package org.myproject.test.authent;

import org.myproject.test.common.entity.User;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

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

@RestController
@RequestMapping(path = "/authent")
public class AuthentResource {

    private final AuthentService service;

    public AuthentResource(AuthentService service) {
        this.service = service;
    }

    @RequestMapping(value = "sign-up", method = POST, consumes = "application/json")
    public ResponseEntity signUp(@RequestBody User user) {
        try{
            service.saveAnUser(user);
        }catch (final RuntimeException e){
            return new ResponseEntity<>(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);
        }
        return new ResponseEntity<>(user.getLogin(), HttpStatus.OK);
    }
}


package com.draper.system.service.impl;

import com.draper.system.dao.UserRoleRelationMapper;
import com.draper.system.entity.UserRoleRelation;
import com.draper.system.service.UserRoleRelationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserRoleRelationServiceImpl implements UserRoleRelationService {

    @Autowired
    private UserRoleRelationMapper userRoleRelationMapper;

    @Override
    public void correlate(UserRoleRelation relation) {
        userRoleRelationMapper.correlate(relation);
    }

    @Override
    public void unCorrelate(long userId, long roleId) {
        userRoleRelationMapper.unCorrelate(userId, roleId);
    }

    @Override
    public List<UserRoleRelation> selectUserRoles(long userId) {
        return userRoleRelationMapper.selectUserRoles(userId);
    }

    @Override
    public List<UserRoleRelation> selectUsersFromRole(long roleId) {
        return userRoleRelationMapper.selectUsersFromRole(roleId);
    }

}


package org.dairy.farms.interceptor.hibernate;

import org.dairy.farms.model.AuditInfo;

import javax.persistence.PrePersist;
import javax.persistence.PreUpdate;
import java.util.Date;

/**
 * Created by IntelliJ IDEA.
 * User: gduggirala
 * Date: Jun 13, 2011
 * Time: 8:24:31 PM
 */
public class AuditListener {
    @PrePersist
    public void prePersist(Object obj){
        if(obj instanceof Auditable){
            AuditInfo auditInfo = ((Auditable) obj).getAuditInfo();
            if(auditInfo == null){
                auditInfo = new AuditInfo();
            }
            auditInfo.setCreatedBy(1l);
            auditInfo.setModifiedBy(1l);
            auditInfo.setDateCreated(new Date());
            auditInfo.setDateModified(new Date());
        }
    }

    @PreUpdate
    public void preUpdate(Object obj){
        if(obj instanceof Auditable){
            AuditInfo auditInfo = ((Auditable) obj).getAuditInfo();
            if(auditInfo == null){
                auditInfo = new AuditInfo();
            }
            auditInfo.setModifiedBy(1l);
            auditInfo.setDateModified(new Date());
        }
    }
}


import processing.core.*;

public class Bullet extends PApplet {				//samma som i processing, men det finns BARA EN SORTS BULLETS. Ingen skild ebullet för enemies, de skjuter samma bullets.
	PVector location;								//Därmed finns också bara en bullets arraylist. detta är möjligt genom att det finns bara en shoot-metod, som både player och enemies kan använda (se "actor")
	  float radius=5;
	  float oldPosX, oldPosY, rotation, speed;
	  boolean toRemove=false;
	  actor shooter;
	  Bullet(actor shooter, float targetPosX, float targetPosY) {
		this.shooter=shooter;
	    location= new PVector(shooter.location.x, shooter.location.y);
	    oldPosX = targetPosX;
	    oldPosY = targetPosY;
	    rotation = atan2(oldPosY - location.y, oldPosX - location.x) / PI * 180;
	    speed = 15;
	  }
	  void update() {
	    location.x = location.x + cos(rotation/180*PI)*speed-(player.playerX-player.pplayerX.get(18));
	    location.y = location.y + sin(rotation/180*PI)*speed-(player.playerY-player.pplayerY.get(18));

	    if (location.x > 0 && location.x < 1000 && location.y > 0 && location.y < 1000 && toRemove==false) {
	    } else {
	      Processing.bullets.remove(this);		//removar denna bullet
	    }

	  }
	}


package com.symlab.hydracloud;

import com.symlab.hydra.IOffloadingService;

import hk.ust.symlab.hydra.network.cloud.Main;
import android.app.Activity;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.Bundle;
import android.os.IBinder;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;

public class MainActivity extends Activity {

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

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		int id = item.getItemId();
		if (id == R.id.action_settings) {
			return true;
		}
		return super.onOptionsItemSelected(item);
	}

	public void RunVMClient() {
		new Thread(){
			public void run() {
				CloudService cloudService = new CloudService(MainActivity.this);
				cloudService.makeconnection();
			};
		}.start();
	}

}


package annotation;

import examples.annotation.Annotation;
import examples.component.MyService;
import examples.bean.instantiating.ExampleBean;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration({"classpath:annotation.xml"})
public class AnnotationTest {

	@Autowired
	Annotation annotation;

	@Test
	public void testAnnotation() {
		System.out.println(annotation.getNoPrimary());
	}

	@Autowired
	@Qualifier("protected")
	private ExampleBean exampleBean;

	@Test
	public void testComponent () {
		System.out.println(exampleBean);
	}

	@Autowired
	private MyService  service;

	@Test
	public void testNameGenerator () {
		System.out.println(service.getBeanName());
	}
}


package ru.votingsystem.auth;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import ru.votingsystem.model.User;

import java.util.ArrayList;
import java.util.Collection;

public class AuthorizedUser implements UserDetails {
    private User user;

    public AuthorizedUser(User user) {
        this.user = user;
    }

    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return new ArrayList<GrantedAuthority>(user.getRoles());
    }

    @Override
    public String getPassword() {
        return user.getPassword();
    }

    @Override
    public String getUsername() {
        return user.getEmail();
    }

    @Override
    public boolean isAccountNonExpired() {
        return true;
    }

    @Override
    public boolean isAccountNonLocked() {
        return true;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return true;
    }

    @Override
    public boolean isEnabled() {
        return user.isEnabled();
    }

    public User getUser() {
        return user;
    }
}


package com.skuniv.cs.geonyeong.kaggleapi.vo;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.skuniv.cs.geonyeong.kaggleapi.vo.meta.QnAMeta;
import java.util.List;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;

@Slf4j
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Question extends QnAMeta {

    private String id;
    private String title;
    private Integer answerCount;
    private Integer favoriteCount;
    private Integer viewCount;

    @Builder
    public Question(String body, String createDate, Integer score, Account account,
        Integer commentCount, String tags, List<Comment> commentList, List<Link> linkList,
        QnaJoin qnaJoin, String id, String title, Integer answerCount, Integer favoriteCount,
        Integer viewCount) {
        super(body, createDate, score, account, commentCount, tags, commentList, linkList, qnaJoin);
        this.id = id;
        this.title = title;
        this.answerCount = answerCount;
        this.favoriteCount = favoriteCount;
        this.viewCount = viewCount;
    }
}


/*
 * 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.tetrapak.processing.parts_control.beans;

import com.tetrapak.processing.parts_control.pc_logic_ejb.Logic;
import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.ejb.Stateless;
import javax.inject.Named;

/**
 * Returns logic from the ejb 'LogicBean' doing the business logic processing
 *
 * @author SEPALMM
 */
@Named(value = "logicClient")
@Stateless
public class LogicClient {

    @EJB
    private Logic logicBean;

    // Properties to be returned to the jsf page
    private String footerMessage;

    // Constructor
    public LogicClient() {
    }

    // Initialize properties and methods (sequencial order is important)
    @PostConstruct
    public void init() {
    }

    public String getFooterMessage() {
        footerMessage = logicBean.getMessage();
        return footerMessage;
    }

    public void setFooterMessage(String footerMessage) {
        this.footerMessage = footerMessage;
    }

}


# Getting Started

First, create a fork of the [openpandemic-app](https://github.com/OpenPandemic/openpandemic-app) repo from master by hitting the `fork` button on the GitHub page.

Next, clone your fork onto your computer with this command (replacing YOUR_USERNAME with your actual GitHub username)

```git@github.com:openpandemic/openpandemic-app.git
git clone git@github.com:YOUR_USERNAME/openpandemic-app.git
```

Once cloning is complete, change directory to the repo.

```
cd openpandemic-app
```

# Set up the development environment

Run the following command.

```
npm install
```

This will download and install all packages needed.

# Steps

* In your fork, make the changes.
* If you've changed features, update the documentation.
* Make sure your code lints.
* Make the pull request!

 We recommend using an IDE or editor with an eslint plugin in order to streamline the development process. Plugins are available for all the popular editors. For more information see [ESLint Integrations](https://eslint.org/docs/user-guide/integrations)


package org.iglooproject.jpa.business.generic.model.migration;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.MappedSuperclass;

import org.iglooproject.jpa.business.generic.model.PredefinedIdGenericEntity;

/**
 * This class should only be used as a temporary measure to migrate entities from an old application
 * to a new one.
 *
 * It allows us to keep the old id as the new id.
 *
 * @see MigratedFromOldApplicationSequenceGenerator
 */
@MappedSuperclass
public abstract class MigratedFromOldApplicationGenericEntity<K extends Serializable & Comparable<K>, E extends PredefinedIdGenericEntity<K, E>>
		extends PredefinedIdGenericEntity<K, E> implements IMigratedFromOldApplicationEntity<K> {

	private static final long serialVersionUID = 2034570162020079499L;

	@Column(nullable = false)
	private boolean migrated = false;

	@Override
	public boolean isMigrated() {
		return migrated;
	}

	@Override
	public void setMigrated(boolean migrated) {
		this.migrated = migrated;
	}

}


package DataBase;

public class Room {
	private String name;
	private int maxPersons;
	private float hCost;
	private float cost;
	private int roomId;

	public Room(String name, int maxPersons,float hCost2,float cost2) {
		this.name = name;
		this.maxPersons = maxPersons;
		this.hCost = hCost2;
		this.cost = cost;
	}

	public Room(String name, int maxPersons,float hCost2,float cost2,int roomId) {
		this.name = name;
		this.maxPersons = maxPersons;
		this.hCost = hCost2;
		this.cost = cost;
		this.roomId=roomId;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public int getMaxPersons() {
		return maxPersons;
	}
	public void setMaxPersons(int maxPersons) {
		this.maxPersons = maxPersons;
	}
	public float gethCost() {
		return hCost;
	}
	public void sethCost(int hCost) {
		this.hCost = hCost;
	}
	public float getCost() {
		return cost;
	}
	public void setCost(int cost) {
		this.cost = cost;
	}
	public int getRoomId() {
		return roomId;
	}
	public void setRoomId(int roomId) {
		this.roomId = roomId;
	}

}


package product.domain.resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import product.domain.model.Product;
import product.domain.repository.ProductRepository;
import product.domain.resource.model.NewProduct;

/**
 * Created by claudio on 27/06/17.
 */
@RestController
@RequestMapping("/api/product")
public class ProductResource {

    private final ProductRepository productRepository;

    @Autowired
    public ProductResource(ProductRepository productRepository) {
        this.productRepository = productRepository;
    }

    @PostMapping
    public ResponseEntity<Product> newOne(NewProduct newProduct){
        return ResponseEntity.status(201).body(this.productRepository.save(Product.builder().product(newProduct).build()));
    }

    @GetMapping("/{id}")
    public ResponseEntity<Product> one(@PathVariable("id") String id){
        return ResponseEntity.status(200).body(this.productRepository.findOne(id));
    }

    @GetMapping
    public ResponseEntity<Iterable<Product>> products(){
        return ResponseEntity.status(200).body(this.productRepository.findAll());
    }

}


package protocols.multipaxos.messages;

import babel.protocol.event.ProtocolMessage;
import io.netty.buffer.ByteBuf;
import network.ISerializer;
import protocols.multipaxos.Operation;

import java.io.Serializable;
import java.net.UnknownHostException;

public class AcceptOperationMessage extends ProtocolMessage implements Serializable {
    public final static short MSG_CODE = 26;

    private Operation operation;

    public AcceptOperationMessage(Operation operation) {
        super(MSG_CODE);
        this.operation = operation;
    }

    public static final ISerializer<AcceptOperationMessage> serializer = new ISerializer<AcceptOperationMessage>() {
        @Override
        public void serialize(AcceptOperationMessage m, ByteBuf out) {
            m.operation.serialize(out);
        }

        @Override
        public AcceptOperationMessage deserialize(ByteBuf in) throws UnknownHostException {
            return new AcceptOperationMessage(Operation.deserialize(in));
        }

        @Override
        public int serializedSize(AcceptOperationMessage m) {
            return m.operation.serializedSize();
        }
    };

    public Operation getOperation() {
        return operation;
    }
}


# Korriban Runtime

## The core runtime dependency chain

Field Reservation (type agnostic)
    Scheduling information. Contains field indexes.
    Indexes element reservations to field sets.
    Defines active interdependency set
    DOES NOT DEFINE FIELDS ON ELEMENTS (only between).
    Says what exit properties go where (and if they should (binding chain)).
    Asked during update loop.
    Used by scheduler for interdependecy data? Possibly is scheduler?
Prop Set (strong type) - Data storage, requires fast R/W.
    Very dumb data storage.
    Delta frame based.
Element - Reserves field indicies, R/W to storage quickly.
    Asks reservation for I/O
    Prepares binding sites
    More to insert here as layers come online.
    Invokes body

Element reserves by asking Field Reservation for index, then strong typing R/W to prop set trait.
    Wasm Element interface - Map from field reservation index to local index for each type (set is primary keyed by type to compiler switches).

Reference types only make sense in the context of another module.
    What makes a reference type?


package zaaim.halim;
import java.io.IOException;
import java.util.StringTokenizer;

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

public class PallindromMapper extends Mapper<LongWritable, Text, Text, IntWritable>{
    private Text pallindromWord = new Text();
    public void map(LongWritable key, Text value, Context context
                    ) throws IOException, InterruptedException {
      StringTokenizer itr = new StringTokenizer(value.toString());
      while (itr.hasMoreTokens()) {
        String word = itr.nextToken().trim();
        if(word.equals(inversedWord(word)))
        {
        	pallindromWord.set(word);
        	context.write(pallindromWord,new IntWritable(1));
        }

      }
    }
	private String inversedWord(String word) {
		String inversedWord = "";
		for(int i = word.length()-1; i >= 0; i--)
		{
			inversedWord = inversedWord + word.charAt(i);
		}
		return inversedWord.trim();
	}
}


package com.example.demo.controller;

import com.example.demo.dao.KhachhangDAO;
import com.example.demo.dto.KhachHangDTO;
import com.example.demo.model.KhachHang;
import com.example.demo.model.Phong;
import com.example.demo.repository.KhachHangRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
@RequestMapping("khach-hang")
public class KhachHangController {
    @Autowired
    KhachHangRepository khachhangRepository;
    @Autowired
    KhachhangDAO khachhangDAO;

    @PostMapping("/add")
    public ResponseEntity<KhachHang> addKhachHang(@RequestBody KhachHangDTO khachHang){
        Boolean check = khachhangDAO.addKhachHang(khachHang);
        if (check) return new ResponseEntity("Success", HttpStatus.ACCEPTED);
        else return new ResponseEntity("Fail", HttpStatus.BAD_REQUEST);
    }
    @GetMapping("/search")
    public ResponseEntity<KhachHang> searchKhachhang(@RequestParam String value){
        return new ResponseEntity(khachhangDAO.searchKhachhang(value), HttpStatus.OK);
    }
}


package com.github.woshikid.mvc.utils;

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

import org.apache.shiro.cache.CacheException;
import org.springframework.cache.Cache;
import org.springframework.cache.support.SimpleValueWrapper;

@SuppressWarnings("rawtypes")
public class ShiroCache implements org.apache.shiro.cache.Cache {

	private Cache cache;

	public ShiroCache(Cache cache) {
		this.cache = cache;
	}

	public Object get(Object key) throws CacheException {
		Object value = cache.get(key);
		if (value instanceof SimpleValueWrapper) {
			return ((SimpleValueWrapper)value).get();
		} else {
			return value;
		}
	}

	public Object put(Object key, Object value) throws CacheException {
		cache.put(key, value);
		return null;
	}

	public Object remove(Object key) throws CacheException {
		cache.evict(key);
		return null;
	}

	public void clear() throws CacheException {
		cache.clear();
	}

	public int size() {
		throw new UnsupportedOperationException();
	}

	public Set keys() {
		throw new UnsupportedOperationException();
	}

	public Collection values() {
		throw new UnsupportedOperationException();
	}

}


package lt.swedbank.itacademy.ItAkaLeasingSystemBackEnd.beans.response;

import lt.swedbank.itacademy.ItAkaLeasingSystemBackEnd.beans.documents.BusinessCustomer;

/**
 * Created by Lukas on 2018-03-20.
 */
public class BusinessCustomerResponse extends CustomerResponse{

    private String companyID;

    private String companyName;

    public BusinessCustomerResponse() {
    }

    public BusinessCustomerResponse(BusinessCustomer businessCustomer) {
        super(businessCustomer.getId().toString(), businessCustomer.getEmail(),
                businessCustomer.getPhoneNumber(), businessCustomer.getAddress(),
                businessCustomer.getCustomerType().toString(), businessCustomer.getCountry(),
                businessCustomer.getUserID());
        this.companyID = businessCustomer.getCompanyID();
        this.companyName = businessCustomer.getCompanyName();
    }

    public String getCompanyID() {
        return companyID;
    }

    public void setCompanyID(String companyID) {
        this.companyID = companyID;
    }

    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }
}


package com.devappliance.springdocparamcustomizer.operationcustomizer;

import com.querydsl.core.types.Path;
import com.querydsl.core.types.PathMetadata;
import com.querydsl.core.types.dsl.EntityPathBase;
import com.querydsl.core.types.dsl.NumberPath;

import static com.querydsl.core.types.PathMetadataFactory.forVariable;

/**
 * @author Gibah Joseph
 * Email: gibahjoe@gmail.com
 * Mar, 2020
 **/
public class QChildEntity extends EntityPathBase<ChildEntity> {

    public static final QChildEntity childEntity = new QChildEntity("childEntity");
    private static final long serialVersionUID = -1184258693L;
    public final NumberPath<Long> id = createNumber("id", Long.class);

    public QChildEntity(String variable) {
        super(ChildEntity.class, forVariable(variable));
    }

    public QChildEntity(Path<? extends ChildEntity> path) {
        super(path.getType(), path.getMetadata());
    }

    public QChildEntity(PathMetadata metadata) {
        super(ChildEntity.class, metadata);
    }
}


package com.wechat.auth.service.impl;

import com.wechat.auth.dao.UserDao;
import com.wechat.auth.pojo.User;
import com.wechat.auth.service.UserService;
import net.sf.json.JSONObject;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * Created by 30825 on 2017/5/18.
 */
@Service
@Transactional
public class UserServiceImpl implements UserService {
    @Resource
    private UserDao userDao;

    @Override
    public User boundUser(JSONObject userInfo) {
        long count = userDao.getCount();
        System.out.println(count);

        //User user = userDao.findDistinctByOpenId(userInfo.getString("openid"));
        String nickName1 = userDao.findnickNameDistinctByOpenId(userInfo.getString("openid"));

        System.out.println(nickName1);
        //为空说明没有绑定使用账号密码条件进行绑定
        if(nickName1 == null){
            String nickName = userInfo.getString("nickname");
            String openId = userInfo.getString("openid");
            userDao.updateUser(nickName,openId);
        }
        return new User();
    }

}


package com.xqkj.baselibrary.weight;

import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;

import androidx.viewpager.widget.ViewPager;

public class NoScrollViewPager extends ViewPager {
    // 是否禁止 viewpager 左右滑动
    private boolean noScroll = true;

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

    public void setNoScroll(boolean noScroll) {
        this.noScroll = noScroll;
    }

    @Override
    public boolean onTouchEvent(MotionEvent arg0) {
        if (noScroll){
            return false;
        }else{
            return super.onTouchEvent(arg0);
        }
    }

    @Override
    public boolean onInterceptTouchEvent(MotionEvent arg0) {
        if (noScroll){
            return false;
        }else{
            return super.onInterceptTouchEvent(arg0);
        }
    }

    @Override
    public void setCurrentItem(int item) {
        super.setCurrentItem(item,false);
    }
}


package com.jade.shelton.weather_map.domain;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

@JsonIgnoreProperties(ignoreUnknown = true)
public class WeatherHourly {

	@JsonProperty("response")
	private ResponseHourly response;

	@JsonProperty("hourly_forecast")
	private List<HourlyForecast> hourlyForecast;

	private String url = "";

	WeatherHourly() {
	}

	WeatherHourly(String apiKey) {
		url += Weather.BASE_URL + apiKey + "/hourly/q/";
	}

	public String setParamsReturnUrl(String location) {
		String encodedUrl = null;
		try {
			encodedUrl = URLEncoder.encode(location, "UTF-8").replace("+", "%20");
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		}
		url += encodedUrl + ".json";
		return url;
	}

	public ResponseHourly getResponse() {
		return response;
	}

	public void setResponse(ResponseHourly input) {
		this.response = input;
	}

	public List<HourlyForecast> getHourlyForecast() {
		return hourlyForecast;
	}

	public void setHourlyForecast(List<HourlyForecast> input) {
		this.hourlyForecast = input;
	}

}


package com.gms.web.util;

import javax.servlet.http.HttpServletRequest;

import com.gms.web.command.Command;
import com.gms.web.factory.CommandFactory;

public class Separator {
	public static Command cmd=new Command();
	public static void init(HttpServletRequest request){
		/*String action=request.getParameter("action");

		String page=request.getParameter("page");
		System.out.println("action : "+action);
		String servletPath=request.getServletPath();
		 		System.out.println("servletPath :" + servletPath);
		String dir=servletPath.substring(1,servletPath.indexOf("."));
		 		System.out.println("directory: " + dir);
		 		System.out.println("page:"+ page);*/
		String servletPath=request.getServletPath();
		cmd=CommandFactory.createCommand(
				servletPath.substring(1,servletPath.indexOf(".")),
				request.getParameter("action"),
				request.getParameter("page"),
				request.getParameter("pageNumber"),
				request.getParameter("column"),
				request.getParameter("search"));

	}
}


package com.samplePojos;

public class TechFrameworks {
    private String name;
    private String developmentPhase;
    private Number version;

    public TechFrameworks(String name, String developmentPhase, Number version) {
        this.name = name;
        this.developmentPhase = developmentPhase;
        this.version = version;
    }

    public String getName() {
        return name;
    }

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

    public String getDevelopmentPhase() {
        return developmentPhase;
    }

    public void setDevelopmentPhase(String developmentPhase) {
        this.developmentPhase = developmentPhase;
    }

    public Number getVersion() {
        return version;
    }

    public void setVersion(Number version) {
        this.version = version;
    }

    @Override
    public String toString() {
        return "TechFrameworks{" +
                "name='" + name + '\'' +
                ", developmentPhase='" + developmentPhase + '\'' +
                ", version=" + version +
                '}';
    }
}


package de.kleindev.twitchbot.configuration;

import com.google.inject.Binder;
import com.google.inject.Module;

import java.io.File;

public class TwitchBotConfiguration extends Config implements Module {
    private File file;

    @Override
    public File getFile() {
        return file;
    }

    @ConfigPath(path = "application.logType", description = "LogTypes: NORMAL, DEBUG, TRACE")
    public String logType = "NORMAL";
//    @ConfigPath(path = "application.pluginsFolder")
//    public String pluginsFolder = "plugins";
    @ConfigPath(path = "application.logsFolder")
    public String logsFolder = "logs";
//    @ConfigPath(path = "application.connectionsFolder")
//    public String connectionsFolder = "connections";

    public TwitchBotConfiguration(File file){
        if (!file.getParentFile().exists())
            file.getParentFile().mkdirs();
        this.file = file;
        load();
    }

    @Override
    public void configure(Binder binder) {

    }
}


package de.coins2015.oscar1.bettingoddscrawler;

import java.util.Arrays;

import org.json.simple.JSONObject;

import com.mongodb.DB;
import com.mongodb.DBCollection;
import com.mongodb.DBObject;
import com.mongodb.MongoClient;
import com.mongodb.MongoCredential;
import com.mongodb.ServerAddress;
import com.mongodb.util.JSON;

public class MongoDBHandler {

    private MongoClient mongoClient;
    private MongoCredential mongoCredential;
    private DB db;

    public MongoDBHandler(String host, String port, String userName,
	    String database, String password) {
	this.mongoCredential = MongoCredential.createCredential(userName,
		database, password.toCharArray());

	this.mongoClient = new MongoClient(new ServerAddress(host),
		Arrays.asList(mongoCredential));
	this.db = mongoClient.getDB(database);
    }

    public void storeData(JSONObject data, String collection) {
	DBObject dbObject = (DBObject) JSON.parse(data.toJSONString());
	DBCollection dbCollection = db.getCollection(collection);
	dbCollection.insert(dbObject);
    }
}


package com.leyou.lmhitysu.search.controller;

import com.leyou.lmhitysu.common.PageResult;
import com.leyou.lmhitysu.search.model.Goods;
import com.leyou.lmhitysu.search.model.SearchRequest;
import com.leyou.lmhitysu.search.service.ISearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping(value = "elastic")
public class SearchController {
    @Autowired
    private ISearchService searchService;

    @RequestMapping(value = "page")
    public ResponseEntity<PageResult<Goods>> search(@RequestBody SearchRequest searchRequest){
        PageResult<Goods> list = this.searchService.searchGoods(searchRequest);
        if(list == null){
            return new ResponseEntity<>(HttpStatus.NOT_FOUND);
        }
        return ResponseEntity.ok(list);
    }
}


package uk.ac.ebi.atlas.utils;

import com.google.gson.Gson;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;

import javax.inject.Inject;

import java.util.Map;

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

@WebAppConfiguration
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:applicationContext.xml", "/dispatcher-servlet.xml"})
public class DBSolrStatusControllerIT {

    @Inject
    private DBSolrStatusController subject;

    @Test
    public void dbAndSolrStatus() throws Exception {
        String message = subject.dbAndSolrStatus();
        Map<String, String> status = new Gson().fromJson(message, Map.class);
        assertThat(status.get("DB"), is("UP"));
        assertThat(status.get("Solr"), is("UP"));
    }
}


package com.hjz.controller;

import com.hjz.model.StudentVo;
import com.hjz.service.NacosProviderFeignClient;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@Api(tags = "nacosProvider对外接口")
@RestController
@RequestMapping("/nconsumer")
public class ConsumerController {
    @Autowired
    private NacosProviderFeignClient nacosProviderFeignClient;

    @ApiOperation(value = "调用消费", notes = "通过feign调用nacos-provider接口")
    @GetMapping(value = "/nconsumerTest")
    public StudentVo nconsumerTest() {
        StudentVo vo = new StudentVo();
        vo.setAge(1);
        vo.setName("lalalala");
        vo.setId(1);

        StudentVo studentVo = nacosProviderFeignClient.getData(vo);
        return studentVo;
    }

}


package com.example.android.myapplication6;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.widget.ListView;

import java.util.ArrayList;

public class HistoricalPlaces extends AppCompatActivity {

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

        ArrayList<Location> historicalPlaces = new ArrayList<Location>();
        historicalPlaces.add(new Location(getString(R.string.benjamin), getString(R.string.benjamin_info), R.drawable.benjamin_house));
        historicalPlaces.add(new Location(getString(R.string.homesteadfarm), getString(R.string.homesteadfarm_info), R.drawable.homestead_farm));
        historicalPlaces.add(new Location(getString(R.string.lainghouse), getString(R.string.lainghouse_info), R.drawable.laing_house));

        LocationAdapter adapter = new LocationAdapter(this, historicalPlaces);
        ListView listView = (ListView) findViewById(R.id.list);
        listView.setAdapter(adapter);

    }
}


package io.pivotal.security.generator;

import io.pivotal.security.controller.v1.SshSecretParameters;
import io.pivotal.security.secret.SshKey;
import io.pivotal.security.util.CertificateFormatter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;

import java.security.KeyPair;
import java.security.interfaces.RSAPublicKey;

@Component
public class SshGenerator implements SecretGenerator<SshSecretParameters, SshKey> {

  @Autowired
  LibcryptoRsaKeyPairGenerator keyGenerator;

  @Override
  public SshKey generateSecret(SshSecretParameters parameters) {
    try {
      final KeyPair keyPair = keyGenerator.generateKeyPair(parameters.getKeyLength());
      String sshComment = parameters.getSshComment();
      String sshCommentMessage = StringUtils.isEmpty(sshComment) ? "" : " " + sshComment;

      String publicKey = CertificateFormatter.derOf((RSAPublicKey) keyPair.getPublic()) + sshCommentMessage;
      String privateKey = CertificateFormatter.pemOf(keyPair.getPrivate());

      return new SshKey(publicKey, privateKey);
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
}


import java.io.Serializable;

/**
 * Created by upadhyad on 7/28/2017.
 */
public class Employee implements Comparable, Serializable {

    private int empId;
    private String name;
    transient private double salary;

    public Employee(int empId, String name, double salary) {
        this.empId = empId;
        this.name = name;
        this.salary = salary;
    }

    public int getEmpId() {
        return empId;
    }

    public void setEmpId(int empId) {
        this.empId = empId;
    }

    public String getName() {
        return name;
    }

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

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }

    @Override
    public String toString() {
        return "Employee{" +
                "empId=" + empId +
                ", name='" + name + '\'' +
                ", salary=" + salary +
                '}';
    }

    @Override
    public int compareTo(Object O) {
        Employee emp = (Employee) O;
        return this.empId - emp.empId;

    }
}


# Host key가 변경되어 SSH 접속에 실패 할 때

AWS 내 새로운 Instance를 생성하여 기존의 key pair를 적용하고,

Elastic IPs를 적용하여 public-dns가 변경되었을 때 (Elastic IP 적용시 주의 메시지가 출력됨)

``` sh
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
[private-key-fingerprints-value].
Please contact your system administrator.
Add correct host key in /Users/Kitchu/.ssh/known_hosts to get rid of this message.
Offending RSA key in /Users/Kitchu/.ssh/known_hosts:6
RSA host key for [public-dns-value] has changed and you have requested strict checking.
Host key verification failed.
```

이렇게 혹시 공격받은거 아니냐고 징징댐;

## 해결 [[참고](http://visu4l.tistory.com/343)]

아래의 커맨드를 실행해 새롭게 private-key를 등록한다.

``` sh
ssh-keygen -R [public-dns-value]
```

해결이 되지 않는다면 링크를 한 번 더 참고하여 저장된 파일을 지워보도록 하자.


package org.nico.cat.server;

import java.io.IOException;
import java.net.Socket;

import org.nico.cat.server.processer.ServerProcesser;
import org.nico.cat.server.processer.entity.ProcessResult;
import org.nico.cat.server.response.buddy.ResponseBuddy;
import org.nico.log.Logging;
import org.nico.log.LoggingHelper;

public class ServerEntrance extends Thread{

	private static Logging logging = LoggingHelper.getLogging(ServerProcesser.class);

	private ResponseBuddy reponseBuddy;

	private Socket client;

	public ServerEntrance(Socket client) {
		this.client = client;
		this.reponseBuddy = new ResponseBuddy(client);
	}

	@Override
	public void run() {
		try{
			ProcessResult result = new ServerProcesser(client).process();
			reponseBuddy.push(result.getResponse());
		}catch(Throwable e){
			reponseBuddy.SimpleFailurePush(e);
		}finally{
			if(client != null){
				try {
					client.close();
				} catch (IOException e) {
					logging.error(e.getMessage());
				}
			}
		}
	}
}


package com.enjoy.sample.user.model.dto;

import com.enjoy.sample.user.model.entity.UserInfo;

import java.io.Serializable;

public class UserInfoDto implements Serializable {
    private Long id;
    private String userCode;
    private String userName;

    public UserInfoDto() {
    }

    public UserInfoDto(Long id, String userCode, String userName) {
        this.id = id;
        this.userCode = userCode;
        this.userName = userName;
    }

    public UserInfoDto(UserInfo userInfo){
        this.id=userInfo.getId();
        this.userCode=userInfo.getUserCode();
        this.userName=userInfo.getUserName();
    }

    public Long getId() {
        return id;
    }

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

    public String getUserCode() {
        return userCode;
    }

    public void setUserCode(String userCode) {
        this.userCode = userCode;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }
}


import java.util.ArrayList;

public class Consumer implements Runnable {

    private ArrayList<Integer> arrayList;
    private String threadName;

    public Consumer(ArrayList<Integer> arrayList, String threadName){

        this.arrayList = arrayList;
        this.threadName = threadName;

        Thread t = new Thread(this);
        t.start();
    }

    @Override
    public void run() {

        while(true){

            synchronized (arrayList){

                while(arrayList.isEmpty()){
                    try {
                        arrayList.wait();
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }

                int variable = arrayList.get(0);
                System.out.println("Value extracted: " + variable + "by " + this.threadName);
                arrayList.remove(0);

                try{
                    Thread.sleep(500);
                }catch (InterruptedException e){
                    e.printStackTrace();
                }

                arrayList.notifyAll();
            }

        }

    }
}


package com.sevensummits.jwt.demo.global.jpa;

import com.sevensummits.jwt.demo.user.ApplicationUser;
import com.sevensummits.jwt.demo.user.ApplicationUserService;
import org.springframework.data.domain.AuditorAware;
import org.springframework.lang.NonNull;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;

import java.util.Optional;

public class AuditorAwareImpl implements AuditorAware<ApplicationUser> {

    private final ApplicationUserService applicationUserService;

    public AuditorAwareImpl(final ApplicationUserService applicationUserService) {
        this.applicationUserService = applicationUserService;
    }

    @Override
    @NonNull
    public Optional<ApplicationUser> getCurrentAuditor() {
        final Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
        return Optional.of(applicationUserService.findByUsername(authentication.getName()));
    }

}


## Journalctl Quick Cheatsheet

- systemd-journald system service is responsible for collecting and storing log data. It creates and maintains
structured, indexed journals based on logging information that is received from a variety of sources.
- One of the main changes in journald was to replace simple plain text log files with a special file format optimized for log messages. This file format allows system administrators to access relevant messages more efficiently. It also brings some of the power of database-driven centralized logging implementations to individual systems.
- You are supposed to use the `journalctl` command to query log files.

### Cheatsheets

- sshd logs : `journalctl _COMM=sshd`
- sshd logs in json format : `journalctl _COMM=sshd -o json-pretty`
- filter by date range : `journalctl --since "2015-01-10" --until "2015-01-11 03:00"`
- another filter by date range example : `journalctl --since 09:00 --until "1 hour ago"`
- logs since boot : `journalctl -b`
- follow logs : `journalctl -f`
- disk usage of all journal files : `journalctl --disk-usage`
- Reduce disk usage below specified size : `journalctl --vacuum-size=1G`

Source : [htop explained](https://peteris.rocks/blog/htop/)


package com.example.bismillahyukbisayuk;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
//import android.support.v7.widget.Toolbar;
import androidx.appcompat.widget.Toolbar;

import androidx.appcompat.app.AppCompatActivity;

import com.google.firebase.auth.FirebaseAuth;

public class ProfileActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_profile);
        Toolbar toolbar = findViewById(R.id.toolbar_layout);
        setSupportActionBar(toolbar);

        TextView logout = findViewById(R.id.backtohome);
        logout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                FirebaseAuth.getInstance().signOut();
                startActivity(new Intent(ProfileActivity.this, LoginActivity.class)
                        .setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP));
            }
        });
    }
}


package com.flc.bankpda.modules.dopackage;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;

import com.flc.bankpda.R;
import com.flc.bankpda.base.BaseMvpActivity;

public class PackageTypeChooseActivity extends BaseMvpActivity {

    private ImageView iv_package2;
    private ImageView iv_package1;

    @Override
    protected int getLayoutId() {
        return R.layout.activity_package_type_choose;
    }

    @Override
    protected void init(Bundle savedInstanceState) {

        iv_package2 = ((ImageView) findViewById(R.id.iv_package2));
        iv_package1 = ((ImageView) findViewById(R.id.iv_package1));

        // 点击一代包
        findViewById(R.id.rl_package1).setOnClickListener(v -> {
            iv_package1.setVisibility(View.VISIBLE);
            iv_package2.setVisibility(View.GONE);
        });
        // 点击二代包
        findViewById(R.id.rl_package2).setOnClickListener(v -> {
            iv_package1.setVisibility(View.GONE);
            iv_package2.setVisibility(View.VISIBLE);

        });

        findViewById(R.id.tv_confirm).setOnClickListener(v -> startActivity(new Intent(mContext,PackageActivity.class)));
    }
}


package com.support.android.vkclient.domain.dto;

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

import java.util.List;

public class Photo {

    @SerializedName("id")
    @Expose
    private int id;

    @SerializedName("sizes")
    @Expose
    private List<PhotoSize> sizes = null;

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

    @SerializedName("date")
    @Expose
    private int date;

    public int getId() {
        return id;
    }

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

    public List<PhotoSize> getSizes() {
        return sizes;
    }

    public void setSizes(List<PhotoSize> sizes) {
        this.sizes = sizes;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public int getDate() {
        return date;
    }

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


# Gulp starter config

## Before working:

1. Create project directory [dir_folder].
2. Install Node.js and npm:
    - Inside the dir, type ```npm init``` and compose the package.json by your data;
    - To install any one package ```npm [i or install] [--save or --save-dev] [package repo or package alias]```;
    - To remove -//- ```npm [rm or remove] [--save or --save-dev] [package repo or package alias]```;
3. Initialize empty git repo, type ```git init```;
4.

## Working with vcs [version control system]:

1. Type ```git add .``` to set all changed files to register;
2. Type ```git commit -m '[you comment of last commit]'```
3. Type ```git push origin [name of your current branch, possible it is [master]]```.
Looks like ```git push origin master```;
4. Type ```git pull origin [name of branch, possible it cout be master]```;
Looks like ```git pull origin master```;

- To create new branch ```git branch [name of your future branch]```;
- To checkout to new one ```git checkout [name of your existing branch]```;

## Working with gulp:

1. for dev ```gulp``` or ```gulp develop```;
2. for buld ```gulp build```;


package kvm;

import utils.FileUtils;

import java.io.BufferedWriter;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;

// step 1
public class InstallKVM {

    private static final String KVM_INSTALL_SCRIPT = "KVM-install.sh";

    protected static void createInstallScript(String root) {
        try {
            Path installScriptPath = Paths.get(root + KVM.KVM_ROOT_FOLDER + KVM.STEP_1_INSTALL_KVM_FOLDER + KVM_INSTALL_SCRIPT);
            BufferedWriter bufferedWriter = FileUtils.createAndWriteToFile(installScriptPath);

            FileUtils.writeLine(bufferedWriter, "#!/bin/bash");
            FileUtils.writeLine(bufferedWriter, "sudo apt-get -qq update");
            FileUtils.writeLine(bufferedWriter, "sudo apt-get -qq -y install qemu-kvm libvirt-bin virtinst bridge-utils");

            bufferedWriter.flush();
            bufferedWriter.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}


import com.sun.org.apache.xalan.internal.xsltc.dom.SimpleResultTreeImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import util.PropertiesReader;

import javax.xml.soap.SAAJResult;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * Created by pgupta10 on 27/08/16.
 */
public class SimpleHttpServer {
    private static final Logger LOGGER = LoggerFactory.getLogger(SimpleHttpServer.class);

    public static void main(String[] args) {
        try (
                ServerSocket serverSocket = new ServerSocket(PropertiesReader.getHttpPort());
                Socket clientSocket = serverSocket.accept();
                PrintWriter out =
                        new PrintWriter(clientSocket.getOutputStream(), true);
                BufferedReader in = new BufferedReader(
                        new InputStreamReader(clientSocket.getInputStream()));
        ) {
            String inputLine;
            while ((inputLine = in.readLine()) != null) {
                LOGGER.debug(inputLine);
            }
        }catch (Exception e){
            LOGGER.error(e.getMessage());
        }

    }
}


package com.avijit.addressbook.api;

import com.avijit.addressbook.common.Constants;

import java.util.concurrent.TimeUnit;

import okhttp3.OkHttpClient;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

public class RetrofitClient {

    private static RetrofitClient retrofitClient;
    private Retrofit retrofit;

    private RetrofitClient() {

        final OkHttpClient okHttpClient = new OkHttpClient.Builder()
                .readTimeout(Constants.READ_TIME_OUT, TimeUnit.SECONDS)
                .connectTimeout(Constants.CONNECT_TIME_OUT, TimeUnit.SECONDS)
                .build();

        retrofit = new Retrofit.Builder()
                .baseUrl(Constants.BASE_URL)
                .addConverterFactory(GsonConverterFactory.create())
                .client(okHttpClient)
                .build();
    }

    public static synchronized RetrofitClient getInstance() {
        if (retrofitClient == null)
            retrofitClient = new RetrofitClient();

        return retrofitClient;
    }

    public ContactApi getApi() {
        return retrofit.create(ContactApi.class);
    }
}


package com.yangtze.ieatbyte.yangtzenews;

import android.util.SparseArray;
import android.view.View;
import android.view.ViewGroup;

import java.util.HashMap;

/**
 * Invalid. Just as singleton model.
 */
public class HomeFragmentViewCache {

    HashMap<String, ViewGroup> mCache;

    private static class HomeFragmentViewCacheLoader {
        private static HomeFragmentViewCache INSTANCE = new HomeFragmentViewCache();
    }

    private HomeFragmentViewCache() {
        if (HomeFragmentViewCacheLoader.INSTANCE != null) {
            throw new IllegalStateException("Already instantiated");
        }
        mCache = new HashMap<String, ViewGroup>();
    }

    public static HomeFragmentViewCache getInstance() {
        return HomeFragmentViewCacheLoader.INSTANCE;
    }

    public void put(String key, ViewGroup viewGroup) {
        mCache.put(key, viewGroup);
    }

    public ViewGroup get(String key) {
        return mCache.get(key);
    }

    public void remove(String key) {
        mCache.remove(key);
    }

    public void clear() {
        mCache.clear();
    }
}


package org.facosta.springsurbtcplots.HighChart_Integration.rangeSelector;

public class Button
{
    private String type;
    private int count;
    private String text;

    public Button(Type type, int count, String text)
    {
        this.type = type.getTypeStr();
        this.count = count;
        this.text = text;
    }

    public Button(Type type, int count)
    {
        this(type, count, type.toString());
    }

    public Button(Type type)
    {
        this(type, 1, type.toString());
    }

    public String getType()
    {
        return type;
    }

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

    public int getCount()
    {
        return count;
    }

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

    public String getText()
    {
        return text;
    }

    public void setText(String text)
    {
        this.text = text;
    }

    @Override
    public String toString()
    {
        return "Button{" +
                "type=" + type +
                ", count=" + count +
                ", text='" + text + '\'' +
                '}';
    }
}


package alura_selenium;

import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;

public class TesteAutomatizado {

	public static void main (String[] args) {

	FirefoxDriver driver;

	// por ser uma nova versão preciso setar o webdriver
	// System.setProperty("webdriver.firefox.marionette", "C:\\Users\\12129\\OneDrive - Underwriters Laboratories\\11.Test Automation\\Selinium\\geckodriver-v0.19.1-win64\\geckodriver.exe");
	System.setProperty("webdriver.gecko.driver", "C:\\Users\\afilipem\\Documents\\Instaladores\\Selenium\\geckodriver-v0.19.1-win64\\geckodriver.exe");
	driver = new FirefoxDriver();

	// acessa o site do google
	driver.get("http://www.google.com.br/");

	// digita no campo com nome "q" do google
	WebElement campoDeTexto = driver.findElement(By.name("q"));
	campoDeTexto.sendKeys("Caelum");

	// submete o form
	campoDeTexto.submit();

/*	public static void main(String[] args) {

		TesteAutomatizado myObj = new TesteAutomatizado();
		myObj.invokeBrowser();

	}*/

	}
}


package theandroidguy.bart.firelink.fragment;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import theandroidguy.bart.firelink.R;

public class RecievedFragment extends Fragment {

    private static final String TAG = RecievedFragment.class.getSimpleName();
    //saved devices json
    private final static String DEVICES = "devices.txt";

    public RecievedFragment() {
        // Required empty public constructor
    }

    public static RecievedFragment newInstance(String param1, String param2) {
        RecievedFragment fragment = new RecievedFragment();
        Bundle args = new Bundle();
        fragment.setArguments(args);
        return fragment;
    }

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

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View view = inflater.inflate(R.layout.fragment_recieved, container, false);

        return view;
    }

}


package Vista;

import javax.swing.*;
import java.awt.*;

public class VentanaGenerica {

    public static void ventanaMostrar(String titulo,String texto){

        JDialog vent = new JDialog();

        vent.setTitle(titulo);
        Container contMostrar= vent.getContentPane();
        contMostrar.setLayout(new BoxLayout(contMostrar, BoxLayout.Y_AXIS));

        JLabel textoM = new JLabel(texto);
        vent.getContentPane().add(textoM);
        vent.setPreferredSize(new Dimension(400,300));
        vent.pack();
        vent.setVisible(true);
    }

    public static void ventanaMostrarLista(String titulo, String[] datos){
        JDialog vent = new JDialog();
        vent.setTitle(titulo);
        Container cont = vent.getContentPane();
        cont.setLayout(new BoxLayout(cont, BoxLayout.Y_AXIS));
        JList lista = new JList(datos);
        vent.getContentPane().add(lista);
        vent.setPreferredSize(new Dimension(400,300));
        vent.pack();
        //vent.setLayout(new FlowLayout());
        vent.setVisible(true);

    }

}


package de.tuberlin.aot.thesis.slienau.orchestrator;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import de.tuberlin.aot.thesis.slienau.orchestrator.models.NodeRedFlow;

import java.io.IOException;

public class NodeRedFlowDatabase {
    private static final NodeRedController flowDatabaseInstance = new NodeRedController("flowDatabaseInstance", "localhost", 2880);
    private static NodeRedFlowDatabase instance;

    private NodeRedFlowDatabase() {
    }

    public static synchronized NodeRedFlowDatabase getInstance() {
        if (NodeRedFlowDatabase.instance == null)
            NodeRedFlowDatabase.instance = new NodeRedFlowDatabase();
        return NodeRedFlowDatabase.instance;
    }

    public NodeRedFlow getFlowByName(String flowName) throws IOException {
        JsonNode flow = flowDatabaseInstance.getFlowByName(flowName);
        ((ObjectNode) flow).put("disabled", false);
        return new NodeRedFlow(flowName, flow);
    }
}


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

public class SymbolTable {

    private String curScope;
    private String curVarType;
    private String symbolId;

    HashMap<String, SymbolObject> symbol = new HashMap<String, SymbolObject>();

    public SymbolTable() {
    }
    public SymbolTable(String newScope) {
	this.curScope = newScope;
    }

    public boolean isLegal(SymbolObject newSymbol) {
	symbolId = newSymbol.getId();
	if(symbol.containsKey(symbolId))
	    return false;
	else
	    return true;
    }

    public HashMap<String, SymbolObject> getSymbols() {
	return symbol;
    }
    public SymbolObject getSymbol(String symbolName) {
	return symbol.get(symbolName);
    }
    public void addToTab(SymbolObject newSymbol) {
	symbol.put(newSymbol.getId(), newSymbol);
    }
    public void setScopeId(String id) {
	curScope = id;
    }
    public String getScopeId() {
	return curScope;
    }
    public void setVarType(String type) {
	curVarType = type;
    }
    public String getVarType() {
	return curVarType;
    }
    public void printErr() {
	System.out.println("DECLARATION ERROR " + symbolId);
    }
}


package pt.mac.demo.entities;

import java.util.Collection;
import java.util.Collections;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

/**
 *
 * @author mario
 * @since 23/10/2021
 */
public class CustomUserDetails implements UserDetails {

	private static final long serialVersionUID = -2495228964187111887L;

	private User entity;

	public CustomUserDetails(User user) {
		this.entity = user;
	}

	@Override
	public String getUsername() {
		return this.entity.getUsername();
	}

	@Override
	public String getPassword() {
		return this.entity.getPassword();
	}

	@Override
	public Collection<? extends GrantedAuthority> getAuthorities() {
		return Collections.<GrantedAuthority>singletonList(new SimpleGrantedAuthority("User"));
	}

	@Override
	public boolean isAccountNonExpired() {
		return true;
	}

	@Override
	public boolean isAccountNonLocked() {
		return true;
	}

	@Override
	public boolean isCredentialsNonExpired() {
		return true;
	}

	@Override
	public boolean isEnabled() {
		return true;
	}

	public User getEntity() {
		return this.entity;
	}
}


package org.example.server.handler;

import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;

import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.Date;

public class FirstServerHandler extends ChannelInboundHandlerAdapter {

    /**
     * 在连接中读取数据.
     * @param ctx
     * @param msg
     */
    @Override
    public void channelRead(ChannelHandlerContext ctx, Object msg) {
        ByteBuf byteBuf = (ByteBuf) msg;
        System.out.println(new Date() + ": 服务器读取到数据:" + byteBuf.toString(Charset.defaultCharset()));
        ctx.channel().writeAndFlush(getByteBuf(ctx));
    }

    private ByteBuf getByteBuf(ChannelHandlerContext ctx) {
        ByteBuf byteBuf = ctx.alloc().buffer();
        byte[] bytes = "hello, this is server firstHandler message".getBytes(StandardCharsets.UTF_8);
        byteBuf.writeBytes(bytes);
        return byteBuf;
    }
}


package com.indivisible.twistedserveradmin.commands;

import java.util.List;

public class RestartCmd
        implements ICmd
{

    //// Help Strings

    private static final String NAME = "restart";

    private static final String HELP_SHORT = "Restarts a running Sever. (Starts if offline)";
    private static final String HELP_LONG = "Usage :: admin restart <nick>\n"
            + "    Restarts a running server (or starts if offline).\n"
            + "    Type 'admin online' to see a list of running servers";

    //// constructor

    public RestartCmd()
    {}

    //// Command methods

    public String getName()
    {
        return NAME;
    }

    public boolean matchName(String test)
    {
        return NAME.equals(test);
    }

    public String getShortHelp()
    {
        return HELP_SHORT;
    }

    public String getLongHelp(List<String> args)
    {
        return HELP_LONG;
    }

    //// invoke

    public boolean invoke(List<String> args)
    {
        return false;
    }

}


package com.example.jackypeng.swangyimusic.rx.converter;

import com.google.gson.Gson;

import org.json.JSONException;
import org.json.JSONObject;

import java.io.IOException;
import java.lang.reflect.Type;

import okhttp3.ResponseBody;
import retrofit2.Converter;

public class ExGsonResponseBodyConverter<T> implements Converter<ResponseBody, T> {

    private final Gson gson;
    private final Type type;

    public ExGsonResponseBodyConverter(Gson gson, Type type) {
        this.gson = gson;
        this.type = type;

    }

    /**
     * 进行解析预处理操作
     *
     * @param responseBody
     * @return
     * @throws IOException
     */
    @Override
    public T convert(ResponseBody responseBody) throws IOException {
        String value = responseBody.string();
        try {
            new JSONObject(value);
            return gson.fromJson(value, type);
        } catch (JSONException e) {
            e.printStackTrace();
            throw new com.alibaba.fastjson.JSONException(value);
        }
    }
}


package com.project.realestate.entity;

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

@Entity
public class District {
    private int id;
    private String districtName;

    @Id
    @Column(name = "id")
    public int getId() {
        return id;
    }

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

    @Basic
    @Column(name = "district_name")
    public String getDistrictName() {
        return districtName;
    }

    public void setDistrictName(String districtName) {
        this.districtName = districtName;
    }

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

        District district = (District) o;

        if (id != district.id) return false;
        if (districtName != null ? !districtName.equals(district.districtName) : district.districtName != null)
            return false;

        return true;
    }

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


package com.sxr.com.mainmodule.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.sxr.com.mainmodule.R;

/**
 * Created by DELL on 2017/11/26.
 */

public class DetailTitleView extends RelativeLayout {

    private TextView mTitleView;
    private TextView mStateView;

    public DetailTitleView(Context context, AttributeSet attrs) {
        super(context, attrs);

        LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        inflater.inflate(R.layout.view_detail_title, this);

        mTitleView = (TextView) getChildAt(0);
        mStateView = (TextView) getChildAt(1);
    }

    public TextView getTitleView() {
        return mTitleView;
    }

    public void setTitleView(TextView titleView) {
        mTitleView = titleView;
    }

    public TextView getStateView() {
        return mStateView;
    }

    public void setStateView(TextView stateView) {
        mStateView = stateView;
    }
}


GiniVision SDK for iOS Example App
======================================

This is an example app for the GiniVision SDK for iOS. See
http://developer.gini.net/ginivision-ios/html/index.html for
further documentation.

Before You Can Run The App
--------------------------

In order to use the Gini SDK you have to edit the ``GiniDempoAppDelegate.m`` file and replace the values of ``your_gini_client_id`` and ``your_gini_client_secret`` in ``application:didFinishLaunchingWithOptions:`` with valid credentials. Please send an email to technical-support@gini.net if you haven't received credentials yet.

For the Gini Vision Library you have to enter valid credentials into the ``pod-install-example.sh`` file. Afterwards rename it to ``pod-install.sh``.

Build & Install the App
-----------------------

Go into the project directory and enter:

```
	$ sh pod-install.sh
```

This will install all dependencies.
If you haven't used CocoaPods before follow the guide on [cocoapods.org](https://cocoapods.org/).

After installing you can run the Gini Demo app.


package stu.com.testretrofit.network;

import retrofit2.Retrofit;
import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;
import stu.com.testretrofit.commons.Constans;

/**
 * Created by xmg on 2016/12/12.
 */

public class NetWorkClient {
    private static NetWorkApi netWorkApi;

    public NetWorkClient(){

    }

    public void init(){
        if (netWorkApi == null) {
            Retrofit retrofit = new Retrofit.Builder()
                    //添加基地址
                    .baseUrl(Constans.BASE_URL)
                    //添加RxJava回调方式
                    .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
                    //添加一个Gson转换工厂
                    .addConverterFactory(GsonConverterFactory.create())
                    .build();
            netWorkApi = retrofit.create(NetWorkApi.class);
        }
    }

    public static NetWorkApi getSnackApi() {
        return netWorkApi;
    }
}


package com.grubtech.model;

public class Grid {

    private DirectionType[][] plateau;

    private final int upperRightX;

    private final int upperRightY;

    private Point activePoint;

    private DirectionType activeDirection;

    public Grid(int upperRightX, int upperRightY) {
        this.upperRightX = upperRightX;
        this.upperRightY = upperRightY;
        plateau = new DirectionType[upperRightX+1][upperRightY+1];
    }

    public Point getActivePoint() {
        return activePoint;
    }

    public void setActivePoint(Point activePoint) {
        this.activePoint = activePoint;
    }

    public void setPlateau(DirectionType[][] plateau) {
        this.plateau = plateau;
    }

    public DirectionType[][] getPlateau() {
        return plateau;
    }

    public DirectionType getActiveDirection() {
        return activeDirection;
    }

    public void setActiveDirection(DirectionType activeDirection) {
        this.activeDirection = activeDirection;
    }

    public int getUpperRightX() {
        return upperRightX;
    }

    public int getUpperRightY() {
        return upperRightY;
    }
}


package com.example.gif_app.DataBase;

import androidx.room.TypeConverter;

import com.Object.Analytics;
import com.Object.Images;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import java.lang.reflect.Type;

class Converters {

    @TypeConverter
    public static String StringfromImages(Images images) {
        Gson gson = new Gson();
        String json = gson.toJson(images);
        return json;
    }

    @TypeConverter
    public static Images ImagesfromString(String string){
        Type Images = new TypeToken<Images>(){}.getType();
        return new Gson().fromJson(string, Images);
    }

    @TypeConverter
    public static String StringfromAnalyctics(Analytics analytics) {
        Gson gson = new Gson();
        String json = gson.toJson(analytics);
        return json;
    }

    @TypeConverter
    public static Analytics AnalyticsfromString(String string){
        Type Analytics = new TypeToken<Analytics>(){}.getType();
        return new Gson().fromJson(string, Analytics);
    }

}


package com.tchepannou.uds.dto;

import com.google.common.base.Preconditions;
import com.tchepannou.uds.domain.Permission;

public class PermissionResponse {
    //-- Attributes
    private final long id;
    private final String name;

    //-- Constructor
    private PermissionResponse(Builder builder){
        Permission permission = builder.permission;
        this.id = permission.getId();
        this.name = permission.getName();
    }

    //-- Getter/Setter
    public long getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public static class Builder {
        private Permission permission;

        public PermissionResponse build () {
            Preconditions.checkState(permission != null, "permission is not set");

            return new PermissionResponse(this);
        }

        public Builder withPermission (final Permission permission) {
            this.permission = permission;
            return this;
        }
    }
}


package filter;

import constant.ServletURL;

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 = {"/settings.jsp", "/myMovies.jsp", "/addToMyMovies.jsp", "/settings", "/myMovies", "/addToMyMovies", "/setWatched"})
public class UserFilter 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("userCredentials") != null) {
            filterChain.doFilter(request, response);
        } else {
            response.sendRedirect(ServletURL.LOG_IN.getUrl());
        }

    }

    @Override
    public void destroy() {

    }
}


package com.practice.aopAnnotations;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

@Configuration
@ComponentScan("com.practice.aopAnnotations")
@EnableAspectJAutoProxy(proxyTargetClass = true)
public class Demo {

	public static void main(String[] args) {
		try {
			AnnotationConfigApplicationContext appContext = new AnnotationConfigApplicationContext(Demo.class);
			OpenDoor openDoor = (OpenDoor) appContext.getBean("openDoorImpl");
			System.out.println(openDoor.getClass().getName());
			openDoor.openDoorWithKey(100);

			CloseDoor closeDoor = (CloseDoor) appContext.getBean("closeDoorImpl");
			closeDoor.closeDoorWithName("Lakshmi");
			System.out.println(closeDoor.getClass().getSimpleName());

			appContext.close();

		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}


package com.example.android.bakingapp.fragments;

import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.example.android.bakingapp.R;

public class InstructionFragment extends Fragment {

    public InstructionFragment() {
    }

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {

        View rootView = inflater.inflate(R.layout.fragment_instruction, container, false);

        Bundle instruction = getArguments();
        if (instruction != null) {
            String instructionString = instruction.getString("Instruction");
            TextView textView = rootView.findViewById(R.id.instruction_text_view);
            textView.setText(instructionString);
        }

        return rootView;
    }
}


package com.gongdel.springbootjpa.repository.note;

import com.gongdel.springbootjpa.domain.note.Note;
import org.junit.After;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import static org.assertj.core.api.AssertionsForClassTypes.assertThat;

@RunWith(SpringRunner.class)
@SpringBootTest
public class NoteTest {

    @Autowired
    private NoteRepository noteRepository;

    @After
    public void cleanup() {
        noteRepository.deleteAll();
    }

    @Test
    public void note_등록() {
        // given
        Note note = new Note();
        note.setTitle("테스트 타이틀");
        note.setContent("테스트 내용");

        // when
        noteRepository.save(note);

        // then
        Note testEntity = noteRepository.findAll().get(0);
        assertThat(testEntity.getTitle()).isEqualTo(note.getTitle());
        assertThat(testEntity.getContent()).isEqualTo(note.getContent());

    }
}


package lk.ijse.royal.main;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.scene.paint.Color;
import javafx.stage.Stage;
import javafx.stage.StageStyle;

import java.io.IOException;

public class AppInitlizer extends Application {

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

    @Override
    public void start(Stage primaryStage) throws IOException {
        Parent root = FXMLLoader.load(this.getClass().getResource( "../view/StudentForm.fxml"));
        Scene scene=new Scene(root, Color.TRANSPARENT);
        primaryStage.setScene(scene);
        primaryStage.setResizable(false);
        primaryStage.initStyle(StageStyle.DECORATED);
        //title Icon Change
        primaryStage.getIcons().add( new Image(getClass().getResourceAsStream("../resource/icon1.png")));

        primaryStage.centerOnScreen();
        primaryStage.show();
    }
}


package com.db.exporter.beans;

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

/**
 * Represents a database.
 *
 */

public class Database {

	private String databaseName;
	private List<Table> tables = new ArrayList<Table>();
	private Map<String, List<String>> dataMap;

	/**
	 * @return the tables
	 */
	public List<Table> getTables() {
		return tables;
	}

	public void addTable(Table table)
    {
        if (table != null)
        {
            tables.add(table);
        }
    }

	/**
	 * @param tables the tables to set
	 */
	public void setTables(List<Table> tables) {
		this.tables = tables;
	}

	/**
	 * @return the databaseName
	 */
	public String getDatabaseName() {
		return databaseName;
	}

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

	/**
	 * @return the dataMap
	 */
	public Map<String, List<String>> getDataMap() {
		return dataMap;
	}

	/**
	 * @param dataMap the dataMap to set
	 */
	public void setDataMap(Map<String, List<String>> dataMap) {
		this.dataMap = dataMap;
	}

}


package com.brandonmanson.services;

import com.brandonmanson.models.SlackRequest;
import io.keen.client.java.KeenClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

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

/**
 * Created by brandonmanson on 3/29/17.
 */
@Service
public class AnalyticsReportingService {
    @Value("${keen.project.id}")
    private String projectId;

    @Value("${keen.write.key}")
    private String writeKey;

    @Value("${swaggy.dev.channel.id}")
    private String swaggyDevChannelId;

    @Value("${analytics.stream.id}")
    private String streamId;

    public void track(SlackRequest request) {
        if (!request.getChannelId().equals(swaggyDevChannelId))
        {
            Map<String, Object> event = new HashMap<String, Object>();
            event.put("channel", request.getChannelId());
            event.put("team", request.getTeamId());
            KeenClient.client().addEvent(streamId, event);
        }
    }

}


package com.cooksys.ftd.socialmedia.controller;

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

import com.cooksys.ftd.socialmedia.service.ValidateService;

@RestController
public class ValidateController {

	private ValidateService validateService;

	@Autowired
	public ValidateController(ValidateService validateService) {
		super();
		this.validateService = validateService;
	}

	//@GetMapping("validate/tag/exists/{label}")

	@GetMapping("validate/username/available/@{username}")
	public boolean usernameAvailable(@PathVariable("username") String username) {
		return !this.validateService.usernameExists(username);
	}

	@GetMapping("validate/username/exists/@{username}")
	public boolean usernameExists(@PathVariable("username") String username) {
		return this.validateService.usernameExists(username);
	}

}


package com.example.poke.pokeApi.models.ExternalApi;

import com.fasterxml.jackson.annotation.JsonAlias;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

@JsonIgnoreProperties(ignoreUnknown = true)
public class PokemonApiOther {
    //variables
    @JsonAlias("dream_world")
    private PokemonApiPhoto dreamWorld;
    @JsonProperty("official-artwork")
    private PokemonApiPhoto officialArtwork;

    //empty constructor
    public PokemonApiOther(){

    }

    //constructor
    public PokemonApiOther(PokemonApiPhoto dreamWorld, PokemonApiPhoto officialArtwork){
        this.dreamWorld = dreamWorld;
        this.officialArtwork = officialArtwork;
    }

    //setters
    public void setDreamWorld(PokemonApiPhoto value){
        this.dreamWorld = value;
    }

    public void setOfficialArtWork(PokemonApiPhoto value){
        this.officialArtwork = value;
    }

    //getters
    public PokemonApiPhoto getDreamWorld(){
        return this.dreamWorld;
    }

    public PokemonApiPhoto getOfficialArtWork(){
        return this.officialArtwork;
    }

}


package xbl.sample.android.layers;

import android.graphics.Color;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;

import xbl.sample.android.MainActivity;
import xbl.sample.android.R;
import xbl.sample.android.views.MenuView;

public class SocialGroupViewLayer
{
    private static final String TAG = "Social Group View Layer";

    public native void InitializeNativeVars();

    private MainActivity m_activity;

    public SocialGroupViewLayer(MainActivity activity)
    {
        m_activity = activity;

        InitializeNativeVars();
    }

    public void Update(double dt)
    {

    }

    public void show(LinearLayout layout)
    {
        // Bind Menu Button
        {
            Button buttonMenuBack = m_activity.findViewById(R.id.button_MenuBack);
            buttonMenuBack.setText(R.string.button_socialGroupsMenu);
            buttonMenuBack.setOnClickListener(new View.OnClickListener()
            {
                public void onClick(View v)
                {
                    m_activity.menuView.changeLayer(MenuView.MVL_SOCIAL_GROUPS);
                }
            });

            buttonMenuBack.setVisibility(View.VISIBLE);
        }
    }
}


## Project Types

nwb supports creation and development of the following project types:

**React apps** - React web applications.

**React component modules** - reusable React components which will be published to npm.

The React component template includes a React demo app in `demo/src/`.

**Web apps** - web applications which don't use React.

**Web modules** - "web module" is just a shorter way of saying "a module which will be published to npm and is expected to be able to run in a browser as a dependency of a webapp"... except we just had to say that anyway,

All project templates are pre-configured to:

* have Git ignore built resources
* run their tests on [Travis CI](https://travis-ci.org/), with code coverage results posted to [codecov.io](https://codecov.io/) and [coveralls](https://coveralls.io)
* publish to npm appropriately:
  * apps have `private: true` set by default so they can't be published to npm by accident
  * components and web modules will only publish source and ES5/UMD builds to npm

Each template also comes with a working, minimal unit test to get you started.


package top.toptimus.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.toptimus.entity.DataModelEntity;
import top.toptimus.meta.TalendMetaInfo;

import java.io.IOException;
import java.util.List;

@Service
public class DataModelRuntimeService {
    @Autowired
    private DataModelEntity dataModelEntity;

    /**
     * 运行时调用，用来获取关联键，用来做关联查询，之前的SELECT类型逻辑
     *
     * @param x_pk_x_talend_id talend model id
     * @param tokenMetaId      token meta id
     * @param key              字段
     * @return TalendMetaInfo
     */
    public TalendMetaInfo getTalendMetaInfo(String x_pk_x_talend_id, String tokenMetaId, String key) throws IOException {
        return dataModelEntity.getTalendMetaInfo(x_pk_x_talend_id, tokenMetaId, key);
    }

    /**
     * 取schema中所有关联定义
     *
     * @param x_pk_x_talend_id        talend model id
     * @param referenceEntityTypeName 联表名
     * @return 关联定义
     */
    public List<TalendMetaInfo> getTalendReference(String x_pk_x_talend_id, String referenceEntityTypeName) throws IOException {
        return dataModelEntity.getTalendReference(x_pk_x_talend_id, referenceEntityTypeName);
    }
}


package de.hsrm.mi.swtp.exchangeplatform.messaging.message;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import de.hsrm.mi.swtp.exchangeplatform.messaging.message.enums.MessageType;
import de.hsrm.mi.swtp.exchangeplatform.model.serializer.ExchangeplatformMessageSerializer;
import lombok.AccessLevel;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.FieldDefaults;

@Data
@EqualsAndHashCode(callSuper = true)
@FieldDefaults(level = AccessLevel.PRIVATE)
@JsonSerialize(using = ExchangeplatformMessageSerializer.class)
public class ExchangeplatformStatusMessage extends Message {

	@JsonProperty("type")
	MessageType messageType = MessageType.EXCHANGEPLATFORM_STATUS;

	@JsonProperty("tradesActive")
	Boolean isActive = false;

	@JsonProperty("message")
	String message = "Tauschbörse ist jetzt %s.";

	@Builder
	public ExchangeplatformStatusMessage(Boolean isActive) {
		this.isActive = isActive;
	}

	public String getMessage() {
		return String.format(message, isActive ? "aktiv": "inaktiv");
	}

}


package org.hunter.pocket.uuid;

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

/**
 * @author wujianchuan 2019/2/14
 */
public class UuidGeneratorFactory {
    private static final Map<String, UuidGenerator> GENERATOR_POOL = new ConcurrentHashMap<>(6);
    private static final UuidGeneratorFactory OUR_INSTANCE = new UuidGeneratorFactory();

    public static UuidGeneratorFactory getInstance() {
        return OUR_INSTANCE;
    }

    private UuidGeneratorFactory() {
    }

    public UuidGenerator getUuidGenerator(String generatorId) {
        return GENERATOR_POOL.get(generatorId);
    }

    public void registerGenerator(UuidGenerator uuidGenerator) {
        synchronized (this) {
            if (GENERATOR_POOL.containsKey(uuidGenerator.getGeneratorId())) {
                throw new RuntimeException("This logo already exists. Please use another one.");
            } else {
                GENERATOR_POOL.put(uuidGenerator.getGeneratorId(), uuidGenerator);
            }
        }
    }
}


/*
 * 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 org.cbc.sql;

/**
 *
 * @author Chris
 */
public class SQLInsertBuilder extends SQLBuilder {
    public SQLInsertBuilder(String table, String protocol) {
        this.table    = table;
        this.protocol = protocol;
    }
    @Override
    public String build() {
        StringBuilder sql    = new StringBuilder("INSERT " + table + "(\r\n   ");
        StringBuilder values = new StringBuilder(") VALUES (\r\n");
        char          sep    = ' ';

        for (Field f : fields) {
            sql.append(sep);
            sql.append("\r\n    ");
            sql.append(f.getName());
            values.append(sep);
            values.append("\r\n    ");
            values.append(f.getValue());
            sep = ',';
        }
        values.append(")");
        sql.append(values);
        addWhere(sql);

        return sql.toString();
    }
}


package com.dg.app.bean;

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

/**
 *狗搭列表实体类
 *
 * @author czh
 * @created 2015年9月8日
 */
public class MapList extends Entity implements ListEntity<MapNodes> {

	public final static int CATALOG_ALL = 1;//所有的狗搭的模块
	public final static int CATALOG_LIUGOU = 2;//遛狗菜单
	public final static int CATALOG_XIANGQIN= 3;//相亲菜单

	public final static int CATALOG_JIYANG = 4;//寄养菜单

	private int catalog;

	private int pageSize;

	private int GouDaCount;

	private List<MapNodes> list = new ArrayList<MapNodes>();

	public int getCatalog() {
		return catalog;
	}

	public void setCatalog(int catalog) {
		this.catalog = catalog;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public int getGouDaCount() {
		return GouDaCount;
	}

	public void setGouDaCount(int gouDaCount) {
		GouDaCount = gouDaCount;
	}

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

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


/**
 *
 */
package com.dida.first.dialog;

import android.content.Context;
import android.view.View;
import android.widget.RelativeLayout;

import com.dida.first.R;

/**
 * @author KingJA
 * @data 2015-8-26 下午2:53:07
 * @use
 */
public class DialogSaveImg extends DialogBaseAlert {

    private RelativeLayout rl_save_image;
    private OnSaveListener onSaveListener;

    /**
     * @param context
     */
    public DialogSaveImg(Context context) {
        super(context);
    }

    @Override
    public void initView() {
        setContentView(R.layout.dialog_text);
        rl_save_image = (RelativeLayout) findViewById(R.id.rl_save_image);
    }

    @Override
    public void initNet() {

    }

    @Override
    public void initEvent() {
        rl_save_image.setOnClickListener(this);
    }

    @Override
    public void initData() {

    }

    @Override
    public void childClick(View v) {
        if (v.getId() == R.id.rl_save_image) {
            onSaveListener.OnSave();
            dismiss();
        }
    }

    public interface OnSaveListener {
        void OnSave();
    }

    public void setOnSaveListener(OnSaveListener onSaveListener) {
        this.onSaveListener = onSaveListener;
    }
}


Local Settings
==============

This package allows you to extend the current config with project-local settings.

![demo](https://raw.githubusercontent.com/s-shin/local-settings/master/demo.gif)

Installation
------------

```
apm install local-settings
```

Usage
-----

* Make `.atomrc.cson` file in the root of the current workspace.
  `.atomrc.cson` can include any settings which are available in `config.cson`.
* Execute `Local Settings: Enable` from the command palette (`cmd+shift+p`).
* If you edit `.atomrc.cson` after enabled, execute `Local Settings: Reload`.
* If you want to restore settings, execute `Local Settings: Disable`.

Configuration
-------------

You can configure some settings by `config.cson`.

```
'local-settings':
  'configFileName': '.atomrc' # '.cson' is automatically appended
  'autoEnable': false # if true, enable local settings on opening project
```

If you change `config.cson`, do `Window: Reload`.

Notice
------

Currently the config file in the first project is used in any projects
when you load multiple projects in the tree view.


package com.example.jrod730.dfsoptimizer;

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

public class DFS extends AppCompatActivity {

    private Button mcashGame;
    private Button mgpp;

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

        mcashGame = (Button) findViewById(R.id.cashgame);
        mgpp = (Button) findViewById(R.id.gpp);

        mcashGame.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {

                startActivity(new Intent(DFS.this, CashGame.class));
            }
        });

        mgpp.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {

                startActivity(new Intent(getBaseContext(), GPP.class));

            }
        });

    }

}


package com.bee32.plover.arch.util;

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

public class FriendData {

    public static String script(Class<?> clazz, String extension) {
        return script(clazz, extension, "utf-8");
    }

    public static String script(Class<?> clazz, String extension, String charset) {
        String resource = clazz.getName().replace('.', '/');
        resource = "/" + resource + "." + extension;
        URL url = clazz.getResource(resource);

        ByteArrayOutputStream buf = new ByteArrayOutputStream();
        try (InputStream in = url.openStream()) {
            int b;
            while ((b = in.read()) != -1) {
                buf.write(b);
            }
        } catch (IOException e) {
            throw new RuntimeException(e.getMessage(), e);
        }

        if (charset == null)
            charset = "utf-8";

        String s;
        try {
            s = new String(buf.toByteArray(), charset);
        } catch (UnsupportedEncodingException e) {
            throw new RuntimeException(e.getMessage(), e);
        }
        return s;
    }

}


package com.sudoku.ad.opos;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

/**
 * Created by AD on 2015/9/2.
 */
public class MyImageButtonLayout extends LinearLayout {
    private ImageView imageView;
    private TextView textView;
    private Context mContext;
    public MyImageButtonLayout(Context context, AttributeSet attrs) {
        super(context, attrs);
        LayoutInflater.from(context).inflate(R.layout.layout_image_button, this, true);
        mContext = context;
        imageView = (ImageView)findViewById(R.id.imagebutton_image);
        textView = (TextView)findViewById(R.id.imagebutton_text);
    }
    public void setImage(int id){
        imageView.setImageResource(id);
    }
    public void setText(String string){
        textView.setText(string);
    }
    public void setSize(int size){
        textView.setTextSize(size);
    }
}


package com.atsz.qtd.event;

import com.atsz.qtd.common.enums.EventType;
import com.atsz.qtd.entity.*;
import lombok.Data;
import org.springframework.context.ApplicationEvent;

import java.util.List;

/**
 * @author : Jerry_Zheng
 * @pakcageName :com.atsz.qtd.event
 * @project : pioneer-ttf-sharding
 * @date : 2019/7/31 16:34

 */
@Data
public class StByRangeReportDateEvent extends ApplicationEvent {

    public StByRangeReportDateEvent(Object source, ByrangeReport report, ByrangeTtf ttfBase, ByrangeTtfData ttfData) {
        super(source);
        this.eventType = EventType.INSERT;
        this.ttfBase = ttfBase;
        this.ttfData = ttfData;
        this.report = report;

    }

    public StByRangeReportDateEvent(Object source, EventType eventType, ByrangeReport report, ByrangeTtf ttfBase, ByrangeTtfData ttfData) {
        super(source);
        this.ttfBase = ttfBase;
        this.eventType = eventType;
        this.report = report;
        this.ttfData = ttfData;

    }

    private EventType eventType;
    private ByrangeTtf ttfBase;
    private ByrangeTtfData ttfData;
    private ByrangeReport report;

}


package com.libraryapp.utils;

import org.apache.commons.io.FileUtils;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;

import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class TakeScreenShot {

    /** Take screen shot **/
    public static void takeScreenshot(String fileName){
        File scrFile = ((TakesScreenshot)Driver.getDriver()).getScreenshotAs(OutputType.FILE);
        String path = System.getProperty("user.dir")
                + File.separator + "test-output"
                + File.separator + "screenshots"
                + File.separator + getTodaysDate()
                + " " + fileName + ".png";
        try {
            FileUtils.copyFile(scrFile, new File(path));
        } catch (IOException e){
            e.printStackTrace();
        }
    }

    public static String getTodaysDate(){
        return(new SimpleDateFormat("yyyyMMdd").format(new Date()));
    }
}


package com.example.appp23;

import android.os.Bundle;
import android.app.Activity;
import android.view.Display;
import android.view.Menu;
import android.view.Surface;
import android.view.WindowManager;
import android.widget.Toast;

public class MainActivity23 extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main_activity23);
        WindowManager wm=getWindowManager();
        Display d=wm.getDefaultDisplay();
        int rot=d.getRotation();
        if(rot==Surface.ROTATION_0||rot==Surface.ROTATION_270)
        {
        	Toast.makeText(getApplicationContext(), "potrait mode", Toast.LENGTH_LONG).show();
        }
        else
        {
        	Toast.makeText(getApplicationContext(), "Landscape mode", Toast.LENGTH_LONG).show();
        }
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main_activity23, menu);
        return true;
    }

}


package com.anit.remider;

import android.content.Context;
import android.content.SharedPreferences;

/**
 * Created by 79900 on 04.07.2016.
 */
public class PreferenceHelper {
    private static PreferenceHelper instannce;
    private Context context;
    private SharedPreferences sharedPreferences;

    public static final String SPLASH_IS_INVISIBLE = "splash_is_invisible";

    private PreferenceHelper() {

    }

    public static PreferenceHelper getInstance(){

          if(instannce==null){
              instannce = new PreferenceHelper();
          }

        return instannce;
    }

    public void init(Context context){
        this.context = context;
        sharedPreferences = context.getSharedPreferences("preference",Context.MODE_PRIVATE);
    }

    public void putBoolean(String key,Boolean value){

        SharedPreferences.Editor editor = sharedPreferences.edit();
        editor.putBoolean(key,value);
        editor.apply();

    }

    public Boolean getBoolean(String key){

        return sharedPreferences.getBoolean(key,false);

    }

}


package com.zhengqing.demo.api;

import com.zhengqing.demo.service.IEasyExcelReadService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;

/**
 * <p> 测试EasyExcel </p>
 *
 * @author zhengqingya
 * @description
 * @date 2022/1/24 17:37
 */
@Slf4j
@RestController
@RequestMapping("/easyExcel/read/test")
@Api(tags = {"EasyExcel-read-api"})
public class EasyExcelReadTestController {

    @Resource
    private IEasyExcelReadService easyExcelReadService;

    @ApiOperation("最简单的读")
    @PostMapping(value = "simpleRead")
    public void simpleRead(@RequestPart @RequestParam MultipartFile file) {
        this.easyExcelReadService.simpleRead(file);
    }

//    @ApiOperation("导出")
//    @GetMapping(value = "/export")
//    public void writeExcel(HttpServletResponse response) {
//        List<ExportModel> list = this.getList();
//        String fileName = "Excel导出测试";
//        String sheetName = "sheet1";
//        EasyExcelUtil.writeExcel(response, list, fileName, sheetName, ExportModel.class);
//    }

}