package ru.vova_2009.saveinventory;

import com.google.inject.Inject;
import org.slf4j.Logger;
import org.spongepowered.api.event.Listener;
import org.spongepowered.api.event.game.state.GameInitializationEvent;
import org.spongepowered.api.plugin.Plugin;
import ru.vova_2009.saveinventory.service.CommandService;

@Plugin(
        id = "save-inventory",
        name = "Save Inventory",
        description = "Plugin for saving player inventory",
        authors = {
                "Vova 2009"
        }
)
public class SaveInventory {

    private final Logger logger;

    private final CommandService commandService;

    @Inject
    public SaveInventory(Logger logger, CommandService commandService) {
        this.logger = logger;
        this.commandService = commandService;
    }

    @Listener
    public void onServerStart(GameInitializationEvent event) {
        logger.info("Initialize save inventory plugin!");
        commandService.initialize(this);
    }
}


package sensingflow.gef.editor.policy;

import org.eclipse.gef.commands.Command;
import org.eclipse.gef.editpolicies.DirectEditPolicy;
import org.eclipse.gef.requests.DirectEditRequest;

import sensingflow.gef.editor.command.SensingflowThingRenameCommand;
import sensingflow.gef.editor.figure.SensingflowThingFigure;
import sensingflow.model.SensingflowThing;

public class SensingflowThingDirectEditPolicy extends DirectEditPolicy {

	@Override
	protected Command getDirectEditCommand(DirectEditRequest request) {
		SensingflowThingRenameCommand command = new SensingflowThingRenameCommand();
		command.setModel((SensingflowThing) getHost().getModel());
		command.setNewName((String) request.getCellEditor().getValue());
		return command;
	}

	@Override
	protected void showCurrentEditValue(DirectEditRequest request) {
		String value = (String) request.getCellEditor().getValue();
		((SensingflowThingFigure) getHostFigure()).getNameLabel().setText(value);
	}
}


package is.symphony.test.split.examples.routes.strategy;

import is.symphony.test.split.examples.model.Person;
import org.apache.camel.Exchange;
import org.apache.camel.processor.aggregate.AggregationStrategy;

import java.util.ArrayList;
import java.util.List;

public class ListPersonAggregationStrategy implements AggregationStrategy {

    @Override
    @SuppressWarnings("unchecked")
    public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {
        Person body = newExchange.getIn().getBody(Person.class);
        if (oldExchange == null) {
            List<Person> list = new ArrayList<>();
            if (body != null) {
                list.add(body);
            }
            newExchange.getIn().setBody(list);
            return newExchange;
        } else {
            List<Person> list = oldExchange.getIn().getBody(List.class);
            if (body != null) {
                list.add(body);
            }
            return oldExchange;
        }
    }
}


package com.wmp.demo.service;

import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.system.CapturedOutput;
import org.springframework.boot.test.system.OutputCaptureExtension;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.test.context.junit.jupiter.SpringExtension;

@ExtendWith(OutputCaptureExtension.class)
@ExtendWith(SpringExtension.class)
public class UserServiceTest {

    @Configuration // does this "import" the beans from another package? since here is in the test?
    @ComponentScan("com.wmp.demo.service")
    public static class UserServiceTestConfig {
    }

    @Autowired
    public DummyUserService dummyUserService;

    @Test
    public void testGreetingAll(CapturedOutput output) {
        dummyUserService.greetAll();
        Assertions.assertThat(output).contains("Elodie!", "Charles!");
    }
}


package com.android.framework.demo.activity.daemon;

/**
 * 后台上传的结果信息
 * Created by meikai on 2018/06/01.
 */
public class DaemonResult {

    public @DaemonSource.SOURCE_TYPE
    int type;

    /**
     * 上传成功后的 图片或视频 的 服务器路径
     */
    public String netUrl;

    public String videoCoverNetUrl;
    public int videoCoverWidth;
    public int videoCoverHeight;

    public static DaemonResult image(String netUrl) {
        DaemonResult result = new DaemonResult();
        result.netUrl = netUrl;
        result.type = DaemonSource.TYPE_IMAGE;
        return result;
    }

    public static DaemonResult video(String netUrl, String coverNetUrl, int coverWidth, int coverHeight) {
        DaemonResult result = new DaemonResult();
        result.netUrl = netUrl;
        result.videoCoverNetUrl = coverNetUrl;
        result.videoCoverWidth = coverWidth;
        result.videoCoverHeight = coverHeight;
        result.type = DaemonSource.TYPE_VIDEO;
        return result;
    }

}


package com.ship.ship.domain.service;

import com.ship.ship.persistence.dao.BranchOfficeDAO;
import com.ship.ship.persistence.model.BranchOffice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.transaction.Transactional;
import java.util.List;

@Service
@Transactional
public class BranchOfficeService {

    @Autowired
    private BranchOfficeDAO branchOfficeDAO;

    public List<BranchOffice> getBranchOffice(){
        return branchOfficeDAO.getBranchOffice();
    }

    public BranchOffice getBranchOfficeById(Integer id){
        return branchOfficeDAO.getBranchOfficeById(id);
    }

    public BranchOffice saveBranchOffice(BranchOffice branchOffice){
        return branchOfficeDAO.saveBranchOffice(branchOffice);
    }

    public BranchOffice updateBranchOffice(BranchOffice branchOffice){
        return branchOfficeDAO.updateBranchOffice(branchOffice);
    }

    public void deleteBranchOffice(BranchOffice branchOffice){
        branchOfficeDAO.deleteBranchOffice(branchOffice);
    }
}


package com.behavioral.observer.publisher;

import com.behavioral.observer.subscriber_interface.OnLevelLoadListener;

import java.util.ArrayList;

public class LevelLoader implements Runnable
{
    ArrayList<OnLevelLoadListener> listeners;

    public LevelLoader()
    {
        listeners = new ArrayList<>();
    }

    public void addOnLoadListener(OnLevelLoadListener listener)
    {
        listeners.add(listener);
    }

    private void loadLevelData()
    {
        System.out.println("Loading level data...");
        try
        {
            Thread.sleep(1000);
            System.out.println("Level data loaded");
        }
        catch (InterruptedException e)
        {
            e.printStackTrace();
        }
    }

    @Override
    public void run()
    {
        loadLevelData();
        loadGUI();
    }

    private void loadGUI()
    {
        for (OnLevelLoadListener listener : listeners)
        {
            listener.onLoad();
        }
    }

}


package br.com.fiap.testes;

import java.util.Calendar;
import java.util.GregorianCalendar;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;

import br.com.fiap.dao.GrupoDAO;
import br.com.fiap.dao.ProjetoDAO;
import br.com.fiap.daoImpl.GrupoDAOImpl;
import br.com.fiap.daoImpl.ProjetoDAOImpl;
import br.com.fiap.entity.Grupo;
import br.com.fiap.entity.Projeto;
import br.com.fiap.singleton.EMSingleton;

public class Teste1 {

	private static EntityManagerFactory ef;
	private static EntityManager em;

	public static void main(String[] args) {

		ef = EMSingleton.getInst();
		em = ef.createEntityManager();

		GrupoDAO daoG = new GrupoDAOImpl(em);
		ProjetoDAO dao = new ProjetoDAOImpl(em);

		try {
			daoG.cadastrar(new Grupo(0, "GDC"));

			dao.cadastrar(new Projeto(0, "GenericDAO", "Fodao", new GregorianCalendar(2017, Calendar.MARCH, 3),
					new GregorianCalendar(2017, Calendar.MARCH, 4), daoG.buscar(1)));

			dao.salvar();

		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			if (ef.isOpen()) {
				ef.close();
			}
		}

	}

}


/*
 * 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 web;

/**
 *
 * @author Luiz Armando
 */
import javax.ejb.EJB;
import javax.enterprise.context.RequestScoped;
import javax.inject.Named;
import negocio.SorteadorLocal;

@Named
@RequestScoped
public class PaginaDaSorteBean {

    @EJB(name = "sorteadorBean")
    private SorteadorLocal sorteadorBean;
    private int valor1, valor2;
    public int getNumero() {
        int numero = 0;
        do{
            numero = sorteadorBean.getNumero();
        }while(valor1 > numero || valor2 < numero);
        return numero;
    }
    public void setValor1(int valor1){
        this.valor1 = valor1;
    }
    public void setValor2(int valor2){
        this.valor2 = valor2;
    }
    public int getValor1(){
        return valor1;
    }
    public int getValor2(){
        return valor2;
    }
}


package com.ManagmentSystem.FleetApp.services;

import com.ManagmentSystem.FleetApp.models.Location;
import com.ManagmentSystem.FleetApp.models.VehicleMake;
import com.ManagmentSystem.FleetApp.repositories.LocationRepository;
import com.ManagmentSystem.FleetApp.repositories.VehicleMakeRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Optional;

@Service
public class VehicleMakeService {

    @Autowired
    private VehicleMakeRepository vehicleMakeRepository;

    // Return list of states
    public List<VehicleMake> getVehicleMakes() {
        return vehicleMakeRepository.findAll();
    }

    //Save new Location
    public void  save(VehicleMake vehicleMake) {
        vehicleMakeRepository.save(vehicleMake);
    }

    //Find Location by Id
    public Optional<VehicleMake> findById(Integer id) {
        return vehicleMakeRepository.findById(id);
    }

    //Delete by Location id
    public void delete(Integer id) {
        vehicleMakeRepository.deleteById(id);
    }
}


/Programación Concurrente Juli/Práctica/TPs Y TPFinal, ultima version/tp5/ej4Puente/Coche.java

/*
 * 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 tp5.ej4Puente;

/**
 *
 */
public class Coche implements Runnable {

    private int id;
    private boolean lado;//true NorteSur - false SurNorte
    private PuenteSemaph recCom;

    public Coche(int id, boolean lado, PuenteSemaph recCom) {
        this.id = id;
        this.lado = lado;
        this.recCom = recCom;
    }

    @Override
    public void run() {
        while (true) {
            if (lado) {
                recCom.entrarNorteASur(id);
                recCom.circular(id);
                recCom.salirNorteASur(id);
            } else {
                recCom.entrarSurANorte(id);
                recCom.circular(id);
                recCom.salirSurANorte(id);
            }
            lado = !lado;
        }
    }
}


import java.util.ArrayList;

public abstract class Card extends Square{
	private ArrayList<String> actions;
	private int top_of_deck;

	public Card(int id, ArrayList<String> action) {
		super(id);
		this.actions = action;
	}

	public void advance_to_go(Person[] player, int current_player) {
		player[current_player].take_charge(200);
		((Player) player[current_player]).setInstant_square(1);
		player[2].pay_dept(200);
	}

	public void pay_card(Person[] player, int current_player, int amount) {
		player[current_player].pay_dept(amount);
		player[2].take_charge(amount);;
	}

	public void collect_card(Person[] player, int current_player, int amount) {
		player[current_player].take_charge(amount);
		player[2].pay_dept(amount);
	}

	public int getTop_of_deck() {
		return top_of_deck;
	}

	public void setTop_of_deck(int top_of_deck) {
		this.top_of_deck = top_of_deck;
	}

	public ArrayList<String> getAction() {
		return actions;
	}

	public void setAction(ArrayList<String> action) {
		this.actions = action;
	}

}


package chamly.learn.spring.microservice.config.swagger;

import java.util.ArrayList;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

@Configuration
@EnableSwagger2
public class SwaggerConfig {

    private static final Contact DEFAULT_CONTACT = new Contact("Chamly",
        "http://chamly.com", "chamlyidunil@gmail.com");
    private static final ApiInfo DEFAULT_API_INFO = new ApiInfo(
        "User Blog APi Documentation", "User Blog APi Documentation", "1.0",
        "urn:tos", DEFAULT_CONTACT, "Apache 2.0",
        "http://www.apache.org/licenses/LICENSE-2.0",
        new ArrayList<>());

    @Bean
    public Docket api() {
        return new Docket(DocumentationType.SWAGGER_2)
            .apiInfo(DEFAULT_API_INFO);
    }
}


package org.apache.maven.plugin.plugin;

import org.apache.maven.plugin.AbstractPlugin;
import org.apache.maven.plugin.PluginExecutionRequest;
import org.apache.maven.plugin.PluginExecutionResponse;

import java.io.File;

/**
 * @author Jason van Zyl
 * @version $Id$
 */
public abstract class AbstractPluginMojo
    extends AbstractPlugin
{

    protected File getJarFile( PluginExecutionRequest request )
    {
        // ----------------------------------------------------------------------
        //
        // ----------------------------------------------------------------------

        String outputDirectory = (String) request.getParameter( "outputDirectory" );

        String jarName = (String) request.getParameter( "jarName" );

        // ----------------------------------------------------------------------
        //
        // ----------------------------------------------------------------------

        File jarFile = new File( new File( outputDirectory ), jarName + ".jar" );

        return jarFile;
    }

}


package com.thoughtworks.kata.word;

import com.google.common.base.Joiner;

import java.util.List;

import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Splitter.fixedLength;
import static com.google.common.base.Splitter.on;
import static com.google.common.collect.Lists.newArrayList;

public class Wrap {

    private static final Joiner JOINER = Joiner.on("|");

    public String wrap(String word, int size) {
        checkArgument(size > 0);
        if (word == null) {
            return "";
        }
        if (word.length() <= size) {
            return word;
        }
        if (!word.contains(" ")) {
            return JOINER.join(fixedLength(size).split(word));
        }

        List<String> splitOnSpace = newArrayList(on(" ").omitEmptyStrings().split(word));
        for (int lineEnd = 1, lineBegin = 0; lineEnd < splitOnSpace.size(); lineEnd++) {

        }
        return JOINER.join(splitOnSpace);
    }
}


/*
 * Copyright (c) 2018-2046, sunmnet Inc. All Rights Reserved.
 *
 * Project Name: bigdata
 * date:  2018-01-30 09:48:58
 */
package com.sunmnet.bigdata.web.service.basedata.impl;

import com.sunmnet.bigdata.web.dao.basedata.IDictCourseDAO;
import com.sunmnet.bigdata.web.model.entity.basedata.DictCourse;
import com.sunmnet.bigdata.web.service.basedata.IDictCourseService;

import com.sunmnet.bigdata.common.service.impl.BaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.io.Serializable;

/**
 * @author wdong
 * @version 1.0
 * @ClassName DictCourseServiceImpl
 * @Description
 * @date 2018-01-30 09:48:58
 */
@Transactional
@Service("DictCourseServiceImpl")
public class DictCourseServiceImpl  implements IDictCourseService{
    @Autowired
    private IDictCourseDAO dictCourseDAO;

}


package Models;

/*
 * 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.
 */

/**
 *
 * @author dwiki
 */
public class Pelanggan extends Orang{
    private String nama;
    private String idPelanggan;
    private String noHP;
    private String kota;

    public Pelanggan(String nama, String idPelanggan, String noHP) {
        super(nama, noHP);
        this.idPelanggan = idPelanggan;
    }

    public void setIdPelanggan(String idPelanggan) {
        this.idPelanggan = idPelanggan;
    }

    public void setKota(String kota) {
        this.kota = kota;
    }

    public String getIdPelanggan() {
        return idPelanggan;
    }

    public String getKota() {
        return kota;
    }

    @Override
    public void displayInfo(){
	System.out.println("ID	: "+getIdPelanggan());
        System.out.println("Nama	: "+ super.getNama());
	System.out.println("No. HP	: "+ super.getNoHP());
    }

}


package nl.brickx.domain.Models;

import android.graphics.drawable.Drawable;

public class MainMenuRecyclerModel {
    private String title;
    private Drawable image;
    private MenuItemIdentifier identifier;

    public MainMenuRecyclerModel() {
    }

    public MainMenuRecyclerModel(String title, Drawable image) {
        this.title = title;
        this.image = image;
    }

    public MainMenuRecyclerModel(String title, Drawable image, MenuItemIdentifier identifier) {
        this.title = title;
        this.image = image;
        this.identifier = identifier;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Drawable getImage() {
        return image;
    }

    public void setImage(Drawable image) {
        this.image = image;
    }

    public MenuItemIdentifier getIdentifier() {
        return identifier;
    }

    public void setIdentifier(MenuItemIdentifier identifier) {
        this.identifier = identifier;
    }
}


package ua.com.codefire.domain;

import java.time.LocalDate;

/**
 * Created by human on 3/26/17.
 */
public class Film {

    private long id;
    private String originTitle;
    private double voteAverage;
    private LocalDate releaseDate;

    public Film(long id, String originTitle, double voteAverage, LocalDate releaseDate) {
        this.id = id;
        this.originTitle = originTitle;
        this.voteAverage = voteAverage;
        this.releaseDate = releaseDate;
    }

    public long getId() {
        return id;
    }

    public String getOriginTitle() {
        return originTitle;
    }

    public double getVoteAverage() {
        return voteAverage;
    }

    public LocalDate getReleaseDate() {
        return releaseDate;
    }

    @Override
    public String toString() {
        return "Film{" +
                "id=" + id +
                ", originTitle='" + originTitle + '\'' +
                ", voteAverage=" + voteAverage +
                ", releaseDate=" + releaseDate +
                '}';
    }
}


# Tech Talk - "A brief introduction to image recognition"

Here are some examples of code that I used to explore my tech talk topic "A brief introduction to image recognition"

The python code was used to explore examples of feature recognition techniques.

The vision folder contains a very simple react app which features pictures which on clicking will make a call to the google vision API
service and will get back the results.

If you would like to use the vision example, you will need to create a google cloud account and generate an API key for google vision.

Once you have done that, add it to the area outlined in src/config/environment.js

Lastly, to get some images to display, create a new image bucket on google api and add each image link to src/config/app.js in the
image array on line 15.

Some resources to help you get started:
https://cloud.google.com/vision/docs/quickstart

Tutorials used for ResNet and using CNNs
https://colab.research.google.com/github/SalChem/Fastai-iNotes-iTutorials/blob/master/Image_Recognition_Basics.ipynb#scrollTo=xHtBFQBLNFie


package fr.trxyy.alternative.alternative_apiv2.assets;

import fr.trxyy.alternative.alternative_apiv2.minecraft.json.DownloadInfo;

/**
 * @author Trxyy
 */
public class AssetIndexInfo extends DownloadInfo {
	/**
	 * The assetIndex
	 */
	protected String id;
	/**
	 * The total size of all Objects
	 */
	protected long totalSize;
	/**
	 * Is known
	 */
	protected boolean known = true;

	/**
	 * The Constructor
	 */
	public AssetIndexInfo() {
	}

	/**
	 * The Constructor
	 * @param id_ The assetIndex id
	 */
	public AssetIndexInfo(String id_) {
		this.id = id_;
		this.url = constantURL("https://s3.amazonaws.com/Minecraft.Download/indexes/" + id + ".json");
		this.known = false;
	}

	/**
	 * @return The total size
	 */
	public long getTotalSize() {
		return this.totalSize;
	}

	/**
	 * @return The assetIndex id
	 */
	public String getId() {
		return this.id;
	}

	/**
	 * @return If the Size and Hash is known
	 */
	public boolean sizeAndHashKnown() {
		return this.known;
	}
}


# puppet-sysctl

## Overview

Manage sysctl variable values. All changes are immediately applied, as well as
configured to become persistent. Tested on Red Hat Enterprise Linux 6.

 * `sysctl` : Definition to manage sysctl variables by setting a value.
 * `sysctl::base` : Base class, included from the main definition.

For persistence to work, your Operating System needs to support looking for
sysctl configuration inside `/etc/sysctl.d/`. When using this module, the
existing content of this directory will be purged, so be careful if you
have already put content there.

Beware also that for the purge to work, you need to either have at least one
sysctl definition call left for the node, or include `sysctl::base` manually.
You can also force a value to `ensure => absent`, which will always work.

For the few original settings in the main `/etc/sysct.conf` file, the value is
replaced so that running `sysctl -p` doesn't revert any change made by puppet.

## Examples

    sysctl { 'net.ipv4.ip_forward': value => '1' }
    sysctl { 'net.core.somaxconn': value => '65536' }


package nguyen.hoang.movierating;

import android.content.Context;

import javax.inject.Singleton;

import nguyen.hoang.movierating.di.DaggerMockParseWrapperComponent;
import nguyen.hoang.movierating.di.DaggerParseWrapperComponent;
import nguyen.hoang.movierating.di.MockParseWrapperModule;
import nguyen.hoang.movierating.di.ParseWrapperComponent;

/**
 * Created by Hoang on 12/14/2015.
 */
public class TestParseApplication extends ParseApplication {
    @Override
    public void onCreate() {
        super.onCreate();
    }

    @Override
    protected void enableParseLocalDatastore(Context context) {
        // Parse.enableLocalDatastore(context);
    }

    private final ParseWrapperComponent component = createComponent();

    ParseWrapperComponent createComponent() {
        return DaggerMockParseWrapperComponent.builder()
                .mockParseWrapperModule(new MockParseWrapperModule())
                .build();
    }

    @Override
    public ParseWrapperComponent getParseWrapperComponent() {
        return component;
    }
}


package exceptions;

import javax.swing.JOptionPane;

import helpers.LoadFailCause;

public class OpenException extends OptionException {
    private OpenException(String title) {
        super(title, "Would you like to try opening a different file?",
                JOptionPane.ERROR_MESSAGE,
                JOptionPane.YES_NO_OPTION);
    }

    public static OptionException create(LoadFailCause cause, String type) {
        String title;
        switch (cause) {
            case FileNotFound:
                title = "Selected file does not exist";
                break;
            case ClassNotFound:
                title = "Selected file is not a recognised format";
                break;
            case WrongClass:
                title = "Selected file is not a " + type;
                break;
            default:
                title = "Selected file is inaccessible";
                break;
        }
        return new OpenException(title);
    }
}


package com.monadiccloud.core.amqp.retrypolicy;

import com.monadiccloud.core.amqp.retrypolicy.exception.ResponseMessageException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.retry.RetryContext;
import org.springframework.retry.policy.SimpleRetryPolicy;

public class ResponseMessageRetryPolicy extends SimpleRetryPolicy {
    private static final Logger log = LoggerFactory.getLogger(ResponseMessageRetryPolicy.class);

    @Override
    public boolean canRetry(RetryContext context) {
        Throwable t = context.getLastThrowable();
        if (t instanceof ResponseMessageException) {
            int maxRetryCount = ((ResponseMessageException) t).getMaxRetryCount();
            return context.getRetryCount() < maxRetryCount;
        }

        log.warn(
                "Policy is used for a wrong exception: {}. Falling back to SimpleRetryPolicy.",
                (t == null ? null : t.getClass().getSimpleName())
        );
        return super.canRetry(context);
    }
}


package com.zz.cloud.service.hystrix.controller;

import com.zz.cloud.service.hystrix.service.HelloService;
import com.zz.cloud.service.hystrix.service.ServiceHello;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(path = "/hello")
public class HelloController {

    @Autowired
    HelloService helloService;

    @GetMapping(value = "/hiFromRibbon")
    public String hiFromRibbon(@RequestParam String name) {
        return helloService.hiService( name );
    }

    @Autowired
    ServiceHello serviceHello;

    @GetMapping(value = "/hiFromFeign")
    public String hiFromFeign(@RequestParam String name) {
        return serviceHello.sayHiFromClientOne(name);
    }

}


package co.vshield.api;

import java.util.concurrent.Callable;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import co.vshield.ScanResult;
import co.vshield.ScanResult.StatusEnum;
import fi.solita.clamav.ClamAVClient;

@RestController
public class ScanApiEndPoint implements ScanApi {

	@Value("${clamd.host}")
	private String hostname;

	@Value("${clamd.port}")
	private int port;

	@Override
	public Callable<ResponseEntity<ScanResult>> scanPost(MultipartFile file) throws NotFoundException {
		return () -> {
			ClamAVClient client = new ClamAVClient(hostname, port);
			byte[] result = client.scan(file.getInputStream());
			ScanResult scanResult = new ScanResult();
			StatusEnum status = ClamAVClient.isCleanReply(result) ? StatusEnum.OK : StatusEnum.FOUND;
			scanResult.setStatus(status);
			return ResponseEntity.status(HttpStatus.OK).body(scanResult);
		};

	}

}


package com.resgain.base.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import com.resgain.base.abs.AbstractPersistentObject;
import com.resgain.base.annotation.Desc;
import com.resgain.base.annotation.Label;

/**
 * 用户角色关联表实体类
 * @author gyl
 */
@Entity
@Table(name = "BASE_USER_ROLE")
@Desc("用户角色关联")
public class UserRole extends AbstractPersistentObject
{
    private static final long serialVersionUID = 1L;

    @Column(name="USER_ID")
	@Label(name = "用户ID", nullFlag = false)
	private String userId;

    @Column(name="ROLE_ID")
	@Label(name = "角色ID", nullFlag = false)
	private String roleId;

	public UserRole() {
		super();
	}

	public UserRole(String userId, String roleId) {
		super();
		this.userId = userId;
		this.roleId = roleId;
	}

	public String getUserId() {
		return userId;
	}
	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getRoleId() {
		return roleId;
	}

	public void setRoleId(String roleId) {
		this.roleId = roleId;
	}
}


package problemController.part04;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@WebServlet("/problem")
public class ProblemContorller extends HttpServlet{
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

		RequestDispatcher dis = req.getRequestDispatcher("/servletview/part04/form.jsp");
		dis.forward(req, resp);

	}
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		req.setCharacterEncoding("utf-8");
		req.setAttribute("res", req.getParameter("ko"));
		RequestDispatcher dis = req.getRequestDispatcher("/servletview/part04/result.jsp");
		dis.forward(req, resp);

	}
}


package uk.gov.pay.directdebit.payments.api;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum ExternalPaymentState {
    EXTERNAL_CREATED("created"),
    EXTERNAL_PENDING("pending"),
    EXTERNAL_SUCCESS("success"),
    EXTERNAL_FAILED("failed"),
    EXTERNAL_CANCELLED("cancelled"),
    EXTERNAL_PAID_OUT("paidout"),
    EXTERNAL_INDEMNITY_CLAIM("indemnityclaim"),
    EXTERNAL_ERROR("error");

    @JsonProperty("status")
    private final String status;

    ExternalPaymentState(String status) {
        this.status = status;
    }

    public String getStatus() {
        return status;
    }

    @Override
    public String toString() {
        return "ExternalPaymentState{" +
                "status='" + status + '\'' +
                '}';
    }
}


# Outbreak

<img src="https://github.com/navinramsaroop/Outbreak/blob/master/outbreak.gif" />

## Summary
##### Single-player avoiding-enemies game made in Java
Welcome to Outbreak! Bear with the glitches.... Use the arrow keys to move your player around! Avoid all the enemies (anything rectangular = AVOID). You have a certain amount of health, and once all your health is gone the game is over. You can go to the store to upgrade your player, and you can change players during the game with the 1, 2, 3, 4, and 5 keys. Finally, you can shoot bullets at enemies that have a health bar on top of them (Enemies without a health bar CANNOT be killed, only avoided)

## Controls
1. w = shoot bullets up
2. a = shoot bullets left
3. s = shoot bullets down
4. d = shoot bullets left
5. arrow keys: move player around
6. Space: Pause Game
7. number keys 1-5: switch players during the game

## How to Start Game
Run `java -jar Outbreak.jar` while in the Outbreak directory


package com.bayer.bayerreward.GetterSetter;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

public class product_achived_planned {

    public String getProduct_name() {
        return product_name;
    }

    public void setProduct_name(String product_name) {
        this.product_name = product_name;
    }

    public String getPlanned_volume() {
        return planned_volume;
    }

    public void setPlanned_volume(String planned_volume) {
        this.planned_volume = planned_volume;
    }

    public String getAchived_volume() {
        return achived_volume;
    }

    public void setAchived_volume(String achived_volume) {
        this.achived_volume = achived_volume;
    }

    @SerializedName("product_name")
    @Expose
    private String product_name;

    @SerializedName("planned_volume")
    @Expose
    private String planned_volume;

    @SerializedName("achived_volume")
    @Expose
    private String achived_volume;

}


package org.example.programmingcourses.entity;

import org.example.programmingcourses.entity.abstr.AbstractEntity;

import javax.persistence.*;

@Entity
@Table(name = "groups")
public class Group extends AbstractEntity {

    @Column
    private String name;

    @ManyToOne
    @JoinColumn(name = "course_id")
    private Course course;

    @ManyToOne
    @JoinColumn(name = "teacher_id")
    private Teacher teacher;

    public Group() {

    }

    public Group(String name, Course course, Teacher teacher) {
        this.name = name;
        this.course = course;
        this.teacher = teacher;
    }

    public String getName() {
        return name;
    }

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

    public Course getCourse() {
        return course;
    }

    public void setCourse(Course course) {
        this.course = course;
    }

    public Teacher getTeacher() {
        return teacher;
    }

    public void setTeacher(Teacher teacher) {
        this.teacher = teacher;
    }
}


package testnglistener.model;

/**
 * Created by yrd on 2017/5/24.
 */
public class StackTrace {

    private String declaringClass;
    private String methodName;
    private String fileName;
    private String lineNumber;

    public StackTrace() {
        super();
    }

    public StackTrace(String declaringClass, String methodName, String fileName, String lineNumber) {
        super();
        this.declaringClass = declaringClass;
        this.methodName = methodName;
        this.fileName = fileName;
        this.lineNumber = lineNumber;
    }

    public String getDeclaringClass() {
        return declaringClass;
    }

    public void setDeclaringClass(String declaringClass) {
        this.declaringClass = declaringClass;
    }

    public String getMethodName() {
        return methodName;
    }

    public void setMethodName(String methodName) {
        this.methodName = methodName;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public String getLineNumber() {
        return lineNumber;
    }

    public void setLineNumber(String lineNumber) {
        this.lineNumber = lineNumber;
    }
}


package com.yasin.practice.solution3;

import java.util.List;
import java.util.Vector;

/**
 * @author Yasin Zhang
 */
public class Path {

    private List<Vertex> vertexList = new Vector<>();
    private Long rate = -1L;

    public Path(List<Vertex> vertexList, long rate) {
        this.vertexList = vertexList;
        this.rate = rate;
    }

    public List<Vertex> getVertexList() {
        return vertexList;
    }

    public void setVertexList(List<Vertex> vertexList) {
        this.vertexList = vertexList;
    }

    public long getRate() {
        return rate;
    }

    public void setRate(long rate) {
        this.rate = rate;
    }

    @Override
    public boolean equals(Object right) {
        if(right instanceof Path)
        {
            Path r_path = (Path) right;
            return vertexList.equals(r_path.vertexList);
        }
        return false;
    }

    @Override
    public int hashCode() {
        return vertexList.hashCode();
    }

    public String toString() {
        return vertexList.toString() + ":" + rate;
    }
}


package io.zipcoder.polymorphism;

public class Pet implements Comparable<Pet>{

    private String name;

    public Pet (String name) {
        this.name = name;
    }

    public Pet (String name, String type) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

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

    public String speak() {
        return "<Insert generic animal noise>";
    }

    public String outputPet () {
        String[] className;
        className = this.getClass().getName().split("\\.");

        return String.format("Pet: %s   Type: %s  Says: %s", this.getName(), className[className.length-1], this.speak());
    }

    public int compareTo(Pet pet2) {
        if (!this.name.equals(pet2.getName())) {
            return this.name.compareTo(pet2.getName());
        } else {
            return this.getClass().getName().compareTo(pet2.getClass().getName());
        }
    }
}


package it.alfasoft.martina;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Servlet implementation class ServletTabella
 */
@WebServlet("/ServletTabella")
public class ServletTabella extends HttpServlet {
	private static final long serialVersionUID = 1L;

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

		response.setContentType("text/html");
		PrintWriter wr = response.getWriter();
		wr.println( "
"+"a	"+"b	"+"
"+"1	"+"2	"+"
"+"
"
		+"3	"+"4	"+"
"+"
");
	}

}


package com.michael.flux.dispatcher;

import com.michael.flux.action.*;
import com.michael.flux.store.Store;

import java.util.LinkedList;
import java.util.List;

/**
 * 分发动作到已经注册的store
 *
 * @author Michael Chu
 * @date 2019-05-20 15:36
 */
public final class Dispatcher {

    private static Dispatcher instance = new Dispatcher();

    private List<Store> stores = new LinkedList<>();

    private Dispatcher() {}

    public static Dispatcher getInstance() {
        return instance;
    }

    public void registerStore(Store store) {
        stores.add(store);
    }

    public void menuItemSelected(MenuItem menuItem) {
        dispatchAction(new MenuAction(menuItem));
        switch (menuItem) {
            case HOME:
            case PRODUCTS:
            default:
                dispatchAction(new ContentAction(Content.PRODUCTS));
                break;
            case COMPANY:
                dispatchAction(new ContentAction(Content.COMPANY));
                break;
        }
    }

    private void dispatchAction(Action action) {
        stores.forEach(store -> store.onAction(action));
    }
}


package com.example.snn.ui;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.widget.TextView;
import androidx.annotation.Nullable;
import com.example.snn.R;

public class targetDisplay extends Activity {

    @SuppressLint("SetTextI18n")
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.target_display);

        Bundle data = getIntent().getExtras();
        if (data == null){
            return;
        }
        String killerName = data.getString("killerName");

        DisplayMetrics dm = new DisplayMetrics();
        getWindowManager().getDefaultDisplay().getMetrics(dm);
        int width = dm.widthPixels;
        int height = dm.heightPixels;
        getWindow().setLayout((int) (width* .8), (int) (height * .1));

        TextView message = findViewById(R.id.targetDisplayText);
        message.setText(killerName + " is the target");
    }
}


package com.kimyong.navermaps;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;

import com.naver.maps.geometry.LatLng;
import com.naver.maps.map.MapView;
import com.naver.maps.map.NaverMap;
import com.naver.maps.map.OnMapReadyCallback;
import com.naver.maps.map.overlay.Marker;

public class KimhaeActivity extends AppCompatActivity implements OnMapReadyCallback {
    private MapView mapView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_kimhae);

        mapView = findViewById(R.id.kimhae);
        mapView.getMapAsync(this);
    }

    @Override
    public void onMapReady(@NonNull NaverMap naverMap) {
        Marker marker = new Marker();
        marker.setPosition((new LatLng(35.228729, 128.901243)));
        marker.setMap(naverMap);
        marker.setCaptionText("김해소방서건너편(JW웨딩건물 옆)(07:30)");

    }
}


package com.Sapi3DTourMongo.Sapi3DTourMongo.requests;

import java.util.Set;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

public class RegistrationRequest {

	@NotNull
    @NotEmpty
	private String username;

	@NotNull
    @NotEmpty
	@Pattern(regexp="^(.+)@(.+)$")
	private String emailAddress;

	@NotNull
    @NotEmpty
	@Pattern(regexp="^\\d{10}$")
	private String phoneNumber;

	@NotNull
    @NotEmpty
    private Set<String> roles;

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getEmailAddress() {
		return emailAddress;
	}

	public void setEmailAddress(String emailAddress) {
		this.emailAddress = emailAddress;
	}

	public String getPhoneNumber() {
		return phoneNumber;
	}

	public void setPhoneNumber(String phoneNumber) {
		this.phoneNumber = phoneNumber;
	}

	public Set<String> getRoles() {
		return roles;
	}

	public void setRoles(Set<String> roles) {
		this.roles = roles;
	}

}


import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.Date;
import java.text.SimpleDateFormat;

public class killjobServlet extends HttpServlet {
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String username = (String) request.getSession().getAttribute("username");
        if(username==null){
            return;
        }
        ServletContext context=getServletContext();
        String jobid = request.getParameter("j");
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        synchronized(this){
            String logpath=context.getRealPath("/userdata/kill.log");
            PrintWriter logout = new PrintWriter(new BufferedWriter(new FileWriter(logpath,true)));
            logout.write(df.format(new Date())+"\t"+username+"\t"+jobid+"\r\n");
            logout.close();
        }
        Process process = Runtime.getRuntime().exec(new String[]{"/bin/sh","-c","hadoop job -kill "+jobid},null,null);

    }
}


package com.plk.sbdemo.admin.web.controller.user;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.UsernamePasswordToken;
import org.apache.shiro.subject.Subject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.plk.sbdemo.admin.web.ApiResponse;

@Controller
public class LoginController {

	@GetMapping("/login")
	public String login() {
		return "user/login";
	}

	@PostMapping("/verify")
	@ResponseBody
	public ApiResponse verify(String username, String password) {
		UsernamePasswordToken token = new UsernamePasswordToken(username, password);
		Subject currentUser = SecurityUtils.getSubject();
		currentUser.login(token);

		return ApiResponse.success();
	}

	@GetMapping("/logout")
	public String logout() {
		Subject currentUser = SecurityUtils.getSubject();
		currentUser.logout();
		return "login";
	}
}


package com.practice.core.rest;

import java.util.Date;

public class Message {

	private int id;
	private String message;
	private String author;
	private Date created;

	public Message(){}

	public Message(int id, String message, String author, Date created) {
		this.id = id;
		this.message = message;
		this.author = author;
		this.created = created;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public String getAuthor() {
		return author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	public Date getCreated() {
		return created;
	}

	public void setCreated(Date created) {
		this.created = created;
	}

	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append("id = ").append(this.getId()).append("\n").append("author= ").append(this.getAuthor()).append("\n")
				.append("message = ").append(this.getMessage()).append("\n");
		return sb.toString();
	}

}


/Personal Assistant Terminal/Personal Assistant/src/SaveFile.java

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.Scanner;

public class SaveFile {

  Home home;
  boolean opened;

  public SaveFile(Home home) {
    this.home = home;
    this.opened = false;
  }

  public String save() {
    try {
      FileWriter writer = new FileWriter(home.id + ".txt");
      for (Task t : home.schedule.tasks) {
        writer.append(t.toString() + "\n");
      }
      writer.close();
      return "Saved successfully.";
    } catch (Exception e) {
      return "Unable to save.";
    }

  }

  public String open() {
    try {
      Scanner scan = new Scanner(new FileReader(home.id + ".txt"));
      Schedule s = new Schedule();
      while (scan.hasNextLine()) {
        s.commandReader(scan.nextLine());
      }
      home.schedule = s;
      return "Opened successfully.";
    } catch (Exception e) {
      return "Unable to open.";
    }
  }
}


package advance.data_structure.hashmap;

import java.util.Objects;

/**
 * @author Maria
 * @program JavaDaily
 * @date 2020/3/21 21:29
 */
public class Person {
    private String name;
    private int age;
    private int gender;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Person person = (Person) o;
        return age == person.age &&
                Objects.equals(name, person.name) &&
                Objects.equals(gender, person.gender);
    }

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

    public static void main(String[] args) {
        Person p1 = new Person();
        p1.name = "p1";
        p1.age = 18;
        p1.gender = 0;
        Person p2 = new Person();
        p2.name = "p1";
        p2.age = 18;
        p2.gender = 0;
        HashMap<Person,Integer> map = new HashMap<>();
        map.put(p1,108);
        System.out.println(map.get(p2));
    }
}


package net.genin.remote.eventbus;

import com.google.common.base.Preconditions;
import com.google.common.eventbus.EventBus;

/**
 * EventBus Implementation.
 */
abstract class EventBusServer implements RemoteEventBusServer {

    public final EventBus eventBus;
    protected String groupName;
    protected Integer port;

    public EventBusServer() {
        eventBus = new EventBus();
    }

    protected void sendToBus(Object o){
        eventBus.post(o);
    }

    @Override
    public void register(Object object){
        Preconditions.checkNotNull(object);
        eventBus.register(object);
    }

    @Override
    public void unregister(Object object){
        Preconditions.checkNotNull(object);
        eventBus.unregister(object);
    }

    @Override
    public String getGroupName() {
        return groupName;
    }

    @Override
    public void setGroupName(String groupName) {
        this.groupName = groupName;
    }

    @Override
    public Integer getPort() {
        return port;
    }
}


package com.example.demo.Pulse;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.util.Date;

public class pulse {
    String phone;
    String pulse;
    String sid;
    @JsonFormat(pattern = "yyyy-MM-dd")
    Date date;

    public pulse() {
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getPulse() {
        return pulse;
    }

    public void setPulse(String pulse) {
        this.pulse = pulse;
    }

    public String getSid() {
        return sid;
    }

    public void setSid(String sid) {
        this.sid = sid;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public pulse(String phone, String pulse, String sid, Date date) {
        this.phone = phone;
        this.pulse = pulse;
        this.sid = sid;
        this.date = date;
    }
}


package com.example.ashishkumar.weather.model;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

import java.util.List;

public class SearchResultResponse {

    @SerializedName("message")
    @Expose
    private String message;
    @SerializedName("code")
    @Expose
    private String code;
    @SerializedName("count")
    @Expose
    private long count;
    @SerializedName("list")
    @Expose
    private List<City> list = null;

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public long getCount() {
        return count;
    }

    public void setCount(long count) {
        this.count = count;
    }

    public List<City> getList() {
        return list;
    }

    public void setList(List<City> list) {
        this.list = list;
    }

}


# webboilerplate
Let's start something new

## Download
```
git clone git@github.com:pennywise81/webboilerplate.git PROJECTNAME
```

## Download without version control
```
git clone --depth=1 git@github.com:pennywise81/webboilerplate.git PROJECTNAME && rm -rf PROJECTNAME/.git
```

## NPM tasks

### Install

Installs dependencies in `./node_modules/`
```
npm install
```

### Start

Runs grunt's `build` tasks and starts a webserver on http://localhost:8080 with `./htdocs/` as entrypoint
```
npm start
```

## Grunt tasks

Compile jade templates.
```
grunt jade
```

Clean files and folders.
```
grunt clean
```

Run predefined tasks whenever watched files change.
```
grunt watch
```

Minify files with UglifyJS.
```
grunt uglify
```

Compile Sass to CSS
```
grunt sass
```

Copy files.
```
grunt copy
```

Clean dist dir and build all
```
grunt build
```

## To do
- [ ] enable Grunt staging
- [ ] enable livereload "on-the-fly" in dev mode
- [ ] update package.json
- [ ] update README


package dev.morphia.test.aggregation.model;

import java.util.Objects;

import dev.morphia.annotations.Entity;
import dev.morphia.annotations.Id;

@Entity
public class ProjectedBook {
    @Id
    private Integer id;
    private String title;
    private ProjectedAuthor author;

    ProjectedBook() {
    }

    public ProjectedBook(Integer id, String title, String last, String first) {
        this.id = id;
        this.title = title;
        author = new ProjectedAuthor(last, first);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, title, author);
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof ProjectedBook)) {
            return false;
        }
        final ProjectedBook that = (ProjectedBook) o;
        return Objects.equals(id, that.id) &&
                title.equals(that.title) &&
                author.equals(that.author);
    }
}


package com.epam.jamp.troubleshooting.five;

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

public class FileReader {

    public List<String> read(File file) throws InterruptedException {
        System.out.println("Reading started");
        List<String> result = new ArrayList<String>();
        BufferedReader bufferedReader = null;
        try {
            bufferedReader = new BufferedReader(new java.io.FileReader(file));
            String line;
            while ((line = bufferedReader.readLine()) != null) {
                result.add(line.substring(0, 3));
                Thread.sleep(30);
            }
        } catch (IOException e) {
            System.err.println(e.getMessage());

        } finally {
            if (bufferedReader != null) {
                try {
                    bufferedReader.close();
                } catch (IOException e) {
                    System.err.println(e.getMessage());
                }
            }
        }
        return result;
    }
}


package function.socket;

import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Arrays;

/**
 * InetAddress类的使用
 *
 * @author kimtian
 */
public class InetAddressOperate {
    public static void main(String[] args) throws UnknownHostException {
        //获取本机的InetAddress实例
        InetAddress localAddress = InetAddress.getLocalHost();
        System.out.println("获取当前计算机的名称：" + localAddress.getHostName());
        System.out.println("获取主机的IP地址：" + localAddress.getHostAddress());
        //获取字节数组形式的IP地址
        byte[] bytes = localAddress.getAddress();
        System.out.println("字节数组形式的IP：" + Arrays.toString(bytes));
        //直接输出InetAddress对象--会输出用户名和IP地址
        System.out.println(localAddress);

        //根据主机名获取InetAddress实例
        InetAddress inetAddress = InetAddress.getByName("KIMTIAN-MC0");
        System.out.println(inetAddress);

        //根据IP地址获取相应的实例信息
        InetAddress inetAddress2 = InetAddress.getByName("10.43.19.128");
        System.out.println(inetAddress2);
    }
}


package com.lawer.service.impl;

import com.lawer.dao.ProcessTypeDao;
import com.lawer.domain.ProcessType;
import com.lawer.model.SearchParam;
import com.lawer.service.ProcessTypeService;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service(value = "processTypeService")
@Transactional
public class ProcessTypeServiceImpl extends BaseServiceImpl implements ProcessTypeService {

	private static Logger logger = Logger.getLogger(ProcessTypeServiceImpl.class);

	@Autowired
	private ProcessTypeDao processTypeDao;

	@Override
	public List<ProcessType> findAllByParam(SearchParam param) {
		List<ProcessType> list = processTypeDao.findByCriteria(param);
		return list;
	}
	@Override
	public List<ProcessType> findPyList() {
		return processTypeDao.findPyList();
	}

	@Override
	public ProcessType findPyById(Integer id) {
		return processTypeDao.find(id);
	}

}


package org.freejava.dependency.graphtransformer.impl;

import java.util.Collection;
import java.util.HashSet;
import java.util.Set;

import org.freejava.dependency.graphtransformer.GraphTransformer;
import org.freejava.dependency.model.Edge;
import org.freejava.dependency.model.Graph;
import org.freejava.dependency.model.Name;

public class RetainOnlyFromSelectedNamesGraphTransformerImpl implements GraphTransformer<Name> {
    private Collection<String> names;
    public RetainOnlyFromSelectedNamesGraphTransformerImpl(Collection<String> names) {
        this.names = names;
    }
    public Graph<Name> transform(Graph<Name> graph) {

        Set<Edge<Name>> edges = new HashSet<Edge<Name>>();
        for (Edge<Name> edge : graph.getEdges()) {
            if (names.contains(edge.getFrom().getNode().getName())) {
                edges.add(edge);
            }
        }

        Graph<Name> result = new Graph<Name>(edges);

        return result;
    }

}


package com.sky.model;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.sky.core.model.BaseModel;
import lombok.Data;

import java.math.BigDecimal;

/**
 * Created by ThinkPad on 2019/12/30.
 */
@Data
@TableName("stock_profit_avarege_rate")
public class StockProfitAvaregeRate extends BaseModel<StockProfitAvaregeRate> {

    /**
     *编码
     */
    @TableField("stock_code")
    private String stockCode ;

    /**
     *统计年限
     */
    @TableField("static_year")
    private Integer staticYear ;

    /**
     *上市日期
     */
    @TableField("publish_time")
    private String publishTime ;

    /**
     *上市时间
     */
    @TableField("space_year")
    private Integer spaceYear ;

    /**
     *利润增长概率
     */
    @TableField("average_grow_rate")
    private BigDecimal averageGrowRate ;

    /**
     *利润增长值(亿)
     */
    @TableField("average_grow_profit")
    private BigDecimal averageGrowProfit ;

}


package com.wowapp.rps.component.command;

import com.wowapp.rps.component.Context;
import com.wowapp.rps.domain.dto.UserDto;
import com.wowapp.rps.domain.entity.User;
import com.wowapp.rps.service.UserService;

import java.util.Optional;

import static com.wowapp.rps.component.util.CommandLineUtil.print;

public class AuthCommand implements Command {

    private String userName;
    private UserService userService;

    public AuthCommand(String userName, UserService userService) {
        this.userName = userName;
        this.userService = userService;
    }

    @Override
    public boolean execute() {
        Optional<User> user;
        if (userService.exists(userName)) {
            user = userService.get(userName);
        } else {
            UserDto userDto = new UserDto();
            userDto.setName(userName);
            user = userService.create(userDto);
        }
        if (!user.isPresent()) {
            return false;
        }
        Context.THIS.setCurrentUser(user.get());
        print("Welcome, " + userName + "!");
        return true;
    }
}


package com.tngtech.archunit.junit.internal.testutil;

import org.junit.jupiter.api.extension.AfterEachCallback;
import org.junit.jupiter.api.extension.ExtensionContext;
import org.junit.jupiter.api.extension.ParameterContext;
import org.junit.jupiter.api.extension.ParameterResolutionException;
import org.junit.jupiter.api.extension.ParameterResolver;

public class TestLogExtension implements ParameterResolver, AfterEachCallback {
    private final LogCaptor logCaptor = new LogCaptor();

    @Override
    public boolean supportsParameter(ParameterContext parameterContext, ExtensionContext extensionContext) throws ParameterResolutionException {
        return LogCaptor.class.equals(parameterContext.getParameter().getType());
    }

    @Override
    public Object resolveParameter(ParameterContext parameterContext, ExtensionContext extensionContext) throws ParameterResolutionException {
        return logCaptor;
    }

    @Override
    public void afterEach(ExtensionContext context) {
        logCaptor.cleanUp();
    }
}


/* File Header */
import java.util.*;

/* Class Header */
public class EncryptionBot
{
    private String simplePass;
    private String encryptedPass;
    private String encryptionKey;

    public EncryptionBot(String simplePass)
    {
        this.simplePass = simplePass;
        encryptionKey = selectEncryptionScheme();
        encryptedPass = encryptedPassword(simplePass, encryptionKey);
    }

    public EncryptionBot(String simplePass, String encKey)
    {
        this.simplePass = simplePass;
        encryptionKey = encKey;
        encryptedPass = encryptedPassword(simplePass, encryptionKey);
    }

    // Selects encryption scheme at random
    public String selectEncryptionScheme()
    {
        return "";
    }

    // Performs encryption, returns encrypted password.
    public String encryptedPassword(String simplePass, String encKey)
    {
        return "test password";
    }

    public String getEncryptedPassword()
    {
        return encryptedPass;
    }
}


package com.sewa.mobil;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.sewa.mobil.domain.Pelanggan;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Andito19 on 8/30/2018.
 */

public class ListPelangganAdapter extends BaseAdapter {

    private Context context;
    private List<Pelanggan> pelanggans=new ArrayList<>();
    private TextView lbNama, lbtlp;

    public ListPelangganAdapter(Context context,List<Pelanggan> pelanggans){
        this.context=context;
        this.pelanggans=pelanggans;
    }

    @Override
    public int getCount() {
        return pelanggans;
    }

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

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

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        return null;
    }

}


package com.zhao.springcloud.controller;

import com.zhao.springcloud.entities.CommentResult;
import com.zhao.springcloud.entities.Payment;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * @Description: desc
 * @Author zhaoxuezhao
 * @Date 2021/1/26 11:11 上午
 */
@RestController
@RequestMapping("/consumer/payment")
@Slf4j
public class OrderController {

    public static final String PAYMENT_URL = "http://cloud-consul-payment/payment";

    @Resource
    private RestTemplate restTemplate;

    @GetMapping("/test")
    public CommentResult<String> getById() {
        log.info("OrderController-consul-getById-start-{}");
        CommentResult commentResult = restTemplate.getForObject(PAYMENT_URL + "/consul", CommentResult.class);
        log.info("OrderController-consul-getById-end-{}", commentResult);
        return commentResult;
    }

}


# Cooking with Alexa VR
Unity VR cooking game integrated with Alexa

## Getting Started
These instructions will guide you through the setup process

### Unity Setup
Import files in CUhackit2019 folder to Unity

### Webserver Setup
Start by install Node.js

Install the [Heroku Toolkit](https://toolbelt.heroku.com/)

Inside install location, create folder node_module

Import files from ServerFiles into node_module folder

In a command line, enter the following
```
cd node_alexa
git init .
git add .
git commit -m "Init"
heroku apps:create "yourappname"
git push heroku master
heroku ps:scale = web 0
heroku ps:scale = web 1
```
Server should now be up and running at "https://yourappname.herokuapp.com"

### Alexa Skills Setup
Using files within AlexaSkills,

Import contents of intent.json into your intent schema

Import files from folder lambda to the lambda section of your Alexa Skill

## Running Game
Start interaction with Alexa by saying, "Alexa, start simulation"

Follow her prompts and have fun!


package uk.gov.hmcts.reform.sscs.ccd.presubmit.writefinaldecision.esa;

import java.util.function.Function;
import uk.gov.hmcts.reform.sscs.ccd.domain.SscsCaseData;
import uk.gov.hmcts.reform.sscs.ccd.presubmit.writefinaldecision.ActivityQuestion;
import uk.gov.hmcts.reform.sscs.ccd.presubmit.writefinaldecision.ActivityType;

/**
 * Enum to encapsulate binding between an activity question key, and the actual question text.
 */
public class EsaActivityQuestion implements ActivityQuestion {

    final EsaQuestionKey<String> key;
    final String value;

    public EsaActivityQuestion(EsaQuestionKey key, String value) {
        this.key = key;
        this.value = value;
    }

    public String getKey() {
        return key.getKey();
    }

    public String getValue() {
        return value;
    }

    @Override
    public ActivityType getActivityType() {
        return key.getActivityType();
    }

    public Function<SscsCaseData, String> getAnswerExtractor() {
        return key.getAnswerExtractor();
    }
}


package Dreamlove.size;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

@XmlRootElement(name = "size")
@XmlType(propOrder = {"width", "height", "depth"})
public class size {
    private int width;
    private int height;
    private int depth;
    private String unit;

    public size(){}

    public String getUnit() {
        return unit;
    }

    public int getDepth() {
        return depth;
    }

    public int getHeight() {
        return height;
    }

    public int getWidth() {
        return width;
    }

    @XmlAttribute(name = "unit")
    public void setUnit(String unit) {
        this.unit = unit;
    }
    @XmlElement(name = "depth")
    public void setDepth(int depth) {
        this.depth = depth;
    }
    @XmlElement(name = "height")
    public void setHeight(int height) {
        this.height = height;
    }
    @XmlElement(name = "width")
    public void setWidth(int width) {
        this.width = width;
    }
}


package useredit.utilities;

import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;

import java.io.IOException;

public class StageCoordinator {
    private Stage stage;
    private static StageCoordinator stageCoordinator;
    private StageCoordinator(){

    }
    public synchronized static StageCoordinator getInstance(){
        if(stageCoordinator ==null){
            stageCoordinator =new StageCoordinator();
        }
        return stageCoordinator;
    }
    public void setStage(Stage stage){
        if(this.stage!=null)
            throw new RuntimeException("stage is already defined ");
        this.stage=stage;
    }
    public void goToUserPage(){
        try {
            Parent root =FXMLLoader.load(getClass().getResource("/Views/UserPage.fxml"));
            Scene scene = new Scene(root);
            stage.setScene(scene);
        } catch (IOException e){
            e.printStackTrace();
        }
    }
}


package org.smart4j.plugin.rest;

import org.apache.cxf.interceptor.Interceptor;
import org.apache.cxf.message.Message;

import java.util.ArrayList;
import java.util.List;

/**
 * ==========================
 * 功能描述：REST 助手类
 * ==========================
 *
 * @author weilai
 * @version 1.0.0
 */
public class RestHelper {

    private static final List<Object> providerList = new ArrayList<Object>();
    private static final List<Interceptor<? extends Message>> inInterceptorList = new ArrayList<Interceptor<? extends Message>>();
    private static final List<Interceptor<? extends Message>> outInterceptorList = new ArrayList<Interceptor<? extends Message>>();

    static {
    }

    /**
     * 发布 REST 服务
     *
     * @param wsdl
     * @param resourceClass
     */
    public static void publishService(String wsdl, Class<?> resourceClass) {
    }

    /**
     * 创建 REST 服务
     *
     * @param wsdl
     * @param resourceClass
     * @param <T>
     * @return
     */
    public static <T> T createClient(String wsdl, Class<? extends T> resourceClass) {
        return null;
    }

}


package com.deltixlab.model.web;

import com.deltixlab.model.Level;
import com.deltixlab.model.db.Event;

import java.util.Date;
import java.util.Optional;

/**
 * UI representation of {@link Event} instance.
 */
public class EventData {
    private final Event event;

    public EventData() {
        this.event = new Event();
    }

    public EventData(Event event) {
        this.event = Optional.ofNullable(event).orElseGet(Event::new);
    }

    public Date getTimestamp() {
        return event.getTimestamp();
    }

    public EventData setTimestamp(Date timestamp) {
        event.setTimestamp(timestamp);
        return this;
    }

    public Level getLevel() {
        return event.getLevel();
    }

    public EventData setLevel(Level level) {
        event.setLevel(level);
        return this;
    }

    public String getDescription() {
        return event.getDescription();
    }

    public EventData setDescription(String description) {
        event.setDescription(description);
        return this;
    }
}


# About
I'm Carsten Wulff, and I'm one of the engineers that worked on the
SAADC on nRF52. These examples are some of my barebone tricks and tips
on how SAADC can be used.

# To compile
Ideally it should be
```
make
make flash_softdevice
make flash
```

But rarely that will suffice, you probably have to at least change
SDKPATH in the Makefile

# To run
Connect using BLE UART application (i.e iOS Nordic UART app), and send commands

- 1 for ex1_scan_multiple_channels
- 2 for ex2_differentiation

# Origin
I've based this example on the ble_peripheral/ble_app_uart example in nRF5_SDK_11, so you
need to download that.

# Excuses
I'm not a professional embedded programmer (i.e I don't get paid to
program embedded code), so I'm sorry if you find these examples a bit
messy.

Any concrete criticism/improvment requests are welcome. Send me a
private message on http://devzone.nordicsemi.com, my nick is cwulff

# Disclamer
This is not an official Nordic Semiconductor release, it's examples
I've compiled in my "offline" time.


package com.joonghyun.dispatch;

import com.joonghyun.function.ConferenceFunction;
import com.joonghyun.function.WakeupFunction;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import static org.junit.Assert.*;

/**
 * Created by joonghyun on 2017. 5. 4..
 */
@RunWith(SpringRunner.class)
@SpringBootTest
public class MessageDispatchTest {

    @Autowired
    private MessageDispatch messageDispatch;

    static final Long ROOM_KEY = 999L;

    @Test
    public void message_최초시작() throws Exception {
        String result = messageDispatch.message(ROOM_KEY, "#안녕봇");
        Assert.assertEquals(WakeupFunction.Message.WAKEUP, result);
    }

    @Test
    public void message_회의실() throws Exception {
        String result = messageDispatch.message(ROOM_KEY, "회의실");
        Assert.assertEquals(ConferenceFunction.Message.CONFERENCE, result);
    }

}


package com.matovic.conntroller;

import java.security.Principal;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import com.matovic.entities.User;
import com.matovic.services.TaskService;
import com.matovic.services.UserService;

@Controller
public class ProfileController {

	@Autowired
	private UserService userService;

	@Autowired
	private TaskService taskService;

	@GetMapping("/profile")
	public String showProfilePage(Model model, Principal principal, HttpSession session) {

		String email = principal.getName();
		User user = userService.findOne(email);

		model.addAttribute("tasks", taskService.findUserTask(user));
		session.setAttribute("User", user);
		session.setAttribute("btnLogOut", true);

		return "views/profile";
	}
}


package com.learn.feign;

import com.learn.api.R;
import com.learn.clients.IUserAuthFeignClient;
import com.learn.exception.ValidException;
import com.learn.utils.JwtGeneratorUtil;
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.ExpiredJwtException;
import io.jsonwebtoken.SignatureException;
import org.apache.commons.lang.StringUtils;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserAuthFeignClient implements IUserAuthFeignClient {

    @Override
    public R<String> validToken(String token) {
        if(StringUtils.isBlank(token)){
            throw new ValidException("token为空");
        }
        try {
            Claims claims = JwtGeneratorUtil.parseToken(token);
            return new R.Builder().setData(claims.get("uid").toString()).buildOk();
        }catch (ExpiredJwtException e){
            return new R.Builder().buildCustomize("token已过期");
        }catch (SignatureException e){
            return new R.Builder().buildCustomize("签名校验失败");
        }
    }
}


package com.security.engine;

import java.io.InputStream;

import org.xmlpull.v1.XmlPullParser;

import android.util.Xml;

import com.security.domain.UpdateInfo;

public class UpdateInfoParser
{

	public static UpdateInfo getUpdateInfo(InputStream is) throws Exception
	{
		UpdateInfo info = new UpdateInfo();
		XmlPullParser xmlPullParser = Xml.newPullParser();
		xmlPullParser.setInput(is, "utf-8");
		int type = xmlPullParser.getEventType();
		while(type != XmlPullParser.END_DOCUMENT)
		{
			switch(type)
			{
				case XmlPullParser.START_TAG :
					if(xmlPullParser.getName().equals("version"))
					{
						info.setVersion(xmlPullParser.nextText());
					}
					else if(xmlPullParser.getName().equals("description"))
					{
						info.setDescription(xmlPullParser.nextText());
					}
					else if(xmlPullParser.getName().equals("apkurl"))
					{
						info.setUrl(xmlPullParser.nextText());
					}
					break;

				default :
					break;
			}
			type = xmlPullParser.next();
		}
		return info;
	}

}


package com.smartprojectmanager.start.controller;

import com.smartprojectmanager.start.dao.UserRepository;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
 @Controller
public class MyController {
	@Autowired
	private UserRepository userRepository;

	@RequestMapping("/")
	public String home(Model model) {
		model.addAttribute("titles","Smart Contact Manager");
		return "home";

	}
	@RequestMapping("/about")
	public String about(Model model) {
		model.addAttribute("titles","Smart Contact Manager");
		return "about";

	}
	@RequestMapping("/register")
	public String register(Model model) {
		model.addAttribute("titles","Smart Contact Manager");
		return "register";

	}
	@RequestMapping("/signin")
	public String signin(Model model) {
		model.addAttribute("titles","Smart Contact Manager");
		return "signin";

	}

}


# Daily::Trending::Apps

This is a ruby CLI Gem that displays a list of new and updated apps froms the Google Play Store,
follow CLI instructions to learn more about the apps that interest you.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'daily-trending-apps'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install daily-trending-apps

## Usage

 Type the following command to start this gem

    $ daily-trending-apps

## Development

After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/'badlychadly'/daily-trending-apps.

## License
The gem is available as open source under the terms of the [Mit License](http://opensource.org/licenses/MIT).


package com.github.nija123098.evelyn.discordobjects.wrappers.event.events;

import com.github.nija123098.evelyn.discordobjects.wrappers.Guild;
import com.github.nija123098.evelyn.discordobjects.wrappers.User;
import com.github.nija123098.evelyn.discordobjects.wrappers.event.BotEvent;
import sx.blah.discord.handle.impl.events.guild.member.NicknameChangedEvent;

/**
 * Made by nija123098 on 3/31/2017.
 */
public class DiscordNicknameChange implements BotEvent {
    private NicknameChangedEvent event;
    public DiscordNicknameChange(NicknameChangedEvent event) {
        this.event = event;
    }
    public Guild getGuild(){
        return Guild.getGuild(this.event.getGuild());
    }
    public User getUser(){
        return User.getUser(this.event.getUser());
    }
    public String getOldUsername(){
        return this.event.getOldNickname().orElse(null);
    }
    public String getNewUsername(){
        return this.event.getNewNickname().orElse(null);
    }
}


package com.example.demo.JUC;

import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;

/**
 * @author Administrator
 * @create 2020-07-21 21:35
 */
public class CompletableFutureDemo {

    public static void main(String[] args) throws ExecutionException, InterruptedException {

        //同步
        CompletableFuture<Void> completableFuture =CompletableFuture.runAsync(()->{
            System.out.println(Thread.currentThread().getName()+"\tCompletableFuture.runAsync");
        });
        completableFuture.get();

        //异步
        CompletableFuture<Integer> completableFuture1 = CompletableFuture.supplyAsync(()->{
            System.out.println(Thread.currentThread().getName()+"\tCompletableFuture.supplyAsync");
            return 1024;
        });
        completableFuture1.whenComplete((t,u)->{
            System.out.println("---t="+t);
            System.out.println("---u="+u);

        }).get();

    }
}


package com.johnsoft.app.services;

import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        TextView textView = (TextView)findViewById(R.id.content);
        if (textView != null) {
            String prefix;
            try {
                ApplicationInfo applicationInfo = getPackageManager().getApplicationInfo(getPackageName(),
                        PackageManager.GET_META_DATA);
                prefix = applicationInfo.metaData.getString("PF");
            } catch (PackageManager.NameNotFoundException e) {
                e.printStackTrace();
                prefix = "Unknown";
            }
            textView.setText(prefix + "\n" + Settings.CONTENT);
        }
    }
}


package com.didi.lg.rocketmqdemo.demo.controller;

import com.didi.lg.rocketmqdemo.demo.entity.Status;
import com.didi.lg.rocketmqdemo.demo.quartz.Schedual;
import org.quartz.Scheduler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author lg
 * @date 2018-08-28
 */

@RestController
public class control {

    @Autowired
    Scheduler scheduler;
    @Autowired
    Schedual schedual;

    @RequestMapping("/stop")
    public void stop() {
        try {
            scheduler.shutdown();
            scheduler.clear();
        } catch (Exception e) {

        }
    }

    @RequestMapping("/start")
    public void start() {
        try {
            schedual.start();
        } catch (Exception e) {

        }
    }

    @RequestMapping("/stop1")
    public void update(int x) {
        Status.setStatus(x);
    }

}


# Git vs GitHub

* **Git** is a version control software program used in code editing.
It is **DVCS** system that allows multiple users to colaberate easily. Git also allows all versions of the code worked on to be saved so the differant itterations made along the way can be revisited and tracked. This is true for each developer working on the colaberation as well as the project as a whole.

* **GitHub** is the application or cloud where developers code drafts and final projects live. It is the way to share your code with others. It also acts as your safe keeping so if code is lost locally you will always have access to your code from the cloud.

Important to note:
There are two types of version control that are used.

1. *Centralized Version Control System* or **CVCS**-This system entails a single server storing all changes and file versions,
which can be accessed by various clients.
1. *Distributed Version Control systems* or **DVCS**- This system entails a single server storing all changes and file versions, which can be accessed by various clients.


package com.xu.day28__JDBC;

import org.junit.Test;

import java.sql.*;

public class JDBC {
    @Test
    public void test() throws SQLException, ClassNotFoundException {

        Class.forName("com.mysql.jdbc.Driver");
        Connection con = DriverManager.getConnection(
                "jdbc:mysql://localhost:3306/news?serverTimezone=UTC",
                "root",
                "123456");

        /**
         * 预编译
         */
        String sql = "SELECT * FROM tbl_user where username = ? and password = ?";
        PreparedStatement stmt = con.prepareStatement(sql);
        stmt.setString(1, "1\"#");
        stmt.setString(2, "1");
        ResultSet rs = stmt.executeQuery();

//        ResultSet rs = stmt.executeQuery();
        while (rs.next()) {
            String x = rs.getString("id");
            String s = rs.getString("password");
            String f = rs.getString("username");
            System.out.println(x + s + f);
        }

        rs.close();
        stmt.close();
        con.close();
    }
}


# Shopify Event Logger Backend API
The project dump event from shopify using nodejs threads and also lets user get local db dump events and search them by to and from date and searh message .</br>

### Demo API HOST
https://fathomless-lake-34348.herokuapp.com/

### Demo Frontend
https://shopifyeventlogs.web.app/

### Prerequisites

Please install all node packages from package.json

### Installing

npm install

## Built With
* [Node](https://nodejs.org/en/) - Server
* [Express](https://github.com/expressjs) - The web framework used
* [Mongodb](https://www.mongodb.com/) - Used NoSql MongoDb
* [mongoosejs](https://mongoosejs.com/) - elegant mongodb object modeling for node.js
* [heroku](https://devcenter.heroku.com/) - Hosted Backend Server on heroku free hosting
* [mlab](https://mlab.com/) - Hosted Database on Mlab free hosting
* [Structure] - Custom structure

## Authors

* **Saeel Parulekar** - *Initial work* - [saeel123](https://github.com/saeel123)


package com.gewara.api.vo.order;

import java.io.Serializable;

import com.gewara.api.vo.goods.GoodsVo;

public class CheckAddOrderGoodsGiftRes implements Serializable{

	/**
	 *
	 */
	private static final long serialVersionUID = -1237001182538322948L;

	private Integer quantity;//赠品数量

	private boolean isGiftExist;//礼品是否存在：true:存在；false:不存在

	private GoodsVo goods;//物品

	public CheckAddOrderGoodsGiftRes(){}

	public CheckAddOrderGoodsGiftRes(Integer quantity, boolean isGiftExist, GoodsVo goods){
		this.quantity = quantity;
		this.isGiftExist = isGiftExist;
		this.goods = goods;
	}

	public Integer getQuantity() {
		return quantity;
	}

	public void setQuantity(Integer quantity) {
		this.quantity = quantity;
	}

	public GoodsVo getGoods() {
		return goods;
	}

	public void setGoods(GoodsVo goods) {
		this.goods = goods;
	}

	public boolean isGiftExist() {
		return isGiftExist;
	}

	public void setGiftExist(boolean isGiftExist) {
		this.isGiftExist = isGiftExist;
	}
}


public class WordEntry {
	private String word="";
	//private MyLinkedList<Position> mypositions = new MyLinkedList();
	private AvlTree<Position> mypositions = new AvlTree();
public WordEntry(String word){
	this.word=word;
}
public void addPosition(Position position){
	//mypositions.addFirst(position);
	//System.out.println("me called");
	if(position!=null)
	mypositions.Insert(position,position.getWordIndex());
}
public void addPositions(MyLinkedList<Position> positions){
	//System.out.println("me called");
	if(positions==null)
		return;
	for(int i=1;i<=positions.size;i++)
		if(mypositions.getElementati(i)!=null)
		mypositions.Insert(positions.getElementati(i),positions.getElementati(i).getWordIndex());

}
public void addPositions(AvlTree<Position> positions){
	if(positions==null)
		return;
	for(int i=1;i<=positions.size;i++)
		if(mypositions.getElementati(i)!=null)
		mypositions.Insert(positions.getElementati(i),positions.getElementati(i).getWordIndex());

}
public String getstring(){
	return word;
}
public AvlTree<Position> getAllPositionsForThisWord() {
	return mypositions;
}
}


package by.iba.bot.chat.dao;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
import org.springframework.data.redis.core.RedisOperations;
import org.springframework.data.redis.core.SessionCallback;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Repository;

@Repository
public class MessageDAORedisImpl implements MessageDAO {

	@Autowired
	private StringRedisTemplate redisTemplate;

	@Override
	public String getValueByKey(String key) {

		return redisTemplate.opsForValue().get(key);
	}

	@Override
	public void updateValuesByKeys(Map<String, String> messageTexts) {

		redisTemplate.execute(new SessionCallback<List<Object>>() {
			public List<String> execute(RedisOperations operations) throws DataAccessException {
				operations.multi();
				for (String key : messageTexts.keySet()) {
					operations.opsForValue().set(key, messageTexts.get(key));
				}
				return operations.exec();
			}
		});
	}

}


package ru.salenko.mtp.controller;

import org.springframework.web.bind.annotation.*;
import ru.salenko.mtp.dto.BankItem;
import ru.salenko.mtp.services.MtpService;

import java.util.List;
import java.util.Optional;

/**
 * Контроллер для выполнения операций с банками
 */
@RestController
@RequestMapping(value = "/api/bank")
public class BankController {

    private final MtpService mtpService;

    public BankController(MtpService mtpService) {
        this.mtpService = mtpService;
    }

    @GetMapping("/list")
    public List<BankItem> getBankItems() {
        return mtpService.getBanks();
    }

    @PostMapping(value = "/findByCode")
    public Optional<BankItem> findByCode(@RequestBody String code) {
        return mtpService.findBankByCode(code);
    }

    public void delete(String code) {
        mtpService.deleteBank(code);
    }

    @PutMapping(value = "/save")
    public void save(@RequestBody BankItem bank) {
        mtpService.createBank(bank);
    }
}


package helper;

import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;
import java.util.ArrayList;
import java.util.List;

public class ViewPagerAdapter extends FragmentPagerAdapter {
    private final List<String> lstTitles = new ArrayList();
    private final List<Fragment> lstfragment = new ArrayList();

    public List<Fragment> getLstfragment() {
        return this.lstfragment;
    }

    public ViewPagerAdapter(FragmentManager fragmentManager) {
        super(fragmentManager);
    }

    public Fragment getItem(int i) {
        return this.lstfragment.get(i);
    }

    public int getCount() {
        return this.lstfragment.size();
    }

    public CharSequence getPageTitle(int i) {
        return this.lstTitles.get(i);
    }

    public void AddFragment(Fragment fragment, String str) {
        this.lstfragment.add(fragment);
        this.lstTitles.add(str);
    }
}


package de.teyzer.genie.model;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;

public class Artist {
    public final ArrayList<Album> albums;
    private final String name;

    public Artist(String name) {
        albums = new ArrayList<>();
        this.name = name;
    }

    public void addAlbum(Album album) {
        albums.add(album);
    }

    public String getName() {
        return name;
    }

    public ArrayList<Album> getAlbums() {
        return albums;
    }

    public ArrayList<Track> getAllTracks() {
        ArrayList<Track> tracks = new ArrayList<>();
        for (Album album : albums) {
            tracks.addAll(album.getTracks());
        }

        Collections.sort(tracks, new Comparator<Track>() {
            @Override
            public int compare(Track lhs, Track rhs) {
                return lhs.getTitle().compareTo(rhs.getTitle());
            }
        });
        return tracks;
    }
}


package cc.lecent.ywgk.reserve.fragment;

import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import cc.lecent.bbc.base.BaseFragment;
import cc.lecent.ywgk.reserve.R;
import cc.lecent.ywgk.reserve.databinding.MeetFragmentBinding;
import cc.lecent.ywgk.reserve.viewmodel.MeetModel;

/**
 * 会见预约
 */
public class MeetFragment extends BaseFragment {
    private MeetFragmentBinding binding;
    private MeetModel model;

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        binding = DataBindingUtil.inflate(inflater, R.layout.meet_fragment, container,false);
        model = new MeetModel(this);
        binding.setViewModel(model);
        binding.setLifecycleOwner(this);
        return binding.getRoot();
    }
}


package pl.allegro.tech.hermes.consumers.consumer.oauth;

import java.util.Objects;

public class OAuthAccessToken {

    private final String tokenValue;

    private final Integer expiresIn;

    public OAuthAccessToken(String tokenValue, Integer expiresIn) {
        this.tokenValue = tokenValue;
        this.expiresIn = expiresIn;
    }

    public String getTokenValue() {
        return tokenValue;
    }

    public Integer getExpiresIn() {
        return expiresIn;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        OAuthAccessToken that = (OAuthAccessToken) o;
        return Objects.equals(tokenValue, that.tokenValue)
                && Objects.equals(expiresIn, that.expiresIn);
    }

    @Override
    public int hashCode() {
        return Objects.hash(tokenValue, expiresIn);
    }
}


package com.example.ablum;

/**
 * Created by robert on 2016/11/15.
 */

public class ImgFile {
    private int tag = 0;
    private String thumbnail;
    private String picture;
    private boolean isChecked;

    public ImgFile() {
        super();
    }

    public ImgFile(int tag, String thumbnail, String picture) {
        super();
        this.tag = tag;
        this.thumbnail = thumbnail;
        this.picture = picture;
    }

    public boolean isChecked() {
        return isChecked;
    }

    public void setChecked(boolean checked) {
        this.isChecked = checked;
    }

    public int getTag() {
        return tag;
    }

    public void setTag(int tag) {
        this.tag = tag;
    }

    public String getThumbnail() {
        return thumbnail;
    }

    public void setThumbnail(String thumbnail) {
        this.thumbnail = thumbnail;
    }

    public String getPicture() {
        return picture;
    }

    public void setPicture(String picture) {
        this.picture = picture;
    }
}


package com.founder.econdaily.common.util;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;

import java.util.Locale;

@Component
public class SpringContextUtil implements ApplicationContextAware {

    private static ApplicationContext context = null;

    @Override
    public void setApplicationContext(ApplicationContext applicationContext)
            throws BeansException {
        context = applicationContext;
    }

    // 传入线程中
    public static <T> T getBean(String beanName) {
        return (T) context.getBean(beanName);
    }

    // 国际化使用
    public static String getMessage(String key) {
        return context.getMessage(key, null, Locale.getDefault());
    }

    /// 获取当前环境
    public static String getActiveProfile() {
        return context.getEnvironment().getActiveProfiles()[0];
    }
}


package ZuulBad;

/**
 * This class is the superclass for all items of the game. Specific item classes
 * extend this class. It provides all information about each item.
 *
 * @author Sarah Engelmayer
 */
public abstract class Item {

	/**
	 * A short description of the item
	 */
	private String description;
	/**
	 * The weight of the item
	 */
	private int weight;
	/**
	 * The name of the item
	 */
	private String name;

	/**
	 * Constructor of the class Item
	 *
	 * @param name item name
	 * @param weight item weight
	 * @param description item description
	 */
	public Item(String name, int weight, String description) {
		this.description = description;
		this.weight = weight;
		this.name = name;
	}

	/**
	 * Returns the item description
	 *
	 * @return description item description
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * Returns the item weight
	 *
	 * @return weight item weight
	 */
	public int getWeight() {
		return weight;
	}

	/**
	 * Returns the item name
	 *
	 * @return name item name
	 */
	public String getName() {
		return name;
	}
}


package com.lft.spacex.ui.history;

import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.TextView;

import com.lft.spacex.R;
import com.lft.spacex.data.model.histories.HistoryEvent;
import com.lft.spacex.utils.DateUtils;

public class EventsHolder extends RecyclerView.ViewHolder {

    private TextView mTittle;
    private TextView mDate;

    public EventsHolder(@NonNull View itemView) {
        super(itemView);
        mTittle = itemView.findViewById(R.id.tv_event_tittle);
        mDate = itemView.findViewById(R.id.tv_event_date);

    }

    public void bind(HistoryEvent event, EventsAdapter.OnItemClickListener onItemClickListener){
        mTittle.setText(event.getTitle());
        mDate.setText(DateUtils.format(event.getEventDateUnix()));

        if (onItemClickListener != null) {
            itemView.setOnClickListener(v -> onItemClickListener.onItemClick(
                    event.getId()
            ));
        }
    }
}


package com.github.enesusta.tasdik.validator;

import com.github.enesusta.tasdik.core.FieldContext;

import java.lang.reflect.Field;

public final class DefaultValidator implements Validator {

    private static DefaultValidator instance = null;

    private DefaultValidator() {

    }

    @Override
    public final boolean isValid(final Object object) throws IllegalAccessException {

        final Class<?> clazz = object.getClass();
        final Field[] fields = clazz.getDeclaredFields();

        final FieldContext fieldContext = FieldContext.getInstance(object);

        boolean[] booleans = new boolean[fields.length];

        byte counter = (byte) 0;
        for (Field field : fields)
            booleans[counter++] = fieldContext.isValid(field);

        return hasAny(booleans);
    }

    public static DefaultValidator getInstance() {
        if (instance == null)
            instance = new DefaultValidator();
        return instance;
    }
}


package com.study.gmall.config;

import com.study.core.utils.RsaUtils;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.ConfigurationProperties;

import javax.annotation.PostConstruct;
import java.io.File;
import java.security.PublicKey;

/**
 * 读取配置文件中的gmall下jwt参数
 * 1.@ConfigurationProperties
 * 2.在使用该类的类上边加@EnableConfigurationProperties
 * 3.添加和application.yml文件中的配置文件相对应的属性字段
 */
@Data
@ConfigurationProperties(prefix = "gmall.jwt")
@Slf4j
public class JwtProperties {

    private String pubKeyPath;// 公钥

    private PublicKey publicKey; // 公钥

    private String cookieName; // cookie名称

    /**
     * @PostContruct：在构造方法执行之后执行该方法
     */
    @PostConstruct
    public void init() {
        try {
            File pubKey = new File(pubKeyPath);
            // 获取公钥和私钥
            this.publicKey = RsaUtils.getPublicKey(pubKeyPath);
        } catch (Exception e) {
            log.error("初始化公钥和私钥失败！", e);
            throw new RuntimeException();
        }
    }
}


package security;

import io.jsonwebtoken.Claims;
import io.jsonwebtoken.JwtException;
import org.restlet.Request;
import org.restlet.Response;
import org.restlet.data.ChallengeResponse;
import org.restlet.security.Role;
import org.restlet.security.User;
import org.restlet.security.Verifier;
import util.JWT;

public class TokenBasedVerifier implements Verifier {
    public int verify(Request request, Response response) {
        ChallengeResponse cr = request.getChallengeResponse();
        String token = cr.getRawValue();
        Claims claims;
        try {
            claims = getClaims(token);
        } catch (JwtException e) {
            return Verifier.RESULT_INVALID;
        }
        request.getClientInfo().getRoles().add(new Role(claims.get("role").toString()));
        request.getClientInfo().setUser(new User(claims.get("id").toString()));
        System.out.println("ROLE IS " + claims.get("role").toString());
        return Verifier.RESULT_VALID;
    }

    Claims getClaims(String token) {
        Claims claims = JWT.decodeJWT(token);
        return claims;
    }
}


package com.codeclan.example.dino_project.repositories.dinos;

import com.codeclan.example.dino_project.models.Dinosaur;
import org.hibernate.Criteria;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.springframework.beans.factory.annotation.Autowired;

import javax.persistence.EntityManager;
import javax.transaction.Transactional;
import java.util.List;

public class DinosaurRepositoryImpl implements DinosaurRepositoryCustom {

    @Autowired
    EntityManager entityManager;

    @Transactional
    public List<Dinosaur> getAllDinosaur(){
        List<Dinosaur> dinosaurs = null;
        Session session = entityManager.unwrap(Session.class);
        try {
            Criteria cr = session.createCriteria(Dinosaur.class);
            dinosaurs = cr.list();
        } catch (HibernateException e) {
            e.printStackTrace();
        } finally {
            session.close();
        }
        return dinosaurs;
    }

}