text:
package rest;

import vos.ProductoPedido;

import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.sql.Date;

import javax.servlet.ServletContext;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

import tm.RotondAndesTM;
import uk.co.jemos.podam.api.PodamFactory;
import uk.co.jemos.podam.api.PodamFactoryImpl;
import vos.Cliente;
import vos.Equivalencia;
import vos.Menu;
import vos.MenuProducto;
import vos.Pedido;
import vos.PedidoProductosMesa;
import vos.Producto;
import vos.Restaurante;
import vos.RestauranteProducto;
import vos.Servicio;
import vos.Usuario;

@Path("datos")
public class DatosServices {
	/**
	 * Atributo que usa la anotacion @Context para tener el ServletContext de la conexion actual.
	 */
	@Context
	private ServletContext context;

	/**
	 * Metodo que retorna el path de la carpeta WEB-INF/ConnectionData en el deploy actual dentro del servidor.
	 * @return path de la carpeta WEB-INF/ConnectionData en el deploy actual.
	 */
	private String getPath() {
		return context.getRealPath("WEB-INF/ConnectionData");
	}

	private String doErrorMessage(Exception e){
		return "{ \"ERROR\": \""+ e.getMessage() + "\"}" ;
	}

	/**
	 * Metodo que expone servicio REST usando GET que da todos los ingredientes de la base de datos.
	 * <b>URL: </b> http://"ip o nombre de host":8080/RotondAndes/rest/ingredientes
	 * @return Json con todos los ingredientes de la base de datos o json con
	 * el error que se produjo
	 */
	@GET
	public void get()
	{
		String delim=",";
		final String NEXT_LINE = "\n";
		PodamFactory factory = new PodamFactoryImpl();
		Long cantRestUsuCli=25000L;
		Long cantProductoPorRestaurante=20L;
		Long cantPedidosCliente=20L;
		Long cantPedidosUsuario=20L;

		ArrayList<Restaurante> restaurantes= new ArrayList<>();
		ArrayList<Producto> productos= new ArrayList<>();
		ArrayList<RestauranteProducto> restauranteProductos= new ArrayList<>();
		ArrayList<Cliente> clientes= new ArrayList<>();
		ArrayList<Usuario> usuarios= new ArrayList<>();
		ArrayList<Pedido> pedidos= new ArrayList<>();
		ArrayList<Servicio> servicios= new ArrayList<>();
		ArrayList<ProductoPedido> productosPedidos= new ArrayList<>();

		for (long i = 0; i < cantRestUsuCli; i++)
		{
			long syso=i%500;
			if(syso==0){System.out.println("Entrada No: "+i);}

			Restaurante restaurante = factory.manufacturePojo(Restaurante.class);
			restaurante.setRol("Restaurante");
			restaurantes.add(restaurante);
			usuarios.add(restaurante.darUsuario());

			for (long e = 0; e < cantProductoPorRestaurante; e++)
			{
				Producto producto = factory.manufacturePojo(Producto.class);
				productos.add(producto);
				int a = factory.manufacturePojo(Integer.class);
				int b = factory.manufacturePojo(Integer.class);
				int CantidadMaxima = 0;
				int CantidadActual = 0;
				if (a > b) {
					CantidadMaxima = a;
					CantidadActual = b;
				} else {
					CantidadMaxima = b;
					CantidadActual = a;
				}

				RestauranteProducto relacion = new RestauranteProducto(restaurante.getRepresentante(),
						producto.getNombre(), CantidadMaxima, CantidadActual);
				restauranteProductos.add(relacion);

			}

			Cliente cliente = factory.manufacturePojo(Cliente.class);
			cliente.setRol("Cliente");
			clientes.add(cliente);
			usuarios.add(cliente.darUsuario());

			Cliente cliente2 = factory.manufacturePojo(Cliente.class);
			cliente2.setRol("Cliente");
			clientes.add(cliente2);
			usuarios.add(cliente2.darUsuario());

			int contadorCantProductos=0;
			for(int o=0;o<cantPedidosCliente;o++)
			{
				// pedidosCliente PEDIDOS pedidosCliente PEDIDOS pedidosCliente PEDIDOS pedidosCliente PEDIDOS pedidosCliente PEDIDOS
				Pedido pedido = factory.manufacturePojo(Pedido.class);
				pedido.setNombre_usuario(cliente.getNombre());
				pedidos.add(pedido);

				if(contadorCantProductos==productos.size())
				{
					contadorCantProductos=0;
				}
				String nombreProductoElejido=productos.get(contadorCantProductos).getNombre();
				ProductoPedido productoPedido=new ProductoPedido(nombreProductoElejido, pedido.getId());
				productosPedidos.add(productoPedido);
				contadorCantProductos++;

				Servicio servicio=new Servicio(pedido.getId(),cliente.getNombre(),restaurante.getRepresentante());
				servicios.add(servicio);
			}

			Usuario usuario = factory.manufacturePojo(Usuario.class);
			usuario.setRol("UsuarioNoRegistrado");
			usuarios.add(usuario);

			Usuario usuario2 = factory.manufacturePojo(Usuario.class);
			usuario2.setRol("UsuarioNoRegistrado");
			usuarios.add(usuario2);

			for(int o=0;o<cantPedidosUsuario;o++)
			{
				//pedidosUsuario PEDIDOS pedidosUsuario PEDIDOS pedidosUsuario PEDIDOS pedidosUsuario PEDIDOS pedidosUsuario PEDIDOS
				Pedido pedido = factory.manufacturePojo(Pedido.class);
				pedido.setNombre_usuario(usuario.getNombre());
				pedidos.add(pedido);
				if(contadorCantProductos==productos.size())
				{
					contadorCantProductos=0;
				}
				String nombreProductoElejido=productos.get(contadorCantProductos).getNombre();
				ProductoPedido productoPedido=new ProductoPedido(nombreProductoElejido, pedido.getId());
				productosPedidos.add(productoPedido);
				contadorCantProductos++;

				Servicio servicio=new Servicio(pedido.getId(),usuario.getNombre(),restaurante.getRepresentante());
				servicios.add(servicio);

			}
		}

		System.out.println("RESTAURANTES: "+restaurantes.size());
		System.out.println("PRODUCTOS: "+productos.size());
		System.out.println("RP: "+restauranteProductos.size()+"");
		System.out.println("CLIENTES: "+clientes.size()+"");
		System.out.println("USUARIOS: "+usuarios.size()+"");
		System.out.println("PEDIDOS: "+pedidos.size()+"");
		System.out.println("SERVICIOS: "+servicios.size()+"");
		System.out.println("PP: "+productosPedidos.size()+"");

		try {
			FileWriter fw = new FileWriter("C:/Users/User/Documents/Iteracion_4/files/2restaurantes.csv");

			fw.append("REPRESENTANTE").append(delim);
			fw.append("TIPO_COMIDA").append(delim);
			fw.append("PAGINA_WEB").append(delim);
			fw.append("NOMBRE_USUARIO").append(NEXT_LINE);

			for(int i=0;i<restaurantes.size();i++)
			{
				fw.append(restaurantes.get(i).getRepresentante());
				fw.append(delim);
				fw.append(restaurantes.get(i).getTipo_comida());
				fw.append(delim);
				fw.append(restaurantes.get(i).getPagina_web());
				fw.append(delim);
				fw.append(restaurantes.get(i).getNombre());
				fw.append(NEXT_LINE);
			}

			fw.flush();
			fw.close();
		} catch (IOException e) {
			// Error al crear el archivo, por ejemplo, el archivo
			// está actualmente abierto.
			e.printStackTrace();
		}

		try {
			FileWriter fw = new FileWriter("C:/Users/User/Documents/Iteracion_4/files/1usuarios.csv");

			fw.append("NOMBRE").append(delim);
			fw.append("IDENTIFICACION").append(delim);
			fw.append("ROL").append(delim);
			fw.append("CORREO_ELECTRONICO").append(NEXT_LINE);

			for(int i=0;i<usuarios.size();i++)
			{
				fw.append(usuarios.get(i).getNombre());
				fw.append(delim);
				fw.append(usuarios.get(i).getIdentificacion()+"");
				fw.append(delim);
				fw.append(usuarios.get(i).getRol());
				fw.append(delim);
				fw.append(usuarios.get(i).getCorreo_electronico());
				fw.append(NEXT_LINE);
			}

			fw.flush();
			fw.close();
		} catch (IOException e) {
			// Error al crear el archivo, por ejemplo, el archivo
			// está actualmente abierto.
			e.printStackTrace();
		}

		try {
			FileWriter fw = new FileWriter("C:/Users/User/Documents/Iteracion_4/files/3clientes.csv");

			fw.append("ID").append(delim);
			fw.append("NOMBRE_USUARIO").append(NEXT_LINE);

			for(int i=0;i<clientes.size();i++)
			{
				fw.append(clientes.get(i).getId()+"");
				fw.append(delim);
				fw.append(clientes.get(i).getNombre()+"");
				fw.append(NEXT_LINE);
			}

			fw.flush();
			fw.close();
		} catch (IOException e) {
			// Error al crear el archivo, por ejemplo, el archivo
			// está actualmente abierto.
			e.printStackTrace();
		}

		try {
			FileWriter fw = new FileWriter("C:/Users/User/Documents/Iteracion_4/files/4productos.csv");

			fw.append("NOMBRE").append(delim);
			fw.append("DESCRIPCION").append(delim);
			fw.append("TRADUCCION").append(delim);
			fw.append("COSTO_PRODUCCION").append(delim);
			fw.append("PRECIO_VENTA").append(delim);
			fw.append("TIEMPO_PREPARACION").append(delim);
			fw.append("TIPO").append(NEXT_LINE);

			for(int i=0;i<productos.size();i++)
			{
				fw.append(productos.get(i).getNombre());
				fw.append(delim);
				fw.append(productos.get(i).getDescripcion());
				fw.append(delim);
				fw.append(productos.get(i).getTraduccion());
				fw.append(delim);
				fw.append(productos.get(i).getCosto_produccion()+"");
				fw.append(delim);
				fw.append(productos.get(i).getPrecio_venta()+"");
				fw.append(delim);
				fw.append(productos.get(i).getTiempo_preparacion()+"");
				fw.append(delim);
				fw.append(productos.get(i).getTipo()+"");
				fw.append(NEXT_LINE);
			}

			fw.flush();
			fw.close();
		} catch (IOException e) {
			// Error al crear el archivo, por ejemplo, el archivo
			// está actualmente abierto.
			e.printStackTrace();
		}

		try
		{
			FileWriter fw = new FileWriter("C:/Users/User/Documents/Iteracion_4/files/5restauranteproductos.csv");

			fw.append("REPRESENTANTE_RESTAURANTE").append(delim);
			fw.append("NOMBRE_PRODUCTO").append(delim);
			fw.append("CANTIDAD_MAXIMA").append(delim);
			fw.append("CANTIDAD_ACTUAL").append(NEXT_LINE);

			for(int i=0;i<restauranteProductos.size();i++)
			{
				fw.append(restauranteProductos.get(i).getRepresentante_restaurante());
				fw.append(delim);
				fw.append(restauranteProductos.get(i).getNombre_producto());
				fw.append(delim);
				fw.append(restauranteProductos.get(i).getCantidad_maxima()+"");
				fw.append(delim);
				fw.append(restauranteProductos.get(i).getCantidad_actual()+"");
				fw.append(NEXT_LINE);
			}

			fw.flush();
			fw.close();
		}
		catch (IOException e)
		{
			// Error al crear el archivo, por ejemplo, el archivo
			// está actualmente abierto.
			e.printStackTrace();
		}

		try
		{
			FileWriter fw = new FileWriter("C:/Users/User/Documents/Iteracion_4/files/6pedidos.csv");

			fw.append("ID").append(delim);
			fw.append("FECHA").append(delim);
			fw.append("HORA").append(delim);
			fw.append("ACEPTADO").append(delim);
			fw.append("NOMBRE_USUARIO").append(NEXT_LINE);

			for(int i=0;i<pedidos.size();i++)
			{
				fw.append(pedidos.get(i).getId()+"");
				fw.append(delim);
				int	dia = (int) (Math.random() * 27) + 1;
				int	mes = (int) (Math.random() * 12) + 1;
				int	anio = (int) (Math.random() *17 ) + 2000;

				String fechita=anio+"-"+mes+"-"+dia;
				int aceptado=(int) (Math.random() * 1);
				fw.append(fechita);
				fw.append(delim);
				fw.append(pedidos.get(i).getHora()+"");
				fw.append(delim);
				fw.append(aceptado+"");
				fw.append(delim);
				fw.append(pedidos.get(i).getNombre_usuario());
				fw.append(NEXT_LINE);
			}

			fw.flush();
			fw.close();
		}
		catch (IOException e)
		{
			// Error al crear el archivo, por ejemplo, el archivo
			// está actualmente abierto.
			e.printStackTrace();
		}

		try
		{
			FileWriter fw = new FileWriter("C:/Users/User/Documents/Iteracion_4/files/8servicios.csv");

			fw.append("ID_PEDIDO").append(delim);
			fw.append("NOMBRE_USUARIO").append(delim);
			fw.append("REPRESENTANTE_RESTAURANTE").append(NEXT_LINE);

			for(int i=0;i<servicios.size();i++)
			{
				fw.append(servicios.get(i).getId_pedido()+"");
				fw.append(delim);
				fw.append(servicios.get(i).getNombre_usuario());
				fw.append(delim);
				fw.append(servicios.get(i).getRepresentante_restaurante());
				fw.append(NEXT_LINE);
			}

			fw.flush();
			fw.close();
		}
		catch (IOException e)
		{
			// Error al crear el archivo, por ejemplo, el archivo
			// está actualmente abierto.
			e.printStackTrace();
		}

		try
		{
			FileWriter fw = new FileWriter("C:/Users/User/Documents/Iteracion_4/files/7productosPedidos.csv");

			fw.append("NOMBRE_PRODUCTO").append(delim);
			fw.append("ID_PEDIDO").append(NEXT_LINE);

			for(int i=0;i<productosPedidos.size();i++)
			{
				fw.append(productosPedidos.get(i).getNombre_producto());
				fw.append(delim);
				fw.append(productosPedidos.get(i).getId_pedido()+"");
				fw.append(NEXT_LINE);
			}

			fw.flush();
			fw.close();
		}
		catch (IOException e)
		{
			// Error al crear el archivo, por ejemplo, el archivo
			// está actualmente abierto.
			e.printStackTrace();
		}
	}

	@GET
	@Path("v2")
	public void getv2()
	{
		String delim=",";
		final String NEXT_LINE = "\n";
		PodamFactory factory = new PodamFactoryImpl();
		Long cantRestUsuCli=15000L;//15000
		Long cantProductos=25L;//25
		Long cantPedidosCliente=33L;//33
		Long cantPedidosUsuario=33L;//33
		Long cantMenus=20L;//20

		ArrayList<Restaurante> restaurantes= new ArrayList<>();
		ArrayList<Producto> productos= new ArrayList<>();
		ArrayList<RestauranteProducto> restauranteProductos= new ArrayList<>();
		ArrayList<Cliente> clientes= new ArrayList<>();
		ArrayList<Usuario> usuarios= new ArrayList<>();
		ArrayList<Pedido> pedidos= new ArrayList<>();
		ArrayList<Servicio> servicios= new ArrayList<>();
		ArrayList<ProductoPedido> productosPedidos= new ArrayList<>();
		ArrayList<Menu> menus = new ArrayList<>();
		ArrayList<MenuProducto> menusProductos=new ArrayList<>();

		for (long e = 0; e < cantProductos; e++)
		{
			Producto producto = factory.manufacturePojo(Producto.class);
			productos.add(producto);
		}

		for(long z=0;z<cantMenus;z++)
		{
			Menu menuu = factory.manufacturePojo(Menu.class);
			menus.add(menuu);
			MenuProducto menuProducto= new MenuProducto(menuu.getNombre(), productos.get((int)z).getNombre());
			menusProductos.add(menuProducto);
		}

		int contadorVueltaProductos=0;
		for (long i = 0; i < cantRestUsuCli; i++)
		{
			long syso=i%500;
			if(syso==0){System.out.println("Entrada No: "+i);}

			Restaurante restaurante = factory.manufacturePojo(Restaurante.class);
			restaurante.setRol("Restaurante");
			restaurantes.add(restaurante);
			usuarios.add(restaurante.darUsuario());

			for(int r=0;r<cantProductos;r++){
				if(contadorVueltaProductos==cantProductos)
				{
					contadorVueltaProductos=0;
				}
				int a = factory.manufacturePojo(Integer.class);
				int b = factory.manufacturePojo(Integer.class);
				int CantidadMaxima = 0;
				int CantidadActual = 0;
				if (a > b) {
					CantidadMaxima = a;
					CantidadActual = b;
				} else {
					CantidadMaxima = b;
					CantidadActual = a;
				}

				RestauranteProducto relacion = new RestauranteProducto(restaurante.getRepresentante(),
						productos.get(contadorVueltaProductos).getNombre(), CantidadMaxima, CantidadActual);
				restauranteProductos.add(relacion);

				contadorVueltaProductos++;

			}

			Cliente cliente = factory.manufacturePojo(Cliente.class);
			cliente.setRol("Cliente");
			clientes.add(cliente);
			usuarios.add(cliente.darUsuario());

			Cliente cliente2 = factory.manufacturePojo(Cliente.class);
			cliente2.setRol("Cliente");
			clientes.add(cliente2);
			usuarios.add(cliente2.darUsuario());

			int contadorCantProductos=0;
			for(int o=0;o<cantPedidosCliente;o++)
			{
				// pedidosCliente PEDIDOS pedidosCliente PEDIDOS pedidosCliente PEDIDOS pedidosCliente PEDIDOS pedidosCliente PEDIDOS
				Pedido pedido = factory.manufacturePojo(Pedido.class);
				pedido.setNombre_usuario(cliente.getNombre());
				pedidos.add(pedido);

				if(contadorCantProductos==productos.size())
				{
					contadorCantProductos=0;
				}
				String nombreProductoElejido=productos.get(contadorCantProductos).getNombre();
				ProductoPedido productoPedido=new ProductoPedido(nombreProductoElejido, pedido.getId());
				productosPedidos.add(productoPedido);
				contadorCantProductos++;

				Servicio servicio=new Servicio(pedido.getId(),cliente.getNombre(),restaurante.getRepresentante());
				servicios.add(servicio);
			}

			Usuario usuario = factory.manufacturePojo(Usuario.class);
			usuario.setRol("UsuarioNoRegistrado");
			usuarios.add(usuario);

			Usuario usuario2 = factory.manufacturePojo(Usuario.class);
			usuario2.setRol("UsuarioNoRegistrado");
			usuarios.add(usuario2);

			for(int o=0;o<cantPedidosUsuario;o++)
			{
				//pedidosUsuario PEDIDOS pedidosUsuario PEDIDOS pedidosUsuario PEDIDOS pedidosUsuario PEDIDOS pedidosUsuario PEDIDOS
				Pedido pedido = factory.manufacturePojo(Pedido.class);
				pedido.setNombre_usuario(usuario.getNombre());
				pedidos.add(pedido);
				if(contadorCantProductos==productos.size())
				{
					contadorCantProductos=0;
				}
				String nombreProductoElejido=productos.get(contadorCantProductos).getNombre();
				ProductoPedido productoPedido=new ProductoPedido(nombreProductoElejido, pedido.getId());
				productosPedidos.add(productoPedido);
				contadorCantProductos++;

				Servicio servicio=new Servicio(pedido.getId(),usuario.getNombre(),restaurante.getRepresentante());
				servicios.add(servicio);

			}
		}

		System.out.println("RESTAURANTES: "+restaurantes.size());
		System.out.println("PRODUCTOS: "+productos.size());
		System.out.println("RP: "+restauranteProductos.size()+"");
		System.out.println("CLIENTES: "+clientes.size()+"");
		System.out.println("USUARIOS: "+usuarios.size()+"");
		System.out.println("PEDIDOS: "+pedidos.size()+"");
		System.out.println("SERVICIOS: "+servicios.size()+"");
		System.out.println("PP: "+productosPedidos.size()+"");
		System.out.println("MENUS: "+menus.size()+"");
		System.out.println("MP: "+menusProductos.size()+"");

		try {
			FileWriter fw = new FileWriter("C:/Users/User/Documents/Iteracion_4/files/2restaurantes.csv");

			fw.append("REPRESENTANTE").append(delim);
			fw.append("TIPO_COMIDA").append(delim);
			fw.append("PAGINA_WEB").append(delim);
			fw.append("NOMBRE_USUARIO").append(NEXT_LINE);

			for(int i=0;i<restaurantes.size();i++)
			{
				fw.append(restaurantes.get(i).getRepresentante());
				fw.append(delim);
				fw.append(restaurantes.get(i).getTipo_comida());
				fw.append(delim);
				fw.append(restaurantes.get(i).getPagina_web());
				fw.append(delim);
				fw.append(restaurantes.get(i).getNombre());
				fw.append(NEXT_LINE);
			}

			fw.flush();
			fw.close();
		} catch (IOException e) {
			// Error al crear el archivo, por ejemplo, el archivo
			// está actualmente abierto.
			e.printStackTrace();
		}

		try {
			FileWriter fw = new FileWriter("C:/Users/User/Documents/Iteracion_4/files/1usuarios.csv");

			fw.append("NOMBRE").append(delim);
			fw.append("IDENTIFICACION").append(delim);
			fw.append("ROL").append(delim);
			fw.append("CORREO_ELECTRONICO").append(NEXT_LINE);

			for(int i=0;i<usuarios.size();i++)
			{
				fw.append(usuarios.get(i).getNombre());
				fw.append(delim);
				fw.append(usuarios.get(i).getIdentificacion()+"");
				fw.append(delim);
				fw.append(usuarios.get(i).getRol());
				fw.append(delim);
				fw.append(usuarios.get(i).getCorreo_electronico());
				fw.append(NEXT_LINE);
			}

			fw.flush();
			fw.close();
		} catch (IOException e) {
			// Error al crear el archivo, por ejemplo, el archivo
			// está actualmente abierto.
			e.printStackTrace();
		}

		try {
			FileWriter fw = new FileWriter("C:/Users/User/Documents/Iteracion_4/files/3clientes.csv");

			fw.append("ID").append(delim);
			fw.append("NOMBRE_USUARIO").append(NEXT_LINE);

			for(int i=0;i<clientes.size();i++)
			{
				fw.append(clientes.get(i).getId()+"");
				fw.append(delim);
				fw.append(clientes.get(i).getNombre()+"");
				fw.append(NEXT_LINE);
			}

			fw.flush();
			fw.close();
		} catch (IOException e) {
			// Error al crear el archivo, por ejemplo, el archivo
			// está actualmente abierto.
			e.printStackTrace();
		}

		try {
			FileWriter fw = new FileWriter("C:/Users/User/Documents/Iteracion_4/files/4productos.csv");

			fw.append("NOMBRE").append(delim);
			fw.append("DESCRIPCION").append(delim);
			fw.append("TRADUCCION").append(delim);
			fw.append("COSTO_PRODUCCION").append(delim);
			fw.append("PRECIO_VENTA").append(delim);
			fw.append("TIEMPO_PREPARACION").append(delim);
			fw.append("TIPO").append(NEXT_LINE);

			for(int i=0;i<productos.size();i++)
			{
				fw.append(productos.get(i).getNombre());
				fw.append(delim);
				fw.append(productos.get(i).getDescripcion());
				fw.append(delim);
				fw.append(productos.get(i).getTraduccion());
				fw.append(delim);
				fw.append(productos.get(i).getCosto_produccion()+"");
				fw.append(delim);
				fw.append(productos.get(i).getPrecio_venta()+"");
				fw.append(delim);
				fw.append(productos.get(i).getTiempo_preparacion()+"");
				fw.append(delim);
				fw.append(productos.get(i).getTipo()+"");
				fw.append(NEXT_LINE);
			}

			fw.flush();
			fw.close();
		} catch (IOException e) {
			// Error al crear el archivo, por ejemplo, el archivo
			// está actualmente abierto.
			e.printStackTrace();
		}

		try
		{
			FileWriter fw = new FileWriter("C:/Users/User/Documents/Iteracion_4/files/5restauranteproductos.csv");

			fw.append("REPRESENTANTE_RESTAURANTE").append(delim);
			fw.append("NOMBRE_PRODUCTO").append(delim);
			fw.append("CANTIDAD_MAXIMA").append(delim);
			fw.append("CANTIDAD_ACTUAL").append(NEXT_LINE);

			for(int i=0;i<restauranteProductos.size();i++)
			{
				fw.append(restauranteProductos.get(i).getRepresentante_restaurante());
				fw.append(delim);
				fw.append(restauranteProductos.get(i).getNombre_producto());
				fw.append(delim);
				fw.append(restauranteProductos.get(i).getCantidad_maxima()+"");
				fw.append(delim);
				fw.append(restauranteProductos.get(i).getCantidad_actual()+"");
				fw.append(NEXT_LINE);
			}

			fw.flush();
			fw.close();
		}
		catch (IOException e)
		{
			// Error al crear el archivo, por ejemplo, el archivo
			// está actualmente abierto.
			e.printStackTrace();
		}

		try
		{
			FileWriter fw = new FileWriter("C:/Users/User/Documents/Iteracion_4/files/6pedidos.csv");

			fw.append("ID").append(delim);
			fw.append("FECHA").append(delim);
			fw.append("HORA").append(delim);
			fw.append("ACEPTADO").append(delim);
			fw.append("NOMBRE_USUARIO").append(NEXT_LINE);

			for(int i=0;i<pedidos.size();i++)
			{
				fw.append(pedidos.get(i).getId()+"");
				fw.append(delim);
				int	dia = (int) (Math.random() * 27) + 1;
				int	mes = (int) (Math.random() * 12) + 1;
				int	anio = (int) (Math.random() *17 ) + 2000;

				String fechita=anio+"-"+mes+"-"+dia;
				int aceptado=(int) (Math.random() * 1);
				fw.append(fechita);
				fw.append(delim);
				fw.append(pedidos.get(i).getHora()+"");
				fw.append(delim);
				fw.append(aceptado+"");
				fw.append(delim);
				fw.append(pedidos.get(i).getNombre_usuario());
				fw.append(NEXT_LINE);
			}

			fw.flush();
			fw.close();
		}
		catch (IOException e)
		{
			// Error al crear el archivo, por ejemplo, el archivo
			// está actualmente abierto.
			e.printStackTrace();
		}

		try
		{
			FileWriter fw = new FileWriter("C:/Users/User/Documents/Iteracion_4/files/8servicios.csv");

			fw.append("ID_PEDIDO").append(delim);
			fw.append("NOMBRE_USUARIO").append(delim);
			fw.append("REPRESENTANTE_RESTAURANTE").append(NEXT_LINE);

			for(int i=0;i<servicios.size();i++)
			{
				fw.append(servicios.get(i).getId_pedido()+"");
				fw.append(delim);
				fw.append(servicios.get(i).getNombre_usuario());
				fw.append(delim);
				fw.append(servicios.get(i).getRepresentante_restaurante());
				fw.append(NEXT_LINE);
			}

			fw.flush();
			fw.close();
		}
		catch (IOException e)
		{
			// Error al crear el archivo, por ejemplo, el archivo
			// está actualmente abierto.
			e.printStackTrace();
		}

		try
		{
			FileWriter fw = new FileWriter("C:/Users/User/Documents/Iteracion_4/files/7productosPedidos.csv");

			fw.append("NOMBRE_PRODUCTO").append(delim);
			fw.append("ID_PEDIDO").append(NEXT_LINE);

			for(int i=0;i<productosPedidos.size();i++)
			{
				fw.append(productosPedidos.get(i).getNombre_producto());
				fw.append(delim);
				fw.append(productosPedidos.get(i).getId_pedido()+"");
				fw.append(NEXT_LINE);
			}

			fw.flush();
			fw.close();
		}
		catch (IOException e)
		{
			// Error al crear el archivo, por ejemplo, el archivo
			// está actualmente abierto.
			e.printStackTrace();
		}

		try
		{
			FileWriter fw = new FileWriter("C:/Users/User/Documents/Iteracion_4/files/9Menus.csv");

			fw.append("NOMBRE").append(delim);
			fw.append("COSTO_PRODUCCION").append(delim);
			fw.append("PRECIO_VENTA").append(NEXT_LINE);

			for(int i=0;i<menus.size();i++)
			{
				fw.append(menus.get(i).getNombre());
				fw.append(delim);
				fw.append(menus.get(i).getCosto_produccion()+"");
				fw.append(delim);
				fw.append(menus.get(i).getPrecio_venta()+"");
				fw.append(NEXT_LINE);
			}

			fw.flush();
			fw.close();
		}
		catch (IOException e)
		{
			// Error al crear el archivo, por ejemplo, el archivo
			// está actualmente abierto.
			e.printStackTrace();
		}

		try
		{
			FileWriter fw = new FileWriter("C:/Users/User/Documents/Iteracion_4/files/10MenusProductos.csv");

			fw.append("NOMBRE_MENU").append(delim);
			fw.append("NOMBRE_PRODUCTO").append(NEXT_LINE);

			for(int i=0;i<menusProductos.size();i++)
			{
				fw.append(menusProductos.get(i).getNombre_menu());
				fw.append(delim);
				fw.append(menusProductos.get(i).getNombre_producto());
				fw.append(NEXT_LINE);
			}

			fw.flush();
			fw.close();
		}
		catch (IOException e)
		{
			// Error al crear el archivo, por ejemplo, el archivo
			// está actualmente abierto.
			e.printStackTrace();
		}
	}

	@GET
	@Path("v3")
	@Produces({ MediaType.APPLICATION_JSON })
	public Response getClientes() {
		RotondAndesTM tm = new RotondAndesTM(getPath());
		PedidoProductosMesa ped;
		try {
			ped = tm.darPrueba();
		} catch (Exception e) {
			return Response.status(500).entity(doErrorMessage(e)).build();
		}
		return Response.status(200).entity(ped).build();
	}

	@POST
	@Consumes(MediaType.APPLICATION_JSON)
	@Produces(MediaType.APPLICATION_JSON)
	public Response addCliente(PedidoProductosMesa ped) {
		RotondAndesTM tm = new RotondAndesTM(getPath());
		try {
			tm.addPedidoMesa(ped);;
		} catch (Exception e) {
			return Response.status(500).entity(doErrorMessage(e)).build();
		}
		return Response.status(200).entity(ped).build();
	}
}


text:
<!DOCTYPE html>

<meta charset="utf-8">
<title>Content Visibility: shadow dom</title>
<link rel="author" title="Rakina Zata Amni" href="mailto:rakina@chromium.org">
<link rel="help" href="https://drafts.csswg.org/css-contain/#content-visibility">
<link rel="match" href="container-with-child-ref.html">
<meta name="assert" content="content-visibility hidden can be used in a shadow DOM">

    Text.

redpajama_set_name: RedPajamaGithub


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Aquatic Phycomycetes (Ann Arbor), Edn 2 1038 (1960)

#### Original name
Pythium middletonii Sparrow, 1960

### Remarks
null


text:
package phasereditor.inspect.core.jsdoc;

public class PhaserMethodArg extends PhaserVariable {

	public PhaserMethodArg() {
	}

}


text:
This doc has some guidelines on how to generate and contribute to this library.

## Generate the Library

The contents of this module are generated from the JSON Schemas defined in the source of truth repo:

https://github.com/googleapis/google-cloudevents

To generate this library, follow these steps:

### Setup

- Install the `qt` CLI globally from https://github.com/googleapis/google-cloudevents/tree/main/tools/quicktype-wrapper
- Clone the types source repo: `git clone git@github.com:googleapis/google-cloudevents.git`
- Clone this language repo: `git clone git@github.com:googleapis/google-cloudevents-nodejs.git --depth 1`

### Generate and Build

- Generate: In the root of this Node repo, run the script: `npm run gen`. This generates this library from JSON schemas.
- Build: In the root of this repo, run the script: `npm run build`. This compiles the TypeScript source.
- Your package should be ready to publish.

## Publish to npm

This module is automatically published by [Release Please](https://github.com/googleapis/release-please) when merging a generated release PR.
This PR is created from a GitHub Action that detects changes to the `main` branch.

Sometimes publishing does not work. To publish manually, Googlers can run the following commands:

```sh
npm run build
npm login --registry https://wombat-dressing-room.appspot.com
npm publish --registry https://wombat-dressing-room.appspot.com
```

### Conventional Commit Requirement

Only `feat` and `fix` or any commit that's breaking, as indicated by a `!`: `refactor!: foo` will trigger a release. Other commits will not trigger a PR from the bot.

See: https://www.conventionalcommits.org/en/v1.0.0/#summary

## How to Contribute

We'd love to accept your patches and contributions to this project. There are
just a few small guidelines you need to follow.

## Contributor License Agreement

Contributions to this project must be accompanied by a Contributor License
Agreement. You (or your employer) retain the copyright to your contribution;
this simply gives us permission to use and redistribute your contributions as
part of the project. Head over to <https://cla.developers.google.com/> to see
your current agreements on file or to sign a new one.

You generally only need to submit a CLA once, so if you've already submitted one
(even if it was for a different project), you probably don't need to do it
again.

## Code reviews

All submissions, including submissions by project members, require review. We
use GitHub pull requests for this purpose. Consult
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
information on using pull requests.

## Community Guidelines

This project follows [Google's Open Source Community
Guidelines](https://opensource.google/conduct/).


text:
<!DOCTYPE html>

	<title> correctness:   JSON.serialize() and large integers  </title>

FAILED (This TC requires JavaScript enabled)


text:
from pyVEP import test

test()


text:
import Ember from 'ember';

export default Ember.ArrayController.extend({
	isLoading: false,
	loadError: null,

	init: function() {
		this.get("unreadCount");
		this._super();
	},

	unreadCount: function() {
		var unreadItems = this.filter(function(item) {
			return !item.get("read");
		});

		return unreadItems.get("length");
	}.property("this.@each.read"),

	hasUnreadItems: function() {
		return (this.get("unreadCount") > 0);
	}.property("unreadCount"),

	unselectAllItems: function() {
		this.get("content").forEach(function(item) {
			if (item.get("isSelected")) {
				item.set("isSelected", false);
			}
		});
	},

	setSelectedItem: function(model) {
		if (Ember.isEqual(model, this.get("selectedItem"))) {
			return;
		}

		this.unselectAllItems();

		if (Ember.isNone(model)) {
			return;
		}

		model.set("isSelected", true);

		this.markItemRead(model);
	},

	selectedItem: function() {
		return this.filterProperty("isSelected").get("firstObject");
	}.property("@each.isSelected"),

	selectedItemIndex: function() {
		return this.indexOf(this.get("selectedItem"));
	}.property("selectedItem"),

	openUrl: function(url) {
		this.openUrlInBackground(url);
	},

	openUrlInBackground: function(url) {
		var a = document.createElement('a');
		// Target needed to work with links implementing anchors.
		a.target = '_blank';
		a.href = url;

		var evt = document.createEvent('MouseEvents');
		// <https://developer.mozilla.org/en/docs/DOM/event.initMouseEvent>
		evt.initMouseEvent('click', true, true, window, 0, 0, 0, 0, 0, true, false, false, false, 0, null);
		a.dispatchEvent(evt);
	},

	openSelectedItem: function() {
		this.openUrl(this.get("selectedItem.url"));
	},

	markItemRead: function(model) {
		if (Ember.isNone("model")) {
			return;
		}

		if (model.get("read")) {
			return;
		}

		this.api.markFeedItemRead(model);
	},

	markSelectedItemRead: function() {
		this.markItemRead(this.get("selectedItem"));
	},

	toggleItemStarred: function(model) {
		if (Ember.isNone(model)) {
			return;
		}

		this.api.updateFeedItem(model, { starred: !model.get("starred") });
	},

	saveItemToReadLater: function(model) {
		if (Ember.isNone(model)) {
			return;
		}

		if (model.get("read_later")) {
			return;
		}

		this.api.updateFeedItem(model, { read_later: true });
	},

	openItem: function(model) {
		if (Ember.isNone(model)) {
			return;
		}

		this.openUrl(model.get("url"));
	},

	toggleRead: function(model) {
		if (Ember.isNone(model)) {
			return;
		}

		this.api.updateFeedItem(model, { read: !model.get("read") });
	},

	actions: {
		doSelectNextItem: function() {
			if (Ember.isNone(this.get("selectedItem"))) {
				this.setSelectedItem(this.get("firstObject"));
				return;
			}

			var newIndex = Math.min((this.get("selectedItemIndex") + 1), (this.get("length") - 1));

			if (newIndex === this.get("selectedItemIndex")) {
				window.scrollTo(0, document.height);
			}

			this.setSelectedItem(this.objectAt(newIndex));
		},

		doSelectPreviousItem: function() {
			if (Ember.isNone(this.get("selectedItem"))) {
				this.setSelectedItem(this.get("lastObject"));
				return;
			}

			var newIndex = Math.max((this.get("selectedItemIndex") - 1), 0);

			if (newIndex === this.get("selectedItemIndex")) {
				window.scrollTo(0, 0);
			}

			this.setSelectedItem(this.objectAt(newIndex));
		},

		doSelectItem: function(model) {
			this.setSelectedItem(model);
		},

		doOpenItem: function(model) {
			this.openItem(model);
		},

		doOpenSelectedItem: function() {
			this.openItem(this.get("selectedItem"));
		},

		doSaveItemToReadLater: function(model) {
			this.saveItemToReadLater(model);
		},

		doSaveSelectedItemToReadLater: function() {
			this.saveItemToReadLater(this.get("selectedItem"));
		},

		doToggleItemStarred: function(model) {
			this.toggleItemStarred(model);
		},

		doToggleSelectedItemStarred: function() {
			this.toggleItemStarred(this.get("selectedItem"));
		},

		doToggleRead: function(model) {
			this.toggleRead(model);
		},

		doToggleSelectedItemRead: function() {
			this.toggleRead(this.get("selectedItem"));
		}
	}
});


text:
Antes de comenzar a trabajar, debe [instalar Visual Studio Code](https://go.microsoft.com/fwlink/?linkid=2016593). También debe [instalar Node.JS](https://go.microsoft.com/fwlink/?linkid=2016195), que incluye npm, lo cual le permitirá obtener Azure Functions Core Tools. Si prefiere no instalar Node, consulte las demás opciones de instalación en nuestra [referencia de Core Tools](https://go.microsoft.com/fwlink/?linkid=2016192).

Ejecute el siguiente comando para instalar el paquete de Core Tools:

``` npm install -g azure-functions-core-tools ```

Core Tools usa [.NET Core 2.1](https://go.microsoft.com/fwlink/?linkid=2016373), así que debería instalar también esta plataforma.

A continuación, [instale la extensión de Azure Functions para Visual Studio Code](https://go.microsoft.com/fwlink/?linkid=2016800). Una vez instalada la extensión, haga clic en el logotipo de Azure, en la barra de actividades. En **Azure: Functions**, haga clic en **Iniciar sesión en Azure...** y siga las instrucciones que aparecerán en pantalla.

# Creación de un proyecto de Azure Functions

Haga clic en el icono **Crear proyecto...**, en el panel **Azure: Functions**.

Se le pedirá que elija un directorio para la aplicación. Elija uno vacío.

A continuación, se le pedirá que seleccione un lenguaje para el proyecto. Elija {workerRuntime}.

# Creación de una función

Haga clic en el icono **Crear función…**, en el panel **Azure: Functions**.

Se le pedirá que elija una plantilla para la función. Para comenzar, le recomendamos el desencadenador HTTP.

# Ejecución del proyecto de función de forma local

Presione **F5** para ejecutar la aplicación de funciones.

El entorno de ejecución generará una dirección URL para las funciones HTTP que podrá copiar y ejecutar en la barra de direcciones del explorador.

Para detener la depuración, presione **Mayús + F5**.

# Implementación del código en Azure

Haga clic en el icono **Implementar en aplicación de funciones...** (flecha arriba azul), en el panel **Azure: Functions**.

Cuando se le pida seleccionar una aplicación de funciones, elija {functionAppName}.


text:
class FFGLPipeline {
public:
	FFGLPipeline() {
		m_sidmin = 0;
		m_sidmax = MAX_SESSIONID;
		m_vizserver = VizServer::GetServer();

	};

	bool do_ffgl_plugin(FFGLPluginInstance* plugin, int which); // which: 0 = first one, 1 = middle, 2 = last, 3 = one and only one, 4 none
	void doPipeline(int window_width, int window_height);
	FFGLPluginInstance* FFGLNewPluginInstance(FFGLPluginDef* plugin, std::string viztag);
	void paintTexture();
	void setSidrange(int sidmin, int sidmax);
	void setSpriteParams(std::string name);
	void applyAllPlugins(std::string meth, cJSON* params);
	void setEnableInput(bool onoff);

	void clearPluginlist() {
		DEBUGPRINT1(("FFGLPipeline.clear is called"));
		for (FFGLPluginList::iterator it = m_pluginlist.begin(); it != m_pluginlist.end(); it++) {
			DEBUGPRINT1(("--- deleteing FFGLPluginInstance *it=%ld", (long)(*it)));
			delete *it;
		}
		m_pluginlist.clear();
	}
	FFGLPluginInstance* find_plugin(std::string viztag, bool required = false) {
		for (FFGLPluginList::iterator it = m_pluginlist.begin(); it != m_pluginlist.end(); it++) {
			FFGLPluginInstance* p = *it;
			if (viztag == p->viztag()) {
				return *it;
			}
		}
		if (required) {
			throw VizException("There is no viztag '%s' in pipeline %s",viztag.c_str(),m_piname.c_str());
		}
		return NULL;
	}
	void delete_plugin(std::string viztag) {
		for (FFGLPluginList::iterator it = m_pluginlist.begin(); it != m_pluginlist.end();) {
			if (viztag == (*it)->viztag()) {
				// DEBUGPRINT1(("--- deleteing BB FFGLPluginInstance *it=%ld", (long)(*it)));
				delete *it;
				it = m_pluginlist.erase(it);
			}
			else {
				it++;
			}
		}
	}
	void append_plugin(FFGLPluginInstance* p) {
		m_pluginlist.insert(m_pluginlist.end(), p);
	}
	void shuffle() {
		size_t sz = m_pluginlist.size();
		// Just swap things randomly
		for (size_t n = 1; n < sz; n++) {
			if ((rand() % 2) == 0) {
				if (m_pluginlist[n - 1]->isMoveable() && m_pluginlist[n]->isMoveable()) {
					FFGLPluginInstance* t = m_pluginlist[n - 1];
					m_pluginlist[n - 1] = m_pluginlist[n];
					m_pluginlist[n] = t;
				}
			}
		}
	}
	void randomize() {
		size_t sz = m_pluginlist.size();
		// Just swap things randomly
		for (size_t n = 1; n < sz; n++) {
			int n1 = rand() % sz;
			int n2 = rand() % sz;
			if (n1 != n2) {
				if (m_pluginlist[n1]->isMoveable() && m_pluginlist[n2]->isMoveable()) {
					FFGLPluginInstance* t = m_pluginlist[n1];
					m_pluginlist[n1] = m_pluginlist[n2];
					m_pluginlist[n2] = t;
				}
			}
		}
	}
	void swap(int n1, int n2) {
		FFGLPluginInstance* t = m_pluginlist[n1];
		m_pluginlist[n1] = m_pluginlist[n2];
		m_pluginlist[n2] = t;
	}
	void moveplugin(std::string viztag, int places) {
		size_t sz = m_pluginlist.size();
		bool up = places < 0;
		if (up) {
			places = -places;
		}
		for (int t = 0; t < places; t++) {
			for (size_t n = 0; n < sz; n++) {
				if (viztag == m_pluginlist[n]->viztag()) {
					if (up) {
						if (n > 0) {
							swap(n - 1, n);
						}
					}
					else {
						if (n < (sz - 1)) {
							swap(n + 1, n);
						}
					}
					break;
				}
			}
		}
	}

	FFGLPluginInstance* newPluginInstance(FFGLPluginDef* plugin, std::string viztag) {
		FFGLPluginInstance* np = new FFGLPluginInstance(plugin, viztag);
		// DEBUGPRINT(("----- MALLOC new FFGLPluginInstance"));
		if (np->InstantiateGL(&fboViewport) != FF_SUCCESS) {
			delete np;
			throw VizException("Unable to InstantiateGL !?");
		}
		return np;
	}

	FFGLPluginInstance* addToPipeline(std::string pluginName, std::string viztag, bool enable, cJSON* params) {

		// See if this viztag is already used in the pipeline
		if (find_plugin(viztag) != NULL) {
			DEBUGPRINT(("Plugin with viztag '%s' already exists", viztag.c_str()));
			return NULL;
		}

		FFGLPluginDef* plugindef = findffglplugindef(pluginName);
		if (plugindef == NULL) {
			throw VizException("There is no plugin named '%s'", pluginName.c_str());
			// DEBUGPRINT(("There is no plugin named '%s'",pluginName.c_str()));
			// return NULL;
		}

		FFGLPluginInstance* np = newPluginInstance(plugindef, viztag);

		// If the plugin's first parameter is "viztag", set it
		int pnum = np->plugindef()->getParamNum("viztag");
		if (pnum >= 0) {
			np->setparam("viztag", viztag);
		}

		// Add it to the end of the pipeline
		append_plugin(np);

		if (params) {
			for (cJSON* pn = params->child; pn != NULL; pn = pn->next) {
				VizAssert(pn->type == cJSON_Object);
				std::string nm = jsonNeedString(pn, "name", "");
				if (nm == "") {
					throw VizException("Missing parameter name");
				}
				cJSON *t = cJSON_GetObjectItem(pn, "value");
				if (t == NULL) {
					throw VizException("Missing parameter value");
				}
				if (t->type == cJSON_String) {
					// In the saved pipeline json, it saves a "vtag" value which
					// is the viztag without the pipeline number prefix.
					if (nm == "vtag" || nm == "viztag") {
						// np->setparam("viztag", viztag);
					}
					else {
						np->setparam(nm, t->valuestring);
					}
				}
				else if (t->type == cJSON_Number) {
					np->setparam(nm, (float)(t->valuedouble));
				}
				else {
					throw VizException("addToPipeline unable to handle type=%d", t->type);
				}
			}
		}
		np->setEnable(enable);
		DEBUGPRINT1(("setEnable plugin=%s enable=%d", viztag.c_str(), enable));
		return np;
	}

	std::string pipelineList(bool only_list_enabled_plugins) {
		std::string r = "[";
		std::string sep = "";

		for (FFGLPluginList::iterator it = m_pluginlist.begin(); it != m_pluginlist.end(); it++) {
			FFGLPluginInstance* p = *it;

			bool isvizlet = m_vizserver->IsVizlet(p->viztag().c_str());

			std::string isviz;
			if (isvizlet) {
				isviz = std::string(" \"vizlet\": ") + (isvizlet ? "1" : "0") + ", ";
			}
			bool enabled = p->isEnabled();
			if (only_list_enabled_plugins == false || enabled == true) {
				r += (sep + "{ \"plugin\":\"" + p->plugindef()->GetPluginName() + "\","
					+ " \"viztag\":\"" + p->viztag() + "\", "
					+ isviz
					+ " \"moveable\": " + (p->isMoveable() ? "1" : "0") + ","
					+ " \"enabled\": " + (p->isEnabled() ? "1" : "0")
					+ "  }");
				sep = ", ";
			}
		}
		r = r + "]";
		return r;
	}

	void clear() {
		// Are we locked, here?
		m_name = "";
		clearPluginlist();
		if (m_piname != "") {
			m_vizserver->ClearJsonCallbacksWithPrefix(m_piname);
		}
	}

	void FFGLPipeline::CheckAutoload() {

		std::time_t throttle = 1;  // don't check more often than this number of seconds
		std::time_t tm = time(0);
		if ((tm - m_file_lastcheck) < throttle) {
			return;
		}

		std::string fpath = m_filepath;

		struct _stat statbuff;
		int e = _stat(fpath.c_str(), &statbuff);
		if (e != 0) {
			throw VizException("Error in _stat fpath=%s - e=%d", fpath.c_str(), e);
		}
		if (statbuff.st_mtime > m_file_lastupdate) {

			DEBUGPRINT(("Pipeline file %s was updated!  Reloading!", m_filepath.c_str()));

			load(m_piname, m_name, m_filepath);
			// Note: sidmin/sidmax remain unchanged
		}
	}

	void load(std::string piname, std::string name, std::string fpath) {

		std::string current_name = m_name;

		DEBUGPRINT(("Pipeline.load name=%s", name.c_str(), fpath.c_str()));
		bool exists = VizFileExists(fpath);
		cJSON* json;
		if (!exists) {
			// If it's a pipeline that doesn't exist,
			// make a copy of the current one
			if (VizFileExists(m_filepath)) {
				VizFileCopy(m_filepath, fpath);
			}
			else {
				throw VizException("No such file: fpath=%s", fpath.c_str());
			}
		}
		std::string err;
		json = jsonReadFile(fpath, err);
		if (!json) {
			throw VizException(err.c_str());
		}
		loadJson(piname, name, json);
		jsonFree(json);

		struct _stat statbuff;
		int e = _stat(fpath.c_str(), &statbuff);
		if (e != 0) {
			throw VizException("Error in _stat fpath=%s - e=%d", fpath.c_str(), e);
		}

		m_name = name;
		m_piname = piname;
		m_filepath = fpath;
		m_file_lastupdate = statbuff.st_mtime;
		m_file_lastcheck = statbuff.st_mtime;
		// setSidrange(sidmin, sidmax);
	}

	void loadJson(std::string piname, std::string name, cJSON* json) {

		clear();

		m_name = name;

		cJSON* plugins = jsonGetArray(json, "pipeline");
		if (!plugins) {
			throw VizException("No 'pipeline' value in config");
		}

		int nplugins = cJSON_GetArraySize(plugins);
		for (int n = 0; n < nplugins; n++) {
			cJSON *p = cJSON_GetArrayItem(plugins, n);
			VizAssert(p);
			if (p->type != cJSON_Object) {
				throw VizException("Hey! Item #%d in pipeline isn't an object?", n);
			}

			std::string plugintype = "ffgl";

			// allow plugin as an alias for ffglplugin.
			cJSON* plugin = jsonGetString(p, "plugin");
			if (!plugin) {
				plugin = jsonGetString(p, "ffglplugin");
			}

			if (plugin == NULL) {
				throw VizException("Hey! Item #%d in pipeline doesn't specify plugin?", n);
			}

			// If an explicit vtag (note, not viztag) isn't given, use plugin name
			const char* name = plugin->valuestring;
			std::string vtag = VizToLower(jsonNeedString(p, "vtag", name));
			std::string viztag = VizSnprintf("%s:%s", piname.c_str(), vtag.c_str());

			bool enabled = jsonNeedBool(p, "enabled", true);  // optional, default is 1 (true)
			bool moveable = jsonNeedBool(p, "moveable", true);  // optional, default is 1 (true)
			cJSON* params = jsonGetArray(p, "params");  // optional, params can be NULL

			// Default is to enable the plugin as soon as we added it, but you
			// can add an "enabled" value to change that.

			FFGLPluginInstance* pi = addToPipeline(name, viztag, enabled, params);
			if (!pi) {
				DEBUGPRINT(("Unable to add plugin=%s", name));
				continue;
			}
			pi->setMoveable(moveable);

			DEBUGPRINT1(("Pipeline, loaded plugin=%s viztag=%s", name, viztag.c_str()));

			cJSON* vizletdump = jsonGetArray(p, "vizletdump");
			if (vizletdump != NULL) {
				int nvals = cJSON_GetArraySize(vizletdump);
				for (int n = 0; n < nvals; n++) {
					cJSON *p = cJSON_GetArrayItem(vizletdump, n);
					VizAssert(p);
					if (p->type != cJSON_Object) {
						DEBUGPRINT(("non-Object in vizletdump array!?"));
						continue;
					}
					std::string meth = jsonNeedString(p, "method", "");
					cJSON* params = jsonGetObject(p, "params");
					if (!params) {
						throw VizException("No params value in vizletdump?");
					}
					DEBUGPRINT1(("Pipeline load meth=%s params=%s", meth.c_str(), cJSON_PrintUnformatted(params)));
					std::string fullmethod = VizSnprintf("%s:%s.%s", piname.c_str(), name, meth.c_str());
					const char* s = m_vizserver->ProcessJson(fullmethod.c_str(), params, "12345");
				}
			}

		}
	}

	VizServer* m_vizserver;
	FFGLPluginList m_pluginlist;

	std::string m_piname;
	std::string m_name;

	int m_sidmin;
	int m_sidmax;
	std::string m_spriteparams;		// name of file

	std::string m_filepath;
	std::time_t m_file_lastupdate;		// last mod time of filepath
	std::time_t m_file_lastcheck;		// last time it was checked

	FFGLViewportStruct fboViewport;
	FFGLTextureStruct m_texture;
	FFGLFBO fbo1;
	FFGLFBO fbo2;
	FFGLFBO* fbo_input;
	FFGLFBO* fbo_output;
};

#endif


text:
//acceptance tests
var request = require("request");
var util = require('util');
var assert = require('assert');

var baseUrl = "http://127.0.0.1:8001/";

/*
 * A very simple acceptance test. This test requires the server to be running (this is setup via the 'grunt accept' task)
 */
exports.it_should_test_hello_in_server = function(finish){
  request(baseUrl + 'beacons', function(err, response, body){
    assert.ok(!err, 'Unexpected error: ', util.inspect(err));
    assert.equal(response.statusCode, 200, 'Unexpected statusCode: ', response.statusCode + ' - ' + util.inspect(body));
    var data = JSON.parse(body);
    assert.equal(data["1"].label, 'iBeacon Label');
    return finish();
  });
};


text:
<?php
/*
|--------------------------------------------------------------------------
| script - Returns either a minified version of the scripts or all scripts
|--------------------------------------------------------------------------
*/
return array('html scripts' => function() {
	if(Input::get('debug') || Request::env() == 'development') {
		// If we are in development mode
		$scripts = "";
		// Loop through the files that are minified
		foreach(Config::get('scripts.files') as $file) {
			// Append the Path for the File
			$path = '/js/'.$file;
			// Add the Script tag for this file
			$scripts .= HTML::script($path);
		}
		// Return individual unminified versions into the head
		return $scripts;
	} else {
		// Return the minified version from S3
		return HTML::script(Config::get('scripts.s3'));
	}
});


text:
. ./env.sh
. ./clean.sh

go install epickrram.com/gochat/gochat


text:
<?php
/**
 * The template for displaying the footer.
 *
 * Contains the closing of the #content div and all content after
 *
 * @package activello
 */
?>

					<?php if( !get_theme_mod('footer_social') ) activello_social_icons(); ?>

						<?php activello_footer_info(); ?>

<?php wp_footer(); ?>


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="app_name">QuickOSC</string>
</resources>


text:
module Feather
  class Tags < Application
    include_plugin_views __FILE__

    def show(id)
      @tag = Tag.first(:conditions => {:name => id})
      display @tag
    end

    def index
      display @tags
    end
  end
end


text:
"use strict";

const Promise    = require( 'bluebird' );
const fs         = require( 'fs' );
const os         = require( 'os' );
const crypto     = require( 'crypto' );
const path       = require( 'path' );
const stream     = require( 'stream' );
const extend     = require( 'extend' );
const restify    = require( 'restify' );
const cookie     = require( 'cookie' );
const ModuleBase = require( '../Base' );
const mkdirp     = require( 'mkdirp' );
const mime       = require( 'mime' );

// Async mkdirp
const mkdirpAsync = Promise.promisify( mkdirp );
const fsStatAsync = Promise.promisify( fs.stat, { context: fs });

// Auto registry constants
const AUTO_REGISTRY = {
	'get': /^GET_(\S+)$/,
	'post': /^POST_(\S+)$/,
	'upload': /^UPLOAD_(\S+)$/
};

/**
 * Convert an item to an array
 * @param item The item to be converted to array
 */
function toArray( item ) {
	if ( !item )
		return [];
	else if ( Array.isArray( item ) )
		return item;
	return [item];
}

// Check for readable stream
function isReadableStream( obj ) {
	return ( obj.pipe && obj.on );
}
/**
 * Pipe an output to the stream
 */
function pipeStreamOutput( res, data ) {
	return new Promise(function( resolve, reject ) {
		data.pipe( res );
		data.on( 'error', reject );
		data.on( 'end',   resolve );
	});
}
/**
 * Write the data to the response
 */
function writeData( res, data ) {
	var statusCode = 200;
	var headers    = {};
	if ( data.$statusCode ) {
		statusCode = data.$statusCode;
		delete data.$statusCode;
	}
	if ( data.$cookies ) {
		const cookies = [];
		for ( let key in data.$cookies ) {
			let c = data.$cookies[ key ];
			if ( typeof( c ) === 'object' ) {
				cookies.push( cookie.serialize( key, c.value, c ) );
			} else if ( c === false ) {
				cookies.push( cookie.serialize( key, '', { expires: new Date(1) } ) );
			} else {
				cookies.push( cookie.serialize( key, c ) );
			}
		}
		headers['set-cookie'] = cookies;
		delete data.$cookies;
	}
	if ( data.$headers ) {
		for ( var key in data.$headers)
			headers[key.toLowerCase()] = data.$headers[key];
		delete data.$headers;
	}

	// Data is Buffer
	if ( Buffer.isBuffer( data ) ) {
		if ( data.contentType && ( typeof( headers['content-type'] ) === 'undefined' ) )
			headers['content-type'] = data.contentType;
		if ( ( typeof( headers['content-disposition'] ) === 'undefined' ) && data.filename )
			headers['content-disposition'] = `inline; filename=${path.basename(data.filename)}`;
		if ( typeof( headers['content-length'] === 'undefined' ) )
			headers['content-length'] = Buffer.byteLength( data );
		res.writeHead( statusCode, headers );
		res.write( data );
		res.end();
		return;
	} else if ( data instanceof fs.ReadStream ) {
		if ( mime && ( typeof(headers['content-type']) === 'undefined' ) )
			headers['content-type'] = mime.lookup( data.path );
		if ( ( typeof( headers['content-disposition'] ) === 'undefined' ) && data.path )
			headers['content-disposition'] = `inline; filename=${path.basename(data.path)}`;
		var promise = Promise.resolve();
		if ( typeof(headers['content-length']) === 'undefined' ) {
			promise = fsStatAsync( data.path )
				.then( function( stat ) {
					headers['content-length'] = stat.size;
				})
			;
		}
		return promise.then(function() {
			res.writeHead( statusCode, headers );
			return pipeStreamOutput( res, data );
		});
	} else if ( isReadableStream( data ) ) {
		if ( data.contentType && ( typeof( headers['content-type'] ) === 'undefined' ) )
			headers['content-type'] = data.contentType;
		if ( ( typeof( headers['content-length'] ) === 'undefined' ) && data.length )
			headers['content-length'] = data.length;
		if ( ( typeof( headers['content-disposition'] ) === 'undefined' ) && data.filename )
			headers['content-disposition'] = `inline; filename=${path.basename(data.filename)}`;
		res.writeHead( statusCode, headers );
		return pipeStreamOutput( res, data );
	}

	data = JSON.stringify( data );
	if ( typeof( headers['content-type'] ) === 'undefined' )
		headers['content-type'] = 'application/json';
	if ( typeof( headers['content-length'] ) === 'undefined' )
		headers['content-length'] = data.length;
	res.writeHead( statusCode, headers );
	res.write( data );
	res.end();
}
/**
 * Wrap the handler
 * @param parent The parent
 * @param handler The handler to be wrapped
 */
function wrapHandler( parent, handler ) {
	return function( req, res, next ) {
		Promise.try( handler.bind( null, req, res ) )
			.then(function( data ) {
				if ( ( typeof(data) === 'undefined' ) || ( data === false ) )
					return undefined;
				return writeData( res, data );
			}).catch(function( reason ) {
				if ( parent )
					parent.logger.error( reason );
				return Promise.reject( reason );
			}).asCallback( next )
		;
	};
}

/**
 * Parse cookies function
 */
function parseCookies( req, res, next ) {
	var cookieHeader = req.headers.cookie;
	if ( cookieHeader ) {
		req.cookies = cookie.parse( cookieHeader );
	} else {
		req.cookies = {};
	}
	next();
}

/**
 * Extented module for REST
 *
 * Only delegates the method to its parent by using
 * the prepended route
 */
class RESTExtended {
	constructor( parent, route ) {
		this.parent_    = parent;
		this.baseRoute_ = toArray( route );
	}
	get( route, handler ) {
		this.parent_.get( this.baseRoute_.concat( toArray( route ) ), handler );
		return this;
	}
	post( route, handler, options ) {
		this.parent_.post( this.baseRoute_.concat( toArray( route ) ), handler, options );
		return this;
	}
	upload( route, handler, options ) {
		this.parent_.upload( this.baseRoute_.concat( toArray( route ) ), handler, options );
		return this;
	}
	autoRegister( obj, thisObj, options ) {
		options      = extend( {}, options );
		options.base = this.baseRoute_.concat( toArray( options.base ) );
		this.parent_.autoRegister( obj, thisObj, options );
	}
	extend( route ) {
		return new RESTExtended( this, route );
	}
}

/**
 * REST module
 */
class REST extends ModuleBase {
	/**
	 * Construct the REST module
	 */
	constructor( parent, options ) {
		options = extend({}, options);
		if ( !options.listen )
			options.listen = 8000;
		if ( !options.upload )
			options.upload = path.join( os.tmpdir(), `REST-${crypto.randomBytes(20).toString( 'hex' )}` );
		super( parent, options );

		// Base route for this server
		this._baseRoute = ['/'].concat( toArray( this.options.base ) );
	}
	/**
	 * Create a new server using the given options
	 */
	_createServer() {
		var serverOptions = {};
		serverOptions.log = this.logger;
		if ( this.options.https )
			serverOptions.httpsServerOptions = this.options.https;

		const server = restify.createServer( serverOptions );

		/*

		 */
		if ( this.options.audit === true ) {
			server.on( 'after', restify.auditLogger({ log: this.logger }) );
		} else if ( typeof(this.options.audit) === 'string' ) {
			const bunyan = require( 'bunyan' );
			const auditLogger = restify.auditLogger({
				log: bunyan.createLogger({
					name: (this.logger.fields ? this.logger.fields.name : false) || this.root.name,
					streams: [{ path: this.options.audit }]
				})
			});
			server.on( 'after', auditLogger );
		} else if ( this.options.audit ) {
			server.on( 'after', restify.auditLogger({ log: this.options.audit }) );
		}

		// Use some headers
		server.use( parseCookies );
		server.use( restify.queryParser() );
		if ( this.options.CORS ) {
			var corsOptions;
			if ( typeof(this.options.CORS) === 'object' )
				corsOptions = this.options.CORS;
			server.use( restify.CORS( corsOptions ) );
		}

		return server;
	}
	/**
	 * Setup the module
	 */
	moduleSetup() {
		var options = this.options;
		this._server = this._createServer();
		const listen = Promise.promisify( this._server.listen, { context: this._server } );
		return mkdirpAsync( options.upload )
			.then(function() { return listen( options.listen ); })
		;
	}
	/**
	 * Close the module
	 */
	moduleClose() {
		if ( this._server ) {
			this._server.close();
			this._server = null;
		}
	}
	/**
	 * Normalize the route before passing to the route method
	 */
	normalizeRoute( route ) {
		route = this._baseRoute.concat( toArray( route ) );
		return path.resolve.apply( path, route );
	}
	/**
	 * Normalize the handler for the methods
	 */
	normalizeHandler( handler ) {
		if ( Array.isArray( handler ) )
			return handler.map( wrapHandler.bind( null, this ) );
		return [ wrapHandler( this, handler ) ];
	}
	/**
	 * GET a route
	 */
	get( route, handler ) {
		route   = this.normalizeRoute( route );
		handler = this.normalizeHandler( handler );
		this.logger.info({ route: route, method: 'GET' }, `Registering GET on "${route}"`);
		if ( route )
			this._server.get( route, handler );
		else
			this._server.get( handler );
	}
	/**
	 * POST a route
	 */
	post( route, handler, options ) {
		route   = this.normalizeRoute( route );
		handler = this.normalizeHandler( handler );

		var preHandlers = [];
		preHandlers = preHandlers.concat( toArray( restify.jsonBodyParser() ) );
		preHandlers = preHandlers.concat( toArray( restify.urlEncodedBodyParser({ bodyReader: true }) ) );

		handler = preHandlers.concat( handler );

		this.logger.info({ route: route, method: 'POST' }, `Registering POST on "${route}"`);
		if ( route )
			this._server.post( route, handler );
		else
			this._server.post( handler );
	}
	/**
	 * A POST route with upload options
	 * @param route The route
	 */
	upload( route, handler, options ) {
		options = options || {};

		route   = this.normalizeRoute( route );
		handler = this.normalizeHandler( handler );

		var bodyParserOptions = {
			uploadDir: options.upload || this.options.upload
		};

		var preHandlers = toArray( restify.bodyParser( bodyParserOptions ) );
		handler = preHandlers.concat( handler );

		this.logger.info({ route: route, method: 'UPLOAD' }, `Registering POST with UPLOAD on "${route}"` );
		if ( route )
			this._server.post( route, handler );
		else
			this._server.post( handler );
	}
	/**
	 * Auto register an object
	 * @param {string} name The name of the function
	 * @param {function} fn The function for the given route
	 * @param {object} options The options for the name object
	 * @param {Array|string} baseRoute The base route for the route
	 */
	autoRegister( obj, thisObj, options ) {
		options = options || {};
		const baseRoute = toArray( options.base );

		const self = this;
		Object.getOwnPropertyNames( obj ).forEach(function( name ) {
			const fn = obj[name];
			if ( typeof(fn) !== 'function' )
				return;
			if ( options.check ) {
				var newName = options.check( name, fn );
				if ( !newName )
					return;
				else if ( typeof(newName) === 'string' )
					name = newName;
			}

			for ( var method in AUTO_REGISTRY ) {
				var match = name.match( AUTO_REGISTRY[method] );
				if ( match ) {
					var split      = match[1].split( /(?=[A-Z])/ ).map(function( s ) { return s.toLowerCase(); });
					var registerFn = fn.bind( thisObj );
					if ( options.wrap )
						registerFn = options.wrap( registerFn, fn );
					self[method].call( self, baseRoute.concat( split ), registerFn );
					break;
				}
			}
		});
	}
	/**
	 * Extend the route
	 */
	extend( route ) {
		return new RESTExtended( this, route );
	}
};

// Exports module
module.exports = REST;


text:
{% extends "broadcaster/base.html" %}
{% load broadcastertags %}

{% block title %}Meteography - Ciel fastueux{% endblock %}

{% block body %}

Meteography

        This is a meteographer. Maybe you have seen your grandfather look at the
        horizon and tell you what the weather will be the day after?
        That is what Meteography is: using a stream of photos from a fixed webcam
        to predict what the sky will be like in the near future.
        It does not forecast the weather in terms of temperature, wind, rain, etc.
        but rather generate an image picturing what the webcam should capture later.

        This is a project originally started to learn about machine learning, it is
        still in early development phase. The source code is available on
        Github.

List of cameras

    {% if webcams %}

        {% for webcam in webcams %}

              {% latest_prediction webcam %}

        {% endfor %}

    {% else %}

No webcam available.

    {% endif %}

{% endblock %}


text:
cmd_start="meguro -b -n 100000000 -a 8G -x 1G -t 4"
outdir="output"
input=$1
[ ! $input ] && echo "Usage" && exit 1

outname=$outdir/`basename $input .tch`

echo "Output will go to $outname.*"

echo "Initial map/reduce from raw Wikipedia parse tree"
$cmd_start -j graph_from_wpt_phase1.js -m $outname.map.tch -r $outname.red.tch $input || exit 1

if [ 1 -eq 1 ]; then
echo "Map on the reduced file above to get just redirects"
$cmd_start -j phase1_to_redirects.js -m $outname.redirects.tch $outname.red.tch || exit 1

echo "Map on redirects.tch to get a file of ultimate redirects (so all values are canonical), using redirects as dictionary"
$cmd_start -j redirects_to_ultimate_redirects.js -d $outname.redirects.tch -m $outname.ultimate_redirects.tch $outname.redirects.tch || exit 1

echo "Map on phase 1 output using ultimate_redirects as a dictionary to get a set of pipe-delimited outlinks for each key"
$cmd_start -j phase1_to_outlinks.js -d $outname.ultimate_redirects.tch -m $outname.outlinks.tch $outname.red.tch || exit 1

echo "$outname.outlinks.tch is ready to be used in the C distance calculator"
#../../c/wikipedia/bin/gcc-4.3.0/release/wikipedia_indexer -t tokyo -y tokyo -i $outname.outlinks.tch -s -e 50 -o $outname.distances.tch || exit 1
#X/home/curtis/code/smallworld/src/c/wikipedia/bin/gcc-4.4.4/debug/wikipedia_indexer -t tokyo -y tokyo -i $outname.outlinks.tch -s -e 50 -o $outname.distances.tch || exit 1

echo "Map/reduce on original map, using ultimate_redirects as dictionary, to get a Relationship Graph formatted tch with all edges canonically named"
$cmd_start -j phase1_to_canonicalized_graph_format.js -d $outname.ultimate_redirects.tch -m $outname.map2.tch -r $outname.red2.tch $outname.red.tch || exit 1

echo "Now can map on canon_graph, with distances as dictionary, to get final graph"
$cmd_start -j fill_in_distances_to_graph.js -d $outname.distances.tch -m $outname.final_graph.tch $outname.red2.tch || exit 1

else
echo "Map/reduce on original map, using ultimate_redirects as dictionary, to get a Relationship Graph formatted tch with all edges canonically named"
$cmd_start -j phase1_to_canonicalized_graph_format.js -d $outname.ultimate_redirects.tch -m $outname.map2.tch -r $outname.red2.tch $outname.red.tch || exit 1
fi


text:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

  <title>delete (Test::Unit::TestSuiteAdapter)</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />

# File lib/spec/interop/test/unit/testsuite_adapter.rb, line 24
      def delete(example)
        examples.delete example
      end


text:
0.20.0 / 2015-06-19
-------------------
- removed `jsonfile` aliases with `File` in the name, they weren't documented and probably weren't in use e.g.
this package had both `fs.readJsonFile` and `fs.readJson` that were aliases to each other, now use `fs.readJson`.
- preliminary walker created. Intentionally not documented. If you use it, it will almost certainly change and break your code.
- started moving tests inline
- upgraded to `jsonfile@2.1.0`, can now pass JSON revivers/replacers to `readJson()`, `writeJson()`, `outputJson()`

0.19.0 / 2015-06-08
-------------------
- `fs.copy()` had support for Node v0.8, dropped support

0.18.4 / 2015-05-22
-------------------
- fixed license field according to this: https://github.com/jprichardson/node-fs-extra/pull/136 and https://github.com/npm/npm/releases/tag/v2.10.0

0.18.3 / 2015-05-08
-------------------
- bugfix: handle `EEXIST` when clobbering on some Linux systems. https://github.com/jprichardson/node-fs-extra/pull/134

0.18.2 / 2015-04-17
-------------------
- bugfix: allow `F_OK` (https://github.com/jprichardson/node-fs-extra/issues/120)

0.18.1 / 2015-04-15
-------------------
- improved windows support for `move()` a bit. https://github.com/jprichardson/node-fs-extra/commit/92838980f25dc2ee4ec46b43ee14d3c4a1d30c1b
- fixed a lot of tests for Windows (appveyor)

0.18.0 / 2015-03-31
-------------------
- added `emptyDir()` and `emptyDirSync()`

0.17.0 / 2015-03-28
-------------------
- `copySync` added `clobber` option (before always would clobber, now if `clobber` is `false` it throws an error if the destination exists).
**Only works with files at the moment.**
- `createOutputStream()` added. See: https://github.com/jprichardson/node-fs-extra/pull/118

0.16.5 / 2015-03-08
-------------------
- fixed `fs.move` when `clobber` is `true` and destination is a directory, it should clobber. https://github.com/jprichardson/node-fs-extra/issues/114

0.16.4 / 2015-03-01
-------------------
- `fs.mkdirs` fix infinite loop on Windows. See: See https://github.com/substack/node-mkdirp/pull/74 and https://github.com/substack/node-mkdirp/issues/66

0.16.3 / 2015-01-28
-------------------
- reverted https://github.com/jprichardson/node-fs-extra/commit/1ee77c8a805eba5b99382a2591ff99667847c9c9

0.16.2 / 2015-01-28
-------------------
- fixed `fs.copy` for Node v0.8 (support is temporary and will be removed in the near future)

0.16.1 / 2015-01-28
-------------------
- if `setImmediate` is not available, fall back to `process.nextTick`

0.16.0 / 2015-01-28
-------------------
- bugfix `fs.move()` into itself. Closes #104
- bugfix `fs.move()` moving directory across device. Closes #108
- added coveralls support
- bugfix: nasty multiple callback `fs.copy()` bug. Closes #98
- misc fs.copy code cleanups

0.15.0 / 2015-01-21
-------------------
- dropped `ncp`, imported code in
- because of previous, now supports `io.js`
- `graceful-fs` is now a dependency

0.14.0 / 2015-01-05
-------------------
- changed `copy`/`copySync` from `fs.copy(src, dest, [filters], callback)` to `fs.copy(src, dest, [options], callback)` https://github.com/jprichardson/node-fs-extra/pull/100
- removed mockfs tests for mkdirp (this may be temporary, but was getting in the way of other tests)

0.13.0 / 2014-12-10
-------------------
- removed `touch` and `touchSync` methods (they didn't handle permissions like UNIX touch)
- updated `"ncp": "^0.6.0"` to `"ncp": "^1.0.1"`
- imported `mkdirp` => `minimist` and `mkdirp` are no longer dependences, should now appease people who wanted `mkdirp` to be `--use_strict` safe. See [#59](https://github.com/jprichardson/node-fs-extra/issues/59)

0.12.0 / 2014-09-22
-------------------
- copy symlinks in `copySync()` [#85](https://github.com/jprichardson/node-fs-extra/pull/85)

0.11.1 / 2014-09-02
-------------------
- bugfix `copySync()` preserve file permissions [#80](https://github.com/jprichardson/node-fs-extra/pull/80)

0.11.0 / 2014-08-11
-------------------
- upgraded `"ncp": "^0.5.1"` to `"ncp": "^0.6.0"`
- upgrade `jsonfile": "^1.2.0"` to `jsonfile": "^2.0.0"` => on write, json files now have `\n` at end. Also adds `options.throws` to `readJsonSync()`
see https://github.com/jprichardson/node-jsonfile#readfilesyncfilename-options for more details.

0.10.0 / 2014-06-29
------------------
* bugfix: upgaded `"jsonfile": "~1.1.0"` to `"jsonfile": "^1.2.0"`, bumped minor because of `jsonfile` dep change
from `~` to `^`. #67

0.9.1 / 2014-05-22
------------------
* removed Node.js `0.8.x` support, `0.9.0` was published moments ago and should have been done there

0.9.0 / 2014-05-22
------------------
* upgraded `ncp` from `~0.4.2` to `^0.5.1`, #58
* upgraded `rimraf` from `~2.2.6` to `^2.2.8`
* upgraded `mkdirp` from `0.3.x` to `^0.5.0`
* added methods `ensureFile()`, `ensureFileSync()`
* added methods `ensureDir()`, `ensureDirSync()` #31
* added `move()` method. From: https://github.com/andrewrk/node-mv

0.8.1 / 2013-10-24
------------------
* copy failed to return an error to the callback if a file doesn't exist (ulikoehler #38, #39)

0.8.0 / 2013-10-14
------------------
* `filter` implemented on `copy()` and `copySync()`. (Srirangan / #36)

0.7.1 / 2013-10-12
------------------
* `copySync()` implemented (Srirangan / #33)
* updated to the latest `jsonfile` version `1.1.0` which gives `options` params for the JSON methods. Closes #32

0.7.0 / 2013-10-07
------------------
* update readme conventions
* `copy()` now works if destination directory does not exist. Closes #29

0.6.4 / 2013-09-05
------------------
* changed `homepage` field in package.json to remove NPM warning

0.6.3 / 2013-06-28
------------------
* changed JSON spacing default from `4` to `2` to follow Node conventions
* updated `jsonfile` dep
* updated `rimraf` dep

0.6.2 / 2013-06-28
------------------
* added .npmignore, #25

0.6.1 / 2013-05-14
------------------
* modified for `strict` mode, closes #24
* added `outputJson()/outputJsonSync()`, closes #23

0.6.0 / 2013-03-18
------------------
* removed node 0.6 support
* added node 0.10 support
* upgraded to latest `ncp` and `rimraf`.
* optional `graceful-fs` support. Closes #17

0.5.0 / 2013-02-03
------------------
* Removed `readTextFile`.
* Renamed `readJSONFile` to `readJSON` and `readJson`, same with write.
* Restructured documentation a bit. Added roadmap.

0.4.0 / 2013-01-28
------------------
* Set default spaces in `jsonfile` from 4 to 2.
* Updated `testutil` deps for tests.
* Renamed `touch()` to `createFile()`
* Added `outputFile()` and `outputFileSync()`
* Changed creation of testing diretories so the /tmp dir is not littered.
* Added `readTextFile()` and `readTextFileSync()`.

0.3.2 / 2012-11-01
------------------
* Added `touch()` and `touchSync()` methods.

0.3.1 / 2012-10-11
------------------
* Fixed some stray globals.

0.3.0 / 2012-10-09
------------------
* Removed all CoffeeScript from tests.
* Renamed `mkdir` to `mkdirs`/`mkdirp`.

0.2.1 / 2012-09-11
------------------
* Updated `rimraf` dep.

0.2.0 / 2012-09-10
------------------
* Rewrote module into JavaScript. (Must still rewrite tests into JavaScript)
* Added all methods of [jsonfile][https://github.com/jprichardson/node-jsonfile]
* Added Travis-CI.

0.1.3 / 2012-08-13
------------------
* Added method `readJSONFile`.

0.1.2 / 2012-06-15
------------------
* Bug fix: `deleteSync()` didn't exist.
* Verified Node v0.8 compatibility.

0.1.1 / 2012-06-15
------------------
* Fixed bug in `remove()`/`delete()` that wouldn't execute the function if a callback wasn't passed.

0.1.0 / 2012-05-31
------------------
* Renamed `copyFile()` to `copy()`. `copy()` can now copy directories (recursively) too.
* Renamed `rmrf()` to `remove()`.
* `remove()` aliased with `delete()`.
* Added `mkdirp` capabilities. Named: `mkdir()`. Hides Node.js native `mkdir()`.
* Instead of exporting the native `fs` module with new functions, I now copy over the native methods to a new object and export that instead.

0.0.4 / 2012-03-14
------------------
* Removed CoffeeScript dependency

0.0.3 / 2012-01-11
------------------
* Added methods rmrf and rmrfSync
* Moved tests from Jasmine to Mocha


text:
include(CheckFunctionExists)
include(CheckIncludeFile)
include(CheckIncludeFiles)
include(CheckSymbolExists)

if (Inttypes_FOUND)
  # This allows the inttypes.h and stdint.h checks to succeed on platforms that
  # do not natively provide there.
  set (CMAKE_REQUIRED_INCLUDES ${INTTYPES_INCLUDE_DIRS})
endif ()

check_include_file(arpa/inet.h HAVE_ARPA_INET_H)
check_include_file(fcntl.h HAVE_FCNTL_H)
check_include_file(getopt.h HAVE_GETOPT_H)
check_include_file(inttypes.h HAVE_INTTYPES_H)
check_include_file(netdb.h HAVE_NETDB_H)
check_include_file(netinet/in.h HAVE_NETINET_IN_H)
check_include_file(signal.h HAVE_SIGNAL_H)
check_include_file(stdint.h HAVE_STDINT_H)
check_include_file(unistd.h HAVE_UNISTD_H)
check_include_file(pthread.h HAVE_PTHREAD_H)
check_include_file(sys/ioctl.h HAVE_SYS_IOCTL_H)
check_include_file(sys/param.h HAVE_SYS_PARAM_H)
check_include_file(sys/resource.h HAVE_SYS_RESOURCE_H)
check_include_file(sys/socket.h HAVE_SYS_SOCKET_H)
check_include_file(sys/stat.h HAVE_SYS_STAT_H)
check_include_file(sys/time.h HAVE_SYS_TIME_H)
check_include_file(sys/un.h HAVE_SYS_UN_H)
check_include_file(sys/poll.h HAVE_SYS_POLL_H)
check_include_file(sys/select.h HAVE_SYS_SELECT_H)
check_include_file(sched.h HAVE_SCHED_H)
check_include_file(string.h HAVE_STRING_H)
check_include_file(strings.h HAVE_STRINGS_H)

check_function_exists(gethostbyname HAVE_GETHOSTBYNAME)
check_function_exists(gethostbyname_r HAVE_GETHOSTBYNAME_R)
check_function_exists(strerror_r HAVE_STRERROR_R)
check_function_exists(sched_get_priority_max HAVE_SCHED_GET_PRIORITY_MAX)
check_function_exists(sched_get_priority_min HAVE_SCHED_GET_PRIORITY_MIN)

include(CheckCSourceCompiles)
include(CheckCXXSourceCompiles)

check_cxx_source_compiles(
  "
  #include <string.h>
  int main(){char b;char *a = strerror_r(0, &b, 0); return(0);}
  "
  STRERROR_R_CHAR_P)

set(PACKAGE ${PACKAGE_NAME})
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
set(VERSION ${thrift_VERSION})

# generate a config.h file
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/build/cmake/config.h.in" "${CMAKE_CURRENT_BINARY_DIR}/thrift/config.h")

include_directories("${CMAKE_CURRENT_BINARY_DIR}")


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package caillou.company.clonemanager.background.bean.applicationFile.comparator.impl;

import caillou.company.clonemanager.background.bean.applicationFile.contract.ApplicationFile;
import java.util.Comparator;

/**
 *
 * @author pierre
 */
public class MD5Comparator implements Comparator<ApplicationFile>{

    @Override
    public int compare(ApplicationFile o1, ApplicationFile o2) {
        if(o1.getMD5Print() == null && o2.getMD5Print() == null){
            return 0;
        }if(o1.getMD5Print() != null && o2.getMD5Print() == null){
            return -1;
        }if(o1.getMD5Print() == null && o2.getMD5Print() != null){
            return 1;
        }else{
            return o1.getMD5Print().compareTo(o2.getMD5Print());
        }
    }

}


text:
package com.badr.infodota.base.util;

/**
 * Created by ABadretdinov
 * 14.04.2015
 * 11:54
 */
public interface Refresher {
    void onRefresh();
}


text:
<?php

namespace Illuminate\Foundation\Testing\Concerns;

use Closure;
use Mockery;

trait InteractsWithContainer
{
    /**
     * Register an instance of an object in the container.
     *
     * @param  string  $abstract
     * @param  object  $instance
     * @return object
     */
    protected function swap($abstract, $instance)
    {
        return $this->instance($abstract, $instance);
    }

    /**
     * Register an instance of an object in the container.
     *
     * @param  string  $abstract
     * @param  object  $instance
     * @return object
     */
    protected function instance($abstract, $instance)
    {
        $this->app->instance($abstract, $instance);

        return $instance;
    }

    /**
     * Mock an instance of an object in the container.
     *
     * @param  string  $abstract
     * @param  \Closure|null  $mock
     * @return object
     */
    protected function mock($abstract, Closure $mock = null)
    {
        return $this->instance($abstract, Mockery::mock(...array_filter(func_get_args())));
    }

    /**
     * Spy an instance of an object in the container.
     *
     * @param  string  $abstract
     * @param  \Closure|null  $mock
     * @return object
     */
    protected function spy($abstract, Closure $mock = null)
    {
        return $this->instance($abstract, Mockery::spy(...array_filter(func_get_args())));
    }
}


text:
package com.taobao.android.builder.tools.bundleinfo;

/**
 * DynamicBundleInfo
 *
 * @author zhayu.ll
 * @date 18/1/10
 * @time 下午4:51
 * @description
 */
public class DynamicBundleInfo {

    public String name;

    public String url;

    public Long size;

    public String md5;
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
    <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
    <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
        <group>
            <file>file:/C:/xampp/htdocs/symfony/src/AppBundle/Controller/DefaultController.php</file>
            <file>file:/C:/xampp/htdocs/symfony/src/AppBundle/AppBundle.php</file>
            <file>file:/C:/xampp/htdocs/symfony/vendor/doctrine/doctrine-cache-bundle/composer.json</file>
            <file>file:/C:/xampp/htdocs/symfony/app/AppKernel.php</file>
            <file>file:/C:/xampp/htdocs/symfony/app/config/config.yml</file>
            <file>file:/C:/xampp/htdocs/symfony/app/config/routing.yml</file>
            <file>file:/C:/xampp/htdocs/symfony/app/config/parameters.yml</file>
            <file>file:/C:/xampp/htdocs/symfony/web/app_dev.php</file>
            <file>file:/C:/xampp/htdocs/symfony/web/app.php</file>
            <file>file:/C:/xampp/htdocs/symfony/app/config/config_dev.yml</file>
            <file>file:/C:/xampp/htdocs/symfony/vendor/doctrine/doctrine-bundle/Command/GenerateEntitiesDoctrineCommand.php</file>
        </group>
    </open-files>
</project-private>


text:
#include "TiUIWebViewProxy.h"

namespace TiUI {

static QList<TiUIWebViewProxy*> webViews_;
QList<TiUIWebViewProxy*> TiUIWebViewProxy::getWebViewProxies()
{
	return webViews_;
}

TiUIWebViewProxy::TiUIWebViewProxy(const char* name) : Ti::TiViewProxy(name)
{
	createPropertySetterGetter("data", _setData,  _getData);
	createPropertySetterGetter("disableBounce", _setDisableBounce,  _getDisableBounce);
	createPropertySetterGetter("hideLoadIndicator", _setHideLoadIndicator,  _getHideLoadIndicator);
	createPropertySetterGetter("html", _setHtml,  _getHtml);
	createPropertySetterGetter("ignoreSslError", _setIgnoreSslError,  _getIgnoreSslError);
	createPropertySetterGetter("loading", _setLoading,  _getLoading);
	createPropertySetterGetter("overScrollMode", _setOverScrollMode,  _getOverScrollMode);
	createPropertySetterGetter("pluginState", _setPluginState,  _getPluginState);
	createPropertySetterGetter("scrollsToTop", _setScrollsToTop,  _getScrollsToTop);
	createPropertySetterGetter("showScrollbars", _setShowScrollbars,  _getShowScrollbars);
	createPropertySetterGetter("enableZoomControls", _setEnableZoomControls,  _getEnableZoomControls);
	createPropertySetterGetter("scalesPageToFit", _setScalesPageToFit,  _getScalesPageToFit);
	createPropertySetterGetter("url", _setUrl,  _getUrl);
	createPropertySetterGetter("userAgent", _setUserAgent,  _getUserAgent);
	createPropertySetterGetter("willHandleTouches", _setWillHandleTouches,  _getWillHandleTouches);

	createPropertyFunction("canGoBack", _canGoBack);
	createPropertyFunction("canGoForward", _canGoForward);
	createPropertyFunction("evalJS", _evalJS);
	createPropertyFunction("goBack", _goBack);
	createPropertyFunction("goForward", _goForward);
	createPropertyFunction("pause", _pause);
	createPropertyFunction("reload", _reload);
	createPropertyFunction("repaint", _repaint);
	createPropertyFunction("release", _release);
	createPropertyFunction("resume", _resume);
	createPropertyFunction("setBasicAuthentication", _setBasicAuthentication);
	createPropertyFunction("stopLoading", _stopLoading);

	_tiWebView = new UIWebView(this);
	setView(_tiWebView);
	webViews_.append(this);
}

UIWebView *TiUIWebViewProxy::getTiWebView()
{
	return _tiWebView;
}
TiUIWebViewProxy::~TiUIWebViewProxy()
{
	webViews_.removeOne(this);
}
void TiUIWebViewProxy::setData(Ti::TiValue)
{
}
void TiUIWebViewProxy::setDisableBounce(Ti::TiValue val)
{
	_tiWebView->setDisableBounce(val.toBool());
}
void TiUIWebViewProxy::setHideLoadIndicator(Ti::TiValue val)
{
	if(val.toBool() == true) {
		_tiWebView->hideLoadingIndicator();
	}
}
void TiUIWebViewProxy::setHtml(Ti::TiValue val)
{
	_tiWebView->setIsLocal(true);
	_tiWebView->getNativeWebView()->setHtml(val.toString());
}
void TiUIWebViewProxy::setIgnoreSslError(Ti::TiValue)
{
}
void TiUIWebViewProxy::setLoading(Ti::TiValue)
{
}
void TiUIWebViewProxy::setOverScrollMode(Ti::TiValue)
{
}
void TiUIWebViewProxy::setPluginState(Ti::TiValue)
{
}
void TiUIWebViewProxy::setScrollsToTop(Ti::TiValue)
{
}
void TiUIWebViewProxy::setShowScrollbars(Ti::TiValue)
{
}
void TiUIWebViewProxy::setEnableZoomControls(Ti::TiValue)
{
}
void TiUIWebViewProxy::setScalesPageToFit(Ti::TiValue val)
{
	_tiWebView->setScalesPageToFit(val.toBool());
}
void TiUIWebViewProxy::setUrl(Ti::TiValue val)
{
    QString url = val.toString();
    if(url.startsWith("http://") || url.startsWith("https://"))
    {
        _tiWebView->setIsLocal(false);
    	_tiWebView->getNativeWebView()->setUrl(QUrl(url));
    	return;
   	}
    const char* a = url.toLocal8Bit().constData();
    QString localUrl = QString("local:///").append(Ti::TiHelper::getAssetPath(url));
    const char* aa = localUrl.toLocal8Bit().constData();
//    localUrl.replace("local:///assets//", "local:///assets/");
//    const char* aaa = localUrl.toLocal8Bit().constData();
    _tiWebView->setIsLocal(true);
	_tiWebView->getNativeWebView()->setUrl(QUrl(localUrl));
	_tiWebView->hideLoadingIndicator();
}
void TiUIWebViewProxy::setUserAgent(Ti::TiValue val)
{
	_tiWebView->setUserAgent(val.toString());
}
void TiUIWebViewProxy::setWillHandleTouches(Ti::TiValue)
{
}

Ti::TiValue TiUIWebViewProxy::getData()
{
	Ti::TiValue val;
	val.setUndefined();
	return val;
}
Ti::TiValue TiUIWebViewProxy::getDisableBounce()
{
	Ti::TiValue val;
	val.setUndefined();
	return val;
}
Ti::TiValue TiUIWebViewProxy::getHideLoadIndicator()
{
	Ti::TiValue val;
	val.setUndefined();
	return val;
}
Ti::TiValue TiUIWebViewProxy::getHtml()
{
	Ti::TiValue val;
	val.setUndefined();
	return val;
}
Ti::TiValue TiUIWebViewProxy::getIgnoreSslError()
{
	Ti::TiValue val;
	val.setUndefined();
	return val;
}
Ti::TiValue TiUIWebViewProxy::getLoading()
{
	Ti::TiValue val;
	val.setUndefined();
	return val;
}
Ti::TiValue TiUIWebViewProxy::getOverScrollMode()
{
	Ti::TiValue val;
	val.setUndefined();
	return val;
}
Ti::TiValue TiUIWebViewProxy::getPluginState()
{
	Ti::TiValue val;
	val.setUndefined();
	return val;
}
Ti::TiValue TiUIWebViewProxy::getScrollsToTop()
{
	Ti::TiValue val;
	val.setUndefined();
	return val;
}
Ti::TiValue TiUIWebViewProxy::getShowScrollbars()
{
	Ti::TiValue val;
	val.setUndefined();
	return val;
}
Ti::TiValue TiUIWebViewProxy::getEnableZoomControls()
{
	Ti::TiValue val;
	val.setUndefined();
	return val;
}
Ti::TiValue TiUIWebViewProxy::getScalesPageToFit()
{
	Ti::TiValue val;
	val.setUndefined();
	return val;
}
Ti::TiValue TiUIWebViewProxy::getUrl()
{
	Ti::TiValue val;
	val.setUndefined();
	return val;
}
Ti::TiValue TiUIWebViewProxy::getUserAgent()
{
	Ti::TiValue val;
	val.setUndefined();
	return val;
}
Ti::TiValue TiUIWebViewProxy::getWillHandleTouches()
{
	Ti::TiValue val;
	val.setUndefined();
	return val;
}

Ti::TiValue TiUIWebViewProxy::canGoBack(Ti::TiValue)
{
	Ti::TiValue val;
	val.setBool(_tiWebView->getNativeWebView()->canGoBack());
	return val;
}
Ti::TiValue TiUIWebViewProxy::canGoForward(Ti::TiValue)
{
	Ti::TiValue val;
	val.setBool(_tiWebView->getNativeWebView()->canGoForward());
	return val;
}
Ti::TiValue TiUIWebViewProxy::evalJS(Ti::TiValue val)
{
	if(val.isList())
	{
		QList<Ti::TiValue> array = val.toList();
		Ti::TiValue str = array.at(0);
		Ti::TiValue callback = array.at(1);
		_tiWebView->evalJS(str.toString(), callback);
	}
	else
	{
		_tiWebView->evalJS(val.toString());
	}
	return Ti::TiValue();
}
Ti::TiValue TiUIWebViewProxy::goBack(Ti::TiValue)
{
	_tiWebView->getNativeWebView()->goBack();
	return Ti::TiValue();
}
Ti::TiValue TiUIWebViewProxy::goForward(Ti::TiValue)
{
	_tiWebView->getNativeWebView()->goForward();
	return Ti::TiValue();
}
Ti::TiValue TiUIWebViewProxy::pause(Ti::TiValue)
{
	Ti::TiValue val;
	val.setUndefined();
	return val;
}
Ti::TiValue TiUIWebViewProxy::reload(Ti::TiValue)
{
	_tiWebView->getNativeWebView()->reload();
	return Ti::TiValue();
}
Ti::TiValue TiUIWebViewProxy::repaint(Ti::TiValue)
{
	Ti::TiValue val;
	val.setUndefined();
	return val;
}
Ti::TiValue TiUIWebViewProxy::release(Ti::TiValue)
{
	Ti::TiValue val;
	val.setUndefined();
	return val;
}
Ti::TiValue TiUIWebViewProxy::resume(Ti::TiValue)
{
	Ti::TiValue val;
	val.setUndefined();
	return val;
}
Ti::TiValue TiUIWebViewProxy::setBasicAuthentication(Ti::TiValue)
{
	Ti::TiValue val;
	val.setUndefined();
	return val;
}
Ti::TiValue TiUIWebViewProxy::stopLoading(Ti::TiValue)
{
	Ti::TiValue val;
	val.setUndefined();
	return val;
}

}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CompareCloudware.Domain.Models
{
    #region CloudApplicationDocumentType
    public class CloudApplicationDocumentType
    {
        public virtual int CloudApplicationDocumentTypeID { get; set; }
        public virtual string CloudApplicationDocumentTypeName { get; set; }
        public virtual Status CloudApplicationDocumentTypeStatus { get; set; }
        public virtual byte[] RowVersion { get; set; }
    }
    #endregion

}


text:
@implementation AGAppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    [WeiboSDK registerApp:[AGSampleViewController appKey]];
    [WeiboSDK enableDebugMode:YES];

    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    [self.window setBackgroundColor:[UIColor whiteColor]];
    // Override point for customization after application launch.

    AGSampleViewController *vc = [[AGSampleViewController alloc] init];

    self.window.rootViewController = vc;
    [self.window makeKeyAndVisible];

    [ShareSDK registerApp:@"api20"];
    [ShareSDK connectSinaWeiboWithAppKey:[AGSampleViewController appKey]
                               appSecret:[AGSampleViewController appSecret]
                             redirectUri:[AGSampleViewController redirectUri]];
    [ShareSDK ssoEnabled:NO];

    return YES;
}

- (void)didReceiveWeiboRequest:(WBBaseRequest *)request
{
    if ([request isKindOfClass:WBProvideMessageForWeiboRequest.class])
    {
    }
}

- (void)didReceiveWeiboResponse:(WBBaseResponse *)response
{
    if ([response isKindOfClass:WBAuthorizeResponse.class])
    {
        [(AGSampleViewController*)(self.window.rootViewController) didReceiveWeiboResponse:response];
    }
}

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
    BOOL result = [WeiboSDK handleOpenURL:url delegate:self];
    NSLog(@"[application:openURL:sourceApplication:annotation:] %@, %d", url, result);
    return result;
}

@end


text:
/*
  DO NOT EDIT THIS FILE - the content was created using a source code generator
*/

#include "QPieSeriesSlots.h"

QPieSeriesSlots::QPieSeriesSlots( QObject *parent ) : QObject( parent )
{
}

QPieSeriesSlots::~QPieSeriesSlots()
{
}

#if (QT_VERSION >= QT_VERSION_CHECK(5,7,0))
void QPieSeriesSlots::added( QList<QPieSlice*> slices )
{
  QObject *object = qobject_cast<QObject *>(sender());

  PHB_ITEM cb = Qt5xHb::Signals_return_codeblock( object, "added(QList<QPieSlice*>)" );

  if( cb )
  {
    PHB_ITEM psender = Qt5xHb::Signals_return_qobject( (QObject *) object, "QPIESERIES" );
    PHB_DYNS pDynSym = hb_dynsymFindName( "QPIESLICE" );
    PHB_ITEM pslices = hb_itemArrayNew(0);
    if( pDynSym )
    {
      for( int i = 0; i < slices.count(); i++ )
      {
        hb_vmPushDynSym( pDynSym );
        hb_vmPushNil();
        hb_vmDo( 0 );
        PHB_ITEM pTempObject = hb_itemNew( NULL );
        hb_itemCopy( pTempObject, hb_stackReturnItem() );
        PHB_ITEM pTempItem = hb_itemNew( NULL );
        hb_itemPutPtr( pTempItem, (QPieSlice *) slices [i] );
        hb_objSendMsg( pTempObject, "NEWFROMPOINTER", 1, pTempItem );
        hb_arrayAddForward( pslices, pTempObject );
        hb_itemRelease( pTempObject );
        hb_itemRelease( pTempItem );
      }
    }
    else
    {
      hb_errRT_BASE( EG_NOFUNC, 1001, NULL, "QPIESLICE", HB_ERR_ARGS_BASEPARAMS );
    }

    hb_vmEvalBlockV( cb, 2, psender, pslices );

    hb_itemRelease( psender );
    hb_itemRelease( pslices );
  }
}
#endif

#if (QT_VERSION >= QT_VERSION_CHECK(5,7,0))
void QPieSeriesSlots::clicked( QPieSlice * slice )
{
  QObject *object = qobject_cast<QObject *>(sender());

  PHB_ITEM cb = Qt5xHb::Signals_return_codeblock( object, "clicked(QPieSlice*)" );

  if( cb )
  {
    PHB_ITEM psender = Qt5xHb::Signals_return_qobject( (QObject *) object, "QPIESERIES" );
    PHB_ITEM pslice = Signals_return_qobject( (QObject *) slice, "QPIESLICE" );

    hb_vmEvalBlockV( cb, 2, psender, pslice );

    hb_itemRelease( psender );
    hb_itemRelease( pslice );
  }
}
#endif

#if (QT_VERSION >= QT_VERSION_CHECK(5,7,0))
void QPieSeriesSlots::countChanged()
{
  QObject *object = qobject_cast<QObject *>(sender());

  PHB_ITEM cb = Qt5xHb::Signals_return_codeblock( object, "countChanged()" );

  if( cb )
  {
    PHB_ITEM psender = Qt5xHb::Signals_return_qobject( (QObject *) object, "QPIESERIES" );

    hb_vmEvalBlockV( cb, 1, psender );

    hb_itemRelease( psender );
  }
}
#endif

#if (QT_VERSION >= QT_VERSION_CHECK(5,7,0))
void QPieSeriesSlots::doubleClicked( QPieSlice * slice )
{
  QObject *object = qobject_cast<QObject *>(sender());

  PHB_ITEM cb = Qt5xHb::Signals_return_codeblock( object, "doubleClicked(QPieSlice*)" );

  if( cb )
  {
    PHB_ITEM psender = Qt5xHb::Signals_return_qobject( (QObject *) object, "QPIESERIES" );
    PHB_ITEM pslice = Signals_return_qobject( (QObject *) slice, "QPIESLICE" );

    hb_vmEvalBlockV( cb, 2, psender, pslice );

    hb_itemRelease( psender );
    hb_itemRelease( pslice );
  }
}
#endif

#if (QT_VERSION >= QT_VERSION_CHECK(5,7,0))
void QPieSeriesSlots::hovered( QPieSlice * slice, bool state )
{
  QObject *object = qobject_cast<QObject *>(sender());

  PHB_ITEM cb = Qt5xHb::Signals_return_codeblock( object, "hovered(QPieSlice*,bool)" );

  if( cb )
  {
    PHB_ITEM psender = Qt5xHb::Signals_return_qobject( (QObject *) object, "QPIESERIES" );
    PHB_ITEM pslice = Signals_return_qobject( (QObject *) slice, "QPIESLICE" );
    PHB_ITEM pstate = hb_itemPutL( NULL, state );

    hb_vmEvalBlockV( cb, 3, psender, pslice, pstate );

    hb_itemRelease( psender );
    hb_itemRelease( pslice );
    hb_itemRelease( pstate );
  }
}
#endif

#if (QT_VERSION >= QT_VERSION_CHECK(5,7,0))
void QPieSeriesSlots::pressed( QPieSlice * slice )
{
  QObject *object = qobject_cast<QObject *>(sender());

  PHB_ITEM cb = Qt5xHb::Signals_return_codeblock( object, "pressed(QPieSlice*)" );

  if( cb )
  {
    PHB_ITEM psender = Qt5xHb::Signals_return_qobject( (QObject *) object, "QPIESERIES" );
    PHB_ITEM pslice = Signals_return_qobject( (QObject *) slice, "QPIESLICE" );

    hb_vmEvalBlockV( cb, 2, psender, pslice );

    hb_itemRelease( psender );
    hb_itemRelease( pslice );
  }
}
#endif

#if (QT_VERSION >= QT_VERSION_CHECK(5,7,0))
void QPieSeriesSlots::released( QPieSlice * slice )
{
  QObject *object = qobject_cast<QObject *>(sender());

  PHB_ITEM cb = Qt5xHb::Signals_return_codeblock( object, "released(QPieSlice*)" );

  if( cb )
  {
    PHB_ITEM psender = Qt5xHb::Signals_return_qobject( (QObject *) object, "QPIESERIES" );
    PHB_ITEM pslice = Signals_return_qobject( (QObject *) slice, "QPIESLICE" );

    hb_vmEvalBlockV( cb, 2, psender, pslice );

    hb_itemRelease( psender );
    hb_itemRelease( pslice );
  }
}
#endif

#if (QT_VERSION >= QT_VERSION_CHECK(5,7,0))
void QPieSeriesSlots::removed( QList<QPieSlice*> slices )
{
  QObject *object = qobject_cast<QObject *>(sender());

  PHB_ITEM cb = Qt5xHb::Signals_return_codeblock( object, "removed(QList<QPieSlice*>)" );

  if( cb )
  {
    PHB_ITEM psender = Qt5xHb::Signals_return_qobject( (QObject *) object, "QPIESERIES" );
    PHB_DYNS pDynSym = hb_dynsymFindName( "QPIESLICE" );
    PHB_ITEM pslices = hb_itemArrayNew(0);
    if( pDynSym )
    {
      for( int i = 0; i < slices.count(); i++ )
      {
        hb_vmPushDynSym( pDynSym );
        hb_vmPushNil();
        hb_vmDo( 0 );
        PHB_ITEM pTempObject = hb_itemNew( NULL );
        hb_itemCopy( pTempObject, hb_stackReturnItem() );
        PHB_ITEM pTempItem = hb_itemNew( NULL );
        hb_itemPutPtr( pTempItem, (QPieSlice *) slices [i] );
        hb_objSendMsg( pTempObject, "NEWFROMPOINTER", 1, pTempItem );
        hb_arrayAddForward( pslices, pTempObject );
        hb_itemRelease( pTempObject );
        hb_itemRelease( pTempItem );
      }
    }
    else
    {
      hb_errRT_BASE( EG_NOFUNC, 1001, NULL, "QPIESLICE", HB_ERR_ARGS_BASEPARAMS );
    }

    hb_vmEvalBlockV( cb, 2, psender, pslices );

    hb_itemRelease( psender );
    hb_itemRelease( pslices );
  }
}
#endif

#if (QT_VERSION >= QT_VERSION_CHECK(5,7,0))
void QPieSeriesSlots::sumChanged()
{
  QObject *object = qobject_cast<QObject *>(sender());

  PHB_ITEM cb = Qt5xHb::Signals_return_codeblock( object, "sumChanged()" );

  if( cb )
  {
    PHB_ITEM psender = Qt5xHb::Signals_return_qobject( (QObject *) object, "QPIESERIES" );

    hb_vmEvalBlockV( cb, 1, psender );

    hb_itemRelease( psender );
  }
}
#endif

void QPieSeriesSlots_connect_signal( const QString & signal, const QString & slot )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,7,0))
  QPieSeries * obj = (QPieSeries *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
    QPieSeriesSlots * s = QCoreApplication::instance()->findChild<QPieSeriesSlots *>();

    if( s == NULL )
    {
      s = new QPieSeriesSlots();
      s->moveToThread( QCoreApplication::instance()->thread() );
      s->setParent( QCoreApplication::instance() );
    }

    hb_retl( Qt5xHb::Signals_connection_disconnection( s, signal, slot ) );
  }
  else
  {
    hb_retl( false );
  }
#else
  hb_retl( false );
#endif
}


text:
package backtype.storm.nimbus;

import backtype.storm.Config;
import com.alibaba.jstorm.client.ConfigExtension;
import com.alibaba.jstorm.utils.NetWorkUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

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

public class NimbusInfo implements Serializable {
    private static final Logger LOG = LoggerFactory.getLogger(NimbusInfo.class);

    private static final String DELIM = ":";

    private String host;
    private int port;
    private boolean isLeader;

    public NimbusInfo(String host, int port, boolean isLeader) {
        this.host = host;
        this.port = port;
        this.isLeader = isLeader;
    }

    public static NimbusInfo parse(String nimbusInfo) {
        String[] hostAndPort = nimbusInfo.split(DELIM);
        if (hostAndPort.length == 2) {
            return new NimbusInfo(hostAndPort[0], Integer.parseInt(hostAndPort[1]), false);
        } else {
            throw new RuntimeException("nimbusInfo should be in the format of host:port, invalid string " + nimbusInfo);
        }
    }

    public static NimbusInfo fromConf(Map conf) {
        String host;
        if (!ConfigExtension.isNimbusUseIp(conf)) {
            host = NetWorkUtils.hostname();
        } else {
            host = NetWorkUtils.ip();
        }

        int port = Integer.parseInt(conf.get(Config.NIMBUS_THRIFT_PORT).toString());
        return new NimbusInfo(host, port, false);
    }

    public String toHostPortString() {
        return String.format("%s%s%s", host, DELIM, port);
    }

    public boolean isLeader() {
        return isLeader;
    }

    public int getPort() {
        return port;
    }

    public String getHost() {
        return host;
    }

    public String getHostPort(){
        return host + ":" + port;
    }

    public void setLeader(boolean isLeader) {
        this.isLeader = isLeader;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof NimbusInfo)) return false;

        NimbusInfo that = (NimbusInfo) o;

        if (isLeader != that.isLeader) return false;
        if (port != that.port) return false;
        return host.equals(that.host);
    }

    @Override
    public int hashCode() {
        int result = host.hashCode();
        result = 31 * result + port;
        result = 31 * result + (isLeader ? 1 : 0);
        return result;
    }

    @Override
    public String toString() {
        return "NimbusInfo{" + "host='" + host + '\'' + ", port=" + port + ", isLeader=" + isLeader + '}';
    }
}