text:
package com.zxr.medicalaid.mvp.ui.activities;

import android.content.SharedPreferences;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;
import android.view.View;
import android.widget.EditText;

import com.github.lazylibrary.util.ToastUtils;
import com.zxr.medicalaid.R;
import com.zxr.medicalaid.mvp.presenter.presenterImpl.ChangUserNamePresenterImpl;
import com.zxr.medicalaid.mvp.ui.activities.base.BaseActivity;
import com.zxr.medicalaid.mvp.view.ChangUserNameView;
import com.zxr.medicalaid.net.ResponseCons;
import com.zxr.medicalaid.utils.db.DbUtil;
import com.zxr.medicalaid.utils.db.IdUtil;
import com.zxr.medicalaid.utils.encode.EncodeUtil;
import com.zxr.medicalaid.utils.system.ActivityStack;
import com.zxr.medicalaid.utils.system.ToActivityUtil;
import com.zxr.medicalaid.widget.CircleImageView;

import java.util.List;

import javax.inject.Inject;

import butterknife.InjectView;
import butterknife.OnClick;
import cn.finalteam.galleryfinal.GalleryFinal;
import cn.finalteam.galleryfinal.model.PhotoInfo;

/**
 * Created by 猿人 on 2017/7/7.
 */

public class UserInfoEditActivity extends BaseActivity implements ChangUserNameView {
    private static final int REQUEST_CODE_GALLERY = 1;
    @InjectView(R.id.circleImageView)
    CircleImageView mUserImage;
    @InjectView(R.id.nick_name)
    EditText mUserName;
    @InjectView(R.id.toolbar)
    Toolbar mToolbar;

    private boolean hasChanged = false;

    @Inject
    ChangUserNamePresenterImpl mPresenter;

    @Override
    public void initInjector() {
        mActivityComponent.inject(this);
        mPresenter.injectView(this);
    }

    @Override
    public void initViews() {
        setSupportActionBar(mToolbar);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        getSupportActionBar().setDisplayShowTitleEnabled(false);
        mToolbar.setTitle(R.string.setting);
        mToolbar.setTitleTextColor(Color.WHITE);

        //最开始设置姓名编辑光标不现实
        mUserName.setCursorVisible(false);
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case android.R.id.home:
                finish();
                break;
        }
        return super.onOptionsItemSelected(item);
    }

    @Override
    public int getLayout() {
        return R.layout.activity_userinfo_edit;
    }

    @OnClick({R.id.head_relative, R.id.name_relative, R.id.log_off, R.id.password_relative,R.id.medical_date_setting_relative, R.id.finish_bt})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.head_relative:
                mUserName.setCursorVisible(false);
                GalleryFinal.openGallerySingle(REQUEST_CODE_GALLERY, mOnHandlerResultCallback);
                break;
            case R.id.name_relative:
                mUserName.setCursorVisible(true);
                mUserName.requestFocus();
                break;
            case R.id.password_relative:
                mUserName.setCursorVisible(false);
                ToActivityUtil.toNextActivity(this, PasswordEditActivity.class);
                break;
            case R.id.finish_bt:
                mUserName.setCursorVisible(false);
                //进行头像和姓名修改等上传
                String changName = mUserName.getText().toString();
                String newName = EncodeUtil.doEncrypt(changName, ResponseCons.KEY_NAME);
                if (changName == null || changName.equals("")){
                    ToastUtils.showToast(this,"暂未进行修改呢");
                    return;
                }
                mPresenter.changUserName(IdUtil.getIdString(),newName);
                break;
            case R.id.medical_date_setting_relative:
                ToActivityUtil.toNextActivity(this,MedicalDateSettingActivity.class);
                break;
            case R.id.log_off:
                mUserName.setCursorVisible(false);
                DbUtil.getDaosession().getUserDao().deleteAll();
                DbUtil.getDaosession().getMedicalDateInfoDao().deleteAll();
                DbUtil.getDaosession().getDateDao().deleteAll();
                DbUtil.getDaosession().getMedicalListDao().deleteAll();
                ToActivityUtil.toNextActivity(this, LoginActivity.class);
                ActivityStack.getScreenManager().clearAllActivity();
                SharedPreferences preferences =getSharedPreferences("isConnect",MODE_PRIVATE);
                SharedPreferences.Editor editor = preferences.edit();
                editor.clear();
                editor.commit();
                //同时进行一些数据清除,如数据库的清理
                break;
        }
    }

    private GalleryFinal.OnHanlderResultCallback mOnHandlerResultCallback = new GalleryFinal.OnHanlderResultCallback() {
        @Override
        public void onHanlderSuccess(int reqeustCode, List<PhotoInfo> resultList) {
            //进行图片上传与置换
            //置换
            hasChanged = true;
            ToastUtils.showToast(UserInfoEditActivity.this, "取得照片");
            String photoPath = resultList.get(0).getPhotoPath();
            mUserImage.setImageBitmap(BitmapFactory.decodeFile(photoPath));
            //上传
            //上传时记得压缩
        }

        @Override
        public void onHanlderFailure(int requestCode, String errorMsg) {
            ToastUtils.showToast(UserInfoEditActivity.this, errorMsg);
        }
    };

    @Override
    public void showProgress() {

    }

    @Override
    public void hideProgress() {

    }

    @Override
    public void showMsg(String msg) {
        ToastUtils.showToast(this,msg);
    }
}


text:
<?php
namespace Acme\PaymentBundle\Controller;

use Acme\PaymentBundle\Entity\Payout;
use Payum\Core\Payum;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Form\Form;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Validator\Constraints\Email;
use Symfony\Component\Validator\Constraints\Range;
use Sensio\Bundle\FrameworkExtraBundle\Configuration as Extra;

class PayoutPaypalMasspayController extends Controller
{
    /**
     * @Extra\Route("/paypal/masspay/prepare", name="acme_paypal_masspay_prepare")
     */
    public function prepareAction(Request $request)
    {
        $gatewayName = 'paypal_masspay';

        $form = $this->createPurchasePlusCreditCardForm();
        $form->handleRequest($request);
        if ($form->isValid()) {
            $data = $form->getData();

            $storage = $this->getPayum()->getStorage(Payout::class);

            /** @var Payout $payout */
            $payout = $storage->create();
            $payout->setRecipientEmail($data['recipient_email']);
            $payout->setCurrencyCode($data['currency']);
            $payout->setTotalAmount($data['amount']);
            $storage->update($payout);

            $captureToken = $this->getPayum()->getTokenFactory()->createPayoutToken(
                $gatewayName,
                $payout,
                'acme_payment_done'
            );

            return $this->redirect($captureToken->getTargetUrl());
        }

        return $this->render('AcmePaymentBundle::prepare.html.twig', [
            'form' => $form->createView()
        ]);
    }

    /**
     * @return Form
     */
    protected function createPurchasePlusCreditCardForm()
    {
        return $this->createFormBuilder()
            ->add('amount', null, [
                'data' => 150,
                'constraints' => [new Range(['max' => 200])]
            ])
            ->add('currency', null, ['data' => 'USD'])
            ->add('recipient_email', null, [
                'data' => $this->container->getParameter('paypal.express_checkout.usd_testuser_login'),
                'constraints' => [new Email]
            ])

            ->getForm()
        ;
    }

    /**
     * @return Payum
     */
    protected function getPayum()
    {
        return $this->get('payum');
    }
}

redpajama_set_name: RedPajamaGithub


text:
require("menu")
require("levelchooser")
require("game")
require("guistack")
require("keys")
require("windialog")
require("about")

local graph = love.graphics

function love.load()
  graph.setBackgroundColor(245, 245, 245)
  font_load()
  guistack_create()
  mainmenu_create()
  about_create()
  windialog_create()
  levelchooser_create()
  guistack_push({ update = mainmenu_update, draw = mainmenu_draw })
  --game_create()
end

function love.mousepressed(b, x, y)
  fingerclicked = true
end

function love.mousereleased(b, x, y)
  fingerreleased = true
end

function love.keypressed(k, isrepeated)
  if k == "escape" then
    returnpressed = true
  elseif k == "menu" then
    menupressed = true
  end
end

function love.keyreleased(k)
  if k == "escape" then
    returnreleased = true
  elseif k == "menu" then
    menureleased = true
  end
end

function love.update(dt)
  guistack_update(dt)
  if returnreleased then
    guistack_popanimated()
  end
  if menureleased then
    guistack_create()
    guistack_push({ update = mainmenu_update, draw = mainmenu_draw })
  end
  fingerclicked = false
  fingerreleased = false
  keys_setdefault()
end

function love.draw()
  guistack_draw()
end


text:
package org.springframework.security.oauth.consumer;

/**
 * Thrown when an attempt is made to use an unverified request token.
 *
 *

 * @deprecated The OAuth 1.0 Protocol RFC 5849 is obsoleted by the OAuth 2.0 Authorization Framework RFC 6749.
 *
 * @author Ryan Heaton
 */
@SuppressWarnings("serial")
@Deprecated
public class UnverifiedRequestTokenException extends OAuthRequestFailedException {

  public UnverifiedRequestTokenException(String msg) {
    super(msg);
  }

  public UnverifiedRequestTokenException(String msg, Throwable t) {
    super(msg, t);
  }
}


text:
Spreadsheet Like JavaScript Grid

        In version 1.3 a new feature was introduced that allows to create spreadsheet like grids. Some functionality comes by default and other
        can be extended with events.

Editable cells (start typing or click enter)

Keyboard or mouse selection (user shift and arrow keys)

Copy/paste to/from other spreadsheets

Custom Ranges

Selection Expansion

<button class="w2ui-btn" onclick="mark()">Mark Range C3:D7</button>
<button class="w2ui-btn" onclick="w2ui.grid.removeRange('range')">Remove Range</button>

<button class="w2ui-btn" onclick="cellFormat(true)">Cell Format</button>
<button class="w2ui-btn" onclick="cellFormat(false)">Remove Cell Format</button>


text:
package io.microgenie.service.commands;

import io.dropwizard.cli.ConfiguredCommand;
import io.dropwizard.setup.Bootstrap;
import io.microgenie.application.events.Event;
import io.microgenie.application.events.EventFactory;
import io.microgenie.application.events.EventHandler;
import io.microgenie.application.events.Subscriber;
import io.microgenie.aws.kinesis.KinesisEventFactory;
import io.microgenie.service.AppConfiguration;
import io.microgenie.service.commands.CommandConfiguration.KinesisConsumerConfig;

import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;

import net.sourceforge.argparse4j.inf.Namespace;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.amazonaws.services.cloudwatch.AmazonCloudWatchClient;
import com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient;
import com.amazonaws.services.kinesis.AmazonKinesisClient;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.base.Preconditions;

/***
 *
 * @author shawn
 *
 */
public class KinesisConsumerCommand extends ConfiguredCommand<AppConfiguration> {

	private static final Logger LOGGER = LoggerFactory.getLogger(KinesisConsumerCommand.class);
	public KinesisConsumerCommand() {
		this("consume", "A command to consume from a kinesis topic");
	}
	protected KinesisConsumerCommand(String name, String description) {
		super(name, description);
	}
	/***
	 * Run the command to consume from a kinesis topic. This requires a configuration file that is able to load
	 * the an instance of KinesisConsumerConfig
	 */
	@Override
	protected void run(final Bootstrap<AppConfiguration> bootstrap,final Namespace namespace, final AppConfiguration configuration) throws Exception {

		Preconditions.checkNotNull(configuration.getCommands(), "the commands section must be configured in your yml configuration file");
		Preconditions.checkNotNull(configuration.getCommands().getKinesisConsumer(), "the kinesis consumer must be configured in your configuration file to run the kinesis consumer");
		Preconditions.checkNotNull(configuration.getCommands().getKinesisConsumer().getClientId(), "Kinesis consumer client id is required");
		Preconditions.checkNotNull(configuration.getCommands().getKinesisConsumer().getTopic(), "Kinesis consumer topic is required in your yaml configuration file");

		final KinesisConsumerConfig config = configuration.getCommands().getKinesisConsumer();

		final AmazonKinesisClient kinesis = new AmazonKinesisClient();
		final AmazonDynamoDBClient dynamodb = new AmazonDynamoDBClient();
		final AmazonCloudWatchClient cloudwatch = new AmazonCloudWatchClient();

		/** start the kinesis consumer **/
		try(EventFactory events = new KinesisEventFactory(kinesis, dynamodb, cloudwatch, bootstrap.getObjectMapper())){

			final KinesisConsumerConfig kinesisConfig = configuration.getCommands().getKinesisConsumer();
			LOGGER.info("configuring kinesis consumer for clientId: {} - topicId: {}", config.getClientId(), config.getTopic());

			final TopicConsumer consumer = new TopicConsumer(events.createSubscriber(kinesisConfig.getClientId(), kinesisConfig.getTopic()), bootstrap.getObjectMapper());
			final Thread thread = new Thread(consumer);

			LOGGER.info("starting consumer for client: {} - topic: {}", config.getClientId(), config.getTopic());
			thread.start();
			thread.join();

		}catch(Exception ex){
			LOGGER.error(ex.getMessage(), ex);
		}finally{
			LOGGER.info("shutting down consumer - client: {} - topic: {}", config.getClientId(), config.getTopic());
			kinesis.shutdown();
			dynamodb.shutdown();
			cloudwatch.shutdown();
		}
	}

	/**
	 * @author shawn
	 */
	public static final class TopicConsumer implements Runnable{
		private static final Logger LOGGER = LoggerFactory.getLogger(TopicConsumer.class);
		private final Subscriber subscriber;
		private final ObjectMapper mapper;

		private final AtomicBoolean running = new AtomicBoolean();

		public TopicConsumer(final Subscriber subscriber, final ObjectMapper mapper) {
			Preconditions.checkNotNull(subscriber, "No nulls allowed - subscriber was null");
			Preconditions.checkNotNull(subscriber, "No nulls allowed - objectMapper was null");
			this.subscriber = subscriber;
			this.mapper = mapper;
		}

		/***
		 * Run the consumer
		 */
		@Override
		public void run() {
			try{
				if(this.running.getAndSet(true)){
					LOGGER.info("Consumer is already in a running state, ignoring the call to run");
					return;
				}
				subscriber.subscribe(new LogHandler(mapper));
				while(running.get()){
					try {
						Thread.sleep(2000); //Check back every two seconds
					} catch (InterruptedException e) {
						running.set(false);
						LOGGER.error(e.getMessage(), e);
					}
				}
				LOGGER.info("exisiting consumer gracefully for consumption of topic: {}", subscriber.getTopic());
			}finally{
				subscriber.stop(); // Stop the consuming thread
				running.set(false);
			}
		}

		/**
		 * stop the consumer
		 * @throws InterruptedException
		 */
		public void stop() throws InterruptedException {
			this.running.set(false);
		}

		/***
		 * Append events to the local log
		 *
		 * @author shawn
		 *
		 */
		public static class LogHandler implements EventHandler {
			private ObjectMapper mapper;

			public LogHandler(final ObjectMapper mapper) {
				this.mapper = mapper;
			}
			@Override
			public void handle(Event event) {
				try {
					LOGGER.info("consumed kinesis event - eventId: {} - topic: {} - key: {} - eventData: {}",
							event.getId(), event.getTopic(), event.getPartitionKey(), this.mapper.writeValueAsString(event.getEventData()));
				} catch (Exception ex) {
					LOGGER.error(ex.getMessage(), ex);
				}
			}
			@Override
			public void handle(List<Event> events) {
				for (Event event : events) {
					handle(event);
				}
			}
		}
	}
}


text:
FILE *open_stream(int file_descriptor[2], int to_open) {
	FILE *stream;
	char mode[1];
	mode[0] = to_open ? 'w' : 'r';

	// Don't need this end anymore
	close(file_descriptor[1 - to_open]);

	// Open a stream to the other end
	stream = fdopen(file_descriptor[to_open], mode);

	if (stream == NULL) {
		throw("Could not open stream for reading");
	}

	return stream;
}

void client_communicate(int file_descriptors[2], struct Arguments *args) {
	struct sigaction signal_action;
	FILE *stream;
	void *buffer;

	stream = open_stream(file_descriptors, 0);
	setup_client_signals(&signal_action);
	buffer = malloc(args->size);

	// Set things in motion
	notify_server();

	for (; args->count > 0; --args->count) {
		wait_for_signal(&signal_action);

		if (fread(buffer, args->size, 1, stream) == -1) {
			throw("Error reading from pipe");
		}

		notify_server();
	}

	// Now close the write end too
	close(file_descriptors[1]);
	free(buffer);
}

void server_communicate(int file_descriptors[2], struct Arguments *args) {
	struct sigaction signal_action;
	struct Benchmarks bench;
	FILE *stream;
	void *buffer;
	int message;

	stream = open_stream(file_descriptors, 1);
	setup_server_signals(&signal_action);
	buffer = malloc(args->size);
	setup_benchmarks(&bench);

	wait_for_signal(&signal_action);

	for (message = 0; message < args->count; ++message) {
		bench.single_start = now();

		if (fwrite(buffer, args->size, 1, stream) == -1) {
			throw("Error writing to pipe");
		}
		// Send immediately
		fflush(stream);

		notify_client();
		wait_for_signal(&signal_action);
		benchmark(&bench);
	}

	evaluate(&bench, args);

	// Now close the write end too
	close(file_descriptors[1]);
	free(buffer);
}

void communicate(int file_descriptors[2], struct Arguments *args) {
	// For the process ID of the spawned child process
	pid_t pid;

	// Fork a child process
	if ((pid = fork()) == -1) {
		throw("Error forking process");
	}

	// fork() returns 0 for the child process
	if (pid == (pid_t)0) {
		client_communicate(file_descriptors, args);
	}

	else {
		server_communicate(file_descriptors, args);
	}
}

int main(int argc, char *argv[]) {
	// The call to pipe will return two file descriptors
	// for the read and write end of the pipe, respectively
	int file_descriptors[2];

	struct Arguments args;

	// check_flag("help", argc, argv);
	parse_arguments(&args, argc, argv);

	// The call that creates a new pipe object and places two
	// valid file descriptors in the array we pass it. The first
	// entry at [0] is the read end (from which you read) and
	// second entry at [1] is the write end (to which you write)
	// Note that these file descriptors will only be visible to
	// the current process and any children it spawns. This is
	// mainly what distinguishes pipes from FIFOs (named pipes)
	if (pipe(file_descriptors) < 0) {
		throw("Error opening pipe!\n");
	}

	communicate(file_descriptors, &args);

	return EXIT_SUCCESS;
}


text:
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
 *
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * The Original Code is the Netscape Portable Runtime (NSPR).
 *
 * The Initial Developer of the Original Code is
 * Netscape Communications Corporation.
 * Portions created by the Initial Developer are Copyright (C) 1998-2000
 * the Initial Developer. All Rights Reserved.
 *
 * Contributor(s):
 *
 * Alternatively, the contents of this file may be used under the terms of
 * either the GNU General Public License Version 2 or later (the "GPL"), or
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 * in which case the provisions of the GPL or the LGPL are applicable instead
 * of those above. If you wish to allow use of your version of this file only
 * under the terms of either the GPL or the LGPL, and not to allow others to
 * use your version of this file under the terms of the MPL, indicate your
 * decision by deleting the provisions above and replace them with the notice
 * and other provisions required by the GPL or the LGPL. If you do not delete
 * the provisions above, a recipient may use your version of this file under
 * the terms of any one of the MPL, the GPL or the LGPL.
 *
 * ***** END LICENSE BLOCK ***** */

#ifndef nspr_cpucfg___
#define nspr_cpucfg___

#ifndef XP_UNIX
#define XP_UNIX
#endif

#ifndef SOLARIS
#define SOLARIS
#endif

#define PR_AF_INET6 26  /* same as AF_INET6 */

#if defined(sparc) || defined(__sparc)
#undef  IS_LITTLE_ENDIAN
#define IS_BIG_ENDIAN 1
#define PR_ALIGN_OF_INT64   8
#define PR_ALIGN_OF_DOUBLE  8
#if defined(__sparcv9)
#define IS_64
#endif
#elif defined(__x86_64)
#define IS_LITTLE_ENDIAN 1
#undef  IS_BIG_ENDIAN
#define PR_ALIGN_OF_INT64   8
#define PR_ALIGN_OF_DOUBLE  8
#define IS_64
#elif defined(i386) || defined(__i386)
#define IS_LITTLE_ENDIAN 1
#undef  IS_BIG_ENDIAN
#define PR_ALIGN_OF_INT64   4
#define PR_ALIGN_OF_DOUBLE  4
#else
#error unknown processor
#endif

#ifdef IS_64

#define PR_BYTES_PER_BYTE   1
#define PR_BYTES_PER_SHORT  2
#define PR_BYTES_PER_INT    4
#define PR_BYTES_PER_INT64  8
#define PR_BYTES_PER_LONG   8
#define PR_BYTES_PER_FLOAT  4
#define PR_BYTES_PER_DOUBLE 8
#define PR_BYTES_PER_WORD   8
#define PR_BYTES_PER_DWORD  8
#define PR_BYTES_PER_WORD_LOG2   3
#define PR_BYTES_PER_DWORD_LOG2  3

#define PR_BITS_PER_BYTE    8
#define PR_BITS_PER_SHORT   16
#define PR_BITS_PER_INT     32
#define PR_BITS_PER_INT64   64
#define PR_BITS_PER_LONG    64
#define PR_BITS_PER_FLOAT   32
#define PR_BITS_PER_DOUBLE  64
#define PR_BITS_PER_WORD    64

#define PR_BITS_PER_BYTE_LOG2   3
#define PR_BITS_PER_SHORT_LOG2  4
#define PR_BITS_PER_INT_LOG2    5
#define PR_BITS_PER_INT64_LOG2  6
#define PR_BITS_PER_LONG_LOG2   6
#define PR_BITS_PER_FLOAT_LOG2  5
#define PR_BITS_PER_DOUBLE_LOG2 6
#define PR_BITS_PER_WORD_LOG2   6

#define PR_ALIGN_OF_SHORT   2
#define PR_ALIGN_OF_INT     4
#define PR_ALIGN_OF_LONG    8
#define PR_ALIGN_OF_FLOAT   4
#define PR_ALIGN_OF_POINTER 8

#else /* IS_64 */

#define PR_BYTES_PER_BYTE   1
#define PR_BYTES_PER_SHORT  2
#define PR_BYTES_PER_INT    4
#define PR_BYTES_PER_INT64  8
#define PR_BYTES_PER_LONG   4
#define PR_BYTES_PER_FLOAT  4
#define PR_BYTES_PER_DOUBLE 8
#define PR_BYTES_PER_WORD   4
#define PR_BYTES_PER_DWORD  8
#define PR_BYTES_PER_WORD_LOG2   2
#define PR_BYTES_PER_DWORD_LOG2  3

#define PR_BITS_PER_BYTE    8
#define PR_BITS_PER_SHORT   16
#define PR_BITS_PER_INT     32
#define PR_BITS_PER_INT64   64
#define PR_BITS_PER_LONG    32
#define PR_BITS_PER_FLOAT   32
#define PR_BITS_PER_DOUBLE  64
#define PR_BITS_PER_WORD    32

#define PR_BITS_PER_BYTE_LOG2   3
#define PR_BITS_PER_SHORT_LOG2  4
#define PR_BITS_PER_INT_LOG2    5
#define PR_BITS_PER_INT64_LOG2  6
#define PR_BITS_PER_LONG_LOG2   5
#define PR_BITS_PER_FLOAT_LOG2  5
#define PR_BITS_PER_DOUBLE_LOG2 6
#define PR_BITS_PER_WORD_LOG2   5

#define PR_ALIGN_OF_SHORT   2
#define PR_ALIGN_OF_INT     4
#define PR_ALIGN_OF_LONG    4
#define PR_ALIGN_OF_FLOAT   4
#define PR_ALIGN_OF_POINTER 4

#endif /* IS_64 */

#ifndef HAVE_LONG_LONG
#define	HAVE_LONG_LONG
#endif
#define	HAVE_ALIGNED_DOUBLES
#define	HAVE_ALIGNED_LONGLONGS

#ifndef NO_NSPR_10_SUPPORT

#define BYTES_PER_BYTE		PR_BYTES_PER_BYTE
#define BYTES_PER_SHORT 	PR_BYTES_PER_SHORT
#define BYTES_PER_INT 		PR_BYTES_PER_INT
#define BYTES_PER_INT64		PR_BYTES_PER_INT64
#define BYTES_PER_LONG		PR_BYTES_PER_LONG
#define BYTES_PER_FLOAT		PR_BYTES_PER_FLOAT
#define BYTES_PER_DOUBLE	PR_BYTES_PER_DOUBLE
#define BYTES_PER_WORD		PR_BYTES_PER_WORD
#define BYTES_PER_DWORD		PR_BYTES_PER_DWORD

#define BITS_PER_BYTE		PR_BITS_PER_BYTE
#define BITS_PER_SHORT		PR_BITS_PER_SHORT
#define BITS_PER_INT		PR_BITS_PER_INT
#define BITS_PER_INT64		PR_BITS_PER_INT64
#define BITS_PER_LONG		PR_BITS_PER_LONG
#define BITS_PER_FLOAT		PR_BITS_PER_FLOAT
#define BITS_PER_DOUBLE		PR_BITS_PER_DOUBLE
#define BITS_PER_WORD		PR_BITS_PER_WORD

#define BITS_PER_BYTE_LOG2	PR_BITS_PER_BYTE_LOG2
#define BITS_PER_SHORT_LOG2	PR_BITS_PER_SHORT_LOG2
#define BITS_PER_INT_LOG2	PR_BITS_PER_INT_LOG2
#define BITS_PER_INT64_LOG2	PR_BITS_PER_INT64_LOG2
#define BITS_PER_LONG_LOG2	PR_BITS_PER_LONG_LOG2
#define BITS_PER_FLOAT_LOG2	PR_BITS_PER_FLOAT_LOG2
#define BITS_PER_DOUBLE_LOG2 	PR_BITS_PER_DOUBLE_LOG2
#define BITS_PER_WORD_LOG2	PR_BITS_PER_WORD_LOG2

#define ALIGN_OF_SHORT		PR_ALIGN_OF_SHORT
#define ALIGN_OF_INT		PR_ALIGN_OF_INT
#define ALIGN_OF_LONG		PR_ALIGN_OF_LONG
#define ALIGN_OF_INT64		PR_ALIGN_OF_INT64
#define ALIGN_OF_FLOAT		PR_ALIGN_OF_FLOAT
#define ALIGN_OF_DOUBLE		PR_ALIGN_OF_DOUBLE
#define ALIGN_OF_POINTER	PR_ALIGN_OF_POINTER
#define ALIGN_OF_WORD		PR_ALIGN_OF_WORD

#define BYTES_PER_WORD_LOG2	PR_BYTES_PER_WORD_LOG2
#define BYTES_PER_DWORD_LOG2	PR_BYTES_PER_DWORD_LOG2
#define WORDS_PER_DWORD_LOG2	PR_WORDS_PER_DWORD_LOG2

#endif /* NO_NSPR_10_SUPPORT */

#endif /* ifndef nspr_cpucfg___ */


text:
module Umpire
  class Engine < ::Rails::Engine
  end
end


text:
using System.Configuration;
using NWebsec.Core.Common.HttpHeaders.Configuration;

namespace NWebsec.Modules.Configuration.Csp
{
    public class CspUpgradeDirectiveConfigurationElement : ConfigurationElement, ICspUpgradeDirectiveConfiguration
    {

        [ConfigurationProperty("enabled", IsRequired = true, DefaultValue = false)]
        public bool Enabled
        {
            get => (bool)this["enabled"];
            set => this["enabled"] = value;
        }

        [ConfigurationProperty("httpsPort", IsRequired = false, DefaultValue = 443)]
        [IntegerValidator(MinValue = 1, MaxValue = 65535)]
        public int HttpsPort
        {
            get => (int)this["httpsPort"];
            set => this["httpsPort"] = value;
        }
    }
}


text:
FOUNDATION_EXPORT NSString *const kMDFPaymentCardUSDescriptionTemplate;

@interface MDFPaymentCardUS : NSObject <MDFPaymentCard>

@property NSString *creditCardNumber;
@property NSString *creditCardVerification;
@property NSUInteger expirationDateMonth;
@property NSUInteger expirationDateYear;
@property NSString *cardHolderName;

+ (MDFPaymentCardUS *)paymentCardWithNumber:(NSString *)cardNumber ccv:(NSString *)ccv expirationMonth:(NSUInteger)expirationMonth expirationYear:(NSUInteger)expirationYear cardHolderName:(NSString *)cardHolderName;

- (BOOL)isEqualToPaymentCard:(id<MDFPaymentCard>)paymentCard;

- (NSUInteger)majorIndustryIdentifier;

@end

#endif


text:
# SVComing-Soon
SVComing Soon is free responsive, simple, clean and mobile friendly coming soon site bootstrap template. Included in the template is a countdown timer, foneawesome icons with 14 background images.

https://github.com/hilios/jQuery.countdown

http://fontawesome.io/

There is no specific reason to font awesome icons, you can use bootstrap default icons also.

http://getbootstrap.com/components/

All images are download from unsplash with CCO License (https://unsplash.com/license).

To change background image, click on ⚙ icon.

To customize, countertime, then change code in js/app.js

$('#counter-block').countdown('2018/01/01', function(event) {
        var $this = $(this).html(event.strftime(''
    /*+ '%w weeks  '*/
    + '%D days  '
    + '%H hrs  '
    + '%M mins  '
    + '%S secs '));
      });


text: Contributing notes will be moved here, since then, please use contribution notes on github


text:
/**
 *
 * Created by Playground Milano
 *
 */

"use strict";

angular.module("playground-tabs-details", []).config(PlaygroundTabsDetailsConfig);
PlaygroundTabsDetailsConfig.$inject = ["$stateProvider"];

function PlaygroundTabsDetailsConfig($stateProvider) {

    $stateProvider
        .state("playground.details", {
            url: "/dettaglio-del-campo",
            parent: "playground",
            title: "Campo",
            resolve: {
                load: ["$q", "$ocLazyLoad", function ($q, $ocLazyLoad) {
                    var deferred = $q.defer();
                    require.ensure([], function (require) {
                            var module = require("./_controller/PlaygroundTabsDetailsController");
                            $ocLazyLoad.load({name: "playground-tabs-details.controller"});
                            deferred.resolve(module);
                        }
                    );
                    return deferred.promise;
                }],
                playgroundDetailsResponse: ["HttpWrapper", function (HttpWrapper) {
                    return HttpWrapper("GET", "playgrounds:idPlayground");
                }]
            },
            views: {
                home: {
                    controller: "PlaygroundTabsDetailsController",
                    templateProvider: ["$q", function ($q) {
                        var deferred = $q.defer();
                        require.ensure([], function (require) {
                                var template = require("./_views/details.html");
                                deferred.resolve(template);
                            }
                        );
                        return deferred.promise;
                    }]
                }
            }
        });

}


text:
/*!
\ingroup PkgMinkowskiSum2Concepts
\cgalConcept

A model of the `PolygonConvexDecomposition_2` concept is capable of
decomposing an input polygon \f$ P\f$ into a set of convex sub-polygons
\f$ P_1, \ldots, P_k\f$, such that \f$ \cup_{i=1}^{k}{P_k} = P\f$.

\cgalHasModel `CGAL::Small_side_angle_bisector_decomposition_2<Kernel,Container>`
\cgalHasModel `CGAL::Optimal_convex_decomposition_2<Kernel,Container>`
\cgalHasModel `CGAL::Hertel_Mehlhorn_convex_decomposition_2<Kernel,Container>`
\cgalHasModel `CGAL::Greene_convex_decomposition_2<Kernel,Container>`

*/

class PolygonConvexDecomposition_2 {
public:

  /// \name Types
  /// @{

  /*! the geometric kernel type. */
  typedef unspecified_type Kernel;

  /*! the container of points type. By default it is
   * `std::vector<typename Kernel::Point_2>`.
   */
  typedef unspecified_type Container;

  /*! the point type, used to represent polygon vertices. */
  typedef unspecified_type Point_2;

  /*! the polygon type, defined as `Polygon_2<Kernel,Container>`. */
  typedef unspecified_type Polygon_2;

  /// @}

  /// \name Creation
  /// @{

  /*! default constructor. */
  PolygonConvexDecomposition_2();

  /// @}

  /// \name Operations
  /// @{

  /*! decomposes the input polygon `P` into convex sub-polygons,
   * and writes them to the output iterator `oi`. The value-type of the
   * output iterator must be `Polygon_2`.
   * The function returns a past-the-end iterator for the convex sub-polygons.
   */
  template <class OutputIterator>
  OutputIterator operator()(const Polygon_2& P, OutputIterator oi) const;

  /// @}

}; /* end PolygonConvexDecomposition_2 */


text:
'use strict';

angular.module('sustainableSeafoodWebApp')
  .factory('Seafood', function ($resource, API) {
    var url = API.endpoint;
    return $resource(url + '/seafoods/:id', { id: '@_id' });
  });


text:
Creating a website for Dre's Coffee Shop

Link: Dre's Coffee


text:
div.timetableHeader {
  padding: 20px 5px 10px 5px;
  margin-top: 20px;
  border-bottom: 2px solid #777;
  font-size: 20px;
  color: rgb(68, 68, 68);
  background: white;
}

div.timetableFullScreenHeader {
  padding: 5px 5px 5px 5px;
  margin-top: 20px;
  border-bottom: 1px solid black;
  font-size: 20px;
  color: rgb(68, 68, 68);
  text-align: center;
  background: white;
}

.timetableInfoBox {
  margin: 17px 10px;
  color: #444;
  font-family: Verdana, sans-serif;
  -moz-border-radius: 5px;
  -webkit-border-radius: 5px;
  border-radius: 5px;
}

.timetableBlock {
  cursor: pointer;
  border: 1px solid #bbb;
  border-radius: 3px;
  -moz-border-radius: 3px;
  -webkit-border-radius: 3px;
  color: #202020;
  box-shadow: 0 0 5px #ddd;
  min-height: 26px;
}

.timetableBlockPileEffect {
  border-bottom: none;
  margin: 1px -1px;
  box-shadow: none !important;
  height: 3px;
  min-height: 0 !important;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

div.timetableContribution {
  background-color: #f8f2e8;
}

/* Timetable drag n drop */
#tt_hour_tip {
  cursor: pointer;
  overflow: auto;
  background: white;
  position: absolute;
  z-index: 1;
}

#tt_hour_tip:hover {
  opacity: 0.7;
}

.hourLine {
  position: absolute;
  border-top: 1px solid #e8e8e8;
  font-size: 11px;
}

.ui-state-disabled.hourLine {
  opacity: 1 !important;
}

.ui-droppable-disabled {
  opacity: 0.7 !important;
}

.key {
  display: inline;
  min-width: 1em;
  padding: 0.2em 0.3em;
  text-align: center;
  -moz-border-radius: 0.3em;
  -webkit-border-radius: 0.3em;
  border-radius: 0.3em;
  border: none;
  cursor: default;
  background: rgb(250, 250, 250);
  color: rgb(50, 50, 50);
  text-shadow: 0 0 2px rgb(255, 255, 255);
  -moz-box-shadow: inset 0 0 1px rgb(255, 255, 255), inset 0 0 0.4em rgb(200, 200, 200),
    0 0.1em 0 rgb(130, 130, 130), 0 0.11em 0 rgba(0, 0, 0, 0.4), 0 0.1em 0.11em rgba(0, 0, 0, 0.9);
  -webkit-box-shadow: inset 0 0 1px rgb(255, 255, 255), inset 0 0 0.4em rgb(200, 200, 200),
    0 0.1em 0 rgb(130, 130, 130), 0 0.11em 0 rgba(0, 0, 0, 0.4), 0 0.1em 0.11em rgba(0, 0, 0, 0.9);
  box-shadow: inset 0 0 1px rgb(255, 255, 255), inset 0 0 0.4em rgb(200, 200, 200),
    0 0.1em 0 rgb(130, 130, 130), 0 0.11em 0 rgba(0, 0, 0, 0.4), 0 0.1em 0.11em rgba(0, 0, 0, 0.9);
}

div.ui-draggable.timetableBlock:hover {
  cursor: move;
}

div.ui-draggable-dragging.timetableBlock {
  z-index: 9000;
  opacity: 0.5;
}

div.entry-content {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  overflow: hidden;
  line-height: normal;
  padding: 4px;
}

div.timetableBlockWrapper {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-between;
  margin-right: 4px;
  width: 100%;
}

div.timetableBlockWrapper > * {
  overflow: hidden;
  text-overflow: ellipsis;
}

div.timetableBlockTitle {
  font-weight: bold;
  font-size: 11px;
  order: 1;
}

a.entry-attachments + div.timetableBlockPresenters {
  margin-right: 24px;
}

div.timetableBlockPresenters {
  float: right;
  margin-right: 7px;
  font-size: 11px;
  font-style: italic;
  max-width: 50%;
  order: 2;
}

div.timetableBlockTime {
  margin-right: 7px;
  padding-top: 4px;
  font-size: 11px;
  order: 3;
}

div.timetableBlockTimeDiscreet {
  float: left;
  margin: 4px 7px;
  font-size: 11px;
}

div.timetableBlockLocation {
  bottom: 4px;
  left: 4px;
  font-style: italic;
  padding-top: 4px;
  font-size: 11px;
  order: 2;
}

div.timetableBlockConvener {
  font-style: italic;
  font-size: 11px;
  order: 2;
}

div.timetablePreLoading {
  background: transparent url('static:images/load_big.gif') scroll no-repeat center center;
}

div.timetablePreLoading .text {
  color: #777;
  text-align: center;
  font-family: Verdana, sans-serif;
  letter-spacing: 2px;
}

div.timetableLoading {
  position: absolute;
  top: 40px;
  left: 0;
  padding: 10px 0 6px 35px;
  background: transparent url('static:images/loading.gif') scroll no-repeat 10px center;
  color: #444;
}

.timetableFilter {
  width: 100%;
  position: fixed;
  bottom: 0;
  left: 0;
}

.timetableFilter .content {
  width: 900px;
  margin: 0 auto;
  background: #ececec;
  border: 1px solid #777;
  border-bottom: none;
  position: relative;
}

.timetableFilter .content table {
  background: white;
  width: 100%;
}

.timetableFilter .content td {
  padding: 13px 30px;
  white-space: nowrap;
  background-color: #ececec;
  vertical-align: middle;
  width: 1px;
}

.timetableFilter .closeButton {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 16px;
  height: 16px;
  cursor: pointer;
  background: transparent url('static:images/close_button.png') scroll no-repeat 0 0;
}

.timetableFilter .closeButton:hover {
  background-position: 0 -16px;
}

ul.timetableSectionPopupList ul.subPopupList {
  max-height: 250px;
  overflow-y: auto;
}

div.timetableManagementInfoArea {
  width: 50%;
  background: #ffd;
  border: 1px solid #aaa;
  border-radius: 3px;
  -moz-border-radius: 3px;
  -webkit-border-radius: 3px;
  -moz-box-shadow: 2px 2px 2px #888;
  -webkit-box-shadow: 2px 2px 2px #888;
  box-shadow: 2px 2px 2px #888;
  margin-left: auto;
  margin-right: auto;
  padding: 5px;
  font-size: 11px;
  position: relative;
}

div.timetableManagementInfoArea div {
  padding: 5px;
}

div.timetableManagementInfoArea ul {
  top: 2px;
  padding-left: 10px;
  margin-top: 5px;
  margin-bottom: 10px;
  list-style: none;
  margin-left: 5px;
}

div.timetableManagementInfoArea ul li {
  padding-left: 0;
  overflow: auto;
  margin-bottom: 5px;
}

.printButton,
.printButtonWhite,
.buttonWhite {
  padding: 4px 6px;
  margin-left: 6px;
  cursor: pointer;
}

.printButtonWhite,
.buttonWhite {
  color: white;
}

.printButton {
  padding-left: 20px;
  background: transparent url('static:images/printer_blue.png') scroll no-repeat center left;
}

.printButtonWhite {
  padding-left: 20px;
  background: transparent url('static:images/printer_white.png') scroll no-repeat center left;
}

.linkButtonWhite {
  padding-left: 20px;
  background: transparent url('static:images/link_white.png') scroll no-repeat center left;
}

#tt_menu .go_back .arrow_up {
  color: #aaa;
  margin-right: 5px;
}

div.UnscheduledContribListDiv {
  margin-bottom: 10px;
  height: 300px;
  width: 400px;
  border: 1px solid #ccc;
  overflow: auto;
  margin-top: 10px;
  margin-right: 35px;
}

div.UnscheduledContribListDiv .toolbar {
  border-bottom: 1px solid #ccc;
  text-align: right;
  color: #999;
  padding: 2px;
}

ul.UnscheduledContribList {
  border: none;
  display: block;
  list-style-type: none;
  padding-left: 0;
  margin: 0;
}

ul.UnscheduledContribList li {
  cursor: pointer;
  padding: 5px;
  border-bottom: 1px solid #eee;
}

ul.UnscheduledContribList li.selected {
  background-color: #cdeb8b;
}

div.rescheduleSection {
  padding-bottom: 20px;
}

div.rescheduleTitle {
  font-size: 18px;
  padding-bottom: 5px;
}

tr.selectedAction {
  background-color: #cdeb8b;
}

td.rescheduleAction {
  vertical-align: top;
  padding-bottom: 5px;
  padding-top: 5px;
}

div.rescheduleLabelTitle {
  font-size: 16px;
  cursor: default;
}

label.rescheduleLabelTitle {
  font-weight: normal;
  font-size: 16px;
  color: #444;
}

div.rescheduleLabelDetails {
  font-size: 12px;
  font-style: italic;
  cursor: default;
  color: #888;
}

.rescheduleWarning {
  font-weight: bold;
  color: #812;
}

div.fitInnerTimetableDialog {
  width: 350px;
}


text:
namespace Octokit
{
    public class RepositoryIssueRequest : IssueRequest
    {
        /// <summary>
        /// Identifies a filter for the milestone. Use "*" for issues with any milestone.
        /// Use the milestone number for a specific milestone. Use the value "none" for issues with any milestones.
        /// </summary>
        public string Milestone { get; set; }
    }
}


text:
#include "cparser-iterator.h"

#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION

#include <numpy/arrayobject.h>

void debug_print(char *msg);

void cparser_iter_dealloc(cparser_iter* self)
{
	if (NULL == self) {
		return ;
	}

	Py_CLEAR(self->parent);
	self->ob_type->tp_free((PyObject*) self);
}

PyObject* cparser_rl_iter(PyObject* self)
{
	assert(NULL != self);

	cparser_recordlist* recordlist;
	cparser_iter* iter;

	recordlist = (cparser_recordlist*) self;
	//debug_print("cparser_rl_iter 1");
	iter = cparser_iter_create(recordlist);
	iter->current_index = 0;

	//debug_print("cparser_rl_iter 2");
	return (PyObject*) iter;
}

PyObject* cparser_iter_iter(PyObject* self)
{
	assert(NULL != self);

	cparser_iter* iter = (cparser_iter*) self;

	//debug_print("cparser_iter_iter 1");

	Py_INCREF(self);
	iter->current_index = 0;

	//debug_print("cparser_iter_iter 2");

	return self;
}

static short cparser_iter_idx_passes_filter(cparser_iter* iter, size_t idx)
{
	assert(NULL != iter);

	if (iter->tstamp_range_enabled) {
		short passes_range = recordlist_record_in_range(iter->parent->lst, idx,
		                     iter->range_fields, iter->range_min_tstamp,
		                     iter->range_max_tstamp);

		if (!passes_range) {
			return 0;
		}
	}

	if (iter->equality_filter_enabled) {
		short passes_equal = recordlist_record_equal(iter->parent->lst, idx,
		                     iter->equality_fields, iter->equality_object, iter->equality_object_len);

		if (!passes_equal) {
			return 0;
		}
	}

	return 1;
}

PyObject* cparser_iter_iternext(PyObject* self)
{
	assert(NULL != self);

	cparser_iter* iter = (cparser_iter*) self;
	cparser_recordlist * recordlist;
	cparser_record* record = NULL;
	size_t idx;

	recordlist = iter->parent;
	idx = iter->current_index;

	// If in range filtering mode, discard records that do not pass the filter.
	while (idx < recordlist->lst->total_records && !cparser_iter_idx_passes_filter(iter, idx)) {
		idx++;
	}

	if (idx >= recordlist->lst->total_records) {
		PyErr_SetNone(PyExc_StopIteration);
		return NULL;
	}

	record = cparser_record_create();

	if (record == NULL) {
		return NULL;
	}

	record->lst = recordlist->lst;
	record->index = idx;
	record->tz = recordlist->tz;

	Py_XINCREF(record->tz);

	iter->current_index = idx + 1;

	return (PyObject*) record;
}

PyObject* cparser_iter_field_as_numpy(PyObject* self, PyObject* args)
{
	assert(NULL != self);

	npy_intp arr_dims[1];
	PyArrayObject* array;
	const char* field_name;
	cparser_iter* iter = (cparser_iter*) self;
	cparser_recordlist * recordlist = iter->parent;
	void* src, *dst;
	uint64_t tstamp;
	int64_t* tstamp_dst;
	size_t field_size;
	uint64_t default_tstamp = 0;
	npy_intp dst_i = 0;
	npy_intp _dims[1];
	PyArray_Dims new_dims;

	new_dims.ptr = _dims;
	new_dims.len = 1;

	struct field_spec* field;

	if (!PyArg_ParseTuple(args, "s|L", &field_name, &default_tstamp)) {
		return NULL;
	}

	field = recordlist_get_fieldspec(recordlist->lst, field_name);

	if (field == NULL) {
		return PyErr_Format(PyExc_TypeError, "Unknown field %s", field_name);
	}

	if (field->type->has_variable_size) {
		return PyErr_Format(PyExc_TypeError, "Can't create arrays if field has variable size");
	}

	field_size = rd_base_types_sizes[field->type->storage_type];

	if (iter->length == -1) {
		arr_dims[0] = recordlist->lst->total_records;
	} else {
		arr_dims[0] = iter->length;
	}

	if (field->type->type == TSTAMP) {// Special case
		// We need to specify the units of the timestamp.
		PyObject *dtype_specifier = Py_BuildValue("s", "datetime64[ns]");
		PyArray_Descr *descr;
		PyArray_DescrConverter(dtype_specifier, &descr);

		array = (PyArrayObject*) PyArray_SimpleNewFromDescr(1, arr_dims, descr);

		if (array == NULL) {
			return NULL;
		}

		dst_i = 0;

		for (npy_intp i = 0; i < recordlist->lst->total_records; i++) {
			if (!cparser_iter_idx_passes_filter(iter, i)) {
				continue;
			}

			src = recordlist_get_record_field(recordlist->lst, field, i);
			tstamp_dst = PyArray_GETPTR1(array, dst_i);
			dst_i++;

			tstamp = *((uint64_t*) src);

			if (tstamp == 0 || tstamp == (uint64_t)-1) {
				tstamp = default_tstamp;
			}

			*tstamp_dst = tstamp;
		}
	} else {
		array = (PyArrayObject*) PyArray_SimpleNew(1, arr_dims, storage_type_to_numpy(field->type->storage_type));

		if (array == NULL)
			return NULL;

		dst_i = 0;

		for (npy_intp i = 0; i < recordlist->lst->total_records; i++) {
			if (!cparser_iter_idx_passes_filter(iter, i)) {
				continue;
			}

			src = recordlist_get_record_field(recordlist->lst, field, i);
			dst = PyArray_GETPTR1(array, dst_i);
			dst_i++;

			memcpy(dst, src, field_size);
		}
	}

	_dims[0] = dst_i;

	if (_dims[0] != arr_dims[0]) {
		PyArray_Resize(array, &new_dims, 0, NPY_ANYORDER);
	}

	return (PyObject*) array;
}

PyObject* cparser_iter_field_as_numpy_from_rl(PyObject * self, PyObject * args)
{
	assert(NULL != self);
	assert(NULL != args);

	cparser_iter* iter = cparser_iter_create((cparser_recordlist*) self);
	PyObject* retval = cparser_iter_field_as_numpy((PyObject*) iter, args);

	Py_CLEAR(iter);
	return retval;
}

static cparser_iter* cparser_iter_duplicate(cparser_iter * iter_orig)
{
	assert(NULL != iter_orig);

	cparser_iter* iter = cparser_iter_create(iter_orig->parent);

	if (iter_orig->equality_filter_enabled) {
		iter->equality_filter_enabled = 1;
		iter->equality_object_len = iter_orig->equality_object_len;
		memcpy(iter->equality_object, iter_orig->equality_object, iter->equality_object_len);
		memcpy(iter->equality_fields, iter_orig->equality_fields, (MAX_RANGE_FIELDS + 1) * sizeof(struct field_spec*));
	}

	if (iter_orig->tstamp_range_enabled) {
		iter->tstamp_range_enabled = 1;
		iter->range_max_tstamp = iter_orig->range_max_tstamp;
		iter->range_min_tstamp = iter_orig->range_min_tstamp;
		memcpy(iter->range_fields, iter_orig->range_fields, (MAX_RANGE_FIELDS + 1) * sizeof(struct field_spec*));
	}

	return iter;
}

PyObject* cparser_iter_tstamp_range(PyObject * self, PyObject * args)
{
	assert(NULL != self);

	cparser_iter* iter_orig = (cparser_iter*) self;
	cparser_iter* iter = cparser_iter_duplicate(iter_orig);
	cparser_recordlist * recordlist = iter_orig->parent;
	PyObject * fieldseq, *fieldseq_iter;
	PyObject* str_obj;
	size_t num_fields = 0;
	struct field_spec* field;
	const char* field_name;
	short error = 0;

	if (!PyArg_ParseTuple(args, "LLO", &iter->range_min_tstamp, &iter->range_max_tstamp, &fieldseq)) {
		return NULL;
	}

	fieldseq_iter = PyObject_GetIter(fieldseq);

	if (fieldseq_iter == NULL) {
		return PyErr_Format(PyExc_TypeError, "Argument should be an iterable of strings (it is not iterable)");
	}

	while ((str_obj = PyIter_Next(fieldseq_iter)) != NULL && !error && num_fields < MAX_RANGE_FIELDS) {
		if (!PyString_Check(str_obj)) {
			PyErr_Format(PyExc_TypeError, "Argument should be an iterable of strings (the elements are not strings)");
			error = 1;
		} else {
			field_name = PyString_AS_STRING(str_obj);
			field = recordlist_get_fieldspec(recordlist->lst, field_name);

			if (field == NULL) {
				PyErr_Format(PyExc_TypeError, "Unrecognized field %s", field_name);
				error = 1;
			} else if (field->type->type != TSTAMP) {
				PyErr_Format(PyExc_TypeError, "Only timestamp fields can be used");
				error = 1;
			} else {
				iter->range_fields[num_fields] = field;
				num_fields++;
			}
		}

		Py_DECREF(str_obj);
	}

	Py_DECREF(fieldseq_iter);

	if (error || PyErr_Occurred())
		return NULL;

	iter->range_fields[num_fields] = NULL;
	iter->tstamp_range_enabled = 1;

	return (PyObject*) iter;
}

PyObject* cparser_iter_tstamp_range_from_rl(PyObject * self, PyObject * args)
{
	assert(NULL != self);

	cparser_iter* iter = cparser_iter_create((cparser_recordlist*) self);

	PyObject* retval = cparser_iter_tstamp_range((PyObject*) iter, args);

	Py_CLEAR(iter);
	return retval;
}

PyObject* cparser_iter_filter_field(PyObject * self, PyObject * args)
{
	assert(NULL != self);

	cparser_iter* iter_orig = (cparser_iter*) self;
	cparser_iter* iter = cparser_iter_duplicate(iter_orig);
	cparser_recordlist * recordlist = iter_orig->parent;
	PyObject * fieldseq, *fieldseq_iter, *filter_obj;
	PyObject* str_obj;
	size_t num_fields = 0;
	struct field_spec* field;
	const char* field_name;
	struct rd_type *type = NULL;

	short error = 0;

	if (!PyArg_ParseTuple(args, "OO", &filter_obj, &fieldseq)) {
		return NULL;
	}

	fieldseq_iter = PyObject_GetIter(fieldseq);

	if (fieldseq_iter == NULL) {
		return PyErr_Format(PyExc_TypeError, "Argument should be an iterable of strings (it is not iterable)");
	}

	while ((str_obj = PyIter_Next(fieldseq_iter)) != NULL && !error && num_fields < MAX_RANGE_FIELDS) {
		if (!PyString_Check(str_obj)) {
			PyErr_Format(PyExc_TypeError, "Argument should be an iterable of strings (the elements are not strings)");
			error = 1;
		} else {
			field_name = PyString_AS_STRING(str_obj);
			field = recordlist_get_fieldspec(recordlist->lst, field_name);

			if (field == NULL) {
				PyErr_Format(PyExc_TypeError, "Unrecognized field %s", field_name);
				error = 1;
			} else if (type != NULL && field->type != type) {
				PyErr_Format(PyExc_TypeError, "All the fields must have the same type");
				error = 1;
			} else {
				iter->equality_fields[num_fields] = field;
				num_fields++;
			}

			type = field->type;
		}

		Py_DECREF(str_obj);
	}

	Py_DECREF(fieldseq_iter);

	if (error || PyErr_Occurred()) {
		return NULL;
	}

	iter->equality_fields[num_fields] = NULL;
	iter->equality_filter_enabled = 1;

	iter->equality_object_len = type->from_python(filter_obj, iter->equality_object);
	return (PyObject*) iter;
}

PyObject* cparser_iter_filter_field_from_rl(PyObject * self, PyObject * args)
{
	assert(NULL != self);

	cparser_iter* iter = cparser_iter_create((cparser_recordlist*) self);
	PyObject* retval = cparser_iter_filter_field((PyObject*) iter, args);

	Py_CLEAR(iter);
	return retval;
}

static PyMethodDef cparser_iter_methods[] = {
	{ "tstamp_range", (PyCFunction) cparser_iter_tstamp_range, METH_VARARGS, "Get an iterator for the records in a certain time range.\n Note that timestamps MUST be in nanoseconds!"},
	{ "filter_fields", (PyCFunction) cparser_iter_filter_field, METH_VARARGS, "Get an iterator for the records with some field equal to some value."},
	{ "field_as_numpy", (PyCFunction) cparser_iter_field_as_numpy, METH_VARARGS, "Create a numpy array for the given field."},
	{NULL}  /* Sentinel */
};

PyObject* cparser_iter_get_filtering_range(cparser_iter* self, void* __attribute__((__unused__)) closure)
{
	assert(NULL != self);

	return PyBool_FromLong(self->tstamp_range_enabled);
}

PyObject* cparser_iter_get_filtering_field(cparser_iter* self, void* __attribute__((__unused__)) closure)
{
	assert(NULL != self);

	return PyBool_FromLong(self->equality_filter_enabled);
}

PyObject* cparser_iter_get_min_tstamp(cparser_iter* self, void* __attribute__((__unused__)) closure)
{
	assert(NULL != self);

	return cparser_pandas_tstamp(self->parent->lst->min_tstamp, self->parent->tz);
}

PyObject* cparser_iter_get_max_tstamp(cparser_iter* self, void* __attribute__((__unused__)) closure)
{
	assert(NULL != self);

	return cparser_pandas_tstamp(self->parent->lst->max_tstamp, self->parent->tz);
}

PyObject* cparser_iter_get_tz(cparser_iter* self, void* __attribute__((__unused__)) closure)
{
	assert(NULL != self);

	Py_INCREF(self->parent->tz);
	return self->parent->tz;
}

Py_ssize_t cparser_iter_size(PyObject* self)
{
	assert(NULL != self);

	cparser_iter* iter = (cparser_iter*) self;

	if (iter->length == -1) {
		iter->length = 0;

		for (size_t i = 0; i < iter->parent->lst->total_records; i++) {
			if (cparser_iter_idx_passes_filter(iter, i)) {
				iter->length++;
			}
		}
	}

	return iter->length;
}

static PySequenceMethods cparser_iter_seqmethods = {
	cparser_iter_size, /* sq_length */
	0,                 /* sq_concat */
	0,                 /* sq_repeat */
	0,                 /* sq_item   */
	0,                 /* sq_ass_item */
	0,                 /* sq_contains */
	0,                 /* sq_inplace_concat */
	0                  /* sq_inplace_repeat */
};

static PyGetSetDef cparser_iter_getsetters[] = {
	{"is_filtering_range", (getter)cparser_iter_get_filtering_range, NULL,  NULL},
	{"is_filtering_field", (getter)cparser_iter_get_filtering_field, NULL,  NULL},
	{"min_timestamp", (getter)cparser_iter_get_min_tstamp, NULL,  NULL},
	{"max_timestamp", (getter)cparser_iter_get_max_tstamp, NULL,  NULL},
	{"tz", (getter)cparser_iter_get_tz, NULL,  NULL},
	{NULL}  /* Sentinel */
};

PyTypeObject cparser_iterType = {
	PyObject_HEAD_INIT(NULL)
	0,                                          /*ob_size*/
	"cparser.RecordListIter",                   /*tp_name*/
	sizeof(cparser_iter),                       /*tp_basicsize*/
	0,                                          /*tp_itemsize*/
	(destructor) cparser_iter_dealloc,          /*tp_dealloc*/
	0,                                          /*tp_print*/
	0,                                          /*tp_getattr*/
	0,                                          /*tp_setattr*/
	0,                                          /*tp_compare*/
	0,                                          /*tp_repr*/
	0,                                          /*tp_as_number*/
	0,                                          /*tp_as_sequence*/
	0,                                          /*tp_as_mapping*/
	0,                                          /*tp_hash */
	0,                                          /*tp_call*/
	0,                                          /*tp_str*/
	0,                                          /*tp_getattro*/
	0,                                          /*tp_setattro*/
	0,                                          /*tp_as_buffer*/
	Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_ITER,  /*tp_flags*/
	"List of parsed records",                   /* tp_doc */
	0,                                          /* tp_traverse */
	0,                                          /* tp_clear */
	0,                                          /* tp_richcompare */
	0,                                          /* tp_weaklistoffset */
	cparser_iter_iter,                          /* tp_iter */
	(iternextfunc) cparser_iter_iternext,       /* tp_iternext */
	cparser_iter_methods,                       /* tp_methods */
	0,                                          /* tp_members */
	cparser_iter_getsetters                     /* tp_getset */
};

cparser_iter* cparser_iter_create(cparser_recordlist* recordlist)
{
	cparser_iter* iter = PyObject_New(cparser_iter, &cparser_iterType);

	iter->parent = recordlist;
	iter->current_index = 0;
	iter->tstamp_range_enabled = 0;
	iter->equality_filter_enabled = 0;
	iter->length = -1;

	Py_XINCREF(iter->parent);

	//debug_print("cparser_iter_create");
	//debug_printf("cparser_iter_create: num_fields=%zu\n", recordlist->lst->num_fields);

	return iter;
}

void cparser_iter_init_types(PyObject* module)
{
	import_array();

	cparser_iterType.tp_as_sequence = &cparser_iter_seqmethods;

	if (PyType_Ready(&cparser_iterType) < 0) {
		return;
	}

	Py_INCREF(&cparser_iterType);

	if (module != NULL) {
		PyModule_AddObject(module, "RecordListIter", (PyObject*) &cparser_iterType);
	}
}


text:
class ZookeeperMonitor < Scout::Plugin
  needs 'socket'

  OPTIONS=<<-EOS
  port:
    name: Port
    notes: ZooKeeper listening port
    default: 2181
  EOS

# Run the 4-letter command to grab the server stats from the running service
#
# This is what the output of the command in bash looks like:
# bash$ echo srvr | nc localhost 2181
#
# Zookeeper version: 3.3.3-cdh3u0--1, built on 03/26/2011 00:21 GMT
# Latency min/avg/max: 0/0/0
# Received: 68
# Sent: 67
# Outstanding: 0
# Zxid: 0x400000002
# Mode: follower
# Node count: 4

  def build_report
    # Ruby's error handling is weird, but this catches in the event that the port is incorrect, unresponsive
    begin
      # Ruby sockets! http://www.ruby-doc.org/stdlib/libdoc/socket/rdoc/index.html
      socket = TCPSocket.open("localhost", "#{option(:port)}")
      socket.print("srvr")
      stats = socket.read

      if stats =~ /This ZooKeeper instance is not currently serving requests/i
        report(:up => 0)
        error(:subject => "Zookeeper not serving requests", :body => stats)
        return
      end

      # Let's set the variables to the outputs, based on regexes
      stats.each_line do |line|
        # This line is smarter, thanks to Dan's regex-fu
        case line
        when %r{^Latency min/avg/max: (\d+)/(\d+)/(\d+)}
          lat_min, lat_avg, lat_max = $1.to_i, $2.to_i, $3.to_i
          report(:lat_min => lat_min, :lat_avg => lat_avg, :lat_max => lat_max)
        when /^(Received|Sent): (\d+)/
          counter($1.downcase, $2.to_i, :per => :minute)
        when /^([^:]+): (\d+)$/
          name, num = $1, $2
          name = name.gsub(' ', '_').downcase
          report(name => num.to_i)
        when /^([^:]+): (\S+)$/
          name, val = $1, $2
          name = name.gsub(' ', '_').downcase
          report(name => val)
        end
      end

      report(:up => 1)
    rescue Errno::ECONNREFUSED => e
      report(:up => 0)
      error(:subject => 'Unable to connect to zookeeper', :body => "The zookeeper service is not running on the specified port (#{option(:port)}).\nFull error is:\n" + e)
    end
  end
end


text:
if [ "$#" -eq 0 ]; then echo "Provide a password for the domain as first argument."; exit; fi
docker build --build-arg ADMIN_PASSWORD=$1 --build-arg PRODUCTION_MODE=$2 -t 1213-domain .


text:
#ifndef VICE_UIVICSET_H
#define VICE_UIVICSET_H

#include <windows.h>

void ui_vic20_settings_dialog(HWND hwnd);

#endif


text:
package restore

import (
	"encoding/json"
	"testing"

	"github.com/stretchr/testify/require"
	"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"

	"github.com/vmware-tanzu/velero/pkg/builder"
	"github.com/vmware-tanzu/velero/pkg/plugin/velero"
	"github.com/vmware-tanzu/velero/pkg/test"
)

func TestExecuteForACRDWithAnIntOnAFloat64FieldShouldWork(t *testing.T) {
	// ref. reopen of https://github.com/vmware-tanzu/velero/issues/2319

	b := builder.ForV1CustomResourceDefinition("test.velero.io")
	// 5 here is just an int value, it could be any other whole number.
	schema := builder.ForJSONSchemaPropsBuilder().Maximum(5).Result()
	b.Version(builder.ForV1CustomResourceDefinitionVersion("v1").Served(true).Storage(true).Schema(schema).Result())
	c := b.Result()

	// Marshall in and out of JSON because the problem doesn't manifest when we use ToUnstructured directly
	// This should simulate the JSON passing over the wire in an HTTP request/response with a dynamic client
	js, err := json.Marshal(c)
	require.NoError(t, err)

	var u unstructured.Unstructured
	err = json.Unmarshal(js, &u)
	require.NoError(t, err)

	a := NewCRDV1PreserveUnknownFieldsAction(test.NewLogger())

	_, err = a.Execute(&velero.RestoreItemActionExecuteInput{Item: &u})
	require.NoError(t, err)
}


text:
package com.nec.harvest.controller;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URI;
import java.text.ParseException;
import java.util.Collections;
import java.util.Date;
import java.util.List;

import javax.inject.Inject;
import javax.servlet.http.HttpServletRequest;

import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.http.HttpHost;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.HttpClientBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.util.UriComponents;
import org.springframework.web.util.UriComponentsBuilder;

import com.nec.core.exception.ObjectNotFoundException;
import com.nec.harvest.bean.mapping.ProfitMonthlyBean;
import com.nec.harvest.constant.Constants;
import com.nec.harvest.exception.ServiceException;
import com.nec.harvest.http.HttpServletContentType;
import com.nec.harvest.menu.group.ProfitAndLossManagementProGroup;
import com.nec.harvest.model.Division;
import com.nec.harvest.model.Organization;
import com.nec.harvest.service.DivisionService;
import com.nec.harvest.service.OrganizationService;
import com.nec.harvest.service.ProfitMonthlyService;
import com.nec.harvest.stereotype.SessionAttribute;
import com.nec.harvest.util.DateFormatUtil;
import com.nec.harvest.util.DateFormatUtil.DateFormat;

/**
 * Provide all method to handle request from client
 * related to profit by shop of department management actions
 *
 * @author huonghv
 */
@Controller
@RequestMapping(Constants.SONEKIH_PATH)
public class SonekihController extends ProfitAndLossManagementProGroup implements PageRenderer, TitleRenderer {

	private static final Logger logger = LoggerFactory.getLogger(SonekihController.class);

	private static final String DEFAULT_KBN_ID = "KAISOU";

	private final DivisionService divisionService;

	private final OrganizationService organizationService;

	private final ProfitMonthlyService profitMonthlyService;

	@Inject
	public SonekihController(DivisionService divisionService, OrganizationService organizationService, ProfitMonthlyService profitMonthlyService) {
		this.divisionService = divisionService;
		this.organizationService = organizationService;
		this.profitMonthlyService = profitMonthlyService;
	}

	/** {@inheritDoc} */
	@Override
	@RequestMapping(value = "", method = RequestMethod.GET)
	public String render(@SessionAttribute(Constants.SESS_ORGANIZATION_CODE) String userOrgCode, @SessionAttribute(Constants.SESS_BUSINESS_DAY) Date businessDay, @PathVariable String proGNo,
			final Model model) {
		if (logger.isDebugEnabled()) {
			logger.debug("Redering sonekih default page view...");
		}

		//
		model.addAttribute(PROCESSING_MONTH, businessDay);

		try {
			// Get a list of divisions
			List<Division> divisions;
			try {
				divisions = divisionService.findByKbnId(DEFAULT_KBN_ID);
			} catch (IllegalArgumentException | ObjectNotFoundException ex) {
				logger.warn(ex.getMessage());

				// Set default is empty if there is no devision
				divisions = Collections.emptyList();
			}

			model.addAttribute("classifies", divisions);
		} catch (ServiceException ex) {
			logger.error(ex.getMessage(), ex);

			// システムエラーです。管理者と連絡してください
			model.addAttribute(ERROR, true);
			model.addAttribute(ERROR_MESSAGE, getSystemError());
		}

		return getViewName();
	}

	/**
	 * Calculate and load data
	 *
	 * @param userOrgCode
	 *            Organization code from session
	 * @param businessDay
	 *            Business day from session
	 * @param proGNo
	 *            Processing menu group
	 * @param unitLevel
	 *            Classify code of management
	 * @param unitDept
	 *            Department code of management
	 * @param month
	 *            Processing month
	 * @param request
	 *            HttpServletRequest object
	 * @param response
	 *            HttpServletResponse object
	 * @param model
	 *            Model interchange between client and server
	 * @return View name logic
	 */
	@RequestMapping(value = "load/{unitdept}/{deptCode}/{month}", method = RequestMethod.GET)
	public String render(@SessionAttribute(Constants.SESS_ORGANIZATION_CODE) String userOrgCode, @SessionAttribute(Constants.SESS_BUSINESS_DAY) Date businessDay,
			@PathVariable String proGNo, @PathVariable String unitdept, @PathVariable String deptCode, @PathVariable @DateTimeFormat(pattern="yyyyMM") Date month, final Model model) {
		logger.info("Loading profit monthly data");

		try {
			//
			loadDepartmentData(unitdept, deptCode, month, businessDay, model);
		} catch (ServiceException ex) {
			logger.error(ex.getMessage(), ex);

			// システムエラーです。管理者と連絡してください
			model.addAttribute(ERROR, true);
			model.addAttribute(ERROR_MESSAGE,  getSystemError());
		}
		return getViewName();
	}

	@RequestMapping(value = "/{unitLevel}/{unitDept}", method = RequestMethod.GET)
	public String render(@SessionAttribute(Constants.SESS_ORGANIZATION_CODE) String userOrgCode, @SessionAttribute(Constants.SESS_BUSINESS_DAY) Date businessDay,
			@PathVariable String proGNo,  @PathVariable String unitLevel, @PathVariable String unitDept, final HttpServletRequest request, final Model model) {

		UriComponents uriComponents = UriComponentsBuilder.fromUriString(Constants.SONEKIH_PATH + "/{unitLevel}/{unitDept}/{month}").build();
		String businessMonth = DateFormatUtil.format(businessDay, DateFormat.DATE_WITHOUT_DAY);
		URI uri = uriComponents.expand(proGNo, unitLevel, unitDept, businessMonth).encode().toUri();
		return "redirect:" + uri.toString();
	}

	/**
	 * Handling when user type on browser's address to take calculation totally
	 * of all organizations that given department manage them
	 *
	 * @param userOrgCode
	 *            Organization code from session
	 * @param businessDay
	 *            Business day from session
	 * @param proGNo
	 *            Processing menu group
	 * @param unitLevel
	 *            Classify code of management
	 * @param unitDept
	 *            Department code of management
	 * @param month
	 *            Processing month
	 * @param model
	 *            Model interchange between client and server
	 * @return Redirect url path
	 */
	@RequestMapping(value = "/{unitLevel}/{unitDept}/{month}", method = RequestMethod.GET)
	public String render(@SessionAttribute(Constants.SESS_ORGANIZATION_CODE) String userOrgCode, @SessionAttribute(Constants.SESS_BUSINESS_DAY) Date businessDay,
			@PathVariable String proGNo, @PathVariable String unitLevel, @PathVariable String unitDept, final HttpServletRequest request, @PathVariable String month,
			final Model model) {
		logger.info("Loading profit monthly data by full path [/sonekih/{unitLevel}/{unitDept}/{month}]");

		try {
			/* Get processing month */
			Date processMonth = monthStandard(month, businessDay);
			if (processMonth == null) {
				UriComponents uriComponents = UriComponentsBuilder.fromUriString(Constants.SONEKIH_PATH + "/{unitLevel}/{unitDept}/{deptCode}/{month}").build();
				String businessMonth = DateFormatUtil.format(businessDay, DateFormat.DATE_WITHOUT_DAY);
				URI uri = uriComponents.expand(proGNo, unitLevel, unitDept, month, businessMonth).encode().toUri();

				return "redirect:" + uri.toString();
			}

			loadClassifies(unitLevel, model);
			loadDepartments(unitLevel, unitDept, model);
			loadDepartmentPage(request, proGNo, unitDept, "-1", model);
			loadDepartmentData(unitDept, unitDept, processMonth, businessDay, model);
		} catch (ServiceException ex) {
			logger.error(ex.getMessage(), ex);

			// システムエラーです。管理者と連絡してください
			model.addAttribute(ERROR, true);
			model.addAttribute(ERROR_MESSAGE,  getSystemError());
		}
		return getViewName();
	}

	/**
	 * Handle when user type on browser's address
	 *
	 * @param userOrgCode
	 *            Organization code from session
	 * @param businessDay
	 *            Business day from session
	 * @param proGNo
	 *            Processing menu group
	 * @param unitLevel
	 *            Classify code of management
	 * @param unitDept
	 *            Department code of management
	 * @param deptCode
	 *            Department code detail
	 * @param month
	 *            Processing month
	 * @param model
	 *            Model interchange between client and server
	 * @return Page view logic name
	 */
	@RequestMapping(value = "/{unitLevel}/{unitDept}/{deptCode}/{month}", method = RequestMethod.GET)
	public String render(@SessionAttribute(Constants.SESS_ORGANIZATION_CODE) String userOrgCode, @SessionAttribute(Constants.SESS_BUSINESS_DAY) Date businessDay,
			@PathVariable String proGNo, @PathVariable String unitLevel, @PathVariable String unitDept,  @PathVariable String deptCode,
			final HttpServletRequest request, @PathVariable @DateTimeFormat(pattern="yyyyMM") Date month, final Model model) {
		logger.info("Loading profit monthly data by full path [/sonekih/{unitLevel}/{unitDept}/{deptCode}/{month}]");

		try {
			loadClassifies(unitLevel, model);
			loadDepartments(unitLevel, unitDept, model);
			loadDepartmentPage(request, proGNo, unitDept, deptCode, model);
			loadDepartmentData(unitDept, deptCode, month, businessDay, model);
		} catch (ServiceException ex) {
			logger.error(ex.getMessage(), ex);

			// システムエラーです。管理者と連絡してください
			model.addAttribute(ERROR, true);
			model.addAttribute(ERROR_MESSAGE,  getSystemError());
		}
		return getViewName();
	}

	/**
	 * Check string input is a date time type or not
	 *
	 * @param month
	 *            Data to check
	 * @param businessMonth
	 *            Business month get from session
	 * @return Data in date type
	 */
	private Date monthStandard(String month, Date businessMonth) {
		try {
			Date processMonth = DateFormatUtil.parse(month, DateFormat.DATE_WITHOUT_DAY);
			return processMonth;
		} catch (NullPointerException | IllegalArgumentException | ParseException ex) {
			logger.warn(ex.getMessage());
		}
		return null;
	}

	/**
	 * Calculate and load given department data
	 *
	 * @param selectedDepartment
	 *            Given department
	 * @param processingMonth
	 *            The processing month
	 * @param businessMonth
	 *            Business month get from session
	 * @param model
	 *            Model interchange between client and server
	 */
	private void loadDepartmentData(String unitDepartment, String selectedDepartment, Date processingMonth, Date businessMonth, Model model) {
		ProfitMonthlyBean profitMonthlyBean = profitMonthlyService.aggregateProfitMonthlyByDepartment(selectedDepartment, processingMonth, businessMonth);

		//
		model.addAttribute(PROCESSING_MONTH, processingMonth);
		model.addAttribute("profitMonthly", profitMonthlyBean);

		/* Check next month */
		Date monthAvailable = null;
		try {
			monthAvailable = profitMonthlyService.checkAvailableByOrgCodeAndMothly(unitDepartment, processingMonth, businessMonth, true);
		} catch (IllegalArgumentException ex) {
			logger.warn(ex.getMessage());
			//
			monthAvailable = null;
		}

		// Next monthly data
		model.addAttribute(NEXT_MONTH, monthAvailable);

		/* Check previous month */
		try {
			monthAvailable = profitMonthlyService.checkAvailableByOrgCodeAndMothly(unitDepartment, processingMonth, businessMonth, false);
		} catch (IllegalArgumentException | ObjectNotFoundException ex) {
			logger.warn(ex.getMessage());

			//
			monthAvailable = null;
		}

		// Previous monthly data
		model.addAttribute(PREVIOUS_MONTH, monthAvailable);
	}

	/**
	 * Load given department current page
	 *
	 * @param request
	 *            HttpServletRequest
	 * @param processingGroup
	 *            Current processing group menu
	 * @param selectedDepartment
	 *            Given department
	 * @param model
	 *            Model interchange between client and server
	 */
	private void loadDepartmentPage(HttpServletRequest request, String processingGroup, String selectedDepartment, String processingDepartment, Model model) {
		if (StringUtils.isEmpty(processingGroup) || StringUtils.isEmpty(selectedDepartment)) {
			model.addAttribute("page", null);
			model.addAttribute("manualLoad", false);
		}

		UriComponents uriComponent = UriComponentsBuilder.fromUriString(request.getContextPath() + "/{proNo}/pagination/paging/{orglevel}/{deptCode}/{index}").build();
		URI uri = uriComponent.expand(processingGroup, selectedDepartment, processingDepartment, 0).encode().toUri();

		try {
			HttpClient client = HttpClientBuilder.create().build();
			HttpHost host = new HttpHost(request.getServerName(), request.getLocalPort(), request.getScheme());
			HttpGet get = new HttpGet(uri);
			HttpResponse response = client.execute(host, get);

			// Get the content
			String htmlPage  = read(response.getEntity().getContent());

			//
			model.addAttribute("page", htmlPage);
			model.addAttribute("manualLoad", true);
			model.addAttribute("unitDept", selectedDepartment);
			model.addAttribute("deptCode", processingDepartment);
		} catch (IOException ex) {
			logger.error(ex.getMessage(), ex);
		}
	}

	/**
	 * Get classify list
	 *
	 * @param selectedClassify
	 *            Current department classify
	 * @param model
	 *            Model interchange between client and server
	 */
	private void loadClassifies(String selectedClassify, Model model) {
		List<Division> divisions;
		try {
			divisions = divisionService.findByKbnId(DEFAULT_KBN_ID);
		} catch (IllegalArgumentException | ObjectNotFoundException ex) {
			logger.warn(ex.getMessage());

			// Set default is empty if there is no division
			divisions = Collections.emptyList();
		}

		model.addAttribute("classifies", divisions);
		model.addAttribute("unitLevel", getDisplayClassfyName(divisions, selectedClassify));
	}

	/**
	 * Get departments list
	 *
	 * @param selectedClassify
	 *            Department's classify
	 * @param selectedDepartment
	 *            Department is selected
	 * @param model
	 *
	 */
	private void loadDepartments(String selectedClassify, String selectedDepartment, Model model) {
		List<Organization> departments = null;
		try {
			// Get the list of organizations level 2
			departments = organizationService.findByKaisoBango(selectedClassify);
		} catch (IllegalArgumentException | ObjectNotFoundException ex) {
			logger.warn(ex.getMessage());
		}

		model.addAttribute("departments", departments);
		model.addAttribute("unitDeptName", getDisplayDepartmentName(departments, selectedDepartment));
	}

	/**
	 * Get data from input stream into string type
	 *
	 * @param in
	 *            Input stream
	 * @return Data from input stream in string type
	 * @throws IOException
	 *             When runtime exception
	 */
	private String read(InputStream in) throws IOException {
        StringBuilder sb = new StringBuilder();
        BufferedReader r = new BufferedReader(new InputStreamReader(in, HttpServletContentType.DEFAULT_ENCODING));
        for (String line = r.readLine(); line != null; line = r.readLine()) {
            sb.append(line);
        }
        in.close();
        return sb.toString();
    }

	/**
	 * Get full display of classify to show on page
	 *
	 * @param classifies
	 *            List of classify
	 * @param classify
	 *            Classify code to get name
	 * @return Name of classify in strings
	 */
	private String getDisplayClassfyName(List<Division> classifies, String classify) {
		if (CollectionUtils.isNotEmpty(classifies) && StringUtils.isNotEmpty(classify)) {
			boolean result = false;
			for (int i = 0; i < classifies.size(); i++) {
				result = result || classifies.get(i).getKbnCode().equalsIgnoreCase(classify);
				Division division = classifies.get(i);
				if (division.getKbnCode().equalsIgnoreCase(classify)) {
					return (classify + ": " + division.getKbnName());
				}
			}
			return null;
		}
		return null;
	}

	/**
	 * Get full display of department to show on page
	 *
	 * @param departments
	 *            List of department
	 * @param deptCode
	 *            Department code to get name
	 * @return Department name in string
	 */
	private String getDisplayDepartmentName(List<Organization> departments, String deptCode) {
		if (CollectionUtils.isNotEmpty(departments) && StringUtils.isNotEmpty(deptCode)) {
			for (int i = 0; i < departments.size(); i++) {
				Organization department = departments.get(i);
				if (department.getStrCode().equalsIgnoreCase(deptCode)) {
					return deptCode + ": " + department.getStrNameR();
				}
			}
			return null;
		}
		return null;
	}

	/** {@inheritDoc} */
	@Override
	public String getViewName() {
		return "sonekih/sonekih";
	}

	@Override
	public String getTitleName() {
		return "損益速報(全店)";
	}
}


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

<title>DosFileAttributeView (Java Platform SE 8 )</title>
<meta name="date" content="2014-12-17">
<meta name="keywords" content="java.nio.file.attribute.DosFileAttributeView interface">
<meta name="keywords" content="name()">
<meta name="keywords" content="readAttributes()">
<meta name="keywords" content="setReadOnly()">
<meta name="keywords" content="setHidden()">
<meta name="keywords" content="setSystem()">
<meta name="keywords" content="setArchive()">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Java™ Platform
Standard Ed. 8

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

compact1, compact2, compact3

java.nio.file.attribute

Interface DosFileAttributeView

All Superinterfaces:

AttributeView, BasicFileAttributeView, FileAttributeView

public interface DosFileAttributeView
extends BasicFileAttributeView

A file attribute view that provides a view of the legacy "DOS" file attributes.
 These attributes are supported by file systems such as the File Allocation
 Table (FAT) format commonly used in consumer devices.

 A DosFileAttributeView is a BasicFileAttributeView that
 additionally supports access to the set of DOS attribute flags that are used
 to indicate if the file is read-only, hidden, a system file, or archived.

 Where dynamic access to file attributes is required, the attributes
 supported by this attribute view are as defined by BasicFileAttributeView, and in addition, the following attributes are
 supported:

      Name
      Type

      readonly
      Boolean

      hidden
      Boolean

      system
      Boolean

      archive
      Boolean

 The getAttribute method may
 be used to read any of these attributes, or any of the attributes defined by
 BasicFileAttributeView as if by invoking the readAttributes() method.

 The setAttribute method may
 be used to update the file's last modified time, last access time or create
 time attributes as defined by BasicFileAttributeView. It may also be
 used to update the DOS attributes as if by invoking the setReadOnly, setHidden, setSystem, and
 setArchive methods respectively.

Since:

1.7

Method Summary

All Methods Instance Methods Abstract Methods

Modifier and Type
Method and Description

String
name()

Returns the name of the attribute view.

DosFileAttributes
readAttributes()

Reads the basic file attributes as a bulk operation.

void
setArchive(boolean value)

Updates the value of the archive attribute.

void
setHidden(boolean value)

Updates the value of the hidden attribute.

void
setReadOnly(boolean value)

Updates the value of the read-only attribute.

void
setSystem(boolean value)

Updates the value of the system attribute.

Methods inherited from interface java.nio.file.attribute.BasicFileAttributeView

setTimes

Method Detail

name

String name()

Returns the name of the attribute view. Attribute views of this type
 have the name "dos".

Specified by:

name in interface AttributeView

Specified by:

name in interface BasicFileAttributeView

Returns:

the name of the attribute view

readAttributes

DosFileAttributes readAttributes()
                          throws IOException

Description copied from interface: BasicFileAttributeView

Reads the basic file attributes as a bulk operation.

 It is implementation specific if all file attributes are read as an
 atomic operation with respect to other file system operations.

Specified by:

readAttributes in interface BasicFileAttributeView

Returns:

the file attributes

Throws:

IOException - if an I/O error occurs

SecurityException - In the case of the default provider, a security manager is
          installed, its checkRead
          method is invoked to check read access to the file

setReadOnly

void setReadOnly(boolean value)
          throws IOException

Updates the value of the read-only attribute.

 It is implementation specific if the attribute can be updated as an
 atomic operation with respect to other file system operations. An
 implementation may, for example, require to read the existing value of
 the DOS attribute in order to update this attribute.

Parameters:

value - the new value of the attribute

Throws:

IOException - if an I/O error occurs

SecurityException - In the case of the default, and a security manager is installed,
          its  checkWrite method
          is invoked to check write access to the file

setHidden

void setHidden(boolean value)
        throws IOException

Updates the value of the hidden attribute.

 It is implementation specific if the attribute can be updated as an
 atomic operation with respect to other file system operations. An
 implementation may, for example, require to read the existing value of
 the DOS attribute in order to update this attribute.

Parameters:

value - the new value of the attribute

Throws:

IOException - if an I/O error occurs

SecurityException - In the case of the default, and a security manager is installed,
          its  checkWrite method
          is invoked to check write access to the file

setSystem

void setSystem(boolean value)
        throws IOException

Updates the value of the system attribute.

 It is implementation specific if the attribute can be updated as an
 atomic operation with respect to other file system operations. An
 implementation may, for example, require to read the existing value of
 the DOS attribute in order to update this attribute.

Parameters:

value - the new value of the attribute

Throws:

IOException - if an I/O error occurs

SecurityException - In the case of the default, and a security manager is installed,
          its  checkWrite method
          is invoked to check write access to the file

setArchive

void setArchive(boolean value)
         throws IOException

Updates the value of the archive attribute.

 It is implementation specific if the attribute can be updated as an
 atomic operation with respect to other file system operations. An
 implementation may, for example, require to read the existing value of
 the DOS attribute in order to update this attribute.

Parameters:

value - the new value of the attribute

Throws:

IOException - if an I/O error occurs

SecurityException - In the case of the default, and a security manager is installed,
          its  checkWrite method
          is invoked to check write access to the file

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Java™ Platform
Standard Ed. 8

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

 Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
 Copyright © 1993, 2015, Oracle and/or its affiliates.  All rights reserved.


text:
package org.apache.beam.sdk.io.aws2.common;

import static java.util.concurrent.ForkJoinPool.commonPool;
import static java.util.stream.Collectors.toList;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoInteractions;
import static org.mockito.Mockito.verifyNoMoreInteractions;

import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.ForkJoinTask;
import java.util.function.Function;
import java.util.stream.Stream;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Spy;
import org.mockito.junit.MockitoJUnitRunner;

@RunWith(MockitoJUnitRunner.class)
public class ClientPoolTest {
  @Spy ClientProvider provider = new ClientProvider();
  ClientPool<Function<String, AutoCloseable>, String, AutoCloseable> pool;

  @Before
  public void init() {
    pool = new ClientPool<>((p, c) -> p.apply(c));
  }

  class ResourceTask implements Callable<AutoCloseable> {
    @Override
    public AutoCloseable call() throws Exception {
      AutoCloseable client = pool.retain(provider, "config");
      pool.retain(provider, "config");
      pool.release(provider, "config");
      verifyNoInteractions(client);
      pool.release(provider, "config");
      return client;
    }
  }

  @Test
  public void concurrentRetainRelease() throws Exception {
    List<ForkJoinTask<AutoCloseable>> futures =
        Stream.generate(() -> new ResourceTask())
            .limit(100000)
            .map(commonPool()::submit)
            .collect(toList());

    futures.stream().forEach(ForkJoinTask::join);
    assertThat(futures.stream().allMatch(ForkJoinTask::isCompletedNormally)).isTrue();

    for (ForkJoinTask<AutoCloseable> future : futures) {
      verify(future.get()).close();
    }
  }

  @Test
  public void shareClientsOfSameConfiguration() {
    String config1 = "config1";
    String config2 = "config2";

    assertThat(pool.retain(provider, config1)).isSameAs(pool.retain(provider, config1));
    assertThat(pool.retain(provider, config1)).isNotSameAs(pool.retain(provider, config2));
    verify(provider, times(2)).apply(anyString());
    verify(provider, times(1)).apply(config1);
    verify(provider, times(1)).apply(config2);
  }

  @Test
  public void closeClientsOnceReleased() throws Exception {
    String config = "config";
    int sharedInstances = 10;

    AutoCloseable client = null;
    for (int i = 0; i < sharedInstances; i++) {
      client = pool.retain(provider, config);
    }

    for (int i = 1; i < sharedInstances; i++) {
      pool.release(provider, config);
    }
    verifyNoInteractions(client);
    // verify close on last release
    pool.release(provider, config);
    verify(client).close();
    // verify further attempts to release have no effect
    pool.release(provider, config);
    verifyNoMoreInteractions(client);
  }

  @Test
  public void recreateClientOnceReleased() throws Exception {
    String config = "config";
    AutoCloseable client1 = pool.retain(provider, config);
    pool.release(provider, config);
    AutoCloseable client2 = pool.retain(provider, config);

    verify(provider, times(2)).apply(config);
    verify(client1).close();
    verifyNoInteractions(client2);
  }

  @Test
  public void releaseWithError() throws Exception {
    String config = "config";
    AutoCloseable client1 = pool.retain(provider, config);
    doThrow(new Exception("error on close")).when(client1).close();
    assertThatThrownBy(() -> pool.release(provider, config)).hasMessage("error on close");

    AutoCloseable client2 = pool.retain(provider, config);
    verify(provider, times(2)).apply(config);
    verify(client1).close();
    verifyNoInteractions(client2);
  }

  static class ClientProvider implements Function<String, AutoCloseable> {
    @Override
    public AutoCloseable apply(String configName) {
      return mock(AutoCloseable.class, configName);
    }
  };
}


text:
$('#menu').click(function() {
    if ($('#cover').hasClass('active')) {
        $('#flyout').removeClass('slide-in');
        $('#flyout').addClass('slide-out');
        $('#cover').removeClass('active');
        $('html').removeClass('covered');
    } else {
        $('html').addClass('covered');
        $('#cover').addClass('active');
        $('#flyout').removeClass('slide-out');
        $('#flyout').addClass('slide-in');
    }
});

// Hide active modal if cover is clicked
$('#cover').click(function() {
    $('#flyout').removeClass('slide-in');
    $('#flyout').addClass('slide-out');
    $('#cover').removeClass('active');
    $('html').removeClass('covered');
});

// Submit the search form automatically if at least 3 characters are entered
$('#search_box').on('input', function() {
    if ($(this).val().length > 2) {
        $(this).submit();
        $('#search-results').addClass('active');
    }
});

// Close the search results when the "close button" is clicked
$('#search-results .close-button').click(function() {
    $('#search-results').removeClass('active');
    $('#search_box').val('');
});


text:
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.net-->
<resources>
  <string-array name="pref_colorTheme_labels">
      <item>Dark Material</item>
      <item>Clean Paper</item>
      <item>Lollipop</item>
      <item>Bubble Gum</item>
      <item>Sakura</item>
    <item>Tropic Lush</item>
    <item>Moss Lake</item>
    <item>Warm Ash</item>
    <item>Sweet Orange</item>
    <item>Dry Desert</item>
      <item>Wood</item>
      <item>Chocolate</item>
    <item>Wet Guava</item>
    <item>Clear Night</item>
    <item>Starry Night</item>
      <item>Blackboard</item>
      <item>Soft Light</item>
  </string-array>
</resources>