blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 4 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 689M ⌀ | 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 131 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 32 values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 313 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
77046240d6bb3ed86311395728e089d2d195cfe5 | 93e672d7b6a3b389e1db26547f1c19cf211934fa | /app/src/main/java/com/project/techaract/amclub/Sliders/fragments/Slider2Fragment.java | 1ca6bf0e160f58e66df92e7a188926ba7af9d03c | [] | no_license | ashar312/AMClubRewamp | 1cfde55e234221f5a84c69c33890bf40e2283db5 | c279ecdb9dad028bb120042e293ee7147be7f7dd | refs/heads/master | 2022-12-26T11:23:59.043819 | 2020-10-02T12:59:05 | 2020-10-02T12:59:05 | 297,944,752 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 588 | java | package com.project.techaract.amclub.Sliders.fragments;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.project.techaract.amclub.R;
public class Slider2Fragment extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_slider2, container, false);
}
} | [
"arsalan.fakhar@yahoo.com"
] | arsalan.fakhar@yahoo.com |
2fb0fe356cdceb76265a9aed979369fea0dd267a | 5e24b94a8d4ed7bb9ba7dbb8c2a5214195a0b3c5 | /TODOlist2/app/src/main/java/com/example/macbook/todolist2/RebootReceiver.java | f67b525c555ffc4a2ca6a2851f09f3da002ba36a | [] | no_license | inkp80/boostcamp_project1 | ad282379be1695b70a53224a35e7be7ce866334b | f3f60a25085063706ddaf5ca5d22f07bcae8aa69 | refs/heads/master | 2021-01-11T17:19:05.707249 | 2017-02-11T05:06:24 | 2017-02-11T05:06:24 | 79,742,524 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,197 | java | package com.example.macbook.todolist2;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.util.Log;
import com.example.macbook.todolist2.data.TodolistContract;
import java.util.Timer;
import java.util.TimerTask;
import static com.example.macbook.todolist2.TodoListAdapter.INTENT_TITLE;
/**
* Created by kyu on 2017-01-28.
*/
public class RebootReceiver extends BroadcastReceiver {
String TAG = Rebooted.class.getName();
@Override
public void onReceive(final Context context, Intent intent) {
if (intent.getAction().equals("android.intent.action.BOOT_COMPLETED")) {
final Intent RebootIntent = new Intent(context, Rebooted.class);
Intent intentBootNoti = new Intent(context, MainActivity.class);
intentBootNoti.putExtra(INTENT_TITLE, "Alarm is Running!");
NotificationUtils.NotificationSomethings(context, intentBootNoti);
context.startService(RebootIntent);
} else {
Log.e(TAG, "Received unexpected intent " + intent.toString());
}
}
}
| [
"inkp80@gmail.com"
] | inkp80@gmail.com |
88883b7eac8d39e4e0d844fa20f4d1cc790fc7ee | 895418f1a46dd4a8b1b70e29de851bd12506a9f1 | /src/main/java/com/imooc/o2o/service/CacheService.java | e8519662ac99ad52fb10517d38c531cf559ed87b | [] | no_license | a362111080/o2oBoot | 007309f40c0fb298b19a66d1091acf973855d58b | 479c621ff4106b84561ed5c173c2c9b57bf68b19 | refs/heads/master | 2022-06-21T18:56:27.109326 | 2019-06-19T09:25:46 | 2019-06-19T09:25:46 | 192,709,439 | 0 | 0 | null | 2022-06-21T01:18:47 | 2019-06-19T10:17:35 | Java | UTF-8 | Java | false | false | 306 | java | package com.imooc.o2o.service;
public interface CacheService {
/**
* 依据key前缀删除匹配该模式下的所有key-value 如传入:shopcategory,则shopcategory_allfirstleve等
* 以shopcategory打头的key_value都会被清空
*/
void removeFromCache(String keyPrefix);
}
| [
"362111080@qq.com"
] | 362111080@qq.com |
6dd66aa71747c830844481dbce2483733e74f310 | 0497f4c46896e9ca2818b8978f7f513b2d30ba60 | /src/pl/sda/javaintro/sda/tworzenieObiektow/Triangle.java | e8a15ef502d51b1a599e3595c6a6c08dc8c5f650 | [] | no_license | MariuszBotwina/MariuszBotwina | 31ef6af42b68cd110bc7f1a8b07fa964b41a6022 | 1b61382595206dd9480a4bbd179d1d1eec4f7cf3 | refs/heads/master | 2020-04-24T19:08:37.929812 | 2019-03-03T10:55:30 | 2019-03-03T10:55:30 | 172,202,788 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 235 | java | package pl.sda.javaintro.sda.tworzenieObiektow;
public class Triangle {
public boolean isRectangular(int a, int b, int c) {
if (c * c == a * a + b * b) {
return true;
}
return false;
}
}
| [
"mar.botwina@gmail.com"
] | mar.botwina@gmail.com |
5f9d09cc302d355f589093f48fa69bb0fc87a34f | 6f33bbee3c717e8d16d5959aa5fe833eea92221f | /src/contest07/Nest.java | 597f4c8aa3984ce571dd222425c0e7c75354c630 | [] | no_license | connorjayr/SienaProgrammingContests | dd46a07e12fb5d0e15f39dbb1808dd70ef333210 | bfa73270f8dd931d049b90dc68654288d4b55139 | refs/heads/master | 2022-04-08T17:00:57.820967 | 2018-12-24T11:09:09 | 2018-12-24T11:09:09 | 82,363,032 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 980 | java | package contest07;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Nest {
public static void main(String[] args) {
String expression = new Scanner(System.in).nextLine();
List<Character> opening = new ArrayList<>();
boolean valid = true;
for (char c : expression.toCharArray()) {
char closing = getClosing(c);
if (closing != ' ') {
opening.add(c);
} else {
if (getClosing(opening.get(opening.size() - 1)) != c) {
valid = false;
break;
} else {
opening.remove(opening.size() - 1);
}
}
}
if (opening.size() != 0) {
valid = false;
}
System.out.println(valid ? "VALID" : "NOT VALID");
}
public static char getClosing(char opening) {
switch (opening) {
case '(': return ')';
case '[': return ']';
case '{': return '}';
case '<': return '>';
default: return ' ';
}
}
}
| [
"connorjayr@gmail.com"
] | connorjayr@gmail.com |
00a0e592ebed9de6626f42e40b26479b3cc0d8ce | c02171bdd2f66768085499ffbc1b3de696c8cef5 | /app/src/test/java/com/nabesh/mpesa/ExampleUnitTest.java | 542a90043dd91f6c43f6c00c0c3ad754680a5baf | [] | no_license | KariukiAbel/Mpesa-Demo | 7030688349f01fca207d74ead0183e76cb8bb9db | f10e3cde2d174d3cfa2f643b630416d87bc3749e | refs/heads/master | 2020-03-21T10:41:19.200216 | 2018-06-24T15:22:59 | 2018-06-24T15:22:59 | 138,465,336 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 377 | java | package com.nabesh.mpesa;
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() {
assertEquals(4, 2 + 2);
}
} | [
"abelmuriithi@gmail.com"
] | abelmuriithi@gmail.com |
1a75eec545b63282b726e1dbd974697e01c35a68 | 09f1b53d0cca7866cf79a0a3cb86c2d279045709 | /Mochito/sample-mockito/src/test/java/com/shashi/service/ProductServiceImplTest.java | 572dc6558a675b28e33705c4f11d30b1e20323e5 | [] | no_license | shksush/CubicPracticeClass | 3904904fecb200ef8040567406e2509deb81639f | b642c4d0b46f97594b98a1acdf73bd3083bfe591 | refs/heads/master | 2020-04-10T10:46:12.335630 | 2018-02-22T03:19:57 | 2018-02-22T03:19:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,808 | java | package com.shashi.service;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.when;
import java.sql.SQLException;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import com.shashi.dao.ProductDAO;
import com.shashi.dao.ProductDetailDAO;
import com.shashi.entity.ProductEntity;
import com.shashi.test.ProductData;
import com.shashi.vo.ProductVO;
@RunWith(MockitoJUnitRunner.class)
public class ProductServiceImplTest {
@Mock
private ProductDAO dao;
@Mock
private ProductDetailDAO detailDao;
private final ProductServiceImpl impl = new ProductServiceImpl();
private ProductVO input;
private ProductEntity entity;
@Before
public void setUp() {
input = ProductData.createProduct();
entity = ProductData.createProductEntity();
impl.setDao(dao);
impl.setDetailDao(detailDao);
}
@Test(expected = IllegalArgumentException.class)
public void testSaveProductNullProduct() {
impl.saveProduct(null);
// fail("Not yet implemented");
}
@Test(expected = IllegalArgumentException.class)
public void testSaveProductNullProductName() {
final ProductVO input = ProductData.createProduct();
input.setProductName(null);
impl.saveProduct(null);
// fail("Not yet implemented");
}
@Test
public void testCreateProduct() throws SQLException {
when(dao.createProduct(any(ProductEntity.class))).thenReturn(entity);
final ProductVO result = impl.saveProduct(input);
assertNotNull(result);
assertNotNull(result.getId());
assertEquals(input.getProductName(), result.getProductName());
assertEquals(input.getDescription(), result.getDescription());
}
}
| [
"robi750@gmail.com"
] | robi750@gmail.com |
2df94c9d60aca3099f51132ea92341887987bbc6 | 528a5592cd95af3a817175c5597356d46c5b3c1d | /app/src/main/java/com/coolweather/app/gson/AQI.java | 33515a31531efc8c0b4b173fe68180ae6a3371cf | [
"Apache-2.0"
] | permissive | ChaoqinLiu/CoolWeather | 65504a3ca377d7d6a895f1141df98b85d02eb1b7 | a48787668b62abf81bf0861304b80f67e509cca9 | refs/heads/master | 2020-04-14T19:22:06.918083 | 2019-01-08T02:06:49 | 2019-01-08T02:06:49 | 164,054,907 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 172 | java | package com.coolweather.app.gson;
public class AQI {
public AQICity city;
public class AQICity{
public String aqi;
public String pm25;
}
}
| [
"1026191382@qq.com"
] | 1026191382@qq.com |
f673dd887b94d62aac5efbe998fda0f8cc1f401b | 52f2c4076e09426d3fbffcfb331b538011aa43f0 | /j0038010_cards/CardDemo/app/src/main/java/com/ebookfrenzy/carddemo/MainActivity.java | bde73ce287968530a698b8c4eed306923c7c25af | [] | no_license | TarekEZZAT/ANDROID-EXAMPLES | f35e956482bca128498069588c93bda8831b99d9 | 812a2b33019ffe3082c77f62ff045ac52ab8844c | refs/heads/master | 2022-12-25T20:42:38.204671 | 2020-09-12T22:10:23 | 2020-09-12T22:10:23 | 294,996,581 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,726 | java | package com.ebookfrenzy.carddemo;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.view.Menu;
import android.view.MenuItem;
public class MainActivity extends AppCompatActivity {
RecyclerView recyclerView;
RecyclerView.LayoutManager layoutManager;
RecyclerView.Adapter adapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
recyclerView = findViewById(R.id.recyclerView);
layoutManager = new LinearLayoutManager(this);
recyclerView.setLayoutManager(layoutManager);
adapter = new RecyclerAdapter();
recyclerView.setAdapter(adapter);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
} | [
"te.professionnel@gmail.com"
] | te.professionnel@gmail.com |
c584d27f63b9407762f5a8196bbaf7765795b112 | 7ca331eb3ec1ba17ff4ab215687466530de992c0 | /chapter07/src/main/java/com/vilin/springboot/chapter07/controller/RedisController.java | ea9f61cae716cb3273a31b0f48cd60519fc832b2 | [] | no_license | guangyongluo/springbootfamily | c6611b1003b80772e418c53221f413eef6392e26 | 698e45a89dbceeaea8e8b4f9ff3e22778db4e963 | refs/heads/master | 2023-04-05T09:53:33.726881 | 2020-02-28T04:35:21 | 2020-02-28T04:35:21 | 239,314,861 | 0 | 2 | null | 2023-03-27T22:30:02 | 2020-02-09T14:07:03 | Java | UTF-8 | Java | false | false | 10,860 | java | package com.vilin.springboot.chapter07.controller;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.connection.RedisZSetCommands.Range;
import org.springframework.data.redis.core.BoundHashOperations;
import org.springframework.data.redis.core.BoundListOperations;
import org.springframework.data.redis.core.BoundSetOperations;
import org.springframework.data.redis.core.BoundZSetOperations;
import org.springframework.data.redis.core.DefaultTypedTuple;
import org.springframework.data.redis.core.RedisOperations;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.core.ZSetOperations.TypedTuple;
import org.springframework.data.redis.core.script.DefaultRedisScript;
import org.springframework.data.redis.serializer.RedisSerializer;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import redis.clients.jedis.Jedis;
/**** imports ****/
@Controller
@RequestMapping("/redis")
public class RedisController {
@Autowired
private RedisTemplate redisTemplate = null;
@Autowired
private StringRedisTemplate stringRedisTemplate = null;
@RequestMapping("/stringAndHash")
@ResponseBody
public Map<String, Object> testStringAndHash() {
redisTemplate.opsForValue().set("key1", "value1");
// 注意这里使用了JDK的序列化器,所以Redis保存的时候不是整数,不能运算
redisTemplate.opsForValue().set("int_key", "1");
stringRedisTemplate.opsForValue().set("int", "1");
// 使用运算
stringRedisTemplate.opsForValue().increment("int", 1);
stringRedisTemplate.opsForValue().decrement("int", 1);
// 获取底层Jedis连接
// Jedis jedis = (Jedis) stringRedisTemplate.getConnectionFactory().getConnection().getNativeConnection();
// 减一操作,这个命令RedisTemplate不支持,所以笔者先获取底层的连接再操作
// jedis.decr("int");
Map<String, String> hash = new HashMap<String, String>();
hash.put("field1", "value1");
hash.put("field2", "value2");
// 存入一个散列数据类型
stringRedisTemplate.opsForHash().putAll("hash", hash);
// 新增一个字段
stringRedisTemplate.opsForHash().put("hash", "field3", "value3");
// 绑定散列操作的key,这样可以连续对同一个散列数据类型进行操作
BoundHashOperations hashOps = stringRedisTemplate.boundHashOps("hash");
// 删除两个个字段
hashOps.delete("field1", "field2");
// 新增一个字段
hashOps.put("filed4", "value5");
Map<String, Object> map = new HashMap<String, Object>();
map.put("success", true);
return map;
}
@RequestMapping("/list")
@ResponseBody
public Map<String, Object> testList() {
// 插入两个列表,注意它们再链表的顺序
// 链表从左到右顺序为v10,v8,v6,v4,v2
stringRedisTemplate.opsForList().leftPushAll("list1", "v2", "v4", "v6", "v8", "v10");
// 链表从左到右顺序为v1,v2,v3,v4,v5,v6
stringRedisTemplate.opsForList().rightPushAll("list2", "v1", "v2", "v3", "v4", "v5", "v6");
// 绑定list2链表操作
BoundListOperations listOps = stringRedisTemplate.boundListOps("list2");
// 从右边弹出一个成员
Object result1 = listOps.rightPop();
// 获取定位元素,Redis从0开始计算,这里值为v2
Object result2 = listOps.index(1);
// 从左边插入链表
listOps.leftPush("v0");
// 求链表长度
Long size = listOps.size();
// 求链表下标区间成员,整个链表下标范围为0到size-1,这里不取最后一个元素
List elements = listOps.range(0, size - 2);
Map<String, Object> map = new HashMap<String, Object>();
map.put("success", true);
return map;
}
@RequestMapping("/set")
@ResponseBody
public Map<String, Object> testSet() {
// 请注意:这里v1重复2次,由于集合不允许重复,所以只是插入5个成员到集合中
stringRedisTemplate.opsForSet().add("set1", "v1", "v1", "v2", "v3", "v4", "v5");
stringRedisTemplate.opsForSet().add("set2", "v2", "v4", "v6", "v8");
// 绑定set1集合操作
BoundSetOperations setOps = stringRedisTemplate.boundSetOps("set1");
// 增加两个元素
setOps.add("v6", "v7");
// 删除两个元素
setOps.remove("v1", "v7");
// 返回所有元素
Set set1 = setOps.members();
// 求成员数
Long size = setOps.size();
// 求交集
Set inter = setOps.intersect("set2");
// 求交集,并且用新集合inter保存
setOps.intersectAndStore("set2", "inter");
// 求差集
Set diff = setOps.diff("set2");
// 求差集,并且用新集合diff保存
setOps.diffAndStore("set2", "diff");
// 求并集
Set union = setOps.union("set2");
// 求并集,并且用新集合union保存
setOps.unionAndStore("set2", "union");
Map<String, Object> map = new HashMap<String, Object>();
map.put("success", true);
return map;
}
@RequestMapping("/zset")
@ResponseBody
public Map<String, Object> testZset() {
Set<TypedTuple<String>> typedTupleSet = new HashSet<>();
for (int i = 1; i <= 9; i++) {
// 分数
double score = i * 0.1;
// 创建一个TypedTuple对象,存入值和分数
TypedTuple<String> typedTuple = new DefaultTypedTuple<String>("value" + i, score);
typedTupleSet.add(typedTuple);
}
// 往有序集合插入元素
stringRedisTemplate.opsForZSet().add("zset1", typedTupleSet);
// 绑定zset1有序集合操作
BoundZSetOperations<String, String> zsetOps = stringRedisTemplate.boundZSetOps("zset1");
// 增加一个元素
zsetOps.add("value10", 0.26);
Set<String> setRange = zsetOps.range(1, 6);
System.out.println(setRange);
// 按分数排序获取有序集合
Set<String> setScore = zsetOps.rangeByScore(0.2, 0.6);
System.out.println(setScore);
// 定义值范围
Range range = new Range();
range.gt("value3");// 大于value3
// range.gte("value3");// 大于等于value3
// range.lt("value8");// 小于value8
range.lte("value8");// 小于等于value8
// 按值排序,请注意这个排序是按字符串排序
Set<String> setLex = zsetOps.rangeByLex(range);
System.out.println(setLex);
// 删除元素
zsetOps.remove("value9", "value2");
// 求分数
Double score = zsetOps.score("value8");
System.out.println(score);
// 在下标区间下,按分数排序,同时返回value和score
Set<TypedTuple<String>> rangeSet = zsetOps.rangeWithScores(1, 6);
System.out.println(rangeSet);
// 在分数区间下,按分数排序,同时返回value和score
Set<TypedTuple<String>> scoreSet = zsetOps.rangeByScoreWithScores(1, 6);
System.out.println(scoreSet);
// 按从大到小排序
Set<String> reverseSet = zsetOps.reverseRange(2, 8);
System.out.println(reverseSet);
Map<String, Object> map = new HashMap<String, Object>();
map.put("success", true);
return map;
}
@RequestMapping("/multi")
@ResponseBody
public Map<String, Object> testMulti() {
redisTemplate.opsForValue().set("key1", "value1");
List list = (List) redisTemplate.execute((RedisOperations operations) -> {
// 设置要监控key1
operations.watch("key1");
// 开启事务,在exec命令执行前,全部都只是进入队列
operations.multi();
operations.opsForValue().set("key2", "value2");
operations.opsForValue().increment("key1", 1);// ①
// 获取值将为null,因为redis只是把命令放入队列,
Object value2 = operations.opsForValue().get("key2");
System.out.println("命令在队列,所以value为null【" + value2 + "】");
operations.opsForValue().set("key3", "value3");
Object value3 = operations.opsForValue().get("key3");
System.out.println("命令在队列,所以value为null【" + value3 + "】");
// 执行exec命令,将先判别key1是否在监控后被修改过,如果是不执行事务,否则执行事务
return operations.exec();// ②
});
System.out.println(list);
Map<String, Object> map = new HashMap<String, Object>();
map.put("success", true);
return map;
}
@RequestMapping("/pipeline")
@ResponseBody
public Map<String, Object> testPipeline() {
Long start = System.currentTimeMillis();
List list = (List) redisTemplate.executePipelined((RedisOperations operations) -> {
for (int i = 1; i <= 100000; i++) {
operations.opsForValue().set("pipeline_" + i, "value_" + i);
String value = (String) operations.opsForValue().get("pipeline_" + i);
if (i == 100000) {
System.out.println("命令只是进入队列,所以值为空【" + value + "】");
}
}
return null;
});
Long end = System.currentTimeMillis();
System.out.println("耗时:" + (end - start) + "毫秒。");
Map<String, Object> map = new HashMap<String, Object>();
map.put("success", true);
return map;
}
@RequestMapping("/lua")
@ResponseBody
public Map<String, Object> testLua() {
DefaultRedisScript<String> rs = new DefaultRedisScript<String>();
// 设置脚本
rs.setScriptText("return 'Hello Redis'");
// 定义返回类型,注意如果没有这个定义Spring不会返回结果
rs.setResultType(String.class);
RedisSerializer<String> stringSerializer = redisTemplate.getStringSerializer();
// 执行Lua脚本
String str = (String) redisTemplate.execute(rs, stringSerializer, stringSerializer, null);
Map<String, Object> map = new HashMap<String, Object>();
map.put("str", str);
return map;
}
@RequestMapping("/lua2")
@ResponseBody
public Map<String, Object> testLua2(String key1, String key2, String value1, String value2) {
// 定义Lua脚本
String lua = " redis.call('set', KEYS[1], ARGV[1]) \n"
+ " redis.call('set', KEYS[2], ARGV[2]) \n"
+ " local str1 = redis.call('get', KEYS[1]) \n"
+ " local str2 = redis.call('get', KEYS[2]) \n"
+ " if str1 == str2 then \n" + "return 1 \n"
+ " end \n"
+ " return 0 \n";
System.out.println(lua);
// 结果返回为Long
DefaultRedisScript<Long> rs = new DefaultRedisScript<Long>();
rs.setScriptText(lua);
rs.setResultType(Long.class);
// 采用字符串序列化器
RedisSerializer<String> stringSerializer = redisTemplate.getStringSerializer();
// 定义key参数
List<String> keyList = new ArrayList<>();
keyList.add(key1);
keyList.add(key2);
// 传递两个参数值,其中第一个序列化器是key的序列化器,第二个序列化器是参数的序列化器
Long result = (Long) redisTemplate.execute(rs, stringSerializer, stringSerializer, keyList, value1, value2);
Map<String, Object> map = new HashMap<String, Object>();
map.put("result", result);
return map;
}
} | [
"llooww@mail.ustc.edu.cn"
] | llooww@mail.ustc.edu.cn |
293943272cae4f842955350fc93e1588d8a64bb8 | 341f4f27469396114c3f6363cf19930fa1a6ab5f | /app/src/main/java/com/example/happy001/HappyViewController.java | 257c59e1b2e4e4d2a8b59dd83e72ddbbaa3fd993 | [] | no_license | FE-xiaoJiang/Happy001 | 7874acf49838b057b33bcad7c171a0064b903b96 | 398d479b1bed9775e8138c615c35a19f2aa0b521 | refs/heads/main | 2023-06-01T13:48:02.309605 | 2021-05-14T09:17:36 | 2021-05-14T09:17:36 | 367,309,062 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 69 | java | package com.example.happy001;
public class HappyViewController {
}
| [
"keanjiang@tencent.com"
] | keanjiang@tencent.com |
0b2c36a46d6bd49ae1d5d1610bbef1e4d1f7893e | 011fe77cd49adc9b15d1de3f0deea967432a3628 | /miller-manager-web/src/test/java/TestRedis.java | 3895f8ea72d1b8d21802b8fb4f406308053dea92 | [] | no_license | edwardsai/IFuelmaven | a68a65f660c6573ecd1fa4e275eb24d91ac3c67b | b6c9f2308fb169cb21eeefbb0cb744a2ee176aef | refs/heads/master | 2020-03-09T15:06:36.871114 | 2018-06-15T03:05:31 | 2018-06-15T03:05:31 | 128,851,648 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 312 | java | import redis.clients.jedis.Jedis;
//import redis.clients.jedis.JedisPool;
public class TestRedis {
public static void main(String[] args) {
Jedis Jedis = new Jedis("119.23.227.39",6379);
Jedis.set("test2","hello World!");
String tt = Jedis.get("test2");
System.out.println(tt);
Jedis.close();
}
}
| [
"ftzhoua@isoftstone.com"
] | ftzhoua@isoftstone.com |
93db4e68dbb5424f48e77c139d3174880ddd1157 | f62ac88d6e26f35c68b0e14ab2ff6ee0b6c9b059 | /java/steps/yaks-groovy/src/test/java/org/citrusframework/yaks/groovy/GroovyTestSteps.java | bcdc33103e1f14c32cb8e549ac161b31038197ea | [
"Apache-2.0"
] | permissive | NilsBerger/yaks | 12f7b57b7e75548a92e0e80628975cc22c283592 | d59196f4df088ae40f7d61349afbdf1f5e57ea22 | refs/heads/master | 2023-03-08T12:44:22.303158 | 2021-02-17T21:50:17 | 2021-02-17T21:50:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,538 | java | /*
* 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 org.citrusframework.yaks.groovy;
import com.consol.citrus.Citrus;
import com.consol.citrus.annotations.CitrusFramework;
import io.cucumber.java.en.Then;
import org.assertj.core.api.Assertions;
/**
* @author Christoph Deppisch
*/
public class GroovyTestSteps {
@CitrusFramework
private Citrus citrus;
@Then("^verify endpoint ([^\"\\s]+)$")
public void verifyEndpointResolvable(String endpoint) {
Assertions.assertThat(citrus.getCitrusContext().getReferenceResolver().isResolvable(endpoint));
}
@Then("^verify bean ([^\"\\s]+)$")
public void verifyBeanResolvable(String name) {
Assertions.assertThat(citrus.getCitrusContext().getReferenceResolver().isResolvable(name));
}
}
| [
"cdeppisch@redhat.com"
] | cdeppisch@redhat.com |
b9463c3ecbbc21773c4989aacaade151b91c72e7 | fc782bd75b35ce90652614792bc8cdf51e155c4b | /app/src/test/java/com/example/priyanka/mediatorngo/ExampleUnitTest.java | f43dd8c082b582f5a74c68cad252ba45a5658fbf | [] | no_license | priyankapakhale/MediatorNGO | de5050d9c9e6abd7056ad337e0467195bc66db43 | 0117bc863ffa79bb0510dbcdefd6efcab6981eb3 | refs/heads/master | 2021-04-28T12:58:15.844863 | 2018-02-19T16:10:17 | 2018-02-19T16:10:17 | 122,087,214 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 410 | java | package com.example.priyanka.mediatorngo;
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);
}
} | [
"ppakhale@asu.edu"
] | ppakhale@asu.edu |
1a03294e66f880c2ea41632021411f1b31c07ee1 | c0e165f94d9670b51384decff6b24f13dacd13d1 | /app/src/main/java/net/ubpost/www/vlayoutdemo/Btn08Activity.java | c22d976411ffdb1202bcfa1b8d4a6ea0d2896f5f | [] | no_license | xinychan/VLayoutDemo | 5f72bf599dbf22f77dd5c217957ddf506879d040 | aeb9659e98ced76e4eaabf68a2a444e3ad6963a1 | refs/heads/master | 2021-07-20T02:30:25.288082 | 2017-10-28T03:52:41 | 2017-10-28T03:52:41 | 108,617,826 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,843 | java | package net.ubpost.www.vlayoutdemo;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.Toast;
import com.alibaba.android.vlayout.DelegateAdapter;
import com.alibaba.android.vlayout.VirtualLayoutManager;
import com.alibaba.android.vlayout.layout.LinearLayoutHelper;
import com.alibaba.android.vlayout.layout.OnePlusNLayoutHelper;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
/**
* 一拖N布局 (OnePlusNLayoutHelper)
* 将布局分为不同比例,最多是1拖4
*/
public class Btn08Activity extends AppCompatActivity implements MyItemClickListener{
private Btn08Activity mContext;
private VirtualLayoutManager layoutManager;
private RecyclerView.RecycledViewPool viewPool;
private RecyclerView recyclerView;
private LinearLayoutHelper linearLayoutHelper;
private OnePlusNLayoutHelper onePlusNLayoutHelper;
private MyAdapter adapter_linearLayout;
private MyAdapter adapter_onePlusNLayoutHelper;
private List<HashMap<String,Object>> listItem;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_btn08);
mContext = this;
listItem = DataDao.getList100();
recyclerView = (RecyclerView) findViewById(R.id.rv_btn08);
baseSetup();
setLayoutHelper();
setAdapter();
bindAdapter();
}
//绑定适配器
private void bindAdapter() {
List<DelegateAdapter.Adapter> adapters = new LinkedList<>();
//adapters.add(adapter_linearLayout);
adapters.add(adapter_onePlusNLayoutHelper);
DelegateAdapter delegateAdapter = new DelegateAdapter(layoutManager);
delegateAdapter.setAdapters(adapters);
recyclerView.setAdapter(delegateAdapter);
}
//设置适配器
private void setAdapter() {
//线性布局适配器
adapter_linearLayout = new MyAdapter(mContext,linearLayoutHelper,20,listItem);
adapter_linearLayout.setOnItemClickListener(this);
//一拖 N 布局适配器
adapter_onePlusNLayoutHelper = new MyAdapter(mContext,onePlusNLayoutHelper,5,listItem){
// 设置需要展示的数据总数,此处设置是5,即1拖4;最多为5,不能超过5,超过会报IllegalArgumentException
//java.lang.IllegalArgumentException: OnePlusNLayoutHelper only supports maximum 5 children now
// 为了展示效果,通过重写onBindViewHolder()将布局的第一个数据设置为onePlus
@Override
public void onBindViewHolder(MainViewHolder holder, int position) {
super.onBindViewHolder(holder, position);
if (position == 0) {
holder.itemView.setBackgroundColor(getResources().getColor(R.color.colorAccent));
holder.tv.setText("onePlus");
}
if (position == 3) {
holder.itemView.setBackgroundColor(getResources().getColor(R.color.colorAccent));
holder.tv.setText("onePlus");
}
}
};
adapter_onePlusNLayoutHelper.setOnItemClickListener(this);
}
//设置布局
private void setLayoutHelper() {
//设置一个线性布局
linearLayoutHelper = new LinearLayoutHelper();
linearLayoutHelper.setBgColor(getResources().getColor(R.color.colorGreen));
//设置一个一拖N布局
onePlusNLayoutHelper = new OnePlusNLayoutHelper();
// 在构造函数里传入显示的Item数
// 最多是1拖4,即5个
// 所有布局公共属性
//onePlusNLayoutHelper.setItemCount(3);// 设置布局里Item个数
//onePlusNLayoutHelper.setPadding(20, 20, 20, 20);// 设置LayoutHelper的子元素相对LayoutHelper边缘的距离
//onePlusNLayoutHelper.setMargin(20, 20, 20, 20);// 设置LayoutHelper边缘相对父控件(即RecyclerView)的距离
onePlusNLayoutHelper.setBgColor(getResources().getColor(R.color.colorYellow));// 设置背景颜色
//onePlusNLayoutHelper.setAspectRatio(3);// 设置设置布局内每行布局的宽与高的比
}
//基本设置
private void baseSetup() {
layoutManager = new VirtualLayoutManager(mContext);
recyclerView.setLayoutManager(layoutManager);
viewPool = new RecyclerView.RecycledViewPool();
viewPool.setMaxRecycledViews(0,10);
recyclerView.setRecycledViewPool(viewPool);
}
@Override
public void onItemClick(View view, int postion) {
Toast.makeText(this, (String) listItem.get(postion).get("ItemTitle"), Toast.LENGTH_SHORT).show();
}
}
| [
"xinychan@163.com"
] | xinychan@163.com |
31de534153afa52363ab011ed4bc4938937cfa61 | 992eda0e6d3c23fcfbd6c806ccdb37497e2ddadd | /app/src/main/java/kumarworld/rahul/kumarbioseeds/fragment/Fragment_SuccessStories.java | f1e9359827fccf5b3e7905d76ba805fd26fc18df | [] | no_license | RahulBibave/BioSeeds | 1acc979047030339127f7164a71ceef5e578fd03 | 321fc4e74709cde6bf94a1405fe12a515f687dbf | refs/heads/master | 2020-04-25T22:05:26.821149 | 2019-02-28T11:33:06 | 2019-02-28T11:33:06 | 173,100,575 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,327 | java | package kumarworld.rahul.kumarbioseeds.fragment;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.text.Html;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.Timer;
import java.util.TimerTask;
import kumarworld.rahul.kumarbioseeds.R;
import kumarworld.rahul.kumarbioseeds.adapter.ViewPagerAdapter;
public class Fragment_SuccessStories extends Fragment {
private ArrayList<String>url;
private String name,story,address,mobile,createdat;
private TextView mTxtStory,mTxtName,mTxtAddress,mTxtMobile;
private ImageView leftNav,rightNav,img_arrowback;
ViewPager viewPager;
int currentPage = 0;
Timer timer;
final long DELAY_MS = 500;//delay in milliseconds before task is to be executed
final long PERIOD_MS = 3000; // time in milliseconds between successive task executions.
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view=inflater.inflate(R.layout.lay_success_details,container,false);
url=new ArrayList<>();
Bundle bundle = getArguments();
url=bundle.getStringArrayList("valuesArray");
name=bundle.getString("name","No Data Found");
story=bundle.getString("msg","No Data Found");
address=bundle.getString("add","No Data Found")+","+bundle.getString("city","No Data Found");
mobile=bundle.getString("mobile","No Data Found");
createdat=bundle.getString("created","No Data Found");
findViews(view);
// Log.e("vfjdgggggggggggggggggggggggggggggggggggggggggg",""+bundle.getString("msg","No Data Found"));
viewPager=view.findViewById(R.id.viewPager);
ViewPagerAdapter adapter=new ViewPagerAdapter(getContext(),url);
viewPager.setAdapter(adapter);
// Images right navigatin
rightNav.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
int tab = viewPager.getCurrentItem();
tab++;
viewPager.setCurrentItem(tab);
}
});
img_arrowback.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
getActivity().onBackPressed();
}
});
return view;
}
private void findViews(View view) {
mTxtStory=view.findViewById(R.id.txtStory);
mTxtAddress=view.findViewById(R.id.txtAddress);
mTxtMobile=view.findViewById(R.id.txtMobileNo);
mTxtName=view.findViewById(R.id.txtName);
leftNav = view.findViewById(R.id.left_nav);
rightNav = view.findViewById(R.id.right_nav);
img_arrowback=view.findViewById(R.id.img_arrowback);
mTxtStory.setText(Html.fromHtml(story));
mTxtName.setText(name);
mTxtMobile.setText(mobile);
mTxtAddress.setText(address);
}
}
| [
"rahulbibave@gmail.com"
] | rahulbibave@gmail.com |
a175029bdea900f775a37378af5a97bcf9e88ff8 | 10997d70d94a615d7ea50f2035c358bb3a581c09 | /src/com/kristo/pogofakegps/SettingsActivity.java | 744cebd4496314b05ea42c03c53c4e7871448332 | [] | no_license | reverseengineeringer/com.kristo.pogofakegps | 511a794bbd42a7613f9e1cc2da694ba868206f6d | eb7b188653560470378f119f9330bf606153684d | refs/heads/master | 2021-01-20T16:05:20.645547 | 2016-07-19T16:16:39 | 2016-07-19T16:16:39 | 63,709,589 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,645 | java | package com.kristo.pogofakegps;
import android.app.ActionBar;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.os.Build.VERSION;
import android.os.Bundle;
import android.util.Log;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.SeekBar;
import android.widget.Switch;
import java.util.Timer;
import java.util.TimerTask;
public class SettingsActivity
extends Activity
{
Context c;
boolean enable_tilt;
EditText et_refresh_time;
SharedPreferences localSharedPreferences;
ProgressDialog progress;
int refresh_rate;
boolean root_location;
SeekBar sb_refresh_per;
SeekBar sb_tilt;
SeekBar sb_zoom;
Switch sw_root;
Switch sw_terrain;
Switch sw_tilt;
Switch sw_zom;
boolean terrain_map;
int tilt_sensitivity;
double tilt_side = 0.0D;
double tilt_up = 0.0D;
Timer timer;
int timer_counter = 0;
Button zero_tilt;
int zoom_level;
boolean zoom_on_location;
private void push_settings_to_prefs()
{
SharedPreferences.Editor localEditor = localSharedPreferences.edit();
localEditor.putBoolean("s_zoom_on_loc", sw_zom.isChecked());
localEditor.putInt("s_zoom_level", sb_zoom.getProgress());
localEditor.putBoolean("s_root_location", sw_root.isChecked());
localEditor.putBoolean("s_terrain_map", sw_terrain.isChecked());
localEditor.putInt("s_tilt_sensitivity", sb_tilt.getProgress());
localEditor.putBoolean("s_enable_tilt", sw_tilt.isChecked());
int j = Integer.parseInt(et_refresh_time.getText().toString());
int i;
if (j <= 25) {
i = 25;
}
for (;;)
{
localEditor.putInt("s_refresh_rate", i);
Log.i("Refresh_rate", i + "");
localEditor.commit();
return;
i = j;
if (j >= 3000) {
i = 3000;
}
}
}
private void setupActionBar()
{
ActionBar localActionBar = getActionBar();
if (localActionBar != null) {
localActionBar.setDisplayHomeAsUpEnabled(true);
}
}
public void onBackPressed()
{
push_settings_to_prefs();
super.onBackPressed();
}
public void onCreate(Bundle paramBundle)
{
super.onCreate(paramBundle);
setContentView(2130968620);
c = this;
localSharedPreferences = getApplicationContext().getSharedPreferences("MyPref", 0);
zoom_on_location = localSharedPreferences.getBoolean("s_zoom_on_loc", false);
zoom_level = localSharedPreferences.getInt("s_zoom_level", 11);
root_location = localSharedPreferences.getBoolean("s_root_location", false);
refresh_rate = localSharedPreferences.getInt("s_refresh_rate", 2200);
terrain_map = localSharedPreferences.getBoolean("s_terrain_map", false);
enable_tilt = localSharedPreferences.getBoolean("s_enable_tilt", false);
tilt_sensitivity = localSharedPreferences.getInt("s_tilt_sensitivity", 50);
et_refresh_time = ((EditText)findViewById(2131427460));
et_refresh_time.setText(refresh_rate + "");
sb_tilt = ((SeekBar)findViewById(2131427464));
sb_tilt.setProgress(tilt_sensitivity);
sw_tilt = ((Switch)findViewById(2131427462));
sw_tilt.setChecked(enable_tilt);
sw_terrain = ((Switch)findViewById(2131427461));
sw_terrain.setChecked(terrain_map);
zero_tilt = ((Button)findViewById(2131427465));
sw_root = ((Switch)findViewById(2131427457));
sw_root.setChecked(root_location);
sw_zom = ((Switch)findViewById(2131427455));
sw_zom.setChecked(zoom_on_location);
sb_zoom = ((SeekBar)findViewById(2131427456));
if (Build.VERSION.SDK_INT >= 24) {
sb_zoom.setProgress(zoom_level, true);
}
for (;;)
{
setupActionBar();
zero_tilt.setOnClickListener(new View.OnClickListener()
{
public void onClick(View paramAnonymousView)
{
paramAnonymousView = (SensorManager)c.getSystemService("sensor");
final float[] arrayOfFloat1 = new float[3];
final float[] arrayOfFloat2 = new float[3];
final float[] arrayOfFloat3 = new float[3];
final float[] arrayOfFloat4 = new float[9];
SensorEventListener local1 = new SensorEventListener()
{
public void onAccuracyChanged(Sensor paramAnonymous2Sensor, int paramAnonymous2Int) {}
public void onSensorChanged(SensorEvent paramAnonymous2SensorEvent)
{
switch (sensor.getType())
{
default:
return;
case 1:
System.arraycopy(values, 0, arrayOfFloat2, 0, 3);
return;
}
System.arraycopy(values, 0, arrayOfFloat1, 0, 3);
}
};
setListners(paramAnonymousView, local1);
progress = new ProgressDialog(c);
progress.setMessage("Do Not Move Device");
progress.setProgressStyle(1);
progress.setIndeterminate(false);
progress.setProgress(0);
progress.setMax(100);
progress.setCancelable(false);
progress.show();
timer = new Timer();
timer.schedule(new TimerTask()
{
public void run()
{
Log.i("Timer!!", "In Timer");
int i = (int)((timer_counter + 1) / 6.0D * 100.0D);
Log.i("Timer!!", i + "");
SensorManager.getRotationMatrix(arrayOfFloat4, null, arrayOfFloat2, arrayOfFloat1);
SensorManager.getOrientation(arrayOfFloat4, arrayOfFloat3);
Object localObject = SettingsActivity.this;
tilt_up += Double.valueOf(arrayOfFloat3[1]).doubleValue();
localObject = SettingsActivity.this;
tilt_side += Double.valueOf(arrayOfFloat3[2]).doubleValue();
progress.setProgress(i);
localObject = SettingsActivity.this;
timer_counter += 1;
if (timer_counter >= 6)
{
localObject = localSharedPreferences.edit();
((SharedPreferences.Editor)localObject).putString("tilt_up_origin", tilt_up / 6.0D + "");
((SharedPreferences.Editor)localObject).putString("tilt_side_origin", tilt_side / 6.0D + "");
((SharedPreferences.Editor)localObject).commit();
timer_counter = 0;
progress.cancel();
timer.cancel();
}
}
}, 1000L, 500L);
}
});
return;
sb_zoom.setProgress(zoom_level);
}
}
public boolean onOptionsItemSelected(MenuItem paramMenuItem)
{
switch (paramMenuItem.getItemId())
{
default:
return super.onOptionsItemSelected(paramMenuItem);
}
push_settings_to_prefs();
super.onBackPressed();
return true;
}
public void setListners(SensorManager paramSensorManager, SensorEventListener paramSensorEventListener)
{
paramSensorManager.registerListener(paramSensorEventListener, paramSensorManager.getDefaultSensor(1), 3);
paramSensorManager.registerListener(paramSensorEventListener, paramSensorManager.getDefaultSensor(2), 3);
}
}
/* Location:
* Qualified Name: com.kristo.pogofakegps.SettingsActivity
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"reverseengineeringer@hackeradmin.com"
] | reverseengineeringer@hackeradmin.com |
3cabf26276c4e72de9327bce278e52fc3b2dbe01 | f1d8839017b055c0aaee4e830e6968db629b2cb8 | /java-utils/src/org/sgx/utils/tests/JavaUtilsTestBean.java | 67b8bd2293a95801b5e008519675308e97955d0a | [] | no_license | orb1t/my-first-java-projects | 1372e8b5b467cf77f576f999e74c7f7b38aca8d3 | a25c1d035502099eae8f2f5ccae6a7b579d17495 | refs/heads/master | 2020-03-18T13:42:37.508614 | 2018-04-06T12:00:11 | 2018-04-06T12:00:11 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 694 | java | package org.sgx.utils.tests;
public class JavaUtilsTestBean {
//i'm a java bean
String prop1;
Integer prop2;
boolean booleanProp1;
public JavaUtilsTestBean() {}
public JavaUtilsTestBean(String prop1, Integer prop2) {
super();
this.prop1 = prop1;
this.prop2 = prop2;
}
public JavaUtilsTestBean(String prop1, Integer prop2, boolean booleanProp1) {
this(prop1, prop2);
this.booleanProp1 = booleanProp1;
}
public String getProp1() {
return prop1;
}
public void setProp1(String prop1) {
this.prop1 = prop1;
}
public Integer getProp2() {
return prop2;
}
public void setProp2(Integer prop2) {
this.prop2 = prop2;
}
}
| [
"sgurin@netsuite.com"
] | sgurin@netsuite.com |
bd5d7eb78e38974310d6b22f007e4c622056830c | 402f0e6c717b834651be87ef0b8df016cad8c78d | /codigo_fonte/android/WhatsMovie/app/src/androidTest/java/br/com/ilhasoft/whatsmovie/ExampleInstrumentedTest.java | eb60914707a0b000b2b93f59ba5857dd29271c72 | [] | no_license | pablorodrigo/whatsTheMovie | b8a71137f947b0423998a61cbcd565e227352120 | 3013f814a3e588f6f726de21ac3f7ba98f24ef47 | refs/heads/master | 2021-01-01T06:52:03.986678 | 2017-07-26T19:39:34 | 2017-07-26T19:39:34 | 97,534,434 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 756 | java | package br.com.ilhasoft.whatsmovie;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("br.com.ilhasoft.whatsmovie", appContext.getPackageName());
}
}
| [
"wfpablo@hotmail.com"
] | wfpablo@hotmail.com |
533b129aae410a27916ff8c5f03440b5637ae8b5 | af1073ef9cb59c494534c1cfaeece6ffe4062206 | /src/main/java/com/mudassirshahzad/retailservice/services/RetailServiceImpl.java | 4656a6274977e8909c6dff04b7cb4651eca33ee3 | [] | no_license | mudassirshahzad/retail-service | 70e76b9201532fbad21a66f1a6f85e5d408a5a65 | 565eb8f17174e5c0844b674fada607fdc514b6dc | refs/heads/master | 2020-11-30T15:02:26.322198 | 2020-01-10T22:05:24 | 2020-01-10T22:05:24 | 230,425,276 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,175 | java | /**
*
*/
package com.mudassirshahzad.retailservice.services;
import com.mudassirshahzad.retailservice.entities.Item;
import com.mudassirshahzad.retailservice.entities.ItemType;
import com.mudassirshahzad.retailservice.entities.User;
import com.mudassirshahzad.retailservice.entities.UserType;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.List;
import lombok.AllArgsConstructor;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.stereotype.Service;
/**
* @author Mudassir Shahzad Dec 27, 2019
*/
@Service
@AllArgsConstructor
public class RetailServiceImpl implements RetailService {
ConfigurableEnvironment env;
@Override
public double calculateTotal(User user, List<Item> items) {
// 1 - Calculate discount percentage based on user type
float discountPercentage = getDiscountPercentage(user);
// 2 - Calculate total amount of the discountable items
double userDiscountableAmount = getTotalAmountWithoutGroceries(items);
// 3 - Check total bill amount for extra discount
Long moreDiscountOn = Long.parseLong(env.getProperty("discount.on.every"));
double extraDiscount = 0d;
double totalAmount = 0d;
if (userDiscountableAmount >= moreDiscountOn) {
totalAmount = items.stream().mapToDouble(Item::getPrice).sum();
extraDiscount = getExtraDiscount(totalAmount, moreDiscountOn);
}
// 3 - Apply the user discount
double userDiscount = getUserDiscount(userDiscountableAmount, discountPercentage);
return getFinalBillAmount(totalAmount, extraDiscount, userDiscount);
}
@Override
public float getDiscountPercentage(User user) {
if (UserType.EMPLOYEE.equals(user.getUserType())) {
return Float.parseFloat(env.getProperty("discount.employee.percentage"));
} else if (UserType.AFFILIATE.equals(user.getUserType())) {
return Float.parseFloat(env.getProperty("discount.affiliate.percentage"));
} else if (UserType.REGULAR_CUSTOMER.equals(user.getUserType())) {
return Float.parseFloat(env.getProperty("discount.regular.customer.percentage"));
} else {
return Float.parseFloat(env.getProperty("discount.new.customer.percentage"));
}
}
@Override
public double getTotalAmountWithoutGroceries(List<Item> items) {
return items.stream().filter(item -> item.getPrice() != 0L && item.getType() != ItemType.GROCERY)
.mapToDouble(Item::getPrice).sum();
}
@Override
public double getUserDiscount(double totalAmount, float discountPercentage) {
double userDiscount = (totalAmount * (discountPercentage / 100.0f));
BigDecimal roundedUserDiscount = BigDecimal.valueOf(userDiscount).setScale(2, RoundingMode.HALF_UP);
return roundedUserDiscount.doubleValue();
}
@Override
public double getFinalBillAmount(double userDiscountableAmount, double extraDiscount, double userDiscount) {
return (userDiscountableAmount - userDiscount) - extraDiscount;
}
@Override
public double getExtraDiscount(double totalAmount, Long moreDiscountOn) {
double discountAmount = Double.parseDouble(env.getProperty("discount.amount"));
int numerOfTimes = (int) (totalAmount / moreDiscountOn);
return discountAmount * numerOfTimes;
}
}
| [
"mudassir.shahzad@dnata.com"
] | mudassir.shahzad@dnata.com |
cee729613d6d149b96b99952bb1d21078bd55e92 | 0f760ca24100d8f075eef8d87797f3428471e19e | /app/src/main/java/com/example/cosmogallery/data/ApiUtils.java | 31adb047a1eb0eea0a86031ebb7f2f6785f36a4c | [] | no_license | tbahlai/SpaceGallery | ed7c93f660da94bb96e1bf76e4f8bcaf5fffaa3f | 2c44371b1ac3becfd8915b7a03373ca55d5fcab1 | refs/heads/master | 2022-04-28T16:20:46.709817 | 2020-05-03T18:12:46 | 2020-05-03T18:12:46 | 260,644,935 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,161 | java | package com.example.cosmogallery.data;
import com.example.cosmogallery.BuildConfig;
import com.example.cosmogallery.data.api.ApiKeyInterceptor;
import com.example.cosmogallery.data.api.NasaApi;
import com.google.gson.Gson;
import java.io.IOException;
import java.net.ConnectException;
import java.net.SocketTimeoutException;
import java.net.UnknownHostException;
import java.util.Arrays;
import java.util.List;
import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;
public class ApiUtils {
private static OkHttpClient client;
private static Gson gson;
private static Retrofit retrofit;
private static NasaApi nasaApi;
public static final List<Class<? extends IOException>> NETWORK_EXCEPTIONS = Arrays.asList(
UnknownHostException.class,
ConnectException.class,
SocketTimeoutException.class
);
public static OkHttpClient getClient() {
if (client == null) {
OkHttpClient.Builder builder = new OkHttpClient().newBuilder();
builder.addInterceptor(new ApiKeyInterceptor());
if (!BuildConfig.BUILD_TYPE.contains("release")) {
builder.addInterceptor(new HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BODY));
}
client = builder.build();
}
return client;
}
public static Retrofit getRetrofit() {
if (gson == null)
gson = new Gson();
if (retrofit == null) {
retrofit = new Retrofit.Builder()
.baseUrl(BuildConfig.API_URL)
.client(getClient())
.addConverterFactory(GsonConverterFactory.create(gson))
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
.build();
}
return retrofit;
}
public static NasaApi getNasaApi() {
if (nasaApi == null)
nasaApi = getRetrofit().create(NasaApi.class);
return nasaApi;
}
}
| [
"tania.baglay@gmail.com"
] | tania.baglay@gmail.com |
aa8108524308d393c4718b7e83e0d6e061386879 | 87755b0453f76b5ac8e6e9265c8063b36de8b45f | /AuthourityManageSystemParent/AUMS-Admin/src/main/java/com/yueqin/admin/mapper/SysDeptMapper.java | 1e2cdbb9626b08832820e5ad923c7c6c730de965 | [] | no_license | HuangYueQin/AUMS | 2ffa072ca0172e36d7f676bed0eadd522f090df4 | 5871098ede463d549a95a9a17e04fe330ef3676d | refs/heads/master | 2023-05-06T17:58:49.634994 | 2021-05-26T15:19:44 | 2021-05-26T15:19:44 | 359,481,808 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 278 | java | package com.yueqin.admin.mapper;
import com.yueqin.admin.entity.SysDept;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* Mapper 接口
* </p>
*
* @author yueqin
* @since 2021-04-30
*/
public interface SysDeptMapper extends BaseMapper<SysDept> {
}
| [
"root"
] | root |
2fd69da07bd7ab024bc073c586c32fdbdf1fa4d6 | e1b27671ee51bec9b420fccbdb2fd4097735c1ac | /src/main/java/com/example/model/Book.java | e00cbaafbc2106d2c8ebf0f428b96fedbe4067d4 | [] | no_license | kmmizanurrahmanjp/jsp-servlet-crud-master | a54e618bc3b8ab8cfba7821fa695c1ddd981abef | ee632d34b4a17c143bab3945afa5179037dba317 | refs/heads/master | 2020-03-28T19:52:23.009255 | 2018-09-16T17:11:00 | 2018-09-16T17:11:00 | 149,017,238 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,116 | java | package com.example.model;
public class Book {
protected int id;
protected String title;
protected String author;
protected float price;
public Book() {
}
public Book(int id) {
this.id = id;
}
public Book(int id, String title, String author, float price) {
this(title, author, price);
this.id = id;
}
public Book(String title, String author, float price) {
this.title = title;
this.author = author;
this.price = price;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public float getPrice() {
return price;
}
public void setPrice(float price) {
this.price = price;
}
}
| [
"https.mizan@gmail.com"
] | https.mizan@gmail.com |
b909d0f3c11276f7aadd2d850a39e6c63eb5d06d | 0b475366a328a0151c8033385b21ea5b4b82884d | /app/src/main/java/com/example/joel/cletapp/MainActivity.java | 62a130c00af92b5017f2f1124924c7b565424885 | [] | no_license | joelavalos/CletApp | 963fbcc5023a1a2abf53e74fbea2a9cbc1752879 | 31af6968a4240f72080e866770f7cf61de8dfb07 | refs/heads/master | 2021-01-20T11:26:16.180158 | 2016-03-05T23:56:23 | 2016-03-05T23:56:23 | 39,688,167 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 15,910 | java | package com.example.joel.cletapp;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import com.example.joel.cletapp.CRUDDatabase.DesafioCRUD;
import com.example.joel.cletapp.CRUDDatabase.DesafioObjetivoCRUD;
import com.example.joel.cletapp.CRUDDatabase.DesafioRutinaCRUD;
import com.example.joel.cletapp.CRUDDatabase.ObjetivoCRUD;
import com.example.joel.cletapp.CRUDDatabase.RepeticionesCRUD;
import com.example.joel.cletapp.CRUDDatabase.ResumenCRUD;
import com.example.joel.cletapp.CRUDDatabase.RutaCRUD;
import com.example.joel.cletapp.CRUDDatabase.RutinaCRUD;
import com.example.joel.cletapp.CRUDDatabase.SerieCRUD;
import com.example.joel.cletapp.ClasesDataBase.Desafio;
import com.example.joel.cletapp.ClasesDataBase.DesafioObjetivo;
import com.example.joel.cletapp.ClasesDataBase.DesafioRutina;
import com.example.joel.cletapp.ClasesDataBase.Objetivo;
import com.example.joel.cletapp.ClasesDataBase.Repeticiones;
import com.example.joel.cletapp.ClasesDataBase.Resumen;
import com.example.joel.cletapp.ClasesDataBase.Ruta;
import com.example.joel.cletapp.ClasesDataBase.Rutina;
import com.example.joel.cletapp.ClasesDataBase.Serie;
import com.example.joel.cletapp.fragments.Cronometro;
import com.example.joel.cletapp.fragments.DialogoCrearRutina;
import com.example.joel.cletapp.fragments.DialogoDetalleDesafio;
import com.example.joel.cletapp.fragments.MainFragment;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class MainActivity extends ActionBarActivity implements Communicator {
private Toolbar toolbar; //Variable para manejar la ToolBar
private NavigationDrawerFragment drawerFargment; //Variable para manejar el Navegation
private MainFragment mainFragment;
private DesafioCRUD desafioCRUD;
private DesafioObjetivoCRUD desafioObjetivoCRUD;
private ObjetivoCRUD objetivoCRUD;
private int seleccion;
private SerieCRUD serieCRUD;
private RepeticionesCRUD repeticionesCRUD;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main_appbar);
toolbar = (Toolbar) findViewById(R.id.app_bar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setIcon(R.drawable.ic_directions_bike_white_18dp);
inicializarComponentes();
poblarBaseDatos();
seleccion = 0;
drawerFargment.listOpciones.performItemClick(drawerFargment.listOpciones.getAdapter().getView(seleccion, null, null), seleccion, drawerFargment.listOpciones.getAdapter().getItemId(seleccion));
//drawerFargment.cargarFragmento2(getMainFragment(), R.anim.activity_visible_salida_izquierda, R.anim.activity_nuevo_entrada_derecha);
}
private void inicializarComponentes() {
drawerFargment = (NavigationDrawerFragment) getSupportFragmentManager().findFragmentById(R.id.fragment_navigation_drawer);
drawerFargment.setUp(R.id.fragment_navigation_drawer, (DrawerLayout) findViewById(R.id.drawer_layout), toolbar);
}
private void poblarBaseDatos() {
desafioCRUD = new DesafioCRUD(this);
desafioObjetivoCRUD = new DesafioObjetivoCRUD(this);
objetivoCRUD = new ObjetivoCRUD(this);
serieCRUD = new SerieCRUD(this);
repeticionesCRUD = new RepeticionesCRUD(this);
List<Desafio> listaDesafios = new ArrayList<Desafio>();
listaDesafios = desafioCRUD.buscarTodosLosDesafios();
List<Objetivo> listObjetivo;
listObjetivo = objetivoCRUD.buscarTodosLosObjetivos();
if (listObjetivo.isEmpty()) {
Objetivo objetivo = new Objetivo(0, "Resistencia", "Distancia recorrida");
objetivoCRUD.insertarObjetivo(objetivo);
}
/*
Objetivo objetivo = null;
try {
objetivo = objetivoCRUD.buscarObjetivoPorNombre("Distancia");
} catch (ParseException e) {
e.printStackTrace();
}
if (listaDesafios.isEmpty()) {
SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy");
Date parsedInicio = null;
Date parsedFinal = null;
String[] nombres = {"Desafio prueba 1", "Desafio prueba 2", "Desafio prueba 3", "Desafio prueba 4", "Desafio prueba 5"};
String[] notas = {"Nota 1", "Nota prueba 2", "Sin nota", "Quiero bajar de peso", "Ja Ja Ja"};
float[] valores = {10000, 25000, 30000, 46000, 60000};
char[] estado = {'T', 'P', 'P', 'T', 'T'};
int[] exito = {1, 0, 0, 0, 1};
int[] series = {2, 2, 3, 4, 5};
int[] repeticiones = {3, 4, 3, 2, 1};
try {
parsedInicio = format.parse("01/01/2015");
parsedFinal = format.parse("02/01/2015");
} catch (ParseException e) {
e.printStackTrace();
}
for (int i = 0; i < nombres.length; i++) {
Desafio desafio = new Desafio(0,
nombres[i],
notas[i],
new java.sql.Date(parsedInicio.getTime()),
new java.sql.Date(parsedFinal.getTime()),
estado[i],
exito[i],
series[i],
repeticiones[i],
5400);
desafio = desafioCRUD.insertarDesafio(desafio);
DesafioObjetivo desafioObjetivo = new DesafioObjetivo(0, desafio, objetivo, valores[i]);
desafioObjetivoCRUD.insertarDesafioObjetivo(desafioObjetivo);
for (int h = 0; h < series[i]; h++) {
Serie serie = new Serie(0, desafio);
serie = serieCRUD.insertarSerie(serie);
for (int j = 0; j < repeticiones[i]; j++) {
Repeticiones addRepeticiones = new Repeticiones(0, serie, 0);
if (j == 0 && h == 0){
addRepeticiones.setValor(13000);
}
if (j == 1 && h == 0){
addRepeticiones.setValor(14580);
}
if (j == 2 && h == 0){
addRepeticiones.setValor(25900);
}
repeticionesCRUD.insertarRepeticion(addRepeticiones);
}
}
}
}
RutinaCRUD rutinaCRUD = new RutinaCRUD(this);
List<Rutina> listaRutinas = rutinaCRUD.buscarTodasLasRutinas();
if (listaRutinas.isEmpty()) {
//Insertar resumen
Date parsedFechaDesafio = null;
SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy");
try {
parsedFechaDesafio = format.parse("01/01/2015");
} catch (ParseException e) {
e.printStackTrace();
}
ResumenCRUD resumenCRUD = new ResumenCRUD(this);
Resumen newResumen = new Resumen(0, "Resumen defecto", new java.sql.Date(parsedFechaDesafio.getTime()));
newResumen = resumenCRUD.insertarResumen(newResumen);
//Insertar rutina
Date parsedInicio = null;
Date parsedFinal = null;
try {
parsedInicio = format.parse("01/01/2015");
parsedFinal = format.parse("02/01/2015");
} catch (ParseException e) {
e.printStackTrace();
}
Rutina newRutina = new Rutina(0, "Rutina 1", "Rutina defecto", new java.sql.Date(parsedInicio.getTime()), new java.sql.Date(parsedFinal.getTime()), 'T', newResumen);
newRutina = rutinaCRUD.insertarRutina(newRutina);
//Buscar desafio
DesafioCRUD desafioCRUD = new DesafioCRUD(this);
Desafio newDesafio = null;
try {
newDesafio = desafioCRUD.buscarDesafioPorId(1);
} catch (ParseException e) {
e.printStackTrace();
}
//Insertar desafioRutina
DesafioRutinaCRUD desafioRutinaCRUD = new DesafioRutinaCRUD(this);
DesafioRutina newDesafioRutina = new DesafioRutina(0, newRutina, newDesafio, new java.sql.Date(parsedInicio.getTime()));
newDesafioRutina = desafioRutinaCRUD.insertarDesafioRutina(newDesafioRutina);
}
RutaCRUD rutaCRUD = new RutaCRUD(this);
if (rutaCRUD.buscarTodasLasRutas().isEmpty()){
Ruta nuevaRuta = new Ruta();
nuevaRuta.setRutaNombre("Ruta larga");
nuevaRuta.setRutaCordenadas("-33.54179451052759=-70.55631310000001X-33.54192417381435=-70.55499613537368X-33.53943371046656=-70.55632114662704");
rutaCRUD.insertarRuta(nuevaRuta);
nuevaRuta = new Ruta();
nuevaRuta.setRutaNombre("Ruta media");
nuevaRuta.setRutaCordenadas("-29.60880770194574=133.24786600000004X-39.313839609651154=-71.05658075000002X46.433078443460715=2.20882574999996");
rutaCRUD.insertarRuta(nuevaRuta);
nuevaRuta = new Ruta();
nuevaRuta.setRutaNombre("Ruta corta");
nuevaRuta.setRutaCordenadas("37.945467316675405=104.13611175000005X-16.395887034238665=-63.5493965");
rutaCRUD.insertarRuta(nuevaRuta);
}
*/
}
public void cargarFragmento(Fragment fragment, int animacionSalida, int animacioEntrada) {
FragmentManager manager = this.getSupportFragmentManager();
FragmentTransaction transaction = manager.beginTransaction();
transaction.setCustomAnimations(animacionSalida, animacioEntrada, animacionSalida, animacioEntrada);
transaction.replace(R.id.contenedor, fragment);
transaction.commit();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
MenuItem itemOculto = menu.findItem(R.id.action_settings);
itemOculto.setVisible(false);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
Mensaje nuevoMensaje = new Mensaje(this, "boton apretado");
return true;
}
if (id == R.id.action_search) {
FragmentManager manager = this.getSupportFragmentManager();
MainFragment asd = (MainFragment) manager.findFragmentByTag("TagPrincipal");
asd.caminoDeRuta();
return true;
}
if (id == R.id.action_view) {
FragmentManager manager = this.getSupportFragmentManager();
MainFragment asd = (MainFragment) manager.findFragmentByTag("TagPrincipal");
asd.estadoRutinaActual();
return true;
}
return super.onOptionsItemSelected(item);
}
public MainFragment getMainFragment() {
if (mainFragment == null) {
mainFragment = new MainFragment();
}
return mainFragment;
}
@Override
public void Actualizar(String data) {
FragmentManager manager = this.getSupportFragmentManager();
MainFragment asd = (MainFragment) manager.findFragmentByTag("TagPrincipal");
asd.actualizarDatos(data);
}
@Override
public void Eliminar(String data) {
FragmentManager manager = this.getSupportFragmentManager();
MainFragment asd = (MainFragment) manager.findFragmentByTag("TagPrincipal");
asd.detenerRutina(data);
}
@Override
public void Reiniciar(String data) {
new Mensaje(this, data);
}
@Override
public void TerminarRutina(String data) {
FragmentManager manager = this.getSupportFragmentManager();
MainFragment asd = (MainFragment) manager.findFragmentByTag("TagPrincipal");
asd.terminarRutina(data);
}
@Override
public void DiasSeleccionados(ArrayList<Integer> data) {
FragmentManager manager = this.getSupportFragmentManager();
MainFragment asd = (MainFragment) manager.findFragmentByTag("TagPrincipal");
asd.diasSeleccionados(data);
}
@Override
public void SeleccionarRuta(String data) {
FragmentManager manager = this.getSupportFragmentManager();
MainFragment asd = (MainFragment) manager.findFragmentByTag("TagPrincipal");
asd.actualizarRuta(data);
}
@Override
public void GuardarRuta(String data) {
FragmentManager manager = this.getSupportFragmentManager();
MainFragment asd = (MainFragment) manager.findFragmentByTag("TagPrincipal");
asd.guardarRuta(data);
}
@Override
public void OcultarDetalle(String data) {
//FragmentManager manager = this.getSupportFragmentManager();
//MainFragment asd = (MainFragment) manager.findFragmentByTag("TagPrincipal");
//asd.ocultar();
}
@Override
public void pruebaDialogToDialog(String[] valoresDesafios, String[] nombres, String[] objetivos, String[] series, String[] repeticiones) {
FragmentManager manager = this.getSupportFragmentManager();
DialogoCrearRutina asd = (DialogoCrearRutina) manager.findFragmentByTag("crearRutina");
//Fragment prev = this.getSupportFragmentManager().findFragmentByTag("rutinaPersonalizada");
//if (prev != null) {
//DialogFragment df = (DialogFragment) prev;
//df.dismiss();
asd.actualizarAdapter(valoresDesafios, nombres, objetivos, series, repeticiones);
//}
}
@Override
protected void onDestroy() {
super.onDestroy();
//guardarEstadoDesafioDetenido();
//guardarEstadoDesafioNoPause();
//pararCronometro();
}
private void guardarEstadoDesafioDetenido() {
SharedPreferences sharedPref = getPreferences(Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPref.edit();
editor.putString("estadoDesafio", "detenido");
editor.commit();
}
private void guardarEstadoDesafioNoPause() {
//pararCronometro();
SharedPreferences sharedPref = getPreferences(Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPref.edit();
editor.putString("estadoDesafioPause", "nopause");
editor.putInt("valorDesafioPause", 0);
editor.commit();
}
private void pararCronometro() {
Intent service = new Intent(getBaseContext(), Cronometro.class);
stopService(service);
}
/*@Override
public void onBackPressed() {
int count = getSupportFragmentManager().getBackStackEntryCount();
if (count == 0) {
super.onBackPressed();
} else {
//drawerFargment.listOpciones.setAdapter(drawerFargment.adapter);
//getSupportFragmentManager().popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);
}
}*/
}
| [
"joelav_3@hotmail.com"
] | joelav_3@hotmail.com |
abb9ddde9e19ddd5707c8fc94c5da0f21d3cd4bf | f319302c92cce257b79d25d72c03a04adbcf3b8a | /src/openccsensors/common/sensors/TileSensorTarget.java | 64d780c114a573230de724111cbfe3ad3c8a2d9e | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | Cruor/OpenCCSensors | adefa028ec49505b9fd187d6dd938e6584d50797 | f516732a2dcb68ec94b07fea1af9b0dbf782188a | refs/heads/master | 2021-01-18T04:54:08.220260 | 2013-01-13T14:29:39 | 2013-01-13T14:29:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 688 | java | package openccsensors.common.sensors;
import java.util.HashMap;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import openccsensors.common.helper.SensorHelper;
public class TileSensorTarget {
public int xCoord;
public int yCoord;
public int zCoord;
public String rawType;
protected TileSensorTarget(TileEntity targetEntity) {
xCoord = targetEntity.xCoord;
yCoord = targetEntity.yCoord;
zCoord = targetEntity.zCoord;
rawType = targetEntity.getClass().getName();
}
public HashMap getBasicInformation(World world) {
HashMap retMap = new HashMap();
retMap.put("Type", SensorHelper.getType(rawType));
return retMap;
}
}
| [
"mikeefranklin@gmail.com"
] | mikeefranklin@gmail.com |
879a0713af189960cbbfcdbf663aac02641bca95 | d71e879b3517cf4fccde29f7bf82cff69856cfcd | /ExtractedJars/PACT_com.pactforcure.app/javafiles/org/researchstack/backbone/storage/file/PinCodeConfig.java | 97ebdb77756f1de7ecfc4fc50880305ed3465d05 | [
"MIT"
] | permissive | Andreas237/AndroidPolicyAutomation | b8e949e072d08cf6c6166c3f15c9c63379b8f6ce | c1ed10a2c6d4cf3dfda8b8e6291dee2c2a15ee8a | refs/heads/master | 2020-04-10T02:14:08.789751 | 2019-05-16T19:29:11 | 2019-05-16T19:29:11 | 160,739,088 | 5 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,778 | java | // Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) annotate safe
package org.researchstack.backbone.storage.file;
public class PinCodeConfig
{
public PinCodeConfig()
{
this(0x493e0L);
// 0 0:aload_0
// 1 1:ldc2w #27 <Long 0x493e0L>
// 2 4:invokespecial #31 <Method void PinCodeConfig(long)>
// 3 7:return
}
public PinCodeConfig(long l)
{
/* block-local class not found */
class PinCodeType {}
this(((Type) (PinCodeType.Numeric)), 4, l);
// 0 0:aload_0
// 1 1:getstatic #36 <Field PinCodeConfig$PinCodeType PinCodeConfig$PinCodeType.Numeric>
// 2 4:iconst_4
// 3 5:lload_1
// 4 6:invokespecial #39 <Method void PinCodeConfig(PinCodeConfig$Type, int, long)>
// 5 9:return
}
public PinCodeConfig(Type type1, int i, long l)
{
// 0 0:aload_0
// 1 1:invokespecial #41 <Method void Object()>
type = type1;
// 2 4:aload_0
// 3 5:aload_1
// 4 6:putfield #43 <Field PinCodeConfig$Type type>
length = i;
// 5 9:aload_0
// 6 10:iload_2
// 7 11:putfield #45 <Field int length>
autoLockTime = l;
// 8 14:aload_0
// 9 15:lload_3
// 10 16:putfield #47 <Field long autoLockTime>
// 11 19:return
}
public long getPinAutoLockTime()
{
return autoLockTime;
// 0 0:aload_0
// 1 1:getfield #47 <Field long autoLockTime>
// 2 4:lreturn
}
public int getPinLength()
{
return length;
// 0 0:aload_0
// 1 1:getfield #45 <Field int length>
// 2 4:ireturn
}
public Type getPinType()
{
return type;
// 0 0:aload_0
// 1 1:getfield #43 <Field PinCodeConfig$Type type>
// 2 4:areturn
}
public void setPinAutoLockTime(long l)
{
autoLockTime = l;
// 0 0:aload_0
// 1 1:lload_1
// 2 2:putfield #47 <Field long autoLockTime>
// 3 5:return
}
private static final String DIGITS_ALPHABETIC = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
private static final String DIGITS_ALPHANUMERIC = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
private static final String DIGITS_NUMERIC = "1234567890";
private long autoLockTime;
private int length;
private Type type;
// Unreferenced inner class org/researchstack/backbone/storage/file/PinCodeConfig$Type
/* block-local class not found */
class Type {}
}
| [
"silenta237@gmail.com"
] | silenta237@gmail.com |
dc2dd9b1f87854cb7616719bb3e2e6146260749b | 004d939d5100de2dcab9d827d5a8e4a8ecfa17ef | /app/src/test/java/uren/com/happysleepingbabies/ExampleUnitTest.java | 94d1b4812188475e7df13959cce26403491c97cd | [] | no_license | ugurgog/HappySleepingBabies | d9a852e5fab8d53bc7931fa5fd6e865aab4f2634 | 3db9a388a575e522bc2e86e7cd0c8ed42e053a63 | refs/heads/master | 2020-04-21T13:27:19.882974 | 2019-02-07T16:05:54 | 2019-02-07T16:05:54 | 169,598,871 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 389 | java | package uren.com.happysleepingbabies;
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() {
assertEquals(4, 2 + 2);
}
} | [
"32577192+ugurgog@users.noreply.github.com"
] | 32577192+ugurgog@users.noreply.github.com |
653c68aee45bb8dd5e7967aa2c4c02c28637f143 | c9bc23ad5b3b2d21dec737c73c1e6c2a1cbe3504 | /app/src/main/java/android/support/v4/a/s.java | ea6cf334a4ddaaaaab3c8b9c28f566e7fba46924 | [] | no_license | IamWilliamWang/wolf | 2e68faed4cab5ba5b04ae52bc44550be04f36079 | 6b7ff2b74f0413578a1a34132750e5d79b0c0fe6 | refs/heads/master | 2020-05-27T10:45:18.596136 | 2017-02-20T09:58:02 | 2017-02-20T09:58:02 | 82,542,835 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,466 | java | package android.support.v4.a;
import android.content.Context;
import android.content.res.Configuration;
import android.os.Parcelable;
import android.util.AttributeSet;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.List<Landroid.support.v4.a.m;>;
public class s
{
private final t<?> a;
private s(t<?> paramt)
{
this.a = paramt;
}
public static final s a(t<?> paramt)
{
return new s(paramt);
}
m a(String paramString)
{
return this.a.d.b(paramString);
}
public u a()
{
return this.a.i();
}
public View a(View paramView, String paramString, Context paramContext, AttributeSet paramAttributeSet)
{
return this.a.d.a(paramView, paramString, paramContext, paramAttributeSet);
}
public List<m> a(List<m> paramList)
{
if (this.a.d.f == null)
return null;
Object localObject = paramList;
if (paramList == null)
localObject = new ArrayList(b());
((List)localObject).addAll(this.a.d.f);
return (List<m>)localObject;
}
public void a(Configuration paramConfiguration)
{
this.a.d.a(paramConfiguration);
}
public void a(Parcelable paramParcelable, List<m> paramList)
{
this.a.d.a(paramParcelable, paramList);
}
public void a(m paramm)
{
this.a.d.a(this.a, this.a, paramm);
}
public void a(android.support.v4.g.m<String, af> paramm)
{
this.a.a(paramm);
}
public void a(String paramString, FileDescriptor paramFileDescriptor, PrintWriter paramPrintWriter, String[] paramArrayOfString)
{
this.a.b(paramString, paramFileDescriptor, paramPrintWriter, paramArrayOfString);
}
public void a(boolean paramBoolean)
{
this.a.a(paramBoolean);
}
public boolean a(Menu paramMenu)
{
return this.a.d.a(paramMenu);
}
public boolean a(Menu paramMenu, MenuInflater paramMenuInflater)
{
return this.a.d.a(paramMenu, paramMenuInflater);
}
public boolean a(MenuItem paramMenuItem)
{
return this.a.d.a(paramMenuItem);
}
public int b()
{
ArrayList localArrayList = this.a.d.f;
if (localArrayList == null)
return 0;
return localArrayList.size();
}
public void b(Menu paramMenu)
{
this.a.d.b(paramMenu);
}
public boolean b(MenuItem paramMenuItem)
{
return this.a.d.b(paramMenuItem);
}
public void c()
{
this.a.d.h();
}
public Parcelable d()
{
return this.a.d.g();
}
public List<m> e()
{
return this.a.d.f();
}
public void f()
{
this.a.d.i();
}
public void g()
{
this.a.d.j();
}
public void h()
{
this.a.d.k();
}
public void i()
{
this.a.d.l();
}
public void j()
{
this.a.d.m();
}
public void k()
{
this.a.d.n();
}
public void l()
{
this.a.d.o();
}
public void m()
{
this.a.d.q();
}
public void n()
{
this.a.d.r();
}
public boolean o()
{
return this.a.d.d();
}
public void p()
{
this.a.k();
}
public void q()
{
this.a.l();
}
public void r()
{
this.a.m();
}
public android.support.v4.g.m<String, af> s()
{
return this.a.n();
}
}
/* Location: C:\Users\Administrator\Desktop\狼王\classes.jar
* Qualified Name: android.support.v4.a.s
* JD-Core Version: 0.6.0
*/ | [
"iamjerichoholic@hotmail.com"
] | iamjerichoholic@hotmail.com |
1e0f5231fa8d516a2d84150d439543b52d848111 | 559779158afa814dd6b70996539d4b8b2c294ce2 | /OfferCruzEntidades/src/bo/com/offercruz/entidades/Categoria.java | c077e40e8188aa73ff7e3f2459951d6d9c41c0b2 | [] | no_license | urdisitus/Offercruz2 | a138b09a41111bf55581ce93070500e2a5461f3a | 5b7c91818895d31442473e742172d43696b78439 | refs/heads/master | 2020-05-20T03:11:07.852050 | 2014-12-01T00:15:23 | 2014-12-01T00:15:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,763 | java | package bo.com.offercruz.entidades;
// Generated 20-nov-2014 4:32:22 by Hibernate Tools 3.6.0
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
/**
* Categoria generated by hbm2java
*/
public class Categoria implements java.io.Serializable {
private Integer id;
private String nombre;
private int tipo;
private int estado;
private Date fechaCreacion;
private Date fechaModificacion;
private Set empresas = new HashSet(0);
private Set ofertas = new HashSet(0);
private Set ofertas_1 = new HashSet(0);
public Categoria() {
}
public Categoria(String nombre, int tipo, int estado, Date fechaCreacion, Date fechaModificacion) {
this.nombre = nombre;
this.tipo = tipo;
this.estado = estado;
this.fechaCreacion = fechaCreacion;
this.fechaModificacion = fechaModificacion;
}
public Categoria(String nombre, int tipo, int estado, Date fechaCreacion, Date fechaModificacion, Set empresas, Set ofertas, Set ofertas_1) {
this.nombre = nombre;
this.tipo = tipo;
this.estado = estado;
this.fechaCreacion = fechaCreacion;
this.fechaModificacion = fechaModificacion;
this.empresas = empresas;
this.ofertas = ofertas;
this.ofertas_1 = ofertas_1;
}
public Integer getId() {
return this.id;
}
public void setId(Integer id) {
this.id = id;
}
public String getNombre() {
return this.nombre;
}
public void setNombre(String nombre) {
this.nombre = nombre;
}
public int getTipo() {
return this.tipo;
}
public void setTipo(int tipo) {
this.tipo = tipo;
}
public int getEstado() {
return this.estado;
}
public void setEstado(int estado) {
this.estado = estado;
}
public Date getFechaCreacion() {
return this.fechaCreacion;
}
public void setFechaCreacion(Date fechaCreacion) {
this.fechaCreacion = fechaCreacion;
}
public Date getFechaModificacion() {
return this.fechaModificacion;
}
public void setFechaModificacion(Date fechaModificacion) {
this.fechaModificacion = fechaModificacion;
}
public Set getEmpresas() {
return this.empresas;
}
public void setEmpresas(Set empresas) {
this.empresas = empresas;
}
public Set getOfertas() {
return this.ofertas;
}
public void setOfertas(Set ofertas) {
this.ofertas = ofertas;
}
public Set getOfertas_1() {
return this.ofertas_1;
}
public void setOfertas_1(Set ofertas_1) {
this.ofertas_1 = ofertas_1;
}
}
| [
"Ernesto@Ernesto-lenovo"
] | Ernesto@Ernesto-lenovo |
8600b51687fb83627938840d9389b6936e8b5c69 | 9ecfa9cdb5d9611a4289cec7303470cd7c556b34 | /azure-dns-mgmt-api/src/main/java/lol/maki/azuredns/config/R2dbcConfig.java | 99e7ebd5591bca48dac41a99e554ab2fb826a532 | [] | no_license | making/azure-dns-mgmt | 552882a23c71433e4e2c33520885e08ca23423d1 | e29c47af8d8bc80cd3217af2fb140aa4300123f7 | refs/heads/master | 2022-04-23T08:47:06.945220 | 2020-04-24T05:50:40 | 2020-04-24T05:50:40 | 255,113,978 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 915 | java | package lol.maki.azuredns.config;
import io.r2dbc.spi.ConnectionFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.ClassPathResource;
import org.springframework.data.r2dbc.connectionfactory.init.ConnectionFactoryInitializer;
import org.springframework.data.r2dbc.connectionfactory.init.ResourceDatabasePopulator;
@Configuration
public class R2dbcConfig {
@Bean
public ConnectionFactoryInitializer initializer(ConnectionFactory connectionFactory) {
ConnectionFactoryInitializer initializer = new ConnectionFactoryInitializer();
initializer.setConnectionFactory(connectionFactory);
ResourceDatabasePopulator populator = new ResourceDatabasePopulator(new ClassPathResource("schema.sql"));
initializer.setDatabasePopulator(populator);
return initializer;
}
}
| [
"tmaki@pivotal.io"
] | tmaki@pivotal.io |
7aad02f4029fe2af02726a10674349af9aad5b81 | b336b22bf2a011d6c01503f920f05f4585f0f445 | /src/main/java/com/malang/webservice/mobile/domain/users_filter/UsersFilter.java | c6cd96e95c5e15969ab37c953d7464663e5a1213 | [] | no_license | yonggyeom/malang-webservice | 646d5a3d9ee5d0568b5a7f636b444b5c87005bb1 | eacac7a2111012f87cd89319109c83fbd2522409 | refs/heads/master | 2021-04-17T11:21:25.358361 | 2020-05-12T12:59:00 | 2020-05-12T12:59:00 | 249,441,346 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,335 | java | package com.malang.webservice.mobile.domain.users_filter;
import com.malang.webservice.mobile.domain.BaseTimeEntity;
import com.malang.webservice.mobile.web.dto.UsersFilterUpdateRequestDto;
import com.malang.webservice.mobile.web.dto.UsersUpdateRequestDto;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import javax.persistence.*;
import java.sql.Timestamp;
@Getter
@NoArgsConstructor
@Entity
public class UsersFilter extends BaseTimeEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String representativeUserId;
private String friendType ;
private int ageFrom ;
private int ageTo ;
@Builder
public UsersFilter(String representativeUserId, String friendType, int ageFrom, int ageTo) {
this.representativeUserId = representativeUserId;
this.friendType = friendType;
this.ageFrom = ageFrom;
this.ageTo = ageTo;
}
public void update(UsersFilterUpdateRequestDto requestDto) {
this.representativeUserId = requestDto.getRepresentativeUserId();
this.friendType = requestDto.getFriendType();
this.ageFrom = requestDto.getAgeFrom();
this.ageTo = requestDto.getAgeTo();
}
}
| [
"winder0524@gmail.com"
] | winder0524@gmail.com |
fabd1f202c0be73400f65e854633cfef5cd6a23d | c1994fd214d3fdb0e5dad6d9e46a00c1a929215f | /src/app/src/main/java/com/example/alumno/hoteladaspalace/Fragments/GalleryFragment.java | 40e1d9dcd61fa8c35fd226e2be60ad8e4f5461f7 | [] | no_license | EmilBrent/hoteladaspalacetambo | 293c4ce5be2c752dafe2f216a2a7a93aba02e0f1 | cc75c9cda6d4d9372dfc0429e20531802f2e6088 | refs/heads/master | 2020-04-09T03:59:03.266956 | 2018-12-27T02:14:34 | 2018-12-27T02:14:34 | 160,005,654 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 647 | java | package com.example.alumno.hoteladaspalace.Fragments;
import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.example.alumno.hoteladaspalace.R;
public class GalleryFragment extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_gallery, container, false);
}
}
| [
"i1620750@continental.edu.pe"
] | i1620750@continental.edu.pe |
790124cfb1f6c48524d2a116b0e4731ee39bd4cf | a0a440447850b8908794a0e1b4de1a8dd94712de | /src/main/java/com/moh/jhispter/config/LoggingConfiguration.java | 32d90d32adbe9dd371e0992afaf9d360a2701d49 | [] | no_license | Mosouley/uemoa_govies_jhipster | b190fb369c73e58ec057bae17d635a91bb666366 | c18526815b8d4852507ae6d21d51e237966bc1ac | refs/heads/master | 2020-03-16T01:56:13.540008 | 2018-05-07T11:37:03 | 2018-05-07T11:37:03 | 132,452,563 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,576 | java | package com.moh.jhispter.config;
import java.net.InetSocketAddress;
import java.util.Iterator;
import io.github.jhipster.config.JHipsterProperties;
import ch.qos.logback.classic.AsyncAppender;
import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.LoggerContext;
import ch.qos.logback.classic.boolex.OnMarkerEvaluator;
import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.classic.spi.LoggerContextListener;
import ch.qos.logback.core.Appender;
import ch.qos.logback.core.filter.EvaluatorFilter;
import ch.qos.logback.core.spi.ContextAwareBase;
import ch.qos.logback.core.spi.FilterReply;
import net.logstash.logback.appender.LogstashTcpSocketAppender;
import net.logstash.logback.encoder.LogstashEncoder;
import net.logstash.logback.stacktrace.ShortenedThrowableConverter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
@Configuration
public class LoggingConfiguration {
private static final String LOGSTASH_APPENDER_NAME = "LOGSTASH";
private static final String ASYNC_LOGSTASH_APPENDER_NAME = "ASYNC_LOGSTASH";
private final Logger log = LoggerFactory.getLogger(LoggingConfiguration.class);
private LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
private final String appName;
private final String serverPort;
private final JHipsterProperties jHipsterProperties;
public LoggingConfiguration(@Value("${spring.application.name}") String appName, @Value("${server.port}") String serverPort,
JHipsterProperties jHipsterProperties) {
this.appName = appName;
this.serverPort = serverPort;
this.jHipsterProperties = jHipsterProperties;
if (jHipsterProperties.getLogging().getLogstash().isEnabled()) {
addLogstashAppender(context);
addContextListener(context);
}
if (jHipsterProperties.getMetrics().getLogs().isEnabled()) {
setMetricsMarkerLogbackFilter(context);
}
}
private void addContextListener(LoggerContext context) {
LogbackLoggerContextListener loggerContextListener = new LogbackLoggerContextListener();
loggerContextListener.setContext(context);
context.addListener(loggerContextListener);
}
private void addLogstashAppender(LoggerContext context) {
log.info("Initializing Logstash logging");
LogstashTcpSocketAppender logstashAppender = new LogstashTcpSocketAppender();
logstashAppender.setName(LOGSTASH_APPENDER_NAME);
logstashAppender.setContext(context);
String customFields = "{\"app_name\":\"" + appName + "\",\"app_port\":\"" + serverPort + "\"}";
// More documentation is available at: https://github.com/logstash/logstash-logback-encoder
LogstashEncoder logstashEncoder=new LogstashEncoder();
// Set the Logstash appender config from JHipster properties
logstashEncoder.setCustomFields(customFields);
// Set the Logstash appender config from JHipster properties
logstashAppender.addDestinations(new InetSocketAddress(jHipsterProperties.getLogging().getLogstash().getHost(),jHipsterProperties.getLogging().getLogstash().getPort()));
ShortenedThrowableConverter throwableConverter = new ShortenedThrowableConverter();
throwableConverter.setRootCauseFirst(true);
logstashEncoder.setThrowableConverter(throwableConverter);
logstashEncoder.setCustomFields(customFields);
logstashAppender.setEncoder(logstashEncoder);
logstashAppender.start();
// Wrap the appender in an Async appender for performance
AsyncAppender asyncLogstashAppender = new AsyncAppender();
asyncLogstashAppender.setContext(context);
asyncLogstashAppender.setName(ASYNC_LOGSTASH_APPENDER_NAME);
asyncLogstashAppender.setQueueSize(jHipsterProperties.getLogging().getLogstash().getQueueSize());
asyncLogstashAppender.addAppender(logstashAppender);
asyncLogstashAppender.start();
context.getLogger("ROOT").addAppender(asyncLogstashAppender);
}
// Configure a log filter to remove "metrics" logs from all appenders except the "LOGSTASH" appender
private void setMetricsMarkerLogbackFilter(LoggerContext context) {
log.info("Filtering metrics logs from all appenders except the {} appender", LOGSTASH_APPENDER_NAME);
OnMarkerEvaluator onMarkerMetricsEvaluator = new OnMarkerEvaluator();
onMarkerMetricsEvaluator.setContext(context);
onMarkerMetricsEvaluator.addMarker("metrics");
onMarkerMetricsEvaluator.start();
EvaluatorFilter<ILoggingEvent> metricsFilter = new EvaluatorFilter<>();
metricsFilter.setContext(context);
metricsFilter.setEvaluator(onMarkerMetricsEvaluator);
metricsFilter.setOnMatch(FilterReply.DENY);
metricsFilter.start();
for (ch.qos.logback.classic.Logger logger : context.getLoggerList()) {
for (Iterator<Appender<ILoggingEvent>> it = logger.iteratorForAppenders(); it.hasNext();) {
Appender<ILoggingEvent> appender = it.next();
if (!appender.getName().equals(ASYNC_LOGSTASH_APPENDER_NAME)) {
log.debug("Filter metrics logs from the {} appender", appender.getName());
appender.setContext(context);
appender.addFilter(metricsFilter);
appender.start();
}
}
}
}
/**
* Logback configuration is achieved by configuration file and API.
* When configuration file change is detected, the configuration is reset.
* This listener ensures that the programmatic configuration is also re-applied after reset.
*/
class LogbackLoggerContextListener extends ContextAwareBase implements LoggerContextListener {
@Override
public boolean isResetResistant() {
return true;
}
@Override
public void onStart(LoggerContext context) {
addLogstashAppender(context);
}
@Override
public void onReset(LoggerContext context) {
addLogstashAppender(context);
}
@Override
public void onStop(LoggerContext context) {
// Nothing to do.
}
@Override
public void onLevelChange(ch.qos.logback.classic.Logger logger, Level level) {
// Nothing to do.
}
}
}
| [
"mo@MacBook-Pro-de-Moh.local"
] | mo@MacBook-Pro-de-Moh.local |
ccd8088446d95d1bcc6c00587ddc85118d2cc833 | fa93c9be2923e697fb8a2066f8fb65c7718cdec7 | /sources/com/avito/android/tariff/edit_info/EditInfoFragmentKt.java | 17742c21851713d8fc4c4271760c61e4864378ad | [] | no_license | Auch-Auch/avito_source | b6c9f4b0e5c977b36d5fbc88c52f23ff908b7f8b | 76fdcc5b7e036c57ecc193e790b0582481768cdc | refs/heads/master | 2023-05-06T01:32:43.014668 | 2021-05-25T10:19:22 | 2021-05-25T10:19:22 | 370,650,685 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 230 | java | package com.avito.android.tariff.edit_info;
import kotlin.Metadata;
@Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u0002\n\u0000¨\u0006\u0000"}, d2 = {"tariff_release"}, k = 2, mv = {1, 4, 2})
public final class EditInfoFragmentKt {
}
| [
"auchhunter@gmail.com"
] | auchhunter@gmail.com |
26289a9e44543c9eb48c9dd7200f455ff03862c0 | 900f55f8940dc01b75d95bc54ce112534db2cafb | /src/main/java/gui/methodsPanes/ProgonkaPane.java | 090ad943d65f68980b0af0323c06b0c513f9e5b2 | [] | no_license | vladyslav-kramarenko/CMVI | f0353a8462d781bcaaa1310c0038c2d8e95f9cdb | 30069cee21fb7f8a3f95880835d114ebe6608520 | refs/heads/master | 2022-12-02T03:10:17.542245 | 2017-08-14T12:19:31 | 2017-08-14T12:19:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,570 | java | package gui.methodsPanes;
import javax.swing.*;
import javax.swing.table.DefaultTableModel;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;
/**
* Created by razor on 09.06.2017.
*/
public class ProgonkaPane extends JLayeredPane {
public String getTableFuncValue(int index) {
return tableFunc.getModel().getValueAt(0, index).toString();
}
public void setTableFuncValue(String value,int column) {
tableFunc.getModel().setValueAt(value, 0, column);
}
public int getSelectedFuncColumn(){
return tableFunc.getSelectedColumn();
}
public Double getTableValue(int row, int col) {
double value = 0;
try {
value = Double.parseDouble(table.getModel().getValueAt(row, col).toString());
} catch (Exception e) {
}
return value;
}
public int getTableColumnCount() {
return table.getColumnCount();
}
public String getTextField_B() {
return textField_B.getText();
}
public String getTextField_A() {
return textField_A.getText();
}
public String getTextField_b() {
return textField_b.getText();
}
public String getTextField_a() {
return textField_a.getText();
}
private JTable table;
private JTable tableFunc;
private JTextField textField_a;
private JTextField textField_b;
private JTextField textField_A;
private JTextField textField_B;
private final JScrollPane scrollPane_func = new JScrollPane();
private final JScrollPane scrollPane = new JScrollPane();
private final JLabel labelAlfa = new JLabel("\u03B1");
private final JLabel labelBeta = new JLabel("\u03B2");
private final JLabel label_A = new JLabel("A");
private final JLabel label_a = new JLabel("a =");
private final JLabel label_B = new JLabel("B");
private final JLabel label_b = new JLabel("b =");
private final JLabel labelFunction = new JLabel("y'' + p(x)y' + q(x)y = f(x)");
public ProgonkaPane() {
textField_a = new JTextField();
textField_a.setBounds(22, 25, 51, 23);
add(textField_a);
textField_a.setColumns(10);
textField_b = new JTextField();
textField_b.setColumns(10);
textField_b.setBounds(22, 48, 51, 23);
add(textField_b);
label_a.setBounds(0, 30, 26, 16);
add(label_a);
label_b.setBounds(0, 52, 26, 16);
add(label_b);
textField_A = new JTextField();
textField_A.setBounds(436, 101, 54, 23);
add(textField_A);
textField_A.setColumns(10);
textField_B = new JTextField();
textField_B.setBounds(436, 138, 54, 23);
add(textField_B);
textField_B.setColumns(10);
label_A.setBounds(446, 88, 45, 16);
add(label_A);
label_B.setBounds(445, 127, 45, 16);
add(label_B);
labelAlfa.setBounds(63, 107, 18, 16);
add(labelAlfa);
labelBeta.setBounds(63, 134, 18, 16);
add(labelBeta);
labelFunction.setBounds(188, 0, 215, 16);
add(labelFunction);
scrollPane_func.setBounds(73, 18, 417, 58);
add(scrollPane_func);
tableFunc = new JTable();
tableFunc.setModel(new DefaultTableModel(new Object[][]{
{
" ", " ", null
},}, new String[]
{
"p(x)", "q(x)", "f(x)"
}));
scrollPane_func.setViewportView(tableFunc);
scrollPane.setBounds(73, 88, 360, 80);
add(scrollPane);
scrollPane.setVisible(true);
table = new JTable(2, 2);
for (int i = 0; i < 2; i++) {
table.getColumnModel().getColumn(i).setMinWidth(25);
table.getColumnModel().getColumn(i).setMaxWidth(200);
table.getColumnModel().getColumn(i).setPreferredWidth(100);
}
table.getColumnModel().getColumn(0).setHeaderValue("y'");
table.getColumnModel().getColumn(1).setHeaderValue("y");
table.getTableHeader().resizeAndRepaint();
table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
table.setBounds(141, 12, 438, 305);
scrollPane.setViewportView(table);
}
public void saveData(PrintWriter pw) {
String s;
s = tableFunc.getModel().getValueAt(0, 0).toString();
pw.println(s);
s = tableFunc.getModel().getValueAt(0, 1).toString();
pw.println(s);
s = tableFunc.getModel().getValueAt(0, 2).toString();
pw.println(s);
s = textField_a.getText() + " ";
s += textField_b.getText() + " ";
s += textField_A.getText() + " ";
s += textField_B.getText() + " ";
for (int i = 0; i < 2; i++) {
s += table.getModel().getValueAt(0, i) + " ";
s += table.getModel().getValueAt(1, i) + " ";
}
pw.print(s);
}
public void loadData(StringTokenizer st, BufferedReader br) {
try {
tableFunc.getModel().setValueAt(st.nextToken(), 0, 0);
String s = br.readLine();
st = new StringTokenizer(s);
tableFunc.getModel().setValueAt(st.nextToken(), 0, 1);
s = br.readLine();
st = new StringTokenizer(s);
tableFunc.getModel().setValueAt(st.nextToken(), 0, 2);
s = br.readLine();
st = new StringTokenizer(s);
textField_a.setText(st.nextToken());
textField_b.setText(st.nextToken());
textField_A.setText(st.nextToken());
textField_B.setText(st.nextToken());
table = new JTable(2, 2);
for (int i = 0; i < 2; i++) {
table.getColumnModel().getColumn(i).setMinWidth(50);
table.getColumnModel().getColumn(i).setMaxWidth(200);
table.getColumnModel().getColumn(i).setPreferredWidth(60);
table.getModel().setValueAt(Double.parseDouble(st.nextToken()), 0, i);
table.getModel().setValueAt(Double.parseDouble(st.nextToken()), 1, i);
}
table.getColumnModel().getColumn(0).setHeaderValue("y'");
table.getColumnModel().getColumn(1).setHeaderValue("y");
table.getTableHeader().resizeAndRepaint();
table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
table.revalidate();
table.repaint();
scrollPane.setViewportView(table);
} catch (Exception e) {
}
}
}
| [
"razorvlad1992@gmail.com"
] | razorvlad1992@gmail.com |
d12b8ba48dad52bf7790694f7b3549662bc262c0 | c7a351c404155e57e22ac0462d51734c8dc5fdd1 | /src/test/java/net/medavante/regression/testscripts/studynavigator/FPTC_1539_MoveAssessmentWithAPaperTranscription_SIP.java | f0304cb3655b19c31fa41de13a24805df0241240 | [] | no_license | arushi1998goel/Medavante | 2de88935388006fffcfa205d0dff1670cf8b2b9c | 6d106a310631d806c247c53b439b42f1cd557bb9 | refs/heads/master | 2023-02-18T23:35:03.190792 | 2021-01-21T17:59:38 | 2021-01-21T17:59:38 | 331,709,545 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 15,251 | java | package net.medavante.regression.testscripts.studynavigator;
import java.util.Properties;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Factory;
import org.testng.annotations.Test;
import net.medavante.portal.dataproviders.DataProviders;
import net.medavante.portal.pages.MedAvantePortalPage;
import net.medavante.portal.pages.studynavigator.StudyDashBoardPage;
import net.medavante.portal.selenium.core.BaseTest;
import net.medavante.portal.selenium.core.Configuration;
import net.medavante.portal.utilities.Constants;
public class FPTC_1539_MoveAssessmentWithAPaperTranscription_SIP extends BaseTest {
protected String subject_CompletedWithPaperTranscriptionSource = "SUBJ_" + generateRandomString(5);
protected String subject_CompletedWithOutPaperTranscriptionSource = "SUBJ_" + generateRandomString(5);
protected String subject_NotCompleted_1 = "SUBJ_" + generateRandomString(5);
protected String subject_NotCompleted_2 = "SUBJ_" + generateRandomString(5);
private String visitName, visitName4, moveToAssesment;
@Factory(dataProvider = "Browsers", dataProviderClass = DataProviders.class)
public FPTC_1539_MoveAssessmentWithAPaperTranscription_SIP(String browser) {
super(browser);
}
@BeforeMethod
public void getTestData() throws Exception {
System.setProperty("className", getClass().getSimpleName());
Properties properties = Configuration.readTestData("RegressionTestData");
studyName = properties.getProperty("Study2180");
visitName = properties.getProperty("visitName");
visitName4 = properties.getProperty("visitName4");
moveToAssesment = properties.getProperty("moveToAssesment");
reportLog(
"Creating a subject for the Study Site (Pr#3), 3.1. Assessment_1 with a paper transcription with source");
dashBoardPage = loginPage.loginInApplication(SuperAdminUN, SuperAdminPW);
studyNavigatorDashBoardPage = dashBoardPage.selectHorizontalUpperNavMenuItem(StudyDashBoardPage.class,
Constants.NavigateText, Constants.StudyText);
studyNavigatorDashBoardPage.selectStudy(studyName, Constants.ATAssignedRater_10);
studyNavigatorDashBoardPage.verifyAddSubjectBtnIsDisplayed();
studyNavigatorDashBoardPage.clickOnAddSubjectBTN();
studyNavigatorDashBoardPage.verifyAddSubjectPopUpIsDisplayed();
studyNavigatorDashBoardPage.inputScreeningNum(subject_CompletedWithPaperTranscriptionSource);
studyNavigatorDashBoardPage.selectSubjectLanguage("English (US)");
subjectDetailPage = studyNavigatorDashBoardPage.clickOnSaveBTN();
subjectDetailPage.verifyNewSubjectDetailPage();
subjectDetailPage.clickOnVisitRow(visitName);
subjectDetailPage.clickOnAddVisitIcon();
subjectDetailPage.selectClinRoDropDownOption(Constants.ATAssignedRater_10);
assessmentDetailPage = subjectDetailPage
.selectThumbnailIMGFromMultipleConfiguredFormType(Constants.ClinRO_Form_Label);
assessmentDetailPage.clickOnCheckBoxInAssesmentDetailPage();
assessmentDetailPage.verifyMarkAsNotAdministeredCheckBoxIsSet();
assessmentDetailPage.conifrmButtonAppears();
assessmentDetailPage.clickOnConfirmButton();
assessmentDetailPage.clickOnYesButtonOfConfirmationWindow();
assessmentDetailPage.verifyReasonForChangePopUpDisplayed();
assessmentDetailPage.setStartedDate();
assessmentDetailPage.selectReasonForChangeOption(Constants.TechincalDifficulties_Reason_for_Change);
assessmentDetailPage.eSignForReasonForChange(SuperAdminUN, SuperAdminPW);
assessmentDetailPage.waitSpinnerToBecomeInvisible();
assessmentDetailPage.clickOnRefreshIconUntillElementNotVisibleAndVerifyStatus(Constants.Complete_Status);
assessmentDetailPage.uncheckNotAdministeredCheckBox();
assessmentDetailPage.conifrmButtonAppears();
assessmentDetailPage.clickOnConfirmButton();
assessmentDetailPage.verifyReasonForChangePopUpDisplayed();
assessmentDetailPage.selectReasonForChangeOption(Constants.TechincalDifficulties_Reason_for_Change);
assessmentDetailPage.eSignForReasonForChange(SuperAdminUN, SuperAdminPW);
assessmentDetailPage.waitSpinnerToBecomeInvisible();
assessmentDetailPage.clickOnPaperTrnscriptionCheckBox();
assessmentDetailPage.conifrmButtonAppears();
assessmentDetailPage.clickOnConfirmButton();
assessmentDetailPage.verifyReasonForChangePopUpDisplayed();
assessmentDetailPage.selectReasonForChangeOption(Constants.TechincalDifficulties_Reason_for_Change);
assessmentDetailPage.eSignForReasonForChange(SuperAdminUN, SuperAdminPW);
assessmentDetailPage.clickOnRefreshIconUntillElementNotVisibleAndVerifyStatus(Constants.Complete_Status);
assessmentDetailPage.verifyPaperTranscriptionCheckBoxFlagSet();
assessmentDetailPage.selectSourceOrAttachementOption("Attachments");
assessmentDetailPage.clickOnPaperSourceIcon();
assessmentDetailPage.closeOnFailedassessment();
assessmentDetailPage.uploadAttachementFile(Constants.exeFilePath, Constants.PDFFile2ToUpload,
Constants.windowTitle);
assessmentDetailPage.selectHorizontalUpperNavMenuItem(MedAvantePortalPage.class, Constants.HomeNavText);
reportLog(
"Creating a subject for the Study Site (Pr#3), 3.2. Assessment_2 without a paper transcription with source");
studyNavigatorDashBoardPage = dashBoardPage.selectHorizontalUpperNavMenuItem(StudyDashBoardPage.class,
Constants.NavigateText, Constants.StudyText);
studyNavigatorDashBoardPage.selectStudy(studyName, Constants.ATAssignedRater_10);
studyNavigatorDashBoardPage.verifyAddSubjectBtnIsDisplayed();
studyNavigatorDashBoardPage.clickOnAddSubjectBTN();
studyNavigatorDashBoardPage.verifyAddSubjectPopUpIsDisplayed();
studyNavigatorDashBoardPage.inputScreeningNum(subject_CompletedWithOutPaperTranscriptionSource);
studyNavigatorDashBoardPage.selectSubjectLanguage("English (US)");
studyNavigatorDashBoardPage.clickOnSaveBTN();
subjectDetailPage.verifyNewSubjectDetailPage();
subjectDetailPage.clickOnVisitRow(visitName4);
subjectDetailPage.clickOnAddVisitIcon();
subjectDetailPage.selectClinRoDropDownOption(Constants.ATAssignedRater_10);
assessmentDetailPage = subjectDetailPage
.selectThumbnailIMGFromMultipleConfiguredFormType(Constants.ClinRO_Form_Label);
assessmentDetailPage.clickOnCheckBoxInAssesmentDetailPage();
assessmentDetailPage.verifyMarkAsNotAdministeredCheckBoxIsSet();
assessmentDetailPage.conifrmButtonAppears();
assessmentDetailPage.clickOnConfirmButton();
assessmentDetailPage.clickOnYesButtonOfConfirmationWindow();
assessmentDetailPage.verifyReasonForChangePopUpDisplayed();
assessmentDetailPage.setStartedDate();
assessmentDetailPage.selectReasonForChangeOption(Constants.TechincalDifficulties_Reason_for_Change);
assessmentDetailPage.eSignForReasonForChange(SuperAdminUN, SuperAdminPW);
assessmentDetailPage.clickOnRefreshIconUntillElementNotVisibleAndVerifyStatus(Constants.Complete_Status);
assessmentDetailPage.uncheckNotAdministeredCheckBox();
assessmentDetailPage.conifrmButtonAppears();
assessmentDetailPage.clickOnConfirmButton();
assessmentDetailPage.verifyReasonForChangePopUpDisplayed();
assessmentDetailPage.selectReasonForChangeOption(Constants.TechincalDifficulties_Reason_for_Change);
assessmentDetailPage.eSignForReasonForChange(SuperAdminUN, SuperAdminPW);
assessmentDetailPage.clickOnRefreshIconUntillElementNotVisibleAndVerifyStatus(Constants.Complete_Status);
assessmentDetailPage.clickOnPaperTrnscriptionCheckBox();
assessmentDetailPage.conifrmButtonAppears();
assessmentDetailPage.clickOnConfirmButton();
assessmentDetailPage.verifyReasonForChangePopUpDisplayed();
assessmentDetailPage.selectReasonForChangeOption(Constants.TechincalDifficulties_Reason_for_Change);
assessmentDetailPage.eSignForReasonForChange(SuperAdminUN, SuperAdminPW);
assessmentDetailPage.waitSpinnerToBecomeInvisible();
assessmentDetailPage.closeOnFailedassessment();
assessmentDetailPage.selectHorizontalUpperNavMenuItem(MedAvantePortalPage.class, Constants.HomeNavText);
reportLog("Creating a subject for the Study Site (Pr#4), 4.1. Assessment_1 Not Completed Non_Cr");
studyNavigatorDashBoardPage = dashBoardPage.selectHorizontalUpperNavMenuItem(StudyDashBoardPage.class,
Constants.NavigateText, Constants.StudyText);
studyNavigatorDashBoardPage.selectStudy(studyName, Constants.ATAssignedRater_10);
studyNavigatorDashBoardPage.verifyAddSubjectBtnIsDisplayed();
studyNavigatorDashBoardPage.clickOnAddSubjectBTN();
studyNavigatorDashBoardPage.verifyAddSubjectPopUpIsDisplayed();
studyNavigatorDashBoardPage.inputScreeningNum(subject_NotCompleted_1);
studyNavigatorDashBoardPage.selectSubjectLanguage("English (US)");
studyNavigatorDashBoardPage.clickOnSaveBTN();
subjectDetailPage.verifyNewSubjectDetailPage();
subjectDetailPage.clickOnVisitRow(visitName);
assessmentDetailPage.selectHorizontalUpperNavMenuItem(MedAvantePortalPage.class, Constants.HomeNavText);
reportLog("Creating a subject for the Study Site (Pr#4), 4.2. Assessment_2 Not Completed Non_Cr");
studyNavigatorDashBoardPage = dashBoardPage.selectHorizontalUpperNavMenuItem(StudyDashBoardPage.class,
Constants.NavigateText, Constants.StudyText);
studyNavigatorDashBoardPage.selectStudy(studyName, Constants.ATAssignedRater_10);
studyNavigatorDashBoardPage.verifyAddSubjectBtnIsDisplayed();
studyNavigatorDashBoardPage.clickOnAddSubjectBTN();
studyNavigatorDashBoardPage.verifyAddSubjectPopUpIsDisplayed();
studyNavigatorDashBoardPage.inputScreeningNum(subject_NotCompleted_2);
studyNavigatorDashBoardPage.selectSubjectLanguage("English (US)");
studyNavigatorDashBoardPage.clickOnSaveBTN();
subjectDetailPage.verifyNewSubjectDetailPage();
subjectDetailPage.clickOnVisitRow(visitName4);
loginPage.logoutApplication();
}
/**
* =========================================================================
* Test Case Id: FP-TC-1539 Test Case Name: Move Assessment with a paper
* transcription ===========================================
*
*
*/
@Test
public void FPTC_1539_verifyMoveAssessmentWithAPaperTranscription_SIP() throws InterruptedException, Exception {
reportLog("1:Log in to the Portal with PR#1");
dashBoardPage = loginPage.loginInApplication(SuperAdminUN, SuperAdminPW);
studyNavigatorDashBoardPage = dashBoardPage.selectHorizontalUpperNavMenuItem(StudyDashBoardPage.class,
Constants.NavigateText, Constants.StudyText);
studyNavigatorDashBoardPage.selectStudy(studyName, Constants.ATAssignedRater_10);
reportLog("1.1:navigate to Assessments Listing");
studyNavigatorDashBoardPage.navigateToAssessmentsListing();
reportLog("1.2 Search visit1 and subject in assessment page");
studyNavigatorDashBoardPage.selectByAssesmentNameAndVisitAndSubjectName(
Constants.Assesment_AdasCog14List1FormName, visitName, subject_CompletedWithPaperTranscriptionSource);
reportLog("1.3 Verify Action button is displaying");
assessmentDetailPage.verifyOptionsIsPresentInActionDropDown(moveToAssesment);
reportLog("2 Select option of change assesment");
assessmentDetailPage.selectActionToMoveAssessment();
reportLog("2.1 Check that Visit PR#4 is displayed in Move To Assessment drop-down list ");
assessmentDetailPage.clickOnChangeToSelectSubjectDropDown();
assessmentDetailPage.selectChangeToSubject(subject_NotCompleted_1);
assessmentDetailPage.clickOnChangeToVisitDropDown();
assessmentDetailPage.verifyVisitIsPresentInChangeToVisitDropDown(visitName);
reportLog("2.2 Select the visit from dropdown in change assesment section");
assessmentDetailPage.changeVisitDropDown(visitName);
assessmentDetailPage.clickOnSaveButtonOnChangeAssesment();
reportLog("2.3 Click on Confirm yes button");
assessmentDetailPage.clickOnConfirmButtonOfChangeAssesment();
reportLog("2.4 : Enter all details for reason for change");
assessmentDetailPage.selectReasonForChangeOption(Constants.IncorrectAssessmentAdministered);
assessmentDetailPage.eSignForReasonForChange(SuperAdminUN, SuperAdminPW);
reportLog("2.5 Verify the assesment has been changed");
assessmentDetailPage.verifyAssesmentChanged();
reportLog("2.6 Click on close icon");
assessmentDetailPage.closeAssesmentSuccessMessage();
reportLog(
"2.6Check that the Assessment PR#4 got a paper transcription with source and all appropriate changes");
assessmentDetailPage.verifyPaperTranscriptionCheckBoxFlagSet();
reportLog("2.7 Click on Attachement link");
assessmentDetailPage.selectSourceOrAttachementOption("Attachments");
reportLog("Verify Pdf is Present");
assessmentDetailPage.verifyPaperSourceAttachementIsPresent();
reportLog("3.1:navigate to Dashboard");
assessmentDetailPage.selectHorizontalUpperNavMenuItem(MedAvantePortalPage.class, Constants.HomeNavText);
studyNavigatorDashBoardPage = dashBoardPage.selectHorizontalUpperNavMenuItem(StudyDashBoardPage.class,
Constants.NavigateText, Constants.StudyText);
studyNavigatorDashBoardPage.selectStudy(studyName, Constants.ATAssignedRater_10);
reportLog("3.2:navigate to Assessments Listing");
studyNavigatorDashBoardPage.navigateToAssessmentsListing();
reportLog("3.3 Search visit1 and subject in assessment page");
studyNavigatorDashBoardPage.selectByAssesmentNameAndVisitAndSubjectName(
Constants.Assesment_AdasCog14List1FormName, visitName4,
subject_CompletedWithOutPaperTranscriptionSource);
reportLog("3.4 Verify Action button is displaying");
assessmentDetailPage.verifyOptionsIsPresentInActionDropDown(moveToAssesment);
reportLog("3.5 Select option of change assesment");
assessmentDetailPage.selectActionToMoveAssessment();
reportLog("3.6 Check that Visit PR#4 is displayed in Move To Assessment drop-down list ");
assessmentDetailPage.clickOnChangeToSelectSubjectDropDown();
assessmentDetailPage.selectChangeToSubject(subject_NotCompleted_2);
assessmentDetailPage.clickOnChangeToVisitDropDown();
assessmentDetailPage.verifyVisitIsPresentInChangeToVisitDropDown(visitName4);
reportLog("3.7 Select the visit from dropdown in change assesment section");
assessmentDetailPage.changeVisitDropDown(visitName);
assessmentDetailPage.clickOnSaveButtonOnChangeAssesment();
reportLog("3.8 Click on Confirm yes button");
assessmentDetailPage.clickOnConfirmButtonOfChangeAssesment();
reportLog("3.9 : Enter all details for reason for change");
assessmentDetailPage.selectReasonForChangeOption(Constants.IncorrectAssessmentAdministered);
assessmentDetailPage.eSignForReasonForChange(SuperAdminUN, SuperAdminPW);
reportLog("3.10 Verify the assesment has been changed");
assessmentDetailPage.verifyAssesmentChanged();
reportLog("3.11 Click on close icon");
assessmentDetailPage.closeAssesmentSuccessMessage();
reportLog("3.12 Check that the Assessment PR#4 got a paper transcription with source and all appropriate changes");
assessmentDetailPage.verifyPaperTranscriptionCheckBoxFlagSet();
reportLog("3.13 Click on Attachement link");
assessmentDetailPage.selectSourceOrAttachementOption("Attachments");
reportLog("3.14 Verify Pdf is Present");
assessmentDetailPage.verifyPaperSourceAttachementIsNotPresent();
reportLog("3.15:Logout application");
loginPage.logoutApplication();
reportLog("3.16:Verify user is logout");
loginPage.verifyUserLogout();
}
}
| [
"Arushi.g@360logica.com"
] | Arushi.g@360logica.com |
0f92abacfb6028850f94a2c5f13adafd4b723e7a | e26bacd2a3722148d2efe144224fc36dce4e1092 | /scheduletask/src/main/java/com/liujun/schedule/application/taskflow/constant/GraphPointEnum.java | 268a9ec2a03041f19e69369a54716e3f00fae6c3 | [] | no_license | kkzfl22/schedule | 2efaed73e527ff36af50dbd3776b140d2542a958 | 0567f940714c05d910c55a51d05a28140abdd1bb | refs/heads/main | 2023-07-04T05:12:33.000010 | 2021-08-03T12:36:32 | 2021-08-03T12:36:32 | 390,570,127 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 731 | java | package com.liujun.schedule.application.taskflow.constant;
/**
* 虚拟顶点信息
*
* @author liujun
* @version 0.0.1
* @date 2019/12/13
*/
public enum GraphPointEnum {
/** 虚拟结束顶点,用来标识出结束任务的结束点,由系统自动添加完成 */
VIRTUAL_FINISH_POINT(Long.MIN_VALUE),
/** 不存在环的标识 */
NOT_CYCLE_FLAG(-1L),
;
/** 顶点信息 */
private Long point;
GraphPointEnum(Long point) {
this.point = point;
}
public Long getPoint() {
return point;
}
@Override
public String toString() {
final StringBuilder sb = new StringBuilder("GraphPointEnum{");
sb.append("point=").append(point);
sb.append('}');
return sb.toString();
}
}
| [
"liujun@paraview.cn"
] | liujun@paraview.cn |
b3fc088b568f0d33846903e4724c0375f5bd2e63 | ba4a427257ad516512d46b2478f308c4c8bb8f4d | /common/src/main/java/com/bonree/ants/manager/proto/CmdsRequestProto.java | 4572e3de00b87814a5866741b213c295e8f3762c | [] | no_license | zhwei4150/monitor_manager | b74de9c262cf7bd8b0cec5bd7affff64e9f92119 | 6d7c42a61ca5e926d2aa1cfac8c8ed6d49ba62c9 | refs/heads/master | 2020-04-10T04:38:30.052899 | 2018-12-07T10:16:34 | 2018-12-07T10:16:34 | 160,804,103 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 750 | java | package com.bonree.ants.manager.proto;
public class CmdsRequestProto {
private String moduleName;
private String cmdName;
private int type;
private String data;
public String getModuleName() {
return moduleName;
}
public void setModuleName(String moduleName) {
this.moduleName = moduleName;
}
public String getCmdName() {
return cmdName;
}
public void setCmdName(String cmdName) {
this.cmdName = cmdName;
}
public String getData() {
return data;
}
public void setData(String data) {
this.data = data;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
}
| [
"zhwei4150@126.com"
] | zhwei4150@126.com |
a71395a8aef57b7d336ab57b4786bd93e5b2db66 | 55964132fdfe6177eaf6af24189dc6d67c63e894 | /Java Projects/Boss-Employees/Boss-Employees/src/main/java/app/controller/MembruController.java | 21ac05b563e6270982d612bd48c2976ac634c4b4 | [] | no_license | Laura-ElenaComanac/Projects | 8e8144e9b2005391e3b64efbe71828f2cd2e1486 | 52319ae7fa3eb656de31963e730a8cae6e534007 | refs/heads/master | 2023-04-27T10:05:27.456603 | 2021-02-25T07:29:14 | 2021-02-25T07:29:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,459 | java | package app.controller;
import app.domain.Discutie;
import app.domain.DiscutieSef;
import app.domain.Echipa;
import app.service.DiscutieService;
import app.service.EchipaService;
import app.utils.events.DiscutieChangeEvent;
import app.utils.events.Event;
import app.utils.observer.Observer;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.TextField;
import javafx.scene.control.cell.PropertyValueFactory;
import javafx.stage.Stage;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.LinkedList;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.StreamSupport;
public class MembruController implements Observer<Event> {
private EchipaService echipaService, echipaActivaService;
private DiscutieService discutieService;
ObservableList<Echipa> modelMembri = FXCollections.observableArrayList();
ObservableList<Echipa> modelMembriActivi = FXCollections.observableArrayList();
ObservableList<Discutie> modelMesaje = FXCollections.observableArrayList();
Stage mainStage;
Boolean aFostInactiv = false;
Boolean esteActiv = true;
@FXML
TextField mesajField;
@FXML
TableView<Echipa> tableViewMembri;
@FXML
TableView<Echipa> tableViewMembriActivi;
@FXML
TableView<Discutie> tableViewMesajePrimite;
@FXML
TableColumn<Echipa, String> tableColumnNumeMembru;
@FXML
TableColumn<Echipa, String> tableColumnRolMembru;
@FXML
TableColumn<Discutie, String> tableColumnNumeMesaj;
@FXML
TableColumn<Discutie, String> tableColumnMesaj;
@FXML
TableColumn<Discutie, LocalDateTime> tableColumnOraMesaj;
public void setEchipaActivaService(EchipaService echipaActivaService){
this.echipaActivaService = echipaActivaService;
echipaActivaService.addObserver(this);
}
public void setEchipaService(EchipaService echipaService){
this.echipaService = echipaService;
echipaService.addObserver(this);
}
public void setDiscutieService(DiscutieService discutieService){
this.discutieService = discutieService;
discutieService.addObserver(this);
}
public void setMainStage(Stage mainStage) {
this.mainStage = mainStage;
}
@FXML
public void initialize(){
tableColumnNumeMembru.setCellValueFactory(new PropertyValueFactory<Echipa,String>("nume"));
tableColumnRolMembru.setCellValueFactory(new PropertyValueFactory<Echipa,String>("rol"));
tableColumnNumeMesaj.setCellValueFactory(new PropertyValueFactory<Discutie, String>("numeExpeditor"));
tableColumnMesaj.setCellValueFactory(new PropertyValueFactory<Discutie, String>("mesaj"));
tableColumnOraMesaj.setCellValueFactory(new PropertyValueFactory<Discutie, LocalDateTime>("ora"));
}
public void initModel(Event event){
Iterable<Echipa> membriActivi = echipaActivaService.getAllEntities();
List<Echipa> membriActiviList = StreamSupport.stream(membriActivi.spliterator(), false).collect(Collectors.toList());
modelMembriActivi.setAll(membriActiviList);
tableViewMembriActivi.setItems(modelMembriActivi);
if(event instanceof DiscutieChangeEvent) {
Discutie d = ((DiscutieChangeEvent) event).getData();
Boolean cond1 = !d.getNumeExpeditor().equals(mainStage.getTitle());
if(d instanceof DiscutieSef) {
if (((DiscutieSef) d).getDestinatar().equals(mainStage.getTitle())) {
modelMesaje.add(d);
tableViewMesajePrimite.setItems(modelMesaje);
}
}else {
if (cond1) {
modelMesaje.add(d);
tableViewMesajePrimite.setItems(modelMesaje);
}
}
}
}
@Override
public void update(Event event) {
initModel(event);
}
@FXML
public void handleMaRetrag(ActionEvent actionEvent) {
Echipa membru = echipaActivaService.getUserByName(mainStage.getTitle());
echipaActivaService.deleteEntity(membru);
discutieService.removeObserver(this);
aFostInactiv = true;
esteActiv = false;
}
@FXML
public void handleRevin(ActionEvent actionEvent) {
Echipa membru = echipaService.getUserByName(mainStage.getTitle());
echipaActivaService.addEntity(membru);
discutieService.addObserver(this);
esteActiv = true;
}
@FXML
public void handleMesajePierdute(ActionEvent actionEvent) {
if(!aFostInactiv) {
MessageAlert.showErrorMessage(null, "Nu ai fost inactiv!");
return;
}
if(!esteActiv)
return;
aFostInactiv = false;
Iterable<Discutie> discutii = discutieService.getAllEntities();
List<Discutie> discutiiList = StreamSupport.stream(discutii.spliterator(), false)
.filter(d->{
Boolean cond1 = !d.getNumeExpeditor().equals(mainStage.getTitle());
if(d instanceof DiscutieSef) {
if (((DiscutieSef) d).getDestinatar().equals(mainStage.getTitle()))
return true;
}else {
if(cond1)
return true;
}
return false;
})
.collect(Collectors.toList());
modelMesaje.setAll(discutiiList);
tableViewMesajePrimite.setItems(modelMesaje);
}
@FXML
public void handletrimiteMesaj(ActionEvent actionEvent) {
Echipa membru = echipaActivaService.getUserByName(mainStage.getTitle());
String mesajText = mesajField.getText();
ZoneId zid = ZoneId.of("Europe/Bucharest");
LocalDateTime dt = LocalDateTime.now(zid);
String date = dt.toString().replace('T', ' ').substring(0,16);
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
LocalDateTime dateTime = LocalDateTime.parse(date, formatter);
Discutie mesaj = new Discutie(membru.getNume(),mesajText,dateTime);
discutieService.addEntity(mesaj);
}
}
| [
"laura.elena.olaru@gmail.com"
] | laura.elena.olaru@gmail.com |
7c8537f8aebb485415ccaf64c13851cb727891b4 | 697833daeb203add9ad68d5f2c28df97baac177b | /framework-base/src/main/java/org/unicorn/framework/base/config/xss/XssHttpServletRequestWrapper.java | 3d3bdaed205cf67d5ff79db068db87956bc5342f | [] | no_license | unicorn-framework/framework | be66296e54249f725c7de52fb1c89aaa1d560d7a | 8ce0e870b2379ab2ff25871679c612acbe8bdf3d | refs/heads/dev-v2.1.0 | 2023-08-08T11:16:18.572327 | 2021-11-19T10:07:27 | 2021-11-19T10:07:27 | 224,378,581 | 1 | 1 | null | 2023-09-12T13:56:47 | 2019-11-27T08:13:39 | Java | UTF-8 | Java | false | false | 1,188 | java | package org.unicorn.framework.base.config.xss;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
/**
* @author xiebin
*/
public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper {
public XssHttpServletRequestWrapper(HttpServletRequest request) {
super(request);
}
@Override
public String getHeader(String name) {
return JsoupUtil.clean(super.getHeader(name));
}
@Override
public String getQueryString() {
return JsoupUtil.clean(super.getQueryString());
}
@Override
public String getParameter(String name) {
return JsoupUtil.clean(super.getParameter(name));
}
@Override
public String[] getParameterValues(String name) {
String[] values = super.getParameterValues(name);
if (values != null) {
int length = values.length;
String[] escapseValues = new String[length];
for (int i = 0; i < length; i++) {
escapseValues[i] = JsoupUtil.clean(values[i]);
}
return escapseValues;
}
return super.getParameterValues(name);
}
}
| [
"xiebin1631216@163.com"
] | xiebin1631216@163.com |
42a4c5e67641efe66cd8696658bad9033fc34474 | a90c8768833ab2df5b5b9ae3417da5377a97b928 | /AsifApp4.java | 67559350f9427ff53043df54084dc17b5df0ca0b | [] | no_license | mohammedshakh1/JavaBasic | af49b382f5dd0bcea3262911a9a4a5542c6a58ba | e0cca12668b861bcacb6f59daf13bfe3ca6c4218 | refs/heads/master | 2022-11-24T13:58:16.586476 | 2020-07-27T22:39:14 | 2020-07-27T22:39:14 | 283,020,690 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 130 | java | public class AsifApp4{
public static void main(String[] args){
System.out.println("Asif App 4 is running well");
}
}
| [
"you@example.com"
] | you@example.com |
7dc6e65610014d33c4f6ad099ece092c1269577a | 7ffefd0f466e19136cc5bd90f151a508962da0ba | /src/UDP/P2_UDP.java | 42612f8e304071b23d96ca8b11d054be7e5c8e5e | [] | no_license | leoproject/SD-2016.1 | 9acf85230e377ab11a1076b73d7958fb02265198 | baa743cb77da25e31bfcea133e27d8bc99033fc9 | refs/heads/master | 2020-05-21T16:43:19.139488 | 2016-09-28T16:23:45 | 2016-09-28T16:23:45 | 63,812,083 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,080 | java | package UDP;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.SocketException;
import java.util.Scanner;
public class P2_UDP {
public static void main(String[] args) throws Exception {
System.out.println("Terminal do P2!!!!! \n");
// Processo de Recieve do processo 2
DatagramSocket socket = new DatagramSocket(4040);
byte [] buf = new byte[300];
DatagramPacket pack = new DatagramPacket(buf, buf.length);
socket.receive(pack);
String msg = new String(pack.getData());
int portOr = pack.getPort();
InetAddress addrOr = pack.getAddress();
System.out.println("P1:"+msg.trim());
//Processo de SEND do processo 2
Scanner read = new Scanner(System.in);
System.out.print("P2:");
String msg2 = read.nextLine();
//String msg2 = "Ola tudo bem?";
byte [] buf2 = msg2.getBytes();
int portDest2 = 3030;
InetAddress addrDest2 = InetAddress.getLocalHost();
DatagramPacket pack2 = new DatagramPacket(buf2, buf2.length,addrDest2, portDest2);
socket.send(pack2);
socket.close();
}
}
| [
"leonardo2013ufs@gmail.com"
] | leonardo2013ufs@gmail.com |
326263dd825df8f944e199172cb1f501a3d2b615 | 22e6bf275fdf02a7ff2046e7c37282dde85bb43e | /core/src/test/resources/plugin/controller/contextual/simple/Contextualizer.java | 87aa4e559e057b5764a70688a66bad0d4e32a76d | [] | no_license | ybz216/juzu | 05206904eb7099abaa5a477224e4dcb4de9ed4c2 | 37612ff8b031ec55523fa4654546ab4c2536fc2c | refs/heads/master | 2022-05-11T10:50:40.699471 | 2020-01-14T14:18:50 | 2020-01-29T18:27:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,505 | java | /*
* Copyright 2013 eXo Platform SAS
*
* 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 plugin.controller.contextual.simple;
import juzu.impl.request.ControllerHandler;
import juzu.impl.request.Stage;
import juzu.Response;
import juzu.impl.request.ContextualParameter;
import juzu.impl.request.Request;
import juzu.impl.request.RequestFilter;
import java.io.ByteArrayInputStream;
/** @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a> */
public class Contextualizer implements RequestFilter<Stage.Handler> {
@Override
public Class<Stage.Handler> getStageType() {
return Stage.Handler.class;
}
@Override
public Response handle(Stage.Handler argument) {
Request request = argument.getRequest();
ControllerHandler m = request.getHandler();
ContextualParameter in = (ContextualParameter)m.getParameter("in");
request.getContextualArguments().put(in, new ByteArrayInputStream("__foo__".getBytes()));
return argument.invoke();
}
}
| [
"julien@julienviet.com"
] | julien@julienviet.com |
2e14a718774b1844323fd56a8f68449b665066f1 | aeb6fe6b2710cbb9210ed91ab96b27dfdee64b37 | /src/com/example/aademo/util/AnimationUtil.java | 366bd0ce041976d3ce7b361aafe68c2781f72655 | [] | no_license | mikeddy/meProjects | 3a8a4ea09b5b5defd5023d2581bd47eca1fb140a | c74d471aed3580cf933b1767ccd5b23a120799fc | refs/heads/master | 2020-12-24T05:10:02.600498 | 2018-01-28T06:57:21 | 2018-01-28T06:57:21 | 19,843,608 | 6 | 3 | null | null | null | null | UTF-8 | Java | false | false | 852 | java | package com.example.aademo.util;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationSet;
/**
* Created by mik_eddy on 15/8/15.
*/
public class AnimationUtil {
public static void repeatAnimation(final AnimationSet mAnimSet, final View v){
mAnimSet.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
v.startAnimation(mAnimSet);
}
@Override
public void onAnimationRepeat(Animation animation) {
}
});
mAnimSet.setFillAfter(true);
mAnimSet.setFillBefore(true);
v.startAnimation(mAnimSet);
}
}
| [
"mik.eddy186@gmail.com"
] | mik.eddy186@gmail.com |
f997aa664522fe4f71a9eb35a2a48565245d97ec | 37d8a5ddfc9ec788e013a52d31c43a89fabf1ddb | /app/src/main/java/kz/jihc/registration/models/User.java | 7ba06f541eb4131d5e807be333bf85b99b1590ce | [] | no_license | myktybayev/jihc_lesson | 8e5afa278592dd5f723c971e54aaeac168ff0c41 | 4e424f38d8c38b713ba61eb65735cf29931b1c53 | refs/heads/master | 2023-03-30T17:29:26.851690 | 2021-04-07T05:50:24 | 2021-04-07T05:50:24 | 355,427,234 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,012 | java | package kz.jihc.registration.models;
import java.io.Serializable;
public class User implements Serializable {
String name;
String surname;
String email;
String phoneNumber;
public User(){}
public User(String name, String surname, String email, String phoneNumber){
this.name = name;
this.surname = surname;
this.email = email;
this.phoneNumber = phoneNumber;
}
public void setName(String name){
this.name = name;
}
public String getName() {
return name;
}
public String getSurname() {
return surname;
}
public void setSurname(String surname) {
this.surname = surname;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPhoneNumber() {
return phoneNumber;
}
public void setPhoneNumber(String phoneNumber) {
this.phoneNumber = phoneNumber;
}
}
| [
"mykty-baha@bk.ru"
] | mykty-baha@bk.ru |
d8c27d22798c1930c655a342e131499ad252668a | d97c1298b515385cedd1ffde51d2c0418479dfd8 | /elasticsearch/LIS/src/main/java/com/example/laxtech/LIS/LisApplication.java | 654519836dcd96b7bfe9de19a472217d9789021a | [] | no_license | gsanjeev/springbootsamples | f4d10fda47bdb3d0d336e737b3f61850294b106c | e4181060084388c76ebf31b8a3d385197a6298ff | refs/heads/master | 2022-06-23T01:42:18.167536 | 2019-09-02T12:29:02 | 2019-09-02T12:29:02 | 117,226,860 | 0 | 0 | null | 2022-06-17T01:51:19 | 2018-01-12T10:18:16 | Java | UTF-8 | Java | false | false | 1,897 | java | package com.example.laxtech.LIS;
import org.elasticsearch.client.Client;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.elasticsearch.core.ElasticsearchOperations;
import java.util.List;
import java.util.Map;
@SpringBootApplication
public class LisApplication implements CommandLineRunner {
public static void main(String[] args) {
SpringApplication.run(LisApplication.class, args);
}
@Autowired
private ElasticsearchOperations es;
@Autowired
private BookService bookService;
@Override
public void run(String... args) throws Exception {
printElasticSearchInfo();
bookService.save(new Book("1001", "Elasticsearch Basics", "Sanjeev Tripathi", "21-FEB-2018"));
bookService.save(new Book("1002", "Apache Lucene Basics", "Sanjeev Tripath", "15-MAR-2018"));
bookService.save(new Book("1003", "Apache Solr Basics", "Sanjeev Tripath", "11-MAR-2018"));
System.out.println("FindByAuther Books Result");
Page<Book> books = bookService.findByAuthor("Sanjeev", new PageRequest(0, 10));
books.forEach(x -> System.out.println(x));
System.out.println("FindByTitle Books Result");
List<Book> booksResult = bookService.findByTitle("Elasticsearch Basics");
booksResult.forEach(x->System.out.println(x));
}
//useful for debug, print elastic search details
private void printElasticSearchInfo() {
System.out.println("--ElasticSearch--");
Client client = es.getClient();
Map<String, String> asMap = client.settings().getAsMap();
asMap.forEach((k, v) -> {
System.out.println(k + " = " + v);
});
System.out.println("--ElasticSearch--");
}
}
| [
"gsanjeevtripathi@gmail.com"
] | gsanjeevtripathi@gmail.com |
9fb442ac13fb3a48445f964457301710820b48f5 | 317e6e8571cf3736b729b840c54bfd2a2ccca769 | /src/main/java/com/studygo/controller/FavoriteController.java | 8f4b35f312f7c9d06dbafb846814baecb819a05f | [] | no_license | tsunghanjacktsai/study-go-website | a1605d4255775619027fee848dcf80471b096f8b | 56346166a56a9e27d5110de8fd50b56c53e2e103 | refs/heads/master | 2022-01-27T04:52:16.045135 | 2019-05-01T10:08:33 | 2019-05-01T10:08:33 | 183,940,768 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,221 | java | package com.studygo.controller;
import com.studygo.bean.Article;
import com.studygo.bean.Favorite;
import com.studygo.service.ArticleService;
import com.studygo.service.RankingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import com.studygo.service.FavoriteService;
@RequestMapping("/favoriteController")
@Controller
public class FavoriteController {
@Autowired
FavoriteService favoriteService;
@Autowired
RankingService rankingService;
@Autowired
ArticleService articleService;
/**
* Delete favorite article (by sid)
* @param favorite
* @return
*/
@RequestMapping("/deleteFavorite")
public String deleteFavorite(Favorite favorite) {
int aUserid = articleService.getArticleUserId(favorite.getFid());
favoriteService.deleteFavorite(favorite);
rankingService.updateRankingFavoritenum(aUserid);
double total = rankingService.getRankingTotal(aUserid);
total -= 0.5;
rankingService.updateRankingTotal(total, aUserid);
return "redirect:/index.jsp"; // redirect
}
/**
* Delete favorite article (by userid & fid)
* @param favorite
* @return
*/
@RequestMapping("/deleteFavoriteByUseridAndFid")
public String deleteFavoriteByUseridAndFid(Favorite favorite) {
int aUserid = articleService.getArticleUserId(favorite.getFid());
favoriteService.deleteFavoriteByUseridAndFid(favorite);
rankingService.updateRankingFavoritenum(aUserid);
double total = rankingService.getRankingTotal(aUserid);
total -= 0.5;
rankingService.updateRankingTotal(total, aUserid);
return "redirect:../userController/getMyself"; // redirect
}
/**
* Add a favorite
* @param favorite
* @return
*/
@RequestMapping("/setFavorite")
public String setFavorite(Favorite favorite, Article article) {
int aUserid = articleService.getArticleUserId(favorite.getFid());
favoriteService.setFavorite(favorite);
rankingService.updateRankingFavoritenum(aUserid);
double total = rankingService.getRankingTotal(aUserid);
total += 0.5;
rankingService.updateRankingTotal(total, aUserid);
return "redirect:/index.jsp"; // redirect
}
}
| [
"jack870131@outlook.com"
] | jack870131@outlook.com |
cd94be7e5dffc3a2d1bd54a2f9c45c673088959c | 895ea02e9fbbbddccd2f550769600608a5ce26bf | /CoreAlgorithms/src/au/gov/asd/tac/constellation/algorithms/sna/similarity/PreferentialAttachmentPlugin.java | 6be4959c78d8028e0d86d983e3db50df0446e6e7 | [
"Apache-2.0"
] | permissive | sol695510/constellation | 8e26a739a8ae09755f1ff2061206d13566d8b432 | 9ab9e0cc3a0bb673204d74d5b017453a882845a0 | refs/heads/master | 2020-12-19T13:40:11.523350 | 2020-03-16T22:31:41 | 2020-03-16T22:31:41 | 226,787,694 | 1 | 0 | Apache-2.0 | 2019-12-20T00:16:47 | 2019-12-09T04:54:54 | null | UTF-8 | Java | false | false | 9,433 | java | /*
* Copyright 2010-2019 Australian Signals Directorate
*
* 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 au.gov.asd.tac.constellation.algorithms.sna.similarity;
import au.gov.asd.tac.constellation.algorithms.sna.SnaConcept;
import au.gov.asd.tac.constellation.graph.GraphConstants;
import au.gov.asd.tac.constellation.graph.GraphWriteMethods;
import au.gov.asd.tac.constellation.graph.schema.SchemaAttribute;
import au.gov.asd.tac.constellation.graph.visual.concept.VisualConcept;
import au.gov.asd.tac.constellation.pluginframework.Plugin;
import au.gov.asd.tac.constellation.pluginframework.PluginException;
import au.gov.asd.tac.constellation.pluginframework.PluginExecution;
import au.gov.asd.tac.constellation.pluginframework.PluginInfo;
import au.gov.asd.tac.constellation.pluginframework.PluginInteraction;
import au.gov.asd.tac.constellation.pluginframework.parameters.PluginParameter;
import au.gov.asd.tac.constellation.pluginframework.parameters.PluginParameters;
import au.gov.asd.tac.constellation.pluginframework.parameters.types.BooleanParameterType;
import au.gov.asd.tac.constellation.pluginframework.parameters.types.BooleanParameterType.BooleanParameterValue;
import au.gov.asd.tac.constellation.pluginframework.templates.SimpleEditPlugin;
import au.gov.asd.tac.constellation.schema.visualschema.VisualSchemaPluginRegistry;
import au.gov.asd.tac.constellation.utilities.datastructure.Tuple;
import java.util.BitSet;
import java.util.HashMap;
import java.util.Map;
import org.openide.util.NbBundle;
import org.openide.util.lookup.ServiceProvider;
/**
* Calculates preferential attachment for each pair of vertices.
*
* @author canis_majoris
*/
@ServiceProvider(service = Plugin.class)
@NbBundle.Messages("PreferentialAttachmentPlugin=Preferential Attachment")
@PluginInfo(tags = {"ANALYTIC"})
public class PreferentialAttachmentPlugin extends SimpleEditPlugin {
private static final SchemaAttribute PREFERENTIAL_ATTACHMENT_ATTRIBUTE = SnaConcept.TransactionAttribute.PREFERENTIAL_ATTACHMENT;
public static final String INCLUDE_CONNECTIONS_IN_PARAMETER_ID = PluginParameter.buildId(PreferentialAttachmentPlugin.class, "include_connections_in");
public static final String INCLUDE_CONNECTIONS_OUT_PARAMETER_ID = PluginParameter.buildId(PreferentialAttachmentPlugin.class, "include_connections_out");
public static final String TREAT_UNDIRECTED_BIDIRECTIONAL_PARAMETER_ID = PluginParameter.buildId(PreferentialAttachmentPlugin.class, "treat_undirected_bidirectional");
public static final String SELECTED_ONLY_PARAMETER_ID = PluginParameter.buildId(PreferentialAttachmentPlugin.class, "selected_only");
@Override
public PluginParameters createParameters() {
final PluginParameters parameters = new PluginParameters();
final PluginParameter<BooleanParameterValue> includeConnectionsInParameter = BooleanParameterType.build(INCLUDE_CONNECTIONS_IN_PARAMETER_ID);
includeConnectionsInParameter.setName("Include Incoming");
includeConnectionsInParameter.setDescription("Include incoming connections");
includeConnectionsInParameter.setBooleanValue(true);
parameters.addParameter(includeConnectionsInParameter);
final PluginParameter<BooleanParameterValue> includeConnectionsOutParameter = BooleanParameterType.build(INCLUDE_CONNECTIONS_OUT_PARAMETER_ID);
includeConnectionsOutParameter.setName("Include Outgoing");
includeConnectionsOutParameter.setDescription("Include outgoing connections");
includeConnectionsOutParameter.setBooleanValue(true);
parameters.addParameter(includeConnectionsOutParameter);
final PluginParameter<BooleanParameterValue> treatUndirectedBidirectionalParameter = BooleanParameterType.build(TREAT_UNDIRECTED_BIDIRECTIONAL_PARAMETER_ID);
treatUndirectedBidirectionalParameter.setName("Include Undirected");
treatUndirectedBidirectionalParameter.setDescription("Treat undirected connections as bidirectional connections");
treatUndirectedBidirectionalParameter.setBooleanValue(true);
parameters.addParameter(treatUndirectedBidirectionalParameter);
final PluginParameter<BooleanParameterValue> selectedOnlyParameter = BooleanParameterType.build(SELECTED_ONLY_PARAMETER_ID);
selectedOnlyParameter.setName("Selected Only");
selectedOnlyParameter.setDescription("Calculate using only selected elements");
selectedOnlyParameter.setBooleanValue(false);
parameters.addParameter(selectedOnlyParameter);
return parameters;
}
@Override
public void edit(final GraphWriteMethods graph, final PluginInteraction interaction, final PluginParameters parameters) throws InterruptedException, PluginException {
final boolean includeConnectionsIn = parameters.getBooleanValue(INCLUDE_CONNECTIONS_IN_PARAMETER_ID);
final boolean includeConnectionsOut = parameters.getBooleanValue(INCLUDE_CONNECTIONS_OUT_PARAMETER_ID);
final boolean treatUndirectedBidirectional = parameters.getBooleanValue(TREAT_UNDIRECTED_BIDIRECTIONAL_PARAMETER_ID);
final boolean selectedOnly = parameters.getBooleanValue(SELECTED_ONLY_PARAMETER_ID);
final int vertexSelectedAttributeId = VisualConcept.VertexAttribute.SELECTED.get(graph);
// map each vertex to its neighbour count
final int vertexCount = graph.getVertexCount();
final BitSet[] neighbours = new BitSet[vertexCount];
final BitSet update = new BitSet(vertexCount);
final BitSet selected = new BitSet(vertexCount);
for (int vertexPosition = 0; vertexPosition < vertexCount; vertexPosition++) {
final int vertexId = graph.getVertex(vertexPosition);
neighbours[vertexPosition] = new BitSet(vertexCount);
for (int vertexNeighbourPosition = 0; vertexNeighbourPosition < graph.getVertexNeighbourCount(vertexId); vertexNeighbourPosition++) {
final int neighbourId = graph.getVertexNeighbour(vertexId, vertexNeighbourPosition);
final int neighbourPosition = graph.getVertexPosition(neighbourId);
if (vertexPosition == neighbourPosition) {
continue;
}
final int linkId = graph.getLink(vertexId, neighbourId);
for (int linkEdgePosition = 0; linkEdgePosition < graph.getLinkEdgeCount(linkId); linkEdgePosition++) {
final int edgeId = graph.getLinkEdge(linkId, linkEdgePosition);
final int edgeDirection = graph.getEdgeDirection(edgeId);
final boolean isRequestedDirection = (treatUndirectedBidirectional && edgeDirection == GraphConstants.UNDIRECTED
|| includeConnectionsIn && graph.getEdgeDestinationVertex(edgeId) == neighbourId
|| includeConnectionsOut && graph.getEdgeSourceVertex(edgeId) == neighbourId);
if (isRequestedDirection) {
if (!SimilarityUtilities.checkEdgeTypes(graph, edgeId)) {
continue;
}
neighbours[vertexPosition].set(neighbourPosition, true);
update.set(vertexPosition, true);
}
}
}
final boolean vertexSelected = graph.getBooleanValue(vertexSelectedAttributeId, vertexId);
selected.set(vertexPosition, vertexSelected);
}
// calculate preferential attachment for every pair of vertices on the graph
final Map<Tuple<Integer, Integer>, Float> paScores = new HashMap<>();
for (int vertexOnePosition = update.nextSetBit(0); vertexOnePosition >= 0; vertexOnePosition = update.nextSetBit(vertexOnePosition + 1)) {
for (int vertexTwoPosition = update.nextSetBit(0); vertexTwoPosition >= 0; vertexTwoPosition = update.nextSetBit(vertexTwoPosition + 1)) {
if (!selectedOnly || (selected.get(vertexOnePosition) || selected.get(vertexTwoPosition))) {
if (vertexOnePosition >= vertexTwoPosition) {
continue;
}
final int vertexOneId = graph.getVertex(vertexOnePosition);
final int vertexTwoId = graph.getVertex(vertexTwoPosition);
final float paScore = graph.getVertexNeighbourCount(vertexOneId) * graph.getVertexNeighbourCount(vertexTwoId);
paScores.put(Tuple.create(vertexOneId, vertexTwoId), paScore);
}
}
}
// update the graph with preferential attachment values
SimilarityUtilities.addScoresToGraph(graph, paScores, PREFERENTIAL_ATTACHMENT_ATTRIBUTE);
// complete with schema
PluginExecution.withPlugin(VisualSchemaPluginRegistry.COMPLETE_SCHEMA).executeNow(graph);
}
}
| [
"39325530+arcturus2@users.noreply.github.com"
] | 39325530+arcturus2@users.noreply.github.com |
7917190063cfcf9971c6d8ff6c5a66d60bf9d44c | 6f3ea31f07d7fac8d0076fd0cfe26f203c4f6550 | /XFBall/app/src/main/java/com/example/cglin/xfball/MyWindowManager.java | 136b11f2eb26a74726266477935c9fa58a6fd681 | [] | no_license | CGLingit/XFBall | d49e44e3ed8caecf79aab5df3d156ddacf048635 | af75b7efd1e9fab49d8276c6b1d14727f0ee0bbd | refs/heads/master | 2021-01-20T13:39:01.401249 | 2017-05-07T05:55:25 | 2017-05-07T05:55:25 | 90,511,883 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,302 | java | package com.example.cglin.xfball;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import android.app.ActivityManager;
import android.content.Context;
import android.graphics.PixelFormat;
//import android.support.v7.app.ActionBar;
import android.view.Gravity;
import android.view.WindowManager;
import android.view.WindowManager.LayoutParams;
import android.widget.TextView;
/**
* Created by Administrator on 2017/4/12.
*/
public class MyWindowManager {
/**
* 小悬浮窗View的实例
*/
private static FloatWindowSmallView smallWindow;
/**
* 大悬浮窗View的实例
*/
private static FloatWindowBigView bigWindow;
/**
* 小悬浮窗View的参数
*/
private static LayoutParams smallWindowParams;
/**
* 大悬浮窗View的参数
*/
private static LayoutParams bigWindowParams;
/**
* 用于控制在屏幕上添加或移除悬浮窗
*/
private static WindowManager mWindowManager;
/**
* 创建一个小悬浮窗。初始位置为屏幕的右部中间位置。
* @param context
* 必须为应用程序的Context.
*/
public static void createSmallWindow(Context context) {
WindowManager windowManager = getWindowManager(context);
int screenWidth = windowManager.getDefaultDisplay().getWidth();
int screenHeight = windowManager.getDefaultDisplay().getHeight();
if (smallWindow == null) {
smallWindow = new FloatWindowSmallView(context);
if (smallWindowParams == null) {
smallWindowParams = new LayoutParams();
smallWindowParams.type = LayoutParams.TYPE_PHONE;
smallWindowParams.format = PixelFormat.RGBA_8888;
smallWindowParams.flags = LayoutParams.FLAG_NOT_TOUCH_MODAL
| LayoutParams.FLAG_NOT_FOCUSABLE;
smallWindowParams.gravity = Gravity.LEFT | Gravity.TOP;
smallWindowParams.width = FloatWindowSmallView.viewWidth;
smallWindowParams.height = FloatWindowSmallView.viewHeight;
smallWindowParams.x = screenWidth;
smallWindowParams.y = screenHeight / 2;
}
smallWindow.setParams(smallWindowParams);
windowManager.addView(smallWindow, smallWindowParams);
}
}
/**
* 将小悬浮窗从屏幕上移除。
*
* @param context
* 必须为应用程序的Context.
*/
public static void removeSmallWindow(Context context) {
if (smallWindow != null) {
WindowManager windowManager = getWindowManager(context);
windowManager.removeView(smallWindow);
smallWindow = null;
}
}
/**
* 创建一个大悬浮窗。位置为屏幕正中间。
*
* @param context
* 必须为应用程序的Context.
*/
public static void createBigWindow(Context context) {
WindowManager windowManager = getWindowManager(context);
int screenWidth = windowManager.getDefaultDisplay().getWidth();
int screenHeight = windowManager.getDefaultDisplay().getHeight();
if (bigWindow == null) {
bigWindow = new FloatWindowBigView(context);
if (bigWindowParams == null) {
bigWindowParams = new LayoutParams();
bigWindowParams.x = screenWidth / 2 - FloatWindowBigView.viewWidth / 2;
bigWindowParams.y = screenHeight / 2 - FloatWindowBigView.viewHeight / 2;
bigWindowParams.type = LayoutParams.TYPE_PHONE;
bigWindowParams.format = PixelFormat.RGBA_8888;
bigWindowParams.gravity = Gravity.LEFT | Gravity.TOP;
bigWindowParams.width = FloatWindowBigView.viewWidth;
bigWindowParams.height = FloatWindowBigView.viewHeight;
}
windowManager.addView(bigWindow, bigWindowParams);
}
}
/**
* 将大悬浮窗从屏幕上移除。
*
* @param context
* 必须为应用程序的Context.
*/
public static void removeBigWindow(Context context) {
if (bigWindow != null) {
WindowManager windowManager = getWindowManager(context);
windowManager.removeView(bigWindow);
bigWindow = null;
}
}
/**
* 是否有悬浮窗(包括小悬浮窗和大悬浮窗)显示在屏幕上。
*
* @return 有悬浮窗显示在桌面上返回true,没有的话返回false。
*/
public static boolean isWindowShowing() {
return smallWindow != null || bigWindow != null;
}
/**
* 如果WindowManager还未创建,则创建一个新的WindowManager返回。否则返回当前已创建的WindowManager。
*
* @param context
* 必须为应用程序的Context.
* @return WindowManager的实例,用于控制在屏幕上添加或移除悬浮窗。
*/
private static WindowManager getWindowManager(Context context) {
if (mWindowManager == null) {
mWindowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
}
return mWindowManager;
}
}
| [
"1542102449@qq.com"
] | 1542102449@qq.com |
d7146cde6fab07f26ffe4d0c723e9497944130fd | fd1b02de0fe351102367d6851de796d780c95d52 | /org.fosstrak.llrp.commander.plugin/src/org/fosstrak/llrp/commander/editors/graphical/LLRPMasterDetailsBlock.java | aef96c7508fc62ece3d5f97e6a0ec6ace28dd3f6 | [] | no_license | Fosstrak/fosstrak-llrp-commander | f7d431c2a9d493d3df701fbe1a4e2251009a56dc | 534980dae851d4f47977b9e2c09eb598b672c30a | refs/heads/master | 2020-05-18T14:07:20.261360 | 2013-01-26T16:41:33 | 2013-01-26T16:41:33 | 38,189,727 | 2 | 2 | null | null | null | null | UTF-8 | Java | false | false | 16,543 | java | /*
*
* Fosstrak LLRP Commander (www.fosstrak.org)
*
* Copyright (C) 2008 ETH Zurich
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
package org.fosstrak.llrp.commander.editors.graphical;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.LinkedList;
import java.util.List;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.ToolBarManager;
import org.eclipse.jface.dialogs.IMessageProvider;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.*;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.FocusEvent;
import org.eclipse.swt.events.FocusListener;
import org.eclipse.swt.graphics.Cursor;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;
import org.eclipse.ui.*;
import org.eclipse.ui.forms.*;
import org.eclipse.ui.forms.events.HyperlinkAdapter;
import org.eclipse.ui.forms.events.HyperlinkEvent;
import org.eclipse.ui.forms.widgets.*;
import org.fosstrak.llrp.commander.LLRPPlugin;
import org.fosstrak.llrp.commander.ResourceCenter;
import org.fosstrak.llrp.commander.editors.graphical.actions.AddParameterAction;
import org.fosstrak.llrp.commander.editors.graphical.actions.DeleteParameterAction;
import org.fosstrak.llrp.commander.util.LLRP;
import org.fosstrak.llrp.commander.util.LLRPTreeMaintainer;
import org.llrp.ltk.types.LLRPMessage;
import org.llrp.ltk.types.LLRPParameter;
import org.llrp.ltkGenerator.generated.*;
/**
* The LLRPMasterDetailsBlock has two parts: a master part that shows the message tree
* and a details part that shows details about the currently selected tree element.
*
* @author Ulrich Etter, ETHZ
*
*/
public class LLRPMasterDetailsBlock extends MasterDetailsBlock {
private static String DUMMY_ACTION_TEXT = "<No Applicable Parameter>";
private TreeViewer treeViewer;
private GraphicalEditorPage page;
private LLRPTreeMaintainer treeMaintainer;
private List<Object> invalidParameters;
public LLRPMasterDetailsBlock(GraphicalEditorPage page, LLRPTreeMaintainer treeMaintainer) {
this.page = page;
this.treeMaintainer = treeMaintainer;
}
/**
* Updates the error message field, refreshes the TreeViewer and selects the given element in the TreeViewer.
*
* @param elementToSelect the element to select in the TreeViewer
*/
public void refresh(Object elementToSelect){
updateErrorMessage();
treeViewer.refresh();
if(elementToSelect != null){
treeViewer.setSelection(new StructuredSelection(elementToSelect), true);
}
treeViewer.expandAll();
}
protected void createMasterPart(final IManagedForm managedForm, Composite parent) {
final FormToolkit toolkit = managedForm.getToolkit();
Section section = toolkit.createSection(parent, Section.TITLE_BAR | Section.DESCRIPTION);
section.setText("Message Tree");
section.setDescription("Right-click on a tree element to add or delete a parameter.");
section.marginWidth = 10;
section.marginHeight = 5;
Composite client = toolkit.createComposite(section, SWT.WRAP);
GridLayout layout = new GridLayout();
layout.numColumns = 1;
layout.marginWidth = 2;
layout.marginTop = 5;
client.setLayout(layout);
Tree t = toolkit.createTree(client, SWT.NULL);
GridData gd = new GridData(GridData.FILL_BOTH);
gd.heightHint = 20;
gd.widthHint = 100;
t.setLayoutData(gd);
toolkit.paintBordersFor(client);
section.setClient(client);
final SectionPart spart = new SectionPart(section);
managedForm.addPart(spart);
treeViewer = new TreeViewer(t);
page.getSite().setSelectionProvider(treeViewer);
treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
managedForm.getMessageManager().removeAllMessages();
managedForm.fireSelectionChanged(spart, event.getSelection());
}
});
treeViewer.setContentProvider(new LLRPTreeContentProvider(treeMaintainer));
treeViewer.setLabelProvider(new LLRPTreeLabelProvider(treeMaintainer));
treeViewer.setInput(treeMaintainer);
treeViewer.expandAll();
createSectionToolbar(section, toolkit);
createContextMenu();
final ScrolledForm form = managedForm.getForm();
form.getForm().addMessageHyperlinkListener(new HyperlinkAdapter() {
public void linkActivated(HyperlinkEvent e) {
Point hl = ((Control) e.widget).toDisplay(0, 0);
hl.x += 10;
hl.y += 10;
Shell shell = new Shell(form.getShell(), SWT.ON_TOP | SWT.TOOL);
shell.setLayout(new FillLayout());
FormText text = toolkit.createFormText(shell, true);
text.addFocusListener(new FocusListener(){
public void focusGained(FocusEvent e) {
// do nothing
}
public void focusLost(FocusEvent e) {
((FormText) e.widget).getShell().dispose();
}
});
configureFormText(text);
text.setText(createFormTextContent(), true, false);
shell.setLocation(hl);
shell.pack();
shell.open();
}
});
}
private void createContextMenu() {
DeleteParameterAction deleteParameterAction = new DeleteParameterAction(page.getSite().getWorkbenchWindow(), treeViewer, treeMaintainer, this);
ImageDescriptor deleteImageDescriptor = ResourceCenter.getInstance().getImageDescriptor("delete.gif");
deleteParameterAction.setImageDescriptor(deleteImageDescriptor);
MenuManager contextMenuManager = new MenuManager(null);
final MenuManager addMenuManager = new MenuManager("Add", "add");
final Action a = new Action(DUMMY_ACTION_TEXT) {};
a.setEnabled(false);
addMenuManager.add(a); // add dummy action so that eclipse shows the menu
addMenuManager.setRemoveAllWhenShown(true);
addMenuManager.addMenuListener(new IMenuListener() {
/* (non-Javadoc)
* @see org.eclipse.jface.action.IMenuListener#menuAboutToShow(org.eclipse.jface.action.IMenuManager)
*/
public void menuAboutToShow(IMenuManager manager) {
createAddParameterActions(addMenuManager);
}
});
contextMenuManager.add(addMenuManager);
contextMenuManager.add(deleteParameterAction);
Menu menu = contextMenuManager.createContextMenu(treeViewer.getControl());
treeViewer.getControl().setMenu(menu);
}
private void createAddParameterActions(MenuManager addMenuManager) {
IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection();
if (!selection.isEmpty()) {
Object treeElement = selection.getFirstElement();
if (treeElement instanceof LLRPMessage || treeElement instanceof LLRPParameter){
Object messageOrParameterDefinition = treeMaintainer.getDefinition(treeElement);
java.util.List<Object> parameterOrChoiceList = new LinkedList<Object>();
if (messageOrParameterDefinition instanceof MessageDefinition){
parameterOrChoiceList = ((MessageDefinition) messageOrParameterDefinition).getParameterOrChoice();
}
else if (messageOrParameterDefinition instanceof ParameterDefinition){
parameterOrChoiceList = ((ParameterDefinition) messageOrParameterDefinition).getParameterOrChoice();
}
for (Object o : parameterOrChoiceList){
String childName = "";
if (o instanceof ParameterReference){
childName = ((ParameterReference) o).getType();
}
else if (o instanceof ChoiceReference){
childName = ((ChoiceReference) o).getType();
}
// lists can't be added or removed, therefore don't create actions for lists
// thus treat here only non lists...
if (!LLRP.canOccurMultipleTimes(messageOrParameterDefinition, childName)) {
if (LLRP.isChoice(messageOrParameterDefinition, childName)) {
MenuManager choiceMenuManager = new MenuManager(childName);
addMenuManager.add(choiceMenuManager);
ChoiceDefinition choiceDefinition = LLRP.getChoiceDefinition(childName);
List<ChoiceParameterReference> choiceParameterReferences = choiceDefinition.getParameter();
for (ChoiceParameterReference cpr : choiceParameterReferences){
String parameterName = cpr.getType();
AddParameterAction addParameterAction = createAddParameterAction(treeElement, childName, parameterName);
choiceMenuManager.add(addParameterAction);
if (treeMaintainer.getChild(treeElement, childName) != null){
// parameter does already exist and therefore can't be added anymore
addParameterAction.setEnabled(false);
}
}
}
else{
AddParameterAction addParameterAction = createAddParameterAction(treeElement, childName, childName);
addMenuManager.add(addParameterAction);
if (treeMaintainer.getChild(treeElement, childName) != null){
// parameter does already exist and therefore can't be added anymore
addParameterAction.setEnabled(false);
}
}
}
}
}
else if (treeElement instanceof java.util.List){
String name = treeMaintainer.getName(treeElement);
LlrpDefinition llrpDefinition = LLRP.getLlrpDefintion();
List<Object> list = llrpDefinition.getMessageDefinitionOrParameterDefinitionOrChoiceDefinition();
for (Object o : list){
if (o instanceof ParameterDefinition){
if (((ParameterDefinition) o).getName().equals(name)){
AddParameterAction addParameterAction = createAddParameterAction(treeElement, null, name);
addMenuManager.add(addParameterAction);
break;
}
}
if (o instanceof ChoiceDefinition){
if (((ChoiceDefinition) o).getName().equals(name)){
ChoiceDefinition choiceDefinition = LLRP.getChoiceDefinition(name);
for (ChoiceParameterReference cpr : choiceDefinition.getParameter()){
AddParameterAction addParameterAction = createAddParameterAction(treeElement, null, cpr.getType());
addMenuManager.add(addParameterAction);
}
break;
}
}
}
}
if (addMenuManager.getSize() == 0){
// add dummy action so that eclipse keeps showing the menu
Action a = new Action(DUMMY_ACTION_TEXT) {};
a.setEnabled(false);
addMenuManager.add(a);
}
}
}
private AddParameterAction createAddParameterAction(Object treeElement, String childName, String parameterName) {
AddParameterAction result =
new AddParameterAction(treeViewer, treeMaintainer, treeElement, childName, parameterName);
ImageDescriptor imageDescriptor = PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_OBJ_ELEMENT);
result.setImageDescriptor(imageDescriptor);
return result;
}
/**
* This method is based on the method 'createSectionToolbar' of
* org.eclipse.pde.internal.ui.editor.plugin.ExtensionsSection
*
* @param section
* @param toolkit
*/
private void createSectionToolbar(Section section, FormToolkit toolkit) {
ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
ToolBar toolbar = toolBarManager.createControl(section);
final Cursor handCursor = new Cursor(Display.getCurrent(), SWT.CURSOR_HAND);
toolbar.setCursor(handCursor);
// Cursor needs to be explicitly disposed
toolbar.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent e) {
if ((handCursor != null) &&
(handCursor.isDisposed() == false)) {
handCursor.dispose();
}
}
});
// Add "expand all" action to the tool bar
Action expandAllAction = new Action(){
public void run() {
if (treeViewer != null){
treeViewer.expandAll();
}
}
};
expandAllAction.setToolTipText("Expand All");
ImageDescriptor imageDescriptor = ResourceCenter.getInstance().getImageDescriptor("expand_all.gif");
expandAllAction.setImageDescriptor(imageDescriptor);
toolBarManager.add(expandAllAction);
// Add "collapse all" action to the tool bar
Action collapseAllAction = new Action(){
public void run() {
if (treeViewer != null){
treeViewer.collapseAll();
}
}
};
collapseAllAction.setToolTipText("Collapse All");
imageDescriptor = ResourceCenter.getInstance().getImageDescriptor("collapse_all.gif");
collapseAllAction.setImageDescriptor(imageDescriptor);
toolBarManager.add(collapseAllAction);
toolBarManager.update(true);
section.setTextClient(toolbar);
}
private void updateErrorMessage(){
final ScrolledForm form = page.getManagedForm().getForm();
invalidParameters = treeMaintainer.getNonRecursivelyInvalidMessageOrParameterDescendants(treeMaintainer.getRoot());
if (invalidParameters.size() == 0){
form.getForm().setMessage(null, 0);
}
else if (invalidParameters.size() == 1){
form.getForm().setMessage(invalidParameters.size() + " parameter contains errors", IMessageProvider.ERROR);
}
else{
form.getForm().setMessage(invalidParameters.size() + " parameters contain errors", IMessageProvider.ERROR);
}
}
private void configureFormText(FormText text) {
text.addHyperlinkListener(new HyperlinkAdapter() {
public void linkActivated(HyperlinkEvent e) {
String is = (String) e.getHref();
int index = Integer.parseInt(is);
Object invalidParameter = invalidParameters.get(index);
((FormText) e.widget).getShell().dispose();
treeViewer.setSelection(new StructuredSelection(invalidParameter), true);
}
});
text.setImage("error", PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_ERROR_TSK));
}
private String createFormTextContent() {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
pw.println("<form>");
for (int i = 0; i < invalidParameters.size(); i++) {
Object invalidParameter = invalidParameters.get(i);
pw.print("<li vspace=\"false\" style=\"image\" indent=\"16\" value=\"error");
pw.print("\"> <a href=\"");
pw.print(i);
pw.print("\">");
pw.print(treeMaintainer.getName(invalidParameter));
pw.println("</a></li>");
}
pw.println("</form>");
pw.flush();
return sw.toString();
}
protected void createToolBarActions(IManagedForm managedForm) {
final ScrolledForm form = managedForm.getForm();
Action haction = new Action("hor", Action.AS_RADIO_BUTTON) {
public void run() {
sashForm.setOrientation(SWT.HORIZONTAL);
form.reflow(true);
}
};
haction.setChecked(true);
haction.setToolTipText("Horizontal orientation");
haction.setImageDescriptor(LLRPPlugin.getImageDescriptor("icons/th_horizontal.gif"));
Action vaction = new Action("ver", Action.AS_RADIO_BUTTON) {
public void run() {
sashForm.setOrientation(SWT.VERTICAL);
form.reflow(true);
}
};
vaction.setChecked(false);
vaction.setToolTipText("Vertical orientation");
vaction.setImageDescriptor(LLRPPlugin.getImageDescriptor("icons/th_vertical.gif"));
form.getToolBarManager().add(haction);
form.getToolBarManager().add(vaction);
}
protected void registerPages(DetailsPart detailsPart) {
detailsPart.setPageProvider(new LLRPDetailsPageProvider());
refresh(treeMaintainer.getRoot());
}
class LLRPDetailsPageProvider implements IDetailsPageProvider{
public IDetailsPage getPage(Object key) {
if (key instanceof LLRPMessage || key instanceof LLRPParameter){
return new LLRPDetailsPage(key, treeViewer, treeMaintainer, LLRPMasterDetailsBlock.this);
}
return null;
}
public Object getPageKey(Object object) {
return object;
}
}
} | [
"samuel.wieland@gmail.com"
] | samuel.wieland@gmail.com |
75d8fc8dbd4fe73686a076393c46e5ef880854dd | 4fec6c57f9ad48d0bf09ee9f470ee8fec1639488 | /src/main/java/br/com/minhareserva/modelo/negocio/persistencia/entidade/Contato.java | c75680c69c82833cb2ac7c223b156868c91524b6 | [] | no_license | ronaldopintogomes/minha-reserva---java---springboot | 2bce233ef76b5144c717de24dbc4d4f9da676e76 | d687744fd0254f28755a207a6e6f619db1e75610 | refs/heads/master | 2023-01-01T11:43:19.239681 | 2020-10-23T00:53:06 | 2020-10-23T00:53:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 599 | java | package br.com.minhareserva.modelo.negocio.persistencia.entidade;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import java.io.Serializable;
import java.util.List;
@Getter
@Setter
@Entity
@NoArgsConstructor
public class Contato implements Serializable {
@Id
@GeneratedValue
private long id;
private String email;
@ElementCollection(targetClass = String.class)
private List<String> telefones;
} | [
"ronaldo.softsystem@gmail.com"
] | ronaldo.softsystem@gmail.com |
b6a2faeedbcc76f50dc0524be89267aaa6461921 | 5b747c30880af98364bce5dfd05d7422018d7c74 | /src/main/java/com/yangyimeng/homework/leetcode/LongestSubstringWithoutRepeatingCharacters.java | 00ffec641d40aef3259b836486ea855fc76e851b | [] | no_license | yangyimeng/homework | a02c7b5a1d09586ed2c0c9843ae4d0473868a935 | 4cd129c93770a4bac75534c4c48403589cd66db1 | refs/heads/master | 2021-01-19T23:53:22.826175 | 2017-10-31T09:58:10 | 2017-10-31T09:58:10 | 89,048,125 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,125 | java | package com.yangyimeng.homework.leetcode;
import java.util.BitSet;
public class LongestSubstringWithoutRepeatingCharacters {
public int lengthOfLongestSubstring(String s) {
BitSet bitSet = new BitSet();
char [] data = s.toCharArray();
if (data.length == 0) {
return 0;
}
int i = 0, j = 0;
int max = 1;
while (i < data.length && j < data.length && i <= j) {
if (bitSet.get(data[j])) {
for (int k = i; k < j; k++) {
if (data[k] != data[j]) {
bitSet.clear(data[k]);
} else {
i = k + 1;
break;
}
}
} else {
bitSet.set(data[j]);
}
if (j - i + 1 > max) {
max = j - i + 1;
}
j++;
}
return max;
}
public static void main(String [] args) {
System.out.println(new LongestSubstringWithoutRepeatingCharacters().lengthOfLongestSubstring("abcabcbb"));
}
}
| [
"yangyimeng@gmail.com"
] | yangyimeng@gmail.com |
8d9508f23e23cc8b0e28f29d1bcf6f0e21f67ca2 | 06e34596185c90f3c1cce7cbca5cfb4f2594782c | /xgen4j/src/test-gen/java/com/rodrigodev/xgen4j/test/throwing/Information.java | 932fe0e0bec0934bf1dc11972a13f77a73e4fa32 | [
"MIT"
] | permissive | RodrigoQuesadaDev/XGen4J | 3e45593c1de9f842b2e2de682bec6b59c34d5ab7 | 8d7791494521f54cbf8d89b5e12001e295cff3f4 | refs/heads/master | 2021-01-21T05:00:42.559899 | 2015-07-28T10:11:13 | 2015-07-28T10:11:13 | 39,287,751 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,080 | java | package com.rodrigodev.xgen4j.test.throwing;
import com.rodrigodev.xgen4j.test.throwing.ErrorInfo.CustomMessageGeneratorErrorDescription;
import com.rodrigodev.xgen4j.test.throwing.ErrorInfo.PlainTextErrorDescription;
import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean;
/**
* Autogenerated by XGen4J on January 1, 0001.
*/
public class Information {
private static List<ErrorInfo> errorInfoList;
private static Map<String, ErrorInfo> idToErrorInfoMap;
private static final AtomicBoolean loaded = new AtomicBoolean();
private static void load() {
if (loaded.compareAndSet(false, true)) {
errorInfoList = new ArrayList<>();
idToErrorInfoMap = new HashMap<>();
errorInfoList.add(new ErrorInfo(
com.rodrigodev.xgen4j.test.throwing.RootError.class,
new ExceptionInfo(com.rodrigodev.xgen4j.test.throwing.RootException.class),
com.rodrigodev.xgen4j.test.throwing.RootError.CODE,
false
));
errorInfoList.add(new ErrorInfo(
com.rodrigodev.xgen4j.test.throwing.c1.C1Error.class,
new ExceptionInfo(com.rodrigodev.xgen4j.test.throwing.c1.C1Exception.class),
com.rodrigodev.xgen4j.test.throwing.c1.C1Error.CODE,
true
));
errorInfoList.add(new ErrorInfo(
com.rodrigodev.xgen4j.test.throwing.c1.c2.C2Error.class,
new ExceptionInfo(com.rodrigodev.xgen4j.test.throwing.c1.c2.C2Exception.class),
com.rodrigodev.xgen4j.test.throwing.c1.c2.C2Error.CODE,
true
));
errorInfoList.add(new ErrorInfo(
com.rodrigodev.xgen4j.test.throwing.c1.c2.c3_1.C3_1Error.class,
new ExceptionInfo(com.rodrigodev.xgen4j.test.throwing.c1.c2.c3_1.C3_1Exception.class),
com.rodrigodev.xgen4j.test.throwing.c1.c2.c3_1.C3_1Error.CODE,
new PlainTextErrorDescription("Message for C3_1 error."),
true
));
errorInfoList.add(new ErrorInfo(
com.rodrigodev.xgen4j.test.throwing.c1.c2.c3_2.C3_2Error.class,
new ExceptionInfo(com.rodrigodev.xgen4j.test.throwing.c1.c2.c3_2.C3_2Exception.class),
com.rodrigodev.xgen4j.test.throwing.c1.c2.c3_2.C3_2Error.CODE,
new PlainTextErrorDescription("{param1: '%s', param2: %d, param3: '%s'}"),
true
));
errorInfoList.add(new ErrorInfo(
com.rodrigodev.xgen4j.test.throwing.c1.c2.c3_3.C3_3Error.class,
new ExceptionInfo(com.rodrigodev.xgen4j.test.throwing.c1.c2.c3_3.C3_3Exception.class),
com.rodrigodev.xgen4j.test.throwing.c1.c2.c3_3.C3_3Error.CODE,
new CustomMessageGeneratorErrorDescription<>(com.rodrigodev.xgen4j.test.common.doubles.error.message.TestMessageGeneratorObject.class),
true
));
errorInfoList.add(new ErrorInfo(
com.rodrigodev.xgen4j.test.throwing.e1.E1Error.class,
new ExceptionInfo(com.rodrigodev.xgen4j.test.throwing.e1.E1Exception.TYPE, com.rodrigodev.xgen4j.test.throwing.e1.E1Exception.class),
com.rodrigodev.xgen4j.test.throwing.e1.E1Error.CODE,
false
));
errorInfoList.add(new ErrorInfo(
com.rodrigodev.xgen4j.test.throwing.e1.e2.E2Error.class,
new ExceptionInfo(com.rodrigodev.xgen4j.test.throwing.e1.e2.E2Exception.TYPE, com.rodrigodev.xgen4j.test.throwing.e1.e2.E2Exception.class),
com.rodrigodev.xgen4j.test.throwing.e1.e2.E2Error.CODE,
false
));
errorInfoList.add(new ErrorInfo(
com.rodrigodev.xgen4j.test.throwing.e1.e2.e3_1.E3_1Error.class,
new ExceptionInfo(com.rodrigodev.xgen4j.test.throwing.e1.e2.e3_1.E3_1Exception.TYPE, com.rodrigodev.xgen4j.test.throwing.e1.e2.e3_1.E3_1Exception.class),
com.rodrigodev.xgen4j.test.throwing.e1.e2.e3_1.E3_1Error.CODE,
new PlainTextErrorDescription("Message for E3_1 error."),
false
));
errorInfoList.add(new ErrorInfo(
com.rodrigodev.xgen4j.test.throwing.e1.e2.e3_2.E3_2Error.class,
new ExceptionInfo(com.rodrigodev.xgen4j.test.throwing.e1.e2.e3_2.E3_2Exception.TYPE, com.rodrigodev.xgen4j.test.throwing.e1.e2.e3_2.E3_2Exception.class),
com.rodrigodev.xgen4j.test.throwing.e1.e2.e3_2.E3_2Error.CODE,
new PlainTextErrorDescription("{param1: '%s', param2: %d, param3: '%s'}"),
false
));
errorInfoList.add(new ErrorInfo(
com.rodrigodev.xgen4j.test.throwing.e1.e2.e3_3.E3_3Error.class,
new ExceptionInfo(com.rodrigodev.xgen4j.test.throwing.e1.e2.e3_3.E3_3Exception.TYPE, com.rodrigodev.xgen4j.test.throwing.e1.e2.e3_3.E3_3Exception.class),
com.rodrigodev.xgen4j.test.throwing.e1.e2.e3_3.E3_3Error.CODE,
new CustomMessageGeneratorErrorDescription<>(com.rodrigodev.xgen4j.test.common.doubles.error.message.TestMessageGeneratorObject.class),
false
));
errorInfoList = Collections.unmodifiableList(errorInfoList);
for (ErrorInfo errorInfo : errorInfoList) {
idToErrorInfoMap.put(errorInfo.code().id(), errorInfo);
}
loaded.set(true);
}
}
public static List<ErrorInfo> list() {
load();
return errorInfoList;
}
public static ErrorInfo forId(String id) {
if (id == null) throw new IllegalArgumentException("id");
load();
return idToErrorInfoMap.get(id);
}
}
| [
"rodrigoquesada@gmail.com"
] | rodrigoquesada@gmail.com |
40d9337dcec61c04ccb86459a73948d296e687ba | 6f4b2e8b054c17b04754d7769738d91bae1091bb | /app/src/test/java/com/college/picodiploma/uts18523066/ExampleUnitTest.java | b69d1c9123ce094eb8d5b0cb737dbff8487cf4ad | [] | no_license | irasalsabila/utspab | d692843b2e36522e45a6732ca2ce7eb04ebc7015 | 1a71a16ed5ef297e52b7072bee0dfadc500ecd06 | refs/heads/master | 2023-01-09T23:41:32.675231 | 2020-11-03T11:25:04 | 2020-11-03T11:25:04 | 309,663,829 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 396 | java | package com.college.picodiploma.uts18523066;
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() {
assertEquals(4, 2 + 2);
}
} | [
"irasalsabila@gmail.com"
] | irasalsabila@gmail.com |
dbc40c43477ff4e2f4d1eeb0273644e7fce424ea | 0e032c95d06b304c5925aa3c4473b8e15b737ce1 | /src/test/java/com/treeviewer/treeviewer/TreeviewerApplicationTests.java | 40497a062f4c731ac42af71379e2a70902a72b04 | [] | no_license | dyutibhaba/treeds-restapi | b8416d49217b368ea00e27d73a2dd10c4343180e | fcb4438d7f6b9b0039774201abf352059929becb | refs/heads/master | 2020-05-24T16:35:20.013668 | 2019-05-19T16:22:33 | 2019-05-19T16:22:33 | 187,362,883 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 954 | java | package com.treeviewer.treeviewer;
import org.assertj.core.api.Assertions;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.test.context.junit4.SpringRunner;
import com.treeviewer.response.DuTTreeWrapper;
@RunWith(SpringRunner.class)
@SpringBootTest
public class TreeviewerApplicationTests {
@Autowired
private TestRestTemplate restTemplate;
@Test
public void contextLoads() {
}
@Test
public void testName() throws Exception {
ResponseEntity<DuTTreeWrapper> respnse = restTemplate.getForEntity("/getdutstructure", DuTTreeWrapper.class);
Assertions.assertThat(respnse.getStatusCode()).isEqualTo(HttpStatus.OK);
}
}
| [
"bhabadyuti.damodar@piterion.com"
] | bhabadyuti.damodar@piterion.com |
5b2d1bb23a35e7c86e30f7b252665fb82aba727b | 421fee6930e74408d4f3df14160b54c544000136 | /security-core/src/main/java/com/jerry/security/core/support/SimpleResponse.java | 92f76d8cf18b7de87d8ba1553cd8d08e778a5661 | [
"Apache-2.0"
] | permissive | TanHaoran/security_old | e97c4088a63c4406a95f204f24aa18111d052563 | ae6856ce656d5f31248e366bf4c8bfa1415e2f50 | refs/heads/master | 2020-03-08T07:08:24.065725 | 2018-04-22T09:00:42 | 2018-04-22T09:00:42 | 127,987,153 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 459 | java | package com.jerry.security.core.support;
/**
* Created with IntelliJ IDEA.
* User: Jerry
* Date: 2018/4/4
* Time: 10:32
* Description: 简单的响应对象
*/
public class SimpleResponse {
private Object content;
public SimpleResponse(Object content) {
this.content = content;
}
public Object getContent() {
return content;
}
public void setContent(Object content) {
this.content = content;
}
}
| [
"thrforever@126.com"
] | thrforever@126.com |
a0fe43cd8d8f8f6324bcb8285cab63b7d34a838a | 21de76ae7bf26465b19d9ec441b3fe028dd7aea3 | /08-security/keycloak-sso/keycloak-spring-security/src/main/java/keycloaksso/springsecurity/SecurityConfig.java | 49bb7a49499e55bf010c55ff488532b973d0bf3d | [] | no_license | ttt9912/prospringboot2 | 0b74ba3c02e21984356c91ad93ef0f8ece45e0e5 | edab521bc755ede1cb8ca93b5248406119e999f2 | refs/heads/master | 2022-06-14T20:05:54.668381 | 2022-05-30T19:19:29 | 2022-05-30T19:19:29 | 163,871,907 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,929 | java | package keycloaksso.springsecurity;
import org.keycloak.adapters.springboot.KeycloakSpringBootConfigResolver;
import org.keycloak.adapters.springsecurity.KeycloakSecurityComponents;
import org.keycloak.adapters.springsecurity.authentication.KeycloakAuthenticationProvider;
import org.keycloak.adapters.springsecurity.config.KeycloakWebSecurityConfigurerAdapter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.FilterType;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.core.authority.mapping.SimpleAuthorityMapper;
import org.springframework.security.core.session.SessionRegistryImpl;
import org.springframework.security.web.authentication.session.RegisterSessionAuthenticationStrategy;
import org.springframework.security.web.authentication.session.SessionAuthenticationStrategy;
/*
* Spring Security requires a configuration class extending
* WebSecurityConfigurerAdapter for any secured application
*
* KeycloakWebSecurityConfigurerAdapter - base class for creating a
* WebSecurityConfigurer instance
*/
@Configuration
@EnableWebSecurity
@ComponentScan(basePackageClasses = KeycloakSecurityComponents.class,
// temporary bug in spring keycloak (duplicate bean 'httpSessionManager')
excludeFilters = @ComponentScan.Filter(type = FilterType.REGEX, pattern = "org.keycloak.adapters.springsecurity.management.HttpSessionManager"))
public class SecurityConfig extends KeycloakWebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
super.configure(http);
http.authorizeRequests()
.antMatchers("/api/*")
.authenticated()
//.hasRole("user")
.anyRequest()
.permitAll();
}
/*
* tasks the SimpleAuthorityMapper to make sure roles are not prefixed with ROLE_
*/
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
KeycloakAuthenticationProvider keycloakAuthenticationProvider = keycloakAuthenticationProvider();
keycloakAuthenticationProvider.setGrantedAuthoritiesMapper(new SimpleAuthorityMapper());
auth.authenticationProvider(keycloakAuthenticationProvider);
}
@Bean
@Override
protected SessionAuthenticationStrategy sessionAuthenticationStrategy() {
return new RegisterSessionAuthenticationStrategy(new SessionRegistryImpl());
}
}
| [
"tschachtli.th@gmail.com"
] | tschachtli.th@gmail.com |
67ba87a4a941c57055c38cfd1ab10c4e435928de | 5d9128606e288f4a8ede1f39bf0909a97247dbb8 | /src/main/old-java/org/arbonaut/android/jooq/impl/Extract.java | 5d8c21e8948c083ae1a891b580b2d017add7c298 | [
"Apache-2.0",
"BSD-3-Clause"
] | permissive | Arbonaut/jOOQ | ec62a03a6541444b251ed7f3cdefc22eadf2a03d | 21fbf50ca6129f1bc20cc6c553d99ba92865d192 | refs/heads/master | 2021-01-16T20:32:00.437982 | 2012-11-26T13:28:19 | 2012-11-26T13:28:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,695 | java | /**
* Copyright (c) 2009-2012, Lukas Eder, lukas.eder@gmail.com
* All rights reserved.
*
* This software is licensed to you under the Apache License, Version 2.0
* (the "License"); You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* . Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* . Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* . Neither the name "jOOQ" nor the names of its contributors may be
* used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package org.jooq.impl;
import static org.jooq.impl.Factory.field;
import static org.jooq.impl.Factory.function;
import org.jooq.Configuration;
import org.jooq.DatePart;
import org.jooq.Field;
import org.jooq.exception.SQLDialectNotSupportedException;
/**
* @author Lukas Eder
*/
class Extract extends AbstractFunction<Integer> {
private static final long serialVersionUID = 3748640920856031034L;
private final Field<?> field;
private final DatePart datePart;
Extract(Field<?> field, DatePart datePart) {
super("extract", SQLDataType.INTEGER, field);
this.field = field;
this.datePart = datePart;
}
@Override
final Field<Integer> getFunction0(Configuration configuration) {
switch (configuration.getDialect()) {
case SQLITE:
switch (datePart) {
case YEAR:
return field("{strftime}('%Y', {0})", SQLDataType.INTEGER, field);
case MONTH:
return field("{strftime}('%m', {0})", SQLDataType.INTEGER, field);
case DAY:
return field("{strftime}('%d', {0})", SQLDataType.INTEGER, field);
case HOUR:
return field("{strftime}('%H', {0})", SQLDataType.INTEGER, field);
case MINUTE:
return field("{strftime}('%M', {0})", SQLDataType.INTEGER, field);
case SECOND:
return field("{strftime}('%S', {0})", SQLDataType.INTEGER, field);
default:
throw new SQLDialectNotSupportedException("DatePart not supported: " + datePart);
}
case DERBY:
case DB2:
switch (datePart) {
case YEAR:
return function("year", SQLDataType.INTEGER, field);
case MONTH:
return function("month", SQLDataType.INTEGER, field);
case DAY:
return function("day", SQLDataType.INTEGER, field);
case HOUR:
return function("hour", SQLDataType.INTEGER, field);
case MINUTE:
return function("minute", SQLDataType.INTEGER, field);
case SECOND:
return function("second", SQLDataType.INTEGER, field);
default:
throw new SQLDialectNotSupportedException("DatePart not supported: " + datePart);
}
case ORACLE:
switch (datePart) {
case YEAR:
return field("{to_char}({0}, 'YYYY')", SQLDataType.INTEGER, field);
case MONTH:
return field("{to_char}({0}, 'MM')", SQLDataType.INTEGER, field);
case DAY:
return field("{to_char}({0}, 'DD')", SQLDataType.INTEGER, field);
case HOUR:
return field("{to_char}({0}, 'HH24')", SQLDataType.INTEGER, field);
case MINUTE:
return field("{to_char}({0}, 'MI')", SQLDataType.INTEGER, field);
case SECOND:
return field("{to_char}({0}, 'SS')", SQLDataType.INTEGER, field);
default:
throw new SQLDialectNotSupportedException("DatePart not supported: " + datePart);
}
case ASE:
case SQLSERVER:
case SYBASE:
switch (datePart) {
case YEAR:
return field("{datepart}(yy, {0})", SQLDataType.INTEGER, field);
case MONTH:
return field("{datepart}(mm, {0})", SQLDataType.INTEGER, field);
case DAY:
return field("{datepart}(dd, {0})", SQLDataType.INTEGER, field);
case HOUR:
return field("{datepart}(hh, {0})", SQLDataType.INTEGER, field);
case MINUTE:
return field("{datepart}(mi, {0})", SQLDataType.INTEGER, field);
case SECOND:
return field("{datepart}(ss, {0})", SQLDataType.INTEGER, field);
default:
throw new SQLDialectNotSupportedException("DatePart not supported: " + datePart);
}
case INGRES:
case MYSQL:
case POSTGRES:
case HSQLDB:
case H2:
// A default implementation is necessary for hashCode() and toString()
default:
return field("{extract}({" + datePart.toSQL() + " from} {0})", SQLDataType.INTEGER, field);
}
}
}
| [
"karol.waga@arbonaut.com"
] | karol.waga@arbonaut.com |
73006571726beb634713b637c8072fba095983bf | d60fabce1b846dda0e433808d3540333f1565c23 | /src/MyCollector.java | 36a7143ba15249a0a158affe2b50c43a12d2b05f | [] | no_license | yc-zhang/java8-learning | af283f8edb081fe27bfb5e9180e8d30e13713248 | 20421cb7e0679a5e07dfa29de79f70ec70b9b4e0 | refs/heads/master | 2020-09-25T10:08:15.902321 | 2016-09-22T02:30:37 | 2016-09-22T02:30:37 | 67,580,949 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 926 | java | import java.util.*;
import java.util.function.BiConsumer;
import java.util.function.BinaryOperator;
import java.util.function.Function;
import java.util.function.Supplier;
public class MyCollector<T> implements java.util.stream.Collector<T, List<T>, List<T>> {
@Override
public Supplier<List<T>> supplier() {
return ArrayList::new;
}
@Override
public BiConsumer<List<T>, T> accumulator() {
return List::add;
}
@Override
public BinaryOperator<List<T>> combiner() {
return (listA, listB) -> {
listA.addAll(listB);
return listA;
};
}
@Override
public Function<List<T>, List<T>> finisher() {
return Function.identity();
}
@Override
public Set<Characteristics> characteristics() {
return Collections.unmodifiableSet(EnumSet.of(Characteristics.IDENTITY_FINISH, Characteristics.CONCURRENT));
}
}
| [
"turalyon.zhangyc@gmail.com"
] | turalyon.zhangyc@gmail.com |
2f45a07a0b9e88ec9bd3f5b1f4fafeb53e058c9c | c884ab6dd9fadcbd713f578ffa9780f2f704038f | /src/main/java/com/zilean/queue/domain/entity/ZileanTokenDO.java | 7eb6569957c23c45b6e64101ef54a52f335f0095 | [] | no_license | aipan/wy-delay-queue | 343c77fabc85d68152b5029b996e98d4c3c1ddae | 14deb63d45397734a5222a8a2ed2b94ca8cd0c65 | refs/heads/master | 2020-07-06T20:04:56.127671 | 2019-07-16T15:45:25 | 2019-07-16T15:45:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,282 | java | package com.zilean.queue.domain.entity;
import com.zilean.queue.domain.entity.base.BaseDO;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
/**
* 描述:
*
* @author xjh
* created on 2019-07-13 19:31
*/
@EqualsAndHashCode(callSuper = true)
@Data
@Entity
@Table(name = "tbl_zilean_token")
public class ZileanTokenDO extends BaseDO {
private static final long serialVersionUID = 5409702228663768433L;
/**
* 自增主键id
*/
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
/**
* username
*/
@Column(name = "username", nullable = false)
private String username;
/**
* password
*/
@Column(name = "password", nullable = false)
private String password;
/**
* salt
*/
@Column(name = "salt", nullable = false)
private String salt;
/**
* 昵称
*/
@Column(name = "nickname", nullable = false)
private String nickname;
/**
* token
*/
@Column(name = "token", nullable = false)
private String token;
}
| [
"qq584686739@gmail.com"
] | qq584686739@gmail.com |
5a834445c1ed5fb20012ef21f27b49f268619f73 | 99d856874f2e13f4da8f67d3a59cb0089ed629fe | /temp/src/minecraft/net/minecraft/src/StatFileWriter.java | e7ccc3db69907f98dbaf29d6c305817ea27c1e68 | [] | no_license | pablo67340/SkinFix | f1e0fa64361edb13c7f937f99a571f08bc349c54 | 5d5a9aa55a948376236a4fda84a7a0eefa373400 | refs/heads/master | 2020-04-27T20:07:23.310747 | 2019-03-09T04:28:15 | 2019-03-09T04:28:15 | 174,646,319 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,074 | java | package net.minecraft.src;
import argo.jdom.JdomParser;
import argo.jdom.JsonNode;
import argo.jdom.JsonRootNode;
import argo.jdom.JsonStringNode;
import argo.saj.InvalidSyntaxException;
import java.io.File;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import net.minecraft.src.Achievement;
import net.minecraft.src.MD5String;
import net.minecraft.src.Session;
import net.minecraft.src.StatBase;
import net.minecraft.src.StatList;
import net.minecraft.src.StatsSyncher;
public class StatFileWriter {
private Map field_25102_a = new HashMap();
private Map field_25101_b = new HashMap();
private boolean field_27189_c = false;
private StatsSyncher field_27188_d;
public StatFileWriter(Session p_i195_1_, File p_i195_2_) {
File var3 = new File(p_i195_2_, "stats");
if(!var3.exists()) {
var3.mkdir();
}
File[] var4 = p_i195_2_.listFiles();
int var5 = var4.length;
for(int var6 = 0; var6 < var5; ++var6) {
File var7 = var4[var6];
if(var7.getName().startsWith("stats_") && var7.getName().endsWith(".dat")) {
File var8 = new File(var3, var7.getName());
if(!var8.exists()) {
System.out.println("Relocating " + var7.getName());
var7.renameTo(var8);
}
}
}
this.field_27188_d = new StatsSyncher(p_i195_1_, this, var3);
}
public void func_25100_a(StatBase p_25100_1_, int p_25100_2_) {
this.func_27186_a(this.field_25101_b, p_25100_1_, p_25100_2_);
this.func_27186_a(this.field_25102_a, p_25100_1_, p_25100_2_);
this.field_27189_c = true;
}
private void func_27186_a(Map p_27186_1_, StatBase p_27186_2_, int p_27186_3_) {
Integer var4 = (Integer)p_27186_1_.get(p_27186_2_);
int var5 = var4 == null?0:var4.intValue();
p_27186_1_.put(p_27186_2_, Integer.valueOf(var5 + p_27186_3_));
}
public Map func_27176_a() {
return new HashMap(this.field_25101_b);
}
public void func_27179_a(Map p_27179_1_) {
if(p_27179_1_ != null) {
this.field_27189_c = true;
Iterator var2 = p_27179_1_.keySet().iterator();
while(var2.hasNext()) {
StatBase var3 = (StatBase)var2.next();
this.func_27186_a(this.field_25101_b, var3, ((Integer)p_27179_1_.get(var3)).intValue());
this.func_27186_a(this.field_25102_a, var3, ((Integer)p_27179_1_.get(var3)).intValue());
}
}
}
public void func_27180_b(Map p_27180_1_) {
if(p_27180_1_ != null) {
Iterator var2 = p_27180_1_.keySet().iterator();
while(var2.hasNext()) {
StatBase var3 = (StatBase)var2.next();
Integer var4 = (Integer)this.field_25101_b.get(var3);
int var5 = var4 == null?0:var4.intValue();
this.field_25102_a.put(var3, Integer.valueOf(((Integer)p_27180_1_.get(var3)).intValue() + var5));
}
}
}
public void func_27187_c(Map p_27187_1_) {
if(p_27187_1_ != null) {
this.field_27189_c = true;
Iterator var2 = p_27187_1_.keySet().iterator();
while(var2.hasNext()) {
StatBase var3 = (StatBase)var2.next();
this.func_27186_a(this.field_25101_b, var3, ((Integer)p_27187_1_.get(var3)).intValue());
}
}
}
public static Map func_27177_a(String p_27177_0_) {
HashMap var1 = new HashMap();
try {
String var2 = "local";
StringBuilder var3 = new StringBuilder();
JsonRootNode var4 = (new JdomParser()).func_27367_a(p_27177_0_);
List var5 = var4.func_27217_b(new Object[]{"stats-change"});
Iterator var6 = var5.iterator();
while(var6.hasNext()) {
JsonNode var7 = (JsonNode)var6.next();
Map var8 = var7.func_27214_c();
Entry var9 = (Entry)var8.entrySet().iterator().next();
int var10 = Integer.parseInt(((JsonStringNode)var9.getKey()).func_27216_b());
int var11 = Integer.parseInt(((JsonNode)var9.getValue()).func_27216_b());
StatBase var12 = StatList.func_27361_a(var10);
if(var12 == null) {
System.out.println(var10 + " is not a valid stat");
} else {
var3.append(StatList.func_27361_a(var10).field_25069_f).append(",");
var3.append(var11).append(",");
var1.put(var12, Integer.valueOf(var11));
}
}
MD5String var14 = new MD5String(var2);
String var15 = var14.func_27369_a(var3.toString());
if(!var15.equals(var4.func_27213_a(new Object[]{"checksum"}))) {
System.out.println("CHECKSUM MISMATCH");
return null;
}
} catch (InvalidSyntaxException var13) {
var13.printStackTrace();
}
return var1;
}
public static String func_27185_a(String p_27185_0_, String p_27185_1_, Map p_27185_2_) {
StringBuilder var3 = new StringBuilder();
StringBuilder var4 = new StringBuilder();
boolean var5 = true;
var3.append("{\r\n");
if(p_27185_0_ != null && p_27185_1_ != null) {
var3.append(" \"user\":{\r\n");
var3.append(" \"name\":\"").append(p_27185_0_).append("\",\r\n");
var3.append(" \"sessionid\":\"").append(p_27185_1_).append("\"\r\n");
var3.append(" },\r\n");
}
var3.append(" \"stats-change\":[");
Iterator var6 = p_27185_2_.keySet().iterator();
while(var6.hasNext()) {
StatBase var7 = (StatBase)var6.next();
if(!var5) {
var3.append("},");
} else {
var5 = false;
}
var3.append("\r\n {\"").append(var7.field_25071_d).append("\":").append(p_27185_2_.get(var7));
var4.append(var7.field_25069_f).append(",");
var4.append(p_27185_2_.get(var7)).append(",");
}
if(!var5) {
var3.append("}");
}
MD5String var8 = new MD5String(p_27185_1_);
var3.append("\r\n ],\r\n");
var3.append(" \"checksum\":\"").append(var8.func_27369_a(var4.toString())).append("\"\r\n");
var3.append("}");
return var3.toString();
}
public boolean func_27183_a(Achievement p_27183_1_) {
return this.field_25102_a.containsKey(p_27183_1_);
}
public boolean func_27181_b(Achievement p_27181_1_) {
return p_27181_1_.field_25076_c == null || this.func_27183_a(p_27181_1_.field_25076_c);
}
public int func_27184_a(StatBase p_27184_1_) {
Integer var2 = (Integer)this.field_25102_a.get(p_27184_1_);
return var2 == null?0:var2.intValue();
}
public void func_27175_b() {}
public void func_27182_c() {
this.field_27188_d.func_27407_b(this.func_27176_a());
}
public void func_27178_d() {
if(this.field_27189_c && this.field_27188_d.func_27420_b()) {
this.field_27188_d.func_27424_a(this.func_27176_a());
}
this.field_27188_d.func_27425_c();
}
}
| [
"pablo67340@gmail.com"
] | pablo67340@gmail.com |
b590c05f04cec329809261fbf1ef0453e7012f78 | d2d640b3fb1a0c3f1f68ed699ff64e30c97293cf | /app/src/main/java/com/android/airhockey/data/VertexArray.java | 340ecb400fb6e9abc8e7d289d1f47f26b8a4d0f2 | [] | no_license | pop1030123/AirHockey | c3b061fac8aa4588571e3ee50ed84109be9a7dd9 | 20071fd34c788705381374d2dc94c81039be3d0e | refs/heads/master | 2020-12-30T15:42:04.074044 | 2017-05-23T14:52:27 | 2017-05-23T14:52:27 | 91,165,296 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,129 | java | package com.android.airhockey.data;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.FloatBuffer;
import static android.opengl.GLES20.GL_FLOAT;
import static android.opengl.GLES20.glCullFace;
import static android.opengl.GLES20.glEnableVertexAttribArray;
import static android.opengl.GLES20.glVertexAttribPointer;
import static com.android.airhockey.Constants.BYTES_PER_FLOAT;
/**
* Created by pengfu on 19/05/2017.
*/
public class VertexArray {
private final FloatBuffer floatBuffer ;
public VertexArray(float[] vertexData){
floatBuffer = ByteBuffer.allocateDirect(vertexData.length * BYTES_PER_FLOAT)
.order(ByteOrder.nativeOrder())
.asFloatBuffer()
.put(vertexData) ;
}
public void setVertexAttribPointer(int dataOffset ,int attributeLocation ,int componentCount ,int stride){
floatBuffer.position(dataOffset) ;
glVertexAttribPointer(attributeLocation ,componentCount ,GL_FLOAT ,false ,stride ,floatBuffer) ;
glEnableVertexAttribArray(attributeLocation);
floatBuffer.position(0) ;
}
}
| [
"77276575@qq.com"
] | 77276575@qq.com |
9be96bce58b40ca9706c515a58710bd56939407a | 56c2e5b6bbbbb00b622f69d14515a9f4f4a028da | /app/src/main/java/demo/mark/com/xposedpluginsearch/sql/SqlUtil.java | 28161af853eca6e45e60a8e7dd636e85a8076b38 | [] | no_license | ariesy313/XposedPluginSearch | 2c49e59ad690e25a1d409594bde4a6e299fdd602 | a7751802bf32913571c3571649b39b7046773985 | refs/heads/master | 2021-01-01T03:52:36.878731 | 2016-05-24T15:54:14 | 2016-05-24T15:54:14 | 59,579,142 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,569 | java | package demo.mark.com.xposedpluginsearch.sql;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import java.util.ArrayList;
import java.util.List;
import de.robv.android.xposed.XposedBridge;
/**
* Created by Berkeley on 4/26/16.
*/
public class SqlUtil {
private static String DB_NAME = "news.db";
private static int DB_VERSION = 1;
private static int POSTION;
public static List<News> queryAll(Context context,SQLiteDatabase db){
List<News> cityList = new ArrayList<>();
Cursor cursor = db.query(SQLiteHelper.TB_NAME, null, null, null, null, null, News.ID + " DESC");
cursor.moveToFirst();
while(!cursor.isAfterLast() && (cursor.getString(1) != null)){
News city = new News();
city.setId(cursor.getString(0));
city.setTitle(cursor.getString(1));
cityList.add(city);
cursor.moveToNext();
}
return cityList;
}
public static int insert(String title,SQLiteDatabase db){
int errorCode = 0;
synchronized (DBInstance.getInstance()) {
try {
ContentValues values = new ContentValues();
values.put(News.NEWS_TITLE, title);
db.insertOrThrow(SQLiteHelper.TB_NAME, News.ID, values);
} catch (Exception e) {
e.printStackTrace();
XposedBridge.log("c出入错误:" + e.toString());
errorCode = 1;
}
return errorCode;
}
}
public static boolean hasNews(String title, SQLiteDatabase db) {
synchronized (DBInstance.getInstance()) {
String sqlCity = title.length() > 0 ? "title='" + title + "'" : "";
Cursor cursor = db.query(true, SQLiteHelper.TB_NAME,
new String[]{"_id", "title"},
sqlCity,
null, null, null, null, null);
cursor.moveToFirst();
News news = new News();
while (!cursor.isAfterLast() && (cursor.getString(1) != null)) {
news.setId(cursor.getString(0));
news.setTitle(cursor.getString(1));
cursor.moveToNext();
}
XposedBridge.log("news.getTitle():===" + news.getTitle());
if(news.getTitle() == null){
return false;
}
return true;
}
}
}
| [
"yefei313@126.com"
] | yefei313@126.com |
f2924aa3ab877be282b7218aa46d24977656ce19 | 4d1f29157250319090607706caa5957ac807e206 | /src/main/java/lk/easycarrental/controller/BookingController.java | 5dfdecb9907048fd555c658d939e2cc533e7152c | [] | no_license | yohansamitha/EasyCarRental-api | 88a2569f3f3a90119c361b261036b3705a04a31e | 9980b2045e64d84a1fbb6fea234152494713d0ee | refs/heads/master | 2023-07-03T20:43:20.355625 | 2021-08-12T04:28:48 | 2021-08-12T04:28:48 | 377,099,313 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,680 | java | package lk.easycarrental.controller;
import lk.easycarrental.dto.BookingDTO;
import lk.easycarrental.dto.CustomerDTO;
import lk.easycarrental.dto.DriverDTO;
import lk.easycarrental.dto.VehicleDTO;
import lk.easycarrental.exception.NotFoundException;
import lk.easycarrental.service.BookingService;
import lk.easycarrental.service.CustomerService;
import lk.easycarrental.service.DriverService;
import lk.easycarrental.service.VehicleService;
import lk.easycarrental.util.StandardResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
@RestController
@CrossOrigin
@RequestMapping("/api/v1/booking")
public class BookingController {
@Autowired
private CustomerService customerService;
@Autowired
private BookingService bookingService;
@Autowired
private VehicleService vehicleService;
@Autowired
private DriverService driverService;
@PostMapping(consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<StandardResponse> saveBooking(@RequestBody BookingDTO dto) {
System.out.println("save booking " + dto);
String validateCustomerData = validateBookingData(dto);
if (validateCustomerData.equals("true")) {
System.out.println("Valid booking");
CustomerDTO customerDTO = customerService.searchCustomer(dto.getCustomerNIC().getCustomerNIC());
dto.setCustomerNIC(customerDTO);
VehicleDTO vehicleDTO = vehicleService.searchVehicle(dto.getVehicleNumber().getVehicleNumber());
dto.setVehicleNumber(vehicleDTO);
DriverDTO d001 = driverService.searchDriver("D001");
dto.setDriverLicenseNumber(d001);
System.out.println("booking : " + dto);
if (bookingService.addBooking(dto)) {
return new ResponseEntity<>(new StandardResponse("201", "Done", dto), HttpStatus.CREATED);
} else {
return new ResponseEntity<>(new StandardResponse("500", "Internal Server Error Custom", dto), HttpStatus.INTERNAL_SERVER_ERROR);
}
} else {
throw new NotFoundException(validateCustomerData);
}
}
private String validateBookingData(BookingDTO dto) {
if (dto.getCustomerNIC().getCustomerNIC().trim().length() <= 0) {
return "booking CustomerNIC is missing";
} else if (dto.getVehicleNumber().getVehicleNumber().trim().length() <= 0) {
return "booking Vehicle number is missing";
} else if (dto.getBooking_date().trim().length() <= 0) {
return "booking Booking date is missing";
} else if (dto.getDeparture_date().trim().length() <= 0) {
return "booking Departure date is missing";
} else if (dto.getArrival_date().trim().length() <= 0) {
return "booking Arrival date is missing";
} else if (dto.getBooking_type().trim().length() <= 0) {
return "booking Booking type is missing";
} else if (dto.getBooking_status().trim().length() <= 0) {
return "booking Booking status is missing";
} else {
return "true";
}
}
// @GetMapping(produces = MediaType.APPLICATION_JSON_VALUE)
// public ResponseEntity<StandardResponse> getAllCustomer() {
// ArrayList<CustomerDTO> allCustomers = customerService.getAllCustomers();
// return new ResponseEntity<>(new StandardResponse("200", "", allCustomers), HttpStatus.OK);
// }
// @GetMapping(params = {"id"}, produces = MediaType.APPLICATION_JSON_VALUE)
// public ResponseEntity<StandardResponse> SearchCustomer(@RequestParam String id) {
// if (id.trim().length() <= 0) {
// throw new NotFoundException("Customer id cannot be empty");
// } else {
// CustomerDTO customerDTO = customerService.searchCustomer(id);
// return new ResponseEntity<>(new StandardResponse("200", "", customerDTO), HttpStatus.OK);
// }
// }
// @DeleteMapping(params = {"id"}, produces = MediaType.APPLICATION_JSON_VALUE)
// public ResponseEntity<StandardResponse> deleteCustomer(@RequestParam String id) {
// if (id.trim().length() <= 0) {
// throw new NotFoundException("Customer id cannot be empty");
// } else {
// boolean b = customerService.deleteCustomer(id);
// return new ResponseEntity<>(new StandardResponse("200", "Customer Delete Successful", id + " deleted " + b), HttpStatus.OK);
// }
// }
// @PutMapping(consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
// public ResponseEntity<StandardResponse> updateCustomer(@RequestBody CustomerDTO dto) {
// String validate = validateCustomerData(dto);
// if (validate.equals("true")) {
// if (dto.getUser_Id().trim().length() > 0) {
// if (customerService.updateCustomer(dto)) {
// return new ResponseEntity<>(new StandardResponse("200", "Customer Update Successful", dto), HttpStatus.OK);
// } else {
// return new ResponseEntity<>(new StandardResponse("500", "Internal Server Error Custom", dto), HttpStatus.INTERNAL_SERVER_ERROR);
// }
// } else {
// throw new NotFoundException("No User Id is Provided");
// }
// } else {
// throw new NotFoundException(validate);
// }
// }
}
| [
"yohansamitha123@gmail.com"
] | yohansamitha123@gmail.com |
2e6ee7ac5a0edb62e8a1b0c6f310dc820539ec0a | b9d3a691e0a64a92e0d106abb9bb7eb2f2ac79d0 | /bundles/sirix-core/src/main/java/org/sirix/api/IPageReadTrx.java | d6b261bbb6658ab7cda41db1abfbe4179d0ed9e3 | [
"BSD-3-Clause",
"LicenseRef-scancode-public-domain"
] | permissive | testadmin1-levelops/sirix | 363d6b46120d3b97200d88787a0d755afeaefa33 | 9b6b7ccbc1739eae41f319e6fb613b016ae88eab | refs/heads/master | 2022-10-29T09:03:54.928218 | 2020-01-24T22:53:04 | 2020-01-24T22:53:04 | 236,097,057 | 0 | 0 | BSD-3-Clause | 2022-10-05T20:01:14 | 2020-01-24T22:52:09 | Java | UTF-8 | Java | false | false | 4,144 | java | package org.sirix.api;
import javax.annotation.Nonnegative;
import javax.annotation.Nonnull;
import org.sirix.cache.PageContainer;
import org.sirix.cache.TransactionLogPageCache;
import org.sirix.exception.SirixIOException;
import org.sirix.node.EKind;
import org.sirix.node.interfaces.INodeBase;
import org.sirix.page.EPage;
import org.sirix.page.RevisionRootPage;
import org.sirix.page.UberPage;
import org.sirix.page.interfaces.IPage;
import com.google.common.base.Optional;
/**
* Interface for reading pages.
*
* @author Sebastian Graf, University of Konstanz
* @author Johannes Lichtenberger, University of Konstanz
*/
public interface IPageReadTrx extends AutoCloseable {
/**
* Get the session this transaction is bound to.
*
* @return session instance
*/
ISession getSession();
/**
* Get a node from persistent storage.
*
* @param pKey
* the unique node-ID
* @param pPage
* the page from which to fetch the node
* @return an {@link Optional} reference usually containing the node reference
* @throws SirixIOException
* if an I/O error occured
*/
Optional<? extends INodeBase> getNode(@Nonnegative final long pKey,
@Nonnull final EPage pPage) throws SirixIOException;
/**
* Current reference to actual rev-root page.
*
* @return the current revision root page
*
* @throws SirixIOException
* if something odd happens within the creation process.
*/
RevisionRootPage getActualRevisionRootPage() throws SirixIOException;
/**
* Getting the name corresponding to the given key.
*
* @param pNameKey
* name key for the term to search
* @param pKind
* kind of node
* @return the name
* @throws NullPointerException
* if {@code pKind} is {@code null}
*/
String getName(int pNameKey, @Nonnull EKind pKind);
/**
* Get the number of references for a name.
*
* @param pNameKey
* name key for the term to search
* @param pKind
* node type
* @return the number of references for a given keyy.
*/
int getNameCount(int pNameKey, @Nonnull EKind pKind);
/**
* Getting the raw name related to the name key and the node kind.
*
* @param pNameKey
* name key for the term to search
* @param pKind
* kind of node
* @return a byte array containing the raw name
* @throws NullPointerException
* if {@code pKind} is {@code null}
*/
byte[] getRawName(int pNameKey, @Nonnull EKind pKind);
/**
* Close transaction.
*
* @throws SirixIOException
* if something weird happened in the storage
*/
@Override
void close() throws SirixIOException;
/**
* Get a node from the page layer.
*
* @param pKey
* {@code nodeKey} of node
* @return {@code the node} or {@code null} if it's not available
* @throws SirixIOException
* if can't read nodePage
* @throws NullPointerException
* if {@code pPage} is {@code null}
* @throws IllegalArgumentException
* if {@code pKey} is negative
*/
PageContainer getNodeFromPage(@Nonnegative long pKey, @Nonnull EPage pPage)
throws SirixIOException;
/**
* Get the {@link UberPage}.
*
* @return {@link UberPage} reference
*/
UberPage getUberPage();
/** Determines if transaction is closed or not. */
boolean isClosed();
/**
* Get the revision number associated with the transaction.
*
* @return the revision number
*/
int getRevisionNumber();
/**
* Get page from cache.
*
* @param pKey
* key of persistent storage
* @return page instance
* @throws SirixIOException
* if an I/O error occurs
*/
IPage getFromPageCache(@Nonnegative long pKey) throws SirixIOException;
/**
* Clear the caches.
*/
void clearCaches();
/**
* Put content from page cache into persistent storage.
*
* @param pPageLog
* persistent page log
*/
void putPageCache(@Nonnull TransactionLogPageCache pPageLog);
}
| [
"viraj@levelops.io"
] | viraj@levelops.io |
6543f00fdc1027eeeed9873abf9c58789603803a | 7985823e82e3008e0cde5c86051bdc9e9f1c2813 | /jesus/src/venancio/alania.java | 91e11e277975ba9123801ecb7769006f3487661b | [] | no_license | JesusVA200998/Creando | b0a9cf78c21274f0281fe097d303452a8ba6a993 | f43d081dc22850509b4f0481c36ca481cae1a7ac | refs/heads/master | 2021-08-29T10:28:09.429366 | 2017-12-13T17:51:17 | 2017-12-13T17:51:17 | 114,150,086 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 160 | java | package venancio;
public class alania {
public static void main(String[] args) {
// TODO Auto-generated method stub
/* hola mundo boli*/
}
}
| [
"uno@DOS35"
] | uno@DOS35 |
c9a5c609ebd8cd4421c86129abed27bea4db4d65 | 711e906f2b6490ef1e4f1f58ca840fd14b857ce2 | /com/android/systemui/statusbar/notification/stack/NotificationSwipeHelper.java | bbe7cc8891ae1cc2889303565beb20548d8f8c05 | [] | no_license | dovanduy/SystemUIGoogle | 51a29b812000d1857145f429f983e93c02bff14c | cd41959ee1bd39a22d0d4e95dc40cefb72a75ec8 | refs/heads/master | 2022-07-09T01:48:40.088858 | 2020-05-16T16:01:21 | 2020-05-16T16:01:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 15,564 | java | //
// Decompiled by Procyon v0.5.36
//
package com.android.systemui.statusbar.notification.stack;
import android.service.notification.StatusBarNotification;
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow;
import android.animation.Animator;
import android.animation.ValueAnimator$AnimatorUpdateListener;
import android.os.Handler;
import android.graphics.Rect;
import com.android.systemui.statusbar.notification.row.ExpandableView;
import android.view.MotionEvent;
import com.android.systemui.plugins.FalsingManager;
import android.content.Context;
import android.view.View;
import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin;
import com.android.internal.annotations.VisibleForTesting;
import com.android.systemui.plugins.statusbar.NotificationSwipeActionHelper;
import com.android.systemui.SwipeHelper;
class NotificationSwipeHelper extends SwipeHelper implements NotificationSwipeActionHelper
{
@VisibleForTesting
protected static final long COVER_MENU_DELAY = 4000L;
private final NotificationCallback mCallback;
private NotificationMenuRowPlugin mCurrMenuRow;
private final Runnable mFalsingCheck;
private boolean mIsExpanded;
private View mMenuExposedView;
private final NotificationMenuRowPlugin.OnMenuEventListener mMenuListener;
private boolean mPulsing;
private View mTranslatingParentView;
NotificationSwipeHelper(final int n, final NotificationCallback mCallback, final Context context, final NotificationMenuRowPlugin.OnMenuEventListener mMenuListener, final FalsingManager falsingManager) {
super(n, (Callback)mCallback, context, falsingManager);
this.mMenuListener = mMenuListener;
this.mCallback = mCallback;
this.mFalsingCheck = new _$$Lambda$NotificationSwipeHelper$C9LXWH0up2brEDre5OaSo4akO38(this);
}
private void handleSwipeFromClosedState(final MotionEvent motionEvent, final View view, final float a, final NotificationMenuRowPlugin notificationMenuRowPlugin) {
final boolean dismissGesture = this.isDismissGesture(motionEvent);
final boolean towardsMenu = notificationMenuRowPlugin.isTowardsMenu(a);
final float escapeVelocity = this.getEscapeVelocity();
final float abs = Math.abs(a);
final int n = 1;
final boolean b = escapeVelocity <= abs;
final double n2 = (double)(motionEvent.getEventTime() - motionEvent.getDownTime());
final boolean b2 = !notificationMenuRowPlugin.canBeDismissed() && n2 >= 200.0;
final boolean b3 = towardsMenu && !dismissGesture;
final boolean b4 = !b || b2;
final boolean b5 = this.swipedEnoughToShowMenu(notificationMenuRowPlugin) && b4;
final boolean b6 = b && !towardsMenu && !dismissGesture;
final boolean b7 = notificationMenuRowPlugin.shouldShowGutsOnSnapOpen() || (this.mIsExpanded && !this.mPulsing);
final boolean b8 = b5 || (b6 && b7);
final int menuSnapTarget = notificationMenuRowPlugin.getMenuSnapTarget();
int n3;
if (!this.isFalseGesture(motionEvent) && b8) {
n3 = n;
}
else {
n3 = 0;
}
if ((b3 || n3 != 0) && menuSnapTarget != 0) {
this.snapOpen(view, menuSnapTarget, a);
notificationMenuRowPlugin.onSnapOpen();
}
else if (this.isDismissGesture(motionEvent) && !towardsMenu) {
this.dismiss(view, a);
notificationMenuRowPlugin.onDismiss();
}
else {
this.snapClosed(view, a);
notificationMenuRowPlugin.onSnapClosed();
}
}
private void handleSwipeFromOpenState(final MotionEvent motionEvent, final View view, final float n, final NotificationMenuRowPlugin notificationMenuRowPlugin) {
final boolean dismissGesture = this.isDismissGesture(motionEvent);
if (notificationMenuRowPlugin.isWithinSnapMenuThreshold() && !dismissGesture) {
notificationMenuRowPlugin.onSnapOpen();
this.snapOpen(view, notificationMenuRowPlugin.getMenuSnapTarget(), n);
}
else if (dismissGesture && !notificationMenuRowPlugin.shouldSnapBack()) {
this.dismiss(view, n);
notificationMenuRowPlugin.onDismiss();
}
else {
this.snapClosed(view, n);
notificationMenuRowPlugin.onSnapClosed();
}
}
public static boolean isTouchInView(final MotionEvent motionEvent, final View view) {
if (view == null) {
return false;
}
int n;
if (view instanceof ExpandableView) {
n = ((ExpandableView)view).getActualHeight();
}
else {
n = view.getHeight();
}
final int n2 = (int)motionEvent.getRawX();
final int n3 = (int)motionEvent.getRawY();
final int[] array = new int[2];
view.getLocationOnScreen(array);
final int n4 = array[0];
final int n5 = array[1];
return new Rect(n4, n5, view.getWidth() + n4, n + n5).contains(n2, n3);
}
private boolean swipedEnoughToShowMenu(final NotificationMenuRowPlugin notificationMenuRowPlugin) {
return !this.swipedFarEnough() && notificationMenuRowPlugin.isSwipedEnoughToShowMenu();
}
public void clearCurrentMenuRow() {
this.setCurrentMenuRow(null);
}
public void clearExposedMenuView() {
this.setExposedMenuView(null);
}
public void clearTranslatingParentView() {
this.setTranslatingParentView(null);
}
@Override
public void dismiss(final View view, final float n) {
this.dismissChild(view, n, this.swipedFastEnough() ^ true);
}
@Override
public void dismissChild(final View view, final float n, final boolean b) {
this.superDismissChild(view, n, b);
if (this.mCallback.shouldDismissQuickly()) {
this.mCallback.handleChildViewDismissed(view);
}
this.mCallback.onDismiss();
this.handleMenuCoveredOrDismissed();
}
public NotificationMenuRowPlugin getCurrentMenuRow() {
return this.mCurrMenuRow;
}
@VisibleForTesting
@Override
protected float getEscapeVelocity() {
return super.getEscapeVelocity();
}
public View getExposedMenuView() {
return this.mMenuExposedView;
}
@VisibleForTesting
protected Runnable getFalsingCheck() {
return this.mFalsingCheck;
}
@VisibleForTesting
protected Handler getHandler() {
return super.mHandler;
}
@Override
public float getMinDismissVelocity() {
return this.getEscapeVelocity();
}
public View getTranslatingParentView() {
return this.mTranslatingParentView;
}
public float getTranslation(final View view) {
if (view instanceof SwipeableView) {
return ((SwipeableView)view).getTranslation();
}
return 0.0f;
}
public Animator getViewTranslationAnimator(final View view, final float n, final ValueAnimator$AnimatorUpdateListener valueAnimator$AnimatorUpdateListener) {
if (view instanceof ExpandableNotificationRow) {
return ((ExpandableNotificationRow)view).getTranslateViewAnimator(n, valueAnimator$AnimatorUpdateListener);
}
return this.superGetViewTranslationAnimator(view, n, valueAnimator$AnimatorUpdateListener);
}
@VisibleForTesting
protected void handleMenuCoveredOrDismissed() {
final View exposedMenuView = this.getExposedMenuView();
if (exposedMenuView != null && exposedMenuView == this.mTranslatingParentView) {
this.clearExposedMenuView();
}
}
@VisibleForTesting
protected void handleMenuRowSwipe(final MotionEvent motionEvent, final View view, final float n, final NotificationMenuRowPlugin notificationMenuRowPlugin) {
if (!notificationMenuRowPlugin.shouldShowMenu()) {
if (this.isDismissGesture(motionEvent)) {
this.dismiss(view, n);
}
else {
this.snapClosed(view, n);
notificationMenuRowPlugin.onSnapClosed();
}
return;
}
if (notificationMenuRowPlugin.isSnappedAndOnSameSide()) {
this.handleSwipeFromOpenState(motionEvent, view, n, notificationMenuRowPlugin);
}
else {
this.handleSwipeFromClosedState(motionEvent, view, n, notificationMenuRowPlugin);
}
}
public boolean handleUpEvent(final MotionEvent motionEvent, final View view, final float n, final float n2) {
final NotificationMenuRowPlugin currentMenuRow = this.getCurrentMenuRow();
if (currentMenuRow != null) {
currentMenuRow.onTouchEnd();
this.handleMenuRowSwipe(motionEvent, view, n, currentMenuRow);
return true;
}
return false;
}
@VisibleForTesting
protected void initializeRow(final SwipeableView swipeableView) {
if (swipeableView.hasFinishedInitialization()) {
final NotificationMenuRowPlugin menu = swipeableView.createMenu();
if ((this.mCurrMenuRow = menu) != null) {
menu.setMenuClickListener(this.mMenuListener);
this.mCurrMenuRow.onTouchStart();
}
}
}
@Override
protected void onChildSnappedBack(final View view, final float n) {
final NotificationMenuRowPlugin mCurrMenuRow = this.mCurrMenuRow;
if (mCurrMenuRow != null && n == 0.0f) {
mCurrMenuRow.resetMenu();
this.clearCurrentMenuRow();
}
}
@Override
public void onDownUpdate(final View mTranslatingParentView, final MotionEvent motionEvent) {
this.mTranslatingParentView = mTranslatingParentView;
final NotificationMenuRowPlugin currentMenuRow = this.getCurrentMenuRow();
if (currentMenuRow != null) {
currentMenuRow.onTouchStart();
}
this.clearCurrentMenuRow();
this.getHandler().removeCallbacks(this.getFalsingCheck());
this.resetExposedMenuView(true, false);
if (mTranslatingParentView instanceof SwipeableView) {
this.initializeRow((SwipeableView)mTranslatingParentView);
}
}
public void onMenuShown(final View view) {
this.setExposedMenuView(this.getTranslatingParentView());
((Callback)this.mCallback).onDragCancelled(view);
final Handler handler = this.getHandler();
if (((Callback)this.mCallback).isAntiFalsingNeeded()) {
handler.removeCallbacks(this.getFalsingCheck());
handler.postDelayed(this.getFalsingCheck(), 4000L);
}
}
public void onMoveUpdate(final View view, final MotionEvent motionEvent, final float n, final float n2) {
this.getHandler().removeCallbacks(this.getFalsingCheck());
final NotificationMenuRowPlugin currentMenuRow = this.getCurrentMenuRow();
if (currentMenuRow != null) {
currentMenuRow.onTouchMove(n2);
}
}
public void resetExposedMenuView(final boolean b, final boolean b2) {
if (!this.shouldResetMenu(b2)) {
return;
}
final View exposedMenuView = this.getExposedMenuView();
if (b) {
final Animator viewTranslationAnimator = this.getViewTranslationAnimator(exposedMenuView, 0.0f, null);
if (viewTranslationAnimator != null) {
viewTranslationAnimator.start();
}
}
else if (exposedMenuView instanceof SwipeableView) {
final SwipeableView swipeableView = (SwipeableView)exposedMenuView;
if (!swipeableView.isRemoved()) {
swipeableView.resetTranslation();
}
}
this.clearExposedMenuView();
}
public void setCurrentMenuRow(final NotificationMenuRowPlugin mCurrMenuRow) {
this.mCurrMenuRow = mCurrMenuRow;
}
public void setExposedMenuView(final View mMenuExposedView) {
this.mMenuExposedView = mMenuExposedView;
}
public void setIsExpanded(final boolean mIsExpanded) {
this.mIsExpanded = mIsExpanded;
}
public void setPulsing(final boolean mPulsing) {
this.mPulsing = mPulsing;
}
@VisibleForTesting
protected void setTranslatingParentView(final View mTranslatingParentView) {
this.mTranslatingParentView = mTranslatingParentView;
}
public void setTranslation(final View view, final float translation) {
if (view instanceof SwipeableView) {
((SwipeableView)view).setTranslation(translation);
}
}
@VisibleForTesting
protected boolean shouldResetMenu(final boolean b) {
final View mMenuExposedView = this.mMenuExposedView;
return mMenuExposedView != null && (b || mMenuExposedView != this.mTranslatingParentView);
}
@Override
public void snapChild(final View view, final float n, final float n2) {
this.superSnapChild(view, n, n2);
((Callback)this.mCallback).onDragCancelled(view);
if (n == 0.0f) {
this.handleMenuCoveredOrDismissed();
}
}
@VisibleForTesting
protected void snapClosed(final View view, final float n) {
this.snapChild(view, 0.0f, n);
}
@Override
public void snapOpen(final View view, final int n, final float n2) {
this.snapChild(view, (float)n, n2);
}
@Override
public void snooze(final StatusBarNotification statusBarNotification, final int n) {
this.mCallback.onSnooze(statusBarNotification, n);
}
@Override
public void snooze(final StatusBarNotification statusBarNotification, final SnoozeOption snoozeOption) {
this.mCallback.onSnooze(statusBarNotification, snoozeOption);
}
@VisibleForTesting
protected void superDismissChild(final View view, final float n, final boolean b) {
super.dismissChild(view, n, b);
}
@VisibleForTesting
protected Animator superGetViewTranslationAnimator(final View view, final float n, final ValueAnimator$AnimatorUpdateListener valueAnimator$AnimatorUpdateListener) {
return super.getViewTranslationAnimator(view, n, valueAnimator$AnimatorUpdateListener);
}
@VisibleForTesting
protected void superSnapChild(final View view, final float n, final float n2) {
super.snapChild(view, n, n2);
}
@VisibleForTesting
@Override
protected boolean swipedFarEnough() {
return super.swipedFarEnough();
}
@Override
public boolean swipedFarEnough(final float n, final float n2) {
return this.swipedFarEnough();
}
@VisibleForTesting
@Override
protected boolean swipedFastEnough() {
return super.swipedFastEnough();
}
@Override
public boolean swipedFastEnough(final float n, final float n2) {
return this.swipedFastEnough();
}
public interface NotificationCallback extends Callback
{
void handleChildViewDismissed(final View p0);
void onDismiss();
void onSnooze(final StatusBarNotification p0, final int p1);
void onSnooze(final StatusBarNotification p0, final SnoozeOption p1);
boolean shouldDismissQuickly();
}
}
| [
"ethan.halsall@gmail.com"
] | ethan.halsall@gmail.com |
fa5bc00cbafeec1080469d9cfef4819887966ea2 | 84fe02f1ba1db6d6baf7eb6bf1d46e9128f66443 | /src/main/java/hu/u_szeged/ohsh/config/Constants.java | 7d849f3f3b098901bdb04952113340881e3272db | [] | no_license | jofel/hermannotes | c1d7a2398c830df9a4f586a3a2076a26446dae7c | 7afd50ad31f3de7f9f375e6e2522f79c2f79fdb0 | refs/heads/master | 2021-09-22T10:28:50.173517 | 2018-09-08T08:53:05 | 2018-09-08T08:53:05 | 108,280,926 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 361 | java | package hu.u_szeged.ohsh.config;
/**
* Application constants.
*/
public final class Constants {
//Regex for acceptable logins
public static final String LOGIN_REGEX = "^[_'.@A-Za-z0-9-]*$";
public static final String SYSTEM_ACCOUNT = "system";
public static final String ANONYMOUS_USER = "anonymoususer";
private Constants() {
}
}
| [
"fodorj@jusoft.hu"
] | fodorj@jusoft.hu |
db55dbbded5f7122fab3b46e772b4eaff202d99d | af2559ac87e14005524c7a3afc12f7c37b8542fc | /src/main/java/es/tid/provisioningManager/objects/Topology.java | 8afe2fdd71048d12489b8123b692021ac3abe1af | [
"Apache-2.0"
] | permissive | telefonicaid/netphony-topology | d54d1e25f3d876050eaa7479a5d879d1cc7ccf80 | 818c60076116d1ba7806497bb14949da70e364d5 | refs/heads/master | 2023-05-25T19:01:30.432685 | 2021-06-01T19:30:40 | 2021-06-01T19:30:40 | 25,867,170 | 34 | 18 | Apache-2.0 | 2023-05-24T08:48:56 | 2014-10-28T11:59:03 | Java | UTF-8 | Java | false | false | 6,942 | java | package es.tid.provisioningManager.objects;
import java.io.File;
import java.util.ArrayList;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.CharacterData;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import es.tid.tedb.elements.Link;
import es.tid.tedb.elements.Node;
public class Topology {
private ArrayList<Node> nodeList;
private ArrayList<Link> linkList;
public Topology() {
nodeList=new ArrayList<Node>();
linkList=new ArrayList<Link>();
}
public ArrayList<Node> getNodeList() {
return nodeList;
}
public void setNodeList(ArrayList<Node> nodeList) {
this.nodeList = nodeList;
}
public ArrayList<Link> getLinkList() {
return linkList;
}
public void setLinkList(ArrayList<Link> linkList) {
this.linkList = linkList;
}
public void initializefromfile(String fileName){
System.out.println("Initializing reachability from " + fileName);
File file = new File(fileName);
try {
DocumentBuilder builder = DocumentBuilderFactory.newInstance()
.newDocumentBuilder();
Document doc;
doc = builder.parse(file);
NodeList nodes_g = doc.getElementsByTagName("g");
for (int j = 0; j < nodes_g.getLength(); j++) {
Element element_domain = (Element) nodes_g.item(j);
NodeList nodes_V = element_domain
.getElementsByTagName("V");
Element domain_V = (Element) nodes_V.item(0);
String domain_Vs = getCharacterDataFromElement(domain_V);//FIXME: Ya veremos que hacemos con esto...domain_Vs
NodeList nodes_E = element_domain
.getElementsByTagName("E");
Element domain_E = (Element) nodes_E.item(0);
String domain_Es = getCharacterDataFromElement(domain_E);//FIXME: Ya veremos que hacemos con esto...domain_Es
NodeList nodes_node = element_domain
.getElementsByTagName("node");
for (int i=0; i<nodes_node.getLength();i++){
Node node=new Node();
Element node_element = (Element) nodes_node.item(i);
NodeList node_name_list = node_element
.getElementsByTagName("name");
Element node_name_element = (Element) node_name_list.item(0);
String node_name = getCharacterDataFromElement(node_name_element);//Nombre del nodo
NodeList node_id_list = node_element
.getElementsByTagName("id");
Element node_id_element = (Element) node_id_list.item(0);
String node_id = getCharacterDataFromElement(node_id_element);//ID del nodo
node.setNodeID(node_id);//Switch del nodo
NodeList node_controller_list = node_element
.getElementsByTagName("controller");
Element node_controller_element = (Element) node_controller_list.item(0);//Controlador del Nodo
if (node_controller_element!=null) {
NodeList controller_type_list=node_controller_element.getElementsByTagName("type");
Element controller_type_element = (Element) controller_type_list.item(0);
String controller_type = getCharacterDataFromElement(controller_type_element);//tipo del controlador
node.setRouterType(controller_type);//Tipo del nodo
NodeList controller_ip_list=node_controller_element.getElementsByTagName("ip");
Element controller_ip_element = (Element) controller_ip_list.item(0);
String controller_ip = getCharacterDataFromElement(controller_ip_element);//ip del controlador
node.getAddress().add(controller_ip);//IP
NodeList controller_port_list=node_controller_element.getElementsByTagName("port");
Element controller_port_element = (Element) controller_port_list.item(0);
String controller_port = getCharacterDataFromElement(controller_port_element);//port del controlador
}
nodeList.add(node);
}
/*
* <link>
* <source>00-00-00-00-00-00-00-01</source>
* <type>0</type>
* <target>00-00-00-00-00-00-00-03</target>
* <local_ifid>2</local_ifid>
* <remote_ifid>1</remote_ifid>
* <channels>
* <count>0</count>
* <item_version>0</item_version>
* </channels>
* </link>
*/
NodeList links_link = element_domain
.getElementsByTagName("link");
System.out.println("Before read links");
for (int k=0; k<links_link.getLength();k++){
Link link=new Link();
Element link_element = (Element) links_link.item(k);
NodeList link_source_list = link_element
.getElementsByTagName("source");
Element link_source_element = (Element) link_source_list.item(0);
String link_source = getCharacterDataFromElement(link_source_element);//Origen del link
link.setSourceId(link_source);//Source Switch ID
NodeList link_type_list = link_element
.getElementsByTagName("type");
Element link_type_element = (Element) link_type_list.item(0);
String link_type = getCharacterDataFromElement(link_type_element);//tipo de Link
link.setType(link_type);//Tipo
NodeList link_target_list = link_element
.getElementsByTagName("target");
Element link_target_element = (Element) link_target_list.item(0);
String link_target = getCharacterDataFromElement(link_target_element);//destino del Link
link.setDestID(link_target);
NodeList link_localIF_list = link_element
.getElementsByTagName("local_ifid");
Element link_localIF_element = (Element) link_localIF_list.item(0);
String link_localIF = getCharacterDataFromElement(link_localIF_element);//IF local del link
link.setSourceIntf(link_localIF);
NodeList link_remoteIF_list = link_element
.getElementsByTagName("remote_ifid");
Element link_remoteIF_element = (Element) link_remoteIF_list.item(0);
String link_remoteIF = getCharacterDataFromElement(link_remoteIF_element);//IF local del link
link.setDestIntf(link_remoteIF);
NodeList link_channels_list = link_element
.getElementsByTagName("channels");
Element link_channels_element = (Element) link_channels_list.item(0);//Channels
if (link_channels_element!=null) {
NodeList channels_count_list=link_channels_element.getElementsByTagName("count");
Element channels_count_element = (Element) channels_count_list.item(0);
String channels_count = getCharacterDataFromElement(channels_count_element);//Channels' count
NodeList channels_itemversion_list=link_channels_element.getElementsByTagName("item_version");
Element channels_itemversion_element = (Element) channels_itemversion_list.item(0);
String controller_ip = getCharacterDataFromElement(channels_itemversion_element);//Channels' item_version
}
linkList.add(link);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
public static String getCharacterDataFromElement(Element e) {
org.w3c.dom.Node child = e.getFirstChild();
if (child instanceof CharacterData) {
CharacterData cd = (CharacterData) child;
return cd.getData();
} else {
return "?";
}
}
}
| [
"eduardo.yustapadilla@telefonica.com"
] | eduardo.yustapadilla@telefonica.com |
6bc71b16368cf4ffdc82f7cf621b63a13b385986 | 0b6b598a135bb6c658cf6eb11969c8d9f085a87c | /src/test/java/org/ashsethu/utils/HtmlParserTest.java | 908a2b0fee529ffdb7a79b9da87a3a5446a4754b | [] | no_license | asethura/WebCrawler | 8efdce92d8e7e2b945809e7d74869dc076ac804e | 976299ccd303b94616e7be416ffa085b0b6d14f0 | refs/heads/master | 2022-09-23T05:56:44.154886 | 2020-04-13T13:49:42 | 2020-04-13T13:49:42 | 254,499,114 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,368 | java | package org.ashsethu.utils;
import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpHandler;
import com.sun.net.httpserver.HttpServer;
import org.apache.commons.lang3.StringEscapeUtils;
import org.ashsethu.service.impl.CrawlerServiceImpl;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import java.io.IOException;
import java.io.OutputStream;
import java.net.InetSocketAddress;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadPoolExecutor;
import static org.mockito.Mockito.when;
@RunWith(SpringRunner.class)
@SpringBootTest
public class HtmlParserTest {
protected static final Logger logger = LoggerFactory.getLogger(CrawlerServiceImpl.class);
@Test
public void noLinks_Test() throws IOException {
HttpServer server = HttpServer.create(new InetSocketAddress("localhost", 8001), 0);
server.createContext("/test", new MyHttpHandler());
ThreadPoolExecutor threadPoolExecutor = (ThreadPoolExecutor) Executors.newFixedThreadPool(10);
server.setExecutor(threadPoolExecutor);
server.start();
logger.info(" Server started on port 8001");
HtmlParser htmlParser = new HtmlParser();
//Testing a site with no links
Elements pageLinks = htmlParser.getLinks("http://localhost:8001/test");
assert (pageLinks.isEmpty());
server.stop(0);
}
@Test
public void MultiLink_Test() throws IOException, InterruptedException {
HttpServer server = HttpServer.create(new InetSocketAddress("localhost", 8001), 0);
server.createContext("/test", new MyHttpHandlerWthTwoLinks());
ThreadPoolExecutor threadPoolExecutor = (ThreadPoolExecutor) Executors.newFixedThreadPool(10);
server.setExecutor(threadPoolExecutor);
server.start();
logger.info(" Server started on port 8001");
HtmlParser htmlParser = new HtmlParser();
//Elements pageLinks = htmlParser.getLinks("https://asethura.wixsite.com/techfortech");
Elements pageLinks = htmlParser.getLinks("http://localhost:8001/test");
logger.info(" pageLinks.size() " + pageLinks.size());
assert (pageLinks.size() == 2);
server.stop(0);
}
private Elements createElementList() {
Element el1 = new Element("a").attr("href", "http://linkedin.com");
Element el2 = new Element("a").attr("href", "http://twitter.com");
Element el3 = new Element("a").attr("href", "http://google.com");
Elements els = new Elements();
els.add(el1);
els.add(el2);
els.add(el3);
return els;
}
private class MyHttpHandler implements HttpHandler {
@Override
public void handle(HttpExchange httpExchange) throws IOException {
String requestParamValue = null;
if ("CONNECT".equals(httpExchange.getRequestMethod())) {
requestParamValue = handleGetRequest(httpExchange);
}
handleResponse(httpExchange, requestParamValue);
}
private String handleGetRequest(HttpExchange httpExchange) {
return httpExchange.
getRequestURI()
.toString()
.split("\\?")[1]
.split("=")[1];
}
private void handleResponse(HttpExchange httpExchange, String requestParamValue) throws IOException {
OutputStream outputStream = httpExchange.getResponseBody();
StringBuilder htmlBuilder = new StringBuilder();
htmlBuilder.append("<html>").
append("<body>").
append("<h1>").
append("Hello ")
.append(requestParamValue)
.append("</h1>")
.append("</body>")
.append("</html>");
String htmlResponse = StringEscapeUtils.escapeHtml4(htmlBuilder.toString());
httpExchange.sendResponseHeaders(200, htmlResponse.length());
outputStream.write(htmlResponse.getBytes());
outputStream.flush();
outputStream.close();
}
}
private class MyHttpHandlerWthTwoLinks implements HttpHandler {
@Override
public void handle(HttpExchange httpExchange) throws IOException {
String requestParamValue = null;
if ("CONNECT".equals(httpExchange.getRequestMethod())) {
requestParamValue = handleGetRequest(httpExchange);
}
handleResponse(httpExchange, requestParamValue);
}
private String handleGetRequest(HttpExchange httpExchange) {
return httpExchange.
getRequestURI()
.toString()
.split("\\?")[1]
.split("=")[1];
}
private void handleResponse(HttpExchange httpExchange, String requestParamValue) throws IOException {
OutputStream outputStream = httpExchange.getResponseBody();
StringBuilder htmlBuilder = new StringBuilder();
htmlBuilder.append("<html>").
append("<body>").
append("<h1>").
append("Hello ")
.append(requestParamValue)
.append("</h1>")
.append("<a href=\"#\">").
append("Level 1")
.append("</a>")
.append("<a href=\"#\">").
append("Level 2")
.append("</a>")
.append("</body>")
.append("</html>");
//String htmlResponse = StringEscapeUtils.escapeHtml4(htmlBuilder.toString());
String htmlResponse = htmlBuilder.toString();
logger.info(htmlResponse);
httpExchange.sendResponseHeaders(200, htmlResponse.length());
outputStream.write(htmlResponse.getBytes());
outputStream.flush();
outputStream.close();
}
}
}
| [
"aks37@ilch-ml0381.local"
] | aks37@ilch-ml0381.local |
fe996df0b866f5827e10276605e64fb49c633c00 | 7dfa7a04bf286bce921103a33915bc8df2cf4713 | /extension-jaxrs/src/test/java/test/io/smallrye/openapi/runtime/scanner/ReferenceResponseTestResource.java | 5f0c5acc277d7b9632e4b452759a1a6a3f502cf4 | [
"Apache-2.0"
] | permissive | radcortez/smallrye-open-api | 49d6f02743e0156bf86494b58190be0ee60648f0 | 299ebd37acfdf40471a807c5ab6df37990114cfc | refs/heads/main | 2023-06-22T10:07:49.213942 | 2022-01-26T12:57:10 | 2022-01-26T12:57:10 | 235,538,281 | 0 | 0 | Apache-2.0 | 2023-06-08T03:58:21 | 2020-01-22T09:23:13 | Java | UTF-8 | Java | false | false | 782 | java | package test.io.smallrye.openapi.runtime.scanner;
import javax.json.JsonObject;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import org.eclipse.microprofile.openapi.annotations.responses.APIResponse;
@Path(value = "pets")
public class ReferenceResponseTestResource {
@SuppressWarnings(value = "unused")
@Path(value = "{id}")
@GET
@Consumes(value = MediaType.APPLICATION_JSON)
@Produces(value = MediaType.APPLICATION_JSON)
@APIResponse(responseCode = "200")
@APIResponse(ref = "NotFound")
@APIResponse(ref = "ServerError")
public JsonObject getPet(@PathParam(value = "id") String id) {
return null;
}
}
| [
"phillip.kruger@gmail.com"
] | phillip.kruger@gmail.com |
d6e7e6c0908f1899013b54ff03bdb6428bbf78a3 | 55a00b679e7d6446fb465ec0912c46b3c07696f0 | /src/main/java/com/epi/jhipster/web/rest/errors/LoginAlreadyUsedException.java | 279a6757fd98296ef688a1d107605219c7ea5d96 | [] | no_license | akalanka95/jhipstersupport-3 | c4efe87b9ba2ea239dcffadaaf652548e9d3ab68 | 94cac470ae905a2f1fcaf8a033c3e6bae0549769 | refs/heads/master | 2020-04-23T03:03:08.000860 | 2019-03-01T06:37:12 | 2019-03-01T06:37:12 | 170,865,981 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 336 | java | package com.epi.jhipster.web.rest.errors;
public class LoginAlreadyUsedException extends BadRequestAlertException {
private static final long serialVersionUID = 1L;
public LoginAlreadyUsedException() {
super(ErrorConstants.LOGIN_ALREADY_USED_TYPE, "Login name already used!", "userManagement", "userexists");
}
}
| [
"akalankamaduka95@gmail.com"
] | akalankamaduka95@gmail.com |
4f0fcbcb469a38b1b8c036c3b05f293831c06b99 | 59bdb6ab10be089e9ecb6eb47f867b7a97218e22 | /java/src/main/java/backtracking/CombinationSumII.java | bb57a8881e8033d48a91a6b5305c7e643cb8c44c | [] | no_license | mathslimin/leetcode | 6975082932070bdc7f4baf316dfa362d3c951622 | ee97ebacb242d0aca3bd10d07f5873dccc9a6cd0 | refs/heads/master | 2022-05-19T16:36:08.891571 | 2022-04-03T02:30:25 | 2022-04-03T02:30:25 | 475,932,165 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,786 | java | package backtracking;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* Created on 14/03/2017. Given a collection of candidate numbers (C) and a
* target number (T), find all unique combinations in C where the candidate numbers sums to T.
*
* <p>Each number in C may only be used once in the combination.
*
* <p>Note: All numbers (including target) will be positive integers. The solution set must not
* contain duplicate combinations. For example, given candidate set [10, 1, 2, 7, 6, 1, 5] and
* target 8, A solution set is: [ [1, 7], [1, 2, 5], [2, 6], [1, 1, 6] ]
*/
public class CombinationSumII {
/**
* Main method
*
* @param args
* @throws Exception
*/
public static void main(String[] args) throws Exception {
int[] candidates = {1, 1, 2, 2};
List<List<Integer>> result = new CombinationSumII().combinationSum2(candidates, 4);
}
public List<List<Integer>> combinationSum2(int[] candidates, int target) {
Arrays.sort(candidates);
List<List<Integer>> result = new ArrayList<>();
combination(0, target, candidates, new ArrayList<>(), result);
return result;
}
private void combination(int i, int target, int[] candidates, List<Integer> row, List<List<Integer>> result) {
if (target == 0) {
result.add(new ArrayList<>(row));
} else if (target > 0) {
for (int j = i, l = candidates.length; j < l; j++) {
if (j > i && candidates[j] == candidates[j - 1])
continue;
row.add(candidates[j]);
combination(j + 1, target - candidates[j], candidates, row, result);
row.remove(row.size() - 1);
}
}
}
}
| [
"mathslimin@gmail.com"
] | mathslimin@gmail.com |
e4207b421ae091d7fbb5552b5faa78d610497f46 | 8c302d7e4009fb19d511eea5ee3d0f3f40c7c152 | /src/main/java/com/spring/component/ComponentJdbcConnection.java | 52f7d3c6565505d82404d6216d61ce03086c7d91 | [] | no_license | alokMr1992/spring-framework | 48b84a82fd9147421d9d98f2cea21e39e5b2db69 | 14b70434a7de8981fd27abe9b27aa43a9f393cec | refs/heads/main | 2023-02-27T06:33:27.033271 | 2021-01-17T16:29:43 | 2021-01-17T16:29:43 | 325,971,877 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 512 | java | package com.spring.component;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.context.annotation.ScopedProxyMode;
import org.springframework.stereotype.Component;
@Component
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE, proxyMode = ScopedProxyMode.TARGET_CLASS)
public class ComponentJdbcConnection {
public ComponentJdbcConnection() {
System.out.println("Component Jdbc Connection");
}
} | [
"alok.mrityunjay1992@gmail.com"
] | alok.mrityunjay1992@gmail.com |
3cf68dc9f8a303fc694a20343829a1008eabe23b | 371dc7b85559249d1313a04b611a868ee3a8234b | /src/Controller/Controller_Setup.java | d8bfbd48dd0c21df06be601bfb25d68ae53f7120 | [] | no_license | Giammaria96/DanmakuCardGame-ABORTED- | 103a4353c1e92d487f03552b3236f8c8eff6b2b2 | 29f5183950cae94dab65de268bf4f645c8fb34a1 | refs/heads/master | 2021-06-19T01:51:38.263847 | 2017-06-19T03:35:33 | 2017-06-19T03:35:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,486 | java | package Controller;
import Language.Language;
import Views.Scenes.Scene_Setup;
import javafx.scene.control.ComboBox;
import javafx.scene.control.Slider;
import org.jetbrains.annotations.Contract;
import java.io.*;
public class Controller_Setup {
private final Slider slider1, slider2;
private final ComboBox<String> cb;
public Controller_Setup() {
Scene_Setup scene = new Scene_Setup();
slider1 = scene.getSFXSlider();
slider2 = scene.getBGMSlider();
cb = scene.getLanguageComboBox();
slider1.setOnMouseClicked(e -> Main.audio.testSFXVol(slider1.getValue() / 100));
slider1.setOnMousePressed(e -> Main.audio.testSFXVol(slider1.getValue() / 100));
slider1.setOnMouseReleased(e -> Main.audio.testSFXVol(slider1.getValue() / 100));
slider2.setOnMouseClicked(e -> Main.audio.testBGMVol(slider2.getValue() / 100));
slider2.setOnMousePressed(e -> Main.audio.testBGMVol(slider2.getValue() / 100));
slider2.setOnMouseReleased(e -> Main.audio.testBGMVol(slider2.getValue() / 100));
cb.getItems().addAll(createList());
cb.getSelectionModel().select(Language.SelectedLanguage);
scene.getExitButton().setOnAction(e->exit());
scene.getSaveButton().setOnAction(e->saveExit());
Main.setNewScene(scene);
}
@Contract(pure = true)
private String[] createList() {
return Language.availableLanguages;
}
private void saveExit() {
try {
BufferedReader FILE = new BufferedReader(new InputStreamReader(Scene_Setup.class.getResourceAsStream("/Controller/SETUP.dat")));
String line1 = cb.getSelectionModel().getSelectedItem();
FILE.readLine();
String line2 = FILE.readLine();
String line3 = (int) slider2.getValue()+"";
String line4 = (int) slider1.getValue()+"";
FILE.close();
BufferedWriter FILE2 = new BufferedWriter(new FileWriter("src/Controller/SETUP.dat"));
FILE2.write(line1 + "\n" + line2 + "\n" + line3 + "\n" + line4);
FILE2.close();
} catch (IOException e) {
e.printStackTrace();
}
Main.setNewLanguage(cb.getSelectionModel().getSelectedItem());
Main.audio.setVolume(slider2.getValue() / 100, slider1.getValue() / 100);
new Controller_Tittle();
}
private void exit() {
Main.audio.setVolume();
new Controller_Tittle();
}
}
| [
"eramirezsantis@gmail.com"
] | eramirezsantis@gmail.com |
f9880c0dfa2f6d91ad5e459fcecdf60361d6e0e8 | 9e9a6f33fcf7c8c378af4792019352fb734b131b | /src/test/java/dev/masuareb/testingweb/TestingWebApplicationTest.java | 0b1b5fba31d9f206601c6dc46880cc33034af94a | [] | no_license | masuareb/learning_spring-testing-web | 25ccae4f27c3d902fffdd76b67ac9d6bb5d6738c | db2171fab4d972dd75800ceb88a9d13a89ff5bf0 | refs/heads/main | 2023-02-16T06:08:08.087038 | 2021-01-17T19:19:43 | 2021-01-17T19:19:43 | 330,324,514 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,136 | java | package dev.masuareb.testingweb;
import static org.hamcrest.Matchers.containsString;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.web.servlet.MockMvc;
@SpringBootTest
@AutoConfigureMockMvc
public class TestingWebApplicationTest {
@Autowired
private MockMvc mockMvc;
@Test
public void shouldReturnDefaultMessage() throws Exception {
this.mockMvc.perform(get("/"))
.andDo(print())
.andExpect(status().isOk())
.andExpect(content().string(containsString("Hello, World")));
}
}
| [
"masuareb@hotmail.com"
] | masuareb@hotmail.com |
a3b08a83a56d4de1aa8b6a4caf3f616771da33f7 | 728433548fedea2997eb72086d3fb78670ff4d87 | /src/Pac_Abstract_Factory/AbstractFactory.java | fe824c806257c4f4fff3ec1d8da51ef27da719d0 | [] | no_license | vivekbasavaraj/Gas_Pump_Project | 84e42bae8b60b448233267edc1ea487a517c1a03 | f52ae6137c8096ffba924bee5c18a3e4984142c4 | refs/heads/master | 2021-01-19T04:47:56.989917 | 2017-04-06T06:50:42 | 2017-04-06T06:50:42 | 87,396,209 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 834 | java | package Pac_Abstract_Factory;
import Pac_Data_Store.*;
import Pac_Strategy.*;
/*
* Abstract Factory Interface consists of all the methods overridden in the concrete factory
*/
public interface AbstractFactory
{
public DS CreateDataStoreObj();
public StoreData CreateStoreDataObj();
public PayMsg CreatePayMsgObj();
public StoreCash CreateStoreCashObj();
public DisplayMenu CreateDisplayMenuObj();
public RejectMsg CreateRejectMsgObj();
public SetW CreateSetWObj(int k);
public SetPrice CreateSetPriceObj(int g);
public ReadyMsg CreateReadyMsgObj();
public SetInitialValues CreateSetIntialValuesObj();
public PumpGasUnit CreatePumpGasUnitObj();
public GasPumpedMsg CreateGasPumpedmsgObj();
public StopMsg CreateStopMsgObj();
public PrintReceipt CreatePrintReceiptObj();
public CancelMsg CreateCancelMsgObj();
}
| [
"vivek.basavaraj123@gmail.com"
] | vivek.basavaraj123@gmail.com |
6964079a0f69f759bface2712dcfa1c223e63aa6 | 00b50b55b16963749ea17cdcfe18fb750ac0fd08 | /propagates/studios/studio3/UnorderedList.java | 6ef5b8c78869e0a8e9d3cac2a92a6c37d6567300 | [] | no_license | xmars23/CSE247 | 6338ca5d0e01a9afa8786482eeca9f84cadc2dae | 89009ae5b6bd695b1f2a6500fc83705c34181ea1 | refs/heads/master | 2020-03-09T20:19:55.884615 | 2018-04-10T19:27:47 | 2018-04-10T19:27:47 | 128,981,696 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 716 | java | package studio3;
import java.util.LinkedList;
import java.util.List;
public class UnorderedList<T extends Comparable<T>> implements PriorityQueue<T> {
public List<T> list;
public UnorderedList() {
list = new LinkedList<T>();
}
@Override
public boolean isEmpty() {
//
// FIXME
//
return list.isEmpty();
}
@Override
public void insert(T thing) {
//
// FIXME
//
list.add(thing);
}
@Override
public T extractMin() {
//
// FIXME
//
T x=list.get(0);
int index;
for(int i=0;i<list.size();i++)
{
if(list.get(i).compareTo(x)<0)
{
x=list.get(i);
index = i;
}
}
list.remove(x);
return x;
}
}
| [
"xmeng23@wustl.edu"
] | xmeng23@wustl.edu |
94148addb65f29b9f513ab8c3b195fb9546d990a | dda312cb59e0e147970388f392baa9ec976e5d16 | /app/src/main/java/fr/esgi/mymodule/mymodule/myclub/app/Maps/MapsActivity.java | b775fc3eb2b89e0d6d02b7f604fd6206e2b19386 | [] | no_license | mohammedelakraoui/MyClub | 9d7ec38ab4e7facee54213306831c56ce0ca1d56 | 001c890a2727d8d486d8fdf9b0502cc025e3afaf | refs/heads/master | 2020-08-05T03:31:42.082268 | 2015-03-20T19:18:39 | 2015-03-20T19:18:39 | 22,598,420 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 17,520 | java | package fr.esgi.mymodule.mymodule.myclub.app.Maps;
import android.app.ActionBar;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.res.ColorStateList;
import android.location.Address;
import android.location.Geocoder;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.support.v4.app.FragmentActivity;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
import android.widget.Toast;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.LocationSource;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.Marker;
import com.google.android.gms.maps.model.MarkerOptions;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import fr.esgi.mymodule.mymodule.myclub.app.CalssesBDD.MapsBDD;
import fr.esgi.mymodule.mymodule.myclub.app.Classes.Maps;
import fr.esgi.mymodule.mymodule.myclub.app.Classes.Salle;
import fr.esgi.mymodule.mymodule.myclub.app.Manager.MessageBox;
import fr.esgi.mymodule.mymodule.myclub.app.R;
public class MapsActivity extends FragmentActivity implements LocationListener, LocationSource{
private int step=0;
private GoogleMap mMap; // Might be null if Google Play services APK is not available.
private LocationSource.OnLocationChangedListener mListener;
private LocationManager locationManager;
private final String longtitude="longtitude";
private final String latitude="latitude";
private Maps maps;
private MapsBDD mapsBDD;
boolean choix=false;
private void setVisible(Boolean b)
{
choix=b;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_maps);
ActionBar actionBar = getActionBar();
actionBar.hide();
mapsBDD=new MapsBDD(getBaseContext());
locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
if (locationManager != null) {
boolean gpsIsEnabled = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);
boolean networkIsEnabled = locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
if (gpsIsEnabled) {
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 5000L, 10F, (android.location.LocationListener) this);
}
if (networkIsEnabled) {
locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 5000L, 10F, (android.location.LocationListener) this);
}
}
setUpMapIfNeeded();
}
private void refresh()
{
locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
if (locationManager != null) {
boolean gpsIsEnabled = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);
boolean networkIsEnabled = locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
if (gpsIsEnabled) {
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 5000L, 10F, (android.location.LocationListener) this);
}
if (networkIsEnabled) {
locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 5000L, 10F, (android.location.LocationListener) this);
}
}
setUpMapIfNeeded();
}
public void infoLocation(String club_name,String number,String adresse_,String cp_)
{
final AlertDialog.Builder alert = new AlertDialog.Builder(MapsActivity.this);
LayoutInflater inflater = this.getLayoutInflater();
alert.setTitle("Ajouter un club?");
alert.setMessage("Adresse du nouveau club?");
// Set an EditText view to get user input
// final EditText input1 = new EditText(MapsActivity.this);
final View v_iew=inflater.inflate(R.layout.ajouter_coordonnees, null);
alert.setView(v_iew);
final EditText nom_club = (EditText)v_iew.findViewById(R.id.maps_nom_club);
final EditText numero=(EditText) v_iew. findViewById(R.id.maps_numero);
final EditText adresse=(EditText)v_iew.findViewById(R.id.maps_adresse);
final EditText cp=(EditText)v_iew. findViewById(R.id.maps_cp);
final EditText[] myEditText={nom_club,numero,adresse,cp};
if(step!=0)
{
check(myEditText);
}
nom_club.setText(club_name);
numero.setText(number);
adresse.setText(adresse_);
cp.setText(cp_);
alert.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
if (check(myEditText)) {
String addresse_new_club = "";
String nom_new_club = "MyClub";
addresse_new_club = numero.getText().toString() + " " + adresse.getText().toString() + " " + " " + cp.getText().toString();
nom_new_club = nom_club.getText().toString();
// Do something with value!
HashMap<String, Double> coordonnes = getLatitudeLongtitude(addresse_new_club);
if (coordonnes.size() > 0) {
MapsBDD mapsBDD = new MapsBDD(getBaseContext());
Maps maps = new Maps();
mapsBDD.open();
maps.setNom_Club(nom_new_club);
maps.setAdresse(addresse_new_club);
maps.setLongtitude(coordonnes.get(longtitude));
maps.setLatitude(coordonnes.get(latitude));
mapsBDD.insertCoordonnees(maps);
Maps maps1 = mapsBDD.getMapsWithAdresse(maps.getAdresse());
if (maps1 != null) {
//On affiche les infos dans un Toast
Toast.makeText(getBaseContext(), "L'ajout à été effectué correctement", Toast.LENGTH_LONG).show();
setUpMap();
} else {
Toast.makeText(getBaseContext(), "Error", Toast.LENGTH_LONG).show();
}
mapsBDD.close();
}
/* else
{
Toast.makeText(getBaseContext(), "Verifirez l'adresse SVP", Toast.LENGTH_LONG).show();
step=1;
infoLocation(nom_club.getText().toString(),numero.getText().toString(), adresse.getText().toString(),cp.getText().toString());
}*/
}
else
{
step=1;
infoLocation(nom_club.getText().toString(),numero.getText().toString(), adresse.getText().toString(),cp.getText().toString());
}
}
});
alert.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
// Canceled.
}
});
alert.show();
}
private HashMap<String,Double> getLatitudeLongtitude(String addresse_club)
{
HashMap<String,Double> coordonnes=new HashMap<String, Double>() ;
Geocoder geoCoder = new Geocoder(getBaseContext(), Locale.getDefault());
try {
// geoCoder.getFromLocationNam
List<Address> addresses = geoCoder.getFromLocationName(addresse_club, 5);
if (addresses.size() > 0) {
Double lat = (double) (addresses.get(0).getLatitude());
Double lon = (double) (addresses.get(0).getLongitude());
coordonnes.put(longtitude,lat);
coordonnes.put(latitude,lon);
final LatLng user = new LatLng(lat, lon);
Marker hamburg = mMap.addMarker(new MarkerOptions()
.position(user)
.title(addresse_club));
/*.icon(BitmapDescriptorFactory
.fromResource(R.drawable.club_icon)));*/
// Move the camera instantly to hamburg with a zoom of 15.
mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(user, 15));
// Zoom in, animating the camera.
mMap.animateCamera(CameraUpdateFactory.zoomTo(10), 2000, null);
}
else
{
MessageBox.Show(MapsActivity.this," Erreur dans l'adresse","Selon les resultats Google Maps y un erreur dans l'adresse : [ "+addresse_club+"].");
infoLocation("","","","");
}
} catch (IOException e) {
e.printStackTrace();
}
return coordonnes;
}
private Boolean check(EditText[] edit)
{
Boolean check_=true;
for(final EditText t:edit)
{
t.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
t.setBackgroundColor(getResources().getColor(R.color.defaultColor));
}
});
if(t.getText().toString().trim().matches(""))
{
t.setBackgroundColor(getResources().getColor(R.color.Red));
check_=false;
}
else
{
t.setBackgroundColor(getResources().getColor(R.color.defaultColor));
}
}
return check_;
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.maps, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle item selection
switch (item.getItemId()) {
case R.id.ajouterCoordonnes:
infoLocation("","","","");
return true;
default:
return super.onOptionsItemSelected(item);
}
}
@Override
public void onPause()
{
if(locationManager != null)
{
locationManager.removeUpdates(this);
}
super.onPause();
}
@Override
public void onLocationChanged(Location location)
{
if( mListener != null )
{
mListener.onLocationChanged( location );
//Move the camera to the user's location once it's available!
mMap.animateCamera(CameraUpdateFactory.newLatLng(new LatLng(location.getLatitude(), location.getLongitude())));
}
}
@Override
public void onResume()
{
super.onResume();
setUpMapIfNeeded();
if(locationManager != null)
{
try {
mMap.setMyLocationEnabled(true);
}
catch(Exception e){}
}
}
private void setUpMapIfNeeded() {
// Do a null check to confirm that we have not already instantiated the map.
if (mMap == null) {
// Try to obtain the map from the SupportMapFragment.
mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map))
.getMap();
// Check if we were successful in obtaining the map.
if (mMap != null) {
setUpMap();
}
}
}
private void setUpMap() {
// 4-6 Rue Louis Armand Paris ; 48.8331220 2.2775678
//111 Avenue Victor Hugo Aubervilliers; 48.9070929 2.3762860
//111 Avenue Victor Hugo 93300 Aubervilliers; 48.9070929 2.3762860
mMap.setMyLocationEnabled(true);
mapsBDD.open();
ArrayList<Maps> mapsList=new ArrayList<Maps>();
mapsList=mapsBDD.getAllcoordonnees();
afficherAllMarkers(mapsList);
}
void afficherAllMarkers(ArrayList<Maps> mapsList)
{
if(mapsList!=null) {
for (final Maps map : mapsList) {
final LatLng pos = new LatLng(map.getLongtitude(), map.getLatitude());
final Marker hamburg = mMap.addMarker(new MarkerOptions()
.position(pos)
.title(map.getNom_Club() + " : \n " + map.getAdresse()));
mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(pos, 15));
// Zoom in, animating the camera.
mMap.animateCamera(CameraUpdateFactory.zoomTo(10), 2000, null);
mMap.setOnMarkerClickListener(new GoogleMap.OnMarkerClickListener() {
@Override
public boolean onMarkerClick(Marker arg0) {
arg0.showInfoWindow();
menuMaps(map, arg0);
return true;
}
});
// mMap.addMarker(new MarkerOptions().position(new LatLng(map.getLongtitude(),map.getLatitude())).title(map.getNom_Club()+" : \n "+map.getAdresse()));
}
}
mapsBDD.close();
}
private void menuMaps(final Maps maps, final Marker marker)
{
final AlertDialog.Builder alert = new AlertDialog.Builder(MapsActivity.this);
LayoutInflater inflater = this.getLayoutInflater();
alert.setTitle("Gestion des clubs?");
alert.setMessage("Verifiez avant la supression!:");
final View v_iew=inflater.inflate(R.layout.gestion_club_on_maps, null);
alert.setView(v_iew);
final RadioGroup choix =(RadioGroup) v_iew. findViewById(R.id.radiogestion_maps);
final TextView nom_club_PoPup =(TextView) v_iew. findViewById(R.id.Nom_club_PopUp);
final TextView adresse_club_PoPuP =(TextView) v_iew. findViewById(R.id.information_popup);
nom_club_PoPup.setText(maps.getNom_Club());
adresse_club_PoPuP.setText(maps.getAdresse());//+ " info sup :[Longtitude ="+maps.getLongtitude()+" ; Latitude="+maps.getLatitude()+"]");
alert.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
final int selectedId = choix.getCheckedRadioButtonId();
RadioButton myChoix= (RadioButton) v_iew.findViewById(selectedId);
// suppression
if(myChoix==null) return;
if(myChoix.getText().toString().contains("Supprimer"))
{
mapsBDD.open();
mapsBDD.removeCoordonneesWithID(maps.getId());
mMap.clear();
afficherAllMarkers(mapsBDD.getAllcoordonnees());
mapsBDD.close();
}
}
});
alert.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
// Canceled.
}
});
alert.show();
}
private void supprimer(final Maps map,final Marker marker ) {
final AlertDialog.Builder alert = new AlertDialog.Builder(MapsActivity.this);
LayoutInflater inflater = this.getLayoutInflater();
alert.setTitle("Supprimer un club?");
alert.setMessage("Vous-voulez vraiment supprimer ce club?!:"+ map.toString());
AlertDialog.Builder ok = alert.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
/// marker.remove(); marker.remove();
//marker.setVisible(false);
Log.v("trace", "3");
setVisible(true);
//onCreate(Bundle.EMPTY);
mapsBDD.open();
mapsBDD.removeCoordonneesWithID(map.getId());
mapsBDD.close();
}
});
alert.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
// Canceled.
}
});
alert.show();
}
@Override
public void activate(OnLocationChangedListener listener)
{
mListener = listener;
}
@Override
public void deactivate()
{
mListener = null;
}
@Override
public void onProviderDisabled(String provider)
{
// TODO Auto-generated method stub
Toast.makeText(this, "provider disabled", Toast.LENGTH_SHORT).show();
}
@Override
public void onProviderEnabled(String provider)
{
}
@Override
public void onStatusChanged(String provider, int status, Bundle extras)
{
}
}
| [
"mohammed.elakraoui@gmail.com"
] | mohammed.elakraoui@gmail.com |
4db1a58aa0d9a4ef7ae1f0f679973ece471116b8 | 32ada64601dca2faf2ad0dae2dd5a080fd9ecc04 | /timesheet/src/main/java/com/fastcode/timesheet/addons/reporting/application/reportrole/IReportroleAppService.java | 2e562d2e4147f9a2eb4baa6193655f7b35c590c0 | [] | no_license | fastcoderepos/tbuchner-sampleApplication1 | d61cb323aeafd65e3cfc310c88fc371e2344847d | 0880d4ef63b6aeece6f4a715e24bfa94de178664 | refs/heads/master | 2023-07-09T02:59:47.254443 | 2021-08-11T16:48:27 | 2021-08-11T16:48:27 | 395,057,379 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,720 | java | package com.fastcode.timesheet.addons.reporting.application.reportrole;
import java.util.List;
import java.util.Map;
import com.fastcode.timesheet.addons.reporting.domain.reportrole.QReportrole;
import com.fastcode.timesheet.addons.reporting.domain.report.Report;
import com.fastcode.timesheet.addons.reporting.domain.reportrole.ReportroleId;
import com.fastcode.timesheet.domain.core.authorization.role.Role;
import com.querydsl.core.BooleanBuilder;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import com.fastcode.timesheet.commons.search.SearchCriteria;
import com.fastcode.timesheet.commons.search.SearchFields;
import com.fastcode.timesheet.addons.reporting.application.reportrole.dto.*;
@Service
public interface IReportroleAppService {
public CreateReportroleOutput create(CreateReportroleInput reportrole);
public void delete(ReportroleId reportroleId);
public Boolean addReportsToRole(Role role, List<Report> reportsList);
public UpdateReportroleOutput update(ReportroleId reportroleId, UpdateReportroleInput input);
public FindReportroleByIdOutput findById(ReportroleId reportroleId);
public List<FindReportroleByIdOutput> find(SearchCriteria search, Pageable pageable) throws Exception;
public BooleanBuilder search(SearchCriteria search) throws Exception;
public void checkProperties(List<String> list) throws Exception;
public BooleanBuilder searchKeyValuePair(QReportrole reportrole, Map<String,SearchFields> map,Map<String,String> joinColumns);
public ReportroleId parseReportroleKey(String keysString);
//Report
public GetReportOutput getReport(ReportroleId reportroleId);
}
| [
"info@nfinityllc.com"
] | info@nfinityllc.com |
1e525cde7106d332ce1ba7091485dbdf1cb3cbf8 | 5fa9d80820142bc20493c2db593a2df325875c6d | /app/src/main/java/com/jc/lottery/bean/VictoryBean.java | 0d7b3fd8851d490fddd92f4f653c9d496d732089 | [] | no_license | chentt521520/svn_android_mobile | 27259538968e40ed8c4a6d21edf15b863f6c988c | 639142764df9a1f0d2ee187e67fd51c9ec82d867 | refs/heads/master | 2022-11-10T20:56:52.537677 | 2020-06-23T09:51:33 | 2020-06-23T09:51:33 | 274,142,856 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,785 | java | package com.jc.lottery.bean;
import com.jc.lottery.bean.type.MatchInfo;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* @author lr
* @description:
* @date:${DATA} 15:24
*/
public class VictoryBean implements Serializable{
private String code;
private String message;
private String state;
private IssueInfo issueInfo;
private List<MatchList> matchList = new ArrayList<MatchList>();
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public IssueInfo getIssueInfo() {
return issueInfo;
}
public void setIssueInfo(IssueInfo issueInfo) {
this.issueInfo = issueInfo;
}
public List<MatchList> getMatchList() {
return matchList;
}
public void setMatchList(List<MatchList> matchList) {
this.matchList = matchList;
}
public class IssueInfo implements Serializable{
private String id;
private String issue_end_time;
private String issue_no;
private String lottery_name;
private String pool_amount;
private String unit_price;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getIssue_end_time() {
return issue_end_time;
}
public void setIssue_end_time(String issue_end_time) {
this.issue_end_time = issue_end_time;
}
public String getIssue_no() {
return issue_no;
}
public void setIssue_no(String issue_no) {
this.issue_no = issue_no;
}
public String getLottery_name() {
return lottery_name;
}
public void setLottery_name(String lottery_name) {
this.lottery_name = lottery_name;
}
public String getPool_amount() {
return pool_amount;
}
public void setPool_amount(String pool_amount) {
this.pool_amount = pool_amount;
}
public String getUnit_price() {
return unit_price;
}
public void setUnit_price(String unit_price) {
this.unit_price = unit_price;
}
}
public class MatchList implements Serializable{
private String away_name;
private String game_name;
private String game_no;
private String game_time;
private String host_name;
private String issue_no;
private String play_type;
private String id;
private String type = "0";
private List<Boolean> typeSelect = new ArrayList<>();
public String getAway_name() {
return away_name;
}
public void setAway_name(String away_name) {
this.away_name = away_name;
}
public String getGame_name() {
return game_name;
}
public void setGame_name(String game_name) {
this.game_name = game_name;
}
public String getGame_no() {
return game_no;
}
public void setGame_no(String game_no) {
this.game_no = game_no;
}
public String getGame_time() {
return game_time;
}
public void setGame_time(String game_time) {
this.game_time = game_time;
}
public String getHost_name() {
return host_name;
}
public void setHost_name(String host_name) {
this.host_name = host_name;
}
public String getIssue_no() {
return issue_no;
}
public void setIssue_no(String issue_no) {
this.issue_no = issue_no;
}
public String getPlay_type() {
return play_type;
}
public void setPlay_type(String play_type) {
this.play_type = play_type;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public List<Boolean> getTypeSelect() {
return typeSelect;
}
public void setTypeSelect(List<Boolean> typeSelect) {
this.typeSelect = typeSelect;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
}
}
| [
"15129858157@163.com"
] | 15129858157@163.com |
2fc5ed6e1c7b8b88ad6f147b5c2f677ba4a447ae | f833c6a6ba4ea2d9b052e43e943a639542078949 | /src/main/java/sabanapayroll/EmployeeByHours.java | 425dfe7f731f7fe58bd5a2ed59871ce8947ecc4a | [] | no_license | MariaPaulaAcero/ACERO-GIRALDO-MAYORGA-SABANA-POOB-2021-1-LAB-INHERITANCE | 25b5000e53ea9cad7b3b6c612aa9d18f6892244e | f37454ff05c04ad9ed287ae24c33d967003e2a37 | refs/heads/master | 2023-04-06T15:06:42.385768 | 2021-04-03T01:11:23 | 2021-04-03T01:11:23 | 351,242,195 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 585 | java | package sabanapayroll;
public class EmployeeByHours extends Employee{
private static final double HOUR = 6500;
private int hoursWorked;
public EmployeeByHours(String name, String lastName, Department department, int hoursWorked) {
super(name, lastName, department);
this.hoursWorked = hoursWorked;
}
@Override
public double calculateSalary(){
double salary = EmployeeByHours.HOUR * hoursWorked;
return salary;
}
@Override
public String toString(){
return super.toString() + " payment by hours.";
}
} | [
"mariaacre@unisabana.edu.co"
] | mariaacre@unisabana.edu.co |
d0eb67b4d70433e210a9510e8b2774218007cf8b | 6acd3e7b955ff8a538220b203e9ccb59f1a153c8 | /src/main/java/kinesis/handlers/DataGenerator.java | 5041607cdd2234d44760a74dfd1bcce1f693838f | [] | no_license | rajpal-choudhary/Kinesis-hello-world | a0447da757cbeb78d313a6882183cf68a08883be | df78395944572f0e4358cdd92f467665e5236381 | refs/heads/main | 2023-03-27T01:57:42.337194 | 2021-03-30T12:57:22 | 2021-03-30T12:57:22 | 352,568,153 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 794 | java | package kinesis.handlers;
import org.json.simple.JSONObject;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
import java.time.Instant;
import java.util.Random;
public class DataGenerator {
private final String[] TICKERS = {"AAPL", "AMZN", "MSFT", "INTC", "TBV"};
public ByteBuffer generateData() {
int index = new Random().nextInt(TICKERS.length);
JSONObject record = new JSONObject();
record.put("EVENT_TIME", Instant.now().toString());
record.put("TICKER", TICKERS[index]);
record.put("PRICE", new Random().nextDouble() * 100);
String str = record.toString();
System.out.println(str);
byte[] sendData = str.getBytes(StandardCharsets.UTF_8);
return ByteBuffer.wrap(sendData);
}
}
| [
"bajaj.varun@hotmail.com"
] | bajaj.varun@hotmail.com |
9b4e0a8c2e71d37775e697240af7a1a141a52163 | fdec1757b376d7a80875a5a65934c353a7ddce87 | /src/main/java/com/km/nn/Net.java | b7cce7d2326c6761281f1791eb13f10c8cba8282 | [] | no_license | kacper-/r2 | 92963b7d26f724fdfc22eb5597c2d1b1309ee405 | 450d1645fd116be05c5d4eac8e0f845dbe3b96ed | refs/heads/master | 2023-06-02T09:44:23.438952 | 2021-06-19T21:03:32 | 2021-06-19T21:03:32 | 378,479,180 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,010 | java | package com.km.nn;
import java.io.Serializable;
import java.util.Arrays;
class Net implements Serializable {
private final static int SIZE = 64;
private final Layer front;
private final Layer back;
private final Layer middle;
private final Layer middle2;
Net(double learningFactor) {
front = new Layer(SIZE, SIZE, learningFactor);
middle = new Layer(SIZE, SIZE, learningFactor);
middle2 = new Layer(SIZE, SIZE, learningFactor);
back = new Layer(1, SIZE, learningFactor);
}
public double process(double[] signal) {
front.process(signal);
middle.process(front.getOutputs());
middle2.process(middle.getOutputs());
back.process(middle2.getOutputs());
return back.getOutputs()[0];
}
public void teach(double[] signal, double expected) {
double result = process(signal);
double[] backError = new double[]{result - expected};
double[] middle2Error = calculateError(back.getWeights(), backError);
double[] middleError = calculateError(middle2.getWeights(), middle2Error);
double[] frontError = calculateError(middle.getWeights(), middleError);
back.calculateWeightDeltas(backError);
middle2.calculateWeightDeltas(middle2Error);
middle.calculateWeightDeltas(middleError);
front.calculateWeightDeltas(frontError);
apply();
}
public int getSize() {
return SIZE;
}
private void apply() {
front.applyWeightDeltas();
middle.applyWeightDeltas();
middle2.applyWeightDeltas();
back.applyWeightDeltas();
}
private double[] calculateError(double[][] weights, double[] error) {
double[] result = new double[weights[0].length];
Arrays.fill(result, 0);
for (int w = 0; w < result.length; w++) {
for (int n = 0; n < weights.length; n++)
result[w] += weights[n][w] * error[n];
}
return result;
}
}
| [
"kacper.marczewski@gmail.com"
] | kacper.marczewski@gmail.com |
effcca44d2d83ef34076e47ef387f0f4ba30e0d7 | 6f3c8cf6cad7c781d06ba242daf48f0b3f41a0f4 | /BlogWebAppProject/src/cubes/main/dao/PostDAO.java | f94cb3c6a78eee5ab5b3834adf128894daf86188 | [] | no_license | ivancukic/Blog-spring | 90e052edaf403ec57dc2de8b6c63d9f69b96218e | 2632d1ed43c1808e194da4e53db046a9ae191ca0 | refs/heads/master | 2023-07-02T13:05:50.074345 | 2021-07-28T11:17:06 | 2021-07-28T11:17:06 | 390,321,368 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 851 | java | package cubes.main.dao;
import java.util.List;
import cubes.main.entity.Post;
import cubes.main.entity.Slider;
public interface PostDAO {
public List<Post> getPostList(); // POSTS LIST
public void savePost(Post post); // SAVE POST
public Post getPost(int id); // UPDATE POST
public void deletePost(int id); // DELETE POST
public List<Post> getImportantPost(); // LIST OF IMPORTANT POST
public Post getPostWithTag(int id);
public List<Post> getPostListByCategory(int id); // POST BY CATEGORY
public List<Post> getPostListByTag(int id); // POST BY TAG
public List<Post> searchBlogPosts(String theSearchPost); // SEARCH FOR BLOG POSTS
public Post getPreviousPost(int id); // PREVIOUS POST
public Post getNextPost(int id); // NEXT POST
public List<Post> getPostListByAuthor(String author); // POST LIST OF AUTHOR
}
| [
"73653389+ivancukic@users.noreply.github.com"
] | 73653389+ivancukic@users.noreply.github.com |
313b615f7a297c9f88bd7d00f658cf4ff5482f17 | c99e5c40ad85e6e14b69dae6e3a8b3af3424013e | /src/main/java/com/pporzuczek/web/rooms/app/repository/OrganizationRepository.java | 8c3e8d40d9fcf766687f216497abc2ad852404ae | [
"MIT"
] | permissive | PeterPorzuczek/web-rooms-app | c907e04b9c049a93db450a9e2efb7f968500edd2 | 8c6c5ece07e5e4c4b2e6f7225f80f03fbba15b02 | refs/heads/master | 2022-12-14T11:40:39.553736 | 2022-12-12T05:14:23 | 2022-12-12T05:14:23 | 79,398,817 | 5 | 2 | null | null | null | null | UTF-8 | Java | false | false | 896 | java | package com.pporzuczek.web.rooms.app.repository;
import java.io.Serializable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import com.pporzuczek.web.rooms.app.model.Organization;
@Repository
public interface OrganizationRepository extends JpaRepository<Organization, Serializable> {
Organization findById(Long id);
Organization findByName(String name);
@Modifying
@Transactional
@Query("update Organization o set o.name = :name "
+ "where o.id = :id")
int updateOrganization(
@Param("id") Long id,
@Param("name") String name);
}
| [
"Piotr@MacBook-Pro.local"
] | Piotr@MacBook-Pro.local |
3c0df85ecfb397af861955decca620aedb9d446b | 01115bb0065ad347874f88ef9e3e64639c3db0f0 | /runelite-client/src/main/java/net/runelite/client/rs/TeeInputStream.java | 143f50740ed100e413dda3949ebebfecf68b7be5 | [
"BSD-2-Clause",
"LicenseRef-scancode-free-unknown"
] | permissive | runelite/runelite | 86e816bd75edb28731ec3559cbfbc9d132baf40a | 88318e346784beb49818112fdc96438e2a2ecd80 | refs/heads/master | 2023-08-22T13:54:56.343669 | 2023-08-21T15:19:25 | 2023-08-21T15:19:25 | 57,461,213 | 5,124 | 7,381 | BSD-2-Clause | 2023-09-14T18:13:32 | 2016-04-30T20:48:02 | Java | UTF-8 | Java | false | false | 2,437 | java | /*
* Copyright (c) 2019 Abex
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.client.rs;
import java.io.FilterInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import lombok.Getter;
import lombok.Setter;
class TeeInputStream extends FilterInputStream
{
@Getter
@Setter
private OutputStream out;
TeeInputStream(InputStream in)
{
super(in);
}
@Override
public int read(byte[] b, int off, int len) throws IOException
{
int thisRead = super.read(b, off, len);
if (thisRead > 0)
{
out.write(b, off, thisRead);
}
return thisRead;
}
@Override
public int read() throws IOException
{
int val = super.read();
if (val != -1)
{
out.write(val);
}
return val;
}
@Override
public long skip(long n) throws IOException
{
byte[] buf = new byte[(int) Math.min(n, 0x4000)];
long total = 0;
while (n > 0)
{
int read = (int) Math.min(n, buf.length);
read = read(buf, 0, read);
if (read == -1)
{
break;
}
total += read;
n -= read;
}
return total;
}
@Override
public boolean markSupported()
{
return false;
}
}
| [
"Adam@sigterm.info"
] | Adam@sigterm.info |
02d4fa9814a0d314ebbe7d6adb33a3e701ca35d6 | 83661b6d498075b2df257ca86372311feaf79d5c | /src/main/java/com/cognifide/maven/plugins/crx/CrxResponse.java | 5442f173fe82c6d6161820227ccf42c39ff607ae | [
"Apache-2.0"
] | permissive | frederikcolardyn/Maven-CRX-Plugin | 34ba201842939247fcf2b68b52ae5f548a156932 | 869713ab373ba0e85762f7c1ebfc5d8b7cde06c8 | refs/heads/master | 2020-04-19T19:34:01.324894 | 2019-01-30T18:47:51 | 2019-01-30T18:47:51 | 168,392,412 | 0 | 0 | Apache-2.0 | 2019-01-30T18:22:19 | 2019-01-30T18:22:18 | null | UTF-8 | Java | false | false | 1,390 | java | /*
* Copyright 2012 Cognifide Limited
*
* 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.cognifide.maven.plugins.crx;
import java.io.IOException;
import org.codehaus.jackson.map.ObjectMapper;
public final class CrxResponse {
private CrxResponse() {
}
public static CrxResponse parseCrxJsonResponse(String json) throws IOException {
ObjectMapper mapper = new ObjectMapper();
return mapper.readValue(json, CrxResponse.class);
}
private boolean success;
private String message;
private String path;
public boolean isSuccess() {
return success;
}
public void setSuccess(boolean success) {
this.success = success;
}
public String getMsg() {
return message;
}
public void setMsg(String message) {
this.message = message;
}
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
}
| [
"cubanan@gmail.com"
] | cubanan@gmail.com |
7ce27fac62c754695b2e37acd4ab960880cf69fc | d4057f6669c6f428b59fdfaa2a783e443bf4cffb | /app/src/main/java/com/example/yairandaviad/bookshop/MainActivity.java | 4c4475c10ad7ac628b34df93aa295b8d37d5241f | [] | no_license | asarid/Books_store | 4aa857d6416322da278e0d9f6d3f76c854a2f726 | 73d0c3ddb373be6c8dd8654e0132ef1f22c1f75e | refs/heads/master | 2016-08-12T03:32:32.245392 | 2015-12-17T17:44:19 | 2015-12-17T17:44:19 | 48,186,376 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,795 | java | package com.example.yairandaviad.bookshop;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.view.Menu;
import android.view.MenuItem;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
/* Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
}
})*/
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
| [
"wgix77jd5hekmeupxsjjjjkrelbitw766bovjyu2p4emwfeo2nta"
] | wgix77jd5hekmeupxsjjjjkrelbitw766bovjyu2p4emwfeo2nta |
7a4fd5f2eb8d2d25fe0a2e76dd4654d7c11416e7 | f6ecdb6ac039d9a217ea5f4070ef63cc7aa3d23a | /LMS/mapreduce/Mr_Assignment_solution_module4/src/in/edureka/mapreduce/Max_temp.java | 425989e0c89ad8e828ad32075eaca7a241c24c3a | [] | no_license | shrds/Hadoop | b9ffe2ee1385f84c3bbba8acecdb389948406b5a | a98bf349454f9f2fb3bb48a9654bf81575500f1e | refs/heads/master | 2021-01-18T18:32:48.538670 | 2017-03-31T21:10:55 | 2017-03-31T21:10:55 | 86,860,769 | 0 | 0 | null | null | null | null | WINDOWS-1250 | Java | false | false | 7,893 | java |
/*******************************************************************************
Copyright (c) 2014 edureka! [www.edureka.in]
******************************************************************************/
package in.edureka.mapreduce;
import java.io.IOException;
import java.util.StringTokenizer;
/*
* All org.apache.hadoop packages can be imported using the jar present in lib
* directory of this java project.
*/
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.hadoop.mapreduce.Reducer;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.input.TextInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
import org.apache.hadoop.mapreduce.lib.output.TextOutputFormat;
/**
* @author edureka!
* @version 1.0
* @since 13-Apr-2014
* @package in.edureka.mapreduce
* @copyright Copyright (c) 2014 edureka! [www.edureka.in]
* <p>The Temperature program finds out the maximum temperature in every year from the given input file.
* The output data is in the form of “Year and Maximum temperature corresponding to that year".
* We write a map reduce code to achieve this, where mapper makes key value pair from the input file
* and reducer does aggregation on this key value pair.
*/
public class Max_temp {
/**
* @author edureka!
* @interface Mapper
* <p>Map class is static and extends MapReduceBase and implements Mapper
* interface having four hadoop generics type LongWritable, Text, Text,
* IntWritable.
*/
public static class Map extends
Mapper<LongWritable, Text, Text, IntWritable> {
//Mapper
/**
* @method map
* <p>This method takes the input as text data type and and tokenizes input
* by taking whitespace as delimiter. The first token goes year and second token is temperature,
* this is repeated till last token. Now key value pair is made and passed to reducer.
* @method_arguments key, value, output, reporter
* @return void
*/
//Defining a local variable k of type Text
Text k= new Text();
/*
* (non-Javadoc)
* @see org.apache.hadoop.mapred.Mapper#map(java.lang.Object, java.lang.Object, org.apache.hadoop.mapred.OutputCollector, org.apache.hadoop.mapred.Reporter)
*/
@Override
public void map(LongWritable key, Text value, Context context)
throws IOException, InterruptedException {
//Converting the record (single line) to String and storing it in a String variable line
String line = value.toString();
//StringTokenizer is breaking the record (line) according to the delimiter whitespace
StringTokenizer tokenizer = new StringTokenizer(line," ");
//Iterating through all the tokens and forming the key value pair
while (tokenizer.hasMoreTokens()) {
//The first token is going in year variable of type string
String year= tokenizer.nextToken();
k.set(year);
//Takes next token and removes all the whitespaces around it and then stores it in the string variable called temp
String temp= tokenizer.nextToken().trim();
//Converts string temp into integer v
int v = Integer.parseInt(temp);
//Sending to output collector which inturn passes the same to reducer
context.write(k,new IntWritable(v));
}
}
}
//Reducer
/**
* @author edureka!
* @interface Reducer
* <p>Reduce class is static and extends MapReduceBase and implements Reducer
* interface having four hadoop generics type Text, IntWritable, Text, IntWritable.
*/
public static class Reduce extends
Reducer<Text, IntWritable, Text, IntWritable> {
/**
* @method reduce
* <p>This method takes the input as key and list of values pair from mapper, it does aggregation
* based on keys and produces the final output.
* @method_arguments key, values, output, reporter
* @return void
*/
/*
* (non-Javadoc)
* @see org.apache.hadoop.mapred.Reducer#reduce(java.lang.Object, java.util.Iterator, org.apache.hadoop.mapred.OutputCollector, org.apache.hadoop.mapred.Reporter)
*/
@Override
public void reduce(Text key, Iterable<IntWritable> values, Context context)
throws IOException, InterruptedException {
/*
* Iterates through all the values available with a key and if the integer variable temperature
* is greater than maxtemp, then it becomes the maxtemp
*/
//Defining a local variable maxtemp of type int
int maxtemp=0;
for(IntWritable it : values) {
//Defining a local variable temperature of type int which is taking all the temperature
int temperature= it.get();
if(maxtemp<temperature)
{
maxtemp =temperature;
}
}
//Finally the output is collected as the year and maximum temperature corresponding to that year
context.write(key, new IntWritable(maxtemp));
}
}
//Driver
/**
* @method main
* <p>This method is used for setting all the configuration properties.
* It acts as a driver for map reduce code.
* @return void
* @method_arguments args
* @throws Exception
*/
public static void main(String[] args) throws Exception {
//reads the default configuration of cluster from the configuration xml files
Configuration conf = new Configuration();
//Initializing the job with the default configuration of the cluster
Job job = new Job(conf, "Max_temp");
//Assigning the driver class name
job.setJarByClass(Max_temp.class);
//Defining the mapper class name
job.setMapperClass(Map.class);
//Defining the reducer class name
job.setReducerClass(Reduce.class);
//Defining the output key class for the final output i.e. from reducer
job.setOutputKeyClass(Text.class);
//Defining the output value class for the final output i.e. from reducer
job.setOutputValueClass(IntWritable.class);
//Defining input Format class which is responsible to parse the dataset into a key value pair
job.setInputFormatClass(TextInputFormat.class);
//Defining output Format class which is responsible to parse the final key-value output from MR framework to a text file into the hard disk
job.setOutputFormatClass(TextOutputFormat.class);
//setting the second argument as a path in a path variable
Path outputPath = new Path(args[1]);
//Configuring the input/output path from the filesystem into the job
FileInputFormat.addInputPath(job, new Path(args[0]));
FileOutputFormat.setOutputPath(job, new Path(args[1]));
//deleting the output path automatically from hdfs so that we don't have delete it explicitly
outputPath.getFileSystem(conf).delete(outputPath);
//exiting the job only if the flag value becomes false
System.exit(job.waitForCompletion(true) ? 0 : 1);
}
}
| [
"shradha.khard@gmail.com"
] | shradha.khard@gmail.com |
17757c425c9ff3328ff298b474132d0d7fd2d6f3 | 921f8267559292812401b713cbb3e945b0787e2f | /trackerv2/src/main/java/com/swift/tracker/trackerv2/api/StatusConfirmationsApi.java | 77b5d3a03e3df51ade56211ed17572bb63a9dad7 | [] | no_license | mdmollah/tracker-all | d1d69190587a88b4c5287bb44d35c6dfe7c26871 | ebcb46598805df648568cf22ad77ce97bca10dbc | refs/heads/master | 2020-04-08T23:53:31.758356 | 2018-11-30T16:43:54 | 2018-11-30T16:43:54 | 159,844,256 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 15,439 | java | /*
* gpi API
* Move your app forward with the gpi API
*/
package com.swift.tracker.trackerv2.api;
import com.swift.tracker.trackerv2.ApiCallback;
import com.swift.tracker.trackerv2.ApiClient;
import com.swift.tracker.trackerv2.ApiException;
import com.swift.tracker.trackerv2.ApiResponse;
import com.swift.tracker.trackerv2.Configuration;
import com.swift.tracker.trackerv2.Pair;
import com.swift.tracker.trackerv2.ProgressRequestBody;
import com.swift.tracker.trackerv2.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import com.swift.tracker.trackerv2.model.CamtA0100103;
import com.swift.tracker.trackerv2.model.CamtA0100202;
import com.swift.tracker.trackerv2.model.ErrorCode;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class StatusConfirmationsApi {
private ApiClient apiClient;
public StatusConfirmationsApi() {
this(Configuration.getDefaultApiClient());
}
public StatusConfirmationsApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Build call for statusConfirmationsPost
* @param laUApplicationID ID that identifies the application generationg the API and used by the gpi Connector to retrieve the related LAU keys (required)
* @param laUVersion version of the LAUSigned header. Mandatory. \"1.0\" for this first release (required)
* @param laUCallTime timestamp in UTC of the API call in the format YYYY-MM-DDTHH:MM:SS.sssZ (required)
* @param laURequestNonce a random value generated by the client. Provided with the request and copied by the gpi Connector on the response (required)
* @param laUSigned service specific HTTP headers (required)
* @param laUSignature contains the LAU signature, base64 encoded (required)
* @param signatureRequired a field indicating that a Signature is required (required)
* @param xApiKey An API key given to your application to authenticate against the sandbox URL (required)
* @param requestBody Status Confirmation Request (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call statusConfirmationsPostCall(String laUApplicationID, String laUVersion, String laUCallTime, String laURequestNonce, String laUSigned, String laUSignature, Boolean signatureRequired, String xApiKey, CamtA0100103 requestBody, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = requestBody;
// create path and map variables
String localVarPath = "/status_confirmations";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
if (laUApplicationID != null)
localVarHeaderParams.put("LAUApplicationID", apiClient.parameterToString(laUApplicationID));
if (laUVersion != null)
localVarHeaderParams.put("LAUVersion", apiClient.parameterToString(laUVersion));
if (laUCallTime != null)
localVarHeaderParams.put("LAUCallTime", apiClient.parameterToString(laUCallTime));
if (laURequestNonce != null)
localVarHeaderParams.put("LAURequestNonce", apiClient.parameterToString(laURequestNonce));
if (laUSigned != null)
localVarHeaderParams.put("LAUSigned", apiClient.parameterToString(laUSigned));
if (laUSignature != null)
localVarHeaderParams.put("LAUSignature", apiClient.parameterToString(laUSignature));
if (signatureRequired != null)
localVarHeaderParams.put("SignatureRequired", apiClient.parameterToString(signatureRequired));
if (xApiKey != null)
localVarHeaderParams.put("x-api-key", apiClient.parameterToString(xApiKey));
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call statusConfirmationsPostValidateBeforeCall(String laUApplicationID, String laUVersion, String laUCallTime, String laURequestNonce, String laUSigned, String laUSignature, Boolean signatureRequired, String xApiKey, CamtA0100103 requestBody, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'laUApplicationID' is set
if (laUApplicationID == null) {
throw new ApiException("Missing the required parameter 'laUApplicationID' when calling statusConfirmationsPost(Async)");
}
// verify the required parameter 'laUVersion' is set
if (laUVersion == null) {
throw new ApiException("Missing the required parameter 'laUVersion' when calling statusConfirmationsPost(Async)");
}
// verify the required parameter 'laUCallTime' is set
if (laUCallTime == null) {
throw new ApiException("Missing the required parameter 'laUCallTime' when calling statusConfirmationsPost(Async)");
}
// verify the required parameter 'laURequestNonce' is set
if (laURequestNonce == null) {
throw new ApiException("Missing the required parameter 'laURequestNonce' when calling statusConfirmationsPost(Async)");
}
// verify the required parameter 'laUSigned' is set
if (laUSigned == null) {
throw new ApiException("Missing the required parameter 'laUSigned' when calling statusConfirmationsPost(Async)");
}
// verify the required parameter 'laUSignature' is set
if (laUSignature == null) {
throw new ApiException("Missing the required parameter 'laUSignature' when calling statusConfirmationsPost(Async)");
}
// verify the required parameter 'signatureRequired' is set
if (signatureRequired == null) {
throw new ApiException("Missing the required parameter 'signatureRequired' when calling statusConfirmationsPost(Async)");
}
// verify the required parameter 'xApiKey' is set
if (xApiKey == null) {
throw new ApiException("Missing the required parameter 'xApiKey' when calling statusConfirmationsPost(Async)");
}
// verify the required parameter 'requestBody' is set
if (requestBody == null) {
throw new ApiException("Missing the required parameter 'requestBody' when calling statusConfirmationsPost(Async)");
}
com.squareup.okhttp.Call call = statusConfirmationsPostCall(laUApplicationID, laUVersion, laUCallTime, laURequestNonce, laUSigned, laUSignature, signatureRequired, xApiKey, requestBody, progressListener, progressRequestListener);
return call;
}
/**
* Status Confirmations
* This API is a status confirmation update to inform the tracker about the updated status of a given payment
* @param laUApplicationID ID that identifies the application generationg the API and used by the gpi Connector to retrieve the related LAU keys (required)
* @param laUVersion version of the LAUSigned header. Mandatory. \"1.0\" for this first release (required)
* @param laUCallTime timestamp in UTC of the API call in the format YYYY-MM-DDTHH:MM:SS.sssZ (required)
* @param laURequestNonce a random value generated by the client. Provided with the request and copied by the gpi Connector on the response (required)
* @param laUSigned service specific HTTP headers (required)
* @param laUSignature contains the LAU signature, base64 encoded (required)
* @param signatureRequired a field indicating that a Signature is required (required)
* @param xApiKey An API key given to your application to authenticate against the sandbox URL (required)
* @param requestBody Status Confirmation Request (required)
* @return CamtA0100202
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public CamtA0100202 statusConfirmationsPost(String laUApplicationID, String laUVersion, String laUCallTime, String laURequestNonce, String laUSigned, String laUSignature, Boolean signatureRequired, String xApiKey, CamtA0100103 requestBody) throws ApiException {
ApiResponse<CamtA0100202> resp = statusConfirmationsPostWithHttpInfo(laUApplicationID, laUVersion, laUCallTime, laURequestNonce, laUSigned, laUSignature, signatureRequired, xApiKey, requestBody);
return resp.getData();
}
/**
* Status Confirmations
* This API is a status confirmation update to inform the tracker about the updated status of a given payment
* @param laUApplicationID ID that identifies the application generationg the API and used by the gpi Connector to retrieve the related LAU keys (required)
* @param laUVersion version of the LAUSigned header. Mandatory. \"1.0\" for this first release (required)
* @param laUCallTime timestamp in UTC of the API call in the format YYYY-MM-DDTHH:MM:SS.sssZ (required)
* @param laURequestNonce a random value generated by the client. Provided with the request and copied by the gpi Connector on the response (required)
* @param laUSigned service specific HTTP headers (required)
* @param laUSignature contains the LAU signature, base64 encoded (required)
* @param signatureRequired a field indicating that a Signature is required (required)
* @param xApiKey An API key given to your application to authenticate against the sandbox URL (required)
* @param requestBody Status Confirmation Request (required)
* @return ApiResponse<CamtA0100202>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<CamtA0100202> statusConfirmationsPostWithHttpInfo(String laUApplicationID, String laUVersion, String laUCallTime, String laURequestNonce, String laUSigned, String laUSignature, Boolean signatureRequired, String xApiKey, CamtA0100103 requestBody) throws ApiException {
com.squareup.okhttp.Call call = statusConfirmationsPostValidateBeforeCall(laUApplicationID, laUVersion, laUCallTime, laURequestNonce, laUSigned, laUSignature, signatureRequired, xApiKey, requestBody, null, null);
Type localVarReturnType = new TypeToken<CamtA0100202>(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Status Confirmations (asynchronously)
* This API is a status confirmation update to inform the tracker about the updated status of a given payment
* @param laUApplicationID ID that identifies the application generationg the API and used by the gpi Connector to retrieve the related LAU keys (required)
* @param laUVersion version of the LAUSigned header. Mandatory. \"1.0\" for this first release (required)
* @param laUCallTime timestamp in UTC of the API call in the format YYYY-MM-DDTHH:MM:SS.sssZ (required)
* @param laURequestNonce a random value generated by the client. Provided with the request and copied by the gpi Connector on the response (required)
* @param laUSigned service specific HTTP headers (required)
* @param laUSignature contains the LAU signature, base64 encoded (required)
* @param signatureRequired a field indicating that a Signature is required (required)
* @param xApiKey An API key given to your application to authenticate against the sandbox URL (required)
* @param requestBody Status Confirmation Request (required)
* @param callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/
public com.squareup.okhttp.Call statusConfirmationsPostAsync(String laUApplicationID, String laUVersion, String laUCallTime, String laURequestNonce, String laUSigned, String laUSignature, Boolean signatureRequired, String xApiKey, CamtA0100103 requestBody, final ApiCallback<CamtA0100202> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = statusConfirmationsPostValidateBeforeCall(laUApplicationID, laUVersion, laUCallTime, laURequestNonce, laUSigned, laUSignature, signatureRequired, xApiKey, requestBody, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<CamtA0100202>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
}
| [
"mdmollah@gmail.com"
] | mdmollah@gmail.com |
51b86ad4cf20f02d4cbae0a5220c96232c97ae93 | 03513b58b6b98a89bba6223bd41626db147af254 | /src/l1j/server/server/model/item/function/ThunderWand.java | 8730adb7f207e38362a69f7605fd5b7033aa24e2 | [] | no_license | damageDown/ChoLong_KOR_Gamja_0805 | 9ea1ab6e3967fc95e546e163e8bd77f211696ad0 | 43261d5dde31b41a9852d19bfb3e09e7463793e6 | refs/heads/master | 2021-01-11T07:07:58.571241 | 2016-10-31T10:52:22 | 2016-10-31T10:52:22 | 72,427,743 | 0 | 2 | null | null | null | null | UHC | Java | false | false | 14,154 | java | /*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* http://www.gnu.org/copyleft/gpl.html
*/
package l1j.server.server.model.item.function;
import static l1j.server.server.model.skill.L1SkillId.ABSOLUTE_BARRIER;
import static l1j.server.server.model.skill.L1SkillId.COOKING_NEW_닭고기;
import static l1j.server.server.model.skill.L1SkillId.COOKING_NEW_연어;
import static l1j.server.server.model.skill.L1SkillId.COOKING_NEW_칠면조;
import static l1j.server.server.model.skill.L1SkillId.COOKING_NEW_한우;
import static l1j.server.server.model.skill.L1SkillId.COUNTER_MAGIC;
import static l1j.server.server.model.skill.L1SkillId.DRAGON_SKIN;
import static l1j.server.server.model.skill.L1SkillId.EARTH_BIND;
import static l1j.server.server.model.skill.L1SkillId.ERASE_MAGIC;
import static l1j.server.server.model.skill.L1SkillId.FEATHER_BUFF_A;
import static l1j.server.server.model.skill.L1SkillId.FEATHER_BUFF_B;
import static l1j.server.server.model.skill.L1SkillId.ICE_LANCE;
import static l1j.server.server.model.skill.L1SkillId.MOB_BASILL;
import static l1j.server.server.model.skill.L1SkillId.PATIENCE;
import static l1j.server.server.model.skill.L1SkillId.REDUCTION_ARMOR;
import static l1j.server.server.model.skill.L1SkillId.SPECIAL_COOKING;
import static l1j.server.server.model.skill.L1SkillId.SPECIAL_COOKING2;
import static l1j.server.server.model.skill.L1SkillId.STATUS_FREEZE;
import static l1j.server.server.model.skill.L1SkillId.메티스정성스프;
import static l1j.server.server.model.skill.L1SkillId.메티스정성요리;
import static l1j.server.server.model.skill.L1SkillId.메티스축복주문서;
import static l1j.server.server.model.skill.L1SkillId.싸이매콤한라면;
import static l1j.server.server.model.skill.L1SkillId.싸이시원한음료;
import java.util.Random;
import l1j.server.server.clientpackets.ClientBasePacket;
import l1j.server.server.model.Broadcaster;
import l1j.server.server.model.CharPosUtil;
import l1j.server.server.model.L1Character;
import l1j.server.server.model.L1ItemDelay;
import l1j.server.server.model.L1Object;
import l1j.server.server.model.L1PcInventory;
import l1j.server.server.model.L1PinkName;
import l1j.server.server.model.L1World;
import l1j.server.server.model.Instance.L1DollInstance;
import l1j.server.server.model.Instance.L1ItemInstance;
import l1j.server.server.model.Instance.L1MonsterInstance;
import l1j.server.server.model.Instance.L1NpcInstance;
import l1j.server.server.model.Instance.L1NpcShopInstance;
import l1j.server.server.model.Instance.L1PcInstance;
import l1j.server.server.model.skill.L1SkillId;
import l1j.server.server.serverpackets.S_ItemName;
import l1j.server.server.serverpackets.S_ServerMessage;
import l1j.server.server.serverpackets.S_SkillSound;
import l1j.server.server.serverpackets.S_UseAttackSkill;
import l1j.server.server.templates.L1EtcItem;
import l1j.server.server.templates.L1Item;
@SuppressWarnings("serial")
public class ThunderWand extends L1ItemInstance {
private static Random _random = new Random(System.nanoTime());
public ThunderWand(L1Item item) {
super(item);
}
@Override
public void clickItem(L1Character cha, ClientBasePacket packet) {
if (cha instanceof L1PcInstance) {
L1PcInstance pc = (L1PcInstance) cha;
if (pc.attacking)
return;
L1ItemInstance useItem = pc.getInventory().getItem(this.getId());
int spellsc_objid = 0;
int spellsc_x = 0;
int spellsc_y = 0;
spellsc_objid = packet.readD();
spellsc_x = packet.readH();
spellsc_y = packet.readH();
int delay_id = 0;
delay_id = ((L1EtcItem) useItem.getItem()).get_delayid();
if (delay_id != 0) { // 지연 설정 있어
if (pc.hasItemDelay(delay_id) == true) {
return;
}
}
if (pc.isInvisble()) {
pc.sendPackets(new S_ServerMessage(1003), true);
return;
}
L1Object target = L1World.getInstance().findObject(spellsc_objid);
pc.cancelAbsoluteBarrier();
int heding = CharPosUtil.targetDirection(pc, spellsc_x, spellsc_y);
pc.getMoveState().setHeading(heding);
if (target != null) {
doWandAction(pc, target);
} else {
pc.sendPackets(new S_UseAttackSkill(pc, 0, 10, spellsc_x,
spellsc_y, 17), true);
Broadcaster.broadcastPacket(pc, new S_UseAttackSkill(pc, 0, 10,
spellsc_x, spellsc_y, 17), true);
}
pc.플레이어상태 = pc.공격_상태;
pc.상태시간 = System.currentTimeMillis() + 2000;
pc.getInventory().updateItem(useItem, L1PcInventory.COL_COUNT);
L1ItemDelay.onItemUse(pc, useItem); // 아이템 지연 개시
pc.getInventory().removeItem(useItem, 1);
/** 2011.07.01 고정수 수량성 아이템 미확인으로 되는 문제 */
if (useItem.isIdentified()) {
useItem.setIdentified(true);
pc.sendPackets(new S_ItemName(useItem), true);
}
}
}
private void doWandAction(L1PcInstance user, L1Object target) {
if (!(target instanceof L1Character)) {
return;
}
if (CharPosUtil.isAreaAttack(user, target.getX(), target.getY(),
target.getMapId()) == false) {
return; // 직선상에 장애물이 있다
}
if (CharPosUtil.isAreaAttack((L1Character) target, user.getX(),
user.getY(), user.getMapId()) == false) {
return; // 직선상에 장애물이 있다
}
// XXX 적당한 데미지 계산, 요점 수정
int dmg = ((_random.nextInt(5) + 1) + user.getAbility().getTotalStr() / 4);
dmg = Math.max(17, dmg);
if (target instanceof L1PcInstance) {
L1PcInstance pc = (L1PcInstance) target;
/*
* if (user.getId() == target.getId()) { return; // 자기 자신에게 맞혔다 }
*/
if (CharPosUtil.getZoneType(pc) == 1
|| user.checkNonPvP(user, pc)
|| CharPosUtil.getZoneType(user) == 1
|| (pc.getSkillEffectTimerSet().hasSkillEffect(
SPECIAL_COOKING) && pc.getSkillEffectTimerSet()
.hasSkillEffect(SPECIAL_COOKING2))) { // 스페셜요리에 의한
// 데미지 경감) {
if (!pc.isGmInvis() && pc.isInvisble()) {
pc.delInvis();
}
// user.sendPackets(new S_AttackPacket(user, pc.getId(),
// ActionCodes.ACTION_Wand));
// Broadcaster.broadcastPacket(user, new S_AttackPacket(user,
// pc.getId(), ActionCodes.ACTION_Wand));
user.sendPackets(
new S_UseAttackSkill(user, pc.getId(), 10, pc.getX(),
pc.getY(), 17, 0), true);
Broadcaster.broadcastPacket(user,
new S_UseAttackSkill(user, pc.getId(), 10, pc.getX(),
pc.getY(), 17, 0), true);
L1PinkName.onAction(pc, user);
return;
}
if (pc.getSkillEffectTimerSet().hasSkillEffect(
L1SkillId.FOG_OF_SLEEPING))
pc.getSkillEffectTimerSet().removeSkillEffect(
L1SkillId.FOG_OF_SLEEPING);
if (isFreeze(pc) || isUseCounterMagic(pc)) {
// user.sendPackets(new S_AttackPacket(user, pc.getId(),
// ActionCodes.ACTION_Wand));
// Broadcaster.broadcastPacket(user, new S_AttackPacket(user,
// pc.getId(), ActionCodes.ACTION_Wand));
user.sendPackets(
new S_UseAttackSkill(user, pc.getId(), 10, pc.getX(),
pc.getY(), 17, 0), true);
Broadcaster.broadcastPacket(user,
new S_UseAttackSkill(user, pc.getId(), 10, pc.getX(),
pc.getY(), 17, 0), true);
L1PinkName.onAction(pc, user);
return;
}
if (pc.getSkillEffectTimerSet().hasSkillEffect(ERASE_MAGIC))
pc.getSkillEffectTimerSet().removeSkillEffect(ERASE_MAGIC);
L1PinkName.onAction(pc, user);
int 리덕 = 리덕(pc);
if (리덕 > 100) {
user.sendPackets(
new S_UseAttackSkill(user, pc.getId(), 10, pc.getX(),
pc.getY(), 17, 0), true);
Broadcaster.broadcastPacket(user,
new S_UseAttackSkill(user, pc.getId(), 10, pc.getX(),
pc.getY(), 17, 0), true);
return;
}
user.sendPackets(
new S_UseAttackSkill(user, pc.getId(), 10, pc.getX(), pc
.getY(), 17), true);
Broadcaster.broadcastPacket(
user,
new S_UseAttackSkill(user, pc.getId(), 10, pc.getX(), pc
.getY(), 17), true);
int newHp = pc.getCurrentHp() - dmg;
if (newHp > 0) {
if (!pc.isGmInvis() && pc.isInvisble()) {
pc.delInvis();
}
// pc.sendPackets(new S_AttackPacket(pc, 0,
// ActionCodes.ACTION_Damage));
// Broadcaster.broadcastPacket(pc, new S_AttackPacket(pc, 0,
// ActionCodes.ACTION_Damage));
pc.setCurrentHp(newHp);
} else if (newHp <= 0 && pc.isGm()) {
pc.setCurrentHp(pc.getMaxHp());
} else if (newHp <= 0 && !pc.isGm()) {
pc.death(user);
}
} else if (target instanceof L1MonsterInstance) {
L1MonsterInstance mob = (L1MonsterInstance) target;
user.sendPackets(
new S_UseAttackSkill(user, mob.getId(), 10, mob.getX(), mob
.getY(), 17), true);
Broadcaster.broadcastPacket(
user,
new S_UseAttackSkill(user, mob.getId(), 10, mob.getX(), mob
.getY(), 17), true);
// Broadcaster.broadcastPacket(mob, new S_AttackPacketForNpc(user,
// mob.getId(), 2));
mob.receiveDamage(user, dmg);
} else if (target instanceof L1NpcInstance) {
L1NpcInstance npc = (L1NpcInstance) target;
if (npc instanceof L1NpcShopInstance) {
L1NpcShopInstance pc = (L1NpcShopInstance) npc;
if (CharPosUtil.getZoneType(pc) == 1
|| user.checkNonPvP(user, pc)
|| CharPosUtil.getZoneType(user) == 1) {
user.sendPackets(new S_UseAttackSkill(user, pc.getId(), 10,
pc.getX(), pc.getY(), 17, 0), true);
Broadcaster.broadcastPacket(user, new S_UseAttackSkill(
user, pc.getId(), 10, pc.getX(), pc.getY(), 17, 0),
true);
return;
}
}
user.sendPackets(
new S_UseAttackSkill(user, npc.getId(), 10, npc.getX(), npc
.getY(), 17), true);
Broadcaster.broadcastPacket(
user,
new S_UseAttackSkill(user, npc.getId(), 10, npc.getX(), npc
.getY(), 17), true);
// Broadcaster.broadcastPacket(npc, new S_DoActionGFX(npc.getId(),
// ActionCodes.ACTION_Damage));
}
}
private boolean isUseCounterMagic(L1Character cha) {
if (cha.getSkillEffectTimerSet().hasSkillEffect(COUNTER_MAGIC)) {
cha.getSkillEffectTimerSet().removeSkillEffect(COUNTER_MAGIC);
Broadcaster.broadcastPacket(cha, new S_SkillSound(cha.getId(),
10702), true);
if (cha instanceof L1PcInstance) {
L1PcInstance pc = (L1PcInstance) cha;
pc.sendPackets(new S_SkillSound(pc.getId(), 10702), true);
}
return true;
}
return false;
}
public boolean isFreeze(L1PcInstance pc) {
if (pc.getSkillEffectTimerSet().hasSkillEffect(STATUS_FREEZE)
|| pc.getSkillEffectTimerSet().hasSkillEffect(ABSOLUTE_BARRIER)
|| pc.getSkillEffectTimerSet().hasSkillEffect(ICE_LANCE)
|| pc.getSkillEffectTimerSet().hasSkillEffect(EARTH_BIND)
|| pc.getSkillEffectTimerSet().hasSkillEffect(
L1SkillId.STATUS_안전모드)
|| pc.getSkillEffectTimerSet().hasSkillEffect(MOB_BASILL)) {
return true;
}
return false;
}
private int 리덕(L1PcInstance pc) {
// TODO 자동 생성된 메소드 스텁
int 리덕 = 0;
/** 마법인형 돌골램 **/
if (pc.getDollList().size() > 0) {
for (L1DollInstance doll : pc.getDollList()) {
리덕 += doll.getDamageReductionByDoll();
}
}
리덕 += pc.getDamageReductionByArmor(); // 방어용 기구에 의한 데미지 경감
if (pc.getSkillEffectTimerSet().hasSkillEffect(SPECIAL_COOKING)) { // 스페셜요리에
// 의한
// 데미지
// 경감
리덕 += 5;
}
if (pc.getSkillEffectTimerSet().hasSkillEffect(SPECIAL_COOKING2)) {
리덕 += 5;
}
if (pc.getSkillEffectTimerSet().hasSkillEffect(COOKING_NEW_닭고기)
|| pc.getSkillEffectTimerSet().hasSkillEffect(COOKING_NEW_연어)
|| pc.getSkillEffectTimerSet().hasSkillEffect(COOKING_NEW_칠면조)
|| pc.getSkillEffectTimerSet().hasSkillEffect(COOKING_NEW_한우)) {
리덕 += 2;
}
if (pc.getSkillEffectTimerSet().hasSkillEffect(메티스정성스프)
|| pc.getSkillEffectTimerSet().hasSkillEffect(싸이시원한음료))
리덕 += 5;
if (pc.getSkillEffectTimerSet().hasSkillEffect(메티스정성요리)
|| pc.getSkillEffectTimerSet().hasSkillEffect(싸이매콤한라면))
리덕 += 5;
if (pc.getSkillEffectTimerSet().hasSkillEffect(메티스축복주문서)
|| pc.getSkillEffectTimerSet().hasSkillEffect(L1SkillId.흑사의기운))
리덕 += 3;
// 키링크 아닐때만 추가
if (pc.getSkillEffectTimerSet().hasSkillEffect(REDUCTION_ARMOR)) {
int targetPcLvl = pc.getLevel();
if (targetPcLvl < 50) {
targetPcLvl = 50;
}
int dmg2 = (targetPcLvl - 40) / 3 - 3;
리덕 += dmg2 > 0 ? dmg2 : 0;// +1
}
L1ItemInstance 반역자의방패 = pc.getInventory().checkEquippedItem(21093);
if (반역자의방패 != null) {
int chance = 반역자의방패.getEnchantLevel() * 2;
if (_random.nextInt(100) <= chance) {
리덕 += 50;
pc.sendPackets(new S_SkillSound(pc.getId(), 6320));
Broadcaster.broadcastPacket(pc, new S_SkillSound(pc.getId(),
6320));
}
}
if (pc.getSkillEffectTimerSet().hasSkillEffect(DRAGON_SKIN)) {
리덕 += 5;
}
if (pc.getSkillEffectTimerSet().hasSkillEffect(PATIENCE)) {
리덕 += 2;
}
if (pc.getSkillEffectTimerSet().hasSkillEffect(FEATHER_BUFF_A)) {
리덕 += 3;
}
if (pc.getSkillEffectTimerSet().hasSkillEffect(FEATHER_BUFF_B)) {
리덕 += 2;
}
if (pc.isAmorGaurd) { // 아머가드에의한 데미지감소
int d = pc.getAC().getAc() / 10;
if (d < 0) {
리덕 -= d;
} else {
리덕 += d;
}
}
return 리덕;
}
}
| [
"noorygo@gmail.com"
] | noorygo@gmail.com |
af8fc28f60b64f171b41682dfdff5082b9b42e61 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/25/25_bdfc59b03322f9da7a129473bdbb9955b0315aa6/Marks/25_bdfc59b03322f9da7a129473bdbb9955b0315aa6_Marks_t.java | 294e4ad7dd21e078cbdd2e930b3b568f1ffda469 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 1,669 | java | package com.gpa.calculator.models;
import android.app.Application;
import android.content.Context;
import com.gpa.calculator.utility.DBConnect;
public class Marks extends Application {
private Context _context;
private int _courseId;
private String _testName;
private float _scoredMarks;
private float _fromTotal;
private float _totalWeight;
public int get_courseId() {
return _courseId;
}
public void set_courseId(int _courseId) {
this._courseId = _courseId;
}
public String get_testName() {
return _testName;
}
public void set_testName(String _testName) {
this._testName = _testName;
}
public float get_scoredMarks() {
return _scoredMarks;
}
public void set_ScoredMarks(float _scoredMarks) {
this._scoredMarks = _scoredMarks;
}
public float get_fromTotal() {
return _fromTotal;
}
public void set_fromTotal(float _fromTotal) {
this._fromTotal = _fromTotal;
}
public float get_totalWeight() {
return _totalWeight;
}
public void set_totalWeight(float _totalWeight) {
this._totalWeight = _totalWeight;
}
public Marks(Context c)
{
this._context = c;
}
public long insertMarks()
{
DBConnect dba = new DBConnect(_context);
dba.open();
//Code to insert values to Marks table
long ret = dba.insertMarks(_courseId, _testName, _scoredMarks, _fromTotal, _totalWeight);
dba.close();
return ret;
}
public String getMarks()
{
DBConnect dba = new DBConnect(getApplicationContext());
dba.open();
//Code to insert values to Marks table
String result = dba.getTotalMarks();
dba.close();
return result;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
2f3ad0ba46d187e849eda8c9328ae627526a6f80 | 26fe854d2ccb7058b8d5dc6d4783d70a05ebed86 | /src/main/java/com/zhuang/domain/User.java | 6aeb31bf11b4baadcd03a8ed7573c2183db4be67 | [] | no_license | www805/shiro | 42da17d665c4b6410abc31fa975cf3c44212ebbd | 5e07a24f1172455eb9701a58388713678b7d8291 | refs/heads/master | 2022-02-20T12:16:14.948975 | 2019-07-27T10:33:09 | 2019-07-27T10:33:09 | 178,919,135 | 0 | 0 | null | 2022-02-09T22:13:05 | 2019-04-01T18:04:21 | Java | UTF-8 | Java | false | false | 952 | java | package com.zhuang.domain;
public class User {
private Integer id;
private String name;
private String address;
private String perms;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getPerms() {
return perms;
}
public void setPerms(String perms) {
this.perms = perms;
}
@Override
public String toString() {
return "User{" +
"id=" + id +
", name='" + name + '\'' +
", address='" + address + '\'' +
", perms='" + perms + '\'' +
'}';
}
}
| [
"zjl@qq.com"
] | zjl@qq.com |
e794b164ef40e0ec11743f268c98e59caead62d0 | 045f437b725e292a81cf4ba5e9ff016fb62306f2 | /SearchInRotatedSortedArray.java | e380b1fcc346447f5e2a417292bec3a85a4256b8 | [] | no_license | saturntoad/leetcode | 4954f56f219422b2a94e562d308f2cd7d57af950 | fb11b7d476b96a9228c1411d8f15be1c3d283910 | refs/heads/master | 2016-09-07T19:13:26.393903 | 2013-06-18T17:22:28 | 2013-06-18T17:22:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,122 | java | public class Solution {
public int search(int[] A, int target) {
// Start typing your Java solution below
// DO NOT write main() function
return binSearch(A, 0, A.length, target);
}
private int binSearch(int[] A, int begin, int end, int target) {
if (end - begin < 1)
return -1;
if (end - begin == 1) {
if (A[begin] == target)
return begin;
return -1;
}
int middle = (end - begin) / 2 + begin;
if (A[begin] == A[middle - 1]) {
if (A[begin] == target)
return begin;
return binSearch(A, middle, end, target);
}
if (A[begin] < A[middle - 1]) {
if (A[begin] > target || A[middle - 1] < target)
return binSearch(A, middle, end, target);
return binSearch(A, begin, middle, target);
}
else {
if (A[begin] > target && A[middle - 1] < target)
return binSearch(A, middle, end, target);
return binSearch(A, begin, middle, target);
}
}
} | [
"yz2498@columbia.edu"
] | yz2498@columbia.edu |
bcf25bec337e277140aac449c9e1db3f9f462975 | 2239b55460889789513413b0880970646d719762 | /oa/src/com/oa/bean/ProcessRoleUserExample.java | e48d236fd24b1cd517a062ef3c4a69f769075991 | [] | no_license | kcsxyz/oa | 99080ff0ea7c1256eecf87688a78eb93466caf5d | 75101d186273869a848c10e87b257c728d1bc1bf | refs/heads/master | 2020-05-30T17:20:08.907251 | 2019-06-03T02:34:56 | 2019-06-03T02:34:56 | 188,569,203 | 0 | 0 | null | 2019-06-02T11:21:25 | 2019-05-25T13:24:30 | Java | UTF-8 | Java | false | false | 12,528 | java | package com.oa.bean;
import java.util.ArrayList;
import java.util.List;
public class ProcessRoleUserExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public ProcessRoleUserExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andProcessRoleNameIsNull() {
addCriterion("process_role_name is null");
return (Criteria) this;
}
public Criteria andProcessRoleNameIsNotNull() {
addCriterion("process_role_name is not null");
return (Criteria) this;
}
public Criteria andProcessRoleNameEqualTo(String value) {
addCriterion("process_role_name =", value, "processRoleName");
return (Criteria) this;
}
public Criteria andProcessRoleNameNotEqualTo(String value) {
addCriterion("process_role_name <>", value, "processRoleName");
return (Criteria) this;
}
public Criteria andProcessRoleNameGreaterThan(String value) {
addCriterion("process_role_name >", value, "processRoleName");
return (Criteria) this;
}
public Criteria andProcessRoleNameGreaterThanOrEqualTo(String value) {
addCriterion("process_role_name >=", value, "processRoleName");
return (Criteria) this;
}
public Criteria andProcessRoleNameLessThan(String value) {
addCriterion("process_role_name <", value, "processRoleName");
return (Criteria) this;
}
public Criteria andProcessRoleNameLessThanOrEqualTo(String value) {
addCriterion("process_role_name <=", value, "processRoleName");
return (Criteria) this;
}
public Criteria andProcessRoleNameLike(String value) {
addCriterion("process_role_name like", value, "processRoleName");
return (Criteria) this;
}
public Criteria andProcessRoleNameNotLike(String value) {
addCriterion("process_role_name not like", value, "processRoleName");
return (Criteria) this;
}
public Criteria andProcessRoleNameIn(List<String> values) {
addCriterion("process_role_name in", values, "processRoleName");
return (Criteria) this;
}
public Criteria andProcessRoleNameNotIn(List<String> values) {
addCriterion("process_role_name not in", values, "processRoleName");
return (Criteria) this;
}
public Criteria andProcessRoleNameBetween(String value1, String value2) {
addCriterion("process_role_name between", value1, value2, "processRoleName");
return (Criteria) this;
}
public Criteria andProcessRoleNameNotBetween(String value1, String value2) {
addCriterion("process_role_name not between", value1, value2, "processRoleName");
return (Criteria) this;
}
public Criteria andUserIdIsNull() {
addCriterion("user_id is null");
return (Criteria) this;
}
public Criteria andUserIdIsNotNull() {
addCriterion("user_id is not null");
return (Criteria) this;
}
public Criteria andUserIdEqualTo(String value) {
addCriterion("user_id =", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotEqualTo(String value) {
addCriterion("user_id <>", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThan(String value) {
addCriterion("user_id >", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThanOrEqualTo(String value) {
addCriterion("user_id >=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThan(String value) {
addCriterion("user_id <", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThanOrEqualTo(String value) {
addCriterion("user_id <=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLike(String value) {
addCriterion("user_id like", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotLike(String value) {
addCriterion("user_id not like", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdIn(List<String> values) {
addCriterion("user_id in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotIn(List<String> values) {
addCriterion("user_id not in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdBetween(String value1, String value2) {
addCriterion("user_id between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotBetween(String value1, String value2) {
addCriterion("user_id not between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andDeptIdIsNull() {
addCriterion("dept_id is null");
return (Criteria) this;
}
public Criteria andDeptIdIsNotNull() {
addCriterion("dept_id is not null");
return (Criteria) this;
}
public Criteria andDeptIdEqualTo(Integer value) {
addCriterion("dept_id =", value, "deptId");
return (Criteria) this;
}
public Criteria andDeptIdNotEqualTo(Integer value) {
addCriterion("dept_id <>", value, "deptId");
return (Criteria) this;
}
public Criteria andDeptIdGreaterThan(Integer value) {
addCriterion("dept_id >", value, "deptId");
return (Criteria) this;
}
public Criteria andDeptIdGreaterThanOrEqualTo(Integer value) {
addCriterion("dept_id >=", value, "deptId");
return (Criteria) this;
}
public Criteria andDeptIdLessThan(Integer value) {
addCriterion("dept_id <", value, "deptId");
return (Criteria) this;
}
public Criteria andDeptIdLessThanOrEqualTo(Integer value) {
addCriterion("dept_id <=", value, "deptId");
return (Criteria) this;
}
public Criteria andDeptIdIn(List<Integer> values) {
addCriterion("dept_id in", values, "deptId");
return (Criteria) this;
}
public Criteria andDeptIdNotIn(List<Integer> values) {
addCriterion("dept_id not in", values, "deptId");
return (Criteria) this;
}
public Criteria andDeptIdBetween(Integer value1, Integer value2) {
addCriterion("dept_id between", value1, value2, "deptId");
return (Criteria) this;
}
public Criteria andDeptIdNotBetween(Integer value1, Integer value2) {
addCriterion("dept_id not between", value1, value2, "deptId");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
} | [
"34733071+pengyujie@users.noreply.github.com"
] | 34733071+pengyujie@users.noreply.github.com |
514f5186a37c9cabf5f502c01e38b5fda73155dc | 8f7534e49d7843214cbf370e313fc49438ec2cce | /rest-api-demo/src/main/java/com/rodionbykov/demo/controllers/BookController.java | edbfebb981ac1935b5a136c85cafa3a32c908544 | [] | no_license | rodionbykov/java-minute | be05a0730cfc3a64493b0d3a021dd68da93aa43e | c3395b6f5245e29246db2c93439e124089e69e2f | refs/heads/master | 2023-04-27T17:59:34.171384 | 2022-12-16T09:55:56 | 2022-12-16T09:55:56 | 19,083,020 | 0 | 5 | null | 2023-04-17T17:35:12 | 2014-04-23T19:39:14 | Java | UTF-8 | Java | false | false | 598 | java | package com.rodionbykov.demo.controllers;
import com.rodionbykov.demo.model.Book;
import com.rodionbykov.demo.model.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
@RestController
public class BookController {
@Autowired
private BookService bookService;
@GetMapping("/books")
public ArrayList<Book> getBooks(){
ArrayList<Book> result = bookService.getAll();
return result;
}
}
| [
"rodionbykov@gmail.com"
] | rodionbykov@gmail.com |
0c203ec3f8c4fc4f1fbc654a5812aac3c2193d71 | d9a6ceaaeb3f6d2c8c2499ef68732475046868ca | /JavaPractice/src/org/dimigo/thread/ServerThread4.java | d90edb9c24d60c8e2319d051fee9ea1512b1c753 | [] | no_license | wp132425/JavaPractice | 8be5ed2c9f0242aa8be3b0802cf26315270b4d4f | 861636b5df29459a4377ee47939951104a8f1ab6 | refs/heads/master | 2021-01-10T21:07:13.798060 | 2015-11-13T09:30:54 | 2015-11-13T09:30:54 | 32,291,338 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,343 | java | package org.dimigo.thread;
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.Socket;
/**
* <pre>
* org.dimigo.thread
* |_ ServerThread4
*
* 1. 개요 :
* 2. 작성일 : 2015. 10. 29.
* </pre>
*
* @author : 이름
* @version : 1.0
*/
public class ServerThread4 implements Runnable {
// 클라이언트와의 통신을 위한 소켓
private Socket connectionSocket;
private final static String DEFAULT_FILE_NAME = "index.html";
private final static String NEWLINE = System.getProperty("line.separator");
public ServerThread4(Socket connectionSocket) {
this.connectionSocket = connectionSocket;
}
@Override
public void run() {
System.out.println(Thread.currentThread().getName() + " thread start");
// 클라이언트와 통신을 위한 입/출력 스트림을 생성한다.
// DataOutputStream은 자바의 기본 자료형 데이터를 바이트 스트림으로 입출력하는 기능을 제공한다.
try(BufferedReader in = new BufferedReader(
new InputStreamReader(connectionSocket.getInputStream()));
DataOutputStream out = new DataOutputStream(connectionSocket.getOutputStream())) {
// 클라이언트로의 메시지중 첫번째 줄을 읽어들인다.
String request = in.readLine();
System.out.println("request message : " + request);
// 파일명 얻기
String[] requestArr = request.split(" ");
String fileName = "";
if(requestArr[1].equals("/")) {
fileName = DEFAULT_FILE_NAME;
} else {
fileName += requestArr[1].substring(1);
}
System.out.println("file name : " + fileName);
// 파일 입력 스트림 생성
File file = new File("org/dimigo/thread/" + fileName);
// 해당 파일이 존재하는 경우
if(file.exists()) {
byte[] bytes = new byte[(int)file.length()];
/********************************************
* 바이트기반 스트림을 생성하여 파일에서 읽어 byte[]에 담기
********************************************/
try(BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file))){
bis.read(bytes);
}
// 정상적으로 처리가 되었음을 나타내는 200 코드를 출력한다.
out.writeBytes("HTTP/1.1 200" + NEWLINE);
out.writeBytes("Content-type: " + contentType(fileName) + NEWLINE);
out.writeBytes("Content-length: ");
out.writeInt(bytes.length);
out.writeBytes(NEWLINE);
// Send a blank line to indicate the end of the header lines.
out.writeBytes(NEWLINE);
out.write(bytes, 0, (int)file.length());
} else {
// 상태 코드 404 : Not Found
out.writeBytes("HTTP/1.1 404" + NEWLINE);
out.writeBytes("Content-type: text/html" + NEWLINE);
String response = "<html><head><title>My Web Server</title></head>" +
"<body><h1>" + fileName + " File Not Found</h1></body></html>";
out.writeBytes("Content-length: ");
out.writeInt(response.length());
out.writeBytes(NEWLINE);
// header부의 끝을 알리기 위해 한줄 띄기
out.writeBytes(NEWLINE);
out.write(response.getBytes(), 0, response.getBytes().length);
}
out.flush();
} catch(Exception e) {
e.printStackTrace();
} finally {
try {
connectionSocket.close();
} catch (IOException e) {
e.printStackTrace();
}
System.out.println(Thread.currentThread().getName() + " thread close");
}
}
private static String contentType(String fileName) {
if(fileName.endsWith(".htm") || fileName.endsWith(".html")) {
return "text/html";
} else if(fileName.endsWith(".jpeg") || fileName.endsWith(".jpg")) {
return "image/jpeg";
} else if(fileName.endsWith(".gif")) {
return "image/gif";
} else if(fileName.endsWith(".png")) {
return "image/png";
}
return "application/octet-stream";
}
}
| [
"user'@user-PC"
] | user'@user-PC |
b4c0ae69c449af12d4f900ee9965a0af4f7833f2 | 61bb049cd6b33201be1678f1125d70d4ae6d7efd | /app/src/main/java/com/cniao5/cniao5dagger2/SubComponetAcivity.java | 6ffbe026d70e6e6ccefd4c7ff1a346ba5cb8bf7b | [
"Apache-2.0"
] | permissive | KevenT/Cniao5Dagger2 | 6cb089168ad5cb187043330a7381d138a5337fb0 | bf378893a551d55cb48b6a769d42005e52cc27e7 | refs/heads/master | 2020-05-29T23:38:25.829789 | 2018-12-23T14:38:51 | 2018-12-23T14:38:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 113 | java | package com.cniao5.cniao5dagger2;
/**
* Created by Ivan on 2016/12/7.
*/
public class SubComponetAcivity {
}
| [
"723618372@qq.com"
] | 723618372@qq.com |
1b382976edb7d00c19cd615f9694c1f32f86855e | bc449001b8cf941f66928af145446156d2fdf4f6 | /src/test/java/com/mycode/SpringrestApplicationTests.java | f88d234f27457abd71d2481aff2cc69c78c43a42 | [] | no_license | sabya-gupta/springRestAndMicroServices | 67ca8dcc1767478264f226b5abd75629f8bf7037 | 394005d3d08de04d1884bb63ae60489758841484 | refs/heads/master | 2020-04-10T08:22:08.212313 | 2018-12-08T14:22:51 | 2018-12-08T14:22:51 | 160,904,267 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 331 | java | package com.mycode;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class SpringrestApplicationTests {
@Test
public void contextLoads() {
}
}
| [
"sabya.gupta@yahoo.com"
] | sabya.gupta@yahoo.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.