package test.ReflectionAndPerformance;

import java.lang.reflect.Field;

import test.json.pojo;

public class TestGetFieldsClassType {

    public static void main(String[] args) {

        for(Field f: pojo.class.getDeclaredFields()){
            StringBuilder sb = new StringBuilder();
            sb.append("\n").append(f.getDeclaringClass());//class test.json.pojo
            sb.append("\n").append(f.getClass());//class java.lang.reflect.Field
            sb.append("\n").append(f.getType());//class java.lang.String

            Class<?> c = f.getType();
            Object obj = c.cast("abc");

            pojo pojo = new pojo();
            try {
                f.setAccessible(true);
                f.set(pojo, obj);
            } catch (IllegalArgumentException e) {
                e.printStackTrace();
            } catch (IllegalAccessException e) {
                e.printStackTrace();
            }
            System.out.println(pojo);
            System.out.println(sb.toString());
        }

    }

}


package fr.sofiane.applications.controller;

import fr.sofiane.applications.dto.ActeurDto;
import fr.sofiane.applications.dto.FilmDto;
import fr.sofiane.applications.repository.FilmRepository;
import fr.sofiane.applications.service.FilmService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.text.ParseException;
import java.util.List;
import java.util.Map;

/**
 * Created by Sofiane on 29/10/2016.
 */

@RestController
@RequestMapping("/film")
public class FilmController {

    @Autowired
    FilmRepository filmRepository;

    @Autowired
    FilmService filmService;

    @RequestMapping(value = "", method = RequestMethod.GET)
    public List<FilmDto> getFilms(){
        return filmService.getFilms();
    }

    @RequestMapping(value = "/{idFilm}", method = RequestMethod.GET)
    public FilmDto getFilm(@PathVariable("idFilm") Long id ){
        return filmService.getFilm(id);
    }

    @RequestMapping(value = "/add", method = RequestMethod.PUT)
    public List<FilmDto> addFilm(@RequestBody Map<String, Object> filmDto) throws ParseException {
        return filmService.add(filmDto);
    }

}


package com.mzy.queue;

import java.util.ArrayList;
import java.util.concurrent.ArrayBlockingQueue;

/**
 * @Author Jack Miao
 * @date 2021/2/25 15:11
 * @desc
 */
public class ArrayBlockingQueueDemo {

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

        ArrayBlockingQueue<String> queue = new ArrayBlockingQueue<String>(5, false);
        //非阻塞添加,队列满抛异常
        queue.add("1");
        queue.poll();
        queue.add("2");
        queue.clear();
        //添加成功返回true,失败返回false
        boolean offer = queue.offer("3");
        System.out.println(offer);
        //返回队列头元素
        System.out.println(queue.peek());
        //删除指定元素
        System.out.println(queue.remove("1"));
        queue.offer("4");
        queue.offer("3");
        System.out.println("reaming: " + queue.remainingCapacity());
        ArrayList<String> strings = new ArrayList<>();
        //将queue中的所有元素移动到指定collection
        queue.drainTo(strings);
        System.out.println(queue);
        System.out.println(strings);

    }
}


package org.ibase4j.core;

import javax.servlet.ServletContextEvent;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import base.listener.XServerListener;
import org.ibase4j.service.SysDicService;
import org.ibase4j.service.SysUserService;
import org.springframework.web.context.ContextLoader;
import org.springframework.web.context.WebApplicationContext;

public class SysServerListener extends XServerListener {

    protected final Logger logger = LogManager.getLogger(this.getClass());

    /**
     * @param contextEvent
     */
    public void contextInitialized(ServletContextEvent contextEvent) {

        WebApplicationContext context = ContextLoader.getCurrentWebApplicationContext();

        SysUserService sysUserService = context.getBean(SysUserService.class);
        sysUserService.init();

        SysDicService sysDicService = context.getBean(SysDicService.class);
        sysDicService.getAllDic();
        //
        super.contextInitialized(contextEvent);
    }
}


package com.woniuxy.test;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.jdbc.core.JdbcTemplate;

import javax.sql.DataSource;
import java.sql.SQLException;

/**
 * @Author: rua
 * @Date: 2021/8/14 16:00
 * @Description:
 */

/**
 * SSM框架所用的数据库连接池 主要是这三个
 *  druid c3p0 dbcp
 *  harika (springboot中的)
 *
 *
 */

public class DBTest {
	public static void main(String[] args) throws SQLException {
		ApplicationContext applicationContext = new ClassPathXmlApplicationContext("application3.xml");
//		DataSource c3p0 = (DataSource) applicationContext.getBean("c3p0");
//		DataSource druid = (DataSource) applicationContext.getBean("druid");
//		DataSource dbcp = (DataSource) applicationContext.getBean("dbcp");

//		System.out.println(c3p0.getConnection());
//		System.out.println(druid.getConnection());
//		System.out.println(dbcp.getConnection());

		JdbcTemplate jdbcTemplate = applicationContext.getBean(JdbcTemplate.class);
		String sql ="delete from t_emp where id=?";
		int row = jdbcTemplate.update(sql, 54);
		System.out.println(row);

	}
}


package colonelkai.ironforgepack.localdeathmessage;

import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.ChatColor;

	/*
	I thought making death messages limited to 50 blocks
	would make RP much better during situations where
	death is important. So I just did it.

	- Colonel_Kai
	*/

public class LocalDeathMessageListener implements Listener {
	@EventHandler(priority = EventPriority.HIGH)
	public void onPlayerDeath(PlayerDeathEvent e) {

		// store death message for later
		String deathMessage = e.getDeathMessage();
		// destroy the normal one
		e.setDeathMessage(null);

		// caching this would probably be a tiny bit faster
		Location loc = e.getEntity().getLocation();

		for(Player p : Bukkit.getOnlinePlayers()) {
			if(loc.distance(p.getLocation()) < 50) {
				// make it red and all for extra spook effect
				// don't ask why this has to be like this, it just has to be.
				p.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + deathMessage);
			}
		}
	}
}


package com.demo.android.myswiperef;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;

/**
 * Created by XiongRun on 2017/5/9.
 */

public class MainActitity extends AppCompatActivity implements View.OnClickListener {

	private Button swipeRefresh,xRecyclerRefresh;
	private Intent intent;

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

		initView();
	}

	private void initView() {
		swipeRefresh = (Button) findViewById(R.id.SwipeRefresh);
		xRecyclerRefresh = (Button) findViewById(R.id.XRecyclerRefresh);

		swipeRefresh.setOnClickListener(this);
		xRecyclerRefresh.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {

		switch (v.getId()){

			case R.id.SwipeRefresh:
				intent = new Intent(this,SwipeRefreshActivity.class);
				startActivity(intent);
				break;

			case R.id.XRecyclerRefresh:
				intent = new Intent(this,XRecyclerRefreshActivity.class);
				startActivity(intent);
				break;

			default:
				break;
		}
	}
}


package bg.sofia.uni.fmi.mjt.auth.domain.commands;

import java.nio.channels.SocketChannel;

import bg.sofia.uni.fmi.mjt.auth.domain.Domain;

public class CommandRemoveAdmin implements CommandOperation{
	private static final String STRING_DELIMITER = " ";
	private static final int SESSION_ID_ARGUMENT = 1;
	private static final int USERNAME_ARGUMENT = 2;

	private String message;
	private Domain domain;
	private SocketChannel socketChannel;

	public CommandRemoveAdmin(SocketChannel channel, String message, Domain domain) {
		this.message = message;
		this.domain = domain;
		this.socketChannel = channel;
	}

	@Override
	public String execute() {
		String[] tokens = message.split(STRING_DELIMITER);
		String currUsername = domain.getChannelsByUsername().get(socketChannel);
		String currSessionID = tokens[SESSION_ID_ARGUMENT];
		String usernameToRemoveAdmin = tokens[USERNAME_ARGUMENT];
		String result = domain.removeAdmin(currUsername, usernameToRemoveAdmin, currSessionID, socketChannel);
		return result;
	}

}


/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.edu.ifnmg.Teste.DataAcess;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Rosy
 */
public class BancoDados {

    private Connection conexao;

    public Connection getConexao() {
        return conexao;
    }

    public void setConexao(Connection conexao) {
        this.conexao = conexao;
    }

    public BancoDados(){
        try {

            Class.forName("com.mysql.jdbc.Driver");
            conexao = DriverManager
                    .getConnection("jdbc:mysql://localhost:3306/trabalhovendas","root","1234");

        } catch (ClassNotFoundException ex) {
            Logger.getLogger(BancoDados.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
                Logger.getLogger(BancoDados.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

}


package com.skettios.lpreboot.gfx;

import com.skettios.lpreboot.entity.component.SpriteRenderer;

/**
 * Only transition for now is fade until I learn the maths for the rest xd
 */
public class TransitionTween
{
    public enum TransitionType
    {
        FADE_IN,
        FADE_OUT
    }

    private TransitionType type;
    private SpriteRenderer renderer;

    public TransitionTween(TransitionType type, SpriteRenderer renderer)
    {
        this.type = type;
        this.renderer = renderer;
    }

    public boolean doTransition(float step)
    {
        switch (type)
        {
            case FADE_IN:
                return fadeIn(step);
            case FADE_OUT:
                return fadeOut(step);
            default:
                return false;
        }
    }

    private boolean fadeIn(float step)
    {
        float currAlpha = Math.min(1f, renderer.alpha + step);
        renderer.setAlpha(currAlpha);

        return currAlpha == 1f;
    }

    private boolean fadeOut(float step)
    {
        float currAlpha = Math.max(0f, renderer.alpha - step);
        renderer.setAlpha(currAlpha);

        return currAlpha == 0f;
    }
}


package com.example.tictactoe;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.text.Editable;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;

public class Start extends AppCompatActivity {

    EditText p1,p2;
    String a;
    String b;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_start);
        p1=(EditText)findViewById(R.id.p1);
        p2=(EditText)findViewById(R.id.p2);
    }
    public void startGame(View view){
        if(p1.getText().length()==0 || p2.getText().length()==0){
            Toast.makeText(this,"Please enter the names",Toast.LENGTH_SHORT).show();
        }
        else {
            Intent i = new Intent();
            i.setClass(this, MainActivity.class);
            a=p1.getText().toString();
            b=p2.getText().toString();
            i.putExtra("player1",a);
            i.putExtra("player2",b);
            startActivity(i);
        }
    }
}


package com.example.jdm.jtab.view;

import android.content.Context;
import android.graphics.Rect;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;

/**
 * 自定义ViewPager，重写onInterceptTouchEvent，解决子视图和ViewPager的滑动冲突
 * Created by JDM on 2016/6/3.
 */
public class CustomViewPager extends ViewPager {

    // 子视图Id
    private int childId;

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

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

    @Override
    public boolean onInterceptTouchEvent(MotionEvent ev) {
        if (childId > 0){
            View childView = findViewById(childId);
            if (childView != null){
                Rect rect = new Rect();
                childView.getHitRect(rect);
                // 判断事件是否在子视图内
                if (rect.contains((int)ev.getX(),(int)ev.getY())){
                    return false;
                }
            }
        }
        return super.onInterceptTouchEvent(ev);
    }

    public void setChildId(int childId) {
        this.childId = childId;
    }
}


package cn.ppl.hello.controller;

import cn.ppl.hello.entity.User;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/springcloud-demo/hello/")
public class HelloController {

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

    @RequestMapping("/hello")
    public String hello(){
        return "say,hello--port:"+port;
    }

    @RequestMapping(value = "/get/{name}",method = RequestMethod.GET)
    public String name( @PathVariable("name") String name){

        return "say,hello "+name+",---port:"+port;
    }

    @RequestMapping(value = "/hello2get",method = RequestMethod.GET)
    public User user(@RequestHeader("name") String name,@RequestHeader("age") int age){
        return new User(name,age,"port:"+port);
    }

    @RequestMapping(value = "/hello3post",method = RequestMethod.POST)
    public String postUser(@RequestBody User u){
        return "hello,"+u.getName()+", "+u.getAge()+",port:"+port;
    }

    @RequestMapping(value = "/public/get")
    public String pub(){
        return "public get...no token";
    }
}


package md.iecs.fcu.lab4;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class Sayhello extends AppCompatActivity {
    Button back;
    EditText output;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.sayhello_main);
        back=(Button)findViewById(R.id.bbt);
        output=(EditText)findViewById(R.id.name_input);
        back.setOnClickListener(backmain);
    }
    private View.OnClickListener backmain=new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Intent backin=new Intent();
            backin.putExtra("backname",output.getText().toString());
            output.setText("");
            setResult(RESULT_OK,backin);
            finish();
        }
    };
}


package com.alghubari.myfv.modle;

public class Product {

    private String productName1;

    private String  productUnite1;

    private int productPrice1;

  //  private int photoUrl1;

    public Product(String productName1, String productUnite1, int productPrice1) {
        this.productName1 = productName1;
        this.productUnite1 = productUnite1;
        this.productPrice1 = productPrice1;
    }

    public Product() {
    }

    public Product(String productName1) {
        this.productName1 = productName1;
    }

    public String getProductName1() {
        return productName1;
    }

    public void setProductName1(String productName1) {
        this.productName1 = productName1;
    }

    public String getProductUnite1() {
        return productUnite1;
    }

    public void setProductUnite1(String productUnite1) {
        this.productUnite1 = productUnite1;
    }

    public int getProductPrice1() {
        return productPrice1;
    }

    public void setProductPrice1(int productPrice1) {
        this.productPrice1 = productPrice1;
    }
}


# MongoDB Driver for Java

This driver was created as a means to simplify the use of MongoDB within a Java project.

## Current Version
The current version of the driver supports MongoDB **v3.5**
## Installation
### Maven
Add the following to your `pom.xml`:
```
<dependencies>
    <dependency>
        <groupId>org.mongodb</groupId>
        <artifactId>mongo-java-driver</artifactId>
        <version>3.5.0</version>
    </dependency>
</dependencies>
```
**Note:** Make sure you use the version of MongoDB that works with this driver. You can find the Mongo dependencies [here.](https://mongodb.github.io/mongo-java-driver/)
### Gradle
Add the following to your gradle dependencies:
```
dependencies {
    compile 'org.mongodb:mongo-java-driver:3.5.0'
}
```
**Note:** Make sure you use the version of MongoDB that works with this driver. You can find the Mongo dependencies [here.](https://mongodb.github.io/mongo-java-driver/)

### Not using Maven or Gradle?
You can download an uber jar for use with your project. Download the jar and include it in your projects build path.

### Adding the Driver
Include the provided jar file in your projects build path.


package uk.ac.ebi.pride.gui.form;

import uk.ac.ebi.pride.App;
import uk.ac.ebi.pride.gui.form.comp.ContextAwareNavigationPanelDescriptor;
import uk.ac.ebi.pride.gui.navigation.Navigator;

import javax.help.HelpBroker;
import javax.swing.*;

/**
 * SummaryDescriptor
 *
 * @author Rui Wang
 * @version $Id$
 */
public class SummaryDescriptor extends ContextAwareNavigationPanelDescriptor {

    public SummaryDescriptor(String id, String title, String desc) {
        super(id, title, desc, new SummaryForm());
    }

    /**
     * Method to be performed to show help document
     * Override this method to add help functionality
     */
    @Override
    public void getHelp() {
        HelpBroker hb = appContext.getMainHelpBroker();
        hb.showID("help.submission.summary", "javax.help.SecondaryWindow", "main");
    }

    @Override
    public void displayingPanel() {
        Navigator navigator = ((App) App.getInstance()).getNavigator();
        JButton nextButton = navigator.getNextButton();

        nextButton.setText(appContext.getProperty("summary.submit.button.title"));
    }
}


package com.jifflenow.cis.models;

import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.HashMap;
import java.util.Map;

public class ErrorMessage {

    private int status;

    private String message;

    private Map<String, String> errors = new HashMap<String, String>();

    public ErrorMessage() {
        super();
    }

    public ErrorMessage(int status, String message) {
        this();
        this.status = status;
        this.message = message;
    }

    public void addErrorMessage(String key, String message) {
        errors.put(key, message);
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getMessage() {
        return message;
    }

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

    public Map<String, String> getErrors() {
        return errors;
    }

    public void setErrors(Map<String, String> errors) {
        this.errors = errors;
    }
}


package us.ihmc.parameterTuner.guiElements;

public abstract class GuiElement
{
   public static final String SEPERATOR = ":";

   private final String name;
   private final GuiRegistry parent;
   private final String uniqueName;

   public GuiElement(String name, GuiRegistry parent)
   {
      this(name, parent, createUniqueName(name, parent));
   }

   public GuiElement(String name, GuiRegistry parent, String uniqueName)
   {
      if (name.contains(SEPERATOR))
      {
         throw new RuntimeException("Name " + name + " should never contain " + SEPERATOR);
      }

      this.name = name;
      this.parent = parent;
      this.uniqueName = uniqueName;
   }

   public String getName()
   {
      return name;
   }

   public String getUniqueName()
   {
      return uniqueName;
   }

   public GuiRegistry getParent()
   {
      return parent;
   }

   public static String createUniqueName(String name, GuiRegistry parent)
   {
      if (parent == null)
      {
         return name;
      }
      else
      {
         return parent.getUniqueName() + SEPERATOR + name;
      }
   }
}


package com.example.playstore;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

public class Local_Nepal extends AppCompatActivity {

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

    public void daraj(View view) {
        Intent intent = new Intent(Local_Nepal.this,
                NEPdaraj.class);
        startActivity(intent);
    }

    public void sastodeal(View view) {
        Intent intent = new Intent(Local_Nepal.this,
                Nepsastodeal.class);
        startActivity(intent);

    }

    public void nepbay(View view) {
        Intent intent = new Intent(Local_Nepal.this,
                Nepnepbay.class);
        startActivity(intent);
    }

    public void socheko(View view) {
        Intent intent = new Intent(Local_Nepal.this,
                Nepsocheko.class);
        startActivity(intent);

    }

    public void hamrobazar(View view) {
        Intent intent = new Intent(Local_Nepal.this,
                Nephamrobazar.class);
        startActivity(intent);

    }
}


# Fit Your Fat
[Play Market](https://play.google.com/store/apps/details?id=com.artycake.fityourfat) | [Demo video](https://youtu.be/A8gNM5Ku5Ew)

A simple and convenient timer for your workouts.

### Main features
- A timer for interval training, running in the background
- Notifications about changing exercises with sounds, voice and vibration
- Pause the timer on an incoming call
- Unlimited training and exercises
- No advertising and in-app purchases, do train and do not be distracted by anything

---

Aplication was created for demonstration purposes.

### Libraries used in this project
- [Realm](https://realm.io/docs/java/latest/) for storing forecasts
- [Butterknife](http://jakewharton.github.io/butterknife/) for views binding
- [CircleProgress](https://github.com/lzyzsd/CircleProgress) for main timer interface

### Features realised in this project
- Background service that makes all calculation and send broadcasts to update UI
- Fragments with fragmentManager and viewPager
- Notification with buttons
- Playing sounds, vibrations and textToSpeach
- BroadcastReceiver for incomming calls to pause and resume timer


package com.netposa.springsocket;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.simp.SimpMessagingTemplate;
import org.springframework.stereotype.Service;
import org.springframework.web.util.HtmlUtils;
@Service
public class WebSocketService {
    @Autowired
    private SimpMessagingTemplate template;
    @Autowired
    SocketSessionRegistry webAgentSessionRegistry;
    /**
     * 广播
     * 发给所有在线用户
     *
     * @param msg
     */
    public void sendMsg(String msg) {
        template.convertAndSend("/topic/greetings", new Greeting("Hello, " + HtmlUtils.htmlEscape(msg) + "!"));
    }

    /**
     * 发送给指定用户
     * @param users
     * @param msg
     */
    public void send2Users(String user, String msg) {
//        users.forEach(userName -> {
//            template.convertAndSendToUser(userName, "/topic/greetings", msg);
//        });
        template.convertAndSendToUser(webAgentSessionRegistry.getSessionIds(user).stream().findFirst().get(), "/topic/greetings",new Greeting("Hello, " + HtmlUtils.htmlEscape(msg) + "!"));
    }
}


package com.seabattle;

public class Water{
	//private Ship ship;
	//if dangerWater is 0 the field is clear, 1 connects with ship and -1 is busy by ship
	private int dangerWater;

	int x;
	int y;

	public Water(int x, int y) {
		this.x = x;
		this.y = y;

		setDangerWater(0);
	}

	public int getDangerWater() {
		return dangerWater;
	}

	public void setDangerWater(int dangerWater) {
		this.dangerWater = dangerWater;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + dangerWater;
		result = prime * result + x;
		result = prime * result + y;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Water other = (Water) obj;
		if (dangerWater != other.dangerWater)
			return false;
		if (x != other.x)
			return false;
		if (y != other.y)
			return false;
		return true;
	}

	public String toString(){
		return String.valueOf(x) + String.valueOf(y) ;
	}

}


package com.example.wechat.controller;

import com.example.react.util.HttpStatus;
import com.example.react.util.Result;
import com.example.wechat.entity.Image;
import com.example.wechat.service.FloorService;
import com.example.wechat.service.GoodsService;
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.RestController;

import java.util.List;

@RestController
@RequestMapping("/goods")
public class GoodsController {

    @Autowired
    private GoodsService goodsService;

    @GetMapping("/category")
    public Result<List> list() {
        List<Image> list = goodsService.category();
        return new Result<List>(list, HttpStatus.SEARCH);
    }

    @GetMapping("/search")
    public Result<List> search() {
        List<Image> list = goodsService.search();
        return new Result<List>(list, HttpStatus.SEARCH);
    }

    @GetMapping("/detail")
    public Result<Image> detail() {
        Image img = goodsService.detail();
        return new Result<Image>(img, HttpStatus.SEARCH);
    }
}


package com.parkingsystem;
import java.util.Date;
public class Token {

    private String tokenNumber;
    private Slot slotInformation;
    private Car  carInformation;
    private Date tokenDate;
    private long checkoutTime;
    public Token(String tokenNumber, Slot slotInformation, Car carInformation)
    {
        this.tokenNumber = tokenNumber;
        this.slotInformation = slotInformation;
        this.carInformation = carInformation;
        this.tokenDate = new Date();

    }

    public String getTokenNumber() {
        return tokenNumber;
    }

    public void setTokenNumber(String tokenNumber) {
        this.tokenNumber = tokenNumber;
    }

    public Slot getSlotInformation() {
        return slotInformation;
    }

    public void setSlotInformation(Slot slotInformation) {
        this.slotInformation = slotInformation;
    }

    public Car getCarInformation() {
        return carInformation;
    }

    public void setCarInformation(Car carInformation) {
        this.carInformation = carInformation;
    }
    public Token updateCheckoutTime(){
           this.checkoutTime = System.currentTimeMillis();
           return this;
    }

}


package com.premierinc.informatics.dataconv;

/**
 * The Enum DataConversionStatus.
 *
 * @author ypatil
 */
public enum DataConversionStatus {
  QMR_BLOCK("QB"), AE_PENDING("AP"), QMR_RUN("QR"), QMR_COMPLETE("QC");

  private String statusCode;

  /**
   * Instantiates a new data conversion status.
   *
   * @param str the str
   */
  private DataConversionStatus(String str) {
    statusCode = str;
  }

  /**
   * @see java.lang.Enum#toString()
   */
  @Override
  public String toString() {
    return this.getValue();
  }

  /**
   * Gets the value.
   *
   * @return the value
   */
  public String getValue() {
    return statusCode;
  }

  /**
   * Parses the.
   *
   * @param status the status
   * @return the data conversion status
   */
  public static DataConversionStatus parse(String status) {
    for (DataConversionStatus stat : DataConversionStatus.values()) {
      if (stat.getValue().equalsIgnoreCase(status)) {
        return stat;
      }
    }
    return null;
  }

}


package com.forum.board.controller;

import com.forum.board.service.BoardService;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/board")
public class BoardController {

    private final BoardService boardService;

    public BoardController(BoardService boardService) {
        this.boardService = boardService;
    }

    @GetMapping(produces = MediaType.APPLICATION_JSON_VALUE)
    public ResponseEntity<?> getAllBoards() {
        return ResponseEntity.ok(boardService.findAllBoards());
    }

    @GetMapping(value = "/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
    public ResponseEntity<?>  getBoardById(@PathVariable Long id) {
        return ResponseEntity.ok(boardService.findBoardById(id));
    }

}


package com.world.controller.back;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
public class LoginCtrl {

	@RequestMapping(value="/user/login",method=RequestMethod.POST)
	public String doLogin(@RequestParam("name") String name,@RequestParam("password") String password,HttpServletRequest request,HttpSession session){
		String basepath=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath();
		request.getServletContext().setAttribute("basepath", basepath);
		System.out.println(name+" = "+password);
		if("yanbo".equals(name)&&"ddn123".equals(password)){
			session.setAttribute("username", name);
			return "redirect:/index";
		}else{
			return "redirect:/login";
		}
	}

	public LoginCtrl() {
		System.out.println("<><><><><><>终于。。。。。");
	}

}


package com.buyhatke.chat_application_admin;

import android.content.Context;
import android.content.Intent;

import com.google.firebase.storage.StorageReference;

public class Admin{
    private String fullName;
    private String id;
    private String packageName;

    public String getEmail() {
        return email;
    }

    private String email;
    public Admin() {}

    public String getId() {
        return id;
    }
    public Admin(String packageName, String fullName, String email,String id) {
        this.fullName = fullName;
        this.id=id;
        this.packageName=packageName;
        this.email=email;
    }
    @Override
    public boolean equals(Object o) {
        if (o == this) {
            return true;
        }
        if (!(o instanceof User)) {
            return false;
        }
        User c = (User) o;

        System.out.println("Equals.................."+this.id);

        System.out.println("Equals.................."+c.getId());
        return id.equals(c.getId());
    }
    public String getFullName() {
        return fullName;
    }

    public String getPackageName() {
        return packageName;
    }
}


package com.cloudbees.jenkins.plugins;

import hudson.Extension;
import hudson.model.AbstractProject;
import hudson.model.Item;
import hudson.plugins.git.GitStatus;
import hudson.triggers.Trigger;
import hudson.triggers.TriggerDescriptor;
import jenkins.model.Jenkins;
import org.eclipse.jgit.transport.URIish;
import org.kohsuke.stapler.DataBoundConstructor;

/**
 * @author Nicolas De Loof
 */
public class BitBucketTrigger extends Trigger<AbstractProject> {

    @DataBoundConstructor
    public BitBucketTrigger() {
    }

    public void onPost(AbstractProject<?,?> job, String user) {
    	BitBucketPushCause cause = new BitBucketPushCause(user);
    	job.scheduleBuild(cause);
    }

    @Extension
    public static class DescriptorImpl extends TriggerDescriptor {

        @Override
        public boolean isApplicable(Item item) {
            return item instanceof AbstractProject;
        }

        @Override
        public String getDisplayName() {
            return "Build when a change is pushed to BitBucket";
        }
    }
}


package cn.java.jdkproxy;

import sun.misc.ProxyGenerator;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Proxy;

public class JDKDynamicProxyClient {
    public static void main(String[] args) {
        InvocationHandler handler = new SubjectProxyHandler(ConcreteSubject.class);

        // 运行时动态生存代理类
        ISubject proxy = (ISubject) Proxy.newProxyInstance(JDKDynamicProxyClient.class.getClassLoader(),
                new Class[]{ISubject.class}, handler);

        proxy.action();
        proxy.doSomething();

        // 获取代理类的字节码文件
        byte[] classFile = ProxyGenerator.generateProxyClass("$Proxy0", ConcreteSubject.class.getInterfaces());
        try {
            FileOutputStream fos = new FileOutputStream("/Users/qinzhen/Desktop/proxy.class");

            fos.write(classFile, 0, classFile.length);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}


 package com.atguigu.atcrowdfunding.potal.service.impl;

 import com.atguigu.atcrowdfunding.bean.Member;
 import com.atguigu.atcrowdfunding.potal.dao.MemberMapper;
 import com.atguigu.atcrowdfunding.potal.service.MemberService;
 import java.util.Map;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;

@Service
public class MemberServiceImpl implements MemberService
{
  @Autowired
  private MemberMapper memberMapper;

  public Member queryMemberlogin(Map<String, Object> paramMap)
  {
    return this.memberMapper.queryMebmerlogin(paramMap);
  }

	public void updateMember(Member member)   {
     this.memberMapper.updateByPrimaryKey(member);
   }

   public Member queryMemberByMid(Integer memberid)
   {
     Member member = this.memberMapper.selectByPrimaryKey(memberid);
     return member;
   }

   public void insertMember(Member member)
   {
     this.memberMapper.insert(member);
   }

   public Member selectMemberByTel(String tel)
   {
     return this.memberMapper.selectByTel(tel);
   }

   public Member selectMemberByLoginacct(String loginacct)
   {
     return this.memberMapper.selectByLoginacct(loginacct);
   }
 }


# Welcome to Tech Networking!

This app was designed for anyone new to the tech field and looking to connect with other techies!

## Installation

To install this to your local computer, fork and clone this repository. Once you are in the "tech_networking_client" directory, run `npm install` to load all dependencies.  This application is dependent on a Rails API for the backend, so be sure to follow the installation instructions here as well:
https://github.com/abaydar/tech_networking_api

## Usage

Once you are in this directory, you can type `npm start` in your terminal.  Once the application is open in your browser, you can sign up by clicking the "login" button and registering with either your email or google account.  Once you are logged in, you can check out the "About" page and get started!

## A Contributor's Guide

For pull requests, please visit: https://github.com/abaydar/tech_networking_client/pulls.
For bug reports, please visit: https://github.com/abaydar/tech_networking_client/issues

## License

This application is available as open source under the terms in the MIT License, found here: https://opensource.org/licenses/MIT


package com.fgy.myblog.service.impl;

import com.fgy.myblog.bean.UserInfo;
import com.fgy.myblog.dao.UserInfoMapper;
import com.fgy.myblog.service.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserInfoServiceImpl implements UserInfoService {
    @Autowired
    UserInfoMapper userInfoMapper;

    @Override
    public List<UserInfo> selecetAll(UserInfo user) {

        return userInfoMapper.selectAll(user);
    }

    @Override
    public UserInfo selectById(Integer id) {
        return userInfoMapper.selectByPrimaryKey(id);
    }

    @Override
    public UserInfo isLogin(UserInfo user) {
        return userInfoMapper.isLogin(user);
    }

    @Override
    public int getUserCount() {
        return userInfoMapper.getUserCount();
    }

    @Override
    public int deleteById(Integer id) {
        return userInfoMapper.deleteById(id);
    }

    @Override
    public int update(UserInfo user) {
        return userInfoMapper.updateByPrimaryKeySelective(user);
    }

    @Override
    public int add(UserInfo user) {
        return userInfoMapper.insertSelective(user);
    }

}


package ua.kiev.softtouch.validations;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.validation.Errors;
import org.springframework.validation.ValidationUtils;
import org.springframework.validation.Validator;

import ua.kiev.softtouch.models.CompanyModel;
import ua.kiev.softtouch.services.CompanyService;

@Component
public class CpmpanyValidator implements Validator{

	@Autowired
	private CompanyService companyService;

	@Override
	public boolean supports(Class<?> clazz) {
		return CompanyModel.class.equals(clazz);
	}

	@Override
	public void validate(Object model, Errors errors) {
		ValidationUtils.rejectIfEmpty(errors, "comanyname", "error.null");
		CompanyModel companyModel =  (CompanyModel) model;
		String companyname = companyModel.getComanyname();
		if( companyname != null && !companyService.isSubdivisionName(companyname)) {
			errors.rejectValue("comanyname", "error.ismatches");
		}

	}

}


package servlets;

import com.mysql.jdbc.StringUtils;
import service.TodoService;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.time.LocalDate;
import java.util.logging.Logger;

import static java.lang.Integer.parseInt;

@WebServlet(name = "servlets.DoneServlet", urlPatterns = {"/done"}, loadOnStartup = 1)
public class DoneServlet extends HttpServlet {
    private static Logger logger = Logger.getLogger(UpdateServlet.class.getName());

    private TodoService service = new TodoService();

    protected void doPut(HttpServletRequest request, HttpServletResponse response) {
        String id = request.getParameter("id");
        if (StringUtils.isNullOrEmpty(id)) {
            logger.warning("Id is missing");
        } else {
            LocalDate dateNow = java.time.LocalDate.now();
            service.updateStatus(parseInt(id), dateNow.toString());
        }
    }
}


package com.renyu.androidcommonlibrary.activity;

import android.graphics.Color;
import androidx.appcompat.widget.AppCompatImageView;
import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat;
import com.renyu.androidcommonlibrary.R;
import com.renyu.commonlibrary.baseact.BaseActivity;

/**
 * Created by Administrator on 2017/9/7.
 */

public class SVGActivity extends BaseActivity {

    AppCompatImageView iv_svg;

    @Override
    public void initParams() {
        iv_svg = findViewById(R.id.iv_svg);
        VectorDrawableCompat a = VectorDrawableCompat.create(getResources(), R.drawable.ic_white_bottom_arrow, getTheme());
        a.setTint(Color.RED);
        iv_svg.setImageDrawable(a);
    }

    @Override
    public int initViews() {
        return R.layout.activity_svg;
    }

    @Override
    public void loadData() {

    }

    @Override
    public int setStatusBarColor() {
        return Color.BLACK;
    }

    @Override
    public int setStatusBarTranslucent() {
        return 0;
    }
}


package component;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.border.EmptyBorder;

public class JFileChooserTest1 extends JFrame {

	private JPanel contentPane;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
					JFileChooserTest1 frame = new JFileChooserTest1();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public JFileChooserTest1() {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 450, 300);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		contentPane.setLayout(new BorderLayout(0, 0));
		setContentPane(contentPane);
		JFileChooser file=new JFileChooser();
		contentPane.add(file, BorderLayout.CENTER);
	}

}


package com.java.chatbot.repository;

import com.java.chatbot.model.Movies;
import org.springframework.context.annotation.Configuration;

import java.util.ArrayList;
import java.util.HashMap;

@Configuration
public class Repository {

private static HashMap<String, Movies> database = new HashMap<String, Movies>();
private static ArrayList<Movies> moviesList = new ArrayList<>();

public void set(String chatId, Movies movies){
    database.put(chatId, movies);
}

public Movies get(String chatId){
    if(database.get(chatId) == null)
        return new Movies();
    return database.get(chatId);
}

public String getAll(){
    StringBuffer stringBuffer = new StringBuffer();
    database.forEach((k,v) -> stringBuffer.append(k +" --> "+ v.toString()+".\n"));
    return stringBuffer.toString();
}

public void addMovie(Movies movie){
    moviesList.add(movie);
}

public void removeMovie(Movies movie){
    moviesList.remove(movie);
}

public ArrayList<Movies> getMovies(){
    return moviesList;
}

}


package com.xiaofei.ssm.utils;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
 * <Description>

 *  进行日期转换
 * @author 小飞

 * @version 1.0

 * @createDate 2019/05/31

 * @see com.xiaofei.ssm.utils

 */
public class DateUtils {
    /**
     * 把日期转换为字符串
     * @param date 传进来的日期
     * @param patt 转换的日期格式
     * @return 返回转换后的字符串日期
     */
    public static String DateToString(Date date,String patt) {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(patt);
        String format = simpleDateFormat.format(date);
        return format;
    }

    /**
     * 把字符串转换为日期
     * @param date 传入的字符日期
     * @param patt 转换的格式
     * @return 返回转换后的日期
     * @throws ParseException
     */
    public static Date StringTiDate(String date, String patt) throws ParseException {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(patt);
        Date parse = simpleDateFormat.parse(date);
        return parse;
    }
}


setting up ufw : http://docs.ansible.com/ansible/ufw_module.html

vagrant up --provider virtualbox

vagrant destroy

check http://jamesdacosta.com/first-steps-with-vagrant-ansible-and-aws/ for next steps and do it with digitial ocean

-- kicked off digital ocean deploy w/
ansible-playbook private/ansible/droplet.yml --private-key ~/.ssh/id_rsa -i private/ansible/hosts

-- had to pip install some python stuff to use digital_ocean stuff
ansible==2.0.0.2
dopy==0.3.5
six==1.10.0

-- able to create and destroy droplets

-- use a vars.yml file to hold names of instances and instance types

--start
ansible-playbook create.yml

--stop
ansible-playbook destroy.yml

-- hosts list is empty -- need to use digital ocean's dns to add the instances to some dns
-- and then use that hosts file to perform some other playbook

-- really would like to be able to provision new instances and install on them at the same time instead of needing two passes
-- into to dynamic inventory needs more reading


package src.Activities.ui.account;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider;

import com.example.tp3_pa_grupo_3.R;

public class AccountFragment extends Fragment {

    public View onCreateView(@NonNull LayoutInflater inflater,
                             ViewGroup container, Bundle savedInstanceState) {
        AccountViewModel accountViewModel = new ViewModelProvider(this).get(AccountViewModel.class);
        View root = inflater.inflate(R.layout.fragment_account, container, false);

        accountViewModel.fillUserInfo(
                root.findViewById(R.id.input_name),
                root.findViewById(R.id.input_email),
                root.findViewById(R.id.input_total_parkings),
                root.findViewById(R.id.input_total_time)
        );

        return root;
    }
}


package me.pljr.fancychangeanimation;

import me.pljr.fancychangeanimation.listeners.FoodLevelChangeListener;
import me.pljr.fancychangeanimation.listeners.PlayerExpChangeListener;
import org.bukkit.plugin.java.JavaPlugin;

public final class FancyChangeAnimation extends JavaPlugin {
    private static FancyChangeAnimation instance;
    private static int speed;

    @Override
    public void onEnable() {
        instance = this;
        setupConfig();
        loadListeners();
    }

    private void setupConfig(){
        saveDefaultConfig();
        speed = getConfig().getInt("speed");
    }

    private void loadListeners(){
        getServer().getPluginManager().registerEvents(new PlayerExpChangeListener(), this);
        getServer().getPluginManager().registerEvents(new FoodLevelChangeListener(), this);
    }

    public static int getSpeed() {
        return speed;
    }

    public static FancyChangeAnimation getInstance() {
        return instance;
    }

    @Override
    public void onDisable() {
        // Plugin shutdown logic
    }
}


package com.samir.upasarga.activities;

import androidx.appcompat.app.AppCompatActivity;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;

import android.os.Bundle;
import android.widget.TextView;

import com.samir.upasarga.R;

public class SwipeToRefresh extends AppCompatActivity {

    SwipeRefreshLayout swipeRefreshLayout;
    TextView textView;

    int num = 0;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_swipe_to_refresh);
        swipeRefreshLayout = findViewById(R.id.refreshLayout);
        textView = findViewById(R.id.swipeCount);

        swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
            @Override
            public void onRefresh() {
                num ++;
                textView.setText(String.valueOf(num));
                swipeRefreshLayout.setRefreshing(false);

            }
        });
    }
}


package com.mytest.controller;

import com.mytest.entity.Dept;
import com.mytest.service.DeptService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;

/**
 * (Dept)表控制层
 *
 * @author makejava
 * @since 2019-07-03 12:05:07
 */
@Controller
@RequestMapping("/dept")
public class DeptController {
    /**
     * 服务对象
     */
    @Resource
    private DeptService deptService;

    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @GetMapping("/selectDeptOne")
    public String selectDeptOne(Integer id, Model model) {
        model.addAttribute("depts", this.deptService.queryById(id));
        return "deptList";
    }

    @GetMapping("/selectDeptAll")
    public List<Dept> selectDeptAll() {
        return this.deptService.queryDeptAll();
    }

}


package gestion_ressources_humains;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.Date;
public class promotion {
    private float date;
    private ArrayList<Employées> Employees;

    //constructeur

    public promotion(float date) {
        this.date= date;//la date cité l'hors du jour
        this.Employees = new ArrayList<>();
    }
    //getters and setters

    public float getdate() {
        return date;
    }

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

    public ArrayList<Employées> getEmployees() {
        return Employees;
    }

    public void setEmployees(ArrayList<Employées> Employees) {
        this.Employees = Employees;
    }

    //affichage

    @Override
    public String toString() {
        return "promotion{" + "date=" + date + ", Employees=" + Employees + '}';
    }

}


NPM install required

I built the site using Node / Express / Angular. To get things running:

* Clone the following repo into a new directory: https://github.com/ASBausch/ww-exercise
* From within the directory run 'npm install'
* Once install is complete, run 'npm start'
* Visit http://localhost:3000 to view the site.

Base requirements:

1. Sticky header stays at the top as user scrolls.
2. Content is centered horizontally and vertically.
3. On mobile content stacks and remains centered.
4-5. Accordion collapsed on initial load, opens downward and closes open items.
6. Employees drawn from 4 on desktop, 3 on tablet, 2 on mobile.
7. On click groups of 4 employees are drawn, button disappears when the end of the array is reached.

A grid was not implemented to avoid extra weight in the css and markup, native css flexbox was used for positioning.
This posed some challenges and a grid may have been an equally effective system.

Tested on latest versions of Safari, Chrome and Firefox.

Technology used, Sass, Gulp, Node, Angular, Express


/**
 * Created by : George Poulos
 * Class : CS342 HW1 ---- Fall 2016
 * Author Code Number : 655P
 *
 * This file holds the class that defines City, this class holds
 * an Integer variable that holds the city index, a String that
 * holds the name of the city, and another string that holds the
 * name of the state that city belongs to.
 * Strictly used for reading from a csv file.
 *
 */
public class City {
    private int city;
    private String cityName;
    private String State;

    public City (int city, String cityName, String State){
        this.city = city;
        this.cityName = cityName;
        this.State = State;
    }

    /**
     * Getters
     * @return
     */
    public String toString(){
        return "The city : " + this.city + ", "+this.cityName + " in the state : " + this.State;
    }
    public int getCity (){
        return this.city;
    }

    public String getCityName(){
        return this.cityName;
    }

    public String getState(){
        return this.State;
    }

}


package com.mingle.webflux.demo;

import java.time.Duration;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.Date;
import java.util.Optional;
import java.util.Random;

import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import reactor.core.scheduler.Schedulers;
import reactor.test.StepVerifier;
import reactor.test.publisher.TestPublisher;

/**
 * Created by mingle. Time 2019-04-23 18:21 Desc 文件描述
 */
public class Test {

    public static void main(String[] args) {
        StepVerifier.create(Flux.just("a", "b"))
                .expectNext("a")
                .expectNext("b")
                .verifyComplete();

        final TestPublisher<String> testPublisher = TestPublisher.create();
        testPublisher.next("a");
        testPublisher.next("b");
        testPublisher.complete();

        StepVerifier.create(testPublisher)
                .expectNext("a")
                .expectNext("b")
                .expectComplete();
    }
}


package me.geek.tom.BulkBlockChange.actions;

// import org.bukkit.ChatColor;
import com.google.common.collect.Lists;
import me.geek.tom.BulkBlockChange.BulkBlockChange;
import org.bukkit.ChatColor;
import org.bukkit.Server;
import org.bukkit.scheduler.BukkitRunnable;

import java.util.List;

public class TaskManager extends BukkitRunnable {

    private Server server;

    private List<TaskRunnable> runnableList;

    public TaskManager(Server server) {
        super();
        this.server = server;
        runnableList = Lists.newArrayList();
    }

    public void queueOperation(TaskRunnable taskRunnable) {
        runnableList.add(taskRunnable);
        taskRunnable.runTask(BulkBlockChange.plugin);
    }

    public void run() {
        // server.broadcastMessage(ChatColor.LIGHT_PURPLE + "Running operations...");
    }

    public void taskDone(TaskRunnable runnable) {
        server.broadcastMessage(ChatColor.LIGHT_PURPLE + "Task complete!");
        runnableList.remove(runnable);
    }
}


package com.illinois.ncsa;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;

import framework.FileIO;

public class Settings {
    public static boolean soundEnabled = true;

    public static void load(FileIO files) {
        BufferedReader in = null;
        try {
            in = new BufferedReader(new InputStreamReader(
                    files.readFile(".ffever")));
            soundEnabled = Boolean.parseBoolean(in.readLine());

        } catch (IOException e) {
            // :( It's ok we have defaults
        }
    }

    public static void save(FileIO files) {
        BufferedWriter out = null;
        try {
            out = new BufferedWriter(new OutputStreamWriter(
                    files.writeFile(".ffever")));
            out.write(Boolean.toString(soundEnabled));
            out.write("\n");

        } catch (IOException e) {
        }
    }

}


package com.model;

import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

@Document(collection = "coordinates")
public class Coordinate {

	public Coordinate(String latitude, String longitude, String altitude, String time) {
		super();
		this.latitude = latitude;
		this.longitude = longitude;
		this.altitude = altitude;
		this.time = time;
	}

	private String id;
	private String latitude;
	private String longitude;
	private String altitude;
	private String time;

	public String getLatitude() {
		return latitude;
	}

	public void setLatitude(String latitude) {
		this.latitude = latitude;
	}

	public String getLongitude() {
		return longitude;
	}

	public void setLongitude(String longitude) {
		this.longitude = longitude;
	}

	public String getAltitude() {
		return altitude;
	}

	public void setAltitude(String altitude) {
		this.altitude = altitude;
	}

	public String getTime() {
		return time;
	}

	public void setTime(String time) {
		this.time = time;
	}

}


package Session;

import java.io.*;
import java.net.InetAddress;
import java.net.Socket;
import java.net.UnknownHostException;

public class EchoClient {
    public static void main(String[] args) throws IOException {
//        InetAddress local = InetAddress.getLocalHost();
////        System.out.println(local.getHostAddress());
////        System.out.println(local.getHostName());
//
//        Socket socket = new Socket (local.getHostAddress(), 33075);

        InetAddress local = InetAddress.getLocalHost();
        Socket socket = new Socket (local.getHostAddress(), 33075);
        PrintWriter pw = new PrintWriter(socket.getOutputStream());
        pw.println("Hello, Server!");

        pw.flush(); // need this to send the data

        InputStream ir = socket.getInputStream();
        InputStreamReader isr = new InputStreamReader(ir);
        BufferedReader br = new BufferedReader(isr);
        String message = br.readLine();
        System.out.println(message);

        socket.close();
    }
}


package com.vpdt.vpdt.model;

import android.os.Parcel;
import android.os.Parcelable;

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

public class Noinhan implements Parcelable {
    @SerializedName("mthu")
    @Expose
    private String mthu;

    protected Noinhan(Parcel in) {
        mthu = in.readString();
    }

    public static final Creator<Noinhan> CREATOR = new Creator<Noinhan>() {
        @Override
        public Noinhan createFromParcel(Parcel in) {
            return new Noinhan(in);
        }

        @Override
        public Noinhan[] newArray(int size) {
            return new Noinhan[size];
        }
    };

    public String getMthu() {
        return mthu;
    }

    public void setMthu(String mthu) {
        this.mthu = mthu;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(mthu);
    }
}


import java.io.*;
import java.util.LinkedList;
import java.util.List;

public class FileManager {
    public void readFile(String filePath) throws IOException {
        //FileReader odczyt pliku znak po znaku, dlatego opakowany w strumień BufferedReader
        FileReader fileReader = new FileReader(filePath);
        //BufferedReader - odczyt pliku linia po linii, udostępnia readLine
        BufferedReader bufferedReader = new BufferedReader(fileReader);
        try {

            String textLine = bufferedReader.readLine();
            do {
                System.out.println(textLine);
                textLine = bufferedReader.readLine();
            } while (textLine != null);
        } finally {
            bufferedReader.close();
        }
    }

    public void writeFile(String filePath, List<String> mountList)
            throws IOException {

        FileWriter fileWriter = new FileWriter(filePath, true);
        BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);

        try {
            for (String line : mountList) {
                bufferedWriter.write(line);
                bufferedWriter.newLine();
            }
        } finally {
            bufferedWriter.close();
        }
    }
}


package com.alibaba.sdk.android.common.auth;

import com.alibaba.sdk.android.common.auth.CredentialProvider;

/**
 * Created by zhouzhuo on 11/4/15.
 */
public class PlainTextAKSKCredentialProvider extends CredentialProvider {
    private String accessKeyId;
    private String accessKeySecret;

    /**
     * 用阿里云提供的AccessKeyId， AccessKeySecret构造一个凭证提供器
     *
     * @param accessKeyId
     * @param accessKeySecret
     */
    public PlainTextAKSKCredentialProvider(String accessKeyId, String accessKeySecret) {
        this.accessKeyId = accessKeyId.trim();
        this.accessKeySecret = accessKeySecret.trim();
    }

    public String getAccessKeyId() {
        return accessKeyId;
    }

    public void setAccessKeyId(String accessKeyId) {
        this.accessKeyId = accessKeyId;
    }

    public String getAccessKeySecret() {
        return accessKeySecret;
    }

    public void setAccessKeySecret(String accessKeySecret) {
        this.accessKeySecret = accessKeySecret;
    }
}


package db;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class Executor {
    private final Connection connection;

    public Executor(Connection connection) {
        this.connection = connection;
    }

    public int executeUpdate(String query) {
        try (Statement statement = connection.createStatement()) {
            return statement.executeUpdate(query);
        } catch (SQLException e) {
            e.printStackTrace();
            return -1;
        }
    }

    public <T> T executeQuery(String query, ResultHandler<T> handler) {
        try (Statement statement = connection.createStatement()) {
            statement.execute(query);
            try (ResultSet set = statement.getResultSet()) {
                return handler.handle(set);
            }
        } catch (SQLException e) {
            e.printStackTrace();
            return null;
        }
    }

    public void close() {
        try {
            connection.close();
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
}


package res;

import java.io.*;
import java.net.URL;
import javax.sound.sampled.*;
import javax.swing.*;

public class AudioPlayer {
    private final String SOUND_DIR = "sounds/";

    /*
     * pre: none
     * post: creates a temporary player and uses it to play clip "name"
     */
    public static void playClip(String name) {
        new AudioPlayer().play(name);
    }

    /*
     * pre: name corresponds to a file present in the resource directory
     * post: starts a new audio stream playing the sound file defined as name
     */
    private void play(String fileName) {
        try {
            URL path = getClass().getResource(SOUND_DIR + fileName);
            AudioInputStream stream = AudioSystem.getAudioInputStream(path);

            Clip clip = AudioSystem.getClip();

            clip.open(stream);
            clip.start();
        }
        catch (UnsupportedAudioFileException | IOException | LineUnavailableException e) {}
    }
}


package io.pantheist.api.flatdir.model;

import javax.inject.Inject;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.inject.assistedinject.Assisted;

import io.pantheist.common.util.OtherPreconditions;

final class ListFileItemImpl implements ListFileItem
{
	private final String url;
	private final String fileName;
	private final String kindUrl;

	@Inject
	private ListFileItemImpl(
			@Assisted("url") @JsonProperty("url") final String url,
			@Assisted("fileName") @JsonProperty("fileName") final String fileName,
			@Assisted("kindUrl") @JsonProperty("kindUrl") final String kindUrl)
	{
		this.url = OtherPreconditions.checkNotNullOrEmpty(url);
		this.fileName = OtherPreconditions.checkNotNullOrEmpty(fileName);
		this.kindUrl = OtherPreconditions.checkNotNullOrEmpty(kindUrl);
	}

	@Override
	public String url()
	{
		return url;
	}

	@Override
	public String fileName()
	{
		return fileName;
	}

	@Override
	public String kindUrl()
	{
		return kindUrl;
	}

}


package com.xingcloud.framework.integration.http.protocol;

import java.io.IOException;

import com.xingcloud.framework.context.stream.input.JSONInputStream;
import com.xingcloud.framework.integration.http.stream.input.HTTPInputStream;
import com.xingcloud.framework.service.request.ServiceRequest;

/**
 * 状态协议服务类
 *
 */
public class StatusServiceProtocol extends RESTServiceProtocol{
	public static final String NAME = "STATUS";

	public String getName(){
		return NAME;
	}
	/**
	 * 获取请求
	 */
	public ServiceRequest getRequest() throws IOException{
		HTTPInputStream is = new HTTPInputStream(this.httpServletRequest);
		isRequestGZipped = is.isUnGZipRequired();
		ServiceRequest serviceRequest = new ServiceRequest(new JSONInputStream(is));
		serviceRequest.setService("status");

		//根据uri判断是否使用admin模块的status接口
		if(getUri().equalsIgnoreCase("/status/admin"))
			serviceRequest.setMethod("admin");
		else serviceRequest.setMethod("status");

		serviceRequest.setParameters(serviceRequest.getInputStream().getParameters());
		return serviceRequest;
	}
}


package efood.com.mvp.Views;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;

import efood.com.mvp.Persenter.CouterPersenter;
import efood.com.mvp.R;

public class MainActivity extends AppCompatActivity implements CounterView {
    Button button;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        button = (Button) findViewById(R.id.BtnCount);
        final CouterPersenter couterPersenter = new CouterPersenter();
        couterPersenter.setView(this);

        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                couterPersenter.DoInBackGroud();
            }
        });
    }

    @Override
    public void setCounterText(String text) {
        button.setText(text);

    }
}


package stepDef;

import java.util.concurrent.TimeUnit;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
//import org.openqa.selenium.firefox.FirefoxDriver;

import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;

//import io.cucumber.java.en.Given;
//import io.cucumber.java.en.Then;

public class Stepj {

	WebDriver driver;

	@Given("user launch browser")
	public void user_launch_browser() {
	    System.setProperty("webdriver.chrome.driver", "C:\\Users\\Avyaan\\Downloads\\selenium\\New folder\\chromedriver_win32\\chromedriver.exe");
	    driver = new ChromeDriver();
        driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
        driver.manage().deleteAllCookies();
        driver.manage().window().maximize();
        driver.manage().timeouts().pageLoadTimeout(10, TimeUnit.SECONDS);

	}

	@Then("open google")
	public void open_google() {
	    driver.get("https://www.google.com/");
	}

}


package com.example.ages;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.widget.DatePicker;
import android.widget.TextView;
import android.view.*;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }
    public void calculate(View view)
    {
        DatePicker dob= (DatePicker)findViewById(R.id.date1);
        DatePicker current_date = (DatePicker)findViewById(R.id.date);

        int day=dob.getDayOfMonth();
        int month=dob.getMonth();
        int year=dob.getYear();

        int day2=current_date.getDayOfMonth();
        int month2=current_date.getMonth();
        int year2=current_date.getYear();
Intent intent=new Intent(MainActivity.this,ResultActivity.class);
        startActivity(intent);
    }

}


package dev.morphia.mapping.lifecycle;

import java.lang.reflect.Method;
import java.util.List;

import dev.morphia.Datastore;
import dev.morphia.EntityListener;
import dev.morphia.annotations.EntityListeners;
import dev.morphia.annotations.internal.MorphiaInternal;

import org.bson.Document;

/**
 * This class wraps the legacy {@link EntityListeners#value()} values with no fixed API to the more formalized {@link EntityListener}
 * interface.
 *
 * @hidden
 * @since 2.4.0
 * @morphia.internal
 */
@MorphiaInternal
public class UntypedEntityListenerAdapter extends EntityListenerAdapter {
    public UntypedEntityListenerAdapter(Class<?> type) {
        super(type);
    }

    void invoke(Class<?> annotation, Object entity, Document document, Datastore datastore) {
        List<Method> list = getMethods().get(annotation);
        if (list != null) {
            list.forEach(method -> {
                try {
                    method.invoke(getListener(), collectArgs(method, entity, document, datastore));
                } catch (IllegalArgumentException | ReflectiveOperationException e) {
                    throw new RuntimeException(e);
                }
            });
        }
    }
}


package org.edu.kushima.service;

import java.net.InetAddress;
import java.net.UnknownHostException;

import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;

import org.wildfly.swarm.spi.runtime.annotations.ConfigurationValue;

@ApplicationScoped
public class RecPagService {

	@Inject
	@ConfigurationValue("url.pagamento")
	String urlPagamento;

	@Inject
	@ConfigurationValue("url.recarga")
	String urlRecarga;

	public String getRecPag(String id) {
		StringBuilder sb = new StringBuilder();
		try {
			return sb.append("Service Recarga & Pagamento: ").append(id)
					.append(" URL Pagamento: [").append(urlPagamento).append("]")
					.append(" URL Recarga: [").append(urlRecarga).append("]")
					.append(" Host: ").append(InetAddress.getLocalHost().getHostName()).toString();
		} catch (UnknownHostException e) {
			return sb.append("Erro ao recuperar Recarga & Pagamento. Erro: [").append(e.getMessage()).append("]").toString();
		}
	}
}


package com.puffer.spider.crawler;

import com.puffer.spider.common.constants.Constants;
import com.puffer.spider.entity.AmazonItem;
import com.puffer.spider.processor.AmazonItemPiperline;
import org.springframework.stereotype.Component;
import us.codecraft.webmagic.downloader.HttpClientDownloader;

import javax.annotation.Resource;

/**
 * 亚马逊爬虫
 *
 * @author puffer
 * @date 2019年10月14日 23:27:37
 * @since
 */
@Component
public class AmazonCrawler {

    @Resource
    private AmazonItemPiperline amazonItemPiperline;

    @Resource
    private BaseCrawler baseCrawler;

    public void amazonCrawler(String url){

        HttpClientDownloader httpClientDownloader = new HttpClientDownloader();
//        httpClientDownloader.setProxyProvider(SimpleProxyProvider.from(new Proxy("",)));

        baseCrawler.crawler(
                amazonItemPiperline,
                httpClientDownloader,
                url,
                Constants.THREADNUM,
                AmazonItem.class
        );
    }
}


Description
===========

Installs the Typesafe Stack.

Requirements
============

Platform
--------

* Ubuntu/Debian/Amazon
* No others--pull requests welcome.

Recipes
=======

default
-------

Include the default recipe in a run list, to get `typesafe_stack`.

Usage
=====

Simply include the `typesafe_stack` recipe where ever you would like the Typesafe Stack installed.

License and Author
==================

Author:: Juan M. Uys (<opyate@gmail.com>)

Copyright:: 2008-2012, Opscode, Inc

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

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

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.


package com.company;

public abstract class Employee {
    public static int EmployeeID=0;
    private int employeeID;
    private String FirstName;
    private String Compensation;
    private double salary;

    public Employee(String Compensation,String FirstName,double AnnualOrHourly)
    {
        this.Compensation=Compensation;
        this.FirstName=FirstName;
        this.salary=AnnualOrHourly;
        employeeID = EmployeeID;
        EmployeeID++;

        getEmployeeID();
    }

    public double getSalary() {
        return salary;
    }

    public int getEmployeeID()
    {
        return employeeID;
    }

    public String getFirstName()
    {
        return FirstName;
    }

    public String getCompensation()
    {
        return Compensation;
    }

    public abstract double calculateSalary();

    public String toString()
    {
        return getFirstName()+" "+getEmployeeID()+" "+getCompensation()+" "+calculateSalary();
    }

}


package com.sinochem.crude.trade.listed.model.vo;

import java.io.Serializable;

/**
 * 瀛楀吀鐨刅O
 * @author Yichen Zhao
 * date: 20180301
 */
public class DictionaryVO implements Serializable {

    /**
     * 编号
     */
    private Integer code;

    /**
     * 中文
     */
    private String zhName;

    /**
     * 英文
     */
    private String enName;

    public DictionaryVO() {

    }

    public DictionaryVO(Integer code, String zhName, String enName) {
        this.code = code;
        this.zhName = zhName;
        this.enName = enName;
    }

    /** getters and setters */
    public Integer getCode() {
        return code;
    }

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

    public String getZhName() {
        return zhName;
    }

    public void setZhName(String zhName) {
        this.zhName = zhName;
    }

    public String getEnName() {
        return enName;
    }

    public void setEnName(String enName) {
        this.enName = enName;
    }
}


package com.practice.springmvc.multi_servlet_path.foo;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.request.WebRequest;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;

@RestController
public class FooHelloController {
    private final FooHelloService helloService;

    public FooHelloController(FooHelloService helloService) {
        this.helloService = helloService;
    }

    @RequestMapping("/hello")
    public Map<String, String> hello(HttpServletRequest request, WebRequest webRequest) {
        String contextPath = request.getContextPath();
        String servletPath = request.getServletPath();
        Map<String, String> map = new HashMap<>();
        map.put("greeting", helloService.hello(this.getClass().getSimpleName()));

        map.put("contextPath", contextPath);
        map.put("servletPath", servletPath);
        return map;
    }
}


package com.example.asyncrestservice;

import com.example.asyncrestservice.reflective.visitor.pattern.*;
import org.junit.Test;

public class ReflectiveVisitorTest {
    @Test
    public void testIt() {
        Element[] list = {new This(), new That(), new TheOther()};
        UpVisitor up = new UpVisitor();
        DownVisitor down = new DownVisitor();
        for (Element element : list) {
            element.accept(up);
        }
        for (Element element : list) {
            element.accept(down);
        }
    }

    @Test
    public void testThisWithUpVisitor() {
        This aThis = new This();
        UpVisitor upVisitor = new UpVisitor();
        aThis.accept(upVisitor);
    }

    @Test
    public void testThatWithUpVisitor() {
        That that = new That();
        UpVisitor upVisitor = new UpVisitor();
        that.accept(upVisitor);
    }

    @Test
    public void testTheOtherWithUpVisitor() {
        TheOther theOther = new TheOther();
        UpVisitor upVisitor = new UpVisitor();
        theOther.accept(upVisitor);
    }

}


package com.network.booking.controller;

import com.network.booking.entities.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.*;

@RestController
public class TestController {
    @GetMapping("/user")
    public User getUser() {
        return new User( "倪升武", 1);
    }

    @GetMapping("/list")
    public List<User> getUserList() {
        List<User> userList = new ArrayList<>();
        User user1 = new User( "倪升武", 1);
        User user2 = new User( "达人课", 1);
        userList.add(user1);
        userList.add(user2);
        return userList;
    }

    @GetMapping("/map")
    public Map<String, Object> getMap() {
        Map<String, Object> map = new HashMap<>();
        User user = new User("倪升武", 1);
        map.put("作者信息", user);
        map.put("博客地址", "http://blog.itcodai.com");
        map.put("CSDN地址", "http://blog.csdn.net/eson_15");
        map.put("粉丝数量", 4153);
        return map;
    }
}


package com.irfan.draft1.Maps;

import java.io.Serializable;

/**
 * Created by irfan on 27/07/2017.
 */

public class Coordinates implements Serializable {

    private Double latitude, longitude;
    private float bearing;
    private int speed;

    public Coordinates() {

    }

    public Coordinates(Double latitude, Double longitude, float bearing, int speed) {
        this.latitude = latitude;
        this.longitude = longitude;
        this.bearing = bearing;
        this.speed = speed;

    }

    public Double getLatitude() {
        return latitude;
    }

    public void setLatitude(Double latitude) {
        this.latitude = latitude;
    }

    public Double getLongitude() {
        return longitude;
    }

    public void setLongitude(Double longitude) {
        this.longitude = longitude;
    }

    public float getBearing() {
        return bearing;
    }

    public int getSpeed() {
        return speed;
    }

    public void setSpeed(int speed) {
        this.speed = speed;
    }
}


import java.awt.Color;

public class Lion extends Critter {

	private int steps;
	private int[] movesDir = { NORTH, SOUTH, EAST, WEST };
	private int counter;
	private int thenMove;

	public Lion(int steps) {
		super();
		this.steps = steps;
		counter = steps;
	}

	public int getSteps() {
		return steps;
	}

	public int fight(String opponent) {
		return PAPER; // Lion always return paper
	}

	public Color getColor() {
		return Color.YELLOW; // Lion has yellow color
	}

	public int getMove(CritterInfo info) {
		// moves the given number of steps in a random direction
		// then choose a new random direction and repeat

		if (counter == steps) { // if counter has equaled the number of
								// steps in the given direction, it will
								// choose a new random direction
			thenMove = movesDir[rand.nextInt(movesDir.length)];
			counter = 1;
			return thenMove;
		} else {
			counter++;
			return thenMove;
		}
	}

	public String toString() {
		return "L"; // displays lion as L
	}
}


package org.fantasy.bean.registry;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

import org.fantasy.service.AbstractService;

/**
 * 暂时没实现
 * @author fantasy
 *
 */
public abstract class RecoverableServiceRegistry extends AbstractService implements ServiceRegistry {

//	private Configuration conf;
	private final ConcurrentMap<RegistryKey, List<RegistryValue>> backupMap = new ConcurrentHashMap<RegistryKey, List<RegistryValue>>();

	public RecoverableServiceRegistry(/** Configuration conf */) {
//		this.conf = conf;

	}

	public void addRegistry(RegistryKey key, RegistryValue value) {
		if(key == null)
			throw new IllegalArgumentException("Registry key is null");
		List<RegistryValue> list = backupMap.get(key);
		if(list == null)
			list = new ArrayList<RegistryValue>();

		if(value != null)
			list.add(value);

		backupMap.put(key, list);
	}

//	public boolean removeRegistry

}


package com.jhkj.mosdc.permission.po;

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

/**
 * 角色 菜单资源表
 *
 * @author evan
 *
 */
@Entity
@Table(name = "TS_JS_CDZY")
public class TsJsCdzy implements java.io.Serializable {

	private static final long serialVersionUID = -2284656840129336950L;

	/**
	 * id
	 */

	private Long id;

	/**
	 * 菜单资源id
	 */

	private Long cdzyId;

	/**
	 * 角色ID
	 */

	private Long jsId;

	@Id
	@Column(name = "ID", unique = true, nullable = false, precision = 16, scale = 0)
	public Long getId() {
		return id;
	}

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

	@Column(name = "CDZY_ID", precision = 16, scale = 0)
	public Long getCdzyId() {
		return cdzyId;
	}

	public void setCdzyId(Long cdzyId) {
		this.cdzyId = cdzyId;
	}

	@Column(name = "JS_ID", precision = 16, scale = 0)
	public Long getJsId() {
		return jsId;
	}

	public void setJsId(Long jsId) {
		this.jsId = jsId;
	}

}


package com.change.mall.adminuser.dao;

import java.util.List;

import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;

import com.change.mall.adminuser.vo.AdminUser;

public class AdminUserDao {
	private SessionFactory sessionFactory;

	// Dao完成登录的代码
	public SessionFactory getSessionFactory() {
		return sessionFactory;
	}

	public void setSessionFactory(SessionFactory sessionFactory) {
		this.sessionFactory = sessionFactory;
	}

	private Session getSession() {
		return sessionFactory.getCurrentSession();
	}

	public AdminUser login(AdminUser adminUser) {
		String hql = "from AdminUser where username = ? and password = ?";
		Query query = getSession().createQuery(hql).setString(0, adminUser.getUsername()).setString(1,
				adminUser.getPassword());

		List<AdminUser> list = query.list();

		if (list != null && list.size() > 0) {
			return list.get(0);
		}
		return null;
	}

}


package io.datakernel.trigger;

import java.util.function.Supplier;

public final class Trigger {
	private final Severity severity;
	private final String component;
	private final String name;
	private final Supplier<TriggerResult> triggerFunction;

	Trigger(Severity severity, String component, String name,
	        Supplier<TriggerResult> triggerFunction) {
		this.severity = severity;
		this.component = component;
		this.name = name;
		this.triggerFunction = triggerFunction;
	}

	public static Trigger of(Severity severity, String component, String name,
	                         Supplier<TriggerResult> triggerFunction) {
		return new Trigger(severity, component, name, triggerFunction);
	}

	public Severity getSeverity() {
		return severity;
	}

	public String getComponent() {
		return component;
	}

	public String getName() {
		return name;
	}

	public Supplier<TriggerResult> getTriggerFunction() {
		return triggerFunction;
	}

	@Override
	public String toString() {
		return severity + " : " + component + " : " + name;
	}
}


package practicedemo;

import org.testng.annotations.Test;
import org.testng.annotations.BeforeTest;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.testng.annotations.AfterTest;

public class Disabledevmode {
		public WebDriver driver;
		String url= "http://www.globalsqa.com/";
		String b="webdriver.chrome.driver";
		String p="C:\\Users\\nikhil\\chromedriver.exe";

  @Test
  public void f() {

	  driver.findElement(By.xpath(".//*[@id='menu-item-1513']/a")).click();
  }
  @BeforeTest
  public void beforeTest() {
	  System.setProperty("b", "p");
	  driver=new ChromeDriver();
	  driver.manage().window().maximize();
	  driver.get(url);
	  ChromeOptions options=new ChromeOptions();
	  options.addArguments("--disable-extensions");
	  WebDriver driver=new ChromeDriver(options);
  }

  @AfterTest
  public void afterTest() {

	  driver.quit();

  }

}


/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
 */
package com.github.KeyMove.Tools;
import javax.script.ScriptContext;
import javax.script.ScriptEngine;

import javax.script.ScriptEngineManager;

/**
 *
 * @author KeyMove
 */
public class JSTools {
    static ScriptEngine engine;
    public static ScriptEngine getInstance(){
        //((Invocable)engine).invokeFunction(name, args)
        if(engine==null){
            engine = new ScriptEngineManager().getEngineByName("js");
            try{
                ScriptContext context = engine.getContext();
                for (String s : new String[] {  "load", "loadWithNewGlobal", "exit", "quit" })
                  context.removeAttribute(s, context.getAttributesScope(s));
            }
            catch (Exception e) {
                System.out.print(e);
            }
        }
        return engine;
    }
}


BSOS
============

A Browser-based virtual Operating System for Operating Systems CMSC 422L111

View the latest submission of the project here.

iProject1 - First set of enhancements to code base.  Due 9/19.

iProject2 - Improve on functionality of iProject1 along with the ability to load and execute user programs in memory.  Due 10/10.

iProject3 - Improve on functionality of iProject2 along with the ability to execute multiple user programs at the same time using round robin scheduling.  Due 11/7.

iProject4 - Improve on functionality of iProject3 along with a local file system and swapped virtual memory so the user can execute more processes than there are memory partitions along with two more scheduling algorithms.  Due 12/05.


package de.one1on.sgjscraper.model;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import lombok.ToString;
import org.joda.time.DateTime;

@Data
@ToString(of = {"id", "timestamp", "votes"})
public class Comment {

    @SerializedName("id")
    @Expose
    private int id;
    @SerializedName("image")
    @Expose
    private String image;
    @SerializedName("imageA")
    @Expose
    private String imageA;
    @SerializedName("text")
    @Expose
    private String text;
    @SerializedName("timestamp")
    @Expose
    private DateTime timestamp;
    @SerializedName("votes")
    @Expose
    private Votes votes;
    @SerializedName("author")
    @Expose
    private Author author;
    @SerializedName("status")
    @Expose
    private int status;
    @SerializedName("pinned")
    @Expose
    private boolean pinned;
    @SerializedName("report")
    @Expose
    private int report;
    @SerializedName("additional_information")
    @Expose
    private String additionalInformation;
}


package com.luxious.lmsd.violation.login;

import com.luxious.lmsd.dao.EmployeeDao;
import com.luxious.lmsd.model.datastore.Employee;
import com.luxious.lmsd.model.service.LoginValidationResult;
import com.luxious.lmsd.model.service.LoginViolationType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class CurrentEmployeeValidator implements LoginValidator {

    @Autowired
    EmployeeDao employeeDao;

    @Override
    public LoginValidationResult validate(String employeeLogin) {
        System.out.println(employeeLogin);
        List<Employee> employeeList = employeeDao.getEmployeeByEmployeeLogin(employeeLogin);
        System.out.println(employeeList.size());
        if (employeeList.isEmpty()) {
            return LoginValidationResult.validResult();
        } else {
            return LoginValidationResult.withViolationResult(LoginViolationType.CURRENT_EMPLOYEE);
        }
    }
}


package mongosocket.examples;

import com.mongodb.MongoNamespace;
import mongosocket.MongoSocket;
import mongosocket.MongoSocketClient;
import mongosocket.MongoSocketConnectFailedException;

import java.io.IOException;
import java.io.OutputStream;

public class SimpleClientExample {

    public static void main(String[] args) throws MongoSocketConnectFailedException, IOException {
        java.util.logging.LogManager.getLogManager().reset();

        MongoSocketClient client = new MongoSocketClient(new MongoNamespace("test.test"));

        for(int i = 0; i < 25; i++) {
            Runnable task = () -> {
                try {
                    MongoSocket socket = client.connect(60, 60);
                    OutputStream stream = socket.getOutputStream();
                    stream.write("Hello, World.".getBytes());
                    stream.close();
                } catch (MongoSocketConnectFailedException | IOException e) {}
            };
            new Thread(task).start();
        }
    }
}


package RestfulServ;

import hibernate.AccountFinding;

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

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class Account {

	   @RequestMapping("/account")
	   public com.jack.obj.Account account(@RequestParam(value="emp_id", defaultValue= "2" ) long emp_num){

	    	//Query database for the account number and routing number
	    	//long emp_num = 1;

	    	List<com.jack.obj.Account> acts = new ArrayList<com.jack.obj.Account>();

	    	AccountFinding af = new AccountFinding();
	    	af.init();
	    	List<hibernate.Account> accts = af.acctFetching(emp_num);

	    	for (hibernate.Account b : accts ){

	    		acts.add(new com.jack.obj.Account(b.getAcct_num(),b.getRoute_num()));

	    	}

	    	return acts.get(0);
	    }

}


package com.company;

public class Course {
    public String name;
    public Student[] participants;
    public int studentCount = 0;

    public void enroll(Student std) {
        participants[studentCount] = std;
        studentCount++;

    }

    public void remove(Student std)
    {
        for (int i = 0; i < studentCount; i++)
        {
            if(participants[i].id == std.id)
            {
                studentCount--;
                if (i == studentCount)
                {
                    participants[i]=null;
                }
                else
                {
                    for (int j = i+1 ; j<=studentCount; j++)
                    {
                        participants[j-1]=participants[j];
                    }
                }
            }
        }
    }

    public Student[] getParticipants()
    {
        Student[] stds = new Student[studentCount];
        for(int i = 0  ; i< studentCount; i++)
        {
            stds[i]=participants[i];
        }
        return stds;
    }
}


package com.stage1.part4.task2;

import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

public class FileCharCopyTest {

    public static void main(String[] args) {

        FileReader fr = null;
        FileWriter fw = null;
        try {
            fr = new FileReader("/Users/spencersun/Desktop/a.txt");
            fw = new FileWriter("/Users/spencersun/Desktop/b.txt");

            int res = 0;
            while((res = fr.read()) != -1){
                fw.write(res);
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if(null != fw) {
                try {
                    fw.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            if(null != fr) {
                try {
                    fr.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }

    }
}


package be.solodoukhin.dao;

import be.solodoukhin.model.Order;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.List;

/**
 * @author SOLODOUKHIN VIKTOR
 * <p>
 * date 16/06/18
 */
public abstract class SQLOrderDAO implements IOrderDAO {

    private static final Logger logger = LoggerFactory.getLogger(SQLOrderDAO.class);
    private final SQLDAOFactory factory;

    public SQLOrderDAO(SQLDAOFactory factory) {
        this.factory = factory;
    }

    @Override
    public Order getById(Integer id) {
        return null;
    }

    @Override
    public List<Order> getAll(String regularExpression) {
        return null;
    }

    @Override
    public Integer insert(Order object) throws Exception {
        return null;
    }

    @Override
    public boolean delete(Order object) throws Exception {
        return false;
    }

    @Override
    public boolean update(Order object) throws Exception {
        return false;
    }
}


package com.binas.tachographcms.service.impl;

import com.binas.tachographcms.model.entity.Admin;
import com.binas.tachographcms.repository.AdminRepository;
import com.binas.tachographcms.service.AdminService;
import javassist.NotFoundException;
import org.springframework.stereotype.Service;

import javax.security.auth.login.AccountNotFoundException;
import java.util.List;
import java.util.Optional;

@Service
public class AdminServiceImpl implements AdminService {

    private AdminRepository adminRepository;

    public AdminServiceImpl(AdminRepository adminRepository) {
        this.adminRepository = adminRepository;
    }

    @Override
    public Optional<Admin> getAdmin(String username, String password) {
        return this.adminRepository.getAdminByUsernameAndPassword(username, password);
    }

    @Override
    public void changePassword(String newPassword) {
        this.adminRepository.getFirstByUsername("admin").ifPresentOrElse(admin -> {
          admin.setPassword(newPassword);
          this.adminRepository.save(admin);
        }, () -> {throw new IllegalStateException();});
    }

    @Override
    public Optional<Admin> getAdmin() {
        return this.adminRepository.getAdminById(1L);
    }
}


package project.checkapp.haams.checkapp.front_end;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import project.checkapp.haams.checkapp.R;

public class LoginActivity extends AppCompatActivity implements View.OnClickListener {

    private Button btnGenLogin;

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

        initViews();
    }

    private void initViews() {
        btnGenLogin = (Button) findViewById(R.id.btn_login_general);
        btnGenLogin.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.btn_login_general:
                startActivity(new Intent(LoginActivity.this, HomeActivity.class));
                finish();
                break;
        }
    }
}


# Remote Debug with VS Remote Debugger

[toc]

## Preparations

Referring to [official document](https://docs.microsoft.com/en-us/visualstudio/debugger/remote-debugging?view=vs-2019), download the remote debug tool and install it to the target remote machine. On the first time start remote debugger, it will ask for configurations, just follow the document.

## Setup the way to look up symbols

Defaultly, visual studio will look up symbols local, which will perform better. But still support configure to look up symbols on remote machine. Actually it is very simple, just keep a same .pdb file on local machine, and set the symbols look up directory in the debug->symbols config panel of the solution.

## Reference

- [Remote debug setting from official site](https://docs.microsoft.com/en-us/visualstudio/debugger/remote-debugging?view=vs-2019)

- may help and waite to confirm: [solve symbols not found and breaks not hit local](https://stackoverflow.com/questions/151966/why-are-no-symbols-loaded-when-remote-debugging)


package com.example.sqlearn;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

/**
 * Created by pateo on 18-9-19.
 */

public class DBHelper extends SQLiteOpenHelper {

    // 数据库文件名
    public static final String DB_NAME = "my_database.db";
    // 数据库表名
    public static final String TABLE_NAME = "t_person";
    // 数据库版本号
    public static final int DB_VERSION = 1;

    public static final String NAME = "name";
    public static final String AGE = "age";
    public DBHelper(Context context) {
        super(context, DB_NAME, null, DB_VERSION);
    }

    // 当数据库文件创建时，执行初始化操作，并且只执行一次
    @Override
    public void onCreate(SQLiteDatabase sqLiteDatabase) {
        //建表
        String sql = "create table " +
                TABLE_NAME+
                "(_id integer primary key autoincrement, "+
                NAME + " varchar,"+
                AGE + " varchar"
                + ")";
        sqLiteDatabase.execSQL(sql);
    }

    @Override
    public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {

    }
}


package webdriverMaven;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.AfterSuite;
import org.testng.annotations.BeforeSuite;
import org.testng.annotations.Test;

//import io.github.bonigarcia.wdm.ChromeDriverManager;
//import org.openqa.selenium.chrome.ChromeDriverInfo;

public class LoginTest {

	 //ChromeDriverManager.getInstance().setup();
	public static WebDriver driver;

	@BeforeSuite
public void setup() {

		//ChromeDriverManager.getInstance().setup();
		System.setProperty("webdriver.chrome.driver", "C:\\Users\\Sridevi\\Documents\\seleniumTutorials\\sleniumRCjar\\chromedriver.exe");
	driver=new ChromeDriver();

}
@Test
public void doLogin() {

	driver.get("http://gmail.com");
	driver.findElement(By.id("identifierId")).sendKeys("sridevigk2@gmail.com");
	driver.findElement(By.xpath("//*[@id=\"identifierNext\"]/span")).click();

}

@AfterSuite
public void tearDown() {
	driver.quit();

}
}


package personal.jasonevans.cowboywiki.entity;

import javax.persistence.*;

/**
 * A POJO class that maps to the "role"
 * table in the cowboy_project schema.
 *
 * Every NEW role type is set to autoincrement that id,
 * so all numbers map to a role type.
 */
@Entity
@Table(name = "role")
public class Role {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    private Long id;

    @Column(name = "name")
    private String name;

    public Role(){}

    public Role(Long id, String name) {
        this.id = id;
        this.name = name;
    }

    public Long getId() {
        return id;
    }

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

    public String getName() {
        return name;
    }

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

    @Override
    public String toString() {
        return "Role{" +
                "id=" + id +
                ", name='" + name + '\'' +
                '}';
    }
}


package com.ws.test;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by shuaiwu on 2016/3/27.
 */
@WebServlet("/hello")
public class HelloServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request,
            HttpServletResponse response)
            throws ServletException, IOException {

           doGet(request,response);
    }

    protected void doGet(HttpServletRequest request,
            HttpServletResponse response)
            throws ServletException, IOException {

        DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String s = df.format(new Date());
        request.setAttribute("time",s);
        request.getRequestDispatcher("/hello.jsp").forward(request,response);
    }

}