text:
package com.cpic.carmarket.activity;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

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

import android.app.Dialog;
import android.content.ContentResolver;
import android.content.Intent;
import android.content.SharedPreferences;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.graphics.Matrix;
import android.graphics.drawable.ColorDrawable;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
import android.os.Message;
import android.preference.PreferenceManager;
import android.provider.MediaStore;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.Gravity;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.PopupWindow;
import android.widget.PopupWindow.OnDismissListener;
import android.widget.TextView;
import android.widget.TimePicker;
import android.widget.Toast;

import com.alibaba.fastjson.JSONObject;
import com.cpic.carmarket.R;
import com.cpic.carmarket.base.BaseActivity;
import com.cpic.carmarket.bean.MerchantInfo;
import com.cpic.carmarket.bean.MerchantInfoDataInfo;
import com.cpic.carmarket.utils.ProgressDialogHandle;
import com.cpic.carmarket.utils.UrlUtils;
import com.cpic.carmarket.view.CircleImageView;
import com.cpic.carmarket.view.MyListView;
import com.lidroid.xutils.BitmapUtils;
import com.lidroid.xutils.HttpUtils;
import com.lidroid.xutils.bitmap.BitmapDisplayConfig;
import com.lidroid.xutils.exception.HttpException;
import com.lidroid.xutils.http.RequestParams;
import com.lidroid.xutils.http.ResponseInfo;
import com.lidroid.xutils.http.callback.RequestCallBack;
import com.lidroid.xutils.http.client.HttpRequest.HttpMethod;

public class MerchantInfoActivity extends BaseActivity {

	private CircleImageView ivIcon;

	private MyListView mlv;

	private ImageView ivBack;
	private LinearLayout llIcon, llAddress, llTime, llChange, llMobile;

	private EditText etContent;

	private TextView tvAddress, tvTime, tvname, tvMobile;
	private Button btnSubmit;

	private ArrayList<MerchantInfoDataInfo> datas;

	private HttpUtils post;
	private RequestParams params;
	private SharedPreferences sp;

	private BitmapUtils utils;
	private Dialog dialog;

	private MercAdapter adapter;

	private BitmapDisplayConfig config;

	private TextView tvCamera, tvPhoto, tvBack;

	private static final int CAMERA = 1;
	private static final int ADDRESS = 2;
	private static final int CAR_LIST = 3;
	private static final int PHOTO = 0;

	private Uri cameraUri;
	private File cameraPic;
	private Intent intent;
	private PopupWindow pw, pwMobile;
	private int screenWidth;
	private String path;// 图片路径

	private String address;

	private TimePicker tpAm, tpPm;
	private Button submitTime;

	private String Latitude, Longitude;// 上个页面返回的经纬度

	@Override
	protected void getIntentData(Bundle savedInstanceState) {
		DisplayMetrics metrics = new DisplayMetrics();
		this.getWindowManager().getDefaultDisplay().getMetrics(metrics);
		screenWidth = metrics.widthPixels;
	}

	@Override
	protected void loadXml() {
		setContentView(R.layout.activity_merchant_info);
	}

	@Override
	protected void initView() {
		llIcon = (LinearLayout) findViewById(R.id.activity_merchant_ll_icon);
		llAddress = (LinearLayout) findViewById(R.id.activity_merchant_ll_address);
		llTime = (LinearLayout) findViewById(R.id.activity_merchant_ll_time);
		llMobile = (LinearLayout) findViewById(R.id.activity_merchant_ll_mobile);
		ivIcon = (CircleImageView) findViewById(R.id.activity_merchant_iv_icon);
		ivBack = (ImageView) findViewById(R.id.activity_merchant_iv_back);
		llChange = (LinearLayout) findViewById(R.id.activity_merchant_ll_change);
		mlv = (MyListView) findViewById(R.id.activity_merchant_mlv);
		tvAddress = (TextView) findViewById(R.id.activity_merchant_tv_address);
		tvTime = (TextView) findViewById(R.id.activity_merchant_tv_time);
		tvname = (TextView) findViewById(R.id.activity_merchant_tv_name);
		tvMobile = (TextView) findViewById(R.id.activity_merchant_tv_mobile);
		dialog = ProgressDialogHandle.getProgressDialog(this, null);
		etContent = (EditText) findViewById(R.id.activity_merchant_et_store_intro);
		btnSubmit = (Button) findViewById(R.id.activity_merchant_btn_submit);
	}

	@Override
	protected void registerListener() {

		ivBack.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				onBackPressed();
			}
		});

		llIcon.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				showPopupWindow(v);
			}
		});
		/**
		 * 地址
		 */
		llAddress.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				intent = new Intent(MerchantInfoActivity.this,
						DetailAddressActivity.class);
				startActivityForResult(intent, ADDRESS);
				;
			}
		});
		llTime.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				showTimePop(v);
			}
		});
		/**
		 * 更改服务车型
		 */
		llChange.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				intent = new Intent(MerchantInfoActivity.this,
						ServiceCarTypeActivity.class);
				startActivityForResult(intent, CAR_LIST);
			}
		});

		/**
		 * 更改手机号码
		 */
		llMobile.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				showMobilePop(v);
			}

		});

		btnSubmit.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				submitDatas();
			}
		});
	}

	private void submitDatas() {

		post = new HttpUtils();
		params = new RequestParams();
		params.addBodyParameter("address", tvAddress.getText().toString());
		if (Latitude == null) {
			Latitude = "0";
		}
		if (Longitude == null) {
			Longitude = "0";
		}
		sp = PreferenceManager
				.getDefaultSharedPreferences(MerchantInfoActivity.this);
		String token = sp.getString("token", "");
		params.addBodyParameter("token", token);
		params.addBodyParameter("lat", Latitude);
		params.addBodyParameter("lng", Longitude);
		params.addBodyParameter("company_desc", etContent.getText().toString());
		params.addBodyParameter("tel", tvMobile.getText().toString());
		params.addBodyParameter("on_time", tvTime.getText().toString());
		params.addBodyParameter("business", TasktoJson(datas));
		Log.i("oye", TasktoJson(datas));
		String url = UrlUtils.postUrl + UrlUtils.path_modifyInfo;
		post.send(HttpMethod.POST, url, params, new RequestCallBack<String>() {

			private Handler handler;

			@Override
			public void onStart() {
				super.onStart();
				if (dialog != null) {
					dialog.show();
				}

			}

			@Override
			public void onFailure(HttpException arg0, String arg1) {
				if (dialog != null) {
					dialog.dismiss();
				}
			}

			@Override
			public void onSuccess(ResponseInfo<String> arg0) {
				if (dialog != null) {
					dialog.dismiss();
				}
				JSONObject obj = JSONObject.parseObject(arg0.result);
				int code = obj.getIntValue("code");
				if (code == 1) {
					showRegisterSuccess();
					new Handler().postDelayed(new Runnable(){

					    public void run() {
					    	MerchantInfoActivity.this.finish();
					    }

					 }, 500);
				}
			}
		});
	}

	private void showRegisterSuccess() {
		View view = View.inflate(MerchantInfoActivity.this,
				R.layout.pop_wait_submit, null);
		pwMobile = new PopupWindow(view, screenWidth * 3 / 5,
				LayoutParams.WRAP_CONTENT);
		pwMobile.setFocusable(true);
		WindowManager.LayoutParams params = MerchantInfoActivity.this
				.getWindow().getAttributes();
		params.alpha = 0.7f;
		MerchantInfoActivity.this.getWindow().setAttributes(params);
		pwMobile.setAnimationStyle(R.style.pw_anim_style1);
		pwMobile.setBackgroundDrawable(new ColorDrawable());
		pwMobile.setOutsideTouchable(true);

		pwMobile.showAtLocation(view, Gravity.TOP, 0, 350);
		pwMobile.setOnDismissListener(new OnDismissListener() {

			@Override
			public void onDismiss() {
				WindowManager.LayoutParams params = MerchantInfoActivity.this
						.getWindow().getAttributes();
				params.alpha = 1f;
				MerchantInfoActivity.this.getWindow().setAttributes(params);
			}
		});
	}

	/**
	 * 将数组转化成json字符串
	 */
	public String TasktoJson(List<MerchantInfoDataInfo> data) {
		String jsonresult = "";
		JSONArray array = new JSONArray();
		for (int i = 0; i < data.size(); i++) {
			org.json.JSONObject petobj = new org.json.JSONObject();
			try {
				petobj.put("dim_name", data.get(i).getDim_name());
				petobj.put("car_category", data.get(i).getCar_category());
				petobj.put("category_name", data.get(i).getCategory_name());
				array.put(petobj);
			} catch (JSONException e) {
				e.printStackTrace();
			}
		}
		jsonresult = array.toString();
		return jsonresult;
	}

	/**
	 * 修改号码的淡出匡
	 */
	private void showMobilePop(View v) {
		View view = View.inflate(MerchantInfoActivity.this,
				R.layout.popup_mobile, null);
		final EditText et = (EditText) view.findViewById(R.id.popup_mobile_et);
		Button btnDel = (Button) view.findViewById(R.id.popup_mobile_btn_del);
		Button btnEn = (Button) view.findViewById(R.id.popup_mobile_btn_ensure);

		pwMobile = new PopupWindow(view, screenWidth * 4 / 5,
				LayoutParams.WRAP_CONTENT);
		pwMobile.setFocusable(true);
		WindowManager.LayoutParams params = MerchantInfoActivity.this
				.getWindow().getAttributes();
		params.alpha = 0.7f;
		MerchantInfoActivity.this.getWindow().setAttributes(params);

		pwMobile.setBackgroundDrawable(new ColorDrawable());
		pwMobile.setOutsideTouchable(true);

		pwMobile.showAtLocation(v, Gravity.CENTER, 0, 0);

		btnDel.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				pwMobile.dismiss();
			}
		});

		btnEn.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				tvMobile.setText(et.getText().toString());
				pwMobile.dismiss();
			}
		});
		pwMobile.setOnDismissListener(new OnDismissListener() {

			@Override
			public void onDismiss() {
				WindowManager.LayoutParams params = MerchantInfoActivity.this
						.getWindow().getAttributes();
				params.alpha = 1f;
				MerchantInfoActivity.this.getWindow().setAttributes(params);
			}
		});

	}

	private void showTimePop(View v) {
		View view = View.inflate(MerchantInfoActivity.this,
				R.layout.popupwindow_time_pick, null);
		tpAm = (TimePicker) view.findViewById(R.id.popupwindow_time_am);
		tpPm = (TimePicker) view.findViewById(R.id.popupwindow_time_pm);
		submitTime = (Button) view
				.findViewById(R.id.popupwindow_time_btn_ensure);
		tpAm.setIs24HourView(true);
		tpPm.setIs24HourView(true);

		submitTime.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				if (tpAm.getCurrentHour() > tpPm.getCurrentHour()) {
					showShortToast("开始时间不得大于结束时间");
					return;
				}
				if (tpAm.getCurrentHour() == tpPm.getCurrentHour()) {
					if (tpAm.getCurrentMinute() >= tpPm.getCurrentMinute()) {
						showShortToast("开始时间不得大于结束时间");
						return;
					}
				}
				StringBuilder sb = new StringBuilder();
				String strAmH = "";
				String strAmM = "";
				String strPmH = "";
				String strPmM = "";

				if (tpAm.getCurrentHour().toString().length() == 1) {
					strAmH = "0" + tpAm.getCurrentHour().toString();
				} else {
					strAmH = tpAm.getCurrentHour().toString();
				}
				if (tpAm.getCurrentMinute().toString().length() == 1) {
					strAmM = "0" + tpAm.getCurrentMinute().toString();
				} else {
					strAmM = tpAm.getCurrentMinute().toString();
				}
				if (tpPm.getCurrentHour().toString().length() == 1) {
					strPmH = "0" + tpPm.getCurrentHour().toString();
				} else {
					strPmH = tpPm.getCurrentHour().toString();
				}
				if (tpPm.getCurrentMinute().toString().length() == 1) {
					strPmM = "0" + tpPm.getCurrentMinute().toString();
				} else {
					strPmM = tpPm.getCurrentMinute().toString();
				}

				sb.append(strAmH + ":");
				sb.append(strAmM + "~");
				sb.append(strPmH + ":");
				sb.append(strPmM);
				tvTime.setText(sb.toString());
				pw.dismiss();
			}
		});

		pw = new PopupWindow(view, screenWidth, LayoutParams.WRAP_CONTENT);
		pw.setFocusable(true);
		WindowManager.LayoutParams params = MerchantInfoActivity.this
				.getWindow().getAttributes();
		params.alpha = 0.7f;
		MerchantInfoActivity.this.getWindow().setAttributes(params);

		pw.setBackgroundDrawable(new ColorDrawable());
		pw.setOutsideTouchable(true);

		pw.setAnimationStyle(R.style.pw_anim_style);

		pw.showAtLocation(v, Gravity.BOTTOM | Gravity.CENTER_HORIZONTAL, 0, 0);

		pw.setOnDismissListener(new OnDismissListener() {

			@Override
			public void onDismiss() {
				WindowManager.LayoutParams params = MerchantInfoActivity.this
						.getWindow().getAttributes();
				params.alpha = 1f;
				MerchantInfoActivity.this.getWindow().setAttributes(params);
			}
		});

	}

	@Override
	protected void initData() {
		loadDatas();
	}

	private void loadDatas() {
		sp = PreferenceManager
				.getDefaultSharedPreferences(MerchantInfoActivity.this);
		String token = sp.getString("token", "");
		post = new HttpUtils();
		params = new RequestParams();
		params.addBodyParameter("token", token);
		String url = UrlUtils.postUrl + UrlUtils.path_merchantInfo;
		post.send(HttpMethod.POST, url, params, new RequestCallBack<String>() {

			@Override
			public void onStart() {
				super.onStart();
				if (dialog != null) {
					dialog.show();
				}
			}

			@Override
			public void onFailure(HttpException arg0, String arg1) {
				if (dialog != null) {
					dialog.dismiss();
				}
				showShortToast("获取数据失败,请检查网络连接!");
			}

			@Override
			public void onSuccess(ResponseInfo<String> arg0) {
				if (dialog != null) {
					dialog.dismiss();
				}
				MerchantInfo info = JSONObject.parseObject(arg0.result,
						MerchantInfo.class);
				int code = info.getCode();
				if (code == 1) {
					datas = info.getData().getBusiness();
					adapter = new MercAdapter();
					adapter.setDatas(datas);
					mlv.setAdapter(adapter);
					tvAddress.setText(info.getData().getAddress());
					tvname.setText(info.getData().getCompany_name());
					tvMobile.setText(info.getData().getTel());
					tvTime.setText(info.getData().getOn_time());
					etContent.setText(info.getData().getCompany_desc());
					String img_url = info.getData().getStore_img();
					loadIvIcon(img_url);
				} else {
					showShortToast("获取数据失败");
				}
			}
		});
	}

	/**
	 * 下载门面
	 *
	 * @param img_url
	 */
	private void loadIvIcon(String img_url) {
		config = new BitmapDisplayConfig();
		utils = new BitmapUtils(MerchantInfoActivity.this);
		config.setLoadingDrawable(getResources().getDrawable(
				R.drawable.empty_photo));
		config.setLoadFailedDrawable(getResources().getDrawable(
				R.drawable.empty_photo));
		utils.display(ivIcon, img_url, config);
	}

	private void showPopupWindow(View v) {
		View view = View.inflate(MerchantInfoActivity.this,
				R.layout.popupwindow_1, null);
		tvCamera = (TextView) view.findViewById(R.id.btn_camera);
		tvPhoto = (TextView) view.findViewById(R.id.btn_photo);
		tvBack = (TextView) view.findViewById(R.id.btn_back);
		tvCamera.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				getFromCamera();
				pw.dismiss();
			}
		});
		tvPhoto.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				getFromPhoto();
				pw.dismiss();
			}
		});
		tvBack.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				pw.dismiss();
			}
		});

		pw = new PopupWindow(view, screenWidth * 99 / 100,
				LayoutParams.WRAP_CONTENT);
		pw.setFocusable(true);
		WindowManager.LayoutParams params = MerchantInfoActivity.this
				.getWindow().getAttributes();
		params.alpha = 0.7f;
		MerchantInfoActivity.this.getWindow().setAttributes(params);

		pw.setBackgroundDrawable(new ColorDrawable());
		pw.setOutsideTouchable(true);

		pw.setAnimationStyle(R.style.pw_anim_style);

		pw.showAtLocation(v, Gravity.BOTTOM | Gravity.CENTER_HORIZONTAL, 0, 0);

		pw.setOnDismissListener(new OnDismissListener() {

			@Override
			public void onDismiss() {
				WindowManager.LayoutParams params = MerchantInfoActivity.this
						.getWindow().getAttributes();
				params.alpha = 1f;
				MerchantInfoActivity.this.getWindow().setAttributes(params);
			}
		});

	}

	/**
	 * 相机中调用
	 */
	private void getFromCamera() {
		// 通过Intent调用系统相机
		intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
		cameraPic = new File(Environment.getExternalStorageDirectory()
				.getAbsolutePath() + "/store.jpg");
		cameraUri = Uri.fromFile(cameraPic);
		// 指定照片拍摄后的存储位置
		intent.putExtra(MediaStore.EXTRA_OUTPUT, cameraUri);
		startActivityForResult(intent, CAMERA);
	}

	private void getFromPhoto() {
		Intent intent = new Intent(Intent.ACTION_PICK);
		intent.setType("image/*");
		intent.putExtra("return-data", true);
		startActivityForResult(intent, PHOTO);
	}

	/**
	 * 通过获取文件名上传图片的文件流
	 *
	 * @param file
	 */
	private void upLoadUserIcon(File file) {
		post = new HttpUtils();
		params = new RequestParams();
		sp = PreferenceManager
				.getDefaultSharedPreferences(MerchantInfoActivity.this);
		String token = sp.getString("token", "");
		params.addBodyParameter("token", token);
		params.addBodyParameter("poster", file);
		String url = UrlUtils.postUrl + UrlUtils.path_uploadStoreImg;
		post.send(HttpMethod.POST, url, params, new RequestCallBack<String>() {

			@Override
			public void onStart() {
				super.onStart();
				if (dialog != null) {
					dialog.show();
				}
			}

			@Override
			public void onFailure(HttpException arg0, String arg1) {
				showShortToast("上传失败,请检查网络状况");
				if (dialog == null) {
					dialog.dismiss();
				}
			}

			@Override
			public void onSuccess(ResponseInfo<String> arg0) {
				if (dialog != null) {
					dialog.dismiss();
				}
				JSONObject obj = JSONObject.parseObject(arg0.result);
				int code = obj.getInteger("code");
				if (code == 0) {
					showShortToast("上传失败,请重试");
				} else if (code == 1) {
					showShortToast("上传成功");
				}
			}
		});
	}

	@Override
	protected void onActivityResult(int requestCode, int resultCode, Intent data) {
		super.onActivityResult(requestCode, resultCode, data);

		if (requestCode == ADDRESS && resultCode == RESULT_OK) {
			if (data != null) {
				address = data.getStringExtra("address");
				tvAddress.setText(address);
			}
		}

		if (requestCode == CAR_LIST && resultCode == RESULT_OK) {
			if (data != null) {
				datas = data.getParcelableArrayListExtra("car_list");
				adapter.setDatas(datas);
				adapter.notifyDataSetChanged();
			}
		}

		if (requestCode == CAMERA) {
			path = Environment.getExternalStorageDirectory().getAbsolutePath()
					+ "/store.jpg";
			if (!cameraUri.getPath().isEmpty()) {
				Bitmap temp = BitmapFactory.decodeFile(cameraUri.getPath());
				Bitmap bitmap = big(temp, 60, 60);
				ivIcon.setImageBitmap(bitmap);
				upLoadUserIcon(new File(path));
			}

			// upLoadUserIcon(new File(Environment.getExternalStorageDirectory()
			// .getAbsolutePath() + "/usericon.PNG"));
		} else if (requestCode == PHOTO) {
			if (data != null) {
				Uri uri = data.getData();
				// 因为相册出返回的uri路径是ContentProvider开放的路径,不是直接的sd卡具体路径
				// 因此无法通过decodeFile方法解析图片
				// 必须通过ContentResolver对象读取图片
				ContentResolver cr = this.getContentResolver();
				try {
					Bitmap b = MediaStore.Images.Media.getBitmap(cr, uri);
					Bitmap bitmap = big(b, 60, 60);
					bitmap.getByteCount();
					ivIcon.setImageBitmap(bitmap);
					// 这里开始的第二部分,获取图片的路径:
					String[] proj = { MediaStore.Images.Media.DATA };
					// 好像是android多媒体数据库的封装接口,具体的看Android文档
					Cursor cursor = managedQuery(uri, proj, null, null, null);
					// 按我个人理解 这个是获得用户选择的图片的索引值
					int column_index = cursor
							.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
					// 将光标移至开头 ,这个很重要,不小心很容易引起越界
					cursor.moveToFirst();
					// 最后根据索引值获取图片路径
					path = cursor.getString(column_index);
					// Log.i("oye", path);
					// 上传头像
					// upLoadUserIcon(new File(path));
					upLoadUserIcon(new File(path));

				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		}
	}

	public Bitmap big(Bitmap b, float x, float y) {
		int w = b.getWidth();
		int h = b.getHeight();
		float sx = (float) x / w;// 要强制转换,不转换我的在这总是死掉。
		float sy = (float) y / h;
		Matrix matrix = new Matrix();
		matrix.postScale(sx, sy); // 长和宽放大缩小的比例
		Bitmap resizeBmp = Bitmap.createBitmap(b, 0, 0, w, h, matrix, true);
		return resizeBmp;
	}

	public class MercAdapter extends BaseAdapter {

		private ArrayList<MerchantInfoDataInfo> datas;

		public void setDatas(ArrayList<MerchantInfoDataInfo> datas) {
			this.datas = datas;
		}

		@Override
		public int getCount() {
			return datas == null ? 0 : datas.size();
		}

		@Override
		public Object getItem(int position) {
			return datas.get(position);
		}

		@Override
		public long getItemId(int position) {
			return position;
		}

		@Override
		public View getView(int position, View convertView, ViewGroup parent) {
			ViewHolder holder;
			if (convertView == null) {
				convertView = View.inflate(MerchantInfoActivity.this,
						R.layout.item_merchant_select_list, null);
				holder = new ViewHolder();
				holder.tvCar = (TextView) convertView
						.findViewById(R.id.item_merchant_tv_car);
				holder.tvCheck = (TextView) convertView
						.findViewById(R.id.item_merchant_tvcheck);
				convertView.setTag(holder);
			} else {
				holder = (ViewHolder) convertView.getTag();
			}

			holder.tvCar.setText(datas.get(position).getCategory_name());
			holder.tvCheck.setText(datas.get(position).getDim_name());
			return convertView;
		}

		class ViewHolder {
			TextView tvCheck, tvCar;
		}
	}
}


text:
<?php

namespace AppBundle\Entity;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;

/**
 * Game
 *
 * @ORM\Table()
 * @ORM\Entity(repositoryClass="AppBundle\Repository\LeagueRepository")
 * @ORM\HasLifecycleCallbacks()
 */
class League
{

    /**
     * @var int
     *
     * @ORM\Column(type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     * @ORM\Column(type="string", length=255)
     */
    private $name;

    /**
     * @var \DateTime
     *
     * @ORM\Column(type="date")
     */
    private $startDate;

    /**
     * @var \DateTime|null
     *
     * @ORM\Column(type="date", nullable=true)
     */
    private $endDate;

    /**
     * @var int
     * @ORM\Column(type="integer")
     */
    private $buyIn = 0;

    /**
     * @var Collection|Player[]
     * @ORM\ManyToMany(targetEntity="AppBundle\Entity\Player", inversedBy="leagues")
     */
    private $players;

    /**
     * @var int
     * @ORM\Column(type="integer")
     */
    private $firstPrize = 0;

    /**
     * @var int
     *
     * @ORM\Column(type="integer")
     */
    private $secondPrize = 0;

    /**
     * @var int|null
     *
     * @ORM\Column(type="integer", nullable=true)
     */
    private $thirdPrize;

    /**
     * @var Player|null
     * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Player")
     */
    private $firstPlace;

    /**
     * @var Player|null
     * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Player")
     */
    private $secondPlace;

    /**
     * @var Player|null
     * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Player")
     */
    private $thirdPlace;

    /**
     * @var \DateTime
     * @ORM\Column(type="datetime")
     */
    private $createdAt;

    /**
     * @var \DateTime
     * @ORM\Column(type="datetime")
     */
    private $updatedAt;

    public function __construct()
    {
        $this->createdAt = $this->updatedAt = new \DateTime();
        $this->startDate = new \DateTime();
        $this->players = new ArrayCollection();
    }

    /**
     * @return int
     */
    public function getId(): ?int
    {
        return $this->id;
    }

    /**
     * @return string|null
     */
    public function getName(): ?string
    {
        return $this->name;
    }

    /**
     * @param string $name
     */
    public function setName(string $name): void
    {
        $this->name = $name;
    }

    /**
     * @return \DateTime
     */
    public function getStartDate(): \DateTime
    {
        return $this->startDate;
    }

    /**
     * @param \DateTime $startDate
     * @return League
     */
    public function setStartDate(\DateTime $startDate): League
    {
        $this->startDate = $startDate;
        return $this;
    }

    /**
     * @return \DateTime
     */
    public function getEndDate(): ?\DateTime
    {
        return $this->endDate;
    }

    /**
     * @param \DateTime $endDate
     * @return League
     */
    public function setEndDate(?\DateTime $endDate): League
    {
        $this->endDate = $endDate;
        return $this;
    }

    /**
     * @return int
     */
    public function getFirstPrize(): int
    {
        return $this->firstPrize;
    }

    /**
     * @param int $firstPrize
     * @return League
     */
    public function setFirstPrize(int $firstPrize): League
    {
        $this->firstPrize = $firstPrize;
        return $this;
    }

    /**
     * @return int
     */
    public function getSecondPrize(): int
    {
        return $this->secondPrize;
    }

    /**
     * @param int $secondPrize
     * @return League
     */
    public function setSecondPrize(int $secondPrize): League
    {
        $this->secondPrize = $secondPrize;
        return $this;
    }

    /**
     * @return int|null
     */
    public function getThirdPrize(): ?int
    {
        return $this->thirdPrize;
    }

    /**
     * @param int|null $thirdPrize
     * @return League
     */
    public function setThirdPrize(?int $thirdPrize): League
    {
        $this->thirdPrize = $thirdPrize;
        return $this;
    }

    /**
     * @return \DateTime
     */
    public function getCreatedAt(): \DateTime
    {
        return $this->createdAt;
    }

    /**
     * @return \DateTime
     */
    public function getUpdatedAt(): \DateTime
    {
        return $this->updatedAt;
    }

    /**
     * @ORM\PreUpdate
     */
    public function setUpdatedAt(): void
    {
        $this->updatedAt = new \DateTime('now');
    }

    /**
     * @return int
     */
    public function getBuyIn(): int
    {
        return $this->buyIn;
    }

    /**
     * @param int $buyIn
     */
    public function setBuyIn(int $buyIn): void
    {
        $this->buyIn = $buyIn;
    }

    /**
     * @return Player[]|Collection
     */
    public function getPlayers(): Collection
    {
        return $this->players;
    }

    public function addPlayer(Player $player): void
    {
        $player->addLeague($this);
        $this->players[] = $player;
    }

    public function removePlayer(Player $player): void
    {
        $this->players->removeElement($player);
    }

    /**
     * @param Player[]|Collection $players
     */
    public function setPlayers($players): void
    {
        $this->players = $players;
    }

    public function getNoOfPlayers(): int
    {
        return $this->getPlayers()->count();
    }

    /**
     * @return Player|null
     */
    public function getFirstPlace(): ?Player
    {
        return $this->firstPlace;
    }

    /**
     * @param Player|null $firstPlace
     * @return League
     */
    public function setFirstPlace(?Player $firstPlace): League
    {
        $this->firstPlace = $firstPlace;
        return $this;
    }

    /**
     * @return Player|null
     */
    public function getSecondPlace(): ?Player
    {
        return $this->secondPlace;
    }

    /**
     * @param Player|null $secondPlace
     * @return League
     */
    public function setSecondPlace(?Player $secondPlace): League
    {
        $this->secondPlace = $secondPlace;
        return $this;
    }

    /**
     * @return Player|null
     */
    public function getThirdPlace(): ?Player
    {
        return $this->thirdPlace;
    }

    /**
     * @param Player|null $thirdPlace
     * @return League
     */
    public function setThirdPlace(?Player $thirdPlace): League
    {
        $this->thirdPlace = $thirdPlace;
        return $this;
    }

}

redpajama_set_name: RedPajamaGithub


text:
#pragma once

#include <cppexpose/plugin/plugin_api.h>

#include <glm/vec4.hpp>

#include <globjects/Framebuffer.h>

#include <gloperate/gloperate-version.h>
#include <gloperate/pipeline/Stage.h>
#include <gloperate/pipeline/Input.h>
#include <gloperate/pipeline/Output.h>

namespace gloperate
{

/**
*  @brief
*    Stage for blitting from one framebuffer to another
*/
template <typename T>
class VectorSelectionStage : public Stage
{
public:
    // Inputs
    Input<std::vector<T> *> elements;     ///< Vector containing all possible elements
    Input<int>              index;        ///< Target index of the selected element
    Input<T>                defaultValue; ///< Default value if index or vector is not valid

    // Outputs
    Output<T>               element;      ///< Selected element

public:
    /**
    *  @brief
    *    Constructor
    *
    *  @param[in] environment
    *    Environment to which the stage belongs (must NOT be null!)
    *  @param[in] name
    *    Stage name
    */
    VectorSelectionStage(Environment * environment, const std::string & name = "VectorSelectionStage");

protected:
    // Virtual Stage interface
    virtual void onProcess() override;
};

} // namespace gloperate

#include <gloperate/stages/base/VectorSelectionStage.inl>


text:
package net.scalytica.symbiotic.test.repositories

import net.scalytica.symbiotic.api.repository.FileRepository
import net.scalytica.symbiotic.api.types._

import scala.concurrent.ExecutionContext

class TestFileRepository extends FileRepository {
  override def save(
      f: File
  )(implicit ctx: SymbioticContext, ec: ExecutionContext) = ???

  override def updateMetadata(
      f: File
  )(implicit ctx: SymbioticContext, ec: ExecutionContext) = ???

  override def findLatestBy(
      fid: FileId
  )(implicit ctx: SymbioticContext, ec: ExecutionContext) = ???

  override def move(
      filename: String,
      orig: Path,
      mod: Path
  )(implicit ctx: SymbioticContext, ec: ExecutionContext) = ???

  override def find(
      filename: String,
      maybePath: Option[Path]
  )(implicit ctx: SymbioticContext, ec: ExecutionContext) = ???

  override def findLatest(
      filename: String,
      maybePath: Option[Path]
  )(implicit ctx: SymbioticContext, ec: ExecutionContext) = ???

  override def listFiles(
      path: Path
  )(implicit ctx: SymbioticContext, ec: ExecutionContext) = ???

  override def lock(
      fid: FileId
  )(implicit ctx: SymbioticContext, ec: ExecutionContext) = ???

  override def unlock(
      fid: FileId
  )(implicit ctx: SymbioticContext, ec: ExecutionContext) = ???

  override def editable(
      from: Path
  )(implicit ctx: SymbioticContext, ec: ExecutionContext) = ???

  override def markAsDeleted(
      fid: FileId
  )(implicit ctx: SymbioticContext, ec: ExecutionContext) = ???

  override def eraseFile(
      fid: FileId
  )(implicit ctx: SymbioticContext, ec: ExecutionContext) = ???
}


text:
package org.apache.ignite.internal.processors.datastructures;

import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import org.apache.ignite.internal.util.lang.GridPeerDeployAware;
import org.apache.ignite.internal.util.tostring.GridToStringBuilder;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.lang.IgniteBiTuple;

/**
 * Atomic stamped value.
 */

public final class GridCacheAtomicStampedValue<T, S> extends AtomicDataStructureValue implements GridPeerDeployAware {
    /** */
    private static final long serialVersionUID = 0L;

    /** Value. */
    private T val;

    /** Stamp. */
    private S stamp;

    /**
     * Constructor.
     *
     * @param val Initial value.
     * @param stamp Initial stamp.
     */
    public GridCacheAtomicStampedValue(T val, S stamp) {
        this.val = val;
        this.stamp = stamp;
    }

    /**
     * Empty constructor required for {@link Externalizable}.
     */
    public GridCacheAtomicStampedValue() {
        // No-op.
    }

    /** {@inheritDoc} */
    @Override public DataStructureType type() {
        return DataStructureType.ATOMIC_STAMPED;
    }

    /**
     * @param val New value.
     * @param stamp New stamp.
     */
    public void set(T val, S stamp) {
        this.val = val;
        this.stamp = stamp;
    }

    /**
     * @return Current value and stamp.
     */
    public IgniteBiTuple<T, S> get() {
        return F.t(val, stamp);
    }

    /**
     * @return val Current value.
     */
    public T value() {
        return val;
    }

    /**
     * @return Current stamp.
     */
    public S stamp() {
        return stamp;
    }

    /** {@inheritDoc} */
    @Override public void writeExternal(ObjectOutput out) throws IOException {
        out.writeObject(val);
        out.writeObject(stamp);
    }

    /** {@inheritDoc} */
    @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
        val = (T)in.readObject();
        stamp = (S)in.readObject();
    }

    /** {@inheritDoc} */
    @Override public Class<?> deployClass() {
        ClassLoader clsLdr = getClass().getClassLoader();

        // First of all check classes that may be loaded by class loader other than application one.
        return stamp != null && !clsLdr.equals(stamp.getClass().getClassLoader()) ?
            stamp.getClass() : val != null ? val.getClass() : getClass();
    }

    /** {@inheritDoc} */
    @Override public ClassLoader classLoader() {
        return deployClass().getClassLoader();
    }

    /** {@inheritDoc} */
    @Override public String toString() {
        return GridToStringBuilder.toString(GridCacheAtomicStampedValue.class, this);
    }
}


text:
import { Injectable } from '@angular/core';

import { Transformer } from 'ng2-rest-service/dist/transformer';

import { UserModel } from './user.model';
import { UserResponseBody } from './user.response-body';

@Injectable()
export class UserResponseBodyToUserModelTransformer implements Transformer<UserResponseBody, UserModel> {

    transform(data: UserResponseBody): UserModel {
        return new UserModel(
            data.id,
            data.username,
            data.plainPassword,
            new Date(data.createdAt * 1000)
        );
    }

}


text:
using namespace std;

TEST(S3RESTfulService, GetWithWrongHeader) {
    HTTPHeaders headers;
    map<string, string> params;
    S3RESTfulService service;

    string url = "https://www.bing.com/";
    headers.Add(HOST, url);
    headers.Add(CONTENTTYPE, "plain/text");

    Response resp = service.get(url, headers, params);

    EXPECT_EQ(RESPONSE_ERROR, resp.getStatus());
}

TEST(S3RESTfulService, DISABLED_GetWithEmptyHeader) {
    HTTPHeaders headers;
    map<string, string> params;
    string url;
    S3RESTfulService service;

    url = "https://www.bing.com/";

    Response resp = service.get(url, headers, params);

    EXPECT_EQ(RESPONSE_OK, resp.getStatus());
    EXPECT_EQ("Success", resp.getMessage());
    EXPECT_EQ(true, resp.moveDataBuffer().size() > 10000);
}

TEST(S3RESTfulService, GetWithoutURL) {
    HTTPHeaders headers;
    map<string, string> params;
    string url;
    S3RESTfulService service;

    Response resp = service.get(url, headers, params);

    EXPECT_EQ(RESPONSE_FAIL, resp.getStatus());
    EXPECT_EQ("Failed to talk to s3 service URL using bad/illegal format or missing URL",
              resp.getMessage());
}

TEST(S3RESTfulService, GetWithWrongURL) {
    HTTPHeaders headers;
    map<string, string> params;
    string url;
    S3RESTfulService service;

    url = "https://www.bing.com/pivotal.html";

    Response resp = service.get(url, headers, params);

    EXPECT_EQ(RESPONSE_ERROR, resp.getStatus());
}


text:
'use strict';

import Chai = require('chai');
import Sinon = require('sinon');
import builder = require('botbuilder');

import Bot = require('../../src/bot');

const assert = Chai.assert;

/**
 * Contains Tests for Bot class
 */
suite('Bot Suite -', () => {
    let sut: Bot;
    const univseralBot = {
        dialog: () => null
    };
    const dialog = {
        onDefault: () => null,
        matches: () => null
    };
    const recognizer: builder.LuisRecognizer = null;
    const connector: builder.IConnector = null;
    const sandbox: Sinon.SinonSandbox = Sinon.createSandbox();
    let botStub: Sinon.SinonStub;
    let connectorStub: Sinon.SinonStub;
    let recognizerStub: Sinon.SinonStub;
    let dialogStub: Sinon.SinonStub;
    let rootDialogStub: Sinon.SinonStub;
    let dialogOnDefaultStub: Sinon.SinonStub;
    let dialogMatchStub: Sinon.SinonStub;

    const setupStubs = () => {
        botStub = sandbox.stub(builder, 'UniversalBot');
        recognizerStub = sandbox.stub(builder, 'LuisRecognizer');
        dialogStub = sandbox.stub(builder, 'IntentDialog');
        rootDialogStub = sandbox.stub(univseralBot, 'dialog');
        dialogOnDefaultStub = sandbox.stub(dialog, 'onDefault');
        dialogMatchStub = sandbox.stub(dialog, 'matches');
        botStub.returns(univseralBot);
        recognizerStub.returns(recognizer);
        dialogStub.returns(dialog);
    };

    setup(() => {
        setupStubs();
        sut = new Bot();
    });

    teardown(() => {
        sandbox.restore();
        sut = null;
    });

    suite('initializeForConsole Tests -', () => {
        setup(() => {
            connectorStub = sandbox.stub(builder, 'ConsoleConnector');
            connectorStub.returns(connector);
        });

        test('initializeForConsole calls required bot framework methods', (done: () => void) => {
            sut.initializeForConsole();
            assert.isTrue(botStub.called);
            assert.isTrue(connectorStub.called);
            assert.isTrue(recognizerStub.called);
            assert.isTrue(dialogStub.called);
            assert.isTrue(rootDialogStub.called);
            assert.isTrue(dialogOnDefaultStub.called);
            assert.isTrue(dialogMatchStub.called);
            done();
        });

        test('initializeForConsole registers all dialogs', (done: () => void) => {
            sut.initializeForConsole();
            assert.equal(rootDialogStub.callCount, 2);
            done();
        });

    });

    suite('initializeForWeb Tests -', () => {
        setup(() => {
            connectorStub = sandbox.stub(builder, 'ChatConnector');
            connectorStub.returns(connector);
        });

        test('initializeForWeb calls required bot framework methods', (done: () => void) => {
            sut.initializeForWeb();
            assert.isTrue(botStub.called);
            assert.isTrue(connectorStub.called);
            assert.isTrue(recognizerStub.called);
            assert.isTrue(dialogStub.called);
            assert.isTrue(rootDialogStub.called);
            assert.isTrue(dialogOnDefaultStub.called);
            assert.isTrue(dialogMatchStub.called);
            done();
        });

        test('initializeForWeb registers all dialogs', (done: () => void) => {
            sut.initializeForWeb();
            assert.equal(rootDialogStub.callCount, 2);
            done();
        });
    });
});


text:
package io.norberg.automatter.jackson;

import com.fasterxml.jackson.annotation.JsonProperty;

import io.norberg.automatter.AutoMatter;

public final class WithInner {
  @AutoMatter
  interface Bar {
    int a();
    String b();
    boolean aCamelCaseField();

    @JsonProperty("foobar")
    boolean isReallyFoobar();
  }

  @AutoMatter
  public interface PublicBar {
    int a();
    String b();
    boolean aCamelCaseField();

    @JsonProperty("foobar")
    boolean isReallyFoobar();
  }
}


text:
from gym.spaces import Space
from typing import Dict, List, Optional, Union, TYPE_CHECKING

from ray.rllib.env.base_env import BaseEnv
from ray.rllib.models.action_dist import ActionDistribution
from ray.rllib.models.modelv2 import ModelV2
from ray.rllib.policy.sample_batch import SampleBatch
from ray.rllib.utils.annotations import DeveloperAPI
from ray.rllib.utils.deprecation import Deprecated
from ray.rllib.utils.framework import try_import_torch, TensorType
from ray.rllib.utils.typing import LocalOptimizer, AlgorithmConfigDict

if TYPE_CHECKING:
    from ray.rllib.policy.policy import Policy
    from ray.rllib.utils import try_import_tf

    _, tf, _ = try_import_tf()

_, nn = try_import_torch()

@DeveloperAPI
class Exploration:
    """Implements an exploration strategy for Policies.

    An Exploration takes model outputs, a distribution, and a timestep from
    the agent and computes an action to apply to the environment using an
    implemented exploration schema.
    """

    def __init__(
        self,
        action_space: Space,
        *,
        framework: str,
        policy_config: AlgorithmConfigDict,
        model: ModelV2,
        num_workers: int,
        worker_index: int
    ):
        """
        Args:
            action_space: The action space in which to explore.
            framework: One of "tf" or "torch".
            policy_config: The Policy's config dict.
            model: The Policy's model.
            num_workers: The overall number of workers used.
            worker_index: The index of the worker using this class.
        """
        self.action_space = action_space
        self.policy_config = policy_config
        self.model = model
        self.num_workers = num_workers
        self.worker_index = worker_index
        self.framework = framework
        # The device on which the Model has been placed.
        # This Exploration will be on the same device.
        self.device = None
        if isinstance(self.model, nn.Module):
            params = list(self.model.parameters())
            if params:
                self.device = params[0].device

    @DeveloperAPI
    def before_compute_actions(
        self,
        *,
        timestep: Optional[Union[TensorType, int]] = None,
        explore: Optional[Union[TensorType, bool]] = None,
        tf_sess: Optional["tf.Session"] = None,
        **kwargs
    ):
        """Hook for preparations before policy.compute_actions() is called.

        Args:
            timestep: An optional timestep tensor.
            explore: An optional explore boolean flag.
            tf_sess: The tf-session object to use.
            **kwargs: Forward compatibility kwargs.
        """
        pass

    # fmt: off
    # __sphinx_doc_begin_get_exploration_action__

    @DeveloperAPI
    def get_exploration_action(self,
                               *,
                               action_distribution: ActionDistribution,
                               timestep: Union[TensorType, int],
                               explore: bool = True):
        """Returns a (possibly) exploratory action and its log-likelihood.

        Given the Model's logits outputs and action distribution, returns an
        exploratory action.

        Args:
            action_distribution: The instantiated
                ActionDistribution object to work with when creating
                exploration actions.
            timestep: The current sampling time step. It can be a tensor
                for TF graph mode, otherwise an integer.
            explore: True: "Normal" exploration behavior.
                False: Suppress all exploratory behavior and return
                a deterministic action.

        Returns:
            A tuple consisting of 1) the chosen exploration action or a
            tf-op to fetch the exploration action from the graph and
            2) the log-likelihood of the exploration action.
        """
        pass

    # __sphinx_doc_end_get_exploration_action__
    # fmt: on

    @DeveloperAPI
    def on_episode_start(
        self,
        policy: "Policy",
        *,
        environment: BaseEnv = None,
        episode: int = None,
        tf_sess: Optional["tf.Session"] = None
    ):
        """Handles necessary exploration logic at the beginning of an episode.

        Args:
            policy: The Policy object that holds this Exploration.
            environment: The environment object we are acting in.
            episode: The number of the episode that is starting.
            tf_sess: In case of tf, the session object.
        """
        pass

    @DeveloperAPI
    def on_episode_end(
        self,
        policy: "Policy",
        *,
        environment: BaseEnv = None,
        episode: int = None,
        tf_sess: Optional["tf.Session"] = None
    ):
        """Handles necessary exploration logic at the end of an episode.

        Args:
            policy: The Policy object that holds this Exploration.
            environment: The environment object we are acting in.
            episode: The number of the episode that is starting.
            tf_sess: In case of tf, the session object.
        """
        pass

    @DeveloperAPI
    def postprocess_trajectory(
        self,
        policy: "Policy",
        sample_batch: SampleBatch,
        tf_sess: Optional["tf.Session"] = None,
    ):
        """Handles post-processing of done episode trajectories.

        Changes the given batch in place. This callback is invoked by the
        sampler after policy.postprocess_trajectory() is called.

        Args:
            policy: The owning policy object.
            sample_batch: The SampleBatch object to post-process.
            tf_sess: An optional tf.Session object.
        """
        return sample_batch

    @DeveloperAPI
    def get_exploration_optimizer(
        self, optimizers: List[LocalOptimizer]
    ) -> List[LocalOptimizer]:
        """May add optimizer(s) to the Policy's own `optimizers`.

        The number of optimizers (Policy's plus Exploration's optimizers) must
        match the number of loss terms produced by the Policy's loss function
        and the Exploration component's loss terms.

        Args:
            optimizers: The list of the Policy's local optimizers.

        Returns:
            The updated list of local optimizers to use on the different
            loss terms.
        """
        return optimizers

    @DeveloperAPI
    def get_state(self, sess: Optional["tf.Session"] = None) -> Dict[str, TensorType]:
        """Returns the current exploration state.

        Args:
            sess: An optional tf Session object to use.

        Returns:
            The Exploration object's current state.
        """
        return {}

    @DeveloperAPI
    def set_state(self, state: object, sess: Optional["tf.Session"] = None) -> None:
        """Sets the Exploration object's state to the given values.

        Note that some exploration components are stateless, even though they
        decay some values over time (e.g. EpsilonGreedy). However the decay is
        only dependent on the current global timestep of the policy and we
        therefore don't need to keep track of it.

        Args:
            state: The state to set this Exploration to.
            sess: An optional tf Session object to use.
        """
        pass

    @Deprecated(new="get_state", error=True)
    def get_info(self, sess: Optional["tf.Session"] = None):
        pass


text:
package epicminesweeper.gui;

import epicminesweeper.logic.Node;

import javax.imageio.ImageIO;
import javax.swing.*;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.IOException;

/**
 * Created by alt on 2.4.2017.
 */
public class JNode extends JLabel {

    private Node node;

    public JNode(Node n) {
        this("");
        node = n;
        updateNode();
    }

    public JNode(String s) {
        super(s, SwingConstants.CENTER);
//        setMaximumSize(new Dimension(20, 20));

    }

    public Node getNode() {
        return node;
    }

    public void updateNode() {
        if (!node.isRevealed()) {
            setBackground(Color.LIGHT_GRAY);
            setIcon(null);

        }

        if (node.isRevealed()) {
            setBackground(Color.WHITE);
            if (node.getGameEnder()) {
                setImage("boom");
            } else if (node.isBomb()) {
                setImage("bomb");
//            } else if (node.getAdjBombs() == 0) {
//                setText("");
            } else {
                setBackground(Color.WHITE);
//                setImage(node.getAdjBombs() + "");
                setText(node.toString());
            }
        } else if (node.getFlagged()) {
            setImage("flag");
        }
    }

    public void setImage(String name) {
        BufferedImage img = null;
        try {
            img = ImageIO.read(getClass().getResource("/" + name + ".png"));
        } catch (IOException e) {
            e.printStackTrace();
        }
        Image dimg = img.getScaledInstance(20, 20,
                Image.SCALE_SMOOTH);
        setIcon(new ImageIcon(dimg));

    }
}


text:
navigator.getWebcam = ( navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia);

navigator.getWebcam(
       //constraints
       {video:true,audio:false},

       //successCallback
       gotWebcam,

       //errorCallback
       gotError
);

function gotError(err) {
     console.log("Oops! Something's not right." + err)
};

function gotWebcam(stream){

	localVideo.src = window.URL.createObjectURL(stream);
	localVideo.play();

	var video_track = stream.getVideoTracks()[0];
	var output = document.getElementById('output');
	output.innerHTML = "stream id = " + stream.id + "
";
	output.innerHTML += "track readyState = " + video_track.readyState + "
";
	output.innerHTML += "track id = " + video_track.id + "
";
	output.innerHTML += "kind = " + video_track.kind + "
";
};


text:
class Switch
{
public:
  Switch(int pwmPin);

  void setup();

  void setState(int state);

  void toggle();

  int state();

  void setNeutralDegree(int degree);

  void setSwitchOffDegree(int degree);

  void setSwitchOnDegree(int degree);

  void setNeutralPosition();

private:
  boolean switchNeeded(int newState);

private:
  Servo servo_;
  int pwmPin_;
  int state_;
  int neutralDegree_;
  int offDegree_;
  int onDegree_;
};

#endif


text:
// Copyright 2020 The Oppia Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS-IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/**
 * @fileoverview Controller for edit profile picture modal.
 */

import Cropper from 'cropperjs';

require('cropperjs/dist/cropper.min.css');

require(
  'components/common-layout-directives/common-elements/' +
  'confirm-or-cancel-modal.controller.ts');

angular.module('oppia').controller('EditProfilePictureModalController', [
  '$controller', '$scope', '$timeout', '$uibModalInstance',
  'ALLOWED_IMAGE_FORMATS', function(
      $controller, $scope, $timeout, $uibModalInstance,
      ALLOWED_IMAGE_FORMATS) {
    $controller('ConfirmOrCancelModalController', {
      $scope: $scope,
      $uibModalInstance: $uibModalInstance
    });

    $scope.uploadedImage = null;
    $scope.croppedImageDataUrl = '';
    $scope.invalidImageWarningIsShown = false;
    $scope.allowedImageFormats = ALLOWED_IMAGE_FORMATS;
    let cropper = null;

    $scope.initialiseCropper = function() {
      let profilePicture = (
        <HTMLImageElement>document.getElementById(
          'croppable-image'));
      cropper = new Cropper(profilePicture, {
        minContainerWidth: 500,
        minContainerHeight: 350,
        aspectRatio: 1
      });
    };

    $scope.onFileChanged = function(file) {
      $('.oppia-profile-image-uploader').fadeOut(function() {
        $scope.invalidImageWarningIsShown = false;

        var reader = new FileReader();
        reader.onload = function(e) {
          $scope.$apply(function() {
            $scope.uploadedImage = (<FileReader>e.target).result;
          });
          $scope.initialiseCropper();
        };
        reader.readAsDataURL(file);

        $timeout(function() {
          $('.oppia-profile-image-uploader').fadeIn();
        }, 100);
      });
    };

    $scope.reset = function() {
      $scope.uploadedImage = null;
      $scope.croppedImageDataUrl = '';
    };

    $scope.onInvalidImageLoaded = function() {
      $scope.reset();
      $scope.invalidImageWarningIsShown = true;
    };

    $scope.confirm = function() {
      $scope.croppedImageDataUrl = (
        cropper.getCroppedCanvas({
          height: 150,
          width: 150
        }).toDataURL());
      $uibModalInstance.close($scope.croppedImageDataUrl);
    };
  }
]);


text:
layout: doc
title: Documentation
---

The node you are looking for is at Changing the name of the coq project file.


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<configuration>
  <!-- Put your site-specific accumulo configurations here. The available configuration values along with their defaults are documented in docs/config.html Unless
    you are simply testing at your workstation, you will most definitely need to change the three entries below. -->

  <property>
    <name>instance.zookeeper.host</name>
    <value>localhost:2181</value>
    <description>comma separated list of zookeeper servers</description>
  </property>

  <property>
    <name>logger.dir.walog</name>
    <value>walogs</value>
    <description>The property only needs to be set if upgrading from 1.4 which used to store write-ahead logs on the local
      filesystem. In 1.5 write-ahead logs are stored in DFS.  When 1.5 is started for the first time it will copy any 1.4
      write ahead logs into DFS.  It is possible to specify a comma-separated list of directories.
    </description>
  </property>

  <property>
    <name>instance.secret</name>
    <value>DEFAULT</value>
    <description>A secret unique to a given instance that all servers
      must know in order to communicate with one another.
      Change it before initialization. To
      change it later use ./bin/accumulo org.apache.accumulo.server.util.ChangeSecret --old [oldpasswd] --new [newpasswd],
      and then update this file.
    </description>
  </property>

  <property>
    <name>tserver.memory.maps.max</name>
    <value>80M</value>
  </property>

  <property>
    <name>tserver.memory.maps.native.enabled</name>
    <value>false</value>
  </property>

  <property>
    <name>tserver.cache.data.size</name>
    <value>7M</value>
  </property>

  <property>
    <name>tserver.cache.index.size</name>
    <value>20M</value>
  </property>

  <property>
    <name>trace.token.property.password</name>
    <!-- change this to the root user's password, and/or change the user below -->
    <value>secret</value>
  </property>

  <property>
    <name>trace.user</name>
    <value>root</value>
  </property>

  <property>
    <name>tserver.sort.buffer.size</name>
    <value>50M</value>
  </property>

  <property>
    <name>tserver.walog.max.size</name>
    <value>100M</value>
  </property>

  <property>
    <name>general.classpaths</name>
    <!--
       Add the following for Hadoop2, actual needs depend on Hadoop installation details.
       This list may be excessive, but this should cause no issues. Append these values
       after the $HADOOP_PREFIX entries

       $HADOOP_PREFIX/share/hadoop/common/.*.jar,
       $HADOOP_PREFIX/share/hadoop/common/lib/.*.jar,
       $HADOOP_PREFIX/share/hadoop/hdfs/.*.jar,
       $HADOOP_PREFIX/share/hadoop/mapreduce/.*.jar,
       $HADOOP_PREFIX/share/hadoop/yarn/.*.jar,
       $HADOOP_PREFIX/share/hadoop/yarn/lib/jersey.*.jar,
       /usr/lib/hadoop/.*.jar,
       /usr/lib/hadoop/lib/.*.jar,
       /usr/lib/hadoop-hdfs/.*.jar,
       /usr/lib/hadoop-mapreduce/.*.jar,
       /usr/lib/hadoop-yarn/.*.jar,
       /usr/lib/hadoop-yarn/lib/jersey.*.jar,
    -->
    <value>
      $ACCUMULO_HOME/server/target/classes/,
      $ACCUMULO_HOME/lib/accumulo-server.jar,
      $ACCUMULO_HOME/core/target/classes/,
      $ACCUMULO_HOME/lib/accumulo-core.jar,
      $ACCUMULO_HOME/start/target/classes/,
      $ACCUMULO_HOME/lib/accumulo-start.jar,
      $ACCUMULO_HOME/fate/target/classes/,
      $ACCUMULO_HOME/lib/accumulo-fate.jar,
      $ACCUMULO_HOME/proxy/target/classes/,
      $ACCUMULO_HOME/lib/accumulo-proxy.jar,
      $ACCUMULO_HOME/lib/[^.].*.jar,
      $ZOOKEEPER_HOME/zookeeper[^.].*.jar,
      $HADOOP_CONF_DIR,
      $HADOOP_PREFIX/[^.].*.jar,
      $HADOOP_PREFIX/lib/[^.].*.jar,
    </value>
    <description>Classpaths that accumulo checks for updates and class files.
      When using the Security Manager, please remove the ".../target/classes/" values.
    </description>
  </property>
</configuration>


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width initial-scale=1">

  <title>Tags</title>
  <meta name="description" content="A simple blog for my current programming projects.  Python, Django, Java, Javascript
">

  <link rel="stylesheet" href="/css/main.css">
  <link rel="canonical" href="http://blog.7blink.com/tags/">
  <link rel="alternate" type="application/atom+xml" title="7 Blink" href="http://blog.7blink.com/feed.xml" />

					home

					archive

					programming languages

					Feedback

					tags

 Efficient

Tags

arduino

bash

c

command line

games

html

intro

javascript

jekyll

linux

maker

python

shell

tags

update

Jun 14» Arduino Game

Nov 02» Linux Desktop Icon

Sep 22» Linux Shutdown Command

Jun 14» Arduino Game

Nov 02» Linux Desktop Icon

Sep 22» Linux Shutdown Command

Sep 22» Platform Game

Jun 10» Gitlab

Nov 11» Jekyll Feedback

Oct 15» Jekyll - Tags without plugins

Sep 22» Platform Game

Sep 21» Hello World

Jun 18» Firefox and Chrome Extensions

Jun 10» Gitlab

Oct 15» Jekyll - Tags without plugins

Sep 22» Platform Game

Nov 11» Jekyll Feedback

Oct 15» Jekyll - Tags without plugins

Nov 02» Linux Desktop Icon

Sep 22» Linux Shutdown Command

Feb 11» 3d Printing

Jan 10» Self Describing Number

Dec 09» Project Euler

Sep 21» Hello World

Nov 02» Linux Desktop Icon

Sep 22» Linux Shutdown Command

Oct 15» Jekyll - Tags without plugins

Nov 02» Linux Desktop Icon

Sep 22» Linux Shutdown Command


text:
App.info({
  id:"com.id1jzmape5r04f41wca0l9",
  name: 'bringMe',
  description: 'Earn money when you do grocery shopping; do grocery shopping without driving',
  author: 'ZOESH',
  email: 'info@zoesh.com',
  website: '52.89.149.88',
  version: '0.01'
});

App.icons({
  // iOS
  'iphone': 'resources/icons/icon-60.png', //57
  'iphone_2x': 'resources/icons/icon-60@2x.png',
  'iphone_3x': 'resources/icons/icon-60@3x.png',
});

App.launchScreens({
  // iOS
  'iphone': 'resources/splash/Default~iphone.png',
  'iphone_2x': 'resources/splash/Default@2x~iphone.png',
  'iphone6': 'resources/splash/Default-736h.png',
  'iphone6p_landscape': 'resources/splash/Default-Landscape-736h.png',
  'iphone5': 'resources/splash/Default-667h.png',
});

App.setPreference('StatusBarOverlaysWebView', 'true');
App.setPreference('StatusBarStyle', 'default');
App.setPreference('StatusBarBackgroundColor', '#000000');
App.setPreference('fullscreen','true');
App.setPreference('android-windowSoftInputMode','adjustresize');
App.setPreference('android-layout_alignParentBottom','true');
App.setPreference('KeyboardDisplayRequiresUserAction','false');
App.accessRule('*');


text:
/**
 * @param {number} rows
 * @param {Array} columns Array of column objects
 *    Column Object: {string} id, {string} name, {number} size
 * @param {boolean | null} headers Show a header row?
 */
thetr.Table = function(args) {
  this.columns = args.columns;
  this.rowCount = 0;
  this.enableHeader = args.headers || false;

  this.rootNode = null;
  this.headerRowElement = null;
  this.rows = [];

  this.setRowCount({count: args.rows});
};

thetr.Table.prototype.getRootNode = function() {
  if (!this.rootNode) {
    this.rootNode = document.createElement('div');
    this.rootNode.style.overflow = 'hidden';
    this.rootNode.style.width = '100%';
    if (this.enableHeader) {
      this.rootNode.appendChild(this.getHeaderRow());
    }
    //this.buildRows();
    //this.setRowCount({count: this.rowCount});
  }

  return this.rootNode;
};

/**
 * Set the number of rows this table contains
 * @param {number} count The number of rows
 */
thetr.Table.prototype.setRowCount = function(args) {
  var newCount = args.count;

  // See if this is how many rows we're already displaying.
  if (this.rowCount == newCount) {
    return;
  }
  var rootNode = this.getRootNode();
  if (this.rowCount > newCount) {
    for (var iter = this.rowCount - 1, row; (row = this.rows[iter]) && iter > (newCount - 1); iter--) {
      try {
        rootNode.removeChild(row.rootNode);
      } catch(e) {
        // Uh yeah. Guess we're okay.
      }
      this.rows.splice(iter, 1);
    }
    //this.rows.splice(newCount, this.rowCount - newCount);
  } else {
    for (var iter = this.rowCount; iter < newCount; iter++) {
      var row = this.getRow({row: iter});
      rootNode.appendChild(row.rootNode);
    }
  }

  this.rowCount = newCount;
};

thetr.Table.prototype.getRowCount = function() {
  return this.rowCount;
};

/**
 * Fetch a row object for a specific row #. If it doesn't exist it'll be created.
 * @param {number} row The row number to fetch.
 */
thetr.Table.prototype.getRow = function(args) {
  // See if we have a row, or make one
  if (!this.rows[args.row]) {
    var root = document.createElement('div');
    root.style.clear = 'left';
    var row = {rootNode: root};

    for (var iter = 0, col; col = this.columns[iter]; iter++) {
      var colElem = document.createElement('div');
      colElem.style.width = col.size + 'px';
      colElem.style.cssFloat = 'left';
      colElem.style.styleFloat = 'left';
      colElem.style.overflow = 'hidden';
      colElem.innerHTML = ' ';
      root.appendChild(colElem);
      row[col.id] = colElem;
    }
    this.rows[args.row] = row;
  }

  return this.rows[args.row];
};

thetr.Table.prototype.getHeaderRow = function() {
  if (!this.headerRowElement) {
    var root = document.createElement('div');
    root.style.clear = 'left';
    for (var iter = 0, col; col = this.columns[iter]; iter++) {
      var colElem = document.createElement('div');
      colElem.style.width = col.size + 'px';
      colElem.innerHTML = col.name;
      colElem.style.cssFloat = 'left';
      colElem.style.styleFloat = 'left';
      colElem.style.overflow = 'hidden';
      root.appendChild(colElem);
    }
    this.headerRowElement = root;
  }

  return this.headerRowElement;
};

/**
 * @param {number} row Row index
 * @param {string} column Column id
 * @param {id | null} value Value to put in cell
 * @param {element | null} element Element to append inside cell
 */
thetr.Table.prototype.setCellContent = function(args) {
  if (args.value) {
    this.rows[args.row][args.column].innerHTML = args.value;
  } else if (args.element) {
    var col = this.rows[args.row][args.column];
    if (col.firstChild) {
      col.removeChild(col.firstChild);
    }
    col.appendChild(args.element);
  }
};


text:
<?php

use PHPUnit\Framework\TestCase;
use SQL\Writer;

/**
 * @internal
 * @coversNothing
 */
class TableDiffTest extends TestCase
{
    public static function featuresDiff()
    {
        $args   = [];
        $diff   = new SQL\TableDiff();
        $parser = new SQLParser();
        Writer::setInstance('mysql');
        foreach (glob(__DIR__ . '/features/alter-table/*.sql') as $file) {
            $content = file_get_contents($file);
            if ($parts = preg_split('/--\\s*(END|NEW|EXPECTED)/', $content)) {
                $old    = $parts[0];
                $new    = $parts[1];
                $sqls   = $parser->parse($parts[2]);
                $args[] = [$diff, $old, $new, array_filter($sqls)];
            }
        }

        return $args;
    }

    /**
     *  @dataProvider featuresDiff
     *
     * @param mixed $tableDiff
     * @param mixed $prev
     * @param mixed $current
     */
    public function testTableDiff($tableDiff, $prev, $current, array $expected)
    {
        $changes = $tableDiff->diff((string) $prev, (string) $current);
        $this->assertEquals(count($changes), count($expected));
        foreach ($changes as $id => $change) {
            $this->assertEquals($change, $expected[$id]);
        }
    }

    public function testTableDiffException()
    {
        $this->expectException(InvalidArgumentException::class);
        $diff = new SQL\TableDiff();
        $diff->diff('SELECT 1', 'SELECT 2');
    }
}


text:
@interface PSTCKCard ()

@property (nonatomic, readwrite) NSString *cardId;
@property (nonatomic, readwrite) NSString *last4;
@property (nonatomic, readwrite) NSString *dynamicLast4;
@property (nonatomic, readwrite) PSTCKCardBrand brand;
@property (nonatomic, readwrite) PSTCKCardFundingType funding;
@property (nonatomic, readwrite) NSString *fingerprint;
@property (nonatomic, readwrite) NSString *country;
@property (nonatomic, readwrite, nonnull, copy) NSDictionary *allResponseFields;

@end

@implementation PSTCKCard

@dynamic number, cvc, expMonth, expYear, currency, name, addressLine1, addressLine2, addressCity, addressState, addressZip, addressCountry;

- (instancetype)init {
    self = [super init];
    if (self) {
        _brand = PSTCKCardBrandUnknown;
        _funding = PSTCKCardFundingTypeOther;
    }

    return self;
}

- (NSString *)last4 {
    return _last4 ?: [super last4];
}

- (NSString *)type {
    switch (self.brand) {
    case PSTCKCardBrandAmex:
        return @"American Express";
    case PSTCKCardBrandDinersClub:
        return @"Diners Club";
    case PSTCKCardBrandDiscover:
        return @"Discover";
    case PSTCKCardBrandJCB:
        return @"JCB";
    case PSTCKCardBrandMasterCard:
        return @"MasterCard";
    case PSTCKCardBrandVerve:
        return @"Verve";
    case PSTCKCardBrandVisa:
        return @"Visa";
    case PSTCKCardBrandUnknown:
        return @"Unknown";
    }
}

- (BOOL)isEqual:(id)other {
    return [self isEqualToCard:other];
}

- (NSUInteger)hash {
    return [self.cardId hash];
}

- (BOOL)isEqualToCard:(PSTCKCard *)other {
    if (self == other) {
        return YES;
    }

    if (!other || ![other isKindOfClass:self.class]) {
        return NO;
    }

    return [self.cardId isEqualToString:other.cardId];
}

#pragma mark PSTCKAPIResponseDecodable
+ (NSArray *)requiredFields {
    return @[@"id", @"last4", @"brand", @"exp_month", @"exp_year"];
}

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated"
+ (instancetype)decodedObjectFromAPIResponse:(NSDictionary *)response {
    NSDictionary *dict = [response pstck_dictionaryByRemovingNullsValidatingRequiredFields:[self requiredFields]];
    if (!dict) {
        return nil;
    }

    PSTCKCard *card = [self new];
    card.cardId = dict[@"id"];
    card.name = dict[@"name"];
    card.last4 = dict[@"last4"];
    card.dynamicLast4 = dict[@"dynamic_last4"];
    NSString *brand = dict[@"brand"];
    if ([brand isEqualToString:@"Visa"]) {
        card.brand = PSTCKCardBrandVisa;
    } else if ([brand isEqualToString:@"American Express"]) {
        card.brand = PSTCKCardBrandAmex;
    } else if ([brand isEqualToString:@"MasterCard"]) {
        card.brand = PSTCKCardBrandMasterCard;
    } else if ([brand isEqualToString:@"Discover"]) {
        card.brand = PSTCKCardBrandDiscover;
    } else if ([brand isEqualToString:@"JCB"]) {
        card.brand = PSTCKCardBrandJCB;
    } else if ([brand isEqualToString:@"Diners Club"]) {
        card.brand = PSTCKCardBrandDinersClub;
    } else {
        card.brand = PSTCKCardBrandUnknown;
    }
    NSString *funding = dict[@"funding"];
    if ([funding.lowercaseString isEqualToString:@"credit"]) {
        card.funding = PSTCKCardFundingTypeCredit;
    } else if ([funding.lowercaseString isEqualToString:@"debit"]) {
        card.funding = PSTCKCardFundingTypeDebit;
    } else if ([funding.lowercaseString isEqualToString:@"prepaid"]) {
        card.funding = PSTCKCardFundingTypePrepaid;
    } else {
        card.funding = PSTCKCardFundingTypeOther;
    }
    card.fingerprint = dict[@"fingerprint"];
    card.country = dict[@"country"];
    card.currency = dict[@"currency"];
    card.expMonth = [dict[@"exp_month"] intValue];
    card.expYear = [dict[@"exp_year"] intValue];
    card.addressLine1 = dict[@"address_line1"];
    card.addressLine2 = dict[@"address_line2"];
    card.addressCity = dict[@"address_city"];
    card.addressState = dict[@"address_state"];
    card.addressZip = dict[@"address_zip"];
    card.addressCountry = dict[@"address_country"];

    card.allResponseFields = dict;
    return card;
}
#pragma clang diagnostic pop

@end


text:
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using NuGet.Common;

namespace Sleet
{
    public abstract class FileSystemBase : ISleetFileSystem
    {
        /// <summary>
        /// URI written to files.
        /// </summary>
        public Uri BaseURI { get; private set; }

        /// <summary>
        /// Actual URI
        /// </summary>
        public Uri Root { get; private set; }

        public LocalCache LocalCache { get; private set; }

        public ConcurrentDictionary<Uri, ISleetFile> Files { get; private set; } = new ConcurrentDictionary<Uri, ISleetFile>();

        public string FeedSubPath { get; protected set; }

        private readonly string[] _roots;

        protected FileSystemBase(LocalCache cache, Uri root)
            : this(cache, root, root)
        {
        }

        protected FileSystemBase(LocalCache cache, Uri root, Uri baseUri, string feedSubPath = null)
        {
            BaseURI = baseUri ?? throw new ArgumentNullException(nameof(baseUri));
            LocalCache = cache ?? throw new ArgumentNullException(nameof(cache));
            Root = root ?? throw new ArgumentNullException(nameof(root));
            FeedSubPath = feedSubPath;

            BaseURI = UriUtility.EnsureTrailingSlash(BaseURI);
            Root = UriUtility.EnsureTrailingSlash(Root);

            // Ensure the longest root is first to avoid conflicts in StartsWith
            _roots = (new[] { BaseURI.AbsoluteUri, Root.AbsoluteUri })
                .Distinct(StringComparer.Ordinal)
                .OrderByDescending(e => e.Length)
                .ThenBy(e => e, StringComparer.Ordinal)
                .ToArray();
        }

        public abstract ISleetFileSystemLock CreateLock(ILogger log);

        public abstract ISleetFile Get(Uri path);

        public abstract Task<IReadOnlyList<ISleetFile>> GetFiles(ILogger log, CancellationToken token);

        public abstract Task<bool> Validate(ILogger log, CancellationToken token);

        public async Task<bool> Commit(ILogger log, CancellationToken token)
        {
            var perfTracker = LocalCache.PerfTracker;

            // Find all files with changes
            var withChanges = Files.Values.Where(e => e.HasChanges).ToList();

            // Order files so that nupkgs are pushed first to help clients avoid
            // missing files during the push.
            withChanges.Sort(new SleetFileComparer());

            if (withChanges.Count > 0)
            {
                var bytes = withChanges.Select(e => e as FileBase)
                    .Where(e => e != null)
                    .Sum(e => e.LocalFileSizeIfExists);

                // Create tasks to run in parallel
                var tasks = withChanges.Select(e => GetCommitFileFunc(e, log, token));

                var message = $"Files committed: {withChanges.Count} Size: {PrintUtility.GetBytesString(bytes)} Total upload time: " + "{0}";
                using (var timer = PerfEntryWrapper.CreateSummaryTimer(message, perfTracker))
                {
                    // Push in parallel
                    await TaskUtils.RunAsync(
                        tasks: tasks,
                        useTaskRun: true,
                        maxThreads: 8,
                        token: token);
                }
            }

            return true;
        }

        private static Func<Task> GetCommitFileFunc(ISleetFile file, ILogger log, CancellationToken token)
        {
            return new Func<Task>(() => file.Push(log, token));
        }

        public virtual async Task<bool> Destroy(ILogger log, CancellationToken token)
        {
            var success = true;

            var files = await GetFiles(log, token);

            foreach (var file in Files.Values)
            {
                try
                {
                    log.LogInformation($"Deleting {file.EntityUri.AbsoluteUri}");
                    file.Delete(log, token);
                }
                catch
                {
                    log.LogError($"Unable to delete {file.EntityUri.AbsoluteUri}");
                    success = false;
                }
            }

            return success;
        }

        public ISleetFile Get(string relativePath)
        {
            return Get(GetPath(relativePath));
        }

        public Uri GetPath(string relativePath)
        {
            if (relativePath == null)
            {
                throw new ArgumentNullException(nameof(relativePath));
            }

            return UriUtility.GetPath(BaseURI, relativePath);
        }

        public virtual string GetRelativePath(Uri uri)
        {
            if (uri == null)
            {
                throw new ArgumentNullException(nameof(uri));
            }

            var path = uri.AbsoluteUri;

            // The root can be either the display root (BaseURI) or the actual root.
            foreach (var prefix in _roots)
            {
                // This must have a trailing slash already.
                if (path.StartsWith(prefix, StringComparison.Ordinal))
                {
                    return path.Replace(prefix, string.Empty);
                }
            }

            throw new InvalidOperationException($"Unable to make '{uri.AbsoluteUri}' relative to '{BaseURI}'.");
        }

        /// <summary>
        /// Create a file and add it to Files
        /// </summary>
        protected ISleetFile GetOrAddFile(Uri path, bool caseSensitive, Func<SleetUriPair, ISleetFile> createFile)
        {
            if (path == null)
            {
                throw new ArgumentNullException(nameof(path));
            }

            var file = Files.GetOrAdd(path, (uri) =>
            {
                return createFile(GetUriPair(path, caseSensitive));
            });

            return file;
        }

        /// <summary>
        /// Inspect a URI and determine the correct root and display URIs
        /// </summary>
        protected SleetUriPair GetUriPair(Uri path, bool caseSensitive)
        {
            if (path == null)
            {
                throw new ArgumentNullException(nameof(path));
            }

            var isRoot = UriUtility.HasRoot(Root, path, caseSensitive);
            var isDisplay = UriUtility.HasRoot(BaseURI, path, caseSensitive);

            if (!isRoot && !isDisplay)
            {
                throw new InvalidOperationException($"URI does not match the feed root or baseURI: {path.AbsoluteUri}");
            }

            var pair = new SleetUriPair()
            {
                BaseURI = path,
                Root = path
            };

            if (!isRoot)
            {
                pair.Root = UriUtility.ChangeRoot(BaseURI, Root, path);
            }

            if (!isDisplay)
            {
                pair.BaseURI = UriUtility.ChangeRoot(Root, BaseURI, path);
            }

            return pair;
        }

        /// <summary>
        /// Clear all tracked files
        /// </summary>
        public void Reset()
        {
            // Mark all files as invalid so that any external users will fail when trying to use them.
            foreach (var file in Files.Values)
            {
                file.Invalidate();
            }

            // Clear all tracked filed
            Files.Clear();
        }

        public abstract Task<bool> HasBucket(ILogger log, CancellationToken token);

        public abstract Task CreateBucket(ILogger log, CancellationToken token);

        public abstract Task DeleteBucket(ILogger log, CancellationToken token);
    }
}


text:
package scala
package io

import java.text.MessageFormat

/** private[scala] because this is not functionality we should be providing
 *  in the standard library, at least not in this idiosyncratic form.
 *  Factored into trait because it is better code structure regardless.
 */
private[scala] trait StdIn {
  import scala.Console._

  /** Read a full line from the default input.  Returns `null` if the end of the
   * input stream has been reached.
   *
   * @return the string read from the terminal or null if the end of stream was reached.
   */
  def readLine(): String = in.readLine()

  /** Print and flush formatted text to the default output, and read a full line from the default input.
   *  Returns `null` if the end of the input stream has been reached.
   *
   *  @param text the format of the text to print out, as in `printf`.
   *  @param args the parameters used to instantiate the format, as in `printf`.
   *  @return the string read from the default input
   */
  def readLine(text: String, args: Any*): String = {
    printf(text, args: _*)
    out.flush()
    readLine()
  }

  /** Reads a boolean value from an entire line of the default input.
   *  Has a fairly liberal interpretation of the input.
   *
   *  @return the boolean value read, or false if it couldn't be converted to a boolean
   *  @throws java.io.EOFException if the end of the input stream has been reached.
   */
  def readBoolean(): Boolean = {
    val s = readLine()
    if (s == null)
      throw new java.io.EOFException("Console has reached end of input")
    else
      s.toLowerCase() match {
        case "true" => true
        case "t" => true
        case "yes" => true
        case "y" => true
        case _ => false
      }
  }

  /** Reads a byte value from an entire line of the default input.
   *
   *  @return the Byte that was read
   *  @throws java.io.EOFException if the end of the
   *  input stream has been reached.
   *  @throws java.lang.NumberFormatException if the value couldn't be converted to a Byte
   */
  def readByte(): Byte = {
    val s = readLine()
    if (s == null)
      throw new java.io.EOFException("Console has reached end of input")
    else
      s.toByte
  }

  /** Reads a short value from an entire line of the default input.
   *
   *  @return the short that was read
   *  @throws java.io.EOFException if the end of the
   *  input stream has been reached.
   *  @throws java.lang.NumberFormatException if the value couldn't be converted to a Short
   */
  def readShort(): Short = {
    val s = readLine()
    if (s == null)
      throw new java.io.EOFException("Console has reached end of input")
    else
      s.toShort
  }

  /** Reads a char value from an entire line of the default input.
   *
   *  @return the Char that was read
   *  @throws java.io.EOFException if the end of the
   *  input stream has been reached.
   *  @throws java.lang.StringIndexOutOfBoundsException if the line read from default input was empty
   */
  def readChar(): Char = {
    val s = readLine()
    if (s == null)
      throw new java.io.EOFException("Console has reached end of input")
    else
      s charAt 0
  }

  /** Reads an int value from an entire line of the default input.
   *
   *  @return the Int that was read
   *  @throws java.io.EOFException if the end of the
   *  input stream has been reached.
   *  @throws java.lang.NumberFormatException if the value couldn't be converted to an Int
   */
  def readInt(): Int = {
    val s = readLine()
    if (s == null)
      throw new java.io.EOFException("Console has reached end of input")
    else
      s.toInt
  }

  /** Reads an long value from an entire line of the default input.
   *
   *  @return the Long that was read
   *  @throws java.io.EOFException if the end of the
   *  input stream has been reached.
   *  @throws java.lang.NumberFormatException if the value couldn't be converted to a Long
   */
  def readLong(): Long = {
    val s = readLine()
    if (s == null)
      throw new java.io.EOFException("Console has reached end of input")
    else
      s.toLong
  }

  /** Reads a float value from an entire line of the default input.
   *  @return the Float that was read.
   *  @throws java.io.EOFException if the end of the
   *  input stream has been reached.
   *  @throws java.lang.NumberFormatException if the value couldn't be converted to a Float
   *
   */
  def readFloat(): Float = {
    val s = readLine()
    if (s == null)
      throw new java.io.EOFException("Console has reached end of input")
    else
      s.toFloat
  }

  /** Reads a double value from an entire line of the default input.
   *
   *  @return the Double that was read.
   *  @throws java.io.EOFException if the end of the
   *  input stream has been reached.
   *  @throws java.lang.NumberFormatException if the value couldn't be converted to a Float
   */
  def readDouble(): Double = {
    val s = readLine()
    if (s == null)
      throw new java.io.EOFException("Console has reached end of input")
    else
      s.toDouble
  }

  /** Reads in some structured input (from the default input), specified by
   *  a format specifier. See class `java.text.MessageFormat` for details of
   *  the format specification.
   *
   *  @param format the format of the input.
   *  @return a list of all extracted values.
   *  @throws java.io.EOFException if the end of the input stream has been
   *          reached.
   */
  def readf(format: String): List[Any] = {
    val s = readLine()
    if (s == null)
      throw new java.io.EOFException("Console has reached end of input")
    else
      textComponents(new MessageFormat(format).parse(s))
  }

  /** Reads in some structured input (from the default input), specified by
   *  a format specifier, returning only the first value extracted, according
   *  to the format specification.
   *
   *  @param format format string, as accepted by `readf`.
   *  @return The first value that was extracted from the input
   */
  def readf1(format: String): Any = readf(format).head

  /** Reads in some structured input (from the default input), specified
   *  by a format specifier, returning only the first two values extracted,
   *  according to the format specification.
   *
   *  @param format format string, as accepted by `readf`.
   *  @return A [[scala.Tuple2]] containing the first two values extracted
   */
  def readf2(format: String): (Any, Any) = {
    val res = readf(format)
    (res.head, res.tail.head)
  }

  /** Reads in some structured input (from the default input), specified
   *  by a format specifier, returning only the first three values extracted,
   *  according to the format specification.
   *
   *  @param format format string, as accepted by `readf`.
   *  @return A [[scala.Tuple3]] containing the first three values extracted
   */
  def readf3(format: String): (Any, Any, Any) = {
    val res = readf(format)
    (res.head, res.tail.head, res.tail.tail.head)
  }

  private def textComponents(a: Array[AnyRef]): List[Any] = {
    var i: Int = a.length - 1
    var res: List[Any] = Nil
    while (i >= 0) {
      res = (a(i) match {
        case x: java.lang.Boolean   => x.booleanValue()
        case x: java.lang.Byte      => x.byteValue()
        case x: java.lang.Short     => x.shortValue()
        case x: java.lang.Character => x.charValue()
        case x: java.lang.Integer   => x.intValue()
        case x: java.lang.Long      => x.longValue()
        case x: java.lang.Float     => x.floatValue()
        case x: java.lang.Double    => x.doubleValue()
        case x => x
      }) :: res
      i -= 1
    }
    res
  }
}

object StdIn extends StdIn


text:
package com.wabbit.dataholders;

public class StatusDataHolder {
	public int Result;
}


text:
#include "TargetBoard.h"

#include "CommonDataType.h"
#include "CommonDefine.h"

#include "CameraMount_System.h"
#include "CameraMount_Version.h"
#include "CameraMount_Register.h"
#include "CameraMount_EEPROM.h"

/**
 * @name    システム管理
 */
/** @{ */
uint8_t System_state;                   /**< 現在のシステムステート */
uint8_t System_status;                  /**< システムステータス */
uint8_t System_error;                   /**< システムエラー */
bool System_initialization_request;     /**< システム初期化要求 */
/** @} */

/**
 * @brief   INITステートのシステムタスクを実行する
 */
static void System_execTask_INITIALIZATION(void);

/**
 * @brief   RUNステートのシステムタスクを実行する
 */
static void System_execTask_RUN(void);

/**
 * @brief   HALTステートのシステムタスクを実行する
 */
static void System_execTask_HALT(void);

#inline
uint8_t System_getState(void)
{
    return System_state;
}

#inline
uint8_t System_getStatus(void)
{
    return System_status;
}

void System_setStatus(uint8_t system_status_flag)
{
    System_status |= system_status_flag;

    return;
}

#inline
uint8_t System_getError(void)
{
    return System_error;
}

void System_setError(uint8_t system_error_flag)
{
    System_error |= system_error_flag;

    return;
}

void System_setInitializationRequest(void)
{
    System_initialization_request = TRUE;

    return;
}

void System_clearInitializationRequest(void)
{
    System_initialization_request = FALSE;

    return;
}

void System_init(void)
{
    System_state = SYSTEM_INITIALIZATION;

    System_status = 0x00;
    switch (restart_cause()) {
        case WDT_TIMEOUT:
            System_status |= SYSTEM_STATUS_WDT_TIMEOUT;
            break;
        case NORMAL_POWER_UP:
        default:
            break;
    }

    System_error = 0x00;

    System_initialization_request = TRUE;

    return;
}

void System_execTask(void)
{
    switch (System_state) {
        case SYSTEM_INITIALIZATION:
            System_execTask_INITIALIZATION();
            break;
        case SYSTEM_RUN:
            System_execTask_RUN();
            break;
        case SYSTEM_HALT:
            System_execTask_HALT();
            break;
        default:
            break;
    }

    return;
}

static void System_execTask_INITIALIZATION(void)
{
    if (System_initialization_request == TRUE) {
        System_state = SYSTEM_INITIALIZATION;
    }
    else if (System_error != 0) {
        System_state = SYSTEM_HALT;
    }
    else {
        System_state = SYSTEM_RUN;
    }

    return;
}

static void System_execTask_RUN(void)
{
    if (System_initialization_request == TRUE) {
        System_state = SYSTEM_INITIALIZATION;
    }
    else if (System_error != 0) {
        System_state = SYSTEM_HALT;
    }
    else {
        System_state = SYSTEM_RUN;
    }

    return;
}

static void System_execTask_HALT(void)
{
    if (System_initialization_request == TRUE) {
        System_state = SYSTEM_INITIALIZATION;
    }
    else {
        System_state = SYSTEM_HALT;
    }

    return;
}


text:
.odometer.odometer-auto-theme, .odometer.odometer-theme-plaza {
  display: inline-block;
  vertical-align: middle;
  *vertical-align: auto;
  *zoom: 1;
  *display: inline;
  position: relative;
}
.odometer.odometer-auto-theme .odometer-digit, .odometer.odometer-theme-plaza .odometer-digit {
  display: inline-block;
  vertical-align: middle;
  *vertical-align: auto;
  *zoom: 1;
  *display: inline;
  position: relative;
}
.odometer.odometer-auto-theme .odometer-digit .odometer-digit-spacer, .odometer.odometer-theme-plaza .odometer-digit .odometer-digit-spacer {
  display: inline-block;
  vertical-align: middle;
  *vertical-align: auto;
  *zoom: 1;
  *display: inline;
  visibility: hidden;
}
.odometer.odometer-auto-theme .odometer-digit .odometer-digit-inner, .odometer.odometer-theme-plaza .odometer-digit .odometer-digit-inner {
  text-align: left;
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
}
.odometer.odometer-auto-theme .odometer-digit .odometer-ribbon, .odometer.odometer-theme-plaza .odometer-digit .odometer-ribbon {
  display: block;
}
.odometer.odometer-auto-theme .odometer-digit .odometer-ribbon-inner, .odometer.odometer-theme-plaza .odometer-digit .odometer-ribbon-inner {
  display: block;
  -webkit-backface-visibility: hidden;
}
.odometer.odometer-auto-theme .odometer-digit .odometer-value, .odometer.odometer-theme-plaza .odometer-digit .odometer-value {
  display: block;
  -webkit-transform: translateZ(0);
}
.odometer.odometer-auto-theme .odometer-digit .odometer-value.odometer-last-value, .odometer.odometer-theme-plaza .odometer-digit .odometer-value.odometer-last-value {
  position: absolute;
}
.odometer.odometer-auto-theme.odometer-animating-up .odometer-ribbon-inner, .odometer.odometer-theme-plaza.odometer-animating-up .odometer-ribbon-inner {
  -webkit-transition: -webkit-transform 2s;
  -moz-transition: -moz-transform 2s;
  -ms-transition: -ms-transform 2s;
  -o-transition: -o-transform 2s;
  transition: transform 2s;
}
.odometer.odometer-auto-theme.odometer-animating-up.odometer-animating .odometer-ribbon-inner, .odometer.odometer-theme-plaza.odometer-animating-up.odometer-animating .odometer-ribbon-inner {
  -webkit-transform: translateY(-100%);
  -moz-transform: translateY(-100%);
  -ms-transform: translateY(-100%);
  -o-transform: translateY(-100%);
  transform: translateY(-100%);
}
.odometer.odometer-auto-theme.odometer-animating-down .odometer-ribbon-inner, .odometer.odometer-theme-plaza.odometer-animating-down .odometer-ribbon-inner {
  -webkit-transform: translateY(-100%);
  -moz-transform: translateY(-100%);
  -ms-transform: translateY(-100%);
  -o-transform: translateY(-100%);
  transform: translateY(-100%);
}
.odometer.odometer-auto-theme.odometer-animating-down.odometer-animating .odometer-ribbon-inner, .odometer.odometer-theme-plaza.odometer-animating-down.odometer-animating .odometer-ribbon-inner {
  -webkit-transition: -webkit-transform 2s;
  -moz-transition: -moz-transform 2s;
  -ms-transition: -ms-transform 2s;
  -o-transition: -o-transform 2s;
  transition: transform 2s;
  -webkit-transform: translateY(0);
  -moz-transform: translateY(0);
  -ms-transform: translateY(0);
  -o-transform: translateY(0);
  transform: translateY(0);
}

.odometer.odometer-auto-theme, .odometer.odometer-theme-plaza {
  -moz-border-radius: 0.15em;
  -webkit-border-radius: 0.15em;
  border-radius: 0.15em;
  background-color: #f0f8ff;
  font-family: "Helvetica Neue", sans-serif;
  font-weight: 100;
  padding: 0 0.12em;
  line-height: 1.2em;
  font-size: 1.2em;
  background-size: 16px 16px;
}
.odometer.odometer-auto-theme .odometer-digit, .odometer.odometer-theme-plaza .odometer-digit {
  -moz-border-radius: 0.1em;
  -webkit-border-radius: 0.1em;
  border-radius: 0.1em;
  padding: 0 0.03em;
  color: #648baf;
}
.odometer.odometer-auto-theme .odometer-digit .odometer-digit-inner, .odometer.odometer-theme-plaza .odometer-digit .odometer-digit-inner {
  left: 0.03em;
}


text:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reactive;
using System.Reactive.Concurrency;
using System.Reactive.Linq;
using System.Reactive.Threading.Tasks;
using System.Reactive.Windows.Foundation;
using System.Text;
using System.Runtime.InteropServices.WindowsRuntime;
using System.Threading.Tasks;
using ReactiveUI;
using Windows.Foundation;
using Windows.Storage;

namespace Akavache
{
    public class SimpleFilesystemProvider : IFilesystemProvider, IEnableLogger
    {
        readonly IDictionary<FileMode, Func<StorageFolder, string, IAsyncOperation<StorageFile>>> openFileStrategies
            = new Dictionary<FileMode, Func<StorageFolder, string, IAsyncOperation<StorageFile>>>
        {
            { FileMode.Create, (f,name) => f.CreateFileAsync(name) },
            { FileMode.CreateNew, (f,name) => f.CreateFileAsync(name, CreationCollisionOption.ReplaceExisting) },
            { FileMode.Open, (f,name) => f.GetFileAsync(name) },
            { FileMode.OpenOrCreate, (f,name) => f.CreateFileAsync(name, CreationCollisionOption.OpenIfExists) },
            { FileMode.Truncate, (f,name) => null }, // ???
            { FileMode.Append, (f,name) => null } // ???
        };

        public IObservable<Stream> SafeOpenFileAsync(string path, FileMode mode, FileAccess access, FileShare share, IScheduler scheduler)
        {
            var folder = Path.GetDirectoryName(path);
            var name = Path.GetFileName(path);

            return StorageFolder.GetFolderFromPathAsync(folder).ToObservable()
                .SelectMany(x => openFileStrategies[mode](x, name).ToObservable())
                .SelectMany(x => access == FileAccess.Read ?
                    x.OpenStreamForReadAsync().ToObservable() :
                    x.OpenStreamForWriteAsync().ToObservable());
        }

        public IObservable<Unit> CreateRecursive(string path)
        {
            var paths = path.Split('\\');

            var firstFolderThatExists = Observable.Range(0, paths.Length - 1)
                .Select(x =>
                    StorageFolder.GetFolderFromPathAsync(String.Join("\\", paths.Take(paths.Length - x)))
                    .ToObservable()
                    .LoggedCatch(this, Observable.Empty<StorageFolder>()))
                .Concat()
                .Take(1);

            return firstFolderThatExists
                .Select(x =>
                {
                    if (x.Path == path) return null;
                    return new { Root = x, Paths = path.Replace(x.Path + "\\", "").Split('\\')};
                })
                .SelectMany(x =>
                {
                    if (x == null) return Observable.Return(default(StorageFolder));
                    return x.Paths.ToObservable().Aggregate(x.Root, (acc, y) => acc.CreateFolderAsync(y).ToObservable().First());
                })
                .Select(_ => Unit.Default);
        }

        public IObservable<Unit> Delete(string path)
        {
            return StorageFile.GetFileFromPathAsync(path).ToObservable()
                .SelectMany(x => x.DeleteAsync().ToObservable());
        }

        public string GetDefaultRoamingCacheDirectory()
        {
            return Path.Combine(Windows.Storage.ApplicationData.Current.RoamingFolder.Path, "BlobCache");
        }

        public string GetDefaultLocalMachineCacheDirectory()
        {
            return Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, "BlobCache");
        }

	public string GetDefaultSecretCacheDirectory()
        {
            return Path.Combine(Windows.Storage.ApplicationData.Current.RoamingFolder.Path, "SecretCache");
        }
    }
}


text:
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Wexflow.NetCore.Tests
{
    [TestClass]
    public class Slack
    {
        [TestInitialize]
        public void TestInitialize()
        {
        }

        [TestCleanup]
        public void TestCleanup()
        {
        }

        [TestMethod]
        public void SlackTest()
        {
            Helper.StartWorkflow(137);
            // TODO
        }
    }
}


text:
{
  "title": "@EmilyRiederer @plotlygraphs is great because easy to use with ggplot, and gives really engaging interactive plots. Some in my recent xaringan slides here: https://t.co/Uq3mup0I8c",
  "date": "2018-04-09"
}

# blogdown

> **Mara Averick** (@dataandme; 5/3): Lots o' playing w/ "submodules" this am, thx to @richlitt's tut.!
"Getting Hugo running on Netlify" https://t.co/EWCeNFMYts
👍 for blogdown × sourcetree × netlify https://t.co/AAYbwUTpbP  [↪](https://twitter.com/xieyihui/status/983003581828788224)

<!-- -->

> **niszet*** (@niszet0; 1/0): blogdown最初の一歩を踏み出した。new_site()だとうまくいかなくて、R Studio IDEのNew Projectの時点でblogdown指定したらうまくいった。  [↪](https://twitter.com/xieyihui/status/982887696157700102)

<!-- -->

> **niszet*** (@niszet0; 0/0): blogdown、公開場所どうしようかな…。結局githubで良いのでは。
であればhttps://t.co/dMDPHU73qrとかでよいのでは。。。あれ?  [↪](https://twitter.com/xieyihui/status/982990594422132736)

<!-- -->

# bookdown

> **Steven Ge** (@StevenXGe; 4/1): https://t.co/Eg4SzxgBUZ  [↪](https://twitter.com/xieyihui/status/982827616754372608)

<!-- -->

> **epb41l2** (@epb41l2; 2/1): Finding out how to create #MSword output from #rstats bookdown seems to be strangely difficult, so I'm putting this here for reference:
https://t.co/BzvlSFJ3AK  [↪](https://twitter.com/xieyihui/status/982922503042617344)

<!-- -->

> **niszet*** (@niszet0; 0/0): bookdown形式にまとめるのもやりたいのだが…まぁこういうのはやろうと思ってやるというよりはある日気絶すると出来ている気がするので気絶するの待ちだな…。  [↪](https://twitter.com/xieyihui/status/982888440629833728)

<!-- -->

# xaringan

> **Ben Marwick** (@benmarwick; 6/0): @EmilyRiederer @plotlygraphs is great because easy to use with ggplot, and gives really engaging interactive plots. Some in my recent xaringan slides here: https://t.co/Uq3mup0I8c  [↪](https://twitter.com/xieyihui/status/982805736437661696)

<!-- -->

> **Jennifer Thompson** (@jent103; 3/0): @apreshill @canva @EmilyRiederer Very good to know! Thanks to the tips - I might be making my way to the xaringan side soon :) Doing a series of workshops in Japan this summer. Minimalist aesthetic vs detailed Keynote templates seems appropriate!  [↪](https://twitter.com/xieyihui/status/982800949692588032)

<!-- -->

> **Alison Hill** (@apreshill; 1/0): @jent103 @canva @EmilyRiederer It helps also to pick a consistent font- I usually use Google ones b/c I can use them in ppt locally, and Canva's free version gives you SOME (but not all), then with xaringan you can import the same fonts.  [↪](https://twitter.com/xieyihui/status/982799591836798977)

<!-- -->