blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 7
332
| content_id
stringlengths 40
40
| detected_licenses
listlengths 0
50
| license_type
stringclasses 2
values | repo_name
stringlengths 7
115
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringclasses 557
values | visit_date
timestamp[us] | revision_date
timestamp[us] | committer_date
timestamp[us] | github_id
int64 5.85k
684M
⌀ | star_events_count
int64 0
77.7k
| fork_events_count
int64 0
48k
| gha_license_id
stringclasses 17
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 82
values | src_encoding
stringclasses 28
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 7
5.41M
| extension
stringclasses 11
values | content
stringlengths 7
5.41M
| authors
listlengths 1
1
| author
stringlengths 0
161
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0f905a6ea6dc2fad70db83a6945156b8e0161fda | 3fe2a55a43fc4a960e9fdcd787e69b3862f335eb | /parser/IdentifierNode.java | f0f3425e72917c56347185e74d17c3800dd05d8e | []
| no_license | EnisKovacevic/assign05_team3EK | 5d2d2d7b7050946505bc927b2dde9c08baeff694 | 00cc86fb231d8fdf972b987f9fad0ac9e9922875 | refs/heads/main | 2023-01-03T15:56:48.795039 | 2020-11-04T01:27:39 | 2020-11-04T01:27:39 | 309,847,128 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 469 | java | package assign4.parser;
import assign4.lexer.*;
import assign4.visitor.*;
public class IdentifierNode extends Node {
public String id;
public Word w;
public IdentifierNode(){
}
public IdentifierNode(Word w){
this.id = w.lexeme;
this.w = w;
}
public void accept(ASTVisitor v){
v.visit(this);
}
void printNode(){
System.out.println("IdentifierNode: " + id);
}
}
| [
"[email protected]"
]
| |
95844579e5748830d95f4c1c4bc493300f4b1692 | b8e70dce7026c24106ba39c51249b2ed06ff5d5e | /src/main/java/org/pflb/vault/model/CourseDTO.java | 919aa418b7fec6ed63860d017b83337dcae0ee65 | []
| no_license | Takca/courseSystem | 5ec2408a6bb2c5e9b48e8c43b79fc3d0118ec041 | 27c81a1fbdd8ecbf088eef9de7a31fe81de114c6 | refs/heads/master | 2020-04-02T01:57:52.050483 | 2018-10-20T07:13:05 | 2018-10-20T07:13:05 | 153,884,217 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 355 | java | package org.pflb.vault.model;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
@Getter
@Setter
public class CourseDTO implements Serializable {
private Long id;
private String name;
private Integer numOfDays;
private Set<StudentMarkDTO> marks = new HashSet<>();
}
| [
"[email protected]"
]
| |
0825c242d0a3c7f3ef8232f6391a578daf535500 | 094642ba71e1bc701c7725ce1b4d836efadac0c1 | /yunpukeji/src/main/java/com/zhiluo/android/yunpu/goods/consume/bean/IntegralScalingBean.java | 37b9688682cdf81df4ffd5781634af521d5f1c77 | []
| no_license | czq080/Trunk | 80a521bab8c6cc8482b55a291a79e8be634ae1d6 | dcfcb5d6be83a87620c74d4092455bf844ff99d7 | refs/heads/master | 2023-03-17T20:01:14.790638 | 2020-03-25T06:26:10 | 2020-03-25T06:26:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 417 | java | package com.zhiluo.android.yunpu.goods.consume.bean;
import java.io.Serializable;
/**
* 积分比例
* 作者:罗咏哲 on 2017/12/23 16:34.
* 邮箱:[email protected]
*/
public class IntegralScalingBean implements Serializable{
private double scaling;
public double getScaling() {
return scaling;
}
public void setScaling(double scaling) {
this.scaling = scaling;
}
}
| [
"[email protected]"
]
| |
65cc5da6cc565f6c08deadb983683e6aa4997f88 | ca81d32f842d3abce208ed4459dfa4d10aff71e6 | /app/src/main/java/com/example/javaproject/NoteActivities/NotesActivity.java | 791f07d3bf00314795ec8adeae93a1b99744a4d0 | []
| no_license | JMCreative97/AndriodVaultApp | b261d1a4fd4f7aec7c993fa7a0fe4d436cfbe1e5 | e5aa0573922ec129ba1e30d5a8e1349cb323cab9 | refs/heads/master | 2022-11-26T15:55:31.768879 | 2020-08-04T11:55:50 | 2020-08-04T11:55:50 | 284,963,295 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,750 | java | package com.example.javaproject.NoteActivities;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;
import android.widget.SearchView;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.example.javaproject.Authentication.LoginActivity;
import com.example.javaproject.Misc.EncryptionManger;
import com.example.javaproject.Misc.SharedPreferencesManager;
import com.example.javaproject.R;
import com.google.firebase.auth.FirebaseAuth;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.attribute.BasicFileAttributes;
import java.nio.file.attribute.FileTime;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
public class NotesActivity extends AppCompatActivity {
private ImageView addNote;
private RecyclerView mRecyclerView;
private NoteAdapter mAdapter;
private List<NoteModel> mNotes;
private SharedPreferencesManager mSharedPreferencesManager;
private EncryptionManger mEncryptionManager;
private String CURRENT_NOTE_PATH;
private SearchView searchNotes;
@Override
public void onBackPressed() {
super.onBackPressed();
finish();
}
@Override
protected void onResume() {
super.onResume();
try {
System.out.println("Resumed");
LoadData();
} catch (IOException e) {
e.printStackTrace();
}
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_notes);
Toolbar toolbar = findViewById(R.id.toolbar_notes);
toolbar.setTitle("Notes");
setSupportActionBar(toolbar);
toolbar.setNavigationIcon(R.drawable.ic_arrow_back);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
mSharedPreferencesManager = new SharedPreferencesManager(this);
mEncryptionManager = new EncryptionManger(this);
//Generate Dir folder
if (!mSharedPreferencesManager.getBoolPref("notesDirFolderGenerated")) {
File dir = new File(getFilesDir(), "eNotes");
dir.mkdirs();
mSharedPreferencesManager.setBoolPref("folderGenerated", true);
}
//Generate Credentials folder
if (!mSharedPreferencesManager.getBoolPref("credentialsFolderGenerated")) {
File dir = new File(getFilesDir(), "credentials");
dir.mkdirs();
mSharedPreferencesManager.setBoolPref("credentialsFolderGenerated", true);
}
GenerateFolder();
InitializeLayout();
searchNotes.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(String query) {
return false;
}
@Override
public boolean onQueryTextChange(String s) {
if (!TextUtils.isEmpty(s)) {
try {
UpdateAdapter(s, s.length());
} catch (IOException e) {
e.printStackTrace();
}
} else {
try {
LoadData();
} catch (IOException e) {
e.printStackTrace();
}
}
return false;
}
});
try {
LoadData();
} catch (IOException e) {
e.printStackTrace();
}
}
private void GenerateFolder() {
File file = new File(getFilesDir() + "/eNotes");
if (!file.isDirectory()) {
file.mkdirs();
}
}
private void UpdateAdapter(String s, int character) throws IOException {
mNotes.clear();
File dir = new File(getFilesDir() + "/eNotes");
if (dir.exists()) {
File[] files = dir.listFiles();
Arrays.sort(files, Comparator.comparingLong(File::lastModified));
for (File file : files) {
String[] split = file.getName().split("[.]");
if (split[0].contains(s)) loadNote(file);
}
mAdapter.notifyDataSetChanged();
}
}
private void LoadData() throws IOException {
mNotes.clear();
File dir = new File(getFilesDir() + "/eNotes");
if (dir.exists()) {
File[] files = dir.listFiles();
System.out.println(files.length);
Arrays.sort(files, Comparator.comparingLong(File::lastModified));
for (int i = files.length-1; i > -1; i--) {
System.out.println("File name " + files[i].getName());
loadNote(files[i]);
}
}
mAdapter.notifyDataSetChanged();
}
private void loadNote(File file) throws IOException {
NoteModel noteModel = new NoteModel();
String[] splitTitle = file.getName().split("[.]");
noteModel.mTitle = splitTitle[0];
noteModel.mPath = file.getPath();
System.out.println(noteModel.mPath);
try {
BasicFileAttributes attr = Files.readAttributes(file.toPath(), BasicFileAttributes.class);
FileTime fileTime = attr.creationTime();
ZonedDateTime zonedDateTime = ZonedDateTime.parse(fileTime.toString());
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("HH:mm:ss \nmm/dd/yy ");
noteModel.mDate = dateTimeFormatter.format(zonedDateTime);
} catch (IOException e) {
e.printStackTrace();
}
mNotes.add(noteModel);
// LoadData();
mAdapter.notifyDataSetChanged();
}
private void InitializeLayout() {
searchNotes = findViewById(R.id.search_notes);
mRecyclerView = findViewById(R.id.recycler_view_notes);
mRecyclerView.setHasFixedSize(true);
//mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
mRecyclerView.setLayoutManager(new GridLayoutManager(this, 2));
mNotes = new ArrayList<>();
mAdapter = new NoteAdapter(this, mNotes);
mRecyclerView.setAdapter(mAdapter);
addNote = findViewById(R.id.add_notes);
addNote.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(NotesActivity.this, CreateNoteActivtiy.class);
startActivity(intent);
}
});
mAdapter.setOnItemClickListener(new NoteAdapter.OnItemClickListener() {
@Override
public void openNote(int position) {
NoteModel note = mNotes.get(position);
Intent intent = new Intent(NotesActivity.this, EditNoteActivity.class);
intent.putExtra("CURRENT_NOTE", note.mTitle);
intent.putExtra("CURRENT_NOTE_PATH", note.mPath);
startActivity(intent);
}
});
}
}
| [
"[email protected]"
]
| |
a5fc47110a7d117e6a4382723c9d3d52034f6ce3 | a3a7a8086cb93b160e35afef029ad7edc023c635 | /Mycat-Core/src/main/java/io/mycat/beans/TableDefBean.java | 5b5f0b4fa032d3c7a824a211bbd8d8f1f043bdd8 | [
"Apache-2.0"
]
| permissive | hemingyu/Mycat2 | e48a770e5e9d036a9dd57a271c676b11f4f3a2b1 | 642e10e2e7e57c58f42dc44c6d64de6a42d209e4 | refs/heads/master | 2021-01-12T18:18:46.983058 | 2016-09-24T08:36:46 | 2016-09-24T08:36:46 | 69,413,436 | 4 | 0 | null | 2016-09-28T01:30:49 | 2016-09-28T01:30:49 | null | UTF-8 | Java | false | false | 2,292 | java | /*
* Copyright (c) 2016, OpenCloudDB/MyCAT and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software;Designed and Developed mainly by many Chinese
* opensource volunteers. you can redistribute it and/or modify it under the
* terms of the GNU General Public License version 2 only, as published by the
* Free Software Foundation.
*
* This code 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
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Any questions about this component can be directed to it's project Web address
* https://code.google.com/p/opencloudb/.
*
*/package io.mycat.beans;
/**
* Mycat Table def Bean
* @author wuzhihui
*
*/
public class TableDefBean {
private String name;
private int type;
private String shardingKey;
private String shardingRule;
public TableDefBean(String name, int type, String shardingKey, String shardingRule) {
super();
this.name = name;
this.type = type;
this.shardingKey = shardingKey;
this.shardingRule = shardingRule;
}
public TableDefBean() {
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getShardingKey() {
return shardingKey;
}
public void setShardingKey(String shardingKey) {
this.shardingKey = shardingKey;
}
public String getShardingRule() {
return shardingRule;
}
public void setShardingRule(String shardingRule) {
this.shardingRule = shardingRule;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
@Override
public String toString() {
return "TableDefBean [name=" + name + ", type=" + type + ", shardingKey=" + shardingKey + ", shardingRule="
+ shardingRule + "]";
}
}
| [
"[email protected]"
]
| |
1c865df04d90a2078f47802a762f38db279717ca | 7aeb8b05ba6b4808ec901da9b76397c6f87c0df0 | /src/main/java/cn/test/MyRejectedExecutionHandler.java | 333d12b883d89e2b51719e9e88d032431e106bbf | []
| no_license | nizhiyong30/MavenProject | 53f160da25b4a1be6b495a260dc4ef5983b3ce1d | f715bffbe68140a3dc1ac6bb83693f6aa6e064b3 | refs/heads/master | 2023-06-24T05:43:00.427512 | 2022-02-21T02:57:13 | 2022-02-21T02:57:13 | 162,069,154 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 464 | java | package cn.test;
import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.RejectedExecutionHandler;
import java.util.concurrent.ThreadPoolExecutor;
/**
* @author nizy
* @date 2020/10/14 5:10 下午
*/
public class MyRejectedExecutionHandler implements RejectedExecutionHandler {
@Override
public void rejectedExecution(Runnable r, ThreadPoolExecutor e) {
System.out.println(Thread.currentThread().getId());
}
}
| [
"[email protected]"
]
| |
efba9d11d7abe15d959dd92cdfa449eb2cd620bf | e21f92c29d1ac33a0c73a42c5fb84a2ffad9bb7f | /LIST-DATATYPES/demo/src/main/java/com/example/demo/hello/sApplication.java | d062f4544ad3a7f404e9d7db1c67299b032f774f | []
| no_license | iSemicolon/SPRING-BOOT | 95cebc7f64432fa1efc09a1e6630dff573d5916d | bcf6032634a7bf873f221c6970bd6f23ac5bfaab | refs/heads/main | 2023-04-08T03:34:23.334488 | 2021-04-17T13:17:43 | 2021-04-17T13:17:43 | 357,205,657 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 299 | java | package com.example.demo.hello;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class sApplication {
@RequestMapping("/hello")
public String sayHi() {
return "Hello";
}
}
| [
"[email protected]"
]
| |
a8cf51745f05298b5efc019fede3d4684d3e9126 | 83f30d2a3ebe507d62a318053c709c3ad92d0b73 | /src/practical/javaNetworking/Networking_SocketProgramming.java | cafbfe6b056cad6daabe2df5d30b14e3ae5a8945 | []
| no_license | Tariqnawaz/core-java | d056b177c5ee34618af1c72d8b558aaf8ac09812 | 112d6611fe7f419323627ff6c04f8f65f3f3c168 | refs/heads/master | 2020-05-09T14:49:58.824839 | 2019-04-13T17:52:16 | 2019-04-13T17:52:16 | 181,205,979 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 531 | java | package practical.javaNetworking;
import java.io.DataInputStream;
import java.net.ServerSocket;
import java.net.Socket;
public class Networking_SocketProgramming {
public static void main(String[] args){
try{
ServerSocket ss=new ServerSocket(6666);
Socket s=ss.accept();//establishes connection
DataInputStream dis=new DataInputStream(s.getInputStream());
String str=(String)dis.readUTF();
System.out.println("message= "+str);
ss.close();
}catch(Exception e){System.out.println(e);}
}
}
| [
"[email protected]"
]
| |
f1831b6966ea6b482436858d0d66e618eb85bc94 | f64fcd2d9d37e4a2c29bf0504f45e95dcaef48ce | /04.spring-mq/mq-common/src/main/java/com/sinosoft/mq/Sender.java | 9f8d4b041c6954494f7cbea642d860b0b3d4cc28 | []
| no_license | chenzecq/StudyProject | 19953bfca1df15300edadf060b307547c4d21a03 | a77a26be49b0caaa3c804426a841040379013dbd | refs/heads/master | 2021-01-17T18:33:28.534269 | 2017-03-05T12:48:06 | 2017-03-05T12:48:06 | 84,135,018 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,351 | java | package com.sinosoft.mq;
import org.apache.activemq.command.ActiveMQQueue;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.jms.core.MessageCreator;
import org.springframework.stereotype.Service;
import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.Session;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
/**
* Created by yangming on 2017/2/14.
*/
public abstract class Sender<T extends Serializable> {
private static Logger logger = LogManager.getLogger(Sender.class.getName());
private static Map<String, Destination> destinationMap = new HashMap<String, Destination>();
public Destination getDestination(String destinationName) {
return destinationMap.get(destinationName);
}
@Autowired
private JmsTemplate template;
/**
* 发送消息到指定的消息队列
*
* @param queueName 消息队列名称
* @param ser 序列化的消息内容
* @return fasle:发送失败;true:发送成功
*/
private boolean sendMessage(String queueName, T ser) {
if (logger.isTraceEnabled()) {
logger.entry(queueName, ser);
}
try {
// 传入需要发送的序列化对象
final Serializable seri = ser;
// 发送消息
logger.debug("seri:" + seri);
Destination destination = destinationMap.get(queueName);
if (destination == null) {
destination = new ActiveMQQueue(queueName);
destinationMap.put(queueName, destination);
}
template.send(destination, new MessageCreator() {
public Message createMessage(Session session) throws JMSException {
return session.createObjectMessage(seri);
}
});
return true;
} catch (Exception ex) {
logger.error(ex);
return false;
}
}
public boolean sendMessage(T t) {
String queueName = this.getClass().getSimpleName().replaceAll("Sender", "");
return sendMessage(queueName, t);
}
}
| [
"[email protected]"
]
| |
ce6963396b77cf1a965a1d6472393ca57c921ad7 | 6ef4869c6bc2ce2e77b422242e347819f6a5f665 | /devices/google/Pixel 2/29/QPP6.190730.005/src/framework/android/hardware/radio/_$$Lambda$RadioManager$cfMLnpQqL72UMrjmCGbrhAOHHgg.java | 1c1a49c48e06a2a6fc1282cd5cc4c330066605c5 | []
| no_license | hacking-android/frameworks | 40e40396bb2edacccabf8a920fa5722b021fb060 | 943f0b4d46f72532a419fb6171e40d1c93984c8e | refs/heads/master | 2020-07-03T19:32:28.876703 | 2019-08-13T03:31:06 | 2019-08-13T03:31:06 | 202,017,534 | 2 | 0 | null | 2019-08-13T03:33:19 | 2019-08-12T22:19:30 | Java | UTF-8 | Java | false | false | 963 | java | /*
* Decompiled with CFR 0.145.
*
* Could not load the following classes:
* android.hardware.radio.-$
* android.hardware.radio.-$$Lambda
* android.hardware.radio.-$$Lambda$RadioManager
* android.hardware.radio.-$$Lambda$RadioManager$cfMLnpQqL72UMrjmCGbrhAOHHgg
*/
package android.hardware.radio;
import android.hardware.radio.-$;
import android.hardware.radio.RadioManager;
import java.util.concurrent.Executor;
public final class _$$Lambda$RadioManager$cfMLnpQqL72UMrjmCGbrhAOHHgg
implements Executor {
public static final /* synthetic */ -$.Lambda.RadioManager.cfMLnpQqL72UMrjmCGbrhAOHHgg INSTANCE;
static /* synthetic */ {
INSTANCE = new _$$Lambda$RadioManager$cfMLnpQqL72UMrjmCGbrhAOHHgg();
}
private /* synthetic */ _$$Lambda$RadioManager$cfMLnpQqL72UMrjmCGbrhAOHHgg() {
}
@Override
public final void execute(Runnable runnable) {
RadioManager.lambda$addAnnouncementListener$0(runnable);
}
}
| [
"[email protected]"
]
| |
be0e43710890dec887616feb1c400f417da9353a | 8f09e25784933be46d857f3a8e760d042b1d3b30 | /src/main/java/com/sigmaukraine/trn/report/WebReportAdapter.java | 99c998f8b26661477ab4d8862a93f2c088ab0bce | []
| no_license | mikhailkulava/KDT-2 | 523a3dcb5e0e3c204a67c6093a019b9a126f54d7 | a077e6fc1608b9a032435a030062bbf6f6f8bb3e | refs/heads/master | 2016-09-05T23:11:34.113487 | 2014-04-25T08:41:07 | 2014-04-25T08:41:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 335 | java | package com.sigmaukraine.trn.report;
public class WebReportAdapter implements ReportAdapter {
public void write(ReportWriter writer, Object item) {
if(writer instanceof WebReportWriterWraper && item instanceof WebReportItem) {
((WebReportItem)item).message((WebReportWriterWraper) writer);
}
}
}
| [
"[email protected]"
]
| |
b32b8f510031bfa1a0f19ad81aa0dbaad24acf01 | 970c66f95a1817f5fe13a0f8fb6625926c03ad03 | /souyun/app/src/main/java/com/xrwl/owner/module/publish/mvp/PublishModel.java | d204cdd36e8a5ecd9dd4a8fd22fc69e0bfae172d | []
| no_license | l331258747/souyun | 97237346f8680c4458b02d275e97a212cf203520 | 5cc45537c73bea6536869e4a130efba910bc948d | refs/heads/master | 2023-04-23T08:51:30.949151 | 2021-05-15T08:42:21 | 2021-05-15T08:42:21 | 323,032,997 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,662 | java | package com.xrwl.owner.module.publish.mvp;
import com.ldw.library.bean.BaseEntity;
import com.xrwl.owner.bean.Distance;
import com.xrwl.owner.retrofit.OtherRetrofitFactory;
import com.xrwl.owner.retrofit.RxSchedulers;
import java.util.Map;
import io.reactivex.Observable;
/**
* Created by www.longdw.com on 2018/4/23 上午9:10.
*/
public class PublishModel implements PublishContract.IModel {
@Override
public Observable<BaseEntity<Integer>> calculateDistancecount(Map<String, String> params) {
return OtherRetrofitFactory.getInstance("http://jiekou.16souyun.com/").calculateDistancecount(params).compose(RxSchedulers
.<BaseEntity<Integer>>compose());
}
@Override
///public/admin/map
public Observable<BaseEntity<Distance>> calculateDistance(Map<String, String> params) {
return OtherRetrofitFactory.getInstance("http://distance.16souyun.com/").calculateDistance(params).compose(RxSchedulers
.<BaseEntity<Distance>>compose());
}
@Override
//public/admin/map/compre
public Observable<BaseEntity<Distance>> calculateLongDistance(Map<String, String> params) {
return OtherRetrofitFactory.getInstance("http://distance.16souyun.com/").calculateLongDistance(params).compose(RxSchedulers
.<BaseEntity<Distance>>compose());
}
@Override
//public/admin/map
public Observable<BaseEntity<Distance>> requestCityLonLat(Map<String, String> params) {
return OtherRetrofitFactory.getInstance("http://distance.16souyun.com/").requestCityLonLat(params).compose(RxSchedulers
.<BaseEntity<Distance>>compose());
}
}
| [
"[email protected]"
]
| |
ca94ac8c7f7b3f7c65d51fa3c183cc5877d4f6cf | 6caa37c1dd7641e95f4a3ad2c8bbe12007c0b2ff | /src/main/java/com/springbootfirst/system/annotation/NotIn.java | af8c1962338e017282c72e4398ce5805e7886874 | []
| no_license | wangzhiziqiao/springbootfirst | b0af04d38fec39447a3ee12492fc5b076b9c9fc1 | 80968488a2e2157f4e40094f6f08b01317a8cae7 | refs/heads/master | 2020-07-05T11:28:15.758844 | 2016-09-06T05:33:44 | 2016-09-06T05:33:44 | 66,939,007 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 474 | java | package com.springbootfirst.system.annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
*
* @author wangqiao
* [email protected]
*
*/
@Target({ElementType.FIELD,ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface NotIn {
String desc() default "";
}
| [
"[email protected]"
]
| |
8852dd32123e83d7c95c2328801b6ff8d5973a3d | b9ca04dd30deb7966fba0b713f9f39dc2d4ce636 | /java1.java | 304dedc63ca6a57e1269326a0c74cb192d4df362 | [
"MIT"
]
| permissive | chenjin29/git-demo | ed2f90c3d54579d3aa7a38a3d66222cfb42bf109 | 82e6bb62f50da40294f14d85d98e2f961e6a4b41 | refs/heads/master | 2021-01-09T06:02:43.134564 | 2017-02-04T14:12:55 | 2017-02-04T14:12:55 | 80,886,145 | 0 | 0 | null | 2017-02-04T02:10:25 | 2017-02-04T02:10:25 | null | UTF-8 | Java | false | false | 30 | java | <h1>a Test</h1>
from chen 2.4
| [
"[email protected]"
]
| |
bfca460990566e561abec60a90d7c53b955d4f27 | bf2966abae57885c29e70852243a22abc8ba8eb0 | /aws-java-sdk-codecommit/src/main/java/com/amazonaws/services/codecommit/model/InvalidResourceArnException.java | beb3fda745e2ae54d86b6de6c9f7afd55e9f0c51 | [
"Apache-2.0"
]
| permissive | kmbotts/aws-sdk-java | ae20b3244131d52b9687eb026b9c620da8b49935 | 388f6427e00fb1c2f211abda5bad3a75d29eef62 | refs/heads/master | 2021-12-23T14:39:26.369661 | 2021-07-26T20:09:07 | 2021-07-26T20:09:07 | 246,296,939 | 0 | 0 | Apache-2.0 | 2020-03-10T12:37:34 | 2020-03-10T12:37:33 | null | UTF-8 | Java | false | false | 1,513 | java | /*
* Copyright 2016-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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.amazonaws.services.codecommit.model;
import javax.annotation.Generated;
/**
* <p>
* The value for the resource ARN is not valid. For more information about resources in AWS CodeCommit, see <a href=
* "https://docs.aws.amazon.com/codecommit/latest/userguide/auth-and-access-control-iam-access-control-identity-based.html#arn-formats"
* >CodeCommit Resources and Operations</a> in the AWS CodeCommit User Guide.
* </p>
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class InvalidResourceArnException extends com.amazonaws.services.codecommit.model.AWSCodeCommitException {
private static final long serialVersionUID = 1L;
/**
* Constructs a new InvalidResourceArnException with the specified error message.
*
* @param message
* Describes the error encountered.
*/
public InvalidResourceArnException(String message) {
super(message);
}
}
| [
""
]
| |
dc7d06e857b6c9d11bc45d4d7749de6aa61c7c7d | 8e6792d2bab821473d550366149504381c262101 | /java课设/8208190406_应用实践Java课设/qqchat/src/qqserver/model/SerConClientThread.java | 4fc4a8e51358f1b47705a39a74a91b4aff93ae5b | []
| no_license | SHEReunice/JavaProj | cf579a6b04f42b7042fdd216a18ca5b19ea1c512 | 2895c62d0a34890b2abeff8c41cf50d84255ef4e | refs/heads/master | 2023-07-08T23:07:40.323938 | 2021-08-07T08:22:14 | 2021-08-07T08:22:14 | 390,556,885 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,890 | java | /*
功能:服务器和某个客户端的通讯线程
*/
package qqserver.model;
import common.Message;
import common.MessageType;
import qqClient_model.ManageClientConServerThread;
import qqclient_view.ManageQqFriendList;
import qqserver.view.ManageView;
import qqserver.view.myServer_view;
import java.io.*;
import java.net.*;
import java.util.HashMap;
import java.util.Iterator;
public class SerConClientThread extends Thread{
myServer_view mview = null;
Socket s;
public SerConClientThread(Socket s)
{
//把服务器与该客户端的连接赋给s
this.s = s;
}
//让该线程去通知其它用户
public void notifyOther(String iam) throws IOException {
//得到在线的人的线程
HashMap hm = ManageClientThread.hm;
Iterator it = hm.keySet().iterator();
while(it.hasNext()){
Message m = new Message();
m.setSender(iam);
m.setCon(iam);
m.setMesType(MessageType.message_ret_onLineFriend);
//取出在线的人的id
String onLineUserId = it.next().toString();
ObjectOutputStream oos = new ObjectOutputStream(ManageClientThread.getClientThread(onLineUserId).s.getOutputStream());
m.setGetter(onLineUserId);
oos.writeObject(m);
}
}
public Socket getS() {
return s;
}
public void run()
{
while(true)
{
//这里该线程就可以接收客户端的信息
try {
ObjectInputStream ois = new ObjectInputStream(s.getInputStream());
Message m = (Message) ois.readObject();
//取出message中信息,确认服务器拿到了信息
System.out.println(m.getSender() + " 给 " + m.getGetter() + " 说 " + m.getCon());
//对从客户端取得的消息进行类型判断,然后做相应的处理
if(m.getMesType().equals(MessageType.message_comm_mes)){
//一会完成转发任务
//取得接收人的通讯线程
SerConClientThread sc = ManageClientThread.getClientThread(m.getGetter());
ObjectOutputStream oos = new ObjectOutputStream(sc.s.getOutputStream());
oos.writeObject(m);
}
else if(m.getMesType().equals(MessageType.message_get_onLineFriend)){
System.out.println(m.getSender() + "要他的好友");
//把在服务器的好友给该客户端返回
mview = ManageView.getView("1");
mview.showXt(m.getSender());
String res = ManageClientThread.getAllOnLineUserid();
Message mnew = new Message();
mnew.setCon(res);
mnew.setSender(m.getSender());
mnew.setMesType(MessageType.message_ret_onLineFriend);
mnew.setGetter(m.getSender());
ObjectOutputStream oos = new ObjectOutputStream(s.getOutputStream());
oos.writeObject(mnew);
}else if(m.getMesType().equals(MessageType.message_qxx)){
System.out.println(m.getSender() + "发送群消息");
//得到在线的人的线程
HashMap hm = ManageClientThread.hm;
Iterator it = hm.keySet().iterator();
while(it.hasNext()){
//取出在线的人的id
String onLineUserId = it.next().toString();
ObjectOutputStream oos = new ObjectOutputStream(ManageClientThread.getClientThread(onLineUserId).getS().getOutputStream());
m.setGetter(onLineUserId);
oos.writeObject(m);
}
}else if(m.getMesType().equals(MessageType.message_out)){
//得到在线的人的线程
ManageClientThread.removeClientThread(m.getCon());
HashMap hm = ManageClientThread.hm;
Iterator it = hm.keySet().iterator();
while(it.hasNext()){
//取出在线的人的id
String onLineUserId = it.next().toString();
ObjectOutputStream oos = new ObjectOutputStream(ManageClientThread.getClientThread(onLineUserId).getS().getOutputStream());
m.setGetter(onLineUserId);
oos.writeObject(m);
}
mview = ManageView.getView("1");
mview.showXx(m.getSender());
}
} catch (IOException | ClassNotFoundException e) {
e.printStackTrace();
}
}
}
}
| [
"[email protected]"
]
| |
77c8188d67aeffe4acca68b6385062aba927342b | 897676fbea6c21725bc8b43329b928e709e22b25 | /io7m-jstructural-tests/src/test/java/com/io7m/jstructural/tests/xom/SXHTML10StrictValidator.java | 04ea8c739acd30fc166912101d5417b2392ece45 | [
"ISC"
]
| permissive | io7m/jstructural | d2ed7fe97ea9bab390f192512dea7169ad3dd0eb | 2a1a149009a257008b2cab3e7d14ff2cf18f4299 | refs/heads/develop | 2023-08-29T09:39:20.158937 | 2018-06-04T14:34:28 | 2018-06-04T14:34:28 | 40,823,892 | 0 | 1 | ISC | 2021-06-07T17:44:24 | 2015-08-16T14:47:38 | Java | UTF-8 | Java | false | false | 3,991 | java | package com.io7m.jstructural.tests.xom;
import com.io7m.jnull.NullCheck;
import com.io7m.jnull.Nullable;
import nu.xom.Builder;
import nu.xom.Document;
import nu.xom.ParsingException;
import nu.xom.ValidityException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.xml.sax.ErrorHandler;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
import org.xml.sax.XMLReader;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import javax.xml.transform.Source;
import javax.xml.transform.stream.StreamSource;
import javax.xml.validation.SchemaFactory;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
public final class SXHTML10StrictValidator
{
private static final Logger LOG;
static {
LOG = LoggerFactory.getLogger(SXHTML10StrictValidator.class);
}
private SXHTML10StrictValidator()
{
}
static Document fromStreamValidate(
final InputStream stream,
final URI uri)
throws SAXException,
ParserConfigurationException,
ValidityException,
ParsingException,
IOException
{
NullCheck.notNull(stream, "Stream");
SXHTML10StrictValidator.LOG.debug("xml: creating sax parser");
final SAXParserFactory factory = SAXParserFactory.newInstance();
SXHTML10StrictValidator.LOG.debug("xml: opening xml.xsd");
final InputStream xml_xsd =
SXHTML10StrictValidator.class
.getResourceAsStream("/com/io7m/jstructural/tests/xml.xsd");
try {
SXHTML10StrictValidator.LOG.debug("xml: opening schema.xsd");
final InputStream schema_xsd =
SXHTML10StrictValidator.class
.getResourceAsStream("/com/io7m/jstructural/tests/xhtml1-strict.xsd");
try {
SXHTML10StrictValidator.LOG.debug("xml: creating schema handler");
final SchemaFactory schema_factory =
SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
final Source[] sources = new Source[2];
sources[0] = new StreamSource(xml_xsd);
sources[1] = new StreamSource(schema_xsd);
factory.setSchema(schema_factory.newSchema(sources));
final TrivialErrorHandler handler = new TrivialErrorHandler();
final SAXParser parser = factory.newSAXParser();
final XMLReader reader = parser.getXMLReader();
reader.setErrorHandler(handler);
reader.setFeature(
"http://apache.org/xml/features/nonvalidating/load-external-dtd",
false);
SXHTML10StrictValidator.LOG.debug("xml: parsing and validating");
final Builder builder = new Builder(reader, false);
final Document doc = builder.build(stream, uri.toString());
final SAXParseException ex = handler.getException();
if (ex != null) {
throw ex;
}
return doc;
} finally {
schema_xsd.close();
}
} finally {
xml_xsd.close();
}
}
private static class TrivialErrorHandler implements ErrorHandler
{
private @Nullable SAXParseException exception;
public TrivialErrorHandler()
{
}
@Override
public void error(
final @Nullable SAXParseException e)
throws SAXException
{
assert e != null;
SXHTML10StrictValidator.LOG.error(e + ": " + e.getMessage());
this.exception = e;
}
@Override
public void fatalError(
final @Nullable SAXParseException e)
throws SAXException
{
assert e != null;
SXHTML10StrictValidator.LOG.error(e + ": " + e.getMessage());
this.exception = e;
}
public
@Nullable
SAXParseException getException()
{
return this.exception;
}
@Override
public void warning(
final @Nullable SAXParseException e)
throws SAXException
{
assert e != null;
SXHTML10StrictValidator.LOG.warn(e + ": " + e.getMessage());
this.exception = e;
}
}
}
| [
"[email protected]"
]
| |
3def5c3716fe38aa93d511264083ae5c544dbafd | fe3ebb7d1d47d512310cadf1f597fa3fa174f03d | /Ecommerce/app/src/main/java/com/seals/shubham/ecommerce/tab3.java | 91d0dbbd392011518eceb6d87c4aada847c69d47 | []
| no_license | ShubhamWorks78/AndroidStudioProjects | 86113b3b1274bf851ab11286e6107ba10c09bb30 | 8ee059dd9f5cbc49ffeb5446c983bb43e33de0bb | refs/heads/master | 2021-01-12T15:05:38.087765 | 2016-10-23T09:10:26 | 2016-10-23T09:10:26 | 71,692,288 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 546 | java | package com.seals.shubham.ecommerce;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
/**
* Created by shubham on 7/14/2016.
*/
public class tab3 extends Fragment{
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
return inflater.inflate(R.layout.tab3,container,false);
}
}
| [
"[email protected]"
]
| |
d10c7b68d0dc3cbb762760f8c2b74e81e98f3513 | b9a6a5af275a02abf41033d0540ef500439b652b | /tests/pos/i7959.java | 5ec2c4f4de8c37a80c2bc56e4472ab954a2c20db | [
"Apache-2.0"
]
| permissive | lampepfl/dotty | d453cb9368fd91d527ad89985c1b9bb13d395837 | 4c77f628811c7096246290a8b4242cfaa5757fcc | refs/heads/main | 2023-08-31T19:38:01.263140 | 2023-08-31T18:41:50 | 2023-08-31T18:41:50 | 7,035,651 | 5,920 | 1,180 | Apache-2.0 | 2023-09-14T12:21:08 | 2012-12-06T12:57:33 | Scala | UTF-8 | Java | false | false | 69 | java | public class i7959 {
private static class Foo {
Foo() { }
}
} | [
"[email protected]"
]
| |
f6e215c25a1aeddd56db74de4d226a2a9eec62f5 | 3a824587e363da3e50ba9f986e67d0dacd22d445 | /hw13/src/main/java/com/example/hw13/MyClass.java | 39e5312216d7bfc2b6c8ecd50a80a95633cb1bea | []
| no_license | love190love/JAVA_hw13 | 4519dd4f1cd21539d763255bc5d940bfb5d27834 | 3396d9bc0deef9071d5639332d54dbb57413dc8b | refs/heads/master | 2020-09-06T11:39:52.983064 | 2019-11-08T07:44:19 | 2019-11-08T07:44:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 758 | java | package com.example.hw13;
import java.util.Scanner;
public class MyClass {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("請輸入您的性別 ");
System.out.println("男生請輸入1 女生請輸入2");
int i=scanner.nextInt();
System.out.println("您的年齡: ");
int j=scanner.nextInt();
if((i==1)&&(j>=18))
System.out.println("您可以合法結婚 ");
if((i==1)&&(j<18))
System.out.println("您不可以合法結婚 ");
if((i==2)&&(j>=16))
System.out.println("您可以合法結婚 ");
if((i==2)&&(j<16))
System.out.println("您不可以合法結婚 ");
}
}
| [
"[email protected]"
]
| |
0be159aee2040220c599c49fd6e07f2ee3f74afb | 6125f31054944b3cac5b2eeaf9b5d7debcf9573a | /src/nl/gcompany/bigqueryapp/Utilities.java | 84c62edc986f6c0d9435e382528364936d59843f | []
| no_license | moinc/gcp-demo1-bigqueryapp | a1afd294eba45cef5b92ca93134d66e32e6bf4ea | 48957143e16bca63ac24a5d598e6dc1826fee193 | refs/heads/master | 2021-01-21T08:01:09.793769 | 2014-03-18T08:21:53 | 2014-03-18T08:21:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,071 | java | package nl.gcompany.bigqueryapp;
import com.google.api.services.bigquery.model.QueryResponse;
import com.google.api.services.bigquery.model.TableCell;
import com.google.api.services.bigquery.model.TableFieldSchema;
import com.google.api.services.bigquery.model.TableRow;
import com.google.api.services.bigquery.model.TableSchema;
public class Utilities {
public static void displayTheResults(QueryResponse queryResponse) {
System.out.println("Results:");
System.out.print("\n");
TableSchema schema = queryResponse.getSchema();
int j = 0;
for (TableFieldSchema field : schema.getFields()) {
if (j > 0) {
System.out.print("\t");
}
System.out.print(field.getName());
j++;
}
System.out.print("\n");
for (TableRow row : queryResponse.getRows()) {
int i = 0;
for (TableCell cell : row.getF()) {
Object value = cell.getV();
if (value == null) {
value = "NULL";
}
if (i > 0) {
System.out.print("\t");
}
System.out.print(value);
i++;
}
System.out.print("\n");
}
System.out.print("\n");
}
}
| [
"[email protected]"
]
| |
f7c44b9f98f342df6b7e617ee0f1697592c8fd79 | ebf8439676ed44a4ed2d7b34c5a22ac989a74105 | /src/android/Crypto.java | 6df59a1c7641bb74031916d4b931c1b2e793991f | []
| no_license | rbfagundes/plugins | 1c0dd1b4725f71b8015653c4f2c37f2a923ea14d | 31c82526425e38afbcd5aed364c0aad9e24863c4 | refs/heads/master | 2016-09-05T11:36:13.258926 | 2015-07-03T13:29:03 | 2015-07-03T13:29:03 | 38,385,938 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,196 | java | package br.com.fullgauge.sitradmobile;
import java.io.UnsupportedEncodingException;
import android.os.Bundle;
import org.apache.cordova.*;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import android.util.Log;
public class Crypto extends CordovaPlugin {
public CallbackContext callback;
public static String TAG = "CryptoPlugin";
/** Executes the request.
* @param action The action to execute.
* @param args The exec() arguments.
* @param callbackContext The callback context used when calling back into JavaScript.
* @return Whether the action was valid.
*/
@Override
public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
Log.d(TAG,"callbackId="+callbackContext.getCallbackId());
this.callback = callbackContext;
String input = "";
//PluginResult result = new PluginResult(PluginResult.Status.NO_RESULT);
try {
// Input String
if(args.length() > 0) {
input = args.getString(0);
//Log.d(TAG,"input="+input);
}
Log.d(TAG,"action="+action);
// if has some input
if (input != null && !"".equals(input)) {
if (action.equals("crypt")) {
JSONObject crypted = crypt(input);
//Log.d(TAG, "crypted=" + crypted);
Log.d(TAG, "action crypt");
callbackContext.success(crypted);
return true;
//result = new PluginResult(PluginResult.Status.OK, crypted);
} else if (action.equals("decrypt")) {
JSONObject decrypted = decrypt(input);
//Log.d(TAG, "decrypted=" + decrypted);
Log.d(TAG, "action decrypt");
callbackContext.success(decrypted);
return true;
//result = new PluginResult(PluginResult.Status.OK, decrypted);
} else if(action.equals("decodeBase64")){
JSONObject decodedBase64 = decodeBase64(input);
//Log.d(TAG, "decodedBase64=" + decodedBase64);
Log.d(TAG, "action decodeBase64");
callbackContext.success(decodedBase64);
return true;
//result = new PluginResult(PluginResult.Status.OK, decodedBase64);
} else if(action.equals("encodeBase64")){
JSONObject encodedBase64 = encodeBase64(input);
//Log.d(TAG, "encodedBase64=" + encodedBase64);
Log.d(TAG, "action encodeBase64");
callbackContext.success(encodedBase64);
return true;
//result = new PluginResult(PluginResult.Status.OK, encodedBase64);
}
else {
Log.d(TAG, "action not valid");
// action not valid
return false;
//result = new PluginResult(
// PluginResult.Status.INVALID_ACTION);
}
}
} catch (JSONException e) {
e.printStackTrace();
// some exception
Log.d(TAG,"JSONException="+e.getMessage());
callbackContext.error(e.getMessage());
return false;
//result = new PluginResult(PluginResult.Status.JSON_EXCEPTION);
} catch (Exception e) {
e.printStackTrace();
// some exception
Log.d(TAG,"Exception="+e.getMessage());
callbackContext.error(e.getMessage());
return false;
//result = new PluginResult(PluginResult.Status.JSON_EXCEPTION);
}
return false;
}
/**
* Encode base 64
*
* @param toEncode String do encode
* @return encoded result
* @throws JSONException if any error
*/
private JSONObject encodeBase64(String toEncode) throws JSONException {
JSONObject jsonResult = new JSONObject();
try {
StringBuffer sb = new StringBuffer(toEncode);
String base64 = new String(Base64.encode(sb.toString().getBytes("ISO-8859-1")));
//Log.d(TAG,"base64="+base64);
Log.d(TAG,"encodeBase64 ok");
jsonResult.put("result", base64);
} catch (UnsupportedEncodingException e) {
throw new JSONException(e.getMessage());
}
return jsonResult;
}
/**
* Decode base64
*
* @param toDecode String to decode
* @return Decoded result
* @throws JSONException if any error
*/
private JSONObject decodeBase64(String toDecode) throws JSONException {
JSONObject jsonResult = new JSONObject();
try {
String base64 = new String(Base64.decode(toDecode.toString()),"ISO-8859-1" );
//Log.d(TAG,"base64="+base64);
Log.d(TAG,"decodeBase64 ok");
jsonResult.put("result", base64);
} catch (UnsupportedEncodingException e) {
throw new JSONException(e.getMessage());
}
return jsonResult;
}
/**
* Crypt the value
*
* @param String text to be crypted
* @return JSONObject representation of directory list. e.g
* {"result":result to be sent}
* @throws JSONException
*/
private JSONObject crypt(String toCrypt) throws JSONException {
JSONObject jsonResult = new JSONObject();
try {
StringBuffer sb = new StringBuffer(toCrypt);
FgCrypto.Criptografar(sb, sb.length());
String base64 = new String(Base64.encode(sb.toString().getBytes("ISO-8859-1")));
//Log.d(TAG,"base64="+base64);
Log.d(TAG,"crypt ok");
// ignore protocol first characters "װ" this will be included by Java Script communication
jsonResult.put("result", base64);
} catch (UnsupportedEncodingException e) {
throw new JSONException(e.getMessage());
}
return jsonResult;
}
/**
* Decrypt the value
*
* @param String text to be decrypted
* @return JSONObject representation of directory list. e.g
* {"result":result to be sent}
* @throws JSONException
*/
private JSONObject decrypt(String crypted) throws JSONException {
JSONObject jsonResult = new JSONObject();
try {
String filtered;
if (crypted.charAt(0) == '\uFFFD') {
filtered = crypted.substring(1, crypted.length() - 2);
} else {
filtered = crypted;
}
Log.d(TAG,"filtered ="+filtered);
StringBuffer sb = new StringBuffer(new String(Base64.decode(filtered.toString()),"ISO-8859-1" ));
FgCrypto.Decriptografar(sb, sb.length());
//Log.d(TAG,"base64="+sb);
Log.d(TAG,"decrypt ok");
jsonResult.put("result", sb);
} catch (UnsupportedEncodingException e) {
throw new JSONException(e.getMessage());
}
return jsonResult;
}
}
| [
"Fagundes@Fagundes-PC"
]
| Fagundes@Fagundes-PC |
27416c6746268c12eb1fce76af3881eeb69f9c1e | 1d068bd78207bed319cd8366351fb0d29a29a71e | /src/com/Thread/Thread_test6.java | ce0930a609bc0ac219637c095ff05a055e3182d8 | []
| no_license | Fish-123/rj_182 | 9a79d769cc79400bcfe8a46a0dba521f91565e6f | 605b97be35474b28f2ccf896074c9e28da53a73b | refs/heads/master | 2020-11-25T18:10:15.821508 | 2019-12-18T07:48:10 | 2019-12-18T07:48:10 | 228,787,013 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,403 | java | package com.Thread;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;
class MyThread implements Callable<Object>{
@Override
public Object call() throws Exception{
int sum=0;
for (int i=1; i<11;i++) {
sum+=i;
}
switch (Thread.currentThread().getName()) {
case "线程1":
break;
case "线程2":
sum+=100;
case "线程3":
sum+=200;
case "线程4":
sum+=300;
case "线程5":
sum+=400;
case "线程6":
sum+=500;
case "线程7":
sum+=600;
case "线程8":
sum+=700;
case "线程9":
sum+=800;
case "线程10":
sum+=900;
break;
default:
break;
}
return sum;
}
}
public class Thread_test6 {
public static void main(String[] args) throws Exception, ExecutionException {
MyThread mt1=new MyThread();
FutureTask<Object> ft1=new FutureTask<Object>(mt1);
Thread t1=new Thread(ft1,"线程1");
t1.start();
System.out.println("线程1求和的结果是"+ft1.get());
MyThread mt2=new MyThread();
FutureTask<Object> ft2=new FutureTask<Object>(mt1);
Thread t2=new Thread(ft2,"线程2");
t2.start();
//System.out.println("线程2求和的结果是"+ft2.get());
int total=(int)ft1.get()+(int)ft2.get();
System.out.println("线程1和线程2的求和的结果是:"+total);
}
}
| [
"[email protected]"
]
| |
72f1c34c7eb6973673b2b0bfea47648ff7f50db0 | 080265e4016497e95fa6a860b9ed1d72c8583ffb | /typeconverter2/src/main/java/hello/typeconverter/formatter/MyNumberFormatter.java | fd3de42d68bece96b3c75eae693d0680fbbd20e5 | []
| no_license | vkrh0406/MVC2 | 45e1e81881b22ef200d21db9a72e2ba468461da7 | 3905902911ee7942d59344bd67d23f5403bb9a2b | refs/heads/main | 2023-06-23T02:11:34.403106 | 2021-07-17T12:29:55 | 2021-07-17T12:29:55 | 382,616,183 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 756 | java | package hello.typeconverter.formatter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.format.Formatter;
import java.text.NumberFormat;
import java.text.ParseException;
import java.util.Locale;
@Slf4j
public class MyNumberFormatter implements Formatter<Number> {
@Override
public Number parse(String text, Locale locale) throws ParseException {
log.info("text={}, locale={}", text, locale);
//"1,000" -> 1000
NumberFormat format = NumberFormat.getInstance(locale);
return format.parse(text);
}
@Override
public String print(Number object, Locale locale) {
log.info("object={}, locale={}", object, locale);
return NumberFormat.getInstance(locale).format(object);
}
}
| [
"[email protected]"
]
| |
9eabc8d4b4580c40968962ae858781f8104f9b1c | 16fce64f8b0a284f28bd770cefdfa009fa695461 | /ConnectGoogleClasswithRealize/src/ImportGoggleClass.java | 725769a6bd4232d2b227f6b2950fbe5273f470f2 | []
| no_license | gowrishankar1707/Gowri-Shankar | c092d049d81f5be3adca99e135812be3d9f12356 | 63bd278dbf8c035ef086c057963950efbfa8c757 | refs/heads/master | 2022-11-13T07:17:14.439274 | 2022-11-07T18:25:55 | 2022-11-07T18:25:55 | 220,994,669 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 433 | java | import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import LinkGoogleClassTeacher.LinkGoogleClass;
public class ImportGoggleClass {
public static void main(String[] args) throws InterruptedException {
// TODO Auto-generated method stub
WebDriver driver=new ChromeDriver();
driver.manage().window().maximize();
LinkGoogleClass.LoginWithRealize(driver);
}
}
| [
"[email protected]"
]
| |
34c4f0db085234cb5bb706cfd518c5d314f285aa | 89c178f7d8cd5dd5a09d78fecead8b5ffd59d66f | /src/main/java/com/chavaillaz/awsec2utils/use/command/Command_A.java | bb5ef1c60615054e158badc09ce362ce8fa36c6e | [
"Apache-2.0"
]
| permissive | Chavjoh/AWS-EC2-Utils | f72d8726379fbd0d486877b1f17d020fd40d6374 | 063c157cea4c55f0cd049d1b25e74dbed68e7d73 | refs/heads/master | 2020-02-26T15:26:24.920413 | 2015-06-11T00:17:34 | 2015-06-11T00:17:34 | 34,458,721 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,017 | java | package com.chavaillaz.awsec2utils.use.command;
import java.util.List;
import com.chavaillaz.awsec2utils.use.exception.CommandParametersException;
/**
* Abstract command.
* Describe constructor and methods of a command.
*
* @author Johan Chavaillaz
*/
abstract public class Command_A {
/**
* Key of the command.
* Used to find the corresponding class of a command.
*/
public static String KEY;
/**
* Help of the command
*/
public static String HELP;
/**
* Detailed help of the command
*/
public static String HELP_DETAIL;
/**
* Create the commands with the given parameters.
*
* @param parameters Parameters used to configure the command
* @throws CommandParametersException
*/
public Command_A(List<String> parameters) throws CommandParametersException {
// Nothing
}
/**
* Run the job of the command.
*
* @throws Exception
*/
public abstract void run() throws Exception;
/**
* Cleaning after run command.
*/
public abstract void clean();
}
| [
"[email protected]"
]
| |
aed437031ab2074e0d092a0f9c1f63990efe9d40 | a38786fc0a0ad9c246a2ab2b7471cf9713542ad0 | /core/src/main/java/com/gy/core/util/FileUtil.java | b5f58b4b40d7a60243c3975b91dd274cc4f637d0 | []
| no_license | sunsguo/g-one | 697132d9ef44f7f7e7c5ce55a273ca9ccb6f01dd | ea396b600debde3ea0d1dae06093e0b52b85673d | refs/heads/main | 2023-03-10T03:17:16.448466 | 2021-02-22T03:24:18 | 2021-02-22T03:24:18 | 331,854,901 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,703 | java | package com.gy.core.util;
import java.io.File;
import java.io.FileFilter;
import java.util.Arrays;
import java.util.function.Consumer;
/**
* 文件工具类
*/
public abstract class FileUtil {
/**
* 遍历所有文件
*
* @param file 需要遍历的文件
* @param consumer 每个文件的处理器
*/
public static void walkFile(String file, Consumer<File> consumer) {
walkFile(new File(file), consumer);
}
/**
* 遍历所有文件
*
* @param file 需要遍历的文件
* @param consumer 每个文件的处理器
*/
public static void walkFile(File file, Consumer<File> consumer) {
walkFile(file, consumer, it -> true);
}
/**
* 遍历所有文件 可以添加文件过滤器
*
* @param file 需要遍历的文件
* @param consumer 每个文件的处理器
*/
public static void walkFile(String file, Consumer<File> consumer, FileFilter filter) {
walkFile(new File(file), consumer, filter);
}
public static void walkFile(File file, Consumer<File> consumer, FileFilter filter) {
if (file.isDirectory()) {
File[] files = file.listFiles(filter);
if (files != null)
Arrays.stream(files).forEach(it -> walkFile(it, consumer));
} else {
consumer.accept(file);
}
}
/**
* 遍历 class 文件
*
* @param file 需要遍历的文件
* @param consumer 每个文件的处理器
*/
public static void walkClassFile(String file, Consumer<Class<?>> consumer) {
ClassLoader classLoader = FileUtil.class.getClassLoader();
if (StringUtil.isEmpty(file))
file = classLoader.getResource("").getPath();
final String basePath = file;
walkFile(file, it -> {
String classPath = it.getPath();
String classFullName = classPath.substring(basePath.length() - 1, classPath.lastIndexOf("."))
.replace(File.separator, ".");
try {
Class<?> cls = classLoader.loadClass(classFullName);
consumer.accept(cls);
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
}, it -> it.isDirectory() || it.getName().endsWith(".class"));
}
/**
* 遍历 class 文件
*
* @param cls cls 类的同包及子包
* @param consumer 每个文件的处理器
*/
public static void walkClassFile(Class<?> cls, Consumer<Class<?>> consumer) {
String classPath = cls.getResource("/").getPath();
walkClassFile(classPath, consumer);
}
}
| [
"[email protected]"
]
| |
cdf25f56ae33e591c5e52ef19c7c2273ccd7ab94 | 3aeed794151a5df6f7ea4980c3705721cac76153 | /backendApi/src/test/java/com/example/swaggerAngSpring/SwaggerAngSpringApplicationTests.java | ab25efe087048cb9c9763a03ab90dd60675cf8ac | []
| no_license | chamathshashika/springboot-angular7-swagger | 6416e0266800ead7f5e48797310665f5eed697dc | 72c03a8a4181abd8d3860a426da7509647a12cf4 | refs/heads/master | 2023-01-13T14:00:27.769335 | 2019-09-06T09:06:17 | 2019-09-06T09:06:17 | 206,756,374 | 0 | 0 | null | 2023-01-07T09:26:10 | 2019-09-06T09:06:52 | TypeScript | UTF-8 | Java | false | false | 355 | java | package com.example.swaggerAngSpring;
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 SwaggerAngSpringApplicationTests {
@Test
public void contextLoads() {
}
}
| [
"[email protected]"
]
| |
3cda09d7ee72352822e999e025d7f47b380441d1 | 5bb22567c8d602907ff4299fc70f053980ac1998 | /src/testClass.java | 69f004317e0136fd7127a6808a9be6b7af64a848 | []
| no_license | orlaithjoyce/test | b203770952ee26cc4ed450381742821b5fd9ecaa | d7d62ccc8a7f5f4833edbb11a1fbb3896ce343b0 | refs/heads/master | 2021-01-11T14:43:32.651216 | 2017-01-27T10:37:28 | 2017-01-27T10:37:28 | 80,197,713 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 108 | java |
public class testClass
{
public static void main(String[] args)
{
System.out.println("Hello");
}
}
| [
"[email protected]"
]
| |
f2fb87dc31760368ecfa01f028fc798392c155ba | 6b76b9b83731fe239d43e47cc4137f3236496124 | /HW11-0036484921/src/hr/fer/zemris/optjava/dz11/evaluators/Evaluator.java | 43d382fd3522e39d5367a0d28782beeb04ec3ac2 | [
"MIT"
]
| permissive | daoos/OptJava-1 | 6ba5141781dfb8d917ab775c7403e0521985847d | ae5350f2a0d4a16a23284cd5d09f08fdf426efbc | refs/heads/master | 2021-12-13T00:58:04.446194 | 2017-03-09T13:13:26 | 2017-03-09T13:13:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,706 | java | package hr.fer.zemris.optjava.dz11.evaluators;
import hr.fer.zemris.optjava.dz11.GrayScaleImage;
import hr.fer.zemris.optjava.dz11.solutions.GASolution;
/**
* Created by Dominik on 20.1.2017..
*/
public class Evaluator implements IGAEvaluator<GASolution<int[]>> {
private GrayScaleImage template;
private ThreadLocal<GrayScaleImage> threadLocal;
public Evaluator(GrayScaleImage template) {
this.template = template;
threadLocal = ThreadLocal.withInitial(() -> new GrayScaleImage(template.getWidth(), template.getHeight()));
}
public GrayScaleImage draw(GASolution<int[]> solution, GrayScaleImage im) {
int[] data = solution.getData();
byte bgcol = (byte) data[0];
im.clear(bgcol);
int n = (data.length - 1) / 5;
int index = 1;
for (int i = 0; i < n; i++) {
im.rectangle(data[index], data[index + 1], data[index + 2], data[index + 3], (byte) data[index +4]);
index += 5;
}
return im;
}
@Override
public void evaluate(GASolution<int[]> solution) {
GrayScaleImage im = threadLocal.get();
draw(solution, im);
byte[] data = im.getData();
byte[] tdata = template.getData();
int w = im.getWidth();
int h = im.getHeight();
double error = 0;
int index2 = 0;
for(int y = 0; y < h; y++) {
for(int x = 0; x < w; x++) {
error += Math.abs(((int) data[index2] & 0xFF) - ((int) tdata[index2] & 0xFF));
index2++;
}
}
solution.fitness = -error;
}
public GrayScaleImage getImage() {
return threadLocal.get();
}
}
| [
"[email protected]"
]
| |
708b0b0f5f50df1caec2260c986e9653e897fd6c | 9b21c5650aaddb7fc0831839744e39ce5a244ded | /Razor-web/src/java/com/chengziting/razor/web/core/annotations/Administrator.java | fcd4ef0bffe4ce278c9580711beae6fcfd7ffb37 | []
| no_license | chengziting/Razor | bb0d0b570044be946d1119272fe13c7a89bb3191 | d1d1750fb214706214d5e8f9e6c98bcde444ad4d | refs/heads/master | 2021-09-11T20:43:56.634586 | 2018-04-12T05:49:49 | 2018-04-12T05:49:49 | 114,941,489 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 423 | java | package com.chengziting.razor.web.core.annotations;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Created by user on 2018-01-16.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(value = {ElementType.TYPE,ElementType.METHOD})
public @interface Administrator {
String []roles() default {"admin"};
} | [
"[email protected]"
]
| |
d784b16eaed86406a5650627c67e8e8442e1187b | ba06f5de7fc26ba0c350d3d3dc08d3f397c9d23e | /src/test/java/stepdefinition/LoginSD.java | fe91a75a4b750a0efc59b59838d88ff9e2f3ac3b | []
| no_license | sevimbalci/BDDFramework_2020 | 37cd441cd755ef29dcfb7372ac6b1a74a8d8318c | 7916670789f495b3bbbaf03b3562a841f4dea247 | refs/heads/master | 2021-05-21T09:12:47.819943 | 2020-04-13T17:39:10 | 2020-04-13T17:39:10 | 252,632,127 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,461 | java | package stepdefinition;
import cucumber.api.java.en.And;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
import org.testng.Assert;
import runnerTest.webPages.LoginPage;
import utils.BasePage;
public class LoginSD {
private LoginPage loginPage = new LoginPage();
@Given("^I am on home page$")
public void iAmOnHomePage(){
Assert.assertEquals(BasePage.get().getCurrentUrl(), "https://www.facebook.com/");
}
@When("^I enter (.+) into (username|password) text fields on home screen$")
public void enterDataUserAndPassField(String anyText, String textFields){
switch (textFields){
case "username":
loginPage.enterEmail(anyText);
break;
case "password":{
loginPage.enterPassword(anyText);
break;
}
}
}
@And("^I click on (login|create account) button on home screen$")
public void clickonButton(String button){
switch (button){
case "login":
loginPage.clickOnLoginButton();
break;
case "create account":
//implement create account object here
break;
}
}
@Then("^I verify that I am in invalid login page$")
public void verifyInvalidLogin(){
Assert.assertEquals(loginPage.getTextElement(), "Log Into Facebook");
}
}
| [
"[email protected]"
]
| |
d75252ea93d4b76ea9c1bef5fc3a8e99f7a74eda | 90b0db3d01cb9d194eeb6495647c77dd93b27c7d | /src/main/java/com/example/erfangame/modules/roles/service/RoleService.java | a5915a25bf887d5701e57769c3431605df8fe319 | []
| no_license | ErfAnDev24/erfangame | ec9ceaa38d6e53b30582eda6fa6b335ced2987c2 | 25ba52d5127735b8730709afbfa9929d3e49e762 | refs/heads/master | 2023-07-18T15:10:59.838801 | 2021-09-04T16:41:02 | 2021-09-04T16:41:02 | 392,655,619 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 980 | java | package com.example.erfangame.modules.roles.service;
import com.example.erfangame.modules.roles.model.Roles;
import com.example.erfangame.modules.roles.repository.RolesRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.transaction.Transactional;
import java.util.List;
import java.util.Optional;
@Service
public class RoleService {
private RolesRepository rolesRepository;
@Autowired
public RoleService(RolesRepository rolesRepository) {
this.rolesRepository = rolesRepository;
}
public List<Roles> findAllRoles() {
return rolesRepository.findAll();
}
public Optional<Roles> findRoleById(Long id) {
return rolesRepository.findById(id);
}
public void registerRole(Roles roles) {
rolesRepository.save(roles);
}
@Transactional
public void deleteRole(Long id) {
rolesRepository.deleteById(id);
}
}
| [
"[email protected]"
]
| |
6e4acd026e1dfcd40b836747c567a7428c9d5225 | 8418d5231661903794a0b74fec5c8112d82d158d | /src/main/java/com/akshay/SumProblem.java | 1d2b7ec23c9983045d9f4bc57a41c79396107746 | []
| no_license | jaiswalakshay/folder-health-monitor | b78a6b1d257f36e3d36595bcd49be2389860bcfa | ca94895bcef3a483d36e8d37f64d110cfcfdfd1c | refs/heads/master | 2021-09-04T01:58:13.802087 | 2018-01-14T09:21:53 | 2018-01-14T09:21:53 | 115,866,113 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,660 | java | package com.akshay;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.util.*;
public class SumProblem {
private static Logger logger = LoggerFactory.getLogger(SumProblem.class);
private static void subArraySum(int arr[], int n, int sum) {
Map<Integer, Integer> map = new HashMap<>();
int curr_sum = 0;
for (int i = 0; i < n; i++) {
// add current element to curr_sum
curr_sum = curr_sum + arr[i];
// if curr_sum is equal to target sum
// we found a subarray starting from index 0
// and ending at index i
if (curr_sum == sum) {
logger.info("Array :" + Arrays.toString(arr) + " nn :" + i + " total1 : " + n + " actual :" + arr.length);
logger.info("SubArray : " + Arrays.toString(Arrays.copyOfRange(arr, 0, i + 1)));
return;
}
// If curr_sum - sum already exists in map
// we have found a subarray with target sum
if (map.get(curr_sum - sum) != null) {
logger.info("SubArray 2: " + Arrays.toString(Arrays.copyOfRange(arr, map.get(curr_sum - sum), i + 1)));
return;
}
map.put(curr_sum, i);
}
logger.info("No subarray with given sum exists");
}
// public static void main(String... arg) {
// int arr[] = {10, 2, -2, -20, 10};
// int n = arr.length;
// int sum = -10;
// logger.info("Array :" + Arrays.toString(arr) + " n :" + n);
// subArraySum(arr, n, sum);
//
// }
public static void main( String [] args ) {
Collection<String> listOne = Arrays.asList("milan", "iga",
"dingo", "iga",
"elpha", "iga",
"hafil", "iga",
"meat", "iga",
"neeta.peeta", "iga");
Collection<String> listTwo = Arrays.asList("hafil",
"iga",
"binga",
"mike",
"dingo", "dingo", "dingo");
Collection<String> similar = new HashSet<String>(listOne);
similar.retainAll(listTwo);
System.out.println(similar);
ObjectMapper mapper = new ObjectMapper();
try {
mapper.readValue("dw", new TypeReference<List<String>>(){});
} catch (IOException e) {
e.printStackTrace();
}
}
}
| [
"[email protected]"
]
| |
c000cd275bbf67182ebe6b7ff40a9a3404069a85 | 783a4a60b892742bc514c66b9fb2ac8533d628a9 | /src/main/java/ru/alishev/springcourse/models/Person.java | 1e46765700ee51ba7ec968f6179086938385beb4 | []
| no_license | Banan4ikk/CRUD_springApp | 5bf01e0e1185052e9ec4f7015505f01f7cf88924 | bf911c9323c7eb2ab139239b8d248bae511986bd | refs/heads/main | 2023-04-07T14:59:35.323739 | 2021-04-21T17:10:51 | 2021-04-21T17:10:51 | 359,929,516 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,445 | java | package ru.alishev.springcourse.models;
import javax.validation.constraints.Email;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Size;
public class Person {
private int id;
@NotEmpty(message = "Error name is empty")
@Size(min = 2, max=30, message = "Your name in incorrect. Name should be between 2 and 30")
private String name;
@Min(value = 0,message = "Age is incorrect. Age should ba greater 0")
private int age;
@NotEmpty(message = "Email is empty. Enter your email")
@Email(message = "Email is incorrect")
private String email;
public Person(){
}
public Person(int id, String name, int age, String email) {
this.id = id;
this.name = name;
this.age = age;
this.email = email;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public Person(int id, String name) {
this.id = id;
this.name = name;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
| [
"[email protected]"
]
| |
85e0dd2faff8d132d80d03a65def10c796a1030b | 29f10f014c85b7fb9cfa8855786683345367eb13 | /src/Tree/CompleteBinaryTree.java | e94ada13ae0e194bd356838c1ac1154f7e4d453c | []
| no_license | fanholiday/MyStructure | 32227d8307157e0b742043c7fd14b4935e014f44 | b2dc1697fe8c3d22b4244d9a4e009365a624e729 | refs/heads/master | 2020-03-27T19:47:52.511248 | 2018-09-01T15:57:32 | 2018-09-01T15:57:32 | 147,011,890 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,072 | java | package Tree;
public class CompleteBinaryTree <T extends Comparable> extends BinaryTree <T>{
public CompleteBinaryTree() {
// TODO Auto-generated constructor stub
node = null;
}
/**
* 以层序遍历构造完全二叉树
* @param levelOrderArray
*/
public CompleteBinaryTree(T[] levelOrderArray){
this.root = create(levelOrderArray, 0);
}
/**
* 层次遍历构造完全二叉树
* @param levelOrderArray
* @param i
* @return
*/
public BinaryNode<T> create(T[] levelOrderArray ,int i){
if(levelOrderArray ==null){
throw new RuntimeException("the param 'array' of create method can\'t be null !");
}
BinaryNode<T> p = null;
if (i<levelOrderArray.length){//递归结束条件
p=new BinaryNode<>(levelOrderArray[i],null,null);
p.left=create(levelOrderArray,2*i+1); //根据完全二叉树的性质 2*i+1 为左孩子结点
p.right=create(levelOrderArray,2*i+2); //2*i+2 为右孩子结点
}
return p;
}
BinaryNode<T> node;
}
| [
"[email protected]"
]
| |
bbb0bb8ac299b24a7d337f3c0b79f95fbfa60d1f | 7c2a935fc98ee9acdd77192fc6749d2c0ec52689 | /src/main/java/com/revolut/money/transfer/exception/AccountAlreadyExistsException.java | 68fad22c0da745ddf8a875580059014959968567 | []
| no_license | ayush-chaubey/revolut-assignment | 10dec4b62ecca487d1503c4f604f8bc9f8d56346 | 11332a164e2298cdce3e4b0df613d7223a5ac3e0 | refs/heads/master | 2022-10-09T15:27:15.768493 | 2019-07-01T02:29:28 | 2019-07-01T02:29:28 | 194,515,305 | 0 | 0 | null | 2022-10-05T19:29:15 | 2019-06-30T12:48:32 | Java | UTF-8 | Java | false | false | 792 | java | package com.revolut.money.transfer.exception;
import javax.ws.rs.core.Response;
import javax.ws.rs.ext.ExceptionMapper;
import javax.ws.rs.ext.Provider;
@Provider
public class AccountAlreadyExistsException extends RuntimeException implements ExceptionMapper<AccountAlreadyExistsException> {
public AccountAlreadyExistsException(Long accountId) {
super("Account with account Number:" + accountId + " already exists");
}
public AccountAlreadyExistsException() {
super();
}
@Override
public Response toResponse(AccountAlreadyExistsException exception) {
return Response
.status(Response.Status.BAD_REQUEST)
.entity(exception.getMessage())
.type("text/plain")
.build();
}
}
| [
"[email protected]"
]
| |
af8c902e5fae87908dcb3f1bb79886cc17b382f2 | ef72a1c3163d44abc41cca71827b552861602f14 | /src/lyu/klt/graduationdesign/moudle/activity/QueryUserActivity.java | ebf42d5c227ed8d099f9f3ece852689256698a89 | []
| no_license | Kanglt/GraduationDesign_KLT_Client | dbc435e702c2e91d6b424bd74c2752008da0dc03 | 2ec265cf820f8057745d1644d4e3473e7d781f57 | refs/heads/master | 2021-01-11T08:20:32.683513 | 2017-01-25T06:23:16 | 2017-01-25T06:23:16 | 72,904,003 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,482 | java | /**
*/
package lyu.klt.graduationdesign.moudle.activity;
import java.util.ArrayList;
import java.util.List;
import org.json.JSONObject;
import com.lyu.graduationdesign_klt.R;
import android.app.Activity;
import android.os.Bundle;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.RecyclerView;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.inputmethod.EditorInfo;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.TextView.OnEditorActionListener;
import lyu.klt.frame.ab.http.AbStringHttpResponseListener;
import lyu.klt.frame.ab.util.AbDialogUtil;
import lyu.klt.frame.ab.util.AbLogUtil;
import lyu.klt.frame.ab.util.AbSharedUtil;
import lyu.klt.frame.ab.util.AbToastUtil;
import lyu.klt.frame.google.gson.Gson;
import lyu.klt.frame.google.gson.reflect.TypeToken;
import lyu.klt.frame.util.StringUtil;
import lyu.klt.graduationdesign.base.BaseActivity;
import lyu.klt.graduationdesign.module.adapter.DynamicFriendsRecyclerAdapter;
import lyu.klt.graduationdesign.module.adapter.MyRecyclerAdapter;
import lyu.klt.graduationdesign.module.adapter.UserInfomationRecyclerAdapter;
import lyu.klt.graduationdesign.module.bean.DynamicPo;
import lyu.klt.graduationdesign.module.bean.UserPo;
import lyu.klt.graduationdesign.moudle.api.ApiHandler;
import lyu.klt.graduationdesign.moudle.api.UserAPI;
import lyu.klt.graduationdesign.moudle.client.Constant;
import lyu.klt.graduationdesign.moudle.client.MyApplication;
import lyu.klt.graduationdesign.util.DataUtils;
import lyu.klt.graduationdesign.view.MyLinearLayoutManger;
import lyu.klt.graduationdesign.view.SpacesItemDecoration;
/**
* @ClassName: AddUserFocusActivity
* @Description: TODO(这里用一句话描述这个类的作用)
* @author 康良涛
* @date 2017年1月19日 下午7:31:19
*
*/
public class QueryUserActivity extends BaseActivity {
private static final String TAG = QueryUserActivity.class
.getSimpleName();
private Activity context;
/**
* titlebar相关组件
*/
private View titlebar_view;// titlebar
private View title_bar_left_img_layout;
private ImageView title_bar_left_img;
private TextView title_bar_text;
private LinearLayout titlebar_right;
private TextView titlebar_right_text;
private RecyclerView rv_user_info;
private UserInfomationRecyclerAdapter mAdapter;
private MyLinearLayoutManger mLayoutManager;
private UserPo userPo;
private List<String> mDatas;
private EditText edi_focusId;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setAbContentView(R.layout.activity_add_user_focus_layout);
init();
}
@Override
public void init() {
// TODO Auto-generated method stub
initUtil();
initData();
initView();
initViewData();
initEvent();
startGame();
}
@Override
public void initUtil() {
// TODO Auto-generated method stub
super.initUtil();
context=this;
MyApplication.getInstance().addActivity(this);
}
@Override
public void initData() {
// TODO Auto-generated method stub
super.initData();
}
@Override
public void initView() {
// TODO Auto-generated method stub
super.initView();
titlebar_view = findViewById(R.id.title_bar_layout);
title_bar_left_img_layout = findViewById(R.id.title_bar_left_img_layout);
title_bar_left_img = (ImageView) findViewById(R.id.title_bar_left_img);
title_bar_text = (TextView) findViewById(R.id.title_bar_text);
titlebar_right = (LinearLayout) titlebar_view.findViewById(R.id.title_bar_right_layout);
titlebar_right_text = (TextView) titlebar_right.findViewById(R.id.title_bar_right_text);
rv_user_info = (RecyclerView) findViewById(R.id.rv_user_info);
edi_focusId=(EditText) findViewById(R.id.edi_focusId);
}
@Override
public void initViewData() {
// TODO Auto-generated method stub
super.initViewData();
title_bar_left_img.setImageDrawable(context.getResources().getDrawable(R.drawable.btn_return2));
title_bar_text.setText("搜索用户");
titlebar_right_text.setVisibility(View.VISIBLE);
titlebar_right_text.setText("搜索");
initRVData();
MyRecyclerAdapter recycleAdapter;
recycleAdapter = new MyRecyclerAdapter(context, mDatas);
rv_user_info.setAdapter(recycleAdapter);
mLayoutManager = new MyLinearLayoutManger(context, LinearLayout.VERTICAL, false);
rv_user_info.setLayoutManager(mLayoutManager);
rv_user_info.setItemAnimator(new DefaultItemAnimator());
// 每项周围的空隙是5,那么项与项之间的间隔就是5+5=10。
SpacesItemDecoration decoration = new SpacesItemDecoration(5);
rv_user_info.addItemDecoration(decoration);
}
@Override
public void initEvent() {
// TODO Auto-generated method stub
super.initEvent();
titlebar_right_text.setOnClickListener(onClickListener);
// edi_focusId.setOnEditorActionListener(new OnEditorActionListener() {
//
// @Override
// public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
// // TODO Auto-generated method stub
// if(actionId==EditorInfo.IME_ACTION_SEND){
// UserAPI.userInformationForMobile(context,edi_focusId.getText().toString(),
// userInformationStringHttpResponseListener);
// return true;
// }
// return false;
// }
// });
}
@Override
public void startGame() {
// TODO Auto-generated method stub
super.startGame();
}
private OnClickListener onClickListener = new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
switch (v.getId()) {
case R.id.title_bar_right_text:
UserAPI.queryPersonalInfo(context,AbSharedUtil.getString(context, Constant.LAST_LOGINID),edi_focusId.getText().toString(),
queryPersonalInfoStringHttpResponseListener);
break;
default:
break;
}
}
};
private AbStringHttpResponseListener queryPersonalInfoStringHttpResponseListener = new AbStringHttpResponseListener() {
@Override
public void onSuccess(int statusCode, String content) {
// TODO Auto-generated method stub
if (!StringUtil.isEmpty(content)) {
try {
JSONObject returncode = new JSONObject(content);
String data = returncode.getString("data");
String type = returncode.getString("type");
if (!ApiHandler.isSccuss(context, type, data)) {
return;
}
// 解密数据
data = DataUtils.getResponseData(context, data);
JSONObject jsonObject = new JSONObject(data);
if (StringUtil.isEmpty(jsonObject.getString("record"))) {
return;
}
Gson gson=new Gson();
userPo = gson.fromJson(jsonObject.getString("record"), new TypeToken<UserPo>() {
}.getType());
mAdapter = new UserInfomationRecyclerAdapter(context, 2, userPo);
rv_user_info.setAdapter(mAdapter);
mAdapter.notifyDataSetChanged();
} catch (Exception e) {
e.printStackTrace();
}
}
}
@Override
public void onStart() {
// TODO Auto-generated method stub
AbLogUtil.d(TAG, "onStart");
// 显示进度框
AbDialogUtil.showProgressDialog(context, 0, "正在查找...");
}
@Override
public void onFinish() {
// TODO Auto-generated method stub
AbLogUtil.d(TAG, "onFinish");
// 移除进度框
//HideProgressDialog();
AbDialogUtil.removeDialog(context);
}
@Override
public void onFailure(int statusCode, String content, Throwable error) {
// TODO Auto-generated method stub
AbLogUtil.d(TAG, "onFailure");
AbToastUtil.showToast(context, error.getMessage());
}
};
private void initRVData() {
mDatas = new ArrayList<String>();
for (int i = 0; i < 1; i++) {
mDatas.add("item" + i);
}
}
// @Override
// public boolean onKeyDown(int keyCode, KeyEvent event) {
// // TODO Auto-generated method stub
// if(keyCode==KeyEvent.KEYCODE_ENTER&&event.getAction()==KeyEvent.ACTION_DOWN){
// UserAPI.userInformationForMobile(context,edi_focusId.getText().toString(),
// userInformationStringHttpResponseListener);
// }
// return super.onKeyDown(keyCode, event);
// }
}
| [
"[email protected]"
]
| |
40eb7176a41fd9209eb43f6cf08b4fa4fab83fbe | 54dc5833e77aabdb8e264d63c19b4b3637a7bc1a | /launcher/src/main/java/org/springframework/boot/loader/thin/MavenSettingsReader.java | c45281506c5134a288edd47a5abc01e5c9ea2224 | [
"Apache-2.0"
]
| permissive | ascheman/spring-boot-thin-launcher | d14a8f58f7638992568c29daf359032a05b368f2 | 7804338d625e2e8c9094e4f615ad866b6f494b20 | refs/heads/master | 2021-01-01T17:34:19.279341 | 2017-07-21T15:18:53 | 2017-07-21T15:18:53 | 98,099,997 | 1 | 1 | null | 2017-07-23T13:32:39 | 2017-07-23T13:32:39 | null | UTF-8 | Java | false | false | 5,528 | java | /*
* Copyright 2012-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.boot.loader.thin;
import java.io.File;
import java.lang.reflect.Field;
import org.apache.maven.settings.Settings;
import org.apache.maven.settings.building.DefaultSettingsBuilderFactory;
import org.apache.maven.settings.building.DefaultSettingsBuildingRequest;
import org.apache.maven.settings.building.SettingsBuildingException;
import org.apache.maven.settings.building.SettingsBuildingRequest;
import org.apache.maven.settings.crypto.DefaultSettingsDecrypter;
import org.apache.maven.settings.crypto.DefaultSettingsDecryptionRequest;
import org.apache.maven.settings.crypto.SettingsDecrypter;
import org.apache.maven.settings.crypto.SettingsDecryptionResult;
import org.eclipse.aether.DefaultRepositorySystemSession;
import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory;
import org.eclipse.aether.repository.LocalRepository;
import org.eclipse.aether.repository.NoLocalRepositoryManagerException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.sonatype.plexus.components.cipher.DefaultPlexusCipher;
import org.sonatype.plexus.components.cipher.PlexusCipherException;
import org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher;
/**
* {@code MavenSettingsReader} reads settings from a user's Maven settings.xml file,
* decrypting them if necessary using settings-security.xml.
*
* @author Andy Wilkinson
* @since 1.3.0
*/
public class MavenSettingsReader {
private static final Logger log = LoggerFactory.getLogger(MavenSettingsReader.class);
private final String homeDir;
public MavenSettingsReader() {
this(System.getProperty("user.home"));
}
public MavenSettingsReader(String homeDir) {
this.homeDir = homeDir;
}
public MavenSettings readSettings() {
Settings settings = loadSettings();
SettingsDecryptionResult decrypted = decryptSettings(settings);
if (!decrypted.getProblems().isEmpty()) {
log.error(
"Maven settings decryption failed. Some Maven repositories may be inaccessible");
// Continue - the encrypted credentials may not be used
}
return new MavenSettings(settings, decrypted);
}
public static void applySettings(MavenSettings settings,
DefaultRepositorySystemSession session) {
if (settings.getLocalRepository() != null) {
try {
session.setLocalRepositoryManager(
new SimpleLocalRepositoryManagerFactory().newInstance(session,
new LocalRepository(settings.getLocalRepository())));
}
catch (NoLocalRepositoryManagerException e) {
throw new IllegalStateException(
"Cannot set local repository to " + settings.getLocalRepository(),
e);
}
}
session.setOffline(settings.getOffline());
session.setMirrorSelector(settings.getMirrorSelector());
session.setAuthenticationSelector(settings.getAuthenticationSelector());
session.setProxySelector(settings.getProxySelector());
}
private Settings loadSettings() {
File settingsFile = new File(this.homeDir, ".m2/settings.xml");
if (settingsFile.exists()) {
log.info("Reading settings from: " + settingsFile);
}
else {
log.info("No settings found at: " + settingsFile);
}
SettingsBuildingRequest request = new DefaultSettingsBuildingRequest();
request.setUserSettingsFile(settingsFile);
request.setSystemProperties(System.getProperties());
try {
return new DefaultSettingsBuilderFactory().newInstance().build(request)
.getEffectiveSettings();
}
catch (SettingsBuildingException ex) {
throw new IllegalStateException(
"Failed to build settings from " + settingsFile, ex);
}
}
private SettingsDecryptionResult decryptSettings(Settings settings) {
DefaultSettingsDecryptionRequest request = new DefaultSettingsDecryptionRequest(
settings);
return createSettingsDecrypter().decrypt(request);
}
private SettingsDecrypter createSettingsDecrypter() {
SettingsDecrypter settingsDecrypter = new DefaultSettingsDecrypter();
setField(DefaultSettingsDecrypter.class, "securityDispatcher", settingsDecrypter,
new SpringBootSecDispatcher());
return settingsDecrypter;
}
private void setField(Class<?> sourceClass, String fieldName, Object target,
Object value) {
try {
Field field = sourceClass.getDeclaredField(fieldName);
field.setAccessible(true);
field.set(target, value);
}
catch (Exception ex) {
throw new IllegalStateException(
"Failed to set field '" + fieldName + "' on '" + target + "'", ex);
}
}
private class SpringBootSecDispatcher extends DefaultSecDispatcher {
private static final String SECURITY_XML = ".m2/settings-security.xml";
SpringBootSecDispatcher() {
File file = new File(MavenSettingsReader.this.homeDir, SECURITY_XML);
this._configurationFile = file.getAbsolutePath();
try {
this._cipher = new DefaultPlexusCipher();
}
catch (PlexusCipherException e) {
throw new IllegalStateException(e);
}
}
}
}
| [
"[email protected]"
]
| |
e3683868d233043e2cabf4054d0aee97c54e249c | ed5159d056e98d6715357d0d14a9b3f20b764f89 | /src/irvine/oeis/a079/A079021.java | 816c253f4bce095a4b71c1a40c7ef9e950709f23 | []
| no_license | flywind2/joeis | c5753169cf562939b04dd246f8a2958e97f74558 | e5efd6971a0062ac99f4fae21a7c78c9f9e74fea | refs/heads/master | 2020-09-13T18:34:35.080552 | 2019-11-19T05:40:55 | 2019-11-19T05:40:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 820 | java | package irvine.oeis.a079;
import irvine.oeis.FiniteSequence;
/**
* A079021 Suppose p and q <code>= p+22</code> are primes. Define the difference pattern of <code>(p,q)</code> to be the successive differences of the primes in the range p to q. There are 51 possible difference patterns, shown in the Comments line. Sequence gives smallest value of p for each difference pattern, sorted by magnitude.
* @author Georg Fischer
*/
public class A079021 extends FiniteSequence {
/** Construct the sequence. */
public A079021() {
super(7, 19, 31, 37, 61, 67, 79, 109, 127, 151, 157, 211, 241, 271, 331, 337, 397, 409, 421, 457, 487, 499, 541, 619, 661, 739, 751, 787, 919, 991, 1069, 1129, 1471, 1531, 1597, 1867, 2221, 2287, 2671, 2707, 2797, 2857, 3187, 3301, 3391, 3637, 4651, 6547, 12637, 17011, 90001);
}
}
| [
"[email protected]"
]
| |
fe5a27feb4688fc501ce6355f10878ee2c12e73d | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/12/12_2316b6aad3e81cc0cd88980acd73d716fd4cdb2d/GATKRunReport/12_2316b6aad3e81cc0cd88980acd73d716fd4cdb2d_GATKRunReport_t.java | ae866f1fdd028a057ecbaf819995a178ab102d3f | []
| 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 | 16,535 | java | /*
* Copyright (c) 2010, The Broad Institute
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
package org.broadinstitute.sting.gatk.phonehome;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.broadinstitute.sting.gatk.CommandLineGATK;
import org.broadinstitute.sting.gatk.GenomeAnalysisEngine;
import org.broadinstitute.sting.gatk.arguments.GATKArgumentCollection;
import org.broadinstitute.sting.gatk.walkers.Walker;
import org.broadinstitute.sting.utils.Utils;
import org.broadinstitute.sting.utils.exceptions.ReviewedStingException;
import org.broadinstitute.sting.utils.exceptions.UserException;
import org.jets3t.service.S3Service;
import org.jets3t.service.S3ServiceException;
import org.jets3t.service.impl.rest.httpclient.RestS3Service;
import org.jets3t.service.model.S3Object;
import org.jets3t.service.security.AWSCredentials;
import org.simpleframework.xml.Element;
import org.simpleframework.xml.ElementList;
import org.simpleframework.xml.Serializer;
import org.simpleframework.xml.core.Persister;
import org.simpleframework.xml.stream.Format;
import org.simpleframework.xml.stream.HyphenStyle;
import java.io.*;
import java.security.NoSuchAlgorithmException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.zip.GZIPOutputStream;
/**
* @author depristo
*
* A detailed description of a GATK run, and error if applicable. Simply create a GATKRunReport
* with the constructor, providing the walker that was run and the fully instantiated GenomeAnalysisEngine
* <b>after the run finishes</b> and the GATKRunReport will collect all of the report information
* into this object. Call postReport to write out the report, as an XML document, to either STDOUT,
* a file (in which case the output is gzipped), or with no arguments the report will be posted to the
* GATK run report database.
*/
public class GATKRunReport {
/**
* The root file system directory where we keep common report data
*/
private static File REPORT_DIR = new File("/humgen/gsa-hpprojects/GATK/reports");
private static final String REPORT_BUCKET_NAME = "GATK_Run_Reports";
/**
* The full path to the direct where submitted (and uncharacterized) report files are written
*/
private static File REPORT_SUBMIT_DIR = new File(REPORT_DIR.getAbsolutePath() + "/submitted");
/**
* Full path to the sentinel file that controls whether reports are written out. If this file doesn't
* exist, no long will be written
*/
private static File REPORT_SENTINEL = new File(REPORT_DIR.getAbsolutePath() + "/ENABLE");
/**
* our log
*/
protected static Logger logger = Logger.getLogger(GATKRunReport.class);
// the listing of the fields is somewhat important; this is the order that the simple XML will output them
@ElementList(required = true, name = "gatk_header_Information")
private List<String> mGATKHeader;
@Element(required = false, name = "id")
private final String id;
@Element(required = false, name = "exception")
private final ExceptionToXML mException;
@Element(required = false, name = "argument_collection")
private final GATKArgumentCollection mCollection;
@Element(required = true, name = "working_directory")
private String currentPath;
@Element(required = true, name = "start_time")
private String startTime = "ND";
@Element(required = true, name = "end_time")
private String endTime;
@Element(required = true, name = "run_time")
private long runTime = 0;
@Element(required = true, name = "command_line")
private String cmdLine = "COULD NOT BE DETERMINED";
@Element(required = true, name = "walker_name")
private String walkerName;
@Element(required = true, name = "svn_version")
private String svnVersion;
@Element(required = true, name = "total_memory")
private long totalMemory;
@Element(required = true, name = "max_memory")
private long maxMemory;
@Element(required = true, name = "java_tmp_directory")
private String tmpDir;
@Element(required = true, name = "user_name")
private String userName;
@Element(required = true, name = "host_name")
private String hostName;
@Element(required = true, name = "java")
private String java;
@Element(required = true, name = "machine")
private String machine;
@Element(required = true, name = "iterations")
private long nIterations;
@Element(required = true, name = "reads")
private long nReads;
public enum PhoneHomeOption {
/** Disable phone home */
NO_ET,
/** Standard option. Writes to local repository if it can be found, or S3 otherwise */
STANDARD,
/** Force output to STDOUT. For debugging only */
STDOUT,
/** Force output to S3. For debugging only */
AWS_S3 // todo -- remove me -- really just for testing purposes
}
private static final DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH.mm.ss");
/**
* Create a new RunReport and population all of the fields with values from the walker and engine
*
* @param walker the GATK walker that we ran
* @param e the exception caused by running this walker, or null if we completed successfully
* @param engine the GAE we used to run the walker, so we can fetch runtime, args, etc
*/
public GATKRunReport(Walker<?,?> walker, Exception e, GenomeAnalysisEngine engine, PhoneHomeOption type) {
if ( type == PhoneHomeOption.NO_ET )
throw new ReviewedStingException("Trying to create a run report when type is NO_ET!");
logger.debug("Aggregating data for run report");
mGATKHeader = CommandLineGATK.createApplicationHeader();
currentPath = System.getProperty("user.dir");
// what did we run?
id = org.apache.commons.lang.RandomStringUtils.randomAlphanumeric(32);
try {
cmdLine = engine.createApproximateCommandLineArgumentString(engine, walker);
} catch (Exception ignore) { }
this.mCollection = engine.getArguments();
walkerName = engine.getWalkerName(walker.getClass());
svnVersion = CommandLineGATK.getVersionNumber();
// runtime performance metrics
Date end = new java.util.Date();
endTime = dateFormat.format(end);
if ( engine.getStartTime() != null ) { // made it this far during initialization
startTime = dateFormat.format(engine.getStartTime());
runTime = (end.getTime() - engine.getStartTime().getTime()) / 1000L; // difference in seconds
}
tmpDir = System.getProperty("java.io.tmpdir");
// deal with memory usage
Runtime.getRuntime().gc(); // call GC so totalMemory is ~ used memory
maxMemory = Runtime.getRuntime().maxMemory();
totalMemory = Runtime.getRuntime().totalMemory();
// we can only do some operations if an error hasn't occurred
if ( engine.getCumulativeMetrics() != null ) {
// it's possible we aborted so early that these data structures arent initialized
nIterations = engine.getCumulativeMetrics().getNumIterations();
nReads = engine.getCumulativeMetrics().getNumReadsSeen();
}
// user and hostname -- information about the runner of the GATK
userName = System.getProperty("user.name");
hostName = "unknown"; // resolveHostname();
// basic java information
java = Utils.join("-", Arrays.asList(System.getProperty("java.vendor"), System.getProperty("java.version")));
machine = Utils.join("-", Arrays.asList(System.getProperty("os.name"), System.getProperty("os.arch")));
// if there was an exception, capture it
this.mException = e == null ? null : new ExceptionToXML(e);
}
public String getID() {
return id;
}
public void postReport(PhoneHomeOption type) {
logger.debug("Posting report of type " + type);
switch (type) {
case NO_ET: // don't do anything
break;
case STANDARD:
if ( repositoryIsOnline() ) {
postReportToLocalDisk(REPORT_SUBMIT_DIR);
} else {
postReportToAWSS3();
}
break;
case STDOUT:
postReportToStream(System.out);
break;
case AWS_S3:
postReportToAWSS3();
break;
default:
exceptDuringRunReport("BUG: unexcepted PhoneHomeOption ");
break;
}
}
/**
* Write an XML representation of this report to the stream, throwing a StingException if the marshalling
* fails for any reason.
*
* @param stream
*/
private void postReportToStream(OutputStream stream) {
Serializer serializer = new Persister(new Format(new HyphenStyle()));
try {
serializer.write(this, stream);
//throw new StingException("test");
} catch (Exception e) {
throw new ReviewedStingException("Failed to marshal the data to the file " + stream, e);
}
}
/**
* Opens the destination file and writes a gzipped version of the XML report there.
*
* @param destination
* @throws IOException
*/
private void postReportToFile(File destination) throws IOException {
BufferedOutputStream out =
new BufferedOutputStream(
new GZIPOutputStream(
new FileOutputStream(destination)));
try {
postReportToStream(out);
} finally {
out.close();
}
}
/**
* Main entry point to writing reports to disk. Posts the XML report to the common GATK run report repository.
* If this process fails for any reason, all exceptions are handled and this routine merely prints a warning.
* That is, postReport() is guarenteed not to fail for any reason.
*/
private File postReportToLocalDisk(File rootDir) {
String filename = getID() + ".report.xml.gz";
File file = new File(rootDir, filename);
try {
postReportToFile(file);
logger.debug("Wrote report to " + file);
return file;
} catch ( Exception e ) {
// we catch everything, and no matter what eat the error
exceptDuringRunReport("Couldn't read report file", e);
file.delete();
return null;
}
}
private void postReportToAWSS3() {
// modifying example code from http://jets3t.s3.amazonaws.com/toolkit/code-samples.html
this.hostName = Utils.resolveHostname(); // we want to fill in the host name
File localFile = postReportToLocalDisk(new File("./"));
logger.debug("Generating GATK report to AWS S3 based on local file " + localFile);
if ( localFile != null ) { // we succeeded in creating the local file
localFile.deleteOnExit();
try {
// stop us from printing the annoying, and meaningless, mime types warning
Logger mimeTypeLogger = Logger.getLogger(org.jets3t.service.utils.Mimetypes.class);
mimeTypeLogger.setLevel(Level.FATAL);
// Your Amazon Web Services (AWS) login credentials are required to manage S3 accounts. These credentials
// are stored in an AWSCredentials object:
// IAM GATK user credentials -- only right is to PutObject into GATK_Run_Report bucket
String awsAccessKey = "AKIAJXU7VIHBPDW4TDSQ"; // GATK AWS user
String awsSecretKey = "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"; // GATK AWS user
AWSCredentials awsCredentials = new AWSCredentials(awsAccessKey, awsSecretKey);
// To communicate with S3, create a class that implements an S3Service. We will use the REST/HTTP
// implementation based on HttpClient, as this is the most robust implementation provided with JetS3t.
S3Service s3Service = new RestS3Service(awsCredentials);
// Create an S3Object based on a file, with Content-Length set automatically and
// Content-Type set based on the file's extension (using the Mimetypes utility class)
S3Object fileObject = new S3Object(localFile);
//logger.info("Created S3Object" + fileObject);
//logger.info("Uploading " + localFile + " to AWS bucket");
S3Object s3Object = s3Service.putObject(REPORT_BUCKET_NAME, fileObject);
logger.debug("Uploaded to AWS: " + s3Object);
} catch ( S3ServiceException e ) {
exceptDuringRunReport("S3 exception occurred", e);
} catch ( NoSuchAlgorithmException e ) {
exceptDuringRunReport("Couldn't calculate MD5", e);
} catch ( IOException e ) {
exceptDuringRunReport("Couldn't read report file", e);
}
}
}
private void exceptDuringRunReport(String msg, Throwable e) {
logger.debug("A problem occurred during GATK run reporting [*** everything is fine, but no report could be generated; please do not post this to the support forum ***]. Message is: " + msg + ". Error message is: " + e.getMessage());
//e.printStackTrace();
}
private void exceptDuringRunReport(String msg) {
logger.debug("A problem occurred during GATK run reporting [*** everything is fine, but no report could be generated; please do not post this to the support forum ***]. Message is " + msg);
}
/**
* Returns true if and only if the common run report repository is available and online to receive reports
*
* @return
*/
private boolean repositoryIsOnline() {
return REPORT_SENTINEL.exists();
}
/**
* A helper class for formatting in XML the throwable chain starting at e.
*/
private class ExceptionToXML {
@Element(required = false, name = "message")
String message = null;
@ElementList(required = false, name = "stacktrace")
final List<String> stackTrace = new ArrayList<String>();
@Element(required = false, name = "cause")
ExceptionToXML cause = null;
@Element(required = false, name = "is-user-exception")
Boolean isUserException;
public ExceptionToXML(Throwable e) {
message = e.getMessage();
isUserException = e instanceof UserException;
for (StackTraceElement element : e.getStackTrace()) {
stackTrace.add(element.toString());
}
if ( e.getCause() != null ) {
cause = new ExceptionToXML(e.getCause());
}
}
}
}
| [
"[email protected]"
]
| |
01cdf1eb34c258a75e9487493638480d55c216d7 | 11c82833b1066d5e48c06ff11de766298f127674 | /open-metadata-implementation/access-services/connected-asset/connected-asset-client/src/main/java/org/odpi/openmetadata/accessservices/connectedasset/client/ConnectedAssetConnections.java | 8af27f271860365b03147abce7d93f2624c41a5b | [
"CC-BY-4.0",
"Apache-2.0"
]
| permissive | PieterJanVanAeken/egeria | 37ac28ee35ac8b395cbe7fb5849741a3d1ffb9ae | 8c71faed767297464ba2bd8396b7b7aa3f1277c5 | refs/heads/master | 2020-03-30T16:09:04.913927 | 2019-03-05T11:35:44 | 2019-03-05T11:35:44 | 148,496,778 | 0 | 0 | Apache-2.0 | 2018-09-12T14:52:25 | 2018-09-12T14:52:24 | null | UTF-8 | Java | false | false | 8,574 | java | /* SPDX-License-Identifier: Apache 2.0 */
/* Copyright Contributors to the ODPi Egeria project. */
package org.odpi.openmetadata.accessservices.connectedasset.client;
import org.odpi.openmetadata.accessservices.connectedasset.ffdc.ConnectedAssetErrorCode;
import org.odpi.openmetadata.accessservices.connectedasset.rest.ConnectionsResponse;
import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException;
import org.odpi.openmetadata.frameworks.connectors.properties.AssetDescriptor;
import org.odpi.openmetadata.frameworks.connectors.properties.ConnectionProperties;
import org.odpi.openmetadata.frameworks.connectors.properties.AssetConnections;
import org.odpi.openmetadata.frameworks.connectors.properties.AssetPropertyBase;
import org.odpi.openmetadata.frameworks.connectors.properties.beans.Connection;
import java.util.ArrayList;
import java.util.List;
/**
* ConnectedAssetConnections provides the open metadata concrete implementation of the
* Open Connector Framework (OCF) AssetConnections abstract class.
* Its role is to query the property servers (metadata repository cohort) to extract connections
* related to the connected asset.
*/
public class ConnectedAssetConnections extends AssetConnections
{
private String serverName;
private String userId;
private String omasServerURL;
private String assetGUID;
private ConnectedAssetUniverse connectedAsset;
private RESTClient restClient;
/**
* Typical constructor creates an iterator with the supplied list of elements.
*
* @param serverName name of the server.
* @param userId user id to use on server calls.
* @param omasServerURL url root of the server to use.
* @param assetGUID unique identifier of the asset.
* @param parentAsset descriptor of parent asset.
* @param totalElementCount the total number of elements to process. A negative value is converted to 0.
* @param maxCacheSize maximum number of elements that should be retrieved from the property server and
* cached in the element list at any one time. If a number less than one is supplied, 1 is used.
* @param restClient client to call REST API
*/
ConnectedAssetConnections(String serverName,
String userId,
String omasServerURL,
String assetGUID,
ConnectedAssetUniverse parentAsset,
int totalElementCount,
int maxCacheSize,
RESTClient restClient)
{
super(parentAsset, totalElementCount, maxCacheSize);
this.serverName = serverName;
this.userId = userId;
this.omasServerURL = omasServerURL;
this.assetGUID = assetGUID;
this.connectedAsset = parentAsset;
this.restClient = restClient;
}
/**
* Copy/clone constructor. Used to reset iterator element pointer to 0;
*
* @param parentAsset descriptor of parent asset
* @param template type-specific iterator to copy; null to create an empty iterator
*/
private ConnectedAssetConnections(ConnectedAssetUniverse parentAsset, ConnectedAssetConnections template)
{
super(parentAsset, template);
if (template != null)
{
this.serverName = template.serverName;
this.userId = template.userId;
this.omasServerURL = template.omasServerURL;
this.assetGUID = template.assetGUID;
this.connectedAsset = parentAsset;
this.restClient = template.restClient;
}
}
/**
* Clones this iterator.
*
* @param parentAsset descriptor of parent asset
* @return new cloned object.
*/
protected AssetConnections cloneIterator(AssetDescriptor parentAsset)
{
return new ConnectedAssetConnections(connectedAsset, this);
}
/**
* Method implemented by a subclass that ensures the cloning process is a deep clone.
*
* @param parentAsset descriptor of parent asset
* @param template object to clone
* @return new cloned object.
*/
protected AssetPropertyBase cloneElement(AssetDescriptor parentAsset, AssetPropertyBase template)
{
return new ConnectionProperties(parentAsset, (ConnectionProperties) template);
}
/**
* Method implemented by subclass to retrieve the next cached list of elements.
*
* @param cacheStartPointer where to start the cache.
* @param maximumSize maximum number of elements in the cache.
* @return list of elements corresponding to the supplied cache pointers.
* @throws PropertyServerException there is a problem retrieving elements from the property (metadata) server.
*/
protected List<AssetPropertyBase> getCachedList(int cacheStartPointer,
int maximumSize) throws PropertyServerException
{
final String methodName = "AssetConnections.getCachedList";
final String urlTemplate = "/servers/{0}/open-metadata/access-services/connected-asset/users/{1}/assets/{2}/connections?elementStart={3}&maxElements={4}";
InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler();
RESTExceptionHandler restExceptionHandler = new RESTExceptionHandler();
invalidParameterHandler.validateOMASServerURL(omasServerURL, methodName);
try
{
ConnectionsResponse restResult = restClient.callConnectionGetRESTCall(methodName,
omasServerURL + urlTemplate,
serverName,
userId,
assetGUID,
cacheStartPointer,
maximumSize);
restExceptionHandler.detectAndThrowInvalidParameterException(methodName, restResult);
restExceptionHandler.detectAndThrowUnrecognizedAssetGUIDException(methodName, restResult);
restExceptionHandler.detectAndThrowUserNotAuthorizedException(methodName, restResult);
restExceptionHandler.detectAndThrowPropertyServerException(methodName, restResult);
List<Connection> beans = restResult.getList();
if ((beans == null) || (beans.isEmpty()))
{
return null;
}
else
{
List<AssetPropertyBase> resultList = new ArrayList<>();
for (Connection bean : beans)
{
if (bean != null)
{
resultList.add(new ConnectionProperties(connectedAsset, bean));
}
}
return resultList;
}
}
catch (Throwable error)
{
ConnectedAssetErrorCode errorCode = ConnectedAssetErrorCode.EXCEPTION_RESPONSE_FROM_API;
String errorMessage = errorCode.getErrorMessageId() + errorCode.getFormattedErrorMessage(error.getClass().getName(),
methodName,
omasServerURL,
error.getMessage());
throw new PropertyServerException(errorCode.getHTTPErrorCode(),
this.getClass().getName(),
methodName,
errorMessage,
errorCode.getSystemAction(),
errorCode.getUserAction(),
error);
}
}
}
| [
"[email protected]"
]
| |
7a6c575a9f63a0e4231c1c4a7045ffde5002498d | 9a8406c11d493c1a4fba530290c5643ec9cccbf2 | /src/pratikum/pkg2/string.java | 7659d53526ef6fdf5484919a90eb361120df8197 | []
| no_license | Yeremia395/Jobsheet-5 | 19e12fa1d889401b5b3557ee2354369f49942b57 | 4c59fbb70bfb70ce8222f3bf2c45aade44ecff0c | refs/heads/master | 2020-07-08T17:23:39.564083 | 2019-08-22T06:53:58 | 2019-08-22T06:53:58 | 203,731,677 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 267 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package pratikum.pkg2;
/**
*
* @author Yeremia Rizky
*/
class string {
}
| [
"[email protected]"
]
| |
f6cc5d24ffc9992d1857c9f5bfa6757d55c30d2a | fa4515568e90b36d2ff81dd8fecd3d80543835b7 | /Release.java | 5d667ac89a3ea6efe5880a4e09c26f2c1ebc3447 | []
| no_license | lpotherat/discogs-data | 49b741a9f7d05cb3bf7a2738cb84f65013f93dc7 | 4089a609b190bdbd49ad50eeb6af4d0b2e6f8a8f | refs/heads/master | 2020-03-17T03:24:28.313268 | 2018-05-13T13:14:17 | 2018-05-13T13:14:17 | 133,233,948 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,871 | java |
public class Release {
private String status;
private String thumb;
private String format;
private String title;
private String catno;
private int year;
private String resourceUrl;
private String artist;
private int id;
/**
* No args constructor for use in serialization
*
*/
public Release() {
}
/**
*
* @param id
* @param catno
* @param title
* @param status
* @param year
* @param artist
* @param format
* @param resourceUrl
* @param thumb
*/
public Release(String status, String thumb, String format, String title, String catno, int year, String resourceUrl, String artist, int id) {
super();
this.status = status;
this.thumb = thumb;
this.format = format;
this.title = title;
this.catno = catno;
this.year = year;
this.resourceUrl = resourceUrl;
this.artist = artist;
this.id = id;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getThumb() {
return thumb;
}
public void setThumb(String thumb) {
this.thumb = thumb;
}
public String getFormat() {
return format;
}
public void setFormat(String format) {
this.format = format;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getCatno() {
return catno;
}
public void setCatno(String catno) {
this.catno = catno;
}
public int getYear() {
return year;
}
public void setYear(int year) {
this.year = year;
}
public String getResourceUrl() {
return resourceUrl;
}
public void setResourceUrl(String resourceUrl) {
this.resourceUrl = resourceUrl;
}
public String getArtist() {
return artist;
}
public void setArtist(String artist) {
this.artist = artist;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
}
| [
"[email protected]"
]
| |
45484475ec076f2f504d36c958744bdc53f6546d | 230856ef97bcaf28c32cbb7458b2209b102cbb44 | /AP-Spring-2018/Slides & Sample Codes/2/chapter01/picture/Circle.java | b7b6996cfec3eaa2a46dc89204fcba369029f274 | []
| no_license | aut-ce/CE104-AP | c67265e0930e3c9d28f3888a0f0a2dd1a29a7ec4 | b0255116bf70e4d4f183c2a6189a38e9e19e5bd4 | refs/heads/master | 2023-06-02T14:03:18.323874 | 2021-06-26T23:31:23 | 2021-06-26T23:31:23 | 224,835,149 | 8 | 2 | null | 2021-06-26T23:31:24 | 2019-11-29T10:48:54 | Java | UTF-8 | Java | false | false | 3,761 | java | import java.awt.*;
import java.awt.geom.*;
/**
* A circle that can be manipulated and that draws itself on a canvas.
*
* @author Michael Kolling and David J. Barnes
* @version 2008.03.30
*/
public class Circle
{
private int diameter;
private int xPosition;
private int yPosition;
private String color;
private boolean isVisible;
/**
* Create a new circle at default position with default color.
*/
public Circle()
{
diameter = 30;
xPosition = 20;
yPosition = 60;
color = "blue";
isVisible = false;
}
/**
* Make this circle visible. If it was already visible, do nothing.
*/
public void makeVisible()
{
isVisible = true;
draw();
}
/**
* Make this circle invisible. If it was already invisible, do nothing.
*/
public void makeInvisible()
{
erase();
isVisible = false;
}
/**
* Move the circle a few pixels to the right.
*/
public void moveRight()
{
moveHorizontal(20);
}
/**
* Move the circle a few pixels to the left.
*/
public void moveLeft()
{
moveHorizontal(-20);
}
/**
* Move the circle a few pixels up.
*/
public void moveUp()
{
moveVertical(-20);
}
/**
* Move the circle a few pixels down.
*/
public void moveDown()
{
moveVertical(20);
}
/**
* Move the circle horizontally by 'distance' pixels.
*/
public void moveHorizontal(int distance)
{
erase();
xPosition += distance;
draw();
}
/**
* Move the circle vertically by 'distance' pixels.
*/
public void moveVertical(int distance)
{
erase();
yPosition += distance;
draw();
}
/**
* Slowly move the circle horizontally by 'distance' pixels.
*/
public void slowMoveHorizontal(int distance)
{
int delta;
if(distance < 0)
{
delta = -1;
distance = -distance;
}
else
{
delta = 1;
}
for(int i = 0; i < distance; i++)
{
xPosition += delta;
draw();
}
}
/**
* Slowly move the circle vertically by 'distance' pixels.
*/
public void slowMoveVertical(int distance)
{
int delta;
if(distance < 0)
{
delta = -1;
distance = -distance;
}
else
{
delta = 1;
}
for(int i = 0; i < distance; i++)
{
yPosition += delta;
draw();
}
}
/**
* Change the size to the new size (in pixels). Size must be >= 0.
*/
public void changeSize(int newDiameter)
{
erase();
diameter = newDiameter;
draw();
}
/**
* Change the color. Valid colors are "red", "yellow", "blue", "green",
* "magenta" and "black".
*/
public void changeColor(String newColor)
{
color = newColor;
draw();
}
/**
* Draw the circle with current specifications on screen.
*/
private void draw()
{
if(isVisible) {
Canvas canvas = Canvas.getCanvas();
canvas.draw(this, color, new Ellipse2D.Double(xPosition, yPosition,
diameter, diameter));
canvas.wait(10);
}
}
/**
* Erase the circle on screen.
*/
private void erase()
{
if(isVisible) {
Canvas canvas = Canvas.getCanvas();
canvas.erase(this);
}
}
}
| [
"[email protected]"
]
| |
49f213504aa7e852a05b423fdf4833af58175494 | 9cdcc9e5437f7c2b9fdbe5135016ce63e6f5c688 | /src/main/java/dr/web/basis/bean/Auth_groupBean.java | 4d62553c38ec41c51831009c0566426472b4d681 | []
| no_license | DreamInception/pc1.0 | a0307cf5e2355a63ba8de562952e3902aacfc80c | 1a1db34762a4d3f70d45d47c09f92e7c5fb98af3 | refs/heads/master | 2021-01-13T07:38:20.166292 | 2016-10-20T14:54:12 | 2016-10-20T14:54:12 | 71,473,454 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,370 | java | /**
* 包名: dr.web.basis.controller
* 文件名: Bean.java
* 描述: 登录相关操作
* 创建人: 陈吉秋特
* 创建时间: 2016-3-16下午5:00:00
* 版权: 2016 景源金服版权所有
*/
package dr.web.basis.bean;
import dr.web.common.bean.BaseBean;
/**
*
* @包名 :dr.web.basis.controller
* @文件名 :Auth_groupBean.java
* @系统名称 : 上海景源金服PC端
* @Author: 陈吉秋特
* @Date: 2014-6-4 上午9:56:20
* @版本号 :v0.0.01
*/
public class Auth_groupBean extends BaseBean {
/**用户组id,自增主键*/public static final String id = "id" ; /**用户组所属模块*/public static final String module = "module" ; /**组类型*/public static final String type = "type" ; /**用户组中文名称*/public static final String title = "title" ; /**描述信息*/public static final String description = "description" ; /**用户组状态:为1正常,为0禁用,-1为删除*/public static final String status = "status" ; /**用户组拥有的规则id,多个规则 , 隔开*/public static final String rules = "rules" ;
}
| [
"[email protected]"
]
| |
56112cea47d04cc829d0df918c7ff8730866014d | 1b69725948e8a617636fedf6c719feacaab6ce01 | /ShopXX/src/main/java/net/shop/controller/admin/OrderStatisticController.java | 6360310365d46d90b6a6bc58fb3bb26ff5b92ef7 | []
| no_license | yezhen125240/yezhen.github.io | a50bb04a78b5bae52eecf2a230da7a68f594451e | 1585e64677896aa6105941e1f0811fd6da97aa43 | refs/heads/master | 2021-05-10T16:18:29.248446 | 2018-02-01T06:20:40 | 2018-02-01T06:20:40 | 118,574,371 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,801 | java | /*
* Support: http://www.shopxx.net
* License: http://www.shopxx.net/license
*/
package net.shop.controller.admin;
import java.util.Date;
import javax.annotation.Resource;
import net.shop.entity.Statistic;
import net.shop.service.StatisticService;
import org.apache.commons.lang.time.DateUtils;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
/**
* Controller - 订单统计
*
* @author SHOP++ Team
* @version 4.0
*/
@Controller("adminOrderStatisticController")
@RequestMapping("/admin/order_statistic")
public class OrderStatisticController extends BaseController {
@Resource(name = "statisticServiceImpl")
private StatisticService statisticService;
/**
* 列表
*/
@RequestMapping(value = "/list", method = RequestMethod.GET)
public String list(Statistic.Period period, Date beginDate, Date endDate, Model model) {
if (period == null) {
period = Statistic.Period.day;
}
if (beginDate == null) {
switch (period) {
case year:
beginDate = DateUtils.addYears(new Date(), -10);
break;
case month:
beginDate = DateUtils.addYears(new Date(), -1);
break;
case day:
beginDate = DateUtils.addMonths(new Date(), -1);
break;
}
}
if (endDate == null) {
endDate = new Date();
}
model.addAttribute("periods", Statistic.Period.values());
model.addAttribute("period", period);
model.addAttribute("beginDate", beginDate);
model.addAttribute("endDate", endDate);
model.addAttribute("statistics", statisticService.analyze(period, beginDate, endDate));
return "/admin/order_statistic/list";
}
} | [
"[email protected]"
]
| |
08384dcfae08cb79c04c4c527ac5f2294c88667c | 691b9eaab1cdbf62989a383c4162f2ef323bd443 | /src/org/bird/gui/controllers/DataSheetController.java | 382306692c711675da4dd85339934d3e57539bd6 | []
| no_license | smoers/BirdNew | 873a15fd4aa3a99691ab9a0d21c25f15811ea9f3 | fa1131ba47fdff7d0fc35d7cc17516c9c028078c | refs/heads/master | 2020-04-15T17:12:02.263046 | 2019-11-04T12:27:03 | 2019-11-04T12:27:03 | 164,865,133 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,275 | java | package org.bird.gui.controllers;
import org.bird.gui.events.OnLeftClickEvent;
import org.bird.gui.listeners.OnLeftClickListener;
import java.util.ArrayList;
import java.util.function.Consumer;
public abstract class DataSheetController<T> extends ProtectedController implements IDataSheetController<T> {
protected ArrayList<OnLeftClickListener> onLeftClickListeners = new ArrayList<>();
public DataSheetController() {
setInternationalizationBundle(internationalizationBuilder.getInternationalizationBundle(getClass()));
}
@Override
public abstract void update(T item);
/**
* Ajoute un écouteur sur les boutons
* @param listener
*/
@Override
public void addOnLeftClickListener(OnLeftClickListener listener){
onLeftClickListeners.add(listener);
}
/**
* Notifie les écouteurs qu'un bouton a été pressé
* @param evt
*/
protected void notifyOnLeftClickListener(OnLeftClickEvent evt){
onLeftClickListeners.forEach(new Consumer<OnLeftClickListener>() {
@Override
public void accept(OnLeftClickListener listener) {
listener.onLeftClick(evt);
}
});
}
@Override
public abstract void setLanguage();
}
| [
"[email protected]"
]
| |
808ec200fa91658f1116192fd6f4a6d319c47ffe | 642d866e30716f0388e7f7c972a9a59e1d056268 | /PetDayCare_EnriqueT/app/src/main/java/com/example/petdaycare_enriquet/Pets.java | 3e755114ae35d088ed6c4be1bb3a534007101335 | []
| no_license | enriquetentor/carlospati | 8c7f013ce851e8e83fa873922caa2b1d55f7be3c | ff86a6b50251ac48c5b0e9e7b62e729a78dd851d | refs/heads/main | 2023-04-20T08:16:54.746814 | 2021-05-15T15:29:12 | 2021-05-15T15:29:12 | 367,665,507 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 965 | java | package com.example.petdaycare_enriquet;
public class Pets {
private String Name;
private String Breed;
private String Gender;
private double Weight;
public Pets(String name, String breed, String gender, double weight) {
Name = name;
Breed = breed;
Gender = gender;
Weight = weight;
}
Pets(String name, String breed) {
Name = name;
Breed = breed;
}
public String getName() {
return Name;
}
public void setName(String name) {
Name = name;
}
public String getBreed() {
return Breed;
}
public void setBreed(String breed) {
Breed = breed;
}
public String getGender() {
return Gender;
}
public void setGender(String gender) {
Gender = gender;
}
public double getWeight() {
return Weight;
}
public void setWeight(double weight) {
Weight = weight;
}
}
| [
"[email protected]"
]
| |
8616e290154504a6c87c9c6a7c0ebeed305a5987 | 0ae9455f8602eaf225972f5912eea09227580dc4 | /DersteSpinnerOrnek/gen/com/example/derstespinnerornek/R.java | f986344a463850e05eceeddfdb7848bdaf2457cb | []
| no_license | canmurat/myworkspace | 7fcb269ae881557ad4cd31450e6a8644311a8de2 | 7ddc97a40609b652cf2b7e5304b1c29a4d4b4393 | refs/heads/master | 2016-09-06T00:27:08.858902 | 2014-04-01T19:46:56 | 2014-04-01T19:46:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,835 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package com.example.derstespinnerornek;
public final class R {
public static final class array {
public static final int spinner1_entries=0x7f060000;
}
public static final class attr {
}
public static final class dimen {
/** Default screen margins, per the Android Design guidelines.
Customize dimensions originally defined in res/values/dimens.xml (such as
screen margins) for sw720dp devices (e.g. 10" tablets) in landscape here.
*/
public static final int activity_horizontal_margin=0x7f040000;
public static final int activity_vertical_margin=0x7f040001;
}
public static final class drawable {
public static final int ic_launcher=0x7f020000;
}
public static final class id {
public static final int action_settings=0x7f090002;
public static final int spinner1=0x7f090000;
public static final int textView1=0x7f090001;
}
public static final class layout {
public static final int activity_main=0x7f030000;
}
public static final class menu {
public static final int main=0x7f080000;
}
public static final class string {
public static final int action_settings=0x7f050001;
public static final int app_name=0x7f050000;
public static final int hello_world=0x7f050002;
public static final int spinnerpromt=0x7f050003;
public static final int textmetin=0x7f050004;
}
public static final class style {
/**
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
Base application theme for API 11+. This theme completely replaces
AppBaseTheme from res/values/styles.xml on API 11+ devices.
API 11 theme customizations can go here.
Base application theme for API 14+. This theme completely replaces
AppBaseTheme from BOTH res/values/styles.xml and
res/values-v11/styles.xml on API 14+ devices.
API 14 theme customizations can go here.
*/
public static final int AppBaseTheme=0x7f070000;
/** Application theme.
All customizations that are NOT specific to a particular API-level can go here.
*/
public static final int AppTheme=0x7f070001;
}
}
| [
"[email protected]"
]
| |
3c88a54a97972331407916646edd0c15f0b8749c | 3b54b58ac613f8c08c4ed9af322b0d46b491a22c | /src/com/sproutlife/renderer/Dimension2Double.java | a231fa44c408decdc0c60c45c519590914a32275 | [
"MIT"
]
| permissive | ShprAlex/SproutLife | f45b31c0484bc6f952aecc618b397e617fffee59 | b07eb5474f5ad063770bb887a3b035b043fa0e0e | refs/heads/master | 2022-07-27T16:53:08.910410 | 2022-07-17T17:32:19 | 2022-07-17T17:32:19 | 49,777,163 | 610 | 33 | MIT | 2019-12-26T22:07:51 | 2016-01-16T14:43:33 | Java | UTF-8 | Java | false | false | 563 | java | package com.sproutlife.renderer;
import java.awt.geom.Dimension2D;
public class Dimension2Double extends Dimension2D {
private double width;
private double height;
public Dimension2Double(double width, double height) {
setSize(width, height);
}
@Override
public double getWidth() {
return width;
}
@Override
public double getHeight() {
return height;
}
@Override
public void setSize(double width, double height) {
this.width = width;
this.height = height;
}
}
| [
"[email protected]"
]
| |
5d46ee958a012a4350f6fc92d7a9103c4e4db0c5 | b77819983a74ed4383ad476b17fb432cefafc0cb | /src/Initialization/ArrayInit.java | 2e10c9a370389397fa812315200a1efb12746a21 | []
| no_license | noman17rus/Education | 46a27e6b49598c78e7f3c333f14af4e7c618b1c9 | a9ccc4b506b62f87a4047c56c900fdacea3ab0c3 | refs/heads/master | 2023-01-24T02:56:11.472368 | 2020-12-05T21:24:00 | 2020-12-05T21:24:00 | 317,555,462 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 638 | java | package Initialization;
import java.util.Arrays;
/**
* Массивы так же можно инициализировать списком в фигруных скобках
*/
public class ArrayInit {
public static void main(String[] args) {
Integer[] a = {
new Integer(1),
new Integer(2),
new Integer(3),
4
};
Integer[] b = new Integer[] {
new Integer(1),
new Integer(2),
3
};
System.out.println(Arrays.toString(a));
System.out.println(Arrays.toString(b));
}
}
| [
"[email protected]"
]
| |
2d861237b6c9503b02467d2c9e6a58edc33dd7c9 | 67ae6fb46bea9caca22aa4ce44e067a91264f00d | /FachlicherAdministrator/src/main/java/faeteam3/FachlicherAdministrator/Controller/WorkerService.java | 28d3dfddb2bba4f6aabbe0ae446e18251a2e3e12 | []
| no_license | Archi-Lab/fae-team-3 | 4c7105e541880a89e5eb7cada07f73a8d76072b4 | b9ab2aa77c3642ca13c34203aeb79eeaf01bda45 | refs/heads/master | 2020-04-02T12:56:00.876275 | 2019-02-25T16:25:21 | 2019-02-25T16:25:21 | 154,458,968 | 0 | 0 | null | 2019-02-25T16:25:22 | 2018-10-24T07:38:56 | Java | UTF-8 | Java | false | false | 1,541 | java | package faeteam3.FachlicherAdministrator.Controller;
import java.io.IOException;
import java.lang.reflect.Field;
import java.util.Map;
import org.json.JSONException;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fasterxml.jackson.databind.ObjectMapper;
@Service
public class WorkerService
{
private static final Logger LOGGER =
LoggerFactory.getLogger(WorkerService.class);
public WorkerService()
{
}
public void bearbeiteMessageBPMetar(String val)
{
ObjectMapper objectMapper = new ObjectMapper();
Map<String, String> empMap = null;
try {
empMap = objectMapper.readValue(val,Map.class);
} catch (IOException e1) {
e1.printStackTrace();
}
for (Map.Entry<String, String> entry : empMap.entrySet())
{
String key = entry.getKey();
String value = entry.getValue();
LOGGER.info("Key: {} Value {} ",key, value);
if(key == "id")
{
; // vlt. in notlage speichern origin of notlage mit type
}
else if(key == "extraInfo")
{
; // use value
}
else if(key == "data2")
{
; // vlt. in notlage speichern origin of notlage mit type
}
else if(key == "dvp_id")
{
;
}
}
}
}
| [
"[email protected]"
]
| |
7cc2f5448fafdd3eda714db6d2965152ab6833aa | 2e66c37c4e2584c31f553e361616868b23749ac5 | /src/test/java/com/example/studentsdb/stydentsdb/StydentsdbApplicationTests.java | b8a2ac4863e703d882e2122637770d592816c2e2 | []
| no_license | Georgly/StudentsDB | a6aa6ebbfc416cfa99058b658c38509ab2208eb5 | 0fece68f2fa0a9bb950dd9c5f9741771d7c7a3a9 | refs/heads/master | 2021-05-12T10:49:55.429294 | 2018-01-13T17:45:33 | 2018-01-13T17:45:33 | 117,363,730 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 354 | java | package com.example.studentsdb.stydentsdb;
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 StydentsdbApplicationTests {
@Test
public void contextLoads() {
}
}
| [
"[email protected]"
]
| |
d29a9b57fb4be18e340dc38ad2aae130093bdfad | 4b5986a3eeeea6bc1f44040291c02a2377097e93 | /java/original/user_service/server/src/main/java/com.solo.coderiver.user/service/impl/UserTeamServiceImpl.java | 3ab72a79829a838f965e8808ed7eae6219c0adc6 | []
| no_license | SharkLaka/coderiver | f9fbd204bda8b13b4e3fe0fd7d7caa942f834536 | cda38d0a9b47ef1b4983cd0e62c6f617ad02cd09 | refs/heads/master | 2020-04-08T18:04:27.385339 | 2018-11-26T02:11:38 | 2018-11-26T02:11:38 | 159,592,564 | 1 | 0 | null | 2018-11-29T02:01:31 | 2018-11-29T02:01:30 | null | UTF-8 | Java | false | false | 959 | java | package com.solo.coderiver.user.service.impl;
import com.solo.coderiver.user.dataobject.UserTeamRelation;
import com.solo.coderiver.user.repository.UserTeamRepository;
import com.solo.coderiver.user.service.UserTeamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@Service
public class UserTeamServiceImpl implements UserTeamService {
@Autowired
UserTeamRepository repository;
@Override
@Transactional
public UserTeamRelation save(UserTeamRelation relation) {
return repository.save(relation);
}
@Override
public List<UserTeamRelation> findByUserId(String userId) {
return repository.findByUserId(userId);
}
@Override
public List<UserTeamRelation> findByTeamId(String teamId) {
return repository.findByTeamId(teamId);
}
}
| [
"[email protected]"
]
| |
35b452a49daa762372bda2f6bb88911571677a72 | a71bb967f1e751ac4adb3a98e83c2f1ce18c6869 | /backend/build/generated-source/endpoints/java/com/etechtour/builditbigger/backend/myApi/MyApiRequestInitializer.java | 7eab1451e388a34d6babddf0e2be029b7810b9d1 | []
| no_license | kittcoldfire/BuildItBigger-Phil | 0388d62e44eeba163466b1a05d90d71fd03ffd0a | 93efb1a72e8852548a743d0ab425cb88ee70e9d7 | refs/heads/master | 2021-01-10T08:26:04.916959 | 2015-11-16T23:13:00 | 2015-11-16T23:13:00 | 46,304,946 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,434 | java | /*
* 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.
*/
/*
* This code was generated by https://code.google.com/p/google-apis-client-generator/
* (build: 2015-08-03 17:34:38 UTC)
* on 2015-11-16 at 21:16:47 UTC
* Modify at your own risk.
*/
package com.etechtour.builditbigger.backend.myApi;
/**
* MyApi request initializer for setting properties like key and userIp.
*
* <p>
* The simplest usage is to use it to set the key parameter:
* </p>
*
* <pre>
public static final GoogleClientRequestInitializer KEY_INITIALIZER =
new MyApiRequestInitializer(KEY);
* </pre>
*
* <p>
* There is also a constructor to set both the key and userIp parameters:
* </p>
*
* <pre>
public static final GoogleClientRequestInitializer INITIALIZER =
new MyApiRequestInitializer(KEY, USER_IP);
* </pre>
*
* <p>
* If you want to implement custom logic, extend it like this:
* </p>
*
* <pre>
public static class MyRequestInitializer extends MyApiRequestInitializer {
{@literal @}Override
public void initializeMyApiRequest(MyApiRequest{@literal <}?{@literal >} request)
throws IOException {
// custom logic
}
}
* </pre>
*
* <p>
* Finally, to set the key and userIp parameters and insert custom logic, extend it like this:
* </p>
*
* <pre>
public static class MyRequestInitializer2 extends MyApiRequestInitializer {
public MyKeyRequestInitializer() {
super(KEY, USER_IP);
}
{@literal @}Override
public void initializeMyApiRequest(MyApiRequest{@literal <}?{@literal >} request)
throws IOException {
// custom logic
}
}
* </pre>
*
* <p>
* Subclasses should be thread-safe.
* </p>
*
* @since 1.12
*/
public class MyApiRequestInitializer extends com.google.api.client.googleapis.services.json.CommonGoogleJsonClientRequestInitializer {
public MyApiRequestInitializer() {
super();
}
/**
* @param key API key or {@code null} to leave it unchanged
*/
public MyApiRequestInitializer(String key) {
super(key);
}
/**
* @param key API key or {@code null} to leave it unchanged
* @param userIp user IP or {@code null} to leave it unchanged
*/
public MyApiRequestInitializer(String key, String userIp) {
super(key, userIp);
}
@Override
public final void initializeJsonRequest(com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest<?> request) throws java.io.IOException {
super.initializeJsonRequest(request);
initializeMyApiRequest((MyApiRequest<?>) request);
}
/**
* Initializes MyApi request.
*
* <p>
* Default implementation does nothing. Called from
* {@link #initializeJsonRequest(com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest)}.
* </p>
*
* @throws java.io.IOException I/O exception
*/
protected void initializeMyApiRequest(MyApiRequest<?> request) throws java.io.IOException {
}
}
| [
"[email protected]"
]
| |
da004ea1f5f697b598ea20a2219920f77c32d1e1 | 6342d1e0179bab61ddf478f7038ca661baf62db3 | /bbm/src/main/java/com/bbxiaoqu/comm/service/db/MemberTsService.java | c539173a5337c498b7b5c9a6b5cb72c5015c891f | []
| no_license | 594904292/xiangzhujava | 5f4ced982c637b8758688bbee7e23c2b516a1ddb | f346b6f251a692366c1344c15e296207b7295404 | refs/heads/master | 2020-06-12T06:00:32.658848 | 2017-02-20T11:00:25 | 2017-02-20T11:00:25 | 75,601,804 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,932 | java | package com.bbxiaoqu.comm.service.db;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import com.bbxiaoqu.comm.tool.L;
import java.util.ArrayList;
import java.util.List;
public class MemberTsService {
public DatabaseHelper dbHelper;
public MemberTsService(Context context){
dbHelper=new DatabaseHelper(context);
}
public ArrayList<String> getmemberids(String userid) {
List<String> guidlist = new ArrayList<String>();
SQLiteDatabase sdb = dbHelper.getReadableDatabase();
String sql="";
sql = "select * from memberts where userid=?";
L.i("query",sql);
String obj[]=new String[]{userid};
Cursor c = sdb.rawQuery(sql, obj);
while (c.moveToNext()) {
guidlist.add(String.valueOf(c.getString(1).toString()));
}
c.close();
sdb.close();
return (ArrayList<String>) guidlist;
}
public boolean addts(String memberid,String userid){
SQLiteDatabase sdb=dbHelper.getReadableDatabase();
String sql="insert into memberts (memberid,userid) values(?,?)";
Object obj[]={memberid,userid};
sdb.execSQL(sql, obj);
sdb.close();
return true;
}
public boolean removets(String memberid,String userid){
SQLiteDatabase sdb=dbHelper.getReadableDatabase();
String sql="delete from memberts where memberid=? and userid=?";
Object obj[]={memberid,userid};
sdb.execSQL(sql, obj);
sdb.close();
return true;
}
public boolean isexit(String memberid,String userid) {
// 读写数据库
SQLiteDatabase sdb=dbHelper.getReadableDatabase();
String sql="select * from memberts where memberid=? and userid=?";
Cursor cursor=sdb.rawQuery(sql, new String[]{memberid,userid});
if(cursor.moveToFirst()==true){
cursor.close();
sdb.close();
return true;
}
cursor.close();
sdb.close();
return false;
}
public void close() {
if (dbHelper != null) {
dbHelper.close();
}
}
}
| [
"[email protected]"
]
| |
34adb8b566bb8c74d310725ef18eab1ba8e63b7a | 24f6caba1a5e477527fdbd926512fe3dae3acd1c | /Help-Sessions/0302/src/lsp/ShapeAreaCalculator.java | 3619a54a7014075315d508361910462aaff1605c | []
| no_license | ayubjuda/sdp-sp3-2021-repo-code | cd7fd4a0a1e0a5f85160d7775b48e796bb50e54b | 87c7dcdabb021b8b9d6b4d7bb01720daa1dc97f2 | refs/heads/main | 2023-05-08T00:00:34.159047 | 2021-05-23T11:24:33 | 2021-05-23T11:24:33 | 406,274,128 | 1 | 0 | null | 2021-09-14T07:49:06 | 2021-09-14T07:49:05 | null | UTF-8 | Java | false | false | 218 | java | package lsp;
import java.util.List;
class ShapeAreaCalculator {
static double sumOfArea(List<? extends Shape> lt){
double sum = 0;
for (Shape r : lt) {
sum += r.getArea();
}
return sum;
}
}
| [
"[email protected]"
]
| |
6ff63fb1b7e3e839ad7d3dbe99b4101ce701f285 | eb29c48427ac279e7a3bba4205d2954280e9331c | /src/main/java/me/suiremc/core/commands/CommandBase.java | 9965d1261114df676178c4ed6c69a9983fb38dd1 | []
| no_license | JustCallMeHims/Suire-Core | b10e8f261fd43e4e83922294ecd85054a93e7fee | 88af0a9cdec8349916cde05e2796ecc8cd2bebd0 | refs/heads/master | 2020-04-26T20:55:25.650552 | 2018-10-26T18:22:52 | 2018-10-26T18:22:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,914 | java | package me.suiremc.core.commands;
import com.google.common.collect.Lists;
import me.suiremc.core.util.ChatUtil;
import org.apache.commons.lang.ArrayUtils;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import java.util.Arrays;
import java.util.List;
public abstract class CommandBase implements CommandExecutor {
private String name;
private String[] aliases;
private String[] description;
private String permission;
private List<SubCommand> subCommands = Lists.newArrayList();
public CommandBase(String name, String permission, String... aliases){
this.name = name;
this.permission = permission;
this.aliases = aliases;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if(permission != null && !sender.hasPermission(permission)){
// send message
return true;
}
if(args.length > 0){
SubCommand subCommand = getSubCommand(args[0]);
if(subCommand != null)
return subCommand.processCommand(sender, this, args.length == 1 ?
new String[0] : (String[])ArrayUtils.remove(args, 0));
}
return onCommand(sender, this, args);
}
public SubCommand getSubCommand(String name){
return subCommands.stream().filter(s->s.isSubCommand(name))
.findFirst().orElse(null);
}
public void addSubCommand(SubCommand subCommand){
subCommands.add(subCommand);
}
public static void sendHelpMenu(CommandSender target, CommandBase commandBase){
//TODO: Move to config
ChatUtil.sendMsg(target, "&3&l<~>&aHelp Menu&3&l<~>");
StringBuilder stringBuilder = new StringBuilder();
for(SubCommand subCommand: commandBase.getSubCommands()){
if(subCommand.getPermission() != null && !target.hasPermission(subCommand.getPermission()))
continue;
stringBuilder.append("&6" + "/" + commandBase.getName() + " " + subCommand.getName() + " &8&l:: &6\n");
if(subCommand.getDescription() != null)
Arrays.stream(subCommand.getDescription()).forEach(s ->
stringBuilder.append("&e" + s + "\n"));
}
ChatUtil.sendMsg(target, stringBuilder.toString());
}
public abstract boolean onCommand(CommandSender sender, CommandBase command, String[] args);
public String getName() {
return name;
}
public String[] getAliases() {
return aliases;
}
public String[] getDescription() {
return description;
}
public void setDescription(String[] description) {
this.description = description;
}
public List<SubCommand> getSubCommands(){
return subCommands;
}
}
| [
"[email protected]"
]
| |
3dc3890722e2567450716048ff8ad8468be01e68 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/30/30_46e0443a0514be23147f8da356a22f814df4d274/ImportCSVEdgeTableInnerPanel/30_46e0443a0514be23147f8da356a22f814df4d274_ImportCSVEdgeTableInnerPanel_t.java | ab3385a77e9950c6403a2287cec04cc9f971ef18 | []
| 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 | 20,303 | java | /*
* This file is part of MONGKIE. Visit <http://www.mongkie.org/> for details.
* Copyright (C) 2011 Korean Bioinformation Center(KOBIC)
*
* MONGKIE is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* MONGKIE 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.mongkie.ui.importer.csv;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComponent;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.table.TableColumn;
import org.netbeans.validation.api.Problems;
import org.netbeans.validation.api.Severity;
import org.netbeans.validation.api.Validator;
import org.netbeans.validation.api.ui.GroupValidator;
import org.netbeans.validation.api.ui.ValidationGroup;
import org.netbeans.validation.api.ui.swing.SwingValidationGroup;
import org.openide.util.NbBundle;
/**
*
* @author Yeongjun Jang <[email protected]>
*/
class ImportCSVEdgeTableInnerPanel extends ImportCSVInnerPanel {
private static final String NO_LABEL =
NbBundle.getMessage(ImportCSVEdgeTableInnerPanel.class, "ImportCSVEdgeTableInnerPanel.labelColumn.noLabel");
/** Creates new form ImportCSVEdgeTableInnerPanel */
ImportCSVEdgeTableInnerPanel(ImportCSVEdgeTableWizardPanel wizardPanel) {
super(wizardPanel);
}
@Override
protected void initUI() {
initComponents();
}
@Override
public String getName() {
return NbBundle.getMessage(ImportCSVEdgeTableInnerPanel.class, "ImportCSVEdgeTableInnerPanel.displayName");
}
@Override
protected JButton getFileButton() {
return fileButton;
}
@Override
protected JTextField getPathTextField() {
return pathTextField;
}
@Override
protected JScrollPane getPreviewScroll() {
return previewScroll;
}
@Override
protected JTable getPreviewTable() {
return previewTable;
}
@Override
protected JCheckBox getSkipCheckBox() {
return skipEdgeTableCheckBox;
}
@Override
protected JCheckBox getHasHeaderCheckBox() {
return hasHeaderCheckBox;
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
descriptionLabel = new javax.swing.JLabel();
pathTextField = new javax.swing.JTextField();
fileButton = new javax.swing.JButton();
targetColumnLabel = new javax.swing.JLabel();
targetColumnComboBox = new javax.swing.JComboBox();
previewScroll = new javax.swing.JScrollPane();
previewTable = new javax.swing.JTable();
sourceColumnLabel = new javax.swing.JLabel();
sourceColumnComboBox = new javax.swing.JComboBox();
previewSeparator = new org.jdesktop.swingx.JXTitledSeparator();
skipEdgeTableCheckBox = new javax.swing.JCheckBox();
labelColumnLabel = new javax.swing.JLabel();
labelColumnComboBox = new javax.swing.JComboBox();
hasHeaderCheckBox = new javax.swing.JCheckBox();
editColumnExplainLabel = new javax.swing.JLabel();
descriptionLabel.setText(org.openide.util.NbBundle.getMessage(ImportCSVEdgeTableInnerPanel.class, "ImportCSVInnerPanel.descriptionLabel.text")); // NOI18N
pathTextField.setEditable(false);
pathTextField.setText(org.openide.util.NbBundle.getMessage(ImportCSVEdgeTableInnerPanel.class, "ImportCSVInnerPanel.pathTextField.text")); // NOI18N
fileButton.setFont(new java.awt.Font("Tahoma", 0, 11)); // NOI18N
fileButton.setText(org.openide.util.NbBundle.getMessage(ImportCSVEdgeTableInnerPanel.class, "ImportCSVInnerPanel.fileButton.text")); // NOI18N
fileButton.setMargin(new java.awt.Insets(0, 4, 0, 2));
targetColumnLabel.setText(org.openide.util.NbBundle.getMessage(ImportCSVEdgeTableInnerPanel.class, "ImportCSVEdgeTableInnerPanel.targetColumnLabel.text")); // NOI18N
targetColumnComboBox.setName("Target column"); // NOI18N
targetColumnComboBox.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
targetColumnComboBoxItemStateChanged(evt);
}
});
previewScroll.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
previewScroll.setViewportView(previewTable);
sourceColumnLabel.setText(org.openide.util.NbBundle.getMessage(ImportCSVEdgeTableInnerPanel.class, "ImportCSVEdgeTableInnerPanel.sourceColumnLabel.text")); // NOI18N
sourceColumnComboBox.setName("Source column"); // NOI18N
sourceColumnComboBox.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
sourceColumnComboBoxItemStateChanged(evt);
}
});
previewSeparator.setTitle(org.openide.util.NbBundle.getMessage(ImportCSVEdgeTableInnerPanel.class, "ImportCSVInnerPanel.previewSeparator.title")); // NOI18N
skipEdgeTableCheckBox.setText(org.openide.util.NbBundle.getMessage(ImportCSVEdgeTableInnerPanel.class, "ImportCSVEdgeTableInnerPanel.skipEdgeTableCheckBox.text")); // NOI18N
skipEdgeTableCheckBox.setFocusPainted(false);
labelColumnLabel.setText(org.openide.util.NbBundle.getMessage(ImportCSVEdgeTableInnerPanel.class, "ImportCSVInnerPanel.labelColumnLabel.text")); // NOI18N
labelColumnComboBox.setName("Label column"); // NOI18N
hasHeaderCheckBox.setFont(new java.awt.Font("Tahoma", 0, 11)); // NOI18N
hasHeaderCheckBox.setText(org.openide.util.NbBundle.getMessage(ImportCSVEdgeTableInnerPanel.class, "ImportCSVEdgeTableInnerPanel.hasHeaderCheckBox.text")); // NOI18N
editColumnExplainLabel.setFont(new java.awt.Font("Tahoma", 0, 11)); // NOI18N
editColumnExplainLabel.setForeground(new java.awt.Color(242, 70, 200));
editColumnExplainLabel.setText(org.openide.util.NbBundle.getMessage(ImportCSVEdgeTableInnerPanel.class, "ImportCSVEdgeTableInnerPanel.editColumnExplainLabel.text")); // NOI18N
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(previewScroll, javax.swing.GroupLayout.DEFAULT_SIZE, 402, Short.MAX_VALUE)
.addContainerGap())
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(sourceColumnLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 126, Short.MAX_VALUE)
.addComponent(sourceColumnComboBox, 0, 126, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(targetColumnLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 126, Short.MAX_VALUE)
.addComponent(targetColumnComboBox, 0, 126, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(labelColumnLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 126, Short.MAX_VALUE)
.addComponent(labelColumnComboBox, 0, 126, Short.MAX_VALUE))
.addContainerGap())
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(pathTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 417, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(fileButton)
.addGap(12, 12, 12))
.addGroup(layout.createSequentialGroup()
.addComponent(previewSeparator, javax.swing.GroupLayout.DEFAULT_SIZE, 402, Short.MAX_VALUE)
.addContainerGap())
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(skipEdgeTableCheckBox)
.addComponent(descriptionLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 357, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(hasHeaderCheckBox))
.addContainerGap(78, Short.MAX_VALUE)))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(editColumnExplainLabel)
.addContainerGap())))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(skipEdgeTableCheckBox)
.addGap(18, 18, 18)
.addComponent(descriptionLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
.addComponent(fileButton)
.addComponent(pathTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(hasHeaderCheckBox, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(12, 12, 12)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
.addComponent(sourceColumnLabel)
.addComponent(targetColumnLabel)
.addComponent(labelColumnLabel))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
.addComponent(sourceColumnComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(targetColumnComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(labelColumnComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(previewSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(editColumnExplainLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 13, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(previewScroll, javax.swing.GroupLayout.DEFAULT_SIZE, 134, Short.MAX_VALUE)
.addContainerGap())
);
layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {fileButton, pathTextField});
layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {labelColumnComboBox, sourceColumnComboBox, targetColumnComboBox});
layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {labelColumnLabel, sourceColumnLabel, targetColumnLabel});
}// </editor-fold>//GEN-END:initComponents
private void sourceColumnComboBoxItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_sourceColumnComboBoxItemStateChanged
// refreshUI();
getWizardPanel().fireChangeEvent();
}//GEN-LAST:event_sourceColumnComboBoxItemStateChanged
private void targetColumnComboBoxItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_targetColumnComboBoxItemStateChanged
// refreshUI();
getWizardPanel().fireChangeEvent();
}//GEN-LAST:event_targetColumnComboBoxItemStateChanged
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel descriptionLabel;
private javax.swing.JLabel editColumnExplainLabel;
private javax.swing.JButton fileButton;
private javax.swing.JCheckBox hasHeaderCheckBox;
private javax.swing.JComboBox labelColumnComboBox;
private javax.swing.JLabel labelColumnLabel;
private javax.swing.JTextField pathTextField;
private javax.swing.JScrollPane previewScroll;
private org.jdesktop.swingx.JXTitledSeparator previewSeparator;
private javax.swing.JTable previewTable;
private javax.swing.JCheckBox skipEdgeTableCheckBox;
private javax.swing.JComboBox sourceColumnComboBox;
private javax.swing.JLabel sourceColumnLabel;
private javax.swing.JComboBox targetColumnComboBox;
private javax.swing.JLabel targetColumnLabel;
// End of variables declaration//GEN-END:variables
@Override
protected void addColumnChooserValidators(ValidationGroup validationGroup) {
SwingValidationGroup columnChoosersValidator = SwingValidationGroup.create(new GroupValidator() {
@Override
protected void performGroupValidation(Problems problems) {
if (isValidationSuspended() || !isValidFile()) {
return;
}
if (!isValidColumns()) {
problems.add(NbBundle.getMessage(ImportCSVEdgeTableInnerPanel.class,
"ImportCSVEdgeTableInnerPanel.validation.fatal.sameSourceTarget"), Severity.FATAL);
}
}
});
Validator<String> mustBeSelected = new Validator<String>() {
@Override
public void validate(Problems problems, String compName, String model) {
if (isValidationSuspended() || !isValidFile()) {
return;
}
if (model.isEmpty()) {
problems.add(NbBundle.getMessage(ImportCSVEdgeTableInnerPanel.class,
"ImportCSVEdgeTableInnerPanel.validation.fatal.noColumnSelected", compName), Severity.FATAL);
}
}
@Override
public Class<String> modelType() {
return String.class;
}
};
columnChoosersValidator.add((JComponent) sourceColumnComboBox, mustBeSelected);
columnChoosersValidator.add((JComponent) targetColumnComboBox, mustBeSelected);
validationGroup.addItem(columnChoosersValidator, false);
validationGroup.add(labelColumnComboBox, mustBeSelected);
}
@Override
protected void refreshColumnChoosers(final String... columnNames) {
runWithValidationSuspended(new Runnable() {
@Override
public void run() {
sourceColumnComboBox.removeAllItems();
targetColumnComboBox.removeAllItems();
labelColumnComboBox.removeAllItems();
if (columnNames.length > 0) {
labelColumnComboBox.addItem(NO_LABEL);
}
for (String column : columnNames) {
sourceColumnComboBox.addItem(column);
targetColumnComboBox.addItem(column);
labelColumnComboBox.addItem(column);
}
sourceColumnComboBox.setSelectedItem(columnNames.length > 0 ? columnNames[0] : null);
targetColumnComboBox.setSelectedItem(columnNames.length > 0 ? columnNames[0] : null);
if (columnNames.length > 0) {
labelColumnComboBox.setSelectedItem(NO_LABEL);
}
}
});
}
@Override
protected void headerNameChanged(TableColumn col, String oldName, String newName) {
comboBoxItemChanged(sourceColumnComboBox, oldName, newName);
comboBoxItemChanged(targetColumnComboBox, oldName, newName);
comboBoxItemChanged(labelColumnComboBox, oldName, newName);
}
@Override
protected boolean isValidColumns() {
String source = (String) sourceColumnComboBox.getSelectedItem();
String target = (String) targetColumnComboBox.getSelectedItem();
return isSkipped() || (source != null && target != null && !source.equals(target));
}
@Override
protected void setColumnChoosersEnabled(final boolean enabled) {
runWithValidationSuspended(new Runnable() {
@Override
public void run() {
sourceColumnComboBox.setEnabled(enabled);
targetColumnComboBox.setEnabled(enabled);
labelColumnComboBox.setEnabled(enabled);
}
});
}
@Override
protected void validateAll() {
super.validateAll();
// sourceColumnComboBox.setEnabled(sourceColumnComboBox.isEnabled());
// targetColumnComboBox.setEnabled(targetColumnComboBox.isEnabled());
// labelColumnComboBox.setEnabled(labelColumnComboBox.isEnabled());
sourceColumnComboBox.firePropertyChange("enabled", !sourceColumnComboBox.isEnabled(), sourceColumnComboBox.isEnabled());
targetColumnComboBox.firePropertyChange("enabled", !targetColumnComboBox.isEnabled(), targetColumnComboBox.isEnabled());
labelColumnComboBox.firePropertyChange("enabled", !labelColumnComboBox.isEnabled(), labelColumnComboBox.isEnabled());
}
Object getSelectedSourceColumn() {
return sourceColumnComboBox.getSelectedItem();
}
Object getSelectedTargetColumn() {
return targetColumnComboBox.getSelectedItem();
}
Object getSelectedLabelColumn() {
Object labelColumn = labelColumnComboBox.getSelectedItem();
return labelColumn != null && labelColumn.equals(NO_LABEL) ? null : labelColumn;
}
Object isDirected() {
return false;
}
}
| [
"[email protected]"
]
| |
dd1d7bcde03578992ee33ecd50d62a23fc2d8f25 | cae41a7b814e9dd7d8a6d583baee7fbbddee2db3 | /src/main/java/com/hm/registropersonaws/ws/PersonaWS.java | 37c8e6a07239c68549c2e45a60b9b66c0f756a15 | [
"MIT"
]
| permissive | lordsafron/RegistroPersonaWS | 1f2d7f40caa131f7f4e4d35f6b1b1a0e67cf9528 | b6b2ce50cc84e99faabc0afbc6c5ba86beb791b1 | refs/heads/master | 2020-03-08T17:36:09.247673 | 2018-04-05T22:56:11 | 2018-04-05T22:56:11 | 128,273,259 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,363 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.hm.registropersonaws.ws;
import com.hm.registropersonabusiness.service.PersonaService;
import com.hm.registropersonaentities.entities.Persona;
import com.hm.registropersonaws.util.Utilidades;
import java.util.List;
import javax.ejb.EJB;
import javax.jws.WebMethod;
import javax.jws.WebService;
/**
*
* @author HugoM
*/
@WebService(name = "personaWS")
public class PersonaWS {
@EJB(mappedName = "PersonaService")
private PersonaService personaService;
@WebMethod(operationName = "getAllPersona")
public List<Persona> getAllPersona() {
try {
personaService = (PersonaService) Utilidades.getEJBRemote("PersonaService", PersonaService.class.getName());
} catch (Exception ex) {
}
return personaService.getAllPersons();
}
@WebMethod(operationName = "getByIdPerson")
public Persona getByIdPerson(long idPersona) {
try {
personaService = (PersonaService) Utilidades.getEJBRemote("PersonaService", PersonaService.class.getName());
} catch (Exception ex) {
}
return personaService.getByPersonId(idPersona);
}
@WebMethod(operationName = "insertPerson")
public boolean insertPerson(Persona persona) {
try {
personaService = (PersonaService) Utilidades.getEJBRemote("PersonaService", PersonaService.class.getName());
} catch (Exception ex) {
}
return personaService.insertPerson(persona);
}
@WebMethod(operationName = "updatePerson")
public boolean updatePerson(Persona persona) {
try {
personaService = (PersonaService) Utilidades.getEJBRemote("PersonaService", PersonaService.class.getName());
} catch (Exception e) {
}
return personaService.updatePerson(persona);
}
@WebMethod(operationName = "deletePerson")
public boolean deletePerson(long idPersona) {
try {
personaService = (PersonaService) Utilidades.getEJBRemote("PersonaService", PersonaService.class.getName());
} catch (Exception e) {
}
return personaService.DeletePerson(idPersona);
}
}
| [
"hmmartinez88"
]
| hmmartinez88 |
3d14d77a83a36f50cf7ca4a8541c58780bfd2ae8 | 2a858a0d1fa1018f93c41924dab4d08e914de97a | /chapter16/Equals.java | 967d35ac9c7c30e8501184e99f36b6bc95eb30fc | []
| no_license | yazamiDev/java-exercises | 6b6ed3a938d49bd3bcd952cb440cc17b438f7ec5 | 8737dcd03572144acccb25241da3e152ba2593cc | refs/heads/master | 2022-12-26T17:12:03.608682 | 2020-09-26T03:42:50 | 2020-09-26T03:42:50 | 289,130,649 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 964 | java | /**
* Write a method equals2 that accepts a second list as a
* parameter and that returns true if the two lists are
* equal and that returns false otherwise. Two lists are
* considered equal if they store exactly the same values
* in exactly the same order and have exactly the same length.
*/
public boolean equals2(LinkedIntList second) {
ListNode i = front;
ListNode j = second.front;
while(i != null || j != null) {
if(i == null) {
return false;
}
if(j == null) {
return false;
}
int n1 = i.data;
int n2 = j.data;
if(n1 != n2) {
return false;
}
i = i.next;
j = j.next;
}
return true;
} | [
"[email protected]"
]
| |
744c08fe8d7c8ed06671f134baee0d637947dc9f | e08159316fdd50225cf6892959f2f77bc547e9e9 | /src/main/java/com/flowable/modules/user/service/UserService.java | 5de9e6273b187ea972b6db3876797b8fa95749e0 | []
| no_license | Realzplore/flowable-task | e10050b085cbca2fd51b74b416fd8047048d1041 | 5058d49b89cc5a007b28b7382862f6cd76cc7e5c | refs/heads/master | 2020-03-24T20:09:29.413109 | 2018-08-10T09:59:12 | 2018-08-10T09:59:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,742 | java | package com.flowable.modules.user.service;
import com.flowable.modules.user.domain.User;
import com.flowable.modules.user.mapping.UserAuthorityMapper;
import com.flowable.modules.user.mapping.UserMapper;
import com.flowable.core.service.BaseService;
import org.apache.ibatis.javassist.tools.rmi.ObjectNotFoundException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;
import java.util.Optional;
/**
* @Author: liping.zheng
* @Date: 2018/7/27
*/
@Service
public class UserService extends BaseService<UserMapper, User> implements UserDetailsService {
@Autowired
UserAuthorityMapper userAuthorityMapper;
@Override
public User selectById(Long id) {
User user = super.selectById(id);
return Optional.ofNullable(getUserAuthorities(user)).orElse(null);
}
public User getParentUserById(Long id) throws ObjectNotFoundException {
User user = baseMapper.selectById(id);
if (user == null) {
throw new ObjectNotFoundException("该用户不存在");
}
//忽略系统层级
if (user.getParentUserId() == 0) {
return user;
}
User parent = baseMapper.selectById(user.getParentUserId());
return Optional.ofNullable(getUserAuthorities(parent)).orElse(null);
}
public User getAssignee(Long userId, Double decisionLevel) throws ObjectNotFoundException {
User assignee = baseMapper.selectById(userId);
if (assignee == null) {
throw new ObjectNotFoundException("该用户不存在");
}
if (decisionLevel <= 0) {
return assignee;
}
for (int i = 0; i < decisionLevel; i++) {
User parent = getParentUserById(assignee.getId());
if (parent.getId() == assignee.getId()) {
break;
}
assignee = parent;
}
return getUserAuthorities(assignee);
}
@Override
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
User user = baseMapper.selectByUsername(username);
return getUserAuthorities(user);
}
/**
* 获取用户权限
* @param user
* @return
*/
private User getUserAuthorities(User user) {
if (user == null || user.getId() == null) {
return null;
}
user.setAuthorityList(userAuthorityMapper.getAuthoritesByUserId(user.getId()));
return user;
}
}
| [
"[email protected]"
]
| |
3954a8a7647a1c2c8b91e4cdc5471edf8527d351 | 900f06f67cb3544efb89738309ceef15dbe28485 | /app/src/test/java/com/example/dee/caloriescounterandroidapp/ExampleUnitTest.java | 28581178970671c09715d7d6ee3eb10483be0110 | []
| no_license | Jade-Myers/CaloriesCounterAndroidApp | 744f88ceaedd3473299ebd8ab8face200f083766 | a3bec67570be40bf56e77fe0b2f3aa1f6652f5f4 | refs/heads/master | 2021-06-15T09:13:31.611182 | 2017-03-04T00:28:28 | 2017-03-04T00:28:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 419 | java | package com.example.dee.caloriescounterandroidapp;
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);
}
} | [
"Jad myer"
]
| Jad myer |
b2179fb44c43c47343059d1701e62071a234131b | 9f7994ed0b8caa3014c0b6254d5ccfaeb97dafd4 | /branches/2.0-SNAPSHOT/maven-httpd-control-win32/src/main/java/org/phpmaven/httpd/control/w32/W32Controller20.java | 28d3e947f16b5a80994591d25e593a8721d88f5f | [
"Apache-2.0"
]
| permissive | tomask-de/maven-php-plugin | fe830c742d4cc980094531358c215ecb063aa814 | 5bcf36c6d66ff3aa18a11968c79d18eec4164aeb | refs/heads/master | 2021-01-18T09:04:20.028784 | 2012-08-04T09:10:41 | 2013-06-20T16:48:01 | 4,183,438 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 10,889 | java | /**
* Copyright 2010-2012 by PHP-maven.org
*
* 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 org.phpmaven.httpd.control.w32;
import java.io.File;
import java.io.IOException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.maven.plugin.logging.Log;
import org.codehaus.plexus.component.annotations.Component;
import org.codehaus.plexus.component.annotations.Configuration;
import org.codehaus.plexus.util.FileUtils;
import org.codehaus.plexus.util.cli.CommandLineException;
import org.phpmaven.core.BuildPluginConfiguration;
import org.phpmaven.core.ConfigurationParameter;
import org.phpmaven.core.ExecutionUtils;
import org.phpmaven.httpd.control.ConfigUtils;
import org.phpmaven.httpd.control.IApacheController;
import org.phpmaven.httpd.control.IApacheService.APACHE_VERSION;
/**
* A helper interface for accessing apache services.
*
* @author Martin Eisengardt <[email protected]>
* @since 2.0.1
*/
@Component(role = IApacheController.class, instantiationStrategy = "per-lookup", hint = "V2.0")
@BuildPluginConfiguration(groupId = "org.phpmaven", artifactId = "maven-httpd-control-api")
public class W32Controller20 implements IApacheController {
/**
* Default value for parameter "defaultConfigFile".
*/
private static final String DEFAULT_CONFIG_FILE = "conf/httpd.conf";
/**
* The apache executable.
*/
@Configuration(name = "executable", value = "httpd.exe")
@ConfigurationParameter(name = "executable", expression = "${apache.executable}")
private String executable;
/**
* configuration file.
*/
@ConfigurationParameter(name = "configFile", expression = "${project.basedir}/target/apache/httpd.conf")
private File configFile;
/**
* server directory.
*/
@ConfigurationParameter(name = "serverDir", expression = "${project.basedir}/target/apache")
private File serverDir;
/**
* pid File.
*/
@ConfigurationParameter(name = "serverDir", expression = "${project.basedir}/target/apache/apache2.pid")
private File pidFile;
/**
* server directory.
*/
@Configuration(name = "defaultConfigFile", value = DEFAULT_CONFIG_FILE)
@ConfigurationParameter(name = "defaultConfigFile", expression = "${apache.defaultConfig}")
private String defaultConfigFile;
/**
* The apache process.
*/
private Process apacheProcess;
@Override
public File getServerDir() {
return this.serverDir;
}
@Override
public void setServerDir(File dir) {
this.serverDir = dir;
}
@Override
public File getConfigFile() {
return this.configFile;
}
@Override
public void setConfigFile(File config) {
this.configFile = config;
}
@Override
public String getExecutable() {
return this.executable;
}
@Override
public String getDefaultConfig(Log log) throws CommandLineException {
// look for the configuration file
File defaultCfg = null;
if (DEFAULT_CONFIG_FILE.equals(defaultConfigFile)) {
final String conf = ExecutionUtils.executeCommand(log, "\"" + this.executable + "\" -V SERVER_CONFIG_FILE");
final Pattern pattern = Pattern.compile("^\\s*-D\\s*SERVER_CONFIG_FILE=\"(.*)?\"$");
final Matcher matcher = pattern.matcher(conf);
final String result = matcher.group(1);
defaultCfg = new File(result);
if (defaultCfg.isAbsolute()) {
if (defaultCfg.exists()) {
return ConfigUtils.readConfigFile(defaultCfg);
}
} else {
final String exec = ExecutionUtils.searchExecutable(log, this.executable);
if (exec != null) {
final File execFile = new File(exec);
File execDir = execFile.getParentFile();
if ("bin".equals(execDir.getName())) {
execDir = execDir.getParentFile();
}
File confDir = new File(execDir, "conf");
if (!confDir.exists()) {
confDir = execDir;
}
defaultCfg = new File(confDir, "httpd.conf");
if (defaultCfg.exists()) {
return ConfigUtils.readConfigFile(defaultCfg);
}
}
}
} else {
defaultCfg = new File(this.defaultConfigFile);
if (defaultCfg.exists()) {
return ConfigUtils.readConfigFile(defaultCfg);
}
}
return null;
}
@Override
public APACHE_VERSION getVersion() throws CommandLineException {
return APACHE_VERSION.VERSION_2_0;
}
@Override
public boolean isActive() throws CommandLineException {
return this.isDaemonActive();
}
@Override
public boolean isDaemonActive() throws CommandLineException {
if (this.pidFile.exists()) {
try {
final String pid = FileUtils.fileRead(this.pidFile).trim();
final String ps = ExecutionUtils.executeCommand(null, "tasklist");
final Pattern pattern = Pattern.compile("^\\S+\\s+" + pid + ".*$");
if (pattern.matcher(ps).matches()) {
return true;
}
} catch (IOException ex) {
throw new CommandLineException("Error testing daemon", ex);
}
}
return false;
}
@Override
public void start() throws CommandLineException {
this.startDaemon();
// simply endless loop, await the process shutting down
try {
this.apacheProcess.waitFor();
} catch (InterruptedException e) {
throw new CommandLineException("Problems joining apache process", e);
}
}
@Override
public void startDaemon() throws CommandLineException {
synchronized (this) {
if (this.isDaemonActive()) {
throw new CommandLineException("Apache already running");
}
if (!this.serverDir.exists()) {
this.serverDir.mkdirs();
}
final ProcessBuilder builder = new ProcessBuilder(
this.executable,
"-f", this.configFile.getAbsolutePath(),
"-d", this.serverDir.getAbsolutePath(),
"-c", "PidFile \"" + this.pidFile.getAbsolutePath() + "\"",
"-k", "start");
builder.directory(this.serverDir);
try {
this.apacheProcess = builder.start();
Runtime.getRuntime().addShutdownHook(new Thread() {
public void run() {
try {
W32Controller20.this.stop();
} catch (CommandLineException ex) {
// in shutdown hooks there may be some problem.
ex.printStackTrace();
}
}
});
} catch (IOException ex) {
throw new CommandLineException("Error starting apache", ex);
}
}
}
@Override
public void stop() throws CommandLineException {
this.stopDaemon();
}
@Override
public void stopDaemon() throws CommandLineException {
synchronized (this) {
if (!this.isDaemonActive()) {
throw new CommandLineException("Apache not running");
}
ExecutionUtils.executeCommand(null,
"\"" + this.executable + "\" " +
"-f \"" + this.configFile.getAbsolutePath() + "\" " +
"-d \"" + this.serverDir.getAbsolutePath() + "\" " +
"-c \"PidFile \\\"" + this.pidFile.getAbsolutePath() + "\\\"\" " +
"-k stop");
}
}
@Override
public void restart() throws CommandLineException {
synchronized (this) {
if (!this.isDaemonActive()) {
this.start();
} else {
final ProcessBuilder builder = new ProcessBuilder(
this.executable,
"-f", this.configFile.getAbsolutePath(),
"-d", this.serverDir.getAbsolutePath(),
"-c", "PidFile \"" + this.pidFile.getAbsolutePath() + "\"",
"-k", "restart");
builder.directory(this.serverDir);
try {
this.apacheProcess = builder.start();
Runtime.getRuntime().addShutdownHook(new Thread() {
public void run() {
try {
W32Controller20.this.stop();
} catch (CommandLineException ex) {
// in shutdown hooks there may be some problem.
ex.printStackTrace();
}
}
});
} catch (IOException ex) {
throw new CommandLineException("Error starting apache", ex);
}
// simply endless loop, await the process shutting down
try {
this.apacheProcess.waitFor();
} catch (InterruptedException e) {
throw new CommandLineException("Problems joining apache process", e);
}
}
}
}
@Override
public void restartDaemon() throws CommandLineException {
synchronized (this) {
if (!this.isDaemonActive()) {
this.startDaemon();
} else {
ExecutionUtils.executeCommand(null,
"\"" + this.executable + "\" " +
"-f \"" + this.configFile.getAbsolutePath() + "\" " +
"-d \"" + this.serverDir.getAbsolutePath() + "\" " +
"-c \"PidFile \\\"" + this.pidFile.getAbsolutePath() + "\\\"\" " +
"-k restart");
}
}
}
}
| [
"[email protected]"
]
| |
dafe3137a29f65b406ad8cb247dcf0e173f366c3 | 35a739e572df26a47cd858b314c83e22880e6454 | /BM-core_v3/src/main/java/bm/cir/objects/CodeBlock.java | 9f735aeec21b9e2e4b12f9e70337245eb0823665 | []
| no_license | MirasCarlo934/symphony | 9ccc3de48e9b1caba1554c0eddc01549dacc5b27 | 315dff76209bbd22b888eb41a6626ea6b0f4137b | refs/heads/master | 2022-12-26T03:17:09.575413 | 2020-06-20T08:21:43 | 2020-06-20T08:21:43 | 167,689,901 | 1 | 1 | null | 2022-12-12T21:41:43 | 2019-01-26T13:08:42 | Java | UTF-8 | Java | false | false | 1,058 | java | package bm.cir.objects;
public abstract class CodeBlock {
private String comID;
private int propIndex;
private Object propValue;
public CodeBlock(String devID, int devProperty, Object propValue) {
setDeviceID(devID);
setDeviceProperty(devProperty);
setPropValue(propValue);
}
/**
* Turns this CodeBlock into a CIR Script String.
*/
public abstract String toString();
/**
* @return the comID
*/
public String getDeviceID() {
return comID;
}
/**
* @param comID the comID to set
*/
public void setDeviceID(String comID) {
this.comID = comID;
}
/**
* @return the comProperty
*/
public int getPropertyIndex() {
return propIndex;
}
/**
* @param comProperty the comProperty to set
*/
public void setDeviceProperty(int comProperty) {
this.propIndex = comProperty;
}
/**
* @return the value of the property
*/
public Object getPropertyValue() {
return propValue;
}
/**
* @param comValue the comValue to set
*/
public void setPropValue(Object comValue) {
this.propValue = comValue;
}
}
| [
"[email protected]"
]
| |
4723d7a4f199ed9b2807f9f8e82ea697af316010 | 1e9be06e4447c952119b04cb6d0e640974f6fe54 | /src/main/java/com/iykno/modeling/common/Result.java | 43e037d4c389c549670c6e17b9bb7d449be3a549 | []
| no_license | iykno/builder | 230a017a64cfbd1350adadf40f0da3ea26fc6bb4 | 79cac19b6fb551f1063ca79dd47d44775e088998 | refs/heads/master | 2020-04-04T22:14:09.148312 | 2018-11-07T08:38:54 | 2018-11-07T08:38:54 | 156,315,730 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,125 | java | package com.iykno.modeling.common;
import com.alibaba.fastjson.JSONObject;
public class Result extends JSONObject {
private static final long serialVersionUID = -3704030906158134520L;
public Result(String resultCode) {
}
public Result(Integer pageNo, Integer rows, Integer pageSize) {
this.put("startNo", pageNo);
this.put("count", rows);
this.put("pageSize", pageSize);
}
public Result(Integer pageSize) {
this.put("TotalNum", pageSize);
}
public Result(Integer pageSize, boolean flag) {
this.put("TotalNum", pageSize);
this.put("nextPage", flag);
}
public void setResultCode(String resultCode) {
this.put("resultCode", resultCode);
}
public String getResultCode() {
return (String) this.get("resultCode");
}
public void setResultMessage(String resultMessage) {
this.put("resultMessage", resultMessage);
}
public void setData(Object data) {
if (data == null) {
this.put("data", "");
} else {
this.put("data", data);
}
}
public Object getData() {
return this.get("data");
}
public void setTotalNum(long totalCount) {
this.put("TotalNum", totalCount);
}
}
| [
"[email protected]"
]
| |
c34a1505aa8c9166219eb8960100a9ed6d6ccd26 | ccd94409a78970ec9587afd389e6ba689b5f02dc | /Crm-Mobile/src/GetCustomersPack/Updated.java | c806c29217e34146b9aa14c9f810b0dff9459ce0 | []
| no_license | AtiehPardaz/CRM-Mobile | 0d559b43c3bacb9c2a6de91b25ebdf467c22869e | 6b43a866102be85eac410e276606e79436d4de7a | refs/heads/master | 2021-01-23T13:22:19.561128 | 2015-06-12T22:28:35 | 2015-06-12T22:28:35 | 30,471,498 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,237 | java |
package GetCustomersPack;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class Updated {
private String Address;
private String Description;
private String Id;
private boolean IsLegal;
private List<PersonRelation_> PersonRelations = new ArrayList<PersonRelation_>();
private String Tel;
private String Title;
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
/**
*
* @return
* The Address
*/
public String getAddress() {
return Address;
}
/**
*
* @param Address
* The Address
*/
public void setAddress(String Address) {
this.Address = Address;
}
/**
*
* @return
* The Description
*/
public String getDescription() {
return Description;
}
/**
*
* @param Description
* The Description
*/
public void setDescription(String Description) {
this.Description = Description;
}
/**
*
* @return
* The Id
*/
public String getId() {
return Id;
}
/**
*
* @param Id
* The Id
*/
public void setId(String Id) {
this.Id = Id;
}
/**
*
* @return
* The IsLegal
*/
public boolean isIsLegal() {
return IsLegal;
}
/**
*
* @param IsLegal
* The IsLegal
*/
public void setIsLegal(boolean IsLegal) {
this.IsLegal = IsLegal;
}
/**
*
* @return
* The PersonRelations
*/
public List<PersonRelation_> getPersonRelations() {
return PersonRelations;
}
/**
*
* @param PersonRelations
* The PersonRelations
*/
public void setPersonRelations(List<PersonRelation_> PersonRelations) {
this.PersonRelations = PersonRelations;
}
/**
*
* @return
* The Tel
*/
public String getTel() {
return Tel;
}
/**
*
* @param Tel
* The Tel
*/
public void setTel(String Tel) {
this.Tel = Tel;
}
/**
*
* @return
* The Title
*/
public String getTitle() {
return Title;
}
/**
*
* @param Title
* The Title
*/
public void setTitle(String Title) {
this.Title = Title;
}
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
}
| [
"[email protected]"
]
| |
9a3e9429fc559515bf6ba6cc55bc5a2ceccac32d | 163a9c11093f982532ec0eebfe0b7a7d88f22557 | /custom/ncip/ncipstorefront/web/src/com/ncip/storefront/checkout/steps/validation/impl/DefaultDeliveryAddressCheckoutStepValidator.java | 2334ff134ded0a698b4ac3dc01d4c4d349acd240 | []
| no_license | green-jin/green | 9fa5809af26e4da0af6a979379544964f9fdd45e | f9ccc1cc2ca97c4bc8e55d7477c798ea598f5059 | refs/heads/master | 2020-08-08T10:26:16.816508 | 2019-08-22T09:11:21 | 2019-08-22T09:11:21 | 213,811,708 | 0 | 0 | null | 2020-04-30T12:28:24 | 2019-10-09T03:24:59 | Java | UTF-8 | Java | false | false | 1,183 | java | /*
* [y] hybris Platform
*
* Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved.
*
* This software is the confidential and proprietary information of SAP
* ("Confidential Information"). You shall not disclose such Confidential
* Information and shall use it only in accordance with the terms of the
* license agreement you entered into with SAP.
*/
package com.ncip.storefront.checkout.steps.validation.impl;
import de.hybris.platform.acceleratorstorefrontcommons.checkout.steps.validation.ValidationResults;
import de.hybris.platform.acceleratorstorefrontcommons.checkout.steps.validation.AbstractCheckoutStepValidator;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
public class DefaultDeliveryAddressCheckoutStepValidator extends AbstractCheckoutStepValidator
{
@Override
public ValidationResults validateOnEnter(final RedirectAttributes redirectAttributes)
{
if (!getCheckoutFlowFacade().hasValidCart())
{
return ValidationResults.REDIRECT_TO_CART;
}
if (!getCheckoutFacade().hasShippingItems())
{
return ValidationResults.REDIRECT_TO_PICKUP_LOCATION;
}
return ValidationResults.SUCCESS;
}
} | [
"[email protected]"
]
| |
a336e709ec898c045b3bb9d8d3106dedc6ec8545 | e3fb2b44481f46682fc6bd87df231da2daffeb1e | /client-java-5.0.15_source_from_Procyon/rp/org/apache/http/impl/client/AuthenticationStrategyImpl.java | ee4a6212acc2c02a7e4c11cac8c2a88dbad850aa | []
| no_license | sachindwivedi18/Hibernate | 733b2acecff1e0642b540e7382f61459f5abbda7 | d561a342be2fdc6cca91aedebeb1b4dd6e9d8625 | refs/heads/master | 2023-06-11T10:14:09.375468 | 2021-06-29T14:51:36 | 2021-06-29T14:51:36 | 365,769,635 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,629 | java | //
// Decompiled by Procyon v0.5.36
//
package rp.org.apache.http.impl.client;
import java.util.Collections;
import java.util.Arrays;
import rp.org.apache.http.client.AuthCache;
import rp.org.apache.http.auth.Credentials;
import rp.org.apache.http.auth.AuthScheme;
import java.util.Iterator;
import rp.org.apache.http.client.CredentialsProvider;
import rp.org.apache.http.config.Lookup;
import rp.org.apache.http.auth.AuthScope;
import rp.org.apache.http.auth.AuthSchemeProvider;
import java.util.LinkedList;
import rp.org.apache.http.client.protocol.HttpClientContext;
import rp.org.apache.http.auth.AuthOption;
import java.util.Queue;
import java.util.Collection;
import rp.org.apache.http.client.config.RequestConfig;
import java.util.Locale;
import rp.org.apache.http.protocol.HTTP;
import rp.org.apache.http.util.CharArrayBuffer;
import rp.org.apache.http.auth.MalformedChallengeException;
import rp.org.apache.http.FormattedHeader;
import java.util.HashMap;
import rp.org.apache.http.Header;
import java.util.Map;
import rp.org.apache.http.util.Args;
import rp.org.apache.http.protocol.HttpContext;
import rp.org.apache.http.HttpResponse;
import rp.org.apache.http.HttpHost;
import rp.org.apache.commons.logging.LogFactory;
import java.util.List;
import rp.org.apache.commons.logging.Log;
import rp.org.apache.http.annotation.ThreadingBehavior;
import rp.org.apache.http.annotation.Contract;
import rp.org.apache.http.client.AuthenticationStrategy;
@Contract(threading = ThreadingBehavior.IMMUTABLE)
abstract class AuthenticationStrategyImpl implements AuthenticationStrategy
{
private final Log log;
private static final List<String> DEFAULT_SCHEME_PRIORITY;
private final int challengeCode;
private final String headerName;
AuthenticationStrategyImpl(final int challengeCode, final String headerName) {
this.log = LogFactory.getLog(this.getClass());
this.challengeCode = challengeCode;
this.headerName = headerName;
}
@Override
public boolean isAuthenticationRequested(final HttpHost authhost, final HttpResponse response, final HttpContext context) {
Args.notNull(response, "HTTP response");
final int status = response.getStatusLine().getStatusCode();
return status == this.challengeCode;
}
@Override
public Map<String, Header> getChallenges(final HttpHost authhost, final HttpResponse response, final HttpContext context) throws MalformedChallengeException {
Args.notNull(response, "HTTP response");
final Header[] headers = response.getHeaders(this.headerName);
final Map<String, Header> map = new HashMap<String, Header>(headers.length);
for (final Header header : headers) {
CharArrayBuffer buffer;
int pos;
if (header instanceof FormattedHeader) {
buffer = ((FormattedHeader)header).getBuffer();
pos = ((FormattedHeader)header).getValuePos();
}
else {
final String s = header.getValue();
if (s == null) {
throw new MalformedChallengeException("Header value is null");
}
buffer = new CharArrayBuffer(s.length());
buffer.append(s);
pos = 0;
}
while (pos < buffer.length() && HTTP.isWhitespace(buffer.charAt(pos))) {
++pos;
}
final int beginIndex = pos;
while (pos < buffer.length() && !HTTP.isWhitespace(buffer.charAt(pos))) {
++pos;
}
final int endIndex = pos;
final String s2 = buffer.substring(beginIndex, endIndex);
map.put(s2.toLowerCase(Locale.ROOT), header);
}
return map;
}
abstract Collection<String> getPreferredAuthSchemes(final RequestConfig p0);
@Override
public Queue<AuthOption> select(final Map<String, Header> challenges, final HttpHost authhost, final HttpResponse response, final HttpContext context) throws MalformedChallengeException {
Args.notNull(challenges, "Map of auth challenges");
Args.notNull(authhost, "Host");
Args.notNull(response, "HTTP response");
Args.notNull(context, "HTTP context");
final HttpClientContext clientContext = HttpClientContext.adapt(context);
final Queue<AuthOption> options = new LinkedList<AuthOption>();
final Lookup<AuthSchemeProvider> registry = clientContext.getAuthSchemeRegistry();
if (registry == null) {
this.log.debug("Auth scheme registry not set in the context");
return options;
}
final CredentialsProvider credsProvider = clientContext.getCredentialsProvider();
if (credsProvider == null) {
this.log.debug("Credentials provider not set in the context");
return options;
}
final RequestConfig config = clientContext.getRequestConfig();
Collection<String> authPrefs = this.getPreferredAuthSchemes(config);
if (authPrefs == null) {
authPrefs = AuthenticationStrategyImpl.DEFAULT_SCHEME_PRIORITY;
}
if (this.log.isDebugEnabled()) {
this.log.debug("Authentication schemes in the order of preference: " + authPrefs);
}
for (final String id : authPrefs) {
final Header challenge = challenges.get(id.toLowerCase(Locale.ROOT));
if (challenge != null) {
final AuthSchemeProvider authSchemeProvider = registry.lookup(id);
if (authSchemeProvider == null) {
if (!this.log.isWarnEnabled()) {
continue;
}
this.log.warn("Authentication scheme " + id + " not supported");
}
else {
final AuthScheme authScheme = authSchemeProvider.create(context);
authScheme.processChallenge(challenge);
final AuthScope authScope = new AuthScope(authhost, authScheme.getRealm(), authScheme.getSchemeName());
final Credentials credentials = credsProvider.getCredentials(authScope);
if (credentials == null) {
continue;
}
options.add(new AuthOption(authScheme, credentials));
}
}
else {
if (!this.log.isDebugEnabled()) {
continue;
}
this.log.debug("Challenge for " + id + " authentication scheme not available");
}
}
return options;
}
@Override
public void authSucceeded(final HttpHost authhost, final AuthScheme authScheme, final HttpContext context) {
Args.notNull(authhost, "Host");
Args.notNull(authScheme, "Auth scheme");
Args.notNull(context, "HTTP context");
final HttpClientContext clientContext = HttpClientContext.adapt(context);
if (this.isCachable(authScheme)) {
AuthCache authCache = clientContext.getAuthCache();
if (authCache == null) {
authCache = new BasicAuthCache();
clientContext.setAuthCache(authCache);
}
if (this.log.isDebugEnabled()) {
this.log.debug("Caching '" + authScheme.getSchemeName() + "' auth scheme for " + authhost);
}
authCache.put(authhost, authScheme);
}
}
protected boolean isCachable(final AuthScheme authScheme) {
if (authScheme == null || !authScheme.isComplete()) {
return false;
}
final String schemeName = authScheme.getSchemeName();
return schemeName.equalsIgnoreCase("Basic");
}
@Override
public void authFailed(final HttpHost authhost, final AuthScheme authScheme, final HttpContext context) {
Args.notNull(authhost, "Host");
Args.notNull(context, "HTTP context");
final HttpClientContext clientContext = HttpClientContext.adapt(context);
final AuthCache authCache = clientContext.getAuthCache();
if (authCache != null) {
if (this.log.isDebugEnabled()) {
this.log.debug("Clearing cached auth scheme for " + authhost);
}
authCache.remove(authhost);
}
}
static {
DEFAULT_SCHEME_PRIORITY = Collections.unmodifiableList((List<? extends String>)Arrays.asList("Negotiate", "Kerberos", "NTLM", "CredSSP", "Digest", "Basic"));
}
}
| [
"[email protected]"
]
| |
cf3f8b4eb95ccddb7d5ecb177df0479504379f0e | 51934a954934c21cae6a8482a6f5e6c3b3bd5c5a | /output/27665dec3a2b4336a33ffec2ff885312.java | 31e17d3d075bc7a2b3a01e41e12b02f2d32ef215 | [
"MIT",
"Apache-2.0"
]
| permissive | comprakt/comprakt-fuzz-tests | e8c954d94b4f4615c856fd3108010011610a5f73 | c0082d105d7c54ad31ab4ea461c3b8319358eaaa | refs/heads/master | 2021-09-25T15:29:58.589346 | 2018-10-23T17:33:46 | 2018-10-23T17:33:46 | 154,370,249 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 37,952 | java | class VdAqZsY {
public static void nfRyYmP_q0geI (String[] jCMFXSR) {
void TuR = this.t3jCA6 = -47848907.dXvr8b_c271I;
int jwmYUGrn0fTACT;
void ybUT9UGvd_BbS = !!this.MkY9YDXGTG() = -this[ true.uYU()];
-!pd7fqdq2MZkDS().TRUohNkeggoI;
{
sF6T7Z DEciLh;
RxrxO7XfwVI[] bxl;
int yUiGRjfO2dFR;
{
void[] TuSECGlINx8h;
}
boolean[] c;
int[] YUe2DO;
if ( true.EFUQFfW) {
if ( k37GKSMnsl.HWN) while ( -!!new ySG_CNa().hRdKvzlnZJbGUi()) return;
}
boolean qR;
boolean[][] Uq6uH9m;
}
return;
return;
}
public static void xqTTGkApi1c5ib (String[] cfE) {
void[][][][] NZa1Qs = !new yh().FP02lXKyJ() = -new int[ true[ ( true[ -false.vkK]).jzeDalJJSes5Ie()]].YSdGM();
if ( true.aHH) {
void[][][][][] yQC;
}else ;
}
public static void LejzQSs6 (String[] DaAZkTgkGvH2y4) {
void TxvCnY9pPE = !-new int[ !true[ false.rjwrWDShKv]].w6() = -!( wus()[ !Q_cJ6d().kXR18b36kZ]).iY;
;
while ( new NZTA()[ --!!oBo6d.BFvyjtS]) while ( !new vpAz6if().Iuc7LWu4qDlObQ) if ( null[ !-null.uY()]) while ( !nK.qHZqoAAoSorrT) ;
DnY_ycmp[][] xFn = true.DMl3MBvWUPu8f;
{
WYFApiVOMjk K2kD;
boolean[][][] dyiQIExTIU4GV;
wO F7Fa7q;
;
-!UQ0w7ke.HSu2fKz();
boolean y;
_19D[][] MzEAu4me;
return;
--null[ !saTRt8iHiM04.WuDIUTeieF];
while ( true[ 03448[ !--null[ !-null.GRCUe4mtDL2gjd]]]) while ( this[ !pcz().acSEkNrdVwLS]) ( -( !!!!new int[ !AI7ObefCtXeV1().xokLViP][ this[ -DjmF().Q8nOmy2FwT]]).aOIi_9X).bkkK0qEUAB;
int zgm5y1x;
if ( !!u._Jg) if ( -HhYAGxfqtmJc[ 509434.ClvvD()]) !-!false.ctpbBiwxjR;
void yeg;
while ( P_k1YMgNhfIUNa.P7th) {
{
void m4U;
}
}
int[] vncLgDcF;
;
boolean KsRx;
}
void _P;
int[][][][] XjEs = --new K53s()[ !!-false.GcSsI];
int[] KlfdV5FtPAPsB;
int[] m2HQtmN;
}
public int BPEUNqFI;
public d1[][] Qtiozm (void ZdRbyVks) {
int b66aqT8P;
!( !!!null[ !!dGSNqw2KxbCMr.R1()]).qftZKAJwH;
}
public static void VSx2BFyFd9 (String[] TerJmqY) throws Dot {
boolean P2 = !new Jq5fZUaEw()[ !-false._j4od];
Nk7OtMSO6vn35 DYR4vc9g_jWY_;
if ( !-8.n8W) if ( !false[ 51114[ this.O()]]) ;
}
public int cbQZXWmH12E () {
void[][] id54yrQ1xImu3 = new enKNK().F() = ( X4KGXs.Xejw()).ywYV35();
while ( --!this[ -this.IgOBVUtQw6lTI2()]) return;
}
public int[] CSh1i;
public static void BW (String[] m6) {
if ( new oEEXN().VhtAMPDv6Ki1P) -true[ !!aXD().P];else !BqhKLjsh().RVIA1X();
}
public int[][][][][][] BtZHNWmMqVMYx () {
if ( !this.BoJRyRSH3kk) {
if ( this[ !i47WS1oAXAnKn4.H6tNdu]) null[ EYY4DOtWktvd4Z().Hx3EebPjCt()];
}else -!( !YAedb().tQi())[ this.HIBzsngY6HEU4()];
void sTBhmYl1s8zmE;
gXN1nOctYz0muR Auc92;
return;
int[][] VNc3hmn74 = !false[ !!this.Sqa4oKAZ6f1z3F];
MBadAbwpTW rTREhChRdU;
}
}
class XBU7Z3C {
}
class zC {
}
class F2rXJoSgdmMyEu {
public void[][][] mIsY6SQZHa6YB () {
while ( !!LvR5nSOwE[ 795598270.P3()]) return;
{
while ( -( CHNVboQ1uu9c().Vkr6MeYeHdeZif()).Z3Qd1g0()) {
void gDWhEwH;
}
void[][][][][][][] tSKuMEF5Y2i;
while ( new lZK()[ -!--new void[ j31bg.d].PPJgQZlZ72Dy85]) if ( !--!-!15.Bm()) while ( --new boolean[ --!!-this._1yWlPmYum][ -!-!YBLYNpw()[ true.Fewhu_lugQ]]) ;
--EU3ziOCp_DfGD.UYHVf();
return;
{
{
int[] M2vH;
}
}
while ( !( -!4376.sN).NuTG1eTUE36li) if ( new sL8WzPZCUZFBXg().NaCkdW) if ( !211323238[ !-N7rb9u()[ -6261.RiQ4youaeaTR()]]) ;
boolean a;
{
void H0m;
}
WeBKdJj2usf[] E;
y7d[] slpy7KRCyjVdf;
-!new wDGXky8().WXhw5yp;
void DMUfpX_E;
while ( false.fkerU3qDZZw9()) while ( 8296015.sNNJvzig()) if ( !--false.izbI5a) -98111.LVW6SZn();
EuU vMNMHQuGWIYXw;
int[][][][][] N1NhrFPg1;
;
;
{
while ( !this[ !false.LU0gLQPV4xUsAR()]) !-AhzLJ.ESKdT;
}
}
void[][][] IhDQHv0 = !MDUFZ.AMFIV;
void bEy0o1WzEYrT = l2X().iA = -!--null.LkowpIitf3S2zp();
boolean[] HKjSSV;
void[][] HH9 = 64174858[ mQgN().LF9x0];
{
while ( this.U4mx) -new jnOh3BWXf().t1koMnQGKfN6C();
{
void EiHg;
}
cGjOUlKUUH CArFNym;
return;
-!false.mD;
if ( null.oM8rFp5Q1IWD7) if ( !!this.b) if ( !!this[ FI8Zh34dI7ZG[ SdPny.XqK]]) if ( -null[ !-true.jC6h0GFReQW]) return;
rsP2D_XahM XP6sI7AG4Eqn0g;
boolean[] tbDCe7W;
int hFm;
vIuP3a2 rMvT;
}
!null[ TUKhcrAOB[ -( !this[ !this[ !( true[ new pbsSVX()[ -!true.DYx]])[ -!false.CvA()]]]).NLI3s_KPUNx6()]];
return fpe()[ new oTne9ZQ[ y_N_zsC()[ !new boolean[ !YS8xTlPlPaNg.HfLsS][ new e3bWFEoLGtt().K]]].uldvgjIETu30m];
while ( !null.OIMePJRj7()) ;
aVGUH[] m6;
OEMdX[][][][][][][][][][][] K_9nxxEXpn;
boolean F7EPFu5jGgz = new e3hxM()[ false.RPEUvHjnWy];
while ( this.RLIjBbP8P()) {
boolean j;
}
}
}
class _MM {
}
class zoBFv {
public int _q;
public boolean OuG3HQS3h () {
void[] Kpx;
return;
return;
int[] BjEUgk84jIAgq;
return ---jqqpP.IwlpOJJilvt8D();
{
boolean[][] VmrjU;
}
{
;
{
boolean[] l;
}
return;
if ( null[ !!-false[ d.WjKVW]]) ;
while ( new jqsAZg7FKR()[ 64671.jKzBz()]) ;
;
return;
;
if ( true.WmvhYorI()) 0.L8jN7UHkCydSw();
int[] m_eLc;
return;
while ( --new MH0vwfh().ni9atP()) this.OxQNCVRz6Lq6mu;
if ( I1l1XF()[ ( this._L6uMPGBdZdX()).qZWgVLGnMu()]) if ( !-!this.onhpL0z91Y6wFa()) while ( false[ -R_rmhRSo().lS_5I_5L()]) while ( !56738.Oo9Xyev()) if ( KE5QvXwKPlWf().aL523Ldvo) ;
while ( -gCpbEL3J3NK().RSy9Z7Iy()) while ( true.lWpoyVbcfWQ) {
z iZYv;
}
vmimQr wyZ1Jf;
;
void[] FjGQuWIgBsa7;
void CmN;
while ( -!!this.Pzkl()) while ( false.e()) if ( --!this[ true.t2yQav()]) if ( !( -WoiCP5Uix[ !-new asy0mhqiBw().sk()]).E79sJrSl_4h) while ( !-( 40.j()).j9vlml) {
{
bCYw[][][][] sTnzd;
}
}
int t;
}
-true.knb2ml8ZW;
int OPhSdF2tf0fMu;
void AWCymyX0u;
while ( !-!!true[ -!03[ !!false.h()]]) ;
boolean jFUF83SSubf2Ij = 1373.WH5I3prLKOTvp6;
{
void zs;
boolean[][][] teMd6Oqbn;
;
ILcggvKpIdn8Hi q2o7;
if ( 7598[ new PJOwhksMy_Klsz()[ null.MGaIKLvv45A1z_()]]) return;
;
rF8qnj _43KO;
}
}
public static void NMlRSv (String[] INjfnTLVa3) {
void[][] qiE76pwUzDlvVH = 8[ HpEMTNLTjHfV()[ kfIky5p[ false.PWaESxyJgD2DSD()]]];
this.vYGEAbhdDNcwl;
crezpOM tib2CBwmTJX44;
boolean LII6;
OB msHf;
int[] MmZci = -!this.LDc4Dy3T_S() = GcB0QgNQ4cokb().KPo();
return new o().K0WFAl1cx_EY;
}
public static void IJbPOFQDDKuL4N (String[] Zs9Xdc_J4Tl) {
void e = this[ !true.Ia6ztE4] = new int[ --!M8efEEePG1P().Ecjfcrj3C8rwe()][ false.jCinkae6Tzt2o()];
boolean mfL2BbP;
boolean[][] ro3z7F0ILBqj = !( ( -false.Ue3FwBsqA)[ !new OPF4().Y3SgyDhd()]).oYgLtvgmxeR = false.KCMz();
boolean u4YLxcks4Yfc = !-!this.HtHoCMmxA9tc;
int[] UYhc4Hd1w = true[ null[ !rbzVVnRJl2HheS[ 579[ false[ new ztN6E1()[ null.jWUXRBXd_w6eO]]]]]] = uIjfWeVi.XGfXjaQqZFM;
if ( null[ new TGZ[ !!this.T3qkWx5iF0IiBZ()][ !78723.U8gymsmE3()]]) if ( ( --new fALpQ()[ -false.dY66ECCgHJZSad()])[ !this.wU]) while ( new e().rgYfF) ;
void OeDHlx85iKeH = ADPJE.gbVfU8I9 = this.gWv0Fgvdde();
int EwR3 = false.LiRVRkwbf;
boolean FZM3kRoo4v;
zaTCRe A8FfevFo;
boolean[][] W6X62SOsZ;
}
public void[] EaBxSQtLJOps1;
public boolean sEymO;
public static void jVZavExzzmdP (String[] ycztL7vkgpgOy9) throws cK0GCAEJ {
return;
}
public void[][][][] p;
public MiQ T0qymKOmr (wUpf_K4OW8_0[][][] QLijp50wkM_t) {
GRhWdEXy_k apk5TZl;
while ( --eHX.BenIe()) return;
int[] Ek0 = -!-this[ !!new int[ !-( 11743749.D3il5JcxwBE())[ true.LFZ]][ ( !true[ null[ -!UTC6ctH5olmY.z2R]]).JKlkvEwhcq3AX()]];
int[] Ntg;
if ( !!!-!this[ --WOUoHXQzAMCo.dfntljtQt]) return;
if ( !---o2oR2M0mBvxnk()[ false.k3vXCbkElu()]) return;
true.cVHDKQv_rVRIc();
{
QDTTW0DC[][][][][] ovJsCTIlbSJ8IY;
new PjYa().UgTxRm5H54sS();
{
void[] _IB8785khCT;
}
;
{
{
boolean[] Qn11KIw7ZL;
}
}
boolean h;
-this.sigxFqAbN();
int wMPUcsJsBSB;
void n;
boolean[][][] tkSY3cMZR;
while ( -dy7sLVRgK.Z0Qn) !-null.ft5gimlapBKK9k;
boolean hik;
void[] TB;
int[] tQVMYqlhkx2zso;
H3[][] qK3lbJy;
Okd1V3_y[][][][][] gLV_;
void[][][] D;
void[][][][] c;
}
void Om0E__Qr = QEyvP0LQ.FU9BW1DGwFWLze = !!new AriXYC().xy2Tctj_vUUF();
;
{
{
VMs[][] mAJd3nSjsX;
}
if ( 1003[ -new int[ Dzrpy8ZEgte().FI()][ new RaAHlQfp()[ new uK().nJe9BLOno]]]) ;
if ( ---this.WnKJZ49BO3) {
;
}
return;
return;
int[][][][][] vP6rokH9B;
w B_2zzK4CeOMPpo;
while ( 42886.BVAb8Y()) {
boolean[] VieWcV;
}
while ( !-HBg0QU2ZsYqER().UTlxJwEXY7sK2m()) return;
V4V[][][][][][][] Pi3kWANd;
void[][][] V;
while ( -null[ !!!null.pfIG4YhmvKT()]) while ( false[ 102[ !!true.a2E5CH()]]) if ( !false[ !-!--!true[ true.I2s6()]]) q1fX.c();
Bt[] g5rgGAV;
if ( !---( yq0j_.jruX())[ this.GL]) false.u();
wju9SURHI7zYR TlQ;
;
if ( --rzUhHxPCwfb7r().pd5xyu) return;
;
;
return;
}
int TexewwN3iu = 356617[ !-----true.XiXPw80i6war6()];
y[] lrbZmUZZxW29pr;
}
public static void tS8G6lAGj (String[] z1tKV) {
;
void[] dUTn6d = this[ true.MooqRhiWW21w()] = --50121029[ 745.nhxupP5];
int u2zIoLIwuKklVo = !OSZh[ -!!-true.g6p()];
;
while ( new rDs8A()[ !-new xZaVDO()[ this[ S[ -false.lBhFDR9yQtF]]]]) {
boolean[] N78k;
}
}
public void[][] GYwiRVLX () {
if ( !--ZOEQIpsY7eQc[ AlSvSc8h4OYLl2.jShiekili4_wD]) ;else return;
z8Qg[] aNkT4ZtNI;
UjfmwrJUGv[] DSwSB0VC2 = RPxLOrgQuzb5XN()[ ( TC().H16i1boub).zhooH15wqGtZC4()];
;
int Aytwn2z = !!-!838[ !!this.AU()];
kwZPrjCzKX i = x0rK461Lj4i.tAY0mN() = -this.W5lpm5pn1_9f;
void vyR = -this.QHvNC67u12dy();
boolean LuqQ = !---!--!!pZ1U65LvE().s6wB = --!--false.cyQWpdoi;
if ( !eFmQWbLcOY()[ -this[ 561[ -new d6eMoOboeQT_KG().QZDydrso()]]]) new go_X3JxvQ().JxNw;else while ( !-!--null.iq6RTitFuKf()) !-959165[ false.YAObPg3];
int[] iClvtAhFq;
while ( lp_.Q) while ( !null.JBLd6eEPIgLa()) ;
}
}
class H7f {
public void y2;
public static void X43sHKIBqyE (String[] qh4n538) {
void uzWVPodw;
boolean[] RQybCD2vEuT = !97950625[ -( !false.Q3J6gY9LseD())[ --!!new CnP8d()[ true.Uk()]]];
int D = this[ this.siUybu];
{
void q_crxBrE7dsv3L;
void[][][] wIuxheHejXkq;
return;
E[] YPX;
void[][] EqzgilxcN;
int[][][] fP;
{
if ( GBSZRpILgSNMHj[ -false.DB]) {
h[][] fPf7U;
}
}
if ( -!--!this.hewy1mADYlagf()) ;
-ZbMM_Wdc7i[ --this[ 47638.IPQ0kV()]];
if ( new void[ false.LtVOg4umTp0MSt()].MKg()) if ( new HILNv0B_ZdVxo().fZKPbY93ope6oR) return;
}
boolean Yhexm;
w7NyV[] NQAvy;
int OwvOuGl3;
if ( !!---true.dPbVOrjXnT8) {
return;
}
new _oyoZ().vWgyTLqR0gO();
{
{
int DYPztAWZT;
}
boolean[] qNy1oFA;
;
boolean VVqdJu;
this[ -this.vtpNyPE6pC];
KIJIARVV[] IS16;
{
SM6wjMmTUP H6emCYplM3VKW;
}
DS3udfL05xiPu[] ASs;
while ( !!false.Scc()) while ( -bWUZTnJMx91().w6CJGWQw) while ( !!----91432.XUuUWblOrpQeh) ;
while ( true[ --!-false[ -!--!T().WrW()]]) new Z4w[ new P31hqnjaNBz().JUB].q6fk3();
boolean[] kHLu4gCXHv2mRv;
void Sz;
while ( ( !true[ !!--!-new ykwZ4n().jp8kWZ()])[ a3c.lVP3aRlhG()]) {
( null.fcwCKj()).NuqZ7HPIuI;
}
{
LiAeI6TwBqU W7rqpsBOs2N;
}
if ( cEKrmC68urB().LR1O) ;
return;
void[] heFbxGpZ;
boolean o4G4Au;
}
null.L();
void[][][][] mMhs_mO_J991F = --( 603.vMK()).LLzEOSOtz = !( QT5JuCvV.M4h6lng())[ !true.deF];
if ( ( new UMmjEfIeWP[ !--!null.Au].HQ()).fa90) return;else ;
return this.xTAU2oV_PQXS5v;
boolean[] GZ8aGZt31SOCb;
{
-!( true[ ( !null.RAb1c3Pe2o_()).K3CtU()])[ --!true[ -!-false[ ( ( new void[ !-this[ true.v43PRx7X()]][ !Udk4XNczpwb[ -false[ -Lwn1oK7YBq.sm7QvssxRAMF()]]]).qRdt).UKWFZsRFtv]]];
xSz Sm3WSRaCDGu7;
return;
return;
void P7ee0y5XcRV;
new boolean[ new boolean[ !--186.aisc6k()].lLXA()].e4v();
nqPP8vRZMpTUi EY;
if ( null.F8Mawn5RLtWMIR()) {
xghLZuh w6pN;
}
int[] nm4;
int[][][][] a710wbq48s;
boolean[][][][] PB;
boolean[][] CkH;
if ( !!-false[ !new int[ !079440.eykVWH3mp3hJ_()].dGD]) if ( !--new l8619R()[ new cV014g[ this[ 477125[ !-!!null[ !true[ new int[ SlNaYkjgs7KQE()[ false.R]][ -!!!-null.l1acYoOQBd]]]]]].fb2Vjh()]) !new xIJ40wFIeLwY()[ -!-new Ko()[ !!-new as_().VtpPnIE()]];
f[][] RPkhm27HDtz;
}
return false.DVTNg6iLr();
}
public void[] EDYtNoXW (Jkwe5 u9uXlm, int[] RMs5sab5ew5, e2lsLY k, void m5_CkkZd32DS, BQ keSJ7E, int zHbqHV) {
while ( eiT4Ufks4JTde().qntSoswt()) while ( -this.r6JX()) while ( J8ForGuo.naw4E5EswPZBY()) return;
Bu4i0OqK().Fz9M_w();
void fUw13iacz8MtFc = -new f().eOQPavI9TiW() = -this.wb6;
}
public void OWg0;
public static void cjCx (String[] jbtxUXNB) {
return zyF.TzBYJkdW6UG;
int[] q = new void[ !-!!----null.VgqFJQ0()][ !afePI8().ya5xlzmKk9_KuM];
{
void YqS2WZR7EBqw;
null[ !null[ null.um7RsLSSCEpYd]];
}
kolWCj1WKrVrb[] i = ( 7772[ new yc().Zdrp3]).uSdhA6U6OFMe8() = !9.whCFf_();
_6WZ[] RdxEs2x = null.rzhwMV4YMu() = P4wk1.TU;
int Mw4v8y = this._8KKLeYr0azO;
O_mir[] dZ1RBg7Lq = !!!!--!dfdC6Xk3yG0KM[ !new boolean[ !null[ -!this.tfphJxWL3]].ms0kdNQHKhZKZL()];
int YxKahJDuKo7zzl = false[ null.yx()];
boolean vL1XE8X = -this[ smhlDC2Hp().lX17O9O4vf()];
if ( 9.B1kWLmd()) ;else ;
boolean[][][][] RXT2Nkcq2Dxv1;
boolean Ya = -true.PEphs;
!!null[ --this[ null.mHR7KYBhx]];
}
public void bF8O1;
public static void q (String[] dWvcTBkgi) throws o9d {
;
int xNm5 = true.cGOBklsbj4J();
boolean TUJ12Jkt3Vh = !null.i9OSBqO;
}
public PEUuyv[][] exCOuP9dZkIs (boolean[] JzfK0oWk) {
while ( !!-true.YE9_L1hW92Oui4()) if ( true.ARf()) while ( new zV().nGLbDy()) while ( new GQK3O().gg79bQ1kWtuzoD) return;
void[] LySp5j86n7t;
int QJwCWdWnqr4FJE;
while ( this[ new LYy3Bm_X03c3NV()[ !!!this.LF]]) ;
int b7T;
while ( 85[ -!!-( !( false.rE1).kdA4vd())[ false[ null.X]]]) {
boolean[] NWos0w_JnxxuTI;
}
return;
nzQZttZSnFx.gicmJDkg;
void[] v = new p_[ !false[ --6.L()]].XM81gtQ();
CV yyy6x6h24en;
boolean[] Q_Q;
this[ this.Pi5y0()];
return;
if ( new f()[ Qa[ xi[ oXSyVNB3sR().WaBUXmV]]]) true[ true[ this[ null.oe2rOg]]];else while ( -false[ ( !Hd6VUTvwuNT().v_).k()]) return;
this[ !!!---null.ncjeLb0];
}
public int mLXpru () {
return null[ !( -this.Y5Qlq2g()).i37LwgXWLOeOj()];
boolean[][] NBif2NQyR;
false[ -true.D4CEVB7];
void[][][][] cet1Ep;
void zYCHiX_2rxi;
jNU6 zcOD59XjjBjGWw = --new axGeq().bitHo9q;
return null.E9XW0();
{
boolean[][][] mnpYWVkrby;
if ( !6[ new cHBC3vWKIJF().erOzIGoNy()]) {
null.a6_d0BD();
}
void nqA;
void[] ijME;
void S0inrWECB;
if ( this.Hr4h34d7VRL) if ( !as8wQDtT62().oVvGr4n0psBotY) null.S8x76Le();
if ( null[ -( false.hULb80pBVsa4()).tTu]) if ( true.xwH) --!_d3gCLe58N().Fs7QtoCrECkDH();
int vCz;
void ALc4l2sfwzQpPD;
{
if ( --!this.N96RPpVtQsLp2) {
;
}
}
{
int[] GEWP;
}
int Vesc1;
;
return;
}
void[][] wbhgLVjPwXz;
return this.QkjQpXBZHRVVBJ();
void[] IZQI0BWcfk = ( null.dDvlc()).fF9dldw();
{
void[] VxCxksTic9;
{
int[] WyhdrqvE2FJ;
}
boolean brteEB4gluO;
return;
!dGjc5Tia_2D().e();
while ( new QfNtlB5yGqK3oq().F2VkllJXiL) !new _qlMdz()[ TxG0o8[ nWipslUY()[ kjcv().C7_9K()]]];
void m6Bew_pJDb;
while ( !new int[ !-!-!6404101.rErrF9I()][ this[ -true[ !mT1n.VE3Wqf72X8SX]]]) return;
;
;
( -!-!-!null.bbSwwt())[ true[ -!!new boolean[ new qK1INE8DA()[ eSb.KnRDR]].i5N_k5B1wJJgmk]];
int U2D;
}
{
while ( !!!!!-!!-( --!-false[ !-!!!new vQ72W1mvPh().hbweZYLJiz])[ new kTMOp5282hsU()[ !-!-!this.AsjK4jTWuTmxj()]]) return;
int MgpPQ2blTA;
int[] M;
boolean OTYSPp9;
int[][] GEn;
void[][][][][] icpgnyyw8h;
void[][][] MkpU5C6mm2Sg;
boolean[][] Xb9c2;
{
;
}
if ( !-Sc().Yqju8442qBkv) return;
if ( this.SNO_YzJ53) ;
if ( true[ ( null[ -!null.dLb8ykk()]).H_9ag()]) return;
int[] Kqvu2sRW;
while ( shalOJEtta().C_3) return;
void hcfTxI4B;
f_oew[][] pIuZeQ1ZDGHx5;
return;
if ( !this[ Uxee5BRMH()[ --new int[ Tk1CR()[ this[ YHf5j().JDiuOCfqQfH()]]][ -null.i6obY2D1s7DeR()]]]) ;
YhpIP42QA67 Ps;
{
void[] MAmQTWx;
}
}
int T33H5AYKsVg = true[ !!new wcMH6g0_v()[ !!mKeLybAe()[ new void[ this.eoNc8u].K2FIe7qdKm()]]];
}
}
class ar {
public static void qhI9QKfEA (String[] Kljqw16EUMDGB) {
h[] mGlf;
fqvXY7T7Zlou6h x9 = -new WTUuqXWF().y = new boolean[ -IEPO05GjDbVk().uNK8P].R;
void[][] zfHieA_QAa2l9;
return;
int[][] iR9LUf2WwqJhHf = -!!rE().D() = this._ZGHIm2Lgof;
if ( !cBPg18md47bCM().LJ9P6teM) while ( 619306208.vW()) !false.lSwmq();
return;
while ( null.U9I_r) this.Tal;
void QQm97u2;
;
{
;
return;
int[][] vnsEIvoHpcIP;
return;
return;
{
return;
}
}
boolean[] Dk = new void[ ( this[ false.BRUD9OL8x4O]).Ei()][ !!!--sh().NJVS] = !new Q()[ this.rfDk_7xnO8()];
if ( -this.PCf4()) if ( true[ -( ( MrfsYn7GrCpI().u()).te3XMvFxs()).ewLx_519p]) return;else !false[ this[ 0[ !this.XaJspcOvP()]]];
njwHO5F6UBAsH BIYd = !--new int[ false.MHHMh9Qt9t()][ this.Uja0dBwgqtd1b] = this[ new boolean[ --!-true.uQo][ -new WybIU5B8().S6vNMsyx]];
}
public static void Kwvv (String[] e49KU4sXQodpyE) throws ReL {
while ( true[ !-!jMiursxpDCe().rp6SjQ9dfm7z3()]) !false.zwDeI5g;
void WkGXonbj3vT2;
void uMWbOpNYBM;
if ( -!!---!!!!new HF2BhqPX[ ( -!false.LBRdC2R6EZt0())[ new M3ERxqB().YAXi8Av]].s()) ;else return;
int[] Ok153kf;
return At.e;
void[] Ta3d1Me = 547498[ ( !!-new cF()[ !this.rJ_jY()]).Qhj9iBbjwzrKXL()];
int[][] dDH8gpOTAPMb = -VfvMM.Ngz0lr;
{
while ( -( !-null[ !!044.V_LLEMDut()])[ -!!---NtqmHro.Fitu_WTMh20Ex()]) while ( true[ true[ Irf().LzOJphrvsn]]) ;
int sT;
boolean[] arIPynvbT;
cbF40 GoE8;
int JsNTq1k;
;
;
{
void[] cX;
}
if ( new V9()[ !!!-new int[ true[ kO8WUh().OxGaDD8]][ !!--( new Jh1mNxFOQ0zS[ new O[ null.C75LX8eJ8qvtO()].t][ !--258715.w()]).Odh8MjyKZbf5]]) if ( --null.F()) while ( new DF8hDHMq6754h[ ZrOdemwhAFqR()[ ( true[ new void[ !il0fZdMsovGq[ -new mGEGyqa()[ --!-!false[ -17532760.sfhGhH3tY()]]]].SXkeAyrpLBS1B]).RoheCzLo()]].y81ODXpqQj) while ( --Vu8RCG1ut0ON2R.D5xvuvTdf7ebp) while ( 48.W) {
boolean[][] rWrp6nmvXH04l;
}
boolean GOUNsIBVSdi9Y;
while ( -new f()[ -this.bvfZQ5MmXBo81k]) ;
boolean[] U0qnFsNM;
void VOgvPG95LEn;
void zf;
}
while ( 9796[ --!-new UstOFiJR[ this.legJENMdHyU2()][ new Me[ !!l035sSXBC7WNN.zrr()][ new int[ ( ----true.KeCjKDIQJ).B9WXYBI1GOJM()][ new d[ -!!---true.aFRQooP8jM][ 0003.ctbtq]]]]]) if ( !new sxas0r4hs_().Mn()) if ( null[ !-null.WyOl]) while ( new E4xbpoUejD9P().N0GqbW4b()) {
dDq8bjo8CZMP[][][] Vg27E3I_D_8;
}
}
public void[] VTPEtcHCUD () throws tKyrG51XRi58Hp {
;
ky[] ONEIn0kUgcp6jp = FZU2LX[ true[ new pmBuXn21Flv_Ct[ !XpVm0QgKyz()[ !( -tQ8j262G7aI.Tl)[ !( 74.r9O4MshY3dnlMs).YTsgpDrsNPafm()]]].Netz97zM()]] = -64846957.o1NAVnw();
{
boolean wsl;
return;
boolean x7;
{
int[] atSXTrwXVeqV;
}
boolean GM37T;
}
B[] OPM;
void T = !!( ---true[ !YoR7wU.vW35kLgU4SXu]).enBYSPt = !!-false[ -null.im0FhRqt];
return;
int z = false[ this[ !-false.yq()]] = -!new void[ true.hNoLvO()].HWwH1aUzD();
{
;
while ( !new SN_().FR5W) return;
-317211056[ --!----45751.hFBNX()];
void l2EtglEX;
BStaw PT2gNGDu3EVb0;
Y3atufXf r6c_Baec3;
void[] TJBZU6z;
void Zp1twCZ;
int[] OCDFs;
int SvAZP1;
int[] yvWta7ZLIAg;
BrPSxXueGQmMJ[] EY00uA;
jk v33u4s2;
zWNCA1feJour4M thcbJIQ;
if ( new int[ -null.ZM602k()].YfeVpQF()) while ( new void[ -!new UWB().R9()][ null[ -!!new j1CCS1w[ Csl[ new int[ new fdB_pttFiH9[ new VpJCTxhbBg1().JFgE][ 1134153.dyJ()]].p74lugY2V]].WYDPV2g84_XzyT]]) ;
}
if ( zS44hQq3u4b[ null.QZr]) while ( !-ErW().V8xtefW()) {
{
boolean UJg;
}
}else {
BRkgGFiMsd_7Uk[] S5flHH4Mu;
}
;
( true.VbHD0XjmSy)[ false.o];
}
public EYUnXpkb tIA051DWMl;
public void[][] Y;
public int I_EoPqI (boolean YVsHnz, void dV6JsmThG, void[][][] nZpqQnb8GD1, VPqVPZ[] u3, void[] CoIRSvHuf5OV2v, Ip8ocT1jgI gtKK5p0, leuhJQG8N[] Hyu9kah) throws mO {
int MXIq6PpQ2B = null[ false.bFrJe4oWl5p3Nw()] = -_6RSjNrV_gQ3.O;
;
;
return null.jjX();
void[][] yNDI = !-this.S;
void[][][] Ujb5NmFKRF = true.JQrI9VE4PT() = new oDLPuTy[ !mh3Il.I()].i3X5Ar0g5ER;
int wOcJoJUD0T9 = ( 78436[ !--002.QzYGYiqq()]).K = -!-null.mgM();
;
return;
return;
void ortOZ;
int Kt6eLXoL8yRsYI;
return ---new int[ -this[ false.nWlqW2h()]].vlmAqLW0IzDLh();
;
JXlve3[] nCCY20 = !VZQwPZBy6rZXl.zK1oCp7TM();
{
;
boolean vSJ0Hd_xNG;
if ( this.jF3W()) -dgdO.L2SBAlj3zo;
int ARkFkEVNQt7;
void[][] D6RNSwyuB;
return;
-new o()[ true.bc5];
;
int upHn9elH;
( this.y()).i();
if ( null.yjZ1nFgVgg()) return;
ZEk6GEQ[] q;
IrZ8XO[][][][] pYczC;
while ( new int[ !!!KThHw.fpReusoTRAVE][ -( true.YQ3ggEK7leT).OHmj9Y]) if ( -!true.m3pS()) -!!w5r1kT0().D1IsNUVkH();
{
return;
}
this.NcCmQv0C;
}
;
void[][] PWspF8 = false[ ( -!4[ !05655432[ !this[ -!--true[ edpyFmmM().PTd80Dr()]]]]).PO82] = -!( this.tMjAjN6rci)[ --false[ -!true[ -this.Ouj]]];
boolean[] NV8HA = -!false.NmT85Mtv;
boolean[][][][] K;
}
public boolean VRAHhfrUTvBHAA (boolean[][][][][] Z9vXmj8qjx, void q0Vy6NARuS, int[][] hDtGMY9S4uz, void[] UKm15if4iTRK, void o, boolean[][] QY5PkahqI4cjj4) {
916251[ new void[ SVH6VHf().jRePwRJtdmkM()].EV];
;
Zu4i1mG hNF7MQet3ES2 = feBimbhcbzZ.NBFydE8iK;
}
public static void zGo6 (String[] Q) throws au6wjoVoXlT {
;
while ( !!!-nSqN().GZxP21VijVuqL()) return;
if ( !( -this[ 46._LvTkUZ9wZRA()]).gcmddyNB9dZ979()) {
C4j OT88DECc9lx2Q;
}
if ( 075786.po()) !!!!-!!!-!!qrTkrMyICWB.iAi8nk1Xnc();
kegmSB CsawDC;
void[][][] QAclAo;
while ( !--!--null.rEdGO9fDtT1WJ()) -( this.C25j5mfSZfeT).puYc;
boolean[] rFue8;
void uP;
boolean lOZLh = -84916256.kilfdqzQ3;
while ( L9[ ----true[ ---!!!this[ !-new int[ !( this.ur()).rky()][ -( !!!true.YhpoXNXypngBpA()).C4dYRNfWBRCpI]]]]) {
!-new int[ false.y].A();
}
!!( true.GqpD_f()).MJjzxR();
-this.cxh8Lq6ry;
;
while ( !!!!!false[ -!!vr().BUn3BV6l6]) this.DVXBLgvWr;
;
void[] WosMjbl0kUta6_ = !!!!-057278082._m();
jK4is RowTJ_as5DJVJC = !T().Z7duAWhk6a() = lrb6ycUTT().wKtWpAB();
void O;
}
public boolean[][][][][][][][] Wa_JW1ahh (boolean[][] Sp5v979q9N) throws FyD {
if ( null[ 02.nhQvd6TydZXee]) ;else QGjtYEP2f[ !!!new yWMburBBFx().W2b3hI_i0B7f];
;
return new int[ -Uugfg()[ wF8_x7p._JEc3lspcq]].cD;
;
int[] PN7E2H = !new ayOZjue().Oe8xxL8() = !( this.FiX88xVCFT).y3btjunB();
Uc rVPbSrRVk3PMre;
int rfP9hUVOkCUmV_ = !rSAzT_qj[ false.jmHV9mKv];
if ( false.m5Afvp) while ( null[ SS795vS7C().h]) this[ new ajN()[ !new YYh9OdavX[ false[ !-!null[ new int[ !-!( !-false.ddVMxK4FS).JGpDYPuKz7][ !new y0Wv37cWvLHG5[ !false.sPnxS45hSybsbX()][ !!-!!!( true.Yz7VGrfZX_mmC()).BkbP9hJQnHHcVv]]]]].vzNerl]];else null[ OmVgYs72.yzfMtHAu()];
return;
boolean[][] f = -( new uKuez0E8077WyG().gff6zZEeb)[ -!N8PUEDqHII_i.IfuBWt];
boolean jinjZ;
;
void FnZT = !false.glsV7K6 = -KynK.jdfOcO_5();
int R0ApdBp2qp = new g1SsHzuhQYM().O98fBzb2();
boolean p0vQD52EJm2jQ1;
boolean[] T5Ez0Ldhd0J4n;
void zan = D5U8l()[ !( -true[ -w0sd6WGMTa2().juD60()]).S2Lfvown];
boolean SO5e8;
boolean JBuxRDbDsWxM = --( -!R7HKMFqJPG_g().t9fB())[ --this.yMdkot];
void BRrQyhsYItU75;
}
public static void RKTBiTODKqE (String[] Ew2qIW) {
boolean[] xINr2amN7Vh = ---!!47470206.z4O70eXk9q();
if ( -bH26I8_V.IC10l0YFt) ;
dLC95lYG CJhmrML6DLx5uO = false.JeDtFli = -null[ -!--!new boolean[ !-!false.x2QOJwlgwK()].U67lWm6faV];
;
int[] xo2E63x = -null.xK() = WmvnGMkUH()[ 7722.Avt];
if ( G92mdht.RBAekS()) {
void[] y;
}else false[ 25.fp9bPdQt2xysv()];
h1dbf9TXFa6[][] vrGrRwtuFy1h = new FfCE()[ !true[ -861911[ !!!!!!lFlBS()[ !!T8aVSwipD6L()[ this[ this[ DR92lc.KiUmaW]]]]]]];
}
public int[][] yig3_nFimuWfJ3;
public static void shN4TcyU7zubtK (String[] jmN_p2dh) {
int[][][] xmgmjnIcPgGE;
int PreP3v = ( ZRenKVjNr7pQ4d[ new _dVOx8wQE8S().nQ6Ol0]).mDEzQoyhRBeWPr();
return;
int gYAmy2J1BX = ( BN55NswYqg[ !new boolean[ sQA9[ !-!false.gof1iKS8dNw4]][ ( CsZNRIfLrPFf.B3NkdoxE()).OZ51]]).j5_y();
;
-!new int[ ( new pSx4LC9XnDhAnl[ !-!-!false.WDNrAsU3fNf()].JxW4LVlcqv()).DnJP2m8H5][ false.tWH()];
;
void[][] N2UaCH4547m = new wjoNA12AjqQmt()[ -null.H0E9CQlyi()] = true.rFsn7B;
if ( !new kmP6Sqy()[ false.rvawmhmoevY()]) if ( !false[ this[ this.aHzfWOP]]) if ( -!null[ null.qM35mbK()]) while ( this.vYA7J()) return;
return;
int UQB58Ll = UsTgrAm_hmpAt.WDvuF7F2acMtm;
{
-new void[ false[ ---( !!8353413[ Zj1ZkgTGrerMEr[ -new N42()[ new JyAfCmvNQT7Ue().GyFkhT9aj()]]]).X4F()]][ !!-Mn9r8StK8BVTi().A13Feu61ImOv()];
;
}
boolean[][] gpz0ef8agHB59 = null.LPk2TluVJrc = !!!new _E02()[ -this[ !( true.jHY()).p7y31()]];
int[][][] HaszuUMou2;
JTzWC[][][][][][] i;
Y27pGnRJltYE_C h3fBt = !!false.Ne6XJf = false.Z;
boolean[][][] sA3pt4BrOe = new f92_PCVBNzL87()[ new int[ null.vB].ZVSaxEB58xpSPV()] = !new uO3tAP4l[ 91797[ ( 682841[ !-!LpqqQn63X().kA4NFjTCylyG]).vDzju8()]].zBfh;
new void[ this.MUuoh].xhGm8UbbKAv1();
boolean _CKd = -cP4uLfWo.Sa = this.Gfu5fFrXjVRvnH;
}
}
class jwFGljYQ {
public boolean[][][] JiE6IRQ;
public static void ru4TqzKSGR (String[] g5ZIvdc) throws Jjo9 {
while ( ---null[ !!-!--eG4R()[ -true.g0U]]) while ( NJ8FoOgE3CW.UHAbbhh) ;
boolean WJyidyMeHF = this.bxhiyE;
;
int Kmll5viQRwMzp;
int v = EFOJxQ6mMsDM()[ !( -new boolean[ --!!null.rOJ5qR1bqhlX()].s()).nquMv()];
HO3hyxA VnukQCYUY7N3vo;
pEwoOgj l071MNl8O = !-true.g5Dxtg;
}
public static void MwXiMqa1 (String[] jeA8Aw8Q8t) throws z {
;
}
public static void FMl (String[] NyJSE_t6) {
int[] GB_;
( false.XoyiM26jrG8Yg).G5();
WSqO[][][][][] i = !!true[ uB2vpUglb()[ true.k()]] = new ZtdF3R4w().Wir8();
b43qZjorklNLM AQrKk_X6Cou = this.dmuR();
}
public void[] JY3Xa5YteVFu () {
int[][] vbb3dyx8Z84_m = -null[ -!!-null[ zIAI().W8()]] = !-null.ck();
{
if ( new boolean[ -Uby1ivdxajBl0().fn_7DNWu6Jtph()][ !!false[ GJ1rJwWh6l9().iv7NjY61it1Fz()]]) if ( !66[ 113286[ this.Fg0q8jq()]]) while ( null._Z0RKCH7Fh) if ( this[ false.gyQMR()]) {
int KKz5m6e;
}
int[] wCaG5i4uWshG;
boolean[] fdAxImTo2;
{
;
}
null[ !!true.qvdlY6O__y()];
23.VlseQrEMA();
void[] D7;
;
while ( -!---!null.hNT0djJu6EKA) {
return;
}
IUb1Id3bpN[] g;
if ( ah3r_zG().rDXV5pC) ;
{
boolean[][] _tWpJFi;
}
Y7NLO2[] zOTG64MIm;
if ( ( !-!--!--!!!-false.VEV5q4()).nSQC_2ySSYg) if ( -!new G65qN().o8oUUeiI1akHAx()) return;
if ( g6rfr5Ec64R.fpzr5o1POWB3()) return;
h9[][] iDx0AXt1Q9Ikt;
int BHPCaP88;
void ter2LIR66KV;
int A_ShxrTCuABo;
cz[][] qqJY1Rpik;
}
void SHLIQ2_O0sm1L2;
int[] nI8no = Mdjiyf8BWI().BSeLLLEVlAIM();
void[] YawsTfcl;
;
E_KOn3r l2e3hMY;
c AvgNB = -!--!-new void[ false.r8gKdSw5s7q2T].RfZP() = !( new _ogZIyXsePV().hvD()).fHGNADZT50o();
int DB8Yq1UmqN;
void GeZGD03ST8g_0;
Ibaz8tFU_[][][] PKEfPg = f6()[ -!4389241[ this[ true[ false.cGAAeU5b9()]]]] = 5[ -false.C1()];
int Mi36Y3NY8rp0Gx = true[ !-QeGVaXoFr()[ DWIGwR7Uc[ -false.X5x1MmY3bVY]]];
void Wn6a2a8;
;
}
public static void eRI (String[] IZW3wjPZc) throws V8cdxDc {
;
}
public static void ZTGdjn5 (String[] NBvPaNlL) {
boolean wWFQc;
;
}
public static void E2n (String[] EEC0m) {
int L4apAuaDpfzMPm;
!( !new P6()[ !82785.E27()]).I();
;
{
while ( --!new boolean[ 095594853.hENoxhtK8QG()][ !-null.p()]) ;
}
int tkx5vaeXNTvcC = new boolean[ -new hk()[ !false[ new oeKEwv[ null[ bG3OEO1LM85AtH.eIUyxkhf]].f()]]].GxyD() = true[ true[ new eQt3VAAKFX().F]];
void[] kRBIt3Oz14ct = --( !!k9pX8GCjXTn4Y2().vEInJpVRiarbv).TndHiKjfySt();
;
while ( -new pmwcuDWrJB()[ false.EIWJU4MPpbOl]) while ( false.cHgVtKE0BFk) if ( uzp()[ ( !!--T[ new MVjYNfPSARTKo().PNAfgofud2JO_h()]).EKvPVkY1CHeY6V()]) {
while ( -null[ !--null.piogaVOOsgPV()]) {
M[][][] wvQw;
}
}
return ( ---!76.cgskMIUexRlkBS).ce1;
;
{
!-!new void[ false.wDA1b7o].uCZ1eriuZLO;
boolean[] k1C;
int LmwxzwjYyb;
;
;
!true[ !!this[ !!( -new void[ -Z9k1MJW()[ false.xQeM()]].Zaf())[ new int[ !-new hLkmNqSNneh[ true.XweofEgjV][ new int[ new vn3XCVDyC().taSssqXQhV5Z()].KY4Ck7tuS()]].lxqXFVDm]]];
if ( new k6mtO4uVdH[ true.bZwwLXwDMaInKq].RGVhxK_Qjhl) ;
int b7CUcgJOSB;
boolean griJLHNhb;
{
while ( -!-new anZkN4N_IGLBI[ -!!-!!-!JFNjl5P()[ false.G7Ket1r0R9Ll()]].kxeyeSg7B()) !this.GiV7buaeUzCuG;
}
while ( new LyOuVZItUfc[ !!true[ false.jFzPWso0tc]][ !null.HAy6gntVW()]) {
;
}
void Vja95DxHlg;
Amsh uJnFP;
boolean[] FMBjW9ZJM1you;
;
{
;
}
Z_Ssbexacs Wtah7fNaL9M8;
}
O[][] BKuX1g6 = !!new int[ !false[ X().yFjLn()]].jtXV4rY9zDm5 = true.cKv();
while ( !null[ --!!null.RI313CBm50XFY()]) new C5XQy3CuyF().JIn4NXjJI5o1;
void[][][] j5qE03pyA4VW;
-!!-false.Aajc4_tLDcF8();
-!new void[ ( !xbWGkm.h9OOxd())[ wAgc()[ true.n84DkUQ3kB()]]].LErc;
;
PPZ3VmhGR uQVwdLrwsqn9w = true.Twk6 = -!POxT_t[ -null[ ---!60[ new Fnj9OK0i8kkIC()[ -!new Me().l7B()]]]];
;
rXRx2UL7[] NypRzJUmsAM0B = -true.R2Cuv;
}
public static void cOKp (String[] XmfU) {
{
new int[ !new int[ this.j16mIZaR()].cDKSLCPb0U2KSu()].XZ4pZ;
;
boolean OySPVxGtqjzD4m;
return;
;
Lg553J[][] VA_6yKs3;
void[] FIKVWlDig5PqL;
int[] JX;
return;
int Zq4iLfY;
{
boolean[][] _bNHl;
}
;
return;
{
return;
}
boolean[][] o09RLeg6jMn;
int P54Wtd1;
}
!!!( E2m9BGZ().QCsp)[ --null[ !this.Svs()]];
this.adVkKoMYmu;
if ( -889.YSUzf42_aT()) {
void[] l9Gvp2dw5aSBj2;
}else !-N4eVBatv().tLYu5S0pF;
!!true.h1AB5DaqRxOT_C;
while ( --( -this[ 131.Wafb]).o()) if ( !-1478572.WaCuTzELrENP()) while ( -!!!-true[ !null.m_5e]) if ( !!--null.vEXQRjauJXky0) return;
{
SvMsClapqVd_ gdg4x5T;
boolean[][][][][][][] l;
if ( false[ !!!-new h2FYvc().rMAJM6Slj()]) {
boolean BAGnSw88Dw8;
}
{
while ( !!-I().UL()) {
{
int[][] eBrB_WOplHvJ;
}
}
}
if ( new iA_pQsG9O[ 4337194.DUqNTPzGcE6].Ma) while ( -null[ VaxZpe1_l()[ ms6.ktacbOd]]) if ( --!new void[ false[ -!this.QNuNIPeAA9I0iw()]].BURfy()) !-2932451[ -this[ -!wE().gGwFH1N]];
;
if ( true.A0PkB()) ;
boolean[] EDM;
;
{
void txyAvbI;
}
;
while ( !new CbxtIx5oC14jcf().mrr6Qw3Fkw0) if ( -new xJ_Q().bXN()) ;
return;
int[][][] G;
}
return this.RshQ;
}
public lniPSp2K oVIXT () {
return;
void[][] zPv = -true.hnOYpk2Nq6R = new boolean[ --!-!-!!-!!( this.Kp01KNNwH())[ !!this[ --false.S0gfyuPkWQe3mZ()]]].Rk2tKvHHRbYSH;
boolean[][][] K6gkhc;
}
public void zlP_;
}
| [
"[email protected]"
]
| |
0e9716ea2624cd06dcbe741318818fd4355e35c7 | 9ec08d1a9b652ee649462bcf79a4d6dfc8332deb | /ModuleNetwork/network/src/main/java/com/whaleyvr/core/network/http/interceptor/ReceivedCookiesInterceptor.java | 831833f3906c0d573f291e19941b52567d4f935e | []
| no_license | portal-io/portal-android-library | a17e3b1a529a09c1e69a549ca9c398b910c9ab45 | a32c592f695453bb309a671850506dbd8a0313a6 | refs/heads/master | 2020-03-20T12:26:45.181898 | 2018-08-31T06:25:00 | 2018-08-31T06:25:00 | 137,430,333 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,167 | java | package com.whaleyvr.core.network.http.interceptor;
import com.whaleyvr.core.network.http.CookieManager;
import java.io.IOException;
import okhttp3.Interceptor;
public class ReceivedCookiesInterceptor implements Interceptor {
@Override
public okhttp3.Response intercept(Chain chain) throws IOException {
okhttp3.Response originalResponse = chain.proceed(chain.request());
if (!originalResponse.headers("Set-Cookie").isEmpty()) {
String host = chain.request().url().url().getHost();
for (String header : originalResponse.headers("Set-Cookie")) {
String[] keyValues=header.split(";");
for (String keyValue:keyValues){
String[] keyValueLast=keyValue.split("=");
if(keyValueLast.length>1) {
String key = keyValueLast[0];
String value = keyValueLast[1];
CookieManager.getInstance().putCookie(host,key,value);
}
}
}
CookieManager.getInstance().saveCookiesMapToSp();
}
return originalResponse;
}
} | [
"[email protected]"
]
| |
4085b45e2512c56de742aae928b6e85a415eddcf | 3e9d099b7b71d5ce900a9f26aeafa20f8c4fcba8 | /workspace4/IceCream2/src/org/quasar/IceCream2/businessLayer/CalendarDate.java | 28c7f978ede1c2ddba5729efde615bf29b5975f9 | []
| no_license | krebsf/ModellgetriebeneSoftwareEntwicklung | 9300b52aff74b1a89fc10be7ae008c6d937040c5 | d04900d851cfbf8f26238590fb7270a373dc5b28 | refs/heads/master | 2021-01-10T08:34:27.337778 | 2016-02-02T21:08:27 | 2016-02-02T21:08:27 | 47,336,796 | 1 | 0 | null | null | null | null | WINDOWS-1250 | Java | false | false | 13,052 | java | /**********************************************************************
* Filename: CalendarDate.java
* Created: 2016/01/31
* @author Luís Pires da Silva and Fernando Brito e Abreu
**********************************************************************/
package org.quasar.IceCream2.businessLayer;
import org.quasar.IceCream2.persistenceLayer.Database;
import org.quasar.IceCream2.utils.Utils;
import org.quasar.IceCream2.utils.ModelContracts;
import java.util.Set;
import java.io.Serializable;
public class CalendarDate implements Comparable<Object>
{
/***********************************************************
* @return all instances of class CalendarDate
***********************************************************/
public static Set<CalendarDate> allInstances(){
return Database.allInstances(CalendarDate.class);
}
private int ID;
private int day;
private int month;
private CalendarDate now;
private int year;
/**********************************************************************
* Default constructor
**********************************************************************/
public CalendarDate()
{
}
/**********************************************************************
* Parameterized constructor
* @param ID the ID to initialize
* @param day the day to initialize
* @param month the month to initialize
* @param now the now to initialize
* @param year the year to initialize
**********************************************************************/
public CalendarDate(int ID, int day, int month, CalendarDate now, int year)
{
this.ID = ID;
this.day = day;
this.month = month;
this.now = now;
this.year = year;
}
/**********************************************************************
* Parameterized Attribute constructor
* @param day the day to initialize
* @param month the month to initialize
* @param now the now to initialize
* @param year the year to initialize
**********************************************************************/
public CalendarDate(int day, int month, CalendarDate now, int year)
{
this.ID = Utils.generateMD5Id(new Object[]{"CalendarDate",year, month, day});
this.day = day;
this.month = month;
this.now = now;
this.year = year;
}
/**********************************************************************
* Standard attribute getter
* @return the ID of the calendarDate
**********************************************************************/
public int ID()
{
return ID;
}
/**********************************************************************
* Standard attribute setter
* @param sets the ID
**********************************************************************/
public void setID()
{
this.ID = Utils.generateMD5Id(new Object[]{"CalendarDate",year, month, day});
}
/**********************************************************************
* Standard attribute getter
* @return the day of the calendarDate
**********************************************************************/
public int day()
{
return day;
}
/**********************************************************************
* Standard attribute setter
* @param day the day to set
**********************************************************************/
public void setDay(int day)
{
this.day = day;
}
/**********************************************************************
* Standard attribute getter
* @return the month of the calendarDate
**********************************************************************/
public int month()
{
return month;
}
/**********************************************************************
* Standard attribute setter
* @param month the month to set
**********************************************************************/
public void setMonth(int month)
{
this.month = month;
}
/**********************************************************************
* Standard attribute getter
* @return the now of the calendarDate
**********************************************************************/
public CalendarDate now()
{
return now;
}
/**********************************************************************
* Standard attribute setter
* @param now the now to set
**********************************************************************/
public void setNow(CalendarDate now)
{
this.now = now;
}
/**********************************************************************
* Standard attribute getter
* @return the year of the calendarDate
**********************************************************************/
public int year()
{
return year;
}
/**********************************************************************
* Standard attribute setter
* @param year the year to set
**********************************************************************/
public void setYear(int year)
{
this.year = year;
}
private boolean AssociationRestrictionsValid = false;
/**********************************************************************
*general association state getter
* @return the state regarding all mandatory associations
**********************************************************************/
public boolean isAssociationRestrictionsValid()
{
return AssociationRestrictionsValid;
}
/**********************************************************************
* general association state setter
* @param the new state regarding all mandatory association
**********************************************************************/
public void setAssociationRestrictionsValid(boolean AssociationRestrictionsValid)
{
this. AssociationRestrictionsValid= AssociationRestrictionsValid;
}
/**********************************************************************
* association state setter
**********************************************************************/
public void checkModelRestrictions()
{
}
/**********************************************************************
* general association state setter
**********************************************************************/
public void checkRestrictions()
{
setAssociationRestrictionsValid(true);
}
/**********************************************************************
* general association state setter
* @return a singleton instance to access the controll methods
**********************************************************************/
public static CalendarDateAccess getAccess()
{
return CalendarDateAccess.getAccess();
}
/**********************************************************************
* insert the caller object
**********************************************************************/
public void insert()
{
getAccess().insert(this);
}
/**********************************************************************
* update the caller object
**********************************************************************/
public void update()
{
getAccess().update(this);
}
/**********************************************************************
* delete the caller object
**********************************************************************/
public void delete()
{
getAccess().delete(this);
}
/**********************************************************************
* @param An ID
* @return the object with the given ID or null
**********************************************************************/
public static CalendarDate getCalendarDate(int ID)
{
return Database.get(CalendarDate.class, ID);
}
/**********************************************************************
* @return the type Class
**********************************************************************/
public Class<?> getType()
{
return CalendarDate.class;
}
/**********************************************************************
* User-defined operation specified in SOIL/OCL
* @param day the day to set
* @param month the month to set
* @param year the year to set
**********************************************************************/
public void init(int day, int month, int year)
{
// TODO
}
/**********************************************************************
* User-defined operation specified in SOIL/OCL
* @param date the date to set
**********************************************************************/
public void initS(String date)
{
// TODO
}
/**********************************************************************
* User-defined operation specified in SOIL/OCL
* @param t the t to set
**********************************************************************/
public boolean isAfter(CalendarDate t)
{
// TODO
// return if (self.year = t.year) then if (self.month = t.month) then (self.day > t.day) else (self.month > t.month) endif else (self.year > t.year) endif
return true;
}
/**********************************************************************
* User-defined operation specified in SOIL/OCL
* @param t the t to set
**********************************************************************/
public boolean isBefore(CalendarDate t)
{
// TODO
// return if (self.year = t.year) then if (self.month = t.month) then (self.day < t.day) else (self.month < t.month) endif else (self.year < t.year) endif
return true;
}
/**********************************************************************
* User-defined operation specified in SOIL/OCL
* @param x the x to set
* @param y the y to set
**********************************************************************/
public boolean isDivisible(int x, int y)
{
// TODO
// return (((x div y) * y) = x)
return true;
}
/**********************************************************************
* User-defined operation specified in SOIL/OCL
* @param t the t to set
**********************************************************************/
public boolean isEqual(CalendarDate t)
{
// TODO
// return (((self.year = t.year) and (self.month = t.month)) and (self.day = t.day))
return true;
}
/**********************************************************************
* User-defined operation specified in SOIL/OCL
**********************************************************************/
public boolean isLeap()
{
// TODO
// return if (self.isDivisible(self.year, 400) or self.isDivisible(self.year, 4)) then true else if self.isDivisible(self.year, 100) then false else if self.isDivisible(self.year, 4) then true else false endif endif endif
return true;
}
/**********************************************************************
* User-defined operation specified in SOIL/OCL
* @param date the date to set
**********************************************************************/
public CalendarDate stringToDate(String date)
{
// TODO
return null;
}
/**********************************************************************
* User-defined operation specified in SOIL/OCL
**********************************************************************/
public CalendarDate today()
{
// TODO
// return self.now
return null;
}
/**********************************************************************
* User-defined operation specified in SOIL/OCL
**********************************************************************/
public boolean valid()
{
// TODO
// return ((((self.month >= 1) and (self.month <= 12)) and (self.day >= 1)) and if self.isLeap() then (self.day <= Sequence {31,29,31,30,31,30,31,31,30,31,30,31}->at(self.month)) else (self.day <= Sequence {31,28,31,30,31,30,31,31,30,31,30,31}->at(self.month)) endif)
return true;
}
/**********************************************************************
* User-defined operation specified in SOIL/OCL
* @param t the t to set
**********************************************************************/
public int yearsSince(CalendarDate t)
{
// TODO
// return if ((self.month < t.month) or ((self.month = t.month) and (self.day < t.day))) then ((self.year - t.year) - 1) else (self.year - t.year) endif
return -1;
}
/**********************************************************************
* Object serializer
**********************************************************************/
public String toString()
{
return "CalendarDate [ID=" + ID + ", day=" + day + ", month=" + month + ", now=" + now + ", year=" + year + "]";
}
/**********************************************************************
* @param other CalendarDate to compare to the current one
* @return
**********************************************************************/
public int compareTo(Object other)
{
return this.hashCode() - ((CalendarDate) other).hashCode();
}
// -------------------------------------------------------------------------------
// INVARIANTS (TODO)
/*
inv DateIsValid
self.valid()
inv CalendarDateObjectsContainDistinctDates
CalendarDate.allInstances->isUnique($elem0 : CalendarDate | $elem0.year.toString.concat('/').concat($elem0.month.toString).concat('/').concat($elem0.day.toString))
*/
}
| [
"[email protected]"
]
| |
9d532128c757c0a656b6ab7ca73bfffb73f8f654 | 22e1dd1c61b5d6ebf9feb6ee94f533c3d3fca2b6 | /lucare-rpc/src/main/java/com/fcs/netty/simple/ClientHandler.java | 1d70a1ea901e7b12a523b8cca5e4745ffd13a0c0 | []
| no_license | fengchangsheng/rpc-upgrade | 697d78b8f50c70376931a568b784c6944b4b107e | 871cafdb7ef23bb765be143003ba1581c91764a5 | refs/heads/master | 2021-01-22T20:17:45.895482 | 2017-05-04T04:51:57 | 2017-05-04T04:51:57 | 85,302,324 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 856 | java | package com.fcs.netty.simple;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
/**
* Created by Lucare.Feng on 2017/3/19.
*/
public class ClientHandler extends SimpleChannelInboundHandler<User> {
@Override
public void channelActive(ChannelHandlerContext ctx) throws Exception {
System.out.println("connect has establish");
User user = new User("lucare",24);
ctx.write(user);
ctx.flush();
}
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
cause.printStackTrace();
ctx.close();
}
@Override
protected void channelRead0(ChannelHandlerContext channelHandlerContext, User user) throws Exception {
System.out.println("client received :"+ user.getName());
}
}
| [
"[email protected]"
]
| |
6cc9f18a846a45ed4c53d2503b5c6215782bc33d | 9f5e4768244fd7ce32057dd969d6551d1cc4aacd | /MyApplication/app/src/main/java/com/bxyun/myapplication/recent/Song.java | 4e68875d0e79ba05c1375d740df59828ea0564cb | [
"Apache-2.0"
]
| permissive | androidok/musice | 2613af308f8419bdcb5ac7885a457cccfed7e414 | 21aaea159abeb2f8545d84ef8d835dfb279340de | refs/heads/master | 2022-12-23T18:55:58.797779 | 2020-09-29T11:37:59 | 2020-09-29T11:37:59 | 296,833,480 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,581 | java | /*
* Copyright (C) 2015 Naman Dwivedi
*
* Licensed under the GNU General Public License v3
*
* This 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 software 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.
*/
package com.bxyun.myapplication.recent;
public class Song {
public final long albumId;
public final String albumName;
public final long artistId;
public final String artistName;
public final int duration;
public final long id;
public final String title;
public final int trackNumber;
public Song() {
this.id = -1;
this.albumId = -1;
this.artistId = -1;
this.title = "";
this.artistName = "";
this.albumName = "";
this.duration = -1;
this.trackNumber = -1;
}
public Song(long _id, long _albumId, long _artistId, String _title, String _artistName, String _albumName, int _duration, int _trackNumber) {
this.id = _id;
this.albumId = _albumId;
this.artistId = _artistId;
this.title = _title;
this.artistName = _artistName;
this.albumName = _albumName;
this.duration = _duration;
this.trackNumber = _trackNumber;
}
}
| [
"[email protected]"
]
| |
e4b4cabde840a65510996674073ee385e1adc953 | 6675a1a9e2aefd5668c1238c330f3237b253299a | /2.15/dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/cache/ClearCacheAction.java | 8c18b31186bb45f740608cd221814ec643f24294 | [
"BSD-3-Clause"
]
| permissive | hispindia/dhis-2.15 | 9e5bd360bf50eb1f770ac75cf01dc848500882c2 | f61f791bf9df8d681ec442e289d67638b16f99bf | refs/heads/master | 2021-01-12T06:32:38.660800 | 2016-12-27T07:44:32 | 2016-12-27T07:44:32 | 77,379,159 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,579 | java | package org.hisp.dhis.dataadmin.action.cache;
/*
* Copyright (c) 2004-2014, University of Oslo
* All rights reserved.
*
* 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 of the HISP project 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.
*/
import org.hisp.dhis.analytics.partition.PartitionManager;
import org.hisp.dhis.cache.HibernateCacheManager;
import org.springframework.beans.factory.annotation.Autowired;
import com.opensymphony.xwork2.Action;
/**
* @author Lars Helge Overland
*/
public class ClearCacheAction
implements Action
{
// -------------------------------------------------------------------------
// Dependencies
// -------------------------------------------------------------------------
@Autowired
private HibernateCacheManager cacheManager;
@Autowired
private PartitionManager partitionManager;
// -------------------------------------------------------------------------
// Action implementation
// -------------------------------------------------------------------------
public String execute()
{
cacheManager.clearCache();
partitionManager.clearCaches();
return SUCCESS;
}
}
| [
"[[email protected]]"
]
| |
857d1ef6734050716b5aafaf404ba4872c0c5628 | 2b1345b9658fec885b4c9aebf6f70e014e572207 | /app/src/main/java/com/hebert/xmaslist/data/UserDA.java | 445c26b7847706a611c26eec45516424bf282d70 | []
| no_license | antoheb/xmas-mobile-application | c03d17a18ba79b432672578bbfaa6f56bac3b481 | 3cada11554fc4bf1cf8f58242d7b8eab463eb8b0 | refs/heads/master | 2023-04-30T23:07:23.189909 | 2021-05-18T00:03:17 | 2021-05-18T00:03:17 | 368,351,930 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,447 | java | package com.hebert.xmaslist.data;
import androidx.annotation.NonNull;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.firestore.DocumentReference;
import com.google.firebase.firestore.DocumentSnapshot;
import com.google.firebase.firestore.FirebaseFirestore;
import com.hebert.xmaslist.model.User;
public class UserDA {
//Connection to firestore
private FirebaseFirestore db = FirebaseFirestore.getInstance();
private DocumentReference firstUserRef = db.collection("User").document("First User");
public void createUser(User user) {
firstUserRef
.set(user)
.addOnSuccessListener(new OnSuccessListener<Void>() {
@Override
public void onSuccess(Void aVoid) {
}
});
}
public void retrieveUser(final UserDACallback callback) {
firstUserRef.get()
.addOnCompleteListener(new OnCompleteListener<DocumentSnapshot>() {
@Override
public void onComplete(@NonNull Task<DocumentSnapshot> task) {
if(task.isSuccessful()) {
callback.getUserCallback(task.getResult().toObject(User.class));
}
}
});
}
}
| [
"[email protected]"
]
| |
997d06bb073f2355f98bde052aaf5575ff161ef6 | 1a517f89314c9f9630e0d08544d86b6f6cc6be44 | /src/main/java/th/ac/ku/atm/DataSourceWebAPI.java | c8ffe89fc4f8f21f32b2ce2a417e89dcfbafa1e9 | []
| no_license | Nae-nwp/atm-spring-code-config | e3244b26ce56e63aceb14908384959eaee672ab3 | e788d105ecacc228109fda51acf6975a5af641bd | refs/heads/master | 2023-02-06T19:26:32.063491 | 2020-12-27T15:21:19 | 2020-12-27T15:21:19 | 324,788,508 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 467 | java | package th.ac.ku.atm;
import java.util.HashMap;
import java.util.Map;
public class DataSourceWebAPI implements DataSource {
public Map<Integer,Customer> readCustomers() {
Map<Integer,Customer> customers = new HashMap<>();
customers.put(1,new Customer(1,"ขวัญ",1234,1000));
customers.put(2,new Customer(2,"พลอย",2345,2000));
customers.put(3,new Customer(3,"ฝน",3456,3000));
return customers;
}
}
| [
"[email protected]"
]
| |
d5c049d1572a59d31b2d4a101efafff0f17053b6 | e14cc47479e697449bf39fc2875d61284637383f | /ws-core/src/main/java/org/ws/core/file/ObjectRepo.java | 20ca52aed85a8ec3795005265e67473c45a1a19c | []
| no_license | achilles-liu/ws-demo | bc266135e91726d8819b5ae48bbe01e2802bbf0e | f416ea011fc063e23dae58733d2e4aa16477c2db | refs/heads/master | 2021-01-09T20:19:06.110010 | 2018-09-06T07:53:23 | 2018-09-06T07:53:23 | 61,907,271 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 577 | java | package org.ws.core.file;
import java.util.HashMap;
import java.util.Map;
/**
* this is the business repository to store business object
* like the implementation of <code>FileEval</code> interface.
* @author Achilles Liu
*
* @param <T>
*/
public class ObjectRepo<T> {
private Map<String, T> cup = new HashMap<String, T>();
public T lookup(String type){
return cup.get(type);
}
public void assign(String type, T eval){
if(!cup.containsKey(type)){
cup.put(type, eval);
}
}
public boolean contains(String type){
return cup.containsKey(type);
}
}
| [
"[email protected]"
]
| |
4b552978d3501bbf3808206e587b77d10c6e857c | e3ca330f4185abcd30538b528971a5610b9c66b0 | /main_homework/theClassicExample/Java031.java | d793a6b4331b15409350ab30eb94ff51b9cba940 | []
| no_license | eraf00/homework | bc1ee098853acde032deaced239372de77ad3699 | eeb7d71274929ce23410626baa230795d35b22be | refs/heads/master | 2020-03-13T18:16:33.397321 | 2018-06-03T07:41:04 | 2018-06-03T07:41:04 | null | 0 | 0 | null | null | null | null | ISO-8859-7 | Java | false | false | 387 | java | package theClassicExample;
import java.util.Scanner;
public class Java031 {
public static void main(String[] srgs) {
int[] j=new int[10];
Scanner input = new Scanner(System.in);
System.out.println("ΗλΚδΘλΚύΧι:");
for(int i=0;i<10;i++) {
j[i]= input.nextInt();
}
input.close();
for(int i=9;i>0;i--) {
System.out.print(j[i]+" ");
}
}
} | [
"Administrator@PC-20180409IVPG"
]
| Administrator@PC-20180409IVPG |
e625432e71cb46439fefbe9dbbe4c31cf6fdfb4b | a2b1fea3f7dabdba0c4243921f63edc1a9d9106d | /src/main/java/universityrecruit/enterprise/interviewmanagement/candidate/service/ICandidateService.java | 5541cb66f80baf97f5256edb71157866e1269538 | []
| no_license | qwert1234zx/student | 204b7cb616ad0a1c254d0ba64f7be4193c016b4b | cafa9a3ec12568940324ce758432bbca2ba8d020 | refs/heads/master | 2020-04-08T14:13:07.803896 | 2018-11-28T02:04:24 | 2018-11-28T02:04:24 | 159,421,065 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 511 | java | /**
* The service interface of Candidate,该文件继承于IBaseService,其中insert、update、deleteByIdList、selectByID、selectByCondition可不用写
* Created 2018/9/18
* @author Howard
*/
package universityrecruit.enterprise.interviewmanagement.candidate.service;
import com.each.common.base.service.IBaseService;
import java.util.Date;
import universityrecruit.enterprise.interviewmanagement.candidate.entity.Candidate;
public interface ICandidateService extends IBaseService<Candidate> {
}
| [
"[email protected]"
]
| |
f2fd0145b7c7b89d3b7f33a35a6049cfb95072be | b55845607cfc5ab4feb45c45598ee6929809fa95 | /src/com/zhiyou100/git/Test.java | 13c7783f7de51f35560222a5416c7e16e4a8719f | []
| no_license | lwj1987/Git | dd9adc947726e8cb848e001a21bb40fb43617db9 | ad0896838d6fa80342738588334687e28fe443ae | refs/heads/master | 2021-05-14T11:49:21.414636 | 2018-01-05T14:24:13 | 2018-01-05T14:24:13 | 116,392,402 | 0 | 0 | null | 2018-01-05T14:17:56 | 2018-01-05T14:17:56 | null | UTF-8 | Java | false | false | 302 | java | package com.zhiyou100.git;
/**
* @ClassName: Test
* @Description: TODO
* @author Administrator
* @date 2018年1月5日 下午4:42:03
*
*/
public class Test {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("sss");
}
}
| [
"[email protected]"
]
| |
9435c22fdf198a9194a56933b43297e48ad5a845 | ad38d19735e398e031b0b7fc88861a431104a0d9 | /src/main/java/br/com/integrador/model/Veiculo.java | 53eb38d5c762866331271415117b6a30b517e862 | [
"MIT"
]
| permissive | joaopdb/trabalho_TAP | d0511ce933d7d09c8d89c288bf3d77faa1300736 | 979410df85b557cf4c6513af0ca716b15968782b | refs/heads/master | 2020-03-29T00:51:03.250278 | 2018-09-18T19:57:13 | 2018-09-18T19:57:13 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,402 | java | package br.com.integrador.model;
import br.com.integrador.exception.CargaCompletaException;
import br.com.integrador.exception.HabilitacaoInvalidaException;
public abstract class Veiculo {
private String marca;
private String modelo;
private String ano;
private String placa;
private int capacidade;
private int carga;
private Motorista motorista;
public Veiculo() {
this.carga = 0;
}
public String getMarca() {
return marca;
}
public void setMarca(String marca) {
this.marca = marca;
}
public String getModelo() {
return modelo;
}
public void setModelo(String modelo) {
this.modelo = modelo;
}
public String getAno() {
return ano;
}
public void setAno(String ano) {
this.ano = ano;
}
public String getPlaca() {
return placa;
}
public void setPlaca(String placa) {
this.placa = placa;
}
public int getCapacidade() {
return capacidade;
}
public void setCapacidade(int capacidade) {
this.capacidade = capacidade;
}
public int getCarga() {
return carga;
}
public void setCarga() throws CargaCompletaException {
if (this.carga < this.capacidade) {
this.carga++;
} else {
throw new CargaCompletaException("CARGA COMPLETA");
}
}
public Motorista getMotorista() {
return motorista;
}
public abstract void setMotorista(Motorista motorista) throws HabilitacaoInvalidaException;
@Override
public String toString() {
StringBuilder veiculo = new StringBuilder();
veiculo.append("\nMARCA: ").append(this.getMarca());
veiculo.append("\nMODELO: ").append(this.getModelo());
veiculo.append("\nANO: ").append(this.getAno());
veiculo.append("\nPLACA: ").append(this.getPlaca());
veiculo.append("\nCAPACIDADE: ").append(this.getCapacidade());
veiculo.append("\nCARGA: ").append(this.getCarga());
if (this.getMotorista() != null) {
veiculo.append("\nMOTORISTA: ").append(this.getMotorista());
} else {
veiculo.append("\nMOTORISTA: VEICULO SEM MOTORISTA");
}
return String.valueOf(veiculo);
}
}
| [
"[email protected]"
]
| |
ffe49fe2b4897a433cc115f8c669dfa22a86aaf3 | de7b67d4f8aa124f09fc133be5295a0c18d80171 | /workspace_java-src/java-src-test/src/sun/io/ByteToCharMacRomania.java | e5e1fe6d095671282d96d603067d739716749913 | []
| no_license | lin-lee/eclipse_workspace_test | adce936e4ae8df97f7f28965a6728540d63224c7 | 37507f78bc942afb11490c49942cdfc6ef3dfef8 | refs/heads/master | 2021-05-09T10:02:55.854906 | 2018-01-31T07:19:02 | 2018-01-31T07:19:02 | 119,460,523 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 665 | java | /*
* %W% %E%
*
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package sun.io;
import sun.nio.cs.ext.MacRomania;
/**
* A table to convert to MacRomania to Unicode
*
* @author ConverterGenerator tool
* @version >= JDK1.1.6
*/
public class ByteToCharMacRomania extends ByteToCharSingleByte {
private final static MacRomania nioCoder = new MacRomania();
public String getCharacterEncoding() {
return "MacRomania";
}
public ByteToCharMacRomania() {
super.byteToCharTable = nioCoder.getDecoderSingleByteMappings();
}
}
| [
"[email protected]"
]
| |
ddf66a47206ea266ed6311774d5b8b4f3684fc39 | f24ad3f64c326068c7de34abcd755acd619ec60b | /src/main/java/com/brctl/spring/inaction/chapter2/MediaPlayer.java | 5312f3a596bfc70a9deec0b4765d1c37ec2bfcbc | [
"MIT"
]
| permissive | xspurs/spring-in-action | adffa4bdae5737ed60263bc8f0180450078209c6 | b9e1843ae337f0055e59e98e966440a3c07dec13 | refs/heads/master | 2021-09-02T04:19:44.488646 | 2017-12-30T09:22:15 | 2017-12-30T09:22:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 172 | java | package com.brctl.spring.inaction.chapter2;
/**
* Media Player
* @author duanxiaoxing
* @created 2017/12/29
*/
public interface MediaPlayer {
void playDisc();
}
| [
"[email protected]"
]
| |
259d819664af64a13de01636624f52a1a3454a61 | a499aa5bb170dada44771eba341d479ae04d9010 | /core/src/main/java/de/jkliff/timetracker/core/persistence/ActivitySummaryDAO.java | edb5f2d182f488409a532451f0b3f39a9f568179 | []
| no_license | jkliff/timetracker | 7ad176cd629f3ecd3648a5d1c684a216e1d0bf45 | b6d1a2beb88adbb67236ccadb5077b0cff8e4b48 | refs/heads/master | 2021-01-19T08:11:48.794933 | 2011-12-10T23:44:52 | 2011-12-10T23:44:52 | 2,920,427 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 576 | java | package de.jkliff.timetracker.core.persistence;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Repository;
import de.jkliff.timetracker.core.service.dto.ActivitySummary;
import de.jkliff.timetracker.util.Pair;
@Repository
public class ActivitySummaryDAO
extends AbstractSummaryDAOImpl<ActivitySummary> {
public List<ActivitySummary> find (final Pair<String, Map<String, Object>> hqlWithParams) {
List<ActivitySummary> l = super.find (hqlWithParams, AbstractSummaryMapper.getInstance ());
return l;
}
}
| [
"john@hesse"
]
| john@hesse |
ef6dc8cd8a5f0406485d7aea708d6a387e15f9b3 | 29170c7d4f8da3eaf88cb040066de89730eec5df | /7_MyFiloFax_B056_58_59_64/workspace/MyFiloFax/src/com/example/myfilofax/Exams.java | 0a113f0ab827f385004e188e637dd1237e4835ee | []
| no_license | NileshSingh/MPSTME_Project_Android | 6c2f77abb5b151d62adfb586c1b339921ef3647e | 8768deaa1b9bde66a1fdddc6ffdc571ca60489ed | refs/heads/master | 2021-01-21T02:46:06.818487 | 2015-05-06T09:56:31 | 2015-05-06T09:56:31 | 59,458,925 | 0 | 1 | null | 2016-05-23T06:51:50 | 2016-05-23T06:51:50 | null | UTF-8 | Java | false | false | 5,248 | java | package com.example.myfilofax;
import android.app.Activity;
import android.content.ContentValues;
import android.database.Cursor;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.support.v4.app.NavUtils;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
public class Exams extends Activity {
SQLiteDatabase db;
EditText sub,date,tym,task,not;
Button set;
int rowId;
RegistrationAdapter regadapter;
long f;
Cursor c ;
RegistrationAdapter adapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_exams);
sub =(EditText)findViewById(R.id.sub);
task =(EditText)findViewById(R.id.type);
date =(EditText)findViewById(R.id.date);
tym =(EditText)findViewById(R.id.time);
not =(EditText)findViewById(R.id.notes);
set = (Button)findViewById(R.id.sett);
Bundle showData = getIntent().getExtras();
rowId = showData.getInt("keyid");
// Toast.makeText(getApplicationContext(), Integer.toString(rowId),
// 500).show();
regadapter = new RegistrationAdapter(this);
c = regadapter.queryAll(rowId);
if (c.moveToFirst()) {
do {
task.setText(c.getString(1));
sub.setText(c.getString(2));
date.setText(c.getString(3));
tym.setText(c.getString(4));
not.setText(c.getString(5));
} while (c.moveToNext());
}
set.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
c = regadapter.queryAll(rowId);
f = regadapter.updateldetail(rowId,task.getText().toString(),sub.getText().toString(),date.getText().toString(),tym.getText().toString(),not.getText().toString());
if(f > 0)
{
Toast.makeText(Exams.this, "Record Successfully Updated", 2000).show();
}
finish();
}
});
// Show the Up button in the action bar.
setupActionBar();
Button btn = (Button)findViewById(R.id.sett);
try
{
db = openOrCreateDatabase("DB", SQLiteDatabase.CREATE_IF_NECESSARY, null);
db.execSQL("Create Table Pattt(_id integer primary key autoincrement,task VARCHAR,subject VARCHAR,date DATETIME,time DATETIME,notes VARCHAR)");
}
catch (SQLException e)
{
}
btn.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
EditText sub=(EditText) findViewById(R.id.type);
EditText type=(EditText)findViewById(R.id.sub);
EditText date=(EditText)findViewById(R.id.date);
EditText time=(EditText)findViewById(R.id.time);
EditText notes=(EditText)findViewById(R.id.notes);
ContentValues values=new ContentValues();
values.put("task", sub.getText().toString());
values.put("subject", type.getText().toString());
values.put("date", date.getText().toString());
values.put("time", time.getText().toString());
values.put("notes", notes.getText().toString());
if((db.insert("Pattt", null, values))!=-1)
{
Toast.makeText(Exams.this, "Record Successfully Inserted", 2000).show();
}
else
{
Toast.makeText(Exams.this, "Insert Error", 2000).show();
}
sub.setText("");
type.setText("");
date.setText("");
time.setText("");
notes.setText("");
Cursor c=db.rawQuery("SELECT * FROM Pattt",null);
c.moveToFirst();
while(!c.isAfterLast())
{
Toast.makeText(Exams.this,c.getString(0)+ " "+c.getString(1)+" "+c.getString(2)+" "+c.getString(3),1000).show();
c.moveToNext();
}
c.close();
}
});
}
/**
* Set up the {@link android.app.ActionBar}.
*/
private void setupActionBar() {
getActionBar().setDisplayHomeAsUpEnabled(true);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.exams, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
// This ID represents the Home or Up button. In the case of this
// activity, the Up button is shown. Use NavUtils to allow users
// to navigate up one level in the application structure. For
// more details, see the Navigation pattern on Android Design:
//
// http://developer.android.com/design/patterns/navigation.html#up-vs-back
//
NavUtils.navigateUpFromSameTask(this);
return true;
}
return super.onOptionsItemSelected(item);
}
}
| [
"[email protected]"
]
| |
067d76f2259d6a9b60eaae30d91fd3277a6b176a | 844caa4e0935bd5dc800ffddd1a2f202a2f6af1f | /src/FindCycle.java | 46b78ee46191729b1ad2e1976793bc901e09c191 | []
| no_license | snskr/edXWInContestCourse | 799400a1b1a0b52e39ae6cbb62b046644bf48ca3 | 991a3057a3a7045966d434260d3d2792f9b25147 | refs/heads/master | 2020-09-24T16:44:39.888923 | 2017-05-12T01:47:16 | 2017-05-12T01:47:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,334 | java | import java.io.*;
import java.util.*;
/**
* Created by sherxon on 4/4/17.
*/
public class FindCycle {
public static void main(String[] args) throws IOException {
try (PrintWriter out = newOutput()) {
FastScanner in = newInput();
int n=in.nextInt();
int m=in.nextInt();
out.println();
}
}
private static class Graph{
int n;
Map<Integer, List<Integer>> map;
public Graph(int n) {
this.n = n;
map= new HashMap<>(n/2);
}
void addEdge(Integer from, Integer to){
if(!map.containsKey(from))
map.put(from, new ArrayList<>());
if(!map.containsKey(to))
map.put(to, new ArrayList<>());
map.get(from).add(to);
}
}
private static class FastScanner {
static BufferedReader br;
static StringTokenizer st;
FastScanner(File f) {
try {
br = new BufferedReader(new FileReader(f));
} catch (FileNotFoundException e) {
e.printStackTrace();
}
}
public FastScanner(InputStream f) {
br = new BufferedReader(new InputStreamReader(f));
}
String next() {
while (st == null || !st.hasMoreTokens()) {
try {
st = new StringTokenizer(br.readLine());
} catch (IOException e) {
e.printStackTrace();
}
}
return st.nextToken();
}
int nextInt() {
return Integer.parseInt(next());
}
long nextLong() {
return Long.parseLong(next());
}
double nextDoulbe() {
return Double.parseDouble(next());
}
}
static FastScanner newInput() throws IOException {
if (System.getProperty("JUDGE") != null) {
return new FastScanner(new File("input.txt"));
} else {
return new FastScanner(System.in);
}
}
static PrintWriter newOutput() throws IOException {
if (System.getProperty("JUDGE") != null) {
return new PrintWriter("output.txt");
} else {
return new PrintWriter(System.out);
}
}
}
| [
"[email protected]"
]
| |
173cdafd6785b1aeac48b41ba7c98778bce686bc | 78316155ec078feef99e863a4ac62154aa8b24fa | /LiquidCoreAndroid/src/main/java/org/liquidplayer/javascript/JNIJSContext.java | fe9459fb0191e0dfc35b97c33ac5c322e45e7370 | [
"BSD-2-Clause"
]
| permissive | nzrq/LiquidCore | ebc617bb0d5a884a63a81e4eb998866320c6fbbb | 34875b1a25b184de862f20efe7ff46353ca4346d | refs/heads/master | 2020-03-27T10:53:38.618327 | 2018-08-25T11:12:48 | 2018-08-25T11:12:48 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,335 | java | //
// JNIJSContext.java
//
// AndroidJSCore project
// https://github.com/ericwlange/AndroidJSCore/
//
// LiquidPlayer project
// https://github.com/LiquidPlayer
//
// Created by Eric Lange
//
/*
Copyright (c) 2018 Eric Lange. All rights reserved.
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.
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 HOLDER 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.liquidplayer.javascript;
import android.support.annotation.NonNull;
class JNIJSContext extends JNIObject {
private JNIJSContext(long ref) {
super(ref);
}
@Override
public void finalize() throws Throwable {
super.finalize();
Finalize(reference);
}
@NonNull static JNIJSContext createContext()
{
return fromRef(create());
}
@NonNull static JNIJSContext createContext(JNIJSContextGroup group)
{
return fromRef(createInGroup(group.reference));
}
JNIJSContextGroup getGroup()
{
return JNIJSContextGroup.fromRef(getGroup(reference));
}
JNIJSObject getGlobalObject()
{
return JNIJSObject.fromRef(getGlobalObject(reference));
}
JNIJSValue makeUndefined()
{
return JNIJSValue.fromRef(JNIJSValue.ODDBALL_UNDEFINED);
}
JNIJSValue makeNull()
{
return JNIJSValue.fromRef(JNIJSValue.ODDBALL_NULL);
}
JNIJSValue makeBoolean(boolean bool)
{
return JNIJSValue.fromRef(bool ? JNIJSValue.ODDBALL_TRUE : JNIJSValue.ODDBALL_FALSE);
}
JNIJSValue makeNumber(double number)
{
long ref = Double.doubleToLongBits(number);
if (!JNIJSValue.isReferencePrimitiveNumber(ref)) {
ref = JNIJSValue.makeNumber(reference, number);
}
return JNIJSValue.fromRef(ref);
}
JNIJSValue makeString(String string)
{
return JNIJSValue.fromRef(JNIJSValue.makeString(reference, string));
}
JNIJSValue makeFromJSONString(String string)
{
return JNIJSValue.fromRef(JNIJSValue.makeFromJSONString(reference, string));
}
JNIJSObject make()
{
return JNIJSObject.fromRef(JNIJSObject.make(reference));
}
JNIJSObject makeArray(JNIJSValue[] args) throws JNIJSException
{
long [] args_ = new long[args.length];
for (int i=0; i<args.length; i++) {
args_[i] = args[i].reference;
}
return JNIJSObject.fromRef(JNIJSObject.makeArray(reference, args_));
}
JNIJSObject makeDate(long[] args)
{
return JNIJSObject.fromRef(JNIJSObject.makeDate(reference, args));
}
JNIJSObject makeError(String message)
{
return JNIJSObject.fromRef(JNIJSObject.makeError(reference, message));
}
JNIJSObject makeRegExp(String pattern, String flags) throws JNIJSException
{
return JNIJSObject.fromRef(JNIJSObject.makeRegExp(reference, pattern, flags));
}
JNIJSFunction makeFunction(@NonNull String name, @NonNull String func,
@NonNull String sourceURL, int startingLineNumber) throws JNIJSException
{
return JNIJSFunction.fromRef(JNIJSObject.makeFunction(reference, name, func, sourceURL,
startingLineNumber));
}
JNIJSFunction makeFunctionWithCallback(JSFunction thiz, String name)
{
return JNIJSFunction.fromRef(JNIJSFunction.makeFunctionWithCallback(thiz, reference, name));
}
JNIJSValue evaluateScript(String script, String sourceURL, int startingLineNumber) throws JNIJSException
{
return JNIJSValue.fromRef(evaluateScript(reference, script, sourceURL, startingLineNumber));
}
@NonNull
static JNIJSContext fromRef(long ctxRef)
{
return new JNIJSContext(ctxRef);
}
/* Natives */
private static native long create();
private static native long createInGroup(long group);
private static native long getGroup(long ctxRef);
private static native long getGlobalObject(long ctxRef);
private static native long evaluateScript(long ctxRef, String script, String sourceURL,
int startingLineNumber) throws JNIJSException;
private static native void Finalize(long ctxRef);
}
| [
"[email protected]"
]
| |
85f289fd6696a3df712e82155c7cf7972e27ff0d | f467d2b9ffbb9e8036dda549201739481d21e0fb | /src/com/epam/train/Locomotive.java | 863ba72f05d44c161e3533798f23b3c63f36ff27 | []
| no_license | Zhassakbayev/Train | e97f18c5f4f0c5e8bf65ffb52f70a5a41ae4050b | 1d5459cbedbfad7884687abd5454166ddb32b24e | refs/heads/master | 2020-04-09T04:52:50.026192 | 2018-12-02T11:42:02 | 2018-12-02T11:42:02 | 160,041,358 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,269 | java | package com.epam.train;
public class Locomotive {
private int power;
private TypeLocomotive typeLocomotive;
private int id;
private static int locomotiveCounter = 1;
public Locomotive(int power, TypeLocomotive typeLocomotive) {
this.typeLocomotive = typeLocomotive;
this.power = power;
this.id = locomotiveCounter++;
}
public int getPower() {
return power;
}
public TypeLocomotive getTypeLocomotive() {
return typeLocomotive;
}
public int getId() {
return id;
}
public static int getLocomotiveCounter() {
return locomotiveCounter-1;
}
public void setPower(int power) {
this.power = power;
}
public void setTypeLocomotive(TypeLocomotive typeLocomotive) {
this.typeLocomotive = typeLocomotive;
}
public void setId(int id) {
this.id = id;
}
public static void setLocomotiveCounter(int locomotiveCounter) {
Locomotive.locomotiveCounter = locomotiveCounter;
}
@Override
public String toString() {
return "Locomotive{" +
"power=" + power +
", typeLocomotive=" + typeLocomotive +
", id=" + id +
'}';
}
}
| [
"[email protected]"
]
| |
7f1dc80221d860e618cd23f671a4625a79403712 | 4e5f4b437defb66236fe0775a126c9d86a4d396a | /Javacore/Assignment/Assignment1/Categoryquestion.java | 23fcb7ab800f7499aac0dfaa278cc45e81b72983 | []
| no_license | luonghaivan99hp/LuongHaiVan | bbab7921d99b4f861fcffc02c531b3fa99fd7667 | 2d4f30ec85589a3f2314243232cf8426f4bee128 | refs/heads/master | 2022-12-31T19:15:30.082549 | 2020-10-26T08:15:44 | 2020-10-26T08:15:44 | 289,701,371 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 227 | java | package Assignment1;
public class Categoryquestion {
int id;
String CategoryName;
public Categoryquestion(int id, String categoryName) {
this.id = id;
CategoryName = categoryName;
}
public Categoryquestion() {
}
}
| [
"[email protected]"
]
| |
61c8577ef160bf9158b538775a5ed6657b6b6815 | b7f73c6e778244588e98a4377e4426c4f6fe5075 | /StudentRegistDemo/src/main/java/com/wei/action/Demo2Action.java | 2c5b1f2b086e8c89d2bf978e56630fe059110323 | []
| no_license | ajilisiwei/Struts2Template | e9538ee5ed192ada6594f8eb6fe67af457eb2b0f | f7d540b0ae1761665f32073bd5c13b15025faced | refs/heads/master | 2021-01-19T22:53:49.178186 | 2017-05-01T04:08:08 | 2017-05-01T04:08:08 | 88,886,308 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 167 | java | package com.wei.action;
public class Demo2Action {
public String query() {
return "success";
}
public String update() {
return "success";
}
}
| [
"[email protected]"
]
| |
6b691f0654de826041b42d73ad915179dce062f2 | 052b7301f95ad419dcc04add139235913fa83d7e | /03_clonevscopy/src/main/java/com/github/arnaudroger/beans/Object4.java | d7acf48ec44a3a9c4a42e84e3ba4178d90a47033 | [
"MIT"
]
| permissive | zpencer/blog_samples | e5ab066271997b63c813cd646adfdb18f601d18a | b4c6b5acc5e10f8007595d4b001b9c9face4812c | refs/heads/master | 2020-03-27T16:54:37.651734 | 2018-05-29T12:35:05 | 2018-05-29T12:35:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,204 | java | package com.github.arnaudroger.beans;
import org.openjdk.jol.datamodel.CurrentDataModel;
import org.openjdk.jol.datamodel.X86_32_DataModel;
import org.openjdk.jol.datamodel.X86_64_COOPS_DataModel;
import org.openjdk.jol.datamodel.X86_64_DataModel;
import org.openjdk.jol.info.ClassLayout;
import org.openjdk.jol.layouters.HotSpotLayouter;
import static java.lang.System.out;
public class Object4 implements Cloneable {
public int f1;
public int f2;
public int f3;
public int f4;
public Object4(Object4 o) {
this.f1 = o.f1;
this.f2 = o.f2;
this.f3 = o.f3;
this.f4 = o.f4;
}
public Object4(int f1, int f2, int f3, int f4) {
this.f1 = f1;
this.f2 = f2;
this.f3 = f3;
this.f4 = f4;
}
@Override
public Object4 clone() {
try {
return (Object4) super.clone();
} catch (CloneNotSupportedException e) {
throw new Error(e);
}
}
public static void main(String[] args) {
Class klass = Object4.class;
out.println(ClassLayout.parseClass(klass, new HotSpotLayouter(new CurrentDataModel())).toPrintable());
}
}
| [
"[email protected]"
]
| |
b643409269abf4721a393d44f3d55ab17b71af23 | 1054465e1c9c1b95448a5b38feec775c035d5b44 | /app/src/main/java/cn/com/custom/widgetproject/dialogs/BaseAlterDialog.java | 4ebeb5ddc777bafb1d36b079222765cd60ce5197 | []
| no_license | stay4it2geek/Widgets_Project | 2f66450b8f4a22f922be87ad8deeaad7eb2a9519 | 94ee5dd92d998a40c70c7a052205acb71e076504 | refs/heads/master | 2020-12-05T03:16:56.354352 | 2016-08-19T01:50:05 | 2016-08-19T01:50:05 | 66,043,213 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,089 | java | package cn.com.custom.widgetproject.dialogs;
import android.app.AlertDialog;
import android.content.Context;
import android.graphics.Point;
import android.os.Bundle;
import android.view.Display;
import android.view.WindowManager;
/**
* Base Dialog
*/
public class BaseAlterDialog extends AlertDialog {
private Context context;
protected BaseAlterDialog(Context context, int themeResId) {
super(context, themeResId);
this.context = context;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
BaseAlterDialog.this.setCancelable(false);
WindowManager windowManager = getWindow().getWindowManager();
Display display = windowManager.getDefaultDisplay();
WindowManager.LayoutParams lp = BaseAlterDialog.this.getWindow().getAttributes();
Point size = new Point();
display.getSize(size);
lp.width = size.x; //���ÿ��
lp.height = size.y;//���ø߶�
BaseAlterDialog.this.getWindow().setAttributes(lp);
}
}
| [
"stay4it2geek"
]
| stay4it2geek |
67fb4b40fa599d1b4799c7a6889c340698e83d9f | 0cf6a9d1b18f1e0b0b0c0572b367715b808afde7 | /SecondTask/src/main/java/by/epam/htp12/comparator/SentencesByWordLengthComparator.java | ab2618bb719ad61e642fa28c1800455118b86eee | []
| no_license | Pickle9/JD2_Epam | 3734fa5a29d2d5badb4a1ac53eeba18ab3fd401c | ce2f06a8ef117c0f96e190dc97d75c5696aeee27 | refs/heads/master | 2020-03-30T13:10:43.401622 | 2018-12-11T07:40:41 | 2018-12-11T07:40:41 | 151,260,954 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,600 | java | package by.epam.htp12.comparator;
import by.epam.htp12.composite.Component;
import by.epam.htp12.composite.ComponentType;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.util.Comparator;
import java.util.concurrent.atomic.AtomicInteger;
public class SentencesByWordLengthComparator implements Comparator<Component> {
private static final Logger LOGGER = LogManager.getLogger();
@Override
public int compare(Component o1, Component o2) {
if (o1.getType() == null || o2.getType() == null) {
LOGGER.log(Level.ERROR, "Comparing error. There is null \"type\" field in one or two of objects.");
return 0;
}
if (o1.getType().equals(ComponentType.SENTENCE) && o2.getType().equals(ComponentType.SENTENCE)) {
return calculateLength(o1) - calculateLength(o2);
}
LOGGER.log(Level.ERROR, "Unknown error. Compare method was completed incorrectly");
return 0;
}
private static int calculateLength(Component parentComponent) {
AtomicInteger length = new AtomicInteger();
for (Component component : parentComponent.getChild()) {
for (Component lexemeComponent : component.getChild()) {
if (lexemeComponent.getType().equals(ComponentType.WORD)) {
lexemeComponent.getChild().forEach(w -> length.addAndGet(w.getData().length()));
}
}
}
return length.get();
}
}
| [
"[email protected]"
]
| |
d4fc637ec9718390f76537d419ae2f915a115b41 | aa8a3972d192dc27805b6c564e6bd5a34eb34636 | /modules/adwords_appengine/src/main/java/com/google/api/ads/adwords/jaxws/v201406/cm/BiddingScheme.java | e3f46fa658eff35bf16034bd6f383142b02d4c4a | [
"Apache-2.0"
]
| permissive | nafae/developer | 201e76ef6909097b07936dbc7f4ef05660fe2a26 | ea3ad63c72009c83c2cdbeebfc3868905a188166 | refs/heads/master | 2021-01-19T17:48:32.453689 | 2014-11-11T22:17:32 | 2014-11-11T22:17:32 | 26,411,286 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,144 | java |
package com.google.api.ads.adwords.jaxws.v201406.cm;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlType;
/**
*
* Base class for all bidding schemes.
* <span class="constraint AdxEnabled">This is disabled for AdX.</span>
*
*
* <p>Java class for BiddingScheme complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="BiddingScheme">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="BiddingScheme.Type" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "BiddingScheme", propOrder = {
"biddingSchemeType"
})
@XmlSeeAlso({
EnhancedCpcBiddingScheme.class,
ManualCpcBiddingScheme.class,
TargetRoasBiddingScheme.class,
ManualCpmBiddingScheme.class,
PercentCpaBiddingScheme.class,
BudgetOptimizerBiddingScheme.class,
TargetSpendBiddingScheme.class,
PageOnePromotedBiddingScheme.class,
ConversionOptimizerBiddingScheme.class,
TargetCpaBiddingScheme.class
})
public abstract class BiddingScheme {
@XmlElement(name = "BiddingScheme.Type")
protected String biddingSchemeType;
/**
* Gets the value of the biddingSchemeType property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getBiddingSchemeType() {
return biddingSchemeType;
}
/**
* Sets the value of the biddingSchemeType property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setBiddingSchemeType(String value) {
this.biddingSchemeType = value;
}
}
| [
"[email protected]"
]
| |
e854fdfe71717dadc46571fa150ea086a0f99301 | 1a954b5a05cb2500e0be6497d66b806f097a6a80 | /OnlineShoppingSystem/src/com/manipal/DAO/LoginDAO.java | 980d50333e248aa82625644216a07a7de9f0a137 | []
| no_license | jaswinipaunikar/job2 | 6e299306748a1f4d02701659687803477e095324 | 3760572ee77b824cf422a690669c298cc53939b4 | refs/heads/master | 2021-01-02T08:18:55.495391 | 2017-08-09T08:57:04 | 2017-08-09T08:57:04 | 98,994,402 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 294 | java | package com.manipal.DAO;
import java.io.IOException;
import java.sql.SQLException;
import java.util.List;
import com.manipal.model.*;
public interface LoginDAO {
public String check();
public List<Customer> validate()throws ClassNotFoundException, SQLException, IOException;
}
| [
"[email protected]"
]
| |
6729eeb68f603408d9131f751fcc52927ef79be8 | 863c8d31875fe09089116d4869c30ecf737f352f | /ChatsFragment.java | 0bff7b8ee46dea6af5bf4eb58528078f1f3558c9 | []
| no_license | Bellac12345/SafeMessaging | 7e999474bb94e920fee99cd3c09299b1d30bcb42 | 6f017ff0812243b5c14611d990659be837fcb57f | refs/heads/main | 2023-05-31T15:54:24.711754 | 2021-06-15T18:44:43 | 2021-06-15T18:44:43 | 377,262,096 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,054 | java | package com.example.safemessaging.Fragments;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.example.safemessaging.Adapter.UserAdapter;
import com.example.safemessaging.Model.Chatlist;
import com.example.safemessaging.Model.Users;
import com.example.safemessaging.R;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
import java.util.ArrayList;
import java.util.List;
/**
* A simple {@link Fragment} subclass.
* Use the {@link ChatsFragment#newInstance} factory method to
* create an instance of this fragment.
*/
public class ChatsFragment extends Fragment {
private UserAdapter userAdapter;
private List<Users> mUsers;
FirebaseUser fuser;
DatabaseReference reference;
private List<Chatlist> usersList;
RecyclerView recyclerView;
// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private static final String ARG_PARAM1 = "param1";
private static final String ARG_PARAM2 = "param2";
// TODO: Rename and change types of parameters
private String mParam1;
private String mParam2;
public ChatsFragment() {
// Required empty public constructor
}
/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment ChatsFragment.
*/
// TODO: Rename and change types and number of parameters
public static ChatsFragment newInstance(String param1, String param2) {
ChatsFragment fragment = new ChatsFragment();
Bundle args = new Bundle();
args.putString(ARG_PARAM1, param1);
args.putString(ARG_PARAM2, param2);
fragment.setArguments(args);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
mParam1 = getArguments().getString(ARG_PARAM1);
mParam2 = getArguments().getString(ARG_PARAM2);
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_chats,container, false);
recyclerView = view.findViewById(R.id.recycler_view2);
recyclerView.setHasFixedSize(true);
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
fuser = FirebaseAuth.getInstance().getCurrentUser();
usersList = new ArrayList<>();
reference = FirebaseDatabase.getInstance().getReference("ChatList").child(fuser.getUid());
reference.addValueEventListener(new ValueEventListener(){
@Override
public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
usersList.clear();
for(DataSnapshot snapshot: dataSnapshot.getChildren()){
Chatlist chatlist = snapshot.getValue(Chatlist.class);
usersList.add(chatlist);
}
chatList();
}
@Override
public void onCancelled(@NonNull DatabaseError error) {
}
});
return view;
}
private void chatList(){
//Getting all recent chats
mUsers = new ArrayList<>();
reference = FirebaseDatabase.getInstance().getReference("MyUsers");
reference.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
mUsers.clear();
for(DataSnapshot snapshot: dataSnapshot.getChildren()){
Users user = snapshot.getValue(Users.class);
for(Chatlist chatlist: usersList){
if(user.getId().equals(chatlist.getId())){
mUsers.add(user);
}
}
}
userAdapter = new UserAdapter(getContext(), mUsers, true);
recyclerView.setAdapter(userAdapter);
}
@Override
public void onCancelled(@NonNull DatabaseError error) {
}
});
}
} | [
"[email protected]"
]
| |
031769abf0578e261fa075164af87123ec02e809 | 6d9e25d6e66d2971230292157a253b8d0d23fef8 | /src/Slot.java | 2d8fcfaf7f90e5ca38df0bdbb36d2b25e87f2702 | []
| no_license | Wstrosser/Cit111Test1 | da6d10068e28728e4467808e9075a34cda07a45c | 5e365356806f6cd419329e02db6a7e774f5376d9 | refs/heads/master | 2021-06-25T14:30:50.473208 | 2020-12-23T12:37:03 | 2020-12-23T12:37:03 | 156,798,773 | 0 | 0 | null | 2020-12-23T12:37:04 | 2018-11-09T02:29:24 | Java | UTF-8 | Java | false | false | 3,503 | java |
/* Ace Free spin 15
3 of a kind 5
Royals 4
Straight 3
Suit 2
Color 1
*/
class Slot {
public static String[] cards = new String[3];
public static String text;
public static String payoutText;
private static int spinLeft = 0;
public static CardSuits[] reelSuit = new CardSuits[3];
public static CardRanks[] reelRank = new CardRanks[3];
public static void slot() throws InterruptedException {
Cards card = Casino.card;
do {
dealCards();
payoutTable();
text = "";
System.out.println(text + card.text);
System.out.print("\nNumber of spins left: " + spinLeft);
System.out.println("\n" + Casino.ac.userBalance);
} while (spinLeft > 0 && Casino.ac.validBet());
Casino.ac.setCasinoBalance();
}
private static void payoutTable() {
if (reelRank[0].worth == 1 && reelRank[1].worth == 1 && reelRank[2].worth == 1) {
//Casino.ac.setMultipler(10);
payoutText += "\nTriple Aces";spinLeft += 15;
}
if (isStraight()) {
Casino.ac.setMultipler(5.0);
payoutText += "\nNice Straight";
}
if (reelRank[0].equals(reelRank[1]) && reelRank[1].equals(reelRank[2])) {
Casino.ac.setMultipler(7.0);
payoutText += "\nThree of a kind";
} else if(reelRank[0].equals(reelRank[1])||reelRank[1].equals(reelRank[2])||reelRank[0].equals(reelRank[2])){
Casino.ac.setMultipler(2.0);
payoutText += "\nNice pair";
}
if (reelRank[0].worth > 10 && reelRank[1].worth > 10 && reelRank[2].worth > 10) {
Casino.ac.setMultipler(4.0);
payoutText += "\nAll royals";
}
if (reelSuit[0].equals(reelSuit[1]) && reelSuit[1].equals(reelSuit[2])) {
Casino.ac.setMultipler(4.0);
payoutText += "\nThat's a flush";
} /*else if (reelSuit[0].getColor().equalsIgnoreCase(reelSuit[1].getColor()) &&
reelSuit[1].getColor().equalsIgnoreCase(reelSuit[2].getColor())) {
if (reelSuit[0].getColor().equalsIgnoreCase("red")) {
text += "\nThat looks all Red";
} else {
text += "\nThat looks all Black";
}
Casino.ac.setMultipler(2);
}*/
if (Casino.ac.getMultipler() >= 2) {
Casino.ac.setWinning(true);
Casino.ac.setCasinoBalance();
Casino.ac.setMultipler(1);
} else {
Casino.ac.setWinning(false);
}
}
private static void dealCards() throws InterruptedException {
int j = 0;
Cards card = Casino.card;
do {
do {
reelSuit[j] = card.cardDealtSuit();
reelRank[j] = card.cardDealtRank();
cards[j]=card.toCardName(reelRank[j],reelSuit[j]);
}
while (card.cardIllegalChecker(reelRank[j].ordinal(), reelSuit[j].ordinal()));
System.out.println("Card " + card.toCardName(reelRank[j], reelSuit[j]));
j++;
Thread.sleep(0);
} while (j < 3);
}
private static boolean isStraight() {
if ((reelRank[0].worth - reelRank[1].worth) == 1 && ((reelRank[1].worth - reelRank[2].worth) == 1)) {
return true;
} else return (reelRank[0].worth - reelRank[1].worth) == -1 && ((reelRank[1].worth - reelRank[2].worth) == -1);
}
}
| [
"[email protected]"
]
| |
5fd9387193bc53196451d6666e1eaa2a98dfbab6 | 9f09df41162558fdc587eacd8d28e63906aab024 | /Arreglos.java | 781761b9a7c2579b8c49c05bfc974361c74bbd59 | []
| no_license | osbaldoAlbornoz/java-scripts | e44b0dcece1c6477a023881c841a7a547a5dd6f8 | 210ba5b8c25670d3b2242ff6effe5fa1d095b40f | refs/heads/master | 2020-04-13T20:52:11.286158 | 2018-12-28T19:20:05 | 2018-12-28T19:20:05 | 163,441,603 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 622 | java | // arreglos
// posicion inicial de un arreglo es 0
// Ej int nombre[] = new int[5];
// Ej numeros[2] = 8; Guarda 8 en la posicion 2 del vector
import java.util.Scanner;
public class Arreglos{
public static void main(String args[]){
Scanner in = new Scanner(System.in);
int vector[] = new int[5];
int i = 0;
int valor = 0;
for(i = 0 ; i < 5 ; i++){
System.out.println("Ingrese el valor de la posicion " + i);
valor = in.nextInt();
vector[i] = valor;
}
System.out.print("Los valores ingresados son: ");
for (i = 0 ; i < 5 ; i++){
System.out.print(vector[i] + " ,");
}
}
} | [
"[email protected]"
]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.