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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a0fa788922de5a1e9590a9530f6b06d4f71fa8ba | 13d7d49ee87e49d2ad22306ffab5fa2e4a6b15f4 | /app/src/main/java/td/com/xiaoheixiong/activity/SelectCollectionActivity.java | 9d41089798862bd2bb08326af2708162b445fdd3 | [] | no_license | yekai0115/XiaoHeiXiong | 894fd55d0ffd32cb1e2fa024a63b3579dcb46193 | 8f991e562b88928b564a5bea6ef83966bcf9b1e4 | refs/heads/master | 2021-09-10T15:54:54.655668 | 2018-03-28T23:28:09 | 2018-03-28T23:28:09 | 126,121,096 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,624 | java | package td.com.xiaoheixiong.activity;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.content.SharedPreferences.Editor;
import android.net.Uri;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import td.com.xiaoheixiong.R;
import td.com.xiaoheixiong.Utils.MyCacheUtil;
import td.com.xiaoheixiong.dialogs.MechantsButtonDialog;
import td.com.xiaoheixiong.dialogs.OnMyDialogClickListener;
public class SelectCollectionActivity extends BaseActivity implements OnClickListener {
private TextView tv__MerchantsGathering, tv_Individual_credit, title_tv;
private String mobile, attStr, sts;
private RelativeLayout bt_main_title_right1;
private Editor editor;
private ImageView back_img, right_img;
private MechantsButtonDialog mDialog;
@Override
@SuppressLint("NewApi")
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_selectcollection);
DisplayMetrics metrics = new DisplayMetrics();
editor = MyCacheUtil.setshared(this);
getWindowManager().getDefaultDisplay().getMetrics(metrics);
mobile = MyCacheUtil.getshared(this).getString("Mobile", "");
attStr = MyCacheUtil.getshared(this).getString("MERSTS", "");
sts = MyCacheUtil.getshared(this).getString("STS", "");
initview();
}
private void initview() {
tv__MerchantsGathering = (TextView) findViewById(R.id.tv__MerchantsGathering);
tv_Individual_credit = (TextView) findViewById(R.id.tv_Individual_credit);
tv__MerchantsGathering.setOnClickListener(this);
tv_Individual_credit.setOnClickListener(this);
back_img = (ImageView) findViewById(R.id.back_img);
back_img.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
title_tv = (TextView) findViewById(R.id.title_tv);
title_tv.setText("聚合收款");
right_img = (ImageView) findViewById(R.id.right_img);
right_img.setOnClickListener(this);
}
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
switch (v.getId()) {
case R.id.tv__MerchantsGathering:
mDialog = new MechantsButtonDialog(this, "", new OnMyDialogClickListener() {
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.btn_left:
Intent it = new Intent(SelectCollectionActivity.this, selectMechatsActivity.class);
it.putExtra("Mine","0");
startActivity(it);
mDialog.dismiss();
finish();
break;
case R.id.btn_right:
Intent it1 = new Intent(SelectCollectionActivity.this, selectMechatsActivity.class);
it1.putExtra("Mine","1");
startActivity(it1);
mDialog.dismiss();
finish();
break;
case R.id.out_img:
mDialog.dismiss();
break;
}
}
});
mDialog.setCancelable(false);
mDialog.setCanceledOnTouchOutside(false);
mDialog.show();
break;
case R.id.tv_Individual_credit:
//Intent intent = new Intent(this, SelectEpayActivity.class);
// Intent intent = new Intent(this, PersonalCollectionActivity.class);
// startActivity(intent);
finish();
break;
case R.id.right_img:
call("4006118163");
break;
default:
break;
}
}
public void call(String phone) {
Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + phone));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
}
}
| [
"996188ygazhzybz"
] | 996188ygazhzybz |
fecc6c976c1188d5cfc4c15a32a77dd0e0abcfc1 | 8cbec1f4e63dd5957eb10d0b54f7ebc7c231d96e | /src/main/java/Tank.java | f9024e7eeed2f8302114b85e846420ab3b496880 | [] | no_license | Anhlaidh/Tank | 405d77ce5b0cd8e486587b4cdc2c560d2c25136f | 065b02ccd74df549f00cdbcd535fd42d91a0751a | refs/heads/main | 2023-01-10T23:06:37.185714 | 2020-11-13T09:33:46 | 2020-11-13T09:33:46 | 312,230,998 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,774 | java | import java.awt.*;
import java.awt.image.BufferedImage;
/**
* @Description:
* @author: Anhlaidh
* @date: 2020-11-12 15:32
*/
public class Tank {
int x ;
int y ;
Dir dir;
TankFrame tf = null;
private final static int SPEED = 5;
boolean isMoving = false;
BufferedImage img ;
public Tank(int x, int y, Dir dir, TankFrame tf) {
this.x = x;
this.y = y;
this.dir = dir;
this.tf = tf;
}
public Dir getDir() {
return dir;
}
public void setDir(Dir dir) {
this.dir = dir;
}
public void paint(Graphics g) {
switch (dir) {
case RIGHT:
img = ResourceMgr.tankR;
break;
case DOWN:
img = ResourceMgr.tankD;
break;
case UP:
img = ResourceMgr.tankU;
break;
case LEFT:
img = ResourceMgr.tankL;
default:
}
g.fillRect(x, y, 50, 50);
g.drawImage(img, x, y, null);
move();
}
public boolean isMoving() {
return isMoving;
}
public void setMoving(boolean moving) {
isMoving = moving;
}
private void move() {
if (!isMoving) {
return;
}
switch (dir) {
case LEFT:
x -= SPEED;
break;
case UP:
y -= SPEED;
break;
case DOWN:
y += SPEED;
break;
case RIGHT:
x += SPEED;
default:
}
}
public void fire() {
tf.bullets.add(new Bullet(x + img.getWidth() / 2 , y + img.getHeight() / 2 , dir, this.tf));
}
}
| [
"chinahantianzhao@foxmail.com"
] | chinahantianzhao@foxmail.com |
9627aa3a3db9d111ae34adab24f474dcc1f443e9 | 8b0b2fa84bad70a3455693b260928f5ab25d5a49 | /src/main/java/com/account/entity/User.java | 8dccadb9858eaf9742962e8dcab5e95fb85d15cf | [] | no_license | waris0129/AccountApplicationMVC | 6c08c41b9c00b7175cd7d4c9566cfc0b195be013 | 6d64536724a501c4925cd388cbfcd0e34c48b615 | refs/heads/main | 2023-04-24T15:34:22.576713 | 2021-05-09T21:22:16 | 2021-05-09T21:22:16 | 354,695,670 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,118 | java | package com.account.entity;
import com.account.enums.UserStatus;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.Where;
import org.hibernate.annotations.WhereJoinTable;
import javax.persistence.*;
import javax.validation.constraints.Email;
@Entity
@Table(name = "users")
@Getter
@Setter
@NoArgsConstructor
@Where(clause = "deleted=false")
public class User extends BaseEntity{
@Email
@Column(nullable = false)
private String email;
@Column(nullable = false)
private String firstname;
@Column(nullable = false)
private String lastname;
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
private String password;
private Boolean enabled;
private String phone;
@ManyToOne
@JoinColumn(name = "company_id")
private Company company;
@ManyToOne()
@JoinColumn(name = "role_id")
private Role role;
private Boolean deleted;
@Enumerated(EnumType.STRING)
private UserStatus status;
}
| [
"waris0129@hotmail.com"
] | waris0129@hotmail.com |
95d7f6066d6e06d5226b36f755a83693f53f0cef | 9f842df2a1a5376b77c1bc0f3903450f5bc1277b | /src/main/java/io/pivotal/azap/ti/api/FieldError.java | a72b02738f6fe1fdf4b437c75972a82b41291a5e | [] | no_license | yogendra/rapid-travel-api | e6b14e129f391cbb7ef9a0bce853e50bbdf2fe47 | b128545282b5ebf2500a6f116e04a460667ac84f | refs/heads/master | 2021-06-09T14:22:32.553204 | 2021-05-22T01:27:54 | 2021-05-22T01:27:54 | 166,263,790 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 417 | java | package io.pivotal.azap.ti.api;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@AllArgsConstructor
@NoArgsConstructor
@Data
@Builder
public class FieldError {
private String path;
private String message;
private String code;
public static FieldError root(String message) {
return new FieldError("/", message, "root-object-error");
}
}
| [
"yrampuria@pivotal.io"
] | yrampuria@pivotal.io |
157e94809d93d3df5d8b45676c37a09740451080 | 3b3372abf325cde8724c9bc354f2f8f90410db07 | /app/src/main/java/com/jjaln/dailychart/wallet/Util.java | b485dea63be78032be14e6836e47c627c70b9c1e | [] | no_license | jjaln/DailyChart | 634ab1a47ef9806f5217d528db2b36d83391d2df | 483751f50dfeba4cbc839b3a148cd06f1db68964 | refs/heads/master | 2023-06-10T10:13:15.197879 | 2021-06-28T07:16:00 | 2021-06-28T07:16:00 | 366,293,170 | 5 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,446 | java | package com.jjaln.dailychart.wallet;
import android.util.Base64;
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.util.Map;
import java.util.Map.Entry;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
public class Util {
private static final String DEFAULT_ENCODING = "UTF-8";
private static final String HMAC_SHA512 = "HmacSHA512";
public static String base64Encode(byte[] bytes) {
String bytesEncoded = Base64.encodeToString(bytes, Base64.DEFAULT);
return bytesEncoded;
}
public static String hashToString(String data, byte[] key) {
String result = null;
Mac sha512_HMAC;
try {
sha512_HMAC = Mac.getInstance("HmacSHA512");
System.out.println("key : " + new String(key));
SecretKeySpec secretkey = new SecretKeySpec(key, "HmacSHA512");
sha512_HMAC.init(secretkey);
byte[] mac_data = sha512_HMAC.doFinal(data.getBytes());
System.out.println("hex : " + bin2hex(mac_data));
result = Base64.encodeToString(mac_data, Base64.DEFAULT);
} catch (Exception e) {
e.printStackTrace();
}
return result;
}
public static byte[] hmacSha512(String value, String key) {
try {
SecretKeySpec keySpec = new SecretKeySpec(
key.getBytes(DEFAULT_ENCODING), HMAC_SHA512);
Mac mac = Mac.getInstance(HMAC_SHA512);
mac.init(keySpec);
return mac.doFinal(value.getBytes(DEFAULT_ENCODING));
} catch (NoSuchAlgorithmException e) {
throw new RuntimeException(e);
} catch (InvalidKeyException e) {
throw new RuntimeException(e);
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
}
public static String asHex(byte[] bytes) {
return new String(Base64.encodeToString(bytes, Base64.DEFAULT));
}
public static String bin2hex(byte[] data) {
return String.format("%0" + (data.length * 2) + "X", new BigInteger(1, data));
}
public static String mapToQueryString(Map<String, String> map) {
StringBuilder string = new StringBuilder();
if (map.size() > 0) {
string.append("?");
}
for (Entry<String, String> entry : map.entrySet()) {
string.append(entry.getKey());
string.append("=");
string.append(entry.getValue());
string.append("&");
}
return string.toString();
}
}
| [
"matrosica0808@gmail.com"
] | matrosica0808@gmail.com |
e2b0f8b16b9e2f3c4f81f40487a0c6ce695d67db | f1f484248cb3b4763038c76b162c86cc72a006a1 | /src/main/java/com/apiumtech/wordnet/DictionaryExporter.java | c45e7db1facd70140001110e5622f6090083c5ec | [] | no_license | xavi-reloaded/java-wordnet-maven | 9ee12c0a761ec6dc929b68b19323aecc30ecad20 | 6c7c899b6be442bc4addd7586dab448a9055d1b8 | refs/heads/master | 2021-01-19T05:09:54.196479 | 2013-09-09T06:46:52 | 2013-09-09T06:46:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,937 | java | package com.apiumtech.wordnet;
import com.androidxtrem.commonsHelpers.FileHelper;
import com.google.gson.JsonObject;
import net.didion.jwnl.JWNLException;
import java.io.*;
import java.util.List;
/**
* Created with IntelliJ IDEA.
* User: xavi
* Date: 9/8/13
* Time: 9:10 PM
* To change this template use File | Settings | File Templates.
*/
public class DictionaryExporter {
private String destPath;
public DictionaryExporter(String destPath) {
this.destPath = destPath;
}
public void createTxtDictionaryMode1(String fileWithIndexPath) throws IOException, JWNLException {
String readline;
String key;
String value;
List hyponyms;
List hypernyms;
int cont=0;
JWNLWrapper wordnetWrapper = new JWNLWrapper();
final File file = new File(fileWithIndexPath);
final File fileDest = new File(destPath+"/"+file.getName());
InputStreamReader is = new InputStreamReader(new FileInputStream(file));
BufferedReader br = new BufferedReader(is);
while ((readline = br.readLine()) != null) {
key = readline.trim();
hyponyms = wordnetWrapper.getHyponymList(key);
hypernyms = wordnetWrapper.getHypernymList(key);
value = getJsonSerializedValue(hyponyms, hypernyms);
StringBuilder builder = new StringBuilder();
builder.append(key).append("*").append(value).append("\n");
System.out.println(cont++ + builder.toString());
FileHelper.stringToFile(builder.toString(),fileDest,true,"UTF-8");
}
}
private String getJsonSerializedValue(List<String> hyponyms, List<String> hypernyms) {
JsonObject json = new JsonObject();
json.addProperty("hypo",hyponyms.toString().replace("_"," "));
json.addProperty("hype",hypernyms.toString().replace("_"," "));
return json.toString();
}
}
| [
"00jabba"
] | 00jabba |
43f46895e1f265a6205ddd0d75212e95a3f65e32 | 9a5b755f815e7291b22fb681fc5163b29718c83e | /Student_Score/src/StudentRating/Client_1.java | c2224c37b2dd1b36d2733e2fbef345ed71fd7a8f | [] | no_license | erinabbey/StudentScore_LTM | ba6245bbd818a7cf7b89c8c02a1b591740de3053 | 001c7015039497759608cd7bd4692437410f3841 | refs/heads/master | 2023-01-27T11:38:35.979098 | 2020-12-04T14:51:03 | 2020-12-04T14:51:03 | 312,004,954 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,936 | java | package StudentRating;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextArea;
import javax.swing.border.EmptyBorder;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import java.awt.SystemColor;
import javax.swing.JButton;
import javax.swing.JFileChooser;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import java.awt.Font;
import java.awt.Frame;
import java.awt.GraphicsEnvironment;
import javax.swing.JTextField;
import javax.swing.UIManager;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionAdapter;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.rmi.Naming;
import java.util.ArrayList;
import java.util.Arrays;
import java.awt.event.ActionEvent;
import javax.swing.border.LineBorder;
import javax.swing.filechooser.FileNameExtensionFilter;
import javax.swing.JTabbedPane;
@SuppressWarnings("serial")
public class Client_1 extends JFrame implements ActionListener {
private JPanel contentPane, panel;
private JTextField txtClassName, txtFilename;
private JButton btnChooseFile, btnSend, btnResult;
private JLabel className, fileName;
private JTextArea txtSortStudent, txtTop5, txtClsStudent;
int xMouse;
int yMouse;
static boolean maximized = true;
boolean isSent = false;
String Studentlist[][] = new String[10][2];// 10 students, with name - class - score
String serverURL1 = "rmi://localhost:1112/Server1";
String serverURL2 = "rmi://localhost:1114/Server2";
String serverURL3 = "rmi://localhost:1113/Server3";
ServerInterface server1, server2, server3;
ArrayList<Student> list = new ArrayList<Student>();
Student student;
boolean server1Ready, server2Ready, server3Ready ;
public static void main(String[] args) {
new Client_1();
}
public Client_1() {
super("Client_1");
try {
InitComponent();
server1 = (ServerInterface) Naming.lookup(serverURL1);
server2 = (ServerInterface) Naming.lookup(serverURL2);
server3 = (ServerInterface) Naming.lookup(serverURL3);
// can not compare
// while (true) {
// Thread.sleep(1000);
// // server is received data
// if (server1.isResultReady() && server2.isResultReady() && server3.isResultReady()) {
// btnResult.setVisible(true);// already to show result in client
// }
// }
} catch (Exception e) {
e.printStackTrace();
}
}
private void InitComponent() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 600, 457);
contentPane = new JPanel();
contentPane.setBackground(SystemColor.inactiveCaption);
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setOpaque(false);
setLocationRelativeTo(null);
setVisible(true);
panel = new JPanel();
panel.setBounds(0, 0, 584, 418);
panel.setBackground(SystemColor.inactiveCaption);
className = new JLabel("Class name");
className.setBounds(10, 22, 98, 28);
className.setFont(new Font("Segoe UI", Font.BOLD, 14));
fileName = new JLabel("Browse file");
fileName.setBounds(10, 69, 98, 28);
fileName.setFont(new Font("Segoe UI", Font.BOLD, 14));
txtClassName = new JTextField();
txtClassName.setBounds(118, 22, 197, 28);
txtClassName.setBackground(SystemColor.inactiveCaptionBorder);
txtClassName.setBorder(null);
txtClassName.setColumns(10);
btnChooseFile = new JButton("Choose file");
btnChooseFile.setBounds(118, 74, 117, 23);
btnChooseFile.setBackground(SystemColor.inactiveCaptionBorder);
btnChooseFile.setBorder(null);
btnChooseFile.setFont(new Font("Segoe UI", Font.PLAIN, 11));
txtFilename = new JTextField();
txtFilename.setBounds(256, 75, 74, 20);
txtFilename.setBackground(SystemColor.inactiveCaption);
txtFilename.setEditable(false);
txtFilename.setColumns(10);
btnSend = new JButton("Send");
btnSend.setBounds(10, 147, 74, 23);
btnSend.setBackground(SystemColor.inactiveCaptionBorder);
btnSend.setFont(new Font("Segoe UI", Font.BOLD, 11));
btnSend.setBorder(null);
btnResult = new JButton("Result");
btnResult.setBounds(118, 147, 74, 23);
btnResult.setFont(new Font("Segoe UI", Font.BOLD, 11));
btnResult.setBorder(null);
btnResult.setBackground(SystemColor.inactiveCaptionBorder);
JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
tabbedPane.setBounds(10, 201, 564, 206);
JPanel sv1 = new JPanel();
sv1.setBackground(SystemColor.controlLtHighlight);
tabbedPane.addTab("Sort Students", null, sv1, null);
sv1.setLayout(null);
txtSortStudent = new JTextArea();
txtSortStudent.setBounds(0, 0, 569, 172);
sv1.add(txtSortStudent);
JPanel panel_2 = new JPanel();
panel_2.setBackground(SystemColor.controlLtHighlight);
tabbedPane.addTab("Top 5 Students", null, panel_2, null);
panel_2.setLayout(null);
txtTop5 = new JTextArea();
txtTop5.setBounds(0, 0, 575, 172);
panel_2.add(txtTop5);
JPanel panel_3 = new JPanel();
panel_3.setBackground(SystemColor.controlLtHighlight);
tabbedPane.addTab("Classify Students", null, panel_3, null);
panel_3.setLayout(null);
txtClsStudent = new JTextArea();
txtClsStudent.setBounds(0, 0, 575, 172);
panel_3.add(txtClsStudent);
txtFilename.setEditable(false);
contentPane.setLayout(null);
contentPane.add(panel);
panel.setLayout(null);
panel.add(className);
panel.add(txtClassName);
panel.add(fileName);
panel.add(btnResult);
panel.add(btnChooseFile);
panel.add(txtFilename);
panel.add(btnSend);
panel.add(tabbedPane);
btnResult.setVisible(false);
btnSend.setVisible(false);
btnResult.addActionListener(this);
btnSend.addActionListener(this);
btnChooseFile.addActionListener(this);
}
public void actionPerformed(ActionEvent evt) {
Object sourceObj = evt.getSource();
// neu chon file
if (btnChooseFile == sourceObj) {
try {
JFileChooser chooser = new JFileChooser();
// chi duoc chon file co duoi txt hoac csv
FileNameExtensionFilter filter = new FileNameExtensionFilter("csv", "txt");
chooser.setFileFilter(filter);
int returnVal = chooser.showOpenDialog(null);
// choose file
if (returnVal == JFileChooser.APPROVE_OPTION) {
File file = chooser.getSelectedFile();
BufferedReader br = new BufferedReader(new FileReader(file.getName()));// given the name of the file
String line = "";
String separator = "-";
// never send before
if (!isSent) {
System.out.println(file.getName());// get file name and print it first
if (chooser.getTypeDescription(file).equals("Text Document")) {// file .txt, get separator "-"
txtFilename.setText(file.getName());
separator = "-";
int i = 0;
while ((line = br.readLine()) != null) {
Studentlist[i] = line.split(separator);
i++;
}
btnSend.setVisible(true);
} else if (chooser.getTypeDescription(file)
.equals("Microsoft Office Excel Comma Separated Values File")) {// file exel -->
// separator ","
txtFilename.setText(file.getName());
separator = ",";
int i = 0;
// read file
while ((line = br.readLine()) != null) {
Studentlist[i] = line.split(separator);
i++;
}
// after reading file
btnSend.setVisible(true);
// send only one/ 1 run
} else
JOptionPane.showMessageDialog(null, "Invalid File");
// sent --> do not allow send again
} else {
JOptionPane.showMessageDialog(null, "Submit only one");
btnSend.setVisible(false);
}
}
} catch (Exception ex) {
ex.printStackTrace();
}
// start sending data
} else if (btnSend == sourceObj) {
try {
if ((txtClassName == null || txtClassName.getText().length() == 0)) {
JOptionPane.showMessageDialog(null, "Enter class");
return;
} else if (!isSent) {
for (int i = 0; i < Studentlist.length; i++) {
System.out.println(Studentlist[i][0] + " " + Studentlist[i][1] + " " + Studentlist[i][2]);
student = new Student(Studentlist[i][0], Studentlist[i][1], Studentlist[i][2]);
list.add(student);
}
server1Ready= server1.sendData(Studentlist, className.getText());
server2Ready = server2.sendData(Studentlist, className.getText());
server3Ready = server3.sendData(Studentlist, className.getText());
//server1.sortStudent(Studentlist); thay vi count thi tra ve true hay false luon
server1.ListStudent(Studentlist);
server2.getTop5(Studentlist);
server3.classifyStudent(Studentlist);
if(server1Ready && server2Ready && server3Ready ) {
btnResult.setVisible(true);
}
// txtSortStudent.setText((String)server1.ListStudent(Studentlist));
// txtTop5.setText((String)server2.getTop5(Studentlist));
// txtClsStudent.setText((String)server3.classifyStudent(Studentlist));
//
isSent = true;// control send thread
} else
JOptionPane.showMessageDialog(null, "Submit only one");
} catch (Exception ex) {
ex.printStackTrace();
System.out.println("Exception: " + ex);
}
}
// result button
else {
try {
// if ((server1.isResultReady()) && (server2.isResultReady()) && (server3.isResultReady())) {
txtSortStudent.setText((String) server1.ListStudent(Studentlist));
txtTop5.setText((String) server2.getTop5(Studentlist));
txtClsStudent.setText((String) server3.classifyStudent(Studentlist));
// } else {
// txtSortStudent.setText("Waiting for server");
// txtTop5.setText("Waiting for server");
// txtClsStudent.setText("Waiting for server");
// }
} catch (Exception ex) {
System.out.println("Error: " + ex);
}
}
}
}
| [
"nguyenngochuyena8@gmail.com"
] | nguyenngochuyena8@gmail.com |
07341d821d13e91896f03ba98cccf8f74b3ab882 | 471a1d9598d792c18392ca1485bbb3b29d1165c5 | /jadx-MFP/src/main/java/com/myfitnesspal/feature/dashboard/ui/view/TextNutrientDashboard.java | 54212990ca766d6af0f9c1cf61ee6c8d56a1b7fa | [] | no_license | reed07/MyPreferencePal | 84db3a93c114868dd3691217cc175a8675e5544f | 365b42fcc5670844187ae61b8cbc02c542aa348e | refs/heads/master | 2020-03-10T23:10:43.112303 | 2019-07-08T00:39:32 | 2019-07-08T00:39:32 | 129,635,379 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 19,443 | java | package com.myfitnesspal.feature.dashboard.ui.view;
import android.content.Context;
import android.content.SharedPreferences;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
import butterknife.BindView;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.myfitnesspal.android.R;
import com.myfitnesspal.feature.appgallery.service.AppGalleryService;
import com.myfitnesspal.feature.dashboard.service.NutrientDashboardAnalyticsHelper;
import com.myfitnesspal.feature.dashboard.ui.view.NutrientDashboard.Type;
import com.myfitnesspal.feature.dashboard.ui.view.NutrientDashboardBase.DashboardUserType;
import com.myfitnesspal.feature.diary.service.DiaryService;
import com.myfitnesspal.feature.externalsync.impl.googlefit.client.GoogleFitClient;
import com.myfitnesspal.feature.goals.service.NutrientGoalService;
import com.myfitnesspal.feature.goals.service.NutrientGoalsUtil;
import com.myfitnesspal.feature.nutrition.model.Nutrient;
import com.myfitnesspal.feature.premium.service.PremiumService;
import com.myfitnesspal.shared.constants.Constants.Extras;
import com.myfitnesspal.shared.model.v1.DiaryDay;
import com.myfitnesspal.shared.model.v2.MfpDailyGoal;
import com.myfitnesspal.shared.service.analytics.ActionTrackingService;
import com.myfitnesspal.shared.service.session.Session;
import com.myfitnesspal.shared.service.steps.StepService;
import com.myfitnesspal.shared.service.userdata.UserEnergyService;
import com.myfitnesspal.shared.util.LocalizedStringsUtil;
import com.uacf.core.util.CollectionUtils;
import com.uacf.core.util.Function1;
import com.uacf.core.util.FunctionUtils;
import com.uacf.core.util.Ln;
import com.uacf.core.util.NumberUtils;
import com.uacf.core.util.Strings;
import com.uacf.core.util.TextViewUtils;
import com.uacf.core.util.ViewUtils;
import dagger.Lazy;
import java.util.Collection;
import java.util.List;
public class TextNutrientDashboard extends NutrientDashboardBase {
private static final String DEFAULT_VALUE = "-";
private static final String MINUS = "–";
private static final String PLUS = "+";
@Nullable
@BindView(2131363893)
View equalSign;
@BindView(2131362501)
TextView exercise;
@Nullable
@BindView(2131362504)
View exercisePlusMinus;
@Nullable
@BindView(2131362505)
View exerciseTextViews;
@BindView(2131362618)
TextView food;
@Nullable
@BindView(2131363892)
View foodPlusMinus;
@BindView(2131362710)
TextView goal;
private boolean hasRenderedOnce;
@Nullable
@BindView(2131363915)
TextView label1;
@Nullable
@BindView(2131363916)
TextView label2;
@Nullable
@BindView(2131363917)
TextView label3;
@Nullable
@BindView(2131363108)
/* renamed from: net reason: collision with root package name */
TextView f31net;
@BindView(2131363431)
TextView remaining;
@Nullable
@BindView(2131363432)
TextView remainingDiary;
@BindView(2131363433)
TextView remainingLabel;
private static class EnergyData {
boolean assignExerciseEnergyEnabled;
float burnedByExercise;
float consumed;
float goal;
/* renamed from: net reason: collision with root package name */
float f32net;
float remaining;
float total;
public static EnergyData fromV1(float f, DiaryDay diaryDay) {
return new EnergyData(f, diaryDay, true);
}
public static EnergyData fromV2(float f, DiaryDay diaryDay, MfpDailyGoal mfpDailyGoal) {
return new EnergyData(f, diaryDay, mfpDailyGoal != null && mfpDailyGoal.isAssignExerciseEnergyOn());
}
public static EnergyData fromFriendDiaryDay(UserEnergyService userEnergyService, DiaryDay diaryDay) {
return new EnergyData((float) userEnergyService.getRoundedCurrentEnergy((double) diaryDay.goalCalories()), diaryDay, diaryDay.isFriendExerciseCaloriesOn());
}
private EnergyData(float f, DiaryDay diaryDay, boolean z) {
this.assignExerciseEnergyEnabled = z;
this.consumed = diaryDay.caloriesConsumed(true);
this.burnedByExercise = diaryDay.caloriesBurnedByExercise(true);
this.goal = f;
float f2 = BitmapDescriptorFactory.HUE_RED;
this.total = f + (z ? this.burnedByExercise : BitmapDescriptorFactory.HUE_RED);
float f3 = this.total;
float f4 = this.consumed;
this.remaining = f3 - f4;
if (z) {
f2 = this.burnedByExercise;
}
this.f32net = f4 - f2;
}
}
public TextNutrientDashboard(Context context, Lazy<UserEnergyService> lazy, Lazy<Session> lazy2, Lazy<LocalizedStringsUtil> lazy3, Lazy<StepService> lazy4, Lazy<ActionTrackingService> lazy5, Lazy<NutrientGoalService> lazy6, Lazy<NutrientGoalsUtil> lazy7, Lazy<PremiumService> lazy8, Lazy<SharedPreferences> lazy9, Lazy<DiaryService> lazy10, Lazy<AppGalleryService> lazy11, Lazy<GoogleFitClient> lazy12, Lazy<NutrientDashboardAnalyticsHelper> lazy13) {
super(context, lazy, lazy2, lazy3, lazy4, lazy5, lazy6, lazy7, lazy8, lazy9, lazy10, lazy11, lazy12, lazy13);
}
/* access modifiers changed from: protected */
public View createView() {
return LayoutInflater.from(this.context).inflate(this.type == Type.Home ? R.layout.nutrient_dashboard_home : R.layout.nutrient_dashboard_diary, null);
}
/* access modifiers changed from: protected */
public String getParentId() {
return this.type == Type.Home ? "home" : "diary";
}
public void onRender(final Function1<NutrientDashboard> function1, final DiaryDay diaryDay) {
if (this.dashboardUserType == DashboardUserType.Self) {
final float round = (float) Math.round(MfpDailyGoal.getLocalizedEnergy(((NutrientGoalService) this.nutrientGoalService.get()).getCachedDefaultGoal(), (UserEnergyService) this.userEnergyService.get()));
final boolean equals = Strings.equals(this.currentDisplaySetting, Extras.DEFAULT_GOAL_DISPLAY);
if (!this.hasRenderedOnce) {
if (equals) {
renderAsLegacy(null);
} else {
renderAsModern(null, null, null);
}
this.hasRenderedOnce = true;
}
((NutrientGoalService) this.nutrientGoalService.get()).getDailyGoalForDate(new Function1<MfpDailyGoal>() {
public void execute(MfpDailyGoal mfpDailyGoal) {
EnergyData fromV2 = EnergyData.fromV2(((UserEnergyService) TextNutrientDashboard.this.userEnergyService.get()).getCurrentEnergy(mfpDailyGoal.getEnergy()), diaryDay, mfpDailyGoal);
if (equals) {
TextNutrientDashboard.this.renderAsLegacy(fromV2);
} else {
TextNutrientDashboard.this.renderAsModern(fromV2, mfpDailyGoal, diaryDay);
}
FunctionUtils.invokeIfValid(function1, TextNutrientDashboard.this);
}
}, new Function1<List<Exception>>() {
public void execute(List<Exception> list) {
TextNutrientDashboard.this.renderAsLegacy(EnergyData.fromV1(round, diaryDay));
FunctionUtils.invokeIfValid(function1, TextNutrientDashboard.this);
Ln.e(list, new Object[0]);
}
}, this.date.getTime());
return;
}
renderAsLegacy(EnergyData.fromFriendDiaryDay((UserEnergyService) this.userEnergyService.get(), diaryDay));
FunctionUtils.invokeIfValid(function1, this);
}
private void renderHeader() {
TextViewUtils.setText(this.title, ((LocalizedStringsUtil) this.localizedStringsUtil.get()).getLocalizedString("summary_remaining", this.userEnergyService));
setTitleVisibility(this.type == Type.Home);
}
private void renderEnergyViews(EnergyData energyData) {
String str;
String str2;
setRemainingText(energyData);
if (energyData != null) {
str2 = NumberUtils.localeStringFromAbsDoubleNoDecimal((double) energyData.goal);
str = Strings.signNumber(NumberUtils.localeStringFromAbsDoubleNoDecimal((double) energyData.f32net), energyData.f32net);
} else {
str2 = DEFAULT_VALUE;
str = DEFAULT_VALUE;
}
this.goal.setText(str2);
TextViewUtils.setText(this.f31net, str);
}
private void setRemainingText(EnergyData energyData) {
int i;
String str;
if (energyData != null) {
float f = energyData.remaining;
str = NumberUtils.localeStringFromDoubleNoDecimal((double) f);
i = getTextColorForValue(f);
} else {
str = DEFAULT_VALUE;
i = R.color.light_green;
}
boolean z = this.type == Type.Diary;
setRemainingTextViewData(this.remaining, i, str, !z);
setRemainingTextViewData(this.remainingDiary, i, str, z);
}
private void setRemainingTextViewData(TextView textView, int i, String str, boolean z) {
if (textView != null) {
textView.setTextColor(i);
textView.setText(str);
ViewUtils.setVisible(z, textView);
}
}
/* access modifiers changed from: private */
public void renderAsLegacy(EnergyData energyData) {
boolean z;
String str;
String str2;
String str3;
renderHeader();
renderEnergyViews(energyData);
if (energyData != null) {
z = energyData.assignExerciseEnergyEnabled;
ViewUtils.setVisible(energyData.assignExerciseEnergyEnabled, this.exerciseTextViews);
ViewUtils.setVisible(energyData.assignExerciseEnergyEnabled, this.exercisePlusMinus);
} else {
z = ViewUtils.isVisible(this.exerciseTextViews);
}
ViewUtils.setVisible(z, this.exerciseTextViews);
ViewUtils.setVisible(z, this.exercisePlusMinus);
if (this.type == Type.Home) {
String titleCase = Strings.toTitleCase(this.context.getString(R.string.remainingDiaryTxt));
String localeStringFromAbsDoubleNoDecimal = energyData != null ? NumberUtils.localeStringFromAbsDoubleNoDecimal((double) energyData.burnedByExercise) : DEFAULT_VALUE;
String localeStringFromAbsDoubleNoDecimal2 = energyData != null ? NumberUtils.localeStringFromAbsDoubleNoDecimal((double) energyData.consumed) : DEFAULT_VALUE;
this.remainingLabel.setText(titleCase);
this.food.setText(localeStringFromAbsDoubleNoDecimal2);
this.exercise.setText(localeStringFromAbsDoubleNoDecimal);
} else {
if (energyData != null) {
str3 = NumberUtils.localeStringFromAbsDoubleNoDecimal((double) energyData.goal);
str2 = NumberUtils.localeStringFromAbsDoubleNoDecimal((double) energyData.consumed);
str = NumberUtils.localeStringFromAbsDoubleNoDecimal((double) energyData.burnedByExercise);
} else {
str3 = DEFAULT_VALUE;
str2 = DEFAULT_VALUE;
str = DEFAULT_VALUE;
}
this.goal.setText(str3);
this.food.setText(str2);
this.exercise.setText(str);
this.remainingLabel.setText(Strings.toTitleCase(this.context.getString(R.string.remainingDiaryTxt)));
}
if (energyData != null) {
TextViewUtils.setText((TextView) ViewUtils.findById(getView(), R.id.exercisePlusMinus), energyData.burnedByExercise >= BitmapDescriptorFactory.HUE_RED ? PLUS : MINUS);
}
ViewUtils.setVisible(true, getView());
}
/* access modifiers changed from: private */
/* JADX WARNING: Removed duplicated region for block: B:25:0x009d */
/* JADX WARNING: Removed duplicated region for block: B:26:0x00a1 */
/* JADX WARNING: Removed duplicated region for block: B:27:0x00a5 */
/* JADX WARNING: Removed duplicated region for block: B:28:0x00a9 */
/* Code decompiled incorrectly, please refer to instructions dump. */
public void renderAsModern(com.myfitnesspal.feature.dashboard.ui.view.TextNutrientDashboard.EnergyData r6, com.myfitnesspal.shared.model.v2.MfpDailyGoal r7, com.myfitnesspal.shared.model.v1.DiaryDay r8) {
/*
r5 = this;
r5.renderHeader()
r5.renderEnergyViews(r6)
com.myfitnesspal.feature.dashboard.ui.view.NutrientDashboard$Type r6 = r5.type
com.myfitnesspal.feature.dashboard.ui.view.NutrientDashboard$Type r0 = com.myfitnesspal.feature.dashboard.ui.view.NutrientDashboard.Type.Home
if (r6 == r0) goto L_0x0027
android.widget.TextView r6 = r5.remainingLabel
android.content.Context r0 = r5.context
dagger.Lazy r1 = r5.userEnergyService
java.lang.Object r1 = r1.get()
com.myfitnesspal.shared.service.userdata.UserEnergyService r1 = (com.myfitnesspal.shared.service.userdata.UserEnergyService) r1
int r1 = r1.getCurrentEnergyStringId()
java.lang.String r0 = r0.getString(r1)
java.lang.String r0 = com.uacf.core.util.Strings.toTitleCase(r0)
r6.setText(r0)
L_0x0027:
android.widget.TextView r6 = r5.title
android.content.Context r0 = r5.context
r1 = 2131889284(0x7f120c84, float:1.9413227E38)
java.lang.String r0 = r0.getString(r1)
com.uacf.core.util.TextViewUtils.setText(r6, r0)
r6 = 1
r5.setTitleVisibility(r6)
android.view.View[] r0 = new android.view.View[r6]
android.view.View r1 = r5.foodPlusMinus
r2 = 0
r0[r2] = r1
com.uacf.core.util.ViewUtils.setVisible(r2, r0)
android.view.View[] r0 = new android.view.View[r6]
android.view.View r1 = r5.equalSign
r0[r2] = r1
com.uacf.core.util.ViewUtils.setVisible(r2, r0)
android.view.View[] r0 = new android.view.View[r6]
android.view.View r1 = r5.exercisePlusMinus
r0[r2] = r1
com.uacf.core.util.ViewUtils.setVisible(r2, r0)
java.lang.String r0 = r5.currentDisplaySetting
r1 = -1
int r3 = r0.hashCode()
r4 = -1170652706(0xffffffffba3941de, float:-7.067005E-4)
if (r3 == r4) goto L_0x008f
r4 = -834279909(0xffffffffce45e61b, float:-8.3004794E8)
if (r3 == r4) goto L_0x0085
r4 = 446259792(0x1a996250, float:6.343815E-23)
if (r3 == r4) goto L_0x007b
r4 = 716388772(0x2ab339a4, float:3.1836784E-13)
if (r3 == r4) goto L_0x0071
goto L_0x0099
L_0x0071:
java.lang.String r3 = "custom_goal_display"
boolean r0 = r0.equals(r3)
if (r0 == 0) goto L_0x0099
r0 = 2
goto L_0x009a
L_0x007b:
java.lang.String r3 = "low_carb_remaining"
boolean r0 = r0.equals(r3)
if (r0 == 0) goto L_0x0099
r0 = 1
goto L_0x009a
L_0x0085:
java.lang.String r3 = "heart_healthy_remaining"
boolean r0 = r0.equals(r3)
if (r0 == 0) goto L_0x0099
r0 = 0
goto L_0x009a
L_0x008f:
java.lang.String r3 = "macros_remaining"
boolean r0 = r0.equals(r3)
if (r0 == 0) goto L_0x0099
r0 = 3
goto L_0x009a
L_0x0099:
r0 = -1
L_0x009a:
switch(r0) {
case 0: goto L_0x00a9;
case 1: goto L_0x00a5;
case 2: goto L_0x00a1;
default: goto L_0x009d;
}
L_0x009d:
r5.renderMacrosRemaining(r7, r8)
goto L_0x00ac
L_0x00a1:
r5.renderCustomGoals(r7, r8)
goto L_0x00ac
L_0x00a5:
r5.renderLowCarb(r7, r8)
goto L_0x00ac
L_0x00a9:
r5.renderHearthHealthy(r7, r8)
L_0x00ac:
android.view.View[] r7 = new android.view.View[r6]
android.view.View r8 = r5.getView()
r7[r2] = r8
com.uacf.core.util.ViewUtils.setVisible(r6, r7)
return
*/
throw new UnsupportedOperationException("Method not decompiled: com.myfitnesspal.feature.dashboard.ui.view.TextNutrientDashboard.renderAsModern(com.myfitnesspal.feature.dashboard.ui.view.TextNutrientDashboard$EnergyData, com.myfitnesspal.shared.model.v2.MfpDailyGoal, com.myfitnesspal.shared.model.v1.DiaryDay):void");
}
private void renderMacrosRemaining(MfpDailyGoal mfpDailyGoal, DiaryDay diaryDay) {
setNetRemainingValuesForMacros(mfpDailyGoal, diaryDay, Nutrient.Carbohydrates, Nutrient.Fat, Nutrient.Protein);
}
private void renderHearthHealthy(MfpDailyGoal mfpDailyGoal, DiaryDay diaryDay) {
setNetRemainingValuesForMacros(mfpDailyGoal, diaryDay, Nutrient.Fat, Nutrient.Sodium, Nutrient.Cholesterol);
}
private void renderLowCarb(MfpDailyGoal mfpDailyGoal, DiaryDay diaryDay) {
setNetRemainingValuesForMacros(mfpDailyGoal, diaryDay, Nutrient.Carbohydrates, Nutrient.Sugar, Nutrient.Fiber);
}
private void renderCustomGoals(MfpDailyGoal mfpDailyGoal, DiaryDay diaryDay) {
List<Nutrient> filterNutrientsForDisplay = NutrientDashboardUtil.filterNutrientsForDisplay(((Session) this.session.get()).getUser().getCustomDisplayGoal());
if (CollectionUtils.size((Collection<?>) filterNutrientsForDisplay) != 3) {
filterNutrientsForDisplay = NutrientDashboardUtil.DEFAULT_CUSTOM_GOALS;
}
setNetRemainingValuesForMacros(mfpDailyGoal, diaryDay, (Nutrient) filterNutrientsForDisplay.get(0), (Nutrient) filterNutrientsForDisplay.get(1), (Nutrient) filterNutrientsForDisplay.get(2));
}
private void setNetRemainingValuesForMacros(MfpDailyGoal mfpDailyGoal, DiaryDay diaryDay, Nutrient... nutrientArr) {
MfpDailyGoal mfpDailyGoal2 = mfpDailyGoal;
DiaryDay diaryDay2 = diaryDay;
setNetRemainingValuesForMacro(this.goal, this.label1, mfpDailyGoal2, diaryDay2, nutrientArr[0]);
setNetRemainingValuesForMacro(this.food, this.label2, mfpDailyGoal, diaryDay, nutrientArr[1]);
setNetRemainingValuesForMacro(this.exercise, this.label3, mfpDailyGoal2, diaryDay2, nutrientArr[2]);
}
private void setNetRemainingValuesForMacro(TextView textView, TextView textView2, MfpDailyGoal mfpDailyGoal, DiaryDay diaryDay, Nutrient nutrient) {
String str;
if (mfpDailyGoal == null || diaryDay == null) {
str = DEFAULT_VALUE;
} else {
int nutrientIndex = nutrient.getNutrientIndex();
str = Strings.toString(Integer.valueOf(Math.round(((NutrientGoalsUtil) this.nutritionalGoalsUtil.get()).getAdjustedNutritionalGoal(diaryDay, mfpDailyGoal, nutrientIndex) - diaryDay.amountOfNutrientConsumed(nutrientIndex))));
}
textView.setText(str);
TextViewUtils.setText(textView2, formatProgressBarLabelWithUnits(nutrient));
}
}
| [
"anon@ymous.email"
] | anon@ymous.email |
6c0f45359d9eab2d723c0c7e34eec083de1ff567 | 2770a15d6501d863cedb584ce4983bd834f002b7 | /klient/JavaApplication3/src/javaapplication3/name_screen.java | bbc2fa9d0a40d5fc5fbd535e1e9f233d3985d99f | [] | no_license | Szymon-R/Stock-experiment | a77bc23623ee84ea7e6b6e1556959cd4c791551d | abcf4c474dd87e35d1c763c4f33755a9514861fc | refs/heads/master | 2020-05-01T05:04:32.461698 | 2019-03-31T17:57:51 | 2019-03-31T17:57:51 | 177,291,261 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,717 | 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 javaapplication3;
import javax.swing.JOptionPane;
/**
*
* @author Szymon
*/
public class name_screen extends javax.swing.JFrame {
IP_Screen IP_Screen1;
public name_screen() {
initComponents();
}
/**
* 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() {
jPanel2 = new javax.swing.JPanel();
jPanel1 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
jLabel7 = new javax.swing.JLabel();
jTextField2 = new javax.swing.JTextField();
jButton1 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setResizable(false);
setSize(new java.awt.Dimension(609, 526));
jPanel2.setBackground(new java.awt.Color(255, 255, 255));
jPanel1.setBackground(new java.awt.Color(0, 102, 204));
jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/javaapplication3/pobrane.png"))); // NOI18N
jLabel3.setFont(new java.awt.Font("Calibri", 1, 18)); // NOI18N
jLabel3.setForeground(new java.awt.Color(255, 255, 255));
jLabel3.setText("Tworzenie konta");
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(37, 37, 37)
.addComponent(jLabel1))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(82, 82, 82)
.addComponent(jLabel3)))
.addContainerGap(43, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(47, 47, 47)
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(209, Short.MAX_VALUE))
);
jLabel4.setFont(new java.awt.Font("Calibri", 1, 15)); // NOI18N
jLabel4.setForeground(new java.awt.Color(102, 102, 102));
jLabel4.setText("Wpisz swoje imię i nazwisko i kliknij zaloguj");
jLabel6.setFont(new java.awt.Font("Calibri", 0, 14)); // NOI18N
jLabel6.setForeground(new java.awt.Color(102, 102, 102));
jLabel6.setText("Imię:");
jTextField1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jTextField1ActionPerformed(evt);
}
});
jLabel7.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
jLabel7.setForeground(new java.awt.Color(102, 102, 102));
jLabel7.setText("Nazwisko:");
jButton1.setText("Zaloguj");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(10, 10, 10)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTextField1, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jTextField2, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, 284, Short.MAX_VALUE)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel7)
.addComponent(jLabel6))
.addGap(0, 0, Short.MAX_VALUE)))
.addContainerGap())
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(87, 87, 87)
.addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(82, 82, 82)
.addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel6)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jLabel7)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(58, 58, 58)
.addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
.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)
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField1ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jTextField1ActionPerformed
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
String imie =jTextField1.getText();
String nazwisko=jTextField2.getText();
if(imie.isEmpty()||nazwisko.isEmpty())
{
JOptionPane.showMessageDialog(this, "Pole na imię, bądź nazwisko jest puste.","Problem z danymi",JOptionPane.WARNING_MESSAGE);
return;
}
else
{
IP_Screen1=new IP_Screen();
IP_Screen1.setLocationRelativeTo(null);
IP_Screen1.setVisible(true);
this.setEnabled(false);
}
}//GEN-LAST:event_jButton1ActionPerformed
/**
* @param args the command line arguments
*/
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JTextField jTextField1;
private javax.swing.JTextField jTextField2;
// End of variables declaration//GEN-END:variables
}
| [
"roskwitek2@gmail.com"
] | roskwitek2@gmail.com |
9499d2d27e601632bbb2dcfc33d521626b31acc3 | c4a14d70951d7ec5aac7fe7ebb2db891cfe6c0b1 | /modulos/apps/LOCALGIS-Protocol/src/main/java/com/geopista/protocol/metadatos/MD_DataIdentification.java | 0c6b33524bf99585be440ab4742fefbba3a60212 | [] | no_license | pepeysusmapas/allocalgis | 925756321b695066775acd012f9487cb0725fcde | c14346d877753ca17339f583d469dbac444ffa98 | refs/heads/master | 2020-09-14T20:15:26.459883 | 2016-09-27T10:08:32 | 2016-09-27T10:08:32 | null | 0 | 0 | null | null | null | null | WINDOWS-1252 | Java | false | false | 4,439 | java | /**
* MD_DataIdentification.java
* © MINETUR, Government of Spain
* This program is part of LocalGIS
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
* You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.geopista.protocol.metadatos;
import java.util.Vector;
/**
* Created by IntelliJ IDEA.
* User: angeles
* Date: 20-ago-2004
* Time: 14:24:38
*/
public class MD_DataIdentification {
String identification_id;
CI_Citation citacion;
String resumen;
String purpose;
String characterset;
CI_ResponsibleParty responsibleParty;
String rolecode_id;
Vector idiomas;
Vector rEspacial;
Vector categorias;
Vector graficos;
Long resolucion=null;
EX_Extent extent=null;
MD_LegalConstraint constraint=null;
public MD_DataIdentification() {
}
public String getCharacterset() {
return characterset;
}
public void setCharacterset(String characterset) {
this.characterset = characterset;
}
public CI_Citation getCitacion() {
return citacion;
}
public void setCitacion(CI_Citation citacion) {
this.citacion = citacion;
}
public String getIdentification_id() {
return identification_id;
}
public void setIdentification_id(String identificacion_id) {
this.identification_id = identificacion_id;
}
public String getPurpose() {
return purpose;
}
public void setPurpose(String purpose) {
this.purpose = purpose;
}
public String getResumen() {
return resumen;
}
public void setResumen(String resumen) {
this.resumen = resumen;
}
public String getRolecode_id() {
return rolecode_id;
}
public void setRolecode_id(String rolecode_id) {
this.rolecode_id = rolecode_id;
}
public Vector getIdiomas() {
return idiomas;
}
public void setIdiomas(Vector idiomas) {
this.idiomas = idiomas;
}
public void addIdioma(String sCodeIdioma)
{
if (idiomas==null) idiomas=new Vector();
idiomas.add(sCodeIdioma);
}
public Vector getrEspacial() {
return rEspacial;
}
public void setrEspacial(Vector rEspacial) {
this.rEspacial = rEspacial;
}
public void addrEspacial(String sCode)
{
if (rEspacial==null) rEspacial=new Vector();
rEspacial.add(sCode);
}
public Vector getCategorias() {
return categorias;
}
public void setCategorias(Vector categorias) {
this.categorias = categorias;
}
public void addCategoria(String sCode)
{
if (categorias==null) categorias=new Vector();
categorias.add(sCode);
}
public Vector getGraficos() {
return graficos;
}
public void setGraficos(Vector graficos) {
this.graficos = graficos;
}
public void addGrafico(String sCode)
{
if (graficos==null) graficos=new Vector();
graficos.add(sCode);
}
public Long getResolucion() {
return resolucion;
}
public void setResolucion(Long resolucion) {
this.resolucion = resolucion;
}
public EX_Extent getExtent() {
return extent;
}
public void setExtent(EX_Extent extent) {
this.extent = extent;
}
public MD_LegalConstraint getConstraint() {
return constraint;
}
public void setConstraint(MD_LegalConstraint constraint) {
this.constraint = constraint;
}
public CI_ResponsibleParty getResponsibleParty() {
return responsibleParty;
}
public void setResponsibleParty(CI_ResponsibleParty responsibleParty) {
this.responsibleParty = responsibleParty;
}
}
| [
"jorge.martin@cenatic.es"
] | jorge.martin@cenatic.es |
880ee3990c1e9aaa0fbe1422c144847f12a6aa46 | 84497001698ba6236d8177605f90cc122e5d9d62 | /ativ-corba-client/src/main/java/br/edu/ifpb/pos/ativ/corba/client/idl/HelloApp/HelloHelper.java | 397d672b97c185647e61bc59b8ed9c2c9e69008e | [] | no_license | pedroviniv/ativ-corba | c16d85fd1e9b761eff2fcf6e61df72d7963a23bc | 14be610511ab78e61aa2ea88c2762ffbf0ec3714 | refs/heads/master | 2021-05-15T14:02:34.477501 | 2017-10-16T17:43:05 | 2017-10-16T17:43:05 | 107,161,319 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,968 | java | package br.edu.ifpb.pos.ativ.corba.client.idl.HelloApp;
/**
* br/edu/ifpb/pos/ativ/corba/client/idl/HelloApp/HelloHelper.java .
* Generated by the IDL-to-Java compiler (portable), version "3.2"
* from br/edu/ifpb/pos/ativ/corba/client/idl/HelloApp.idl
* Segunda-feira, 16 de Outubro de 2017 13h02min12s BRT
*/
abstract public class HelloHelper
{
private static String _id = "IDL:HelloApp/Hello:1.0";
public static void insert (org.omg.CORBA.Any a, br.edu.ifpb.pos.ativ.corba.client.idl.HelloApp.Hello that)
{
org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();
a.type (type ());
write (out, that);
a.read_value (out.create_input_stream (), type ());
}
public static br.edu.ifpb.pos.ativ.corba.client.idl.HelloApp.Hello extract (org.omg.CORBA.Any a)
{
return read (a.create_input_stream ());
}
private static org.omg.CORBA.TypeCode __typeCode = null;
synchronized public static org.omg.CORBA.TypeCode type ()
{
if (__typeCode == null)
{
__typeCode = org.omg.CORBA.ORB.init ().create_interface_tc (br.edu.ifpb.pos.ativ.corba.client.idl.HelloApp.HelloHelper.id (), "Hello");
}
return __typeCode;
}
public static String id ()
{
return _id;
}
public static br.edu.ifpb.pos.ativ.corba.client.idl.HelloApp.Hello read (org.omg.CORBA.portable.InputStream istream)
{
return narrow (istream.read_Object (_HelloStub.class));
}
public static void write (org.omg.CORBA.portable.OutputStream ostream, br.edu.ifpb.pos.ativ.corba.client.idl.HelloApp.Hello value)
{
ostream.write_Object ((org.omg.CORBA.Object) value);
}
public static br.edu.ifpb.pos.ativ.corba.client.idl.HelloApp.Hello narrow (org.omg.CORBA.Object obj)
{
if (obj == null)
return null;
else if (obj instanceof br.edu.ifpb.pos.ativ.corba.client.idl.HelloApp.Hello)
return (br.edu.ifpb.pos.ativ.corba.client.idl.HelloApp.Hello)obj;
else if (!obj._is_a (id ()))
throw new org.omg.CORBA.BAD_PARAM ();
else
{
org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate ();
br.edu.ifpb.pos.ativ.corba.client.idl.HelloApp._HelloStub stub = new br.edu.ifpb.pos.ativ.corba.client.idl.HelloApp._HelloStub ();
stub._set_delegate(delegate);
return stub;
}
}
public static br.edu.ifpb.pos.ativ.corba.client.idl.HelloApp.Hello unchecked_narrow (org.omg.CORBA.Object obj)
{
if (obj == null)
return null;
else if (obj instanceof br.edu.ifpb.pos.ativ.corba.client.idl.HelloApp.Hello)
return (br.edu.ifpb.pos.ativ.corba.client.idl.HelloApp.Hello)obj;
else
{
org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate ();
br.edu.ifpb.pos.ativ.corba.client.idl.HelloApp._HelloStub stub = new br.edu.ifpb.pos.ativ.corba.client.idl.HelloApp._HelloStub ();
stub._set_delegate(delegate);
return stub;
}
}
}
| [
"pfernandesvasconcelos@gmail.com"
] | pfernandesvasconcelos@gmail.com |
1bb87437bb9a0c028294c24ef0c669421ab8de31 | 9792619b924d411ffc36b1993d8ed478bbbe247f | /src/main/java/net/minecraft/server/EntitySlime.java | d553c4c5a9e2effd031d5c0b11c74491c5316ed6 | [] | no_license | Hidendra/CanaryRecode | 92e369f208505d7463122726d04e87fc0b3812e8 | 170646ad36b977a99d2da23faee55ea74097917f | refs/heads/master | 2021-01-18T08:53:28.026812 | 2013-08-18T18:09:12 | 2013-08-18T18:09:12 | 12,199,428 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,241 | java | package net.minecraft.server;
import net.canarymod.api.entity.living.monster.CanarySlime;
public class EntitySlime extends EntityLiving implements IMob {
public float h;
public float i;
public float j;
private int bn;
public EntitySlime(World world) {
super(world);
int i0 = 1 << this.ab.nextInt(3);
this.N = 0.0F;
this.bn = this.ab.nextInt(20) + 10;
this.a(i0);
this.entity = new CanarySlime(this); // CanaryMod: Wrap Entity
}
protected void a() {
super.a();
this.ah.a(16, new Byte((byte) 1));
}
public void a(int i0) { // CanaryMod: protected => public
this.ah.b(16, new Byte((byte) i0));
this.a(0.6F * (float) i0, 0.6F * (float) i0);
this.b(this.u, this.v, this.w);
this.a(SharedMonsterAttributes.a).a((double) (i0 * i0));
this.g(this.aS());
this.b = i0;
}
public int bR() {
return this.ah.a(16);
}
public void b(NBTTagCompound nbttagcompound) {
super.b(nbttagcompound);
nbttagcompound.a("Size", this.bR() - 1);
}
public void a(NBTTagCompound nbttagcompound) {
super.a(nbttagcompound);
this.a(nbttagcompound.e("Size") + 1);
}
protected String bJ() {
return "slime";
}
protected String bP() {
return "mob.slime." + (this.bR() > 1 ? "big" : "small");
}
public void l_() {
if (!this.q.I && this.q.r == 0 && this.bR() > 0) {
this.M = true;
}
this.i += (this.h - this.i) * 0.5F;
this.j = this.i;
boolean flag0 = this.F;
super.l_();
int i0;
if (this.F && !flag0) {
i0 = this.bR();
for (int i1 = 0; i1 < i0 * 8; ++i1) {
float f0 = this.ab.nextFloat() * 3.1415927F * 2.0F;
float f1 = this.ab.nextFloat() * 0.5F + 0.5F;
float f2 = MathHelper.a(f0) * (float) i0 * 0.5F * f1;
float f3 = MathHelper.b(f0) * (float) i0 * 0.5F * f1;
this.q.a(this.bJ(), this.u + (double) f2, this.E.b, this.w + (double) f3, 0.0D, 0.0D, 0.0D);
}
if (this.bQ()) {
this.a(this.bP(), this.aZ(), ((this.ab.nextFloat() - this.ab.nextFloat()) * 0.2F + 1.0F) / 0.8F);
}
this.h = -0.5F;
} else if (!this.F && flag0) {
this.h = 1.0F;
}
this.bM();
if (this.q.I) {
i0 = this.bR();
this.a(0.6F * (float) i0, 0.6F * (float) i0);
}
}
protected void bk() {
this.bo();
EntityPlayer entityplayer = this.q.b(this, 16.0D);
if (entityplayer != null) {
this.a(entityplayer, 10.0F, 20.0F);
}
if (this.F && this.bn-- <= 0) {
this.bn = this.bL();
if (entityplayer != null) {
this.bn /= 3;
}
this.bd = true;
if (this.bS()) {
this.a(this.bP(), this.aZ(), ((this.ab.nextFloat() - this.ab.nextFloat()) * 0.2F + 1.0F) * 0.8F);
}
this.be = 1.0F - this.ab.nextFloat() * 2.0F;
this.bf = (float) (1 * this.bR());
} else {
this.bd = false;
if (this.F) {
this.be = this.bf = 0.0F;
}
}
}
protected void bM() {
this.h *= 0.6F;
}
protected int bL() {
return this.ab.nextInt(20) + 10;
}
protected EntitySlime bK() {
return new EntitySlime(this.q);
}
public void w() {
int i0 = this.bR();
if (!this.q.I && i0 > 1 && this.aM() <= 0.0F) {
int i1 = 2 + this.ab.nextInt(3);
for (int i2 = 0; i2 < i1; ++i2) {
float f0 = ((float) (i2 % 2) - 0.5F) * (float) i0 / 4.0F;
float f1 = ((float) (i2 / 2) - 0.5F) * (float) i0 / 4.0F;
EntitySlime entityslime = this.bK();
entityslime.a(i0 / 2);
entityslime.b(this.u + (double) f0, this.v + 0.5D, this.w + (double) f1, this.ab.nextFloat() * 360.0F, 0.0F);
this.q.d((Entity) entityslime);
}
}
super.w();
}
public void b_(EntityPlayer entityplayer) {
if (this.bN()) {
int i0 = this.bR();
if (this.o(entityplayer) && this.e(entityplayer) < 0.6D * (double) i0 * 0.6D * (double) i0 && entityplayer.a(DamageSource.a((EntityLivingBase) this), (float) this.bO())) {
this.a("mob.attack", 1.0F, (this.ab.nextFloat() - this.ab.nextFloat()) * 0.2F + 1.0F);
}
}
}
protected boolean bN() {
return this.bR() > 1;
}
protected int bO() {
return this.bR();
}
protected String aN() {
return "mob.slime." + (this.bR() > 1 ? "big" : "small");
}
protected String aO() {
return "mob.slime." + (this.bR() > 1 ? "big" : "small");
}
protected int s() {
return this.bR() == 1 ? Item.aO.cv : 0;
}
public boolean bs() {
Chunk chunk = this.q.d(MathHelper.c(this.u), MathHelper.c(this.w));
if (this.q.N().u() == WorldType.c && this.ab.nextInt(4) != 1) {
return false;
} else {
if (this.bR() == 1 || this.q.r > 0) {
BiomeGenBase biomegenbase = this.q.a(MathHelper.c(this.u), MathHelper.c(this.w));
if (biomegenbase == BiomeGenBase.h && this.v > 50.0D && this.v < 70.0D && this.ab.nextFloat() < 0.5F && this.ab.nextFloat() < this.q.x() && this.q.n(MathHelper.c(this.u), MathHelper.c(this.v), MathHelper.c(this.w)) <= this.ab.nextInt(8)) {
return super.bs();
}
if (this.ab.nextInt(10) == 0 && chunk.a(987234911L).nextInt(10) == 0 && this.v < 40.0D) {
return super.bs();
}
}
return false;
}
}
protected float aZ() {
return 0.4F * (float) this.bR();
}
public int bp() {
return 0;
}
protected boolean bS() {
return this.bR() > 0;
}
protected boolean bQ() {
return this.bR() > 2;
}
}
| [
"darkdiplomat@visualillusionsent.net"
] | darkdiplomat@visualillusionsent.net |
3b8f276c1f645ac43480e73a774bfa75011df6ed | 84b38ea2f96a9d9b7d6142a73fbf0b03db41a4a6 | /src/main/java/com/athena/chameleon/engine/entity/xml/ejbjar/jeus/v6_0/TimeStampType.java | 43c4e169231d74530e10994bfaeab4946cd4194c | [
"Apache-2.0"
] | permissive | OpenSourceConsulting/playce-chameleon | 06916eae62ba0bdf3088c5364544ae1f6acbe69b | 356a75674495d2946aaf2c2b40f78ecf388fefd0 | refs/heads/master | 2022-12-04T10:06:02.135611 | 2020-08-11T04:27:17 | 2020-08-11T04:27:17 | 5,478,313 | 4 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,118 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.0-b52-fcs
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2012.09.05 at 10:14:54 오후 KST
//
package com.athena.chameleon.engine.entity.xml.ejbjar.jeus.v6_0;
import java.math.BigInteger;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for timeStampType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="timeStampType">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="timeToLive" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" minOccurs="0"/>
* <element name="aberration" type="{http://www.w3.org/2001/XMLSchema}integer" minOccurs="0"/>
* <element name="requireSignature" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
* <element name="precision" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "timeStampType", propOrder = {
"timeToLive",
"aberration",
"requireSignature",
"precision"
})
public class TimeStampType {
@XmlElement(namespace = "http://www.tmaxsoft.com/xml/ns/jeus")
protected BigInteger timeToLive;
@XmlElement(namespace = "http://www.tmaxsoft.com/xml/ns/jeus")
protected BigInteger aberration;
@XmlElement(namespace = "http://www.tmaxsoft.com/xml/ns/jeus")
protected Boolean requireSignature;
@XmlElement(namespace = "http://www.tmaxsoft.com/xml/ns/jeus")
protected BigInteger precision;
/**
* Gets the value of the timeToLive property.
*
* @return
* possible object is
* {@link BigInteger }
*
*/
public BigInteger getTimeToLive() {
return timeToLive;
}
/**
* Sets the value of the timeToLive property.
*
* @param value
* allowed object is
* {@link BigInteger }
*
*/
public void setTimeToLive(BigInteger value) {
this.timeToLive = value;
}
/**
* Gets the value of the aberration property.
*
* @return
* possible object is
* {@link BigInteger }
*
*/
public BigInteger getAberration() {
return aberration;
}
/**
* Sets the value of the aberration property.
*
* @param value
* allowed object is
* {@link BigInteger }
*
*/
public void setAberration(BigInteger value) {
this.aberration = value;
}
/**
* Gets the value of the requireSignature property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isRequireSignature() {
return requireSignature;
}
/**
* Sets the value of the requireSignature property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setRequireSignature(Boolean value) {
this.requireSignature = value;
}
/**
* Gets the value of the precision property.
*
* @return
* possible object is
* {@link BigInteger }
*
*/
public BigInteger getPrecision() {
return precision;
}
/**
* Sets the value of the precision property.
*
* @param value
* allowed object is
* {@link BigInteger }
*
*/
public void setPrecision(BigInteger value) {
this.precision = value;
}
}
| [
"nices96@gmail.com"
] | nices96@gmail.com |
69bbfec52449da551811f10a1562acabe3cef5e0 | bbdfb39cafb948edec5091381c3a17114bd25eeb | /modules/Core/src/test/java/jpower/core/test/ListUtilsTest.java | 2596620eef1236e55797b1b116e731f9095b863c | [
"MIT"
] | permissive | dostal1111/JPower | f791614416dd0662cb2df535009ffa8bf279c1c4 | 3a329140269d06e8db6e3d14db78bbe90954d791 | refs/heads/master | 2021-01-18T07:59:54.578920 | 2015-04-29T04:29:37 | 2015-04-29T04:29:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,100 | java | package jpower.core.test;
import jpower.core.utils.ArrayUtils;
import jpower.core.utils.ListUtils;
import org.junit.Test;
import java.util.ArrayList;
import java.util.List;
import static org.junit.Assert.assertEquals;
public class ListUtilsTest
{
@Test
public void testCollectWorks()
{
List<String> expected = ArrayUtils.toList(new String[]{
"HELLO",
"WORLD"
});
List<String> input = new ArrayList<String>()
{{
add("Hello");
add("World");
}};
assertEquals(expected, ListUtils.collect(input, String::toUpperCase));
}
@Test
public void testJoin()
{
List<String> input = new ArrayList<String>()
{{
add("Hello");
add("World");
}};
String bySpace = ListUtils.join(input, " ");
System.out.println("Joined By Space: " + bySpace);
assertEquals("Hello World", bySpace);
String byComma = ListUtils.join(input, ",");
System.out.println("Joined By Comma: " + byComma);
assertEquals("Hello,World", byComma);
}
}
| [
"kaendfinger@gmail.com"
] | kaendfinger@gmail.com |
91d93de367f75d6b5608fd20c49b0abbea3c3212 | cbea900a55b9c1a23a634a9b2d9aeefdfce6c218 | /managed/src/test/java/com/yugabyte/yw/common/certmgmt/VaultPKITest.java | f7ee7a7b45f09f2077acc180f8725cb39ca2ac88 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0",
"OpenSSL"
] | permissive | nocaway/yugabyte-db | 34294051a7d0e002d74450b6021c82adb89d613c | 70e0d54e2adb14aa775843be836cbe254092f668 | refs/heads/master | 2023-04-27T04:25:34.587033 | 2023-02-21T03:59:48 | 2023-02-21T15:28:41 | 193,143,072 | 0 | 0 | Apache-2.0 | 2019-06-21T18:24:58 | 2019-06-21T18:24:58 | null | UTF-8 | Java | false | false | 12,922 | java | /*
* Copyright 2022 YugaByte, Inc. and Contributors
*
* Licensed under the Polyform Free Trial License 1.0.0 (the "License"); you
* may not use this file except in compliance with the License. You
* may obtain a copy of the License at
*
* https://github.com/YugaByte/yugabyte-db/blob/master/licenses/
* POLYFORM-FREE-TRIAL-LICENSE-1.0.0.txt
*/
package com.yugabyte.yw.common.certmgmt;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import java.security.PublicKey;
import java.security.cert.X509Certificate;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
import com.fasterxml.jackson.databind.JsonNode;
import com.yugabyte.yw.common.FakeDBApplication;
import com.yugabyte.yw.common.TestUtils;
import com.yugabyte.yw.common.certmgmt.providers.CertificateProviderInterface;
import com.yugabyte.yw.common.certmgmt.providers.VaultPKI;
import com.yugabyte.yw.common.certmgmt.providers.VaultPKI.VaultOperationsForCert;
import com.yugabyte.yw.common.kms.util.hashicorpvault.HashicorpVaultConfigParams;
import com.yugabyte.yw.common.kms.util.hashicorpvault.VaultAccessor;
import com.yugabyte.yw.common.kms.util.hashicorpvault.VaultEARServiceUtilTest;
import org.bouncycastle.asn1.x509.GeneralName;
import org.bouncycastle.asn1.x509.GeneralNames;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
// @RunWith(MockitoJUnitRunneoriginalObjr.class)
public class VaultPKITest extends FakeDBApplication {
protected static final Logger LOG = LoggerFactory.getLogger(VaultPKITest.class);
boolean MOCK_RUN;
HashicorpVaultConfigParams params;
UUID caUUID = UUID.randomUUID();
UUID customerUUID = UUID.randomUUID();
String username;
String certPath;
String certKeyPath;
@Before
public void setUp() {
MOCK_RUN = VaultEARServiceUtilTest.MOCK_RUN;
// MOCK_RUN = false;
params = new HashicorpVaultConfigParams();
params.vaultAddr = VaultEARServiceUtilTest.vaultAddr;
params.vaultToken = VaultEARServiceUtilTest.vaultToken;
params.engine = "pki";
params.mountPath = "p3jan/";
params.role = "example-dot-com";
username = "127.0.0.1";
certPath = username + ".pem";
certKeyPath = username + ".key";
}
@Test
public void TestPathCreation() {
String oPath = "pki/cert/ca";
String path =
"pki/"
+ VaultOperationsForCert.CERT.toString()
+ "/"
+ VaultOperationsForCert.CA_CERT.toString();
assertEquals(oPath, path);
}
@Test
public void TestHashicorpParams() {
HashicorpVaultConfigParams params2 = new HashicorpVaultConfigParams(params);
Calendar tokenTtlExpiry = Calendar.getInstance();
params2.ttl = 0L;
params2.ttlExpiry = tokenTtlExpiry.getTimeInMillis();
LOG.debug(" Json string:{}", params2.toString());
JsonNode node = params2.toJsonNode();
assertNotNull(node);
assertEquals("0", node.get("HC_VAULT_TTL").asText());
assertEquals(String.valueOf(params2.ttlExpiry), node.get("HC_VAULT_TTL_EXPIRY").asText());
}
@Test
public void TestCertificateGenerationMock() throws Exception {
if (MOCK_RUN == false) return;
Map<String, String> result = new HashMap<String, String>();
result.put(VaultPKI.ISSUE_FIELD_SERIAL, TestUtils.readResource("hashicorp/pki/ca.pem"));
result.put(VaultPKI.ISSUE_FIELD_CERT, TestUtils.readResource("hashicorp/pki/client.pem"));
result.put(VaultPKI.ISSUE_FIELD_PRV_KEY, TestUtils.readResource("hashicorp/pki/client.key"));
result.put(VaultPKI.ISSUE_FIELD_CA, TestUtils.readResource("hashicorp/pki/issuing_ca.pem"));
VaultAccessor vAccessor = mock(VaultAccessor.class);
when(vAccessor.writeAt(any(), any())).thenReturn(result);
VaultPKI pkiObj = new VaultPKI(caUUID, vAccessor, params);
pkiObj.createCertificate(null, username, new Date(), new Date(), certPath, certKeyPath, null);
X509Certificate cert = CertificateHelper.convertStringToX509Cert(pkiObj.getCertPEM());
LOG.info(CertificateHelper.getCertificateProperties(cert));
assertEquals("CN=" + username, cert.getSubjectDN().toString());
assertTrue(cert.getSubjectAlternativeNames().toString().contains(username));
}
@Test
public void TestCertificateGeneration() throws Exception {
if (MOCK_RUN == true) return;
// Simulates CertificateController.getClientCert
CertificateProviderInterface certProvider = VaultPKI.getVaultPKIInstance(caUUID, params);
CertificateDetails cDetails =
certProvider.createCertificate(null, username, null, null, certPath, certKeyPath, null);
// LOG.info("Client Cert is: {}", cDetails.getCrt());
// LOG.info("Client Cert key is: {}", cDetails.getKey());
X509Certificate cert = CertificateHelper.convertStringToX509Cert(cDetails.getCrt());
LOG.info(CertificateHelper.getCertificateProperties(cert));
assertEquals("CN=" + username, cert.getSubjectDN().toString());
assertTrue(cert.getSubjectAlternativeNames().toString().contains(username));
// verify using issue_ca
X509Certificate caCert =
CertificateHelper.convertStringToX509Cert(((VaultPKI) certProvider).getCACertificate());
PublicKey k = caCert.getPublicKey();
cert.verify(k, "BC");
// verify by fetching ca from mountPath.
caCert = ((VaultPKI) certProvider).getCACertificateFromVault();
assertNotEquals("", caCert);
k = caCert.getPublicKey();
cert.verify(k, "BC");
}
@Test
public void TestCertificateDates() throws Exception {
if (MOCK_RUN == true) return;
Date certStart = Calendar.getInstance().getTime();
Calendar calEnd = Calendar.getInstance();
calEnd.add(Calendar.DATE, 2);
Date certExpiry = calEnd.getTime();
CertificateProviderInterface certProvider = VaultPKI.getVaultPKIInstance(caUUID, params);
CertificateDetails cDetails =
certProvider.createCertificate(
null, username, certStart, certExpiry, certPath, certKeyPath, null);
X509Certificate cert = CertificateHelper.convertStringToX509Cert(cDetails.crt);
LOG.info("Start Date: {} and {}", certStart.toString(), cert.getNotBefore());
LOG.info("End Date: {} and {}", certExpiry.toString(), cert.getNotAfter());
long diffInMillies1 = Math.abs(certExpiry.getTime() - certStart.getTime());
long diffInMillies2 = Math.abs(cert.getNotAfter().getTime() - cert.getNotBefore().getTime());
long ttlInHrs1 = TimeUnit.HOURS.convert(diffInMillies1, TimeUnit.MILLISECONDS);
long ttlInHrs2 = TimeUnit.HOURS.convert(diffInMillies2, TimeUnit.MILLISECONDS);
assertEquals(0L, Math.abs(ttlInHrs1 - ttlInHrs2));
}
@Test
public void TestCertificateIPs() throws Exception {
if (MOCK_RUN == true) return;
String ip1 = "127.0.0.111";
String ip2 = "127.0.0.112";
Map<String, Integer> alternateNames = new HashMap<>();
alternateNames.put(ip1, GeneralName.iPAddress);
alternateNames.put(ip2, GeneralName.iPAddress);
// alternateNames.put("otherName", GeneralName.otherName);
alternateNames.put("rfc822Name", GeneralName.rfc822Name); // string
alternateNames.put("dNSName", GeneralName.dNSName); // string
// alternateNames.put("x400Address", GeneralName.x400Address);
// alternateNames.put("directoryName", GeneralName.directoryName);
// alternateNames.put("ediPartyName", GeneralName.ediPartyName);
alternateNames.put("uniformResourceIdentifier", GeneralName.uniformResourceIdentifier); // str
// alternateNames.put("registeredID", GeneralName.registeredID);
GeneralNames generalNames = CertificateHelper.extractGeneralNames(alternateNames);
LOG.debug("SAN LIST: " + generalNames.toString());
CertificateProviderInterface certProvider = VaultPKI.getVaultPKIInstance(caUUID, params);
CertificateDetails cDetails =
certProvider.createCertificate(
null, username, null, null, certPath, certKeyPath, alternateNames);
X509Certificate cert = CertificateHelper.convertStringToX509Cert(cDetails.crt);
// LOG.info(CertificateHelper.getCertificateProperties(cert));
String ip_sans = cert.getSubjectAlternativeNames().toString();
assertTrue(ip_sans.contains(ip1));
assertTrue(ip_sans.contains(ip2));
assertTrue(ip_sans.contains("dNSName"));
}
@Test
public void TestCAChainMock() throws Exception {
if (MOCK_RUN == false) return;
Map<String, String> result = new HashMap<String, String>();
result.put("issuing_ca", TestUtils.readResource("hashicorp/pki/issuing_ca.pem"));
result.put("ca_chain", TestUtils.readResource("hashicorp/pki/ca_chain.pem"));
VaultAccessor vAccessor = mock(VaultAccessor.class);
when(vAccessor.readAt(any(), any()))
.thenReturn(result.get("issuing_ca"))
.thenReturn(result.get("ca_chain"));
VaultPKI pkiObj = new VaultPKI(caUUID, vAccessor, params);
X509Certificate caCert = pkiObj.getCACertificateFromVault();
List<X509Certificate> caChain = pkiObj.getCAChainFromVault();
assertNotNull(caCert);
assertEquals(2, caChain.size());
caChain = CertificateHelper.convertStringToX509CertList(result.get("ca_chain"));
assertEquals(2, caChain.size());
caChain.clear();
}
@Test
public void TestCAChainNonMock() throws Exception {
if (MOCK_RUN == true) return;
{
VaultPKI certProvider = VaultPKI.getVaultPKIInstance(caUUID, params);
X509Certificate caCert = certProvider.getCACertificateFromVault();
List<X509Certificate> caChain = certProvider.getCAChainFromVault();
assertNotNull(caCert);
assertEquals(0, caChain.size());
}
{
// for this test you would need a pki at p01feb_i as intermidiate pki
/*
create intermidiate ca:
export pki=p01feb
export pki_i="p01feb_i"
export role_i=r2
export ip="s.test.com"
vault secrets enable -path=$pki_i pki
vault secrets tune -max-lease-ttl=43800h $pki_i
vault write $pki_i/intermediate/generate/internal \
common_name="test.com Intermediate Authority" ttl=43800h \
-format=json | jq -r '.data.csr' > pki_i.csr
# *** dump output of above command in pki_i.csr
vault write $pki/root/sign-intermediate csr=@pki_i.csr format=pem_bundle ttl=43800h
-format=json | jq -r .data.certificate > i_signed.pem
# also append ca of root PKI.
cat i_signed.pem
-----BEGIN CERTIFICATE-----
MIIDpjCCA...eIvcEWTgAt5QGAqJg=
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIDLDCCAhSgAwIBAgIU...8/pr5ahdKEu7n+ngYv8QY1rRv
-----END CERTIFICATE-----
vault write $pki_i/intermediate/set-signed certificate=@i_signed.pem
vault write $pki_i/config/urls \
issuing_certificates="http://127.0.0.1:8200/v1/p01feb_i/ca" \
crl_distribution_points="http://127.0.0.1:8200/v1/p01feb_i/crl"
vault write $pki_i/roles/$role_i allowed_domains=test.com \
allow_subdomains=true max_ttl=720h
vault write $pki_i/issue/$role_i common_name="$ip" ttl="800h" \
-format=json > $ip.txt
cat $ip.txt | jq -r '.data.certificate' > "$ip"_cert.pem
cat $ip.txt | jq -r '.data.private_key' > "$ip"_key.pem
cat $ip.txt | jq -r '.data.issuing_ca' > "$ip"_ca.pem
cat $ip.txt | jq -r '.data.ca_chain[]' > "$ip"_ca_chain.pem
store "$ip"_ca_chain.pem in hashicorp/pki/ca_chain.pem
*/
String fileData = TestUtils.readResource("hashicorp/pki/ca_chain.pem");
fileData = fileData.replaceAll("\\n$", "");
List<X509Certificate> caChain = CertificateHelper.convertStringToX509CertList(fileData);
assertEquals(2, caChain.size());
caChain.clear();
HashicorpVaultConfigParams params2 = new HashicorpVaultConfigParams(params);
params2.mountPath = "p01feb_i/";
VaultPKI certProvider = VaultPKI.getVaultPKIInstance(caUUID, params2);
X509Certificate caCert = certProvider.getCACertificateFromVault();
String returnedData = certProvider.getCAChainFromVaultInString();
assertEquals(fileData, returnedData);
caChain = certProvider.getCAChainFromVault();
assertNotNull(caCert);
assertEquals(2, caChain.size());
}
}
@Test
public void testRoleFailure() {
if (MOCK_RUN == true) return;
HashicorpVaultConfigParams params2 = new HashicorpVaultConfigParams(params);
params2.role = "invalid_role";
try {
VaultPKI.getVaultPKIInstance(caUUID, params2);
assertTrue(false);
} catch (Exception e) {
assertTrue(true);
}
}
}
| [
"yogesh.dhawale@gmail.com"
] | yogesh.dhawale@gmail.com |
9a901f3e2f622f674e53266daef0646b0b49278b | 966ecf4fa074ce737cd0118b789f47d56902f5a4 | /menu/src/main/java/menu/impl/IntKeyMenu.java | 3ab05e137576ede3f2273670524ea2e7ab8cff16 | [] | no_license | LadyzRoman/Menu | b92544764869dbbbdeca0265dd4ac190007fb443 | c04eaa6fa207ac97d168a40db80c2f7cd6ba27c0 | refs/heads/master | 2023-03-22T01:54:50.065468 | 2021-03-17T13:30:50 | 2021-03-17T13:30:50 | 348,721,006 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,562 | java | package menu.impl;
import menu.AbstractMenu;
import menu.Menu;
import menu.MenuElement;
import java.util.*;
public class IntKeyMenu extends AbstractMenu<Integer> {
protected IntKeyMenu(Map<Integer, MenuElement<Integer>> menu, String title) {
super(menu, title);
}
@Override
public void print() {
System.out.println(title);
for (var entry: menu.entrySet()) {
System.out.printf("%d) %s\n",entry.getKey(), entry.getValue());
}
}
public static Builder getBuilder() {
return new Builder();
}
public static class Builder implements Menu.Builder<Integer> {
protected Map<Integer, MenuElement<Integer>> menu = new LinkedHashMap<>();
protected String title;
protected Builder() {
}
@Override
public Builder setTitle(String title) {
this.title = title;
return this;
}
@Override
public Builder addOption(Integer key, MenuElement<Integer> element) {
menu.put(key, element);
return this;
}
public Builder addOption(MenuElement<Integer> element) {
int key = menu.size();
menu.put(key, element);
return this;
}
@Override
public Builder reset() {
this.title = null;
this.menu.clear();
return this;
}
@Override
public IntKeyMenu build() {
return new IntKeyMenu(new LinkedHashMap<>(menu), title);
}
}
}
| [
"1234"
] | 1234 |
439879f073e5fc57559958ecb5c0f4a2dfd4a84c | 7a929050e06376d52b2cff37462ff6145c308b74 | /src/main/java/com/spring/mvc/dao/EmployeeDAO.java | 6499eee939aabfb07c97b9d295dcec288fd0e44b | [] | no_license | ybuzevych/spring_project | ab04543e9b7530516dac344bbb2884f67fd476ef | 48036ff630e5ee5e5f01ab5a93cbec531a1460b5 | refs/heads/master | 2023-06-24T12:32:13.875818 | 2021-07-26T07:18:19 | 2021-07-26T07:18:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 304 | java | package com.spring.mvc.dao;
import com.spring.mvc.entity.Employee;
import java.util.List;
public interface EmployeeDAO {
public List<Employee> getAllEmployees();
public void saveEmployee(Employee employee);
public Employee getEmployee(int id);
public void deleteEmployee(int id);
}
| [
"egorforwork95@gmail.com"
] | egorforwork95@gmail.com |
442560b109a10b63d9b276d70995ddacf606d0aa | ba862919678b07d5ae672fc1bedfe499d3e65a2f | /ProyectoJuegoMultimedia/core/src/es/josemaria/videojuego/Mijuego.java | a6004b592470f0d3b61b73edb1105fcc3196bfc1 | [] | no_license | kareka78/ArmaduraSagrada | 9937b59e5c2fe2c3113332737718b7dfd2c0bbc3 | 3e1d9fec5fb3a7b37d5191219b26f64c595a16d3 | refs/heads/master | 2020-12-21T09:18:13.337011 | 2020-02-05T16:11:32 | 2020-02-05T16:11:32 | 236,382,758 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,491 | java | package es.josemaria.videojuego;
import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.InputMultiplexer;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.maps.tiled.TiledMap;
import com.badlogic.gdx.maps.tiled.TiledMapTileLayer;
import com.badlogic.gdx.maps.tiled.TmxMapLoader;
import com.badlogic.gdx.maps.tiled.renderers.OrthogonalTiledMapRenderer;
public class Mijuego extends ApplicationAdapter {
private OrthogonalTiledMapRenderer renderer;
private OrthographicCamera camera;
private static int WIDTH;
private static int HEIGHT;
public static final float unitScale = 1/32f;
private Jugador jugador;
private boolean caballeroJugador;
/**
* Constructor de Mijuego, recibe el caballero del personaje
* @param caballero false-> Pegaso , true -> Dragon
*/
public Mijuego(boolean caballero){
caballeroJugador=caballero;
}
/**
* Sirve para inicializar variables, como el mundo, personajes, teclado, sprites...
*/
@Override
public void create () {
//CREACIóN DEL MUNDO
//Obtenemos la anchura y la altura de nuestra pantalla en pixels
float w = Gdx.graphics.getWidth();
float h = Gdx.graphics.getHeight();
//Cargamos el tilemap desde assets
TiledMap map = new TmxMapLoader().load("mapas/PantallaInicio.tmx");
//Establecemos el renderizado del mapa dividido en Tiles de 32 dp.
renderer = new OrthogonalTiledMapRenderer(map, unitScale);
//Declaramos la cámara a través de la que veremos el mundo
camera = new OrthographicCamera();
//Establecemos el zoom de la cámara. 0.1 es más cercano que 1.
camera.zoom=1f;
//Obtenemos desde el mapa el número de tiles de ancho de la 1º Capa
WIDTH = ((TiledMapTileLayer) map.getLayers().get(0)).getWidth();
//Obtenemos desde el mapa el número de tiles de alto de la 1º Capa
HEIGHT = ((TiledMapTileLayer) map.getLayers().get(0)).getHeight();
//Sacamos por el log el número de tiles de ancho
Gdx.app.log("Width",Float.toString(WIDTH));
//Sacamos por el log el número de tiles de alto
Gdx.app.log("Height",Float.toString(HEIGHT));
//Establecemos la cámara, y le decimos cuanto tiene que ocupar. Por defecto enfoca al 0,0.
camera.setToOrtho(false, WIDTH,HEIGHT);
camera.position.x =10; //Establecemos la posición x de la cámara en función del número de tiles de la anchura. Jugaremos con esto en clase
camera.position.y = 3; //Establecemos la posición x de la cámara en función del número de tiles de la anchura. Jugaremos con esto en clase
Gdx.app.log("camera x",Float.toString(camera.position.x));
Gdx.app.log("camera x",Float.toString(camera.position.y));
camera.update(); //Colocamos la Cámara.
//Inicializar Sprites
jugador=new Jugador(caballeroJugador,camera,map);
//ESCUCHADORES
InputMultiplexer multiplexer = new InputMultiplexer();
multiplexer.addProcessor(new EscuchadorTecladoCamara(camera,map));
multiplexer.addProcessor(new EscuchadorTecladoJugador(jugador));
Gdx.input.setInputProcessor(multiplexer);
}
/**Función que se ejecuta 60 veces por segundo por defecto, y dibuja
* en pantalla, calcula acciones, consecuencias, etc. Es el núcleo de nuestro juego
*/
@Override
public void render () {
//Color de limpieza, evita que cuando se desplaza la cámara
//se queden dibujos antiguos que ya no deberían estar alli.
Gdx.gl.glClearColor(1, 0, 0, 1);
//limpia el fondo de pantalla con el color indicado
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
//indica los elementos que se meten en el batch
camera.update();
renderer.render(); //Renderizamos la vista
renderer.setView(camera); //Establecemos la vista del mundo a través de la cámara.
jugador.dibujar();
}
/**
* Se llama al cerrar la pantalla de juego, se debe llamar aqui
* al dispose de todos los elementos que tengan uno. La mayoría
* de los de LibGdx la tiene.
*/
@Override
public void dispose () {
jugador.dispose();
renderer.dispose(); //Destruimos el objeto que renderiza un mapa, para no tener filtraciones de memoria
}
}
| [
"47817807+kareka78@users.noreply.github.com"
] | 47817807+kareka78@users.noreply.github.com |
fbb44d4b3a9c5ffe2fbd72c3829c39db9dcd599f | b2c2de30aec8f6cd84162f9fdf3ab23614b6d963 | /Lept4J/src/net/sourceforge/lept4j/L_DnaHash.java | 7b927ca57e4d2b51c2e88ceec85e9805bcf5bd22 | [
"Apache-2.0"
] | permissive | ASeoighe/5thYearProject | aeaecde5eb289bcc09f570cb8815fcda2b2367a6 | 772aff2b30f04261691171a1039c417c386785c4 | refs/heads/master | 2021-09-14T11:41:11.701841 | 2018-04-24T22:30:41 | 2018-04-24T22:30:41 | 112,224,159 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,797 | java | package net.sourceforge.lept4j;
import com.sun.jna.Pointer;
import com.sun.jna.Structure;
import com.sun.jna.ptr.DoubleByReference;
import java.util.Arrays;
import java.util.List;
/**
* <i>native declaration : array.h:34</i><br>
* This file was autogenerated by <a href="http://jnaerator.googlecode.com/">JNAerator</a>,<br>
* a tool written by <a href="http://ochafik.com/">Olivier Chafik</a> that <a href="http://code.google.com/p/jnaerator/wiki/CreditsAndLicense">uses a few opensource projects.</a>.<br>
* For help, please visit <a href="http://nativelibs4java.googlecode.com/">NativeLibs4Java</a> or <a href="http://jna.dev.java.net/">JNA</a>.
*/
public class L_DnaHash extends Structure {
/** C type : l_int32 */
public int nbuckets;
/**
* initial size of each dna that is made<br>
* C type : l_int32
*/
public int initsize;
/**
* array of L_Dna<br>
* C type : L_Dna**
*/
public DoubleByReference dna;
public L_DnaHash() {
super();
}
protected List<? > getFieldOrder() {
return Arrays.asList("nbuckets", "initsize", "dna");
}
/**
* @param nbuckets C type : l_int32<br>
* @param initsize initial size of each dna that is made<br>
* C type : l_int32<br>
* @param dna array of L_Dna<br>
* C type : L_Dna**
*/
public L_DnaHash(int nbuckets, int initsize, DoubleByReference dna) {
super();
this.nbuckets = nbuckets;
this.initsize = initsize;
// if ((dna.length != this.dna.length))
// throw new IllegalArgumentException("Wrong array size !");
this.dna = dna;
}
public L_DnaHash(Pointer peer) {
super(peer);
read();
}
public static class ByReference extends L_DnaHash implements Structure.ByReference {
};
public static class ByValue extends L_DnaHash implements Structure.ByValue {
};
}
| [
"aaronjoyce2@gmail.com"
] | aaronjoyce2@gmail.com |
1aa89fdbe9b6de943cd1d6dc565ce0a8c36459f2 | d62e8091c903d64310c72c613eff6a8679bac997 | /public/secondlife/app/src/test/java/com/example/xqlim/secondlife/ExampleUnitTest.java | d4b7720e59e9504c55782f6b5ccd06a8a8ae778d | [] | no_license | JeraldYik/jeraldyik.github.io | c2c0ce1f9cf102e295e5d1af78c7b13351903684 | b86a325ee7116239a3163b904747296121a21697 | refs/heads/master | 2023-08-18T01:00:43.894447 | 2023-08-05T09:23:16 | 2023-08-05T09:23:50 | 181,647,963 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 389 | java | package com.example.xqlim.secondlife;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
} | [
"jeraldyik12@gmail.com"
] | jeraldyik12@gmail.com |
e10a5e859568de1b9622c68ebce577f3e83491d4 | 81ae03175fa4708a57fac059bdcc3669232a9021 | /RedXXIWeb/src/net/ciespal/redxxi/web/controller/RedController.java | 32a185803c9361bf06f19fe123aed664b65f0586 | [] | no_license | Idonius/rsp | 0889965b83b0adaff0a9a0406ab60db9672500ee | bb7dbbcad047fd2cf1c2e4a07e3c1135f555534a | refs/heads/master | 2020-04-25T12:21:30.005604 | 2015-08-22T00:43:11 | 2015-08-22T00:43:11 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,717 | java | package net.ciespal.redxxi.web.controller;
import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.ViewScoped;
import net.ciespal.redxxi.ejb.negocio.ArgosService;
import net.ciespal.redxxi.ejb.persistence.entities.argos.RedDTO;
import net.ciespal.redxxi.web.commons.util.JsfUtil;
import net.ciespal.redxxi.web.datamanager.RedDataManager;
import com.corvustec.commons.util.CorvustecException;
@ViewScoped
@ManagedBean(name="redController")
public class RedController {
@EJB
private ArgosService argosService;
@ManagedProperty(value="#{redDataManager}")
private RedDataManager redDataManager;
public RedController() {
}
@PostConstruct
private void init()
{
read();
}
public RedDataManager getRedDataManager() {
return redDataManager;
}
public void setRedDataManager(RedDataManager redDataManager) {
this.redDataManager = redDataManager;
}
public void save()
{
try {
argosService.createOrUpdateRed(redDataManager.getRed());
read();
cancel();
JsfUtil.addInfoMessage("Guardado Exitosamente");
} catch (CorvustecException e) {
JsfUtil.addErrorMessage(e.toString());
}
}
public void cancel()
{
redDataManager.setRed(new RedDTO());
}
public void edit(RedDTO red)
{
redDataManager.setRed(red);
}
public void delete(RedDTO red)
{
}
public void ciudadChange()
{
read();
}
private void read()
{
try {
redDataManager.setRedList(argosService.readRed());
} catch (CorvustecException e) {
JsfUtil.addErrorMessage(e.toString());
}
}
}
| [
"fensefernando@gmail.com"
] | fensefernando@gmail.com |
2e7bae65fbac6f298ee04a0b4f231e5734e43371 | 08bf401b2db69b332fb310b17fc170479dfd7c71 | /src/main/java/com/godlumen/common/MySQL5DialectUTF8.java | e4900d707775c6e1d182fb8cf8a18abfcad50c97 | [] | no_license | Godlumen/Qber | def26090eec5b84c9d95e922ca77b73cd696a52d | eca23a4192e15f5f251a596bc7b0def2095fe805 | refs/heads/master | 2021-09-02T11:18:59.280642 | 2018-01-02T08:43:02 | 2018-01-02T08:43:02 | 114,944,672 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 257 | java | package com.godlumen.common;
import org.hibernate.dialect.MySQL5InnoDBDialect;
public class MySQL5DialectUTF8 extends MySQL5InnoDBDialect{
@Override
public String getTableTypeString(){
return "ENGINE=InnoDB DEFAULT CHARSET=utf8";
}
}
| [
"cicasa@163.com"
] | cicasa@163.com |
179dee5b19132c591138f48a2fc2e5f4a7fb344f | 4f642426522f6008bff3a276c28f8c7804a28995 | /src/ch12.chainofresponsibility/dealer/goods/Fund.java | 0aba4ca839bd639fd287db02e7bcc108443017e4 | [] | no_license | Maisy/design-pattern | d53ef40dd42dcd540f4063a9468467acfb0d6300 | 822d145eb36c5a2e76a4b9fce88101123be2b4a3 | refs/heads/master | 2020-04-29T07:06:26.020891 | 2019-04-27T17:45:32 | 2019-04-27T17:45:32 | 175,940,549 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 46 | java | package dealer.goods;
public class Fund {
}
| [
"linari21@gmail.com"
] | linari21@gmail.com |
88150ce035a24d93cb2c864737f891f3fa96ef28 | 24b85b0a0954ae3d5b6c6db876ff9a8046218429 | /src/main/java/com/springframework/spring5webfluxrest/controllers/VendorController.java | 2f6d841f5588827d5de28aa5a7b7f30f4d707547 | [] | no_license | IvanKrstic123/spring5-webflux-rest | 9ea13e44e11c4b227eb5ffd1b6844901e7b81582 | a8760ee171ff11b57ef41f1d5db7cf396f7f2b75 | refs/heads/master | 2023-08-30T03:44:33.822830 | 2021-10-06T09:37:52 | 2021-10-06T09:37:52 | 412,217,399 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,137 | java | package com.springframework.spring5webfluxrest.controllers;
import com.springframework.spring5webfluxrest.domain.Category;
import com.springframework.spring5webfluxrest.domain.Vendor;
import com.springframework.spring5webfluxrest.repositories.VendorRepository;
import org.reactivestreams.Publisher;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
@RestController
public class VendorController {
private final VendorRepository vendorRepository;
public VendorController(VendorRepository vendorRepository) {
this.vendorRepository = vendorRepository;
}
@GetMapping("/api/v1/vendors")
Flux<Vendor> getVendors() {
return vendorRepository.findAll();
}
@GetMapping("/api/v1/vendors/{id}")
Mono<Vendor> getVendorById(@PathVariable String id) {
return vendorRepository.findById(id);
}
@ResponseStatus(HttpStatus.CREATED)
@PostMapping("/api/v1/vendors/")
Mono<Void> createVendor(@RequestBody Publisher<Vendor> vendorStream){
return vendorRepository.saveAll(vendorStream).then();
}
@PutMapping("/api/v1/vendors/{id}")
Mono<Vendor> updateVendor(@PathVariable String id,
@RequestBody Vendor vendor) {
vendor.setId(id);
return vendorRepository.save(vendor);
}
@ResponseStatus(HttpStatus.OK)
@PatchMapping("/api/v1/vendors/{id}")
Mono<Vendor> updateCategoryPatch(@PathVariable String id,
@RequestBody Vendor vendor) {
return vendorRepository.findById(id)
.flatMap(vendor1 -> {
// implement logic for all props
if (!vendor1.getFirstname().equals(vendor.getFirstname())) {
vendor1.setFirstname(vendor.getFirstname());
vendor1.setLastname(vendor.getLastname());
return vendorRepository.save(vendor1);
}
return Mono.just(vendor);
});
}
}
| [
"krstic8687@yahoo.com"
] | krstic8687@yahoo.com |
e71e193e9c215760422b1ad5c43f6c9291d6e2e6 | 88aca044c58c90ce1bb53f532e29a8a7aceff05e | /src/test/java/com/test/Test.java | 47a1c05caa3edd63e2da08ed824a74ad07de9146 | [] | no_license | qzbbz/bbzweb | 4618b7ba2b2ccd608052401e8b64bda13f88e715 | ba4bb57e1cfeaf3cc2f44eff853bef23d6630e76 | refs/heads/master | 2021-01-23T21:53:28.651940 | 2018-09-21T02:10:14 | 2018-09-21T02:10:14 | 34,449,049 | 1 | 5 | null | 2016-08-17T07:32:53 | 2015-04-23T10:14:11 | JavaScript | UTF-8 | Java | false | false | 2,767 | java | package com.test;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.file.FileVisitResult;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.SimpleFileVisitor;
import java.nio.file.attribute.BasicFileAttributes;
import com.itextpdf.text.BaseColor;
import com.itextpdf.text.Document;
import com.itextpdf.text.DocumentException;
import com.itextpdf.text.PageSize;
import com.itextpdf.text.Paragraph;
import com.itextpdf.text.Rectangle;
import com.itextpdf.text.pdf.PdfWriter;
public class Test {
public static void main(String[] args) throws IOException, DocumentException {
// Path startingDir = Paths.get("D:\\work");
// //遍历目录
// Files.walkFileTree(startingDir, new FindJavaVisitor());
// }
//
// private static class FindJavaVisitor extends SimpleFileVisitor<Path> {
//
// @Override
// public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) {
//
// if (file.toString().endsWith(".txt")) {
// System.out.println(file.getFileName());
// }
// return FileVisitResult.CONTINUE;
// }
// //Step 1—Create a Document.
// Document document = new Document();
// //Step 2—Get a PdfWriter instance.
// PdfWriter.getInstance(document, new FileOutputStream("D:/work/" + "createSamplePDF.pdf"));
// //Step 3—Open the Document.
// document.open();
// //Step 4—Add content.
// document.add(new Paragraph("Hello World"));
// //Step 5—Close the Document.
// document.close();
// System.out.println("---");
//页面大小
Rectangle rect = new Rectangle(PageSize.B5.rotate());
//页面背景色
rect.setBackgroundColor(BaseColor.ORANGE);
Document doc = new Document(rect);
PdfWriter writer = PdfWriter.getInstance(doc, new FileOutputStream("D:/work/" + "SamplePDF.pdf"));
//PDF版本(默认1.4)
writer.setPdfVersion(PdfWriter.PDF_VERSION_1_2);
//文档属性
doc.addTitle("Title@sample");
doc.addAuthor("Author@XiaoMing");
doc.addSubject("Subject@iText sample");
doc.addKeywords("Keywords@iText");
doc.addCreator("Creator@iText");
//页边空白
doc.setMargins(10, 20, 30, 40);
doc.open();
doc.add(new Paragraph("Hello World"));
doc.close();
}
}
| [
"haoming1100@163.com"
] | haoming1100@163.com |
2554e3ddc040ae597db614445bd85ef4d08188b1 | b55259e1d1eb295595f7b585c1cdc0b4450dd950 | /sangphpc00958_ProjectMini/src/main/java/sangphpc00958_ProjectMini/service/OrderService.java | 131e2063bce9fee8b42e85ebf3b5639be89ee55b | [] | no_license | PhamHoangSang2k/sangphpc00958_ProjectMini | 000854f432af8789b902d7ccd226239da50f05ce | 21afa75043372d1776d3af963cb4069b318abfc0 | refs/heads/master | 2023-07-28T07:46:18.592331 | 2021-09-08T08:53:01 | 2021-09-08T08:53:01 | 403,919,304 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 310 | java | package sangphpc00958_ProjectMini.service;
import java.util.List;
import com.fasterxml.jackson.databind.JsonNode;
import sangphpc00958_ProjectMini.entity.Order;
public interface OrderService {
Order create(JsonNode orderData);
Order findById(Long id);
List<Order> findByUsername(String username);
}
| [
"abc@gmail.com"
] | abc@gmail.com |
a4e9d1086681655407ba8da78e3c18cf54ac4272 | 5f645c9e930b658dd4e3b4499b98c473f35d7895 | /wine-cellar-api/src/main/java/cz/muni/fi/pa165/facade/PriceFacade.java | 3890bfc74bd5ad2d70b451da35a7b5ef3757bb63 | [] | no_license | mbamburova/pa165-wine-cellar | e64c82f11dcf1879bb6647393b43a3bf95754371 | 1efa1818177a2545ab43cbc04139b29188571051 | refs/heads/master | 2021-01-11T06:44:15.503246 | 2017-01-17T22:30:40 | 2017-01-17T22:30:40 | 71,838,974 | 1 | 7 | null | 2017-01-13T18:46:36 | 2016-10-24T22:57:49 | Java | UTF-8 | Java | false | false | 863 | java | package cz.muni.fi.pa165.facade;
import cz.muni.fi.pa165.dto.marketingEvent.MarketingEventDto;
import cz.muni.fi.pa165.dto.packing.PackingDto;
import cz.muni.fi.pa165.dto.price.PriceCreateDto;
import cz.muni.fi.pa165.dto.price.PriceDto;
import java.math.BigDecimal;
import java.util.Currency;
import java.util.List;
/**
* @author Michaela Bamburová on 08.11.2016.
*/
public interface PriceFacade {
Long createPrice(PriceCreateDto price);
void updatePrice(PriceDto price);
void deletePrice(Long id);
List<PriceDto> findAllPrices();
PriceDto findPriceById(Long priceId);
List<PriceDto> findPricesByMarketingEvent(MarketingEventDto marketingEvent);
List<PriceDto> findPricesByPacking(PackingDto packing);
List<PriceDto> findPricesByCurrency(Currency currency);
List<PriceDto> findPricesByPrice(BigDecimal price);
}
| [
"433732@mail.muni.cz"
] | 433732@mail.muni.cz |
f2a8e9b379533991ae6b1e55ea61cc53623f1577 | 1653ce4d8e15e2a6037d5619aff2e1fcdd1f3ebd | /src/dao/MagazineDao.java | 53156a3bfe7b0d31594afaafc4a7ac8c989d5571 | [] | no_license | dpwls1379/magazine | 0fc3794072d08483c08e1ff1e3be319a862c9e39 | 374f3eca65e2015154a44e9ed3a1a3b49571d8c3 | refs/heads/master | 2020-12-02T22:54:46.176136 | 2017-07-21T12:49:12 | 2017-07-21T12:49:12 | 96,202,991 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,267 | java | package dao;
import java.io.IOException;
import java.io.Reader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import model.Magazine;
public class MagazineDao {
private static MagazineDao instance;
private MagazineDao() {
}
public static MagazineDao getInstance() {
if (instance == null) {
instance = new MagazineDao();
}
return instance;
}
private static SqlSession session;
static {// static: 초기화 블록
try {
Reader reader = Resources.getResourceAsReader("configuration.xml");
SqlSessionFactory sqlMapper = new SqlSessionFactoryBuilder().build(reader);
session = sqlMapper.openSession(true);
reader.close();
} catch (IOException e) {
System.out.println(e.getMessage());
}
}
public int getTotal(int ma_kind) {
int result = 0;
Magazine magazine=new Magazine();
magazine.setMa_kind(ma_kind);
result = (int) session.selectOne("magazinens.getTotal",magazine);
return result;
}
public List<Magazine> list(int startRow, int endRow, int ma_kind) {
// TODO Auto-generated method stub
List<Magazine> list = new ArrayList<>();
HashMap<String, Integer> hashmap = new HashMap<>();
hashmap.put("startRow", startRow);
hashmap.put("endRow", endRow);
hashmap.put("ma_kind", ma_kind);
list = session.selectList("magazinens.list", hashmap);
return list;
}
public List<Magazine> mylist(){
List<Magazine> list=new ArrayList<>();
list=session.selectList("magazinens.mylist");
return list;
}
public List<Magazine> mgrList() {
// TODO Auto-generated method stub
List<Magazine> list=new ArrayList<>();
list=session.selectList("magazinens.mgrlist");
return list;
}
public List<Magazine> mIndex(){
List<Magazine> list=new ArrayList<>();
list=session.selectList("magazinens.mindex");
return list;
}
public int max() {
int result = 0;
result = (int) session.selectOne("magazinens.max");
return result;
}
public int insert(Magazine magazine) {
int result = 0;
int number = max();
magazine.setMa_num(number);
if (magazine.getMa_image() == null) {
magazine.setMa_image("nothing.jpg");
}
result = session.insert("magazinens.insert", magazine);
return result;
}
public void readcountUpdate(int ma_num) {
session.update("magazinens.readcountUpdate", ma_num);
}
public Magazine select(int ma_num) {
Magazine magazine = new Magazine();
magazine = (Magazine) session.selectOne("magazinens.select", ma_num);
return magazine;
}
public int update(Magazine magazine) {
// TODO Auto-generated method stub
int result = 0;
if (magazine.getMa_image() == null) {
magazine.setMa_image("nothing.jpg");
}
result = session.update("magazinens.update", magazine);
return result;
}
public int delete(int ma_num) {
// TODO Auto-generated method stub
int result = 0;
result = session.update("magazinens.delete", ma_num);
return result;
}
public int realDel(int ma_num) {
// TODO Auto-generated method stub
int result=0;
result=session.delete("magazinens.realDel",ma_num);
return result;
}
}
| [
"rndeo1379@naver.com"
] | rndeo1379@naver.com |
5dc0459d33a5ff2b4889ba775a99594a73d67cae | 138b1a87d78307d8ca255fa930d5a1c156a390c4 | /src/main/java/com/gcm/cursomc/resources/CategoriaResource.java | 74bfb28cba5c63a6446d9de0115d44da93b40758 | [] | no_license | gcuj/cursomc | 51810cb87dfffd3442824c1bba4c77ae6f8be678 | 59e50d503ff92d1dc56197f3f8230d561c01d80d | refs/heads/master | 2020-03-21T18:56:05.802993 | 2018-06-27T19:54:58 | 2018-06-27T19:54:58 | 138,921,613 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 416 | java | package com.gcm.cursomc.resources;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping(value="/categorias")
public class CategoriaResource {
@RequestMapping(method=RequestMethod.GET)
public String listar() {
return "REST funcionando";
}
}
| [
"gcme@outlook.com.br"
] | gcme@outlook.com.br |
9bb0c90a8f1f04caa9c281a549f13898830b8613 | 5f2d25a47e69ee6a27653a07181cbcb6c2e536db | /app/src/main/java/com/carvision/data/vision/response/PagesWithMatchingImage.java | ec27e514d0adb5afd21e5af36bb0ea70e5324296 | [] | no_license | danial229/Coloride | 21dae0f40f8d1ec29c22206dad63873ab3027b68 | fb3591ddef169a5a7b94a05b9737cb5550781d2c | refs/heads/coloride | 2021-01-31T07:02:16.642287 | 2020-04-03T23:26:58 | 2020-04-03T23:26:58 | 243,357,527 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,394 | java |
package com.carvision.data.vision.response;
import java.util.List;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class PagesWithMatchingImage {
@SerializedName("fullMatchingImages")
@Expose
private List<FullMatchingImage> fullMatchingImages = null;
@SerializedName("pageTitle")
@Expose
private String pageTitle;
@SerializedName("url")
@Expose
private String url;
@SerializedName("partialMatchingImages")
@Expose
private List<PartialMatchingImage> partialMatchingImages = null;
public List<FullMatchingImage> getFullMatchingImages() {
return fullMatchingImages;
}
public void setFullMatchingImages(List<FullMatchingImage> fullMatchingImages) {
this.fullMatchingImages = fullMatchingImages;
}
public String getPageTitle() {
return pageTitle;
}
public void setPageTitle(String pageTitle) {
this.pageTitle = pageTitle;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public List<PartialMatchingImage> getPartialMatchingImages() {
return partialMatchingImages;
}
public void setPartialMatchingImages(List<PartialMatchingImage> partialMatchingImages) {
this.partialMatchingImages = partialMatchingImages;
}
}
| [
"1835310@brunel.ac.uk"
] | 1835310@brunel.ac.uk |
7d3dcd195c286ce7708deb07d8a2481b005136f5 | 11a7615d4f0f07390156e19a7cced27c08ed5388 | /ris03_v02/src/singleton/DatabaseSingleton1.java | 830d9c43cd337d5cf636090b17a319eed70fd063 | [] | no_license | loshmi/ris | eb9cdbd680f06ba116927c8c81800e79a43e0767 | 163de32650c7a4f03048d124cfdd4fadf8e9da04 | refs/heads/master | 2021-08-30T20:35:47.149512 | 2017-12-19T10:26:22 | 2017-12-19T10:26:22 | 109,952,985 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,500 | 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 singleton;
import static java.lang.Thread.sleep;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author loshmi
*/
public class DatabaseSingleton1 extends DatabaseSingleton
{
/**
* Ovo je verzija koja nije Thread safe
* Ima tri komponente:
* 1. Static variabla koja je na pocetku setovana na null
* 2. Private konstruktor
* 3. getInstance metoda koja proverava da li je instance promenljiva null,
* sto ukazuje na to da nije jos kreirana
*/
private static DatabaseSingleton1 instance = null;
private DatabaseSingleton1 ()
{
}
public static DatabaseSingleton1 getInstance ()
{
if (instance == null)
{
// Pauza je dodata da bi se ilustrovalo kako ova implementacija nije Thread safe
try {
sleep(2000);
} catch (InterruptedException ex) {
Logger.getLogger(DatabaseSingleton1.class.getName()).log(Level.SEVERE, null, ex);
}
instance = new DatabaseSingleton1 ();
}
return instance;
}
public void connect()
{
System.out.println("Connected!");
}
public void disconnect()
{
System.out.println("Disonnected!");
}
}
| [
"milos.subotic@gmail.com"
] | milos.subotic@gmail.com |
4561c2e2ede01ac52ec52654317ada6474cfcf9e | 530ace00a675d7effda8f3c61662afde0b963771 | /ThailandV2X/baselib/src/main/java/com/library/base/widget/MyViewPagerNew.java | 3548097b096b3ba24bb8936c2e1bf9858ea91574 | [] | no_license | CHENKANGS/BaseProject | d282355a590a31dd8fcf3eab7815b842adba28c0 | 74d5d8215fd773a430217d91b3a5a4afe88f8331 | refs/heads/master | 2022-06-18T06:22:03.746864 | 2020-05-11T07:51:31 | 2020-05-11T07:51:31 | 262,973,504 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,083 | java | package com.library.base.widget;
import android.content.Context;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
/**
* Created by ChenKang on 2017/8/10.
*/
public class MyViewPagerNew extends ViewPager {
private Context context;
// 是否滑动 ;默认启动
private boolean scrollble = true;
public MyViewPagerNew(Context context) {
super(context);
this.context = context;
}
public MyViewPagerNew(Context context, AttributeSet attrs) {
super(context, attrs);
this.context = context;
}
@Override
public boolean onTouchEvent(MotionEvent arg0) {
if (scrollble) {
return super.onTouchEvent(arg0);
} else {
return false;
}
}
@Override
public boolean onInterceptTouchEvent(MotionEvent arg0) {
if (scrollble) {
return super.onInterceptTouchEvent(arg0);
} else {
return false;
}
}
public boolean isScrollble() {
return scrollble;
}
public void setScrollble(boolean scrollble) {
this.scrollble = scrollble;
}
@Override
public void setCurrentItem(int item, boolean smoothScroll) {
super.setCurrentItem(item, smoothScroll);
}
@Override
public void setCurrentItem(int item) {
super.setCurrentItem(item, false);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
int height = 0;
for (int i = 0; i < getChildCount(); i++) {
View child = getChildAt(i);
child.measure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
int h = child.getMeasuredHeight();
if (h > height) height = h;
}
heightMeasureSpec = MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY);
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
}
| [
"280306701@qq.com"
] | 280306701@qq.com |
3dc99cbffc524ee105a15490b5de602eedfbb973 | dc57b2c8621e347615e8e160af30b2a52aa34288 | /src/main/java/com/jp/ichi/spigot/commandhelper/argument/ArgumentBlockData.java | 6de5e6e8b0a476283148052dc3a69220d0f326f5 | [] | no_license | Team-Abyss/CommandHelper | 8919b1990d689c5bf9f544529607c253e1955043 | 7cc909965d5f260f75fb27722a50bbb5e10583f1 | refs/heads/master | 2023-01-19T15:41:39.105487 | 2020-11-11T13:31:43 | 2020-11-11T13:31:43 | 281,922,868 | 0 | 0 | null | 2020-11-10T14:05:02 | 2020-07-23T10:36:33 | Java | UTF-8 | Java | false | false | 833 | java | package com.jp.ichi.spigot.commandhelper.argument;
import com.mojang.brigadier.builder.RequiredArgumentBuilder;
import com.mojang.brigadier.context.CommandContext;
import net.minecraft.server.v1_13_R2.ArgumentTile;
import net.minecraft.server.v1_13_R2.CommandListenerWrapper;
import org.bukkit.block.data.BlockData;
import org.bukkit.craftbukkit.v1_13_R2.block.data.CraftBlockData;
public class ArgumentBlockData extends SimpleCommandArgument<BlockData> {
public ArgumentBlockData(String name, CommandArgument<?>... arguments) {
super(name,()-> RequiredArgumentBuilder.argument(name, ArgumentTile.a()),arguments);
}
@Override
public BlockData getValue(CommandContext<CommandListenerWrapper> commandContext) {
return CraftBlockData.fromData(ArgumentTile.a(commandContext, getName()).a());
}
}
| [
"unconfigured@null.spigotmc.org"
] | unconfigured@null.spigotmc.org |
fe80ac43ca1e44a9a6d055fa5845a0b3b33ad1d7 | 0c047cd94ca3d12099b7471119fd044ccd382f46 | /Patterns/src/main/java/CreationalPattern4/Hamburger.java | 90bc0ef229b1beb23a88a6953f9d362bae4491a6 | [] | no_license | Sowmyasree24/DesignPatterns | 06b091ea53eedd99b35bf24b3c730c028f7103c1 | 8dfb5cf02acc917d0dd8d883595bfa232e8535c8 | refs/heads/master | 2022-10-06T15:38:09.204833 | 2020-05-31T13:13:00 | 2020-05-31T13:13:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 192 | java | package CreationalPattern4;
public abstract class Hamburger implements ItemType{
public Packing packing() {
return new Wrapper();
}
public abstract float price();
}
| [
"noreply@github.com"
] | Sowmyasree24.noreply@github.com |
0141f45c54e82872d2a01d55405f394b881e4a8c | cffff8c08ea81432754337bb33f3495c13f7c118 | /xengine-core/src/main/java/org/apache/zeppelin/interpreter/InterpreterSettingManager.java | 19fe265580aedf57d7963e58fe42ba34de249271 | [] | no_license | zjffdu/x-engine | e47f677dd0f26457448c6eeccc255d2e89de4ee4 | 3398297f8fe8ab821d9cc4c0a37a1b72896f4337 | refs/heads/master | 2022-11-03T20:09:06.458144 | 2019-10-23T09:44:27 | 2019-10-23T09:44:27 | 215,936,249 | 1 | 0 | null | 2022-10-12T20:32:58 | 2019-10-18T03:45:08 | Java | UTF-8 | Java | false | false | 36,976 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.zeppelin.interpreter;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.zeppelin.conf.ZeppelinConfiguration;
import org.apache.zeppelin.conf.ZeppelinConfiguration.ConfVars;
import org.apache.zeppelin.dep.Dependency;
import org.apache.zeppelin.dep.DependencyResolver;
import org.apache.zeppelin.display.AngularObjectRegistryListener;
import org.apache.zeppelin.interpreter.Interpreter.RegisteredInterpreter;
import org.apache.zeppelin.interpreter.remote.RemoteInterpreterProcess;
import org.apache.zeppelin.interpreter.remote.RemoteInterpreterProcessListener;
import org.apache.zeppelin.interpreter.thrift.RemoteInterpreterService;
import org.apache.zeppelin.resource.Resource;
import org.apache.zeppelin.resource.ResourcePool;
import org.apache.zeppelin.resource.ResourceSet;
import org.apache.zeppelin.storage.ConfigStorage;
import org.apache.zeppelin.storage.LocalConfigStorage;
import org.apache.zeppelin.util.ReflectionUtils;
import org.eclipse.jetty.util.annotation.ManagedAttribute;
import org.eclipse.jetty.util.annotation.ManagedObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.sonatype.aether.repository.Authentication;
import org.sonatype.aether.repository.Proxy;
import org.sonatype.aether.repository.RemoteRepository;
import javax.inject.Inject;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.lang.reflect.Type;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
import java.nio.file.DirectoryStream.Filter;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
/**
* InterpreterSettingManager is the component which manage all the interpreter settings.
* (load/create/update/remove/get)
* TODO(zjffdu) We could move it into another separated component.
*/
@ManagedObject("interpreterSettingManager")
public class InterpreterSettingManager {
private static final Logger LOGGER = LoggerFactory.getLogger(InterpreterSettingManager.class);
private static final Map<String, Object> DEFAULT_EDITOR = ImmutableMap.of(
"language", (Object) "text",
"editOnDblClick", false);
private final ZeppelinConfiguration conf;
private final Path interpreterDirPath;
/**
* This is only InterpreterSetting templates with default name and properties
* name --> InterpreterSetting
*/
private final Map<String, InterpreterSetting> interpreterSettingTemplates =
Maps.newConcurrentMap();
/**
* This is used by creating and running Interpreters
* id --> InterpreterSetting
* TODO(zjffdu) change it to name --> InterpreterSetting
*/
private final Map<String, InterpreterSetting> interpreterSettings =
Maps.newConcurrentMap();
private final List<RemoteRepository> interpreterRepositories;
private InterpreterOption defaultOption;
private String defaultInterpreterGroup;
private final Gson gson;
private AngularObjectRegistryListener angularObjectRegistryListener;
private RemoteInterpreterProcessListener remoteInterpreterProcessListener;
// private ApplicationEventListener appEventListener;
private DependencyResolver dependencyResolver;
private LifecycleManager lifecycleManager;
// private RecoveryStorage recoveryStorage;
private ConfigStorage configStorage;
private RemoteInterpreterEventServer interpreterEventServer;
@Inject
public InterpreterSettingManager(ZeppelinConfiguration zeppelinConfiguration,
AngularObjectRegistryListener angularObjectRegistryListener,
RemoteInterpreterProcessListener
remoteInterpreterProcessListener)
throws IOException {
this(zeppelinConfiguration, new InterpreterOption(),
angularObjectRegistryListener,
remoteInterpreterProcessListener);
}
public InterpreterSettingManager(ZeppelinConfiguration conf,
InterpreterOption defaultOption,
AngularObjectRegistryListener angularObjectRegistryListener,
RemoteInterpreterProcessListener remoteInterpreterProcessListener)
throws IOException {
this.conf = conf;
this.defaultOption = defaultOption;
this.interpreterDirPath = Paths.get(conf.getInterpreterDir());
LOGGER.debug("InterpreterRootPath: {}", interpreterDirPath);
this.dependencyResolver =
new DependencyResolver(conf.getString(ConfVars.ZEPPELIN_INTERPRETER_LOCALREPO));
this.interpreterRepositories = dependencyResolver.getRepos();
this.defaultInterpreterGroup = conf.getString(ConfVars.ZEPPELIN_INTERPRETER_GROUP_DEFAULT);
this.gson = new GsonBuilder().setPrettyPrinting().create();
this.angularObjectRegistryListener = angularObjectRegistryListener;
this.remoteInterpreterProcessListener = remoteInterpreterProcessListener;
// this.appEventListener = appEventListener;
// this.recoveryStorage =
// ReflectionUtils.createClazzInstance(
// conf.getRecoveryStorageClass(),
// new Class[] {ZeppelinConfiguration.class, InterpreterSettingManager.class},
// new Object[] {conf, this});
// this.recoveryStorage.init();
// LOGGER.info("Using RecoveryStorage: " + this.recoveryStorage.getClass().getName());
this.lifecycleManager =
ReflectionUtils.createClazzInstance(
conf.getLifecycleManagerClass(),
new Class[] {ZeppelinConfiguration.class},
new Object[] {conf});
LOGGER.info("Using LifecycleManager: " + this.lifecycleManager.getClass().getName());
this.configStorage = new LocalConfigStorage(conf);
this.interpreterEventServer = new RemoteInterpreterEventServer(conf, this);
this.interpreterEventServer.start();
init();
}
public void refreshInterpreterTemplates() {
Set<String> installedInterpreters = Sets.newHashSet(interpreterSettingTemplates.keySet());
try {
LOGGER.info("Refreshing interpreter list");
loadInterpreterSettingFromDefaultDir(false);
Set<String> newlyAddedInterpreters = Sets.newHashSet(interpreterSettingTemplates.keySet());
newlyAddedInterpreters.removeAll(installedInterpreters);
if(!newlyAddedInterpreters.isEmpty()) {
saveToFile();
}
} catch (IOException e) {
LOGGER.error("Error while saving interpreter settings.");
}
}
private void initInterpreterSetting(InterpreterSetting interpreterSetting) {
interpreterSetting.setConf(conf)
.setInterpreterSettingManager(this)
.setAngularObjectRegistryListener(angularObjectRegistryListener)
.setRemoteInterpreterProcessListener(remoteInterpreterProcessListener)
.setDependencyResolver(dependencyResolver)
.setLifecycleManager(lifecycleManager)
.setInterpreterEventServer(interpreterEventServer)
.postProcessing();
}
/**
* Load interpreter setting from interpreter.json
*/
private void loadFromFile() throws IOException {
InterpreterInfoSaving infoSaving =
configStorage.loadInterpreterSettings();
if (infoSaving == null) {
// it is fresh zeppelin instance if there's no interpreter.json, just create interpreter
// setting from interpreterSettingTemplates
for (InterpreterSetting interpreterSettingTemplate : interpreterSettingTemplates.values()) {
InterpreterSetting interpreterSetting = new InterpreterSetting(interpreterSettingTemplate);
initInterpreterSetting(interpreterSetting);
interpreterSettings.put(interpreterSetting.getId(), interpreterSetting);
}
return;
}
//TODO(zjffdu) still ugly (should move all to InterpreterInfoSaving)
for (InterpreterSetting savedInterpreterSetting : infoSaving.interpreterSettings.values()) {
savedInterpreterSetting.setProperties(InterpreterSetting.convertInterpreterProperties(
savedInterpreterSetting.getProperties()
));
initInterpreterSetting(savedInterpreterSetting);
InterpreterSetting interpreterSettingTemplate =
interpreterSettingTemplates.get(savedInterpreterSetting.getGroup());
// InterpreterSettingTemplate is from interpreter-setting.json which represent the latest
// InterpreterSetting, while InterpreterSetting is from interpreter.json which represent
// the user saved interpreter setting
if (interpreterSettingTemplate != null) {
savedInterpreterSetting.setInterpreterDir(interpreterSettingTemplate.getInterpreterDir());
// merge properties from interpreter-setting.json and interpreter.json
Map<String, InterpreterProperty> mergedProperties =
new HashMap<>(InterpreterSetting.convertInterpreterProperties(
interpreterSettingTemplate.getProperties()));
Map<String, InterpreterProperty> savedProperties = InterpreterSetting
.convertInterpreterProperties(savedInterpreterSetting.getProperties());
for (Map.Entry<String, InterpreterProperty> entry : savedProperties.entrySet()) {
// only merge properties whose value is not empty
if (entry.getValue().getValue() != null && !
StringUtils.isBlank(entry.getValue().toString())) {
mergedProperties.put(entry.getKey(), entry.getValue());
}
}
savedInterpreterSetting.setProperties(mergedProperties);
// merge InterpreterInfo
savedInterpreterSetting.setInterpreterInfos(
interpreterSettingTemplate.getInterpreterInfos());
savedInterpreterSetting.setInterpreterRunner(
interpreterSettingTemplate.getInterpreterRunner());
} else {
LOGGER.warn("No InterpreterSetting Template found for InterpreterSetting: "
+ savedInterpreterSetting.getGroup() + ", but it is found in interpreter.json, "
+ "it would be skipped.");
continue;
}
// Overwrite the default InterpreterSetting we registered from InterpreterSetting Templates
// remove it first
for (InterpreterSetting setting : interpreterSettings.values()) {
if (setting.getName().equals(savedInterpreterSetting.getName())) {
interpreterSettings.remove(setting.getId());
}
}
savedInterpreterSetting.postProcessing();
LOGGER.info("Create Interpreter Setting {} from interpreter.json",
savedInterpreterSetting.getName());
interpreterSettings.put(savedInterpreterSetting.getId(), savedInterpreterSetting);
}
if (infoSaving.interpreterRepositories != null) {
for (RemoteRepository repo : infoSaving.interpreterRepositories) {
if (!dependencyResolver.getRepos().contains(repo)) {
this.interpreterRepositories.add(repo);
}
}
// force interpreter dependencies loading once the
// repositories have been loaded.
for (InterpreterSetting setting : interpreterSettings.values()) {
setting.setDependencies(setting.getDependencies());
}
}
}
public void saveToFile() throws IOException {
InterpreterInfoSaving info = new InterpreterInfoSaving();
info.interpreterSettings = Maps.newHashMap(interpreterSettings);
info.interpreterRepositories = interpreterRepositories;
configStorage.save(info);
}
private void init() throws IOException {
loadInterpreterSettingFromDefaultDir(true);
loadFromFile();
saveToFile();
}
private void loadInterpreterSettingFromDefaultDir(boolean override) throws IOException {
// 1. detect interpreter setting via interpreter-setting.json in each interpreter folder
// 2. detect interpreter setting in interpreter.json that is saved before
String interpreterJson = conf.getInterpreterJson();
ClassLoader cl = Thread.currentThread().getContextClassLoader();
if (Files.exists(interpreterDirPath)) {
for (Path interpreterDir : Files
.newDirectoryStream(interpreterDirPath, new Filter<Path>() {
@Override
public boolean accept(Path entry) throws IOException {
return Files.exists(entry) && Files.isDirectory(entry);
}
})) {
String interpreterDirString = interpreterDir.toString();
/**
* Register interpreter by the following ordering
* 1. Register it from path {ZEPPELIN_HOME}/interpreter/{interpreter_name}/
* interpreter-setting.json
* 2. Register it from interpreter-setting.json in classpath
* {ZEPPELIN_HOME}/interpreter/{interpreter_name}
*/
if (!registerInterpreterFromPath(interpreterDirString, interpreterJson, override)) {
if (!registerInterpreterFromResource(cl, interpreterDirString, interpreterJson,
override)) {
LOGGER.warn("No interpreter-setting.json found in " + interpreterDirString);
}
}
}
} else {
LOGGER.warn("InterpreterDir {} doesn't exist", interpreterDirPath);
}
}
public RemoteInterpreterProcessListener getRemoteInterpreterProcessListener() {
return remoteInterpreterProcessListener;
}
private boolean registerInterpreterFromResource(ClassLoader cl, String interpreterDir,
String interpreterJson, boolean override) throws IOException {
URL[] urls = recursiveBuildLibList(new File(interpreterDir));
ClassLoader tempClassLoader = new URLClassLoader(urls, null);
URL url = tempClassLoader.getResource(interpreterJson);
if (url == null) {
return false;
}
LOGGER.debug("Reading interpreter-setting.json from {} as Resource", url);
List<RegisteredInterpreter> registeredInterpreterList =
getInterpreterListFromJson(url.openStream());
registerInterpreterSetting(registeredInterpreterList, interpreterDir, override);
return true;
}
private boolean registerInterpreterFromPath(String interpreterDir, String interpreterJson,
boolean override) throws IOException {
Path interpreterJsonPath = Paths.get(interpreterDir, interpreterJson);
if (Files.exists(interpreterJsonPath)) {
LOGGER.debug("Reading interpreter-setting.json from file {}", interpreterJsonPath);
List<RegisteredInterpreter> registeredInterpreterList =
getInterpreterListFromJson(new FileInputStream(interpreterJsonPath.toFile()));
registerInterpreterSetting(registeredInterpreterList, interpreterDir, override);
return true;
}
return false;
}
private List<RegisteredInterpreter> getInterpreterListFromJson(InputStream stream) {
Type registeredInterpreterListType = new TypeToken<List<RegisteredInterpreter>>() {
}.getType();
return gson.fromJson(new InputStreamReader(stream), registeredInterpreterListType);
}
private void registerInterpreterSetting(List<RegisteredInterpreter> registeredInterpreters,
String interpreterDir, boolean override) {
Map<String, DefaultInterpreterProperty> properties = new HashMap<>();
List<InterpreterInfo> interpreterInfos = new ArrayList<>();
InterpreterOption option = defaultOption;
String group = null;
InterpreterRunner runner = null;
for (RegisteredInterpreter registeredInterpreter : registeredInterpreters) {
//TODO(zjffdu) merge RegisteredInterpreter & InterpreterInfo
InterpreterInfo interpreterInfo =
new InterpreterInfo(registeredInterpreter.getClassName(), registeredInterpreter.getName(),
registeredInterpreter.isDefaultInterpreter(), registeredInterpreter.getEditor(),
registeredInterpreter.getConfig());
interpreterInfo.setConfig(registeredInterpreter.getConfig());
group = registeredInterpreter.getGroup();
runner = registeredInterpreter.getRunner();
// use defaultOption if it is not specified in interpreter-setting.json
if (registeredInterpreter.getOption() != null) {
option = registeredInterpreter.getOption();
}
properties.putAll(registeredInterpreter.getProperties());
interpreterInfos.add(interpreterInfo);
}
InterpreterSetting interpreterSettingTemplate = new InterpreterSetting.Builder()
.setGroup(group)
.setName(group)
.setInterpreterInfos(interpreterInfos)
.setProperties(properties)
.setDependencies(new ArrayList<Dependency>())
.setOption(option)
.setRunner(runner)
.setInterpreterDir(interpreterDir)
.setRunner(runner)
.setConf(conf)
.setIntepreterSettingManager(this)
.create();
String key = interpreterSettingTemplate.getName();
if(override || !interpreterSettingTemplates.containsKey(key)) {
LOGGER.info("Register InterpreterSettingTemplate: {}", key);
interpreterSettingTemplates.put(key, interpreterSettingTemplate);
}
}
@VisibleForTesting
public InterpreterSetting getDefaultInterpreterSetting(String noteId) {
List<InterpreterSetting> allInterpreterSettings = getInterpreterSettings(noteId);
return allInterpreterSettings.size() > 0 ? allInterpreterSettings.get(0) : null;
}
public List<InterpreterSetting> getInterpreterSettings(String noteId) {
return get();
}
public InterpreterSetting getInterpreterSettingByName(String name) {
try {
for (InterpreterSetting setting : interpreterSettings.values()) {
if (setting.getName().equals(name)) {
return setting;
}
}
throw new RuntimeException("No such interpreter setting: " + name);
} finally {
}
}
public ManagedInterpreterGroup getInterpreterGroupById(String groupId) {
for (InterpreterSetting setting : interpreterSettings.values()) {
ManagedInterpreterGroup interpreterGroup = setting.getInterpreterGroup(groupId);
if (interpreterGroup != null) {
return interpreterGroup;
}
}
return null;
}
//TODO(zjffdu) logic here is a little ugly
public Map<String, Object> getEditorSetting(Interpreter interpreter, String user, String noteId,
String replName) {
Map<String, Object> editor = DEFAULT_EDITOR;
String group = StringUtils.EMPTY;
try {
String defaultSettingName = getDefaultInterpreterSetting(noteId).getName();
List<InterpreterSetting> intpSettings = getInterpreterSettings(noteId);
for (InterpreterSetting intpSetting : intpSettings) {
String[] replNameSplit = replName.split("\\.");
if (replNameSplit.length == 2) {
group = replNameSplit[0];
}
// when replName is 'name' of interpreter
if (intpSetting.getName().equals(defaultSettingName)) {
editor = intpSetting.getEditorFromSettingByClassName(interpreter.getClassName());
}
// when replName is 'alias name' of interpreter or 'group' of interpreter
if (replName.equals(intpSetting.getName()) || group.equals(intpSetting.getName())) {
editor = intpSetting.getEditorFromSettingByClassName(interpreter.getClassName());
break;
}
}
} catch (NullPointerException e) {
// Use `debug` level because this log occurs frequently
LOGGER.debug("Couldn't get interpreter editor setting");
}
return editor;
}
// Get configuration parameters from `interpreter-setting.json`
// based on the interpreter group ID
public Map<String, Object> getConfigSetting(String interpreterGroupId) {
InterpreterSetting interpreterSetting = get(interpreterGroupId);
if (null != interpreterSetting) {
List<InterpreterInfo> interpreterInfos = interpreterSetting.getInterpreterInfos();
int infoSize = interpreterInfos.size();
for (InterpreterInfo intpInfo : interpreterInfos) {
if ((intpInfo.isDefaultInterpreter() || (infoSize == 1))
&& (intpInfo.getConfig() != null)) {
return intpInfo.getConfig();
}
}
}
return new HashMap<>();
}
public List<ManagedInterpreterGroup> getAllInterpreterGroup() {
List<ManagedInterpreterGroup> interpreterGroups = new ArrayList<>();
for (InterpreterSetting interpreterSetting : interpreterSettings.values()) {
interpreterGroups.addAll(interpreterSetting.getAllInterpreterGroups());
}
return interpreterGroups;
}
//TODO(zjffdu) move Resource related api to ResourceManager
public ResourceSet getAllResources() {
return getAllResourcesExcept(null);
}
private ResourceSet getAllResourcesExcept(String interpreterGroupExcludsion) {
ResourceSet resourceSet = new ResourceSet();
for (ManagedInterpreterGroup intpGroup : getAllInterpreterGroup()) {
if (interpreterGroupExcludsion != null &&
intpGroup.getId().equals(interpreterGroupExcludsion)) {
continue;
}
RemoteInterpreterProcess remoteInterpreterProcess = intpGroup.getRemoteInterpreterProcess();
if (remoteInterpreterProcess == null) {
ResourcePool localPool = intpGroup.getResourcePool();
if (localPool != null) {
resourceSet.addAll(localPool.getAll());
}
} else if (remoteInterpreterProcess.isRunning()) {
List<String> resourceList = remoteInterpreterProcess.callRemoteFunction(
new RemoteInterpreterProcess.RemoteFunction<List<String>>() {
@Override
public List<String> call(RemoteInterpreterService.Client client) throws Exception {
return client.resourcePoolGetAll();
}
});
if (resourceList != null) {
for (String res : resourceList) {
resourceSet.add(Resource.fromJson(res));
}
}
}
}
return resourceSet;
}
// public RecoveryStorage getRecoveryStorage() {
// return recoveryStorage;
// }
public void removeResourcesBelongsToParagraph(String noteId, String paragraphId) {
for (ManagedInterpreterGroup intpGroup : getAllInterpreterGroup()) {
ResourceSet resourceSet = new ResourceSet();
RemoteInterpreterProcess remoteInterpreterProcess = intpGroup.getRemoteInterpreterProcess();
if (remoteInterpreterProcess == null) {
ResourcePool localPool = intpGroup.getResourcePool();
if (localPool != null) {
resourceSet.addAll(localPool.getAll());
}
if (noteId != null) {
resourceSet = resourceSet.filterByNoteId(noteId);
}
if (paragraphId != null) {
resourceSet = resourceSet.filterByParagraphId(paragraphId);
}
for (Resource r : resourceSet) {
localPool.remove(
r.getResourceId().getNoteId(),
r.getResourceId().getParagraphId(),
r.getResourceId().getName());
}
} else if (remoteInterpreterProcess.isRunning()) {
List<String> resourceList = remoteInterpreterProcess.callRemoteFunction(
new RemoteInterpreterProcess.RemoteFunction<List<String>>() {
@Override
public List<String> call(RemoteInterpreterService.Client client) throws Exception {
return client.resourcePoolGetAll();
}
});
for (String res : resourceList) {
resourceSet.add(Resource.fromJson(res));
}
if (noteId != null) {
resourceSet = resourceSet.filterByNoteId(noteId);
}
if (paragraphId != null) {
resourceSet = resourceSet.filterByParagraphId(paragraphId);
}
for (final Resource r : resourceSet) {
remoteInterpreterProcess.callRemoteFunction(
new RemoteInterpreterProcess.RemoteFunction<Void>() {
@Override
public Void call(RemoteInterpreterService.Client client) throws Exception {
client.resourceRemove(
r.getResourceId().getNoteId(),
r.getResourceId().getParagraphId(),
r.getResourceId().getName());
return null;
}
});
}
}
}
}
public void removeResourcesBelongsToNote(String noteId) {
removeResourcesBelongsToParagraph(noteId, null);
}
/**
* Overwrite dependency jar under local-repo/{interpreterId} if jar file in original path is
* changed
*/
private void copyDependenciesFromLocalPath(final InterpreterSetting setting) {
try {
List<Dependency> deps = setting.getDependencies();
if (deps != null) {
LOGGER.info("Start to copy dependencies for interpreter: " + setting.getName());
for (Dependency d : deps) {
File destDir = new File(
conf.getRelativeDir(ConfVars.ZEPPELIN_DEP_LOCALREPO));
int numSplits = d.getGroupArtifactVersion().split(":").length;
if (!(numSplits >= 3 && numSplits <= 6)) {
dependencyResolver.copyLocalDependency(d.getGroupArtifactVersion(),
new File(destDir, setting.getId()));
}
}
LOGGER.info("Finish copy dependencies for interpreter: " + setting.getName());
}
} catch (Exception e) {
LOGGER.error(String.format("Error while copying deps for interpreter group : %s," +
" go to interpreter setting page click on edit and save it again to make " +
"this interpreter work properly.",
setting.getGroup()), e);
setting.setErrorReason(e.getLocalizedMessage());
setting.setStatus(InterpreterSetting.Status.ERROR);
}
}
/**
* Return ordered interpreter setting list.
* The list does not contain more than one setting from the same interpreter class.
* Order by InterpreterClass (order defined by ZEPPELIN_INTERPRETERS), Interpreter setting name
*/
public List<String> getInterpreterSettingIds() {
List<String> settingIdList = new ArrayList<>();
for (InterpreterSetting interpreterSetting : get()) {
settingIdList.add(interpreterSetting.getId());
}
return settingIdList;
}
public InterpreterSetting createNewSetting(String name, String group,
List<Dependency> dependencies,
InterpreterOption option,
Map<String, InterpreterProperty> properties)
throws IOException {
InterpreterSetting interpreterSetting = null;
try {
interpreterSetting = inlineCreateNewSetting(name, group, dependencies, option, properties);
// broadcastClusterEvent(ClusterEvent.CREATE_INTP_SETTING, interpreterSetting);
} catch (IOException e) {
LOGGER.error(e.getMessage(), e);
throw e;
}
return interpreterSetting;
}
private InterpreterSetting inlineCreateNewSetting(String name, String group,
List<Dependency> dependencies,
InterpreterOption option,
Map<String, InterpreterProperty> properties)
throws IOException {
if (name.indexOf(".") >= 0) {
throw new IOException("'.' is invalid for InterpreterSetting name.");
}
// check if name is existed
for (InterpreterSetting interpreterSetting : interpreterSettings.values()) {
if (interpreterSetting.getName().equals(name)) {
throw new IOException("Interpreter " + name + " already existed");
}
}
InterpreterSetting setting = new InterpreterSetting(interpreterSettingTemplates.get(group));
setting.setName(name);
setting.setGroup(group);
//TODO(zjffdu) Should use setDependencies
setting.appendDependencies(dependencies);
setting.setInterpreterOption(option);
setting.setProperties(properties);
initInterpreterSetting(setting);
interpreterSettings.put(setting.getId(), setting);
saveToFile();
return setting;
}
@VisibleForTesting
public void closeNote(String user, String noteId) {
// close interpreters in this note session
LOGGER.info("Close Note: {}", noteId);
List<InterpreterSetting> settings = getInterpreterSettings(noteId);
for (InterpreterSetting setting : settings) {
setting.closeInterpreters(user, noteId);
}
}
public Map<String, InterpreterSetting> getInterpreterSettingTemplates() {
return interpreterSettingTemplates;
}
private URL[] recursiveBuildLibList(File path) throws MalformedURLException {
URL[] urls = new URL[0];
if (path == null || !path.exists()) {
return urls;
} else if (path.getName().startsWith(".")) {
return urls;
} else if (path.isDirectory()) {
File[] files = path.listFiles();
if (files != null) {
for (File f : files) {
urls = (URL[]) ArrayUtils.addAll(urls, recursiveBuildLibList(f));
}
}
return urls;
} else {
return new URL[]{path.toURI().toURL()};
}
}
public List<RemoteRepository> getRepositories() {
return this.interpreterRepositories;
}
public void addRepository(String id, String url, boolean snapshot, Authentication auth,
Proxy proxy) throws IOException {
dependencyResolver.addRepo(id, url, snapshot, auth, proxy);
saveToFile();
}
public void removeRepository(String id) throws IOException {
dependencyResolver.delRepo(id);
saveToFile();
}
/** restart in interpreter setting page */
private InterpreterSetting inlineSetPropertyAndRestart(
String id,
InterpreterOption option,
Map<String, InterpreterProperty> properties,
List<Dependency> dependencies,
boolean initiator)
throws InterpreterException, IOException {
InterpreterSetting intpSetting = interpreterSettings.get(id);
if (intpSetting != null) {
try {
intpSetting.close();
intpSetting.setOption(option);
intpSetting.setProperties(properties);
intpSetting.setDependencies(dependencies);
intpSetting.postProcessing();
if (initiator) {
saveToFile();
}
} catch (Exception e) {
loadFromFile();
throw new IOException(e);
}
} else {
throw new InterpreterException("Interpreter setting id " + id + " not found");
}
return intpSetting;
}
/** Change interpreter properties and restart */
public void setPropertyAndRestart(
String id,
InterpreterOption option,
Map<String, InterpreterProperty> properties,
List<Dependency> dependencies)
throws InterpreterException, IOException {
try {
InterpreterSetting intpSetting = inlineSetPropertyAndRestart(id, option, properties, dependencies, true);
} catch (Exception e) {
throw e;
}
}
// restart in note page
public void restart(String settingId, String noteId, String user) throws InterpreterException {
InterpreterSetting intpSetting = interpreterSettings.get(settingId);
Preconditions.checkNotNull(intpSetting);
intpSetting = interpreterSettings.get(settingId);
// Check if dependency in specified path is changed
// If it did, overwrite old dependency jar with new one
if (intpSetting != null) {
copyDependenciesFromLocalPath(intpSetting);
intpSetting.closeInterpreters(user, noteId);
} else {
throw new InterpreterException("Interpreter setting id " + settingId + " not found");
}
}
@VisibleForTesting
public void restart(String id) throws InterpreterException {
InterpreterSetting setting = interpreterSettings.get(id);
copyDependenciesFromLocalPath(setting);
setting.close();
}
public InterpreterSetting get(String id) {
return interpreterSettings.get(id);
}
@VisibleForTesting
public InterpreterSetting getByName(String name) {
for (InterpreterSetting interpreterSetting : interpreterSettings.values()) {
if (interpreterSetting.getName().equals(name)) {
return interpreterSetting;
}
}
return null;
}
public void remove(String id) throws IOException {
boolean removed = inlineRemove(id, true);
if (removed) {
// broadcast cluster event
InterpreterSetting intpSetting = new InterpreterSetting();
intpSetting.setId(id);
// broadcastClusterEvent(ClusterEvent.DELETE_INTP_SETTING, intpSetting);
}
}
private boolean inlineRemove(String id, boolean initiator) throws IOException {
boolean removed = false;
// 1. close interpreter groups of this interpreter setting
// 2. remove this interpreter setting
// 3. remove this interpreter setting from note binding
// 4. clean local repo directory
LOGGER.info("Remove interpreter setting: " + id);
if (interpreterSettings.containsKey(id)) {
InterpreterSetting intp = interpreterSettings.get(id);
intp.close();
interpreterSettings.remove(id);
if (initiator) {
// Event initiator saves the file
// Cluster event accepting nodes do not need to save files repeatedly
saveToFile();
}
removed = true;
}
File localRepoDir = new File(conf.getInterpreterLocalRepoPath() + "/" + id);
FileUtils.deleteDirectory(localRepoDir);
return removed;
}
/**
* Get interpreter settings
*/
public List<InterpreterSetting> get() {
List<InterpreterSetting> orderedSettings = new ArrayList<>(interpreterSettings.values());
Collections.sort(orderedSettings, new Comparator<InterpreterSetting>() {
@Override
public int compare(InterpreterSetting o1, InterpreterSetting o2) {
if (o1.getName().equals(defaultInterpreterGroup)) {
return -1;
} else if (o2.getName().equals(defaultInterpreterGroup)) {
return 1;
} else {
return o1.getName().compareTo(o2.getName());
}
}
});
return orderedSettings;
}
public InterpreterSetting getDefaultInterpreterSetting() {
InterpreterSetting setting =
getByName(conf.getString(ConfVars.ZEPPELIN_INTERPRETER_GROUP_DEFAULT));
if (setting != null) {
return setting;
} else {
return get().get(0);
}
}
@VisibleForTesting
public List<String> getSettingIds() {
List<String> settingIds = new ArrayList<>();
for (InterpreterSetting interpreterSetting : get()) {
settingIds.add(interpreterSetting.getId());
}
return settingIds;
}
public void close(String settingId) {
get(settingId).close();
}
public void close() {
List<Thread> closeThreads = interpreterSettings.values().stream()
.map(intpSetting-> new Thread(intpSetting::close, intpSetting.getId() + "-close"))
.peek(t -> t.setUncaughtExceptionHandler((th, e) ->
LOGGER.error("interpreterGroup close error", e)))
.peek(Thread::start)
.collect(Collectors.toList());
for (Thread t : closeThreads) {
try {
t.join();
} catch (InterruptedException e) {
LOGGER.error("Can't wait close interpreterGroup threads", e);
Thread.currentThread().interrupt();
break;
}
}
}
@ManagedAttribute
public Set<String> getRunningInterpreters() {
Set<String> runningInterpreters = Sets.newHashSet();
for (Map.Entry<String, InterpreterSetting> entry : interpreterSettings.entrySet()) {
for (ManagedInterpreterGroup mig : entry.getValue().getAllInterpreterGroups()) {
if (null != mig.getRemoteInterpreterProcess()) {
runningInterpreters.add(entry.getKey());
}
}
}
return runningInterpreters;
}
}
| [
"zjffdu@apache.org"
] | zjffdu@apache.org |
5b531961a51d7073bcd041c91927fe575d4dd84f | 832b40e4cd630737fe9c584eace8f1f6bed05925 | /src/main/java/com/javadub1/jdbc/Student.java | c81210e6e15278061e9bc0d97ceab5ca46367c4e | [] | no_license | lady-dragon/javadub1-jdbcdemo | 007a165711ab97c0f900937d5914b1cba3f098e6 | c7e18d90937be498094c322511e5ef3baa39b896 | refs/heads/master | 2022-06-24T17:27:38.387605 | 2019-08-10T13:18:09 | 2019-08-10T13:18:09 | 201,632,373 | 0 | 0 | null | 2022-06-21T01:38:29 | 2019-08-10T13:14:40 | Java | UTF-8 | Java | false | false | 281 | java | package com.javadub1.jdbc;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Student {
private Long id;
private String indeks;
private String name;
private int age;
}
| [
"47868276+lady-dragon@users.noreply.github.com"
] | 47868276+lady-dragon@users.noreply.github.com |
192b2d4e38a93bca54acd156136b5220dffa1788 | e140d68139f745f0642d55c11b1a75712b4a7c79 | /src/main/java/com/neo/repository/UserDao.java | f680e4c4a230bd7e24b9a272d037bd0577c07d9b | [] | no_license | 2390257098/spring-boot-jpa-thymeleaf-curd | a6d8819fcd4dbfa3e59fbcd6928c08e2677985c4 | 38d225c62a59cf328c96bd180df2bfb99fb3577f | refs/heads/master | 2020-05-23T04:01:03.029147 | 2019-05-15T14:51:53 | 2019-05-15T14:51:53 | 186,627,761 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 371 | java | package com.neo.repository;
import com.neo.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
@Mapper
public interface UserDao {
User findById(long id);
Long deleteById(Long id);
List<User> getUserList();
void save(User user);
void edit(User user);
} | [
"2390257098@qq.com"
] | 2390257098@qq.com |
157d8c04c1d5ea16608dba1fd4b8e552c63237d3 | 4689e2d8f9ecc56ba7ba7e9ca54db6024181e417 | /app/src/main/java/com/example/fitapp/BMI.java | 4ee61ecc09e38b8b8e917ead030e6e37fe68403e | [] | no_license | CalP12/Fitness-App-Android- | 5b9fafbf35c9bc891f75046f936ce75a88069d68 | 411bcfefa76cb9c80e32830b3cb7b4d8fff3fd18 | refs/heads/main | 2023-08-10T16:04:01.001768 | 2021-10-02T11:33:31 | 2021-10-02T11:33:31 | 393,312,067 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,298 | java | package com.example.fitapp;
import android.graphics.Color;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
public class BMI extends AppCompatActivity {
EditText height,weight;
Button cal;
TextView res,health,currentBmi;
private FirebaseUser user;
private DatabaseReference reference;
private String userID;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.bmi);
Toolbar toolbar = findViewById(R.id.toolbar2); //toolbar
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(true);
currentBmi= findViewById(R.id.fbmi);
user = FirebaseAuth.getInstance().getCurrentUser();
reference = FirebaseDatabase.getInstance().getReference("Users1");
userID = user.getUid();
reference.child(userID).addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot snapshot) {
User1 userProfile = snapshot.getValue(User1.class);
if(userProfile!=null)
{
String cwe = userProfile.we;
String che = userProfile.he;
float ch= Float.parseFloat(che);
float cw= Float.parseFloat(cwe);
double cr = cw/((ch/100)*(ch/100));
Double bmi = cr;
reference.child(userID).child("bmi").setValue(bmi);
if(cr<=18.5){
currentBmi.setTextColor(Color.parseColor("#FF3D41"));
}
else if(cr>=18.5 && cr<=24.9)
{
currentBmi.setTextColor(Color.parseColor("#45F248"));
}
else if(cr>=25 && cr<=24.9)
{
currentBmi.setTextColor(Color.parseColor("#FF3D41"));
}
else{
currentBmi.setTextColor(Color.parseColor("#FF3D41"));
}
currentBmi.setText(String.format("%.2f",cr));
}
}
@Override
public void onCancelled(@NonNull DatabaseError error) {
}
});
height=findViewById(R.id.height);
weight=findViewById(R.id.weight);
cal=findViewById(R.id.calc);
res=findViewById(R.id.result);
health=findViewById(R.id.health);
cal.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
height.setEnabled(false);
height.setEnabled(true);
String he = height.getText().toString();
String we = weight.getText().toString();
if(we.isEmpty()){
weight.setError("Weight Required!");
weight.requestFocus();
return;
}
if(he.isEmpty()){
height.setError("Height Required!");
height.requestFocus();
return;
}
float h= Float.parseFloat(he);
float w= Float.parseFloat(we);
float r = w/((h/100)*(h/100));
if(r<=18.5){
health.setText("Underweight");
health.setTextColor(Color.parseColor("#FF3D41"));
}
else if(r>=18.5 && r<=24.9)
{
health.setText("Normal");
health.setTextColor(Color.parseColor("#45F248"));
}
else if(r>=25 && r<=24.9)
{
health.setText("Overweight");
health.setTextColor(Color.parseColor("#FF3D41"));
}
else{
health.setText("Obese");
health.setTextColor(Color.parseColor("#FF3D41"));
weight.clearFocus();
}
res.setText(String.format("%.2f",r));
}
});
}
@Override
public boolean onOptionsItemSelected(MenuItem item) //toolbar back
{
if(item.getItemId() == android.R.id.home){
finish();
}
return super.onOptionsItemSelected(item);
}
}
| [
"noreply@github.com"
] | CalP12.noreply@github.com |
fd409827c24530c36f895cd5677c03378f2f097c | b80b28099facdef4eabaedbc8736a97fe7cdb65a | /src/main/java/com/example/springbootapp/config/MVCconfig.java | f20496d5c764718a7a9d66e2c84520665b3c0a63 | [] | no_license | Evgeny0088/SpringBootAppTrainee | 917c9dabcd3027d26355fa0ee19759f7decb2b67 | 153af14e0c14894fd1e40814a5fdb5ae878ab4df | refs/heads/master | 2023-07-16T01:39:27.748696 | 2021-08-31T20:47:19 | 2021-08-31T20:47:19 | 401,826,521 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,317 | java | package com.example.springbootapp.config;
import com.example.springbootapp.utils.RedirectInterseptor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class MVCconfig implements WebMvcConfigurer {
@Value("${upload.path_dev}")
private String uploaded_path;
public void addViewControllers(ViewControllerRegistry viewControllerRegistry){
viewControllerRegistry.addViewController("/login").setViewName("login");
}
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/img/**")
.addResourceLocations("file://" + uploaded_path + "/");
registry.addResourceHandler("/static/**")
.addResourceLocations("classpath:/static/");
}
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(new RedirectInterseptor());
}
}
| [
"evgeny.kuznetsov0088@gmail.com"
] | evgeny.kuznetsov0088@gmail.com |
2667a576ea1c92e0935c828dab3fafe3135b6d6b | d57d2079ff1a23c5e751ee131fc2b23466479f63 | /app/src/main/java/com/cloudtp/learnrxjava/MainActivity.java | e267d0ea3f1239dd02b263fd3ceea6a0d321c6fe | [] | no_license | h8452763/LearnRxjava | 4ea5f742700b1526a5e4e6d4671f0f3ac2b648ae | 28f8b9d1abbb887bba9c712e7720117c16f2b2ba | refs/heads/master | 2020-12-03T18:43:59.266551 | 2017-10-27T09:34:41 | 2017-10-27T09:34:41 | 67,787,788 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,031 | java | package com.cloudtp.learnrxjava;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.util.Log;
import android.view.View;
import android.support.design.widget.NavigationView;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import com.cloudtp.learnrxjava.utils.ActivityUtils;
public class MainActivity extends AppCompatActivity
implements NavigationView.OnNavigationItemSelectedListener {
MainFragment mainFragment;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
//Fragment create
mainFragment=(MainFragment) getSupportFragmentManager().findFragmentById(R.id.contentFrame);
if(mainFragment==null){
mainFragment=MainFragment.getInstance();
ActivityUtils.addFragmentToActivity(getSupportFragmentManager(),mainFragment,R.id.contentFrame);
Log.w("hello","jinru");
}
Log.w("hello","weijinru");
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
}
});
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
drawer.setDrawerListener(toggle);
toggle.syncState();
NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
navigationView.setNavigationItemSelectedListener(this);
}
@Override
public void onBackPressed() {
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
if (drawer.isDrawerOpen(GravityCompat.START)) {
drawer.closeDrawer(GravityCompat.START);
} else {
super.onBackPressed();
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
@SuppressWarnings("StatementWithEmptyBody")
@Override
public boolean onNavigationItemSelected(MenuItem item) {
// Handle navigation view item clicks here.
int id = item.getItemId();
if (id == R.id.observer_patten) {
} else if (id == R.id.api_introduce) {
//api介绍 使用realm数据库
} else if (id == R.id.application_screen) {
} else if (id == R.id.nav_manage) {
} else if (id == R.id.nav_share) {
} else if (id == R.id.nav_send) {
}
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
drawer.closeDrawer(GravityCompat.START);
return true;
}
}
| [
"jiangyd@cloudtp.cn"
] | jiangyd@cloudtp.cn |
8325547693ff88e051e35db1786852a4bbfe7140 | 3fb8a562c1530424e187020f61b1278dcd1f3438 | /pingyougou-pojo/src/main/java/com/pinyougou/pojo/pojogroup/Specification.java | 7384db529380c3edeb14c9f65722f0b6c858846a | [] | no_license | xiaobai688/Internshop | 3dc21ad81d8c0f4e01a469209664e87670f24df2 | ca025a363935ee870093c025cc4f0c820033bbe6 | refs/heads/master | 2022-12-22T11:10:29.176638 | 2020-01-12T08:44:11 | 2020-01-12T08:44:11 | 233,360,160 | 1 | 0 | null | 2022-12-16T07:18:35 | 2020-01-12T08:19:55 | JavaScript | UTF-8 | Java | false | false | 852 | java | package com.pinyougou.pojo.pojogroup;
import java.io.Serializable;
import java.util.List;
import com.pinyougou.pojo.TbSpecification;
import com.pinyougou.pojo.TbSpecificationOption;
/**
* 规格组合实体类
* @author Administrator
*
*/
public class Specification implements Serializable{
private TbSpecification specification;
private List<TbSpecificationOption> specificationOptionList;
public TbSpecification getSpecification() {
return specification;
}
public void setSpecification(TbSpecification specification) {
this.specification = specification;
}
public List<TbSpecificationOption> getSpecificationOptionList() {
return specificationOptionList;
}
public void setSpecificationOptionList(List<TbSpecificationOption> specificationOptionList) {
this.specificationOptionList = specificationOptionList;
}
}
| [
"2372541633@qq.com"
] | 2372541633@qq.com |
a558ccc7ec668f27902b1a57ed2635411ec73f88 | 181a03c9dda878318fc46d30afc97249df7bb7b9 | /db/src/com/db/service/ItemService.java | 711a2c775aacc337f56e9122ea09569da11d5d3e | [] | no_license | joal10086/R | 87fd40cd765146013bee20bbf6de0c0b6b557b72 | 5569cad0aa6ca2e1b3821e8d49cc00bbbc48e80d | refs/heads/master | 2021-01-12T06:08:42.418947 | 2017-06-11T01:19:18 | 2017-06-11T01:19:18 | 77,314,603 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 467 | java | package com.db.service;
import com.db.model.Item;
import com.utils.Page;
public interface ItemService extends UniversalService {
Item getItemByItemname(String itemname, String flag);
Page getItem(String string, int pagenum, int pagesize, String i_text, String i_type);
Item findItemById(int parseInt);
Page getItemList(String string, int pagenum, int pagesize, String i_text, String i_type);
String checkItemById(int parseInt);
}
| [
"joal10086@gmail.com"
] | joal10086@gmail.com |
c75fafaf9836d6da6591b5c25993536dd21e09cf | 572ab44a5612fa7c48c1c3b29b5f4375f3b08ed1 | /BIMfoBA.src/jsdai/SIfc4/CIfcsimplepropertytemplate.java | 3378eff35f014f3541adc586d8b8f751475ab1fa | [] | no_license | ren90/BIMforBA | ce9dd9e5c0b8cfd2dbd2b84f3e2bcc72bc8aa18e | 4a83d5ecb784b80a217895d93e0e30735dc83afb | refs/heads/master | 2021-01-12T20:49:32.561833 | 2015-03-09T11:00:40 | 2015-03-09T11:00:40 | 24,721,790 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 21,007 | java | /* Generated by JSDAI Express Compiler, version 4.3.2, build 500, 2011-12-13 */
// Java class implementing entity IfcSimplePropertyTemplate
package jsdai.SIfc4;
import jsdai.lang.*;
public class CIfcsimplepropertytemplate extends CIfcpropertytemplate implements EIfcsimplepropertytemplate {
public static final jsdai.dictionary.CEntity_definition definition = initEntityDefinition(CIfcsimplepropertytemplate.class, SIfc4.ss);
/*----------------------------- Attributes -----------*/
/*
// GlobalId: protected String a0; GlobalId - java inheritance - STRING
// OwnerHistory: protected Object a1; OwnerHistory - java inheritance - ENTITY IfcOwnerHistory
// Name: protected String a2; Name - java inheritance - STRING
// Description: protected String a3; Description - java inheritance - STRING
// HasContext: protected Object - inverse - java inheritance - ENTITY IfcRelDeclares
// HasAssociations: protected Object - inverse - java inheritance - ENTITY IfcRelAssociates
// PartOfComplexTemplate: protected Object - inverse - java inheritance - ENTITY IfcComplexPropertyTemplate
// PartOfPsetTemplate: protected Object - inverse - java inheritance - ENTITY IfcPropertySetTemplate
protected int a4; // TemplateType - current entity - ENUMERATION IfcSimplePropertyTemplateTypeEnum
protected static final jsdai.dictionary.CExplicit_attribute a4$ = CEntity.initExplicitAttribute(definition, 4);
protected String a5; // PrimaryMeasureType - current entity - STRING
protected static final jsdai.dictionary.CExplicit_attribute a5$ = CEntity.initExplicitAttribute(definition, 5);
protected String a6; // SecondaryMeasureType - current entity - STRING
protected static final jsdai.dictionary.CExplicit_attribute a6$ = CEntity.initExplicitAttribute(definition, 6);
protected Object a7; // Enumerators - current entity - ENTITY IfcPropertyEnumeration
protected static final jsdai.dictionary.CExplicit_attribute a7$ = CEntity.initExplicitAttribute(definition, 7);
protected Object a8; // PrimaryUnit - current entity - SELECT IfcUnit
protected static final jsdai.dictionary.CExplicit_attribute a8$ = CEntity.initExplicitAttribute(definition, 8);
protected Object a9; // SecondaryUnit - current entity - SELECT IfcUnit
protected static final jsdai.dictionary.CExplicit_attribute a9$ = CEntity.initExplicitAttribute(definition, 9);
protected String a10; // Expression - current entity - STRING
protected static final jsdai.dictionary.CExplicit_attribute a10$ = CEntity.initExplicitAttribute(definition, 10);
protected int a11; // AccessState - current entity - ENUMERATION IfcStateEnum
protected static final jsdai.dictionary.CExplicit_attribute a11$ = CEntity.initExplicitAttribute(definition, 11);
*/
/*----------------------------- Attributes (new version) -----------*/
// GlobalId - explicit - java inheritance
// protected static final jsdai.dictionary.CExplicit_attribute a0$ = CEntity.initExplicitAttribute(definition, 0);
// protected String a0;
// OwnerHistory - explicit - java inheritance
// protected static final jsdai.dictionary.CExplicit_attribute a1$ = CEntity.initExplicitAttribute(definition, 1);
// protected Object a1;
// Name - explicit - java inheritance
// protected static final jsdai.dictionary.CExplicit_attribute a2$ = CEntity.initExplicitAttribute(definition, 2);
// protected String a2;
// Description - explicit - java inheritance
// protected static final jsdai.dictionary.CExplicit_attribute a3$ = CEntity.initExplicitAttribute(definition, 3);
// protected String a3;
// HasContext - inverse - java inheritance
// protected static final jsdai.dictionary.CInverse_attribute i0$ = CEntity.initInverseAttribute(definition, 0);
// HasAssociations - inverse - java inheritance
// protected static final jsdai.dictionary.CInverse_attribute i1$ = CEntity.initInverseAttribute(definition, 1);
// PartOfComplexTemplate - inverse - java inheritance
// protected static final jsdai.dictionary.CInverse_attribute i2$ = CEntity.initInverseAttribute(definition, 2);
// PartOfPsetTemplate - inverse - java inheritance
// protected static final jsdai.dictionary.CInverse_attribute i3$ = CEntity.initInverseAttribute(definition, 3);
// TemplateType - explicit - current entity
protected static final jsdai.dictionary.CExplicit_attribute a4$ = CEntity.initExplicitAttribute(definition, 4);
protected int a4;
// PrimaryMeasureType - explicit - current entity
protected static final jsdai.dictionary.CExplicit_attribute a5$ = CEntity.initExplicitAttribute(definition, 5);
protected String a5;
// SecondaryMeasureType - explicit - current entity
protected static final jsdai.dictionary.CExplicit_attribute a6$ = CEntity.initExplicitAttribute(definition, 6);
protected String a6;
// Enumerators - explicit - current entity
protected static final jsdai.dictionary.CExplicit_attribute a7$ = CEntity.initExplicitAttribute(definition, 7);
protected Object a7;
// PrimaryUnit - explicit - current entity
protected static final jsdai.dictionary.CExplicit_attribute a8$ = CEntity.initExplicitAttribute(definition, 8);
protected Object a8;
// SecondaryUnit - explicit - current entity
protected static final jsdai.dictionary.CExplicit_attribute a9$ = CEntity.initExplicitAttribute(definition, 9);
protected Object a9;
// Expression - explicit - current entity
protected static final jsdai.dictionary.CExplicit_attribute a10$ = CEntity.initExplicitAttribute(definition, 10);
protected String a10;
// AccessState - explicit - current entity
protected static final jsdai.dictionary.CExplicit_attribute a11$ = CEntity.initExplicitAttribute(definition, 11);
protected int a11;
public jsdai.dictionary.EEntity_definition getInstanceType() {
return definition;
}
/* *** old implementation ***
protected void changeReferences(InverseEntity old, InverseEntity newer) throws SdaiException {
super.changeReferences(old, newer);
if (a7 == old) {
a7 = newer;
}
if (a8 == old) {
a8 = newer;
}
if (a9 == old) {
a9 = newer;
}
}
*/
protected void changeReferences(InverseEntity old, InverseEntity newer) throws SdaiException {
super.changeReferences(old, newer);
if (a7 == old) {
a7 = newer;
}
if (a8 == old) {
a8 = newer;
}
if (a9 == old) {
a9 = newer;
}
}
/*----------- Methods for attribute access -----------*/
/*----------- Methods for attribute access (new)-----------*/
//going through all the attributes: #5618=EXPLICIT_ATTRIBUTE('GlobalId',#5616,0,#2517,$,.F.);
//<01> generating methods for consolidated attribute: GlobalId
//<01-1> supertype, java inheritance
//<01-1-0> explicit - generateExplicitSupertypeJavaInheritedMethodsX()
//going through all the attributes: #5619=EXPLICIT_ATTRIBUTE('OwnerHistory',#5616,1,#4858,$,.T.);
//<01> generating methods for consolidated attribute: OwnerHistory
//<01-1> supertype, java inheritance
//<01-1-0> explicit - generateExplicitSupertypeJavaInheritedMethodsX()
// attribute (java explicit): OwnerHistory, base type: entity IfcOwnerHistory
public static int usedinOwnerhistory(EIfcroot type, EIfcownerhistory instance, ASdaiModel domain, AEntity result) throws SdaiException {
return ((CEntity)instance).makeUsedin(definition, a1$, domain, result);
}
//going through all the attributes: #5620=EXPLICIT_ATTRIBUTE('Name',#5616,2,#2539,$,.T.);
//<01> generating methods for consolidated attribute: Name
//<01-1> supertype, java inheritance
//<01-1-0> explicit - generateExplicitSupertypeJavaInheritedMethodsX()
//going through all the attributes: #5621=EXPLICIT_ATTRIBUTE('Description',#5616,3,#2657,$,.T.);
//<01> generating methods for consolidated attribute: Description
//<01-1> supertype, java inheritance
//<01-1-0> explicit - generateExplicitSupertypeJavaInheritedMethodsX()
//going through all the attributes: #5113=INVERSE_ATTRIBUTE('HasContext',#5111,0,#5450,$,#5453,#8928,#8929,.F.);
//<01> generating methods for consolidated attribute: HasContext
//<01-1> supertype, java inheritance
//<01-1-2> inverse - generateInverseSupertypeJavaInheritedMethodsX()
//going through all the attributes: #5114=INVERSE_ATTRIBUTE('HasAssociations',#5111,1,#5375,$,#5377,#8931,$,.F.);
//<01> generating methods for consolidated attribute: HasAssociations
//<01-1> supertype, java inheritance
//<01-1-2> inverse - generateInverseSupertypeJavaInheritedMethodsX()
//going through all the attributes: #5165=INVERSE_ATTRIBUTE('PartOfComplexTemplate',#5163,0,#3679,$,#3683,#8976,$,.F.);
//<01> generating methods for consolidated attribute: PartOfComplexTemplate
//<01-1> supertype, java inheritance
//<01-1-2> inverse - generateInverseSupertypeJavaInheritedMethodsX()
//going through all the attributes: #5166=INVERSE_ATTRIBUTE('PartOfPsetTemplate',#5163,1,#5145,$,#5149,#8978,$,.F.);
//<01> generating methods for consolidated attribute: PartOfPsetTemplate
//<01-1> supertype, java inheritance
//<01-1-2> inverse - generateInverseSupertypeJavaInheritedMethodsX()
//going through all the attributes: #5692=EXPLICIT_ATTRIBUTE('TemplateType',#5690,0,#3015,$,.T.);
//<01> generating methods for consolidated attribute: TemplateType
//<01-0> current entity
//<01-0-0> explicit attribute - generateExplicitCurrentEntityMethodsX()
// attribute:TemplateType, base type: ENUMERATION
public boolean testTemplatetype(EIfcsimplepropertytemplate type) throws SdaiException {
return test_enumeration(a4);
}
public int getTemplatetype(EIfcsimplepropertytemplate type) throws SdaiException {
return get_enumeration(a4);
}
public void setTemplatetype(EIfcsimplepropertytemplate type, int value) throws SdaiException {
a4 = set_enumeration(value, a4$);
}
public void unsetTemplatetype(EIfcsimplepropertytemplate type) throws SdaiException {
a4 = unset_enumeration();
}
public static jsdai.dictionary.EAttribute attributeTemplatetype(EIfcsimplepropertytemplate type) throws SdaiException {
return a4$;
}
//going through all the attributes: #5693=EXPLICIT_ATTRIBUTE('PrimaryMeasureType',#5690,1,#2539,$,.T.);
//<01> generating methods for consolidated attribute: PrimaryMeasureType
//<01-0> current entity
//<01-0-0> explicit attribute - generateExplicitCurrentEntityMethodsX()
/// methods for attribute: PrimaryMeasureType, base type: STRING
public boolean testPrimarymeasuretype(EIfcsimplepropertytemplate type) throws SdaiException {
return test_string(a5);
}
public String getPrimarymeasuretype(EIfcsimplepropertytemplate type) throws SdaiException {
return get_string(a5);
}
public void setPrimarymeasuretype(EIfcsimplepropertytemplate type, String value) throws SdaiException {
a5 = set_string(value);
}
public void unsetPrimarymeasuretype(EIfcsimplepropertytemplate type) throws SdaiException {
a5 = unset_string();
}
public static jsdai.dictionary.EAttribute attributePrimarymeasuretype(EIfcsimplepropertytemplate type) throws SdaiException {
return a5$;
}
//going through all the attributes: #5694=EXPLICIT_ATTRIBUTE('SecondaryMeasureType',#5690,2,#2539,$,.T.);
//<01> generating methods for consolidated attribute: SecondaryMeasureType
//<01-0> current entity
//<01-0-0> explicit attribute - generateExplicitCurrentEntityMethodsX()
/// methods for attribute: SecondaryMeasureType, base type: STRING
public boolean testSecondarymeasuretype(EIfcsimplepropertytemplate type) throws SdaiException {
return test_string(a6);
}
public String getSecondarymeasuretype(EIfcsimplepropertytemplate type) throws SdaiException {
return get_string(a6);
}
public void setSecondarymeasuretype(EIfcsimplepropertytemplate type, String value) throws SdaiException {
a6 = set_string(value);
}
public void unsetSecondarymeasuretype(EIfcsimplepropertytemplate type) throws SdaiException {
a6 = unset_string();
}
public static jsdai.dictionary.EAttribute attributeSecondarymeasuretype(EIfcsimplepropertytemplate type) throws SdaiException {
return a6$;
}
//going through all the attributes: #5695=EXPLICIT_ATTRIBUTE('Enumerators',#5690,3,#5124,$,.T.);
//<01> generating methods for consolidated attribute: Enumerators
//<01-0> current entity
//<01-0-0> explicit attribute - generateExplicitCurrentEntityMethodsX()
// attribute (current explicit or supertype explicit) : Enumerators, base type: entity IfcPropertyEnumeration
public static int usedinEnumerators(EIfcsimplepropertytemplate type, EIfcpropertyenumeration instance, ASdaiModel domain, AEntity result) throws SdaiException {
return ((CEntity)instance).makeUsedin(definition, a7$, domain, result);
}
public boolean testEnumerators(EIfcsimplepropertytemplate type) throws SdaiException {
return test_instance(a7);
}
public EIfcpropertyenumeration getEnumerators(EIfcsimplepropertytemplate type) throws SdaiException {
return (EIfcpropertyenumeration)get_instance(a7);
}
public void setEnumerators(EIfcsimplepropertytemplate type, EIfcpropertyenumeration value) throws SdaiException {
a7 = set_instance(a7, value);
}
public void unsetEnumerators(EIfcsimplepropertytemplate type) throws SdaiException {
a7 = unset_instance(a7);
}
public static jsdai.dictionary.EAttribute attributeEnumerators(EIfcsimplepropertytemplate type) throws SdaiException {
return a7$;
}
//going through all the attributes: #5696=EXPLICIT_ATTRIBUTE('PrimaryUnit',#5690,4,#3221,$,.T.);
//<01> generating methods for consolidated attribute: PrimaryUnit
//<01-0> current entity
//<01-0-0> explicit attribute - generateExplicitCurrentEntityMethodsX()
// -2- methods for SELECT attribute: PrimaryUnit
public static int usedinPrimaryunit(EIfcsimplepropertytemplate type, EEntity instance, ASdaiModel domain, AEntity result) throws SdaiException {
return ((CEntity)instance).makeUsedin(definition, a8$, domain, result);
}
public boolean testPrimaryunit(EIfcsimplepropertytemplate type) throws SdaiException {
return test_instance(a8);
}
public EEntity getPrimaryunit(EIfcsimplepropertytemplate type) throws SdaiException { // case 1
return get_instance_select(a8);
}
public void setPrimaryunit(EIfcsimplepropertytemplate type, EEntity value) throws SdaiException { // case 1
a8 = set_instance(a8, value);
}
public void unsetPrimaryunit(EIfcsimplepropertytemplate type) throws SdaiException {
a8 = unset_instance(a8);
}
public static jsdai.dictionary.EAttribute attributePrimaryunit(EIfcsimplepropertytemplate type) throws SdaiException {
return a8$;
}
//going through all the attributes: #5697=EXPLICIT_ATTRIBUTE('SecondaryUnit',#5690,5,#3221,$,.T.);
//<01> generating methods for consolidated attribute: SecondaryUnit
//<01-0> current entity
//<01-0-0> explicit attribute - generateExplicitCurrentEntityMethodsX()
// -2- methods for SELECT attribute: SecondaryUnit
public static int usedinSecondaryunit(EIfcsimplepropertytemplate type, EEntity instance, ASdaiModel domain, AEntity result) throws SdaiException {
return ((CEntity)instance).makeUsedin(definition, a9$, domain, result);
}
public boolean testSecondaryunit(EIfcsimplepropertytemplate type) throws SdaiException {
return test_instance(a9);
}
public EEntity getSecondaryunit(EIfcsimplepropertytemplate type) throws SdaiException { // case 1
return get_instance_select(a9);
}
public void setSecondaryunit(EIfcsimplepropertytemplate type, EEntity value) throws SdaiException { // case 1
a9 = set_instance(a9, value);
}
public void unsetSecondaryunit(EIfcsimplepropertytemplate type) throws SdaiException {
a9 = unset_instance(a9);
}
public static jsdai.dictionary.EAttribute attributeSecondaryunit(EIfcsimplepropertytemplate type) throws SdaiException {
return a9$;
}
//going through all the attributes: #5698=EXPLICIT_ATTRIBUTE('Expression',#5690,6,#2539,$,.T.);
//<01> generating methods for consolidated attribute: Expression
//<01-0> current entity
//<01-0-0> explicit attribute - generateExplicitCurrentEntityMethodsX()
/// methods for attribute: Expression, base type: STRING
public boolean testExpression(EIfcsimplepropertytemplate type) throws SdaiException {
return test_string(a10);
}
public String getExpression(EIfcsimplepropertytemplate type) throws SdaiException {
return get_string(a10);
}
public void setExpression(EIfcsimplepropertytemplate type, String value) throws SdaiException {
a10 = set_string(value);
}
public void unsetExpression(EIfcsimplepropertytemplate type) throws SdaiException {
a10 = unset_string();
}
public static jsdai.dictionary.EAttribute attributeExpression(EIfcsimplepropertytemplate type) throws SdaiException {
return a10$;
}
//going through all the attributes: #5699=EXPLICIT_ATTRIBUTE('AccessState',#5690,7,#3033,$,.T.);
//<01> generating methods for consolidated attribute: AccessState
//<01-0> current entity
//<01-0-0> explicit attribute - generateExplicitCurrentEntityMethodsX()
// attribute:AccessState, base type: ENUMERATION
public boolean testAccessstate(EIfcsimplepropertytemplate type) throws SdaiException {
return test_enumeration(a11);
}
public int getAccessstate(EIfcsimplepropertytemplate type) throws SdaiException {
return get_enumeration(a11);
}
public void setAccessstate(EIfcsimplepropertytemplate type, int value) throws SdaiException {
a11 = set_enumeration(value, a11$);
}
public void unsetAccessstate(EIfcsimplepropertytemplate type) throws SdaiException {
a11 = unset_enumeration();
}
public static jsdai.dictionary.EAttribute attributeAccessstate(EIfcsimplepropertytemplate type) throws SdaiException {
return a11$;
}
/*---------------------- setAll() --------------------*/
/* *** old implementation ***
protected void setAll(ComplexEntityValue av) throws SdaiException {
if (av == null) {
a0 = null;
a1 = unset_instance(a1);
a2 = null;
a3 = null;
a4 = 0;
a5 = null;
a6 = null;
a7 = unset_instance(a7);
a8 = unset_instance(a8);
a9 = unset_instance(a9);
a10 = null;
a11 = 0;
return;
}
a0 = av.entityValues[3].getString(0);
a1 = av.entityValues[3].getInstance(1, this, a1$);
a2 = av.entityValues[3].getString(2);
a3 = av.entityValues[3].getString(3);
a4 = av.entityValues[4].getEnumeration(0, a4$);
a5 = av.entityValues[4].getString(1);
a6 = av.entityValues[4].getString(2);
a7 = av.entityValues[4].getInstance(3, this, a7$);
a8 = av.entityValues[4].getInstance(4, this, a8$);
a9 = av.entityValues[4].getInstance(5, this, a9$);
a10 = av.entityValues[4].getString(6);
a11 = av.entityValues[4].getEnumeration(7, a11$);
}
*/
protected void setAll(ComplexEntityValue av) throws SdaiException {
if (av == null) {
a0 = null;
a1 = unset_instance(a1);
a2 = null;
a3 = null;
a4 = 0;
a5 = null;
a6 = null;
a7 = unset_instance(a7);
a8 = unset_instance(a8);
a9 = unset_instance(a9);
a10 = null;
a11 = 0;
return;
}
a0 = av.entityValues[3].getString(0);
a1 = av.entityValues[3].getInstance(1, this, a1$);
a2 = av.entityValues[3].getString(2);
a3 = av.entityValues[3].getString(3);
a4 = av.entityValues[4].getEnumeration(0, a4$);
a5 = av.entityValues[4].getString(1);
a6 = av.entityValues[4].getString(2);
a7 = av.entityValues[4].getInstance(3, this, a7$);
a8 = av.entityValues[4].getInstance(4, this, a8$);
a9 = av.entityValues[4].getInstance(5, this, a9$);
a10 = av.entityValues[4].getString(6);
a11 = av.entityValues[4].getEnumeration(7, a11$);
}
/*---------------------- getAll() --------------------*/
/* *** old implementation ***
protected void getAll(ComplexEntityValue av) throws SdaiException {
// partial entity: IfcPropertyDefinition
// partial entity: IfcPropertyTemplate
// partial entity: IfcPropertyTemplateDefinition
// partial entity: IfcRoot
av.entityValues[3].setString(0, a0);
av.entityValues[3].setInstance(1, a1);
av.entityValues[3].setString(2, a2);
av.entityValues[3].setString(3, a3);
// partial entity: IfcSimplePropertyTemplate
av.entityValues[4].setEnumeration(0, a4, a4$);
av.entityValues[4].setString(1, a5);
av.entityValues[4].setString(2, a6);
av.entityValues[4].setInstance(3, a7);
av.entityValues[4].setInstance(4, a8);
av.entityValues[4].setInstance(5, a9);
av.entityValues[4].setString(6, a10);
av.entityValues[4].setEnumeration(7, a11, a11$);
}
*/
protected void getAll(ComplexEntityValue av) throws SdaiException {
// partial entity: IfcPropertyDefinition
// partial entity: IfcPropertyTemplate
// partial entity: IfcPropertyTemplateDefinition
// partial entity: IfcRoot
av.entityValues[3].setString(0, a0);
av.entityValues[3].setInstance(1, a1);
av.entityValues[3].setString(2, a2);
av.entityValues[3].setString(3, a3);
// partial entity: IfcSimplePropertyTemplate
av.entityValues[4].setEnumeration(0, a4, a4$);
av.entityValues[4].setString(1, a5);
av.entityValues[4].setString(2, a6);
av.entityValues[4].setInstance(3, a7);
av.entityValues[4].setInstance(4, a8);
av.entityValues[4].setInstance(5, a9);
av.entityValues[4].setString(6, a10);
av.entityValues[4].setEnumeration(7, a11, a11$);
}
}
| [
"renato.filipe.vieira@gmail.com"
] | renato.filipe.vieira@gmail.com |
dffb23b984ca52c4cf1c5bf74503ea82ec1551cd | 0e54b471947a0c5e6cd27964178a2c8bdfc61bfe | /SpringMVC_Test/src/com/ikook/mvc/model/Fruits.java | 04bcae5c0583ede85127e133d50814716c1ad981 | [] | no_license | china-kook/SpringMVC-MyBatis-Study | b2ea2d2c338deaccd8dfea087579953076d06b20 | 2593c01a4125f03db2b0002eac12972e0d306b29 | refs/heads/master | 2021-04-06T01:20:31.288799 | 2018-03-18T14:40:55 | 2018-03-18T14:40:55 | 124,878,700 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 729 | java | package com.ikook.mvc.model;
public class Fruits {
private int id;
private String name;
private double price;
private String producing_area;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}
public String getProducing_area() {
return producing_area;
}
public void setProducing_area(String producing_area) {
this.producing_area = producing_area;
}
}
| [
"china.ikook@gmail.com"
] | china.ikook@gmail.com |
4f74a6d870e4913cdbff1c376622a2b771739412 | 4710fe7b59f54d34edef3333a3936534ae8649c2 | /xpdl-to-bpmn2/src/main/java/org/jbpm/migration/processor/dom/OverlappingPoolProcessor.java | 0f05f236f3c4ed3d16ff12dcf6358ce88fb62da1 | [
"Apache-2.0"
] | permissive | selrahal/xpdl-to-bpmn2 | 7e0a9ba885c6bee331ed66247bc095456daa0123 | f7c6647928e013fcf63b7fd159b41db13e1a1cf5 | refs/heads/main | 2023-07-17T20:53:54.483944 | 2021-08-20T14:16:19 | 2021-08-20T14:16:19 | 56,805,217 | 3 | 1 | null | 2016-05-02T12:50:15 | 2016-04-21T20:57:43 | Java | UTF-8 | Java | false | false | 4,044 | java | package org.jbpm.migration.processor.dom;
import org.apache.log4j.Logger;
import org.joox.Match;
import org.w3c.dom.Document;
import java.util.List;
import static org.joox.JOOX.$;
import static org.joox.JOOX.attr;
/**
* Ensures no pools are overlapping
*
*
*/
public class OverlappingPoolProcessor implements DomProcessor {
private static final Logger LOG = Logger.getLogger(OverlappingPoolProcessor.class);
@Override
public Document process(Document bpmn) {
double lowestBlankY = 0;
double largestWidth = Double.MIN_VALUE;
//Should not be parrallelized, we are using the lowestBlankY to keep track of the position
List<Match> lanes = $(bpmn).find("lane").each();
for (Match lane : lanes) {
Match bpmnShape = $(bpmn).find("BPMNShape").filter(attr("bpmnElement",lane.attr("id")));
double oldX = Double.parseDouble(bpmnShape.child().attr("x") == null ? "0":bpmnShape.child().attr("x"));
double oldY = Double.parseDouble(bpmnShape.child().attr("y") == null ? "0":bpmnShape.child().attr("y"));
double deltaX = 0 - oldX;
double deltaY = lowestBlankY - oldY;
LOG.debug("Moving lane " + lane.attr("id") + " by " + deltaX + "," + deltaY);
moveElements(bpmn, lane.attr("id"), deltaX, deltaY);
lowestBlankY += Double.parseDouble(bpmnShape.child().attr("height") == null ? "0":bpmnShape.child().attr("height"));
Double currentWidth = Double.parseDouble(bpmnShape.child().attr("width") == null ? "0":bpmnShape.child().attr("width"));
if (largestWidth < currentWidth) {
largestWidth = currentWidth;
}
}
//Set the width of every pool to the max width we have seen so far
for (Match lane : lanes) {
Match bpmnShape = $(bpmn).find("BPMNShape").filter(attr("bpmnElement",lane.attr("id")));
bpmnShape.child().attr("width",Double.toString(largestWidth));
}
//Reset the sequence flows
List<Match> edges = $(bpmn).find("BPMNEdge").each();
for (Match edge : edges) {
Match sourceElement = $(bpmn).find("BPMNShape").filter(attr("id",edge.attr("sourceElement")));
Match targetElement = $(bpmn).find("BPMNShape").filter(attr("id",edge.attr("targetElement")));
edge.child(0).attr("x", sourceElement.child().attr("x"));
edge.child(0).attr("y", sourceElement.child().attr("y"));
edge.child(1).attr("x", targetElement.child().attr("x"));
edge.child(1).attr("y", targetElement.child().attr("y"));
}
return bpmn;
}
private void moveElements(Document bpmn, String laneId, double deltaX, double deltaY) {
//first move the actual swim lane
Match bpmnShape = $(bpmn).find("BPMNShape").filter(attr("bpmnElement",laneId));
double oldX = Double.parseDouble(bpmnShape.child().attr("x") == null ? "0":bpmnShape.child().attr("x"));
double oldY = Double.parseDouble(bpmnShape.child().attr("y") == null ? "0":bpmnShape.child().attr("y"));
bpmnShape.child().attr("x", Double.toString(oldX + deltaX));
bpmnShape.child().attr("y", Double.toString(oldY + deltaY));
//Find all of the FlowNodeRef's for the give laneId
List<Match> flowNodeRefs = $(bpmn).find("lane").filter(attr("id",laneId)).children().each();
LOG.debug("Moving " + flowNodeRefs.size() + " flowNodeRefs for " + laneId);
for (Match flowNodeRef : flowNodeRefs) {
this.moveElement(bpmn, flowNodeRef.text(), deltaX, deltaY);
}
}
private void moveElement(Document bpmn, String elementId, double deltaX, double deltaY) {
Match bpmnShape = $(bpmn).find("BPMNShape").filter(attr("bpmnElement", elementId));
//Update X
double oldX = Double.parseDouble(bpmnShape.child().attr("x") == null ? "0":bpmnShape.child().attr("x"));
double newX = oldX + deltaX;
bpmnShape.child().attr("x", Double.toString(newX));
//Update Y
double oldY = Double.parseDouble(bpmnShape.child().attr("y") == null ? "0":bpmnShape.child().attr("y"));
double newY = oldY + deltaY;
bpmnShape.child().attr("y", Double.toString(newY));
LOG.debug("Moved shape for bpmnElement=" + elementId + " from " + oldX + "," + oldY + " to " + newX + "," + newY);
}
}
| [
"selrahal@librem.one"
] | selrahal@librem.one |
358e1d9d21189545435383c053e2c57f5b542eae | 43bf4f0a770c6c2e624286904f20bc855613271b | /src/main/java/jobicade/toolsdoneright/block/BlockResource.java | 62765816738aed666e4fff2f1c632647abad3d3b | [
"MIT"
] | permissive | mccreery/tools-done-right | 26b6c9d07dcc4201fd868d96ed0a39ba522246d4 | ebdc6be7c0cc6335d2997b640620021d4a95680b | refs/heads/master | 2020-04-17T20:05:18.312317 | 2019-06-24T16:15:54 | 2019-06-24T16:15:54 | 166,890,579 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 554 | java | package jobicade.toolsdoneright.block;
import net.minecraft.block.Block;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
public class BlockResource extends Block {
public BlockResource(Material material, MapColor mapColor) {
super(material, mapColor);
setHardness(5.0F);
setResistance(10.0F);
setSoundType(SoundType.METAL);
setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
}
}
| [
"4602020+mccreery@users.noreply.github.com"
] | 4602020+mccreery@users.noreply.github.com |
31636a5fa8bfd35a9f1da713b0d3e4cdb71824a3 | 7826ba6a955399bb0b7148953c999802b9a62898 | /src/cideplus/ui/astview/EditorUtility.java | 46df1082d7e5f678b042ea35af0c992b68e1a54f | [] | no_license | ppires/cideplus | d3836597baaa6b7aa1253c781fefd6c3d1a34edd | 4bfef58176ef34b7f6d73ee9a029d1178121bd25 | refs/heads/master | 2020-12-24T17:35:23.000481 | 2012-07-05T18:58:42 | 2012-07-05T18:58:42 | 3,325,056 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,882 | java | /*******************************************************************************
* Copyright (c) 2000, 2007 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package cideplus.ui.astview;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.ITypeRoot;
import org.eclipse.jdt.ui.JavaUI;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.texteditor.ITextEditor;
/**
*
*/
public class EditorUtility {
private EditorUtility() {
super();
}
public static IEditorPart getActiveEditor() {
IWorkbenchWindow window= ASTViewPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow();
if (window != null) {
IWorkbenchPage page= window.getActivePage();
if (page != null) {
return page.getActiveEditor();
}
}
return null;
}
public static ITypeRoot getJavaInput(IEditorPart part) {
IEditorInput editorInput= part.getEditorInput();
if (editorInput != null) {
IJavaElement input= JavaUI.getEditorInputJavaElement(editorInput);
if (input instanceof ITypeRoot) {
return (ITypeRoot) input;
}
}
return null;
}
public static void selectInEditor(ITextEditor editor, int offset, int length) {
IEditorPart active = getActiveEditor();
if (active != editor) {
editor.getSite().getPage().activate(editor);
}
editor.selectAndReveal(offset, length);
}
}
| [
"pedro.pires@dito.com.br"
] | pedro.pires@dito.com.br |
16c515f264e886bc2fce5a7fa83b9ac324ce07c3 | 5f82aae041ab05a5e6c3d9ddd8319506191ab055 | /Projects/JacksonDatabind/85/src/main/java/com/fasterxml/jackson/databind/introspect/AnnotatedConstructor.java | a5e81ad03e164611a02e620d707dbaaf259755d3 | [
"LicenseRef-scancode-generic-cla",
"Apache-2.0"
] | permissive | lingming/prapr_data | e9ddabdf971451d46f1ef2cdbee15ce342a6f9dc | be9ababc95df45fd66574c6af01122ed9df3db5d | refs/heads/master | 2023-08-14T20:36:23.459190 | 2021-10-17T13:49:39 | 2021-10-17T13:49:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,521 | java | package com.fasterxml.jackson.databind.introspect;
import java.lang.reflect.*;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.util.ClassUtil;
public final class AnnotatedConstructor
extends AnnotatedWithParams
{
private static final long serialVersionUID = 1L;
protected final Constructor<?> _constructor;
/**
* Field that is used to make JDK serialization work with this
* object.
*
* @since 2.1
*/
protected Serialization _serialization;
/*
/**********************************************************
/* Life-cycle
/**********************************************************
*/
public AnnotatedConstructor(TypeResolutionContext ctxt, Constructor<?> constructor,
AnnotationMap classAnn, AnnotationMap[] paramAnn)
{
super(ctxt, classAnn, paramAnn);
if (constructor == null) {
throw new IllegalArgumentException("Null constructor not allowed");
}
_constructor = constructor;
}
/**
* Method used for JDK serialization support
* @since 2.1
*/
protected AnnotatedConstructor(Serialization ser)
{
super(null, null, null);
_constructor = null;
_serialization = ser;
}
@Override
public AnnotatedConstructor withAnnotations(AnnotationMap ann) {
return new AnnotatedConstructor(_typeContext, _constructor, ann, _paramAnnotations);
}
/*
/**********************************************************
/* Annotated impl
/**********************************************************
*/
@Override
public Constructor<?> getAnnotated() { return _constructor; }
@Override
public int getModifiers() { return _constructor.getModifiers(); }
@Override
public String getName() { return _constructor.getName(); }
@Override
public JavaType getType() {
return _typeContext.resolveType(getRawType());
}
@Override
public Class<?> getRawType() {
return _constructor.getDeclaringClass();
}
/*
/**********************************************************
/* Extended API
/**********************************************************
*/
@Override
public int getParameterCount() {
return _constructor.getParameterTypes().length;
}
@Override
public Class<?> getRawParameterType(int index)
{
Class<?>[] types = _constructor.getParameterTypes();
return (index >= types.length) ? null : types[index];
}
@Override
public JavaType getParameterType(int index) {
Type[] types = _constructor.getGenericParameterTypes();
if (index >= types.length) {
return null;
}
return _typeContext.resolveType(types[index]);
}
@Override
@Deprecated // since 2.7
public Type getGenericParameterType(int index) {
Type[] types = _constructor.getGenericParameterTypes();
if (index >= types.length) {
return null;
}
return types[index];
}
@Override
public final Object call() throws Exception {
return _constructor.newInstance();
}
@Override
public final Object call(Object[] args) throws Exception {
return _constructor.newInstance(args);
}
@Override
public final Object call1(Object arg) throws Exception {
return _constructor.newInstance(arg);
}
/*
/**********************************************************
/* AnnotatedMember impl
/**********************************************************
*/
@Override
public Class<?> getDeclaringClass() { return _constructor.getDeclaringClass(); }
@Override
public Member getMember() { return _constructor; }
@Override
public void setValue(Object pojo, Object value)
throws UnsupportedOperationException
{
throw new UnsupportedOperationException("Cannot call setValue() on constructor of "
+getDeclaringClass().getName());
}
@Override
public Object getValue(Object pojo)
throws UnsupportedOperationException
{
throw new UnsupportedOperationException("Cannot call getValue() on constructor of "
+getDeclaringClass().getName());
}
/*
/**********************************************************
/* Extended API, specific annotations
/**********************************************************
*/
@Override
public String toString() {
return "[constructor for "+getName()+", annotations: "+_annotations+"]";
}
@Override
public int hashCode() {
return _constructor.getName().hashCode();
}
@Override
public boolean equals(Object o) {
if (o == this) return true;
if (o == null || o.getClass() != getClass()) return false;
return ((AnnotatedConstructor) o)._constructor == _constructor;
}
/*
/**********************************************************
/* JDK serialization handling
/**********************************************************
*/
Object writeReplace() {
return new AnnotatedConstructor(new Serialization(_constructor));
}
Object readResolve() {
Class<?> clazz = _serialization.clazz;
try {
Constructor<?> ctor = clazz.getDeclaredConstructor(_serialization.args);
// 06-Oct-2012, tatu: Has "lost" its security override, must force back
if (!ctor.isAccessible()) {
ClassUtil.checkAndFixAccess(ctor, false);
}
return new AnnotatedConstructor(null, ctor, null, null);
} catch (Exception e) {
throw new IllegalArgumentException("Could not find constructor with "
+_serialization.args.length+" args from Class '"+clazz.getName());
}
}
/**
* Helper class that is used as the workaround to persist
* Field references. It basically just stores declaring class
* and field name.
*/
private final static class Serialization
implements java.io.Serializable
{
private static final long serialVersionUID = 1L;
protected Class<?> clazz;
protected Class<?>[] args;
public Serialization(Constructor<?> ctor) {
clazz = ctor.getDeclaringClass();
args = ctor.getParameterTypes();
}
}
}
| [
"2890268106@qq.com"
] | 2890268106@qq.com |
b983584c184a82fda752d9fe8b1949ca47a8cffd | befde1e4446dec36af350e49bacac9cdb84e9d96 | /ymir-core/src/main/java/org/seasar/ymir/scope/annotation/Ins.java | e514b6534c1f646c6138fe8ee25a3a94e5b17b8d | [] | no_license | seasarorg/test-ymir-component-1 | c6c9ae715b090edae3f994e602047d4086363661 | cb53d0e4c193b9a2211df16bfabdaf23665f24b7 | refs/heads/master | 2016-09-09T19:01:46.293634 | 2013-10-01T17:36:25 | 2013-10-01T17:36:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 831 | java | package org.seasar.ymir.scope.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.seasar.ymir.annotation.Collection;
/**
* {@link In}アノテーションを複数指定するためのアノテーションです。
* <p>{@link In}アノテーションに対応するインジェクション処理は指定した順序で行なわれます。
* </p>
*
* @see In
* @author YOKOTA Takehiko
*/
@Retention(RetentionPolicy.RUNTIME)
@Target( { ElementType.METHOD, ElementType.PARAMETER })
@Collection
public @interface Ins {
/**
* {@link In}アノテーションです。
*
* @return {@link In}アノテーション。
*/
In[] value();
}
| [
"skirnir@ce2cb714-bd0d-0410-8c66-e472ade7ad34"
] | skirnir@ce2cb714-bd0d-0410-8c66-e472ade7ad34 |
af72c35ebc229a947189ddbc24da1d99e7c25a58 | 91ba18142f80670a70a3abba878b4846a48e2056 | /app/src/main/java/com/oschina/bluelife/loadhtmlbyproxy/model/Proxy.java | c3eee17b57463d6fa1ff9dda96c9deeb2b66ac4e | [] | no_license | bluelife/LoadHtmlByProxy | 700e018f151ef18f5df3747b313e2a9746689f44 | e15a2de8b65b9c70485a1277bee94805f5603631 | refs/heads/master | 2020-05-29T08:40:19.387212 | 2016-09-23T17:53:56 | 2016-09-23T17:53:56 | 69,048,258 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 597 | java | package com.oschina.bluelife.loadhtmlbyproxy.model;
/**
* Created by HiWin10 on 2016/9/23.
*/
public class Proxy
{
private String port;
private String proxyIp;
public String getPort ()
{
return port;
}
public void setPort (String port)
{
this.port = port;
}
public String getProxyIp ()
{
return proxyIp;
}
public void setProxyIp (String proxyIp)
{
this.proxyIp = proxyIp;
}
@Override
public String toString()
{
return "ClassPojo [port = "+port+", proxyIp = "+proxyIp+"]";
}
} | [
"28998638@qq.com"
] | 28998638@qq.com |
7b2561fcdaa57a0f739074d5d6b2bf611cd43fe2 | 9a24e44e56edd448d7388fd8b17c6a90095c2247 | /src/Square.java | 7048dc6609dd13c9889ddc08354a13a3b1504742 | [] | no_license | angelmedina2356/Actividad-11 | 5c84b125f3e363083314b7d5005c8ef50c363c06 | 6d38e15d4200e0fb1d3b6b1b265b2f799512edee | refs/heads/master | 2023-01-18T21:49:25.146962 | 2020-11-06T06:30:16 | 2020-11-06T06:30:16 | 310,505,689 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 837 | java | import java.util.*;
/*
* 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.
*/
/**
*
* @author Angel
*/
public class Square implements Shape{
double area, a, perimetro;
public Square(){}
@Override
public void getArea() {
Scanner scanner = new Scanner(System.in);
System.out.println("ingrese el lado de cuadrado");
a = scanner.nextDouble();
area=a*a;
System.out.println(area);
}
@Override
public void getPerimeter() {
Scanner key = new Scanner(System.in);
System.out.println("ingrese el lado de cuadrado");
a = key.nextDouble();
perimetro=a*4;
System.out.println(perimetro);
}
} | [
"medinaangel13109@gmail.com"
] | medinaangel13109@gmail.com |
58e6f0257f1377a75ae1f5867c436b2073dd4121 | 6423b8913ccce2507a65852f1d9cbb589b4480c9 | /src/org/historyresearchenvironment/usergui/handlers/HRELoggerHandler.java | ef56f3d43b44d228ab8c6b6096109178f0d4ac07 | [] | no_license | PQYPLZXHGF/MVP | 93b2301532ed3496001a74be49871b19c1fbb1ba | 98a454d6387c357c411cd11a019a33c75def7700 | refs/heads/master | 2020-06-21T02:01:23.089589 | 2020-02-22T21:35:12 | 2020-02-22T21:35:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,159 | java | /* */ package org.historyresearchenvironment.usergui.handlers;
/* */
/* */ import java.io.PrintStream;
/* */ import java.util.logging.Handler;
/* */ import java.util.logging.LogRecord;
/* */ import org.eclipse.core.internal.runtime.InternalPlatform;
/* */ import org.eclipse.e4.core.contexts.EclipseContextFactory;
/* */ import org.eclipse.e4.core.contexts.IEclipseContext;
/* */ import org.eclipse.e4.core.services.events.IEventBroker;
/* */ import org.osgi.framework.BundleContext;
/* */
/* */
/* */ public class HRELoggerHandler
/* */ extends Handler
/* */ {
/* */ private static IEventBroker eventBroker;
/* */
/* */ public HRELoggerHandler()
/* */ {
/* 20 */ BundleContext context = InternalPlatform.getDefault().getBundleContext();
/* 21 */ IEclipseContext ecf = EclipseContextFactory.getServiceContext(context);
/* 22 */ eventBroker = (IEventBroker)ecf.get(IEventBroker.class.getName());
/* 23 */ System.out.println("Constructed logger handler");
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public void close()
/* */ throws SecurityException
/* */ {}
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public void flush() {}
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public void publish(LogRecord record)
/* */ {
/* 51 */ BundleContext context = InternalPlatform.getDefault().getBundleContext();
/* 52 */ IEclipseContext ecf = EclipseContextFactory.getServiceContext(context);
/* 53 */ eventBroker = (IEventBroker)ecf.get(IEventBroker.class.getName());
/* 54 */ eventBroker.post("LOG", record);
/* 55 */ eventBroker.post("MESSAGE", record);
/* 56 */ System.out.println("Called console for logger");
/* */ }
/* */ }
/* Location: C:\Temp\HRE Mockup Product-win32.win32.x86_64\plugins\org.historyresearchenvironment.usergui_1.0.0.201801161825.jar!\org\historyresearchenvironment\usergui\handlers\HRELoggerHandler.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 0.7.1
*/ | [
"michael.erichsen@xact.dk"
] | michael.erichsen@xact.dk |
dce7db07b5b29daf434d25a991c33e0219049244 | 89fdc41b51562bf64f77cb25837d240a5e8c350b | /src/restaurant/reservation/controller/SeatingTableController.java | 8d1a6a79f7ff07aa727b67f5d1ca67c7d2fa048c | [] | no_license | hemalawati/Restaurant_Reservation_API | 1cc03d2b6ab2a78f823d9d7c6674ee5875c0f0a1 | 831111d5b0869cd10568245a460edfa566ba72e1 | refs/heads/master | 2021-01-21T12:40:53.357246 | 2015-09-05T00:04:50 | 2015-09-05T00:04:50 | 41,942,404 | 0 | 0 | null | 2015-09-19T08:09:31 | 2015-09-04T23:52:52 | JavaScript | UTF-8 | Java | false | false | 4,275 | java | package restaurant.reservation.controller;
import java.util.List;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response.Status;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import restaurant.reservation.dao.SeatingTableDAO;
import restaurant.reservation.exception.AppException;
import restaurant.reservation.model.SeatingTable;
@Path("/seating")
@Api(tags = {"/seating"})
public class SeatingTableController {
@GET
@Produces(MediaType.APPLICATION_JSON)
@ApiOperation(value = "Find All Tables", notes = "Finds all tables in the database")
@ApiResponses(value = { @ApiResponse(code = 200, message = "Success"),
@ApiResponse(code = 500, message = "Internal Server Error") })
public List<SeatingTable> getAll() {
List<SeatingTable> seatingTable = null;
SeatingTableDAO dao = new SeatingTableDAO();
try {
seatingTable = dao.getAllTables();
} catch (AppException e) {
// TODO Auto-generated catch block
e.printStackTrace();
throw new WebApplicationException(Status.INTERNAL_SERVER_ERROR);
}
return seatingTable;
}
@GET
@Path("/{table_id}")
@Produces(MediaType.APPLICATION_JSON)
@ApiOperation(value = "Find one table", notes = "Finds one table in the database")
@ApiResponses(value = { @ApiResponse(code = 200, message = "Success"),
@ApiResponse(code = 500, message = "Internal Server Error") })
public SeatingTable getById(@PathParam("table_id") int tableId) {
SeatingTable seatingTable;
SeatingTableDAO dao = new SeatingTableDAO();
try {
seatingTable = dao.getOneTable(tableId);
} catch (AppException e) {
// TODO Auto-generated catch block
e.printStackTrace();
throw new WebApplicationException(Status.INTERNAL_SERVER_ERROR);
}
if (seatingTable == null) {
throw new WebApplicationException(Status.NO_CONTENT);
}
return seatingTable;
}
@POST
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@ApiOperation(value = "Create a table reservation", notes = "Creates seating table reservation in database")
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Success"),
@ApiResponse(code = 500, message = "Internal Server Error") })
public SeatingTable insertTable(SeatingTable seatingTable) {
SeatingTableDAO dao = new SeatingTableDAO();
try {
seatingTable = dao.insert(seatingTable);
} catch (AppException e) {
// TODO Auto-generated catch block
e.printStackTrace();
throw new WebApplicationException(Status.INTERNAL_SERVER_ERROR);
}
// TODO
// NEED EXCEPTION
return seatingTable;
}
@PUT
@Path("/{table_id}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@ApiOperation(value = "Update seating table status", notes = "Update seating table status in database")
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Success"),
@ApiResponse(code = 500, message = "Internal Server Error") })
public SeatingTable updateTable(@PathParam("table_id") int tableId, SeatingTable seatingTable){
SeatingTableDAO dao = new SeatingTableDAO();
try {
seatingTable = dao.update(tableId, seatingTable);
} catch (AppException e) {
// TODO Auto-generated catch block
e.printStackTrace();
throw new WebApplicationException(Status.INTERNAL_SERVER_ERROR);
}
return seatingTable;
}
@DELETE
@Path("/{table_id}")
@ApiOperation(value = "Delete seating table", notes = "Delete seating table in database")
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Success"),
@ApiResponse(code = 500, message = "Internal Server Error") })
public void deleteTable(@PathParam("table_id") int table_id){
SeatingTableDAO dao = new SeatingTableDAO();
try {
dao.delete(table_id);
} catch (AppException e) {
// TODO Auto-generated catch block
e.printStackTrace();
throw new WebApplicationException(Status.INTERNAL_SERVER_ERROR);
}
}
}
| [
"hemalawati@gmail.com"
] | hemalawati@gmail.com |
32c1361f4f869fc9a81d6a963a914d0f1c71fbc1 | 77d7a9bab6977aa682d3646a0b492bbaa73b2f3e | /app/src/main/java/kr/rokoroku/mbus/data/model/Favorite.java | 2cfaba4019c82874f56466ac3dd4b915a68a8d60 | [] | no_license | rokoroku/android-material-bus-tracker | 551242f7a7ced7fd83bf2aa4165a9e4cf2e44806 | 7811556f06ae70e15f99ff0c9a930af4ae7fcb73 | refs/heads/master | 2021-03-27T15:39:03.776364 | 2015-12-07T17:09:11 | 2015-12-07T17:44:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,593 | java | package kr.rokoroku.mbus.data.model;
import org.mapdb.Serializer;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import kr.rokoroku.mbus.util.SerializeUtil;
/**
* Created by rok on 2015. 6. 8..
*/
public class Favorite implements Serializable {
private String name;
private Map<Provider, Map<String, Integer>> coloredStationTable;
private Map<Provider, Map<String, Integer>> coloredRouteTable;
private List<FavoriteGroup> favoriteGroups;
public Favorite(String name) {
this.name = name;
this.coloredStationTable = new HashMap<>();
this.coloredRouteTable = new HashMap<>();
this.favoriteGroups = new ArrayList<>();
}
public Favorite(Favorite another) {
this.name = another.name;
this.coloredRouteTable = new HashMap<>(another.coloredRouteTable);
this.coloredStationTable = new HashMap<>(another.coloredStationTable);
this.favoriteGroups = new ArrayList<>();
for (FavoriteGroup favoriteGroup : another.favoriteGroups) {
FavoriteGroup group = new FavoriteGroup(favoriteGroup.getName(), favoriteGroup.getItems());
this.favoriteGroups.add(group);
}
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Map<Provider, Map<String, Integer>> getColoredRouteTable() {
return coloredRouteTable;
}
public Map<Provider, Map<String, Integer>> getColoredStationTable() {
return coloredStationTable;
}
public Integer getStationColor(Provider provider, String stationId) {
Map<String, Integer> stringIntegerPair = coloredStationTable.get(provider);
if (stringIntegerPair != null) return stringIntegerPair.get(stationId);
else return null;
}
public Integer getRouteColor(Provider provider, String routeId) {
Map<String, Integer> stringIntegerPair = coloredRouteTable.get(provider);
if (stringIntegerPair != null) return stringIntegerPair.get(routeId);
else return null;
}
public void setStationColor(Provider provider, String stationId, Integer color) {
Map<String, Integer> stationTable = coloredStationTable.get(provider);
if (color != null) {
if (stationTable == null) {
stationTable = new HashMap<>();
coloredStationTable.put(provider, stationTable);
}
stationTable.put(stationId, color);
} else if (stationTable != null) {
stationTable.remove(stationId);
if (stationTable.size() == 0) coloredRouteTable.remove(provider);
}
}
public void setRouteColor(Provider provider, String routeId, Integer color) {
Map<String, Integer> routeTable = coloredRouteTable.get(provider);
if (color != null) {
if (routeTable == null) {
routeTable = new HashMap<>();
coloredRouteTable.put(provider, routeTable);
}
routeTable.put(routeId, color);
} else if (routeTable != null) {
routeTable.remove(routeId);
if (routeTable.size() == 0) coloredRouteTable.remove(provider);
}
}
public List<FavoriteGroup> getFavoriteGroups() {
return favoriteGroups;
}
public void addFavoriteGroup(int position, FavoriteGroup favoriteGroup) {
favoriteGroups.add(position, favoriteGroup);
}
public boolean removeFavoriteGroup(FavoriteGroup favoriteGroup) {
return favoriteGroups.remove(favoriteGroup);
}
public FavoriteGroup removeFavoriteGroup(int position) {
return favoriteGroups.remove(position);
}
public static Serializer<Favorite> SERIALIZER = new Serializer<Favorite>() {
private Serializer<Map<String, Integer>> stringIntegerMapSerializer = new Serializer<Map<String, Integer>>() {
@Override
public void serialize(DataOutput out, Map<String, Integer> value) throws IOException {
SerializeUtil.writeMap(out, value, Serializer.STRING, Serializer.INTEGER);
}
@Override
public Map<String, Integer> deserialize(DataInput in, int available) throws IOException {
return SerializeUtil.readMap(in, Serializer.STRING, Serializer.INTEGER);
}
};
@Override
public void serialize(DataOutput out, Favorite value) throws IOException {
SerializeUtil.writeString(out, value.name);
SerializeUtil.writeMap(out, value.coloredRouteTable, Provider.SERIALIZER, stringIntegerMapSerializer);
SerializeUtil.writeMap(out, value.coloredStationTable, Provider.SERIALIZER, stringIntegerMapSerializer);
SerializeUtil.writeList(out, value.favoriteGroups, FavoriteGroup.SERIALIZER);
}
@Override
public Favorite deserialize(DataInput in, int available) throws IOException {
Favorite favorite = new Favorite(SerializeUtil.readString(in));
favorite.coloredRouteTable = SerializeUtil.readMap(in, Provider.SERIALIZER, stringIntegerMapSerializer);
favorite.coloredStationTable = SerializeUtil.readMap(in, Provider.SERIALIZER, stringIntegerMapSerializer);
favorite.favoriteGroups = SerializeUtil.readList(in, FavoriteGroup.SERIALIZER);
return favorite;
}
};
}
| [
"rok0810@gmail.com"
] | rok0810@gmail.com |
c7a526723eea4b83e017101ceee75d0b2cddf373 | 50ed52809f07a632bfe15cacbe7ef96779ede10e | /src/humanity/page/objects/HumanityProfile.java | f3853cd96da3a1711c659b5a7729f18c8ee4a3f5 | [] | no_license | tijacvet/Final-Project | 626daaa28fb8ffbaeaa8921e249a99511954639b | cbc6b6fa500e72727dcb97a3bee0ea3996a1aea6 | refs/heads/master | 2020-07-31T01:51:47.769153 | 2019-09-27T19:13:13 | 2019-09-27T19:13:13 | 210,440,434 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,190 | java | package humanity.page.objects;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
public class HumanityProfile {
private static final String PROFILE_PICTURE_XPATH = "//i[@class='icon icon-arrowFullDn j-arrowIconToAvatar navBottom__userArrow']";
private static final String SIGN_OUT_BUTTON_XPATH = "//a[contains(text(),'Sign Out')]";
private static final String PROFILE_BUTTON_XPATH = "//a[contains(text(),'Profile')]";
private static final String SETTINGS_BUTTON_XPATH = "//div[@class='userm userm-mainPage']//a[contains(text(),'Settings')]";
private static final String AVAILABILITY_BUTTON_XPATH = "//div[@class='userm userm-mainPage']//a[contains(text(),'Availability')]";
private static final String HUMANITY_APP_VERSION_XPATH= "//b[contains(text(),'9.5.5')]";
public static WebElement getProfilePicture(WebDriver driver) {
return driver.findElement(By.xpath(PROFILE_PICTURE_XPATH));
}
public static void clickProfilePicture(WebDriver driver) {
getProfilePicture(driver).click();
}
public static WebElement getSignOutButton(WebDriver driver) {
return driver.findElement(By.xpath(SIGN_OUT_BUTTON_XPATH));
}
public static void clickSignOutButton(WebDriver driver) {
getSignOutButton(driver).click();
}
public static WebElement getProfileButton (WebDriver driver) {
return driver.findElement(By.xpath(PROFILE_BUTTON_XPATH));
}
public static void clicProfileButton(WebDriver driver) {
getProfileButton (driver).click();
}
public static WebElement getSettingsButton(WebDriver driver) {
return driver.findElement(By.xpath(SETTINGS_BUTTON_XPATH));
}
public static void clickSettingsButton(WebDriver driver) {
getSettingsButton(driver).click();
}
public static WebElement getAvailabilityButton(WebDriver driver) {
return driver.findElement(By.xpath(AVAILABILITY_BUTTON_XPATH));
}
public static void clickAvailabilityButton(WebDriver driver) {
getAvailabilityButton(driver).click();
}
public static WebElement getHumanityAppVersion(WebDriver driver) {
return driver.findElement(By.xpath(HUMANITY_APP_VERSION_XPATH));
}
}
| [
"noreply@github.com"
] | tijacvet.noreply@github.com |
8b94b805eee63fd2b54d436cacd3ee5682cf37a0 | 27141ebb9b1c5625d11656d39855a1d3de2a003d | /aula5/exercicio9/Principal.java | de74039ba68bfbb81f424f1d6d80802668a5a3e2 | [] | no_license | matheusspall/TreinamentoJava | 49e3be55899852b99982e9a6618c003a8ebb454e | 981d82f9fa95e06b533a0a9a113c3bb9618ba29f | refs/heads/master | 2021-01-13T07:12:46.411530 | 2016-12-09T19:39:42 | 2016-12-09T19:39:42 | 71,488,154 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 378 | java | package br.com.meta.aula5.exercicio9;
public class Principal {
public static void main(String[] args) {
Letra a = new Letra();
System.out.println("Letra 'a': " + a.vogalOuConsoante("a"));
int codASCLetra = '$';
System.out.println("ASCII " + codASCLetra + ": " + a.vogalOuConsoante(codASCLetra));
}
}
| [
"matheusspall@hotmail.com"
] | matheusspall@hotmail.com |
bee84eb036e7d8fbb54219639fd000dd0896fdee | 761a6620cd54327540e58557a4668bd325200e3a | /Zomato-Zeta/App/src/main/java/integration/DTO/restaurants.java | c489a7b49603ec58834817f0f20cd35636830b15 | [] | no_license | lakshita97/TestNgAPIs | ff754a697582818e6f32e2535e9088b32209ecae | 79f0ce51c2a99310fbe649b07d336d4191846633 | refs/heads/main | 2022-12-20T07:56:47.865667 | 2020-10-08T18:27:27 | 2020-10-08T18:27:27 | 302,427,288 | 0 | 0 | null | 2020-10-08T18:27:28 | 2020-10-08T18:22:00 | null | UTF-8 | Java | false | false | 1,417 | java | package integration.DTO;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"restaurant"
})
public class restaurants {
@JsonProperty("restaurant")
private restaurant restaurant;
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
@JsonProperty("restaurant")
public restaurant getRestaurant() {
return restaurant;
}
@JsonProperty("restaurant")
public void setRestaurant(restaurant restaurant) {
this.restaurant = restaurant;
}
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
@Override
public String toString() {
return "restaurants{" +
"restaurant=" + restaurant +
", additionalProperties=" + additionalProperties +
'}';
}
}
| [
"noreply@github.com"
] | lakshita97.noreply@github.com |
a7d68528a12f65bce8dba7b67aba02ecaa9a2d55 | 1adcdfc9378baaa0e1990422a2710f2020faea15 | /Goal.java | f833b15abdd6f488fb51809c79ce1860629f2d7e | [] | no_license | HarryYelland/ProActive | a74a4598211875547f05eb9a177634ba91564e66 | fcd9895436eae1465109bc6aa8d9ab897b13240a | refs/heads/main | 2023-04-19T21:42:03.937244 | 2021-05-12T01:13:21 | 2021-05-12T01:13:21 | 345,642,426 | 0 | 2 | null | 2021-05-10T10:40:09 | 2021-03-08T12:05:19 | Java | UTF-8 | Java | false | false | 662 | java | public class Goal {
public String goalName;
public Integer calorieGoal;
public Goal() {
this.goalName = "";
this.calorieGoal = 0;
}
public Goal(String goalName, Integer calorieGoal) {
this.goalName = goalName;
this.calorieGoal = calorieGoal;
}
public String getGoalName() {
return goalName;
}
public void setGoalName(String goalName) {
this.goalName = goalName;
}
public Integer getCalorieGoal() {
return calorieGoal;
}
public void setCalorieGoal(Integer calorieGoal) {
this.calorieGoal = calorieGoal;
}
} | [
"noreply@github.com"
] | HarryYelland.noreply@github.com |
5502cd3a85a1dd48bbf00229fdd5ceb7ea37297f | 3ef55e152decb43bdd90e3de821ffea1a2ec8f75 | /large/module0182_public/src/java/module0182_public/a/Foo1.java | 9bb8fa18d81a9addaf91b9fe80f9a17147c2e9c5 | [
"BSD-3-Clause"
] | permissive | salesforce/bazel-ls-demo-project | 5cc6ef749d65d6626080f3a94239b6a509ef145a | 948ed278f87338edd7e40af68b8690ae4f73ebf0 | refs/heads/master | 2023-06-24T08:06:06.084651 | 2023-03-14T11:54:29 | 2023-03-14T11:54:29 | 241,489,944 | 0 | 5 | BSD-3-Clause | 2023-03-27T11:28:14 | 2020-02-18T23:30:47 | Java | UTF-8 | Java | false | false | 1,497 | java | package module0182_public.a;
import java.beans.beancontext.*;
import java.io.*;
import java.rmi.*;
/**
* Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut
* labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
* Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
*
* @see java.io.File
* @see java.rmi.Remote
* @see java.nio.file.FileStore
*/
@SuppressWarnings("all")
public abstract class Foo1<F> extends module0182_public.a.Foo0<F> implements module0182_public.a.IFoo1<F> {
java.sql.Array f0 = null;
java.util.logging.Filter f1 = null;
java.util.zip.Deflater f2 = null;
public F element;
public static Foo1 instance;
public static Foo1 getInstance() {
return instance;
}
public static <T> T create(java.util.List<T> input) {
return module0182_public.a.Foo0.create(input);
}
public String getName() {
return module0182_public.a.Foo0.getInstance().getName();
}
public void setName(String string) {
module0182_public.a.Foo0.getInstance().setName(getName());
return;
}
public F get() {
return (F)module0182_public.a.Foo0.getInstance().get();
}
public void set(Object element) {
this.element = (F)element;
module0182_public.a.Foo0.getInstance().set(this.element);
}
public F call() throws Exception {
return (F)module0182_public.a.Foo0.getInstance().call();
}
}
| [
"gwagenknecht@salesforce.com"
] | gwagenknecht@salesforce.com |
0f385603d0a44ea2712fcdc0ce491017c090714a | 8c48ecb5fd0a92449d1503a51d5c38aa9e5eaba4 | /src/easy/EasyAndSay.java | 7babfe600433ac8533fe915964abdda05b5abaf6 | [] | no_license | tortoiselala/leetcode | 6aa2211a05c23a3c67593b127806dc885d33646f | 07db71de617b7f2ed0569e71b8ea731f900592c6 | refs/heads/master | 2020-06-20T15:05:16.582054 | 2019-08-19T12:39:58 | 2019-08-19T12:39:58 | 197,159,305 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,108 | java | package easy;
/**
* @author tortoiselala
*/
public class EasyAndSay {
public String countAndSay(int n) {
StringBuilder pre = new StringBuilder();
StringBuilder cur = new StringBuilder();
pre.append('1');
for(int i = 2; i <= n; ++i){
int preLength = pre.length();
char preChar = 0;
int preCount = 0;
for(int j = 0; j < preLength; ++j){
if(preCount == 0){
preChar = pre.charAt(j);
++preCount;
continue;
}
if(pre.charAt(j) == preChar){
++preCount;
}else{
cur.append(preCount);
cur.append(preChar);
preCount = 1;
preChar = pre.charAt(j);
}
}
if(preCount != 0){
cur.append(preCount);
cur.append(preChar);
}
pre = cur;
cur = new StringBuilder();
}
return pre.toString();
}
}
| [
"tortoiselala@gmail.com"
] | tortoiselala@gmail.com |
7f1ad00bf0cf5c060deba591ab0fbfb19016f9a2 | 1c76b9b8416f3d75b8ea8c02c7e795e67d17d189 | /src/main/java/org/training/issuetracker/i18n/LocalizerRU.java | b62be707db6963bc9d26915df1dd19a0b6d00f4a | [] | no_license | sergei-doroshenko/it-master | 3e220441e7a39625903953843636a254ed345d4f | f4d3c12edd2c7fcd1f68037d501c22cba4f34908 | refs/heads/master | 2016-09-11T04:49:11.624398 | 2014-02-25T20:26:19 | 2014-02-25T20:26:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,364 | java | package org.training.issuetracker.i18n;
import java.io.File;
import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.Locale;
import java.util.Map;
import java.util.PropertyResourceBundle;
import java.util.ResourceBundle;
import org.training.issuetracker.constants.Constants;
/**Class that implements Russian language localization.
* @author Sergei_Doroshenko
*/
public class LocalizerRU implements Localizer {
private static final String path = Constants.getRealPath() + "WEB-INF\\classes\\i18n\\";
private ResourceBundle bundle;
private final Locale locale;
private final ClassLoader loader;
public LocalizerRU (Locale locale) throws MalformedURLException {
File file = new File(path);
URL[] urls = {file.toURI().toURL()};
loader = new URLClassLoader(urls);
this.locale = locale;
}
@Override
public String getElementValue(String key) throws UnsupportedEncodingException {
return new String (bundle.getString(key).getBytes("ISO-8859-1"), "UTF-8");
}
@Override
public ResourceBundle getBundle(String fileName) {
return PropertyResourceBundle.getBundle(fileName, locale, loader);
}
@Override
public Map<String, String> getValuesMap()
throws UnsupportedEncodingException {
// TODO Auto-generated method stub
return null;
}
}
| [
"6823298@gmail.com"
] | 6823298@gmail.com |
02c428d7fc9fe3adfac38d7668215ee6921bc090 | b0e2226010a774a3f098b88fee6378deff2b56fb | /C_protec.java | 7a480292b8921953ad125bb0ff5956d4ed39c100 | [] | no_license | chocolate90/Access-Modifier | c3743d9b0b2c9ea801d0eecd88ae99da62a44836 | 438e4dd55ec6d46e567db93b0985fefe8849d35f | refs/heads/main | 2023-03-20T07:43:56.038927 | 2021-03-05T11:29:49 | 2021-03-05T11:29:49 | 344,784,866 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 322 | java | package modi.protec.pac2;
import modi.protec.pac1.A_protec;
public class C_protec extends A_protec {
public C_protec() {
// A_protec a = new A_protec();
//
// a.bool = true;
// a.method();
// protected는 super 참조가 가능하다.
super();
super.bool = true;
super.method();
}
}
| [
"noreply@github.com"
] | chocolate90.noreply@github.com |
70e9ab2e9470cca70379df23dd693c60f1888665 | c4ee1e77025052d489612cff3d78a098b59f5a0b | /finla-Aves/Test/modelo/GorrionTest.java | b3f8d60b907fedca66a15f8450da1827fb5771b5 | [] | no_license | agustinaa235/FIUBA-Finales-Algo3 | c170f43256b20d862c05b79fdb5e74ce803eac17 | 4a99ac489916a98fbf28d4c184bc17b7c666b5f7 | refs/heads/master | 2023-03-26T04:10:25.222443 | 2021-03-22T14:22:23 | 2021-03-22T14:22:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 438 | java | package modelo;
import org.junit.Test;
import personajes.Gorrion;
import static junit.framework.TestCase.assertEquals;
public class GorrionTest {
@Test
public void gorrionPuedeVolar() {
Gorrion gorrion= new Gorrion();
assertEquals(50,gorrion.volar());
}
@Test
public void gorrionPuedeCantar() {
Gorrion gorrion = new Gorrion();
assertEquals("pio pio", gorrion.cantar());
}
}
| [
"noreply@github.com"
] | agustinaa235.noreply@github.com |
90c4169842736a9f832a98731fa9bcdcc2dacf7e | eee6680de1bebd9eece4aa901bec9d6dccae7b1b | /src/test/java/com/pathomation/frontendui/TC21_InstructionsAndManualsAvailability.java | 5aebbeaa9a8ad88d166ac6ea94d57ac1d1a9690d | [] | no_license | DaryaForest/Sumongo3 | 724a793f3f8f37c922f925b14d36cdb1e54bb542 | fd470a0715bbda2312f30e844edb288675e6f10d | refs/heads/master | 2021-07-17T17:39:40.374379 | 2017-10-26T14:12:31 | 2017-10-26T14:12:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,995 | java | package com.pathomation.frontendui;
import com.pathomation.actions.Actions;
import com.pathomation.actions.MainActions;
import com.pathomation.base.BaseTest;
import com.pathomation.pages.Pages;
import com.pathomation.util.ConstantsPma2;
import com.pathomation.util.data.URLConnection;
import com.pathomation.util.reporter.Reporter;
import org.testng.Assert;
import org.testng.annotations.Test;
import javax.xml.parsers.ParserConfigurationException;
import java.awt.*;
import java.awt.event.KeyEvent;
import java.io.File;
import java.io.IOException;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.file.Files;
public class TC21_InstructionsAndManualsAvailability extends BaseTest {
@Test(testName = "TC 21.1: PMA.core manual availability")
public void tc21_InstructionsAndManualsAvailability() throws IOException, URISyntaxException, ParserConfigurationException, AWTException {
//TC 21.1: PMA.core manual availability
Actions.mainActions().openMainPage();
Actions.mainActions().clearSession();
Actions.loginActions().login(ConstantsPma2.ADMIN_USER_NAME, ConstantsPma2.ADMIN_PASSWORD);
Pages.homePage().waitHomePageLounching();
if (!System.getProperty("browser").equalsIgnoreCase("InternetExplorer")) {
Pages.leftSideBarPage().clickManualButton();
MainActions.wait(ConstantsPma2.ELEMENT_MICRO_TIMEOUT_SECONDS);
if (!System.getProperty("browser").equalsIgnoreCase("firefox")) {
Pages.imagesPage().switchToNewTab(); // for Chrome and and Edge
}
if (System.getProperty("browser").equalsIgnoreCase("firefox")) {
Pages.imagesPage().switchToJustOpenedWindow();
}
MainActions.wait(ConstantsPma2.ELEMENT_EXTRASMALL_TIMEOUT_SECONDS);
Reporter.log("Compare url");
Assert.assertEquals(
driver.getCurrentUrl(),
ConstantsPma2.BASE_URL + "Content/" + ConstantsPma2.MANUAL_NAME
);
Reporter.log("Check content type");
Assert.assertEquals(
URLConnection.getContentType(new URL(driver.getCurrentUrl())), "application/pdf"
);
} else {
Reporter.log("Test " + Pages.leftSideBarPage().getManualButtonHref());
Actions.mainActions().openPage(Pages.leftSideBarPage().getManualButtonHref());
MainActions.wait(ConstantsPma2.ELEMENT_MICRO_TIMEOUT_SECONDS);
String filePath = System.getProperty("user.home") + "/Downloads/" + ConstantsPma2.MANUAL_NAME;
final File downloadedLogFile = new File(filePath);
if (downloadedLogFile.exists()) {
downloadedLogFile.delete();
}
//Save file in IE
Robot robot = new Robot();
robot.setAutoDelay(1000);
robot.keyPress(KeyEvent.VK_ALT);
robot.keyPress(KeyEvent.VK_S);
robot.keyRelease(KeyEvent.VK_S);
robot.keyRelease(KeyEvent.VK_ALT);
Reporter.log("Check file successfully downloaded and valid " + filePath);
Assert.assertTrue(downloadedLogFile.exists(), "File successfully downloaded");
long fileSize = 0;
try {
fileSize = Files.size(downloadedLogFile.toPath());
} catch (IOException ioException) {
Assert.fail("ERROR: Unable to determine file size for " + filePath
+ " due to exception " + ioException);
}
Assert.assertTrue(fileSize != 0, "File size is > 0");
Assert.assertTrue(downloadedLogFile.canRead(),
"Log file exists its path name and the file is allowed to be read by the application");
Assert.assertTrue(
downloadedLogFile.delete(),
"downloaded file was existed, successfully deleted"
);
}
}
} | [
"veryhappytester4@gmail.com"
] | veryhappytester4@gmail.com |
c3eea8015c6d0fa6f67185f68c0623c8c27a362b | 3ffe58a01857a5b1c1eecb1bee8f3251280aa2c9 | /src/main/java/com/aramark/rsr/invoiceheader/dao/JdbcInvoiceHeaderDAO.java | 3db3b7c5940dc69163d93d327900258c02a3073f | [] | no_license | pimontanog/aramarkrsrapi | 1a6fc424777aebfef687a47f0fb0e3479fba3518 | 07d61323406a5bcbd5913e7469390a98f0df05bb | refs/heads/master | 2021-01-10T06:18:11.121488 | 2015-11-09T21:47:02 | 2015-11-09T21:47:02 | 45,853,774 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,883 | java | package com.aramark.rsr.invoiceheader.dao;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Date;
import javax.sql.DataSource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.aramark.rsr.invoiceheader.controller.InvoiceHeaderController;
import com.aramark.rsr.invoiceheader.model.InvoiceHeader;
import oracle.jdbc.OracleTypes;
public class JdbcInvoiceHeaderDAO implements InvoiceHeaderDAO {
private static final Logger logger = LoggerFactory.getLogger(JdbcInvoiceHeaderDAO.class);
private DataSource dataSource;
public void setDataSource(DataSource data){
this.dataSource = data;
}
public JdbcInvoiceHeaderDAO(DataSource data){
this.setDataSource(data);
}
@Override
public ArrayList<InvoiceHeader> getAllInvoiceHeader(Date pDownloadDate, long pRouteId, long pEmployeeId) {
Connection conn = null;
CallableStatement stmt = null;
ArrayList<InvoiceHeader> inh = new ArrayList<InvoiceHeader>();
ResultSet rs = null;
try{
logger.info("inside JdbcInvoiceHeaderDAO");
conn = dataSource.getConnection();
stmt = conn.prepareCall("{call PK_GET_INVOICE_HEADER.SP_GET_INVOICE_HEADER(?,?,?,?)}");
stmt.setDate(1, new java.sql.Date(pDownloadDate.getTime()));
logger.info(pDownloadDate.toString());
stmt.setLong(2, pRouteId);
logger.info(Long.toString(pRouteId));
stmt.setLong(3, pEmployeeId);
logger.info(Long.toString(pEmployeeId));
stmt.registerOutParameter(4, OracleTypes.CURSOR);
stmt.execute();
rs = (ResultSet) stmt.getObject(4);
logger.info("just before looping cursor");
while(rs.next()){
logger.info("in cursor");
InvoiceHeader invh = new InvoiceHeader();
invh.setId(rs.getLong("ID"));
invh.setRoute_header_id(rs.getLong("ROUTE_HEADER_ID"));
invh.setInvoice_date(rs.getString("INVOICE_DATE"));
invh.setNumber(rs.getString("NUMBER"));
invh.setCustomer_id(rs.getLong("CUSTOMER_ID"));
invh.setTerms_code(rs.getString("TERMS_CODE"));
invh.setTaxable_customer(rs.getString("TAXABLE_CUSTOMER"));
invh.setService_days(rs.getString("SERVICE_DAYS"));
invh.setService_weeks(rs.getString("SERVICE_WEEKS"));
invh.setPrebilled_amt(rs.getDouble("PREBILLED_AMT"));
invh.setAdjustment_amt(rs.getDouble("ADJUSTMENT_AMT"));
invh.setCollected_amt(rs.getDouble("COLLECTED_AMT"));
invh.setManual_invoice_flag(rs.getString("MANUAL_INVOICE_FLAG"));
invh.setAdjustment_counter(rs.getLong("ADJUSTMENT_COUNTER"));
invh.setInvoice_credit_code_id(rs.getLong("INVOICE_CREDIT_CODE_ID"));
invh.setLpc_code_flag(rs.getString("LPC_CODE_FLAG"));
invh.setOffice_adjustment(rs.getDouble("OFFICE_ADJUSTMENT"));
invh.setE4w_rental_invoice(rs.getString("E4W_RENTAL_INVOICE"));
invh.setProcessed_flag(rs.getString("PROCESSED_FLAG"));
invh.setIrm_generate_flag(rs.getString("IRM_GENERATE_FLAG"));
invh.setSpc_irm_requests(rs.getLong("SPC_IRM_REQUESTS"));
invh.setTotal_loss_ruin_chrgs(rs.getDouble("TOTAL_LOSS_RUIN_CHRGS"));
invh.setNumber_of_pages(rs.getLong("NUMBER_OF_PAGES"));
invh.setOriginal_invoice(rs.getString("ORIGINAL_INVOICE"));
invh.setOversize_msg_print_flag(rs.getString("OVERSIZE_MSG_PRINT_FLAG"));
invh.setRate_control_flag(rs.getString("RATE_CONTROL_FLAG"));
invh.setSpecial_rounding_flag(rs.getString("SPECIAL_ROUNDING_FLAG"));
invh.setAuto_loss_perc(rs.getDouble("AUTO_LOSS_PERC"));
invh.setInvoice_minimum(rs.getDouble("INVOICE_MINIMUM"));
invh.setSvc_charge_perc(rs.getDouble("SVC_CHARGE_PERC"));
invh.setInv_adj_flag(rs.getString("INV_ADJ_FLAG"));
invh.setStatus_id(rs.getLong("STATUS_ID"));
invh.setNbr_of_lines_up(rs.getLong("NBR_OF_LINES_UP"));
invh.setExplanation(rs.getString("EXPLANATION"));
invh.setTax_adjustment_amt(rs.getDouble("TAX_ADJUSTMENT_AMT"));
invh.setSvc_adjustment_amt(rs.getDouble("SVC_ADJUSTMENT_AMT"));
invh.setTax_amt_1(rs.getDouble("TAX_AMT_1"));
invh.setTax_amt_2(rs.getDouble("TAX_AMT_2"));
invh.setTax_amt_3(rs.getDouble("TAX_AMT_3"));
invh.setTax_amt_4(rs.getDouble("TAX_AMT_4"));
invh.setTax_on_1(rs.getDouble("TAX_ON_1"));
invh.setTax_on_2(rs.getDouble("TAX_ON_2"));
invh.setTax_on_3(rs.getDouble("TAX_ON_3"));
invh.setTax_on_4(rs.getDouble("TAX_ON_4"));
invh.setTax_perc_1(rs.getDouble("TAX_PERC_1"));
invh.setTax_perc_2(rs.getDouble("TAX_PERC_2"));
invh.setTax_perc_3(rs.getDouble("TAX_PERC_3"));
invh.setTax_perc_4(rs.getDouble("TAX_PERC_4"));
invh.setSoil_message_id(rs.getLong("SOIL_MESSAGE_ID"));
invh.setSoil_approval_status(rs.getLong("SOIL_APPROVAL_STATUS"));
invh.setEc_adjustment_amt(rs.getDouble("EC_ADJUSTMENT_AMT"));
invh.setSoil_approval_rank(rs.getString("SOIL_APPROVAL_RANK"));
invh.setDisplay_approval_rank(rs.getString("DISPLAY_APPROVAL_RANK"));
inh.add(invh);
}
} catch(Exception ex){
ex.printStackTrace();
} finally{
try {
rs.close();
stmt.close();
conn.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
return inh;
}
}
| [
"pimontanog@gmail.com"
] | pimontanog@gmail.com |
82e3149ec5809c012919571b44f8917e516bbd9b | 107ae0a1718ebf087aff8725588da7d1f79e1cfc | /app/src/main/java/com/Tata/video/adapter/MessageAdapter.java | 2a156fae4bfddfa7c644575f4185ef15eed27ae0 | [] | no_license | 513778392/mamayu | f4c6c418adc6a99bb6ec46d8435963bffb16a48c | 6c48075e5faf9b95f4ebc33d19d299922fd6a53a | refs/heads/master | 2023-01-11T04:17:19.549478 | 2020-11-12T07:00:36 | 2020-11-12T07:00:36 | 312,190,793 | 3 | 1 | null | null | null | null | UTF-8 | Java | false | false | 7,965 | java | package com.Tata.video.adapter;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.Tata.video.Constants;
import com.Tata.video.R;
import com.Tata.video.activity.OtherUserActivity;
import com.Tata.video.bean.ChatUserBean;
import com.Tata.video.glide.ImgLoader;
import com.Tata.video.interfaces.OnItemClickListener;
import com.Tata.video.jpush.JMessageUtil;
import java.util.ArrayList;
import java.util.List;
/**
* Created by cxf on 2018/7/13.
*/
public class MessageAdapter extends RecyclerView.Adapter<MessageAdapter.Vh> {
private static final int HEAD = 1;
private static final int MIDDLE = 2;
private static final int FOOT = 3;
private Context mContext;
private List<ChatUserBean> mList;
private List<ChatUserBean> mAdminChatBeanList;
private LayoutInflater mInflater;
private OnItemClickListener<ChatUserBean> mOnItemClickListener;
private long mLastClickTime;
public MessageAdapter(Context context) {
mContext = context;
mList = new ArrayList<>();
mAdminChatBeanList = new ArrayList<>();
ChatUserBean cub1 = new ChatUserBean();
cub1.setId(Constants.YB_ID_1);
cub1.setUser_nicename(mContext.getResources().getString(R.string.Official));
cub1.setFromType(ChatUserBean.TYPE_SYSTEM);
JMessageUtil util = JMessageUtil.getInstance();
ChatUserBean cubInfo1 = util.getLastMessageInfo(cub1);
if (cubInfo1 != null) {
cub1 = cubInfo1;
}
ChatUserBean cub2 = new ChatUserBean();
cub2.setId(Constants.YB_ID_2);
cub2.setUser_nicename(mContext.getResources().getString(R.string.System_notification));
cub2.setFromType(ChatUserBean.TYPE_SYSTEM);
ChatUserBean cubInfo2 = util.getLastMessageInfo(cub2);
if (cubInfo2 != null) {
cub2 = cubInfo2;
}
mAdminChatBeanList.add(cub1);
mAdminChatBeanList.add(cub2);
mList.addAll(mAdminChatBeanList);
mInflater = LayoutInflater.from(context);
}
public void setOnItemClickListener(OnItemClickListener<ChatUserBean> onItemClickListener) {
mOnItemClickListener = onItemClickListener;
}
public List<ChatUserBean> getAdminChatBeanList() {
return mAdminChatBeanList;
}
public void updateAdminChatInfo() {
JMessageUtil util = JMessageUtil.getInstance();
for (ChatUserBean c : mAdminChatBeanList) {
ChatUserBean info = util.getLastMessageInfo(c);
if (info != null) {
updateItem(c.getId());
}
}
}
public void insertList(List<ChatUserBean> list) {
int p = mList.size();
mList.addAll(list);
notifyItemRangeInserted(p, list.size());
}
public void insertItem(ChatUserBean bean) {
int p = mList.size();
mList.add(bean);
notifyItemInserted(p);
}
public void updateItem(String touid) {
if (!TextUtils.isEmpty(touid)) {
for (int i = 0, size = mList.size(); i < size; i++) {
if (touid.equals(mList.get(i).getId())) {
notifyItemChanged(i, "payload");
break;
}
}
}
}
public void updateItem(int position) {
notifyItemChanged(position, "payload");
}
public void clearData() {
mList.clear();
mList.addAll(mAdminChatBeanList);
notifyDataSetChanged();
}
@Override
public int getItemViewType(int position) {
if (position == 0) {
return HEAD;
} else if (position == mList.size() - 1) {
return FOOT;
} else {
return MIDDLE;
}
}
@Override
public Vh onCreateViewHolder(ViewGroup parent, int viewType) {
int layoutId = 0;
if (viewType == HEAD) {
layoutId = R.layout.item_list_msg_head;
} else if (viewType == FOOT) {
layoutId = R.layout.item_list_msg_foot;
} else {
layoutId = R.layout.item_list_msg;
}
return new Vh(mInflater.inflate(layoutId, parent, false));
}
@Override
public void onBindViewHolder(Vh holder, int position) {
}
@Override
public void onBindViewHolder(Vh vh, int position, List<Object> payloads) {
Object payload = payloads.size() > 0 ? payloads.get(0) : null;
vh.setData(mList.get(position), position, payload);
}
@Override
public int getItemCount() {
return mList.size();
}
class Vh extends RecyclerView.ViewHolder {
ImageView mAvatar;
TextView mName;
TextView mLastMsg;
TextView mTime;
View mSys;
TextView mRedPoint;
ChatUserBean mBean;
int mPosition;
public Vh(View itemView) {
super(itemView);
mAvatar = (ImageView) itemView.findViewById(R.id.avatar);
mName = (TextView) itemView.findViewById(R.id.name);
mLastMsg = (TextView) itemView.findViewById(R.id.last_msg);
mTime = (TextView) itemView.findViewById(R.id.time);
mSys = itemView.findViewById(R.id.sys);
mRedPoint = (TextView) itemView.findViewById(R.id.red_point);
mAvatar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mBean.getFromType() == ChatUserBean.TYPE_NORMAL) {
OtherUserActivity.forwardOtherUser(mContext, mBean.getId());
}
}
});
itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
long curTime = System.currentTimeMillis();
if (curTime - mLastClickTime < 1000) {
return;
}
mLastClickTime = curTime;
if (mOnItemClickListener != null) {
mOnItemClickListener.onItemClick(mBean, mPosition);
}
}
});
}
void setData(ChatUserBean bean, int position, Object payload) {
mBean = bean;
mPosition = position;
if (payload == null) {
if (bean.getFromType() == ChatUserBean.TYPE_SYSTEM) {
if (Constants.YB_ID_1.equals(bean.getId())) {
mAvatar.setImageResource(R.mipmap.logo);
} else if (Constants.YB_ID_2.equals(bean.getId())) {
mAvatar.setImageResource(R.mipmap.icon_msg_sys_2);
}
if (mSys.getVisibility() != View.VISIBLE) {
mSys.setVisibility(View.VISIBLE);
}
} else {
ImgLoader.display(bean.getAvatar(), mAvatar);
if (mSys.getVisibility() == View.VISIBLE) {
mSys.setVisibility(View.INVISIBLE);
}
}
mName.setText(bean.getUser_nicename());
}
mTime.setText(bean.getLastTime());
mLastMsg.setText(bean.getLastMessage());
if (bean.getUnReadCount() > 0) {
if (mRedPoint.getVisibility() != View.VISIBLE) {
mRedPoint.setVisibility(View.VISIBLE);
}
mRedPoint.setText(String.valueOf(bean.getUnReadCount()));
} else {
if (mRedPoint.getVisibility() == View.VISIBLE) {
mRedPoint.setVisibility(View.INVISIBLE);
}
}
}
}
}
| [
"chen2297998"
] | chen2297998 |
1a4e8fabca9840ffbaccf8032437159befefa563 | 65a09e9f4450c6133e6de337dbba373a5510160f | /contabForge/src/main/java/co/simasoft/models/contable/contabilidad/Saldos.java | ac8fdf879507e8d6ea5e0ef3c48d6e903c5824a0 | [] | no_license | nelsonjava/simasoft | c0136cdf0c208a5e8d01ab72080330e4a15b1261 | be83eb8ef67758be82bbd811b672572eff1910ee | refs/heads/master | 2021-01-23T15:21:01.981277 | 2017-04-27T12:46:16 | 2017-04-27T12:46:16 | 27,980,384 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,764 | java | package co.simasoft.models.contable.contabilidad;
import co.simasoft.models.contable.contabilidad.*;
import java.util.*;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.lang.Override;
@Entity
public class Saldos
{
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.TABLE)
private long id;
private Integer optlock;
private Date year;
private Date mes;
private float debitos;
private float creditos;
private float saldoInicial;
private float saldoFinal;
@ManyToOne
private Pucs pucs;
@ManyToOne
private Terceros terceros;
public Saldos()
{
}
public Saldos(Date year, Date mes, float debitos, float creditos, float saldoInicial, float saldoFinal)
{
this.year = year;
this.mes = mes;
this.debitos = debitos;
this.creditos = creditos;
this.saldoInicial = saldoInicial;
this.saldoFinal = saldoFinal;
}
public long getId()
{
return this.id;
}
public void setId(long id)
{
this.id = id;
}
public Date getYear()
{
return year;
}
public void setYear(Date year)
{
this.year = year;
}
public Date getMes()
{
return mes;
}
public void setMes(Date mes)
{
this.mes = mes;
}
public float getDebitos()
{
return debitos;
}
public void setDebitos(float debitos)
{
this.debitos = debitos;
}
public float getCreditos()
{
return creditos;
}
public void setCreditos(float creditos)
{
this.creditos = creditos;
}
public float getSaldoInicial()
{
return saldoInicial;
}
public void setSaldoInicial(float saldoInicial)
{
this.saldoInicial = saldoInicial;
}
public float getSaldoFinal()
{
return saldoFinal;
}
public void setSaldoFinal(float saldoFinal)
{
this.saldoFinal = saldoFinal;
}
public Pucs getPucs()
{
return pucs;
}
public void setPucs(Pucs pucs)
{
this.pucs = pucs;
}
public Terceros getTerceros()
{
return terceros;
}
public void setTerceros(Terceros terceros)
{
this.terceros = terceros;
}
@Override
public int hashCode()
{
final int prime = 31;
int result = 1;
result = prime * result + (int) (id ^ (id >>> 32));
return result;
}
@Override
public boolean equals(Object obj)
{
if (this == obj)
{
return true;
}
if (!(obj instanceof Saldos))
{
return false;
}
Saldos other = (Saldos) obj;
if (id != other.id)
{
return false;
}
return true;
}
} // entity
| [
"nelsonjava@gmail.com"
] | nelsonjava@gmail.com |
9480d3ad2693f7b3eabdb47db74b87e4b4b51697 | 3e121bd4055195b24c1b71d6922ff0f76a733c4a | /JMmes/src/main/java/com/bluebirdme/mes/linglong/common/entity/CuringMonthPlanLog.java | 6f59969f2d14216a6d81ca5265153c54e6fed160 | [] | no_license | c-haowan-g/MyFirstRepository | 5a55b268d881f2d1c838db6ddcb1427e446e8dc5 | 626eac1b48bc9645f2785cda9258d41efd07304b | refs/heads/master | 2022-07-28T03:08:01.658858 | 2020-12-26T02:50:52 | 2020-12-26T02:50:52 | 319,186,890 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 32,450 | java | /**
* 上海蓝鸟集团
* 上海蓝鸟科技股份有限公司
* 2018版权所有
*/
package com.bluebirdme.mes.linglong.common.entity;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Column;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import com.bluebirdme.mes.linglong.core.RockWellBaseEntity;
import com.bluebirdme.mes.linglong.core.rockwell.ATDefinition;
import com.bluebirdme.core.system.annotations.Comment;
/**
* 轮胎主表(同步硫化月计划实际产量及已过动平衡量)
* @author 兰颖慧
* @Date 2019-02-20 17:30:34
*/
@ATDefinition("C_MM_MainTyre_QtyLOG")
@Entity
@XmlRootElement
@Table(name="AT_C_MM_MAINTYRE_QTYLOG")
public class CuringMonthPlanLog extends RockWellBaseEntity{
@Comment("机构编号:招远8000;德州8002柳州8003泰国8004")
@Column(nullable=true,length=80)
private String agenc_no_s;
@Comment("归档标记")
@Column(nullable=true,length=2)
private String arch_flag_s;
@Comment("轮胎条码:MainTyre.BARCODE")
@Column(nullable=true,length=80)
private String barcode_s;
@Comment("气泡病象编号:D_BS_Reas.REAS_CODE")
@Column(nullable=true,length=10)
private String blistercode_s;
@Comment("气泡检查次数")
@Column(nullable=true,length=0)
private Integer blistercount_i;
@Comment("气泡质量等级")
@Column(nullable=true,length=80)
private String blistergradecode_s;
@Comment("气泡设备条码")
@Column(nullable=true,length=20)
private String blistermbarcode_s;
@Comment("气泡通过时间")
@Column(nullable=true,length=0)
private Date blisterpasstime_t;
@Comment("气泡质检员工号")
@Column(nullable=true,length=10)
private String blisteruserid_s;
@Comment("成型换规首条确认标记:0-否,1-是")
@Column(nullable=true,length=80)
private String buildingfirstflag_s;
@Comment("成型质量等级编码")
@Column(nullable=true,length=80)
private String buildingradecode_s;
@Comment("成型物料编码")
@Column(nullable=true,length=80)
private String buildingspeccode_s;
@Comment("成型作业ID")
@Column(nullable=true,length=80)
private String buildingtaskid_s;
@Comment("成型生产时间")
@Column(nullable=true,length=0)
private Date buildingtime_t;
@Comment("成型机台")
@Column(nullable=true,length=80)
private String buildinmachinecode_s;
@Comment("物流装笼笼号")
@Column(nullable=true,length=80)
private String cagenumber_s;
@Comment("修改人")
@Column(nullable=true,length=80)
private String changed_by_s;
@Comment("修改时间")
@Column(nullable=true,length=0)
private Date changed_time_t;
@Comment("创建人")
@Column(nullable=true,length=80)
private String created_by_s;
@Comment("创建时间")
@Column(nullable=true,length=0)
private Date created_time_t;
@Comment("硫化合模时间")
@Column(nullable=true,length=0)
private Date curingclosemouldtime_t;
@Comment("硫化换模首条确认标记:0-否,1-是")
@Column(nullable=true,length=80)
private String curingfirstflag_s;
@Comment("硫化质量等级")
@Column(nullable=true,length=80)
private String curinggradecode_s;
@Comment("硫化机台")
@Column(nullable=true,length=80)
private String curingmachinecode_s;
@Comment("硫化开模时间")
@Column(nullable=true,length=0)
private Date curingopenmouldtime_t;
@Comment("硫化物料编码")
@Column(nullable=true,length=80)
private String curingspeccode_s;
@Comment("外胎延时硫化标记,1为延时硫化,其余为空")
@Column(nullable=true,length=80)
private String curingtimedelay_s;
@Comment("硫化员工号")
@Column(nullable=true,length=10)
private String curinguserid_s;
@Comment("疑问胎标记:1标记")
@Column(nullable=true,length=80)
private String doubtflag_s;
@Comment("动平衡检查次数")
@Column(nullable=true,length=0)
private Integer dynamicbalancecount_i;
@Comment("动平衡质量等级")
@Column(nullable=true,length=80)
private String dynamicbalancegradecode_s;
@Comment("动平衡配方号")
@Column(nullable=true,length=0)
private Integer dynamicbalanceindex_i;
@Comment("动平衡机条码")
@Column(nullable=true,length=20)
private String dynamicbalancembarcode_s;
@Comment("动平衡通过时间")
@Column(nullable=true,length=0)
private Date dynamicbalancepasstime_t;
@Comment("动平衡病象编号:D_BS_Reas.REAS_CODE")
@Column(nullable=true,length=10)
private String dynamicbalancereascode_s;
@Comment("动平衡质检员工号")
@Column(nullable=true,length=10)
private String dynamicbalanceuserid_s;
@Comment("质量等级编码")
@Column(nullable=true,length=80)
private String gradecode_s;
@Comment("轮胎毛重量")
@Column(nullable=true,length=0)
private Integer grossweight_i;
@Comment("割毛次数")
@Column(nullable=true,length=0)
private Integer hairscount_i;
@Comment("割毛质量等级")
@Column(nullable=true,length=80)
private String hairsgradecode_s;
@Comment("割毛操作时间")
@Column(nullable=true,length=0)
private Date hairspasstime_t;
@Comment("物流推送-推送次数")
@Column(nullable=true,length=0)
private Integer handcount_i;
@Comment("物流推送-推送标记:0-未推送,1-已推送")
@Column(nullable=true,length=80)
private String handflag_s;
@Comment("镂空条码")
@Column(nullable=true,length=80)
private String hollowedbarcode_s;
@Comment("主键ID")
@Column(nullable=true,length=80)
private String id_s;
@Comment("跟踪胎标识:1跟踪")
@Column(nullable=true,length=80)
private String integratedcode_s;
@Comment("是否复检:0未复检、1已复检过")
@Column(nullable=true,length=80)
private String isrck_s;
@Comment("当前工序")
@Column(nullable=true,length=80)
private String proess_s;
@Comment("病象编号:D_BS_Reas.REAS_CODE")
@Column(nullable=true,length=80)
private String reascode_s;
@Comment("记录标志,A可用,D删除")
@Column(nullable=true,length=2)
private String record_flag_s;
@Comment("物流推送-错误消息(处理成功是返回空)")
@Column(nullable=true,length=383)
private String returnmsg_s;
@Comment("物流推送-返回处理结果状态(S:处理成功,E:处理失败,U:处理异常)")
@Column(nullable=true,length=80)
private String returnstatus_s;
@Comment("销售方式:0-内销、1-外销")
@Column(nullable=true,length=80)
private String saletype_s;
@Comment("产量更新标记:0-未更新,1-已更新")
@Column(nullable=true,length=80)
private String spare1_s;
@Comment("过动平衡量跟新标记:0-未更新,1-已更新")
@Column(nullable=true,length=80)
private String spare2_s;
@Comment("备用字段3")
@Column(nullable=true,length=80)
private String spare3_s;
@Comment("硫化月计划号")
@Column(nullable=true,length=80)
private String spare4_s;
@Comment("备用字段5")
@Column(nullable=true,length=80)
private String spare5_s;
@Comment("轮胎状态编码:0-待检、1-合格、2-不合格")
@Column(nullable=true,length=80)
private String statecode_s;
@Comment("数据同步创建时间")
@Column(nullable=true,length=0)
private Date sync_create_time_t;
@Comment("数据同步处理:A-新增、U-修改、D-删除")
@Column(nullable=true,length=80)
private String sync_flag_s;
@Comment("数据同步处理标记:0-未处理、1-已处理")
@Column(nullable=true,length=80)
private String sync_hand_flag_s;
@Comment("数据同步处理反馈")
@Column(nullable=true,length=200)
private String sync_hand_msg_s;
@Comment("数据同步处理时间")
@Column(nullable=true,length=0)
private Date sync_hand_time_t;
@Comment("工厂(1全钢2半钢)")
@Column(nullable=true,length=80)
private String s_factory_s;
@Comment("预入库胎抽检扫描时间")
@Column(nullable=true,length=0)
private Date tackchecktime_t;
@Comment("预入库胎抽检扫描人ID")
@Column(nullable=true,length=80)
private String tackcheckuserid_s;
@Comment("总返修次数")
@Column(nullable=true,length=0)
private Integer totalreworknum_i;
@Comment("轮胎去向标识:1-返修、2-割毛")
@Column(nullable=true,length=80)
private String trackdirection_s;
@Comment("均匀度检查次数")
@Column(nullable=true,length=0)
private Integer uniformitycount_i;
@Comment("均匀度质量等级")
@Column(nullable=true,length=80)
private String uniformitygradecode_s;
@Comment("均匀度配方号")
@Column(nullable=true,length=0)
private Integer uniformityindex_i;
@Comment("均匀度设备条码")
@Column(nullable=true,length=20)
private String uniformitymbarcode_s;
@Comment("均匀度通过时间")
@Column(nullable=true,length=0)
private Date uniformitypasstime_t;
@Comment("均匀度病象编号:D_BS_Reas.REAS_CODE")
@Column(nullable=true,length=10)
private String uniformityreascode_s;
@Comment("均匀度质检员工号")
@Column(nullable=true,length=10)
private String uniformityuserid_s;
@Comment("外胎检查次数")
@Column(nullable=true,length=0)
private Integer visualcount_i;
@Comment("外胎重检一次操作时间")
@Column(nullable=true,length=80)
private String visuald1_s;
@Comment("外胎重检二次操作时间")
@Column(nullable=true,length=80)
private String visuald3_s;
@Comment("外胎质量等级")
@Column(nullable=true,length=80)
private String visualgradecode_s;
@Comment("外胎重检一次检测工位")
@Column(nullable=true,length=20)
private String visualmbarcode1_s;
@Comment("外胎重检一次检测工位")
@Column(nullable=true,length=20)
private String visualmbarcode2_s;
@Comment("外胎操作时间")
@Column(nullable=true,length=0)
private Date visualpasstime_t;
@Comment("外胎重检一次次扫描人ID")
@Column(nullable=true,length=80)
private String visualuserid1_s;
@Comment("外胎重检二次扫描人ID")
@Column(nullable=true,length=80)
private String visualuserid2_s;
@Comment("年周号")
@Column(nullable=true,length=80)
private String weeklynumber_s;
@Comment("X光检查次数")
@Column(nullable=true,length=0)
private Integer xlightcount_i;
@Comment("X光质量等级")
@Column(nullable=true,length=80)
private String xlightgradecode_s;
@Comment("X光配方号")
@Column(nullable=true,length=0)
private Integer xlightindex_i;
@Comment("X光机条码")
@Column(nullable=true,length=20)
private String xlightmbarcode_s;
@Comment("X光通过时间")
@Column(nullable=true,length=0)
private Date xlightpasstime_t;
@Comment("X光病象编号:D_BS_Reas.REAS_CODE")
@Column(nullable=true,length=10)
private String xlightreascode_s;
@Comment("X光质检员工号")
@Column(nullable=true,length=10)
private String xlightuserid_s;
public String getAgenc_no_s(){
return agenc_no_s;
}
@XmlElement
public void setAgenc_no_s(String agenc_no_s){
this.agenc_no_s=agenc_no_s;
}
public String getArch_flag_s(){
return arch_flag_s;
}
@XmlElement
public void setArch_flag_s(String arch_flag_s){
this.arch_flag_s=arch_flag_s;
}
public String getBarcode_s(){
return barcode_s;
}
@XmlElement
public void setBarcode_s(String barcode_s){
this.barcode_s=barcode_s;
}
public String getBlistercode_s(){
return blistercode_s;
}
@XmlElement
public void setBlistercode_s(String blistercode_s){
this.blistercode_s=blistercode_s;
}
public Integer getBlistercount_i(){
return blistercount_i;
}
@XmlElement
public void setBlistercount_i(Integer blistercount_i){
this.blistercount_i=blistercount_i;
}
public String getBlistergradecode_s(){
return blistergradecode_s;
}
@XmlElement
public void setBlistergradecode_s(String blistergradecode_s){
this.blistergradecode_s=blistergradecode_s;
}
public String getBlistermbarcode_s(){
return blistermbarcode_s;
}
@XmlElement
public void setBlistermbarcode_s(String blistermbarcode_s){
this.blistermbarcode_s=blistermbarcode_s;
}
public Date getBlisterpasstime_t(){
return blisterpasstime_t;
}
@XmlElement
public void setBlisterpasstime_t(Date blisterpasstime_t){
this.blisterpasstime_t=blisterpasstime_t;
}
public String getBlisteruserid_s(){
return blisteruserid_s;
}
@XmlElement
public void setBlisteruserid_s(String blisteruserid_s){
this.blisteruserid_s=blisteruserid_s;
}
public String getBuildingfirstflag_s(){
return buildingfirstflag_s;
}
@XmlElement
public void setBuildingfirstflag_s(String buildingfirstflag_s){
this.buildingfirstflag_s=buildingfirstflag_s;
}
public String getBuildingradecode_s(){
return buildingradecode_s;
}
@XmlElement
public void setBuildingradecode_s(String buildingradecode_s){
this.buildingradecode_s=buildingradecode_s;
}
public String getBuildingspeccode_s(){
return buildingspeccode_s;
}
@XmlElement
public void setBuildingspeccode_s(String buildingspeccode_s){
this.buildingspeccode_s=buildingspeccode_s;
}
public String getBuildingtaskid_s(){
return buildingtaskid_s;
}
@XmlElement
public void setBuildingtaskid_s(String buildingtaskid_s){
this.buildingtaskid_s=buildingtaskid_s;
}
public Date getBuildingtime_t(){
return buildingtime_t;
}
@XmlElement
public void setBuildingtime_t(Date buildingtime_t){
this.buildingtime_t=buildingtime_t;
}
public String getBuildinmachinecode_s(){
return buildinmachinecode_s;
}
@XmlElement
public void setBuildinmachinecode_s(String buildinmachinecode_s){
this.buildinmachinecode_s=buildinmachinecode_s;
}
public String getCagenumber_s(){
return cagenumber_s;
}
@XmlElement
public void setCagenumber_s(String cagenumber_s){
this.cagenumber_s=cagenumber_s;
}
public String getChanged_by_s(){
return changed_by_s;
}
@XmlElement
public void setChanged_by_s(String changed_by_s){
this.changed_by_s=changed_by_s;
}
public Date getChanged_time_t(){
return changed_time_t;
}
@XmlElement
public void setChanged_time_t(Date changed_time_t){
this.changed_time_t=changed_time_t;
}
public String getCreated_by_s(){
return created_by_s;
}
@XmlElement
public void setCreated_by_s(String created_by_s){
this.created_by_s=created_by_s;
}
public Date getCreated_time_t(){
return created_time_t;
}
@XmlElement
public void setCreated_time_t(Date created_time_t){
this.created_time_t=created_time_t;
}
public Date getCuringclosemouldtime_t(){
return curingclosemouldtime_t;
}
@XmlElement
public void setCuringclosemouldtime_t(Date curingclosemouldtime_t){
this.curingclosemouldtime_t=curingclosemouldtime_t;
}
public String getCuringfirstflag_s(){
return curingfirstflag_s;
}
@XmlElement
public void setCuringfirstflag_s(String curingfirstflag_s){
this.curingfirstflag_s=curingfirstflag_s;
}
public String getCuringgradecode_s(){
return curinggradecode_s;
}
@XmlElement
public void setCuringgradecode_s(String curinggradecode_s){
this.curinggradecode_s=curinggradecode_s;
}
public String getCuringmachinecode_s(){
return curingmachinecode_s;
}
@XmlElement
public void setCuringmachinecode_s(String curingmachinecode_s){
this.curingmachinecode_s=curingmachinecode_s;
}
public Date getCuringopenmouldtime_t(){
return curingopenmouldtime_t;
}
@XmlElement
public void setCuringopenmouldtime_t(Date curingopenmouldtime_t){
this.curingopenmouldtime_t=curingopenmouldtime_t;
}
public String getCuringspeccode_s(){
return curingspeccode_s;
}
@XmlElement
public void setCuringspeccode_s(String curingspeccode_s){
this.curingspeccode_s=curingspeccode_s;
}
public String getCuringtimedelay_s(){
return curingtimedelay_s;
}
@XmlElement
public void setCuringtimedelay_s(String curingtimedelay_s){
this.curingtimedelay_s=curingtimedelay_s;
}
public String getCuringuserid_s(){
return curinguserid_s;
}
@XmlElement
public void setCuringuserid_s(String curinguserid_s){
this.curinguserid_s=curinguserid_s;
}
public String getDoubtflag_s(){
return doubtflag_s;
}
@XmlElement
public void setDoubtflag_s(String doubtflag_s){
this.doubtflag_s=doubtflag_s;
}
public Integer getDynamicbalancecount_i(){
return dynamicbalancecount_i;
}
@XmlElement
public void setDynamicbalancecount_i(Integer dynamicbalancecount_i){
this.dynamicbalancecount_i=dynamicbalancecount_i;
}
public String getDynamicbalancegradecode_s(){
return dynamicbalancegradecode_s;
}
@XmlElement
public void setDynamicbalancegradecode_s(String dynamicbalancegradecode_s){
this.dynamicbalancegradecode_s=dynamicbalancegradecode_s;
}
public Integer getDynamicbalanceindex_i(){
return dynamicbalanceindex_i;
}
@XmlElement
public void setDynamicbalanceindex_i(Integer dynamicbalanceindex_i){
this.dynamicbalanceindex_i=dynamicbalanceindex_i;
}
public String getDynamicbalancembarcode_s(){
return dynamicbalancembarcode_s;
}
@XmlElement
public void setDynamicbalancembarcode_s(String dynamicbalancembarcode_s){
this.dynamicbalancembarcode_s=dynamicbalancembarcode_s;
}
public Date getDynamicbalancepasstime_t(){
return dynamicbalancepasstime_t;
}
@XmlElement
public void setDynamicbalancepasstime_t(Date dynamicbalancepasstime_t){
this.dynamicbalancepasstime_t=dynamicbalancepasstime_t;
}
public String getDynamicbalancereascode_s(){
return dynamicbalancereascode_s;
}
@XmlElement
public void setDynamicbalancereascode_s(String dynamicbalancereascode_s){
this.dynamicbalancereascode_s=dynamicbalancereascode_s;
}
public String getDynamicbalanceuserid_s(){
return dynamicbalanceuserid_s;
}
@XmlElement
public void setDynamicbalanceuserid_s(String dynamicbalanceuserid_s){
this.dynamicbalanceuserid_s=dynamicbalanceuserid_s;
}
public String getGradecode_s(){
return gradecode_s;
}
@XmlElement
public void setGradecode_s(String gradecode_s){
this.gradecode_s=gradecode_s;
}
public Integer getGrossweight_i(){
return grossweight_i;
}
@XmlElement
public void setGrossweight_i(Integer grossweight_i){
this.grossweight_i=grossweight_i;
}
public Integer getHairscount_i(){
return hairscount_i;
}
@XmlElement
public void setHairscount_i(Integer hairscount_i){
this.hairscount_i=hairscount_i;
}
public String getHairsgradecode_s(){
return hairsgradecode_s;
}
@XmlElement
public void setHairsgradecode_s(String hairsgradecode_s){
this.hairsgradecode_s=hairsgradecode_s;
}
public Date getHairspasstime_t(){
return hairspasstime_t;
}
@XmlElement
public void setHairspasstime_t(Date hairspasstime_t){
this.hairspasstime_t=hairspasstime_t;
}
public Integer getHandcount_i(){
return handcount_i;
}
@XmlElement
public void setHandcount_i(Integer handcount_i){
this.handcount_i=handcount_i;
}
public String getHandflag_s(){
return handflag_s;
}
@XmlElement
public void setHandflag_s(String handflag_s){
this.handflag_s=handflag_s;
}
public String getHollowedbarcode_s(){
return hollowedbarcode_s;
}
@XmlElement
public void setHollowedbarcode_s(String hollowedbarcode_s){
this.hollowedbarcode_s=hollowedbarcode_s;
}
public String getId_s(){
return id_s;
}
@XmlElement
public void setId_s(String id_s){
this.id_s=id_s;
}
public String getIntegratedcode_s(){
return integratedcode_s;
}
@XmlElement
public void setIntegratedcode_s(String integratedcode_s){
this.integratedcode_s=integratedcode_s;
}
public String getIsrck_s(){
return isrck_s;
}
@XmlElement
public void setIsrck_s(String isrck_s){
this.isrck_s=isrck_s;
}
public String getProess_s(){
return proess_s;
}
@XmlElement
public void setProess_s(String proess_s){
this.proess_s=proess_s;
}
public String getReascode_s(){
return reascode_s;
}
@XmlElement
public void setReascode_s(String reascode_s){
this.reascode_s=reascode_s;
}
public String getRecord_flag_s(){
return record_flag_s;
}
@XmlElement
public void setRecord_flag_s(String record_flag_s){
this.record_flag_s=record_flag_s;
}
public String getReturnmsg_s(){
return returnmsg_s;
}
@XmlElement
public void setReturnmsg_s(String returnmsg_s){
this.returnmsg_s=returnmsg_s;
}
public String getReturnstatus_s(){
return returnstatus_s;
}
@XmlElement
public void setReturnstatus_s(String returnstatus_s){
this.returnstatus_s=returnstatus_s;
}
public String getSaletype_s(){
return saletype_s;
}
@XmlElement
public void setSaletype_s(String saletype_s){
this.saletype_s=saletype_s;
}
public String getSpare1_s(){
return spare1_s;
}
@XmlElement
public void setSpare1_s(String spare1_s){
this.spare1_s=spare1_s;
}
public String getSpare2_s(){
return spare2_s;
}
@XmlElement
public void setSpare2_s(String spare2_s){
this.spare2_s=spare2_s;
}
public String getSpare3_s(){
return spare3_s;
}
@XmlElement
public void setSpare3_s(String spare3_s){
this.spare3_s=spare3_s;
}
public String getSpare4_s(){
return spare4_s;
}
@XmlElement
public void setSpare4_s(String spare4_s){
this.spare4_s=spare4_s;
}
public String getSpare5_s(){
return spare5_s;
}
@XmlElement
public void setSpare5_s(String spare5_s){
this.spare5_s=spare5_s;
}
public String getStatecode_s(){
return statecode_s;
}
@XmlElement
public void setStatecode_s(String statecode_s){
this.statecode_s=statecode_s;
}
public Date getSync_create_time_t(){
return sync_create_time_t;
}
@XmlElement
public void setSync_create_time_t(Date sync_create_time_t){
this.sync_create_time_t=sync_create_time_t;
}
public String getSync_flag_s(){
return sync_flag_s;
}
@XmlElement
public void setSync_flag_s(String sync_flag_s){
this.sync_flag_s=sync_flag_s;
}
public String getSync_hand_flag_s(){
return sync_hand_flag_s;
}
@XmlElement
public void setSync_hand_flag_s(String sync_hand_flag_s){
this.sync_hand_flag_s=sync_hand_flag_s;
}
public String getSync_hand_msg_s(){
return sync_hand_msg_s;
}
@XmlElement
public void setSync_hand_msg_s(String sync_hand_msg_s){
this.sync_hand_msg_s=sync_hand_msg_s;
}
public Date getSync_hand_time_t(){
return sync_hand_time_t;
}
@XmlElement
public void setSync_hand_time_t(Date sync_hand_time_t){
this.sync_hand_time_t=sync_hand_time_t;
}
public String getS_factory_s(){
return s_factory_s;
}
@XmlElement
public void setS_factory_s(String s_factory_s){
this.s_factory_s=s_factory_s;
}
public Date getTackchecktime_t(){
return tackchecktime_t;
}
@XmlElement
public void setTackchecktime_t(Date tackchecktime_t){
this.tackchecktime_t=tackchecktime_t;
}
public String getTackcheckuserid_s(){
return tackcheckuserid_s;
}
@XmlElement
public void setTackcheckuserid_s(String tackcheckuserid_s){
this.tackcheckuserid_s=tackcheckuserid_s;
}
public Integer getTotalreworknum_i(){
return totalreworknum_i;
}
@XmlElement
public void setTotalreworknum_i(Integer totalreworknum_i){
this.totalreworknum_i=totalreworknum_i;
}
public String getTrackdirection_s(){
return trackdirection_s;
}
@XmlElement
public void setTrackdirection_s(String trackdirection_s){
this.trackdirection_s=trackdirection_s;
}
public Integer getUniformitycount_i(){
return uniformitycount_i;
}
@XmlElement
public void setUniformitycount_i(Integer uniformitycount_i){
this.uniformitycount_i=uniformitycount_i;
}
public String getUniformitygradecode_s(){
return uniformitygradecode_s;
}
@XmlElement
public void setUniformitygradecode_s(String uniformitygradecode_s){
this.uniformitygradecode_s=uniformitygradecode_s;
}
public Integer getUniformityindex_i(){
return uniformityindex_i;
}
@XmlElement
public void setUniformityindex_i(Integer uniformityindex_i){
this.uniformityindex_i=uniformityindex_i;
}
public String getUniformitymbarcode_s(){
return uniformitymbarcode_s;
}
@XmlElement
public void setUniformitymbarcode_s(String uniformitymbarcode_s){
this.uniformitymbarcode_s=uniformitymbarcode_s;
}
public Date getUniformitypasstime_t(){
return uniformitypasstime_t;
}
@XmlElement
public void setUniformitypasstime_t(Date uniformitypasstime_t){
this.uniformitypasstime_t=uniformitypasstime_t;
}
public String getUniformityreascode_s(){
return uniformityreascode_s;
}
@XmlElement
public void setUniformityreascode_s(String uniformityreascode_s){
this.uniformityreascode_s=uniformityreascode_s;
}
public String getUniformityuserid_s(){
return uniformityuserid_s;
}
@XmlElement
public void setUniformityuserid_s(String uniformityuserid_s){
this.uniformityuserid_s=uniformityuserid_s;
}
public Integer getVisualcount_i(){
return visualcount_i;
}
@XmlElement
public void setVisualcount_i(Integer visualcount_i){
this.visualcount_i=visualcount_i;
}
public String getVisuald1_s(){
return visuald1_s;
}
@XmlElement
public void setVisuald1_s(String visuald1_s){
this.visuald1_s=visuald1_s;
}
public String getVisuald3_s(){
return visuald3_s;
}
@XmlElement
public void setVisuald3_s(String visuald3_s){
this.visuald3_s=visuald3_s;
}
public String getVisualgradecode_s(){
return visualgradecode_s;
}
@XmlElement
public void setVisualgradecode_s(String visualgradecode_s){
this.visualgradecode_s=visualgradecode_s;
}
public String getVisualmbarcode1_s(){
return visualmbarcode1_s;
}
@XmlElement
public void setVisualmbarcode1_s(String visualmbarcode1_s){
this.visualmbarcode1_s=visualmbarcode1_s;
}
public String getVisualmbarcode2_s(){
return visualmbarcode2_s;
}
@XmlElement
public void setVisualmbarcode2_s(String visualmbarcode2_s){
this.visualmbarcode2_s=visualmbarcode2_s;
}
public Date getVisualpasstime_t(){
return visualpasstime_t;
}
@XmlElement
public void setVisualpasstime_t(Date visualpasstime_t){
this.visualpasstime_t=visualpasstime_t;
}
public String getVisualuserid1_s(){
return visualuserid1_s;
}
@XmlElement
public void setVisualuserid1_s(String visualuserid1_s){
this.visualuserid1_s=visualuserid1_s;
}
public String getVisualuserid2_s(){
return visualuserid2_s;
}
@XmlElement
public void setVisualuserid2_s(String visualuserid2_s){
this.visualuserid2_s=visualuserid2_s;
}
public String getWeeklynumber_s(){
return weeklynumber_s;
}
@XmlElement
public void setWeeklynumber_s(String weeklynumber_s){
this.weeklynumber_s=weeklynumber_s;
}
public Integer getXlightcount_i(){
return xlightcount_i;
}
@XmlElement
public void setXlightcount_i(Integer xlightcount_i){
this.xlightcount_i=xlightcount_i;
}
public String getXlightgradecode_s(){
return xlightgradecode_s;
}
@XmlElement
public void setXlightgradecode_s(String xlightgradecode_s){
this.xlightgradecode_s=xlightgradecode_s;
}
public Integer getXlightindex_i(){
return xlightindex_i;
}
@XmlElement
public void setXlightindex_i(Integer xlightindex_i){
this.xlightindex_i=xlightindex_i;
}
public String getXlightmbarcode_s(){
return xlightmbarcode_s;
}
@XmlElement
public void setXlightmbarcode_s(String xlightmbarcode_s){
this.xlightmbarcode_s=xlightmbarcode_s;
}
public Date getXlightpasstime_t(){
return xlightpasstime_t;
}
@XmlElement
public void setXlightpasstime_t(Date xlightpasstime_t){
this.xlightpasstime_t=xlightpasstime_t;
}
public String getXlightreascode_s(){
return xlightreascode_s;
}
@XmlElement
public void setXlightreascode_s(String xlightreascode_s){
this.xlightreascode_s=xlightreascode_s;
}
public String getXlightuserid_s(){
return xlightuserid_s;
}
@XmlElement
public void setXlightuserid_s(String xlightuserid_s){
this.xlightuserid_s=xlightuserid_s;
}
}
| [
"1435768264@qq.com"
] | 1435768264@qq.com |
96ce009a98cf0d4bb043fba41ff7b640b3032a98 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/5/5_8cc11f64748c6b1587cc806b334da3c43c2a2351/MicroarraySetParser/5_8cc11f64748c6b1587cc806b334da3c43c2a2351_MicroarraySetParser_t.java | 3baaab276d9ffd876f3fca429e086eb4d057c001 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 13,077 | java | package org.geworkbench.parsers;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.geworkbench.bison.annotation.CSAnnotationContext;
import org.geworkbench.bison.annotation.CSAnnotationContextManager;
import org.geworkbench.bison.annotation.DSAnnotationContext;
import org.geworkbench.bison.datastructure.biocollections.microarrays.CSMicroarraySet;
import org.geworkbench.bison.datastructure.biocollections.microarrays.DSMicroarraySet;
import org.geworkbench.bison.datastructure.bioobjects.markers.CSExpressionMarker;
import org.geworkbench.bison.datastructure.bioobjects.markers.DSGeneMarker;
import org.geworkbench.bison.datastructure.bioobjects.markers.DSRangeMarker;
import org.geworkbench.bison.datastructure.bioobjects.markers.annotationparser.AnnotationParser;
import org.geworkbench.bison.datastructure.bioobjects.microarray.CSExpressionMarkerValue;
import org.geworkbench.bison.datastructure.bioobjects.microarray.CSMarkerValue;
import org.geworkbench.bison.datastructure.bioobjects.microarray.CSMicroarray;
import org.geworkbench.bison.datastructure.bioobjects.microarray.DSMarkerValue;
import org.geworkbench.bison.datastructure.bioobjects.microarray.DSMicroarray;
import org.geworkbench.bison.datastructure.bioobjects.microarray.DSMutableMarkerValue;
import org.geworkbench.bison.util.Range;
import org.geworkbench.util.AffyAnnotationUtil;
/**
*
* Parser of .exp file.
*
* @author zji
* @version $Id$
*
*/
// TODO The exceptional cases are not handled very well by this parser. Returning null does not provide much information.
public class MicroarraySetParser {
private static Log log = LogFactory.getLog(MicroarraySetParser.class);
/** Parse without associate to annotation file. */
// FIXME this method is only used by ConsensusClustering, which does not handle either InputFileFormatException or returned null.
public DSMicroarraySet parseCSMicroarraySet(File file) {
DSMicroarraySet microarraySet = new CSMicroarraySet();
microarraySet.setFile( file ); // this seems only used by "View in Editor"
microarraySet.setLabel(file.getName());
AnnotationParser.setCurrentDataSet(microarraySet);
try {
if (!readFile(file))
return null;
} catch (InputFileFormatException e) {
e.printStackTrace();
return null;
}
populateDataset(microarraySet);
return microarraySet;
}
/** Parse existing microarraySet without associate to annotation file.
* @throws InputFileFormatException */
public void parseExistingCSMicroarraySet(File file, DSMicroarraySet microarraySet) throws InputFileFormatException {
if(microarraySet == null) return;
microarraySet.setFile( file ); // this seems only used by "View in Editor"
microarraySet.setLabel(file.getName());
AnnotationParser.setCurrentDataSet(microarraySet);
if (!readFile(file))
return;
populateDataset(microarraySet);
}
/** Parse when invoked from ExpressionFileFormat. */
DSMicroarraySet parseCSMicroarraySet(File file, String compatibilityLabel) throws InputFileFormatException {
DSMicroarraySet microarraySet = new CSMicroarraySet();
if (compatibilityLabel != null) {
microarraySet.setCompatibilityLabel(compatibilityLabel);
} else {
String chiptype = AffyAnnotationUtil
.matchAffyAnnotationFile(microarraySet);
if (chiptype == null) { // this is never null
log.error("annotation returned as null");
}
microarraySet.setCompatibilityLabel(chiptype);
}
microarraySet.setFile( file ); // this seems only used by "View in Editor"
microarraySet.setLabel(file.getName());
AnnotationParser.setCurrentDataSet(microarraySet);
if (!readFile(file)) {
throw new InputFileFormatException();
}
populateDataset(microarraySet);
return microarraySet;
}
transient boolean pValueExists = false;
private boolean readFile(File file) throws InputFileFormatException {
markerNumber = 0;
pValueExists = false;
String line = null;
BufferedReader reader = null;
try {
reader = new BufferedReader(new FileReader(file));
markerValues = new ArrayList<DSMarkerValue[]>();
while ((line = reader.readLine()) != null) {
if (!line.trim().equalsIgnoreCase("")) {
parseLine(line);
}
}
} catch (IOException ioe) {
log.error("Error while parsing line: " + line);
ioe.printStackTrace();
return false;
} finally {
try {
if(reader!=null)
reader.close();
} catch (IOException e) {
// nothing further necessary
}
}
return true;
}
private void populateDataset(DSMicroarraySet microarraySet) {
// just to make it is clear it is final here
final int markerCount = markerNumber;
microarraySet.initializeMarkerVector(markerCount); // only way to set marker
// count
for (int i = 0; i < arrayNames.size(); i++) {
microarraySet.add(i, (DSMicroarray) new CSMicroarray(i,
markerCount, arrayNames.get(i),
DSMicroarraySet.expPvalueType));
}
CSAnnotationContextManager manager = CSAnnotationContextManager
.getInstance();
for (String phLabel : arrayInfo.keySet()) {
DSAnnotationContext<DSMicroarray> context = manager.getContext(
microarraySet, phLabel);
CSAnnotationContext.initializePhenotypeContext(context);
String[] labels = arrayInfo.get(phLabel);
for (int arrayIndex = 0; arrayIndex < labels.length; arrayIndex++) {
if (labels[arrayIndex] == null
|| labels[arrayIndex].length() == 0)
continue;
if (labels[arrayIndex].indexOf("|") > -1) {
for (String tok : labels[arrayIndex].split("\\|")) {
context.labelItem(microarraySet.get(arrayIndex), tok);
}
} else {
context.labelItem(microarraySet.get(arrayIndex),
labels[arrayIndex]);
}
}
}
for (int markerIndex = 0; markerIndex < markerCount; markerIndex++) {
microarraySet.getMarkers().set(markerIndex,
markers.get(markerIndex));
}
if(microarraySet instanceof CSMicroarraySet) {
((CSMicroarraySet)microarraySet).getMarkers().correctMaps();
}
microarraySet.sortMarkers(markerCount);
int markerIndex = 0;
for (DSMarkerValue[] markerValue : markerValues) {
for (int arrayIndex = 0; arrayIndex < arrayNames.size(); arrayIndex++) {
// missing data should not be set as null
if(markerValue[arrayIndex]==null) continue;
microarraySet.get(arrayIndex).setMarkerValue(
microarraySet.getNewMarkerOrder()[markerIndex],
markerValue[arrayIndex]);
}
markerIndex++;
}
}
private transient int markerNumber = 0;
private transient List<String> arrayNames = new ArrayList<String>();
// use LinkedHashMap so to maintain the order
private transient Map<String, String[]> arrayInfo = new LinkedHashMap<String, String[]>();
private transient List<DSGeneMarker> markers = new ArrayList<DSGeneMarker>();
private transient List<DSMarkerValue[]> markerValues = null;
private DSMarkerValue[] parseValue(String[] fields) throws InputFileFormatException {
// This handles individual gene lines with (value, pvalue) pairs
// separated by tabs
if(markerNumber==0) { // only do this for the first line
if(fields.length-2 == arrayNames.size()) {
pValueExists = false;
} else if(fields.length-2 == arrayNames.size()*2) {
pValueExists = true;
} else {
throw new InputFileFormatException("Field number (first line) is incorrect.");
}
} else {
if(fields.length-2 == arrayNames.size() ) {
if(pValueExists)
throw new InputFileFormatException("Value field number is not double the header field number for the case of p-value existing.");
} else if(fields.length-2 == arrayNames.size()*2 ) {
if(!pValueExists)
throw new InputFileFormatException("Value field number is double the header field number for the case of no p-value.");
} else {
throw new InputFileFormatException("Field number is incorrect.");
}
}
boolean pValueExists = (fields.length-2 > arrayNames.size());
DSMarkerValue[] values = new DSMarkerValue[arrayNames.size()];
int arrayIndex = 0;
int step = 1;
if(pValueExists) step = 2;
for(int i=2; i<fields.length; i += step) {
String value = fields[i];
String status; // p-value or letter status
if (pValueExists) {
status = fields[i+1];
} else {
// If no p-value is present, assume that the detection
// call is "Present"
status = 0.000001 + "";
}
DSMutableMarkerValue markerValue = createMarkerValue(value, status);
// markerValue does not really need to be mutable. it is
// DSRangeMarker's mistake
((DSRangeMarker) markers.get(markerNumber)).updateRange(markerValue);
values[arrayIndex++] = markerValue;
}
return values;
}
/**
* initialize microarrays; initializer markers (probe sets); prompt for affy
* annotation.
* @throws InputFileFormatException
*/
private void parseLine(String line) throws InputFileFormatException {
if (line.charAt(0) == '#') {
return;
}
int startindx = line.indexOf('\t');
if (startindx <= 0)
return;
String[] fields = line.split( "\t", -1 );
if (line.substring(0, 6).equalsIgnoreCase("AffyID")) {
for(int i=2; i<fields.length; i++) {
arrayNames.add(fields[i]);
}
} else if (line.substring(0, 11).equalsIgnoreCase("Description")) {
// This handles all the phenotype definition lines
String[] f = line.split("\t", -1);
String[] labels = new String[(arrayNames.size())];
for(int i=0; i<Math.min(labels.length, f.length-2); i++) {
labels[i] = f[i+2];
}
String phLabel = new String(f[1]);
arrayInfo.put(phLabel, labels);
} else if (line.charAt(0) != '\t') {
CSExpressionMarker marker = new CSExpressionMarker(markerNumber);
marker.setLabel(fields[0]);
// set the annotation field of current marker
marker.setDescription(fields[1]);
marker.getUnigene().set(fields[0]);
String[] entrezIds = AnnotationParser.getInfo(fields[0],
AnnotationParser.LOCUSLINK);
if ((entrezIds != null) && (!entrezIds[0].trim().equals(""))) {
try {
marker.setGeneId(Integer.parseInt(entrezIds[0].trim()));
} catch (NumberFormatException e) {
log.debug("Invalid locus link for gene " + markerNumber);
}
}
String[] geneNames = AnnotationParser.getInfo(fields[0],
AnnotationParser.ABREV);
if (geneNames != null) {
marker.setGeneName(geneNames[0].trim());
}
String[] annotations = AnnotationParser.getInfo(fields[0],
AnnotationParser.DESCRIPTION);
if (annotations != null) {
marker.setAnnotation(annotations[0].trim());
}
markers.add(marker);
markerValues.add(parseValue(fields));
markerNumber++;
}
}
private DSMutableMarkerValue createMarkerValue(String value, String status) {
CSMarkerValue markerValue = new CSExpressionMarkerValue(0);
// support status a in letter and extra text before the actual value
if (Character.isLetter(status.charAt(0))) {
String[] parseableValue = value.split(":");
value = parseableValue[parseableValue.length - 1];
}
try {
double v = Double.parseDouble(value);
Range range = ((DSRangeMarker) markers.get(markerNumber))
.getRange();
markerValue.setValue(v);
range.max = Math.max(range.max, v);
range.min = Math.min(range.min, v);
} catch (NumberFormatException e) {
markerValue.setValue(0.0);
markerValue.setMissing(true);
return markerValue;
}
char c = status.charAt(0);
if (Character.isLetter(c)) {
try {
if (Character.isLowerCase(c)) {
markerValue.mask();
}
switch (Character.toUpperCase(c)) {
case 'P':
markerValue.setPresent();
break;
case 'A':
markerValue.setAbsent();
break;
case 'M':
markerValue.setMarginal();
break;
default:
markerValue.setMissing(true);
break;
}
} catch (NumberFormatException e) {
markerValue.setValue(0.0);
markerValue.setMissing(true);
}
} else {
try {
double p = Double.parseDouble(status);
markerValue.setConfidence(p);
} catch (NumberFormatException e) {
markerValue.setValue(0.0);
markerValue.setMissing(true);
}
}
return markerValue;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
05224cb2893aac1976ba80fa0e5a8bf6befe31dc | 85e510ac3571e9caa56676535f2f987dc54c93ca | /src/main/java/com/tiendarop/model/entity/Proveedor.java | 56bf52e7e233b451bbd19648f2f2ce2bc637f07a | [] | no_license | jesusChristian18/T4Soluciones | 44409ae65ebc962e3d0d6e25203d08207a1de113 | e558cc41d59782180ac70100d0c23b3d159533a3 | refs/heads/master | 2020-09-17T08:43:56.585191 | 2019-11-25T23:08:21 | 2019-11-25T23:08:21 | 224,058,095 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,977 | java | package com.tiendarop.model.entity;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
@Entity
@Table(name = "proveedores")
public class Proveedor {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
@Column(name = "nombreProveedor", length = 60)
private String nombre;
@Column(name = "apellidoProveedor", length = 60)
private String apellido;
@Column(name = "nombreEmpresa", length = 60)
private String empresa;
@Column(name = "telefonoProveedor", length = 10)
private String telefono;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "ciudad_id")
private Ciudad ciudad;
@OneToMany(mappedBy = "proveedor", fetch = FetchType.LAZY)
private List<Producto> productos;
public Proveedor() {
productos = new ArrayList<>();
}
public void addProducto(Producto producto) {
producto.setProveedor(this);
this.productos.add(producto);
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getNombre() {
return nombre;
}
public void setNombre(String nombre) {
this.nombre = nombre;
}
public String getApellido() {
return apellido;
}
public void setApellido(String apellido) {
this.apellido = apellido;
}
public String getEmpresa() {
return empresa;
}
public void setEmpresa(String empresa) {
this.empresa = empresa;
}
public String getTelefono() {
return telefono;
}
public void setTelefono(String telefono) {
this.telefono = telefono;
}
public Ciudad getCiudad() {
return ciudad;
}
public void setCiudad(Ciudad ciudad) {
this.ciudad = ciudad;
}
}
| [
"chris.jesus1997@gmail.com"
] | chris.jesus1997@gmail.com |
ff864ea264357c9c856ee2e21e33e018f7f6e184 | 445c3cf84dd4bbcbbccf787b2d3c9eb8ed805602 | /aliyun-java-sdk-workbench-ide/src/main/java/com/aliyuncs/workbench_ide/transform/v20210121/RemoveOrgMemberResponseUnmarshaller.java | db3c0b0f78d857acb3ac989352b709b3293021f4 | [
"Apache-2.0"
] | permissive | caojiele/aliyun-openapi-java-sdk | b6367cc95469ac32249c3d9c119474bf76fe6db2 | ecc1c949681276b3eed2500ec230637b039771b8 | refs/heads/master | 2023-06-02T02:30:02.232397 | 2021-06-18T04:08:36 | 2021-06-18T04:08:36 | 172,076,930 | 0 | 0 | NOASSERTION | 2019-02-22T14:08:29 | 2019-02-22T14:08:29 | null | UTF-8 | Java | false | false | 1,349 | java | /*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.aliyuncs.workbench_ide.transform.v20210121;
import com.aliyuncs.workbench_ide.model.v20210121.RemoveOrgMemberResponse;
import java.util.Map;
import com.aliyuncs.transform.UnmarshallerContext;
public class RemoveOrgMemberResponseUnmarshaller {
public static RemoveOrgMemberResponse unmarshall(RemoveOrgMemberResponse removeOrgMemberResponse, UnmarshallerContext _ctx) {
removeOrgMemberResponse.setRequestId(_ctx.stringValue("RemoveOrgMemberResponse.RequestId"));
removeOrgMemberResponse.setCode(_ctx.stringValue("RemoveOrgMemberResponse.Code"));
removeOrgMemberResponse.setData(_ctx.mapValue("RemoveOrgMemberResponse.Data"));
removeOrgMemberResponse.setMessage(_ctx.stringValue("RemoveOrgMemberResponse.Message"));
return removeOrgMemberResponse;
}
} | [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
2b4ad716ad79252b4afe238f59ad2be0328bd5b9 | 37d96872c8743b84a7588a32b2af1747527afe77 | /src/ToyMerchantApplication/SocketServer.java | 0764033723133d29ed8100d22122d7461c0eaf91 | [] | no_license | WanjiruKagema/DistributedSystemsAssignment | 05a4c89184bbfd769410f376040c567504338bc4 | ab0ce54baee70e503f7d0f0a6c18ffd63ea91690 | refs/heads/master | 2022-12-13T04:46:09.510285 | 2020-09-10T18:42:48 | 2020-09-10T18:42:48 | 294,488,276 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,808 | 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 ds_assignment_2;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.ArrayList;
import javax.swing.SwingUtilities;
/**
*
* @author kagema
*/
public class SocketServer extends javax.swing.JFrame {
static ServerSocket serverSocket;
static Socket socket;
static DataInputStream dataInputStream;
static DataOutputStream dataOutputStream;
static ArrayList<String> serverRequests = new ArrayList<>();
static ArrayList<String> toyDetails = new ArrayList<>();
static int count;
/**
* Creates new form SocketServer
*/
public SocketServer() {
initComponents();
}
/**
* 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() {
jScrollPane1 = new javax.swing.JScrollPane();
msg_area = new javax.swing.JTextArea();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
msg_area.setColumns(20);
msg_area.setRows(5);
jScrollPane1.setViewportView(msg_area);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 405, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(25, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 244, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(20, Short.MAX_VALUE))
);
pack();
}// </editor-fold>//GEN-END:initComponents
/**
* @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(SocketServer.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(SocketServer.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(SocketServer.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(SocketServer.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 SocketServer().setVisible(true);
showMessage("Listening for client requests..........\n");
}
});
String msgin = "";
serverRequests.add("Enter the other toy information(Description, Price, Date of Manufacture, Batch Number)");
serverRequests.add("Enter the toy manufacturers details(Street Address, Zip-Code and Country)");
serverRequests.add("Send Thank You Message");
serverRequests.add("Want to send all the information at once?");
serverRequests.add("Information successfully recorded");
try{
serverSocket = new ServerSocket(3333);
socket = serverSocket.accept();
dataInputStream = new DataInputStream(socket.getInputStream());
dataOutputStream = new DataOutputStream(socket.getOutputStream());
showMessage("New Client Connected\n");
int i = 0;
while(!msgin.equals("exit") && i < serverRequests.size()){
msgin = dataInputStream.readUTF();
msg_area.setText(msg_area.getText().trim()+"\n"+msgin+"\n");
toyDetails.add(msgin);
try{
String msgout = "";
msgout = serverRequests.get(i).trim();
dataOutputStream.writeUTF(msgout);
count++;
i++;
}
catch(Exception e){}
}
String[] allDetails = toyDetails.toArray(new String[toyDetails.size()]);
String toyDetailsString = allDetails[4];
String[] tempArray = null;
String delimeter = ", ";
tempArray = toyDetailsString.split(delimeter);
String[] labels = {"Code", "Name", "Description", "Price", "Date of Manufacture", "Batch Number", "Company Name", "Street Address", "Zip Code", "Country", "Thank You Message"};
System.out.println(tempArray.length);
}
catch(Exception e){}
}
public static void showMessage(final String message){
SwingUtilities.invokeLater(
new Runnable(){
public void run(){
msg_area.append(message);
}
}
);
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JScrollPane jScrollPane1;
private static javax.swing.JTextArea msg_area;
// End of variables declaration//GEN-END:variables
}
| [
"maureenkagema@gmail.com"
] | maureenkagema@gmail.com |
0b4efc23e57fc6e892b8e1f3404ff4d3b53bbcca | 5ef0b4d230dc5243225d149efb44cdcdd2ffea9d | /trunk/tm/src/tm/clc/analysis/RuleProxy.java | 699584d9839bfb608677d02a1d0c927395923bf8 | [
"Apache-2.0"
] | permissive | kai-zhu/the-teaching-machine-and-webwriter | 3d3b3dfdecd61e0fb2146b44c42d6467489fd94f | 67adf8f41bb475108c285eb0894906cb0878849c | refs/heads/master | 2021-01-16T20:47:55.620437 | 2016-05-23T12:38:03 | 2016-05-23T12:38:12 | 61,149,759 | 1 | 0 | null | 2016-06-14T19:22:57 | 2016-06-14T19:22:57 | null | UTF-8 | Java | false | false | 2,418 | java | // Copyright 1998--2010 Michael Bruce-Lockhart and Theodore S. Norvell
//
// 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 tm.clc.analysis;
/**
* Proxy permitting lazy construction of rule sequences.
* A rule sequence for a situation deemed obscure enough can be
* wrapped in a custom <code>RuleProxy</code>. The rule sequence will not be
* built until the first time it is used.
*/
public abstract class RuleProxy extends CodeGenRule {
/** the identifier for the rule sequence used as the rulebase key */
protected String ruleId;
/** the rulebase the sequence should be added to */
protected RuleBase ruleBase;
/** will contain the rule sequence once built */
protected CodeGenRule rule;
/**
* Creates a new <code>RuleProxy</code> instance
* @param ruleId the rule identifier
* @param rb the rulebase
*/
public RuleProxy (String ruleId, RuleBase rb) {
this.ruleId = ruleId;
this.ruleBase = rb;
}
/**
* Applies the associated rule sequence. If the sequence has not yet
* been built, this method will first generate the rule sequence and
* add an entry for it in the rulebase. This will generally replace
* the entry for the proxy (if any), and so any subsequent accesses of
* the rule will directly access the rule sequence.
* <br><em>note:</em>Unfortunately,
* rulebase access occurs during rule sequence construction, and not
* (in general) rule application.
* @param exp the expression (and raw materials) against which to apply
* the rule
*/
public void apply (ExpressionPtr exp) {
if (rule == null) {
rule = buildRule ();
ruleBase.put (ruleId, rule);
}
rule.apply (exp);
}
/**
* Deriving classes build the rule sequence in this method's
* implementation
* @return the rule sequence
*/
protected abstract CodeGenRule buildRule () ;
}
| [
"theodore.norvell@gmail.com"
] | theodore.norvell@gmail.com |
71538ab29406176aff37602e2e2cef526bea8b4f | 7e1d4295b7f8543efee07e31189855ed66eb7e23 | /ch_002/src/main/java/ru/job4j/professions/Surgeon.java | 9bb76cb28372aa1090f0345faba5a4be9223dbc6 | [
"Apache-2.0"
] | permissive | KengyRoo/old_job4j | 9b84810049a56644f6767967c4df202663ec62d3 | 095ba3c2f8958ab445486ecf61ea378d34d1d971 | refs/heads/master | 2021-06-25T05:21:46.943627 | 2019-11-22T14:23:30 | 2019-11-22T14:23:30 | 142,148,269 | 0 | 0 | Apache-2.0 | 2020-10-13T04:48:55 | 2018-07-24T11:21:33 | Java | UTF-8 | Java | false | false | 234 | java | package ru.job4j.professions;
import java.util.Date;
public class Surgeon extends Doctor {
public Surgeon(String name, String surname, String education, Date birthday) {
super(name, surname, education, birthday);
}
} | [
"KengyRoo@mail.ru"
] | KengyRoo@mail.ru |
4dff753cfdb97b61b4b668c7dd6494c5c80441e9 | 731ee84dc45c41bd3b130df760783cc8f34cbacc | /src/main/java/com/jmbo/sporty/web/rest/util/HeaderUtil.java | a554623a81d956deb0499a6a6340800ae1a74800 | [] | no_license | Jmballes/AllSportyNews | 6e9c7f6f4df26ad62495cf804ed51a58bef0c2de | 18406a00e4d2c9b1629400be58b70295ed925d9b | refs/heads/master | 2020-03-19T11:23:20.723357 | 2018-07-22T20:41:24 | 2018-07-22T20:41:24 | 136,452,369 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,622 | java | package com.jmbo.sporty.web.rest.util;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpHeaders;
/**
* Utility class for HTTP headers creation.
*/
public final class HeaderUtil {
private static final Logger log = LoggerFactory.getLogger(HeaderUtil.class);
private static final String APPLICATION_NAME = "allSportyNewsApp";
private HeaderUtil() {
}
public static HttpHeaders createAlert(String message, String param) {
HttpHeaders headers = new HttpHeaders();
headers.add("X-allSportyNewsApp-alert", message);
headers.add("X-allSportyNewsApp-params", param);
return headers;
}
public static HttpHeaders createEntityCreationAlert(String entityName, String param) {
return createAlert(APPLICATION_NAME + "." + entityName + ".created", param);
}
public static HttpHeaders createEntityUpdateAlert(String entityName, String param) {
return createAlert(APPLICATION_NAME + "." + entityName + ".updated", param);
}
public static HttpHeaders createEntityDeletionAlert(String entityName, String param) {
return createAlert(APPLICATION_NAME + "." + entityName + ".deleted", param);
}
public static HttpHeaders createFailureAlert(String entityName, String errorKey, String defaultMessage) {
log.error("Entity processing failed, {}", defaultMessage);
HttpHeaders headers = new HttpHeaders();
headers.add("X-allSportyNewsApp-error", "error." + errorKey);
headers.add("X-allSportyNewsApp-params", entityName);
return headers;
}
}
| [
"juan-manuel.ballesteros@soprasteria.com"
] | juan-manuel.ballesteros@soprasteria.com |
ecb66247ba11b5cbe98ebc7091d3c94a0d2199e6 | a76e674ac06462ed0ca9f583e520c2f912a7773a | /nacos-gateway/src/main/java/com/swtte/alicloud/nacosgateway/GatewayApp.java | f625f5e553d4d6c9acc85dd35bd28f405b4224fc | [] | no_license | SwimToTheNd/alicloud | 75a6b2bea98c3c7112032183d1df4849653f9e83 | 5d13666eed049ea7abd7e623df9502820fdbc3cf | refs/heads/master | 2023-06-25T05:55:07.982871 | 2021-07-14T03:07:30 | 2021-07-14T03:07:30 | 385,844,510 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 417 | java | package com.swtte.alicloud.nacosgateway;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
@SpringBootApplication
@EnableDiscoveryClient
public class GatewayApp {
public static void main(String[] args) {
SpringApplication.run(GatewayApp.class, args);
}
}
| [
"cxh@paramland.com"
] | cxh@paramland.com |
289c0f99884427883aef7f6bca989d43f89f9fcc | 90868039ba3031eaeb47b75616573f3dc4bcd20a | /app/src/main/java/com/xinyuan/xyshop/ui/goods/detail/fragment/GoodsEvaFragment.java | 29d58ff4272c5e4e7332d265256a3dbac524a643 | [] | no_license | xiasiqiu/XinYuan | 5a6ddd67efff1a98c6920e587a23e085beec99ec | 00f863b0eff7031c83cb18d4a0d074aefd8f80ff | refs/heads/master | 2021-01-20T01:46:00.318949 | 2020-07-29T09:41:59 | 2020-07-29T09:41:59 | 89,322,724 | 4 | 1 | null | null | null | null | UTF-8 | Java | false | false | 7,252 | java | package com.xinyuan.xyshop.ui.goods.detail.fragment;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.view.View;
import android.widget.CheckBox;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.xinyuan.xyshop.R;
import com.xinyuan.xyshop.base.BaseFragment;
import com.xinyuan.xyshop.base.BasePresenter;
import com.xinyuan.xyshop.even.GoodBusEven;
import com.xinyuan.xyshop.model.GoodDetailModels;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import java.util.ArrayList;
import java.util.List;
import butterknife.BindView;
import butterknife.OnClick;
/**
* Created by fx on 2017/5/18.
* 商品评价界面
*/
public class GoodsEvaFragment extends BaseFragment<BasePresenter> {
@BindView(R.id.ll_eva_all)
LinearLayout ll_eva_all;
@BindView(R.id.ll_eva_good)
LinearLayout ll_eva_good;
@BindView(R.id.ll_eva_med)
LinearLayout ll_eva_med;
@BindView(R.id.ll_eva_bad)
LinearLayout ll_eva_bad;
@BindView(R.id.ll_eva_pic)
LinearLayout ll_eva_pic;
@BindView(R.id.tv_eva_all_num)
TextView tv_eva_all_num;
@BindView(R.id.tv_eva_good_num)
TextView tv_eva_good_num;
@BindView(R.id.tv_eva_med_num)
TextView tv_eva_med_num;
@BindView(R.id.tv_eva_bad_num)
TextView tv_eva_bad_num;
@BindView(R.id.tv_eva_pic_num)
TextView tv_eva_pic_num;
@BindView(R.id.tv_eva_all)
TextView tv_eva_all;
@BindView(R.id.tv_eva_good)
TextView tv_eva_good;
@BindView(R.id.tv_eva_med)
TextView tv_eva_med;
@BindView(R.id.tv_eva_bad)
TextView tv_eva_bad;
@BindView(R.id.tv_eva_pic)
TextView tv_eva_pic;
private static final String CURRENT_FRAGMENT = "STATE_FRAGMENT_SHOW";
@BindView(R.id.good_eva_content)
FrameLayout good_eva_content;
private int currentIndex = 0;
private List<Fragment> fragments = new ArrayList<>();
private Fragment currentFragment = new Fragment();
Bundle savedInstanceState;
private static boolean VIEW_INIT = true;
private FragmentManager fragmentManager;
private GoodCommentContentFragment commentContentFragment;
private TextView tvs[];
@Override
public void initView(View rootView) {
tv_eva_all_num.setEnabled(false);
tv_eva_all.setEnabled(false);
fragmentManager = getChildFragmentManager();
if (savedInstanceState != null) { // “内存重启”时调用
//获取“内存重启”时保存的索引下标
currentIndex = savedInstanceState.getInt(CURRENT_FRAGMENT, 0);
fragments.removeAll(fragments);
fragments.add(fragmentManager.findFragmentByTag(0 + ""));
fragments.add(fragmentManager.findFragmentByTag(1 + ""));
fragments.add(fragmentManager.findFragmentByTag(2 + ""));
fragments.add(fragmentManager.findFragmentByTag(3 + ""));
fragments.add(fragmentManager.findFragmentByTag(4 + ""));
//恢复fragment页面
restoreFragment();
} else { //正常启动时调用
fragments.add(commentContentFragment.getInstance(""));
fragments.add(commentContentFragment.getInstance("good"));
fragments.add(commentContentFragment.getInstance("normal"));
fragments.add(commentContentFragment.getInstance("low"));
fragments.add(commentContentFragment.getInstance("img"));
showFragment();
}
tvs = new TextView[]{tv_eva_all, tv_eva_all_num, tv_eva_good, tv_eva_good_num, tv_eva_med, tv_eva_med_num, tv_eva_bad, tv_eva_bad_num, tv_eva_pic, tv_eva_pic_num};
}
@Override
public void initData() {
this.savedInstanceState = savedInstanceState;
}
@Override
protected BasePresenter createPresenter() {
return null;
}
@Override
protected int provideContentViewId() {
return R.layout.fragment_good_comment;
}
@Subscribe(threadMode = ThreadMode.MAIN)
//第2步:注册一个在后台线程执行的方法,用于接收事件
public void onGoodEvent(GoodBusEven goodBusEven) {//参数必须是ClassEvent类型, 否则不会调用此方法
if (goodBusEven.getFlag().equals(GoodBusEven.GoodEvaluate)) {
GoodDetailModels.GoodEvaNum comment = (GoodDetailModels.GoodEvaNum) goodBusEven.getObj();
tv_eva_all_num.setText("" + comment.getGoodsEvaluates());
tv_eva_good_num.setText("" + comment.getGoodsEvaluatesGood());
tv_eva_med_num.setText("" + comment.getGoodsEvaluatesNormal());
tv_eva_bad_num.setText("" + comment.getGoodsEvaluatesLow());
tv_eva_pic_num.setText("" + comment.getGoodsEvaluatesImg());
}
}
@OnClick({R.id.ll_eva_all, R.id.ll_eva_good, R.id.ll_eva_med, R.id.ll_eva_bad, R.id.ll_eva_pic})
public void onClick(View view) {
switch (view.getId()) {
case R.id.ll_eva_all:
currentIndex = 0;
GoodCommentContentFragment.page = 1;
changBtnSelectedStatus(0);
break;
case R.id.ll_eva_good:
currentIndex = 1;
GoodCommentContentFragment.page = 1;
changBtnSelectedStatus(1);
break;
case R.id.ll_eva_med:
currentIndex = 2;
GoodCommentContentFragment.page = 1;
changBtnSelectedStatus(2);
break;
case R.id.ll_eva_bad:
currentIndex = 3;
GoodCommentContentFragment.page = 1;
changBtnSelectedStatus(3);
break;
case R.id.ll_eva_pic:
currentIndex = 4;
GoodCommentContentFragment.page = 1;
changBtnSelectedStatus(4);
break;
}
showFragment();
}
/**
* 使用show() hide()切换页面
* 显示fragment
*/
private void showFragment() {
FragmentTransaction transaction = fragmentManager.beginTransaction();
//如果之前没有添加过
if (!fragments.get(currentIndex).isAdded()) {
transaction
.hide(currentFragment)
.add(R.id.good_eva_content, fragments.get(currentIndex), "" + currentIndex); //第三个参数为添加当前的fragment时绑定一个tag
} else {
transaction
.hide(currentFragment)
.show(fragments.get(currentIndex));
}
currentFragment = fragments.get(currentIndex);
transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
transaction.commitAllowingStateLoss();
}
/**
* 恢复fragment
*/
private void restoreFragment() {
FragmentTransaction mBeginTreansaction = fragmentManager.beginTransaction();
for (int i = 0; i < fragments.size(); i++) {
if (i == currentIndex) {
mBeginTreansaction.show(fragments.get(i));
} else {
mBeginTreansaction.hide(fragments.get(i));
}
}
mBeginTreansaction.commit();
//把当前显示的fragment记录下来
currentFragment = fragments.get(currentIndex);
}
@Override
public void onSaveInstanceState(Bundle outState) {
//“内存重启”时保存当前的fragment名字
outState.putInt(CURRENT_FRAGMENT, currentIndex);
super.onSaveInstanceState(outState);
}
public void changBtnSelectedStatus(int position) {
int index = position * 2;
int next = index + 1;
for (int i = 0; i < 9; i++) {
if (i == index) {
tvs[i].setEnabled(false);
} else if (i == next) {
tvs[i].setEnabled(false);
} else {
tvs[i].setEnabled(true);
}
}
}
@Override
public void onStart() {
super.onStart();
EventBus.getDefault().register(this);
}
@Override
public void onStop() {
EventBus.getDefault().unregister(this);
super.onStop();
}
}
| [
"491850673@qq.com"
] | 491850673@qq.com |
1fcea1b55d332e4dea60f345da317b0ca0c3bcc7 | 1ddf18aa9a0d410d68bcb23e80cd229fbb5042c6 | /respondToYabot/src/main/java/audioCore/TrackManager.java | a63cfafe0da1c2dfe770b876f9e76319926c5d05 | [] | no_license | Maximilinator/RespondToYa-Discord-Bot | e8663dcd932e086c6fb5ebd7baf8c409922cb470 | 00e100d48f3712db7886e9702e8625e8593b2e2c | refs/heads/master | 2020-04-04T08:06:55.072084 | 2019-02-11T15:19:39 | 2019-02-11T15:19:39 | 155,241,148 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,359 | java | package audioCore;
import com.sedmelluq.discord.lavaplayer.player.AudioPlayer;
import com.sedmelluq.discord.lavaplayer.player.event.AudioEventAdapter;
import com.sedmelluq.discord.lavaplayer.track.AudioTrack;
import com.sedmelluq.discord.lavaplayer.track.AudioTrackEndReason;
import net.dv8tion.jda.core.entities.Guild;
import net.dv8tion.jda.core.entities.Member;
import net.dv8tion.jda.core.entities.VoiceChannel;
import java.util.*;
import java.util.concurrent.LinkedBlockingQueue;
/**
* Created by zekro on 18.06.2017 / 11:30 supremeBot.audioCore dev.zekro.de -
* github.zekro.de © zekro 2017
*/
public class TrackManager extends AudioEventAdapter {
private final AudioPlayer PLAYER;
private final Queue<AudioInfo> queue;
/**
* Erstellt eine Instanz der Klasse TrackManager.
*
* @param player
*/
public TrackManager(AudioPlayer player) {
this.PLAYER = player;
this.queue = new LinkedBlockingQueue<>();
}
/**
* Reiht den übergebenen Track in die Queue ein.
*
* @param track
* AudioTrack
* @param author
* Member, der den Track eingereiht hat
*/
public void queue(AudioTrack track, Member author) {
AudioInfo info = new AudioInfo(track, author);
queue.add(info);
if (PLAYER.getPlayingTrack() == null) {
PLAYER.playTrack(track);
}
}
/**
* Returnt die momentane Queue als LinkedHashSet.
*
* @return Queue
*/
public Set<AudioInfo> getQueue() {
return new LinkedHashSet<>(queue);
}
/**
* Returnt AudioInfo des Tracks aus der Queue.
*
* @param track
* AudioTrack
* @return AudioInfo
*/
public AudioInfo getInfo(AudioTrack track) {
return queue.stream().filter(info -> info.getTrack().equals(track)).findFirst().orElse(null);
}
/**
* Leert die gesammte Queue.
*/
public void purgeQueue() {
queue.clear();
}
/**
* Shufflet die momentane Queue.
*/
public void shuffleQueue() {
List<AudioInfo> cQueue = new ArrayList<>(getQueue());
AudioInfo current = cQueue.get(0);
cQueue.remove(0);
Collections.shuffle(cQueue);
cQueue.add(0, current);
purgeQueue();
queue.addAll(cQueue);
}
/**
* PLAYER EVENT: TRACK STARTET Wenn Einreiher nicht im VoiceChannel ist, wird
* der Player gestoppt. Sonst connectet der Bot in den Voice Channel des
* Einreihers.
*
* @param player
* AudioPlayer
* @param track
* AudioTrack
*/
@Override
public void onTrackStart(AudioPlayer player, AudioTrack track) {
AudioInfo info = queue.element();
VoiceChannel vChan = info.getAuthor().getVoiceState().getChannel();
if (vChan == null)
player.stopTrack();
else
info.getAuthor().getGuild().getAudioManager().openAudioConnection(vChan);
}
/**
* PLAYER EVENT: TRACK ENDE Wenn die Queue zuende ist, verlässt der Bot den
* Audio Channel. Sonst wird der nächste Track in der Queue wiedergegeben.
*
* @param player
* @param track
* @param endReason
*/
@Override
public void onTrackEnd(AudioPlayer player, AudioTrack track, AudioTrackEndReason endReason) {
Guild g = queue.poll().getAuthor().getGuild();
if (queue.isEmpty())
g.getAudioManager().closeAudioConnection();
else
player.playTrack(queue.element().getTrack());
}
} | [
"max-grossmann@hackyweb.de"
] | max-grossmann@hackyweb.de |
48feca7fd6e7eb9bdd6401032e8e5cd35f4f263f | 0df41851309c87d0e30d0c2d48231ee621fbc25f | /cloudify-widget-pool-manager/src/main/java/cloudify/widget/pool/manager/NodeManagementExecutor.java | e408241674b510c067272dff82c4ee3fb4f9c9e1 | [] | no_license | eliranmal/cloudify-widget-modules | c89648933245d7fd102eaa40895d011fb4037a36 | 5f2dd2e660456a3df54d0941dc615e25c760ef66 | refs/heads/master | 2020-12-28T23:15:41.150911 | 2014-05-12T00:06:23 | 2014-05-12T00:06:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,592 | java | package cloudify.widget.pool.manager;
import cloudify.widget.pool.manager.dto.NodeManagementModuleType;
import cloudify.widget.pool.manager.dto.PoolSettings;
import cloudify.widget.pool.manager.node_management.BaseNodeManagementModule;
import cloudify.widget.pool.manager.node_management.Constraints;
import cloudify.widget.pool.manager.node_management.DecisionsDao;
import cloudify.widget.pool.manager.node_management.NodeManagementModuleProvider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
/**
* User: eliranm
* Date: 4/27/14
* Time: 2:30 PM
*/
public class NodeManagementExecutor {
private static Logger logger = LoggerFactory.getLogger(NodeManagementExecutor.class);
private ScheduledExecutorService executorService;
private int terminationTimeoutInSeconds = 30;
private int decisionExecutionIntervalInSeconds = 60;
@Autowired
private NodeManagementModuleProvider nodeManagementModuleProvider;
@Autowired
private DecisionsDao decisionsDao;
@Autowired
private ErrorsDao errorsDao;
// TODO get rid of this - it has to be persisted somewhere
// key: poolId, value: pool execution including scheduled futures returned from starting scheduled tasks for this pool's active modules, and the runner instance
private Map<String, List<PoolExecution>> poolExecutions = new HashMap<String, List<PoolExecution>>();
public void init() {
}
public void destroy() {
executorService.shutdown();
try {
// Wait until all threads are finish
executorService.awaitTermination(terminationTimeoutInSeconds, TimeUnit.SECONDS);
} catch (InterruptedException e) {
logger.error("await termination interrupted", e);
}
}
public void start(PoolSettings poolSettings) {
// clean all undeleted decisions first, just in case
logger.debug(" cleaning all decisions of pool [{}]", poolSettings.getUuid());
decisionsDao.deleteAllOfPool(poolSettings.getUuid());
List<NodeManagementModuleType> activeModules = poolSettings.getNodeManagement().getActiveModules();
if (activeModules == null || activeModules.isEmpty()) {
return;
}
LinkedList<PoolExecution> executionList = new LinkedList<PoolExecution>();
for (NodeManagementModuleType activeModule : activeModules) {
logger.info("starting scheduled execution of node management module [{}]", activeModule);
PoolNodeManagementModuleRunner runner = new PoolNodeManagementModuleRunner(activeModule, poolSettings);
ScheduledFuture<?> scheduledFuture = executorService.scheduleAtFixedRate(
runner, 0, decisionExecutionIntervalInSeconds, TimeUnit.SECONDS);
executionList.add(new PoolExecution().setScheduled(scheduledFuture).setRunner(runner));
}
poolExecutions.put(poolSettings.getUuid(), executionList);
}
public void stop(PoolSettings poolSettings) {
String poolSettingsUuid = poolSettings.getUuid();
if (!poolExecutions.containsKey(poolSettingsUuid)) {
return;
}
List<PoolExecution> executionList = poolExecutions.get(poolSettingsUuid);
if (executionList != null && !executionList.isEmpty()) {
logger.info("stopping all scheduled executions of node management modules for pool settings [{}]", poolSettingsUuid);
for (PoolExecution execution : executionList) {
execution.getScheduled().cancel(true);
}
}
poolExecutions.remove(poolSettingsUuid);
}
public void update(PoolSettings poolSettings) {
String poolSettingsUuid = poolSettings.getUuid();
if (!poolExecutions.containsKey(poolSettingsUuid)) {
return;
}
List<PoolExecution> executionList = poolExecutions.get(poolSettingsUuid);
if (executionList != null && !executionList.isEmpty()) {
logger.info("updating pool settings in all scheduled executions of node management modules for pool settings [{}]", poolSettingsUuid);
for (PoolExecution execution : executionList) {
execution.getRunner().updatePoolSettings(poolSettings);
}
}
}
public static class PoolExecution {
// holds the execution id, to cancel it when pool settings is removed
private ScheduledFuture scheduled;
// used for updating the pool settings while the execution is running
private PoolNodeManagementModuleRunner runner;
public PoolNodeManagementModuleRunner getRunner() {
return runner;
}
public PoolExecution setRunner(PoolNodeManagementModuleRunner runner) {
this.runner = runner;
return this;
}
public ScheduledFuture getScheduled() {
return scheduled;
}
public PoolExecution setScheduled(ScheduledFuture scheduled) {
this.scheduled = scheduled;
return this;
}
}
public class PoolNodeManagementModuleRunner implements Runnable {
private Logger logger = LoggerFactory.getLogger(PoolNodeManagementModuleRunner.class);
private BaseNodeManagementModule _nodeManagementModule;
public PoolNodeManagementModuleRunner(NodeManagementModuleType type, PoolSettings poolSettings) {
_nodeManagementModule = nodeManagementModuleProvider.fromType(type)
.having(new Constraints(poolSettings));
}
public void updatePoolSettings(PoolSettings poolSettings) {
_nodeManagementModule.having(new Constraints(poolSettings));
}
@Override
public void run() {
logger.debug("running node management module [{}]", _nodeManagementModule.getClass());
_nodeManagementModule
.decide()
.execute();
}
}
public void setDecisionExecutionIntervalInSeconds(int decisionExecutionIntervalInSeconds) {
this.decisionExecutionIntervalInSeconds = decisionExecutionIntervalInSeconds;
}
public void setExecutorService(ScheduledExecutorService executorService) {
this.executorService = executorService;
}
}
| [
"eliranmal@gmail.com"
] | eliranmal@gmail.com |
8549180b6e822533e53779cb21f87f5c45594a69 | 965f57bfb499f2b6283d30b23c0643adcfe9ba61 | /src/main/java/ru/zapoebad/pwd/admin/ApplInitServlet.java | 93524f962407f8de462432b90f11d200f81088c0 | [] | no_license | HeBuDuMkA-83/people-who-do | e3a32975e90692323a5ab7f709ebc1d2565ebdb2 | 9d7bd0ed4bfe795290fa621824eebe60df827ad1 | refs/heads/master | 2020-04-09T20:08:43.155052 | 2015-03-26T21:00:22 | 2015-03-26T21:00:22 | 31,385,989 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,885 | java | package ru.zapoebad.pwd.admin;
import com.dart.webadmin.ajax.AnnotationEngine;
import org.apache.log4j.Logger;
import ru.zapoebad.pwd.managers.CrewManager;
import ru.zapoebad.pwd.managers.EventManager;
import ru.zapoebad.pwd.managers.PersonManager;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import java.io.*;
import java.sql.Connection;
import java.util.Properties;
public class ApplInitServlet extends HttpServlet {
private static Logger logger = Logger.getLogger(ApplInitServlet.class);
private static String applPath;
private static String dataPath;
private static Properties properties;
private static boolean local;
public static String getApplPath() {
return applPath;
}
public static String getDataPath() {
return dataPath;
}
public static String getSiteShotUrl() {
return properties.getProperty("site.shorturl");
}
public static Properties getProperties() {
return properties;
}
public static boolean isLocal() {
return local;
}
@Override
public void destroy() {
super.destroy();
}
@Override
public void init(ServletConfig servletConfig) throws ServletException {
try {
applPath = servletConfig.getServletContext().getRealPath("/");
if (!applPath.endsWith(File.separator))
applPath += File.separator;
logger.info("start service. ApplPath: " + applPath);
String propPath = applPath + "WEB-INF" + File.separator + servletConfig.getInitParameter("property_file_name");
logger.info("start service. loading propeties file: " + propPath);
properties = new Properties();
InputStream propsInput = new FileInputStream(propPath);
properties.load(propsInput);
propsInput.close();
logger.info("start service. properties file loaded. ");
ByteArrayOutputStream tmpOut = new ByteArrayOutputStream();
PrintStream tmpPrintStream = new PrintStream(tmpOut);
properties.list(tmpPrintStream);
logger.info(new String(tmpOut.toByteArray()));
local = properties.getProperty("app.local", "false").equalsIgnoreCase("true") ;
dataPath = getProperties().getProperty("data.path", applPath + File.separator + "data");
if (!dataPath.endsWith(File.separator)) {
dataPath += File.separator;
}
AnnotationEngine.scan("ru.zapoebad.pwd.ajax.controllers");
PersonManager.getInstance();
CrewManager.getInstance();
EventManager.getInstance();
logger.debug("service started");
} catch (Throwable tr) {
logger.error("start service ERROR", tr);
}
}
}
| [
"hebudumka@hotmail.com"
] | hebudumka@hotmail.com |
ed74061e0951166de821ccbdb204fd79dce53771 | fe53177056a28946d300e7aaac41aed0e66b52f1 | /cosc311/Assignment6/Assignment6-3/src/BinarySearchTree.java | cb44fa2ce3a76904077b2bbe3e04799d4036efeb | [] | no_license | Dumblydore/SchoolProjects | 0f73ef1508ea469613e6d9af4d7c1b0435055ce3 | 3ea73254516883c4d9e231c09eed61073d079aa9 | refs/heads/master | 2021-01-16T20:47:16.883374 | 2015-12-18T01:31:56 | 2015-12-18T01:31:56 | 23,319,374 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,046 | java | import java.io.BufferedWriter;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.nio.file.Path;
/**
* Created by medwar40 on 11/5/15.
*/
public class BinarySearchTree<T> {
private final int CAPACITY = 10000;
private int probes;
private class Node {
Node left;
Node right;
T data;
public Node(T data) {
this.data = data;
}
public Node(Node left, Node right, T data) {
this.left = left;
this.right = right;
this.data = data;
}
}
private Node root;
public BinarySearchTree() {
root = null;
probes = 0;
}
public boolean add(T item) {
if (root == null) { //if root is make the new node root
root = new Node(item);
return true;
} else {
Node current = root;
Node prev = null;
while (current != null) { //iterates until iterator is null
if (current.data.hashCode() == item.hashCode()) //returns false if data exists in tree
return false;
//iterator goes less if iterators data is greater than new item's
else if (current.data.hashCode() > item.hashCode()) {
prev = current;
current = current.left;
//otherwise it goes right
} else {
if(!current.equals(item)) { //if the values are equal then do not update the node
prev = current;
current = current.right;
}
probes++;
}
}
if (prev.data.hashCode() > item.hashCode())
prev.left = new Node(item);
else
prev.right = new Node(item);
return true;
}
}
//recursive function to print tree
public void display() {
display(root);
}
private void display(Node node) {
if (node != null) {
display(node.left);//prints left branch
System.out.println(node.data.toString()); //prints node
display(node.right);//prints right branch
}
}
//recursive function to write tree to file
public void upload(String filePath) {
try {
Path path = FileSystems.getDefault().getPath(".", filePath);
OutputStream in = Files.newOutputStream(path);
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(in));
upload(root, writer);
writer.flush();
writer.close();
System.out.println("Upload completed.");
} catch (IOException e) {
}
}
private void upload(Node node, BufferedWriter writer) throws IOException{
if (node != null) {
upload(node.left, writer); //write left branch
writer.write(node.data.toString() + '\n'); // write current node
upload(node.right, writer); //write right branch
}
}
//recursive function to get height of tree
public int height() {
return height(root);
}
private int height(Node node) {
if(node == null) {
return 0;
} else {
int leftHeight = height(node.left);
int rightHeight = height(node.right);
//returns 1 + the largest of the left and right branch's height
return 1 + (leftHeight <= rightHeight ? rightHeight : leftHeight);
}
}
//recursive function to get number of nodes
public int nodeSize() {
return nodeSize(root);
}
private int nodeSize(Node node) {
//return 0 if node is null otherwise returns branch + 1
return node == null ? 0 : 1 + (nodeSize(node.left) + nodeSize(node.right));
}
public int getProbes() {
return probes;
}
}
| [
"medwar40@emich.edu"
] | medwar40@emich.edu |
d7b6160db1536a0af52c7a24b9f01629aaa80f80 | 917c229f173164ec94fc134368e7bbc341ff8d8d | /ZDesk/src/com/zinglabs/apps/chatWorkflow/action/WorkflowSearchAction.java | 578f7976ef860f9eecc0f5c626b5369f26997d00 | [] | no_license | JunHeGitHub/ITest | ef16283f54754bee766b963f2b9e1c0adf124a7c | d7d866a5033040a051284c3db8cfe2f744065312 | refs/heads/master | 2021-01-09T06:44:39.659251 | 2017-02-15T09:46:10 | 2017-02-15T09:46:10 | 81,161,881 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,093 | java | package com.zinglabs.apps.chatWorkflow.action;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import com.zinglabs.apps.chatWorkflow.WorkflowSearchService;
import com.zinglabs.base.core.frame.BaseAction;
import com.zinglabs.util.JsonUtils;
@Controller
@RequestMapping("/*/WorkflowSearch")
public class WorkflowSearchAction extends BaseAction {
public static Logger logger = LoggerFactory.getLogger("ZDesk");
@RequestMapping(value="/MyWorkflowSearch")
public void MyWorkflowSearch(@RequestParam HashMap map, HttpServletRequest request, HttpServletResponse response){
WorkflowSearchService ws=new WorkflowSearchService();
Map m=ws.MyWorkSearch(map, request);
postStrToClient(JsonUtils.genUpdateDataReturnJsonStr(true, "",m), response);
}
}
| [
"1046868763@qq.com"
] | 1046868763@qq.com |
d624e513d92b8e94b3bc16e1993486da5d8c0db8 | c1d3a662d46d42f324cb5597d7a7319bb446dd24 | /src/admissionsystem/CutOffPanel.java | 90ed94b004d7deee6ea07431f1c92a6ca0dc794d | [] | no_license | ChigboIO/AdmissionSystem | a4ede3b38189d617ef77deade5bef1f17e5a975a | d281cd0a177b7b05142ac3d2e48175e5b5e2506a | refs/heads/master | 2021-05-28T07:35:04.430274 | 2014-12-29T07:33:27 | 2014-12-29T07:33:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,452 | 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 admissionsystem;
import java.awt.BorderLayout;
import java.awt.GridLayout;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.border.EmptyBorder;
/**
*
* @author SCIENCE
*/
public class CutOffPanel extends JPanel {
String dept;
JPanel centerPanel, southPanel;
JTextField utmeCutOff, putmeCutOff;
JButton save, close;
Statement statement;
ResultSet result;
public CutOffPanel(String dept){
this.dept = dept;
setLayout(new BorderLayout());
try{
statement = Connect.connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
} catch(SQLException ex){
JOptionPane.showMessageDialog(null, "SQL error occoured");
}
centerPanel = new JPanel();
southPanel = new JPanel();
utmeCutOff = new JTextField(5);
putmeCutOff = new JTextField(5);
save = new JButton("Save Cutoff Marks");
close = new JButton("Close");
centerPanel.setLayout(new GridLayout(2,2,5,5));
centerPanel.add(new JLabel("UTME Cutoff Mark : "));
centerPanel.add(utmeCutOff);
centerPanel.add(new JLabel("Average of UTME and PUTME : "));
centerPanel.add(putmeCutOff);
centerPanel.setBorder(new EmptyBorder(50,100,350,100));
save.addActionListener(UGMain.eventhandler);
close.addActionListener(UGMain.eventhandler);
southPanel.setLayout(new BorderLayout());
southPanel.add(close, BorderLayout.WEST);
southPanel.add(save, BorderLayout.EAST);
add(centerPanel, BorderLayout.CENTER);
add(southPanel, BorderLayout.SOUTH);
initValues();
}
private void initValues(){
try{
result = statement.executeQuery("SELECT utme_cut_off, putme_cut_off FROM departments WHERE departmentName = '"+ dept +"'");
if(result.first()){
utmeCutOff.setText(String.valueOf(result.getInt("utme_cut_off")));
putmeCutOff.setText(String.valueOf(result.getInt("putme_cut_off")));
}
}catch(SQLException ex){
JOptionPane.showMessageDialog(null, "SQL error occoured");
}
}
public void doSave(){
int utme;
int putme;
try{
utme = Math.abs(Integer.valueOf(utmeCutOff.getText()));
putme = Math.abs(Integer.valueOf(putmeCutOff.getText()));
} catch(NumberFormatException ex){
utme = 0;
putme = 0;
}
try{
statement.execute("UPDATE departments SET utme_cut_off = "+ utme +" WHERE departmentName = '"+ dept +"'");
statement.execute("UPDATE departments SET putme_cut_off = "+ putme +" WHERE departmentName = '"+ dept +"'");
JOptionPane.showMessageDialog(null, "CutOff Marks saved!!!");
} catch(SQLException ex){
JOptionPane.showMessageDialog(null, "SQL error occoured");
}
}
}
| [
"chigboemmanuel@gmail.com"
] | chigboemmanuel@gmail.com |
a8e96807d31599449083408e11a6690243de4efe | 3e20a358fb2ca39e84cf800b0f821f7898cc1e6a | /task15/UsingCPrintLog/app/src/test/java/com/jikexueyuan/usingcprintlog/ExampleUnitTest.java | 480a8c173e0d17be05aba9e5912d06607ebdf53f | [] | no_license | dej-software/Android-Practice | 3f430a8cef9f7e28bba903d5f1a035780ac8f26b | 3ab4cd57f06b3866c5aeb41271e51fd326aef386 | refs/heads/master | 2021-01-12T09:08:16.199771 | 2016-12-18T06:56:33 | 2016-12-18T06:56:33 | 76,772,019 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 408 | java | package com.jikexueyuan.usingcprintlog;
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);
}
} | [
"dej1314@163.com"
] | dej1314@163.com |
56a2537db3e70daeb748252de99f829443568f1e | 2bc2eadc9b0f70d6d1286ef474902466988a880f | /branches/multi-tx/transports/jms/src/main/java/org/mule/transport/jms/JmsConstants.java | 62f6f568bc5c0b15d4a1c12ea2162e022c2563e2 | [] | no_license | OrgSmells/codehaus-mule-git | 085434a4b7781a5def2b9b4e37396081eaeba394 | f8584627c7acb13efdf3276396015439ea6a0721 | refs/heads/master | 2022-12-24T07:33:30.190368 | 2020-02-27T19:10:29 | 2020-02-27T19:10:29 | 243,593,543 | 0 | 0 | null | 2022-12-15T23:30:00 | 2020-02-27T18:56:48 | null | UTF-8 | Java | false | false | 2,403 | java | /*
* $Id$
* --------------------------------------------------------------------------------------
* Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
*
* The software in this package is published under the terms of the CPAL v1.0
* license, a copy of which has been included with this distribution in the
* LICENSE.txt file.
*/
package org.mule.transport.jms;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
// @ThreadSafe
public class JmsConstants
{
public static final String JMS_SPECIFICATION_102B = "1.0.2b";
public static final String JMS_SPECIFICATION_11 = "1.1";
public static final String JMS_CORRELATION_ID = "JMSCorrelationID";
public static final String JMS_DELIVERY_MODE = "JMSDeliveryMode";
public static final String JMS_DESTINATION = "JMSDestination";
public static final String JMS_EXPIRATION = "JMSExpiration";
public static final String JMS_MESSAGE_ID = "JMSMessageID";
public static final String JMS_PRIORITY = "JMSPriority";
public static final String JMS_REDELIVERED = "JMSRedelivered";
public static final String JMS_REPLY_TO = "JMSReplyTo";
public static final String JMS_TIMESTAMP = "JMSTimestamp";
public static final String JMS_TYPE = "JMSType";
// QoS properties
public static final String TIME_TO_LIVE_PROPERTY = "timeToLive";
public static final String PERSISTENT_DELIVERY_PROPERTY = "persistentDelivery";
public static final String PRIORITY_PROPERTY = "priority";
public static final String JMS_SELECTOR_PROPERTY = "selector";
public static final String TOPIC_PROPERTY = "topic";
public static final String DURABLE_PROPERTY = "durable";
public static final String DURABLE_NAME_PROPERTY = "durableName";
public static final String CACHE_JMS_SESSIONS_PROPERTY = "cacheJmsSessions";
public static final String DISABLE_TEMP_DESTINATIONS_PROPERTY = "disableTemporaryReplyToDestinations";
public static final Set JMS_PROPERTY_NAMES = Collections.unmodifiableSet(new HashSet(
Arrays.asList(new String[]{JMS_SPECIFICATION_102B, JMS_SPECIFICATION_11, JMS_CORRELATION_ID,
JMS_DELIVERY_MODE, JMS_DELIVERY_MODE, JMS_DESTINATION, JMS_EXPIRATION, JMS_MESSAGE_ID,
JMS_PRIORITY, JMS_REDELIVERED, JMS_REPLY_TO, JMS_TIMESTAMP, JMS_TYPE, JMS_SELECTOR_PROPERTY})));
}
| [
"aperepel@bf997673-6b11-0410-b953-e057580c5b09"
] | aperepel@bf997673-6b11-0410-b953-e057580c5b09 |
64e4b28811bf760cc73fcef0942d4f81ecf7c613 | 0b4d8b0330797fd72f0708411d0f841a4fa6ec6c | /src/test/java/treasures/GoldTest.java | 266e9479ec80012007ebf8b812b9d009f43cf1b2 | [] | no_license | tannyque/Week12-Day04-Fantasy-Game | 4ae6f773fefea54420edbdb5c07668ee64a6ce62 | af8c8189a903ae248d8db674b25ebf0cb033fa23 | refs/heads/master | 2020-03-30T20:23:43.448718 | 2018-10-04T14:34:12 | 2018-10-04T14:34:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 367 | java | package treasures;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
public class GoldTest {
Gold gold;
@Before
public void setUp() {
gold = new Gold(TreasureType.GOLD);
}
@Test
public void canGetTreasureType() {
assertEquals(TreasureType.GOLD, gold.getTreasureType());
}
}
| [
"kmbruce1986@gmail.com"
] | kmbruce1986@gmail.com |
8733e1980da9c6c3fd75cfe1c1675a6ae835c9f1 | c2bf5b82f209f41746d3b56b593db4a457e8bbd3 | /src/main/java/br/com/travelmate/model/Videopasta4_.java | 32e3a954bd7f727a4cb1eb8415188cc2b61ea536 | [] | no_license | julioizidoro/systm-com | 93d008f4d291bc2e1eda33ec32abdbc537388795 | ecf99caebbf59adc2bda33c7a3925794f796980d | refs/heads/master | 2020-03-27T10:52:17.319659 | 2018-08-29T19:59:32 | 2018-08-29T19:59:32 | 146,450,606 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 700 | java | package br.com.travelmate.model;
import javax.annotation.Generated;
import javax.persistence.metamodel.SingularAttribute;
import javax.persistence.metamodel.StaticMetamodel;
@Generated(value="Dali", date="2018-03-01T21:10:40.304-0300")
@StaticMetamodel(Videopasta4.class)
public class Videopasta4_ {
public static volatile SingularAttribute<Videopasta4, Integer> idvideopasta4;
public static volatile SingularAttribute<Videopasta4, String> descricao;
public static volatile SingularAttribute<Videopasta4, Videopasta2> videopasta2;
public static volatile SingularAttribute<Videopasta4, Videopasta1> videopasta1;
public static volatile SingularAttribute<Videopasta4, Videopasta3> videopasta3;
}
| [
"julioizidoro@192.168.100.17"
] | julioizidoro@192.168.100.17 |
962f22bc46126b1192d66bcafeb6d46071aa7c45 | 8496c9bae8b41106f8a8f80af2c2d990297eefad | /DisasterRelief/android/app/src/main/java/com/disasterrelief/MainActivity.java | 0008b576a62702ccbe009acd88b230677c085142 | [] | no_license | raquelclare/disaster-relief-app | 776cf064c6dfa4f8c78c6b7e81af8f434c308bb3 | 28582a4a9ca71aef8a7bb17406f2dbbe526cfc4a | refs/heads/master | 2021-07-07T21:00:54.161527 | 2017-10-04T23:02:53 | 2017-10-04T23:02:53 | 103,192,337 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 373 | java | package com.disasterrelief;
import com.facebook.react.ReactActivity;
public class MainActivity extends ReactActivity {
/**
* Returns the name of the main component registered from JavaScript.
* This is used to schedule rendering of the component.
*/
@Override
protected String getMainComponentName() {
return "DisasterRelief";
}
}
| [
"raquelclare@Raquels-MacBook-Air.local"
] | raquelclare@Raquels-MacBook-Air.local |
9492fd06002d849f703c5b997ac411ede4ff1b77 | a22182f2bcbb0eb14b3f0f8d642d95bca0586280 | /src/br/com/simpleblog/model/Post.java | 986fc6009281089642f68facc44cff72df7d931a | [] | no_license | cesar-andre/projeto-final-modulo-java | 6206cc2d32b898b23ca591c0236276fc42670c8a | 2f2f0af0191978c572079c9b5834e33b72da2e4f | refs/heads/master | 2021-01-01T19:59:11.760248 | 2017-08-05T04:13:06 | 2017-08-05T04:13:06 | 98,739,408 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,880 | java | package br.com.simpleblog.model;
import java.io.ByteArrayInputStream;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.primefaces.model.DefaultStreamedContent;
@Entity
public class Post {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
private Integer id;
@ManyToOne
@JoinColumn(name="categoria_id")
private Categoria categoria;
@ManyToOne
@JoinColumn(name="usuario_id")
private Usuario autor;
private String titulo;
@Column(columnDefinition="TEXT")
private String conteudo;
@Temporal(TemporalType.DATE)
private Date data;
@Lob
@Column(length=400000)
private byte[] imagem;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Categoria getCategoria() {
return categoria;
}
public void setCategoria(Categoria categoria) {
this.categoria = categoria;
}
public Usuario getAutor() {
return autor;
}
public void setAutor(Usuario autor) {
this.autor = autor;
}
public String getTitulo() {
return titulo;
}
public void setTitulo(String titulo) {
this.titulo = titulo;
}
public String getConteudo() {
return conteudo;
}
public void setConteudo(String conteudo) {
this.conteudo = conteudo;
}
public Date getData() {
return data;
}
public void setData(Date data) {
this.data = data;
}
public byte[] getImagem() {
return imagem;
}
public void setImagem(byte[] imagem) {
this.imagem = imagem;
}
}
| [
"cdepaula@csc.com"
] | cdepaula@csc.com |
99e215f294758a4400ce59156b9ccaea791aa7ee | 7672d388edc6eaaba1d6af582c2a3170526c9c95 | /src/main/java/capter03/c1/impl/beverage/Decaf.java | fed0d3ec433aa3f0054a3606642acc9928094b6c | [] | no_license | kkoobee/HeadFirstDesignPartten | 1466830f67a915d2d53db2c9ce909dab3686b0b3 | 0386039cc73cd8e48020795bf6e907bf77146310 | refs/heads/master | 2023-02-11T12:15:04.078802 | 2020-04-02T07:59:47 | 2020-04-02T07:59:47 | 324,954,920 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 214 | java | package capter03.c1.impl.beverage;
import capter03.c1.component.Beverage;
public class Decaf extends Beverage{
public Decaf() {
description = "Decaf";
}
@Override
public double cost() {
return 0.78;
}
}
| [
"Xu1993082700"
] | Xu1993082700 |
c4de54a3ebc84288f0460ac55674345cd08518ce | 88626a21705aafeea2a57e45c12bb9d052f4a670 | /src/main/java/com/example/enrollment/model/CoursesEntity.java | 1c19fc7f376c0fcfa90855f8455413de728d4e35 | [] | no_license | edy477/studentsREST | a1a3e73ab9d2e90ef1a1a3d6a727930c228737bc | f9f1f8913f43f306ed10519badb41b7809823d09 | refs/heads/master | 2023-06-02T04:56:56.988061 | 2021-06-20T06:17:25 | 2021-06-20T06:17:25 | 378,570,060 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 996 | java | package com.example.enrollment.model;
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.Type;
import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Collection;
import java.util.UUID;
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name = "courses", schema = "enrolled", catalog = "enrollment")
@JsonIdentityInfo(generator= ObjectIdGenerators.PropertyGenerator.class, property="courseId")
public class CoursesEntity implements Serializable {
private String courseName;
private String created;
private String category;
@Id
@Column(name = "course_id", nullable = false)
@Type(type="org.hibernate.type.PostgresUUIDType")
private UUID courseId;
private Timestamp startDate;
}
| [
"edy47@mesoamericana.edu.gt"
] | edy47@mesoamericana.edu.gt |
1e1e16b36b3397ea5442672e89a5879afd5d97bc | 50eb47577b4b5cff82c3221692024501a8d5300f | /src/codility/BinaryGap.java | 2f504ed60011db9be738af30b6138232a043b1d0 | [] | no_license | Kubalka/codility | 8e8f74daa7eb7b45c2fb40b70be7e03cbe0fc919 | a9b61a20acaa9c1a3c336ac01fc5392e720f5a2a | refs/heads/master | 2021-01-18T22:20:12.388263 | 2016-05-31T08:57:05 | 2016-05-31T08:57:05 | 55,182,501 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,668 | java | package codility;
/*
* Maximum binary gap = how many 0 is between
* two 1 in the binary form of the number.
* For instance, for number 20 is binary form 10100,
* binary gap is 1, because there is no 1 after last two 0.
* Find the maximum binary gap.
*/
public class BinaryGap {
public static int solution(int N) {
int numZero = -1;
// number of 0 in binary form of N, starting value is -1, after first
// found 1, the value is changed to 0 and continues counting if
// relevant.
int bitValue = 0;
// value of examined bit (0 or 1)
int max = 0;
// max number of 0 in binary gap
while (N > 0) {
// while there is the right shift of bits, the value of N is
// decreasing, cycle is running until N is 0
bitValue = N & 1;
// Bitwise AND (or multiplication). If 1 is on current bit in binary
// form on N, returns 1 to bitValue, otherwise returns 0.In next
// step, there is the right shift and we are going to test next bit.
N = N >> 1;
// right shift to next bit of N. Caution: Right shift causes, that
// the bits are taken from right to left.
if (bitValue == 0 && numZero >= 0) {
// the condition numZero >= 0 tells us, that there was 1 in the
// beginning of counting. If not, numZero stay the same, because
// otherwise there is no gap.
numZero++;
}
if (bitValue == 1) {
max = numZero > max ? numZero : max;
// if there are more gaps, return number of 0 of the bigger one
// to max.
numZero = 0;
// after findig bit with value 1, resets the numZero to 0.
}
}
return max;
}
public static void main(String[] args) {
System.out.println(solution(20));
}
}
| [
"m.svecena@gmail.com"
] | m.svecena@gmail.com |
eafa81c53c61b52d1b78be8c2b756571e55534dc | 35240e8ee5bed10082a487eaefd17d786117ebe8 | /025_Spring-Annotation-@Component-@ComponentScan/src/main/java/com/mustafazorbaz/Main.java | d8f8c3823540780bb77d5ed85892f4b584d4893e | [] | no_license | mustafazorbaz/SpringFramework | ccd01daee94788315fe09d0a489b2711824589f2 | 46360e64289ba65a2aa6cc287a9a523f67e8dc1c | refs/heads/master | 2021-01-10T23:15:42.584289 | 2016-10-11T19:01:23 | 2016-10-11T19:01:23 | 70,625,778 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 892 | java | package com.mustafazorbaz;
import java.text.Annotation;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class Main {
public static void main(String[] args) {
ApplicationContext context=new ClassPathXmlApplicationContext("spring-bean-configuration.xml");
Batarya batarya=context.getBean("bataryaBeanComponent",Batarya.class);
batarya.setVolt("3.5");
batarya.setWh("4.5");
Telefon telefon=context.getBean("telefonBeanComponent",Telefon.class);
telefon.setMarka("Vestel");
telefon.setModel("Venus");
telefon.setBatarya(batarya);
System.out.println(telefon);
((AbstractApplicationContext) context).close();
}
}
| [
"mustafazorbaz@hotmail.com"
] | mustafazorbaz@hotmail.com |
5fd45cc4f016115f5ce4924302b9f66873c7871f | 8c00ffbe41f0a1ed89ec63da4e4a75f39fe2ae49 | /CoverUtils/src/com/cover/utils/CFProxyUtil.java | dc3ab9eae633eaf9300d4676a196b9486087cfd9 | [] | no_license | coverfate/Java | a821f168bbd52abf980b2619ede0317945baee45 | e4352b094b806a38da43442c39304e93b04c05a7 | refs/heads/master | 2021-05-16T02:55:29.776400 | 2017-03-17T08:13:58 | 2017-03-17T08:13:58 | 22,402,739 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,265 | java | /**
*
* @Title: CoverProxyUtil.java
* @Prject: HcDBCrawlNew
* @Package: com.cover.utils
* @Description: TODO
* @author: chenchao
* @date: 2016年6月23日 下午1:25:18
* @version: V1.0
*/
package com.cover.utils;
import java.net.InetSocketAddress;
import java.net.Proxy;
import org.apache.log4j.Logger;
/**
* @ClassName: CoverProxyUtil
* @Description: TODO
* @author: chenchao
* @date: 2016年6月23日 下午1:25:18
*/
public class CFProxyUtil {
private static Logger logger = Logger.getLogger(CFProxyUtil.class);
public static boolean checkProxyUsable(String ip, int port) {
try {
boolean flag = false;
String url = "http://1212.ip138.com/ic.asp";
InetSocketAddress addr = null;
addr = new InetSocketAddress(ip, port);
Proxy proxy = new Proxy(Proxy.Type.HTTP, addr);
String jsonData = CFHttpUtil.getJsonString(url, proxy);
int l = jsonData.indexOf("[");
int r = jsonData.indexOf("]");
if (l > 0 && r > l) {
jsonData = jsonData.substring(l + 1, r);
if (jsonData.equals(ip))
flag = true;
}
logger.info(jsonData);
return flag;
} catch (Exception e) {
}
return false;
}
public static void main(String[] args) {
logger.info(checkProxyUsable("101.226.249.237", 80));
}
}
| [
"coverfate@gmail.com"
] | coverfate@gmail.com |
3d60928f827dd0ab46568c28eb4ee0c827be09c5 | 4dbec1e3ecc04d05f1020a615b7446b65f4458e6 | /app/src/main/java/com/ecjtu/whack_a_mole/activity/MainActivity.java | a28988d830586bbdab6b1575042b3c20c699bbf5 | [] | no_license | 755586/Whack-A-Mole | 7f0b6da5007a1059cef9c2937422467272ab5bdb | 02d445162f531a16fb053c32f694a1f224918a33 | refs/heads/master | 2020-06-15T11:55:12.868181 | 2017-05-16T01:16:26 | 2017-05-16T01:16:26 | 75,296,453 | 4 | 1 | null | null | null | null | UTF-8 | Java | false | false | 10,648 | java | package com.ecjtu.whack_a_mole.activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.Pair;
import android.view.View;
import android.widget.TextView;
import com.ecjtu.whack_a_mole.util.DialogUtils;
import com.ecjtu.whack_a_mole.util.GameWord;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.xutils.common.Callback;
import org.xutils.http.RequestParams;
import org.xutils.view.annotation.ContentView;
import org.xutils.view.annotation.Event;
import org.xutils.view.annotation.ViewInject;
import org.xutils.x;
import java.util.*;
@ContentView(R.layout.activity_main)
public class MainActivity extends BaseActivity {
private List<String> nameList = GameWord.getInstance().getAllTypeName();
private Map<String,Integer> allTypeMap = GameWord.getInstance().getAllType();
private int chooseMenuItem;
@ViewInject(R.id.tv_main_title)
private TextView tv_main_title;
@Event({R.id.btn_main_begin,R.id.btn_max_scope,R.id.btn_main_exit})
private void onClick(View v){
switch (v.getId()){
case R.id.btn_main_begin:{
// startActivity(new Intent(MainActivity.this,GameActivity.class));
getAllType();
break;
}
case R.id.btn_max_scope:{
startActivity(new Intent(MainActivity.this,MaxScopeActivity.class));
break;
}
case R.id.btn_main_exit:{
removeALLActivity();
break;
}
}
}
private Handler handler = new Handler(){
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case 0x123:{//succuss
int temp = msg.arg1;
if(temp==0){
showMenuDialog();
}else{
String err = msg.obj.toString();
toast(msg.obj.toString());
System.out.println(err);
}
break;
}
}
super.handleMessage(msg);
}
};
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
x.view().inject(this);
initView();
}
private void initView() {
tv_main_title.setText("趣味英语打地鼠");
}
private void showMenuDialog() {
chooseMenuItem = 0;
final String[] items = new String[nameList.size()];
for(int i=0;i<nameList.size();i++){
items[i] = nameList.get(i);
}
if(items.length>0){
AlertDialog.Builder singleChoiceDialog =
new AlertDialog.Builder(MainActivity.this);
singleChoiceDialog.setTitle("请选择游戏模式");
singleChoiceDialog.setSingleChoiceItems(items, 0,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
chooseMenuItem = which;
}
});
singleChoiceDialog.setPositiveButton("确定",
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
if (chooseMenuItem == -1) {
toast("请选择模式");
}else{
int type = allTypeMap.get(nameList.get(chooseMenuItem));
getWordByType(type);
}
}
});
singleChoiceDialog.show();
}else{
toast("系统维护中...");
}
}
//根据所选类型查询词汇信息
private void getWordByType(int type) {
//定义一个变量用于存储返回结果的解析数据,并尝试通过工程类获取结果
List<Pair<String, String>> wordList = GameWord.getInstance().getWordListMap().get(chooseMenuItem);
//当前已存在数据,无须解析
if(wordList!=null){
System.out.println("存在词汇信息");
if(wordList.size()>=9){
System.out.println("加载词汇数据成功,正在进入游戏...");
GameWord.getInstance().setChoose(chooseMenuItem);
startActivity(new Intent(MainActivity.this,GameActivity.class));
}else{
toast("当前无法进入该模式");
}
}else{
System.out.println("不存在词汇信息");
DialogUtils.showWaitingDialog(MainActivity.this,"数据加载中");//弹出遮罩效果,提示正在加载数据
//根据词汇类型type查询词汇数据的接口地址
String url = "http://139.199.210.125:8097/mole/system/word?action=getListByType&type="+type;
RequestParams params = new RequestParams(url);
x.http().post(params, new Callback.CommonCallback<JSONObject>() {
@Override
public void onSuccess(JSONObject result) {//请求成功,并获取返回值
//System.out.println(result.toString());
//toast(result.toString());
loadGame(result);//解析返回值
}
@Override
public void onError(Throwable ex, boolean isOnCallback) {//请求发生错误
toast("加载数据出错");
}
@Override
public void onCancelled(CancelledException cex) {//取消请求回调方法
}
@Override
public void onFinished() {//请求结束返回方法
DialogUtils.hideWaitingDialog();//隐藏数据加载遮罩框
}
});
}
}
//请求结果返回值解析,并进入下一步游戏界面
private void loadGame(JSONObject result) {
//定义一个变量用于存储返回结果的解析数据,并尝试通过工程类获取结果
List<Pair<String, String>> wordList = GameWord.getInstance().getWordListMap().get(chooseMenuItem);
wordList = new ArrayList<>();
try {
JSONArray rows = (JSONArray) result.get("rows");//根据key值获取词汇数据
for(int i=0;i<rows.length();i++){//将获取到的json数据进行解析成数组数据并保存
JSONObject word_obj = rows.getJSONObject(i);
String chinese = word_obj.get("chinese").toString();
String english = word_obj.get("english").toString();
Pair<String,String> word = new Pair<>(english,chinese);
wordList.add(word);
}
GameWord.getInstance().getWordListMap().put(chooseMenuItem,wordList);
if(wordList.size()>=9){
System.out.println("加载词汇数据成功,正在进入游戏...");
GameWord.getInstance().setChoose(chooseMenuItem);
startActivity(new Intent(MainActivity.this,GameActivity.class));
}else{
toast("当前无法进入该模式");
}
} catch (JSONException e) {
e.printStackTrace();
toast("加载数据出现异常");
}
}
private void getAllType() {
if(nameList!=null&&allTypeMap!=null){
System.out.println("===存在数据===");
// System.out.println(nameList.toString());
// System.out.println(allTypeMap.toString());
Message msg = Message.obtain();
msg.what=0x123;
msg.arg1=0;
msg.obj="获取数据成功";
handler.sendMessage(msg);
return;
}else{
System.out.println("===不存在数据===");
}
final Message msg = Message.obtain();
msg.what=0x123;
msg.arg1=1;
msg.obj="获取菜单数据中...";
DialogUtils.showWaitingDialog(MainActivity.this,"正在加载菜单...");
String url = "http://139.199.210.125:8097/mole/system/wordType?action=getAllType";
RequestParams params = new RequestParams(url);
x.http().post(params, new Callback.CommonCallback<JSONObject>() {
@Override
public void onSuccess(JSONObject result) {
try {
JSONArray allType = (JSONArray) result.get("allType");
nameList = new ArrayList<String>();
allTypeMap = new HashMap<String, Integer>();
for(int i=0;i<allType.length();i++){
JSONObject type = (JSONObject) allType.get(i);
Integer id = (Integer) type.get("id");
String type_name = (String) type.get("type_name");
nameList.add(type_name)
; allTypeMap.put(type_name,id);
}
GameWord.getInstance().setAllTypeName(nameList);
GameWord.getInstance().setAllType(allTypeMap);
// System.out.println(GameWord.getInstance().getAllTypeName().toString());
// System.out.println(GameWord.getInstance().getAllType().toString());
msg.arg1=0;
msg.obj="菜单加载成功";
} catch (JSONException e) {
e.printStackTrace();
//toast("菜单加载出现异常");
msg.arg1=1;
msg.obj="菜单加载出现异常";
}
}
@Override
public void onError(Throwable ex, boolean isOnCallback) {
//toast("菜单加载出错");
msg.arg1=1;
msg.obj="菜单加载出错";
}
@Override
public void onCancelled(CancelledException cex) {
//toast("菜单加载已取消");
msg.arg1=1;
msg.obj="菜单加载已取消";
}
@Override
public void onFinished() {
handler.sendMessage(msg);
DialogUtils.hideWaitingDialog();
}
});
}
}
| [
"755545586@qq.com"
] | 755545586@qq.com |
dfd4ce271da3bfa12113c130b8fe137bfd2655a0 | e7bf01082d34560c999af134320438d1f382c80f | /viikko6/Laskin/src/ohtu/Nollaa.java | 9d68d4b5a3cd5265338a96c62962c45c9e6cd194 | [] | no_license | sasumaki/ohtu2016 | f8d2375be05f407c1f9b9e8c14b9e9a7b6fb04fb | cf5169f8632fb2828394651a9fa8eb8b88f36693 | refs/heads/master | 2021-01-17T08:23:15.444961 | 2016-05-09T14:25:37 | 2016-05-09T14:25:37 | 54,116,388 | 0 | 0 | null | 2016-03-17T12:34:19 | 2016-03-17T12:34:19 | null | UTF-8 | Java | false | false | 1,098 | 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 ohtu;
import javax.swing.JTextField;
/**
*
* @author sasumaki
*/
class Nollaa implements Komento {
private Sovelluslogiikka sovellus;
private JTextField tuloskentta;
private JTextField syotekentta;
private int edellinen;
public Nollaa(Sovelluslogiikka sovellus, JTextField tuloskentta, JTextField syotekentta) {
this.sovellus = sovellus;
this.tuloskentta = tuloskentta;
this.syotekentta = syotekentta;
this.edellinen = 0;
}
@Override
public void suorita() {
edellinen = Integer.parseInt(tuloskentta.getText());
sovellus.nollaa();
syotekentta.setText("");
tuloskentta.setText("" + sovellus.tulos());
}
@Override
public void peru() {
sovellus.nollaa();
sovellus.plus(edellinen);
syotekentta.setText("");
tuloskentta.setText("" + sovellus.tulos());
}
}
| [
"sasu.makinen@helsinki.fi"
] | sasu.makinen@helsinki.fi |
24b28858b39c57263680f57c431747294ec882d5 | 20e4994a2ae22cba09d1d40bf535316f3a631994 | /core/src/main/java/zm/gov/moh/core/repository/database/dao/domain/OrderTypeClassMapDao.java | c3ab741d7618021cdd6fbad9dd45bea179eddf84 | [] | no_license | BlueCodeSystems/smartcerv | c7690918c55f9836f31e980c76f343b1f7a155c0 | 747b4f570eb82ecc69051c61dc07a0dfcb6ebbfa | refs/heads/master | 2021-06-21T10:27:54.936694 | 2020-02-13T10:20:34 | 2020-02-13T10:20:34 | 154,180,362 | 7 | 2 | null | 2020-12-18T12:33:09 | 2018-10-22T16:48:00 | Java | UTF-8 | Java | false | false | 273 | java | package zm.gov.moh.core.repository.database.dao.domain;
import androidx.room.*;
import zm.gov.moh.core.repository.database.entity.domain.OrderTypeClassMap;
@Dao
public interface OrderTypeClassMapDao {
@Insert
void insert(OrderTypeClassMap orderTypeClassMap);
}
| [
"kkabwe@bluecodeltd.com"
] | kkabwe@bluecodeltd.com |
83b32fb3e02459bfcf0e50b9cce1a28bb1825980 | be25edd3e17275011fd2ac3c949edcb01628e002 | /src/day16_String/CheckWords.java | 63e3defec7ab4e941e71d7595eb2917796d5fdd0 | [] | no_license | hankfetic/summer2020_b20 | 1126df200b08f229b2b413c1d6e8ac6d9277426a | c7434a1cdcdc7ab84dcb3845de72e5224c8069eb | refs/heads/master | 2022-11-25T04:39:33.163010 | 2020-08-03T16:26:28 | 2020-08-03T16:26:28 | 284,333,782 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 785 | java | package day16_String;
import java.util.Scanner;
public class CheckWords {
public static void main(String[] args) {
String str = "ABC";
//Scanner scan = new Scanner(System.in);
if(str.length() ==0){
System.out.println("empty string"); //last index number = length -1
// for example, "V" would be last index -1
}else if(str.length() > 3){
System.out.println( str.substring( str.length() -3));
} else {
System.out.println(str);
}
System.out.println("============");
String s1 = "I like to watch game of thrones, and walking dead";
s1 = s1.replace(", and walking dead" , "");
System.out.println(s1);
}
}
| [
"hankfetic@gmail.com"
] | hankfetic@gmail.com |
60527b3914471736c6ca18687e7092c30c478be9 | b67ebace5d76d36324f04fc7c4ec4a3b9faa161e | /onlinemedicalstore/src/main/java/com/capgemini/OnlineMedicalStore/dao/ProductDaoImpl.java | f93b1197e3309e1ebfca85b5b23ad07444dc6ef9 | [] | no_license | NarendraMaganti/demo | 11d8d5453a9ed595e59af9444d907ad9e1810434 | 3a0eb163cf52d2fff89f07b3e5e5fac3dd6a524c | refs/heads/master | 2022-12-22T18:59:42.947102 | 2020-03-27T16:01:08 | 2020-03-27T16:01:08 | 238,342,840 | 0 | 0 | null | 2022-12-15T23:58:21 | 2020-02-05T01:24:15 | Java | UTF-8 | Java | false | false | 6,778 | java | package com.capgemini.OnlineMedicalStore.dao;
import java.io.FileInputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.capgemini.OnlineMedicalStore.dto.ProductBean;
import com.capgemini.OnlineMedicalStore.factory.Factory;
public class ProductDaoImpl implements ProductDao {
static Logger log = LogManager.getLogger("ProductDAOImpl");
static Properties pro;
static int a = 0;
static ProductBean pBean = Factory.getProductBean();
static Connection con = null;
static PreparedStatement pstmt = null;
static ResultSet rs = null;
static int rsi = 0;
static String category = null;
static String pname = null;
static int b = 0;
static ArrayList<Integer> orderId = new ArrayList<Integer>();
static double total = 0;
public ProductDaoImpl() {
try {
FileInputStream fs = new FileInputStream("product.properties");
pro = new Properties();
pro.load(fs);
Class.forName(pro.getProperty("driver"));
} catch (Exception e) {
log.info("driver not found");
}
}
@Override
public List<ProductBean> showProducts() {
try (Connection conn = DriverManager.getConnection(pro.getProperty("url"), pro.getProperty("user"),
pro.getProperty("password"));
PreparedStatement pstmt = conn.prepareStatement(pro.getProperty("query1"))) {
rs = pstmt.executeQuery();
// log.info("ItemCode" + " " + "ItemName" + " " + "CategoryType" + " " + "Price" + " " + "ManufacturingDate"
// + " " + "ExpireDate" + " " + "Stock" + " " + "SupplierName");
List<ProductBean> productsList = new ArrayList<>();
while (rs.next()) {
ProductBean pBean = new ProductBean();
pBean.setItemCode(rs.getInt("itemCode"));
pBean.setCategoryType(rs.getString("categoryType"));
pBean.setItemName(rs.getString("itemName"));
pBean.setPrice(rs.getInt("price"));
pBean.setManufacturingDate(rs.getString("manufacturingDate"));
pBean.setExpiryDate(rs.getString("expiryDate"));
pBean.setStock(rs.getInt("stock"));
pBean.setSupplierName(rs.getString("supplierName"));
productsList.add(pBean);
// log.info(pBean.getItemCode() + " " + pBean.getItemName() + " " + pBean.getCategoryType() + " "
// + pBean.getPrice() + " " + " " + pBean.getManufacturingDate() + " "
// + pBean.getExpiryDate() + " " + pBean.getStock() + " " + pBean.getSupplierName());
}
return productsList;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
@Override
public void cartProduct(int id, int quantity, int uid) {
try (Connection conn = DriverManager.getConnection(pro.getProperty("url"), pro.getProperty("user"),
pro.getProperty("password"));
PreparedStatement pstmt = conn.prepareStatement(pro.getProperty("query2"))) {
pstmt.setInt(1, id);
rs = pstmt.executeQuery();
if (rs.next()) {
category = rs.getString("categoryType");
pname = rs.getString("itemName");
b = rs.getInt("price");
}
double orderPrice = b * quantity;
addToCart(uid, id, quantity, orderPrice, category, pname);
} catch (Exception e) {
e.getMessage();
e.printStackTrace();
}
}
public void addToCart(int id, int select, int quantity, double orderPrice, String category, String pname) {
try (Connection conn = DriverManager.getConnection(pro.getProperty("url"), pro.getProperty("user"),
pro.getProperty("password"));
PreparedStatement pstmt1 = conn
.prepareStatement("select quantity from cart where id = ? and itemCode = ?");
PreparedStatement pstmt2 = conn
.prepareStatement("update cart set quantity = ? where id = ? and itemCode = ? ");
PreparedStatement pstmt3 = conn.prepareStatement(pro.getProperty("query3"))) {
pstmt1.setInt(1, id);
pstmt1.setInt(2, select);
ResultSet rs = pstmt1.executeQuery();
if (rs.next()) {
int oldQuantity = rs.getInt("quantity");
oldQuantity = oldQuantity + quantity;
pstmt2.setInt(1, oldQuantity);
pstmt2.setInt(2, id);
pstmt2.setInt(3, select);
rsi = pstmt2.executeUpdate();
if (rsi > 0) {
System.out.println("Product already in the cart. Updated the quantity.");
}
} else {
pstmt3.setInt(1, id);
pstmt3.setInt(2, select);
pstmt3.setString(3, pname);
pstmt3.setString(4, category);
pstmt3.setInt(5, quantity);
pstmt3.setDouble(6, orderPrice);
rsi = pstmt.executeUpdate();
}
} catch (Exception e) {
System.out.println(" not added to cart ");
e.getMessage();
e.printStackTrace();
}
}
@Override
public void makeOrder(int id) {
try (Connection conn = DriverManager.getConnection(pro.getProperty("url"), pro.getProperty("user"),
pro.getProperty("password"));
PreparedStatement pstmt = conn.prepareStatement(pro.getProperty("query4"))) {
pstmt.setInt(1, id);
pstmt.setDouble(2, getTotal(id));
pstmt.executeUpdate();
} catch (Exception e) {
e.printStackTrace();
System.out.println("order data not inserted");
}
}
public static double getTotal(int id) {
try (Connection conn = DriverManager.getConnection(pro.getProperty("url"), pro.getProperty("user"),
pro.getProperty("password"));
PreparedStatement pstmt = conn.prepareStatement(pro.getProperty("query5"))) {
pstmt.setInt(1, id);
rs = pstmt.executeQuery();
while (rs.next()) {
total = total + rs.getDouble("orderPrice");
}
} catch (Exception e) {
System.out.println("query not executed");
e.getMessage();
}
return total;
}
@Override
public void viewCart() {
try (Connection conn = DriverManager.getConnection(pro.getProperty("url"), pro.getProperty("user"),
pro.getProperty("password"));
PreparedStatement pstmt = conn.prepareStatement(pro.getProperty("query6"))) {
rs = pstmt.executeQuery();
log.info("Id" + " " + "ItemCode" + " " + "itemName" + " " + "CategoryType" + " " + "quantity" + " "
+ "orderPrice");
while (rs.next()) {
pBean.setItemCode(rs.getInt("id"));
pBean.setCategoryType(rs.getString("itemCode"));
pBean.setItemName(rs.getString("itemName"));
pBean.setPrice(rs.getInt("categoryType"));
pBean.setManufacturingDate(rs.getString("quantity"));
pBean.setExpiryDate(rs.getString("orderPrice"));
log.info(pBean.getItemCode() + " " + pBean.getItemName() + " " + pBean.getCategoryType() + " "
+ pBean.getPrice() + " " + " " + pBean.getManufacturingDate() + " "
+ pBean.getExpiryDate() + " " + pBean.getStock() + " " + pBean.getSupplierName());
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
} | [
"magantinarendra3939@gmail.com"
] | magantinarendra3939@gmail.com |
4ac47a9a1f70bba94ead7cd5c241a2155629c76b | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/4/4_0024687802a969f35d342d1af024666cc20ca543/BoardView/4_0024687802a969f35d342d1af024666cc20ca543_BoardView_s.java | 3f654437bbf247faaea853fad3a1669205457c29 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 2,572 | java | package com.ioabsoftware.gameraven.views;
import com.ioabsoftware.gameraven.AllInOneV2;
import com.ioabsoftware.gameraven.R;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
public class BoardView extends LinearLayout {
public static enum BoardViewType {
NORMAL, SPLIT, LIST
}
protected String url;
private BoardViewType type;
public BoardView(Context context, String nameIn, String descIn, String lastPostIn,
String tCount, String mCount, String urlIn, BoardViewType typeIn) {
super(context);
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
inflater.inflate(R.layout.boardview, this);
TextView desc = (TextView) findViewById(R.id.bvDesc);
TextView lastPost = (TextView) findViewById(R.id.bvLastPost);
TextView tpcMsgDetails = (TextView) findViewById(R.id.bvTpcMsgDetails);
((TextView) findViewById(R.id.bvName)).setText(nameIn);
if (descIn != null)
desc.setText(descIn);
else
desc.setVisibility(View.INVISIBLE);
switch (typeIn) {
case NORMAL:
lastPost.setText("Last Post: " + lastPostIn);
tpcMsgDetails.setText("Tpcs: " + tCount + "; Msgs: " + mCount);
break;
case SPLIT:
lastPost.setText("--Split List--");
tpcMsgDetails.setVisibility(View.INVISIBLE);
break;
case LIST:
lastPost.setText("--Board List--");
tpcMsgDetails.setVisibility(View.INVISIBLE);
break;
}
url = urlIn;
type = typeIn;
findViewById(R.id.bvSep).setBackgroundColor(AllInOneV2.getAccentColor());
setBackgroundDrawable(AllInOneV2.getSelector().getConstantState().newDrawable());
}
public BoardView(Context context, String platform, String name, String urlIn) {
super(context);
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
inflater.inflate(R.layout.gamesearchview, this);
((TextView) findViewById(R.id.gsPlatform)).setText("Platform: " + platform);
((TextView) findViewById(R.id.gsName)).setText(name);
url = urlIn;
type = BoardViewType.NORMAL;
setBackgroundResource(R.drawable.selector);
}
public String getUrl() {
return url;
}
public BoardViewType getType() {
return type;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.