package org.usc.wechat.mp.sdk.vo.reply;

import java.util.List;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Shunli
 */
@XmlRootElement(name = "xml")
@XmlAccessorType(XmlAccessType.FIELD)
public class NewsReply extends Reply {
    @XmlElement(name = "ArticleCount")
    private int ArticleCount;

    @XmlElementWrapper(name = "Articles")
    @XmlElement(name = "item")
    private List<ArticleDetail> articles;

    public int getArticleCount() {
        return ArticleCount;
    }

    public void setArticleCount(int articleCount) {
        ArticleCount = articleCount;
    }

    public List<ArticleDetail> getArticles() {
        return articles;
    }

    public void setArticles(List<ArticleDetail> articles) {
        this.articles = articles;
    }

}


package org.tcontrol.sms.commands;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;
import org.tcontrol.sms.IRelayController;
import org.tcontrol.sms.ISMSCommand;
import org.tcontrol.sms.IThermostat;
import org.tcontrol.sms.config.props.ThermostatConfig;

@Component
@Slf4j
@Qualifier("thermostatOffCommand")
@AllArgsConstructor
public class ThermostatOffCommand implements ISMSCommand {

    private final IRelayController relayController;

    private final IThermostat thermostatElectro;

    private final ThermostatConfig thermostatElectroConfig;

    @Override
    public CommandResult run() {

        thermostatElectro.changeOn(false);

        thermostatElectroConfig.relayPins().forEach(pin -> {
            relayController.turnOffRelay(pin);
        });

        log.info("Executed");
        return new CommandResult(STATUS.OK, "Termostat is off");
    }
}


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

/**
 *
 * @author Korisnik
 */
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;

public class Prijava {

    public static boolean logiraj (String name, String password) throws SQLException
    {
         Database db = new Database();
        PreparedStatement ps = db.CONNECTION.prepareStatement("SELECT * FROM korisnici WHERE id =? AND "
                + "lozinka=?");
        try {
            ps.setString(1, name);
            ps.setString(2, password);
            ResultSet rs = ps.executeQuery();
            if (rs.next()) {
                return true;
            } else {
                return false;
            }
        } catch (SQLException ex) {
            System.out.println("Nastala je greška: "+ex.getMessage());
            return false;
    }
  }
}


package com.mycompany.domain.shop;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.mycompany.annotation.Deployment;
import com.mycompany.domain.Entity;

import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;

@JsonIgnoreProperties(ignoreUnknown = true)
@Deployment(table = "customers")
public class Customer extends Entity
{
    public String name;
    public String comment;
    public String phone;
    public Integer totalOrdered = 0;
    public List<Address> addresses = new ArrayList<>();

    @Override
    public String getFullText() {
        return Optional.ofNullable(name).orElse("").toLowerCase() + " " + Optional.ofNullable(comment).orElse("").toLowerCase()
            + " " + Optional.ofNullable(phone).orElse("").toLowerCase() + " " +
              addresses.stream().map(a->String.format("%s %s %s", a.streetName, a.streetNumber, a.flat)).collect(Collectors.joining(" "));
    }

}


package com.example.classwork;

public class Student {
    int id;
    String name;
    String department;
    String course;

    public Student(){}

    public Student(String name, String department, String course){
        this.name = name;
        this.department = department;
        this.course = course;
    }

    public Student(int id, String name, String department, String course){
        this.id = id;
        this.name = name;
        this.department = department;
        this.course = course;
    }

    public int getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public String getCourse() {
        return course;
    }

    public String getDepartment() {
        return department;
    }

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

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

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

    public void setDepartment(String department) {
        this.department = department;
    }
}


package com.nraynaud.sport.web.result;

import com.nraynaud.sport.web.ActionDetail;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.Result;
import com.opensymphony.xwork2.inject.Inject;
import org.apache.struts2.dispatcher.mapper.ActionMapper;

import java.util.Map;

/**
 * Redirect (with 302) to the previous action.
 */
public class RedirectBack extends BackResult {
    private ActionMapper actionMapper;

    protected Result createRealResult(final ActionInvocation invocation, final ActionDetail detail) {
        final Redirect result = new Redirect(detail.namespace, detail.name, "index");
        result.setActionMapper(actionMapper);
        for (final Map.Entry<String, String[]> entry : detail.parameters.entrySet()) {
            result.addParameter(entry.getKey(), entry.getValue()[0]);
        }
        return result;
    }

    @Inject
    public void setActionMapper(final ActionMapper mapper) {
        actionMapper = mapper;
    }
}


package company.infrastructure.datastore.jackson;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.datatype.joda.JodaModule;
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;

public class JacksonConfiguration extends AbstractJacksonConfig {

    @Override
    @Bean
    public Jackson2ObjectMapperBuilderCustomizer jacksonBuilderCustomizer(ApplicationContext ctx) {
        return baseConfig(objectMapperBuilder ->
                        objectMapperBuilder.modulesToInstall(
                                new JodaModule()),
                ctx);
    }

    @Bean
    @Primary
    public ObjectMapper objectMapper() {
        ObjectMapper objectMapper = new ObjectMapper();

        objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
        return objectMapper;
    }
}


package com.source;

import java.util.concurrent.TimeUnit;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;

public class ChooseBrowser {
	  public WebDriver loadBrowser(String browser) {
		  WebDriver driver;

		  if(browser.equalsIgnoreCase("firefox")){
	    	  // use firefox
	          driver = new FirefoxDriver();
	      }
	      else if(browser.equalsIgnoreCase("chrome")){
	    	  // use chrome
	          System.setProperty("webdriver.chrome.driver","C:\\chromeDriver\\chromedriver.exe");
	          driver = new ChromeDriver();
	      }
	      else if(browser.equalsIgnoreCase("ie")){
	    	  // use IE
	    	  System.setProperty("webdriver.ie.driver","C:\\iedriver\\IEDriverServer.exe");
	          driver = new InternetExplorerDriver();
	      }
	      else{
	          throw new RuntimeException("Browser is not correct");
	      }

	      return driver;
	  }
}


package com.alpgeeks.phonestop.library;

import android.app.Activity;
import android.database.Cursor;
import android.net.Uri;

/**
 * Created by Akki on 10/26/2015.
 */
public class SmsReader {
    public static final String INBOX = "content://sms/inbox";
    public static boolean smsReceived(Activity activity) {
        Cursor cursor = activity.getContentResolver().query(Uri.parse(INBOX), null, null, null, null);

        String msgData = "";
        if (cursor.moveToFirst()) { // must check the result to prevent exception
            do {
              //  for(int idx=0;idx<cursor.getColumnCount();idx++)
               // {
                int idx=0;
                    msgData += " " + cursor.getColumnName(idx) + ":" + cursor.getString(idx);
               // }
                // use msgData
            } while (cursor.moveToNext());
        } else {
            // empty box, no SMS
        }

        System.out.println("Yes "+ msgData);
        return false;
    }
}


package me.bigua.comiccollector.Fragments;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import me.bigua.comiccollector.MainActivity;
import me.bigua.comiccollector.R;

public class WishListFragment extends Fragment {
    private static final String ARG_SECTION_NUMBER = "section_number";

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

    public static WishListFragment newInstance(int sectionNumber) {
        WishListFragment fragment = new WishListFragment();
        Bundle args = new Bundle();
        args.putInt(ARG_SECTION_NUMBER, sectionNumber);
        fragment.setArguments(args);
        return fragment;
    }

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

        return view;

    }

}


package net.acomputerdog.map.stage.convert.in;

import net.acomputerdog.map.image.SourcedImage;
import net.acomputerdog.map.tile.Tile;
import net.acomputerdog.map.tile.TileSource;

public class ImportedTile extends Tile {

    private final SourcedImage image;
    private final int startX, startY, endX, endY;
    private final long modified;

    public ImportedTile(TileSource source, SourcedImage image, int x, int y) {
        super(source);
        this.image = image;
        this.startX = x;
        this.startY = y;
        this.endX = x + 512;
        this.endY = y + 512;
        this.modified = image.getSourceFile().lastModified();
    }

    @Override
    public int getStartX() {
        return startX;
    }

    @Override
    public int getStartY() {
        return startY;
    }

    @Override
    public int getEndX() {
        return endX;
    }

    @Override
    public int getEndY() {
        return endY;
    }

    @Override
    public SourcedImage getImage() {
        return image;
    }

    @Override
    public long getLastModified() {
        return modified;
    }
}


package com.fleta.watchingservice.adapter.grpc.server;
import com.fleta.watchingservice.domain.service.WatchingServiceGrpcImpl;
import com.fleta.watchingservice.port.WatchingRepository;
import io.grpc.ServerBuilder;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class WatchingServer implements ApplicationRunner {

    @Value("${grpc.port}")
    public int port;

    @Value("${grpc.host}")
    public String host;

    private final WatchingRepository watchingRepository;

    public WatchingServer(WatchingRepository watchingRepository) {
        this.watchingRepository = watchingRepository;
    }

    @Override
    public void run(ApplicationArguments args) throws Exception {
        log.info("host {} {}", host, port);
        ServerBuilder.forPort(port)
            .addService(new WatchingServiceGrpcImpl(watchingRepository))
            .build().start();
    }
}


package managers;

import org.picketlink.annotations.PicketLink;
import org.picketlink.idm.PartitionManager;
import org.picketlink.idm.model.basic.Realm;
import resources.JPAResources;

import javax.enterprise.inject.Produces;
import javax.inject.Inject;
import java.io.Serializable;

/**
 * author.name: Imad Yamane
 * author.email: contact@imadyamane.de
 * author.website: //imadyamane.de
 * date: 04/05/16
 */
public class RealmManager  implements Serializable {

    @Inject
    private PartitionManager partitionManager;

    private Realm realm;

    @Produces
    @PicketLink
    public Realm select() {
        return this.realm;
    }

    public JPAResources.REALM getRealm() {
        if (this.realm == null) {
            return null;
        }

        return JPAResources.REALM.valueOf(this.realm.getName());
    }

    public void setRealm(JPAResources.REALM realm) {
        this.realm = this.partitionManager.getPartition(Realm.class, realm.name());
    }

}


package com.jojoldu.blogcode.springbootjpaid;

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.Assertions.assertThat;

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

    @Autowired
    private BookRepository bookRepository;

    @Autowired
    private MemberRepository memberRepository;

    @After
    public void tearDown() throws Exception {
        bookRepository.deleteAllInBatch();
        memberRepository.deleteAllInBatch();
    }

    @Test
    public void auto_increment_테스트() {
        //given
        bookRepository.save(new Book("book1"));
        memberRepository.save(new Member("member1"));

        //when
        Book book = bookRepository.findAll().get(0);
        Member member = memberRepository.findAll().get(0);

        //then
        assertThat(book.getId()).isEqualTo(1L);
        assertThat(member.getId()).isEqualTo(1L);
    }
}


package com.pedromassango.programmers.extras;

import android.content.Context;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.animation.LinearInterpolator;

/**
 * Created by Pedro Massango on 26/05/2017.
 */

public class AnimUtils {

    public static Animation blink() {

        Animation animation = new AlphaAnimation(1, 0);
        animation.setDuration(550);
        animation.setInterpolator(new LinearInterpolator());
        animation.setRepeatCount(10);
        animation.setRepeatMode(Animation.REVERSE);
        return animation;
    }

    public static Animation transOut(Context context) {

        return AnimationUtils.loadAnimation(context, android.R.anim.fade_out);
    }

    public static Animation transIn(Context context) {

        return AnimationUtils.loadAnimation(context, android.R.anim.fade_in);
    }

}


package entity;

import java.util.Objects;

/**
 * Entity class that models a student with geo location
 */
public class Student implements Comparable<Student> {
    private String name;
    private GeoCoordinate geoCoordinate;

    public Student(String name, GeoCoordinate geoCoordinate) {
        this.name = name;
        this.geoCoordinate = geoCoordinate;
    }

    public String getName() {
        return name;
    }

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

    public GeoCoordinate getGeoCoordinate() {
        return geoCoordinate;
    }

    public void setGeoCoordinate(GeoCoordinate geoCoordinate) {
        this.geoCoordinate = geoCoordinate;
    }

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

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

    @Override
    public int compareTo(Student student) {
        return this.name.compareTo(student.name);
    }
}


package com.compuware.caqs.domain.dataschemas.rights;

import com.compuware.caqs.domain.dataschemas.DefinitionBean;

public class RoleBean extends DefinitionBean implements Comparable {
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object role) {
        boolean result = false;
        if (role != null && role instanceof RoleBean && this.id != null) {
            result = id.equals(((RoleBean) role).getId());
        }
        return result;
    }

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

    public int compareTo(Object role) {
          int result = 0;
        if (role != null) {
            if (this.lib != null) {
                result = this.lib.compareTo(((RoleBean) role).getLib());
            } else if (this.id != null) {
                result = this.id.compareTo(((RoleBean) role).getId());
            }
        }
        return result;
  }
}


Jive API

Is this repository you will find :
- a Jive API wrapper
- a Jive analytics API wrapper
- a Bunchball API wrapper

     === Jive API ===

Basic Auth : all performed actions will be performed by authenticated user
You will have to fill in your password into wrapper.gs.
I've divided functions into places and persons actions and you'll find them respectively into place.gs and persons.gs as the names of the files suggest.

https://developers.jivesoftware.com/api/v3/cloud/rest/index.html

     === Jive Analytics API (Jive Data Export Service) ===

You will have to first configure you analytics. Please see with Jive or on Jive community.
Then you'll have a client ID and Client secret to fill in the file.

     === Bunchball API ===

You'll have to fill in the API key.
The documentation is accessible by following this URL but you'll have to have a account (see with bunchball, they will give you the registration for free, in my understanding)
https://bunchballnet-main.pbworks.com/w/page/53131932/FrontPage


package com.zk.condition;

import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.env.Environment;
import org.springframework.core.type.AnnotatedTypeMetadata;

public class MacCondition implements Condition {
    @Override
    public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {

        // 得到 ioc 的 bean factory
        ConfigurableListableBeanFactory beanFactory = context.getBeanFactory();

        // 获得类加载器
        ClassLoader classLoader = context.getClassLoader();

        Environment environment = context.getEnvironment();

        String osName = environment.getProperty("os.name");

        boolean mac_os_x = osName.equals("Mac OS X");

        return mac_os_x;

    }

    public static void main(String[] args) {
        String name = System.getProperty("os.name");
        System.out.println(name);

    }
}


package com.demo.reactive.model.repository;

import com.demo.reactive.model.document.Employee;
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 reactor.core.publisher.Flux;
import reactor.test.StepVerifier;

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

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

    @Autowired
    EmployeeCrudRepository employeeCrudRepository;

    @Test
    public void 正常_登録と検索() {

        employeeCrudRepository.save(new Employee(null, "heno")).block();
        Flux<Employee> employeeFlux = employeeCrudRepository.findAllByName("heno");

        StepVerifier
                .create(employeeFlux)
                .assertNext(employee -> {
                    assertThat(employee.getId()).isNotNull();
                    assertThat(employee.getName()).isEqualTo("heno");
                })
                .expectComplete()
                .verify();
    }
}


package com.lemon.framework.enumwrapper;

/**
 * Created by igotti on 14-11-4.
 */
public class Option extends NameValuePair<String> implements Cloneable {

    private boolean selected;

    public Option() {

    }

    public Option(String name, String value) {
        super(name, value);
    }

    public Option(String name, String value, boolean selected) {
        super(name, value);
        this.selected = selected;
    }

    public boolean isSelected() {
        return selected;
    }

    public void setSelected(boolean selected) {
        this.selected = selected;
    }

    @Override
    public String toString() {
        return "Option{name='" + super.getName() + "', value='" + super.getValue() + "', selected=" + selected + '}';
    }

    @Override
    public Option clone() {
        Option o = null;
        try {
            o = (Option) super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return o;
    }
}


package com.xk.CarRenting.frontend.adapter;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.xk.CarRenting.app.Constant;
import com.xk.CarRenting.frontend.fragment.LoginFragment;

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

/**
 *  Adapter
 */
public class LoginPagerAdapter extends FragmentPagerAdapter {

    List<Fragment> fragments = new ArrayList<>(2);

    public LoginPagerAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        if (fragments.size() > position) {
            return fragments.get(position);
        } else {
            LoginFragment fragment = new LoginFragment();
            if (position == 1) {
                Bundle arg = new Bundle();
                arg.putBoolean(Constant.IS_SIGN_UP, true);
                fragment.setArguments(arg);
            }
            fragments.add(fragment);
            return fragment;
        }
    }

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

}


package com.wachoo.demo.quartz.jmx.bo;

import java.beans.ConstructorProperties;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * @desc: 基本监测属性指标
 * @author: wangchao3
 * @since: JDK1.8
 * @date: 2018/9/28 18:26
 */
@Setter
@Getter
@NoArgsConstructor
public class MetricalInfo {

  private String apiName;
  private Double qps;
  private Long qpsNum;
  private Long resTotalNum;
  private Long resSucNum;
  private Long resFailNum;
  private Long resNullNum;
  private Long resNotNullNum;

  @ConstructorProperties({"apiName", "qps", "qpsNum", "resTotalNum",
      "resSucNum", "resFailNum", "resNullNum", "resNotNullNum"})
  public MetricalInfo(String apiName, Double qps, Long qpsNum, Long resTotalNum,
      Long resSucNum, Long resFailNum, Long resNullNum, Long resNotNullNum) {
    this.apiName = apiName;
    this.qps = qps;
    this.qpsNum = qpsNum;
    this.resTotalNum = resTotalNum;
    this.resSucNum = resSucNum;
    this.resFailNum = resFailNum;
    this.resNullNum = resNullNum;
    this.resNotNullNum = resNotNullNum;
  }

}


package com.dhjacobson.recipebook_commons.enums;

public enum QuantityUnit {

    COUNT(null, null, null, null),
    TEASPOON("teaspoon", "teaspoons", "tsp", "tsps"),
    TABLESPOON("tablespoon", "tablespoons", "Tbsp", "Tbsps"),
    CUP("cup", "cups", "cup", "cups"),
    OUNCE("ounce", "ounces", "oz", "oz"),
    POUND("pound", "pounds", "lb", "ozs");

    private String longName;
    private String longNamePlural;
    private String shortName;
    private String shortNamePlural;

    QuantityUnit(String longName, String longNamePlural, String shortName, String shortNamePlural) {
        this.longName = longName;
        this.longNamePlural = longNamePlural;
        this.shortName = shortName;
        this.shortNamePlural = shortNamePlural;
    }

    public String getLongName() {
        return longName;
    }

    public String getLongNamePlural() {
        return longNamePlural;
    }

    public String getShortName() {
        return shortName;
    }

    public String getShortNamePlural() {
        return shortNamePlural;
    }
}


package memory;

import java.io.Serializable;

// Page class represent page in memory
@SuppressWarnings("serial")
public class Page <T> implements Serializable{

	// Data members
	private int pageId;
	private T content;

	// C'tor
	public Page(int id, T content){
		this.pageId = id;
		this.content = content;
	}

	// Methods

	// Get pageId
	public int getPageId(){
		return this.pageId;
	}

	// Set pageId
	public void setPageId(int pageId){
		this.pageId = pageId;
	}

	// Get content
	public T getContent(){
		return content;
	}

	// Set content
	public void setContent(T content){
		this.content = content;
	}

	// Hash code override
	@Override
	public int hashCode(){
		return pageId;
	}

	// Equals override
	@Override
	public boolean equals(Object obj){
		return ((this.hashCode() == obj.hashCode()) ? true : false);
	}

	// ToString override
	@Override
	public String toString(){
		return ("PageID:" + pageId + "\n" +
				"Content: " + content.toString() + "\n" );
	}
}


package com.example.pizzeria.service;

import com.example.pizzeria.model.Drink;
import com.example.pizzeria.repository.DrinkRepository;
import com.example.pizzeria.security.userApp.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DrinkService {
    private final DrinkRepository drinkRepository;

    @Autowired
    public DrinkService(DrinkRepository drinkRepository) {
        this.drinkRepository = drinkRepository;
    }

    public Drink findDrinkById(Long id){
     return drinkRepository.findById(id).orElseThrow(null);
    }

    public List<Drink> findAllDrinks(){
        return drinkRepository.findAll();
    }

    public void addDrink(Drink drink){
        drinkRepository.save(drink);
    }

    public void deleteDrinkById(Long id){
        drinkRepository.deleteById(id);
    }

}


package selenium;
import java.io.File;

import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.wakanda.wastudio.common.Paths;
import org.wakanda.wastudio.common.Utils;

@RunWith(Suite.class)
@Suite.SuiteClasses({
	TestCasesRadioAPI.class,
	TestCasesRadioEvents.class
})
public class TestSuiteRuntimeRadiogroup {
	@BeforeClass
	public static void beforeTestSuite() throws Exception {
		Utils.copyStaticRessources();
	}
	@AfterClass
	public static void clear() throws Exception {
		Utils.killServer();
		Utils.killChromeDriver();
		Utils.killStudio();

		File file = null;
		if (Utils.getOS().equals("win"))
			file = new File(Paths.appStudio.substring(0,Paths.appStudio.lastIndexOf("\\"))+ "\\Resources\\Web Components\\GUIDesigner\\scripts\\designer\\test\\designer-test.js");
		else
			file = new File(Paths.appStudio	+ "/Contents/Resources/Web Components/GUIDesigner/scripts/designer/test/designer-test.js");

		Utils.copyFolderImpl(new File(Paths.tempMac + "/designer-test.js"),	file);
	}
}


package de.fhdo.lemma.model_processing.eclipse.launcher.processing_configurations.arguments.kinds;

import de.fhdo.lemma.model_processing.eclipse.launcher.processing_configurations.arguments.types.ArgumentTypeFactory;
import de.fhdo.lemma.model_processing.eclipse.launcher.processing_configurations.arguments.types.IntermediateModelsOfAllImportsArgumentType;

/**
 * Argument kind for arguments with multi-valued parameters.
 *
 * @author Florian Rademacher
 */
@SuppressWarnings("all")
public final class MultiValuedParameterArgumentKind extends AbstractArgumentKind {
  public static final ArgumentKindIdentifier IDENTIFIER = ArgumentKindIdentifier.MULTI_VALUED_PARAMETER;

  /**
   * Constructor
   */
  public MultiValuedParameterArgumentKind() {
    super(MultiValuedParameterArgumentKind.IDENTIFIER, "Multi-Valued Parameter",
      ArgumentTypeFactory.fromIdentifier(IntermediateModelsOfAllImportsArgumentType.IDENTIFIER));
  }
}


/*
 *  Copyright 2013 Foundation4GWT
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package com.wfairclough.foundation4gwt.client.ui.resources.internal;

import com.wfairclough.foundation4gwt.client.ui.resources.ResourceInjector;

public class DefaultInternalInjector implements InternalResourceInjector {

	private static String LOAD_FOUNDATION_SCRIPT = "\njQuery(document).ready(function () {\n\tjQuery(document).foundation();\n});\n";

    public void preConfigure() {

    }

    public void configure() {
    	ResourceInjector.injectScript(LOAD_FOUNDATION_SCRIPT);
    }

}


package com.prince.bookstoreapi.service;

import com.prince.bookstoreapi.domain.security.Role;
import com.prince.bookstoreapi.repository.RoleRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class RoleServiceImpl implements RoleService {

    private static final Logger logger = LoggerFactory.getLogger(RoleService.class);
    private RoleRepository roleRepository;

    @Autowired
    public RoleServiceImpl(RoleRepository roleRepository) {
        this.roleRepository = roleRepository;
    }

    @Transactional
    @Override
    public Role createRole(Role role) throws Exception {
        Role localRole = roleRepository.findByName(role.getName());
        if(localRole != null) {
            logger.info("Role {} already exists", role.getName());
            throw new Exception("Role "+role.getName()+" already in there to use.");
        }
        localRole = roleRepository.save(role);
        return localRole;
    }
}


package com.warikoo.round.bingo.tambola.controllers;

import java.util.ArrayList;
import java.util.Objects;

import com.warikoo.round.bingo.tambola.services.GameService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author krishnamohan
 * @date 29/06/20
 **/

@Controller
public class TicketController {

    @Autowired
    private GameService service;

    @GetMapping("/ticket/{ticketId}")
    @ResponseBody
    public ResponseEntity<ArrayList<ArrayList<Integer>>> getTicket(@PathVariable("ticketId") Long ticketId) {
        ArrayList<ArrayList<Integer>> ticket = service.getTicket(ticketId);
        if (Objects.nonNull(ticket)) {
            return ResponseEntity.ok().body(ticket);
        } else {
            return ResponseEntity.badRequest().body(ticket);
        }
    }

}


package com.mycompany.persistence;

import javax.inject.Inject;

import org.apache.ibatis.session.SqlSession;
import org.springframework.stereotype.Repository;

import com.mycompany.domain.MemberTokenVO;
import com.mycompany.domain.MemberVO;

@Repository
public class LoginDAOImpl implements LoginDAO{

	@Inject
	private SqlSession session;
	private static String namespace = "loginMapper";

	@Override
	public MemberVO insertMember(MemberVO vo) throws Exception {
		session.insert(namespace+".insertMember",vo);
		return vo;
	}

	@Override
	public void insertMemberToken(MemberTokenVO vo) throws Exception {
		session.insert(namespace+".insertMemberToken",vo);

	}

	@Override
	public MemberVO selectMember(MemberVO vo) throws Exception {
		return session.selectOne(namespace+".selectMember",vo);
	}

	@Override
	public void updateToken(MemberTokenVO vo) throws Exception {
		session.update(namespace+".updateToken",vo);

	}

}


package entity;

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

/**
 * Created by Mateusz on 30.11.2016.
 */

@Entity
@Table
public class Result implements Serializable {

    private Integer id;
    private Long result;
    private Track track;
    private Player player;

    public Result(){

    }

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "ID")
    public Integer getId() {
        return id;
    }

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

    @Column(name = "RESULT")
    public Long getResult() {
        return result;
    }

    public void setResult(Long result) {
        this.result = result;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "PLAYER_ID")
    public Player getPlayer() {
        return player;
    }

    public void setPlayer(Player player) {
        this.player = player;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "TRACK_ID")
    public Track getTrack() {
        return track;
    }

    public void setTrack(Track track) {
        this.track = track;
    }
}


package com.superlity.strongservice;

import java.util.List;

import android.app.ActivityManager;
import android.app.ActivityManager.RunningAppProcessInfo;
import android.content.Context;
import android.widget.Toast;

public class Utils {

    /**
     * 判断进程是否运行
     *
     * @return
     */
    public static boolean isProessRunning(Context context, String proessName) {

        boolean isRunning = false;
        ActivityManager am = (ActivityManager) context
                .getSystemService(Context.ACTIVITY_SERVICE);

        List<RunningAppProcessInfo> lists = am.getRunningAppProcesses();
        for (RunningAppProcessInfo info : lists) {
            if (info.processName.equals(proessName)) {
                isRunning = true;
            }
        }

        return isRunning;
    }

    public static void toast(String msg) {
        if (msg == null) {
            return;
        }
        Toast.makeText(TempApplication.getContext(), msg, Toast.LENGTH_SHORT).show();
    }
}


package xziar.enhancer.pojo;

import java.util.HashMap;

public class GroupBean extends UserBean
{
	public static enum Role
	{
		leader, member;
	}

	private HashMap<Integer, String> members = new HashMap<>();
	private int leaderID = -1;
	private String leaderName = "";

	public GroupBean()
	{
		this.role = AccountBean.Role.group;
	}

	public GroupBean(AccountBean account)
	{
		super(account);
	}

	public void addMember(int muid, String name, int role)
	{
		if (Role.leader.ordinal() == role)
		{
			setLeaderID(muid);
			setLeaderName(name);
		}
		else
		{
			members.put(muid, name);
		}
	}

	@Override
	public int getPeople()
	{
		return members.size() + 1;
	}

	public int getLeaderID()
	{
		return leaderID;
	}

	public void setLeaderID(int leaderID)
	{
		this.leaderID = leaderID;
	}

	public String getLeaderName()
	{
		return leaderName;
	}

	public void setLeaderName(String leaderName)
	{
		this.leaderName = leaderName;
	}

	public HashMap<Integer, String> getMembers()
	{
		return members;
	}

	public void setMembers(HashMap<Integer, String> members)
	{
		this.members = members;
	}

}


package com.dingli.test.io;

import java.io.Serializable;

public class Place1 implements Serializable{
    private String pro;
    private String city;
    private String county;

    public Place1() {
    }

    public Place1(String pro, String city, String county) {
        this.pro = pro;
        this.city = city;
        this.county = county;
    }

    public String getPro() {
        return pro;
    }

    public void setPro(String pro) {
        this.pro = pro;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getCounty() {
        return county;
    }

    public void setCounty(String county) {
        this.county = county;
    }

    @Override
    public Object clone() throws CloneNotSupportedException {
        return super.clone();
    }

    @Override
    public String toString() {
        return "Place{" +
                "pro='" + pro + '\'' +
                ", city='" + city + '\'' +
                ", county='" + county + '\'' +
                '}';
    }
}


import com.xuggle.mediatool.IMediaReader;
import com.xuggle.mediatool.IMediaViewer;
import com.xuggle.mediatool.MediaListenerAdapter;
import com.xuggle.mediatool.ToolFactory;

public class DecodeAndPlayAudioAndVideo extends MediaListenerAdapter
{
  /**
   * Takes a media container (file) as the first argument, opens it,
   * plays audio as quickly as it can, and opens up a Swing window and
   * displays video frames with <i>roughly</i> the right timing.
   *
   * @param args Must contain one string which represents a filename
   */

  public static void main(String[] args)
  {
    IMediaReader reader = ToolFactory.makeReader("E:/eclipse-jee-juno-SR1-win32/eclipse-jee-juno-SR1-win32/workspace/ILook/target/test.mp4");

      // create a new reader

      //
      // Create a MediaViewer object and tell it to play video only
      //
      reader.addListener(ToolFactory.makeViewer(IMediaViewer.Mode.VIDEO_ONLY));

      // read out the contents of the media file, and sit back and watch

      while (reader.readPacket() == null)
        do {} while(false);

    }

  }


package org.kulabukhov.android.commons.helpers;

import android.support.annotation.Nullable;

/**
 * Helper class to work with strings
 */
public class StringHelper {

	/**
	 * Capitalizes given string
	 *
	 * @param string string to capitalize
	 * @return capitalized string or null if given string was null
	 */
	@Nullable
	public static String capitalize(@Nullable String string) {
		if (string == null || string.length() == 0) {
			return "";
		}
		char first = string.charAt(0);
		if (Character.isUpperCase(first)) {
			return string;
		} else {
			return Character.toUpperCase(first) + string.substring(1);
		}
	}

	/**
	 * Checks if given string is empty or contains only empty characters (for example, whitespaces)
	 *
	 * @param string string to check. May be null
	 * @return true, if given string is null, has 0 length or contains only empty characters. Otherwise returns false.
	 */
	public static boolean isEmptyOrWhitespaced(@Nullable String string) {
		return string == null || string.length() == 0 || string.matches("\\s*");
	}

}


package com.jinchao.service.impl;

import com.github.pagehelper.PageHelper;
import com.jinchao.dao.IOrdersDao;
import com.jinchao.domain.Orders;
import com.jinchao.service.IOrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class OrdersServiceImpl implements IOrdersService {

    @Autowired
    private IOrdersDao ordersDao;

    @Override
    public List<Orders> findAll(int page,int size) throws Exception {
        //参数pageNum是页码值，参数pageSize代表是每页显示条数
        PageHelper.startPage(page,size);
        return ordersDao.findAll();
    }

    @Override
    public Orders findById(String ordersId) throws Exception {
        return ordersDao.findById(ordersId);
    }

    @Override
    public void update(Orders orders)throws Exception {
        ordersDao.update(orders);
    }

    @Override
    public Order save(Orders orders) throws Exception{
        return ordersDao.save(orders);
    }

}


package com.turing.server.impl;

import java.util.List;

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

import com.turing.entity.SysUsers;
import com.turing.entity.SysUsersExample;
import com.turing.entity.SysUsersExample.Criteria;
import com.turing.mapper.SysUsersMapper;
import com.turing.server.SysUsersServer;

@Service
public class SysUsersServerImpl implements SysUsersServer{

	@Autowired
	private SysUsersMapper sysUsersMapper;

	/**
	  *  登录的方法
	 */
	@Override
	public SysUsers login(SysUsers sysUsers) {
		SysUsersExample sysUsersExample = new SysUsersExample();
		Criteria criteria = sysUsersExample.createCriteria();
		criteria.andLoginIdEqualTo(sysUsers.getLoginId()).andPasswordEqualTo(sysUsers.getPassword());
		List<SysUsers> list = sysUsersMapper.selectByExample(sysUsersExample);
		if(list.size()!=0) {
			return list.get(0);
		}
		return null;
	}

}


package br.com.mbragariano.gostudyapi.domains.presentation.handlers.failures.contracts;

import br.com.mbragariano.gostudyapi.domains.application.failures.contracts.CreateUserFailure;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;

@Slf4j
@Component
@AllArgsConstructor
public abstract class CreateUserFailureHandler {

  private final CreateUserFailureHandler createUserFailureHandler;

  public ResponseEntity<?> handle(CreateUserFailure createUserFailure) {
    log.info("Realizando tratamento para " + createUserFailure.getClass().getSimpleName());

    return this.isApplicable(createUserFailure)
      ? this.apply(createUserFailure)
      : this.createUserFailureHandler.handle(createUserFailure);
  }

  protected abstract ResponseEntity<?> apply(CreateUserFailure createUserFailure);

  protected abstract Boolean isApplicable(CreateUserFailure createUserFailure);

}


/*
 * Copyright 2011-2016 YueJi.com All right reserved. This software is the confidential and proprietary information of
 * YueJi.com ("Confidential Information"). You shall not disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into with YueJi.com.
 */
package com.yue.app.web.amazon.member;

/**
 * @author 轰天雷 2013-2-19 下午10:39:21
 */
public class MemberDefaultCondition extends MemberCondition {

    public MemberDefaultCondition(int memberId, String name) {
        super(memberId, name);
    }

    public String getPageUrl(int action, int page, Object... data) {
        StringBuilder sb = new StringBuilder(50);
        if (page == 0) {
            sb.append(U).append(memberId).append(PATH_SEP).append(name).append(SUFFIX);
        } else {
            sb.append(U).append(memberId).append(PATH_SEP).append(name).append(PATH_SEP).append(page).append(SUFFIX);
        }
        return sb.toString();
    }
}


# Memory Game Project

## Table of Contents

* [Instructions](#instructions)
* [How to play](#Howtoplay)
* [Game dependencies](#GameDependancies)

## Instructions

Run the index.html file and play a round of Memory. You need to click on the cards and find the matching card. You will be able to restart the game whenever you want and after you found all the matches the game will end.

## How to play

https://junks89.github.io/nanodegree-memoryGame/

By clicking on a card(black square), the card will flip and you will be able to see the hidden icon. You will need to find the related second card to get a match. After finding all of the 8 matches the game is finished. You can restart the game whenever you want by clicking on the restart icon on right side. Furthermore you will be able to see how many moves you made and how long you are playing on the top ob the playing board. After finishing the game a total score will appear, with your star rating and the consumed time.

## Game dependencies

There are no dependencies needed for running this project or playing this game except a browser which is able to execute javascript.


package simobject;

import java.awt.Color;

/**
 * Rather than use a null value, we create an "empty object"
 * singleton that will be used in all places in the world where there
 * is no object. This is useful for getting the render color, being able
 * to call getObject.getType to see if a space is occupied, and other useful
 * things. If this becomes problematic then we can change it in the future.
 * It also has the added benefit of reducing the amount of objects we need to create
 * and therefore freeing up heap space.
 * @author Timothy
 *
 */
public final class EmptyObject extends SimObject {
	private static final EmptyObject INSTANCE = new EmptyObject();

	private EmptyObject() {
		this.renderColor = Color.WHITE;
		this.objectType = SimObjectType.EMPTY;
	}

	/**
	 * Returns the singleton instance of the empty {@link SimObject}.
	 * @return A Singleton SimObject that has a {@link SimObjectType type}
	 * of EMPTY.
	 */
	public static EmptyObject getInstance() {
		return INSTANCE;
	}

	@Override
	public void update() {
		return;
	}

	@Override
	public String toString() {
		return new String("Empty Object");
	}

}


# Grafana on ECS Fargate

This Terraform Module deploys Grafana on ECS Fargate with an ALB on top of an ECS Cluster.

![alt text](./docs/grafana_ecs.png)

## What is an ECS Service?

To run Docker containers with ECS, you first define an [ECS
Task](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_defintions.html), which is a JSON file that
describes what container(s) to run, the resources (memory, CPU) those containers need, the volumes to mount, the
environment variables to set, and so on. To actually run an ECS Task, you define an ECS Service, which can:

1. Deploy the requested number of Tasks across an ECS cluster based on the `desired_number_of_tasks` input variable.
1. Restart tasks if they fail.

## What is an ALB?

An [Application Load Balancer](http://docs.aws.amazon.com/elasticloadbalancing/latest/application/introduction.html) is
a "Layer 7" load balancer managed by AWS that forwards incoming requests to the ECS Tasks (Docker containers) in your ECS
Service which are running in your ECS Cluster.


package com.wedevol.fcmtest;

import android.content.Context;
import android.content.SharedPreferences;
import android.util.Log;

import static android.content.Context.MODE_PRIVATE;

/**
 * Created by hp on 8/8/2017.
 */

public class SessoinManager {
    private static final String KEY_GET_TOKEN = "token";
    // Shared Preferences
    SharedPreferences pref;

    SharedPreferences.Editor editor;
    Context _context;

    // Shared pref mode
    int PRIVATE_MODE = MODE_PRIVATE;

    // Shared preferences file name
    private static final String PREF_NAME = "fcmSession";

    public SessoinManager(Context _context) {
        this._context = _context;
    }

    public void setKeyGetToken(String token) {
        pref = _context.getSharedPreferences(PREF_NAME, PRIVATE_MODE);
        editor = pref.edit();
        editor.putString(KEY_GET_TOKEN, token);

        // commit changes
        editor.commit();

        Log.d("Session", "sender token saved");

    }

    public String getKeyGetToken() {
        pref = _context.getSharedPreferences(PREF_NAME, PRIVATE_MODE);
        return pref.getString(KEY_GET_TOKEN, "");
    }

}


package br.com.control.revenda.service;

import br.com.control.revenda.entity.Web;
import br.com.control.revenda.repository.WebRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WebService implements CrudBaisc<Web, String> {

    @Autowired
    WebRepository webRepository;

    @Override
    public Web save(Web obj) {
        return webRepository.save(obj);
    }

    @Override
    public Page<Web> getAll(Pageable pageable) {
        return null;
    }

    @Override
    public List<Web> getAll() {
        return null;
    }

    @Override
    public Web get(String id) {
        return null;
    }

    @Override
    public Web update(Web obj) {
        return null;
    }

    @Override
    public void delete(Web obj) {

    }

    @Override
    public Boolean exist(String id) {
        return null;
    }
}


package metno.kvalobs.kl;
import java.util.*;

public class KvDataStation implements Comparable<KvDataStation> {
	int station;
	TreeSet<KvDataType> container = null;

	public KvDataStation( int station )
	{
		this.station= station;

		try {
			container = new TreeSet<KvDataType>();
		}
		catch( NullPointerException e) {
			container = null;
		}
	}

	public int compareTo( KvDataStation station ) {
		return this.station -station.station;
	}

	public KvDataType findType( int typeid ) {
		Iterator<KvDataType> it = container.iterator();
		KvDataType type;

		while( it.hasNext() ) {
			type = it.next();

			if( type.getType() == typeid )
				return type;
		}

		return null;
	}

	public int getStation() {
		return station;
	}

	public boolean add( KvDataType type ) {
		if(container == null )
			return false;

		return container.add( type );
	}

	Iterator<KvDataType> iterator() {
		if( container == null )
			return null;

		return container.iterator();
	}
}


package com.example.spacetraders.entities;

import android.support.annotation.Nullable;

/**
 * This enum represents the political systems
 */
public enum PoliticalSystem {
    ANARCHY("Anarchy"),
    CAPITALIST_STATE("Capitalist State"),
    COMMUNIST_STATE("Communist State"),
    CONFEDERACY("Confederacy"),
    CORPORATE_STATE("Corporate State"),
    CYBERNETIC_STATE("Cybernetic State"),
    DEMOCRACY("Democracy"),
    DICTATORSHIP("Dictatorship"),
    FASCIST_STATE("Fascist State"),
    FEUDAL_STATE("Feudal State"),
    MILITARY_STATE("Military State"),
    MONARCHY("Monarchy"),
    PACIFIST_STATE("Pacifist State"),
    SOCIALIST_STATE("Socialist State"),
    STATE_OF_SATORI("State of Satori"),
    TECHNOCRACY("Technocracy"),
    THEOCRACY("Theocracy");

    private final String name;

    /**
     * Constructor for the enumeration
     *
     * @param name the name
     */
    PoliticalSystem(String name) {
        this.name = name;
    }

    /**
     * getter for name
     *
     * @return name
     */
    @Nullable
    public String getName() {
        return name;
    }

}


package ifpi.hello4662019;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;

import java.util.List;

import ifpi.hello4662019.adapters.CelularAdapter;
import ifpi.hello4662019.modelos.Celular;

public class ListaCelularActivity extends AppCompatActivity {

    RecyclerView rvCelulares;

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

        rvCelulares = findViewById(R.id.rv_celulares);
    }

    @Override
    protected void onResume() {
        super.onResume();
        obterCelulares();
    }

    private void obterCelulares() {
        List<Celular> celulars = Celular.getCelulares();

        CelularAdapter adapter = new CelularAdapter(celulars, this);
        rvCelulares.setAdapter(adapter);

        rvCelulares.setLayoutManager(new LinearLayoutManager(this));

    }
}


package net.marcusslover.sloverhologram.data;

import net.marcusslover.sloverhologram.SloverHologram;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;

import java.io.File;
import java.io.IOException;

public class Config {
    @SuppressWarnings({"FieldCanBeLocal", "unused"})
    private final SloverHologram sloverHologram;
    private final File file;
    public final FileConfiguration config;

    @SuppressWarnings({"ResultOfMethodCallIgnored", "WeakerAccess"})
    public Config(final SloverHologram sloverHologram, final String filename) {
        this.sloverHologram = sloverHologram;
        this.file = new File(sloverHologram.getDataFolder(), filename);
        if (!file.exists()) {
            try {
                file.createNewFile();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        this.config = YamlConfiguration.loadConfiguration(file);
    }

    public void save() {
        try {
            config.save(file);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}


# ohmyfood: Online food ordering #

Integrate a mobile website with animations in CSS

[My web page hosted online on GitHub Pages](https://fcammy.github.io/ohmyfood/)

## Graphic Effects and Animations ##

## Home Page ##

•	A loading spinner will be displayed and cover the whole screen for 3 seconds

## Menu Pages ##

•	  The menu  dishes will appear gradually on page load with a slight delay for each menu.

•	A small checkmark will appear to the right of the dish. This tick slide from right to left.

## Buttons ##

•	When hovering, the background color of the main buttons be lighten slightly. The drop shadow also be more visible.

•	A heart-shaped Like button is present on this model. When you hover on it, it will fill up gradually.

## Others Animations integrated ##

- Bouncing-loader
- FadeIn
- SlideIn

## Additional requirements ##

-	When you click on Contact, a link to an email address is made.
- The whole site responsive on mobile, tablet, and desktop.
-
### Tools used ###

- VScode
- GitHub
- SASS
- Keyframes
- Transition


package gr.hua.dit.myapplication;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.widget.Toast;

public class NetworkAvailability extends BroadcastReceiver {
    Intent service;

    @Override
    public void onReceive(Context context, Intent intent) {

        ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
        NetworkInfo netInfo = cm.getActiveNetworkInfo();
        //if connected to internet start service else stop it
        if (netInfo != null) {

            service = new Intent(context, LocationService.class);
            Toast.makeText(context, "Location Service Started", Toast.LENGTH_SHORT).show();
            context.startService(service);
        } else {
            context.stopService(service);
            Toast.makeText(context, "Location service  stopped,you disconnected from the internet", Toast.LENGTH_SHORT).show();
        }
    }
}


package com.gauravbytes.springjdbc;

import java.util.logging.Logger;

import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.PreparedStatementCreator;

import com.gauravbytes.springjdbc.ds.JdbcDataSourceUtils;

/**
 * Example usage of {@link PreparedStatementCreator} and
 * {@link ReturnGeneratedKeysPreparedStatementCreator}
 *
 * @author Gaurav Rai Mazra My blog
 *         Website
 */
public class PreparedStatementCreatorExample {
	private static final Logger log = Logger.getGlobal();

	public static void main(String[] args) {
		JdbcTemplate jdbcTemplate = new JdbcTemplate(JdbcDataSourceUtils.getH2Database());
		Integer key = jdbcTemplate.execute(
				new ReturnGeneratedKeysPreparedStatementCreator(
						"insert into product(name, category, description) values('Acer Laptop', 'laptop', 'Predator series')"),
				new GeneratedKeysPreparedStatementCallback());
		log.info(() -> String.format("Product saved in database with key: %d", key));
	}
}


package de.syscy.kagecloud.webserver.pages.webcomponents.navigation;

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

import lombok.AccessLevel;
import lombok.Getter;
import lombok.Setter;

public abstract class BSNavigationComponent {
	protected final @Getter List<BSNavigationComponent> components = new LinkedList<>();

	protected @Getter @Setter(value = AccessLevel.PRIVATE) BSNavigationComponent parent;

	public void add(BSNavigationComponent component) {
		components.add(component);
		component.setParent(this);
	}

	/**
	 * @return itself
	 */
	public BSNavigationComponent addRS(BSNavigationComponent component) {
		add(component);

		return this;
	}

	/**
	 * @return the added component
	 */
	public <T extends BSNavigationComponent> T addRC(T component) {
		add(component);

		return component;
	}

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

	protected String componentsToString() {
		StringBuilder componentsString = new StringBuilder();

		for(BSNavigationComponent component : components) {
			componentsString.append(component.toString());
		}

		return componentsString.toString();
	}
}


package LinkedList;

import java.util.Iterator;
import java.util.LinkedList;

public class Menu {
	public static void main(String[] args) {
		LinkedList<String> menu =new LinkedList<>();

		LinkedList<String> submenu=new LinkedList<>();
		LinkedList<LinkedList<String>> menuCard=new LinkedList<>();
	//System.out.println("menu");
		menu.add("abs");
		menu.add("hgfkh");
		menu.add("jhgjgm");
		menu.add("jk");

		//submenu.add("yu");

		//System.out.println(submenu);
		//System.out.println("submenu");
		submenu.add("uiusjka");
		submenu.add("kshaj");

		menuCard.add(menu);
		for (String me:menu) {
			System.out.println("menu card is "+me);
			menuCard.add(submenu);
			for(LinkedList<String> m:menuCard)
			{
				if(m.removeAll(menu))
				{
				System.out.println("subManu is following");
				}
				else
					System.out.println(m);
				}
			}

		}

		/*Iterator<LinkedList<String>> ite=menuCard.iterator();
		while(ite.hasNext())
		{
			LinkedList<String>i=ite.next();
			Iterator<String >
			System.out.println("menu"+ite.next());
		}*/

}


package com.github.intangir.IdentityOverride.Commands;

import com.github.intangir.IdentityOverride.MainConfig;
import com.github.intangir.IdentityOverride.NameOverrides;

import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.plugin.Command;

@SuppressWarnings("deprecation")
public class NameCommand extends Command {

	public String command;
	public MainConfig config;
	public NameOverrides names;

	public NameCommand(MainConfig config, NameOverrides names) {
		super(config.getCommand("name"), "override.name", config.getAliases("name"));
		command = config.getCommand("name");
		this.config = config;
		this.names = names;
	}

	@Override
	public void execute(CommandSender sender, String[] args) {
		if(args.length == 2) {
			String uuid = args[0];
			names.put(uuid, args[1]);
			sender.sendMessage(ChatColor.YELLOW + "Overriding Name for " + uuid + " to " + args[1]);
		} else {
			sender.sendMessage(ChatColor.RED + "Usage: /" + command + " [currentname/uuid] [newname]");
		}
	}
}


# What's next?

- Ambiguous and imaginary time detection?
    - Currently available via `dateutil.tz`:
        - `tz.datetime_ambiguous`
        - `tz.datetime_exists`
        - `tz.resolve_imaginary`

- Improvements to `datetime` arithmetic

    - Separate built-in functions for absolute and wall time
    - Possible minor changes to the semantics of datetime subtraction

- Leap second support

    - Needs changes to the `datetime` class
    - Leap second data is included in `tzdata` and IANA database
    - Looking for real use cases

--

# What you can do

- Be an early adopter!

- Help add support for `zoneinfo` zones in popular libraries

    - `pytz-deprecation-shim` may work with Django, but `zoneinfo` won't out of the box (yet)
    - `pandas` makes extensive use of the private API for `pytz` and `dateutil`, and will not work with `zoneinfo` (as of 1.1.4)

- Start updating documentation and StackOverflow questions to recommend `zoneinfo`

- Bring me your real-world leap second use cases!


package at.htlgkr.festlever.services;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;

import androidx.annotation.Nullable;

import at.htlgkr.festlever.logic.FireBaseCommunication;

public class UpdateService extends Service {

    Thread thread;

    @Nullable
    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }

    @Override
    public void onCreate() {
        thread = new Thread(this::doInBackground);
        super.onCreate();
    }

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        thread.start();
        return super.onStartCommand(intent, flags, startId);
    }

    @Override
    public void onDestroy() {
        thread.interrupt();
        thread = null;
        super.onDestroy();
    }

    private void doInBackground(){
        while(true){
            long whaitUntil = System.currentTimeMillis() + 300000;
            while(System.currentTimeMillis() < whaitUntil){}

            new FireBaseCommunication().getAllEvents(true);
            new FireBaseCommunication().getAllUsers(true);
        }
    }
}


Baker's Oven
============

An easy way to create valid hpubs for the Baker Framework.

About Baker
-----------

Baker Framework allows simple creation of HTML5-based eBooks. There is
a simple specification for html-based books that has been developed for
Baker - hpub.

Installing Baker's Oven
--------------------

Baker's Oven is a padrino-based application (running on Ruby). To
install:

1. Download Baker's Oven
2. `$ bundle install`
3. `$ padrino rake dm:auto:migrate`
4. `$ padrino rake seed`

By default, the database for Baker's oven will be SQLite3. The seed step
allows you to set an administrator username/password.

Running Baker's Oven
--------------------

1. `$ rackup`
2. Go to the admin panel in your browser: http://localhost:9292/admin
3. Follow directions to create book
4. Preview at http://localhost:9292/

Running on a Remote Server
--------------------------

Currently not supported - need to figure out the most efficient way to
allow multiple books to be built (currently all built in a single tmp/book dir
in the filesystem).


package <missing>;

public class GlobalMembers
{
	public static int Main()
	{
	String c = new String(new char[2000]);
	char[][] x = new char[2000][100];
	int n;
	int m;
	int j;
	int len;
	int i;
	int max;
	int[] p = new int[2000];
	int[] co = new int[2000];
	String tempVar = ConsoleInput.scanfRead();
	if (tempVar != null)
	{
		m = Integer.parseInt(tempVar);
	}
	c = new Scanner(System.in).nextLine();
	len = c.length();
	for (i = 0;i <= len - m;i++)
	{
	 for (j = 0;j <= m - 1;j++)
	 {
		x[i][j] = c.charAt(i + j);
	 }
	}
	for (i = 0;i <= len - m - 1;i++)
	{
		 p[i] = 0;
	 for (j = i + 1;j <= len - m;j++)
	 {
	  if (strcmp(x[i],x[j]) == 0 && p[j] == 0)
	  {
		co[i]++;
		p[j] = 1;
	  }
	 }
	}
	 max = 0;
	for (i = 0;i <= len - m;i++)
	{
	if (max < co[i])
	{
		max = co[i];
	}
	}
	if (max + 1 <= 1)
	{
		System.out.print("NO");
	}
	else
	{
		System.out.printf("%d\n",max + 1);
	for (i = 0;i <= len - m;i++)
	{
	if (co[i] == max)
	{
		System.out.printf("%s\n",x[i]);
	}
	}
	}
	}
}


package com.tweet.follow.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.neo4j.graphdb.Direction;
import org.springframework.data.annotation.Transient;
import org.springframework.data.neo4j.annotation.GraphId;
import org.springframework.data.neo4j.annotation.Indexed;
import org.springframework.data.neo4j.annotation.NodeEntity;
import org.springframework.data.neo4j.annotation.RelatedToVia;

import java.util.Set;

/**
 * User
 */
@Getter
@Setter
@Builder
@AllArgsConstructor
@NoArgsConstructor
@NodeEntity
@ApiModel(value = "usuario", description = "Informação de usuário e seus relacionamentos")
public class User {

    @GraphId
    @JsonIgnore
    private Long nodeId;
    @Indexed(unique = true)
    @ApiModelProperty(name = "Nome de usuário", required = true, example = "userabc", value = "Username")
    private String id;
    @RelatedToVia(type = Relationship.FOLLOWING, direction = Direction.OUTGOING)
    @JsonIgnore
    private Set<FollowInfo> following;
    @Transient
    private String name;

}


/**
 * RelationShipEntity.java
 * io.znz.jsite.visa.entity.relationship
 * Copyright (c) 2017, 北京科技有限公司版权所有.
*/

package io.znz.jsite.visa.entity.relationship;

import java.util.Date;

import lombok.Data;

import org.nutz.dao.entity.annotation.Column;
import org.nutz.dao.entity.annotation.Comment;
import org.nutz.dao.entity.annotation.Id;
import org.nutz.dao.entity.annotation.Table;

/**
 * 与你的关系
 * @author   崔建斌
 * @Date	 2017年6月22日
 */
@Data
@Table("visa_new_relationship")
public class RelationShipEntity {
	@Id(auto = true)
	@Column
	@Comment("主键")
	private long id;
	@Column
	@Comment("客户id")
	private long customerId;
	@Column
	@Comment("订单id")
	private long orderId;
	@Column
	@Comment("美国联系地址")
	private String contactAddress;
	@Column
	@Comment("电话号码")
	private String phone;
	@Column
	@Comment("电子邮箱")
	private String email;
	@Column
	@Comment("创建时间")
	private Date createTime;
	@Column
	@Comment("更新时间")
	private Date updateTime;
	@Column
	@Comment("状态")
	private Integer status;
	@Column
	@Comment("备注")
	private String remark;
}


package de.uni_koeln.spinfo.ang;
import java.io.IOException;

import de.bkis.climate.Climate;

public class Main {

	public static void main(String[] args) {
		Climate cli = new Climate("-");
		cli.addArgument("termsFile");
		cli.addArgument("typesFile");
		cli.addArgument("corpusDir");
		cli.addArgument("matrixFile");
		cli.addArgument("nMostFreqDimensions");
		cli.addArgument("nMostFreqTerms");

		for (int i = 0; i < args.length; i++) {
			if (cli.hasArgument(args[i].replaceAll("-", ""))){
				cli.addArgument(args[i].replaceAll("-", ""), args[i+1]);
				i++;
			} else {
				System.err.println("DA LÄUFT WAS SCHIEF!");
			}
		}

		AngAnalysis ang = new AngAnalysis();
		try {
			ang.analyze(cli.getValue("termsFile"),
					cli.getValue("typesFile"),
					cli.getValue("corpusDir"),
					cli.getValue("matrixFile"),
					cli.getValue("nMostFreqDimensions"),
					cli.getValue("nMostFreqTerms"));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

}


package edu.gemini.spdb.reports.util;

import edu.gemini.spdb.reports.IColumn;
import edu.gemini.spdb.reports.ISort;

/**
 * Trivial javabean implementation of ISort. Just a container.
 * @author rnorris
 */
public class SimpleSort implements ISort {

	private static final long serialVersionUID = 1L;

	private final IColumn column;
	private Order order;
	private NullPolicy nullPolicy;

	public SimpleSort(IColumn column) {
		this(column, Order.ASC);
	}

	public SimpleSort(IColumn column, Order order) {
		this(column, order, NullPolicy.NULL_LAST);
	}

	public SimpleSort(IColumn column, Order order, NullPolicy nullPolicy) {
		this.column = column;
		this.order = order;
		this.nullPolicy = nullPolicy;
	}

	public NullPolicy getNullPolicy() {
		return nullPolicy;
	}

	public void setNullPolicy(NullPolicy nullPolicy) {
		this.nullPolicy = nullPolicy;
	}

	public Order getOrder() {
		return order;
	}

	public void setOrder(Order order) {
		this.order = order;
	}

	public IColumn getColumn() {
		return column;
	}

}


package com.shu.controller;

import com.shu.service.StudentService;
import org.json.Cookie;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CookieValue;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by Dell on 2017/4/17.
 */
@Controller
@RequestMapping(value = "student")
public class StudentController {
    @Autowired
    private StudentService studentService;

    @RequestMapping(value = "/")
    public String index() {
        return "student";
    }

    @RequestMapping(value = "/data",produces = "text/html;charset=utf-8")
    @ResponseBody
    public String getStudentData(@CookieValue(value = "id") String id) {
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("id", id);
        jsonObject.put("name",studentService.getStudent(id).getName());
        jsonObject.put("department",studentService.getDepartment(id).getName());
        return jsonObject.toString();
    }
}


package io.anemos.metastore.metastep;

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

public class GitLabMagic {

  boolean gitLabEmptyCall = false;
  String[] gitLabArgs = null;
  String workDir = null;

  public GitLabMagic() {
    System.out.println("GitLab detected, starting magic mode (tested on GitLab 11.5).");
    Scanner scanner = new Scanner(System.in);
    while (scanner.hasNext()) {
      String line = scanner.nextLine();

      if (line.startsWith(": | eval")) {
        Pattern pattern = Pattern.compile(".*\\\\'cd\\\\' \\\"(.*)\\\"");

        String[] tokens = line.split("\\\\n");
        for (String token : tokens) {
          Matcher matcher = pattern.matcher(token);
          if (matcher.matches()) {
            workDir = matcher.group(1);
          }
        }
        if (tokens.length < 2) {
          gitLabEmptyCall = true;
        } else {
          gitLabArgs = tokens[tokens.length - 2].split(" ");
        }
      }
    }

    scanner.close();
  }
}


package com.somnus.springboot;

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

import com.somnus.springboot.service.Transaction1stService;
import com.somnus.springboot.service.Transaction2ndService;
import com.somnus.springboot.service.Transaction3rdService;
import com.somnus.springboot.service.Transaction4thService;

@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = Application.class)
public class TransactionServiceTest {

	@Autowired
    private Transaction1stService service1st;
	@Autowired
    private Transaction2ndService service2nd;
	@Autowired
    private Transaction3rdService service3rd;
	@Autowired
    private Transaction4thService service4th;

	@Test
	public void service1st(){
		service1st.parent();
	}

	@Test
	public void service2nd(){
		service2nd.parent();
	}

	@Test
	public void service3rd(){
		service3rd.parent();
	}

	@Test
	public void service4th(){
		service4th.parent();
	}
}


package function;

import javax.swing.*;
import java.awt.event.*;
import java.io.*;
import java.net.*;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;

public class Read implements ActionListener {
    public static String text = null;
    static HashMap<String, Integer> map = new HashMap<String, Integer>();
    public void actionPerformed(ActionEvent e) {
        if (text != null) {
            JOptionPane.showMessageDialog(null, "已经载入成功，无需再次载入");
        }
        else {
            try {
                Socket s = new Socket("127.0.0.1",9999);
                BufferedReader in = new BufferedReader(new InputStreamReader(s.getInputStream(), StandardCharsets.UTF_8));
                String str = null;
                while ((str = in.readLine()) != null) {
                    text = text + str + "\n";
                    if (text.contains("http://Www.Qisuu.Com")) break;
                    //System.out.println(str);
                }
                s.close();
                in.close();
                JOptionPane.showMessageDialog(null, "载入成功");
            } catch (Exception a) {}
        }

    }
}


package com.youtell.backchat.tiles;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;

import com.youtell.backchat.Util;
import com.youtell.backchat.models.Friend;
import com.youtell.backchat.models.Gab;
import com.youtell.backchat.R;
import com.youtell.backchat.R.drawable;

public class GabTile extends Tile {
	public GabTile(Context context, ViewGroup group) {
		super(context, group);
	}

	@Override
	public void fill(Object obj) {
		setAlpha(1.0);

		Gab gab = (Gab)obj;
		this.titleLabel.setText(gab.getTitle());
		this.subtitleLabel.setText(gab.getContentSummary());
		this.timeLabel.setVisibility(View.VISIBLE);
		this.timeLabel.setText(Util.humanDateTime(context, gab.getUpdatedAt()));
		if(gab.isUnread()) {
			this.attributeIcon.setVisibility(View.VISIBLE);
			this.attributeIcon.setBackgroundResource(R.drawable.read_accessory);
		}
		else {
			this.attributeIcon.setVisibility(View.INVISIBLE);
		}

		loadAvatar(gab.getRelatedAvatar());
	}
}


package com.telstra.tdm.common.dto.Inventory;

import java.util.List;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.telstra.tdm.common.Enum.StatusEnum;
import com.telstra.tdm.common.dto.resource.RequestBaseDto;

import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper=false)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class  ResourceOrderRequestDto extends RequestBaseDto {

	@JsonIgnore
    private StatusEnum resOrderstatus;
    private String type;
    private String resourceValue;
    private String environment;
    private String source;
    private String triggerSystem;
    private String orderId;
    private String orderSubtype;
    private String orderServiceType;
    private String orderTechnology;
    private String orderClass;
    private String orderPlan;
    private String orderStatus;
    private String orderPayload;
    @JsonIgnore
    private List<InventoryRequestDto> inventories;
    private List<OrderProductDetailDto> productDetails;
    private List<ResourceAdditionalDetailDto> additionalDetails;
}


/*
 * 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.nihr.model;

import com.nihr.controller.Printer;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;

/**
 *
 * @author sa841
 */
@ManagedBean(name = "nameStructure")
public class NameStructureView implements Serializable {

    public List<NameStructure> lNameStructure;

    @PostConstruct
    public void init() {
        lNameStructure = new ArrayList();
        Printer printer = new Printer();
        printer.printStructure(this.lNameStructure);
    }

    public List<NameStructure> getlOIDStructure() {
        return lNameStructure;
    }

    public void setlOIDStructure(List<NameStructure> lNameStructure) {
        this.lNameStructure = lNameStructure;
    }

    public void addOIDStructure(NameStructure namestructure) {
        this.lNameStructure.add(namestructure);
    }

}


# Alexa-Intrinio
**An Amazon Alexa Intrinio Skill**

This is an API for the unofficial Intrinio Amazon Alexa skill: [Market Savvy](https://www.amazon.com/Kevin-Mircovich-Apps-Market-Savvy/dp/B01N4OW2Z4)

Status: Published

## Demo
"What was the opening price for Apple?" `120 dollars and 0 cents per share.`

"What was the closing price for Amazon?" `844 dollars and 43 cents per share.`

"What was the last price for Facebook?" `128 dollars and 94 cents per share.`

"What is the 52 week low for Bank of America" `$10.99 per share`

"How many employees does Tesla have" `13,058`

## Contribute
Clone project

`npm i` to install dependencies.

`npm install -g foreman` install node-foreman globally

Set these global vars:
- `AMAZONAPPID` (the amazon id in req needs to match the one in the environment to authenticate)
- `INTRINIO_USERNAME`
- `INTRINIO_PASSWORD`

`nf run nodemon app.js` to serve app locally.

Runs on node verion: `5.6.0`

## TODO
- add a db to store every request, intent, and if it was successfully responded to (for reporting and improving the service).
- create unit tests for each service
- create end-to-end tests


----
# ForeverAFK
**Website:** [foreverafk.net](http://www.foreverafk.net)
**Minecraft IP:** mc.ForeverAFK.net

----
## Introduction

>This project will contain a plugin (or multiple plugins) for use in a [Bukkit](https://bukkit.org/) or [Spigot](http://www.spigotmc.org/) server. The main purpose is to reduce the dependency on other plugins that may be out-of-date or not have enough (or have way too many) features. Specifically designed for a multiworld SMP server with a free world and a protected world.

----
## Versions
* 0.1 - No functionality

----
## Future Features
* Mod TP - TP to players and be set into gamemode 3
* Bedtime timer - Once 1/2 of the people in one world go to bed it will become daytime
* /warn <player> [reason] give formal written and logged warnings

----
## Links
* [Spigot API documentation](https://hub.spigotmc.org/javadocs/spigot/)
* [SpigotMC Developer Hub](https://hub.spigotmc.org/)
* [BukkitWiki](http://wiki.bukkit.org/Main_Page)


package com.avionte.status.beepbeep.core.services;

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

public class StatusRepository implements IStatusRepository {
	private HashMap<String, Boolean> currentStatuses;
	private final Lock currentStatusToken = new ReentrantLock();

	public StatusRepository() {
		currentStatuses = new HashMap<String, Boolean>();
	}

	public HashMap<String,Boolean> getCurrentStatuses(){
		HashMap<String,Boolean> statusSnapshot = new HashMap<String, Boolean>();

		try {
			currentStatusToken.lock();
			statusSnapshot.putAll(currentStatuses);
		} finally {
			currentStatusToken.unlock();
		}

		return statusSnapshot;
	}

	public void updateCurrentStatus(String configuration, boolean isGood) {
		try {
			currentStatusToken.lock();
			currentStatuses.put(configuration, isGood);
		} finally {
			currentStatusToken.unlock();
		}
	}
}


package org.rhq.misc.checkstyle;

import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;

import com.puppycrawl.tools.checkstyle.api.AuditEvent;
import com.puppycrawl.tools.checkstyle.api.AutomaticBean;
import com.puppycrawl.tools.checkstyle.api.Filter;
import com.puppycrawl.tools.checkstyle.api.Utils;

/**
 * Inclusion Filter for checkstyle
 * Follows the example from http://checkstyle.sourceforge.net/writingfilters.html
 */
@SuppressWarnings("unused")
public class InclusionFilter extends AutomaticBean implements Filter {

    private Pattern mFileRegexp;

    public InclusionFilter()
        throws PatternSyntaxException
    {
        setFiles("^$");
    }

    public boolean accept(AuditEvent aEvent)
    {
        final String fileName = aEvent.getFileName();
        boolean matches = (fileName != null) && mFileRegexp.matcher(fileName).find();
        return matches;
    }

    public void setFiles(String aFilesPattern)
        throws PatternSyntaxException
    {
        mFileRegexp = Utils.getPattern(aFilesPattern);
    }
}


package com.catalanrenegado.tinkdatabase;

public interface Shell {
    default void startShell() {
        String command;
        String help = dotShell() ? ".help" : "help" ;
        String quit = dotShell() ? ".quit" : "quit" ;

        do {
            boolean commandErrored;
            command = Leer.leerTexto(this.getShellString() + ": ");
            if (command.startsWith(help)) {
                commandErrored = false;
                printHelp(command.replace(help,""));
            } else if (command.equals(quit)) {
                break;
            } else {
                commandErrored = !startShell(command);
            }
            if (commandErrored) {
                System.out.println("Orden desconocida");
                this.printHelp();
            }
        } while (true);
    }

    String getShellString();

    /**
     * @param command command to execute.
     * @return boolean representing the if the command inserted is right.
     */
    boolean startShell(String command);

    void printHelp();
    void printHelp(String command);

    default boolean dotShell() {
        return true;
    }
}


package com.order.model.vo;

import com.order.model.bo.Payment;
import lombok.Data;

import java.time.LocalDateTime;

@Data
public class PaymentRetVo{

    private Long id;

    private Long amount;

    private Long actualAmount;

    private String paymentPattern;

    private LocalDateTime payTime;

    private LocalDateTime beginTime;

    private LocalDateTime endTime;

    private Long orderId;

    private Long aftersaleId;

    private Byte state;

    private LocalDateTime gmtCreate;

    private LocalDateTime gmtModified;

    public PaymentRetVo(Payment payment) {
        this.actualAmount=payment.getActualAmount();
        this.amount=payment.getAmount();
        this.beginTime=payment.getBeginTime();
        this.endTime=payment.getEndTime();
        this.gmtCreate=payment.getGmtCreate();
        this.gmtModified=payment.getGmtModified();
        this.id=payment.getId();
        this.orderId=payment.getOrderId();
        this.paymentPattern=payment.getPaymentPattern();
        this.payTime=payment.getPayTime();
        this.state=payment.getState();
        this.aftersaleId=payment.getAftersaleId();
    }

}


package com.epam.lab.buyit.controller.web.servlet.user.login;

import java.io.IOException;

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

import com.epam.lab.buyit.controller.service.user.UserServiceImpl;

public class CheckLoginServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
	private UserServiceImpl service;

	public void init() {
		service = new UserServiceImpl();
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		String login = request.getParameter("login");
		String responseText = login;
		if(service.checkLogin(login)) {
			responseText = "This login allready exists";
		}
		response.setContentType("text/plain");
		response.setCharacterEncoding("UTF-8");
		response.getWriter().write(responseText);
	}

}


package example.weather;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;

import java.util.Optional;

@Component
public class WeatherClient {
    private final RestTemplate restTemplate;
    private final String weatherUrl;
    private final String weatherServiceApiKey;

    @Autowired
    public WeatherClient(final RestTemplate restTemplate,
                         @Value("${weather.url}") final String weatherUrl,
                         @Value("${weather.api_secret}") final String weatherServiceApiKey) {
        this.restTemplate = restTemplate;
        this.weatherUrl = weatherUrl;
        this.weatherServiceApiKey = weatherServiceApiKey;
    }

    public Optional<WeatherResponse> fetchWeather(final String latitude, final String longitude) {
        String url = String.format("%s/%s/%s,%s", weatherUrl, weatherServiceApiKey, latitude, longitude);

        return Optional.ofNullable(restTemplate.getForObject(url, WeatherResponse.class));
    }

}


package echoserver;

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

class MessageSender {

    private final BufferedReader input;
    private final PrintWriter output;

    MessageSender(BufferedReader input, PrintWriter output) {
        this.input = input;
        this.output = output;
    }

    void run() {
        while (true) {
            var message = receiveMessage();
            if (isEndOfMessages(message)) {
                break;
            }
            sendMessage(message);
        }
    }

    private boolean isEndOfMessages(String message) {
        return message == null || message.equals(SocketAction.exit.toString());
    }

    private String receiveMessage() {
        try {
            return input.readLine();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    private void sendMessage(String message) {
        output.println(Messages.echoFromServerMessage(message));
    }
}


[![Build Status](https://dev.azure.com/mathandoro/CoachPlus/_apis/build/status/coach-plus.android?branchName=master)](https://dev.azure.com/mathandoro/CoachPlus/_build/latest?definitionId=6&branchName=master)

# android
Coach+ Android App

## Setup
1. Download google-services.json from Firebase and put it inside the android/app/ directory

## Releases
New features can be tested using the Coach+ Early Access version. Note that you can't access productive data when using Coach+ Early Access.

## Create new Release (Owners only)
Make sure that you increment the versionName manually in `/app/build.gradle` for every release to production.
The versionCode is incremented automatically via a fastlane plugin.

```
versionName "1.1.4"
```

Once the build was successfull you can [trigger a new release](https://dev.azure.com/mathandoro/CoachPlus/_release?definitionId=3&view=mine&_a=releases). The app will be deployed to Coach+ (Early Access) first. Once you think it's ready to be published to production, simply  approve the pending approval in the release build.


package uk.co.mould.matt.vocabinator;

public class Question {
    public final String questionWord;
    public final String correctAnswer;

    public Question(String questionWord, String correctAnswer) {
        this.questionWord = questionWord;
        this.correctAnswer = correctAnswer;
    }

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

        Question question = (Question) o;

        if (questionWord != null ? !questionWord.equals(question.questionWord) : question.questionWord != null)
            return false;
        return correctAnswer != null ? correctAnswer.equals(question.correctAnswer) : question.correctAnswer == null;

    }

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


package de.nordakademie.github.beans;

import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;

public class Century {

    private Path directoryPath;
    private String name;
    private List<Student> students = new ArrayList<>();

    public Century(Path directoryPath) {
        this.directoryPath = directoryPath;
        String directory = directoryPath.toString();
        this.name = directory.replaceAll("\\\\", "/").substring(directory.lastIndexOf("/")+1);
    }

    public Path getDirectoryPath() {
        return directoryPath;
    }

    public String getName() {
        return name;
    }

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

    public void addStudent(Student student) {
        students.add(student);
    }

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

        Century century = (Century) o;

        return directoryPath.equals(century.directoryPath);

    }

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

}


package com.learningProject.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

import com.learningProject.controller.GraphQLController;
import com.learningProject.controller.RestExceptionHandler;
import com.learningProject.controller.UserController;
import com.learningProject.repository.UserRepository;
import com.learningProject.service.UserService;
import com.learningProject.service.UserServiceImpl;

@Configuration
@Import({JpaConfig.class, SecurityConfig.class})
public class Config {

	@Autowired
	private UserRepository userRepository;

	@Bean
	public UserService userService() {
		return new UserServiceImpl(userRepository);
	}

	@Bean
	public UserController userController() {
		return new UserController(userService());
	}

	@Bean
	public GraphQLController graphQLController() {
		return new GraphQLController(userService());
	}

	@Bean
	public RestExceptionHandler restExceptionHandler () {
		return new RestExceptionHandler();
	}
}


/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.scolere.lms.common.utils;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Web application lifecycle listener.
 *
 * @author dell
 */
@WebListener()
public class ApplContextListener implements ServletContextListener {
    Logger logger = LoggerFactory.getLogger(ApplContextListener.class);

    @Override
    public void contextInitialized(ServletContextEvent sce) {
        sce.getServletContext().log("Context initialized...........");
        PropertyManager propertyManager= new PropertyManager();
        sce.getServletContext().log("Application property loaded..."+propertyManager.getProperty("TEST.MESSAGE.WELCOME"));

        logger.info("logger configured.");
    }

    @Override
    public void contextDestroyed(ServletContextEvent sce) {
    	sce.getServletContext().log("Context destroyed...........");
    }

}


package com.client.manager.ui.configuration;

import com.client.manager.ui.service.IUserService;
import com.client.manager.ui.util.SecurityUtil;
import org.springframework.security.authentication.BadCredentialsException;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.stereotype.Service;

import java.util.Optional;

@Service("userDetailsService")
public class UserDetailsServiceImpl implements UserDetailsService {

    private final IUserService userService;

    public UserDetailsServiceImpl(IUserService userService) {
        this.userService = userService;
    }

    @Override
    public UserDetails loadUserByUsername(String username) {
        return Optional.ofNullable(userService.findByUsername(username).getBody())
                .map(SecurityUtil::buildSecurityUserFrom)
                .orElseThrow(() -> new BadCredentialsException("Bad Credentials"));
    }
}


package evilorange.jee.ejb;

import java.util.List;

import javax.enterprise.context.ApplicationScoped;
import javax.inject.Named;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import javax.transaction.Transactional;

import evilorange.jee.model.User;

@Named
@ApplicationScoped
public class PersistenceController {

    @PersistenceContext(unitName = "myPU")
    EntityManager em;

    @Transactional
    public String saveRandom() {
        final User entity = new User();
        entity.setFirstName("Andrey");
        entity.setLastName(String.valueOf(Math.random()));
        entity.setImageUrl("");
        entity.setPasswordConfirmation("1");
        entity.setPassword("1");
        em.persist(entity);
        return "";

    }
    @Transactional
    public String getUser() {
        final User user = em.find(User.class, 1L);
        return "";
    }

    public List<User> getUserList() {
        final Query query = em.createQuery(
                "select u from User as u");
        List<User> list = query.getResultList();
        return list;
    }

}


package com.test.socksapp.di;

import com.test.socksapp.repository.SockRepository;
import com.test.socksapp.usecase.GetCount;
import com.test.socksapp.usecase.GetSocks;
import com.test.socksapp.usecase.RegIncome;
import com.test.socksapp.usecase.RegOutcome;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class DIConfig {
    private SockRepository sockRepository;

    @Autowired
    public DIConfig(SockRepository sockRepository) {
        this.sockRepository = sockRepository;
    }

    @Bean
    public GetCount getCount() {
        return new GetCount(sockRepository);
    }

    @Bean
    public RegIncome regIncome() {
        return new RegIncome(sockRepository);
    }

    @Bean
    public RegOutcome regOutcome() {
        return new RegOutcome(sockRepository);
    }

    @Bean
    public GetSocks getSocks() {
        return new GetSocks(sockRepository);
    }
}


package com.springbootexample.xworkz.service;

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

import com.springbootexample.xworkz.dto.PrintDTO;
import com.springbootexample.xworkz.entity.PrintEntity;
import com.springbootexample.xworkz.repository.PrintRepo;

import lombok.extern.slf4j.Slf4j;

@Service
@Slf4j
public class PrintServiceImpl implements PrintService {

	@Autowired
	private PrintRepo printrepository;

	public PrintServiceImpl() {
		log.info(this.getClass().getSimpleName() + "  created");
	}

	@Override
	public PrintDTO savethedetails(PrintDTO printdto) {
		log.info(this.getClass().getSimpleName()+"is created");
		try {
			PrintEntity printentity = new PrintEntity();
			printentity.setFrom(printdto.getFrom());
			printentity.setMessage(printdto.getMessage());
			printentity = printrepository.save(printentity);
			if (printentity.getId() != null) {
				printdto.setId(printentity.getId());
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		return printdto;
	}

}


package com.doc;

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

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import com.doc.model.Employee;
import com.doc.repository.EmpRepository;

@SpringBootApplication
public class DockerSpringApplication implements CommandLineRunner{

	@Autowired
	EmpRepository emprepo;

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

	@Override
	public void run(String... arg0) throws Exception {
		List<Employee> elist=new ArrayList<>();
		Employee emp1=new Employee("Soumyajit Das","BIW Fixture Designer");
		Employee emp2=new Employee("Rajesh Das","BM");
		Employee emp3=new Employee("Ankit Anubhav","Software Engineer");
		elist.add(emp1);
		elist.add(emp2);
		elist.add(emp3);
		emprepo.save(elist);
	}
}


package com.example.mcourse;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.widget.ProgressBar;

public class course_web_activity extends AppCompatActivity {
    public static String URL;

    private ProgressBar progressBar;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_course_web_activity);
        WebView webView = findViewById(R.id.webview);
        progressBar = findViewById(R.id.progressbar);
        webView.loadUrl(URL);

        webView.setWebChromeClient(new WebChromeClient() {
            @Override
            public void onProgressChanged(WebView view, int newProgress) {
                if (newProgress == 100) {
                    progressBar.setVisibility(View.GONE);
                } else {
                    progressBar.setVisibility(View.VISIBLE);
                    progressBar.setProgress(newProgress);
                }
            }
        });
    }

}


package jp.drjoy.service.grpc.starter.configure;

import jp.drjoy.service.grpc.starter.EnableGrpcServer;
import jp.drjoy.service.grpc.starter.runner.GrpcServerRunner;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfigureOrder;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 *
 * Created by k.sumi on 6/13/2017.
 */
@Configuration
@EnableConfigurationProperties(GrpcProperties.class)
@AutoConfigureOrder
public class GrpcAutoConfiguration {

    private GrpcProperties grpcProperties;

    @Autowired
    public GrpcAutoConfiguration(GrpcProperties grpcProperties) {
        this.grpcProperties = grpcProperties;
    }

    @Bean
    @ConditionalOnBean(annotation = EnableGrpcServer.class)
    public GrpcServerRunner grpcServerRunner() {
        return new GrpcServerRunner(grpcProperties);
    }
}


import javax.swing.JPanel;
import java.awt.Graphics;
import java.awt.Color;

/**
 *
 *
 * @author Abdul Asif, Zohaib Asif
 */
abstract public class GameObj extends Thread {

    protected int x;
    protected int y;
    protected int width;
    protected int height;
    protected int speedX;
    protected int speedY;
    protected Color color;
    protected JPanel container;

    private boolean running;

    public GameObj(int x, int y, int width, int height, int speedX, int speedY,  Color color, JPanel container) {
        this.x = x;
        this.y = y;
        this.width = width;
        this.height = height;
        this.speedX = speedX;
        this.speedY = speedY;
        this.color = color;
        this.container = container;

        this.running = true;
    }

    public void draw(Graphics g) {
        g.setColor(color);
        g.fillRect(x,y,width,height);
    }

    public boolean isRunning() {
        return running;
    }

    public void stopRunning() {
        running = false;
    }

    public void contain(){}

    public void run(){}

}