package transformer.demo;

public class BaseConstants {

    /**
     * @Author: youpengda@qq.com
     * @Description: 0:失效 1:生效
     */
    public enum State {
        INVALID("0", "失效"),
        VALID("1", "生效"),
        ;
        private String key;
        private String name;

        State(String key, String name) {
            this.key = key;
            this.name = name;
        }

        public static String getNameBykey(String key) {
            for (State type : State.values()) {
                if (type.getKey().equals(key)) {
                    return type.getName();
                }
            }
            return null;
        }

        public String getKey() {
            return key;
        }

        public void setKey(String key) {
            this.key = key;
        }

        public String getName() {
            return name;
        }

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


package xyz.yuanwl.job;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import xyz.yuanwl.config.LogsRtProperties;
import xyz.yuanwl.service.ProdService;
import xyz.yuanwl.service.TestService;

/**
 * <p>日志定时清理任务
 *
 * @author Yuanwl
 * @date 2018/10/21 17:14
 */
@Component
@Slf4j
public class LogsCleanupTask {

	@Autowired
	private LogsRtProperties logsRtProperties;

	@Autowired
	private TestService testService;

	@Autowired
	private ProdService prodService;

	/**
	 * 定时执行清理
	 * @author Yuanwl
	 * @date 2018-10-21 18:02:04
	 * @version v1.0.0
	 */
	@Scheduled(cron = "0 0 2 * * ?") // 每天凌晨2点执行
//	@Scheduled(cron = "*/5 * * * * ?") // 每5秒钟执行一次
	public void clean(){
		log.info("LogsCleanupTask.clean()...");
		// 清理测试环境日志
		testService.deleteLogsBefore(logsRtProperties.getTest());
		// 清理生产环境日志
		prodService.deleteLogsBefore(logsRtProperties.getProd());
	}
}


# CHIP-8 Emulator

## Usage
After download or clone the repository, I use CMake to build the code, then run the `chip8` program.

The default game is Tetris. If you want to use CLI, please uncomment `#define CLI` in the main.cpp file.

### Command Line Usage
chip8 \<Scale> \<Delay> \<Rom>

Scale: scale factor to enlarge the game window, 10 is recommanded.

Delay: time between the cycles to determine the game speed.

Rom: CHIP-8 file to load

## Prerequisite
1. CMake
    For MacOS, you can download CMake using `brew install CMake`.
    If you use M1 chip Mac, please open terminal using Rosetta.

2. SDL2 library
    For MacOS, you can download SDL2 using `brew install sdl2`.
    If you use M1 chip Mac, please open terminal using Rosetta.
    You can use `brew info sdl2` to find the directory of SDL2 library.

## Note
Please change the SDL2 library directory ${SDL_DIR} to your own directory in the CMakeLists.txt file.

## Acknowledge
Special thanks to Austin Morlan and his detailed guide of CHIP-8 emulator.


package com.rabbitmq.tutorial;

import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;

import java.io.IOException;
import java.net.URISyntaxException;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.util.concurrent.TimeoutException;

import static com.rabbitmq.tutorial.ExampleConstants.*;
import static com.rabbitmq.tutorial.ExampleConstants.QUEUE_NAME;

public class RabbitHelper {

    static Channel initRabbitMqClient() throws URISyntaxException, NoSuchAlgorithmException, KeyManagementException, IOException, TimeoutException {
        ConnectionFactory factory = new ConnectionFactory();
        factory.setUri(AMPQ_URI);
        factory.setConnectionTimeout(300000);
        Connection connection = factory.newConnection();
        Channel channel = connection.createChannel();
        channel.queueDeclare(QUEUE_NAME, true, false,false,null);
        return channel;
    }
}


package com.github.zhongl.benchmarker;

import org.junit.Test;

import java.util.concurrent.Callable;

import static org.hamcrest.Matchers.*;
import static org.junit.Assert.assertThat;

/** @author <a href="mailto:zhong.lunfu@gmail.com">zhongl<a> */
public class FixInstanceSizeFactoryTest {

    @Test
    public void returnNullIfOverFixSize() throws Exception {
        CallableFactory runnablefactory = new CallableFactory() {
            @Override
            public Callable<?> create() {
                return new Callable() {
                    @Override
                    public Object call() throws Exception {
                        return null;
                    }
                };
            }
        };
        int size = 5;
        FixInstanceSizeFactory factory = new FixInstanceSizeFactory(size, runnablefactory);

        for (int i = 0; i < size; i++) {
            assertThat(factory.create(), is(notNullValue()));
        }
        assertThat(factory.create(), is(nullValue()));
    }
}


package conj.Shop.tools;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;

public class StringUtil {
   public static String toString(List<String> list) {
      if (list == null) {
         return null;
      } else {
         String string = "";

         String s;
         for(Iterator var3 = list.iterator(); var3.hasNext(); string = string + s + "/;") {
            s = (String)var3.next();
         }

         return string;
      }
   }

   public static List<String> fromString(String string) {
      if (string == null) {
         return null;
      } else {
         List<String> list = new ArrayList();
         List<String> split = Arrays.asList(string.split("/;"));
         Iterator var4 = split.iterator();

         while(var4.hasNext()) {
            String s = (String)var4.next();
            list.add(s);
            Debug.log("Added lore: " + s);
         }

         return list;
      }
   }
}


package Flyer;

import Common.DroneCommunicator;
import Common.DroneState;
import Message.Status;

import java.net.SocketException;

public class StateReceiver implements Runnable{
    DroneState droneState;
    private Status status;
    public StateReceiver(DroneState droneState) {
        this.droneState=droneState;
    }

    @Override
    public void run() {
        DroneCommunicator State = null;
        try {
            State = new DroneCommunicator(8890);
        } catch (SocketException e) {
            e.printStackTrace();
        }
        while(true) {
            try {
                 String reply = State.receiveRequest();
                status = new Status(reply);
               droneState.updateFlyingInfo(this.status);
            } catch (Exception e) {
                e.printStackTrace();
            }
            try {
                Thread.sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}


package com.workevr.api.config;

import com.amazonaws.auth.AWSCredentials;
import com.amazonaws.auth.AWSStaticCredentialsProvider;
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.services.s3.AmazonS3;
import com.amazonaws.services.s3.AmazonS3Client;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

/**
 * @Author rohit
 * @Date 23/09/21
 **/

@Configuration
public class AwsConfig {

    @Value("${alpha.s3.accessKey}")
    private String accessKey;

    @Value("${alpha.s3.secretKey}")
    private String secretKey;

    @Value("${alpha.s3.region}")
    private String region;

    public AmazonS3 getS3Client(){
        AWSCredentials credentials = new BasicAWSCredentials(accessKey, secretKey);
        return AmazonS3Client.builder()
                .withRegion(region)
                .withCredentials(new AWSStaticCredentialsProvider(credentials))
                .build();
    }

}


package com.example.customui;

import android.os.Bundle;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;

import com.example.customui.view.MyRadioButton;

public class RadioButtonActivity extends BaseActivity {
	private MyRadioButton myRadioButton;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		String typeStr = getIntent().getStringExtra("type");
		if (typeStr.equals("radio")) {
			setContentView(R.layout.radio);

			myRadioButton = (MyRadioButton) findViewById(R.id.rb_radio);

			myRadioButton.setOnCheckedChangeListener(new OnCheckedChangeListener() {
				@Override
				public void onCheckedChanged(CompoundButton buttonView,
						boolean isChecked) {

					show("" + myRadioButton.getValue());
				}
			});
		}else if (typeStr.equals("textedit")){
			setContentView(R.layout.textedit);
		}else if (typeStr.equals("launch")){
			setContentView(R.layout.launch_scroll_layout);
		}
	}
}


package com.ExploreCanada.packages.entities;

import java.sql.Date;

import javax.persistence.Temporal;
import javax.persistence.TemporalType;

public class BookingQueryDetails {

	private String fromDetails;
	private String toDetails;
	@Temporal(TemporalType.DATE)
	private Date journeyDate;
	public BookingQueryDetails() {
		super();
	}
	public BookingQueryDetails(String fromDetails, String toDetails, Date journeyDate) {
		super();
		this.fromDetails = fromDetails;
		this.toDetails = toDetails;
		this.journeyDate = journeyDate;
	}
	public String getFromDetails() {
		return fromDetails;
	}
	public void setFromDetails(String fromDetails) {
		this.fromDetails = fromDetails;
	}
	public String getToDetails() {
		return toDetails;
	}
	public void setToDetails(String toDetails) {
		this.toDetails = toDetails;
	}
	public Date getJourneyDate() {
		return journeyDate;
	}
	public void setJourneyDate(Date journeyDate) {
		this.journeyDate = journeyDate;
	}

}


import org.apache.commons.lang3.ObjectUtils;
import org.codehaus.jackson.JsonParser;
import org.json.JSONException;
import org.json.JSONObject;

import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.Charset;

/**
 * Created by MC on 4/23/2015.
 */
public class JsonReader {

    String URL;

    public JsonReader(String URL){
        this.URL = URL;
    }

    private String readAll(Reader rd) throws IOException {
        StringBuilder sb = new StringBuilder();
        int cp;
        while ((cp = rd.read()) != -1) {
            sb.append((char) cp);
        }
        return sb.toString();
    }

    public JSONObject readJsonFromUrl() throws IOException, JSONException {
        InputStream is = new URL(this.URL).openStream();
        JSONObject json;
        try {
            BufferedReader rd = new BufferedReader(new InputStreamReader(is, Charset.forName("UTF-8")));
            String jsonText = readAll(rd);
            json = new JSONObject(jsonText);
            return json;
        }
        catch (IOException e){
            e.printStackTrace();
            json = new JSONObject();
        } finally{
            is.close();
        }

        return json;
    }

}


package arie.kal.covidtracker.controllers;

import arie.kal.covidtracker.models.LocationData;
import arie.kal.covidtracker.services.CovidDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;

@Controller
public class MainController {

    @Autowired
    CovidDataService covidDataService;

    @GetMapping("/")
    public String main(Model model) {
        List<LocationData> allData = covidDataService.getAllData();
        int totalReportedCases = allData.stream().mapToInt(stat -> stat.getLatestTotalCases()).sum();
        int totalNewCases = allData.stream().mapToInt(stat -> stat.getDiffFromPrevDay()).sum();
        model.addAttribute("locData", allData);
        model.addAttribute("totalReportedCases", totalReportedCases);
        model.addAttribute("totalNewCases", totalNewCases);
        return "main";
    }
}


# Jigsaw-Modularity
Explains Jigsaw Modular design

@author Ganesh Nagalingam

The code is developed using Java SE 11.
Three modules have been designed and developed to explain Jigsaw modularity.
To learn and understand, the code can be imported into your local machine and can be tested.
It consists of module-info.java file and one or more packages. Modules offer stronger encapsulation than jars.

What is Jigsaw ?
Project Jigsaw- Its a flagship feature of Java 9.
It introduces modularity to monolithic Java SE ecosystem. The primary goal of the Jigsaw project was to make the
Java SE Platform and the JDK more easily scalable down.
Modularization of the JDK enables the source code to be completely restructured in order to make it easier to maintain.
Module is a self-describing collection of code, data and resources.

Happy learning!!!
------------------------------------------------------------------------------------------------------------------------------------------------------------------


package rainmtime.com.demorepo.movies.data;

/**
 * Created by chunyu on 2018/2/11 下午3:39.
 * Email: 746431278@qq.com
 */

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

public class Director {

    @SerializedName("alt")
    @Expose
    private String alt;
    @SerializedName("avatars")
    @Expose
    private DirectorAvatar avatars;
    @SerializedName("name")
    @Expose
    private String name;
    @SerializedName("id")
    @Expose
    private String id;

    public String getAlt() {
        return alt;
    }

    public void setAlt(String alt) {
        this.alt = alt;
    }

    public DirectorAvatar getAvatars() {
        return avatars;
    }

    public void setAvatars(DirectorAvatar avatars) {
        this.avatars = avatars;
    }

    public String getName() {
        return name;
    }

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

    public String getId() {
        return id;
    }

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

}


package com.company;

import java.util.ArrayList;

import java.util.List;

public class Department {

    private String name;
    private College college;
    private List<Student> students ;

     Department(String name, College college) {
        this.name = name;
        this.college = college;
        this.students = new ArrayList<>();

    }

    public String getName() {
        return name;
    }

    public List<Student> getStudents() {
        return students;
    }

    public void setStudents(List<Student> students) {
        this.students = students;
    }

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

    public College getCollege() {
        return college;
    }

    public void setCollege(College college) {
        this.college = college;
    }
    public void addStudents(Student student) {
        this.students.add(student);
    }
    public void showStudents() {
         for(Student student : students)
        System.out.println( " Department " + name + "   Student name " + student.getName());

    }
}


package no.agens.dialogfragmentissue;

import android.support.v4.app.FragmentManager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        findViewById(R.id.open_dialog).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                showEditDialog();
            }
        });
    }

    private void showEditDialog() {
        FragmentManager fm = getSupportFragmentManager();
        ExampleDialogFragment editNameDialog = new ExampleDialogFragment();
        editNameDialog.show(fm, "fragment_example_dialog");
    }

    /*@Override
    public void onFinishEditDialog(String inputText) {
        Toast.makeText(this, "Hi, " + inputText, Toast.LENGTH_SHORT).show();
    }*/

}


---
title: windows 下MongoDB的安装与配置
date: 2018-03-07 19:14:57
tags:
---

# 一、 先登录Mongodb官网https://www.mongodb.com/download-center#community下载安装包

# 二、 安装MongoDB
自定义安装路径修改如下：  D:\MongoDB

# 三、创建数据库文件的存放位置
在MongoDB下创建data，因为启动mongodb服务之前需要必须创建数据库文件的存放文件夹，否则命令不会自动创建，而且不能启动成功。

# 四、启动MongoDB服务
1. 打开cmd命令行，进入D:\MongoDB\bin 目录
2. 输入如下命令启动MongoDB服务
    > mongodb --dbpath D:\MongoDB\data
3. 在浏览器输入http://localhost:27017 查看
如果显示“It looks like you are trying to access MongoDB over HTTP on the native driver port.”,表示成功。

# 五、 配置本地windows mongodb 服务
这个可设置为开机自启动，可直接手动启动关闭，可通过命令行net start MongoDB 启动。
1. 先在MongoDb 文件夹下创建一个logs 文件夹下创建一个logs
2. 在MongoDB新建配置文件mongo.conf
3. 打开mongo.conf, 并输入：
```
dbpath=D:\MongoDB\data
logpath=D:\MongoDB\logs\mongo.log
logappend=true
journal=true
quiet=true
port=27017
```
4. 配置windows服务
以管理员的身份打开cmd,进入D:\MongoDB\bin目录下
输入mongod --config D:\\Mongodb\mongo.conf --install --serviceName "MongoDB"
完成后，再次查看本地的服务，如果成功的话，会发现本地服务多了”MongoDB"服务。


package com.clairvoyantsoft.demo.security;

import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.Optional;

public class SecurityUtils {

    public static Optional<String> getCurrentLoggedInUSer(){

        SecurityContext securityContext = SecurityContextHolder.getContext();

        return Optional.ofNullable(securityContext.getAuthentication())
                .map(authentication -> {

                    if(authentication.getPrincipal() instanceof UserDetails){
                        return ((UserDetails) authentication.getPrincipal()).getUsername();
                    } else if(authentication.getPrincipal() instanceof  String){
                        return (String) authentication.getPrincipal();

                    }
                    return null;
                });
    }
}


# TeamInterview

**Docker Commands**

1.  create a docker image by running:

**docker build -t ti:latest .**

a) create container by running:**docker run --name ti-container --env-file=.env -p 5000:5000 teaminterview-dev**

b) run db migrations by running in container: **docker exec ti-container python3 manage.py db migrate**

c) copy migrations from container to host machine by running: **docker cp ti-container:/TeamInterview/migrations ~/path/to/host/destination**

2. Whenever rerunning container, to persist and save migrations for source control run docker container by bind mounting the host migrations folder created in step 1c by running: **docker run -it --name ti-container -v ~/pathFrom1C/migrations:/TeamInterview/migrations --env-file=.env ti**
<!-- 1. In docker container run:
   **docker exec ti-container python3 manage.py db init**
3. Create volume for migrations by running:
   **docker volume create teaminterview-dev**
4. whenever rerunning container, use command from 1a. -->


package com.project.musicstore.controller;

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

import com.project.musicstore.entity.BillingAddress;
import com.project.musicstore.entity.Customer;
import com.project.musicstore.entity.ShippingAddress;
import com.project.musicstore.service.CustomerService;

@Controller
public class RegisterController {

	@Autowired
    private CustomerService customerService;

	@GetMapping("/register")
	public String registerCustomer(Model theModel) {
		Customer customer = new Customer();
		BillingAddress billingAddress = new BillingAddress();
        ShippingAddress shippingAddress = new ShippingAddress();

        customer.setBillingAddress(billingAddress);
        customer.setShippingAddress(shippingAddress);

        theModel.addAttribute("customer", customer);

		return "registerCustomer";
	}

}


package org.academiadecodigo.charliesangels.services;

import org.academiadecodigo.charliesangels.models.Poll;
import org.springframework.stereotype.Service;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

@Service
public class PollServiceImpl implements PollService {

    private Map<Integer, Poll> polls = new ConcurrentHashMap<>();
    private Integer counter = 0;

    public Map<Integer, Poll> getPolls() {
        return polls;
    }

    public void setPolls(Map<Integer, Poll> polls) {
        this.polls = polls;
    }

    @Override
    public Poll savePoll(Poll poll) {
        counter++;
        poll.setId(counter);
        return polls.put(poll.getId(), poll);
    }

    @Override
    public Poll getPoll(Integer id) {
        return polls.get(id);
    }

    @Override
    public void incrementYes(Integer id) {
        Poll poll = polls.get(id);
        poll.incrementYes();
    }

    @Override
    public void incrementNo(Integer id) {
        Poll poll = polls.get(id);
        poll.incrementNo();
    }
}


package com.mcshoppinglist.app.util;

import android.graphics.Color;
import android.graphics.Typeface;
import android.text.SpannableString;
import android.text.Spanned;
import android.text.style.StyleSpan;
import android.widget.TextView;

public class ViewUpdateUtil {

    /**
     * Bold/unbold the TextView based on the boolean value.
     *
     * @param notBold
     * @param textView
     * @param textViewStr
     */
    public static void setTextBold(boolean bold, TextView textView, String textViewStr) {
        if (bold) {
            textView.setTextColor(Color.WHITE);
            SpannableString spannableStr = new SpannableString(textViewStr);
            spannableStr.setSpan(new StyleSpan(Typeface.BOLD), 0, textViewStr.length(),
                            Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
            textView.setText(spannableStr);
        } else {
            textView.setTextColor(Color.GRAY);
            textView.setText(textViewStr);
        }
    }

}


package com.imooc.web.filter;

import com.imooc.domain.User;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebFilter(filterName = "UserFilter", urlPatterns = {"/AddEditMessageServlet", "/UserServlet"})
public class UserFilter implements Filter {
    public void destroy() {
    }

    public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws ServletException, IOException {
        HttpServletRequest request = (HttpServletRequest) req;
        User loginUser = (User) request.getSession().getAttribute("loginUser");
        if (loginUser == null) {
            request.setAttribute("msg", "您尚未登录，请先登录");
            request.getRequestDispatcher("/login.jsp").forward(request, (HttpServletResponse) resp);
        }

        chain.doFilter(req, resp);
    }

    public void init(FilterConfig config) throws ServletException {

    }

}


# Quake - Offering - GOG - Epsilon

### Description:
This script will facilitate you install of this game on Linux OS:
"Quake - Offering" provided by GOG using Darkplaces engine:
http://icculus.org/twilight/darkplace
and Epsilon enhancement pack:
https://www.soulstudios.co.nz/epsilon/
https://www.moddb.com/mods/quake-epsilon-build/downloads/quake-epsilon-build-v254
During install please let all options by default.
Big thanks to people who gave their time to permit us playing this game in the best conditions on Linux platform.

### Technical notes:
- Epsilon pack v2.54 - 18/12/2016
- Included 3 Mission Packs: "Scourge of Armagon ", "Dissolution of Eternity" and "Abyss of Pandemonium".
- Included all needed original soundtracks
- Install Windows AND Linux version. You could choose which one to play at start.
- x360 gamepad compatible.
- Please report issue concerning this script on my Github page:
https://github.com/legluondunet/MyLittleLutrisScripts/


package com.andre.api;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

import com.andre.api.utils.SenhaUtils;

@SpringBootApplication
public class MeuPrimeiroProjetoApplication {

	@Value("${paginacao.qtd_por_pagina}")
	private int qtdPorPagina;

	public static void main(String[] args) {
		SpringApplication.run(MeuPrimeiroProjetoApplication.class, args);
		System.out.println("Meu primeiro projeto...");
	}

	@Bean
	public CommandLineRunner commandLineRunner() {
		return args -> {
			String senhaEncoded = SenhaUtils.gerarBCrypt("123456");
			System.out.println("Senha encoded: "+ senhaEncoded);

			senhaEncoded = SenhaUtils.gerarBCrypt("123456");
			System.out.println("Senha encoded novaente: "+ senhaEncoded);

			System.out.println("Senha válida: "+ SenhaUtils.senhaValida("123456", senhaEncoded));
		};
	}

}


package edu.weather.portlet.dto;

import edu.weather.api.dto.Weather;

import java.util.List;

public class WeatherForecast {
    private String resourceName;
    private String cityName;
    private List<Weather> weatherList;

    public WeatherForecast(String resourceName, String cityName, List<Weather> weatherList) {
        this.resourceName = resourceName;
        this.cityName = cityName;
        this.weatherList = weatherList;
    }

    public String getCityName() {
        return cityName;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }

    public String getResourceName() {
        return resourceName;
    }

    public void setResourceName(String resourceName) {
        this.resourceName = resourceName;
    }

    public List<Weather> getWeatherList() {
        return weatherList;
    }

    public void setWeatherList(List<Weather> weatherList) {
        this.weatherList = weatherList;
    }
}


package com.iteyes.newslive;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.ImageView;
import android.widget.TextView;

import com.squareup.picasso.Picasso;

public class NewsDetailActivity extends AppCompatActivity {

    ImageView iv1;
    TextView tvTitle;
    TextView tvDescription;

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

        iv1 = (ImageView) findViewById(R.id.imageview_1);
        tvTitle = (TextView) findViewById(R.id.textview_1);
        tvDescription = (TextView) findViewById(R.id.textview_2);

        NewsItem newsItem = (NewsItem) getIntent().getSerializableExtra("news_item");
        Picasso.with(this).load(newsItem.imagePath).placeholder(R.drawable.placeholder).into(iv1);
        tvTitle.setText(newsItem.title);
        tvDescription.setText(newsItem.description);
    }
}


package com.helio.myreelty.network.models;

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

/**
 * Created by Fedir on 25.02.2016.
 */
public class RegistrationResponseModel {

    @SerializedName("name")
    @Expose
    public String name;
    @SerializedName("id")
    @Expose
    public Integer id;
    @SerializedName("email")
    @Expose
    public String email;
    @SerializedName("created_at")
    @Expose
    public String createdAt;

    public String getName() {
        return name;
    }

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

    public Integer getId() {
        return id;
    }

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

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(String createdAt) {
        this.createdAt = createdAt;
    }
}


package ar.com.mercadolibre.solarsystem.entity;

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

@Entity
@Table(name = "WEATHER")
public class Weather {

    @Id
    @Column(name = "DAY", nullable = false, unique = true)
    private int day;

    @Column(name = "WEATHER", nullable = false)
    private String weather;

    public Weather() {
        super();
    }

    public Weather(int day, String weather) {
        this();
        this.day = day;
        this.weather = weather;
    }

    public int getDay() {
        return day;
    }

    public void setDay(int day) {
        this.day = day;
    }

    public String getWeather() {
        return weather;
    }

    public void setWeather(String weather) {
        this.weather = weather;
    }

    @Override
    public String toString() {
        return "Weather{" +
                "day=" + day +
                ", weather='" + weather + '\'' +
                '}';
    }
}


package jp.co.axiz.entity;

import java.sql.Date;

public class Tax {
	/*---  Field  ---*/
	private Integer taxId;				// 変数名概要
	private Double tax;					// 変数名概要
	private Date introductionDate;		// 変数名概要

	/*---  Field End  ---*/

	/*---  Constructor  ---*/
	//  処理概要
	public Tax() {
	}

	public Tax(Integer taxId, Double tax, Date introductionDate) {
		super();
		this.taxId = taxId;
		this.tax = tax;
		this.introductionDate = introductionDate;
	}

	/*---  Constructor End  ---*/

	/*---  Method  ---*/
	//  処理概要
	public Integer getTaxId() {
		return taxId;
	}

	public void setTaxId(Integer taxId) {
		this.taxId = taxId;
	}

	public Double getTax() {
		return tax;
	}

	public void setTax(Double tax) {
		this.tax = tax;
	}

	public Date getIntroductionDate() {
		return introductionDate;
	}

	public void setIntroductionDate(Date introductionDate) {
		this.introductionDate = introductionDate;
	}

	/*---  Method End  ---*/
}


# bench-blog-railsdecal

Title: Bench Blog RailsDeCal

Team Members: Abhishek Mangla, Amrith Mylvara, Aneesh Khera, Srinand Balaji

Demo Link: [Insert Heroku Link Here]

Idea: An application where up and coming bloggers can make a name for themselves in the world of sports.

Models and Description:

	User: has name, email, and many comments and questions

	Post: has title, topic, and text

	Comment: has text and belongs to a designated User

	Blog: has many posts and belongs to a designated User

Features:

	Users can log in

	Users can comment on blogs and use the like feature

	Blogs will be siphoned into specific sections, based on their sport

Division of Labor:

	Abhishek: user model, users controller, html design, css design

	Amrith: post model, posts controller, blog model, screencast

	Aneesh: comments model, comments controller, pages controller

	Srinand: views, migrations, html design, gem implementation

Link to app document: https://docs.google.com/document/d/18VFWW3_ZVyN5BPYy3JGEADjiybIZxiZFJ7Gf6b4AF7c/edit


package com.bluewind.boot.common.utils.web;

import com.bluewind.boot.common.utils.JsonTool;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.servlet.ServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * @author liuxingyu01
 * @date 2021-01-30-11:21
 **/
public class ResponseUtil {
    private final static Logger logger = LoggerFactory.getLogger(ResponseUtil.class);

    public static void sendJson(ServletResponse response, Object responseObject) {
        //将实体对象转换为JSON Object转换
        String jsonStr = JsonTool.objectToJsonString(responseObject);
        response.setCharacterEncoding("UTF-8");
        response.setContentType("application/json; charset=utf-8");
        PrintWriter out = null;
        try {
            out = response.getWriter();
            out.append(jsonStr);
        } catch (IOException e) {
            logger.error("ResponseUtil -- sendJson -- IOException = {e}", e);
        } finally {
            if (out != null) {
                out.close();
            }
        }
    }

}


/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.senai.sc.util;

import java.sql.DriverManager;
import java.sql.SQLException;

/**
 *
 * @author Caio Pereira
 */
public class ConnectionUtil {

    private static java.sql.Connection con;

    public static java.sql.Connection getConnection(){
        try {
            Class.forName("com.mysql.jdbc.Driver");
            String url = "jdbc:mysql://localhost:3306/epark";
            con = DriverManager.getConnection(url,"root","root");
            con.setAutoCommit(true);
            return con;
        } catch ( ClassNotFoundException e){
            e.printStackTrace();
        } catch ( SQLException se){
            se.printStackTrace();
        }
        return null;
    }

    public static void closeConnection(){
        try {
            con.close();
        } catch (SQLException ex) {
            ex.printStackTrace();
        }
    }

}


package com.stewartrap.movies;

import android.os.Bundle;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;

import com.stewartrap.movies.bus.BusProvider;

public class MovieDetailActivity extends AppCompatActivity {

    public final String TAG = MovieDetailActivity.class.getSimpleName();

    @Override
    protected void onCreate( Bundle savedInstanceState ) {

        super.onCreate( savedInstanceState );
        setContentView( R.layout.movie_detail_activity_layout );
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar );
        setSupportActionBar( toolbar );

        MovieDetailFragment movieDetailFragment = new MovieDetailFragment();
        FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
        transaction.add( R.id.detailFragmentPlaceholder, movieDetailFragment, "movieDetailFragment" );
        transaction.commit();
    }
}


package us.ihmc.robotiq.communication.registers;

import us.ihmc.robotiq.communication.Finger;
import us.ihmc.robotiq.communication.InvalidFingerException;

public class FingerCurrentRegister extends RobotiqInputRegister
{
   private final int index;
   private byte current;

   public FingerCurrentRegister(Finger finger)
   {
      switch(finger)
      {
         case FINGER_A:
            index = 5;
            break;
         case FINGER_B:
            index = 8;
            break;
         case FINGER_C:
            index = 11;
            break;
         case SCISSOR:
            index = 14;
            break;
         default:
            throw new InvalidFingerException(finger);
      }
   }

   @Override
   public byte getRegisterValue()
   {
      return current;
   }

   @Override
   public void setRegisterValue(byte value)
   {
      current = value;
   }

   @Override
   public int getRegisterIndex()
   {
      return index;
   }

}


package pl.sda.shop.web;

import pl.sda.shop.model.User;
import pl.sda.shop.model.UserRole;
import pl.sda.shop.security.UserService;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class LoginServlet extends HttpServlet {
    private UserService userService;

    public LoginServlet(UserService userService) {
        this.userService = userService;
    }

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        req.getRequestDispatcher("/login.jsp").forward(req,resp);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        if ( userService.login(req)){
            resp.sendRedirect("/addProduct");
        } else {
            resp.sendRedirect("/login?success=false");
        }
    }
}


package com.swyep.cassandra.astyanax.demo.messaging;

import org.apache.activemq.ActiveMQConnectionFactory;

import javax.jms.Connection;
import javax.jms.JMSException;
import javax.jms.Session;

public class ActiveMqConnector {

    private final ActiveMQConnectionFactory connectionFactory;

    public ActiveMqConnector(String brokerUrl) {
        this.connectionFactory = new ActiveMQConnectionFactory(brokerUrl);
    }

    public Connection getConnection() {
        try {
            return connectionFactory.createConnection();
        } catch (JMSException e) {
            throw new RuntimeException(e);
        }
    }

    public Session getSession(boolean b, int i) {
        try {
            Connection connection = getConnection();
            Session session = connection.createSession(b, i);
            connection.start();
            return session;
        } catch (JMSException e) {
            throw new RuntimeException(e);
        }
    }
}


package com.company;

public class Television {
    private String make;
    private String model;
    private int size;
    private Resolution nativeResolution;
    private int channel;

    public Television(String make, String model, int size, Resolution nativeResolution, int channel) {
        this.make = make;
        this.model = model;
        this.size = size;
        this.nativeResolution = nativeResolution;
        this.channel = channel;
    }

    public void powerOn() {
        System.out.println("Powering on..." + make + " " + model);
    }

    public void changeChannel(int newChannel) {
        channel = newChannel;
        System.out.println("Channel changed to " + newChannel);
    }

    public String getMake() {
        return make;
    }

    public String getModel() {
        return model;
    }

    public int getSize() {
        return size;
    }

    public Resolution getNativeResolution() {
        return nativeResolution;
    }

    public int getChannel() {
        return channel;
    }
}


package com.sandlex.progressbot.bot.commands;

import com.sandlex.progressbot.bot.BotResponse;
import com.sandlex.progressbot.bot.CallbackOptionsBuilder;
import com.sandlex.progressbot.bot.model.Status;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;
import org.telegram.telegrambots.api.objects.Message;

import java.util.List;

@Component
@RequiredArgsConstructor
public class CancelledCommand implements ExecutableCommand {

    private final CallbackOptionsBuilder callbackOptionsBuilder;

    @Override
    public BotResponse execute(Message message) {
        List<String> cancelledProjects = callbackOptionsBuilder.projectsWith(message.getFrom().getId(), Status.CANCELLED);
        if (cancelledProjects.isEmpty()) {
            return new BotResponse("Your don't have any cancelled projects");
        }

        return new BotResponse(
                "Your cancelled projects:",
                cancelledProjects);
    }

}


package com.sundl.spring.tx;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by Sun on 2015/5/10.
 */
@Service("bookShopService")
public class BookShopServiceImpl implements BookShopService {

    @Autowired
    private BookShopDao bookShopDao;

    @Transactional(propagation = Propagation.REQUIRED,
            isolation = Isolation.READ_COMMITTED, readOnly = false, timeout = 3)
    public void purchase(String username, String isbn) {
        try {
            Thread.sleep(4000);
        } catch (InterruptedException e) {
        }

        //1. 获取书的单价
        int bookPriceByIsbn = bookShopDao.findBookPriceByIsbn(isbn);

        //2.更新书的库存
        bookShopDao.updateBookStock(isbn);

        //3.更新用户余额
        bookShopDao.updateUserAccount(username, bookPriceByIsbn);
    }
}


package com.msk.product.bean;

import com.msk.core.entity.PdClasses;
import org.springframework.util.CollectionUtils;

import java.util.List;

/**
 *
 * @author gyh
 *
 */
public class ProductClasses extends PdClasses {
    /** serialVersionUID */
    private static final long serialVersionUID = 1L;
    private int size;
    private List<ProductBreed> pdBreedList;

    /**
     * @return the size
     */
    public int getSize() {
        if(!CollectionUtils.isEmpty(pdBreedList)){
            return pdBreedList.size();
        }
        return size;
    }

    /**
     * @param size the size to set
     */
    public void setSize(int size) {
        this.size = size;
    }

    /**
     *
     * 品种信息
     *
     * @return
     * @author silent
     */
    public List<ProductBreed> getPdBreedList() {
        return this.pdBreedList;
    }

    public void setPdBreedList(List<ProductBreed> pdBreedList) {
        this.pdBreedList = pdBreedList;
    }

}


package org.jboss.modules.cl;

import org.jboss.modules.spi.Module;
import org.jboss.modules.spi.ResourceLoader;
import org.jboss.modules.spi.ResourceSpec;

import java.io.IOException;
import java.io.InputStream;
import java.net.URL;

/**
 * @author John Bailey
 */
public class DefaultResourceSpec implements ResourceSpec
{
   private final Module module;
   private final ResourceLoader loader;
   private final URL resourceUrl;

   public DefaultResourceSpec(final Module module, final ResourceLoader loader, final URL resourceUrl)
   {
      this.module = module;
      this.loader = loader;
      this.resourceUrl = resourceUrl;
   }

   public URL getUrl()
   {
      return resourceUrl;
   }

   public InputStream openStream() throws IOException
   {
      return resourceUrl.openStream();
   }

   public ResourceLoader getLoader()
   {
      return loader;
   }

   public Module getModule()
   {
      return module;
   }
}


package com.lyn.utils.dayuren;

import java.io.File;

/**
 * 查询文件
 */
public class SearchFile {
    public static void main(String[] args) throws Exception {

        searchFile("F:\\十方俱灭\\大鱼人");
    }

    public static void replaceFileName(File f,String newName){
        String c=f.getParent();
        File mm=new File(newName);
        if(f.renameTo(mm))
        {
            System.out.println("修改成功!");
        }
        else
        {
            System.out.println("修改失败");
        }
    }

    public static void searchFile(String path){
        File file = new File(path);		//获取其file对象
        File[] fs = file.listFiles();	//遍历path下的文件和目录，放在File数组中
        for(File f:fs){					//遍历File[]数组
            if(!f.isDirectory())		//若非目录(即文件)，则打印
                if(f.getName().indexOf("--")<0){
                    String fileName=f.getName();
                    System.out.println(fileName);
                    replaceFileName(f,"F:/十方俱灭/"+fileName);
                }
        }
    }

}


package com.sample.common.entity;

import lombok.Builder;

import java.util.List;

//@Entity
public class SearchEntity {

    // タイトル
    private String title;

    // 概要
    private String overview;

    // 掲載開始日FROM
    private String displayStartDateFrom;

    // 掲載開始日TO
    private String displayStartDateTo;

    // 掲載終了日FROM
    private String displayEndDateFrom;

    // 掲載終了日TO
    private String displayEndDateTo;

    // お知らせタイプリスト
    private List<Integer> informationTypeList;

    @Builder
    public SearchEntity(String title, String overview, String displayStartDateFrom, String displayStartDateTo
    , String displayEndDateFrom, String displayEndDateTo, List<Integer> informationTypeList) {
        this.title = title;
        this.overview = overview;
        this.displayStartDateFrom = displayStartDateFrom;
        this.displayStartDateTo = displayStartDateTo;
        this.displayEndDateFrom = displayEndDateFrom;
        this.displayEndDateTo = displayEndDateTo;
        this.informationTypeList = informationTypeList;
    }
}


import java.util.Scanner;
import java.util.regex.Pattern;

public class Main {
    public static final String WRONG_EMAIL_ANSWER = "Неверный формат email";

    public static void main(String[] args) {
        EmailList emailList = new EmailList();
        Scanner scanner = new Scanner(System.in);
        final String enterList = "LIST";
        Pattern addMail = Pattern.compile("ADD .+");
        while (true) {
            String input = scanner.nextLine();
            if (input.equals("exit")) {
                break;
            } else if (input.trim().equals(enterList)) {
                for (String str :
                        emailList.getSortedEmails()) {
                    System.out.println(str);
                }
            } else if (addMail.matcher(input).matches()) {
                emailList.add(input.replaceAll("ADD ", ""));
            } else {
                System.out.println(WRONG_EMAIL_ANSWER);
            }

        }

    }
}


package com.filipkesteli.prvaaplikacija;

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

public class ResultActivity extends AppCompatActivity {

    private EditText etResult;

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

        initWidgets();
        handleIntent();
    }

    private void initWidgets() {
        etResult = (EditText) findViewById(R.id.etResult);
    }

    private void handleIntent() {
        int number = 0;
        Intent intent = getIntent();
        if (intent.hasExtra(MainActivity.PARAMETER_SMALLER)) {
            number = intent.getIntExtra(MainActivity.PARAMETER_SMALLER, 0);
        }
        if (intent.hasExtra(MainActivity.PARAMETER_BIGGER)) {
            number = intent.getIntExtra(MainActivity.PARAMETER_BIGGER, 0);
        }
        etResult.setText(number+"");
    }
}


package com.example.elina.a2505;

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.TextView;

public class Main4Activity extends AppCompatActivity {
    TextView quoteText;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main4);
        Intent intent = getIntent();

        quoteText = findViewById(R.id.tv1);
        quoteText.setText(intent.getStringExtra("cc"));
    }
}
/*
 Intent mIntent= getIntent();
 int intValue = mIntent.getIntExtra("intVariableName", 0);

Bundle extras = new Bundle();
extras.putString("StringVariableName", intValue + "");
intent.putExtras(extras);
startActivity(intent);

Bundle extras = getIntent().getExtras();
   String stringVariableName = extras.getString("StringVariableName");
   int intVariableName = Integer.parseInt(stringVariableName);
 */


package org.ggj2013;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
import android.view.Window;
import android.view.WindowManager;

public class StartActivity extends Activity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		requestWindowFeature(Window.FEATURE_NO_TITLE);
		getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
				WindowManager.LayoutParams.FLAG_FULLSCREEN);
		setContentView(R.layout.activity_start);
		findViewById(R.id.btn_start).setOnTouchListener(new OnTouchListener() {
			@Override
			public boolean onTouch(View v, MotionEvent event) {
				if (MotionEvent.ACTION_UP == event.getAction()) {
					Intent myIntent = new Intent(StartActivity.this,
							MenuActivity.class);
					startActivity(myIntent);
				}
				return true;
			}
		});
	}
}


package com.coderfocus.servletinspringbootdemo.servlet;

import org.springframework.beans.factory.annotation.Autowired;

import javax.servlet.ServletContext;
import javax.servlet.ServletRequestEvent;
import javax.servlet.ServletRequestListener;
import javax.servlet.annotation.WebFilter;
import javax.servlet.annotation.WebListener;
import javax.servlet.http.HttpServletRequest;

@WebListener
public class MyServletRequestLinstener implements ServletRequestListener {

    @Override
    public void requestInitialized (ServletRequestEvent sre) {
        HttpServletRequest request = (HttpServletRequest) sre.getServletRequest();
        ServletContext servletContext = request.getServletContext();
        servletContext.log("request was initialized!");
    }

    @Override
    public void requestDestroyed (ServletRequestEvent sre) {
        HttpServletRequest request = (HttpServletRequest) sre.getServletRequest();
        ServletContext servletContext = request.getServletContext();
        servletContext.log("request was destroyed!");
    }

}


# webduino

Web components for Webduino

## Installation

```Shell
$ bower install webduino
```

Build webduino-js dist files:

```Shell
$ cd bower_components/webduino-js
$ npm install && npm run build
```

## Usage

Insert webduino web-components and polyfill:

```
<script src='bower_components/webcomponentsjs/webcomponents.js'></script>
<link rel='import' href='bower_components/webduino/web-arduino.html'></link>
<link rel='import' href='bower_components/webduino/wa-led.html'></link>
```

Use it in your html:

```
<web-arduino id='board' device='device_id'>
  <wa-led id='led' pin='10'></wa-led>
</web-arduino>
```

Control it with javascript:

```javascript
window.addEventListener('WebComponentsReady', function() {
  var board = document.getElementById('board'),
    led = document.getElementById('led');

  board.on('ready', function () {
    led.on();
  });
});
```

## API

_(coming soon...)_

## See Also

[webduino-js](https://github.com/webduinoio/webduino-js) (The javascript core that powers webduino)

## [License](LICENSE)


package com.example.rabbitmqdemo.topic;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * Created by zhoun on 2019-05-14
 */
@Component
public class TopicSender {

    @Autowired
    private AmqpTemplate amqpTemplate;

    public void send(){
        String context = "i am message all";
        System.out.println("Sender:"+context);
        this.amqpTemplate.convertAndSend("topicExhange","topic.1",context);
    }

    public void send1(String message){
        String  context = "i am mesage 1";
        System.out.println("Sender:"+context);
        this.amqpTemplate.convertAndSend("topicExchange","topic.message",context);
    }

    public void send2(String message){
        String context = "i am message 2";
        System.out.println("Sender:"+context);
        this.amqpTemplate.convertAndSend("topicExchange","topic.messages",context);
    }

}


package com.alberto.arellano.ThreadsSandbox;

import java.util.Objects;

/**
 * Created by rome on 11/4/2015.
 */
public class CloningThreadDemo{
//    Threads were never designed to be cloned. Doing some reading sparked off one of the comments I found this summed it up quite well :
//   "But we either have to disallow cloning or give it meaningful semantics - and the latter isn't going to
//    happen." -- David Holmes
    public static void main(String[] args) {
        // Unhandled
        CloningThreadDemo thredToBeCloned = new CloningThreadDemo();
        thredToBeCloned.cloned();
    }

    public CloningThreadDemo cloned()
    {
        try {
            return (CloningThreadDemo) super.clone();
        } catch (CloneNotSupportedException e) {
            //ERROR: Throws CloneNotSupportedException as a Thread can not be meaningfully cloned. Construct a new Thread instead
            e.printStackTrace();
        }
        return null;
    }

}


package com.ctriposs.cache.foroldlogic.Entities;

import com.ctriposs.cache.memcached.MemcachedClient;

public class MInstance
{

	private String privateIpAddress;
	public final String getIpAddress()
	{
		return privateIpAddress;
	}
	public final void setIpAddress(String value)
	{
		privateIpAddress = value;
	}

	private int privatePort;
	public final int getPort()
	{
		return privatePort;
	}
	public final void setPort(int value)
	{
		privatePort = value;
	}

	private int privateMaxConnections;
	public final int getMaxConnections()
	{
		return privateMaxConnections;
	}
	public final void setMaxConnections(int value)
	{
		privateMaxConnections = value;
	}

	private MGroup privateGroup;
	public final MGroup getGroup()
	{
		return privateGroup;
	}
	public final void setGroup(MGroup value)
	{
		privateGroup = value;
	}

	private MemcachedClient _client;

	public final MemcachedClient getClient()
	{
		if(_client == null)
		{
			_client = null;//MemcachedClient.Create(getIpAddress() + ":" + getPort());
		}
		return _client;
	}

}


package com.walmart.ticketing.seats;

import java.util.Objects;

public class Position {

	private Integer seatNumber;
	private Integer rowNumber;

	public Position(){}

	public Position(Integer rowNumber, Integer seatNumber)
	{
		this.seatNumber = seatNumber;
		this.rowNumber = rowNumber;
	}

	public Integer getSeatNumber() {
		return seatNumber;
	}
	public void setSeatNumber(Integer seatNumber) {
		this.seatNumber = seatNumber;
	}
	public Integer getRowNumber() {
		return rowNumber;
	}
	public void setRowNumber(Integer rowNumber) {
		this.rowNumber = rowNumber;
	}

	 @Override
	    public boolean equals(Object o) {

	        if (o == this) return true;
	        if (!(o instanceof Position)) {
	            return false;
	        }
	        Position position = (Position) o;
	        return (seatNumber == position.seatNumber &&
	                rowNumber == position.rowNumber);

	    }

	 @Override
	    public int hashCode() {
	        return Objects.hash(seatNumber, rowNumber);
	    }
}


package ua.com.booking.hotel.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import ua.com.booking.hotel.entity.User;
import ua.com.booking.hotel.repository.UserRepository;
import ua.com.booking.hotel.service.UserService;

import javax.persistence.EntityExistsException;
import java.util.Optional;

@Service
public class UserServiceImpl implements UserService {

    private UserRepository userRepository;

    @Autowired
    UserServiceImpl(UserRepository userRepository) {
        this.userRepository = userRepository;
    }

    @Override
    public User create(User user) {
        if (userRepository.existsByUsername(user.getUsername())) {
            throw new EntityExistsException(String.format("User with name: '%s' already exists.", user.getUsername()));
        }
        return userRepository.saveAndFlush(user);
    }

    @Override
    public Optional<User> getUserById(long id) {
        return userRepository.findById(id);
    }

}


package com.leverx.onboarding.streams.model;

import lombok.Getter;
import lombok.Setter;

import java.util.Arrays;
import java.util.List;
import java.util.Objects;

@Setter
@Getter
public class Person {

    private Long personId;
    private String name;
    private List<Skill> skills;

    public Person(Long personId, String name, Skill... skills) {
        this.personId = personId;
        this.name = name;
        this.skills = Arrays.asList(skills);
    }

    @Override
    public String toString() {
        return name;
    }

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

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


package com.example.pascalisnala.cleart.models;

import com.google.gson.annotations.SerializedName;

import java.util.List;

public class Attraction {

    @SerializedName("attrid")
    private int attrid;

    @SerializedName("attrname")
    private String attrname;

    @SerializedName("location")
    private String location;

    @SerializedName("details")
    private String details;

    @SerializedName("schedule")
    private String schedule;

    public Attraction(int attrid, String attrname, String location, String details, String schedule) {
        this.attrid = attrid;
        this.attrname = attrname;
        this.location = location;
        this.details = details;
        this.schedule = schedule;
    }

    public int getAttrid() {
        return attrid;
    }

    public String getAttrname() {
        return attrname;
    }

    public String getLocation() {
        return location;
    }

    public String getDetails() {
        return details;
    }

    public String getSchedule() {
        return schedule;
    }

}


package com.haliri.israj.javaspringboothazelcast.service;

import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.core.IMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class HazelcastSerivce {

    private String keyMap = "visitor";

    @Autowired
    private HazelcastInstance hazelcastInstance;

    public void save(String key, String value){
        Map<String, String> hazelcastMap = hazelcastInstance.getMap(keyMap);

        hazelcastMap.put(key, value);
    }

    public void delete(String key){
        Map<String, String> hazelcastMap = hazelcastInstance.getMap(keyMap);

        ((IMap<String, String>) hazelcastMap).delete(key);
    }

    public Map<Object, Object> get(){
        return hazelcastInstance.getMap(keyMap);
    }

    public String get(String key){
        Map<String, String> hazelcastMap = hazelcastInstance.getMap(keyMap);

        return hazelcastMap.get(key);
    }
}


package com.abhijind.userservice.controller;

import com.abhijind.userservice.entity.User;
import com.abhijind.userservice.service.UserService;
import com.abhijind.userservice.valueobjects.ResponseTemplateVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
@RequestMapping("/users")
public class UserController {

    private final UserService userService;

    public UserController(UserService userService) {
        this.userService = userService;
    }
    @GetMapping("/{id}")
    public ResponseEntity<ResponseTemplateVO> getById(@PathVariable("id") Long id) {
        log.info("User Controller: get user with dept.");
        return ResponseEntity.ok().body(userService.getByIdWithDept(id));
    }

    @PostMapping("/")
    public ResponseEntity<?> save(@RequestBody User user) {
        log.info("User Controller: save user");
        return ResponseEntity.ok().body(userService.save(user));
    }

}


package planner;

/**
 * Port - each port has an id, ports' ids must be unique inside the components
 * they belong to
 */
public abstract class Port extends AppElement {
	protected String cId; // id of the component it is in
	protected String vmId; // id of the VM the component is in

	/**
	 * @param pId
	 * @param cId
	 * @param vMId
	 */
	public Port(String vMId, String cId, String pId) {
		super(pId);
		this.id = pId;
		this.cId = cId;
		this.vmId = vMId;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Port other = (Port) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}

}


package controller;

import java.util.Scanner;

import dto.*;
import service.Service;

public class MainController {

   public static void main(String[] args) {
      Service service = new Service();
      Scanner scan = new Scanner(System.in);
      int menu=0;

      while(true){
         service.title();
         menu = Integer.parseInt(scan.nextLine());
         if(menu==0) {
            System.out.println(" 종료합니다");
            break;
         }
         switch(menu) {
         case 1: //데이터등록
            service.inputData();
            break;
         case 2: //데이터출력

            service.showData();
            break;
         case 3: //데이터검색
            service.selectData();
            break;
         case 4: //데이터삭제
            service.deleteData();
            break;
         default:
            System.out.println("잘못입력하셨습니다.");
            break;
         }//스위치끝
      }//루프끝
   }//메인끝

}//클래스끝


package org.tenpo.test.mstenpotest.security.user;

import lombok.AccessLevel;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Component;

import java.util.Set;

@RequiredArgsConstructor(onConstructor_ = @Autowired)
@Component
public class UserMapper {

    @Getter(AccessLevel.PRIVATE)
    private final PasswordEncoder passwordEncoder;

    public User toUser(UserRequest userRequest) {
        User user =  new User();
        user.setEmail(userRequest.getUserName());
        user.setPassword(passwordEncoder.encode(userRequest.getPassword()));
        user.setFirstName(userRequest.getFirstName());
        user.setLastName(userRequest.getLastName());
        Role role = new Role();
        role.setName(userRequest.getRole());
        user.setRoles(Set.of(role));
        user.setLogged(false);
        return user;
    }
}


package assignment6.dlist;

/**
 *
 * @author henry
 */
public class DNode<E>
{
    private DNode<E> next;
    private DNode<E> previous;
    private E element;

    public DNode()
    {
        this(null, null, null);
    }

    public DNode(E element)
    {
        this(element, null, null);
    }

    public DNode(E element, DNode<E> previous, DNode<E> next)
    {
        this.element = element;
        this.next = next;
        this.previous = previous;
    }

    public DNode<E> getNext()
    {
        return next;
    }

    public DNode<E> getPrevious()
    {
        return previous;
    }

    public E getElement()
    {
        return element;
    }

    public void setNext(DNode<E> newNext)
    {
        next = newNext;
    }

    public void setPrevious(DNode<E> newPrevious)
    {
        previous = newPrevious;
    }

    public void setElement(E newElement)
    {
        element = newElement;
    }

    @Override
    public String toString()
    {
        return "(Node:" + element.toString() + ")";
    }
}


package cn.ztuo.bitrade.constant;

import com.fasterxml.jackson.annotation.JsonValue;
import cn.ztuo.bitrade.core.BaseEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;

/**
 * @author GuoShuai
 * @date 2018年03月08日
 */
@AllArgsConstructor
@Getter
public enum ActivityRewardType implements BaseEnum {
    /**
     * 注册奖励
     */
    REGISTER("注册奖励"),
    /**
     * 交易奖励
     */
    TRANSACTION("交易奖励"),
    /**
    /**
     * 充值奖励
     */
    RECHARGE("充值奖励");
    @Setter
    private String cnName;

    @Override
    @JsonValue
    public int getOrdinal() {
        return ordinal();
    }

    public static ActivityRewardType valueOfOrdinal(int ordinal){
        if(ordinal==0){
            return ActivityRewardType.REGISTER;
        }else if(ordinal == 1){
            return ActivityRewardType.TRANSACTION;
        }else if(ordinal ==2){
            return ActivityRewardType.RECHARGE;
        }else {
            return null;
        }
    }
}


package cn.linkmore.order.controller.staff.response;

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

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

@ApiModel("车场列表")
public class ResPreList implements Serializable {

	/**
	 *
	 */
	private static final long serialVersionUID = 1L;
	@ApiModelProperty("车区id")
	private Long preId;
	@ApiModelProperty("车区名称")
	private String preName;
	@ApiModelProperty("车区类型")
	private ResPreListType listType = new ResPreListType();
	public Long getPreId() {
		return preId;
	}
	public void setPreId(Long preId) {
		this.preId = preId;
	}
	public String getPreName() {
		return preName;
	}
	public void setPreName(String preName) {
		this.preName = preName;
	}
	public ResPreListType getListType() {
		return listType;
	}
	public void setListType(ResPreListType listType) {
		this.listType = listType;
	}

}


package com.example.android.newsapp;

public class Article {

    private String title;
    private String author;
    private String section;
    private String pubDate;
    private String url;
    private String image;

    public Article(String articleTitle, String articleAuthor,
                   String articleSection, String articlePublishDate,
                   String articleUrl, String imageUrl) {
        super();
        title = articleTitle;
        author = articleAuthor;
        section = articleSection;
        pubDate = articlePublishDate;
        url = articleUrl;
        image = imageUrl;
    }

    public String getTitle() {
        return title;
    }

    public String getAuthor() {
        return author;
    }

    public String getSection() {
        return section;
    }

    public String getPubDate() {
        return pubDate;
    }

    public String getUrl() {
        return url;
    }

    public String getImage() {
        return image;
    }

}


package com.lftechnology.batch7crud.db;

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

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.sql.DataSource;

import com.lftechnology.batch7crud.controller.UserController;

public class DbConnector {

  private static final Logger LOGGER = Logger.getLogger(UserController.class.getName());

  private DbConnector() {

  }

  public static Connection getMySqlConnection() throws SQLException {
    Connection connection = null;
    try {
      Context initCtx = new InitialContext();

      Context envCtx = (Context) initCtx.lookup("java:comp/env");

      DataSource ds = (DataSource) envCtx.lookup("jdbc/dbInitial");
      connection = ds.getConnection();
    } catch (NamingException e) {
      LOGGER.log(Level.SEVERE, e.getMessage(), e);
    }

    return connection;
  }
}


public class BankDepositExample3 implements Runnable {

    BankAccount3 account;
    public BankDepositExample3(BankAccount3 b) {
        account = b;
    }

    public void run() {
        int nb;
        try {
            for (int i = 0; i < 100; i++) {
                System.out.println("Transferring from checking to savings");
                account.checkingAccountLock.lock();
                account.checkingBalance= account.checkingBalance - 100;
                account.savingsAccountLock.lock();
                account.savingsBalance = account.savingsBalance + 100;
                System.out.println("Deposit thread: balance is " + account.savingsBalance);
                account.savingsAccountLock.unlock();
                account.checkingAccountLock.unlock();
                Thread.sleep(1000);
            }
        } catch(InterruptedException e) {
            System.out.println("Deposit interrupted.");
        } finally {
            account.checkingAccountLock.unlock();
            account.savingsAccountLock.unlock();
        }

    }
}


package com.tecsol.batua.user.data.model.User;

import com.google.gson.annotations.SerializedName;

import org.parceler.Parcel;

/**
 * @author Arnold Laishram.
 */
@Parcel
public class PaymentMode {

    @SerializedName("id")
    private Integer id;

    @SerializedName("paymentMode")
    private String paymentMode;

    @SerializedName("walletType")
    private String walletType;

    /**
     *
     * @return
     * The id
     */
    public Integer getId() {
        return id;
    }

    /**
     *
     * @param id
     * The id
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     *
     * @return
     * The paymentMode
     */
    public String getPaymentMode() {
        return paymentMode;
    }

    /**
     *
     * @param paymentMode
     * The paymentMode
     */
    public void setPaymentMode(String paymentMode) {
        this.paymentMode = paymentMode;
    }

    /**
     *
     * @return
     * The walletType
     */
    public String getWalletType() {
        return walletType;
    }

    /**
     *
     * @param walletType
     * The walletType
     */
    public void setWalletType(String walletType) {
        this.walletType = walletType;
    }

}


package com.seecen.exam.day0808;

/**
 * 狗实体类
 *
 * @scjs170602
 * @author 【万磊】
 * @2017年8月8日
 */
public class Dog extends Pet {
	private String type;// 类型

	public Dog() {
		super();
	}

	public Dog(String name, int healthy, int lover) {
		super(name, healthy, lover);
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	/**
	 * 狗玩飞盘的方法(自己的方法)
	 */
	public void catchFlyDisc() {
		this.setHealthy(this.getHealthy() - 10);
		this.setLover(this.getLover() + 5);
		System.out.println(getName() + "玩飞盘游戏!");
	}

	/**
	 * 狗自白方法(复写父类的抽象方法)
	 */
	@Override
	public void show() {
		System.out.println("我的名字叫:\"" + this.getName() + "\",我的健康值是:"
				+ this.getHealthy() + ",我和我主人的亲密程度是:" + this.getLover()
				+ ",我的类型是:" + this.getType());
	}

	/**
	 * 狗去医院方法(复写父类的抽象方法)
	 */
	@Override
	public void toHospital() {
		this.setHealthy(this.getHealthy() + 10);
		System.out.println(getName() + "打针,吃药!");
	}

	/**
	 * 狗吃饭方法(复写父类的抽象方法)
	 */
	@Override
	public void eat() {
		System.out.println(getName() + "爱好吃排骨!");
	}
}


# nycitibike
A data visualization of Citibike usage around New York City.

This tool provides a visualization of the average, maximum, and minimum number of Citibikes available over a 24 hour period for each half hour of the day. You can sort the chart by NYC, Brooklyn or Manhattan, any zip code, or a specific station. The table below each chart will also show the specific data associated with a chart.

## Repo Installation Instructions

To run the application, clone the repo locally and make sure you have node/npm, bower, and gulp installed.

Instructions to install node / npm - https://nodejs.org/

To install bower, run npm install -g bower

To install gulp, run npm install -g gulp

Once you have these installed, from the home directory of the repository, run the following in this order:

1) npm install - This will install the node_modules dependencies for the application.

2) bower install - This will install the client side dependencies (Angular and jQuery).

3) gulp - This will start up a local server and redirect you to the application in your browser.


package de.codecentric.reedelk.rabbitmq.internal.commons;

import de.codecentric.reedelk.runtime.api.commons.FormattedMessage;

public class Messages {

    private Messages() {
    }

    public enum RabbitMQProducer implements FormattedMessage {

        CREATE_CHANNEL_ERROR("The channel could not be created, cause=[%s]."),
        PUBLISH_MESSAGE_ERROR("The message could not be published to the queue (Queue name=[%s])."),
        QUEUE_EMPTY_ERROR("The queue name must not be empty (DynamicValue=[%s]).");

        private final String message;

        RabbitMQProducer(String message) {
            this.message = message;
        }

        @Override
        public String template() {
            return message;
        }
    }

    public enum RabbitMQConsumer implements FormattedMessage {

        CONSUME_ERROR("An error occurred while consuming message from queue=[%s], cause=[%s].");

        private final String message;

        RabbitMQConsumer(String message) {
            this.message = message;
        }

        @Override
        public String template() {
            return message;
        }
    }
}


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.codekul.firsthibernate.domain;

import javax.persistence.Column;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;

/**
 *
 * @author Deepak Mandal
 */
@Entity
@DiscriminatorValue("tiger")
public class Tiger extends Animal{

    @Column(name = "stripe_count",unique = false, nullable = true)
    private Integer strpeCount;

    @Column(name = "from_india",unique = false, nullable = true, columnDefinition = "boolean default true")
    private Boolean fromInda = false;

    public Integer getStrpeCount() {
        return strpeCount;
    }

    public void setStrpeCount(Integer strpeCount) {
        this.strpeCount = strpeCount;
    }

    public Boolean getFromInda() {
        return fromInda;
    }

    public void setFromInda(Boolean fromInda) {
        this.fromInda = fromInda;
    }

    @Override
    public String toString() {
        return "Tiger{" + "strpeCount=" + strpeCount + ", fromInda=" + fromInda + '}';
    }
}


package com.baizhi.listener;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.baizhi.dao.BannerDao;
import com.baizhi.entity.Banner;
import com.baizhi.util.ApplicationContextUtils;
import org.springframework.context.annotation.Configuration;

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

@Configuration
public class BannerListener extends AnalysisEventListener<Banner> {
    private  List list = new ArrayList();

    // 每行数据读取完成后会调用invoke方法
    @Override
    public void invoke(Banner banner, AnalysisContext context) {
        banner.setId(UUID.randomUUID().toString().replace("-", ""));
        list.add(banner);
    }
    // 全部读取后执行 doAfterAllAnalysed 方法
    @Override
    public void doAfterAllAnalysed(AnalysisContext context) {
        //标准用法
        BannerDao bannerDao= (BannerDao) ApplicationContextUtils.getBean("bannerDao");
        bannerDao.insertList(list);

    }
}


package com.redditsearcher.web.controller;

import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.verify;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.springframework.ui.ModelMap;

import com.redditsearcher.biz.manager.SearchManager;

@RunWith(MockitoJUnitRunner.class)
public class HomeControllerTest {
    private HomeController controller;
    @Mock
    private ModelMap model;
    @Mock
    private SearchManager searchManager;

    @Before
    public void before() {
        this.controller = new HomeController();
        this.controller.searchManager = searchManager;
    }

    @Test
    public void home() {

        // when
        String actualView = controller.home();

        // then
        assertEquals("home", actualView);
    }

    @Test
    public void homeWithParameter() {

        // when
        String actualView = controller.home(model, "test");

        // then
        assertEquals("home", actualView);
        verify(searchManager).search("test");
    }
}


package by.st.h2_test.dao.connection_pool;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.Properties;

public final class H2_PropertyManager {

	private final String PATH = "db.properties";
	private final String PREFIX = this.getClass().getResource("/").getPath();

	private Properties properties = new Properties();
	private BufferedReader bufferedReader = null;

	private static class Holder {
		private static final H2_PropertyManager INSTANCE = new H2_PropertyManager();
	}

	public static H2_PropertyManager getInstance() {
		return Holder.INSTANCE;
	}

	private H2_PropertyManager() {
		try {
			bufferedReader = new BufferedReader(new FileReader(PREFIX+PATH));
			properties.load(bufferedReader);
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public String getValue(String key) {
		return properties.getProperty(key);
	}

}


package ca.jeonghoon.day4project3;

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

public class Test2Activity extends AppCompatActivity implements View.OnClickListener {

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

        initialize();
    }

    private void initialize() {
        findViewById(R.id.btnOk).setOnClickListener(this);
        findViewById(R.id.btnCancel).setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        Intent myIntent = new Intent();
        switch (v.getId()) {
            case R.id.btnOk:
                myIntent.putExtra("return_result_from_test2", "OK result");
                setResult(RESULT_OK, myIntent);
                break;
            case R.id.btnCancel:
                myIntent.putExtra("return_result_from_test2", "Cancel result");
                setResult(RESULT_CANCELED, myIntent);
                break;
        }
        finish();
    }
}


This Haskell script turns a [get_iplayer][gi] download history file into a podcast feed.

There are other tools that do the same or similar things, such as [Martin O'Hanlon's get_iplayer_genrss][martin],
but this one is mine and it's what I use.

These days, the BBC Sounds app exists and supports downloads,
but I'm still using this because it works and I guess I just really like my podcast app/breaking the law.

## Usage

First, edit the various configuration things at the top of `iplayer-podcast.hs`, and compile by running `cabal install`.
Then:

    ./iplayer-podcast > output.xml

It goes without saying that you'll need to download some things using get_iplayer for this to be useful.
I've added all sorts of things to [the PVR][pvr], and a line in my `crontab` runs `get_iplayer --pvr-run` periodically.

[gi]: http://squarepenguin.co.uk/
[martin]: https://github.com/martinohanlon/get_iplayer_genrss
[app]: http://www.bbc.co.uk/blogs/internet/entries/4eba16ca-f1e8-4744-a305-7a31b3804535
[pvr]: https://squarepenguin.co.uk/wiki/documentation/#pvr-usage


# FriendFinder - Psych!

The Friend Finder is a Psych themed application in which a user can answer survey questions to find the friend that the algorithm determines is most compatible. Upon determination of the most fit friend, a box containing the friends photo and name will be presented to the user. The user can also click links on the bottom of the page to view all friends currently in the database, or access the github repository containing the code for this application.

![FriendFinderSurvey](Survey.png)
![FriendFinderModal](Modal.png)

The application was written using HTML, CSS, JavaScript, jQuery, express.js, node.js, and heroku.

To use the Friend Finder Application:

    1) Click on deployed heroku link provided below to access application
    2) Click on the Survey button to begin the survey
    3) Simply fill out the survey and you receive a popup containing a friend that
        the algorithm has determined is most compatible for you
    4) You will also have your information added so other friends can find you!

Deployed Heroku link: [Deployed Heroku](https://evening-inlet-95607.herokuapp.com/)
Link to the github repo: [GitHub Repo](https://github.com/nguyenj0215/FriendFinder)


package HConstants;

/**
 * Created by SNOY on 2017/5/13.
 */
public interface HConstants {

    String url = "http://192.168.1.131:8080/timeLang/";
    String url_man = "http://192.168.1.188:8080/timeLang/";

    /**
     * Eventbus 常量
     */
    interface EVENT {
        int HOMEREFRESH = 0;
        int LOGINACTIVITY_CLOSE = 1;
    }

    interface URL {
        //验证码
        String VER = url + "existsUser";
        //注册
        String Register = url + "saveUser";
        //登录
        String LOGIN = url + "userLogin";

        String Weather = url + "weather";

        String historyToday = url + "historyToday";

        String saveRemind = url_man + "saveRemind";

        String findFriendList = url + "findFriendList";

        String updateRegId = url + "updateRegId";

        String uploadFile = url + "uploadFile";

        String uploadPhoto = url + "uploadPicFile";

        String saveUser = url + "saveUser";

    }

    interface KEY {
        String UserId = "userId";
        String RegId = "regId";
        String QQnickName = "QQnickName";
        String QQfigureurl = "QQfigureurl";
        String QQgender = "QQgender";
        String QQcity = "QQcity";
        String QQopenid = "QQopenid";

    }
}


# Quasar App (todo)

To-Do APP made with Quasar (uses localStorage to store the data)

## Install the dependencies
```bash
npm install
```

### Start the app in development mode (hot-code reloading, error reporting, etc.) (web app)
```bash
quasar dev
```

### Start the app in development mode (hot-code reloading, error reporting, etc.) (desktop version)
```bash
quasar dev -m electron
```

### Start the app in development mode (hot-code reloading, error reporting, etc.) (Android version)
```bash
quasar dev -m cordova -T android
```

### Start the app in development mode (hot-code reloading, error reporting, etc.) (iOS version)
```bash
quasar dev -m cordova -T ios
```

### Build the app for production (web app)
```bash
quasar build
```

### Build the app for production (desktop / mac or windows)
```bash
quasar build -m electron
```

### Customize the configuration
See [Configuring quasar.conf.js](https://v1.quasar.dev/quasar-cli/quasar-conf-js).

### Source (tutorial)
https://www.youtube.com/watch?v=GV-D85D9KJQ


/*
 * Copyright 2020-2022 MicroEJ Corp. All rights reserved.
 * Use of this source code is governed by a BSD-style license that can be found with this software.
 */
package com.microej.example.mwt.immutablestylesheet.fontprovider;

import ej.annotation.Nullable;
import ej.microui.display.Font;

/**
 * Provides a specific font identified by its resource path.
 * <p>
 * The font will only be loaded on demand.
 */
public class ResourceFontProvider implements FontProvider {

	private final String path;

	/**
	 * Creates a resource font provider with the resource path of the font to provide.
	 *
	 * @param path
	 *            the resource path of the font to provide.
	 */
	public ResourceFontProvider(String path) {
		this.path = path;
	}

	@Override
	public Font getFont() {
		return Font.getFont(this.path);
	}

	@Override
	public boolean equals(@Nullable Object obj) {
		if (obj instanceof ResourceFontProvider) {
			ResourceFontProvider fontProvider = (ResourceFontProvider) obj;
			return this.path.equals(fontProvider.path);
		}
		return false;
	}

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


package internet.com.larkmusic.network;

import org.greenrobot.eventbus.EventBus;

import internet.com.larkmusic.action.ActionStopLoading;
import internet.com.larkmusic.bean.Song;
import okhttp3.Interceptor;
import okhttp3.OkHttpClient;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * Created by sjning
 * created on: 2019/1/9 下午3:01
 * description:
 */
public final class HttpUtil {

    private HttpUtil() {

    }

    public static StreamService getApiService(String host, Interceptor interceptor) {
        Retrofit.Builder builder = new Retrofit.Builder();
        builder.baseUrl(host);
        if (interceptor != null) {
            builder.client(new OkHttpClient.Builder().addInterceptor(interceptor).build());
        }
        builder.addConverterFactory(GsonConverterFactory.create());
        Retrofit client = builder.build();
        StreamService ss = client.create(StreamService.class);
        return ss;
    }

}


package com.treehole.framework.domain.member.result;

import com.treehole.framework.model.response.ResultCode;
import lombok.ToString;

/**
 * @Author: Qbl
 * Created by 19:25 on 2019/11/12.
 * Version: 1.0
 */
@ToString
public enum  AuthCode implements ResultCode {
    UNKNOWN_ERROR(false,-1,"未知错误"),
    AUTH_LOGIN_APPLYTOKEN_FAI(false,-1,"令牌为空！"),
    AUTH_LOGIN_TOKEN_SAVEFAI(false,-1,"用户令牌保存失败！"),
    AUTH_ACCOUNT_NOTEXISTS(false,-1,"用户不存在！"),
    AUTH_CREDENTIAL_ERROR(false,-1,"用户名或密码错误！"),
    AUTH_USERNAME_NONE(false,-1,"用户名为空！"),
    AUTH_PASSWORD_NONE(false,-1,"密码为空!")
            ;
    //操作代码
    boolean success;
    //操作代码
    int code;
    //提示信息
    String message;

    private AuthCode(boolean success, int code, String message) {
        this.success = success;
        this.code = code;
        this.message = message;
    }

    @Override
    public boolean success() {
        return success;
    }

    @Override
    public int code() {
        return code;
    }

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


package com.garbled.util.fragment;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.garbled.util.activity.BaseActivity;

/**
 * Created by Garbled on 2016/5/29.
 */
public abstract class BaseFragment extends Fragment {

    protected BaseActivity activity;
    //初始化视图
    protected abstract void initView(View view, Bundle saveInstanceState);
    //获取布局文件
    protected abstract int getLayoutId();

    protected BaseActivity getHoldingActivity(){
        return activity;
    }

    @Override
    public void onAttach(Context context) {
        super.onAttach(context);
        activity = (BaseActivity) context;
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(getLayoutId(),container,false);
        initView(view,savedInstanceState);
        return view;
    }
}


import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.JsonNode;
import com.mashape.unirest.http.Unirest;
import com.mashape.unirest.http.exceptions.UnirestException;
import org.json.JSONObject;

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

public class Main {

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

        //Change URL to match your service

        //HTTP GET request
        HttpResponse<JsonNode> getResponse = Unirest.get("http://httpbin.org/get").queryString("Limit",10).asJson();

        System.out.println(getResponse.getBody().getObject().getString("url"));
        System.out.println(getResponse.getBody().getObject().getJSONObject("headers").getString("Host"));

        //Post Request with Json
        JSONObject exampleJson = new JSONObject().put("name","Oskar");
        exampleJson.put("age",21);
        exampleJson.put("id",4);
        HttpResponse<String> postResponse = Unirest.post("http://httpbin.org/post").body(exampleJson).asString();

        System.out.println(postResponse.getBody());

    }

}


package cn.mdl.Servlet;

import cn.mdl.Pojo.User;
import cn.mdl.Service.ServiceImpl.UserServiceImpl;
import cn.mdl.Service.UserService;

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.util.List;

@WebServlet(urlPatterns = "/Loginend")
public class endServlet 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 {
        request.setCharacterEncoding("utf-8");
        response.setContentType("text/html;charset=utf-8");
        UserService userService=new UserServiceImpl();
        try {
            List<User> all = userService.findAll();
            request.setAttribute("omg",all);
            request.getRequestDispatcher("/index.jsp").forward(request,response);
        } catch (Exception e) {
            e.printStackTrace();
        }

    }
}


package com.yiqi.common.utils;

import java.io.Serializable;

/**
 * @author chan
 * @Description: 返回消息统一定义文件
 * @email chan150@163.com
 * @date 2018/12/2815:39
 */
public class CodeMsg implements Serializable {
    private static final long serialVersionUID = 1L;

    private int code;
    private String msg;

    // 按照模块定义CodeMsg
    /** 通用异常 **/
    public static CodeMsg SUCCESS = new CodeMsg(0,"成功");
    public static CodeMsg ERROR = new CodeMsg(1,"失败");
    public static CodeMsg SERVER_EXCEPTION = new CodeMsg(500,"未知异常，请联系管理员");
    public static CodeMsg PARAMETER_ISNULL = new CodeMsg(501,"参数为空");
    /** 业务异常 **/
    public static CodeMsg NOT_FIND_DATA = new CodeMsg(300,"查找不到对应数据");

    private CodeMsg(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}


package homework.week4.data_base.models;

/**
 * Created by Котято on 06.10.2016.
 */
public abstract class Person  {
    private String firstName;
    private String lastName;
    private String mail;

    public Person(String firstName, String lastName, String mail) {
        this.firstName = firstName;
        this.lastName = lastName;
        this.mail = mail;
    }

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public String getMail() {
        return mail;
    }

    public void setMail(String mail) {
        this.mail = mail;
    }

    @Override
    public String toString() {
        return "firstName= " + firstName +
                ", lastName= " + lastName  +
                ", mail= " + mail;
    }
}


## [2.1.0] - 2017-06-01
### Added
- Container class for services and parameters
- Application core class
- Tests PSR-4 autoload
- Tests shortcut command
- Services and parameters configuration files
- Module main class with specific configuration file
- Unit of work pattern
- Entity Manager
- Routing component
- Templating component
- Daemon server to handle the game in real-time
- Event and listeners for system and sector seizing
- Realtime action scheduler
- Cyclic action scheduler
- Process manager
- Task manager
- Load balancer for processes

### Changed
- Many managers are now free of the session pattern
- Sector and system seizing program

### Removed
- Support of HHVM
- Support of PHP 5.5

## [2.0.0] - 2016-11-01
### Added
* Composer project file
* PHPUnit configuration file
* PSR-4 Autoload
* Travis CI configuration file
* Scrutinizer CI configuration file
* Editor configuration file
* NPM and Gulp configuratoin file

### Changed
* Classes are loaded by namespaces instead of manual loading
* Scripts keys dots replaced by underscores

### Removed
* Manual include of the modules
* Modules location constants


package com.griffin.spring.oracle;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.jdbc.core.JdbcTemplate;

@SpringBootApplication
public class DemoApplication implements CommandLineRunner{

	private static final Logger log = LoggerFactory.getLogger(DemoApplication.class);

	@Autowired
	JdbcTemplate jdbcTemplate;

	public static void main(String[] args) {
		SpringApplication.run(DemoApplication.class, args);
	}

	@Override
	public void run(String... args) throws Exception {
		log.info("checking db connection...");

		jdbcTemplate.update("create table if not exists person(id INT NOT NULL AUTO_INCREMENT,firstname VARCHAR(255) NOT NULL,lastname VARCHAR(255) NOT NULL,PRIMARY KEY ( id ));");

		log.info("created db");
	}
}


package com.bluecasedevelopment.bluetoothreconnect;

import android.bluetooth.BluetoothDevice;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;

public class MediaPlaybackReceiver extends BroadcastReceiver {

	@Override
	public void onReceive(Context context, Intent intent) {
		if (!intent.hasExtra(BluetoothDevice.EXTRA_DEVICE))
			return;

		BluetoothDevice device = (BluetoothDevice) intent.getExtras().get(
				BluetoothDevice.EXTRA_DEVICE);
		if (device == null)
			return;

		String targetId = getId(context, intent);

		if (targetId != null && device.getAddress().equals(targetId)) {
			Intent i = new Intent(context, MediaPlaybackService.class);
			context.startService(i);
		}
	}

	private static String getId(Context context, Intent intent) {
		SharedPreferences p = PreferenceManager
				.getDefaultSharedPreferences(context);
		return p.getString(
				context.getString(R.string.preference_key_device_id), null);
	}
}


package com.study.gmall.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.study.core.bean.PageVo;
import com.study.core.bean.Query;
import com.study.core.bean.QueryCondition;
import com.study.gmall.dao.CommentReplayDao;
import com.study.gmall.pms.entity.CommentReplayEntity;
import com.study.gmall.service.CommentReplayService;
import org.springframework.stereotype.Service;

@Service("commentReplayService")
public class CommentReplayServiceImpl extends ServiceImpl<CommentReplayDao, CommentReplayEntity> implements CommentReplayService {

    @Override
    public PageVo queryPage(QueryCondition params) {
        IPage<CommentReplayEntity> page = this.page(
                new Query<CommentReplayEntity>().getPage(params),
                new QueryWrapper<CommentReplayEntity>()
        );

        return new PageVo(page);
    }

}


package com.lh.booktrading.mybatis.mapper;

import com.lh.booktrading.BooktradingApplicationTests;
import com.lh.booktrading.mybatis.pojo.Category;
import org.junit.Assert;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;

import static org.junit.jupiter.api.Assertions.*;

class CategoryMapperTest extends BooktradingApplicationTests {
    @Autowired
    private CategoryMapper categoryMapper;
    @Test
    void addCategory() {
        int add = categoryMapper.addCategory(new Category((long) 3, "文化"));
        Assert.assertEquals(1,add);
    }

    @Test
    void deleteCategoryById() {
        int del = categoryMapper.deleteCategoryById((long) 3);
        Assert.assertEquals(1,del);
    }

    @Test
    void updateCategory() {
        int update =categoryMapper.updateCategory(new Category((long)2,"文化"));
        Assert.assertEquals(1,update);
    }

    @Test
    void get() {
        Category category = categoryMapper.get((long)1);
        Assert.assertNotNull(category);
    }
}


package org.online.shopping;

import java.sql.SQLException;

import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.online.shopping.pagination.PaginationFilter;
import org.online.shopping.repository.DatabaseFactory;

public abstract class BaseTest {

	private TestDatabaseUtil testDatabaseUtil = new TestDatabaseUtil();

	@BeforeClass
	public static void initDatabase() {
		DatabaseFactory.initiateDatabase(new TestDatabase());
	}

	@Before
	public void createTable() throws SQLException {
		testDatabaseUtil.dropTables();
		testDatabaseUtil.createUserTable();
		testDatabaseUtil.createProductTable();
		testDatabaseUtil.createUserCartTable();
		testDatabaseUtil.createOrderTable();
		testDatabaseUtil.createSellerProductTable();
		testDatabaseUtil.createNotifyProductTable();
		testDatabaseUtil.createRecentlyAddedProductTable();
	}

	@Before
	public void destroyPagination() {
		PaginationFilter.pagination = null;
	}

	@After
	public void destroy() throws SQLException {
		testDatabaseUtil.closeConnection();
	}

}


package com.codeup.mockprep.Controllers;

import com.codeup.mockprep.Models.User;
import com.codeup.mockprep.Repo.UserRepo;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class IndexController {

    private final UserRepo userDao;

    public IndexController(UserRepo userDao){
        this.userDao = userDao;
    }

    @GetMapping("/")
    public String homeRedirect(){
        return "redirect:/home";
    }

    @GetMapping("/home")
    public String home(){
        if ( SecurityContextHolder.getContext().getAuthentication().getPrincipal() == "anonymousUser") {
            return "anonymousUser/anonymous_index";
        }else{

            User loggedInUser = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
            User userInDB = userDao.findByUsername(loggedInUser.getUsername());

            if (userInDB.isAdmin()) {
                return "admin/admin_index";
            }
        }
        return "user/user_index";
    }

}