text:
#ifndef TENSORFLOW_COMPILER_MLIR_LITE_TRANSFORMS_PASSES_H_
#define TENSORFLOW_COMPILER_MLIR_LITE_TRANSFORMS_PASSES_H_

#include <memory>
#include <string>

#include "absl/container/flat_hash_set.h"

namespace mlir {
class FuncOp;
class ModuleOp;
template <typename T>
class OperationPass;
class Type;

namespace TFL {
using StringSet = absl::flat_hash_set<std::string>;
class QuantizationSpecs;

// Creates an instance of the TensorFlow Lite dialect LegalizeTF pass.
// When the given run_tfl_runtime_verification value is true, it will check each
// TFL builtin op towards the TFL runtime capability and the incompatible TF ops
// will be left in the graph without getting legalized.
std::unique_ptr<OperationPass<FuncOp>> CreateLegalizeTFPass(
    bool run_tfl_runtime_verification);

// Creates an instance of the TensorFlow Lite dialect Optimize pass.
std::unique_ptr<OperationPass<FuncOp>> CreateOptimizePass(
    bool enable_canonicalization);

// Creates an instance of the TensorFlow Lite dialect PrepareTF pass.
std::unique_ptr<OperationPass<FuncOp>> CreatePrepareTFPass(
    bool unfold_batch_matmul, bool allow_bf16_and_f16_type_legalization);

// Creates an instance of the TensorFlow Lite dialect LowerStaticTensorList
// pass.
std::unique_ptr<OperationPass<ModuleOp>> CreateLowerStaticTensorListPass(
    bool allow_tensorlist_pass_through = false);

// Creates an instance of the TensorFlow Lite dialect Quantize pass.
std::unique_ptr<OperationPass<FuncOp>> CreateQuantizePass(
    bool verify_numeric = false, bool whole_model_verify = false,
    bool legacy_float_scale = false, const StringSet& ops_blocklist = {},
    const StringSet& nodes_blocklist = {});

// Creates an instance of the TensorFlow Lite dialect PrepareQuantize pass.
std::unique_ptr<OperationPass<FuncOp>> CreatePrepareQuantizePass(
    const QuantizationSpecs& quant_specs);

// Creates an instance of the TensorFlow Lite dialect PostQuantize pass.
std::unique_ptr<OperationPass<FuncOp>> CreatePostQuantizePass(
    bool emit_quant_adaptor_ops);

// Creates an instance of the TensorFlow Lite pass that decomposes hybrid
// quantization patterns to the same dense operation with tfl dequantization
// and quantization patterns.
std::unique_ptr<OperationPass<FuncOp>> CreateDecomposeHybridQuantizationPass();

// Creates an instance of the TensorFlow Lite optimize op order pass.
std::unique_ptr<OperationPass<FuncOp>> CreateOptimizeOpOrderPass();

// Creates an instance of the TensorFlow Lite dialect TrimFunctions
// pass.
std::unique_ptr<OperationPass<ModuleOp>> CreateTrimFunctionsPass(
    const std::vector<std::string>& trim_funcs_allowlist);

// Creates an instance of the TensorFlow Lite dialect PrepareCompositeFunctions
// pass.
std::unique_ptr<OperationPass<ModuleOp>> CreatePrepareCompositeFunctionsPass();

// Creates an instance of the TensorFlow Lite dialect SplitMergedOperandsPass.
std::unique_ptr<OperationPass<FuncOp>> CreateSplitMergedOperandsPass();

// Creates an instance of the TensorFlow Lite dialect OptimizeFunctionalOpsPass.
std::unique_ptr<OperationPass<ModuleOp>> CreateOptimizeFunctionalOpsPass();

std::unique_ptr<OperationPass<FuncOp>> CreateModifyIONodesPass(
    mlir::Type input_type, mlir::Type output_type);

// Creates an instance of the TensorFlow Lite dialect PostQuantizeRemoveQDQ
// pass.
std::unique_ptr<OperationPass<FuncOp>> CreatePostQuantizeRemoveQDQPass();

// Creates an instance of the TensorFlow Lite dialect pass to add default
// quantization parameters.
std::unique_ptr<OperationPass<FuncOp>> CreateDefaultQuantParamsPass(
    double default_min, double default_max, bool is_signed);

// Creates an instance of the TensorFlow Lite dialect pass to convert dense
// tensor to sparse format.
std::unique_ptr<OperationPass<FuncOp>> CreateDenseToSparsePass();

// Creates function pass to legalize TF While to TFL While.
std::unique_ptr<OperationPass<ModuleOp>> CreateLegalizeTFWhilePass();

// Creates an instance of the TensorFlow Lite dialect WhileOp outline pass.
std::unique_ptr<OperationPass<ModuleOp>> CreateWhileOutlinePass();

// Verifies runtime constraints.
std::unique_ptr<OperationPass<FuncOp>> CreateRuntimeVerifyPass();

// Creates raise custom ops pass, which legalize custom ops to TFL::CustomOp
std::unique_ptr<OperationPass<FuncOp>> CreateRaiseCustomOpsPass(
    const std::vector<std::string>& target_ops);

// Creates raise custom ops pass, which legalize custom ops to TFL::CustomOp
std::unique_ptr<OperationPass<FuncOp>> CreateLowerCustomOpsPass();

// Inserts an TFL::CallOnce op when the tf_saved_model's session initialzer is
// given.
std::unique_ptr<OperationPass<ModuleOp>>
CreateInsertCallOnceOpFromSessionInitializerPass();

// Creates a pass which is responsible for legalizing TensorFlow variables to
// TensorFlow Lite variables.
std::unique_ptr<OperationPass<ModuleOp>> CreateLegalizeVariablesPass();

// Creates a pass which analyze the model whether it is safe to use
// native TFLite variables or not.
std::unique_ptr<OperationPass<ModuleOp>> CreateAnalyzeVariablesPass();

// Creates a pass which is responsible for legalizing TensorFlow static hash
// tables to TensorFlow Lite hash tables.
std::unique_ptr<OperationPass<ModuleOp>> CreateLegalizeHashTablesPass();

// Creates get arithmetic count pass, which will calculate the arithmetic count
// for each ops.
std::unique_ptr<OperationPass<FuncOp>> CreateGetArithmeticCountPass();
}  // namespace TFL

}  // namespace mlir

#endif  // TENSORFLOW_COMPILER_MLIR_LITE_TRANSFORMS_PASSES_H_


text:
package br.com.casadocodigo.livraria.modelo;

import java.math.BigDecimal;
import java.net.URI;
import java.util.Calendar;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;

@Entity
public class Livro {

	@Id
	@GeneratedValue
	private Long id;

	@Column(unique = true)
	private String isbn;

	private String titulo;
	private String descricao;
	private BigDecimal preco;
	private Calendar dataPublicacao;

	private String capa;

	public String getTitulo() {
		return titulo;
	}

	public void setTitulo(String titulo) {
		this.titulo = titulo;
	}

	public String getDescricao() {
		return descricao;
	}

	public void setDescricao(String descricao) {
		this.descricao = descricao;
	}

	public String getIsbn() {
		return isbn;
	}

	public void setIsbn(String isbn) {
		this.isbn = isbn;
	}

	public BigDecimal getPreco() {
		return preco;
	}

	public void setPreco(BigDecimal preco) {
		this.preco = preco;
	}

	public Calendar getDataPublicacao() {
		return dataPublicacao;
	}

	public void setDataPublicacao(Calendar dataPublicacao) {
		this.dataPublicacao = dataPublicacao;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public URI getCapa() {
		if (capa == null)
			return null;
		return URI.create(capa);
	}

	public void setCapa(URI capa) {
		this.capa = capa == null ? null : capa.toString();
	}
}

redpajama_set_name: RedPajamaGithub


text:
<?php if(!defined("HDPHP_PATH"))exit;C("SHOW_NOTICE",FALSE);?><!DOCTYPE html>

	<meta charset="UTF-8">
	<title>货品</title>

<link href='http://localhost/ecshop/hdphp/hdphp/Extend/Org/hdjs/hdui/css/hdui.css' rel='stylesheet' media='screen'>

<link href='http://localhost/ecshop/hdphp/hdphp/Extend/Org/hdjs/hdvalidate/css/hdvalidate.css' rel='stylesheet' media='screen'>

            货品管理

            商品列表

<form action="" method="post">

                 规格属性循环
                货号
                库存数量
                操作

                <input type="text" name="product_sn" value="">
                <input type="text" name="product_number" value="">
                [+]

</form>


text:
<?php

global $xerte_toolkits_site;
global $development;
$xerte_toolkits_site = new stdClass();

require_once(dirname(__FILE__) . "/../database.php");
require_once(dirname(__FILE__) . '/../website_code/php/database_library.php');

$success_string = '';
$fail_string = '';
$magic_quotes = get_magic_quotes_gpc();
$development = true;

function _debug($string) {
    // pass, for now.
}

ini_set('error_reporting', E_ALL);

echo file_get_contents("page_top");

$res = db_query("SELECT * FROM {$xerte_toolkits_site->database_table_prefix}sitedetails");

if(isset($res[0]['site_id'])){

die("
You appear to have already created a database and so do not need to install again
");

}

$res = db_query("DELETE FROM {$xerte_toolkits_site->database_table_prefix}sitedetails");
if($res === false) {
    die("Error running SQL query");
}

$res = db_query("insert  into {$xerte_toolkits_site->database_table_prefix}sitedetails(site_id) VALUES (1)");
if($res === false) {
    die("Error running SQL query");
}

if(!empty($_POST['site_url'])) {
    if(!preg_match('/^http/', $_POST['site_url'])) {
        $_POST['site_url'] = 'http://' . $_POST['site_url'];
    }
}
foreach(array('news_text', 'pod_one', 'pod_two', 'form_string', 'peer_form_string', 'play_edit_preview_query') as $key) {
    $_POST[$key] = base64_encode(stripcslashes($_POST[$key]));
}

foreach(array('site_url', 'apache', 'mimetypes', 'LDAP_preference', 'LDAP_filter', 'integration_config_path', 'admin_username', 'admin_password', 'site_session_name',
    'site_title', 'site_name', 'site_logo', 'organisational_logo','welcome_message', 'site_text', 'news_text', 'pod_one', 'pod_two', 'copyright', 'rss_title',
    'synd_publisher', 'synd_rights', 'synd_license', 'demonstration_page', 'form_string', 'peer_form_string', 'module_path', 'website_code_path', 'users_file_area_short',
    'php_library_path', 'error_log_path', 'email_error_list', 'error_log_message', 'max_error_size', 'error_email_message', 'max_error_size', 'error_email_message',
    'ldap_host', 'ldap_port', 'bind_pwd', 'basedn', 'bind_dn', 'flash_save_path', 'flash_upload_path', 'flash_preview_check_path', 'flash_flv_skin',
    'site_email_account', 'headers', 'email_to_add_to_username', 'proxy1', 'port1', 'feedback_list', 'play_edit_preview_query' ) as $field) {

    $res = db_query("UPDATE {$xerte_toolkits_site->database_table_prefix}sitedetails SET $field = ? WHERE site_id = ?", array($_POST[$field], '1'));
    if($res===false) {
        $fail_string .= "
The sitedetails {$field} query has failed.

";
    }
    else {
        $success_string .= "The sitedetails {$field} query succeeded
";
    }
}

$ldap_fields = array('ldap_filter' => 'LDAP_filter', 'ldap_filter_attr' => 'LDAP_preference', 'ldap_knownname' => 'ldap_host', 'ldap_host' => 'ldap_host', 'ldap_port' => 'ldap_port',
                     'ldap_password' => 'bind_pwd', 'ldap_basedn' => 'basedn', 'ldap_username' => 'bind_dn');
$comma = '';
$query = "INSERT INTO {$xerte_toolkits_site->database_table_prefix}ldap (" . implode(',', array_keys($ldap_fields)) . ") VALUES (";
$values = array();
foreach($ldap_fields as $post_key) {
    $query .= $comma;
    $query .= "?";
    $comma = ",";
    $values[] = $_POST[$post_key];
}
$query .= ")";

$res = db_query($query, $values);
if($res===false) {
    $fail_string .= "The ldap query has failed (query: {{{$query}}})
";
}
else {
    $success_string .= "The 'ldap' insert query has succeeded
";
}

if(!$magic_quotes){
    $import_path = addslashes($_POST['import_path']);
}else{
    $import_path = $_POST['import_path'];
}

$query = "update " . $xerte_toolkits_site->database_table_prefix . "sitedetails set import_path=\"" . str_replace("\\\\","/",$import_path) . "\" where site_id=\"1\"";

$query_response = db_query($query);

if($query_response === false){
    $fail_string .= "The sitedetails import_path query " . $query . " has failed.
";
}else{
    $success_string .= "The sitedetails import_path query succeeded
";
}

if(!$magic_quotes){
    $root_path = addslashes($_POST['root_file_path']);
}else{
    $root_path = $_POST['root_file_path'];

}

$query = "update " . $xerte_toolkits_site->database_table_prefix . "sitedetails set root_file_path='" . str_replace("\\\\","/",$root_path) . "' where site_id=\"1\"";
$query_response = db_query($query);

if($query_response === false){
    $fail_string .= "The sitedetails root_file_path query " . $query . " has failed due to " . mysql_error() . "
";
}else{
    $success_string .= "The sitedetails root_file_path query succeeded
";

}

// Setup .htaccess file if we can...
if($_POST['apache']=="true"){
    $replace = substr($_SERVER['PHP_SELF'],0,strpos($_SERVER['PHP_SELF'],"/",1));
    $buffer = file_get_contents("htaccess.conf");
    $buffer = str_replace("*/",$replace . "/",$buffer);
    $file_handle = fopen(".htaccess",'w');
    fwrite($file_handle,$buffer,strlen($buffer));
    fclose($file_handle);
    if(chmod(".htaccess",0744) && rename(".htaccess","../.htaccess") && chmod("../.htaccess",0744)) {
        $success_string .= "
.htaccess setup succeeded
";
    }
}

?>

    Install complete

<?PHP

if($fail_string!=""){

    echo "
<b?The following queries failed -
 " . $fail_string . "
";
    echo "
These failures may affect your site, please see if they can be rectified using the management tools or altering the database directly.
";

}

if($success_string!=""){

    echo "
The following queries suceeded -
 " . $success_string . "
";

}

?>

 Your site URL is  <a href="http://<?PHP echo $_SERVER['HTTP_HOST'] . substr($_SERVER['PHP_SELF'],0,strlen($_SERVER['PHP_SELF'])-15); ?>"><?php echo $_SERVER['HTTP_HOST'] . substr($_SERVER['PHP_SELF'],0,strlen($_SERVER['PHP_SELF'])-15); ?>

Security Warning

If you have installed this on a public facing server, ensure you delete the following:

/setup (this installer; it can be used to overwrite files on your webserver)

You should also delete all of the following you are not planning to use:

webctlink,php (allows anyone to specify whatever username they wish)

Register!

Please register your site to receive valuable notifications regarding Xerte Online Toolkits. You can find the registration button in the management page:
    <a href="http://<?PHP echo $_SERVER['HTTP_HOST'] . substr($_SERVER['PHP_SELF'],0,strlen($_SERVER['PHP_SELF'])-15) . "/management.php?register"; ?>"><?php echo $_SERVER['HTTP_HOST'] . substr($_SERVER['PHP_SELF'],0,strlen($_SERVER['PHP_SELF'])-15) . "/management.php"; ?>

Need more help?

Please see the Xerte Community site at http://www.xerte.org.uk and please consider joining the forum.


text:
<?php

namespace backend\modules\questions\controllers;

use yii\web\Controller;

class DefaultController extends Controller
{
    public function actionIndex()
    {
        return $this->render('index');
    }
}


text:
package com.blazebit.persistence.view.testsuite.collections.subview;

import static com.blazebit.persistence.view.testsuite.collections.subview.SubviewAssert.assertSubviewEquals;
import static org.junit.Assert.assertEquals;

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

import javax.persistence.EntityManager;

import com.blazebit.persistence.testsuite.tx.TxVoidWork;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

import com.blazebit.persistence.CriteriaBuilder;
import com.blazebit.persistence.view.EntityViewManager;
import com.blazebit.persistence.view.EntityViewSetting;
import com.blazebit.persistence.view.EntityViews;
import com.blazebit.persistence.view.spi.EntityViewConfiguration;
import com.blazebit.persistence.view.testsuite.AbstractEntityViewTest;
import com.blazebit.persistence.view.testsuite.collections.entity.simple.DocumentForCollections;
import com.blazebit.persistence.view.testsuite.collections.entity.simple.PersonForCollections;
import com.blazebit.persistence.view.testsuite.collections.subview.model.SubviewClassDocumentForCollectionsView;
import com.blazebit.persistence.view.testsuite.collections.subview.model.SubviewPersonForCollectionsView;

/**
 *
 * @author Christian Beikov
 * @since 1.0.0
 */
@RunWith(Parameterized.class)
public class SubviewClassCollectionsTest extends AbstractEntityViewTest {

    private final String viewConstructorName;

    private DocumentForCollections doc1;
    private DocumentForCollections doc2;

    public SubviewClassCollectionsTest(String viewConstructorName) {
        this.viewConstructorName = viewConstructorName;
    }

    @Override
    protected Class<?>[] getEntityClasses() {
        return new Class<?>[]{
            DocumentForCollections.class,
            PersonForCollections.class
        };
    }

    @Override
    public void setUpOnce() {
        cleanDatabase();
        transactional(new TxVoidWork() {
            @Override
            public void work(EntityManager em) {
                doc1 = new DocumentForCollections("doc1");
                doc2 = new DocumentForCollections("doc2");

                PersonForCollections o1 = new PersonForCollections("pers1");
                PersonForCollections o2 = new PersonForCollections("pers2");
                PersonForCollections o3 = new PersonForCollections("pers3");
                PersonForCollections o4 = new PersonForCollections("pers4");
                o1.setPartnerDocument(doc1);
                o2.setPartnerDocument(doc2);
                o3.setPartnerDocument(doc1);
                o4.setPartnerDocument(doc2);

                doc1.setOwner(o1);
                doc2.setOwner(o2);

                doc1.getContacts().put(1, o1);
                doc2.getContacts().put(1, o2);
                doc1.getContacts().put(2, o3);
                doc2.getContacts().put(2, o4);

                em.persist(o1);
                em.persist(o2);
                em.persist(o3);
                em.persist(o4);

                doc1.getPartners().add(o1);
                doc1.getPartners().add(o3);
                doc2.getPartners().add(o2);
                doc2.getPartners().add(o4);

                doc1.getPersonList().add(o1);
                doc1.getPersonList().add(o2);
                doc2.getPersonList().add(o3);
                doc2.getPersonList().add(o4);

                em.persist(doc1);
                em.persist(doc2);
            }
        });
    }

    @Before
    public void setUp() {
        doc1 = cbf.create(em, DocumentForCollections.class).where("name").eq("doc1").getSingleResult();
        doc2 = cbf.create(em, DocumentForCollections.class).where("name").eq("doc2").getSingleResult();
    }

    @Parameterized.Parameters(name = "{0}")
    public static Collection<?> entityViewCombinations() {
        return Arrays.asList(new Object[][]{
            { SubviewClassDocumentForCollectionsView.STRING_MAP_SET_LIST_CONSTRUCTOR },
            { SubviewClassDocumentForCollectionsView.STRING_MAP_LIST_SET_CONSTRUCTOR },
            { SubviewClassDocumentForCollectionsView.STRING_SET_MAP_LIST_CONSTRUCTOR },
            { SubviewClassDocumentForCollectionsView.STRING_SET_LIST_MAP_CONSTRUCTOR },
            { SubviewClassDocumentForCollectionsView.STRING_LIST_SET_MAP_CONSTRUCTOR },
            { SubviewClassDocumentForCollectionsView.STRING_LIST_MAP_SET_CONSTRUCTOR },

            { SubviewClassDocumentForCollectionsView.MAP_SET_STRING_LIST_CONSTRUCTOR },
            { SubviewClassDocumentForCollectionsView.MAP_SET_LIST_STRING_CONSTRUCTOR },
            { SubviewClassDocumentForCollectionsView.MAP_LIST_SET_STRING_CONSTRUCTOR },
            { SubviewClassDocumentForCollectionsView.MAP_LIST_STRING_SET_CONSTRUCTOR },
            { SubviewClassDocumentForCollectionsView.MAP_STRING_SET_LIST_CONSTRUCTOR },
            { SubviewClassDocumentForCollectionsView.MAP_STRING_LIST_SET_CONSTRUCTOR },

            { SubviewClassDocumentForCollectionsView.LIST_MAP_STRING_SET_CONSTRUCTOR },
            { SubviewClassDocumentForCollectionsView.LIST_MAP_SET_STRING_CONSTRUCTOR },
            { SubviewClassDocumentForCollectionsView.LIST_SET_MAP_STRING_CONSTRUCTOR },
            { SubviewClassDocumentForCollectionsView.LIST_SET_STRING_MAP_CONSTRUCTOR },
            { SubviewClassDocumentForCollectionsView.LIST_STRING_SET_MAP_CONSTRUCTOR },
            { SubviewClassDocumentForCollectionsView.LIST_STRING_MAP_SET_CONSTRUCTOR },

            { SubviewClassDocumentForCollectionsView.SET_MAP_LIST_STRING_CONSTRUCTOR },
            { SubviewClassDocumentForCollectionsView.SET_MAP_STRING_LIST_CONSTRUCTOR },
            { SubviewClassDocumentForCollectionsView.SET_LIST_MAP_STRING_CONSTRUCTOR },
            { SubviewClassDocumentForCollectionsView.SET_LIST_STRING_MAP_CONSTRUCTOR },
            { SubviewClassDocumentForCollectionsView.SET_STRING_LIST_MAP_CONSTRUCTOR },
            { SubviewClassDocumentForCollectionsView.SET_STRING_MAP_LIST_CONSTRUCTOR }
        });
    }

    @Test
    public void testCollections() {
        EntityViewManager evm = build(
                SubviewClassDocumentForCollectionsView.class,
                SubviewPersonForCollectionsView.class
        );

        CriteriaBuilder<DocumentForCollections> criteria = cbf.create(em, DocumentForCollections.class, "d")
            .orderByAsc("id");
        CriteriaBuilder<SubviewClassDocumentForCollectionsView> cb = evm.applySetting(EntityViewSetting.create(SubviewClassDocumentForCollectionsView.class, viewConstructorName), criteria);
        List<SubviewClassDocumentForCollectionsView> results = cb.getResultList();

        assertEquals(2, results.size());
        // Doc1
        assertEquals(doc1.getName(), results.get(0).getName());
        assertSubviewEquals(doc1.getContacts(), results.get(0).getContacts());
        assertSubviewEquals(doc1.getPartners(), results.get(0).getPartners());
        assertSubviewEquals(doc1.getPersonList(), results.get(0).getPersonList());

        // Doc2
        assertEquals(doc2.getName(), results.get(1).getName());
        assertSubviewEquals(doc2.getContacts(), results.get(1).getContacts());
        assertSubviewEquals(doc2.getPartners(), results.get(1).getPartners());
        assertSubviewEquals(doc2.getPersonList(), results.get(1).getPersonList());
    }
}


text:
package org.scalaml.plots

import java.util.List
import java.awt.{GradientPaint, Color, Stroke, Shape, Paint, BasicStroke}
import java.awt.geom.Ellipse2D

import org.jfree.data.xy.XYDataset
import org.jfree.data.xy.{XYSeriesCollection, XYSeries}
import org.jfree.data.statistics.DefaultMultiValueCategoryDataset
import org.jfree.chart.{ChartFactory, JFreeChart}
import org.jfree.chart.plot.{PlotOrientation, XYPlot, CategoryPlot}
import org.jfree.chart.renderer.xy.XYShapeRenderer
import org.jfree.chart.axis.{ValueAxis, NumberAxis}
import org.jfree.chart.ChartFrame
import org.jfree.chart.renderer.xy.{XYDotRenderer, XYLineAndShapeRenderer}
import org.jfree.chart.renderer.category.LineAndShapeRenderer
import org.jfree.util.ShapeUtilities

import org.scalaml.core.Types.ScalaMl
import org.scalaml.util.DisplayUtils
import Plot._

object ChartType extends Enumeration {
	type ChartType = Value
	val LINE, TIME_SERIES, SCATTER, BAR = Value
}

		/**
		 *
Generic plotting class that uses the JFreeChart library.

		 * @param config  Configuration for the plot of type PlotInfo
		 * @param theme Configuration for the display of plots of type PlotTheme
		 * @author Patrick Nicolas
		 * @since  November 18, 2013
		 * @note Scala for Machine Learning
		 */
abstract class Plot(config: PlotInfo, theme: PlotTheme) {
	import ScalaMl._

		/**
		 * DisplayUtils array of tuple (x,y) in a 2D plot for a given width and height
		 * @param xy Array of pair (x,y)
		 * @param width Width for the display (pixels)
		 * @param height Height of the chart (pixels)
		 */
	def display(xy: XYTSeries, width: Int, height: Int): Unit

	def display(xy: XYTSeries): Unit = display(xy, DEFAULT_WIDTH, DEFAULT_HEIGHT)

		/**
		 * DisplayUtils a vector of Double value in a 2D plot with counts [0, n] on X-Axis and
		 * vector value on Y-Axis with a given width and height
		 * @param xy Array of pair (x,y)
		 * @param width Width for the display (pixels)
		 * @param height Height of the chart (pixels)
		 */
	def display(y: DblVector, width: Int, height: Int): Unit

	def display(y: DblVector): Unit = display(y, DEFAULT_WIDTH, DEFAULT_HEIGHT)

	protected[this] def createFrame(id: String, chart: JFreeChart): Unit = {
		val frame = new ChartFrame(s"Chart ${count+1}: $id", chart)
		val anchor = getLocation
		frame.setLocation(anchor._1, anchor._2)
		frame.pack
		frame.setVisible(true)
	}
}

		/**
		 * Companion object for the Plot class
		 * @author Patrick Nicolas
		 * @since  November 18, 2013
		 * @note Scala for Machine Learning
		 */
object Plot {
	type PlotInfo = (String, String, String)
	final val DISPLAY_OFFSET = 25

	var count = 0
	final def getLocation: (Int, Int) = {
		count += 1
		val offset = count * DISPLAY_OFFSET
		(offset, offset % 420)
	}

	private val DEFAULT_WIDTH = 320
	private val DEFAULT_HEIGHT = 240

	private val MIN_DISPLAY_SIZE = 60
	private val MAX_DISPLAY_SIZE = 1280

		/**
		 * Validate the display dimension for a particular plot
		 * @param y Array of values to be plotted
		 * @param height  Height of the display
		 * @param width Width of the display
		 * @param comment Comments to be added to the chart or plot
		 * @throws IllegalArgumentException if the display height or width is out or range or
		 * the values are undefined
		 */
	def validateDisplayUtils[T](y: Array[T], width: Int, height: Int, comment: String): Boolean = {
		if( DisplayUtils.isChart ) {
			require( !y.isEmpty, s"$comment Cannot display an undefined series")
			validateDisplaySize(width, height, comment)
	  }
		DisplayUtils.isChart
	}

		/**
		 * Validate the display dimension for a particular plot
		 * @param y List of values to be plotted
		 * @param height  Height of the display
		 * @param width Width of the display
		 * @param comment Comments to be added to the chart or plot
		 * @throws IllegalArgumentException if the display height or width is out or range or
		 * the values are undefined
		 */
	import scala.collection.immutable.List
	def validateDisplayUtils[T](y: List[T], width: Int, height: Int, comment: String =""): Boolean = {
		if( DisplayUtils.isChart ) {
			require( !y.isEmpty, s"$comment Cannot display an undefined series")
			validateDisplaySize(width, height, comment)
		}
		DisplayUtils.isChart
	}

		/**
		 * Validate the display dimension for a particular plot
		 * @param height  Height of the display
		 * @param width Width of the display
		 * @param comment Comments to be added to the chart or plot
		 * @throws IllegalArgumentException if the display height or width is out or range
		 */
	def validateDisplaySize(width: Int, height: Int, comment: String = ""): Boolean = {
		if( DisplayUtils.isChart ) {
			require( width > MIN_DISPLAY_SIZE && width < MAX_DISPLAY_SIZE,
					s"$comment Width $width is out of range")
			require( height > MIN_DISPLAY_SIZE && height < MAX_DISPLAY_SIZE,
					s"$comment  height $height is out of range")
		}
		DisplayUtils.isChart
	}
}

// ------------------------  EOF ----------------------------------------------


text:
package org.apache.camel.component.file.remote;

import java.net.URI;

import org.apache.camel.component.file.GenericFileConfiguration;
import org.apache.camel.spi.Metadata;
import org.apache.camel.spi.UriParam;
import org.apache.camel.spi.UriPath;
import org.apache.camel.util.ObjectHelper;
import org.apache.camel.util.StringHelper;

/**
 * Configuration of the FTP server
 */
public abstract class RemoteFileConfiguration extends GenericFileConfiguration {

    /**
     * Path separator as either unix or windows style.
     *

     * UNIX = Path separator / is used
     * Windows = Path separator \ is used
     * Auto = Use existing path separator in file name
     */
    public enum PathSeparator { UNIX, Windows, Auto }

    // component name is implied as the protocol, eg ftp/ftps etc
    private String protocol;
    @UriPath @Metadata(required = true)
    private String host;
    @UriPath
    private int port;
    @UriPath(name = "directoryName")
    private String directoryName;
    @UriParam(label = "security", secret = true)
    private String username;
    @UriParam(label = "security", secret = true)
    private String password;
    @UriParam
    private boolean binary;
    @UriParam
    private boolean passiveMode;
    @UriParam(defaultValue = "10000", label = "advanced")
    private int connectTimeout = 10000;
    @UriParam(defaultValue = "30000", label = "advanced")
    private int timeout = 30000;
    @UriParam(defaultValue = "300000", label = "advanced")
    private int soTimeout = 300000;
    @UriParam(defaultValue = "32768", label = "consumer,advanced")
    private int receiveBufferSize = 32 * 1024;
    @UriParam(label = "advanced")
    private boolean throwExceptionOnConnectFailed;
    @UriParam(label = "advanced")
    private String siteCommand;
    @UriParam(defaultValue = "true", label = "advanced")
    private boolean stepwise = true;
    @UriParam(defaultValue = "UNIX")
    private PathSeparator separator = PathSeparator.UNIX;
    @UriParam(label = "consumer")
    private boolean streamDownload;
    @UriParam(defaultValue = "true", label = "consumer,advanced")
    private boolean useList = true;
    @UriParam(label = "consumer,advanced")
    private boolean ignoreFileNotFoundOrPermissionError;
    @UriParam(label = "producer,advanced", defaultValue = "true")
    private boolean sendNoop = true;

    public RemoteFileConfiguration() {
    }

    public RemoteFileConfiguration(URI uri) {
        configure(uri);
    }

    @Override
    public boolean needToNormalize() {
        return false;
    }

    @Override
    public void configure(URI uri) {
        super.configure(uri);
        // after configure the directory has been resolved, so we can use it for directoryName
        // (directoryName is the name we use in the other file components, to use consistent name)
        setDirectoryName(getDirectory());
        setProtocol(uri.getScheme());
        setDefaultPort();

        // UserInfo can contain both username and password as: user:pwd@ftpserver
        // see: http://en.wikipedia.org/wiki/URI_scheme
        String username = uri.getUserInfo();
        String pw = null;
        if (username != null && username.contains(":")) {
            pw = StringHelper.after(username, ":");
            username = StringHelper.before(username, ":");
        }
        if (username != null) {
            setUsername(username);
        }
        if (pw != null) {
            setPassword(pw);
        }

        setHost(uri.getHost());
        setPort(uri.getPort());
    }

    /**
     * Returns human readable server information for logging purpose
     */
    public String remoteServerInformation() {
        return protocol + "://" + (username != null ? username : "anonymous") + "@" + host + ":" + getPort();
    }

    protected abstract void setDefaultPort();

    public String getHost() {
        return host;
    }

    /**
     * Hostname of the FTP server
     */
    public void setHost(String host) {
        this.host = host;
    }

    public int getPort() {
        return port;
    }

    /**
     * Port of the FTP server
     */
    public void setPort(int port) {
        // only set port if provided with a positive number
        if (port > 0) {
            this.port = port;
        }
    }

    public String getPassword() {
        return password;
    }

    /**
     * Password to use for login
     */
    public void setPassword(String password) {
        this.password = password;
    }

    public String getProtocol() {
        return protocol;
    }

    /**
     * The ftp protocol to use
     */
    public void setProtocol(String protocol) {
        this.protocol = protocol;
    }

    public String getUsername() {
        return username;
    }

    /**
     * Username to use for login
     */
    public void setUsername(String username) {
        this.username = username;
    }

    public String getDirectoryName() {
        return directoryName;
    }

    /**
     * The starting directory
     */
    public void setDirectoryName(String directoryName) {
        this.directoryName = directoryName;
    }

    public boolean isBinary() {
        return binary;
    }

    /**
     * Specifies the file transfer mode, BINARY or ASCII. Default is ASCII (false).
     */
    public void setBinary(boolean binary) {
        this.binary = binary;
    }

    public boolean isPassiveMode() {
        return passiveMode;
    }

    /**
     * Sets passive mode connections.
     *

     * Default is active mode connections.
     */
    public void setPassiveMode(boolean passiveMode) {
        this.passiveMode = passiveMode;
    }

    public int getConnectTimeout() {
        return connectTimeout;
    }

    /**
     * Sets the connect timeout for waiting for a connection to be established
     *

     * Used by both FTPClient and JSCH
     */
    public void setConnectTimeout(int connectTimeout) {
        this.connectTimeout = connectTimeout;
    }

    public int getTimeout() {
        return timeout;
    }

    /**
     * Sets the data timeout for waiting for reply
     *

     * Used only by FTPClient
     */
    public void setTimeout(int timeout) {
        this.timeout = timeout;
    }

    public int getSoTimeout() {
        return soTimeout;
    }

    /**
     * Sets the so timeout
     *

     * FTP and FTPS Only for Camel 2.4. SFTP for Camel 2.14.3/2.15.3/2.16 onwards.
     * Is the SocketOptions.SO_TIMEOUT value in millis.
     * Recommended option is to set this to 300000 so as not have a hanged connection.
     * On SFTP this option is set as timeout on the JSCH Session instance.
     */
    public void setSoTimeout(int soTimeout) {
        this.soTimeout = soTimeout;
    }

    public int getReceiveBufferSize() {
        return receiveBufferSize;
    }

    /**
     * The receive (download) buffer size
     *

     * Used only by FTPClient
     */
    public void setReceiveBufferSize(int receiveBufferSize) {
        this.receiveBufferSize = receiveBufferSize;
    }

    public boolean isThrowExceptionOnConnectFailed() {
        return throwExceptionOnConnectFailed;
    }

    /**
     * Should an exception be thrown if connection failed (exhausted)
     *

     * By default exception is not thrown and a <tt>WARN</tt> is logged.
     * You can use this to enable exception being thrown and handle the thrown exception
     * from the {@link org.apache.camel.spi.PollingConsumerPollStrategy} rollback method.
     */
    public void setThrowExceptionOnConnectFailed(boolean throwExceptionOnConnectFailed) {
        this.throwExceptionOnConnectFailed = throwExceptionOnConnectFailed;
    }

    public String getSiteCommand() {
        return siteCommand;
    }

    /**
     * Sets optional site command(s) to be executed after successful login.
     *

     * Multiple site commands can be separated using a new line character.
     */
    public void setSiteCommand(String siteCommand) {
        this.siteCommand = siteCommand;
    }

    public boolean isStepwise() {
        return stepwise;
    }

    /**
     * Sets whether we should stepwise change directories while traversing file structures
     * when downloading files, or as well when uploading a file to a directory.
     *

     * You can disable this if you for example are in a situation where you cannot change directory
     * on the FTP server due security reasons.
     *
     * @param stepwise whether to use change directory or not
     */
    public void setStepwise(boolean stepwise) {
        this.stepwise = stepwise;
    }

    public PathSeparator getSeparator() {
        return separator;
    }

    /**
     * Sets the path separator to be used.
     *

     * UNIX = Uses unix style path separator
     * Windows = Uses windows style path separator
     * Auto = (is default) Use existing path separator in file name
     */
    public void setSeparator(PathSeparator separator) {
        this.separator = separator;
    }

    public boolean isStreamDownload() {
        return streamDownload;
    }

    /**
     * Sets the download method to use when not using a local working directory.  If set to true,
     * the remote files are streamed to the route as they are read.  When set to false, the remote files
     * are loaded into memory before being sent into the route.
     */
    public void setStreamDownload(boolean streamDownload) {
        this.streamDownload = streamDownload;
    }

    public boolean isUseList() {
        return useList;
    }

    /**
     * Whether to allow using LIST command when downloading a file.
     *

     * Default is <tt>true</tt>. In some use cases you may want to download
     * a specific file and are not allowed to use the LIST command, and therefore
     * you can set this option to <tt>false</tt>.
     * Notice when using this option, then the specific file to download does not
     * include meta-data information such as file size, timestamp, permissions etc, because
     * those information is only possible to retrieve when LIST command is in use.
     */
    public void setUseList(boolean useList) {
        this.useList = useList;
    }

    public boolean isIgnoreFileNotFoundOrPermissionError() {
        return ignoreFileNotFoundOrPermissionError;
    }

    /**
     * Whether to ignore when (trying to list files in directories or when downloading a file), which does not exist or due to permission error.
     *

     * By default when a directory or file does not exists or insufficient permission, then an exception is thrown.
     * Setting this option to <tt>true</tt> allows to ignore that instead.
     */
    public void setIgnoreFileNotFoundOrPermissionError(boolean ignoreFileNotFoundOrPermissionError) {
        this.ignoreFileNotFoundOrPermissionError = ignoreFileNotFoundOrPermissionError;
    }

    public boolean isSendNoop() {
        return sendNoop;
    }

    /**
     * Whether to send a noop command as a pre-write check before uploading files to the FTP server.
     *

     * This is enabled by default as a validation of the connection is still valid, which allows to silently
     * re-connect to be able to upload the file. However if this causes problems, you can turn this option off.
     */
    public void setSendNoop(boolean sendNoop) {
        this.sendNoop = sendNoop;
    }

    /**
     * Normalizes the given path according to the configured path separator.
     *
     * @param path  the given path
     * @return the normalized path
     */
    public String normalizePath(String path) {
        if (ObjectHelper.isEmpty(path) || separator == PathSeparator.Auto) {
            return path;
        }

        if (separator == PathSeparator.UNIX) {
            // unix style
            return path.replace('\\', '/');
        } else {
            // windows style
            return path.replace('/', '\\');
        }
    }
}


text:
/**
 *
 */
package com.kant.datastructure.queues;

import com.kant.datastructure.list.ListNode;

/**
 *
 * TESTED
 *
 * @author shaskant
 *
 */
public class QueueListImplementation<T> extends AbstractQueue<T> {
	private ListNode<T> front, rear;

	/**
	 * capacity will be ignored
	 *
	 * @param capacity
	 */
	public QueueListImplementation() {
		front = null;
		rear = null;
	}

	@Override
	public void enQueue(T data) throws OverFlowException {
		ListNode<T> temp = new ListNode<>(data);
		size++;
		if (rear == null) {
			rear = front = temp;
			return;
		}
		rear.setNext(temp);
		rear = temp;

	}

	@Override
	public T deQueue() throws UnderFlowException {
		if (isEmpty()) {
			throw new UnderFlowException("no items on queue");
		}
		T data = front.getData();
		front = front.getNext();
		size--;
		if (size == 0)
			rear = null;
		return data;
	}

	@Override
	public T getFront() throws UnderFlowException {
		if (isEmpty()) {
			throw new UnderFlowException("no items on queue");
		}
		return front.getData();
	}

	@Override
	public T getRear() throws UnderFlowException {
		if (isEmpty()) {
			throw new UnderFlowException("no items on queue");
		}
		return rear.getData();
	}

	@Override
	protected boolean isEmpty() {
		return (front == null && rear == null) ? true : false;
	}

	@Override
	protected boolean isFull() {
		return false;
	}

	public static void main(String[] args) throws OverFlowException {
		QueueListImplementation<String> queue = new QueueListImplementation<String>();
		queue.enQueue("this");
		queue.enQueue("is");
		queue.enQueue("shashi");
		try {
			System.out.println(queue.deQueue());
			System.out.println(queue.deQueue());
			System.out.println(queue.deQueue());
			System.out.println(queue.deQueue());
		} catch (UnderFlowException e) {
			System.out.println(e.getMessage());
		}

	}
}


text:
<?xml version="1.0" encoding="utf-8"?>
<io.sweers.barber.sample.testing.RequiredTestView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    />


text:
package base

import (
	"encoding/json"
	"flag"
	"fmt"
	"internal/buildcfg"
	"io/ioutil"
	"log"
	"os"
	"reflect"
	"runtime"
	"strings"

	"cmd/internal/objabi"
	"cmd/internal/sys"
)

func usage() {
	fmt.Fprintf(os.Stderr, "usage: compile [options] file.go...\n")
	objabi.Flagprint(os.Stderr)
	Exit(2)
}

// Flag holds the parsed command-line flags.
// See ParseFlag for non-zero defaults.
var Flag CmdFlags

// A CountFlag is a counting integer flag.
// It accepts -name=value to set the value directly,
// but it also accepts -name with no =value to increment the count.
type CountFlag int

// CmdFlags defines the command-line flags (see var Flag).
// Each struct field is a different flag, by default named for the lower-case of the field name.
// If the flag name is a single letter, the default flag name is left upper-case.
// If the flag name is "Lower" followed by a single letter, the default flag name is the lower-case of the last letter.
//
// If this default flag name can't be made right, the `flag` struct tag can be used to replace it,
// but this should be done only in exceptional circumstances: it helps everyone if the flag name
// is obvious from the field name when the flag is used elsewhere in the compiler sources.
// The `flag:"-"` struct tag makes a field invisible to the flag logic and should also be used sparingly.
//
// Each field must have a `help` struct tag giving the flag help message.
//
// The allowed field types are bool, int, string, pointers to those (for values stored elsewhere),
// CountFlag (for a counting flag), and func(string) (for a flag that uses special code for parsing).
type CmdFlags struct {
	// Single letters
	B CountFlag    "help:\"disable bounds checking\""
	C CountFlag    "help:\"disable printing of columns in error messages\""
	D string       "help:\"set relative `path` for local imports\""
	E CountFlag    "help:\"debug symbol export\""
	G CountFlag    "help:\"accept generic code\""
	I func(string) "help:\"add `directory` to import search path\""
	K CountFlag    "help:\"debug missing line numbers\""
	L CountFlag    "help:\"show full file names in error messages\""
	N CountFlag    "help:\"disable optimizations\""
	S CountFlag    "help:\"print assembly listing\""
	// V is added by objabi.AddVersionFlag
	W CountFlag "help:\"debug parse tree after type checking\""

	LowerC int        "help:\"concurrency during compilation (1 means no concurrency)\""
	LowerD flag.Value "help:\"enable debugging settings; try -d help\""
	LowerE CountFlag  "help:\"no limit on number of errors reported\""
	LowerH CountFlag  "help:\"halt on error\""
	LowerJ CountFlag  "help:\"debug runtime-initialized variables\""
	LowerL CountFlag  "help:\"disable inlining\""
	LowerM CountFlag  "help:\"print optimization decisions\""
	LowerO string     "help:\"write output to `file`\""
	LowerP *string    "help:\"set expected package import `path`\"" // &Ctxt.Pkgpath, set below
	LowerR CountFlag  "help:\"debug generated wrappers\""
	LowerT bool       "help:\"enable tracing for debugging the compiler\""
	LowerW CountFlag  "help:\"debug type checking\""
	LowerV *bool      "help:\"increase debug verbosity\""

	// Special characters
	Percent          int  "flag:\"%\" help:\"debug non-static initializers\""
	CompilingRuntime bool "flag:\"+\" help:\"compiling runtime\""

	// Longer names
	AsmHdr             string       "help:\"write assembly header to `file`\""
	ASan               bool         "help:\"build code compatible with C/C++ address sanitizer\""
	Bench              string       "help:\"append benchmark times to `file`\""
	BlockProfile       string       "help:\"write block profile to `file`\""
	BuildID            string       "help:\"record `id` as the build id in the export metadata\""
	CPUProfile         string       "help:\"write cpu profile to `file`\""
	Complete           bool         "help:\"compiling complete package (no C or assembly)\""
	ClobberDead        bool         "help:\"clobber dead stack slots (for debugging)\""
	ClobberDeadReg     bool         "help:\"clobber dead registers (for debugging)\""
	Dwarf              bool         "help:\"generate DWARF symbols\""
	DwarfBASEntries    *bool        "help:\"use base address selection entries in DWARF\""                        // &Ctxt.UseBASEntries, set below
	DwarfLocationLists *bool        "help:\"add location lists to DWARF in optimized mode\""                      // &Ctxt.Flag_locationlists, set below
	Dynlink            *bool        "help:\"support references to Go symbols defined in other shared libraries\"" // &Ctxt.Flag_dynlink, set below
	EmbedCfg           func(string) "help:\"read go:embed configuration from `file`\""
	GenDwarfInl        int          "help:\"generate DWARF inline info records\"" // 0=disabled, 1=funcs, 2=funcs+formals/locals
	GoVersion          string       "help:\"required version of the runtime\""
	ImportCfg          func(string) "help:\"read import configuration from `file`\""
	ImportMap          func(string) "help:\"add `definition` of the form source=actual to import map\""
	InstallSuffix      string       "help:\"set pkg directory `suffix`\""
	JSON               string       "help:\"version,file for JSON compiler/optimizer detail output\""
	Lang               string       "help:\"Go language version source code expects\""
	LinkObj            string       "help:\"write linker-specific object to `file`\""
	LinkShared         *bool        "help:\"generate code that will be linked against Go shared libraries\"" // &Ctxt.Flag_linkshared, set below
	Live               CountFlag    "help:\"debug liveness analysis\""
	MSan               bool         "help:\"build code compatible with C/C++ memory sanitizer\""
	MemProfile         string       "help:\"write memory profile to `file`\""
	MemProfileRate     int          "help:\"set runtime.MemProfileRate to `rate`\""
	MutexProfile       string       "help:\"write mutex profile to `file`\""
	NoLocalImports     bool         "help:\"reject local (relative) imports\""
	Pack               bool         "help:\"write to file.a instead of file.o\""
	Race               bool         "help:\"enable race detector\""
	Shared             *bool        "help:\"generate code that can be linked into a shared library\"" // &Ctxt.Flag_shared, set below
	SmallFrames        bool         "help:\"reduce the size limit for stack allocated objects\""      // small stacks, to diagnose GC latency; see golang.org/issue/27732
	Spectre            string       "help:\"enable spectre mitigations in `list` (all, index, ret)\""
	Std                bool         "help:\"compiling standard library\""
	SymABIs            string       "help:\"read symbol ABIs from `file`\""
	TraceProfile       string       "help:\"write an execution trace to `file`\""
	TrimPath           string       "help:\"remove `prefix` from recorded source file paths\""
	WB                 bool         "help:\"enable write barrier\"" // TODO: remove

	// Configuration derived from flags; not a flag itself.
	Cfg struct {
		Embed struct { // set by -embedcfg
			Patterns map[string][]string
			Files    map[string]string
		}
		ImportDirs   []string          // appended to by -I
		ImportMap    map[string]string // set by -importmap OR -importcfg
		PackageFile  map[string]string // set by -importcfg; nil means not in use
		SpectreIndex bool              // set by -spectre=index or -spectre=all
		// Whether we are adding any sort of code instrumentation, such as
		// when the race detector is enabled.
		Instrumenting bool
	}
}

// ParseFlags parses the command-line flags into Flag.
func ParseFlags() {
	Flag.G = 3
	Flag.I = addImportDir

	Flag.LowerC = 1
	Flag.LowerD = objabi.NewDebugFlag(&Debug, DebugSSA)
	Flag.LowerP = &Ctxt.Pkgpath
	Flag.LowerV = &Ctxt.Debugvlog

	Flag.Dwarf = buildcfg.GOARCH != "wasm"
	Flag.DwarfBASEntries = &Ctxt.UseBASEntries
	Flag.DwarfLocationLists = &Ctxt.Flag_locationlists
	*Flag.DwarfLocationLists = true
	Flag.Dynlink = &Ctxt.Flag_dynlink
	Flag.EmbedCfg = readEmbedCfg
	Flag.GenDwarfInl = 2
	Flag.ImportCfg = readImportCfg
	Flag.ImportMap = addImportMap
	Flag.LinkShared = &Ctxt.Flag_linkshared
	Flag.Shared = &Ctxt.Flag_shared
	Flag.WB = true

	Debug.InlFuncsWithClosures = 1
	if buildcfg.Experiment.Unified {
		Debug.Unified = 1
	}

	Debug.Checkptr = -1 // so we can tell whether it is set explicitly

	Flag.Cfg.ImportMap = make(map[string]string)

	objabi.AddVersionFlag() // -V
	registerFlags()
	objabi.Flagparse(usage)

	if Flag.MSan && !sys.MSanSupported(buildcfg.GOOS, buildcfg.GOARCH) {
		log.Fatalf("%s/%s does not support -msan", buildcfg.GOOS, buildcfg.GOARCH)
	}
	if Flag.ASan && !sys.ASanSupported(buildcfg.GOOS, buildcfg.GOARCH) {
		log.Fatalf("%s/%s does not support -asan", buildcfg.GOOS, buildcfg.GOARCH)
	}
	if Flag.Race && !sys.RaceDetectorSupported(buildcfg.GOOS, buildcfg.GOARCH) {
		log.Fatalf("%s/%s does not support -race", buildcfg.GOOS, buildcfg.GOARCH)
	}
	if (*Flag.Shared || *Flag.Dynlink || *Flag.LinkShared) && !Ctxt.Arch.InFamily(sys.AMD64, sys.ARM, sys.ARM64, sys.I386, sys.PPC64, sys.RISCV64, sys.S390X) {
		log.Fatalf("%s/%s does not support -shared", buildcfg.GOOS, buildcfg.GOARCH)
	}
	parseSpectre(Flag.Spectre) // left as string for RecordFlags

	Ctxt.Flag_shared = Ctxt.Flag_dynlink || Ctxt.Flag_shared
	Ctxt.Flag_optimize = Flag.N == 0
	Ctxt.Debugasm = int(Flag.S)
	Ctxt.Flag_maymorestack = Debug.MayMoreStack

	if flag.NArg() < 1 {
		usage()
	}

	if Flag.GoVersion != "" && Flag.GoVersion != runtime.Version() {
		fmt.Printf("compile: version %q does not match go tool version %q\n", runtime.Version(), Flag.GoVersion)
		Exit(2)
	}

	if Flag.LowerO == "" {
		p := flag.Arg(0)
		if i := strings.LastIndex(p, "/"); i >= 0 {
			p = p[i+1:]
		}
		if runtime.GOOS == "windows" {
			if i := strings.LastIndex(p, `\`); i >= 0 {
				p = p[i+1:]
			}
		}
		if i := strings.LastIndex(p, "."); i >= 0 {
			p = p[:i]
		}
		suffix := ".o"
		if Flag.Pack {
			suffix = ".a"
		}
		Flag.LowerO = p + suffix
	}
	switch {
	case Flag.Race && Flag.MSan:
		log.Fatal("cannot use both -race and -msan")
	case Flag.Race && Flag.ASan:
		log.Fatal("cannot use both -race and -asan")
	case Flag.MSan && Flag.ASan:
		log.Fatal("cannot use both -msan and -asan")
	}
	if Flag.Race || Flag.MSan || Flag.ASan {
		// -race, -msan and -asan imply -d=checkptr for now.
		if Debug.Checkptr == -1 { // if not set explicitly
			Debug.Checkptr = 1
		}
	}

	if Flag.CompilingRuntime && Flag.N != 0 {
		log.Fatal("cannot disable optimizations while compiling runtime")
	}
	if Flag.LowerC < 1 {
		log.Fatalf("-c must be at least 1, got %d", Flag.LowerC)
	}
	if Flag.LowerC > 1 && !concurrentBackendAllowed() {
		log.Fatalf("cannot use concurrent backend compilation with provided flags; invoked as %v", os.Args)
	}

	if Flag.CompilingRuntime {
		// Runtime can't use -d=checkptr, at least not yet.
		Debug.Checkptr = 0

		// Fuzzing the runtime isn't interesting either.
		Debug.Libfuzzer = 0
	}

	if Debug.Checkptr == -1 { // if not set explicitly
		Debug.Checkptr = 0
	}

	// set via a -d flag
	Ctxt.Debugpcln = Debug.PCTab
}

// registerFlags adds flag registrations for all the fields in Flag.
// See the comment on type CmdFlags for the rules.
func registerFlags() {
	var (
		boolType      = reflect.TypeOf(bool(false))
		intType       = reflect.TypeOf(int(0))
		stringType    = reflect.TypeOf(string(""))
		ptrBoolType   = reflect.TypeOf(new(bool))
		ptrIntType    = reflect.TypeOf(new(int))
		ptrStringType = reflect.TypeOf(new(string))
		countType     = reflect.TypeOf(CountFlag(0))
		funcType      = reflect.TypeOf((func(string))(nil))
	)

	v := reflect.ValueOf(&Flag).Elem()
	t := v.Type()
	for i := 0; i < t.NumField(); i++ {
		f := t.Field(i)
		if f.Name == "Cfg" {
			continue
		}

		var name string
		if len(f.Name) == 1 {
			name = f.Name
		} else if len(f.Name) == 6 && f.Name[:5] == "Lower" && 'A' <= f.Name[5] && f.Name[5] <= 'Z' {
			name = string(rune(f.Name[5] + 'a' - 'A'))
		} else {
			name = strings.ToLower(f.Name)
		}
		if tag := f.Tag.Get("flag"); tag != "" {
			name = tag
		}

		help := f.Tag.Get("help")
		if help == "" {
			panic(fmt.Sprintf("base.Flag.%s is missing help text", f.Name))
		}

		if k := f.Type.Kind(); (k == reflect.Ptr || k == reflect.Func) && v.Field(i).IsNil() {
			panic(fmt.Sprintf("base.Flag.%s is uninitialized %v", f.Name, f.Type))
		}

		switch f.Type {
		case boolType:
			p := v.Field(i).Addr().Interface().(*bool)
			flag.BoolVar(p, name, *p, help)
		case intType:
			p := v.Field(i).Addr().Interface().(*int)
			flag.IntVar(p, name, *p, help)
		case stringType:
			p := v.Field(i).Addr().Interface().(*string)
			flag.StringVar(p, name, *p, help)
		case ptrBoolType:
			p := v.Field(i).Interface().(*bool)
			flag.BoolVar(p, name, *p, help)
		case ptrIntType:
			p := v.Field(i).Interface().(*int)
			flag.IntVar(p, name, *p, help)
		case ptrStringType:
			p := v.Field(i).Interface().(*string)
			flag.StringVar(p, name, *p, help)
		case countType:
			p := (*int)(v.Field(i).Addr().Interface().(*CountFlag))
			objabi.Flagcount(name, help, p)
		case funcType:
			f := v.Field(i).Interface().(func(string))
			objabi.Flagfn1(name, help, f)
		default:
			if val, ok := v.Field(i).Interface().(flag.Value); ok {
				flag.Var(val, name, help)
			} else {
				panic(fmt.Sprintf("base.Flag.%s has unexpected type %s", f.Name, f.Type))
			}
		}
	}
}

// concurrentFlagOk reports whether the current compiler flags
// are compatible with concurrent compilation.
func concurrentFlagOk() bool {
	// TODO(rsc): Many of these are fine. Remove them.
	return Flag.Percent == 0 &&
		Flag.E == 0 &&
		Flag.K == 0 &&
		Flag.L == 0 &&
		Flag.LowerH == 0 &&
		Flag.LowerJ == 0 &&
		Flag.LowerM == 0 &&
		Flag.LowerR == 0
}

func concurrentBackendAllowed() bool {
	if !concurrentFlagOk() {
		return false
	}

	// Debug.S by itself is ok, because all printing occurs
	// while writing the object file, and that is non-concurrent.
	// Adding Debug_vlog, however, causes Debug.S to also print
	// while flushing the plist, which happens concurrently.
	if Ctxt.Debugvlog || Debug.Any || Flag.Live > 0 {
		return false
	}
	// TODO: Test and delete this condition.
	if buildcfg.Experiment.FieldTrack {
		return false
	}
	// TODO: fix races and enable the following flags
	if Ctxt.Flag_dynlink || Flag.Race {
		return false
	}
	return true
}

func addImportDir(dir string) {
	if dir != "" {
		Flag.Cfg.ImportDirs = append(Flag.Cfg.ImportDirs, dir)
	}
}

func addImportMap(s string) {
	if Flag.Cfg.ImportMap == nil {
		Flag.Cfg.ImportMap = make(map[string]string)
	}
	if strings.Count(s, "=") != 1 {
		log.Fatal("-importmap argument must be of the form source=actual")
	}
	i := strings.Index(s, "=")
	source, actual := s[:i], s[i+1:]
	if source == "" || actual == "" {
		log.Fatal("-importmap argument must be of the form source=actual; source and actual must be non-empty")
	}
	Flag.Cfg.ImportMap[source] = actual
}

func readImportCfg(file string) {
	if Flag.Cfg.ImportMap == nil {
		Flag.Cfg.ImportMap = make(map[string]string)
	}
	Flag.Cfg.PackageFile = map[string]string{}
	data, err := ioutil.ReadFile(file)
	if err != nil {
		log.Fatalf("-importcfg: %v", err)
	}

	for lineNum, line := range strings.Split(string(data), "\n") {
		lineNum++ // 1-based
		line = strings.TrimSpace(line)
		if line == "" || strings.HasPrefix(line, "#") {
			continue
		}

		var verb, args string
		if i := strings.Index(line, " "); i < 0 {
			verb = line
		} else {
			verb, args = line[:i], strings.TrimSpace(line[i+1:])
		}
		var before, after string
		if i := strings.Index(args, "="); i >= 0 {
			before, after = args[:i], args[i+1:]
		}
		switch verb {
		default:
			log.Fatalf("%s:%d: unknown directive %q", file, lineNum, verb)
		case "importmap":
			if before == "" || after == "" {
				log.Fatalf(`%s:%d: invalid importmap: syntax is "importmap old=new"`, file, lineNum)
			}
			Flag.Cfg.ImportMap[before] = after
		case "packagefile":
			if before == "" || after == "" {
				log.Fatalf(`%s:%d: invalid packagefile: syntax is "packagefile path=filename"`, file, lineNum)
			}
			Flag.Cfg.PackageFile[before] = after
		}
	}
}

func readEmbedCfg(file string) {
	data, err := ioutil.ReadFile(file)
	if err != nil {
		log.Fatalf("-embedcfg: %v", err)
	}
	if err := json.Unmarshal(data, &Flag.Cfg.Embed); err != nil {
		log.Fatalf("%s: %v", file, err)
	}
	if Flag.Cfg.Embed.Patterns == nil {
		log.Fatalf("%s: invalid embedcfg: missing Patterns", file)
	}
	if Flag.Cfg.Embed.Files == nil {
		log.Fatalf("%s: invalid embedcfg: missing Files", file)
	}
}

// parseSpectre parses the spectre configuration from the string s.
func parseSpectre(s string) {
	for _, f := range strings.Split(s, ",") {
		f = strings.TrimSpace(f)
		switch f {
		default:
			log.Fatalf("unknown setting -spectre=%s", f)
		case "":
			// nothing
		case "all":
			Flag.Cfg.SpectreIndex = true
			Ctxt.Retpoline = true
		case "index":
			Flag.Cfg.SpectreIndex = true
		case "ret":
			Ctxt.Retpoline = true
		}
	}

	if Flag.Cfg.SpectreIndex {
		switch buildcfg.GOARCH {
		case "amd64":
			// ok
		default:
			log.Fatalf("GOARCH=%s does not support -spectre=index", buildcfg.GOARCH)
		}
	}
}


text:
"""The export window to save as image"""

from PyQt4 import QtCore, QtGui
from Core.globals import options, mainWidgets

class ExportWindow(QtGui.QDialog):
    def __init__(self, parent = None):
        """
        Create an export window to save the current canvas as an image.
        """
        QtGui.QDialog.__init__(self, parent)

        self.gridCheckBox = QtGui.QCheckBox(self.tr("Save with grid"))
        self.namesCheckBox = QtGui.QCheckBox(self.tr("Save with names"))
        self.gridCheckBox.setChecked(True)
        self.namesCheckBox.setChecked(True)

        chooseButton = QtGui.QPushButton("Select File")

        layout = QtGui.QVBoxLayout()
        layout.addWidget(self.gridCheckBox)
        layout.addWidget(self.namesCheckBox)
        layout.addWidget(chooseButton)

        self.setLayout(layout)
        self.setWindowModality(QtCore.Qt.ApplicationModal)
        self.resize(200, 150)
        self.setWindowTitle("Export Image")

        self.connect(chooseButton, QtCore.SIGNAL("clicked()"), self.chooseFile)

    def chooseFile(self):
        """
        Pop up a file dialog box to determine a save filename, then save it.
        """
        self.hide()
        filename = QtGui.QFileDialog.getSaveFileName(self,
                    self.tr("Choose a file name"), ".",
                    self.tr("PNG (*.png)"))
        if filename.isEmpty():
            return

        if not filename.toLower().endsWith(".png"):
            filename += ".png"

        canvas = mainWidgets["canvas"]
        sceneRect = canvas.sceneRect()
        viewRect = canvas.mapFromScene(sceneRect).boundingRect()

        image = QtGui.QImage(viewRect.width(), viewRect.height(), QtGui.QImage.Format_ARGB32)
        painter = QtGui.QPainter(image)

        oldGridOption = options["grid"]
        oldNamesOption = options["names"]
        options["grid"] = self.gridCheckBox.isChecked()
        options["names"] = self.namesCheckBox.isChecked()
        canvas.render(painter, QtCore.QRectF(), viewRect)
        options["grid"] = oldGridOption
        options["names"] = oldNamesOption

        painter.end()

        image.save(filename)

        self.parent().statusBar().showMessage(self.tr("Ready"), 2000)


text:
IF EXISTS(SELECT * FROM [dbo].[sysobjects]
	WHERE ID = object_id(N'[dbo].[SPMessagesGet]')
	AND xtype in ('P'))
	DROP PROCEDURE SPMessagesGet;
GO

CREATE PROCEDURE [dbo].[SPMessagesGet]
	@TopicId int=1,
	@MessageId int=1
AS
SELECT
	F.ForumId
	,F.ForumName
	,F.ForumShortName
	,T.TopicId
	,T.TopicTitle
	,T.TopicShortName
	,M.MessageId
	,M.MessageBody
	,M.MessageCreationDate
	,M.MessageLastEditDate
	,M.ParentId
	,M.UserId
	,M.UserName
	,M.UserSignature
	,M.UserGroupId
	,M.UserGroupName
	,M.UserPhoto
	,M.UserRegistrationDate
	,M.Active

FROM
	MessagesComplete M
		Inner join Topics T on T.TopicId = M.TopicId
		Inner join Forums F on F.ForumId = T.ForumId
WHERE
	M.TopicId = @TopicId
	AND
	M.MessageId = @MessageId
GO

IF EXISTS(SELECT * FROM [dbo].[sysobjects]
	WHERE ID = object_id(N'[dbo].[SPMessagesUpdate]')
	AND xtype in ('P'))
	DROP PROCEDURE SPMessagesUpdate;
GO

Create PROCEDURE [dbo].[SPMessagesUpdate]
	@TopicId int
	,@MessageId int
	,@MessageBody nvarchar(max)
	,@UserId int
	,@Ip varchar (39)
AS

	UPDATE M
	SET
		MessageBody = @MessageBody
		,MessageLastEditDate = GETUTCDATE()
		,EditIp = @Ip
		,MessageLastEditUser = @UserId
	FROM
		Messages M
	WHERE
		TopicId = @TopicId
		and MessageId = @MessageId

GO


text:
#include <glog/logging.h>
#include <algorithm>
#include <string>
#include "vobla/traits.h"
#include "vsfs/index/index_info.h"

namespace vsfs {
namespace index {

int IndexInfo::string_to_index_type(const string &str) {
  string buf = str;
  std::transform(buf.begin(), buf.end(), buf.begin(), ::tolower);
  if (buf == "btree") {
    return BTREE;
  } else if (buf == "hash") {
    return HASH;
  } else if (buf == "content") {
    return CONTENT;
  } else if (buf == "multidim") {
    return MULTIDIM;
  }
  return -1;
}

string IndexInfo::index_type_to_string(int idx_type) {
  switch (idx_type) {
    case BTREE:
      return "btree";
    case HASH:
      return "hash";
    case CONTENT:
      return "content";
    case MULTIDIM:
      return "multidim";
    default:
      return "unknown";
  }
}

IndexInfo::IndexInfo() : index_type_(UNKNOWN_INDEX), key_type_(UNKNOWN) {
}

IndexInfo::IndexInfo(const string &idx_path, const string &name,
                     int idx_type, int k_type )
    : index_path_(idx_path), index_name_(name), index_type_(idx_type),
    key_type_(k_type) {
}

bool IndexInfo::is_validate() const {
  if (index_type_ == BTREE || index_type_ == MULTIDIM) {
    return key_type_ == INT64 || key_type_ == UINT64 ||
        key_type_ == FLOAT || key_type_ == DOUBLE;
  }
  if (index_type_ == CONTENT) {
    return key_type_ == STRING;
  }
  return true;
}

void IndexInfo::set_path(const string &index_path) {
  index_path_ = index_path;
}

const string& IndexInfo::path() const {
  return index_path_;
}

void IndexInfo::set_index_name(const string &name) {
  CHECK(!name.empty());
  index_name_ = name;
}

const string& IndexInfo::index_name() const {
  return index_name_;
}

void IndexInfo::set_index_type(int type) {
  CHECK_GE(type, HASH);
  CHECK_LE(type, CONTENT);
  index_type_ = type;
}

int IndexInfo::index_type() const {
  return index_type_;
}

string IndexInfo::index_type_string() const {
  return index_type_to_string(index_type_);
}

void IndexInfo::set_key_type(int type) {
  CHECK_GT(type, UNKNOWN);
  CHECK_LE(type, STRING);
  key_type_ = type;
}

int IndexInfo::key_type() const {
  return key_type_;
}

string IndexInfo::key_type_string() const {
  return type_int_to_string(key_type_);
}

}  // namespace index
}  // namespace vsfs