package com.kamalova.bot;

import java.util.List;

public class Question {

    private final int number;
    private final String question;
    private final List<String> answers;
    private final String correctAnswer;

    public Question(int number, String question, List<String> answers, String correctAnswer) {
        this.number = number;
        this.question = question;
        this.answers = answers;
        this.correctAnswer = correctAnswer;
    }

    public String getQuestion() {
        return question;
    }

    public List<String> getAnswers() {
        return answers;
    }

    public String getCorrectAnswer() {
        return correctAnswer;
    }

    @Override
    public String toString() {
        return "Question{" +
                "number=" + number +
                ", question='" + question + '\'' +
                ", answers=" + answers +
                ", correctAnswer='" + correctAnswer + '\'' +
                '}';
    }
}


# ant_hardware
Trying to create an autonomous bot using Raspberry Pi and Arduino Mega with other required hardware.

Integrated various hardware modules with ROS (like motors, encoders, camera etc.)

Code for the following cases:

* **ros_encoders_embed** - Embedded C code for integrating motor encoders with Arduino Mega and send the data to the server (or main computer) through ROS.

* **ros_motors** - Arduino IDE code for integrating two Geared DC motors with Arduino Mega.

* **ros_motors_embed** - Embedded C code for integrating two Geared DC motors with Arduino Mega and send the commands to the motor from the server (or main computer) through ROS.

* **ros_nav_embed** - Embedded C code for integrating both Geared DC motors and the encoders with each other and Arduino Mega and send/receive the data to/from the server (or main computer) through ROS.

* **ros_nav_pid** - Embedded C code for implementing **PID algorithm** to the motors to get accurate data from the encoders.

* **teleop_joystick_hardware** - C++ script for integrating a joystick controller with server (or main computer) and send the data to the motors through ROS.


package com.stech.jttapi;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 * @author srikanth
 *
 */
@RestController
@RequestMapping(value = "/api/v1/domains/jttapi/", produces = MediaType.APPLICATION_JSON_VALUE)
public class AgreementController {

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

	/**
	 *
	 * @param agreementId
	 * @return
	 */
	@GetMapping("/{ag_id}/agreement")
	public Agreement getAgreement(@PathVariable("ag_id") String agreementId) {
		LOGGER.trace("ENTRY: getAgreement {}, {}", agreementId);
		Agreement agreement = new Agreement();
		agreement.setAgId(001);
		agreement.setLicensee("test");
		agreement.setLicensor("test");
		LOGGER.trace("EXIT: getAgreement {}", agreement);
		return agreement;

	}
}


package com.example.validation.demo;

import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.boot.web.servlet.error.DefaultErrorAttributes;

import java.util.HashMap;
import java.util.List;

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

@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@Slf4j
public class ValidationControllerTest {

	@LocalServerPort
	private int port;

	@Autowired
	private TestRestTemplate restTemplate;

	@Test
	void invalidValidation() {
		ValidatedInput input = ValidatedInput.builder()
											 .eMail("invalid @ email.io")
											 .build();
		var response = restTemplate.postForObject("http://localhost:" + port + "/", input, HashMap.class);
		var errors = (List)response.get("errors");

		assertThat(errors).hasSize(1);
		log.info("Response: ", response);
	}

}


package com.example.marketstask.ui.ui.home;

import androidx.lifecycle.MutableLiveData;
import androidx.paging.DataSource;

import com.example.marketstask.data.DataManager;
import com.example.marketstask.data.remote.models.PublicRepository;

import io.reactivex.disposables.CompositeDisposable;

public class HomeDataSourceFactory extends DataSource.Factory<Long, PublicRepository> {

    private MutableLiveData<HomeDataSourceClass> liveData;
    private DataManager dataManager;
    private CompositeDisposable compositeDisposable;

    public HomeDataSourceFactory(DataManager dataManager, CompositeDisposable compositeDisposable) {
        this.dataManager = dataManager;
        this.compositeDisposable = compositeDisposable;
        liveData = new MutableLiveData<>();
    }

    public MutableLiveData<HomeDataSourceClass> getMutableLiveData() {
        return liveData;
    }

    @Override
    public DataSource<Long, PublicRepository> create() {
        HomeDataSourceClass dataSourceClass = new HomeDataSourceClass(dataManager, compositeDisposable);
        liveData.postValue(dataSourceClass);
        return dataSourceClass;
    }
}


package com.sheng.Service.back.Impl;

import com.sheng.Dao.IDeptDao;
import com.sheng.Dao.IEmpDao;
import com.sheng.Service.back.IDeptServiceBack;
import com.sheng.vo.Dept;
import com.sheng.vo.Emp;
import org.springframework.stereotype.Service;

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

@Service
public class IDeptServiceBackImpl implements IDeptServiceBack {
    @Resource(name = "IDeptDaoImpl")
    private IDeptDao DeptDao;
    @Resource(name = "IEmpDaoImpl")
    private IEmpDao EmpDao;

    @Override
    public Map<String, Object> list() {
        Map<String,Object> map=new HashMap<String,Object>();
        //获取所有部门信息
        List<Dept> AllDept=DeptDao.findDeptById();
        //获取所有部门的员工信息
        List<Emp> AllEmp=EmpDao.findAllManager();
        map.put("AllDept",AllDept);
        map.put("AllEmp",AllEmp);
        return map;
    }

    @Override
    public boolean UpdateDname(Dept dept) {
        return DeptDao.doUpdate(dept);
    }

}


package com.userexperior.uewallet;

import android.support.test.espresso.UiController;
import android.support.test.espresso.ViewAction;
import android.view.View;

import org.hamcrest.Matcher;

import java.util.ArrayList;

/**
 * Created by userexperior on 03-08-2017.
 */

public class MyViewAction {

    public static ViewAction clickChildViewWithId(final int id) {
        return new ViewAction() {
            @Override
            public Matcher<View> getConstraints() {
                return null;
            }

            @Override
            public String getDescription() {
                return "Click on a child view with specified id.";
            }

            @Override
            public void perform(UiController uiController, View view) {
                View v = view.findViewById(id);
                //v.performClick();

                ArrayList<View> views = new ArrayList<>();

                view.findViewsWithText(views, "Electricity Bill", 0);

                views.get(0).performClick();

            }
        };
    }

}


package com.atguigu.mysqlrw.service.impl;

import com.atguigu.mysqlrw.mapper.UserMapper;
import com.atguigu.mysqlrw.pojo.User;
import com.atguigu.mysqlrw.service.UserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class UserServiceImpl implements UserService {

    private static final Logger logger=LoggerFactory.getLogger(UserServiceImpl.class);

    @Autowired
    private UserMapper userMapper;

    @Override
    public User getUser(Integer id) {
        return this.userMapper.getUser(id);
    }

    @Transactional
    @Override
    public int insertUser(User user) {
        logger.info("insert into user!!!");

        return this.userMapper.insertUser(user);
    }

    @Override
    public User findUser(Integer id) {
        return this.userMapper.getUser(id);
    }
}


package com.example.novelonlineapp.model.hakore;

import java.util.ArrayList;

public class Chapter {
    private ArrayList<String> content;
    private String nextChapterUrl;
    private String prevChapterUrl;

    public Chapter() {

    }

    public Chapter(ArrayList<String> content, String nextChapterUrl, String prevChapterUrl) {
        this.content = content;
        this.nextChapterUrl = nextChapterUrl;
        this.prevChapterUrl = prevChapterUrl;
    }

    public ArrayList<String> getContent() {
        return content;
    }

    public void setContent(ArrayList<String> content) {
        this.content = content;
    }

    public String getNextChapterUrl() {
        return nextChapterUrl;
    }

    public void setNextChapterUrl(String nextChapterUrl) {
        this.nextChapterUrl = nextChapterUrl;
    }

    public String getPrevChapterUrl() {
        return prevChapterUrl;
    }

    public void setPrevChapterUrl(String prevChapterUrl) {
        this.prevChapterUrl = prevChapterUrl;
    }
}


package com.ieebook.wxshop.test;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

public class SpringContainerBeans implements BeanPostProcessor, ApplicationContextAware {
    private static final Logger logger = LoggerFactory.getLogger(SpringContainerBeans.class);

    //    private ApplicationContext applicationContext;
    private String level;

    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
        logger.debug(this.level + ": " + bean.getClass().getName());
        return bean;
    }

    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        return bean;
    }

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
//        this.applicationContext = applicationContext;
        this.level = applicationContext.getParent() == null ? "Root" : "Web";
    }
}


package org.unclesniper.uake;

public final class Location {

	public static final Location UNKNOWN = new Location(null, 0, 0);

	private final String file;

	private final int line;

	private final int column;

	public Location(String file, int line, int column) {
		this.file = file;
		this.line = line;
		this.column = column;
	}

	public String getFile() {
		return file;
	}

	public int getLine() {
		return line;
	}

	public int getColumn() {
		return column;
	}

	public boolean isUnknown() {
		return (file == null || file.length() == 0) && line <= 0;
	}

	public String toString() {
		String f;
		if(file == null || file.length() == 0) {
			if(line <= 0)
				return "<unknown location>";
			f = "<unknown file>";
		}
		else
			f = file;
		StringBuilder builder = new StringBuilder(f);
		if(line > 0) {
			builder.append(':' + String.valueOf(line));
			if(column > 0)
				builder.append(':' + String.valueOf(column));
		}
		else
			builder.append(":<unknown line>");
		return builder.toString();
	}

}


TITAN
=====

Theme: You Are the Monster
--------------------------

This is the theme I hoped would get chosen. Oh gosh.
Oh gosh.

This game will be a top-down, I guess what you'd call the very edge case of the beat-'em-up genre.

You play as a *titan*, a mythical, humongous humanoid creature, with a club. You're unleashed, by an army, as a WMD against a warring faction.

Your goal is to not die, and to cause as much destruction as possible. You can walk about, swing a club, all fun stuff.

Your enemies are swordsmen (if they're close, they're doing damage) and archers (you know what archers do I hope).

You have a, frankly, irresponsibly large health bar. It should be pretty hard to die in this game.

When you destroy the 'target' (a building), the mission is over. You gain points based on such levely things as
* slaughtering peasants
* widowing soldiers' wives
* destroying livelihoods
* demolishing nutrition sources
* eradicating enely culture

The point of the game I guess is to make you feel terrible about yourself? That's what I'm going for anyway.


# InventoryManager-ASP.NET-MVC-Project
The inventory management store application allows Store managers to manage (create, read, update and delete) clothes for their stores.

### Project desctiption:
#### ASP.NET MVC Inventory manager application.
This is application made on ASP .NET MVC.
It's purpose is to create clothes by user with role Administrator.
The application has administration panel and only user with role "Administrator", can create clothes, edit clothes information, delete clothes, edit information of given user, change role of given user.

Roles in the application and what can they visit.
* Administrator - can visit all pages in the application.
* Regular user - can visit home, about, contact, profile, all clothes, all users and details for user and clothes pages.
* Not registered user - can see only home, about, contact, login, register, view all clothes and details for clothes pages.

### Images from the application:

![](Images/Register.png)
![](Images/AllUsers.png)
![](Images/UserDetails.png)
![](Images/AddClothes.png)

## GitHub repository:

https://github.com/todor-enikov/InventoryManager-ASP.NET-MVC-Project


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

import java.io.IOException;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;

public class hadapan {
    public static void main (String[] args){
        Document doc;

        try {
              doc = Jsoup.connect("http://fskm.uitm.edu.my/v1/fakulti/staff-directory/academic/1097.html").get();

              Element tajukLaman = doc.select("#ru-mainnav").first();
            String tajuk;
              System.out.println("Tajuk Laman Web:"+ tajuk);
              Elements bahasa= doc.select("#ru-mainnav");

              for (Element BahasaElement : bahasa){
                  System.out.println("Bahasa digunakan:"+BahasaElement.text());
              }

    } catch(IOException e){

    }
    }

}


package com.xm4399.dao;

import com.xm4399.run.RunArgs;
import com.xm4399.util.JdbcUtil;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.support.rowset.SqlRowSet;
import org.springframework.lang.Nullable;
import org.springframework.stereotype.Component;

@Component
public class MysqlDao implements InitializingBean {
    @Autowired
    RunArgs runArgs;
    private JdbcTemplate jdbcTemplate;

    @Override
    public void afterPropertiesSet() throws Exception {
        jdbcTemplate = JdbcUtil.getJdbcTemplate(runArgs.getMYSQL_URL(),runArgs.getMYSQL_USER(),runArgs.getMYSQL_PASSWORD());
    }

    /**
     *
     * @param sql
     * @return
     */
    public SqlRowSet queryResultSet(String sql){
        return jdbcTemplate.queryForRowSet(sql);
    }
    /**
     *
     * @param sql
     * @param args
     * @return
     */
    public SqlRowSet queryResultSet(String sql,@Nullable Object... args){
        return jdbcTemplate.queryForRowSet(sql,args);
    }
}


package com.vmanolache.httpserver.request;

import java.io.BufferedReader;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;

/**
 * Used to read the body of a request when we know the body length in advance.
 */
class LimitedBodyReader {

	byte[] read(BufferedReader reader, int length) throws IOException {
		char[] buffer = null;
		try {
			buffer = new char[length];
			reader.read(buffer, 0, length);
		} catch (NumberFormatException e) {
			e.printStackTrace();
		}
		return toBytes(buffer);
	}

	private byte[] toBytes(char[] chars) {
		CharBuffer charBuffer = CharBuffer.wrap(chars);
		ByteBuffer byteBuffer = StandardCharsets.UTF_8.encode(charBuffer);
		byte[] bytes = Arrays.copyOfRange(byteBuffer.array(), byteBuffer.position(), byteBuffer.limit());
		Arrays.fill(charBuffer.array(), '\u0000'); // clear sensitive data
		Arrays.fill(byteBuffer.array(), (byte) 0); // clear sensitive data
		return bytes;
	}

}


import org.junit.Assert;
import org.junit.Test;
import org.powermock.api.mockito.PowerMockito;

import static org.junit.Assert.*;

public class MyAwsomeClassTest {

    @Test
    public void shouldprintHappyText() {
        //given
        InternalClassMock mock = new InternalClassMock();
        InternalClass mock2 = PowerMockito.mock(InternalClass.class);
        MyAwsomeClass myAwsomeClass = new MyAwsomeClass(mock2);

        //when
        String result = myAwsomeClass.printHappyText();
        //then
        Assert.assertEquals("I AM HA",result);
    }
    @Test
    public void shouldCosTamWhenCosTam(){
        //given
        InternalClass mock = PowerMockito.mock(InternalClass.class);
        PowerMockito.when(mock.returnSomeString()).thenReturn("STUB");
        MyAwsomeClass myAwsomeClass = new MyAwsomeClass(mock);
        //when
        String result = myAwsomeClass.thisMethodIsStubbed();

        //then
        Assert.assertEquals("STUB",result);
    }
}


package com.example.ismael.aula18softbluesms;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.telephony.SmsManager;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.EditText;

public class MainActivity extends AppCompatActivity {

    private EditText edt_telefone;
    private EditText edt_mensagem;

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

        edt_telefone = (EditText)findViewById(R.id.edt_tel);
        edt_mensagem = (EditText)findViewById(R.id.edt_mes);

    }

    public void send(View view) {

        String telefone = edt_telefone.getText().toString();
        String mensagem = edt_mensagem.getText().toString();

        SmsManager smsManager = SmsManager.getDefault();
        smsManager.sendTextMessage(telefone, null, mensagem, null, null);

    }
}


# JVM-Meetup-14
Summarize form JVM Meetup #14 @ BBM Indonesia Office

JVM Meetup #14 : Git Workflow
Tuesday, 23 October 2018
From 6 PM - 9.30 PM
@ SCTV Tower 8th Floor
SCTV Tower Senayan City
Jl Asia Afrika Jakarta Selatan

Speaker :

1. Deny Prasetyo (Senior Engineer of GoPay) -> [Implementasi Trunk based Git Work flow di GoJek.](https://drive.google.com/open?id=1QaRLmKYV0YEVBUDSTLtcEWeCxPDNfT35)
2. Endy Muhardin (Senior Consultanf of Artivisi) -> [Git Workflow: From editor to production, no hands.](https://drive.google.com/open?id=1fyt9GC7GA6VvthcHhO1BgaAC8Vd1FuhM)

![Poster JVM Meetup 14](img/jvm14_poster.jpg "Poster JVM Meetup 14")

#### Photo Session

![Photo SessionJVM Meetup 14](img/jvm14_01.jpg "Photo Session JVM Meetup 14")

![Photo Session JVM Meetup 14](img/jvm14_02.jpg "Photo Session JVM Meetup 14")

Ayo join JVM User Group di telegram untuk diskusi lebih lanjut.

Join Us : [@JVMUserGroup](http://t.me/JVMUserGroup)

Like & Follow : JVM Developer

Like & Follow -> https://www.facebook.com/JVMDeveloperID/


package com.example.kdm.astropic;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.TextView;

public class Data extends AppCompatActivity {

    WebView webView;
    TextView textView;

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

        Intent intent = getIntent();

        webView = findViewById(R.id.webview);
        textView = findViewById(R.id.txt);

        WebSettings webSettings = webView.getSettings();
        webSettings.setJavaScriptEnabled(true);
        webView.loadUrl(intent.getStringExtra("url"));
        textView.setText(intent.getStringExtra("explanation"));
        webView.setWebViewClient(new WebViewClient());
    }

    public void  onBackPressed()
    {
        if(webView.canGoBack())
        {
            webView.goBack();
        }
        else
            super.onBackPressed();
    }
}


package com.example.covidtracker.preference;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.SharedPreferences;

public class UserPreference {
    private final SharedPreferences sharedPreferences;
    private final SharedPreferences.Editor editor;

    private static final String PREFERENCE_NAME = "user_preference";
    private static final String REMINDER_TIME = "reminder_time";
    private static final String LANGUAGE = "language";

    @SuppressLint("CommitPrefEdits")
    public UserPreference(Context context){
        sharedPreferences = context.getSharedPreferences(PREFERENCE_NAME, Context.MODE_PRIVATE);
        editor = sharedPreferences.edit();
    }

    public String getReminderTime(){
        return sharedPreferences.getString(REMINDER_TIME, "17:00"); // Default jam
    }

    public void setReminderTime(String reminderTime){
        editor.putString(REMINDER_TIME, reminderTime);
        editor.apply();
    }

    public String getLanguage(){
        return sharedPreferences.getString(LANGUAGE, "in");
    }

    public void setLanguage(String language){
        editor.putString(LANGUAGE, language);
        editor.apply();
    }

}


package net.gddata.other.crm.Util;

import lombok.extern.slf4j.Slf4j;
import org.apache.commons.configuration.Configuration;
import org.apache.commons.configuration.PropertiesConfiguration;
import org.apache.commons.lang.StringUtils;

import java.io.InputStream;

/**
 * Created by knix on 16/2/29.
 */
@Slf4j
public class PropertyUtil {
    public static Configuration getConfig(String pid) {
        if (StringUtils.isEmpty(pid)) {
            throw new RuntimeException("Property file ID must be specified.");
        }
        String filename = pid + ".properties";
        PropertiesConfiguration config = new PropertiesConfiguration();
        try {
            InputStream stream = Thread.currentThread().getContextClassLoader().getResourceAsStream(filename);
            if (stream != null) {
                config.load(stream);
            }
        } catch (Exception e) {
            log.warn("Can not load configuration file", e);
        }

        return config;
    }
}


Better String
============

After reading [this](https://groups.google.com/a/chromium.org/forum/#!msg/chromium-dev/EUqoIz2iFU4/kPZ5ZK0K3gEJ) post in the Chromium-dev group I thought it was about time to take a crack at creating a better C++ string library for average use. This is the result.

The better string library contains a whole host of improvements! Delayed transfer of ownership, Delayed memory allocation and copying, extended feature set built in (conversions, parsers, constructers), and a number of optimizations built in.

Better Strings contain all of the behavior of std::string and more! Preform common operations like converting a string to an integer, preforming an insensitive comparision, or even checking if a string is a palindrome right out of the box with a single function call.

Usage
============

Better string is ready for out of the box use in any C++ project. Simply include BetterString.cpp and BetterString.h in your project and you're ready to replace all those nasty std::strings.


package de.pmrd.hackcalculator.i18n;

import com.vaadin.flow.i18n.I18NProvider;
import java.text.MessageFormat;
import java.util.List;
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import org.springframework.util.Assert;

@Component
public class SimpleI18NProvider implements I18NProvider {

  private Logger log = LoggerFactory.getLogger(SimpleI18NProvider.class);

  public static final String BUNDLE_PREFIX = "translate";

  @Override
  public List<Locale> getProvidedLocales() {
    return List.of(Locale.GERMAN);
  }

  @Override
  public String getTranslation(String key, Locale locale, Object... params) {
    Assert.notNull(key, "Got lang request for key with null value!");
    String value;
    try {
      ResourceBundle bundle = ResourceBundle.getBundle(BUNDLE_PREFIX, locale);
      value = MessageFormat.format(bundle.getString(key), params);
    } catch (MissingResourceException e) {
      log.warn("Missing resource", e);
      value = key;
    }
    return value;
  }
}


package com.example.dinogame;

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

import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        WebView webView = findViewById(R.id.wview);
        WebSettings webSettings = webView.getSettings();
        webSettings.setBuiltInZoomControls(true);
        webSettings.setJavaScriptEnabled(true);

        webView.setWebViewClient(new WebViewClient());
        webView.loadUrl("file:///android_asset/index.html");
    }
    private class WebViewClient extends android.webkit.WebViewClient {
        @Override
        public boolean shouldOverrideUrlLoading(WebView view, String url) {
            return super.shouldOverrideUrlLoading(view, url);
        }
    }
}


# HtmlToPdfMake

Convert html to PdfMake schema

## Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

### Installing

```bash
npm i -S @palmabit/htmltopdfmake
```

### Usage

```javascript
const { pdfForElement } = require('@palmabit/htmltopdfmake')
const result = pdfForElement('<div><h1>header1</h1></div>')

//result
[
  { "stack": [
    { "text": [] },
    { "stack": [
      { "text": [
        { "text": "header1", "fontSize": 32, "bold": true }
        ]
      }]
    }
  ]
]
```

## Built With

* [Parse5](https://github.com/inikulin/parse5) - HTML parsing/serialization toolset for Node.js. WHATWG HTML Living Standard (aka HTML5)-compliant.

## Versioning

We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/your/project/tags).

## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details


package com.devsaki.fakkudroid;

import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.preference.PreferenceManager;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.View;
import android.webkit.WebView;

import com.devsaki.fakkudroid.util.ConstantsPreferences;

public class MessageSupportActivity extends ActionBarActivity {

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

        try{
            PackageInfo pInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
            SharedPreferences prefs = PreferenceManager
                    .getDefaultSharedPreferences(this);
            prefs.edit().putBoolean(ConstantsPreferences.SHOW_MESSAGE_SUPPORT + pInfo.versionCode, false).apply();
        }catch (Exception ex){}

        WebView wvHelp = (WebView) findViewById(R.id.wbSupport);
        wvHelp.loadDataWithBaseURL(null, getResources().getString(R.string.help_to_fakkudroid),"text/html", "utf-8",null);
    }

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


package cn.huafei.androidm.databind;

import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Toast;

import cn.huafei.androidm.R;
import cn.huafei.androidm.bean.User;
import cn.huafei.androidm.databinding.ActivityDataBindBinding;

public class DataBindActivity extends AppCompatActivity {

    private User mUser;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ActivityDataBindBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_data_bind);
        mUser = new User("zhangsan","30");
        mUser.setPhone("1587964235");
        mUser.setAddress("shengzhen");
        binding.setUser(mUser);
        binding.setGender("男");

    }
    public void click(View view){
        Toast.makeText(DataBindActivity.this, mUser.toString(), Toast.LENGTH_SHORT).show();
    }
}


package de.baywa.tecb2bwebgwt.client.ui.page.privacy;

import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Widget;
import com.gwtplatform.mvp.client.ViewImpl;

import javax.inject.Inject;

/**
 * View of the privacy page, gwt implementation.
 *
 * @author Manfred Tremmel
 * @version $Rev$, $Date$
 *
 */
public class PrivacyViewImpl extends ViewImpl implements PrivacyPresenter.MyView {

  interface Binder extends UiBinder<Widget, PrivacyViewImpl> {
  }

  @UiField
  HTML privacyHtml;

  private final PrivacyMessages messages;

  /**
   * constructor injecting parameters.
   *
   * @param puiBinder ui binder of the page
   * @param pmessages localized messages
   */
  @Inject
  public PrivacyViewImpl(final Binder puiBinder, final PrivacyMessages pmessages) {
    super();
    this.initWidget(puiBinder.createAndBindUi(this));
    this.messages = pmessages;
  }

  @Override
  public void setHtml(final String pbranchId) {
    this.privacyHtml.setHTML(this.messages.privacyPage(pbranchId));
  }
}


package no.nav.foreldrepenger.mottak.config;

import static java.lang.System.getenv;
import static no.nav.foreldrepenger.mottak.util.EnvUtil.DEFAULT;
import static no.nav.foreldrepenger.mottak.util.EnvUtil.DEV;
import static no.nav.foreldrepenger.mottak.util.EnvUtil.LOCAL;

import java.util.Optional;

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

public class ClusterAwareSpringProfileResolver {

    private static final Logger LOG = LoggerFactory.getLogger(ClusterAwareSpringProfileResolver.class);
    private static final String NAIS_CLUSTER_NAME = "NAIS_CLUSTER_NAME";

    public static String[] profiles() {
        return Optional.ofNullable(clusterFra(getenv(NAIS_CLUSTER_NAME)))
                .map(c -> new String[] { c })
                .orElse(new String[0]);
    }

    private static String clusterFra(String cluster) {
        if (cluster == null) {
            LOG.info("NAIS cluster ikke detektert, antar {}", LOCAL);
            System.setProperty(NAIS_CLUSTER_NAME, LOCAL);
            return LOCAL;
        }
        if (cluster.contains(DEV)) {
            return DEV;
        }
        return DEFAULT;
    }
}


package es.upm.miw.apaw_ep_themes.api_controllers;

import es.upm.miw.apaw_ep_themes.business_controllers.OrderDishBusinessController;
import es.upm.miw.apaw_ep_themes.dtos.OrderDishDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping(OrderDishResource.ORDERDISHES)
public class OrderDishResource {

    public static final String ORDERDISHES = "/orderdishes";
    public static final String ID_ID = "/{id}";

    private OrderDishBusinessController orderDishBusinessController;

    @Autowired
    public OrderDishResource(OrderDishBusinessController orderDishBusinessController) {
        this.orderDishBusinessController = orderDishBusinessController;
    }

    @PutMapping(value = ID_ID)
    public void update(@PathVariable String id, @RequestBody OrderDishDto orderDishDto) {
        orderDishDto.validate();
        this.orderDishBusinessController.update(id, orderDishDto);
    }
}


/*
 * 2014/09/23 自动生成 新規作成
 *
 * (c) 江苏润和.
 */
package com.msk.core.entity;
/**
 *
表sl_bs_city_seqno对应的SlBsCitySeqno。

 *
 * @author 自动生成
 * @version 1.00
 */
public class SlBsCitySeqno extends BaseEntity{
    /**
     *
     */
    private static final long serialVersionUID = 1L;
    /** 地区编码 */
    private String cityCode;
    /** 已注册买手数 */
    private Long bsCount;
    /**
     *
默认构造函数。

     */
    public SlBsCitySeqno() {

    }

    /**
     *
地区编码。

     *
     * @return the 地区编码
     */
    public String getCityCode() {
        return cityCode;
    }

    /**
     *
地区编码。

     *
     * @param cityCode 地区编码。
     */
    public void setCityCode(String cityCode) {
        this.cityCode = cityCode;
    }

    /**
     *
已注册买手数。

     *
     * @return the 已注册买手数
     */
    public Long getBsCount() {
        return bsCount;
    }

    /**
     *
已注册买手数。

     *
     * @param bsCount 已注册买手数。
     */
    public void setBsCount(Long bsCount) {
        this.bsCount = bsCount;
    }

}


package com.gradle.demo.base.io.cpiped;

import java.io.IOException;
import java.io.PipedWriter;

/**
 * @author guxc
 * @date 2020/6/5
 */
public class CSender extends Thread {

    private PipedWriter pipedWriter = new PipedWriter();

    public PipedWriter getPipedWriter() {
        return pipedWriter;
    }

    @Override
    public void run() {
        writerShort();
//        writerLong();
    }

    private void writerShort() {
        String msg = "this is a short message";
        try {
            pipedWriter.write(msg.toCharArray());
            pipedWriter.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    private void writerLong() {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < 102; i++) {
            sb.append("1234567890");
        }
        sb.append("abcdefghijklmnopqrstuvwxyz");
        String str = sb.toString();
        try {
            pipedWriter.write(str);
            pipedWriter.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}


<img align='right' src="http://i.imgur.com/7nR7HrI.png">

# Soundmist
A Soundcloud desktop client for Windows, Linux and Mac OS X. Built with Electron and AngularJS.

### Prerequisites
The first step is to register an SC app [here](http://soundcloud.com/you/apps). The Client ID and Client Secret will be automatically generated, but you'll have to enter `http://127.0.0.1:3000/callback` in the _Redirect URL_-field so we can fetch the token later on.

To authenticate we need to set up our own backend. The one I'm using can be found [here](https://github.com/Kattjakt/soundmist-auth) and is started by running `npm install && node index.js` in the root directory.

### Running and Building
Running the application is done through either `npm run watch-linux` or `npm run watch-windows` which will start a _livereload_-session and watch the working directory for changes.

Building is done with `electron-packager` and is initiated with `npm run build` which will build packages for Windows (_32/64 bit_), Linux (_x86/x86-64_) and Darwin. Generated packages can be found in the `dist`-folder.


package ie.gmit.sw.ai.documents;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.stream.Collectors;

public class DocumentService {
	private String basePath;

	public DocumentService(String basePath) {
		this.basePath = basePath;
	}

	public void listDocuments(String path) {
		Arrays.stream(new File(basePath + path).listFiles())
			.map(file -> file.getName())
			.forEach(i -> System.out.println(i));
	}

	public TextDocument createTextDocument(String path, String name) throws IOException {
		String text = parseTextFile(path, name);
		return new TextDocument(name, text);
	}

	public String parseTextFile(String path, String textFile) throws IOException {
		return Files.lines(Paths.get(basePath + path + "/" + textFile)).collect(Collectors.joining());
	}

	public void writeToFile(String path, String name, String text) {
		try {
			System.out.println("Writing to file...");
			Files.write(Paths.get(basePath + path + "/" + name), text.getBytes());
		} catch (IOException e) {
			System.out.println("Error writing to file");
		}
	}
}


package cn.ixuehu.phoneguard.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.telephony.SmsManager;
import android.telephony.TelephonyManager;

import cn.ixuehu.phoneguard.utils.MyConstants;

/**
 * 项目名：PhoneGuard-master
 * 包名：cn.ixuehu.phoneguard.receiver
 * Created by daimaren on 2016/2/28.
 */
public class BootCompleteReceiver extends BroadcastReceiver{
    private SharedPreferences sp;
    private TelephonyManager telephonyManager;
    @Override
    public void onReceive(Context context, Intent intent) {
        //判断是否更换sim卡
        sp = context.getSharedPreferences(MyConstants.SP_NAME, Context.MODE_PRIVATE);
        String oldSim = sp.getString(MyConstants.SIM, "") + "1";
        telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
        String newSim = telephonyManager.getSimSerialNumber();
        if (oldSim.equals(newSim)){

        }
        else {
            SmsManager sm = SmsManager.getDefault();
            sm.sendTextMessage(sp.getString(MyConstants.SAFEPHONE,"110"),null,"我是小偷,这是我的新号",null,null);
        }
    }
}


/*
 * 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.
 */
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.*;

/**
 *
 * @author Fran
 */
public class Parse {
    public Parse(){}
    public void leer (File file) throws FileNotFoundException, IOException{
        FileInputStream inputStream = null;
        Scanner sc = null;
        try{
            //inputStream = new FileInputStream(file);
            //sc = new Scanner(inputStream, "UTF-8");
            sc = new Scanner(file);
            while (sc.hasNextLine()){
                String line = sc.nextLine();
                System.out.println(line);
            }
            if(sc.ioException() != null){  throw sc.ioException();   }
        }
        finally{
            if (inputStream != null){   inputStream.close();    }
            if (sc != null) {   sc.close();     }
        }
    }

}


+++
author = "Balduran Chang"
date = 2015-06-08T23:09:52Z
description = ""
draft = true
slug = "yahoo-oauth2-flow"
title = "Yahoo oauth2 flow"

+++

#yahoo oauth2
##work flow
https://developer.yahoo.com/oauth2/guide/flows_authcode/

server side要拉user資料，一定是通過explicit grant flow，如果是client side app才會是走implicit grant flow。

### get developer credential
拿到每個developer自己一組key/secret。

### redirect user to oauth endpoint
developer key為一組參數，將user轉入oauth endpoint

### Yahoo redirect user back to developer app
user 允許app取得個人資料後，yahpp endpoing轉回developer app，同時提供authorization code供之後使用

### developer app use authorization code to get token
authorization code 拿到之後，developer可以從token endpoint繼續拿到
1. access_token
2. refresh_token

### use access token to poke API
access token 過期前都可以用，過期後就拿refresh token取得新token

## trouble shooting
{"error":"invalid_grant"}
redirect_url必須一樣。

ref:
1. https://developer.linkedin.com/docs/signin-with-linkedin#images
2. https://dev.twitter.com/web/sign-in/desktop-browser
3. https://dev.twitter.com/web/sign-in/implementing
4. http://app.balduran.cc/index.php


package nl.tudelft.oopp.group43.project.payload;

import nl.tudelft.oopp.group43.project.models.BikeReservation;

public class BikeReservationResponse {
    BikeReservation bikeReservation;
    String message;
    int status;

    /**
     * init the bike reservation.
     * @param bikeReservation the bike reservation.
     * @param message the message.
     * @param status the status of reservation.
     */
    public BikeReservationResponse(BikeReservation bikeReservation, String message, int status) {
        this.bikeReservation = bikeReservation;
        this.message = message;
        this.status = status;
    }

    public String getMessage() {
        return message;
    }

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

    public BikeReservation getBikeReservation() {
        return bikeReservation;
    }

    public void setBikeReservation(BikeReservation bikeReservation) {
        this.bikeReservation = bikeReservation;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }
}


package com.honda.atlas.security.service;

import com.honda.atlas.models.Users;
import com.honda.atlas.repo.RolesRepo;
import com.honda.atlas.repo.UsersRepo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Component;

import java.util.HashSet;

@Component
public class UserServiceImpl implements UserService {

    private final UsersRepo usersRepo;
    private final PasswordEncoder passwordEncoder;
    private final RolesRepo rolesRepo;

    @Autowired
    public UserServiceImpl(UsersRepo usersRepo, PasswordEncoder passwordEncoder, RolesRepo rolesRepo) {
        this.usersRepo = usersRepo;
        this.passwordEncoder = passwordEncoder;
        this.rolesRepo = rolesRepo;
    }

    @Override
    public void save(Users user) {
        user.setPassword(passwordEncoder.encode(user.getPassword()));
//        user.setRoles(new HashSet<>(rolesRepo.findAll()));
        usersRepo.save(user);
    }

    @Override
    public Users findByUsername(String username) {
        return usersRepo.findByUsername(username);
    }
}


package com.oysteinmyrmo.test.collapsibletoolbarnestedscrollviewtest;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.AppBarLayout;
import android.support.v4.app.Fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

public class YellowFragment extends Fragment
{
	public static YellowFragment newInstance()
	{
		return new YellowFragment();
	}

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

	@Nullable
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
	{
		View rootView = inflater.inflate(R.layout.yellow_fragment, container, false);

		RecyclerView recyclerView = (RecyclerView) rootView.findViewById(R.id.yellow_recyclerview);
		recyclerView.setAdapter(new YellowFragmentRecyclerViewAdapter());
		recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));

		return rootView;
	}
}


package cn.wilmar.wcmdemo;

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

import java.util.ArrayList;

/**
 * 创建 by 殷国伟 于 2017/9/15.
 */
@Component
public class DemoUserDetailsService implements UserDetailsService {
    private final UserRepository repository;

    public DemoUserDetailsService(UserRepository repository) {
        this.repository = repository;
    }

    @Override
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
        User user = repository.findByUsername(username);
        if (user == null ) {
            throw  new UsernameNotFoundException("用户找不到！" + username);
        }
        return new org.springframework.security.core.userdetails.User(
                username, user.getPassword(), new ArrayList<>()
        );
    }
}


package hey.action;

import com.opensymphony.xwork2.ActionSupport;
import hey.model.HeyBean;
import org.apache.struts2.interceptor.SessionAware;

import java.rmi.RemoteException;
import java.util.Map;

public class PassaURLAction extends ActionSupport implements SessionAware {
    private Map<String, Object> session;
    private String url;

    @Override
    public String execute() throws RemoteException {
        //vai buscar o url do facebook
        String url = this.getHeyBean().connectionURL();
        session.put("url", url);
        return SUCCESS;
    }

    public Map<String, Object> getSession() {
        return session;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public HeyBean getHeyBean() {
        if(!session.containsKey("heyBean"))
            this.setHeyBean(new HeyBean());
        return (HeyBean) session.get("heyBean");
    }

    public void setHeyBean(HeyBean heyBean) {
        this.session.put("heyBean", heyBean);
    }

    @Override
    public void setSession(Map<String, Object> session) {
        this.session = session;
    }
}


# Title
Anita's Kitchen
## Author
Yvonne Ouma
## Description
This application entails information on Anita's kitchen.It is a sample layout of what the hotel offers.
## Prerequisites
* web browser
* git
## Setup/Installation Requirements
* Go to Goggle Chrome or Google Chromium
* In the search button,search github
* log in if you have an account if not create an account
* You can clone my project on the clone button
* this is the link to my application https://yvonne-ouma.github.io/kitchen-anita/
## Known Bugs
Does not work in Internet-explorer.
## Technologies Used
In my application i used HTML language where i brought out the structure of the application.I also used CSS where i was able to make my application look more pleasant.It is easy to work on HTML and CSS, a'll highly recommend you to learn more on using this languages.
## Support and contact details
If any complication comes up when running this application please contact me on my gmail account yvonneouma98@gmail.com or 0706244461.


package com.example.rxusagi.myapplication.model;

import android.util.Log;

/**
 * Created by RXUsagi on 15/10/2015.
 */
public class Instruction {
    private int key;
    private String img;
    private String instruction;
    private String instruction2;
    private String instruction_name;
    private String style;
    public  Instruction(int key,String img,String instruction,String instruction2,String instruction_name,String style){
        Log.i("TAG4", "INCre" + instruction_name +" " + style);
        this.key = key;
        this.img = img;
        this.instruction = instruction;
        this.instruction2 = instruction2;
        this.instruction_name = instruction_name;
        this.style = style;
    }
    public int getKey() {
        return key;
    }
    public String getImg() {
        return img;
    }
    public String getInstruction() {
        return instruction;
    }
    public String getInstruction2() {
        return instruction2;
    }
    public String getInstruction_name() {
        return instruction_name;
    }
    public String getStyle() {
        return style;
    }
}


# LSA_PRACTICALS
                                            ##INDEX
________________________________________________________________________________________________________________________________________________________________________________
Practical_1	Install DHCP Server

Practical_2	Initial settings: Add a user, Network settings, Configure services and List of services.

Practical_3	Configure NFS server to share directories or files on your network.

Practical_4 SSH Server: Password Authentication Configure SSH server.

Practical_5 Install Samba to share folders or files between Windows and Linux

Practical_6	Configure NTP, Install and Configure NTP Server, Configure NTP Client.

Practical_7 Install MySQL to configure database server

Practical_8 Configure NIS in order to share user accounts in your local network.
________________________________________________________________________________________________________________________________________________________________________________

# NAME    : PANKAJ PATHAK
# ROLL NO : 6089
# CLASS   : TYCS


---
layout: page
title:  From HTML 4 to XHTML 1
author: jevon
date:   2005-12-09 08:14:42 +13:00
tags:
  - Article
  - HTML
redirect_from:
  - "/wiki/From HTML 4 to XHTML 1"
---

[Articles](Articles.md)

Recently I made a [Journals](Journals.md) style that had to be valid to [XHTML](xhtml.md) (strict) instead of just [HTML](html.md). While working on this, I made a couple of observations.

## DOCTYPE
The doctype for [XHTML](xhtml.md) strict documents:
`<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">`

## IFRAME
_IFRAME_ is no longer permitted in [XHTML](xhtml.md), but you can do the same thing with the _OBJECT_ tag (source):
```
<object data="sourcefile.html" type="text/html">
(text for other browsers)
</object>
```

## NOBR
_NOBR_ was never part of the [HTML](html.md) 4.0 standard anyway. To do the same thing in [CSS](CSS.md):
`.nobr { white-space: nowrap; }`

## IMG
The _align="absmiddle"_ attribute is not supported in XHTML, but using _middle_ seems to work just as well. Also, you can't use a _border_ attribute on an _IMG_ tag (use [CSS](CSS.md) instead).


## Module 1: Intro to Programming

Module 1 will cover an introduction to programming in the respective language of the cohort class, Java or C#. Included in the material will be
Data Types, Expressions and Statements, Object Oriented Programming Principles, Exception Handling, File I/O, and Testing using TDD.

[Module 1: Intro to Programming](module-1/)

## Module 2: Database Programming

The database module introduces SQL as a query language and then leverages C# and Java to issue SQL commands against our databases.

[Module 2: Database Programming](module-2)

## Module 3

Module 3 covers how to implement web applications that are dynamically generated using server-side code. The use of the Model View Controller (MVC) pattern is especially emphasized.

[Module 3: Server Side Programming](module-3)

## Module 4

Module 4 will cover an introduction to JavaScript. We will cover the fundamentals of JavaScript and look at a framework called VueJS that will help us build applications. We will wrap the module up by looking what web services are and how to consume and create them.

[Module 4: JavaScript](module-4)


package com.galua.autodealer.entity;

import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Column;
import com.haulmont.cuba.core.entity.StandardEntity;
import com.haulmont.chile.core.annotations.NamePattern;

@NamePattern("%s %s %s|firstName,lastName,phone")
@Table(name = "AUTODEALER_PHYSICAL_PERSON")
@Entity(name = "autodealer$PhysicalPerson")
public class PhysicalPerson extends StandardEntity {
    private static final long serialVersionUID = -4000120056723997493L;

    @Column(name = "FIRST_NAME")
    protected String firstName;

    @Column(name = "LAST_NAME")
    protected String lastName;

    @Column(name = "PHONE")
    protected String phone;

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public String getFirstName() {
        return firstName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public String getLastName() {
        return lastName;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getPhone() {
        return phone;
    }

}


package com.tc.poc.policy.event.engine;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.stereotype.Service;

import com.tc.poc.policy.event.model.Policy;

@Service
public class Producer {

    private static final Logger logger = LoggerFactory.getLogger(Producer.class);
    private static final String TOPIC = "posting";

    /*
    @Autowired
    private KafkaTemplate<String, String> kafkaTemplate;
    */

    @Autowired
    private KafkaTemplate<String, Policy> kafkaTemplatePolicy;

    /*
    public void sendMessage(String message) {
        logger.info(String.format("#### -> Producing message -> %s", message));
        this.kafkaTemplate.send(TOPIC, message);
    }

    */
    public void sendPolicy(Policy policy) {
        logger.info(String.format("#### -> Producing message -> %s", policy));
        this.kafkaTemplatePolicy.send(TOPIC, policy);
    }
}


package com.yyf.happyfish.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.util.Log;

import com.yyf.happyfish.wechat.view.fragment.WeChatFragment;

/**
 * Created by yyf on 2016/5/25.
 */
public class NetWorkBroadcastReceiver extends BroadcastReceiver {

//    public static boolean isConnected;
    @Override
    public void onReceive(Context context, Intent intent) {
        ConnectivityManager connectivityManager=(ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
        NetworkInfo mobNetInfo=connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
        NetworkInfo  wifiNetInfo=connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI);

        if (!mobNetInfo.isConnected() && !wifiNetInfo.isConnected()) {
            WeChatFragment.isConnected = false;
        }else {
            WeChatFragment.isConnected = true;
            //改变背景或者 处理网络的全局变量
        }

        Log.d("123","isConnected:"+  WeChatFragment.isConnected);
    }
}


package es.restserver.service.consumer;

import java.util.concurrent.CountDownLatch;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

import es.restserver.component.MessageStorage;

@Component
public class KafkaConsumer {

	private static final Logger log = LoggerFactory.getLogger(KafkaConsumer.class);

	public final CountDownLatch countDownLatch1 = new CountDownLatch(1);

	@Autowired
	MessageStorage storage;

	@Value("${client.topic}") //--client.topic=client_1
	private String clientTopic;

	@KafkaListener(topics="${client.topic}", group="${spring.kafka.consumer.group-id}")
    public void processMessage(String content) {
		log.info("[KafkaConsumerREST-GET] topic='{}' data='{}'",clientTopic,content);
		storage.put(content);
		countDownLatch1.countDown();
    }

}


package com.example.bookreservationserver.book.service;

import com.example.bookreservationserver.book.domain.repository.BookRepository;
import com.example.bookreservationserver.book.dto.BookRequestDto;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;

import static org.mockito.ArgumentMatchers.argThat;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;

@ExtendWith(MockitoExtension.class)
class BookAddServiceTest {

    @InjectMocks
    private BookAddService bookAddService;

    @Mock
    private BookRepository bookRepository;

    @Test
    @DisplayName("책 추가 성공")
    public void testAddBookSuccess(){
        // given
        BookRequestDto bookRequestDto = BookRequestDto.builder().book_name("book1").build();

        // when
        bookAddService.addBook(bookRequestDto);

        // then
        verify(bookRepository, times(1)).save(argThat(b -> b.getBook_name().equals("book1")));
    }
}


package br.com.quub.jms.consumer;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.stereotype.Component;

import br.com.quub.model.Chat;
import br.com.quub.model.User;
import br.com.quub.model.storage.ChatStorage;
import br.com.quub.service.RegisterUserService;

@Component
public class JmsConsumer {

	@Autowired
	JmsTemplate jmsTemplate;

	@Autowired
	private ChatStorage chatStorage;

	@Autowired
	private RegisterUserService registerUserService;

	@JmsListener(destination = "${quub.activemq.queue.chat}", containerFactory = "jsaFactory")
	public void receive(Chat chat) {
		chatStorage.add(chat);
	}

	@JmsListener(destination = "${quub.activemq.queue.chat.login}")
	public void receiveRegisterLogin(User user) {
		try {
			registerUserService.registraUsuario(user);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	@JmsListener(destination = "${quub.activemq.queue.chat.logout}")
	public void receiveRegisterLogout(User user) {
		try {
			registerUserService.excluiRegistroUsuario(user);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}


# What is this?
- This is just a school project that about "SDN security". However, it is not really about the security in SDN. I was actually working on "detecting the traditional malicious traffics in SDN".

- Also:
    -  the code are messy and unreadable.
    -  do not expect has good performance
    -  many bugs

# Description
## read this first
- I am using the RYU controller in this project.
- All the experiments test in the Mininet VM
- I mainly aim to detect the following malicious traffics in SDN:
    - Scanning probe traffics like nmap, ncat or maybe telnet for HTTP
    - "Potential flooding" - it is a rubbish because I just set a threshold manually in ```simple_monitor_13.py``` for flow stat and port stat for the detection
- Currently, I only upload the parser coding for convert pcap to csv
- I will upload the codes of RYU later in May after the final presentation
## folder structure in this repo
- ```pcap_parsing_and_data_training/``` store the code of pcap parser and the ML code for training the clf(classifiers). Those clf are used in RYU later
- ```ryu_code/``` store the ryu controller codes, there will be only 2 files ```example_switch_13.py``` & ```simple_monitor_13.py```


package be.vdab.servlets;

import be.vdab.entities.Genre;
import be.vdab.services.GenreService;

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

/**
 * Servlet implementation class IndexServlet
 */
@WebServlet(name="indexservlet", urlPatterns="/index.htm")
public class IndexServlet extends HttpServlet {

	private static final long serialVersionUID = 1L;
	private static final String VIEW = "/WEB-INF/JSP/index.jsp";
	private final transient GenreService genreservice = new GenreService();

	@Override
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		Iterable<Genre> genres = genreservice.findAllGenres();
		request.setAttribute("genres", genres);
		request.getRequestDispatcher(VIEW).forward(request, response);
	}

}


package com.test.wrapper;
import com.test.wrapper.StringWrapper;
import org.junit.Test;
import static org.junit.Assert.*;

public class TestStringWrapper {

    @Test
    public void TestWrapperForValidLongStr(){
        StringWrapper st = new StringWrapper();

        st.maxLength = 23;
        String out = st.wrapAString("Design a word wrap micro service which provides functionality.");
        String expected = "Design a word wrap " + System.lineSeparator() + "micro service which " +
                System.lineSeparator() + "provides functionality.";
        assertEquals(out, expected);
    }

    @Test
    public void TestWrapperForNullString(){
        StringWrapper st = new StringWrapper();

        st.maxLength = 23;
        String out = st.wrapAString(null);
        String expected = null;
        assertEquals(out, expected);
    }

    @Test
    public void TestWrapperForShortString(){
        StringWrapper st = new StringWrapper();

        st.maxLength = 23;
        String out = st.wrapAString("test a string");
        String expected = "test a string";
        assertEquals(out, expected);
    }

}


package com.example.app1;

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

import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {
Button btn;
ImageView img;
CheckBox ck1, ck2;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        btn=(Button) findViewById(R.id.next);
        img=(ImageView) findViewById(R.id.img);
        btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent= new Intent(MainActivity.this,Verification.class);
                startActivity(intent);
            }
        });
        ck1 = (CheckBox) findViewById(R.id.agree);
        ck2=(CheckBox) findViewById(R.id.disagree);
        if (!ck1.isChecked()) {
            ck1.setChecked(true);
        }
        else if (!ck2.isChecked()){
            ck2.setChecked(true);
        }
    }
}


package company.wfi.com.waitforit;

public class ItemInPlaylist {
    private String id;
    private String url;

    public String getType() {
        return type;
    }

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

    public String getId() {
        return id;
    }

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

    public String getUrl() {
        if(this.getType().equals("1")) {//video
            int videoIdIndex = url.indexOf("?v=");
            return url.substring(videoIdIndex+3);
        }
        else if(this.getType().equals("2")){
            if(!url.contains("http"))
                return "https://" + url;
            else
                return url;
        }
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    private String type;

    public ItemInPlaylist(String id,String url,String type){
        this.id = id;
        this.url = url;
        this.type = type;
    }
}


# Rain Reminder - Weather Forecast

This application is intended to help people to cope with rainy weather.
By sending automatic notifications about harsh weather conditions and things you might need to deal with them.
Like an umbrella, windbreaker or rain boots.

### Features list:
- current weather display
- weather forecast display
- rainy day notifications
- location detection automatic or manual
- customizable notification message and time
- easy notification skip - just swipe the notification to the right or use the stop button when the alarm is triggered
- automatic internet connection loss detection and notification.

### Technology:
- Kotlin
- Clean Architecture
- MVVM
- Coroutines
- Dagger
- Room
- Retrofit
- Glide
- Unit tests

## Screenshots:


package dk.yousee.randy.filters.monitoring;

import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletResponseWrapper;

/**
 * Stop-gap temporary solution until we can switch to Servlet spec 3.0, where
 * the http status code is readily available.
 * @author jablo
 */
public class ServletResponseWithStatus extends HttpServletResponseWrapper {
    private int httpStatus;

    public ServletResponseWithStatus(HttpServletResponse response) {
        super(response);
    }

    @Override
    public void sendError(int sc) throws IOException {
        httpStatus = sc;
        super.sendError(sc);
    }

    @Override
    public void sendError(int sc, String msg) throws IOException {
        httpStatus = sc;
        super.sendError(sc, msg);
    }

    @Override
    public void setStatus(int sc) {
        httpStatus = sc;
        super.setStatus(sc);
    }

    @Override
    public void setStatus(int sc, String sm) {
        httpStatus = sc;
        super.setStatus(sc, sm);
    }

    public int getStatus() {
        return httpStatus;
    }
}


package com.optum.hedis.domain;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.optum.hedis.domain.NumeratorPK;

@Entity
@Table(name="NCQA_NUMERATORS")
public class Numerator implements Serializable {
	private static final long serialVersionUID = 1L;

	@EmbeddedId
	private NumeratorPK id;

	@JsonInclude
	@Column(name="MEASURE_NAME")
	private String measureName;

	@JsonInclude
	@Column(name="RPT_DESCR")
	private String rptDescr;

	@JsonInclude
	@Column(name="DESCR")
	private String descr;

	@JsonInclude
	@Column(name="IS_ACTIVE")
	private Long isActive;

	@Temporal(TemporalType.DATE)
	@JsonInclude
	@Column(name = "CREATE_DT")
	private Date createDt;

	@JsonInclude
	@Column(name="CREATED_BY")
	private String createdBy;

	@JsonInclude
	@Column(name="IS_REPORTABLE")
	private Long isReportable;

	@JsonInclude
	@Column(name="OHM_DESCR")
	private String ohmDescr;
}


# 20questions

# Built With

The system was built using vuejs, while consuming my authentication Api using nodejs

# Getting Started

## Prerequisites

Your system must have npm and node installed, and this can be done on the terminal with

```
- npm install npm@latest -g
```

## Project setup
```
Clone the repo https://github.com/AdemolaAdedoyin/20questions.git
npm install
```

## Usage

NB: The backend is locally hosted but exposed using ngrok. If at any point authentication fails, kindly reach out to me via email, and this will be updated and shared with you

Configs to be passed when trying to start the server

```
VUE_APP_NEW_BASE_URL="THE BACKEND API"
```

To start the server, run this on your terminal
```
VUE_APP_NEW_BASE_URL=value npm start
```

### Compiles and minifies for production
```
npm run build
```

### Lints and fixes files
```
npm run lint
```
# Contact

Kindly reach out if any issue is encountered or token and keys are needed, adedoyinademola397@gmail.com


package com.fisherevans.scs.cache.config;

import com.fisherevans.scs.cache.CacheObject;
import org.bukkit.configuration.ConfigurationSection;

/**
 * Created by h13730 on 11/4/2015.
 */
public class VoteConfig implements CacheObject {
  private static final String YML_TIMEOUT = "timeout";
  private static final String YML_REQUIRED_PERCENTAGE = "required-percentage";

  private Integer _timeout = 60;
  private Double _requiredPercentage = 0.8;

  public Integer getTimeout() {
    return _timeout;
  }

  public Double getRequiredPercentage() {
    return _requiredPercentage;
  }

  @Override
  public void load(ConfigurationSection section) {
    section.set(YML_TIMEOUT, _timeout);
    section.set(YML_REQUIRED_PERCENTAGE, _requiredPercentage);
  }

  @Override
  public void save(ConfigurationSection section) {
    if(section.contains(YML_TIMEOUT))
      _timeout = section.getInt(YML_TIMEOUT);
    if(section.contains(YML_REQUIRED_PERCENTAGE))
      _requiredPercentage = section.getDouble(YML_REQUIRED_PERCENTAGE);
  }
}


package com.indonesia.ridwan.kumpulandoa;

import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageView;

public class About extends AppCompatActivity {

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

        ImageView img = (ImageView) findViewById(R.id.imgabout2);
        img.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Uri uriUrl = Uri.parse("https://www.facebook.com/ridwan.hasanah3?ref componenet=mbasic home header&ref page=%2Fwap%2Fhome.php&refid=7");
                Intent i = new Intent(Intent.ACTION_VIEW,uriUrl);
                startActivity(i);
            }
        });
    }
}


package ua.training.model.entity;

import ua.training.model.entity.dishes.Dish;

import java.util.List;

public class Order {
     private int orderId;
     private Observer client;
     private List<Dish> dishes;

     public Order(Observer client, List<Dish> dishes) {
          this.client = client;
          this.dishes = dishes;
     }

     public int getOrderId() {
          return orderId;
     }

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

     public Observer getClient() {
          return client;
     }

     public void setClient(Observer client) {
          this.client = client;
     }

     public List<Dish> getDishes() {
          return dishes;
     }

     public void setDishes(List<Dish> dishes) {
          this.dishes = dishes;
     }

     @Override
     public String toString() {
          return "Order{" +
                  "orderId=" + orderId +
                  ", client=" + client +
                  ", dishes=" + dishes +
                  '}';
     }
}


package com.library.management.system.validator;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;
import org.springframework.validation.Errors;
import org.springframework.validation.ValidationUtils;
import org.springframework.validation.Validator;

import com.library.management.system.model.User;

@Component
public class UserFormValidator implements Validator {

	@Autowired
	@Qualifier("emailValidator")
	EmailValidator emailValidator;

	@Override
	public boolean supports(Class<?> clazz) {
		return User.class.equals(clazz);
	}

	@Override
	public void validate(Object target, Errors errors) {

		User user = (User) target;

		ValidationUtils.rejectIfEmptyOrWhitespace(errors, "email", "NotEmpty.userForm.email");
		ValidationUtils.rejectIfEmptyOrWhitespace(errors, "password", "NotEmpty.userForm.password");

		if(!emailValidator.valid(user.getEmail())){
			errors.rejectValue("email", "Pattern.userForm.email");
		}

	}

}


package com.adil.pertemuan2.tugas.NO_2;

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

        Binatang supperClass = new Binatang ();

        System.out.println ( "SupperClass" );
        supperClass.Makan ( "Harimau" );
        supperClass.tidur ( "Harimau" );
        System.out.println ();

        System.out.println ( "subClass = 1 " );
        Ikan subClass1 = new Ikan ( "ikan" );
        subClass1.getNama ();
        subClass1.Berenang ();
        subClass1.Makan ( subClass1.nama );
        subClass1.tidur ( subClass1.nama );
        System.out.println ();

        System.out.println ( "subClass = 2 " );
        Burung subClass2 = new Burung ( "burung" );
        subClass2.getNama ();
        subClass2.terbang ();
        subClass2.Makan ( subClass2.nama );
        subClass2.tidur ( subClass2.nama );
        System.out.println ();

        System.out.println ( "subClass = 3 " );
        Kucing subClass3 = new Kucing ( "kucing" );
        subClass3.getNama ();
        subClass3.Meong ();
        subClass3.Makan ( subClass3.nama );
        subClass3.tidur ( subClass3.nama );
    }
}


package edu.temple.mercado_assignment4;

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

import androidx.appcompat.app.AppCompatActivity;

public class DisplayActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.new_activity);
        this.setTitle("Display Activity");

        Intent intent = getIntent();
        String name = intent.getStringExtra(SelectionActivity.NAME);
        String desc = intent.getStringExtra(SelectionActivity.DESC);
        int imgID = intent.getIntExtra(SelectionActivity.IMG, 0);

        TextView nameView = findViewById(R.id.nameView);
        nameView.setText(name);

        TextView descView = findViewById(R.id.descView);
        descView.setText(desc);

        ImageView imgView = findViewById(R.id.riderImg);
        imgView.setImageResource(imgID);

    }
}


package me.bttb.crs.beans.symptom;

import java.util.List;

import javax.persistence.PersistenceException;

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

import me.bttb.crs.model.Symptom;

@Service
@Scope("session")
public class SymptomService {
	@Autowired
	private SymptomDAO dao;
	private Symptom selected;

	public SymptomService() {
	}

	public List<Symptom> getAllSymptoms() {
		return dao.findAllSymptoms();
	}

	public Symptom getSelected() {
		return selected;
	}

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

	public void createNewSymptom() {
		this.selected = new Symptom();
	}

	public boolean save() {
		try {
			if (selected.getId() == 0) {
				dao.addSymptom(selected);
			} else {
				dao.updateSymptom(selected);
			}
			selected = null;
			return true;

		} catch (PersistenceException pe) {
			selected = null;
			return false;
		}
	}

	public void cancel() {
		selected = null;
	}
}


package edu.uam.zstd1.input.adapter;

import java.io.File;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;

import org.apache.tika.config.TikaConfig;
import org.apache.tika.exception.TikaException;
import org.apache.tika.io.TikaInputStream;
import org.apache.tika.metadata.Metadata;
import org.apache.tika.mime.MediaType;

/**
 *
 * @author mmanski
 */
public class ContentTypeDetector {

	private TikaConfig tikaConfig;

	public ContentTypeDetector() {
		try {
			this.tikaConfig = new TikaConfig();
		} catch (TikaException | IOException ex) {
			Logger.getLogger(ContentTypeDetector.class.getName()).log(Level.SEVERE, null, ex);
		}
	}

	public SupportedMediaType getMediaTypeFromFile(File file) {
		Metadata metadata = new Metadata();
		metadata.set(Metadata.RESOURCE_NAME_KEY, file.toString());
		MediaType mediaType = null;
		try {
			mediaType = tikaConfig.getDetector().detect(
					TikaInputStream.get(file.toPath()), metadata);
		} catch (IOException ex) {
			Logger.getLogger(ContentTypeDetector.class.getName()).log(Level.SEVERE, null, ex);
		}
		return SupportedMediaType.of(mediaType);
	}
}


package com.rbac.service.impl;

import com.rbac.dao.RoleManager;
import com.rbac.model.Person;
import com.rbac.model.Role;
import com.rbac.service.RolesService;
import com.rbac.service.UserService;
import lombok.AllArgsConstructor;

import java.util.Set;

@AllArgsConstructor
public class RoleServiceImpl implements RolesService {

    private RoleManager roleManager;
    private UserService userService;
    @Override
    public Role createRole(String roleName) {
        return roleManager.createRole(roleName);
    }

    @Override
    public boolean addUser(String userId, String roleId) {
        Person person = userService.getUser(userId);
        return roleManager.addUser(person,roleId);
    }

    @Override
    public boolean removeUser(String userId, String roleId) {
        Person person = userService.getUser(userId);
        return roleManager.removeUser(person,roleId);
    }

    @Override
    public Set<Role> getRoleForUser(String userId) {
        return roleManager.getRoleForUser(userId);
    }
}


package com.github.phillipkruger.quoteservice;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import javax.ejb.Singleton;
import javax.ejb.Startup;
import javax.ejb.Timeout;
import javax.ejb.Timer;
import javax.ejb.TimerConfig;
import javax.ejb.TimerService;
import javax.inject.Inject;
import org.eclipse.microprofile.config.inject.ConfigProperty;

@Singleton
@Startup
public class QuoteUpdaterTimer {

    @Inject
    private QuoteUpdater updater;

    @Resource
    private TimerService timerService;

    @Inject
    @ConfigProperty(name = "quote.updateFrequency",defaultValue = "3600") // 1 hour
    private int updateFrequency;

    @PostConstruct
    public void init(){
        int timeout = updateFrequency * 1000;
        TimerConfig config = new TimerConfig("Quote Cache update", false);
        updater.update();
        timerService.createIntervalTimer(timeout,timeout, config);
    }

    @Timeout
    public void timeout(Timer timer) {
        updater.update();
    }

}


package com.es.phoneshop.web;

import com.es.phoneshop.service.ProductService;

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 ProductListPageServlet extends HttpServlet {

    private ProductService productService;

    @Override
    public void init() {
        productService = ProductService.getInstance();
    }

    @Override
    protected void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException {
        String search = request.getParameter("search");
        String sort = request.getParameter("sort");
        if (search == null) {
            search = "";
        }
        if (sort == null) {
            sort = "ascDescription";
        }

        request.setAttribute("products", productService.findProducts(search, sort));
        request.getRequestDispatcher("/WEB-INF/pages/productList.jsp").forward(request, response);
    }

}


package main.nini.com.iread.my_util;

/**
 * Created by zyf on 2017/2/12.
 */

public class Constant {
    //搜索的url
    public static String SEARCH_BY_NAME =
            "http://api01pbmp.zhuishushenqi.com/book/auto-complete?query=";

    //模糊搜索的url
    public static String SEARCH_ON_FUZZY =
            "http://api01pbmp.zhuishushenqi.com/book/fuzzy-search?query=";

    public  static String data = "http://api02u58f.zhuishushenqi.com/";

    public static final int FROM_TYPE_SHELF = 0;
    public static final int FROM_TYPE_SEARCH = 1;

    public static String BOOK = "http://chapter2.zhuishushenqi.com/chapter/http://vip.zhuishushenqi.com/chapter/";//+"?cv=1487321257409";
    public static String getGetBookList(String bookId){
        return BOOK + bookId ;
    }
    public static String getTypeFromHasCp(boolean hasCp,String _id){
        if(hasCp){

            return data+"b"+"toc/"+_id+"?view=chapters";
        }
        return data+"mix-a"+"toc/"+_id;
    }

    public static String GET_BTOC_BY_ID(String bookId){
        return "http://api02u58f.zhuishushenqi.com/btoc?view=summary&book="+bookId;
    }

}


package com.example.crudspringbootdynamodb.config;

import org.socialsignin.spring.data.dynamodb.repository.config.EnableDynamoDBRepositories;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.util.StringUtils;

import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.services.dynamodbv2.AmazonDynamoDB;
import com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient;

@Configuration
@EnableDynamoDBRepositories(basePackages = "com.example.crudspringbootdynamodb.dao")
public class DynamoDBConfig {

	@Value("${amazon.dynamodb.endpoint}")
	private String dynamoDBEndPoint;

	@Value("${amazon.aws.accesskey}")
	private String accessKey;

	@Value("${amazon.aws.secretkey}")
	private String secretKey;

	@Bean
	public AmazonDynamoDB amazonDynamoDB() {
		AmazonDynamoDB amazonDynamoDB = new AmazonDynamoDBClient(new BasicAWSCredentials(accessKey, secretKey));
		if (!StringUtils.isEmpty(amazonDynamoDB)){
			amazonDynamoDB.setEndpoint(dynamoDBEndPoint);
		}
		return amazonDynamoDB;
	}

}


package com.comcast.EndToEnd;

import static io.restassured.RestAssured.*;

import java.util.HashMap;

import org.testng.annotations.Test;

import io.restassured.http.ContentType;

public class Create_Project_And_Allocate_User {
	@Test
	public void createProjAndAllocateUser() {
		baseURI = "http://localhost";
		port = 8084;

		//create body
		 HashMap map = new HashMap();
		 map.put("createdBy", "Rini860");
		 map.put("projectName", "airte560");
		 map.put("status", "Completed");
		 map.put("teamSize", 12);
		 // create project
		 given()
		 .contentType(ContentType.JSON)
		 .body(map)
		 .when()
		 .post("/addProject")
		 .then()
		 .log().all();

		 //create body
		HashMap map1 = new HashMap();
		map1.put("designation", "SDET99");
		map1.put("dob", 25/06/1999);
		map1.put("email", "nitesh4@gmail.com");
		map1.put("empName", "nitesh3");
		map1.put("experience", 15);
		map1.put("mobileNo", "9888777657");
		map1.put("project", "abch7");
		map1.put("role", "ROLE_ADMIN");
		map1.put("username", "nitesh2");

		given()
		.contentType(ContentType.JSON)
		.body(map1)
		.when()
		//create empl
		.post("http://localhost:8084/employees")
		.then()
		.log()
		.all()
		.assertThat().statusCode(201);

	}

}


# Amethyst [![Build Status](https://travis-ci.com/LukvonStrom/Amethyst.svg?token=Bzqrz8mA9aTjvxyDQhbr&branch=master)](https://travis-ci.com/LukvonStrom/Amethyst) [![NSP Status](https://nodesecurity.io/orgs/lukas/projects/e46837c8-2457-4f93-8e6f-d85a963de0b1/badge)](https://nodesecurity.io/orgs/lukas/projects/e46837c8-2457-4f93-8e6f-d85a963de0b1)
Amethyst is a simple shop software designed especially for artists.

This Project is based on [node-express-boilerplate](https://github.com/inakianduaga/node-express-boilerplate)

## Suggestions
If you do have any suggestions for this project, just create a new issue which describes your idea. If the implementation is likely, the issue will be added to the project, where it will be implemented.

## Hosting [![Uberspace](http://i.imgur.com/Nm6c5U8.png)](https://uberspace.de/)

I do offer a hosting of this project for you.
This hosting is done via [uberspace](https://uberspace.de/).
If you do want to know the exact pricing, feel free to contact me via Discord.

## Discord
Feel free to join the Discord Server.

[![Discord Invitation](https://discordapp.com/api/guilds/304655534357741578/widget.png?style=banner2)](https://discord.gg/QPT6DeG)


package com.example.logintest;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class Payment_Choice extends AppCompatActivity {

    TextView tv;
    Button btn_paypal,btn_card;

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

        tv = findViewById(R.id.tv_price);
        btn_paypal = findViewById(R.id.btn_paypal_chc);
        btn_card = findViewById(R.id.btn_card_chc);

        tv.setText(Constant.cost + " TK");

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

                Intent i = new Intent(Payment_Choice.this,Paypal.class);
                startActivity(i);

            }
        });
    }
}


package group.zeus.demo.client;

import group.zeus.demo.api.Person;
import group.zeus.rpc.RpcClientConfiguration;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @Author: maodazhan
 * @Date: 2020/12/5 22:25
 */
public class RpcClientBootStrap {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(RpcClientConfiguration.class, ClientApplicationConfiguration.class);
        // 确保销毁资源
        applicationContext.registerShutdownHook();
        WelcomeImpl welcome = applicationContext.getBean(WelcomeImpl.class);
        welcome.welcome(new Person("dazhan", "mao"));
        welcome.welcome("maodazhan");

        // 测试心跳
//        try {
//            Thread.sleep(1000000);
//            welcome.welcome(new Person("dazhan", "mao"));
//            welcome.welcome("maodazhan");
//            Thread.sleep(100000);
//        } catch (Exception ex){
//            //
//        }
    }
}


package com.kevinguanchedarias.owgejava.entity.listener;

import com.kevinguanchedarias.owgejava.business.RequirementInformationBo;
import com.kevinguanchedarias.owgejava.entity.Upgrade;
import com.kevinguanchedarias.owgejava.enumerations.ObjectEnum;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import javax.persistence.PostLoad;

/**
 * @author Kevin Guanche Darias <kevin@kevinguanchedarias.com>
 * @since 0.9.0
 */
@Component
public class UpgradeListener {
    private final RequirementInformationBo requirementInformationBo;

    @Lazy
    public UpgradeListener(RequirementInformationBo requirementInformationBo) {
        this.requirementInformationBo = requirementInformationBo;
    }

    @PostLoad
    @Transactional(propagation = Propagation.REQUIRES_NEW)
    public void loadRequirements(Upgrade upgrade) {
        upgrade.setRequirements(requirementInformationBo.findRequirements(ObjectEnum.UPGRADE, upgrade.getId()));
    }
}


package com.algorithm.longpoll.deferredResult;

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

public class PoolingMessage {

    private String vid;
    private long lastConnectime;
    private Map<String,String> message;

    public PoolingMessage( String vid){
        this(vid,"","");
    }

    public PoolingMessage( String vid, String type, String message){
        this.vid = vid;
        this.lastConnectime = System.currentTimeMillis();
        this.message = new HashMap<>();
        this.message.put( type,message );
    }

    public String getVid() {
        return vid;
    }

    public void setVid( String vid ) {
        this.vid = vid;
    }

    public long getLastConnectime() {
        return lastConnectime;
    }

    public void setLastConnectime( long lastConnectime ) {
        this.lastConnectime = lastConnectime;
    }

    public Map< String, String> getMessage() {
        return message;
    }

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

    public void setMessage( String type,String msg) {
        if(this.message==null){
            this.message = new HashMap<>(  );
        }
        this.message.put( type,msg );
    }

}


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

/**
 * @understands the condition when the config file change failed because it has already been changed by someone else
 */
public class ConfigFileHasChangedException extends RuntimeException {
    public static final String CONFIG_CHANGED_PLEASE_REFRESH = "Configuration file has been modified by someone else.";

    public ConfigFileHasChangedException() {
        super(CONFIG_CHANGED_PLEASE_REFRESH);
    }
}


package com.example.wandermate;

import androidx.room.Entity;
import androidx.room.ForeignKey;

@Entity(foreignKeys = {@ForeignKey(entity = Route.class, parentColumns = "route_id", childColumns = "route_id"),
@ForeignKey(entity = Stop.class, parentColumns = "stop_id", childColumns = "stop_id")},
primaryKeys = {"route_id", "stop_id"})
public class RouteDetails {
    private int route_id;
    private int stop_id;
    private int stop_number;
    private int duration_hrs;
    private int duration_mins;

    public RouteDetails(int route_id, int stop_id, int stop_number, int duration_hrs, int duration_mins) {
        this.route_id = route_id;
        this.stop_id = stop_id;
        this.stop_number = stop_number;
        this.duration_hrs = duration_hrs;
        this.duration_mins = duration_mins;
    }

    public int getRoute_id() {
        return route_id;
    }

    public int getStop_id() {
        return stop_id;
    }

    public int getStop_number() {
        return stop_number;
    }

    public int getDuration_hrs() {
        return duration_hrs;
    }

    public int getDuration_mins() {
        return duration_mins;
    }
}


package com.kball.util;

import android.app.Activity;

import java.util.Stack;

/**
 * Activity管理
 *

 * lizheng -- 15/5/21
 *

 * weici
 */
public class KballActivityManager {
    private static KballActivityManager instance;
    private Stack<Activity> mActivityStack = new Stack<Activity>();

    private KballActivityManager() {

    }

    public static KballActivityManager getInstance() {
        if (null == instance) {
            instance = new KballActivityManager();
        }
        return instance;
    }

    public void addActivity(Activity act) {
        mActivityStack.push(act);
    }

    public void removeActivity(Activity act) {
        mActivityStack.remove(act);
    }

    public void killMyProcess() {
        int nCount = mActivityStack.size();
        for (int i = nCount - 1; i >= 0; i--) {
            Activity activity = mActivityStack.get(i);
            activity.finish();
        }
        mActivityStack.clear();
        // android.os.Process.killProcess(android.os.Process.myPid());
    }
}


package com.shaunhossain.imcomingdear.data.models;

import android.arch.persistence.room.Entity;
import android.arch.persistence.room.Ignore;
import android.arch.persistence.room.PrimaryKey;
import android.support.annotation.NonNull;

/**
 * Created by adriaboschsaez on 19/11/2017.
 */

@Entity(tableName = "messages")
public class Message {

    @PrimaryKey
    @NonNull
    private String time;

    private String text;

    private boolean isMine;

    public void setTime(String time) {
        this.time = time;
    }

    public void setMine(boolean mine) {
        isMine = mine;
    }

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

    public Message() {

    }

    @Ignore
    public Message(String time, boolean isMine, String text) {

        this.time = time;
        this.isMine = isMine;
        this.text = text;
    }

    public boolean getIsMine() {
        return isMine;
    }

    public String getTime() {
        return time;
    }

    public String getText() {

        return text;
    }

}


package br.com.srsolution.agenda.api.dtos.request;

import java.io.Serializable;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

import org.hibernate.validator.constraints.br.CPF;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class ClienteModelInputRequest implements Serializable {

	private static final long serialVersionUID = 1L;

	@Schema(name = "nome", type = "string", format = "string", description = "nome do cliente", required = true, example = "Fulano")
	@NotBlank
	@Size(min = 5, max = 90)
	private String nome;

	@Schema(name = "email", type = "string", format = "string", description = "email do cliente", required = true, example = "email@email.com.br")
	@Email
	@NotBlank
	private String email;

	@Schema(name = "cpf", type = "string", format = "string", description = "CPF do cliente", required = true, example = "000.000.000-00")
	@CPF
	@NotBlank
	private String cpf;

}


package com.lottery.log;

import com.lottery.common.util.HTTPUtil;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

import java.util.Map;

/**
 * Created by fengqinyun on 15/8/25.
 */
public class Tphase {
    public static void main(String[] args) {
        String platyType="1001";
        System.out.println(platyType.endsWith("01"));
       //dd(null);
    }

    public  static void dd( Map<String, String> map){
        String strResult=null;

        try {

            JSONObject paramJson = new JSONObject();
            JSONArray paramJsonArray = new JSONArray();
            paramJsonArray.add("18600758958");
            paramJson.put("type", 2);
            paramJson.put("msg", "注册test");
            paramJson.put("numList", paramJsonArray);
            paramJson.put("clientType", "android");
            String send=paramJson.toString();
            System.out.println(send);
            strResult = HTTPUtil.postJson("http://118.26.65.147/smscenter/send/msg", send);
            System.out.println(strResult);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}


package com.edoardogiacomello.telegrambot.types;

/**
 * This object represents a voice note
 * Created by Edoardo Giacomello <edoardo.giacomello1990@gmail.com> on 31/03/16.
 */
public class Voice implements TelegramData{
    private String fileId;
    private Integer duration;
    private String mimeType; //Optional
    private Integer fileSize; //Optional

    public Voice(String fileId, Integer duration) {
        this.fileId = fileId;
        this.duration = duration;
    }

    public Voice(String fileId, Integer duration, String mimeType, Integer fileSize) {
        this.fileId = fileId;
        this.duration = duration;
        this.mimeType = mimeType;
        this.fileSize = fileSize;
    }

    public String getFileId() {
        return fileId;
    }

    public Integer getDuration() {
        return duration;
    }

    public String getMimeType() {
        return mimeType;
    }

    public Integer getFileSize() {
        return fileSize;
    }

    public void setMimeType(String mimeType) {
        this.mimeType = mimeType;
    }

    public void setFileSize(Integer fileSize) {
        this.fileSize = fileSize;
    }
}


package com.midilabs.dentech.api.service;

import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.EmptyResultDataAccessException;
import org.springframework.stereotype.Service;

import com.midilabs.dentech.api.model.vo.Responsavel;
import com.midilabs.dentech.api.repository.ResponsavelRepository;

@Service
public class ResponsavelService {

	@Autowired
	private ResponsavelRepository responsavelRepository;

	public Responsavel buscarResponsavelPorId(Long id) {
		return responsavelRepository.findById(id).orElseThrow(() -> new EmptyResultDataAccessException(1));
	}

	public Responsavel atualizar(Long id, Responsavel responsavel) {
		Responsavel responsavelSalvo = this.buscarResponsavelPorId(id);
		// --- Copia as propriedades alteradas para as propriedades do objeto pesquisado excluindo o código (id) que já está definido
		BeanUtils.copyProperties(responsavel, responsavelSalvo, "id");
		return responsavelRepository.save(responsavelSalvo);
	}

}


package com.jdbcagent.clientpool.c3p0;

import com.jdbcagent.client.jdbc.JdbcConnection;
import com.jdbcagent.clientpool.ProxyConnection;
import com.mchange.v2.c3p0.impl.NewProxyConnection;

import java.lang.reflect.Field;
import java.sql.Connection;
import java.sql.SQLException;

public class JAC3p0Connection extends ProxyConnection implements Connection {
    public JAC3p0Connection(Connection conn) {
        super(conn);
    }

    @Override
    public void close() throws SQLException {
        JdbcConnection jdbcConn = null;
        if (conn instanceof NewProxyConnection) {
            NewProxyConnection newProxyConn = (NewProxyConnection) conn;
            try {
                Field innerField = NewProxyConnection.class.getDeclaredField("inner");
                innerField.setAccessible(true);
                jdbcConn = (JdbcConnection) innerField.get(newProxyConn);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        conn.close();
        if (jdbcConn != null) {
            jdbcConn.release();
        }

    }
}


package az.itstep.pbs.resource;

import az.itstep.pbs.dto.PaymentRequest;
import az.itstep.pbs.entities.Payment;
import az.itstep.pbs.service.impl.PaymentService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/payments")
@RequiredArgsConstructor
@Slf4j
public class PaymentResource {

    private final PaymentService paymentService;

    @PostMapping
    public ResponseEntity<?> pay(@RequestBody PaymentRequest request) {
        log.info("Incoming payment for subscription: {} with amount {}", request.getSubscriptionNumber(), request.getAmount());
        Payment response = paymentService.pay(request);
        return ResponseEntity.status(HttpStatus.ACCEPTED)
                .contentType(MediaType.APPLICATION_JSON)
                .body(response);
    }

}