text:
package org.apache.camel.model.dataformat;

import java.util.List;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

import org.apache.camel.model.DataFormatDefinition;
import org.apache.camel.spi.Metadata;

/**
 * Marshal and unmarshal Java objects to and from YAML.
 */
@Metadata(firstVersion = "2.17.0", label = "dataformat,transformation,yaml", title = "YAML")
@XmlRootElement(name = "yaml")
@XmlAccessorType(XmlAccessType.FIELD)
public class YAMLDataFormat extends DataFormatDefinition {
    @XmlAttribute
    @Metadata(defaultValue = "SnakeYAML")
    private YAMLLibrary library = YAMLLibrary.SnakeYAML;
    @XmlTransient
    private ClassLoader classLoader;
    @XmlTransient
    private Class<?> unmarshalType;
    @XmlAttribute
    private String unmarshalTypeName;
    @XmlAttribute
    private String constructor;
    @XmlAttribute
    private String representer;
    @XmlAttribute
    private String dumperOptions;
    @XmlAttribute
    private String resolver;
    @XmlAttribute
    @Metadata(javaType = "java.lang.Boolean", defaultValue = "true")
    private String useApplicationContextClassLoader = Boolean.toString(true);
    @XmlAttribute
    @Metadata(javaType = "java.lang.Boolean", defaultValue = "false")
    private String prettyFlow = Boolean.toString(false);
    @XmlAttribute
    @Metadata(javaType = "java.lang.Boolean", defaultValue = "false")
    private String allowAnyType = Boolean.toString(false);
    @XmlElement(name = "typeFilter")
    private List<YAMLTypeFilterDefinition> typeFilters;
    @XmlAttribute
    @Metadata(javaType = "java.lang.Integer", defaultValue = "50")
    private String maxAliasesForCollections = "50";
    @XmlAttribute
    @Metadata(javaType = "java.lang.Boolean")
    private String allowRecursiveKeys;

    public YAMLDataFormat() {
        this(YAMLLibrary.SnakeYAML);
    }

    public YAMLDataFormat(YAMLLibrary library) {
        super("yaml-" + library.name().toLowerCase());
        this.library = library;
    }

    public YAMLDataFormat(YAMLLibrary library, Class<?> unmarshalType) {
        super("yaml-" + library.name().toLowerCase());
        this.library = library;
        this.unmarshalType = unmarshalType;
    }

    public YAMLLibrary getLibrary() {
        return library;
    }

    /**
     * Which yaml library to use.
     * <p/>
     * By default it is SnakeYAML
     */
    public void setLibrary(YAMLLibrary library) {
        this.library = library;
        setDataFormatName("yaml-" + library.name().toLowerCase());
    }

    public Class<?> getUnmarshalType() {
        return unmarshalType;
    }

    /**
     * Class of the object to be created
     */
    public void setUnmarshalType(Class<?> type) {
        this.unmarshalType = type;
    }

    public String getUnmarshalTypeName() {
        return unmarshalTypeName;
    }

    /**
     * Class name of the java type to use when unmarshalling
     */
    public void setUnmarshalTypeName(String unmarshalTypeName) {
        this.unmarshalTypeName = unmarshalTypeName;
    }

    public ClassLoader getClassLoader() {
        return classLoader;
    }

    /**
     * Set a custom classloader
     */
    public void setClassLoader(ClassLoader classLoader) {
        this.classLoader = classLoader;
    }

    public String getConstructor() {
        return constructor;
    }

    /**
     * BaseConstructor to construct incoming documents.
     */
    public void setConstructor(String constructor) {
        this.constructor = constructor;
    }

    public String getRepresenter() {
        return representer;
    }

    /**
     * Representer to emit outgoing objects.
     */
    public void setRepresenter(String representer) {
        this.representer = representer;
    }

    public String getDumperOptions() {
        return dumperOptions;
    }

    /**
     * DumperOptions to configure outgoing objects.
     */
    public void setDumperOptions(String dumperOptions) {
        this.dumperOptions = dumperOptions;
    }

    public String getResolver() {
        return resolver;
    }

    /**
     * Resolver to detect implicit type
     */
    public void setResolver(String resolver) {
        this.resolver = resolver;
    }

    public String getUseApplicationContextClassLoader() {
        return useApplicationContextClassLoader;
    }

    /**
     * Use ApplicationContextClassLoader as custom ClassLoader
     */
    public void setUseApplicationContextClassLoader(String useApplicationContextClassLoader) {
        this.useApplicationContextClassLoader = useApplicationContextClassLoader;
    }

    public String getPrettyFlow() {
        return prettyFlow;
    }

    /**
     * Force the emitter to produce a pretty YAML document when using the flow style.
     */
    public void setPrettyFlow(String prettyFlow) {
        this.prettyFlow = prettyFlow;
    }

    public String getAllowAnyType() {
        return allowAnyType;
    }

    /**
     * Allow any class to be un-marshaled
     */
    public void setAllowAnyType(String allowAnyType) {
        this.allowAnyType = allowAnyType;
    }

    public List<YAMLTypeFilterDefinition> getTypeFilters() {
        return typeFilters;
    }

    /**
     * Set the types SnakeYAML is allowed to un-marshall
     */
    public void setTypeFilters(List<YAMLTypeFilterDefinition> typeFilters) {
        this.typeFilters = typeFilters;
    }

    public String getMaxAliasesForCollections() {
        return maxAliasesForCollections;
    }

    /**
     * Set the maximum amount of aliases allowed for collections.
     */
    public void setMaxAliasesForCollections(String maxAliasesForCollections) {
        this.maxAliasesForCollections = maxAliasesForCollections;
    }

    public String getAllowRecursiveKeys() {
        return allowRecursiveKeys;
    }

    /**
     * Set whether recursive keys are allowed.
     */
    public void setAllowRecursiveKeys(String allowRecursiveKeys) {
        this.allowRecursiveKeys = allowRecursiveKeys;
    }
}


text:
<?php
/**
 * Template part for displaying posts.
 *
 * @link https://codex.wordpress.org/Template_Hierarchy
 *
 * @package portfolio
 */

?>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

		<?php the_title( sprintf( '
', esc_url( get_permalink() ) ), '
' ); ?>

		<?php if ( 'post' === get_post_type() ) : ?>

			<?php rohan_portfolio_posted_on(); ?>

		<?php endif; ?>

		<?php
			the_content( sprintf(
				/* translators: %s: Name of current post. */
				wp_kses( __( 'Continue reading %s →', 'rohan-portfolio' ), array( 'span' => array( 'class' => array() ) ) ),
				the_title( '"', '"', false )
			) );
		?>

		<?php
			wp_link_pages( array(
				'before' => '
' . esc_html__( 'Pages:', 'rohan-portfolio' ),
				'after'  => '
',
			) );
		?>

		<?php rohan_portfolio_entry_footer(); ?>

redpajama_set_name: RedPajamaGithub


text:
package com.xtremelabs.robolectric.shadows;

import android.app.Activity;
import android.content.Context;
import android.widget.AbsSeekBar;
import com.xtremelabs.robolectric.Robolectric;
import com.xtremelabs.robolectric.WithTestDefaultsRunner;
import org.junit.Test;
import org.junit.runner.RunWith;

import static org.hamcrest.CoreMatchers.instanceOf;
import static org.junit.Assert.assertThat;

@RunWith(WithTestDefaultsRunner.class)
public class AbsSeekBarTest {

	@Test
	public void testInheritance() {
		TestAbsSeekBar seekBar = new TestAbsSeekBar(new Activity());
		ShadowAbsSeekBar shadow = Robolectric.shadowOf(seekBar);
		assertThat(shadow, instanceOf(ShadowProgressBar.class));
	}

	private static class TestAbsSeekBar extends AbsSeekBar {

		public TestAbsSeekBar(Context context) {
			super(context);
		}
	}
}


text:
ActiveRecord::Schema.define(version: 20150628195858) do

  # These are extensions that must be enabled in order to support this database
  enable_extension "plpgsql"

  create_table "invitations", force: :cascade do |t|
    t.integer  "pool_id"
    t.integer  "guest_id"
    t.string   "confirmation_status", default: "pending"
    t.datetime "created_at",                              null: false
    t.datetime "updated_at",                              null: false
  end

  add_index "invitations", ["pool_id"], name: "index_invitations_on_pool_id", using: :btree

  create_table "pools", force: :cascade do |t|
    t.string   "name"
    t.integer  "pool_amount"
    t.integer  "life_raft"
    t.integer  "cycle"
    t.integer  "member_limit"
    t.string   "status",       default: "open"
    t.integer  "reciever_id"
    t.datetime "created_at",                    null: false
    t.datetime "updated_at",                    null: false
    t.integer  "lifeguard_id"
    t.date     "start_date"
  end

  create_table "swimmers", force: :cascade do |t|
    t.integer  "pool_id"
    t.integer  "user_id"
    t.datetime "created_at",                  null: false
    t.datetime "updated_at",                  null: false
    t.datetime "payday_date"
    t.boolean  "recieved",    default: false
    t.date     "paydate"
  end

  add_index "swimmers", ["pool_id"], name: "index_swimmers_on_pool_id", using: :btree
  add_index "swimmers", ["user_id"], name: "index_swimmers_on_user_id", using: :btree

  create_table "users", force: :cascade do |t|
    t.string   "first_name"
    t.string   "last_name"
    t.integer  "credibility",   default: 500
    t.string   "email"
    t.datetime "created_at",                  null: false
    t.datetime "updated_at",                  null: false
    t.string   "provider"
    t.string   "uid"
    t.string   "profile_photo"
    t.string   "stripeid"
  end

  add_foreign_key "invitations", "pools"
  add_foreign_key "swimmers", "pools"
  add_foreign_key "swimmers", "users"
end


text:
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CartaMei.Common
{
    public interface IMapObject : INotifyPropertyChanged
    {
        #region Properties

        string Name { get; set; }

        ObservableCollection<IMapObject> Items { get; }

        IEnumerable<IButtonModel> ContextMenu { get; }

        bool ShowOnDesign { get; }

        bool ShowOnExport { get; }

        bool IsActive { get; set; }

        void Select();

        void DoubleClick();

        #endregion
    }

    public class MapObject : NotifyPropertyChangedBase, IMapObject
    {
        #region Constructor

        public MapObject()
        {
            this.ShowOnDesign = true;
            this.ShowOnExport = true;
            this.IsActive = true;
        }

        #endregion

        #region Properties

        private string _name;
        [Category("General")]
        [Description("The name of the object.")]
        [DisplayName("Name")]
        public virtual string Name
        {
            get { return _name; }
            set
            {
                if (value != _name)
                {
                    _name = value;
                    onPropetyChanged();
                }
            }
        }

        private ObservableCollection<IMapObject> _items;
        [Browsable(false)]
        public virtual ObservableCollection<IMapObject> Items
        {
            get { return _items; }
            set
            {
                if (value != _items)
                {
                    _items = value;
                    onPropetyChanged();
                }
            }
        }

        [Browsable(false)]
        public virtual IEnumerable<IButtonModel> ContextMenu { get { return null; } }

        private bool _showOnDesign;
        [Category("General")]
        [Description("When on, this means that the object will appear on the design canvas.")]
        [DisplayName("Show On Design")]
        public virtual bool ShowOnDesign
        {
            get { return _showOnDesign; }
            set
            {
                if (value != _showOnDesign)
                {
                    _showOnDesign = value;
                    onPropetyChanged();
                }
            }
        }

        private bool _showOnExport;
        [Category("General")]
        [Description("When on, this means that the object will appear on the exported document.")]
        [DisplayName("Show On Export")]
        public virtual bool ShowOnExport
        {
            get { return _showOnExport; }
            set
            {
                if (value != _showOnExport)
                {
                    _showOnExport = value;
                    onPropetyChanged();
                }
            }
        }

        private bool _isActive;
        [Category("General")]
        [Description("When off, this means that the object will not appear at all.")]
        [DisplayName("Is Active")]
        public virtual bool IsActive
        {
            get { return _isActive; }
            set
            {
                if (value != _isActive)
                {
                    _isActive = value;
                    onPropetyChanged();
                }
            }
        }

        public virtual void Select() { }

        public virtual void DoubleClick() { }

        #endregion
    }

    public class MapLeafObject : NotifyPropertyChangedBase, IMapObject
    {
        #region Properties

        private string _name;
        [Category("General")]
        [Description("The name of the object.")]
        [DisplayName("Name")]
        public virtual string Name
        {
            get { return _name; }
            set
            {
                if (value != _name)
                {
                    _name = value;
                    onPropetyChanged();
                }
            }
        }

        [Browsable(false)]
        public virtual ObservableCollection<IMapObject> Items { get { return null; } }

        private ILayer _layer;
        [Browsable(false)]
        public virtual ILayer Layer
        {
            get { return _layer; }
            set
            {
                if (value != _layer)
                {
                    _layer = value;
                    onPropetyChanged();
                }
            }
        }

        [Browsable(false)]
        public virtual IEnumerable<IButtonModel> ContextMenu { get { return null; } }

        [Browsable(false)]
        public virtual object Properties { get { return this; } }

        [Category("General")]
        [Description("When on, this means that the object will appear on the design canvas.")]
        [DisplayName("Show On Design")]
        public virtual bool ShowOnDesign { get { return true; } }

        [Category("General")]
        [Description("When on, this means that the object will appear on the exported document.")]
        [DisplayName("Show On Export")]
        public virtual bool ShowOnExport { get { return true; } }

        private bool _isActive;
        [Category("General")]
        [Description("When off, this means that the object will not appear at all.")]
        [DisplayName("Is Active")]
        public virtual bool IsActive
        {
            get { return _isActive; }
            set
            {
                if (value != _isActive)
                {
                    _isActive = value;
                    onPropetyChanged();
                }
            }
        }

        public virtual void Select() { }

        public virtual void DoubleClick() { }

        #endregion
    }
}


text:
package client

import (
	"bytes"
	"encoding/json"
	"errors"
	"fmt"
	"io"
	"io/ioutil"
	"log"
	"net/http"
)

var _ = log.Print

func (bc *Client) makeRequest(method string, url string, entity interface{}) (*http.Request, *http.Response, error) {
	req, err := bc.buildRequest(method, url, entity)
	if err != nil {
		return req, nil, err
	}
	res, err := http.DefaultClient.Do(req)
	return req, res, err
}

func (bc *Client) buildRequest(method string, url string, entity interface{}) (*http.Request, error) {
	body, err := encodeEntity(entity)
	if err != nil {
		return nil, err
	}

	req, err := http.NewRequest(method, url, body)
	if err != nil {
		return req, err
	}

	req.Header.Set("content-type", "application/json")
	if bc.AccessToken != "" {
		req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", bc.AccessToken))
	}

	return req, err
}

func encodeEntity(entity interface{}) (io.Reader, error) {
	if entity == nil {
		return nil, nil
	}
	b, err := json.Marshal(entity)
	if err != nil {
		return nil, err
	}
	return bytes.NewBuffer(b), nil

}

func unmarshalResponse(r *http.Response, data interface{}) error {
	respBody, err := ioutil.ReadAll(r.Body)
	if err != nil {
		return errors.New("Cannot read response from body")
	}
	err = json.Unmarshal(respBody, data)
	if err != nil {
		fmt.Printf("%T\n%s\n%#v\n", err, err, err)
		return errors.New("Cannot unmarshal json data")
	}
	return nil

}

func checkStatusOK(status int) bool {
	if status >= 500 {
		return false
	}
	return true
}

func checkAuthOK(status int) bool {
	if status == 401 || status == 403 {
		return false
	}
	return true
}

func handleAuthNOK(status int) {
	switch status {
	case 401:
		fmt.Println("Unauthorized. Please check the provided token.")
	case 403:
		fmt.Println("You are not authorized to perform this action.")
	}
}

func handleStatusNOK(status int) {
	switch status {
	case 500:
		fmt.Println("Internal error.")
	case 503:
		fmt.Println("Service unavailable, please check your config.")
	default:
		fmt.Println("Generic error.")
	}
}


text:
require 'packer/builder'
require 'packer/dataobject'

module Packer
  class Builder < Packer::DataObject
    class Amazon < Builder
      def initialize
        super
        self.add_required(
          'ami_name',
          'instance_type',
          'region',
          'source_ami',
          'communicator'
        )
        self.communicators = %w(none ssh winrm)
      end

      def access_key(key)
        self.__add_string('access_key', key)
      end

      def ami_name(name)
        self.__add_string('ami_name', name)
      end

      def instance_type(type)
        self.__add_string('instance_type', type)
      end

      def region(name)
        self.__add_string('region', name)
      end

      def source_ami(name)
        self.__add_string('source_ami', name)
      end

      def secret_key(key)
        self.__add_string('secret_key', key)
      end

      def ami_block_device_mappings(mappings)
        self.__add_array_of_hashes('ami_block_device_mappings', mappings)
      end

      def ami_description(description)
        self.__add_string('ami_description', description)
      end

      def ami_groups(groups)
        self.__add_array_of_strings('ami_groups', groups)
      end

      def ami_product_codes(codes)
        self.__add_array_of_strings('ami_product_codes', codes)
      end

      def ami_regions(regions)
        self.__add_array_of_strings('ami_regions', regions)
      end

      def ami_users(users)
        self.__add_array_of_strings('ami_users', users)
      end

      def ami_virtualization_type(type)
        self.__add_string('ami_virtualization_type', type)
      end

      def associate_public_ip_address(bool)
        self.__add_boolean('associate_public_ip_address', bool)
      end

      def availability_zone(zone)
        self.__add_string('availability_zone', zone)
      end

      def enhanced_networking(bool)
        self.__add_boolean('enhanced_networking', bool)
      end

      def iam_instance_profile(profile)
        self.__add_string('iam_instance_profile', profile)
      end

      def launch_block_device_mappings(mappings)
        self.__add_array_of_hashes('launch_block_device_mappings', mappings)
      end

      def run_tags(tags)
        self.__add_hash('run_tags', tags)
      end

      def security_group_id(id)
        self.__add_string('security_group_id', id, %w[security_group_ids])
      end

      def security_group_ids(ids)
        self.__add_array_of_strings('security_group_ids', ids, %w[security_group_id])
      end

      def subnet_id(id)
        self.__add_string('subnet_id', id)
      end

      def tags(tags)
        self.__add_hash('tags', tags)
      end

      def temporary_key_pair_name(name)
        self.__add_string('temporary_key_pair_name', name)
      end

      def user_data(data)
        self.__add_string('user_data', data)
      end

      def user_data_file(file)
        self.__add_string('user_data_file', file)
      end

      def vpc_id(id)
        self.__add_string('vpc_id', id)
      end

      class EBS < Amazon
        def initialize
          super
          self.data['type'] = AMAZON_EBS
        end
      end

      class Instance < Amazon
        def initialize
          super
          self.data['type'] = AMAZON_INSTANCE
          self.add_required(
            'account_id',
            's3_bucket',
            'x509_cert_path',
            'x509_key_path'
          )
        end

        def account_id(id)
          self.__add_string('account_id', id)
        end

        def s3_bucket(bucket)
          self.__add_string('s3_bucket', bucket)
        end

        def x509_cert_path(path)
          self.__add_string('x509_cert_path', path)
        end

        def x509_key_path(path)
          self.__add_string('x509_key_path', path)
        end

        def bundle_destination(directory)
          self.__add_string('bundle_destination', directory)
        end

        def bundle_prefix(prefix)
          self.__add_string('bundle_prefix', prefix)
        end

        def bundle_upload_command(command)
          self.__add_string('bundle_upload_command', command)
        end

        def bundle_vol_command(command)
          self.__add_string('bundle_vol_command', command)
        end

        def x509_upload_path(path)
          self.__add_string('x509_upload_path', path)
        end
      end
    end
  end
end


text:
<!doctype html>

    <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="A layout example that shows off a blog page with a list of posts.">

    <title>Si Chen's Homepage</title>

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">

<link rel="stylesheet" href="{{ url_for('static', filename='pure/pure-min.css') }}">

<link rel="stylesheet" href="{{ url_for('static', filename='pure/grids-responsive-min.css') }}">

        <link rel="stylesheet" href="{{ url_for('static', filename='css/layouts/blog.css') }}">

Si Chen

Department of Computer Science and Engineering

University at Buffalo - SUNY

Office: 301 Davis Hall, Buffalo NY

About Me

                         Mail

                          CV

                         Google Scholar

                         Research Gate

                         Blog

                        GitHub

I am a final year PhD student at University at Buffalo - SUNY in the Department of Computer Science and Engineering under the supervision of Dr. Kui Ren. I'm also a member of the Ubiquitous Security and Privacy Research Laboratory
(UbiSeC Lab)

During my PhD study, my primary research topic is exploring the novel ideas and techniques to solve practical problems and security issues for mobile sensing and cyber physical systems. In the context of mobile sensing systems, I am interested in smartphone-enabled crowdsourcing approaches that can help build large-scale information infrastructures conveniently at a very low cost. I also study cyber-physical system security from the physical layer, leveraging various related characteristics to enable inherently secure and dependable wireless communications.

In my sparetime, I actively participate volunteer computing projects to power cutting-edge research in health, poverty and sustainability:

 {% for badge in badges %}

                {% endfor %}

Research Interests

My research interests include physical layer security, cyber-physical system security, wireless system and smartphone-enabled crowdsourcing system, with current focus on exploring and improving the cloud-assisted mobile sensing security.

Recent publications and pre-prints

                            {% for entrie in entries %}

                                {% if entrie['type'] == 1 %}
                                C
                                {% endif %}
                                {% if entrie['type'] == 2 %}
                                J
                                {% endif %}
                                {% if entrie['type'] == 3 %}
                                P
                                {% endif %}
                                {% if entrie['type'] == 4 %}
                                B
                                {% endif %}
                                <tit>{{ entrie['title'] }}</tit>
 <author>{{ entrie['author'] }}.</author>
<conf>{{ entrie['confname'] }}</conf>

                                {% if entrie['type'] == 1 %}
                                , {{ entrie['place'] }}.
                                {% else %}
                                .
                                {% endif %}
                                {% if entrie['urlpaper'] %}

 [paper]
                                {% endif %}
                                {% if entrie['urlslides'] %}
                                    | [slides]
                                {% endif %}

                                {{ entrie['cite'] }}

                                {{ entrie['year'] }}

                            {% endfor %}

Honors and Awards

 The 19th Annual International Conference on Mobile Computing and Networking (ACM Mobicom'13) App Competition Finalists (Video), 2013

 Student Travel Grant Awards, IEEE ICDCS, 2015

 Top 100 Excellent Graduate Theses in China Agricultural University, 2010

 Excellent Graduate Award in China Agricultural University, 2010

 National University Student Innovation Program Award, 2009-2010

 Undergraduate Research Program Award, 2007-2008

 Third Prize of International Interdisciplinary Contest in Modeling (ICM), 2009

 Third Prize of Scholarship for Excellent Academic Performance, 2007, 2008, 2009

 Awarded "The best debater" title in debate competitions, 2006, 2007

Professional Services

Technical Program Committee (TPC) for Milcom 2016

 Conference Reviewer for AsiaCCS'16, ICCCN'16, ACM CCS'15, ICDCS'15, ESORICS'15, AsiaCCS'15, Cloud'15, ICCCN'15, DBSec'15, CoudCom'15, ACM CHI'15, CloudNet'15, ISC'15, Securecomm'15, IEEE MSN'15, IPCCC'15, INFOCOM'14, ACM CCS'14, ICDCS'14, ESORICS'14, ICNP'14, AisaCCS'14, MobiHoc'14, CNS'14, CloudNet'14,DBSec'14, SecureComm'14.

 Journal Reviewer for IEEE Trans. on Parallel and Distributed Systems, IEEE Trans. on Services Computing, IEEE Trans. on Smart Grid, IEEE Trans. on Vehicular Technology, IEEE Trans. on Wireless Communications, IEEE Security & Privacy magazine, IEEE Network Magazine, Journal of Computer Security, Journal of Mobile Communication, Com- putation and Information, Journal of Parallel and Distributed Computing.

Webchair for the 27th IEEE Annual Computer Communications Workshop (CCW'13).

Teaching Experience

 Teaching Assistant:

  CSE 241 Digital Systems (S'16)

  CSE 664 Applied Cryptography and Computer Security (S'14)

                            Guest Lecturer:

  CSE 706 Seminar: Selected Topics in Privacy and Security (F'15)

  CSE 706 Seminar: Sensing, Crowdsourcing with Smartphones and Wearable Devices (F'14)

  CSE 706 Seminar: Security and Privacy in Emerging Applications (F'13)

  CSE 706 Seminar: Advanced Topics on Privacy Enhancing Technologies (F'12)

 © 2016 Si Chen. All Rights Reserved | Design by Si Chen | Powered by Dodrio, Flask, Purecss.io


text:
import LoggerInterface from './interface';
import * as util from '../lib/util';

/**
 * Localstorage protocol
 * @class LocalStorageLogger
 */
export default class LocalStorageLogger extends LoggerInterface {
    /**
     * Localstorage protocol constructor
     * @constructor
     * @param {String} namespace - namespace to use
     */
    constructor(...args) {
        super(...args);
    }

    /**
     * add a log record
     * @method _reocrd
     * @private
     * @parma {String} level - log level
     * @param {String} descriptor - to speed up search and improve understanding
     * @param {Mixed} [data] - additional data
     */
    _record(level, descriptor, data) {
        var logs;
        try {
            logs = window.localStorage.getItem(LocalStorageLogger._database) ? JSON.parse(window.localStorage.getItem(LocalStorageLogger._database)) : [];
            logs.push([
                Date.now(),
                this._namespace,
                level,
                descriptor,
                data
            ]);
            util.debug(this._namespace, level, descriptor, data);
            window.localStorage.setItem(LocalStorageLogger._database, JSON.stringify(logs));
        } catch (e) {
            window.localStorage.removeItem(LocalStorageLogger._database);
            window.localStorage.setItem(LocalStorageLogger._database, JSON.stringify([]));
            util.throwError('failed to write, may be localStorage is full, ' + e.message);
        }
    }

    /**
     * initialize protocol
     * @method init
     * @static
     * @param {String} database - database name to use
     */
    static init(database) {
        try {
            if (!LocalStorageLogger.support) {
                util.throwError('your platform does not support localstorage protocol.');
            }
            LocalStorageLogger._database = database || 'logline';
            if (!window.localStorage.getItem(LocalStorageLogger._database)) {
                window.localStorage.setItem(LocalStorageLogger._database, JSON.stringify([]));
            }
            LocalStorageLogger.status = super.STATUS.INITED;
        } catch (e) {
            util.throwError('failed to init, ' + e.message);
        }
    }

    /**
     * get logs in range
     * if from and end is not defined, will fetch full log
     * @method get
     * @static
     * @param {String} from - time from, unix time stamp or falsy
     * @param {String} to - time end, unix time stamp or falsy
     * @param {Function} readyFn - function to call back with logs as parameter
     */
    static get(from, to, readyFn) {
        var logs, i;
        try {
            logs = JSON.parse(window.localStorage.getItem(LocalStorageLogger._database));

            from = LoggerInterface.transTimeFormat(from);
            to = LoggerInterface.transTimeFormat(to);

            for (i = 0; i < logs.length; i++) {
                if ((from && logs[i][0] < from) || (to && logs[i][0] > to)) {
                    continue;
                }

                logs[i] = {
                    time: logs[i][0],
                    namespace: logs[i][1],
                    level: logs[i][2],
                    descriptor: logs[i][3],
                    data: logs[i][4]
                };
            }
            readyFn(logs);
        } catch (e) {
            util.throwError('failed to get, ' + e.message);
            readyFn([]);
        }
    }

    /**
     * clean logs = keep limited logs
     * @method keep
     * @static
     * @param {Number} daysToMaintain - keep logs within days
     */
    static keep(daysToMaintain) {
        var logs;
        try {
            logs = !daysToMaintain ? [] : (window.localStorage.getItem(LocalStorageLogger._database) ? JSON.parse(window.localStorage.getItem(LocalStorageLogger._database)) : []).filter(log => {
                return log.time >= (Date.now() - (daysToMaintain || 2) * 24 * 3600 * 1000);
            });
            window.localStorage.setItem(LocalStorageLogger._database, JSON.stringify(logs));
        } catch (e) {
            util.throwError('failed to keep, ' + e.message);
        }
    }

    /**
     * delete log database
     * @method clean
     * @static
     */
    static clean() {
        try {
            delete LocalStorageLogger.status;
            window.localStorage.removeItem(LocalStorageLogger._database);
        } catch (e) {
            util.throwError('failed to clean, ' + e.message);
        }
    }

    /**
     * detect support situation
     * @prop {Boolean} support
     */
    static get support() {
        return 'localStorage' in window;
    }
}


text:
Photography

I enjoy playing around with cameras and making photos. While a lot of my work makes its way to Instagram, you can explore a different dimension of it on my photoblog.

                    Visit Photoblog


text:
Use github's interface to make a fork of the repo, then add that repo as an upstream remote:

```
git remote add upstream https://github.com/reactorcore/<NAME_OF_REPO>.git
```

### Cut a namespaced feature branch from master

Your branch should follow this naming convention:
  - bug/...
  - feat/...
  - test/...
  - doc/...
  - refactor/...

These commands will help you do this:

``` bash

# Creates your branch and brings you there
git checkout -b `your-branch-name`
```

### Make commits to your feature branch.

Prefix each commit like so
  - (feat) Added a new feature
  - (fix) Fixed inconsistent tests [Fixes #0]
  - (refactor) ...
  - (cleanup) ...
  - (test) ...
  - (doc) ...

Make changes and commits on your branch, and make sure that you
only make changes that are relevant to this branch. If you find
yourself making unrelated changes, make a new branch for those
changes.

### Rebase upstream changes into your branch

Once you are done making changes, you can begin the process of getting
your code merged into the main repo.

First switch to your master branch and grab the latest updates from upstream

```bash
git checkout master
git pull --rebase upstream master
```

Then go back to your branch and rebase those changes to your branch:

```bash
git checkout `your-branch-name`
git rebase master
```

If a conflict arises between your new code and what exists on upstream,
git will yell at you to fix the conflicts. To get a better picture of what
conflicts you need to fix, type:

```bash
git status
```

You should see a picture something like this:

In this example, it's saying there's a conflict in the package.json file. If you navigate to that file in your editor (sublime or atom), you'll see something like this:

In this particular example, Maurice had added the dependencies mysql and sequelize while I had added request. To resolve this issue, simply delete the text that git inserted (the red highlighted text), and format the package.json to include all 3 (mysql, sequelize, and request):

Once you are done fixing conflicts for a specific commit, run:

```bash
git rebase --continue
```

This will continue the rebasing process. If all conflicts are resolved,
the rebase should complete. Go back to master and merge your branch with your
master as follows:

```bash
git checkout master
git merge --ff-only `your-branch-name`
```

Finally, push your code to your fork (origin), but with the same
branch name as the branch you've been working on (not to orgin master)

```bash
git push origin master
```

Note: If you run into difficulty pushing to your origin (i.e.
it says your local master has diverged from origin/master), you can force
a push with:

```bash
git push origin master -f
```

### Make a pull request

Make a clear pull request from your fork and branch to the upstream master
branch, detailing exactly what changes you made and what feature this
should add. The clearer your pull request is the faster you can get
your changes incorporated into this repo.

At least one other person MUST give your changes a code review, and once
they are satisfied they will merge your changes into upstream. Alternatively,
they may have some requested changes. You should make more commits to your
branch to fix these, then follow this process again from rebasing onwards.

If all changes are good to go, instead of doing the default merge, select the
drop down arrow next to the button and select the "Rebase and merge" option:

This should give us a nice, clean, linear history :)

Thanks for contributing!

### Guidelines

1. Uphold the current code standard:
    - Keep your code [DRY][].
    - Apply the [boy scout rule][].
    - Follow [STYLE-GUIDE.md](STYLE-GUIDE.md)
1. Run the [tests][] before submitting a pull request.
1. Tests are very, very important. Submit tests if your pull request contains
   new, testable behavior.
1. Your pull request is comprised of a single ([squashed][]) commit.

## Checklist:

This is just to help you organize your process

- [ ] Did I cut my work branch off of master (don't cut new branches from existing feature brances)?
- [ ] Did I follow the correct naming convention for my branch?
- [ ] Is my branch focused on a single main change?
 - [ ] Do all of my changes directly relate to this change?
- [ ] Did I rebase the upstream master branch after I finished all my
  work?
- [ ] Did I write a clear pull request message detailing what changes I made?
- [ ] Did I get a code review?
 - [ ] Did I make any requested changes from that code review?

If you follow all of these guidelines and make good changes, you should have
no problem getting your changes merged in.

[style guide]: https://github.com/reactorcore/style-guide
[n-queens]: https://github.com/reactorcore/n-queens
[Underbar]: https://github.com/reactorcore/underbar
[curriculum workflow diagram]: http://i.imgur.com/p0e4tQK.png
[cons of merge]: https://f.cloud.github.com/assets/1577682/1458274/1391ac28-435e-11e3-88b6-69c85029c978.png
[Bookstrap]: https://github.com/reactorcore/bookstrap
[Taser]: https://github.com/reactorcore/bookstrap
[tools workflow diagram]: http://i.imgur.com/kzlrDj7.png
[Git Flow]: http://nvie.com/posts/a-successful-git-branching-model/
[GitHub Flow]: http://scottchacon.com/2011/08/31/github-flow.html
[Squash]: http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html


text:
package com.jayantkrish.jklol.ccg.lambda;

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

import com.google.common.base.Preconditions;
import com.google.common.collect.Sets;

public class Type implements Serializable {
  private static final long serialVersionUID = 1L;

  // Either atomicType is non-null or atomicTypeVar >= 0
  // if this is an atomic type.
  private final String atomicType;
  private final int atomicTypeVar;

  // Non-null if this is a function type.
  private final Type argType;
  private final Type returnType;
  // If true, this is a function that accepts any number of
  // argType arguments.
  private final boolean acceptRepeatedArguments;

  private Type(String atomicType, int atomicTypeVar,
      Type argType, Type returnType, boolean acceptRepeatedArguments) {
    this.atomicType = atomicType;
    this.atomicTypeVar = atomicTypeVar;
    this.argType = argType;
    this.returnType = returnType;
    this.acceptRepeatedArguments = acceptRepeatedArguments;
  }

  public static Type createAtomic(String type) {
    return new Type(type, -1, null, null, false);
  }

  public static Type createTypeVariable(int id) {
    Preconditions.checkArgument(id >= 0, "Type variables must have positive ids (got %s)", id);
    return new Type(null, id, null, null, false);
  }

  public static Type createFunctional(Type argType, Type returnType,
      boolean acceptRepeatedArguments) {
    return new Type(null, -1, argType, returnType, acceptRepeatedArguments);
  }

  public static Type parseFrom(String spec) {
    return ExpressionParser.typeParser().parse(spec);
  }

  public boolean isAtomic() {
    return atomicType != null || atomicTypeVar >= 0;
  }

  public String getAtomicTypeName() {
    return atomicType;
  }

  public int getAtomicTypeVar() {
    return atomicTypeVar;
  }

  public boolean isFunctional() {
    return !isAtomic();
  }

  public Type getArgumentType() {
    return argType;
  }

  public Type getReturnType() {
    return returnType;
  }

  public boolean hasTypeVariables() {
    if (isAtomic()) {
      return atomicTypeVar >= 0;
    } else {
      return argType.hasTypeVariables() || returnType.hasTypeVariables();
    }
  }

  public Set<Integer> getTypeVariables() {
    Set<Integer> typeVars = Sets.newHashSet();
    getTypeVariablesHelper(typeVars);
    return typeVars;
  }

  private void getTypeVariablesHelper(Set<Integer> vars) {
    if (isAtomic()) {
      if (atomicTypeVar > 0) {
        vars.add(atomicTypeVar);
      }
    } else {
      argType.getTypeVariablesHelper(vars);
      returnType.getTypeVariablesHelper(vars);
    }
  }

  public Type addArgument(Type arg) {
    return Type.createFunctional(arg, this, false);
  }

  /**
   * Adds a list of argument types to this type. The
   * last argument in the list is the first argument
   * accepted by the returned type. For example, if
   * the list is [a, b, c], the resulting type is
   * (c, (b, (a, this)))
   *
   * @param argTypes
   * @return
   */
  public Type addArguments(List<Type> argTypes) {
    Type t = this;
    for (Type a : argTypes) {
      t = t.addArgument(a);
    }
    return t;
  }

  public boolean acceptsRepeatedArguments() {
    return acceptRepeatedArguments;
  }

  public Type substitute(Map<Integer, Type> typeVarBindings) {
    if (isAtomic()) {
      if (typeVarBindings.containsKey(atomicTypeVar)) {
        return typeVarBindings.get(atomicTypeVar);
      } else {
        return this;
      }
    } else {
      Type newArg = argType.substitute(typeVarBindings);
      Type newReturn = returnType.substitute(typeVarBindings);

      if (newArg != argType || newReturn != returnType) {
        return Type.createFunctional(newArg, newReturn, acceptRepeatedArguments);
      } else {
        return this;
      }
    }
  }

  @Override
  public String toString() {
    if (isAtomic()) {
      if (hasTypeVariables()) {
        return "$" + atomicTypeVar;
      } else {
        return atomicType;
      }
    } else {
      return "<" + argType + (acceptRepeatedArguments ? "*" : "") + "," + returnType + ">";
    }
  }

  @Override
  public int hashCode() {
    final int prime = 31;
    int result = 1;
    result = prime * result + (acceptRepeatedArguments ? 1231 : 1237);
    result = prime * result + ((argType == null) ? 0 : argType.hashCode());
    result = prime * result + ((atomicType == null) ? 0 : atomicType.hashCode());
    result = prime * result + atomicTypeVar;
    result = prime * result + ((returnType == null) ? 0 : returnType.hashCode());
    return result;
  }

  @Override
  public boolean equals(Object obj) {
    if (this == obj)
      return true;
    if (obj == null)
      return false;
    if (getClass() != obj.getClass())
      return false;
    Type other = (Type) obj;
    if (acceptRepeatedArguments != other.acceptRepeatedArguments)
      return false;
    if (argType == null) {
      if (other.argType != null)
        return false;
    } else if (!argType.equals(other.argType))
      return false;
    if (atomicType == null) {
      if (other.atomicType != null)
        return false;
    } else if (!atomicType.equals(other.atomicType))
      return false;
    if (atomicTypeVar != other.atomicTypeVar)
      return false;
    if (returnType == null) {
      if (other.returnType != null)
        return false;
    } else if (!returnType.equals(other.returnType))
      return false;
    return true;
  }
}


text:
package armtrafficmanager

import "time"

// CheckTrafficManagerRelativeDNSNameAvailabilityParameters - Parameters supplied to check Traffic Manager name operation.
type CheckTrafficManagerRelativeDNSNameAvailabilityParameters struct {
	// The name of the resource.
	Name *string `json:"name,omitempty"`

	// The type of the resource.
	Type *string `json:"type,omitempty"`
}

// DNSConfig - Class containing DNS settings in a Traffic Manager profile.
type DNSConfig struct {
	// The relative DNS name provided by this Traffic Manager profile. This value is combined with the DNS domain name used by
	// Azure Traffic Manager to form the fully-qualified domain name (FQDN) of the
	// profile.
	RelativeName *string `json:"relativeName,omitempty"`

	// The DNS Time-To-Live (TTL), in seconds. This informs the local DNS resolvers and DNS clients how long to cache DNS responses
	// provided by this Traffic Manager profile.
	TTL *int64 `json:"ttl,omitempty"`

	// READ-ONLY; The fully-qualified domain name (FQDN) of the Traffic Manager profile. This is formed from the concatenation
	// of the RelativeName with the DNS domain used by Azure Traffic Manager.
	Fqdn *string `json:"fqdn,omitempty" azure:"ro"`
}

// DeleteOperationResult - The result of the request or operation.
type DeleteOperationResult struct {
	// READ-ONLY; The result of the operation or request.
	OperationResult *bool `json:"boolean,omitempty" azure:"ro"`
}

// Endpoint - Class representing a Traffic Manager endpoint.
type Endpoint struct {
	// Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName}
	ID *string `json:"id,omitempty"`

	// The name of the resource
	Name *string `json:"name,omitempty"`

	// The properties of the Traffic Manager endpoint.
	Properties *EndpointProperties `json:"properties,omitempty"`

	// The type of the resource. Ex- Microsoft.Network/trafficManagerProfiles.
	Type *string `json:"type,omitempty"`
}

// EndpointProperties - Class representing a Traffic Manager endpoint properties.
type EndpointProperties struct {
	// If Always Serve is enabled, probing for endpoint health will be disabled and endpoints will be included in the traffic
	// routing method.
	AlwaysServe *AlwaysServe `json:"alwaysServe,omitempty"`

	// List of custom headers.
	CustomHeaders []*EndpointPropertiesCustomHeadersItem `json:"customHeaders,omitempty"`

	// Specifies the location of the external or nested endpoints when using the 'Performance' traffic routing method.
	EndpointLocation *string `json:"endpointLocation,omitempty"`

	// The monitoring status of the endpoint.
	EndpointMonitorStatus *EndpointMonitorStatus `json:"endpointMonitorStatus,omitempty"`

	// The status of the endpoint. If the endpoint is Enabled, it is probed for endpoint health and is included in the traffic
	// routing method.
	EndpointStatus *EndpointStatus `json:"endpointStatus,omitempty"`

	// The list of countries/regions mapped to this endpoint when using the 'Geographic' traffic routing method. Please consult
	// Traffic Manager Geographic documentation for a full list of accepted values.
	GeoMapping []*string `json:"geoMapping,omitempty"`

	// The minimum number of endpoints that must be available in the child profile in order for the parent profile to be considered
	// available. Only applicable to endpoint of type 'NestedEndpoints'.
	MinChildEndpoints *int64 `json:"minChildEndpoints,omitempty"`

	// The minimum number of IPv4 (DNS record type A) endpoints that must be available in the child profile in order for the parent
	// profile to be considered available. Only applicable to endpoint of type
	// 'NestedEndpoints'.
	MinChildEndpointsIPv4 *int64 `json:"minChildEndpointsIPv4,omitempty"`

	// The minimum number of IPv6 (DNS record type AAAA) endpoints that must be available in the child profile in order for the
	// parent profile to be considered available. Only applicable to endpoint of type
	// 'NestedEndpoints'.
	MinChildEndpointsIPv6 *int64 `json:"minChildEndpointsIPv6,omitempty"`

	// The priority of this endpoint when using the 'Priority' traffic routing method. Possible values are from 1 to 1000, lower
	// values represent higher priority. This is an optional parameter. If specified,
	// it must be specified on all endpoints, and no two endpoints can share the same priority value.
	Priority *int64 `json:"priority,omitempty"`

	// The list of subnets, IP addresses, and/or address ranges mapped to this endpoint when using the 'Subnet' traffic routing
	// method. An empty list will match all ranges not covered by other endpoints.
	Subnets []*EndpointPropertiesSubnetsItem `json:"subnets,omitempty"`

	// The fully-qualified DNS name or IP address of the endpoint. Traffic Manager returns this value in DNS responses to direct
	// traffic to this endpoint.
	Target *string `json:"target,omitempty"`

	// The Azure Resource URI of the of the endpoint. Not applicable to endpoints of type 'ExternalEndpoints'.
	TargetResourceID *string `json:"targetResourceId,omitempty"`

	// The weight of this endpoint when using the 'Weighted' traffic routing method. Possible values are from 1 to 1000.
	Weight *int64 `json:"weight,omitempty"`
}

// EndpointPropertiesCustomHeadersItem - Custom header name and value.
type EndpointPropertiesCustomHeadersItem struct {
	// Header name.
	Name *string `json:"name,omitempty"`

	// Header value.
	Value *string `json:"value,omitempty"`
}

// EndpointPropertiesSubnetsItem - Subnet first address, scope, and/or last address.
type EndpointPropertiesSubnetsItem struct {
	// First address in the subnet.
	First *string `json:"first,omitempty"`

	// Last address in the subnet.
	Last *string `json:"last,omitempty"`

	// Block size (number of leading bits in the subnet mask).
	Scope *int32 `json:"scope,omitempty"`
}

// EndpointsClientCreateOrUpdateOptions contains the optional parameters for the EndpointsClient.CreateOrUpdate method.
type EndpointsClientCreateOrUpdateOptions struct {
	// placeholder for future optional parameters
}

// EndpointsClientDeleteOptions contains the optional parameters for the EndpointsClient.Delete method.
type EndpointsClientDeleteOptions struct {
	// placeholder for future optional parameters
}

// EndpointsClientGetOptions contains the optional parameters for the EndpointsClient.Get method.
type EndpointsClientGetOptions struct {
	// placeholder for future optional parameters
}

// EndpointsClientUpdateOptions contains the optional parameters for the EndpointsClient.Update method.
type EndpointsClientUpdateOptions struct {
	// placeholder for future optional parameters
}

// GeographicHierarchiesClientGetDefaultOptions contains the optional parameters for the GeographicHierarchiesClient.GetDefault
// method.
type GeographicHierarchiesClientGetDefaultOptions struct {
	// placeholder for future optional parameters
}

// GeographicHierarchy - Class representing the Geographic hierarchy used with the Geographic traffic routing method.
type GeographicHierarchy struct {
	// Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName}
	ID *string `json:"id,omitempty"`

	// The name of the resource
	Name *string `json:"name,omitempty"`

	// The properties of the Geographic Hierarchy resource.
	Properties *GeographicHierarchyProperties `json:"properties,omitempty"`

	// The type of the resource. Ex- Microsoft.Network/trafficManagerProfiles.
	Type *string `json:"type,omitempty"`
}

// GeographicHierarchyProperties - Class representing the properties of the Geographic hierarchy used with the Geographic
// traffic routing method.
type GeographicHierarchyProperties struct {
	// The region at the root of the hierarchy from all the regions in the hierarchy can be retrieved.
	GeographicHierarchy *Region `json:"geographicHierarchy,omitempty"`
}

// HeatMapClientGetOptions contains the optional parameters for the HeatMapClient.Get method.
type HeatMapClientGetOptions struct {
	// The bottom right latitude,longitude pair of the rectangular viewport to query for.
	BotRight []float64
	// The top left latitude,longitude pair of the rectangular viewport to query for.
	TopLeft []float64
}

// HeatMapEndpoint - Class which is a sparse representation of a Traffic Manager endpoint.
type HeatMapEndpoint struct {
	// A number uniquely identifying this endpoint in query experiences.
	EndpointID *int32 `json:"endpointId,omitempty"`

	// The ARM Resource ID of this Traffic Manager endpoint.
	ResourceID *string `json:"resourceId,omitempty"`
}

// HeatMapModel - Class representing a Traffic Manager HeatMap.
type HeatMapModel struct {
	// Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName}
	ID *string `json:"id,omitempty"`

	// The name of the resource
	Name *string `json:"name,omitempty"`

	// The properties of the Traffic Manager HeatMap.
	Properties *HeatMapProperties `json:"properties,omitempty"`

	// The type of the resource. Ex- Microsoft.Network/trafficManagerProfiles.
	Type *string `json:"type,omitempty"`
}

// HeatMapProperties - Class representing a Traffic Manager HeatMap properties.
type HeatMapProperties struct {
	// The ending of the time window for this HeatMap, exclusive.
	EndTime *time.Time `json:"endTime,omitempty"`

	// The endpoints used in this HeatMap calculation.
	Endpoints []*HeatMapEndpoint `json:"endpoints,omitempty"`

	// The beginning of the time window for this HeatMap, inclusive.
	StartTime *time.Time `json:"startTime,omitempty"`

	// The traffic flows produced in this HeatMap calculation.
	TrafficFlows []*TrafficFlow `json:"trafficFlows,omitempty"`
}

// MonitorConfig - Class containing endpoint monitoring settings in a Traffic Manager profile.
type MonitorConfig struct {
	// List of custom headers.
	CustomHeaders []*MonitorConfigCustomHeadersItem `json:"customHeaders,omitempty"`

	// List of expected status code ranges.
	ExpectedStatusCodeRanges []*MonitorConfigExpectedStatusCodeRangesItem `json:"expectedStatusCodeRanges,omitempty"`

	// The monitor interval for endpoints in this profile. This is the interval at which Traffic Manager will check the health
	// of each endpoint in this profile.
	IntervalInSeconds *int64 `json:"intervalInSeconds,omitempty"`

	// The path relative to the endpoint domain name used to probe for endpoint health.
	Path *string `json:"path,omitempty"`

	// The TCP port used to probe for endpoint health.
	Port *int64 `json:"port,omitempty"`

	// The profile-level monitoring status of the Traffic Manager profile.
	ProfileMonitorStatus *ProfileMonitorStatus `json:"profileMonitorStatus,omitempty"`

	// The protocol (HTTP, HTTPS or TCP) used to probe for endpoint health.
	Protocol *MonitorProtocol `json:"protocol,omitempty"`

	// The monitor timeout for endpoints in this profile. This is the time that Traffic Manager allows endpoints in this profile
	// to response to the health check.
	TimeoutInSeconds *int64 `json:"timeoutInSeconds,omitempty"`

	// The number of consecutive failed health check that Traffic Manager tolerates before declaring an endpoint in this profile
	// Degraded after the next failed health check.
	ToleratedNumberOfFailures *int64 `json:"toleratedNumberOfFailures,omitempty"`
}

// MonitorConfigCustomHeadersItem - Custom header name and value.
type MonitorConfigCustomHeadersItem struct {
	// Header name.
	Name *string `json:"name,omitempty"`

	// Header value.
	Value *string `json:"value,omitempty"`
}

// MonitorConfigExpectedStatusCodeRangesItem - Min and max value of a status code range.
type MonitorConfigExpectedStatusCodeRangesItem struct {
	// Max status code.
	Max *int32 `json:"max,omitempty"`

	// Min status code.
	Min *int32 `json:"min,omitempty"`
}

// NameAvailability - Class representing a Traffic Manager Name Availability response.
type NameAvailability struct {
	// Descriptive message that explains why the name is not available, when applicable.
	Message *string `json:"message,omitempty"`

	// The relative name.
	Name *string `json:"name,omitempty"`

	// Describes whether the relative name is available or not.
	NameAvailable *bool `json:"nameAvailable,omitempty"`

	// The reason why the name is not available, when applicable.
	Reason *string `json:"reason,omitempty"`

	// Traffic Manager profile resource type.
	Type *string `json:"type,omitempty"`
}

// Profile - Class representing a Traffic Manager profile.
type Profile struct {
	// Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName}
	ID *string `json:"id,omitempty"`

	// The Azure Region where the resource lives
	Location *string `json:"location,omitempty"`

	// The name of the resource
	Name *string `json:"name,omitempty"`

	// The properties of the Traffic Manager profile.
	Properties *ProfileProperties `json:"properties,omitempty"`

	// Resource tags.
	Tags map[string]*string `json:"tags,omitempty"`

	// The type of the resource. Ex- Microsoft.Network/trafficManagerProfiles.
	Type *string `json:"type,omitempty"`
}

// ProfileListResult - The list Traffic Manager profiles operation response.
type ProfileListResult struct {
	// Gets the list of Traffic manager profiles.
	Value []*Profile `json:"value,omitempty"`
}

// ProfileProperties - Class representing the Traffic Manager profile properties.
type ProfileProperties struct {
	// The list of allowed endpoint record types.
	AllowedEndpointRecordTypes []*AllowedEndpointRecordType `json:"allowedEndpointRecordTypes,omitempty"`

	// The DNS settings of the Traffic Manager profile.
	DNSConfig *DNSConfig `json:"dnsConfig,omitempty"`

	// The list of endpoints in the Traffic Manager profile.
	Endpoints []*Endpoint `json:"endpoints,omitempty"`

	// Maximum number of endpoints to be returned for MultiValue routing type.
	MaxReturn *int64 `json:"maxReturn,omitempty"`

	// The endpoint monitoring settings of the Traffic Manager profile.
	MonitorConfig *MonitorConfig `json:"monitorConfig,omitempty"`

	// The status of the Traffic Manager profile.
	ProfileStatus *ProfileStatus `json:"profileStatus,omitempty"`

	// The traffic routing method of the Traffic Manager profile.
	TrafficRoutingMethod *TrafficRoutingMethod `json:"trafficRoutingMethod,omitempty"`

	// Indicates whether Traffic View is 'Enabled' or 'Disabled' for the Traffic Manager profile. Null, indicates 'Disabled'.
	// Enabling this feature will increase the cost of the Traffic Manage profile.
	TrafficViewEnrollmentStatus *TrafficViewEnrollmentStatus `json:"trafficViewEnrollmentStatus,omitempty"`
}

// ProfilesClientCheckTrafficManagerRelativeDNSNameAvailabilityOptions contains the optional parameters for the ProfilesClient.CheckTrafficManagerRelativeDNSNameAvailability
// method.
type ProfilesClientCheckTrafficManagerRelativeDNSNameAvailabilityOptions struct {
	// placeholder for future optional parameters
}

// ProfilesClientCreateOrUpdateOptions contains the optional parameters for the ProfilesClient.CreateOrUpdate method.
type ProfilesClientCreateOrUpdateOptions struct {
	// placeholder for future optional parameters
}

// ProfilesClientDeleteOptions contains the optional parameters for the ProfilesClient.Delete method.
type ProfilesClientDeleteOptions struct {
	// placeholder for future optional parameters
}

// ProfilesClientGetOptions contains the optional parameters for the ProfilesClient.Get method.
type ProfilesClientGetOptions struct {
	// placeholder for future optional parameters
}

// ProfilesClientListByResourceGroupOptions contains the optional parameters for the ProfilesClient.ListByResourceGroup method.
type ProfilesClientListByResourceGroupOptions struct {
	// placeholder for future optional parameters
}

// ProfilesClientListBySubscriptionOptions contains the optional parameters for the ProfilesClient.ListBySubscription method.
type ProfilesClientListBySubscriptionOptions struct {
	// placeholder for future optional parameters
}

// ProfilesClientUpdateOptions contains the optional parameters for the ProfilesClient.Update method.
type ProfilesClientUpdateOptions struct {
	// placeholder for future optional parameters
}

// ProxyResource - The resource model definition for a ARM proxy resource. It will have everything other than required location
// and tags
type ProxyResource struct {
	// Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName}
	ID *string `json:"id,omitempty"`

	// The name of the resource
	Name *string `json:"name,omitempty"`

	// The type of the resource. Ex- Microsoft.Network/trafficManagerProfiles.
	Type *string `json:"type,omitempty"`
}

// QueryExperience - Class representing a Traffic Manager HeatMap query experience properties.
type QueryExperience struct {
	// REQUIRED; The id of the endpoint from the 'endpoints' array which these queries were routed to.
	EndpointID *int32 `json:"endpointId,omitempty"`

	// REQUIRED; The number of queries originating from this location.
	QueryCount *int32 `json:"queryCount,omitempty"`

	// The latency experienced by queries originating from this location.
	Latency *float64 `json:"latency,omitempty"`
}

// Region - Class representing a region in the Geographic hierarchy used with the Geographic traffic routing method.
type Region struct {
	// The code of the region
	Code *string `json:"code,omitempty"`

	// The name of the region
	Name *string `json:"name,omitempty"`

	// The list of Regions grouped under this Region in the Geographic Hierarchy.
	Regions []*Region `json:"regions,omitempty"`
}

// Resource - The core properties of ARM resources
type Resource struct {
	// Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName}
	ID *string `json:"id,omitempty"`

	// The name of the resource
	Name *string `json:"name,omitempty"`

	// The type of the resource. Ex- Microsoft.Network/trafficManagerProfiles.
	Type *string `json:"type,omitempty"`
}

// TrackedResource - The resource model definition for a ARM tracked top level resource
type TrackedResource struct {
	// Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName}
	ID *string `json:"id,omitempty"`

	// The Azure Region where the resource lives
	Location *string `json:"location,omitempty"`

	// The name of the resource
	Name *string `json:"name,omitempty"`

	// Resource tags.
	Tags map[string]*string `json:"tags,omitempty"`

	// The type of the resource. Ex- Microsoft.Network/trafficManagerProfiles.
	Type *string `json:"type,omitempty"`
}

// TrafficFlow - Class representing a Traffic Manager HeatMap traffic flow properties.
type TrafficFlow struct {
	// The approximate latitude that these queries originated from.
	Latitude *float64 `json:"latitude,omitempty"`

	// The approximate longitude that these queries originated from.
	Longitude *float64 `json:"longitude,omitempty"`

	// The query experiences produced in this HeatMap calculation.
	QueryExperiences []*QueryExperience `json:"queryExperiences,omitempty"`

	// The IP address that this query experience originated from.
	SourceIP *string `json:"sourceIp,omitempty"`
}

// UserMetricsKeysClientCreateOrUpdateOptions contains the optional parameters for the UserMetricsKeysClient.CreateOrUpdate
// method.
type UserMetricsKeysClientCreateOrUpdateOptions struct {
	// placeholder for future optional parameters
}

// UserMetricsKeysClientDeleteOptions contains the optional parameters for the UserMetricsKeysClient.Delete method.
type UserMetricsKeysClientDeleteOptions struct {
	// placeholder for future optional parameters
}

// UserMetricsKeysClientGetOptions contains the optional parameters for the UserMetricsKeysClient.Get method.
type UserMetricsKeysClientGetOptions struct {
	// placeholder for future optional parameters
}

// UserMetricsModel - Class representing Traffic Manager User Metrics.
type UserMetricsModel struct {
	// Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName}
	ID *string `json:"id,omitempty"`

	// The name of the resource
	Name *string `json:"name,omitempty"`

	// The properties of the Traffic Manager User Metrics.
	Properties *UserMetricsProperties `json:"properties,omitempty"`

	// The type of the resource. Ex- Microsoft.Network/trafficManagerProfiles.
	Type *string `json:"type,omitempty"`
}

// UserMetricsProperties - Class representing a Traffic Manager Real User Metrics key response.
type UserMetricsProperties struct {
	// The key returned by the User Metrics operation.
	Key *string `json:"key,omitempty"`
}


text:
<?php declare(strict_types=1);

namespace PhpParser;

use PhpParser\NodeVisitor\FindingVisitor;
use PhpParser\NodeVisitor\FirstFindingVisitor;

class NodeFinder {
    /**
     * Find all nodes satisfying a filter callback.
     *
     * @param Node|Node[] $nodes  Single node or array of nodes to search in
     * @param callable    $filter Filter callback: function(Node $node) : bool
     *
     * @return Node[] Found nodes satisfying the filter callback
     */
    public function find($nodes, callable $filter) : array {
        if (!is_array($nodes)) {
            $nodes = [$nodes];
        }

        $visitor = new FindingVisitor($filter);

        $traverser = new NodeTraverser;
        $traverser->addVisitor($visitor);
        $traverser->traverse($nodes);

        return $visitor->getFoundNodes();
    }

    /**
     * Find all nodes that are instances of a certain class.
     *
     * @param Node|Node[] $nodes Single node or array of nodes to search in
     * @param string      $class Class name
     *
     * @return Node[] Found nodes (all instances of $class)
     */
    public function findInstanceOf($nodes, string $class) : array {
        return $this->find($nodes, function ($node) use ($class) {
            return $node instanceof $class;
        });
    }

    /**
     * Find first node satisfying a filter callback.
     *
     * @param Node|Node[] $nodes  Single node or array of nodes to search in
     * @param callable    $filter Filter callback: function(Node $node) : bool
     *
     * @return null|Node Found node (or null if none found)
     */
    public function findFirst($nodes, callable $filter) {
        if (!is_array($nodes)) {
            $nodes = [$nodes];
        }

        $visitor = new FirstFindingVisitor($filter);

        $traverser = new NodeTraverser;
        $traverser->addVisitor($visitor);
        $traverser->traverse($nodes);

        return $visitor->getFoundNode();
    }

    /**
     * Find first node that is an instance of a certain class.
     *
     * @param Node|Node[] $nodes  Single node or array of nodes to search in
     * @param string      $class Class name
     *
     * @return null|Node Found node, which is an instance of $class (or null if none found)
     */
    public function findFirstInstanceOf($nodes, string $class) {
        return $this->findFirst($nodes, function ($node) use ($class) {
            return $node instanceof $class;
        });
    }
}


text: You are looking at the renew endpoint


text:
define([
  'backbone',
  'models/Score',
  'jquery',
  'templates/index',
], function (Backbone, Score, $, Templates) {
  return Backbone.View.extend({
    el: '.score-container',
    template: Templates.score,
    initialize: function (options) {
      this.model = new Score();
      this.render();
      this.listenTo(this.model, 'change:value', this.render, this);
    },
    render: function () {
      this.$el.html(this.template(this.model.attributes));
      return this;
    },
  });
});


text:
using System;
using Llvm.NET.DebugInfo;
using Llvm.NET.Values;

namespace Llvm.NET.Instructions
{
    /// Exposes an LLVM Instruction
    public class Instruction
        : User
    {
        /// Block that contains this instruction
        public BasicBlock ContainingBlock => BasicBlock.FromHandle( NativeMethods.GetInstructionParent( ValueHandle ) );

        /// Gets the LLVM opcode for the instruction
        public OpCode Opcode => ( OpCode )NativeMethods.GetInstructionOpcode( ValueHandle );

        /// FLag to indicate if the opcode is for a memory access <see cref="Alloca"/>, <see cref="Load"/>, <see cref="Store"/>
        public bool IsMemoryAccess
        {
            get
            {
                var opCode = Opcode;
                return opCode == OpCode.Alloca
                    || opCode == OpCode.Load
                    || opCode == OpCode.Store;
            }
        }

        /// Alignment for the instruction
        /// <remarks>
        /// The alignment is always 0 for instructions other than Alloca, Load, and Store
        /// that deal with memory accesses. Setting the alignment for other instructions
        /// results in an InvalidOperationException()
        /// </remarks>
        public uint Alignment
        {
            get
            {
                return IsMemoryAccess ? NativeMethods.GetAlignment( ValueHandle ) : 0;
            }

            set
            {
                if( !IsMemoryAccess )
                    throw new InvalidOperationException( "Alignment can only be set for instructions dealing with memory read/write (alloca, load, store)" );
                NativeMethods.SetAlignment( ValueHandle, value );
            }
        }

        internal Instruction( LLVMValueRef valueRef )
            : base( ValidateConversion( valueRef, NativeMethods.IsAInstruction ) )
        {
        }
    }

    /// Provides extension methods to <see cref="Instruction"/> that cannot be achieved as members of the class
    /// <remarks>
    /// Using generic static extension methods allows for fluent coding while retaining the type of the "this" parameter.
    /// If these were members of the <see cref="Instruction"/> class then the only return type could be <see cref="Instruction"/>
    /// thus losing the original type and requiring a cast to get back to it, thereby defeating the purpose of the fluent style.
    /// </remarks>
    public static class InstructionExtensions
    {
        /// Fluent style extension method to set the <see cref="Instruction.Alignment"/> for an instruction
        /// <typeparam name="T">Type of the instruction (usually implicitly inferred from usage)</typeparam>
        /// <param name="self">Instruction to set the <see cref="Instruction.Alignment"/> for</param>
        /// <param name="value">New alignment for the instruction</param>
        /// <returns>To allow fluent style coding this returns the <paramref name="self"/> parameter</returns>
        public static T Alignment<T>( this T self, uint value )
            where T : Instruction
        {
            if( self.IsMemoryAccess )
                self.Alignment = value;

            return self;
        }

        /// Fluent style extension method to set the Volatile property of a <see cref="Load"/> or <see cref="Store"/> instruction
        /// <typeparam name="T">Type of the instruction (usually implicitly inferred from usage)</typeparam>
        /// <param name="self">Instruction to set the Volatile property for</param>
        /// <param name="value">Flag to indicate if the instruction's operation is volatile</param>
        /// <returns>To allow fluent style coding this returns the <paramref name="self"/> parameter</returns>
        public static T IsVolatile<T>( this T self, bool value )
            where T : Instruction
        {
            if( self.IsMemoryAccess )
            {
                // only load and store instructions have the volatile property
                var loadInst = self as Load;
                if( loadInst != null )
                    loadInst.IsVolatile = value;
                else
                {
                    var storeinst = self as Store;
                    if( storeinst != null )
                        storeinst.IsVolatile = value;
                }
            }

            return self;
        }
    }
}


text:
declare class C {
    [Symbol.unscopables](): string;
}

//// [parserES5SymbolProperty3.js]


text:
<?php defined('BASEPATH') OR exit('No direct script access allowed');

class  Oportunidades_model extends CI_Model{

	public function get_byid( $id = NULL ){
		if( $id != NULL ){
			/* seleciona no DB onde o campo ID == $id */
			$this->db->where('id',$id);

			/* mostra apenas 1 resultado, e TEM q ser 1 resultado pois ID é unico */
			$this->db->limit(1);

			/* pega a tabela aluno */
			return $this->db->get('oportunidades');
		}else{
			return FALSE;
		}
	}

	public function get_areas(){
		$areasCadastradas = $this->db->get('area');

		return $areasCadastradas;
	}

	public function get_estados(){
		$estadosCadastrados = $this->db->get('estados');

		return $estadosCadastrados;
	}

	public function get_status(){
		$statusCadastrados = $this->db->get('status');

		return $statusCadastrados;
	}

	/***********************************************
	*											   *
	*	TUDO RELACIONADO As OPORTUNIDADES    	   *
	*											   *
	***********************************************/

	public function do_insert($dados = NULL){

		// se a variavel $dados que veio do controller crud  for diferente de vazia, executa:
		if($dados != NULL){

			//insere na tabela curso_ci a variavel $dados
			$this->db->insert('oportunidades',$dados);

			// retorna uma flashdata de nome cadastrook e valor {}
			// e depois redireciona para /crud/create que vai estar esperando essa flashdata
			$this->session->set_flashdata('cadastrook','Cadastro efetuado com sucesso');
			redirect('empresa/novaOportunidade');
		}
	}

	public function do_update($dados = NULL, $condicao = NULL){
		if ($dados != NULL && $condicao != NULL){

			/* atualiza o banco de dados aluno com os $dados usando a $condição */
			$this->db->update('oportunidades',$dados,$condicao);

			/* retorna para a view de alunos cadastrados uma mensagem  de edição ok */
			$this->session->set_flashdata('edicaook','Uhul! Uma oportunidade foi editada! -

');

			/* ao terminar de editar o registro vai para a tela de alunos cadastrados */
			redirect('empresa/oportunidades');
		}
	}

	public function do_delete($condicao = NULL){
		if ($condicao != NULL) {
			$this->db->delete('oportunidades',$condicao);

			$this->session->set_flashdata('exclusaook','Você excluiu uma oportunidade! -

');

			redirect('empresa/oportunidades');

		}
	}

	public function oportunidadesCadastradas( $empresa = NULL ){
		if( $empresa != NULL ){
			/* seleciona no DB onde o campo ID == $id */
			$this->db->where('empresa_responsavel',$empresa);

			return $this->db->get('oportunidades');
		}else{
			return FALSE;
		}
	}

	public function quantidadeOportunidadesCadastradas( $empresa = NULL ){
		if( $empresa != NULL ){

			$this->db->where('empresa_responsavel',$empresa);

			return $this->db->get('oportunidades')->num_rows();

		}else{
			return FALSE;
		}
	}

	public function oportunidadesDisponiveis(){

			$query = $this->db->get('oportunidades');

			$num = $query->num_rows();

			return $num;

	}

	public function todasOportunidades(){
		return $this->db->get('oportunidades');
	}

	public function quantidadeEmpresasCadastradas(){

		$tipo = 'empresa';

		$query = $this->db->where('perfil',$tipo);

		$query2 = $this->db->get('users');

		$nn = $query2->num_rows();

		return $nn;

	}

	public function quantidadeUsuariosCadastrados( ){

		$usuarios = 'usuario';

		$this->db->where('perfil',$usuarios);

		return $this->db->get('users')->num_rows();
	}

	public function registra_usuario($dados = NULL){

		// se a variavel $dados que veio do controller crud  for diferente de vazia, executa:
		if($dados != NULL){

			//insere na tabela curso_ci a variavel $dados
			$this->db->insert('users',$dados);

			// retorna uma flashdata de nome cadastrook e valor {}
			// e depois redireciona para /crud/create que vai estar esperando essa flashdata
			$this->session->set_flashdata('usuariocriado','Usuário Registrado com Sucesso!');
			redirect('login');
		}
	}

	/***********************************************
	*											   *
	*	TUDO RELACIONADO AO CURRICULUMMMMMMMM	   *
	*											   *
	***********************************************/

	public function cadastraCurriculum($dados = NULL){

		if($dados != NULL){

			//insere na tabela curso_ci a variavel $dados
			$this->db->insert('curriculum',$dados);

			$this->session->set_flashdata('cadastreicurriculum','Parabéns! Você acabou de enviar um novo Curriculum!');
			redirect('upload/');

		}
	}

	public function curriculumCadastrados( $dados = NULL ){
		if( $dados != NULL ){
			/* seleciona no DB onde o campo ID == $id */
			$this->db->where('idusuario',$dados);

			return $this->db->get('curriculum');
		}else{
			return FALSE;
		}
	}

	public function exibeOcurriculum( $id = NULL ){
		if( $id != NULL ){

			$this->db->where('id',$id);

			/* mostra apenas 1 resultado, e TEM q ser 1 resultado pois ID é unico */
			$this->db->limit(1);

			return $this->db->get('curriculum');
		}else{
			return FALSE;
		}
	}

	public function excluirCurriculum($condicao = NULL){
		if ($condicao != NULL) {
			$this->db->delete('curriculum',$condicao);
			redirect('upload/');
		}else{
			return false;
		}
	}

	public function queromecandidatar($dados = NULL){

		if($dados != NULL){

			$this->db->insert('candidatos',$dados);

			$this->session->set_flashdata('mecandidatei','Parabéns! Você acabou de se candidatar para uma Oportunidade de Emprego!');
			redirect('usuario/oportunidades');
		}
	}

	/********************************************
	*											*
	*		COISAS RELACIONADAS AO CANDIDATO 	*
	*											*
	********************************************/
	public function exibeOportunidades( $id = NULL ){
		if( $id != NULL ){

			$this->db->where('nomeempresa',$id);

			return $this->db->get('candidatos');

		}else{
			return FALSE;
		}
	}

	public function nomeDoCandidato( $id = NULL ){
		if( $id != NULL ){

			$this->db->where('id',$id);

			$this->db->limit(1);

			return $this->db->get('users');

		}else{
			return FALSE;
		}
	}

	public function curriculumDoCandidato( $id = NULL ){
		if( $id != NULL ){

			$this->db->where('idusuario',$id);

			/* mostra apenas 1 resultado, e TEM q ser 1 resultado pois ID é unico */
			$this->db->limit(1);

			return $this->db->get('curriculum');
		}else{
			return FALSE;
		}
	}

}


text:
using System.Collections.Generic;

namespace Cake.OctoVariapus
{
    public class OctoVariable
    {
        public string Name { get; set; }

        public string Value { get; set; }

        public bool IsSensitive { get; set; }

        public bool IsEditable { get; set; }

        public List<OctoScope> Scopes { get; set; }
    }
}


text:
draft.mixins.move = {
  /* // Get/set the element's x position
  x(x) {
    return this.prop('x', draft.types.length(x));
  },

  // Get/set the element's y position
  y(y) {
    return this.prop('y', draft.types.length(y));
  }, */

  // Get/set the element's position
  move(...args) {
    var pos = {};
    for (var i in args) {
      pos[draft.defaults[this.prop('system')].vars[i]] = draft.types.length(args[i]);
    }
    return this.prop(pos);
  }
};


text:
![A Wemos ESP8266 board](wemos.jpg)

The general idea of the project is to get a handle on how the house heats and cools so that we can better program the thermostat.

To gather data, I've assembled and programmed 5 probes using inexpensive hardware
([Wemos D1 Mini](https://wiki.wemos.cc/products:d1:d1_mini) ESP8266 WiFi boards and
[SHT30](https://wiki.wemos.cc/products:d1_mini_shields:sht30_shield) temperature/humidity sensors).
The probes send periodic reports to a web app that stashes away the data for later visualization and analysis.

Here are the project's lab notebooks.

* [A preliminary look at sensor data](InitialTemperatureValues.ipynb) after the first round of software
* [The foam core experiment](FoamCoreExperiment.ipynb) for getting more consistent sensor values
* [Moving the sensor away from the ESP8266](MovingTheSensor.ipynb) to see how much heat from the ESP8266 board is throwing measurements off
* [After moving the sensors](AfterMovingSensors.ipynb) and gathering a day's worth of data


text:
package com.anrisoftware.globalpom.exec.external.pipeoutputs;

import java.io.InputStream;

import com.anrisoftware.globalpom.exec.external.core.CommandInput;

/**
 * Pipes the read data from one stream to the standard input of the command.
 *
 * @author Erwin Mueller, erwin.mueller@deventm.org
 * @since 3.1
 */
public interface PipeCommandInput extends CommandInput {

    /**
     * Sets the stream that is read and piped to the standard input of the
     * command.
     *
     * @param stream
     *            the {@link InputStream}.
     */
    void setPipe(InputStream stream);

    /**
     * Sets the buffer size.
     *
     * @param size
     *            the size in bytes.
     */
    void setBufferSize(int size);

}


text:
package org.apache.rave.portal.repository.impl;

import org.apache.rave.portal.model.JpaRegionWidget;
import org.apache.rave.portal.model.JpaRegionWidgetPreference;
import org.apache.rave.model.RegionWidget;
import org.apache.rave.model.RegionWidgetPreference;
import org.apache.rave.portal.model.impl.RegionWidgetImpl;
import org.apache.rave.portal.repository.RegionWidgetRepository;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.annotation.Rollback;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Transactional;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import java.util.ArrayList;
import java.util.List;

import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;

@Transactional
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:test-dataContext.xml", "classpath:test-applicationContext.xml"})
public class JpaRegionWidgetRepositoryTest {
    @PersistenceContext
    private EntityManager manager;

    private static final Long VALID_REGION_WIDGET_ID = 1L;
    private static final Long INVALID_REGION_WIDGET_ID = -1L;
    private static final String VALID_PREFERENCE_NAME = "color";
    private static final String VALID_PREFERENCE_VALUE = "blue";

    @Autowired
    private RegionWidgetRepository repository;

    @Test
    public void getType() {
        assertEquals(repository.getType(), JpaRegionWidget.class);
    }

    @Test
    public void getById_validId() {
        RegionWidget regionWidget = repository.get(VALID_REGION_WIDGET_ID.toString());
        assertThat(regionWidget, is(notNullValue()));
        assertThat(regionWidget.getId(), is(equalTo(VALID_REGION_WIDGET_ID.toString())));
    }

    @Test
    public void getById_invalidId() {
        RegionWidget regionWidget = repository.get(INVALID_REGION_WIDGET_ID.toString());
        assertThat(regionWidget, is(nullValue()));
    }

    @Test
    public void getAll(){
        List<RegionWidget> regions = repository.getAll();
        assertThat(regions, is(notNullValue()));
        assertThat(regions.size(), is(equalTo(51)));
    }

    @Test
    public void getLimitedSet(){
        List<RegionWidget> regions = repository.getLimitedList(0, 10);
        assertThat(regions.size(), is(equalTo(10)));
    }

    @Test
    public void getCount(){
        int count = repository.getCountAll();
        assertThat(count, is(notNullValue()));
        assertThat(count, is(equalTo(51)));
    }

    @Test
    @Rollback(true)
    public void save_newEntity() {
        RegionWidget regionWidget = new JpaRegionWidget();
        regionWidget.setPreferences(new ArrayList<RegionWidgetPreference>());

        RegionWidget saved = repository.save(regionWidget);
        manager.flush();
        assertThat(saved, is(sameInstance(regionWidget)));
        assertThat(saved.getId(), is(notNullValue()));
    }

    @Test
    @Rollback(true)
    public void save_existingEntity() {
        RegionWidget regionWidget = new JpaRegionWidget(VALID_REGION_WIDGET_ID);
        regionWidget.setPreferences(new ArrayList<RegionWidgetPreference>());

        RegionWidget saved = repository.save(regionWidget);
        manager.flush();
        assertThat(saved, is(not(sameInstance(regionWidget))));
        assertThat(saved.getId(), is(equalTo(regionWidget.getId())));
    }

    @Test
    @Rollback(true)
    public void save_cascadePersist() {
        RegionWidget regionWidget = new JpaRegionWidget();
        regionWidget.setPreferences(new ArrayList<RegionWidgetPreference>());
        RegionWidgetPreference regionWidgetPreference = new JpaRegionWidgetPreference(null, null, VALID_PREFERENCE_NAME,
                VALID_PREFERENCE_VALUE);
        regionWidget.getPreferences().add(regionWidgetPreference);

        RegionWidget saved = repository.save(regionWidget);
        manager.flush();

        assertThat(saved.getPreferences().size(), is(equalTo(1)));
        JpaRegionWidgetPreference actual = (JpaRegionWidgetPreference)saved.getPreferences().get(0);

        assertThat(actual, is(sameInstance(regionWidgetPreference)));
        assertThat(actual.getEntityId(), is(notNullValue()));
    }

    @Test
    @Rollback(true)
    public void save_cascadeMerge() {
        long VALID_PREFERENCE_ID = addPreferenceToRegionWidget(VALID_REGION_WIDGET_ID);

        RegionWidget regionWidget = new JpaRegionWidget(VALID_REGION_WIDGET_ID);
        regionWidget.setPreferences(new ArrayList<RegionWidgetPreference>());
        JpaRegionWidgetPreference regionWidgetPreference = new JpaRegionWidgetPreference(VALID_PREFERENCE_ID,
                VALID_REGION_WIDGET_ID, VALID_PREFERENCE_NAME, VALID_PREFERENCE_VALUE);
        regionWidget.getPreferences().add(regionWidgetPreference);

        RegionWidget saved = repository.save(regionWidget);
        manager.flush();

        assertThat(saved.getPreferences().size(), is(equalTo(1)));
        JpaRegionWidgetPreference actual = (JpaRegionWidgetPreference)saved.getPreferences().get(0);

        assertThat(actual, is(not(sameInstance(regionWidgetPreference))));
        assertThat(actual.getEntityId(), is(equalTo(regionWidgetPreference.getEntityId())));
    }

    @Test
    @Rollback(true)
    public void save_cascadeOrphan() {
        long VALID_PREFERENCE_ID = addPreferenceToRegionWidget(VALID_REGION_WIDGET_ID);

        RegionWidget regionWidget = repository.get(VALID_REGION_WIDGET_ID.toString());
        regionWidget.getPreferences().remove(0);

        RegionWidget saved = repository.save(regionWidget);
        manager.flush();
        RegionWidgetPreference preference = manager.find(JpaRegionWidgetPreference.class, VALID_PREFERENCE_ID);

        assertThat(saved.getPreferences().size(), is(equalTo(0)));
        assertThat(preference, is(nullValue()));
    }

    @Test
    @Rollback(true)
    public void delete_jpaObject() {
        RegionWidget regionWidget = repository.get(VALID_REGION_WIDGET_ID.toString());
        assertThat(regionWidget, is(notNullValue()));
        repository.delete(regionWidget);
        regionWidget = repository.get(VALID_REGION_WIDGET_ID.toString());
        assertThat(regionWidget, is(nullValue()));
    }

    @Test
    @Rollback(true)
    public void delete_implObject() {
        RegionWidget regionWidget = repository.get(VALID_REGION_WIDGET_ID.toString());
        assertThat(regionWidget, is(notNullValue()));
        RegionWidgetImpl impl = new RegionWidgetImpl(regionWidget.getId());
        repository.delete(impl);
        regionWidget = repository.get(VALID_REGION_WIDGET_ID.toString());
        assertThat(regionWidget, is(nullValue()));
    }

    private long addPreferenceToRegionWidget(Long validRegionWidgetId) {
        RegionWidget regionWidget = repository.get(validRegionWidgetId.toString());
        RegionWidgetPreference regionWidgetPreference = new JpaRegionWidgetPreference(null, validRegionWidgetId,
                VALID_PREFERENCE_NAME, VALID_PREFERENCE_VALUE);
        regionWidget.getPreferences().add(regionWidgetPreference);

        RegionWidget saved = repository.save(regionWidget);
        manager.flush();
        return ((JpaRegionWidgetPreference)saved.getPreferences().get(0)).getEntityId();
    }
}


text:
// --------------------------------------------------------------------------------------------------------------------
// <copyright company="Chocolatey" file="NuspecPackage.cs">
//   Copyright 2014 - Present Rob Reynolds, the maintainers of Chocolatey, and RealDimensions Software, LLC
// </copyright>
// --------------------------------------------------------------------------------------------------------------------

namespace ChocolateyGui.Models
{
    using System;
    using System.Xml.Serialization;

    [Serializable]
    [XmlRoot(ElementName = "package")]
    public class NuspecPackage
    {
        [XmlElement("metadata")]
        public PackageMetadata Metadata { get; set; }
    }
}


text:
exports.setEnvironment = function() {
  process.env['AZURE_BATCH_ACCOUNT'] = 'batchtestnodesdk';
  process.env['AZURE_BATCH_ENDPOINT'] = 'https://batchtestnodesdk.japaneast.batch.azure.com';
  process.env['AZURE_SUBSCRIPTION_ID'] = 'f30ef677-64a9-4768-934f-5fbbc0e1ad27';
};

exports.scopes = [[function (nock) {
var result =
nock('https://batchtestnodesdk.japaneast.batch.azure.com:443')
  .get('/lifetimejobstats?api-version=2020-09-01.12.0')
  .reply(200, "{\r\n  \"odata.metadata\":\"https://batchtestnodesdk.japaneast.batch.azure.com/$metadata#jobstats/@Element\",\"url\":\"https://batchtestnodesdk.japaneast.batch.azure.com/lifetimejobstats\",\"startTime\":\"2020-09-24T19:29:29.400557Z\",\"lastUpdateTime\":\"2020-09-24T19:29:29.400557Z\",\"userCPUTime\":\"PT0S\",\"kernelCPUTime\":\"PT0S\",\"wallClockTime\":\"PT0S\",\"readIOps\":\"0\",\"writeIOps\":\"0\",\"readIOGiB\":0.0,\"writeIOGiB\":0.0,\"numTaskRetries\":\"0\",\"numSucceededTasks\":\"0\",\"numFailedTasks\":\"0\",\"waitTime\":\"PT0S\"\r\n}", { 'transfer-encoding': 'chunked',
  'content-type': 'application/json;odata=minimalmetadata',
  server: 'Microsoft-HTTPAPI/2.0',
  'request-id': 'dab8783d-5fad-49a0-bbcc-2ff3663672e5',
  'strict-transport-security': 'max-age=31536000; includeSubDomains',
  'x-content-type-options': 'nosniff',
  dataserviceversion: '3.0',
  date: 'Thu, 24 Sep 2020 20:02:22 GMT',
  connection: 'close' });
 return result; }]];


text:
using System.Windows;

namespace EraFileCreator
{
    /// <summary>
    ///     Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            this.InitializeComponent();
        }
    }
}


text:
module Erp
  module OnlineStore
    module Frontend
      class EventsController < Erp::Frontend::FrontendController
        def index
          @meta_description = "Các chương trình sự kiện của Tìm Hàng Công Nghệ với những ưu đãi, giảm giá cực hấp dẫn, đa dạng mặt hàng, thoải mái lựa chọn"
        end
        def event_detail
          @products = Erp::Products::Event.get_event_products(params).paginate(:page => params[:page], :per_page => 16)
          @menus = Erp::Menus::Menu.get_menus
          @event = Erp::Products::Event.find(params[:event_id])
          @meta_description = "Tìm Hàng Công Nghệ - " + @event.name
        end
      end
    end
  end
end