package com.xll.enums;

/**
 * Created by lonely.xia on 2017/10/17.
 */
public enum ResponseEnum {

    INSERT_SUCCESS("插入成功" , 200) ,
    INSERT_FAIL("插入失败" , -101) ,
    INSERT_OR_UPDATE_ROLE_NAME_DUPLICATION("插入或更新重复角色名" , -102) ,
    UPDATE_SUCCESS("更新成功" , 200) ,
    UPDATE_FAIL("更新失败" , -201) ,
    SELECT_SUCCESS("查询成功" , 200) ,
    SELECT_FAIL("查询失败" , -301) ,
    DELETE_SUCCESS("删除成功" , 200) ,
    DELETE_FAIL("删除失败" , -401) ,
    INSERT_NAME_OR_EMAIL_DUPLICATION("插入重复用户名或邮箱" , -501) ,
    UPDATE_NAME_DUPLICATION("更新的用户名已存在" , -601) ,
    UPDATE_EMAIL_DUPLICATION("更新的用户邮箱已存在" , -701) ,
    INSERT_OR_UPDATE_TITLE_DUPLICATION("插入或更新重复的权限TITLE" , -502) ,
    OK("成功" , 200);

    private String name;
    private int code;

    private ResponseEnum(String name , int code) {
        this.name = name;
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public int getCode() {
        return code;
    }

}


package commands;

import DAO.UsuarioDAO;
import entidade.Usuario;
import java.io.IOException;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class EditarNome implements Command {

    @Override
    public void execute(HttpServletRequest request, HttpServletResponse response) {
        try{

            UsuarioDAO dao = new UsuarioDAO();
            Usuario usr = (Usuario)dao.getPojo((String)((request.getSession().getAttribute("usuario"))+""));
            usr.setNome(request.getParameter("nome"));
            dao.updatePojo(usr);
            RequestDispatcher d = request.getRequestDispatcher("/editarPerfil.jsp?sucesso=Nome editado com sucesso!");
            d.forward(request, response);
        }catch(IOException | ServletException ex){
            throw new RuntimeException(ex);
        }
    }

}


# Zeppelin notes

## Installing Zeppelin
Download the Zeppelin binary package for your environment. Things are most simple if you choose the "Package with all interpreters".
https://zeppelin.apache.org/docs/0.7.3/install/install.html

Initially, start the Zeppelin server from the terminal. It will run in the background as a daemon. Later, you can find out how to do it in a more organized fashion.

Open now a browser window or tab, with the URL:
http://localhost:8080/
This should show the local Zeppelin home page, with the initial sample notebooks.

## Using the AM4 notebooks

Clone the Zeppelin repository somewhere:
```
git clone https://github.com/kic-markon/Zeppelin.git
```
This will create the local copy of the AM4 Zeppelin notebook repository, with the "notebook" directory inside.
Copy or link this into your zeppelin directory, instead of the original notebook directory.

If you restart now the Zeppelin server, the notebooks become available.


# Dynamic blog

This app was created to test dynamic routing on Rails.

So, lets say that John wants to create his own blog. What we are looking for is that once John is registered in the system, the route `dynamic-blog/john` becomes immediately available within the app.
And with that set up, John can start posting articles/events and whatnot  on the `dynamic-blog/john/events` url.

In other words, I just wanted to test how to modify Rails routes so that we won't have to search by `:id` anymore ¯\\_(ツ)_/¯

Note: FriendlyId made it really, really simple :)

Note: I took the opportunity to use two gems that I've never used before, `friendly_id` and `bootstrap`.

## Setup

Ruby version:

    2.5.1

System dependencies:

    rvm gemset create dynamic-blog
    rvm gemset use dynamic-blog

    bundle install

## Resources

- [FriendlyId](https://github.com/norman/friendly_id)
- [Bootstrap Ruby Gem](https://github.com/twbs/bootstrap-rubygem)


package com.minecarts.miraclegrow.listener;

import com.minecarts.miraclegrow.MiracleGrow;
import com.minecarts.miraclegrow.BlockStateRestore.Cause;
import org.bukkit.event.world.*;
import org.bukkit.block.Block;
import org.bukkit.block.BlockState;

public class WorldListener extends org.bukkit.event.world.WorldListener {

    private MiracleGrow plugin;

    public WorldListener(MiracleGrow plugin) {
        this.plugin = plugin;
    }

    @Override
    public void onPortalCreate(PortalCreateEvent event) {
        if(event.isCancelled()) return;

        for(Block block : event.getBlocks()) {
            plugin.scheduleRestore(block, Cause.PLAYER);
        }
    }

    @Override
    public void onStructureGrow(StructureGrowEvent event) {
        if(event.isCancelled()) return;

        for(BlockState state : event.getBlocks()) {
            plugin.scheduleRestore(state.getBlock(), Cause.PLAYER);
        }
    }
}


package com.va.kotlintaste.service;

import android.annotation.SuppressLint;
import android.service.notification.NotificationListenerService;
import android.service.notification.StatusBarNotification;
import android.util.Log;

/**
 * Created by Junmeng.Chen on 2017/9/22.
 */

@SuppressLint("OverrideAbstract")
public class ListenerService extends NotificationListenerService {

    public static final String TAG = ListenerService.class.getSimpleName();

    @Override
    public void onListenerConnected() {
        super.onListenerConnected();
        Log.i(TAG, "onListenerConnected: ");
    }

    @Override
    public void onNotificationPosted(StatusBarNotification sbn) {
        super.onNotificationPosted(sbn);
        Log.i(TAG, "onNotificationPosted: ");
    }

    @Override
    public void onNotificationRemoved(StatusBarNotification sbn) {
        super.onNotificationRemoved(sbn);
        Log.i(TAG, "onNotificationRemoved: ");
    }
}


package com.orderhub.dao;

import net.sf.json.JSONObject;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;

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

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

class OrderBookDAOTest{

    @Autowired
    private OrderBookDAO orderBookDAO;

    @Test
    void getOrderBookBidBySymbol() {

    }

    @Test
    void getOrderBookAskBySymbol() {
    }

    @Test
    void getBestAskBySymbol() {
    }

    @Test
    void getBestBidBySymbol() {
    }

    @Test
    void getAllLevel1() {
        String bidSql = "select DISTINCT(Symbol) from bidorderbook";
        QueryRunner queryRunner = mock(QueryRunner.class);
        List<String> l =new ArrayList<>();
        l.add("symbol");
        when(queryRunner.query(bidSql)).thenReturn(l);
        JSONObject jsonObject = orderBookDAO.getAllLevel1();
        assertEquals(jsonObject.get("symbol"), "data");

    }
}


/*
 * Copyright 2014 Alibaba.com All right reserved. This software is the
 * confidential and proprietary information of Alibaba.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 Alibaba.com.
 */
package com.alibaba.ims.web.vo;

/**
 * 分页模型对象
 *
 * @author randy.ly 2014年12月10日 下午8:53:24
 */
public class PageVO
{

    private int current;

    private int start;

    private int limit;

    public int getCurrent()
    {
        return current;
    }

    public void setCurrent(int current)
    {
        this.current = current;
    }

    public int getStart()
    {
        return start;
    }

    public void setStart(int start)
    {
        this.start = start;
    }

    public int getLimit()
    {
        return limit;
    }

    public void setLimit(int limit)
    {
        this.limit = limit;
    }
}


package com.atguigu.atcrowdfunding.component;

import java.util.Collection;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;
import org.springframework.stereotype.Component;

import com.atguigu.atcrowdfunding.bean.TAdmin;

public class AppUserDetail  extends User {

	/**
	 *
	 */
	private static final long serialVersionUID = 1L;
	//封装TAmin
	private TAdmin admin;

	public AppUserDetail(String username, String password, boolean enabled, boolean accountNonExpired,
			boolean credentialsNonExpired, boolean accountNonLocked,
			Collection<? extends GrantedAuthority> authorities,TAdmin admin) {
		super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities);
		this.admin = admin;
	}

	public TAdmin getAdmin() {
		return admin;
	}

	public void setAdmin(TAdmin admin) {
		this.admin = admin;
	}

}


package com.mdzyuba.bakingtime.repository;

import java.io.IOException;
import java.io.InputStream;
import java.util.Scanner;

import androidx.annotation.Nullable;

class TestDataUtils {
    private static final String DELIMITER = "\\A";

    @Nullable
    public static String getJsonString(String fileName) throws IOException {
        ClassLoader classLoader = TestDataUtils.class.getClassLoader();
        if (classLoader == null) {
            return null;
        }
        try (InputStream inputStream =
                     classLoader.getResourceAsStream(fileName)) {
            if (inputStream == null) {
                return null;
            }
            Scanner scanner = new Scanner(inputStream);
            scanner.useDelimiter(DELIMITER);

            boolean hasInput = scanner.hasNext();
            if (hasInput) {
                return scanner.next();
            } else {
                return null;
            }
        }
    }

}


package com.hoang.lsp.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import com.hoang.lsp.events.ClickEvent;
import com.hoang.lsp.exception.BusinessException;
import com.hoang.lsp.service.LinkStatsService;

@Controller("clickProcessor")
public class ClickProcessorImpl implements ClickProcessor {

    private static final Logger LOGGER = LoggerFactory.getLogger(ClickProcessorImpl.class);

    @Autowired
    private LinkStatsService linkStatsService;

    @Override
    public void process (ClickEvent event) {
        LOGGER.info("Processing Click message: " + event.toString());

        try {
            this.linkStatsService.increaseClick(event);
        }
        catch (BusinessException be) {
            LOGGER.error("Error increasing Click for event: " + event.toString() + " - Cause: " + be.getMessage());
        }
    }
}


package com.ecp888.wxms.web.controller.notice;

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

import com.ecp888.wxms.vo.PageVO;
import com.ecp888.wxms.vo.notice.NoticeVO;
/**
 * APP广告位信息Form
 * @author ecp875
 * @since 2014-08-11
 */
public class NoticeForm {

	private PageVO pageVO=new PageVO();

	private NoticeVO noticeVO = new NoticeVO();

	private List<NoticeVO> noticeList = new ArrayList<NoticeVO>();

	private String data;

	public PageVO getPageVO() {
		return pageVO;
	}

	public void setPageVO(PageVO pageVO) {
		this.pageVO = pageVO;
	}

	public NoticeVO getNoticeVO() {
		return noticeVO;
	}

	public void setNoticeVO(NoticeVO noticeVO) {
		this.noticeVO = noticeVO;
	}

	public List<NoticeVO> getNoticeList() {
		return noticeList;
	}

	public void setNoticeList(List<NoticeVO> noticeList) {
		this.noticeList = noticeList;
	}

	public String getData() {
		return data;
	}

	public void setData(String data) {
		this.data = data;
	}

}


package sekta.platform.core.entity;

import javax.persistence.*;
import java.util.HashSet;
import java.util.Set;

/**
 * Created by Retro on 16.05.2016.
 */

@Entity
@Table(name = "forum_category_table")
public class ForumCategory {

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

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

    @OneToMany(mappedBy = "forumCategory")
    private Set<Message> messageSet= new HashSet<>();

    public ForumCategory() {
    }

    public long getId() {
        return id;
    }

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

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Set<Message> getMessageSet() {
        return messageSet;
    }

    public void setMessageSet(Set<Message> messageSet) {
        this.messageSet = messageSet;
    }
}


package demon.com.asyntaskdemo;

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

import java.net.MalformedURLException;
import java.net.URL;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class MainActivity extends AppCompatActivity {

    @BindView(R.id.down)
    Button down;
    @BindView(R.id.text)
    TextView text;

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

    @OnClick(R.id.down)
    public void onViewClicked(){
        DownloadTask task = new DownloadTask(this);
        try {
            task.execute(new URL("http://192.168.199.100:8080/mp3/Me.mp3"));
        } catch (MalformedURLException e) {
            e.printStackTrace();
        }
    }
}


package io.wijaya.external.stockbit_02.consumer;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class StockEntry {

    private LocalDateTime timestamp;

    private String code;

    private Integer price;

    private StockEntry(){}

    public LocalDateTime getTimestamp() {
        return timestamp;
    }

    public String getCode() {
        return code;
    }

    public Integer getPrice() {
        return price;
    }

    public static StockEntry parse(String s) throws Exception {
        String[] parts = s.split("\\|");
        if (parts.length < 3) {
            throw new IllegalArgumentException("invalid entry");
        }

        StockEntry entry = new StockEntry();
        entry.timestamp = LocalDateTime.parse(parts[0], DateTimeFormatter.ofPattern("yyyy-MMM-dd HH:mm:ss")).withSecond(0);
        entry.code = parts[1];
        entry.price = Integer.parseInt(parts[2]);

        return entry;
    }
}


package drools;

import org.kie.api.builder.ReleaseId;

/**
 * "Inspired" from
 * https://github.com/kiegroup/drools/blob/00657c78d252951abbf8b541a7fc2417df8d6fb1/drools-model/drools-model-compiler/src/test/java/org/drools/modelcompiler/KJARUtils.java#L21
 *
 */
public class KJARUtils {
  public static String getPom(final ReleaseId releaseId) {
    final String pom =
        "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
            + "         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\">\n" + "  <modelVersion>4.0.0</modelVersion>\n" + "\n"
            + "  <groupId>" + releaseId.getGroupId() + "</groupId>\n" + "  <artifactId>" + releaseId.getArtifactId() + "</artifactId>\n" + "  <version>" + releaseId.getVersion()
            + "</version>\n" + "</project>";
    return pom;
  }
}


color_follower
==============

Control code for a webcam-based color tracking/following robot

This is the code to run a BeagleBone Black based robot that follows a specified color.

The hardware requirements are:

        - A frame that utilizes two direct drive motors, one on either side of the robot.
        - A webcam (low resolution is fine, this script doesn't use anything higher than 320 x 240)
        - A BeagleBone Black to run the code and drive the PWM output
        - A motor driver board (Pololu dual bidirectional motor driver is best)
        - Several power sources: 5V usb battery for BBB, 9V (or appropriate) battery for motor power

The software requirements are:

        - Angstrom Linux running the 3.8.13 kernel
        - Saad Ahmad's beaglebone-black-cpp-PWM driver modifications installed
        - Customized adafruit-beaglebone-io-python (kiorpesc's fork - for fully functional PWM)
        - opencv and python-opencv installed


package gti310.tp3.parser;

import java.util.LinkedList;

/**
 *
 * Class contenant les lignes(details) du fichier
 *
 * @author Innocent Windsor Junior
 */
public class MazeLine {

	/** Variables de class */
	private String source;
	private String destination;
	private int weight;

	/** Méthode servant à initialiser un object MazeLine */
	MazeLine(String source, String destination, String weight){
		this.source = source;
		this.destination = destination;
		this.weight = Integer.parseInt(weight);
	}

	/** Mutateurs & accesseur */
	public String getSource() {
		return source;
	}
	public void setSource(String source) {
		this.source = source;
	}

	public String getDestination() {
		return destination;
	}
	public void setDestination(String destination) {
		this.destination = destination;
	}

	public int getweight() {
		return weight;
	}
	public void setweight(int weight) {
		this.weight = weight;
	}
}


package pl.edu.agh.java2015.ftp.server.gui.action;

import pl.edu.agh.java2015.ftp.server.session.SessionsManager;

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

/**
 * Created by Kamil on 03.02.2016.
 */
public class ConnectAction extends AbstractAction{
    SessionsManager manager;

    public ConnectAction(SessionsManager manager){
        super("Start");
        this.manager = manager;
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        if(getValue(NAME).equals("Start")){
            new SwingWorker<Void, Void>() {
                @Override
                protected Void doInBackground() throws Exception {
                    manager.start();
                    return null;
                }
            }.execute();
            putValue(NAME,"Stop");
            System.out.println("Started");
        }
        else {
            manager.disconnect();
            putValue(NAME,"Start");
        }
    }
}


package com.neuedu.util;

import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

import java.io.IOException;
import java.io.InputStream;

/**
 * @program: mvntest09
 * @description: MyBatis工具类
 * @author: LinLuo
 * @create: 2019-09-09 15:30
 **/
public class MyBatisUtil {
    private MyBatisUtil() {
    }

    public static SqlSession getSqlSession(String reso) {
        String resource = reso;
        InputStream inputStream = null;
        SqlSession session = null;
        try {
            inputStream = Resources.getResourceAsStream(resource);
            SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(inputStream);
            session = sqlSessionFactory.openSession();
        } catch (IOException e) {
            e.printStackTrace();
        }

        return session;
    }
}


package com.quincy.java.algorithm.leetcode;

/**
 * Copyright (C), 2015-2020, 大众易书天津科技有限公司
 * FileName: LeetCode28
 *
 * @author: quincy
 * Date: 2020/7/22 下午6:12
 * History:
 * 给定一个 haystack 字符串和一个 needle 字符串，
 * 在 haystack 字符串中找出 needle 字符串出现的第一个位置 (从0开始)。如果不存在，则返回  -1
 */

public class LeetCode28 {
    public static void main(String[] args) {
        System.out.println(strStr("phello", "llo"));
    }
    public static int strStr(String haystack, String needle) {
        int position = -1;
        int index = 0;
        int indexN = 0;
        while (haystack.length() > index){
            if (indexN < needle.length() && haystack.charAt(index) == needle.charAt(indexN)){
                indexN ++;
                position ++;
            }
            if (indexN == needle.length()){
                //position = haystack.length() - position - 1;
                break;
            }
            index ++;
        }

        return position;
    }
}


package com.ymin.chatbot.service;

import com.ymin.chatbot.dto.Item;
import com.ymin.chatbot.mapper.ItemMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class ItemService {

    @Autowired
    ItemMapper itemMapper;

    public boolean findItem(String userId, String name){
        Item item = itemMapper.findItem(userId, name);

        return (item != null);
    }

    public boolean insertItem(Item item){
        return itemMapper.insertItem(item.getUserId(), item.getName(), item.getUrl());
    }

    public List<Item> getItemList(String userId){
        return itemMapper.getItemList(userId);
    }

    public boolean deleteItem(String userId, String name){
        return itemMapper.deleteItem(userId, name);
    }
}


package com.nju.vo;

import com.nju.enums.Gender;
import lombok.Data;

@Data
public class UserAddressVO {
    Long id;
    /**
     * 用户编号
     */
    Long userId;
    /**
     * 联系人姓名
     */
    String contactName;
    /**
     * 性别
     */
    Gender gender;
    /**
     * 联系人电话
     */
    String phone;
    /**
     * 地址
     */
    String address;
    /**
     * 经度
     */
    private String lng;
    /**
     * 纬度
     */
    private String lat;
    /**
     * 门牌号
     */
    String houseNumber;

    public UserAddressVO(){}

    public UserAddressVO(Long id, Long userId, String contactName, Gender gender, String phone, String address, String lng, String lat, String houseNumber) {
        this.id = id;
        this.userId = userId;
        this.contactName = contactName;
        this.gender = gender;
        this.phone = phone;
        this.address = address;
        this.lng = lng;
        this.lat = lat;
        this.houseNumber = houseNumber;
    }
}


package com.tetrisbybulek.Model.Block;

import com.tetrisbybulek.Model.Piece.Pieces;

public class SpritedBlock extends Block {
    /**
     * Class defining SpritedBlock object that has defined
     * type so it can print with given colors on Frame
     */

    Pieces pieces;

    public SpritedBlock(boolean empty, Pieces type){
        /**
         * Parameter Constructor of SpritedBlock object
         *
         * Calls Parameter Constructor of superclass with passed empty
         *
         * @param empty boolean telling whether Block should be treated
         *              as empty or not
         * @param type  Pieces enum type defining type of given block
         *
         * @see Block#Block(boolean)
         */
        super(empty);
        pieces = type;
    }

    @Override
    public Pieces getPieces(){
        /**
         * Getter of pieces field
         *
         * @return value of pieces field
         */
        return pieces;
    }

}


package com.example.administrator.mytablayout;

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

/**
 * Created by ${郭艳杰} on 2017/1/15.
 */

public class ItemFragment extends Fragment {
    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        String title = getArguments().getString("title");
        TextView textView = new TextView(getActivity());
        textView.setText(title);
        return textView;
    }

    public static Fragment getInstance(String s) {
        ItemFragment itemFragment = new ItemFragment();
        Bundle args = new Bundle();
        args.putString("title",s);
        itemFragment.setArguments(args);
        return itemFragment;
    }
}


package com.ote.github.api;

import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;

import javax.validation.constraints.NotNull;
import java.io.IOException;

public final class JsonUtils {

    // ObjectMapper is threadsafe
    private static final ObjectMapper MAPPER;

    static {
        MAPPER = new ObjectMapper();
        MAPPER.setPropertyNamingStrategy(PropertyNamingStrategy.CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES);
        MAPPER.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
    }

    private JsonUtils() {
    }

    public static <T> T parse(@NotNull String content, @NotNull Class<T> type) throws IOException {
        return MAPPER.readValue(content, type);
    }

    public static <T> String serialize(@NotNull T obj) throws IOException {
        return MAPPER.writeValueAsString(obj);
    }
}


# Real Time Embedded Systems (18-648) Project

Hacking the Linux Kernel for the Android Nexus 7 device

## /apps
* calc.c: Userspace program to use syscall
* energymon.c: Userspace application to print task wise energy usage on console
* easyperiodic.c: Real time thread used for reservation.
* reserve.c: Userspace app to reserve a thread.
* rtps.c: Userspace app to check thread status.

## /modules: Loadable Kernel Modules
* hello: A simple module to print hello on the dmesg screen
* psdev: A character device driver supporting 255 devices
* cleanup: Module to check open devices

## /kernel
* sysclock.c: Computes the frequency to scale to based on utilization of the core.
* calc.c: Syscall to float arithmetic in kernel space.
* reserve.c: Real time thread reservation framework.
* cpu_heuristics.c: Computes core to be used to reserve the new thread based on user selected heuristic.
* taskmon_sysfs.c: Computes and stores energy consumption for each thread.


package au.gov.amsa.detection.behaviour;

import au.gov.amsa.detection.model.DetectionRule;
import au.gov.amsa.detection.model.MessageTemplate;
import au.gov.amsa.detection.model.MessageTemplate.Behaviour;
import au.gov.amsa.detection.model.MessageTemplate.Events.Create;
import xuml.tools.model.compiler.runtime.ArbitraryId;

public class MessageTemplateBehaviour implements Behaviour {

    private final MessageTemplate self;

    public MessageTemplateBehaviour(MessageTemplate self) {
        this.self = self;
    }

    @Override
    public void onEntryCreated(Create event) {
        self.setId(ArbitraryId.next());
        self.setBody(event.getBody());
        self.setSubject(event.getSubject());
        self.setStartTime(event.getStartTime());
        self.setEndTime(event.getEndTime());
        self.setForceUpdateBeforeTime(event.getForceUpdateBeforeTime());
        DetectionRule.find(event.getDetectionRuleID()).get().setMessageTemplate_R8(self);
    }

}


Sample source code of Simple Home launcher on AndroidTV.
=============

## Introduction
Home launcher on AndroidTV displays application's banners with category of LEANBACK_LAUNCHER.

## ScreenShot

![Image](https://raw.githubusercontent.com/nehori/java-simple-launcher-androidtv/master/screenshot/1.png)

## License
Copyright 2016 nehori.

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.

[1]: http://developer.android.com/reference/android/service/notification/NotificationListenerService.html


# Vue-shoppingcart

> A Vue.js project

> It's just an experiment.

> Shopping Cart

> Some Code In Vuetify (like slider/login/sign up)
> Vuetify

> Create Database In Firebase Database and add given detail in main.js file using firebase databse.

   firebase.initializeApp({
      apiKey: '',
      authDomain: '',
      databaseURL: '',
      projectId: '',
      storageBucket: ''
    })

# This website contains admin part. So You can add categories and add products accroding to categories. You can also add slider.
# Sign up And Sign In the help of Firebase.
# Add to Cart

## Build Setup

``` bash
# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

For detailed explanation on how things work, checkout the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).


import Interfaces.Appender;
import Interfaces.Layout;
import Interfaces.Logger;
import controllers.ConsoleAppender;
import controllers.XmlLayout;
import logger.MessageLogger;

public class Main {
    public static
    void main (String[] args) {
       /* Layout   simpleLayout    = new SimpleLayout ();
        Appender consoleAppender = new ConsoleAppender (simpleLayout);
        Logger   logger          = new MessageLogger (consoleAppender);
        logger.logError ("3/26/2015 2:08:11 PM", "Error parsing JSON.");
        logger.logInfo ("3/26/2015 2:08:11 PM", "User Pesho successfully registered.");*/
        Layout xmlLayout = new XmlLayout ();
        Appender consoleAppender = new ConsoleAppender(xmlLayout);
        Logger logger = new MessageLogger(consoleAppender);

        logger.logFatal("3/31/2015 5:23:54 PM", "mscorlib.dll does not respond");
        logger.logCritical("3/31/2015 5:23:54 PM", "No connection string found in App.config");

    }
}


## Practising Prometheus style metric collection concepts while setting up sample project for bazel

WIP to setup bazel for all three components in one workspace.

`/server` has a simple HTTP server serving one endpoint. Start the server using:

```
cd server
go run main.go
```

Hit server endpoint using:

```
curl localhost:8080/password?keywords=abc,xyz&len=10
```

Start metric collector with below commands and visualize request metric histogram in terminal:

```
cd metrics
go run scraper.go

HTTP Request count metric
(Latest scrapped metric last)
|**************************
|*******************
|*******
|**************
|***************
|************************
|***********************
|*****************
|********************
|***********
```

Generate synthetic load with helper script:

```
cd load-generator
sh naive.sh localhost:8080/password
```

Made use of https://golang.org/pkg/expvar/ stdlib for clientside metric state and http exporter handler.


package kniga.project.bookshop.status;

import kniga.project.bookshop.dto.AuthorRequest;
import kniga.project.bookshop.entity.Author;

import java.util.HashSet;

public final class AuthorStub {

    public static final Long ID = 1L;
    public static final String NAME = "name";
    public static final String SURNAME = "surname";
    public static final String DESCRIPTION = "description";
    public static Author getRandomAuthor() {
        return Author.builder().id(ID)
                .name(NAME)
                .surname(SURNAME)
                .genre(new HashSet<>())
                .description(DESCRIPTION)
                .books(new HashSet<>())
                .build();
    }

    public static AuthorRequest getAuthorRequest() {
        AuthorRequest authorRequest = new AuthorRequest();
        authorRequest.setName(NAME);
        authorRequest.setSurname(SURNAME);
        authorRequest.setDescription(DESCRIPTION);
        return authorRequest;
    }
}


package com.example.wifisurvey;

import com.loopj.android.http.AsyncHttpClient;

public class ElasticSearchExporter {
    private AsyncHttpClient httpClient = null;

    public static class ESExporterOptions {
        protected String domain;
        protected int port;

        protected String username;

        public void ESExporterOptions() {

        }

        public int getPort() {
            return port;
        }

        public String getDomain() {
            return domain;
        }

        public String getUsername() {
            return username;
        }
    }

    private ESExporterOptions curConfig = null;

    public boolean config(ESExporterOptions options) {
        if (httpClient != null) {
            return false;
        }

        curConfig = options;

        httpClient = new AsyncHttpClient();

        return true;
    }

    public void upload() {
        assert curConfig != null;
        assert httpClient != null;

    }
}


package com.jpb.displaycontrol.exception;

import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;

@ResponseStatus (value= HttpStatus.NOT_FOUND)
public class ItemNotFoundException extends RuntimeException{

	/**
	 * @ResponseStatus (value= HttpStatus.NOT_FOUND)
	 * public class ItemNotFound extends RuntimeException
	 *
	 * ----Pending to check why i have to include serilVersionUID to avoid warning JP
	 */
	private static final long serialVersionUID = 1L;
	private String exceptionDescription;
	private Object fieldDetail;

	public ItemNotFoundException(String exceptionDescription, String fieldDetail) {

		super(exceptionDescription+"- !!Oh my Godness :-) ! - "+fieldDetail);
		this.exceptionDescription = exceptionDescription;
		this.fieldDetail = fieldDetail;
	}

	public String getExceptionDetail() {
		return exceptionDescription;
		}

	public Object getFieldValue() {
		return fieldDetail;
		}

}


package fr.exorth;

import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

public class Main extends JavaPlugin {

	static Main instance;
	public SqlConnection sql;

	public static Main getInstance(){
		return instance;
	}

	@Override
	public void onEnable() {

        sql = new SqlConnection("jdbc:mysql://","localhost","quake","root","");
        sql.connection();

		instance=this;

		getConfig().options().copyDefaults(true);
		saveConfig();

		Bukkit.getPluginManager().registerEvents(new SignEvent(sql), this);
		Bukkit.getPluginManager().registerEvents(new SignClickEvent(), this);

		getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");

		getCommand("lobby").setExecutor(new QuakeLobbyCommand());

		new SignRefreshRunnable(sql).runTaskTimer(this, 5L, 5L);

		super.onEnable();
	}

	@Override
	public void onDisable() {
		sql.disconnect();
		super.onDisable();
	}

}


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

import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

/**
 *
 * @author rrodriguez
 */
@ManagedBean(name = "loginManagedBean")
@RequestScoped
public class LoginManagedBean {

    private String rut;
    private String email;

    public LoginManagedBean() {
    }

    public void login(){
        System.out.print("login");
        System.out.print("RUT: "+this.rut);
        System.out.print("EMAIL: "+this.email);
    }

    public String getRut() {
        return rut;
    }

    public void setRut(String rut) {
        this.rut = rut;
    }

    public String getEmail() {
        return email;
    }

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

}


package com.alecktos.stockfetcher;

import com.alecktos.misc.logger.EmailNotifier;
import com.alecktos.misc.logger.Logger;
import com.google.inject.AbstractModule;
import com.google.inject.Inject;
import com.google.inject.Provider;
import com.google.inject.name.Names;

abstract public class StockfetcherDependencyModule extends AbstractModule {

	private String emailConfigPath;

	public StockfetcherDependencyModule(String emailConfigPath) {
		this.emailConfigPath = emailConfigPath;
	}

	protected Provider<Logger> getLoggerProvider() {
		return new Provider<Logger>() {

			@Inject
			EmailNotifier emailNotifier;

			@Override
			public Logger get() {
				return new Logger(emailNotifier);
			}
		};
	}

	@Override
	protected void configure() {
		bind(Logger.class).toProvider(getLoggerProvider());
		bindConstant().annotatedWith(Names.named("emailConfigPath")).to(emailConfigPath);
		bindConstant().annotatedWith(Names.named("influxDbName")).to("stocks");
	}

}


package com.teste.redismock.redismock.service;

import com.teste.redismock.redismock.model.Navegation;
import com.teste.redismock.redismock.repository.NavegationRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class NavegationService {

    @Autowired
    private NavegationRepository repository;

    public Navegation findById(String id) throws Exception {
        return repository.findById(id).orElseThrow(Exception::new);
    }

    public void insertNavegation(Navegation newNavegation) {
        repository.save(
            Navegation.builder()
                .id(newNavegation.getId())
                .home(newNavegation.getHome())
                .about(newNavegation.getAbout())
                .blog(newNavegation.getBlog())
                .help(newNavegation.getHelp())
                .rules(newNavegation.getRules())
                .build()
        );
    }
}


package courses.lecture1;
import com.sun.jna.Native;
import com.sun.jna.platform.win32.Kernel32;
import com.sun.jna.platform.win32.WinBase.SYSTEMTIME;
import com.sun.jna.platform.win32.WinBase.SYSTEM_INFO;

public class HardwareUtility {
	public static long getCPUCores(){
		return Runtime.getRuntime().availableProcessors();
	}

	public static void main (String[] args){
		 Kernel32 INSTANCE = (Kernel32) Native
			        .loadLibrary("Kernel32", Kernel32.class);

			           SYSTEMTIME time =new SYSTEMTIME();
			           INSTANCE.GetSystemTime(time);
			           System.out.println("Day of the Week "+time.wDayOfWeek);
			           System.out.println("Year :  "+time.wYear);

			           SYSTEM_INFO systeminfo=new SYSTEM_INFO();

			           INSTANCE.GetSystemInfo(systeminfo);
			         //  INSTANCE.GetNativeSystemInfo(arg0);
			           System.out.println("Processor Type : "+systeminfo.dwNumberOfProcessors);
	}
}


package com.feast.demo.hibernate;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.ToString;
import org.hibernate.annotations.Index;

import javax.persistence.Column;
import javax.persistence.EntityListeners;
import javax.persistence.MappedSuperclass;
import java.sql.Timestamp;

/**
 * Created by ggke on 2017/7/29.
 */
@MappedSuperclass
@Data
@ToString(callSuper = true)
@EntityListeners({ TimedEntityListener.class })
public abstract class TimedEntity{
    /**
     *
     */
    private static final long serialVersionUID = 5968742044806210654L;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "YYYY/MM/DD hh:mm:ss", timezone="GMT+8")
    @Column(updatable = false, nullable = false)
    protected Timestamp creation;

    /**
     * 最后修改时间
     */
    @Index(name="lastModified")
    @JsonFormat(pattern = "YYYY/MM/DD hh:mm:ss", timezone="GMT+8")
    @Column(nullable = false)
    protected Timestamp lastModified;

}


# Memory-Game

## Instructions:
* Click on cards
* Keep viewing the front side of cards and memorize them and simultaneously try matching them
* Try to complete this in minimum number of moves possible
  - 3 stars for completing the game is not more than 12 moves
  - 2 stars for completing the game is moves not greater than 22 and not less than 13
  - 1 star otherwise
* Modal with final stats appears after game completion
* Restart button available above game board on right side
* "Ok" and "Play Again" buttons on modal
  - Ok to close the modal and return to the completed game screen
  - Play again to restart the game

## Web Development Technologies used:
* HTML
* CSS
* JavaScript

## Fonts Source
* [Google Fonts](https://fonts.google.com/)

## Icons Source
* [Font Awesome](https://fontawesome.com/v4.7.0/)

## Animations Source
* https://daneden.github.io/animate.css/

### GitHub pages link: [Memory Game](https://amarjeetsingh1999.github.io/Memory-Game/)


package com.dinas.dinaskesehatanbelitung.Api;

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

public class ApiCovid {
    public static Retrofit getApiCovid(){
        HttpLoggingInterceptor httpLoggingInterception = new HttpLoggingInterceptor();
        httpLoggingInterception.setLevel(HttpLoggingInterceptor.Level.BODY);
        OkHttpClient okHttpClient = new OkHttpClient.Builder().addInterceptor(httpLoggingInterception).build();

        Retrofit retrofit = new Retrofit.Builder()
                .baseUrl("https://data.covid19.go.id/")
                .addConverterFactory(GsonConverterFactory.create())
                .client(okHttpClient)
                .build();
        return retrofit;

    }
    public static ApiService getData(){
        ApiService apiService = getApiCovid().create(ApiService.class);
        return apiService;
    }
}


package com.example.konradszmidt.myapplication;

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

public class MainActivity extends AppCompatActivity {

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

        String[] elementy_listy = { "Pierwszy", "Drugi", "Trzeci", "Czwarty" };
        ListView prosta_lista = (ListView) findViewById(R.id.lista_mainList);

        ArrayAdapter adapter_listy = new ArrayAdapter(this,
                android.R.layout.simple_list_item_1, elementy_listy);
        prosta_lista.setAdapter(adapter_listy);
    }
    public void sendMessage(View view)
    {
        Intent intent = new Intent(MainActivity.this, Podstrona.class);
        startActivity(intent);
    }
}


package com.kq.concurrent.threadlocal;

import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicLong;

/**
 * ThreadLocalLeakDemo
 *
 * @author kq
 * @date 2021/8/23 23:43
 * @since 1.0.0
 */
public class ThreadLocalLeakDemo {

    static AtomicLong atomicLong = new AtomicLong();

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

        for(int i=0;i<5000000;i++) {

            new Thread(() -> {
                ThreadLocal<String> value = new ThreadLocal<String>();
                try {
//                    Thread.sleep(1000L);
                    value.set("milk11111111111111111111111111111111111111111" + atomicLong.incrementAndGet());
                    // null
                    System.out.println("get1=" + value.get());
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }, "thread-2").start();

        }

        TimeUnit.SECONDS.sleep(100);

    }

}


package org.infokin.repository.api;

import org.hibernate.Session;
import org.infokin.model.core.BaseEntity;
import org.infokin.util.HibernateUtility;

/**
 * Generic implementation of basic repository operations.
 */
public abstract class AbstractBaseRepository<T extends BaseEntity> implements BaseRepository<T> {

    /**
     * {@inheritDoc}
     */
    @Override
    public Session getSession() {
        return HibernateUtility.getSessionFactory().getCurrentSession();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Long save(T entity) {
        Session session = getSession();

        session.beginTransaction();

        Long id = (Long) session.save(entity);

        session.getTransaction().commit();

        return id;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Long update(T entity) {
        return 0L;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void delete(T entity) {
    }
}


package com.e1858.wuye.pojo;

import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.NotEmpty;

import com.e1858.wuye.common.CommonConstant;

public class CommissionTypeCommand
{
	private long id;
	@NotBlank(message=CommonConstant.ValidMessage.NotBlank)
	@NotEmpty(message=CommonConstant.ValidMessage.NotEmpty)
	private String name;
	private long template_count;
	private boolean isCommissionuse;

	public long getId()
	{
		return id;
	}
	public void setId(long id)
	{
		this.id = id;
	}
	public String getName()
	{
		return name;
	}
	public void setName(String name)
	{
		this.name = name;
	}
	public long getTemplate_count()
	{
		return template_count;
	}
	public void setTemplate_count(long template_count)
	{
		this.template_count = template_count;
	}
	public boolean isCommissionuse()
	{
		return isCommissionuse;
	}
	public void setCommissionuse(boolean isCommissionuse)
	{
		this.isCommissionuse = isCommissionuse;
	}

}


package com.ish.board;

import static org.junit.Assert.*;

import javax.inject.Inject;

import org.apache.ibatis.session.SqlSession;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import com.ish.board.dao.BDao;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations= {
		"file:src/main/webapp/WEB-INF/spring/appServlet/servlet-context.xml",
		"file:src/main/webapp/WEB-INF/spring/root-context.xml"
})
public class TestOfBDao {
	@Inject
	private SqlSession sqlSession;
	private BDao dao;

	@Before
	public void setup() {
		dao = sqlSession.getMapper(BDao.class);
	}

	@Test
	public void test() {
		int rows = dao.getRowNum();
		System.out.println(rows);
		int max = dao.getRowNum();
		System.out.println(max);
	}
}


package net.zhaoxuyang.concurrent.demo;

/**
 * 线程示例程序 - 可见性
 * @author zhaoxuyang
 */
public class ThreadDemoVolatile {

    public static void main(String[] args) {
        class StoppableThread extends Thread {

            private volatile boolean shutdown;

            @Override
            public void run() {
                synchronized (this) {
                    while (!shutdown) {
                        System.out.println(System.nanoTime());
                    }
                }

            }

            void stopThread() {
                shutdown = true;
            }
        }

        StoppableThread t = new StoppableThread();
        t.start();

        try {
            Thread.sleep(1);
        } catch (InterruptedException ex) {
            System.out.println("出错：" + ex);
        }
        System.out.println("停止" + t.getName());

        t.stopThread();

        System.out.println("停止" + Thread.currentThread().getName());

    }
}


package com.example.jpademo.dto;

import com.example.jpademo.domain.Person;
import com.example.jpademo.domain.Song;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class SongDto {

    private Long id;

    private String title;
    private String singer;

    private Person person;

    public SongDto(Long id, String title, String singer) {
        this.id = id;
        this.title = title;
        this.singer = singer;
    }

    public SongDto(Song song) {
        this.id = song.getId();
        this.title = song.getTitle();
        this.singer = song.getSinger();
        this.person = song.getPerson();
    }

    @Override
    public String toString() {
        return "SongDto{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", singer='" + singer + '\'' +
                ", person=" + person +
                '}';
    }
}


/*
 * 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.example.ThymeleafDemo.controller;

import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.servlet.ModelAndView;

/**
 *
 * @author Admin
 */
@ControllerAdvice
public class GlobalController {

    @ExceptionHandler(value = Exception.class)
    public ModelAndView error(HttpServletRequest request, Exception e) throws Exception{
         System.out.println(e);
         ModelAndView mav = new ModelAndView();
         mav.addObject("exception", e);
         mav.addObject("url", request.getRequestURI());

         mav.setViewName("error");
         return mav;
    }
}


package com.altarrys.ultimatepixel.game;

import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.DialogInterface;
import android.os.Bundle;

import com.altarrys.ultimatepixel.R;

public class DFVictoryScore extends DialogFragment implements android.content.DialogInterface.OnClickListener
{
	private int m_score;

	public DFVictoryScore()
	{
		m_score = 0;
	}

	public void setScore(int score)
	{
		m_score = score;
	}

	@Override
	public Dialog onCreateDialog(Bundle savedInstanceState)
	{
		AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());

		setCancelable(false);

		builder.setTitle(getString(R.string.dfvictoryscore) + " " + m_score);
		builder.setPositiveButton(R.string.dfcontinue, this);

		return builder.create();
	}

	@Override
	public void onClick(DialogInterface dialog, int which)
	{
		if (which == DialogInterface.BUTTON_POSITIVE)
			getActivity().finish();
	}

}


package com.productivepathway.liquibase;

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

public class Response {
    private List<String> errors;
    private boolean success;

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

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

    public void addError(String error) {
        if(errors == null) {
            errors = new ArrayList<String>();
        }
        errors.add(error);
        success = false;
    }

    public boolean getSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public Response(List<String> errors) {
        this.errors = errors;
    }

    public Response() {
    }

    public String toString() {
        return "Response: ["
            + (success ? "success" : "")
            + (errors != null ? ("errors=" + errors) : "")
            + "]";
    }
}


package com.capnet.game;

import com.badlogic.gdx.Gdx;
import com.capnet.share.Entities.InputSnapshot;
import com.capnet.share.networking.PacketManager;

import java.net.Socket;

/**
 * Created by michaelpollind on 4/30/16.
 */
public class InputHandle {
    private  int key;
    private  PacketManager manager;
    private Socket server;
    private  boolean isPressed;

    public  boolean IsPressed()
    {
        return isPressed;
    }

    public  int Key()
    {
        return  key;
    }

    public InputHandle(int key, PacketManager manager, Socket server)
    {
        this.key = key;
        this.manager = manager;
        this.server = server;

    }

    public boolean  Update()
    {
        boolean press = Gdx.input.isKeyPressed(key);
        if(isPressed != press) {
            isPressed = press;
            manager.SendPacket(new InputSnapshot(key, isPressed), server);

            return  true;
        }
        return false;

    }

}


package com.example.covidassessment;

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

import androidx.appcompat.app.AppCompatActivity;

public class VaccineRegisterResult extends AppCompatActivity {

    String name,date,time,centre;
    TextView t1,t2,t3;
    String[] suit;
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.vaccine_register_result);

        Intent intent = new Intent();
        t1 = (TextView)findViewById(R.id.vaccinetest3);
        t2 = (TextView)findViewById(R.id.covidcenterVaccine);
        t3 = (TextView)findViewById(R.id.coviddatevaccine);
        //suit = intent.getStringArrayExtra("nameres");
        Bundle b=this.getIntent().getExtras();
        String[] array=b.getStringArray("key");

        t1.setText(array[0]);
        t2.setText(array[3]);
        t3.setText(array[1] + " at " + array[2]);
    }
}


package com.gzj.healthydiets.entity;

public class Resp<E> {
    private String errcode;
    private String message;
    private E body;

    public Resp() {
    }

    public Resp(String errcode, String message, E body) {
        this.errcode = errcode;
        this.message = message;
        this.body = body;
    }

    public String getErrcode() {
        return errcode;
    }

    public void setErrcode(String errcode) {
        this.errcode = errcode;
    }

    public String getMessage() {
        return message;
    }

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

    public E getBody() {
        return body;
    }

    public void setBody(E body) {
        this.body = body;
    }

    @Override
    public String toString() {
        return "Resp{" +
                "errcode='" + errcode + '\'' +
                ", message='" + message + '\'' +
                ", body=" + body +
                '}';
    }
}


# Auto Gallery

This build uses a fuse-box build process, rather than webpack.  This includes the following feature support, minus the time overhead or babel dependencies (fuse-box uses a TypeScript transpiler under the hood).
- [x] React/JSX support
- [x] Hot reloading
- [x] CSS/LESS/SASS
- [x] Images
- [x] Autoreloading of server & client while in `yarn dev` mode
- [x] Sourcemaps (manual refresh required, as hot-reloading messes with sourcemaps)
- [x] Build to ES5
- [x] Cache-busting

### Structure Description
- `/src/client` - throw your entire untranspiled client code+assets in here (entry point is index.jsx)
- `/src/server` - throw your entire untranspiled server code here (entry point is index.js)
- `/dist` - generated distributable output from the `yarn build` command
- `.env` (root) - local environment variables will be automatically loaded
- `fuse.js` - build config
- `.eslint.json` - linting config

Notes
- Routes
  - /:gallery-slug/i/:uuid


package com.project.entity;

import java.sql.Date;

public class BusTemp extends Bus{
    private java.sql.Date nextWarrantyDate;
    private Boolean checkOutOfDate;
    private int revenue;

    public BusTemp(Date nextWarrantyDate, Boolean checkOutOfDate, int revenue) {
        this.nextWarrantyDate = nextWarrantyDate;
        this.checkOutOfDate = checkOutOfDate;
        this.revenue = revenue;
    }

    public int getRevenue() {
        return revenue;
    }

    public void setRevenue(int revenue) {
        this.revenue = revenue;
    }

    public BusTemp(){}

    public Date getNextWarrantyDate() {
        return nextWarrantyDate;
    }

    public void setNextWarrantyDate(Date nextWarrantyDate) {
        this.nextWarrantyDate = nextWarrantyDate;
    }

    public Boolean getCheckOutOfDate() {
        return checkOutOfDate;
    }

    public void setCheckOutOfDate(Boolean checkOutOfDate) {
        this.checkOutOfDate = checkOutOfDate;
    }

}


package com.jungle.wemall.wx.controller;

import com.jungle.wemall.common.util.ResponseUtil;
import com.jungle.wemall.db.pojo.WemallAd;
import com.jungle.wemall.db.service.WemallAdService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @description: 广告
 * @author: jungle
 * @date: 2020-02-29 09:55
 */
@RestController
@RequestMapping("/wx/ad")
public class WxAdController {
    @Autowired
    private WemallAdService wemallAdService;

    @GetMapping("/list")
    public Object listAd(){
        List<WemallAd> list = wemallAdService.listAd();
        if(list != null){
            return ResponseUtil.okList(list);
        }
        return  ResponseUtil.fail();
    }
}


package com.xingyeda.ehome.bean;

import org.litepal.crud.DataSupport;

public class SeekHistoryBase extends DataSupport{

    private int mId;
    private String name;
    private String mUserId;
    private String mTime;

    public SeekHistoryBase(String name, String time) {
        this.name = name;
        this.mTime = time;
    }
    public SeekHistoryBase(String name) {
        this.name = name;
    }
    public SeekHistoryBase() {
    }

    public int getmId() {
        return mId;
    }

    public void setmId(int mId) {
        this.mId = mId;
    }

    public String getName() {
        return name;
    }

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

    public String getUid() {
        return mUserId;
    }

    public void setUid(String uid) {
        this.mUserId = uid;
    }

    public String getmTime() {
        return mTime;
    }

    public void setmTime(String mTime) {
        this.mTime = mTime;
    }
}


package com.dtd.thevyshka.Adapters;

import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.dtd.thevyshka.Adapters.ViewHolders.ScienceViewHolder;
import com.dtd.thevyshka.R;

public class ScienceListAdapter extends RecyclerView.Adapter<ScienceViewHolder> {

    View.OnClickListener listener;

    public ScienceListAdapter(View.OnClickListener listener){
        this.listener = listener;
    }

    @Override
    public ScienceViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
        View view = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_science, viewGroup, false);
        return new ScienceViewHolder(view, listener);
    }

    @Override
    public void onBindViewHolder(final ScienceViewHolder holder, final int i) {

    }

    @Override
    public int getItemCount() {
        return 3;
    }
}


package com.netty.tcp;

import io.netty.bootstrap.Bootstrap;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.SocketChannel;
import io.netty.channel.socket.nio.NioSocketChannel;

public class NettyTcpClient {

	public static void main(String[] args) throws Exception {
		NioEventLoopGroup group = new NioEventLoopGroup();
		try {
			// 客户端配置
			Bootstrap bootstrap = new Bootstrap();
			bootstrap.group(group)
			.channel(NioSocketChannel.class)
			.handler(new ChannelInitializer<SocketChannel>() {

				@Override
				protected void initChannel(SocketChannel ch) throws Exception {
					ch.pipeline().addLast(new NettyTcpClientHandler());

				}
			});
			ChannelFuture channelFuture = bootstrap.connect("127.0.0.1", 6666).sync();
			channelFuture.channel().closeFuture().sync();//监听通道关闭
		} finally {
			group.shutdownGracefully();
		}

	}

}


package cn.shop.servlet;

import java.io.IOException;

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

import cn.shop.util.RandomValidateCode;
@WebServlet("/imageCodeServlet")
public class ImageCodeServlet extends HttpServlet {

	/**
	 *
	 */
	private static final long serialVersionUID = -3574237787598371108L;

	@Override
	protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		response.setContentType("image/jpeg");
		response.setHeader("Pragma", "No-cache");
		response.setHeader("Cache-Control", "No-cache");
		response.setDateHeader("Expires", 0);

		RandomValidateCode rc = new RandomValidateCode();

		try {
			rc.getRandomCode(request,response);
		}catch(Exception e) {
			e.printStackTrace();
		}
	}

}


package com.sudhirt.apiutils.portal.exception;

import lombok.Getter;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;

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

@Getter
public class Error implements Serializable {

    private static final long serialVersionUID = 7554020068463996833L;

    private String error;
    private List<String> description;

    public Error(String error) {
        super();
        this.error = error;
    }

    public Error(String message, String error) {
        super();
        description = Arrays.asList(error);
    }

    public Error(String message, List<String> errors) {
        super();
        this.description = errors;
    }

    public void addDetail(String detail) {
        if(description == null) {
            description = new ArrayList<>();
        }
        description.add(detail);
    }
}


package com.queencastle.dao.utils;

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

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;

/**
 * 系统时间处理，在各种JSON传递的时候，在对应的字段加上这个注解即可，用法如下：<br>
 *
 * @JsonSerialize(using = SysDateSerializer.class) private Date startTime;
 * @author 于东伟
 *
 */
public class SysDateSerializer extends JsonSerializer<Date> {
    public static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";
    public static final SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT);

    @Override
    public void serialize(Date date, JsonGenerator generator, SerializerProvider provider)
            throws IOException, JsonProcessingException {
        String dateStr = sdf.format(date);
        generator.writeString(dateStr);
    }

}


Magento 2 Newsletter module overview
=========================================

Magento 2x Newsletter adding new field Guest First Name, Guest Last Name and Privacy agreement checkbox to frontend newsletter form.

Module is tested on Magento 2.4.2-p1 version

How install module
==================

1. First download the Magento module (LR_Newsletter) from the github and unzip the
module

2. Use the Ftp client to upload or copy to extension in your [magento_root]/app/code directory

3. After upload module path will be [magento_root]/app/code/LR/Newsletter

4. Open the command line (connect ssh) and go to the Magento root directory then execute
one by one below commands:

    ```bash
    php bin/magento setup:upgrade
    php bin/magento setup:static-content:deploy -f
    php bin/magento indexer:reindex
    php bin/magento cache:clean
    php bin/magento cache:flush
    chmod -R 777 var/ pub/ generated/
    ```

THANK YOU!


package com.panther.aspect;

import com.panther.aspect.impl.PersonServiceBean;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;

/**
 * 动态代理
 * Created by panther on 16-9-28.
 */
public class ProxyFactory implements InvocationHandler {
    private Object targetObject;

    public Object creatProxyInstance(Object obj){
        this.targetObject = obj;
        return Proxy.newProxyInstance(this.targetObject.getClass()
                .getClassLoader(), this.targetObject.getClass()
                .getInterfaces(), this);
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        PersonServiceBean personServiceBean = (PersonServiceBean) this.targetObject;
        Object result = null;
        if (personServiceBean.getUser() != null) {
            result = method.invoke(personServiceBean, args);
        }
        return result;
    }
}


This is the code for team 668's T-shirt shooter.  It is based on the Team221 Sasquatch robot controller.

[Home](http://www.team221.com/robotopen)
[Driver Station](http://www.team221.com/robotopen/ds.html)
[Current Snapshot of Library](https://github.com/221robotics/RobotOpen-Sasquatch-Library/archive/master.zip)
[Library Classes](https://robotopen.readthedocs.org/en/latest/)
[Official Purchase Page](http://www.team221.com/robotopen/product.php?id=114)
And [here](http://www.team221.com/upload/Sasquatch_rev2_drawing_package.pdf) is the official schematic of the controller, not that anyone but mark005 will need it.

The IDE (Integrated Development Environment) can be found [here](http://arduino.cc/en/Main/Software), and download version 1.0.5.

The Snapshot of the current library previously linked to, must be uncompressed into your sketchbook folder, making sure that the "libraries" and "hardware" folders are both in the sketchbook directory.


package com.lmt.mbsp.user.controller;

import com.lmt.framework.support.service.CrudService;
import com.lmt.framework.support.web.controller.CrudController;
import com.lmt.mbsp.user.dto.PermissionQuery;
import com.lmt.mbsp.user.entity.permission.Permission;
import com.lmt.mbsp.user.service.PermissionService;
import com.lmt.mbsp.user.vo.permission.PermissionInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @描述: 权限.
 * @作者: lijing.
 * @创建时间: 2018-06-27 16:41.
 * @版本: 1.0 .
 */
@RestController
@RequestMapping("/permission")
public class PermissionController implements CrudController<Permission, Long, PermissionQuery, PermissionInfo> {
    @Autowired
    private PermissionService permissionService;

    @Override
    public CrudService<Permission, Long> getService() {
        return permissionService;
    }
}


package com.example.womensecurity;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class HospWeb extends AppCompatActivity {

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

        hospWebView = findViewById(R.id.hospWeb);
        hospWebView.setWebViewClient(new WebViewClient());
        hospWebView.loadUrl("https://www.mapsofindia.com/nagpur/health/hospitals.html");

        WebSettings webSettings = hospWebView.getSettings();
        webSettings.setJavaScriptEnabled(true);
    }

    @Override
    public void onBackPressed() {
        if (hospWebView.canGoBack()) {
            hospWebView.goBack();
        }
        else {
            super.onBackPressed();
        }
    }
}


package org.smartloli.kafka.eagle.web.controller;

import org.smartloli.kafka.eagle.web.exception.entity.NormalException;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpSession;
/**
 * @author LH
 *
 *
 * */
@Controller
public class VisualizerController {
    @RequestMapping(value = "/visualizer/visShow", method = RequestMethod.GET)
    public ModelAndView visShow(HttpSession session){
        ModelAndView mav = new ModelAndView();
        mav.setViewName("/visualizer/sourceVisualizer");
        String monitorGroupId;
        if((monitorGroupId = (String)session.getAttribute("monitorGroupId")) != null)
            mav.addObject("monitorGroupId", monitorGroupId);
        session.removeAttribute("monitorGroupId");
        return mav;
    }
}


import com.udemy.javaee.clase303.domain.Persona;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.EntityTransaction;
import javax.persistence.Persistence;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

public class ClienteEntidadPersona {
    static Logger log = LogManager.getRootLogger();

    public static void main(String[] args) {
        final EntityManagerFactory emf = Persistence.createEntityManagerFactory("PersonaPU");
        final EntityManager em = emf.createEntityManager();
        EntityTransaction tx = em.getTransaction();

        tx.begin();
        Persona persona = new Persona("Lucas", "Muñoz", "lmunoz@mail.com", "123123");
        log.debug("Objeto a persistir" + persona);
        em.persist(persona);
        tx.commit();
        log.debug("Objeto persistido" + persona);
        em.close();
    }
}


archive-utils
=============

[![Gem Version](https://badge.fury.io/rb/archive-utils.svg)](http://badge.fury.io/rb/archive-utils)

Ruby utilities for archival data (BagIt, Fixity, Tarfile).

**Note** As of Q1 2018, this repository is in the process of being replaced by https://github.com/sul-dlss/preservation_robots (not yet complete as of this writing).

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'archive-utils'
```

And then execute:

```sh
$ bundle update
```

Or install it yourself as:

```sh
$ gem install archive-utils
```

## Usage

```ruby
include 'archive-utils'

bag = Archive::BagitBag.new()
```

## Contributing

1. Fork it (https://github.com/[my-github-username]/archive-utils/fork )
2. Create your feature branch (`git checkout -b feature/my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin feature/my-new-feature`)
5. Create a new Pull Request


@Override void addElements(ArrayList<CompressedObjectParcelable> elements){
  TarArchiveInputStream tarInputStream=null;
  try {
    tarInputStream=new TarArchiveInputStream(new FileInputStream(filePath));
    TarArchiveEntry entry;
    while ((entry=tarInputStream.getNextTarEntry()) != null) {
      String name=entry.getName();
      if (!CompressedHelper.isEntryPathValid(name)) {
        continue;
      }
      if (name.endsWith(SEPARATOR))       name=name.substring(0,name.length() - 1);
      boolean isInBaseDir=relativePath.equals("") && !name.contains(SEPARATOR);
      boolean isInRelativeDir=name.contains(SEPARATOR) && name.substring(0,name.lastIndexOf(SEPARATOR)).equals(relativePath);
      if (isInBaseDir || isInRelativeDir) {
        elements.add(new CompressedObjectParcelable(entry.getName(),entry.getLastModifiedDate().getTime(),entry.getSize(),entry.isDirectory()));
      }
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}


package net.klakegg.formats.mobi.code;

import net.klakegg.formats.common.compression.CompressionAlgorithm;
import net.klakegg.formats.common.compression.NoCompression;
import net.klakegg.formats.mobi.compression.PalmDocCompression;

public enum Compression implements CompressionAlgorithm {
    NONE(1, new NoCompression()),
    PalmDOC(2, new PalmDocCompression()),
    HUFF_CDIC(17480, null);

    private int identifier;
    private CompressionAlgorithm algorithm;

    Compression(int identifier, CompressionAlgorithm algorithm) {
        this.identifier = identifier;
        this.algorithm = algorithm;
    }

    public static Compression findByIdentifier(int identifier) {
        for (Compression compression : values())
            if (compression.identifier == identifier)
                return compression;

        return null;
    }

    @Override
    public byte[] decompress(byte[] bytes) {
        return algorithm.decompress(bytes);
    }
}


# Hello-World
I'm a freshman
Here is an example of AppleScript:

    tell application "Foo"
        beep
    end tell

This is a normal paragraph:

    This is a code block.

        Foo

*emphasis*
©
这是一个一级标题
=============

这是一个二级标题
-------------

# 这是一级标题

## 这是二级标题

###### 这是六级标题

> This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
> consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
> Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
>
> Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
> id sem consectetuer libero luctus adipiscing.

> This is the first level of quoting.
>
> > This is nested blockquote.
>
> Back to the first level.

> ## This is a header.
>
> 1.   This is the first list item.
> 2.   This is the second list item.
>
> Here's some example code:
>
>     return shell_exec("echo $input | $markdown_script");


package org.ctp.enchantmentsolution.api;

import org.bukkit.plugin.java.JavaPlugin;
import org.ctp.enchantmentsolution.enchantments.CustomEnchantmentWrapper;

public class ApiEnchantmentWrapper extends CustomEnchantmentWrapper {

	private final JavaPlugin plugin;

	/**
	 * Constructor for the ApiEnchantmentWrapper
	 *
	 * @param plugin
	 *            - the plugin of the enchantment
	 * @param namespace
	 *            - the standard name of the enchantment
	 * @param name
	 *            - the standard name of the enchantment
	 */
	public ApiEnchantmentWrapper(JavaPlugin plugin, String namespace, String name) {
		super(plugin, namespace, name);

		if (name == null || name == "") throw new NullPointerException("An enchantment's name may not be set to null or an empty string!");
		this.plugin = plugin;
	}

	/**
	 * Gets the plugin of this enchantment
	 *
	 * @return JavaPlugin - the plugin
	 */
	public JavaPlugin getPlugin() {
		return plugin;
	}
}


# Elm intro examples

## Usage

### Installing elm
```sh
$ npm i -g elm
```
That will install the following tools:
- elm-repl
- elm-make - for compiling elm files
- elm-reactor - a dev server
- elm-package - for managing packages

For more details, as well as editor/IDE integrations, see [the `install` section of the guide](https://guide.elm-lang.org/install.html). Also note [elm-format](https://github.com/avh4/elm-format), which auto-formats your code according to the official styleguide.

### Running the examples
```sh
$ elm package install --yes
$ elm reactor
$ open http://localhost:8000
```

## Learning elm

- [The official docs](http://elm-lang.org/docs)
- [Egghead.io course](https://egghead.io/courses/start-using-elm-to-build-web-applications)
- [Awesome Elm](https://github.com/isRuslan/awesome-elm)
- [Elm Town Podcast](https://elmtown.github.io/)
- [Elm Conf 2016 Videos](https://www.youtube.com/playlist?list=PLglJM3BYAMPH2zuz1nbKHQyeawE4SN0Cd)


import java.util.Scanner;

/**
 * Player
 */
public class Player
{
    private boolean myTurn;
    private Board board;
    private String name;

    public Player (String name, int boardSize)
    {
        this.name = name;
        board = new Board(boardSize);
        myTurn = false;
    }

    /**
     *
     */
    public String toString()
    {
        return name;
    }

    /**
     *
     */
    public Board getBoard()
    {
        return board;
    }

    public void placeShips(int numShips)
    {
        Scanner in = new Scanner(System.in);
        for(int i = 0; i < numShips; i++)
        {
            System.out.print("Place your battleship: ");
            int xcoord = in.nextInt();
            int ycoord = in.nextInt();
            String orientation = in.next();
            Ship ship = new Ship(xcoord, ycoord, 5, orientation.charAt(0));
            board.placeShip(ship);
            System.out.println(board);
        }
    }
}


# 05-homework
Read Me

Project: Work Day Planner

Author: Alicia Burn

Date: 12/19/2019

https://aliciaburn.github.io/05-homework/

******************************
*  TABLE OF CONTENTS         *
******************************
1. Description
2. Features
3. Known Issues

******************************
*  DESCRIPTION              *
******************************
Work Day Scheduler
   A simple calendar application that allows the user to save events for each hour of the day. This app will run in the browser and feature dynamically updated HTML and CSS powered by jQuery.

******************************
*  FEATURES             *
******************************
Work Day Scheduler
   1. Updates current date
   2. Time blocks for each hour 9am-5pm
   3. Color coded time blocks
   4. Color coding represents past, present, future
   5. Input area to hold data

******************************
*  Known Issues             *
******************************
1. None


import java.net.*;
import java.util.*;
import java.io.*;

public class Coordinates {
	public static void main(String []args) {

	}

	public static String getMetars(int minLat, int minLong, int maxLat, int maxLong) {
		String url = "https://aviationweather.gov/adds/dataserver_current/httpparam?dataSource=metars&requestType=retrieve&format=xml&minLat=" + minLat + "&minLon=" + minLong + "&maxLat=" + maxLat + "&maxLon=" + maxLong + "&hoursBeforeNow=3";
		return getUrlSource(url);
	}

	public static String getUrlSource(String url) {
		try {
			URL yahoo = new URL(url);
			URLConnection yc = yahoo.openConnection();
			BufferedReader in = new BufferedReader(new InputStreamReader(yc.getInputStream(), "UTF-8"));
			String inputLine;
			StringBuilder a = new StringBuilder();
			while ((inputLine = in.readLine()) != null)
				a.append(inputLine);
			in.close();

			return a.toString();
		}
		catch (IOException e) {
			throw new RuntimeException(e);
		}
	}
}


package ru.otus.spring.service;

import org.springframework.stereotype.Service;
import ru.otus.spring.common.LocalizationService;
import ru.otus.spring.domain.Person;

@Service
public class PersonServiceImpl implements PersonService {

    private final ChannelService channel;
    private final LocalizationService localizationService;

    public PersonServiceImpl(ChannelService channel, LocalizationService localizationService){
        this.channel = channel;
        this.localizationService = localizationService;
    }

    @Override
    public Person getPerson() {
        channel.say(localizationService.getMessage("say_name"));
        String answer = channel.listen();
        String[] names = answer.split(" ");

        Person person = new Person();
        if (names.length > 0){
            person.setLastName(names[0]);
        }
        if (names.length > 1){
            person.setName(names[1]);
        }
        return person;
    }
}


/*
 * 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 pioneertrail.view;

import java.io.PrintWriter;
import pioneertrail.PioneerTrail;

/**
 *
 * @author Jacob Enszer
 */
public class ErrorView {

    private static PrintWriter console = PioneerTrail.getOutFile();
    private static PrintWriter log = PioneerTrail.getLogFile();

    public static void display(String className, String errorMessage) {

        console.println(
                "\n---ERROR-------------------------"
                + "\n" + errorMessage
                + "\n---------------------------------");

        log.printf("%n%n%s", className + " - " + errorMessage);
    }

    static void display(String error_saving_Invenotry_items_list_to_file) {
        throw new UnsupportedOperationException();
    }

}


package com.rest.board.repository;

import java.util.List;

import javax.swing.GroupLayout.SequentialGroup;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.rest.board.domain.Board;

@Repository
public class BoardDAOMybatis implements BoardDAO{
	@Autowired
	private SqlSessionTemplate sqlSessionTemplate;

	@Override
	public List selectAll() {
		return sqlSessionTemplate.selectList("Board.selectAll");
	}

	@Override
	public Board select(int board_id) {
		return sqlSessionTemplate.selectOne("Board.select",board_id);
	}

	@Override
	public void insert(Board board) {
		sqlSessionTemplate.insert("Board.insert", board);
	}

	@Override
	public void update(Board board) {
		sqlSessionTemplate.update("Board.update",board);
	}

	@Override
	public void delete(int board_id) {
		sqlSessionTemplate.delete("Board.delete", board_id);

	}

}


/*
 * 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 start;
import java.rmi.Naming;

import common.RMIinter;
import controller.Opration;
import controller.Registerlogin;
/**
 *
 * @author user
 */
public class RMIClient {
 public static String URL;
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws Exception {

        URL="rmi://"+"192.168.1.103"+":9999/common.interimplement";
        RMIinter userOperation=(RMIinter)Naming.lookup(URL);
        String wow = userOperation.print();
        System.out.println(wow);

        while(true){
        Registerlogin.registerlogin();
        if(Registerlogin.flag==1){
            break;
        }
        }
        while(true){
        Opration.Operation();
        }
    }

}


package com.package2119;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;

/**
 * @author jianger
 * @Date 2018/2/26 下午8:59
 **/
public class Runnable2 implements Runnable {
    private Runnable1 waitNotify;

    public Runnable2(Runnable1 waitNotify) {
        this.waitNotify = waitNotify;
    }

    @Override
    public void run() {
        synchronized (waitNotify) {

            waitNotify.notifyAll();
        }
    }

    public static void main(String[] args) throws InterruptedException {
//        WaitNotify waitNotify=new WaitNotify();
        Runnable1 runnable1 = new Runnable1();
        ExecutorService executorService = Executors.newCachedThreadPool();
        executorService.execute(runnable1);
        TimeUnit.SECONDS.sleep(1);
        executorService.execute(new Runnable2(runnable1));

        TimeUnit.SECONDS.sleep(1);
        executorService.shutdown();
    }
}


# de-obfuscate
Fixes obfuscated filenames by renaming them to the name of the directory they are contained in.

When one obtains a file via NNTP, or BitTorrent, or whatever, they are often "obfuscated".

What this means is that, when it's done downloading, you'll have a directory named (for example):

ShowTitle.S01E01.1080p.HDTV.x264-AVS

This is all well and good- but the file contained within this directory is named something slightly less useful:

41948484cf014f3f994f605c2e842aa6.mp4

This script will rename each file with the name of its parent folder, and will also find and remove common patterns in said directory name, like "1080p", "720p", "x264", "DVDRip", etc.

The example given above would be renamed to "ShowTitle.S01E01.mp4".

It'll work on however many folders you put in the directory it's working in (I've got a "de-obfuscate" folder I use), and will also delete the original folders so you'll be left with nothing but the filenames.


/Java Web Development Basics/Exams/JavaEEBlock/src/main/java/repositories/ProductRepository.java

package repositories;

import models.Product;
import models.ProductType;

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

public class ProductRepository {

    private List<Product> products;

    public ProductRepository() {
        this.products = new ArrayList<>();
        this.seedProducts();
    }

    public List<Product> getProducts() {
        return Collections.unmodifiableList(this.products);
    }

    private void seedProducts() {
        this.products.add(new Product("Chushkopek", "A universal tool for …", ProductType.valueOf("Domestic".toUpperCase())));
        this.products.add(new Product("Injektoplqktor", "Dunno what this is…", ProductType.valueOf("Cosmetic".toUpperCase())));
        this.products.add(new Product("Plumbus", "A domestic tool for everything", ProductType.valueOf("Food".toUpperCase())));
    }

    public void addProduct(Product product) {
        this.products.add(product);
    }
}


/*
 * 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 deltastream.pkg;

/**
 * A part of data sampled from the input stream at the source.
 *
 * Each of this parts are transmitted to the other clients and then reforged
 * into the original UDP- or TCP-stream.
 *
 * @author Petter Tomner
 */

public class Part{
    int partN;  //de part number of the part
    byte[] data; //generic data container
    long timeCreated;//when the part was created
    /**
     *
     * @param thisPartN the number this part has, with the first part BY THE SOURCE created at index 0
     * @param thisData the data the part carries
     */
    public Part(int thisPartN, byte thisData[]){
        timeCreated = System.currentTimeMillis();
        partN = thisPartN;
        data = thisData;
    }

}


package gg.plugins.piggybanks.api;

import org.bukkit.OfflinePlayer;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;

public class BagRedeemEvent extends Event implements Cancellable {

    private static final HandlerList handlers = new HandlerList();
    private boolean cancelled;

    private OfflinePlayer player;
    private int amount;

    public BagRedeemEvent(OfflinePlayer player, int amount) {
        this.player = player;
        this.amount = amount;
    }

    public OfflinePlayer getPlayer() {
        return player;
    }

    public int getAmount() {
        return amount;
    }

    public boolean isCancelled() {
        return cancelled;
    }

    public void setCancelled(boolean cancel) {
        cancelled = cancel;
    }

    public HandlerList getHandlers() {
        return handlers;
    }

    public static HandlerList getHandlerList() {
        return handlers;
    }
}


package mx.ipn.escom.horario;

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

public class Registro_AluActivity extends AppCompatActivity {

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

    EditText tx = findViewById(R.id.Nombre_a);

    public void registro(View view) {

        String cadena1 = "20";
        Integer bo = Integer.valueOf(String.valueOf(tx));

        if(cadena1.equals(bo)) {
            System.out.println("Es alumono");
        } else {
            System.out.println("Es profesor");
        }

        Intent r = new Intent(Registro_AluActivity.this, MainActivity.class);
        startActivity(r);
        finish();
    }

    public void cancelar_a(View view) {
        finish();
    }

}


# emoticam-server

[Emoticam](//www.emoticam.net) is a program that ran (consensually) in the background on a bunch of personal computers, from 2013-2018.
Anytime a user typed something to imply they were emoting in real life, it took a photo of their face and uploaded it to the project page (and formerly to Twitter).

This is the server-side software.
* docking.php handles receiving images uploaded by the desktop app
* index.php handles adding received images to the database + displaying all images
* settings.php stores database credentials and unique user codes for known participants
* receiver/poster.php handles sending new posts to Twitter (now defunct).

[The client app can be found here](https://github.com/dansakamoto/emoticam-app).

Note: there was an issue with certain Mac models purchased after the project began which caused some of the images to be underexposed. This is the reason why there are so many solid black images in the later years.


package com.futabooo.listviewpractice.views.adapters;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.futabooo.listviewpractice.R;
import com.futabooo.listviewpractice.dummy.DummyContent;
import java.util.List;

public class NormalAdapter extends ArrayAdapter<DummyContent.DummyItem> {

  public NormalAdapter(Context context, List<DummyContent.DummyItem> list) {
    super(context, 0, list);
  }

  @Override public View getView(int position, View convertView, ViewGroup parent) {
    View view = View.inflate(getContext(), R.layout.item, null);

    ImageView thumbnail = (ImageView) view.findViewById(R.id.thumbnail);
    thumbnail.setImageResource(R.mipmap.ic_launcher);

    TextView title = (TextView) view.findViewById(R.id.title);
    title.setText(getItem(position).toString());

    return view;
  }
}


package user;

import java.io.Serializable;
import java.util.Objects;

public class User implements Serializable {
    private volatile int id;
    private volatile String username;

    public User() {
        this.username = null;
    }

    public User(Integer id, String username) {
        this.id = id;
        this.username = username;
    }

    public Integer getId() {
        return id;
    }

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

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    @Override
    public boolean equals(Object o) {
        if (!(o instanceof User)) {
            return false;
        }

        User user = (User) o;
        return Objects.equals(this.username, user.username) && Objects.equals(this.id, user.id);
    }

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


package com.mytechexp.library.controller;

import com.mytechexp.library.entity.Library;
import com.mytechexp.library.service.LibraryService;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Optional;

@RestController
@RequestMapping("/library")
@Log4j2
public class LibraryController {
    @Autowired
    private LibraryService libService;
    @PostMapping("/create")
    public Library createLibrary(@RequestBody Library library)
    {
        log.info("inside create controller");
       libService.createLibrary(library);
       log.info("executed the createLibrary");
        return library;
    }
    @GetMapping("/{id}")
    public Library searchLibrary(@PathVariable long id)
    {
        Optional<Library> lib=libService.findbyId(id);
        if(lib.isPresent())
           return lib.get();
        else
        return null;
    }

}


package find_elements;

import java.util.List;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;

public class date_picker_active_dates {

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

		 System.setProperty("webdriver.chrome.driver","drivers\\chromedriver.exe");
	     WebDriver driver=new ChromeDriver();
	     driver.get("https://www.cleartrip.com/trains");
	     driver.manage().window().maximize();

	     WebElement date_picker=driver.findElement(By.xpath("//input[@id='dpt_date']"));
	     date_picker.click();

		for (int i = 0; i <=3; i++);

		WebElement active_month;
		active_month=driver.findElement(By.xpath("//input[@id='dpt_date']"));

		List<WebElement> active_dates;
		active_dates=(List<WebElement>) active_month.findElement(By.xpath("javascript: void(0);"));

	}

}


package com.eomcs.lms;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.Socket;
import com.eomcs.lms.domain.Member;

public class ServerTest {
  public static void main(String[] args) {

    try (Socket socket = new Socket("localhost", 8888);
        ObjectOutputStream out = new ObjectOutputStream(socket.getOutputStream());
        ObjectInputStream in = new ObjectInputStream(socket.getInputStream()); ){
      System.out.println("서버와 연결되었음.");

      Member member = new Member();
      member.setNo(1);
      member.setName("홍길동");
      member.setEmail("hong@test.com");
      member.setPassword("1111");
      member.setPhoto("hong.gif");
      member.setTel("1111-1111");

      out.writeObject(member);
      out.flush();

      System.out.println(in.readUTF());

      System.out.println("서버와 연결 끊었음.");
    } catch(Exception e) {
      e.printStackTrace();
    }

  } // main
}


package database;

import java.util.List;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.TypedQuery;

import entities.User;

@Stateless
public class UserDao {

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

	public User getUserByGoogleId(String googleId) {
		User user = em.find(User.class, googleId);
		return user;
	}

	public void insert(User user) {
		em.persist(user);
	}

	public void updateLevel(String googleId, String level) {
		User user = em.find(User.class, googleId);
		user.setLevelFromString(level);
	}

	public List<User> getUsers() {
		TypedQuery<User> query = em.createQuery("SELECT u FROM User u", User.class);
		List<User> resultList = query.getResultList();
		return resultList;
	}

	public void updateUser(final User user) {
		em.merge(user);
	}

	public void removeUser(final User databaseUser) {
		em.remove(databaseUser);
	}

}


package cn.yaman.http;

import androidx.annotation.Nullable;
import cn.lamb.activity.BaseActivity;
import cn.lamb.http.HttpCallback;

/**
 * @author timpkins
 */
public class YamanHttpCallback implements HttpCallback {
    private BaseActivity activity;

    public YamanHttpCallback() {
    }

    public YamanHttpCallback(BaseActivity activity) {
        this.activity = activity;
    }

    @Override
    public void onStart() {
        if (activity != null) {
            activity.showLoading();
        }
    }

    @Override
    public void onFailure(String url, String statusCode) {

    }

    @Override
    public void onSuccess(String url, @Nullable Object o) {

    }

    @Override
    public void onSuccess(String url, String result) {

    }

    @Override
    public void onError(String url, Exception e) {

    }

    @Override
    public void onFinish() {
        if (activity != null) {
            activity.dismissLoading();
        }
    }
}


package non_terminal_expression;

import java.util.List;
import java.util.ArrayList;
import abstract_expression.*;
import terminal_expression.*;
import context.*;

public class NonTerminalExpression extends AbstractExpression{
    private int resultValue;
    private String Plus = "+";
    private List<AbstractExpression> list = new ArrayList<AbstractExpression>();

    public int interpret(Context context){
        AbstractExpression childExpressions;
        context.nextToken();
        String token = "";
        while(!context.isEnd()){
            token = context.getToken();
            if(Plus.equals(token)){
                childExpressions = new NonTerminalExpression();
            }else{
                childExpressions = new TerminalExpression();
            }
            resultValue += childExpressions.interpret(context);
        }
        return resultValue;
    }

    public String toString(){
        return "+" + list.toString();
    }
}


package io.baku.alchemy.substrate.predicates;

import java.util.function.Predicate;

import edu.umd.cs.findbugs.annotations.NonNull;
import io.baku.alchemy.substrate.Scanner;
import io.baku.alchemy.substrate.symbols.Symbol;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

@RequiredArgsConstructor
@Getter
public abstract class ParsePredicate {
    public static final ParsePredicate EOF = create(0, 0, s -> !s.hasCurrent());

    public static ParsePredicate create(final int width, final float entropy,
            final Predicate<? super Scanner<? extends Symbol>> fn) {
        return new ParsePredicate(width, entropy) {
            @Override
            public boolean test(final @NonNull Scanner<? extends Symbol> state) {
                return fn.test(state);
            }
        };
    }

    private final int width;
    private final float entropy;
    public abstract boolean test(@NonNull Scanner<? extends Symbol> state);
}


package com.example.safe;

import com.example.work35_md5.R;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;

public class MainActivity extends Activity {

	private EditText tvInput;

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

	}

	 public void click1(View v){
		 Intent intent =new Intent(this,MD5Activity.class);
		 startActivity(intent);
	 }
	 public void click2(View v){
		 Intent intent =new Intent(this,AesActivity.class);
		 startActivity(intent);
	 }
	 public void click3(View v){
		 Intent intent =new Intent(this,RsaActivity.class);
		 startActivity(intent);
	 }
	 public void click4(View v){
		 Intent intent =new Intent(this,HttpsActivity.class);
		 startActivity(intent);
	 }

}


package com.shirtsio.model;

import org.codehaus.jackson.annotate.JsonProperty;

import java.math.BigDecimal;
import java.util.Date;

public class Order {

    private BigDecimal price;
    @JsonProperty("order_id")
    private Long orderId;
    private String[] warnings;

    @JsonProperty("delivery_date")
    private Date deliveryDate;

    public Date getDeliveryDate() {
        return deliveryDate;
    }

    public void setDeliveryDate(Date deliveryDate) {
        this.deliveryDate = deliveryDate;
    }

    public Long getOrderId() {
        return orderId;
    }

    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public String[] getWarnings() {
        return warnings;
    }

    public void setWarnings(String[] warnings) {
        this.warnings = warnings;
    }
}


# rest-hapi-demo
A template to auto generate RESTful API and admin dashboard using [rest-hapi](https://github.com/JKHeadley/rest-hapi) and [adminBro](https://adminbro.com/) Hapi plugin.
## Requirements

You need [Node.js version >= 12](https://nodejs.org/en/) installed and you'll need [MongoDB](https://docs.mongodb.com/manual/installation/) installed and running.

## Installation

clone the repo
```
$ git clone https://github.com/marquelzikri/rest-hapi-admin-bro
$ cd rest-hapi-admin-bro
```

install the dependencies
```
$ npm install
```
copy env file
```
$ cp .env.example .env
```

seed the models
- Local db
```
$ ./node_modules/.bin/rest-hapi-cli seed
```
- External db
```
$ ./node_modules/.bin/rest-hapi-cli seed <your mongoDB url>
```

## Using the app

start the api
```
$ npm start
```

view the api docs at

[http://localhost:8080/](http://localhost:8080/)

view the admin dashboard at

[http://localhost:8080/admin](http://localhost:8080/admin)