blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
410
| content_id
stringlengths 40
40
| detected_licenses
listlengths 0
51
| license_type
stringclasses 2
values | repo_name
stringlengths 5
132
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringlengths 4
80
| visit_date
timestamp[us] | revision_date
timestamp[us] | committer_date
timestamp[us] | github_id
int64 5.85k
689M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 22
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 131
values | src_encoding
stringclasses 34
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 3
9.45M
| extension
stringclasses 32
values | content
stringlengths 3
9.45M
| authors
listlengths 1
1
| author_id
stringlengths 0
313
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1171e36f211beadb0e5ae9b01e10b1d2948062cf | a9a50e927a204c3e9d921cd5a0290be1f4908427 | /core/src/com/color/game/elements/enabledelements/WindBlowerEnabled.java | 62d2bd7838f834e5d7c17c1ba324eb9df50b9e6f | []
| no_license | Pravez/ColoringWorld | fb392b46a23f1e68abaa1b4c1e74d4524bc6c4b2 | c056e38d483dc00af6c2c9c15a930778ed6a67cd | refs/heads/master | 2021-01-01T18:03:01.771643 | 2015-09-06T16:57:34 | 2015-09-06T16:57:34 | 34,316,803 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,185 | java | package com.color.game.elements.enabledelements;
import com.badlogic.gdx.math.Vector2;
import com.color.game.elements.staticelements.sensors.WindBlower;
import com.color.game.elements.staticelements.sensors.WindDirection;
import com.color.game.levels.Level;
/**
* WindBlower which can be activated or deactivated
*/
public class WindBlowerEnabled extends WindBlower implements BaseEnabledElement {
private boolean activated;
public WindBlowerEnabled(Vector2 position, float width, float height, Level level, WindDirection direction, boolean activated) {
super(position, width, height, level, direction);
this.activated = activated;
if (!this.activated)
deactivate();
}
public boolean isActivated() {
return this.activated;
}
@Override
public void changeActivation() {
if (this.activated)
deactivate();
else
activate();
}
private void activate() {
this.activated = true;
this.physicComponent.enableCollisions();
}
private void deactivate() {
this.activated = false;
this.physicComponent.disableCollisions();
}
}
| [
"[email protected]"
]
| |
c4d748b42d0d0225153bc24f5a81f07069afd0cc | 64e83f45d7769df95f021b97183dd4e002fc4d7f | /src/com/jiaox/io/SequenceInputStreamDemo.java | d8be87595beca2f8128afbd7839409225e31d90e | []
| no_license | jiaox/javademo | 449b188c877af88d4c0612f0b29f1287364b5c4d | 1d70136234f43ed0b2faded366b531ade23993ab | refs/heads/master | 2020-03-29T05:56:00.878297 | 2019-03-26T13:22:23 | 2019-03-26T13:22:23 | 149,602,079 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,067 | java | package com.jiaox.io;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.SequenceInputStream;
import java.util.Enumeration;
import java.util.Vector;
/**
* 序列流,
* 将多个读取流进行串联
* 多个读取流,合并成一个读取流
* 可以实现数据合并。
* @author Administrator
*
*/
public class SequenceInputStreamDemo {
public static void main(String[] args) throws IOException {
Vector<FileInputStream> v=new Vector<FileInputStream>();
for(int x=1;x<=3;x++){
v.add(new FileInputStream("E:\\"+x+".txt"));
}
Enumeration<FileInputStream> en=v.elements();
//将多个流对象合并成一个流对象
SequenceInputStream sis=new SequenceInputStream(en);
//定义一个目的
FileOutputStream fos =new FileOutputStream("E:\\123.txt");
byte[] buf=new byte[1024];
int len=0;
while((len=sis.read(buf))!=-1){
fos.write(buf,0,len);
}
fos.close();
sis.close();
}
}
| [
"[email protected]"
]
| |
6ec263e87fc5f6876a2459fb8d3d7790084d374d | 26081e97fc245bfc919f0887a57108c4c8bf95fd | /app/src/main/java/io/kaif/mobile/view/LoginActivity.java | c715de1391b7c58718fcd31282eec85b5cedee55 | [
"Apache-2.0"
]
| permissive | zhengda/kaif-android | 376c4563a566d1e752763634fddffd0e464f5b2f | bfe8d91eaf2f116303663181a27677fb1c9964f1 | refs/heads/master | 2020-12-31T03:36:16.365419 | 2016-05-12T01:52:49 | 2016-05-12T01:52:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,650 | java | package io.kaif.mobile.view;
import javax.inject.Inject;
import android.content.Intent;
import android.graphics.Rect;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import butterknife.ButterKnife;
import butterknife.Bind;
import io.kaif.mobile.KaifApplication;
import io.kaif.mobile.R;
import io.kaif.mobile.app.BaseActivity;
import io.kaif.mobile.view.daemon.AccountDaemon;
import io.kaif.mobile.view.graphics.drawable.Triangle;
import io.kaif.mobile.view.util.Views;
public class LoginActivity extends BaseActivity {
@Inject
AccountDaemon accountDaemon;
@Bind(R.id.sign_in)
Button signInBtn;
@Bind(R.id.sign_in_progress)
ProgressBar signInProgress;
@Bind(R.id.sign_in_title)
TextView signInTitle;
@Bind(R.id.title)
TextView title;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
ButterKnife.bind(this);
KaifApplication.getInstance().beans().inject(this);
int triangleSize = (int) -title.getPaint().ascent();
Triangle triangle = new Triangle(getResources().getColor(R.color.vote_state_up), false);
triangle.setBounds(new Rect(0, 0, triangleSize, triangleSize));
title.setCompoundDrawables(triangle, null, null, null);
title.setCompoundDrawablePadding((int) Views.convertDpToPixel(16, this));
signInBtn.setOnClickListener(v -> startActivity(accountDaemon.createOauthPageIntent()));
}
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
setIntent(intent);
}
@Override
protected void onResume() {
super.onResume();
final Uri data = getIntent().getData();
if (data == null) {
return;
}
getIntent().setData(null);
signInProgress.setVisibility(View.VISIBLE);
signInTitle.setVisibility(View.VISIBLE);
signInBtn.setVisibility(View.GONE);
bind(accountDaemon.accessToken(data.getQueryParameter("code"), data.getQueryParameter("state")))
.subscribe(aVoid -> {
Toast.makeText(this, R.string.sign_in_success, Toast.LENGTH_SHORT).show();
Intent intent = new Intent(this, HomeActivity.class);
startActivity(intent);
finish();
}, throwable -> {
Toast.makeText(this, throwable.toString(), Toast.LENGTH_SHORT).show();
signInProgress.setVisibility(View.GONE);
signInTitle.setVisibility(View.GONE);
signInBtn.setVisibility(View.VISIBLE);
});
}
}
| [
"[email protected]"
]
| |
0cbd022c1711f082352cdfd71ffc0b0b33a72662 | ffaa97bcdbd0450d86000d66d8b5f77b36edc7dc | /src/main/java/app/strategy/Bird.java | b3d6b5887f49f851e015cc467464650714ebb1c6 | []
| no_license | moonik/design-patterns | 14eda1e4c5a341e5dd63f88d0c02cb8d7bded99e | 1da8c92f56adaacb6e81a7d3684d1a005207c713 | refs/heads/master | 2020-04-15T15:28:15.404814 | 2019-01-13T12:45:45 | 2019-01-13T12:45:45 | 164,795,045 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 251 | java | package app.strategy;
public class Bird extends Animal {
public Bird() {
super();
// We set the Fly interface polymorphically
// This sets the behavior as a non-flying Animal
setFlyingType(new CanFly());
}
}
| [
"[email protected]"
]
| |
7c6bdc3cecf7cb179cf9e4c41de67f12f357f103 | 000e9ddd9b77e93ccb8f1e38c1822951bba84fa9 | /java/classes/com/b/a/i/b.java | 52a53c9961b23ff09f40dbc4dca5ae97e200da10 | [
"Apache-2.0"
]
| permissive | Paladin1412/house | 2bb7d591990c58bd7e8a9bf933481eb46901b3ed | b9e63db1a4975b614c422fed3b5b33ee57ea23fd | refs/heads/master | 2021-09-17T03:37:48.576781 | 2018-06-27T12:39:38 | 2018-06-27T12:41:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 482 | java | package com.b.a.i;
import com.b.a.d;
public class b
extends d
{
public b(String paramString)
{
super(paramString);
}
public b(String paramString, Throwable paramThrowable)
{
super(paramString, paramThrowable);
}
public b(Throwable paramThrowable)
{
super(paramThrowable);
}
}
/* Location: /Users/gaoht/Downloads/zirom/classes-dex2jar.jar!/com/b/a/i/b.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"[email protected]"
]
| |
bf7463e58003e7fc47ce2378b8a330136c1ee7b2 | c846dd9f3c8cc7857b5d09f1046806ee9a14d8e3 | /src/plascon/view/Clients.java | 6be71fc99028e57c639d5da857a60805f43997f0 | []
| no_license | Ndinyo/client_manager | 6ff44cb725cabdd2c340fafd3a571fc3317b5679 | 90801c8c8bf44f32c0625b8f995cefe4fceb78db | refs/heads/master | 2022-11-04T19:13:22.722744 | 2020-06-20T17:04:13 | 2020-06-20T17:04:13 | 273,749,969 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 20,616 | java | package plascon.view;
/**
*
* @author abi
*/
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.Arrays;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import plascon.model.ClientDB;
public class Clients extends javax.swing.JFrame {
String conString = "jdbc:postgresql://localhost:5432/Plascon";
String user = "postgres";
String passWord = "abel";
/**
* Creates new form Clients
*/
public Clients() {
initComponents();
txtFldName.requestFocus();
}
public String getName() {
return txtFldName.toString();
}
public String getTelephone() {
return txtFldPNumber.toString();
}
public String getLoc() {
return txtLocation.toString();
}
public String getIDNO() {
return txtIDNO.toString();
}
public String getDateOfJoining() {
return dateSignedUp.getDateFormatString().toString();
}
public String getComments() {
return textAreaComments.toString();
}
/**
* 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() {
jPanel1 = new javax.swing.JPanel();
jPanel2 = new javax.swing.JPanel();
txtFldPNumber = new javax.swing.JTextField();
jPanel3 = new javax.swing.JPanel();
txtFldName = new javax.swing.JTextField();
jPanel4 = new javax.swing.JPanel();
txtLocation = new javax.swing.JTextField();
jPanel5 = new javax.swing.JPanel();
txtIDNO = new javax.swing.JTextField();
btnCreate = new javax.swing.JButton();
btnReset = new javax.swing.JButton();
btnExit = new javax.swing.JButton();
jPanel6 = new javax.swing.JPanel();
dateSignedUp = new com.toedter.calendar.JDateChooser();
jPanel7 = new javax.swing.JPanel();
jScrollPane1 = new javax.swing.JScrollPane();
textAreaComments = new javax.swing.JTextArea();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setTitle("NEW CLIENT");
setResizable(false);
jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Telephone Number"));
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addComponent(txtFldPNumber)
.addContainerGap())
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(txtFldPNumber, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Name"));
javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
jPanel3.setLayout(jPanel3Layout);
jPanel3Layout.setHorizontalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
.addContainerGap()
.addComponent(txtFldName)
.addContainerGap())
);
jPanel3Layout.setVerticalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(txtFldName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder("Location"));
txtLocation.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
txtLocationActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
jPanel4.setLayout(jPanel4Layout);
jPanel4Layout.setHorizontalGroup(
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
.addContainerGap()
.addComponent(txtLocation)
.addContainerGap())
);
jPanel4Layout.setVerticalGroup(
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(txtLocation, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder("I.D NO"));
javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
jPanel5.setLayout(jPanel5Layout);
jPanel5Layout.setHorizontalGroup(
jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
.addContainerGap()
.addComponent(txtIDNO)
.addContainerGap())
);
jPanel5Layout.setVerticalGroup(
jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(txtIDNO, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
btnCreate.setBackground(new java.awt.Color(242, 12, 18));
btnCreate.setText("Create");
btnCreate.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnCreateActionPerformed(evt);
}
});
btnReset.setBackground(new java.awt.Color(242, 12, 18));
btnReset.setText("Reset");
btnReset.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnResetActionPerformed(evt);
}
});
btnExit.setBackground(new java.awt.Color(242, 12, 18));
btnExit.setText("Exit");
btnExit.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnExitActionPerformed(evt);
}
});
jPanel6.setBorder(javax.swing.BorderFactory.createTitledBorder("Date"));
javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
jPanel6.setLayout(jPanel6Layout);
jPanel6Layout.setHorizontalGroup(
jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel6Layout.createSequentialGroup()
.addContainerGap()
.addComponent(dateSignedUp, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
jPanel6Layout.setVerticalGroup(
jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel6Layout.createSequentialGroup()
.addContainerGap()
.addComponent(dateSignedUp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
jPanel7.setBorder(javax.swing.BorderFactory.createTitledBorder("Comments"));
textAreaComments.setColumns(20);
textAreaComments.setRows(5);
textAreaComments.setMinimumSize(new java.awt.Dimension(0, 27));
jScrollPane1.setViewportView(textAreaComments);
javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
jPanel7.setLayout(jPanel7Layout);
jPanel7Layout.setHorizontalGroup(
jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel7Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 325, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel7Layout.setVerticalGroup(
jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel7Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(55, 55, 55)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, 361, Short.MAX_VALUE)
.addComponent(jPanel5, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(btnCreate, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(27, 27, 27)
.addComponent(btnReset, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(30, 30, 30)
.addComponent(btnExit, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap(65, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnCreate)
.addComponent(btnReset)
.addComponent(btnExit))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGap(0, 0, 0))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
pack();
setLocationRelativeTo(null);
}// </editor-fold>//GEN-END:initComponents
private void txtLocationActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtLocationActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_txtLocationActionPerformed
private void btnCreateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCreateActionPerformed
ClientDB client = new ClientDB();
try {
if (txtFldName.getText().length() == 0) {
JOptionPane.showMessageDialog(null, " Name should not be blank!", "Error!", JOptionPane.OK_OPTION);
txtFldName.requestFocus();
} else if (txtFldPNumber.getText().length() == 0) {
JOptionPane.showMessageDialog(null, " Telephone Number should not be blank!", "Error!", JOptionPane.OK_OPTION);
txtFldPNumber.requestFocus();
} else if (txtLocation.getText().length() == 0) {
JOptionPane.showMessageDialog(null, " Location should not be blank!", "Error!", JOptionPane.OK_OPTION);
txtLocation.requestFocus();
} else if (txtIDNO.getText().length() == 0) {
JOptionPane.showMessageDialog(null, " ID Number should not be blank!", "Error!", JOptionPane.OK_OPTION);
txtIDNO.requestFocus();
} else if (client.addClient(txtFldName.getText(), txtFldPNumber.getText(), txtLocation.getText(), txtIDNO.getText(),dateSignedUp.getDate().toString(),textAreaComments.getText())) {
JOptionPane.showMessageDialog(null, " New Client '" + txtFldName.getText() + "' created Successfully!");
resetFields();
int response = JOptionPane.showConfirmDialog(this, "Add a new Client?", "New Client", JOptionPane.YES_NO_OPTION);
if (response == JOptionPane.NO_OPTION) {
this.dispose();
}
}
} catch (Exception ex) {
}
}//GEN-LAST:event_btnCreateActionPerformed
private void btnExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnExitActionPerformed
int exit = JOptionPane.showConfirmDialog(this, "Exit?", "Confirm!", JOptionPane.YES_NO_OPTION);
if (exit == JOptionPane.YES_OPTION) {
this.dispose();
}
}//GEN-LAST:event_btnExitActionPerformed
private void btnResetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnResetActionPerformed
resetFields();
}//GEN-LAST:event_btnResetActionPerformed
private void resetFields() {
txtFldName.setText("");
txtFldPNumber.setText("");
txtLocation.setText("");
txtIDNO.setText("");
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(Clients.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(Clients.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(Clients.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(Clients.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Clients().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnCreate;
private javax.swing.JButton btnExit;
private javax.swing.JButton btnReset;
private com.toedter.calendar.JDateChooser dateSignedUp;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel3;
private javax.swing.JPanel jPanel4;
private javax.swing.JPanel jPanel5;
private javax.swing.JPanel jPanel6;
private javax.swing.JPanel jPanel7;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTextArea textAreaComments;
private javax.swing.JTextField txtFldName;
private javax.swing.JTextField txtFldPNumber;
private javax.swing.JTextField txtIDNO;
private javax.swing.JTextField txtLocation;
// End of variables declaration//GEN-END:variables
}
| [
"[email protected]"
]
| |
eee5aac94401e42943499a50a6ffe08e3c2873c9 | fa081a547cba53919b2b2b59613916c56d153927 | /app/src/main/java/vn/com/kidy/data/model/login/Account.java | 1c26509c2fdcd075ce7146e290d1bb04b1556fb9 | []
| no_license | hoangpn412/Kidy-Parent | ad42f9012c9460758ba197820bad6585901a7e2b | ec57368c2a57effdcecdeb0e9b2c67eb03bd88ef | refs/heads/master | 2020-03-16T17:28:11.382373 | 2018-05-10T01:47:41 | 2018-05-10T01:47:41 | 132,833,569 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 277 | java | package vn.com.kidy.data.model.login;
/**
* Created by admin on 3/20/18.
*/
public class Account {
final String email;
final String password;
public Account(String email, String password) {
this.email = email;
this.password = password;
}
}
| [
"[email protected]"
]
| |
e3874dbacdbbbc909eb3ad049c7bd523371a438d | 0b5739e601f80ef46aaf1cb58da85b6a0cc90cfa | /src/de/regioosm/housenumbercore/util/OsmReader.java | e9021a174906e66070a920ca8fe68b1780944802 | []
| no_license | DavidMoraisFerreira/housenumbercore | 3f7b6965316c3d74d3eb71865f13a54aa5f0ebdf | 98a8664e1370b9515260160b13d5417b168b30e9 | refs/heads/master | 2020-03-08T06:28:44.104357 | 2018-05-10T07:43:59 | 2018-05-10T07:43:59 | 127,972,835 | 0 | 0 | null | 2018-04-03T21:51:44 | 2018-04-03T21:51:43 | null | UTF-8 | Java | false | false | 19,574 | java | package de.regioosm.housenumbercore.util;
import java.io.BufferedReader;
import java.io.File;
import java.sql.Connection;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.openstreetmap.osmosis.core.OsmosisRuntimeException;
import org.openstreetmap.osmosis.core.container.v0_6.EntityContainer;
import org.openstreetmap.osmosis.core.container.v0_6.NodeContainer;
import org.openstreetmap.osmosis.core.container.v0_6.RelationContainer;
import org.openstreetmap.osmosis.core.container.v0_6.WayContainer;
import org.openstreetmap.osmosis.core.domain.v0_6.*;
import org.openstreetmap.osmosis.core.task.v0_6.Sink;
import org.openstreetmap.osmosis.core.task.v0_6.RunnableSource;
import org.openstreetmap.osmosis.xml.common.CompressionMethod;
import org.openstreetmap.osmosis.xml.v0_6.XmlReader;
public class OsmReader {
protected static Connection housenumberConn = null;
private static OsmImportparameter importparameter = new OsmImportparameter();
public OsmReader(OsmImportparameter importparameter) {
OsmReader.importparameter = importparameter;
}
public static OsmImportparameter getImportparameter() {
return importparameter;
}
public static void connectDB(Connection housenumberConn) {
OsmReader.housenumberConn = housenumberConn;
}
public Map<Municipality, HousenumberList> execute() {
Map<Municipality, HousenumberList> lists = new HashMap<>();
Map<Long, Node> gibmirnodes = new HashMap<Long, Node>();
Map<Long, Way> gibmirways = new HashMap<Long, Way>();
Map<Long, Relation> gibmirrelations = new HashMap<Long, Relation>();
try {
Sink sinkImplementation = new Sink() {
OsmImportparameter importparameter = OsmReader.getImportparameter();
List<String> extraosmkeys = importparameter.getExtrakeys();
Integer nodes_count = 0;
Integer ways_count = 0;
Integer relations_count = 0;
int doubletaddresses = 0;
@Override
public void release() {
// TODO Auto-generated method stub
System.out.println("hallo Sink.release aktiv !!!");
}
@Override
public void complete() {
System.out.println("hallo Sink.complete aktiv: nodes #"+nodes_count+" ways #"+ways_count+" relations #"+relations_count);
ImportAddress.connectDB(housenumberConn);
// loop over all osm node objects
for (Map.Entry<Long, Node> nodemap: gibmirnodes.entrySet()) {
ImportAddress housenumber = new ImportAddress();
housenumber.setSourceSrid(importparameter.getSourceCoordinateSystem());
String countrycode = importparameter.getCountrycode();
Long objectid = nodemap.getKey();
Collection<Tag> tags = nodemap.getValue().getTags();
HashMap<String,String> keyvalues = new HashMap<String,String>();
for (Tag tag: tags) {
System.out.println("node #" + objectid + ": Tag [" + tag.getKey() + "] ==="+tag.getValue()+"===");
keyvalues.put(tag.getKey(), tag.getValue());
if(tag.getKey().equals("addr:country")) {
countrycode = tag.getValue().trim();
try {
housenumber.setCountrycode(countrycode);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
if(tag.getKey().equals("addr:city"))
housenumber.setMunicipality(tag.getValue().trim());
if( tag.getKey().equals("addr:street")
|| tag.getKey().equals("addr:place")) {
housenumber.setStreet(tag.getValue().trim());
}
if(tag.getKey().equals("addr:postcode"))
housenumber.setPostcode(tag.getValue().trim());
if(tag.getKey().equals("addr:housenumber")) {
housenumber.setHousenumber(tag.getValue().trim());
if ((housenumber.getHousenumber().indexOf(",") != -1) ||
(housenumber.getHousenumber().indexOf(";") != -1)) {
System.out.println("WARNING: in housenumber special character " +
"for more than one housenumber found, will not be resolved to separate housenumbers");
}
}
if(extraosmkeys.contains(tag.getKey())) {
housenumber.osmtags.add(tag.getKey().trim(), tag.getValue().trim());
}
}
System.out.println( "raw node with housenumber ===" + housenumber.getHousenumber() +
"=== in street ===" + housenumber.getStreet() + "===, node id #" + objectid + "===");
if (!housenumber.getHousenumber().equals("")) {
if (!housenumber.getStreet().equals("")) {
housenumber.setLonLat(nodemap.getValue().getLongitude(), nodemap.getValue().getLatitude());
Municipality municipality = null;
try {
municipality = new Municipality(countrycode,
housenumber.getMunicipality(), "");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
HousenumberList housenumberlist = null;
if(lists.containsKey(municipality))
housenumberlist = lists.get(municipality);
else {
housenumberlist = new HousenumberList(municipality);
}
if(!housenumberlist.contains(housenumber)) {
housenumberlist.addHousenumber(housenumber);
lists.put(municipality, housenumberlist);
} else {
System.out.println("housenumber doublet at osm id " + objectid);
doubletaddresses++;
}
} else {
System.out.println("WARNING: OSM Node has a housenumber, but no street or place Information and will be ignored. OSM-Node id is " + objectid);
}
}
}
// loop over all osm way objects
for (Map.Entry<Long, Way> waymap: gibmirways.entrySet()) {
ImportAddress housenumber = new ImportAddress();
housenumber.setSourceSrid(importparameter.getSourceCoordinateSystem());
String countrycode = importparameter.getCountrycode();
Long objectid = waymap.getKey();
Collection<Tag> tags = waymap.getValue().getTags();
HashMap<String,String> keyvalues = new HashMap<String,String>();
for (Tag tag: tags) {
keyvalues.put(tag.getKey(), tag.getValue());
if(tag.getKey().equals("addr:country")) {
countrycode = tag.getValue().trim();
try {
housenumber.setCountrycode(countrycode);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
if(tag.getKey().equals("addr:city"))
housenumber.setMunicipality(tag.getValue().trim());
if( tag.getKey().equals("addr:street")
|| tag.getKey().equals("addr:place")) {
housenumber.setStreet(tag.getValue().trim());
}
if(tag.getKey().equals("addr:postcode"))
housenumber.setPostcode(tag.getValue().trim());
if(tag.getKey().equals("addr:housenumber")) {
housenumber.setHousenumber(tag.getValue().trim());
if ((housenumber.getHousenumber().indexOf(",") != -1) ||
(housenumber.getHousenumber().indexOf(";") != -1)) {
System.out.println("WARNING: in housenumber special character " +
"for more than one housenumber found, will not be resolved to separate housenumbers");
}
}
if(tag.getKey().equals("centroid_lon"))
housenumber.setLon(Double.parseDouble(tag.getValue()));
if(tag.getKey().equals("centroid_lat"))
housenumber.setLat(Double.parseDouble(tag.getValue()));
if(extraosmkeys.contains(tag.getKey())) {
housenumber.osmtags.add(tag.getKey().trim(), tag.getValue().trim());
}
}
System.out.println( "raw way with housenumber ===" + housenumber.getHousenumber() +
"=== in street ===" + housenumber.getStreet() + "===, node id #" + objectid + "===");
if (!housenumber.getHousenumber().equals("")) {
if (!housenumber.getStreet().equals("")) {
//osmhousenumber.set_osm_tag(keyvalues);
Municipality municipality = null;
try {
municipality = new Municipality(countrycode,
housenumber.getMunicipality(), "");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
HousenumberList housenumberlist = null;
if(lists.containsKey(municipality))
housenumberlist = lists.get(municipality);
else {
housenumberlist = new HousenumberList(municipality);
}
if(!housenumberlist.contains(housenumber)) {
housenumberlist.addHousenumber(housenumber);
lists.put(municipality, housenumberlist);
} else {
System.out.println("housenumber doublet at osm id " + objectid);
doubletaddresses++;
}
} else {
System.out.println("WARNING: OSM Way has a housenumber, but no street or place Information and will be ignored. OSM-Wayid is " + objectid);
}
}
}
// loop over all osm relation objects with addr:housenumber Tag
for (Map.Entry<Long, Relation> relationmap: gibmirrelations.entrySet()) {
ImportAddress housenumber = new ImportAddress();
housenumber.setSourceSrid(importparameter.getSourceCoordinateSystem());
String countrycode = importparameter.getCountrycode();
Long objectid = relationmap.getKey();
Collection<Tag> tags = relationmap.getValue().getTags();
HashMap<String,String> keyvalues = new HashMap<String,String>();
for (Tag tag: tags) {
keyvalues.put(tag.getKey(), tag.getValue());
if(tag.getKey().equals("addr:country")) {
countrycode = tag.getValue().trim();
try {
housenumber.setCountrycode(countrycode);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
if(tag.getKey().equals("addr:city"))
housenumber.setMunicipality(tag.getValue().trim());
if( tag.getKey().equals("addr:street")
|| tag.getKey().equals("addr:place")) {
housenumber.setStreet(tag.getValue().trim());
}
if(tag.getKey().equals("addr:postcode"))
housenumber.setPostcode(tag.getValue().trim());
if(tag.getKey().equals("addr:housenumber")) {
housenumber.setHousenumber(tag.getValue().trim());
if ((housenumber.getHousenumber().indexOf(",") != -1) ||
(housenumber.getHousenumber().indexOf(";") != -1)) {
System.out.println("WARNING: in housenumber special character " +
"for more than one housenumber found, will not be resolved to separate housenumbers");
}
}
if(tag.getKey().equals("centroid_lon"))
housenumber.setLon(Double.parseDouble(tag.getValue()));
if(tag.getKey().equals("centroid_lat"))
housenumber.setLat(Double.parseDouble(tag.getValue()));
if(extraosmkeys.contains(tag.getKey())) {
housenumber.osmtags.add(tag.getKey().trim(), tag.getValue().trim());
}
}
System.out.println( "raw relation with housenumber ===" + housenumber.getHousenumber() +
"=== in street ===" + housenumber.getStreet() + "===, node id #" + objectid + "===");
if (!housenumber.getHousenumber().equals("")) {
if (!housenumber.getStreet().equals("")) {
//osmhousenumber.set_osm_tag(keyvalues);
Municipality municipality = null;
try {
municipality = new Municipality(countrycode,
housenumber.getMunicipality(), "");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
HousenumberList housenumberlist = null;
if(lists.containsKey(municipality))
housenumberlist = lists.get(municipality);
else {
housenumberlist = new HousenumberList(municipality);
}
if(!housenumberlist.contains(housenumber)) {
housenumberlist.addHousenumber(housenumber);
lists.put(municipality, housenumberlist);
} else {
System.out.println("housenumber doublet at osm id " + objectid);
doubletaddresses++;
}
} else {
System.out.println("WARNING: OSM Relation has a housenumber, " +
"but no street or place Information and will be ignored. OSM-relationid is " + objectid);
}
}
}
}
@Override
public void initialize(Map<String, Object> metaData) {
}
@Override
public void process(EntityContainer entityContainer) {
Entity entity = entityContainer.getEntity();
if (entity instanceof Node) {
//do something with the node
nodes_count++;
//availableNodes.set(entity.getId());
NodeContainer nodec = (NodeContainer) entityContainer;
Node node = nodec.getEntity();
//System.out.println("Node lon: "+node.getLongitude() + " lat: "+node.getLatitude()+"===");
gibmirnodes.put(entity.getId(), node);
} else if (entity instanceof Way) {
ways_count++;
WayContainer wayc = (WayContainer) entityContainer;
Way way = wayc.getEntity();
List<WayNode> actwaynodes = way.getWayNodes();
Integer lfdnr = 0;
Double lon_sum = 0.0D;
Double lat_sum = 0.0D;
for (WayNode waynode: actwaynodes) {
Node actnode = gibmirnodes.get(waynode.getNodeId());
lon_sum += actnode.getLongitude();
lat_sum += actnode.getLatitude();
lfdnr++;
}
Collection<Tag> waytags = way.getTags();
Double centroid_lon = lon_sum / lfdnr;
Double centroid_lat = lat_sum / lfdnr;
waytags.add(new Tag("centroid_lon", centroid_lon.toString()));
waytags.add(new Tag("centroid_lat", centroid_lat.toString()));
gibmirways.put(entity.getId(), way);
} else if (entity instanceof Relation) {
//do something with the relation
relations_count++;
//System.out.println("Relation " + entity.toString());
List<RelationMember> relmembers = ((Relation) entity).getMembers();
RelationContainer relationc = (RelationContainer) entityContainer;
Relation relation = relationc.getEntity();
Collection<Tag> relationtags = entity.getTags();
String relationType = "";
String relationName = "";
boolean relationContainsAddrhousenumber = false;
for (Tag tag: relationtags) {
//System.out.println("Tag [" + tag.getKey() + "] ==="+tag.getValue()+"===");
if( tag.getKey().equals("type"))
relationType = tag.getValue();
if( tag.getKey().equals("name"))
relationName = tag.getValue();
if(tag.getKey().equals("addr:housenumber"))
relationContainsAddrhousenumber = true;
}
if( ! relationType.equals("associatedStreet")
&& ! relationType.equals("multipolygon")) {
System.out.println("WARNING: Relation is not of type associatedStreet, instead ===" +
relationType + "===, OSM-Id ===" + entity.getId() + "===");
return;
}
if( relationType.equals("associatedStreet")
&& (relationName.equals(""))) {
System.out.println("WARNING: Relation has no name Tag, will be ignored, OSM-Id ===" + entity.getId() + "===");
return;
}
Integer lfdnr = 0;
Double lon_sum = 0.0D;
Double lat_sum = 0.0D;
for(int memberi = 0; memberi < relmembers.size(); memberi++) {
RelationMember actmember = relmembers.get(memberi);
EntityType memberType = actmember.getMemberType();
long memberId = actmember.getMemberId();
//System.out.println("relation member ["+memberi+"] Typ: "+memberType+" ==="+actmember.toString()+"=== Role ==="+actmember.getMemberRole()+"===");
if(actmember.getMemberRole().equals("street")) { // ignore relation member with role street
System.out.println("WARNING: Relation is of type=street, will be ignored, OSM-Id ===" + entity.getId() + "===");
continue;
}
if (EntityType.Node.equals(memberType)) {
if (gibmirnodes.get(memberId) != null) {
System.out.println("Info: in Relation Member vom Type NODE enthalten ==="+gibmirnodes.get(memberId).toString()+"===");
System.out.println("Info: Hier die Tags des Node: "+gibmirnodes.get(memberId).getTags().toString()+"===");
Collection<Tag> nodetags = gibmirnodes.get(memberId).getTags();
nodetags.add(new Tag("addr:street", relationName));
}
} else if (EntityType.Way.equals(memberType)) {
if (gibmirways.get(memberId) != null) {
Collection<Tag> waytags = gibmirways.get(memberId).getTags();
waytags.add(new Tag("addr:street", relationName));
Way actway = gibmirways.get(memberId);
List<WayNode> actwaynodes = actway.getWayNodes();
for (WayNode waynode: actwaynodes) {
Node actnode = gibmirnodes.get(waynode.getNodeId());
if(!actmember.getMemberRole().equals("inner")) {
lon_sum += actnode.getLongitude();
lat_sum += actnode.getLatitude();
lfdnr++;
}
}
}
}
} // loop over alle relation members
// if relation contains a housenumber (so its not an assocatedStreet relation, but a multipolygon with address)
if(relationContainsAddrhousenumber) {
Double centroid_lon = lon_sum / lfdnr;
Double centroid_lat = lat_sum / lfdnr;
relationtags.add(new Tag("centroid_lon", centroid_lon.toString()));
relationtags.add(new Tag("centroid_lat", centroid_lat.toString()));
gibmirrelations.put(entity.getId(), relation);
}
}
}
};
RunnableSource osmfilereader;
if(importparameter.getImportfile() == null)
return null;
File filehandle = new File(importparameter.getImportfile());
if(!filehandle.isFile() || !filehandle.canRead())
return null;
osmfilereader = new XmlReader(filehandle, false, CompressionMethod.None);
osmfilereader.setSink(sinkImplementation);
Thread readerThread = new Thread(osmfilereader);
readerThread.start();
while (readerThread.isAlive()) {
readerThread.join();
}
} catch (OsmosisRuntimeException osmosiserror) {
System.out.println("ERROR: Osmosis runtime Error ...");
System.out.println("ERROR: " +osmosiserror.toString());
} catch (InterruptedException e) {
System.out.println("WARNING: Execution of type InterruptedException occured, details follows ...");
System.out.println("WARNING: " + e.toString());
/* do nothing */
}
return lists;
}
}
| [
"[email protected]"
]
| |
ee8a96c19dee21f3ab545535e1b3bf0c19774126 | 25c61a6cb15f45e25509ade69eb740eb44616f1d | /Framework/out/production/Framework/rescueagents/MedicalRobotControl.java | 53306c4329fefa96489ddea3b8c2b97abb369fc3 | []
| no_license | aabbeell/USAR-competition | 4fde9e4098d72b57806603b07f110a9731e2f6f2 | 44beebe6e9396491e703f50d5a531af59e6fb201 | refs/heads/master | 2020-05-19T09:21:03.074493 | 2019-05-04T21:19:39 | 2019-05-04T21:19:39 | 184,944,982 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,924 | 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 rescueagents;
import interfaces.CellInfo;
import interfaces.RobotPerception;
import rescueframework.AbstractRobotControl;
import rescueframework.Action;
import world.Path;
import world.Robot;
import java.util.ArrayList;
/**
* RobotControl class to implement custom robot control strategies for medical robots
* The main aim of medical robots is to discover injured people and keep them alive until they are rescued.
*/
public class MedicalRobotControl extends AbstractRobotControl{
RescueRobotControl fallbackRescue;
FlyingDroneControl fallbackExplore; //untill we find an injured TODO: rescuenál is
private AMSService amsService;
public RobotPerception internalWorldMap;
public Robot me;
/**
* Default constructor saving world robot object and perception interface
*
* @param robot
* The robot object in the world
* @param perception
* Robot perceptions
*/
public MedicalRobotControl(Robot robot, RobotPerception perception) {
super(robot, perception);
me = robot;
fallbackRescue = new RescueRobotControl(robot, perception);
fallbackExplore = new FlyingDroneControl(robot, perception);
this.amsService = AMSService.getAMSService();
internalWorldMap = amsService.getInternalMap();
amsService.resetMemory();
this.setRobotName("Medic");
}
/**
* Custom step strategy of the robot, implement your robot control here!
*
* @return one of the following actions:
* <b>Action.STEP_UP</b> for step up,
* <b>Action.STEP_RIGHT</b> for step right,
* <b>Action.STEP_DOWN</b> for step down,
* <b>Action.STEP_LEFT</b> for step left
* <b>Action.PICK_UP</b> for pick up injured,
* <b>Action.PUT_DOWN</b> for put down injured,
* <b>Action.HEAL</b> for heal injured.
* <b>Action.IDLE</b> for doing nothing.
*/
@Override
public Action step() {
amsService.updateMedic(this);
amsService.updateInjureds(internalWorldMap.getDiscoveredInjureds()); //updates AMS with injuredList
//if no discovered injuried then help explore
if (amsService.injuredList.size() == 0 || internalWorldMap.getShortestInjuredPath(me.getLocation()) == null){
System.out.println("nincs senki am");
return fallbackExplore.step();
}
//if no medicine then convert to rescue
if(robot.getMedicine()==0){
System.out.println("nincs medicine am");
return fallbackRescue.step();
}
CellInfo dest = amsService.calcDestination(this, true); //calculate the destionation
path = amsService.pathToDest(robot.getLocation(), dest); //and path to dest
AMSService.log(this, "destination: " + dest);
AMSService.log(this, "my location: " + robot.getLocation());
//heals if the patient need some
if(robot.getLocation().getX() == dest.getX() && robot.getLocation().getY()== dest.getY()){
AMSService.log(this, "HEEEAAAAAALLLLING");
AMSService.log(this, "Medicine: " + robot.getMedicine());
return Action.HEAL;
}
ArrayList<Integer> strList = amsService.getStrengths(this);
int maxV = strList.get(amsService.getMaxIndex(strList));
if (maxV < 1000) {
System.out.println("ink nem healelek");
return fallbackRescue.step();
}
// Move the robot along the path and help the rescue if can
if (path != null) {
// Move the robot along the path and help the rescue if can
boolean helpingmode = true;
if (helpingmode) {
// FELVESZI HA AZ EXIT FELE MEGY és éppen injureden áll és nincs nála injured
boolean onInjured = robot.getLocation().hasInjured();
boolean hasInjured = robot.hasInjured();
boolean nextCellHasInjured = true;
if(path.getNextCell(me.getLocation())!=null){
nextCellHasInjured = path.getNextCell(robot.getLocation()).hasInjured(); //TODO: NULL PTR EXEP-nincs path.getnextCell-nincs path-??
}
int pathLength = path.getLength();
int distFromThis;
int distFromNext2;
if(internalWorldMap.getShortestExitPath(robot.getLocation())==null){ //HA ELÁLTÁK AZ EXIT FELÉ VEZETŐ UTAT
distFromThis = 99;
}else{
distFromThis = internalWorldMap.getShortestExitPath(robot.getLocation()).getLength();
}
int distFromNext;
if (internalWorldMap.getShortestExitPath(path.getNextCell(robot.getLocation())) != null) {
distFromNext = internalWorldMap.getShortestExitPath(path.getNextCell(robot.getLocation()))
.getLength();
} else {
distFromNext = distFromThis + 1;
distFromNext2 = distFromThis + 1;
}
// CellInfo next2 = path.getNextCell(path.getNextCell(robot.getLocation()));
// int distFromNext2 = internalWorldMap.getShortestExitPath(next2).getLength();
AMSService.log(this, "onInjured : " + onInjured);
AMSService.log(this, "hasInjured : " + hasInjured);
AMSService.log(this, "pathlenght: " + pathLength);
AMSService.log(this, "distFromThis " + distFromThis);
AMSService.log(this, "distFromNext " + distFromThis);
// AMSService.log(this, "distFromNext2 " + distFromThis);
AMSService.log(this, "nextCellHasInjured " + nextCellHasInjured);
if (onInjured) {
System.out.println("on injured");
if (!hasInjured) {
System.out.println("no carried injured");
if (!nextCellHasInjured) {
System.out.println("nextcellclear");
if (distFromNext < distFromThis) {
System.out.println("distance is lower : PICK UP");
System.out.println("hasInjured"+robot.getLocation().hasInjured());
System.out.println("getInjured"+robot.getLocation().getInjured());
amsService.updateRescuedInjureds(robot.getLocation().getInjured(), true);
return Action.PICK_UP;
}
}
}
}
// HA VAN NÁLA VALAKI és az exittől távolodik
if (hasInjured) {
System.out.println("carrying injured but ");
if (nextCellHasInjured || distFromThis < distFromNext) {
System.out.println("hasinjured or dist higher");
System.out.println("hasInjured"+robot.getLocation().hasInjured());
System.out.println("getInjured"+robot.getLocation().getInjured());
amsService.updateRescuedInjureds(me.getInjured(), false);
return Action.PUT_DOWN;
}
}
}
// más esetben simán megy az utján
return amsService.moveRobotAlongPath(robot, path);
} else {
// If no path found - the robot stays in place and does nothing
AMSService.log(this, "no path found. Stopping.");
return Action.IDLE;
}
}
}
| [
"[email protected]"
]
| |
9f38c2353e4eaf89829be32852b869f3bd5dd8ce | 9d73d7f664e6afaa76c6b080614d5a1d82fa6f90 | /src/mwac/RoutingTableEntry.java | 0c3adedf751454da0c289f01c611b28578662822 | []
| no_license | ancabalanel/trmwac | 34c390f4976bed33e288954774a3623a4318f801 | 7c4de00c69165b6b0ad4d6f99b3f60ea7d484463 | refs/heads/master | 2021-01-01T05:41:19.740506 | 2011-07-21T15:41:26 | 2011-07-21T15:41:26 | 1,977,841 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 478 | java | package mwac;
import java.util.List;
public class RoutingTableEntry{
int repDest;
List<Integer> route;
public RoutingTableEntry(int repDest, List<Integer> route) {
super();
this.repDest = repDest;
this.route = route;
}
public int getRepDest() {
return repDest;
}
public List<Integer> getRoute() {
return route;
}
@Override
public String toString() {
return "RoutingInfo [repDest=" + repDest + ", route=" + route + "]";
}
} | [
"[email protected]"
]
| |
ca8d950a0238a04fe2a0b0a9467ba393638d74a5 | c45fd48988cb7f7314fbf7c68248d3b5b87119be | /LeetCode/Java/Easy/ReverseInteger.java | 7ca6d2aaa996f3f10404d72367d17d766030a701 | [
"MIT"
]
| permissive | alui07/Technical-Interview | 49068dc52f12ec74ea1cf3e9a0c26ff02a1d1f4d | aee7a28f18ebdb4c38f9fd56662df9bdf0930c5c | refs/heads/master | 2021-07-13T05:01:41.645497 | 2020-07-22T01:11:38 | 2020-07-22T01:11:38 | 184,683,355 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,229 | java | /* 7. Reverse Integer
Given a 32-bit signed integer, reverse digits of an integer.
Example 1:
Input: 123
Output: 321
Example 2:
Input: -123
Output: -321
Example 3:
Input: 120
Output: 21
Note:
Assume we are dealing with an environment which could only store integers within the 32-bit signed integer range: [−231, 231 − 1]. For the purpose of this problem, assume that your function returns 0 when the reversed integer overflows.
*/
public class ReverseInteger{
public static int reverse(int x) {
char[] charArr;
if (x > -1) {
charArr = Integer.toString(x).toCharArray();
} else {
String stringx = Integer.toString(x);
stringx = stringx.substring(1, stringx.length());
charArr = stringx.toCharArray();
}
String result = "";
for (int i = charArr.length - 1; i > -1; i--) {
result += charArr[i];
}
try{
if (x < 0) return Integer.parseInt("-" + result);
return Integer.parseInt(result);
} catch (Exception e){
}
return 0;
}
public static void main(String[] args){
System.out.println(Integer.toString(reverse(-123)));
}
} | [
"[email protected]"
]
| |
9737625fcb4d13df4d9353dbedbaab3bf4238451 | d12608842c2ad5efb31c03fc901a1a58e0690d9e | /src/main/java/cn/bxd/sip/his/webservice/hisws/invoke/QueryToPayRecipeInfoListResponse.java | 5499324a2a945e7e53e9dde16eda1f9472d7f771 | []
| no_license | haomeiling/hlp | fc69cf8dcc92b72f495784b4de7973e2f9128b47 | cc826e0acd91b5cd4acdb253ceb1465659df1e97 | refs/heads/master | 2020-06-27T13:15:27.673382 | 2019-10-08T07:22:16 | 2019-10-08T07:22:16 | 199,963,146 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,607 | java |
package cn.bxd.sip.his.webservice.hisws.invoke;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>anonymous complex type的 Java 类。
*
* <p>以下模式片段指定包含在此类中的预期内容。
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="queryToPayRecipeInfoListResult" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"queryToPayRecipeInfoListResult"
})
@XmlRootElement(name = "queryToPayRecipeInfoListResponse")
public class QueryToPayRecipeInfoListResponse {
protected String queryToPayRecipeInfoListResult;
/**
* 获取queryToPayRecipeInfoListResult属性的值。
*
* @return
* possible object is
* {@link String }
*
*/
public String getQueryToPayRecipeInfoListResult() {
return queryToPayRecipeInfoListResult;
}
/**
* 设置queryToPayRecipeInfoListResult属性的值。
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setQueryToPayRecipeInfoListResult(String value) {
this.queryToPayRecipeInfoListResult = value;
}
}
| [
"[email protected]"
]
| |
bcf64d25a929fe6ce7cafa89c8a32addc9311c3f | 8e5584f51543d2122fe2c565eb96f4f61aed1af6 | /server/src/com/xiejun/server/ServletContext.java | fdbb0e44e9d5b322c90e6fa03ad6f493e24642d5 | []
| no_license | Wall-Xj/JavaStudy | 8bf8c149b75582eca1e52fc06bffbbb06c3bd528 | 0fe70d8d869b9360b09e9ce27efecd7329d42f8c | refs/heads/master | 2021-01-15T22:46:22.591778 | 2018-03-05T13:23:10 | 2018-03-05T13:23:10 | 99,911,643 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 793 | java | package com.xiejun.server;
import java.util.HashMap;
import java.util.Map;
/**
* 上下文
* @author Administrator
*
*/
public class ServletContext {
//为每一个servlet取个别名
// login -->com.bjsxt.server.demo03.LoginServlet
private Map<String,String> servlet ;
//url -->login
// /log -->login
// /login -->login
private Map<String,String> mapping;
ServletContext(){
servlet =new HashMap<String,String>();
mapping =new HashMap<String,String>();
}
public Map<String, String> getServlet() {
return servlet;
}
public void setServlet(Map<String, String> servlet) {
this.servlet = servlet;
}
public Map<String, String> getMapping() {
return mapping;
}
public void setMapping(Map<String, String> mapping) {
this.mapping = mapping;
}
}
| [
"[email protected]"
]
| |
9224771bf4ab3d8edb4b0f2c50cf175326f45f40 | d941c5200484a0e22420f98ada6967b5e99004a1 | /src/main/java/com/alocar/backend/web/dto/UserCredentialsDto.java | 7dce880f8e296cc8fb52a431761525759c2f9fdc | []
| no_license | AndreiVatavu/AloCar-backend | 4d1b15eddff4cefda95f0b10ce5ea667905f5644 | f66b6776f8e6df4b1f3e170b58802868269693df | refs/heads/develop | 2020-05-07T14:01:10.901164 | 2019-09-01T19:36:39 | 2019-09-01T19:36:39 | 180,573,394 | 0 | 0 | null | 2019-09-01T19:36:40 | 2019-04-10T12:07:15 | Java | UTF-8 | Java | false | false | 582 | java | package com.alocar.backend.web.dto;
import javax.validation.constraints.NotNull;
/**
* Created by Andrei Vatavu on 5/20/2019
*/
public class UserCredentialsDto {
@NotNull
private String email;
@NotNull
private String password;
public UserCredentialsDto() {
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}
| [
"[email protected]"
]
| |
e04d24f2685ed6a3b752c2f1469a3f1814264b3b | df75458c1b02010c46580774422e50a2303603b3 | /Milestone2/Milestone2/src/pt/ips/pa/fase1/tads/exceptions/ElementoExistenteException.java | 7507c0ce31c5615afb7c18db489e73ed48139e4f | [
"MIT"
]
| permissive | moraispgsi/3linha | f8ac45e480c4aab577e5625edd3c91e0437005c6 | e68bf3333ab88aad54eac8e30465229e8d049f30 | refs/heads/master | 2021-01-20T01:32:02.382227 | 2017-04-24T22:10:01 | 2017-04-24T22:10:01 | 89,291,255 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 330 | java | package pt.ips.pa.fase1.tads.exceptions;
/**
* Ocorre ao inserir um elemento já existente
*
* @author Ricardo José Horta Morais
*/
public class ElementoExistenteException extends RuntimeException {
/**
* Construtor
*/
public ElementoExistenteException() {
super("Elemento já existe.");
}
}
| [
"[email protected]"
]
| |
fdaef604e851851344145ca435ada9f58d5bb8cb | 40cac9136da589ecc3cd179f5357bbea1f88cf41 | /src/main/java/com/pcg/db/mongo/dao/impl/ScheduleLogDAOImpl.java | 50f45e579d98be87424fdb59b1f54b63ce9a5da0 | []
| no_license | obinna240/CouncilDemo2 | 430ae4630f739aa4826c4494b88c01d315eade36 | d25608092b4e1c55918ea969f09b853193a747ed | refs/heads/master | 2020-03-07T23:29:39.590957 | 2018-04-02T16:34:26 | 2018-04-02T16:34:26 | 127,782,889 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 787 | java | package com.pcg.db.mongo.dao.impl;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.data.mongodb.core.MongoOperations;
import com.pcg.db.mongo.dao.ScheduleLogDAOCustom;
import com.pcg.db.mongo.model.ScheduleLog;
/**
* DAO for managing scheduled tasks in Assist
*/
public class ScheduleLogDAOImpl extends CustomDAOImpl<ScheduleLog, Long> implements ScheduleLogDAOCustom {
@Autowired @Qualifier("mongoTemplate") MongoOperations mongoOps;
private static Log m_log = LogFactory.getLog(ScheduleLogDAOImpl.class);
public ScheduleLogDAOImpl() {
super(ScheduleLog.class);
}
}
| [
"[email protected]"
]
| |
3fb05ee906c7a0f8cc63d9d2d4743be88c4fbf9b | 1872b7a3f3a16720e0fb5a2cad380a5669cf327a | /parser/src/main/java/com/plhal/ares/parser/ParserRepository.java | 5acc753f8564cc7de770e97b7257770785b7f1b4 | []
| no_license | jiri-plhal/ares-api | 2aa6e161a31947a2be43297956fec21b65044b3c | 6b562cce38ab1bcda1be77621b93a9bcdf27e6f6 | refs/heads/master | 2023-04-01T19:08:45.453616 | 2021-03-30T20:52:46 | 2021-03-30T20:52:46 | 335,394,707 | 2 | 0 | null | 2021-03-30T20:52:47 | 2021-02-02T19:04:51 | Java | UTF-8 | Java | false | false | 490 | java | package com.plhal.ares.parser;
import com.plhal.ares.dblayer.Firma;
/**
* Interface for getting informations about company
*/
public interface ParserRepository {
/**
* This method finds informations about company from Czech business register.
*
* @param ico Identification number of company.
* @return Object of company with its informations. If company is not found or error happened, return value is null.
*/
public Firma najdiFirmu(String ico);
}
| [
"[email protected]"
]
| |
f5afbfdd4e5a20a1cb88af367e2650b970453279 | 7fa443413a08efad0df6d74d715da3463953180b | /letPapa/src/main/java/com/wq/letpapa/customview/ColorFilterImageView.java | 82e8a1fabb61064127a0ac6105153c22bcc3574b | []
| no_license | steveyg/ihepai | 5e18333171eb52ba693a5e0f6a273b649f5d04cd | 478f5cdda0eefd3e3b0d9450fec38ff197e0ae87 | refs/heads/master | 2021-01-17T22:33:43.895943 | 2014-11-27T07:05:42 | 2014-11-27T07:05:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,532 | java | /*
* Copyright (C) 2011 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.wq.letpapa.customview;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.ImageView;
import com.wq.letpapa.R;
/**
* A @{code ImageView} which grey out the icon if disabled.
*/
public class ColorFilterImageView extends ImageView {
private final int DISABLED_COLOR;
private boolean mFilterEnabled = true;
public ColorFilterImageView(Context context, AttributeSet attrs) {
super(context, attrs);
DISABLED_COLOR = context.getResources().getColor(
R.color.icon_disabled_color);
}
//
public ColorFilterImageView(Context context) {
this(context, null);
}
@Override
public void setEnabled(boolean enabled) {
super.setEnabled(enabled);
if (mFilterEnabled) {
if (enabled) {
clearColorFilter();
} else {
setColorFilter(DISABLED_COLOR);
}
}
}
public void enableFilter(boolean enabled) {
mFilterEnabled = enabled;
}
}
| [
"[email protected]"
]
| |
903273278ff0e34d0cc56a4e5630cac44903472e | c5e2c69203bb2e9a39700f7b995d8897924725d7 | /.metadata/.plugins/org.eclipse.core.resources/.history/ba/10adc6aac22d001418ebe578132245ab | 9af0ec9b877d4034cbc1529702c09875a4c0fcd2 | []
| no_license | gvenez/quicksilver | acb15dba6f1cc326fda2359a8bc055acc4ea74b0 | 2062497aacfd82d40f832cc1cddbe2ad115d47cd | refs/heads/master | 2020-05-19T07:47:13.569251 | 2014-09-04T07:10:06 | 2014-09-04T07:10:06 | 23,489,591 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,741 | package com.xmppapp.xmpp.entities;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.concurrent.ConcurrentHashMap;
public class Roster {
Account account;
ConcurrentHashMap<String, Contact> contacts = new ConcurrentHashMap<String, Contact>();
private String version = null;
public Roster(Account account) {
this.account = account;
}
public boolean hasContact(String jid) {
String cleanJid = jid.split("/")[0];
return contacts.containsKey(cleanJid);
}
public Contact getContact(String jid) {
String cleanJid = jid.split("/")[0].toLowerCase(Locale.getDefault());
if (contacts.containsKey(cleanJid)) {
return contacts.get(cleanJid);
} else {
Contact contact = new Contact(cleanJid);
contact.setAccount(account);
contacts.put(cleanJid, contact);
return contact;
}
}
public void clearPresences() {
for(Contact contact : getContacts()) {
contact.clearPresences();
}
}
public void markAllAsNotInRoster() {
for(Contact contact : getContacts()) {
contact.resetOption(Contact.Options.IN_ROSTER);
}
}
public void clearSystemAccounts() {
for(Contact contact : getContacts()) {
contact.setPhotoUri(null);
contact.setSystemName(null);
contact.setSystemAccount(null);
}
}
public List<Contact> getContacts() {
return new ArrayList<Contact>(this.contacts.values());
}
public void initContact(Contact contact) {
contact.setAccount(account);
contact.setOption(Contact.Options.IN_ROSTER);
contacts.put(contact.getJid(),contact);
}
public void setVersion(String version) {
this.version = version;
}
public String getVersion() {
return this.version;
}
public Account getAccount() {
return this.account;
}
}
| [
"[email protected]"
]
| ||
0170a31ab2d462dc813fec439f65cfa78f4502ae | 8e24a4a2c0ea149f693baaf4378ca597af468ee2 | /SipGwtConferenceDemo/src/main/java/javax/servlet/sip/TimerListener.java | 02d19c1ca10f8484bf602d9f0a399a00143524bd | []
| no_license | nguyenquynh1993/multi-p2p | d71144897208a7ca16f77b1955a6ac48c5100009 | 5c46a17192e6483df1e560337fc0a50bdd7cc0b2 | refs/heads/master | 2021-01-10T07:07:57.279875 | 2010-09-13T09:09:20 | 2010-09-13T09:09:20 | 47,410,077 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,291 | java | /*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package javax.servlet.sip;
/**
* Listener interface implemented by SIP servlet applications using timers.
* The application specifies an implementation of this interface in a listener element of the SIP deployment descriptor. There may be at most one TimerListener defined.
* See Also:TimerService
*/
public interface TimerListener extends java.util.EventListener{
/**
* Notifies the listener that the specified timer has expired.
*/
void timeout(javax.servlet.sip.ServletTimer timer);
}
| [
"tuantq84@67113970-6624-11de-9f54-6d4fae1110e3"
]
| tuantq84@67113970-6624-11de-9f54-6d4fae1110e3 |
7d556d659015f63d395c9d9397c9c65a801596fe | 50ae1858b2027cde72cd37942be0e204cfece01c | /src/entities/Produto.java | 6f30fa5f4d0bfae6032d57a7d63619462fc8b681 | []
| no_license | rafaeldosantos88/67Java-OrietacaoObjetos | 4a654d3eb22f6157dcef674afe60113bdfccf04f | 835031dfcef968aef43da5faabe649144b5a6a63 | refs/heads/master | 2021-03-30T15:18:03.910869 | 2020-03-17T20:30:00 | 2020-03-17T20:30:00 | 248,067,333 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 644 | java | package entities;
public class Produto {
public String name;
public double price;
public int quantity;
public double totalValueInStock() {
return price * quantity; //Ou seja vamos multiplicar preco vezes quantidade para saber total do valor
}
public void addProducts(int quantity) {
this.quantity +=quantity; //This referencia como o atributo da classe
}
public void removeProduct(int quantity) {
this.quantity -=quantity;
}
public String toString() {
return name
+ ", $ "
+ String.format("%.2f",price)
+ ", "
+ quantity
+ " units: total: $ "
+ String.format("%.2f",totalValueInStock());
}
}
| [
"[email protected]"
]
| |
34a9554deb517358c4ff8dc2a384fd7e10ef4b1e | 5ce963cbfd170d4f1f48b294ccc5d39a6a0ef12f | /src/test/java/api/PriceApiTest.java | d6ec33d1f953c7b824754eada1174413a46ef597 | []
| no_license | mihirk/chelsea-analytics | 9c1ff67255743476c5f64d745a1563768c2adc6c | 46fa8ccf6fc94e925bdffe0776fdb84cfb4d6155 | refs/heads/master | 2016-09-06T14:24:52.047813 | 2014-02-22T15:11:22 | 2014-02-22T15:11:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,131 | java | package api;
import models.Price;
import models.SKU;
import models.User;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;
public class PriceApiTest {
private Price skuPrice;
private User user;
private SKU sku;
PriceApi priceApi;
@Before
public void setUp() throws Exception {
skuPrice = mock(Price.class);
user = mock(User.class);
sku = mock(SKU.class);
priceApi = spy(new PriceApi());
}
@Test
public void shouldAddUserInformation() throws Exception {
priceApi.addInfo(user, sku, skuPrice);
assertEquals(user, priceApi.getUser());
}
@Test
public void shouldAddSKUInformation() throws Exception {
priceApi.addInfo(user, sku, skuPrice);
assertEquals(sku, priceApi.getSKU());
}
@Test
public void shouldCallAddOnSKUPrice() throws Exception {
priceApi.addInfo(user, sku, skuPrice);
verify(priceApi).add(skuPrice);
}
}
| [
"[email protected]"
]
| |
bdc99187373479d9433baf1f3abcf688ae083da8 | 5c46f9c99453a1caff909fded9eceb9c2550ac47 | /src/main/java/com/dfirago/swing/sql/runner/tasks/QueryExecutorTask.java | facd363d95ef63ee717f9d9caebd21f42d142e72 | []
| no_license | Firago/swing-sql-runner | 0715656e40fedac17e2b6c6ec954dae03fd2c7fe | 96b3f2d365ac793d7727588d99a7d909035ba431 | refs/heads/master | 2021-01-10T17:17:03.785519 | 2016-03-06T17:30:32 | 2016-03-06T17:30:32 | 51,875,472 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,303 | java | package com.dfirago.swing.sql.runner.tasks;
import com.dfirago.swing.sql.runner.domain.QueryConfig;
import com.dfirago.swing.sql.runner.services.ConfigurationService;
import com.dfirago.swing.sql.runner.services.DatabaseService;
import com.dfirago.swing.sql.runner.services.ProgressService;
import com.dfirago.swing.sql.runner.services.TaskSchedulerService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Component;
import java.util.concurrent.BlockingQueue;
/**
* @author diankasol
*/
@Component
@Scope("prototype")
public class QueryExecutorTask implements Runnable {
private static final Logger logger = LoggerFactory.getLogger(QueryExecutorTask.class);
@Autowired
private DatabaseService databaseService;
@Autowired
private ConfigurationService configurationService;
@Autowired
private TaskSchedulerService taskSchedulerService;
@Autowired
private ProgressService progressService;
@Override
public void run() {
QueryConfig config = (QueryConfig) configurationService.get(QueryConfig.class);
BlockingQueue<String> queries = config.getQueries();
Integer batchSize = config.getBatchSize();
logger.debug("Processing queries: batch size - {}, queries left - {}", batchSize, queries.size());
for (int i = 0; i < batchSize; i++) {
String query = queries.poll();
if (query != null) {
processQuery(query);
configurationService.save(config);
}
}
if (queries.isEmpty()) {
logger.debug("Processing finished");
taskSchedulerService.cancel(this);
}
}
private void processQuery(String query) {
try {
logger.debug("Processing query [{}]", query);
databaseService.execute(query);
logger.debug("Query executed successfully");
progressService.handleSuccess(query);
} catch (DataAccessException e) {
logger.debug("Query execution failed");
progressService.handleFailure(query);
}
}
}
| [
"[email protected]"
]
| |
2236a7fad2d8d9e35085edc261c0b995d04fff4c | 63c37d35b712e8c4bb8efa0e4ca94e2bb9345af6 | /src/day10/Test01.java | 494159e41f6959cab46ee1e1ca9cbe13eca7b945 | []
| no_license | vvvvvoin/java | 1b7e651f6b9f829fee3dd69e2706c5f1195f4ba9 | 93f9a14a253117c0f0861402014c3bf5ae2b699e | refs/heads/master | 2020-11-24T20:21:16.810017 | 2019-12-16T08:46:30 | 2019-12-16T08:46:30 | 228,326,665 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 980 | java | package day10;
public class Test01 {
public static void main(String[] args) {
Employee<String> emp1 = new Employee("홍길동", "20190001");
System.out.println(emp1);
System.out.println(emp1.number.charAt(3));
Employee<Integer> emp2 = new Employee("고길동", 20190002);
System.out.println(emp2);
System.out.println(emp2.number.getClass());
Employee emp3 = new Employee("김길동", 20190003);
System.out.println(emp3);
System.out.println(emp3.number.getClass());
}
}
class Employee<T>{
String name;
T number;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public T getNumber() {
return number;
}
public void setNumber(T number) {
this.number = number;
}
public Employee(String name, T number) {
super();
this.name = name;
this.number = number;
}
@Override
public String toString() {
return "Employee [name=" + name + ", number=" + number + "]";
}
} | [
"[email protected]"
]
| |
b0c9fa9866d8033811f1ffdc6657bca7c54685fb | 02570607edea101396ff231025498056ece3df31 | /TVLibrary/src/main/java/com/swl/tvlibrary/recyclerView/LinearLayoutManagerTV.java | 64e1b4200b9c05bcdc94df3891c9733547339046 | []
| no_license | SKToukir/FileBrowser-TV | 978048f6d172224522d57b06a2282b2f9fd922ea | 25b6d2f19bd76d7933f143744d1b01a40958f2ef | refs/heads/master | 2023-03-05T15:12:25.861913 | 2021-02-18T04:41:21 | 2021-02-18T04:41:21 | 334,580,130 | 5 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,021 | java | package com.swl.tvlibrary.recyclerView;
import android.content.Context;
import android.graphics.PointF;
import android.util.AttributeSet;
import android.view.View;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.LinearSmoothScroller;
import androidx.recyclerview.widget.RecyclerView;
/**
* 自定义的GridLayoutManager
* 配合RecyclerTV一起使用,
* 解决Recycler使用在TV上的各种焦点问题,无法快速滚动问题,滚动焦点错乱问题
*
* @author zhangTianSheng [email protected]
*/
public class LinearLayoutManagerTV extends LinearLayoutManager {
public LinearLayoutManagerTV(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}
public LinearLayoutManagerTV(Context context, int orientation, boolean reverseLayout) {
super(context, orientation, reverseLayout);
}
public LinearLayoutManagerTV(Context context) {
super(context);
}
@Override
public void scrollToPosition(int position) {
super.scrollToPosition(position);
}
/**
* 解决快速长按焦点丢失问题.
*
* @param focused
* @param focusDirection
* @param recycler
* @param state
* @return
*/
@Override
public View onFocusSearchFailed(View focused, int focusDirection, RecyclerView.Recycler recycler, RecyclerView.State state) {
View nextFocus = super.onFocusSearchFailed(focused, focusDirection, recycler, state);
return null;
}
/**
* RecyclerView的smoothScrollToPosition方法最终会执行smoothScrollToPosition
*
* @param recyclerView
* @param state
* @param position
*/
@Override
public void smoothScrollToPosition(RecyclerView recyclerView, RecyclerView.State state, int position) {
TvLinearSmoothScroller linearSmoothScroller = new TvLinearSmoothScroller(recyclerView.getContext());
linearSmoothScroller.setTargetPosition(position);
startSmoothScroll(linearSmoothScroller);
}
public PointF computeVectorForPosition(int targetPosition) {
return super.computeScrollVectorForPosition(targetPosition);
}
/**
* Base class which scrolls to selected view in onStop().
*/
class TvLinearSmoothScroller extends LinearSmoothScroller {
public TvLinearSmoothScroller(Context context) {
super(context);
}
@Override
public PointF computeScrollVectorForPosition(int targetPosition) {
return computeVectorForPosition(targetPosition);
}
/**
* 滑动完成后,让该targetPosition 处的item获取焦点
*/
@Override
protected void onStop() {
super.onStop();
View targetView = findViewByPosition(getTargetPosition());
if (targetView != null) {
targetView.requestFocus();
}
}
}
}
| [
"[email protected]"
]
| |
459b8109a8edd4314285ced07495b6efd7516531 | 12a99ab3fe76e5c7c05609c0e76d1855bd051bbb | /src/main/java/com/alipay/api/response/KoubeiRetailWmsOutboundworkDeleteResponse.java | ecc498022f886c7a8bacea44f918d2e5768c6a94 | [
"Apache-2.0"
]
| permissive | WindLee05-17/alipay-sdk-java-all | ce2415cfab2416d2e0ae67c625b6a000231a8cfc | 19ccb203268316b346ead9c36ff8aa5f1eac6c77 | refs/heads/master | 2022-11-30T18:42:42.077288 | 2020-08-17T05:57:47 | 2020-08-17T05:57:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 385 | java | package com.alipay.api.response;
import com.alipay.api.AlipayResponse;
/**
* ALIPAY API: koubei.retail.wms.outboundwork.delete response.
*
* @author auto create
* @since 1.0, 2019-01-07 20:51:15
*/
public class KoubeiRetailWmsOutboundworkDeleteResponse extends AlipayResponse {
private static final long serialVersionUID = 5363885593635874391L;
}
| [
"[email protected]"
]
| |
9e1d0df5b45a2dc70ada04f684e58bf6b97051bf | 6b54b1ed018685cd5b6affd91ee0b726908bce7f | /src/main/java/com/example/demo/ProdConfig.java | 42196589b5fa80943ec77cd5d0d0ab5a56fbcb3f | []
| no_license | simonpirko/chet | d3fa39d40d7f1a68332da16e7331cb115e706810 | a5c9224fc2b8227e0e9f76b27a61811d135201f3 | refs/heads/master | 2022-05-10T06:10:22.604237 | 2019-10-19T23:29:21 | 2019-10-19T23:29:21 | 215,411,717 | 0 | 0 | null | 2022-03-31T18:55:49 | 2019-10-15T23:01:43 | Java | UTF-8 | Java | false | false | 398 | java | package com.example.demo;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.web.servlet.HandlerInterceptor;
@Configuration
@Profile("prod")
public class ProdConfig implements HandlerInterceptor {
@Bean
public String name() {
return "Andrew";
}
}
| [
"[email protected]"
]
| |
90b5c4d008fedd0e8162f923557a43a754cf8c79 | 56456387c8a2ff1062f34780b471712cc2a49b71 | /com/google/android/gms/maps/internal/IMapViewDelegate$zza$zza.java | 97c882058768af2d53c52bf676dea45ac5f901ab | []
| no_license | nendraharyo/presensimahasiswa-sourcecode | 55d4b8e9f6968eaf71a2ea002e0e7f08d16c5a50 | 890fc86782e9b2b4748bdb9f3db946bfb830b252 | refs/heads/master | 2020-05-21T11:21:55.143420 | 2019-05-10T19:03:56 | 2019-05-10T19:03:56 | 186,022,425 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 14,942 | java | package com.google.android.gms.maps.internal;
import android.os.IBinder;
import android.os.Parcel;
import com.google.android.gms.dynamic.zzd;
import com.google.android.gms.dynamic.zzd.zza;
class IMapViewDelegate$zza$zza
implements IMapViewDelegate
{
private IBinder zzoz;
IMapViewDelegate$zza$zza(IBinder paramIBinder)
{
this.zzoz = paramIBinder;
}
public IBinder asBinder()
{
return this.zzoz;
}
public IGoogleMapDelegate getMap()
{
Parcel localParcel1 = Parcel.obtain();
Parcel localParcel2 = Parcel.obtain();
Object localObject1 = "com.google.android.gms.maps.internal.IMapViewDelegate";
try
{
localParcel1.writeInterfaceToken((String)localObject1);
localObject1 = this.zzoz;
int i = 1;
((IBinder)localObject1).transact(i, localParcel1, localParcel2, 0);
localParcel2.readException();
localObject1 = localParcel2.readStrongBinder();
localObject1 = IGoogleMapDelegate.zza.zzcv((IBinder)localObject1);
return (IGoogleMapDelegate)localObject1;
}
finally
{
localParcel2.recycle();
localParcel1.recycle();
}
}
/* Error */
public void getMapAsync(zzo paramzzo)
{
// Byte code:
// 0: invokestatic 20 android/os/Parcel:obtain ()Landroid/os/Parcel;
// 3: astore_2
// 4: invokestatic 20 android/os/Parcel:obtain ()Landroid/os/Parcel;
// 7: astore_3
// 8: ldc 22
// 10: astore 4
// 12: aload_2
// 13: aload 4
// 15: invokevirtual 26 android/os/Parcel:writeInterfaceToken (Ljava/lang/String;)V
// 18: aload_1
// 19: ifnull +53 -> 72
// 22: aload_1
// 23: invokeinterface 54 1 0
// 28: astore 4
// 30: aload_2
// 31: aload 4
// 33: invokevirtual 58 android/os/Parcel:writeStrongBinder (Landroid/os/IBinder;)V
// 36: aload_0
// 37: getfield 14 com/google/android/gms/maps/internal/IMapViewDelegate$zza$zza:zzoz Landroid/os/IBinder;
// 40: astore 4
// 42: bipush 9
// 44: istore 5
// 46: aload 4
// 48: iload 5
// 50: aload_2
// 51: aload_3
// 52: iconst_0
// 53: invokeinterface 33 5 0
// 58: pop
// 59: aload_3
// 60: invokevirtual 36 android/os/Parcel:readException ()V
// 63: aload_3
// 64: invokevirtual 49 android/os/Parcel:recycle ()V
// 67: aload_2
// 68: invokevirtual 49 android/os/Parcel:recycle ()V
// 71: return
// 72: aconst_null
// 73: astore 4
// 75: goto -45 -> 30
// 78: astore 4
// 80: aload_3
// 81: invokevirtual 49 android/os/Parcel:recycle ()V
// 84: aload_2
// 85: invokevirtual 49 android/os/Parcel:recycle ()V
// 88: aload 4
// 90: athrow
// Local variable table:
// start length slot name signature
// 0 91 0 this zza
// 0 91 1 paramzzo zzo
// 3 82 2 localParcel1 Parcel
// 7 74 3 localParcel2 Parcel
// 10 64 4 localObject1 Object
// 78 11 4 localObject2 Object
// 44 5 5 i int
// Exception table:
// from to target type
// 13 18 78 finally
// 22 28 78 finally
// 31 36 78 finally
// 36 40 78 finally
// 52 59 78 finally
// 59 63 78 finally
}
public zzd getView()
{
Parcel localParcel1 = Parcel.obtain();
Parcel localParcel2 = Parcel.obtain();
Object localObject1 = "com.google.android.gms.maps.internal.IMapViewDelegate";
try
{
localParcel1.writeInterfaceToken((String)localObject1);
localObject1 = this.zzoz;
int i = 8;
((IBinder)localObject1).transact(i, localParcel1, localParcel2, 0);
localParcel2.readException();
localObject1 = localParcel2.readStrongBinder();
localObject1 = zzd.zza.zzbs((IBinder)localObject1);
return (zzd)localObject1;
}
finally
{
localParcel2.recycle();
localParcel1.recycle();
}
}
/* Error */
public void onCreate(android.os.Bundle paramBundle)
{
// Byte code:
// 0: invokestatic 20 android/os/Parcel:obtain ()Landroid/os/Parcel;
// 3: astore_2
// 4: invokestatic 20 android/os/Parcel:obtain ()Landroid/os/Parcel;
// 7: astore_3
// 8: ldc 22
// 10: astore 4
// 12: aload_2
// 13: aload 4
// 15: invokevirtual 26 android/os/Parcel:writeInterfaceToken (Ljava/lang/String;)V
// 18: aload_1
// 19: ifnull +59 -> 78
// 22: iconst_1
// 23: istore 5
// 25: aload_2
// 26: iload 5
// 28: invokevirtual 70 android/os/Parcel:writeInt (I)V
// 31: iconst_0
// 32: istore 5
// 34: aconst_null
// 35: astore 4
// 37: aload_1
// 38: aload_2
// 39: iconst_0
// 40: invokevirtual 76 android/os/Bundle:writeToParcel (Landroid/os/Parcel;I)V
// 43: aload_0
// 44: getfield 14 com/google/android/gms/maps/internal/IMapViewDelegate$zza$zza:zzoz Landroid/os/IBinder;
// 47: astore 4
// 49: iconst_2
// 50: istore 6
// 52: aload 4
// 54: iload 6
// 56: aload_2
// 57: aload_3
// 58: iconst_0
// 59: invokeinterface 33 5 0
// 64: pop
// 65: aload_3
// 66: invokevirtual 36 android/os/Parcel:readException ()V
// 69: aload_3
// 70: invokevirtual 49 android/os/Parcel:recycle ()V
// 73: aload_2
// 74: invokevirtual 49 android/os/Parcel:recycle ()V
// 77: return
// 78: iconst_0
// 79: istore 5
// 81: aconst_null
// 82: astore 4
// 84: aload_2
// 85: iconst_0
// 86: invokevirtual 70 android/os/Parcel:writeInt (I)V
// 89: goto -46 -> 43
// 92: astore 4
// 94: aload_3
// 95: invokevirtual 49 android/os/Parcel:recycle ()V
// 98: aload_2
// 99: invokevirtual 49 android/os/Parcel:recycle ()V
// 102: aload 4
// 104: athrow
// Local variable table:
// start length slot name signature
// 0 105 0 this zza
// 0 105 1 paramBundle android.os.Bundle
// 3 96 2 localParcel1 Parcel
// 7 88 3 localParcel2 Parcel
// 10 73 4 localObject1 Object
// 92 11 4 localObject2 Object
// 23 57 5 i int
// 50 5 6 j int
// Exception table:
// from to target type
// 13 18 92 finally
// 26 31 92 finally
// 39 43 92 finally
// 43 47 92 finally
// 58 65 92 finally
// 65 69 92 finally
// 85 89 92 finally
}
public void onDestroy()
{
Parcel localParcel1 = Parcel.obtain();
Parcel localParcel2 = Parcel.obtain();
Object localObject1 = "com.google.android.gms.maps.internal.IMapViewDelegate";
try
{
localParcel1.writeInterfaceToken((String)localObject1);
localObject1 = this.zzoz;
int i = 5;
((IBinder)localObject1).transact(i, localParcel1, localParcel2, 0);
localParcel2.readException();
return;
}
finally
{
localParcel2.recycle();
localParcel1.recycle();
}
}
/* Error */
public void onEnterAmbient(android.os.Bundle paramBundle)
{
// Byte code:
// 0: invokestatic 20 android/os/Parcel:obtain ()Landroid/os/Parcel;
// 3: astore_2
// 4: invokestatic 20 android/os/Parcel:obtain ()Landroid/os/Parcel;
// 7: astore_3
// 8: ldc 22
// 10: astore 4
// 12: aload_2
// 13: aload 4
// 15: invokevirtual 26 android/os/Parcel:writeInterfaceToken (Ljava/lang/String;)V
// 18: aload_1
// 19: ifnull +60 -> 79
// 22: iconst_1
// 23: istore 5
// 25: aload_2
// 26: iload 5
// 28: invokevirtual 70 android/os/Parcel:writeInt (I)V
// 31: iconst_0
// 32: istore 5
// 34: aconst_null
// 35: astore 4
// 37: aload_1
// 38: aload_2
// 39: iconst_0
// 40: invokevirtual 76 android/os/Bundle:writeToParcel (Landroid/os/Parcel;I)V
// 43: aload_0
// 44: getfield 14 com/google/android/gms/maps/internal/IMapViewDelegate$zza$zza:zzoz Landroid/os/IBinder;
// 47: astore 4
// 49: bipush 10
// 51: istore 6
// 53: aload 4
// 55: iload 6
// 57: aload_2
// 58: aload_3
// 59: iconst_0
// 60: invokeinterface 33 5 0
// 65: pop
// 66: aload_3
// 67: invokevirtual 36 android/os/Parcel:readException ()V
// 70: aload_3
// 71: invokevirtual 49 android/os/Parcel:recycle ()V
// 74: aload_2
// 75: invokevirtual 49 android/os/Parcel:recycle ()V
// 78: return
// 79: iconst_0
// 80: istore 5
// 82: aconst_null
// 83: astore 4
// 85: aload_2
// 86: iconst_0
// 87: invokevirtual 70 android/os/Parcel:writeInt (I)V
// 90: goto -47 -> 43
// 93: astore 4
// 95: aload_3
// 96: invokevirtual 49 android/os/Parcel:recycle ()V
// 99: aload_2
// 100: invokevirtual 49 android/os/Parcel:recycle ()V
// 103: aload 4
// 105: athrow
// Local variable table:
// start length slot name signature
// 0 106 0 this zza
// 0 106 1 paramBundle android.os.Bundle
// 3 97 2 localParcel1 Parcel
// 7 89 3 localParcel2 Parcel
// 10 74 4 localObject1 Object
// 93 11 4 localObject2 Object
// 23 58 5 i int
// 51 5 6 j int
// Exception table:
// from to target type
// 13 18 93 finally
// 26 31 93 finally
// 39 43 93 finally
// 43 47 93 finally
// 59 66 93 finally
// 66 70 93 finally
// 86 90 93 finally
}
public void onExitAmbient()
{
Parcel localParcel1 = Parcel.obtain();
Parcel localParcel2 = Parcel.obtain();
Object localObject1 = "com.google.android.gms.maps.internal.IMapViewDelegate";
try
{
localParcel1.writeInterfaceToken((String)localObject1);
localObject1 = this.zzoz;
int i = 11;
((IBinder)localObject1).transact(i, localParcel1, localParcel2, 0);
localParcel2.readException();
return;
}
finally
{
localParcel2.recycle();
localParcel1.recycle();
}
}
public void onLowMemory()
{
Parcel localParcel1 = Parcel.obtain();
Parcel localParcel2 = Parcel.obtain();
Object localObject1 = "com.google.android.gms.maps.internal.IMapViewDelegate";
try
{
localParcel1.writeInterfaceToken((String)localObject1);
localObject1 = this.zzoz;
int i = 6;
((IBinder)localObject1).transact(i, localParcel1, localParcel2, 0);
localParcel2.readException();
return;
}
finally
{
localParcel2.recycle();
localParcel1.recycle();
}
}
public void onPause()
{
Parcel localParcel1 = Parcel.obtain();
Parcel localParcel2 = Parcel.obtain();
Object localObject1 = "com.google.android.gms.maps.internal.IMapViewDelegate";
try
{
localParcel1.writeInterfaceToken((String)localObject1);
localObject1 = this.zzoz;
int i = 4;
((IBinder)localObject1).transact(i, localParcel1, localParcel2, 0);
localParcel2.readException();
return;
}
finally
{
localParcel2.recycle();
localParcel1.recycle();
}
}
public void onResume()
{
Parcel localParcel1 = Parcel.obtain();
Parcel localParcel2 = Parcel.obtain();
Object localObject1 = "com.google.android.gms.maps.internal.IMapViewDelegate";
try
{
localParcel1.writeInterfaceToken((String)localObject1);
localObject1 = this.zzoz;
int i = 3;
((IBinder)localObject1).transact(i, localParcel1, localParcel2, 0);
localParcel2.readException();
return;
}
finally
{
localParcel2.recycle();
localParcel1.recycle();
}
}
/* Error */
public void onSaveInstanceState(android.os.Bundle paramBundle)
{
// Byte code:
// 0: invokestatic 20 android/os/Parcel:obtain ()Landroid/os/Parcel;
// 3: astore_2
// 4: invokestatic 20 android/os/Parcel:obtain ()Landroid/os/Parcel;
// 7: astore_3
// 8: ldc 22
// 10: astore 4
// 12: aload_2
// 13: aload 4
// 15: invokevirtual 26 android/os/Parcel:writeInterfaceToken (Ljava/lang/String;)V
// 18: aload_1
// 19: ifnull +76 -> 95
// 22: iconst_1
// 23: istore 5
// 25: aload_2
// 26: iload 5
// 28: invokevirtual 70 android/os/Parcel:writeInt (I)V
// 31: iconst_0
// 32: istore 5
// 34: aconst_null
// 35: astore 4
// 37: aload_1
// 38: aload_2
// 39: iconst_0
// 40: invokevirtual 76 android/os/Bundle:writeToParcel (Landroid/os/Parcel;I)V
// 43: aload_0
// 44: getfield 14 com/google/android/gms/maps/internal/IMapViewDelegate$zza$zza:zzoz Landroid/os/IBinder;
// 47: astore 4
// 49: bipush 7
// 51: istore 6
// 53: aload 4
// 55: iload 6
// 57: aload_2
// 58: aload_3
// 59: iconst_0
// 60: invokeinterface 33 5 0
// 65: pop
// 66: aload_3
// 67: invokevirtual 36 android/os/Parcel:readException ()V
// 70: aload_3
// 71: invokevirtual 88 android/os/Parcel:readInt ()I
// 74: istore 5
// 76: iload 5
// 78: ifeq +8 -> 86
// 81: aload_1
// 82: aload_3
// 83: invokevirtual 92 android/os/Bundle:readFromParcel (Landroid/os/Parcel;)V
// 86: aload_3
// 87: invokevirtual 49 android/os/Parcel:recycle ()V
// 90: aload_2
// 91: invokevirtual 49 android/os/Parcel:recycle ()V
// 94: return
// 95: iconst_0
// 96: istore 5
// 98: aconst_null
// 99: astore 4
// 101: aload_2
// 102: iconst_0
// 103: invokevirtual 70 android/os/Parcel:writeInt (I)V
// 106: goto -63 -> 43
// 109: astore 4
// 111: aload_3
// 112: invokevirtual 49 android/os/Parcel:recycle ()V
// 115: aload_2
// 116: invokevirtual 49 android/os/Parcel:recycle ()V
// 119: aload 4
// 121: athrow
// Local variable table:
// start length slot name signature
// 0 122 0 this zza
// 0 122 1 paramBundle android.os.Bundle
// 3 113 2 localParcel1 Parcel
// 7 105 3 localParcel2 Parcel
// 10 90 4 localObject1 Object
// 109 11 4 localObject2 Object
// 23 74 5 i int
// 51 5 6 j int
// Exception table:
// from to target type
// 13 18 109 finally
// 26 31 109 finally
// 39 43 109 finally
// 43 47 109 finally
// 59 66 109 finally
// 66 70 109 finally
// 70 74 109 finally
// 82 86 109 finally
// 102 106 109 finally
}
}
/* Location: C:\Users\haryo\Desktop\enjarify-master\presensi-enjarify.jar!\com\google\android\gms\maps\internal\IMapViewDelegate$zza$zza.class
* Java compiler version: 5 (49.0)
* JD-Core Version: 0.7.1
*/ | [
"[email protected]"
]
| |
294d0ed785bb980d60189fdc4fc7b2588430b75f | 7e0744ef6b063f2f1aa197b3b0993cd0907f6811 | /Factory/src/factorymethod/ChicagoCheesePizza.java | 18b47950d59814d91328b322e7f9359d5ce0cdc6 | [
"Apache-2.0"
]
| permissive | Hugo-Gao/Design-pattern | 200ca478ec0ecdffce0bf4669065b3cf51bab3d2 | 025cf051a6d2ee23eca0429cf5608bbf3ace0e56 | refs/heads/master | 2020-07-11T15:39:48.678232 | 2017-07-16T03:29:48 | 2017-07-16T03:29:48 | 94,273,344 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 588 | java | package factorymethod;
/**
* Created by Administrator on 2017/6/18.
*/
public class ChicagoCheesePizza implements factorymethod.Pizza
{
@Override
public void prepare()
{
System.out.println("ChicagoCheesePizza"+" preparing");
}
@Override
public void bake()
{
System.out.println("ChicagoCheesePizza"+" backing");
}
@Override
public void cut()
{
System.out.println("ChicagoCheesePizza"+" cutting");
}
@Override
public void box()
{
System.out.println("ChicagoCheesePizza"+" boxing");
}
}
| [
"[email protected]"
]
| |
1b5e34c3c9be0b5eff02a04ef45b884daffae837 | 40d738b8807503bf0b5bd480dee255c05cf401bf | /src/main/java/tfg/backend/LopdModel/Incidence.java | 5ff181e1c002a03301df6e4039148f940111c217 | []
| no_license | luisjesuspellicer/dataManagment | f4e2ac0942aeba70e55aea4047cb812d2190c63d | 267760cfca8ddebee9ef994a1c9ab10f88124886 | refs/heads/master | 2021-03-27T19:06:45.075291 | 2016-12-04T18:54:04 | 2016-12-04T18:54:04 | 75,552,899 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,503 | java | /**
* Creator: Luis Jesús Pellicer Magallón
* Year: 2016
* Version: 1.0
* Description: This class represents an incidence into system.
*/
package tfg.backend.LopdModel;
import tfg.backend.DataModel.User;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
@Entity
@Table(name = "Incidence")
public class Incidence implements Serializable{
@Column(name = "id")
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
Long id;
@Column(name = "typeIncidence")
private String typeIncidence;
@Column(name = "date")
private Date date;
@ManyToOne
private User user;
@Column(name = "efectsAndProcedures")
private String efectsAndProcedures;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getTypeIncidence() {
return typeIncidence;
}
public void setTypeIncidence(String typeIncidence) {
this.typeIncidence = typeIncidence;
}
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
public String getEfectsAndProcedures() {
return efectsAndProcedures;
}
public void setEfectsAndProcedures(String efectsAndProcedures) {
this.efectsAndProcedures = efectsAndProcedures;
}
}
| [
"[email protected]"
]
| |
b24b7b4da1110a89f8dd15d8cd5d52e258daf80b | bd281a8f67851c30287937f29f2ecaea8ebdb3db | /jbossas-remote-6/src/main/java/org/jboss/arquillian/container/jbossas/remote_6/ShrinkWrapUtil.java | bb65db97ca65ff7f41a15bc9357f5fc8c8ba6e95 | []
| no_license | DavideD/arquillian-container-jbossas | b36d6480a79a155222040d2a9f5b8e99aefaf1b6 | dc49b188ef944c6c8aabe39b35d66cf4c23ef955 | refs/heads/master | 2021-01-16T21:45:48.989994 | 2011-06-26T18:04:08 | 2011-06-26T18:04:08 | 1,722,203 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,071 | java | /*
* JBoss, Home of Professional Open Source
* Copyright 2011 Red Hat Inc. and/or its affiliates and other contributors
* as indicated by the @authors tag. All rights reserved.
* See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* 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.jboss.arquillian.container.jbossas.remote_6;
import java.io.File;
import java.io.FileOutputStream;
import java.net.URL;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.exporter.ZipExporter;
import org.jboss.shrinkwrap.descriptor.api.Descriptor;
/**
* ShrinkWrapUtil
*
* @author <a href="mailto:[email protected]">Aslak Knutsen</a>
* @version $Revision: $
*/
final class ShrinkWrapUtil
{
private ShrinkWrapUtil() { }
/**
* Creates a tmp folder and exports the file. Returns the URL for that file location.
*
* @param archive Archive to export
* @return
*/
public static URL toURL(final Archive<?> archive)
{
// create a random named temp file, then delete and use it as a directory
try
{
File root = File.createTempFile("arquillian", archive.getName());
root.delete();
root.mkdirs();
File deployment = new File(root, archive.getName());
deployment.deleteOnExit();
archive.as(ZipExporter.class).exportTo(deployment, true);
return deployment.toURI().toURL();
}
catch (Exception e)
{
throw new RuntimeException("Could not export deployment to temp", e);
}
}
public static URL toURL(final Descriptor descriptor)
{
// create a random named temp file, then delete and use it as a directory
try
{
File root = File.createTempFile("arquillian", descriptor.getDescriptorName());
root.delete();
root.mkdirs();
File deployment = new File(root, descriptor.getDescriptorName());
deployment.deleteOnExit();
FileOutputStream stream = new FileOutputStream(deployment);
try
{
descriptor.exportTo(stream);
}
finally
{
try
{
stream.close();
}
catch (Exception e)
{
throw new RuntimeException(e);
}
}
return deployment.toURI().toURL();
}
catch (Exception e)
{
throw new RuntimeException("Could not export deployment to temp", e);
}
}
}
| [
"[email protected]"
]
| |
450ac7e84d2df138a5e80f7e24c1f8d63ca03fa8 | c885ef92397be9d54b87741f01557f61d3f794f3 | /tests-without-trycatch/Time-5/org.joda.time.Period/BBC-F0-opt-70/23/org/joda/time/Period_ESTest_scaffolding.java | 2807ff045bdb951baa169ca047475e360b6344e9 | [
"CC-BY-4.0",
"MIT"
]
| permissive | pderakhshanfar/EMSE-BBC-experiment | f60ac5f7664dd9a85f755a00a57ec12c7551e8c6 | fea1a92c2e7ba7080b8529e2052259c9b697bbda | refs/heads/main | 2022-11-25T00:39:58.983828 | 2022-04-12T16:04:26 | 2022-04-12T16:04:26 | 309,335,889 | 0 | 1 | null | 2021-11-05T11:18:43 | 2020-11-02T10:30:38 | null | UTF-8 | Java | false | false | 22,555 | java | /**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Sun Oct 24 03:39:04 GMT 2021
*/
package org.joda.time;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
import org.junit.AfterClass;
import org.evosuite.runtime.sandbox.Sandbox;
import org.evosuite.runtime.sandbox.Sandbox.SandboxMode;
import static org.evosuite.shaded.org.mockito.Mockito.*;
@EvoSuiteClassExclude
public class Period_ESTest_scaffolding {
@org.junit.Rule
public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule();
private static final java.util.Properties defaultProperties = (java.util.Properties) java.lang.System.getProperties().clone();
private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000);
@BeforeClass
public static void initEvoSuiteFramework() {
org.evosuite.runtime.RuntimeSettings.className = "org.joda.time.Period";
org.evosuite.runtime.GuiSupport.initialize();
org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100;
org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000;
org.evosuite.runtime.RuntimeSettings.mockSystemIn = true;
org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED;
org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT();
org.evosuite.runtime.classhandling.JDKClassResetter.init();
setSystemProperties();
initializeClasses();
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
try { initMocksToAvoidTimeoutsInTheTests(); } catch(ClassNotFoundException e) {}
}
@AfterClass
public static void clearEvoSuiteFramework(){
Sandbox.resetDefaultSecurityManager();
java.lang.System.setProperties((java.util.Properties) defaultProperties.clone());
}
@Before
public void initTestCase(){
threadStopper.storeCurrentThreads();
threadStopper.startRecordingTime();
org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler();
org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode();
setSystemProperties();
org.evosuite.runtime.GuiSupport.setHeadless();
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
org.evosuite.runtime.agent.InstrumentingAgent.activate();
}
@After
public void doneWithTestCase(){
threadStopper.killAndJoinClientThreads();
org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks();
org.evosuite.runtime.classhandling.JDKClassResetter.reset();
resetClasses();
org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode();
org.evosuite.runtime.agent.InstrumentingAgent.deactivate();
org.evosuite.runtime.GuiSupport.restoreHeadlessMode();
}
public static void setSystemProperties() {
java.lang.System.setProperties((java.util.Properties) defaultProperties.clone());
java.lang.System.setProperty("user.timezone", "Etc/UTC");
}
private static void initializeClasses() {
org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(Period_ESTest_scaffolding.class.getClassLoader() ,
"org.joda.time.DateTimeZone",
"org.joda.time.field.AbstractPartialFieldProperty",
"org.joda.time.field.StrictDateTimeField",
"org.joda.time.convert.ConverterSet$Entry",
"org.joda.time.DateTimeFieldType$StandardDateTimeFieldType",
"org.joda.time.chrono.BasicChronology$HalfdayField",
"org.joda.time.chrono.BasicChronology$YearInfo",
"org.joda.time.LocalDate$Property",
"org.joda.time.field.UnsupportedDurationField",
"org.joda.time.ReadWritableInterval",
"org.joda.time.format.PeriodFormatterBuilder",
"org.joda.time.format.DateTimePrinter",
"org.joda.time.chrono.ISOChronology",
"org.joda.time.base.BaseLocal",
"org.joda.time.format.PeriodFormatterBuilder$FieldFormatter",
"org.joda.time.field.DividedDateTimeField",
"org.joda.time.convert.DateConverter",
"org.joda.time.chrono.ZonedChronology",
"org.joda.time.format.DateTimeFormatterBuilder$TimeZoneOffset",
"org.joda.time.field.BaseDateTimeField",
"org.joda.time.field.ZeroIsMaxDateTimeField",
"org.joda.time.base.BaseInterval",
"org.joda.time.Duration",
"org.joda.time.format.FormatUtils",
"org.joda.time.format.PeriodFormatter",
"org.joda.time.Interval",
"org.joda.time.convert.LongConverter",
"org.joda.time.base.AbstractInstant",
"org.joda.time.tz.DateTimeZoneBuilder",
"org.joda.time.ReadWritablePeriod",
"org.joda.time.convert.ConverterSet",
"org.joda.time.LocalDateTime",
"org.joda.time.base.BasePeriod$1",
"org.joda.time.tz.FixedDateTimeZone",
"org.joda.time.format.PeriodPrinter",
"org.joda.time.convert.IntervalConverter",
"org.joda.time.field.PreciseDateTimeField",
"org.joda.time.chrono.LimitChronology$LimitException",
"org.joda.time.convert.ReadableDurationConverter",
"org.joda.time.base.BaseDuration",
"org.joda.time.field.DecoratedDateTimeField",
"org.joda.time.Months",
"org.joda.time.YearMonthDay",
"org.joda.time.format.DateTimeParser",
"org.joda.time.format.DateTimeFormatterBuilder$CharacterLiteral",
"org.joda.time.YearMonth",
"org.joda.time.chrono.GJChronology$CutoverField",
"org.joda.time.LocalTime$Property",
"org.joda.time.field.OffsetDateTimeField",
"org.joda.time.DateTime$Property",
"org.joda.time.convert.ReadablePeriodConverter",
"org.joda.time.Years",
"org.joda.time.convert.ReadableIntervalConverter",
"org.joda.time.DateTimeField",
"org.joda.time.field.FieldUtils",
"org.joda.time.Partial",
"org.joda.time.format.ISODateTimeFormat",
"org.joda.time.field.SkipDateTimeField",
"org.joda.time.base.AbstractPeriod",
"org.joda.time.DateTimeUtils$SystemMillisProvider",
"org.joda.time.chrono.GJDayOfWeekDateTimeField",
"org.joda.time.IllegalInstantException",
"org.joda.time.IllegalFieldValueException",
"org.joda.time.format.DateTimeFormatterBuilder$Composite",
"org.joda.time.format.DateTimeFormatterBuilder$UnpaddedNumber",
"org.joda.time.field.ImpreciseDateTimeField$LinkedDurationField",
"org.joda.time.ReadablePeriod",
"org.joda.time.chrono.ZonedChronology$ZonedDateTimeField",
"org.joda.time.chrono.GregorianChronology",
"org.joda.time.convert.ConverterManager",
"org.joda.time.chrono.GJChronology$LinkedDurationField",
"org.joda.time.Minutes",
"org.joda.time.format.DateTimeFormatterBuilder$PaddedNumber",
"org.joda.time.chrono.BasicMonthOfYearDateTimeField",
"org.joda.time.base.AbstractPartial",
"org.joda.time.base.BasePartial",
"org.joda.time.DateTimeUtils",
"org.joda.time.base.AbstractDuration",
"org.joda.time.base.BaseDateTime",
"org.joda.time.base.AbstractInterval",
"org.joda.time.Hours",
"org.joda.time.LocalTime",
"org.joda.time.base.BasePeriod",
"org.joda.time.field.DecoratedDurationField",
"org.joda.time.tz.DateTimeZoneBuilder$DSTZone",
"org.joda.time.format.DateTimeFormat$1",
"org.joda.time.TimeOfDay",
"org.joda.time.format.ISOPeriodFormat",
"org.joda.time.Partial$Property",
"org.joda.time.field.ImpreciseDateTimeField",
"org.joda.time.chrono.CopticChronology",
"org.joda.time.field.PreciseDurationField",
"org.joda.time.tz.DateTimeZoneBuilder$OfYear",
"org.joda.time.ReadableDuration",
"org.joda.time.chrono.BasicGJChronology",
"org.joda.time.format.DateTimeFormatterBuilder$NumberFormatter",
"org.joda.time.DurationField",
"org.joda.time.format.DateTimeFormatter",
"org.joda.time.chrono.IslamicChronology$LeapYearPatternType",
"org.joda.time.DateTime",
"org.joda.time.format.PeriodFormatterBuilder$SimpleAffix",
"org.joda.time.ReadWritableDateTime",
"org.joda.time.convert.PeriodConverter",
"org.joda.time.chrono.ZonedChronology$ZonedDurationField",
"org.joda.time.Instant",
"org.joda.time.format.PeriodFormatterBuilder$Separator",
"org.joda.time.convert.CalendarConverter",
"org.joda.time.chrono.LimitChronology$LimitDurationField",
"org.joda.time.DurationFieldType$StandardDurationFieldType",
"org.joda.time.chrono.BasicDayOfYearDateTimeField",
"org.joda.time.chrono.BuddhistChronology",
"org.joda.time.format.DateTimeFormatterBuilder$StringLiteral",
"org.joda.time.tz.DateTimeZoneBuilder$Recurrence",
"org.joda.time.format.ISODateTimeFormat$Constants",
"org.joda.time.convert.ReadablePartialConverter",
"org.joda.time.DateTimeUtils$MillisProvider",
"org.joda.time.convert.Converter",
"org.joda.time.chrono.GJYearOfEraDateTimeField",
"org.joda.time.convert.PartialConverter",
"org.joda.time.Seconds",
"org.joda.time.field.RemainderDateTimeField",
"org.joda.time.JodaTimePermission",
"org.joda.time.chrono.BasicWeekOfWeekyearDateTimeField",
"org.joda.time.DateTimeFieldType",
"org.joda.time.format.DateTimeFormatterBuilder$Fraction",
"org.joda.time.format.DateTimeFormatterBuilder$FixedNumber",
"org.joda.time.MutableDateTime$Property",
"org.joda.time.ReadableInterval",
"org.joda.time.chrono.LimitChronology$LimitDateTimeField",
"org.joda.time.tz.DateTimeZoneBuilder$PrecalculatedZone",
"org.joda.time.field.LenientDateTimeField",
"org.joda.time.base.AbstractDateTime",
"org.joda.time.field.SkipUndoDateTimeField",
"org.joda.time.convert.AbstractConverter",
"org.joda.time.field.DelegatedDateTimeField",
"org.joda.time.chrono.BasicChronology",
"org.joda.time.chrono.BasicYearDateTimeField",
"org.joda.time.format.DateTimeFormatterBuilder",
"org.joda.time.tz.CachedDateTimeZone$Info",
"org.joda.time.chrono.EthiopicChronology",
"org.joda.time.PeriodType",
"org.joda.time.field.MillisDurationField",
"org.joda.time.chrono.GJChronology",
"org.joda.time.chrono.IslamicChronology",
"org.joda.time.LocalDateTime$Property",
"org.joda.time.chrono.BasicFixedMonthChronology",
"org.joda.time.field.UnsupportedDateTimeField",
"org.joda.time.field.ScaledDurationField",
"org.joda.time.chrono.ISOYearOfEraDateTimeField",
"org.joda.time.field.PreciseDurationDateTimeField",
"org.joda.time.MonthDay",
"org.joda.time.MutablePeriod",
"org.joda.time.MutableDateTime",
"org.joda.time.tz.CachedDateTimeZone",
"org.joda.time.ReadableDateTime",
"org.joda.time.format.PeriodFormatterBuilder$Literal",
"org.joda.time.format.PeriodParser",
"org.joda.time.DateMidnight",
"org.joda.time.convert.DurationConverter",
"org.joda.time.chrono.GJMonthOfYearDateTimeField",
"org.joda.time.chrono.BasicWeekyearDateTimeField",
"org.joda.time.Days",
"org.joda.time.format.DateTimeFormatterBuilder$MatchingParser",
"org.joda.time.chrono.BasicSingleEraDateTimeField",
"org.joda.time.format.DateTimeFormat",
"org.joda.time.YearMonth$Property",
"org.joda.time.chrono.LimitChronology",
"org.joda.time.ReadableInstant",
"org.joda.time.base.BaseSingleFieldPeriod",
"org.joda.time.convert.NullConverter",
"org.joda.time.tz.DefaultNameProvider",
"org.joda.time.tz.Provider",
"org.joda.time.chrono.AssembledChronology$Fields",
"org.joda.time.DurationFieldType",
"org.joda.time.MutableInterval",
"org.joda.time.ReadWritableInstant",
"org.joda.time.tz.NameProvider",
"org.joda.time.convert.ReadableInstantConverter",
"org.joda.time.convert.StringConverter",
"org.joda.time.convert.InstantConverter",
"org.joda.time.chrono.AssembledChronology",
"org.joda.time.chrono.StrictChronology",
"org.joda.time.tz.ZoneInfoProvider",
"org.joda.time.chrono.GJEraDateTimeField",
"org.joda.time.DateTimeZone$1",
"org.joda.time.chrono.BaseChronology",
"org.joda.time.chrono.JulianChronology",
"org.joda.time.Period",
"org.joda.time.Weeks",
"org.joda.time.Chronology",
"org.joda.time.format.PeriodFormatterBuilder$Composite",
"org.joda.time.field.AbstractReadableInstantFieldProperty",
"org.joda.time.format.PeriodFormatterBuilder$PeriodFieldAffix",
"org.joda.time.LocalDate",
"org.joda.time.chrono.BasicDayOfMonthDateTimeField",
"org.joda.time.MonthDay$Property",
"org.joda.time.ReadablePartial",
"org.joda.time.chrono.GJChronology$ImpreciseCutoverField",
"org.joda.time.field.BaseDurationField"
);
}
private static void initMocksToAvoidTimeoutsInTheTests() throws ClassNotFoundException {
mock(Class.forName("org.joda.time.format.PeriodParser", false, Period_ESTest_scaffolding.class.getClassLoader()));
mock(Class.forName("org.joda.time.format.PeriodPrinter", false, Period_ESTest_scaffolding.class.getClassLoader()));
}
private static void resetClasses() {
org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(Period_ESTest_scaffolding.class.getClassLoader());
org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(
"org.joda.time.base.AbstractPeriod",
"org.joda.time.base.BasePeriod$1",
"org.joda.time.base.BasePeriod",
"org.joda.time.DateTimeUtils$SystemMillisProvider",
"org.joda.time.tz.FixedDateTimeZone",
"org.joda.time.tz.ZoneInfoProvider",
"org.joda.time.tz.DefaultNameProvider",
"org.joda.time.DateTimeZone",
"org.joda.time.tz.DateTimeZoneBuilder",
"org.joda.time.tz.DateTimeZoneBuilder$PrecalculatedZone",
"org.joda.time.tz.DateTimeZoneBuilder$DSTZone",
"org.joda.time.tz.DateTimeZoneBuilder$Recurrence",
"org.joda.time.tz.DateTimeZoneBuilder$OfYear",
"org.joda.time.tz.CachedDateTimeZone",
"org.joda.time.DateTimeUtils",
"org.joda.time.PeriodType",
"org.joda.time.DurationFieldType$StandardDurationFieldType",
"org.joda.time.DurationFieldType",
"org.joda.time.Chronology",
"org.joda.time.chrono.BaseChronology",
"org.joda.time.chrono.AssembledChronology",
"org.joda.time.DurationField",
"org.joda.time.field.MillisDurationField",
"org.joda.time.field.BaseDurationField",
"org.joda.time.field.PreciseDurationField",
"org.joda.time.DateTimeField",
"org.joda.time.field.BaseDateTimeField",
"org.joda.time.field.PreciseDurationDateTimeField",
"org.joda.time.field.PreciseDateTimeField",
"org.joda.time.DateTimeFieldType$StandardDateTimeFieldType",
"org.joda.time.DateTimeFieldType",
"org.joda.time.field.DecoratedDateTimeField",
"org.joda.time.field.ZeroIsMaxDateTimeField",
"org.joda.time.chrono.BasicChronology$HalfdayField",
"org.joda.time.chrono.BasicChronology",
"org.joda.time.chrono.BasicGJChronology",
"org.joda.time.chrono.AssembledChronology$Fields",
"org.joda.time.field.ImpreciseDateTimeField",
"org.joda.time.chrono.BasicYearDateTimeField",
"org.joda.time.field.ImpreciseDateTimeField$LinkedDurationField",
"org.joda.time.chrono.GJYearOfEraDateTimeField",
"org.joda.time.field.OffsetDateTimeField",
"org.joda.time.field.DividedDateTimeField",
"org.joda.time.field.DecoratedDurationField",
"org.joda.time.field.ScaledDurationField",
"org.joda.time.field.RemainderDateTimeField",
"org.joda.time.chrono.GJEraDateTimeField",
"org.joda.time.chrono.GJDayOfWeekDateTimeField",
"org.joda.time.chrono.BasicDayOfMonthDateTimeField",
"org.joda.time.chrono.BasicDayOfYearDateTimeField",
"org.joda.time.chrono.BasicMonthOfYearDateTimeField",
"org.joda.time.chrono.GJMonthOfYearDateTimeField",
"org.joda.time.chrono.BasicWeekyearDateTimeField",
"org.joda.time.chrono.BasicWeekOfWeekyearDateTimeField",
"org.joda.time.field.UnsupportedDurationField",
"org.joda.time.chrono.GregorianChronology",
"org.joda.time.chrono.ISOYearOfEraDateTimeField",
"org.joda.time.chrono.ISOChronology",
"org.joda.time.chrono.ZonedChronology",
"org.joda.time.chrono.ZonedChronology$ZonedDurationField",
"org.joda.time.chrono.ZonedChronology$ZonedDateTimeField",
"org.joda.time.Period",
"org.joda.time.format.ISOPeriodFormat",
"org.joda.time.format.FormatUtils",
"org.joda.time.base.BaseSingleFieldPeriod",
"org.joda.time.format.PeriodFormatterBuilder",
"org.joda.time.format.PeriodFormatterBuilder$Literal",
"org.joda.time.format.PeriodFormatterBuilder$FieldFormatter",
"org.joda.time.format.PeriodFormatterBuilder$SimpleAffix",
"org.joda.time.format.PeriodFormatterBuilder$Composite",
"org.joda.time.format.PeriodFormatterBuilder$Separator",
"org.joda.time.format.PeriodFormatter",
"org.joda.time.Weeks",
"org.joda.time.Days",
"org.joda.time.Hours",
"org.joda.time.Minutes",
"org.joda.time.Seconds",
"org.joda.time.field.FieldUtils",
"org.joda.time.base.AbstractPartial",
"org.joda.time.base.BaseLocal",
"org.joda.time.LocalDateTime",
"org.joda.time.IllegalFieldValueException",
"org.joda.time.chrono.BasicSingleEraDateTimeField",
"org.joda.time.base.AbstractInstant",
"org.joda.time.Instant",
"org.joda.time.chrono.GJChronology",
"org.joda.time.field.DelegatedDateTimeField",
"org.joda.time.field.SkipDateTimeField",
"org.joda.time.chrono.JulianChronology",
"org.joda.time.chrono.BasicChronology$YearInfo",
"org.joda.time.chrono.GJChronology$CutoverField",
"org.joda.time.chrono.GJChronology$ImpreciseCutoverField",
"org.joda.time.chrono.GJChronology$LinkedDurationField",
"org.joda.time.field.SkipUndoDateTimeField",
"org.joda.time.base.AbstractDateTime",
"org.joda.time.base.BaseDateTime",
"org.joda.time.DateTime",
"org.joda.time.chrono.LimitChronology",
"org.joda.time.chrono.LimitChronology$LimitDurationField",
"org.joda.time.chrono.LimitChronology$LimitDateTimeField",
"org.joda.time.chrono.BuddhistChronology",
"org.joda.time.MutablePeriod",
"org.joda.time.base.AbstractDuration",
"org.joda.time.base.BaseDuration",
"org.joda.time.Duration",
"org.joda.time.chrono.IslamicChronology$LeapYearPatternType",
"org.joda.time.chrono.IslamicChronology",
"org.joda.time.convert.ConverterManager",
"org.joda.time.convert.ConverterSet",
"org.joda.time.convert.AbstractConverter",
"org.joda.time.convert.ReadableInstantConverter",
"org.joda.time.convert.StringConverter",
"org.joda.time.convert.CalendarConverter",
"org.joda.time.convert.DateConverter",
"org.joda.time.convert.LongConverter",
"org.joda.time.convert.NullConverter",
"org.joda.time.convert.ReadablePartialConverter",
"org.joda.time.convert.ReadableDurationConverter",
"org.joda.time.convert.ReadableIntervalConverter",
"org.joda.time.convert.ReadablePeriodConverter",
"org.joda.time.convert.ConverterSet$Entry",
"org.joda.time.base.BasePartial",
"org.joda.time.YearMonth",
"org.joda.time.MutableDateTime",
"org.joda.time.format.DateTimeFormatterBuilder",
"org.joda.time.format.ISODateTimeFormat",
"org.joda.time.format.DateTimeFormatterBuilder$NumberFormatter",
"org.joda.time.format.DateTimeFormatterBuilder$PaddedNumber",
"org.joda.time.format.DateTimeFormatter",
"org.joda.time.format.DateTimeFormatterBuilder$CharacterLiteral",
"org.joda.time.format.DateTimeFormatterBuilder$Composite",
"org.joda.time.format.DateTimeFormatterBuilder$StringLiteral",
"org.joda.time.format.DateTimeFormatterBuilder$UnpaddedNumber",
"org.joda.time.format.DateTimeFormatterBuilder$Fraction",
"org.joda.time.format.DateTimeFormatterBuilder$TimeZoneOffset",
"org.joda.time.format.DateTimeFormatterBuilder$FixedNumber",
"org.joda.time.format.DateTimeFormatterBuilder$MatchingParser",
"org.joda.time.format.ISODateTimeFormat$Constants",
"org.joda.time.format.DateTimeFormat$1",
"org.joda.time.format.DateTimeFormat",
"org.joda.time.MonthDay",
"org.joda.time.LocalDate",
"org.joda.time.chrono.StrictChronology",
"org.joda.time.field.StrictDateTimeField",
"org.joda.time.chrono.BasicFixedMonthChronology",
"org.joda.time.chrono.EthiopicChronology",
"org.joda.time.base.AbstractInterval",
"org.joda.time.base.BaseInterval",
"org.joda.time.Interval",
"org.joda.time.format.DateTimeParserBucket",
"org.joda.time.format.DateTimeParserBucket$SavedState",
"org.joda.time.LocalTime",
"org.joda.time.chrono.CopticChronology",
"org.joda.time.MutableInterval",
"org.joda.time.tz.UTCProvider",
"org.joda.time.Years",
"org.joda.time.field.AbstractPartialFieldProperty",
"org.joda.time.YearMonth$Property",
"org.joda.time.Partial",
"org.joda.time.Months",
"org.joda.time.chrono.LenientChronology",
"org.joda.time.field.LenientDateTimeField",
"org.joda.time.chrono.LimitChronology$LimitException",
"org.joda.time.MonthDay$Property",
"org.joda.time.field.AbstractReadableInstantFieldProperty",
"org.joda.time.LocalDateTime$Property",
"org.joda.time.field.UnsupportedDateTimeField",
"org.joda.time.format.DateTimeParserBucket$SavedField",
"org.joda.time.LocalTime$Property",
"org.joda.time.MutableDateTime$Property",
"org.joda.time.format.DateTimeFormatterBuilder$TextField",
"org.joda.time.DateTimeZone$1",
"org.joda.time.DateTime$Property",
"org.joda.time.DateTimeZone$Stub",
"org.joda.time.LocalDate$Property",
"org.joda.time.format.DateTimeFormatterBuilder$TimeZoneName",
"org.joda.time.Partial$Property",
"org.joda.time.tz.CachedDateTimeZone$Info",
"org.joda.time.format.DateTimeFormatterBuilder$TwoDigitYear"
);
}
}
| [
"[email protected]"
]
| |
97360e941cff9b1bf728e4e49752320c0967c986 | 25a5e9065aa86dad15edd32b354572bccff0f0e0 | /spring-in-5-steps/src/main/java/com/arshad/spring/basics/springin5steps/basic/QuickSortAlgorithm.java | b7734b2d6601b33ff6479325612dabba48242a4e | []
| no_license | 46353658/Spring_Framework_Master_Class | 5aceb23df54bdf117d7924a9fd65194b4c2cb2f2 | b6e2f7fa7f29f0329b176ab0c36cae70b0e3b296 | refs/heads/master | 2020-05-14T00:32:34.780123 | 2019-05-07T12:47:36 | 2019-05-07T12:47:36 | 181,679,864 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 344 | java | package com.arshad.spring.basics.springin5steps.basic;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;
@Component
@Qualifier("quick")
public class QuickSortAlgorithm implements SortAlgorithm {
public int[] sort(int[] numbers) {
// Logic for Quick Sort
return numbers;
}
}
| [
"[email protected]"
]
| |
f60dc4539a0bdd9aa640a2e2238544d135a6b004 | c65750d37074d5c764633bd750872d8ef4913028 | /src/main/java/com/mynetgear/ccvf3/test/TestDaoImp.java | f513674a6702545463b98a72e0471d50069167b9 | []
| no_license | ccvf2/particle | 72d74990fbb98ffbdf36b5cc0c62dcbc76e45303 | 7e1d292e2fe3e6d54b178aceef4f72dc19163d07 | refs/heads/master | 2020-05-30T18:47:10.052874 | 2016-08-26T06:24:52 | 2016-08-26T06:24:52 | 63,306,093 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 117 | java | package com.mynetgear.ccvf3.test;
import java.util.List;
public interface TestDaoImp {
List<TestDTO> getTest();
}
| [
"[email protected]"
]
| |
3c74ce8abe47668825da6d3f40e14408b729671e | 596daefd4fe55e504c89ee9238661db0013f9892 | /src/main/java/com/sciaps/common/swing/events/InstrumentStatusEvent.java | 7bba72e655fa2e5c692b9b6a406c84721cf19173 | []
| no_license | dschroedter/SwingCommon | f3972cd27af1be75e29b22310b69f021780f122b | cc2c62f19fb9ecfc85d2a1daeda669ab1147aae3 | refs/heads/master | 2020-03-17T14:34:42.081123 | 2016-01-13T22:20:47 | 2016-01-13T22:20:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 744 | java | package com.sciaps.common.swing.events;
public class InstrumentStatusEvent {
public static final int UNSUPPORTED_FEATURE = -100;
public static final int UNKNOWN = -1;
public static final int TRUE_VALUE = 0;
public static final int FALSE_VALUE = 1;
public boolean mConnected = false;
public int mInstrumentVersionCode = 0;
public int mWLCalibrationCode = FALSE_VALUE;
public float mArgonPSILevel = -1;
public InstrumentStatusEvent(boolean isConnected, int instrumentVersion, int wlCalibrationCode, float argonPSILevel) {
mConnected = isConnected;
mInstrumentVersionCode = instrumentVersion;
mWLCalibrationCode = wlCalibrationCode;
mArgonPSILevel = argonPSILevel;
}
}
| [
"[email protected]"
]
| |
90aa041dc1fffa5f2f4f60633f14d4e88562be9e | 64f6b54df29d67b13d7984037ac5f403f8b2bb77 | /SSMS/epms-mianzhu-android/Sampling/app/src/main/java/com/xiangxun/sampling/ui/main/SamplingExceptionActivity.java | 8c1a72d7acc996b2c7c25261f0552f4642fe33b7 | []
| no_license | Darlyyuhui/history | 3e8f3f576180811f0aca1a7576106baaa47ff097 | 6338dc4e9514038b65f12a8f174e49d41ecb71b6 | refs/heads/master | 2021-01-22T21:17:43.422744 | 2017-10-10T02:52:02 | 2017-10-10T02:52:02 | 100,677,394 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,672 | java | package com.xiangxun.sampling.ui.main;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import com.xiangxun.sampling.R;
import com.xiangxun.sampling.base.BaseActivity;
import com.xiangxun.sampling.bean.SamplingPlanning;
import com.xiangxun.sampling.binder.ContentBinder;
import com.xiangxun.sampling.binder.ViewsBinder;
import com.xiangxun.sampling.common.dlog.DLog;
import com.xiangxun.sampling.ui.adapter.StickyAdapter;
import com.xiangxun.sampling.widget.header.TitleView;
import java.util.List;
import se.emilsjolander.stickylistheaders.StickyListHeadersListView;
/**
* Created by Zhangyuhui/Darly on 2017/7/6.
* Copyright by [Zhangyuhui/Darly]
* ©2017 XunXiang.Company. All rights reserved.
*
* @TODO:地块异常查询各个功能
*/
@ContentBinder(R.layout.activity_sampling_exception)
public class SamplingExceptionActivity extends BaseActivity {
@ViewsBinder(R.id.id_planning_title)
private TitleView titleView;
@ViewsBinder(R.id.id_planning_wlist)
private StickyListHeadersListView wlist;
@ViewsBinder(R.id.id_planning_text)
private TextView textView;
private List<SamplingPlanning> data;
private StickyAdapter adapter;
@Override
protected void initView(Bundle savedInstanceState) {
titleView.setTitle("地块异常上报");
}
@Override
protected void loadData() {
}
@Override
protected void initListener() {
titleView.setLeftBackOneListener(R.mipmap.ic_back_title, new View.OnClickListener() {
@Override
public void onClick(View arg0) {
onBackPressed();
}
});
}
}
| [
"[email protected]"
]
| |
d132d9a3e7411775e9f86d420eb81cae1e87edfa | bb8c8dc00dd3e039ad89eee02599220b915a0e09 | /src/main/java/com/mingdi/kafka/service/ConsumerService.java | 0e7ea9d33ae8cfd48ba03770295b25bb40bb3f6a | []
| no_license | zmingdi/kafka-demo | 28248f69f9ab24a477657eefde644ee2c0c1b193 | 3c3e9d9b32c5d5d26a490992ca7cc4bfb4f24617 | refs/heads/master | 2022-11-17T20:23:49.782579 | 2020-07-18T08:00:34 | 2020-07-18T08:00:34 | 280,607,879 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 528 | java | package com.mingdi.kafka.service;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Service;
import com.mingdi.kafka.constants.Constants;
import lombok.extern.slf4j.Slf4j;
@Service
@Slf4j
public class ConsumerService {
@KafkaListener(topics = Constants.TOPIC_TEST)
public void listener(ConsumerRecord<String, String> record) {
String value = record.value();
log.info("[receive]:{}", value);
}
}
| [
"[email protected]"
]
| |
4b6aa81fc0e92e36a020f7176d4f42995823890d | 4297a39c8a8bdc5933b7766bc2ef2fafb9ec493f | /y_project-RuoYi-master/RuoYi/ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java | 69e4c69a6057d96f496a2c03f19e6d87f5accc1f | [
"MIT",
"Apache-2.0"
]
| permissive | Liangchengdeye/NewsApplet | 5f3c1350665bbb49cc77f52ad7ca3df6ac65d2f0 | 0d64256fa41d9d77c9e35133459358c72853bd4d | refs/heads/main | 2023-06-25T18:18:01.335128 | 2021-07-20T02:46:59 | 2021-07-20T02:46:59 | 387,629,586 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,352 | java | package com.ruoyi.web.core.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.ruoyi.common.config.RuoYiConfig;
import io.swagger.annotations.ApiOperation;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
/**
* Swagger2的接口配置
*
* @author ruoyi
*/
@Configuration
public class SwaggerConfig
{
/** 是否开启swagger */
@Value("${swagger.enabled}")
private boolean enabled;
/**
* 创建API
*/
@Bean
public Docket createRestApi()
{
return new Docket(DocumentationType.OAS_30)
// 是否启用Swagger
.enable(enabled)
// 用来创建该API的基本信息,展示在文档的页面中(自定义展示的信息)
.apiInfo(apiInfo())
// 设置哪些接口暴露给Swagger展示
.select()
// 扫描所有有注解的api,用这种方式更灵活
.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
// 扫描指定包中的swagger注解
//.apis(RequestHandlerSelectors.basePackage("com.ruoyi.project.tool.swagger"))
// 扫描所有 .apis(RequestHandlerSelectors.any())
.paths(PathSelectors.any())
.build();
}
/**
* 添加摘要信息
*/
private ApiInfo apiInfo()
{
// 用ApiInfoBuilder进行定制
return new ApiInfoBuilder()
// 设置标题
.title("后台管理系统_接口文档")
// 描述
.description("描述:管理后台管理接口文档")
// 作者信息
.contact(new Contact(RuoYiConfig.getName(), null, null))
// 版本
.version("版本号:" + RuoYiConfig.getVersion())
.build();
}
}
| [
"[email protected]"
]
| |
0c4cc4f78b28c3319ccba7916df21ca427988190 | 00098c5be303fccd8c26d2dfa336c0bb7481d6bc | /src/InvalidCharException.java | 5ee6b9db1bca80dc92b8a032c4b50122e5175ba3 | []
| no_license | luhkevin/Huffman | 678e74870ac05db133d8cd14c8cdde9217586e61 | 710f74e4baf5ee5ba35fd859a2c8db6fe45dbc68 | refs/heads/master | 2020-05-30T14:04:28.607509 | 2013-03-06T20:12:37 | 2013-03-06T20:12:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 466 | java | /**
* -------------------
* @author CIS-121 Staff
* @version 1.0 - 03/19/08
*/
@SuppressWarnings("serial")
public class InvalidCharException extends IllegalArgumentException
{
public InvalidCharException()
{
super();
}
public InvalidCharException(String message)
{
super(message);
}
public InvalidCharException(Throwable cause)
{
super(cause);
}
public InvalidCharException(String message, Throwable cause)
{
super(message, cause);
}
}
| [
"[email protected]"
]
| |
4b7888a2d4ee85f23b321ff3f75872cb6df101dc | 88ea4c7ebc57b85d2971ccb01fcf2ee43022970c | /src/main/java/HomeWork/java_core1/lesson2/HomeWorkTwo.java | bc11d20432893af7f696ca9b3facdbef7b765407 | []
| no_license | Woopsik11/java_core1_lesson2 | d692278a37feab9365d3b47a55a531711bcba167 | 57f567dfc24ccd02835a0541eef79607129f32b5 | refs/heads/master | 2023-09-03T12:30:21.343591 | 2021-11-10T13:30:01 | 2021-11-10T13:30:01 | 422,827,187 | 0 | 0 | null | 2021-11-10T13:30:02 | 2021-10-30T08:36:24 | Java | UTF-8 | Java | false | false | 813 | java | package HomeWork.java_core1.lesson2;
public class HomeWorkTwo {
public static void main(String[] args) {
System.out.println(twoNumbers(5, 9));
System.out.println(isPositive(11));
System.out.println(isNegative(23));
String s = "Hi";
int counter = 5;
printNumbers("Hi", 5);
}
private static boolean twoNumbers ( int first, int second) {
int sum = first + second;
return sum <= 20 && sum >= 10;
}
private static boolean isPositive(int variable) {
return variable >= 0;
}
private static boolean isNegative(int number) {
return number < 0;
}
private static void printNumbers(String s, int count) {
for (int i = 0; i < count; i++) {
System.out.println(s);
}
}
}
| [
"[email protected]"
]
| |
09331cf4d13249a9987da48919d2cab77731ff1b | 1aef4669e891333de303db570c7a690c122eb7dd | /src/main/java/com/alipay/api/domain/AlipayOpenAgentCancelModel.java | 29c6cc1e4e3974d2007e3d66f11d4d419a8da59f | [
"Apache-2.0"
]
| permissive | fossabot/alipay-sdk-java-all | b5d9698b846fa23665929d23a8c98baf9eb3a3c2 | 3972bc64e041eeef98e95d6fcd62cd7e6bf56964 | refs/heads/master | 2020-09-20T22:08:01.292795 | 2019-11-28T08:12:26 | 2019-11-28T08:12:26 | 224,602,331 | 0 | 0 | Apache-2.0 | 2019-11-28T08:12:26 | 2019-11-28T08:12:25 | null | UTF-8 | Java | false | false | 686 | java | package com.alipay.api.domain;
import com.alipay.api.AlipayObject;
import com.alipay.api.internal.mapping.ApiField;
/**
* 取消代商户签约、创建应用事务
*
* @author auto create
* @since 1.0, 2019-11-18 14:27:27
*/
public class AlipayOpenAgentCancelModel extends AlipayObject {
private static final long serialVersionUID = 1527269919892374618L;
/**
* ISV 代商户操作事务编号,通过事务开启接口alipay.open.agent.create调用返回。
*/
@ApiField("batch_no")
private String batchNo;
public String getBatchNo() {
return this.batchNo;
}
public void setBatchNo(String batchNo) {
this.batchNo = batchNo;
}
}
| [
"[email protected]"
]
| |
0cb0069045fda47276794110f9e853b43f3ac012 | 11684c24f764e97a9a3295c862f4c2339b1fdb1f | /myandroidjokelibrary/src/androidTest/java/com/uproject/shola/myandroidjokelibrary/ExampleInstrumentedTest.java | 81cc1b0851d39a08d1e60c1b476a401aff73e0c6 | []
| no_license | sholafalana/Udacity_Build-it-bigger_with_Gradle | 77ee6b1cef452bd4831d38cee6bff7eb9ea31861 | e8faad3a93189fe4de7fa75cab90ce0e6f25a518 | refs/heads/master | 2020-04-14T20:44:08.489434 | 2019-01-05T20:16:04 | 2019-01-05T20:16:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 784 | java | package com.uproject.shola.myandroidjokelibrary;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.uproject.shola.myandroidjokelibrary.test", appContext.getPackageName());
}
}
| [
"[email protected]"
]
| |
cff2f52788744f99a125f0d6ff8a6a271ad428a7 | 0b53707e37fd2c2fbaba583c93f83ed28990f69e | /src/main/java/com/example/demo/mapper/UserMapper.java | 77668d0d5f315a4c94a1391ab0e4b47e4d18cae1 | [
"Apache-2.0"
]
| permissive | team4j/demo | bf1a293a55731143f192284b1e4525a448f0d8b5 | 3d11b7316c4bfce0d8083db16a60829dbe3f5813 | refs/heads/master | 2022-06-26T09:26:11.047897 | 2022-06-10T06:52:45 | 2022-06-10T06:52:45 | 218,671,457 | 0 | 0 | Apache-2.0 | 2021-03-31T21:39:55 | 2019-10-31T02:51:21 | Java | UTF-8 | Java | false | false | 232 | java | package com.example.demo.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.demo.model.User;
/**
* Created by dequan.yu on 2020/10/11.
*/
public interface UserMapper extends BaseMapper<User> {
}
| [
"[email protected]"
]
| |
fb33fa5059a52d2e7cd7c6ea0359087982b6ef67 | bcaad8c5a1c32842188527467009437a00d70db7 | /bilo-access-android/src/main/java/ch/bitzgi/android/bluetooth/spp/event/supervisor/Event.java | 70e7d9bda1fc7a06f2fffcb8bb624efb7d83b2d7 | [
"Apache-2.0"
]
| permissive | bilo/bilo-access | 49010f59442d930d4c144e26c4e1fbdbb1a5b5f1 | 362b77d8f404a34b1eb6159b7a8ba6a30800932c | refs/heads/master | 2021-01-01T17:34:33.412899 | 2019-01-06T16:57:08 | 2019-01-06T16:57:08 | 98,102,395 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 206 | java | /*
* Copyright 2018 Urs Fässler
* SPDX-License-Identifier: Apache-2.0
*/
package ch.bitzgi.android.bluetooth.spp.event.supervisor;
public interface Event {
public void accept(Visitor visitor);
}
| [
"[email protected]"
]
| |
dee2f5193a8ad10befb8f7bd7ed17b310796cf7e | 3c920b775ec0ccf11c720d2abaeaeb973c928d8b | /app/src/main/java/studio/blackhand/popularmovies/MainActivity.java | efce21f3250d859bbc0b2c9e1fd6dca44d1d4ab1 | []
| no_license | Rimplot/popular-movies | a0610c83552e2db2a2c41f19649fe9b9db1110fa | 628a979f89e55e528bbb94d069999e5a152e84bc | refs/heads/master | 2020-03-19T18:41:07.134022 | 2018-06-17T21:49:19 | 2018-06-17T21:49:19 | 136,819,930 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,035 | java | package studio.blackhand.popularmovies;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.v4.app.LoaderManager;
import android.support.v4.content.AsyncTaskLoader;
import android.support.v4.content.Loader;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AbsListView;
import android.widget.AdapterView;
import android.widget.GridView;
import android.widget.ProgressBar;
import android.widget.Toast;
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import studio.blackhand.popularmovies.model.Movie;
import studio.blackhand.popularmovies.utilities.ImageAdapter;
import studio.blackhand.popularmovies.utilities.JsonUtils;
import studio.blackhand.popularmovies.utilities.NetworkUtils;
public class MainActivity extends AppCompatActivity implements
LoaderManager.LoaderCallbacks<String> {
private static final int MOVIE_LOADER = 163;
private static final String QUERY_URL_EXTRA_KEY = "query_url";
private static String mode = NetworkUtils.MODE_POPULAR;
private ImageAdapter adapter;
private static Integer resultsPage = 0;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
GridView gridView = findViewById(R.id.main_grid);
adapter = new ImageAdapter(this, new ArrayList<Movie>());
gridView.setAdapter(adapter);
gridView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
Movie movie = adapter.getItem(position);
Intent intent = new Intent(MainActivity.this, DetailsActivity.class);
intent.putExtra(DetailsActivity.KEY_MOVIE, movie);
MainActivity.this.startActivity(intent);
}
});
gridView.setOnScrollListener(new AbsListView.OnScrollListener(){
@Override
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount)
{
if(firstVisibleItem + visibleItemCount >= totalItemCount){
// End has been reached
updateResults();
}
}
@Override
public void onScrollStateChanged(AbsListView view, int scrollState){
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
// update results only if mode changed
if (id == R.id.button_popular && !mode.equals(NetworkUtils.MODE_POPULAR)) {
mode = NetworkUtils.MODE_POPULAR;
resultsPage = 0;
adapter.clear();
updateResults();
} else if (id == R.id.button_top_rated && !mode.equals(NetworkUtils.MODE_TOP_RATED)) {
mode = NetworkUtils.MODE_TOP_RATED;
resultsPage = 0;
adapter.clear();
updateResults();
}
return super.onOptionsItemSelected(item);
}
@SuppressLint("StaticFieldLeak")
@NonNull
@Override
public Loader<String> onCreateLoader(int id, final Bundle args) {
return new AsyncTaskLoader<String>(this) {
@Override
protected void onStartLoading() {
/* If no arguments were passed, we don't have a query to perform. Simply return. */
if (args == null) {
return;
}
ProgressBar progressBar = findViewById(R.id.progressBar);
progressBar.setVisibility(View.VISIBLE);
forceLoad();
}
@Override
public String loadInBackground() {
String queryUrlString = args.getString(QUERY_URL_EXTRA_KEY);
try {
URL queryUrl = new URL(queryUrlString);
return NetworkUtils.getResponseFromHttpUrl(queryUrl);
} catch (IOException e) {
e.printStackTrace();
return null;
}
}
};
}
@Override
public void onLoadFinished(@NonNull Loader<String> loader, String data) {
resultsPage++; // stores the id of the page queried most recently
ArrayList<Movie> movies = JsonUtils.parseJson(data);
adapter.allMovies.addAll(movies);
adapter.notifyDataSetChanged();
ProgressBar progressBar = findViewById(R.id.progressBar);
progressBar.setVisibility(View.GONE);
}
@Override
public void onLoaderReset(@NonNull Loader<String> loader) {
}
public void updateResults() {
if (NetworkUtils.isOnline(this)) {
String queryString = NetworkUtils.buildQueryUrlString(mode, resultsPage + 1);
Log.e("URL", queryString);
Bundle queryBundle = new Bundle();
queryBundle.putString(QUERY_URL_EXTRA_KEY, queryString);
LoaderManager loaderManager = getSupportLoaderManager();
Loader<String> movieQueryLoader = loaderManager.getLoader(MOVIE_LOADER);
if (movieQueryLoader == null) {
loaderManager.initLoader(MOVIE_LOADER, queryBundle, MainActivity.this);
} else {
loaderManager.restartLoader(MOVIE_LOADER, queryBundle, MainActivity.this);
}
} else {
Toast.makeText(this, R.string.error_no_connection, Toast.LENGTH_SHORT).show();
}
}
}
| [
"[email protected]"
]
| |
d387b32edd59d4858d50a3605365984249d574c2 | 6d528077dd9f2d1e574ad635cc81f549e79f5b51 | /src/Zodiac_classs.java | 7d5e67affcbc2555707761d3088a31a0ab433ba8 | []
| no_license | prasunthapa10/COMSC_1003_Zodiac_project | 011befe77f53d8067eb336524efcaa8216ea837b | 329c257bc6dbcdf72db3e521f5072d4deeabc390 | refs/heads/master | 2021-01-10T04:38:55.502012 | 2015-10-19T15:27:18 | 2015-10-19T15:27:18 | 44,544,382 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 181 | java | /**
*
*/
/**
* @author LAB
*
*/
public class Zodiac_classs {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
}
}
| [
"[email protected]"
]
| |
134ba7be69b03a0baee941167107dfb42db191d4 | b0e21d70cb27a724ce7647f5bc2c52fcf1f8ccfe | /src/model4/abstractFactory/sourceInterface/sourceImpl/ThinCrustDough.java | db0059cc4d0db46a018cf5c6ef433cfe6d1a57c9 | []
| no_license | Pridelory/DesignMode | fd4a168d83453aa3d005be46d5070dafc11b8b2a | d5adc454eab74ca8131af91e1d07183ce362cc6f | refs/heads/master | 2020-05-17T07:48:33.419852 | 2020-02-22T09:17:11 | 2020-02-22T09:17:11 | 183,587,388 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 187 | java | package model4.abstractFactory.sourceInterface.sourceImpl;
import model4.abstractFactory.sourceInterface.Dough;
/**
* 薄壳面团
*/
public class ThinCrustDough implements Dough{
}
| [
"[email protected]"
]
| |
b9bb9e87073ad6d1b5e957486415e9e5a2bffd6f | 63d987575635f0775e0bf8347747f4c2fc706d63 | /app/src/main/java/com/mavyfaby/DesignPatterns/creational/Factory/IAnimal.java | 54d8230fb2d99403372e70b8a9f69d7bb0e8c5ed | [
"MIT"
]
| permissive | mavyfaby/DesignPatterns | b0f670a80e5604ec1a477fa82a7b38eca5c0b2b7 | 3dd47eaefe532da67bbfa748f1efba0c68da668b | refs/heads/master | 2022-09-30T18:19:23.816060 | 2020-06-05T07:33:01 | 2020-06-05T07:33:01 | 266,529,132 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 105 | java | package com.mavyfaby.DesignPatterns.creational.Factory;
public interface IAnimal {
void makeSound();
}
| [
"[email protected]"
]
| |
988471fc263c22414d883d30a11f99b148c5e67e | d618bac577ad1c673500684d42544cbb882eb225 | /app/src/test/java/com/example/piotr/myapplication2/ExampleUnitTest.java | c79cd006a5d5fee239930f429551c637007ab84d | []
| no_license | 1PiotrCz/And_LayoutTest | f22f6eb35196b1e9331933ffaf1690d0c1467dda | 0dd22840278819efbdd2134e8fc73f2b480543c2 | refs/heads/master | 2021-01-23T12:34:28.801844 | 2017-06-02T14:31:45 | 2017-06-02T14:31:45 | 93,174,091 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 410 | java | package com.example.piotr.myapplication2;
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);
}
} | [
"[email protected]"
]
| |
77811edbe265e72102a603b5ca103bab13017de0 | adb8b1da4d427a62827dc6b24bf6b1e3274a7f6b | /src/main/java/com/github/xuejike/springboot/jkfaststart/common/QueryDslTool.java | ceea034db72e00be3bc96be78261de674bd49120 | []
| no_license | xuejike/jk-faststart | a59d98ae8a307eb44c14af567033a3546d797ae1 | 16215490dcaa066727fa05568313561ea96485e9 | refs/heads/master | 2021-05-05T15:49:05.803706 | 2018-05-30T06:14:42 | 2018-05-30T06:14:42 | 117,321,869 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 471 | java | package com.github.xuejike.springboot.jkfaststart.common;
import com.querydsl.jpa.impl.JPAQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.persistence.EntityManager;
@Component
public class QueryDslTool {
@Autowired
EntityManager entityManager;
public JPAQuery getQuery(){
JPAQuery<Object> jpaQuery = new JPAQuery<>(entityManager);
return jpaQuery;
}
}
| [
"[email protected]"
]
| |
694443936fe56f9eaf007f8dd7fac5ba47f954d7 | 8b1dfb3fb0fb385959240f61af969c6392c6210d | /src/main/java/com/myretail/data/ProductPriceDao.java | bce9e71b3459a371ba26cbce5508652f01658dd0 | [
"MIT"
]
| permissive | DylanLWScott/myRetail | 6fdba6c4d8221269c0440e16324f7c9dacc51fc8 | 73eeef1661ceb01b870a502c7c2e5470a5865221 | refs/heads/master | 2021-01-10T17:10:04.082541 | 2016-03-02T18:43:20 | 2016-03-02T18:43:20 | 52,984,742 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,284 | java | package com.myretail.data;
import java.math.BigDecimal;
import java.util.Iterator;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Repository;
import com.datastax.driver.core.BoundStatement;
import com.datastax.driver.core.Cluster;
import com.datastax.driver.core.PreparedStatement;
import com.datastax.driver.core.ResultSet;
import com.datastax.driver.core.Row;
import com.datastax.driver.core.Session;
import com.myretail.config.CassandraConfig;
import com.myretail.model.ProductPrice;
@Repository
public class ProductPriceDao {
@Value("${cassandra.priceselect}")
private String priceSelect;
@Value("${cassandra.priceupdate}")
private String priceUpdate;
@Autowired
private CassandraConfig config;
private Cluster cluster;
private Session session;
private PreparedStatement preparedSelect;
private PreparedStatement preparedUpdate;
@PostConstruct
private void createSession() {
try {
cluster = config.cluster().getObject();
session = cluster.connect(config.getKeyspaceName());
} catch (Exception e) {
throw new RuntimeException("Error connecting to database cluster");
}
preparedSelect = session.prepare(priceSelect);
preparedUpdate = session.prepare(priceUpdate);
}
public ProductPrice getPriceById(long id) throws Exception {
BoundStatement bound = preparedSelect.bind(id);
ResultSet resultSet = session.execute(bound);
Iterator<Row> iter = resultSet.iterator();
BigDecimal res = null;
String currency_code = null;
while (iter.hasNext()) {
Row r = iter.next();
res = r.getDecimal("price");
currency_code = r.getString("currency_code");
}
ProductPrice productPrice = new ProductPrice();
productPrice.setPrice(res);
productPrice.setCurrencyCode(currency_code);
return productPrice;
}
public void updatePriceById(long id, BigDecimal price) throws Exception{
BoundStatement bound = preparedUpdate.bind(price, id);
session.execute(bound);
}
@PreDestroy
private void cleanup() throws Exception {
if (session != null) {
session.close();
}
if (cluster != null) {
cluster.close();
}
}
}
| [
"[email protected]"
]
| |
7246fc915f2f3bb5f271e79584b96b75ebd83025 | fed913d49d2a5b64cec1858217e1b6e4ebb62402 | /src/test/java/configuration/Runner.java | 7cecc1e9494d6f8dac349855f991a7d66c0fb3f2 | []
| no_license | EreOo/Open | 1b4981ac5938cc906d0ab8b145f612258978065d | 653dfcd6fd9ea40fd673dfe20ee2f405dc703950 | refs/heads/master | 2020-03-26T09:37:40.855754 | 2018-08-18T20:41:04 | 2018-08-18T20:41:04 | 144,755,834 | 0 | 0 | null | 2018-08-18T20:06:29 | 2018-08-14T18:09:21 | Java | UTF-8 | Java | false | false | 698 | java | package configuration;
import com.codeborne.selenide.Configuration;
import pages.YandexPage;
import static com.codeborne.selenide.Selenide.open;
/**
* Created Vladimir Shekhavtsov.
* All setting hide there.
*/
public class Runner {
private static final String URL_SITE = "https://yandex.ru/";
public YandexPage openSite() {
selectChrome();
open(URL_SITE);
return new YandexPage();
}
// Get properties from pom.xml (profiles)
private void selectChrome() {
Configuration.browser = System.getProperty("browser");
// Uncomment for use selenium grid or selenoid.
// Configuration.remote = System.getProperty("hub");
}
}
| [
"[email protected]"
]
| |
d7d9d9d24f92f3567ef110aab7eae9ac8ea46fa7 | 8af1164bac943cef64e41bae312223c3c0e38114 | /results-java/mybatis--mybatis-3/c012ffbd04aff191290cc4850ccfc35499ae876e/before/BatchExecutor.java | 4d641afaf1fe711ccaa8c86e5877377d38e1a61d | []
| no_license | fracz/refactor-extractor | 3ae45c97cc63f26d5cb8b92003b12f74cc9973a9 | dd5e82bfcc376e74a99e18c2bf54c95676914272 | refs/heads/master | 2021-01-19T06:50:08.211003 | 2018-11-30T13:00:57 | 2018-11-30T13:00:57 | 87,353,478 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,542 | java | /*
* Copyright 2009-2012 The MyBatis Team
*
* 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.apache.ibatis.executor;
import java.sql.BatchUpdateException;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator;
import org.apache.ibatis.executor.keygen.KeyGenerator;
import org.apache.ibatis.executor.statement.StatementHandler;
import org.apache.ibatis.mapping.BoundSql;
import org.apache.ibatis.mapping.MappedStatement;
import org.apache.ibatis.session.Configuration;
import org.apache.ibatis.session.ResultHandler;
import org.apache.ibatis.session.RowBounds;
import org.apache.ibatis.transaction.Transaction;
public class BatchExecutor extends BaseExecutor {
public static final int BATCH_UPDATE_RETURN_VALUE = Integer.MIN_VALUE + 1002;
private final List<Statement> statementList = new ArrayList<Statement>();
private final List<BatchResult> batchResultList = new ArrayList<BatchResult>();
private String currentSql;
private MappedStatement currentStatement;
public BatchExecutor(Configuration configuration, Transaction transaction) {
super(configuration, transaction);
}
public int doUpdate(MappedStatement ms, Object parameterObject) throws SQLException {
Configuration configuration = ms.getConfiguration();
StatementHandler handler = configuration.newStatementHandler(this, ms, parameterObject, RowBounds.DEFAULT, null, null);
BoundSql boundSql = handler.getBoundSql();
String sql = boundSql.getSql();
Statement stmt;
if (sql.equals(currentSql) && ms.equals(currentStatement)) {
int last = statementList.size() - 1;
stmt = statementList.get(last);
BatchResult batchResult = batchResultList.get(last);
batchResult.addParameterObject(parameterObject);
} else {
Connection connection = getConnection();
stmt = handler.prepare(connection);
currentSql = sql;
currentStatement = ms;
statementList.add(stmt);
BatchResult batchResult = new BatchResult(ms, sql);
batchResult.addParameterObject(parameterObject);
batchResultList.add(batchResult);
}
handler.parameterize(stmt);
handler.batch(stmt);
return BATCH_UPDATE_RETURN_VALUE;
}
public <E> List<E> doQuery(MappedStatement ms, Object parameterObject, RowBounds rowBounds, ResultHandler resultHandler, BoundSql boundSql)
throws SQLException {
Statement stmt = null;
try {
flushStatements();
Configuration configuration = ms.getConfiguration();
StatementHandler handler = configuration.newStatementHandler(this, ms, parameterObject, rowBounds, resultHandler, boundSql);
Connection connection = getConnection();
stmt = handler.prepare(connection);
handler.parameterize(stmt);
return handler.<E>query(stmt, resultHandler);
} finally {
closeStatement(stmt);
}
}
public List<BatchResult> doFlushStatements(boolean isRollback) throws SQLException {
try {
List<BatchResult> results = new ArrayList<BatchResult>();
if (isRollback) {
return Collections.emptyList();
} else {
for (int i = 0, n = statementList.size(); i < n; i++) {
Statement stmt = statementList.get(i);
BatchResult batchResult = batchResultList.get(i);
try {
batchResult.setUpdateCounts(stmt.executeBatch());
MappedStatement ms = batchResult.getMappedStatement();
List<Object> parameterObjects = batchResult.getParameterObjects();
KeyGenerator keyGenerator = ms.getKeyGenerator();
if (keyGenerator instanceof Jdbc3KeyGenerator) {
Jdbc3KeyGenerator jdbc3KeyGenerator = (Jdbc3KeyGenerator) keyGenerator;
jdbc3KeyGenerator.processBatch(ms, stmt, parameterObjects);
} else {
for (Object parameter : parameterObjects) {
keyGenerator.processAfter(this, ms, stmt, parameter);
}
}
} catch (BatchUpdateException e) {
StringBuffer message = new StringBuffer();
message.append(batchResult.getMappedStatement().getId())
.append(" (batch index #")
.append(i + 1)
.append(")")
.append(" failed.");
if (i > 0) {
message.append(" ")
.append(i)
.append(" prior sub executor(s) completed successfully, but will be rolled back.");
}
throw new BatchExecutorException(message.toString(), e, results, batchResult);
}
results.add(batchResult);
}
return results;
}
} finally {
for (Statement stmt : statementList) {
closeStatement(stmt);
}
currentSql = null;
statementList.clear();
batchResultList.clear();
}
}
} | [
"[email protected]"
]
| |
3aae41a86be6f4eeb208dc3bbec1a150d57eb616 | e27942cce249f7d62b7dc8c9b86cd40391c1ddd4 | /modules/dfp_axis/src/main/java/com/google/api/ads/dfp/axis/v201702/ExchangeRateDirection.java | bb59762f69cb1507b9573b3d475940a4a1369ae1 | [
"Apache-2.0"
]
| permissive | mo4ss/googleads-java-lib | b4b6178747d25d16ae6aa0c80d80ee18a2dfe01a | efaa9c3bd8a46a3ed4b00963dc9760c6dd8bd641 | refs/heads/master | 2022-12-05T00:30:56.740813 | 2022-11-16T10:47:15 | 2022-11-16T10:47:15 | 108,132,394 | 0 | 0 | Apache-2.0 | 2022-11-16T10:47:16 | 2017-10-24T13:41:43 | Java | UTF-8 | Java | false | false | 3,613 | java | // Copyright 2017 Google Inc. 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.
// 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.
/**
* ExchangeRateDirection.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Mar 02, 2009 (07:08:06 PST) WSDL2Java emitter.
*/
package com.google.api.ads.dfp.axis.v201702;
public class ExchangeRateDirection implements java.io.Serializable {
private java.lang.String _value_;
private static java.util.HashMap _table_ = new java.util.HashMap();
// Constructor
protected ExchangeRateDirection(java.lang.String value) {
_value_ = value;
_table_.put(_value_,this);
}
public static final java.lang.String _TO_NETWORK = "TO_NETWORK";
public static final java.lang.String _FROM_NETWORK = "FROM_NETWORK";
public static final java.lang.String _UNKNOWN = "UNKNOWN";
public static final ExchangeRateDirection TO_NETWORK = new ExchangeRateDirection(_TO_NETWORK);
public static final ExchangeRateDirection FROM_NETWORK = new ExchangeRateDirection(_FROM_NETWORK);
public static final ExchangeRateDirection UNKNOWN = new ExchangeRateDirection(_UNKNOWN);
public java.lang.String getValue() { return _value_;}
public static ExchangeRateDirection fromValue(java.lang.String value)
throws java.lang.IllegalArgumentException {
ExchangeRateDirection enumeration = (ExchangeRateDirection)
_table_.get(value);
if (enumeration==null) throw new java.lang.IllegalArgumentException();
return enumeration;
}
public static ExchangeRateDirection fromString(java.lang.String value)
throws java.lang.IllegalArgumentException {
return fromValue(value);
}
public boolean equals(java.lang.Object obj) {return (obj == this);}
public int hashCode() { return toString().hashCode();}
public java.lang.String toString() { return _value_;}
public java.lang.Object readResolve() throws java.io.ObjectStreamException { return fromValue(_value_);}
public static org.apache.axis.encoding.Serializer getSerializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.EnumSerializer(
_javaType, _xmlType);
}
public static org.apache.axis.encoding.Deserializer getDeserializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.EnumDeserializer(
_javaType, _xmlType);
}
// Type metadata
private static org.apache.axis.description.TypeDesc typeDesc =
new org.apache.axis.description.TypeDesc(ExchangeRateDirection.class);
static {
typeDesc.setXmlType(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201702", "ExchangeRateDirection"));
}
/**
* Return type metadata object
*/
public static org.apache.axis.description.TypeDesc getTypeDesc() {
return typeDesc;
}
}
| [
"[email protected]"
]
| |
264600e54cd65a61321bfb26716c5651a2389b2c | fe144b37897d077d7ab1343c264e94497b6a2107 | /src/main/java/com/springBatch/springBatch/SpringBatchApplication.java | ab153d0813ba29ef26f61600cf5a17e06e052684 | []
| no_license | surjjin/Spring-Batch | 7d2229b04d2e9eb32e6482fdebbb682affdd5306 | f052196617fae4d0e1d7e3295e223b6f7f5c38db | refs/heads/master | 2020-04-11T12:42:28.748510 | 2018-12-14T13:42:00 | 2018-12-14T13:42:00 | 161,789,397 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 362 | java | package com.springBatch.springBatch;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class SpringBatchApplication {
public static void main(String[] args) {
SpringApplication.run(SpringBatchApplication.class, args);
//System.out.println("12312");
}
}
| [
"[email protected]"
]
| |
1126465776a76fa3c53f7354cd3cf0e4a1739dc0 | 296ca0c34cd6b0dcd9eddd40fe277ca825388058 | /src/flowchart/arrow/RR/ShapeArrow_RR_IF.java | bf818e0d452083a88a9f39bd08eb887bc803e39d | []
| no_license | iptomar/algorithmi-code | a53f64369d8d40f2381e68ac1bd598604ff580c5 | 544ed5b000fdbc36ac2e98f17d36a792eebf7965 | refs/heads/master | 2021-01-21T21:38:57.213393 | 2016-07-19T03:30:50 | 2016-07-19T03:30:50 | 53,688,238 | 0 | 10 | null | 2016-07-19T03:30:51 | 2016-03-11T18:30:38 | Java | UTF-8 | Java | false | false | 5,342 | java | /*
* Copyright (c) 2015 Instituto Politecnico de Tomar. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; 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.
*
*/
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
//:: ::
//:: Antonio Manuel Rodrigues Manso ::
//:: ::
//:: I N S T I T U T O P O L I T E C N I C O D E T O M A R ::
//:: Escola Superior de Tecnologia de Tomar ::
//:: e-mail: [email protected] ::
//:: url : http://orion.ipt.pt/~manso ::
//:: ::
//:: This software was build with the purpose of investigate and ::
//:: learning. ::
//:: ::
//:: (c)2015 ::
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
//////////////////////////////////////////////////////////////////////////////
package flowchart.arrow.RR;
import i18n.FkeyWord;
import flowchart.decide.IfElse.IfThenElse;
import flowchart.shape.BorderFlowChart;
import flowchart.utils.UtilsFlowchart;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Insets;
import java.awt.Polygon;
/**
*
* @author ZULU
*/
public class ShapeArrow_RR_IF extends BorderFlowChart {
/**
* Creates a line border with the specified color, thickness, and corner
* shape.
*
* @param color the color of the border
*/
public ShapeArrow_RR_IF(Color color) {
super(color);
}
/**
* Paints the border for the specified component with the specified position
* and size.
*
* @param c the component for which this border is being painted
* @param g the paint graphics
* @param x the x position of the painted border
* @param y the y position of the painted border
* @param width the width of the painted border
* @param height the height of the painted border
*/
public void paint(Graphics g, int x, int y, int width, int height, Color fillColor) {
int S = getBorderSize() / 2 + 1;
int W = getBorderSize() * 3;
int y2 = y + height;
int x2 = x + width;
Polygon p = new Polygon();
p.addPoint(x2 - W + S, y + S);//inicio da seta
p.addPoint(x2 - W, y + S / 2);//inicio da seta
p.addPoint(x2 - W + S, y);//inicio da seta
p.addPoint(x2, y);//2
p.addPoint(x2, y2 - S);//3
//SETA
p.addPoint(x + 2 * S, y2 - S);//SETA
p.addPoint(x + 3 * S, y2);//SETA
p.addPoint(x, y2 - (int) (1.5 * S));//SETA
p.addPoint(x + 3 * S, y2 - 3 * S);//SETA
p.addPoint(x + 2 * S, y2 - 2 * S);//SETA
p.addPoint(x2 - S, y2 - 2 * S);//5
p.addPoint(x2 - S, y + S);//2
p.addPoint(p.xpoints[0], p.ypoints[0]); //fechar
g.setColor(fillColor);
g.fillPolygon(p);
if (S > 1) {
g.setColor(Color.BLACK);
g.drawPolygon(p);
}
if (shape.parent instanceof IfThenElse) {
String txt = FkeyWord.get("KEYWORD.then");
Dimension dimText = UtilsFlowchart.getTextDimension(txt, getLabelFont());
drawLabel(g, txt, x2-3*S-dimText.width, y2 - dimText.height+5);
}
}
/**
* Reinitialize the insets parameter with this Border's current Insets.
*
* @param c the component for which this border insets value applies
* @param insets the object to be reinitialized
*/
public Insets getBorderInsets(Component c, Insets insets) {
insets.set(getThickness(), getThickness(), getThickness(), getThickness());
return insets;
}
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
private static final long serialVersionUID = 201509071215L;
//::::::::::::::::::::::::::: Copyright(c) M@nso 2015 :::::::::::::::::::
///////////////////////////////////////////////////////////////////////////
}
| [
"[email protected]"
]
| |
f75e221b1c253bd12e624513e6af00193431e76b | ed2d2dc547a2453144455db53de2e2702c1b2528 | /src/lab1/Book.java | 14cb6119424e8e6f7d438bf298b1431420486edd | []
| no_license | AndreeaZaharia21/AtelierulDigital2019 | 8a7a915f4cbf630df46b8d1f72933002c68e1a41 | 1f1f7217b82daccf42e4ea3290ca262413f0321d | refs/heads/master | 2020-04-28T06:22:12.488580 | 2019-04-22T18:06:21 | 2019-04-22T18:06:21 | 175,054,763 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 400 | java | package lab1;
public class Book {
private String name;
public void setName(String name) {
this.name = name;
}
public int getPrice() {
return price;
}
public void setPrice(int price) {
this.price = price;
}
public int price;
public Book(int price)
{this.price = price;}
public String getName()
{return name;}
}
| [
"[email protected]"
]
| |
a5e460f1d498d14250f2e472e6b5e6f80f384293 | a59ac307b503ff470e9be5b1e2927844eff83dbe | /wheatfield/branches/rkylin-wheatfield-HKYH/wheatfield/src/test/java/test/wheatfield/CreditRepaymentMonthManagerTest.java | 4e8a00cec62722f1e700a264b56047761599ad6a | []
| no_license | yangjava/kylin-wheatfield | 2cc82ee9e960543264b1cfc252f770ba62669e05 | 4127cfca57a332d91f8b2ae1fe1be682b9d0f5fc | refs/heads/master | 2020-12-02T22:07:06.226674 | 2017-07-03T07:59:15 | 2017-07-03T07:59:15 | 96,085,446 | 0 | 4 | null | null | null | null | UTF-8 | Java | false | false | 1,609 | java | /*
* Powered By rkylin-code-generator
* Web Site: http://www.chanjetpay.com
* Since 2014 - 2015
*/
package test.wheatfield;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import com.rkylin.wheatfield.manager.CreditRepaymentMonthManager;
import com.rkylin.wheatfield.pojo.CreditRepaymentMonth;
import com.rkylin.wheatfield.pojo.CreditRepaymentMonthQuery;
public class CreditRepaymentMonthManagerTest extends BaseJUnit4Test {
@Autowired
@Qualifier("creditRepaymentMonthManager")
private CreditRepaymentMonthManager creditRepaymentMonthManager;
public void testNewCreditRepaymentMonth() {
CreditRepaymentMonth CreditRepaymentMonth = new CreditRepaymentMonth();
creditRepaymentMonthManager.saveCreditRepaymentMonth(CreditRepaymentMonth);
}
public void testUpdateCreditRepaymentMonth(){
CreditRepaymentMonth CreditRepaymentMonth = new CreditRepaymentMonth();
// CreditRepaymentMonth.setId(2l);
creditRepaymentMonthManager.saveCreditRepaymentMonth(CreditRepaymentMonth);
}
public void testDeleteCreditRepaymentMonth(){
creditRepaymentMonthManager.deleteCreditRepaymentMonthById(99L);
}
public void testDeleteCreditRepaymentMonthByQuery(){
CreditRepaymentMonthQuery query = new CreditRepaymentMonthQuery();
creditRepaymentMonthManager.deleteCreditRepaymentMonth(query);
}
public void testFindCreditRepaymentMonthById(){
CreditRepaymentMonthQuery query = new CreditRepaymentMonthQuery();
int size = creditRepaymentMonthManager.queryList(query).size();
System.out.println(size);
}
}
| [
"[email protected]"
]
| |
2ce25ed9df10920bc7bbc436d2dbc97fdd22a3b1 | aef392871ae627fea6a0c825be9ba162a90ace46 | /app/src/main/java/org/androidtown/anywhere/any_11_store_reservation/StoreReservation.java | 191ce0b18f03bba7fa200b570ec7b62349a7cc4e | []
| no_license | GiDuck/Anywhere-android | 50137026ae5aaf3353fdf7d3c9f78e597afef2ad | 09e115c75dce21c4286f22afbbe74902f31d9105 | refs/heads/master | 2020-03-22T23:12:56.365047 | 2018-07-13T04:23:46 | 2018-07-13T04:23:46 | 140,796,266 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 20,690 | java | package org.androidtown.anywhere.any_11_store_reservation;
import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.View;
import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.ScrollView;
import android.widget.TextView;
import android.widget.Toast;
import com.bumptech.glide.Glide;
import com.google.gson.reflect.TypeToken;
import com.jaredrummler.materialspinner.MaterialSpinner;
import org.androidtown.anywhere.R;
import org.androidtown.anywhere.any_02_main.Main;
import org.androidtown.anywhere.any_newVO.CustomerReservationVO;
import org.androidtown.anywhere.any_newVO.MenuVO;
import org.androidtown.anywhere.any_newVO.ReservationListVO;
import org.androidtown.anywhere.any_newVO.SalesVO;
import org.androidtown.anywhere.any_newVO.StoreDetailVO;
import org.androidtown.anywhere.any_newVO.StoreVO;
import org.androidtown.anywhere.header.Header;
import org.androidtown.anywhere.httpcontrol.HttpRequestSyncObject;
import org.androidtown.anywhere.httpcontrol_retrofitController.CustomerController;
import java.lang.reflect.Type;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import info.hoang8f.widget.FButton;
import retrofit2.Call;
import static org.androidtown.anywhere.R.id.reservation_PeopleNum;
import static org.androidtown.anywhere.httpcontrol.ImageURLParser.imageURLParser;
public class StoreReservation extends Header implements View.OnClickListener, MaterialSpinner.OnItemSelectedListener {
final SimpleDateFormat simpleDate = new SimpleDateFormat("yyyy-MM-dd");
RelativeLayout actionbar;
FrameLayout menubar;
ScrollView container1;
ImageView storeImage;
ImageView peoplePlus;
ImageView peopleMinus;
TextView storeName;
TextView storeAddress;
TextView reservationDate;
TextView reservationMenuNum;
TextView reservationMenuPrice;
EditText customerNick;
EditText customerPhone;
EditText reservationPeopleNum;
EditText reservationRequest;
MaterialSpinner timeSelector;
MaterialSpinner daySelector;
RecyclerView reservationMenu;
FButton payment;
StoreDetailVO storeDetailVO;
StoreReservationMenuAdapter menuAdapter;
ArrayList<ReservationListVO> reservationList;
ArrayList<ReservationListVO> reservationListVO;
ArrayList<String> vaild_reservationDate;
HashMap<String, ArrayList<ReservationListVO>> reservationMap;
ArrayList<String> selectedTimes;
SharedPreferences pref;
int reservation_num;
public static final Pattern VALID_HAND_PHONE_NUMBER =
Pattern.compile("^01(?:0|1|[6-9]) - (?:\\d{3}|\\d{4}) - \\d{4}$", Pattern.CASE_INSENSITIVE); //핸드폰 번호 정규식
public static final Pattern VALID_PHONE_NUMBER =
Pattern.compile("^\\d{2,3}-\\d{3,4}-\\d{4}$", Pattern.CASE_INSENSITIVE); //일반 전화번호 정규식
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.anywhere11_store_reservation);
Intent intent = getIntent();
storeDetailVO = (StoreDetailVO) intent.getSerializableExtra("storeDetailVO");
getReservationList(this);
initialize();
setHeader();
mainDataSet();
LinearLayoutManager menuManager = new LinearLayoutManager(this);
reservationMenu.setLayoutManager(menuManager);
menuAdapter = new StoreReservationMenuAdapter(this);
setStoreReservationMenuAdd(menuAdapter);
reservationMenu.setAdapter(menuAdapter);
reservationMenu.setNestedScrollingEnabled(false);
}
public void getReservationList(Activity activity) {
Intent intent;
try {
HttpRequestSyncObject hrs = new HttpRequestSyncObject();
hrs.createRetrofitObject();
CustomerController apiService = hrs.createApiserverObject();
Call call = apiService.getReservationListVO(storeDetailVO.getStoreVO().getStore_num());
hrs.HttpRequestExecute(call);
Type type = new TypeToken<List<ReservationListVO>>() {
}.getType();
hrs.makeGsonObjectTypeDate();
reservationList = (ArrayList<ReservationListVO>) hrs.ObjectParsingFunc2(type);
} catch (Exception e) {
e.printStackTrace();
Toast.makeText(this, "에러가 발생 하였습니다.", Toast.LENGTH_LONG).show();
finish();
}
if (reservationList.size() == 0) {
Toast.makeText(this, "사용 가능한 일정이 존재 하지 않습니다.", Toast.LENGTH_LONG).show();
finish();
} else if (reservationList.isEmpty()) {
Toast.makeText(this, "사용 가능한 일정이 존재 하지 않습니다.", Toast.LENGTH_LONG).show();
activity.finish();
}
}
public void setStoreReservationMenuAdd(StoreReservationMenuAdapter menuAdapter) {
ArrayList<MenuVO> menuVOList = storeDetailVO.getMenuVO();
for (MenuVO menu : menuVOList) {
StoreReservationMenuData data1 = new StoreReservationMenuData();
data1.setMenuName(menu.getMenu_name());
data1.setMenuPrice(String.valueOf(menu.getMenu_price()));
data1.setMenuNum("0");
menuAdapter.add(data1);
}
}
public void mainDataSet() {
StoreVO storeVO = storeDetailVO.getStoreVO();
/*ReservationListVO reservationListVO = storeDetailVO.getReservationListVO();
*/
storeName.setText(storeVO.getStore_name());
storeAddress.setText(storeVO.getStore_addr());
reservationMap = new HashMap<>();
vaild_reservationDate = new ArrayList<>();
vaild_reservationDate.add("날짜를 선택해 주세요");
for (int i = 0; i < reservationList.size(); i++) {
if (!vaild_reservationDate.contains(simpleDate.format(reservationList.get(i).getReservation_date()))) {
//만약 vaild_reservaionDate 리스트 안에 같은 날짜 문자열이 없다면
vaild_reservationDate.add(simpleDate.format(reservationList.get(i).getReservation_date()));
//vaild_reservaionDate 리스트 안에 날짜 문자열 추가 (문자열 reservationDate 리스트에 중복된 문자열을 넣지 않게 하기 위함)
}
}
reservationListVO = new ArrayList<>();
for (int i = 1; i < vaild_reservationDate.size(); i++) {
//추출한 날짜 문자열 사이즈 만큼 반복시킨다.
for (int j = 0; j < reservationList.size(); j++) {
//총 예약 리스트 사이즈 만큼 반복시킨다.
if (simpleDate.format(reservationList.get(j).getReservation_date()).equals(vaild_reservationDate.get(i))) {
//만약 reservationList의 예약 날짜와 문자열 리스트에 들어있는 예약 날짜가 같다면
reservationListVO.add(reservationList.get(j)); //예약 객체 리스트에 add 시켜라.
}
}
reservationMap.put(simpleDate.format(reservationListVO.get(0).getReservation_date()), reservationListVO);
reservationListVO = new ArrayList<>();
}
Glide.with(this).load(imageURLParser(storeVO.getStore_mainurl())).into(storeImage);
Iterator<String> keys = reservationMap.keySet().iterator();
while (keys.hasNext()) {
String key = keys.next();
Log.d("giduckTest47", key);
for (int i = 0; i < reservationMap.get(key).size(); i++) {
Log.d("giduckTest46", "날짜 : " + simpleDate.format(reservationMap.get(key).get(i).getReservation_date()));
Log.d("giduckTest46", "시작 시간 : " + reservationMap.get(key).get(i).getReservation_starttime());
Log.d("giduckTest46", "끝 시간 : " + reservationMap.get(key).get(i).getReservation_endtime());
Log.d("giduckTest46", "-----------------------------------------------------------\n");
}
}
daySelector.setItems(vaild_reservationDate);
daySelector.setOnNothingSelectedListener(new MaterialSpinner.OnNothingSelectedListener() {
@Override
public void onNothingSelected(MaterialSpinner spinner) {
setTimeSpinner();
}
});
}
/////////////////////////////////////데이터 ////////////////////////////////////////
public void initialize() {
//헤더 데이터
actionbar = (RelativeLayout) findViewById(R.id.actionbar);
menubar = (FrameLayout) findViewById(R.id.menubar);
container1 = (ScrollView) findViewById(R.id.container1);
storeName = (TextView) findViewById(R.id.storeName);
storeAddress = (TextView) findViewById(R.id.storeAddress);
reservationDate = (TextView) findViewById(R.id.reservationDate);
reservationMenuNum = (TextView) findViewById(R.id.reservationMenuNum);
reservationMenuPrice = (TextView) findViewById(R.id.reservationMenuPrice);
customerNick = (EditText) findViewById(R.id.customerNick);
customerPhone = (EditText) findViewById(R.id.customerPhone);
reservationPeopleNum = (EditText) findViewById(reservation_PeopleNum);
reservationRequest = (EditText) findViewById(R.id.reservationRequest);
storeImage = (ImageView) findViewById(R.id.storeImage);
peopleMinus = (ImageView) findViewById(R.id.peopleMinus);
peoplePlus = (ImageView) findViewById(R.id.peoplePlus);
reservationMenu = (RecyclerView) findViewById(R.id.reservationMenu);
timeSelector = (MaterialSpinner) findViewById(R.id.timeSelector);
daySelector = (MaterialSpinner) findViewById(R.id.daySelector);
payment = (FButton) findViewById(R.id.payment);
peopleMinus.setOnClickListener(this);
peoplePlus.setOnClickListener(this);
payment.setOnClickListener(this);
daySelector.setOnItemSelectedListener(this);
}
/////////////////////////////헤더 셋팅/////////////////////////////
public void setHeader() {
setActionBar(actionbar);
setTitleName("예약하기");
setBackVisivility(View.VISIBLE);
setMenuBarView(menubar);
setMenuBarAnimation(container1);
setMenuListSelectView(cunsumerMenuListSelect);
}
public void buildCustomerReservationVO() {
SalesVO salesVO;
int customerTotalMenuNum = 0;
int customerTotalMenuPrice = 0;
ArrayList<SalesVO> salesList = new ArrayList<>();
ArrayList<StoreReservationMenuData> data = menuAdapter.getDatas();
HashMap<String, StoreReservationMenuData> dataMap = menuAdapter.getDummyDatas();
Iterator<String> iterator = dataMap.keySet().iterator();
while (iterator.hasNext()) {
String key = iterator.next();
if (Integer.parseInt(dataMap.get(key).getMenuNum()) != 0) {
if (dataMap.get(key).getMenuNum() == null) {
Toast.makeText(this, "메뉴 개수가 공백입니다. 다시 선택해 주세요.", Toast.LENGTH_SHORT).show();
return;
} else if (dataMap.get(key).getMenuNum().trim().length() == 0) {
Toast.makeText(this, "메뉴 개수가 공백입니다. 다시 선택해 주세요.", Toast.LENGTH_SHORT).show();
return;
}
salesVO = new SalesVO();
salesVO.setStore_num(storeDetailVO.getStoreVO().getStore_num());
salesVO.setSales_count(Integer.parseInt(dataMap.get(key).getMenuNum()));
salesVO.setSales_menu(key);
salesVO.setSales_price(Integer.parseInt(dataMap.get(key).getMenuPrice()));
salesVO.setReservation_num(reservation_num);
/*
salesVO.setReservation_num(storeDetailVO.getReservationListVO().getReservation_num());
*/
salesList.add(salesVO);
Log.d("giduckTest41", salesVO.getSales_menu());
Log.d("giduckTest41", salesVO.getSales_count() + "");
Log.d("giduckTest41", salesVO.getSales_price() + "");
Log.d("giduckTest41", salesVO.getReservation_num() + "");
Log.d("giduckTest41", salesVO.getStore_num() + "");
}
}
Matcher vaild_handphone_number = VALID_PHONE_NUMBER.matcher(customerPhone.getText().toString());
Matcher vaild_phone_number = VALID_PHONE_NUMBER.matcher(customerPhone.getText().toString());
if (Integer.parseInt(reservationMenuNum.getText().toString()) < storeDetailVO.getStoreVO().getStore_min() || Integer.parseInt(reservationMenuNum.getText().toString()) == 0) {
Toast.makeText(this, "최소 인원 이상 메뉴를 선택하십시오.", Toast.LENGTH_SHORT).show();
return;
} else if (customerPhone.getText().toString().trim().length() == 0) {
Toast.makeText(this, "연락처가 공백입니다. 다시 입력해 주세요.", Toast.LENGTH_SHORT).show();
return;
} else if (!vaild_handphone_number.matches() || !vaild_phone_number.matches()) {
Toast.makeText(this, "전화번호 양식이 올바르지 않습니다.", Toast.LENGTH_SHORT).show();
return;
} else if (customerNick.getText().toString().trim().length() == 0) {
Toast.makeText(this, "이름을 입력해 주세요", Toast.LENGTH_SHORT).show();
return;
} else if (Integer.parseInt(reservationMenuNum.getText().toString()) < Integer.parseInt(reservationPeopleNum.getText().toString())) {
Toast.makeText(this, "1인 1메뉴 이상 주문 하여야 합니다.", Toast.LENGTH_SHORT).show();
return;
}
ArrayList<ReservationListVO> reservation = new ArrayList<>();
reservation = reservationMap.get(daySelector.getText().toString());
ReservationListVO reservationVO = new ReservationListVO();
reservationVO = reservation.get(timeSelector.getSelectedIndex());
reservationVO.setStore_num(storeDetailVO.getStoreVO().getStore_num());
pref = getSharedPreferences("anywhere", MODE_PRIVATE);
reservationVO.setReservation_nick(pref.getString("user_nick", "")); //sharedPreference로 nick 넘겨줌
reservationVO.setReservation_phone(customerPhone.getText().toString());
reservationVO.setReservation_name(customerNick.getText().toString());
reservationVO.setReservation_total(Integer.parseInt(reservationPeopleNum.getText().toString()));
reservationVO.setReservation_request(reservationRequest.getText().toString());
Log.d("giduckTest41", reservationVO.getReservation_name());
Log.d("giduckTest41", reservationVO.getReservation_nick());
Log.d("giduckTest41", "" + reservationVO.getReservation_num());
Log.d("giduckTest41", reservationVO.getReservation_phone());
Log.d("giduckTest41", reservationVO.getReservation_request());
Log.d("giduckTest41", reservationVO.getReservation_total() + "");
Log.d("giduckTest41", "스피너 출력 결과" + timeSelector.getText().toString());
CustomerReservationVO crVO = new CustomerReservationVO();
crVO.setReservationListVO(reservationVO);
crVO.setSalesVO(salesList);
requestHttp(crVO);
}
public void requestHttp(CustomerReservationVO crVO) {
try {
HttpRequestSyncObject hrs = new HttpRequestSyncObject();
hrs.createRetrofitObject();
CustomerController apiService = hrs.createApiserverObject();
Call call = apiService.reservationInfoSend(crVO);
hrs.HttpRequestExecute(call);
hrs.makeGsonObject();
String result = hrs.parsingStringFunc("result");
if (result.equals("true")) {
Toast.makeText(this, "결제 페이지로 이동합니다!", Toast.LENGTH_SHORT).show();
Intent intent = new Intent(StoreReservation.this, Main.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
} else if (result.equals("false")) {
Toast.makeText(this, "해당 일정에 예약이 존재합니다.", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(this, "오류가 발생하였습니다.", Toast.LENGTH_SHORT).show();
finish();
}
} catch (Exception e) {
e.printStackTrace();
Log.d("errorCode", "소비자 예약 storeReservation exception 에러 발생");
Toast.makeText(this, "오류가 발생 하였습니다.", Toast.LENGTH_SHORT).show();
finish();
}
}
//타임 스피너를 초기화 시켜주는 메소드
public void setTimeSpinner() {
try {
selectedTimes = new ArrayList<>();
reservation_num = reservationMap.get(daySelector.getText().toString()).get(0).getReservation_num();
for (int i = 0; i < reservationMap.get(daySelector.getText().toString()).size(); i++) {
ReservationListVO getReservation = reservationMap.get(daySelector.getText().toString()).get(i);
String am = "오전";
String pm = "오후";
int startTime = getReservation.getReservation_starttime();
int endTime = getReservation.getReservation_endtime();
String str;
if (0 < startTime && startTime < 12) {
str = am + " " + startTime + "시 ~ ";
} else if (startTime == 12) {
str = "정오 " + startTime + "시 ~ ";
} else {
str = pm + " " + (startTime - 12) + "시 ~ ";
}
if (0 < endTime && endTime < 12) {
str += am + " " + endTime + "시";
} else if (endTime == 12) {
str += "정오 " + endTime + "시";
} else if (endTime == 24) {
str += "자정 " + endTime + "시";
} else {
str += pm + " " + (endTime - 12) + "시";
}
selectedTimes.add(str);
}
timeSelector.setItems(selectedTimes);
} catch (Exception e) {
e.printStackTrace();
ArrayList<String> nullPointerArray = new ArrayList<>();
nullPointerArray.add(" ");
timeSelector.setItems(nullPointerArray);
}
}
@Override
public void onClick(View v) {
int peopleNum;
int totalMenuNum;
switch (v.getId()) {
case R.id.peoplePlus: {
peopleNum = Integer.parseInt(reservationPeopleNum.getText().toString());
reservationPeopleNum.setText(String.valueOf(peopleNum + 1));
break;
}
case R.id.peopleMinus: {
peopleNum = Integer.parseInt(reservationPeopleNum.getText().toString());
if (peopleNum != 0) {
reservationPeopleNum.setText(String.valueOf(peopleNum - 1));
}
break;
}
case R.id.payment: {
buildCustomerReservationVO();
break;
}
}
}
@Override
public void onItemSelected(MaterialSpinner view, int position, long id, Object item) {
if (view.getId() == R.id.daySelector) {
setTimeSpinner();
}
}
@Override
public void onLowMemory() {
super.onLowMemory();
Glide.get(this).clearMemory();
}
@Override
public void onTrimMemory(int level) {
super.onTrimMemory(level);
Glide.get(this).trimMemory(level);
}
}
| [
"[email protected]"
]
| |
4a42c7b0c7383b2186fc83f4aa4b03cf37ac9f6d | b118a9cb23ae903bc5c7646b262012fb79cca2f2 | /src/com/estrongs/android/ui/preference/fragments/d.java | 603245d12ac8b165f22a3c76815e2287a91af938 | []
| no_license | secpersu/com.estrongs.android.pop | 22186c2ea9616b1a7169c18f34687479ddfbb6f7 | 53f99eb4c5b099d7ed22d70486ebe179e58f47e0 | refs/heads/master | 2020-07-10T09:16:59.232715 | 2015-07-05T03:24:29 | 2015-07-05T03:24:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,807 | java | package com.estrongs.android.ui.preference.fragments;
import android.preference.Preference;
import android.preference.Preference.OnPreferenceClickListener;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import com.estrongs.android.pop.ad;
import com.estrongs.android.ui.dialog.cg;
import com.estrongs.android.ui.dialog.ct;
import com.estrongs.android.util.am;
class d
implements Preference.OnPreferenceClickListener
{
d(BackupPreferenceFragment paramBackupPreferenceFragment) {}
public boolean onPreferenceClick(Preference paramPreference)
{
paramPreference = com.estrongs.android.pop.esclasses.g.a(a.getActivity()).inflate(2130903061, null);
Object localObject1 = (Button)paramPreference.findViewById(2131361960);
EditText localEditText = (EditText)paramPreference.findViewById(2131361959);
Object localObject2 = (EditText)paramPreference.findViewById(2131361963);
((TextView)paramPreference.findViewById(2131361958)).setText(2131428146);
((TextView)paramPreference.findViewById(2131361962)).setText(2131428147);
String str = am.bk(ad.a(a.getActivity()).au());
if (str != null) {
localEditText.setText(str);
}
localObject2 = new ct(a.getActivity()).a(2131427379).b(2131427339, new f(this, localEditText, (EditText)localObject2)).c(2131427340, new e(this));
((Button)localObject1).setOnClickListener(new g(this, str, localEditText));
localObject1 = ((ct)localObject2).b();
((cg)localObject1).setContentView(paramPreference);
((cg)localObject1).show();
return true;
}
}
/* Location:
* Qualified Name: com.estrongs.android.ui.preference.fragments.d
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"[email protected]"
]
| |
3529d598d97b88ea94a73a338ed2acac6a9cf7ad | 1d20a0b85ef0fce4cf8bb54895306c02ada3a36c | /src/main/java/com/car/controllers/AccessController.java | 28de9f0e94777f3638b020a683836225ea7f61e5 | []
| no_license | L0ngM4n/CarMaintananceDiary | e94c75603292087163ec705dddbc827618001e69 | f5e1854494b1ea2c128837febb64076c8af1d095 | refs/heads/master | 2021-01-20T05:19:18.758128 | 2017-05-04T21:39:32 | 2017-05-04T21:39:32 | 89,770,816 | 0 | 0 | null | 2017-05-05T09:47:11 | 2017-04-29T07:32:56 | Java | UTF-8 | Java | false | false | 297 | java | package com.car.controllers;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
@Controller
public class AccessController {
@GetMapping("/unauthorized")
public String getHomePage(){
return "fragments/noAccess";
}
}
| [
"sasho sasho"
]
| sasho sasho |
daacb6bc8d0a848991bb79209deb632abf6931b7 | 65125873799e29045c8a9cf1840ef503deb2a5bd | /Ch5_Conditionals_and_Loops/PP_5_4_PrintChar.java | 9768c6d98f9ec50fb10a5f0cba620162136aea2f | []
| no_license | phm1234567/Java-Software-Solutions | 15a225287573d5c982756e835ea22ef818b3a7d4 | b577ac2ff7643261348fd98080deb9b54e3d2958 | refs/heads/master | 2022-11-17T04:35:42.747448 | 2020-07-08T19:39:13 | 2020-07-08T19:39:13 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 980 | java | //********************************************************************************
// PrintChar.java @author: Hyunryung Kim
//
// Programming Projects 5.4, Chapter 5
// Design and implement an application that reads a string from the user and
// prints it one characer per line.
//********************************************************************************
import java.util.Scanner;
public class PP_5_4_PrintChar
{
//----------------------------------------------------------------------------
// Reads the user's input string and prints one character per line.
//----------------------------------------------------------------------------
public static void main(String[] args)
{
String str;
Scanner scan = new Scanner (System.in);
System.out.print("Enter a string: ");
str = scan.next();
for (int i = 0;i < str.length();i++)
System.out.println(str.charAt(i));
}
}
| [
"[email protected]"
]
| |
51b2a76c123b696fdb5cf03042a43885c9c22437 | 99f29305c3b72b783e856566fed44aa567386541 | /app/src/main/java/com/example/yijun/finaltruefinal/instructions.java | 339f1312c7db62a1583d2bdc644b2ebaa9115c68 | []
| no_license | yijunl4/finaltruefinal | f1dc329af2268e43b90d73b65634f3ceaf7a48de | ea62821f87d011c8de2bcfa7a7e25dd051fc70db | refs/heads/master | 2020-04-08T22:01:48.710392 | 2018-12-12T22:29:10 | 2018-12-12T22:29:10 | 159,768,410 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 364 | java | package com.example.yijun.finaltruefinal;
import android.app.Activity;
import android.os.Bundle;
import java.nio.channels.AcceptPendingException;
public class instructions extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.instructions);
}
}
| [
"[email protected]"
]
| |
015c7a511bea311287f9b5061e926ca48d21152b | d0d7bc4ed3b915754dedfc808b8b0908629f72f5 | /prodavnica/src/main/java/api/prodavnica/dto/StavkaDTO.java | cadf968a2ce815ec70ed6b99f32fe3474bcdf99a | []
| no_license | ninamarkovic123/osanajnovije | 022e3d2a298c934788be4fb4b0e2efc11ccd5245 | ed31c75a2d8f85a59a42f37285fdf08669b2dbe1 | refs/heads/master | 2023-08-16T17:58:57.835156 | 2021-09-22T17:54:28 | 2021-09-22T17:54:28 | 406,833,071 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 845 | java | package api.prodavnica.dto;
import java.io.Serializable;
@SuppressWarnings("serial")
public class StavkaDTO implements Serializable {
private Long id;
private Integer kolicina;
private PorudzbinaDTO porudzbinaDTO;
private ArtikalDTO artikalDTO;
public StavkaDTO() {
super();
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Integer getKolicina() {
return kolicina;
}
public void setKolicina(Integer kolicina) {
this.kolicina = kolicina;
}
public PorudzbinaDTO getPorudzbinaDTO() {
return porudzbinaDTO;
}
public void setPorudzbinaDTO(PorudzbinaDTO porudzbinaDTO) {
this.porudzbinaDTO = porudzbinaDTO;
}
public ArtikalDTO getArtikalDTO() {
return artikalDTO;
}
public void setArtikalDTO(ArtikalDTO artikalDTO) {
this.artikalDTO = artikalDTO;
}
}
| [
"[email protected]"
]
| |
c822e2ad66a380cd4bda51d83b6d4220fcdd6881 | ff561a299733cdcdaf6808544531cb8ce20cdb3a | /src/main/java/com/automation/techassessment/ui/pages/sauce/CartPage.java | 47f3331f55d7c3624004f8ba215c7be7904584a1 | []
| no_license | hariiravii/skeletor-master | 153e47d6172640a5bb8a68cead142dbc44bfedc5 | 9a322ae0ab8204fe2895c3a60da33caf40bb7432 | refs/heads/master | 2022-06-19T15:40:53.055772 | 2019-12-08T22:03:36 | 2019-12-08T22:03:36 | 226,735,289 | 0 | 0 | null | 2022-05-20T21:19:29 | 2019-12-08T21:36:48 | Java | UTF-8 | Java | false | false | 1,976 | java | package com.automation.techassessment.ui.pages.sauce;
import com.automation.techassessment.ui.lib.UIThreadManager;
import com.slickqa.webdriver.FindBy;
import com.slickqa.webdriver.PageElement;
import com.slickqa.webdriver.WebDriverWrapper;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.openqa.selenium.By;
public class CartPage {
private PageElement yourCart = new PageElement("Your Cart", FindBy.className("subheader"));
private PageElement Onesie = new PageElement("Sauce Labs Onesie", By.xpath("//div[contains(@class, 'inventory_item_name') and text()='Sauce Labs Onesie']"));
private PageElement BikeLight = new PageElement("Sauce Labs Bike Light", By.xpath("//div[contains(@class, 'inventory_item_name') and text()='Sauce Labs Bike Light']"));
private PageElement OnesiePrice = new PageElement("Sauce Labs Onesie", By.xpath("//div[contains(@class, 'inventory_item_name') and text()='Sauce Labs Onesie']/../../div[2]/div"));
private PageElement BikeLightPrice = new PageElement("Sauce Labs Bike Light", By.xpath("//div[contains(@class, 'inventory_item_name') and text()='Sauce Labs Bike Light']/../../div[2]/div"));
public String OnesieCartPrice =null;
public String BikeLightCartPrice = null;
// Need to add more elements like price, desc ,qty
public boolean productContainerIsVisible() {
return UIThreadManager.getBrowser().exists(yourCart);
}
public boolean productNameOnesie() {
return UIThreadManager.getBrowser().exists(Onesie);
}
public boolean productNameBikeLight() {
return UIThreadManager.getBrowser().exists(BikeLight);
}
public void CartPrice() throws Exception{
WebDriverWrapper webDriverWrapper = UIThreadManager.getBrowser();
OnesieCartPrice=webDriverWrapper.getText(OnesiePrice).replace("$","");
BikeLightCartPrice=webDriverWrapper.getText(BikeLightPrice).replace("$","");
}
}
| [
"[email protected]"
]
| |
6e34299f6e2ac37e62613186853a200128c5d4a7 | d8d96bcb4c2db4620d0b8e88ff93825ec16261c5 | /src/lessons17/Converter.java | 048866847a3ce30448ae8879fe242c7bbef44ef0 | []
| no_license | GannaOvchynnykova/MyFirstLovelyJavaTryAndCry | edaa4002ee0f6daf0b5adc5aec12429777bd6ecb | 9efa596c56ec4b5cc1011e390fbedad37048a3c6 | refs/heads/main | 2023-02-22T18:27:09.030130 | 2021-01-27T16:45:43 | 2021-01-27T16:45:43 | 327,896,394 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 941 | java | package lessons17;
public class Converter {
public static void main(String[] args) {
System.out.println(convertDecimalToBinaryWhile(78));
System.out.println(convertDecimalToBinary(78));
}
public static String convertDecimalToBinaryWhile(int decimal){
String output = "";
while (decimal > 0){
int remainder = decimal % 2; //naxodim chislo ot dvoichnogo chisla
output = remainder + output; // sapicivaem v resultat
decimal= decimal/2; //delim input na 2 and pereispilsyem
}
return output;
}
public static String convertDecimalToBinary(int decimal){
String output = "";
for (int i = decimal; i > 0; i = i /2) {
int remainder = i % 2; //naxodim chislo ot dvoichnogo chisla
output = remainder + output; // sapicivaem v resultat
}
return output;
}
}
| [
"[email protected]"
]
| |
af8801275796e13bd46ceef76d58f63023cbbab1 | 9383ef29ea17c95664e39e0ef9351d6b4989328d | /src/main/java/slimeknights/toolleveling/Tooltips.java | 8c93fc139bae4e2f61030e64350538301773940c | [
"MIT"
]
| permissive | miuirussia/TinkersToolLeveling | 8e60b2819407dd96a8d1a51f6ef305a164bb202a | 45854fbead649b5273c0f4e5920c80b2e62dd401 | refs/heads/master | 2020-05-30T15:09:01.345512 | 2016-09-29T12:43:35 | 2016-09-29T12:43:35 | 69,581,594 | 0 | 0 | null | 2016-09-29T15:34:20 | 2016-09-29T15:34:20 | null | UTF-8 | Java | false | false | 3,303 | java | package slimeknights.toolleveling;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.util.text.translation.I18n;
import java.awt.*;
import java.util.List;
import slimeknights.tconstruct.library.client.CustomFontColor;
import slimeknights.tconstruct.library.utils.TinkerUtil;
// utility class for constructing tooltip
public final class Tooltips {
private Tooltips() {
} // non-instantiable
public static void addTooltips(ItemStack itemStack, List<String> tooltips) {
NBTTagCompound tag = TinkerUtil.getModifierTag(itemStack, TinkerToolLeveling.modToolLeveling.getModifierIdentifier());
if(!tag.hasNoTags()) {
ToolLevelNBT data = new ToolLevelNBT(tag);
tooltips.add(1, getXpToolTip(data.xp, TinkerToolLeveling.modToolLeveling.getXpForLevelup(data.level, itemStack)));
tooltips.add(1, getLevelTooltip(data.level));
}
}
private static String getXpToolTip(int xp, int xpNeeded) {
return String.format("%s: %s", I18n.translateToLocal("tooltip.xp"), getXpString(xp, xpNeeded));
}
private static String getXpString(int xp, int xpNeeded) {
return TextFormatting.WHITE + String.format("%d / %d", xp, xpNeeded);
//float xpPercentage = (float)xp / (float)xpNeeded * 100f;
//return String.format("%.2f", xpPercentage) + "%"
}
private static String getLevelTooltip(int level) {
return String.format("%s: %s", I18n.translateToLocal("tooltip.level"), getLevelString(level));
}
public static String getLevelString(int level) {
return getLevelColor(level) + getRawLevelString(level) + TextFormatting.RESET;
}
private static String getRawLevelString(int level) {
if(level <= 0) {
return "";
}
// try a basic translated string
if(I18n.canTranslate("tooltip.level." + level)) {
return I18n.translateToLocal("tooltip.level." + level);
}
// ok. try to find a modulo
int i = 1;
while(I18n.canTranslate("tooltip.level." + i)) {
i++;
}
// get the modulo'd string
String str = I18n.translateToLocal("tooltip.level." + (level % i));
// and add +s!
for(int j = level / i; j > 0; j--) {
str += '+';
}
return str;
}
private static String getLevelColor(int level) {
float hue = (0.277777f * level);
hue = hue - (int) hue;
return CustomFontColor.encodeColor(Color.HSBtoRGB(hue, 0.75f, 0.8f));
/* Old colors
switch (level%12)
{
case 0: return TextFormatting.GRAY.toString();
case 1: return TextFormatting.DARK_RED.toString();
case 2: return TextFormatting.GOLD.toString();
case 3: return TextFormatting.YELLOW.toString();
case 4: return TextFormatting.DARK_GREEN.toString();
case 5: return TextFormatting.DARK_AQUA.toString();
case 6: return TextFormatting.LIGHT_PURPLE.toString();
case 7: return TextFormatting.WHITE.toString();
case 8: return TextFormatting.RED.toString();
case 9: return TextFormatting.DARK_PURPLE.toString();
case 10:return TextFormatting.AQUA.toString();
case 11:return TextFormatting.GREEN.toString();
default: return "";
}*/
}
}
| [
"[email protected]"
]
| |
ee7d1f949eaf9e1a2a4e1988dc90bfc48d6b6213 | 53aba4ba0b83736dea7b456e5570040b890921e2 | /script/src/main/java/com/funny/blood/server/login/LoginLauncher.java | e25cd7fec32163e6864a7db2c13955f0ca43545e | []
| no_license | boyshell/funny | 06d5104517832f16a4884ab8d6bdab5d952e2e06 | bdb0bc415af213c6b5352287f42a41684ba63c3e | refs/heads/master | 2020-03-27T22:57:58.897255 | 2018-09-12T11:46:40 | 2018-09-12T11:46:40 | 147,276,662 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 933 | java | package com.funny.blood.server.login;
import com.funny.blood.ILauncher;
import com.funny.blood.server.login.net.GateToLoginDispatcherScript;
import com.funny.blood.server.login.net.LoginServer;
import com.google.inject.Inject;
public class LoginLauncher implements ILauncher {
private final LoginServer loginServer;
private final LoginScriptHolder loginScriptHolder;
private final GateToLoginDispatcherScript dispatcherScript;
@Inject
public LoginLauncher(
LoginServer loginServer,
LoginScriptHolder loginScriptHolder,
GateToLoginDispatcherScript dispatcherScript) {
this.loginServer = loginServer;
this.loginScriptHolder = loginScriptHolder;
this.dispatcherScript = dispatcherScript;
}
@Override
public void launch() throws Exception {
loginServer.startup();
}
@Override
public void registerScript() {
loginScriptHolder.gate2loginDispatcher = dispatcherScript;
}
}
| [
"[email protected]"
]
| |
6cf0b2956997948ac4767ac456002a6f7be51096 | 91900d740accc408dfb2254505e86e8789a3f06a | /src/main/java/com/camlait/global/erp/domain/model/json/inventaire/Inventaire.java | af88e2c9e023ecc3705d34aa0c69a0f93a78ac2c | []
| no_license | RainerJava/global-erp-json-model | f2ff963cf27e5def58c9c3cf268cca8b0ddef444 | 7747ffda212c5667e2091932b93d12b6aeee59db | refs/heads/master | 2021-01-15T18:15:11.070318 | 2016-01-08T12:50:06 | 2016-01-08T12:50:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,902 | java | package com.camlait.global.erp.domain.model.json.inventaire;
import java.util.Collection;
import java.util.Date;
import com.camlait.global.erp.domain.model.json.Entite;
import com.camlait.global.erp.domain.model.json.document.Document;
import com.camlait.global.erp.domain.model.json.entrepot.Magasin;
import com.camlait.global.erp.domain.model.json.partenaire.Magasinier;
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
@JsonIdentityInfo(generator = ObjectIdGenerators.IntSequenceGenerator.class)
public class Inventaire extends Entite {
private Long inventaireId;
private String codeInventaire;
private Date dateInventaire;
private String note;
private Magasin magasin;
private Magasinier magasinierSortant;
private Magasinier magasinierEntrant;
private boolean inventaireClos;
private Collection<Document> documents;
private Collection<LigneInventaire> ligneInventaires;
private Date dateDeCreation;
private Date derniereMiseAJour;
public Magasinier getMagasinierEntrant() {
return magasinierEntrant;
}
public void setMagasinierEntrant(Magasinier magasinierEntrant) {
this.magasinierEntrant = magasinierEntrant;
}
public String getCodeInventaire() {
return codeInventaire;
}
public void setCodeInventaire(String codeInventaire) {
this.codeInventaire = codeInventaire;
}
public String getNote() {
return note;
}
public void setNote(String note) {
this.note = note;
}
public Magasin getMagasin() {
return magasin;
}
public void setMagasin(Magasin magasin) {
this.magasin = magasin;
}
public Magasinier getMagasinierSortant() {
return magasinierSortant;
}
public void setMagasinierSortant(Magasinier magasinier) {
this.magasinierSortant = magasinier;
}
public boolean isInventaireClos() {
return inventaireClos;
}
public void setInventaireClos(boolean inventaireClos) {
this.inventaireClos = inventaireClos;
}
public Collection<Document> getDocuments() {
return documents;
}
public void setDocuments(Collection<Document> documents) {
this.documents = documents;
}
public Collection<LigneInventaire> getLigneInventaires() {
return ligneInventaires;
}
public void setLigneInventaires(Collection<LigneInventaire> ligneInventaires) {
this.ligneInventaires = ligneInventaires;
}
public Long getInventaireId() {
return inventaireId;
}
public void setInventaireId(Long id) {
this.inventaireId = id;
}
public Date getDateInventaire() {
return dateInventaire;
}
public void setDateInventaire(Date dateInventaire) {
this.dateInventaire = dateInventaire;
}
public Date getDateDeCreation() {
return dateDeCreation;
}
public void setDateDeCreation(Date dateDeCreation) {
this.dateDeCreation = dateDeCreation;
}
public Date getDerniereMiseAJour() {
return derniereMiseAJour;
}
public void setDerniereMiseAJour(Date derniereMiseAJour) {
this.derniereMiseAJour = derniereMiseAJour;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((codeInventaire == null) ? 0 : codeInventaire.hashCode());
result = prime * result + ((inventaireId == null) ? 0 : inventaireId.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Inventaire other = (Inventaire) obj;
if (codeInventaire == null) {
if (other.codeInventaire != null)
return false;
} else if (!codeInventaire.equals(other.codeInventaire))
return false;
if (inventaireId == null) {
if (other.inventaireId != null)
return false;
} else if (!inventaireId.equals(other.inventaireId))
return false;
return true;
}
public Inventaire() {
setDateDeCreation(new Date());
setDerniereMiseAJour(new Date());
}
}
| [
"[email protected]"
]
| |
f2a7a9a03e6e0e20b77098f62bb97d2b63c95ec0 | b9b614e1bd7b3cb329d3b2f1d92884bdda794d8b | /pet-clinic-web/src/main/java/com/example/petclinic/controllers/IndexController.java | 13c9edbc8b79dd15930ae2ec9b9e92874529d9ef | []
| no_license | miki1099/pet-clinic | 6ff72f4fcd01eea42dad22c2e1736ad18840bb28 | 15e2877bbeb93ca36ef1b2d86e59d058e7598c9f | refs/heads/master | 2023-03-23T14:13:00.080715 | 2021-03-11T11:56:51 | 2021-03-11T11:56:51 | 343,102,883 | 0 | 0 | null | 2021-03-08T13:43:38 | 2021-02-28T12:44:01 | Java | UTF-8 | Java | false | false | 400 | java | package com.example.petclinic.controllers;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class IndexController {
@RequestMapping({"", "/", "index"})
public String index() {
return "index";
}
@RequestMapping("/oups")
public String oups() {
return "notimplemented";
}
}
| [
"[email protected]"
]
| |
0af6ee2944daa9e3a2967d91362d5ea1bbddee49 | 167c6226bc77c5daaedab007dfdad4377f588ef4 | /java/ql/test/stubs/springframework-5.3.8/org/springframework/boot/SpringBootConfiguration.java | 483c5cc5606536c4681dcb915d4334b58c686bf1 | [
"Apache-2.0",
"MIT"
]
| permissive | github/codeql | 1eebb449a34f774db9e881b52cb8f7a1b1a53612 | d109637e2d7ab3b819812eb960c05cb31d9d2168 | refs/heads/main | 2023-08-20T11:32:39.162059 | 2023-08-18T14:33:32 | 2023-08-18T14:33:32 | 143,040,428 | 5,987 | 1,363 | MIT | 2023-09-14T19:36:50 | 2018-07-31T16:35:51 | CodeQL | UTF-8 | Java | false | false | 260 | java | package org.springframework.boot;
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
import org.springframework.context.annotation.Configuration;
@Target(ElementType.TYPE)
@Configuration
public @interface SpringBootConfiguration {} | [
"[email protected]"
]
| |
54dcd78e4ca8b0f942d5d51c49a144c099b921e5 | bdbf4944483e2afa7e932e25c8caba45f9fb0960 | /src/main/java/com/aak1247/promise/PromiseScheduler.java | da9796382c309274ad8bdc2cbd781772d013cdd8 | []
| no_license | aak1247/PromiseJava | 8f2f34ecd565bde5d115dff9867fe4f79625fc59 | 5022609719fbc5c067ada0388cee536f328188be | refs/heads/master | 2021-05-03T18:51:46.251218 | 2020-10-21T02:51:49 | 2020-10-21T02:51:49 | 120,416,891 | 3 | 0 | null | 2020-10-21T02:51:50 | 2018-02-06T07:19:39 | Java | UTF-8 | Java | false | false | 2,148 | java | package com.aak1247.promise;
import com.lmax.disruptor.*;
import com.lmax.disruptor.dsl.Disruptor;
import com.lmax.disruptor.dsl.ProducerType;
import com.lmax.disruptor.util.DaemonThreadFactory;
import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;
public class PromiseScheduler {
Disruptor<PromiseEvent> disruptor;
RingBuffer<PromiseEvent> buffer;
List<BatchEventProcessor<PromiseEvent>> processors;
List<EventHandler<Promise<?, ?, ?>>> eventHandlers = new LinkedList<>();
public PromiseScheduler() {
this(2, 65536);
}
public PromiseScheduler(int workerNum, int bufferSize) {
ThreadFactory threadFactory = DaemonThreadFactory.INSTANCE;
Executor executor = Executors.newFixedThreadPool(workerNum, threadFactory);
WaitStrategy waitStrategy = new SleepingWaitStrategy();
this.disruptor
= new Disruptor<>(PromiseEvent.PROMISE_EVENT_FACTORY, bufferSize, executor, ProducerType.MULTI, waitStrategy);
PromiseConsumer consumer = new PromiseConsumer();
PromiseExceptionHandler exceptionHandler = new PromiseExceptionHandler();
this.disruptor.handleEventsWith(consumer);
this.disruptor.setDefaultExceptionHandler(exceptionHandler);
this.buffer = disruptor.start();
}
public void stop() {
this.disruptor.shutdown();
}
void registerEventHandler(EventHandler eventHandler) {
eventHandlers.add(eventHandler);
}
synchronized void publishPromise(Promise promise) {
publishPromise(promise, promise.getStatus());
}
synchronized void publishPromise(Promise promise, PromiseStatus after) {
if (promise != null) {
this.buffer.publishEvent(PromiseEvent.TRANSLATOR, promise, after);
}
}
synchronized void publishPromise(Promise promise, PromiseStatus after, boolean repeated) {
if (promise != null) {
this.buffer.publishEvent(PromiseEvent.TRANSLATOR_REPEATED, promise, after, repeated);
}
}
}
| [
"[email protected]"
]
| |
2b74c8be70326d4aa22767af7378a3c0f2359ab4 | 5e520a6b641baa05463d89911e9eb0e66c91672d | /src/main/java/com/pde/jhipster/repository/AuthorityRepository.java | 629ef250db6649155c07da03971c64a35815c1a9 | []
| no_license | pde201/jhipster-sample-application | 66125b356fa6764105e653bc70fbe481ba935e89 | 6f653b823818223b7318611d0f4c1b871fa19b38 | refs/heads/main | 2023-03-23T02:18:28.843549 | 2021-03-21T09:02:52 | 2021-03-21T09:02:52 | 349,946,715 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 296 | java | package com.pde.jhipster.repository;
import com.pde.jhipster.domain.Authority;
import org.springframework.data.jpa.repository.JpaRepository;
/**
* Spring Data JPA repository for the {@link Authority} entity.
*/
public interface AuthorityRepository extends JpaRepository<Authority, String> {}
| [
"[email protected]"
]
| |
d436cac639ff23637cb847dee47eb85dc55040c5 | 34ffdbb15f1b3ff4e905a6d4870308fd581ee16b | /spring-boot/springBoot-mvc-h2db/src/main/java/com/springboot/api/Application.java | 2ff0c1258df58ea9e6a1609939f1284fe252244b | []
| no_license | thotaanil19/Spring | 5dfe549fe620098ea28889a601726dfa9f2557cd | 267f64a4fdb456775a48a15a472cd174fd1931c4 | refs/heads/master | 2022-12-20T10:25:50.256369 | 2020-02-10T18:36:46 | 2020-02-10T18:36:46 | 138,951,600 | 0 | 0 | null | 2022-12-15T23:38:58 | 2018-06-28T01:35:49 | Java | UTF-8 | Java | false | false | 330 | java | package com.springboot.api;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
*
* @author anilt
*
*/
@SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
| [
"[email protected]"
]
| |
46c22ebd2f964a7753d35f961280afd96530a2d0 | 2f1f883b88c35fbdd7bcdad42b364df465f61279 | /ses-app/ses-web-ros/src/main/java/com/redescooter/ses/web/ros/service/base/impl/OpeInvoiceCombinDetailBServiceImpl.java | 2b0aec6e55400661a2376c80faa1f5ed2727e11c | [
"MIT"
]
| permissive | RedElect/ses-server | bd4a6c6091d063217655ab573422f4cf37c8dcbf | 653cda02110cb31a36d8435cc4c72e792467d134 | refs/heads/master | 2023-06-19T16:16:53.418793 | 2021-07-19T09:19:25 | 2021-07-19T09:19:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,203 | java | package com.redescooter.ses.web.ros.service.base.impl;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
import com.redescooter.ses.web.ros.dao.base.OpeInvoiceCombinDetailBMapper;
import com.redescooter.ses.web.ros.dm.OpeInvoiceCombinDetailB;
import com.redescooter.ses.web.ros.service.base.OpeInvoiceCombinDetailBService;
@Service
public class OpeInvoiceCombinDetailBServiceImpl extends ServiceImpl<OpeInvoiceCombinDetailBMapper, OpeInvoiceCombinDetailB> implements OpeInvoiceCombinDetailBService {
@Override
public int updateBatch(List<OpeInvoiceCombinDetailB> list) {
return baseMapper.updateBatch(list);
}
@Override
public int batchInsert(List<OpeInvoiceCombinDetailB> list) {
return baseMapper.batchInsert(list);
}
@Override
public int insertOrUpdate(OpeInvoiceCombinDetailB record) {
return baseMapper.insertOrUpdate(record);
}
@Override
public int insertOrUpdateSelective(OpeInvoiceCombinDetailB record) {
return baseMapper.insertOrUpdateSelective(record);
}
}
| [
"[email protected]"
]
| |
8d8156f23dcf3f666390ff515468da7181fb7044 | d1fcdaa5338b40804f0b72ea0d4ce3ed67ba0905 | /TextExcel/src/textExcel/EmptyCell.java | 052cb330d685ddb0cf67ebad3a9b25331ed59e56 | []
| no_license | conanlee718/conanl_APCS2_spring | 53af60bd82e34e8c9c8831b2c24bf2407b9390ae | ad44b8e1eeafdb88406faccec412f102bae7fdc3 | refs/heads/master | 2021-01-13T05:21:05.674694 | 2017-05-21T18:36:18 | 2017-05-21T18:36:18 | 81,362,098 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 348 | java | //Conan Lee
//APCS 2nd period
//finished date for checkpoint 1 : 3/4/17
package textExcel;
public class EmptyCell implements Cell {
@Override
public String abbreviatedCellText() {
// TODO Auto-generated method stub
return " ";
}
@Override
public String fullCellText() {
// TODO Auto-generated method stub
return "";
}
}
| [
"[email protected]"
]
| |
e07d1c344f485a8686c89363bbe13a55e2733cc7 | 49bb926966baeb7e83ed36c17c0122314380d7bd | /src/main/java/org/springframework/data/redis/connection/ReactiveClusterListCommands.java | 92e87f6e8e39cd2620bc42e47d76d4c3f97358fe | [
"LicenseRef-scancode-generic-cla"
]
| no_license | HiskeyCheng/spring-data-redis | 63dbb3dd596ddfea3f1172acd35ad3f0bfd194ec | bcc256be7e2347e15212e873abf77dc1b7720e3e | refs/heads/master | 2020-04-30T13:31:37.573217 | 2019-03-20T09:08:30 | 2019-03-20T09:08:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 802 | java | /*
* Copyright 2016-2019 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.data.redis.connection;
/**
* @author Christoph Strobl
* @since 2.0
*/
public interface ReactiveClusterListCommands extends ReactiveListCommands {
}
| [
"[email protected]"
]
| |
0f21513e0fa5b5c9288ee5a02f3cdf8313b870cc | 30b40872495d06d20ff4215fabdc82bfd6798052 | /src/main/java/hu/sari/shoppinglist/api/UserController.java | 9852aa7eecb52d043bce5f118565ff7bc1bfa971 | []
| no_license | Sari21/ShoppingList | add0e1087c98dc8259604fb6684638c2292a77a6 | 3264d6c59be96a66728ea6e4436a385a60313ff3 | refs/heads/master | 2023-01-09T21:26:49.994323 | 2020-03-04T08:18:50 | 2020-03-04T08:18:50 | 242,761,404 | 0 | 0 | null | 2023-01-07T20:18:07 | 2020-02-24T14:45:12 | JavaScript | UTF-8 | Java | false | false | 1,195 | java | package hu.sari.shoppinglist.api;
import hu.sari.shoppinglist.model.User;
import hu.sari.shoppinglist.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.UUID;
@CrossOrigin(origins = "*")
@RequestMapping("api/user")
@RestController
public class UserController {
private final UserService userService;
@Autowired
public UserController(UserService userService) {
this.userService = userService;
}
@PostMapping(consumes = "application/json", produces = "application/json")
public void addUser(@RequestBody User user){
userService.addUser(user);
}
@GetMapping
public List<User> getAllUsers(){
return userService.getAllUsers();
}
/* @GetMapping(path = "{id}")
public User getUserById(@PathVariable("id") UUID id){
return userService.getUserById(id).orElse(null);
}*/
@GetMapping(path = "{name}")
public User getUserByUsername(@PathVariable("name") String name){
return userService.getUserByUsername(name).orElse(null);
}
}
| [
"[email protected]"
]
| |
46f82a7f8c29e872139f9c8ec7a6794be69b3465 | 8c9b0757ada3705876aeda512a4f79edf78a5125 | /spring-mongo-rest/src/main/java/com/learning/Repository/UserRepository.java | eb7258c16fab3b2bf8a3a7b42f746ac45cf7f036 | []
| no_license | BugraAslan/spring-example | af9e45f86ffd6d7c3d272efbe8f92faf15abb672 | 3b049b7c079f215f9d6a82c01e62d02e209bb599 | refs/heads/master | 2023-05-28T02:59:45.743295 | 2021-06-01T19:41:36 | 2021-06-01T19:41:36 | 368,459,787 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 210 | java | package com.learning.Repository;
import com.learning.Entity.User;
import org.springframework.data.mongodb.repository.MongoRepository;
public interface UserRepository extends MongoRepository<User, String> {
}
| [
"[email protected]"
]
| |
120e5e3c8fa32ed0220a3db0994ff514f1e46486 | 61d9d715bb76ec499943aac6b464a8168a6da689 | /src/main/java/homework_project/repositories/DebtCaseRepository.java | cd64b5fda90718dbcdc9de9c7287251de4741909 | []
| no_license | AnnaSam48/HomeworkProject | aad733a37da3a2555fb93935df22e5ca0e1f03cd | 846bec4030b6469392656ccfec0d12a18f0e7f7f | refs/heads/master | 2023-04-07T09:23:44.517031 | 2021-04-19T15:21:14 | 2021-04-19T15:21:14 | 357,875,301 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 709 | java | package homework_project.repositories;
import homework_project.models.entities.DebtCase;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;
import java.util.List;
import java.util.Optional;
public interface DebtCaseRepository extends CrudRepository <DebtCase, Long>{
String serchForAllCasesForCustomer = "SELECT d FROM DebtCase d JOIN Customer c ON d.customerId = c.id WHERE c.id =:customerId";
Optional<DebtCase> findById(Long id);
List<DebtCase> findAll();
@Query(serchForAllCasesForCustomer)
List<DebtCase> findByCustomerId(@Param("customerId")Long customerId);
}
| [
"[email protected]"
]
| |
0ab0818fc4d7f8fc2dcf593d5339a5fe98973ab2 | 5765c87fd41493dff2fde2a68f9dccc04c1ad2bd | /Variant Programs/2-4/16/dealer/Retailer.java | 165ab47c4182c0d4bedcbc80ee18741b0be71e2f | [
"MIT"
]
| permissive | hjc851/Dataset2-HowToDetectAdvancedSourceCodePlagiarism | 42e4c2061c3f8da0dfce760e168bb9715063645f | a42ced1d5a92963207e3565860cac0946312e1b3 | refs/heads/master | 2020-08-09T08:10:08.888384 | 2019-11-25T01:14:23 | 2019-11-25T01:14:23 | 214,041,532 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,649 | java | package dealer;
import multitasking.DcSpreadsheet;
import multitasking.GrrProgrammer;
import multitasking.Treat;
import multitasking.GpaInterface;
import multitasking.ObtainingConfiguration;
import multitasking.Configuration;
import multitasking.SchedulingPlanner;
import moot.OperationSimulated;
import java.io.IOException;
import java.util.*;
public class Retailer {
public static int AssignThing;
public java.util.LinkedList<Treat> mechanisms;
public java.util.ArrayDeque<Configuration> performance;
public static final String maximize = "N1pJ";
public Retailer() {
multitasking.Configuration using;
multitasking.Configuration sta;
multitasking.Configuration days;
multitasking.Configuration grr;
multitasking.Configuration lm;
this.performance = new java.util.ArrayDeque<>();
using = new multitasking.SchedulingPlanner();
sta = new multitasking.GpaInterface();
days = new multitasking.ObtainingConfiguration();
grr = new multitasking.GrrProgrammer();
lm = new multitasking.DcSpreadsheet();
this.performance.addLast(using);
this.performance.addLast(sta);
this.performance.addLast(days);
this.performance.addLast(lm);
this.performance.addLast(grr);
}
public synchronized void orderedMechanisms(java.util.LinkedList<Treat> summons) {
int nominate;
nominate = -147242579;
this.mechanisms = summons;
}
public synchronized void doForwardingAgain(int dischargeDays) {
double flag;
flag = 0.6887431070371106;
this.AssignThing = dischargeDays;
}
public synchronized void scarperCaller() {
double narrowerMax;
narrowerMax = 0.5705936068200637;
for (multitasking.Configuration fh : performance) {
fh.resumeServer();
while (fh.goIsMoving()) {
if (fh.findCompletionActSmall() == mechanisms.size()) {
fh.ceaseOrganizer();
} else {
java.util.LinkedList<Treat> lineMechanism;
lineMechanism = new java.util.LinkedList<>();
for (multitasking.Treat postscript : mechanisms) {
if (postscript.obtainSendDays() == fh.catchRifeCheck() + 1) {
lineMechanism.add(new multitasking.Treat(postscript));
}
}
java.util.Collections.sort(lineMechanism);
while (!lineMechanism.isEmpty()) {
fh.methodEntrance(lineMechanism.removeFirst());
}
fh.markAfootDials(fh.catchRifeCheck() + 1);
fh.nsoTic();
}
}
}
this.photographySnapshot();
}
public synchronized void photographySnapshot() {
int restricted;
restricted = 896956854;
try {
java.lang.String masthead;
OperationSimulated.ProducerSubmitted.write("Summary\n");
System.out.println("Summary");
masthead =
java.lang.String.format(
"%-9s%23s%26s", "Algorithm", "Average Waiting Time", "Average Turnaround Time");
OperationSimulated.ProducerSubmitted.write(masthead + "\n");
System.out.println(masthead);
for (multitasking.Configuration waffen : performance) {
java.lang.String synopsis;
synopsis =
java.lang.String.format(
"%-9s%23.2f%26.2f",
waffen.compilerMake(),
waffen.haveModerateDeferPeriods(),
waffen.conveyRegularAdjustmentAmount());
OperationSimulated.ProducerSubmitted.write(synopsis + "\n");
System.out.println(synopsis);
}
OperationSimulated.ProducerSubmitted.close();
} catch (java.io.IOException tipp) {
System.out.println("Unable to write summary to file.");
}
}
}
| [
"[email protected]"
]
| |
242dea256d621b66d95e5a5c9434bbdac275db53 | 034a349a737d266ac0eca6bc3fe924ac0e06ac51 | /Storm/warm_up/WordSpout.java | a1aa526ef92b594745f8392116b4c1459e322e38 | []
| no_license | xioccMo/Test-Oriented-Programming | abf991ff10db9538556d8e72fab02ea297bc505f | 67b96065fe1f875e371fe59e566a30fb04f25ce8 | refs/heads/master | 2020-12-03T10:48:50.067523 | 2020-01-02T03:30:47 | 2020-01-02T03:30:47 | 231,287,395 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,869 | java | package DSPPCode.storm.warm_up;
import DSPPCode.storm.warm_up.util.FileProcess;
import org.apache.storm.spout.SpoutOutputCollector;
import org.apache.storm.task.TopologyContext;
import org.apache.storm.topology.OutputFieldsDeclarer;
import org.apache.storm.topology.base.BaseRichSpout;
import org.apache.storm.tuple.Fields;
import org.apache.storm.tuple.Values;
import java.io.BufferedReader;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
public class WordSpout extends BaseRichSpout {
private String datasource;
private SpoutOutputCollector collector;
private List<String> words;
private int index;
private boolean isStop;
public WordSpout(String datasource) {
this.datasource = datasource;
}
public void open(Map map, TopologyContext topologyContext, SpoutOutputCollector spoutOutputCollector) {
collector = spoutOutputCollector;
index = 0;
words = new ArrayList<>();
isStop = false;
BufferedReader br = FileProcess.getReader(datasource);
String line = FileProcess.read(br);
while (line != null && !line.equals("")) {
String[] words2 = line.split(" ");
for (String word : words2) {
words.add(word);
}
line = FileProcess.read(br);
}
FileProcess.close(br);
}
public void nextTuple() {
if (index < words.size()) {
String word = words.get(index);
index++;
collector.emit(new Values(word));
} else {
if (isStop == false) {
collector.emit(new Values("stop!"));
isStop = true;
}
}
}
public void declareOutputFields(OutputFieldsDeclarer outputFieldsDeclarer) {
outputFieldsDeclarer.declare(new Fields("word"));
}
}
| [
"[email protected]"
]
| |
d13c0f6f1a0fb1ac19ffc33726118525157e00aa | 421bd275437813a17baddb8e152324f72640cb3b | /Java/Day 9/Day_9.4/src/test/Program.java | ba8539a9ad27f26832f3b2ab238bc40fc44b2e5a | []
| no_license | JyotiDewangan13121996/Notes | 7eb0f0374848952639e39e1457765a45b804d5ce | cb7a1562dd300ff071d22d4865f97561cd1bf9de | refs/heads/master | 2022-11-28T10:59:17.784322 | 2020-08-10T15:27:55 | 2020-08-10T15:27:55 | 286,489,917 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,699 | java | package test;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.ConcurrentModificationException;
import java.util.Deque;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.List;
import java.util.Queue;
import java.util.Set;
import java.util.Stack;
import java.util.TreeSet;
import java.util.Vector;
public class Program
{
public static void main(String[] args)
{
Set<Integer> set = new TreeSet<Integer>();
set.add(50);
set.add(10);
set.add(40);
set.add(20);
set.add(30);
set.add(50);
set.add(10);
set.add(40);
set.add(20);
set.add(30);
set.add(null); //NullPointerException
for( Integer element : set )
System.out.println(element);
}
public static void main6(String[] args)
{
Queue<Integer> que = new ArrayDeque<>();
que.offer(10);
que.offer(20);
que.offer(30);
Integer ele = null;
while( !que.isEmpty())
{
ele = que.peek();
System.out.println("Removed element is : "+ele);
que.poll();
}
}
public static void main5(String[] args)
{
Queue<Integer> que = new ArrayDeque<>();
que.add(10);
que.add(20);
que.add(30);
Integer ele = null;
while( !que.isEmpty())
{
ele = que.element();
System.out.println("Removed element is : "+ele);
que.remove();
}
}
public static void main4(String[] args)
{
Deque<Integer> stk = new ArrayDeque<>();
stk.push(10);
stk.push(20);
stk.push(30);
Integer element = null;
while( !stk.isEmpty())
{
element = stk.peek();
System.out.println("Popped element is : "+element);
stk.pop();
}
}
public static void main3(String[] args)
{
Stack<Integer> stk = new Stack<Integer>();
stk.push(10);
stk.push(20);
stk.push(30);
Integer element = null;
while( !stk.empty() )
{
//element = stk.peek();
element = stk.pop();
System.out.println("Popped element is : "+element);
}
}
public static void main2(String[] args)
{
Vector<Integer> v = new Vector<>();
v.add(10);
v.add(20);
v.add(30);
v.add(40);
v.add(50);
Integer element = null;
Enumeration<Integer> e = v.elements();
while( e.hasMoreElements())
{
element = e.nextElement();
System.out.print(element+" ");
if( element == 50 )
v.add(60); //OK
}
System.out.println();
}
public static void main1(String[] args)
{
Vector<Integer> v = new Vector<>();
v.add(10);
v.add(20);
v.add(30);
v.add(40);
v.add(50);
Integer element = null;
Iterator<Integer> itr = v.iterator();
while( itr.hasNext())
{
element = itr.next();
System.out.print(element+" ");
if( element == 50 )
v.add(60); //ConcurrentModificationException
}
System.out.println();
}
}
| [
"[email protected]"
]
| |
ed975af3e70ed731a1fa7b704ddbf3b1638a6aa2 | 7ba275bcaf28543df238781b4e8dc89001cee366 | /src/main/java/com/xmomen/module/pick/entity/TbExchangeCardLog.java | fc6f8157ce691e0e41c747860b664e8ee62f301b | [
"MIT"
]
| permissive | moyuB/dms-webapp | b0ddaaf4a9566d9edb63549952c5d9978a89bab8 | 96fcd1bc0b60389c339be18c30fea385196825f4 | refs/heads/master | 2021-12-27T06:26:06.403221 | 2017-06-15T14:17:42 | 2017-06-15T14:17:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,517 | java | package com.xmomen.module.pick.entity;
import com.xmomen.framework.mybatis.model.BaseMybatisModel;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Version;
@Entity
@Table(name = "tb_exchange_card_log")
public class TbExchangeCardLog extends BaseMybatisModel {
/**
* 主键
*/
private Integer id;
/**
* 旧卡ID
*/
private Integer oldCouponId;
/**
* 旧卡卡号
*/
private String oldCouponNo;
/**
*
*/
private Integer newCouponId;
/**
*
*/
private String newCouponNo;
/**
* 换卡操作者
*/
private Integer rechargeUser;
/**
* 换卡采摘点
*/
private Integer rechargePlace;
@Column(name = "ID")
@Id
@GeneratedValue(generator = "UUIDGenerator")
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
if(id == null){
removeValidField("id");
return;
}
addValidField("id");
}
@Column(name = "OLD_COUPON_ID")
public Integer getOldCouponId() {
return oldCouponId;
}
public void setOldCouponId(Integer oldCouponId) {
this.oldCouponId = oldCouponId;
if(oldCouponId == null){
removeValidField("oldCouponId");
return;
}
addValidField("oldCouponId");
}
@Column(name = "OLD_COUPON_NO")
public String getOldCouponNo() {
return oldCouponNo;
}
public void setOldCouponNo(String oldCouponNo) {
this.oldCouponNo = oldCouponNo;
if(oldCouponNo == null){
removeValidField("oldCouponNo");
return;
}
addValidField("oldCouponNo");
}
@Column(name = "NEW_COUPON_ID")
public Integer getNewCouponId() {
return newCouponId;
}
public void setNewCouponId(Integer newCouponId) {
this.newCouponId = newCouponId;
if(newCouponId == null){
removeValidField("newCouponId");
return;
}
addValidField("newCouponId");
}
@Column(name = "NEW_COUPON_NO")
public String getNewCouponNo() {
return newCouponNo;
}
public void setNewCouponNo(String newCouponNo) {
this.newCouponNo = newCouponNo;
if(newCouponNo == null){
removeValidField("newCouponNo");
return;
}
addValidField("newCouponNo");
}
@Column(name = "RECHARGE_USER")
public Integer getRechargeUser() {
return rechargeUser;
}
public void setRechargeUser(Integer rechargeUser) {
this.rechargeUser = rechargeUser;
if(rechargeUser == null){
removeValidField("rechargeUser");
return;
}
addValidField("rechargeUser");
}
@Column(name = "RECHARGE_PLACE")
public Integer getRechargePlace() {
return rechargePlace;
}
public void setRechargePlace(Integer rechargePlace) {
this.rechargePlace = rechargePlace;
if(rechargePlace == null){
removeValidField("rechargePlace");
return;
}
addValidField("rechargePlace");
}
} | [
"[email protected]"
]
| |
41422766d63c31eef1ae238cb2c691631ac4f81d | 68a171c2729aeb435f77bdfba7424dc999836055 | /src/main/java/main/io/FileWriter.java | c7894c1a14e7d9c9ae380c7e2de1dcdfc6a95883 | []
| no_license | AmosforYu/TransTool | 76e899f0b7f2e7a598af00ce2a28cf50109b10b1 | e8e08cf2d5def5aeb3c2042233ed6d517988fc14 | refs/heads/master | 2020-04-14T02:17:21.528705 | 2018-12-30T10:42:29 | 2018-12-30T10:42:29 | 163,579,934 | 1 | 0 | null | 2018-12-30T10:44:49 | 2018-12-30T10:44:48 | null | UTF-8 | Java | false | false | 770 | java | package main.io;
import java.io.File;
import java.io.IOException;
/**
* Create By Mr.Han
* ------ On 2018/12/22 13:41
*/
public class FileWriter {
public static boolean writer(String path, String out) {
File outFile = null;
try {
String outPath = path.replace("\\game\\", "\\trans\\");
outFile = new File(outPath);
if (outFile.exists()) outFile.delete();
outFile.createNewFile();
java.io.FileWriter writer = new java.io.FileWriter(outPath);
writer.write(out);
writer.close();
return true;
}catch (Exception e){
e.printStackTrace();
return false;
}
}
}
| [
"[email protected]"
]
| |
3d81225d9ac1202ee44b02014225d4070d111df9 | 83b67e767a30020840f5055365e19806fb1c80ad | /app/src/test/java/com/social/boldbuddy/ExampleUnitTest.java | da3a8f48d587c68c60f7d40f00ee8f2f2a4557ac | []
| no_license | anantprsd5/Bold-Buddy | d98d098857db09a90b10a38782c542c1d10e803d | af882bc7b39d5bade70451f8e320d5a547fbf04e | refs/heads/master | 2020-12-26T21:31:59.519556 | 2020-02-01T17:34:01 | 2020-02-01T17:34:01 | 237,650,725 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 414 | java | package com.social.boldbuddy;
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);
}
} | [
"[email protected]"
]
| |
5d38ca7b8498f2fda3b1cdb3fd03282f6b18f2f0 | 9bb171fb5c6566bbc653c74516ec47a69013d36c | /TestSeleniumParkingBooking/test/selenium/log/Messages.java | d4460b16ca42b13f75ec425e5fe2818ddb89514d | []
| no_license | DimJarn/TestSeleniumParkingBooking | 74df650c5826196811857d42d92acf82f291d0c0 | 8904ce0587cee7e32a49a75a73ef3e20b063a649 | refs/heads/master | 2020-03-08T00:56:39.180153 | 2018-04-03T15:41:34 | 2018-04-03T15:41:34 | 127,817,498 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 516 | java | package selenium.log;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
public class Messages {
private static final String BUNDLE_NAME = "selenium.log.messages"; //$NON-NLS-1$
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
private Messages() {}
public static String getString(String key) {
try {
return RESOURCE_BUNDLE.getString(key);
} catch (MissingResourceException e) {
return '!' + key + '!';
}
}
}
| [
"[email protected]"
]
| |
94ac9ca947f4cf11938c8d8d051b691e14218d5b | eab41d6e74f2653b894f3dfb68dcae1defa4dd18 | /aidlcline/src/main/java/com/cfox/aidlcline/MainActivity.java | b569b46206f08922fe05b773f89f7ffd915ea710 | []
| no_license | mm-sgf/AidlSimple | ee6b7d042e0a09e31c73b4e45cdaffe0955ab673 | 0fcdb974482cd848f2a34ba3446910f33ba0bcee | refs/heads/master | 2023-07-09T14:20:47.326911 | 2021-08-22T12:31:31 | 2021-08-22T12:31:31 | 398,794,490 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,051 | java | package com.cfox.aidlcline;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.IBinder;
import android.os.RemoteException;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import androidx.appcompat.app.AppCompatActivity;
import com.cfox.aidllibrary.IAIDLService;
import com.cfox.aidllibrary.bean.ProcessUserBean;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
public class MainActivity extends AppCompatActivity {
private static final String TAG = "ProcessActivity";
private Button mBtnStart,mBtnStop,mBtnGetData,mBtnSetData;
private IAIDLService iaidlService;
private ServiceConnection conn;
private class MyConn implements ServiceConnection{
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
iaidlService = IAIDLService.Stub.asInterface(service);
}
@Override
public void onServiceDisconnected(ComponentName name) {
iaidlService = null;
}
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mBtnStart = (Button) findViewById(R.id.btn_start_service);
mBtnStart.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent("com.cfox.myprocess");
intent.setPackage("com.cfox.aidlservice");
conn = new MyConn();
bindService(intent,conn, Context.BIND_AUTO_CREATE);
}
});
mBtnStop = (Button) findViewById(R.id.btn_stop_service);
mBtnStop.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
unbindService(conn);
}
});
mBtnGetData = (Button) findViewById(R.id.btn_get_data);
mBtnGetData.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
try {
showUser(iaidlService.getUser());
} catch (RemoteException e) {
e.printStackTrace();
}
}
});
mBtnSetData = (Button) findViewById(R.id.btn_set_data);
mBtnSetData.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
try {
iaidlService.setProcessUser(createUser());
} catch (RemoteException e) {
e.printStackTrace();
}
}
});
}
private ProcessUserBean createUser(){
ProcessUserBean user = new ProcessUserBean();
user.setName("张三");
user.setAge(58);
List<String> list = new ArrayList<String>();
list.add("good good ");
user.setList(list);
Map<String,String> map = new HashMap<String,String>();
map.put("addr","beijing");
user.setMap(map);
return user;
}
private void showUser(ProcessUserBean user){
String name = user.getName();
Log.e(TAG,"ProcessActivity UserInfo Name:" + name);
int age = user.getAge();
Log.e(TAG,"ProcessActivity UserInfo age:" + age);
List<String> listString = user.getList();
for(int i = 0 ; i < listString.size(); i ++){
Log.e(TAG,"ProcessActivity UserInfo list:" + listString.get(i));
}
Map<String,String> map = user.getMap();
Set<String> keys = map.keySet();
for(String key : keys){
String value = map.get(key);
Log.e(TAG,"ProcessActivity UserInfo Map->key:" + key + ";value" + map.get(key));
}
}
}
| [
"[email protected]"
]
| |
ec08ad4d1e832dfdc8f9aee2a2e908ec713b4a20 | 78ea798f59d27ee45aaa8ea341848724fe3fc8d1 | /app/src/main/java/com/wechat/files/cleaner/videoclean/holder/VideoCleanViewHolder.java | f632679fd299e82f7f97cd5b8a84432a76d99c7e | [
"Apache-2.0"
]
| permissive | Yuangudashen/DavidInChina-Cleaner | d217c5b7cc3954fca7354054ff25e6ecc2964afb | 699af9a3a988da90e0737b26e82ce65449c106e5 | refs/heads/master | 2022-04-15T15:31:17.323481 | 2020-04-12T15:29:47 | 2020-04-12T15:29:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,188 | java | package com.wechat.files.cleaner.videoclean.holder;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.wechat.files.cleaner.R;
import com.wechat.files.cleaner.videoclean.bean.CleanVideoHeadInfo;
import butterknife.BindView;
import butterknife.ButterKnife;
public class VideoCleanViewHolder extends RecyclerView.ViewHolder {
@BindView(R.id.icon)
public ImageView mAppIcon;
@BindView(R.id.title)
public TextView mTitle;
@BindView(R.id.tvItemSize)
public TextView tvItemSize;
@BindView(R.id.progress)
public ProgressBar mProgressBar;
@BindView(R.id.linWrapper)
public LinearLayout linWrapper;
public VideoCleanViewHolder(View itemView) {
super(itemView);
ButterKnife.bind(this, itemView);
linWrapper.setOnClickListener(v -> {
CleanVideoHeadInfo info = (CleanVideoHeadInfo) v.getTag();
if (null != info && info.getSize() > 0) {
// category.goCategoryDetail(v.getContext());
}
});
}
} | [
"[email protected]"
]
| |
6c1de33ba4bc89db10ea2bb20c15a88fb8dd9b68 | 59d56ad52a7e016883b56b73761104a17833a453 | /src/main/java/com/whatever/MoleculeService/SearchActivePrincipleByProductIdResponse.java | 9e674f7e960e059f295ce17c9cfac8faf65a7952 | []
| no_license | zapho/cxf-client-quarkus | 3c330a3a5f370cce21c5cd1477ffbe274d1bba59 | 6e147d44b9ea9cc455d52f0efe234ef787b336c4 | refs/heads/master | 2023-01-22T03:33:27.579072 | 2020-12-08T14:55:27 | 2020-12-08T14:55:27 | 319,641,033 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,624 | java |
package com.whatever.MoleculeService;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Classe Java pour anonymous complex type.
*
* <p>Le fragment de schéma suivant indique le contenu attendu figurant dans cette classe.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="moleculeList" type="{urn:Vidal}ArrayOfMolecule"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"moleculeList"
})
@XmlRootElement(name = "searchActivePrincipleByProductIdResponse")
public class SearchActivePrincipleByProductIdResponse {
@XmlElement(required = true, nillable = true)
protected ArrayOfMolecule moleculeList;
/**
* Obtient la valeur de la propriété moleculeList.
*
* @return
* possible object is
* {@link ArrayOfMolecule }
*
*/
public ArrayOfMolecule getMoleculeList() {
return moleculeList;
}
/**
* Définit la valeur de la propriété moleculeList.
*
* @param value
* allowed object is
* {@link ArrayOfMolecule }
*
*/
public void setMoleculeList(ArrayOfMolecule value) {
this.moleculeList = value;
}
}
| [
"[email protected]"
]
| |
7fb2b274c7d4df8f96b94d7ac3f9306850044c5a | 49348b036c07fef433a3b005366222455e18300d | /src/main/java/com/clockworkjava/kursspring/domain/DuelingKnight.java | 360fac48803d0aee422636365ecbaf1d92f1c47b | []
| no_license | pkornijasz/kursspring | 9f278f9d3a755e693543c22e598a15ac661948d1 | ce07eaeeca200fd80d0f951942a6ce5042691db9 | refs/heads/master | 2023-02-24T21:00:36.718358 | 2021-01-31T17:58:05 | 2021-01-31T17:58:05 | 333,349,332 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 174 | java | package com.clockworkjava.kursspring.domain;
public class DuelingKnight extends Knight {
public DuelingKnight(String name, int age) {
super(name, age);
}
}
| [
"[email protected]"
]
| |
fbce92da1caf48ff394c2e55108a1085a2f88ead | 937bbb750b99e3000d38b9a1130fd0b7af53638c | /cybernet/src/com/mortrag/lsb/cybernet/net/RemoteMsgManager.java | 2ef709659694325b241358f499a507170f10de65 | [
"MIT"
]
| permissive | mbforbes/cybernet | c0b68c1572ac8295149fe33adf0a10d9969df26f | 92d32eea404f72dd2665fd52f638ab80d5cf2386 | refs/heads/master | 2021-01-10T22:09:57.949646 | 2014-04-21T20:04:32 | 2014-04-21T20:04:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,060 | java | package com.mortrag.lsb.cybernet.net;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Net;
import com.badlogic.gdx.net.ServerSocket;
import com.badlogic.gdx.net.Socket;
import com.badlogic.gdx.utils.GdxRuntimeException;
import com.mortrag.lsb.cybernet.Level_GlobalChat;
public class RemoteMsgManager {
// --------------------------------------------------------------------------------------------
// GENERAL
// --------------------------------------------------------------------------------------------
// Settings
private static final String TAG = "RemoteMsgManager";
public static final int CYBERNET_SERVER_PORT = 25565; // Minecraft! :-)
public static final String MAX_IP = "67.170.49.252";
private static final int SOCKET_WAIT_TIME_MS = 100;
// Commands
public static final String CLIENT_SEND_CMD = "/cs";
public static final String CLIENT_EOF_CMD = "/eof";
public static final String SERVER_START_CMD = "/server";
public static final String SERVER_SEND_CMD = "/ss";
public static final String SERVER_EXIT_CMD = "/exit";
// NOTE: Manually closing client not yet implemente.d
public RemoteMsgManager() {
clientReceived = new StringBuilder();
serverReceived = new StringBuilder();
serverToSend = new StringBuilder();
}
// --------------------------------------------------------------------------------------------
// Client
// --------------------------------------------------------------------------------------------
private boolean shutdownClient = false;
private Socket clientSocket = null;
private StringBuilder clientReceived = null;
private class ClientListensToServer extends Thread {
private final String TAG = RemoteMsgManager.TAG + ":" + "ClientListensToServer";
@Override
public void run() {
if (clientSocket == null || !clientSocket.isConnected()) {
Gdx.app.log(TAG, "Can't start " + TAG + " when not connected! Exiting.");
return;
}
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(
clientSocket.getInputStream()));
Gdx.app.log(TAG, "Client ready to receive ACKs from Server.");
boolean serverClosed = false;
while(!getShutdownClient() && clientSocket != null &&
clientSocket.isConnected() && !serverClosed) {
String msg = reader.readLine();
if (msg == null) {
serverClosed = true;
} else {
Gdx.app.log(TAG, "Got msg from server: " + msg);
clientReceived.append(msg + Level_GlobalChat.NL);
}
}
} catch (IOException e) {
Gdx.app.log(TAG, "Client got IOException reading from server.", e);
} catch (Exception e) {
Gdx.app.log(TAG, "Client got unexpected exception.", e);
} finally {
if (clientSocket != null) {
clientSocket.dispose();
clientSocket = null;
}
clientHasBeenShutDown();
}
}
}
public synchronized String getClientText() {
if (clientReceived.length() > 0) {
String ret = clientReceived.toString();
clientReceived.delete(0, clientReceived.length());
return ret;
} else {
return null;
}
}
public void connectToServer(String ip) {
if (clientSocket != null && clientSocket.isConnected()) {
Gdx.app.log(TAG, "Client is already connected!");
}
// try to connect
try {
clientSocket = Gdx.net.newClientSocket(Net.Protocol.TCP,
ip, CYBERNET_SERVER_PORT, null);
Gdx.app.log(TAG, "Client connected to server.");
// Start listening to ensure we get responses.
new ClientListensToServer().start();
} catch (GdxRuntimeException e) {
Gdx.app.log(TAG, "Client couldn't connect to server");
if (clientSocket != null) {
clientSocket.dispose();
clientSocket = null;
}
}
}
public void sendMsgToServer(String ip, String raw_msg) {
// If we're not connected, connect.
if (clientSocket == null || !clientSocket.isConnected()) {
connectToServer(ip);
}
// If we're still not connected, there's probably a problem.
if (clientSocket == null || !clientSocket.isConnected()) {
Gdx.app.log(TAG, "Couldn't send message as couldn't connect to server");
return;
}
// Try to write a message.
String msg = raw_msg + Level_GlobalChat.NL; // add newline so we can use readline(...)
try {
clientSocket.getOutputStream().write(msg.getBytes());
Gdx.app.log(TAG, "Client sent msg to server: " + raw_msg);
} catch (GdxRuntimeException e){
Gdx.app.log(TAG, e.getMessage(), e);
} catch (IOException e) {
Gdx.app.log(TAG, e.getMessage(), e);
}
}
private synchronized boolean getShutdownClient() {
return shutdownClient;
}
public synchronized void shutdownClient() {
Gdx.app.log(TAG, "Shutting down client");
shutdownClient = true;
}
private synchronized void clientHasBeenShutDown() {
Gdx.app.log(TAG, "Client has been shut down");
shutdownClient = false;
}
// --------------------------------------------------------------------------------------------
// Server
// --------------------------------------------------------------------------------------------
private boolean serverRunning = false;
private boolean shutdownServer = false;
private ServerSocket serverSocket = null;
public StringBuilder serverToSend = null;
public StringBuilder serverReceived = null;
public String getServerToSend() {
synchronized (serverToSend) {
if (serverToSend.length() > 0) {
String ret = serverToSend.toString();
serverToSend.delete(0, serverToSend.length());
return ret;
} else {
return null;
}
}
}
public synchronized String getServerText() {
if (serverReceived.length() > 0) {
String ret = serverReceived.toString();
serverReceived.delete(0, serverReceived.length());
return ret;
} else {
return null;
}
}
public void addToServerToSend(String s) {
synchronized (serverToSend) {
serverToSend.append(s);
}
}
public void setupServer() {
if (serverRunning) {
Gdx.app.log(TAG, "Server already running--not starting.");
return;
}
Gdx.app.log(TAG, "Setting up server...");
new Thread(new Runnable() {
@Override
public void run() {
serverSocket = null;
try {
serverSocket = Gdx.net.newServerSocket(Net.Protocol.TCP, CYBERNET_SERVER_PORT,
null);
while(!getShutdownServer()) {
Socket serverChannel = null;
Gdx.app.log(TAG, "Server waiting for incoming connections...");
serverChannel = serverSocket.accept(null);
Gdx.app.log(TAG, "Server got connection from client");
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(
serverChannel.getInputStream()));
boolean exit = false;
while (!exit && !getShutdownServer()) {
// Check sending / send.
String toSend = getServerToSend();
if (toSend != null) {
serverSend(serverChannel, toSend);
}
// Check receipt / receive.
synchronized (serverChannel) {
if (!reader.ready()) {
// If not ready, wait so we can check shutdown again.
try {
serverChannel.wait(SOCKET_WAIT_TIME_MS);
} catch (InterruptedException e) {
// Do nothing
}
} else {
// Ready to read a msg; do it.
String msg = reader.readLine();
if (msg == null) {
// if this happens, reader can be "ready" only to have
// readLine() return null for EOF. Good to know.
Gdx.app.log(TAG, "Server readline() got null. Exiting");
exit = true;
}
if (msg.indexOf(CLIENT_EOF_CMD) > -1) {
// Client told us to stop.
Gdx.app.log(TAG,
"Server got exit command from client. Exiting");
exit = true;
} else {
// "Normal" case: got msg!
Gdx.app.log(TAG, "Server got msg: " + msg);
serverReceived.append(msg + Level_GlobalChat.NL);
//serverAck(serverChannel, msg);
}
}
}
}
// Connection ended
// ----------------
} catch (IOException e) {
Gdx.app.log(TAG, "Problem with current connection.", e);
} finally {
if (serverChannel != null) {
Gdx.app.log(TAG, "Disposing of sever channel (socket).");
serverChannel.dispose();
}
}
}
// Server shutdown
// ---------------
} catch (GdxRuntimeException e) {
Gdx.app.log(TAG,
"GdxRuntimeExceptoin means likely problem with seversocket",
e);
} catch (NullPointerException e) {
Gdx.app.log(TAG,
"ServerSocket probably not created correctly; NullPointerException",
e);
} finally {
if (serverSocket != null) {
Gdx.app.log(TAG, "Disposing of server acceptor socket entirely.");
serverSocket.dispose();
}
}
// Server has shut down--turn the flag off so that future servers can be shut down.
serverHasBeenShutDown();
}
}).start();
serverRunning = true;
}
public void serverSend(Socket serverChannel, String msg) {
if (serverChannel == null || !serverChannel.isConnected()) {
Gdx.app.log(TAG, "Server couldn't send msg ("+ msg + "); not connected.");
return;
}
try {
String msg_w_newline = msg + Level_GlobalChat.NL;
serverChannel.getOutputStream().write(msg_w_newline.getBytes());
Gdx.app.log(TAG, "Server sent msg (" + msg + ").");
} catch (IOException e) {
Gdx.app.log(TAG, "Server encountered problem sending msg (" + msg + ").", e);
}
}
public void serverAck(Socket serverChannel, String receivedMsg) {
serverSend(serverChannel, "ACK: " + receivedMsg);
}
// TODO look up synchronized methods to confirm or deny suspicions.
// TODO make these Booleans and lock on them, not synrhconized methods.
private synchronized boolean getShutdownServer() {
return shutdownServer;
}
public synchronized void shutdownServer() {
Gdx.app.log(TAG, "Shutting down server");
shutdownServer = true;
}
private synchronized void serverHasBeenShutDown() {
Gdx.app.log(TAG, "Server has been shut down");
shutdownServer = false;
serverRunning = false;
}
// --------------------------------------------------------------------------------------------
// Cooper thread :-)
// --------------------------------------------------------------------------------------------
public void getMsgsFromMax() {
new GetMsgsFromMax().start();
}
public class GetMsgsFromMax extends Thread {
private final String TAG = RemoteMsgManager.TAG + ":" + "GetMsgsFromMax";
@Override
public void run() {
synchronized (this) {
while (true) {
// NEED to enforce invariant that socket gets set to null when closed.
if (clientSocket == null) {
connectToServer(RemoteMsgManager.MAX_IP);
}
try {
this.wait(1000); // just check every second
} catch (InterruptedException e) {
// It's OK if we're interrupted; just continue.
}
}
}
}
}
}
| [
"[email protected]"
]
| |
89946cf3d902862db84d1de1e03c78dfbc2045bd | ffc46b46dfe9da48089fcdf8a33357a0965f3344 | /src/main/java/com/appsflyer/helloworld/services/MapService.java | 510e37d60bf00df38168756ec01f73e01c07251e | []
| no_license | SergeyVinickiy/hello-world | 0fa8c8dcb131e5eeb8fb166bff3ca4be75a976ec | b8d37b634312312257f4f5149e7e880f3b5de572 | refs/heads/master | 2022-12-26T18:53:21.426480 | 2020-06-10T19:15:37 | 2020-06-10T19:15:37 | 129,531,662 | 0 | 0 | null | 2018-04-14T16:36:04 | 2018-04-14T15:52:59 | null | UTF-8 | Java | false | false | 410 | java | package com.appsflyer.helloworld.services;
import com.appsflyer.helloworld.entities.Client;
import lombok.Getter;
import lombok.Setter;
import org.springframework.stereotype.Service;
import java.util.concurrent.ConcurrentHashMap;
@Service
@Getter
@Setter
public class MapService {
ConcurrentHashMap<Integer, Client> map;
public MapService() {
this.map = new ConcurrentHashMap<>();
}
}
| [
"[email protected]"
]
| |
c29a3c9f5e82a7adda831ffcb12b6508e7c9586c | 74d7f8c7467926b715b2ea36bae77c43d4c83765 | /eu.jgen.notes.dmw.lite.base/src-gen/eu/jgen/notes/dmw/lite/base/lang/impl/YArgumentImpl.java | 3f765fd0ce3953806ee75d70892bea9b5f3f72a3 | []
| no_license | JGen-Notes/DMW-Lite-Plus | 93f0845ec5d4e46c0c56d5d4bb4e0bc024b16dc0 | faee562442c920c47de43da276921e838bad257f | refs/heads/master | 2021-07-18T16:11:35.448963 | 2020-05-14T18:00:27 | 2020-05-14T18:00:27 | 160,064,800 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,241 | java | /**
* generated by Xtext 2.21.0
*/
package eu.jgen.notes.dmw.lite.base.lang.impl;
import eu.jgen.notes.dmw.lite.base.lang.LangPackage;
import eu.jgen.notes.dmw.lite.base.lang.YArgument;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>YArgument</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link eu.jgen.notes.dmw.lite.base.lang.impl.YArgumentImpl#getName <em>Name</em>}</li>
* <li>{@link eu.jgen.notes.dmw.lite.base.lang.impl.YArgumentImpl#getValue <em>Value</em>}</li>
* </ul>
*
* @generated
*/
public class YArgumentImpl extends MinimalEObjectImpl.Container implements YArgument
{
/**
* The default value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected static final String NAME_EDEFAULT = null;
/**
* The cached value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected String name = NAME_EDEFAULT;
/**
* The default value of the '{@link #getValue() <em>Value</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getValue()
* @generated
* @ordered
*/
protected static final String VALUE_EDEFAULT = null;
/**
* The cached value of the '{@link #getValue() <em>Value</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getValue()
* @generated
* @ordered
*/
protected String value = VALUE_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected YArgumentImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return LangPackage.Literals.YARGUMENT;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String getName()
{
return name;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setName(String newName)
{
String oldName = name;
name = newName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, LangPackage.YARGUMENT__NAME, oldName, name));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String getValue()
{
return value;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setValue(String newValue)
{
String oldValue = value;
value = newValue;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, LangPackage.YARGUMENT__VALUE, oldValue, value));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case LangPackage.YARGUMENT__NAME:
return getName();
case LangPackage.YARGUMENT__VALUE:
return getValue();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case LangPackage.YARGUMENT__NAME:
setName((String)newValue);
return;
case LangPackage.YARGUMENT__VALUE:
setValue((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case LangPackage.YARGUMENT__NAME:
setName(NAME_EDEFAULT);
return;
case LangPackage.YARGUMENT__VALUE:
setValue(VALUE_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case LangPackage.YARGUMENT__NAME:
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
case LangPackage.YARGUMENT__VALUE:
return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value);
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString()
{
if (eIsProxy()) return super.toString();
StringBuilder result = new StringBuilder(super.toString());
result.append(" (name: ");
result.append(name);
result.append(", value: ");
result.append(value);
result.append(')');
return result.toString();
}
} //YArgumentImpl
| [
"[email protected]"
]
| |
ff64eb23ba1411cdff75fd356df1763c036e1331 | f309d6f854d03b39f80d5b3850fa0fa7a1e609a3 | /z-helper-quartz/src/main/java/org/zipper/helper/quartz/consumer/JobConsumer.java | a86797aee7e67a1704eec3b4121916d5cf19232f | []
| no_license | Zxj19951031/z-helper | d7868fd6c00eb5b5bd21576446ac021fa24f3cc7 | a64edfd4849530cae0fe3db0af3eef69569d305b | refs/heads/master | 2022-12-17T19:28:35.979712 | 2020-08-20T02:50:39 | 2020-08-20T02:50:39 | 275,718,057 | 0 | 0 | null | 2020-07-12T04:20:24 | 2020-06-29T03:09:44 | Java | UTF-8 | Java | false | false | 166 | java | package org.zipper.helper.quartz.consumer;
import org.quartz.Job;
/**
* 一般任务
*
* @author zhuxj
*/
public abstract class JobConsumer implements Job {
}
| [
"[email protected]"
]
| |
69a4145e25ac8a97ca9a01c2fa4ca0b52a1d9364 | 777750ac7bf400ad21b77ed4b8f613e01de77d0a | /ats/src/main/java/ny2/ats/information/impl/InformationManagerImpl.java | 16eab4564d4f082dc24425d016e49cf28f3b1923 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
]
| permissive | leetoo/FX-AlgorithmTrading | 6ef4b7fdf98f311cbd7c99a95c08aa522d40664a | 92fbd48855f136c4f8f4a4c9b1744bdd46c78c57 | refs/heads/master | 2021-01-21T10:13:49.059419 | 2015-10-06T21:23:21 | 2015-10-06T21:23:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,401 | java | package ny2.ats.information.impl;
import java.io.IOException;
import java.net.URL;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.TreeMap;
import java.util.jar.Attributes;
import java.util.jar.Manifest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
import org.springframework.core.env.MutablePropertySources;
import org.springframework.core.env.PropertiesPropertySource;
import org.springframework.core.env.PropertySource;
import org.springframework.jmx.export.annotation.ManagedOperation;
import org.springframework.jmx.export.annotation.ManagedResource;
import org.springframework.stereotype.Service;
import ny2.ats.core.event.SystemInformationEvent;
import ny2.ats.core.router.IEventRouter;
import ny2.ats.information.IInformationManager;
@Service
@ManagedResource(objectName = "InformationService:name=InformationManager")
public class InformationManagerImpl implements IInformationManager {
// //////////////////////////////////////
// Field
// //////////////////////////////////////
// Logger
private final Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private IEventRouter eventRouter;
@Autowired
private ApplicationContext applicationContext;
// バージョン情報(MINIFESTから取得)
private static final String APP_TITLE = "algorithm-trading-system";
private String version;
private String buildTime;
// //////////////////////////////////////
// Constructor
// //////////////////////////////////////
public InformationManagerImpl() {
readManifest();
}
// //////////////////////////////////////
// Method
// //////////////////////////////////////
@Override
public void sendEvent(SystemInformationEvent informationEvent) {
logger.info("Send Information : {}", informationEvent.getContent().toStringSummary());
eventRouter.addEvent(informationEvent);
}
/**
* MINIFEST.MF からバージョン情報を読み取ります
*/
private void readManifest() {
try {
Enumeration<URL> resources = getClass().getClassLoader().getResources("META-INF/MANIFEST.MF");
while (resources.hasMoreElements()) {
Manifest manifest = new Manifest(resources.nextElement().openStream());
Attributes attributes = manifest.getMainAttributes();
String title = attributes.getValue("Implementation-Title");
if (APP_TITLE.equals(title)) {
version = attributes.getValue("Implementation-Version");
buildTime = attributes.getValue("Build-Time");
break;
}
}
} catch (IOException e) {
logger.error("", e);
}
}
// //////////////////////////////////////
// Method - JMX
// //////////////////////////////////////
/**
* BeanDefinitionNamesを表示します
*
* @return
*/
@ManagedOperation
public String showBeanDefinition() {
StringBuilder sb = new StringBuilder("[BeanDefinition]\n");
for (String name : applicationContext.getBeanDefinitionNames()) {
sb.append(name).append("\n");
}
return sb.toString();
}
/**
* BeanDefinitionNamesを表示します
*
* @return
*/
@ManagedOperation
public String showPropertySources() {
StringBuilder sb = new StringBuilder("[PropertySources]\n");
MutablePropertySources propertySources = (MutablePropertySources) applicationContext.getBean(PropertySourcesPlaceholderConfigurer.class).getAppliedPropertySources();
Iterator<PropertySource<?>> iterator = propertySources.iterator();
while(iterator.hasNext()) {
PropertySource<?> source = iterator.next();
if (source instanceof PropertiesPropertySource) {
// PropertiesPropertySource
// sort for display
Map<String, Object> propertyMap = new TreeMap<>();
for (Entry<String, Object> entry : ((PropertiesPropertySource) source).getSource().entrySet()) {
propertyMap.put(entry.getKey(), entry.getValue());
}
for (Entry<String, Object> entry : propertyMap.entrySet()) {
sb.append(entry.getKey()).append("=").append(entry.getValue()).append("\n");
}
} else {
// environmentProperties
sb.append(source.getName()).append("=").append(source.getSource().toString()).append("\n");
}
}
return sb.toString();
}
/**
* アプリケーションのバージョンを表示します
*
* @return
*/
@ManagedOperation
public String showAppVersion() {
StringBuilder sb = new StringBuilder("[AppVersion]\n");
sb.append("title : ").append(APP_TITLE).append("\n");
sb.append("version : ").append(version).append("\n");
sb.append("build-time : ").append(buildTime).append("\n");
return sb.toString();
}
}
| [
"[email protected]"
]
| |
357a5056c64a4d3f3498ed8704d8f1f1e8fc31af | 57709ebdb3003fc711b7ee93418b324f42f66702 | /src/com/xunku/dao/office/EventWarnDao.java | 39e7e025de31e2f8af5f7f11d522b1a5a0309081 | []
| no_license | jacky2016/twitter1.0 | 34ea88498821fb2ecad3cb5e9563394d26f65156 | 8698cd7aa70dd3ead5821a621e08301de40f14e7 | refs/heads/master | 2020-03-07T20:30:14.880639 | 2018-04-02T04:01:20 | 2018-04-02T04:01:20 | 127,699,192 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,503 | java | package com.xunku.dao.office;
import java.util.List;
import com.xunku.pojo.base.Pager;
import com.xunku.pojo.office.EventWarn;
import com.xunku.utils.Pagefile;
public interface EventWarnDao {
void changeRunning(int eventid, int customid, boolean running);
/**
* 功能描述<添加事件预警>
*
* @author wanghui
* @param void
* @return boolean
* @version twitter 1.0
* @date Aug 29, 20141:43:20 PM
*/
int insert(EventWarn ew);
/**
* 功能描述<删除事件预警>
*
* @author wanghui
* @param void
* @return boolean
* @version twitter 1.0
* @date Aug 29, 20141:43:48 PM
*/
boolean deleteById(int ewid);
/**
* 功能描述<更新事件预警>
*
* @author wanghui
* @param void
* @return boolean
* @version twitter 1.0
* @date Aug 29, 20141:44:02 PM
*/
boolean update(EventWarn ew);
/**
* 功能描述<获取客户下事件预警>
*
* @author wanghui
* @param void
* @return List<EventWarn>
* @version twitter 1.0
* @date Aug 29, 20141:44:19 PM
*/
List<EventWarn> queryEventWarnList(int customid);
/**
* 获得指定客户下的事件预警分页列表
*
* @param customid
* @param pager
* @return
*/
Pagefile<EventWarn> queryEventWarnList(int customid, Pager pager);
/**
* 功能描述<通过事件id获取事件预警>
*
* @author wanghui
* @param void
* @return EventWarn
* @version twitter 1.0
* @date Sep 12, 201411:37:11 AM
*/
EventWarn queryEventByEventid(int eventid);
}
| [
"[email protected]"
]
| |
6af61262fec00f783195df1bf13bf84af747b0ca | f5049214ff99cdd7c37da74619b60ac4a26fc6ba | /runtime/db/eu.agno3.runtime.db/src/main/java/eu/agno3/runtime/db/DataSourceUtil.java | f2383be0653dfc39f0549097f6f590a0e7a59169 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
]
| permissive | AgNO3/code | d17313709ee5db1eac38e5811244cecfdfc23f93 | b40a4559a10b3e84840994c3fd15d5f53b89168f | refs/heads/main | 2023-07-28T17:27:53.045940 | 2021-09-17T14:25:01 | 2021-09-17T14:31:41 | 407,567,058 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 3,207 | java | /**
* © 2014 AgNO3 Gmbh & Co. KG
* All right reserved.
*
* Created: 09.01.2014 by mbechler
*/
package eu.agno3.runtime.db;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.UUID;
/**
* @author mbechler
*
*/
public interface DataSourceUtil {
/**
* @return metadata for the datasource
*/
DataSourceMetaData createMetadata ();
/**
* Check whether a schema exists
*
* @param catalog
* @param schema
* @return whether given schema exists
* @throws DatabaseException
*/
boolean schemaExists ( String catalog, String schema ) throws DatabaseException;
/**
* Make sure a database schema exists
*
* @param catalog
* @param schema
* @throws DatabaseException
*/
void ensureSchemaExists ( String catalog, String schema ) throws DatabaseException;
/**
* Create a schema
*
* @param catalog
* @param schema
* @throws DatabaseException
*/
void createSchema ( String catalog, String schema ) throws DatabaseException;
/**
* Drop a schema
*
* Contained objects must be dropped first, you may use {@link #clearSchema(String, String)} for this.
*
* @param catalog
* @param schemaName
* @throws DatabaseException
*/
void dropSchema ( String catalog, String schemaName ) throws DatabaseException;
/**
* Set the connection default schema
*
* @param conn
* @param catalog
* @param schemaName
* @throws DatabaseException
*/
void setConnectionDefaultSchema ( Connection conn, String catalog, String schemaName ) throws DatabaseException;
/**
* Remove all objects from the given schema
*
* @param catalog
* @param schema
* @throws DatabaseException
*/
void clearSchema ( String catalog, String schema ) throws DatabaseException;
/**
* Remove all objects from the database
*
* @param catalog
* @throws DatabaseException
*/
void clearDatabase ( String catalog ) throws DatabaseException;
/**
* Escapes a database identifier (e.g. schema, table name) for use in a query
*
* @param conn
* @param schema
* @return the escaped identifier
* @throws DatabaseException
*/
String quoteIdentifier ( Connection conn, String schema ) throws DatabaseException;
/**
*
* @return whether locking is supported
* @throws DatabaseException
*/
boolean lockDatabase () throws DatabaseException;
/**
*
* @throws DatabaseException
*/
void unlockDatabase () throws DatabaseException;
/**
* @return the validation query to use
*/
String getValidationQuery ();
/**
* @param ps
* @param i
* @param uuid
* @throws SQLException
*/
void setParameter ( PreparedStatement ps, int i, UUID uuid ) throws SQLException;
/**
* @param rs
* @param i
* @return uuid
* @throws SQLException
*/
UUID extractUUID ( ResultSet rs, int i ) throws SQLException;
}
| [
"[email protected]"
]
| |
a38824fd62ec8d4bcbb2118ec71274027ebf7c0b | 7a938f1c155498b8fdece0204c886d72963bad0a | /app/src/test/java/br/senac/waterreservoir/ExampleUnitTest.java | ed4519beaa00d1e165a81e559a835b3b39e9112d | []
| no_license | fredw/senac-tcs-android | 1221eb1615f8d1f27e54a9a4a8dd18941792471d | cd718ec8b6543013740026c65f0048977873a4f6 | refs/heads/master | 2021-01-21T14:16:33.322086 | 2017-06-30T17:59:21 | 2017-06-30T17:59:21 | 95,259,536 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 401 | java | package br.senac.waterreservoir;
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);
}
} | [
"[email protected]"
]
| |
a853604fa0747f96ea9259aa1d69b076207ef7e0 | 90dfb85fd0a2756445c6c555a9d3cbf522bd6596 | /src/data/model/ComputePair.java | 955609825d860d8fd0beda7d080dfa9a10b39483 | []
| no_license | denisurusov/opt | 19e772594a42d8efe7143a8fda2e67665b6878a8 | b2bf4e526b2e3d7e66c52b673e657f6cf3532090 | refs/heads/master | 2020-04-05T10:22:13.179777 | 2018-12-03T05:18:17 | 2018-12-03T05:18:17 | 156,796,037 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 791 | java | package data.model;
public class ComputePair {
private NodeValue value;
private Function function;
public ComputePair(NodeValue runtime, Function function) {
this.value = runtime;
this.function = function;
}
public float compute() {
return (this.function.computable()) ? this.value.compute(this.function) : this.value.getCurrentValue();
}
public void set(float value) {
this.value.set(value);
}
public void reset() {
this.value.reset();
}
public float getValue() {
return this.value.getCurrentValue();
}
@Override
public String toString() {
return "ComputePair{" +
"value=" + value +
", function=" + function +
'}';
}
}
| [
"[email protected]"
]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.