text:
////////////////////////////////////////////////////////////////////////////////
/// DISCLAIMER
///
/// Copyright 2019 ArangoDB GmbH, Cologne, Germany
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
///     http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
/// Copyright holder is ArangoDB GmbH, Cologne, Germany
///
/// @author Andrey Abramov
////////////////////////////////////////////////////////////////////////////////

#include "tests_shared.hpp"
#include "store/store_utils.hpp"
#include "utils/lz4compression.hpp"
#include "utils/delta_compression.hpp"

#include <numeric>
#include <random>

namespace {

struct dummy_compressor final : irs::compression::compressor {
  virtual irs::bytes_ref compress(irs::byte_type*, size_t, irs::bstring& /*buf*/) {
    return irs::bytes_ref::NIL;
  }

  virtual void flush(data_output&) { }
};

struct dummy_decompressor final : irs::compression::decompressor {
  virtual irs::bytes_ref decompress(
      const irs::byte_type*, size_t,
      irs::byte_type*, size_t) {
    return irs::bytes_ref::NIL;
  }

  virtual bool prepare(data_input&) { return true; }
};

}

TEST(compression_test, registration) {
  struct dummy_compression { };

  constexpr auto type = irs::type<dummy_compression>::get();

  // check absent
  {
    ASSERT_FALSE(irs::compression::exists(type.name()));
    ASSERT_EQ(nullptr, irs::compression::get_compressor(type.name(), {}));
    ASSERT_EQ(nullptr, irs::compression::get_decompressor(type.name(), {}));
    auto visitor = [&type](const irs::string_ref& name) { return name != type.name(); };
    ASSERT_TRUE(irs::compression::visit(visitor));
  }

  static size_t calls_count;
  irs::compression::compression_registrar initial(
     type,
     [](const irs::compression::options&) -> irs::compression::compressor::ptr {
       ++calls_count;
       return irs::memory::to_managed(std::make_unique<dummy_compressor>());
     },
     []() -> irs::compression::decompressor::ptr {
       ++calls_count;
       return irs::memory::to_managed(std::make_unique<dummy_decompressor>());
     }
  );
  ASSERT_TRUE(initial); // registered

  // check registered
  {
    ASSERT_TRUE(irs::compression::exists(type.name()));
    ASSERT_EQ(0, calls_count);
    ASSERT_NE(nullptr, irs::compression::get_compressor(type.name(), {}));
    ASSERT_EQ(1, calls_count);
    ASSERT_NE(nullptr, irs::compression::get_decompressor(type.name(), {}));
    ASSERT_EQ(2, calls_count);
    auto visitor = [&type](const irs::string_ref& name) { return name != type.name(); };
    ASSERT_FALSE(irs::compression::visit(visitor));
  }

  irs::compression::compression_registrar duplicate(
     type,
     [](const irs::compression::options&) -> irs::compression::compressor::ptr {  return nullptr;  },
     []() -> irs::compression::decompressor::ptr { return nullptr; }
  );
  ASSERT_FALSE(duplicate); // not registered

  // check registered
  {
    ASSERT_TRUE(irs::compression::exists(type.name()));
    ASSERT_EQ(2, calls_count);
    ASSERT_NE(nullptr, irs::compression::get_compressor(type.name(), {}));
    ASSERT_EQ(3, calls_count);
    ASSERT_NE(nullptr, irs::compression::get_decompressor(type.name(), {}));
    ASSERT_EQ(4, calls_count);
    auto visitor = [&type](const irs::string_ref& name) { return name != type.name(); };
    ASSERT_FALSE(irs::compression::visit(visitor));
  }
}

TEST(compression_test, none) {
  static_assert("iresearch::compression::none" == irs::type<irs::compression::none>::name());
  ASSERT_EQ(nullptr, irs::compression::none().compressor({}));
  ASSERT_EQ(nullptr, irs::compression::none().decompressor());
}

TEST(compression_test, lz4) {
  using namespace iresearch;
  static_assert("iresearch::compression::lz4" == irs::type<irs::compression::lz4>::name());

  std::vector<size_t> data(2047, 0);
  std::random_device rnd_device;
  std::mt19937 mersenne_engine {rnd_device()};
  std::uniform_int_distribution<size_t> dist {1, 2142152};
  auto generator = [&dist, &mersenne_engine](){ return dist(mersenne_engine); };

  compression::lz4::lz4decompressor decompressor;
  compression::lz4::lz4compressor compressor;
  ASSERT_EQ(0, compressor.acceleration());

  for (size_t i = 0; i < 10; ++i) {
    std::generate(data.begin(), data.end(), generator);

    bstring compression_buf;
    bstring data_buf(data.size()*sizeof(size_t), 0);
    std::memcpy(&data_buf[0], data.data(), data_buf.size());

    ASSERT_EQ(
      bytes_ref(reinterpret_cast<const byte_type*>(data.data()), data.size()*sizeof(size_t)),
      bytes_ref(data_buf)
    );

    const auto compressed = compressor.compress(&data_buf[0], data_buf.size(), compression_buf);
    ASSERT_EQ(compressed, bytes_ref(compression_buf.c_str(), compressed.size()));

    // lz4 doesn't modify data_buf
    ASSERT_EQ(
      bytes_ref(reinterpret_cast<const byte_type*>(data.data()), data.size()*sizeof(size_t)),
      bytes_ref(data_buf)
    );

    bstring decompression_buf(data_buf.size(), 0); // ensure we have enough space in buffer
    const auto decompressed = decompressor.decompress(&compression_buf[0], compressed.size(),
                                                      &decompression_buf[0], decompression_buf.size());

    ASSERT_EQ(data_buf, decompression_buf);
    ASSERT_EQ(data_buf, decompressed);
  }
}

TEST(compression_test, delta) {
  using namespace iresearch;
  static_assert("iresearch::compression::delta" == irs::type<irs::compression::delta>::name());

  std::vector<uint64_t> data(2047, 0);
  std::random_device rnd_device;
  std::mt19937 mersenne_engine {rnd_device()};
  std::uniform_int_distribution<uint64_t> dist {1, 52};
  auto generator = [&dist, &mersenne_engine](){ return dist(mersenne_engine); };

  compression::delta_decompressor decompressor;
  compression::delta_compressor compressor;

  for (size_t i = 0; i < 10; ++i) {
    std::generate(data.begin(), data.end(), generator);

    bstring compression_buf;
    bstring data_buf(data.size()*sizeof(size_t), 0);
    std::memcpy(&data_buf[0], data.data(), data_buf.size());

    ASSERT_EQ(
      bytes_ref(reinterpret_cast<const byte_type*>(data.data()), data.size()*sizeof(size_t)),
      bytes_ref(data_buf)
    );

    const auto compressed = compressor.compress(&data_buf[0], data_buf.size(), compression_buf);
    ASSERT_EQ(compressed, bytes_ref(compression_buf.c_str(), compressed.size()));

    bstring decompression_buf(data_buf.size(), 0); // ensure we have enough space in buffer
    const auto decompressed = decompressor.decompress(&compression_buf[0], compressed.size(),
                                                      &decompression_buf[0], decompression_buf.size());

    ASSERT_EQ(
      bytes_ref(reinterpret_cast<const byte_type*>(data.data()), data.size()*sizeof(size_t)),
      bytes_ref(decompression_buf)
    );
    ASSERT_EQ(
      bytes_ref(reinterpret_cast<const byte_type*>(data.data()), data.size()*sizeof(size_t)),
      bytes_ref(decompressed)
    );
  }
}


text:
import "@babel/polyfill";

import * as React from "react";

import { Frame, FrameCollection } from "@morleydev/pauper/render/render-frame.model";
import { map, scan } from "rxjs/operators";
import { matterJsPhysicsEcsEvents, matterJsPhysicsReducer } from "@morleydev/pauper/physics/_inner/matterEngine";

import { AppDrivers } from "@morleydev/pauper/app-drivers";
import { Game } from "../../main/game-render";
import { GameAction } from "../../main/game-action";
import { GameApp } from "../../main/GameApp";
import { GameState } from "../../main/game-state";
import { HtmlDocumentKeyboard } from "@morleydev/pauper/input/HtmlDocumentKeyboard";
import { HtmlElementMouse } from "@morleydev/pauper/input/HtmlElementMouse";
import { ReactRenderer } from "@morleydev/pauper/render/jsx/render";
import { Subscription } from "rxjs/Subscription";
import { WebAssetLoader } from "@morleydev/pauper/assets/web-asset-loader.service";
import { WebAudioService } from "@morleydev/pauper/audio/web-audio.service";
import { animationFrame } from "rxjs/scheduler/animationFrame";
import { async } from "rxjs/scheduler/async";
import { bootstrap } from "../../main/game-bootstrap";
import { concat } from "rxjs/observable/concat";
import { createReducer } from "../../main/game-reducer";
import { initialState } from "../../main/game-initial-state";
import { interval } from "rxjs/observable/interval";
import { merge } from "rxjs/observable/merge";
import { renderToCanvas } from "@morleydev/pauper/render/render-to-canvas.func";

const canvas = document.getElementById("render-target") as HTMLCanvasElement | null;
if (canvas == null) {
	throw new Error("Could not find #render-target");

}
const context = canvas.getContext("2d");
if (context == null) {
	throw new Error("Could not acquire 2d rendering context");
}
const element = document.getElementById("canvas-container");
if (element == null) {
	throw new Error("Could not find #canvas-container");
}

const drivers = {
	keyboard: new HtmlDocumentKeyboard(document),
	mouse: new HtmlElementMouse(canvas),
	audio: new WebAudioService(),
	loader: new WebAssetLoader(),
	framerates: {
		logicalRender: 20,
		logicalTick: 20
	},
	physics: {
		events: matterJsPhysicsEcsEvents,
		reducer: matterJsPhysicsReducer
	},
	schedulers: {
		logical: async,
		graphics: animationFrame
	}
};

const assets = new WebAssetLoader();

const renderer = new ReactRenderer(<GameApp drivers={drivers as any} initialState={initialState} />);

requestAnimationFrame(function draw() {
	const frame: FrameCollection = renderer.frame() as FrameCollection;
	renderToCanvas({ canvas, context, assets }, frame);
	requestAnimationFrame(draw);
});

redpajama_set_name: RedPajamaGithub


text: Put your TFLite model files from Teachable Machine here.


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    tools:ignore="MissingPrefix"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true">

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:minHeight="?attr/actionBarSize"
        android:background="?attr/colorPrimary" >

        <TextView
            android:id="@+id/toolbar_title"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:gravity="center_vertical"
            android:text="@string/muzei_settings"
            android:maxLines="1"
            android:ellipsize="end"
            android:textSize="@dimen/text_toolbar_title"
            android:textColor="?attr/toolbar_icon"
            fontPath="fonts/Font-Medium.ttf"/>
    </android.support.v7.widget.Toolbar>

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@+id/toolbar">

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:layout_gravity="center"
            android:layout_margin="@dimen/content_margin"
            android:gravity="center_vertical">

            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="@string/muzei_refresh_duration"
                android:textSize="@dimen/text_toolbar_title"
                android:textColor="?android:attr/textColorPrimary"
                android:gravity="center"
                fontPath="fonts/Font-Medium.ttf"/>

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:layout_gravity="center"
                android:gravity="center"
                android:layout_marginTop="10dp">

                <NumberPicker
                    android:id="@+id/number_picker"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:descendantFocusability="blocksDescendants" />

                <RadioButton
                    android:id="@+id/minute"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/minute"
                    android:textColor="?android:attr/textColorPrimary"
                    android:textSize="@dimen/text_content_subtitle"
                    app:theme="@style/CheckBoxStyle"
                    fontPath="fonts/Font-Regular.ttf"/>

                <RadioButton
                    android:id="@+id/hour"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/hour"
                    android:textColor="?android:attr/textColorPrimary"
                    android:textSize="@dimen/text_content_subtitle"
                    app:theme="@style/CheckBoxStyle"
                    fontPath="fonts/Font-Regular.ttf"/>
            </LinearLayout>

            <android.support.v7.widget.AppCompatCheckBox
                android:id="@+id/wifi_only"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="20dp"
                android:text="@string/muzei_wifi_only"
                android:background="@android:color/transparent"
                android:textColor="?android:attr/textColorPrimary"
                android:textSize="@dimen/text_content_subtitle"
                app:theme="@style/CheckBoxStyle"
                fontPath="fonts/Font-Regular.ttf"/>
        </LinearLayout>
    </ScrollView>

    <View
        android:layout_width="match_parent"
        android:layout_height="@dimen/toolbar_shadow"
        android:layout_below="@+id/toolbar"
        android:background="@drawable/toolbar_shadow" />
</RelativeLayout>


text:
package com.intellij.lang.properties;

import com.intellij.ExtensionPoints;
import com.intellij.codeInspection.duplicatePropertyInspection.DuplicatePropertyInspection;
import com.intellij.codeInspection.unsorted.AlphaUnsortedPropertiesFileInspection;
import com.intellij.codeInspection.unsorted.AlphaUnsortedPropertiesFileInspectionSuppressor;
import com.intellij.lang.properties.psi.PropertiesFile;
import com.intellij.openapi.application.PluginPathManager;
import com.intellij.openapi.extensions.ExtensionPoint;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.testFramework.InspectionTestCase;
import org.jetbrains.annotations.NotNull;

/**
 * @author Dmitry Batkovich
 */
public class AlphaUnsortedInspectionTest extends InspectionTestCase {
  private AlphaUnsortedPropertiesFileInspection myTool;

  @Override
  protected void setUp() throws Exception {
    super.setUp();
    myTool = new AlphaUnsortedPropertiesFileInspection();
  }

  public void testUnsorted() throws Exception {
    doTest();
  }

  public void testSorted() throws Exception {
    doTest();
  }

  public void testUnsortedSuppressed() throws Exception {
    final ExtensionPoint<AlphaUnsortedPropertiesFileInspectionSuppressor> ep =
      Extensions.getRootArea().getExtensionPoint(AlphaUnsortedPropertiesFileInspectionSuppressor.EP_NAME);
    final AlphaUnsortedPropertiesFileInspectionSuppressor suppressor = new AlphaUnsortedPropertiesFileInspectionSuppressor() {
      @Override
      public boolean suppressInspectionFor(PropertiesFile propertiesFile) {
        return propertiesFile.getName().toLowerCase().contains("suppress");
      }
    };
    try {
      ep.registerExtension(suppressor);
      doTest();
    } finally {
      ep.unregisterExtension(suppressor);
    }
  }

  private void doTest() throws Exception {
    doTest("alphaUnsorted/" + getTestName(true), myTool);
  }

  @NotNull
  @Override
  protected String getTestDataPath() {
    return PluginPathManager.getPluginHomePath("properties") + "/testData";
  }

}


text:
package org.nypl.parsing;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.util.ArrayList;

import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;

import org.nypl.MoverContentProvider;
import org.nypl.database.AudioDAO;
import org.nypl.database.CsvReader;
import org.nypl.database.PlayDAO;
import org.nypl.database.VersionDAO;
import org.nypl.dataholder.PlaysBean;
import org.nypl.dataholder.VersionBean;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;

import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.net.Uri;

public class VersionParser {

	public static SQLiteDatabase db1;
	public static Context context1;
	public static String CONTENT_LOCATION;
	public static String ProjectFolder;
	public static String parsePlayVersion(InputStream is, SQLiteDatabase db, Context context, String content_location) {
		db1 = db;
		context1 = context;
		CONTENT_LOCATION = content_location;

		SAXParserFactory factory = SAXParserFactory.newInstance();
		try {
			SAXParser parser = factory.newSAXParser();
			RssHandler handler = new RssHandler();
			parser.parse(is, handler);
			is.close();
			return handler.getXmlItems();
		} catch (Exception e) {
			throw new RuntimeException(e);
		}

	}

	public  static class RssHandler extends DefaultHandler{
		private ArrayList<VersionBean> versionItemList;
		private ArrayList<PlaysBean> playsItemList;
		private VersionBean currentItem;
		private PlaysBean currentPlay=new PlaysBean();
		private StringBuilder builder;
		private String item_id;
		private String version_id;
		private String version_name;
		private String version_html_name;
		private String version_audio_name;
		private String playidfinal;
		private Boolean titleActive=false;
		private Boolean authorActive=false;
		public String getXmlItems(){
			return this.playidfinal;
		}

		@Override
		public void characters(char[] ch, int start, int length)
		throws SAXException {
			super.characters(ch, start, length);

			builder.append(ch, start, length);

		}

		@Override
		public void endElement(String uri, String localName, String name)
		throws SAXException {
			super.endElement(uri, localName, name);
			System.out.println("end: "+localName);
		//if (this.currentItem != null){
				System.out.println("Do do do "+localName);
				 if ((localName.equalsIgnoreCase(NAVPOINT))&&(this.currentItem != null)){
					 String versionname = builder.toString().trim();
					System.out.println("*******"+version_id);
					System.out.println("*******"+versionname);
					System.out.println("*******"+version_html_name);
					currentItem.setVersionPlayID(playidfinal);
					currentItem.setVersionID(version_id);
					currentItem.setVersionName(builder.toString());
					currentItem.setVersionHTMLFile(version_html_name);
					versionItemList.add(currentItem);
					System.out.println("Inserting version");
					if (db1!=null){
						System.out.println("db1 not null");
					CsvReader.insertVersionTable(db1,context1,version_id, playidfinal,version_html_name, versionname);
					}
					else{
						System.out.println("DB1 null but playidfinal is "+playidfinal);
						ContentValues cv = new ContentValues();
						cv.put(VersionDAO.COLUMN_NAME_VERSION_UUID,version_id);
						cv.put(VersionDAO.COLUMN_NAME_VERSION_PLAY_ID,playidfinal);
						cv.put(VersionDAO.COLUMN_NAME_VERSION_NAME,versionname);
						cv.put(VersionDAO.COLUMN_NAME_HTML_FILE,version_html_name);
						context1.getContentResolver().insert(Uri.parse(MoverContentProvider.CONTENT_URI+"/"+MoverContentProvider.VERSION_PATH), cv);

					}
				}

				 else if (localName.equalsIgnoreCase("text")){
					 if (titleActive){
						 System.out.println("Setting title");
						 currentPlay.setPlayName(builder.toString().trim());
						 titleActive = false;
					 }
					 else if (authorActive){
						 System.out.println("Setting author");
						 currentPlay.setPlayAuthors(builder.toString().trim());
						 authorActive = false;
					 }
				 }
	//	}
			//}
			//builder.setLength(0);
		}

		@Override
		public void startDocument() throws SAXException {
			super.startDocument();
			versionItemList = new ArrayList<VersionBean>();
			builder = new StringBuilder();
		}

		@Override
		public void startElement(String uri, String localName, String name,
				Attributes attributes) throws SAXException {
			super.startElement(uri, localName, name, attributes);
			Cursor cursor2;
			ProjectFolder=CONTENT_LOCATION.substring(0,CONTENT_LOCATION.lastIndexOf("/"));
			File PlayFolder = new File(CONTENT_LOCATION);

			if(localName.equalsIgnoreCase(NAVMAP))
			{

			if (db1!=null){
			 cursor2 = db1.rawQuery("select * from PLAY where PLAY_LONG_ID=\""+playidfinal+"\"",null);
			}
			else{
			 cursor2 = context1.getContentResolver().query(Uri.parse(MoverContentProvider.CONTENT_URI+"/"+MoverContentProvider.PLAY_PATH), null, PlayDAO.COLUMN_NAME_PLAY_LONG_ID +"=\""+playidfinal+"\"", null, null);
			}

			if (cursor2.getCount()==0){

			if (db1!=null){
			CsvReader.insertPlayTable(db1, context1, playidfinal, currentPlay.getPlayName(),"cover.jpeg", currentPlay.getPlayAuthors(),currentPlay.getPlayUrl());
			}
			else{
				ContentValues cv = new ContentValues();
				cv.put(PlayDAO.COLUMN_NAME_PLAY_LONG_ID, playidfinal);
				cv.put(PlayDAO.COLUMN_NAME_PLAY_NAME, currentPlay.getPlayName());
				cv.put(PlayDAO.COLUMN_NAME_PLAY_IMAGE, "cover.jpeg");
				cv.put(PlayDAO.COLUMN_NAME_PLAY_AUTHORS, currentPlay.getPlayAuthors());
				context1.getContentResolver().insert(Uri.parse(MoverContentProvider.CONTENT_URI+"/"+MoverContentProvider.PLAY_PATH), cv);

			}
			System.out.println("Inserted");
			PlayJsonParser.addPlayToJson(ProjectFolder+File.separator+"playjsonformat.json",playidfinal, currentPlay.getPlayName(), "cover.jpeg", "", currentPlay.getPlayAuthors(), "");
			}
			System.out.println("IS PLAY FOLDER NAMED RIGHT?");
		    if (PlayFolder.exists()){
		    	System.out.println(CONTENT_LOCATION);
		    	System.out.println(ProjectFolder+File.separator+playidfinal);
		    	PlayFolder.renameTo(new File(ProjectFolder+File.separator+playidfinal));
		    }
			this.currentItem = new VersionBean();

		    }
			else if(localName.equalsIgnoreCase("meta")){
			     if (attributes.getValue("name").equalsIgnoreCase("dtb:uid")){
			    	 playidfinal = attributes.getValue("content");
			     }
			}
			else if (localName.equalsIgnoreCase("navMap")){

			 }
			else if(localName.equalsIgnoreCase(NAVPOINT)){
				version_id =attributes.getValue(ID);
			 }
			 else if (localName.equalsIgnoreCase(CONTENT)){
				 version_html_name = attributes.getValue("src");
			 }
			 else if (localName.equalsIgnoreCase(TEXT)){
				 builder.delete(0, builder.length());
			 }
			 else if (localName.equalsIgnoreCase("docTitle")){
				 titleActive=true;
			 }

		}
		private static final  String NAVMAP = "navMap";
		private static final  String NAVPOINT = "navPoint";
		private static final  String TEXT = "text";
		private static final  String CONTENT = "content";
		private static final  String ID = "id";

	}

}


text:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var extend = require("extend");
// Lessu!
var BasicTypes;
(function (BasicTypes) {
    BasicTypes["number"] = "number";
    BasicTypes["string"] = "string";
    BasicTypes["object"] = "object";
    BasicTypes["boolean"] = "boolean";
    BasicTypes["any"] = "any";
    BasicTypes["null"] = "null";
    BasicTypes["undefined"] = "undefined";
})(BasicTypes = exports.BasicTypes || (exports.BasicTypes = {}));
exports.defaultDefinedChecker = {};
function makeErrorMessage(key, exceptToBe, actual) {
    if (key && key.length > 0) {
        if (actual) {
            exports.lastError += "[" + key + "] except " + exceptToBe + ",actual = " + JSON.stringify(actual) + "\n";
        }
        else {
            exports.lastError += "[" + key + "] " + exceptToBe + "\n";
        }
    }
    else {
        if (actual) {
            exports.lastError += "except " + exceptToBe + ",actual = " + JSON.stringify(actual) + "\n";
        }
        else {
            exports.lastError += exceptToBe + "\n";
        }
    }
}
var defaultOptions = {
    weakNumber: false
};
// aa[] => true,-1,aa
// aa[3]=> true,3,aa
// aa[invalid => false,0,null
function typeArrayCount(type) {
    var index = type.lastIndexOf('[');
    if (index < 0) {
        return [false, 0, null];
    }
    var indexString = type.substring(index);
    if (indexString == "[]") {
        return [true, -1, type.substring(0, index)];
    }
    if (isNaN(indexString.substring(1, indexString.length - 1))) {
        return [false, 0, null];
    }
    else {
        return [true, parseInt(indexString.substring(1, indexString.length - 1)), type.substring(0, index)];
    }
}
//return [typename, args]
function definedTypesParse(type) {
    var index = type.lastIndexOf("(");
    if (index < 0) {
        return [type, []];
    }
    var typename = type.substring(0, index);
    var argsString = type.substring(index);
    if (argsString == "()") {
        return [typename, []];
    }
    argsString = argsString.substring(1, argsString.length - 1);
    var args = argsString.split(",");
    return [typename, args];
}
function _checkType(key, value, type, definedTypes, options) {
    if (typeof type == "string") {
        var isArray = typeArrayCount(type);
        if (isArray[0]) {
            if (!(value instanceof Array)) {
                makeErrorMessage(key, "value type to be an array", value);
                return false;
            }
            if (isArray[1] >= 0 && value.length != isArray[1]) {
                makeErrorMessage(key, "array length=" + isArray[1], value.length);
                return false;
            }
            for (var i = 0; i < value.length; i++) {
                if (_checkType(key, value[i], isArray[2], definedTypes, options) == false) {
                    // makeErrorMessage(`${key}[${i}]`,"value type to be "+isArray[2] , value);
                    return false;
                }
            }
            return true;
        }
        else {
            if (type == "any") {
                return true;
            }
            if (type == "null") {
                var result = (value == null);
                if (result == false)
                    makeErrorMessage(key, "value to be null", value);
                return result;
            }
            if (type == "undefined") {
                var result = (value == undefined);
                if (result == false)
                    if (result == false)
                        makeErrorMessage(key, "value to be undefined", value);
                return result;
            }
            if (value == undefined) {
                makeErrorMessage(key, "is missing", undefined);
                return false;
            }
            if (typeof value == type) {
                return true;
            }
            if (options.weakNumber && type == "number" && !isNaN(value)) {
                return true;
            }
            // type check with 'user defined type'
            var definedTypeParse = definedTypesParse(type);
            if (definedTypes && definedTypes[definedTypeParse[0]]) {
                var customType = definedTypes[definedTypeParse[0]];
                if (typeof customType == "function") {
                    var result = customType(value, definedTypeParse[1]);
                    if (result == false)
                        makeErrorMessage(key, "value type to be " + type, value);
                    return result;
                }
                else {
                    var result = _checkType(key, value, customType, definedTypes, options);
                    if (result == false)
                        makeErrorMessage(key, "value type to be " + type, value);
                    return result;
                }
            }
            return false;
        }
    }
    else if (typeof type == "function") {
        //cystom type checker;
        var result = type(value);
        if (result == false)
            makeErrorMessage(key, "value pass function check", value);
        return result;
    }
    else if (typeof type == "object") {
        if (type instanceof Array) {
            for (var i = 0; i < type.length; i++) {
                if (_checkType(key, value, type[i], definedTypes, options)) {
                    return true;
                }
            }
            // makeErrorMessage(key,"value type mismatch", null);
            return false;
        }
        else {
            //type checker;
            var result = _checkOptions(value, type, definedTypes, options);
            // if(result == false) makeErrorMessage(key,"value type mismatch", null);
            return result;
        }
    }
    return false;
}
function _checkOptions(object, typeChecker, definedTypes, options) {
    for (var key in typeChecker) {
        if (_checkType(key, object[key], typeChecker[key], definedTypes, options) == false) {
            // makeErrorMessage(key,"value type mismatch", null);
            return false;
        }
    }
    return true;
}
function checkType(value, type, _definedTypes, _options) {
    exports.lastError = "";
    var options = {};
    extend(options, defaultOptions, _options);
    var definedTypes = {};
    extend(definedTypes, exports.defaultDefinedChecker, _definedTypes);
    var result = _checkType("", value, type, definedTypes, options);
    return result;
}
exports.checkType = checkType;
exports.lastError = null;
//# sourceMappingURL=index.js.map


text:
{% extends "admin/base_site.html" %}{% load i18n admin_static %}

{% block extrahead %}{{block.super}}{% endblock %}

{% block object-tools %}

						 {% trans "Change password" %}

{% endblock %}

{% block content %}

				<form class="form-horizontal" method="POST" action=".">
					{% csrf_token %}
					<fieldset>

{% include 'admin/includes/base_form.html' %}

					</fieldset>
					<input type="submit" value="{% trans 'Update account' %}" class="btn btn-success" />
				</form>

{% endblock %}


text:
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace WebAPI.Models
{
	public class Device
	{
		[Key]
		public long Id { get; set; }

		[Index]
		public long UserId { get; set; }

		public virtual User User { get; set; }

		public string DeviceName { get; set; }
	}
}


text:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.jsh.erp.datasource.mappers.MsgMapper" >
  <resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.Msg" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="id" property="id" jdbcType="BIGINT" />
    <result column="msg_title" property="msgTitle" jdbcType="VARCHAR" />
    <result column="msg_content" property="msgContent" jdbcType="VARCHAR" />
    <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
    <result column="type" property="type" jdbcType="VARCHAR" />
    <result column="status" property="status" jdbcType="VARCHAR" />
    <result column="tenant_id" property="tenantId" jdbcType="BIGINT" />
    <result column="delete_Flag" property="deleteFlag" jdbcType="VARCHAR" />
  </resultMap>
  <sql id="Example_Where_Clause" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <where >
      <foreach collection="oredCriteria" item="criteria" separator="or" >
        <if test="criteria.valid" >
          <trim prefix="(" suffix=")" prefixOverrides="and" >
            <foreach collection="criteria.criteria" item="criterion" >
              <choose >
                <when test="criterion.noValue" >
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue" >
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue" >
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue" >
                  and ${criterion.condition}
                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Update_By_Example_Where_Clause" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <where >
      <foreach collection="example.oredCriteria" item="criteria" separator="or" >
        <if test="criteria.valid" >
          <trim prefix="(" suffix=")" prefixOverrides="and" >
            <foreach collection="criteria.criteria" item="criterion" >
              <choose >
                <when test="criterion.noValue" >
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue" >
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue" >
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue" >
                  and ${criterion.condition}
                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    id, msg_title, msg_content, create_time, type, status, tenant_id, delete_Flag
  </sql>
  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.jsh.erp.datasource.entities.MsgExample" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select
    <if test="distinct" >
      distinct
    </if>
    <include refid="Base_Column_List" />
    from jsh_msg
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null" >
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select
    <include refid="Base_Column_List" />
    from jsh_msg
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from jsh_msg
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.MsgExample" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from jsh_msg
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.jsh.erp.datasource.entities.Msg" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into jsh_msg (id, msg_title, msg_content,
      create_time, type, status,
      tenant_id, delete_Flag)
    values (#{id,jdbcType=BIGINT}, #{msgTitle,jdbcType=VARCHAR}, #{msgContent,jdbcType=VARCHAR},
      #{createTime,jdbcType=TIMESTAMP}, #{type,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR},
      #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.Msg" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into jsh_msg
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        id,
      </if>
      <if test="msgTitle != null" >
        msg_title,
      </if>
      <if test="msgContent != null" >
        msg_content,
      </if>
      <if test="createTime != null" >
        create_time,
      </if>
      <if test="type != null" >
        type,
      </if>
      <if test="status != null" >
        status,
      </if>
      <if test="tenantId != null" >
        tenant_id,
      </if>
      <if test="deleteFlag != null" >
        delete_Flag,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        #{id,jdbcType=BIGINT},
      </if>
      <if test="msgTitle != null" >
        #{msgTitle,jdbcType=VARCHAR},
      </if>
      <if test="msgContent != null" >
        #{msgContent,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null" >
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="type != null" >
        #{type,jdbcType=VARCHAR},
      </if>
      <if test="status != null" >
        #{status,jdbcType=VARCHAR},
      </if>
      <if test="tenantId != null" >
        #{tenantId,jdbcType=BIGINT},
      </if>
      <if test="deleteFlag != null" >
        #{deleteFlag,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.jsh.erp.datasource.entities.MsgExample" resultType="java.lang.Integer" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select count(*) from jsh_msg
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update jsh_msg
    <set >
      <if test="record.id != null" >
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.msgTitle != null" >
        msg_title = #{record.msgTitle,jdbcType=VARCHAR},
      </if>
      <if test="record.msgContent != null" >
        msg_content = #{record.msgContent,jdbcType=VARCHAR},
      </if>
      <if test="record.createTime != null" >
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.type != null" >
        type = #{record.type,jdbcType=VARCHAR},
      </if>
      <if test="record.status != null" >
        status = #{record.status,jdbcType=VARCHAR},
      </if>
      <if test="record.tenantId != null" >
        tenant_id = #{record.tenantId,jdbcType=BIGINT},
      </if>
      <if test="record.deleteFlag != null" >
        delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR},
      </if>
    </set>
    <if test="_parameter != null" >
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update jsh_msg
    set id = #{record.id,jdbcType=BIGINT},
      msg_title = #{record.msgTitle,jdbcType=VARCHAR},
      msg_content = #{record.msgContent,jdbcType=VARCHAR},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      type = #{record.type,jdbcType=VARCHAR},
      status = #{record.status,jdbcType=VARCHAR},
      tenant_id = #{record.tenantId,jdbcType=BIGINT},
      delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR}
    <if test="_parameter != null" >
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.jsh.erp.datasource.entities.Msg" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update jsh_msg
    <set >
      <if test="msgTitle != null" >
        msg_title = #{msgTitle,jdbcType=VARCHAR},
      </if>
      <if test="msgContent != null" >
        msg_content = #{msgContent,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null" >
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="type != null" >
        type = #{type,jdbcType=VARCHAR},
      </if>
      <if test="status != null" >
        status = #{status,jdbcType=VARCHAR},
      </if>
      <if test="tenantId != null" >
        tenant_id = #{tenantId,jdbcType=BIGINT},
      </if>
      <if test="deleteFlag != null" >
        delete_Flag = #{deleteFlag,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.jsh.erp.datasource.entities.Msg" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update jsh_msg
    set msg_title = #{msgTitle,jdbcType=VARCHAR},
      msg_content = #{msgContent,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      type = #{type,jdbcType=VARCHAR},
      status = #{status,jdbcType=VARCHAR},
      tenant_id = #{tenantId,jdbcType=BIGINT},
      delete_Flag = #{deleteFlag,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>


text:
package com.testapps.movieslist.utils;

import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Build;
import android.os.Handler;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;

import com.testapps.movieslist.R;
import com.testapps.movieslist.app.MoviesListApp;

import org.jetbrains.annotations.Contract;

import java.util.ArrayList;

public class Utils {

    private static int deviceAPI = Build.VERSION.SDK_INT;
    private static final Handler mHandler = new Handler();

    private static Context mContext = MoviesListApp.getContext();

    public static boolean isNetworkAvailable() {
        ConnectivityManager connectivityManager = (ConnectivityManager) mContext
                .getSystemService(Context.CONNECTIVITY_SERVICE);
        NetworkInfo activeNetworkInfo = connectivityManager
                .getActiveNetworkInfo();
        return activeNetworkInfo != null && activeNetworkInfo.isConnectedOrConnecting();
    }

    public static void shareIt(String title) {
        mHandler.post(() -> {
            Intent sharingIntent = new Intent(Intent.ACTION_SEND);
            sharingIntent.setType("text/plain");
            sharingIntent.putExtra(Intent.EXTRA_TEXT, title);
            Intent intent = Intent.createChooser(sharingIntent, mContext.getString(R.string.share_via));
            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            mContext.startActivity(intent);
        });
    }

    @Contract(pure = true)
    public static boolean isKitkat() {
        return deviceAPI >= Build.VERSION_CODES.KITKAT;
    }

    @Contract(pure = true)
    public static boolean isLollipop() {
        return deviceAPI >= Build.VERSION_CODES.LOLLIPOP;
    }

    @Contract(pure = true)
    public static boolean isMarshmallow() {
        return deviceAPI >= Build.VERSION_CODES.M;
    }

    @Contract(pure = true)
    public static boolean isNougat() {
        return deviceAPI >= Build.VERSION_CODES.N;
    }

    public static void logError(Exception e) {
        Log.e("-CHP-ERROR:", " " + e.getMessage());
    }

    public static boolean isTwoPane(Context context) {
        return ((AppCompatActivity)context).findViewById(R.id.frag_single_container) != null;
    }

    public static void setFragment(Context context, Fragment fragment, boolean addToBackStack, @Nullable String tag) {
        FragmentManager fragmentManager = ((AppCompatActivity) context).getSupportFragmentManager();
        FragmentTransaction fragmentTransaction =
                fragmentManager.beginTransaction();
        try {
            if(!fragment.isAdded()) {

                fragmentTransaction.replace(R.id.frag_container, fragment, tag);
                if (addToBackStack) {
                    fragmentTransaction.addToBackStack("");
                }
                fragmentTransaction.commit();
            }
        } catch (IllegalStateException e) {
            e.printStackTrace();
        }
    }

    public static boolean isTablet(Context context) {
        boolean xlarge = ((context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == 4);
        boolean large = ((context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_LARGE);
        return (xlarge || large);
    }

}


text:
'*********************************************************
'
' Copyright (c) Microsoft. All rights reserved.
' This code is licensed under the MIT License (MIT).
' THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
' ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
' IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
' PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
'
'*********************************************************
Imports System
Imports System.Text
Imports System.Threading.Tasks
Imports Windows.Devices.PointOfService
Imports Windows.Storage.Streams
Imports Windows.UI
Imports Windows.UI.Xaml
Imports Windows.UI.Xaml.Controls
Imports Windows.UI.Xaml.Media
Imports Windows.UI.Xaml.Navigation

Namespace Global.SDKTemplate

    ''' <summary>
    ''' An empty page that can be used on its own or navigated to within a Frame.
    ''' </summary>
    Public NotInheritable Partial Class Scenario2_MultipleScanners
        Inherits Page

        Dim rootPage As MainPage = MainPage.Current

        Dim scannerInstance1 As BarcodeScanner = Nothing

        Dim scannerInstance2 As BarcodeScanner = Nothing

        Dim claimedBarcodeScannerInstance1 As ClaimedBarcodeScanner = Nothing

        Dim claimedBarcodeScannerInstance2 As ClaimedBarcodeScanner = Nothing

        Public Sub New()
            Me.InitializeComponent()
        End Sub

        Private Enum BarcodeScannerInstance
            Instance1
            Instance2
        End Enum

        ''' <summary>
        ''' Invoked when this page is about to be displayed in a Frame.
        ''' </summary>
        ''' <param name="e">Event data that describes how this page was reached.  The Parameter
        ''' property is typically used to configure the page.</param>
        Protected Overrides Sub OnNavigatedTo(e As NavigationEventArgs)
            ResetTheScenarioState()
            MyBase.OnNavigatedTo(e)
        End Sub

        ''' <summary>
        ''' Invoked when this page is no longer displayed.
        ''' </summary>
        ''' <param name="e">Event data that describes how this page was exited.  The Parameter
        ''' property is typically used to configure the page.</param>
        Protected Overrides Sub OnNavigatedFrom(e As NavigationEventArgs)
            ResetTheScenarioState()
            MyBase.OnNavigatedFrom(e)
        End Sub

        ''' <summary>
        ''' This is the click handler for the 'ScenarioStartScanningInstance1' button. It initiates creation of scanner instance 1.
        '''
        ''' </summary>
        ''' <param name="sender"></param>
        ''' <param name="e"></param>
        '''
        Private Async Sub ButtonStartScanningInstance1_Click(sender As Object, e As RoutedEventArgs)
            If Await CreateDefaultScannerObjectAsync(BarcodeScannerInstance.Instance1) Then
                If Await ClaimBarcodeScannerAsync(BarcodeScannerInstance.Instance1) Then
                    AddHandler claimedBarcodeScannerInstance1.ReleaseDeviceRequested, AddressOf claimedBarcodeScannerInstance1_ReleaseDeviceRequested
                    AddHandler claimedBarcodeScannerInstance1.DataReceived, AddressOf claimedBarcodeScannerInstance1_DataReceived
                    claimedBarcodeScannerInstance1.IsDecodeDataEnabled = True
                    If Await EnableBarcodeScannerAsync(BarcodeScannerInstance.Instance1) Then
                        ResetUI()
                        SetUI(BarcodeScannerInstance.Instance1)
                    End If
                Else
                    scannerInstance1 = Nothing
                End If
            End If
        End Sub

        ''' <summary>
        ''' This method is called upon when a claim request is made on instance 1. If a retain request was placed on the device it rejects the new claim.
        ''' </summary>
        ''' <param name="instance"></param>
        ''' <returns></returns>
        Async Sub claimedBarcodeScannerInstance1_ReleaseDeviceRequested(sender As Object, e As ClaimedBarcodeScanner)
            Await MainPage.Current.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, Sub()
                If Retain1.IsChecked = True Then
                    Try
                        claimedBarcodeScannerInstance1.RetainDevice()
                    Catch exception As Exception
                        rootPage.NotifyUser("Retain instance 1 failed: " & exception.Message, NotifyType.ErrorMessage)
                    End Try
                Else
                    claimedBarcodeScannerInstance1.Dispose()
                    claimedBarcodeScannerInstance1 = Nothing
                End If
            End Sub)
        End Sub

        ''' <summary>
        ''' This is the click handler for the 'ScenarioStartScanningInstance2' button. Initiates creation of scanner instance 2
        ''' </summary>
        ''' <param name="sender"></param>
        ''' <param name="e"></param>
        '''
        Private Async Sub ButtonStartScanningInstance2_Click(sender As Object, e As RoutedEventArgs)
            If Await CreateDefaultScannerObjectAsync(BarcodeScannerInstance.Instance2) Then
                If Await ClaimBarcodeScannerAsync(BarcodeScannerInstance.Instance2) Then
                    AddHandler claimedBarcodeScannerInstance2.ReleaseDeviceRequested, AddressOf claimedBarcodeScannerInstance2_ReleaseDeviceRequested
                    AddHandler claimedBarcodeScannerInstance2.DataReceived, AddressOf claimedBarcodeScannerInstance2_DataReceived
                    claimedBarcodeScannerInstance2.IsDecodeDataEnabled = True
                    If Await EnableBarcodeScannerAsync(BarcodeScannerInstance.Instance2) Then
                        ResetUI()
                        SetUI(BarcodeScannerInstance.Instance2)
                    End If
                Else
                    scannerInstance2 = Nothing
                End If
            End If
        End Sub

        ''' <summary>
        ''' This method is called upon when a claim request is made on instance 2. If a retain request was placed on the device it rejects the new claim.
        ''' </summary>
        ''' <param name="instance"></param>
        ''' <returns></returns>
        Async Sub claimedBarcodeScannerInstance2_ReleaseDeviceRequested(sender As Object, e As ClaimedBarcodeScanner)
            Await MainPage.Current.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, Sub()
                If Retain2.IsChecked = True Then
                    Try
                        claimedBarcodeScannerInstance2.RetainDevice()
                    Catch exception As Exception
                        rootPage.NotifyUser("Retain instance 1 failed: " & exception.Message, NotifyType.ErrorMessage)
                    End Try
                Else
                    claimedBarcodeScannerInstance2.Dispose()
                    claimedBarcodeScannerInstance2 = Nothing
                End If
            End Sub)
        End Sub

        ''' <summary>
        ''' This is the click handler for the 'ScenarioEndScanningInstance1' button.
        ''' Initiates the disposal of scanner instance 1.
        ''' </summary>
        ''' <param name="sender"></param>
        ''' <param name="e"></param>
        '''
        Private Sub ButtonEndScanningInstance1_Click(sender As Object, e As RoutedEventArgs)
            RemoveHandler claimedBarcodeScannerInstance1.DataReceived, AddressOf claimedBarcodeScannerInstance1_DataReceived
            RemoveHandler claimedBarcodeScannerInstance1.ReleaseDeviceRequested, AddressOf claimedBarcodeScannerInstance1_ReleaseDeviceRequested
            claimedBarcodeScannerInstance1.Dispose()
            claimedBarcodeScannerInstance1 = Nothing
            scannerInstance1 = Nothing
            ResetUI()
            rootPage.NotifyUser("Click a start scanning button to begin.", NotifyType.StatusMessage)
        End Sub

        ''' <summary>
        ''' This is the click handler for the 'ScenarioEndScanningInstance2' button.
        ''' Initiates the disposal fo scanner instance 2.
        ''' </summary>
        ''' <param name="sender"></param>
        ''' <param name="e"></param>
        '''
        Private Sub ButtonEndScanningInstance2_Click(sender As Object, e As RoutedEventArgs)
            RemoveHandler claimedBarcodeScannerInstance2.DataReceived, AddressOf claimedBarcodeScannerInstance2_DataReceived
            RemoveHandler claimedBarcodeScannerInstance2.ReleaseDeviceRequested, AddressOf claimedBarcodeScannerInstance2_ReleaseDeviceRequested
            claimedBarcodeScannerInstance2.Dispose()
            claimedBarcodeScannerInstance2 = Nothing
            scannerInstance2 = Nothing
            ResetUI()
            rootPage.NotifyUser("Click a start scanning button to begin.", NotifyType.StatusMessage)
        End Sub

        ''' <summary>
        ''' This method returns the first available Barcode Scanner. To enumerate and find a particular device use the device enumeration code.
        ''' </summary>
        ''' <returns>a boolean value based on whether it found a compatible scanner connected</returns>
        Private Async Function CreateDefaultScannerObjectAsync(instance As BarcodeScannerInstance) As Task(Of Boolean)
            Dim scanner As BarcodeScanner = Nothing
            scanner = Await BarcodeScanner.GetDefaultAsync()
            If scanner Is Nothing Then
                rootPage.NotifyUser("Barcode scanner not found. Please connect a barcode scanner.", NotifyType.ErrorMessage)
                Return False
            End If

            Select instance
                Case BarcodeScannerInstance.Instance1
                    scannerInstance1 = scanner
                     Case BarcodeScannerInstance.Instance2
                    scannerInstance2 = scanner
                     Case Else
                    Return False
            End Select

            Return True
        End Function

        ''' <summary>
        ''' This method claims the connected scanner.
        ''' </summary>
        ''' <returns>a boolean based on whether it was able to claim the scanner.</returns>
        Private Async Function ClaimBarcodeScannerAsync(instance As BarcodeScannerInstance) As Task(Of Boolean)
            Dim bClaimAsyncStatus As Boolean = False
            Select instance
                Case BarcodeScannerInstance.Instance1
                    claimedBarcodeScannerInstance1 = Await scannerInstance1.ClaimScannerAsync()
                    If claimedBarcodeScannerInstance1 Is Nothing Then
                        rootPage.NotifyUser("Instance 1 claim barcode scanner failed.", NotifyType.ErrorMessage)
                    Else
                        bClaimAsyncStatus = True
                    End If

                     Case BarcodeScannerInstance.Instance2
                    claimedBarcodeScannerInstance2 = Await scannerInstance2.ClaimScannerAsync()
                    If claimedBarcodeScannerInstance2 Is Nothing Then
                        rootPage.NotifyUser("Instance 2 claim barcode scanner failed.", NotifyType.ErrorMessage)
                    Else
                        bClaimAsyncStatus = True
                    End If

                     Case Else
                    Return bClaimAsyncStatus
            End Select

            Return bClaimAsyncStatus
        End Function

        ''' <summary>
        ''' This method enables the connected scanner.
        ''' </summary>
        ''' <returns>a boolean based on whether it was able to enable the scanner.</returns>
        Private Async Function EnableBarcodeScannerAsync(instance As BarcodeScannerInstance) As Task(Of Boolean)
            Select instance
                Case BarcodeScannerInstance.Instance1
                    Await claimedBarcodeScannerInstance1.EnableAsync()
                    rootPage.NotifyUser("Instance 1 ready to scan. Device ID: " & claimedBarcodeScannerInstance1.DeviceId, NotifyType.StatusMessage)
                     Case BarcodeScannerInstance.Instance2
                    Await claimedBarcodeScannerInstance2.EnableAsync()
                    rootPage.NotifyUser("Instance 2 ready to scan. Device ID: " & claimedBarcodeScannerInstance2.DeviceId, NotifyType.StatusMessage)
                     Case Else
                    Return False
            End Select

            Return True
        End Function

        ''' <summary>
        ''' Reset the Scenario state
        ''' </summary>
        Private Sub ResetTheScenarioState()
            If claimedBarcodeScannerInstance1 IsNot Nothing Then
                claimedBarcodeScannerInstance1.Dispose()
                claimedBarcodeScannerInstance1 = Nothing
            End If

            scannerInstance1 = Nothing
            If claimedBarcodeScannerInstance2 IsNot Nothing Then
                claimedBarcodeScannerInstance2.Dispose()
                claimedBarcodeScannerInstance2 = Nothing
            End If

            scannerInstance2 = Nothing
            ResetUI()
        End Sub

        ''' <summary>
        ''' Resets the display Elements to original state
        ''' </summary>
        Private Sub ResetUI()
            Instance1Border.BorderBrush = New SolidColorBrush(Colors.Gray)
            Instance2Border.BorderBrush = New SolidColorBrush(Colors.Gray)
            ScanDataType1.Text = String.Format("No data")
            ScanData1.Text = String.Format("No data")
            DataLabel1.Text = String.Format("No data")
            ScanDataType2.Text = String.Format("No data")
            ScanData2.Text = String.Format("No data")
            DataLabel2.Text = String.Format("No data")
            ScenarioStartScanningInstance1.IsEnabled = True
            ScenarioStartScanningInstance2.IsEnabled = True
            ScenarioEndScanningInstance1.IsEnabled = False
            ScenarioEndScanningInstance2.IsEnabled = False
        End Sub

        ''' <summary>
        ''' Sets the UI elements to a state corresponding to the current active Instance.
        ''' </summary>
        ''' <param name="instance">Corresponds to the current active instance</param>
        Private Async Sub SetUI(instance As BarcodeScannerInstance)
            Instance1Border.BorderBrush = New SolidColorBrush(Colors.Gray)
            Instance2Border.BorderBrush = New SolidColorBrush(Colors.Gray)
            Select instance
                Case BarcodeScannerInstance.Instance1
                    Await rootPage.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, Sub()
                        ScenarioStartScanningInstance1.IsEnabled = False
                        ScenarioStartScanningInstance2.IsEnabled = True
                        ScenarioEndScanningInstance1.IsEnabled = True
                        ScenarioEndScanningInstance2.IsEnabled = False
                        Instance1Border.BorderBrush = New SolidColorBrush(Colors.DarkBlue)
                    End Sub)
                     Case BarcodeScannerInstance.Instance2
                    Await rootPage.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, Sub()
                        ScenarioStartScanningInstance1.IsEnabled = True
                        ScenarioStartScanningInstance2.IsEnabled = False
                        ScenarioEndScanningInstance1.IsEnabled = False
                        ScenarioEndScanningInstance2.IsEnabled = True
                        Instance2Border.BorderBrush = New SolidColorBrush(Colors.DarkBlue)
                    End Sub)
                     Case Else
                     End Select
        End Sub

        Function GetDataString(data As IBuffer) As String
            Dim result As StringBuilder = New StringBuilder()
            If data Is Nothing Then
                result.Append("No data")
            Else
                ' Just to show that we have the raw data, we'll print the value of the bytes.
                ' Arbitrarily limit the number of bytes printed to 20 so the UI isn't overloaded.
                Const MAX_BYTES_TO_PRINT As UInteger = 20
                Dim bytesToPrint As UInteger = Math.Min(data.Length, MAX_BYTES_TO_PRINT)
                Dim reader As DataReader = DataReader.FromBuffer(data)
                Dim dataBytes As Byte() = New Byte() {}
                reader.ReadBytes(dataBytes)
                For byteIndex = 0 To bytesToPrint - 1
                    result.AppendFormat("{0:X2} ", dataBytes(byteIndex))
                Next

                If bytesToPrint < data.Length Then
                    result.Append("...")
                End If
            End If

            Return result.ToString()
        End Function

        Function GetDataLabelString(data As IBuffer, scanDataType As UInteger) As String
            Dim result As String = Nothing
            If data Is Nothing Then
                result = "No data"
            Else
                Select BarcodeSymbologies.GetName(scanDataType)
                    Case "Upca", "UpcaAdd2", "UpcaAdd5", "Upce", "UpceAdd2", "UpceAdd5", "Ean8", "TfStd"
                        ' The UPC, EAN8, and 2 of 5 families encode the digits 0..9
                        ' which are then sent to the app in a UTF8 string (like "01234")
                        ' This is not an exhaustive list of symbologies that can be converted to a string
                        Dim reader As DataReader = DataReader.FromBuffer(data)
                        result = reader.ReadString(data.Length)
                         Case Else
                        result = String.Format("Decoded data unavailable. Raw label data: {0}", GetDataString(data))
                         End Select
            End If

            Return result
        End Function

        ''' <summary>
        ''' This is an event handler for the claimed scanner Instance 1 when it scans and recieves data
        ''' </summary>
        ''' <param name="sender"></param>
        ''' <param name="args"></param>
        Private Async Sub claimedBarcodeScannerInstance1_DataReceived(sender As ClaimedBarcodeScanner, args As BarcodeScannerDataReceivedEventArgs)
            ' Grab the data from the IBuffers
            Dim scanData As String = String.Empty
            Dim scanDataLabel As String = String.Empty
            If args.Report.ScanData IsNot Nothing Then
                scanData = GetDataString(args.Report.ScanData)
            End If

            If args.Report.ScanDataLabel IsNot Nothing Then
                scanDataLabel = GetDataLabelString(args.Report.ScanDataLabel, args.Report.ScanDataType)
            End If

            Await MainPage.Current.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, Sub()
                ScanDataType1.Text = String.Format("{0}", BarcodeSymbologies.GetName(args.Report.ScanDataType))
                DataLabel1.Text = String.Format("{0}", scanDataLabel)
                ScanData1.Text = String.Format("{0}", scanData)
                rootPage.NotifyUser("Instance 1 received data from the barcode scanner.", NotifyType.StatusMessage)
            End Sub)
        End Sub

        ''' <summary>
        ''' This is an event handler for the claimed scanner Instance 2 when it scans and recieves data
        ''' </summary>
        ''' <param name="sender"></param>
        ''' <param name="args"></param>
        Private Async Sub claimedBarcodeScannerInstance2_DataReceived(sender As ClaimedBarcodeScanner, args As BarcodeScannerDataReceivedEventArgs)
            ' Grab the data from the IBuffers
            Dim scanData As String = String.Empty
            Dim scanDataLabel As String = String.Empty
            If args.Report.ScanData IsNot Nothing Then
                scanData = GetDataString(args.Report.ScanData)
            End If

            If args.Report.ScanDataLabel IsNot Nothing Then
                scanDataLabel = GetDataLabelString(args.Report.ScanDataLabel, args.Report.ScanDataType)
            End If

            Await MainPage.Current.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, Sub()
                ScanDataType2.Text = String.Format("{0}", BarcodeSymbologies.GetName(args.Report.ScanDataType))
                DataLabel2.Text = String.Format("{0}", scanDataLabel)
                ScanData2.Text = String.Format("{0}", scanData)
                rootPage.NotifyUser("Instance 2 received data from the barcode scanner.", NotifyType.StatusMessage)
            End Sub)
        End Sub
    End Class
End Namespace


text:
/*******************************************************************************
 * \file position_estimation_default_config.h
 *
 * \author MAV'RIC Team
 *
 * \brief Default configuration for position estimation
 *
 ******************************************************************************/

#ifndef POSITION_ESTIMATION_DEFAULT_CONFIG_H_
#define POSITION_ESTIMATION_DEFAULT_CONFIG_H_

#ifdef __cplusplus
extern "C" {
#endif

#include "position_estimation.h"

static const position_estimation_conf_t position_estimation_default_config =
{
    .origin =
    {
        //default home location (EFPL Esplanade)
        .longitude  = 6.566044801857777f,
        .latitude   = 46.51852236174565f,
        .altitude   = 400.0f
    },
    .gravity = 9.81f
};

#ifdef __cplusplus
}
#endif

#endif // POSITION_ESTIMATION_DEFAULT_CONFIG_H_


text:
package tk.zielony.carbonsamples;

import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

import carbon.recycler.RowListAdapter;
import carbon.recycler.ViewItemDecoration;
import carbon.widget.RecyclerView;

public class SampleListActivity extends ThemedActivity {

    RowListAdapter<Serializable> adapter;
    Map<String, String> allPreferences;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        SharedPreferences preferences = getSharedPreferences("samples", Context.MODE_PRIVATE);
        allPreferences = (Map<String, String>) preferences.getAll();

        RecyclerView recyclerView = findViewById(R.id.recycler);
        recyclerView.setLayoutManager(new LinearLayoutManager(this));
        adapter = new RowListAdapter<>();
        adapter.putFactory(SampleActivityGroup.class, parent -> new DataBindingComponent<>(parent, R.layout.row_main));
        adapter.putFactory(SampleActivityItem.class, parent -> {
            return new DataBindingComponent<SampleActivityItem>(parent, R.layout.row_sample) {
                @Override
                public void bind(SampleActivityItem data) {
                    super.bind(data);
                    getView().findViewById(R.id.star).setOnClickListener(v -> {
                        data.setStarred(!data.isStarred());
                        if (data.isStarred()) {
                            preferences.edit().putString(data.getActivityClass().getName(), getString(data.getName())).commit();
                        } else {
                            preferences.edit().remove(data.getActivityClass().getName()).commit();
                        }
                        for (int i = 0; i < adapter.getItemCount(); i++) {
                            if (adapter.getItems().get(i) == data) {
                                adapter.notifyItemChanged(i);
                                break;
                            }
                        }
                    });
                }
            };
        });
        adapter.putFactory(String.class, parent -> new DataBindingComponent<>(parent, R.layout.row_description));
        adapter.setOnItemClickedListener((view, item, position) -> {
            if (item instanceof SampleActivityGroup) {
                Class activityClass = ((SampleActivityGroup) item).getActivityClass();
                Intent intent = new Intent(view.getContext(), activityClass);
                startActivity(intent);
            }
        });
        recyclerView.setAdapter(adapter);

        ViewItemDecoration itemDecoration = new ViewItemDecoration(this, R.layout.carbon_row_padding);
        itemDecoration.setDrawBefore(position -> position == 0);
        itemDecoration.setDrawAfter(position -> position == adapter.getItemCount() - 1);
        recyclerView.addItemDecoration(itemDecoration);
    }

    protected void setItems(List<Serializable> items) {
        for (Serializable item : items) {
            if (item instanceof SampleActivityItem) {
                SampleActivityItem sampleItem = (SampleActivityItem) item;
                sampleItem.setStarred(allPreferences.containsKey(sampleItem.getActivityClass().getName()));
            }
        }

        adapter.setItems(items);
    }

}


text:
package com.ys.tvnews.activity;

import android.content.Intent;
import android.graphics.Color;
import android.os.CountDownTimer;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import com.lidroid.xutils.HttpUtils;
import com.lidroid.xutils.exception.HttpException;
import com.lidroid.xutils.http.RequestParams;
import com.lidroid.xutils.http.ResponseInfo;
import com.lidroid.xutils.http.callback.RequestCallBack;
import com.lidroid.xutils.http.client.HttpRequest;
import com.ys.tvnews.R;
import com.ys.tvnews.httpurls.HttpUrl;
import com.ys.tvnews.utils.DESMD5Utils;
import com.ys.tvnews.views.MyProgressDialog;

import org.json.JSONException;
import org.json.JSONObject;

import java.util.HashMap;

/**
 * Created by sks on 2015/11/25.
 */
public class RegisterActivity extends BaseActivity implements View.OnClickListener{

    private TextView title_textView,right_textView;
    private EditText user_phone,user_code,user_passwd,user_confirm_passwd;
  //  private CheckBox check_agreement;
    private Button btn_register,img_accetp_code;
    private ImageView back_imageView;
    private boolean flag = false;   //判断所有的EditText是否都有值

    private String u_phone,u_passwd,u_confirm_passwd,u_code;
    private HttpUtils httpUtils;
    private CountDownTimer countDownTimer;

    private MyProgressDialog mDialog;

    @Override
    protected int loadLayout() {
        return R.layout.activity_register;
    }

    @Override
    protected void findView() {
        title_textView = (TextView) findViewById(R.id.title_title_textview);
        user_phone = (EditText) findViewById(R.id.user_phone);
        user_code = (EditText) findViewById(R.id.register_code);
       // user_passwd = (EditText) findViewById(R.id.user_passwd);
       // user_confirm_passwd = (EditText) findViewById(R.id.user_confirm_passwd);
        back_imageView = (ImageView) findViewById(R.id.title_back_imageview);
        img_accetp_code = (Button) findViewById(R.id.img_accept_code);
        right_textView = (TextView) findViewById(R.id.title_right_textview);
        btn_register = (Button) findViewById(R.id.btn_register);
        //check_agreement = (CheckBox) findViewById(R.id.check_agreement);
        mDialog = MyProgressDialog.createLoadingDialog(RegisterActivity.this,"正在加载!");
    }

    @Override
    protected void regListener() {
//        user_phone.setOnFocusChangeListener(this);
//        user_code.setOnFocusChangeListener(this);
       // user_passwd.setOnFocusChangeListener(this);
      //  user_confirm_passwd.setOnFocusChangeListener(this);
        back_imageView.setOnClickListener(this);
        img_accetp_code.setOnClickListener(this);
        right_textView.setOnClickListener(this);
        btn_register.setOnClickListener(this);
      //  check_agreement.setOnCheckedChangeListener(this);

    }

    @Override
    protected void loadData() {

      //  u_passwd = user_passwd.getText().toString().trim();
    //    u_confirm_passwd = user_confirm_passwd.getText().toString().trim();

        title_textView.setText("注册");
        right_textView.setText("登录");
        right_textView.setTextColor(Color.BLUE);
        right_textView.setVisibility(View.VISIBLE);
        httpUtils = new HttpUtils();
        //计时发送验证码的时间
        countDownTimer = new CountDownTimer(60000,1000) {
            @Override
            public void onTick(long millisUntilFinished) {
                img_accetp_code.setBackgroundResource(R.mipmap.code_time);
                img_accetp_code.setText(String.valueOf(millisUntilFinished / 1000) + "s");
                img_accetp_code.setTextColor(Color.parseColor("#ffffff"));
            }

            @Override
            public void onFinish() {
                img_accetp_code.setClickable(true);
                img_accetp_code.setBackgroundResource(R.mipmap.fasongyzm);
                img_accetp_code.setText("");
            }
        };

        user_code.addTextChangedListener(new TextWatcher() {
            @Override
            public void beforeTextChanged(CharSequence s, int start, int count, int after) {

            }

            @Override
            public void onTextChanged(CharSequence s, int start, int before, int count) {

            }

            @Override
            public void afterTextChanged(Editable s) {
                u_phone = user_phone.getText().toString().trim();

                if(!TextUtils.isEmpty(u_phone)&&!TextUtils.isEmpty(s.toString())){
                    Log.e("info","文本不为空==================");
                    btn_register.setEnabled(true);
                }else{
                    btn_register.setEnabled(false);
                    Log.e("info", "文本为空==================");
                }
            }
        });
    }

    @Override
    protected void reqServer() {

    }

    @Override
    public void onClick(View v) {
       switch (v.getId()){
           case R.id.title_back_imageview:
               finish();
               break;
           case R.id.title_right_textview:
               Intent intent = new Intent(RegisterActivity.this,LoginActivity.class);
               startActivity(intent);
               break;
           case R.id.img_accept_code:
               acceptCode();
               break;
           case R.id.btn_register:
               startRegister();
               break;
       }
    }

    /**
     * 注册
     */
    private void startRegister() {
        if (TextUtils.isEmpty(u_phone)) {
            showToast("请输入手机号");
            return;
        }

        if(!isMobileNO(u_phone)){
            showToast("请输入正确的手机号");
            return;
        }

        final String phone = user_phone.getText().toString().trim();
        String SmsCode = user_code.getText().toString().trim();

        HashMap<String, String> map = new HashMap<String, String>();
        map.put("userName", DESMD5Utils.doDESEncode(phone, HttpUrl.desKey));
        map.put("smsCode", SmsCode);
        String sign = DESMD5Utils.dsigndispost(map);
        RequestParams params = new RequestParams();
        params.addBodyParameter("userName", DESMD5Utils.doDESEncode(phone, HttpUrl.desKey));
        params.addBodyParameter("smsCode", SmsCode);
        params.addBodyParameter("sign", sign);

        httpUtils.send(HttpRequest.HttpMethod.POST, HttpUrl.VERIFICATIONCODE, params, new RequestCallBack<String>() {

            @Override
            public void onStart() {
                super.onStart();
            }

            @Override
            public void onSuccess(ResponseInfo<String> responseInfo) {
                   if(responseInfo!=null){
                       Log.e("info",responseInfo.result);
                       try {
                           JSONObject jsonObject = new JSONObject(responseInfo.result);
                           JSONObject msg = jsonObject.getJSONObject("msg");
                           if ("0".equals(msg.getString("code"))) {
                              Intent register_intent = new Intent(mContext,RegisterNextActivity.class);
                               register_intent.putExtra("phone",phone);
                               startActivity(register_intent);
                               RegisterActivity.this.finish();
                           }else{
                               showToast(msg.getString("text"));
                           }
                       }catch (Exception e){
                           e.printStackTrace();
                       }
                   }
            }

            @Override
            public void onFailure(HttpException e, String s) {

            }
        });

    }

    private void acceptCode(){

       String phone = user_phone.getText().toString().trim();
        if (TextUtils.isEmpty(phone)) {
            showToast("请输入手机号");
            return;
        }
        if(!isMobileNO(phone)){
            showToast("请输入正确的手机号");
            return;
        }
        final HashMap<String, String> map = new HashMap<String, String>();
        map.put("userName", DESMD5Utils.doDESEncode(phone, HttpUrl.desKey));
        String sign = DESMD5Utils.dsigndispost(map);
        RequestParams params = new RequestParams();
        params.addBodyParameter("userName", DESMD5Utils.doDESEncode(phone, HttpUrl.desKey));
        params.addBodyParameter("sign", sign);
        httpUtils.send(HttpRequest.HttpMethod.POST, HttpUrl.SENDCAPTCHA, params, new RequestCallBack<String>() {

            @Override
            public void onStart() {
                Log.e("info", "执行了start方法");
                mDialog.show();
                super.onStart();
            }

            @Override
            public void onSuccess(ResponseInfo<String> responseInfo) {
                 if(responseInfo!=null){
                     mDialog.dismiss();
                     try {
                         JSONObject jsonObject = new JSONObject(responseInfo.result);
                         JSONObject msg = jsonObject.getJSONObject("msg");
                         if(msg.getString("code").equals("0")){
                             img_accetp_code.setClickable(false);
                             countDownTimer.start();
                         }else{
                             showToast(msg.getString("text"));
                         }
                     } catch (JSONException e) {
                         e.printStackTrace();
                     }
                 }else{
                     showToast("网络加载失败");
                 }

            }

            @Override
            public void onFailure(HttpException e, String s) {
                showToast("网络加载失败");
                mDialog.dismiss();
            }

        });
    }

    /**
     * 验证手机格式
     */
    public static boolean isMobileNO(String mobiles) {
    /*
    移动:134、135、136、137、138、139、150、151、157(TD)、158、159、187、188
    联通:130、131、132、152、155、156、185、186
    电信:133、153、180、189、(1349卫通)
    总结起来就是第一位必定为1,第二位必定为3或5或8,其他位置的可以为0-9
    */
        String telRegex = "[1][358]\\d{9}";//"[1]"代表第1位为数字1,"[358]"代表第二位可以为3、5、8中的一个,"\\d{9}"代表后面是可以是0~9的数字,有9位。
        if (TextUtils.isEmpty(mobiles)) return false;
        else return mobiles.matches(telRegex);
    }

}


text:
<?php

namespace Senegal\ApiBundle\Model;

class Collection extends \ArrayObject
{
    /**
     * @var string
     */
    private $name;

    /**
     * @param string            $name
     * @param array|null|object $input
     */
    public function __construct($name, $input)
    {
        $this->name = $name;

        parent::__construct($input);
    }

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


text:
<?php

namespace AppBundle\Controller;

use AppBundle\Entity\Courier;
use AppBundle\Form\CreateCourierForm;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

/**
 * Class CourierController
 * @Route("/couriers")
 */
class CourierController extends Controller
{
    /**
     * @Route("/", name="courier_list")
     * @Method("GET")
     * @Template("@App/Courier/list.html.twig")
     * @param Request $request
     * @return array|Response
     */
    public function indexAction(Request $request)
    {
        $couriers = $this->getDoctrine()->getRepository('AppBundle:Courier')->findAll();

        return [
            'couriers' => $couriers,
        ];
    }

    /**
     * @Route("/create/", name="courier_create")
     * @Method({"GET","POST"})
     * @Template("@App/Courier/create.html.twig")
     * @param Request $request
     * @return array|Response
     */
    public function createAction(Request $request)
    {
        $form = $this->createForm(CreateCourierForm::class);
        $form->handleRequest($request);
        if ($form->isValid()) {
            /** @var Courier $courier */
            $courier = $form->getData();
            $em = $this->getDoctrine()->getManager();
            $em->persist($courier);
            $em->flush();

            $this->addFlash('success', 'Курьер ' . $courier->getFullName() . ' успешно добавлен.');

            return $this->redirectToRoute('courier_list');
        }

        return [
            'form' => $form->createView(),
        ];
    }

    /**
     * @Route("/get_courier_busy_dates", name="get_courier_busy_dates")
     * @Method("GET")
     * @param Request $request
     * @return JsonResponse
     */
    public function getCourierBusyDates(Request $request)
    {
        $courierId = $request->get('courierId');
        $courierBusyDays = $this->get('app.service.schedule_service')->getCourierBusyDates($courierId);

        return new JsonResponse($courierBusyDays);
    }
}


text:
. /etc/sysconfig/heat-params

KUBE_OS_CLOUD_CONFIG=/etc/sysconfig/kube_openstack_config

# kubernetes backend only support keystone v2 at this point
AUTH_URL=$(echo "$AUTH_URL" | tr -s "v3" "v2")

# Generate a the configuration for Kubernetes services
# to talk to OpenStack Neutron
cat > $KUBE_OS_CLOUD_CONFIG <<EOF
[Global]
auth-url=$AUTH_URL
Username=$USERNAME
Password=$PASSWORD
tenant-name=$TENANT_NAME
[LoadBalancer]
subnet-id=$CLUSTER_SUBNET
create-monitor=yes
monitor-delay=1m
monitor-timeout=30s
monitor-max-retries=3
EOF


text:
import gql from 'graphql-tag';

export default {
   viewer: {
      name: "PushShoutFormViewer",
      document: gql`
      fragment PushShoutFormViewer on IAuthorized {
         id
         role {
            id
            rules {
               id
               name
            }
         }
      }`
   }
};


text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/video/transcoder/v1/services.proto

package com.google.cloud.video.transcoder.v1;

public interface ListJobsRequestOrBuilder
    extends
    // @@protoc_insertion_point(interface_extends:google.cloud.video.transcoder.v1.ListJobsRequest)
    com.google.protobuf.MessageOrBuilder {

  /**
   *
   *
   *

   * Required. Format: `projects/{project}/locations/{location}`
   *

   *
   *
   * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   *
   *
   * @return The parent.
   */
  java.lang.String getParent();
  /**
   *
   *
   *

   * Required. Format: `projects/{project}/locations/{location}`
   *

   *
   *
   * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   *
   *
   * @return The bytes for parent.
   */
  com.google.protobuf.ByteString getParentBytes();

  /**
   *
   *
   *

   * The maximum number of items to return.
   *

   *
   * int32 page_size = 2;
   *
   * @return The pageSize.
   */
  int getPageSize();

  /**
   *
   *
   *

   * The `next_page_token` value returned from a previous List request, if
   * any.
   *

   *
   * string page_token = 3;
   *
   * @return The pageToken.
   */
  java.lang.String getPageToken();
  /**
   *
   *
   *

   * The `next_page_token` value returned from a previous List request, if
   * any.
   *

   *
   * string page_token = 3;
   *
   * @return The bytes for pageToken.
   */
  com.google.protobuf.ByteString getPageTokenBytes();

  /**
   *
   *
   *

   * The filter expression, following the syntax outlined in
   * https://google.aip.dev/160.
   *

   *
   * string filter = 4;
   *
   * @return The filter.
   */
  java.lang.String getFilter();
  /**
   *
   *
   *

   * The filter expression, following the syntax outlined in
   * https://google.aip.dev/160.
   *

   *
   * string filter = 4;
   *
   * @return The bytes for filter.
   */
  com.google.protobuf.ByteString getFilterBytes();

  /**
   *
   *
   *

   * One or more fields to compare and use to sort the output.
   * See https://google.aip.dev/132#ordering.
   *

   *
   * string order_by = 5;
   *
   * @return The orderBy.
   */
  java.lang.String getOrderBy();
  /**
   *
   *
   *

   * One or more fields to compare and use to sort the output.
   * See https://google.aip.dev/132#ordering.
   *

   *
   * string order_by = 5;
   *
   * @return The bytes for orderBy.
   */
  com.google.protobuf.ByteString getOrderByBytes();
}


text:
<?php

/* @Twig/Exception/exception.atom.twig */
class __TwigTemplate_addfd37cf699b109e52bb7117d1b2a91905e81e23aff271e99906d1b08f2ca4d extends Twig_Template
{
    public function __construct(Twig_Environment $env)
    {
        parent::__construct($env);

        $this->parent = false;

        $this->blocks = array(
        );
    }

    protected function doDisplay(array $context, array $blocks = array())
    {
        $__internal_2db98ec9fc1b81ff1050ab84fb67e875922cce8e8c0b9a10116d272e469f5ac9 = $this->env->getExtension("Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension");
        $__internal_2db98ec9fc1b81ff1050ab84fb67e875922cce8e8c0b9a10116d272e469f5ac9->enter($__internal_2db98ec9fc1b81ff1050ab84fb67e875922cce8e8c0b9a10116d272e469f5ac9_prof = new Twig_Profiler_Profile($this->getTemplateName(), "template", "@Twig/Exception/exception.atom.twig"));

        $__internal_f9a88541f057cf8a4f2eed009eae0d26179f3cad272ee4395ccb63ba524af75a = $this->env->getExtension("Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension");
        $__internal_f9a88541f057cf8a4f2eed009eae0d26179f3cad272ee4395ccb63ba524af75a->enter($__internal_f9a88541f057cf8a4f2eed009eae0d26179f3cad272ee4395ccb63ba524af75a_prof = new Twig_Profiler_Profile($this->getTemplateName(), "template", "@Twig/Exception/exception.atom.twig"));

        // line 1
        echo twig_include($this->env, $context, "@Twig/Exception/exception.xml.twig", array("exception" => ($context["exception"] ?? $this->getContext($context, "exception"))));
        echo "
";

        $__internal_2db98ec9fc1b81ff1050ab84fb67e875922cce8e8c0b9a10116d272e469f5ac9->leave($__internal_2db98ec9fc1b81ff1050ab84fb67e875922cce8e8c0b9a10116d272e469f5ac9_prof);

        $__internal_f9a88541f057cf8a4f2eed009eae0d26179f3cad272ee4395ccb63ba524af75a->leave($__internal_f9a88541f057cf8a4f2eed009eae0d26179f3cad272ee4395ccb63ba524af75a_prof);

    }

    public function getTemplateName()
    {
        return "@Twig/Exception/exception.atom.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  25 => 1,);
    }

    /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */
    public function getSource()
    {
        @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED);

        return $this->getSourceContext()->getCode();
    }

    public function getSourceContext()
    {
        return new Twig_Source("{{ include('@Twig/Exception/exception.xml.twig', { exception: exception }) }}
", "@Twig/Exception/exception.atom.twig", "C:\\wamp64\\www\\Ecommerce\\vendor\\symfony\\symfony\\src\\Symfony\\Bundle\\TwigBundle\\Resources\\views\\Exception\\exception.atom.twig");
    }
}


text:
"""
@file
@brief Shortcut to *examples*.
"""


text:
"""
A bot to change the header of a subreddit according a schedule
Written by /u/SmBe19
"""

import praw
import time
import OAuth2Util

# ### USER CONFIGURATION ### #

# The bot's useragent. It should contain a short description of what it does and your username. e.g. "RSS Bot by /u/SmBe19"
USERAGENT = ""

# The name of the subreddit to operate on. The bot has to be a mod there.
SUBREDDIT = ""

# ### END USER CONFIGURATION ### #

# ### BOT CONFIGURATION ### #
HEADERS_CONFIGFILE = "headers.txt"
# ### END BOT CONFIGURATION ### #

try:
	# A file containing data for global constants.
	import bot
	for k in dir(bot):
		if k.upper() in globals():
			globals()[k.upper()] = getattr(bot, k)
except ImportError:
	pass

def read_headers_config():
	headers = []
	with open(HEADERS_CONFIGFILE, "r") as f:
		for line in f:
			parts = line.split("\t")
			headers.append((int(parts[0]), parts[1].strip()))
	headers.sort()
	return headers

# main procedure
def run_bot():
	r = praw.Reddit(USERAGENT)
	o = OAuth2Util.OAuth2Util(r)
	o.refresh()
	sub = r.get_subreddit(SUBREDDIT)

	print("Start bot for subreddit", SUBREDDIT)

	while True:
		try:
			o.refresh()
			headers = read_headers_config()
			if len(headers) < 1:
				return

			next_header = headers[0]
			atime = time.localtime().tm_hour * 100 + time.localtime().tm_min
			for header in headers:
				if header[0] > atime:
					next_header = header
					break

			sleeptime = (next_header[0] % 100 - atime % 100) * 60 + (next_header[0] // 100 - atime // 100) * 3600
			if sleeptime < 0:
				sleeptime += 24*3600
			print("Now:", atime, "/ Sleep for", sleeptime, "s until", next_header[0])
			time.sleep(sleeptime)

			sub.upload_image(next_header[1], header=True)
			print("Change header")

		except KeyboardInterrupt:
			break
		except Exception as e:
			print("Exception", e)

if __name__ == "__main__":
	if not USERAGENT:
		print("missing useragent")
	elif not SUBREDDIT:
		print("missing subreddit")
	else:
		run_bot()


text:
FactoryGirl.define do
  factory :download do
    user_id 1
  end
end


text:
namespace Google.Cloud.Container.V1.Snippets
{
    // [START container_v1_generated_ClusterManager_SetMaintenancePolicy_async_flattened2]
    using Google.Cloud.Container.V1;
    using System.Threading.Tasks;

    public sealed partial class GeneratedClusterManagerClientSnippets
    {
        /// <summary>Snippet for SetMaintenancePolicyAsync</summary>
        /// <remarks>
        /// This snippet has been automatically generated and should be regarded as a code template only.
        /// It will require modifications to work:
        /// - It may require correct/in-range values for request initialization.
        /// - It may require specifying regional endpoints when creating the service client as shown in
        ///   https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
        /// </remarks>
        public async Task SetMaintenancePolicy2Async()
        {
            // Create client
            ClusterManagerClient clusterManagerClient = await ClusterManagerClient.CreateAsync();
            // Initialize request argument(s)
            string name = "";
            MaintenancePolicy maintenancePolicy = new MaintenancePolicy();
            // Make the request
            Operation response = await clusterManagerClient.SetMaintenancePolicyAsync(name, maintenancePolicy);
        }
    }
    // [END container_v1_generated_ClusterManager_SetMaintenancePolicy_async_flattened2]
}