package br.com.dwbidiretor.converter;

import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.FacesConverter;

import br.com.dwbidiretor.classe.SigeModulo;

@FacesConverter(forClass = SigeModulo.class,value="conversorSigeModulo")
public class SigeModuloConverter implements Converter {
    @Override
    public Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String value) {
        if (value != null && !value.isEmpty()) {
            return (SigeModulo) uiComponent.getAttributes().get(value);
        }
        return null;
    }

    @Override
    public String getAsString(FacesContext facesContext, UIComponent uiComponent, Object value) {
        if (value instanceof SigeModulo) {
        	SigeModulo entity= (SigeModulo) value;
            if (entity != null && entity instanceof SigeModulo && entity.getIdmodulo() != null) {
                uiComponent.getAttributes().put( entity.getIdmodulo().toString(), entity);
                return entity.getIdmodulo().toString();
            }
        }
        return "";
    }
}


package com.hashlearning.utils.validators;

import com.jfoenix.controls.JFXPasswordField;
import com.jfoenix.controls.JFXTextField;
import com.jfoenix.validation.base.ValidatorBase;
import javafx.scene.control.TextInputControl;

/**
 * Created by Omar on 09-Dec-16
 */
public class PasswordConfirmationMismatchValidator extends ValidatorBase {

    private JFXPasswordField passwordField;

    public PasswordConfirmationMismatchValidator(JFXPasswordField passwordField) {
        this.passwordField = passwordField;
    }

    @Override
    protected void eval() {
        if (srcControl.get() instanceof TextInputControl)
            evalTextInputField();
    }

    private void evalTextInputField() {
        TextInputControl passwordConfirmationTextField = (TextInputControl) srcControl.get();
        if (passwordConfirmationTextField.getText() == null || passwordConfirmationTextField.getText().equals("")
                || !passwordConfirmationTextField.getText().equals(passwordField.getText())) {
            hasErrors.set(true);
        }
        else hasErrors.set(false);
    }

}


package com.atguigu.controller;

import com.atguigu.pojo.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

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

@RestController
@RequestMapping("/user")
public class UserController {
    @RequestMapping("/findAll")
    public List<User> getAll(){
        List<User> users = new ArrayList<User>();

        User user1 = new User();
        user1.setUsername("杨过");
        user1.setPassword("123456");
        user1.setAge(18);
        user1.setSex("男");

        User user2 = new User();
        user2.setUsername("杨过");
        user2.setPassword("123456");
        user2.setAge(18);
        user2.setSex("男");

        User user3 = new User();
        user3.setUsername("杨过");
        user3.setPassword("123456");
        user3.setAge(18);
        user3.setSex("男");

        users.add(user1);
        users.add(user2);
        users.add(user3);

        return users ;

    }
}


# oxfordcity.github.io
This is the GitHub Pages site used to supply the front-end for the Oxfordshire Data Portal at www.oxopendata.uk

The main portal uses the Socrata platform, but as this does not enable 'pages' to be created, this site sits in the front to enable additional information to be provided and more easily updated independently of Socrata. Clicking on the 'data' tab takes the visitor to the Socrata portal at www2.oxopendata.uk.

The site uses Jekyll to provide a main layout (_layouts/default.html) that can be called by all content pages rather than replicate all the layout code

The styling of this site mirrors that of the Socrata portal so that there is a near-seamless transition for visitors. The main portal css files (base.css, current_site.css) are referenced along with a custom.css file for adding any site-specific styling for non-Socrata content.

# More information
* information on GitHub Pages is available at https://pages.github.com/
* Information on using Markdown is available at https://daringfireball.net/projects/markdown/
* Information on Jekyll is available at http://jekyllrb.com


package pd.cars.cars.model;

import org.hibernate.annotations.OnDelete;
import org.hibernate.annotations.OnDeleteAction;

import javax.persistence.*;
import java.time.LocalDateTime;

@Entity
@Table(name = "rent")
public class Rent {

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

    @OneToOne
    @JoinColumn(name = "fk_car", nullable=false)
    @OnDelete(action = OnDeleteAction.CASCADE)
    private Car car;

    @ManyToOne
    @JoinColumn(name="fk_user", nullable=false)
    @OnDelete(action = OnDeleteAction.CASCADE)
    private User user;

    @Column(name = "rent_ts")
    private LocalDateTime rentTime;

    public long getId() {
        return id;
    }

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

    public Car getCar() {
        return car;
    }

    public void setCar(Car car) {
        this.car = car;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public LocalDateTime getRentTime() {
        return rentTime;
    }

    public void setRentTime(LocalDateTime rentTime) {
        this.rentTime = rentTime;
    }
}


package com.econo.hackday.contentsproxyblog.model;

import lombok.AccessLevel;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.util.List;

@Entity
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class Post {

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

	@Column(nullable = false)
	private String title;

	@Column(nullable = false)
	private String url;

	@OneToMany(cascade = CascadeType.ALL, mappedBy = "post")
	public List<HashtagVariable> hashtagVariables;

	@ManyToOne
	private Account writer;

	private Long viewCount;

	@Builder
	public Post(String title, String url, Account writer) {
		this.title = title;
		this.url = url;
		this.writer = writer;
		this.viewCount = 0l;
	}

	public void increaseViewCount() {
		this.viewCount++;
	}

	public boolean hasTag(String tagName) {
		for (HashtagVariable hashtagVariable : hashtagVariables) {
			if (hashtagVariable.getHashtag().getName().equals(tagName)) {
				return true;
			}
		}
		return false;
	}
}


package com.stormpath.examples.service;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.stormpath.examples.model.AccountsResponse;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.GetMethod;
import org.springframework.stereotype.Service;

import java.io.BufferedReader;
import java.io.InputStreamReader;

@Service
public class CommunicationService {
    public AccountsResponse doRemoteRequest(String url, String token) throws Exception {
        // make request of other micro-service
        GetMethod method = new GetMethod(url + "?token=" + token);
        HttpClient httpClient = new HttpClient();
        int returnCode = httpClient.executeMethod(method);

        BufferedReader br = new BufferedReader(
            new InputStreamReader(method.getResponseBodyAsStream())
        );
        StringBuffer buffer = new StringBuffer();
        String line;
        while(((line = br.readLine()) != null)) {
            buffer.append(line);
        }

        ObjectMapper mapper = new ObjectMapper();
        return mapper.readValue(buffer.toString(), AccountsResponse.class);
    }
}


package com.zhangaochong.spring.starter.openapi.handler;

import com.zhangaochong.spring.starter.openapi.properties.UserProperties;

import javax.annotation.Resource;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * 默认权限处理器实现
 *
 * @author AochongZhang
 */
public class DefaultAuthHandler extends AbstractAuthHandler {
    /** 存储调用方随机数，生产中可放入Redis，并设置过期时间 */
    private static final Map<String, String> NONCEMAP = new ConcurrentHashMap<>();

    /** 用户唯一key及密钥，生产中可放入数据库和Redis */
    @Resource
    private UserProperties userConfig;

    @Override
    public String getUserSecretKey(String accessKey) {
        Map<String, String> secretKeyMap = userConfig.getSecretKeyMap();
        if (secretKeyMap == null) {
            throw new IllegalArgumentException("未配置用户密钥");
        }
        return secretKeyMap.get(accessKey);
    }

    @Override
    public boolean saveUserNonce(String accessKey, String nonce) {
        NONCEMAP.put(accessKey, nonce);
        return true;
    }

    @Override
    public String getUserLastNonce(String accessKey) {
        return NONCEMAP.get(accessKey);
    }
}


package com.cgcg.base.language;

import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.MessageSource;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.stereotype.Component;

import java.util.Locale;

@Slf4j
@Component
public class Translator {

    private static MessageSource messageSource;

    public Translator(@Autowired MessageSource messageSource) {
        Translator.messageSource = messageSource;
    }

    public static String toLocale(String msg) {
        if (StringUtils.isBlank(msg)) {
            return null;
        }
        final Locale locale = LocaleContextHolder.getLocale();
        try {
            return messageSource.getMessage(msg, null, locale);
        } catch (Exception e) {
            return null;
        }
    }

    public static String toLocale(String code, String defaultMsg) {
        final String result = Translator.toLocale(code);
        return result != null && (defaultMsg == null || !result.equals(code)) ? result : defaultMsg;
    }

}


package com.idgi.android.activity;

import android.content.Intent;

import com.google.common.eventbus.Subscribe;
import com.idgi.R;
import com.idgi.android.ActivityType;
import com.idgi.core.Nameable;
import com.idgi.core.School;
import com.idgi.event.BusEvent;
import com.idgi.event.Event;
import com.idgi.service.FireDatabase;
import com.idgi.session.SessionData;
import java.util.List;

/*
Lists all the database's schools
 */
public class SchoolListActivity extends NameableListActivity{

	@Override
	protected String getTitleName() {
		return getResources().getString(R.string.list_school_title);
	}

	@Override
	protected List<? extends Nameable> getNameables() {
		return FireDatabase.getInstance().getSchools();
	}

	@Subscribe
	public void onSchoolSelected(BusEvent busEvent) {
		if(busEvent.getEvent() == Event.SCHOOL_SELECTED){
			School school = (School) busEvent.getData();
			SessionData.setCurrentSchool(school);

			startActivity(new Intent(this, SubjectListActivity.class));
		}
	}
}


package com.mb.nzbair.providers.converters;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.Reader;

import org.codehaus.jackson.JsonFactory;
import org.codehaus.jackson.JsonParser;
import org.codehaus.jackson.map.ObjectMapper;

import com.mb.nzbair.providers.domain.UsenetPostResult;
import com.mb.nzbair.remote.response.RestResponse;

public class UsenetPostResultConverter extends BaseConverter<UsenetPostResult> {

	private ObjectMapper objectMapper = null;
	private JsonFactory jsonFactory = null;
	private JsonParser jp = null;

	public UsenetPostResultConverter() {
		objectMapper = new ObjectMapper();
		jsonFactory = new JsonFactory();
	}

	@Override
	public UsenetPostResult convert(RestResponse rr) throws Exception {

		this.throwErrorIf(rr);
		final Reader r = new InputStreamReader(rr.getStream());
		final BufferedReader reader = new BufferedReader(r);
		jp = jsonFactory.createJsonParser(reader);
		final UsenetPostResult upr = objectMapper.readValue(jp, UsenetPostResult.class);

		return upr;
	}

}


package cn.com.java.thread.synch;

public class DeadLock {

    private static final Object lockA = new Object();
    private static final Object lockB = new Object();

    public static void main(String[] args) {
        new Thread(()->{a();},"main-1").start();
        try {
            Thread.sleep(50);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        new Thread(()->{b();},"main-2").start();
    }

    private static void a(){
        synchronized (lockA){
            System.out.println(Thread.currentThread().getName()+"运行a()");
            try {
                Thread.sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println(Thread.currentThread().getName()+"等待运行b()");
            b();
        }
    }

    private static void b(){
        synchronized (lockB){
            System.out.println(Thread.currentThread().getName()+"运行b()");
            System.out.println(Thread.currentThread().getName()+"等待运行a()");
            a();
        }
    }
}


package steps;

import common.UserInfo;
import net.thucydides.core.annotations.Step;
import net.thucydides.core.steps.ScenarioSteps;
import pages.LoginLogoutPage;

public class LoginLogoutPageSteps extends ScenarioSteps {

    LoginLogoutPage sp;

    @Step("Test 1: Login button functionality ")
    public void loginOptionFunctionality() {
        sp.loginOption();
    }

    @Step("Test 2 : Test the presence of elements")
    public void loginElements()  {
        sp.loginElements();
    }

    @Step("Test 3 :  Test the close button with blank fields")
    public void closeButtonFunctionality() {
        sp.closeButtonFunctionality();
    }

    @Step("Test 4 : Test the successful login")
    public void successfulLogin(String user, String pass) {
        sp.successfulLogin(user,pass);
    }

    @Step("Test 5 : Test the functionality of logout button")
    public void logoutUser() {
        sp.logoutUser();
    }

    @Step("Test 6 : Log in with invalid credentials")
    public void invalidCredentials ()  {
        sp.invalidCredentials();
    }
}


package com.spaceinvaders.controller.states.playstate.playstatecontrollers;

import com.spaceinvaders.model.arena.Arena;
import com.spaceinvaders.model.enemy.Enemy;
import com.spaceinvaders.model.pools.ShotPool;
import com.spaceinvaders.model.shots.Shot;

public class EnemiesShotsGenerator {
    private Arena arena;
    private ShotPool shotPool;
    private int whenToShoot;
    private Enemy enemyToShoot;

    public EnemiesShotsGenerator(Arena arena, ShotPool shotPool) {
        this.arena = arena;
        this.shotPool = shotPool;
    }

    public void generate() {
        Shot shot = shotPool.extract();
        enemyToShoot.recycleShot(shot);
        arena.addElement(shot);
    }

    public boolean enemyReadyToShoot() {
        return !arena.getEnemies().isEmpty() && enemyToShoot.getAttackBehavior().readyToShoot(whenToShoot);
    }

    public void setWhenToShoot(int whenToShoot) {
        this.whenToShoot = whenToShoot;
    }

    public void setEnemyIndex(int enemyIndex) {
        this.enemyToShoot = arena.getEnemies().get(enemyIndex);
    }
}


# Team Profile Generator

## Description
This project demonstrates the node.js inquirer method and testing. It asks the user to enter information about individual team member such as engineer or intern and it renders the information and displays it the information to cards.

## Table of Contents
* [Installation](#installation)
* [Usage](#usage)
* [License](#license)
* [Contributions](#contributions)
* [Tests](#tests)
* [Questions](#questions)

## Installation
User must have node.js installed and npm installed to run this application

## Usage
This application can be used to created individual member information and it will run using the Terminal
Video Demonstration: https://drive.google.com/file/d/1IjRhqszIVI5Xz1a_WNTdYyTz7Majiwy8/view
<img src="./Assets/Screen%20Shot%202020-09-28%20at%2011.43.14%20PM.png">

## License
MIT

## Contributions
Anyone can contribute to the application by just forking this repository

## Tests
Application was tested using NPM and was run in the Terminal

## Questions
Questions about this repository? Please contact me at [nodirbekmaksudov@gmail.com](mailto:nodirbekmaksudov@gmail.com). View more of my work in GitHub at [https://github.com/Nodirbek94](https://github.com/Nodirbek94)


package tests;

import io.github.bonigarcia.wdm.WebDriverManager;
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import utils.PageTitleUtils;

import static org.assertj.core.api.Assertions.*;

public class BaseTest {

    protected static final String BASE_URL = "http://automationpractice.com/index.php";
    protected WebDriver driver;

    @BeforeAll
    public static void setupClass() {
        WebDriverManager.chromedriver().setup();
    }

//    @BeforeEach
//    public void setupTest() {
//        driver = new ChromeDriver();
//        driver.get(BASE_URL);
//        assertThat(driver.getTitle()).isEqualTo(PageTitleUtils.HOME_PAGE_TITLE);
//    }

    @AfterEach
    public void tearDown() {
        if (driver != null) {
            driver.quit();
        }
    }
}


package com.chen.pei.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.chen.pei.entity.Blogger;
import com.chen.pei.mapper.BloggerMapper;
import com.chen.pei.mapper.LoginMapper;
import com.chen.pei.service.LoginService;
import org.springframework.stereotype.Service;

@Service
public class LoginServiceImpl extends ServiceImpl<LoginMapper, Blogger> implements LoginService {

    @Override
    public Blogger findLogin(String nickName, String password) {
        QueryWrapper<Blogger> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("nick_name",nickName);
        queryWrapper.eq("password",password);
        Blogger blogger = baseMapper.selectOne(queryWrapper);
        return blogger;
    }

    @Override
    public Blogger findLoginByName(String username) {
        QueryWrapper<Blogger> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("nick_name",username);
        Blogger blogger = baseMapper.selectOne(queryWrapper);
        return blogger;
    }
}


package me.aaron.survivalsystem.listeners.trade;

import org.bukkit.GameMode;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerGameModeChangeEvent;

import me.aaron.survivalsystem.main.Main;
import me.aaron.survivalsystem.trade.Trade;
import me.aaron.survivalsystem.trade.TradeMain;
import me.aaron.survivalsystem.trade.TradeUtils;

public class listenerGameModeChange implements Listener {

	@EventHandler
	public void onPlayerGameModeChange(final PlayerGameModeChangeEvent e) {
		final Player p = e.getPlayer();
		if (e.getNewGameMode() == GameMode.CREATIVE && !Main.getInstance().getConfig().getBoolean("TradeInCreative")) {
			Trade tr = null;
			if (TradeUtils.getTradeFromAccepter(p) != null)
				tr = TradeUtils.getTradeFromAccepter(p);
			if (TradeUtils.getTradeFromRequester(p) != null)
				tr = TradeUtils.getTradeFromRequester(p);
			if (tr != null) {
				tr.cancelTrade(true);
				tr.getAccepter().sendMessage(TradeMain.getMessage("trade-cancelled-creative-reason"));
				tr.getRequester().sendMessage(TradeMain.getMessage("trade-cancelled-creative-reason"));
			}
		}
	}
}


package com.weeg.callbackHandler.CallbackHandlerImpl;

import com.weeg.callbackHandler.CallbackFactory;
import com.weeg.callbackHandler.CallBackHandler;
import com.weeg.util.DataFomat;
import net.sf.json.JSONObject;
import org.springframework.stereotype.Component;

/**
 * Created by SJ on 2020/8/13
 */
@Component
public class Upload200ACallBackHandler extends CallBackHandler {

    @Override
    public JSONObject upload200aHandler(JSONObject object, String mid, String[] binaryData) {
        DataFomat dataFomat = new DataFomat();
        if (mid.equals("200a") || mid.equals("200A")) {
            String SIM = "";
            for (int i = 0; i < 20; i++) {
                SIM += binaryData[i];
            }
            String SIMascii = dataFomat.convertHexToString(SIM);
            object.put("SIM卡信息", SIMascii);
        }
        return object;
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        CallbackFactory.register("200a",this);
    }
}


package com.sun.power.modules.system.user.dto;

import com.sun.power.core.aop.mysql.MysqlQueryFieldHandle;
import com.sun.power.core.common.entity.BaseRequestVo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * @author : caoxin
 * @Date: 2019/4/18
 * @Description: 查询所有、模糊查询请求
 */
@Data
public class QueryUserVo extends BaseRequestVo {
    @MysqlQueryFieldHandle
    @ApiModelProperty(value = "登陆姓名",  required = false)
    private String userName;

    @ApiModelProperty(value = "单位id",  required = false)
    private String organizationId;

    @ApiModelProperty(value = "专/兼职",  required = false)
    private String fullPart;

    @MysqlQueryFieldHandle
    @ApiModelProperty(value="所属部门")
    private String department;

    @MysqlQueryFieldHandle
    @ApiModelProperty(value = "工作人员姓名",  required = false)
    private String realName;

    @ApiModelProperty(value = "当前页",  required = false, example = "1")
    private Integer currentPage;

    @ApiModelProperty(value = "页面大小",  required = false, example = "20")
    private Integer pageSize;

}


/*
 * 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 cast.testapp.invoice.boundary.impl;

import cast.testapp.invoice.boundary.InvoiceFileReader;
import java.io.File;

/**
 *
 * @author cbustamante
 */
public class InvoiceFileReaderImpl implements InvoiceFileReader {

    @Override
    public File readFile(String filePath) {
       try{
           File file = new File(filePath);
           if (!file.exists()){
               throw new IllegalArgumentException("Ruta invalidad el archivo");
           }
           return file;
       }
       catch(Exception ex){
           System.out.println("Ocurrio un error al leer el archivo");
       }

        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public Boolean validateLine(String line) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

}


package wm.list;

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

import wm.list.model.Animal;

import static android.R.attr.name;

public class AnimalDetailsActivity extends AppCompatActivity {

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

        ImageView animalImg = (ImageView) findViewById(R.id.animalImage);
        TextView nameTxt = (TextView) findViewById(R.id.animalTxt);

        Intent in = getIntent();
        int position = in.getIntExtra("position",0);

        AnimalData animalData = AnimalData.getInstance();
        Animal animal = animalData.animalList.get(position);

        nameTxt.setText(animal.detail);
        animalImg.setImageResource(animal.pic);

        getSupportActionBar().setTitle(animal.thaiName+" ("+animal.name+")");
    }
}


package com.atguigu.reflection;
import cn.hutool.core.util.ClassUtil;
import cn.hutool.crypto.SecureUtil;

import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

/**
 * @author:yaoshuai.1024
 * @date: 2021/1/25 4:58 下午
 */
public class reflection_test1 {
    private static Map<String, Class<?>> rpcMethodMap = new HashMap<>();

    public static void main(String[] args) throws Exception {
        Set<Class<?>> classes = ClassUtil.scanPackageBySuper("com.atguigu.reflection", Base.class);
        for (Class<?> aclass:classes) {
            Method[] publicMethods = ClassUtil.getPublicMethods(aclass);
            Arrays.stream(publicMethods).forEach(e->rpcMethodMap.put(e.getName(),aclass));
        }
        System.out.println(rpcMethodMap);
        ClassUtil.invoke(rpcMethodMap.get("emmitt2").getName(),"emmitt2",true);

        String eeee = SecureUtil.md5("eeee");
        System.out.println(eeee);

    }
}


package com.appspot.plucial.controller.account;

import java.util.ArrayList;

import org.slim3.controller.Navigation;

import com.appspot.plucial.model.ActivityModel;
import com.appspot.plucial.model.UserModel;
import com.appspot.plucial.service.ActivityService;

public class ActivityDeleteController extends BaseController {

    @Override
    protected Navigation execute(UserModel loginUserModel) throws Exception {
        String activityId = asString("activity");

        ActivityModel activityModel = ActivityService.getActivity(activityId);

        ArrayList<ActivityModel> activityList = new ArrayList<ActivityModel>();
        if(activityModel != null) {
            activityList.add(activityModel);
        }

        requestScope("activityModel", activityModel);
        requestScope("activityList", activityList);

        return forward("/responsive/account/activity_delete.jsp");
    }

    @Override
    protected String setPageTitle() {
        return "アクティビティの削除";
    }

    @Override
    protected String setPageDescription() {
        return "アクティビティの削除";
    }
}


## Static Website Template

A template for creating static sites.

**Languages/Libraries:**

* [NodeJS][nodejs]
* [Metalsmith][metalsmith]
* [Bootstrap][bootstrap]
* [Knockout][knockout]
* [Coffeescript][coffeescript]
* [HAML][haml]
* [SASS][sass]

## Usage

## Setup

`cake setup`

## Build

Single: `cake build`
Watching: `bundle exec guard`
> Run `gem install bundler && bundle install` to setup Bundler/Guard

[nodejs]: https://nodejs.org
[metalsmith]: http://www.metalsmith.io/
[bootstrap]: http://getbootstrap.com/
[knockout]: http://knockoutjs.com/
[coffeescript]: http://coffeescript.org/
[haml]: http://haml.info/
[sass]: http://sass-lang.com/

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/RyanScottLewis/static_template-metalsmith-bootstrap-knockout.

This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.

## License

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


/**
 *
 */
package edu.illinois.ncsa.versus.service;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import freemarker.template.Configuration;
import freemarker.template.DefaultObjectWrapper;

/**
 * Setup FreeMarker for templating.
 *
 * @author Luigi Marini
 *
 */
public class FreeMarkerServletConfig implements ServletContextListener {

	@Override
	public void contextDestroyed(ServletContextEvent event) {
		ServletContext context = event.getServletContext();
		context.removeAttribute(Configuration.class.getName());
	}

	@Override
	public void contextInitialized(ServletContextEvent event) {
		Configuration cfg = new Configuration();
		cfg.setServletContextForTemplateLoading(event.getServletContext(),
				"WEB-INF/templates");
		cfg.setObjectWrapper(new DefaultObjectWrapper());
		ServletContext context = event.getServletContext();
		context.setAttribute(Configuration.class.getName(), cfg);
	}

}


/3D5 Software Design/2-ToDo List/app/src/main/java/com/example/android/todolistgh/Connectivity.java

package com.example.android.todolistgh;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.widget.Toast;

/**
 * Created by ed on 27/11/15.
 */
public class Connectivity {

    Context context;

    public Connectivity(Context context){
        this.context = context;
    }

    public void sendToEmail(String memo) {

        if (memo.isEmpty()) {
            Toast.makeText(context, "Empty Memo", Toast.LENGTH_SHORT).show();
            return;
        }
        else {
            Intent sendEmailSummary = new Intent(Intent.ACTION_SENDTO);

            sendEmailSummary.setData(Uri.parse("mailto:")); // only email apps should handle this
            sendEmailSummary.putExtra(Intent.EXTRA_SUBJECT, ("MEMO- To-Do List App"));
            sendEmailSummary.putExtra(Intent.EXTRA_TEXT, memo);
            if (sendEmailSummary.resolveActivity(context.getPackageManager()) != null) {
                context.startActivity(sendEmailSummary);
            }
        }
    }
}


package edu.calbaptist.android.dontopenthedoorgame.database;

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

import edu.calbaptist.android.dontopenthedoorgame.database.DoorGameDbSchema.PlayerTable;

/**
 * Created by lynnreilly on 11/8/17.
 */

public class DoorGameBaseHelper extends SQLiteOpenHelper {
    private static final int VERSION = 1;
    private static final String DATABASE_NAME = "dotd.db";

    public DoorGameBaseHelper(Context context) {
        super(context,DATABASE_NAME, null, VERSION);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL("create table " + PlayerTable.NAME + "( " + " _id integer primary key autoincrement, " +
                PlayerTable.Cols.UUID + ", " +
                PlayerTable.Cols.PLAYER + ", " +
                PlayerTable.Cols.SCORE + ")"
        );
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }

}


package sample;

import javax.swing.JFrame;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class DelegationTest extends JFrame implements ActionListener {

	private static final long serialVersionUID = 1L;

	JButton bt1;
	JButton bt2;
	JLabel label;

	public DelegationTest() {
		setBounds(200, 200, 200, 100);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		label = new JLabel("クリックしてください",JLabel.CENTER);
		add("North",label);
		bt1 = new JButton("ボタン１");
		bt2 = new JButton("ボタン２");
		bt1.addActionListener(this);
		bt2.addActionListener(this);
		JPanel p = new JPanel();
		p.add(bt1);
		p.add(bt2);
		add("Center",p);
		setVisible(true);
	}

	public static void main(String[] args) {
		new DelegationTest();
	}

	public void actionPerformed(ActionEvent e) {
		if (e.getSource() == bt1)
			label.setText("ボタン１");
		else if(e.getSource() == bt2)
			label.setText("ボタン２");
	}
}


package com.fsw.chat_ui.widget.chatrow;

import android.content.Context;

import com.fsw.chat_ui.ChatMessage;
import com.fsw.chat_ui.R;
import com.fsw.chat_ui.adapter.viewholder.ChatFileViewHolder;
import com.fsw.chat_ui.entity.Message;

/**
 * Created by Admin on 2017/4/8.
 */

public class ChatRowFile extends ChatRow {

    private ChatFileViewHolder viewHolder;

    public ChatRowFile(Context context, Message message) {
        super(context, message);
    }

    @Override
    protected void onInflateView() {
        inflater.inflate(message.getDirect() == ChatMessage.Direct.RECEIVE ? R.layout.chat_row_file_receive : R.layout.chat_row_file_send, this);
    }

    @Override
    protected void onViewFindById() {
        if (viewHolder == null) {
            viewHolder = new ChatFileViewHolder();
            this.setTag(viewHolder);
        } else {
            viewHolder = (ChatFileViewHolder) this.getTag();
        }
    }

    @Override
    protected void onSetUpView() {

    }

    @Override
    protected void onSetClickListener() {

    }
}


package dynamic;

import java.util.Scanner;

/* the link to the problem is :http://poj.org/problem?id=1505
 *
problem 1505...

the problem is not yet done.
 */

public class ScribersSolution {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);

		int inputCount = 0;
		inputCount = scanner.nextInt();
		for (int i = 0; i < inputCount; i++) {
			int m = 0, k = 0; // m denote the numbers of books, while the k means how many scribers
			m = scanner.nextInt();
			k = scanner.nextInt();

			int[] books = new int[m];
			int[] acc_pages = new int[m];

			for (int j = 0; j < m; j++) {
				books[j] = scanner.nextInt();
				acc_pages[j] = j > 0 ? acc_pages[j - 1] : 0 + books[j];
			}

			int[] scribers = new int[k];
			int[] scriber_books = new int[k];
			for (int j = 0; j < k; j++) {
				scriber_books[j] = j+1; // that means scriber 0 scribes book [0..1), scriber 1 scribes books [1,2)....
				scribers[j] = books[i];
			}

			for (int j = 0; j < m; j++) {

			}
		}
	}
}


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

import java.util.ArrayList;

/**
 *
 * @author Stephan
 */
public class Round {

    private final ArrayList<Match> matches; // list of matches in this round
    private Boolean played; // true if round is finished

    public Round() {
        this.matches = new ArrayList();
        this.played = false; // set default false
    }

    // add new match to a round
    public void addMatch(Match m) {
        this.matches.add(m);
    }

    // returns list of matches in this round
    public ArrayList<Match> getMatches() {
        return this.matches;
    }

    // sets round as played
    public void isPlayed() {
        this.played = true;
    }

    // returns status of the round (true if finished, false if not)
    public Boolean getPlayed() {
        return this.played;
    }
}


package com.basiqnation.basiqpve;

import java.sql.SQLException;

import org.bukkit.entity.*;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageByEntityEvent;

public class PlayerListener implements Listener {
	public static BasiqPVE plugin;

	public PlayerListener(BasiqPVE instance) {
		plugin = instance;
	}

	@EventHandler(priority = EventPriority.NORMAL)
	public void onEntityDamaged(final EntityDamageByEntityEvent event)
			throws SQLException {
		if ((event.getDamager() instanceof Player)
				&& (event.getEntity() instanceof Player)) {

			Player damager = (Player) event.getDamager();
			Player damagee = (Player) event.getEntity();
			if (damager.hasPermission("basiqpve.pve")
					|| damagee.hasPermission("basiqpve.pve")) {
				event.setCancelled(true);

			}
			if(damager.hasPermission("basiqpve.pve")){
				damager.sendMessage("You cannot damage other players");
			}
			if(damagee.hasPermission("basiqpve.pve")){
				damager.sendMessage("You cannot damage PVE players");
			}
		}

	}
}


package work.model.dto;

/**
 * 사진
 * ID : 시퀀스 + 프라이머리
 * 파일명 : 200자
 * @author cse
 *
 */
public class Image {

 private int imageId;

 private String fileName;

 /**
  * Image 기본 생성자
  */
 public Image() {
  super();
 }

 /**
  * Image 필수 / 모든 데이터 생성자
  * @param imageId
  * @param fileName
  */
 public Image(int imageId, String fileName) {
  super();
  this.imageId = imageId;
  this.fileName = fileName;
 }

 /**
  * 시퀀스 생성자
  * @param fileName
  */

 public Image(String fileName) {
  super();
  this.fileName = fileName;
 }

 /**
  * @return the imageId
  */
 public int getImageId() {
  return imageId;
 }

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

 /**
  * @return the fileName
  */
 public String getFileName() {
  return fileName;
 }

 /**
  * @param fileName the fileName to set
  */
 public void setFileName(String fileName) {
  this.fileName = fileName;
 }

 /* (non-Javadoc)
  * @see java.lang.Object#toString()
  */
 @Override
 public String toString() {
  StringBuilder builder = new StringBuilder();
  builder.append(imageId);
  builder.append(", ");
  builder.append(fileName);
  return builder.toString();
 }
}


/*
 * 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.csys.parametrageachat.domain;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Entity;
import javax.persistence.ManyToMany;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import com.csys.parametrageachat.domain.ArticlePH;

/**
 *
 * @author Farouk
 */
@Entity
@Table(name = "specialite")
@NamedQueries({
    @NamedQuery(name = "Specialite.findAll", query = "SELECT s FROM Specialite s")})
public class Specialite extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;
    @ManyToMany(mappedBy = "specialiteCollection")
    private Collection<ArticlePH> articleCollection;

    public Collection<ArticlePH> getArticleCollection() {
        return articleCollection;
    }

    public void setArticleCollection(Collection<ArticlePH> articleCollection) {
        this.articleCollection = articleCollection;
    }

}


package se.kth.payment;

import org.junit.jupiter.api.Test;

import java.io.File;

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

class PaymentParserServiceTest {
    PaymentParserService paymentParserService = new PaymentParserService();

    @Test
    void readPaymentFileBetalningsservice() {
        String filePathBetalningsservice = this.getClass().getClassLoader().getResource("Exempelfil_betalningsservice.txt").getFile();
        File paymentFile = new File(filePathBetalningsservice);
        boolean b = paymentParserService.readPaymentFile(paymentFile);
        assertTrue(b);

    }

    @Test
    void readPaymentFileInbetalningstjansten() {
        String filePathInbetalningstjansten = this.getClass().getClassLoader().getResource("Exempelfil_inbetalningstjansten.txt").getFile();
        File paymentFile = new File(filePathInbetalningstjansten);
        boolean b = paymentParserService.readPaymentFile(paymentFile);
        assertTrue(b);
    }
}


/*
 * Copyright 2016 Atlas, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * You may not use this file except in compliance with the License.
 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for
 * the specific language governing permissions and limitations under the License.
 *
 * Module: atlas
 * File: App.java
 * Class: App
 * Qualified: com.atlas.api.App
 *
 * Author: vinas
 * Date: 10/16/16 1:36 PM
 * Modified: 10/16/16 1:35 PM
 */

package com.atlas.api;

import com.atlas.servers.GrizzlyServer;
import org.irenical.lifecycle.builder.CompositeLifeCycle;

public class App {
  public static void main(String[] args) {
    CompositeLifeCycle cycle = new CompositeLifeCycle();
    cycle.append(new GrizzlyServer());
    cycle.start();
  }
}


package com.example.demo.controller;

import com.example.demo.mapper.AdministratorMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpSession;
import java.util.Map;

@Controller
public class LoginController {

    @Autowired
    AdministratorMapper administratorMapper;

//    @DeleteMapping
//    @PutMapping
//    @GetMapping

    //@RequestMapping(value = "/admin/login",method = RequestMethod.POST)
    @PostMapping("/admin/login")
    public String login(@RequestParam("username") String username,
                        @RequestParam("password") String password,
                        Map<String, Object> map, HttpSession session){
        if(administratorMapper.getUserByUserName(username).getPassWord().equals(password)){
            //登陆成功，防止表单重复提交，可以重定向到主页
            session.setAttribute("loginUser", username);
            return "redirect:/main.html";
        }else{
            //登陆失败
            map.put("msg","用户名密码错误");
            return  "login";
        }

    }
}


import java.util.LinkedList;

public class QueueHospital<PatientType> extends Hospital<PatientType>
{

    private LinkedList<PatientType> waitList;

    // constructor to initialize waitList
    public QueueHospital()
    {
        waitList = new LinkedList<PatientType>();

    }

    @Override
    public void addPatient(PatientType patient)
    {
        waitList.add(patient);
    }

    @Override
    public PatientType nextPatient()
    {
        return waitList.peek();
    }

    @Override
    public PatientType treatNextPatient()
    {
        return waitList.poll();
    }

    @Override
    public int numPatients()
    {
        return waitList.size();
    }

    @Override
    public String hospitalType()
    {
        return "QueueHospital";
    }

    @Override
    public String allPatientInfo()
    {
        String result = "";
        for (int i = 0; i < waitList.size(); ++i)
        {
            result += waitList.get(i);
        }
        return result;
    }

}


/**
 * @(#)MailService.java, 9月 06, 2021.
 * <p>
 * Copyright 2021 fenbi.com. All rights reserved.
 * FENBI.COM PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package mingyu.data;

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

import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;

/**
 * @author yangmingyu
 */
@Component
public class MailService {

    @Autowired
    private User user;

    private ZoneId zoneId = ZoneId.systemDefault();

    public void setZoneId(ZoneId zoneId) {
        this.zoneId = zoneId;
    }

    public String getTime() {
        return ZonedDateTime.now(this.zoneId).format(DateTimeFormatter.ISO_ZONED_DATE_TIME);
    }

    public void sendLoginMail() {
        System.err.println(String.format("Hi, %s! You are logged in at %s", user.getName(), getTime()));
    }

    public void sendRegistrationMail() {
        System.err.println(String.format("Welcome, %s!", user.getName()));

    }
}


package controller.servlet.Filter;

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

@WebFilter(urlPatterns = {"/listUser.jsp", "/Read", "/Update.jsp", "/Update"})
public class RoleServlet implements Filter {

    @Override
    public void init(FilterConfig filterConfig) throws ServletException {

    }

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        HttpServletRequest request = (HttpServletRequest) servletRequest;
        HttpServletResponse response = (HttpServletResponse) servletResponse;
        HttpSession session = request.getSession();

        if (session.getAttribute("role") == "admin") {
            filterChain.doFilter(request, response);
        }
        else {
            response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
        }
    }

    @Override
    public void destroy() {

    }
}


package net.minestom.server.command.builder.arguments.minecraft;

import net.kyori.adventure.text.format.NamedTextColor;
import net.kyori.adventure.text.format.TextColor;
import net.minestom.server.command.builder.arguments.Argument;
import net.minestom.server.command.builder.exception.ArgumentSyntaxException;
import org.jetbrains.annotations.NotNull;

/**
 * Represents an argument which will give you a {@link TextColor}.
 * <p>
 * Example: red, white, reset
 */
public class ArgumentColor extends Argument<TextColor> {

    public static final int UNDEFINED_COLOR = -2;

    public ArgumentColor(String id) {
        super(id);
    }

    @NotNull
    @Override
    public TextColor parse(@NotNull String input) throws ArgumentSyntaxException {
        final TextColor color = NamedTextColor.NAMES.value(input);
        if (color == null)
            throw new ArgumentSyntaxException("Undefined color", input, UNDEFINED_COLOR);

        return color;
    }

}


package aug.manas.splitter.web;

import static org.springframework.web.bind.annotation.RequestMethod.*;

import org.apache.log4j.Logger;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class HomeController {
	private static final Logger logger = Logger.getLogger(HomeController.class);

	@RequestMapping(value = "/", method = GET)
	public ModelAndView goToDashboard() {
		logger.debug("Entered in the goToDashboard method");
		Authentication auth = SecurityContextHolder.getContext().getAuthentication();
		String name = auth.getName(); // get logged in username
		logger.debug("Logged in user is :: "+ auth.getName());
		ModelAndView modelAndView = new ModelAndView("home","loggedInUser",name);
		return modelAndView;
	}
}


package de.laboranowitsch.priceimporter.testutil;

import de.laboranowitsch.priceimporter.domain.FactData;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;

import javax.sql.DataSource;
import java.util.List;

/**
 * Reads {@link de.laboranowitsch.priceimporter.domain.FactData} for test purpose.
 *
 * @author christian@laboranowitsch.de
 */
public class FactDataRecordHelper {

    /**
     * Reads all entries of {@link FactData}
     *
     * @param dataSource
     * @return List of FactData
     */
    public static  List<FactData> getFactData(DataSource dataSource) {
        NamedParameterJdbcTemplate jdbcTemplate = new NamedParameterJdbcTemplate(dataSource);
        return jdbcTemplate.query("select * from int_test_f_energy_price_demand", ((rs, rowNum) -> FactData.builder().id(rs.getLong(1))
                .totalDemand(rs.getDouble(2))
                .rpr(rs.getDouble(3))
                .regionId(rs.getLong(4))
                .periodId(rs.getLong(5))
                .dateTimeId(rs.getLong(6))
                .build()));
    }
}


package org.nico.cat.server.processer.response.chains.segment;

import java.util.Base64;
import java.util.Date;

import org.nico.cat.config.ConfigKey;
import org.nico.cat.server.container.Container;
import org.nico.cat.server.processer.response.chains.AbstractResponseProcess;
import org.nico.cat.server.request.Request;
import org.nico.cat.server.response.Response;

/**
 * Process uri filter
 * @author nico
 * @date 2018年1月11日
 */
public class ProcessSession extends AbstractResponseProcess{

	@Override
	public Response process(Request request, Response response) throws Exception {

		if(container != null){
			if(request.getSession() != null){
				if(! request.getSession().isEmpty()){
					if(! request.getCookieMap().containsKey(ConfigKey.SESSIONID)){
						String sessionToken = new String(Base64.getEncoder().encode(String.valueOf(new Date().getTime()).getBytes()));
						container.putSession(sessionToken, request.getSession());
						response.getHeaders().add("Set-Cookie", ConfigKey.SESSIONID + "=" + sessionToken + ";path=/");
					}
				}
			}else{

			}
		}
		return next(request, response);
	}

}


package com.khairy.core.data.db.entities;

import android.widget.ImageView;

import androidx.annotation.NonNull;
import androidx.databinding.BindingAdapter;
import androidx.room.Entity;
import androidx.room.PrimaryKey;

import com.bumptech.glide.Glide;
import com.khairy.core.R;

import java.io.File;

@Entity(tableName = "weatherPhoto")
public class WeatherPhotoEntity {
    String name;
    @PrimaryKey
    @NonNull
    String photoPath;

    public WeatherPhotoEntity(String name, @NonNull String photoPath) {
        this.name = name;
        this.photoPath = photoPath;
    }

    public String getName() {
        return name;
    }

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

    public String getPhotoPath() {
        return photoPath;
    }

    public void setPhotoPath(String photoPath) {
        this.photoPath = photoPath;
    }

    @BindingAdapter("displayPhoto")
    public static void loadImage(ImageView view, String imageUrl) {
        Glide.with(view).
                load(new File(imageUrl)).
                error(R.drawable.placeholder).
                into(view);
    }
}


package model.data;

import abstracts.Data;
import com.sun.org.apache.xerces.internal.impl.dv.util.Base64;
import java.io.Serializable;
import org.json.JSONObject;

/**
 *
 * @author Patrick
 */
public class Picture extends Data implements Serializable {

    private String name;
    private byte[] byteArray;

    public Picture(int id, String name, byte[] byteArray, int updateNumber) {
        super(id, updateNumber);
        this.name = name;
        this.byteArray = byteArray;
    }

    public String getName() {
        return name;
    }

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

    public byte[] getByteArray() {
        return byteArray;
    }

    public void setByteArray(byte[] byteArray) {
        this.byteArray = byteArray;
    }

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

    @Override
    public JSONObject toJSONObject() {
        JSONObject obj = new JSONObject();
        obj.put("id", getId());
        obj.put("name", name);
        String base64String = Base64.encode(byteArray);
        obj.put("picturestring", base64String);
        obj.put("updatenumber", getUpdateNumber());
        return obj;
    }

}


/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package shopper.data;
import java.sql.*;

/**
 *
 * @author HP_Owner
 */
public class ArtTypeDB {

    public static int selectArtType(String arttype) {
  ConnectionPool pool = ConnectionPool.getInstance();
  Connection connection = pool.getConnection();
  PreparedStatement ps = null;
  ResultSet rs = null;
  int arttype_ID=0;

  String sql = "SELECT ArtType_ID FROM ArtType WHERE ArtTypeName= ?";
  try {
   ps=   connection.prepareStatement(sql);

   ps.setString(1,arttype);
   rs= ps.executeQuery();
   if(rs.next()) {
     arttype_ID= rs.getInt("ArtType_ID");

      return arttype_ID;
  }
   else {
       return 0;
  }
  }

  catch(SQLException e) {
      e.printStackTrace();
      return 0;

  }

  finally {
      pool.freeConnection(connection);
      DBUtil.closePreparedStatement(ps);
      DBUtil.closeResultSet(rs);}
  }

}


package com.example.administrator.day0620_chabaike;

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

import com.example.administrator.day0620_chabaike.Constant.ConstantKey;
import com.example.administrator.day0620_chabaike.Utils.Pref_Utils;

public class LoadingActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_loading);
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                Intent intent = new Intent();
                intent.setClass(LoadingActivity.this,WelcomeActivity.class);
                if(!getFirstOpenFlag()){
                    intent.setClass(LoadingActivity.this,HomeActivity.class);
                }
                startActivity(intent);
                finish();
            }
        },3000);
    }

    private boolean getFirstOpenFlag() {
        return Pref_Utils.getBoolean(this, ConstantKey.PRE_KEY_FIRST_OPEN,true);
    }
}


package com.IS.SINU.controllers;

import com.IS.SINU.entities.dao.Group;
import com.IS.SINU.entities.dao.User;
import com.IS.SINU.entities.dto.Request;
import com.IS.SINU.services.GroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/group")
public class GroupController {

    @Autowired
    private GroupService service;

    @RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
    public ResponseEntity<Group> getGroup() {
        Group group = service.getGroup();
        return ResponseEntity.ok(group);
    }

    @RequestMapping(value = "/{id}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
    public ResponseEntity<Group> getGroup(@PathVariable Long id) {
        Group group = service.getGroupById(id);
        return ResponseEntity.ok(group);
    }
}


package com.colorcloud.movementsensor;

import android.os.Handler;
import android.os.RemoteException;

import com.colorcloud.movementsensor.IMovementSensor;

/**
 *

 * CLASS:
 *  implements service API handler Interface. For now, service stub is empty.
 *  This is reserved here for future usage. The Intent filter to bind to this service will be defined later.
 *
 * RESPONSIBILITIES:
 *  Expose Location manager service binder APIs so other components can bind to us.
 *
 * COLABORATORS:
 *
 * USAGE:
 * 	See each method.
 *
 *

 */

public class MovementSensorApiHandler extends IMovementSensor.Stub {

    @SuppressWarnings("unused")
    private MovementSensorManager mManager;

    public MovementSensorApiHandler(MovementSensorManager manager) {
        mManager = manager;    // dependency injection, reserved for future extension.
    }

    public int registerListener(int movement_interval, String intentActionString)
    throws RemoteException {
        return 0;
    }

    public int unregisterListener(int hdl) throws RemoteException {
        return 0;
    }

}


package com.sfg.inventoryfailover.controller;

import com.sfg.inventoryfailover.model.BeerInventoryDto;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

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

@RestController
@Slf4j
public class InventoryFailoverController {

    @GetMapping("/inventory-failover")
    public List<BeerInventoryDto> getInventoryDtoList(){
        BeerInventoryDto beerInventoryDto = BeerInventoryDto.builder()
                .id(UUID.randomUUID())
                .beerId(UUID.fromString("00000000-0000-0000-0000-000000000000"))
                .quantityOnHand(999)
                .createdDate(OffsetDateTime.now())
                .lastModifiedDate(OffsetDateTime.now())
                .upc("72527273070")
                .build();
        List<BeerInventoryDto> beerInventoryDtoList = new ArrayList<BeerInventoryDto>();
        beerInventoryDtoList.add(beerInventoryDto);

        return beerInventoryDtoList;
    }

}


package com.cqjtu.tools;

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

import org.mybatis.generator.api.MyBatisGenerator;
import org.mybatis.generator.config.Configuration;
import org.mybatis.generator.config.xml.ConfigurationParser;
import org.mybatis.generator.internal.DefaultShellCallback;

/**
 *
 *
ClassName:MybatisGenerator

 *
Description:逆向工程

 * @author ZJH
 * @date 2017年5月31日下午7:13:52
 */
public class MybatisGenerator {

	public static void main(String[] args) throws Exception {
		List<String> warnings = new ArrayList<String>();
		boolean overwrite = true;
		File configFile = new File(MybatisGenerator.class.getResource("/").getPath() + "mybatisGenerator.xml");
		System.out.println(configFile.toString());
		ConfigurationParser cp = new ConfigurationParser(warnings);
		Configuration config = cp.parseConfiguration(configFile);
		DefaultShellCallback callback = new DefaultShellCallback(overwrite);
		MyBatisGenerator myBatisGenerator = new MyBatisGenerator(config, callback, warnings);
		myBatisGenerator.generate(null);
		System.out.println("mybatis逆向工程完成");
	}

}


package ee.kool.kool.actorsAndMovies.actors.movies.service;

import ee.kool.kool.actorsAndMovies.actors.dto.Actor;
import ee.kool.kool.actorsAndMovies.actors.movies.dto.Film;
import org.springframework.stereotype.Service;

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

@Service
public class MovieService {

    public List<Film> mockMovies() {
        List<Film> films = new ArrayList<>();
        Film film1 = new Film();
        film1.setId(1);
        film1.setName("Star Wars");
        Actor actor1 = new Actor();
        actor1.setForeName("Matthew");
        actor1.setLastName("Mercer");
        actor1.setId(1);

        List<Actor> actors = new ArrayList<>();
        actors.add(actor1);
        film1.setActors(actors);
        films.add(film1);
        return films;
    }

    public Film mockOneMovie(Integer id) {
        Film film2 = new Film();
        film2.setId(id);
        film2.setName("Overwatch");
        return film2;
    }

    public Film mockTwoMovie(Integer id) {
        Film film3 = new Film();
        film3.setId(id);
        film3.setName("Bingo");
        film3.setRating(7);
        return film3;
    }
}


package com.tree.newversion;

/**
 * ues it after version 0.9
 *
 * http://kafka.apache.org/23/javadoc/index.html?org/apache/kafka/clients/producer/KafkaProducer.html
 */
import java.util.Properties;
import org.apache.kafka.clients.producer.KafkaProducer;
import org.apache.kafka.clients.producer.ProducerRecord;

public class ProducerDemo {

	public static void main(String[] args) {

		Properties properties = new Properties();
		properties.put("bootstrap.servers", "kafka01:9092,kafka02:9092");
		properties.put("acks", "all");
		properties.put("retries", 0);
		properties.put("batch.size", 16384);
		properties.put("linger.ms", 1);
		properties.put("buffer.memory", 33554432);
		properties.put("key.serializer", "org.apache.kafka.common.serialization.StringSerializer");
		properties.put("value.serializer", "org.apache.kafka.common.serialization.StringSerializer");
		KafkaProducer<String, String> kafkaProducer = new KafkaProducer<String, String>(properties);
		kafkaProducer.send(new ProducerRecord<>("topic", "value"));
		kafkaProducer.close();

	}

}


package madbuildparser.LogParser;

import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;

import static org.junit.Assert.fail;

import java.io.IOException;

public class MadBuildLogParserTest {

@Test
public void readSampleLogFile() throws IOException {

   	String inputDir=System.getProperty("user.dir")+"\\src\\test\\resources\\input";
    String outputDir=System.getProperty("user.dir")+"\\src\\test\\resources\\output";

    MadBuildLogParser madBuildLogParser=new MadBuildLogParser();
    madBuildLogParser.process(inputDir,outputDir);

    madBuildLogParser.showProcessedFiles();
    madBuildLogParser.showGeneratedFiles();
}

@Rule
public TemporaryFolder temporaryFolder = new TemporaryFolder();

@Test
public void checkIfOutputFolderExist() throws IOException {

	temporaryFolder.newFolder("output");

    fail("Output folder alredy exist");
}

@Test
public void checkIfInputFolderExist() throws IOException {

	temporaryFolder.newFolder("input");

    fail("Input folder alredy exist");
}

}


package com.mmall.common;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerExceptionResolver;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.view.json.MappingJacksonJsonView;

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

@Slf4j
@Component
public class ExceptionResolver  implements HandlerExceptionResolver {
    @Override
    public ModelAndView resolveException(HttpServletRequest request, HttpServletResponse response, Object handler, Exception e) {
        log.error("{} exception",request.getRequestURI(),e);
        MappingJacksonJsonView jsonView = new MappingJacksonJsonView();
        ModelAndView view = new ModelAndView(jsonView);
        //当时用jackson2.x 的时候,使用MappingJacksonJson2View
        view.addObject("status",ResponseCode.ERROR.getCode());
        view.addObject("msg","接口异常,请联系管理员");
        view.addObject("data",e.toString());
        return view;
    }
}


package objects;

import data.User;

import java.io.Serializable;

public class Request implements Serializable {
    private String command;
    private String commandArg;
    private Object obj;
    private User user;

    public Request(String command, String commandArg, Object obj, User user) {
        this.command = command;
        this.commandArg = commandArg;
        this.obj = obj;
        this.user = user;
    }

    public Request(String command, String commandArr, User user) {
        this(command, commandArr, null, user);
    }

    public Request(String command, User user) {
        this(command, "", null, user);
    }

    public String getCommandString() {
        return command;
    }

    public String getCommandArg() {return commandArg;}

    public Object getObject() {return obj;}

    public User getUser() {
        return user;
    }

    public boolean isEmpty() {
        return command.isEmpty();
    }

    @Override
    public String toString() {
        return "Request[" + command + "]\n" + "Argument: " + commandArg + "\nObject: " + obj;
    }
}


# Workout Tracker

[![License: WTFPL](https://img.shields.io/badge/License-WTFPL-brightgreen.svg)](http://www.wtfpl.net/about/)

![Workout Tracker](./public/assets/finalScreen.PNG)

### Description

Manage your workouts with this workout tracker.

### Table of Contents

- [Usage Guide](#Usage-Guide)
- [Install Instructions](#Installation)
- [Technologies Used](#Technologies-Used)
- [Contributions](#Contributions)
- [Tests](#Tests)
- [Questions](#Questions)

## Usage Guide

Deployed on [Heroku](https://intense-springs-06464.herokuapp.com/) This application allows you track your workouts, add to existing, create new ones and trend on the last 7 days of workouts.

Get started with the fitness tracker [here](https://intense-springs-06464.herokuapp.com/)

## Technologies Used

MongoDB, Node, mongoose, expresss

## Contributions

This is currently my own work. Please feel free to submit your contributions on GITHUB with credits given

## Tests

Future testing planned using Jest testing framework

## Questions

If you have any questions or want to keep up with my latest projects, please follow me on [Github](http://www.github.com/operationBrass) or contact me via [Email](mr.brn.lewis@outlook.com).


package com.switchvov.kafka.demo.producer;

import com.alibaba.fastjson.JSON;
import com.switchvov.kafka.demo.domain.Order;
import org.apache.kafka.clients.producer.KafkaProducer;
import org.apache.kafka.clients.producer.ProducerRecord;

import java.math.BigDecimal;
import java.util.Properties;

/**
 * @author switch
 * @since 2021/4/23
 */
public class KafkaProducerDemo {
    public static void main(String[] args) {
        Properties props = new Properties();
        props.setProperty("key.serializer", "org.apache.kafka.common.serialization.StringSerializer");
        props.setProperty("value.serializer", "org.apache.kafka.common.serialization.StringSerializer");
        props.setProperty("bootstrap.servers", "localhost:9092");

        KafkaProducer<String, String> producer = new KafkaProducer<String, String>(props);
        for (int i = 0; i < 10; i++) {
            Order order = new Order().setId(i).setAmount(BigDecimal.ONE).setType(1);
            ProducerRecord<String, String> record = new ProducerRecord<>("demo-source", JSON.toJSONString(order));
            producer.send(record);
        }
        producer.close();
    }
}


YourPosition
==================================

This application is an application to display your present position in the map by using location information API.
This application is made for the demonstration of [Locater](https://github.com/holyshared/Locater "Locater").

Author
----------------------------------
Noritaka Horio<holy.shared.design@gmail.com>

Licence
----------------------------------
[The MIT Licence ](http://www.opensource.org/licenses/mit-license.php "The MIT Licence ")

Build of source
----------------------------------

Please do the build by using [packager](https://github.com/kamicane/packager "packager").

### Mootools
packager build Core/Object Core/Browser Core/Class Core/Class.Extras

### Locater(All components)
packager build Locater/Locater.Application Locater/Locater.Handler.DebugHandler Locater/Locater.Handler.CurrentPositionHandler +use-only Locater

### Application
packager build YourPosition/* +use-only YourPosition


package com.utn.UDEE.models;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import javax.validation.constraints.NotNull;

@Entity (name = "addresses")
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Address {

    @Id
    @GeneratedValue(strategy= GenerationType.IDENTITY)
    @Column(name = "address_id",unique = true,nullable = false)
    private Integer id;

    @NotNull(message = "The street shouldn't be null")
    @Column(name = "street")
    private String street;

    @NotNull(message = "The street number shouldn't be null")
    @Column(name = "number")
    private Integer number;

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

    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "userId")
    private User user;

    @OneToOne
    @JoinColumn(name = "meterId")
    private Meter meter;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "id_rate")
    private Rate rate;

}


package com.gauravnadar.covid19stats.BroadcastReceiver;

import android.app.job.JobInfo;
import android.app.job.JobScheduler;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.util.Log;
import android.widget.Toast;

import com.gauravnadar.covid19stats.MainActivity;
import com.gauravnadar.covid19stats.Scheduler;
import com.gauravnadar.covid19stats.Util.Job;

import static android.content.Context.JOB_SCHEDULER_SERVICE;
import static android.content.Context.MODE_PRIVATE;

public class CustomBroadcastReceiver extends BroadcastReceiver {

    SharedPreferences prefs;
    SharedPreferences.Editor editor;

    @Override
    public void onReceive(Context context, Intent intent) {
        String intentAction = intent.getAction();

        Log.e("log", intent.getAction());

        if(intentAction != null)
        {
            Log.e("check", "inside");

          if(Intent.ACTION_MY_PACKAGE_REPLACED.equals(intentAction))
          {

              Job.scheduleJob(context);
              Log.e("Broadcast", "Working");
          }

        }

    }
}


package wenjian;

import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;

import java.io.File;
import java.io.IOException;
import java.net.SocketPermission;

/**
 * Created by hjh on 16-7-23.
 */
public class FileTest {
    public static void main(String[] args)throws IOException{
        File file = new File(".");
        System.out.println(file.getName());
        System.out.println(file.getParent());
        System.out.println(file.getAbsoluteFile());
        System.out.println(file.getAbsoluteFile().getParent());

        File tmpfile = File.createTempFile("aaa",".txt",file);
        tmpfile.deleteOnExit();

        File newfile = new File(System.currentTimeMillis()+"");
        System.out.println(newfile.exists());

        newfile.createNewFile();
        newfile.mkdir();

        String[] filelist = file.list();
        for(String filename : filelist){
            System.out.println(filename);
        }

        File[] roots = File.listRoots();
        for(File root:roots){
            System.out.println(root);
        }

    }
}


##Multi-User Blog
A simple blog with user signup
Here's the [link](https://monsey-therapists.appspot.com) to the website.

Instructions for running application:

1. Install [Cloud SDK](https://cloud.google.com/appengine/downloads#Google_App_Engine_SDK_for_Python)
(runs on Linux, Mac OS X and Windows, and requires Python 2.7.x)
2. Extract the file to any location on your file system.
3. Initialize gcloud on the command line from within the sdk directory:
```./google-cloud-sdk/bin/gcloud init```
4. Run the application with the "dev_appserver.py" command, specifying the paths of dev_appserver.py and the application:
For example,
```~/Documents/programming_software/google-cloud-sdk/bin/dev_appserver.py ./Documents/projects/google_applications/user-signup-154601```
5. When the command executes, it will give you the port where the application is running. View the application in the browser by visiting "http://localhost:8080", "8080" is just an example or a port number.
6. To stop the local server: with Mac OS X or Unix, press Control-C or with Windows, press Control-Break in your command prompt window.


package com.example.infs3634_task3.utils;

import android.content.Context;

import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.JsonArrayRequest;
import com.android.volley.toolbox.Volley;

import org.json.JSONArray;
import org.json.JSONException;

public class GetAPIRequest {
    private JsonArrayRequest request;
    private RequestQueue requestQueue;

    public void request(final Context context, final FetchDataListener listener, final String ApiURL) throws JSONException {
        if (listener != null) {
            listener.onFetchStart();
        }

        request = new JsonArrayRequest(ApiURL, new Response.Listener<JSONArray>() {
            @Override
            public void onResponse(JSONArray response) {
                listener.onFetchComplete(response);
            }

        } , new Response.ErrorListener() {
            @Override
            public void onErrorResponse(VolleyError error) { }
        });
        requestQueue = Volley.newRequestQueue(context);
        requestQueue.add(request);
    }
}


package com.example.lab_JsonPlaceholder_Demo;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;

import androidx.appcompat.app.AlertDialog;

public class ProgressDialogUtil {
    private static AlertDialog mAlertDialog;

    public static void showProgressDialog(Context context, String s) {
        if (mAlertDialog == null) {
            mAlertDialog = new AlertDialog.Builder(context, R.style.CustomProgressDialog).create();
        }

        View loadView = LayoutInflater.from(context).inflate(R.layout.process_dialog, null);
        mAlertDialog.setView(loadView);
        mAlertDialog.setCanceledOnTouchOutside(false);

        TextView tv_jsonDownload = loadView.findViewById(R.id.tv_jsonDownload);
        tv_jsonDownload.setText(s);

        mAlertDialog.show();
    }

    public static void dismissProgressDialog() {
        if (mAlertDialog != null && mAlertDialog.isShowing()) {
            mAlertDialog.dismiss();
        }
    }
}


# Oneesama

Promise wrapper for [oppai-ng](https://github.com/Francesco149/oppai-ng).

## Getting started

To install the package, just install it from this repository:

`npm i NikoBotDev/onee-sama`

## Testing

Just clone this repository using:

`git clone https://github.com/NikoBotDev/onee-sama.git`

Then go to the folder using cmd and run the following:

`npm run test`

## Usage

### Get oppai data

```javascript
    const Oneesama = require('onee-sama');
    const parser = new Oneesama();

    parser.get('beatmapId').then(data => {
        console.log(data);
    }).catch(console.err);

```

## Contributing

1. Fork & clone the repository
2. Code your heart out!
3. Make a test just for sure.
4. [Submit a pull request](https://github.com/NikoBotDev/onee-sama/compare)

## License
This package is licensed under the MIT license (see the LICENSE file for more information). I have neither created or contributed to the development of oppai-ng, and this package is not affiliated with its developers in any way.

> GitHub [@EmptyException](https://github.com/NikoBotDev)


# Maah for ZSH

A theme for [Oh My ZSH](https://github.com/robbyrussell/oh-my-zsh) with collapsed working directory and moon(Persian: ماه, Māh) icon!

![Screenshot](https://raw.githubusercontent.com/SlashArash/maah/master/screenshot.png)

## Install

### CURL

  - Enter below command:
    ```
    curl -o ~/.oh-my-zsh/custom/themes/maah.zsh-theme https://raw.githubusercontent.com/SlashArash/maah/master/maah.zsh-theme --create-dirs
    ```

### Git

  - Clone the repo:
    ```
    git clone https://github.com/SlashArash/maah.git
    ```
  - Create a symbolic link to oh-my-zsh's custom theme folder:
    > Remember that you should replace PATH_TO_CLONED_REPO with the actual directories for this command to work.
    ```
    ln -s PATH_TO_CLONED_REPO/maah/maah.zsh-theme ~/.oh-my-zsh/custom/themes/maah.zsh-theme
    ```

### Manually

  1) Download using the GitHub .zip download option and unzip them.
  2) Move maah.zsh-theme file to oh-my-zsh's custom theme folder: ~/.oh-my-zsh/custom/themes/maah.zsh-theme.

## Active theme

  Go to your ~/.zshrc file and set ZSH_THEME="maah".

## License

[MIT License](./LICENSE)


package com.bignerdranch.android.hometrainer2;

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

public class ProfileActivity extends AppCompatActivity {

    private TextView mName;
    private TextView mPassword;
    private TextView mEmail;
    private TextView mPhoneNumber;
    private TextView mAddress;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_registry);
        mName = (TextView) findViewById(R.id.personName);
        mName.setText(0);
        mAddress = (TextView) findViewById(R.id.address);
        mAddress.setText(0);
        mPassword = (TextView) findViewById(R.id.userPassword);
        mPassword.setText(0);
        mEmail = (TextView) findViewById(R.id.email);
        mEmail.setText(0);
        mPhoneNumber = (TextView) findViewById(R.id.phone);
        mPhoneNumber.setText(0);
    }
}


/*
 * Copyright 2008, Red Hat, Inc., and individual contributors
 * by the @authors tag. See the copyright.txt in the distribution for a
 * full listing of individual contributors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * http://www.apache.org/licenses/LICENSE-2.0
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package jakarta.enterprise.inject.literal;

import jakarta.enterprise.util.AnnotationLiteral;
import jakarta.inject.Singleton;

/**
 * Supports inline instantiation of the {@link Singleton} annotation.
 *
 * @author Martin Kouba
 * @since 2.0
 */
public final class SingletonLiteral extends AnnotationLiteral<Singleton> implements Singleton {

    public static final SingletonLiteral INSTANCE = new SingletonLiteral();

    private static final long serialVersionUID = 1L;

}


package com.codeclan.example.WhiskyTracker.controllers;

import com.codeclan.example.WhiskyTracker.models.Whisky;
import com.codeclan.example.WhiskyTracker.repositories.WhiskyRepository.WhiskyRepository;
import org.hibernate.Session;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

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

@RestController
@RequestMapping(value = "/whiskies")
public class WhiskyController {

    @Autowired
    WhiskyRepository whiskeyRepository;
    EntityManager entityManager;

    @GetMapping(value = "/whiskies/{year}")

    public List<Whisky> GetAllTheWhiskiesWithYear(@PathVariable int year) {
        return whiskeyRepository.findWhiskyByYear(year);

    }
}


package com.dev.lishabora.Views.Admin;

import com.dev.lishabora.Models.ProductsModel;
import com.dev.lishabora.Models.Trader.TraderModel;

import java.util.List;

public class CreateTraderConstants {
    private static TraderModel traderModel;
    private static List<ProductsModel> productModels;

    public static TraderModel getTraderModel() {
        return traderModel;
    }

    public static void setTraderModel(TraderModel traderModel) {
        CreateTraderConstants.traderModel = traderModel;
    }

    public static List<ProductsModel> getProductModels() {
        return productModels;
    }

    public static void setProductModels(List<ProductsModel> productModels) {
        CreateTraderConstants.productModels = productModels;
    }

    public static void addTraderProducts(List<ProductsModel> selectedProducts) {
        if (productModels != null) {
            productModels.addAll(selectedProducts);
        } else {
            productModels = selectedProducts;
        }
    }

    public class TraderPayload {

    }
}


package edu.bsu.cs222;

import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;

import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;

public class RedirectParser {

    public Redirect parse(InputStream inputStream) {
        try {
            JsonParser parser = new JsonParser();
            Reader reader = new InputStreamReader(inputStream);
            JsonElement rootElement = parser.parse(reader);
            JsonObject rootObject = rootElement.getAsJsonObject();
            JsonObject query = rootObject.getAsJsonObject("query").getAsJsonObject();
            JsonElement redirectElement = query.getAsJsonArray("redirects").get(0);
            if (redirectElement == null) {
                return null;
            }
            String originalSearchTerm = redirectElement.getAsJsonObject().get("from").getAsString();
            String newSearchTerm = redirectElement.getAsJsonObject().get("to").getAsString();
            return new Redirect(originalSearchTerm, newSearchTerm);
        } catch (Exception e) {
            return null;
        }
    }
}


package com.nrusev.domain;

import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.util.Date;

/**
 * Created by nikolayrusev on 3/10/16.
 */
@MappedSuperclass
@EntityListeners({AuditingEntityListener.class})
public class AbstractAuditableEntity {

    private Date createdDate;

    private Date lastModifiedDate;

    @CreatedDate
    @Column(name = "created_at")
    @Temporal(TemporalType.TIMESTAMP)
    public Date getCreatedDate() {
        return createdDate;
    }

    public void setCreatedDate(Date createdDate) {
        this.createdDate = createdDate;
    }

    @LastModifiedDate
    @Column(name = "updated_at")
    @Temporal(TemporalType.TIMESTAMP)
    public Date getLastModifiedDate() {
        return lastModifiedDate;
    }

    public void setLastModifiedDate(Date lastModifiedDate) {
        this.lastModifiedDate = lastModifiedDate;
    }
}


package com.abu.order.controller;

import com.abu.order.client.StorageClient;
import com.abu.order.pojo.Order;
import com.abu.order.service.OrderTblService;
import com.abu.storage.pojo.Storage;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author 阿布
 * @since 2020-04-12
 */
@RestController
@RequestMapping("/order")
public class OrderTblController {

    @Autowired
    private OrderTblService orderservice;

    @Autowired
    private StorageClient storageClient;

    @PostMapping("insert")
    @GlobalTransactional
    public void createOrder(Order order) {
        this.orderservice.save(order);
        Storage storage = new Storage();
        storage.setCommodityCode("fsf");
        storage.setCount(1);
//        int a = 1 / 0;
        this.storageClient.save(storage);
    }
}


package com.geekbrains.internship.warehouse.controllers.rest;

import com.geekbrains.internship.warehouse.entities.Image;
import com.geekbrains.internship.warehouse.services.ImageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/v1/images")
@Api("Set of endpoints for CRUD operations for Image")
public class ImagesController {
    private ImageService imageService;

    @Autowired
    private ImagesController(ImageService imageService){
        this.imageService = imageService;
    }

    @GetMapping
    @ApiOperation("Returns list of all images")
    public List<Image> getAllImages() {
        return imageService.findAll();
    }

    @PostMapping
    @ApiOperation("Creates a new image")
    public Image createNewImage(Image image) {
        return imageService.saveOrUpdate(image);
    }
}


package ml.dpgames.tegris;

import java.util.Random;

import ml.dpgames.tegris.TextureRender.Draw;

import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.math.Rectangle;

public class GameObject {

	public float x, y, width, height;
	public static Texture terrain;
	public TextureRegion terrainReg = new TextureRegion(terrain,0,0,16,16);
	public static final Random rand = new Random();

	public GameObject(float x, float y, float width, float height) {
		this.x = x;
		this.y = y;
		this.width = width;
		this.height = height;
		terrainReg.setRegion(0, rand.nextInt(2) * 16, 16, 16);
	}

	public Rectangle getBounds() {
		return null;
	}

	public void update(float delta) {

	}

	public void render(SpriteBatch batch) {
		TextureRender.addTex(new Draw(){
			public void render(SpriteBatch batch) {
				batch.draw(terrainReg, x, y);
			}
		}, (int) y+50);
	}

}


package com.siberteam.koen.dictionary;

import java.io.*;
import java.util.Deque;
import java.util.Set;
import java.util.concurrent.ConcurrentLinkedDeque;

public class FileStreamWorker {
    private final String fileReaderName;
    public final String fileWriterName;

    public FileStreamWorker(String fileRead, String fileWrite) {
        this.fileReaderName = fileRead;
        this.fileWriterName = fileWrite;
    }

    public Deque<String> getStackUrl() throws IOException {
        Deque<String> urls = new ConcurrentLinkedDeque<>();
        try (BufferedReader readerFile = new BufferedReader(new FileReader(fileReaderName))) {
            String line;
            while ((line = readerFile.readLine()) != null) {
                urls.push(line);
            }
        }
        return urls;
    }

    public void writeResultsToFile(Set<String> setWords) throws IOException {
        try (BufferedWriter fileWriter = new BufferedWriter(new FileWriter(fileWriterName))) {
            for (String setWord : setWords) {
                fileWriter.write(setWord + System.lineSeparator());
            }
        }
    }
}


package com.paperfly.otphelper;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.SimpleTimeZone;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class OtpListener {
    private String mSender;
    private String mMessageFormat;

    public OtpListener(String sender, String messageFormat) {
        mSender = sender;
        mMessageFormat = messageFormat;
    }

    public boolean isRightSender(String sender) {
        return mSender.equals(sender);
    }

    public Otp getOtpFromMessage(String message) {
        Pattern pattern = Pattern.compile(mMessageFormat);
        Matcher matcher = pattern.matcher(message);
        Otp otp = new Otp();

        if (matcher.find()) {
            SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmm", Locale.US);
            sdf.setTimeZone(new SimpleTimeZone(SimpleTimeZone.UTC_TIME, "UTC"));

            otp.setText(matcher.group(1));
            otp.setDate(sdf.format(new Date()));
        }

        return otp;
    }
}


package com.ricoh.test.liferay.portlet;

import javax.portlet.PortletException;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;

import org.osgi.service.component.annotations.Component;

import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.portlet.bridges.mvc.MVCRenderCommand;
import com.ricoh.test.liferay.constants.AdminDataPortletKeys;
import com.ricoh.test.liferay.constants.Constants;

@Component(
		immediate = true,
		property = {
			"javax.portlet.name=" + AdminDataPortletKeys.ADMINDATA,
			"mvc.command.name=" + Constants.RENDER_ALTA_COCHE
		},
		service = MVCRenderCommand.class
)
public class AdminDataAltaCocheRenderCommand implements MVCRenderCommand {

	@Override
	public String render(RenderRequest renderRequest, RenderResponse renderResponse) throws PortletException {

		_log.info("Redirect to '" + Constants.ALTA_COCHE + "'");

		return Constants.ALTA_COCHE;
	}

	private static final Log _log = LogFactoryUtil.getLog(AdminDataAltaCocheRenderCommand.class);
}


package com.complexible.common.openrdf.vocabulary;

import org.openrdf.model.IRI;

/**
 *
Vocabulary for the DBPedia schemas

 *
 * @author  Michael Grove
 * @since   0.3.1
 * @version 4.0
 */
public class DBPedia {

	private static final Ontology ONT = new Ontology();
	private static final Property PROP = new Property();
	private static final Resource RES = new Resource();

	public static Property property() {
		return PROP;
	}

	public static Resource resource() {
		return RES;
	}

	public static Ontology ontology() {
		return ONT;
	}

	public static class Property extends Vocabulary {
		private Property() {
			super("http://dbpedia.org/property/");
		}

		public final IRI countryCode = term("countryCode");
	}

	public static class Resource extends Vocabulary {
		private Resource() {
			super("http://dbpedia.org/resource/");
		}
	}

	public static class Ontology extends Vocabulary {
		private Ontology() {
			super("http://dbpedia.org/ontology/");
		}

		public final IRI Place = term("Place");
		public final IRI PopulatedPlace = term("PopulatedPlace");
		public final IRI Country = term("Country");
	}
}


package examples;

import io.vertx.core.Vertx;
import io.vertx.ext.cache.Cache;
import io.vertx.ext.cache.CacheOptions;
import io.vertx.ext.cache.ExpirationPolicy;

/**
 * @author Clement Escoffier
 */
public class Examples {

  public void create(Vertx vertx) {
    Cache.create(vertx, "my-cache", new CacheOptions().setExpirationPolicy(ExpirationPolicy.TOUCH)
        .setExpirationTimeInSecond(3600), cache -> {
      // cache is the instance you can use
    });
  }

  public void put(Cache<String, String> cache) {
    cache.put("key", "my value", v -> {
      if (v.failed()) {
        // cannot insert the value
      } else {
        // value inserted
      }
    });
  }

  public void get(Cache<String, String> cache) {
    cache.get("key", retrieved -> {
      if (retrieved.failed()) {
        // cannot get the value
      } else {
        String cachedValue = retrieved.result();
        // cachedValue may be null if the cache don't have a mapping for "key".
      }
    });
  }

  public void close(Cache<String, String> cache) {
    cache.close(done -> {
      // you can destroy it to unregister it from the cache manager
      cache.destroy();
    });
  }
}


package com.example.administrator.personhealthrecord.util;

import android.graphics.Rect;
import android.view.View;
import android.view.ViewTreeObserver;

/**
 * Created by andy on 2017/8/1.
 */

public class SoftInputFixUtil {
    public static void fix(final View root, final View lastView){
        root.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener(){
            @Override
                    public void onGlobalLayout(){
                Rect rect=new Rect();
                root.getWindowVisibleDisplayFrame(rect);
                int mainInvisibleHeight=root.getRootView().getHeight()-rect.bottom;
                if(mainInvisibleHeight>200){
                    int[]location=new int[2];
                    lastView.getLocationInWindow(location);
                    int deltaY=location[1]+lastView.getHeight()-rect.bottom;
                    root.scrollBy(0,deltaY);
                }else{
                    root.scrollTo(0,0);
                }
            }
        });
    }
}


package andrej.com.musicmanagement.base;

import andrej.com.musicmanagement.ScreenPresenter;
import andrej.com.musicmanagement.ScreenView;
import io.reactivex.disposables.CompositeDisposable;

public abstract class BaseScreenPresenter<T extends ScreenView> implements ScreenPresenter<T> {

    private T mView;
    protected final CompositeDisposable viewSubscriptions = new CompositeDisposable();
    protected final CompositeDisposable screenSubscriptions = new CompositeDisposable();

    @Override
    public final void takeView(T view) {
        mView = view;
        onViewAttached();
    }

    @Override
    public final void dropView() {
        mView = null;
        viewSubscriptions.clear();
        onViewDetached();
    }

    @Override
    public void destroyScreen() {
        screenSubscriptions.clear();
        onScreenDestroyed();
    }

    protected final T getView() {
        return mView;
    }

    protected final boolean isViewAttached() {
        return mView != null;
    }

    protected abstract void onViewDetached();

    protected abstract void onViewAttached();

    protected abstract void onScreenDestroyed();
}


package gl_22_01.p6;

import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

public class SinglElemBuffLock {
    private final Lock lock = new ReentrantLock(true);
    private final Condition notEmpty = lock.newCondition();
    private final Condition notFull = lock.newCondition();
    private Integer elem = null;

    public void put(int newElem) throws InterruptedException {
        lock.lock();
        try {
            while (elem != null) {
                notFull.await();
            }
            this.elem = newElem;
            notEmpty.signal();
        } finally {
            lock.unlock();
        }
    }

    public void get() throws InterruptedException {
        lock.lock();
        try {
            while (elem == null) {
                notEmpty.await();
            }
            Integer result = elem;
            elem = null;
            notFull.signal();
        } finally {
            lock.unlock();
        }
    }

}


/* Annot8 (annot8.io) - Licensed under Apache-2.0. */
package io.annot8.common.serialisation.jackson;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;

import org.junit.jupiter.api.Test;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.module.SimpleModule;

import io.annot8.common.data.bounds.NoBounds;

public class NoBoundsSerializerTest {

  @Test
  public void testSerialize() {
    ObjectMapper mapper = new ObjectMapper();
    SimpleModule module = new SimpleModule();
    module.addSerializer(new NoBoundsSerializer());
    mapper.registerModule(module);

    String json = null;
    try {
      json = mapper.writeValueAsString(NoBounds.getInstance());
    } catch (JsonProcessingException e) {
      e.printStackTrace();
    }

    assertNotNull(json);
    assertEquals("{}", json);
  }
}


package com.coin.controller;

import com.coin.models.AppResponse;
import com.coin.services.CoinBalanceUpdateService;
import com.coin.services.WalletAddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class CoinController {

    @Autowired
    WalletAddressService walletAddressService;

    @Autowired
    CoinBalanceUpdateService coinBalanceUpdateService;

    @RequestMapping(value = "/getWalletAddress", method = RequestMethod.POST)
    public AppResponse<String> getWalletAddress(String userId) {
        String address = walletAddressService.getAddress(userId);
        return new AppResponse<>(address);
    }

    @RequestMapping(value = "/balanceUpdate/{txid}", method = RequestMethod.GET)
    public void updateBalanceByTxId(@PathVariable("txid") String txId) {
        coinBalanceUpdateService.update(txId);
    }
}


package cn.edu.swpu.cins.openday.model.service;

public class AuthUser {

	private String mail;
	private String token;

	public AuthUser() {}

	public AuthUser(String mail, String token) {
		this.mail = mail;
		this.token = token;
	}

	public String getMail() {
		return mail;
	}

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

	public String getToken() {
		return token;
	}

	public void setToken(String token) {
		this.token = token;
	}

	@Override
	public boolean equals(Object o) {
		if (this == o) return true;
		if (o == null || getClass() != o.getClass()) return false;

		AuthUser that = (AuthUser) o;

		if (getMail() != null ? !getMail().equals(that.getMail()) : that.getMail() != null) return false;
		return getToken() != null ? getToken().equals(that.getToken()) : that.getToken() == null;

	}

	@Override
	public int hashCode() {
		int result = getMail() != null ? getMail().hashCode() : 0;
		result = 31 * result + (getToken() != null ? getToken().hashCode() : 0);
		return result;
	}

	@Override
	public String toString() {
		return "AuthUser{" +
			"mail='" + mail + '\'' +
			", token='" + token + '\'' +
			'}';
	}
}


package dev.mate.cinemagame.states;

import java.awt.Graphics;

import dev.mate.cinemagame.Handler;
import dev.mate.cinemagame.gfx.Assets;
import dev.mate.cinemagame.ui.ClickListener;
import dev.mate.cinemagame.ui.UIImageButton;
import dev.mate.cinemagame.ui.UIManager;

public class MenuState extends State {

	private UIManager uiManager;

	public MenuState(Handler handler) {
		super(handler);
		uiManager = new UIManager(handler);
		handler.getMouse().setUIManager(uiManager);

		uiManager.addObject(new UIImageButton(handler.getGame().getWidth()/2-Assets.MENU_BUTTON_WIDTH/2, handler.getGame().getHeight()/2-Assets.MENU_BUTTON_HEIGHT/2,
				Assets.MENU_BUTTON_WIDTH, Assets.MENU_BUTTON_HEIGHT, Assets.startButton, new ClickListener() {

			@Override
			public void onClick() {
				handler.getMouse().setUIManager(null);
				State.setState(handler.getGame().gameState);

			}}));
	}

	@Override
	public void tick() {
		uiManager.tick();
	}

	@Override
	public void render(Graphics g) {
		uiManager.render(g);

	}

}


package Txl.DemoMavenSampleProject;

import java.util.concurrent.TimeUnit;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;

public class ExampleTest {

	public static WebDriver driver;

	@BeforeTest
	public static void startUp()
	{

		//driver = new ChromeDriver();

		driver = new FirefoxDriver();
		driver.manage().window().maximize();
		driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
	}
	@Test
	public void testDownload() throws Exception
	{
		driver.get("https://www.zoho.com/mail/");
		driver.findElement(By.xpath("//div[@class='header']//div[@class='signing']//a[text()='Sign In']")).click();
		String header = driver.findElement(By.xpath("//div[@class='main']/h1")).getText();
		System.out.println("Page Title : "+ header);
		System.out.println("Done");
	}

	@AfterTest
	public static void tearDown()
	{
		driver.close();
		driver.quit();
	}
}