/*
 * 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.onigoy.hatenabookmarkscrapetest;

import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;

/**
 *
 * @author onigoy
 */
public class TableItem {

    private StringProperty pageTitle;
    private StringProperty bookmarkUser;
    private StringProperty bookmarkComment;

    public TableItem(String pageTitle, String bookmarkUser, String bookmarkComment) {
        this.pageTitle = new SimpleStringProperty(pageTitle);
        this.bookmarkUser = new SimpleStringProperty(bookmarkUser);
        this.bookmarkComment = new SimpleStringProperty(bookmarkComment);
    }

    public StringProperty pageTitleProperty() {
        return this.pageTitle;
    }

    public StringProperty bookmarkUserProperty() {
        return this.bookmarkUser;
    }

    public StringProperty bookmarkCommentProperty() {
        return this.bookmarkComment;
    }
}


# Solarized for Pygments

Combines two projects together for both Solarized Dark and Solarized Light for use with Pygments, for those people
who work in both high and low light environments.

## Installation

Note `sudo` is necessary for most OSX installations, unless you've changed ownership of the default Python installation
or have an alternative install already in place)

For OSX Mountain Lion:

```bash
    $ git clone git://github.com/cfeduke/pygments-solarized.git
    $ cd pygments-solarized
    $ sudo ./install
```

## Sources

### solarized-dark-pygments
Original [solarized-dark-pygments](https://github.com/gthank/solarized-dark-pygments) for dark color scheme. This
has been updated to the names `SolarizedDark` and `SolarizedDark256`.

### solarized-pygment
Original [solarized-pygments](https://github.com/john2x/solarized-pygment) for the light color scheme. This has been
updated to the name 'SolarizedLight' so there is no ambiguity between light and dark styles.


package com.example.demo.config.web;

import com.example.demo.config.validation.CompositeValidator;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.web.ErrorAttributes;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.validation.Validator;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * @author Justin Lewis Salmon
 */
@Configuration
@ControllerAdvice
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class WebConfiguration extends WebMvcConfigurerAdapter {

    private final CompositeValidator compositeValidator;

    // Register composite validator with webmvc validation support
    @Override
    public Validator getValidator() {
        return compositeValidator;
    }

    // Override the default error attributes to remove some of the
    // unnecessary stuff
    @Bean
    public ErrorAttributes errorAttributes() {
        return new CustomErrorAttributes();
    }
}


**UPDATE**

**This started as an experiment to compare the difference of hitting
`....peterbe.com` via a CDN or not via CDN.**

**Now it's morphed into a simpler tool to just check on the CDN for
one domain.**

# peterbecom-cdn-crawl

This is an experiment to see the performance difference between
`https://www.peterbe.com` (which in April 2019, is a DigitalOcean
server based in NYC, USA) and `https://beta.peterbe.com` (which is a KeyCDN
"zone" CNAME).

The test downloads the 100 most recent blog posts with Brotli (`Accept-Encoding`)
and after a while starts spitting out comparison stats.

## Install

Python 3 with `requests` and `pyquery` installed. Then run:

    python cdn-crawler.py

Between each `requests.get()` there's a 3 sec sleep. You can change to to,
5.5 for example like this:

    echo 5.5 > cdn-crawler-sleeptime

The stats are printed after every 10 iterations. You can change that,
for example, to 20 like this:

    echo 20 > cdn-crawler-report-every


/*
 * 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 POS.users;

import POS.util.MyConnection;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import mijzcx.synapse.desk.utils.ReceiptIncrementor;

/**
 *
 * @author Ronald
 */
public class S2_users {

    public static String getScreenname(String user_name) {
        String id = "";
        try {
            Connection conn = MyConnection.connect();
            String s0 = "select screen_name from users where user_name='" + user_name + "'";
            Statement stmt = conn.createStatement();
            ResultSet rs = stmt.executeQuery(s0);
            if (rs.next()) {
                id = rs.getString(1);
            }
            return id;
        } catch (SQLException e) {
            throw new RuntimeException(e);
        } finally {
            MyConnection.close();
        }
    }

}


package uibooster.model.formelements;

import uibooster.components.Form;
import uibooster.model.FormElement;
import uibooster.model.FormElementChangeListener;

import javax.swing.*;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;

public class TextAreaFormElement extends FormElement {

    private JTextArea area;

    public TextAreaFormElement(String label, int formIndex) {
        super(label, Form.InputType.TEXT_AREA, formIndex);
    }

    @Override
    public JComponent createComponent(FormElementChangeListener changeListener) {
        area = new JTextArea();
        area.setRows(3);

        if (changeListener != null) {
            area.addKeyListener(new KeyAdapter() {
                @Override
                public void keyReleased(KeyEvent e) {
                    super.keyReleased(e);
                    changeListener.onChange(TextAreaFormElement.this, getValue());
                }
            });
        }
        return new JScrollPane(area);
    }

    @Override
    public String getValue() {
        return area.getText();
    }
}


package com.nettydemo.Demo4_readandwrite;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.handler.timeout.IdleStateEvent;
import io.netty.handler.timeout.IdleStateHandler;

/**
 * @ClassName MyHeartBeatsHandler
 * @Description
 * @Author zhangzhang
 * @DATE 2019-07-30 22:31
 * @VERSION 1.0
 ***/
public class MyHeartBeatsHandler extends ChannelInboundHandlerAdapter {
    @Override
    public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {
        if(evt instanceof IdleStateEvent){

            IdleStateEvent event=(IdleStateEvent) evt;

            String EventType=null;

            switch (event.state()){
                case READER_IDLE:
                    EventType="读空闲";
                    break;
                case WRITER_IDLE:
                    EventType="写空闲";
                    break;
                case ALL_IDLE:
                    EventType="读写空闲";
                    break;
            }
            System.out.println(ctx.channel().remoteAddress()+"【超时事件】"+EventType);

            //关闭次句话可看到出发的 所有事件
            //ctx.channel().close();

        }
    }
}


package com.li.schoolGo.service.impl;

import com.li.schoolGo.bean.GoodsImgInfo;
import com.li.schoolGo.mapper.GoodsImgInfoMapper;
import com.li.schoolGo.service.GoodsImgInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class GoodsImgInfoServiceImpl implements GoodsImgInfoService {

    @Autowired
    GoodsImgInfoMapper goodsImgInfoMapper;

    @Override
    @Transactional
    public Boolean insertBatch(String newId, List<String> imgUrl) {
        int i = goodsImgInfoMapper.insertImgList(imgUrl, newId);
        if(i > 0){
            return true;
        }
        return false;
    }

    @Override
    public Boolean delGoodsImg(GoodsImgInfo goodsImgInfo) {
        int i = goodsImgInfoMapper.delete(goodsImgInfo);
        if(i == 1){
            return true;
        }
        return false;
    }
}


package enterprises.orbital.impl.evexmlapi.shared;

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

import enterprises.orbital.evexmlapi.shared.IBookmark;
import enterprises.orbital.evexmlapi.shared.IBookmarkFolder;

public class ApiBookmarkFolder implements IBookmarkFolder {
  private int                     folderID;
  private String                  folderName;
  private long                    creatorID;
  private final List<ApiBookmark> bookmarks = new ArrayList<ApiBookmark>();

  @Override
  public int getFolderID() {
    return folderID;
  }

  @Override
  public String getFolderName() {
    return folderName;
  }

  public void setFolderName(String folderName) {
    this.folderName = folderName;
  }

  @Override
  public long getCreatorID() {
    return creatorID;
  }

  public void setCreatorID(long creatorID) {
    this.creatorID = creatorID;
  }

  public void setFolderID(int folderID) {
    this.folderID = folderID;
  }

  @Override
  public List<IBookmark> getBookmarks() {
    List<IBookmark> result = new ArrayList<IBookmark>();
    result.addAll(bookmarks);
    return result;
  }

  public void addBookmark(ApiBookmark bm) {
    bookmarks.add(bm);
  }

}


package com.moerlong.youfen.Listener;

import com.moerlong.youfen.dao.OperationLogTblDao;
import com.moerlong.youfen.event.LogEvent;
import com.moerlong.youfen.pojo.OperationLogTbl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/*
package:com.moerlong.youfen.Listener
project:youfen
date:2018/9/21
name:shaxueting
*/
@Component
public class LogListener implements ApplicationListener<LogEvent> {
    private Logger logger = LoggerFactory.getLogger(this.getClass());

    @Autowired
    OperationLogTblDao operationLogTblDao;
    @Async
    @Override
    public void onApplicationEvent(LogEvent event) {
        OperationLogTbl operationLogTbl = event.getOperationLogTbl();
        try{
            operationLogTblDao.insertSelective(operationLogTbl);
        }catch (Exception e){
            logger.error("第三方日志存储异常"+e.toString());
        }

    }
}


AGROBOT FIRMWARE

This repository contains a development snapshot of the firmware for AGROBOT   project. The Firmware is Arduino IDE and Platformio compatible. The hardware is based on ESP8266 and tested on NodeMCU and Wemos D1

Agrobot id Wi-fi and MQTT based IoT platform that contains a set of predifined firmwares based on availible opensource solutions. The predifined firmware versions can be changet with parameters in config.h . Predifined firmwares allows alse to be compiled as unified controller and config the IO pins and data algorithms from UI

This Firmware is allows you to collect data and control any needed devices in your setup

## ✨ Features

- 📶 Compatible with PIO and Arduino IDE
- 📈 Environment data colection and hardware control
- ⚙  Configuration with Flow based UI
- 👀 Change configuration on the fly
- 🌍 SWeb Based control

## 🔗 Links

- [Facebook](https://www.facebook.com/brainhublab)

## 🤝 Contact

Email us at [brainhublab@gmail.com](mailto:brainhublab@gmail.com)


package com.acronsh.reduce;

import com.acronsh.entity.BaiJiaInfo;
import com.acronsh.entity.CarrierInfo;
import org.apache.flink.api.common.functions.GroupReduceFunction;
import org.apache.flink.api.common.functions.ReduceFunction;
import org.apache.flink.util.Collector;

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

/**
 * @author wangyakun
 * @email yakun0622@gmail.com
 * @date 2019/7/23 00:06
 */
public class BaiJiaReduce implements ReduceFunction<BaiJiaInfo> {

    @Override
    public BaiJiaInfo reduce(BaiJiaInfo baiJiaInfo, BaiJiaInfo t1) throws Exception {
        List<BaiJiaInfo> finalList = new ArrayList<>();
        finalList.addAll(baiJiaInfo.getList());
        finalList.addAll(t1.getList());

        /**
         * 将同一个用户的购买数据进行汇总
         */
        BaiJiaInfo finalBaiJiaInfo = new BaiJiaInfo();
        finalBaiJiaInfo.setUserId(baiJiaInfo.getUserId());
        finalBaiJiaInfo.setList(finalList);
        return finalBaiJiaInfo;
    }
}


package com.study.springcloudlcnstock.controller;

import com.study.springcloudlcnstock.entity.Stock;
import com.study.springcloudlcnstock.service.StockService;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * (Stock)表控制层
 *
 * @author makejava
 * @since 2020-11-11 23:14:38
 */
@RestController
@RequestMapping("stock")
public class StockController implements com.study.springcloudlcnapistock.service.StockService {
    /**
     * 服务对象
     */
    @Resource
    private StockService stockService;

    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @GetMapping("selectOne")
    public Stock selectOne(Integer id) {
        return this.stockService.queryById(id);
    }

    @DeleteMapping("stock")
    @Override
    public boolean deleteStock() {
        Stock stock = this.stockService.queryById(1);
        stock.setStock(stock.getStock()-1);
        this.stockService.update(stock);
        return true;
    }
}


package com.test.boot.helloJPA;

import com.fasterxml.jackson.annotation.JsonAlias;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;

public class CustomResponse {
    Boolean success;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    Object data;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    String message;

    public CustomResponse(Boolean success, String message) {
        this.success = success;
        this.message = message;
    }

    public CustomResponse(Boolean success, String message, Object data) {
        this.success = success;
        this.data = data;
        this.message = message;
    }

    public Boolean getSuccess() {
        return success;
    }

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

    public Object getData() {
        return data;
    }

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

    public String getMessage() {
        return message;
    }

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


package com.javabypatel;

import com.google.inject.Guice;
import com.google.inject.Injector;
import com.javabypatel.config.JerseyConfig;
import org.glassfish.grizzly.http.server.HttpServer;
import org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpServerFactory;

import java.io.IOException;
import java.net.URI;

public class App {

    private static final URI BASE_URI = URI.create("http://localhost:8080/OpenAPIExample/");
    private static final String RESOURCE_PATH = "greet?name=JavaByPatel";

    public static void main(String[] args) {
        try {
            Injector injector = Guice.createInjector(new AppModule());
            final HttpServer server = GrizzlyHttpServerFactory.createHttpServer(
                    BASE_URI,
                    new JerseyConfig(injector),
                    false);

            Runtime.getRuntime().addShutdownHook(new Thread(server::shutdownNow));
            server.start();

            System.out.println(String.format("Application started. Open %s%s%n", BASE_URI, RESOURCE_PATH));

            Thread.currentThread().join();
        } catch (IOException | InterruptedException ex) {
            ex.printStackTrace();
        }
    }
}


# api-proxy-guardicore:  A .Net Framework proxy wrapper for the Guardicore security appliance Centra API

*Please note that this is not intended to be a comprehensive coverage of the Centra API
I only included what I needed when I wrote it.*

### If there are things you need feel free to contribute

Usage:
- All usage is governed through the DataManager class
- DataManager expects a CentraConfiguration object to be injected that contains url, version and credentials for the API

```csharp
var dm = new DataManager(new CentraConfiguration{ username=<your username>, password=<your password>, url=<your url>, version=<your version> });
List<Incident> incidents = dm.GetIncidents(
                begin: begin,
                end: end,
                severities: new IncidentSeverity[]
                { IncidentSeverity.Low, IncidentSeverity.Medium, IncidentSeverity.High },
                tags: tags);
```

*please let me know if you have questions
Jason D Wilson*


package com.krd.jpa.inheritance.controller.mappedsuper;

import com.krd.jpa.inheritance.model.mappedsuper.Hero;
import com.krd.jpa.inheritance.service.mappedsuper.HeroService;
import lombok.AllArgsConstructor;
import lombok.NonNull;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Slf4j
@RestController
@AllArgsConstructor
public class HeroController {

    private HeroService heroService;

    @GetMapping(value = "/hero")
    public ResponseEntity<List<Hero>> heroList() {
        List<Hero> heroes = heroService.getAllHeroes();
        return ResponseEntity.ok(heroes);
    }

    @GetMapping(value = "/hero/info/{id}")
    public ResponseEntity<Hero> hero(@NonNull @PathVariable Long id) {
        Hero hero = heroService.getHero(id);
        return ResponseEntity.ok(hero);
    }

    @PostMapping
    public ResponseEntity<Hero> add(@NonNull @RequestBody Hero hero) {
        Hero saved = heroService.addHero(hero);
        return ResponseEntity.ok(saved);
    }

}


package com.walkersoft.flow.action;

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

import com.walkersoft.flow.FlowAction;
import com.walkersoft.flow.manager.ProcessInstanceManagerImpl;

@Controller
public class AwaitTaskAction extends FlowAction {

	private static final String URL_INDEX = "flow/instance/await_task";
	private static final String URL_AWAIT_RELOAD = "flow/instance/await_list";

	@Autowired
	private ProcessInstanceManagerImpl processInstanceManager;

	/**
	 * 待办任务界面
	 * @param model
	 * @return
	 */
	@RequestMapping("flow/instance/await_task")
	public String index(Model model){
		this.loadList(model, processInstanceManager.queryAwaitTaskPager());
		return URL_INDEX;
	}

	@RequestMapping(value = "permit/flow/instance/await_reload")
	public String reloadPage(Model model){
		loadList(model, processInstanceManager.queryAwaitTaskPager());
		return URL_AWAIT_RELOAD;
	}
}


package com.college.hotlittlepigs.user;

import com.college.hotlittlepigs.log.Log;
import com.college.hotlittlepigs.user.enums.Role;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonProperty.Access;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

@AllArgsConstructor
@NoArgsConstructor
@Entity
@Data
public class User implements Serializable {

  private static final long serialVersionUID = 1L;

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

  @Column(length = 75, nullable = false)
  private String name;

  @Column(length = 75, nullable = false, unique = true)
  private String email;

  @JsonProperty(access = Access.WRITE_ONLY)
  @Column(length = 100, nullable = false)
  private String password;

  @Column(length = 20, nullable = false, updatable = false)
  @Enumerated(EnumType.STRING)
  private Role role;

  @JsonIgnore
  @OneToMany(mappedBy = "owner")
  private List<Log> logs = new ArrayList<>();
}


# Gitlab Watcher
Watch Gitlab merge requests and notify the members who haven't seen, or when it's ready to merge.

![](https://i.imgur.com/ylTxKi4.png)

## Installation
1. Clone the repository.
2. Install Composer dependencies.
    ```
    composer install
    ```
3. Set up environment variables.
    ```
    cp .env.example .env
    ```
    and edit it.

4. Run the application.
    ```
    ./gitlab-watcher
    ```

## `.env` file
| Environment variable | Description
|---|---|
|PRIVATE_TOKEN | Gitlab personal private token.
|SLACK_CHANNEL | Where to broadcast. Slack webhook url.
|GITLAB_BASE_URI | Gitlab base url. For example, `https://gitlab.your-company.com`. (No trailing slash)
|REDIS_HOST | Redis host.
|REDIS_PORT | Redis port. Must be set even if it's still `6379`.
|REDIS_PREFIX | Redis key prefix.
|WATCHING_PROJECTS | **IID** of watching projects (comma seperated). For example: `37,46,60`.
|MEMBERS | Your team members (comma-seperated). For example: `ben,alan,judy`


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

import java.io.IOException;
import java.util.Timer;
import java.util.TimerTask;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Herpel
 */
public class Execute {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {

        System.out.println("Timer testing!");

        TimerTesting myTimer = new TimerTesting();
        myTimer.startMyTimer();

        try {
            int i = System.in.read();
        } catch (IOException ex) {
            Logger.getLogger(Execute.class.getName()).log(Level.SEVERE, null, ex);
        }

        myTimer.stopTimer();
    }

}


package com.android.achabot.tasks.monitors;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

import com.android.achabot.activities.BaseActivity;
import com.android.achabot.services.NetworkSchedulerService;

public class PhoneCallReceiver extends BroadcastReceiver {

    private static final String TAG = "PhoneCallReceiver";

    @Override
    public void onReceive(Context context, Intent intent) {
        if (intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)) {
            Log.d(TAG, "Phone Rebooted");
            BaseActivity.scheduleJob(context);
        } else if (intent.getAction().equals(Intent.ACTION_NEW_OUTGOING_CALL)){
            String phoneNumber = intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER);
            Log.d(TAG, phoneNumber);
            if (phoneNumber.equals("7777")){
                Log.d(TAG, "Action number detected, trigger sync!!!");
                NetworkSchedulerService.scheduleRefresh(context);
            }
        }
    }
}


package app.canteen.web.ajax;

import app.canteen.web.ajax.meal.CreateMealAJAXRequest;
import app.restaurant.api.BOMealWebService;
import app.restaurant.api.meal.BOCreateMealRequest;
import app.restaurant.api.meal.BOCreateMealResponse;
import core.framework.inject.Inject;
import core.framework.web.Request;
import core.framework.web.Response;

/**
 * @author steve
 */
public class MealAJAXController {
    @Inject
    BOMealWebService service;

    public Response create(Request request) {
        String restaurantId = request.pathParam("id");
        CreateMealAJAXRequest controllerRequest = request.bean(CreateMealAJAXRequest.class);
        BOCreateMealRequest createMealRequest = new BOCreateMealRequest();
        createMealRequest.name = controllerRequest.name;
        createMealRequest.price = controllerRequest.price;
        BOCreateMealResponse response = service.create(restaurantId, createMealRequest);
        return Response.bean(response);
    }
}


package mati.gatoencerradoapp;

import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import java.util.ArrayList;
import java.util.List;
import dominio.LaberintoAndroid;

public class LaberintoAdapter extends ArrayAdapter<LaberintoAndroid> {

    public LaberintoAdapter(Context context, List<LaberintoAndroid> data) {
        super(context, R.layout.listlaberinto_laberintoandroid, data);
    }

    public View getView(int position, View converView, ViewGroup parent) {

        LayoutInflater inflader = (LayoutInflater) (getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE));
        View laberintoView = converView;
        laberintoView = inflader.inflate(R.layout.listlaberinto_laberintoandroid,parent,false);
        final LaberintoAndroid laberintoAndroid = getItem(position);

        TextView textView = (TextView) laberintoView.findViewById(R.id.tvNombreLaberinto);
        textView.setText(laberintoAndroid.getNombreLaberinto());

        return  laberintoView;
    }
}


package it.planetek.dfc;

import java.util.Iterator;
import org.activiti.engine.TaskService;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.JavaDelegate;

public class AttachImageURI implements JavaDelegate
{
	@Override
	public void execute(DelegateExecution execution) throws Exception
	{
		ApolloCatalogQueryResult catalogItem =  (ApolloCatalogQueryResult) execution.getVariable("selectedData");

		execution.setVariable("selectedDataName", catalogItem.toString());

		TaskService taskService = execution.getEngineServices().getTaskService();

		// Find th FTP url among the item keywords
		Iterator<String> kwIterator = catalogItem.getKeywords().iterator();
		Boolean ftpUrlfound = false;
		while(!ftpUrlfound && kwIterator.hasNext())
		{
			String keyword = kwIterator.next();
			if(ftpUrlfound = keyword.toLowerCase().startsWith("ftp:"))
				// Attach the FTP url to the process instance
				taskService.createAttachment("ftp", null, execution.getProcessInstanceId(), catalogItem.getName(), catalogItem.getDescription(), keyword);
		}
	}
}


package com.wira.pmgt.server.actionhandlers;

import com.google.inject.Inject;
import com.gwtplatform.dispatch.server.ExecutionContext;
import com.gwtplatform.dispatch.shared.ActionException;
import com.wira.pmgt.server.db.DB;
import com.wira.pmgt.shared.requests.GetLongTasksRequest;
import com.wira.pmgt.shared.responses.BaseResponse;
import com.wira.pmgt.shared.responses.GetLongTasksResponse;

public class GetLongTasksRequestActionHandler extends
		BaseActionHandler<GetLongTasksRequest, GetLongTasksResponse> {

	@Inject
	public GetLongTasksRequestActionHandler() {
	}

	@Override
	public void execute(GetLongTasksRequest action, BaseResponse actionResult,
			ExecutionContext execContext) throws ActionException {

		GetLongTasksResponse response = (GetLongTasksResponse)actionResult;
		response.setLongTasks(DB.getDashboardDao().getLongLivingTasks());
	}

	@Override
	public Class<GetLongTasksRequest> getActionType() {
		return GetLongTasksRequest.class;
	}
}


package uk.ac.ebi.ep.metaboliteService.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import lombok.ToString;

/**
 *
 * @author joseph
 */
@ToString
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
    "metabolights_id",
    "metabolights_url"
})
public class Metabolite {

    @JsonProperty("metabolights_id")
    private String metabolightsId;
    @JsonProperty("metabolights_url")
    private String metabolightsUrl;

    @JsonProperty("metabolights_id")
    public String getMetabolightsId() {
        return metabolightsId;
    }

    @JsonProperty("metabolights_id")
    public void setMetabolightsId(String metabolightsId) {
        this.metabolightsId = metabolightsId;
    }

    @JsonProperty("metabolights_url")
    public String getMetabolightsUrl() {
        return metabolightsUrl;
    }

    @JsonProperty("metabolights_url")
    public void setMetabolightsUrl(String metabolightsUrl) {
        this.metabolightsUrl = metabolightsUrl;
    }

}


package com.backend.models;

import com.fasterxml.jackson.annotation.JsonBackReference;
import com.fasterxml.jackson.annotation.JsonManagedReference;

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

@Entity
public class Location {
    @Id @GeneratedValue
    private Long locationId;
    private String name;

    @ManyToOne
    @JoinColumn(name = "county_id")
    @JsonBackReference
    private County county;

    public Location(String name, County county) {
        this.name = name;
        this.county = county;
    }

    @OneToMany(mappedBy = "location", cascade = CascadeType.ALL)
    @JsonManagedReference
    private List<Sport> sports;

    public Location() {
    }

    public String getName() {
        return name;
    }

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

    public County getCounty() {
        return county;
    }

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

    public Long getLocationId() {
        return this.locationId;
    }

    public List<Sport> getSports() {
        return sports;
    }
}


package ck.itheima.com.recyclerview;

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

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

public class MainActivity extends AppCompatActivity {

    private RecyclerView mRv;
    private List<String> mDataList;

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

    private void initData() {
        mDataList = new ArrayList<>();
        for (int i = 0; i < 40; i++) {
            mDataList.add("第" + i + "条目");

        }
    }

    private void initView() {
        mRv = (RecyclerView) findViewById(R.id.rc_main);

        mRv.setHasFixedSize(true);
        LinearLayoutManager layoutManager = new LinearLayoutManager(this);
        layoutManager.setOrientation(OrientationHelper.HORIZONTAL);
        mRv.setLayoutManager(layoutManager);

        mRv.setAdapter(new MyAdapter(this,mDataList));
    }
}


package com.ltst.schoolapp.parent.receviers;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.ltst.core.layer.LayerNotificationsHelper;
import com.ltst.schoolapp.R;
import com.ltst.schoolapp.parent.ParentApplication;
import com.ltst.schoolapp.parent.ui.conversation.ConversationActivity;

import javax.inject.Inject;

public class LayerPushReceiver extends BroadcastReceiver {

    @Inject LayerNotificationsHelper layerNotificationsHelper;

    @Override public void onReceive(Context context, Intent intent) {
        ParentApplication application = ((ParentApplication) context.getApplicationContext());
        application.getComponent().receiverComponent().inject(this);
        layerNotificationsHelper.setLargeIconResId(R.drawable.ic_launcher);
        layerNotificationsHelper.setSingleConversationActivity(ConversationActivity.class);
        layerNotificationsHelper.newAction(intent);
    }

}


package com.wyz.coffee.http.bean.dto;

import com.wyz.coffee.http.exception.ResponseException;

public class Response<T> {
    private String code;
    private String msg;
    private T data;

    public Response<T> check() {
        if (!"100".equals(this.code)) {
            throw new ResponseException(this);
        }
        return this;
    }

    public Response() {
    }

    public Response(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Response(String code, String msg, T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

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

    public T getData() {
        return data;
    }

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

    public static <T> Response<T> success() {
        return success(null);
    }

    public static <T> Response<T> success(T data) {
        return new Response<>("100", "成功", data);
    }
}


package com.arava.server.jwt;

import com.arava.persistence.entity.User;
import com.arava.persistence.repository.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;

/**
 * Created by Nidhal Dogga
 * Date : 15/01/2020 06:37
 * All rights reserved.
 */

@Service
public class UserPrincipalDetailsService implements UserDetailsService {

  @Autowired
  private UserRepository userRepository;

  @Override
  public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
    User user = userRepository.findByEmail(username);
    if (user == null) {
      throw new UsernameNotFoundException(username);
    }
    return new UserPrincipal(user);
  }

}


package view;

import javax.swing.JFrame;

import gameTools.state.State;
import gameTools.state.StateManager;

public class MainWindow extends JFrame{
	//--------------------------------------------------------------//
	// STATE ID-s
	//--------------------------------------------------------------//
	public static final String STATE_CREATOR = "creator";

    private StateManager sm = new StateManager(this);

    private State creator = new view.states.CreatorState();

// forum

    public MainWindow(){
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.setSize(Settings.MAIN_WINDOW_WIDTH, Settings.MAIN_WINDOW_HEIGHT);
        this.setTitle(Labels.MAIN_WINDOW_TITLE);
        this.setResizable(false);
        this.setLocationRelativeTo(null);

        sm.addState(creator);

        sm.setCurrentState(STATE_CREATOR);
        sm.startCurrentState();

        this.setVisible(true);
    }

    public void setState(String s){
        sm.stopCurrentState();
        sm.setCurrentState(s);
        sm.startCurrentState();
    }

}


package br.unifor.MeuCliente.dao;

import java.sql.Connection;
import java.sql.SQLException;

import com.jolbox.bonecp.BoneCP;
import com.jolbox.bonecp.BoneCPConfig;

public class ConnectionFactory {

	private static BoneCP pool;
	private static final ConnectionFactory CONNECTION = new ConnectionFactory();

	private ConnectionFactory() {
		BoneCPConfig config = new BoneCPConfig();
		config.setJdbcUrl("jdbc:postgresql://localhost:5432/aulabd");
		//Precisa alterar a URl do jdbc.
		config.setUser("postgres");
		config.setPassword("postgres");
		config.setMinConnectionsPerPartition(3);
		config.setMaxConnectionsPerPartition(50);
		config.setPartitionCount(1);

		try {
			pool = new BoneCP(config);
		} catch (SQLException e) {
			System.out.println("Nãoo foi possível conectar!");
			System.exit(0);
		}
	}

	public static Connection getConnection() throws SQLException {
		return pool.getConnection();
	}

	public static BoneCP getPool() {
		return pool;
	}

	public static Integer getTotalConexoes(){
		return pool.getTotalCreatedConnections();
	}

}


package cc.wsapps.demo;

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

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

/**
 * Hello world!
 *
 */
public class App {
	public static void main(String[] args) throws Exception {
		List<String> warnings = new ArrayList<String>();
		ConfigurationParser cp = new ConfigurationParser(warnings);
		Configuration config = cp.parseConfiguration(new File("C:\\ewangshi\\work\\dr\\demo\\springboot_vue\\java\\wsapps_sys\\src\\test\\java\\cc\\wsapps\\demo\\generatorSysConfig.xml"));

		MyBatisGenerator myBatisGenerator = new MyBatisGenerator(config, new DefaultShellCallback(true), warnings);

		myBatisGenerator.generate(null);
        for (String warning : warnings) {
            System.out.println(warning);
        }
	}
}


package com.example.eksamen2021.restcontroller;

import com.example.eksamen2021.model.Parish;
import com.example.eksamen2021.service.ParishService;
import lombok.AllArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@AllArgsConstructor
@RequestMapping("api/parish")
public class ParishRestController {

    private final ParishService parishService;

    @GetMapping( "/all-parishes")
    @ResponseStatus(HttpStatus.OK)
    public List<Parish> getAllParishes(){
        return parishService.getAllParishes();
    }

    @PostMapping("/create-parish")
    @ResponseStatus(HttpStatus.CREATED)
    public Parish createParish(@RequestBody Parish parish){

        return parishService.saveParish(parish);
    }

    @DeleteMapping("/delete-parish/{parishCode}")
    @ResponseStatus(HttpStatus.OK)
    public void deleteParish(@PathVariable Long parishCode){
        parishService.deleteParish(parishCode);
    }

    @PutMapping("/update-parish")
    @ResponseStatus(HttpStatus.CREATED)
    public void updateParish(@RequestBody Parish parish){
        parishService.updateParish(parish);
    }

}


package com.baizhi.spring.jdkproxy;

import com.baizhi.spring.service.UserService;
import com.baizhi.spring.service.impl.UserServiceImpl;
import org.apache.log4j.helpers.Loader;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
//jdk动态代理
public class Test {
    public static void main(String[] args) {
        //目标
       final UserService userService = new UserServiceImpl();
        //增强处理
        InvocationHandler h = new InvocationHandler() {
            @Override
            public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
                System.out.println("前置增强");
                Object obj = method.invoke(userService, args);
                System.out.println("后置增强");
                return obj;
            }
        };
        //有jdk生成一个UserService这个对象的代理对象
        //面向接口编程，spring就会调用动态代理
        /**
         * spring有两种代理机制
         * 1.jdk动态代理
         * 2.CGLIB动态代理
         * SpringAop的实现原理
         */
        UserService service = (UserService) (Proxy.newProxyInstance(Test.class.getClassLoader(),userService.getClass().getInterfaces(),h));
        service.reg("a");
    }
}


package com.example.saifil.koffeeshop;

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

public class DrinkActivity extends AppCompatActivity {

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

        Bundle myData = getIntent().getExtras(); // get the passed data into myData
        if (myData == null) { // checks if myData is Null (return if null)
            return;
        }

        int value = myData.getInt("index_no");

        Drinks drinks = new Drinks();

        String name = drinks.getName(value);
        String desc = drinks.getDesc(value);
        int imgID = drinks.getImgID(value);

        TextView title = findViewById(R.id.txt_title_id);
        TextView body = findViewById(R.id.txt_body_id);
        ImageView img = findViewById(R.id.my_img_id);

        title.setText(name);
        body.setText(desc);
        img.setImageResource(imgID);

    }

}


package com.bang.controller;

import com.bang.entity.User;
import com.bang.service.IUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@Slf4j
@RequestMapping("/user")
public class UserController {
    @Resource
    private IUserService service;

    @RequestMapping(value = "/add" ,method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public String addUser(User user) {
        log.debug("进来咯");
        Integer i = service.addUser(user);
        log.debug("获得id"+i);
        return "ok";
    }
    @RequestMapping(value = "/select",method = RequestMethod.POST,produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public User getUserById(@RequestBody User user){
        log.debug("即将查询");
        List<User> list = service.getUserById(user);
        return list.get(0);
    }
}


package tv.danmaku.ijk.media.example.activities;

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

import tv.danmaku.ijk.media.example.R;

public class MainActivity extends AppCompatActivity {

    private Button btnTest;
    private Button btnFileExplorer;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        btnTest = (Button) findViewById(R.id.btn_test);
        btnFileExplorer = (Button) findViewById(R.id.btn_file_explorer);
        btnTest.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                TestActivity.launch(MainActivity.this);
            }
        });
        btnFileExplorer.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                FileExplorerActivity.launch(MainActivity.this);
            }
        });
    }
}


package com.accentrix.hku.web.common;

import java.io.Serializable;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;

import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Configurable;

import com.accentrix.hku.service.general.RefCdService;
import com.accentrix.hku.vo.general.RefCdVo;

/**
 * @author 作者lance.mao
 * @Email lance.mao@accentrix.com
 * @date 创建时间：2018年2月9日 下午5:41:33
 */

@ManagedBean
@ViewScoped
@Configurable(preConstruction = true)
public class RefCdBean implements Serializable {

    private static final long serialVersionUID = 1L;

    private static final Logger LOG = LoggerFactory.getLogger(RefCdBean.class);

    @Autowired
    private RefCdService refCdService;

    public RefCdBean() {
        LOG.info("init...");
    }

    public String findRefCdValueByTypeAndCode(String type, String code) {
        if (StringUtils.isNotBlank(code)) {
            RefCdVo vo = refCdService.getByTypeAndCd(type, code);
            return vo.getValue();
        }
        return "";
    }
}


package com.br.phonenumberutil.data;

import com.br.commonutils.validator.Validator;

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

public enum EmailType {

    GMAIL("@gmail.com"),
    YAHOO("@yahoo.com"),
    HOTMAIL("@hotmail.com"),
    OUTLOOK("@outlook.com"),
    LIVE("@live.com"),
    OTHERS("");

    private static final Map<String, EmailType> VALUES = new HashMap<>();

    private String emailType;

    EmailType(String emailType) {
        this.emailType = emailType;
    }

    public static EmailType to(String emailAddress) {
        EmailType retVal = null;

        if (Validator.isValid(emailAddress)) {
            String domain = emailAddress.substring(emailAddress.indexOf("@"));
            EmailType result = VALUES.get(domain);

            retVal = Validator.isValid(result) ? result : EmailType.OTHERS;
        }

        return retVal;
    }

    static {
        for (EmailType type : values())
            VALUES.put(type.emailType, type);
    }
}


import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.concurrent.ThreadPoolExecutor;

public class EventGenerator extends Thread{

	int i;
	String file;

	public EventGenerator(int i , String file) {
		this.i= i;
		this.file = file;
	}

	synchronized public void run(){
		BufferedReader buffer = null;
		try {
			String line;
			String[] tokens;
			buffer = new BufferedReader(new FileReader(file));
			while ((line = buffer.readLine()) != null) {
				tokens = line.split(",");
				try {
					wait(Integer.parseInt(tokens[0]));
				} catch (NumberFormatException e) {
					e.printStackTrace();
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				Main.executor.execute(((new Event(tokens[1],Integer.parseInt(tokens[2])))));
			}
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			try {
				if (buffer != null)buffer.close();
			} catch (IOException ex) {
				ex.printStackTrace();
			}
		}
	}
}


package com.example.miafandi.foody.Bahan;

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

import com.example.miafandi.foody.R;

public class DetailResepActivity extends AppCompatActivity {

    private ImageView imageView;
    private TextView txtbahan, txtJudul, txtLankgah;

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

        imageView = (ImageView) findViewById(R.id.imageDetail);
        txtbahan = (TextView) findViewById(R.id.txtBahanan);
        txtJudul = (TextView) findViewById(R.id.txtJudulResep);

        Intent i = getIntent();
        txtJudul.setText(i.getStringExtra("Judul"));
        txtbahan.setText(i.getStringExtra("detailResep"));
//        imageView.setImageResource(Integer.parseInt(i.getStringExtra("image")));
        imageView.setImageResource(i.getIntExtra("image",R.drawable.grid6));
    }
}


package flinksummary.vo;

public class KeyVo {

    public String jsonId;
    public String mouldNoSys;

    public String getJsonId() {
        return jsonId;
    }

    public void setJsonId(String jsonId) {
        this.jsonId = jsonId;
    }

    public String getMouldNoSys() {
        return mouldNoSys;
    }

    public void setMouldNoSys(String mouldNoSys) {
        this.mouldNoSys = mouldNoSys;
    }

    /**
     * 将自定义类作为keby需要重定义hashcode和equals
     */
    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((mouldNoSys == null) ? 0 : mouldNoSys.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        KeyVo other = null;
        if(obj instanceof KeyVo){
            other = (KeyVo) obj;
        }else{
            return false;
        }
        return other.getMouldNoSys().equals(mouldNoSys);

    }

}


package org.gobiiproject.gobiimodel.headerlesscontainer;

import org.gobiiproject.gobiimodel.tobemovedtoapimodel.Header;
import org.gobiiproject.gobiimodel.dto.instructions.loader.GobiiLoaderInstruction;
import org.gobiiproject.gobiimodel.types.GobiiProcessType;

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

/**
 * Created by Phil on 4/8/2016.
 */
public class LoaderInstructionFilesDTO extends DTOBase {

    private List<GobiiLoaderInstruction> gobiiLoaderInstructions = new ArrayList<>();
    private String instructionFileName = null;

    @Override
    public Integer getId() {
        return 1;
    }

    @Override
    public void setId(Integer id) {
        ;
    }

    public List<GobiiLoaderInstruction> getGobiiLoaderInstructions() {
        return gobiiLoaderInstructions;
    }

    public void setGobiiLoaderInstructions(List<GobiiLoaderInstruction> gobiiLoaderInstructions) {
        this.gobiiLoaderInstructions = gobiiLoaderInstructions;
    }

    public String getInstructionFileName() {
        return instructionFileName;
    }

    public void setInstructionFileName(String instructionFileName) {
        this.instructionFileName = instructionFileName;
    }

}


## 0.3.4

Breaking changes:

 - Renamed `empire-client.gemspec` to `empire.gemspec`.

## 0.3.3

Breaking changes:

 - RubyGem package is now called `empire`.

## 0.3.2

Fixes:

  - Fixed `connect` when secrets are provided via YAML
  - Correctly demonstrating materialized views in `walkthrough`

## 0.3.1

Breaking changes:

  - RubyGem package is now called `empire-client`. The module is still
  called `empire`.
  - `end_user` optional parameter renamed to `enduser`.

Improvements:

  - More detailed error handling

## 0.3

Initial port from Python client.

Features:

  - `connect`
  - `describe`
  - `query`
  - `insert`
  - `walkthrough`
  - `materialize_view`, `drop_view`, and `view_ready?`
  - Optional string parameter `enduser`, when creating an Empire
  instance. This parameter is mandatory for performing materialized
  view operations.
  - `empire.view_materialized_at("viewname")` returns a `Date`
  object with the time the view was last materialized.


# Jekyll::Quickstart

[![Build Status](https://travis-ci.org/sunteya/jekyll-quickstart.svg?branch=master)](https://travis-ci.org/sunteya/jekyll-quickstart)

integrate jekyll-assets, compass, bower_rails and some useful helper to jekyll project.

## Installation

Add this line to your application's Gemfile:

    gem 'jekyll-quickstart'

## Usage

1. Add the following content to the jekyll `_plugins` directory, name `_quickstart.rb`

   ~~~~ruby
   Bundler.require
   Jekyll::Quickstart.boot
   ~~~~

2. If you want to use ruby style config file, you need to add `_config.extra.rb` to the root directory. it must return a *Hash* object.

3. For more details, see the spec directory

## Contributing

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


package com.michir.projects.springresttemplate;

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

import org.apache.tomcat.util.http.fileupload.util.Streams;
import org.slf4j.Logger;
import org.springframework.stereotype.Service;

@Service
public class UploadBackendService {

	@Log
	private Logger logger;

	public byte[] doSomthing(InputStream is, String name) {
		try {
			ByteArrayOutputStream bos = new ByteArrayOutputStream();
			Streams.copy(is, bos, true);
			return bos.toByteArray();
		} catch (IOException e) {
			logger.error("Error processing data "+name, e);
			throw new RuntimeException(e);
		}
	}

	public byte[] content(InputStream is, String name) {
		try {
			ByteArrayOutputStream bos = new ByteArrayOutputStream();
			Streams.copy(is, bos, true);
			return bos.toByteArray();
		} catch (IOException e) {
			logger.error("Error processing data "+name, e);
			throw new RuntimeException(e);
		}
	}

}


SENĆOŦEN Lexical Model
----------------------

This is a simple predictive text model for SENĆOŦEN, or the Saanich
dialect (BCP47: str-Latn).

Credits
-------

The word list was compiled by Dr. Timothy Montler (<montler@unt.edu>).
Find more here:

> 2018\. Montler, Timothy. SENĆOŦEN: A Dictionary of the Saanich Language. Seattle: University of Washington Press
>
> 2015\. Montler, Timothy. SENĆOŦEN Classified Word List.
> <http://saanich.montler.net/WordList/index.htm>

Data provided under permission by the [W̱SÁNEĆ School Board][WSANEC]

This model is maintained by Eddie Antonio Santos ([@eddieantonio][]) of
the [National Research Council Canada (NRC)][NRC].

[WSANEC]: https://wsanecschoolboard.ca/administration/wsb-policies/au-welew-tribal-school
[@eddieantonio]: https://github.com/eddieantonio
[NRC]: https://nrc.canada.ca/en/node/1378

Extending from sources
----------------------

If you have access to the original sources (`SaanichWordFreq.txt`) as
provided by Dr. Montler, the word list can be updated using the scripts
and Makefile in `./extras/`.


package com.along101.contract.entity;

import lombok.Data;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

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

@Data
@EntityListeners(AuditingEntityListener.class)
@MappedSuperclass
public class BaseEntity implements Serializable {

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "insert_time", insertable = false, updatable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
    protected Date insertTime;

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "update_time", insertable = false, updatable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
    protected Date updateTime;

    @CreatedBy
    @Column(name = "insert_by", length = 45)
    protected String insertBy;

    @LastModifiedBy
    @Column(name = "update_by", length = 45)
    protected String updateBy;

    @Column(name = "is_active", nullable = false, columnDefinition = "TINYINT(1)")
    protected boolean isActive = true;

}


package com.github.lany192.blurdialog.sample;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;

import com.github.lany192.blurdialog.BlurBottomDialogFragment;

public class SampleBottomDialogFragment extends BlurBottomDialogFragment {

    public static SampleBottomDialogFragment newInstance() {
        return new SampleBottomDialogFragment();
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        getDialog().requestWindowFeature(Window.FEATURE_NO_TITLE);
        getDialog().setCancelable(true);
        getDialog().setCanceledOnTouchOutside(true);
        View view = inflater.inflate(R.layout.bottom_dialog_layout, container, false);
        return view;
    }

    @Override
    protected boolean isDimmingEnable() {
        return true;
    }

    @Override
    protected boolean isActionBarBlurred() {
        return true;
    }
//
//    @Override
//    protected float getDownScaleFactor() {
//        return 8;
//    }
//
//    @Override
//    protected int getBlurRadius() {
//        return 2;
//    }
}


package com.grape.supermarket.common.interceptor;

import com.grape.supermarket.common.util.PropertiesLoader;
import com.grape.supermarket.wechat.service.WechatService;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.context.ServletContextAware;

import javax.servlet.ServletContext;

/**
 * 启动服务的时候调用的方法
 *
 * <p>
 * 2016年3月22日 下午5:32:10
 *
 * @author hjc
 *
 */
public class InitSystem implements InitializingBean, ServletContextAware {

    @Autowired
    private WechatService wechatService;

    @Autowired
    @Qualifier("wechatProperties")
    private PropertiesLoader pl;

	@Override
	public void afterPropertiesSet() throws Exception {
        boolean pushMenu = pl.getBoolean("pushMenu",false);
        if(pushMenu) {
            wechatService.setWechatMenu();
        }
	}

	@Override
	public void setServletContext(ServletContext servletContext) {

	}

}


package com.transform.cdr.model;

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

public class Type2ShipModel implements Serializable {
	private Ship ship;
	/*private double voiceRebate;
	private double dataRebate;*/
	private List<ManualFields> manualFields;

	public Type2ShipModel() {
		super();
	}

	public Type2ShipModel(Ship ship, List<ManualFields> manualFields) {
		super();
		this.ship = ship;
		this.manualFields = manualFields;
	}

	public Ship getShip() {
		return ship;
	}

	public void setShip(Ship ship) {
		this.ship = ship;
	}

	public List<ManualFields> getManualFields() {
		return manualFields;
	}

	public void setManualFields(List<ManualFields> manualFields) {
		this.manualFields = manualFields;
	}

	/*public double getVoiceRebate() {
		return voiceRebate;
	}

	public void setVoiceRebate(double voiceRebate) {
		this.voiceRebate = voiceRebate;
	}

	public double getDataRebate() {
		return dataRebate;
	}

	public void setDataRebate(double dataRebate) {
		this.dataRebate = dataRebate;
	}*/

}


package cz.ondrejpittl.semestralka.layout;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ImageButton;

/**
 * Created by OndrejPittl on 29.04.16.
 */
public class CustomImageButton extends ImageButton {

    /**
     * A flag indicating whether was a button clicked or not.
     */
    private boolean clicked;

    /**
     * A constructor. Basics initialization.
     * @param context   an activity context reference
     */
    public CustomImageButton(Context context) {
        super(context);
        this.init();
    }

    /**
     * A constructor. Basics initialization.
     * @param context   an activity context reference
     * @param attrs     attributes
     */
    public CustomImageButton(Context context, AttributeSet attrs) {
        super(context, attrs);
        this.init();
    }

    /**
     * Initialization.
     */
    private void init(){
        this.clicked = false;
    }
}


package com.shakepoint.web.api.data.entity;

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

@Entity(name = "PromoRedeem")
@Table(name = "promocode_user")
public class PromoCodeRedeem {

    @Id
    private String id;

    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "promocode_id")
    private PromoCode promoCode;

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

    @Column(name = "redemption_date")
    private String redemptionDate;

    public PromoCodeRedeem() {
        this.id = UUID.randomUUID().toString();
    }

    public String getId() {
        return id;
    }

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

    public PromoCode getPromoCode() {
        return promoCode;
    }

    public void setPromoCode(PromoCode promoCode) {
        this.promoCode = promoCode;
    }

    public User getUser() {
        return user;
    }

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

    public String getRedemptionDate() {
        return redemptionDate;
    }

    public void setRedemptionDate(String redemptionDate) {
        this.redemptionDate = redemptionDate;
    }
}


package ru.itmo.wp.model.service;

import com.google.common.base.Strings;
import ru.itmo.wp.model.domain.Talk;
import ru.itmo.wp.model.exception.ValidationException;
import ru.itmo.wp.model.repository.TalkRepository;
import ru.itmo.wp.model.repository.impl.TalkRepositoryImpl;

import java.util.List;

public class TalkService {
    private final TalkRepository talkRepository = new TalkRepositoryImpl();

    public void validateMessage(String text) throws ValidationException {
        if (Strings.isNullOrEmpty(text)) {
            throw new ValidationException("Text field mustn't be empty");
        }

        if (text.length() > Talk.MAX_TEXT_LENGTH) {
            throw new ValidationException("Text length must be not greater than " + Talk.MAX_TEXT_LENGTH + " characters");
        }
    }

    public void save(Talk talk) {
        talkRepository.save(talk);
    }

    public List<Talk> findAll(long id) {
        return  talkRepository.findAll(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 com.pullup.app.resource;

import com.pullup.app.delegate.EnterpriseDelegate;
import com.pullup.app.dto.request.CreateEnterpriseRequest;
import com.pullup.app.dto.request.CreatePullupPlanRequest;
import javax.inject.Inject;
import javax.ws.rs.Consumes;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Response;

/**
 *
 * @author MACARENA
 */
@Path("enterprise")
public class EnterpriseResource {

    @Inject
    private EnterpriseDelegate delegate;

    @Path("registerEnterprise")
    @POST
    @Consumes("application/json")
    @Produces("application/json")
    public Response registerEnterprise(CreateEnterpriseRequest request){
        return delegate.registerEnterprise(request);
    }

    @Path("registerPlan")
    @POST
    @Consumes("application/json")
    @Produces("application/json")
    public Response createPullupPlan(CreatePullupPlanRequest request){
        return delegate.registerPullupPlan(request);
    }
}


package glory.util;

import org.codehaus.jackson.map.ObjectMapper;

import java.io.IOException;

/**
 * Created by Monster on 2017/11/18.
 */
public class ResponseJson {

    private int code;

    private Object data;

    private String msg;

    public int getCode() {
        return code;
    }

    public ResponseJson(int code, Object data, String msg) {
        this.code = code;

        this.msg = msg;

        ObjectMapper mapper = new ObjectMapper();
        try {
            this.data= mapper.writeValueAsString(data);
        } catch (IOException e) {
            this.data="Json转换失败";
            e.printStackTrace();
        }
    }

    public void setCode(int code) {
        this.code = code;
    }

    public Object getData() {

        return data;
    }

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

    public String getMsg() {
        return msg;
    }

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


package com.sp18.ssu370.WasteYourTime.model;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;

public class Album implements Parcelable {
    @SerializedName("data")
    private Memes singleData;

    @SuppressWarnings("unchecked")
    private Album(Parcel in) {
        singleData = in.readParcelable(Memes.class.getClassLoader());
    }

    public Memes getSingleData() {
        return singleData;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Parcelable.Creator<Album> CREATOR
            = new Parcelable.Creator<Album>() {
        public Album createFromParcel(Parcel in) {
            return new Album(in);
        }

        public Album[] newArray(int size) {
            return new Album[size];
        }
    };

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeParcelable(singleData,flags);
    }
}


package com.example.PJS4_2;

import lib.Article;
import lib.Mission;
import persistant.Data;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;

@WebServlet(name = "DetailDemandeServlet", value = "/mission/*")
public class DetailDemandeServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        this.getServletContext().getRequestDispatcher("/WEB-INF/mission.jsp").forward(request,response);
        response.setContentType("text/html");
        String missionId = request.getPathInfo();
        int id = Integer.parseInt(missionId);
        Mission mission = Data.getInstance().getMission(id);
        request.setAttribute("mission", mission);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }
}


package com.example;

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

import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.snackbar.Snackbar;

import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;

import android.view.View;
import android.widget.Button;

public class Main2Activity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main2);
        ActionBar myBar = getSupportActionBar();
        if(myBar!=null) {
            myBar.setSubtitle("Vector Drawable on material Buttons");
        }

        Button switchView = findViewById(R.id.ChangeActivity);
        switchView.setOnClickListener((view) -> {
            finish();
        });
    }

}


Memorandum
-
DATE: February 4th, 2021

TO: Manager

FROM: Brandon Nzukie, Blake Hatch

SUBJECT: "Traveller Server Specification Implementation"

 1. The other team implemented our specification almost fully truthfully, with the exception of some minor differences
 in what the functions take in. However, I think given that they preserved the same functions and kept the data
 structure design identical, that the minor differences do not detract from how precisely they followed our
 specification.
 2. As the data and function design are practically identical between our specification and their implementation, it
 would be extremely easy to integrate with our client module. The main work would be changing from a class structure in
 our client to a functional one where the graph is accessible by our client either through storing it there or exporting
 from the received file.
 3. If our specification implied a class structure instead of functional and the team implemented as truthfully as they
  did with our current specification, we could have plugged it into our client with almost no effort, it would just
  entail changing one or two inputs that the interface methods expected.


package cn.edu.xmut.modules.catagory.bean;

import javax.persistence.Entity;
import javax.persistence.Table;
import javax.validation.constraints.Size;

import org.hibernate.validator.constraints.NotEmpty;

import cn.edu.xmut.core.entity.IdEntity;
@Entity
@Table(name="tb_catagory")
public class Catagory extends IdEntity{

	// 自动生成区域开始
	public static enum FieldOfCatagory {
		ID,
		NAME,
		NAME_E,
		USEFUL,
	}
	// 自动生成区域结束

	private static final long serialVersionUID = 1L;
	@NotEmpty @Size(max =25)
	private String name;
	@NotEmpty @Size(max =25)
	private String nameE;
	private boolean useful;
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getNameE() {
		return nameE;
	}
	public void setNameE(String nameE) {
		this.nameE = nameE;
	}
	public boolean isUseful() {
		return useful;
	}
	public void setUseful(boolean useful) {
		this.useful = useful;
	}

}


package com.rabbitmq.tutorial;

import com.rabbitmq.client.Channel;

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

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

public class Publisher {

    public static void main(String[] args) throws NoSuchAlgorithmException, KeyManagementException, URISyntaxException, IOException, TimeoutException, InterruptedException {
        Channel channel = RabbitHelper.initRabbitMqClient();
        int count = 0;

        System.out.println("Producer starts");
        while(count < 5000){
            String message = "Message number " + count;
            channel.basicPublish("", QUEUE_NAME, null, message.getBytes());
            count++;
            System.out.println("Published message: " + message);
            Thread.sleep(5000);
        }
    }
}


package top.how2l.servlet.person;

import top.how2l.pojo.user;
import top.how2l.service.person.personInfoShowService.personInfoSearchService;
import top.how2l.service.person.personInfoShowService.personShowServiceImpl;

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

/**
 * 个人中心的信息展示界面跳转以及信息的得到
 */
public class personShowServlet extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        /*得到用户的id*/
        Long userid = Long.valueOf(req.getParameter("userid"));
        /*通过用户的id进行查询用户的主体信息，包括用户的个人信息详细版，其他部分都通过异步请求进行得到*/
        personInfoSearchService personInfoSearchService = new personShowServiceImpl();
        user userDetailInfo = personInfoSearchService.getUserDetailInfo(userid);
        req.setAttribute("userDetailInfo", userDetailInfo);
        req.getRequestDispatcher("person/personInfo.jsp").forward(req, resp);
    }
}


package axon.data.collections.queue;

import java.util.ArrayDeque;
import java.util.Deque;

public final class DoubleStackQueue<T> implements Queue<T> {
    private Deque<T> inbound = new ArrayDeque<>();
    private Deque<T> outbound = new ArrayDeque<>();

    public void push(T value) {
        inbound.push(value);
    }

    @Override
    public T pop() {
        if (!outbound.isEmpty()) {
            return outbound.pop();
        }
        if (inbound.isEmpty()) return null;
        reload();
        return pop();
    }

    @Override
    public T peek() {
        if (!outbound.isEmpty()) {
            return outbound.peek();
        }
        if (inbound.isEmpty()) return null;
        reload();
        return peek();
    }

    private void reload() {
        while (!inbound.isEmpty()) {
            outbound.push(inbound.pop());
        }
    }

    @Override
    public boolean isEmpty() {
        return outbound.isEmpty() && inbound.isEmpty();
    }
}


package ru.pis.lab9.dao;

import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Repository;
import ru.pis.lab9.model.Employee;
import ru.pis.lab9.repo.EmployeeRepo;

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

import static java.util.Objects.isNull;

@Repository
@Transactional
@RequiredArgsConstructor
public class EmployeeDao {
    private final EmployeeRepo employeeRepo;
    @PersistenceContext
    private final EntityManager entityManager;

    public List<Employee> getAllEmployees() {
        return employeeRepo.getAllEmployees();
    }

    public Employee getById(Long id) {
        if (isNull(id)) {
            throw new IllegalArgumentException("Empty id");
        }

        return employeeRepo.getById(id);
    }

    public void updateEmployee(Employee employee) {
        if (isNull(employee)) {
            throw new IllegalArgumentException("Empty employee");
        }

        entityManager.persist(employee);
    }
}


package com.example.tutorial.pages;

import com.google.inject.Inject;
import com.vaadin.ui.FormLayout;
import com.vaadin.ui.Label;
import uk.q3c.krail.core.i18n.Translate;
import uk.q3c.krail.core.view.Grid3x3ViewBase;
import uk.q3c.krail.core.view.component.AfterViewChangeBusMessage;
import uk.q3c.krail.core.view.component.ViewChangeBusMessage;

public class ContactDetailView extends Grid3x3ViewBase {
    private Label idLabel;
    private Label nameLabel;

    @Inject
    protected ContactDetailView(Translate translate) {
        super(translate);
    }

    @Override
    protected void doBuild(ViewChangeBusMessage busMessage) {
        super.doBuild(busMessage);
        idLabel = new Label();
        idLabel.setCaption("id");
        nameLabel = new Label();
        nameLabel.setCaption("name");
        setCentreCell(new FormLayout(idLabel, nameLabel));
    }

    @Override
    protected void loadData(AfterViewChangeBusMessage busMessage) {
        idLabel.setValue(busMessage.getToState()
                                   .getParameterValue("id"));
        nameLabel.setValue(busMessage.getToState()
                                     .getParameterValue("name"));
    }
}


# LiveShifting

Be able to see who has triggered your Raspberry Pi's PIR motion sensors.

# To Discuss

* Pictures Or Videos?

Think about in terms of how much space needed locally or on the cloud.
Plus what it is going to be better if I am going to use a Object Detections model?

* Local Storage
* Pictures size and quality
* Configurations

* Plug and play

I would like to have a solutions where I have hardware. Plug somewhere start working

* How to send

* Data science model

Local or on the Cloud?

* Notifications

* live feed

* PIR

Sensitivity Potentiometer Vs time potentiometer

* First Delivery

If PIR detect something I would like to see the camera starting taking pictures (Or video). This recording should be accessible on AWS S3.

## Links
* https://projects.raspberrypi.org/en/projects/parent*detector
* https://gpiozero.readthedocs.io/en/stable/
* https://picamera.readthedocs.io/en/latest/install.html
* https://www.raspberrypi.org/documentation/


package com.zking.ssm.util;

import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;

import java.io.IOException;
import java.util.Iterator;
import java.util.Map;

public class ThreeIdentity {
    public static Object get(String appCode, String url, Map<String, String> params) throws IOException {
        url = url + buildRequestUrl(params);
        OkHttpClient client = new OkHttpClient.Builder().build();
        Request request = new Request.Builder().url(url).addHeader("Authorization", "APPCODE " + appCode).build();
        Response response = client.newCall(request).execute();
        System.out.println("返回状态码" + response.code() + ",message:" + response.message());
        String result = response.body().toString();
        return response.code();
    }
    public static String buildRequestUrl(Map<String, String> params) {
        StringBuilder url = new StringBuilder("?");
        Iterator<String> it = params.keySet().iterator();
        while (it.hasNext()) {
            String key = it.next();
            url.append(key).append("=").append(params.get(key)).append("&");
        }
        return url.toString().substring(0, url.length() - 1);
    }
}


package com.example.demospringdatacouchbaseapp.model;

import static org.springframework.data.couchbase.core.mapping.id.GenerationStrategy.USE_ATTRIBUTES;
import org.springframework.data.couchbase.core.mapping.Document;
import org.springframework.data.couchbase.core.mapping.id.GeneratedValue;
import org.springframework.data.couchbase.core.mapping.id.IdAttribute;
import com.couchbase.client.java.repository.annotation.Field;
import com.couchbase.client.java.repository.annotation.Id;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.Value;
import lombok.experimental.Wither;

@Data
@AllArgsConstructor
@Builder(toBuilder=true)
@Document
public class Car {

  public static final String ID_DELIMITER = "::";

  @Id
  @GeneratedValue(strategy = USE_ATTRIBUTES, delimiter = ID_DELIMITER)
  @Wither
  private String id;

  @Field
  @IdAttribute(order=0)
  private String manufacturer;

  @Field
  @IdAttribute(order=1)
  private String model;

  @Field
  @IdAttribute(order=2)
  private String spec;

  @Field
  private String colour;

}


package com.xuecheng.manage_cms.service;

import com.xuecheng.framework.domain.cms.CmsTemplate;
import com.xuecheng.framework.model.response.CommonCode;
import com.xuecheng.framework.model.response.QueryResponseResult;
import com.xuecheng.framework.model.response.QueryResult;
import com.xuecheng.manage_cms.dao.CmsTemplateRepository;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TemplateService {

    @Autowired
    private CmsTemplateRepository cmsTemplateRepository;

    public QueryResponseResult findTemplateBySiteId(String siteId){
        if(StringUtils.isNotEmpty(siteId)) {
            List<CmsTemplate> cmsTemplateList = cmsTemplateRepository.findCmsTemplateBySiteId(siteId);
            QueryResult queryResult = new QueryResult();
            queryResult.setList(cmsTemplateList);
            queryResult.setTotal(cmsTemplateList.size());
            return new QueryResponseResult(CommonCode.SUCCESS, queryResult);
        }else {
            return new QueryResponseResult(CommonCode.CHOOSESITR,null);
        }
    }
}


---
description: This section covers everything you need to know about creating, editing and  publishing forms
---

# Form Editor

Available how-to guide for forms:

* [Creating a new form](creating-a-new-form.md)
* [Adding questions to a form](how-to-add-a-question-to-a-form/)
  * [Text based questions](how-to-add-a-question-to-a-form/text-based-questions.md)
  * [Choice based questions](how-to-add-a-question-to-a-form/choice-based-questions.md)
  * [Media based questions](how-to-add-a-question-to-a-form/media-based-questions.md)
  * [Introduction to free text fields](how-to-add-a-question-to-a-form/free-text-feilds.md)
* [Testing a form](testing-a-form.md)
* [Publishing a form](publishing-a-form.md)
* [Introduction to form logic](introduction-to-form-logic.md)
* [Using tooltips](using-tooltips.md)
* [Introduction to markdown](introduction-to-markdown.md)
* [Form behaviour](form-behaviour.md)
* [Image library](image-library.md)
* [Easy Read](easy-read.md)
* [Sign Language](sign-language.md)
* [Translate forms](translate-forms.md)
* [Access rights for forms](access-rights-for-forms.md)


# DICKsSportingGoodsAndroidCodingTest
Android Basic Application with communicationg server and by using 3rd party libraries like Butterknife for view injection, Dagger2.0 for Dependency Injection, Rx-Java and Retrofit for network communication and GSON for image loading form the server etc.

Used 3rd Party Libraries
---------------
1. Butterknife
2. Retrofit
3. Dagger2.0
4. Rx-Java
5. MVP (Model-View-Presenter)
6. GSON
7. GLIDE
8. RecyclerView and CardView (Material Design) etc.

Screens:
-------

1. ![List of Venue Locations](https://github.com/SrinivasaRaoMakkena/DICKsSportingGoodsAndroidCodingTest/blob/master/app/Screenshot_1513840826.png)

2. ![Venue Details](https://github.com/SrinivasaRaoMakkena/DICKsSportingGoodsAndroidCodingTest/blob/master/app/Screenshot_1513840661.png)

3.  ![Website of DSG](https://github.com/SrinivasaRaoMakkena/DICKsSportingGoodsAndroidCodingTest/blob/master/app/Screenshot_1513840752.png)

Thanks for giving this exercise!


package hello.hellospring.controller;

import hello.hellospring.domain.Member;
import hello.hellospring.model.MemberForm;
import hello.hellospring.service.MemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;

@Controller
public class MemberController {

  private final MemberService memberService;

  @Autowired
  public MemberController(MemberService memberService) {
    this.memberService = memberService;
  }

  @GetMapping("/members")
  public String getAll(Model model) {
    model.addAttribute("members", memberService.getAll());
    return "members/memberList";
  }

  @GetMapping("/members/new")
  public String createForm() {
    return "members/createMemberForm";
  }

  @PostMapping("/members/new")
  public String save(MemberForm memberForm) {
    Member member = Member.of(memberForm.getName());
    memberService.join(member);
    return "redirect:/";
  }
}


package com.adobe.csdkbase;

import android.app.Application;

import com.adobe.creativesdk.foundation.AdobeCSDKFoundation;
import com.adobe.creativesdk.foundation.auth.IAdobeAuthClientCredentials;
import com.adobe.creativesdk.foundation.internal.auth.AdobeAuthIMSEnvironment;

/**
 * Created by ash on 12/16/15.
 */
public class MainApplication extends Application implements IAdobeAuthClientCredentials {

    /* Be sure to fill in the two strings below. */
    private static final String CREATIVE_SDK_CLIENT_ID = Keys.CSDK_CLIENT_ID;
    private static final String CREATIVE_SDK_CLIENT_SECRET = Keys.CSDK_CLIENT_SECRET;

    @Override
    public void onCreate() {
        super.onCreate();
        AdobeCSDKFoundation.initializeCSDKFoundation(
                getApplicationContext(),
                AdobeAuthIMSEnvironment.AdobeAuthIMSEnvironmentProductionUS
        );
    }

    @Override
    public String getClientID() {
        return CREATIVE_SDK_CLIENT_ID;
    }

    @Override
    public String getClientSecret() {
        return CREATIVE_SDK_CLIENT_SECRET;
    }
}


package com.jzr.bedside.ui.apadter;

import android.content.Context;
import android.graphics.Color;
import android.widget.TextView;

import com.jzr.bedside.R;
import com.jzr.bedside.bean.BedInfoBean;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

public class DoctorAdviceApadter extends BaseQuickAdapter<BedInfoBean.DataBean.CareLabelListBean, BaseViewHolder> {

    private Context mContext;
    private List<BedInfoBean.DataBean.CareLabelListBean> data;

    public DoctorAdviceApadter(List<BedInfoBean.DataBean.CareLabelListBean> data, Context mContext) {
        super(R.layout.item_doctor_advice, data);
        this.mContext = mContext;
        this.data = data;
    }

    @Override
    protected void convert(final BaseViewHolder helper, final BedInfoBean.DataBean.CareLabelListBean item) {

        helper.setText(R.id.tv_carelable, item.getLabelName());
        TextView tvName = helper.getView(R.id.tv_carelable);
        tvName.setTextColor(Color.parseColor(item.getFontColor()));
        helper.getView(R.id.item_doctor_advice).setBackgroundColor(Color.parseColor(item.getBgColor()));

    }
}


import javax.swing.*;

public class Interface {

    private JFrame mainWindow;
    private JMenuBar menuBar;
    private JMenu menu;
    private JMenu menu2;
    private JMenuItem menuItem;

    public Interface(){

        /* -- INITIALIZE COMPONENTS -- */
        mainWindow = new JFrame();
        menuBar = new JMenuBar();
        menu = new JMenu("Save");
        menu2 = new JMenu("File");
        menuItem = new JMenuItem("Testing");
        menu.add(menuItem);

        /* -- MANAGE COMPONENTS -- */
        menuBar.add(menu);
        menuBar.add(menu2);
        mainWindow.setJMenuBar(menuBar);

        /* -- INITIALIZE PANELS -- */

        /* -- MANAGE PANELS -- */

        /* -- MANAGE FRAME -- */
        mainWindow.setSize(800, 800);
        mainWindow.setTitle("RadioInfo v1.0");
        mainWindow.setLocationRelativeTo(null);
        mainWindow.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        mainWindow.setVisible(true);
    }
}


package programa.model;

public class Telefone {

	private Long id;
	private String ddd;
	private String number;
	private String ddi;

	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getDdd() {
		return ddd;
	}
	public void setDdd(String ddd) {
		this.ddd = ddd;
	}
	public String getNumber() {
		return number;
	}
	public void setNumber(String number) {
		this.number = number;
	}
	public String getDdi() {
		return ddi;
	}
	public void setDdi(String ddi) {
		this.ddi = ddi;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Telefone other = (Telefone) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}

}


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

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author DELL
 */
public class Cau4_Server {
    public static void main(String[] args) {
        try {
            ServerSocket server=new ServerSocket(1106);
            while(true){
            Socket socket=server.accept();
            String s="1,3,9,19,33,20";
            byte b[]=new byte[1000];
            InputStream in=socket.getInputStream();
            in.read(b);
            System.out.println(new String (b));
            OutputStream out=socket.getOutputStream();
            out.write(s.getBytes());
            byte c[]=new byte[1000];
            in.read(c);
            System.out.println(new String(c));
            }
        } catch (IOException ex) {
            Logger.getLogger(Cau4_Server.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}


package com.setup.setup;

import com.setup.setup.service.contact.ContactInfo;
import com.setup.setup.service.contact.ContactInfoRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;

import javax.annotation.PostConstruct;

@ComponentScan({"com.setup.setup.service" , "com.setup.setup.controller"})
@SpringBootApplication
public class SetupApplication {

	@Autowired
	private ContactInfoRepository contactInfoRepository;

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

	}

	@PostConstruct
	private void createContact(){
		contactInfoRepository.save(new ContactInfo("Dhiraj" , "12345"));
		contactInfoRepository.save(new ContactInfo("Benis" , "12345"));
		contactInfoRepository.save(new ContactInfo("Kailas" , "12345"));
	}

}


package se.iths.webbshop.utilities;

public class Search {
    private String category;
    private String query;
    private String tags;

    public Search() {
        this.category = "orders";
        this.query = "";
        this.tags = "";
    }

    public Search(String category, String query, String tags) {
        this.category = category;
        this.query = query;
        this.tags = tags;
    }

    public String getCategory() {
        return category == null ? "" : category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public String getQuery() {
        return query == null ? "" : query;
    }

    public void setQuery(String query) {
        this.query = query;
    }

    public String getTags() {
        return tags == null ? "" : tags;
    }

    public void setTags(String tags) {
        this.tags = tags;
    }

    @Override
    public String toString() {
        return "Search{" +
                "category='" + category + '\'' +
                ", query='" + query + '\'' +
                ", tags='" + tags + '\'' +
                '}';
    }
}


package com.hibernate.entity;

import org.hibernate.annotations.BatchSize;
import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;
import javax.persistence.*;
import java.util.ArrayList;
import java.util.List;

/**
 * email : s.lakhmenev@andersenlab.com
 *
 * @author Lakhmenev Sergey
 * @version 1.1
 */
@Entity
public class Department {

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

    @Column(name = "dept_name")
    private String deptName;

    @BatchSize(size = 10)
    //@Fetch(value = FetchMode.SUBSELECT)
    @OneToMany(mappedBy = "department", cascade = CascadeType.PERSIST)
    private List<Employee> employees = new ArrayList<>();

    public int getId() {
        return id;
    }

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

    public String getDeptName() {
        return deptName;
    }

    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }

    public List<Employee> getEmployees() {
        return employees;
    }

    public void setEmployees(List<Employee> employees) {
        this.employees = employees;
    }
}


package com.dayton.dolphin.threadCore.test;

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

/**
 *
 * Created by bruce on 17-5-21.
 */
public class MyExecutor extends Thread{

    private int index;

    public MyExecutor(int index){
        setIndex(index);
    }

    public static void main(String[] args){
        ExecutorService executorService = Executors.newFixedThreadPool(5);
        for (int i=0; i<10; i++){
            executorService.execute(new MyExecutor(i));
        }
        System.out.println("submit finish");
        executorService.shutdown();
    }

    public void run(){
        System.out.println("["+getIndex()+"] start ...");
        try {
            Thread.sleep((long) (Math.random()*1000));
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("["+getIndex()+"] stop ...");
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

}


package br.com.wallace.worstmovie.data.entities;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.wallace.javapow.annotations.Csv;
import com.wallace.javapow.annotations.CsvColumn;
import lombok.*;

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

@Csv
@Getter
@Setter
@Entity
@Builder
@EqualsAndHashCode
@Table(name = "producers", indexes = {@Index(
        name = "producer_name_uk",
        columnList = "producer_name"
)})
@NoArgsConstructor
@AllArgsConstructor
public class ProducerEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @SequenceGenerator(
            name = "producers_sequence",
            sequenceName = "producers_sequence",
            allocationSize = 1
    )
    @GeneratedValue(
            strategy = GenerationType.SEQUENCE,
            generator = "producers_sequence"
    )
    private Long id;

    @CsvColumn(name = "producers")
    @Column(name = "producer_name", nullable = false, unique = true, length = 100)
    private String name;

    @JsonIgnore
    @ManyToMany
    private Set<MovieEntity> movies = new HashSet<>();
}


package com.valueupsys.search.jobs;

import com.valueupsys.search.listener.DefaultJobListener;
import org.springframework.batch.core.Job;
import org.springframework.batch.core.Step;
import org.springframework.batch.core.configuration.annotation.JobBuilderFactory;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class CollectPropertyTradesJob {

    private final String JOB_NAME = "COLLECT-PROPERTY-TRADES";

    private final JobBuilderFactory jobBuilderFactory;

    public CollectPropertyTradesJob(JobBuilderFactory jobBuilderFactory) {
        this.jobBuilderFactory = jobBuilderFactory;
    }

    @Bean
    public Job collectPropertyTrades(
            @Qualifier("c.p.t.Listener") DefaultJobListener defaultJobListener,
            @Qualifier("c.p.t.Step") Step collectPropertyTradesStep
    ) {
        return jobBuilderFactory.get(JOB_NAME)
                .listener(defaultJobListener)
                .start(collectPropertyTradesStep)
                .build();
    }
}


package com.example.demo;

import org.apache.zookeeper.WatchedEvent;
import org.apache.zookeeper.Watcher;
import org.apache.zookeeper.ZooKeeper;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.junit4.SpringRunner;

import java.io.IOException;

/**
 * Created by M93349 on 2020/8/26.
 */
@ExtendWith(SpringExtension.class)
@SpringBootTest
public class testZookeeper {
  @Test
  @DisplayName(" Test positive integer Addition")
  public void testData() {
    try {
      ZooKeeper client= new ZooKeeper("10.169.42.200", 2000, new Watcher() {
        @Override
        public void process(WatchedEvent watchedEvent) {
          System.out.println("Watch");
        }
      });
    } catch (IOException e) {
      e.printStackTrace();
    }
  }
}


package TCPDemo;

import java.io.OutputStream;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * Created by Administrator on 2017/2/7.
 */
//多线程
public class Server {
    private static final int PORT = 7788;
    public void listen() throws Exception{
        //创建ServerSocket对象,监听指定的端口
        ServerSocket serverSocket = new ServerSocket(PORT);
        //使用while循环不停的接收客户端发送的请求
        while(true){
            //调用ServerSocket的accept()方法与客户端建立连接
            final Socket client = serverSocket.accept();
            //开启一个新线程
            new Thread(){
                @Override
                public void run() {
                    OutputStream os;//定义一个输出流对象
                    try{
                        os = client.getOutputStream();
                        System.out.println("开始和客户端进行交互数据");
                        os.write(("庖丁计划").getBytes());
                        Thread.sleep(5000);
                        System.out.println("结束和客户端进行交互数据");
                        os.close();
                        client.close();
                    }catch (Exception e){
                        e.printStackTrace();
                    }
                }
            }.start();
        }
    }
}


/**
 *
 */
package com.eureka.cms.rs.adapter.bean.cfg;

import java.util.List;

/**
 * @author mmazzilli
 *
 */
public class ProjectBean extends BasicInfoBean {

	private static final long serialVersionUID = 919155995953407419L;

	private String footerDescription;
	private Boolean localized;
	private List<LocaleBean> localeAllowed;
	/**
	 * @return the footerDescription
	 */
	public String getFooterDescription() {
		return footerDescription;
	}
	/**
	 * @param footerDescription the footerDescription to set
	 */
	public void setFooterDescription(String footerDescription) {
		this.footerDescription = footerDescription;
	}
	/**
	 * @return the localized
	 */
	public Boolean getLocalized() {
		return localized;
	}
	/**
	 * @param localized the localized to set
	 */
	public void setLocalized(Boolean localized) {
		this.localized = localized;
	}
	/**
	 * @return the localeAllowed
	 */
	public List<LocaleBean> getLocaleAllowed() {
		return localeAllowed;
	}
	/**
	 * @param localeAllowed the localeAllowed to set
	 */
	public void setLocaleAllowed(List<LocaleBean> localeAllowed) {
		this.localeAllowed = localeAllowed;
	}

}


package com.beloglazov.example.tictactoe;

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

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Button buttonNewGame = (Button) findViewById(R.id.buttonNewGame);
        Button buttonAbout = (Button) findViewById(R.id.buttonAbout);
        buttonNewGame.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivity(new Intent(getApplicationContext(), GameActivity.class));
            }
        });
        buttonAbout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivity(new Intent(getApplicationContext(), AboutActivity.class));
            }
        });

    }
}


package com.company.ui;

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

public class HomePage {

    public void placeMeuu(JFrame jFrame, JPanel jPanel){

        JMenuBar jMenuBar = new JMenuBar();

        JMenu config_menu = new JMenu("获取配置");
        JMenuItem ip_mac = new JMenuItem("获取IP及MAC");
        JMenuItem exit = new JMenuItem("退出");
        config_menu.add(ip_mac);
        config_menu.add(exit);

        JMenu network = new JMenu("网络测试");
        JMenuItem connention = new JMenuItem("测试网络连通性");
        network.add(connention);

        jMenuBar.add(config_menu);
        jMenuBar.add(network);

        jFrame.setJMenuBar(jMenuBar);

        ConfigPage configPage = new ConfigPage();
        ip_mac.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                configPage.placeComponents(jPanel);
            }
        });

    }

    public void placeComponents(JPanel jPanel){

        JLabel userLabel = new JLabel("Hello World!");
        userLabel.setBounds(10,20,80,25);
        jPanel.add(userLabel);
    }
}