blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2
values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 132
values | src_encoding stringclasses 34
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 3 9.45M | extension stringclasses 28
values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 352 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a6108efd6d6a8868db30e7518f81e491968b9ed2 | 349bb12680991950c7686c336046d354d0e21836 | /src/main/java/org/lecture/design/pattern/factory/factorymethod/pizzastore/order/BJOrderPizza.java | fa9e7af14ee57bc6427cbc5c545db50dbf24c1ec | [] | no_license | kusebingtang/DesignPattern_Lecture | 49b89c9de441e25d43179a11fb92e1b4d9b32447 | f14693af54214a4c1f94259ea585e982f733aa81 | refs/heads/master | 2021-05-16T19:13:46.597198 | 2020-04-09T04:51:39 | 2020-04-09T04:51:39 | 250,434,921 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 724 | java | package org.lecture.design.pattern.factory.factorymethod.pizzastore.order;
import org.lecture.design.pattern.factory.factorymethod.pizzastore.pizza.BJCheesePizza;
import org.lecture.design.pattern.factory.factorymethod.pizzastore.pizza.BJPepperPizza;
import org.lecture.design.pattern.factory.factorymethod.pizzastore.pizza.Pizza;
public class BJOrderPizza extends OrderPizza {
@Override
Pizza createPizza(String orderType) {
Pizza pizza = null;
if (orderType.equals("cheese")) {
pizza = new BJCheesePizza();
} else if (orderType.equals("pepper")) {
pizza = new BJPepperPizza();
}
// TODO Auto-generated method stub
return pizza;
}
}
| [
"jb@98game.cn"
] | jb@98game.cn |
bc02d782b2335d2007fa6ec811ad6f5407014746 | fb558f5983cde26b66915f3c8d76ea66b719f419 | /app/src/main/java/ai/extime/Adapters/SelectPositionAdapter.java | 6da011715ab7e2d0b4e8d60baea33929b74459ea | [] | no_license | Vadzka500/extime-andriod-bug_fixes_2 | 8829dd4cc2070c1947ae543efc9aafe9c11935a4 | 70ed603521fd0a48611493c22259aa7e19953940 | refs/heads/master | 2022-12-05T16:35:32.377604 | 2020-09-03T14:20:00 | 2020-09-03T14:20:00 | 292,591,137 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,192 | java | package ai.extime.Adapters;
import android.annotation.SuppressLint;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.List;
import ai.extime.Interfaces.CompanySelectInterface;
import com.extime.R;
/**
* Created by patal on 05.10.2017.
*/
public class SelectPositionAdapter extends RecyclerView.Adapter<SelectPositionAdapter.SelectCompanyViewHolder> {
private View mainView;
private Context context;
private CompanySelectInterface companySelectInterface;
private List<String> listOfPosition = new ArrayList<>();
private EditText fieldForSet;
static class SelectCompanyViewHolder extends RecyclerView.ViewHolder {
TextView hashTagValue;
View card;
SelectCompanyViewHolder(View itemView) {
super(itemView);
card = itemView;
hashTagValue = (TextView) itemView.findViewById(R.id.companyValue);
}
}
public SelectPositionAdapter(List<String> listOfPosition, EditText fieldForSet){
this.listOfPosition = listOfPosition;
this.companySelectInterface = companySelectInterface;
this.fieldForSet = fieldForSet;
}
@Override
public SelectCompanyViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
mainView = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.card_company_select, viewGroup, false);
return new SelectCompanyViewHolder(mainView);
}
@SuppressLint("RecyclerView")
@Override
public void onBindViewHolder(final SelectCompanyViewHolder holder, int position) {
holder.hashTagValue.setText(listOfPosition.get(position));
holder.hashTagValue.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
fieldForSet.setText(listOfPosition.get(position));
}
});
}
@Override
public int getItemCount() {
return listOfPosition.size();
}
}
| [
"Vad-grodno@mail.ru"
] | Vad-grodno@mail.ru |
eaab5e51bb8d80a4def8fb1c7ac1665ce15eae78 | 9b6ba7f8f8c347bf40757dbee26a00bbfc222bf2 | /app/src/test/java/khalilbhijazi/gmail/com/mathcalculator/ExampleUnitTest.java | be215b46d69dacc9602ca924d171a420378233ec | [] | no_license | khalilhijazi/AndroidMathCalculator | 2078372039f034765778c1281147af0f2482c133 | 3502473295fe443fe6e974a7edde564a42f830c5 | refs/heads/master | 2020-03-21T06:19:22.137659 | 2018-06-21T19:46:11 | 2018-06-21T19:46:11 | 138,212,105 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 416 | java | package khalilbhijazi.gmail.com.mathcalculator;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"khalilbhijazi@gmail.com"
] | khalilbhijazi@gmail.com |
cb0ad14a556484697ba3b7935f09e3e3e8865b6c | 4b74bd7ff6c3f5a9d57b1f6012d0b241b24b94fc | /frontend/src/main/java/com/epam/qa/website/WebSite.java | 8b6967090d6b48a40b166489d34593fcfdd759f4 | [] | no_license | Savostytskyi/tc_project | b941049717ce1b554a93b25f37666c1a33e9d7b1 | 1976cd2de92abefea40fddf2ff6ad2ad71a7b46b | refs/heads/master | 2021-05-12T01:03:15.349046 | 2018-01-17T17:23:31 | 2018-01-17T17:23:31 | 117,549,765 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 60 | java | package com.epam.qa.website;
public interface WebSite {
}
| [
"anton_savostytskyi@epam.com"
] | anton_savostytskyi@epam.com |
6db6333e6d7bd431953e939402c54f824ed50f2e | 7057a51363b779f306143cd615c407b17f2279bf | /src/fr/istic/galaxsim/gui/form/IntegerFieldControl.java | db2fe9d03cc2a071e0425dffc6637787f29301a6 | [] | no_license | Unijere/GalaxSim | 5e3dce1bc27574f46c231910f516653fd35762ec | 1781c1effcc066448f15986062ae85020ba68fec | refs/heads/master | 2020-05-30T00:20:29.666254 | 2019-05-30T14:15:31 | 2019-05-30T14:15:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,297 | java | package fr.istic.galaxsim.gui.form;
import fr.istic.galaxsim.gui.ErrorDialog;
import javafx.scene.control.TextField;
import java.util.Optional;
public class IntegerFieldControl extends FieldControl {
private final TextField field;
private Optional<Integer> lowerBound = Optional.empty();
private Optional<Integer> higherBound = Optional.empty();
public IntegerFieldControl(TextField field, String fieldName, boolean required) {
super(fieldName, required);
this.field = field;
// Seuls les chiffres sont acceptes, les autres sont effaces
field.textProperty().addListener((obs, oldValue, newValue) -> {
field.setText(newValue.replaceAll("[^0-9\\-]", ""));
});
}
public IntegerFieldControl(TextField field, String fieldName, boolean required, int lowBound, int hightBound) {
this(field, fieldName, required);
setHigherBound(hightBound);
setLowerBound(lowBound);
}
public int getHigherBound() {
return higherBound.get();
}
public int getLowerBound() {
return lowerBound.get();
}
/**
* Retourne la valeur du champ si celui-ci est rempli
* A utiliser pour les champ non obligatoires
*
* @return La valeur du champ
*/
public Optional<Integer> getOptionalValue() {
try {
int value = getValue();
return Optional.of(value);
} catch(NumberFormatException e) {
return Optional.empty();
}
}
/**
* Recupere la valeur du champ de texte et la convertir en un entier
*
* @throws NumberFormatException si la valeur saisie n'est pas valide
* @return la valeur du champ
*/
public int getValue() {
return Integer.parseInt(field.getText());
}
/**
* Determine si la valeur du champ est bien comprise entre la borne inferieure (inclue)
* et la borne superieure (exclue)
*
* @return true si la valeur est comprise dans l'interval, false sinon
*/
@Override
public boolean isValid() {
if(field.getText().isEmpty() && !required) {
return true;
}
int value;
try {
value = getValue();
} catch(NumberFormatException e) {
ErrorDialog.show("La valeur du champ " + fieldName + " n'est pas valide");
return false;
}
if(lowerBound.isPresent() && value < getLowerBound()) {
ErrorDialog.show("La valeur du champ " + fieldName + " doit etre superieure ou egale a " + getLowerBound());
return false;
}
else if(higherBound.isPresent() && value >= getHigherBound()) {
ErrorDialog.show("La valeur du champ " + fieldName + " doit etre inferieure a " + getHigherBound());
return false;
}
else {
return true;
}
}
public void setHigherBound(int value) {
higherBound = Optional.of(value);
}
public void setLowerBound(int value) {
lowerBound = Optional.of(value);
}
@Override
public void hideError() {
field.getStyleClass().remove("field-error");
}
@Override
public void showError() {
field.getStyleClass().add("field-error");
}
}
| [
"maxime.desmarais1610@gmail.com"
] | maxime.desmarais1610@gmail.com |
36a45d71d2b4a71fdfda76937f481185be1302e9 | aefabe7c745166d18fa335b8d02f4dd9872a8112 | /src/main/java/de/cron3x/cor3/commands/StatusCommand.java | 006be6d6f5a92ff55f217fea1cf5f9275dd8b5f7 | [] | no_license | Cron3x/Cor3-Minecraft-Paper-Plugin | 090fedd336f754b04fa99fe1a992327dc05b5f26 | 58fc4e753163ccb10fa429a01a5374b5592bf354 | refs/heads/main | 2023-06-23T19:18:53.115780 | 2021-07-27T12:50:01 | 2021-07-27T12:50:01 | 376,135,839 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,109 | java | package de.cron3x.cor3.commands;
import de.cron3x.cor3.Cor3;
import net.md_5.bungee.api.ChatColor;
import net.wesjd.anvilgui.AnvilGUI;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.scoreboard.Scoreboard;
import org.bukkit.scoreboard.Team;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.*;
import java.util.function.Consumer;
public class StatusCommand implements TabExecutor, Listener {
/*
*
* TODO:
* register in plugin.yml
* ---------------
* Status Command;
* Select Ui
* ---------------
* with out Argument - open ui
* Menu - (Building) , Admin , Custom -> Anvil , Survival
*
*/
private final String GUI_NAME = "Change Status";
public void openGUI(Player player){
Inventory inventory = Bukkit.createInventory(null, 9*1, GUI_NAME);
ItemStack item = new ItemStack(Material.IRON_SWORD);
ItemMeta itemMeta = item.getItemMeta();
itemMeta.setDisplayName(ChatColor.RESET+"" + ChatColor.WHITE+"Survival");
item.setItemMeta(itemMeta);
inventory.setItem(0, item);
itemMeta.setDisplayName(ChatColor.RESET+"" + ChatColor.WHITE+"Creative");
item.setType(Material.GRASS_BLOCK);
item.setItemMeta(itemMeta);
inventory.setItem(1, item);
itemMeta.setDisplayName(ChatColor.RESET+"" + ChatColor.WHITE+"Custom");
item.setType(Material.NAME_TAG);
item.setItemMeta(itemMeta);
inventory.setItem(8, item);
player.openInventory(inventory);
}
public void openCustomGUI(Player player){
new AnvilGUI.Builder()
.open(player);
}
@EventHandler
public void handleGuiClick(InventoryClickEvent event){
if (!(event.getWhoClicked() instanceof Player)) return;
Player player = (Player) event.getWhoClicked();
if (event.getView().getTitle().equalsIgnoreCase(GUI_NAME)){
if (event.getCurrentItem().getItemMeta() == null) return;
Bukkit.broadcastMessage(event.getCurrentItem().getItemMeta().getDisplayName().substring(1).toLowerCase());
switch (event.getCurrentItem().getItemMeta().getDisplayName().substring(1).toLowerCase()){
case "fsurvival":
Bukkit.broadcastMessage("Survival");
changePrefix(player, "survival", ChatColor.WHITE+"Survival | ");
break;
case "fcreative":
Bukkit.broadcastMessage("Creative");
changePrefix(player, "creative", ChatColor.BLUE+"Creative | ");
break;
case "fcustom":
Bukkit.broadcastMessage("Custom");
event.setCancelled(true);
event.getClickedInventory().close();
openCustomGUI(player);
//open Custom Name Inv (text input)
break;
default:
break;
}
event.setCancelled(true);
event.getClickedInventory().close();
}
}
public void changePrefix(Player player, String name,String prefix){
Scoreboard scoreboard = Bukkit.getScoreboardManager().getMainScoreboard();
Team team = null;
if (scoreboard.getTeam(name) == null) {
scoreboard.registerNewTeam(name);
}
team = scoreboard.getTeam(name);
team.setPrefix(prefix);
team.addPlayer(player);
}
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
if (sender instanceof Player){
Player player = (Player) sender;
if (args.length==0){
openGUI(player);
}
if (args.length==1){
if (args[0].equalsIgnoreCase("admin") && player.isOp()){
Bukkit.broadcastMessage("admin");
}
if (args[0].equalsIgnoreCase("build")){
Bukkit.broadcastMessage("build");
}
if (args[0].equalsIgnoreCase("survival")){
Bukkit.broadcastMessage("survival");
}
if (args[0].equalsIgnoreCase("custom")){
Bukkit.broadcastMessage("custom");
Inventory Inv = Bukkit.createInventory(player, InventoryType.ANVIL, ChatColor.GOLD + "Custom Anvil");
for (int i = 0; i < Inv.getSize(); i++) {
ItemStack air = new ItemStack(Material.AIR,1);
Inv.setItem(i, air);
}
player.openInventory(Inv);
}
if (args[0].equalsIgnoreCase("ui")){
Bukkit.broadcastMessage("ui");
}
}
}
return true;
}
@Override
public @Nullable List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String alias, @NotNull String[] args) {
if (args.length == 1) {
Cor3.getInstance().log("len 3");
ArrayList<String> subcommandsArguments = new ArrayList<>();
subcommandsArguments.add("admin");
subcommandsArguments.add("build");
subcommandsArguments.add("survival");
subcommandsArguments.add("custom");
subcommandsArguments.add("ui");
return subcommandsArguments;
}
return null;
}
} | [
"craipy.exe@gmail.com"
] | craipy.exe@gmail.com |
a891f783d1b4e439f40bcb718d6a2fc8154a123b | b67b01b4c067d9b4f05cf8c8fc73aa7edbcb3926 | /src/main/java/com/sinjee/configs/RedisTemplateConfig.java | 097ef677c52322e36e169538e81b34cc81293b3e | [] | no_license | kweitan/hotsell | a7ada4b4bf0c3704308c6fb665d5ddd9419b4f73 | a943fd68ee829f37a0ac4687be23d010e373720a | refs/heads/master | 2022-05-28T01:54:43.210711 | 2020-03-27T10:38:38 | 2020-03-27T10:38:38 | 227,637,455 | 0 | 0 | null | 2022-05-20T21:18:35 | 2019-12-12T15:26:02 | Java | UTF-8 | Java | false | false | 2,215 | java | package com.sinjee.configs;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.PropertyAccessor;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.GenericToStringSerializer;
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
import org.springframework.data.redis.serializer.StringRedisSerializer;
/**
* @author 小小极客
* 时间 2020/2/22 11:34
* @ClassName RedisTemplateConfig
* 描述 RedisTemplateConfig
**/
@Configuration
public class RedisTemplateConfig {
/**
* 设置 redisTemplate 的序列化设置
* @param redisConnectionFactory
* @return
*/
@Bean
public RedisTemplate<Object, Object> redisTemplate(RedisConnectionFactory redisConnectionFactory) {
// 1.创建 redisTemplate 模版
RedisTemplate<Object, Object> template = new RedisTemplate<>();
// 2.关联 redisConnectionFactory
template.setConnectionFactory(redisConnectionFactory);
Jackson2JsonRedisSerializer jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer(Object.class) ;
ObjectMapper objectMapper = new ObjectMapper() ;
objectMapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY) ;
objectMapper.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
jackson2JsonRedisSerializer.setObjectMapper(objectMapper);
// 3.创建 序列化类
StringRedisSerializer stringRedisSerializer = new StringRedisSerializer() ;
// 6.序列化类,对象映射设置
// 7.设置 value 的转化格式和 key 的转化格式
template.setValueSerializer(jackson2JsonRedisSerializer);
template.setKeySerializer(stringRedisSerializer);
template.setHashKeySerializer(stringRedisSerializer);
template.setValueSerializer(jackson2JsonRedisSerializer);
return template;
}
}
| [
"chen_guixin@163.com"
] | chen_guixin@163.com |
5b7ee728a7f7663aad899dc38b7b9873af8dc180 | ec9c9570082a33a564165bdd6397be1be3466ec1 | /src/main/java/com/serefacet/bigdata/trendtopic/analyzer/filter/condition/impl/PositiveResponseCondition.java | 825565011591e95b2a751313bdc6061e4c317551 | [] | no_license | serefacet/trend-topics | 6bfb696b1abfed74c27b9733adc40a8c5ef9053e | f4a3fbd44e92c94a2b56d9e3472f10f6150a9917 | refs/heads/master | 2020-04-30T23:07:50.336435 | 2019-03-22T12:40:48 | 2019-03-22T12:40:48 | 177,137,007 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 547 | java | package com.serefacet.bigdata.trendtopic.analyzer.filter.condition.impl;
import com.serefacet.bigdata.trendtopic.analyzer.filter.condition.ICondition;
import org.apache.spark.sql.Dataset;
import org.apache.spark.sql.Row;
import static org.apache.spark.sql.functions.col;
/**
* This condition filters the rows which has "yes" response.
*/
public class PositiveResponseCondition implements ICondition<Row> {
@Override
public Dataset<Row> apply(Dataset<Row> input) {
return input.filter(col("response").equalTo("yes"));
}
}
| [
"serefacet@gmail.com"
] | serefacet@gmail.com |
66473db8acc849277bf8c2bbeac8837a883f6dd3 | 35beca9a8466f19678f43a6a9ebe95eec0fb2963 | /src/cn/com/yunqitong/test/SentMessage2Wx.java | 3b6d51613d20cfcee36ac6ef319e4b82ea8783e2 | [] | no_license | chinadx/payServer | 6e938a4dde4584e7e68cbfec0e31106145e6f06d | 00578b4ab7ff43747f94ac950e79896a208447ce | refs/heads/master | 2021-01-16T19:33:12.504564 | 2016-02-01T06:31:56 | 2016-02-01T06:31:56 | 50,765,036 | 0 | 0 | null | 2016-01-31T08:17:12 | 2016-01-31T08:17:12 | null | UTF-8 | Java | false | false | 1,246 | java | package cn.com.yunqitong.test;
import java.util.Iterator;
import java.util.Map;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.Map.Entry;
import org.dom4j.Document;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import org.junit.Test;
public class SentMessage2Wx {
@Test
public void t() {
/*String url = PropertyFactory.getProperty("WXADDR");
TOrderRecord record = new TOrderRecord();
record.setBody("CA");
record.setDetail("不知道");
try {
JAXBContext context = JAXBContext.newInstance(TOrderRecord.class);
Marshaller marshaller = context.createMarshaller();
marshaller.marshal(record, System.out);
// HttpsUtil.doPostXml(url, xml);
} catch (JAXBException e) {
e.printStackTrace();
}*/
}
@Test
public void get() {
SortedMap<Object, Object> parameters = new TreeMap<Object, Object>();
parameters.put("appid", "3434");
parameters.put("mch_id", "344534");
parameters.put("body", "346ghgh34");
parameters.put("nonce_str", "348934");
parameters.put("out_trade_no", "34uii34");
parameters.put("trade_type", "343rtrt4");
parameters.put("notify_url", "34ere34");
parameters.put("total_fee", "34erqewr34");
}
}
| [
"18612045235@163.com"
] | 18612045235@163.com |
e9afa5eda28af4992ede0e1bfbfeb0c03110925f | 7b8c6d11f5c1ccc29213024908e47d3faed134f8 | /src/main/java/com/qa/pages/Search.java | a923285a09b931ed8151ce2f2fe1c8e00fd0b594 | [] | no_license | Bhoomika-123/DemoRepo | 0d050587a62a14af5c23503099894adcdc340386 | 34428dee924ab7c835bf9c2ae465a0dc83f77136 | refs/heads/master | 2022-10-14T06:27:40.794910 | 2020-06-08T17:33:36 | 2020-06-08T17:33:36 | 270,631,301 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 109 | java | package com.qa.pages;
public class Search {
public void search()
{
System.out.println("search");
}
}
| [
"mamorabhoomika2110@gmail.com"
] | mamorabhoomika2110@gmail.com |
9a6844bce4cd266ec36cf5a8a31ea8c38260e5fd | 796091f99376f72e513fb7e221755a0016387a97 | /src/main/java/com/spaceboost/challenge/domain/compound/KeywordAdGroupService.java | 13d07a5d5dae093e35790cdb0dd0b99aac520b28 | [] | no_license | duardito/knowledge-backend-test | 46a2a3cbdee9491c4517f9fd74497ab49f0dfe25 | 81f1e818a7165272662ab64abf3162133aa41906 | refs/heads/master | 2020-05-01T05:39:55.489952 | 2019-03-23T20:09:17 | 2019-03-23T20:09:17 | 177,308,422 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,046 | java | package com.spaceboost.challenge.domain.compound;
import com.spaceboost.challenge.domain.adgroup.AdGroupDto;
import com.spaceboost.challenge.domain.adgroup.IAdGroupService;
import com.spaceboost.challenge.domain.keyword.IKeywordService;
import com.spaceboost.challenge.domain.keyword.KeywordDto;
public class KeywordAdGroupService implements IKeywordAdGroupService {
private final IKeywordService iKeywordService;
private final IAdGroupService iAdGroupService;
public KeywordAdGroupService(IKeywordService iKeywordService, IAdGroupService iAdGroupService) {
this.iKeywordService = iKeywordService;
this.iAdGroupService = iAdGroupService;
}
@Override
public KeywordAdGroupDto getMostCostLessConverted() {
KeywordDto keyword = iKeywordService.getMostCostLessConverted();
AdGroupDto adGroup = iAdGroupService.getMostCostLessConverted();
return new KeywordAdGroupDto.Builder().
adGroup(adGroup).
keyword(keyword).
build();
}
}
| [
"edu@samuris.com"
] | edu@samuris.com |
0ae723ef59787c3ddb6d0a0907c90b0118207ecf | 5e224ff6d555ee74e0fda6dfa9a645fb7de60989 | /database/src/main/java/adila/db/on5xelteins.java | 02524565ca9dbccf599dffb796bceb7d8ff24611 | [
"MIT"
] | permissive | karim/adila | 8b0b6ba56d83f3f29f6354a2964377e6197761c4 | 00f262f6d5352b9d535ae54a2023e4a807449faa | refs/heads/master | 2021-01-18T22:52:51.508129 | 2016-11-13T13:08:04 | 2016-11-13T13:08:04 | 45,054,909 | 3 | 1 | null | null | null | null | UTF-8 | Java | false | false | 234 | java | // This file is automatically generated.
package adila.db;
/*
* Samsung Galaxy J5 Prime
*
* DEVICE: on5xelteins
* MODEL: SM-G570F
*/
final class on5xelteins {
public static final String DATA = "Samsung|Galaxy J5 Prime|";
}
| [
"keldeeb@gmail.com"
] | keldeeb@gmail.com |
00d42659f698374e9aeb777dc0a5992e056a990d | 9386cc87c6c2890bd5f812bf24ba08bcfa363e83 | /src/handling/channel/handler/MovementParse.java | 289da0820ca9cfb0ca5a20c84ae1d42c310937ef | [
"MIT"
] | permissive | deedywu/maple-zeroms | 5820fa466e5954eb557a1914b3001b63666c34e5 | 6760951bca99c041a887e569cba80fb6ba6ab6d9 | refs/heads/master | 2021-09-25T14:51:07.999213 | 2017-11-29T11:27:36 | 2017-11-29T11:27:36 | 255,094,968 | 0 | 1 | null | 2020-04-12T14:03:18 | 2020-04-12T14:03:17 | null | UTF-8 | Java | false | false | 7,723 | java |
package handling.channel.handler;
import java.awt.Point;
import java.util.ArrayList;
import java.util.List;
import server.maps.AnimatedMapleMapObject;
import server.movement.*;
import tools.data.input.SeekableLittleEndianAccessor;
/**
*
* @author zjj
*/
public class MovementParse {
//1 = player, 2 = mob, 3 = pet, 4 = summon, 5 = dragon
/**
*
* @param lea
* @param kind
* @return
*/
public static final List<LifeMovementFragment> parseMovement(final SeekableLittleEndianAccessor lea, int kind) {
final List<LifeMovementFragment> res = new ArrayList<>();
final byte numCommands = lea.readByte();
for (byte i = 0; i < numCommands; i++) {
final byte command = lea.readByte();
switch (command) {
case -1: {
final short xpos = lea.readShort();
final short ypos = lea.readShort();
final short unk = lea.readShort();
final short fh = lea.readShort();
final byte newstate = lea.readByte();
final short duration = lea.readShort();
final BounceMovement bm = new BounceMovement(command, new Point(xpos, ypos), duration, newstate);
bm.setFH(fh);
bm.setUnk(unk);
res.add(bm);
break;
}
case 0: // normal move
case 5:
case 17: // Float
{
final short xpos = lea.readShort();
final short ypos = lea.readShort();
final short xwobble = lea.readShort();
final short ywobble = lea.readShort();
final short unk = lea.readShort();
final byte newstate = lea.readByte();
final short duration = lea.readShort();
final AbsoluteLifeMovement alm = new AbsoluteLifeMovement(command, new Point(xpos, ypos), duration, newstate);
alm.setUnk(unk);
alm.setPixelsPerSecond(new Point(xwobble, ywobble));
// log.trace("Move to {},{} command {} wobble {},{} ? {} state {} duration {}", new Object[] { xpos,
// xpos, command, xwobble, ywobble, newstate, duration });
res.add(alm);
break;
}
case 1:
case 2:
case 6: // fj
case 12:
case 13: // Shot-jump-back thing
case 16: { // Float
final short xmod = lea.readShort();
final short ymod = lea.readShort();
final byte newstate = lea.readByte();
final short duration = lea.readShort();
final RelativeLifeMovement rlm = new RelativeLifeMovement(command, new Point(xmod, ymod), duration, newstate);
res.add(rlm);
// log.trace("Relative move {},{} state {}, duration {}", new Object[] { xmod, ymod, newstate,
// duration });
break;
}
case 3:
case 4: // tele... -.-
case 7: // assaulter
case 8: // assassinate
case 9: // rush
case 14: {
final short xpos = lea.readShort();
final short ypos = lea.readShort();
final short xwobble = lea.readShort();
final short ywobble = lea.readShort();
final byte newstate = lea.readByte();
final TeleportMovement tm = new TeleportMovement(command, new Point(xpos, ypos), newstate);
tm.setPixelsPerSecond(new Point(xwobble, ywobble));
res.add(tm);
break;
}
case 10: // change equip ???
res.add(new ChangeEquipSpecialAwesome(command, lea.readByte()));
break;
case 11: // chair
{
final short xpos = lea.readShort();
final short ypos = lea.readShort();
final short unk = lea.readShort();
final byte newstate = lea.readByte();
final short duration = lea.readShort();
final ChairMovement cm = new ChairMovement(command, new Point(xpos, ypos), duration, newstate);
cm.setUnk(unk);
res.add(cm);
break;
}
case 15: { // Jump Down
final short xpos = lea.readShort();
final short ypos = lea.readShort();
final short xwobble = lea.readShort();
final short ywobble = lea.readShort();
final short unk = lea.readShort();
final short fh = lea.readShort();
final byte newstate = lea.readByte();
final short duration = lea.readShort();
final JumpDownMovement jdm = new JumpDownMovement(command, new Point(xpos, ypos), duration, newstate);
jdm.setUnk(unk);
jdm.setPixelsPerSecond(new Point(xwobble, ywobble));
jdm.setFH(fh);
res.add(jdm);
break;
}
case 20:
case 21:
case 22: {
int unk = lea.readShort();
int newstate = lea.readByte();
final AranMovement acm = new AranMovement(command, new Point(0, 0), unk, newstate);
res.add(acm);
}
/*case 19:
case 20: // Aran Combat Step
case 21: {
final short xmod = lea.readShort();
final short ymod = lea.readShort();
final byte newstate = lea.readByte();
final short duration = lea.readShort();
final AranMovement am = new AranMovement(command, new Point(xmod, ymod), duration, newstate);
res.add(am);
break;
}*/
default:
System.out.println("Kind movement: " + kind + ", Remaining : " + (numCommands - res.size()) + " New type of movement ID : " + command + ", packet : " + lea.toString(true));
return null;
}
}
if (numCommands != res.size()) {
System.out.println("error in movement");
return null; // Probably hack
}
return res;
}
/**
*
* @param movement
* @param target
* @param yoffset
*/
public static final void updatePosition(final List<LifeMovementFragment> movement, final AnimatedMapleMapObject target, final int yoffset) {
for (final LifeMovementFragment move : movement) {
if (move instanceof LifeMovement) {
if (move instanceof AbsoluteLifeMovement) {
Point position = ((LifeMovement) move).getPosition();
position.y += yoffset;
target.setPosition(position);
}
target.setStance(((LifeMovement) move).getNewstate());
}
}
}
}
| [
"zaygeegee@gmail.com"
] | zaygeegee@gmail.com |
7647fb3e5de7bbd79c7d5b6067d72c0203272538 | 1d4b4b0ab7648b33ba7ff4280c235364360c59fc | /jfinal-module/j-web-MVCS/src/main/java/com/jxtpro/controller/UserController.java | 4926fae4b4ba9aa6664ff0937704c70a264a1e35 | [
"Apache-2.0"
] | permissive | duchengying/jfinal_module | 62242879ecd0bdfe7ab67b31eadcc460935ef561 | 8cdfb1d495c2f403b9c19645dccd648b48e14024 | refs/heads/master | 2021-06-10T08:51:32.320107 | 2016-12-29T11:53:07 | 2016-12-29T11:53:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 402 | java | package com.jxtpro.controller;
import com.jfinal.core.Controller;
import com.jfinal.kit.Ret;
import com.jxtpro.service.UserService;
public class UserController extends Controller{
public void index(){
render("view/index.jsp");
}
public void findUser(){
Integer id = getParaToInt("id");
Ret r = UserService.me.findById(id);
setAttr("user", r.getData());
render("view/index.jsp");
}
}
| [
"jxestone@163.com"
] | jxestone@163.com |
e19442d583dbb8eee38414e82b5284d4831aab45 | 5c56fd8a1d812ad3b6998c3e22d53d10061e9d47 | /src/creational/builder/ComplexBuilder.java | 5a3c02c525ef1456ed6e1e6000429670354929a8 | [] | no_license | eplacebo/Patterns | 842820f74ce34d6b69635196eebdb85f97f69ecf | b34737836dcfe0befb61a9a972cf03afa508fc9e | refs/heads/main | 2023-06-01T15:28:35.399093 | 2021-06-11T20:52:59 | 2021-06-11T20:52:59 | 376,139,911 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 315 | java | package creational.builder;
public abstract class ComplexBuilder {
Complex complex;
void createComplex() {
complex = new Complex();
}
abstract void buildName();
abstract void buildPills();
abstract void buildPrice();
Complex getComplex() {
return complex;
}
}
| [
"ef3d88@gmail.com"
] | ef3d88@gmail.com |
ca870de14903becae5e856b505a8ddc882e8ef0b | 4cb47b3ac2f8b999e3e3835588bc5765b132169e | /src/GumballMachineTestDrive.java | bf4f3fa0e2d8d85fb88a895d4f4fb6ccdecf98d8 | [] | no_license | alexhap/DP-11_Proxy | 5cd2ed1be4cb4b70d12c378cc2360e0688c0623f | 2f1b6e3899f0702b9d9e3d8d632ffc749dcc1cc6 | refs/heads/master | 2021-01-19T20:29:46.833030 | 2015-07-02T14:33:59 | 2015-07-02T14:33:59 | 38,159,436 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 958 | java | import java.rmi.Naming;
public class GumballMachineTestDrive {
public static void main(String[] args) {
if (args.length < 2) {
System.out.println("Use: GumballMachineTestDrive <Name> <Count>");
return;
}
GumballMachine gumballMachine;
try {
gumballMachine = new GumballMachine(args[0], Integer.parseInt(args[1]));
Naming.rebind("//" + args[0] + "/gumballMachine", gumballMachine);
System.out.println(gumballMachine);
gumballMachine.insertQuarter();
gumballMachine.turnCrank();
System.out.println(gumballMachine);
gumballMachine.insertQuarter();
gumballMachine.turnCrank();
System.out.println(gumballMachine);
gumballMachine.insertQuarter();
gumballMachine.turnCrank();
System.out.println(gumballMachine);
gumballMachine.refill(10);
gumballMachine.insertQuarter();
gumballMachine.turnCrank();
System.out.println(gumballMachine);
} catch (Exception e) {
e.printStackTrace();
}
}
}
| [
"hap@ukr.net"
] | hap@ukr.net |
bcfc9d19f58f93f55291b649ad27d364c47150f9 | 648e0cfcfd14c086ed2ef61aa06ea606a923df7a | /src/main/java/org/vombel/digitalscoretracker/reader/TeamTeamStructureReader.java | db162e6dc8caee7b6d8a276f7265fd30c77497c2 | [] | no_license | grao666/OPLScoreTracker | ce03567596a831a1627b297fc191eb92c95a8753 | bdda903f8a878ec1374c6d9bd5521bb68324f778 | refs/heads/master | 2020-03-27T22:33:21.877196 | 2018-09-03T19:09:16 | 2018-09-03T19:09:16 | 147,241,092 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 174 | java | package org.vombel.digitalscoretracker.reader;
public class TeamTeamStructureReader {
public static void main(String[] args) {
// TODO Auto-generated method stub
}
}
| [
"ganeshas@oath.com"
] | ganeshas@oath.com |
ab43a47feb902a823bbba27a519193598e515a95 | e5fe07d8470161cb90d45d6848d69e981320e9f7 | /新版红包宠物区块链数字交易所商城原生APP系统/数字交易所安卓/ZTuoExchange_android-master/app/src/main/java/cn/ztuo/customview/CustomViewPager.java | 6dc80223900a508d8966af997200c3439ed44a84 | [] | no_license | kknet/a20200615-6 | 374e0501e544de1a3b8fb5a3f0265925f0158f9d | 487a7756e2e2edfc38504bc843fe1d3c9e76957f | refs/heads/master | 2022-11-05T13:14:53.627973 | 2020-06-16T18:42:14 | 2020-06-16T18:42:14 | 274,289,456 | 0 | 1 | null | 2020-06-23T02:27:26 | 2020-06-23T02:27:25 | null | UTF-8 | Java | false | false | 1,189 | java | package cn.ztuo.customview;
import android.content.Context;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
/**
* Created by Administrator on 2018/6/4 0004.
*/
public class CustomViewPager extends ViewPager {
public CustomViewPager(Context context) {
super(context);
}
public CustomViewPager(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int height = 0;
for (int i = 0; i < getChildCount(); i++) {
View child = getChildAt(i);
child.measure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
int h = child.getMeasuredHeight();
if (h > height) height = h;
}
heightMeasureSpec = MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY);
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
private boolean isSlide = false;
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
return isSlide;
}
}
| [
"2257120854@qq.com"
] | 2257120854@qq.com |
c84eb8e507cab3b1d6b2ea08e468f4d6d49e6f8b | 4659c2c3e7d8f5e85d1b1248134fc9cf802a2a14 | /RTDW-gmall-realtime/src/main/java/com/shangbaishuyao/gmall/realtime/bean/OrderDetail.java | 5bc132e634b80338d79ba0bdef107663189b3a4c | [
"Apache-2.0"
] | permissive | corersky/flink-learning-from-zhisheng | e68dfad1f91196d8cfeaaa0014fce7c55cb66847 | 9765eaee0e2cf49d2a925d8d55ebc069f9bdcda1 | refs/heads/main | 2023-05-14T07:12:49.610363 | 2021-06-06T15:21:17 | 2021-06-06T15:21:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 489 | java | package com.shangbaishuyao.gmall.realtime.bean;
import lombok.Data;
import java.math.BigDecimal;
/**
* Author: 上白书妖
* Date: 2021/2/5
* Desc: 订单明细实体类
*/
@Data
public class OrderDetail {
Long id;
Long order_id ;
Long sku_id;
BigDecimal order_price ;
Long sku_num ;
String sku_name;
String create_time;
BigDecimal split_total_amount;
BigDecimal split_activity_amount;
BigDecimal split_coupon_amount;
Long create_ts;
}
| [
"shangbaishuyao@163.com"
] | shangbaishuyao@163.com |
7e8e59d2f77c0b154dba0cec3c9c0279af46b622 | 3c581eae66e227d511d3f15af4fd3969b3de45b8 | /src/main/java/testgroup/service/parseReplacement/ParseDay.java | b3bb7859d7ae0b55581c966ebaebd22a2c23aea5 | [] | no_license | H7H5/Schedules5 | ab96bc7cd5250bf3364c101e37cc065256831e37 | efbf7b4876e98dabb3c065778532d99d0192551f | refs/heads/master | 2022-12-22T09:04:25.632650 | 2022-02-23T06:49:46 | 2022-02-23T06:49:46 | 196,536,431 | 0 | 1 | null | 2022-12-16T00:35:32 | 2019-07-12T08:03:48 | Java | UTF-8 | Java | false | false | 2,854 | java | package testgroup.service.parseReplacement;
import org.apache.poi.ss.usermodel.Workbook;
import java.io.IOException;
public class ParseDay {
public int sheetInExcel = 0;
private Day day;
private String[] months = {"січня","лютого","березня","квітня","травня","червня",
"липня","серпня","вересня","жовтня","листопада","грудня"};
public void getLastDay(Workbook wb)throws IOException {
Day day1 = getDayDate(wb,0,7);
Day day2 = getDayDate(wb,2,8);
day = getLastDay(day1, day2);
}
private Day getDayDate(Workbook wb, int sheet, int startRow){
String data = SortGroup.getCellText(wb.getSheetAt(sheet).getRow(startRow).getCell(0));
String delimiter = "\"";
String[] subData = data.split(delimiter);
int day = 999;
int monthInt = 999;
int year = 999;
if (subData.length==3){
try {
day = Integer.parseInt(subData[1]);
delimiter = "\\s+";
data = subData[2];
subData = data.split(delimiter);
monthInt = getNumberMonth(subData[1]);
year = Integer.parseInt(subData[2]);
}catch (Exception e){
}
}else if(subData.length==2){
try {
String[] r = subData[0].split("\\D+");
day = Integer.parseInt(String.join("", r));
delimiter = "\\s+";
data = subData[1];
subData = data.split(delimiter);
monthInt = getNumberMonth(subData[1]);
year = Integer.parseInt(subData[2]);
}catch (Exception e){
}
}
return new Day(day,monthInt,year);
}
private int getNumberMonth(String strMonth){
String s = strMonth.toLowerCase();
for (int i = 0; i < months.length; i++) {
if(s.equals(months[i])){
return i+1;
}
}
return 1;
}
private Day getLastDay(Day day1, Day day2){
if(day1.getYear() > day2.getYear()){
sheetInExcel = 0;
return day1;
}else if(day1.getYear() < day2.getYear()){
sheetInExcel = 2;
return day2;
}
if(day1.getMonth() > day2.getMonth()){
sheetInExcel = 0;
return day1;
}else if(day1.getMonth() < day2.getMonth()){
sheetInExcel = 2;
return day2;
}
if(day1.getDay() > day2.getDay()){
sheetInExcel = 0;
return day1;
}else if(day1.getDay() < day2.getDay()){
sheetInExcel = 2;
return day2;
}
return day1;
}
public Day getDay() {
return day;
}
}
| [
"Serdyk87@ukr.net"
] | Serdyk87@ukr.net |
060858b625012c427023856ff26c40f3e7902d80 | 803167358b6ddee43912401f89d8c07eabf5e12d | /src/Practice/Arrays/TicTacToe/TicTacToe.java | 98a54e7b4ada7616550d571141fec4963c2f8d9d | [] | no_license | SushmaSrimathtirumala/GeeksForGeeks | 7510c5d9c71c281b0957fda641abf164290a5229 | 7712707a414b10a553b3fcdbbb9757f259ca6143 | refs/heads/master | 2020-05-02T12:39:03.889681 | 2017-05-04T16:04:43 | 2018-05-04T04:03:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,495 | java | package Practice.Arrays.TicTacToe;
import java.util.Scanner;
/**
* Created by gakshintala on 6/14/16.
*/
public class TicTacToe {
// This matrix is used to find indexes to check all
// possible wining triplets in board[0..8]
private static int WIN[][] = {{0, 1, 2}, // Check first row.
{3, 4, 5}, // Check second Row
{6, 7, 8}, // Check third Row
{0, 3, 6}, // Check first column
{1, 4, 7}, // Check second Column
{2, 5, 8}, // Check third Column
{0, 4, 8}, // Check first Diagonal
{2, 4, 6}}; // Check second Diagonal
public static void main(String[] args) {
Scanner scn = new Scanner(System.in);
int tests = scn.nextInt();
while (tests-- > 0) {
char[] board = new char[9];
fillArray(board, scn);
System.out.println(isBoardValid(board) ? "Valid" : "Invalid");
}
}
private static void fillArray(char[] arr, Scanner scn) {
for (int i = 0; i < arr.length; i++) {
arr[i] = scn.next().charAt(0);
}
}
private static boolean isBoardValid(char[] board) {
int xCount = findCount(board, 'X');
int oCount = findCount(board, 'O');
// Valid only if count is equal or x is +1 ahead of o
if (xCount == oCount || xCount == oCount + 1) {
if (isWinning(board, 'O')) {
// false if both are winning
if (isWinning(board, 'X')) {
return false;
}
// If O is winning, count should be equal
return (xCount == oCount);
}
// If X is winning, it should be 1 ahead
if (isWinning(board, 'X') && (xCount != oCount + 1)) {
return false;
}
return true;
}
return false;
}
private static boolean isWinning(char[] board, char c) {
// Checking winning combination, by row by row in WIN array
for (int i = 0; i < 8; i++) {
if (board[WIN[i][0]] == c
&& board[WIN[i][1]] == c
&& board[WIN[i][2]] == c) {
return true;
}
}
return false;
}
private static int findCount(char[] board, char x) {
int count = 0;
for (char c : board) {
if (c == x) {
count++;
}
}
return count;
}
}
| [
"gopalakshintala@gmail.com"
] | gopalakshintala@gmail.com |
802aa4fa9b076260c0fc012150c2bd473171b076 | 660020c00ddb414ded5523ab93ebefffaacabfd4 | /SDK/src/main/java/com/qiyei/sdk/server/core/CoreWakeUpService.java | 906bd016e6121dc6b3b087270054819a1fe1f15e | [] | no_license | 1296695625/EssayJoke | 202fe93f539745334ea9f67b36a9f3971f66bf02 | bcb7da2e79d2506006d71f44c75564576d32e2c4 | refs/heads/master | 2020-04-09T06:50:25.325200 | 2018-11-23T03:40:24 | 2018-11-23T03:40:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,395 | java | package com.qiyei.sdk.server.core;
import android.annotation.TargetApi;
import android.app.Notification;
import android.app.job.JobInfo;
import android.app.job.JobParameters;
import android.app.job.JobScheduler;
import android.app.job.JobService;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import com.qiyei.sdk.common.RuntimeEnv;
import com.qiyei.sdk.log.LogManager;
import static com.qiyei.sdk.common.RuntimeEnv.serviceAlive;
/**
* Email: 1273482124@qq.com
* Created by qiyei2015 on 2017/6/23.
* Version: 1.0
* Description:
*/
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public class CoreWakeUpService extends JobService {
private static final String TAG = CoreWakeUpService.class.getSimpleName();
private final int jobWakeUpId = 1;
@Override
public void onCreate() {
super.onCreate();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){
LogManager.i(TAG,"startForeground");
startForeground(1,new Notification());
}
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
JobInfo.Builder builder = new JobInfo.Builder(jobWakeUpId,
new ComponentName(this,CoreWakeUpService.class));
builder.setPeriodic(1000); //1秒
JobScheduler jobScheduler = (JobScheduler) getSystemService(Context.JOB_SCHEDULER_SERVICE);
jobScheduler.schedule(builder.build());
return START_STICKY;
}
@Override
public boolean onStartJob(JobParameters params) {
// 开启定时任务,定时轮寻 , 看MessageService有没有被杀死
// 如果杀死了启动 轮寻onStartJob
// 判断服务有没有在运行
boolean alive = RuntimeEnv.serviceAlive(CoreService.class.getName());
if(!alive){
//startService Android 8.0以上不支持启动在后台的service
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.N_MR1){
startForegroundService(new Intent(this,CoreService.class));
}else {
startService(new Intent(this,CoreService.class));
}
LogManager.i(TAG,"startService CoreService");
}
return false;
}
@Override
public boolean onStopJob(JobParameters params) {
return false;
}
}
| [
"1273482124@qq.com"
] | 1273482124@qq.com |
f544e07935b38f6dede4fb0e71d5e12b23747507 | 5a18bb53f3b30985d72d0ad0de8bb83cf806ab2a | /src/main/java/edu/virginia/lib/fedora/eadingest/ImportDigitizedItems.java | f6c0d20f58b1e20638f8c56bdbc825844b8620aa | [] | no_license | mikedurbin/eadingest | 08ad6adec3ce026b55cc747e349313aae2a5e076 | 8f429256f31b9a41d4e0a77f81ae161a501336ab | refs/heads/master | 2021-01-10T21:32:23.514551 | 2013-02-19T15:47:50 | 2013-02-19T15:47:50 | 5,126,176 | 0 | 0 | null | 2020-10-12T22:36:49 | 2012-07-20T17:32:28 | Java | UTF-8 | Java | false | false | 6,902 | java | package edu.virginia.lib.fedora.eadingest;
import java.io.IOException;
import java.util.List;
import java.util.Properties;
import org.apache.commons.io.IOUtils;
import org.apache.commons.io.output.ByteArrayOutputStream;
import com.yourmediashelf.fedora.client.FedoraClient;
import com.yourmediashelf.fedora.client.FedoraClientException;
import com.yourmediashelf.fedora.client.FedoraCredentials;
/**
* A simple utility to import digitized items from one repository
* to another. This utility is incomplete and untested.
*/
public class ImportDigitizedItems {
public static void main(String args[]) throws Exception {
System.out.println("ImportDigitizedItems");
Properties prodP = new Properties();
prodP.load(ImportDigitizedItems.class.getClassLoader().getResourceAsStream("config/fedora-production.properties"));
FedoraClient source = new FedoraClient(new FedoraCredentials(prodP.getProperty("fedora-url"), prodP.getProperty("fedora-username"), prodP.getProperty("fedora-password")));
Properties testP = new Properties();
testP.load(ImportDigitizedItems.class.getClassLoader().getResourceAsStream("config/fedora-test.properties"));
FedoraClient dest = new FedoraClient(new FedoraCredentials(testP.getProperty("fedora-url"), testP.getProperty("fedora-username"), testP.getProperty("fedora-password")));
Properties p = new Properties();
p.load(ImportDigitizedItems.class.getClassLoader().getResourceAsStream("config/ontology.properties"));
EADOntology o = new EADOntology(p);
/*
* TODO: this all works on the test environment, but should
* be parameterized if this class or program will ever be used
* more generally.
*/
int count = 1;
boolean stealIdentity = false;
String sourceCollection = "uva-lib:744806";
String destinationCollection = "uva-lib-test:4556";
String sourcePredicate = "http://fedora.lib.virginia.edu/relationships#hasCatalogRecordIn";
List<String> pids = EADIngest.getSubjects(source, sourceCollection, sourcePredicate);
System.out.println(prodP.getProperty("fedora-url"));
System.out.println(" " + sourceCollection + ": " + pids.size() + " items found");
for (int i = 0; i < pids.size() && i < count; i ++) {
String pid = pids.get(i);
System.out.println(" " + pid);
copyObjectAndUpdateRelationship(source, dest, pid, sourcePredicate, sourceCollection, o, destinationCollection, stealIdentity);
}
}
/**
* Copies an object from one repository to another then creates a "logical-item" object
* in the new repository that references that copied item within the context of an
* archival collection in the new repository.
*
* @param source the repository from which the object will be copied
* @param dest the repository to which the object will be copied
* @param subjectPid the pid of the object to be copied
* @param oldPredicateUri (not currently used)
* @param oldObjectPid (not currently used)
* @param o the ontology for the new repository
* @param newObjectPid the pid of the parent (series, collection, whatever)
* for the archival collection context into which we are importing the
* object
* @param stealIdentity if true, when copying over the object, the logical
* object that's created will take the pid of the original object and
* the otherwise-exact copy of the original object will have a new pid.
*/
public static void copyObjectAndUpdateRelationship(FedoraClient source, FedoraClient dest, String subjectPid, String oldPredicateUri, String oldObjectPid, EADOntology o, String newObjectPid, boolean stealIdentity) throws Exception {
String logicalItemPid = null;
if (stealIdentity) {
logicalItemPid = subjectPid;
String newSubjectPid = FedoraClient.getNextPID().execute(dest).getPid();
copyObject(subjectPid, source, dest, false, newSubjectPid);
subjectPid = newSubjectPid;
} else {
copyObject(subjectPid, source, dest, false, null);
}
logicalItemPid = logicalItemPid != null
? FedoraClient.ingest(logicalItemPid).execute(dest).getPid()
: FedoraClient.ingest().execute(dest).getPid();
FedoraClient.addRelationship(logicalItemPid).predicate(EADOntology.HAS_MODEL_PREDICATE).object("info:fedora/" + o.eadItemCModel()).execute(dest);
FedoraClient.addRelationship(logicalItemPid).predicate(EADOntology.HAS_MODEL_PREDICATE).object("info:fedora/" + o.metadataPlaceholderCmodel()).execute(dest);
FedoraClient.addRelationship(logicalItemPid).predicate(o.getRelationship(EADOntology.Relationship.IS_PART_OF)).object("info:fedora/" + newObjectPid).execute(dest);
FedoraClient.addRelationship(logicalItemPid).predicate(o.getRelationship(EADOntology.Relationship.IS_METADATA_PLACEHOLDER_FOR)).object("info:fedora/" + subjectPid).execute(dest);
System.out.println(logicalItemPid + " --> " + subjectPid);
// TODO: add the "follows" relationship
// We don't actually want to monkey with the existing object
//FedoraClient.purgeRelationship(subjectPid).predicate(oldPredicateUri).object("info:fedora/" + oldObjectPid).execute(dest);
//FedoraClient.addRelationship(subjectPid).predicate(newPredicateUri).object("info:fedora/" + newObjectPid).execute(dest);
}
public static void copyObject(String pid, FedoraClient source, FedoraClient dest, boolean overwrite, String newPid) throws IOException, FedoraClientException {
if (!(FedoraClient.findObjects().pid().query("pid=" + pid).execute(dest).getPids().size() == 0 || overwrite)) {
System.out.println("Skipping " + pid + " because it already exists.");
} else {
System.out.print("Copying " + pid + "...");
ByteArrayOutputStream baos = new ByteArrayOutputStream();
IOUtils.copy(FedoraClient.export(pid).context("archive").execute(source).getEntityInputStream(), baos);
if (newPid != null) {
// replace the pid: this doesn't work if the
// RELS-EXT or RELS-INT datastreams aren't using the
// X control group.
FedoraClient.ingest().content(baos.toString("UTF-8").replace(pid, newPid).replaceAll("\\Q<foxml:contentDigest\\E[^>]*\\Q/>\\E", "").replaceAll("(?s)\\Q<foxml:datastream ID=\"RELS-INT\"\\E.*?\\Q</foxml:datastream>\\E", "")).execute(dest);
} else {
FedoraClient.ingest().content(baos.toString("UTF-8")).execute(dest);
}
System.out.println("DONE");
}
}
}
| [
"md5wz@md5wz.lib.virginia.edu"
] | md5wz@md5wz.lib.virginia.edu |
0c414bfcdd44f86d043ac34d4a57baad576ead0c | 7688d12de179ba4b76f2df5a076c5444b0460675 | /src/main/java/com/leetcode/p_dp/Solution309.java | 40cf9c92c2c390d122db877bd545ea42f5a63215 | [] | no_license | yanisdxw/algtest | 5fee7ea7b7d9665004ec275addc29b1c9123f45d | 62f7fe02b7df9f9a73a36c710cf2df800131673f | refs/heads/master | 2023-03-07T16:40:18.341049 | 2023-02-28T14:45:13 | 2023-02-28T14:45:13 | 186,846,256 | 0 | 1 | null | 2022-11-16T08:58:39 | 2019-05-15T14:43:19 | Java | UTF-8 | Java | false | false | 1,858 | java | package com.leetcode.p_dp;
/**
* 给定一个整数数组,其中第 i 个元素代表了第 i 天的股票价格 。
*
* 设计一个算法计算出最大利润。在满足以下约束条件下,你可以尽可能地完成更多的交易(多次买卖一支股票):
*
* 你不能同时参与多笔交易(你必须在再次购买前出售掉之前的股票)。
* 卖出股票后,你无法在第二天买入股票 (即冷冻期为 1 天)。
* 示例:
*
* 输入: [1,2,3,0,2]
* 输出: 3
* 解释: 对应的交易状态为: [买入, 卖出, 冷冻期, 买入, 卖出]
*
* 来源:力扣(LeetCode)
* 链接:https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock-with-cooldown
* 著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。
*/
public class Solution309 {
public int maxProfit(int[] prices) {
if(prices.length==0){
return 0;
}
int n = prices.length;
int[][] dp = new int[prices.length][3];
dp[0][0] = -prices[0]; dp[0][1] = 0; dp[0][2] = 0;
// dp[i][0]: 第i天之后,手上持有股票的最大收益
// dp[i][1]: 第i天之后,手上不持有股票,并且处于冷冻期中的累计最大收益
// dp[i][2]: 第i天之后,手上不持有股票,并且不在冷冻期中的累计最大收益
for (int i = 1; i < prices.length; i++) {
dp[i][0] = Math.max(dp[i-1][0], dp[i-1][2]-prices[i]);
dp[i][1] = dp[i][0] + prices[i];
dp[i][2] = Math.max(dp[i-1][2], dp[i-1][1]);
}
return Math.max(dp[n-1][1],dp[n-1][2]);
}
public static void main(String[] args) {
int[] prices = new int[]{1,2,3,0,2};
int ans = new Solution309().maxProfit(prices);
System.out.println(ans);
}
}
| [
"dengxw@rd.netease.com"
] | dengxw@rd.netease.com |
8cf3574a7954234ac80b3a62b60e82c15f2c074f | 5ebfdb90bcc0c56ca6d987f5b673087c7afa19b8 | /tuikit1/src/main/java/com/tencent/qcloud/tim/uikit/modules/conversation/ConversationLayout.java | 5ce5f8c9d083873c623b310488fa8d043b95e0a6 | [
"Apache-2.0"
] | permissive | JewSaten/360VRShop | 4570e2c72296709aea9d593050c738cbc10d2266 | d89d09ef5a2bf3a20885ce8249b3e807e0d2d91a | refs/heads/master | 2020-09-20T09:52:18.887806 | 2019-11-27T13:55:23 | 2019-11-27T13:55:23 | 224,424,898 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,366 | java | package com.tencent.qcloud.tim.uikit.modules.conversation;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.RelativeLayout;
import com.tencent.qcloud.tim.uikit.R;
import com.tencent.qcloud.tim.uikit.base.IUIKitCallBack;
import com.tencent.qcloud.tim.uikit.component.TitleBarLayout;
import com.tencent.qcloud.tim.uikit.modules.conversation.base.ConversationInfo;
import com.tencent.qcloud.tim.uikit.modules.conversation.interfaces.IConversationAdapter;
import com.tencent.qcloud.tim.uikit.modules.conversation.interfaces.IConversationLayout;
import com.tencent.qcloud.tim.uikit.utils.ToastUtil;
public class ConversationLayout extends RelativeLayout implements IConversationLayout {
private TitleBarLayout mTitleBarLayout;
private ConversationListLayout mConversationList;
public ConversationLayout(Context context) {
super(context);
init();
}
public ConversationLayout(Context context, AttributeSet attrs) {
super(context, attrs);
init();
}
public ConversationLayout(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init();
}
/**
* 初始化相关UI元素
*/
private void init() {
inflate(getContext(), R.layout.conversation_layout, this);
mTitleBarLayout = findViewById(R.id.conversation_title);
mConversationList = findViewById(R.id.conversation_list);
}
public void initDefault() {
mTitleBarLayout.setTitle(getResources().getString(R.string.conversation_title), TitleBarLayout.POSITION.MIDDLE);
mTitleBarLayout.getLeftGroup().setVisibility(View.GONE);
mTitleBarLayout.setRightIcon(R.drawable.conversation_more);
final IConversationAdapter adapter = new ConversationListAdapter();
mConversationList.setAdapter(adapter);
ConversationManagerKit.getInstance().loadConversation(new IUIKitCallBack() {
@Override
public void onSuccess(Object data) {
adapter.setDataProvider((ConversationProvider) data);
}
@Override
public void onError(String module, int errCode, String errMsg) {
ToastUtil.toastLongMessage("加载消息失败");
}
});
}
public TitleBarLayout getTitleBar() {
return mTitleBarLayout;
}
@Override
public void setParentLayout(Object parent) {
}
@Override
public ConversationListLayout getConversationList() {
return mConversationList;
}
public void addConversationInfo(int position, ConversationInfo info) {
mConversationList.getAdapter().addItem(position, info);
}
public void removeConversationInfo(int position) {
mConversationList.getAdapter().removeItem(position);
}
@Override
public void setConversationTop(int position, ConversationInfo conversation) {
ConversationManagerKit.getInstance().setConversationTop(position, conversation);
}
@Override
public void deleteConversation(int position, ConversationInfo conversation) {
ConversationManagerKit.getInstance().deleteConversation(position, conversation);
}
}
| [
"satenjew@gmail.com"
] | satenjew@gmail.com |
5c8998cd14f55659ac34dc834e4b7ee3f76fe224 | ca87e087d458ef102f4d587d42888f527865bfa8 | /app/src/main/java/gt/utils/log/mobilelogcat/common/LogFactory.java | 30bb9f0de42ee8d09936d7b2e35498bfa5ae20b2 | [] | no_license | pouloghost/MobileLogCat | 4865cda350fb8387c6a2c92f7c54754f74625bf7 | ac1e7159b424683088792f2f015949f26b70eedf | refs/heads/master | 2016-09-05T10:52:13.939052 | 2015-07-31T07:23:17 | 2015-07-31T07:23:17 | 38,429,282 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,922 | java | package gt.utils.log.mobilelogcat.common;
import android.util.Log;
import java.text.SimpleDateFormat;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* Created by ghost on 2015/7/3.
*/
public class LogFactory {
private static final Pattern sPATTERN = Pattern.compile("([0-9\\-:\\.\\s]+?)\\s*([VDIWEFS]{1})\\s*/\\s*([^\\(]*)\\(\\s*([^\\)]*)\\s*\\)\\s*:\\s*(.*)", Pattern.DOTALL);
private static final SimpleDateFormat sFORMAT = new SimpleDateFormat("MM-dd hh:mm:ss.SSS");
private static final int sPARTS = 5;
private static LogModel sLastLog;
public static LogModel onNewLine(String log) {
Matcher matcher = sPATTERN.matcher(log);
LogModel model = null;
boolean shouldReturn = true;
if (matcher.find()) {
if (sPARTS == matcher.groupCount()) {
model = new LogModel();
try {
model.timestamp = sFORMAT.parse(matcher.group(1)).getTime();
model.logLevel = matcher.group(2);
model.tag = matcher.group(3);
model.process = Integer.parseInt(matcher.group(4));
model.content = matcher.group(5);
if (null != sLastLog && model.timestamp == sLastLog.timestamp && !sLastLog.content.equals(matcher.groupCount())) {
sLastLog.content = sLastLog.content + "\n" + model.content;
model = null;
}
} catch (Exception e) {
Log.e("LogCatManager", e.getMessage());
}
}
} else {
if (!log.startsWith("----") && null != sLastLog) {
sLastLog.content += log;
}
}
if (null != model) {
LogModel tmp = sLastLog;
sLastLog = model;
return tmp;
}
return null;
}
}
| [
"864984007@qq.com"
] | 864984007@qq.com |
5943e0b25ebe7d37d6ba5ea5612700693004d10e | 45d79816326381fef81a1f5ef852b6a9f9610b92 | /sso-client-demo/sso-client-shiro-demo/src/main/java/com/toceansoft/cas/shiro/client/demo/confg/ClientConfiguration.java | fd7b4c3c1e918b86fa6041132ed23c23329c0db0 | [
"MIT"
] | permissive | pologood/toceansoft-cas | 8a26c412fa42a6dc266f85e6158087da6ce1317b | 3de98181b68ab971d222bd89502ab516f5e51f92 | refs/heads/master | 2021-01-06T14:15:03.870538 | 2018-11-06T11:38:53 | 2018-11-06T11:38:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,675 | java | /*
* 版权所有.(c)2010-2018. 拓胜科技
*/
package com.toceansoft.cas.shiro.client.demo.confg;
import com.toceansoft.cas.shiro.client.demo.confg.pros.GithubProperties;
import com.toceansoft.cas.shiro.client.demo.core.ClientStrategy;
import com.toceansoft.cas.shiro.client.demo.core.ClientStrategyFactory;
import com.toceansoft.cas.shiro.client.demo.core.PrincipalBindResolver;
import com.toceansoft.cas.shiro.client.demo.core.github.GitHubClientStrategy;
import com.toceansoft.cas.shiro.client.demo.core.github.GitHubMemoryPrincipalBindResolver;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import java.util.HashMap;
import java.util.Map;
/**
* @author Narci.Lee
* @date 2018/10/8
* @since 1.0.0
*/
@Configuration
@Profile("dev")
public class ClientConfiguration {
@Autowired
private GithubProperties properties;
@Bean
protected ClientStrategyFactory clientStrategyFactory() {
Map<String, ClientStrategy> clientStrategyMap = new HashMap<>();
GitHubClientStrategy clientStrategy = new GitHubClientStrategy(bindResolver());
clientStrategyMap.put(clientStrategy.name(), clientStrategy);
return new ClientStrategyFactory(clientStrategyMap);
}
/**
* 绑定用户取决器
* @return
*/
@Bean
protected PrincipalBindResolver bindResolver() {
GitHubMemoryPrincipalBindResolver gitHubBinder = new GitHubMemoryPrincipalBindResolver(properties.getBindId());
return gitHubBinder;
}
}
| [
"narci.ltc@toceansoft.com"
] | narci.ltc@toceansoft.com |
7f9cec18669971ae280abcce6aa376904b58ef93 | 5af5d4d7ea17f4adc526413052155f1fb79da7c5 | /src/MasinaTestAudi.java | 9b0b2916e987f5cccdd421c3bfbf42843ee62580 | [] | no_license | andreeaprus/SQMProject | fd9b40ea9caf28369845fd274c38b7ea98252c5a | 2b959fc1cdd1a195862da67b00b817a4c3843bd5 | refs/heads/master | 2020-12-14T12:09:57.464167 | 2020-01-19T14:56:29 | 2020-01-19T14:56:29 | 234,736,590 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,216 | java | import org.junit.Assert;
import org.junit.jupiter.api.Test;
class MasinaTestAudi {
@Test
public void testSetModel(){
String expectedModel = "Audi";
Masina masina = new Masina("Audi", 70000d);
masina.setModel(expectedModel);
Assert.assertEquals(masina.getModel(),expectedModel);
}
@Test
public void testConstructor(){
String expected = "Audi";
double expP = 70000d;
double delta = 0.17;
Masina masina = new Masina (expected,expP);
Assert.assertEquals(masina.getModel(),expected);
Assert.assertEquals(masina.getPret(),expP, delta);
}
@Test
public void testConstructorCrossCheck(){
String expected = "Audi";
double expP = 70000d;
double delta = 0.17;
Masina masina1 = new Masina (expected,expP);
Masina masina2 = new Masina ();
masina2.setModel(expected);
masina2.setPret(expP);
Assert.assertEquals(masina1.getModel(),expected);
Assert.assertEquals(masina2.getPret(),expP, delta);
Assert.assertEquals(masina1.getModel(),masina2.getModel());
Assert.assertEquals(masina1.getPret(),masina2.getPret(), delta);
}
}
| [
"andreeaprus@gmail.com"
] | andreeaprus@gmail.com |
8b9d9c37c506c8500980615bad9a168c52e91ea5 | d6975c7340f2eb05ead754d08fc839c0712e7101 | /08-object/src/com/itutry/test/TernaryTest.java | 50f3052b0edf28916f4f54758e48fce981ec9876 | [] | no_license | china-university-mooc/Java-Basics-Atguigu | 5da9d1d9512b2ac8b431a2f241eabd4ad9edd60c | 40d28ce5d421dee46de7d80e16a840bddc4b6b7a | refs/heads/master | 2021-05-17T21:23:42.095525 | 2020-07-05T11:55:51 | 2020-07-05T11:55:51 | 250,959,175 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 344 | java | package com.itutry.test;
import org.junit.Test;
public class TernaryTest {
@Test
public void test1() {
Object o1 = true ? new Integer(1) : new Double(2.0);
System.out.println(o1);
}
@Test
public void test2() {
Object o2;
if (true) {
o2 = new Integer(1);
} else {
o2 = new Double(2.0);
}
System.out.println();
}
}
| [
"zhaozhang@thoughtworks.com"
] | zhaozhang@thoughtworks.com |
ae37b20f7f850b0e55e15aa038ea7af8481bce5c | 9175da4fa386abd1922d5e5a187dfd86a7923984 | /src/main/java/com/affordability/scripts/OrangeBus_TC037.java | 9c2b5319f7e2851693f81fa6b773e21b52c95c65 | [] | no_license | SubbaCigniti/Affordability | 934f9abbd052527d4de617ec2b452f221213b281 | 5bacd033391c196bd4051b695bb2830c0f281df2 | refs/heads/master | 2021-04-12T07:17:37.231217 | 2017-06-16T05:47:17 | 2017-06-16T05:47:17 | 94,507,124 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,370 | java | package com.affordability.scripts;
import org.testng.Assert;
import org.testng.annotations.Test;
import com.affordability.workflows.OrangeBusBusinessFunctions;
import com.pageobject.OrangePO;
import com.testdata.MSODMTestData;
import com.testdata.OrangeBusTestData;
public class OrangeBus_TC037 extends OrangeBusBusinessFunctions {
@Test
public void OrangeBusTC037() throws Throwable {
child = extent.startTest("OrangeBus", "Verification");
iterationReport(1, "OrangeBus Test Case 037" + " Started");
launchApplication(OrangeBusTestData.ORANGEBUSURL);
setPropertyAndLoanValues("TC037");
clickYesApplicant1("TC037");
setemployment_statusApplicant1("TC037");
setLastFullTradingYearsNetProfit_1("TC037");
setPreviousFullTradingYearsNetProfit_1("TC037");
clickDetailedOption_exp();
setcommitted_Expenditure_Personal_loans_or_Hire_purchaseApp1("TC037");
setcomittedExp_CC_Monthlypayment("TC037");
ClickDetailedOption_hh();
setproperty_expenditure("TC037");
setGroundRentOrService("TC037");
setUtilities("TC037");
clickDetailedOption_oth();
setSchoolFees("TC037");
setHouseKeeping("TC037");
setOtherInsuranced("TC037");
clickCalculateResults();
verifyAmountAndLoanTerm("TC037");
parent.appendChild(child);
// This will mark end of the one row in data sheet
iterationReport(1, "Test Case Completed");
}
}
| [
"E003700@cigniti.com"
] | E003700@cigniti.com |
f74b81a72afae34b01099d25678cb4a37896cbff | e4b6315f4adcbe85b45156b1a6636c6377a633cd | /java11/src/main/java/java.xml/com/sun/org/apache/bcel/internal/generic/I2B.java | 5f60143507ac4a90eb66bbc1288c3505df4df442 | [] | no_license | sunxiongkun/jdk-source | 48f0664d50f8c63e6f92eb1bb643e3ed452f99ee | 068e4867e17e5a965703d2edf561781b4f7b22a2 | refs/heads/master | 2020-04-15T01:56:30.872418 | 2019-01-07T02:33:58 | 2019-01-07T02:33:58 | 164,297,232 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,897 | java | /*
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.sun.org.apache.bcel.internal.generic;
/**
* I2B - Convert int to byte
* <PRE>Stack: ..., value -> ..., result</PRE>
*
* @version $Id: I2B.java 1747278 2016-06-07 17:28:43Z britter $
*/
public class I2B extends ConversionInstruction {
/** Convert int to byte
*/
public I2B() {
super(com.sun.org.apache.bcel.internal.Const.I2B);
}
/**
* Call corresponding visitor method(s). The order is:
* Call visitor methods of implemented interfaces first, then
* call methods according to the class hierarchy in descending order,
* i.e., the most specific visitXXX() call comes last.
*
* @param v Visitor object
*/
@Override
public void accept( final Visitor v ) {
v.visitTypedInstruction(this);
v.visitStackProducer(this);
v.visitStackConsumer(this);
v.visitConversionInstruction(this);
v.visitI2B(this);
}
}
| [
"sunxiongkun2018@163.com"
] | sunxiongkun2018@163.com |
7dcdd34bbd4f0b95840b48b1d30dba5384d3e196 | 791265898121d8a17e8d2c2eeb1f9a61afa69385 | /bancol_avaluos/src/main/java/com/helio4/bancol/avaluos/servicio/datos/FotografiaService.java | d77e61577f03e0e89ef1cfdaa362d5c48c7f9ac4 | [] | no_license | jarivera94/spring | 2309f0520294927c5a5b31f16115a424d036b945 | b180131f7396dbe0a72af10f6fff16dae417ca3f | refs/heads/master | 2020-04-05T00:44:20.775243 | 2018-11-06T15:54:51 | 2018-11-06T15:54:51 | 116,262,012 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,172 | java | package com.helio4.bancol.avaluos.servicio.datos;
import java.util.List;
import com.helio4.bancol.avaluos.servicio.excepciones.FotografiaNotFoundException;
import org.springframework.stereotype.Service;
import com.helio4.bancol.avaluos.dto.FotografiaDTO;
@Service
public interface FotografiaService {
/**
* Crea un nuevo fotografia.
*
* @param fotografiaDTO
* La información del nuevo fotografia.
* @return El valuo creado
*/
public FotografiaDTO crear(FotografiaDTO fotografiaDTO);
/**
* Crea un nuevo anexo.
*
* @param fotografiaDTO
* La información del nuevo anexo.
* @return El valuo creado
*/
public FotografiaDTO crearAnexo(FotografiaDTO fotografiaDTO);
/**
* Crea un nuevo croquis.
*
* @param fotografiaDTO
* La información del nuevo croquis.
* @return El valuo creado
*/
public FotografiaDTO crearCroquis(FotografiaDTO fotografiaDTO);
/**
* Elimina el fotografia
*
* @param fotografiaId
* El identificador del fotografia que se va a eliminar.
* @throws FotografiaNotFoundException
* Si el fotografia no existe.
* @return El fotografia que se eliminó.
*/
public FotografiaDTO eliminar(Long fotografiaId)
throws FotografiaNotFoundException;
/**
* Elimina el anexo
*
* @param anexoId
* El identificador del anexo que se va a eliminar.
* @throws FotografiaNotFoundException
* Si el anexo no existe.
* @return El anexo que se eliminó.
*/
public FotografiaDTO eliminarAnexo(Long anexoId)
throws FotografiaNotFoundException;
/**
* Elimina el croquis
*
* @param croquisId
* El identificador del croquis que se va a eliminar.
* @throws FotografiaNotFoundException
* Si el croquis no existe.
* @return El croquis que se eliminó.
*/
public FotografiaDTO eliminarCroquis(Long anexoId)
throws FotografiaNotFoundException;
/**
* Encuentra todos los fotografias.
*
* @return Una lista con todos los fotografias.
*/
public List<FotografiaDTO> encontrarTodos();
/**
* Encuentra el fotografia por el identificador.
*
* @param id
* El identificador del fotografia que se quiere encontrar.
* @return
*/
public FotografiaDTO encontrarPorId(Long id);
/**
* Retorna las fotografias del avaluo (Inicialización perezosa manual)
*
* @param avaluo
* @return
*/
public List<FotografiaDTO> buscarFotografiasAvaluo(Long avaluoId);
/**
* Retorna los anexos del avaluo (Inicialización perezosa manual)
*
* @param avaluo
* @return
*/
public List<FotografiaDTO> buscarAnexosAvaluo(Long avaluoId);
/**
* Retorna los croquis del avaluo (Inicialización perezosa manual)
*
* @param avaluo
* @return
*/
public List<FotografiaDTO> buscarCroquisAvaluo(Long avaluoId);
/**
* Actualiza la información de un fotografia.
*
* @param actualizado
* La información del fotografia actualizado
* @return El avaluuo actualizado
* @throws FotografiaNotFoundException
* Si no hay un fotografia con el id dado.
*/
public FotografiaDTO actualizar(FotografiaDTO actualizado)
throws FotografiaNotFoundException;
/**
* Actualiza la información de un anexo.
*
* @param actualizado
* La información del anexo actualizado
* @return El avaluo actualizado
* @throws FotografiaNotFoundException
* Si no hay un fotografia con el id dado.
*/
public FotografiaDTO actualizarAnexo(FotografiaDTO actualizado)
throws FotografiaNotFoundException;
/**
* Actualiza la información de un croquis.
*
* @param actualizado
* La información del croquis actualizado
* @return El avaluo actualizado
* @throws FotografiaNotFoundException
* Si no hay un croquis con el id dado.
*/
public FotografiaDTO actualizarCroquis(FotografiaDTO actualizado)
throws FotografiaNotFoundException;
/**
* Guarda la ruta de la fotografia que se pasa como parametro
*
* @param fotografiaDTO
* @return
*/
public FotografiaDTO guardarRutaFotografia(FotografiaDTO fotografiaDTO)
throws FotografiaNotFoundException;
/**
* Guarda la ruta del anexo que se pasa como parametro
*
* @param fotografiaDTO
* @return
*/
public FotografiaDTO guardarRutaAnexo(FotografiaDTO fotografiaDTO)
throws FotografiaNotFoundException;
/**
* Guarda la ruta del croquis que se pasa como parametro
*
* @param fotografiaDTO
* @return
*/
public FotografiaDTO guardarRutaCroquis(FotografiaDTO fotografiaDTO)
throws FotografiaNotFoundException;
}
| [
"jrivera@koghi.com"
] | jrivera@koghi.com |
8653ef04186b9fc39292cb68a4edf8949ad6e913 | 68f4e86658b037b71270cb57527b4691afdcd880 | /src/main/java/com/qgailab/raftkv/exception/RaftRemotingException.java | f38bc17a81b5f92b5d191a91f8c6f95ae7adef0f | [] | no_license | linux5396/raft-kv | 7ede46fbd7b5acaae4fe3f5abe6bb2d545268fd2 | 05ba9b774a0f7eb3c3390c2da5a6d9d4fff1f4d1 | refs/heads/master | 2022-08-08T22:08:25.535640 | 2020-01-19T07:22:41 | 2020-01-19T07:22:41 | 234,613,215 | 21 | 7 | null | 2022-06-17T02:52:57 | 2020-01-17T18:39:38 | Java | UTF-8 | Java | false | false | 247 | java | package com.qgailab.raftkv.exception;
public class RaftRemotingException extends RuntimeException {
public RaftRemotingException() {
super();
}
public RaftRemotingException(String message) {
super(message);
}
}
| [
"929159338@qq.com"
] | 929159338@qq.com |
17f4a114ae63b1104a4a5d0108818aee7691bf3d | 47c9926b8ae3f9ef7a883758da783ead7772eb64 | /src/main/java/me/crespel/karaplan/model/CatalogSelection.java | de2f40e288d9dd0e6eeb991fe5412a3eda927a5b | [
"MIT",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | fcrespel/karaplan | fd48f9e3bcb1f40666794073bccce454b03ff32f | 165b9bf215e9ea323564249aaa4c12d0ea13a1f5 | refs/heads/master | 2023-06-24T17:09:21.773206 | 2023-06-21T21:07:31 | 2023-06-21T21:07:31 | 173,645,120 | 5 | 10 | MIT | 2023-06-21T21:15:17 | 2019-03-04T00:02:27 | Java | UTF-8 | Java | false | false | 532 | java | package me.crespel.karaplan.model;
import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import lombok.ToString;
import lombok.experimental.Accessors;
@Data
@Accessors(chain = true)
@ToString(of = {"id", "name"})
@JsonIgnoreProperties(ignoreUnknown = true)
public class CatalogSelection implements Serializable {
private static final long serialVersionUID = -2595089354908324339L;
private Long id;
private String name;
private String img;
}
| [
"fabien@crespel.net"
] | fabien@crespel.net |
49d419a3c0f259cbfe5272f82e97965b976daa50 | 880581a3f5d85922bb8999f7f4fc64700f59cc02 | /app/src/main/java/com/example/simcard/web/SaveXmlIntoFile.java | d65bd67c5568c890f4ab0e9f26e11ec1e2fb7c91 | [] | no_license | ValeriyLapin/SimCard | e5f7c41c4b8d376573d3f0c422feb85ee2bd1ade | 53e3c528d69cba8e1171c9ca257012f40e076561 | refs/heads/master | 2016-09-16T04:21:47.600037 | 2015-02-12T13:32:43 | 2015-02-12T13:32:43 | 30,703,857 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,194 | java | package com.example.simcard.web;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.AsyncTask;
import android.os.Environment;
import com.example.simcard.ListOfAllActivity;
import com.example.simcard.MyApplication;
import com.example.simcard.R;
public class SaveXmlIntoFile extends AsyncTask<Void, Void, String> {
final String xmlString;
File file;
final ListOfAllActivity context;
public SaveXmlIntoFile(final String xmlString, ListOfAllActivity context) {
super();
this.xmlString = xmlString;
this.context = context;
}
@Override
protected String doInBackground(Void... params) {
String result = "";
FileWriter writer = null;
final File PATH = Environment
.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);
final String FILENAME = (String) android.text.format.DateFormat.format(
"yyyyMMdd_hhmmss", new java.util.Date()) + ".xml";
file = new File(PATH, FILENAME);
try {
writer = new FileWriter(file, true);
writer.append(xmlString);
writer.flush();
} catch (IOException e) {
result = e.getLocalizedMessage();
e.printStackTrace();
} finally {
try {
if (writer != null)
writer.close();
} catch (IOException e) {
if (result.isEmpty()) {
result = e.getLocalizedMessage();
} else {
result = result + "\n" + e.getLocalizedMessage();
}
}
}
return result;
}
@Override
protected void onPostExecute(String result) {
super.onPostExecute(result);
String message = "";
if (result.isEmpty()) {
message = context
.getString(R.string.sales_orders_are_saved_to_file_message)
+ file.toString();
} else {
message = context.getString(R.string.saving_error_message) + result;
}
new AlertDialog.Builder(context)
.setTitle(
MyApplication.context
.getString(R.string.selling_sale_orders_dialog_title))
.setMessage(message)
.setPositiveButton(android.R.string.yes,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int which) {
}
}).show();
}
}
| [
"valerylapin@mail.ru"
] | valerylapin@mail.ru |
ec5b3a605ca21c92760934f8b47538900c516b0d | f9c8ec4d93e996b4c56c1e03d86485eb413bf8ca | /src/main/java/com/AlcanciaTest/demo/modelo/Alcancia.java | b0a4518df745807db8bcb5e0301e74d2ab397b80 | [] | no_license | kevinpayares/AlcanciaTest | b2e20c08210084f115e9bcd1e493de4855afdd5c | 131e1ffb777d5f6c0d0a181679aa68c928d6a317 | refs/heads/main | 2023-06-02T23:24:04.953275 | 2021-06-19T03:16:00 | 2021-06-19T03:16:00 | 378,308,620 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 675 | java | package com.AlcanciaTest.demo.modelo;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Id;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
@Entity
@Table(name="alcancia")
public class Alcancia {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int Id;
private int Moneda;
public Alcancia() {
}
public Alcancia(int id, int moneda) {
super();
Id = id;
Moneda = moneda;
}
public int getId() {
return Id;
}
public void setId(int id) {
Id = id;
}
public int getMoneda() {
return Moneda;
}
public void setMoneda(int moneda) {
Moneda = moneda;
}
}
| [
"kevinpayares1@gmail.com"
] | kevinpayares1@gmail.com |
8d26d19f012f86132ee1a9909b4a26cfc742adc4 | 3e702d21fc470bc34f1dbb6412320380d7e19fdc | /src/main/java/com/example/pasarYuk/repository/NewsRepository.java | dcfba60f4b5ae6cc63313697ace67627f62454e3 | [] | no_license | westonk21/pasarYuk | 962a4917b41f31c088896f467a4dcf6a7e82ec83 | 1688490d8cfac48f5f8e56227aef3ca15b148c3c | refs/heads/master | 2023-06-09T06:43:46.839325 | 2021-07-04T10:41:26 | 2021-07-04T10:41:26 | 356,887,131 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 278 | java | package com.example.pasarYuk.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import com.example.pasarYuk.model.News;
@Repository
public interface NewsRepository extends JpaRepository<News, Long>{
}
| [
"westonkierangen21@gmail.com"
] | westonkierangen21@gmail.com |
6de0bfd0a77ab291db0cc806c4eb65e569734aa1 | 244b09299f93a2b3315e3c0845270b2e5f2741dc | /src/main/java/com/aaa/Imple/InternalconfigImple.java | 5bb8be81f6567ae4d9e6df361e6f18c8ec605b41 | [] | no_license | ayldhaa/SpringBootAshuanCarPort | 82b04126d00fe4dc95a00ee422a25ec45af98f34 | 6a81d64c70a0ef72079138502ab2f58c63af5932 | refs/heads/master | 2022-12-05T02:42:09.539783 | 2020-08-31T08:15:42 | 2020-08-31T08:15:42 | 289,830,140 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 220 | java | package com.aaa.Imple;
import com.aaa.Entity.Internalconfig;
import org.springframework.stereotype.Repository;
public interface InternalconfigImple {
Integer AddInternalconfig(Internalconfig internalconfig);
}
| [
"1151044240@qq.com"
] | 1151044240@qq.com |
9a8936b4b18262b6e24e75ea73a857a921e7bd46 | 3266cf757b39e106eb6b51d94ea40e8ef8563b61 | /src/main/java/com/graduate/DAO/GoodDAO.java | 2abfd6df96175b708381f385513f7303406dce7d | [] | no_license | 17mirinae/BuyBook | 6ba943b62be9128f41f26197c120ffb3cfa8a1b5 | 77e08b03b617e835f1a9d371ee7b3e38ae870bb6 | refs/heads/main | 2023-08-28T12:15:59.757520 | 2021-11-08T11:37:50 | 2021-11-08T11:37:50 | 394,520,466 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,977 | java | package com.graduate.DAO;
import java.util.*;
import javax.sql.*;
import org.springframework.jdbc.core.*;
import org.springframework.stereotype.*;
import com.graduate.DTO.*;
@Component
public class GoodDAO {
private JdbcTemplate jdbcTemplate;
public GoodDAO(DataSource dataSource) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
}
public GoodDTO selectByGoodNo(int inputGoodNo) {
try {
return jdbcTemplate.queryForObject("SELECT * FROM GOOD WHERE GOODNO = " + inputGoodNo + ";",
(rs, rowNum) -> new GoodDTO(rs.getInt("GOODNO"), rs.getString("GOODISBN"),
rs.getString("GOODTITLE"), rs.getString("GOODCONTENT"), rs.getString("GOODIMAGE"),
rs.getTimestamp("GOODDATE")));
} catch (Exception ex) {
ex.printStackTrace();
return null;
}
}
public List<GoodDTO> showAll() {
List<GoodDTO> result = jdbcTemplate.query("SELECT * FROM GOOD;", (rs, rowNum) -> {
GoodDTO goodDTO = new GoodDTO(rs.getInt("GOODNO"), rs.getString("GOODISBN"), rs.getString("GOODTITLE"),
rs.getString("GOODCONTENT"), rs.getString("GOODIMAGE"), rs.getTimestamp("GOODDATE"));
return goodDTO;
});
return result;
}
public List<GoodDTO> showThree() {
List<GoodDTO> result = jdbcTemplate.query("SELECT * FROM GOOD ORDER BY GOODNO DESC LIMIT 3;", (rs, rowNum) -> {
GoodDTO goodDTO = new GoodDTO(rs.getInt("GOODNO"), rs.getString("GOODISBN"), rs.getString("GOODTITLE"),
rs.getString("GOODCONTENT"), rs.getString("GOODIMAGE"), rs.getTimestamp("GOODDATE"));
return goodDTO;
});
return result;
}
public void insertGood(GoodDTO goodDTO) {
jdbcTemplate.update("INSERT INTO GOOD(GOODISBN, GOODTITLE, GOODCONTENT, GOODIMAGE, GOODDATE) VALUES('"
+ goodDTO.getGoodISBN() + "', '" + goodDTO.getGoodTitle() + "', '" + goodDTO.getGoodContent() + "', '"
+ goodDTO.getGoodImage() + "', NOW());");
}
public void deleteGood(int inputGoodNo) {
jdbcTemplate.update("DELETE FROM GOOD WHERE GOODNO = " + inputGoodNo + ";");
}
}
| [
"mirinae@skuniv.ac.kr"
] | mirinae@skuniv.ac.kr |
10e5032a87e71ad55eb3fe10996b8f50b1f2afbd | 4117a2144142d3596d97140bab8f87c04f339ec7 | /app/src/main/java/com/example/lanjianzhong/homework3/SampleAdapterActivity.java | 7b92e33850d3368d1d9e2156b064c7e0c1c660e9 | [] | no_license | JianzhongLan/homework3 | 8851ac91e4fa48a2f47cd8b2096d88d8e89e224a | ccadc59df757761a313417d9ab3fb0938ae105a0 | refs/heads/master | 2020-03-09T06:34:11.282412 | 2018-04-08T14:00:38 | 2018-04-08T14:00:38 | 128,642,685 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,544 | java | package com.example.lanjianzhong.homework3;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.Toast;
import java.util.ArrayList;
import java.util.HashMap;
public class SampleAdapterActivity extends AppCompatActivity {
private ListView lv;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sample_adapter);
intoListView();
}
//将数据加入ListView
public void intoListView(){
lv = (ListView) findViewById(R.id.listview);
//定义一个动态数组
ArrayList<HashMap<String, Object>> listItem = new ArrayList<HashMap<String, Object>>();
//在数组中存放数据
HashMap<String, Object> map = new HashMap<String, Object>();
map.put("ItemImage", R.drawable.head1);//加入图片
map.put("ItemName","兰建忠 ");
map.put("ItemId", "15301121");
listItem.add(map);
HashMap<String, Object> map2 = new HashMap<String, Object>();
map2.put("ItemImage", R.drawable.head2);//加入图片
map2.put("ItemName","兰建忠2 ");
map2.put("ItemId", "15301121");
listItem.add(map2);
HashMap<String, Object> map3 = new HashMap<String, Object>();
map3.put("ItemImage", R.drawable.head3);//加入图片
map3.put("ItemName","兰建忠3 ");
map3.put("ItemId", "15301121");
listItem.add(map3);
SimpleAdapter mSimpleAdapter = new SimpleAdapter(this, listItem,//需要绑定的数据
R.layout.list_item,//每一行的布局
//动态数组中的数据源的键对应到定义布局的View中
new String[]{"ItemImage", "ItemName", "ItemId"},
new int[]{R.id.img_head, R.id.txt_name, R.id.txt_ID}
);
lv.setAdapter(mSimpleAdapter);//为ListView绑定适配器
lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {//响应事件,响应用户点击listview中游记列表块
@Override
public void onItemClick(AdapterView<?> parent, View view, int position,
long id) {
Toast.makeText(SampleAdapterActivity.this, "你点击了第" + position + "行", Toast.LENGTH_SHORT).show();
}
});
}
}
| [
"1778713874@qq.com"
] | 1778713874@qq.com |
d74340a6fa4b7de1e1c5d80524cd8d1e4e001b34 | d18a4ac052839b1461fc7976348453dcd8d71ddc | /geso_coban1/TrainingGESO/src/geso/erp/beans/muahang_hieu/IMuahang.java | 347b4de8150e0ac57357ef2162fea20909e0de59 | [] | no_license | luutrupx003/javaweb_hs1 | ac86afaecd752e3f08ed643d34c8ac09947eb4ff | be91ac6c9f2e436eb2dce706e8ad3de8da3fe8dd | refs/heads/master | 2021-03-04T05:49:46.663558 | 2020-03-09T11:07:10 | 2020-03-09T11:07:10 | 246,011,318 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 993 | java | package geso.erp.beans.muahang_hieu;
import geso.dms.center.util.IPhan_Trang;
import java.io.Serializable;
import java.sql.ResultSet;
public interface IMuahang extends Serializable, IPhan_Trang{
public String getUserId();
public void setUserId(String _userId);
public String getTrangthai();
public void setTrangthai(String _trangthai);
public String getId();
public void setId(String _id);
public String getMa();
public void setMa(String _ma);
public String getNgaychungtu();
public void setNgaychungtu(String _ngaychungtu);
public String getNhacungcap();
public void setNhacungcap(String _nhacungcap);
public void setmsg(String _msg);
public String getmsg();
public ResultSet getDataList();
public void setDataList(ResultSet _dmhlist);
public ResultSet getRskh();
public void setRskh(ResultSet _dmhlist);
public void init(String _search);
public void CreateRs();
public void DBclose();
public boolean Delete_dh();
public boolean Chot_dh();
}
| [
"luutrupx003@gmail.com"
] | luutrupx003@gmail.com |
9bf718889e5025ae97d70c7ebe69ae6c76ad5d80 | 666d6d38200e985cfef87c1d2d84cd22e95abf2c | /src/main/java/com/chai/DesignPattern/Prototype/deepclone/Client.java | e46eafecedf877392db4bb63474c4a94efbe7d24 | [] | no_license | xschai/DesignPattern | d78bc141650fc673f1756706d3b00db9e55881d4 | f55b0519bffaf054a10de6ce48bc169f8fbe2edb | refs/heads/master | 2023-03-17T07:06:13.315063 | 2021-03-16T11:39:05 | 2021-03-16T11:39:05 | 343,338,743 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 933 | java | package com.chai.DesignPattern.Prototype.deepclone;
public class Client {
public static void main(String[] args) throws Exception {
DeepProtoType p = new DeepProtoType();
p.name = "宋江";
p.deepCloneableTarget = new DeepCloneableTarget("大牛", "小牛");
//方式 1 完成深拷贝
// DeepProtoType p2 = (DeepProtoType) p.clone();
// System.out.println("p.name=" + p.name + "p.deepCloneableTarget=" + p.deepCloneableTarget.hashCode());
// System.out.println("p2.name=" + p.name + "p2.deepCloneableTarget=" + p2.deepCloneableTarget.hashCode());
//方式 2 完成深拷贝
DeepProtoType p2 = (DeepProtoType) p.deepClone();
System.out.println("p.name=" + p.name + "p.deepCloneableTarget=" + p.deepCloneableTarget.hashCode());
System.out.println("p2.name=" + p.name + "p2.deepCloneableTarget=" + p2.deepCloneableTarget.hashCode());
}
}
| [
"1113935182@qq.com"
] | 1113935182@qq.com |
26dffef70d3ab2e8a57c0f2bfc87e7a1152df1c5 | 0ff62d512c96005b1b34d1b10521e2248f71fca5 | /app/src/main/java/com/example/cruzmarcano/juego/adaptadores/CrearGrupoAdacter.java | e4ec3d34ea5362a1ca6706067e5f2b44d140e4fb | [] | no_license | cruzmarcano/juego_app | e2570fb6ae3997fc92173c4bde246af45eab519a | 9c944a4f74bedc964bb42c1dbd3e21523e7be0e4 | refs/heads/master | 2021-05-11T17:21:54.872431 | 2018-03-08T04:03:57 | 2018-03-08T04:03:57 | 117,797,106 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,981 | java | package com.example.cruzmarcano.juego.adaptadores;
import android.content.Context;
import android.support.v7.widget.CardView;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.TextView;
import android.widget.Toast;
import com.example.cruzmarcano.juego.R;
import com.example.cruzmarcano.juego.pojo.EjerciciosPojo;
import java.util.ArrayList;
import java.util.List;
/**
* Created by cruzmarcano on 28/2/18.
*/
public class CrearGrupoAdacter extends RecyclerView.Adapter<CrearGrupoAdacter.ViewHolder> {
Context contexto;
//estos lista contiene los datos que va a recibir
List<EjerciciosPojo> ejerciciospojo;
//esta lista almacena el id de los juegos cuyos checkbox fueron marcados
private ArrayList<Integer> idJuegosCheckbox;
public CrearGrupoAdacter(Context contexto, List<EjerciciosPojo> ejerciciospojo) {
this.contexto = contexto;
this.ejerciciospojo = ejerciciospojo;
}
@Override
public CrearGrupoAdacter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View vistaItem= LayoutInflater.from(parent.getContext()).inflate(R.layout.item_crear_grupo,parent,false);
ViewHolder viewHolder= new ViewHolder(vistaItem);
return viewHolder;
}
@Override
public void onBindViewHolder(final CrearGrupoAdacter.ViewHolder holder, final int position) {
//se inicializa el arreglo
idJuegosCheckbox=new ArrayList<Integer>();
//esto captura el nombre del juego
holder.nombre.setText(ejerciciospojo.get(position).getNombre());
//evita que se pierdan los checbox marcados al subir o bajar el scrol
holder.checkBox.setOnCheckedChangeListener(null);
//se crea un elemento onclick para capturar cundo se preciona el checkbox
holder.checkBox.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
//se valida si el checkbox fue marcado
if(holder.checkBox.isChecked()){
//si es checkeado se guarda en el arreglo el id del ejercicio
idJuegosCheckbox.add(ejerciciospojo.get(position).getId());
//si se deselecciona
}else if(!holder.checkBox.isChecked()){
//se valida si existe el id dentro del arreglo
if(idJuegosCheckbox.contains(ejerciciospojo.get(position).getId())){
//si exite se pide que indique que posicion
int po=idJuegosCheckbox.indexOf(ejerciciospojo.get(position).getId());
//finalmente se elimina
idJuegosCheckbox.remove(po);
}
}
}
});
//color de fondo de la tarjeta ARVERTENCIA "se debe colocar un color dependiendo del juego"
holder.tarjeta.setCardBackgroundColor(contexto.getResources().getColor(R.color.azul2));
}
// el metodo geter permite que se pueda aceder al arreglo desde oro activity solo vreando una
// instancia de la clase e invocando el metodo
public ArrayList<Integer> getNumbers() {
return idJuegosCheckbox;
}
//numero de instancias que se crearan
@Override
public int getItemCount() {
return ejerciciospojo.size();
}
//nuestra propia clase Viewholder
public static class ViewHolder extends RecyclerView.ViewHolder{
private CardView tarjeta;
private TextView nombre;
private CheckBox checkBox;
public ViewHolder(View itemView) {
super(itemView);
tarjeta=(CardView)itemView.findViewById(R.id.itemGrupEjer);
nombre=(TextView)itemView.findViewById(R.id.nombEjerc);
checkBox=(CheckBox)itemView.findViewById(R.id.checkBox);
}
}
}
| [
"cruzmarcano@gmail.com"
] | cruzmarcano@gmail.com |
cdb60d980998512c5fd2788eef7699200ee5e6b9 | 34ccbfffa071b0cc931a94c59ee878a177bb884d | /Android/java/com/bayer/turfid/SprayActivity6_CalibratedJug.java | ddf53325ad32e4dcb2468b19950a31e4feff7534 | [] | no_license | JasmineJeyakani/Sample | 77cd30ebb080c358513a2648e867429f3780a438 | 2ee30ba0559670a8046cd2dcbda80b1027635721 | refs/heads/master | 2021-01-22T19:22:33.772909 | 2017-03-17T05:54:28 | 2017-03-17T05:54:28 | 85,188,655 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,240 | java | package com.bayer.turfid;
import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.text.Html;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
public class SprayActivity6_CalibratedJug extends Activity {
Button continue6calibrate;
ImageView backArrow,imgLogo;
SharedPreferences Prefrence;
SharedPreferences.Editor editor;
TextView productlabel1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.spray_activity6__calibrated_jug);
backArrow=(ImageView)findViewById(R.id.leftarrowknapsack);
backArrow.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
continue6calibrate=(Button)findViewById(R.id.calibratedjugcontinue);
imgLogo=(ImageView)findViewById(R.id.img_logo);
productlabel1=(TextView)findViewById(R.id.productlabel);
imgLogo.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(SprayActivity6_CalibratedJug.this, BayerTurfManagementActivity.class);
startActivity (intent);
}
});
Prefrence=getApplicationContext().getSharedPreferences("SprayCalc",MODE_PRIVATE);
String type = Prefrence.getString("sprayerType","default");
if(type.equals("boom")) {
CustomTextViewBold t = (CustomTextViewBold) findViewById(R.id.step3);
t.setText(R.string.boom_step_6);
String sourceString = " Using a calibrated jug and stopwatch," +
" check the output from a minimum of four" +
" nozzles and at least one from each boom section." +
" <br>If time permits, check the output from all nozzles." +
" <br><br> <b>Keep a note of the actual<br></b>" +
" nozzle output";
productlabel1.setText(Html.fromHtml(sourceString));
}
continue6calibrate.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String type = Prefrence.getString("sprayerType","default");
Intent totalOutput;
if(type.equals("boom")){
totalOutput = new Intent(SprayActivity6_CalibratedJug.this, BoomStep7Activity.class);
}
else {
totalOutput = new Intent(SprayActivity6_CalibratedJug.this, SprayActivity7_TotalOutput.class);
}
startActivity(totalOutput);
}
});
}
@Override
public void onBackPressed() {
Intent i=new Intent(SprayActivity6_CalibratedJug.this,SprayActivity5_correctnozzle.class);
editor = Prefrence.edit();
editor.putBoolean("in5",false);
editor.commit();
startActivity(i);
}
}
| [
"jasmine@newgen.co"
] | jasmine@newgen.co |
c080193f2d4a916679db4d72a51363759c583b2c | 0fce88c4467d5887f47835e8e3d499d16a9115ea | /Assignment2/src/Application.java | 6618366e5b8e9adb73346ff7f6e1368f437c8fad | [] | no_license | aishwarya-sankhla/JavaTraining | 15d52377d54cd39540eef3170a280a62c9a4d1d3 | b389b2abfcf69ccb26edc9925e3dc18543e98dde | refs/heads/master | 2020-03-29T05:23:51.262712 | 2018-10-18T08:49:41 | 2018-10-18T08:49:41 | 149,580,597 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,230 | java | import java.util.List;
import java.util.Scanner;
public class Application {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
System.out.println("Enter the Doctor id:");
int id = sc.nextInt();
System.out.println("Special:");
String s =sc.next();
Patient p1 = new Patient(101,"Sam");
Patient p2 = new Patient(102,"John");
Patient p3 = new Patient(103,"Jack");
Patient p4 = new Patient(104,"Jake");
Patient p5 = new Patient(105,"Cole");
Doctor d1 = new Doctor(11,"Dr. Clive","random");
Doctor d2 = new Doctor(12,"Dr. Kit","ortho");
Doctor d3 = new Doctor(12,"Dr.","ortho");
Hospital h = new Hospital();
d1.addPatient(p1);
d2.addPatient(p2);
d2.addPatient(p3);
d2.addPatient(p4);
h.add(d1);
h.add(d2);
h.add(d3);
List<Doctor> doc = h.findAll();
h.fixAppointment(d1, d1.patientset);
h.fixAppointment(d2, d2.patientset);
h.fixAppointment(d1, p5);
for(Doctor doctor:doc){
if(doctor.getDoctorId() == id){
h.display(doctor);
break;
}
}
for(Doctor doctor:doc){
if(doctor.getSpecial().equals(s)){
System.out.println(doctor.getDoctorName());
}
}
sc.close();
}
}
| [
"Aishwarya.Sankhla@CenturyLink.com"
] | Aishwarya.Sankhla@CenturyLink.com |
f1e1cfa83fcd8a0076714f90d9219439cf9aec3a | 221860043fe105ba197074a34ae0ea9a354948d6 | /05 Java Advanced framework/1 Java Advanced framework_XML/webssm/src/main/java/com/huyy/service/UsersService.java | 2397a461906b48e29c226965a76a91ec68197628 | [] | no_license | FynKatz/JavaBasic | 8632d767b4a5605697f7fb214a5ec6ba0efde7bc | 62f1f8eb85330cd3ccf60a6347adf2363b5b365f | refs/heads/master | 2023-03-20T22:29:00.135577 | 2021-03-02T13:58:38 | 2021-03-02T13:58:38 | 277,420,752 | 0 | 0 | null | 2020-07-06T02:44:26 | 2020-07-06T02:08:53 | Java | UTF-8 | Java | false | false | 142 | java | package com.huyy.service;
import java.util.List;
import com.huyy.pojo.Users;
public interface UsersService {
public List<Users> show();
}
| [
"easyyhu@gmail.com"
] | easyyhu@gmail.com |
901c225f86d2ae735ea0ada98b40c94e6355a793 | ee2c183366bacc77b10d62608294ec4ee2f1f734 | /app/src/main/java/com/example/fellyrusli/pollster/Task/LoadQuestion.java | a58723c98ca0499e6047fedc5822e23970aa41e2 | [] | no_license | fellyrusli/PollsterAndroid | 6941e3f5c9d879e343e45a213feb00d3d47a0bfd | 4f3c99d3d943af1ec8a489308e884fbbad0c8cab | refs/heads/master | 2020-07-28T12:02:53.129712 | 2016-11-10T19:10:02 | 2016-11-10T19:10:02 | 73,412,949 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,105 | java | package com.example.fellyrusli.pollster.Task;
import android.app.FragmentTransaction;
import android.app.ProgressDialog;
import android.os.AsyncTask;
import android.os.SystemClock;
import com.example.fellyrusli.pollster.Activity.ApplicationController;
import com.example.fellyrusli.pollster.R;
import org.apache.http.client.methods.HttpGetHC4;
import org.apache.http.client.methods.HttpRequestBaseHC4;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.impl.client.HttpClients;
import java.net.URI;
/**
* Created by fellyrusli on 10/15/2016.
*/
public class LoadQuestion extends AsyncTask<Void, Void, Void> {
ApplicationController applicationController;
ProgressDialog loadingScreen;
public LoadQuestion (ApplicationController applicationController) {
this.applicationController = applicationController;
}
@Override
protected void onPreExecute() {
while (true) {
try{
loadingScreen = new ProgressDialog(applicationController);
loadingScreen.setTitle("Loading");
loadingScreen.setCanceledOnTouchOutside(false);
loadingScreen.show();
break;
} catch (RuntimeException e) {
SystemClock.sleep(100);
}
}
}
@Override
protected Void doInBackground(Void... params) {
return null;
}
protected void onPostExecute(Void ignore) {
if (loadingScreen.isShowing()) {
loadingScreen.dismiss();
}
FragmentTransaction fragmentTransaction = applicationController.getFragmentManager().beginTransaction();
fragmentTransaction.add(R.id.visible_view, applicationController.getQuestionFragment());
fragmentTransaction.show(applicationController.getQuestionFragment())
.hide(applicationController.getSessionFragment())
.hide(applicationController.getHomeFragment())
.addToBackStack(null).commit();
applicationController.getFragmentManager().executePendingTransactions();
}
}
| [
"frusli6@gatech.edu"
] | frusli6@gatech.edu |
e80aca58669fb94547157bea262f0e401ce22aa8 | 3e579df28224f9c3bb0c50ee5da4d1f8eeca634f | /gitIntro/src/test/java/utils/ConfigReader.java | ae3649ee5edee260769ca6e356142e5b62f9dfb1 | [] | no_license | ysfcntrn/gitIntro1 | 5191b547ee6680d1805dac7e8ce8e78ed22390cc | ab201dea513859e68096b9db04545389d89511cd | refs/heads/master | 2023-05-10T23:56:31.957218 | 2020-03-19T23:51:36 | 2020-03-19T23:51:36 | 241,258,144 | 0 | 0 | null | 2023-05-09T18:21:46 | 2020-02-18T02:52:32 | HTML | UTF-8 | Java | false | false | 596 | java | package utils;
import java.io.FileInputStream;
import java.util.Properties;
public class ConfigReader {
private static Properties configFile;
static {
String path = "configuration.properties";
try {
FileInputStream inputStream = new FileInputStream(path);
configFile = new Properties();
configFile.load(inputStream);
inputStream.close();
}catch (Exception e){
e.printStackTrace();
}
}
public static String getProperty(String keyValue){
return configFile.getProperty(keyValue);
}
}
| [
"yusufcanturan@Yusufs-MacBook-Pro-2.local"
] | yusufcanturan@Yusufs-MacBook-Pro-2.local |
8e336a4e9fb0bc93a2107ab5399c04bad632dc09 | ce0cd71e8a7a537a4e709d92dacbdfeb026fb352 | /src/Circle.java | 115f866d95fa78f871b0c2d120f381faa10b9bda | [] | no_license | akothari11/DontTouchTheObstacle | 78084a60d1c919bb92877e029273b67199188a06 | b839030e3c8e826c72068a5b598a490e2e2bc6f8 | refs/heads/master | 2020-04-06T13:07:14.993605 | 2018-11-14T03:31:02 | 2018-11-14T03:31:02 | 152,293,056 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,174 | java | import java.awt.Color;
import java.awt.Toolkit;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Rectangle2D;
public class Circle implements Shapes
{
private int myX;
private int myY;
private int myWidth = 80;
private int myHeight = 20;
private Color myColor = Color.black;
private Ellipse2D myCircle;
public Circle(int x, int y, int width, int height)
{
myX = x;
myY = y;
myWidth = width;
myHeight = height;
myCircle = new Ellipse2D.Double(myX,myY,myWidth,myHeight);
}
public Ellipse2D getCircle()
{
return myCircle;
}
public int getMyX() {
return myX;
}
public void setMyX(int myX) {
this.myX = myX;
}
public int getMyY() {
return myY;
}
public void setMyY(int myY) {
this.myY = myY;
}
public int getMyWidth() {
return myWidth;
}
public void setMyWidth(int myWidth) {
this.myWidth = myWidth;
}
public int getMyHeight() {
return myHeight;
}
public void setMyHeight(int myHeight) {
this.myHeight = myHeight;
}
public Color getMyColor() {
return myColor;
}
public void setMyColor(Color myColor) {
this.myColor = myColor;
}
public Rectangle2D getRectangle() {
return null;
}
}
| [
"anujkothari@Anujs-MacBook-Pro.local"
] | anujkothari@Anujs-MacBook-Pro.local |
8d16d3e75273f322faf86dd2ff007b79a30d6083 | 03a08b97d547eee0d1bdada9fab74b8cd8321450 | /deeplearning4j-core/src/main/java/org/deeplearning4j/nn/BaseNeuralNetwork.java | b86d83d876c9b595044768e625b51f6d6b2668af | [] | no_license | YesBarJALL/java-deeplearning | b3d3df6d3eb7fba5ab5dfccf0ab8f286ea2fea10 | 80ef4a8afc21ad5c3a5453d2054553f329b525d7 | refs/heads/master | 2020-12-29T02:54:44.557329 | 2014-09-01T14:41:36 | 2014-09-01T14:41:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 37,743 | java | package org.deeplearning4j.nn;
import static org.deeplearning4j.util.MatrixUtil.log;
import static org.deeplearning4j.util.MatrixUtil.oneMinus;
import static org.deeplearning4j.util.MatrixUtil.sigmoid;
import static org.deeplearning4j.util.MatrixUtil.sqrt;
import static org.jblas.MatrixFunctions.pow;
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.lang.reflect.Constructor;
import org.apache.commons.math3.distribution.NormalDistribution;
import org.apache.commons.math3.distribution.RealDistribution;
import org.apache.commons.math3.random.MersenneTwister;
import org.apache.commons.math3.random.RandomGenerator;
import org.deeplearning4j.berkeley.Pair;
import org.deeplearning4j.dbn.DBN;
import org.deeplearning4j.nn.gradient.NeuralNetworkGradient;
import org.deeplearning4j.nn.learning.AdaGrad;
import org.deeplearning4j.optimize.NeuralNetworkOptimizer;
import org.deeplearning4j.plot.NeuralNetPlotter;
import org.deeplearning4j.util.Dl4jReflection;
import org.deeplearning4j.util.MatrixUtil;
import org.jblas.DoubleMatrix;
import org.jblas.MatrixFunctions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Baseline class for any Neural Network used
* as a layer in a deep network such as an {@link DBN}
* @author Adam Gibson
*
*/
public abstract class BaseNeuralNetwork implements NeuralNetwork,Persistable {
private static final long serialVersionUID = -7074102204433996574L;
/* Number of visible inputs */
protected int nVisible;
/**
* Number of hidden units
* One tip with this is usually having
* more hidden units than inputs (read: input rows here)
* will typically cause terrible overfitting.
*
* Another rule worthy of note: more training data typically results
* in more redundant data. It is usually a better idea to use a smaller number
* of hidden units.
*
*
*
**/
protected int nHidden;
/* Weight matrix */
protected DoubleMatrix W;
/* hidden bias */
protected DoubleMatrix hBias;
/* visible bias */
protected DoubleMatrix vBias;
/* RNG for sampling. */
protected RandomGenerator rng;
/* input to the network */
protected DoubleMatrix input;
/* sparsity target */
protected double sparsity = 0;
/* momentum for learning */
protected double momentum = 0.5;
/* Probability distribution for weights */
protected transient RealDistribution dist = new NormalDistribution(rng,0,.01,NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
/* L2 Regularization constant */
protected double l2 = 0.1;
protected transient NeuralNetworkOptimizer optimizer;
protected int renderWeightsEveryNumEpochs = -1;
protected double fanIn = -1;
protected boolean useRegularization = false;
protected boolean useAdaGrad = true;
//used to track if adagrad needs to be changed
protected boolean firstTimeThrough = false;
//normalize by input rows or not
protected boolean normalizeByInputRows = true;
//use only when binary hidden layers are active
protected boolean applySparsity = false;
protected double dropOut = 0;
protected DoubleMatrix doMask;
protected OptimizationAlgorithm optimizationAlgo;
protected LossFunction lossFunction;
private static Logger log = LoggerFactory.getLogger(BaseNeuralNetwork.class);
//cache input when training?
protected boolean cacheInput;
//previous gradient used for updates
protected DoubleMatrix wGradient,vBiasGradient,hBiasGradient;
protected int lastMiniBatchSize = 1;
protected AdaGrad wAdaGrad,hBiasAdaGrad,vBiasAdaGrad;
protected BaseNeuralNetwork() {}
/**
*
* @param nVisible the number of outbound nodes
* @param nHidden the number of nodes in the hidden layer
* @param W the weights for this vector, maybe null, if so this will
* create a matrix with nHidden x nVisible dimensions.
* @param rng the rng, if not a seed of 1234 is used.
*/
public BaseNeuralNetwork(int nVisible, int nHidden,
DoubleMatrix W, DoubleMatrix hbias, DoubleMatrix vbias, RandomGenerator rng,double fanIn,RealDistribution dist) {
this(null,nVisible,nHidden,W,hbias,vbias,rng,fanIn,dist);
}
/**
*
* @param input the input examples
* @param nVisible the number of outbound nodes
* @param nHidden the number of nodes in the hidden layer
* @param W the weights for this vector, maybe null, if so this will
* create a matrix with nHidden x nVisible dimensions.
* @param rng the rng, if not a seed of 1234 is used.
*/
public BaseNeuralNetwork(DoubleMatrix input, int nVisible, int nHidden,
DoubleMatrix W, DoubleMatrix hbias, DoubleMatrix vbias, RandomGenerator rng,double fanIn,RealDistribution dist) {
this.nVisible = nVisible;
if(dist != null)
this.dist = dist;
else
this.dist = new NormalDistribution(rng,0,.01,NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
this.nHidden = nHidden;
this.fanIn = fanIn;
this.input = input;
if(rng == null)
this.rng = new MersenneTwister(1234);
else
this.rng = rng;
this.W = W;
if(this.W != null)
this.wAdaGrad = new AdaGrad(this.W.rows,this.W.columns);
this.vBias = vbias;
if(this.vBias != null)
this.vBiasAdaGrad = new AdaGrad(this.vBias.rows,this.vBias.columns);
this.hBias = hbias;
if(this.hBias != null)
this.hBiasAdaGrad = new AdaGrad(this.hBias.rows,this.hBias.columns);
initWeights();
}
/**
* Whether to cache the input at training time
*
* @return true if the input should be cached at training time otherwise false
*/
@Override
public boolean cacheInput() {
return cacheInput;
}
@Override
public double l2RegularizedCoefficient() {
return (MatrixFunctions.pow(getW(),2).sum()/ 2.0) * l2 + 1e-6;
}
/**
* Initialize weights.
* This includes steps for doing a random initialization of W
* as well as the vbias and hbias
*/
protected void initWeights() {
if(this.nVisible < 1)
throw new IllegalStateException("Number of visible can not be less than 1");
if(this.nHidden < 1)
throw new IllegalStateException("Number of hidden can not be less than 1");
if(this.dist == null)
dist = new NormalDistribution(rng,0,.01,NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
/*
* Initialize based on the number of visible units..
* The lower bound is called the fan in
* The outer bound is called the fan out.
*
* Below's advice works for Denoising AutoEncoders and other
* neural networks you will use due to the same baseline guiding principles for
* both RBMs and Denoising Autoencoders.
*
* Hinton's Guide to practical RBMs:
* The weights are typically initialized to small random values chosen from a zero-mean Gaussian with
* a standard deviation of about 0.01. Using larger random values can speed the initial learning, but
* it may lead to a slightly worse final model. Care should be taken to ensure that the initial weight
* values do not allow typical visible vectors to drive the hidden unit probabilities very close to 1 or 0
* as this significantly slows the learning.
*/
if(this.W == null) {
this.W = DoubleMatrix.zeros(nVisible,nHidden);
for(int i = 0; i < this.W.rows; i++)
this.W.putRow(i,new DoubleMatrix(dist.sample(this.W.columns)));
}
this.wAdaGrad = new AdaGrad(this.W.rows,this.W.columns);
if(this.hBias == null) {
this.hBias = DoubleMatrix.zeros(nHidden);
/*
* Encourage sparsity.
* See Hinton's Practical guide to RBMs
*/
//this.hBias.subi(4);
}
this.hBiasAdaGrad = new AdaGrad(hBias.rows,hBias.columns);
if(this.vBias == null) {
if(this.input != null) {
this.vBias = DoubleMatrix.zeros(nVisible);
}
else
this.vBias = DoubleMatrix.zeros(nVisible);
}
this.vBiasAdaGrad = new AdaGrad(vBias.rows,vBias.columns);
}
@Override
public void resetAdaGrad(double lr) {
if(!firstTimeThrough) {
this.wAdaGrad = new AdaGrad(this.getW().rows,this.getW().columns,lr);
firstTimeThrough = false;
}
}
public void setRenderEpochs(int renderEpochs) {
this.renderWeightsEveryNumEpochs = renderEpochs;
}
@Override
public int getRenderEpochs() {
return renderWeightsEveryNumEpochs;
}
@Override
public double fanIn() {
return fanIn < 0 ? 1 / nVisible : fanIn;
}
@Override
public void setFanIn(double fanIn) {
this.fanIn = fanIn;
}
/**
* Backprop with the output being the reconstruction
*/
@Override
public void backProp(double lr,int epochs,Object[] extraParams) {
double currRecon = getReConstructionCrossEntropy();
boolean train = true;
NeuralNetwork revert = clone();
int numEpochs = 0;
while(train) {
if(numEpochs > epochs)
break;
NeuralNetworkGradient gradient = getGradient(extraParams);
DoubleMatrix wLearningRates = getAdaGrad().getLearningRates(gradient.getwGradient());
Pair<DoubleMatrix,DoubleMatrix> sample = sampleHiddenGivenVisible(input);
DoubleMatrix hiddenSample = sample.getSecond().transpose();
/*
Scale the input and reconstrution to see the relative difference in absolute space
*/
DoubleMatrix scaledInput = input.dup();
MatrixUtil.normalizeZeroMeanAndUnitVariance(scaledInput);
DoubleMatrix z = reconstruct(input);
MatrixUtil.normalizeZeroMeanAndUnitVariance(z);
DoubleMatrix outputDiff = z.sub(scaledInput);
//changes in error relative to neurons
DoubleMatrix delta = hiddenSample.mmul(outputDiff).transpose();
//hidden activations
DoubleMatrix hBiasMean = sample.getFirst().columnSums().transpose();
if(isUseAdaGrad())
delta.muli(wLearningRates);
else
delta.muli(lr);
if(momentum != 0)
delta.muli(momentum).add(delta.mul(1 - momentum));
if(normalizeByInputRows)
delta.divi(input.rows);
getW().addi(W.sub(delta));
if(isUseAdaGrad())
hBiasMean.muli(gethBiasAdaGrad().getLearningRates(gradient.gethBiasGradient()));
else
hBiasMean.muli(lr);
if(momentum != 0)
hBiasMean.muli(momentum).add(hBiasMean.mul(1 - momentum));
if(normalizeByInputRows)
hBiasMean.divi(input.rows);
gethBias().addi(gethBias().sub(hBiasMean));
double newRecon = this.getReConstructionCrossEntropy();
//prevent weights from exploding too far in either direction, we want this as close to zero as possible
if(newRecon > currRecon || currRecon < 0 && newRecon < currRecon) {
update((BaseNeuralNetwork) revert);
log.info("Converged for new recon; breaking...");
break;
}
else if(Double.isNaN(newRecon) || Double.isInfinite(newRecon)) {
update((BaseNeuralNetwork) revert);
log.info("Converged for new recon; breaking...");
break;
}
else if(newRecon == currRecon)
break;
else {
currRecon = newRecon;
revert = clone();
log.info("Recon went down " + currRecon);
}
numEpochs++;
int plotEpochs = getRenderEpochs();
if(plotEpochs > 0) {
NeuralNetPlotter plotter = new NeuralNetPlotter();
if(numEpochs % plotEpochs == 0) {
plotter.plotNetworkGradient(this,getGradient(extraParams),getInput().rows);
}
}
}
}
@Override
public boolean isUseAdaGrad() {
return this.useAdaGrad;
}
@Override
public boolean isUseRegularization() {
return this.useRegularization;
}
@Override
public void setUseRegularization(boolean useRegularization) {
this.useRegularization = useRegularization;
}
/**
* Applies sparsity to the passed in hbias gradient
* @param hBiasGradient the hbias gradient to apply to
* @param learningRate the learning rate used
*/
protected void applySparsity(DoubleMatrix hBiasGradient,double learningRate) {
if(useAdaGrad) {
DoubleMatrix change = this.hBiasAdaGrad.getLearningRates(hBias).neg().mul(sparsity).mul(hBiasGradient.mul(sparsity));
hBiasGradient.addi(change);
}
else {
DoubleMatrix change = hBiasGradient.mul(sparsity).mul(-learningRate * sparsity);
hBiasGradient.addi(change);
}
}
/**
* Update the gradient according to the configuration such as adagrad, momentum, and sparsity
* @param gradient the gradient to modify
* @param learningRate the learning rate for the current iteratiaon
*/
protected void updateGradientAccordingToParams(NeuralNetworkGradient gradient,double learningRate) {
DoubleMatrix wGradient = gradient.getwGradient();
DoubleMatrix hBiasGradient = gradient.gethBiasGradient();
DoubleMatrix vBiasGradient = gradient.getvBiasGradient();
DoubleMatrix wLearningRates = wAdaGrad.getLearningRates(wGradient);
if (useAdaGrad)
wGradient.muli(wLearningRates);
else
wGradient.muli(learningRate);
if (useAdaGrad)
hBiasGradient = hBiasGradient.mul(hBiasAdaGrad.getLearningRates(hBiasGradient)).add(hBiasGradient.mul(momentum));
else
hBiasGradient = hBiasGradient.mul(learningRate).add(hBiasGradient.mul(momentum));
if (useAdaGrad)
vBiasGradient = vBiasGradient.mul(vBiasAdaGrad.getLearningRates(vBiasGradient)).add(vBiasGradient.mul(momentum));
else
vBiasGradient = vBiasGradient.mul(learningRate).add(vBiasGradient.mul(momentum));
//only do this with binary hidden layers
if (applySparsity && this.hBiasGradient != null)
applySparsity(hBiasGradient, learningRate);
if (momentum != 0 && this.wGradient != null)
wGradient.addi(this.wGradient.mul(momentum).add(wGradient.mul(1 - momentum)));
if(momentum != 0 && this.vBiasGradient != null)
vBiasGradient.addi(this.vBiasGradient.mul(momentum).add(vBiasGradient.mul(1 - momentum)));
if(momentum != 0 && this.hBiasGradient != null)
hBiasGradient.addi(this.hBiasGradient.mul(momentum).add(hBiasGradient.mul(1 - momentum)));
if (normalizeByInputRows) {
wGradient.divi(lastMiniBatchSize);
vBiasGradient.divi(lastMiniBatchSize);
hBiasGradient.divi(lastMiniBatchSize);
}
//simulate post gradient application and apply the difference to the gradient to decrease the change the gradient has
if(useRegularization && l2 > 0)
wGradient.subi(wGradient.mul(l2).mul(wLearningRates));
this.wGradient = wGradient;
this.vBiasGradient = vBiasGradient;
this.hBiasGradient = hBiasGradient;
}
/**
* Clears the input from the neural net
*/
@Override
public void clearInput() {
this.input = null;
}
@Override
public void setDropOut(double dropOut) {
this.dropOut = dropOut;
}
@Override
public double dropOut() {
return dropOut;
}
@Override
public AdaGrad getAdaGrad() {
return this.wAdaGrad;
}
@Override
public void setAdaGrad(AdaGrad adaGrad) {
this.wAdaGrad = adaGrad;
}
@Override
public NeuralNetwork transpose() {
try {
Constructor<?> c = Dl4jReflection.getEmptyConstructor(getClass());
c.setAccessible(true);
NeuralNetwork ret = (NeuralNetwork) c.newInstance();
ret.setHbiasAdaGrad(vBiasAdaGrad);
ret.setVBiasAdaGrad(hBiasAdaGrad);
ret.sethBias(vBias.dup());
ret.setvBias(hBias.dup());
ret.setnHidden(getnVisible());
ret.setnVisible(getnHidden());
ret.setW(W.transpose());
ret.setL2(l2);
ret.setMomentum(momentum);
ret.setRenderEpochs(getRenderEpochs());
ret.setSparsity(sparsity);
ret.setRng(getRng());
ret.setDist(getDist());
ret.setAdaGrad(wAdaGrad);
ret.setLossFunction(lossFunction);
ret.setOptimizationAlgorithm(optimizationAlgo);
return ret;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
@Override
public NeuralNetwork clone() {
try {
Constructor<?> c = Dl4jReflection.getEmptyConstructor(getClass());
c.setAccessible(true);
NeuralNetwork ret = (NeuralNetwork) c.newInstance();
ret.setHbiasAdaGrad(hBiasAdaGrad);
ret.setVBiasAdaGrad(vBiasAdaGrad);
ret.sethBias(hBias.dup());
ret.setvBias(vBias.dup());
ret.setnHidden(getnHidden());
ret.setnVisible(getnVisible());
ret.setW(W.dup());
ret.setL2(l2);
ret.setMomentum(momentum);
ret.setRenderEpochs(getRenderEpochs());
ret.setSparsity(sparsity);
ret.setRng(getRng());
ret.setDist(getDist());
ret.setAdaGrad(wAdaGrad);
ret.setLossFunction(lossFunction);
ret.setOptimizationAlgorithm(optimizationAlgo);
return ret;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* RMSE for reconstruction entropy
*
* @return rmse for reconstruction entropy
*/
@Override
public double mseRecon() {
return sqrt(pow(reconstruct(input).sub(input),2)).sum() / input.rows;
}
@Override
public LossFunction getLossFunction() {
return lossFunction;
}
@Override
public void setLossFunction(LossFunction lossFunction) {
this.lossFunction = lossFunction;
}
@Override
public OptimizationAlgorithm getOptimizationAlgorithm() {
return optimizationAlgo;
}
@Override
public void setOptimizationAlgorithm(
OptimizationAlgorithm optimizationAlgorithm) {
this.optimizationAlgo = optimizationAlgorithm;
}
@Override
public RealDistribution getDist() {
return dist;
}
@Override
public void setDist(RealDistribution dist) {
this.dist = dist;
}
@Override
public void merge(NeuralNetwork network,int batchSize) {
W.addi(network.getW().sub(W).div(batchSize));
hBias.addi(network.gethBias().sub(hBias).divi(batchSize));
vBias.addi(network.getvBias().subi(vBias).divi(batchSize));
}
@Override
public String toString() {
final StringBuilder sb = new StringBuilder("BaseNeuralNetwork{");
sb.append("nVisible=").append(nVisible);
sb.append(", nHidden=").append(nHidden);
sb.append(", rng=").append(rng);
sb.append(", sparsity=").append(sparsity);
sb.append(", momentum=").append(momentum);
sb.append(", dist=").append(dist);
sb.append(", l2=").append(l2);
sb.append(", optimizer=").append(optimizer);
sb.append(", renderWeightsEveryNumEpochs=").append(renderWeightsEveryNumEpochs);
sb.append(", fanIn=").append(fanIn);
sb.append(", useRegularization=").append(useRegularization);
sb.append(", useAdaGrad=").append(useAdaGrad);
sb.append(", firstTimeThrough=").append(firstTimeThrough);
sb.append(", normalizeByInputRows=").append(normalizeByInputRows);
sb.append(", applySparsity=").append(applySparsity);
sb.append(", dropOut=").append(dropOut);
sb.append(", doMask=").append(doMask);
sb.append(", optimizationAlgo=").append(optimizationAlgo);
sb.append(", lossFunction=").append(lossFunction);
sb.append(", cacheInput=").append(cacheInput);
sb.append(", wGradient=").append(wGradient);
sb.append(", vBiasGradient=").append(vBiasGradient);
sb.append(", hBiasGradient=").append(hBiasGradient);
sb.append(", lastMiniBatchSize=").append(lastMiniBatchSize);
sb.append(", wAdaGrad=").append(wAdaGrad);
sb.append(", hBiasAdaGrad=").append(hBiasAdaGrad);
sb.append(", vBiasAdaGrad=").append(vBiasAdaGrad);
sb.append('}');
return sb.toString();
}
/**
* Copies params from the passed in network
* to this one
* @param n the network to copy
*/
public void update(BaseNeuralNetwork n) {
this.W = n.W;
this.normalizeByInputRows = n.normalizeByInputRows;
this.hBias = n.hBias;
this.vBias = n.vBias;
this.l2 = n.l2;
this.useRegularization = n.useRegularization;
this.momentum = n.momentum;
this.nHidden = n.nHidden;
this.nVisible = n.nVisible;
this.rng = n.rng;
this.sparsity = n.sparsity;
this.wAdaGrad = n.wAdaGrad;
this.hBiasAdaGrad = n.hBiasAdaGrad;
this.vBiasAdaGrad = n.vBiasAdaGrad;
this.optimizationAlgo = n.optimizationAlgo;
this.lossFunction = n.lossFunction;
this.cacheInput = n.cacheInput;
}
/**
* Load (using {@link ObjectInputStream}
* @param is the input stream to load from (usually a file)
*/
public void load(InputStream is) {
try {
ObjectInputStream ois = new ObjectInputStream(is);
BaseNeuralNetwork loaded = (BaseNeuralNetwork) ois.readObject();
update(loaded);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* Negative log likelihood of the current input given
* the corruption level
* @return the negative log likelihood of the auto encoder
* given the corruption level
*/
@Override
public double negativeLogLikelihood() {
DoubleMatrix z = this.reconstruct(input);
if(this.useRegularization) {
double reg = (2 / l2) * MatrixFunctions.pow(this.W,2).sum();
double ret = - input.mul(log(z)).add(
oneMinus(input).mul(log(oneMinus(z)))).
columnSums().mean() + reg;
if(this.normalizeByInputRows)
ret /= input.rows;
return ret;
}
double likelihood = - input.mul(log(z)).add(
oneMinus(input).mul(log(oneMinus(z)))).
columnSums().mean();
if(this.normalizeByInputRows)
likelihood /= input.rows;
return likelihood;
}
/**
* Negative log likelihood of the current input given
* the corruption level
* @return the negative log likelihood of the auto encoder
* given the corruption level
*/
public double negativeLoglikelihood(DoubleMatrix input) {
DoubleMatrix z = this.reconstruct(input);
if(this.useRegularization) {
double reg = (2 / l2) * MatrixFunctions.pow(this.W,2).sum();
return - input.mul(log(z)).add(
oneMinus(input).mul(log(oneMinus(z)))).
columnSums().mean() + reg;
}
return - input.mul(log(z)).add(
oneMinus(input).mul(log(oneMinus(z)))).
columnSums().mean();
}
/**
* Reconstruction entropy.
* This compares the similarity of two probability
* distributions, in this case that would be the input
* and the reconstructed input with gaussian noise.
* This will account for either regularization or none
* depending on the configuration.
* @return reconstruction error
*/
public double getReConstructionCrossEntropy() {
DoubleMatrix preSigH = input.mmul(W).addRowVector(hBias);
DoubleMatrix sigH = sigmoid(preSigH);
DoubleMatrix preSigV = sigH.mmul(W.transpose()).addRowVector(vBias);
DoubleMatrix sigV = sigmoid(preSigV);
DoubleMatrix inner =
input.mul(log(sigV))
.add(oneMinus(input)
.mul(log(oneMinus(sigV))));
double ret = inner.rowSums().mean();
if(normalizeByInputRows)
ret /= input.rows;
return ret;
}
@Override
public boolean normalizeByInputRows() {
return normalizeByInputRows;
}
/* (non-Javadoc)
* @see org.deeplearning4j.nn.NeuralNetwork#getnVisible()
*/
@Override
public int getnVisible() {
return nVisible;
}
/* (non-Javadoc)
* @see org.deeplearning4j.nn.NeuralNetwork#setnVisible(int)
*/
@Override
public void setnVisible(int nVisible) {
this.nVisible = nVisible;
}
/* (non-Javadoc)
* @see org.deeplearning4j.nn.NeuralNetwork#getnHidden()
*/
@Override
public int getnHidden() {
return nHidden;
}
/* (non-Javadoc)
* @see org.deeplearning4j.nn.NeuralNetwork#setnHidden(int)
*/
@Override
public void setnHidden(int nHidden) {
this.nHidden = nHidden;
}
/* (non-Javadoc)
* @see org.deeplearning4j.nn.NeuralNetwork#getW()
*/
@Override
public DoubleMatrix getW() {
return W;
}
/* (non-Javadoc)
* @see org.deeplearning4j.nn.NeuralNetwork#setW(org.jblas.DoubleMatrix)
*/
@Override
public void setW(DoubleMatrix w) {
W = w;
}
/* (non-Javadoc)
* @see org.deeplearning4j.nn.NeuralNetwork#gethBias()
*/
@Override
public DoubleMatrix gethBias() {
return hBias;
}
/* (non-Javadoc)
* @see org.deeplearning4j.nn.NeuralNetwork#sethBias(org.jblas.DoubleMatrix)
*/
@Override
public void sethBias(DoubleMatrix hBias) {
this.hBias = hBias;
}
/* (non-Javadoc)
* @see org.deeplearning4j.nn.NeuralNetwork#getvBias()
*/
@Override
public DoubleMatrix getvBias() {
return vBias;
}
/* (non-Javadoc)
* @see org.deeplearning4j.nn.NeuralNetwork#setvBias(org.jblas.DoubleMatrix)
*/
@Override
public void setvBias(DoubleMatrix vBias) {
this.vBias = vBias;
}
/* (non-Javadoc)
* @see org.deeplearning4j.nn.NeuralNetwork#getRng()
*/
@Override
public RandomGenerator getRng() {
return rng;
}
/* (non-Javadoc)
* @see org.deeplearning4j.nn.NeuralNetwork#setRng(org.apache.commons.math3.random.RandomGenerator)
*/
@Override
public void setRng(RandomGenerator rng) {
this.rng = rng;
}
/* (non-Javadoc)
* @see org.deeplearning4j.nn.NeuralNetwork#getInput()
*/
@Override
public DoubleMatrix getInput() {
return input;
}
/* (non-Javadoc)
* @see org.deeplearning4j.nn.NeuralNetwork#setInput(org.jblas.DoubleMatrix)
*/
@Override
public void setInput(DoubleMatrix input) {
this.input = input;
}
public double getSparsity() {
return sparsity;
}
public void setSparsity(double sparsity) {
this.sparsity = sparsity;
}
public double getMomentum() {
return momentum;
}
public void setMomentum(double momentum) {
this.momentum = momentum;
}
public double getL2() {
return l2;
}
public void setL2(double l2) {
this.l2 = l2;
}
@Override
public AdaGrad gethBiasAdaGrad() {
return hBiasAdaGrad;
}
@Override
public void setHbiasAdaGrad(AdaGrad adaGrad) {
this.hBiasAdaGrad = adaGrad;
}
@Override
public AdaGrad getVBiasAdaGrad() {
return this.vBiasAdaGrad;
}
@Override
public void setVBiasAdaGrad(AdaGrad adaGrad) {
this.vBiasAdaGrad = adaGrad;
}
/**
* Write this to an object output stream
* @param os the output stream to write to
*/
public void write(OutputStream os) {
try {
ObjectOutputStream os2 = new ObjectOutputStream(os);
os2.writeObject(this);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
/**
* All neural networks are based on this idea of
* minimizing reconstruction error.
* Both RBMs and Denoising AutoEncoders
* have a component for reconstructing, ala different implementations.
*
* @param x the input to reconstruct
* @return the reconstructed input
*/
public abstract DoubleMatrix reconstruct(DoubleMatrix x);
/**
* The loss function (cross entropy, reconstruction error,...)
* @return the loss function
*/
public abstract double lossFunction(Object[] params);
public double lossFunction() {
return lossFunction(null);
}
protected void applyDropOutIfNecessary(DoubleMatrix input) {
if(dropOut > 0)
this.doMask = DoubleMatrix.rand(input.rows, this.nHidden).gt(dropOut);
else
this.doMask = DoubleMatrix.ones(input.rows,this.nHidden);
}
/**
* train one iteration of the network
* @param input the input to train on
* @param lr the learning rate to train at
* @param params the extra params (k, corruption level,...)
*/
@Override
public abstract void train(DoubleMatrix input,double lr,Object[] params);
@Override
public double squaredLoss() {
DoubleMatrix squaredDiff = pow(reconstruct(input).sub(input),2);
double loss = squaredDiff.columnSums().sum() / input.rows;
if(this.useRegularization) {
loss += 0.5 * l2 * MatrixFunctions.pow(W,2).sum();
}
return loss;
}
@Override
public double mse() {
DoubleMatrix reconstructed = reconstruct(input);
DoubleMatrix diff = reconstructed.sub(input);
double sum = 0.5 * MatrixFunctions.pow(diff,2).columnSums().sum() / input.rows;
return sum;
}
@Override
public DoubleMatrix hBiasMean() {
DoubleMatrix hbiasMean = getInput().mmul(getW()).addRowVector(gethBias());
return hbiasMean;
}
@Override
public void epochDone(int epoch) {
int plotEpochs = getRenderEpochs();
if(plotEpochs <= 0)
return;
if(epoch % plotEpochs == 0 || epoch == 0) {
NeuralNetPlotter plotter = new NeuralNetPlotter();
plotter.plotNetworkGradient(this,this.getGradient(new Object[]{1,0.001,1000}),getInput().rows);
}
}
public static class Builder<E extends BaseNeuralNetwork> {
private E ret = null;
private DoubleMatrix W;
protected Class<? extends NeuralNetwork> clazz;
private DoubleMatrix vBias;
private DoubleMatrix hBias;
private int numVisible;
private int numHidden;
private RandomGenerator gen = new MersenneTwister(123);
private DoubleMatrix input;
private double sparsity = 0.01;
private double l2 = 0.01;
private double momentum = 0.5;
private int renderWeightsEveryNumEpochs = -1;
private double fanIn = 0.1;
private boolean useRegularization = false;
private RealDistribution dist;
private boolean useAdaGrad = true;
private boolean applySparsity = false;
private boolean normalizeByInputRows = true;
private double dropOut = 0;
private LossFunction lossFunction = LossFunction.RECONSTRUCTION_CROSSENTROPY;
private OptimizationAlgorithm optimizationAlgo = OptimizationAlgorithm.CONJUGATE_GRADIENT;
private boolean cacheInput = true;
public Builder<E> cacheInput(boolean cacheInput) {
this.cacheInput = cacheInput;
return this;
}
public Builder<E> applySparsity(boolean applySparsity) {
this.applySparsity = applySparsity;
return this;
}
public Builder<E> withOptmizationAlgo(OptimizationAlgorithm optimizationAlgo) {
this.optimizationAlgo = optimizationAlgo;
return this;
}
public Builder<E> withLossFunction(LossFunction lossFunction) {
this.lossFunction = lossFunction;
return this;
}
public Builder<E> withDropOut(double dropOut) {
this.dropOut = dropOut;
return this;
}
public Builder<E> normalizeByInputRows(boolean normalizeByInputRows) {
this.normalizeByInputRows = normalizeByInputRows;
return this;
}
public Builder<E> useAdaGrad(boolean useAdaGrad) {
this.useAdaGrad = useAdaGrad;
return this;
}
public Builder<E> withDistribution(RealDistribution dist) {
this.dist = dist;
return this;
}
public Builder<E> useRegularization(boolean useRegularization) {
this.useRegularization = useRegularization;
return this;
}
public Builder<E> fanIn(double fanIn) {
this.fanIn = fanIn;
return this;
}
public Builder<E> withL2(double l2) {
this.l2 = l2;
return this;
}
public Builder<E> renderWeights(int numEpochs) {
this.renderWeightsEveryNumEpochs = numEpochs;
return this;
}
@SuppressWarnings("unchecked")
public E buildEmpty() {
try {
return (E) clazz.newInstance();
} catch (InstantiationException | IllegalAccessException e) {
throw new RuntimeException(e);
}
}
public Builder<E> withClazz(Class<? extends BaseNeuralNetwork> clazz) {
this.clazz = clazz;
return this;
}
public Builder<E> withSparsity(double sparsity) {
this.sparsity = sparsity;
return this;
}
public Builder<E> withMomentum(double momentum) {
this.momentum = momentum;
return this;
}
public Builder<E> withInput(DoubleMatrix input) {
this.input = input;
return this;
}
public Builder<E> asType(Class<E> clazz) {
this.clazz = clazz;
return this;
}
public Builder<E> withWeights(DoubleMatrix W) {
this.W = W;
return this;
}
public Builder<E> withVisibleBias(DoubleMatrix vBias) {
this.vBias = vBias;
return this;
}
public Builder<E> withHBias(DoubleMatrix hBias) {
this.hBias = hBias;
return this;
}
public Builder<E> numberOfVisible(int numVisible) {
this.numVisible = numVisible;
return this;
}
public Builder<E> numHidden(int numHidden) {
this.numHidden = numHidden;
return this;
}
public Builder<E> withRandom(RandomGenerator gen) {
this.gen = gen;
return this;
}
public E build() {
return buildWithInput();
}
@SuppressWarnings("unchecked")
private E buildWithInput() {
Constructor<?>[] c = clazz.getDeclaredConstructors();
for(int i = 0; i < c.length; i++) {
Constructor<?> curr = c[i];
curr.setAccessible(true);
Class<?>[] classes = curr.getParameterTypes();
//input matrix found
if(classes != null && classes.length > 0 && classes[0].isAssignableFrom(DoubleMatrix.class)) {
try {
ret = (E) curr.newInstance(input,numVisible, numHidden, W, hBias,vBias, gen,fanIn,dist);
ret.cacheInput = cacheInput;
ret.sparsity = this.sparsity;
ret.applySparsity = this.applySparsity;
ret.normalizeByInputRows = this.normalizeByInputRows;
ret.renderWeightsEveryNumEpochs = this.renderWeightsEveryNumEpochs;
ret.l2 = this.l2;
ret.momentum = this.momentum;
ret.useRegularization = this.useRegularization;
ret.useAdaGrad = this.useAdaGrad;
ret.dropOut = this.dropOut;
ret.optimizationAlgo = this.optimizationAlgo;
ret.lossFunction = this.lossFunction;
return ret;
}catch(Exception e) {
throw new RuntimeException(e);
}
}
}
return ret;
}
}
}
| [
"agibson@clevercloudcomputing.com"
] | agibson@clevercloudcomputing.com |
016fc92dc3eadd7e2a9193a6e9cc91595a0b2b06 | 84f818927d7379ed049047aadb4faf3828c82cbf | /Application_programming_in_java/Class_stuff/Class_7/src/main/java/demo/SimpleQuery1.java | 9b945b4eb826de2ec501c5a9b77a36fbd9f78173 | [] | no_license | joettcrow/University_of_Washington | 00c667c3bff1ebb871f5becf06d0325bea02a76b | 59fcd9c0fb3ab61d432d023963c010bdb3e50238 | refs/heads/master | 2020-03-10T20:10:27.490849 | 2018-09-10T23:08:44 | 2018-09-10T23:08:44 | 129,564,659 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,126 | java | package demo;
import java.sql.SQLException;
import java.util.List;
import util.Contact;
public class SimpleQuery1
{
public static void main(String[] args)
{
Contact[] contacts =
{
new Contact( "Smith", "John", "1111111", "partyAnimal" ),
new Contact( "Jones", "Jessica", "2222222", "deepThinker" ),
new Contact( "Jackson", "Janet", "3333333", "litigator" ),
new Contact( "Kelly", "Gene", "4444444", "prancer" ),
};
try
{
ContactTable mgr = new ContactTable();
mgr.truncateTable();
for ( Contact contact : contacts )
mgr.insertContact( contact );
dumpContacts( mgr );
}
catch ( SQLException exc )
{
exc.printStackTrace();
System.exit( 1 );
}
}
private static void dumpContacts( ContactTable mgr )
throws SQLException
{
List<Contact> list = mgr.getAllContacts();
list.forEach( System.out::println );
}
}
| [
"jcrowley@indeed.com"
] | jcrowley@indeed.com |
d51fa22c81f325cf7c983e3b2c3d1a0066ec8782 | fa65423799abd17783cf7e019e2267494e08b846 | /service-users/src/main/java/br/com/lucimarsb/ecommerce/BatchSendMessageService.java | 20e55a2eb220512dc2ca41f9531df4bb77420e0d | [] | no_license | lucimarsb/ecommerce | f9e355498be083bfb7991d12ee7a2d2790170904 | f1bac70daaeb652477c6aefd9de9c623ea55399a | refs/heads/main | 2023-08-11T19:18:53.314387 | 2021-10-12T05:33:49 | 2021-10-12T05:33:49 | 408,598,502 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,741 | java | package br.com.lucimarsb.ecommerce;
import br.com.lucimarsb.ecommerce.consumer.KafkaService;
import br.com.lucimarsb.ecommerce.dispatcher.KafkaDispatcher;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutionException;
public class BatchSendMessageService {
private final Connection connection;
public BatchSendMessageService() throws SQLException {
String url = "jdbc:sqlite:target/users_database.db";
connection = DriverManager.getConnection(url);
try {
connection.prepareStatement("SELECT * FROM Users");
return;
} catch (SQLException e) {
connection.createStatement().execute("create table Users(" +
"uuid varchar(200) primary key," +
"email varchar(200))");
}
}
public static void main(String[] args) throws SQLException, ExecutionException, InterruptedException {
var batchService = new BatchSendMessageService();
try (var service = new KafkaService<>(BatchSendMessageService.class.getSimpleName(),
"ECOMMERCE_SEND_MESSAGE_TO_ALL_USERS",
batchService::parse,
Map.of())) {
service.run();
}
}
private final KafkaDispatcher<User> userDispatcher = new KafkaDispatcher<>();
private void parse(ConsumerRecord<String, Message<String>> record) throws ExecutionException, InterruptedException, SQLException {
System.out.println("________________________________________");
System.out.println("Processando novo lote!");
var message = record.value();
System.out.println("Topic: " + message.getPayload());
for (User user : getAllUsers()) {
// Sincrona
userDispatcher.send(message.getPayload(), user.getUuId(), message.getId().continueWith(BatchSendMessageService.class.getSimpleName()), user);
System.out.println("Enviei para " + user);
// Assincrona
// userDispatcher.sendAsync(message.getPayload(), user.getUuId(), message.getId().continueWith(BatchSendMessageService.class.getSimpleName()), user);
// System.out.println("Acho que enviei para " + user);
}
}
private List<User> getAllUsers() throws SQLException {
var results = connection.prepareStatement("select uuid from Users").executeQuery();
List<User> users = new ArrayList<>();
while (results.next()) {
users.add(new User(results.getString(1)));
}
return users;
}
}
| [
"lucimar.santos@cabal.com.br"
] | lucimar.santos@cabal.com.br |
db24a7222744368d363f4b30a478fe1c7061f8da | 29d1d260cc822b0c0281482d151331d92996ec89 | /app/src/main/java/com/partnerx/roboth_server/HelpActivity.java | edde2613c0ea4573d3f2afda51d7d34e09a9b64a | [] | no_license | guanqingguang0914/GroupCortorl_H_Server | 35e195320b048087a54c492515b66e68de647e45 | 0461c3bb1a652b4108ec5081a170c4bb4f1ab2e0 | refs/heads/master | 2023-09-01T10:07:57.845317 | 2018-12-05T05:21:28 | 2018-12-05T05:21:28 | 160,465,142 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,963 | java | package com.partnerx.roboth_server;
import android.app.Activity;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.ScrollView;
import android.widget.TextView;
public class HelpActivity extends Activity {
private ImageView back;
private ScrollView scrollView;
private TextView help;
private TextView title;
// /////总图
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_help);
scrollView = (ScrollView) findViewById(R.id.scrollViewH);
help = (TextView) findViewById(R.id.helpH);
title = (TextView) findViewById(R.id.titleH);;
String titleStr = getString(R.string.help1);
String str = null;
try {
str = " "+getString(R.string.help2)+ " \n"+
" "+ getString(R.string.help3)+ " \n"+
" "+ getString(R.string.help4)+ " \n"+
" "+ getString(R.string.help5)+ " \n"+
" "+ getString(R.string.help6)+ " \n"+
" "+ getString(R.string.help7)+ " \n"+
" "+ getString(R.string.help8) + " \n"+" \n"+
" " + getPackageManager().getPackageInfo(this.getPackageName(),0).versionName;
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
}
title.setText(titleStr);
help.setText(str);
titleStr = null;
str = null;
back = (ImageView) findViewById(R.id.backH);
back.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
finish();
}
});
}
protected void onDestroy() {
super.onDestroy();
finish();
}
}
| [
"guanqingguang0914@163.com"
] | guanqingguang0914@163.com |
076e4ef6d4d8cd8b96558409b2904d5b0ff2cb36 | 6b9bfd4b76a34ed98a598853e6481856a1480e99 | /src/main/java/abstract_factory/exercise_01/FastPathFinder.java | c5e7606fe3815af005077dfa603d6d28c55d37bc | [] | no_license | woosanguk/java-oop-design-pattern | 1c734b5dc67bb3c9c3ed4b9ee5feb6646a35feff | a0682f9584d0258ec83dbcdb890b873252fc1c82 | refs/heads/master | 2021-08-24T05:11:21.554308 | 2017-12-08T05:47:04 | 2017-12-08T05:47:04 | 110,225,463 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 220 | java | package abstract_factory.exercise_01;
public class FastPathFinder extends PathFinder {
public Path findPath(Location from, Location to) {
System.out.println("Fast Path Finder");
return null;
}
}
| [
"baofree.uk@gamil.com"
] | baofree.uk@gamil.com |
20ceda5145ee6d53ec24a3769f8683b5e33c996e | 0b934ab6559d13d1aac621770122599efb0f63f8 | /Rogue/src/com/peter/rogue/views/UI.java | d1bf5dec75aad7b5578afcdc7357ab561eb5f549 | [] | no_license | powerc9000/Pragma | cd18459c91617deb148875df7f38aa26f2e788c8 | 822e4a49e6fb1d03afe56b7578be47c0611e213d | refs/heads/master | 2021-01-18T09:27:43.449979 | 2013-12-01T09:37:24 | 2013-12-01T09:37:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,895 | java | package com.peter.rogue.views;
import java.util.HashMap;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL10;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer.ShapeType;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.math.Vector3;
import com.peter.entities.Entity;
import com.peter.entities.NPC;
import com.peter.entities.Player;
import com.peter.entities.Shopkeep;
import com.peter.inventory.Chest;
import com.peter.map.Map;
import com.peter.packets.MPPlayer;
import com.peter.rogue.Global;
import com.peter.rogue.screens.Play;
public class UI{
private Texture texture1 = new Texture(Gdx.files.internal("img/guiLeftTest.png"));
private Texture texture2 = new Texture(Gdx.files.internal("img/guiRightTest.png"));
public static HashMap<Vector3, Entity> screenMarks;
private Vector2 screenCoord;
public UI(Player player){
screenMarks = new HashMap<Vector3, Entity>();
}
public void draw(Player player){
// Draws the messages and statuses on top of everything
for(NPC npc : Play.map.npcs.values()){
if(npc.canDraw){
if(npc.messageFlag){
Global.mapShapes.begin(ShapeType.Filled);
Global.mapShapes.setColor(0, 0f, 0, 1f);
Global.mapShapes.rect(npc.getX(), npc.getY() - 17, Global.font.getBounds(npc.getMessage()).width, Global.font.getLineHeight());
Global.mapShapes.end();
}
if(npc.statusFlag){
Global.mapShapes.begin(ShapeType.Filled);
if(npc.getStatus() == 0)
Global.mapShapes.setColor(0f, 0f, .6f, 1f);
else if(npc.getStatus() < 0)
Global.mapShapes.setColor(.4f, 0f, 0f, 1f);
else if(npc.getStatus() > 0)
Global.mapShapes.setColor(0f, .4f, 0f, 1f);
Global.mapShapes.circle(npc.getX(), npc.getY() + 20, 13);
Global.mapShapes.end();
Global.mapShapes.begin(ShapeType.Line);
Global.mapShapes.setColor(0f, 0f, 0f, 1f);
Global.mapShapes.circle(npc.getX(), npc.getY() + 20, 13);
Global.mapShapes.end();
}
Play.map.getSpriteBatch().begin();
Global.font.draw(Play.map.getSpriteBatch(), npc.getMessage(), npc.getX(), npc.getY());
if(npc.getStatus() != null)
if(Math.abs(npc.getStatus()) < 10)
Global.font.draw(Play.map.getSpriteBatch(), ((Integer)(Math.abs(npc.getStatus()))).toString(), npc.getX() - 4, npc.getY() + 26);
else
Global.font.draw(Play.map.getSpriteBatch(), ((Integer)(Math.abs(npc.getStatus()))).toString(), npc.getX() - 7, npc.getY() + 26);
Play.map.getSpriteBatch().end();
}
}
for(MPPlayer mpPlayer : Play.map.players.values()){
if(mpPlayer.canDraw){
if(mpPlayer.statusFlag){
Global.mapShapes.begin(ShapeType.Filled);
if(mpPlayer.getStatus() == 0)
Global.mapShapes.setColor(0f, 0f, .6f, 1f);
else if(mpPlayer.getStatus() < 0)
Global.mapShapes.setColor(.4f, 0f, 0f, 1f);
else if(mpPlayer.getStatus() > 0)
Global.mapShapes.setColor(0f, .4f, 0f, 1f);
Global.mapShapes.circle(mpPlayer.getX(), mpPlayer.getY() + 20, 13);
Global.mapShapes.end();
Global.mapShapes.begin(ShapeType.Line);
Global.mapShapes.setColor(0f, 0f, 0f, 1f);
Global.mapShapes.circle(mpPlayer.getX(), mpPlayer.getY() + 20, 13);
Global.mapShapes.end();
}
Play.map.getSpriteBatch().begin();
Global.font.draw(Play.map.getSpriteBatch(), mpPlayer.getMessage(), mpPlayer.getX(), mpPlayer.getY());
if(mpPlayer.getStatus() != null)
if(Math.abs(mpPlayer.getStatus()) < 10)
Global.font.draw(Play.map.getSpriteBatch(), ((Integer)(Math.abs(mpPlayer.getStatus()))).toString(), mpPlayer.getX() - 4, mpPlayer.getY() + 26);
else
Global.font.draw(Play.map.getSpriteBatch(), ((Integer)(Math.abs(mpPlayer.getStatus()))).toString(), mpPlayer.getX() - 7, mpPlayer.getY() + 26);
Play.map.getSpriteBatch().end();
}
}
if(player.messageFlag){
Global.mapShapes.begin(ShapeType.Filled);
Global.mapShapes.setColor(0, 0, 0, 1f);
Global.mapShapes.rect(player.getX(), player.getY() - 17, Global.font.getBounds(player.getMessage()).width, Global.font.getLineHeight());
Global.mapShapes.end();
}
if(player.statusFlag){
Global.mapShapes.begin(ShapeType.Filled);
if(player.getStatus() == 0)
Global.mapShapes.setColor(0f, 0f, .6f, 1f);
else if(player.getStatus() < 0)
Global.mapShapes.setColor(.4f, 0f, 0f, 1f);
else if(player.getStatus() > 0)
Global.mapShapes.setColor(0f, .4f, 0f, 1f);
Global.mapShapes.circle(player.getX(), player.getY() + 20, 13);
Global.mapShapes.end();
}
Play.map.getSpriteBatch().begin();
Global.font.draw(Play.map.getSpriteBatch(), player.getMessage(), player.getX(), player.getY());
if(player.getStatus() != null)
if(Math.abs(player.getStatus()) < 10)
Global.font.draw(Play.map.getSpriteBatch(), ((Integer)(Math.abs(player.getStatus()))).toString(), player.getX() - 4, player.getY() + 26);
else
Global.font.draw(Play.map.getSpriteBatch(), ((Integer)(Math.abs(player.getStatus()))).toString(), player.getX() - 7, player.getY() + 26);
Play.map.getSpriteBatch().end();
Global.screenShapes.begin(ShapeType.Filled);
Global.screenShapes.setColor(0, 0, 0, 1f);
Global.screenShapes.rect(0, 0, Global.SCREEN_WIDTH, 100f);
Global.screenShapes.end();
Global.screenShapes.begin(ShapeType.Line);
Global.screenShapes.setColor(Color.DARK_GRAY);
Global.screenShapes.line(0, 100f, Global.SCREEN_WIDTH, 100f);
Global.screenShapes.end();
display(Global.screen, player);
if(player.isMenuActive()){
screenCoord = new Vector2(Gdx.input.getX(), (Gdx.input.getY() * -1 + Global.SCREEN_HEIGHT));
if(player.getMenu().equals("Inventory")){
player.getInventory().display(Global.screen, Global.font, screenCoord, player);
}
else if(player.getMenu().equals("Chest")){
player.getInventory().setTrade(((Chest)(player.getMenuObject())));
((Chest)(player.getMenuObject())).setTrade(player);
player.getInventory().display(Global.screen, Global.font, screenCoord, player);
((Chest)(player.getMenuObject())).display(Global.screen, Global.font, screenCoord);
}
else if(player.getMenu().equals("Barter")){
player.getInventory().setTrade(((Shopkeep)(player.getMenuObject())));
((Shopkeep)(player.getMenuObject())).setTrade(player);
player.getInventory().display(Global.screen, Global.font, screenCoord, player);
((Shopkeep)(player.getMenuObject())).display(Global.screen, Global.font, screenCoord);
}
else if(player.getMenu().equals("Chat")){
Gdx.gl.glEnable(GL10.GL_BLEND);
Gdx.gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);
Global.screenShapes.begin(ShapeType.Filled);
Global.screenShapes.setColor(.1f, .1f, .1f, .9f);
Global.screenShapes.rect(200, 150, Global.SCREEN_WIDTH-400, 50);
Global.screenShapes.end();
Global.screenShapes.begin(ShapeType.Line);
Global.screenShapes.setColor(0.25f, 0.25f, 0.25f, 1);
Global.screenShapes.rect(200, 150, Global.SCREEN_WIDTH-400, 50);
Global.screenShapes.end();
Gdx.gl.glDisable(GL10.GL_BLEND);
Global.screen.begin();
Global.gothicFont.setScale(1.1f);
Global.gothicFont.draw(Global.screen, player.getMessageBuffer(), (Global.SCREEN_WIDTH/2) - Global.font.getBounds(player.getMessageBuffer()).width/1.3f, 208);
Global.gothicFont.setScale(1f);
Global.screen.end();
}
}
else
player.getInventory().setTrade(null);
update(Gdx.graphics.getDeltaTime());
}
public void update(float delta){
}
public void display(SpriteBatch spriteBatch, Player player){
spriteBatch.begin();
spriteBatch.draw(texture1, 0, 0);
spriteBatch.draw(texture2, Global.SCREEN_WIDTH - 179, 0);
spriteBatch.draw(player.getPicture(), 200, 15);
Global.gothicFont.setScale(1f);
Global.gothicFont.draw(spriteBatch, player.getName(), 280, 90);
Global.gothicFont.setScale(.7f);
if(player.getStats().getPoints() > 0){
Global.gothicFont.setColor(Color.GREEN);
Global.gothicFont.draw(spriteBatch, "Level: " + player.getStats().getLevel(), 280, 50);
Global.gothicFont.setColor(Color.WHITE);
}
else
Global.gothicFont.draw(spriteBatch, "Level: " + player.getStats().getLevel(), 280, 50);
Global.gothicFont.draw(spriteBatch, "Hitpoints: " + player.getStats().getHitpoints() + "/" + player.getStats().getMaxHitpoints(), 430, 50);
Global.gothicFont.draw(spriteBatch, "Experience: " + player.getStats().getExperience(), 430, 80);
Global.gothicFont.draw(spriteBatch, "Demeanor: ", 670, 80);
if(player.isHostile())
Global.gothicFont.draw(spriteBatch, "Hostile", 755, 80);
else
Global.gothicFont.draw(spriteBatch, "Friendly", 755, 80);
Global.gothicFont.draw(spriteBatch, "Floor: " + Map.getFloor(), 670, 50);
spriteBatch.end();
}
public void dispose(){
}
}
| [
"peter.jacobsen55@gmail.com"
] | peter.jacobsen55@gmail.com |
14b8d87fa3f59f173bdc780a7424e8bdd484bff9 | 5af214d95f78074ceb3c40c5e64a0c42bf13ee49 | /src/easybooking/server/payingGateway/MastercardAdapter.java | ba951484cccb034ae3a95eeceb454f56359774b5 | [] | no_license | Taumoutsh/EasyBooking_Server | 719ea1861971c4e3d77251ac9f982b514c8e98cf | a43195acb0b68ab0f446d537f7665a1b5e1e0dca | refs/heads/master | 2020-09-12T00:53:35.452928 | 2020-01-12T21:21:06 | 2020-01-12T21:21:06 | 222,247,026 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 144 | java | package easybooking.server.payingGateway;
public class MastercardAdapter implements IPaymentAdapter {
public int pay() {
return 30;
}
}
| [
"sinan.thomas@gmail.com"
] | sinan.thomas@gmail.com |
b1d0994eb5b0b8aa735dd2f7b4c2db9266c418e1 | a9a4a49505040c2dbf0c3ed1ee8e8b4c38380e72 | /spring-aot/src/test/java/org/springframework/aot/context/bootstrap/generator/infrastructure/nativex/NativeSerializationEntryTests.java | ab6c3f9b29e33920f0a0a9e9f37d6cbea2433412 | [
"Apache-2.0",
"LicenseRef-scancode-generic-cla"
] | permissive | saki-osive/spring-native | bf9b798b259f8991718b77702c74fab4b7e5c347 | 32dbf6190ed6ad90dd638f5fdcb3b6e826fd75e4 | refs/heads/main | 2023-08-26T05:30:05.882182 | 2021-11-07T02:00:23 | 2021-11-07T02:00:23 | 425,388,113 | 0 | 0 | Apache-2.0 | 2021-11-07T01:36:10 | 2021-11-07T01:36:09 | null | UTF-8 | Java | false | false | 2,022 | java | /*
* Copyright 2019-2021 the original author or authors.
*
* 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
*
* https://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 org.springframework.aot.context.bootstrap.generator.infrastructure.nativex;
import org.junit.jupiter.api.Test;
import org.springframework.nativex.domain.serialization.SerializationDescriptor;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
/**
* Tests for {@link NativeSerializationEntry}.
*
* @author Sebastien Deleuze
*/
public class NativeSerializationEntryTests {
@Test
void ofTypeWithNull() {
assertThatIllegalArgumentException().isThrownBy(() -> NativeSerializationEntry.ofType(null));
}
@Test
void contributeType() {
SerializationDescriptor serializationDescriptor = new SerializationDescriptor();
NativeSerializationEntry.ofType(String.class).contribute(serializationDescriptor);
assertThat(serializationDescriptor.getSerializableTypes()).singleElement().isEqualTo(String.class.getName());
}
@Test
void ofTypeNameWithNull() {
assertThatIllegalArgumentException().isThrownBy(() -> NativeSerializationEntry.ofTypeName(null));
}
@Test
void contributeTypeName() {
SerializationDescriptor serializationDescriptor = new SerializationDescriptor();
NativeSerializationEntry.ofTypeName(String.class.getName()).contribute(serializationDescriptor);
assertThat(serializationDescriptor.getSerializableTypes()).singleElement().isEqualTo(String.class.getName());
}
}
| [
"snicoll@vmware.com"
] | snicoll@vmware.com |
db6a27d3d7d6e1cee356b4767790ec11e5c59069 | 8243a34ab28e6e77ffde6ec9567b83a93826b841 | /other/aj/fm/Tool.java | 0799256541858312ea75c446fadeb2d919bbde29 | [] | no_license | fire/tnf2 | c13465515b8b33849e78a434852aee6538f56287 | 6aead8a4b737014639814a69a573b47e036decec | refs/heads/master | 2021-01-19T13:53:44.396590 | 2006-11-07T18:51:35 | 2006-11-07T18:51:35 | 82,427,482 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,019 | java | package aj.fm;
import java.awt.BorderLayout;
import java.awt.Frame;
import java.awt.GridLayout;
import java.awt.Panel;
import java.awt.TextArea;
import java.awt.TextField;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.io.IOException;
import java.util.Vector;
import aj.misc.GmlPair;
public class Tool implements ActionListener {
private static String spellsFileName;
TextField RHCurr = new TextField(10);
TextField LHCurr = new TextField(10);
TextArea RHOptions = new TextArea(8, 25);
TextArea LHOptions = new TextArea(8, 25);
Vector allSpells = new Vector();
public static void main(String s[]) {
if (s.length == 0) {
System.out.println("usage: java - aj.fm.Tool <spells.gml>");
}
spellsFileName = s[0];
new Tool();
}
public Tool() {
Frame F = new Frame();
Panel p = new Panel(new GridLayout());
Panel pp = new Panel(new BorderLayout());
RHCurr.addActionListener(this);
LHCurr.addActionListener(this);
pp.add("North", RHCurr);
pp.add("Center", RHOptions);
p.add(pp);
pp = new Panel(new BorderLayout());
pp.add("North", LHCurr);
pp.add("Center", LHOptions);
p.add(pp);
F.add("Center", p);
readSpells();
F.pack();
F.setVisible(true);
}
public void actionPerformed(ActionEvent ae) {
RHOptions.setText(getOptionsFor(RHCurr.getText()));
LHOptions.setText(getOptionsFor(LHCurr.getText()));
}
public String getOptionsFor(String hand) {
String res = "";
for (int b = 1; b < 10; b++) {
// System.out.println("check all "+allSpells.size()+" spells");
for (int a = 0; a < allSpells.size(); a++) {
SpellOld sp = (SpellOld) allSpells.elementAt(a);
if (sp.getStepsFrom(hand) == b) {
res += sp.summaryString(hand, allSpells) + "\n";
Vector l = sp.includes(hand, allSpells);
for (int c = 0; c < l.size(); c++) {
res += "\tinc="
+ ((SpellOld) l.elementAt(c)).summaryString(hand,
allSpells) + "\n";
}
l = sp.choice(hand, allSpells);
for (int c = 0; c < l.size(); c++) {
res += "\tchoice="
+ ((SpellOld) l.elementAt(c)).summaryString(hand,
allSpells) + "\n";
}
l = sp.headStart(hand, allSpells);
for (int d = 0; d < 10; d++) {
for (int c = 0; c < l.size(); c++) {
SpellOld hs = (SpellOld) l.elementAt(c);
if (hs.getStepsFrom(hand + sp.gest) == d) {
res += "\ths="
+ ((SpellOld) l.elementAt(c))
.summaryString(sp.gest,
allSpells) + "\n";
}
}
}
}
}
}
return res;
}
public void readSpells() {
try {
GmlPair all = GmlPair.parse(new File(spellsFileName));
GmlPair gmlSpells[] = all.getAllByName("node");
for (int a = 0; a < gmlSpells.length; a++) {
SpellOld sp = SpellOld.parse(gmlSpells[a]);
if (sp.name.startsWith("descision"))
continue;
allSpells.addElement(sp);
}
} catch (IOException ioe) {
System.out.println("IO problem." + ioe);
System.exit(0);
}
}
}
| [
"flandar"
] | flandar |
a19472338109961d9146724d1cdc653084df1a0a | ea4f810ee8f08fbd096b09bc9f44f5ad687ae547 | /app/src/test/java/edu/gatech/robodroids/raindrop/JoshuaViszlaiUnitTest.java | 70edaafa75d7d2c1b834d8592e874c2cbc9b0783 | [] | no_license | RoboDroids-2340/CS2340-RainDrop | 0573eafb3ac1ad28e09edec922c08727dec6106f | 5c048d7fe44d1a2d53b8d137383e68d9f3531e50 | refs/heads/master | 2021-06-15T21:38:05.497134 | 2017-04-25T04:10:50 | 2017-04-25T04:10:50 | 78,888,058 | 0 | 0 | null | 2017-04-25T03:42:02 | 2017-01-13T21:28:18 | Java | UTF-8 | Java | false | false | 2,343 | java | package edu.gatech.robodroids.raindrop;
import junit.framework.Assert;
import org.junit.Test;
/**
* Created by jviszlai on 4/9/17.
*/
public class JoshuaViszlaiUnitTest {
@Test
public void validInputTest() {
QualityReportModel testReport =
ValidateQualityInput.inputToQualityReport(
"3.3", "3.2", "Treatable",
"100.1", "99.9", "Josh", "10371932");
Assert.assertNotNull(testReport);
Assert.assertEquals(testReport.getLat(), 3.3);
Assert.assertEquals(testReport.getLon(), 3.2);
Assert.assertEquals(testReport.getWaterCondition(), "Treatable");
Assert.assertEquals(testReport.getVirusPPM(), 100.1);
Assert.assertEquals(testReport.getContaminantPPM(), 99.9);
Assert.assertEquals(testReport.getReporterName(), "Josh");
Assert.assertEquals(testReport.getSubmissionTime(), "10371932");
}
@Test
public void nullInputTest() {
QualityReportModel testReport =
ValidateQualityInput.inputToQualityReport(
"3.3", "3.2", null,
"100,1", "99.9", "Josh", "10371932");
Assert.assertEquals(testReport, null);
}
@Test
public void nonNumericInputTest() {
QualityReportModel testReport1 =
ValidateQualityInput.inputToQualityReport(
"notNum", "3.2", "Treatable",
"100.1", "99.9", "Josh", "10371932");
QualityReportModel testReport2 =
ValidateQualityInput.inputToQualityReport(
"3.3", "notNum", "Treatable",
"100.1", "99.9", "Josh", "10371932");
QualityReportModel testReport3 =
ValidateQualityInput.inputToQualityReport(
"3.3", "3.2", "Treatable",
"notNum", "99.9", "Josh", "10371932");
QualityReportModel testReport4 =
ValidateQualityInput.inputToQualityReport(
"3.3", "3.2", "Treatable",
"100.1", "notNum", "Josh", "10371932");
Assert.assertEquals(testReport1, null);
Assert.assertEquals(testReport2, null);
Assert.assertEquals(testReport3, null);
Assert.assertEquals(testReport4, null);
}
}
| [
"viszlai@gatech.edu"
] | viszlai@gatech.edu |
1504f2db1a6cd6615e475f5e47e9d4cfa9ed12f0 | 9f204342f63c82b26908792c84144d80c67911cc | /src/org/omg/WorkflowModel/_WfResourceImplBase.java | 98852a03f1a6107eae272a41ef818d2e18e13487 | [] | no_license | kinnara-digital-studio/shark | eaada7bbb4ba976e1c876defdcab9d5ee15b81eb | 7abf690837152da11ddda360ad2436ec68c7bdb4 | refs/heads/master | 2023-03-16T07:27:02.867938 | 2013-05-05T13:12:25 | 2013-05-05T13:12:25 | null | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 5,708 | java | package org.omg.WorkflowModel;
/**
* org/omg/WorkflowModel/_WfResourceImplBase.java .
* 由 IDL-to-Java 编译器(可移植),版本 "3.2" 生成
* 来自 WorkflowModel.idl
* 2009年2月3日 星期二 下午05时32分29秒 CST
*/
public abstract class _WfResourceImplBase extends org.omg.CORBA.portable.ObjectImpl
implements org.omg.WorkflowModel.WfResource, org.omg.CORBA.portable.InvokeHandler
{
// Constructors
public _WfResourceImplBase ()
{
}
private static java.util.Hashtable _methods = new java.util.Hashtable ();
static
{
_methods.put ("how_many_work_item", new java.lang.Integer (0));
_methods.put ("get_iterator_work_item", new java.lang.Integer (1));
_methods.put ("get_sequence_work_item", new java.lang.Integer (2));
_methods.put ("is_member_of_work_items", new java.lang.Integer (3));
_methods.put ("resource_key", new java.lang.Integer (4));
_methods.put ("resource_name", new java.lang.Integer (5));
_methods.put ("release", new java.lang.Integer (6));
}
public org.omg.CORBA.portable.OutputStream _invoke (String $method,
org.omg.CORBA.portable.InputStream in,
org.omg.CORBA.portable.ResponseHandler $rh)
{
org.omg.CORBA.portable.OutputStream out = null;
java.lang.Integer __method = (java.lang.Integer)_methods.get ($method);
if (__method == null)
throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
switch (__method.intValue ())
{
case 0: // WorkflowModel/WfResource/how_many_work_item
{
try {
int $result = (int)0;
$result = this.how_many_work_item ();
out = $rh.createReply();
out.write_long ($result);
} catch (org.omg.WfBase.BaseException $ex) {
out = $rh.createExceptionReply ();
org.omg.WfBase.BaseExceptionHelper.write (out, $ex);
}
break;
}
case 1: // WorkflowModel/WfResource/get_iterator_work_item
{
try {
org.omg.WorkflowModel.WfAssignmentIterator $result = null;
$result = this.get_iterator_work_item ();
out = $rh.createReply();
org.omg.WorkflowModel.WfAssignmentIteratorHelper.write (out, $result);
} catch (org.omg.WfBase.BaseException $ex) {
out = $rh.createExceptionReply ();
org.omg.WfBase.BaseExceptionHelper.write (out, $ex);
}
break;
}
case 2: // WorkflowModel/WfResource/get_sequence_work_item
{
try {
int max_number = in.read_long ();
org.omg.WorkflowModel.WfAssignment $result[] = null;
$result = this.get_sequence_work_item (max_number);
out = $rh.createReply();
org.omg.WorkflowModel.WfAssignmentSequenceHelper.write (out, $result);
} catch (org.omg.WfBase.BaseException $ex) {
out = $rh.createExceptionReply ();
org.omg.WfBase.BaseExceptionHelper.write (out, $ex);
}
break;
}
case 3: // WorkflowModel/WfResource/is_member_of_work_items
{
try {
org.omg.WorkflowModel.WfAssignment member = org.omg.WorkflowModel.WfAssignmentHelper.read (in);
boolean $result = false;
$result = this.is_member_of_work_items (member);
out = $rh.createReply();
out.write_boolean ($result);
} catch (org.omg.WfBase.BaseException $ex) {
out = $rh.createExceptionReply ();
org.omg.WfBase.BaseExceptionHelper.write (out, $ex);
}
break;
}
case 4: // WorkflowModel/WfResource/resource_key
{
try {
String $result = null;
$result = this.resource_key ();
out = $rh.createReply();
out.write_wstring ($result);
} catch (org.omg.WfBase.BaseException $ex) {
out = $rh.createExceptionReply ();
org.omg.WfBase.BaseExceptionHelper.write (out, $ex);
}
break;
}
case 5: // WorkflowModel/WfResource/resource_name
{
try {
String $result = null;
$result = this.resource_name ();
out = $rh.createReply();
out.write_wstring ($result);
} catch (org.omg.WfBase.BaseException $ex) {
out = $rh.createExceptionReply ();
org.omg.WfBase.BaseExceptionHelper.write (out, $ex);
}
break;
}
case 6: // WorkflowModel/WfResource/release
{
try {
org.omg.WorkflowModel.WfAssignment from_assigment = org.omg.WorkflowModel.WfAssignmentHelper.read (in);
String release_info = in.read_wstring ();
this.release (from_assigment, release_info);
out = $rh.createReply();
} catch (org.omg.WfBase.BaseException $ex) {
out = $rh.createExceptionReply ();
org.omg.WfBase.BaseExceptionHelper.write (out, $ex);
} catch (org.omg.WorkflowModel.NotAssigned $ex) {
out = $rh.createExceptionReply ();
org.omg.WorkflowModel.NotAssignedHelper.write (out, $ex);
}
break;
}
default:
throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
}
return out;
} // _invoke
// Type-specific CORBA::Object operations
private static String[] __ids = {
"IDL:omg.org/WorkflowModel/WfResource:1.0",
"IDL:omg.org/WfBase/BaseBusinessObject:1.0"};
public String[] _ids ()
{
return (String[])__ids.clone ();
}
} // class _WfResourceImplBase
| [
"classic1999@sina.com"
] | classic1999@sina.com |
1d8c09900b26549d7fd2709dab28f968721eea2f | 4bbd528933c4548f482a8d1f4655429f16c09dd2 | /Atividade/Veiculo.java | 46cd02990db5b9eeaf007ba36c24490fabfd4e45 | [] | no_license | danilomarcus/java1 | ca7a5908f1a920ea6497b5d6305935c37b0b803a | 91f48d0de79572fb9ea47c8a722a35f53438eb7d | refs/heads/master | 2021-01-20T04:32:56.053457 | 2014-03-24T22:02:33 | 2014-03-24T22:02:33 | null | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 1,817 | java | public class Veiculo {
private String marca;
private boolean ligado;
private int gasolina;
private String fabricante;
private boolean carroLigado;
private int combustivel;
public String getFabricante() {
return fabricante;
}
public void setFabricante(String fabricante) {
this.fabricante = fabricante;
}
public boolean isCarroLigado() {
return carroLigado;
}
public void setCarroLigado(boolean carroLigado) {
this.carroLigado = carroLigado;
}
public int getCombustivel() {
return combustivel;
}
public void setCombustivel(int combustivel) {
this.combustivel = combustivel;
}
public String getMarca() {
return marca;
}
public void setMarca(String marca) {
this.marca = marca;
}
public boolean isLigado() {
return ligado;
}
public void setLigado(boolean ligado) {
this.ligado = ligado;
}
public int getGasolina() {
return gasolina;
}
public void setGasolina(int gasolina) {
this.gasolina = gasolina;
}
/*
* TODO Cria Método viajar
*
* CRIAR O METODO viajar em que testa se o carro esta ligado e se a gasolina
* é maior que zero. Se estiver tudo OK com a gasolina e o carro estiver
* ligado deve imprimir a mensagem "viajando..."
*
* Verifique se este método deverá ter retorno ou parâmetros *
*/
public String viajar() {
String status = "";
if (this.ligado && this.gasolina < 10) { // ligado sem gasolina
status = "Abasteça o carro";
} else if (this.ligado && this.gasolina > 10) { // ligado e com gasolina
status = "Viajando";
} else if (!this.ligado && this.gasolina < 10) { // desligado e sem gasolina
status = "Abasteça e ligue o carro";
} else if (!this.ligado && this.gasolina > 10) {
status = "Ligue o carro"; // com gasolina e desligado
}
return status;
}
}
| [
"danpayne21@gmail.com"
] | danpayne21@gmail.com |
0eb585668e553a39958e56d42ba05360bc972099 | ca46d31ac6e4479f09b1c13ac60aa3bbc16e449d | /src/main/java/com/decision/engines/exporter/Application.java | 1872730172a6ffd88f33234db2f015603cb63689 | [] | no_license | qlikstar/JsonExporterService | 96de412c0b6a911d5fab45f456b8b54f48351e3f | 08eda890fea4eaa6303b217d1de2d9f0e9e88035 | refs/heads/master | 2020-04-21T18:33:31.115222 | 2019-02-11T07:33:50 | 2019-02-11T07:33:50 | 169,774,135 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 963 | java | package com.decision.engines.exporter;
import com.decision.engines.exporter.config.FileStorageConfig;
import org.modelmapper.ModelMapper;
import org.modelmapper.convention.MatchingStrategies;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableAsync;
@SpringBootApplication
@EnableAsync
@EnableConfigurationProperties({FileStorageConfig.class})
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
@Bean
public ModelMapper modelMapper() {
ModelMapper modelMapper = new ModelMapper();
modelMapper.getConfiguration().setMatchingStrategy(MatchingStrategies.LOOSE);
return modelMapper;
}
} | [
"smishra@zendesk.com"
] | smishra@zendesk.com |
7db5ed2b177b784514f9ba3b5aa66f1a5f74b884 | 06f1d0dfb621ed35ed462f1d3772faf965e5cf0e | /arctor-base/src/main/java/com/alapshin/arctor/delegate/ViewGroupMvpDelegateImpl.java | d22fd5aec3bf8936eaf55646d5139b147b710017 | [
"Apache-2.0"
] | permissive | alapshin/arctor | 8fc4182d46abd7b2c24d59f500081cbc0aecba43 | 6d8191ff7ccf6a8f2e8d3655a9a4abe25cb51033 | refs/heads/master | 2020-03-26T21:28:27.745010 | 2019-05-18T16:10:24 | 2019-05-18T16:20:36 | 39,699,952 | 3 | 0 | Apache-2.0 | 2019-05-18T16:20:38 | 2015-07-25T19:27:42 | Java | UTF-8 | Java | false | false | 1,328 | java | package com.alapshin.arctor.delegate;
import android.os.Parcelable;
import android.view.View;
import com.alapshin.arctor.presenter.Presenter;
import com.alapshin.arctor.view.MvpView;
public class ViewGroupMvpDelegateImpl<V extends MvpView, P extends Presenter<V>>
implements ViewGroupMvpDelegate<V, P> {
private MvpCallback<V, P> callback;
public ViewGroupMvpDelegateImpl(MvpCallback<V, P> callback) {
this.callback = callback;
}
@Override
public void onAttachedToWindow() {
callback.getPresenter().onCreate(null);
callback.getPresenter().attachView(callback.getMvpView());
}
@Override
public void onDetachedFromWindow() {
callback.getPresenter().detachView();
callback.getPresenter().onDestroy();
}
@Override
public void onWindowVisibilityChanges(int visibility) {
if (visibility == View.VISIBLE) {
callback.getPresenter().onStart();
callback.getPresenter().onResume();
} else if (visibility == View.GONE) {
callback.getPresenter().onPause();
callback.getPresenter().onStop();
}
}
@Override
public void onRestoreInstanceState(Parcelable state) {
}
@Override
public Parcelable onSaveInstanceState() {
return null;
}
}
| [
"alapshin@fastmail.com"
] | alapshin@fastmail.com |
367c3eea6f3dae8042e31c290741cffd10c6690b | bf2e7099f7749594eb36de0f7547462d1ee841d4 | /Fahz/app/src/main/java/br/com/avanade/fahz/fragments/requests/RequestDetailsFragment.java | 6f11a8d63295c9e39514839b2e96118c75b90b69 | [] | no_license | belarminoneto/fahz_android_flutter | 9212bdf2d5be74c190b034c9455a2a7b1814bc12 | a22848fd5d352257858a906e0dae1ac86e6eb2a7 | refs/heads/master | 2023-03-22T05:12:37.033318 | 2021-03-18T15:00:26 | 2021-03-18T15:00:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,509 | java | package br.com.avanade.fahz.fragments.requests;
import android.animation.Animator;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.daimajia.androidanimations.library.Techniques;
import com.daimajia.androidanimations.library.YoYo;
import java.util.ArrayList;
import java.util.List;
import br.com.avanade.fahz.R;
import br.com.avanade.fahz.controls.DateEditText;
import br.com.avanade.fahz.model.Request;
import br.com.avanade.fahz.model.response.RequestStep;
import br.com.avanade.fahz.util.Utils;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
public class RequestDetailsFragment extends Fragment {
@BindView(R.id.overlay)
ViewGroup mOverlay;
@BindView(R.id.content)
ViewGroup mContent;
@BindView(R.id.steps_list)
RecyclerView mStepsList;
@BindView(R.id.tv_request_title)
TextView mTvRequestTitle;
@BindView(R.id.tv_request_date)
TextView mTvRequestDate;
@BindView(R.id.tv_request_status)
TextView mTvRequestStatus;
Request request;
private YoYo.AnimatorCallback onFinishAnimationListener;
public static RequestDetailsFragment newInstance(Request request) {
RequestDetailsFragment fragment = new RequestDetailsFragment();
Bundle bundle = new Bundle();
bundle.putSerializable("request", request);
fragment.setArguments(bundle);
return fragment;
}
public void setOnFinishAnimationListener(YoYo.AnimatorCallback onFinishAnimationListener) {
this.onFinishAnimationListener = onFinishAnimationListener;
}
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
Bundle args = getArguments();
if (args != null) {
this.request = (Request) args.getSerializable("request");
}
View view = inflater.inflate(R.layout.fragment_request_details, container, false);
ButterKnife.bind(this, view);
if (request.getFinalResult() == Request.Result.PENDENT) {
view.findViewById(R.id.layout_see_more).setVisibility(View.GONE);
}
mOverlay.setVisibility(View.INVISIBLE);
mContent.setVisibility(View.INVISIBLE);
return view;
}
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
initHeader();
initStatusHistoryList();
startInitialAnimation();
}
private void initHeader() {
mTvRequestTitle.setText(request.getBehaviorDescription());
String date = getString(R.string.request_date) + DateEditText.parseTODate(request.getDate());
mTvRequestDate.setText(date);
mTvRequestStatus.setText(request.getStatus().description);
Context context = getContext();
if (context != null) {
if (request.getStatus().description.equals(context.getString(R.string.approved_request))) {
mTvRequestStatus.setBackgroundDrawable(ContextCompat.getDrawable(context, R.drawable.square_green_info_filled));
} else if (request.getStatus().description.equals(context.getString(R.string.pending_request))) {
mTvRequestStatus.setBackgroundDrawable(ContextCompat.getDrawable(context, R.drawable.square_yellow_info_filled));
} else {
mTvRequestStatus.setBackgroundDrawable(ContextCompat.getDrawable(context, R.drawable.square_red_info));
}
}
}
private void startInitialAnimation() {
YoYo.with(Techniques.FadeIn).onEnd(new YoYo.AnimatorCallback() {
@Override
public void call(Animator animator) {
mOverlay.setVisibility(View.VISIBLE);
YoYo.with(Techniques.SlideInUp).onStart(new YoYo.AnimatorCallback() {
@Override
public void call(Animator animator) {
mContent.setVisibility(View.VISIBLE);
}
}).duration(200).playOn(mContent);
}
}).duration(200).playOn(mOverlay);
}
private void initStatusHistoryList() {
if (this.request != null) {
List<RequestStep> steps = new ArrayList<>(request.getFlows());
//Collections.reverse(steps);
RequestStatusListAdapter requestStatusListAdapter = new RequestStatusListAdapter(getContext(), request, steps);
LinearLayoutManager layoutManager = new LinearLayoutManager(getContext());
mStepsList.setLayoutManager(layoutManager);
mStepsList.setAdapter(requestStatusListAdapter);
}
}
@OnClick(R.id.tv_see_more)
public void seeMoreClick(View view) {
String message = request.getMessage();
if(message == null || message.equals(""))
message = getString(R.string.no_approve_message);
Utils.showSimpleDialog(getString(R.string.reason_request_card_label), message, getString(R.string.close), getActivity(), null);
}
@OnClick(R.id.overlay)
public void overlayClick(View view) {
startCloseAnimation();
}
@OnClick(R.id.btn_close)
public void closeClick(View view) {
startCloseAnimation();
}
public void startCloseAnimation() {
YoYo.with(Techniques.SlideOutDown).onEnd(new YoYo.AnimatorCallback() {
@Override
public void call(Animator animator) {
mContent.setVisibility(View.INVISIBLE);
YoYo.with(Techniques.FadeOut).onEnd(new YoYo.AnimatorCallback() {
@Override
public void call(Animator animator) {
mOverlay.setVisibility(View.INVISIBLE);
if (onFinishAnimationListener != null) {
onFinishAnimationListener.call(animator);
}
}
}).duration(200).playOn(mOverlay);
}
}).duration(200).playOn(mContent);
}
}
| [
"dimarcelo984@gmail.com"
] | dimarcelo984@gmail.com |
076bd62f0a9abcc7146ef77c0fd864ab137f463b | 8ae8b10422f5d4ccafe138db133e7e4f65be500c | /055_WordInsideWord/src/WordInsideWord.java | eba488f5e662be291b414e421da2141584daea3c | [] | no_license | comet-fmat/exercises-java | 33bdf7bc5387e68e754e0fd7a13a444e1cbf3735 | c6c22f1e73d5b65e4d23de3871841202e3d95bfa | refs/heads/master | 2021-09-04T01:09:34.369075 | 2018-01-13T20:35:05 | 2018-01-13T20:35:05 | 112,857,981 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 797 | java |
import java.util.Scanner;
public class WordInsideWord {
public static void main(String[] args) {
Scanner reader = new Scanner(System.in);
//request a first word and request second word
//print if the second word is found or not inside the first word
//BEGIN SOLUTION
System.out.println("Type the first word: ");
String word1 = reader.nextLine();
System.out.println("Type the second word: ");
String word2 = reader.nextLine();
if(word1.indexOf(word2) != -1){
System.out.println("The word '"+word2+"' is found in the word '"+word1+"'.");
} else {
System.out.println("The word '"+word2+"' is not found in the word '"+word1+"'.");
}
//END SOLUTION
}
}
| [
"lordpdc@hotmail.com"
] | lordpdc@hotmail.com |
bbb852ed9537196680fca1c6195a4b21473478f8 | f840ea2386942de16db800c224f7c96989732392 | /code/src/eventspackage/EndVerdict.java | 3a33804f62cc98dd9d3f6a056bef09c8628eb4a4 | [] | no_license | adnaneh/SymErgy | 34d9011e8d4e095ada98012149c00f6e647c4b94 | 2db9cdcdb5ce52cef9a94f6d80cc0763f4b0dabf | refs/heads/main | 2023-01-28T19:12:21.635124 | 2020-12-09T13:59:58 | 2020-12-09T13:59:58 | 319,968,530 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 485 | java | package eventspackage;
import ressourcehr.Patient;
import ressourcehr.Physician;
import room.Room;
import visitorpattern.Visitor;
public class EndVerdict extends EventType {
public EndVerdict(Patient patient, Physician physician, Room room) {
super();
this.setType("ENDVERDICT");
this.setPatient(patient);
this.setPhysician(physician);
this.setLocation(room);
this.setBeginning(false);
}
@Override
public void accept(Visitor visitor) {
visitor.visit(this);
}
}
| [
"adnane.hamid@student.ecp.fr"
] | adnane.hamid@student.ecp.fr |
8e32070d97795ff8a1166f6445f9496e45ce6641 | 0a470a3b7032efac7cc0908667f620d6ca354175 | /src/main/java/de/lukweb/timetablebot/timetable/sql/TeachersSQL.java | deca30b604b654addfc75916502d2275bad9b6d4 | [
"MIT"
] | permissive | timetablebot/bot | cd86a9fefa3b4c58dbd1ea76a72c3ad448b36fe1 | 3ec1109668462ede0df34f52c54b1628e5df3b4f | refs/heads/master | 2021-11-19T01:29:09.781404 | 2021-09-24T09:51:54 | 2021-09-24T09:53:20 | 178,917,274 | 2 | 0 | MIT | 2021-08-23T21:01:12 | 2019-04-01T17:53:27 | Java | UTF-8 | Java | false | false | 2,174 | java | package de.lukweb.timetablebot.timetable.sql;
import de.lukweb.timetablebot.telegram.TelegramUser;
import org.jdbi.v3.core.Handle;
import org.jdbi.v3.core.statement.PreparedBatch;
import java.util.List;
import java.util.stream.Collectors;
public class TeachersSQL {
private Handle handle;
public TeachersSQL(Handle handle) {
this.handle = handle;
}
public void addMissingTeachers(List<String> names) {
PreparedBatch batch = handle.prepareBatch("INSERT IGNORE INTO teachers (name) VALUES (?)");
names.stream()
.filter(name -> !name.equals("") && !name.contains(","))
.map(String::toLowerCase)
.forEach(batch::add);
if (batch.size() > 0) {
batch.execute();
}
batch.close();
}
public List<String> getAll() {
return handle.select("SELECT `name` FROM teachers WHERE name NOT LIKE '%,%' OR name LIKE ''")
.mapTo(String.class)
.stream()
.map(String::toUpperCase)
.collect(Collectors.toList());
}
public List<String> loadTeachers(long chatid) {
return handle.select("SELECT tea.name FROM users_teachers usts " +
"LEFT JOIN teachers tea ON usts.teacher = tea.id " +
"WHERE user = ?", chatid)
.mapTo(String.class)
.stream()
.map(String::toLowerCase)
.collect(Collectors.toList());
}
public void saveTeachers(TelegramUser user) {
// Adding the missing teachers
addMissingTeachers(user.getTeachers());
long chatid = user.getChatid();
// Removing the old entries
handle.execute("DELETE FROM users_teachers WHERE user = ?", chatid);
// Adding the new ones
PreparedBatch batch = handle.prepareBatch("INSERT INTO users_teachers (user, teacher) " +
"VALUES (?, (SELECT id FROM teachers WHERE name = ?))");
user.getTeachers().forEach(teacher -> batch.add(chatid, teacher));
if (batch.size() > 0) {
batch.execute();
}
batch.close();
}
}
| [
"luk.bukkit@gmail.com"
] | luk.bukkit@gmail.com |
9237c4cfeee39c3692d0396e8ec26173def53017 | 570796c1e7ea97e8a23413f728dbc01370e9e5c0 | /developPlatform/.svn/pristine/dd/dd73084e09d6387213b3d77be265a76ab58bdca4.svn-base | 53a6a1281f90361a3e2227611c0a49c57ff4ebf8 | [] | no_license | DDengxin/gab | a56b462275516a1ce758927e4f19622eaaef24ad | 070f461f5d1d59b150145be561e92877dd78bff9 | refs/heads/master | 2022-12-13T10:16:43.739906 | 2020-09-02T06:30:35 | 2020-09-02T06:30:35 | 291,856,121 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 594 | package com.tengzhi.business.sc.pd.gcrw.service;
import com.tengzhi.base.jpa.dto.BaseDto;
import com.tengzhi.base.jpa.result.Result;
import com.tengzhi.base.jpa.service.BaseService;
import com.tengzhi.business.sc.task.sctack.model.MScScrw;
import com.tengzhi.business.sc.task.sctack.model.MScScrw.MScScrw_PK;
import com.tengzhi.business.sc.task.sctack.vo.MScScrwGxVo;
import java.io.IOException;
public interface GcrwkService extends BaseService<MScScrw, MScScrw_PK> {
Result getSrchScpdList(BaseDto baseDto) throws IOException;
Result updateRwGx(MScScrwGxVo vo)throws IOException;
}
| [
"1012838949.com"
] | 1012838949.com | |
32de41f12862d315c75e6a534facf9f992496efe | 7ef841751c77207651aebf81273fcc972396c836 | /cstream/src/main/java/com/loki/cstream/stubs/SampleClass4459.java | 34a6366b746b02844b4a4b079d49d711555e5a0d | [] | no_license | SergiiGrechukha/ModuleApp | e28e4dd39505924f0d36b4a0c3acd76a67ed4118 | 00e22d51c8f7100e171217bcc61f440f94ab9c52 | refs/heads/master | 2022-05-07T13:27:37.704233 | 2019-11-22T07:11:19 | 2019-11-22T07:11:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 274 | java | package com.loki.cstream.stubs;
public class SampleClass4459 {
private SampleClass4460 sampleClass;
public SampleClass4459(){
sampleClass = new SampleClass4460();
}
public String getClassName() {
return sampleClass.getClassName();
}
} | [
"sergey.grechukha@gmail.com"
] | sergey.grechukha@gmail.com |
e6621a057647713a22d44fc9cbb9b3ca9a7a367a | c32089a05e5c88f0ecba92546e9bbf460363cf9a | /src/guishapes/TriangleGUI.java | 8177d43d668270d38e21ccc0f46fc9e2994398f5 | [] | no_license | Mendenbarr/Shape-Calculator | 9974250c0731af379e6d3543adaf7a6b1fcff624 | f4bfe212f6a4cefbf0bb2ee537c352e25841e22c | refs/heads/master | 2020-07-22T20:53:06.985109 | 2019-10-09T15:19:49 | 2019-10-09T15:19:49 | 207,324,346 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,326 | java | /*
* 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 guishapes;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import shapecalculator.*;
/**
*
* @author 01048750
*/
public class TriangleGUI extends javax.swing.JFrame implements ActionListener {
/**
* Creates new form CircleGUI
*/
public TriangleGUI() {
initComponents();
InputButton.addActionListener(this);
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
InputLabel = new javax.swing.JLabel();
InputLabel1 = new javax.swing.JLabel();
Input2Label = new javax.swing.JLabel();
Side1Text = new javax.swing.JTextField();
Side2Text = new javax.swing.JTextField();
Side3Text = new javax.swing.JTextField();
PerimeterLabel = new javax.swing.JLabel();
AreaLabel = new javax.swing.JLabel();
InputButton = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setTitle("Triangle Calculator");
InputLabel.setText("Side 1: ");
InputLabel1.setText("Side 2: ");
Input2Label.setText("Side 3: ");
Side1Text.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
Side1TextActionPerformed(evt);
}
});
Side2Text.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
Side2TextActionPerformed(evt);
}
});
Side3Text.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
Side3TextActionPerformed(evt);
}
});
PerimeterLabel.setText("0: Perimeter");
PerimeterLabel.setToolTipText("");
AreaLabel.setText("0: Area");
InputButton.setText("Enter");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(AreaLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(PerimeterLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(Input2Label, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(InputLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(InputLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(Side1Text, javax.swing.GroupLayout.DEFAULT_SIZE, 136, Short.MAX_VALUE)
.addGap(79, 79, 79))
.addGroup(layout.createSequentialGroup()
.addComponent(Side3Text)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(InputButton)
.addContainerGap())
.addGroup(layout.createSequentialGroup()
.addComponent(Side2Text, javax.swing.GroupLayout.DEFAULT_SIZE, 136, Short.MAX_VALUE)
.addGap(79, 79, 79))))))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(InputLabel)
.addComponent(Side1Text, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(InputLabel1)
.addComponent(Side2Text, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(Input2Label)
.addComponent(Side3Text, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(InputButton))
.addGap(18, 18, 18)
.addComponent(PerimeterLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(AreaLabel)
.addContainerGap(35, Short.MAX_VALUE))
);
setSize(new java.awt.Dimension(287, 217));
setLocationRelativeTo(null);
}// </editor-fold>//GEN-END:initComponents
private void Side1TextActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Side1TextActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_Side1TextActionPerformed
private void Side3TextActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Side3TextActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_Side3TextActionPerformed
private void Side2TextActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Side2TextActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_Side2TextActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(TriangleGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(TriangleGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(TriangleGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(TriangleGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new TriangleGUI().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel AreaLabel;
private javax.swing.JLabel Input2Label;
private javax.swing.JButton InputButton;
private javax.swing.JLabel InputLabel;
private javax.swing.JLabel InputLabel1;
private javax.swing.JLabel PerimeterLabel;
private javax.swing.JTextField Side1Text;
private javax.swing.JTextField Side2Text;
private javax.swing.JTextField Side3Text;
// End of variables declaration//GEN-END:variables
@Override
public void actionPerformed(ActionEvent ae) {
double side1 = Double.parseDouble(Side1Text.getText());
double side2 = Double.parseDouble(Side2Text.getText());
double side3 = Double.parseDouble(Side3Text.getText());
Triangle triangle = new Triangle(side1,side2,side3);
PerimeterLabel.setText(String.valueOf(triangle.getPerimeter()) + ": Perimeter");
AreaLabel.setText(String.valueOf(triangle.getArea()) + ": Area");
}
}
| [
"01048750@NK-LABW14017.ncc.commnet.edu"
] | 01048750@NK-LABW14017.ncc.commnet.edu |
657130e2511b4a55930a226ce3def9e6e2e43bcb | eaf51c46aebb57480d4cc785a973d8f7cb354ce5 | /Sonstiges/Java/Blackjack/src/Blackjack.java | 3a03dd2aecc611514a7129dce8f6cf57f69f4ce4 | [
"Unlicense"
] | permissive | valentinorusconi/gibm | 85b3ff4badd819d35b6d2da7e98b5e5e69d38593 | aa5d20311076dfc774c733675f5c151afd7265e2 | refs/heads/master | 2022-01-05T07:07:09.231526 | 2019-06-25T10:32:39 | 2019-06-25T10:32:39 | 221,708,377 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,728 | java |
//ArrayList: Ähnlich wie "String[]" nur beliebig Erweiter- und Verkleinerbar.
import java.util.ArrayList;
import java.util.Random;
public class Blackjack {
private int balance = 1000, bet = 0;
private java.util.List<String> pointsPC = new ArrayList<String>();
private java.util.List<String> pointsPL = new ArrayList<String>();
// Zufallsgenerator
private Random r = new Random();
// Setzt Wetteinsatz in "bet" Variable fest und zieht den Betrag von
// "balance" ab.
public void setBet(int betgui) {
bet = betgui;
balance = balance - bet;
}
// Gibt "balance" aus.
public int getBalance() {
return balance;
}
// Erstellung und gibt ein zufällige Zahl aus.
public int getRandom() {
int random = r.nextInt(12);
return random;
}
// String aller möglichen Karten.
public String[] Cards = { "2", "3", "4", "5", "6", "7", "8", "9", "10", "Jack", "Queen", "King", "Ass" };
// Gibt die durch Zufallszahl ausgewählte Karte aus.
public String getCard(int random) {
String card = Cards[random];
return card;
}
// Addiert Punkte zum Spielerkonto, je nach Karte unterschiedlich viel.
public void setPointsPL(int number) {
switch (number) {
case 0:
pointsPL.add("2");
break;
case 1:
pointsPL.add("3");
break;
case 2:
pointsPL.add("4");
break;
case 3:
pointsPL.add("5");
break;
case 4:
pointsPL.add("6");
break;
case 5:
pointsPL.add("7");
break;
case 6:
pointsPL.add("8");
break;
case 7:
pointsPL.add("9");
break;
case 8:
pointsPL.add("10");
break;
case 9:
pointsPL.add("10");
break;
case 10:
pointsPL.add("10");
break;
case 11:
pointsPL.add("10");
break;
case 12:
pointsPL.add("11");
break;
}
}
// Gibt die Punktzahl aus, welche sich an der stelle "index" befindet.
public String getPointsPL(int index) {
return pointsPL.get(index);
}
// Addiert Punkte zum Dealerkonto, je nach Karte unterschiedlich viel.
public void setPointsPC(int number) {
switch (number) {
case 0:
pointsPC.add("2");
break;
case 1:
pointsPC.add("3");
break;
case 2:
pointsPC.add("4");
break;
case 3:
pointsPC.add("5");
break;
case 4:
pointsPC.add("6");
break;
case 5:
pointsPC.add("7");
break;
case 6:
pointsPC.add("8");
break;
case 7:
pointsPC.add("9");
break;
case 8:
pointsPC.add("10");
break;
case 9:
pointsPC.add("10");
break;
case 10:
pointsPC.add("10");
break;
case 11:
pointsPC.add("10");
break;
case 12:
pointsPC.add("11");
break;
}
}
// Gibt die Punktzahl aus, welche sich an der stelle "index" befindet.
public String getPointsPC(int index) {
return pointsPC.get(index);
}
}
| [
"mail@eliareutlinger.ch"
] | mail@eliareutlinger.ch |
5ac6ed5f2c26c2e02ad14d545aad1ed5c3ab5fd6 | 7a2c41c756e97390af3a77c86c6dc65a2f01d9f8 | /src/main/java/com/googlecode/starflow/service/filter/ProcessFilter.java | 0ae48dcf6e8f945b308d1311dc014ae00184443e | [] | no_license | melin/starflow | 925cafe3fc5e49881fd0a5091eda3b62e9c1ca12 | 49f5c8fb9f84aced0352f0e8b841893de0ba6e70 | refs/heads/master | 2023-08-06T08:20:52.234085 | 2022-07-16T14:24:12 | 2022-07-16T14:24:12 | 4,428,440 | 23 | 28 | null | null | null | null | UTF-8 | Java | false | false | 2,274 | java | /*
* Copyright 2010-2011 the original author or authors.
*
* 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.googlecode.starflow.service.filter;
import com.googlecode.starflow.engine.event.AbstractFlowEvent;
import com.googlecode.starflow.engine.event.ActivityFinishEvent;
import com.googlecode.starflow.engine.event.ActivityStartEvent;
import com.googlecode.starflow.engine.event.ActivityTerminalEvent;
import com.googlecode.starflow.engine.event.ProcessFinishEvent;
import com.googlecode.starflow.engine.event.ProcessStartEvent;
import com.googlecode.starflow.engine.event.ProcessTerminalEvent;
import com.googlecode.starflow.engine.model.ActivityInst;
import com.googlecode.starflow.engine.model.ProcessInstance;
/**
*
* @author libinsong1204@gmail.com
* @version 1.0
*/
public interface ProcessFilter {
/**
* 流程创建
* @param processInstance
*/
public void processCreate(ProcessInstance processInstance);
/**
* 流程开始
* @param event
*/
public void processStart(ProcessStartEvent event);
/**
* 流程运行完成
* @param event
*/
public void processComplete(ProcessFinishEvent event);
/**
* 流程终止
* @param event
*/
public void processTerminal(ProcessTerminalEvent event);
/**
* 环节创建
* @param event
* @param destActInst
*/
public void activityCreate(AbstractFlowEvent event, ActivityInst destActInst);
/**
* 环节启动
* @param event
* @param destActInst
*/
public void activityStart(ActivityStartEvent event, ActivityInst destActInst);
/**
* 环节终止
* @param event
*/
public void activityTerminal(ActivityTerminalEvent event);
/**
* 环节结束
* @param event
*/
public void activityComplete(ActivityFinishEvent event);
}
| [
"libinsong1204@gmail.com"
] | libinsong1204@gmail.com |
8f6ef862ba2d3b78b6f281d239cf893bbe0adf51 | b1d0b2a12898a0ea19dba29d40222691ab80ef31 | /Automated Dictation Evaluation I/Main.java | 8958761503c47ee9fae0afcdf8249e515a34a184 | [] | no_license | jvmy2j0802/Playground | c673ba1e17a3e197e7eebe2b87d9b010cc194b35 | d99d4c0c18bbc185a18937e20cb15d9015dd888b | refs/heads/master | 2022-09-11T01:30:41.145087 | 2020-05-31T14:06:12 | 2020-05-31T14:06:12 | 257,623,661 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 277 | java | #include<iostream>
#include<string>
using namespace std;
int main()
{
std::string st1;
std::string st2;
std::getline(std::cin,st1);
std::getline(std::cin,st2);
if(st1==st2)
{
std::cout<<"It is correct";
}
else
std::cout<<"It is wrong";
return 0;
} | [
"63339775+jvmy2j0802@users.noreply.github.com"
] | 63339775+jvmy2j0802@users.noreply.github.com |
9d363406b57e53ad3d07907a34b70948a9d3d888 | 06d85fe26e3b3a165c7698cc37e1f64c872c40ec | /HTW/src/HuntTheWumpus/Runner.java | 7610eba59635f613a6858a3574af62580919928f | [] | no_license | paytonrules/HuntTheWumpus | 9cef0a089815061a6c3262bdc2ebaa2cd200c465 | d630637d5fc3f2775c9e21b73fccd31949cdf45c | refs/heads/master | 2016-09-05T20:28:09.690406 | 2013-04-02T19:46:17 | 2013-04-02T19:46:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,625 | java | package HuntTheWumpus;
import java.io.*;
import static HuntTheWumpus.Game.*;
public class Runner {
public static void main(String[] args) throws Exception {
GamePresenter p = new GamePresenter(new Console() {
public void print(String message) {
System.out.println(message);
}
});
Game g = p.getGame();
g.addPath(1,2,EAST);
g.addPath(2,3,EAST);
g.addPath(3,4,SOUTH);
g.addPath(4,5,SOUTH);
g.addPath(5,6,SOUTH);
g.addPath(5,7,EAST);
g.addPath(7,8,EAST);
g.addPath(8,9,NORTH);
g.addPath(9,10,EAST);
g.addPath(10,11,EAST);
g.addPath(11,12,NORTH);
g.addPath(12,13,NORTH);
g.addPath(8,14,SOUTH);
g.addPath(14,15,SOUTH);
g.addPath(14,16,EAST);
g.addPath(16,17,EAST);
g.addPath(17,18,NORTH);
g.addPath(18,11,NORTH);
g.addPath(3,19,NORTH);
g.addPath(19,20,NORTH);
g.addPath(20,21,EAST);
g.addPath(21,22,EAST);
g.addPath(22,23,EAST);
g.addPath(23,24,EAST);
g.addPath(24,13,SOUTH);
g.addPath(1,25,SOUTH);
g.addPath(25,26,SOUTH);
g.addPath(26,15,EAST);
g.addPath(15,27,EAST);
g.addPath(27,16,NORTH);
g.addPath(15,21,SOUTH);
g.addPath(25,20,EAST);
g.addPath(8,18,EAST);
g.addPath(21,9,SOUTH);
g.putPlayerInCavern(1);
g.putWumpusInCavern(15);
g.putPitInCavern(22);
g.putPitInCavern(17);
g.putBatsInCavern(8);
g.setQuiver(5);
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
p.execute("r");
while (g.gameTerminated() == false) {
String command = br.readLine();
p.execute(command);
}
}
}
| [
"eric@8thlight.com"
] | eric@8thlight.com |
a24fe140de4571795e0db7a6de2d1bbae7a33667 | 9f83f3f306bbc29410c812444ce5d3a35b678d7f | /week-08/src/main/java/com/greenfox/rueppellii/seadog/week08day1/todo/todo/TodoRepository.java | 12c21d260d47fcb21bdb68a087de1fb9ac345e94 | [] | no_license | markpalotas/starlinginferno | 18eefbb5e3a6003ee77b30709b866b7d2a77fe63 | 5d711cf49e6446facc3e9e5383e39f46acd4f028 | refs/heads/master | 2020-04-17T14:34:50.553166 | 2019-01-16T12:20:47 | 2019-01-16T12:20:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 216 | java | package com.greenfox.rueppellii.seadog.week08day1.todo.todo;
import org.springframework.data.repository.CrudRepository;
import java.util.List;
public interface TodoRepository extends CrudRepository<Todo, Long> {
} | [
"liliszendrei@gmail.com"
] | liliszendrei@gmail.com |
1abaa3b4a4401b570f378266cdf0a63b4a7737d2 | 339115ccc6874040dd4a05873d55d6f991437458 | /app/src/main/java/app/bennsandoval/com/woodmin/Woodmin.java | 398d2693a2540438289a2b3727ff0ac002ecce8c | [
"Apache-2.0"
] | permissive | mnafian/Woodmin | b7c1e0708533c815be4b5a8a53b08fe09bf7d652 | 11c1c845f7335b63e1d84e4e46d89aedf5d9d551 | refs/heads/master | 2021-01-16T22:10:45.637625 | 2015-05-21T04:57:39 | 2015-05-21T04:57:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 426 | java | package app.bennsandoval.com.woodmin;
import android.app.Application;
import com.crashlytics.android.Crashlytics;
import io.fabric.sdk.android.Fabric;
/**
* Created by Mackbook on 1/10/15.
*/
public class Woodmin extends Application {
public final String LOG_TAG = Woodmin.class.getSimpleName();
@Override public void onCreate() {
super.onCreate();
Fabric.with(this, new Crashlytics());
}
}
| [
"bennsandoval"
] | bennsandoval |
b0bf570651977e630ada011267051222c9eef653 | 3ef55e152decb43bdd90e3de821ffea1a2ec8f75 | /large/module1420_public/tests/more/src/java/module1420_public_tests_more/a/Foo1.java | 81a7998efd18d42feac6fb54f50a5cc18764bba8 | [
"BSD-3-Clause"
] | permissive | salesforce/bazel-ls-demo-project | 5cc6ef749d65d6626080f3a94239b6a509ef145a | 948ed278f87338edd7e40af68b8690ae4f73ebf0 | refs/heads/master | 2023-06-24T08:06:06.084651 | 2023-03-14T11:54:29 | 2023-03-14T11:54:29 | 241,489,944 | 0 | 5 | BSD-3-Clause | 2023-03-27T11:28:14 | 2020-02-18T23:30:47 | Java | UTF-8 | Java | false | false | 1,635 | java | package module1420_public_tests_more.a;
import java.util.zip.*;
import javax.annotation.processing.*;
import javax.lang.model.*;
/**
* Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut
* labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
* Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
*
* @see java.awt.datatransfer.DataFlavor
* @see java.beans.beancontext.BeanContext
* @see java.io.File
*/
@SuppressWarnings("all")
public abstract class Foo1<J> extends module1420_public_tests_more.a.Foo0<J> implements module1420_public_tests_more.a.IFoo1<J> {
java.rmi.Remote f0 = null;
java.nio.file.FileStore f1 = null;
java.sql.Array f2 = null;
public J element;
public static Foo1 instance;
public static Foo1 getInstance() {
return instance;
}
public static <T> T create(java.util.List<T> input) {
return module1420_public_tests_more.a.Foo0.create(input);
}
public String getName() {
return module1420_public_tests_more.a.Foo0.getInstance().getName();
}
public void setName(String string) {
module1420_public_tests_more.a.Foo0.getInstance().setName(getName());
return;
}
public J get() {
return (J)module1420_public_tests_more.a.Foo0.getInstance().get();
}
public void set(Object element) {
this.element = (J)element;
module1420_public_tests_more.a.Foo0.getInstance().set(this.element);
}
public J call() throws Exception {
return (J)module1420_public_tests_more.a.Foo0.getInstance().call();
}
}
| [
"gwagenknecht@salesforce.com"
] | gwagenknecht@salesforce.com |
c66465b8ba8de3d2f0c149c157d5fb305f519e4d | 771d7c3caf9e4a245492a9a9e5987a47d29a47d3 | /src/main/java/com/relesi/smart/api/dtos/FuncionarioDto.java | 0296ddbe6c7b9d702883e8fe9aecd72f177b5d31 | [
"MIT"
] | permissive | Relesi/smart-api | be70198bc28520562d08b13c78be71fa9d60b8ce | c1cc077d24023709747a82999262bac6426fdd40 | refs/heads/master | 2022-11-26T12:05:30.132509 | 2020-07-25T22:28:34 | 2020-07-25T22:28:34 | 261,590,691 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,409 | java | package com.relesi.smart.api.dtos;
import java.util.Optional;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotEmpty;
public class FuncionarioDto {
private Long id;
private String nome;
private String email;
private Optional<String> senha = Optional.empty();
private Optional<String> valorHora = Optional.empty();
private Optional<String> qtdHorasTrabalhoDia = Optional.empty();
private Optional<String> qtdHorasAlmoco = Optional.empty();
public FuncionarioDto() {
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
@NotEmpty(message = "Nome não pode ser vazio.")
@Length(min = 3, max = 200, message = "Nome deve conter entre 3 e 200 caracteres.")
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
@NotEmpty(message = "Email não pode ser vazio.")
@Length(min = 5, max = 200, message = "Email deve conter entre 5 e 200 caracteres.")
@Email(message="Email inválido.")
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public Optional<String> getSenha() {
return senha;
}
public void setSenha(Optional<String> senha) {
this.senha = senha;
}
public Optional<String> getValorHora() {
return valorHora;
}
public void setValorHora(Optional<String> valorHora) {
this.valorHora = valorHora;
}
public Optional<String> getQtdHorasTrabalhoDia() {
return qtdHorasTrabalhoDia;
}
public void setQtdHorasTrabalhoDia(Optional<String> qtdHorasTrabalhoDia) {
this.qtdHorasTrabalhoDia = qtdHorasTrabalhoDia;
}
public Optional<String> getQtdHorasAlmoco() {
return qtdHorasAlmoco;
}
public void setQtdHorasAlmoco(Optional<String> qtdHorasAlmoco) {
this.qtdHorasAlmoco = qtdHorasAlmoco;
}
@Override
public String toString() {
return "FuncionarioDto [id=" + id + ", nome=" + nome + ", email=" + email + ", senha=" + senha + ", valorHora="
+ valorHora + ", qtdHorasTrabalhoDia=" + qtdHorasTrabalhoDia + ", qtdHorasAlmoco=" + qtdHorasAlmoco
+ "]";
}
}
| [
"renatolessa.2011@hotmail.com"
] | renatolessa.2011@hotmail.com |
f73676cc9a040ca0bbeb9f994bc625b23398e102 | 94c896828e4aedd44db86fd06f5c1614e7200751 | /geeks4geeks/dynamicprogramming/MaxSumRectangle.java | fbae74e1d0766a0c44a5c9aefb64b55d17598d4c | [
"MIT"
] | permissive | vj20284/Study | 611d4ba562a11c4e292101149c3a492b21ca67b6 | 9dc6954b4cb3b218c3153b217567a49a7a8d185b | refs/heads/master | 2021-08-26T08:48:16.274481 | 2021-08-14T06:05:56 | 2021-08-14T06:05:56 | 58,826,996 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 283 | java | package com.practise.geeks4geeks.dynamicprogramming;
public class MaxSumRectangle {
public int maxSumRectangle(int[][] matrix) {
int[][] soln = new int[matrix.length][matrix[0].length];
for (int i = 0; i < matrix.length; i++)
soln[0][i] = matrix[0][0];
return 0;
}
}
| [
"vivek.20284@gmail.com"
] | vivek.20284@gmail.com |
0c1b1c091942a04aef877e01b3cfcf648e811e87 | da956842e20319be61cb9cc504e70fa1c7d8c25b | /src/com/sg763/textmining/SG763_DriverClass.java | f9694e43d11a53ef4b8c1f95302e2d2987d55c92 | [] | no_license | yyleon/TextMining | 012a2561affb614778dcafa38e8442d896f021ce | 559a026d85b7915ef39f1825d14c3dfa29390a47 | refs/heads/master | 2021-12-14T21:41:50.396957 | 2017-06-04T19:24:54 | 2017-06-04T19:24:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,689 | java | package com.sg763.textmining;
/*
* It is the Driver class, which drives all the other classes using their instances
* Submitted By: Shravani Krishna Rau Gogineni
* ID: 31376289 / SG763
*/
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.*;
import java.util.Map.Entry;
public class SG763_DriverClass
{
static final String inputPath = "C:/Users/Shravni/Documents/NJIT/DM_FinalProject/InitialTextDoc";
static final String outputPath = "C:/Users/Shravni/Documents/NJIT/DM_FinalProject/Keywords";
static BufferedReader in;
static PrintWriter out;
static List<String> bestWords = new ArrayList<>();
static Map<String, Set<String>> dataSet = new HashMap<String, Set<String>>();
static int supportCount;
static float minConfidence;
static int k;
public static void main(String[] args) throws IOException
{
Scanner userInput = new Scanner(System.in);
System.out.println("********************************************\n");
System.out.println("************TEXT MINING SYSTEM**************\n\n");
System.out.println("\nThis system is used for keyword based association discovery aong various terms in different documents in a document collection Dataset.\n");
System.out.println("Data Set Used: Reuters 21578 Collection\n" + "Algorithms Used:\n1. Text mining algorithm : for keyword association mining\n" + "2. Tfidf algorithm : for identifying and extracting keywords\n" + "3. Apriori algorithm : for finding association rules\n");
System.out.println("\nEnter the Minimum Support Count value (In Integer):");
supportCount = userInput.nextInt();
System.out.println("\nEnter the minimum confidence value (In Decimal):");
minConfidence = userInput.nextFloat();
System.out.println("\nEnter the no of top/best keywords you wantto select: ");
k = userInput.nextInt();
System.out.println("\n*************************************************");
System.out.println("***************User Entered Values***************");
System.out.println("\nMinimum SupportCount :" + supportCount + " \nMinimum Confidence :" + minConfidence + "\nTop k keywords :" + k);
/*
* Extract key words from all the input files
*/
SG763_ExtractingKeywords keyword = new SG763_ExtractingKeywords();
File[] inputFiles = new File(inputPath).listFiles();
int fileIndex = 0;
for (File file : inputFiles)
{
if (file.isFile() && file.getName().contains(".txt"))
{
keyword.keywordExtract(file.getName(), fileIndex, inputPath, outputPath);
fileIndex++;
}
}
/*
* Creating an object of class TfIdf to calculate the tfidf values for
* all the words in all the documents
*/
SG763_TfIdf tf = new SG763_TfIdf(outputPath);
tf.buildAllDocuments();
File allwordFile = new File(outputPath + "/allwords.txt");
File topWords = new File(outputPath + "/bestwords.txt");
/*
* Reading all tfidf values and adding them to a map for further processing
* of all words
*/
Map<String, Double> map = new HashMap<String, Double>();
in = new BufferedReader(new FileReader(allwordFile));
String inputStr = null;
while ((inputStr = in.readLine()) != null)
{
String[] obj = inputStr.split(" ");
map.put(obj[0], Double.parseDouble(obj[1]));
}
in.close();
/*
* Sorting the map generated above to get the best words
*/
Set<Entry<String, Double>> set = map.entrySet();
List<Entry<String, Double>> list = new ArrayList<Entry<String, Double>>(set);
Collections.sort(list, new Comparator<Map.Entry<String, Double>>()
{
public int compare(Map.Entry<String, Double> o1, Map.Entry<String, Double> o2)
{
return (o2.getValue()).compareTo(o1.getValue());
}
});
out = new PrintWriter(new BufferedWriter(new FileWriter(topWords, false)));
int i = 0;
for (Map.Entry<String, Double> entry : list)
{
if (i < 100)
{
out.println(entry.getKey());
}
else
break;
i++;
}
out.close();
/*
* Storing the best words and adding them to local list for comparing it with
* individual key word file
*/
in = new BufferedReader(new FileReader(topWords));
while (in.readLine() != null)
{
bestWords.add(in.readLine());
}
in.close();
/*
* Invidual key word file are compared with the top words which will generate the
* data set for Apriori to work on
*/
File[] keyFiles = new File(outputPath).listFiles();
int filenumber = 0;
for (File file : keyFiles)
{
if (file.isFile() && file.getName().contains("keyword"))
{
Set<String> words = new HashSet<String>();
in = new BufferedReader(new FileReader(file));
String line = null;
while ((line = in.readLine()) != null)
{
if (bestWords.contains(line))
{
words.add(line);
}
}
dataSet.put(file.getName(), words);
in.close();
filenumber++;
}
}
File dataset = new File(outputPath + "/dataset.txt");
out = new PrintWriter(new BufferedWriter(new FileWriter(dataset, false)));
for (String s : dataSet.keySet())
{
if (!dataSet.get(s).isEmpty())
out.println(s + " " + dataSet.get(s) + "\n");
}
out.close();
/*
* Creating an instance of Apriori and applying it on the above generated data set
*/
SG763_Apriori apr = new SG763_Apriori(dataSet, supportCount, minConfidence);
apr.InitProcess();
}
} | [
"gvkrishnarau@Shravanis-MacBook-Pro.local"
] | gvkrishnarau@Shravanis-MacBook-Pro.local |
7235957282bcf3a7adcfc4d62c618a8a1e406cf6 | 44fecbe10152dec98a08d11131fb09f611086848 | /app/src/main/java/com/callenld/demo/network/impl/CommonService.java | 3818b28c3864a9d00055a5b21d1c907a0e80bc3a | [] | no_license | AllureLo/myApplication | ac70fd8e8642be07def2cc822a9412f2e09f6fd9 | 9aaa318a60e76ab7fe98822b5be9130b50f758bb | refs/heads/master | 2020-05-16T02:41:46.290607 | 2019-04-22T11:01:02 | 2019-04-22T11:01:02 | 182,637,599 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 906 | java | package com.callenld.demo.network.impl;
import com.callenld.demo.callback.bean.ResultBean;
import com.callenld.demo.network.ICommonService;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.callback.AbsCallback;
import java.io.File;
/**
* @Author: Callenld
* @Date: 19-4-22
*/
public class CommonService implements ICommonService {
@Override
public <T> void upload(AbsCallback<ResultBean<T>> callback, String url) {
OkGo.<ResultBean<T>>post("https://app.teambook.cc/lindoor/common/upload")
.tag(this)
.params("file", new File(url))
.execute(callback);
}
@Override
public <T> void delete(AbsCallback<ResultBean<T>> callback, String url) {
OkGo.<ResultBean<T>>post("https://app.teambook.cc/lindoor/common/delete")
.tag(this)
.params("url", url)
.execute(callback);
}
}
| [
"527670557@qq.com"
] | 527670557@qq.com |
32a80762b2a378355f3520ada3479f80ae36d62e | ac72641cacd2d68bd2f48edfc511f483951dd9d6 | /opscloud-service/src/main/java/com/baiyi/opscloud/service/kubernetes/impl/OcKubernetesTemplateServiceImpl.java | 71a7c921ca223877c4a2d32eca5c2856c990592b | [] | no_license | fx247562340/opscloud-demo | 6afe8220ce6187ac4cc10602db9e14374cb14251 | b608455cfa5270c8c021fbb2981cb8c456957ccb | refs/heads/main | 2023-05-25T03:33:22.686217 | 2021-06-08T03:17:32 | 2021-06-08T03:17:32 | 373,446,042 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,290 | java | package com.baiyi.opscloud.service.kubernetes.impl;
import com.baiyi.opscloud.domain.DataTable;
import com.baiyi.opscloud.domain.generator.opscloud.OcKubernetesTemplate;
import com.baiyi.opscloud.domain.param.kubernetes.KubernetesTemplateParam;
import com.baiyi.opscloud.mapper.opscloud.OcKubernetesTemplateMapper;
import com.baiyi.opscloud.service.kubernetes.OcKubernetesTemplateService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;
import javax.annotation.Resource;
import java.util.List;
/**
* @Author baiyi
* @Date 2020/6/30 10:58 上午
* @Version 1.0
*/
@Service
public class OcKubernetesTemplateServiceImpl implements OcKubernetesTemplateService {
@Resource
private OcKubernetesTemplateMapper ocKubernetesTemplateMapper;
@Override
public DataTable<OcKubernetesTemplate> queryOcKubernetesTemplateByParam(KubernetesTemplateParam.PageQuery pageQuery) {
Page page = PageHelper.startPage(pageQuery.getPage(), pageQuery.getLength());
List<OcKubernetesTemplate> list = ocKubernetesTemplateMapper.queryKubernetesTemplateByParam(pageQuery);
return new DataTable<>(list, page.getTotal());
}
@Override
public List<OcKubernetesTemplate> queryOcKubernetesTemplateByType(String templateType) {
Example example = new Example(OcKubernetesTemplate.class);
Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("templateType", templateType);
return ocKubernetesTemplateMapper.selectByExample(example);
}
@Override
public OcKubernetesTemplate queryOcKubernetesTemplateById(Integer id) {
return ocKubernetesTemplateMapper.selectByPrimaryKey(id);
}
@Override
public void addOcKubernetesTemplate(OcKubernetesTemplate ocKubernetesTemplate) {
ocKubernetesTemplateMapper.insert(ocKubernetesTemplate);
}
@Override
public void updateOcKubernetesTemplate(OcKubernetesTemplate ocKubernetesTemplate) {
ocKubernetesTemplateMapper.updateByPrimaryKey(ocKubernetesTemplate);
}
@Override
public void deleteOcKubernetesTemplateById(int id) {
ocKubernetesTemplateMapper.deleteByPrimaryKey(id);
}
}
| [
"fanxin01@longfor.com"
] | fanxin01@longfor.com |
db69730524a3c1f5d66cb834fe0f53eac63a461c | 1a5a2ed76b1ceaa18464eae531915d667611096c | /app/src/main/java/com/chooblarin/githublarin/model/FeedConverter.java | 57bcd8a7866fbcff571fcd9fe48db43d35868f8e | [] | no_license | chooblarin/githublarin-android | c45b3e067aa6290f1b8d24274f1f160a8b45ace9 | 972c49bf2ba13425fe6d19008a0323f7abdca34d | refs/heads/master | 2021-01-15T11:19:48.374549 | 2016-02-17T00:57:47 | 2016-02-17T00:57:47 | 37,381,478 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,512 | java | package com.chooblarin.githublarin.model;
import android.net.Uri;
import java.util.regex.Pattern;
import rx.Observable.Transformer;
public class FeedConverter {
final public static Transformer<Feed, Feed> expandThumbnail = feed -> feed.map(_feed -> {
Uri uri = Uri.parse(_feed.thumbnail);
_feed.thumbnail = new Uri.Builder().scheme(uri.getScheme())
.authority(uri.getAuthority())
.path(uri.getPath())
.appendQueryParameter("v", uri.getQueryParameter("v"))
.appendQueryParameter("s", "120")
.build().toString();
return _feed;
});
final public static Transformer<Feed, Feed> discriminateAction = feed -> feed.map(_feed -> {
String authorName = _feed.authorName;
Pattern pattern = Pattern.compile(authorName + " made .+ public");
if (_feed.title.startsWith(authorName + " starred")) {
_feed.action = Action.STAR;
return _feed;
}
if (_feed.title.startsWith(authorName + " forked")) {
_feed.action = Action.FORK;
return _feed;
}
if (_feed.title.startsWith(authorName + " created repository")) {
_feed.action = Action.CREATE_REPOSITORY;
return _feed;
}
if (pattern.matcher(_feed.title).find()) {
_feed.action = Action.MAKE_PUBLIC;
return _feed;
}
_feed.action = Action.NONE;
return _feed;
});
}
| [
"choo.bla.rin@gmail.com"
] | choo.bla.rin@gmail.com |
3b0fe0b9d32d832edf508b3f4763659b7ffcc13d | 029cb22eb9bd2fbbe22f03c752276f2459ace1a6 | /3m-server/src/test/java/fr/skytech/application/test/model/UserModel.java | 70846903eaf79e7c19e2b297b17c78b14e629503 | [] | no_license | skytech-application/3m | 0e02f8e2066b9506e023e47eb69d2c73ef82ef18 | 98c4b477c96804cf21f09cc304a5527e8b8bc4e9 | refs/heads/master | 2016-09-06T02:15:00.385834 | 2014-06-19T22:42:54 | 2014-06-19T22:42:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,707 | java | package fr.skytech.application.test.model;
import static org.junit.Assert.assertEquals;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Transactional;
import fr.skytech.application.model.User;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration({ "classpath:/test-context.xml" })
@Transactional
public class UserModel {
@Autowired
private SessionFactory sessionFactory;
private Session currentSession;
@Before
public void openSession() {
this.currentSession = this.sessionFactory.getCurrentSession();
}
@Test
public void user_create() {
assertEquals(0, this.currentSession.createQuery("from User").list()
.size());
final User user = new User();
user.setUsername("admin");
this.currentSession.persist(user);
this.currentSession.flush();
assertEquals(1, this.currentSession.createQuery("from User").list()
.size());
}
@Test
public void user_find_by_username() {
final User user = new User();
user.setUsername("admin");
this.currentSession.persist(user);
this.currentSession.flush();
assertEquals(
1,
this.currentSession
.createQuery("from User where username = 'admin'")
.list().size());
assertEquals(
0,
this.currentSession
.createQuery("from User where username = 'mrlo'")
.list().size());
}
} | [
"skytech.application@gmail.com"
] | skytech.application@gmail.com |
8962530b74ec724f2105d3bcf240e200fcedfd8f | 10f4158c5bdb67244eedf286b4c03350b9e8407e | /designPatterns4/组合模式/src/com/zhulu/test/Test.java | 14e83db38868cd5f9b2f89f24824db4847ffe8c4 | [] | no_license | Yubao1/designPatterns4 | 570606544a878cb87858f5d520a7c3ad4aea7383 | e7bc18eb286ec49bd8d562386d609fb3184c5375 | refs/heads/master | 2023-04-03T23:23:08.712137 | 2021-04-19T21:54:47 | 2021-04-19T21:54:47 | 359,608,227 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 552 | java | package com.zhulu.test;
/*
* 测试 组合模式
*/
public class Test {
public static void main(String[] args) {
AbstractFile f2,f3,f4,f5;
Folder f1 = new Folder("我的文件夹");
f2 = new ImageFile("我的图片");
f3 = new TextFile("我的文本文件");
Folder f11 = new Folder("我的电影");
f1.add(f2);
f1.add(f3);
f4 = new VideoFile("神雕侠侣");
f5 = new VideoFile("笑傲江湖");
f11.add(f4);
f11.add(f5);
f1.add(f11);
f1.killVirus();
}
}
| [
"2535370631@qq.com"
] | 2535370631@qq.com |
d9d77f4e4d19342b8510763c741ca0dc58d9bdc9 | 634bb7edac99885fd64cc42641ce41e1e33ec993 | /law_web_app/src/test/java/DAO_classes/DAO_contractTest.java | 89842820128c4465e500abd58e8eeca6222ea32a | [] | no_license | Tanya1515/web_application | 72ab681781592c9f5909f5943514c455f3676f73 | da262b93712b09435681bb65464fc6fed427f2b4 | refs/heads/master | 2023-05-05T16:57:38.776321 | 2021-05-25T19:01:28 | 2021-05-25T19:01:28 | 341,249,661 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,595 | java | package DAO_classes;
import entities.Contract;
import org.testng.Assert;
import org.testng.annotations.Test;
import java.util.List;
import static org.testng.Assert.*;
public class DAO_contractTest {
@Test
public void testDelete_ok() {
DAO_contract dao_cont = new DAO_contract();
Contract new_C = new Contract (9,1,7, java.sql.Date.valueOf("2014-01-01"), java.sql.Date.valueOf("2014-04-01"));
dao_cont.save(new_C);
Assert.assertEquals(dao_cont.delete(new_C), true);
}
@Test
public void testDelete_not_ok() {
DAO_contract dao_cont = new DAO_contract();
Contract new_C = new Contract (9,1,7, java.sql.Date.valueOf("2014-01-01"), java.sql.Date.valueOf("2014-04-01"));
dao_cont.save(new_C);
dao_cont.delete(new_C);
Assert.assertEquals(dao_cont.delete(new_C), false);
}
@Test
public void testFindById_ok() {
DAO_contract dao_cont = new DAO_contract();
Contract new_C = new Contract (9,1,7, java.sql.Date.valueOf("2014-01-01"), java.sql.Date.valueOf("2014-04-01"));
dao_cont.save(new_C);
Assert.assertNotNull(dao_cont.findById(new_C.getId_contract()));
}
@Test
public void testFindById_not_ok() {
DAO_contract dao_cont = new DAO_contract();
Contract new_C = new Contract (9,1,7, java.sql.Date.valueOf("2014-01-01"), java.sql.Date.valueOf("2014-04-01"));
dao_cont.save(new_C);
dao_cont.delete(new_C);
Assert.assertNull(dao_cont.findById(new_C.getId_contract()));
}
@Test
public void testListContract() {
DAO_contract dao_cont = new DAO_contract();
Contract new_C = new Contract (9,1,7, java.sql.Date.valueOf("2014-01-01"), java.sql.Date.valueOf("2014-04-01"));
dao_cont.save(new_C);
List<Contract> l = dao_cont.ListContract();
for(Contract c: l)
{
Assert.assertNotNull(dao_cont.findById(new_C.getId_contract()));
}
}
@Test
public void testSave_ok() {
DAO_contract dao_cont = new DAO_contract();
Contract new_C = new Contract (9,1,7, java.sql.Date.valueOf("2014-01-01"), java.sql.Date.valueOf("2014-04-01"));
Assert.assertEquals(dao_cont.save(new_C), true);
dao_cont.delete(new_C);
}
@Test
public void testSave_not_ok() {
DAO_contract dao_cont = new DAO_contract();
Contract new_C = new Contract (100,1,7, java.sql.Date.valueOf("2014-01-01"), java.sql.Date.valueOf("2014-04-01"));
Assert.assertEquals(dao_cont.save(new_C), false);
}
} | [
"tanya1515@ispras.ru"
] | tanya1515@ispras.ru |
6034bbf9f660ecf1b225dd02434cceef406c1970 | 42bfbfaaae1f0dbfc8172bab078b80e65c9bb109 | /java-basic/src/main/java/bitcamp/java100/ch11/ex5/Sedan.java | d10f00d0bf837a1b5840ed60c273e994afa521ef | [] | no_license | leech5151/bitcamp | 972e9e1358f19d6433fc9aa4b8f7258e76a7afc6 | 479419f6ff5448f3ccf1c33873ac3acc92da5927 | refs/heads/master | 2021-09-06T04:19:19.493102 | 2018-02-02T08:57:22 | 2018-02-02T08:57:22 | 104,423,463 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 471 | java | package bitcamp.java100.ch11.ex5;
public class Sedan extends Car{
boolean isOpen;
@Override
public void run() {
if(isOpen) {
System.out.println("시원하게 달린다.");
}else {
System.out.println("포근하게 달린다!");
}
}
public void openSunroof() {
isOpen = true;
System.out.println("썬루프 연다.");
}
public void closeSunroof() {
isOpen = false;
System.out.println("썬루프 닫는다.");
}
}
| [
"leech99661@naver.com"
] | leech99661@naver.com |
53be62d74e2d80bc93ebac52cf9757890d9add7e | 8dc1b972432ecf93606ca357b6a56164740ac8d6 | /OA/src/com/oa/service/EmployeeService.java | b09d1a0a7f915469857b9081d56f80ae04a64b6f | [] | no_license | QKGood/OAStystem | 090ad0bea3ebdbef8bdabda0cb23eaa0f104e765 | 12cb726b22cc02f2548ec333611da2cc5f7f2bf7 | refs/heads/master | 2021-01-21T22:10:12.783571 | 2017-06-23T03:02:09 | 2017-06-23T03:02:09 | 95,177,508 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,451 | java | package com.oa.service;
import java.util.Date;
import java.util.List;
import java.util.Map;
import com.oa.bean.Department;
import com.oa.bean.Employee;
import com.oa.bean.info.EmpBaseInfo;
import com.oa.common.bean.Pager4EasyUI;
public interface EmployeeService extends BaseService<Employee>{
public Employee login(Employee emp);
/**
* 所有角色
* @return
*/
public Object[] allRoles();
/**
* 所有员工
* @return
*/
public Object[] allEmps() ;
/**
* 把角色设置给某个员工
* @param rolename
* @param empid
*/
public void giveRole2Emp(String rolename, String empid);
/**
* 查询某个部门的某角色(用于查管理者)
* @param rolename
* @param depid
* @return 经理id
*/
public String queryEmpByRole(String rolename,String depid);
public String queryRoleIdByRoleName(String rolename);
/**
* 计数部门员工
* @param deptid
* @return
*/
public int countEmpsByDept(String deptid);
/**
* update
* @param empid
* @param pwd
* @param email
* @param phone
* @param qq
* @param wechat
* @param address
*/
public void selfUpdate(Employee employee);
public void otherUpdate(String empid,String depid, String roleid, String contactname,String contactphone,String bankname,String accountname,String accountno,String alipay,int status);
public void updPwd(String empId, String pwd);
public void otherStatusUpdate(String empid,int status);
public Pager4EasyUI<EmpBaseInfo> queryByDepWhe(Pager4EasyUI<EmpBaseInfo> pager,String depId, String empName,String beginDate,String endDate, String status,String sort, String order);
public Pager4EasyUI<EmpBaseInfo> queryByAllWhe(Pager4EasyUI<EmpBaseInfo> pager,String empName,String beginDate,String endDate, String status,String sort, String order);
/**
* countByDepWhe 对应于 queryByDepWhe
* countByAllWhe 对应于 queryByAllWhe
* @return
*/
public int countByDepWhe(String depId, String empName,String beginDate,String endDate, String status);
public int countByAllWhe(String empName,String beginDate,String endDate, String status);
/**
* 其他人要用,不要删
* @param pager
* @param deptId
* @return
*/
public Pager4EasyUI<EmpBaseInfo> queryEmpByDept(Pager4EasyUI<EmpBaseInfo> pager,String deptId);
/**
*
* @param phone 添加员工时需要检查手机号是否重复
* @return 拥有该手机号的员工
*/
public int checkRegister(String phone);
}
| [
"1756691236@qq.com"
] | 1756691236@qq.com |
63e92d2b536d62c6eb6aa7d0707e3d89dad71540 | 7c20e36b535f41f86b2e21367d687ea33d0cb329 | /Capricornus/src/com/gopawpaw/erp/hibernate/f/FcgMstrDAO.java | 968710c481914fb26345a171a9048a13a3c64f4b | [] | no_license | fazoolmail89/gopawpaw | 50c95b924039fa4da8f309e2a6b2ebe063d48159 | b23ccffce768a3d58d7d71833f30b85186a50cc5 | refs/heads/master | 2016-09-08T02:00:37.052781 | 2014-05-14T11:46:18 | 2014-05-14T11:46:18 | 35,091,153 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,974 | java | package com.gopawpaw.erp.hibernate.f;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.LockMode;
import org.springframework.context.ApplicationContext;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
/**
* A data access object (DAO) providing persistence and search support for
* FcgMstr entities. Transaction control of the save(), update() and delete()
* operations can directly support Spring container-managed transactions or they
* can be augmented to handle user-managed Spring transactions. Each of these
* methods provides additional information for how to configure it for the
* desired type of transaction control.
*
* @see com.gopawpaw.erp.hibernate.f.FcgMstr
* @author MyEclipse Persistence Tools
*/
public class FcgMstrDAO extends HibernateDaoSupport {
private static final Log log = LogFactory.getLog(FcgMstrDAO.class);
protected void initDao() {
// do nothing
}
public void save(FcgMstr transientInstance) {
log.debug("saving FcgMstr instance");
try {
getHibernateTemplate().save(transientInstance);
log.debug("save successful");
} catch (RuntimeException re) {
log.error("save failed", re);
throw re;
}
}
public void delete(FcgMstr persistentInstance) {
log.debug("deleting FcgMstr instance");
try {
getHibernateTemplate().delete(persistentInstance);
log.debug("delete successful");
} catch (RuntimeException re) {
log.error("delete failed", re);
throw re;
}
}
public FcgMstr findById(com.gopawpaw.erp.hibernate.f.FcgMstrId id) {
log.debug("getting FcgMstr instance with id: " + id);
try {
FcgMstr instance = (FcgMstr) getHibernateTemplate().get(
"com.gopawpaw.erp.hibernate.f.FcgMstr", id);
return instance;
} catch (RuntimeException re) {
log.error("get failed", re);
throw re;
}
}
public List findByExample(FcgMstr instance) {
log.debug("finding FcgMstr instance by example");
try {
List results = getHibernateTemplate().findByExample(instance);
log.debug("find by example successful, result size: "
+ results.size());
return results;
} catch (RuntimeException re) {
log.error("find by example failed", re);
throw re;
}
}
public List findByProperty(String propertyName, Object value) {
log.debug("finding FcgMstr instance with property: " + propertyName
+ ", value: " + value);
try {
String queryString = "from FcgMstr as model where model."
+ propertyName + "= ?";
return getHibernateTemplate().find(queryString, value);
} catch (RuntimeException re) {
log.error("find by property name failed", re);
throw re;
}
}
public List findAll() {
log.debug("finding all FcgMstr instances");
try {
String queryString = "from FcgMstr";
return getHibernateTemplate().find(queryString);
} catch (RuntimeException re) {
log.error("find all failed", re);
throw re;
}
}
public FcgMstr merge(FcgMstr detachedInstance) {
log.debug("merging FcgMstr instance");
try {
FcgMstr result = (FcgMstr) getHibernateTemplate().merge(
detachedInstance);
log.debug("merge successful");
return result;
} catch (RuntimeException re) {
log.error("merge failed", re);
throw re;
}
}
public void attachDirty(FcgMstr instance) {
log.debug("attaching dirty FcgMstr instance");
try {
getHibernateTemplate().saveOrUpdate(instance);
log.debug("attach successful");
} catch (RuntimeException re) {
log.error("attach failed", re);
throw re;
}
}
public void attachClean(FcgMstr instance) {
log.debug("attaching clean FcgMstr instance");
try {
getHibernateTemplate().lock(instance, LockMode.NONE);
log.debug("attach successful");
} catch (RuntimeException re) {
log.error("attach failed", re);
throw re;
}
}
public static FcgMstrDAO getFromApplicationContext(ApplicationContext ctx) {
return (FcgMstrDAO) ctx.getBean("FcgMstrDAO");
}
} | [
"ahuaness@b3021582-c689-11de-ba9a-9db95b2bc6c5"
] | ahuaness@b3021582-c689-11de-ba9a-9db95b2bc6c5 |
8eab5ffa090a70a16cf8358cf32aab134fac78b9 | 5721244937dc629b9018a188be0ae8635252af1f | /src/main/java/Service/AdminService.java | e0f1113221965aa036bb14605f17b320cc0e9094 | [] | no_license | sumanxrtha/Library-Management-System | f71ea2d1213ed59a3547679b86006b03d1d98a5d | 48ce14e071ec3f4c9fcc51cd576639042857fa9f | refs/heads/master | 2023-04-28T09:28:33.024215 | 2021-05-18T09:12:00 | 2021-05-18T09:12:00 | 365,243,891 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,217 | java | package Service;
import DBConnection.DBConnection;
import Model.Admin;
import Model.Librarian;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
public class AdminService {
public Admin getUser(String username, String password) {
Admin admin = null;
String query = "select * from admin where adminUsername=? and adminPass=?";
PreparedStatement pstm = new DBConnection().getStatement(query);
System.out.println(username + " " + password);
try {
pstm.setString(1, username);
pstm.setString(2, password);
ResultSet rs = pstm.executeQuery();
System.out.println(username + " " + password);
while (rs.next()) {
admin = new Admin();
admin.setAdminId(rs.getInt("adminId"));
admin.setAdminName(rs.getString("adminName"));
admin.setAdminMob(rs.getInt("adminMob"));
admin.setAdminEmail(rs.getString("adminEmail"));
admin.setAdminUsername(rs.getString("adminUsername"));
admin.setAdminPass(rs.getString("adminPass"));
System.out.println(admin.getAdminUsername() + " " + admin.getAdminPass());
}
} catch (SQLException e) {
e.printStackTrace();
}
return admin;
}
public void insertAdmin(Admin admin) {
String query = "insert into admin (adminName,adminMob,adminEmail,adminUsername,adminPass)" +
"values(?,?,?,?,?)";
PreparedStatement pstm = new DBConnection().getStatement(query);
try {
pstm.setString(1, admin.getAdminName());
pstm.setInt(2, admin.getAdminMob());
pstm.setString(3, admin.getAdminEmail());
pstm.setString(4, admin.getAdminUsername());
pstm.setString(5, admin.getAdminPass());
pstm.execute();
} catch (SQLException e) {
e.printStackTrace();
}
}
public int insertOnce() throws SQLException {
String check = "select * from admin";
PreparedStatement pst = new DBConnection().getStatement(check);
ResultSet rs = pst.executeQuery();
int id = 0;
while(rs.next()){
id = rs.getInt("adminId");
System.out.println(id);
}
System.out.println(id);
return id;
}
public void insertLibrarian(Librarian librarian) {
String query = "insert into librarian (librarianName,librarianMob,librarianEmail,librarianUsername,librarianPass)" +
"values(?,?,?,?,?)";
PreparedStatement pstm = new DBConnection().getStatement(query);
try {
pstm.setString(1, librarian.getLibrarianName());
pstm.setInt(2, librarian.getLibrarianMob());
pstm.setString(3, librarian.getLibrarianEmail());
pstm.setString(4, librarian.getLibrarianUsername());
pstm.setString(5, librarian.getLibrarianPass());
pstm.execute();
} catch (SQLException e) {
e.printStackTrace();
}
}
}
| [
"sumanxrtha@gmail.com"
] | sumanxrtha@gmail.com |
dc22a03de5d1b42da62e319666b18457c00ad68f | 28f4856aa872dcb91130026273859420f9955418 | /kracart/src/main/java/org/kratos/kracart/service/impl/EmailServiceImpl.java | 929f5510e6004084cb8ffa3e5412915ec23d30d3 | [] | no_license | GaryDev/java-web | 70fc00ac0881edf53ed9cf4252597e06b7ae4918 | d4e1c3edc6c998aac8c7be0dd4b055d86a433a3f | refs/heads/master | 2016-09-02T00:43:20.275818 | 2014-09-02T06:06:37 | 2014-09-02T06:06:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 708 | java | package org.kratos.kracart.service.impl;
import java.util.Map;
import org.kratos.kracart.entity.EmailTemplateDescription;
import org.kratos.kracart.model.EmailTemplateModel;
import org.kratos.kracart.service.EmailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service("emailService")
public class EmailServiceImpl implements EmailService {
@Autowired
private EmailTemplateModel emailTemplateModel;
@Override
public EmailTemplateDescription getEmailTemplateDetail(
Map<String, String> params) {
EmailTemplateDescription tpl = emailTemplateModel.getEmailTemplateByName(params);
return tpl;
}
}
| [
"Xuesong Guo@PC-GuoXuesong"
] | Xuesong Guo@PC-GuoXuesong |
2ebfd41b620ab3ea18b87c704301108d6aeeefa0 | 07769aaff14b5b3faa407fba72fd377d8521063c | /java/Grafos/src/us/lsi/graphs/virtual/EGraphI.java | 3c983b73e2d7538923e780aeed17caa5772f1040 | [] | no_license | migueltoro/adda2021 | 93ec1d30b7153c37344db733d9e3162669cfba87 | b16a576669011e44b94b1f9212fbefadd1733f1b | refs/heads/master | 2023-03-22T04:25:42.502350 | 2021-03-06T21:23:08 | 2021-03-06T21:23:08 | 336,328,096 | 2 | 1 | null | null | null | null | WINDOWS-1250 | Java | false | false | 5,221 | java | package us.lsi.graphs.virtual;
import java.util.Collection;
import java.util.List;
import java.util.Set;
import java.util.function.Function;
import java.util.function.Supplier;
import java.util.stream.Collectors;
import org.jgrapht.Graph;
import org.jgrapht.GraphType;
import us.lsi.common.TriFunction;
import us.lsi.path.EGraphPath;
import us.lsi.path.EGraphPath.PathType;
public class EGraphI<V,E,G extends Graph<V,E>> implements EGraph<V,E> {
private G graph;
private Function<E,Double> edgeWeight = null;
private Function<V,Double> vertexWeight = null;
private TriFunction<V,E,E,Double> vertexPassWeight= null;
private EGraphPath<V,E> path;
private V startVertex;
private PathType type;
public EGraphI(G graph, V startVertex, PathType type, Function<E, Double> edgeWeight, Function<V, Double> vertexWeight,
TriFunction<V, E, E, Double> vertexPassWeight) {
super();
this.graph = graph;
this.edgeWeight = edgeWeight;
this.vertexWeight = vertexWeight;
this.vertexPassWeight = vertexPassWeight;
this.type = PathType.Sum;
this.startVertex = startVertex;
this.type = type;
}
@Override
public boolean addEdge(V arg0, V arg1, E arg2) {
return graph.addEdge(arg0, arg1, arg2);
}
@Override
public E addEdge(V arg0, V arg1) {
return graph.addEdge(arg0, arg1);
}
@Override
public V addVertex() {
return graph.addVertex();
}
@Override
public boolean addVertex(V arg0) {
return graph.addVertex(arg0);
}
@Override
public boolean containsEdge(E arg0) {
return graph.containsEdge(arg0);
}
@Override
public boolean containsEdge(V arg0, V arg1) {
return graph.containsEdge(arg0, arg1);
}
@Override
public boolean containsVertex(V arg0) {
return graph.containsVertex(arg0);
}
@Override
public int degreeOf(V arg0) {
return graph.degreeOf(arg0);
}
@Override
public Set<E> edgeSet() {
return graph.edgeSet();
}
@Override
public Set<E> edgesOf(V v) {
return graph.edgesOf(v);
}
@Override
public Set<E> getAllEdges(V arg0, V arg1) {
return graph.getAllEdges(arg0, arg1);
}
@Override
public E getEdge(V arg0, V arg1) {
return graph.getEdge(arg0, arg1);
}
@Override
public V getEdgeSource(E arg0) {
return graph.getEdgeSource(arg0);
}
@Override
public Supplier<E> getEdgeSupplier() {
return graph.getEdgeSupplier();
}
@Override
public V getEdgeTarget(E arg0) {
return graph.getEdgeTarget(arg0);
}
@Override
public GraphType getType() {
return graph.getType();
}
@Override
public Supplier<V> getVertexSupplier() {
return graph.getVertexSupplier();
}
@Override
public int inDegreeOf(V arg0) {
return graph.inDegreeOf(arg0);
}
@Override
public Set<E> incomingEdgesOf(V arg0) {
return graph.incomingEdgesOf(arg0);
}
@Override
public int outDegreeOf(V arg0) {
return graph.outDegreeOf(arg0);
}
@Override
public Set<E> outgoingEdgesOf(V arg0) {
return graph.outgoingEdgesOf(arg0);
}
@Override
public boolean removeAllEdges(Collection<? extends E> arg0) {
return graph.removeAllEdges(arg0);
}
@Override
public Set<E> removeAllEdges(V arg0, V arg1) {
return graph.removeAllEdges(arg0, arg1);
}
@Override
public boolean removeAllVertices(Collection<? extends V> arg0) {
return graph.removeAllVertices(arg0);
}
@Override
public boolean removeEdge(E arg0) {
return graph.removeEdge(arg0);
}
@Override
public E removeEdge(V arg0, V arg1) {
return graph.removeEdge(arg0, arg1);
}
@Override
public boolean removeVertex(V arg0) {
return graph.removeVertex(arg0);
}
@Override
public void setEdgeWeight(E arg0, double arg1) {
graph.setEdgeWeight(arg0, arg1);
}
@Override
public Set<V> vertexSet() {
return graph.vertexSet();
}
@Override
public double getEdgeWeight(E edge) {
Double r;
if(edgeWeight != null) r = edgeWeight.apply(edge);
else r = graph.getEdgeWeight(edge);
return r;
}
/**
* @param vertex es el vértice actual
* @return El peso de vertex
*/
@Override
public double getVertexWeight(V vertex) {
Double r = 0.;
if(vertexWeight != null) r = vertexWeight.apply(vertex);
return r;
}
/**
* @param vertex El vértice actual
* @param edgeIn Una arista entrante o incidente en el vértice actual. Es null en el vértice inicial.
* @param edgeOut Una arista saliente o incidente en el vértice actual. Es null en el vértice final.
* @return El peso asociado al vértice suponiendo las dos aristas dadas.
*/
@Override
public double getVertexPassWeight(V vertex, E edgeIn, E edgeOut) {
Double r = 0.;
if(vertexPassWeight != null) r = vertexPassWeight.apply(vertex,edgeIn,edgeOut);
return r;
}
@Override
public List<E> edgesListOf(V v) {
return graph.edgesOf(v).stream().collect(Collectors.toList());
}
@Override
public EGraphPath<V, E> initialPath() {
if(this.path == null) {
this.path = EGraphPath.ofVertex(this,this.startVertex,this.type);
}
return this.path.copy();
}
@Override
public V startVertex() {
return startVertex;
}
@Override
public PathType pathType() {
return type;
}
}
| [
"migueltoro@LAPTOP-93NQHUSI.lsi.us.es"
] | migueltoro@LAPTOP-93NQHUSI.lsi.us.es |
8f5c3506112640da14eb2ec03ebbe07a9a660ad0 | 2e4a04b20e0b429e57149e23d56889588bbc09e2 | /Chapter09/src/main/java/com/packt/modern/api/repository/AuthorizationRepository.java | 190c16413d1c717ae05b08653aea6d8eccaf92d2 | [
"MIT"
] | permissive | kayazas123/Modern-API-Development-with-Spring-and-Spring-Boot | 1db9ae0269ae801d8adbc3143e073741ed59c6b3 | db4586f22997c6d591cf449fc9e5c3c33803764d | refs/heads/main | 2023-04-30T14:45:29.565008 | 2021-05-21T11:41:34 | 2021-05-21T11:41:34 | 371,608,373 | 1 | 0 | null | 2021-05-28T06:51:59 | 2021-05-28T06:51:59 | null | UTF-8 | Java | false | false | 400 | java | package com.packt.modern.api.repository;
import com.packt.modern.api.entity.AuthorizationEntity;
import java.util.UUID;
import org.springframework.data.repository.CrudRepository;
/**
* @author : github.com/sharmasourabh
* @project : Chapter09 - Modern API Development with Spring and Spring Boot
**/
public interface AuthorizationRepository extends CrudRepository<AuthorizationEntity, UUID> {
}
| [
"sousharm"
] | sousharm |
41357772878116e3c47dc9e2ff0b01f01442c561 | bd82472520cd8c0c7af9d830e96e67005411188a | /ocp/ch1/ch1.2/Pencil.java | d7f93255ca88aa328bda7c8a721002bd96ae9e85 | [] | no_license | lulinxa/oca7 | 582916450480df73fcef54e83649a58e5cb235a7 | fcd00a4bc9ec63a5a0a78a3c933928f6f6818a81 | refs/heads/master | 2021-01-11T14:19:03.335190 | 2017-10-04T21:18:22 | 2017-10-04T21:18:22 | 81,342,001 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 641 | java | class Instrument{
{
System.out.println("Instrument:initializer block");
}
Instrument(){
System.out.println("Instrument:constructor");
}
static {
System.out.println("INSTRUMENT:STATIC initializer");
}
}
public class Pencil extends Instrument {
public Pencil(){
System.out.println("Pencil:constructor");
}
static {
System.out.println("PENCIL:STATIC instance initializer");
}
{
System.out.println("Pencil:instance initilizer");
}
public Pencil(String s){
System.out.println("Pencil:String consutrctor");
}
public static void main(String... args){
new Pencil();
System.out.println();
new Pencil("test");
}
}
| [
"lulinxa@gmail.com"
] | lulinxa@gmail.com |
b2b6b4aca4e8f67fd052e724cae833e7e3d3baed | 309f5c82fdd6324923c1cf72c14cafcf77815f4f | /src/com/ganesh/aircraft/Main.java | a1876462004b0ca22d73e995ef2c5a386f24aead | [] | no_license | Ganeshk750/java-object-oriented | c6e93fc886e517eac1e8f3845aadecb5e0fb9bf9 | bf0b9b0b7c014ace23d65b6d8379545c86694a01 | refs/heads/master | 2023-04-11T09:00:07.372871 | 2021-04-16T09:46:18 | 2021-04-16T09:46:18 | 357,621,466 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 970 | java | package com.ganesh.aircraft;
import java.time.LocalDateTime;
import java.util.List;
/**
* @created: 16/04/2021 - 3:11 PM
* @author: Ganesh
*/
public class Main {
public static void main(String[] args) {
List<Aircraft> aircraft = List.of(
new Aircraft(1000, "B737", WakeTurbulence.LIGHT),
new Aircraft(1001, "A320", WakeTurbulence.LIGHT),
new Aircraft(1002, "A330", WakeTurbulence.MEDIUM),
new Aircraft(1003, "ATR90", WakeTurbulence.LIGHT),
new Aircraft(1004, "A380", WakeTurbulence.SUPER)
);
int offset = 0;
for (Aircraft a : aircraft) {
offset += a.getWakeTurbulence().getTimeOffset();
LocalDateTime depTime = LocalDateTime
.now()
.plusSeconds(offset);
System.out.println("Aircraft " + a.getModeAOctal() + " takes off at " + depTime.toLocalTime());
}
}
}
| [
"47558133+Ganeshk750@users.noreply.github.com"
] | 47558133+Ganeshk750@users.noreply.github.com |
064f41c25ab204f457f18717d87ff122702f8485 | 17deccf7190f6c9ccc5f3589340753cb9970ce5f | /src/org/guanmu/log/Loggers.java | 6c7fe8d1a87d87a2e3fa7104e92cd4a28750a75b | [] | no_license | guanmu/FgoAutoAttack | 10955638620554e3977eae7c023a4725ec426f4a | d1080b603657512193fb0f98338931398d1c8ca0 | refs/heads/master | 2020-03-10T00:14:02.268566 | 2018-04-13T11:02:18 | 2018-04-13T11:02:18 | 129,076,408 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 391 | java | package org.guanmu.log;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* 系统日志工厂类
* @author wangquan
*
*/
public class Loggers {
public static Logger getLogEx() {
return LoggerFactory.getLogger(new
Throwable().getStackTrace()[1].getClassName());
}
public static Logger getLog(String className) {
return LoggerFactory.getLogger(className);
}
}
| [
"wqguanmu@gmail.com"
] | wqguanmu@gmail.com |
0d931d3d6cba5615f14fc9b4d4bf917b05f264a4 | 92b0bad812dce62a66a53fef9b7271df566c3985 | /learnenglish/src/main/java/cn/wyb/sble/resources/queryword/util/JsonUtils.java | ec0f6231f63382dcae597bf7d5fe4b39e3363db3 | [] | no_license | altairsii/sble-parent | 3a7fe887d3d40fd2f573a85057b9218c35a8ef46 | 81d761c80bd9d7b2bd3f2050cc01ae1fae265093 | refs/heads/master | 2018-01-08T14:14:24.260833 | 2015-11-03T07:10:48 | 2015-11-03T07:10:48 | 44,523,382 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,059 | java | package cn.wyb.sble.resources.queryword.util;
import java.util.Map;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonObject;
import com.google.gson.reflect.TypeToken;
/**
* @author wangyongbing
*
*/
public class JsonUtils {
private static Gson getGson(){
GsonBuilder gsonBuilder = new GsonBuilder();
Gson g = gsonBuilder.create();
return g;
}
/**
* 将json转换为map,value是object
*
* @param data json数据
* @return
*/
public static JsonObject getMapFromJsonVO(String data){
return getGson().fromJson(data, JsonObject.class);
}
/**
* 将json转换为map,value是String
*
* @param data json数据
* @return
*/
public static Map<String,String> getMapFromJsonVS(String data){
return getGson().fromJson(data, new TypeToken<Map<String, String>>(){}.getType());
}
/**
* 将json对象转换为java类
* @param data
* @param clazz
* @return
*/
public static <T> T getPogo(String data,Class<T> clazz){
return getGson().fromJson(data,clazz);
}
}
| [
"122812806@qq.com"
] | 122812806@qq.com |
186c1afe79570d1de703e3afb9fdf13a971cab85 | 5e5fbc908edcb7916f5159f70301c8059179bf41 | /JAVA/src/TercerExerciciApp.java | 0f1e72cb0b7ab9b6c6d124bff216cb45218ae1be | [] | no_license | jgona0/ITA_Ej3_JAVA | 10c16ff133e63a1c0e623aa29c2cb706e75669ae | 19717dfaf0dc57e35ac3677e682a10bba455eeb7 | refs/heads/master | 2023-01-09T19:30:40.384230 | 2020-10-15T15:24:25 | 2020-10-15T15:24:25 | 297,616,184 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,465 | java | /*
* Tercer exercici IT ACADEMY
* Xavi Gonzalez JAVA-1
*/
import java.util.*;
import java.util.ArrayList;
public class TercerExerciciApp {
public static void main(String[] args) {
// Crea sis variables tipu string buides
String s0, s1, s2, s3, s4, s5 = "";
// Demana per consola que s’introdueixin els noms
System.out.println("Introduce las ciudades:");
Scanner entrada = new Scanner(System.in);
s0=entrada.nextLine();
s1=entrada.nextLine();
s2=entrada.nextLine();
s3=entrada.nextLine();
s4=entrada.nextLine();
s5=entrada.nextLine();
// Mostra per consola el nom de les 6 ciutats.
System.out.println(s0 + " , " + s1 + " , " + s2 + " , " + s3 + " , " + s4 + " , " + s5);
/*----------
-- FASE 2 --
----------*/
System.out.println(" \n Fase 2:");
// Un cop tenim els noms de les ciutats guardats en variables haurem de pasar l’informacio a un array (arrayCiutats).
ArrayList<String> arrayCiutats = new ArrayList<String>();
arrayCiutats.add(s0);
arrayCiutats.add(s1);
arrayCiutats.add(s2);
arrayCiutats.add(s3);
arrayCiutats.add(s4);
arrayCiutats.add(s5);
// Quan tinguem l’array ple, haurem de mostrar per consola el nom de les ciutats ordenadas per ordre alfabetic.
Collections.sort(arrayCiutats);
for (String i : arrayCiutats) {
System.out.println(i);
}
/*----------
-- FASE 3 --
----------*/
System.out.println(" \n Fase 3:");
//Cambieu les vocals “a” dels noms de les ciutats per el numero 4 i guardeu els noms modificats en un nou array(ArrayCiutatsModificades).
ArrayList<String> arrayCiutatsModificades = replaceA(arrayCiutats);
for (String i : arrayCiutatsModificades) {
System.out.println(i);
}
/*----------
-- FASE 4 --
----------*/
System.out.println(" \n Fase 4:");
// Creeu un nou array per cada una de les ciutats que tenim. La mida dels nous arrays sera la llargada de cada string (string nomCiutat.Length)
char[] c0 = new char[s0.length()];
char[] c1 = new char[s1.length()];
char[] c2 = new char[s2.length()];
char[] c3 = new char[s3.length()];
char[] c4 = new char[s4.length()];
char[] c5 = new char[s5.length()];
// Ompliu els nous arrays lletra per lletra
fillArray(s0, c0);
fillArray(s1, c1);
fillArray(s2, c2);
fillArray(s3, c3);
fillArray(s4, c4);
fillArray(s5, c5);
//Mostreu per consola els nous arrays amb els noms invertits (Ex: Barcelona - anolecraB).
reverseAndPrint(c0);
reverseAndPrint(c1);
reverseAndPrint(c2);
reverseAndPrint(c3);
reverseAndPrint(c4);
reverseAndPrint(c5);
}
// Métode que reb un ArrayList i li canvia les 'a' per 4
static ArrayList replaceA (ArrayList input) {
ArrayList<String> arrayCiutatsModificades = new ArrayList<String>();
for (int i = 0; i<input.size();i++) {
arrayCiutatsModificades.add(((String) input.get(i)).replace('a', '4'));
}
return arrayCiutatsModificades;
}
// Métode que omple un array de chars amb les lletres d'un string
static void fillArray (String city, char[] input) {
for (int z = 0; z<input.length; z++) {
input[z] = city.charAt(z);
}
}
// Métode que fa un reverse de l'ordre de les lletres d'un array de chars i l'imprimeix
static void reverseAndPrint (char[] input) {
for (int i=input.length-1; i>=0; i--) {
System.out.print(input[i]);
}
System.out.print("\n");
}
}
| [
"jgona0@gmail.com"
] | jgona0@gmail.com |
54768f1f5487e222097194761e8d9ef6df045752 | a4a51084cfb715c7076c810520542af38a854868 | /src/main/java/com/shopee/app/c/a.java | 73c31f274d809bb8f2ce7bc0cfd2b7801faef169 | [] | no_license | BharathPalanivelu/repotest | ddaf56a94eb52867408e0e769f35bef2d815da72 | f78ae38738d2ba6c9b9b4049f3092188fabb5b59 | refs/heads/master | 2020-09-30T18:55:04.802341 | 2019-12-02T10:52:08 | 2019-12-02T10:52:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,201 | java | package com.shopee.app.c;
import android.app.Activity;
import android.content.Context;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import com.shopee.app.application.ar;
public class a {
public static void a(View view) {
InputMethodManager inputMethodManager = (InputMethodManager) ar.a().getSystemService("input_method");
if (inputMethodManager != null) {
try {
inputMethodManager.hideSoftInputFromWindow(view.getWindowToken(), 0);
} catch (Exception unused) {
inputMethodManager.toggleSoftInput(1, 2);
}
}
}
public static void b(View view) {
view.requestFocus();
InputMethodManager inputMethodManager = (InputMethodManager) ar.a().getSystemService("input_method");
if (inputMethodManager != null) {
inputMethodManager.showSoftInput(view, 1);
}
}
public static void a(Context context) {
if (context instanceof Activity) {
View currentFocus = ((Activity) context).getCurrentFocus();
if (currentFocus != null) {
a(currentFocus);
}
}
}
}
| [
"noiz354@gmail.com"
] | noiz354@gmail.com |
c4c4f14e1b9001dfcfab56821e1c1c5444357942 | 7c1bb7f2507e856d1dd1645ec70b7e9a298daf9d | /src/main/java/com/vereinssponsoren/myapp/service/AuditEventService.java | b799079e529701adb60432f0628389ed2bf79d70 | [] | no_license | hakojava/VereinsSponsoren | fbcb36736970f46228aa7229efa44170b5139da9 | fb61b8a380126ea1133db118f2c56f7565bbb3cb | refs/heads/main | 2023-03-02T00:42:03.598897 | 2021-02-08T22:03:21 | 2021-02-08T22:03:21 | 336,813,166 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,978 | java | package com.vereinssponsoren.myapp.service;
import com.vereinssponsoren.myapp.config.audit.AuditEventConverter;
import com.vereinssponsoren.myapp.repository.PersistenceAuditEventRepository;
import io.github.jhipster.config.JHipsterProperties;
import java.time.Instant;
import java.time.temporal.ChronoUnit;
import java.util.Optional;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.actuate.audit.AuditEvent;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* Service for managing audit events.
* <p>
* This is the default implementation to support SpringBoot Actuator {@code AuditEventRepository}.
*/
@Service
@Transactional
public class AuditEventService {
private final Logger log = LoggerFactory.getLogger(AuditEventService.class);
private final JHipsterProperties jHipsterProperties;
private final PersistenceAuditEventRepository persistenceAuditEventRepository;
private final AuditEventConverter auditEventConverter;
public AuditEventService(
PersistenceAuditEventRepository persistenceAuditEventRepository,
AuditEventConverter auditEventConverter,
JHipsterProperties jhipsterProperties
) {
this.persistenceAuditEventRepository = persistenceAuditEventRepository;
this.auditEventConverter = auditEventConverter;
this.jHipsterProperties = jhipsterProperties;
}
/**
* Old audit events should be automatically deleted after 30 days.
*
* This is scheduled to get fired at 12:00 (am).
*/
@Scheduled(cron = "0 0 12 * * ?")
public void removeOldAuditEvents() {
persistenceAuditEventRepository
.findByAuditEventDateBefore(Instant.now().minus(jHipsterProperties.getAuditEvents().getRetentionPeriod(), ChronoUnit.DAYS))
.forEach(
auditEvent -> {
log.debug("Deleting audit data {}", auditEvent);
persistenceAuditEventRepository.delete(auditEvent);
}
);
}
@Transactional(readOnly = true)
public Page<AuditEvent> findAll(Pageable pageable) {
return persistenceAuditEventRepository.findAll(pageable).map(auditEventConverter::convertToAuditEvent);
}
@Transactional(readOnly = true)
public Page<AuditEvent> findByDates(Instant fromDate, Instant toDate, Pageable pageable) {
return persistenceAuditEventRepository
.findAllByAuditEventDateBetween(fromDate, toDate, pageable)
.map(auditEventConverter::convertToAuditEvent);
}
@Transactional(readOnly = true)
public Optional<AuditEvent> find(Long id) {
return persistenceAuditEventRepository.findById(id).map(auditEventConverter::convertToAuditEvent);
}
}
| [
"jhipster-bot@jhipster.tech"
] | jhipster-bot@jhipster.tech |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.