text:
<?php $this->load->view('layouts/header'); ?>

+add Device

              Device Name
              Device ID
              About Device
              Parameters
              Edit
              Delete

            <?php foreach ($result as $row) {

							echo "
";
							// echo "".$row->id."	";
							echo "".$row->device_name."	";
							echo "".$row->device_id."	";
							echo "".$row->about_device."	";
							$id = $row->id;
							// $hobbies = $row->hobbies;
							// echo "".$hobbies."	";
							$base_url = base_url().'index.php';
							$edit_url = $base_url . "/home/edit_device/{$id}";
							$delete_url = $base_url."/device/delete_device/{$id}";
							$parameters_url = $base_url."/home/add_parameters/{$id}";
							echo " +Add parameters
                    <button type=\"button\" class=\"btn btn-info btn-sm\" data-toggle=\"modal\" data-target=\"#myModal\">View</button>
                    	";

          ×

        <form action="<?php echo base_url(); ?>index.php/device/update_parameter" method="post" class="form-horizontal">
        <?php
        echo "
The parameters are:-
";

                Parameter Name

                  <input type="name" class="form-control" name="parameter_name[]" id="inputName" placeholder="parameter name" value ="<?php echo $parameter_name; ?>">

                  <input type="name" name="parameter_id[]" id="" placeholder="" value ="<?php echo $parameter_id;  ?>" style="display:none">

          <?php } ?>

                  <button style="float:right;" type="submit" class="btn btn-default" >Save Changes</button>

        </form>

            <?php

							echo "Edit 	";
							echo "Delete 	";
							echo "
";
				} ?>

< >

<?php $this->load->view('layouts/footer'); ?>


text:
'use strict';

var $ = require('preconditions').singleton();
var _ = require('lodash');
var util = require('util');

var Uuid = require('uuid');

var Address = require('./address');
var AddressManager = require('./addressmanager');
var WalletUtils = require('bitcore-wallet-utils');
var Bitcore = WalletUtils.Bitcore;
var HDPublicKey = Bitcore.HDPublicKey;

function Copayer() {};

Copayer.create = function(opts) {
  opts = opts || {};
  $.checkArgument(opts.xPubKey, 'Missing copayer extended public key')
    .checkArgument(opts.requestPubKey, 'Missing copayer request public key')
    .checkArgument(opts.signature, 'Missing copayer request public key signature');

  opts.copayerIndex = opts.copayerIndex || 0;

  var x = new Copayer();

  x.version = 2;
  x.createdOn = Math.floor(Date.now() / 1000);
  x.xPubKey = opts.xPubKey;
  x.id = WalletUtils.xPubToCopayerId(x.xPubKey);
  x.name = opts.name;
  x.requestPubKey = opts.requestPubKey;
  x.signature = opts.signature;
  x.requestPubKeys = [{
    key: opts.requestPubKey,
    signature: opts.signature,
  }];

  var derivationStrategy = opts.derivationStrategy || WalletUtils.DERIVATION_STRATEGIES.BIP45;
  if (AddressManager.supportsCopayerBranches(derivationStrategy)) {
    x.addressManager = AddressManager.create({
      derivationStrategy: derivationStrategy,
      copayerIndex: opts.copayerIndex,
    });
  }

  x.customData = opts.customData;

  return x;
};

Copayer.fromObj = function(obj) {
  var x = new Copayer();

  x.version = obj.version;
  x.createdOn = obj.createdOn;
  x.id = obj.id;
  x.name = obj.name;
  x.xPubKey = obj.xPubKey;
  x.requestPubKey = obj.requestPubKey;
  x.signature = obj.signature;

  if (parseInt(x.version) == 1) {
    x.requestPubKeys = [{
      key: x.requestPubKey,
      signature: x.signature,
    }];
    x.version = 2;
  } else {
    x.requestPubKeys = obj.requestPubKeys;
  }

  if (obj.addressManager) {
    x.addressManager = AddressManager.fromObj(obj.addressManager);
  }
  x.customData = obj.customData;

  return x;
};

Copayer.prototype.createAddress = function(wallet, isChange) {
  $.checkState(wallet.isComplete());

  var path = this.addressManager.getNewAddressPath(isChange);
  var raw = Address.create(WalletUtils.deriveAddress(wallet.addressType, wallet.publicKeyRing, path, wallet.m, wallet.network));
  var address = Address.create(_.extend(raw, {
    walletId: wallet.id,
    type: wallet.addressType,
  }));

  address.isChange = isChange;
  return address;
};

module.exports = Copayer;

redpajama_set_name: RedPajamaGithub


text:
/**
 *
 */
package com.astudio.inspicsoc.model;

/**
 * @author CJH 图片实体用于上传
 */
public class PictureBean {

	private String name;

	private String srcUrl;

	private Integer width;

	private Integer height;

	public String getName() {
		return name;
	}

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

	public String getSrcUrl() {
		return srcUrl;
	}

	public void setSrcUrl(String srcUrl) {
		this.srcUrl = srcUrl;
	}

	public Integer getWidth() {
		return width;
	}

	public void setWidth(Integer width) {
		this.width = width;
	}

	public Integer getHeight() {
		return height;
	}

	public void setHeight(Integer height) {
		this.height = height;
	}

}


text:
OH "you are not exactly git blameless here."
— Justin Searls (@searls) September 6, 2012

## Why version control?

  * Backup
  * Rollback
  * History
  * Deployment
  * No Emailing Files
  * No more index.final.v6.html, etc.

## GIT

  * Distributed
  * Fast
  * Complicated

## Basic GIT commands

You should know how to:

  * Create a local repository
  * Add files to the repository
  * Commit those files (-m)
  * Check the repository status
  * Commit more files
  * Looking at all of your commits (and --pretty=oneline)
  * Interactive add changes

![](https://rawgit.com/pastjean/git-cheat-sheet/master/git-cheat-sheet.svg)

See more at: http://gitimmersion.com

## .gitignore

Gitignore tells git about files that you never, ever want to commit.  Examples of these files are things like .DS_Store, editor-specific files and files that contain sensitive information or logs.

### Global .gitignore

Global .gitignore files are great for ignoring operating system specific files (such as .DS_Store) that you will never want to accidentally commit.

* https://help.github.com/articles/ignoring-files
* http://devoh.com/blog/2013/01/global-gitignore

## Hidden Files

If you're having trouble seeing certain files in OS X Finder, you'll want to enable viewing hidden files:

* http://mac.tutsplus.com/tutorials/os-x/quick-tip-revealing-hidden-files-in-os-x/

## Resources for when things go wrong:

* [On undoing, fixing, or removing commits in git](https://sethrobertson.github.io/GitFixUm/fixup.html)
* [Seriously, The Reflog Isn't That Scary
Harnessing the power of git-reflog for good](https://medium.com/@./seriously-the-reflog-isnt-that-scary-a4189dd88c40)

## Sources & Further Reading:

* [A Visual Git Reference](http://marklodato.github.io/visual-git-guide/index-en.html)
* [GitRef.org](http://gitref.org/)
* [GitHub Guides](https://guides.github.com/)

### TODO:

![in-class-git-flow.png]

[gitpretty.pdf](git-pretty.pdf)


text:
package examples.dustin.commandline.jbock;

import java.util.Optional;
import net.jbock.Command;
import net.jbock.Option;

/**
 * Demonstrates use of jbock 4.2 to process command-line
 * arguments in a Java application.
 */
public class Main
{

   @Command
   abstract static class Arguments
   {

      /**
       * Verbosity enabled?
       */
      @Option(names = {"-v", "--verbose"})
      abstract boolean verbose();

      /**
       * File name and path
       */
      @Option(names = {"-f", "--file"})
      abstract Optional<String> file();
   }

   public static void main(String[] arguments)
   {
      Arguments args = new Main_Arguments_Parser().parseOrExit(arguments);
      System.out.println("The file '" + args.file() + "' was provided and verbosity is set to '" + args.verbose() + "'.");
   }
}


text:
using System;
using DatabaseMigrateExt;

namespace DemoLog.Serilog.Migrations.MovieStore
{
    [ExtMgrStoredProcedures(2019,09,08,03,21,01)]
    public class MovieStore_20190908_032101_exec_script : ExtStoreProcedureMigration
    {
        public override void Up()
        {
            base.ExecuteGeneralRefScript("v0000001_do_something.sql");
        }

        public override void Down()
        {
            throw new NotImplementedException();
        }
    }
}


text:
Auto Host adder for xampp on WIn 7+

![ScreenShot](screenshot.png)

## Usage:
* Fill all info
* Press add/delete
* ???
* Profit

## TODO:
* Add en lang
* Add no sound mode
* Try WPF


text:
CopyNumberVariant::CopyNumberVariant()
	: chr_()
	, start_(0)
	, end_(0)
	, num_regs_()
	, genes_()
	, annotations_()
{
}

CopyNumberVariant::CopyNumberVariant(const Chromosome& chr, int start, int end)
	: chr_(chr)
	, start_(start)
	, end_(end)
	, num_regs_(-1)
	, genes_()
	, annotations_()
{
}

CopyNumberVariant::CopyNumberVariant(const Chromosome& chr, int start, int end, int num_regs, GeneSet genes, QByteArrayList annotations)
	: chr_(chr)
	, start_(start)
	, end_(end)
	, num_regs_(num_regs)
	, genes_(genes)
	, annotations_(annotations)
{
}

QString CopyNumberVariant::toStringWithMetaData() const
{
	return toString() + " regions=" + QString::number(num_regs_) + " size=" + QString::number((end_-start_)/1000.0, 'f', 3) + "kb";
}

int CopyNumberVariant::copyNumber(const QByteArrayList& annotation_headers, bool throw_if_not_found) const
{
	for (int i=0; i<annotation_headers.count(); ++i)
	{
		if(annotation_headers[i] == "tumor_CN_change") //ClinCNV somatic
		{
			return annotations_[i].toInt();
		}
		else if (annotation_headers[i]=="CN_change") //ClinCNV germline
		{
			return annotations_[i].toInt();
		}
		else if (annotation_headers[i]=="region_copy_numbers") //CnvHunter
		{
			QByteArrayList parts = annotations_[i].split(',');

			int max = 0;
			QByteArray max_cn;
			QHash<QByteArray, int> cn_counts;
			foreach(const QByteArray& cn, parts)
			{
				int count_new = cn_counts[cn] + 1;
				if (count_new>max)
				{
					max = count_new;
					max_cn = cn;
				}
				cn_counts[cn] = count_new;
			}

			return Helper::toInt(max_cn, "copy-number");
		}
	}

	if (throw_if_not_found)
	{
		THROW(ProgrammingException, "Copy-number could not be determine for CNV: " + toString());
	}

	return -1;
}

void CopyNumberVariant::setCopyNumber(int cn, const QByteArrayList& annotation_headers, bool throw_if_not_found)
{
	bool found = false;
	for (int i=0; i<annotation_headers.count(); ++i)
	{
		if (annotation_headers[i]=="CN_change") //ClinCNV germline
		{
			annotations_[i] = QByteArray::number(cn);
			found = true;
		}
	}

	if (!found && throw_if_not_found)
	{
		THROW(ProgrammingException, "Copy-number could not be determine for CNV: " + toString());
	}
}

CnvList::CnvList()
	: type_(CnvListType::INVALID)
	, comments_()
	, annotation_headers_()
	, variants_()
{
}

bool CnvList::isValid() const
{
	return type_!=CnvListType::INVALID;
}

void CnvList::clear()
{
	type_ = CnvListType::INVALID;
	comments_.clear();
	variants_.clear();
	annotation_headers_.clear();
}

void CnvList::load(QString filename)
{
	loadInternal(filename, false);
}

void CnvList::loadHeaderOnly(QString filename)
{
	loadInternal(filename, true);
}

void CnvList::loadInternal(QString filename, bool header_only)
{
	//clear previous content
	clear();

	//parse header
	TSVFileStream file(filename);
	QByteArray type_prefix = "##ANALYSISTYPE=";
	foreach(QByteArray line, file.comments())
	{
		if (line.startsWith(type_prefix)) //analysis type
		{
			QByteArray type = line.mid(type_prefix.length()).trimmed();
			if (type=="CNVHUNTER_GERMLINE_SINGLE") type_ = CnvListType::CNVHUNTER_GERMLINE_SINGLE;
			else if (type=="CNVHUNTER_GERMLINE_MULTI") type_ = CnvListType::CNVHUNTER_GERMLINE_MULTI;
			else if (type=="CLINCNV_GERMLINE_SINGLE") type_ = CnvListType::CLINCNV_GERMLINE_SINGLE;
			else if (type=="CLINCNV_GERMLINE_MULTI") type_ = CnvListType::CLINCNV_GERMLINE_MULTI;
			else if (type=="CLINCNV_TUMOR_NORMAL_PAIR") type_ = CnvListType::CLINCNV_TUMOR_NORMAL_PAIR;
			else if (type=="CLINCNV_TUMOR_ONLY") type_ = CnvListType::CLINCNV_TUMOR_ONLY;
			else THROW(FileParseException, "CNV file '" + filename + "' contains unknown analysis type: " + type);
		}
		else if (line.startsWith("##DESCRIPTION=")) //header descriptions
		{
			QByteArrayList parts = line.trimmed().split('=');
			if (parts.count()>2)
			{
				setHeaderDesciption(parts[1], parts[2]);
			}
		}
		else //all other header lines
		{
			comments_ << line;
		}
	}
	if (type()==CnvListType::INVALID)
	{
		THROW(FileParseException, "CNV file '" + filename + "' is outdated. It does not contain an ##ANALYSISTYPE header line. Please re-run CNV calling!");
	}

	//handle column indices
	QVector<int> annotation_indices = BasicStatistics::range(file.columns(), 0, 1);
	int i_chr = file.colIndex("chr", true);
	annotation_indices.removeAll(i_chr);
	int i_start = file.colIndex("start", true);
	annotation_indices.removeAll(i_start);
	int i_end = file.colIndex("end", true);
	annotation_indices.removeAll(i_end);
	int i_genes = file.colIndex("genes", false);
	annotation_indices.removeAll(i_genes);
	int i_region_count = -1;

	if (type()==CnvListType::CNVHUNTER_GERMLINE_SINGLE)
	{
		//mandatory columns
		i_region_count = file.colIndex("region_count", false);
		annotation_indices.removeAll(i_region_count);
		//remove columns
		int i_sample = file.colIndex("sample", true);
		annotation_indices.removeAll(i_sample);
		int i_size = file.colIndex("size", true);
		annotation_indices.removeAll(i_size);
	}
	else if (type()==CnvListType::CNVHUNTER_GERMLINE_MULTI)
	{
		//mandatory columns
		i_region_count = file.colIndex("region_count", false);
		annotation_indices.removeAll(i_region_count);
		//remove columns
		int i_sample = file.colIndex("sample", true);
		annotation_indices.removeAll(i_sample);
		int i_size = file.colIndex("size", true);
		annotation_indices.removeAll(i_size);
	}
	else if (type()==CnvListType::CLINCNV_GERMLINE_SINGLE)
	{
		//mandatory columns
		i_region_count = file.colIndex("no_of_regions", false);
		annotation_indices.removeAll(i_region_count);
		//remove
		int i_size = file.colIndex("length_KB", true);
		annotation_indices.removeAll(i_size);
	}
	else if (type()==CnvListType::CLINCNV_GERMLINE_MULTI)
	{
		//mandatory columns
		int no_of_regions_idx = file.colIndex("no_of_regions", false);
		i_region_count = no_of_regions_idx>=0 ? no_of_regions_idx : -2; //not present
		//remove
		int i_sample = file.colIndex("sample", true);
		annotation_indices.removeAll(i_sample);
		int i_size = file.colIndex("size", true);
		annotation_indices.removeAll(i_size);
	}
	else if (type()==CnvListType::CLINCNV_TUMOR_NORMAL_PAIR)
	{
		//mandatory columns
		i_region_count = file.colIndex("number_of_regions", false);
		annotation_indices.removeAll(i_region_count);
		//remove
		int i_sample = file.colIndex("sample", true);
		annotation_indices.removeAll(i_sample);
		int i_size = file.colIndex("size", true);
		annotation_indices.removeAll(i_size);
	}
	else if (type()==CnvListType::CLINCNV_TUMOR_ONLY)
	{
		//mandatory columns
		i_region_count = file.colIndex("no_of_regions", false);
		annotation_indices.removeAll(i_region_count);
		//remove
		int i_size = file.colIndex("length_KB", true);
		annotation_indices.removeAll(i_size);
	}
	else
	{
		THROW(NotImplementedException, "Column handling for this CNV list with type not implemented!");
	}

	//check mandatory columns were found
	if (i_region_count==-1) THROW(FileParseException, "No column with region/exon count found!");
	if (i_genes==-1) THROW(FileParseException, "No column with genes found!");

	//parse annotation headers
	foreach(int index, annotation_indices)
	{
		annotation_headers_ << file.header()[index];
	}

	//parse content
	if (!header_only)
	{
		while (!file.atEnd())
		{
			QByteArrayList parts = file.readLine();
			if(parts.empty()) continue;

			//regions
			int region_count = 0;
			if (i_region_count>=0)
			{
				 region_count = parts[i_region_count].toInt();
			}

			//genes
			GeneSet genes = GeneSet::createFromText(parts[i_genes], ',');

			//parse annotation headers
			QByteArrayList annos;
			foreach(int index, annotation_indices)
			{
				annos << parts[index];
			}

			variants_.append(CopyNumberVariant(parts[i_chr], parts[i_start].toInt(), parts[i_end].toInt(), region_count, genes, annos));
		}
	}
}

void CnvList::store(QString filename)
{
	// check if CnvListType is valid
	if (type()==CnvListType::INVALID) THROW(NotImplementedException, "Invalid CnvListType! Cannot create file.");

	//open stream
	QSharedPointer<QFile> file = Helper::openFileForWriting(filename, true);
	QTextStream stream(file.data());

	//write header lines

	//analysis type
	stream << "##ANALYSISTYPE=" << typeAsString() << "\n";

	//comments
	foreach (const QByteArray& comment_line, comments_)
	{
		stream << comment_line << "\n";
	}

	//description
	foreach (QByteArray header, annotation_headers_)
	{
		if (annotation_header_desc_[header].trimmed() != "")
		{
			stream << "##DESCRIPTION=" << header << "=" << annotation_header_desc_[header] << "\n";
		}
	}

	// header line
	stream << "#chr\tstart\tend";
	QByteArrayList header_line = annotation_headers_;

	if (type()==CnvListType::CLINCNV_GERMLINE_SINGLE)
	{
		// assemble header line
		header_line.insert(2, "no_of_regions");
		header_line.insert(3, "length_KB");
		header_line.insert(5, "genes");
	}
	else if (type()==CnvListType::CLINCNV_GERMLINE_MULTI)
	{
		// assemble header line
		header_line.insert(0, "sample");
		header_line.insert(1, "size");
		header_line.insert(9, "genes");
	}
	else if (type()==CnvListType::CNVHUNTER_GERMLINE_SINGLE)
	{
		// assemble header line
		header_line.insert(0, "sample");
		header_line.insert(1, "size");
		header_line.insert(2, "region_count");
		header_line.insert(8, "genes");
	}
	else if (type()==CnvListType::CLINCNV_TUMOR_NORMAL_PAIR)
	{
		// assemble header line
		header_line.insert(0, "sample");
		header_line.insert(1, "size");
		header_line.insert(9, "number_of_regions");
		header_line.insert(10, "genes");
	}
	else if(type() == CnvListType::CLINCNV_TUMOR_ONLY)
	{
		// assemble header line
		header_line.insert(5, "no_of_regions");
		header_line.insert(6, "length_KB");
		header_line.insert(8, "genes");
	}
	else
	{
		THROW(NotImplementedException, "Export of this CnvListType is not supported!");
	}

	stream << "\t" << header_line.join("\t") << "\n";

	// CNVs
	foreach (CopyNumberVariant variant, variants_)
	{
		// write position:
		stream << variant.chr().strNormalized(true) << "\t" << variant.start() << "\t" << variant.end();
		QByteArrayList cnv_annotations = variant.annotations();

		if (type()==CnvListType::CLINCNV_GERMLINE_SINGLE)
		{
			// assemble CNV line
			cnv_annotations.insert(2, QByteArray::number(variant.regions()));
			cnv_annotations.insert(3, QByteArray::number(((variant.size() - 1)/1000.0), 'f', 3).rightJustified(8, ' '));
			cnv_annotations.insert(5, variant.genes().toStringList().join(",").toUtf8());
		}
		else if (type()==CnvListType::CLINCNV_GERMLINE_MULTI)
		{
			// assemble CNV line
			cnv_annotations.insert(0, "multi");
			cnv_annotations.insert(1, QByteArray::number(variant.size() - 1));
			cnv_annotations.insert(9, variant.genes().toStringList().join(", ").toUtf8());
		}
		else if (type()==CnvListType::CNVHUNTER_GERMLINE_SINGLE)
		{
			// assemble CNV line
			cnv_annotations.insert(0, "");
			cnv_annotations.insert(1, QByteArray::number(variant.size()));
			cnv_annotations.insert(2, QByteArray::number(variant.regions()));
			cnv_annotations.insert(8, variant.genes().toStringList().join(",").toUtf8());
		}
		else if (type()==CnvListType::CLINCNV_TUMOR_NORMAL_PAIR)
		{
			// assemble header line
			cnv_annotations.insert(0, "somatic");
			cnv_annotations.insert(1, QByteArray::number(variant.size()));
			cnv_annotations.insert(9, QByteArray::number(variant.regions()));
			cnv_annotations.insert(10, variant.genes().toStringList().join(",").toUtf8());
		}
		else if(type() == CnvListType::CLINCNV_TUMOR_ONLY)
		{
			// assemble CNV line
			cnv_annotations.insert(5, QByteArray::number(variant.regions()));
			cnv_annotations.insert(6, QByteArray::number(((variant.size() - 1)/1000.0), 'f', 3).rightJustified(8, ' '));
			cnv_annotations.insert(8, variant.genes().toStringList().join(",").toUtf8());
		}
		stream << "\t" << cnv_annotations.join("\t") << "\n";
	}

	stream.flush();
	file.data()->close();
}

QString CnvList::typeAsString() const
{
	if (type()==CnvListType::CNVHUNTER_GERMLINE_SINGLE) return "CNVHUNTER_GERMLINE_SINGLE";
	else if (type()==CnvListType::CNVHUNTER_GERMLINE_MULTI) return "CNVHUNTER_GERMLINE_MULTI";
	else if (type()==CnvListType::CLINCNV_GERMLINE_SINGLE) return "CLINCNV_GERMLINE_SINGLE";
	else if (type()==CnvListType::CLINCNV_GERMLINE_MULTI) return "CLINCNV_GERMLINE_MULTI";
	else if (type()==CnvListType::CLINCNV_TUMOR_NORMAL_PAIR) return "CLINCNV_TUMOR_NORMAL_PAIR";
	else if (type()==CnvListType::CLINCNV_TUMOR_ONLY) return "CLINCNV_TUMOR_ONLY";
	else if (type()==CnvListType::INVALID) return "INVALID";

	THROW(NotImplementedException, "Unknown CnvListType!");
}

CnvCallerType CnvList::caller() const
{
	CnvListType list_type = type();
	if (list_type==CnvListType::INVALID)
	{
		return CnvCallerType::INVALID;
	}
	else if (list_type==CnvListType::CNVHUNTER_GERMLINE_SINGLE || list_type==CnvListType::CNVHUNTER_GERMLINE_MULTI)
	{
		return CnvCallerType::CNVHUNTER;
	}
	else if (list_type==CnvListType::CLINCNV_GERMLINE_SINGLE || list_type==CnvListType::CLINCNV_GERMLINE_MULTI || list_type==CnvListType::CLINCNV_TUMOR_NORMAL_PAIR || list_type==CnvListType::CLINCNV_TUMOR_ONLY)
	{
		return CnvCallerType::CLINCNV;
	}
	else
	{
		THROW(ProgrammingException, "CNV list type not handled in CnvList::caller()!");
	}
}

QString CnvList::callerAsString() const
{
	CnvCallerType caller_type = caller();
	if (caller_type==CnvCallerType::CLINCNV)
	{
		return "ClinCNV";
	}
	else if (caller_type==CnvCallerType::CNVHUNTER)
	{
		return "CnvHunter";
	}
	else
	{
		THROW(ProgrammingException, "CNV caller type not handled in CnvList::callerAsString()!");
	}
}

QByteArray CnvList::build()
{
	//parse header line, e.g. "##GENOME_BUILD=GRCh38"
	for(QByteArray line : comments_)
	{
		if (line.startsWith("##GENOME_BUILD="))
		{
			return line.split('=').last().trimmed();
		}
	}

	return "";
}

QByteArray CnvList::qcMetric(QString name, bool throw_if_missing) const
{
	QByteArray value;

	foreach(QByteArray comment, comments_)
	{
		if (comment.contains(":"))
		{
			comment = comment.mid(2); //remove '##'

			int sep_pos = comment.indexOf(':');
			QByteArray key = comment.mid(0, sep_pos);

			//normal match
			if (key==name)
			{
				value = comment.mid(sep_pos+1).trimmed();
			}

			//special handling for CnvHunter/trio output (metrics are prefixed with processed sample name)
			key = key.split(' ').mid(1).join(' ');
			if (key==name)
			{
				value = comment.mid(sep_pos+1).trimmed();
			}
		}
	}

	if (value.isEmpty() && throw_if_missing)
	{
		THROW(ProgrammingException, "Cannot find QC metric '" + name + "' in CNV list header!");
	}

	return value;
}

QByteArray CnvList::headerDescription(QByteArray name) const
{
	return annotation_header_desc_.value(name, "");
}

void CnvList::setHeaderDesciption(QByteArray name, QByteArray desciption)
{
	annotation_header_desc_[name] = desciption;
}

int CnvList::annotationIndexByName(const QByteArray& name, bool throw_on_error, bool contains) const
{
	QList<int> matches;
	for(int i=0; i<annotation_headers_.count(); ++i)
	{
		if (!contains && annotation_headers_[i] == name )
		{
			matches.append(i);
		}
		if(contains && annotation_headers_[i].contains(name))
		{
			matches.append(i);
		}
	}

	//Error handling
	if (matches.count()<1)
	{
		if (throw_on_error)
		{
			THROW(ArgumentException, "Could not find annotation column '" + name + "' in CNV list!");
		}
		else
		{
			return -1;
		}
	}

	if (matches.count()>1)
	{
		if (throw_on_error)
		{
			THROW(ArgumentException, "Found multiple annotation columns for '" + name + "' in CNV list!");
		}
		else
		{
			return -2;
		}
	}

	return matches.at(0);
}

long long CnvList::totalCnvSize() const
{
	long long total_size = 0;
	for(const CopyNumberVariant& variant : variants_)
	{
		total_size += variant.size();
	}
	return total_size;
}

KeyValuePair CnvList::split(const QByteArray& string, char sep)
{
	QByteArrayList parts = string.split(sep);

	QString key = parts.takeFirst().trimmed().mid(2); //remove '##'
	QString value = parts.join(sep).trimmed();

	return KeyValuePair(key, value);
}

CnvListCallData CnvList::getCallData(const CnvList& cnvs, QString filename, QString ps_name, bool ignore_inval_header_lines)
{
	//parse file header
	CnvListCallData out;

	out.caller = cnvs.callerAsString();

	foreach(const QByteArray& line, cnvs.comments())
	{
		if (line.contains(":"))
		{
			KeyValuePair pair = split(line, ':');

			if (pair.key.endsWith(" version"))
			{
				out.caller_version = pair.value;
			}
			else if (pair.key.endsWith(" finished on"))
			{
				out.call_date = QDateTime::fromString(pair.value, "yyyy-MM-dd hh:mm:ss");
			}
			else //quality metrics
			{
				if (pair.key.startsWith(ps_name + " ")) //remove sample name prefix (CnvHunter only)
				{
					pair.key = pair.key.mid(ps_name.length()+1).trimmed();
				}

				out.quality_metrics.insert(pair.key, pair.value);
			}
		}
		else if(!ignore_inval_header_lines)
		{
			THROW(FileParseException, "Invalid header line '" + line + "' in file '" + filename + "'!");
		}
	}

	if (out.call_date.isNull()) //fallback if CNV file does not contain any dates
	{
		if(filename != "") out.call_date = QFileInfo(filename).created();
		else THROW(ArgumentException, "Cannot determine date of CnvHunter file, not given in header and there is no filename given.");
	}

	return out;

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context"
	xsi:schemaLocation="http://www.springframework.org/schema/beans
      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
       http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context-3.0.xsd
         http://www.springframework.org/schema/mvc
		http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
	<!-- 使用annotation 自动注册bean, 并保证@Required、@Autowired的属性被注入 -->
	<context:component-scan base-package="org.jeecgframework.core.aop" />
</beans>


text:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />

    <title>Inédit Reporter</title>
    <meta name="description" content="Informations en vrac, inédites et de qualité." />

    <meta name="HandheldFriendly" content="True" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <link rel="shortcut icon" href="//inedit-reporter.github.io/themes/Roon/favicon.ico">

    <link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Merriweather:400,700,400italic,700italic|Open+Sans:400italic,700italic,700,400">
    <link rel="stylesheet" type="text/css" href="//inedit-reporter.github.io/themes/Roon/assets/css/screen.css?v=1.0.0" />

    <link rel="canonical" href="https://inedit-reporter.github.io" />
    <meta name="generator" content="Ghost ?" />
    <link rel="alternate" type="application/rss+xml" title="Inédit Reporter" href="https://inedit-reporter.github.io/rss" />
    <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/default.min.css">

Tag : Education

        <time datetime="2016-02-04">04 Février, 2016</time>

Réformer l'orthographe, une nécessité ?

La réforme de l'orthographe de 1990, la plus récente, a suscité de vives passions. Récemment, les éditeurs français ont décidé d'un commun accord d'adopter ces recommendations dans leurs manuels scolaires. La question se pose toujours : réformer, est-ce nécessaire ? La réponse divise les spécialistes, mais deux

        Lire la suite

Aucun billet publié

    Page 1 sur 1

            Inédit Reporter


text:
#ifndef WXWEBVIEWPRIVATE_H
#define WXWEBVIEWPRIVATE_H

#include "config.h"
#include "EditCommand.h"
#include "EditCommandWx.h"
#include "Page.h"
#include "wtf/Vector.h"

#include <wx/timer.h>

class WebViewPrivate
{
public:
    WebViewPrivate() :
        page(0)
    {}

    WebCore::Page* page;

    wxTimer tripleClickTimer;
    wxPoint tripleClickPos;

    WTF::Vector<EditCommandWx> undoStack;
    WTF::Vector<EditCommandWx> redoStack;
};

#endif


text:
import logging

from flask import abort, flash, redirect, render_template, request, url_for

from flask_login import current_user, login_required, login_user, logout_user
from redash import __version__, limiter, models, settings
from redash.authentication import current_org, get_login_url, get_next_path
from redash.authentication.account import (
    BadSignature,
    SignatureExpired,
    send_password_reset_email,
    send_user_disabled_email,
    send_verify_email,
    validate_token,
)
from redash.handlers import routes
from redash.handlers.base import json_response, org_scoped_rule
from redash.version_check import get_latest_version
from sqlalchemy.orm.exc import NoResultFound

logger = logging.getLogger(__name__)

def get_google_auth_url(next_path):
    if settings.MULTI_ORG:
        google_auth_url = url_for(
            "google_oauth.authorize_org", next=next_path, org_slug=current_org.slug
        )
    else:
        google_auth_url = url_for("google_oauth.authorize", next=next_path)
    return google_auth_url

def render_token_login_page(template, org_slug, token, invite):
    try:
        user_id = validate_token(token)
        org = current_org._get_current_object()
        user = models.User.get_by_id_and_org(user_id, org)
    except NoResultFound:
        logger.exception(
            "Bad user id in token. Token= , User id= %s, Org=%s",
            user_id,
            token,
            org_slug,
        )
        return (
            render_template(
                "error.html",
                error_message="Invalid invite link. Please ask for a new one.",
            ),
            400,
        )
    except (SignatureExpired, BadSignature):
        logger.exception("Failed to verify invite token: %s, org=%s", token, org_slug)
        return (
            render_template(
                "error.html",
                error_message="Your invite link has expired. Please ask for a new one.",
            ),
            400,
        )

    if invite and user.details.get("is_invitation_pending") is False:
        return (
            render_template(
                "error.html",
                error_message=(
                    "This invitation has already been accepted. "
                    "Please try resetting your password instead."
                ),
            ),
            400,
        )

    status_code = 200
    if request.method == "POST":
        if "password" not in request.form:
            flash("Bad Request")
            status_code = 400
        elif not request.form["password"]:
            flash("Cannot use empty password.")
            status_code = 400
        elif len(request.form["password"]) < 6:
            flash("Password length is too short (<6).")
            status_code = 400
        else:
            if invite or user.is_invitation_pending:
                user.is_invitation_pending = False
            user.hash_password(request.form["password"])
            models.db.session.add(user)
            login_user(user)
            models.db.session.commit()
            return redirect(url_for("redash.index", org_slug=org_slug))

    google_auth_url = get_google_auth_url(url_for("redash.index", org_slug=org_slug))

    return (
        render_template(
            template,
            show_google_openid=settings.GOOGLE_OAUTH_ENABLED,
            google_auth_url=google_auth_url,
            show_saml_login=current_org.get_setting("auth_saml_enabled"),
            show_remote_user_login=settings.REMOTE_USER_LOGIN_ENABLED,
            show_ldap_login=settings.LDAP_LOGIN_ENABLED,
            org_slug=org_slug,
            user=user,
        ),
        status_code,
    )

@routes.route(org_scoped_rule("/invite/<token>"), methods=["GET", "POST"])
def invite(token, org_slug=None):
    return render_token_login_page("invite.html", org_slug, token, True)

@routes.route(org_scoped_rule("/reset/<token>"), methods=["GET", "POST"])
def reset(token, org_slug=None):
    return render_token_login_page("reset.html", org_slug, token, False)

@routes.route(org_scoped_rule("/verify/<token>"), methods=["GET"])
def verify(token, org_slug=None):
    try:
        user_id = validate_token(token)
        org = current_org._get_current_object()
        user = models.User.get_by_id_and_org(user_id, org)
    except (BadSignature, NoResultFound):
        logger.exception(
            "Failed to verify email verification token: %s, org=%s", token, org_slug
        )
        return (
            render_template(
                "error.html",
                error_message="Your verification link is invalid. Please ask for a new one.",
            ),
            400,
        )

    user.is_email_verified = True
    models.db.session.add(user)
    models.db.session.commit()

    template_context = {"org_slug": org_slug} if settings.MULTI_ORG else {}
    next_url = url_for("redash.index", **template_context)

    return render_template("verify.html", next_url=next_url)

@routes.route(org_scoped_rule("/forgot"), methods=["GET", "POST"])
def forgot_password(org_slug=None):
    if not current_org.get_setting("auth_password_login_enabled"):
        abort(404)

    submitted = False
    if request.method == "POST" and request.form["email"]:
        submitted = True
        email = request.form["email"]
        try:
            org = current_org._get_current_object()
            user = models.User.get_by_email_and_org(email, org)
            if user.is_disabled:
                send_user_disabled_email(user)
            else:
                send_password_reset_email(user)
        except NoResultFound:
            logging.error("No user found for forgot password: %s", email)

    return render_template("forgot.html", submitted=submitted)

@routes.route(org_scoped_rule("/verification_email/"), methods=["POST"])
def verification_email(org_slug=None):
    if not current_user.is_email_verified:
        send_verify_email(current_user, current_org)

    return json_response(
        {
            "message": "Please check your email inbox in order to verify your email address."
        }
    )

@routes.route(org_scoped_rule("/login"), methods=["GET", "POST"])
@limiter.limit(settings.THROTTLE_LOGIN_PATTERN)
def login(org_slug=None):
    # We intentionally use == as otherwise it won't actually use the proxy. So weird :O
    # noinspection PyComparisonWithNone
    if current_org == None and not settings.MULTI_ORG:
        return redirect("/setup")
    elif current_org == None:
        return redirect("/")

    index_url = url_for("redash.index", org_slug=org_slug)
    unsafe_next_path = request.args.get("next", index_url)
    next_path = get_next_path(unsafe_next_path)
    if current_user.is_authenticated:
        return redirect(next_path)

    if request.method == "POST":
        try:
            org = current_org._get_current_object()
            user = models.User.get_by_email_and_org(request.form["email"], org)
            if (
                user
                and not user.is_disabled
                and user.verify_password(request.form["password"])
            ):
                remember = "remember" in request.form
                login_user(user, remember=remember)
                return redirect(next_path)
            else:
                flash("Wrong email or password.")
        except NoResultFound:
            flash("Wrong email or password.")

    google_auth_url = get_google_auth_url(next_path)

    return render_template(
        "login.html",
        org_slug=org_slug,
        next=next_path,
        email=request.form.get("email", ""),
        show_google_openid=settings.GOOGLE_OAUTH_ENABLED,
        google_auth_url=google_auth_url,
        show_password_login=current_org.get_setting("auth_password_login_enabled"),
        show_saml_login=current_org.get_setting("auth_saml_enabled"),
        show_remote_user_login=settings.REMOTE_USER_LOGIN_ENABLED,
        show_ldap_login=settings.LDAP_LOGIN_ENABLED,
    )

@routes.route(org_scoped_rule("/logout"))
def logout(org_slug=None):
    logout_user()
    return redirect(get_login_url(next=None))

def base_href():
    if settings.MULTI_ORG:
        base_href = url_for("redash.index", _external=True, org_slug=current_org.slug)
    else:
        base_href = url_for("redash.index", _external=True)

    return base_href

def date_time_format_config():
    date_format = current_org.get_setting("date_format")
    date_format_list = set(["DD/MM/YY", "MM/DD/YY", "YYYY-MM-DD", settings.DATE_FORMAT])
    time_format = current_org.get_setting("time_format")
    time_format_list = set(["HH:mm", "HH:mm:ss", "HH:mm:ss.SSS", settings.TIME_FORMAT])
    return {
        "dateFormat": date_format,
        "dateFormatList": list(date_format_list),
        "timeFormatList": list(time_format_list),
        "dateTimeFormat": "{0} {1}".format(date_format, time_format),
    }

def number_format_config():
    return {
        "integerFormat": current_org.get_setting("integer_format"),
        "floatFormat": current_org.get_setting("float_format"),
    }

def client_config():
    if not current_user.is_api_user() and current_user.is_authenticated:
        client_config = {
            "newVersionAvailable": bool(get_latest_version()),
            "version": __version__,
        }
    else:
        client_config = {}

    if (
        current_user.has_permission("admin")
        and current_org.get_setting("beacon_consent") is None
    ):
        client_config["showBeaconConsentMessage"] = True

    defaults = {
        "allowScriptsInUserInput": settings.ALLOW_SCRIPTS_IN_USER_INPUT,
        "showPermissionsControl": current_org.get_setting(
            "feature_show_permissions_control"
        ),
        "hidePlotlyModeBar": current_org.get_setting(
            "hide_plotly_mode_bar"
        ),
        "disablePublicUrls": current_org.get_setting("disable_public_urls"),
        "allowCustomJSVisualizations": settings.FEATURE_ALLOW_CUSTOM_JS_VISUALIZATIONS,
        "autoPublishNamedQueries": settings.FEATURE_AUTO_PUBLISH_NAMED_QUERIES,
        "extendedAlertOptions": settings.FEATURE_EXTENDED_ALERT_OPTIONS,
        "mailSettingsMissing": not settings.email_server_is_configured(),
        "dashboardRefreshIntervals": settings.DASHBOARD_REFRESH_INTERVALS,
        "queryRefreshIntervals": settings.QUERY_REFRESH_INTERVALS,
        "googleLoginEnabled": settings.GOOGLE_OAUTH_ENABLED,
        "ldapLoginEnabled": settings.LDAP_LOGIN_ENABLED,
        "pageSize": settings.PAGE_SIZE,
        "pageSizeOptions": settings.PAGE_SIZE_OPTIONS,
        "tableCellMaxJSONSize": settings.TABLE_CELL_MAX_JSON_SIZE,
    }

    client_config.update(defaults)
    client_config.update({"basePath": base_href()})
    client_config.update(date_time_format_config())
    client_config.update(number_format_config())

    return client_config

def messages():
    messages = []

    if not current_user.is_email_verified:
        messages.append("email-not-verified")

    if settings.ALLOW_PARAMETERS_IN_EMBEDS:
        messages.append("using-deprecated-embed-feature")

    return messages

@routes.route("/api/config", methods=["GET"])
def config(org_slug=None):
    return json_response(
        {"org_slug": current_org.slug, "client_config": client_config()}
    )

@routes.route(org_scoped_rule("/api/session"), methods=["GET"])
@login_required
def session(org_slug=None):
    if current_user.is_api_user():
        user = {"permissions": [], "apiKey": current_user.id}
    else:
        user = {
            "profile_image_url": current_user.profile_image_url,
            "id": current_user.id,
            "name": current_user.name,
            "email": current_user.email,
            "groups": current_user.group_ids,
            "permissions": current_user.permissions,
        }

    return json_response(
        {
            "user": user,
            "messages": messages(),
            "org_slug": current_org.slug,
            "client_config": client_config(),
        }
    )


text:
<!DOCTYPE html>

  <title>Bootstrap Table Examples For Test</title>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="description" content="An extended Bootstrap table with radio, checkbox, sort, pagination, and other added features.">
  <meta name="keywords" content="table, bootstrap, bootstrap plugin, bootstrap resources, bootstrap table, jQuery plugin">
  <meta name="author" content="Zhixin Wen, and Bootstrap table contributors">

  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.2/css/bulma.min.css">
  <link rel="stylesheet" href="https://unpkg.com/@fortawesome/fontawesome-free@5.12.1/css/all.min.css">


text:
package com.connect_group.thymesheet.query;

import java.util.Arrays;
import java.util.Collection;

import org.junit.Test;
import org.thymeleaf.dom.Comment;
import org.thymeleaf.dom.Element;

import com.connect_group.thymesheet.css.selectors.NodeSelectorException;
import com.connect_group.thymesheet.query.HtmlElements;

import static org.hamcrest.CoreMatchers.*;
import static org.junit.matchers.JUnitMatchers.*;
import static org.junit.Assert.*;

public class HtmlElementsTests {

	@Test
	public void shouldAddAllElementsOfACollection_WhenConstructedUsingACollection() throws NodeSelectorException {
		Element[] testArray = new Element[] {
				new Element("banana"),
				new Element("apple")
		};

		HtmlElements tags = new HtmlElements(Arrays.asList(testArray));
		assertThat(tags.get(0).tagName(), is("banana"));
		assertThat(tags.get(1).tagName(), is("apple"));
	}

	@Test
	public void shouldReturnEmptyElementsObject_WhenMatchingCriteriaNotMet() throws NodeSelectorException {
		HtmlElements tags = getSimpleElements();
		assertThat(tags.matching("banana"), instanceOf(HtmlElements.class));
		assertThat(tags.matching("banana").size(), is(0));
	}

	@Test
	public void shouldImplementCollectionOfTag() {
		@SuppressWarnings("unused")
		Collection<HtmlElement> collection = new HtmlElements();
	}

	@Test
	public void shouldReturnNthElement_WhenElementAtIndexIsRequested() {
		HtmlElements tags = getSimpleElements();
		assertThat(tags.get(0).tagName(), is("body"));

	}

	@Test
	public void shouldReturnExpectedElements_WhenMatchingCriteriaOnDocument() throws NodeSelectorException {
		HtmlElements tags = getSimpleElements();

		assertThat(tags.matching("p").size(), is(1));
		assertThat(tags.matching("p").get(0).tagName(), is("p"));
	}

	@Test
	public void shouldReturnExpectedElements_WhenMatchingCriteriaOnElement() throws NodeSelectorException {
		Element p = new Element("p");
		p.addChild(new Element("a"));
		HtmlElements tags = new HtmlElements(p);

		assertThat(tags.matching("a").size(), is(1));
		assertThat(tags.matching("a").get(0).tagName(), is("a"));
	}

	private HtmlElements getSimpleElements() {
		Element h1=new Element("h1");
		Element p=new Element("p");
		Element body=new Element("body");
		Comment banana=new Comment("banana");

		body.addChild(h1);
		body.addChild(p);
		body.addChild(banana);
		HtmlElements elements = new HtmlElements(body);
		return elements;
	}

}


text:
'use strict';

const should = require('should'),
      sinon  = require('sinon'),
      helper = require('./helper');

describe('Static: trigger', () => {
  const method = require('../../../../lib/sdk/static/trigger');

  const id = 100,
        meta = {
          foo: 'bar'
        },
        options = {};

  it('makes the correct call to post', () => {
    const context = helper.getContext();

    context.request.post.returns(global.Promise.resolve());

    return method(id, meta, options, context).
      then(_ => {
        context.request.post.called.should.eql(true);
        context.request.post.calledWithExactly({
          uri: `${context.uri}/trigger`,
          body: { meta }
        }).should.eql(true);
      });
  });

  it('defaults body to an empty meta object', () => {
    const context = helper.getContext();

    context.request.post.returns(global.Promise.resolve());

    return method(id, {}, options, context).
      then(_ => {
        context.request.post.args[0][0].body.should.eql({ meta: {} });
      });
  });

  it('resolves when post resolves', () => {
    const context = helper.getContext(),
          result = sinon.stub();

    context.request.post.returns(global.Promise.resolve(result));

    return method(id, meta, options, context).should.be.fulfilled(result);
  });

  it('rejects when post rejects', () => {
    const context = helper.getContext(),
          error = new Error('foo');

    context.request.post.returns(global.Promise.reject(error));

    return method(id, meta, options, context).should.be.rejectedWith(error);
  });
});


text:
@interface YYChatViewController ()<UITableViewDataSource, NSFetchedResultsControllerDelegate, UITextViewDelegate, UINavigationControllerDelegate, UIImagePickerControllerDelegate>
{
    NSFetchedResultsController *_resultsControl;
}

@property (nonatomic, strong) NSLayoutConstraint *inputViewConstraint;//inputView底部约束
@property (nonatomic, strong) NSLayoutConstraint *inputViewHConstraint;//inputView高度约束
@property (nonatomic, weak) UITableView *tableView;
//@property (nonatomic, weak) YYInputView *inputView;
@property (nonatomic, strong) HttpTool *httpTool;
@end

@implementation YYChatViewController

- (HttpTool *)httpTool
{
    if (!_httpTool) {
        _httpTool = [[HttpTool alloc] init];
    }
    return _httpTool;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    //代码实现自动布局
    [self setupView];
    // 监听键盘
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(KeyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(KeyboardWillHide:) name:UIKeyboardWillHideNotification object:nil];

   // [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(KeyboardWillChangeFrame:) name:UIKeyboardWillChangeFrameNotification object:nil];
    //加载聊天数据
    [self loadMessage];
}

//- (void)KeyboardWillChangeFrame:(NSNotification *)noti
//{
//    NSDictionary *userInfo = noti.userInfo;
//
//    // 动画的持续时间
//    double duration = [userInfo[UIKeyboardAnimationDurationUserInfoKey] doubleValue];
//
//    // 键盘的frame
//    CGRect keyboardF = [userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
//
//    // 执行动画
//    [UIView animateWithDuration:duration animations:^{
//        // 工具条的Y值 == 键盘的Y值 - 工具条的高度
//        if (keyboardF.origin.y > self.view.height) { // 键盘的Y值已经远远超过了控制器view的高度
//            self.inputView.y = self.view.height - self.inputView.height;
//        } else {
//            self.inputView.y = keyboardF.origin.y - self.inputView.height;
//            //键盘弹出,表格滚动到底部
//            [self scrollToTableViewBottom];
//        }
//    }];
//}
- (void)KeyboardWillShow:(NSNotification *)noti
{
    NSLog(@"%@",noti.userInfo);
    //获取键盘的高度
    CGRect kbEndFrame = [noti.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
    CGFloat kbHeight = kbEndFrame.size.height;

//    if ([[UIDevice currentDevice].systemVersion doubleValue] < 8.0 && UIInterfaceOrientationIsLandscape(self.interfaceOrientation)) {
//        kbHeight = kbEndFrame.size.width;//适配iOS7
//    }
    self.inputViewConstraint.constant = kbHeight;

    //键盘弹出,表格滚动到底部
    [self scrollToTableViewBottom];
}

- (void)KeyboardWillHide:(NSNotification *)noti
{
    //隐藏键盘的时候,距离底部的约束永远为0
    self.inputViewConstraint.constant = 0;
}
//-(void)kbFrmWillChange:(NSNotification *)noti{
//    NSLog(@"%@",noti.userInfo);
//
//    // 获取窗口的高度
//
//    CGFloat windowH = [UIScreen mainScreen].bounds.size.height;
//
//
//
//    // 键盘结束的Frm
//    CGRect kbEndFrm = [noti.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
//    // 获取键盘结束的y值
//    CGFloat kbEndY = kbEndFrm.origin.y;
//
//
//    self.inputViewConstraint.constant = windowH - kbEndY;
//}

#pragma mark -代码实现自动布局 用VFL
- (void)setupView
{
    //创建tableView
    UITableView *tableView = [[UITableView alloc] init];
    tableView.dataSource = self;
    tableView.translatesAutoresizingMaskIntoConstraints = NO;
    [self.view addSubview:tableView];
    self.tableView = tableView;

    //创建InputView
    YYInputView *inputView = [YYInputView inputView];
    inputView.translatesAutoresizingMaskIntoConstraints = NO;
    inputView.msgTextView.delegate = self;
    [inputView.addBtn addTarget:self action:@selector(addBtnClick) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:inputView];
    //self.inputView = inputView;

    //自动布局
    //水平方向上的约束
    NSDictionary *views = @{@"tableView":tableView,@"inputView":inputView};
    //1.tableView的约束
   NSArray *tableViewHC = [NSLayoutConstraint constraintsWithVisualFormat:@"H:|-0-[tableView]-0-|" options:0 metrics:nil views:views];
    [self.view addConstraints:tableViewHC];

    //2.inputView的约束
    NSArray *inputViewHC = [NSLayoutConstraint constraintsWithVisualFormat:@"H:|-0-[inputView]-0-|" options:0 metrics:nil views:views];
    [self.view addConstraints:inputViewHC];

    //垂直方向上的约束
    NSArray *vConstraints = [NSLayoutConstraint constraintsWithVisualFormat:@"V:|-0-[tableView]-0-[inputView(50)]-0-|" options:0 metrics:nil views:views];
    self.inputViewConstraint = [vConstraints lastObject];
    self.inputViewHConstraint = vConstraints[2];
    [self.view addConstraints:vConstraints];

}

#pragma mark -选择图片
- (void)addBtnClick
{
    UIImagePickerController *picker = [[UIImagePickerController alloc] init];
    picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
    picker.delegate = self;
    [self presentViewController:picker animated:YES completion:nil];
}

#pragma mark -UIImagePickerController代理
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary<NSString *,id> *)info
{
    [self dismissViewControllerAnimated:picker completion:nil];
    //获取图片
    UIImage *image = info[UIImagePickerControllerOriginalImage];
    //将图片发上传到文件服务器
    //文件上传路径http://localhost:8080/imfileserver/Upload/Image/文件名
    //1.获取文件名 用户名+时间
    NSString *user = [YYUserInfo sharedYYUserInfo].user;
    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
    dateFormatter.dateFormat = @"yyyyMMddHHmmss";
    NSString *timeStr = [dateFormatter stringFromDate:[NSDate date]];
    NSString *fileName = [user stringByAppendingString:timeStr];

    //2.拼接文件上传路径
    NSString *uploadURL = [@"http://localhost:8080/imfileserver/Upload/Image/" stringByAppendingString:fileName];

    //3.使用http put上传文件(put比post方式更简单,速度更快)
    [self.httpTool uploadData:UIImageJPEGRepresentation(image, 0.75) url:[NSURL URLWithString:uploadURL] progressBlock:nil completion:^(NSError *error) {
        if (!error) {
            NSLog(@"上传成功");
            [self sendMessageWithText:uploadURL bodyType:@"image"];
        }
    }];

    //图片发送成功,将图片的URL传给openfire服务器

}

#pragma mark -加载XMPPMessageArichiving数据库数据显示在表格中
- (void)loadMessage
{
    //上下文
    NSManagedObjectContext *context = [YYXMPPTool sharedYYXMPPTool].msgArchivingStorage.mainThreadManagedObjectContext;
    //请求对象
    NSFetchRequest *request = [NSFetchRequest fetchRequestWithEntityName:@"XMPPMessageArchiving_Message_CoreDataObject"];
    //过滤,排序
    //1.当前登录用户JID的消息
    //2.好友JID的消息
    NSPredicate *predicate = [NSPredicate predicateWithFormat:@"streamBareJidStr = %@ AND bareJidStr = %@", [YYUserInfo sharedYYUserInfo].jid, self.fJid.bare];
    request.predicate = predicate;
    //时间升序
    NSSortDescriptor *sort = [NSSortDescriptor sortDescriptorWithKey:@"timestamp" ascending:YES];
    request.sortDescriptors = @[sort];
    //查询
    _resultsControl = [[NSFetchedResultsController alloc] initWithFetchRequest:request managedObjectContext:context sectionNameKeyPath:nil cacheName:nil];
    _resultsControl.delegate = self;
    NSError *error = nil;
    [_resultsControl performFetch:&error];
    if (error) {
        YYLog(@"%@", error);
    }
}

#pragma mark -tableViewDataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return _resultsControl.fetchedObjects.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *ID = @"MessageCell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if (!cell) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:ID];
    }

    //获取聊天消息对象
    XMPPMessageArchiving_Message_CoreDataObject *message = _resultsControl.fetchedObjects[indexPath.row];
    //显示消息
    //判断是图片还是文本
    NSString *bodyType = [message.message attributeStringValueForName:@"bodyType"];
    if ([bodyType isEqualToString:@"image"]) {
        [cell.imageView sd_setImageWithURL:[NSURL URLWithString:message.body] placeholderImage:[UIImage imageNamed:@"DefaultProfileHead"]];
        cell.textLabel.text = nil;
        return cell;
    }
//    else if ([bodyType isEqualToString:@"text"]) {
//       if ([message.outgoing boolValue]) { //自己发的消息
//          cell.textLabel.text = [NSString stringWithFormat:@"Me: %@", message.body];
//        }else { //对方发的消息
//          cell.textLabel.text = [NSString stringWithFormat:@"Other: %@", message.body];
//        }
//        cell.imageView.image = nil;
//    }

    if ([message.outgoing boolValue]) { //自己发的消息
        cell.textLabel.text = [NSString stringWithFormat:@"Me: %@", message.body];
        cell.imageView.image = nil;
    }else { //对方发的消息
        cell.textLabel.text = [NSString stringWithFormat:@"Other: %@", message.body];
        cell.imageView.image = nil;
    }

    return cell;
}

#pragma mark -NSFetchedResultsController代理方法,当数据库内容发生改变时会调用
- (void)controllerDidChangeContent:(NSFetchedResultsController *)controller
{
    //数据库数据发生改变,刷新表格
    [self.tableView reloadData];
    [self scrollToTableViewBottom];
}

#pragma mark -UITextView代理方法
- (void)textViewDidChange:(UITextView *)textView
{
    CGFloat contentH = textView.contentSize.height;
    if (contentH > 33 && contentH < 70) { //高度在三行内
        self.inputViewHConstraint.constant = contentH + 18;
    }

    NSString *text = textView.text;
    //换行就相当于点了Send
    if ([text rangeOfString:@"\n"].length != 0) {
        //去除换行符
        text = [text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
        //发送数据
        [self sendMessageWithText:text bodyType:@"text"];
        //清空输入框的消息
        textView.text = nil;

        //发送完消息后改变约束
        self.inputViewHConstraint.constant = 50;
    }
}

#pragma mark -发送聊天消息
- (void)sendMessageWithText:(NSString *)text bodyType:(NSString *)bodyType
{
    XMPPMessage *message = [XMPPMessage messageWithType:@"chat" to:self.fJid];//type:chat代表个人聊天(私聊)
    //bodyType为text:纯文本 image:图片
    if ([bodyType isEqualToString:@"image"]) {
        [message addAttributeWithName:@"bodyType" stringValue:bodyType];
    }
    //[message addAttributeWithName:@"bodyType" stringValue:bodyType];
    //设置消息内容
    [message addBody:text];
    [[YYXMPPTool sharedYYXMPPTool].xmppStream sendElement:message];
}

#pragma mark -滚动到表格底部
- (void)scrollToTableViewBottom
{
    NSInteger lastRow = _resultsControl.fetchedObjects.count - 1;
    if (lastRow < 0) {
        return;
    }
    NSIndexPath *lastCell = [NSIndexPath indexPathForRow:lastRow inSection:0];
    [self.tableView scrollToRowAtIndexPath:lastCell atScrollPosition:UITableViewScrollPositionBottom animated:YES];
}
@end


text:
package eu.neoteric.starter.swagger;

import eu.neoteric.starter.embedded.MockEmbeddedServletContainerFactory;
import eu.neoteric.starter.mvc.StarterMvcAutoConfiguration;
import org.junit.After;
import org.junit.Test;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration;
import org.springframework.boot.autoconfigure.web.DispatcherServletAutoConfiguration;
import org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration;
import org.springframework.boot.autoconfigure.web.HttpMessageConvertersAutoConfiguration;
import org.springframework.boot.autoconfigure.web.ServerPropertiesAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.ConfigurableWebApplicationContext;

import javax.validation.constraints.NotNull;
import java.lang.annotation.*;

import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

public class SwaggerAutoConfigurationIntegrationTest {

    private ConfigurableWebApplicationContext wac;

    private MockMvc mockMvc;

    @After
    public void close() {
        if (this.wac != null) {
            this.wac.close();
        }
    }

    @Test
    public void defaultSwaggerEndpointLocation() throws Exception {
        this.wac = (ConfigurableWebApplicationContext) new SpringApplicationBuilder(SwaggerConfiguration.class).run();
        this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build();
        this.mockMvc.perform(get("/swagger")).andExpect(status().isOk());
    }

    @Test
    public void swaggerDisabledOnProperty() throws Exception {
        this.wac = (ConfigurableWebApplicationContext) new SpringApplicationBuilder(SwaggerConfiguration.class)
                .properties("neostarter.swagger.enabled=false")
                .run();
        this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build();
        this.mockMvc.perform(get("/swagger")).andExpect(status().isNotFound());
    }

    @Test
    public void shouldAddApiInfoDetails() throws Exception {
        this.wac = (ConfigurableWebApplicationContext) new SpringApplicationBuilder(SwaggerConfiguration.class)
                .properties("neostarter.swagger.license=license",
                        "neostarter.swagger.licenseUrl=licenseUrl",
                        "neostarter.swagger.title=ApiTitle",
                        "neostarter.swagger.description=ApiDescription",
                        "neostarter.swagger.termsOfServiceUrl=termsUrl",
                        "neostarter.swagger.contact.name=contactName",
                        "neostarter.swagger.contact.email=contactEmail",
                        "neostarter.swagger.contact.url=contactUrl",
                        "neostarter.swagger.version=2",
                        "neostarter.swagger.basePackage="
                        )
                .run();
        this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build();

        this.mockMvc.perform(get("/swagger"))
                .andExpect(status().isOk())
                .andExpect(jsonPath("$.info.license.name").value("license"))
                .andExpect(jsonPath("$.info.license.url").value("licenseUrl"))
                .andExpect(jsonPath("$.info.title").value("ApiTitle"))
                .andExpect(jsonPath("$.info.description").value("ApiDescription"))
                .andExpect(jsonPath("$.info.termsOfService").value("termsUrl"))
                .andExpect(jsonPath("$.info.contact.name").value("contactName"))
                .andExpect(jsonPath("$.info.contact.email").value("contactEmail"))
                .andExpect(jsonPath("$.info.contact.url").value("contactUrl"))
                .andExpect(jsonPath("$.info.version").value("2"));
    }

    @Target(ElementType.TYPE)
    @Retention(RetentionPolicy.RUNTIME)
    @Documented
    @Import({ServerPropertiesAutoConfiguration.class,
            DispatcherServletAutoConfiguration.class, StarterMvcAutoConfiguration.class,
            HttpMessageConvertersAutoConfiguration.class, ErrorMvcAutoConfiguration.class,
            PropertyPlaceholderAutoConfiguration.class})
    protected @interface MinimalWebConfiguration {
    }

    @Configuration
    @MinimalWebConfiguration
    @Import(SwaggerAutoConfiguration.class)
    @RestController
    public static class SwaggerConfiguration {

        @Bean
        public MockEmbeddedServletContainerFactory embeddedServletContainerFactory() {
            return new MockEmbeddedServletContainerFactory();
        }

        // For manual testing
        public static void main(String[] args) {
            SpringApplication.run(TestConfiguration.class, args);
        }

        @GetMapping("/hello/{name}")
        public String hello(@NotNull @PathVariable String name) {
            return "hello " + name;
        }

    }
}


text:
package com.pandits.opensource;

import java.util.Date;
import java.util.TimeZone;

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

public class JodaTimeUtilTest {

    private JodaTimeUtil jodaTimeUtil;

    @Before
    public void before() {
        jodaTimeUtil = new JodaTimeUtil();
    }

    @Test
    public void getDateInTimeZone() {
        long epochTime = 1398038663000L;
        TimeZone timeZone = TimeZone.getTimeZone("Pacific/Honolulu");
        Date date = new Date(epochTime);
        Date timeZoneSpecificDate = jodaTimeUtil.getAdjustedDateInTimeZone(date, timeZone);

        Assert.assertNotNull(timeZoneSpecificDate);
    }

    @Test
    public void getDayOfTheWeek() {
        long epochTime = 1398038663000L;
        int dayOfWeek = jodaTimeUtil.getDayOfTheWeek(epochTime);
        Assert.assertEquals(1, dayOfWeek);
    }

    @Test
    public void getDayOfTheWeekForTimeZone() {
        long epochTime = 1398038663000L;
        int dayOfWeek = jodaTimeUtil.getDayOfTheWeek(epochTime,
                TimeZone.getTimeZone("America/Los_Angeles"));
        Assert.assertEquals(7, dayOfWeek);
    }

    @Test
    public void getTimeOfDayInMillis() {
        long epochTime = 1398038663000L;
        long timeOfDay = jodaTimeUtil.getSecondsOfDayInMillis(epochTime);

        long expectedTimeOfTheDay = (4L * 60 + 23) * 1000;
        Assert.assertEquals(expectedTimeOfTheDay, timeOfDay);
    }

    @Test
    public void getHourOfTheDay() {
        long epochTime = 1398049773000L;
        long hourOfDay = jodaTimeUtil.getHourOfTheDay(epochTime,
                TimeZone.getTimeZone("America/Los_Angeles"));

        long hourOfTheDay = 20L;
        Assert.assertEquals(hourOfTheDay, hourOfDay);
    }

    @Test
    public void getHourOfTheDayForTimeZone() {
        long epochTime = 1398049773000L;
        long hourOfDay = jodaTimeUtil.getHourOfTheDay(epochTime);

        long hourOfTheDay = 3L;
        Assert.assertEquals(hourOfTheDay, hourOfDay);
    }

    @Test
    public void getMinuteOfTheDay() {
        long epochTime = 1398049773000L;
        long hourOfDay = jodaTimeUtil.getMinuteOfTheDay(epochTime);

        long hourOfTheDay = 189L;
        Assert.assertEquals(hourOfTheDay, hourOfDay);
    }

    @Test
    public void getMinuteOfTheDayForTimeZone() {
        long epochTime = 1398049773000L;
        long hourOfDay = jodaTimeUtil.getMinuteOfTheDay(epochTime,
                TimeZone.getTimeZone("America/Los_Angeles"));

        long hourOfTheDay = 1209L;
        Assert.assertEquals(hourOfTheDay, hourOfDay);
    }

    @Test
    public void getTimeOfDayInMillisForTimeZone() {
        long epochTime = 1398038663000L;
        long timeOfDay = jodaTimeUtil.getSecondsOfDayInMillis(epochTime,
                TimeZone.getTimeZone("America/Los_Angeles"));

        long expectedTimeOfTheDay = ((17L * 60 * 60) + (4L * 60) + 23) * 1000;
        Assert.assertEquals(expectedTimeOfTheDay, timeOfDay);
    }

    @Test
    public void spanIntervalInDays() {
        long epochTimeDayOne = 1398038663000L;
        long epochTimeDayThree = 1398038663000L + 2L * 24 * 60 * 60 * 1000;
        Date startDate = new Date(epochTimeDayOne);
        Date endDate = new Date(epochTimeDayThree);
        int numberOfDays = jodaTimeUtil.spanIntervalInDays(startDate, endDate);
        Assert.assertEquals(2, numberOfDays);
    }

    @Test
    public void spanIntervalInDaysSameDay() {
        long epochTimeDayOne = 1398038663000L;
        long epochTimeDaySameDayOne = 1398038663000L + (15L * 60 * 1000);
        Date startDate = new Date(epochTimeDayOne);
        Date endDate = new Date(epochTimeDaySameDayOne);
        int numberOfDays = jodaTimeUtil.spanIntervalInDays(startDate, endDate);
        Assert.assertEquals(0, numberOfDays);
    }

    @Test
    public void spanIntervalInWeeks() {
        long epochTimeDayOne = 1398038663000L;
        long epochTimeDayTwentyTwo = 1398038663000L + 22L * 24 * 60 * 60 * 1000;
        Date startDate = new Date(epochTimeDayOne);
        Date endDate = new Date(epochTimeDayTwentyTwo);
        int numberOfWeeks = jodaTimeUtil.spanIntervalInWeeks(startDate, endDate);
        Assert.assertEquals(3, numberOfWeeks);
    }

    @Test
    public void spanIntervalInWeeksSameWeek() {
        long epochTimeDayOne = 1398038663000L;
        long epochTimeDayThree = 1398038663000L + 3L * 24 * 60 * 60 * 1000;
        Date startDate = new Date(epochTimeDayOne);
        Date endDate = new Date(epochTimeDayThree);
        int numberOfWeeks = jodaTimeUtil.spanIntervalInWeeks(startDate, endDate);
        Assert.assertEquals(0, numberOfWeeks);
    }

    @Test
    public void spanIntervalInHours() {
        long epochTimeDayOne = 1398038663000L;
        long epochTimeDayOneAdvanceByFiveHours = 1398038669000L + 15L * 60 * 60 * 1000;
        Date startDate = new Date(epochTimeDayOne);
        Date endDate = new Date(epochTimeDayOneAdvanceByFiveHours);
        int numberOfHours = jodaTimeUtil.spanIntervalInHours(startDate, endDate);
        Assert.assertEquals(15, numberOfHours);
    }

    @Test
    public void spanIntervalInHoursLessThanOne() {
        long epochTimeDayOne = 1398038663000L;
        long epochTimeDayOneAdvanceByFiftyNineMinutes = 1398038663000L + 59L * 60 * 1000;
        Date startDate = new Date(epochTimeDayOne);
        Date endDate = new Date(epochTimeDayOneAdvanceByFiftyNineMinutes);
        int numberOfHours = jodaTimeUtil.spanIntervalInHours(startDate, endDate);
        Assert.assertEquals(0, numberOfHours);
    }

    @Test
    public void advanceToNextDayMidnight() {
        long epochTimeDayOne = 1398038663000L;
        Date date = new Date(epochTimeDayOne);
        Date midnightDate = jodaTimeUtil.advanceToNextDayMidnight(date);
        Assert.assertNotNull(midnightDate);

        long nextDayMidnight = 1398124800000L;
        Assert.assertEquals(nextDayMidnight, midnightDate.getTime());
    }

    @Test
    public void retrogressToThisDayMidnight() {
        long epochTimeDayOne = 1398225600000L;
        Date date = new Date(epochTimeDayOne);
        Date midnightDate = jodaTimeUtil.retrogressToThisDayMidnight(date);
        Assert.assertNotNull(midnightDate);

        long nextDayMidnight = 1398211200000L;
        Assert.assertEquals(nextDayMidnight, midnightDate.getTime());
    }

    @Test
    public void advanceBy() {
        long epochTimeDayOne = 1398225600000L;
        Date date = new Date(epochTimeDayOne);
        int numOfDays = 2;
        Date nextDayDate = jodaTimeUtil.advanceBy(date, numOfDays);
        Assert.assertNotNull(nextDayDate);

        long nextDay = epochTimeDayOne + 2 * 24L * 60 * 60 * 1000;
        Assert.assertEquals(nextDay, nextDayDate.getTime());
    }

    @Test
    public void retrogressBy() {
        long epochTimeDayOne = 1398225600000L;
        Date date = new Date(epochTimeDayOne);
        int numOfDays = 2;
        Date nextDayDate = jodaTimeUtil.retrogessBy(date, numOfDays);
        Assert.assertNotNull(nextDayDate);

        long nextDay = epochTimeDayOne - 2 * 24L * 60 * 60 * 1000;
        Assert.assertEquals(nextDay, nextDayDate.getTime());
    }
}


text:
<!DOCTYPE html>

	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0"/>
	<meta name="keywords" content="Discord, Monster Hunter Online, MHOnline, Tencent, CAPCOM, QQ, Hobby">
	<meta name="author" content="Monster Hunter Online Wiki">
	<link rel="apple-touch-icon" sizes="57x57" href="/apple-icon-57x57.png">
	<link rel="apple-touch-icon" sizes="60x60" href="/apple-icon-60x60.png">
	<link rel="apple-touch-icon" sizes="72x72" href="/apple-icon-72x72.png">
	<link rel="apple-touch-icon" sizes="76x76" href="/apple-icon-76x76.png">
	<link rel="apple-touch-icon" sizes="114x114" href="/apple-icon-114x114.png">
	<link rel="apple-touch-icon" sizes="120x120" href="/apple-icon-120x120.png">
	<link rel="apple-touch-icon" sizes="144x144" href="/apple-icon-144x144.png">
	<link rel="apple-touch-icon" sizes="152x152" href="/apple-icon-152x152.png">
	<link rel="apple-touch-icon" sizes="180x180" href="/apple-icon-180x180.png">
	<link rel="icon" type="image/png" sizes="192x192"  href="/android-icon-192x192.png">
	<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
	<link rel="icon" type="image/png" sizes="96x96" href="/favicon-96x96.png">
	<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
	<link rel="manifest" href="/manifest.json">
	<meta name="msapplication-TileColor" content="#ffffff">
	<meta name="msapplication-TileImage" content="/ms-icon-144x144.png">
	<meta name="theme-color" content="#ffffff">
	<title>MHOnline - Install</title>

	<link href="/css/icon.css" rel="stylesheet">
	<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
	<link href="/css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection"/>
	<link href="/css/style.css" type="text/css" rel="stylesheet" media="screen,projection"/>

Skills

Weapon Stone

Armor

Hunter Set

Weapons

Jewelry

Mosaics

Talismans

Crafting

Materials

Quests

Monsters

Gathering

Hunting Groups

Main NPCs

Cats

Food

FAQ

Translated Content

Install Guide

Translation Guide

VIP Guide

Home

Skillsarrow_drop_down

Itemsarrow_drop_down

Huntingarrow_drop_down

NPCsarrow_drop_down

Guidesarrow_drop_down

Home

							Skills

Skills

Weapon Stone

							Items

Armor

Hunter Set

Weapons

Jewelry

Mosaics

Talismans

Crafting

Materials

							Hunting

Quests

Monsters

Gathering

Hunting Groups

							NPCs

Main NPCs

Cats

Food

							Guides

FAQ

Translated Content

Install Guide

Translation Guide

VIP Guide

			menu

					Setting up a QQ account

							Go Here to get to this screen. Fill out the form and click sign up

							You will be taken to the phone verification screen (althought I have heard of lucky souls who skip this process)

							Click on the red box to change the country for phone verification, then enter your phone to get the verification code via SMS

							After the phone verification, you will get a verification email with a link in it. That will show you your QQ ID (it's completely made of numbers, and be sure to write it down or save it somewhere because finding it later can be a little convoluted)

							*if you have issues with getting a working phone number for the SMS, hop on the discord server and someone may be able to assist you in #help.

							Follow this guide to verify your account as an 18 year+ (althought you can do this step latter, you won't be able to play the game without this step)

					Installation guide via TGP

							Go Here and download TGP (Click the big button that says TGP).

							Go Here and download the latest Locale-Emulator.

							Extract the Locale-Emulator program with your favorite file extractor. (I use 7-zip because it's free.)

							Click "Install/Upgrade" if it warns you about japanese things ignore and click install on the next screen too.

							Run the LEGUI.exe program to make your locale chinese. Select the settings below and click "Save".

							Right click the tgpminiloader file you downloaded earlier and select "Run in Chinese".

							When it opens click the bottom right button.

							Put an install location in, or leave the current one if you so fancy, unselect the two check marks, and click the bottom right button here too. After that press the blue button in the middle.

							Wait for it to install...

							Click the big green button.

							Click next a bunch of times.

							Click Finish!

							Log in to your account and click the second option in the TGP window.

							Now to find MHO, click on the MMORPG button and then scroll down to MHO.

							Another damn green button.

							Wait for download to finish. This will be way faster than using the old method which we won't talk about.

							Once downloaded it will install in the background. You will hear the wonderful Monster Hunter theme music in the background while it does this...

							When the Youku bs comes up close out by the x at the top then go to your taskbar, right click it and click the bottom button.

							Uninstall that shit. (Unless you are into Chinese things. Like that.)

							At the same time you were uninstalling Youku this little popup probably happened. this means it was installed and you can run the game!

							If you installed it during maintenance you will see this:

							The game will update if it is not in maintenance. If another popup happens when you press the button, this is TGP asking if you would like to authorize TGP to keep Monster Hunter Online updated.  Click the left button which will be Yes!

Site Info

This site is paid for and maintained by @Reaver01.  If you would like to contribute to the development of this site, you can make a donation, or message me on our Discord channel.

					<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
						<input type="hidden" name="cmd" value="_s-xclick">
						<input type="hidden" name="hosted_button_id" value="CRDPXKLXJTTY2">
						<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">

					</form>

Discord

#newsupdate

#faq

#mhodiscussion

#raid-search

#help

#off-topic

				Made by @Reaver01 with Materialize


text:
from __future__ import print_function
# Time:  O(n * k), k is the length of the common prefix
# Space: O(1)

# Write a function to find the longest common prefix string
# amongst an array of strings.

class Solution(object):
    def longestCommonPrefix(self, strs):
        """
        :type strs: List[str]
        :rtype: str
        """
        if not strs:
            return ""

        for i in xrange(len(strs[0])):
            for string in strs[1:]:
                if i >= len(string) or string[i] != strs[0][i]:
                    return strs[0][:i]
        return strs[0]

if __name__ == "__main__":
    print(Solution().longestCommonPrefix(["hello", "heaven", "heavy"]))


text:
const Behavior = require('../../src/js/event/behavior');
const expect = require('chai').expect;
const jQuery = require('jquery');
const Resizer = require('../../src/js/event/resizer');

describe('Resizer', function() {
    describe('constructor', function() {
        it('should initialize Resizer', function() {
            const $image = jQuery('

');
            const behavior = new Behavior($image);
            const resizer = new Resizer(behavior);
            expect(resizer.constructor.name).to.equal('Resizer');
        });
    });
});


text:
package org.kuali.kfs.module.bc.document.service;

import java.math.BigDecimal;
import java.util.List;

import org.kuali.kfs.module.bc.businessobject.BudgetConstructionAppointmentFundingReasonCode;
import org.kuali.kfs.module.bc.businessobject.PendingBudgetConstructionAppointmentFunding;
import org.kuali.kfs.module.bc.businessobject.PendingBudgetConstructionGeneralLedger;
import org.kuali.kfs.module.bc.businessobject.SalarySettingExpansion;
import org.kuali.kfs.module.bc.util.SalarySettingFieldsHolder;
import org.kuali.rice.core.api.util.type.KualiInteger;
import org.kuali.rice.kim.api.identity.Person;

/**
 * This class defines methods a Salary Setting Service must provide The Salary Setting Service supports functionality associated
 * with detailed salary setting for an account as well as organization based salary setting by incumbent and by position.
 */
public interface SalarySettingService {

    /**
     * This method returns the disabled setting of the System Parameter controlling Budget module Salary Setting. Disabling Salary
     * Setting will cause any UI controls related to the salary setting functionality to not be displayed. Disabling will also cause
     * associated business rules checks to behave differently or not be run.
     *
     * @return
     */
    public boolean isSalarySettingDisabled();

    /**
     * determine whehter the given pending budget construction general ledger is paid at a biweekly or hourly rate
     *
     * @param pendingBudgetConstructionGeneralLedger the given pending budget construction general ledger
     * @return true if the given given pending budget construction general ledger is paid at a biweekly or hourly rate; otherwise,
     *         false
     */
    public boolean isHourlyPaid(PendingBudgetConstructionGeneralLedger pendingBudgetConstructionGeneralLedger);

    /**
     * determine whehter the given appointment funding is paid at a biweekly or hourly rate
     *
     * @param appointmentFunding the given appointment funding
     * @return true if the given appointment funding is paid at a biweekly or hourly rate; otherwise, false
     */
    public boolean isHourlyPaid(PendingBudgetConstructionAppointmentFunding appointmentFunding);

    /**
     * determine whehter the given object code is of a biweekly or hourly pay type
     *
     * @param fiscalYear the given fiscal year
     * @param chartOfAccountsCode the given chart of accounts code
     * @param objectCode the given object code
     * @return true if the given object code is of a biweekly or hourly pay type; otherwise, false
     */
    public boolean isHourlyPaidObject(Integer fiscalYear, String chartOfAccountsCode, String objectCode);

    /**
     * calculate the hourly pay rate from the request amount in the given appointment funding
     *
     * @param appointmentFunding the given apporintment funding
     * @return the hourly pay rate
     */
    public BigDecimal calculateHourlyPayRate(PendingBudgetConstructionAppointmentFunding appointmentFunding);

    /**
     * calculate the annual pay amount from the request pay rate in the given appointment funding
     *
     * @param appointmentFunding the given apporintment funding
     * @return the annual pay amount
     */
    public KualiInteger calculateAnnualPayAmount(PendingBudgetConstructionAppointmentFunding appointmentFunding);

    /**
     * normalize the hourly pay rate and annual pay amount of the given appointment funding
     *
     * @param appointmentFunding the given appointment funding
     */
    public void normalizePayRateAndAmount(PendingBudgetConstructionAppointmentFunding appointmentFunding);

    /**
     * calculate the fte quantity based on the information of the given appointment funding
     *
     * @param appointmentFunding the given appointment funding
     * @return the fte quantity calculated from the information of the given appointment funding
     */
    public BigDecimal calculateFteQuantityFromAppointmentFunding(PendingBudgetConstructionAppointmentFunding appointmentFunding);

    /**
     * calculate the FTE quantity through the given information
     *
     * @param payMonth the given number of pay months
     * @param fundingMonth the given number of funding months
     * @param requestedTimePercent the requested FTE time percent
     * @return the FTE quantity calculated from the given information
     */
    public BigDecimal calculateFteQuantity(Integer payMonth, Integer fundingMonth, BigDecimal requestedTimePercent);

    /**
     * calculate the CSF fte quantity based on the information of the given appointment funding
     *
     * @param appointmentFunding
     * @return the CSF fte quantity calculated from the information of the given appointment funding
     */
    public BigDecimal calculateCSFFteQuantityFromAppointmentFunding(PendingBudgetConstructionAppointmentFunding appointmentFunding);

    /**
     * calculate the CSF FTE quantity through the given information
     *
     * @param payMonth the given number of pay months
     * @param normalWorkMonth the given number of normal work months
     * @param requestedCSFTimePercent the requested CSF time percent
     * @return the CSF FTE quantity from the given information
     */
    public BigDecimal calculateCSFFteQuantity(Integer payMonth, Integer normalWorkMonth, BigDecimal requestedCSFTimePercent);

    /**
     * determine whether the given appointment funding can be vacated
     *
     * @param appointmentFunding the given appointment funding
     * @return true if the given appointment funding can be vacated; otherwise, false
     */
    public boolean canBeVacant(PendingBudgetConstructionAppointmentFunding appointmentFunding);

    /**
     * determine whehter the given appointment funding can be vacated
     *
     * @param appointmentFundings the given appointment funding collection that the given appointment funding belongs to
     * @param appointmentFunding the given appointment funding
     * @return true if the given appointment funding can be vacated; otherwise, false
     */
    public boolean canBeVacant(List<PendingBudgetConstructionAppointmentFunding> appointmentFundings, PendingBudgetConstructionAppointmentFunding appointmentFunding);

    /**
     * vacate the given appointment funding and create a vacant appointment funding based on the given funding
     *
     * @param appointmentFunding the given apporintment funding
     * @return a vacant appointment funding
     */
    public PendingBudgetConstructionAppointmentFunding vacateAppointmentFunding(PendingBudgetConstructionAppointmentFunding appointmentFunding);

    /**
     * vacate the given appointment funding, create a vacant appointment funding based on the given funding, and add the vacant line
     * into the given appointment funding collection
     *
     * @param appointmentFundings the given appointment funding collection that the given appointment funding belongs to
     * @param appointmentFunding the given apporintment funding
     * @return a vacant appointment funding
     */
    public PendingBudgetConstructionAppointmentFunding vacateAppointmentFunding(List<PendingBudgetConstructionAppointmentFunding> appointmentFundings, PendingBudgetConstructionAppointmentFunding appointmentFunding);

    /**
     * permanently delete the given appointment funding lines being purged
     *
     * @param purgedAppointmentFundings the given appointment funding collection being purged
     */
    public void purgeAppointmentFundings(List<PendingBudgetConstructionAppointmentFunding> purgedAppointmentFundings);

    /**
     * find the appointment funding from the given appointment funding collection, which has the same key information as the
     * specified vacant appointment funding
     *
     * @param appointmentFundings the given appointment funding collection
     * @param vacantAppointmentFunding the given vacant apporintment funding
     * @return the appointment funding from the given appointment funding collection, which has the same key information as the
     *         specified vacant appointment funding
     */
    public PendingBudgetConstructionAppointmentFunding findVacantAppointmentFunding(List<PendingBudgetConstructionAppointmentFunding> appointmentFundings, PendingBudgetConstructionAppointmentFunding vacantAppointmentFunding);

    /**
     * find the appointment funding from the given appointment funding collection, which has the same key information as the
     * specified appointment funding
     *
     * @param appointmentFundings the given appointment funding collection
     * @param vacantAppointmentFunding the given apporintment funding
     * @return the appointment funding from the given appointment funding collection, which has the same key information as the
     *         specified appointment funding
     */
    public PendingBudgetConstructionAppointmentFunding findAppointmentFunding(List<PendingBudgetConstructionAppointmentFunding> appointmentFundings, PendingBudgetConstructionAppointmentFunding appointmentFunding);

    /**
     * adjust the requested salary amount of the given appointment funding by amount
     *
     * @param appointmentFunding the given appointment funding
     */
    public void adjustRequestedSalaryByAmount(PendingBudgetConstructionAppointmentFunding appointmentFunding);

    /**
     * adjust the requested salary amount of the given appointment funding by percent
     *
     * @param appointmentFunding the given appointment funding
     */
    public void adjustRequestedSalaryByPercent(PendingBudgetConstructionAppointmentFunding appointmentFunding);

    /**
     * save the salary setting and its associated appointment funding
     *
     * @param salarySettingExpansion the given salary setting expansion, a pending budget construction GL object
     */
    public void saveSalarySetting(SalarySettingExpansion salarySettingExpansion);

    /**
     * save the pending budget general ledger rows associated with a given salary setting expansion
     * this also handles updating the special 2PLG row
     *
     * @param salarySettingExpansion
     */
    public void savePBGLSalarySetting(SalarySettingExpansion salarySettingExpansion);

    /**
     * save the given appointment fundings and associated salary setting expansion,
     * also known as, pending budget general ledger row
     *
     * @param appointmentFundings
     * @param isSalarySettingByIncumbent
     */
    public void saveSalarySetting(List<PendingBudgetConstructionAppointmentFunding> appointmentFundings, Boolean isSalarySettingByIncumbent);

    /**
     * save the given appointment fundings
     *
     * @param appointmentFundings the given appointment funding collection
     */
    public void saveAppointmentFundings(List<PendingBudgetConstructionAppointmentFunding> appointmentFundings);

    /**
     * reset the given appointment funcding as deleted
     *
     * @param appointmentFunding the given appointment funcding
     */
    public void resetAppointmentFunding(PendingBudgetConstructionAppointmentFunding appointmentFunding);

    /**
     * mark the given appointment funding as deleted
     *
     * @param appointmentFunding the given appointment funding
     */
    public void markAsDelete(PendingBudgetConstructionAppointmentFunding appointmentFunding);

    /**
     * revert the given appointment funding if it is just vacated
     *
     * @param appointmentFundings the given appointment funding collection
     * @param appointmentFunding the given appointment funding
     */
    public void revert(List<PendingBudgetConstructionAppointmentFunding> appointmentFundings, PendingBudgetConstructionAppointmentFunding appointmentFunding);

    /**
     * retrive the salary setting expension from the information provided by the given appointment funding
     *
     * @param appointmentFunding the given appointment funding
     * @return the salary setting expension with the information provided by the given appointment funding
     */
    public SalarySettingExpansion retriveSalarySalarySettingExpansion(PendingBudgetConstructionAppointmentFunding appointmentFunding);

    /**
     * retrieve a list of PendingBudgetConstructionAppointmentFunding from the information provided by
     * the given SalarySettingExpansion
     *
     * @param salarySettingExpansion
     * @return the list of PendingBudgetConstructionAppointmentFunding
     */
    public List<PendingBudgetConstructionAppointmentFunding> retrievePendingBudgetConstructionAppointmentFundings(SalarySettingExpansion salarySettingExpansion);

    /**
     * update the access flags of the given appointment funding according to the given information
     *
     * @param appointmentFunding the given appointment funding
     * @param salarySettingFieldsHolder the field holder that contains the values passed from the user
     * @param budgetByObjectMode the budget by object mode flag
     * @param hasDocumentEditAccess indicates whether the user has edit permission for the budget document (for budget by object)
     * @param person the specified user
     * @return true if the access flags are updated successfully; otherwise, false
     */
    public boolean updateAccessOfAppointmentFunding(PendingBudgetConstructionAppointmentFunding appointmentFunding, SalarySettingFieldsHolder salarySettingFieldsHolder, boolean budgetByObjectMode, boolean hasDocumentEditAccess, Person person);

    /**
     * update the access flags of the given appointment funding according to the user level and document organization level
     *
     * @param appointmentFunding the given appointment funding
     * @param person the specified user
     * @return true if the access flags are updated successfully; otherwsie, false
     */
    public boolean updateAccessOfAppointmentFundingByUserLevel(PendingBudgetConstructionAppointmentFunding appointmentFunding, Person person);

    /**
     * update the fields before saving the given appointment fundings
     *
     * @param appointmentFundings the given collection of appointment fundings
     */
    public void updateAppointmentFundingsBeforeSaving(List<PendingBudgetConstructionAppointmentFunding> appointmentFundings);

    /**
     * update the fields with the values that can be derived from the existing information, for example, hourly rate and FTE
     *
     * @param appointmentFundings the given appointment funding
     */
    public void recalculateDerivedInformation(PendingBudgetConstructionAppointmentFunding appointmentFunding);

    /**
     * checks if a reason code has existing appointment funding reasons
     *
     * @param budgetConstructionAppointmentFundingReasonCode
     * @return
     */
    public boolean hasExistingFundingReason(BudgetConstructionAppointmentFundingReasonCode budgetConstructionAppointmentFundingReasonCode);
}


text:
module Propellor.Property.Sudo where

import Data.List

import Propellor
import Propellor.Property.File
import qualified Propellor.Property.Apt as Apt
import Propellor.Property.User

-- | Allows a user to sudo. If the user has a password, sudo is configured
-- to require it. If not, NOPASSWORD is enabled for the user.
enabledFor :: UserName -> Property
enabledFor user = property desc go `requires` Apt.installed ["sudo"]
  where
	go = do
		locked <- liftIO $ isLockedPassword user
		ensureProperty $
			fileProperty desc
				(modify locked . filter (wanted locked))
				"/etc/sudoers"
	desc = user ++ " is sudoer"
	sudobaseline = user ++ " ALL=(ALL:ALL)"
	sudoline True = sudobaseline ++ " NOPASSWD:ALL"
	sudoline False = sudobaseline ++ " ALL"
	wanted locked l
		-- TOOD: Full sudoers file format parse..
		| not (sudobaseline `isPrefixOf` l) = True
		| "NOPASSWD" `isInfixOf` l = locked
		| otherwise = True
 	modify locked ls
		| sudoline locked `elem` ls = ls
		| otherwise = ls ++ [sudoline locked]


text:
export default function(client, filename) {
  client.fs.delete(filename, () => {
    client.control.send('250 Requested file action okay, completed.');
  });
}