text:
/*global module:false*/
module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({
    watch: {
      source: {
          spawn: false,
          debounceDelay: 1000,
          atBegin: true,
          files: ['src/**/*.js'],
          tasks: ['lint', 'build']
      }
    },
    eslint: {
      target: ['src/**/*.js'],
      options: {
        config: '.eslintrc'
      }
    },
    jscs: {
        src: ['src/**/*.js'],
        options: {
            config: '.jscsrc'
        }
    },
    csslint: {
      strict: {
        options: {
          import: 2
        },
        src: ['src/**/*.css']
      },
      lax: {
        options: {
          import: false
        },
        src: ['src/**/*.css']
      },
      options: {
        csslintrc: '.csslintrc'
      }
    },
    jsdoc2md: {
      separateOutputFilePerInput: {
        options: {
          index: true
        },
        files: [
            // core
            { src: 'src/LayoutContext.js', dest: 'docs/LayoutContext.md' },
            { src: 'src/LayoutController.js', dest: 'docs/LayoutController.md' },
            { src: 'src/ScrollController.js', dest: 'docs/ScrollController.md' },
            { src: 'src/FlexScrollView.js', dest: 'docs/FlexScrollView.md' },
            { src: 'src/LayoutUtility.js', dest: 'docs/LayoutUtility.md' },
            { src: 'src/VirtualViewSequence.js', dest: 'docs/VirtualViewSequence.md' },
            { src: 'src/AnimationController.js', dest: 'docs/AnimationController.md' },
            // widgets
            { src: 'src/widgets/DatePicker.js', dest: 'docs/widgets/DatePicker.md' },
            { src: 'src/widgets/TabBar.js', dest: 'docs/widgets/TabBar.md' },
            { src: 'src/widgets/TabBarController.js', dest: 'docs/widgets/TabBarController.md' },
            // helpers
            { src: 'src/helpers/LayoutDockHelper.js', dest: 'docs/helpers/LayoutDockHelper.md' },
            // layouts
            { src: 'src/layouts/CollectionLayout.js', dest: 'docs/layouts/CollectionLayout.md' },
            { src: 'src/layouts/GridLayout.js', dest: 'docs/layouts/GridLayout.md' },
            { src: 'src/layouts/ListLayout.js', dest: 'docs/layouts/ListLayout.md' },
            { src: 'src/layouts/HeaderFooterLayout.js', dest: 'docs/layouts/HeaderFooterLayout.md' },
            { src: 'src/layouts/NavBarLayout.js', dest: 'docs/layouts/NavBarLayout.md' },
            { src: 'src/layouts/WheelLayout.js', dest: 'docs/layouts/WheelLayout.md' },
            { src: 'src/layouts/ProportionalLayout.js', dest: 'docs/layouts/ProportionalLayout.md' },
            { src: 'src/layouts/TabBarLayout.js', dest: 'docs/layouts/TabBarLayout.md' }
        ]
      }
    },
    requirejs: {
      compile: {
        options: {
          baseUrl: '.',
          name: 'template.js',
          out: 'dist/famous-flex.js',
          paths: {
            'famous': 'empty:',
            'famous-flex': './src'
          },
          optimize: 'none'
        }
      }
    },
    browserify: {
      dist: {
        files: {
          './dist/famous-flex-global.js': ['./template-global.js']
        },
        options: {
          transform: ['browserify-shim']
        }
      }
    },
    uglify: {
      noglobal: {
        src: './dist/famous-flex.js',
        dest: './dist/famous-flex.min.js'
      },
      global: {
        src: './dist/famous-flex-global.js',
        dest: './dist/famous-flex-global.min.js'
      }
    },
    usebanner: {
      dist: {
        options: {
          position: 'top',
          banner:
            '/**\n' +
            '* This Source Code is licensed under the MIT license. If a copy of the\n' +
            '* MIT-license was not distributed with this file, You can obtain one at:\n' +
            '* http://opensource.org/licenses/mit-license.html.\n' +
            '*\n' +
            '* @author: Hein Rutjes (IjzerenHein)\n' +
            '* @license MIT\n' +
            '* @copyright Gloey Apps, 2014/2015\n' +
            '*\n' +
            '* @library famous-flex\n' +
            '* @version ' + grunt.file.readJSON('package.json').version + '\n' +
            '* @generated <%= grunt.template.today("dd-mm-yyyy") %>\n' +
            '*/'
        },
        files: {
          src: ['dist/*.js']
        }
      }
    }
  });

  // These plugins provide necessary tasks.
  grunt.loadNpmTasks('grunt-eslint');
  grunt.loadNpmTasks('grunt-jscs');
  grunt.loadNpmTasks('grunt-contrib-csslint');
  grunt.loadNpmTasks('grunt-jsdoc-to-markdown');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-contrib-requirejs');
  grunt.loadNpmTasks('grunt-browserify');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-banner');

  // Tasks
  grunt.registerTask('lint', ['eslint', 'jscs', 'csslint']);
  grunt.registerTask('doc', ['jsdoc2md']);
  grunt.registerTask('dist', ['requirejs', 'browserify', 'uglify', 'usebanner']);
  grunt.registerTask('develop', ['watch:source']); // Develop: Watches source files. Trigger lint & build upon change.
  grunt.registerTask('default', ['lint', 'doc', 'dist']);
};


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    android:id="@+id/ll_content"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="100dp"
        android:padding="16dp">

        <ImageView
            android:id="@+id/img"
            android:layout_width="95dp"
            android:layout_height="70dp"
            android:layout_alignParentRight="true"
            android:scaleType="centerCrop"
            android:src="@drawable/ic_loading_small"/>

        <TextView
            android:id="@+id/tv_title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_marginRight="16.0dip"
            android:layout_toLeftOf="@id/img"
            android:ellipsize="end"
            android:maxLines="2"
            android:text="我是标题sfsdfsdfdsfdsfsdfdsfdsf"
            android:textColor="@color/primary_text_default_material_light"
            android:textSize="16.0sp"/>

        <TextView
            android:id="@+id/tv_info"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:singleLine="true"
            android:text="袜子@无厘头"
            android:textColor="@color/secondary_text_default_material_light"
            android:textSize="14sp"/>

    </RelativeLayout>

    <View
        android:layout_width="match_parent"
        android:layout_height="2px"
        android:background="#ffd9d9d9"/>

</LinearLayout>

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Oro\Bundle\DraftBundle\Duplicator\Extension;

use DeepCopy\Filter\Filter;
use DeepCopy\Matcher\Matcher;
use DeepCopy\Matcher\PropertyTypeMatcher;
use Oro\Bundle\DraftBundle\Duplicator\Filter\DateTimeFilter;
use Oro\Bundle\DraftBundle\Entity\DraftableInterface;
use Oro\Bundle\DraftBundle\Manager\DraftManager;

/**
 * Responsible for copying behavior of DateTime type parameters.
 */
class DateTimeExtension extends AbstractDuplicatorExtension
{
    /**
     * @return Filter
     */
    public function getFilter(): Filter
    {
        return new DateTimeFilter();
    }

    /**
     * @return Matcher
     */
    public function getMatcher(): Matcher
    {
        return new PropertyTypeMatcher(\DateTime::class);
    }

    /**
     * @inheritDoc
     */
    public function isSupport(DraftableInterface $source): bool
    {
        return $this->getContext()->offsetGet('action') === DraftManager::ACTION_CREATE_DRAFT;
    }
}


text:
TEST_NAMESPACE

//
// Builds transactions for use with automated tests using random blinding factors.
// To make the transaction valid, TxBuilder keeps track of all blinding factors used,
// and adjusts the tx offset to make a valid transaction.
//
class TxBuilder
{
public:
    TxBuilder();

    TxBuilder& AddInput(const TxOutput& input);
    TxBuilder& AddInput(const CAmount amount);
    TxBuilder& AddInput(
        const CAmount amount,
        const SecretKey& privkey,
        const BlindingFactor& blind,
        const mw::Hash& output_id
    );

    TxBuilder& AddOutput(const CAmount amount);
    TxBuilder& AddOutput(
        const CAmount amount,
        const SecretKey& sender_privkey,
        const StealthAddress& receiver_addr
    );

    TxBuilder& AddPlainKernel(const CAmount fee, const bool add_stealth_excess = false);
    TxBuilder& AddPeginKernel(const CAmount amount, const boost::optional<CAmount>& fee = boost::none, const bool add_stealth_excess = false);
    TxBuilder& AddPegoutKernel(const CAmount amount, const CAmount fee, const bool add_stealth_excess = false);

    Tx Build();

private:
    CAmount m_amount;
    Blinds m_kernelOffset;
    Blinds m_stealthOffset;

    std::vector<Input> m_inputs;
    std::vector<TxOutput> m_outputs;
    std::vector<Kernel> m_kernels;
};

END_NAMESPACE


text:
package com.loopj.android.http;

import android.content.Context;
import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.conn.scheme.SchemeRegistry;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.protocol.HttpContext;

// Referenced classes of package com.loopj.android.http:
//            AsyncHttpClient, ResponseHandlerInterface, AsyncHttpRequest, RequestHandle

public class SyncHttpClient extends AsyncHttpClient
{

    public SyncHttpClient()
    {
        super(false, 80, 443);
    }

    public SyncHttpClient(int i)
    {
        super(false, i, 443);
    }

    public SyncHttpClient(int i, int j)
    {
        super(false, i, j);
    }

    public SyncHttpClient(SchemeRegistry schemeregistry)
    {
        super(schemeregistry);
    }

    public SyncHttpClient(boolean flag, int i, int j)
    {
        super(flag, i, j);
    }

    protected RequestHandle sendRequest(DefaultHttpClient defaulthttpclient, HttpContext httpcontext, HttpUriRequest httpurirequest, String s, ResponseHandlerInterface responsehandlerinterface, Context context)
    {
        if (s != null)
        {
            httpurirequest.addHeader("Content-Type", s);
        }
        responsehandlerinterface.setUseSynchronousMode(true);
        (new AsyncHttpRequest(defaulthttpclient, httpcontext, httpurirequest, responsehandlerinterface)).run();
        return new RequestHandle(null);
    }
}


text:
namespace dents
{
    partial class AddPatient
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AddPatient));
            this.lastame_textbox = new MaterialSkin.Controls.MaterialSingleLineTextField();
            this.save_button = new MaterialSkin.Controls.MaterialRaisedButton();
            this.materialLabel3 = new MaterialSkin.Controls.MaterialLabel();
            this.materialLabel4 = new MaterialSkin.Controls.MaterialLabel();
            this.materialLabel5 = new MaterialSkin.Controls.MaterialLabel();
            this.materialLabel6 = new MaterialSkin.Controls.MaterialLabel();
            this.status_combobox = new System.Windows.Forms.ComboBox();
            this.materialLabel7 = new MaterialSkin.Controls.MaterialLabel();
            this.gender_combobox = new System.Windows.Forms.ComboBox();
            this.materialLabel8 = new MaterialSkin.Controls.MaterialLabel();
            this.birthday_textbox = new System.Windows.Forms.DateTimePicker();
            this.firstname_textbox = new MaterialSkin.Controls.MaterialSingleLineTextField();
            this.address_textbox = new MaterialSkin.Controls.MaterialSingleLineTextField();
            this.phone_textbox = new MaterialSkin.Controls.MaterialSingleLineTextField();
            this.SuspendLayout();
            //
            // lastame_textbox
            //
            this.lastame_textbox.Depth = 0;
            this.lastame_textbox.Hint = "";
            this.lastame_textbox.Location = new System.Drawing.Point(263, 92);
            this.lastame_textbox.MaxLength = 32767;
            this.lastame_textbox.MouseState = MaterialSkin.MouseState.HOVER;
            this.lastame_textbox.Name = "lastame_textbox";
            this.lastame_textbox.PasswordChar = '\0';
            this.lastame_textbox.SelectedText = "";
            this.lastame_textbox.SelectionLength = 0;
            this.lastame_textbox.SelectionStart = 0;
            this.lastame_textbox.Size = new System.Drawing.Size(112, 23);
            this.lastame_textbox.TabIndex = 1;
            this.lastame_textbox.TabStop = false;
            this.lastame_textbox.UseSystemPasswordChar = false;
            //
            // save_button
            //
            this.save_button.AutoSize = true;
            this.save_button.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
            this.save_button.Depth = 0;
            this.save_button.Icon = ((System.Drawing.Image)(resources.GetObject("save_button.Icon")));
            this.save_button.Location = new System.Drawing.Point(292, 328);
            this.save_button.MouseState = MaterialSkin.MouseState.HOVER;
            this.save_button.Name = "save_button";
            this.save_button.Primary = true;
            this.save_button.Size = new System.Drawing.Size(83, 36);
            this.save_button.TabIndex = 7;
            this.save_button.Text = "save";
            this.save_button.UseVisualStyleBackColor = true;
            this.save_button.Click += new System.EventHandler(this.save_click);
            //
            // materialLabel3
            //
            this.materialLabel3.AutoSize = true;
            this.materialLabel3.Depth = 0;
            this.materialLabel3.Font = new System.Drawing.Font("Roboto", 11F);
            this.materialLabel3.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
            this.materialLabel3.Location = new System.Drawing.Point(38, 92);
            this.materialLabel3.MouseState = MaterialSkin.MouseState.HOVER;
            this.materialLabel3.Name = "materialLabel3";
            this.materialLabel3.Size = new System.Drawing.Size(56, 19);
            this.materialLabel3.TabIndex = 40;
            this.materialLabel3.Text = "NAME:";
            //
            // materialLabel4
            //
            this.materialLabel4.AutoSize = true;
            this.materialLabel4.Depth = 0;
            this.materialLabel4.Font = new System.Drawing.Font("Roboto", 11F);
            this.materialLabel4.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
            this.materialLabel4.Location = new System.Drawing.Point(38, 123);
            this.materialLabel4.MouseState = MaterialSkin.MouseState.HOVER;
            this.materialLabel4.Name = "materialLabel4";
            this.materialLabel4.Size = new System.Drawing.Size(63, 19);
            this.materialLabel4.TabIndex = 41;
            this.materialLabel4.Text = "PHONE:";
            //
            // materialLabel5
            //
            this.materialLabel5.AutoSize = true;
            this.materialLabel5.Depth = 0;
            this.materialLabel5.Font = new System.Drawing.Font("Roboto", 11F);
            this.materialLabel5.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
            this.materialLabel5.Location = new System.Drawing.Point(38, 156);
            this.materialLabel5.MouseState = MaterialSkin.MouseState.HOVER;
            this.materialLabel5.Name = "materialLabel5";
            this.materialLabel5.Size = new System.Drawing.Size(79, 19);
            this.materialLabel5.TabIndex = 42;
            this.materialLabel5.Text = "ADDRESS:";
            //
            // materialLabel6
            //
            this.materialLabel6.AutoSize = true;
            this.materialLabel6.Depth = 0;
            this.materialLabel6.Font = new System.Drawing.Font("Roboto", 11F);
            this.materialLabel6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
            this.materialLabel6.Location = new System.Drawing.Point(38, 190);
            this.materialLabel6.MouseState = MaterialSkin.MouseState.HOVER;
            this.materialLabel6.Name = "materialLabel6";
            this.materialLabel6.Size = new System.Drawing.Size(84, 19);
            this.materialLabel6.TabIndex = 43;
            this.materialLabel6.Text = "BIRTHDAY:";
            //
            // status_combobox
            //
            this.status_combobox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.status_combobox.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.status_combobox.FormattingEnabled = true;
            this.status_combobox.Location = new System.Drawing.Point(138, 260);
            this.status_combobox.Name = "status_combobox";
            this.status_combobox.Size = new System.Drawing.Size(235, 25);
            this.status_combobox.TabIndex = 6;
            //
            // materialLabel7
            //
            this.materialLabel7.AutoSize = true;
            this.materialLabel7.Depth = 0;
            this.materialLabel7.Font = new System.Drawing.Font("Roboto", 11F);
            this.materialLabel7.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
            this.materialLabel7.Location = new System.Drawing.Point(38, 225);
            this.materialLabel7.MouseState = MaterialSkin.MouseState.HOVER;
            this.materialLabel7.Name = "materialLabel7";
            this.materialLabel7.Size = new System.Drawing.Size(71, 19);
            this.materialLabel7.TabIndex = 44;
            this.materialLabel7.Text = "GENDER:";
            //
            // gender_combobox
            //
            this.gender_combobox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.gender_combobox.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.gender_combobox.FormattingEnabled = true;
            this.gender_combobox.Location = new System.Drawing.Point(138, 223);
            this.gender_combobox.Name = "gender_combobox";
            this.gender_combobox.Size = new System.Drawing.Size(235, 25);
            this.gender_combobox.TabIndex = 5;
            //
            // materialLabel8
            //
            this.materialLabel8.AutoSize = true;
            this.materialLabel8.Depth = 0;
            this.materialLabel8.Font = new System.Drawing.Font("Roboto", 11F);
            this.materialLabel8.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
            this.materialLabel8.Location = new System.Drawing.Point(38, 261);
            this.materialLabel8.MouseState = MaterialSkin.MouseState.HOVER;
            this.materialLabel8.Name = "materialLabel8";
            this.materialLabel8.Size = new System.Drawing.Size(69, 19);
            this.materialLabel8.TabIndex = 45;
            this.materialLabel8.Text = "STATUS:";
            //
            // birthday_textbox
            //
            this.birthday_textbox.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.birthday_textbox.Format = System.Windows.Forms.DateTimePickerFormat.Short;
            this.birthday_textbox.Location = new System.Drawing.Point(138, 188);
            this.birthday_textbox.Name = "birthday_textbox";
            this.birthday_textbox.Size = new System.Drawing.Size(235, 25);
            this.birthday_textbox.TabIndex = 4;
            //
            // firstname_textbox
            //
            this.firstname_textbox.Depth = 0;
            this.firstname_textbox.Hint = "";
            this.firstname_textbox.Location = new System.Drawing.Point(138, 92);
            this.firstname_textbox.MaxLength = 32767;
            this.firstname_textbox.MouseState = MaterialSkin.MouseState.HOVER;
            this.firstname_textbox.Name = "firstname_textbox";
            this.firstname_textbox.PasswordChar = '\0';
            this.firstname_textbox.SelectedText = "";
            this.firstname_textbox.SelectionLength = 0;
            this.firstname_textbox.SelectionStart = 0;
            this.firstname_textbox.Size = new System.Drawing.Size(119, 23);
            this.firstname_textbox.TabIndex = 0;
            this.firstname_textbox.TabStop = false;
            this.firstname_textbox.UseSystemPasswordChar = false;
            //
            // address_textbox
            //
            this.address_textbox.Depth = 0;
            this.address_textbox.Hint = "";
            this.address_textbox.Location = new System.Drawing.Point(138, 156);
            this.address_textbox.MaxLength = 32767;
            this.address_textbox.MouseState = MaterialSkin.MouseState.HOVER;
            this.address_textbox.Name = "address_textbox";
            this.address_textbox.PasswordChar = '\0';
            this.address_textbox.SelectedText = "";
            this.address_textbox.SelectionLength = 0;
            this.address_textbox.SelectionStart = 0;
            this.address_textbox.Size = new System.Drawing.Size(235, 23);
            this.address_textbox.TabIndex = 3;
            this.address_textbox.TabStop = false;
            this.address_textbox.UseSystemPasswordChar = false;
            //
            // phone_textbox
            //
            this.phone_textbox.Depth = 0;
            this.phone_textbox.Hint = "";
            this.phone_textbox.Location = new System.Drawing.Point(138, 121);
            this.phone_textbox.MaxLength = 32767;
            this.phone_textbox.MouseState = MaterialSkin.MouseState.HOVER;
            this.phone_textbox.Name = "phone_textbox";
            this.phone_textbox.PasswordChar = '\0';
            this.phone_textbox.SelectedText = "";
            this.phone_textbox.SelectionLength = 0;
            this.phone_textbox.SelectionStart = 0;
            this.phone_textbox.Size = new System.Drawing.Size(235, 23);
            this.phone_textbox.TabIndex = 2;
            this.phone_textbox.TabStop = false;
            this.phone_textbox.UseSystemPasswordChar = false;
            //
            // AddPatient
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(395, 376);
            this.Controls.Add(this.lastame_textbox);
            this.Controls.Add(this.save_button);
            this.Controls.Add(this.materialLabel3);
            this.Controls.Add(this.materialLabel4);
            this.Controls.Add(this.materialLabel5);
            this.Controls.Add(this.materialLabel6);
            this.Controls.Add(this.status_combobox);
            this.Controls.Add(this.materialLabel7);
            this.Controls.Add(this.gender_combobox);
            this.Controls.Add(this.materialLabel8);
            this.Controls.Add(this.birthday_textbox);
            this.Controls.Add(this.firstname_textbox);
            this.Controls.Add(this.address_textbox);
            this.Controls.Add(this.phone_textbox);
            this.Name = "AddPatient";
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Text = "AddPatient";
            this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.exit_application);
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private MaterialSkin.Controls.MaterialSingleLineTextField lastame_textbox;
        private MaterialSkin.Controls.MaterialRaisedButton save_button;
        private MaterialSkin.Controls.MaterialLabel materialLabel3;
        private MaterialSkin.Controls.MaterialLabel materialLabel4;
        private MaterialSkin.Controls.MaterialLabel materialLabel5;
        private MaterialSkin.Controls.MaterialLabel materialLabel6;
        private System.Windows.Forms.ComboBox status_combobox;
        private MaterialSkin.Controls.MaterialLabel materialLabel7;
        private System.Windows.Forms.ComboBox gender_combobox;
        private MaterialSkin.Controls.MaterialLabel materialLabel8;
        private System.Windows.Forms.DateTimePicker birthday_textbox;
        private MaterialSkin.Controls.MaterialSingleLineTextField firstname_textbox;
        private MaterialSkin.Controls.MaterialSingleLineTextField address_textbox;
        private MaterialSkin.Controls.MaterialSingleLineTextField phone_textbox;
    }
}


text:
package kvpeer

import (
	"context"
	"io"

	"bazil.org/bazil/kv"
	"bazil.org/bazil/peer/wire"
	"google.golang.org/grpc/codes"
	"google.golang.org/grpc/status"
)

type KVPeer struct {
	peer wire.PeerClient
}

var _ kv.KV = (*KVPeer)(nil)

func (k *KVPeer) Put(ctx context.Context, key, value []byte) error {
	stream, err := k.peer.ObjectPut(ctx)
	if err != nil {
		return err
	}

	first := true

	const chunkSize = 4 * 1024 * 1024
	var chunk []byte
	buf := value
	for len(buf) > 0 {
		size := chunkSize
		if size > len(buf) {
			size = len(buf)
		}
		chunk, buf = buf[:size], buf[size:]

		req := &wire.ObjectPutRequest{Data: chunk}
		if first {
			req.Key = key
			first = false
		}
		if err := stream.Send(req); err != nil {
			return err
		}
	}

	if _, err := stream.CloseAndRecv(); err != nil {
		return err
	}
	return nil
}

func (k *KVPeer) Get(ctx context.Context, key []byte) ([]byte, error) {
	stream, err := k.peer.ObjectGet(ctx, &wire.ObjectGetRequest{
		Key: key,
	})
	if err != nil {
		if status.Code(err) == codes.NotFound {
			return nil, kv.NotFoundError{Key: key}
		}
		return nil, err
	}

	var data []byte
	for {
		resp, err := stream.Recv()
		if err == io.EOF {
			break
		}
		if err != nil {
			return nil, err
		}
		data = append(data, resp.Data...)
	}
	return data, nil
}

func Open(peer wire.PeerClient) (*KVPeer, error) {
	return &KVPeer{
		peer: peer,
	}, nil
}


text:
<link rel="import" href="../bower-components/polymer/polymer.html">
<link rel="import" href="../bower_components/core-ajax/core-ajax.html">

<polymer-element name="my-element" noscript>
  <template>
    I'm my-element. This is my Shadow DOM.
  </template>
</polymer-element>


text:
#ifndef BOOST_MATH_COMPLEX_ACOSH_INCLUDED
#define BOOST_MATH_COMPLEX_ACOSH_INCLUDED

#ifndef BOOST_MATH_COMPLEX_DETAILS_INCLUDED
#  include <boost/math/complex/details.hpp>
#endif
#ifndef BOOST_MATH_COMPLEX_ATANH_INCLUDED
#  include <boost/math/complex/acos.hpp>
#endif

namespace boost{ namespace math{

template<class T>
inline std::complex<T> acosh(const std::complex<T>& z)
{
   //
   // We use the relation acosh(z) = +-i acos(z)
   // Choosing the sign of multiplier to give real(acosh(z)) >= 0
   // as well as compatibility with C99.
   //
   std::complex<T> result = boost::math::acos(z);
   if(!detail::test_is_nan(result.imag()) && result.imag() <= 0)
      return detail::mult_i(result);
   return detail::mult_minus_i(result);
}

} } // namespaces

#endif // BOOST_MATH_COMPLEX_ACOSH_INCLUDED


text:
"""Tests for MetricSpec."""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import functools
import sys

# TODO: #6568 Remove this hack that makes dlopen() not crash.
if hasattr(sys, "getdlopenflags") and hasattr(sys, "setdlopenflags"):
  import ctypes
  sys.setdlopenflags(sys.getdlopenflags() | ctypes.RTLD_GLOBAL)

from tensorflow.contrib.learn.python.learn.metric_spec import MetricSpec
from tensorflow.python.platform import test

def test_metric(predictions, labels, weights=None):
  return predictions, labels, weights

class MetricSpecTest(test.TestCase):

  def test_create_metric_ops(self):
    features = {"feature1": "feature1_tensor", "feature2": "feature2_tensor"}
    labels = {"label1": "label1_tensor", "label2": "label2_tensor"}
    predictions = {"pred1": "pred1_tensor", "pred2": "pred2_tensor"}

    passed = MetricSpec(
        metric_fn=test_metric,
        prediction_key="pred1",
        label_key="label1",
        weight_key="feature2").create_metric_ops(features, labels, predictions)

    self.assertEqual(passed[0], "pred1_tensor")
    self.assertEqual(passed[1], "label1_tensor")
    self.assertEqual(passed[2], "feature2_tensor")

  def test_no_weight(self):
    features = {"feature1": "feature1_tensor", "feature2": "feature2_tensor"}
    labels = {"label1": "label1_tensor", "label2": "label2_tensor"}
    predictions = {"pred1": "pred1_tensor", "pred2": "pred2_tensor"}

    passed = MetricSpec(
        metric_fn=test_metric, prediction_key="pred1",
        label_key="label1").create_metric_ops(features, labels, predictions)

    self.assertEqual(passed[0], "pred1_tensor")
    self.assertEqual(passed[1], "label1_tensor")
    self.assertEqual(passed[2], None)

  def test_fail_no_prediction(self):
    features = {"feature1": "feature1_tensor", "feature2": "feature2_tensor"}
    labels = {"label1": "label1_tensor", "label2": "label2_tensor"}
    predictions = {"pred1": "pred1_tensor", "pred2": "pred2_tensor"}

    self.assertRaisesRegexp(
        ValueError,
        "MetricSpec without specified prediction_key "
        "requires predictions tensor or single element "
        "dict, got",
        MetricSpec(
            metric_fn=test_metric, label_key="label1",
            weight_key="feature2").create_metric_ops,
        features,
        labels,
        predictions)

  def test_fail_no_label(self):
    features = {"feature1": "feature1_tensor", "feature2": "feature2_tensor"}
    labels = {"label1": "label1_tensor", "label2": "label2_tensor"}
    predictions = {"pred1": "pred1_tensor", "pred2": "pred2_tensor"}

    self.assertRaisesRegexp(
        ValueError,
        "MetricSpec without specified label_key requires "
        "labels tensor or single element dict, got",
        MetricSpec(
            metric_fn=test_metric,
            prediction_key="pred1",
            weight_key="feature2").create_metric_ops,
        features,
        labels,
        predictions)

  def test_single_prediction(self):
    features = {"feature1": "feature1_tensor", "feature2": "feature2_tensor"}
    labels = {"label1": "label1_tensor", "label2": "label2_tensor"}
    predictions = "pred1_tensor"

    passed = MetricSpec(
        metric_fn=test_metric, label_key="label1",
        weight_key="feature2").create_metric_ops(features, labels, predictions)

    self.assertEqual(passed[0], "pred1_tensor")
    self.assertEqual(passed[1], "label1_tensor")
    self.assertEqual(passed[2], "feature2_tensor")

  def test_single_label(self):
    features = {"feature1": "feature1_tensor", "feature2": "feature2_tensor"}
    labels = "label1_tensor"
    predictions = {"pred1": "pred1_tensor", "pred2": "pred2_tensor"}

    passed = MetricSpec(
        metric_fn=test_metric, prediction_key="pred1",
        weight_key="feature2").create_metric_ops(features, labels, predictions)

    self.assertEqual(passed[0], "pred1_tensor")
    self.assertEqual(passed[1], "label1_tensor")
    self.assertEqual(passed[2], "feature2_tensor")

  def test_fail_single_prediction(self):
    features = {"feature1": "feature1_tensor", "feature2": "feature2_tensor"}
    labels = {"label1": "label1_tensor", "label2": "label2_tensor"}
    predictions = "pred1_tensor"

    self.assertRaisesRegexp(
        ValueError,
        "MetricSpec with prediction_key specified requires "
        "predictions dict, got",
        MetricSpec(
            metric_fn=test_metric,
            prediction_key="pred1",
            label_key="label1",
            weight_key="feature2").create_metric_ops,
        features,
        labels,
        predictions)

  def test_fail_single_label(self):
    features = {"feature1": "feature1_tensor", "feature2": "feature2_tensor"}
    labels = "label1_tensor"
    predictions = {"pred1": "pred1_tensor", "pred2": "pred2_tensor"}

    self.assertRaisesRegexp(
        ValueError,
        "MetricSpec with label_key specified requires "
        "labels dict, got",
        MetricSpec(
            metric_fn=test_metric,
            prediction_key="pred1",
            label_key="label1",
            weight_key="feature2").create_metric_ops,
        features,
        labels,
        predictions)

  def test_str(self):
    metric_spec = MetricSpec(
        metric_fn=test_metric,
        label_key="label1",
        prediction_key="pred1",
        weight_key="feature2")
    string = str(metric_spec)
    self.assertIn("test_metric", string)
    self.assertIn("label1", string)
    self.assertIn("pred1", string)
    self.assertIn("feature2", string)

  def test_partial_str(self):

    def custom_metric(predictions, labels, stuff, weights=None):
      return predictions, labels, weights, stuff

    partial_metric = functools.partial(custom_metric, stuff=5)
    metric_spec = MetricSpec(
        metric_fn=partial_metric,
        label_key="label1",
        prediction_key="pred1",
        weight_key="feature2")
    self.assertIn("custom_metric", str(metric_spec))

  def test_partial(self):
    features = {"feature1": "feature1_tensor", "feature2": "feature2_tensor"}
    labels = {"label1": "label1_tensor"}
    predictions = {"pred1": "pred1_tensor", "pred2": "pred2_tensor"}

    def custom_metric(predictions, labels, stuff, weights=None):
      if stuff:
        return predictions, labels, weights
      else:
        raise ValueError("Nooooo")

    partial_metric = functools.partial(custom_metric, stuff=5)
    passed = MetricSpec(
        metric_fn=partial_metric,
        label_key="label1",
        prediction_key="pred1",
        weight_key="feature2").create_metric_ops(features, labels, predictions)
    self.assertEqual(passed[0], "pred1_tensor")
    self.assertEqual(passed[1], "label1_tensor")
    self.assertEqual(passed[2], "feature2_tensor")

    broken_partial_metric = functools.partial(custom_metric, stuff=0)
    self.assertRaisesRegexp(
        ValueError,
        "Nooooo",
        MetricSpec(
            metric_fn=broken_partial_metric,
            prediction_key="pred1",
            label_key="label1",
            weight_key="feature2").create_metric_ops,
        features,
        labels,
        predictions)

if __name__ == "__main__":
  test.main()


text:
using namespace std;
using namespace Simulator;

bool
ComponentModelRegistry::Entity::operator<(const ComponentModelRegistry::Entity& right) const
{
    return (type < right.type ||
            (type == right.type && type != VOID &&
             (
                 (type == UINT && value < right.value) ||
                 (type == SYMBOL && symbol < right.symbol) ||
                 (type == OBJECT && object < right.object))));
};

ComponentModelRegistry::ComponentModelRegistry()
    : m_symbols(),
      m_objects(),
      m_entities(),
      m_objprops(),
      m_linkprops(),
      m_names()
{}

ComponentModelRegistry::Symbol
ComponentModelRegistry::makeSymbol(const string& sym)
{
    string str(sym);
    transform(str.begin(), str.end(), str.begin(), ::tolower);
    auto i = m_symbols.insert(str);
    return &(*i.first);
}

ComponentModelRegistry::ObjectRef
ComponentModelRegistry::refObject(const Simulator::Object& obj)
{
    auto obj_declaration = m_objects.find(&obj);
    assert(obj_declaration != m_objects.end());

    return obj_declaration->first;
}

ComponentModelRegistry::EntityRef
ComponentModelRegistry::refEntity(const ObjectRef& obj)
{
    assert(m_objects.find(obj) != m_objects.end());
    Entity e;
    e.type = Entity::OBJECT;
    e.object = obj;
    auto i = m_entities.insert(e);
    return &(*i.first);
}

ComponentModelRegistry::EntityRef
ComponentModelRegistry::refEntity(const char *str)
{
    return refEntity(makeSymbol(str));
}

ComponentModelRegistry::EntityRef
ComponentModelRegistry::refEntity(const string& str)
{
    return refEntity(makeSymbol(str));
}

ComponentModelRegistry::EntityRef
ComponentModelRegistry::refEntity(const Symbol& sym)
{
    assert(m_symbols.find(*sym) != m_symbols.end());
    Entity e;
    e.type = Entity::SYMBOL;
    e.symbol = sym;
    auto i = m_entities.insert(e);
    return &(*i.first);
}

ComponentModelRegistry::EntityRef
ComponentModelRegistry::refEntity(const uint32_t& val)
{
    Entity e;
    e.type = Entity::UINT;
    e.value = val;
    auto i = m_entities.insert(e);
    return &(*i.first);
}

ComponentModelRegistry::EntityRef
ComponentModelRegistry::refEntity(void)
{
    Entity e;
    e.type = Entity::VOID;
    auto i = m_entities.insert(e);
    return &(*i.first);
}

void
ComponentModelRegistry::registerObject(const Object& obj,
                                       const string& type)
{
    assert(m_objects.find(&obj) == m_objects.end()
           || m_objects.find(&obj)->second == makeSymbol(type));
    m_objects[&obj] = makeSymbol(type);
}

void ComponentModelRegistry::renameObjects()
{
    map<Symbol, int> typecounters;
    m_names.clear();
    for (auto& i : m_objects)
    {
        m_names[i.first] = makeSymbol(*i.second + to_string(typecounters[i.second]++));
    }
}

void
ComponentModelRegistry::printEntity(ostream& os,
                                    const ComponentModelRegistry::Entity& e) const
{
    switch(e.type)
    {
    case Entity::VOID: os << "(void)"; break;
    case Entity::SYMBOL: os << *e.symbol; break;
    case Entity::OBJECT:
        assert(m_names.find(e.object) != m_names.end());
        os << *m_names.find(e.object)->second;
        break;
    case Entity::UINT: os << dec << e.value; break;
    }
}

void
ComponentModelRegistry::dumpComponentGraph(ostream& os,
                                           bool display_nodeprops,
                                           bool display_linkprops)
{
    renameObjects();

    os << "# Microgrid system topology, generated by " << PACKAGE_NAME << " " << PACKAGE_VERSION << endl
       << "digraph Microgrid {" << endl
       << "overlap=\"false\"; labeljust=\"l\"; concentrate=\"true\"; splines=\"true\"; node [shape=box]; edge [len=2,constraint=\"false\"];" << endl;
    for (auto& i : m_objects)
    {
        ObjectRef objref = i.first;
        os << *m_names[objref] << " [label=\"" << *m_names[objref];

        string name = objref->GetName();
        if (name != *m_names[objref])
            os << "\\nconfig:" << name;

        if (display_nodeprops && !m_objprops[objref].empty())
        {
            for (auto& p : m_objprops[objref])
            {
                os << "\\n" << *p.first;
                if (p.second->type != Entity::VOID)
                {
                    os << ':';
                    printEntity(os, *p.second);
                }
            }
        }
        os << "\"];" << endl;
    }

    for (auto& i : m_linkprops)
    {
        auto& endpoints = i.first;
        auto& props = i.second;

        os << *m_names[endpoints.first] << " -> " << *m_names[endpoints.second.first]
           << " [constraint=\"" << (endpoints.second.second.first ? "false" : "true") << "\"";

        if (endpoints.second.second.second)
            os << ",dir=both";

        if (display_linkprops)
        {
            os << ",label=\"";
            for (auto& p : props)
            {
                os << *p.first;
                if (p.second->type != Entity::VOID)
                {
                    os << ':';
                    printEntity(os, *p.second);
                }
                os << ' ';
            }
            os << "\"";
        }
        os << "];"  << endl;
    }
    os << "}" << endl;
}


text:
<!doctype html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>app-router</title>

    <link rel="import" href="/src/app-router.html">
    <link rel="import" href="/bower_components/polymer/polymer.html">
    <link rel="import" href="/bower_components/core-animated-pages/core-animated-pages.html">
    <link rel="import" href="/bower_components/core-scaffold/core-scaffold.html">
    <link rel="import" href="/bower_components/core-header-panel/core-header-panel.html">
    <link rel="import" href="/bower_components/core-toolbar/core-toolbar.html">
    <link rel="import" href="/bower_components/core-item/core-item.html">

    <polymer-element name="sidebar-layout" noscript>
      <template>
        <core-scaffold>
          <core-header-panel navigation flex mode="seamed">
            <core-toolbar>core-animated-pages tests</core-toolbar>
            <core-item label="/first"></core-item>
            <core-item label="/second"></core-item>
            <core-item label="/page/123"></core-item>
            <core-item label="/page/456"></core-item>
          </core-header-panel>

            <content select=".title"></content>

Test the different app-route types by navigating through these links.

Test the basic features of <core-animated-pages>.

            <content></content>

        </core-scaffold>
      </template>
    </polymer-element>

    <polymer-element name="first-page" noscript>
      <template>
        <sidebar-layout>

first

first page

        </sidebar-layout>
      </template>
    </polymer-element>

    <polymer-element name="second-page" noscript>
      <template>
        <sidebar-layout>

second

second page

        </sidebar-layout>
      </template>
    </polymer-element>

    <polymer-element name="third-page" attributes="pageNum" noscript>
      <template>
        <sidebar-layout>

third

{{pageNum}} page

        </sidebar-layout>
      </template>
    </polymer-element>

    <app-router core-animated-pages transitions="cross-fade-all">
      <app-route path="/first" element="first-page"></app-route>
      <app-route path="/second" element="second-page"></app-route>
      <app-route path="/page/:pageNum" element="third-page"></app-route>
      <app-route path="*" element="first-page"></app-route>
    </app-router>


text:
#include "random.h"
/* (c) 1996,1997 Thomas Worsch, Peter Sanders */
/* =====================================================================
 * The pseudo random number generator functions in this file are
 * similar to those in
 *    Numerical Recipes in C, Second Edition, pages 279-282.
 *
 * The RNGs have names nextRandom<something> and they return a Float64.
 *    They are initialized by a call to initRandom<something> which
 *    take an Int32 as seed.
 */

#define EPS 1.2e-7
#define RNMX (1.0-EPS)
#define IM 2147483647
#define AM ((Float64)1.0/IM)
#define IA 16807
#define IQ 127773
#define IR 2836

static Int32 state = 123456789;

void initRandomParkMiller(Int32 seed)
{
  state = seed;
  /* but we have to make sure that state never ever is set to zero */
  if (state==0) { state = 42; }
}

Float64 nextRandomParkMiller(void)
{
  Int32 k;
  Float64 result;

  k = state/IQ;
  state = IA*(state-k*IQ)-k*IR;
  if (state < 0) { state += IM; }
  result = AM*state;
  if (result >= 1.0) { result = RNMX; }
  return result;
}

/* =====================================================================
 * Now a pseudo RNG with a longer period (roughly 10^18) by lEcuyer
 *    (Numerical Recipes, page 282).
 */

#define IM1 2147483563
#define IM2 2147483399
#define AM1 ((Float64)1.0/IM1)
#define IMM1 (IM1-1)
#define IA1 40014
#define IA2 40692
#define IQ1 53668
#define IQ2 52774
#define IR1 12211
#define IR2 3791

#define NTAB 32
#define NDIV (1+IMM1/NTAB)

static Int32 state1 = 987654321;
static Int32 state2;
static Int32 y;
static Int32 v[NTAB];

/* ------------------------------------------------------------------ */
static void initRandomSeedLEcuyer(Int32 seed)
{
  state1 = seed;
  if (state1==0) { state1 = 987654321; }
  state2 = state1;
}

/* ------------------------------------------------------------------ */
static void initRandomTabLEcuyer(void)
{
  Int32 j, k;

  for (j=NTAB+7;  j>=0;  j--) {
    k = state1/IQ1;
    state1 = IA1*(state1-k*IQ1)-k*IR1;
    if (state1 < 0) { state1 += IM1; }
    if (j < NTAB) { v[j] = state1; }
  }
  y = v[0];
}

/* ------------------------------------------------------------------ */
void initRandomLEcuyer(Int32 seed)
{
  initRandomSeedLEcuyer(seed);
  initRandomTabLEcuyer();
}

/* ------------------------------------------------------------------ */
static Int32 power(Int32 base, Card64 exp, Int32 modulus)
{
  Int64 temp = 1;
  Card64 mask;

  if (base < 0) { return 0; }

  /* note that at on each entry into the following loop body, the
     actual value of temp is always positive and fits into an Int32 */
  for (mask = ((Card64)1) << 63;  mask != 0;  mask >>= 1) {
    temp = (temp * temp) % modulus;
    if (exp & mask) {
      temp = (temp * base) % modulus;
    }
  }
  return ((Int32) temp);
}

/* ------------------------------------------------------------------ */
static void forwardRandomLEcuyer(Card64 steps)
{
  Int32 a;

  a = power(IA1, steps, IM1);
  state1 = (Int32) ( (((Int64)a) * state1) % IM1);

  a = power(IA2, steps, IM2);
  state2 = (Int32) ( (((Int64)a) * state2) % IM2);
}

/* ------------------------------------------------------------------ */
/*
 * The following initialization function is intended for use on a
 * parallel machine.
 * Each PE must call initParallelRandomLEcuyer once at the beginning.
 * Calls to nextRandomLEcuyer will then return different (and hopefully
 *    pseudo unrelated) pseudo random numbers on different PEs.
 * The calls to initParallelRandomLEcuyer on different PEs
 *    *MUST* *SATISFY* *THE* *FOLLOWING* *CONDITIONS*:
 *    - The parameter seed is the same on all PEs.
 *    - The parameter total is the same on all PEs and it must be
 *      the total number of PEs using the RNG.
 *    - The parameter pe must be different on each PE and for each
 *      i in the set {0,1,...,total-1} there must be exactly one PE
 *      calling initParallelRandomLEcuyer with parameter pe set to i.
 * Please note:
 *    - There are *NO* run time checks to see whether the above
 *      conditions have been satisfied.
 *    - The numbers generated on different PEs are probably only more or
 *      less unrelated as long as the number of calls of nextRandomLEcuyer
 *      on each of the PEs is smaller than the period of the RNG
 *      (approx. 10^18) divided by the number of PEs (probably below 10^4).
 *      Since 10^14 calls of nextRandomLEcuyer will take quite some time,
 *      you are probably safe using this RNG.
 *    - This function uses nextRandomParkMiller. If you want to have
 *      reproducible results, make sure that you do not use
 *      RandomParkMiller yourself before calling initParallelRandomLEcuyer.
 */
void initParallelRandomLEcuyer(Int32 seed, Int32 pe, Int32 total)
{
  Card64 steps;

  initRandomSeedLEcuyer(seed);

  /* The period of the RNG is roughly 2.3e18, i.e. 2^61,
     which should be distributed onto the PEs approximately equally;
     because we do not know the exact value we are careful and take
     one half of the average length of the interval per PE: */
  steps = (((Card64)1) << 60)/total;

  /* For PE number pe we get the starting point: */
  steps = steps * pe;

  /* Finally the starting point for each PE is randomly shifted
     by an amount which is small compared to the length of
     its interval (as long as there are much less than 2^30 PEs :-).
     Therefore steps will still be far below the end of its interval: */
  steps = steps + (Card64) (nextRandomParkMiller() * (((Card64)1) << 30));

  /* Now the RNG is initialized for PE pe as if it had already made steps
     many steps from the initial seed. */
  forwardRandomLEcuyer(steps);

  initRandomTabLEcuyer();
}

/* ------------------------------------------------------------------ */
Float64 nextRandomLEcuyer(void)
{
  Int32 k;
  Float64 result;
  int j;

  k = state1/IQ1;
  state1 = IA1*(state1-k*IQ1)-k*IR1;
  if (state1 < 0) { state1 += IM1; }

  k = state2/IQ2;
  state2 = IA2*(state2-k*IQ2)-k*IR2;
  if (state2 < 0) { state2 += IM2; }

  j = y/NDIV;
  y = v[j] - state2;
  v[j] = state1;

  if (y < 1) { y += IMM1; }

  result = AM1*y;
  if (result >= 1.0) { result = RNMX; }
  return result;
}


text:
from datetime import datetime  # noqa
from datetime import timedelta  # noqa

import json

from django.core.urlresolvers import reverse
from django.http import HttpResponse   # noqa
from django.utils.datastructures import SortedDict
from django.utils.translation import ugettext_lazy as _
import django.views

from horizon import exceptions
from horizon import tables
from horizon import tabs
from horizon.utils import csvbase

from openstack_dashboard import api
from openstack_dashboard.api import ceilometer

from openstack_dashboard.dashboards.admin.metering import tables as \
    metering_tables
from openstack_dashboard.dashboards.admin.metering import tabs as \
    metering_tabs

class IndexView(tabs.TabbedTableView):
    tab_group_class = metering_tabs.CeilometerOverviewTabs
    template_name = 'admin/metering/index.html'

class SamplesView(django.views.generic.TemplateView):
    template_name = "admin/metering/samples.csv"

    @staticmethod
    def _series_for_meter(aggregates,
                          resource_name,
                          meter_name,
                          stats_name,
                          unit):
        """Construct datapoint series for a meter from resource aggregates."""
        series = []
        for resource in aggregates:
            if resource.get_meter(meter_name):
                point = {'unit': unit,
                         'name': getattr(resource, resource_name),
                         'data': []}
                for statistic in resource.get_meter(meter_name):
                    date = statistic.duration_end[:19]
                    value = float(getattr(statistic, stats_name))
                    point['data'].append({'x': date, 'y': value})
                series.append(point)
        return series

    def get(self, request, *args, **kwargs):
        meter = request.GET.get('meter', None)
        if not meter:
            return HttpResponse(json.dumps({}),
                                content_type='application/json')

        meter_name = meter.replace(".", "_")
        date_options = request.GET.get('date_options', None)
        date_from = request.GET.get('date_from', None)
        date_to = request.GET.get('date_to', None)
        stats_attr = request.GET.get('stats_attr', 'avg')
        group_by = request.GET.get('group_by', None)

        resources, unit = query_data(request,
                                     date_from,
                                     date_to,
                                     date_options,
                                     group_by,
                                     meter)
        resource_name = 'id' if group_by == "project" else 'resource_id'
        series = self._series_for_meter(resources,
                                        resource_name,
                                        meter_name,
                                        stats_attr,
                                        unit)

        ret = {}
        ret['series'] = series
        ret['settings'] = {}

        return HttpResponse(json.dumps(ret),
                            content_type='application/json')

class ReportView(tables.MultiTableView):
    template_name = 'admin/metering/report.html'

    def get_tables(self):
        if self._tables:
            return self._tables
        project_data = load_report_data(self.request)
        table_instances = []
        limit = int(self.request.POST.get('limit', '1000'))
        for project in project_data.keys():
            table = metering_tables.UsageTable(self.request,
                                               data=project_data[project],
                                               kwargs=self.kwargs.copy())
            table.title = project
            t = (table.name, table)
            table_instances.append(t)
            if len(table_instances) == limit:
                break
        self._tables = SortedDict(table_instances)
        self.project_data = project_data
        return self._tables

    def handle_table(self, table):
        name = table.name
        handled = self._tables[name].maybe_handle()
        return handled

    def get_context_data(self, **kwargs):
        context = {'tables': self.get_tables().values()}
        context['csv_url'] = reverse('horizon:admin:metering:csvreport')
        return context

class CsvReportView(django.views.generic.View):
    def get(self, request, **response_kwargs):
        render_class = ReportCsvRenderer
        response_kwargs.setdefault("filename", "usage.csv")
        context = {'usage': load_report_data(request)}
        resp = render_class(request=request,
                            template=None,
                            context=context,
                            content_type='csv',
                            **response_kwargs)
        return resp

class ReportCsvRenderer(csvbase.BaseCsvResponse):

    columns = [_("Project Name"), _("Meter"), _("Description"),
               _("Service"), _("Time"), _("Value (Avg)")]

    def get_row_data(self):

        for p in self.context['usage'].values():
            for u in p:
                yield (u["project"],
                       u["meter"],
                       u["description"],
                       u["service"],
                       u["time"],
                       u["value"])

def _calc_period(date_from, date_to):
    if date_from and date_to:
        if date_to < date_from:
            # TODO(lsmola) propagate the Value error through Horizon
            # handler to the client with verbose message.
            raise ValueError("Date to must be bigger than date "
                             "from.")
            # get the time delta in seconds
        delta = date_to - date_from
        if delta.days <= 0:
            # it's one day
            delta_in_seconds = 3600 * 24
        else:
            delta_in_seconds = delta.days * 24 * 3600 + delta.seconds
            # Lets always show 400 samples in the chart. Know that it is
        # maximum amount of samples and it can be lower.
        number_of_samples = 400
        period = delta_in_seconds / number_of_samples
    else:
        # If some date is missing, just set static window to one day.
        period = 3600 * 24
    return period

def _calc_date_args(date_from, date_to, date_options):
    # TODO(lsmola) all timestamps should probably work with
    # current timezone. And also show the current timezone in chart.
    if (date_options == "other"):
        try:
            if date_from:
                date_from = datetime.strptime(date_from,
                                              "%Y-%m-%d")
            else:
                # TODO(lsmola) there should be probably the date
                # of the first sample as default, so it correctly
                # counts the time window. Though I need ordering
                # and limit of samples to obtain that.
                pass
            if date_to:
                date_to = datetime.strptime(date_to,
                                            "%Y-%m-%d")
                # It return beginning of the day, I want the and of
                # the day, so i will add one day without a second.
                date_to = (date_to + timedelta(days=1) -
                           timedelta(seconds=1))
            else:
                date_to = datetime.now()
        except Exception:
            raise ValueError("The dates are not "
                             "recognized.")
    else:
        try:
            date_from = datetime.now() - timedelta(days=int(date_options))
            date_to = datetime.now()
        except Exception:
            raise ValueError("The time delta must be an "
                             "integer representing days.")
    return date_from, date_to

def query_data(request,
               date_from,
               date_to,
               date_options,
               group_by,
               meter,
               period=None,
               additional_query=None):
    date_from, date_to = _calc_date_args(date_from,
                                         date_to,
                                         date_options)
    if not period:
        period = _calc_period(date_from, date_to)
    if additional_query is None:
        additional_query = []
    if date_from:
        additional_query += [{'field': 'timestamp',
                              'op': 'ge',
                              'value': date_from}]
    if date_to:
        additional_query += [{'field': 'timestamp',
                              'op': 'le',
                              'value': date_to}]

    # TODO(lsmola) replace this by logic implemented in I1 in bugs
    # 1226479 and 1226482, this is just a quick fix for RC1
    try:
        meter_list = [m for m in ceilometer.meter_list(request)
                      if m.name == meter]
        unit = meter_list[0].unit
    except Exception:
        unit = ""
    if group_by == "project":
        try:
            tenants, more = api.keystone.tenant_list(
                request,
                domain=None,
                paginate=False)
        except Exception:
            tenants = []
            exceptions.handle(request,
                              _('Unable to retrieve project list.'))
        queries = {}
        for tenant in tenants:
            tenant_query = [{
                            "field": "project_id",
                            "op": "eq",
                            "value": tenant.id}]

            queries[tenant.name] = tenant_query

        ceilometer_usage = ceilometer.CeilometerUsage(request)
        resources = ceilometer_usage.resource_aggregates_with_statistics(
            queries, [meter], period=period, stats_attr=None,
            additional_query=additional_query)

    else:
        query = []

        def filter_by_meter_name(resource):
            """Function for filtering of the list of resources.

            Will pick the right resources according to currently selected
            meter.
            """
            for link in resource.links:
                if link['rel'] == meter:
                    # If resource has the currently chosen meter.
                    return True
            return False

        ceilometer_usage = ceilometer.CeilometerUsage(request)
        try:
            resources = ceilometer_usage.resources_with_statistics(
                query, [meter], period=period, stats_attr=None,
                additional_query=additional_query,
                filter_func=filter_by_meter_name)
        except Exception:
            resources = []
            exceptions.handle(request,
                              _('Unable to retrieve statistics.'))
    return resources, unit

def load_report_data(request):
    meters = ceilometer.Meters(request)
    services = {
        _('Nova'): meters.list_nova(),
        _('Neutron'): meters.list_neutron(),
        _('Glance'): meters.list_glance(),
        _('Cinder'): meters.list_cinder(),
        _('Swift_meters'): meters.list_swift(),
        _('Kwapi'): meters.list_kwapi(),
    }
    project_rows = {}
    date_options = request.GET.get('date_options', 7)
    date_from = request.GET.get('date_from')
    date_to = request.GET.get('date_to')
    for meter in meters._cached_meters.values():
        service = None
        for name, m_list in services.items():
            if meter in m_list:
                service = name
                break
        # show detailed samples
        # samples = ceilometer.sample_list(request, meter.name)
        res, unit = query_data(request,
                               date_from,
                               date_to,
                               date_options,
                               "project",
                               meter.name,
                               3600 * 24)
        for re in res:
            values = re.get_meter(meter.name.replace(".", "_"))
            if values:
                for value in values:
                    row = {"name": 'none',
                           "project": re.id,
                           "meter": meter.name,
                           "description": meter.description,
                           "service": service,
                           "time": value._apiresource.period_end,
                           "value": value._apiresource.avg}
                    if re.id not in project_rows:
                        project_rows[re.id] = [row]
                    else:
                        project_rows[re.id].append(row)
    return project_rows


text:
package com.cisco.qte.jdtn.events;

import com.cisco.qte.jdtn.ltp.ReportSegment;

/**
 * Event with associated ReportSegment
 */
public class ReportSegmentEvent extends SegmentEvent {

	public ReportSegmentEvent(ReportSegment reportSegment) {
		super(EventType.REPORT_SEGMENT, reportSegment);
	}

}


text:
<?xml version="1.0" encoding="utf-8"?>
<!-- Omnibox strings file -->

<resources>

    <string name="omnibox_inputbar_hint">
        Busca o escriba la URL
    </string>

    <string name="omnibox_forward_btn_acsb_desc">
        Reenviar
    </string>
    <string name="Favicon">Favicon</string>

</resources>


text:
jupytext:
  formats: md:myst
  text_representation:
    extension: .md
    format_name: myst
kernelspec:
  display_name: Python 3
  language: python
  name: python3
author:
date:

---

# Sample article

> {sub-ref}`today` | {sub-ref}`wordcount-words` words | {sub-ref}`wordcount-minutes` min read

https://myst-parser.readthedocs.io/en/latest/sphinx/use.html?highlight=date#sphinx-specific-page-front-matter

https://myst-parser.readthedocs.io/en/latest/sphinx/roles-and-directives.html?highlight=date#insert-the-date-and-reading-time


text:
window.Evme = new function Evme_Core() {
    var NAME = "Core", self = this,
        recalculateHeightRetries = 1,
        TIMEOUT_BEFORE_INIT_SESSION = "FROM CONFIG",
        OPACITY_CHANGE_DURATION = 300,
        head_ts = new Date().getTime(),

        CLASS_WHEN_SHOWING_SHORTCUTS = 'evme-display-shortcuts';

    this.shouldSearchOnInputBlur = true;

    this.init = function init() {
        data = Evme.__config;

        var apiHost = Evme.Utils.getUrlParam("apiHost") || data.apiHost;
        apiHost && Evme.api.setHost(apiHost);

        TIMEOUT_BEFORE_INIT_SESSION = data.timeoutBeforeSessionInit;

        window.addEventListener('contextmenu', onContextMenu, true);

        // calculate the precise background image size loaded behind search results
        // takes screen size and pixel density into account
        data.bgImageSize = [
            Math.floor(window.innerWidth * window.devicePixelRatio),
            Math.floor(window.innerHeight * window.devicePixelRatio)
        ];

        // calculate number of apps to load on every search
        // if the screen height permits it - add another row of apps
        var numberOfAppsToLoad = data.numberOfAppsToLoad;
        if (window.innerHeight/window.innerWidth > 1.66) {
            numberOfAppsToLoad += data.apps.appsPerRow;
        }

        Evme.Brain.init({
            "numberOfAppsToLoad": numberOfAppsToLoad,
            "minimumLettersForSearch": data.minimumLettersForSearch,
            "timeBeforeAllowingDialogsRemoval": data.timeBeforeAllowingDialogsRemoval,
            "tips": data.tips,
            "searchSources": data.searchSources,
            "pageViewSources": data.pageViewSources,
            "displayInstalledApps": data.apps.displayInstalledApps
        });

        Evme.DoATAPI.init({
            "apiKey": data.apiKey,
            "appVersion": data.appVersion,
            "authCookieName": data.authCookieName,
            "callback": function callback() {
                Evme.Analytics.init({
                    "config": data.analytics,
                    "namespace": Evme,
                    "DoATAPI": Evme.DoATAPI,
                    "getCurrentAppsRowsCols": Evme.Apps.getCurrentRowsCols,
                    "Brain": Evme.Brain,
                    "connectionLow": Evme.Utils.connection().speed != Evme.Utils.connection().SPEED_HIGH,
                    "sessionObj": Evme.DoATAPI.Session.get(),
                    "pageRenderStartTs": head_ts,
                    "SEARCH_SOURCES": data.searchSources,
                    "PAGEVIEW_SOURCES": data.pageViewSources
                });
            }
        });

        initObjects(data);
    };

    // Gaia communication methods
    this.setOpacityBackground = function setOpacityBackground(value) {
        Evme.BackgroundImage.changeOpacity(value, OPACITY_CHANGE_DURATION);
    };

    this.pageMove = function pageMove(value) {
        Evme.BackgroundImage.changeOpacity(Math.floor(value*100)/100);
    };

    this.onSwipeFromPage = function onSwipeFromPage() {

    };

    this.onHomeButtonPress = function onHomeButtonPress() {
        Evme.Searchbar.clearIfHasQuery();
        Evme.Searchbar.blur();

        if (
          Evme.BackgroundImage.closeFullScreen() ||
          Evme.Brain.Shortcuts.hideIfEditing() ||
          Evme.Brain.ShortcutsCustomize.hideIfOpen() ||
          Evme.Brain.ShortcutsCustomize.hideIfRequesting()
        ) {
          // return true to prevent homescreen from performing its own home button actions
          return true;
        }

        document.body.classList.remove(CLASS_WHEN_SHOWING_SHORTCUTS);

        // return false to allow homescreen to perform its own home button actions
        return false;
    };

    this.searchFromOutside = function searchFromOutside(query) {
        Evme.Brain.Searcher.searchExactFromOutside(query);
    };
    this.onShow = function onShow() {
        self.displayed = true;
        document.body.classList.add('evme-displayed');
    };
    this.onHide = function onHide() {
        self.displayed = false;
        document.body.classList.remove('evme-displayed');
        Evme.Searchbar.blur();
        document.body.classList.remove(CLASS_WHEN_SHOWING_SHORTCUTS);
        Evme.Brain.Shortcuts.hideIfEditing();
    };

    this.onHideStart = function onHideStart(source) {
        Evme.Brain.SmartFolder.hideIfOpen();

        if (source === "homeButtonClick") {
            if (
                Evme.Brain.Shortcuts.hideIfEditing() ||
                Evme.Brain.ShortcutsCustomize.hideIfOpen() ||
                Evme.Brain.ShortcutsCustomize.hideIfRequesting() ||
                Evme.Searchbar.clearIfHasQuery()
            ) {
                return true;
            }
        }

        Evme.Searchbar.blur();
        return false; // allow navigation to homescreen
    };

    function onContextMenu(e) {
      if (self.displayed &&
          (Evme.Searchbar.getValue() ||
          document.body.classList.contains(CLASS_WHEN_SHOWING_SHORTCUTS))
          ) {
        e.stopImmediatePropagation();
      }
    }

    function initObjects(data) {
        Evme.Features.init({
            "featureStateByConnection": data.featureStateByConnection
        });

        Evme.ConnectionMessage.init({
        });

        Evme.Location.init({
            "refreshInterval": data.locationInterval,
            "requestTimeout": data.locationRequestTimeout
        });

        Evme.Shortcuts.init({
            "el": Evme.$("#shortcuts"),
            "elLoading": Evme.$("#shortcuts-loading"),
            "design": data.design.shortcuts,
            "defaultShortcuts": data._defaultShortcuts
        });

        Evme.ShortcutsCustomize.init({
            "elParent": Evme.Utils.getContainer()
        });

        Evme.Searchbar.init({
            "el": Evme.$("#search-q"),
            "elForm": Evme.$("#search-rapper"),
            "elDefaultText": Evme.$("#default-text"),
            "timeBeforeEventPause": data.searchbar.timeBeforeEventPause,
            "timeBeforeEventIdle": data.searchbar.timeBeforeEventIdle,
            "setFocusOnClear": false
        });

        Evme.Helper.init({
            "el": Evme.$("#helper"),
            "elTitle": Evme.$("#search-title"),
            "elTip": Evme.$("#helper-tip")
        });

        Evme.Apps.init({
            "el": Evme.$("#evmeApps"),
            "elHeader": Evme.$("#header"),
            "design": data.design.apps,
            "appHeight": data.apps.appHeight,
            "minHeightForMoreButton": data.minHeightForMoreButton,
            "defaultScreenWidth": {
                "portrait": 320,
                "landscape": 480
            }
        });

        Evme.IconGroup.init({});

        Evme.BackgroundImage.init({
            "el": Evme.$("#search-overlay"),
            "elementsToFade": [Evme.$("#evmeApps"), Evme.$("#header"), Evme.$("#search-header")],
            "defaultImage": data.defaultBGImage
        });

        Evme.Banner.init({
            "el": Evme.$("#evmeBanner")
        });

        Evme.SearchHistory.init({
            "maxEntries": data.maxHistoryEntries
        });

        Evme.EventHandler.trigger(NAME, "init", {"deviceId": Evme.DoATAPI.getDeviceId()});
    }
};


text:
<?php

namespace WellCommerce\Bundle\WishlistBundle\Service\Layout\Configurator;

use WellCommerce\Bundle\CoreBundle\Layout\Configurator\AbstractLayoutBoxConfigurator;
use WellCommerce\Bundle\WishlistBundle\Controller\Box\WishlistBoxController;

/**
 * Class WishlistBoxConfigurator
 *
 * @author  Adam Piotrowski <adam@wellcommerce.org>
 */
final class WishlistBoxConfigurator extends AbstractLayoutBoxConfigurator
{
    public function __construct(WishlistBoxController $controller)
    {
        $this->controller = $controller;
    }

    public function getType(): string
    {
        return 'Wishlist';
    }
}


text:
<?php
class Slider_model extends CI_Model {

	public function __construct()
	{
		parent::__construct();
		$this->load->database();
	}
	public function insert_data()
	{
		$image_data = $this->upload->data();
		$insert_data = array(
			'img_name' => $image_data['file_name'],
			'img_type' => $image_data['file_type'],
			'img_path'=>$image_data['full_path'],
			);
		$this->db->insert('slider', $insert_data);
	}
	public function read_data()
	{
		$query = $this->db->query('SELECT * FROM slider ORDER BY id DESC LIMIT 6');
		return $query->result_array();
	}

}
?>


text:
This is my personal presentations repository, and a simple presentation workflow/framework.

It uses Grunt and Livereload,
enabling you to see the changes made to your presentations immediately.

Presentations are based on the excellent [Reveal.js](https://github.com/hakimel/reveal.js).

## Usage

It is very simple to use this as a bootstrap for your own presentations! You must have [node.js](http://nodejs.org/) installed.

Simply clone the repository and install the depencies:

	git clone git://github.com/gadr90/presentations.git
	cd presentations
	npm install
    npm install -g grunt-cli

You're done! Now run grunt:

	grunt

And you can access your presentations under `localhost:1990/folder/index.html`

There's a default presentation at `reveal/index.html`. You can start from there.


text:
#pragma once

#include <string>
#include <mraa/i2c.hpp>
#include <math.h>

#define TMP006_NAME "TMP006"
#define TMP006_I2C_ADDRESS     0x41
#define TMP006_MANUFACTURER_ID 0x5449
#define TMP006_DEVICE_ID       0x0067

#define TMP007_I2C_ADDRESS     0x40
// this should actually be split
#define TMP007_DEVICE_ID       0x0078

#ifndef TMP006_CONVERSION_TIME
#define TMP006_CONVERSION_TIME 1E6 /**< Default Conversion Time in us */
#endif

/* TMP006 Register Map */
#define TMP006_SENSOR_VOLTAGE      0x00   /* Sensor voltage register */
#define TMP006_LOCAL_TEMPERATURE   0x01   /* Ambient temperature register */
#define TMP006_CONFIGURATION       0x02
#define TMP006_MANUFACTURER_ID_REG 0xFE
#define TMP006_DEVICE_ID_REG       0xFF

/* TMP007 Register Map */
#define TMP007_DEVICE_ID_REG       0x1F

/* TMP006 configuration register bitmap */
#define TMP006_RST_SOFT         (1 << 15)

#define TMP006_CONFIG_MOD_SHIFT 12
#define TMP006_CONFIG_MOD_MASK  0x7000
#define TMP006_CONFIG_MOD(x)    (((uint16_t)(((uint16_t)(x))<<\
                                TMP006_CONFIG_MOD_SHIFT))\
                                &TMP006_CONFIG_MOD_MASK)
#define TMP006_CONFIG_MOD_CC    0x07
#define TMP006_CONFIG_MOD_OFF   0x00

#define TMP006_CONFIG_CR_SHIFT  9
#define TMP006_CONFIG_CR_MASK   0x0E00
#define TMP006_CONFIG_CR(x)     (((uint16_t)(((uint16_t)(x))<<\
                                TMP006_CONFIG_CR_SHIFT))\
                                &TMP006_CONFIG_CR_MASK)
#define TMP006_CONFIG_CR_AS1  0x00 /* Conversion Time 0.25 s, AVG Samples: 1 */
#define TMP006_CONFIG_CR_AS2  0x01 /* Conversion Time 0.5 s, AVG Samples: 2 */
#define TMP006_CONFIG_CR_AS4  0x02 /* Conversion Time 1 s, AVG Samples: 4 */
#define TMP006_CONFIG_CR_AS8  0x03 /* Conversion Time 2 s, AVG Samples: 8 */
#define TMP006_CONFIG_CR_AS16 0x04 /* Conversion Time 4 s, AVG Samples: 16 */
#define TMP006_CONFIG_CR_DEF  TMP006_CONFIG_CR_AS4 /**< Default for Testing */

#define TMP006_DRDY_EN          (1 << 8)
#define TMP006_DRDY_DATA_RDY    (1 << 7)

/* constant values for data conversion */
#ifndef TMP006_CCONST_S0
#define TMP006_CCONST_S0       6.4E-14    /* Calibration Factor */
#endif

#define TMP006_CCONST_A1       1.75E-3   /* Constant \f$a_{\mathrm{1}}\f$ */
#define TMP006_CCONST_A2       -1.678E-5 /* Constant \f$a_{\mathrm{2}}\f$ */
#define TMP006_CCONST_TREF     298.15    /* Constant \f$T_{\mathrm{REF}}\f$ */
#define TMP006_CCONST_B0       -2.94E-5  /* Constant \f$b_{\mathrm{0}}\f$ */
#define TMP006_CCONST_B1       -5.7E-7   /* Constant \f$b_{\mathrm{1}}\f$ */
#define TMP006_CCONST_B2       4.63E-9   /* Constant \f$b_{\mathrm{2}}\f$ */
#define TMP006_CCONST_C2       13.4      /* Constant \f$c_{\mathrm{2}}\f$ */
#define TMP006_CCONST_LSB_SIZE 156.25E-9 /* Sensor Voltage Register LSB Size */

typedef enum {
    TMP006_SEN,
    TMP007_SEN } tmp_t;

namespace upm {

/**
 * @brief TMP006 Infrared-Thermopile Sensor
 * @defgroup tmp006 libupm-tmp006
 * @ingroup ti i2c temp
 */

/**
 * @library tmp006
 * @sensor tmp006
 * @comname TMP006 IR-Thermopile Sensor
 * @type temp
 * @man ti
 * @web http://www.ti.com/product/TMP006/datasheet/abstract#SBOS5183423
 * @con i2c
 *
 * @brief API for the TMP006 IR-Thermopile Sensor
 *
 * Description in web-link above:
 * The TMP006 and TMP006B are fully integrated MEMs thermopile sensors that
 * measure the temperature of an object without having to be in direct contact.
 * The thermopile absorbs passive infrared energy from an object at wavelengths
 * between 4 um to 16 um within the end-user defined field of view.
 * The corresponding change in voltage across the thermopile is digitized and
 * reported with the on-chip die thermal sensor measurement through an I2C- and
 * SMBus-compatible interface. With this data, the target object temperature
 * can be calculated by an external processor.
 * The Infrared thermopile sensor is specified to operate from
 * -40 to +125 [degC]. It is possible to measure an object temperature beyond
 * the device operating range as long as the device itself does not exceed the
 * operating temperature range (-40 to +125 [degC]).
 *
 * @snippet tmp006.cxx Interesting
 */
class TMP006 {
    public:
        /**
         *
         * Instantiates an TMP006 object
         *
         * @param bus Number of the used bus
         * @param conv_rate Conversation rate (allowed between 0 and 4)
         * @param devAddr Address of the used I2C device
         */
        TMP006 (int bus, uint8_t conv_rate=TMP006_CONFIG_CR_DEF,
                                  int devAddr=TMP006_I2C_ADDRESS);

        /**
         * Check device_id of sensor
         *
         * @return  0 on succes
         *         -1 on error
         */
        int checkID(void);

        /**
         * Performs a soft reset of the TMP006 device to ensure
         * it is in a known state.
         */
        void resetSensor(void);

        /**
         * Set active mode, this enables periodic measurements.
         */
        void setActive(void);

        /**
         * Set standby mode, this disables periodic measurements.
         */
        void setStandby(void);

        /**
         * Read out data of regs and call further function
         * Also saves converted value to variable
         */
        int sampleData(void);

        /**
         * Convert raw sensor values to temperature.
         *
         * @param rawv Object voltage value
         * @param rawt Raw die temperature value
         * @param tamb Converted ambient temperature
         * @param tobj Converted object temperature
         */
        void convert_data(int16_t rawv,int16_t rawt, float *tamb, float *tobj);

        /**
         * Get the calculated object temperature [degC]
         *
         * @param bSampleData Flag to read sensor
         * @return The object temp in degC on success
         *         and -273.2 on 'conversation in progress'
         */
        float getTemperature(int bSampleData = 0);

        /**
         * Get value of configuration reg
         */
        uint16_t getConfig(void);

    private:

        std::string m_name;

        int m_controlAddr;
        int m_bus;
        mraa::I2c m_i2ControlCtx;
        tmp_t sensorType;

        int32_t m_temperature;
};

}


text:
<?php

namespace Xidea\Person;

/**
 * @author Artur Pszczółka <a.pszczolka@xidea.pl>
 */
abstract class Events
{
    /**
     * The PRE_SAVE event occurs when the person is saved.
     */
    const PRE_SAVE = 'xidea_person.person.pre_save';

    /**
     * The POST_SAVE event occurs when the person is saved.
     */
    const POST_SAVE = 'xidea_person.person.post_save';

    /**
     * The CREATE_INITIALIZE event occurs when the create process is initialized.
     */
    const CREATE_INITIALIZE = 'xidea_person.person.create_initialize';

    /**
     * The PRE_CREATE event occurs when the create process is initialized.
     */
    const PRE_CREATE = 'xidea_person.person.pre_create';

    /**
     * The CREATE_SUCCESS event occurs when the create process is initialized.
     */
    const CREATE_SUCCESS = 'xidea_person.person.create_success';

    /**
     * The CREATE_FORM_VALID event occurs when the create process is initialized.
     */
    const CREATE_FORM_VALID = 'xidea_person.person.create_form_valid';

    /**
     * The CREATE_COMPLETED event occurs when the create process is initialized.
     */
    const CREATE_COMPLETED = 'xidea_person.person.create_completed';

}


text:
/)
{
    D3D12SingleGpu sample(1200, 900, L"");
    auto viewProvider = ref new ViewProvider(reinterpret_cast<UINT_PTR>(&sample));

    Windows::ApplicationModel::Core::CoreApplication::Run(viewProvider);
    return 0;
}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:ns1="urn:oasis:names:tc:xliff:document:1.2">
    <!-- From: file:/tmp/tmp-deduplicated2941550394266788208/blaze-out/gcc-4.X.Y-crosstool-v18-hybrid-grtev4-k8-opt/genfiles/java/com/google/android/gmscore/integ/client/cast/res/values-pl/cast_strings.xml -->
    <eat-comment/>
    <string msgid="5319032370587661362" name="cast_notification_connected_message">"Połączono z <ns1:g id="NAME">%1$s</ns1:g>"</string>
    <string msgid="2758865089947797888" name="cast_notification_connecting_message">"Łączę z <ns1:g id="NAME">%1$s</ns1:g>"</string>
    <string msgid="5232008641593292969" name="cast_notification_disconnect">"Odłącz"</string>
</resources>


text:
include_recipe 'chef-openstack::common'

packages = %w[openstack-dashboard
              apache2
              libapache2-mod-wsgi
              memcached
              python-memcache
              node-less]

services = %w[apache2
              memcached]

packages.each do |pkg|
  package pkg do
    action :install
  end
end

services.each do |srv|
  service srv do
    action :nothing
  end
end

package 'openstack-dashboard-ubuntu-theme' do
  action :purge
end

template '/etc/apache2/conf-available/openstack-dashboard.conf' do
  source 'horizon/openstack-dashboard.conf.erb'
  owner 'root'
  group 'root'
  mode 00755
  notifies :restart, resources(:service => 'apache2')
  notifies :restart, resources(:service => 'memcached')
end

template '/etc/openstack-dashboard/local_settings.py' do
  source 'horizon/local_settings.py.erb'
  owner 'root'
  group 'root'
  mode 00644
  notifies :restart, resources(:service => 'apache2'), :immediately
  notifies :restart, resources(:service => 'memcached'), :immediately
end


text:
package com.navercorp.nbasearc.confmaster.server.cluster;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;

import org.junit.Test;

import com.navercorp.nbasearc.confmaster.server.MemoryObjectMapper;
import com.navercorp.nbasearc.confmaster.server.cluster.PhysicalMachineCluster.PmClusterData;

public class PmClusterDataTest {

    @Test
    public void equals() {
        PmClusterData d1 = new PmClusterData();
        assertEquals(d1, d1);

        PmClusterData d2 = new PmClusterData();
        assertEquals(d1, d2);

        d1.addPgsId(0);
        d1.addPgsId(1);
        d1.addGwId(0);
        d1.addGwId(1);
        d2.addPgsId(0);
        d2.addPgsId(1);
        d2.addGwId(0);
        d2.addGwId(1);
        assertEquals(d1, d2);

        d2.addGwId(2);
        assertNotEquals(d1, d2);
        assertNotEquals(d1, null);
        assertNotEquals(d1, new Object());
    }

    @Test
    public void pmClusterData() throws Exception {
        PmClusterData data = new PmClusterData();
        MemoryObjectMapper mapper = new MemoryObjectMapper();
        mapper.writeValueAsString(data);
    }
}


text:
from os.path import isfile, isdir
import os
from keras.models import model_from_json
from os import makedirs
from _datetime import datetime

class BaseTrainer(object):
    def __init__(self, model_name, overwrite=False):
        self.__model_name__ = model_name
        self.__overwrite__ = overwrite
        # Obtain the model
        model = self.__read_model__()
        if not model:
            print ("No previous checkpoints found for basetrainer: ", model_name)
            print ("Creating basetrainer from scratch.")
            model = self.__create_model__()
        self.__model__ = model
        self.__compile_model__()
        return self

    def get_image_shape(self):
#         return (32, 32)
        shape = self.__model__.layers[0].input_shape
        return (shape[1], shape[2]) #list(self.__model__.input.get_shape())

    def checkpoint(self):
        (json, hd5) = self.__write_model__()
        if json == None:
            print ("Model {} could not be saved.".format(self.__model_name__))
        else:
            print ("Model saved to files: {}, {}".format(json, hd5))

    def __compile_model__(self):
        raise "Not Implemented"

    def train_with(self, trainbatchgen, samples_per_epoch, validation_data=None, nb_val_samples=0, num_epochs=1):
        self.__model__.fit_generator(trainbatchgen, samples_per_epoch=samples_per_epoch, nb_epoch = num_epochs, \
                                     nb_val_samples = nb_val_samples, verbose=1, validation_data=validation_data)

    def evaluate_with(self, testbatchgen, nb_val_samples):
        [loss, accuracy] = self.__model__.evaluate_generator(testbatchgen, nb_val_samples)
        return (loss, accuracy)

    def predict(self, imagearray, batchsize=32):
        return self.__model__.predict(imagearray, batchsize, verbose=1)

    def __create_model__(self):
        raise "Virtual create_model not implemented"

    def __getlogpath__(self, iteration=None):
        if iteration==None or iteration==0:
            return os.path.join(self.__model_name__, 'command.log')
        else:
            return os.path.join(self.__model_name__, 'command_{}.log'.format(iteration))

    def __getmodelpath__(self, iteration=None):
        if iteration==None or iteration==0:
            return os.path.join(self.__model_name__, 'model.json')
        else:
            return os.path.join(self.__model_name__, 'model_{}.json'.format(iteration))

    def __getweightspath__(self, iteration=None):
        if iteration==None or iteration==0:
            return os.path.join(self.__model_name__, 'weights.hd5')
        else:
            return os.path.join(self.__model_name__, 'weights_{}.hd5'.format(iteration))

    def __write_model__(self):
        # If no folder exists, no point looking
        if not isdir(self.__model_name__):
            makedirs(self.__model_name__)

        idx = None
        if self.__overwrite__:
            idx = self.__id__
        else:
#             start = self.__id__ if not self.__id__ is None else 0
            for idx in range(0, 1000):
                if not isfile(self.__getmodelpath__(idx)):
                    break

        jsonfile = self.__getmodelpath__(idx)
        print ("Writing model to file: ", jsonfile)
        json = self.__model__.to_json()
        with open(jsonfile, 'w') as jfile:
            jfile.write(json)

        hd5file = self.__getweightspath__(idx)
        print ("Writing mweights to file: ", hd5file)
        self.__model__.save_weights(hd5file)

        return jsonfile, hd5file

    def __read_model__(self):
        # If no folder exists, no point looking
        if not isdir(self.__model_name__):
            return None

        # find the last model file in folder
        idx = None
        for idx in range(0, 1000):
            if not isfile(self.__getmodelpath__(idx)):
                    break
        if idx==0:
            return None # No model exists if it couldn't even find id = 0
        else:
            idx = idx - 1

        jsonfile = self.__getmodelpath__(idx)
        print ("Reading model from file: ", jsonfile)
        with open(jsonfile, 'r') as jfile:
            model = model_from_json(jfile.read())

        hd5file = self.__getweightspath__(idx)
        print ("Reading weights from file: ", hd5file)
        model.load_weights(hd5file)

        self.__id__ = idx

        return model

    def log_command_args(self, args):
        # If no folder exists, no point looking
        if not isdir(self.__model_name__):
            makedirs(self.__model_name__)

        idx = None
        if self.__overwrite__:
            idx = self.__id__
        else:
            for idx in range(0, 1000):
                if not isfile(self.__getlogpath__(idx)):
                    break

        logfile = self.__getlogpath__(idx)
        print ("Writing command history to file: ", logfile)
        log = "{}: ; Training: {}; NEpochs: {}; BatchSize: {}\n". format(datetime.now(), args.training_data_folders, args.num_epochs, args.batch_size)
        with open(logfile, 'w') as lfile:
            lfile.write(log)

        print ("Command log saved to file: {}".format(logfile))

        return logfile


text:
package core.ipc.repeatClient;

import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.logging.Level;
import java.util.logging.Logger;

import argo.jdom.JsonNode;
import argo.jdom.JsonNodeFactories;
import core.ipc.IIPCService;
import utilities.StringUtilities;
import utilities.json.JSONUtility;

public abstract class IPCClientService extends IIPCService {

	private static final Logger LOGGER = Logger.getLogger(IPCClientService.class.getName());
	protected static final long TIMEOUT_MS = 5000;

	protected File executingProgram; // The program used to execute this ipc client
	protected Thread mainThread, forceDestroyThread;
	protected Process mainProcess;
	protected BufferedReader input;

	public void setExecutingProgram(File executablePath) {
		if (!executablePath.canExecute()) {
			LOGGER.warning("File is not executable: " + executablePath.getAbsolutePath());
			return;
		}

		this.executingProgram = executablePath;
	}

	@Override
	public final void start() throws IOException {
		if (executingProgram == null) {
			getLogger().warning("Launcher does not exist. Doing nothing.");
			return;
		}

		if (!executingProgram.exists()) {
			getLogger().warning("Launcher " + executingProgram.getAbsolutePath() + " does not exist.");
			return;
		}

		if (!executingProgram.canExecute()) {
			getLogger().warning("Launcher " + executingProgram.getAbsolutePath() + " is not executable.");
			return;
		}

		final String[] cmd = getLaunchCmd();
		if (cmd == null) {
			getLogger().warning("Unable to retrieve launch cmd for " + getName());
			return;
		} else {
			getLogger().info("Executing " + StringUtilities.join(cmd, " ") + " in " + new File(".").getAbsolutePath());
		}

		mainThread = new Thread() {
			@Override
			public void run() {
				try {
					String line;
					ProcessBuilder processBuilder = new ProcessBuilder(cmd);
					processBuilder.directory(new File("."));
					processBuilder.redirectErrorStream(true);
					mainProcess = processBuilder.start();

					input = new BufferedReader(new InputStreamReader(mainProcess.getInputStream()));

					while ((line = input.readLine()) != null) {
						String trimmed = line.trim();
						if (trimmed.length() == 0) {
							continue;
						}

						getLogger().info("[" + getName() + "] - " + trimmed);
					}

					mainProcess.waitFor();
			    } catch (Exception e) {
			    	getLogger().log(Level.WARNING, "Encounter exception while running process: " + cmd[0] + cmd[1], e);
			    } finally {
			    	try {
						input.close();
					} catch (IOException e) {
						getLogger().log(Level.WARNING, "Failed to close input stream for " + getName(), e);
					}
			    }
			}
		};

		mainThread.start();
	}

	@Override
	public final void stop() throws IOException {
		if (forceDestroyThread != null) {
			getLogger().info("Waiting for " + getName() + " to terminate...");
			return;
		}

		forceDestroyThread = new Thread() {
			@Override
			public void run() {
				mainProcess.destroy();
				getLogger().info("Process for IPC client service destroyed...");

				try {
					Thread.sleep(TIMEOUT_MS);
				} catch (InterruptedException e) {
					getLogger().log(Level.WARNING, "Interrupted while waiting for " + getName() + " to terminate", e);
				}

				if (mainProcess.isAlive()) {
					getLogger().info("Forcing " + getName() + " termination");
					mainProcess.destroyForcibly();
				}
			}
		};
		forceDestroyThread.start();
	}

	@Override
	public final boolean isRunning() {
		boolean result = mainThread != null && mainThread.isAlive();
		if (!result) {
			forceDestroyThread = null;
		}
		return result;
	}

	@Override
	public final boolean setPort(int newPort) {
		this.port = newPort;
		return true;
	}

	@Override
	protected JsonNode getSpecificConfig() {
		JsonNode config = super.getSpecificConfig();
		return JSONUtility.addChild(config, "executing_program", executingProgram == null ?
				JsonNodeFactories.nullNode() : JsonNodeFactories.string(executingProgram.getAbsolutePath()));
	}

	@Override
	protected boolean extractSpecificConfig(JsonNode node) {
		if (!super.extractSpecificConfig(node)) {
			return false;
		}

		if (node.isNode("executing_program") && !node.isNullNode("executing_program")) {
			setExecutingProgram(new File(node.getStringValue("executing_program")));
		}

		return true;
	}

	protected abstract String[] getLaunchCmd();
}


text:
package com.mindbodyonline.ironhidetestapp.models;

import com.mindbodyonline.ironhide.Infrastructure.IronhideViews.Clickable;
import com.mindbodyonline.ironhide.Infrastructure.IronhideViews.ListAdapter;
import com.mindbodyonline.ironhide.Infrastructure.IronhideViews.NavDrawer;
import com.mindbodyonline.ironhide.PageObjects.PageObject;
import com.mindbodyonline.ironhidetestapp.R;

/**
 * Page Ojbect for {@link com.mindbodyonline.ironhidetestapp.DrawerActivity}
 */
public class DrawerModel extends PageObject {

    public NavDrawer<DrawerModel> Drawer = new NavDrawer<>(DrawerModel.class, R.id.drawer_layout);

    public ListAdapter<DrawerModel> DrawerList = new ListAdapter<>(DrawerModel.class, String.class);

    public Clickable<DrawerModel> DrawerText = new Clickable<>(DrawerModel.class, R.id.drawer_text_view);
}


text:
package org.apache.spark.sql.hive.thriftserver

import java.io.IOException
import java.util.{List => JList}
import javax.security.auth.login.LoginException

import scala.collection.JavaConverters._

import org.apache.commons.logging.Log
import org.apache.hadoop.hive.conf.HiveConf
import org.apache.hadoop.hive.shims.Utils
import org.apache.hadoop.security.UserGroupInformation
import org.apache.hive.service.Service.STATE
import org.apache.hive.service.auth.HiveAuthFactory
import org.apache.hive.service.cli._
import org.apache.hive.service.server.HiveServer2
import org.apache.hive.service.{AbstractService, Service, ServiceException}

import org.apache.spark.sql.hive.HiveContext
import org.apache.spark.sql.hive.thriftserver.ReflectionUtils._

private[hive] class SparkSQLCLIService(hiveServer: HiveServer2, hiveContext: HiveContext)
  extends CLIService(hiveServer)
  with ReflectedCompositeService {

  override def init(hiveConf: HiveConf) {
    setSuperField(this, "hiveConf", hiveConf)

    val sparkSqlSessionManager = new SparkSQLSessionManager(hiveServer, hiveContext)
    setSuperField(this, "sessionManager", sparkSqlSessionManager)
    addService(sparkSqlSessionManager)
    var sparkServiceUGI: UserGroupInformation = null

    if (UserGroupInformation.isSecurityEnabled) {
      try {
        HiveAuthFactory.loginFromKeytab(hiveConf)
        sparkServiceUGI = Utils.getUGI()
        setSuperField(this, "serviceUGI", sparkServiceUGI)
      } catch {
        case e @ (_: IOException | _: LoginException) =>
          throw new ServiceException("Unable to login to kerberos with given principal/keytab", e)
      }
    }

    initCompositeService(hiveConf)
  }

  override def getInfo(sessionHandle: SessionHandle, getInfoType: GetInfoType): GetInfoValue = {
    getInfoType match {
      case GetInfoType.CLI_SERVER_NAME => new GetInfoValue("Spark SQL")
      case GetInfoType.CLI_DBMS_NAME => new GetInfoValue("Spark SQL")
      case GetInfoType.CLI_DBMS_VER => new GetInfoValue(hiveContext.sparkContext.version)
      case _ => super.getInfo(sessionHandle, getInfoType)
    }
  }
}

private[thriftserver] trait ReflectedCompositeService { this: AbstractService =>
  def initCompositeService(hiveConf: HiveConf) {
    // Emulating `CompositeService.init(hiveConf)`
    val serviceList = getAncestorField[JList[Service]](this, 2, "serviceList")
    serviceList.asScala.foreach(_.init(hiveConf))

    // Emulating `AbstractService.init(hiveConf)`
    invoke(classOf[AbstractService], this, "ensureCurrentState", classOf[STATE] -> STATE.NOTINITED)
    setAncestorField(this, 3, "hiveConf", hiveConf)
    invoke(classOf[AbstractService], this, "changeState", classOf[STATE] -> STATE.INITED)
    getAncestorField[Log](this, 3, "LOG").info(s"Service: $getName is inited.")
  }
}


text:
using System;

namespace Gma.QrCodeNet.Encoding
{
	/// <summary>
	/// Use this exception for null or empty input string or when input string is too large.
	/// </summary>
	public class InputOutOfBoundaryException : Exception
	{
		public InputOutOfBoundaryException() : base()
		{
		}

		public InputOutOfBoundaryException(string message) : base(message)
		{
		}
	}
}


text:
.class public Lcom/android/server/pm/PersistentPreferredIntentResolver;
.super Lcom/android/server/IntentResolver;
.source "PersistentPreferredIntentResolver.java"

# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "Lcom/android/server/IntentResolver",
        "<",
        "Lcom/android/server/pm/PersistentPreferredActivity;",
        "Lcom/android/server/pm/PersistentPreferredActivity;",
        ">;"
    }
.end annotation

# direct methods
.method public constructor <init>()V
    .locals 0

    .prologue
    .line 23
    invoke-direct {p0}, Lcom/android/server/IntentResolver;-><init>()V

    return-void
.end method

# virtual methods
.method protected bridge synthetic isPackageForFilter(Ljava/lang/String;Landroid/content/IntentFilter;)Z
    .locals 1
    .param p1, "x0"    # Ljava/lang/String;
    .param p2, "x1"    # Landroid/content/IntentFilter;

    .prologue
    .line 23
    check-cast p2, Lcom/android/server/pm/PersistentPreferredActivity;

    .end local p2    # "x1":Landroid/content/IntentFilter;
    invoke-virtual {p0, p1, p2}, Lcom/android/server/pm/PersistentPreferredIntentResolver;->isPackageForFilter(Ljava/lang/String;Lcom/android/server/pm/PersistentPreferredActivity;)Z

    move-result v0

    return v0
.end method

.method protected isPackageForFilter(Ljava/lang/String;Lcom/android/server/pm/PersistentPreferredActivity;)Z
    .locals 1
    .param p1, "packageName"    # Ljava/lang/String;
    .param p2, "filter"    # Lcom/android/server/pm/PersistentPreferredActivity;

    .prologue
    .line 32
    iget-object v0, p2, Lcom/android/server/pm/PersistentPreferredActivity;->mComponent:Landroid/content/ComponentName;

    invoke-virtual {v0}, Landroid/content/ComponentName;->getPackageName()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    return v0
.end method

.method protected bridge synthetic newArray(I)[Landroid/content/IntentFilter;
    .locals 1
    .param p1, "x0"    # I

    .prologue
    .line 23
    invoke-virtual {p0, p1}, Lcom/android/server/pm/PersistentPreferredIntentResolver;->newArray(I)[Lcom/android/server/pm/PersistentPreferredActivity;

    move-result-object v0

    return-object v0
.end method

.method protected newArray(I)[Lcom/android/server/pm/PersistentPreferredActivity;
    .locals 1
    .param p1, "size"    # I

    .prologue
    .line 27
    new-array v0, p1, [Lcom/android/server/pm/PersistentPreferredActivity;

    return-object v0
.end method