text:
package util;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;

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

import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.text.TextUtils;
import model.City;
import model.CoolWeatherDB;
import model.County;
import model.Province;

public class Utility {
	/**
	* ½âÎöºÍ´¦Àí·þÎñÆ÷·µ»ØµÄÊ¡¼¶Êý¾Ý
	*/
	public synchronized static boolean handleProvincesResponse(CoolWeatherDB coolWeatherDB, String response) {
		if (!TextUtils.isEmpty(response)) {
			String[] allProvinces = response.split(",");
			if (allProvinces != null && allProvinces.length > 0) {
				for (String p : allProvinces) {
					String[] array = p.split("\\|");
					Province province = new Province();
					province.setProvinceCode(array[0]);
					province.setProvinceName(array[1]);
					// ½«½âÎö³öÀ´µÄÊý¾Ý´æ´¢µ½Province±í
					coolWeatherDB.saveProvince(province);
				} return true;
			}
		} return false;
	}
		/**
		* ½âÎöºÍ´¦Àí·þÎñÆ÷·µ»ØµÄÊм¶Êý¾Ý
		*/
	public static boolean handleCitiesResponse(CoolWeatherDB coolWeatherDB,String response, int provinceId) {
		if (!TextUtils.isEmpty(response)) {
			String[] allCities = response.split(",");
			if (allCities != null && allCities.length > 0) {
				for (String c : allCities) {
					String[] array = c.split("\\|");
					City city = new City();
					city.setCityCode(array[0]);
					city.setCityName(array[1]);
					city.setProvinceId(provinceId);
					// ½«½âÎö³öÀ´µÄÊý¾Ý´æ´¢µ½City±í
					coolWeatherDB.saveCity(city);
				} return true;
			}
		}
		return false;
	}
		/**
		* ½âÎöºÍ´¦Àí·þÎñÆ÷·µ»ØµÄÏؼ¶Êý¾Ý
		*/
	public static boolean handleCountiesResponse(CoolWeatherDB coolWeatherDB,String response, int cityId) {
		if (!TextUtils.isEmpty(response)) {
			String[] allCounties = response.split(",");
			if (allCounties != null && allCounties.length > 0) {
				for (String c : allCounties) {
					String[] array = c.split("\\|");
					County county = new County();
					county.setCountyCode(array[0]);
					county.setCountyName(array[1]);
					county.setCityId(cityId);
					// ½«½âÎö³öÀ´µÄÊý¾Ý´æ´¢µ½County±í
					coolWeatherDB.saveCounty(county);
				}
				return true;
			}
		}
		return false;
	}

	/**
	* ½âÎö·þÎñÆ÷·µ»ØµÄJSONÊý¾Ý£¬²¢½«½âÎö³öµÄÊý¾Ý´æ´¢µ½±¾µØ¡£
	*/
	public static void handleWeatherResponse(Context context,String response){
		try {
			JSONObject jsonObject = new JSONObject(response);
			JSONObject data = jsonObject.getJSONObject("data");
			String cityName = data.getString("city");
			JSONArray forecast=data.getJSONArray("forecast");
			JSONObject array1=forecast.getJSONObject(0);
			String temp1=array1.getString("high");
			String t[]=temp1.split(" ");
			temp1=t[1];
            String temp2=array1.getString("low");
            t=temp2.split(" ");
            temp2=t[1];
            String weatherDesp=array1.getString("type");
            String publishTime=array1.getString("date");
			saveWeatherInfo(context, cityName,temp1, temp2,weatherDesp, publishTime);
		}
		catch (JSONException e) {
			e.printStackTrace();
		}
	}
	/**
	* ½«·þÎñÆ÷·µ»ØµÄËùÓÐÌìÆøÐÅÏ¢´æ´¢µ½SharedPreferencesÎļþÖС£
	*/
	public static void saveWeatherInfo(Context context, String cityName,String temp1, String temp2, String weatherDesp, String publishTime) {
		//»ñÈ¡µ±Ç°Ê±¼ä
		long time=System.currentTimeMillis();
		final Calendar mCalendar=Calendar.getInstance();
		mCalendar.setTimeInMillis(time);
		String mHour,mMinuts;
		mHour=String.valueOf(mCalendar.get(Calendar.HOUR));
		mMinuts=String.valueOf(mCalendar.get(Calendar.MINUTE));

		SimpleDateFormat sdf = new SimpleDateFormat("yyyyÄêMÔÂdÈÕ",Locale.CHINA);
		SharedPreferences.Editor editor = PreferenceManager.getDefaultSharedPreferences(context).edit();
		editor.putBoolean("city_selected", true);
		editor.putString("city_name", cityName);
		editor.putString("temp1", temp1);
		editor.putString("temp2", temp2);
		editor.putString("weather_desp", weatherDesp);
		editor.putString("publish_time", mHour+":"+mMinuts);
		editor.putString("current_date", sdf.format(new Date()));
		editor.commit();

	}

}


text:
action :start_nat_monitor do
  bash "start nat_monitor.sh" do
    user "root"
    cwd "/root"
    code <<-EOH
  pkill nat-monitor > /dev/null
  /root/nat-monitor.sh >> /var/log/nat-monitor.log 2>&1 &
    EOH
  end

end

action :stop_nat_monitor do
  bash "stop nat-monitor.sh" do
    user "root"
    cwd "/root"
    code <<-EOH
  pkill nat-monitor > /dev/null
    EOH
  end
end

redpajama_set_name: RedPajamaGithub


text:
from __future__ import unicode_literals

from django.db import migrations, models
from django.conf import settings

class Migration(migrations.Migration):

    dependencies = [
        ('routines', '0002_auto_20160216_2236'),
    ]

    operations = [
        migrations.AlterField(
            model_name='routine',
            name='user',
            field=models.ForeignKey(to=settings.AUTH_USER_MODEL),
        ),
    ]


text:
title: Publications
cms_exclude: true

# View.
#   1 = List
#   2 = Compact
#   3 = Card
#   4 = Citation
view: 3

# Optional header image (relative to `static/img/` folder).
header:
  caption: ""
  image: ""
---


text:
using System;
using System.ComponentModel;

namespace Azure.ResourceManager.SignalR.Models
{
    /// <summary> The scale type applicable to the sku. </summary>
    public readonly partial struct ScaleType : IEquatable<ScaleType>
    {
        private readonly string _value;

        /// <summary> Initializes a new instance of <see cref="ScaleType"/>. </summary>
        /// <exception cref="ArgumentNullException"> <paramref name="value"/> is null. </exception>
        public ScaleType(string value)
        {
            _value = value ?? throw new ArgumentNullException(nameof(value));
        }

        private const string NoneValue = "None";
        private const string ManualValue = "Manual";
        private const string AutomaticValue = "Automatic";

        /// <summary> None. </summary>
        public static ScaleType None { get; } = new ScaleType(NoneValue);
        /// <summary> Manual. </summary>
        public static ScaleType Manual { get; } = new ScaleType(ManualValue);
        /// <summary> Automatic. </summary>
        public static ScaleType Automatic { get; } = new ScaleType(AutomaticValue);
        /// <summary> Determines if two <see cref="ScaleType"/> values are the same. </summary>
        public static bool operator ==(ScaleType left, ScaleType right) => left.Equals(right);
        /// <summary> Determines if two <see cref="ScaleType"/> values are not the same. </summary>
        public static bool operator !=(ScaleType left, ScaleType right) => !left.Equals(right);
        /// <summary> Converts a string to a <see cref="ScaleType"/>. </summary>
        public static implicit operator ScaleType(string value) => new ScaleType(value);

        /// <inheritdoc />
        [EditorBrowsable(EditorBrowsableState.Never)]
        public override bool Equals(object obj) => obj is ScaleType other && Equals(other);
        /// <inheritdoc />
        public bool Equals(ScaleType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);

        /// <inheritdoc />
        [EditorBrowsable(EditorBrowsableState.Never)]
        public override int GetHashCode() => _value?.GetHashCode() ?? 0;
        /// <inheritdoc />
        public override string ToString() => _value;
    }
}


text:
package com.sequenceiq.mock.swagger.model;

import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.validation.annotation.Validated;
import javax.validation.Valid;
import javax.validation.constraints.*;

/**
 * A counter in an HDFS replication job.
 */
@ApiModel(description = "A counter in an HDFS replication job.")
@Validated
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2021-12-10T21:24:30.629+01:00")

public class ApiHdfsReplicationCounter   {
  @JsonProperty("group")
  private String group = null;

  @JsonProperty("name")
  private String name = null;

  @JsonProperty("value")
  private Integer value = null;

  public ApiHdfsReplicationCounter group(String group) {
    this.group = group;
    return this;
  }

  /**
   *
   * @return group
  **/
  @ApiModelProperty(value = "")

  public String getGroup() {
    return group;
  }

  public void setGroup(String group) {
    this.group = group;
  }

  public ApiHdfsReplicationCounter name(String name) {
    this.name = name;
    return this;
  }

  /**
   *
   * @return name
  **/
  @ApiModelProperty(value = "")

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public ApiHdfsReplicationCounter value(Integer value) {
    this.value = value;
    return this;
  }

  /**
   *
   * @return value
  **/
  @ApiModelProperty(value = "")

  public Integer getValue() {
    return value;
  }

  public void setValue(Integer value) {
    this.value = value;
  }

  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ApiHdfsReplicationCounter apiHdfsReplicationCounter = (ApiHdfsReplicationCounter) o;
    return Objects.equals(this.group, apiHdfsReplicationCounter.group) &&
        Objects.equals(this.name, apiHdfsReplicationCounter.name) &&
        Objects.equals(this.value, apiHdfsReplicationCounter.value);
  }

  @Override
  public int hashCode() {
    return Objects.hash(group, name, value);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ApiHdfsReplicationCounter {\n");

    sb.append("    group: ").append(toIndentedString(group)).append("\n");
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    value: ").append(toIndentedString(value)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(java.lang.Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }
}


text:
package org.apache.flink.test.windowing.sessionwindows;

import org.apache.flink.util.Preconditions;

/**
 * Configuration data for a session.
 *
 * @param <K> type of session key
 * @param <E> type of session event
 */
public final class SessionConfiguration<K, E> {

	// key of the session
	private final K key;

	// id of the session w.r.t. key
	private final int sessionId;

	// allowed gap between events in one session
	private final long gap;

	// minimum event time among all events in the session
	private final long minEventTimestamp;

	// number of timely events in the session
	private final int numberOfTimelyEvents;

	// factory that produces the events for the session from metadata such as timestamps
	private final GeneratorEventFactory<K, E> eventFactory;

	public SessionConfiguration(
			K key,
			int sessionId,
			long gap,
			long minEventTimestamp,
			int numberOfTimelyEvents,
			GeneratorEventFactory<K, E> eventFactory) {

		Preconditions.checkNotNull(key);
		Preconditions.checkNotNull(eventFactory);
		Preconditions.checkArgument(numberOfTimelyEvents > 0);
		Preconditions.checkArgument(gap > 0);

		this.key = key;
		this.eventFactory = eventFactory;
		this.sessionId = sessionId;
		this.gap = gap;
		this.numberOfTimelyEvents = numberOfTimelyEvents;
		this.minEventTimestamp = minEventTimestamp;
	}

	public K getKey() {
		return key;
	}

	public GeneratorEventFactory<K, E> getEventFactory() {
		return eventFactory;
	}

	public long getGap() {
		return gap;
	}

	public long getMinEventTimestamp() {
		return minEventTimestamp;
	}

	public int getNumberOfTimelyEvents() {
		return numberOfTimelyEvents;
	}

	public int getSessionId() {
		return sessionId;
	}

	public static <K, E> SessionConfiguration<K, E> of(
			K key,
			int sessionId,
			long timeout,
			long startTimestamp,
			int numberOfEvents,
			GeneratorEventFactory<K, E> eventFactory) {
		return new SessionConfiguration<>(key, sessionId, timeout, startTimestamp, numberOfEvents, eventFactory);
	}

	@Override
	public String toString() {
		return "SessionConfiguration{" +
				"key=" + key +
				", sessionId=" + sessionId +
				", gap=" + gap +
				", minEventTimestamp=" + minEventTimestamp +
				", numberOfTimelyEvents=" + numberOfTimelyEvents +
				", eventFactory=" + eventFactory +
				'}';
	}

	public SessionConfiguration<K, E> getFollowupSessionConfiguration(long startTimestamp) {
		return SessionConfiguration.of(
				getKey(),
				getSessionId() + 1,
				getGap(),
				startTimestamp,
				getNumberOfTimelyEvents(),
				getEventFactory());
	}
}


text:
from google.cloud.bigquery import analyticshub_v1

def sample_update_data_exchange():
    # Create a client
    client = analyticshub_v1.AnalyticsHubServiceClient()

    # Initialize request argument(s)
    data_exchange = analyticshub_v1.DataExchange()
    data_exchange.display_name = "display_name_value"

    request = analyticshub_v1.UpdateDataExchangeRequest(
        data_exchange=data_exchange,
    )

    # Make the request
    response = client.update_data_exchange(request=request)

    # Handle the response
    print(response)

# [END analyticshub_v1_generated_AnalyticsHubService_UpdateDataExchange_sync]


text:
@extends('layout.guess.main-admin')

@section('content')

        <form class="form-horizontal" role="form" method="post" action="/GuessSeries/admin/addSeries">

                Name

                    <input type="text" class="form-control" value="" name="name" id="inputEmail3" placeholder="Name">

                Year

                    <input type="text" class="form-control" name="year" id="inputPassword3" placeholder="Year">

                Difficulty

                    <input type="text" class="form-control" value="2" name="difficulty" id="inputPassword4">

                studio_id / name

                    <input type="text" class="form-control" name="studio" id="inputName">

                    <button type="submit" class="btn btn-default">Save</button>

        </form>

@stop

@section('sidebar')

Actions

Back

@stop


text:
#include "pch.h"

//namespaces
using namespace wolf;
using namespace wolf::system;

//Entry point of program
WOLF_MAIN()
{
    w_logger_config _log_config;
    _log_config.app_name = L"08_json";
    _log_config.log_path = wolf::system::io::get_current_directoryW();
#ifdef __WIN32
    _log_config.log_to_std_out = false;
#else
    _log_config.log_to_std_out = true;
#endif
    logger.initialize(_log_config);

    //use rapid json to make json
    using namespace rapidjson;
    StringBuffer _string_buffer;
    Writer<StringBuffer> _writer(_string_buffer);

    _writer.StartObject();
    {
    _writer.Key("name");
    _writer.String("pooya");
    _writer.Key("male");
    _writer.Bool(true);
    _writer.Key("age");
    _writer.Uint(31);
    _writer.Key("friends");
    _writer.StartArray();
    _writer.String("ray");
    _writer.String("rayan");
    _writer.String("sib");
    _writer.String("barf");
    _writer.EndArray();
    _writer.Key("NULL");
    _writer.Null();
    }
    _writer.EndObject();

    //output json
    auto _size = _string_buffer.GetSize();
    auto _str = _string_buffer.GetString();
    logger.write(_str);

    //read it again
    Document _doc;

    auto _buffer = new char[_size];
    memcpy(&_buffer[0], &_str[0], _size);

	auto _parse = &_doc.Parse<rapidjson::kParseStopWhenDoneFlag>(_buffer);
    if (_parse->HasParseError())
    {
        logger.error("error on parsing json. error code: {}", _parse->GetParseError());
    }
    else
    {
        if(_doc.HasMember("name"))
        {
            if (_doc["name"].IsString())
            {
                logger.write(_doc["name"].GetString());
            }
        }

    }

    logger.release();

	return EXIT_SUCCESS;
}


text:
package net.sf.mmm.code.base;

import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Iterator;

import net.sf.mmm.code.api.CodeContext;
import net.sf.mmm.code.api.CodeFile;
import net.sf.mmm.code.api.CodePackage;
import net.sf.mmm.code.api.node.CodeNodeWithFileWriting;
import net.sf.mmm.code.api.type.CodeType;

import org.junit.jupiter.api.Test;

/**
 * Test of {@link AbstractBaseContext} via {@link TestContext}.
 */
public class AbstractBaseContextTest extends BaseContextTest {

  /**
   * Test of {@link CodeNodeWithFileWriting#write(Path)}.
   *
   * @throws Exception on error.
   */
  @Test
  public void testWrite() throws Exception {

    // given
    CodeContext context = createContext();

    // when
    CodePackage rootPkg = context.getSource().getRootPackage();
    CodePackage fooPkg = rootPkg.getChildren().createPackage("foo");
    CodeFile fooFile = fooPkg.getChildren().getOrCreateFile("Foo");
    CodeType fooType = fooFile.getType();
    CodePackage barPkg = fooPkg.getChildren().getOrCreatePackage("bar");
    barPkg.getDoc().add("This is the bar package.");
    barPkg.getAnnotations().add(context.getType(Deprecated.class).asType());
    CodeFile barFile = barPkg.getChildren().getOrCreateFile("Bar");
    CodeType barType = barFile.getType();
    barType.getSuperTypes().add(fooType);
    barFile.getImports().add(fooType);

    Path targetDir = Files.createTempDirectory("BaseContextImplTest");
    targetDir.toFile().deleteOnExit();
    fooPkg.write(targetDir);

    // then
    int childCount = 0;
    Iterator<Path> childIterator = Files.list(targetDir).iterator();
    while (childIterator.hasNext()) {
      Path child = childIterator.next();
      if (Files.isRegularFile(child)) {
        assertThat(child).isRegularFile().hasFileName("Foo.java").hasContent("package foo;\n\n" //
            + "public class Foo {\n" //
            + "}\n");
      } else {
        assertThat(child).isDirectory().hasFileName("bar");
        Iterator<Path> subChildIterator = Files.list(child).iterator();
        while (subChildIterator.hasNext()) {
          Path subChild = subChildIterator.next();
          assertThat(subChild).isRegularFile();
          if (subChild.getFileName().toString().equals("package-info.java")) {
            assertThat(subChild).hasContent("/** This is the bar package. */\n" //
                + "@Deprecated\n" //
                + "package foo.bar;\n");
          } else {
            assertThat(subChild).hasFileName("Bar.java").hasContent("package foo.bar;\n\n" //
                + "import foo.Foo;\n\n" //
                + "public class Bar extends Foo {\n"//
                + "}\n");
          }
          childCount++;
        }
      }
      childCount++;
    }
    assertThat(childCount).isEqualTo(4);
  }

}


text:
``` diff
 {
+    namespace Microsoft.AspNetCore.Components {
+        public sealed class BindInputElementAttribute : Attribute {
+            public BindInputElementAttribute(string type, string suffix, string valueAttribute, string changeAttribute, bool isInvariantCulture, string format);
+            public string ChangeAttribute { get; }
+            public string Format { get; }
+            public bool IsInvariantCulture { get; }
+            public string Suffix { get; }
+            public string Type { get; }
+            public string ValueAttribute { get; }
+        }
+    }
+    namespace Microsoft.AspNetCore.Components.Forms {
+        public static class EditContextFieldClassExtensions {
+            public static string FieldCssClass(this EditContext editContext, in FieldIdentifier fieldIdentifier);
+            public static string FieldCssClass<TField>(this EditContext editContext, Expression<Func<TField>> accessor);
+        }
+        public class EditForm : ComponentBase {
+            public EditForm();
+            public IReadOnlyDictionary<string, object> AdditionalAttributes { get; set; }
+            public RenderFragment<EditContext> ChildContent { get; set; }
+            public EditContext EditContext { get; set; }
+            public object Model { get; set; }
+            public EventCallback<EditContext> OnInvalidSubmit { get; set; }
+            public EventCallback<EditContext> OnSubmit { get; set; }
+            public EventCallback<EditContext> OnValidSubmit { get; set; }
+            protected override void BuildRenderTree(RenderTreeBuilder builder);
+            protected override void OnParametersSet();
+        }
+        public abstract class InputBase<TValue> : ComponentBase {
+            protected InputBase();
+            public IReadOnlyDictionary<string, object> AdditionalAttributes { get; set; }
+            protected string CssClass { get; }
+            protected TValue CurrentValue { get; set; }
+            protected string CurrentValueAsString { get; set; }
+            protected EditContext EditContext { get; set; }
+            protected FieldIdentifier FieldIdentifier { get; set; }
+            public TValue Value { get; set; }
+            public EventCallback<TValue> ValueChanged { get; set; }
+            public Expression<Func<TValue>> ValueExpression { get; set; }
+            protected virtual string FormatValueAsString(TValue value);
+            public override Task SetParametersAsync(ParameterView parameters);
+            protected abstract bool TryParseValueFromString(string value, out TValue result, out string validationErrorMessage);
+        }
+        public class InputCheckbox : InputBase<bool> {
+            public InputCheckbox();
+            protected override void BuildRenderTree(RenderTreeBuilder builder);
+            protected override bool TryParseValueFromString(string value, out bool result, out string validationErrorMessage);
+        }
+        public class InputDate<TValue> : InputBase<TValue> {
+            public InputDate();
+            public string ParsingErrorMessage { get; set; }
+            protected override void BuildRenderTree(RenderTreeBuilder builder);
+            protected override string FormatValueAsString(TValue value);
+            protected override bool TryParseValueFromString(string value, out TValue result, out string validationErrorMessage);
+        }
+        public class InputNumber<TValue> : InputBase<TValue> {
+            public InputNumber();
+            public string ParsingErrorMessage { get; set; }
+            protected override void BuildRenderTree(RenderTreeBuilder builder);
+            protected override string FormatValueAsString(TValue value);
+            protected override bool TryParseValueFromString(string value, out TValue result, out string validationErrorMessage);
+        }
+        public class InputSelect<TValue> : InputBase<TValue> {
+            public InputSelect();
+            public RenderFragment ChildContent { get; set; }
+            protected override void BuildRenderTree(RenderTreeBuilder builder);
+            protected override bool TryParseValueFromString(string value, out TValue result, out string validationErrorMessage);
+        }
+        public class InputText : InputBase<string> {
+            public InputText();
+            protected override void BuildRenderTree(RenderTreeBuilder builder);
+            protected override bool TryParseValueFromString(string value, out string result, out string validationErrorMessage);
+        }
+        public class InputTextArea : InputBase<string> {
+            public InputTextArea();
+            protected override void BuildRenderTree(RenderTreeBuilder builder);
+            protected override bool TryParseValueFromString(string value, out string result, out string validationErrorMessage);
+        }
+        public class ValidationMessage<TValue> : ComponentBase, IDisposable {
+            public ValidationMessage();
+            public IReadOnlyDictionary<string, object> AdditionalAttributes { get; set; }
+            public Expression<Func<TValue>> For { get; set; }
+            protected override void BuildRenderTree(RenderTreeBuilder builder);
+            protected virtual void Dispose(bool disposing);
+            protected override void OnParametersSet();
+            void System.IDisposable.Dispose();
+        }
+        public class ValidationSummary : ComponentBase, IDisposable {
+            public ValidationSummary();
+            public IReadOnlyDictionary<string, object> AdditionalAttributes { get; set; }
+            protected override void BuildRenderTree(RenderTreeBuilder builder);
+            protected virtual void Dispose(bool disposing);
+            protected override void OnParametersSet();
+            void System.IDisposable.Dispose();
+        }
+    }
+    namespace Microsoft.AspNetCore.Components.RenderTree {
+        public sealed class WebEventDescriptor {
+            public WebEventDescriptor();
+            public int BrowserRendererId { get; set; }
+            public string EventArgsType { get; set; }
+            public EventFieldInfo EventFieldInfo { get; set; }
+            public ulong EventHandlerId { get; set; }
+        }
+    }
+    namespace Microsoft.AspNetCore.Components.Routing {
+        public class NavLink : ComponentBase, IDisposable {
+            public NavLink();
+            public string ActiveClass { get; set; }
+            public IReadOnlyDictionary<string, object> AdditionalAttributes { get; set; }
+            public RenderFragment ChildContent { get; set; }
+            protected string CssClass { get; set; }
+            public NavLinkMatch Match { get; set; }
+            protected override void BuildRenderTree(RenderTreeBuilder builder);
+            public void Dispose();
+            protected override void OnInitialized();
+            protected override void OnParametersSet();
+        }
+        public enum NavLinkMatch {
+            All = 1,
+            Prefix = 0,
+        }
+    }
+    namespace Microsoft.AspNetCore.Components.Web {
+        public static class BindAttributes
+        public class ClipboardEventArgs : EventArgs {
+            public ClipboardEventArgs();
+            public string Type { get; set; }
+        }
+        public class DataTransfer {
+            public DataTransfer();
+            public string DropEffect { get; set; }
+            public string EffectAllowed { get; set; }
+            public string[] Files { get; set; }
+            public DataTransferItem[] Items { get; set; }
+            public string[] Types { get; set; }
+        }
+        public class DataTransferItem {
+            public DataTransferItem();
+            public string Kind { get; set; }
+            public string Type { get; set; }
+        }
+        public class DragEventArgs : MouseEventArgs {
+            public DragEventArgs();
+            public DataTransfer DataTransfer { get; set; }
+        }
+        public class ErrorEventArgs : EventArgs {
+            public ErrorEventArgs();
+            public int Colno { get; set; }
+            public string Filename { get; set; }
+            public int Lineno { get; set; }
+            public string Message { get; set; }
+            public string Type { get; set; }
+        }
+        public static class EventHandlers
+        public class FocusEventArgs : EventArgs {
+            public FocusEventArgs();
+            public string Type { get; set; }
+        }
+        public class KeyboardEventArgs : EventArgs {
+            public KeyboardEventArgs();
+            public bool AltKey { get; set; }
+            public string Code { get; set; }
+            public bool CtrlKey { get; set; }
+            public string Key { get; set; }
+            public float Location { get; set; }
+            public bool MetaKey { get; set; }
+            public bool Repeat { get; set; }
+            public bool ShiftKey { get; set; }
+            public string Type { get; set; }
+        }
+        public class MouseEventArgs : EventArgs {
+            public MouseEventArgs();
+            public bool AltKey { get; set; }
+            public long Button { get; set; }
+            public long Buttons { get; set; }
+            public double ClientX { get; set; }
+            public double ClientY { get; set; }
+            public bool CtrlKey { get; set; }
+            public long Detail { get; set; }
+            public bool MetaKey { get; set; }
+            public double ScreenX { get; set; }
+            public double ScreenY { get; set; }
+            public bool ShiftKey { get; set; }
+            public string Type { get; set; }
+        }
+        public class PointerEventArgs : MouseEventArgs {
+            public PointerEventArgs();
+            public float Height { get; set; }
+            public bool IsPrimary { get; set; }
+            public long PointerId { get; set; }
+            public string PointerType { get; set; }
+            public float Pressure { get; set; }
+            public float TiltX { get; set; }
+            public float TiltY { get; set; }
+            public float Width { get; set; }
+        }
+        public class ProgressEventArgs : EventArgs {
+            public ProgressEventArgs();
+            public bool LengthComputable { get; set; }
+            public long Loaded { get; set; }
+            public long Total { get; set; }
+            public string Type { get; set; }
+        }
+        public class TouchEventArgs : EventArgs {
+            public TouchEventArgs();
+            public bool AltKey { get; set; }
+            public TouchPoint[] ChangedTouches { get; set; }
+            public bool CtrlKey { get; set; }
+            public long Detail { get; set; }
+            public bool MetaKey { get; set; }
+            public bool ShiftKey { get; set; }
+            public TouchPoint[] TargetTouches { get; set; }
+            public TouchPoint[] Touches { get; set; }
+            public string Type { get; set; }
+        }
+        public class TouchPoint {
+            public TouchPoint();
+            public double ClientX { get; set; }
+            public double ClientY { get; set; }
+            public long Identifier { get; set; }
+            public double PageX { get; set; }
+            public double PageY { get; set; }
+            public double ScreenX { get; set; }
+            public double ScreenY { get; set; }
+        }
+        public static class WebEventCallbackFactoryEventArgsExtensions {
+            public static EventCallback<ClipboardEventArgs> Create(this EventCallbackFactory factory, object receiver, Action<ClipboardEventArgs> callback);
+            public static EventCallback<DragEventArgs> Create(this EventCallbackFactory factory, object receiver, Action<DragEventArgs> callback);
+            public static EventCallback<ErrorEventArgs> Create(this EventCallbackFactory factory, object receiver, Action<ErrorEventArgs> callback);
+            public static EventCallback<FocusEventArgs> Create(this EventCallbackFactory factory, object receiver, Action<FocusEventArgs> callback);
+            public static EventCallback<KeyboardEventArgs> Create(this EventCallbackFactory factory, object receiver, Action<KeyboardEventArgs> callback);
+            public static EventCallback<MouseEventArgs> Create(this EventCallbackFactory factory, object receiver, Action<MouseEventArgs> callback);
+            public static EventCallback<PointerEventArgs> Create(this EventCallbackFactory factory, object receiver, Action<PointerEventArgs> callback);
+            public static EventCallback<ProgressEventArgs> Create(this EventCallbackFactory factory, object receiver, Action<ProgressEventArgs> callback);
+            public static EventCallback<TouchEventArgs> Create(this EventCallbackFactory factory, object receiver, Action<TouchEventArgs> callback);
+            public static EventCallback<WheelEventArgs> Create(this EventCallbackFactory factory, object receiver, Action<WheelEventArgs> callback);
+            public static EventCallback<ClipboardEventArgs> Create(this EventCallbackFactory factory, object receiver, Func<ClipboardEventArgs, Task> callback);
+            public static EventCallback<DragEventArgs> Create(this EventCallbackFactory factory, object receiver, Func<DragEventArgs, Task> callback);
+            public static EventCallback<ErrorEventArgs> Create(this EventCallbackFactory factory, object receiver, Func<ErrorEventArgs, Task> callback);
+            public static EventCallback<FocusEventArgs> Create(this EventCallbackFactory factory, object receiver, Func<FocusEventArgs, Task> callback);
+            public static EventCallback<KeyboardEventArgs> Create(this EventCallbackFactory factory, object receiver, Func<KeyboardEventArgs, Task> callback);
+            public static EventCallback<MouseEventArgs> Create(this EventCallbackFactory factory, object receiver, Func<MouseEventArgs, Task> callback);
+            public static EventCallback<PointerEventArgs> Create(this EventCallbackFactory factory, object receiver, Func<PointerEventArgs, Task> callback);
+            public static EventCallback<ProgressEventArgs> Create(this EventCallbackFactory factory, object receiver, Func<ProgressEventArgs, Task> callback);
+            public static EventCallback<TouchEventArgs> Create(this EventCallbackFactory factory, object receiver, Func<TouchEventArgs, Task> callback);
+            public static EventCallback<WheelEventArgs> Create(this EventCallbackFactory factory, object receiver, Func<WheelEventArgs, Task> callback);
+        }
+        public class WheelEventArgs : MouseEventArgs {
+            public WheelEventArgs();
+            public long DeltaMode { get; set; }
+            public double DeltaX { get; set; }
+            public double DeltaY { get; set; }
+            public double DeltaZ { get; set; }
+        }
+    }
+}
```


text:
package rx.internal.operators;

import static org.junit.Assert.*;
import static rx.internal.operators.BlockingOperatorNext.next;

import java.util.*;
import java.util.concurrent.*;
import java.util.concurrent.atomic.*;

import org.junit.*;

import rx.*;
import rx.Observable;
import rx.exceptions.TestException;
import rx.observables.BlockingObservable;
import rx.schedulers.Schedulers;
import rx.subjects.*;

public class BlockingOperatorNextTest {

    private void fireOnNextInNewThread(final Subject<String, String> o, final String value) {
        new Thread() {
            @Override
            public void run() {
                try {
                    Thread.sleep(500);
                } catch (InterruptedException e) {
                    // ignore
                }
                o.onNext(value);
            }
        }.start();
    }

    private void fireOnErrorInNewThread(final Subject<String, String> o) {
        new Thread() {
            @Override
            public void run() {
                try {
                    Thread.sleep(500);
                } catch (InterruptedException e) {
                    // ignore
                }
                o.onError(new TestException());
            }
        }.start();
    }

    @Test
    public void constructorShouldBePrivate() {
        TestUtil.checkUtilityClass(BlockingOperatorNext.class);
    }

    @Test
    public void testNext() {
        Subject<String, String> obs = PublishSubject.create();
        Iterator<String> it = next(obs).iterator();
        fireOnNextInNewThread(obs, "one");
        assertTrue(it.hasNext());
        assertEquals("one", it.next());

        fireOnNextInNewThread(obs, "two");
        assertTrue(it.hasNext());
        assertEquals("two", it.next());

        fireOnNextInNewThread(obs, "three");
        try {
            assertEquals("three", it.next());
        } catch (NoSuchElementException e) {
            fail("Calling next() without hasNext() should wait for next fire");
        }

        obs.onCompleted();
        assertFalse(it.hasNext());
        try {
            it.next();
            fail("At the end of an iterator should throw a NoSuchElementException");
        } catch (NoSuchElementException e) {
        }

        // If the observable is completed, hasNext always returns false and next always throw a NoSuchElementException.
        assertFalse(it.hasNext());
        try {
            it.next();
            fail("At the end of an iterator should throw a NoSuchElementException");
        } catch (NoSuchElementException e) {
        }
    }

    @Test
    public void testNextWithError() {
        Subject<String, String> obs = PublishSubject.create();
        Iterator<String> it = next(obs).iterator();
        fireOnNextInNewThread(obs, "one");
        assertTrue(it.hasNext());
        assertEquals("one", it.next());

        fireOnErrorInNewThread(obs);
        try {
            it.hasNext();
            fail("Expected a TestException");
        } catch (TestException e) {
        }

        assertErrorAfterObservableFail(it);
    }

    @Test
    public void testNextWithEmpty() {
        Observable<String> obs = Observable.<String> empty().observeOn(Schedulers.newThread());
        Iterator<String> it = next(obs).iterator();

        assertFalse(it.hasNext());
        try {
            it.next();
            fail("At the end of an iterator should throw a NoSuchElementException");
        } catch (NoSuchElementException e) {
        }

        // If the observable is completed, hasNext always returns false and next always throw a NoSuchElementException.
        assertFalse(it.hasNext());
        try {
            it.next();
            fail("At the end of an iterator should throw a NoSuchElementException");
        } catch (NoSuchElementException e) {
        }
    }

    @Test
    public void testOnError() throws Throwable {
        Subject<String, String> obs = PublishSubject.create();
        Iterator<String> it = next(obs).iterator();

        obs.onError(new TestException());
        try {
            it.hasNext();
            fail("Expected a TestException");
        } catch (TestException e) {
            // successful
        }

        assertErrorAfterObservableFail(it);
    }

    @Test
    public void testOnErrorInNewThread() {
        Subject<String, String> obs = PublishSubject.create();
        Iterator<String> it = next(obs).iterator();

        fireOnErrorInNewThread(obs);

        try {
            it.hasNext();
            fail("Expected a TestException");
        } catch (TestException e) {
            // successful
        }

        assertErrorAfterObservableFail(it);
    }

    private void assertErrorAfterObservableFail(Iterator<String> it) {
        // After the observable fails, hasNext and next always throw the exception.
        try {
            it.hasNext();
            fail("hasNext should throw a TestException");
        } catch (TestException e) {
        }
        try {
            it.next();
            fail("next should throw a TestException");
        } catch (TestException e) {
        }
    }

    @Test
    public void testNextWithOnlyUsingNextMethod() {
        Subject<String, String> obs = PublishSubject.create();
        Iterator<String> it = next(obs).iterator();
        fireOnNextInNewThread(obs, "one");
        assertEquals("one", it.next());

        fireOnNextInNewThread(obs, "two");
        assertEquals("two", it.next());

        obs.onCompleted();
        try {
            it.next();
            fail("At the end of an iterator should throw a NoSuchElementException");
        } catch (NoSuchElementException e) {
        }
    }

    @Test
    public void testNextWithCallingHasNextMultipleTimes() {
        Subject<String, String> obs = PublishSubject.create();
        Iterator<String> it = next(obs).iterator();
        fireOnNextInNewThread(obs, "one");
        assertTrue(it.hasNext());
        assertTrue(it.hasNext());
        assertTrue(it.hasNext());
        assertTrue(it.hasNext());
        assertEquals("one", it.next());

        obs.onCompleted();
        try {
            it.next();
            fail("At the end of an iterator should throw a NoSuchElementException");
        } catch (NoSuchElementException e) {
        }
    }

    /**
     * Confirm that no buffering or blocking of the Observable onNext calls occurs and it just grabs the next emitted value.
     * <p/>
     * This results in output such as => a: 1 b: 2 c: 89
     *
     * @throws Throwable
     */
    @Test
    public void testNoBufferingOrBlockingOfSequence() throws Throwable {
        int retries = 10;

        for (;;) {
            try {
                final CountDownLatch finished = new CountDownLatch(1);
                final int COUNT = 30;
                final CountDownLatch timeHasPassed = new CountDownLatch(COUNT);
                final AtomicBoolean running = new AtomicBoolean(true);
                final AtomicInteger count = new AtomicInteger(0);
                final Observable<Integer> obs = Observable.unsafeCreate(new Observable.OnSubscribe<Integer>() {

                    @Override
                    public void call(final Subscriber<? super Integer> o) {
                        new Thread(new Runnable() {

                            @Override
                            public void run() {
                                try {
                                    while (running.get()) {
                                        o.onNext(count.incrementAndGet());
                                        timeHasPassed.countDown();
                                    }
                                    o.onCompleted();
                                } catch (Throwable e) {
                                    o.onError(e);
                                } finally {
                                    finished.countDown();
                                }
                            }
                        }).start();
                    }

                });

                try {
                    Iterator<Integer> it = next(obs).iterator();

                    assertTrue(it.hasNext());
                    int a = it.next();
                    assertTrue(it.hasNext());
                    int b = it.next();
                    // we should have a different value
                    assertTrue("a and b should be different", a != b);

                    // wait for some time (if times out we are blocked somewhere so fail ... set very high for very slow, constrained machines)
                    timeHasPassed.await(8000, TimeUnit.MILLISECONDS);

                    assertTrue(it.hasNext());
                    int c = it.next();

                    assertTrue("c should not just be the next in sequence", c != (b + 1));
                    assertTrue("expected that c [" + c + "] is higher than or equal to " + COUNT, c >= COUNT);

                    assertTrue(it.hasNext());
                    int d = it.next();
                    assertTrue(d > c);

                    // shut down the thread
                    running.set(false);

                    finished.await();

                    assertFalse(it.hasNext());

                    System.out.println("a: " + a + " b: " + b + " c: " + c);
                } finally {
                    running.set(false); // don't let the thread spin indefinitely
                }
                return;
            } catch (AssertionError ex) {
                if (retries-- == 0) {
                    throw ex;
                }
            }
        }
    }

    @Test /* (timeout = 8000) */
    public void testSingleSourceManyIterators() throws InterruptedException {
        Observable<Long> o = Observable.interval(100, TimeUnit.MILLISECONDS);
        PublishSubject<Void> terminal = PublishSubject.create();
        BlockingObservable<Long> source = o.takeUntil(terminal).toBlocking();

        Iterable<Long> iter = source.next();

        for (int j = 0; j < 3; j++) {
            BlockingOperatorNext.NextIterator<Long> it = (BlockingOperatorNext.NextIterator<Long>)iter.iterator();

            for (long i = 0; i < 10; i++) {
                Assert.assertEquals(true, it.hasNext());
                Assert.assertEquals(j + "th iteration next", Long.valueOf(i), it.next());
            }
            terminal.onNext(null);
        }
    }

    @Test
    public void testSynchronousNext() {
        assertEquals(1, BehaviorSubject.create(1).take(1).toBlocking().single().intValue());
        assertEquals(2, BehaviorSubject.create(2).toBlocking().toIterable().iterator().next().intValue());
        assertEquals(3, BehaviorSubject.create(3).toBlocking().next().iterator().next().intValue());
    }
}


text:
package com.gary.garytool.business.map.api;

import java.util.ArrayList;

import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.Point;

public class Line extends BaseGraphics {

	public Line(ArrayList<Coordinates> crds,Paint p){
		super(crds,p);
	}

	@Override
	public void draw(){
		if(this.points!=null&&this.points.size()>1){
			Coordinates crd=this.points.get(0);

			Path path=new Path();
			Point tmp=this.pMaplet.CoordinatesToPixel(crd.X, crd.Y);
			path.moveTo(tmp.x, tmp.y);
			for(int i=1;i<this.points.size();i++){
				crd=this.points.get(i);
				tmp=this.pMaplet.CoordinatesToPixel(crd.X, crd.Y);
				path.lineTo(tmp.x, tmp.y);
			}
			if(this.pMaplet.drawingCanvas!=null){
				this.pMaplet.drawingCanvas.drawPath(path,this.pen);
//				this.pen.setStyle(Paint.Style.STROKE);
//				this.pMaplet.drawingCanvas.drawRect(380,480,420,520,this.pen);
			}
		}
	}
}


text:
====
Using polymer to create multiple types of forms using a single tag in HTML
====

## Example

```
1. Install all the contents on the web server (for now simply download the zip file)
2. Add the import element for form <link rel="import" href="q-form.html">'
3. Include '<script src="../platform/platform.js"></script>'
4. For a Contact Form: '<q-form types="contact" sendto="your email address"></q-form>'
```


text:
sudo apt-get update; \
  sudo apt-get -y install dotnet-sdk-6.0 git cmake build-essential libssl-dev pkg-config libboost-all-dev libsodium-dev libzmq5

(cd src/Miningcore && \
BUILDIR=${1:-../../build} && \
echo "Building into $BUILDIR" && \
dotnet publish -c Release --framework net6.0 -o $BUILDIR)


text:
class CreateTopicTags < ActiveRecord::Migration[4.2]
  def change
    create_table :topic_tags, id: false do |t|
      t.integer :topic_id
      t.integer :tag_id
    end

    add_index :topic_tags, :topic_id
    add_index :topic_tags, :tag_id
  end
end


text:
"""
see http://www.sno.phy.queensu.ca/~phil/exiftool/
"""

import json
import sys
from subprocess import Popen, PIPE

exiftool_path = '/usr/local/bin/exiftool'
exiftool_path = '/usr/bin/exiftool'

def exif_info(any_file):
    """
    Get file info in json
    """
    cmd = [exiftool_path, '-j', any_file]
    p = Popen(cmd, stdout=PIPE, stderr=PIPE)
    out, err = p.communicate()
    if p.returncode > 0:
        print 'Could not get file information, error: %s %s' % (out, err)
        return False
    return json.loads(out)

if __name__ == '__main__':
    rs = exif_info(sys.argv[1])
    if rs:
        print json.dumps(rs, sort_keys=True, indent=4)


text:
package orwir.widget.carousel.misc;

import android.content.Context;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.Transformation;

public class WrapPagerView extends ViewPager {

    private Boolean mAnimStarted = false;
    private Animation a;
    private int targetHeight;
    private int heightChange;
    private int currentHeight;

    {
        a = new Animation() {

            @Override
            protected void applyTransformation(float interpolatedTime, Transformation t) {
                if (interpolatedTime >= 1) {
                    getLayoutParams().height = targetHeight;
                } else {
                    int stepHeight = (int) (heightChange * interpolatedTime);
                    getLayoutParams().height = currentHeight + stepHeight;
                }
                requestLayout();
            }

            @Override
            public boolean willChangeBounds() {
                return true;
            }

        };

        a.setAnimationListener(new Animation.AnimationListener() {
            @Override
            public void onAnimationStart(Animation animation) {
                mAnimStarted = true;
            }

            @Override
            public void onAnimationEnd(Animation animation) {
                mAnimStarted = false;
            }

            @Override
            public void onAnimationRepeat(Animation animation) {
            }
        });
    }

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

    public WrapPagerView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

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

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        int hSize = MeasureSpec.getSize(heightMeasureSpec);
        if (getChildCount() > 0) {
            View view = findViewWithTag(getCurrentItem());
            if (view != null) {
                view.measure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
                hSize = view.getMeasuredHeight();

                if (hSize > 0) {
                    targetHeight = hSize;
                    currentHeight = getLayoutParams().height;
                    heightChange = targetHeight - currentHeight;

                    if (!mAnimStarted) {
                        a.setDuration(100);
                        startAnimation(a);
                        mAnimStarted = true;
                    }
                }
            }
        }
        super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(hSize, MeasureSpec.AT_MOST));
    }
}


text:
class CreateCategoryRecipes < ActiveRecord::Migration

  def self.up
    create_table :categories_members do |t|
      t.references :category
      t.references :member, :polymorphic => true

      t.timestamps
    end
    add_index :categories_members, :category_id
    add_index :categories_members, :member_id
  end

  def self.down
    drop_table :categories_members
  end

end