text:
layout: post
date: 2018-02-19
title: "Stella York A-Line Bridal Gown
 Style 5966 Sleeveless Court Train Aline/Princess"
category: Stella York
tags: [Stella York,Aline/Princess ,V-neck,Court Train,Sleeveless]
---
### Stella York A-Line Bridal Gown
 Style 5966
Just **$319.99**
###   Sleeveless Court Train Aline/Princess

BRANDS	Stella York

Silhouette	Aline/Princess

Neckline	V-neck

Hemline/Train	Court Train

Sleeve	Sleeveless

Buy it: [https://www.readybrides.com/en/stella-york/13524-stella-york-a-line-bridal-gown-style-5966.html](https://www.readybrides.com/en/stella-york/13524-stella-york-a-line-bridal-gown-style-5966.html)

redpajama_set_name: RedPajamaGithub


text:
package com.jude.controller;

import com.jude.entity.Customer;
import com.jude.entity.CustomerManager;
import com.jude.entity.ModelSwitch;
import com.jude.entity.RecordDetail;
import com.jude.entity.Task;
import com.jude.entity.VisitRecord;
import com.jude.entity.Workflow;
import com.jude.entity.WorkflowReply;
import com.jude.json.JSONArray;
import com.jude.json.JSONObject;
import com.jude.service.CustomerManagerService;
import com.jude.service.CustomerService;
import com.jude.service.SwitchService;
import com.jude.service.TaskService;
import com.jude.service.VisitRecordService;
import com.jude.service.WorkflowService;
import com.jude.util.MD5;
import com.jude.util.PagingSet;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.math.NumberUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;

@Controller
@RequestMapping({ "/mobile/*" })
public class MobileController {

	@Autowired
	private CustomerManagerService managerService;

	@Autowired
	private CustomerService customerService;

	@Autowired
	private TaskService taskService;

	@Autowired
	private VisitRecordService recordService;

	@Autowired
	private WorkflowService workflowService;

	@Autowired
	private SwitchService switchService;

	private static final SimpleDateFormat DATETIME_FMT = new SimpleDateFormat("yyyy-MM-dd hh:mm");

	@RequestMapping({ "login" })
	public void login(HttpServletRequest request, HttpServletResponse response) {
		JSONObject json = new JSONObject();
		try {
			String username = request.getParameter("username");
			String password = request.getParameter("password");
			if (!this.managerService.usernameExist(username)) {
				json.put("retcode", "000003");
				json.put("retinfo", "用户名或密码错误");
				write(response, json);
				return;
			}

			CustomerManager manager = this.managerService.getCustomerManager(username);
			if (!MD5.encrypt(password).equals(manager.getPassword())) {
				json.put("retcode", "000003");
				json.put("retinfo", "用户名或密码错误");
				write(response, json);
				return;
			}

			json.put("retcode", "000000");
			json.put("retinfo", "success");
			json.put("userId", manager.getId());
		} catch (Exception e) {
			e.printStackTrace();
			json.put("retcode", "000001");
			json.put("retinfo", "exception");
		}
		write(response, json);
	}

	@RequestMapping({ "codeSign" })
	public void codeSign(HttpServletRequest request, HttpServletResponse response) {
		JSONObject json = new JSONObject();
		try {
			if (isSwitchOpen().getQrcode().equals("0")) {
				json.put("retcode", "000003");
				json.put("retinfo", "二维码开关未开!");
				write(response, json);
				return;
			}
			String flag = request.getParameter("flag");
			String userId = request.getParameter("userId");
			String serviceId = request.getParameter("serviceId");
			if ((StringUtils.isBlank(flag)) || (StringUtils.isBlank(userId))
					|| (StringUtils.isBlank(serviceId))) {
				json.put("retcode", "000003");
				json.put("retinfo", "请求参数不正确!");
				write(response, json);
				return;
			}

			long taskId = Long.parseLong(request.getParameter("serviceId"));
			VisitRecord record = this.recordService.getVisitRecordByTaskId(taskId);
			Customer customer = record.getCustomer();
			String code = request.getParameter("code");
			if (code != null) {
				code = code.trim();
			}
			if (code == null
					|| !(code.equals("满意")
							|| (customer.getNumber() != null && code.equals(customer.getNumber())) || (customer
							.getSellNumber() != null && code.equals(customer.getSellNumber())))) {
				json.put("retcode", "000003");
				json.put("retinfo", "二维码不正确!");
				write(response, json);
				return;
			}

			if ("0".equals(flag)) {
				// 签到
				String city = request.getParameter("city");
				String lat = request.getParameter("lat");
				String lng = request.getParameter("lng");
				if (lat == null || lng == null) {
					json.put("retcode", "000003");
					json.put("retinfo", "没有定位信息,请等定位完成再扫码!");
					write(response, json);
					return;
				}
				double latF = Double.parseDouble(lat);
				double lngF = Double.parseDouble(lng);
				String gps = customer.getGps();
				double cLatF = 0;
				double cLngF = 0;
				if (gps != null && !gps.equals("")) {
					cLatF = Double.parseDouble(gps.substring(gps.indexOf(",") + 1));
					cLngF = Double.parseDouble(gps.substring(0, gps.indexOf(",")));
					double lngDist = Math.abs(lngF - cLngF) * 1110000;
					double latDist = Math.abs(latF - cLatF) * 1110000
							* Math.cos(Math.PI * cLatF / 180);
					double gpsDist = (int) Math.sqrt(lngDist * lngDist + latDist * latDist);
					if (gpsDist > 2000) {
						json.put("retcode", "000003");
						json.put("retinfo", "定位不正确!");
						write(response, json);
						return;
					}
				} else {
					// 客户没有GPS信息,添加第一次签到的位置为客户的GPS位置
					if (lng != null && lat != null && lngF != 0 && latF != 0) {
						customer.setGps(lng + "," + lat);
						this.customerService.updateGps(customer.getGps(), customer.getId());
					}
				}
				record.setCity(city);
				if (lng != null && lat != null) {
					record.setGps(lng + "," + lat);
				}
				record.setType(1);
				record.setVisitTime(new Date());
				this.recordService.update(record);
				this.customerService.updateLastVisitTime(new Date(), customer.getId());
			} else if ("1".equals(flag)) {
				// 签退
				Long s = Long.valueOf(new Date().getTime() - record.getVisitTime().getTime());
				record.setCostTime((int) (s.longValue() / 60000L));
				record.setLeaveTime(new Date());
				record.setType(2);
				this.recordService.update(record);
				this.taskService.complete(taskId);
			}
			json.put("retcode", "000000");
			json.put("retinfo", "success");
		} catch (Exception e) {
			e.printStackTrace();
			json.put("retcode", "000001");
			json.put("retinfo", "系统异常");
		}
		write(response, json);
	}

	@RequestMapping({ "queryServiceContent" })
	public void queryServiceContent(HttpServletRequest request, HttpServletResponse response) {
		JSONObject json = new JSONObject();
		JSONArray ja = new JSONArray();
		Long userId = Long.parseLong(request.getParameter("userId"));
		int page = NumberUtils.toInt((String) request.getParameter("page"), 1);
		int limit = NumberUtils.toInt((String) request.getParameter("limit"), -1);
		if (limit == -1) {
			page = 1;
			limit = 1000000;
		}
		int start = page * limit - limit;
		int type = NumberUtils.toInt((String) request.getParameter("type"), 0);
		String keyword = request.getParameter("keyword");
		if (keyword == null) {
			keyword = "";
		}
		String startTime = request.getParameter("startTime");
		String endTime = request.getParameter("endTime");
		try {
			PagingSet<Task> set = this.taskService.getManagerTask(userId, start, limit, type,
					keyword, startTime, endTime);
			List<Task> ts = set.getList();
			if ((ts != null) && (ts.size() > 0)) {
				for (Task t : ts) {
					JSONObject js = new JSONObject();
					js.put("title", t.getContent());
					js.put("createTime", DATETIME_FMT.format(t.getCreate()));
					js.put("name", t.getCustomer().getName());
					js.put("serviceId", t.getId());
					js.put("reject", t.getReject());
					js.put("reason", t.getReply());
					ja.put(js);
				}
			}
			json.put("dataInfo", ja);
			json.put("total", set.getTotal());
			json.put("retcode", "000000");
			json.put("retinfo", "success");
		} catch (Exception e) {
			e.printStackTrace();
			json.put("retcode", "000001");
			json.put("retinfo", "exception");
		}

		write(response, json);
	}

	@RequestMapping({ "queryServiceStatus" })
	public void queryServiceStatus(HttpServletRequest request, HttpServletResponse response) {
		JSONObject json = new JSONObject();
		try {
			long serviceId = Long.parseLong(request.getParameter("serviceId"));
			VisitRecord vr = this.recordService.getVisitRecordByTaskId(serviceId);
			int codeSignFlag = 1;
			int codeExitFlag = 1;
			int contentFlag = 1;
			int praiseFlag = 1;
			int takePhotoFlag = 1;
			// if (vr.getReject() != 1) {
			if (vr.getType() == 0) {
				contentFlag = 0;
				takePhotoFlag = 0;
				praiseFlag = 0;
				codeExitFlag = 0;
			} else if (vr.getType() == 1) {
				codeSignFlag = 0;
				if (vr.getResultCode() == 1) {
					praiseFlag = 0;
				}
			} else if (vr.getType() == 2) {
				codeSignFlag = 0;
				if (vr.getResultCode() == 1) {
					praiseFlag = 0;
				}
				codeExitFlag = 0;
			}
			// }
			json.put("codeSignFlag", codeSignFlag);
			json.put("codeExitFlag", codeExitFlag);
			json.put("contentFlag", contentFlag);
			json.put("takePhotoFlag", takePhotoFlag);
			json.put("praiseFlag", praiseFlag);
			json.put("retcode", "000000");
			json.put("retinfo", "success");
		} catch (Exception e) {
			e.printStackTrace();
			json.put("retcode", "000001");
			json.put("retinfo", "exception");
		}

		write(response, json);
	}

	@RequestMapping({ "queryContent" })
	public void queryContent(HttpServletRequest request, HttpServletResponse response) {
		JSONObject json = new JSONObject();
		JSONArray ja = new JSONArray();
		try {
			List<RecordDetail> ts = this.recordService.getDetails(Long.parseLong(request
					.getParameter("serviceId")));
			if ((ts != null) && (ts.size() > 0)) {
				for (RecordDetail t : ts) {
					JSONObject js = new JSONObject();
					js.put("name", t.getContent());
					js.put("id", t.getId());
					ja.put(js);
				}
			}
			json.put("dataInfo", ja);
			json.put("retcode", "000000");
			json.put("retinfo", "success");
		} catch (Exception e) {
			e.printStackTrace();
			json.put("retcode", "000001");
			json.put("retinfo", "exception");
		}

		write(response, json);
	}

	@RequestMapping({ "submitServiceContent" })
	public void submitServiceContent(HttpServletRequest request, HttpServletResponse response) {
		JSONObject json = new JSONObject();
		try {
			String ids = request.getParameter("ids");
			long serviceId = Long.parseLong(request.getParameter("serviceId"));

			this.recordService.submit(ids, serviceId);

			json.put("retcode", "000000");
			json.put("retinfo", "success");
		} catch (Exception e) {
			e.printStackTrace();
			json.put("retcode", "000001");
			json.put("retinfo", "exception");
		}

		write(response, json);
	}

	@RequestMapping({ "submitServiceResult" })
	public void submitServiceResult(HttpServletRequest request, HttpServletResponse response) {
		JSONObject json = new JSONObject();
		try {
			MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
			List mfs = multipartRequest.getFiles("file");
			long taskId = Long.parseLong(request.getParameter("serviceId"));
			VisitRecord record = this.recordService.getVisitRecordByTaskId(taskId);
			String path = request.getServletContext().getRealPath("/recordImages") + File.separator
					+ record.getId() + "_";
			for (int i = 0; i < mfs.size(); ++i) {
				File f = new File(path + i + ".jpg");
				IOUtils.copy(((MultipartFile) mfs.get(i)).getInputStream(), new FileOutputStream(f));
			}
			json.put("retcode", "000000");
			json.put("retinfo", "success");
		} catch (Exception e) {
			e.printStackTrace();
			json.put("retcode", "000001");
			json.put("retinfo", "exception");
		}

		write(response, json);
	}

	@RequestMapping({ "praise" })
	public void praise(HttpServletRequest request, HttpServletResponse response) {
		JSONObject json = new JSONObject();
		try {
			String code = request.getParameter("code");
			long taskId = Long.parseLong(request.getParameter("serviceId"));
			VisitRecord record = this.recordService.getVisitRecordByTaskId(taskId);
			Customer customer = record.getCustomer();
			if (code != null) {
				code = code.trim();
			}
			if (code == null
					|| !(code.equals("满意")
							|| (customer.getNumber() != null && code.equals(customer.getNumber())) || (customer
							.getSellNumber() != null && code.equals(customer.getSellNumber())))) {
				json.put("retcode", "000003");
				json.put("retinfo", "二维码不正确!");
				write(response, json);
				return;
			}
			record.setResultCode(1);
			this.recordService.update(record);
			json.put("retcode", "000000");
			json.put("retinfo", "success");
		} catch (Exception e) {
			e.printStackTrace();
			json.put("retcode", "000001");
			json.put("retinfo", "系统异常");
		}

		write(response, json);
	}

	@RequestMapping({ "getVisitInfo" })
	public void getVisitInfo(HttpServletRequest request, HttpServletResponse response) {
		JSONObject json = new JSONObject();
		Long userId = Long.parseLong(request.getParameter("userId"));
		int page = NumberUtils.toInt((String) request.getParameter("page"), 1);
		int limit = NumberUtils.toInt((String) request.getParameter("limit"), -1);
		if (limit == -1) {
			page = 1;
			limit = 1000000;
		}
		int start = page * limit - limit;
		int type = NumberUtils.toInt((String) request.getParameter("type"), 2);
		String keyword = request.getParameter("keyword");
		if (keyword == null) {
			keyword = "";
		}
		String startTime = request.getParameter("startTime");
		String endTime = request.getParameter("endTime");
		StringBuffer where = new StringBuffer();
		if (type != 2) {
			where.append(" and t.complete = ").append(type);
		}
		if (userId != 1) {
			where.append(" and m.id = ").append(userId);
		}
		if (keyword.length() > 0) {
			where.append(" and (c.name like '%").append(keyword).append("%'");
			where.append(" or c.sell_number like '%").append(keyword).append("%'");
			where.append(" or c.phone_number like '%").append(keyword).append("%'");
			where.append(" or c.backup_number like '%").append(keyword).append("%')");
		}
		try {
			PagingSet pset = this.recordService.queryVisitRecords(start, limit, where.toString(),
					"visit_time", "DESC");
			List<VisitRecord> list = pset.getList();
			JSONArray ja = new JSONArray();
			if ((list != null) && (list.size() > 0)) {
				for (VisitRecord record : list) {
					JSONObject js = new JSONObject();
					js.put("username", record.getCustomerManager().getUsername());
					if (record.getVisitTime() != null) {
						js.put("arriveTime", DATETIME_FMT.format(record.getVisitTime()));
					}
					if (record.getLeaveTime() != null) {
						js.put("leaveTime", DATETIME_FMT.format(record.getLeaveTime()));
					}
					js.put("city", record.getCity());
					js.put("praise", record.getResultCode());
					JSONArray jar = new JSONArray();

					String path = request.getServletContext().getRealPath("/recordImages")
							+ File.separator;
					for (int i = 0; i < 6; ++i) {
						String url = path + record.getId() + "_" + i + ".jpg";
						File f = new File(url);
						if (f.exists()) {
							JSONObject job = new JSONObject();
							job.put("imageUrl",
									request.getRequestURL().substring(0,
											request.getRequestURL().length() - 23)
											+ "/record.do?action=getImage&path="
											+ record.getId()
											+ "_" + i + ".jpg");
							jar.put(job);
						}
					}
					js.put("imageList", jar);
					ja.put(js);
				}
			}
			json.put("dataInfo", ja);
			json.put("total", pset.getTotal());
			json.put("retcode", "000000");
			json.put("retinfo", "success");
		} catch (Exception e) {
			e.printStackTrace();
			json.put("retcode", "000001");
			json.put("retinfo", "exception");
		}
		write(response, json);
	}

	@RequestMapping({ "newWorkflowSubmit" })
	public void newWorkflowSubmit(HttpServletRequest request, HttpServletResponse response) {
		JSONObject json = new JSONObject();
		try {
			String userId = request.getParameter("userId");
			String customerId = request.getParameter("customerId");
			String address = request.getParameter("address");
			String receiveTimeStr = request.getParameter("receiveTime");
			String handlerId = request.getParameter("handlerId");
			String description = request.getParameter("description");
			String remark = request.getParameter("remark");
			if (StringUtils.isBlank(userId) || StringUtils.isBlank(customerId)
					|| StringUtils.isBlank(address) || StringUtils.isBlank(receiveTimeStr)
					|| StringUtils.isBlank(handlerId) || StringUtils.isBlank(description)) {
				json.put("retcode", "000003");
				json.put("retinfo", "参数不正确");
				write(response, json);
				return;
			}
			Customer customer = customerService.getCustomersByIds(customerId).get(0);
			Date receiveTime = null;
			try {
				receiveTime = DATETIME_FMT.parse(receiveTimeStr);
			} catch (ParseException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			CustomerManager problemFinder = managerService.getCustomerManager(Long
					.parseLong(userId));
			CustomerManager handler = managerService.getCustomerManager(Long.parseLong(handlerId));
			Date handleTime = new Date();
			Workflow workflow = new Workflow();
			workflow.setCustomer(customer);
			workflow.setAddress(address);
			workflow.setReceiveTime(receiveTime);
			workflow.setProblemFinder(problemFinder);
			workflow.setHandleTime(handleTime);
			workflow.setHandler(handler);
			workflow.setCurrentHandler(handler);
			workflow.setDescription(description);
			workflow.setRemark(remark);
			workflowService.addWorkflow(workflow);
			json.put("retcode", "000000");
			json.put("retinfo", "success");
		} catch (Exception e) {
			e.printStackTrace();
			json.put("retcode", "000001");
			json.put("retinfo", "exception");
		}
		write(response, json);
	}

	@RequestMapping({ "dealWorkflowSubmit" })
	public void dealWorkflowSubmit(HttpServletRequest request, HttpServletResponse response) {
		JSONObject json = new JSONObject();
		try {
			String userId = request.getParameter("userId");
			String workflowIdStr = request.getParameter("workflowId");
			String orderNumStr = request.getParameter("orderNum");
			String handlerId = request.getParameter("handlerId");
			String reply = request.getParameter("reply");
			String remark = request.getParameter("remark");
			if (StringUtils.isBlank(userId) || StringUtils.isBlank(handlerId)
					|| StringUtils.isBlank(reply) || StringUtils.isBlank(workflowIdStr)) {
				json.put("retcode", "000003");
				json.put("retinfo", "参数不正确");
				write(response, json);
				return;
			}
			CustomerManager handler = managerService.getCustomerManager(Long.parseLong(handlerId));
			Date handleTime = new Date();
			WorkflowReply workflowReply = new WorkflowReply();
			workflowReply.setWorkflowId(Long.parseLong(workflowIdStr));
			workflowReply.setOrderNum(Integer.parseInt(orderNumStr));
			workflowReply.setHandleTime(handleTime);
			workflowReply.setHandler(handler);
			workflowReply.setReply(reply);
			workflowReply.setRemark(remark);
			workflowService.addWorkflowReply(workflowReply);
			json.put("retcode", "000000");
			json.put("retinfo", "success");
		} catch (Exception e) {
			e.printStackTrace();
			json.put("retcode", "000001");
			json.put("retinfo", "exception");
		}
	}

	@RequestMapping({ "dealWorkflow" })
	public void dealWorkflow(HttpServletRequest request, HttpServletResponse response) {
		JSONObject json = new JSONObject();
		try {
			String userId = request.getParameter("userId");
			String workflowId = request.getParameter("workflowId");
			if (StringUtils.isBlank(userId) || StringUtils.isBlank(workflowId)) {
				json.put("retcode", "000003");
				json.put("retinfo", "参数不正确");
				write(response, json);
				return;
			}
			Workflow workflow = this.workflowService.getWorkflow(Long.parseLong(workflowId));
			List<WorkflowReply> list = this.workflowService.queryWorkflowReplies(0, 100000,
					" and w.workflow_id = " + workflowId, "w.handle_time", "ASC").getList();
			Long currentHandler = workflow.getCurrentHandler().getId();
			if (!String.valueOf(currentHandler).equals(userId)) {
				json.put("retcode", "000003");
				json.put("retinfo", "参数不正确");
				write(response, json);
				return;
			}
			JSONObject js = new JSONObject();
			js.put("customer", workflow.getCustomer().getName());
			js.put("address", workflow.getAddress());
			js.put("sellNumber", workflow.getCustomer().getSellNumber());
			js.put("receive_time", DATETIME_FMT.format(workflow.getReceiveTime()));
			js.put("problem_finder", workflow.getProblemFinder().getName());
			js.put("handle_time", DATETIME_FMT.format(workflow.getHandleTime()));
			js.put("handler_name", workflow.getHandler().getName());
			js.put("description", workflow.getDescription());
			js.put("remark", workflow.getRemark());
			JSONArray ja = new JSONArray();
			int size = list.size();
			if (list != null && size > 0) {
				for (int i = 0; i < size; i++) {
					WorkflowReply reply = list.get(i);
					JSONObject jo = new JSONObject();
					jo.put("reply", reply.getReply());
					jo.put("remark", reply.getRemark());
					jo.put("handle_time", reply.getHandleTime());
					jo.put("current_handler_name", reply.getCurrentHandler().getName());
					ja.put(jo);
				}
				js.put("replies", ja);
			}
			json.put("dataInfo", js);
			json.put("retcode", "000000");
			json.put("retinfo", "success");
		} catch (Exception e) {
			e.printStackTrace();
			json.put("retcode", "000001");
			json.put("retinfo", "exception");
		}
	}

	@RequestMapping({ "viewWorkflow" })
	public void viewWorkflow(HttpServletRequest request, HttpServletResponse response) {
		JSONObject json = new JSONObject();
		try {
			String userId = request.getParameter("userId");
			String workflowId = request.getParameter("workflowId");
			if (StringUtils.isBlank(userId) || StringUtils.isBlank(workflowId)) {
				json.put("retcode", "000003");
				json.put("retinfo", "参数不正确");
				write(response, json);
				return;
			}
			Workflow workflow = this.workflowService.getWorkflow(Long.parseLong(workflowId));
			List<WorkflowReply> list = this.workflowService.queryWorkflowReplies(0, 100000,
					" and w.workflow_id = " + workflowId, "w.handle_time", "ASC").getList();
			JSONObject js = new JSONObject();
			js.put("customer", workflow.getCustomer().getName());
			js.put("address", workflow.getAddress());
			js.put("sellNumber", workflow.getCustomer().getSellNumber());
			js.put("receive_time", DATETIME_FMT.format(workflow.getReceiveTime()));
			js.put("problem_finder", workflow.getProblemFinder().getName());
			js.put("handle_time", DATETIME_FMT.format(workflow.getHandleTime()));
			js.put("handler_name", workflow.getHandler().getName());
			js.put("description", workflow.getDescription());
			js.put("remark", workflow.getRemark());
			JSONArray ja = new JSONArray();
			int size = list.size();
			if (list != null && size > 0) {
				for (int i = 0; i < size; i++) {
					WorkflowReply reply = list.get(i);
					JSONObject jo = new JSONObject();
					jo.put("reply", reply.getReply());
					jo.put("remark", reply.getRemark());
					jo.put("handle_time", reply.getHandleTime());
					jo.put("current_handler_name", reply.getCurrentHandler().getName());
					ja.put(jo);
				}
				js.put("replies", ja);
			}
			json.put("dataInfo", js);
			json.put("retcode", "000000");
			json.put("retinfo", "success");
		} catch (Exception e) {
			e.printStackTrace();
			json.put("retcode", "000001");
			json.put("retinfo", "exception");
		}
	}

	@RequestMapping({ "dealWorkflowList" })
	public void dealWorkflowList(HttpServletRequest request, HttpServletResponse response) {
		JSONObject json = new JSONObject();
		try {
			if (StringUtils.isBlank(request.getParameter("userId"))) {
				json.put("retcode", "000003");
				json.put("retinfo", "参数不正确");
				write(response, json);
				return;
			}
			Long userId = Long.parseLong(request.getParameter("userId"));
			int page = NumberUtils.toInt((String) request.getParameter("page"), 1);
			int limit = NumberUtils.toInt((String) request.getParameter("limit"), -1);
			if (limit == -1) {
				page = 1;
				limit = 1000000;
			}
			int start = page * limit - limit;
			String keyword = request.getParameter("keyword");
			if (keyword == null) {
				keyword = "";
			}
			StringBuffer where = new StringBuffer();
			where.append(" and w.current_handler_id = ").append(userId);
			PagingSet pset = this.workflowService.queryWorkflows(start, limit, where.toString(),
					"w.handle_time", "DESC");
			List<Workflow> list = pset.getList();
			JSONArray ja = new JSONArray();
			if ((list != null) && (list.size() > 0)) {
				for (Workflow workflow : list) {
					JSONObject js = new JSONObject();
					js.put("customer", workflow.getCustomer().getName());
					js.put("problemFinder", workflow.getProblemFinder().getName());
					if (workflow.getReceiveTime() != null) {
						js.put("receiveTime", DATETIME_FMT.format(workflow.getReceiveTime()));
					}
					if (workflow.getHandleTime() != null) {
						js.put("handleTime", DATETIME_FMT.format(workflow.getHandleTime()));
					}
					int len = workflow.getDescription().length();
					if (len > 20) {
						js.put("brief", workflow.getDescription().substring(0, 19) + "…");
					} else {
						js.put("brief", workflow.getDescription());
					}
					ja.put(js);
				}
			}
			json.put("dataInfo", ja);
			json.put("total", pset.getTotal());
			json.put("retcode", "000000");
			json.put("retinfo", "success");
		} catch (Exception e) {
			e.printStackTrace();
			json.put("retcode", "000001");
			json.put("retinfo", "exception");
		}
		write(response, json);
	}

	@RequestMapping({ "viewWorkflowList" })
	public void viewWorkflowList(HttpServletRequest request, HttpServletResponse response) {
		JSONObject json = new JSONObject();
		try {
			String userIdStr = request.getParameter("userId");
			if (StringUtils.isBlank(userIdStr)) {
				json.put("retcode", "000003");
				json.put("retinfo", "参数不正确");
				write(response, json);
				return;
			}
			Long userId = Long.parseLong(userIdStr);
			int page = NumberUtils.toInt((String) request.getParameter("page"), 1);
			int limit = NumberUtils.toInt((String) request.getParameter("limit"), -1);
			if (limit == -1) {
				page = 1;
				limit = 1000000;
			}
			int start = page * limit - limit;
			String keyword = request.getParameter("keyword");
			if (keyword == null) {
				keyword = "";
			}
			StringBuffer where = new StringBuffer();
			where.append(" and ((w.problem_finder_id = ")
					.append(userId)
					.append(" and w.current_handler_id != ")
					.append(userId)
					.append(") or (w.id in (SELECT r.workflow_id from workflow_reply r WHERE r.handler_id = ")
					.append(userId).append(" GROUP BY r.workflow_id)))");
			PagingSet pset = this.workflowService.queryWorkflows(start, limit, where.toString(),
					"w.handle_time", "DESC");
			List<Workflow> list = pset.getList();
			JSONArray ja = new JSONArray();
			if ((list != null) && (list.size() > 0)) {
				for (Workflow workflow : list) {
					JSONObject js = new JSONObject();
					js.put("customer", workflow.getCustomer().getName());
					js.put("problemFinder", workflow.getProblemFinder().getName());
					if (workflow.getReceiveTime() != null) {
						js.put("receiveTime", DATETIME_FMT.format(workflow.getReceiveTime()));
					}
					if (workflow.getHandleTime() != null) {
						js.put("handleTime", DATETIME_FMT.format(workflow.getHandleTime()));
					}
					int len = workflow.getDescription().length();
					if (len > 20) {
						js.put("brief", workflow.getDescription().substring(0, 19) + "…");
					} else {
						js.put("brief", workflow.getDescription());
					}
					ja.put(js);
				}
			}
			json.put("dataInfo", ja);
			json.put("total", pset.getTotal());
			json.put("retcode", "000000");
			json.put("retinfo", "success");
		} catch (Exception e) {
			e.printStackTrace();
			json.put("retcode", "000001");
			json.put("retinfo", "exception");
		}
		write(response, json);
	}

	@RequestMapping({ "getVersionInfo" })
	public void getVersionInfo(HttpServletRequest request, HttpServletResponse response) {
		JSONObject json = new JSONObject();
		File file = new File(request.getServletContext().getRealPath("app_version_info.txt"));
		try {
			BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
			String str;
			while ((str = br.readLine()) != null) {
				String[] arr = str.split("=");
				if (arr[0].equals("androidversioncode")) {
					json.put("androidversioncode", arr[1]);
				} else if (arr[0].equals("androidversionname")) {
					json.put("androidversionname", arr[1]);
				} else if (arr[0].equals("androidlink")) {
					json.put("androidlink", arr[1]);
				}
			}
			br.close();
			json.put("retcode", "000000");
			json.put("retinfo", "success");
		} catch (Exception e) {
			e.printStackTrace();
			json.put("retcode", "000001");
			json.put("retinfo", "exception");
		}
		write(response, json);
	}

	@RequestMapping({ "getApp" })
	public void getApp(HttpServletRequest request, HttpServletResponse response) throws Exception {
		String path = request.getParameter("path");
		File file = new File(path);
		if (!file.exists()) {
			file = new File(request.getServletContext().getRealPath("/app") + File.separator + path);
		}
		InputStream is = new FileInputStream(file);
		IOUtils.copy(is, response.getOutputStream());
	}

	private ModelSwitch isSwitchOpen() {
		ModelSwitch s = this.switchService.query();
		if (s == null) {
			s = new ModelSwitch();
			s.setQrcode("1");
		}
		return s;
	}

	private void write(HttpServletResponse response, JSONObject json) {
		try {
			response.setContentType("text/plain");
			response.setCharacterEncoding("UTF-8");
			PrintWriter out = response.getWriter();
			out.write(json.toString(4));
			out.flush();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}


text:
Build Towers, roguelikelikelike TD

Made by [horaguchi](http://horaguchi.github.io/) for [7DRL Challenge 2017](http://www.roguebasin.com/index.php?title=7DRL_Challenge_2017).

[Play](http://horaguchi.github.io/BuildTowers/)


text:
package org.apache.taverna.servicedescriptions.events;

import org.apache.taverna.servicedescriptions.ServiceDescriptionProvider;

public class AbstractProviderNotification extends AbstractProviderEvent {

	private final String message;

	public AbstractProviderNotification(ServiceDescriptionProvider provider, String message) {
		super(provider);
		this.message = message;
	}

	public String getMessage() {
		return message;
	}

}


text:
.PHONY: detect_os Linux Darwin clean

export GOPATH=$(PWD)
UNAME_S = $(shell uname -s)

ifeq ($(UNAME_S), Linux)
	INC=-I. \
		-I/usr/include/gtk-2.0 \
		-I/usr/include/glib-2.0 \
		-I/usr/include/cairo \
		-I/usr/include/pango-1.0 \
		-I/usr/include/gdk-pixbuf-2.0 \
		-I/usr/include/atk-1.0 \
		-I/usr/lib/x86_64-linux-gnu/glib-2.0/include \
		-I/usr/lib/x86_64-linux-gnu/gtk-2.0/include \
		-I/usr/lib/i386-linux-gnu/gtk-2.0/include \
		-I/usr/lib/i386-linux-gnu/glib-2.0/include \
		-I/usr/lib64/glib-2.0/include \
		-I/usr/lib64/gtk-2.0/include
	export CC=gcc $(INC)
	export CGO_LDFLAGS=-L $(PWD)/Release -lcef
else ifeq ($(UNAME_S), Darwin)
	INC=-I.
	export CGO_ENABLED=1
	export CC=clang $(INC)
	export CGO_LDFLAGS=-F$(PWD)/Release/tmp -framework Cocoa -framework cef
endif

detect_os:
	make $(UNAME_S)

Linux:
	clear
	go install gtk
	go install cef
	go test -ldflags "-r $(PWD)/Release" src/tests/cef_test.go
	go build -ldflags "-r ." -o Release/cef2go src/main_linux.go
	cd Release && ./cef2go && cd ../

Darwin:
	clear

	@# Required for linking. Go doesn't allow framework name
	@# to contain spaces, so we're making a copy of the framework
	@# without spaces.
	@if [ ! -d Release/tmp ]; then \
		echo Copying CEF framework directory to Release/tmp ;\
		mkdir -p Release/tmp ;\
		cp -rf Release/cef2go.app/Contents/Frameworks/Chromium\ Embedded\ Framework.framework Release/tmp/cef.framework ;\
		mv Release/tmp/cef.framework/Chromium\ Embedded\ Framework Release/tmp/cef.framework/cef ;\
	fi
	go install -x cef
	@# CEF requires specific app bundle / directory structure
	@# on OSX, but Go doesn't allow for such thing when
	@# running test. So turning off test.
	@# go test -ldflags "-r $(PWD)/Release" src/tests/cef_test.go
	rm -f Release/cef2go.app/Contents/MacOS/cef2go
	go build -x -ldflags "-r ." -o Release/cef2go.app/Contents/MacOS/cef2go src/main_darwin.go
	install_name_tool -change @executable_path/Chromium\ Embedded\ Framework @executable_path/../Frameworks/Chromium\ Embedded\ Framework.framework/Chromium\ Embedded\ Framework Release/cef2go.app/Contents/MacOS/cef2go
	cp -f Release/example.html Release/cef2go.app/Contents/MacOS/example.html
	cd Release/cef2go.app/Contents/MacOS && ./cef2go && cd ../../../../

clean:
	clear
	go clean -i cef


text:
using System;
using FlatRedBall;
using FlatRedBall.Gui;
using System.Collections.Generic;
using FlatRedBall.Instructions;
using FlatRedBall.Input;
using FlatRedBall.Instructions.ScriptedAnimations;
using FlatRedBall.Utilities;

namespace InstructionEditor.Gui
{
	/// <summary>
	/// Summary description for ListBoxWindow.
	/// </summary>
	public class ListBoxWindow : Window
    {
        #region Fields

        CollapseListBox mInstructionSetListBox;

		Button mAddKeyframeListButton;
        Button mAddKeyframeButton;

        ComboBox mTimelineSelection;

        ListDisplayWindow mAnimationSequenceListBox;

        #endregion

        #region Properties

        public CollapseListBox InstructionSetListBox
        {
            get { return mInstructionSetListBox; }
        }

        //public Button AddKeyframeListButton
        //{
        //    get { return mAddKeyframeListButton; }
        //}

        #endregion

        #region Event Methods

        private void AddKeyframeListClick(Window callingWindow)
        {
            if (EditorData.EditorLogic.CurrentInstructionSet == null)
            {
                GuiManager.ShowMessageBox("Currently the InstructionEditor is under \"Current'\" editing mode." +
                    "  To add an Animation, you must have a selected object first.", "Error");

                return;
            }

            TextInputWindow tiw = GuiManager.ShowTextInputWindow("Enter a name for the new Animation:", "Enter name");
            if (GuiData.TimeLineWindow.InstructionMode == InstructionMode.Current)
            {
                if (EditorData.EditorLogic.CurrentInstructionSet != null)
                {
                    tiw.Text = "Keyframe List " + EditorData.EditorLogic.CurrentInstructionSet.Count;
                }
                else
                {
                    tiw.Text = "Keyframe List " + 0;
                }
            }
            else
            {
                tiw.Text = "Animation " + EditorData.GlobalInstructionSets.Count;
            }

            tiw.OkClick += new GuiMessage(AddKeyframeListOk);
        }

        private void AddKeyframeListOk(Window callingWindow)
        {
            string name = ((TextInputWindow)callingWindow).Text;

            if (GuiData.TimeLineWindow.InstructionMode == InstructionMode.All)
            {
                AnimationSequence newSequence = new AnimationSequence();
                newSequence.Name = name;
                EditorData.GlobalInstructionSets.Add(newSequence);
            }
            else
            {

                KeyframeList keyframeList = new KeyframeList();

                EditorData.EditorLogic.CurrentInstructionSet.Add(keyframeList);
                keyframeList.Name = name;

                //GuiData.ListBoxWindow.InstructionSetListBox.HighlightItem(item);
            }
            GuiData.ListBoxWindow.UpdateLists();

        }

        private void AddKeyframe(Window callingWindow)
        {

            #region See if adding is allowed (Are there objects to record).  If not, show a message

            if (EditorData.CurrentSpriteMembersWatching.Count == 0 &&
                EditorData.CurrentSpriteFrameMembersWatching.Count == 0 &&
                EditorData.CurrentPositionedModelMembersWatching.Count == 0 &&
                EditorData.CurrentTextMembersWatching.Count == 0)
            {
                GuiManager.ShowMessageBox("There are no members being recorded.  Try opening the " +
                    "\"used members\" window through Window->Used Members menu item.", "No members");
                return;
            }

            if (GuiData.TimeLineWindow.InstructionMode == InstructionMode.Current)
            {
                if (EditorData.EditorLogic.CurrentKeyframeList == null)
                {
                    GuiManager.ShowMessageBox("There is no Keyframe List currently selected", "Error");
                    return;
                }

                if (EditorData.EditorLogic.CurrentSprites.Count == 0 &&
                    EditorData.EditorLogic.CurrentSpriteFrames.Count == 0 &&
                    EditorData.EditorLogic.CurrentPositionedModels.Count == 0 &&
                    EditorData.EditorLogic.CurrentTexts.Count == 0)
                {
                    GuiManager.ShowMessageBox("No object is selected.  Select an object to record.", "No selected object.");
                    return;
                }
            }
            else if (GuiData.TimeLineWindow.InstructionMode == InstructionMode.All)
            {
                if (EditorData.EditorLogic.CurrentAnimationSequence == null)
                {
                    GuiManager.ShowMessageBox("There is no Animation currently selected", "Error");
                    return;
                }
            }
            #endregion

            if (GuiData.TimeLineWindow.InstructionMode == InstructionMode.All)
            {

                KeyframeListSelectionWindow klsw = new KeyframeListSelectionWindow(GuiManager.Cursor);
                GuiManager.AddWindow(klsw);
                klsw.PopulateComboBoxes(EditorData.BlockingScene, EditorData.ObjectInstructionSets);

                klsw.OkClick += AddKeyframeToGlobalInstrutionSet;
            }
            else
            {
                TextInputWindow tiw = GuiManager.ShowTextInputWindow("Enter a name for the new keyframe:", "Enter name");
                tiw.Text = "Keyframe " + EditorData.EditorLogic.CurrentKeyframeList.Count;

                tiw.OkClick += new GuiMessage(AddKeyframeOk);
            }

        }

        public static void AddKeyframeOk(Window callingWindow)
        {
            if (EditorData.EditorLogic.CurrentKeyframeList == null)
            {
                GuiManager.ShowMessageBox("There is no Keyframe List currently selected", "Error");
                return;
            }

            if (EditorData.CurrentSpriteMembersWatching.Count == 0 &&
                EditorData.CurrentSpriteFrameMembersWatching.Count == 0 &&
                EditorData.CurrentPositionedModelMembersWatching.Count == 0 &&
                EditorData.CurrentTextMembersWatching.Count == 0)
            {
                GuiManager.ShowMessageBox("There are no members being recorded.  Try opening the " +
                    "\"used members\" window through Window->Used Members menu item.", "No members");
                return;
            }

            InstructionList instructionList = new InstructionList();
            instructionList.Name = ((TextInputWindow)callingWindow).Text;
            double timeToExecute = GuiData.TimeLineWindow.timeLine.CurrentValue;
            EditorData.AddInstructionsToList(instructionList, timeToExecute);

            GuiData.TimeLineWindow.UpdateToCurrentSet();
            EditorData.EditorLogic.CurrentKeyframeList.Add(instructionList);

            GuiData.ListBoxWindow.UpdateLists();
        }

        public static void AddKeyframeToGlobalInstrutionSet(Window callingWindow)
        {
            KeyframeList keyframeList = ((KeyframeListSelectionWindow)callingWindow).SelectedKeyframeList;

            INameable targetNameable = ((KeyframeListSelectionWindow)callingWindow).SelectedNameable;

            TimedKeyframeList timedKeyframeList = new TimedKeyframeList(keyframeList, targetNameable.Name);
            timedKeyframeList.TimeToExecute = GuiData.TimeLineWindow.CurrentValue;

            // Add the selected KeyframeList to the Global InstructionSet
            EditorData.EditorLogic.CurrentAnimationSequence.Add(timedKeyframeList);

        }

        private void AdjustPositionsAndScales(Window callingWindow)
        {
            mInstructionSetListBox.SetPositionTL(ScaleX, ScaleY - 2.3f);
            mInstructionSetListBox.ScaleX = ScaleX - .5f;
            mInstructionSetListBox.ScaleY = ScaleY - 3f ;

            mAnimationSequenceListBox.X = mInstructionSetListBox.X;
            mAnimationSequenceListBox.Y = mInstructionSetListBox.Y;
            mAnimationSequenceListBox.ScaleX = mInstructionSetListBox.ScaleX;
            mAnimationSequenceListBox.ScaleY = mInstructionSetListBox.ScaleY;

            mAddKeyframeListButton.ScaleX = 6.2f;
            mAddKeyframeListButton.ScaleY = 2.2f;
            mAddKeyframeListButton.SetPositionTL(6.8f, 2 * ScaleY - 2.9f);

            mAddKeyframeButton.ScaleX = 6.2f;
            mAddKeyframeButton.ScaleY = 2.2f;
            mAddKeyframeButton.SetPositionTL(19.4f, 2 * ScaleY - 2.9f);

        }

        private void AnimationSequenceFocusUpdate(IInputReceiver inputReceiver)
        {
            Keyboard keyboard = InputManager.Keyboard;

            #region Delete

            if (keyboard.KeyPushed(Microsoft.Xna.Framework.Input.Keys.Delete))
            {
                // Check to see which object is current and delete it

                // If a CurrentTimedKeyframeList is not null, then the CurrentAnimationSequence is also not null.
                // Therefore, always check "bottom up" or else the wrong thing will be deleted.
                if (EditorData.EditorLogic.CurrentTimedKeyframeList != null)
                {
                    EditorData.EditorLogic.CurrentAnimationSequence.Remove(EditorData.EditorLogic.CurrentTimedKeyframeList);
                    UpdateLists();

                }

                else if (EditorData.EditorLogic.CurrentAnimationSequence != null)
                {
                    EditorData.GlobalInstructionSets.Remove(EditorData.EditorLogic.CurrentAnimationSequence);
                    EditorData.EditorLogic.CurrentAnimationSequence = null;
                    UpdateLists();

                }

            }

            #endregion
        }

        private void DoubleClickAnimationSequenceListBox(Window callingWindow)
        {
            object highlightedObject = mAnimationSequenceListBox.GetFirstHighlightedObject();

            if (highlightedObject != null)
            {
                if (highlightedObject is AnimationSequence)
                {
                    // Any logic here?
                }
                else if (highlightedObject is TimedKeyframeList)
                {
                    // Find the object that this references and select it.
                    TimedKeyframeList asTimedKeyframeList = highlightedObject as TimedKeyframeList;

                    INameable target = EditorData.BlockingScene.FindByName(asTimedKeyframeList.TargetName);

                    if (target is Sprite)
                    {
                        EditorData.EditorLogic.SelectObject<Sprite>(target as Sprite, EditorData.EditorLogic.CurrentSprites);
                    }
                    // else other types

                    GuiData.TimeLineWindow.InstructionMode = InstructionMode.Current;

                    EditorData.EditorLogic.CurrentKeyframeList = asTimedKeyframeList.KeyframeList;
                }
            }
        }

        private string GetTimedKeyframeListStringRepresentation(object timedKeyframeList)
        {
            TimedKeyframeList asTimedKeyframeList = timedKeyframeList as TimedKeyframeList;

            return asTimedKeyframeList.TargetName + " : " + asTimedKeyframeList.Name;
        }

        private void HighlightInstructionSetListBox(Window callingWindow)
        {
            CollapseItem item = mInstructionSetListBox.GetFirstHighlightedItem();

            if (item != null)
            {
                // Set the current InstructionSet
                CollapseItem topParentItem = item.TopParent;

                EditorData.EditorLogic.CurrentKeyframeList = topParentItem.ReferenceObject as KeyframeList;

                EditorData.EditorLogic.CurrentKeyframe = mInstructionSetListBox.GetFirstHighlightedItem().ReferenceObject as InstructionList;

                // if the object is an instruction list, execute em
                if (EditorData.EditorLogic.CurrentKeyframe != null && EditorData.EditorLogic.CurrentKeyframe.Count != 0)
                {
                    GuiData.TimeLineWindow.CurrentValue =
                        EditorData.EditorLogic.CurrentKeyframe[0].TimeToExecute;
                    EditorData.EditorLogic.CurrentKeyframe.Execute();
                }

                //GuiData.SpritePropertyGrid.UpdateDisplayedProperties();
            }
            else
            {
                EditorData.EditorLogic.CurrentKeyframeList = null;

                EditorData.EditorLogic.CurrentKeyframe = null;

            }

        }

        private void InstructionListHotkeyUpdate(IInputReceiver receiver)
        {
            #region Delete

            if (InputManager.Keyboard.KeyPushed(Microsoft.Xna.Framework.Input.Keys.Delete))
            {
                object highlightedObject = mInstructionSetListBox.GetFirstHighlightedObject();

                if (highlightedObject is KeyframeList)
                {
                    EditorData.EditorLogic.CurrentInstructionSet.Remove(highlightedObject as KeyframeList);

                    EditorData.EditorLogic.CurrentKeyframe = null;

                    EditorData.EditorLogic.CurrentKeyframeList = null;

                    UpdateLists();
                }
                else if (highlightedObject is InstructionList)
                {
                    EditorData.EditorLogic.CurrentKeyframeList.Remove(highlightedObject as InstructionList);
                    UpdateLists();
                }
            }

            #endregion
        }

        private void HighlightAnimationSequenceListBox(Window callingWindow)
        {
            object highlightedObject = mAnimationSequenceListBox.GetFirstHighlightedObject();

            if (highlightedObject == null)
            {

            }
            else
            {

                if (highlightedObject is AnimationSequence)
                {
                    EditorData.EditorLogic.CurrentAnimationSequence = highlightedObject as AnimationSequence;
                }
                else if (highlightedObject is TimedKeyframeList)
                {
                    CollapseItem highlightedItem = mAnimationSequenceListBox.GetFirstHighlightedItem();

                    CollapseItem parentItem = highlightedItem.TopParent;

                    EditorData.EditorLogic.CurrentAnimationSequence =
                        parentItem.ReferenceObject as AnimationSequence;

                    EditorData.EditorLogic.CurrentTimedKeyframeList = highlightedObject as TimedKeyframeList;
                }
            }
        }

        private void UpdateAddButtonVisibility(Window callingWindow)
        {
            mAddKeyframeButton.Enabled = true;
            mAddKeyframeListButton.Enabled = true;
        }

        #endregion

        #region Methods

        #region Constructor

        public ListBoxWindow() :
            base(GuiManager.Cursor)
        {
            #region Set "this" properties.
            GuiManager.AddWindow(this);
			SetPositionTL(97.3f, 25.2f);
			ScaleX = 13.1f;
			ScaleY = 19.505f;
			mName = "Keyframes";
			mMoveBar = true;

            MinimumScaleX = ScaleX;
            MinimumScaleY = 7;

            this.Resizable = true;

            this.Resizing += AdjustPositionsAndScales;

            #endregion

            #region List Box

            mInstructionSetListBox = AddCollapseListBox();
            mInstructionSetListBox.Highlight += new GuiMessage(UpdateAddButtonVisibility);
            mInstructionSetListBox.Highlight += HighlightInstructionSetListBox;

            mInstructionSetListBox.FocusUpdate += InstructionListHotkeyUpdate;
            #endregion

            #region AnimationSequence ListDisplayWindow

            mAnimationSequenceListBox = new ListDisplayWindow(mCursor);
            this.AddWindow(mAnimationSequenceListBox);
            mAnimationSequenceListBox.ListBox.Highlight += HighlightAnimationSequenceListBox;
            mAnimationSequenceListBox.ListBox.StrongSelect += DoubleClickAnimationSequenceListBox;
            mAnimationSequenceListBox.ListBox.FocusUpdate += new FocusUpdateDelegate(AnimationSequenceFocusUpdate);
            ListDisplayWindow.SetStringRepresentationMethod(typeof(TimedKeyframeList), GetTimedKeyframeListStringRepresentation);

            #endregion

            #region Add Keyframe List Button

            mAddKeyframeListButton = AddButton();
            mAddKeyframeListButton.Text = "Add Animation";
            mAddKeyframeListButton.Click += AddKeyframeListClick; // this will call UpdateVisibleWindows

            #endregion

            #region Add Keyframe Button

            mAddKeyframeButton = AddButton();
            mAddKeyframeButton.Text = "Add Keyframe";
            mAddKeyframeButton.Click += AddKeyframe;

            #endregion

            AdjustPositionsAndScales(null);
        }

        #endregion

        #region Public Methods

        public void HighlightNoCall(InstructionList keyframe)
        {
            UpdateLists();

            mInstructionSetListBox.HighlightObjectNoCall(keyframe, false);
        }

        public void HighlightNoCall(KeyframeList keyframeList)
        {
            UpdateLists();

            mInstructionSetListBox.HighlightObjectNoCall(keyframeList, false);
        }

        public void UpdateLists()
        {

            #region Update List window visibility

            mInstructionSetListBox.Visible = GuiData.TimeLineWindow.InstructionMode == InstructionMode.Current;
            mAnimationSequenceListBox.Visible = GuiData.TimeLineWindow.InstructionMode == InstructionMode.All;

            #endregion

            #region Update the Global InstructionSets ListDisplayWindow

            mAnimationSequenceListBox.ListShowing = EditorData.GlobalInstructionSets;

            #endregion

            #region If there is not a CurrentInstructionSet

            if (EditorData.EditorLogic.CurrentInstructionSet == null)
            {
                mInstructionSetListBox.Clear();
            }

            #endregion

            #region Else, there is
            else
            {
                #region See if there are any KeyframeLists that aren't shown in the list
                for (int i = 0; i < EditorData.EditorLogic.CurrentInstructionSet.Count; i++)
                {
                    if (mInstructionSetListBox.ContainsObject(
                        EditorData.EditorLogic.CurrentInstructionSet[i]) == false)
                    {
                        CollapseItem item = mInstructionSetListBox.AddItem(
                            EditorData.EditorLogic.CurrentInstructionSet[i].Name,
                            EditorData.EditorLogic.CurrentInstructionSet[i]);
                    }
                    else
                    {
                        mInstructionSetListBox.GetItem(EditorData.EditorLogic.CurrentInstructionSet[i]).Text =
                            EditorData.EditorLogic.CurrentInstructionSet[i].Name;
                    }
                }
                #endregion

                #region See if there are any Keyframes that aren't in the ListBox

                foreach (KeyframeList keyframeList in EditorData.EditorLogic.CurrentInstructionSet)
                {
                    CollapseItem itemForKeyframe = mInstructionSetListBox.GetItem(keyframeList);

                    for (int i = 0; i < keyframeList.Count; i++)
                    {
                        InstructionList list = keyframeList[i];

                        string listName = "";

                        if (list.Count != 0)
                        {
                            string numberString = list[0].TimeToExecute.ToString("00.000");
                            listName = numberString + "  " + list.Name;

                        }
                        else
                            listName = list.Name;

                        if (itemForKeyframe.Contains(list) == false)
                        {
                            itemForKeyframe.InsertItem(i,
                                listName, list);
                        }
                        else
                        {
                            itemForKeyframe.GetItem(list).Text = listName;
                        }
                    }
                }

                #endregion

                #region See if there are any KeyframeLists or Keyframes in the ListBox that aren't in the List

                for (int itemNumber = 0; itemNumber < mInstructionSetListBox.Items.Count; itemNumber++)
                {
                    CollapseItem item = mInstructionSetListBox.Items[itemNumber];

                    KeyframeList keyframeList = item.ReferenceObject as KeyframeList;

                    if (EditorData.EditorLogic.CurrentInstructionSet.Contains(keyframeList) == false)
                    {
                        mInstructionSetListBox.RemoveCollapseItem(item);
                    }
                    else
                    {

                        for (int i = item.Count - 1; i > -1; i--)
                        {
                            CollapseItem subItem = item[i];

                            InstructionList keyframe = subItem.ReferenceObject as InstructionList;

                            if (keyframeList.Contains(keyframe) == false)
                            {
                                item.RemoveObject(keyframe);
                            }
                        }
                    }

                }

                #endregion
            }
            #endregion

        }

        #endregion

        #endregion
    }
}


text:
<?php

namespace Ice\Widget;

use Ice\Core\Widget;
use Ice\WidgetComponent\HtmlTag;

class Header extends Widget
{
    /**
     * Widget config
     *
     * @return array
     */
    protected static function config()
    {
        return [
            'render' => ['template' => true, 'class' => 'Ice:Php', 'layout' => null, 'resource' => null],
            'access' => ['roles' => [], 'request' => null, 'env' => null, 'message' => 'Access denied'],
            'resource' => ['js' => null, 'css' => null, 'less' => null, 'img' => null],
            'cache' => ['ttl' => -1, 'count' => 1000],
            'actions' => [],
            'input' => [],
            'output' => [],
        ];
    }

    /**
     * @param $name
     * @param array $options
     * @param string $template
     * @return Header
     */
    public function h1($name, array $options = [], $template = 'Ice\Widget\Header\H1')
    {
        return $this->addPart(new HtmlTag($name, $options, $template, $this));
    }

    /**
     * @param $name
     * @param array $options
     * @param string $template
     * @return Header
     */
    public function h2($name, array $options = [], $template = 'Ice\Widget\Header\H2')
    {
        return $this->addPart(new HtmlTag($name, $options, $template, $this));
    }

    /**
     * @param $name
     * @param array $options
     * @param string $template
     * @return Header
     */
    public function h3($name, array $options = [], $template = 'Ice\Widget\Header\H3')
    {
        return $this->addPart(new HtmlTag($name, $options, $template, $this));
    }

    /**
     * @param $name
     * @param array $options
     * @param string $template
     * @return Header
     */
    public function h4($name, array $options = [], $template = 'Ice\Widget\Header\H4')
    {
        return $this->addPart(new HtmlTag($name, $options, $template, $this));
    }

    /**
     * @param $name
     * @param array $options
     * @param string $template
     * @return Header
     */
    public function h4a($name, array $options = [], $template = 'Ice\Widget\Header\H4a')
    {
        return $this->addPart(new HtmlTag($name, $options, $template, $this));
    }

    /**
     * @param $name
     * @param array $options
     * @param string $template
     * @return Header
     */
    public function h5($name, array $options = [], $template = 'Ice\Widget\Header\H5')
    {
        return $this->addPart(new HtmlTag($name, $options, $template, $this));
    }

    /**
     * @param $name
     * @param array $options
     * @param string $template
     * @return Header
     */
    public function h6($name, array $options = [], $template = 'Ice\Widget\Header\H6')
    {
        return $this->addPart(new HtmlTag($name, $options, $template, $this));
    }

    /** Build widget
     *
     * @param array $input
     * @return array
     */
    protected function build(array $input)
    {
        return [];
    }
}


text:
% EXPORT Export object simple data file
%
% This method exports objects to a data file for use outside of the Image
% class.
%   >> export(object,filename);
% % If the file name has a *.pff extension (case insensitive), the export
% % uses the (binary) Portable File Format.  Any other extension exports the image to
% % a text file with (x y z) columns.
%
% See also IMAGE, store
%

% created October 7, 2013 by Daniel Dolan (Sandia National Laboratories)
% modified October 18, 2013 by Tommy Ao (Sandia National Laboratories)
% modified January 27, 2015 by Daniel Dolan
%   -added PFF support
% modified February 13, 2015 by Daniel Dolan
%   -removed graphic (jpeg, etc) support
%   -removed SDA support (use export instead)
%   -revised text file support (three data columns)
function export(object,filename,mode)

% manage input
assert(nargin>=2,'ERROR: insufficient input');
assert(ischar(filename),'ERROR: invalid file name');
assert(~isempty(filename),'ERROR: invalid file name');
[~,~,extension]=fileparts(filename);
extension=lower(extension);

if (nargin<3) || isempty(mode)
    mode='create';
end

% place data into file
switch extension
    case '.pff'
        data=struct();
        data.Grid={object.Grid1 object.Grid2};
        data.GridLabel={object.Grid1Label object.Grid2Label};
        data.Vector={object.Data};
        data.VectorLabel={object.DataLabel};
        data.Type='Image export';
        data.Title=object.Name;
        archive=SMASH.FileAccess.PFFfile(filename);
        write(archive,data,mode);
    case {'.bmp' '.png' '.jpg' '.jpeg' '.tif' '.tiff'}
        z=object.Data;
        %z1=min(z(:));
        %z2=max(z(:));
        %z=(z-z1)/(z2-z1);
        imwrite(z,filename);
    otherwise
        x=object.Grid1;
        y=object.Grid2;
        [x,y]=meshgrid(x,y);
        z=object.Data;
        table=[x(:) y(:) z(:)];
        format='%#+.6e %#+.6e %#+.6e\n';
        header{1}=sprintf('Image export on %s',datestr(now));
        header{2}=sprintf('column format: grid1 grid2 data');
        SMASH.FileAccess.writeFile(filename,table,format,header);
end

end


text:
package org.opensplice.config.meta;

public class MetaValueSize extends MetaValueNatural {
    public MetaValueSize(String doc, Long defaultValue, Long maxValue,
            Long minValue, String dimension) {
        super(doc, defaultValue, maxValue, minValue, dimension);
    }

    @Override
    public boolean setMaxValue(Object maxValue) {
        boolean result;

        if(maxValue instanceof Long){
            this.maxValue = maxValue;
            result = true;
        } else {
            result = false;
        }
        return result;
    }

    @Override
    public boolean setMinValue(Object minValue) {
        boolean result;

        if(minValue instanceof Long){
            this.minValue = minValue;
            result = true;
        } else {
            result = false;
        }
        return result;
    }

    @Override
    public boolean setDefaultValue(Object defaultValue) {
        boolean result;

        if(defaultValue instanceof Long){
            this.defaultValue = defaultValue;
            result = true;
        } else {
            result = false;
        }
        return result;
    }
}


text:
package psidev.psi.mi.jami.xml.model.extension;

import psidev.psi.mi.jami.datasource.FileSourceContext;
import psidev.psi.mi.jami.datasource.FileSourceLocator;
import psidev.psi.mi.jami.model.CooperativityEvidence;
import psidev.psi.mi.jami.model.CvTerm;
import psidev.psi.mi.jami.model.Experiment;
import psidev.psi.mi.jami.model.Publication;
import psidev.psi.mi.jami.utils.comparator.cooperativity.UnambiguousCooperativityEvidenceComparator;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;

/**
 * Xml implementation for cooperativity evidence
 *
 * @author Marine Dumousseau (marine@ebi.ac.uk)
 * @version $Id$
 * @since
15/11/13

 */
public class XmlCooperativityEvidence implements CooperativityEvidence, FileSourceContext {
    private PsiXmlLocator sourceLocator;
    private Experiment exp;
    private Publication publication;
    private Collection<CvTerm> evidenceMethods;

    /**
     *
Constructor for XmlCooperativityEvidence.

     *
     * @param exp a {@link psidev.psi.mi.jami.model.Experiment} object.
     */
    public XmlCooperativityEvidence(Experiment exp) {
        if (exp == null){
            throw new IllegalArgumentException("The experiment is mandatory");
        }
        this.exp = exp;
    }

    /**
     *
Getter for the field publication.

     *
     * @return a {@link psidev.psi.mi.jami.model.Publication} object.
     */
    public Publication getPublication() {
        if (this.publication == null){
            if (exp.getPublication() == null){
                this.publication = new BibRef();
            }
            else{
                this.publication = exp.getPublication();
            }
            this.exp = null;
        }
        return this.publication;
    }

    /**
     *
Getter for the field sourceLocator.

     *
     * @return a {@link psidev.psi.mi.jami.datasource.FileSourceLocator} object.
     */
    public FileSourceLocator getSourceLocator() {
        return sourceLocator;
    }

    /** {@inheritDoc} */
    public void setSourceLocator(FileSourceLocator locator) {
        if (sourceLocator == null){
            this.sourceLocator = null;
        }
        else if (sourceLocator instanceof PsiXmlLocator){
            this.sourceLocator = (PsiXmlLocator)sourceLocator;
        }
        else {
            this.sourceLocator = new PsiXmlLocator(sourceLocator.getLineNumber(), sourceLocator.getCharNumber(), null);
        }
    }

    /**
     *
Setter for the field sourceLocator.

     *
     * @param locator a {@link psidev.psi.mi.jami.xml.model.extension.PsiXmlLocator} object.
     */
    public void setSourceLocator(PsiXmlLocator locator) {
        this.sourceLocator = locator;
    }

    /** {@inheritDoc} */
    @Override
    public String toString() {
        return (getSourceLocator() != null ? "Cooperativity evidence: "+getSourceLocator().toString():super.toString());
    }

    /**
     *
initialiseEvidenceMethods.

     */
    protected void initialiseEvidenceMethods(){
        this.evidenceMethods = new ArrayList<CvTerm>();
    }

    /**
     *
initialiseEvidenceMethodsWith.

     *
     * @param methods a {@link java.util.Collection} object.
     */
    protected void initialiseEvidenceMethodsWith(Collection<CvTerm> methods){
        if (methods == null){
            this.evidenceMethods = Collections.EMPTY_LIST;
        }
        else{
            this.evidenceMethods = methods;
        }
    }

    /** {@inheritDoc} */
    public void setPublication(Publication publication) {
        if (publication == null){
            throw new IllegalArgumentException("The publication cannot be null in a CooperativityEvidence");
        }
        this.publication = publication;
    }

    /**
     *
Getter for the field evidenceMethods.

     *
     * @return a {@link java.util.Collection} object.
     */
    public Collection<CvTerm> getEvidenceMethods() {

        if (evidenceMethods == null){
            initialiseEvidenceMethods();
        }
        return evidenceMethods;
    }

    /** {@inheritDoc} */
    @Override
    public boolean equals(Object o) {
        if (this == o){
            return true;
        }

        if (!(o instanceof CooperativityEvidence)){
            return false;
        }

        return UnambiguousCooperativityEvidenceComparator.areEquals(this, (CooperativityEvidence) o);
    }

    /** {@inheritDoc} */
    @Override
    public int hashCode() {
        return UnambiguousCooperativityEvidenceComparator.hashCode(this);
    }
}


text:
<?php

 require_once('bp_lib.php');

 global $bpOptions;

 if(isset($_POST['rcla'])) {
   $post = array();
   $bpOptions['apiKey'] = base64_decode(trim($_POST['rcla']));
   $opts = array('orderID', 'itemDesc', 'itemCode', 'notificationEmail', 'notificationURL', 'redirectURL',
                 'posData', 'price', 'currency', 'physical', 'fullNotifications', 'transactionSpeed', 'buyerName',
                 'buyerAddress1', 'buyerAddress2', 'buyerCity', 'buyerState', 'buyerZip', 'buyerEmail', 'buyerPhone');

    $opts = array_flip($opts);

    foreach($_POST as $key => $value) {
      if (array_key_exists($key, $opts))
        $post[$key] = $_POST[$key];
    }

   $invresp = bpCreateInvoice($_POST['orderId'],$_POST['price'],$_POST['posData'],$post);

   if(isset($invresp['url']))
     header('Location: ' . $invresp['url']);
   else
     header('Location: ' . $_POST['redirectURL'] . '?error='. htmlentities($invresp['error']['message']));
 } else {
   die();
 }


text:
layout: docwithnav
title: "Run Kubernetes with rkt"
---
<!-- BEGIN MUNGE: UNVERSIONED_WARNING -->

<!-- END MUNGE: UNVERSIONED_WARNING -->

# Run Kubernetes with rkt

This document describes how to run Kubernetes using [rkt](https://github.com/coreos/rkt) as a container runtime.
We still have [a bunch of work](https://github.com/GoogleCloudPlatform/kubernetes/issues/8262) to do to make the experience with rkt wonderful, please stay tuned!

### **Prerequisite**

- [systemd](http://www.freedesktop.org/wiki/Software/systemd/) should be installed on your machine and should be enabled. The minimum version required at this moment (2015/05/28) is [215](http://lists.freedesktop.org/archives/systemd-devel/2014-July/020903.html).
  *(Note that systemd is not required by rkt itself, we are using it here to monitor and manage the pods launched by kubelet.)*

- Install the latest rkt release according to the instructions [here](https://github.com/coreos/rkt).
  The minimum version required for now is [v0.5.6](https://github.com/coreos/rkt/releases/tag/v0.5.6).

- Make sure the `rkt metadata service` is running because it is necessary for running pod in private network mode.
  More details about the networking of rkt can be found in the [documentation](https://github.com/coreos/rkt/blob/master/Documentation/networking.md).

  To start the `rkt metadata service`, you can simply run:

{% highlight console %}
{% raw %}
  $ sudo rkt metadata-service
{% endraw %}
{% endhighlight %}

  If you want the service to be running as a systemd service, then:

{% highlight console %}
{% raw %}
  $ sudo systemd-run rkt metadata-service
{% endraw %}
{% endhighlight %}

  Alternatively, you can use the [rkt-metadata.service](https://github.com/coreos/rkt/blob/master/dist/init/systemd/rkt-metadata.service) and [rkt-metadata.socket](https://github.com/coreos/rkt/blob/master/dist/init/systemd/rkt-metadata.socket) to start the service.

### Local cluster

To use rkt as the container runtime, you just need to set the environment variable `CONTAINER_RUNTIME`:

{% highlight console %}
{% raw %}
$ export CONTAINER_RUNTIME=rkt
$ hack/local-up-cluster.sh
{% endraw %}
{% endhighlight %}

### CoreOS cluster on Google Compute Engine (GCE)

To use rkt as the container runtime for your CoreOS cluster on GCE, you need to specify the OS distribution, project, image:

{% highlight console %}
{% raw %}
$ export KUBE_OS_DISTRIBUTION=coreos
$ export KUBE_GCE_MINION_IMAGE=<image_id>
$ export KUBE_GCE_MINION_PROJECT=coreos-cloud
$ export KUBE_CONTAINER_RUNTIME=rkt
{% endraw %}
{% endhighlight %}

You can optionally choose the version of rkt used by setting `KUBE_RKT_VERSION`:

{% highlight console %}
{% raw %}
$ export KUBE_RKT_VERSION=0.5.6
{% endraw %}
{% endhighlight %}

Then you can launch the cluster by:

{% highlight console %}
{% raw %}
$ kube-up.sh
{% endraw %}
{% endhighlight %}

Note that we are still working on making all containerized the master components run smoothly in rkt. Before that we are not able to run the master node with rkt yet.

### CoreOS cluster on AWS

To use rkt as the container runtime for your CoreOS cluster on AWS, you need to specify the provider and OS distribution:

{% highlight console %}
{% raw %}
$ export KUBERNETES_PROVIDER=aws
$ export KUBE_OS_DISTRIBUTION=coreos
$ export KUBE_CONTAINER_RUNTIME=rkt
{% endraw %}
{% endhighlight %}

You can optionally choose the version of rkt used by setting `KUBE_RKT_VERSION`:

{% highlight console %}
{% raw %}
$ export KUBE_RKT_VERSION=0.5.6
{% endraw %}
{% endhighlight %}

You can optionally choose the CoreOS channel  by setting `COREOS_CHANNEL`:

{% highlight console %}
{% raw %}
$ export COREOS_CHANNEL=stable
{% endraw %}
{% endhighlight %}

Then you can launch the cluster by:

{% highlight console %}
{% raw %}
$ kube-up.sh
{% endraw %}
{% endhighlight %}

Note: CoreOS is not supported as the master using the automated launch
scripts. The master node is always Ubuntu.

### Getting started with your cluster

See [a simple nginx example](../../../docs/user-guide/simple-nginx.html) to try out your new cluster.

For more complete applications, please look in the [examples directory](../../../examples/).

<!-- BEGIN MUNGE: IS_VERSIONED -->
<!-- TAG IS_VERSIONED -->
<!-- END MUNGE: IS_VERSIONED -->

<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/getting-started-guides/rkt/README.md?pixel)]()
<!-- END MUNGE: GENERATED_ANALYTICS -->


text:
require 'spec_helper'

describe "Projects" do
  before { login_as :user }

  describe "GET /projects/show" do
    before do
      @project = create(:project, owner: @user)
      @project.add_access(@user, :read)

      visit project_path(@project)
    end

    it "should be correct path" do
      current_path.should == project_path(@project)
    end
  end

  describe "GET /projects/:id/edit" do
    before do
      @project = create(:project)
      @project.add_access(@user, :admin, :read)

      visit edit_project_path(@project)
    end

    it "should be correct path" do
      current_path.should == edit_project_path(@project)
    end

    it "should have labels for new project" do
      page.should have_content("Project name is")
      page.should have_content("Advanced settings:")
      page.should have_content("Features:")
    end
  end

  describe "PUT /projects/:id" do
    before do
      @project = create(:project, owner: @user)
      @project.add_access(@user, :admin, :read)

      visit edit_project_path(@project)

      fill_in 'project_name', with: 'Awesome'
      click_button "Save"
      @project = @project.reload
    end

    it "should be correct path" do
      current_path.should == edit_project_path(@project)
    end

    it "should show project" do
      page.should have_content("Awesome")
    end
  end

  describe "DELETE /projects/:id" do
    before do
      @project = create(:project, owner: @user)
      @project.add_access(@user, :read, :admin)
      visit edit_project_path(@project)
    end

    it "should be correct path" do
      expect { click_link "Remove" }.to change {Project.count}.by(-1)
    end
  end
end


text:
/**
 * aecp_controller_state_machine.h
 *
 * AVDECC Entity Model Controller State Machine class
 */

#pragma once

#include <vector>
#include "inflight.h"
#include "operation.h"

namespace avdecc_lib
{
class inflight;

class aecp_controller_state_machine
{
private:
    uint16_t aecp_seq_id; // The sequence id used for identifying the AECP command that a response is for
    std::vector<inflight> inflight_cmds;
    std::vector<operation> active_operations;

public:
    aecp_controller_state_machine();

    ~aecp_controller_state_machine();
    ///
    /// Initialize and fill Ethernet frame payload with Ethernet frame information for AEM commands.
    ///
    int ether_frame_init(uint64_t end_station_mac, struct jdksavdecc_frame * cmd_frame, uint16_t len);

    ///
    /// Initialize and fill Ethernet frame payload with 1722 AECP Header information.
    ///
    void common_hdr_init(int message_type, struct jdksavdecc_frame * cmd_frame, uint64_t target_entity_id, uint32_t cd_len);

    ///
    /// Process the Send Command state of the AEM Controller State Machine.
    ///
    int state_send_cmd(void * notification_id, uint32_t notification_flag, struct jdksavdecc_frame * cmd_frame);

    ///
    /// Process the Received Unsolicited state of the AEM Controller State Machine.
    ///
    int state_rcvd_unsolicited(struct jdksavdecc_frame * cmd_frame);

    ///
    /// Process the Received Response state of the AEM Controller State Machine.
    ///
    int state_rcvd_resp(void *& notification_id, struct jdksavdecc_frame * cmd_frame);

    ///
    /// Check timeout for the inflight commands.
    ///
    void tick();

    ///
    /// Update inflight command for the response received.
    ///
    int update_inflight_for_rcvd_resp(void *& notification_id, uint32_t msg_type, bool u_field, struct jdksavdecc_frame * cmd_frame);

    int start_operation(void *& notification_id, uint16_t operation_id, uint16_t operation_type, const uint8_t * frame, ssize_t frame_len);
    bool is_active_operation_with_notification_id(void * notification_id);

    int update_operation_for_rcvd_resp(void *& notification_id, uint16_t operation_id, uint16_t percent_complete, struct jdksavdecc_frame * cmd_frame);

    ///
    /// Check if the command with the corresponding notification id is already in the inflight command vector.
    ///
    bool is_inflight_cmd_with_notification_id(void * notification_id);

private:
    ///
    /// Transmit an AEM Command.
    ///
    int tx_cmd(void * notification_id, uint32_t notification_flag, struct jdksavdecc_frame * cmd_frame, bool resend);

    ///
    /// Handle the receipt and processing of a received unsolicited response for a command sent.
    ///
    int proc_unsolicited(struct jdksavdecc_frame * cmd_frame);

    ///
    /// Handle the receipt and processing of a received response for a command sent.
    ///
    int proc_resp(void *& notification_id, struct jdksavdecc_frame * cmd_frame);

    ///
    /// Notify the application that a command has timed out and the retry has timed out and the
    /// inflight command is removed from the inflight list.
    ///
    void state_timeout(uint32_t inflight_cmd_index);

    ///
    /// Call notification or post_log_msg callback function for the command sent or response received.
    ///
    int callback(void * notification_id, uint32_t notification_flag, uint8_t * frame);
};

extern aecp_controller_state_machine * aecp_controller_state_machine_ref;
}


text:
<!DOCTYPE html>

	{% include head.html %}

					<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
						Toggle navigation

					</button>

							Back to News

						{{ page.title }} // {{ page.date | date_to_string }}

{{ page.title }}

{{ page.date | date_to_string }}

					{{ page.content }}

		{% include footer.html %} {% include js.html %}


text:
package fr.ortolang.teicorpo;

import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.*;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpression;
import javax.xml.xpath.XPathExpressionException;
import java.io.StringWriter;

public class XpathTest {
    public static void main(String args[]) {
        if (args.length < 2) {
            System.err.println("Usage: XpathTest xml/tei-filename xpath-query -details");
        }
        TeiDocument teidoc = new TeiDocument(args[0], false);
        XPathExpression expr = null;
        try {
            expr = teidoc.path.compile(args[1]);
        } catch (XPathExpressionException e) {
            System.err.printf("xpath syntax error.%n%s%n", e.toString());
            e.printStackTrace();
        }
        NodeList nodes;
        try {
            nodes = (NodeList) expr.evaluate(teidoc.root, XPathConstants.NODESET);
        } catch (XPathExpressionException e) {
            System.err.printf("xpath processing error.%n%s%n", e.toString());
            e.printStackTrace();
            return;
        }
        for (int i = 0; i < nodes.getLength(); i++) {
            if (args.length > 2)
                System.out.printf("Node %d: %s%n", i, prettyprint(nodes.item(i)));
            else
                System.out.printf("Node %d: %s%n", i, prettyprint0(nodes.item(i)));
        }
    }

    private static String prettyprint0(Node item) {
        NamedNodeMap nnm = item.getAttributes();
        String s = "<" + item.getNodeName() + " ";
        for (int i = 0; i < nnm.getLength(); i++) {
            Node n = nnm.item(i);
            s += n.getNodeName() + "=" + n.getTextContent() + " ";
        }
        return s + ">";
    }

    private static String prettyprint(Node item) {
        Transformer transformer = null;
        try {
            transformer = TransformerFactory.newInstance().newTransformer();
        } catch (TransformerConfigurationException e) {
            e.printStackTrace();
        }
        transformer.setOutputProperty(OutputKeys.INDENT, "yes");
        transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
//initialize StreamResult with File object to save to file
        StreamResult result = new StreamResult(new StringWriter());
//        DOMSource source = new DOMSource(createDocFromNode(item));
        DOMSource source = new DOMSource(item);
        try {
            transformer.transform(source, result);
        } catch (TransformerException e) {
            e.printStackTrace();
        }
        return result.getWriter().toString();
    }

    private static Document createDocFromNode(Node item) {
        DocumentBuilderFactory factory = null;
        try {
            factory = DocumentBuilderFactory.newInstance();
            DocumentBuilder builder = factory.newDocumentBuilder();
            Document doc = builder.newDocument();
            doc.appendChild(item);
            return doc;
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }
}


text:
CORS is a `net/http` handler implementing [Cross Origin Resource Sharing W3 specification](http://www.w3.org/TR/cors/) in Golang.

## Getting Started

After installing Go and setting up your [GOPATH](http://golang.org/doc/code.html#GOPATH), create your first `.go` file. We'll call it `server.go`.

```go
package main

import (
    "net/http"

    "github.com/rs/cors"
)

func main() {
    mux := http.NewServeMux()
    mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
        w.Header().Set("Content-Type", "application/json")
        w.Write([]byte("{\"hello\": \"world\"}"))
    })

    // cors.Default() setup the middleware with default options being
    // all origins accepted with simple methods (GET, POST). See
    // documentation below for more options.
    handler := cors.Default().Handler(mux)
    http.ListenAndServe(":8080", handler)
}
```

Install `cors`:

    go get github.com/rs/cors

Then run your server:

    go run server.go

The server now runs on `localhost:8080`:

    $ curl -D - -H 'Origin: http://foo.com' http://localhost:8080/
    HTTP/1.1 200 OK
    Access-Control-Allow-Origin: foo.com
    Content-Type: application/json
    Date: Sat, 25 Oct 2014 03:43:57 GMT
    Content-Length: 18

    {"hello": "world"}

### Allow * With Credentials Security Protection

This library has been modified to avoid a well known security issue when configured with `AllowedOrigins` to `*` and `AllowCredentials` to `true`. Such setup used to make the library reflects the request `Origin` header value, working around a security protection embedded into the standard that makes clients to refuse such configuration. This behavior has been removed with [#55](https://github.com/rs/cors/issues/55) and [#57](https://github.com/rs/cors/issues/57).

If you depend on this behavior and understand the implications, you can restore it using the `AllowOriginFunc` with `func(origin string) {return true}`.

Please refer to [#55](https://github.com/rs/cors/issues/55) for more information about the security implications.

### More Examples

* `net/http`: [examples/nethttp/server.go](https://github.com/rs/cors/blob/master/examples/nethttp/server.go)
* [Goji](https://goji.io): [examples/goji/server.go](https://github.com/rs/cors/blob/master/examples/goji/server.go)
* [Martini](http://martini.codegangsta.io): [examples/martini/server.go](https://github.com/rs/cors/blob/master/examples/martini/server.go)
* [Negroni](https://github.com/codegangsta/negroni): [examples/negroni/server.go](https://github.com/rs/cors/blob/master/examples/negroni/server.go)
* [Alice](https://github.com/justinas/alice): [examples/alice/server.go](https://github.com/rs/cors/blob/master/examples/alice/server.go)
* [HttpRouter](https://github.com/julienschmidt/httprouter): [examples/httprouter/server.go](https://github.com/rs/cors/blob/master/examples/httprouter/server.go)
* [Gorilla](http://www.gorillatoolkit.org/pkg/mux): [examples/gorilla/server.go](https://github.com/rs/cors/blob/master/examples/gorilla/server.go)
* [Buffalo](https://gobuffalo.io): [examples/buffalo/server.go](https://github.com/rs/cors/blob/master/examples/buffalo/server.go)
* [Gin](https://gin-gonic.github.io/gin): [examples/gin/server.go](https://github.com/rs/cors/blob/master/examples/gin/server.go)
* [Chi](https://github.com/go-chi/chi): [examples/chi/server.go](https://github.com/rs/cors/blob/master/examples/chi/server.go)

## Parameters

Parameters are passed to the middleware thru the `cors.New` method as follow:

```go
c := cors.New(cors.Options{
    AllowedOrigins: []string{"http://foo.com", "http://foo.com:8080"},
    AllowCredentials: true,
    // Enable Debugging for testing, consider disabling in production
    Debug: true,
})

// Insert the middleware
handler = c.Handler(handler)
```

* **AllowedOrigins** `[]string`: A list of origins a cross-domain request can be executed from. If the special `*` value is present in the list, all origins will be allowed. An origin may contain a wildcard (`*`) to replace 0 or more characters (i.e.: `http://*.domain.com`). Usage of wildcards implies a small performance penality. Only one wildcard can be used per origin. The default value is `*`.
* **AllowOriginFunc** `func (origin string) bool`: A custom function to validate the origin. It takes the origin as an argument and returns true if allowed, or false otherwise. If this option is set, the content of `AllowedOrigins` is ignored.
* **AllowOriginRequestFunc** `func (r *http.Request origin string) bool`: A custom function to validate the origin. It takes the HTTP Request object and the origin as argument and returns true if allowed or false otherwise. If this option is set, the content of `AllowedOrigins` and `AllowOriginFunc` is ignored
* **AllowedMethods** `[]string`: A list of methods the client is allowed to use with cross-domain requests. Default value is simple methods (`GET` and `POST`).
* **AllowedHeaders** `[]string`: A list of non simple headers the client is allowed to use with cross-domain requests.
* **ExposedHeaders** `[]string`: Indicates which headers are safe to expose to the API of a CORS API specification
* **AllowCredentials** `bool`: Indicates whether the request can include user credentials like cookies, HTTP authentication or client side SSL certificates. The default is `false`.
* **MaxAge** `int`: Indicates how long (in seconds) the results of a preflight request can be cached. The default is `0` which stands for no max age.
* **OptionsPassthrough** `bool`: Instructs preflight to let other potential next handlers to process the `OPTIONS` method. Turn this on if your application handles `OPTIONS`.
* **Debug** `bool`: Debugging flag adds additional output to debug server side CORS issues.

See [API documentation](http://godoc.org/github.com/rs/cors) for more info.

## Benchmarks

    BenchmarkWithout          20000000    64.6 ns/op      8 B/op    1 allocs/op
    BenchmarkDefault          3000000      469 ns/op    114 B/op    2 allocs/op
    BenchmarkAllowedOrigin    3000000      608 ns/op    114 B/op    2 allocs/op
    BenchmarkPreflight        20000000    73.2 ns/op      0 B/op    0 allocs/op
    BenchmarkPreflightHeader  20000000    73.6 ns/op      0 B/op    0 allocs/op
    BenchmarkParseHeaderList  2000000      847 ns/op    184 B/op    6 allocs/op
    BenchmarkParse…Single     5000000      290 ns/op     32 B/op    3 allocs/op
    BenchmarkParse…Normalized 2000000      776 ns/op    160 B/op    6 allocs/op

## Licenses

All source code is licensed under the [MIT License](https://raw.github.com/rs/cors/master/LICENSE).


text:
"use strict";

var compiler = "../../../../lib/sentient/compiler";
var Level1Compiler = require(compiler + "/level1Compiler");
var Level2Compiler = require(compiler + "/level2Compiler");
var Level3Compiler = require(compiler + "/level3Compiler");

var runtime = "../../../../lib/sentient/runtime";
var Level1Runtime = require(runtime + "/level1Runtime");
var Level2Runtime = require(runtime + "/level2Runtime");
var Level3Runtime = require(runtime + "/level3Runtime");

var Machine = require("../../../../lib/sentient/machine");

describe("Integration: 'bounds'", function () {
  it("checks whether a given index is in bounds of the array", function () {
    var program = Level3Compiler.compile({
      instructions: [
        { type: "constant", value: 10 },
        { type: "constant", value: 20 },
        { type: "constant", value: 30 },
        { type: "collect", width: 3 },
        { type: "pop", symbol: "array" },

        { type: "push", symbol: "array" },
        { type: "constant", value: -1 },
        { type: "bounds" },
        { type: "pop", symbol: "foo" },

        { type: "push", symbol: "array" },
        { type: "constant", value: 0 },
        { type: "bounds" },
        { type: "pop", symbol: "bar" },

        { type: "push", symbol: "array" },
        { type: "constant", value: 1 },
        { type: "bounds" },
        { type: "pop", symbol: "baz" },

        { type: "push", symbol: "array" },
        { type: "constant", value: 2 },
        { type: "bounds" },
        { type: "pop", symbol: "qux" },

        { type: "push", symbol: "array" },
        { type: "constant", value: 3 },
        { type: "bounds" },
        { type: "pop", symbol: "abc" },

        { type: "variable", symbol: "foo" },
        { type: "variable", symbol: "bar" },
        { type: "variable", symbol: "baz" },
        { type: "variable", symbol: "qux" },
        { type: "variable", symbol: "abc" }
      ]
    });

    program = Level2Compiler.compile(program);
    program = Level1Compiler.compile(program);

    var assignments = Level3Runtime.encode(program, {});
    assignments = Level2Runtime.encode(program, assignments);
    assignments = Level1Runtime.encode(program, assignments);

    var result = Machine.run(program, assignments)[0];

    result = Level1Runtime.decode(program, result);
    result = Level2Runtime.decode(program, result);
    result = Level3Runtime.decode(program, result);

    expect(result.foo).toEqual(false);
    expect(result.bar).toEqual(true);
    expect(result.baz).toEqual(true);
    expect(result.qux).toEqual(true);
    expect(result.abc).toEqual(false);
  });

  it("works for nested arrays", function () {
    var program = Level3Compiler.compile({
      instructions: [
        // [[10, 20], [30]]
        { type: "constant", value: 10 },
        { type: "constant", value: 20 },
        { type: "collect", width: 2 },

        { type: "constant", value: 30 },
        { type: "collect", width: 1 },

        { type: "collect", width: 2 },

        { type: "pop", symbol: "array" },

        { type: "push", symbol: "array" },
        { type: "constant", value: -1 },
        { type: "bounds" },
        { type: "pop", symbol: "foo" },

        { type: "push", symbol: "array" },
        { type: "constant", value: 0 },
        { type: "bounds" },
        { type: "pop", symbol: "bar" },

        { type: "push", symbol: "array" },
        { type: "constant", value: 1 },
        { type: "bounds" },
        { type: "pop", symbol: "baz" },

        { type: "push", symbol: "array" },
        { type: "constant", value: 2 },
        { type: "bounds" },
        { type: "pop", symbol: "qux" },

        { type: "push", symbol: "array" },
        { type: "constant", value: 0 },
        { type: "get" },
        { type: "pop", symbol: "first" },

        { type: "push", symbol: "array" },
        { type: "constant", value: 1 },
        { type: "get" },
        { type: "pop", symbol: "second" },

        // [10, 20]
        { type: "push", symbol: "first" },
        { type: "constant", value: -1 },
        { type: "bounds" },
        { type: "pop", symbol: "a" },

        { type: "push", symbol: "first" },
        { type: "constant", value: 0 },
        { type: "bounds" },
        { type: "pop", symbol: "b" },

        { type: "push", symbol: "first" },
        { type: "constant", value: 1 },
        { type: "bounds" },
        { type: "pop", symbol: "c" },

        { type: "push", symbol: "first" },
        { type: "constant", value: 2 },
        { type: "bounds" },
        { type: "pop", symbol: "d" },

        // [30]
        { type: "push", symbol: "second" },
        { type: "constant", value: -1 },
        { type: "bounds" },
        { type: "pop", symbol: "z" },

        { type: "push", symbol: "second" },
        { type: "constant", value: 0 },
        { type: "bounds" },
        { type: "pop", symbol: "y" },

        { type: "push", symbol: "second" },
        { type: "constant", value: 1 },
        { type: "bounds" },
        { type: "pop", symbol: "x" },

        { type: "variable", symbol: "foo" },
        { type: "variable", symbol: "bar" },
        { type: "variable", symbol: "baz" },
        { type: "variable", symbol: "qux" },

        { type: "variable", symbol: "a" },
        { type: "variable", symbol: "b" },
        { type: "variable", symbol: "c" },
        { type: "variable", symbol: "d" },

        { type: "variable", symbol: "z" },
        { type: "variable", symbol: "y" },
        { type: "variable", symbol: "x" }
      ]
    });

    program = Level2Compiler.compile(program);
    program = Level1Compiler.compile(program);

    var assignments = Level3Runtime.encode(program, {});
    assignments = Level2Runtime.encode(program, assignments);
    assignments = Level1Runtime.encode(program, assignments);

    var result = Machine.run(program, assignments)[0];

    result = Level1Runtime.decode(program, result);
    result = Level2Runtime.decode(program, result);
    result = Level3Runtime.decode(program, result);

    expect(result.foo).toEqual(false);
    expect(result.bar).toEqual(true);
    expect(result.baz).toEqual(true);
    expect(result.qux).toEqual(false);

    expect(result.a).toEqual(false);
    expect(result.b).toEqual(true);
    expect(result.c).toEqual(true);
    expect(result.d).toEqual(false);

    expect(result.z).toEqual(false);
    expect(result.y).toEqual(true);
    expect(result.x).toEqual(false);
  });
});


text:
START_ATF_NAMESPACE
    typedef wchar_t *PWCHAR;
END_ATF_NAMESPACE


text:
package com.draga.spaceTravels3.manager.level.serialisableEntities;

import java.util.LinkedHashMap;
import java.util.List;

public class SerialisableLevel
{
    // TODO: JSON ignore?
    public String                                        id;
    public String                                        name;
    public SerialisableShip                              serialisedShip;
    public SerialisablePlanet                            serialisedDestinationPlanet;
    public List<SerialisablePlanet>                      serialisedPlanets;
    public List<SerialisablePickup>                      serialisedPickups;
    public LinkedHashMap<String, SerialisableDifficulty> serialisedDifficulties;

    public SerialisableLevel()
    {
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.lumi</groupId>
    <artifactId>rumpelstiltskin</artifactId>
    <version>1.0-SNAPSHOT</version>
    <name>rumpelstiltskin</name>
    <url>http://maven.apache.org</url>

    <properties>
        <encoding>UTF-8</encoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    </properties>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                    <archive>
                        <manifest>
                            <mainClass>org.lumi.rumpelstiltskin.RumpelstiltskinMain</mainClass>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.4</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <configuration>
                            <descriptorRefs>
                                <descriptorRef>jar-with-dependencies</descriptorRef>
                            </descriptorRefs>
                            <archive>
                                <manifest>
                                    <mainClass>org.lumi.rumpelstiltskin.RumpelstiltskinMain</mainClass>
                                </manifest>
                            </archive>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>


text:
[kakao](../../index.md) / [com.agoda.kakao.recycler](../index.md) / [KRecyclerView](index.md) / [getPosition](./get-position.md)

# getPosition

`fun getPosition(childMatcher: `[`ViewBuilder`](../../com.agoda.kakao.common.builders/-view-builder/index.md)`.() -> `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`): `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)

Returns the adapter position of item matched by given matcher

### Parameters

`childMatcher` - Matcher that will be used to find item

**Return**
Position of that item in adapter


text:
<?php

namespace App\Providers;

use Carbon\Carbon;
use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        // TODO: does this belong here?
        setlocale(LC_TIME, 'de_DE.utf8');
        // Use HTTPS for all routes
        if($this->app->environment('production')) {
            \Illuminate\Support\Facades\URL::forceScheme('https');
        }
    }

    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        //
    }
}


text:
description("Tests dynamic updates of the 'dx' property of the SVGFEOffsetElement object")
createSVGTestCase();

var offsetElement = createSVGElement("feOffset");
offsetElement.setAttribute("dx", "50");
offsetElement.setAttribute("dy", "0");

var filterElement = createSVGElement("filter");
filterElement.setAttribute("id", "myFilter");
filterElement.setAttribute("filterUnits", "userSpaceOnUse");
filterElement.setAttribute("x", "0");
filterElement.setAttribute("y", "0");
filterElement.setAttribute("width", "200");
filterElement.setAttribute("height", "200");
filterElement.appendChild(offsetElement);

var defsElement = createSVGElement("defs");
defsElement.appendChild(filterElement);

rootSVGElement.appendChild(defsElement);

var rectElement = createSVGElement("circle");
rectElement.setAttribute("width", 200);
rectElement.setAttribute("height", 200);
rectElement.setAttribute("cx", "100");
rectElement.setAttribute("cy", "100");
rectElement.setAttribute("r", "70");
rectElement.setAttribute("fill", "green");
rectElement.setAttribute("filter", "url(#myFilter)");
rootSVGElement.appendChild(rectElement);

shouldBe("offsetElement.dx.baseVal", "50");

function repaintTest() {
    offsetElement.dx.baseVal = 0;
    shouldBe("offsetElement.dx.baseVal", "0");

    completeTest();
}

var successfullyParsed = true;