text:
<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:orientation="vertical"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:background="#FFFFFFFF"
        android:gravity="center_horizontal">
    <ScrollView
            android:layout_width="match_parent"
            android:layout_height="match_parent">
        <LinearLayout
                android:orientation="vertical"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="#FFFFFFFF"
                android:gravity="center_horizontal">
            <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:focusable="true"
                    android:focusableInTouchMode="true"/>

            <LinearLayout
                    android:orientation="horizontal"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:gravity="center_vertical">
                <Button
                        android:id="@+id/button_back"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:textColor="#000"
                        android:padding="10dp"
                        android:background="#0fff"
                        android:textSize="15sp"
                        android:drawableLeft="@drawable/close_button_icon"
                        android:text="取消"/>
                <TextView
                        android:id="@+id/text_title"
                        android:layout_width="0dp"
                        android:layout_weight="1"
                        android:layout_height="wrap_content"
                        android:gravity="center"
                        android:textColor="#000"
                        android:textSize="18sp"
                        android:text="XXX微博分享"/>
                <Button
                        android:id="@+id/button_publish"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:textColor="#000"
                        android:padding="10dp"
                        android:background="#0fff"
                        android:textSize="15sp"
                        android:drawableLeft="@drawable/submit_button_icon"
                        android:text="发布"/>
            </LinearLayout>
            <TextView
                    android:layout_width="match_parent"
                    android:layout_height="1dp"
                    android:background="#ccc"/>
            <EditText
                    android:layout_width="match_parent"
                    android:layout_height="200dp"
                    android:layout_marginRight="10dp"
                    android:layout_marginLeft="10dp"
                    android:layout_marginTop="10dp"
                    android:layout_marginBottom="5dp"
                    android:paddingTop="5dp"
                    android:paddingLeft="5dp"
                    android:background="@drawable/share_content_text"
                    android:gravity="top"
                    android:id="@+id/edit_content"/>
            <LinearLayout
                    android:orientation="horizontal"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:gravity="right">
                <TextView
                        android:id="@+id/text_counter"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginBottom="10dp"
                        android:text="还可以输入X字"/>
            </LinearLayout>
            <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">
                <CheckBox
                        android:id="@+id/checkBox_image"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:checked="false"
                        android:visibility="gone"
                        android:textColor="#000"
                        android:text="无图分享"/>
            </LinearLayout>
            <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:gravity="center">
                <ImageView
                        android:id="@+id/imageView_image"
                        android:layout_width="180dp"
                        android:layout_height="130dp"
                        android:src="@drawable/default_share_image"/>
            </LinearLayout>
        </LinearLayout>
    </ScrollView>

</LinearLayout>


text:
using System;
using System.Windows.Input;

namespace Assisticant
{
    /// <summary>
    /// Creates a command object, which implements ICommand. Use the When (optional) and
    /// Do (required) methods to specify the behavior of the command. Pass lambda expressions
    /// taking no parameters into both methods. A lambda expression taking no parameters
    /// looks like this: () => <condition or {statement}>
    /// </summary>
    public static class MakeCommand
    {
        private class Command : ICommand
        {
            // The condition under which it can execute, and the action to execute.
            private Func<bool> _canExecuteFunction;
            private Action _execute;

            // A computed flag, true when the command can be executed.
            private bool _canExecute = false;
            private Computed _depCanExecute;

            public Command(Func<bool> canExecute, Action execute)
            {
                _canExecuteFunction = canExecute;
                _execute = execute;

                // Create a computed sentry to control the "can execute" flag.
                _depCanExecute = new Computed(UpdateCanExecute);
                _depCanExecute.Invalidated += new Action(Invalidated);

                // It begins its life out-of-date, so prepare to update it.
                Invalidated();
            }

            public event EventHandler CanExecuteChanged;

            public bool CanExecute(object parameter)
            {
                // Just returning the flag. The flag gets set elsewhere.
                _depCanExecute.OnGet();
                return _canExecute;
            }

            public void Execute(object parameter)
            {
                _execute();
            }

            private void UpdateCanExecute()
            {
                // Here is where the flag gets updated. The update function
                // is executed, and the result is stored in the "can execute"
                // flag. I become dependent upon anything that the update
                // function touches.
                _canExecute = _canExecuteFunction();
            }

            private void Invalidated()
            {
                // When the "can execute" flag is invalidated, we need to queue
                // up a call to update it. This will cause the UI thread to
                // call TriggerUpdate (below) when everything settles down.
                UpdateScheduler.ScheduleUpdate(UpdateNow);
            }

            private void UpdateNow()
            {
                // The "can execute" flag is now out-of-date. We need to update it.
                _depCanExecute.OnGet();

                // Now that it is up-to-date again, we need to notify anybody bound
                // to this command that the flag has changed.
                if (CanExecuteChanged != null)
                    CanExecuteChanged(this, new EventArgs());
            }
        }

        public class Condition
        {
            private Func<bool> _canExecute;

            public Condition(Func<bool> canExecute)
            {
                _canExecute = canExecute;
            }

            /// <summary>
            /// Specify an action to execute when the command is invoked. The action is a lambda
            /// taking no parameters and performing a statement. The syntax looks like: () => { DoSomething(); }
            /// </summary>
            /// <param name="execute">A lambda expression taking no parameters and performing a statement. The
            /// syntax looks like: () => { DoSomething(); }</param>
            /// <returns>A command that does that.</returns>
            public ICommand Do(Action execute)
            {
                return new Command(_canExecute, execute);
            }
        }

        /// <summary>
        /// Specify a condition under which the command can be executed. Controls bound to the
        /// command will only be enabled when this condition is true. The condition is a lambda
        /// taking no parameters and returning a boolean. The syntax looks like: () => SelectedThing != null
        /// </summary>
        /// <param name="condition">A lambda expression taking no parameters and returing a boolean: () => SelectedThing != null</param>
        /// <returns>An object that you can add .Do to.</returns>
        public static Condition When(Func<bool> condition)
        {
            return new Condition(condition);
        }

        /// <summary>
        /// Specify an action to execute when the command is invoked. The action is a lambda
        /// taking no parameters and performing a statement. The syntax looks like: () => { DoSomething(); }
        /// </summary>
        /// <param name="execute">A lambda expression taking no parameters and performing a statement. The
        /// syntax looks like: () => { DoSomething(); }</param>
        /// <returns>A command that does that.</returns>
        public static ICommand Do(Action execute)
        {
            return new Command(() => true, execute);
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using System.IO;
using Wbs.Sockets;
using System.Configuration;

namespace Wbs.Everdigm.Network
{
    /// <summary>
    /// 全局静态网络服务类
    /// </summary>
    public static class StaticService
    {
        private static SocketServer _server;

        /// <summary>
        /// 初始化并启动服务
        /// </summary>
        public static void StartService()
        {
            var port = int.Parse(ConfigurationManager.AppSettings["SERVER_PORT"]);
            if (null == _server)
            {
                _server = new SocketServer(port);
                _server.StartUDP = true;
                _server.Start();
            }
        }
        /// <summary>
        /// 关闭服务
        /// </summary>
        public static void StopService()
        {
            if (null != _server)
            {
                _server.Stop();
            }
        }
        /// <summary>
        /// 写入系统日志
        /// </summary>
        /// <param name="EventString"></param>
        public static void WriteEventLog(string EventString)
        {
            string filename = DateTime.Now.ToString("yyyyMMdd");
            FileStream fs = new FileStream(System.Web.HttpContext.Current.Server.MapPath("~/exceptions/" + filename + ".txt"), FileMode.Append);
            //创建FileSteam类,参数为路径\打开文件方式\对文件进行什么样的操作
            StreamWriter ww = new StreamWriter(fs, System.Text.Encoding.Default);
            ww.WriteLine("\r\n**************" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "**************");
            ww.Write(EventString);
            ww.WriteLine("\r\n**************End**************");
            ww.Close();
            fs.Close();
        }
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using sly.lexer;

namespace sly.parser
{
    public class UnexpectedTokenSyntaxError<T> : ParseError, IComparable
    {
        public UnexpectedTokenSyntaxError(Token<T> unexpectedToken, params T[] expectedTokens)
        {
            UnexpectedToken = unexpectedToken;
            if (expectedTokens != null)
            {
                ExpectedTokens = new List<T>();
                ExpectedTokens.AddRange(expectedTokens);
            }
            else
            {
                ExpectedTokens = null;
            }
        }

        public Token<T> UnexpectedToken { get; set; }

        public List<T> ExpectedTokens { get; set; }

        public override int Line
        {
            get
            {
                var l = UnexpectedToken?.Position?.Line;
                return l.HasValue ? l.Value : 1;
            }
        }

        public override int Column
        {
            get
            {
                var c = UnexpectedToken?.Position?.Column;
                return c.HasValue ? c.Value : 1;
            }
        }

        public override string ErrorMessage
        {
            get
            {
                var message = new StringBuilder();
                if (!UnexpectedToken.IsEOS)
                    message.Append($"unexpected \"{UnexpectedToken.Value}\" ({UnexpectedToken.TokenID}) ");
                else
                    message.Append("unexpected end of stream. ");
                message.Append($"at {UnexpectedToken.Position}.");
                if (ExpectedTokens != null && ExpectedTokens.Any())
                {
                    message.Append("expecting ");

                    foreach (var t in ExpectedTokens)
                    {
                        message.Append(t);
                        message.Append(", ");
                    }
                }

                return message.ToString();
            }
        }

        public override string ToString()
        {
            return ErrorMessage;
        }
    }
}


text:
package tests;

import gui.PieChart;
import java.awt.Dimension;
import javax.swing.JFrame;
import org.jfree.chart.ChartPanel;
import org.jfree.chart.annotations.XYPointerAnnotation;
import org.jfree.chart.axis.ValueAxis;
import org.jfree.chart.plot.MeterPlot;

public class PieTest extends JFrame {
    public static String[] x;
    public static double[] y;

    static {
        x = new String[]{"a", "b", "c", "d", "e", "f", "g", "h", "i", "j"};
        y = new double[10];
    }

    public PieTest() {
        ChartPanel p = PieChart.createPieChart("a", "b", x, y);
        p.setPreferredSize(new Dimension(ValueAxis.MAXIMUM_TICK_COUNT, MeterPlot.DEFAULT_METER_ANGLE));
        p.setVisible(true);
        setContentPane(p);
    }

    public static void main(String[] args) {
        for (int i = 0; i < 10; i++) {
            y[i] = (double) ((int) (Math.random() * XYPointerAnnotation.DEFAULT_TIP_RADIUS));
        }
        PieTest a = new PieTest();
        a.setVisible(true);
        a.pack();
        a.setDefaultCloseOperation(3);
    }
}


text:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">

  <title>Qt 4.3: pieview.h Example File (itemviews/chart/pieview.h)</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />

  	Home · All Classes · Main Classes · Grouped Classes · Modules · Functions

pieview.h Example File
itemviews/chart/pieview.h

 #ifndef PIEVIEW_H
 #define PIEVIEW_H

 #include <QAbstractItemView>
 #include <QFont>
 #include <QItemSelection>
 #include <QItemSelectionModel>
 #include <QModelIndex>
 #include <QRect>
 #include <QSize>
 #include <QPoint>
 #include <QWidget>

 class QRubberBand;

 class PieView : public QAbstractItemView
 {
     Q_OBJECT

 public:
     PieView(QWidget *parent = 0);

     QRect visualRect(const QModelIndex &index) const;
     void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible);
     QModelIndex indexAt(const QPoint &point) const;

 protected slots:
     void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);
     void rowsInserted(const QModelIndex &parent, int start, int end);
     void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end);

 protected:
     bool edit(const QModelIndex &index, EditTrigger trigger, QEvent *event);
     QModelIndex moveCursor(QAbstractItemView::CursorAction cursorAction,
                            Qt::KeyboardModifiers modifiers);

     int horizontalOffset() const;
     int verticalOffset() const;

     bool isIndexHidden(const QModelIndex &index) const;

     void setSelection(const QRect&, QItemSelectionModel::SelectionFlags command);

     void mousePressEvent(QMouseEvent *event);

     void mouseMoveEvent(QMouseEvent *event);
     void mouseReleaseEvent(QMouseEvent *event);

     void paintEvent(QPaintEvent *event);
     void resizeEvent(QResizeEvent *event);
     void scrollContentsBy(int dx, int dy);

     QRegion visualRegionForSelection(const QItemSelection &selection) const;

 private:
     QRect itemRect(const QModelIndex &item) const;
     QRegion itemRegion(const QModelIndex &index) const;
     int rows(const QModelIndex &index = QModelIndex()) const;
     void updateGeometries();

     int margin;
     int totalSize;
     int pieSize;
     int validItems;
     double totalValue;
     QPoint origin;
     QRubberBand *rubberBand;
 };

 #endif

<address>

Copyright © 2008 Trolltech
Trademarks

Qt 4.3.5

</address>


text:
<?php
/**
 * Created by PhpStorm.
 * User: jderay
 * Date: 8/13/15
 * Time: 9:51 PM
 */

namespace Giftcards\Encryption\Form\DataTransformer;

use Giftcards\Encryption\Encryptor;
use Symfony\Component\Form\DataTransformerInterface;
use Symfony\Component\Form\Exception\TransformationFailedException;

class EncryptTransformer implements DataTransformerInterface
{
    protected $encryptor;
    protected $profile;

    /**
     * EncryptTransformer constructor.
     * @param Encryptor $encryptor
     * @param $profile
     */
    public function __construct(
        Encryptor $encryptor,
        $profile = null
    ) {
        $this->encryptor = $encryptor;
        $this->profile = $profile;
    }

    /**
     * Transforms a value from the original representation to a transformed representation.
     *
     * This method is called on two occasions inside a form field:
     *
     * 1. When the form field is initialized with the data attached from the datasource (object or array).
     * 2. When data from a request is submitted using {@link Form::submit()} to transform the new input data
     *    back into the renderable format. For example if you have a date field and submit '2009-10-10'
     *    you might accept this value because its easily parsed, but the transformer still writes back
     *    "2009/10/10" onto the form field (for further displaying or other purposes).
     *
     * This method must be able to deal with empty values. Usually this will
     * be NULL, but depending on your implementation other empty values are
     * possible as well (such as empty strings). The reasoning behind this is
     * that value transformers must be chainable. If the transform() method
     * of the first value transformer outputs NULL, the second value transformer
     * must be able to process that value.
     *
     * By convention, transform() should return an empty string if NULL is
     * passed.
     *
     * @param mixed $value The value in the original representation
     *
     * @return mixed The value in the transformed representation
     *
     * @throws TransformationFailedException When the transformation fails.
     */
    public function transform($value)
    {
        if (!$value) {
            return '';
        }

        return $this->encryptor->decrypt($value);
    }

    /**
     * Transforms a value from the transformed representation to its original
     * representation.
     *
     * This method is called when {@link Form::submit()} is called to transform the requests tainted data
     * into an acceptable format for your data processing/model layer.
     *
     * This method must be able to deal with empty values. Usually this will
     * be an empty string, but depending on your implementation other empty
     * values are possible as well (such as empty strings). The reasoning behind
     * this is that value transformers must be chainable. If the
     * reverseTransform() method of the first value transformer outputs an
     * empty string, the second value transformer must be able to process that
     * value.
     *
     * By convention, reverseTransform() should return NULL if an empty string
     * is passed.
     *
     * @param mixed $value The value in the transformed representation
     *
     * @return mixed The value in the original representation
     *
     * @throws TransformationFailedException When the transformation fails.
     */
    public function reverseTransform($value)
    {
        if ($value == '') {
            return null;
        }

        return $this->encryptor->encrypt($value, $this->profile);
    }
}


text:
package main

import (
	"bufio"
	"context"
	"encoding/json"
	"flag"
	"fmt"
	"io/ioutil"
	"os"
	"os/user"
	"path/filepath"
	"strconv"
	"strings"
	"text/tabwriter"

	"github.com/google/gapid/core/app"
	"github.com/google/gapid/core/log"
	"github.com/google/gapid/gapis/client"
	"github.com/google/gapid/gapis/service/path"
)

type perfettoVerb struct{ PerfettoFlags }

func init() {
	verb := &perfettoVerb{}
	app.AddVerb(&app.Verb{
		Name:      "perfetto",
		ShortHelp: "Run metrics and interact with system profiler trace.",
		Action:    verb,
	})
}

func (verb *perfettoVerb) Run(ctx context.Context, flags flag.FlagSet) error {
	var trace string
	if verb.Mode != ModeList {
		if flags.NArg() != 1 {
			app.Usage(ctx, "Exactly one perfetto trace file expected, got %d", flags.NArg())
			return nil
		}

		trace = flags.Arg(0)
		if _, err := os.Stat(trace); os.IsNotExist(err) {
			return fmt.Errorf("Could not find trace file: %v", trace)
		}
	}

	if verb.Mode != ModeMetrics && verb.Mode != ModeInteractive && verb.Mode != ModeList {
		app.Usage(ctx, "Run mode should be 'metrics', 'interactive' or 'list', got '%s'.", verb.Mode)
	}

	var input string
	if verb.In != "" {
		input, _ = filepath.Abs(verb.In)
		if _, err := os.Stat(input); os.IsNotExist(err) {
			return fmt.Errorf("Could not find input queries file: %v", input)
		}
	} else if verb.Mode == ModeMetrics {
		log.I(ctx, "No input file is given to read the metric definitions. Default metrics will be run. You can use '-in <metrics-json-file>' to provide custom metric definitions or  '-mode interactive' to use the interactive mode.")
	}

	var empty struct{}
	categories := make(map[string]struct{})
	if verb.Mode != ModeInteractive && verb.Categories != "" {
		catstrs := strings.Split(verb.Categories, ",")
		for _, s := range catstrs {
			categories[s] = empty
		}
	}

	output := ""
	if verb.Out != "" {
		output, _ = filepath.Abs(verb.Out)
	}

	outputFormat := OutputText
	switch verb.Format {
	case OutputDefault:
		if output == "" {
			outputFormat = OutputText
		} else {
			outputFormat = OutputJson
		}
	case OutputText:
		break
	case OutputJson:
		outputFormat = OutputJson
	default:
		app.Usage(ctx, "Output format should be 'text' or 'json', got '%s'.", verb.Format)
	}

	if verb.Mode == ModeMetrics {
		return RunMetrics(ctx, trace, input, categories, output, outputFormat)
	} else if verb.Mode == ModeInteractive {
		return RunInteractive(ctx, trace, input, output, outputFormat)
	} else {
		return ListMetrics(ctx, input, categories)
	}
}

func RunPrepQuery(ctx context.Context, cclient client.Client, capture *path.Capture, query string) (err error) {
	log.I(ctx, "Running query: %s", query)
	_, error := cclient.PerfettoQuery(ctx, capture, query)
	if error != nil {
		err = fmt.Errorf("Error while running query %s : %v.", query, err)
	}
	return
}

func RunQuery(ctx context.Context, cclient client.Client, capture *path.Capture, query string) (numColumns int, columnNames []string, columnTypes []string, numRecords uint64, dataStrings [][]string, dataLongs [][]int64, dataDoubles [][]float64, err error) {
	log.I(ctx, "Running query: %s", query)
	queryResult, error := cclient.PerfettoQuery(ctx, capture, query)
	if error != nil {
		err = fmt.Errorf("Error while running query %s : %v.", query, err)
		return
	}
	columns := queryResult.GetColumns()
	numColumns = len(columns)
	numRecords = queryResult.GetNumRecords()
	columnNames = make([]string, numColumns)
	columnTypes = make([]string, numColumns)
	columnDescriptors := queryResult.GetColumnDescriptors()
	dataStrings = make([][]string, numColumns)
	dataLongs = make([][]int64, numColumns)
	dataDoubles = make([][]float64, numColumns)
	for i := 0; i < numColumns; i++ {
		columnNames[i] = columnDescriptors[i].GetName()
		columnTypes[i] = columnDescriptors[i].GetType().String()
		switch columnTypes[i] {
		case "UNKNOWN":
			fallthrough
		case "STRING":
			dataStrings[i] = columns[i].GetStringValues()
		case "LONG":
			dataLongs[i] = columns[i].GetLongValues()
		case "DOUBLE":
			dataDoubles[i] = columns[i].GetDoubleValues()
		}
	}
	return
}

type MetricResult struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type MetricResultRecord struct {
	Results []MetricResult `json:"result"`
}

type MetricResults struct {
	Name        string               `json:"name"`
	Description string               `json:"description"`
	Results     []MetricResultRecord `json:"results"`
}

type CategoryResults struct {
	Name    string          `json:"name"`
	Metrics []MetricResults `json:"metrics"`
}

type MetricsResults struct {
	Categories []CategoryResults `json:"categories"`
}

type Query struct {
	Query string `json:"query"`
}

type Metric struct {
	Name        string  `json:"name"`
	Description string  `json:"description"`
	Queries     []Query `json:"queries"`
}

type MetricCategory struct {
	Name    string   `json:"category"`
	Metrics []Metric `json:"metric"`
}

type MetricsInfo struct {
	PrepQueries      []Query          `json:"initialize"`
	MetricCategories []MetricCategory `json:"metrics"`
}

func RunMetrics(ctx context.Context, trace string, inputPath string, categories map[string]struct{}, outputPath string, format PerfettoOutputFormat) error {
	var byteValue []byte
	if inputPath != "" {
		metricsFile, err := os.Open(inputPath)
		if err != nil {
			app.Usage(ctx, "Cannot open file %s: %v.", inputPath, err)
		}
		defer metricsFile.Close()
		byteValue, _ = ioutil.ReadAll(metricsFile)
	} else {
		byteValue = []byte(PredefinedMetrics())
	}
	var metricsInfo MetricsInfo
	err := json.Unmarshal(byteValue, &metricsInfo)
	if err != nil {
		return fmt.Errorf("Error while unmarshalling metrics from file %s: %v.", inputPath, err)
	}

	// Load the trace
	client, capture, err := getGapisAndLoadCapture(ctx, GapisFlags{}, GapirFlags{}, trace, CaptureFileFlags{})
	if err != nil {
		return fmt.Errorf("Error while loading the trace file %s: %v.", trace, err)
	}
	defer client.Close()

	// Run the preparation queries
	for _, query := range metricsInfo.PrepQueries {
		if err := RunPrepQuery(ctx, client, capture, query.Query); err != nil {
			return err
		}
	}

	if format == OutputText {
		if err := InitilizeOutputFile(ctx, ModeMetrics, outputPath, format); err != nil {
			return err
		}
	}

	var metricsResults MetricsResults
	runCustomCategories := len(categories) > 0
	for i := 0; i < len(metricsInfo.MetricCategories); i++ {
		categoryName := metricsInfo.MetricCategories[i].Name
		if runCustomCategories {
			if _, ok := categories[categoryName]; !ok {
				continue
			}
		}
		log.I(ctx, "Running Category: %s", categoryName)
		categoryResults := CategoryResults{Name: categoryName}
		metrics := &(metricsInfo.MetricCategories[i].Metrics)
		for j := 0; j < len(*metrics); j++ {
			log.I(ctx, "Running Metric: %s", (*metrics)[j].Name)
			queries := &(*metrics)[j].Queries
			if len(*queries) == 0 {
				log.I(ctx, "No queires found to run for this metric.")
			} else {
				for k := 0; k < len(*queries)-1; k++ {
					if err := RunPrepQuery(ctx, client, capture, (*queries)[k].Query); err != nil {
						return err
					}
				}
				numColumns, columnNames, columnTypes, numRecords, dataStrings, dataLongs, dataDoubles, err := RunQuery(ctx, client, capture, (*queries)[len(*queries)-1].Query)
				if err != nil {
					return err
				}
				if numRecords == 0 {
					log.I(ctx, "No records returned by this query.")
				} else if format == OutputText {
					err := ReportMetricResultsInTextFormat(categoryName, (*metrics)[j].Name, (*metrics)[j].Description, numColumns, columnNames, columnTypes, numRecords, dataStrings, dataLongs, dataDoubles, outputPath)
					if err != nil {
						return err
					}
				} else {
					categoryResults.Metrics = append(categoryResults.Metrics, CreateMetricResult((*metrics)[j].Name, (*metrics)[j].Description, numColumns, columnNames, columnTypes, numRecords, dataStrings, dataLongs, dataDoubles))
				}
			}
		}
		metricsResults.Categories = append(metricsResults.Categories, categoryResults)
	}
	if format == OutputJson {
		if err := WriteResultsToJSONOutput(metricsResults, outputPath); err != nil {
			return err
		}
	}
	return nil
}

func RunInteractive(ctx context.Context, trace string, inputPath string, outputPath string, format PerfettoOutputFormat) error {
	// Load the preparation queries from input file. For these queries we do not report the output.
	var prepQueries []string
	if inputPath != "" {
		queriesFile, err := os.Open(inputPath)
		if err != nil {
			app.Usage(ctx, "Cannot open file %s: %v.", inputPath, err)
		}
		defer queriesFile.Close()
		scanner := bufio.NewScanner(queriesFile)
		for scanner.Scan() {
			prepQueries = append(prepQueries, scanner.Text())
		}
	}

	// Load main queries from stdin if any exist. We report the result of these queries.
	pipeMode := false
	var queries []string
	stat, _ := os.Stdin.Stat()
	if (stat.Mode() & os.ModeCharDevice) == 0 {
		pipeMode = true
		scanner := bufio.NewScanner(os.Stdin)
		for scanner.Scan() {
			queries = append(queries, scanner.Text())
		}
	}

	// Load the trace
	client, capture, err := getGapisAndLoadCapture(ctx, GapisFlags{}, GapirFlags{}, trace, CaptureFileFlags{})
	if err != nil {
		return fmt.Errorf("Error while loading the trace file %s: %v.", trace, err)
	}
	defer client.Close()

	// Run the preparation queries
	for _, query := range prepQueries {
		if err := RunPrepQuery(ctx, client, capture, query); err != nil {
			return err
		}
	}

	// If queries are passed as a pipe, run the queries, report the results and finish the execution
	if pipeMode {
		err := InitilizeOutputFile(ctx, ModeInteractive, outputPath, format)
		if err != nil {
			return err
		}
		for qindex, query := range queries {
			log.I(ctx, "Running query: %s", query)
			numColumns, columnNames, columnTypes, numRecords, dataStrings, dataLongs, dataDoubles, err := RunQuery(ctx, client, capture, query)
			if err != nil {
				return err
			}
			if format == OutputText {
				err := ReportAllQueryResultsInTextFormat(query, numColumns, columnNames, columnTypes, numRecords, dataStrings, dataLongs, dataDoubles, outputPath)
				if err != nil {
					return err
				}
			} else {
				lastQuery := qindex == len(queries)-1
				err := ReportQueryResultsInJSONFormat(query, lastQuery, numColumns, columnNames, columnTypes, numRecords, dataStrings, dataLongs, dataDoubles, outputPath)
				if err != nil {
					return err
				}
			}
		}
		if format == OutputJson {
			if err := FinalizeJSONOutput(ctx, outputPath); err != nil {
				return err
			}
		}
		return nil
	}

	// Start the interactive mode
	log.I(ctx, "Starting interactive mode ...")
	validResults := false
	var numColumns int
	var columnNames []string
	var columnTypes []string
	var numRecords uint64
	var dataStrings [][]string
	var dataLongs [][]int64
	var dataDoubles [][]float64
	var query string
	var cmdString string
	var cmdHistory []string
	var validCommand bool
	runCommandFromHistory := false

	for {
		validCommand = false
		if !runCommandFromHistory {
			fmt.Print(">> ")
			reader := bufio.NewReader(os.Stdin)
			cmdString, err = reader.ReadString('\n')
			if err != nil {
				return err
			}
		}
		runCommandFromHistory = false
		cmdHistory = append(cmdHistory, cmdString)
		if strings.HasPrefix(cmdString, "run") {
			validResults = false
			query = strings.TrimSuffix(strings.TrimPrefix(cmdString, "run"), "\n")
			numColumns, columnNames, columnTypes, numRecords, dataStrings, dataLongs, dataDoubles, err = RunQuery(ctx, client, capture, query)
			if err != nil {
				fmt.Println("Error while running query: ", err)
			} else {
				validResults = true
				startIndex := uint64(0)
				recordCount := uint64(10)
				for {
					err = ReportPartialQueryResultsOnConsole(query, numColumns, columnNames, columnTypes, numRecords, dataStrings, dataLongs, dataDoubles, startIndex, recordCount)
					if err != nil {
						fmt.Println(err)
					}
					if startIndex+recordCount >= numRecords {
						break
					}
					fmt.Print("Press any key for more results; press 'q' to quit... ")
					reader := bufio.NewReaderSize(os.Stdin, 1)
					input, _ := reader.ReadByte()
					if input == 'q' {
						break
					}
					startIndex = startIndex + recordCount
				}
			}
			validCommand = true
		} else if strings.HasPrefix(cmdString, "save") {
			if !validResults {
				fmt.Println("No valid query results available to save.")
			} else {
				cmdString = strings.TrimSpace(strings.TrimPrefix(cmdString, "save"))
				if strings.HasPrefix(cmdString, "text") || strings.HasPrefix(cmdString, "json") {
					validCommand = true
					prefix := cmdString[:4]
					path := strings.TrimSpace(cmdString[4:])
					if strings.HasPrefix(path, "~/") {
						usr, _ := user.Current()
						path = filepath.Join(usr.HomeDir, path[2:])
					}
					var err error
					switch prefix {
					case "text":
						err = InitilizeOutputFile(ctx, ModeInteractive, path, OutputText)
						if err != nil {
							err = ReportAllQueryResultsInTextFormat(query, numColumns, columnNames, columnTypes, numRecords, dataStrings, dataLongs, dataDoubles, path)
						}
					case "json":
						err = InitilizeOutputFile(ctx, ModeInteractive, path, OutputJson)
						if err == nil {
							lastQuery := true
							err = ReportQueryResultsInJSONFormat(query, lastQuery, numColumns, columnNames, columnTypes, numRecords, dataStrings, dataLongs, dataDoubles, path)
						}
						if err == nil {
							if err = FinalizeJSONOutput(ctx, outputPath); err != nil {
								return err
							}
						}
					}
					fmt.Println("Results saved to ", path)
				}
			}
		} else if strings.HasPrefix(cmdString, "history") {
			cmdString = strings.TrimSpace(strings.TrimPrefix(cmdString, "history"))
			validCommand = true
			cmdFirst := 0
			cmdCountr, err := strconv.Atoi(cmdString)
			if err == nil {
				if len(cmdHistory)-cmdCountr > 0 {
					cmdFirst = len(cmdHistory) - cmdCountr - 1
				}
			}
			for i := cmdFirst; i < len(cmdHistory)-1; i++ {
				fmt.Print(i, "\t", cmdHistory[i])
			}
		} else if strings.HasPrefix(cmdString, "!") {
			cmdString = strings.TrimSpace(strings.TrimPrefix(cmdString, "!"))
			cmdId, err := strconv.Atoi(cmdString)
			if err == nil && cmdId < len(cmdHistory)-1 {
				validCommand = true
				cmdString = cmdHistory[cmdId]
				runCommandFromHistory = true
				fmt.Println(cmdString)
			}
		} else if strings.HasPrefix(cmdString, "quit") {
			break
		}
		if !validCommand {
			fmt.Println("Please use one of the following commands:")
			fmt.Println("\t>> run <sql-query>")
			fmt.Println("\t>> save text <filename>")
			fmt.Println("\t>> save json <filename>")
			fmt.Println("\t>> history [num-of-last-commands]")
			fmt.Println("\t>> !<command-id-returned-in-history>")
			fmt.Println("\t>> quit")
		}
	}
	return nil
}

func InitilizeOutputFile(ctx context.Context, runMode PerfettoMode, outputPath string, outputFormat PerfettoOutputFormat) error {
	var output *os.File
	var err error
	if outputPath != "" {
		output, err = os.Create(outputPath)
		if err != nil {
			return fmt.Errorf("Error while creating the output file %s: %v.", outputPath, err)
		}
		defer output.Close()
	} else {
		output = os.Stdout
	}
	if runMode == ModeInteractive && outputFormat == OutputJson {
		if _, err := output.Write([]byte("{\"queries\":[\n")); err != nil {
			return fmt.Errorf("Error writing to the output file %s: %v.", outputPath, err)
		}
	} else if runMode == ModeMetrics && outputFormat == OutputText {
		if _, err := output.Write([]byte("GAPID System Profiler Metrics\n")); err != nil {
			return fmt.Errorf("Error writing to the output file %s: %v.", outputPath, err)
		}
	}
	return nil
}

func FinalizeJSONOutput(ctx context.Context, outputPath string) error {
	var output *os.File
	var err error
	if outputPath != "" {
		output, err = os.OpenFile(outputPath, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
		if err != nil {
			return fmt.Errorf("Error while opening the output file %s: %v.", outputPath, err)
		}
		defer output.Close()
	} else {
		output = os.Stdout
	}
	if _, err := output.Write([]byte("]}")); err != nil {
		return fmt.Errorf("Error writing to the output file %s: %v.", outputPath, err)
	}
	return nil
}

func ReportAllQueryResultsInTextFormat(query string, numColumns int, columnNames []string, columnTypes []string, numRecords uint64, dataStrings [][]string, dataLongs [][]int64, dataDoubles [][]float64, outputPath string) error {
	return ReportQueryResultsInTextFormat(query, numColumns, columnNames, columnTypes, numRecords, dataStrings, dataLongs, dataDoubles, outputPath, true, 0, 0)
}

func ReportPartialQueryResultsOnConsole(query string, numColumns int, columnNames []string, columnTypes []string, numRecords uint64, dataStrings [][]string, dataLongs [][]int64, dataDoubles [][]float64, startIndex uint64, count uint64) error {
	return ReportQueryResultsInTextFormat(query, numColumns, columnNames, columnTypes, numRecords, dataStrings, dataLongs, dataDoubles, "", false, startIndex, count)
}

func ReportQueryResultsInTextFormat(query string, numColumns int, columnNames []string, columnTypes []string, numRecords uint64, dataStrings [][]string, dataLongs [][]int64, dataDoubles [][]float64, outputPath string, showAll bool, startIndex uint64, count uint64) error {
	var output *os.File
	var err error
	if outputPath != "" {
		output, err = os.OpenFile(outputPath, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
		if err != nil {
			return fmt.Errorf("Error while opening the output file %s: %v.", outputPath, err)
		}
		defer output.Close()
	} else {
		output = os.Stdout
	}
	const padding = 2
	writer := tabwriter.NewWriter(output, 0, 0, padding, ' ', 0)
	for i := 0; i < numColumns; i++ {
		fmt.Fprint(writer, columnNames[i]+"\t")
	}
	fmt.Fprintln(writer)

	if showAll {
		fmt.Fprintln(writer, "Query: "+query)
		startIndex = 0
		count = numRecords
	}
	endIndex := numRecords
	if endIndex > startIndex+count {
		endIndex = startIndex + count
	}
	for i := startIndex; i < endIndex; i++ {
		for j := 0; j < numColumns; j++ {
			switch columnTypes[j] {
			case "UNKNOWN":
				fmt.Fprintf(writer, "NULL\t")
			case "STRING":
				fmt.Fprintf(writer, "%s\t", dataStrings[j][i])
			case "LONG":
				fmt.Fprintf(writer, "%d\t", dataLongs[j][i])
			case "DOUBLE":
				fmt.Fprintf(writer, "%f\t", dataDoubles[j][i])
			}
		}
		fmt.Fprintln(writer)
	}
	fmt.Fprintln(writer)
	writer.Flush()
	return nil
}

func ReportMetricResultsInTextFormat(categoryName string, metric string, description string, numColumns int, columnNames []string, columnTypes []string, numRecords uint64, dataStrings [][]string, dataLongs [][]int64, dataDoubles [][]float64, outputPath string) error {
	var output *os.File
	var err error
	if outputPath != "" {
		output, err = os.OpenFile(outputPath, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
		if err != nil {
			return fmt.Errorf("Error while opening the output file %s: %v.", outputPath, err)
		}
		defer output.Close()
	} else {
		output = os.Stdout
	}
	const padding = 2
	writer := tabwriter.NewWriter(output, 0, 0, padding, ' ', 0)
	fmt.Fprintln(writer, "Category: ", categoryName)
	fmt.Fprintln(writer, "Metric name: ", metric)
	fmt.Fprintln(writer, "Description: ", description)
	for i := 0; i < numColumns; i++ {
		fmt.Fprint(writer, columnNames[i]+"\t")
	}
	fmt.Fprintln(writer)

	for i := uint64(0); i < numRecords; i++ {
		for j := 0; j < numColumns; j++ {
			switch columnTypes[j] {
			case "UNKNOWN":
				fmt.Fprintf(writer, "NULL\t")
			case "STRING":
				fmt.Fprintf(writer, "%s\t", dataStrings[j][i])
			case "LONG":
				fmt.Fprintf(writer, "%d\t", dataLongs[j][i])
			case "DOUBLE":
				fmt.Fprintf(writer, "%f\t", dataDoubles[j][i])
			}
		}
		fmt.Fprintln(writer)
	}
	fmt.Fprintln(writer)
	writer.Flush()
	return nil
}

func ReportQueryResultsInJSONFormat(query string, lastQuery bool, numColumns int, columnNames []string, columnTypes []string, numRecords uint64, dataStrings [][]string, dataLongs [][]int64, dataDoubles [][]float64, outputPath string) error {
	var output *os.File
	var err error
	if outputPath != "" {
		output, err = os.OpenFile(outputPath, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
		if err != nil {
			return fmt.Errorf("Error while opening the output file %s: %v.", outputPath, err)
		}
		defer output.Close()
	} else {
		output = os.Stdout
	}

	writer := bufio.NewWriter(output)
	const padding1 = "  "
	const padding2 = "    "
	const padding3 = "      "
	const padding4 = "        "
	writer.WriteString(padding1 + "{ \"query\": \"" + strings.ReplaceAll(query, "\"", "\\\"") + "\",\n")
	writer.WriteString(padding2 + "\"result\": [\n")

	for i := uint64(0); i < numRecords; i++ {
		for j := 0; j < numColumns; j++ {
			if j == 0 {
				writer.WriteString(padding3 + "{ ")
			} else {
				writer.WriteString(padding4)
			}
			writer.WriteString("\"" + columnNames[j] + "\": \"")
			switch columnTypes[j] {
			case "UNKNOWN":
				writer.WriteString("NULL\"")
			case "STRING":
				writer.WriteString(fmt.Sprintf("%s", dataStrings[j][i]) + "\"")
			case "LONG":
				writer.WriteString(fmt.Sprintf("%d", dataLongs[j][i]) + "\"")
			case "DOUBLE":
				writer.WriteString(fmt.Sprintf("%f", dataDoubles[j][i]) + "\"")
			}
			if j != numColumns-1 {
				writer.WriteString(",\n")
			} else {
				writer.WriteString("\n")
			}
		}
		if i != numRecords-1 {
			writer.WriteString(padding3 + "},\n")
		} else {
			writer.WriteString(padding3 + "}\n" + padding2 + "]\n")
		}
	}
	if lastQuery {
		writer.WriteString(padding1 + "}\n")

	} else {
		writer.WriteString(padding1 + "},\n")
	}

	writer.Flush()
	return nil
}

func CreateMetricResult(metric string, description string, numColumns int, columnNames []string, columnTypes []string, numRecords uint64, dataStrings [][]string, dataLongs [][]int64, dataDoubles [][]float64) (metricResults MetricResults) {
	metricResults.Name = metric
	metricResults.Description = description
	for i := uint64(0); i < numRecords; i++ {
		var resultsRecord MetricResultRecord
		for j := 0; j < numColumns; j++ {
			var result string
			switch columnTypes[j] {
			case "UNKNOWN":
				result = "NULL"
			case "STRING":
				result = dataStrings[j][i]
			case "LONG":
				result = strconv.FormatInt(dataLongs[j][i], 10)
			case "DOUBLE":
				result = strconv.FormatFloat(dataDoubles[j][i], 'E', -1, 64)
			}
			resultsRecord.Results = append(resultsRecord.Results, MetricResult{Name: columnNames[j], Value: result})
		}
		metricResults.Results = append(metricResults.Results, resultsRecord)
	}
	return
}

func WriteResultsToJSONOutput(metricsResults MetricsResults, outputPath string) error {
	var output *os.File
	var err error
	if outputPath != "" {
		output, err = os.Create(outputPath)
		if err != nil {
			return fmt.Errorf("Error while opening the output file %s: %v.", outputPath, err)
		}
		defer output.Close()
	} else {
		output = os.Stdout
	}

	jsonResult, err := json.MarshalIndent(&metricsResults, "", "  ")
	if err != nil {
		return fmt.Errorf("Error converting the metrics results to Json. Please file a bug and provide as much as information as possbile to address this issue. Error: %v", err)
	}
	if _, err := output.Write(jsonResult); err != nil {
		return fmt.Errorf("Error writing to the output file %s: %v.", outputPath, err)
	}
	output.Sync()
	return nil
}

func ListMetrics(ctx context.Context, inputPath string, categories map[string]struct{}) error {
	var byteValue []byte
	if inputPath != "" {
		metricsFile, err := os.Open(inputPath)
		if err != nil {
			app.Usage(ctx, "Cannot open file %s: %v.", inputPath, err)
		}
		defer metricsFile.Close()
		byteValue, _ = ioutil.ReadAll(metricsFile)
	} else {
		byteValue = []byte(PredefinedMetrics())
	}
	var metricsInfo MetricsInfo
	err := json.Unmarshal(byteValue, &metricsInfo)
	if err != nil {
		return fmt.Errorf("Error while unmarshalling metrics from file %s: %v.", inputPath, err)
	}

	metricInfo, _ := json.MarshalIndent(&metricsInfo.PrepQueries, "", "  ")
	fmt.Println("Initialization Queries:")
	os.Stdin.Write(metricInfo)
	os.Stdin.Sync()
	fmt.Println("\nMetrics:")
	listCustomCategories := len(categories) > 0
	for i := 0; i < len(metricsInfo.MetricCategories); i++ {
		categoryName := metricsInfo.MetricCategories[i].Name
		if listCustomCategories {
			if _, ok := categories[categoryName]; !ok {
				continue
			}
		}
		metricInfo, _ := json.MarshalIndent(&metricsInfo.MetricCategories[i], "", "  ")
		os.Stdin.Write(metricInfo)
		os.Stdin.WriteString("\n")
	}
	os.Stdin.Sync()
	return nil
}

func PredefinedMetrics() string {
	metricsJsonString := `{
	  "initialize": [{
	      "query": "CREATE VIEW [DRIVER_MEM_TRACK_IDS] AS SELECT * FROM counter_track WHERE name LIKE 'vulkan.mem.driver.%'"
	    },
	    {
	      "query": "CREATE VIEW [GPU_MEM_ALLOC_TRACK_IDS] AS SELECT * FROM counter_track WHERE name LIKE 'vulkan.mem.device.%allocation'"
	    },
	    {
	      "query": "CREATE VIEW [GPU_MEM_BIND_TRACK_IDS] AS SELECT * FROM counter_track WHERE name LIKE 'vulkan.mem.device.%bind'"
	    }
	  ],
	  "metrics": [{
	      "category": "CPU",
	      "metric": [{
	        "name": "AvgCPULoadPercentage",
	        "description": "Average CPU load in percentage over all CPU cores",
	        "queries": [{
	          "query": "SELECT (100 * CAST(SUM(dur) AS FLOAT) / (COUNT(DISTINCT cpu) * CAST(MAX(ts) - MIN(ts) AS FLOAT))) AS avg_cpu_load FROM sched WHERE utid !=  0"
	        }]
	      }]
	    },
	    {
	      "category": "Memory",
	      "metric": [{
	          "name": "AvgMemoryUsageBytes",
	          "description": "Average host memory usage in bytes",
	          "queries": [{
	              "query": "CREATE VIEW [TOTALMEM] AS SELECT value AS total_mem FROM counter WHERE track_id = (SELECT id FROM counter_track WHERE name = 'MemTotal') LIMIT 1"
	            },
	            {
	              "query": "CREATE VIEW [FREEMEM] AS SELECT AVG(value) AS avg_free_mem FROM counter WHERE track_id = (SELECT id FROM counter_track WHERE name = 'MemFree')"
	            },
	            {
	              "query": "SELECT CAST((total_mem - avg_free_mem) AS INT) AS avg_used_mem FROM [TOTALMEM], [FREEMEM]"
	            }
	          ]
	        },
	        {
	          "name": "MaxMemoryUsageBytes",
	          "description": "Max host memory usage in bytes",
	          "queries": [{
	              "query": "CREATE VIEW [TOTALMEM] AS SELECT value AS total_mem FROM counter WHERE track_id = (SELECT id FROM counter_track WHERE name = 'MemTotal') LIMIT 1"
	            },
	            {
	              "query": "CREATE VIEW [MINFREEMEM] AS SELECT MIN(value) AS min_free_mem FROM counter WHERE track_id = (SELECT id FROM counter_track WHERE name = 'MemFree')"
	            },
	            {
	              "query": "SELECT CAST((total_mem - min_free_mem) AS INT) AS max_used_mem FROM [TOTALMEM], [MINFREEMEM]"
	            }
	          ]
	        }
	      ]
	    },
	    {
	      "category": "Graphics.Memory.Driver",
	      "metric": [{
	          "name": "AvgDriverMemUsagePerScope",
	          "description": "Average memory usage by driver per allocation scope in bytes",
	          "queries": [{
	            "query": "SELECT REPLACE([DRIVER_MEM_TRACK_IDS].name, 'vulkan.mem.driver.scope.', '') AS scope, CAST(AVG(counter.value) AS INT) AS avg_mem_driver_bytes FROM counter LEFT JOIN [DRIVER_MEM_TRACK_IDS] WHERE counter.track_id = [DRIVER_MEM_TRACK_IDS].id GROUP BY counter.track_id"
	          }]
	        },
	        {
	          "name": "MaxDriverMemUsagePerScope",
	          "description": "Max memory usage by driver per allocation scope in bytes",
	          "queries": [{
	            "query": "SELECT REPLACE([DRIVER_MEM_TRACK_IDS].name, 'vulkan.mem.driver.scope.', '') AS scope, CAST (MAX(counter.value) AS INT) AS max_mem_driver_bytes FROM counter LEFT JOIN [DRIVER_MEM_TRACK_IDS] WHERE counter.track_id = [DRIVER_MEM_TRACK_IDS].id GROUP BY counter.track_id"
	          }]
	        }
	      ]
	    },
	    {
	      "category": "Graphics.Memory.GPU",
	      "metric": [{
	          "name": "AvgGPUMemAllocPerMemType",
	          "description": "Average GPU memory allocation per memory type",
	          "queries": [{
	            "query": "SELECT REPLACE(REPLACE([GPU_MEM_ALLOC_TRACK_IDS].name, 'vulkan.mem.device.memory.type.', ''), '.allocation', '') AS memory_type, CAST(AVG(counter.value) AS INT) AS avg_gpu_alloc_bytes FROM counter LEFT JOIN [GPU_MEM_ALLOC_TRACK_IDS] WHERE counter.track_id = [GPU_MEM_ALLOC_TRACK_IDS].id GROUP BY counter.track_id ORDER BY memory_type"
	          }]
	        },
	        {
	          "name": "MaxGPUMemAllocPerMemType",
	          "description": "Max GPU memory allocation per memory type",
	          "queries": [{
	            "query": "SELECT REPLACE(REPLACE([GPU_MEM_ALLOC_TRACK_IDS].name, 'vulkan.mem.device.memory.type.', ''), '.allocation', '') AS memory_type, CAST(MAX(counter.value) AS INT) AS max_gpu_alloc_bytes FROM counter LEFT JOIN [GPU_MEM_ALLOC_TRACK_IDS] WHERE counter.track_id = [GPU_MEM_ALLOC_TRACK_IDS].id GROUP BY counter.track_id ORDER BY memory_type"
	          }]
	        },
	        {
	          "name": "AvgGPUMemBindPerMemType",
	          "description": "Average GPU memory bound per memory type",
	          "queries": [{
	            "query": "SELECT REPLACE(REPLACE([GPU_MEM_BIND_TRACK_IDS].name, 'vulkan.mem.device.memory.type.', ''), '.bind', '') AS memory_type, CAST(AVG(counter.value) AS INT) AS avg_gpu_bound_bytes FROM counter LEFT JOIN [GPU_MEM_BIND_TRACK_IDS] WHERE counter.track_id = [GPU_MEM_BIND_TRACK_IDS].id GROUP BY counter.track_id ORDER BY memory_type"
	          }]
	        },
	        {
	          "name": "MaxGPUMemBindPerMemType",
	          "description": "Max GPU memory bound per memory type",
	          "queries": [{
	            "query": "SELECT REPLACE(REPLACE([GPU_MEM_BIND_TRACK_IDS].name, 'vulkan.mem.device.memory.type.', ''), '.bind', '') AS memory_type, CAST(MAX(counter.value) AS INT) AS max_gpu_bound_bytes FROM counter LEFT JOIN [GPU_MEM_BIND_TRACK_IDS] WHERE counter.track_id = [GPU_MEM_BIND_TRACK_IDS].id GROUP BY counter.track_id ORDER BY memory_type"
	          }]
	        }
	      ]
	    },
	    {
	      "category": "Graphics.Vulkan",
	      "metric": [{
	          "name": "NumCreateBufferEvents",
	          "description": "Number of create buffer events",
	          "queries": [{
	            "query": "SELECT COUNT(*) AS num_create_buffers FROM vulkan_memory_allocations WHERE source = 'GPU_BUFFER' AND operation = 'CREATE'"
	          }]
	        },
	        {
	          "name": "NumBindBufferEvents",
	          "description": "Number of bind buffer events",
	          "queries": [{
	            "query": "SELECT COUNT(*) AS num_bind_buffers FROM vulkan_memory_allocations WHERE source = 'GPU_BUFFER' AND operation = 'BIND'"
	          }]
	        },
	        {
	          "name": "SumBoundBuffersPerMemoryType",
	          "description": "Sum of bound buffer sizes per memory type in bytes",
	          "queries": [{
	            "query": "SELECT memory_type, SUM(memory_size) AS bound_buffers_in_bytes FROM vulkan_memory_allocations WHERE source = 'GPU_BUFFER' AND operation = 'BIND' GROUP BY memory_type"
	          }]
	        },
	        {
	          "name": "NumCreateImageEvents",
	          "description": "Number of create image events",
	          "queries": [{
	            "query": "SELECT COUNT(*) AS num_create_images FROM vulkan_memory_allocations WHERE source = 'GPU_IMAGE' AND operation = 'CREATE'"
	          }]
	        },
	        {
	          "name": "NumBindImageEvents",
	          "description": "Number of bind image events",
	          "queries": [{
	            "query": "SELECT COUNT(*) AS num_bind_images FROM vulkan_memory_allocations WHERE source = 'GPU_IMAGE' AND operation = 'BIND'"
	          }]
	        },
	        {
	          "name": "SumBoundImagesPerMemoryType",
	          "description": "Sum of bound image sizes per memory type in bytes",
	          "queries": [{
	            "query": "SELECT memory_type, SUM(memory_size) AS bound_images_in_bytes FROM vulkan_memory_allocations WHERE source = 'GPU_IMAGE' AND operation = 'BIND' GROUP BY memory_type"
	          }]
	        }
	      ]
	    }
	  ]
	}`
	return metricsJsonString
}


text:
using System;
using System.IO;
using System.Collections.Generic;

namespace SetIntersection
{
    class SetIntersection
    {
        static void Main(string[] args)
        {
            try
            {
                using (FileStream stream = File.Open(args[0], FileMode.Open))
                using (StreamReader reader = new StreamReader(stream))
                {
                    int[] nums;
                    String result = "";
                    HashSet<int> set1 = new HashSet<int>();
                    HashSet<int> set2 = new HashSet<int>();
                    HashSet<int> set3 = new HashSet<int>();
                    String line = reader.ReadLine();
                    while (line != null)
                    {
                        String[] tokens = line.Split(';');
                        String[] values1 = tokens[0].Split(',');
                        String[] values2 = tokens[1].Split(',');
                        foreach (String s in values1)
                        {
                            set1.Add(int.Parse(s));
                        }
                        foreach (String s in values2)
                        {
                            set2.Add(int.Parse(s));
                        }
                        foreach (int val in set1)
                        {
                            if (set2.Contains(val))
                            {
                                set3.Add(val);
                            }
                        }
                        set3.CopyTo(nums = new int[set3.Count], 0, set3.Count);
                        result = String.Join(",", nums);
                        Console.WriteLine(result);

                        result = "";
                        set1.Clear();
                        set2.Clear();
                        set3.Clear();
                        line = reader.ReadLine();
                    }
                }
            }
            catch (FileNotFoundException ex)
            {
                Console.WriteLine(ex.StackTrace);
            }
        }
    }
}


text:
extern "C" {
    fn regular_in_block();
}

const extern "C" fn bar() {
    unsafe {
        regular_in_block();
        //~^ ERROR: calls in constant functions
    }
}

extern "C" fn regular() {}

const extern "C" fn foo() {
    unsafe {
        regular();
        //~^ ERROR: calls in constant functions
    }
}

fn main() {}


text:
local List = require 'pl.List'
local utils = require 'pl.utils'
local path = require 'pl.path'
local stringx = require 'pl.stringx'
local template = require 'pl.template'
local tablex = require 'pl.tablex'
local OrderedMap = require 'pl.OrderedMap'
local tools = require 'ldoc.tools'
local markup = require 'ldoc.markup'
local prettify = require 'ldoc.prettify'
local doc = require 'ldoc.doc'
local unpack = utils.unpack
local html = {}

local quit = utils.quit

local function cleanup_whitespaces(text)
   local lines = stringx.splitlines(text)
   for i = 1, #lines do
      lines[i] = stringx.rstrip(lines[i])
   end
   lines[#lines + 1] = "" -- Little trick: file should end with newline
   return table.concat(lines, "\n")
end

local function get_module_info(m)
   local info = OrderedMap()
   for tag in doc.module_info_tags() do
      local val = m.tags[tag]
      if type(val)=='table' then
         val = table.concat(val,',')
      end
      tag = stringx.title(tag)
      info:set(tag,val)
   end
   if #info:keys() > 0 then
      return info
   end
end

local escape_table = { ["'"] = "'", ["\""] = """, ["<"] = "<", [">"] = ">", ["&"] = "&" }

function html.generate_output(ldoc, args, project)
   local check_directory, check_file, writefile = tools.check_directory, tools.check_file, tools.writefile
   local original_ldoc

   local function save_and_set_ldoc (set)
      if not set then return end
      if not original_ldoc then
         original_ldoc = tablex.copy(ldoc)
      end
      for s in set:iter() do
         local var,val = s:match('([^=]+)=(.+)')
         local num = tonumber(val)
         if num then val = num
         elseif val == 'true' then val = true
         elseif val == 'false' then val = false
         end
         print('setting',var,val)
         ldoc[var] = val
      end
   end

   local function restore_ldoc ()
      if original_ldoc then
         ldoc = original_ldoc
      end
   end

   function ldoc.escape(str)
      return (str:gsub("['&<>\"]", escape_table))
   end

   function ldoc.prettify(str)
      return prettify.code('lua','usage',str,0,false)
   end

   -- Item descriptions come from combining the summary and description fields
   function ldoc.descript(item)
      return tools.join(' ', item.summary, item.description)
   end

   function ldoc.module_name (mod)
      local name = mod.name
      if args.unqualified and (mod.type == 'module' or mod.type == 'classmod') then -- leave out package
         name = name:gsub('^.-%.','')
      elseif mod.type == 'topic' then
         if mod.display_name then
            name = mod.display_name
         else -- leave out md extension
            name = name:gsub('%..*$','')
         end
      end
      return name
   end

   -- this generates the internal module/function references
   function ldoc.href(see)
      if see.href then -- explict reference, e.g. to Lua manual
         return see.href
      elseif doc.Module:class_of(see) then
         return ldoc.ref_to_module(see)
      else
         return ldoc.ref_to_module(see.mod)..'#'..see.name
      end
   end

   -- this is either called from the 'root' (index or single module) or
   -- from the 'modules' etc directories. If we are in one of those directories,
   -- then linking to another kind is `../kind/name`; to the same kind is just `name`.
   -- If we are in the root, then it is `kind/name`.
   function ldoc.ref_to_module (mod)
      local base = "" -- default: same directory
      mod = mod or ldoc.module
      local kind, module = mod.kind, ldoc.module
      local name = mod.name -- default: name of module
      if not ldoc.single then
         if module then -- we are in kind/
            if module.type ~= type then -- cross ref to ../kind/
               base = "../"..kind.."/"
            end
         else -- we are in root: index
            base = kind..'/'
         end
      else -- single module
         if mod == ldoc.single then
            name = ldoc.output
            if not ldoc.root then base = '../' end
         elseif ldoc.root then -- ref to other kinds (like examples)
            base = kind..'/'
         else
            if module.type ~= type then -- cross ref to ../kind/
               base = "../"..kind.."/"
            end
         end
      end
      return base..name..'.html'
   end

   function ldoc.include_file (file)
      local text,_ = utils.readfile(file)
      if not text then quit("unable to include "..file)
      else
         return text
      end
   end

-- these references are never from the index...?
function ldoc.source_ref (fun)
      local modname = fun.module.name
      local pack,name = tools.split_dotted_name(modname)
      if not pack then
         name = modname
      end
      return (ldoc.single and "" or "../").."source/"..name..'.lua.html#'..fun.lineno
   end

   function ldoc.use_li(ls)
      if #ls > 1 then return '
','
' else return '','' end
   end

   function ldoc.default_display_name(item)
      -- Project-level items:
      if doc.project_level(item.type) then
        return ldoc.module_name(item)
      end
      -- Module-level items:
      local name = item.display_name or item.name
      if item.type == 'function' or item.type == 'lfunction' then
         if not ldoc.no_space_before_args then
            name = name..' '
         end
         return name..item.args
      else
         return name
      end
   end

   function ldoc.display_name(item)
      if ldoc.custom_display_name_handler then
        return ldoc.custom_display_name_handler(item, ldoc.default_display_name)
      else
        return ldoc.default_display_name(item)
      end
   end

   function ldoc.no_spaces(s)
      s = s:gsub('%s*$','')
      return (s:gsub('%W','_'))
   end

   function ldoc.module_typename(m)
      return doc.presentation_name(m.type)
   end

   function ldoc.is_list (t)
      return type(t) == 'table' and t.append
   end

   function ldoc.strip_header (s)
      if not s then return s end
      return s:gsub('^%s*#+%s+','')
   end

   function ldoc.typename (tp)
      if not tp or tp == '' or tp:match '^@' then return '' end
      local optional
      -- ?<type> is short for ?nil|<type>
      if tp:match("^%?") and not tp:match '|' then
         tp = '?|'..tp:sub(2)
      end
      local tp2 = tp:match("%?|?(.*)")
      if tp2 then
         optional = true
         tp = tp2
      end

      local types = {}
      for name in tp:gmatch("[^|]+") do
         local sym = name:match '([%w%.%:]+)'
         local ref,_ = markup.process_reference(sym,true)
         if ref then
            if ref.label and sym == name then
               name = ref.label
            end
            types[#types+1] = ('%s'):format(ldoc.href(ref),name)
         else
            types[#types+1] = ''..name..''
         end
      end
      local names = table.concat(types, ", ", 1, math.max(#types-1, 1))
      if #types > 1 then names = names.." or "..types[#types] end
      if optional then
         if names ~= '' then
            if #types == 1 then names = "optional "..names end
         else
            names = "optional"
        end
      end
      return names
   end

   -- the somewhat tangled logic that controls whether a type appears in the
   -- navigation sidebar. (At least it's no longer in the template ;))
   function ldoc.allowed_in_contents(type,module)
      local allowed = true
      if ldoc.kinds_allowed then
         allowed = ldoc.kinds_allowed[type]
      elseif ldoc.prettify_files and type == 'file' then
         allowed = ldoc.prettify_files == 'show' or (module and module.type == 'file')
      end
      return allowed
   end

   local function set_charset (ldoc,m)
      m = m or ldoc.module
      ldoc.doc_charset = (m and m.tags.charset) or ldoc.charset
   end

   local module_template,_ = utils.readfile (path.join(args.template,ldoc.templ))
   if not module_template then
      quit("template not found at '"..args.template.."' Use -l to specify directory containing ldoc.ltp")
   end

   -- Runs a template on a module to generate HTML page.
   local function templatize(template_str, ldoc, module)
      local out, err = template.substitute(template_str, {
         ldoc = ldoc,
         module = module,
         _escape = ldoc.template_escape
      })
      if not out then
         quit(("template failed for %s: %s"):format(
               module and module.name or ldoc.output or "index",
               err))
      end
      if ldoc.postprocess_html then
         out = ldoc.postprocess_html(out, module)
      end
      return cleanup_whitespaces(out)
   end

   local css, custom_css = ldoc.css, ldoc.custom_css
   ldoc.output = args.output
   ldoc.ipairs = ipairs
   ldoc.pairs = pairs
   ldoc.print = print

   -- Bang out the index.
   -- in single mode there is one module and the 'index' is the
   -- documentation for that module.
   ldoc.module = ldoc.single
   if ldoc.single and args.one then
      ldoc.kinds_allowed = {module = true, topic = true}
      ldoc.one = true
   end
   ldoc.root = true
   if ldoc.module then
      ldoc.module.info = get_module_info(ldoc.module)
      ldoc.module.ldoc = ldoc
      save_and_set_ldoc(ldoc.module.tags.set)
   end
   set_charset(ldoc)
   local out = templatize(module_template, ldoc, ldoc.module)
   ldoc.root = false
   restore_ldoc()

   check_directory(args.dir) -- make sure output directory is ok

   -- project icon
   if ldoc.icon then
      local dir_data = args.dir .. '/data'
      if not path.isdir(dir_data) then
          -- luacheck: push ignore lfs
          lfs.mkdir(dir_data)
          -- luacheck: pop
      end
      local file = require 'pl.file'
      file.copy(ldoc.icon, dir_data)
   end

   args.dir = args.dir .. path.sep

   if css then -- has CSS been copied?
      check_file(args.dir..css, path.join(args.style,css))
   end

   if custom_css then -- has custom CSS been copied?
      check_file(args.dir..custom_css, custom_css)
   end

   -- write out the module index
   out = cleanup_whitespaces(out)
   writefile(args.dir..args.output..args.ext,out)

   -- in single mode, we exclude any modules since the module has been done;
   -- ext step is then only for putting out any examples or topics
   local mods = List()
   for kind, modules in project() do
      local lkind = kind:lower()
      if not ldoc.single or ldoc.single and lkind ~= 'modules' then
         mods:append {kind, lkind, modules}
      end
   end

   -- write out the per-module documentation
   -- note that we reset the internal ordering of the 'kinds' so that
   -- e.g. when reading a topic the other Topics will be listed first.
   if css then
      ldoc.css = '../'..css
   end
   if custom_css then
      ldoc.custom_css = '../'..custom_css
   end
   for m in mods:iter() do
      local kind, lkind, modules = unpack(m)
      check_directory(args.dir..lkind)
      project:put_kind_first(kind)
      for m in modules() do
         ldoc.module = m
         ldoc.body = m.body
         m.ldoc = ldoc
         if m.tags.set then
            save_and_set_ldoc(m.tags.set)
         end
         set_charset(ldoc)
         m.info = get_module_info(m)
         if ldoc.body and m.postprocess then
            ldoc.body = m.postprocess(ldoc.body)
         end
         local out = templatize(module_template, ldoc, m)
         writefile(args.dir..lkind..'/'..m.name..args.ext,out)
         restore_ldoc()
      end
   end
   if not args.quiet then print('output written to '..tools.abspath(args.dir)) end
end

return html


text:
angular.module('uixApp')
  .controller('GroupPositionIndexCtrl', function ($scope, $rootScope, APP, $http, exMsg) {

    $scope.$on('uix:index-ready', function (evt, modelName, config, scope) {
      if (modelName !== 'GroupPosition') return;
      // Do something
    });
  });

angular.module('uixApp')
  .controller('GroupPositionFormCtrl', function ($scope, $rootScope, APP, $http, exMsg) {

    $scope.$on('uix:form-ready', function (evt, modelName, config, scope) {
      if (modelName !== 'GroupPosition') return;
      // Do something
    });

    $scope.$on('uix:record-loaded', function (evt, modelName, record, scope) {
      if (modelName !== 'GroupPosition') return;
      // Do something
    });
  });

angular.module('uixApp')
  .run(function (fieldService) {
    // Set config for angular-formly
    fieldService.set('group_position', fieldConfig());

    function fieldConfig () {
      return [
        {
          "fieldGroup": [
            {
              "className": "col-xs-6",
              "key": "name",
              "type": "ex-input",
              "templateOptions": {
                "required": true,
                "label": "Name"
              }
            }
          ]
        }
      ];
    }
  });

angular.module('uixApp')
  .run(function (schemaService) {
    // Set config for json-schema
    schemaService.set('group_position', schemaConfig());

    function schemaConfig () {
      return {
        "type": "object",
        "title": "Group Position",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "key": "name",
            "title": "Name",
            "type": "string",
            "format": "text"
          }
        }
      };
    }
  });


text:
#region -- License Terms --
//
// MessagePack for CLI
//
// Copyright (C) 2010-2016 FUJIWARA, Yusuke
//
//    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.
//
#endregion -- License Terms --

using System;
using System.Collections;
#if FEATURE_TAP
using System.Threading;
using System.Threading.Tasks;
#endif // FEATURE_TAP

namespace MsgPack.Serialization.DefaultSerializers
{
	// ReSharper disable once InconsistentNaming
	[Preserve( AllMembers = true )]
	internal sealed class System_Collections_DictionaryEntryMessagePackSerializer : MessagePackSerializer<DictionaryEntry>
	{
		public System_Collections_DictionaryEntryMessagePackSerializer( SerializationContext ownerContext )
			: base( ownerContext, SerializerCapabilities.PackTo | SerializerCapabilities.UnpackFrom ) { }

		[System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Design", "CA1062:ValidateArgumentsOfPublicMethods", MessageId = "0", Justification = "Validated internally" )]
		protected internal override void PackToCore( Packer packer, DictionaryEntry objectTree )
		{
			packer.PackArrayHeader( 2 );
			EnsureMessagePackObject( objectTree.Key ).PackToMessage( packer, null );
			EnsureMessagePackObject( objectTree.Value ).PackToMessage( packer, null );
		}

		private static MessagePackObject EnsureMessagePackObject( object obj )
		{
			if ( obj == null )
			{
				return MessagePackObject.Nil;
			}

			if ( !( obj is MessagePackObject ) )
			{
				throw new NotSupportedException( "Only MessagePackObject Key/Value is supported." );
			}

			return ( MessagePackObject )obj;
		}

		[System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Design", "CA1062:ValidateArgumentsOfPublicMethods", MessageId = "0", Justification = "Validated internally" )]
		protected internal override DictionaryEntry UnpackFromCore( Unpacker unpacker )
		{
			if ( unpacker.IsArrayHeader )
			{
				MessagePackObject key;
				MessagePackObject value;

				if ( !unpacker.ReadObject( out key ) )
				{
					SerializationExceptions.ThrowUnexpectedEndOfStream( unpacker );
				}

				if ( !unpacker.ReadObject( out value ) )
				{
					SerializationExceptions.ThrowUnexpectedEndOfStream( unpacker );
				}

				return new DictionaryEntry( key, value );
			}
			else
			{
				// Previous DictionaryEntry serializer accidentally pack it as map...
				MessagePackObject key = default( MessagePackObject );
				MessagePackObject value = default( MessagePackObject );
				bool isKeyFound = false;
				bool isValueFound = false;
				string propertyName;

				while ( ( !isKeyFound || !isValueFound ) && unpacker.ReadString( out propertyName ) )
				{
					switch ( propertyName )
					{
						case "Key":
						{
							if ( !unpacker.ReadObject( out key ) )
							{
								SerializationExceptions.ThrowUnexpectedEndOfStream( unpacker );
							}

							isKeyFound = true;
							break;
						}
						case "Value":
						{
							if ( !unpacker.ReadObject( out value ) )
							{
								SerializationExceptions.ThrowUnexpectedEndOfStream( unpacker );
							}

							isValueFound = true;
							break;
						}
					}
				}

				if ( !isKeyFound )
				{
					SerializationExceptions.ThrowMissingProperty( "Key" );
				}

				if ( !isValueFound )
				{
					SerializationExceptions.ThrowMissingProperty( "Value" );
				}

				return new DictionaryEntry( key, value );
			}
		}

#if FEATURE_TAP

		protected internal override async Task PackToAsyncCore( Packer packer, DictionaryEntry objectTree, CancellationToken cancellationToken )
		{
			await packer.PackArrayHeaderAsync( 2, cancellationToken ).ConfigureAwait( false );
			await EnsureMessagePackObject( objectTree.Key ).PackToMessageAsync( packer, null, cancellationToken ).ConfigureAwait( false );
			await EnsureMessagePackObject( objectTree.Value ).PackToMessageAsync( packer, null, cancellationToken ).ConfigureAwait( false );
		}

		protected internal override async Task<DictionaryEntry> UnpackFromAsyncCore( Unpacker unpacker, CancellationToken cancellationToken )
		{
			if ( unpacker.IsArrayHeader )
			{
				var key = await unpacker.ReadObjectAsync( cancellationToken ).ConfigureAwait( false );
				if ( !key.Success )
				{
					SerializationExceptions.ThrowUnexpectedEndOfStream( unpacker );
				}

				var value = await unpacker.ReadObjectAsync( cancellationToken ).ConfigureAwait( false );
				if ( !value.Success )
				{
					SerializationExceptions.ThrowUnexpectedEndOfStream( unpacker );
				}

				return new DictionaryEntry( key.Value, value.Value );
			}
			else
			{
				// Previous DictionaryEntry serializer accidentally pack it as map...
				AsyncReadResult<MessagePackObject> key = default( AsyncReadResult<MessagePackObject> );
				AsyncReadResult<MessagePackObject> value = default( AsyncReadResult<MessagePackObject> );

				for ( var propertyName = await unpacker.ReadStringAsync( cancellationToken ).ConfigureAwait( false );
					( !key.Success || !value.Success ) && propertyName.Success;
					propertyName = await unpacker.ReadStringAsync( cancellationToken ).ConfigureAwait( false ) )
				{
					switch ( propertyName.Value )
					{
						case "Key":
						{
							key = await unpacker.ReadObjectAsync( cancellationToken ).ConfigureAwait( false );
							if ( !key.Success )
							{
								SerializationExceptions.ThrowUnexpectedEndOfStream( unpacker );
							}

							break;
						}
						case "Value":
						{
							value = await unpacker.ReadObjectAsync( cancellationToken ).ConfigureAwait( false );
							if ( !value.Success )
							{
								SerializationExceptions.ThrowUnexpectedEndOfStream( unpacker );
							}

							break;
						}
					}
				}

				if ( !key.Success )
				{
					SerializationExceptions.ThrowMissingProperty( "Key" );
				}

				if ( !value.Success )
				{
					SerializationExceptions.ThrowMissingProperty( "Value" );
				}

				return new DictionaryEntry( key.Value, value.Value );
			}
		}

#endif // FEATURE_TAP

	}
}


text:
<component name="ProjectDictionaryState">
  <dictionary name="cwales" />
</component>


text:
@import 'normalize.css';

@import 'basscss-type-scale';
@import 'basscss-typography';
@import 'basscss-layout';
@import 'basscss-align';
@import 'basscss-margin';
@import 'basscss-padding';
@import 'basscss-grid';
@import 'basscss-flexbox';
@import 'basscss-position';
@import 'basscss-border';
@import 'basscss-hide';

@import 'basscss-addons/modules/responsive-margin';
@import 'basscss-addons/modules/responsive-padding';
@import 'basscss-addons/modules/media-object';
@import 'basscss-addons/modules/all';
@import 'basscss-addons/modules/forms';
@import 'basscss-addons/modules/input-range';
@import 'basscss-addons/modules/progress';
@import 'basscss-addons/modules/btn';
@import 'basscss-addons/modules/btn-primary';
@import 'basscss-addons/modules/btn-outline';
@import 'basscss-addons/modules/btn-sizes';
@import 'basscss-addons/modules/colors';
@import 'basscss-addons/modules/background-colors';
@import 'basscss-addons/modules/border-colors';
@import 'basscss-addons/modules/darken';
@import 'basscss-addons/modules/lighten';
@import 'basscss-addons/modules/background-images';

@custom-media --breakpoint-sm (min-width: 40em);
@custom-media --breakpoint-md (min-width: 52em);
@custom-media --breakpoint-lg (min-width: 64em);

:root {
  --h1: 2rem;
  --h2: 1.5rem;
  --h3: 1.25rem;
  --h4: 1rem;
  --h5: .875rem;
  --h6: .75rem;
  --bold-font-weight: bold;
  --space-1: .5rem;
  --space-2: 1rem;
  --space-3: 2rem;
  --space-4: 4rem;
  --border-width: 1px;
  --border-radius: 3px;
}


text:
package com.brilapps.etl.source;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

import org.apache.log4j.Logger;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;

import com.brilapps.etl.ETLUtil;
import com.brilapps.etl.target.CostTypeReferenceTable;

public class CostTypeReferenceTableExtractor {
	static Logger logger = Logger.getLogger(CostTypeReferenceTableExtractor.class);

	/**
	 * Generate target Project Definition file from the source file.
	 *
	 * @param sourceProjectDefinitionFile
	 *            source file from which target will be generated.
	 * @param destinationProjectDefinitionFile
	 *            destination file to which target file will be generated.
	 * @throws Exception
	 */
	public void extractCostTypeRefereceTable(final File sourceFileRefereceTable)
			throws Exception {
		logger.debug(" entering extractCostTypeRefereceTable() ");
		try {
			// File input stream to read source project definition file.
			FileInputStream fileInputStream = new FileInputStream(sourceFileRefereceTable);
			// Create Workbook instance holding reference to excel file
			Workbook sourceRefereceTableWorkbook = null;
			if (sourceFileRefereceTable.getName().endsWith(".xls")) {
				sourceRefereceTableWorkbook = new HSSFWorkbook(fileInputStream);
			} else {
				sourceRefereceTableWorkbook = new XSSFWorkbook(fileInputStream);
			}
			// Create sheet in source project definition work book.
			Sheet sourceRefereceTableSheet = sourceRefereceTableWorkbook
					.getSheetAt(1);
			validateColumnHeaders(sourceRefereceTableSheet);

			int colNum = 0;
			Map<String, Integer> pdReferenceTableColumnIndexMap = new HashMap<String, Integer>();
			for (String header : getColumnHeaders(sourceRefereceTableSheet)) {
				pdReferenceTableColumnIndexMap.put(header, colNum);
				colNum++;
			}

			Iterator<Row> iterator = sourceRefereceTableSheet.iterator();
			// iterate header row first and process remaining rows.
			iterator.next();
			while (iterator.hasNext()) {
				Row currentRow = iterator.next();
				String costType = "";
				CostTypeReferenceTable costTypeReferenceTable = new CostTypeReferenceTable();
				for (Map.Entry<String, Integer> entry : pdReferenceTableColumnIndexMap.entrySet()) {
					int columnIndex = pdReferenceTableColumnIndexMap.get(entry.getKey());
					if (CostTypeReferenceTableColumnHeaders.COST_TYPE.getColumnHeader()
							.equals(entry.getKey())) {
						costType = ETLUtil.getCellValueAsString(currentRow.getCell(columnIndex), logger);
						costTypeReferenceTable.setCostType(costType);
					} else if (CostTypeReferenceTableColumnHeaders.COST_TYPE_DESCRIPTION.getColumnHeader()
							.equals(entry.getKey())) {
						costTypeReferenceTable
						.setCostTypeDescription(
								ETLUtil.getCellValueAsString(currentRow.getCell(columnIndex), logger));
					} else if (CostTypeReferenceTableColumnHeaders.COST_TYPE_ACTUAL_DESCRIPTION.getColumnHeader()
							.equals(entry.getKey())) {
						costTypeReferenceTable
						.setCostTypeActualDescription(
								ETLUtil.getCellValueAsString(currentRow.getCell(columnIndex), logger));
					}
				}
				ETLUtil.getCostTypeReferenceTableByCostType().put(costType, costTypeReferenceTable);
			}

			fileInputStream.close();
		} catch (FileNotFoundException e) {
			logger.error(" in extractCostTypeRefereceTable() ", e);
			throw new Exception(e);
		} catch (IOException e) {
			logger.error(" in extractCostTypeRefereceTable() ", e);
			throw new Exception(e);
		}
		logger.debug(" exiting extractCostTypeRefereceTable() ");
	}

	public ArrayList<String> validateColumnHeaders(final Sheet sheet) {
		ArrayList<String> headers = getColumnHeaders(sheet);
		CostTypeReferenceTableColumnHeaders[] costTypeReferenceTableColumnHeaders = CostTypeReferenceTableColumnHeaders
				.values();
		for (CostTypeReferenceTableColumnHeaders costTypeReferenceTableColumnHeader : costTypeReferenceTableColumnHeaders) {
			if (!headers.contains(costTypeReferenceTableColumnHeader.getColumnHeader())) {
				logger.error(CostTypeReferenceTableExtractor.class,
						new Exception("Column " + costTypeReferenceTableColumnHeader.getColumnHeader()
						+ " missing in source Reference Table."));
			}
		}
		return headers;
	}

	public ArrayList<String> getColumnHeaders(final Sheet sheet) {
		logger.debug(" entering getColumnHeaders() ");
		ArrayList<String> headers = new ArrayList<String>();
		Iterator<Row> iterator = sheet.iterator();
		while (iterator.hasNext()) {
			Row currentRow = iterator.next();
			Iterator<Cell> cellIterator = currentRow.iterator();
			while (cellIterator.hasNext()) {
				Cell currentCell = cellIterator.next();
				headers.add(ETLUtil.getCellValueAsString(currentCell, logger));
			}
			break;
		}
		logger.debug(" exiting getColumnHeaders() ");
		return headers;
	}
}


text:
#include <mrpt/hwdrivers.h>  // Precompiled headers

#include <mrpt/hwdrivers/CWirelessPower.h>

using namespace mrpt::hwdrivers;

IMPLEMENTS_GENERIC_SENSOR(CWirelessPower,mrpt::hwdrivers)

CWirelessPower::CWirelessPower()
{
	m_sensorLabel = "WIRELESS_POWER";
}

#ifdef MRPT_OS_LINUX
#include <iostream>
#include <sstream>
#endif

#ifdef MRPT_OS_WINDOWS
	#  if defined(__GNUC__)
		// MinGW: Nothing to do here (yet)
	# else

#include <windows.h>
#include <wlanapi.h>
#include <objbase.h>
#include <wtypes.h>
#pragma comment(lib, "Wlanapi.lib")

	#endif

#endif

using namespace mrpt::utils;

#ifdef MRPT_OS_WINDOWS
	#  if defined(__GNUC__)
		// MinGW: Nothing to do here (yet)
	# else
/*---------------------------------------------------------------
					ConnectWlanServerW
   Get a connection to the WLAN server
 ---------------------------------------------------------------*/

		/** Gets a connection to the server
		 * \exception std::exception In case there is a failure (happens when WiFi is not started)
		 */

void*	ConnectWlanServerW()
{
	DWORD dwMaxClient = 2;
    DWORD dwCurVersion = 0;
	DWORD dwResult = 0;			// Result of the API call
	HANDLE hClient;
	// open connection to server
    dwResult = WlanOpenHandle(dwMaxClient, NULL, &dwCurVersion, &hClient);
    if (dwResult != ERROR_SUCCESS) {
		// if an error ocurred
		std::stringstream excmsg;
		excmsg << "WlanOpenHandle failed with error: " << dwResult << std::endl;

        // You can use FormatMessage here to find out why the function failed
		THROW_EXCEPTION(excmsg.str());
    }
	return (void*)hClient;
}

/*---------------------------------------------------------------
					ListInterfacesW
   Gets a list of the interfaces (Windows)
 ---------------------------------------------------------------*/

		/** Gets a list of the interfaces available in the system (in Windows format)
		 * \exception std::exception In case there is a failure
		 * \return std::vector returns handles to the available interfaces
		 */

std::vector<PWLAN_INTERFACE_INFO>	ListInterfacesW(HANDLE hClient)
{
	// Get a list of the available interfaces

	std::vector<PWLAN_INTERFACE_INFO> outputVector;			// start the output vector
	PWLAN_INTERFACE_INFO_LIST pIfList = NULL;				// list of WLAN interfaces
    PWLAN_INTERFACE_INFO pIfInfo = NULL;					// information element for one interface
	DWORD dwResult = 0;

	int i;

	// Call the interface enumeration function of the API
	dwResult = WlanEnumInterfaces(hClient, NULL, &pIfList);

	// check result
    if (dwResult != ERROR_SUCCESS) {
		// In case of error, raise an exception
		std::stringstream excmsg;
		excmsg << "WlanEnumInterfaces failed with error: " << dwResult << std::endl;

		THROW_EXCEPTION(excmsg.str());
        // You can use FormatMessage here to find out why the function failed
    } else {
		// iterate throught interfaces to add them to the output vector
		for (i = 0; i < (int) pIfList->dwNumberOfItems; i++) {

            pIfInfo = (WLAN_INTERFACE_INFO *) &pIfList->InterfaceInfo[i];
			outputVector.push_back(pIfInfo);
		}
	}
	return outputVector;

}

/*---------------------------------------------------------------
					GUID2Str
   Gets the GUID of a network based on its handler in Windows
 ---------------------------------------------------------------*/
		/** Transforms a GUID structure (in Windows format) to a string
		 * \exception std::exception In case there is a failure
		 * \return std::string returns a string containing the GUID
		 */

std::string GUID2Str(GUID ifaceGuid)
{
	// Variables
	int iRet;
	errno_t wctostr;
	size_t sizeGUID;

	WCHAR GuidString[39] = {0};
	char GuidChar[100];

	std::string outputString;

	// Call the API function that gets the name of the GUID as a WCHAR[]
    iRet = StringFromGUID2(ifaceGuid, (LPOLESTR) &GuidString, sizeof(GuidString)/sizeof(*GuidString));
            // For c rather than C++ source code, the above line needs to be
            // iRet = StringFromGUID2(&pIfInfo->InterfaceGuid, (LPOLESTR) &GuidString,
            //     sizeof(GuidString)/sizeof(*GuidString));

	// translate from a WCHAR to string if no error happened
	if (iRet == 0){
		THROW_EXCEPTION("StringFromGUID2 failed\n");
	}	else {
		wctostr = wcstombs_s(&sizeGUID, GuidChar, 100, GuidString, 100 );
		if ( (wctostr == EINVAL) || (wctostr == ERANGE) ){
			THROW_EXCEPTION("wcstombs_s failed\n");
		} else {
			outputString = std::string(GuidChar);
		}
	}

	return outputString;
}

/*---------------------------------------------------------------
					GetInterfaceW
   Gets a handler for the interface (Windows)
 ---------------------------------------------------------------*/

		/** Gets a handle to the interface that has been set by setNet() (in Windows format)
		 * \exception std::exception In case there is a failure
		 * \return PWLAN_INTERFACE_INFO returns a handle to the interface
		 */

PWLAN_INTERFACE_INFO GetInterfaceW(std::string guid, HANDLE hClient)
{
	// Get interface given the GUID as a string (by the guid property of the object)

	std::vector<PWLAN_INTERFACE_INFO> ifaceList;						// interface list
	std::vector<PWLAN_INTERFACE_INFO>::iterator ifaceIter;				// iterator
	PWLAN_INTERFACE_INFO output = NULL;									// interface info element

	// get a list of all the interfaces
	ifaceList = ListInterfacesW(hClient);

	// search for the interface that has the given GUID
	for(ifaceIter = ifaceList.begin(); ifaceIter != ifaceList.end(); ifaceIter++){
		if (GUID2Str((*ifaceIter)->InterfaceGuid) == guid){
			output = *ifaceIter;
			break;
		}
	}

	return output;
}

/*---------------------------------------------------------------
					ListNetworksW
   Gets a list of the networks available for the interface (in Windows)
 ---------------------------------------------------------------*/

		/** Gets a list of the networks available for an interface (in Windows format)
		 * \exception std::exception In case there is a failure
		 * \return std::vector returns handles to the available networks of a given interface
		 * \param iface handle to the WiFi interface
		 */
std::vector<PWLAN_AVAILABLE_NETWORK>	ListNetworksW(PWLAN_INTERFACE_INFO iface, HANDLE hClient)
{
	// Start variables

	DWORD dwResult = 0;
    PWLAN_AVAILABLE_NETWORK_LIST pBssList = NULL;	// list of available networks
    PWLAN_AVAILABLE_NETWORK pBssEntry = NULL;		// information element for one interface

	GUID ifaceGuid = iface->InterfaceGuid;			// Get GUID of the interface

	std::vector<PWLAN_AVAILABLE_NETWORK> outputVector;	// output vector

	WCHAR GuidString[39] = {0};

	// Force a scan (to obtain new data)
	WLAN_RAW_DATA IeData;
	WlanScan((HANDLE)hClient, &ifaceGuid, NULL, &IeData, NULL);

	// Call the Windows API and get a list of the networks available through the interface
	dwResult = WlanGetAvailableNetworkList((HANDLE)hClient, &ifaceGuid, 0, NULL, &pBssList);

	// Check the result of the call
	if (dwResult != ERROR_SUCCESS) {
		// In case an error ocurred
		std::stringstream excmsg;
		excmsg << "WlanGetAvailableNetworkList failed with error: " << dwResult << std::endl;
	//	THROW_EXCEPTION(excmsg.str());
	} else {
		// for each network, get its info and save it
		for (unsigned int j = 0; j < pBssList->dwNumberOfItems; j++) {
			pBssEntry = (WLAN_AVAILABLE_NETWORK *) & pBssList->Network[j];	// get entry for network
			outputVector.push_back(pBssEntry);	// save entry
		}
	}

	return outputVector;
}

/*---------------------------------------------------------------
					GetNetworkW
   Gets a handler to a wireless network in Windows
 ---------------------------------------------------------------*/
/** Gets a handle to the network that has been set by setNet() (in Windows format)
		 * \exception std::exception In case there is a failure
		 * \return PWLAN_AVAILABLE_NETWORK returns a handle to the network
		 */
PWLAN_AVAILABLE_NETWORK GetNetworkW(HANDLE hClient, std::string ssid, std::string guid)
{
	// Variables
	PWLAN_INTERFACE_INFO iface;			// interface handler
	PWLAN_AVAILABLE_NETWORK output;		// output network handler

	// Get a handler to the interface
	iface = GetInterfaceW(guid, hClient);

	// Get the list of networks
	std::vector<PWLAN_AVAILABLE_NETWORK> pBssList = ListNetworksW(iface,hClient);

	// Iterate through the list and find the network that has the matching SSID
	std::vector<PWLAN_AVAILABLE_NETWORK>::iterator netIter;
	for(netIter = pBssList.begin(); netIter != pBssList.end() ; netIter++){
		if (std::string((char*)((*netIter)->dot11Ssid.ucSSID)) == ssid ){
			output = *netIter;
			break;
		}
	}

	return output;
}

	#endif

#endif // end of Windows auxiliary functions definition

/*---------------------------------------------------------------
					ListInterfaces
   Gets a list of the interfaces
 ---------------------------------------------------------------*/

std::vector<std::string>	CWirelessPower::ListInterfaces()
{

	std::vector<std::string> output;				// output vector of strings

#ifdef MRPT_OS_LINUX
	// in linux, the command line is used to get all the relevant information
	FILE *cmdoutput;                                // file handler for the executed command line
	char ifaceread[256],*netname;                   // strings used to read the output of the command line and get the name of each network

    // Run the command line: get the info frim /proc/net/wireless and cut out the names of the interfaces

	//commandl << "cat /proc/net/wireless|grep \"wlan\"|cut -d\" \" -f2|cut -d\":\" -f1";
	cmdoutput = popen("cat /proc/net/wireless|grep \"wlan\"|cut -d\" \" -f2|cut -d\":\" -f1","r");
	if (!fgets(ifaceread,3,cmdoutput))       // read output
		THROW_EXCEPTION("Error reading /proc/net/wireless")

	// iterate thrugh list and get each interface as a string
    netname = ::strtok(ifaceread,"\n");
	while(netname){
        output.push_back(std::string(netname));
        netname = ::strtok(NULL,"\n");
	}
#endif

#ifdef MRPT_OS_WINDOWS
	#  if defined(__GNUC__)
    THROW_EXCEPTION("Sorry, method not available for MinGW")
	# else
	// In windows, this function is a wrapper to ListInterfacesW

	std::vector<PWLAN_INTERFACE_INFO> ifaces;					// vector containing the interface entries (Windows format)
	std::vector<PWLAN_INTERFACE_INFO>::iterator ifacesIter;		// iterator to run through the previous list

	// get the list
	ifaces = ListInterfacesW(hClient);

	// iterate thrugh list and get each GUID as a string
	for (ifacesIter = ifaces.begin(); ifacesIter != ifaces.end() ; ifacesIter++){
		output.push_back(GUID2Str((*ifacesIter)->InterfaceGuid));
	}
	#endif
#endif

	return output;
}

/*---------------------------------------------------------------
					ListNetworks
   Gets a list of the networks available for the interface
 ---------------------------------------------------------------*/

std::vector<std::string>	CWirelessPower::ListNetworks()
{

	std::vector<std::string> output;							// output vector of strings

#ifdef MRPT_OS_LINUX

	std::stringstream commandl;             // command to be executed

	FILE *cmdoutput;
	char listread[1024];
	char *netname;

    // Run command: get a list of networks and cut out their names. Note: this must be done as a superuser, so the command is executed with sudo. Usually it should ask for the password only the first time.
    // To avoid the inconvenience of having to write the password, it would be useful to configure sudo to allow the user to run this command. See "man sudoers"
	commandl << "sudo iwlist " << "wlan0" << " scan|grep ESSID|cut -d\"\\\"\" -f2";
	cmdoutput = popen(commandl.str().c_str(),"r");
	if (!fgets(listread,3,cmdoutput))
		THROW_EXCEPTION("Error reading response from iwlist")

	netname = ::strtok(listread,"\n");
	while(netname){
        output.push_back(std::string(netname));
        netname = ::strtok(NULL,"\n");
	}

#endif

#ifdef MRPT_OS_WINDOWS
	#  if defined(__GNUC__)
    THROW_EXCEPTION("Sorry, method not available for MinGW")
	# else

	PWLAN_INTERFACE_INFO iface;			// Information element for an interface

	iface = GetInterfaceW(guid,(HANDLE)hClient);			// Get the interface handler

	// Get the list of networks
	std::vector<PWLAN_AVAILABLE_NETWORK> pBssList = ListNetworksW(iface,(HANDLE)hClient);

	// Iterate through the list and save the names as strings
	std::vector<PWLAN_AVAILABLE_NETWORK>::iterator netIter;
	for(netIter = pBssList.begin(); netIter != pBssList.end() ; netIter++){
		output.push_back( std::string((char*)((*netIter)->dot11Ssid.ucSSID)));
	}
	#endif

#endif

	return output;

}

/*---------------------------------------------------------------
					GetPower
   Gets the power of the network
 ---------------------------------------------------------------*/
int		CWirelessPower::GetPower()
{
#ifdef MRPT_OS_LINUX
    FILE *cmdoutput;
	char *powerReadL;
    std::stringstream commandl;
    // Run command: get the power of the networks and additional info
	commandl << "sudo iwlist " << "wlan0" << " scan";
	cmdoutput = popen(commandl.str().c_str(),"r");

	std::vector<std::string> powerReadV;
    size_t readBytes;

	powerReadL = (char *) malloc (256);
	std::stringstream ssidLine;

	ssidLine << "ESSID:\"" << ssid << "\"";
    if (getline(&powerReadL,&readBytes,cmdoutput)<0) THROW_EXCEPTION("Error reading response from iwlist")

    while(!strstr(powerReadL, ssidLine.str().c_str())){
        powerReadV.push_back(std::string(powerReadL));
        if (getline(&powerReadL,&readBytes,cmdoutput))
			THROW_EXCEPTION("Error reading response from iwlist")
	}

    std::vector<std::string>::iterator ssiter= powerReadV.end() - 2;

	char powerLine[256];

	// now we have a string per output line of iwlist. We must find the line containing the desired ESSID and read the power from two lines before

	strcpy(powerLine,(*ssiter).c_str());

    char level[10];
	// meaning that the ESSID was found
    // Example pf the value of poerLine: Quality=57/100  Signal level=57/100
    char *fraction;

    ::strtok(powerLine,"=");
    ::strtok(NULL,"=");
    fraction = ::strtok(NULL,"=");
    strcpy(level,::strtok(fraction,"/"));

    free(powerReadL);

    return atoi(level);

#endif

#ifdef MRPT_OS_WINDOWS
	#  if defined(__GNUC__)
     THROW_EXCEPTION("Sorry, method not available for MinGW")
	# else

	PWLAN_AVAILABLE_NETWORK wlan;	// handler to the network

	// Get a handler to the network
	wlan = GetNetworkW((HANDLE)hClient,ssid,guid);

	return wlan->wlanSignalQuality;
	#endif
#endif

}

/*---------------------------------------------------------------
					getObservation
    Get the power of a given network as an observation
	NOTE: Deprecated, use getObservations. Use this class as
	      GenericSensor. See the CGenericSensor documentation
 ---------------------------------------------------------------*/
bool CWirelessPower::getObservation( mrpt::slam::CObservationWirelessPower &outObservation )
{
	try{

	//	outObservation.m_readings.clear();
		outObservation.power = (float)GetPower();

		outObservation.timestamp = mrpt::system::getCurrentTime();

		outObservation.sensorLabel = m_sensorLabel;
	//	std::cout << "mrpt::hwdrivers::CWirelessPower::getObservation() " << "\n\tsensorLabel: " << outObservation.sensorLabel << "\n\ttimestamp: " << outObservation.timestamp << "\n\tpower: " << outObservation.power << std::endl;
		return true;
	}
	catch(exception &e)
	{
		cerr << "[CWirelessPower::getObservation] Returning false due to exception: " << endl;
		cerr << e.what() << endl;
		return false;
	}
}

void CWirelessPower::doProcess()
{

	// Wrapper to getObservation
	mrpt::slam::CObservationWirelessPowerPtr  outObservation = mrpt::slam::CObservationWirelessPower::Create();
	getObservation(*outObservation);

	appendObservation(CObservationWirelessPowerPtr(new CObservationWirelessPower(*outObservation)));

}

void  CWirelessPower::loadConfig_sensorSpecific(
	const mrpt::utils::CConfigFileBase &configSource,
	const std::string			&iniSection )
{
	MRPT_START
		pose_x = configSource.read_float(iniSection,"pose_x",0,true);
		pose_y = configSource.read_float(iniSection,"pose_y",0,true);
		pose_z = configSource.read_float(iniSection,"pose_z",0,true);
		pose_roll = configSource.read_float(iniSection,"pose_roll",0,true);
		pose_pitch = configSource.read_float(iniSection,"pose_pitch",0,true);
		pose_yaw = configSource.read_float(iniSection,"pose_yaw",0,true);

		ssid = configSource.read_string(iniSection,"ssid","",true);
		guid = configSource.read_string(iniSection,"guid","",true);   // in the case of Linux, the "GUID" is the interface name (wlanX)

		#ifdef MRPT_OS_WINDOWS
			#  if defined(__GNUC__)
			 THROW_EXCEPTION("Sorry, method not available for MinGW")
			# else
			hClient = ConnectWlanServerW();
			#endif
		#endif

	MRPT_END

}


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
null

#### Original name
Scleroderma sinnamariense Mont., 1840

### Remarks
null


text:
@import url(http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300);
@import "~font-awesome/css/font-awesome.css";
@import "~react-redux-toastr/lib/css/react-redux-toastr.min.css";

body {
    font-family: 'Source Sans Pro', sans-serif;
    font-weight: 300;
}

body ::-webkit-input-placeholder {
    /* WebKit browsers */
    font-family: 'Source Sans Pro', sans-serif;
    color: #fff;
    font-weight: 300;
}