blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 332 | content_id stringlengths 40 40 | detected_licenses listlengths 0 50 | license_type stringclasses 2 values | repo_name stringlengths 7 115 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 557 values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 77.7k | fork_events_count int64 0 48k | gha_license_id stringclasses 17 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 82 values | src_encoding stringclasses 28 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 7 5.41M | extension stringclasses 11 values | content stringlengths 7 5.41M | authors listlengths 1 1 | author stringlengths 0 161 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e68f7cca33a2ff1e44094206ec93c360d35744ef | b8b9868360aecb618fa6bb02832ce106b07293a0 | /client/src/main/java/council/website/event/beans/StagingEvent.java | 51658587a47e746f8285e5bb08080f20d526ea95 | [] | no_license | abhinavshetty/hec-mba-council-website | 1b04aadb4029ce059fef335c38db0264c0c76809 | 90d20c090781ca753dee4a10ae39472da131b29c | refs/heads/main | 2023-02-26T20:24:30.351741 | 2021-01-30T17:01:02 | 2021-01-30T17:01:02 | 333,860,136 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 361 | java | package council.website.event.beans;
public class StagingEvent extends Event {
/**
*
*/
private static final long serialVersionUID = -1007251484263448031L;
private int stagingEventId;
public int getStagingEventId() {
return stagingEventId;
}
public void setStagingEventId(int stagingEventId) {
this.stagingEventId = stagingEventId;
}
}
| [
"abhinavshetty9419@gmail.com"
] | abhinavshetty9419@gmail.com |
90ec89e974b630736dcd95580750d3e899263994 | 8b1692d9daf2d2339d2c63444ca8ebb12bbeb62f | /src/main/java/com/ncl/sindhu/web/rest/vm/KeyAndPasswordVM.java | 1854f398e62b3ed9af6f7ee65115c00e581a65f1 | [] | no_license | shyamailene/nclsindhu | 11fbb2233c6803c671a517b57a08c14154cc0683 | 782446b603151ebe9aa0332a042d6957adc22fa2 | refs/heads/master | 2021-09-03T08:29:20.771868 | 2018-01-07T14:34:54 | 2018-01-07T14:34:54 | 114,122,561 | 0 | 0 | null | 2018-01-07T14:44:10 | 2017-12-13T13:12:50 | Java | UTF-8 | Java | false | false | 495 | java | package com.ncl.sindhu.web.rest.vm;
/**
* View Model object for storing the user's key and password.
*/
public class KeyAndPasswordVM {
private String key;
private String newPassword;
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getNewPassword() {
return newPassword;
}
public void setNewPassword(String newPassword) {
this.newPassword = newPassword;
}
}
| [
"shyam.ailene@hpe.com"
] | shyam.ailene@hpe.com |
26403dea3425e017163ae8c5e98cf2b197db25a8 | 16bb1d75b02b2445efe9df05115a6eb642eccae0 | /src/main/java/com/raindrop/mail/spring/boot/cache/AccountCache.java | e8dd712deb81ae90d59823e3f63836afba4aeb0b | [] | no_license | 727474430/mail-spring-boot | 1cded6d3dcc6fe83bf14130b0bfa3867a4258f66 | cfc9e14f0ddd00ea1eb2cdea5a594eb879cb6ffa | refs/heads/master | 2020-03-22T03:08:49.582472 | 2018-07-02T08:47:01 | 2018-07-02T08:47:01 | 139,415,464 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 737 | java | package com.raindrop.mail.spring.boot.cache;
import com.raindrop.mail.spring.boot.model.Account;
import java.util.HashMap;
import java.util.Map;
/**
* @name: com.raindrop.mail.spring.boot.cache.AccountCache.java
* @description: 模拟数据库数据
* @author: Wang Liang
* @create Time: 2018/6/28 19:37
*/
public class AccountCache {
public static Map<String, Account> accountMap;
static {
initAccountMap();
}
private static void initAccountMap() {
accountMap = new HashMap<>();
Account account1 = new Account("wangliang@qq.com", "q84518936", "0");
Account account2 = new Account("lvjia@qq.com", "q84518936", "1");
accountMap.put("wangliang@qq.com", account1);
accountMap.put("lvjia@qq.com", account2);
}
}
| [
"727474430@qq.com"
] | 727474430@qq.com |
c6c0a15b89383e484566ac2485da90fbfda29f8a | 05217bf46b5f64118a809f21d55e95b4ebeb6676 | /src/leetcode/solution/Solution309.java | b5e3ce9fa5c70b351d068d921025941343a0906b | [] | no_license | zd071lz/leetcode | b67737fcea979a15f0b0b5f0a09a0d68da418179 | 218cf01f8641d8a299683488e66c5963b0d9b4c9 | refs/heads/master | 2022-09-08T23:26:17.002711 | 2022-07-06T01:19:48 | 2022-07-06T01:19:48 | 193,122,807 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 798 | java | package leetcode.solution;
/**
* @author okr
*/
public class Solution309 {
public int maxProfit(int[] prices) {
if (prices.length == 0) {
return 0;
}
int n = prices.length;
// f[i][0]: 手上持有股票的最大收益
// f[i][1]: 手上不持有股票,并且处于冷冻期中的累计最大收益
// f[i][2]: 手上不持有股票,并且不在冷冻期中的累计最大收益
int[][] f = new int[n][3];
f[0][0] = -prices[0];
for (int i = 1; i < n; ++i) {
f[i][0] = Math.max(f[i - 1][0], f[i - 1][2] - prices[i]);
f[i][1] = f[i - 1][0] + prices[i];
f[i][2] = Math.max(f[i - 1][1], f[i - 1][2]);
}
return Math.max(f[n - 1][1], f[n - 1][2]);
}
}
| [
"zheng.li1@okcoin.net"
] | zheng.li1@okcoin.net |
8aad8a370a33e095deff0d3b162f0619fd53757a | 28411db80139955c9e045e61160f4e3ece5dd782 | /src/FantabArray.java | 52209013f01582f8d12bb03b9986f29a5b1bd77b | [] | no_license | Padmaja02/project | 2c1419214b311e40faed9db53cf0912aefdda459 | c06ef1060cfcb350d72aeb543678c4157c9f4f88 | refs/heads/master | 2020-04-06T05:11:16.426255 | 2017-02-17T12:06:55 | 2017-02-17T12:06:55 | 54,535,020 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 795 | java | import java.util.Scanner;
public class FantabArray {
private static Scanner sc;
private static int prod;
private static int sum;
public static void main(String[] args) {
sc = new Scanner(System.in);
boolean fab=true;
boolean fant=true;
int n=sc.nextInt();
int[] arr=new int[n];
for(int i=0;i<n;i++)
arr[i]=sc.nextInt();
sum = arr[0];
prod = arr[0];
for(int i=1;i<n;i++)
{
if(arr[i]>sum)
sum+=arr[i];
else
fab=false;
if(arr[i]>prod)
prod*=arr[i];
else
fant=false;
}
if(fab && fant)
System.out.println("Fantabulous Array");
else if(fab)
System.out.println("Fabulous Array");
else if(fant)
System.out.println("Fantastic Array");
else
System.out.println("Not an Array");
}
}
| [
"padmajaswaminathan@gmail.com"
] | padmajaswaminathan@gmail.com |
5cd767b246906d1f52120e7cbe202002ef50de3c | 518779119258b8e5c13484a854ff93eb5f48edcf | /src/Lab4/FractalExplorer.java | ad063e275c19a6f9b57b5aeceb06ef301b19646a | [] | no_license | shvekh/Labs | 9bb25fdc75e41300b2bf45b4b53df64f0c09cfca | 8e83a4a753f7529f53b0554fb729c9d8e5ef7c3f | refs/heads/master | 2022-10-29T11:06:04.754746 | 2020-06-16T10:58:27 | 2020-06-16T10:58:27 | 244,499,425 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,111 | java | package Lab4;
import javax.imageio.ImageIO;
import javax.swing.*;
import javax.swing.filechooser.FileFilter;
import javax.swing.filechooser.FileNameExtensionFilter;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.geom.Rectangle2D;
import java.io.File;
import java.io.IOException;
public class FractalExplorer {
private int size;
private JImageDisplay jimage;
private FractalGenerator fgen;
private JComboBox<Object> box;
private JButton btnReset;
private JButton btnSave;
private Rectangle2D.Double range;
public FractalExplorer(int size) {
this.size = size;
this.fgen = new Mandelbrot();
this.range = new Rectangle2D.Double();
fgen.getInitialRange(this.range);
createAndShowGUI();
drawFractal();
}
public void createAndShowGUI() {
JFrame jfrm = new JFrame("Fractals");
btnReset = new JButton("Reset");
btnSave = new JButton("Save");
jimage = new JImageDisplay(size, size);
JLabel label = new JLabel("Fractal: ");
box = new JComboBox<>();// сoздание выпадающего списка
box.addItem(new Mandelbrot());
JPanel panelBox = new JPanel();
panelBox.add(label);
panelBox.add(box);
JPanel panelBtn = new JPanel();
panelBtn.add(btnReset);
panelBtn.add(btnSave);
jfrm.add(jimage, BorderLayout.CENTER);
jfrm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
jfrm.add(panelBtn, BorderLayout.SOUTH);
jfrm.add(panelBox, BorderLayout.NORTH);
ActionHandler handler = new ActionHandler();
btnReset.addActionListener(handler);
btnSave.addActionListener(handler);
box.addActionListener(handler);
jimage.addMouseListener(new MouseHandler());
jfrm.pack();
jfrm.setVisible(true);
jfrm.setResizable(false);
}
private void drawFractal() {
for (int x = 0; x < size; x++) {
for (int y = 0; y < size; y++) {
double xCoord = FractalGenerator.getCoord(range.x, range.x + range.width,
size, x);
double yCoord = FractalGenerator.getCoord(range.y, range.y + range.height,
size, y);
if (fgen.numIterations(xCoord, yCoord) == -1) {
jimage.drawPixel(x, y, 0);
} else {
float hue = 0.7f + (float) fgen.numIterations(xCoord, yCoord) / 200f;
int rgbColor = Color.HSBtoRGB(hue, 1f, 1f);
jimage.drawPixel(x, y, rgbColor);
}
}
}
jimage.repaint();
}
public class ActionHandler implements ActionListener {
public void actionPerformed(ActionEvent e) {
if (e.getSource() == btnReset) {
fgen.getInitialRange(range);
drawFractal();
} else if (e.getSource() == btnSave) {
JFileChooser chooser = new JFileChooser();
FileFilter filter = new FileNameExtensionFilter("PNG Images", "PNG");
chooser.setFileFilter(filter);
chooser.setAcceptAllFileFilterUsed(false);
if (chooser.showSaveDialog(null) == JFileChooser.APPROVE_OPTION) {
try {
ImageIO.write(jimage.getBufferedImage(), "png", new File(chooser.getSelectedFile() + ".PNG"));
} catch (IOException ex) {
System.out.println("Failed to save image!");
}
} else {
System.out.println("No file chosen!");
}
} else if (e.getSource() == box) {
fgen = (FractalGenerator) box.getSelectedItem();
fgen.getInitialRange(range);
drawFractal();
}
}
}
public class MouseHandler implements MouseListener {
@Override
public void mouseClicked(MouseEvent e) {
double mouseX = FractalGenerator.getCoord(range.x, range.x + range.width, size, e.getX());
double mouseY = FractalGenerator.getCoord(range.y, range.y + range.width, size, e.getY());
System.out.println(mouseX + " " + mouseY);
if (e.getButton() == MouseEvent.BUTTON1) {
fgen.recenterAndZoomRange(range, mouseX, mouseY, 0.5);
drawFractal();
} else if (e.getButton() == MouseEvent.BUTTON3) {
fgen.recenterAndZoomRange(range, mouseX, mouseY, 1.5);
drawFractal();
}
}
public void mousePressed(MouseEvent mouseEvent) { }
public void mouseReleased(MouseEvent mouseEvent) { }
public void mouseEntered(MouseEvent mouseEvent) { }
public void mouseExited(MouseEvent mouseEvent) { }
}
public static void main(String[] args) {
new FractalExplorer(600);
}
} | [
"shvekh-misha@yandex.ru"
] | shvekh-misha@yandex.ru |
6663df1754c9c3d8a2ef0e30420ae4eec4b8715d | 563e8db7dba0131fb362d8fb77a852cae8ff4485 | /Blagosfera/bp-core/src/main/java/ru/radom/blagosferabp/activiti/component/converters/xml/parsers/MapChildParser.java | b9bf68df93dc5fcbae5d19426d1465cc5ad78b21 | [] | no_license | askor2005/blagosfera | 13bd28dcaab70f6c7d6623f8408384bdf337fd21 | c6cf8f1f7094ac7ccae3220ad6518343515231d0 | refs/heads/master | 2021-01-17T18:05:08.934188 | 2016-10-14T16:53:38 | 2016-10-14T16:53:48 | 70,894,701 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,904 | java | package ru.radom.blagosferabp.activiti.component.converters.xml.parsers;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
import javax.xml.stream.XMLStreamWriter;
import java.util.HashMap;
import java.util.Map;
/**
* Created by Otts Alexey on 17.11.2015.<br/>
* Парсер для значение типа {@link Map}
*/
@Component
public class MapChildParser extends ComplexChildParser<Map<String, Object>> {
@Autowired
private CollectionChildParser collectionChildParser;
@Override
public String getElementName() {
return "map";
}
@Override
public Map<String, Object> parseBack(XMLStreamReader xtr, String elementNameOverride) throws XMLStreamException {
Map<String, Object> map = new HashMap<>();
String elementName = elementNameOverride != null ? elementNameOverride : getElementName();
while (true) {
xtr.next();
if(xtr.isEndElement() && xtr.getLocalName().equals(elementName)) {
break;
}
if(xtr.isStartElement()) {
if ("entry".equals(xtr.getLocalName())) {
String key = xtr.getAttributeValue(null, "key");
if (StringUtils.hasText(key)) {
String type = xtr.getAttributeValue(null, "type");
if(isSimpleType(type)) {
String value = xtr.getAttributeValue(null, "value");
map.put(key, parseSimpleValue(value, type));
} else {
ParameterToChildElementParser parser = resolveParser(type);
map.put(key, parser.parseBack(xtr, null));
}
}
}
}
}
return map;
}
@Override
public void createChild(String name, Map<String, Object> param, XMLStreamWriter xtw, String elementNameOverride) throws XMLStreamException {
String elementName = elementNameOverride != null ? elementNameOverride : getElementName();
xtw.writeStartElement(ACTIVITI_EXTENSIONS_PREFIX, elementName, ACTIVITI_EXTENSIONS_NAMESPACE);
if(name != null) {
xtw.writeAttribute(PARAM_NAME, name);
}
for (Map.Entry<String, Object> entry : param.entrySet()) {
Object value = entry.getValue();
String type = resolveType(value);
if(type == null) {
throw new IllegalArgumentException("Unsupported type: " + value.getClass());
} else if(NULL_TYPE.equals(type)) {
continue;
}
boolean simpleType = isSimpleType(type);
if(simpleType) {
xtw.writeEmptyElement(ACTIVITI_EXTENSIONS_PREFIX, "entry", ACTIVITI_EXTENSIONS_NAMESPACE);
xtw.writeAttribute("value", value.toString());
} else {
xtw.writeStartElement(ACTIVITI_EXTENSIONS_PREFIX, "entry", ACTIVITI_EXTENSIONS_NAMESPACE);
}
xtw.writeAttribute("key", entry.getKey());
xtw.writeAttribute("type", type);
if(!simpleType) {
ParameterToChildElementParser parser = resolveParser(type);
parser.createChild(null, value, xtw, null);
xtw.writeEndElement();
}
}
xtw.writeEndElement();
}
ParameterToChildElementParser resolveParser(String type) {
if(COLLECTION_TYPE.equals(type)) {
return collectionChildParser;
} else if(MAP_TYPE.equals(type)) {
return this;
}
throw new IllegalArgumentException("Unsupported type: " + type);
}
}
| [
"askor2005@yandex.ru"
] | askor2005@yandex.ru |
fcfedd4b0a46134e1d3857cd2ad828a90d45cbb3 | 9ee294cea46b872dae47fc076f4ab668ac8d10d4 | /app/src/main/java/com/bhargav/hcms/LoginActivity.java | 2e38d8af1685992b22d12978c019273d5bcc3a3d | [] | no_license | bhargav944/HCMS-Old-Code | 0507424f3491578356b3afd2a09b9ecf60ab84e8 | f57c164ef684c8cd9502cab42ee10968ee6ce49a | refs/heads/master | 2020-09-12T00:20:39.513138 | 2019-08-12T10:02:18 | 2019-08-12T10:02:18 | 222,238,398 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 17,062 | java | package com.bhargav.hcms;
import android.app.ActivityOptions;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.design.widget.FloatingActionButton;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import com.bhargav.hcms.data.SharedPreferenceHelper;
import com.bhargav.hcms.data.StaticConfig;
import com.bhargav.hcms.model.User;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthResult;
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.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
import com.yarolegovich.lovelydialog.LovelyInfoDialog;
import com.yarolegovich.lovelydialog.LovelyProgressDialog;
import java.util.HashMap;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* Created by Gurramkonda Bhargav on 05-05-2018.
*/
public class LoginActivity extends AppCompatActivity {
private static String TAG = "LoginActivity";
FloatingActionButton fab;
private final Pattern VALID_EMAIL_ADDRESS_REGEX =
Pattern.compile("^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,6}$", Pattern.CASE_INSENSITIVE);
private EditText editTextUsername, editTextPassword;
private LovelyProgressDialog waitingDialog;
TextView mSkip;
private AuthUtils authUtils;
private FirebaseAuth mAuth;
private FirebaseAuth.AuthStateListener mAuthListener;
private FirebaseUser user;
private boolean firstTimeAccess;
@Override
protected void onStart() {
super.onStart();
mAuth.addAuthStateListener(mAuthListener);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
fab = (FloatingActionButton) findViewById(R.id.fab);
editTextUsername = (EditText) findViewById(R.id.et_username);
editTextPassword = (EditText) findViewById(R.id.et_password);
mSkip = findViewById(R.id.skip);
mSkip.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view)
{
Intent i = new Intent(LoginActivity.this,SkipPortal.class);
startActivity(i);
}
});
firstTimeAccess = true;
initFirebase();
}
private void initFirebase() {
//Khoi tao thanh phan de dang nhap, dang ky
mAuth = FirebaseAuth.getInstance();
authUtils = new AuthUtils();
mAuthListener = new FirebaseAuth.AuthStateListener() {
@Override
public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {
user = firebaseAuth.getCurrentUser();
if (user != null) {
// User is signed in
StaticConfig.UID = user.getUid();
Log.d(TAG, "onAuthStateChanged:signed_in:" + user.getUid());
if (firstTimeAccess) {
startActivity(new Intent(LoginActivity.this, PortalPage.class));
LoginActivity.this.finish();
}
} else {
Log.d(TAG, "onAuthStateChanged:signed_out");
}
firstTimeAccess = false;
}
};
//Khoi tao dialog waiting khi dang nhap
waitingDialog = new LovelyProgressDialog(this).setCancelable(false);
}
@Override
protected void onStop() {
super.onStop();
if (mAuthListener != null) {
mAuth.removeAuthStateListener(mAuthListener);
}
}
public void clickRegisterLayout(View view) {
getWindow().setExitTransition(null);
getWindow().setEnterTransition(null);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
ActivityOptions options =
ActivityOptions.makeSceneTransitionAnimation(this, fab, fab.getTransitionName());
startActivityForResult(new Intent(this, RegisterActivity.class), StaticConfig.REQUEST_CODE_REGISTER, options.toBundle());
} else {
startActivityForResult(new Intent(this, RegisterActivity.class), StaticConfig.REQUEST_CODE_REGISTER);
}
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == StaticConfig.REQUEST_CODE_REGISTER && resultCode == RESULT_OK) {
authUtils.createUser(data.getStringExtra(StaticConfig.STR_EXTRA_USERNAME), data.getStringExtra(StaticConfig.STR_EXTRA_PASSWORD));
}
}
public void clickLogin(View view) {
String username = editTextUsername.getText().toString();
String password = editTextPassword.getText().toString();
if (validate(username, password)) {
authUtils.signIn(username, password);
} else {
Toast.makeText(this, R.string.invalid_password, Toast.LENGTH_SHORT).show();
}
}
@Override
public void onBackPressed() {
super.onBackPressed();
setResult(RESULT_CANCELED, null);
finish();
}
private boolean validate(String emailStr, String password) {
Matcher matcher = VALID_EMAIL_ADDRESS_REGEX.matcher(emailStr);
return (password.length() > 0 || password.equals(";")) && matcher.find();
}
public void clickResetPassword(View view) {
String username = editTextUsername.getText().toString();
if (validate(username, ";")) {
authUtils.resetPassword(username);
} else {
Toast.makeText(this, R.string.invalid_email, Toast.LENGTH_SHORT).show();
}
}
/**
* Dinh nghia cac ham tien ich cho quas trinhf dang nhap, dang ky,...
*/
class AuthUtils {
/**
* Action register
*
* @param email
* @param password
*/
void createUser(String email, String password) {
waitingDialog.setIcon(R.drawable.ic_add_friend)
.setTitle(R.string.register1)
.setTopColorRes(R.color.colorPrimary)
.show();
mAuth.createUserWithEmailAndPassword(email, password)
.addOnCompleteListener(LoginActivity.this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
Log.d(TAG, "createUserWithEmail:onComplete:" + task.isSuccessful());
waitingDialog.dismiss();
// If sign in fails, display a message to the user. If sign in succeeds
// the auth state listener will be notified and logic to handle the
// signed in user can be handled in the listener.
if (!task.isSuccessful()) {
new LovelyInfoDialog(LoginActivity.this) {
@Override
public LovelyInfoDialog setConfirmButtonText(String text) {
findView(com.yarolegovich.lovelydialog.R.id.ld_btn_confirm).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
dismiss();
}
});
return super.setConfirmButtonText(text);
}
}
.setTopColorRes(R.color.colorAccent)
.setIcon(R.drawable.ic_add_friend)
.setTitle(R.string.register_false)
.setMessage(R.string.email_exist_or_weak)
.setConfirmButtonText(R.string.ok)
.setCancelable(false)
.show();
} else {
initNewUserInfo();
Toast.makeText(LoginActivity.this, R.string.register_and_login_success, Toast.LENGTH_SHORT).show();
startActivity(new Intent(LoginActivity.this, PortalPage.class));
LoginActivity.this.finish();
}
}
})
.addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
waitingDialog.dismiss();
}
})
;
}
/**
* Action Login
*
* @param email
* @param password
*/
void signIn(String email, String password) {
waitingDialog.setIcon(R.drawable.ic_person_low)
.setTitle(R.string.login1)
.setTopColorRes(R.color.colorPrimary)
.show();
mAuth.signInWithEmailAndPassword(email, password)
.addOnCompleteListener(LoginActivity.this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
Log.d(TAG, "signInWithEmail:onComplete:" + task.isSuccessful());
// If sign in fails, display a message to the user. If sign in succeeds
// the auth state listener will be notified and logic to handle the
// signed in user can be handled in the listener.
waitingDialog.dismiss();
if (!task.isSuccessful()) {
Log.w(TAG, "signInWithEmail:failed", task.getException());
new LovelyInfoDialog(LoginActivity.this) {
@Override
public LovelyInfoDialog setConfirmButtonText(String text) {
findView(com.yarolegovich.lovelydialog.R.id.ld_btn_confirm).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
dismiss();
}
});
return super.setConfirmButtonText(text);
}
}
.setTopColorRes(R.color.colorAccent)
.setIcon(R.drawable.ic_person_low)
.setTitle(R.string.login_false)
.setMessage(R.string.email_not_exist_or_weak)
.setCancelable(false)
.setConfirmButtonText(R.string.ok)
.show();
} else {
saveUserInfo();
startActivity(new Intent(LoginActivity.this, PortalPage.class));
LoginActivity.this.finish();
}
}
})
.addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
waitingDialog.dismiss();
}
});
}
/**
* Action reset password
*
* @param email
*/
void resetPassword(final String email) {
mAuth.sendPasswordResetEmail(email)
.addOnCompleteListener(new OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task) {
new LovelyInfoDialog(LoginActivity.this) {
@Override
public LovelyInfoDialog setConfirmButtonText(String text) {
findView(com.yarolegovich.lovelydialog.R.id.ld_btn_confirm).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
dismiss();
}
});
return super.setConfirmButtonText(text);
}
}
.setTopColorRes(R.color.colorPrimary)
.setIcon(R.drawable.ic_pass_reset)
.setTitle(R.string.pswd_recovery)
.setMessage(R.string.sent_email_to + email)
.setConfirmButtonText(R.string.ok)
.show();
}
})
.addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
new LovelyInfoDialog(LoginActivity.this) {
@Override
public LovelyInfoDialog setConfirmButtonText(String text) {
findView(com.yarolegovich.lovelydialog.R.id.ld_btn_confirm).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
dismiss();
}
});
return super.setConfirmButtonText(text);
}
}
.setTopColorRes(R.color.colorAccent)
.setIcon(R.drawable.ic_pass_reset)
.setTitle(R.string.false1)
.setMessage(R.string.false_email + email)
.setConfirmButtonText(R.string.ok)
.show();
}
});
}
/**
* Luu thong tin user info cho nguoi dung dang nhap
*/
void saveUserInfo() {
FirebaseDatabase.getInstance().getReference().child("user/" + StaticConfig.UID).addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
waitingDialog.dismiss();
HashMap hashUser = (HashMap) dataSnapshot.getValue();
User userInfo = new User();
userInfo.name = (String) hashUser.get("name");
userInfo.email = (String) hashUser.get("email");
userInfo.avata = (String) hashUser.get("avata");
SharedPreferenceHelper.getInstance(LoginActivity.this).saveUserInfo(userInfo);
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
});
}
/**
* Khoi tao thong tin mac dinh cho tai khoan moi
*/
void initNewUserInfo() {
User newUser = new User();
newUser.email = user.getEmail();
newUser.name = user.getEmail().substring(0, user.getEmail().indexOf("@"));
newUser.avata = StaticConfig.STR_DEFAULT_BASE64;
FirebaseDatabase.getInstance().getReference().child("user/" + user.getUid()).setValue(newUser);
}
}
}
| [
"bhargav.gurramkonda@gmail.com"
] | bhargav.gurramkonda@gmail.com |
052b4f40e904d304518d207056d1743df7488644 | 4b38bc3064c80d792d155a2cd0d24ece9186f0fe | /app/src/main/java/com/mark/app/hjshop4a/common/utils/NumberUtils.java | 4f147884c70c4d9c672de77c7d4b9bd603e2ca3a | [] | no_license | HHFly/HJShop | 8d074cd3819073305c545ca8e44a36dbfc64336c | 877b918418014a16cdf19d4d2153f5d0f9c4eb1f | refs/heads/master | 2020-03-23T18:17:40.906719 | 2018-06-19T14:13:03 | 2018-06-19T14:13:03 | 141,899,610 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,436 | java | package com.mark.app.hjshop4a.common.utils;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;
/**
* 功能:数值加工厂
* 作者:林敬聚
*/
public class NumberUtils {
//格式化日期
private static final String PARAM_DATETIME = "yyyy-MM-dd HH:mm:ss";
//格式化日期
private static final String PARAM_DATETIME_YMDHM = "yyyy-MM-dd HH:mm";
//格式化日期
private static final String PARAM_DATETIME_MD_HMS = "MM-dd HH:mm:ss";
//格式化日期
private static final String PARAM_DATETIME_HMS = "HH:mm:ss";
//格式化日期
private static final String PARAM_DATETIME_HM = "HH:mm";
//格式化日期
private static final String PARAM_DATETIME_MD_HM = "MM-dd HH:mm";
//格式化日期
private static final String PARAM_DATETIME_YMD = "yyyy-MM-dd";
//格式化日期
private static final String PARAM_DATETIME_MS = "(剩余 mm 分 ss 秒)";
//格式化日期
private static final String PARAM_DATETIME_NEW_YMD = "yyyy年MM月dd日";
//格式化数值
private static final String PARAM_KEEP_DECIMAL_TWO = "#0.00";
//格式化数值
private static final String PARAM_KEEP_DECIMAL_ONE = "#0.0";
//格式化数值
private static final String PARAM_KEEP_DECIMAL = "#0";
//格式化数值
private static final String PARAM_KEEP_DECIMAL00 = "#00";
public static double parseDouble(String data) {
double d = 0;
try {
d = Double.parseDouble(data);
} catch (Exception e) {
LogUtils.logFormat("NumberUtils", "parseDouble", "d = Double.parseDouble(data);");
}
return d;
}
/**
* 将毫秒转换为从0开始的时间
* 例如13:00
*
* @param data
* @return
*/
public static String getTimeHM(long data) {
//所有秒
int allSecond = (int) (data / 1000l);
//所有分
int allMinute = allSecond / 60;
//所有小时
int allHour = allMinute / 60;
//小时
int hour = allHour % 24;
if (hour == 0 && allHour != 0) {
hour = 24;
}
//分
int minute = allMinute % 60;
return keepDecimal00(hour) + ":" + keepDecimal00(minute);
}
/**
* 格式化数值
* 00
*
* @param number number
* @return String
*/
private static String keepDecimal00(double number) {
return keepDecimal(number, PARAM_KEEP_DECIMAL00);
}
/**
* 格式化数值
* 0.0
*
* @param number number
* @return String
*/
public static String keepDecimalOne(double number) {
return keepDecimal(number, PARAM_KEEP_DECIMAL_ONE);
}
/**
* 格式化数值
* #0
*
* @param number number
* @return String
*/
public static String keepDecimalZero(double number) {
return keepDecimal(number, PARAM_KEEP_DECIMAL);
}
/**
* 格式化数值
* 0.00
*
* @param number number
* @return String
*/
public static String keepDecimal(String number) {
try {
double d = Double.valueOf(number);
return keepDecimal(d, PARAM_KEEP_DECIMAL_TWO);
} catch (Exception e) {
LogUtils.logFormat("NumberUtils", "keepDecimal", "字符串转换double异常");
}
return number;
}
/**
* 格式化数值
* 0.00
*
* @param number number
* @return String
*/
public static String keepDecimal(double number) {
return keepDecimal(number, PARAM_KEEP_DECIMAL_TWO);
}
/**
* 格式化日期(1-1 1:00)
* yyyy-MM-dd HH:mm:ss
*
* @param dateTime
* @return
*/
public static String getFormatDateTimeMDHMS(long dateTime) {
return getFormatDateTime(PARAM_DATETIME_MD_HMS, dateTime);
}
/**
* 格式化日期(剩余 mm 分 ss 秒)
* yyyy-MM-dd HH:mm:ss
*
* @param dateTime
* @return
*/
public static String getFormatDateTimeMS(long dateTime) {
return getFormatDateTime(PARAM_DATETIME_MS, dateTime);
}
/**
* 格式化日期
* HH:mm:ss
*
* @param dateTime
* @return
*/
public static String getFormatDateTimeHMS(long dateTime) {
return getFormatDateTime(PARAM_DATETIME_HMS, dateTime);
}
/**
* 格式化日期
* HH:mm
*
* @param dateTime
* @return
*/
public static String getFormatDateTimeHM(long dateTime) {
return getFormatDateTime(PARAM_DATETIME_HM, dateTime);
}
/**
* 格式化日期(2000-1-1)
* yyyy-MM-dd HH:mm:ss
*
* @param dateTime
* @return
*/
public static String getFormatDateTimeMDHM(long dateTime) {
return getFormatDateTime(PARAM_DATETIME_MD_HM, dateTime);
}
/**
* 格式化日期(2000-1-1)
* yyyy-MM-dd HH:mm:ss
*
* @param dateTime
* @return
*/
public static String getFormatDateTimeYMD(long dateTime) {
return getFormatDateTime(PARAM_DATETIME_YMD, dateTime);
}
/**
* 格式化日期(2000年1月1日)
* yyyy-MM-dd HH:mm:ss
*
* @param dateTime
* @return
*/
public static String getFormatDateTimeNEWYMD(long dateTime) {
return getFormatDateTime(PARAM_DATETIME_NEW_YMD, dateTime);
}
/**
* 格式化日期
* yyyy-MM-dd HH:mm:ss
*
* @param dateTime
* @return
*/
public static String getFormatDateTimeYMDHMS(long dateTime) {
return getFormatDateTime(PARAM_DATETIME, dateTime);
}
/**
* 格式化日期
* yyyy-MM-dd HH:mm:ss
*
* @param dateTime
* @return
*/
public static String getFormatDateTimeYMDHM(long dateTime) {
return getFormatDateTime(PARAM_DATETIME_YMDHM, dateTime);
}
/**
* 格式化数值
*
* @param number number
* @return String
*/
private static String keepDecimal(double number, String pattern) {
DecimalFormat format = new DecimalFormat(pattern);
String result = format.format(number);
return result;
}
/**
* 格式化日期
*
* @param pattern
* @param dateTime
* @return
*/
private static String getFormatDateTime(String pattern, long dateTime) {
SimpleDateFormat format = new SimpleDateFormat(pattern);
format.setTimeZone(TimeZone.getTimeZone("GMT-0:00"));
return format.format(new Date(dateTime));
}
/*
* 判断获取 long 型时间 or String 型时间
* */
public static String getTimeStrYMDHMS(long timelong , String timeStr ){
String strTime ="";
if(timeStr==null){
// strTime = NumberUtils.getFormatDateTimeYMDHMS(timelong);
return strTime;
}else {
if(timeStr.isEmpty()){
// strTime = NumberUtils.getFormatDateTimeYMDHMS(timelong);]
strTime= timeStr;
}else {
strTime =timeStr;
}
}
return strTime;
}
/*
* 判断获取 long 型时间 or String 型时间
* */
public static String getTimeStrYMDHM(long timelong , String timeStr ){
String strTime ="";
if(timeStr==null){
// strTime = NumberUtils.getFormatDateTimeYMDHM(timelong);
return strTime;
}else {
if(timeStr.isEmpty()){
// strTime = NumberUtils.getFormatDateTimeYMDHM(timelong);
strTime=timeStr;
}else {
strTime =timeStr;
}
}
return strTime;
}
/*
* 判断获取 long 型时间 or String 型时间
* */
public static String getTimeStrYMD(long timelong , String timeStr ){
String strTime ="";
if(timeStr==null){
// strTime = NumberUtils.getFormatDateTimeYMD(timelong);
return strTime;
}else {
if(timeStr.isEmpty()){
// strTime = NumberUtils.getFormatDateTimeYMD(timelong);
strTime =timeStr;
}else {
strTime =timeStr;
}
}
return strTime;
}
/*
* 判断获取 long 型时间 or String 型时间
* */
public static String getTimeStrMS(long timelong , String timeStr ){
String strTime ="";
if(timeStr==null){
//strTime = NumberUtils.getFormatDateTimeMS(timelong);
return strTime;
}else {
if(timeStr.isEmpty()){
// strTime = NumberUtils.getFormatDateTimeMS(timelong);
strTime= timeStr;
}else {
strTime =timeStr;
}
}
return strTime;
}
/*
* 判断获取 long 型时间 or String 型时间 (不作处理)
* */
public static String getTimeStrHM(long timelong , String timeStr ){
String strTime ="";
if(timeStr==null){
//strTime = NumberUtils.getFormatDateTimeHM(timelong);
return strTime;
}else {
if(timeStr.isEmpty()){
// strTime = NumberUtils.getFormatDateTimeHM(timelong);
strTime =timeStr;
}else {
strTime =timeStr;
}
}
return strTime;
}
}
| [
"zhouchunhui@dlydly.com"
] | zhouchunhui@dlydly.com |
71b1fe00f80df871b808cde12565db10b6b41796 | dc4f0d95e99a2d6d64de0faaa5b95626602fa2cf | /app/src/main/java/com/mstring/andtest/bean/LeLiveCreateBean.java | 2013434ca8b5546e92678db5e56fd3747f4420d5 | [] | no_license | zyzd/LeVodTest | 4a5dd0d5a27e2f6f0dc2d3323a81cc6be6256956 | 55ca8ec04045cc31d8d44cf0fec9ce6b8484d57d | refs/heads/master | 2021-01-24T08:36:41.674312 | 2016-11-01T06:11:00 | 2016-11-01T06:11:00 | 69,553,096 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 568 | java | package com.mstring.andtest.bean;
import java.io.Serializable;
/**
* Created by 李宗源 on 2016/10/11.
* 创建标准直播活动的接口
*/
public class LeLiveCreateBean implements Serializable {
private String activityId;
public String getActivityId() {
return activityId;
}
public void setActivityId(String activityId) {
this.activityId = activityId;
}
@Override
public String toString() {
return "LeLiveCreateBean{" +
"activityId='" + activityId + '\'' +
'}';
}
}
| [
"919869109@qq.com"
] | 919869109@qq.com |
0fc6869bbe100b0671bf6d7f7ba372ad23c915c0 | e6b5e0f7330fab7597926e4f16a8555e232a6fc4 | /src/main/java/uk/nhs/ctp/service/report/org/hl7/v3/CSCDAObservationType.java | 82b0c095e74e4566565b9cd47d5a55f263c68133 | [
"LicenseRef-scancode-proprietary-license",
"MIT"
] | permissive | UECIT/cdss-ems | 424500c8b3365abaf44162c6cbacbf186748fb8c | 7b9552268ed42f027fa401aba24eddef25aae799 | refs/heads/develop | 2022-04-25T19:18:23.192395 | 2020-04-30T16:25:31 | 2020-04-30T16:25:31 | 259,712,948 | 0 | 0 | MIT | 2020-04-30T16:25:32 | 2020-04-28T17:59:53 | Java | UTF-8 | Java | false | false | 1,163 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// 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: 2019.03.15 at 03:22:47 PM GMT
//
package uk.nhs.ctp.service.report.org.hl7.v3;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for CS_CDAObservationType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="CS_CDAObservationType">
* <complexContent>
* <restriction base="{urn:hl7-org:v3}CS">
* <attribute name="code" use="required" type="{urn:hl7-org:v3}CDAObservationType_code" />
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CS_CDAObservationType")
public class CSCDAObservationType
extends CS
{
}
| [
"daniel.nuttall@answerdigital.com"
] | daniel.nuttall@answerdigital.com |
89a2297e49eca99105405b1989348c57a23f825e | 28346f85beff37198be57d7e2b6013e62f2510f1 | /app/src/main/java/com/daocheng/girlshop/view/FullyGridLayoutManager.java | 4aaae8e341bd344cbea588030719d5941f766a2d | [] | no_license | xuxiang1991/girlshoplast | 25e71f6c79006fa8155de18c9d1385ec4c03895e | 0dda0976b808a389ab5bf7adb3222d7ede7af3d7 | refs/heads/master | 2023-02-03T21:04:33.453918 | 2018-10-26T02:24:15 | 2018-10-26T02:24:15 | 88,509,677 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,251 | java | package com.daocheng.girlshop.view;
import android.content.Context;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
/**
* 项目名称:girlshop
* 类描述:
* 创建人:Dove
* 创建时间:2016/5/3 17:51
* 修改人:Dove
* 修改时间:2016/5/3 17:51
* 修改备注:
*/
public class FullyGridLayoutManager extends GridLayoutManager {
private int mwidth = 0;
private int mheight = 0;
public FullyGridLayoutManager(Context context, int spanCount) {
super(context, spanCount);
}
public FullyGridLayoutManager(Context context, int spanCount, int orientation, boolean reverseLayout) {
super(context, spanCount, orientation, reverseLayout);
}
private int[] mMeasuredDimension = new int[2];
public int getMwidth() {
return mwidth;
}
public void setMwidth(int mwidth) {
this.mwidth = mwidth;
}
public int getMheight() {
return mheight;
}
public void setMheight(int mheight) {
this.mheight = mheight;
}
@Override
public void onMeasure(RecyclerView.Recycler recycler, RecyclerView.State state, int widthSpec, int heightSpec) {
final int widthMode = View.MeasureSpec.getMode(widthSpec);
final int heightMode = View.MeasureSpec.getMode(heightSpec);
final int widthSize = View.MeasureSpec.getSize(widthSpec);
final int heightSize = View.MeasureSpec.getSize(heightSpec);
int width = 0;
int height = 0;
int count = getItemCount();
int span = getSpanCount();
for (int i = 0; i < count; i++) {
measureScrapChild(recycler, i,
View.MeasureSpec.makeMeasureSpec(i, View.MeasureSpec.UNSPECIFIED),
View.MeasureSpec.makeMeasureSpec(i, View.MeasureSpec.UNSPECIFIED),
mMeasuredDimension);
if (getOrientation() == HORIZONTAL) {
if (i % span == 0) {
width = width + mMeasuredDimension[0];
}
if (i == 0) {
height = mMeasuredDimension[1];
}
} else {
if (i % span == 0) {
height = height + mMeasuredDimension[1];
}
if (i == 0) {
width = mMeasuredDimension[0];
}
}
}
switch (widthMode) {
case View.MeasureSpec.EXACTLY:
width = widthSize;
case View.MeasureSpec.AT_MOST:
case View.MeasureSpec.UNSPECIFIED:
}
switch (heightMode) {
case View.MeasureSpec.EXACTLY:
height = heightSize;
case View.MeasureSpec.AT_MOST:
case View.MeasureSpec.UNSPECIFIED:
}
setMheight(height);
setMwidth(width);
setMeasuredDimension(width, height);
}
private void measureScrapChild(RecyclerView.Recycler recycler, int position, int widthSpec,
int heightSpec, int[] measuredDimension) {
if (position < getItemCount()) {
try {
View view = recycler.getViewForPosition(0);//fix 动态添加时报IndexOutOfBoundsException
if (view != null) {
RecyclerView.LayoutParams p = (RecyclerView.LayoutParams) view.getLayoutParams();
int childWidthSpec = ViewGroup.getChildMeasureSpec(widthSpec,
getPaddingLeft() + getPaddingRight(), p.width);
int childHeightSpec = ViewGroup.getChildMeasureSpec(heightSpec,
getPaddingTop() + getPaddingBottom(), p.height);
view.measure(childWidthSpec, childHeightSpec);
measuredDimension[0] = view.getMeasuredWidth() + p.leftMargin + p.rightMargin;
measuredDimension[1] = view.getMeasuredHeight() + p.bottomMargin + p.topMargin;
recycler.recycleView(view);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
| [
"597698914@qq.com"
] | 597698914@qq.com |
097ec67eb1083c554e4b77616ca8efc762922ce1 | 1d928c3f90d4a0a9a3919a804597aa0a4aab19a3 | /java/neo4j/2017/4/GBPTreeIT.java | 57bc906228546c74cbd178615a6f361a44aea6ae | [] | no_license | rosoareslv/SED99 | d8b2ff5811e7f0ffc59be066a5a0349a92cbb845 | a062c118f12b93172e31e8ca115ce3f871b64461 | refs/heads/main | 2023-02-22T21:59:02.703005 | 2021-01-28T19:40:51 | 2021-01-28T19:40:51 | 306,497,459 | 1 | 1 | null | 2020-11-24T20:56:18 | 2020-10-23T01:18:07 | null | UTF-8 | Java | false | false | 8,239 | java | /*
* Copyright (c) 2002-2017 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.index.internal.gbptree;
import org.apache.commons.lang3.mutable.MutableLong;
import org.junit.After;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.RuleChain;
import java.io.IOException;
import java.util.Comparator;
import java.util.Map;
import java.util.Random;
import java.util.TreeMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import org.neo4j.cursor.RawCursor;
import org.neo4j.io.pagecache.IOLimiter;
import org.neo4j.io.pagecache.PageCache;
import org.neo4j.test.rule.PageCacheRule;
import org.neo4j.test.rule.RandomRule;
import org.neo4j.test.rule.TestDirectory;
import org.neo4j.test.rule.fs.DefaultFileSystemRule;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.junit.rules.RuleChain.outerRule;
import static org.neo4j.index.internal.gbptree.GBPTree.NO_HEADER;
import static org.neo4j.index.internal.gbptree.GBPTree.NO_MONITOR;
import static org.neo4j.test.rule.PageCacheRule.config;
public class GBPTreeIT
{
private final DefaultFileSystemRule fs = new DefaultFileSystemRule();
private final TestDirectory directory = TestDirectory.testDirectory( getClass(), fs.get() );
private final PageCacheRule pageCacheRule = new PageCacheRule();
private final RandomRule random = new RandomRule();
@Rule
public final RuleChain rules = outerRule( fs ).around( directory ).around( pageCacheRule ).around( random );
private final Layout<MutableLong,MutableLong> layout = new SimpleLongLayout();
private GBPTree<MutableLong,MutableLong> index;
private final ExecutorService threadPool = Executors.newFixedThreadPool( Runtime.getRuntime().availableProcessors() );
private PageCache pageCache;
private GBPTree<MutableLong,MutableLong> createIndex( int pageSize )
throws IOException
{
return createIndex( pageSize, NO_MONITOR );
}
private GBPTree<MutableLong,MutableLong> createIndex( int pageSize, GBPTree.Monitor monitor )
throws IOException
{
pageCache = pageCacheRule.getPageCache( fs.get(), config().withPageSize( pageSize ).withAccessChecks( true ) );
return index = new GBPTree<>( pageCache, directory.file( "index" ),
layout, 0/*use whatever page cache says*/, monitor, NO_HEADER );
}
@After
public void consistencyCheckAndClose() throws IOException
{
try
{
threadPool.shutdownNow();
index.consistencyCheck();
}
finally
{
index.close();
}
}
@Test
public void shouldStayCorrectAfterRandomModifications() throws Exception
{
// GIVEN
GBPTree<MutableLong,MutableLong> index = createIndex( 256 );
Comparator<MutableLong> keyComparator = layout;
Map<MutableLong,MutableLong> data = new TreeMap<>( keyComparator );
int count = 100;
int totalNumberOfRounds = 10;
for ( int i = 0; i < count; i++ )
{
data.put( randomKey( random.random() ), randomKey( random.random() ) );
}
// WHEN
try ( Writer<MutableLong,MutableLong> writer = index.writer() )
{
for ( Map.Entry<MutableLong,MutableLong> entry : data.entrySet() )
{
writer.put( entry.getKey(), entry.getValue() );
}
}
for ( int round = 0; round < totalNumberOfRounds; round++ )
{
// THEN
for ( int i = 0; i < count; i++ )
{
MutableLong first = randomKey( random.random() );
MutableLong second = randomKey( random.random() );
MutableLong from, to;
if ( first.longValue() < second.longValue() )
{
from = first;
to = second;
}
else
{
from = second;
to = first;
}
Map<MutableLong,MutableLong> expectedHits = expectedHits( data, from, to, keyComparator );
try ( RawCursor<Hit<MutableLong,MutableLong>,IOException> result = index.seek( from, to ) )
{
while ( result.next() )
{
MutableLong key = result.get().key();
if ( expectedHits.remove( key ) == null )
{
fail( "Unexpected hit " + key + " when searching for " + from + " - " + to );
}
assertTrue( keyComparator.compare( key, from ) >= 0 );
assertTrue( keyComparator.compare( key, to ) < 0 );
}
if ( !expectedHits.isEmpty() )
{
fail( "There were results which were expected to be returned, but weren't:" + expectedHits +
" when searching range " + from + " - " + to );
}
}
}
index.checkpoint( IOLimiter.unlimited() );
randomlyModifyIndex( index, data, random.random(), (double) round / totalNumberOfRounds );
}
}
private static void randomlyModifyIndex( GBPTree<MutableLong,MutableLong> index,
Map<MutableLong,MutableLong> data, Random random, double removeProbability ) throws IOException
{
int changeCount = random.nextInt( 10 ) + 10;
try ( Writer<MutableLong,MutableLong> writer = index.writer() )
{
for ( int i = 0; i < changeCount; i++ )
{
if ( random.nextDouble() < removeProbability && data.size() > 0 )
{ // remove
MutableLong key = randomKey( data, random );
MutableLong value = data.remove( key );
MutableLong removedValue = writer.remove( key );
assertEquals( "For " + key, value, removedValue );
}
else
{ // put
MutableLong key = randomKey( random );
MutableLong value = randomKey( random );
writer.put( key, value );
data.put( key, value );
}
}
}
}
private static Map<MutableLong,MutableLong> expectedHits( Map<MutableLong,MutableLong> data,
MutableLong from, MutableLong to, Comparator<MutableLong> comparator )
{
Map<MutableLong,MutableLong> hits = new TreeMap<>( comparator );
for ( Map.Entry<MutableLong,MutableLong> candidate : data.entrySet() )
{
if ( comparator.compare( candidate.getKey(), from ) >= 0 &&
comparator.compare( candidate.getKey(), to ) < 0 )
{
hits.put( candidate.getKey(), candidate.getValue() );
}
}
return hits;
}
private static MutableLong randomKey( Map<MutableLong,MutableLong> data, Random random )
{
MutableLong[] keys = data.keySet().toArray( new MutableLong[data.size()] );
return keys[random.nextInt( keys.length )];
}
private static MutableLong randomKey( Random random )
{
return new MutableLong( random.nextInt( 1_000 ) );
}
}
| [
"rodrigosoaresilva@gmail.com"
] | rodrigosoaresilva@gmail.com |
b5ffb15f6d1fabb03d6ccd2f6076137b00960b28 | a6c1355cf9f1ea5b316610ea4a763fd19e184d97 | /src/com/epam/training/onlineshop/controller/ShowOrdersServlet.java | 10572d00907db9a2689650bc016f2dd049a6d46f | [] | no_license | SidarenkaIhar/OnlineShop | 119ba36314cc2efe37abe4abeb086e8cd9a9dd1e | 9c231803ff8ecb7fef870bcca18261690ec90ec2 | refs/heads/master | 2020-05-29T09:50:08.390396 | 2019-07-04T17:31:50 | 2019-07-04T17:31:50 | 180,342,411 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,290 | java | package com.epam.training.onlineshop.controller;
import com.epam.training.onlineshop.dao.AbstractDAO;
import com.epam.training.onlineshop.dao.DAOFactory;
import com.epam.training.onlineshop.entity.order.Order;
import com.epam.training.onlineshop.utils.json.JsonDataPackage;
import com.epam.training.onlineshop.utils.json.OrderJsonDataPackage;
import com.google.gson.Gson;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.Locale;
import static com.epam.training.onlineshop.dao.DAOFactory.MYSQL;
import static com.epam.training.onlineshop.dao.DAOFactory.getDAOFactory;
/**
* The servlet is responsible for displaying and removing orders store
*
* @author Ihar Sidarenka
* @version 0.1 25-May-19
*/
@WebServlet(name = "ShowOrdersServlet", urlPatterns = "/showOrdersServlet")
public class ShowOrdersServlet extends ShowServlet<Order> {
/* Working with orders in database */
private AbstractDAO<Order> orderDAO;
public void init() {
DAOFactory mysqlFactory = getDAOFactory(MYSQL);
orderDAO = mysqlFactory.getOrderDAO();
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException {
Locale locale = LoginServlet.getUserLocale(request);
Gson gson = new Gson();
OrderJsonDataPackage requestJson = null;
BufferedReader br = new BufferedReader(new InputStreamReader(request.getInputStream(), StandardCharsets.UTF_8));
String json = br.readLine();
if (json != null) {
requestJson = gson.fromJson(json, OrderJsonDataPackage.class);
}
JsonDataPackage<Order> responseJson = getResponse(orderDAO, requestJson, locale);
String respJson = gson.toJson(responseJson);
response.setContentType("application/json");
response.setCharacterEncoding("UTF-8");
response.getWriter().write(respJson);
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
response.sendRedirect("/html/admin/orders.html");
}
}
| [
"sid157659623@gmail.com"
] | sid157659623@gmail.com |
5fe7815b33b6c3d0cfdf8543d7e7bcd247682c99 | 547c393b59ec2e1a4879c204cfb86ce47b60ec64 | /enterprise-spring-4.2.a.RELEASE/jms-solution/src/main/java/rewards/messaging/client/RewardConfirmationLogger.java | b68d7e21178f3c783732b53a3ed6df9d544d1791 | [] | no_license | vinodhkumarg/enterprise-spring | aa54868684fbb0ceff41b6fce6e07d324bedf901 | b1f6463416975db10b414c10166302fab952e16a | refs/heads/master | 2020-04-07T15:45:31.278330 | 2016-11-22T22:33:01 | 2016-11-22T22:33:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 940 | java | package rewards.messaging.client;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.jms.annotation.JmsListener;
import rewards.RewardConfirmation;
/**
* A simple logger for reward confirmations.
*/
public class RewardConfirmationLogger {
private static final Log logger = LogFactory.getLog(RewardConfirmationLogger.class);
private List<RewardConfirmation> confirmations = new ArrayList<RewardConfirmation>();
@JmsListener(destination="rewards.queue.confirmation")
public void log(RewardConfirmation rewardConfirmation) {
this.confirmations.add(rewardConfirmation);
if (logger.isInfoEnabled()) {
logger.info("received confirmation: " + rewardConfirmation);
}
}
public List<RewardConfirmation> getConfirmations() {
return Collections.unmodifiableList(confirmations);
}
}
| [
"sullivang@CAR03-03992.corp.monitise.net"
] | sullivang@CAR03-03992.corp.monitise.net |
29d7dfe4acdd259848dae8c8b6aa9f83f2349e74 | c8aa009fad341ac3840c00e72269b5cb306f8254 | /src/buildMap/Gui.java | 5fe1d5147fe5b6f9180c0b2fa0db3304dccf8463 | [] | no_license | jcarlos2289/TopoMap | aacde76a55debf6216f77d35f0d55199b38ce64f | 05d73fc67b943f262bd3daa9e1beff710453c3d6 | refs/heads/master | 2021-01-10T08:58:45.732159 | 2015-11-25T20:39:29 | 2015-11-25T20:39:29 | 44,687,743 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 24,476 | java | package buildMap;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.DateFormat;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.SimpleDateFormat;
//import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import javax.swing.BoxLayout;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JCheckBoxMenuItem;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.UIManager;
public class Gui extends JFrame implements ActionListener {
private static final long serialVersionUID = -7457350242559078527L;
private CanvasMap cm;
int width = 1000, height = 900;
JButton process, clusterbt, clusterCoefBt;
JCheckBox originalButton, graphButton, backButton, showNodes,clusters;
JTextField th1, th2, th3;
JComboBox<String> nodes;
double threshold1, threshold2;
int cutNode;
boolean original = true, showMap = true, background = true,
mapGenerated = false, nodesMode = false, selectNodeChanged = false, showCluster = false;
int selectedNode = -1;
BuildMap bm;
Kmeans km;
String name ;
JMenu jmOperations, jmShows;
JMenuItem jmiGetCluster, jmiGenCluster, jmiCapture, jmiGenMap;
JCheckBoxMenuItem originalCB, graphCB, backCB, showNodesCB, clustersCB;
public Gui() {
threshold1 = 0.022;
threshold2 = 0.049;
cutNode = 15;
bm = new BuildMap(threshold1, threshold2, cutNode);
//bm.readTags("/home/jcarlos2289/Documentos/tagsNewCollege/NewCollegePlaces_AlexNet/NewCollege_",0.000000001,8127,"output.data",205,1,2000000);
//name = "NewCollege_PlacesAlexNet";
//bm.readTags("/home/jcarlos2289/Documentos/tagsNewCollege/NewCollege_HybridAlexNet/NewCollege_",0.000000001,8127,"output.data",1183,1,2000000);
//name = "NewCollege_HybridAlexNet";
bm.readTags("/home/jcarlos2289/Documentos/tagsNewCollege/NewCollegeSeq1_HybridAlexNet/NewCollege_",0.000000001,1981,"/home/jcarlos2289/Documentos/tagsNewCollege/NewCollegeSeq1.data",1183,1,2000000);
name = "NewCollegeSeq1_HybridAlexNet";
// bm.readTags("/Users/miguel/Dropbox/Investigacion/Desarrollo/MapaTopologico/tagsNewCollege/NewCollegeTags/PanoStitchOutput_LisaNewCollegeNov3_");
//bm.readTags("/home/jcarlos2289/workspacejava/tagsNewCollege/NewCollegePlaces/NewCollege_",0.000000001,8127);
//bm.readTags("/home/jcarlos2289/Documentos/tagsNewCollege/NewCollegePlaces/NewCollege_",0.000000001);
//bm.readTags("/Users/miguel/Dropbox/Investigacion/Desarrollo/MapaTopologico/tagsNewCollege/NewCollegeTags/PanoStitchOutput_LisaNewCollegeNov3_");
//bm.readTags("/home/jcarlos2289/workspace/tagsNewCollege/NewCollegePlaces/NewCollege_",0.000000001);
//bm.readTags("/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Dumbo/dum_cloudy1/dum_cloudy1_Places/IDOL_DUMBO_Cl1_",-0.000000001,917,"IDOL_DUMBO_Cl1.txt",205);
//bm.readTags("/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Minnie/min_cloudy1/min_cloudy1_Places/IDOL_MINNIE_Cl1_",-0.000000001,915, "IDOL_MINNIE_Cl1.txt",205);
//name = "MinnieCl1_PlacesAlexNet";
//bm.readTags("/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Dumbo/dum_cloudy1/dum_cloudy1_ImageNet/IDOL_DUMBO_Cl1_",-0.000000001,917,"IDOL_DUMBO_Cl1.txt",1000);
//bm.readTags("/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Minnie/min_cloudy1/min_cloudy1_ImageNet/IDOL_MINNIE_Cl1_",-1.00,915, "IDOL_MINNIE_Cl1.txt",1000);
//name = "MinnieCl1_ImageNetCaffe";
//bm.readTags("/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Dumbo/dum_cloudy1/dum_cloudy1_Hybrid/IDOL_DUMBO_Cl1_",-0.000000001,917,"IDOL_DUMBO_Cl1.txt",1183);
//bm.readTags("/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Minnie/min_cloudy1/min_cloudy1_Hybrid/IDOL_MINNIE_Cl1_",-0.000000001,915, "IDOL_MINNIE_Cl1.txt",1183);
//name = "MinnieCl1_HybridAlexNet";
//bm.readTags("/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Minnie/min_cloudy1/min_cloudy1_ImageNetGoogleNet/IDOL_MINNIE_Cl1_",-0.000000001,915, "IDOL_MINNIE_Cl1.txt",1000);
// bm.readTags("/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Dumbo/dum_cloudy1/dum_cloudy1_ImageNetGoogleNet/IDOL_DUMBO_Cl1_",-0.000000001,917,"IDOL_DUMBO_Cl1.txt",1000);
//name = "DumboCl1_ImageNetGoogLeNet";
//bm.readTags("/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Minnie/min_cloudy1/min_cloudy1_ImageNetAlex/IDOL_MINNIE_Cl1_",-0.000000001,915, "IDOL_MINNIE_Cl1.txt",1000);
//bm.readTags("/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Dumbo/dum_cloudy1/dum_cloudy1_ImageNetAlex/IDOL_DUMBO_Cl1_",-0.000000001,917,"IDOL_DUMBO_Cl1.txt",1000);
//name = "MinnieCl1_ImageNetAlexNet";
//bm.readTags("/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Minnie/min_cloudy1/min_cloudy1_ImageNetRCNN/IDOL_MINNIE_Cl1_",-0.000000001,915, "IDOL_MINNIE_Cl1.txt",1000);
//bm.readTags("/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Dumbo/dum_cloudy1/dum_cloudy1_ImageNetRCNN/IDOL_DUMBO_Cl1_",-0.000000001,917,"IDOL_DUMBO_Cl1.txt",1000);
// name = "DumboCl1_ImageNetRCNN";
//bm.readTags("/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Minnie/min_cloudy1/min_cloudy1_ImageNetVGG/IDOL_MINNIE_Cl1_",-0.000000001,915, "IDOL_MINNIE_Cl1.txt",1000);
//bm.readTags("/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Dumbo/dum_cloudy1/dum_cloudy1_ImageNetVGG/IDOL_DUMBO_Cl1_",-0.000000001,917,"IDOL_DUMBO_Cl1.txt",1000);
//name = "DumboCl1_ImageNetVGG";
//bm.readTags("/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Minnie/min_cloudy1/min_cloudy1_ImageNetMerge/IDOL_MINNIE_Cl1_",-0.000000001,915, "IDOL_MINNIE_Cl1.txt",1000);
//bm.readTags("/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Dumbo/dum_cloudy1/dum_cloudy1_ImageNetMerge/IDOL_DUMBO_Cl1_",-0.000000001,917,"IDOL_DUMBO_Cl1.txt",1000);
//bm.readTags("/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Minnie/min_cloudy1/min_cloudy1_ImageNetSUM/IDOL_MINNIE_Cl1_",-0.000000001,915, "IDOL_MINNIE_Cl1.txt",1000);
//bm.readTags("/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Dumbo/dum_cloudy1/dum_cloudy1_ImageNetSUM/IDOL_DUMBO_Cl1_",-0.000000001,917,"IDOL_DUMBO_Cl1.txt",1000);
//bm.readTags("/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Minnie/min_cloudy1/min_cloudy1_ImageNetFusion/IDOL_MINNIE_Cl1_",-0.000000001,1830, "IDOL_MINNIE_Cl1_FUSION.txt",1000);
//------------------------------------------------Fusion
//CLOUDY
//bm.readTags("/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Minnie_Fusion/min_cloudy/min_cloudy_PlacesAlexNet/IDOL_MINNIE_Cl_",-0.000000001,3752, "/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Minnie_Fusion/min_cloudy/IDOL_MINNIE_Cl.txt",205);
//name = "MinnieCloudy_PlacesAlexNet";
//bm.readTags("/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Minnie_Fusion/min_cloudy/min_cloudy_ImageNetAlexNet/IDOL_MINNIE_Cl_",-0.000000001,3752, "/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Minnie_Fusion/min_cloudy/IDOL_MINNIE_Cl.txt",205);
//name = "MinnieCloudy_ImageNetAlexNet";
//bm.readTags("/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Minnie_Fusion/min_cloudy/min_cloudy_ImageNetCaffeNet/IDOL_MINNIE_Cl_",-0.000000001,3752, "/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Minnie_Fusion/min_cloudy/IDOL_MINNIE_Cl.txt",205);
//name = "MinnieCloudy_ImageNetCaffeNet";
//bm.readTags("/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Minnie_Fusion/min_cloudy/min_cloudy_ImageNetGoogLeNet/IDOL_MINNIE_Cl_",-0.000000001,3752, "/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Minnie_Fusion/min_cloudy/IDOL_MINNIE_Cl.txt",205);
//name = "MinnieCloudy_ImageNetGoogLeNet";
//bm.readTags("/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Minnie_Fusion/min_cloudy/min_cloudy_ImageNetVGG/IDOL_MINNIE_Cl_",-0.000000001,3752, "/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Minnie_Fusion/min_cloudy/IDOL_MINNIE_Cl.txt",205);
//name = "MinnieCloudy_ImageNetVGG";
//bm.readTags("/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Minnie_Fusion/min_cloudy/min_cloudy_HybridAlexNet/IDOL_MINNIE_Cl_",-0.000000001,3752, "/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Minnie_Fusion/min_cloudy/IDOL_MINNIE_Cl.txt",1183,5, 200000000);
//name = "MinnieCloudy_HybridAlexNet";
//Sunny
//bm.readTags("/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Minnie_Fusion/min_sunny/min_sunny_PlacesAlexNet/IDOL_MINNIE_Su_",-0.000000001,3606, "/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Minnie_Fusion/min_sunny/IDOL_MINNIE_Su.txt",205);
//name = "MinnieSunny_PlacesAlexNet";
//bm.readTags("/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Minnie_Fusion/min_sunny/min_sunny_ImageNetAlexNet/IDOL_MINNIE_Su_",-0.000000001,3606, "/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Minnie_Fusion/min_sunny/IDOL_MINNIE_Su.txt",205);
//name = "MinnieSunny_ImageNetAlexNet";
//bm.readTags("/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Minnie_Fusion/min_sunny/min_sunny_ImageNetCaffeNet/IDOL_MINNIE_Su_",-0.000000001,3606, "/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Minnie_Fusion/min_sunny/IDOL_MINNIE_Su.txt",205);
//name = "MinnieSunny_ImageNetCaffeNet";
//bm.readTags("/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Minnie_Fusion/min_sunny/min_sunny_ImageNetGoogLeNet/IDOL_MINNIE_Su_",-0.000000001,3606, "/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Minnie_Fusion/min_sunny/IDOL_MINNIE_Su.txt",205);
//name = "MinnieSunny_ImageNetGoogLeNet";
//bm.readTags("/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Minnie_Fusion/min_sunny/min_sunny_ImageNetVGG/IDOL_MINNIE_Su_",-0.000000001,3606, "/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Minnie_Fusion/min_sunny/IDOL_MINNIE_Su.txt",205);
//name = "MinnieSunny_ImageNetVGG";
//bm.readTags("/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Minnie_Fusion/min_sunny/min_sunny_HybridAlexNet/IDOL_MINNIE_Su_",-0.000000001,3606, "/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Minnie_Fusion/min_sunny/IDOL_MINNIE_Su.txt",1183);
//name = "MinnieSunny_HybridAlexNet";
//Night
//bm.readTags("/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Minnie_Fusion/min_night/min_night_PlacesAlexNet/IDOL_MINNIE_Ni_",-0.000000001,4005, "/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Minnie_Fusion/min_night/IDOL_MINNIE_Ni.txt",205,5, 200000000);
//name = "Minnienight_PlacesAlexNet";
//bm.readTags("/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Minnie_Fusion/min_night/min_night_ImageNetAlexNet/IDOL_MINNIE_Ni_",-0.000000001,4005, "/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Minnie_Fusion/min_night/IDOL_MINNIE_Ni.txt",205);
//name = "MinnieNight_ImageNetAlexNet";
//bm.readTags("/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Minnie_Fusion/min_night/min_night_ImageNetCaffeNet/IDOL_MINNIE_Ni_",-0.000000001,4005, "/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Minnie_Fusion/min_night/IDOL_MINNIE_Ni.txt",205);
//name = "MinnieNight_ImageNetCaffeNet";
//bm.readTags("/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Minnie_Fusion/min_night/min_night_ImageNetGoogLeNet/IDOL_MINNIE_Ni_",-0.000000001,4005, "/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Minnie_Fusion/min_night/IDOL_MINNIE_Ni.txt",205);
//name = "MinnieNight_ImageNetGoogLeNet";
//bm.readTags("/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Minnie_Fusion/min_night/min_night_ImageNetVGG/IDOL_MINNIE_Ni_",-0.000000001,4005, "/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Minnie_Fusion/min_night/IDOL_MINNIE_Ni.txt",205);
//name = "MinnieNight_ImageNetVGG";
//bm.readTags("/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Minnie_Fusion/min_night/min_night_HybridAlexNet/IDOL_MINNIE_Ni_",-0.000000001,4005, "/home/jcarlos2289/Descargas/KTH_IDOL/KTH_Minnie_Fusion/min_night/IDOL_MINNIE_Ni.txt",1183);
//name = "MinnieNight_HybridAlexNet";
getContentPane().setLayout(new BorderLayout());
setSize(width, height);
setTitle(name);
cm = new CanvasMap(this);
//setTitle("Topological Mapping");
getContentPane().add(cm, BorderLayout.CENTER);
getContentPane().add(getToolBar(), BorderLayout.NORTH);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setResizable(true);
}
public JPanel getToolBar() {
jmOperations = new JMenu();
//jmOperations.addActionListener(this);
jmOperations.setText("Operations");
jmiGenMap = new JMenuItem("Gen Map");
jmiGenMap.addActionListener(this);
jmOperations.add(jmiGenMap);
jmiGetCluster = new JMenuItem();
jmiGetCluster.setText("Get K Cluster");
jmiGetCluster.addActionListener(this);
jmOperations.add(jmiGetCluster);
jmiGenCluster = new JMenuItem();
jmiGenCluster.setText("Gen Cluster");
jmiGenCluster.addActionListener(this);
jmOperations.add(jmiGenCluster);
jmiCapture = new JMenuItem("Capture Screen");
jmiCapture.addActionListener(this);
jmiCapture.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_MASK));
jmOperations.add(jmiCapture);
jmShows = new JMenu("View");
originalCB= new javax.swing.JCheckBoxMenuItem("OriginalMap");
originalCB.setSelected(true);
originalCB.addActionListener(this);
graphCB = new javax.swing.JCheckBoxMenuItem("Graph");
graphCB.setSelected(true);
graphCB.setEnabled(mapGenerated);
backCB = new javax.swing.JCheckBoxMenuItem("Background Image");
backCB.setSelected(true);
backCB.addActionListener(this);
showNodesCB = new javax.swing.JCheckBoxMenuItem("Show Nodes");
showNodesCB.setSelected(false);
showNodesCB.setEnabled(false);
showNodesCB.addActionListener(this);
clustersCB =new JCheckBoxMenuItem("Clusters");
clustersCB.addActionListener(this);
clustersCB.setSelected(false);
clustersCB.setEnabled(false);
jmShows.add(originalCB);
jmShows.add(graphCB);
jmShows.add(backCB);
jmShows.add(showNodesCB);
jmShows.add(clustersCB);
//JPanel jp2 = new JPanel();
JMenuBar jMenuBar1 = new JMenuBar();
jMenuBar1.add(jmOperations);
jMenuBar1.add(jmShows);
this.setJMenuBar(jMenuBar1);
JPanel jp = new JPanel();
jp.setSize(width, 100);
jp.setLayout(new BoxLayout(jp, BoxLayout.LINE_AXIS));
jp.setAlignmentX(LEFT_ALIGNMENT);
process = new JButton("Gen Map");
process.addActionListener(this);
//jp.add(process);
clusterbt = new JButton("Gen Clus");
clusterbt.addActionListener(this);
//jp.add(clusterbt);
clusterCoefBt = new JButton("ClusCoef");
clusterCoefBt.addActionListener(this);
//jp.add(clusterCoefBt);
originalButton = new JCheckBox("Original Map");
originalButton.setSelected(true);
originalButton.addActionListener(this);
//jp.add(originalButton);
graphButton = new JCheckBox("Graph");
graphButton.setSelected(true);
graphButton.setEnabled(mapGenerated);
graphButton.addActionListener(this);
//jp.add(graphButton);
backButton = new JCheckBox("BackImage");
backButton.setSelected(true);
backButton.addActionListener(this);
//jp.add(backButton);
clusters = new JCheckBox("ShowCluster");
clusters.setSelected(false);
clusters.setEnabled(false);
clusters.addActionListener(this);
//jp.add(clusters);
JLabel lab1 = new JLabel("Threshold1");
jp.add(lab1);
th1 = new JTextField(String.valueOf(threshold1));
th1.addActionListener(this);
jp.add(th1);
JLabel lab2 = new JLabel("Threshold2");
jp.add(lab2);
th2 = new JTextField(String.valueOf(threshold2));
th2.addActionListener(this);
jp.add(th2);
JLabel lab3 = new JLabel("CutNode");
jp.add(lab3);
th3 = new JTextField(String.valueOf(cutNode));
th3.addActionListener(this);
jp.add(th3);
showNodes = new JCheckBox("ShowNodes");
showNodes.setSelected(false);
showNodes.setEnabled(false);
showNodes.addActionListener(this);
//jp.add(showNodes);
String[] aux = {"Select Node"};
nodes = new JComboBox<String>(aux);
nodes.addActionListener(this);
nodes.setEnabled(nodesMode);
jp.add(nodes);
return jp;
}
public void genComboNodes() {
int size = bm.map.nodes.size();
String[] aux = new String[size + 1];
aux[0] = "Select Node";
for (int i = 1; i < size + 1; i++) {
aux[i] = String.valueOf(i - 1) + " "
+ bm.map.getNode(i - 1).getSize();
}
nodes.setModel(new DefaultComboBoxModel<String>(aux));
nodes.setSelectedIndex(0);
//Imprimir lista de nodos
/*String lst = "";
for (int i = 0; i < aux.length; i++) {
lst += aux[i] + "\n";
}*/
// FileMethods.saveFile(lst, "NodeList", false);
}
public static void main(String[] args) {
Gui g = new Gui();
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {
e.printStackTrace();
}
g.setVisible(true);
g.toFront();
String DATARESUME ;
/*if (true)
DATARESUME="Th1;Th2;CN;Nodes;Edges;Metric\n";
else
DATARESUME="";*/
float incremento = (float) 0.002;
float th1 = (float) 0.002;
float th2 = (float) 0.01;
int vuelta=1;
//DecimalFormatSymbols simbolos;
// Each tag contains a name and probability assigned to it by the recognition engine.
//System.out.println(String.format(" %s (%.4f)", tag.getName(), tag.getProbability()));
DecimalFormatSymbols simbol = new DecimalFormatSymbols();
simbol.setDecimalSeparator('.');
DecimalFormat formateador = new DecimalFormat("####.######", simbol);
for (int i = 0; i <15; i++) {
for (int j = 0; j <2; j++) {
g.bm.setThreshold1(th1);
g.bm.setThreshold2(th2);
g.bm.buildMap();
System.out.printf("i= %d\tj= %d\t Ciclo= %d\t th1= %.4f\t th2= %.4f\n", i,j,vuelta, th1, th2);
th1+=incremento;
//String.format("%,6f",g.bm.threshold1)
float metric = g.bm.map.getMapMetric(g.cm.MaxDistance());
DATARESUME=formateador.format(g.bm.threshold1)+ ";"
+ formateador.format(g.bm.threshold2)+ ";"
+g.bm.cutNode+ ";"+g.bm.map.nodes.size()+ ";"
+g.bm.map.edges.size()+ ";"
+g.bm.map.coefA+ ";"
+g.bm.map.coefB+ ";"
+g.bm.map.coefC+ ";"
+g.bm.map.coefD+ ";"
+g.bm.map.coefE+ ";"
+metric+"\n";
FileMethods.saveFile(DATARESUME, g.name+"_MetricsData", true);
//System.out.printf("i= %d\tj= %d\t Ciclo= %d\n", i,j,vuelta);
++vuelta;
}
th2+=0.001;
th1=(float) 0.002;
}
g.setVisible(false);
g.dispose();
/*
System.out.println("Width-X= "+g.cm.getMaxWidth());
System.out.println("Heigth-Y= "+g.cm.getMaxHeight());
System.out.println("DMAX= " +g.cm.MaxDistance());
g.dispose();
*/
}
public void actionPerformed(ActionEvent e) {
if (e.getSource() == process) {
graphButton.setEnabled(false);
showNodes.setEnabled(false);
bm.buildMap();
graphButton.setEnabled(true);
showNodes.setEnabled(true);
genComboNodes();
mapGenerated = true;
cm.repaint();
cm.showNodeDetails();
cm.showMapInfo();
String DATARESUME ="Th1;Th2;CN;Nodes;Edges;Metric\n";
float metric = bm.map.getMapMetric(cm.MaxDistance());
DATARESUME+=bm.threshold1+ ";"+ bm.threshold2+ ";"+bm.cutNode+ ";"+bm.map.nodes.size()+ ";"+bm.map.edges.size()+ ";"+metric+"\n";
FileMethods.saveFile(DATARESUME, name+"_MetricsData", true);
return;
}
if (e.getSource() == clusterbt) {
// Kmeans
int k =Integer.parseInt( JOptionPane.showInputDialog("How many clusters?","4"));
km= new Kmeans(k, bm.dimension, bm.imgTags);
km.findMeans();
//mapGenerated = false;
showCluster=true;
clusters.setEnabled(true);
clusters.setSelected(true);
cm.repaint();
return;
}
if (e.getSource() == clusterCoefBt) {
Kmeans km2;
km2 = new Kmeans(1,bm.dimension, bm.imgTags);
ArrayList<Float> coef = new ArrayList<Float>();
int k=1;
if(k==1)
FileMethods.saveFile("K;s2\n", "K_Variances_"+name, false);
do {
km2.setK(k);
Float coefValue =km2.findMeansCoef();
coef.add(coefValue);
FileMethods.saveFile(String.valueOf(k)+";"+String.valueOf(coefValue)+"\n", "K_Variances_"+name, true);
++k;
if ((k%100)==0) System.out.println("K="+k);
}
while(k<=800);
/*
try {
DrawLineChart.viewChart(coef,name);
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
*/
return;
}
if (e.getSource() == originalButton) {
//showCluster = false;
original = originalButton.isSelected();
cm.repaint();
return;
}
if (e.getSource() == graphButton) {
showMap = graphButton.isSelected();
cm.repaint();
return;
}
if (e.getSource() == backButton) {
background = backButton.isSelected();
cm.repaint();
return;
}
if (e.getSource() == clusters) {
showCluster = clusters.isSelected();
cm.repaint();
return;
}
if (e.getSource() == th1) {
threshold1 = Double.parseDouble(th1.getText());
bm.setThreshold1(threshold1);
cm.repaint();
return;
}
if (e.getSource() == th2) {
threshold2 = Double.parseDouble(th2.getText());
bm.setThreshold2(threshold2);
cm.repaint();
return;
}
if (e.getSource() == th3) {
System.out.println(th3.getText());
bm.setCutNode(Integer.parseInt(th3.getText()));
if (bm.map != null)
bm.map.setWeights(Integer.parseInt(th3.getText()));
cm.repaint();
return;
}
if (e.getSource() == showNodes) {
nodesMode = showNodes.isSelected();
selectedNode = -1;
nodes.setEnabled(true);
cm.repaint();
return;
}
if (e.getSource() == nodes) {
if (((String) nodes.getSelectedItem()).equals("Select Node")) {
selectedNode = -1;
} else {
selectedNode = Integer.valueOf(
((String) nodes.getSelectedItem()).split(" ")[0]);
selectNodeChanged = true;
cm.repaint();
}
return;
}
if (e.getSource() == originalCB) {
original = originalCB.isSelected();
cm.repaint();
return;
}
if (e.getSource() == graphCB) {
showMap = graphCB.isSelected();
cm.repaint();
return;
}
if (e.getSource() == backCB) {
background = backCB.isSelected();
cm.repaint();
return;
}
if (e.getSource() == showNodesCB) {
nodesMode = showNodesCB.isSelected();
selectedNode = -1;
nodes.setEnabled(true);
cm.repaint();
return;
}
if (e.getSource() == clustersCB) {
showCluster = clustersCB.isSelected();
cm.repaint();
return;
}
if (e.getSource() == jmiGenMap) {
graphCB.setEnabled(false);
showNodesCB.setEnabled(false);
bm.buildMap();
graphCB.setEnabled(true);
showNodesCB.setEnabled(true);
genComboNodes();
mapGenerated = true;
cm.repaint();
cm.showNodeDetails();
cm.showMapInfo();
return;
}
if (e.getSource() == jmiCapture) {
Date date = new Date();
DateFormat hourdateFormat = new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss");
String imgName = name+"_"+bm.threshold1+"_"+bm.threshold2+"_"+hourdateFormat.format(date);
cm.createImage(imgName);
return;
}
if (e.getSource() == jmiGenCluster) {
// Kmeans
int k =Integer.parseInt( JOptionPane.showInputDialog("How many clusters?","4"));
km= new Kmeans(k, bm.dimension, bm.imgTags);
km.findMeans();
//mapGenerated = false;
showCluster=true;
clustersCB.setEnabled(true);
clustersCB.setSelected(true);
cm.repaint();
return;
}
if (e.getSource() == jmiGetCluster) {
Kmeans km2;
km2 = new Kmeans(1,bm.dimension, bm.imgTags);
ArrayList<Float> coef = new ArrayList<Float>();
int k=1;
if(k==1)
FileMethods.saveFile("K;s2\n", "K_Variances_"+name, false);
do {
km2.setK(k);
Float coefValue =km2.findMeansCoef();
coef.add(coefValue);
FileMethods.saveFile(String.valueOf(k)+";"+String.valueOf(coefValue)+"\n", "K_Variances_"+name, true);
++k;
if ((k%100)==0) System.out.println("K="+k);
}
while(k<=800);
return;
}
}
}
| [
"jockrlos2289@gmail.com"
] | jockrlos2289@gmail.com |
d351a3d618a9b3d9fdd7349c2c24ff619e4c3fe9 | 0bcceee7140c5ec7f03199798d1db643fdc5b6e3 | /src/Git_Holecek_Keles_Kogler/LightsOutLogic.java | 22a0fbb21c9132e1004ccfb06806e4a597968f18 | [] | no_license | williamholecek/Git_Holecek_Keles_Kogler | fba3179015d97ec8b7443877b8ea7e829ac8076a | 84e2112990ec79428a20d7df1f1f67a0df9dd185 | refs/heads/master | 2021-01-01T05:34:50.388295 | 2014-12-11T15:38:36 | 2014-12-11T15:38:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 68 | java | package Git_Holecek_Keles_Kogler;
public class LightsOutLogic {
}
| [
"pkogler@student.tgm.ac.at"
] | pkogler@student.tgm.ac.at |
d03087987ba633ece263f67a362b6023cfe602ee | cbc61ffb33570a1bc55bb1e754510192b0366de2 | /ole-app/olefs/src/main/java/org/kuali/ole/gl/batch/service/BalanceCalculator.java | 712364e8dfc12bc59524bcc8d2cb8d623147967c | [
"ECL-2.0"
] | permissive | VU-libtech/OLE-INST | 42b3656d145a50deeb22f496f6f430f1d55283cb | 9f5efae4dfaf810fa671c6ac6670a6051303b43d | refs/heads/master | 2021-07-08T11:01:19.692655 | 2015-05-15T14:40:50 | 2015-05-15T14:40:50 | 24,459,494 | 1 | 0 | ECL-2.0 | 2021-04-26T17:01:11 | 2014-09-25T13:40:33 | Java | UTF-8 | Java | false | false | 1,552 | java | /*
* Copyright 2006 The Kuali Foundation
*
* Licensed under the Educational Community 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.opensource.org/licenses/ecl2.php
*
* 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.kuali.ole.gl.batch.service;
import java.util.Collection;
import org.kuali.ole.gl.businessobject.Balance;
import org.kuali.ole.gl.businessobject.Transaction;
/**
* This interface declares methods needed for posting transactions to the appropriate balance records.
*/
public interface BalanceCalculator {
/**
* Given a collection of balance records, returns the balance that the given transaction would post to
* or creates a new balance record
*
* @param balanceList a Collection of balance records
* @param t the transaction to post
* @return the balance to post against
*/
public Balance findBalance(Collection balanceList, Transaction t);
/**
* Updates the balance based on the given transaction
*
* @param t the transaction to post
* @param b the balance being posted against
*/
public void updateBalance(Transaction t, Balance b);
}
| [
"david.lacy@villanova.edu"
] | david.lacy@villanova.edu |
d83c8fe4895978429cad9bf55d2050b5898f126f | 574afb819e32be88d299835d42c067d923f177b0 | /src/net/minecraft/advancements/critereon/ConsumeItemTrigger.java | 404051340302712d846fdfc0105c78603f21e6db | [] | no_license | SleepyKolosLolya/WintWare-Before-Zamorozka | 7a474afff4d72be355e7a46a38eb32376c79ee76 | 43bff58176ec7422e826eeaf3ab8e868a0552c56 | refs/heads/master | 2022-07-30T04:20:18.063917 | 2021-04-25T18:16:01 | 2021-04-25T18:16:01 | 361,502,972 | 6 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,815 | java | package net.minecraft.advancements.critereon;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonObject;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import net.minecraft.advancements.ICriterionTrigger;
import net.minecraft.advancements.PlayerAdvancements;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
public class ConsumeItemTrigger implements ICriterionTrigger<ConsumeItemTrigger.Instance> {
private static final ResourceLocation field_193149_a = new ResourceLocation("consume_item");
private final Map<PlayerAdvancements, ConsumeItemTrigger.Listeners> field_193150_b = Maps.newHashMap();
public ResourceLocation func_192163_a() {
return field_193149_a;
}
public void func_192165_a(PlayerAdvancements p_192165_1_, ICriterionTrigger.Listener<ConsumeItemTrigger.Instance> p_192165_2_) {
ConsumeItemTrigger.Listeners consumeitemtrigger$listeners = (ConsumeItemTrigger.Listeners)this.field_193150_b.get(p_192165_1_);
if (consumeitemtrigger$listeners == null) {
consumeitemtrigger$listeners = new ConsumeItemTrigger.Listeners(p_192165_1_);
this.field_193150_b.put(p_192165_1_, consumeitemtrigger$listeners);
}
consumeitemtrigger$listeners.func_193239_a(p_192165_2_);
}
public void func_192164_b(PlayerAdvancements p_192164_1_, ICriterionTrigger.Listener<ConsumeItemTrigger.Instance> p_192164_2_) {
ConsumeItemTrigger.Listeners consumeitemtrigger$listeners = (ConsumeItemTrigger.Listeners)this.field_193150_b.get(p_192164_1_);
if (consumeitemtrigger$listeners != null) {
consumeitemtrigger$listeners.func_193237_b(p_192164_2_);
if (consumeitemtrigger$listeners.func_193238_a()) {
this.field_193150_b.remove(p_192164_1_);
}
}
}
public void func_192167_a(PlayerAdvancements p_192167_1_) {
this.field_193150_b.remove(p_192167_1_);
}
public ConsumeItemTrigger.Instance func_192166_a(JsonObject p_192166_1_, JsonDeserializationContext p_192166_2_) {
ItemPredicate itempredicate = ItemPredicate.func_192492_a(p_192166_1_.get("item"));
return new ConsumeItemTrigger.Instance(itempredicate);
}
public void func_193148_a(EntityPlayerMP p_193148_1_, ItemStack p_193148_2_) {
ConsumeItemTrigger.Listeners consumeitemtrigger$listeners = (ConsumeItemTrigger.Listeners)this.field_193150_b.get(p_193148_1_.func_192039_O());
if (consumeitemtrigger$listeners != null) {
consumeitemtrigger$listeners.func_193240_a(p_193148_2_);
}
}
static class Listeners {
private final PlayerAdvancements field_193241_a;
private final Set<ICriterionTrigger.Listener<ConsumeItemTrigger.Instance>> field_193242_b = Sets.newHashSet();
public Listeners(PlayerAdvancements p_i47563_1_) {
this.field_193241_a = p_i47563_1_;
}
public boolean func_193238_a() {
return this.field_193242_b.isEmpty();
}
public void func_193239_a(ICriterionTrigger.Listener<ConsumeItemTrigger.Instance> p_193239_1_) {
this.field_193242_b.add(p_193239_1_);
}
public void func_193237_b(ICriterionTrigger.Listener<ConsumeItemTrigger.Instance> p_193237_1_) {
this.field_193242_b.remove(p_193237_1_);
}
public void func_193240_a(ItemStack p_193240_1_) {
List<ICriterionTrigger.Listener<ConsumeItemTrigger.Instance>> list = null;
Iterator var3 = this.field_193242_b.iterator();
ICriterionTrigger.Listener listener1;
while(var3.hasNext()) {
listener1 = (ICriterionTrigger.Listener)var3.next();
if (((ConsumeItemTrigger.Instance)listener1.func_192158_a()).func_193193_a(p_193240_1_)) {
if (list == null) {
list = Lists.newArrayList();
}
list.add(listener1);
}
}
if (list != null) {
var3 = list.iterator();
while(var3.hasNext()) {
listener1 = (ICriterionTrigger.Listener)var3.next();
listener1.func_192159_a(this.field_193241_a);
}
}
}
}
public static class Instance extends AbstractCriterionInstance {
private final ItemPredicate field_193194_a;
public Instance(ItemPredicate p_i47562_1_) {
super(ConsumeItemTrigger.field_193149_a);
this.field_193194_a = p_i47562_1_;
}
public boolean func_193193_a(ItemStack p_193193_1_) {
return this.field_193194_a.func_192493_a(p_193193_1_);
}
}
}
| [
"ask.neverhide@gmail.com"
] | ask.neverhide@gmail.com |
7ba93d7a6d6be38caa0b68d8c1756d88c33a11a6 | 6c91bdda01f712a830e63138be37f08c7bbfce4c | /com.io7m.jnoisetype.writer.api/src/main/java/com/io7m/jnoisetype/writer/api/NTInstrumentWriterZoneDescriptionType.java | ba0dead1512d38235c68783e4460a08df109f00d | [
"ISC"
] | permissive | io7m/jnoisetype | bdd40587527aacfa759a2614809c57078aebd3ef | 0cbe1063961b6ea5fb24f640020898fca45e216d | refs/heads/master | 2023-08-19T22:41:19.146622 | 2022-04-09T21:12:05 | 2022-04-09T21:12:05 | 172,563,997 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,356 | java | /*
* Copyright © 2019 Mark Raynsford <code@io7m.com> https://www.io7m.com
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
package com.io7m.jnoisetype.writer.api;
import com.io7m.immutables.styles.ImmutablesStyleType;
import org.immutables.value.Value;
import java.util.List;
/**
* The description of an instrument consumed by a writer.
*/
@ImmutablesStyleType
@Value.Immutable
public interface NTInstrumentWriterZoneDescriptionType
{
/**
* @return The zone generators
*/
List<NTInstrumentWriterZoneGeneratorDescription> generators();
/**
* @return The zone modulators
*/
List<NTInstrumentWriterZoneModulatorDescription> modulators();
}
| [
"code@io7m.com"
] | code@io7m.com |
60086e228e146f961d6a113808d5312834b5ae42 | bd8d90dac229dddea0c8a4256cb13291084c880d | /A7/NotExtended.java | 929060e1510569297374b759c2f45d4f8b4f650c | [] | no_license | PuranjaySharma/javacodes | 265ed0e7656855e257f36b7f17164450a9850d6f | ff1af58f61a9ef60fe77c1d47dbb997d374b2680 | refs/heads/master | 2021-07-05T07:08:59.101321 | 2020-08-05T10:21:20 | 2020-08-05T10:21:20 | 146,789,719 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 138 | java | final class finalClass
{
}
class Derived
{
}
public class NotExtended
{
public static void main(String[] x)
{
}
} | [
"noreply@github.com"
] | noreply@github.com |
27cf17848619c69315bea6dd6f4ab603032fac27 | f6ecfe2dded201449b8cf8d12e770487205db4c9 | /Enhance_02(객체 설계)/src/model/Bomb.java | bfb059cfdab46fb47372a2514f555fd705298aff | [] | no_license | yunkangmin/project | e292c10066eefafa99bbb92735e8477340623ba9 | cc183a445844576d6fdb04adf6fc6ec3c248a1b2 | refs/heads/master | 2021-08-20T03:21:41.371499 | 2017-11-28T03:59:47 | 2017-11-28T03:59:47 | 112,186,261 | 0 | 0 | null | null | null | null | UHC | Java | false | false | 1,693 | java | package model;
public class Bomb {
//Bomb 관련 기능인것 같긴 한데, instance용 메서드는 아닌거 같고,
//class를 새로 설계해서 만들 필요까지는 없을것 같고,
//유효한 사거리인지 아닌지 체크
public static boolean checkValid(Bomb t) {
return t.radius>0;
}
public boolean isValid() {
return radius>0;
}
int x;
int y;
int radius;
Bomb(int a, int b) {
x = a;
y = b;
radius = 1;
}
Bomb(int a, int b, int c) {
x = a;
y = b;
radius = c;
}
public String toJson() {// 제이슨 형태로 출력되게
return "{\"x\":\"" + x + "\",\"y\":" + y + ",\"radius\":" + radius + "}";
}
boolean contains(int x, int y) {
// 폭탄반경에 해당 전달된 x,y가 포함되어 있는지 확인
// (원이나 사각형으로 계산, 경계선 미포함)
// JSON어느언어나 호환되는 형식언어
// 몽고디비 nosql
// return this.x-radius<=x&&x+radius>=x&&this.y-radius<=y&&y+radius>=y;
if (rangeTo(x, y) < radius)
return true;// return이 사용되는 즉시 메소드가 종료된다.
return false;
}
double damageTo(int x, int y) {
// 전달된 x,y에 입힐 데미지퍼센트
/*
* if(contains(x,y)) return ((radius-rangeTo(x,y))/radius)*100;
*
* else return 0.0;
*/ double r = rangeTo(x, y);
if (r > radius)//경계선을 포함을 안해야 그자리에서 부터 +2칸 -2칸영역이 확보된다.
return 0;
else
// range 0=100, range=radius :0, r=?
return 1-r/radius;
// 100 - (r / radius * 100);
}
double rangeTo(int tx, int ty) {
// 전달된 x,y까지의 거리를 계산
double t = Math.pow(x - tx, 2) + Math.pow(y - ty, 2);
return Math.sqrt(t);
}
}
| [
"1103-8@1103-8-PC"
] | 1103-8@1103-8-PC |
db8404240e6e5787c8930db5359a8a8576707c55 | 8ba531d6a9cf52d4020762aaf4e79cf527083768 | /src/TreeCountUnivalSubTree.java | daaf42c89e324937e539c11bd3ed647ea4111e05 | [] | no_license | sswaminathanart/Java | 5d46fff5cf70e09f0b73c624587693e74b61622c | f1a5c79235c02afb57f6805f61d34e7871e02772 | refs/heads/master | 2020-03-27T18:24:26.413755 | 2018-09-25T02:13:05 | 2018-09-25T02:13:05 | 146,920,417 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,053 | java | public class TreeCountUnivalSubTree {
public static void main(String args[]) {
Node root = new Node(15);
root.left = new Node(25);
root.right = new Node(57);
root.left.left = new Node(25);
root.left.right = new Node(25);
root.right.right = new Node(15);
int[] cc = {0};
univalCount(root,cc);
System.out.println(cc[0]);
}
static boolean univalCount(Node root,int[] count){
if(root== null) return true;
boolean left =univalCount(root.left,count);
boolean right= univalCount(root.right,count);
if(right==false || left== false) return false;
if(root.right != null && root.data != root.right.data) return false;
if(root.left != null && root.data != root.left.data) return false;
count[0]++;
return true;
}
static class Node {
int data;
Node left;
Node right;
Node(int d) {
data = d;
}
}
static class Count{
int c = 0;
}
}
| [
"sswaminathan@art.com"
] | sswaminathan@art.com |
a0dbccf967cbaa0bc98ee8c71f468010d002950b | f30d49642d0aacbab53177a4617ebbb5f33d8c94 | /src/net/frapu/code/visualization/bpmn/IntermediateEvent.java | 203eadfbb7a4750e8bfe21830f7d319b653a14db | [
"Apache-2.0"
] | permissive | frapu78/processeditor | 393892ab855ff4dbc83cc320279315a1c2789a8c | 2e317a17308f5958d35c2b7cecb3e86d06a1b9c1 | refs/heads/master | 2023-08-09T23:26:22.035014 | 2023-07-24T16:06:11 | 2023-07-24T16:06:11 | 20,647,096 | 5 | 6 | null | 2015-03-24T16:31:59 | 2014-06-09T13:18:37 | Java | UTF-8 | Java | false | false | 5,314 | java | /**
*
* Process Editor - BPMN Package
*
* (C) 2008,2009 Frank Puhlmann
*
* http://frapu.net
*
*/
package net.frapu.code.visualization.bpmn;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.geom.Ellipse2D;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import net.frapu.code.visualization.AttachedNode;
import net.frapu.code.visualization.editors.BooleanPropertyEditor;
import net.frapu.code.visualization.editors.ListSelectionPropertyEditor;
import net.frapu.code.visualization.ProcessModel;
import net.frapu.code.visualization.ProcessNode;
import net.frapu.code.visualization.ProcessObject;
/**
*
* @author fpu
*/
public class IntermediateEvent extends Event implements AttachedNode {
/** The sub-type of the event. Possible values are "Catching" or "Throwing" **/
public final static String PROP_EVENT_SUBTYPE = "event_subtype";
/** Catching Intermediate Event */
public final static String EVENT_SUBTYPE_CATCHING = "Catching";
/** Throwing Intermediate Event */
public final static String EVENT_SUBTYPE_THROWING = "Throwing";
/** The interruption type of the event. Possible values are "0" or "Throwing" **/
public final static String PROP_NON_INTERRUPTING = "non_interupting";
public final static String EVENT_NON_INTERRUPTING_FALSE = "0";
public final static String EVENT_NON_INTERRUPTING_TRUE = "1";
/** The parent node */
public final static String PROP_SOURCE_NODE = "#source";
private boolean isThrowable = false;
public IntermediateEvent() {
super();
initializeProperties();
}
public IntermediateEvent(int x, int y, String label) {
super();
setPos(x, y);
setText(label);
initializeProperties();
}
protected void initializeProperties() {
setProperty(PROP_EVENT_SUBTYPE, EVENT_SUBTYPE_CATCHING);
String[] subtype = { EVENT_SUBTYPE_CATCHING , EVENT_SUBTYPE_THROWING };
setPropertyEditor(PROP_EVENT_SUBTYPE, new ListSelectionPropertyEditor(subtype));
setProperty(PROP_NON_INTERRUPTING, EVENT_NON_INTERRUPTING_FALSE);
setPropertyEditor(PROP_NON_INTERRUPTING, new BooleanPropertyEditor());
setProperty(PROP_SOURCE_NODE, "");
}
/**
* tells you whether this intermediate event can be set to a throwing state or not
* @return
*/
public boolean isThrowable() {
return isThrowable;
}
public void setThrowable(boolean value) {
isThrowable = value;
}
@Override
/**
* overriding handling of throwable/catching
*/
public void setProperty(String key, String value) {
if(key.equals(PROP_EVENT_SUBTYPE) && !isThrowable) {
super.setProperty(PROP_EVENT_SUBTYPE, EVENT_SUBTYPE_CATCHING);
}else {
super.setProperty(key, value);
}
}
@Override
public void paintInternal(Graphics g) {
Graphics2D g2 = (Graphics2D) g;
// Draw intermediate event
if (getProperty(PROP_NON_INTERRUPTING).toLowerCase().equals(EVENT_NON_INTERRUPTING_TRUE)) {
g2.setStroke(BPMNUtils.longDashedStroke);
} else {
g2.setStroke(BPMNUtils.defaultStroke);
}
drawEventBasicShape(g2);
// Call stub
drawMarker(g2);
Ellipse2D outline = new Ellipse2D.Double(getPos().x - (getSize().width / 2) + 3,
getPos().y - (getSize().width / 2) + 3, getSize().width - 6, getSize().width - 6);
g2.setColor(Color.BLACK);
g2.draw(outline);
}
/**
*
* @param g2
*/
protected void drawMarker(Graphics2D g2) {
// Just a stub here...
}
@Override
public List<Class<? extends ProcessNode>> getVariants() {
List<Class<? extends ProcessNode>> result = new LinkedList<Class<? extends ProcessNode>>();
result.add(IntermediateEvent.class);
result.add(MessageIntermediateEvent.class);
result.add(TimerIntermediateEvent.class);
result.add(ErrorIntermediateEvent.class);
result.add(EscalationIntermediateEvent.class);
result.add(CancelIntermediateEvent.class);
result.add(CompensationIntermediateEvent.class);
result.add(ConditionalIntermediateEvent.class);
result.add(LinkIntermediateEvent.class);
result.add(SignalIntermediateEvent.class);
result.add(MultipleIntermediateEvent.class);
result.add(ParallelMultipleIntermediateEvent.class);
return result;
}
public ProcessNode getParentNode(ProcessModel model) {
return model.getNodeById(getProperty(PROP_SOURCE_NODE));
}
@Override
protected void handleCloning(Map<String, String> localIdMap) {
setProperty(PROP_SOURCE_NODE, localIdMap.get(this.getProperty(PROP_SOURCE_NODE)));
}
public void setParentNode(ProcessNode node) {
String id = "";
if (node!=null) id = node.getProperty(ProcessObject.PROP_ID);
setProperty(PROP_SOURCE_NODE, id==null?"":id);
}
public String getParentNodeId() {
String result = getProperty(PROP_SOURCE_NODE);
return result;
}
public String toString() {
return "Intermediate Event ("+getText()+")";
}
}
| [
"frank@frapu.de"
] | frank@frapu.de |
d1c9fb322f95384b4e269b9f8db40bc477ac968b | 6fc1240c9ae2a7b3d8eead384668e1f4b58d47da | /workshops/contrerasi/unit3/WS28-SortingAlgorithms/SortingAlgorithms/src/ec/edu/espe/view/SortingAlgorithms.java | 48842af98e997f2643d70d3787697c2cfbf0869e | [] | no_license | elascano/ESPE202105-OOP-TC-3730 | 38028e870d4de004cbbdf82fc5f8578126f8ca32 | 4275a03d410cf6f1929b1794301823e990fa0ef4 | refs/heads/main | 2023-08-09T13:24:26.898865 | 2021-09-13T17:08:10 | 2021-09-13T17:08:10 | 371,089,640 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 847 | 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 ec.edu.espe.view;
import ec.edu.espe.controller.SortingContext;
/**
*
* @author Ian Contreras ESPE-DCCO
*/
public class SortingAlgorithms {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
SortingContext sortingContext = new SortingContext();
int data[] = {3,5,6,7};
int sortedList[] = sortingContext.sort(data);
int data2[] = {3,5,6,7,5,7};
sortingContext.sort(data2);
int data3[] = {3,5,6,7,5,7, 10, 12, 34, 45, 12 ,23};
sortingContext.sort(data3);
}
}
| [
"iancontre09@gmail.com"
] | iancontre09@gmail.com |
9975141995a27d83d3bb3c1f747f153aac513935 | dc5e14947d62e7ba284ab598c3ce912088726fdf | /create/src/builderpattern/BuilderClient.java | 0b20d26d27d2d602e09efc588f860e094eff8702 | [] | no_license | GL168/demo-designPatterns | 512431e66ffeffa4a7ceaf6243dd87a696dd70b6 | 1d498dea54231cc81666796bef500aac72b20e0c | refs/heads/main | 2023-07-19T15:40:43.472594 | 2021-09-03T05:40:22 | 2021-09-03T05:40:22 | 395,496,838 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,538 | java | package builderpattern;
/**
* 建造者模式
* 产品角色(Product):它是包含多个组成部件的复杂对象,由具体建造者来创建其各个零部件。
* 抽象建造者(Builder):它是一个包含创建产品各个子部件的抽象方法的接口,通常还包含一个返回复杂产品的方法 getResult()。
* 具体建造者(Concrete Builder):实现 Builder 接口,完成复杂产品的各个部件的具体创建方法。
* 指挥者(Director):它调用建造者对象中的部件构造与装配方法完成复杂对象的创建,在指挥者中不涉及具体产品的信息。
*
* @author gulin
* @date 2021/9/2 14:07
*/
public class BuilderClient {
public static void main(String[] args) {
Builder builder = new ConcreteBuilder();
Director director = new Director(builder);
Product product = director.construct();
product.show();
}
}
//产品角色 包含多个组成部件的复杂对象
class Product {
private String partA;
private String partB;
private String partC;
public void setPartA(String partA) {
this.partA = partA;
}
public void setPartB(String partB) {
this.partB = partB;
}
public void setPartC(String partC) {
this.partC = partC;
}
public void show() {
//显示产品的特性
System.out.println(partA+"==="+partB+"===="+partC);
}
}
//抽象建造者 包含创建产品各个子部件的抽象方法。
abstract class Builder {
//创建产品对象
protected Product product = new Product();
public abstract void buildPartA();
public abstract void buildPartB();
public abstract void buildPartC();
//返回产品对象
public Product getResult() {
return product;
}
}
//具体建造者 实现了抽象建造者接口。
class ConcreteBuilder extends Builder {
public void buildPartA() {
product.setPartA("建造 PartA");
}
public void buildPartB() {
product.setPartB("建造 PartB");
}
public void buildPartC() {
product.setPartC("建造 PartC");
}
}
//指挥者 调用建造者中的方法完成复杂对象的创建。
class Director {
private Builder builder;
public Director(Builder builder) {
this.builder = builder;
}
//产品构建与组装方法
public Product construct() {
builder.buildPartA();
builder.buildPartB();
builder.buildPartC();
return builder.getResult();
}
} | [
"Lin.Gu@itiaoling.com"
] | Lin.Gu@itiaoling.com |
dcd27bb6c9098c68d443b86d161543df52f2cb41 | 72905f1a93b18e147419471c4c7b28bbcf0a4e68 | /AndroidPhysicalTherapy-final/app/src/main/java/edu/fau/group10/AndroidPhysicalTherapy/FragmentActivityFragment5.java | 0be1e059bec3090df88271ab2215c9355ddb78c8 | [] | no_license | HealthCareApps/Group-10-Physical-Activity | 4818c186c00f2b3720e028ccfd3cad8a9f9edc75 | 324c3f6524ebdae8239695c3eb02e5593728454e | refs/heads/master | 2021-01-10T17:47:56.568114 | 2016-05-02T04:28:07 | 2016-05-02T04:28:07 | 52,137,502 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 650 | java | package edu.fau.group10.AndroidPhysicalTherapy;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
/**
* A placeholder fragment containing a simple view.
*/
public class FragmentActivityFragment5 extends Fragment {
public FragmentActivityFragment5() {
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
return inflater.inflate(edu.fau.group10.AndroidPhysicalTherapy.R.layout.fragment_fragment5, container, false);
}
}
| [
"fsoares2014@fau.edu"
] | fsoares2014@fau.edu |
fdf441765935174bb58d1bfe073995ac8dc2c08a | bbf46b05cbdfa739ec19433882bc20d38f76739f | /app/src/main/java/com/cawlapp/cawlapp/data/cache/GetDaoSession.java | 5e92cb11b226d05840882108afa916744f8b598c | [] | no_license | IvanSvirin/CAWLApp | e4df7183ce8207b142cd003c124779c15eaf82bf | efcfe7dc15facfd5a45545408a82ab318b3ad734 | refs/heads/master | 2020-12-24T12:20:55.500966 | 2016-11-07T06:53:28 | 2016-11-07T06:53:28 | 73,050,351 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 950 | java | package com.cawlapp.cawlapp.data.cache;
import android.content.Context;
import com.cawlapp.cawlapp.data.entity.DaoMaster;
import com.cawlapp.cawlapp.data.entity.DaoSession;
import org.greenrobot.greendao.database.Database;
import javax.inject.Inject;
import javax.inject.Singleton;
@Singleton
public class GetDaoSession {
/**
* A flag to show how easily you can switch from standard SQLite to the encrypted SQLCipher.
*/
public static final boolean ENCRYPTED = false;
private DaoSession daoSession;
@Inject
public GetDaoSession(Context context) {
DaoMaster.DevOpenHelper helper = new DaoMaster.DevOpenHelper(context, ENCRYPTED ? "cash-db-encrypted" : "cash-db");
Database db = ENCRYPTED ? helper.getEncryptedWritableDb("super-secret") : helper.getWritableDb();
daoSession = new DaoMaster(db).newSession();
}
public DaoSession getDaoSession() {
return daoSession;
}
}
| [
"Ivan.Svirin@softomate.com"
] | Ivan.Svirin@softomate.com |
91388beddb2c1b761824ca7175fb0d0af146ecd2 | 5e33fe47d645674b44109f6a43105907634228e0 | /simpleDB/src/simpledb/remote/RemoteConnectionImpl.java | 68278252dbd17d6cf26691783387cf7897dd845e | [] | no_license | Meyke/TheSDB | 74f6471b9f39c7ec835a0a227f3cfe71452b3717 | 95785e4f8cb84e1f4d21e5c1d75e15c5fb6ce953 | refs/heads/master | 2021-04-06T00:49:28.507851 | 2018-04-03T07:09:38 | 2018-04-03T07:09:38 | 125,223,231 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,881 | java | package simpledb.remote;
import simpledb.server.SimpleDB;
import simpledb.tx.Transaction;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
/**
* The RMI server-side implementation of RemoteConnection.
* @author Edward Sciore
*/
@SuppressWarnings("serial")
class RemoteConnectionImpl extends UnicastRemoteObject implements RemoteConnection {
private Transaction tx;
/**
* Creates a remote connection
* and begins a new transaction for it.
* @throws RemoteException
*/
RemoteConnectionImpl() throws RemoteException {
tx = new Transaction();
}
/**
* Creates a new RemoteStatement for this connection.
* @see simpledb.remote.RemoteConnection#createStatement()
*/
public RemoteStatement createStatement() throws RemoteException {
return new RemoteStatementImpl(this);
}
/**
* Closes the connection.
* The current transaction is committed.
* @see simpledb.remote.RemoteConnection#close()
*/
public void close() throws RemoteException {
tx.commit();
}
// The following methods are used by the server-side classes.
/**
* Returns the transaction currently associated with
* this connection.
* @return the transaction associated with this connection
*/
Transaction getTransaction() {
return tx;
}
/**
* Commits the current transaction,
* and begins a new one.
*/
void commit() {
tx.commit();
System.out.println(stampaStatistiche());
SimpleDB.fileMgr().resetBlockStats(); //perchè voglio azzerare le statistiche a ogni interrogazione
tx = new Transaction();
}
private String stampaStatistiche() {
return SimpleDB.fileMgr().getBlockStats().toString();
}
/**
* Rolls back the current transaction,
* and begins a new one.
*/
void rollback() {
tx.rollback();
tx = new Transaction();
}
}
| [
"michele.tedesco487@virgilio.it"
] | michele.tedesco487@virgilio.it |
37255df3739f8aa31188b6ec0a68ad8770812431 | be2cf493dadcd9a31d0582b793bb605191173484 | /src/main/java/learn/calorietracker/controllers/LogEntryController.java | 47e0d11fb88dc1bb3ec7d8bfc2798c896f097df7 | [] | no_license | kdonelson/dev10-calorietracker-jdbctemplate | 2092f03344ec047e268f9cadfdc0f2f8a46641ea | fee79e86c0852591e053e6a758e5381d03f0bf8c | refs/heads/main | 2023-02-27T07:00:03.776588 | 2021-01-28T22:22:59 | 2021-01-28T22:22:59 | 332,900,943 | 0 | 0 | null | 2021-01-28T22:23:01 | 2021-01-25T22:23:37 | Java | UTF-8 | Java | false | false | 2,164 | java | package learn.calorietracker.controllers;
import learn.calorietracker.domain.LogEntryResult;
import learn.calorietracker.domain.LogEntryService;
import learn.calorietracker.models.LogEntry;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/log")
public class LogEntryController {
private final LogEntryService service;
public LogEntryController(LogEntryService service) {
this.service = service;
}
@GetMapping
public List<LogEntry> findAll() {
return service.findAll();
}
@GetMapping("/{logEntryId}")
public ResponseEntity findById(@PathVariable int logEntryId) {
if (logEntryId <= 0) {
return new ResponseEntity<>(null, HttpStatus.BAD_REQUEST);
}
LogEntry entry = service.findById(logEntryId);
if (entry == null) {
return new ResponseEntity(null, HttpStatus.NOT_FOUND);
}
return new ResponseEntity<>(entry, HttpStatus.OK);
}
@PostMapping
public ResponseEntity<LogEntryResult> add(@RequestBody LogEntry entry) {
LogEntryResult result = service.create(entry);
if (!result.isSuccessful()) {
return new ResponseEntity<>(result, HttpStatus.BAD_REQUEST);
}
return new ResponseEntity<>(result, HttpStatus.CREATED);
}
@PutMapping("/{logEntryId}")
public ResponseEntity<LogEntryResult> update(@PathVariable int logEntryId, @RequestBody LogEntry entry) {
entry.setId(logEntryId);
LogEntryResult result = service.update(entry);
if(!result.isSuccessful()) {
return new ResponseEntity<>(result, HttpStatus.BAD_REQUEST);
}
return new ResponseEntity<>(result, HttpStatus.OK);
}
@DeleteMapping("/{logEntryId}")
public ResponseEntity<Void> delete(@PathVariable int logEntryId) {
if (service.deleteById(logEntryId)) {
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
return new ResponseEntity<>(HttpStatus.NOT_FOUND);
}
}
| [
"kdonelson@genesis10.com"
] | kdonelson@genesis10.com |
f9075ef4e913c531d6e52fd93bb811e16709ca07 | 5b84eff937375f68b76a60ef29dea9bedfb3444e | /src/test/java/com/nagel/api/FlightPlanControllerIT.java | 286651268a7812725c73394186ccf509387af06b | [] | no_license | armine28/airflux | 8c2a9df330eea778b45f1a700b00149fb89fe499 | 8a559fcc7372790b08fac2f26c2c5eab1d092937 | refs/heads/feature/airflux-task | 2020-03-31T16:37:34.098327 | 2018-10-14T20:01:16 | 2018-10-14T20:01:16 | 152,382,902 | 0 | 1 | null | 2018-10-14T20:01:17 | 2018-10-10T07:42:20 | Java | UTF-8 | Java | false | false | 2,844 | java | package com.nagel.api;
import com.google.common.collect.ImmutableList;
import com.nagel.api.error.exception.AirportNotFoundException;
import com.nagel.api.response.Flight;
import com.nagel.common.AirportSign;
import com.nagel.config.Application;
import com.nagel.service.AirportService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc;
import java.time.LocalDateTime;
import java.util.List;
import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.core.Is.is;
import static org.mockito.BDDMockito.given;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
@RunWith(SpringRunner.class)
@SpringBootTest(
classes = Application.class)
@AutoConfigureMockMvc
public class FlightPlanControllerIT {
@Autowired
private MockMvc mvc;
@MockBean
private AirportService airportService;
@Test
public void shouldFailCauseAirportNotFound() throws Exception {
final String testCity = "TEST_CITY";
given(airportService.getFlights(testCity)).willThrow(new AirportNotFoundException("Foo"));
mvc.perform(get("/flightplan")
.param("airport", testCity))
.andExpect(status().isBadRequest());
}
@Test
public void shouldReturnFlights() throws Exception {
final List<Flight> flights = ImmutableList.of(
new Flight(AirportSign.MUC,
AirportSign.TXL,
LocalDateTime.of(2018, 10, 10, 20, 00),
LocalDateTime.of(2018, 10, 10, 22, 00),
"FL1"),
new Flight(AirportSign.HAM,
AirportSign.LHR,
LocalDateTime.of(2018, 10, 10, 18, 00),
LocalDateTime.of(2018, 10, 10, 19, 30),
"FL2"));
given(airportService.getFlights()).willReturn(flights);
mvc.perform(get("/flightplan"))
.andExpect(status().isOk())
.andExpect(jsonPath("$", hasSize(2)))
.andExpect(jsonPath("$[0].origin", is(AirportSign.MUC.name())))
.andExpect(jsonPath("$[0].destination", is(AirportSign.TXL.name())))
.andExpect(jsonPath("$[0].equipment", is("FL1")));
}
}
| [
"armin@Julias-MBP.fritz.box"
] | armin@Julias-MBP.fritz.box |
e3443264e73456b091f591736f7f8268e5217c80 | ccbaabfc53561b0ae740e4ae82d4ebdb7a781c58 | /src/test/java/com/spartaglobal/tlg/JSONJackson/AppTest.java | 26a1d49abbe6366ce739d06c798a41da09fd6dac | [] | no_license | toby7794/JSONJackson | ab9413f8a739786ded56cc1d61d063567f30640b | 64844aed0893b6005d737fef18166eb4c289cebc | refs/heads/master | 2020-05-16T19:13:40.832432 | 2019-04-25T08:33:53 | 2019-04-25T08:33:53 | 183,252,478 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 304 | java | package com.spartaglobal.tlg.JSONJackson;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
/**
* Unit test for simple App.
*/
public class AppTest
{
/**
* Rigorous Test :-)
*/
@Test
public void shouldAnswerWithTrue()
{
assertTrue( true );
}
}
| [
"TGoddard@spartaglobal.com"
] | TGoddard@spartaglobal.com |
e6ffdcdcb4ad1f84f117ed69922507b837169edb | 36bf98918aebe18c97381705bbd0998dd67e356f | /projects/argouml-0.34/argouml/src/argouml-core-model-mdr/src/org/argouml/model/mdr/UndoUmlHelperDecorator.java | 9da756595a63302d970225572543e8b8cce19c87 | [] | no_license | ESSeRE-Lab/qualitas.class-corpus | cb9513f115f7d9a72410b3f5a72636d14e4853ea | 940f5f2cf0b3dc4bd159cbfd49d5c1ee4d06d213 | refs/heads/master | 2020-12-24T21:22:32.381385 | 2016-05-17T14:03:21 | 2016-05-17T14:03:21 | 59,008,169 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,669 | java | /* $Id: UndoUmlHelperDecorator.java 17765 2010-01-11 21:20:14Z linus $
*****************************************************************************
* Copyright (c) 2009 Contributors - see below
* 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:
* tfmorris
*****************************************************************************
*
* Some portions of this file was previously release using the BSD License:
*/
// Copyright (c) 2005-2006 The Regents of the University of California. All
// Rights Reserved. Permission to use, copy, modify, and distribute this
// software and its documentation without fee, and without a written
// agreement is hereby granted, provided that the above copyright notice
// and this paragraph appear in all copies. This software program and
// documentation are copyrighted by The Regents of the University of
// California. The software program and documentation are supplied "AS
// IS", without any accompanying services from The Regents. The Regents
// does not warrant that the operation of the program will be
// uninterrupted or error-free. The end-user understands that the program
// was developed for research purposes and is advised not to rely
// exclusively on the program for any reason. IN NO EVENT SHALL THE
// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
package org.argouml.model.mdr;
import org.argouml.model.AbstractUmlHelperDecorator;
import org.argouml.model.UmlHelper;
/**
* This Decorator is responsible for generating commands for any
* mutable methods.
*
* @author Linus Tolke
*/
public class UndoUmlHelperDecorator extends AbstractUmlHelperDecorator {
/**
* Constructor.
*
* @param component The component we are decorating.
*/
UndoUmlHelperDecorator(UmlHelper component) {
super(component);
}
}
| [
"marco.zanoni@disco.unimib.it"
] | marco.zanoni@disco.unimib.it |
89f5029b0e0daa0e82a3ad7eaaa1ef6bf0264e8b | 480a0d66554091e9059192903c2b4c8fa9664083 | /src/ar/edu/untdf/labprog/tp1/ejer5/sol/SortListIntStrategy.java | c1d2d80243cc8d9f5e9bef79fe0a9b0683e95dd0 | [] | no_license | derlisjeremias/LabProg2013_tp1 | 40931e45c1cb5eae15b9945f1055a26f9c941f72 | 66cb991705fef62a2f62135410b05430137be09d | refs/heads/master | 2021-01-18T10:41:49.185304 | 2013-04-22T02:19:15 | 2013-04-22T02:19:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 293 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package ar.edu.untdf.labprog.tp1.ejer5.sol;
/**
*
* @author Jere
*/
public interface SortListIntStrategy {
public void setList(int[] aList);
public void sort();
}
| [
"Jere@Jere-PC"
] | Jere@Jere-PC |
c02ed02fe9913f1dc83848248256649fd90fc16d | a4bff513038d59d5e5cde81997b75d45bd76aecb | /Semana9/RayTracer1/src/Math/Vector4.java | 64bf08288d695dce3bd0da8feec4c2c4a99cfbdb | [] | no_license | imurielr/Computer-graphics | 542c6101d960644f6f69b2e95507680eb41c0bd9 | 4e927e32adccefe914cf7ecd2a89408c98b774c3 | refs/heads/master | 2021-01-15T05:51:30.333211 | 2020-02-25T02:55:13 | 2020-02-25T02:55:13 | 242,894,786 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,775 | 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 Math;
/**
*
* @author htrefftz
*/
public class Vector4 {
/**
* x, y and z coordinates are stored in an array with 4 positions
*/
double [] vector;
/**
* Constructor
*/
public Vector4() {
vector = new double[4];
vector[3] = 1d;
}
/**
* Constructor: if another Vector4 is received, this is a COPY (clone) of
* it.
* @param other Other vector to be cloned
*/
public Vector4(Vector4 other) {
vector = new double[4];
for(int i = 0; i < 4; i++) {
vector[i] = other.vector[i];
}
}
/**
* Constructor, the x, y and z components are given
* @param x x component
* @param y y component
* @param z z component
*/
public Vector4(double x, double y, double z) {
vector = new double[4];
vector[0] = x;
vector[1] = y;
vector[2] = z;
vector[3] = 1d;
}
/**
* Constructor from a given point
* @param p Point
*/
public Vector4(Point p) {
vector = new double[4];
vector[0] = p.x;
vector[1] = p.y;
vector[2] = p.z;
vector[3] = 1d;
}
/**
* Creates a vector based on the tail (x1, y1, z2) and the head(x2, y2, z2)
* @param x1 tail
* @param y1 tail
* @param z1 tail
* @param x2 head
* @param y2 head
* @param z2 head
*/
public Vector4(double x1, double y1, double z1, double x2, double y2, double z2) {
vector = new double[4];
vector[0] = x2 - x1;
vector[1] = y2 - y1;
vector[2] = z2 - z1;
vector[3] = 1d;
}
/**
* Creates a vector based on two points: the tail and the head
* @param tail Initial Point
* @param head Final Point
*/
public Vector4(Point tail, Point head) {
vector = new double[4];
vector[0] = head.x - tail.x;
vector[1] = head.y - tail.y;
vector[2] = head.z - tail.z;
vector[3] = 1d;
}
/**
* Computes the cross product of V1 times V2
* @param v1 vector 1
* @param v2 vector 2
* @return v1 x v2
*/
public static Vector4 crossProduct(Vector4 v1, Vector4 v2) {
double x = v1.getY() * v2.getZ() - v1.getZ() * v2.getY();
double y = - (v1.getX() * v2.getZ() - v1.getZ() * v2.getX());
double z = v1.getX() * v2.getY() - v1.getY() * v2.getX();
return new Vector4(x, y, z);
}
/**
* Computes the dot product of two vectors
* @param v1 Vector1
* @param v2 Vector2
* @return v1 . v2
*/
public static double dotProduct(Vector4 v1, Vector4 v2) {
return v1.getX() * v2.getX() + v1.getY() * v2.getY() +
v1.getZ() * v2.getZ();
}
/**
* Adds two vectors and returns the result
* @param v1 First vector to be added
* @param v2 Second vector to be added
* @return result of v1 + v2
*/
public static Vector4 add(Vector4 v1, Vector4 v2) {
double x = v1.vector[0] + v2.vector[0];
double y = v1.vector[1] + v2.vector[1];
double z = v1.vector[2] + v2.vector[2];
return new Vector4(x, y, z);
}
/**
* Subtract two vectors and return the result
* @param v1 First vector
* @param v2 Second vector
* @return result of First Vector - Second Vector
*/
public static Vector4 subtract(Vector4 v1, Vector4 v2) {
double x = v1.vector[0] - v2.vector[0];
double y = v1.vector[1] - v2.vector[1];
double z = v1.vector[2] - v2.vector[2];
return new Vector4(x, y, z);
}
/**
* Multiplies a vector times a scalar and returns the result
* @param v vector to be multiplied by a scalar
* @param s scalar to be multiplied by a vector
* @return result of s * v
*/
public static Vector4 multiply(double s, Vector4 v) {
double x = v.vector[0] * s;
double y = v.vector[1] * s;
double z = v.vector[2] * s;
return new Vector4(x, y, z);
}
/**
* Finds the reflection of vector u, after bouncing a surface with
* Normal n
* @param u Vector to be reflected
* @param n Normal of the surface
* @return reflection of vector u after bouncing with surface with normal n
*/
public static Vector4 reflection(Vector4 u, Vector4 n) {
n.normalize();
double scalar = - 2 * Vector4.dotProduct(u, n);
Vector4 res = Vector4.add(u, Vector4.multiply(scalar, n));
return res;
}
/**
* Computes the magnitude of this vector
* @return magnitude of the vector
*/
public double magnitude() {
return Math.sqrt(vector[0]*vector[0] + vector[1]*vector[1] + vector[2]*vector[2]);
}
/**
* Normalize, so the magnitude is 1
*/
public void normalize() {
double mag = this.magnitude();
vector[0] /= mag;
vector[1] /= mag;
vector[2] /= mag;
}
/**
* Creates a new vector based on an existing vector
* @param vector existing vector
*/
public Vector4(double [] vector) {
this.vector = vector;
}
/**
* Normalizes the homogeneous coordinate, the last element should be 1
*/
public void normalizeW() {
if (vector[3] == 0) {
return;
}
for(int i = 0; i < 4; i++) {
vector[i] /= vector[3];
}
}
/**
* Returns the element at position pos
* @param pos position of the element to return
* @return element at position pos
*/
public double get(int pos) {
return vector[pos];
}
/**
* Returns the X coordinate
* @return X coordinate
*/
public double getX() {
return vector[0];
}
/**
* Returns the Y coordinate
* @return Y coordinate
*/
public double getY() {
return vector[1];
}
/**
* Returns the Z coordinate
* @return Z coordinate
*/
public double getZ() {
return vector[2];
}
/**
* Returns the W value
* @return W value
*/
public double getW() {
return vector[3];
}
/**
* Method to print a vector
* @return the string with the elements of the vector
*/
@Override
public String toString() {
String s = "Vector4: ";
for(int i = 0; i < 4; i++) {
s += vector[i] + " ";
}
return s;
}
}
| [
"isamuriel@MacBook-Pro-de-Isa.local"
] | isamuriel@MacBook-Pro-de-Isa.local |
390c0915d824606f9f7774b033b400b68986e383 | c1e81483ad5d91c26ca273644b27f5a038387126 | /MyBatis-Config/src/main/java/com/atguigu/mybatis/bean/Employee.java | 612b560804a6baf98ae479324aed175099986e0b | [] | no_license | mu15182/MyBatis | acf63c8abfc3b9021e51d850f0ca3893075cc58a | 580728cc19711bf1636a18fbfbfe3f739c9d7d28 | refs/heads/master | 2023-07-13T06:31:33.416523 | 2021-08-22T11:44:04 | 2021-08-22T11:44:04 | 398,770,790 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 257 | java | package com.atguigu.mybatis.bean;
import lombok.Data;
import org.apache.ibatis.type.Alias;
@Data
@Alias(value = "employee")
public class Employee {
private String id;
private String lastName;
private double sal;
private String deptno;
}
| [
"1765641153@qq.com"
] | 1765641153@qq.com |
13323e3d97dfdc136d6125a773dec5e1b150a82c | afb52c5d1000c8afc6de5d533a5a70745fd97a5f | /Inlab3/GroceryItem.java | 01c3ee66d432424bdc6fba1d63af772834217511 | [] | no_license | EthanMiller2/CSCI-111-Intro-To-Java | 76f2642d2298d5c806f482bdeaafd410f599cfcc | 61680cec08cdce3e033306859936896ae10b4911 | refs/heads/master | 2020-12-02T23:36:14.117688 | 2019-12-31T23:13:05 | 2019-12-31T23:13:05 | 231,155,064 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 793 | java |
/**
*
*
* @author (Ethan Miller)
* @version (20 Sept 2016 )
*/
public class GroceryItem
{
private String name; //item name
private double cost; //cost of 1 unit of item
private int stockNum;
// constructor for GroceryItems
public GroceryItem(String inName, double inCost, int inStockNum)
{
name = inName;
cost = inCost;
stockNum = inStockNum;
}
// returns the item's name
public String getName()
{
return name;
}
// returns the cost of 1 item
public double getCost()
{
return cost;
}
//prints the stock of the item
public void printStock()
{
System.out.println("There are " + stockNum + " units of " + name + " in stock");
}
} | [
"noreply@github.com"
] | noreply@github.com |
41cf2f15c0b9e57387c025d19dd7c582a5c0d86f | 8418693407524990398234cded53a63ac3c808ad | /lernfesttool-gui/src/main/java/de/rincewind/gui/panes/editors/PaneHelperEditor.java | 5a008cd8b900f9424cbf0b709db48f50e964191c | [] | no_license | Rincewind34/Lernfesttool | 73aa8d3d6805c7256d89ddb8235c83c704044981 | cb26c827fe6a48b11726060fb4aac3db59db6dfd | refs/heads/master | 2021-01-19T22:05:15.584689 | 2017-04-22T16:52:53 | 2017-04-22T16:52:53 | 88,749,480 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 725 | java | package de.rincewind.gui.panes.editors;
import java.util.Arrays;
import javafx.scene.layout.VBox;
import de.rincewind.api.Helper;
import de.rincewind.gui.controller.editors.ControllerHelperEditor;
import de.rincewind.gui.panes.abstracts.PaneEditor;
import de.rincewind.gui.util.TabHandler;
public class PaneHelperEditor extends PaneEditor<VBox> {
private ControllerHelperEditor controller;
public PaneHelperEditor(TabHandler handler, int helperId) {
super("helpereditor.fxml", Arrays.asList(), new ControllerHelperEditor(handler, helperId));
this.controller = (ControllerHelperEditor) this.getController();
}
@Override
public Helper getEditingObject() {
return this.controller.getEditingObject();
}
}
| [
"rincewind34@wtnet.de"
] | rincewind34@wtnet.de |
b7c6624ebe02ef6ed1de22c8f1763ed10a7d9c12 | e6f5120b3263b419cf743865dc5850d0c4678ef1 | /src/main/java/com/sellinall/shopify/init/InitSKUMap.java | 31188b0784f026d2b9f5bce24e90ead3d24ac0a0 | [] | no_license | sathiya-sellinall/shopify-test | c66719e16240fed05ecc30ab513f3585fc8c40cf | e96438349114369d6313a72ea8c1190dae9e4395 | refs/heads/master | 2021-07-23T04:47:34.653444 | 2020-04-07T05:13:55 | 2020-04-07T05:13:55 | 253,687,208 | 0 | 0 | null | 2021-07-07T06:23:43 | 2020-04-07T04:30:48 | Java | UTF-8 | Java | false | false | 634 | java | /**
*
*/
package com.sellinall.shopify.init;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.log4j.Logger;
import org.codehaus.jettison.json.JSONObject;
/**
* @author malli
*
*/
public class InitSKUMap implements Processor {
static Logger log = Logger.getLogger(InitSKUMap.class.getName());
public void process(Exchange exchange) throws Exception {
JSONObject SKUMap = exchange.getIn().getBody(JSONObject.class);
exchange.setProperty("SKUMap", SKUMap);
exchange.setProperty("SKU", SKUMap.getString("SKU"));
exchange.getOut().setBody(exchange.getProperty("inputRequest"));
}
} | [
"sathiya@sellinall.com"
] | sathiya@sellinall.com |
c53cbd08179556a8064dc74a25a32b9a588da009 | 4956e2651640a7a3574bc670c216b13ae92969dd | /app/src/main/java/org/c19x/data/type/ContactPattern.java | 34945faf9978f337c5bede656b8ad8da558b0d4d | [
"MIT"
] | permissive | emotionrobots/C19X-Android | 74baa7b2c9400266e4b73f8008a6334ac2dc27c1 | 564f1a1ce0c19a59e4418a1453f8fb90e331ffd1 | refs/heads/master | 2022-12-11T07:04:32.324548 | 2020-07-09T12:26:49 | 2020-07-09T12:26:49 | 290,578,815 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 320 | java | package org.c19x.data.type;
public class ContactPattern {
public String value;
public ContactPattern(final String value) {
this.value = value;
}
@Override
public String toString() {
return "ContactPattern{" +
"value='" + value + '\'' +
'}';
}
}
| [
"support@c19x.org"
] | support@c19x.org |
b3e4b9ba5a246fb2bb349ddc1ba31ad196355395 | b98c635746a6abbea60e78a18aa63ce8646e4bdd | /monitoring/src/main/java/de/hub/cs/dbis/aeolus/monitoring/throughput/ThroughputCounterSpoutOutputCollector.java | dabc3d9b5a4c984f29acc84951334d7981e1ed3a | [
"Apache-2.0"
] | permissive | InsightsDev-dev/aeolus | 56e5b8693d85f45434c7b02f4404cded9f6d8a12 | 32f3a34f153a32ca87cdfa3fa063eb6bdb159c10 | refs/heads/master | 2020-12-24T09:07:48.734615 | 2016-07-23T20:55:47 | 2016-07-23T20:55:47 | 69,042,504 | 0 | 0 | null | 2016-09-23T16:33:21 | 2016-09-23T16:33:21 | null | UTF-8 | Java | false | false | 3,073 | java | /*
* #!
* %
* Copyright (C) 2014 - 2016 Humboldt-Universität zu Berlin
* %
* 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 de.hub.cs.dbis.aeolus.monitoring.throughput;
import java.util.List;
import backtype.storm.spout.SpoutOutputCollector;
import backtype.storm.utils.Utils;
/**
* {@link ThroughputCounterSpoutOutputCollector} wraps a spout output collector to monitor the output streams of a
* spout.
*
* @author Matthias J. Sax
*/
class ThroughputCounterSpoutOutputCollector extends SpoutOutputCollector {
/** The internally used counter. */
private SpoutThroughputCounter counter;
/**
* Instantiates a new {@link ThroughputCounterSpoutOutputCollector}.
*
* @param collector
* The original output collector.
* @param reportStream
* The ID of the report stream.
*/
public ThroughputCounterSpoutOutputCollector(SpoutOutputCollector collector, String reportStream) {
super(collector);
this.counter = new SpoutThroughputCounter(collector, reportStream);
}
@Override
public List<Integer> emit(String streamId, List<Object> tuple, Object messageId) {
this.counter.countOut(streamId);
return super.emit(streamId, tuple, messageId);
}
@Override
public List<Integer> emit(List<Object> tuple, Object messageId) {
return this.emit(Utils.DEFAULT_STREAM_ID, tuple, messageId);
}
@Override
public List<Integer> emit(List<Object> tuple) {
return this.emit(tuple, null);
}
@Override
public List<Integer> emit(String streamId, List<Object> tuple) {
return this.emit(streamId, tuple, null);
}
@Override
public void emitDirect(int taskId, String streamId, List<Object> tuple, Object messageId) {
this.counter.countOut(streamId);
super.emitDirect(taskId, streamId, tuple, messageId);
}
@Override
public void emitDirect(int taskId, List<Object> tuple, Object messageId) {
this.emitDirect(taskId, Utils.DEFAULT_STREAM_ID, tuple, messageId);
}
@Override
public void emitDirect(int taskId, String streamId, List<Object> tuple) {
this.emitDirect(taskId, streamId, tuple, null);
}
@Override
public void emitDirect(int taskId, List<Object> tuple) {
this.emitDirect(taskId, tuple, null);
}
/**
* Forwards the reporting request to the internally used counter.
*
* @param ts
* The timestamp when this report is triggered.
* @param factor
* The normalization factor to get reported values "per second".
*/
void reportCount(long ts, double factor) {
this.counter.reportCount(ts, factor);
}
}
| [
"mjsax@informatik.hu-berlin.de"
] | mjsax@informatik.hu-berlin.de |
dcda9878b4017d757ac1385db666e7e4193180d5 | 2061092e898d99f008ae727771c42747f6dce83a | /src/main/java/com/soud/jaba/util/RegexSplitUtils.java | ef4179ffef6a05229ef06c4bd9c71022440978b1 | [] | no_license | porsukali/Jaba | 0534c9271299336844594decbe56675b5bdad29a | 6c5e46516fe63265c2d414ab94f52fe349ac1ebf | refs/heads/master | 2023-03-16T20:02:38.238991 | 2019-08-19T07:14:37 | 2019-08-19T07:14:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,021 | java | package com.soud.jaba.util;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* @author Soud
*/
public class RegexSplitUtils {
/**
* 根据 pattern 把字符串 str 分割出来,匹配与不匹配部分皆保留。
* 详见:com.soud.jaba.JabaCutTest#testSplit()
*/
public static List<String> split(Pattern pattern, String str) {
List<String> result = new ArrayList<>();
List<Integer> positions = new ArrayList<>();
Matcher m = pattern.matcher(str);
positions.add(0);
while(m.find()) {
positions.add(m.start());
positions.add(m.end());
}
positions.add(str.length());
for(int i = 0; i < positions.size() - 1; i++) {
int st = positions.get(i);
int ed = positions.get(i + 1);
if (ed != st) {
result.add(str.substring(st, ed));
}
}
return result;
}
}
| [
"soud95@163.com"
] | soud95@163.com |
306b95d329a4891191179e0e34e32f6189554da0 | 330729ecb0f7185345a9b3d73d386004be3edf01 | /basex-core/src/main/java/org/basex/query/func/fn/FnNumber.java | 757d4600d47a6262fe1058322d162b4708342e46 | [
"BSD-3-Clause"
] | permissive | bryanchance/basex | f9e3ca99a3c41f97790b002af48a65bdb956f67d | a18a092b11a5240075b081ffd301014f0dc00edf | refs/heads/master | 2020-04-27T20:15:02.231646 | 2019-03-08T12:10:37 | 2019-03-08T12:10:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,246 | java | package org.basex.query.func.fn;
import org.basex.query.*;
import org.basex.query.expr.*;
import org.basex.query.value.item.*;
import org.basex.query.value.type.*;
import org.basex.util.*;
/**
* Function implementation.
*
* @author BaseX Team 2005-19, BSD License
* @author Christian Gruen
*/
public final class FnNumber extends ContextFn {
@Override
public Item item(final QueryContext qc, final InputInfo ii) throws QueryException {
final Item item = ctxArg(0, qc).atomItem(qc, info);
if(item == null) return Dbl.NAN;
if(item.type == AtomType.DBL) return item;
try {
if(info != null) info.internal(true);
return AtomType.DBL.cast(item, qc, sc, info);
} catch(final QueryException ex) {
return Dbl.NAN;
} finally {
if(info != null) info.internal(false);
}
}
@Override
protected Expr opt(final CompileContext cc) {
final boolean context = exprs.length == 0;
final Expr expr = context ? cc.qc.focus.value : exprs[0];
if(expr != null && expr.seqType().eq(SeqType.DBL_O)) {
// number(1e1) -> 1e1
// $double[number() = 1] -> $double[. = 1]
return context && cc.nestedFocus() ? new ContextValue(info).optimize(cc) : expr;
}
return this;
}
}
| [
"christian.gruen@gmail.com"
] | christian.gruen@gmail.com |
876e659b1b3fd6cdd094e1e17b68b80004334b7c | 6c20f1c49aedf1c4d42556920a1e3866d6dc4be9 | /src/main/java/com/xugah/exam/security/SecurityUtils.java | 9f007097706e5e65f2a7f508b2efb9a696cb5fb1 | [] | no_license | aazipperer/exam | 309a8ff88b0bb8dc802f9885ec83c1b0842901da | 29938a2603708fa202c63c4ba98e0ecc4fa22833 | refs/heads/master | 2016-09-05T10:37:35.022461 | 2014-10-28T23:35:27 | 2014-10-28T23:35:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,958 | java | package com.xugah.exam.security;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails;
import java.util.Collection;
/**
* Utility class for Spring Security.
*/
public final class SecurityUtils {
private SecurityUtils() {
}
/**
* Get the login of the current user.
*/
public static String getCurrentLogin() {
SecurityContext securityContext = SecurityContextHolder.getContext();
Authentication authentication = securityContext.getAuthentication();
UserDetails springSecurityUser = null;
String userName = null;
if(authentication != null) {
if (authentication.getPrincipal() instanceof UserDetails) {
springSecurityUser = (UserDetails) authentication.getPrincipal();
userName = springSecurityUser.getUsername();
} else if (authentication.getPrincipal() instanceof String) {
userName = (String) authentication.getPrincipal();
}
}
return userName;
}
/**
* Check if a user is authenticated.
*
* @return true if the user is authenticated, false otherwise
*/
public static boolean isAuthenticated() {
SecurityContext securityContext = SecurityContextHolder.getContext();
final Collection<? extends GrantedAuthority> authorities = securityContext.getAuthentication().getAuthorities();
if (authorities != null) {
for (GrantedAuthority authority : authorities) {
if (authority.getAuthority().equals(AuthoritiesConstants.ANONYMOUS)) {
return false;
}
}
}
return true;
}
}
| [
"fredo.br@gmail.com"
] | fredo.br@gmail.com |
09bf123ccc499e5cc552fc515f1cdf3e55e9ec6f | d2d80c36a2b7f0495d59a6b1dd942b89678aabde | /platforms/android/src/br/com/jeitto/phonegap/MainActivity.java | 1d7ceb527480fc7a39c2d6441fa6b2bb1b43ecb6 | [] | no_license | cauerego/jeitto | 3938f271c98b6eeafdfbb0cde6374817c8d79395 | 1637d38a70827e9a949be0f9a7f8e37487fcada3 | refs/heads/master | 2021-01-10T13:30:49.074926 | 2015-10-27T23:20:24 | 2015-10-27T23:20:24 | 45,069,341 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,215 | 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 br.com.jeitto.phonegap;
import android.os.Bundle;
import org.apache.cordova.*;
public class MainActivity extends CordovaActivity
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
// Set by <content src="index.html" /> in config.xml
loadUrl(launchUrl);
}
}
| [
"caue@cregox.com"
] | caue@cregox.com |
4d842f176d1f16c3234da23117f700def4274101 | 582571cf75e603ae639a8b8af4e31476a11129fa | /src/test/java/com/github/hasys/TrafficViolationTest.java | 7d3670ae5ce98f571a8793e28f1646ef7c981975 | [
"Apache-2.0"
] | permissive | hasys/QuickServiceTest | f6ae85fd9b5559e841c6766dfd7dde0f6344791a | 357f05525dd9bd1b71efd8f98c6d7c95724a3a5d | refs/heads/main | 2023-06-09T21:23:20.227074 | 2021-07-02T14:49:26 | 2021-07-02T14:50:00 | 382,377,117 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,650 | java | /*
* Copyright 2021 Red Hat, Inc. and/or its affiliates.
*
* 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.github.hasys;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.http.ContentType;
import org.junit.jupiter.api.Test;
import static io.restassured.RestAssured.given;
import static org.hamcrest.Matchers.is;
@QuarkusTest
public class TrafficViolationTest {
@Test
public void testEvaluateTrafficViolation() {
given()
.body("{\n" +
" \"Driver\": {\n" +
" \"Points\": 2\n" +
" },\n" +
" \"Violation\": {\n" +
" \"Type\": \"speed\",\n" +
" \"Actual Speed\": 120,\n" +
" \"Speed Limit\": 100\n" +
" }\n" +
"}")
.contentType(ContentType.JSON)
.when()
.post("/Traffic Violation")
.then()
.statusCode(200)
.body("'Should the driver be suspended?'", is("No"));
}
} | [
"kgaevski@redhat.com"
] | kgaevski@redhat.com |
7680f5156befa148a26757be921b0f7e153c1738 | 7e2de44520d02ea2f4b4c8891be33853fb54ec00 | /app/src/main/java/com/mtsealove/github/food_delivery/Design/TitleView.java | 6fe4ab954af623b41572176f29bc147adf45a82e | [] | no_license | mtsealove/FoodDeliveryAndroid | e01074f75ca15cfbf01bc3f97ae15c4bdcabd551 | 42d1fcf2922ecc24e8908a679bceb8b4e3af48fa | refs/heads/master | 2020-09-07T03:11:45.386619 | 2019-11-17T12:56:33 | 2019-11-17T12:56:33 | 220,639,182 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,640 | java | package com.mtsealove.github.food_delivery.Design;
import android.content.Context;
import android.content.Intent;
import android.util.AttributeSet;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import com.mtsealove.github.food_delivery.*;
import java.util.concurrent.ThreadPoolExecutor;
public class TitleView extends RelativeLayout {
Context context;
String tag = getClass().getSimpleName();
ImageView menuIv, logoIv;
public TitleView(Context context) {
super(context);
init(context);
}
public TitleView(Context context, AttributeSet attrs) {
super(context, attrs);
init(context);
}
public TitleView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init(context);
}
public TitleView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
init(context);
}
private void init(Context context) {
this.context = context;
LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
Log.d(tag, String.valueOf(R.layout.view_title));
View layout = inflater.inflate(R.layout.view_title, TitleView.this, false);
logoIv = layout.findViewById(R.id.logoIv);
logoIv.setOnLongClickListener(new OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
setIP();
return false;
}
});
menuIv = layout.findViewById(R.id.menuIv);
menuIv.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
OpenDrawer();
}
});
addView(layout);
}
private void OpenDrawer() {
switch (context.getClass().getSimpleName()) {
case "MainActivity":
MainActivity.OpenDrawer();
break;
case "CurrentOrderActivity":
CurrentOrderActivity.OpenDrawer();
break;
case "LastOrderActivity":
LastOrderActivity.OpenDrawer();
break;
case "RestaurantListActivity":
RestaurantListActivity.OpenDrawer();
break;
}
}
private void setIP() {
Intent intent = new Intent(context, IpActivity.class);
context.startActivity(intent);
}
}
| [
"40752097+mtsealove@users.noreply.github.com"
] | 40752097+mtsealove@users.noreply.github.com |
9d8ab4f942e29b7cd34cace1b98eee5e40d5dc1a | d145a722f56e7b6e6584c7a2eb6de7c7500761e9 | /src/modelo/Endereco.java | 7bbaf3857bcd25f4a8ac5be5710de62bad31342c | [] | no_license | Gerlan-Ferreira/PJRevisaoJava | b4bb4194519f55871c994f870a6b39a7d4729eec | 2c0b2c58882e420509ada6b46702f18e9d1ad279 | refs/heads/master | 2021-01-01T23:59:36.239920 | 2020-02-12T02:16:51 | 2020-02-12T02:16:51 | 239,402,019 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 793 | java | package modelo;
public class Endereco {
private int id_end;
private String rua;
private String bairro;
private String cidade;
public Endereco() {
}
public Endereco(int id_end, String rua, String bairro, String cidade) {
super();
this.id_end = id_end;
this.rua = rua;
this.bairro = bairro;
this.cidade = cidade;
}
public int getId_end() {
return id_end;
}
public void setId_end(int id) {
this.id_end = id;
}
public String getRua() {
return rua;
}
public void setRua(String rua) {
this.rua = rua;
}
public String getBairro() {
return bairro;
}
public void setBairro(String bairro) {
this.bairro = bairro;
}
public String getCidade() {
return cidade;
}
public void setCidade(String cidade) {
this.cidade = cidade;
}
}
| [
"gerlan.ferr@gmail.com"
] | gerlan.ferr@gmail.com |
bc53aef8a42546bc71db3910387285a67c9134a7 | d30ab70db08ee104a941afeb2417573c2f9d295f | /android/app/src/main/java/com/customeraccount/MainApplication.java | 30c725fbac08712a705c551cdb25be99dc0d2f6a | [] | no_license | AlphaDevTeam/Scotts_Customer_Account | c8aaaaf9209082e794c57924b580be435f9e8cea | 5800459d308965e78542889961ff5a0a21d06887 | refs/heads/master | 2021-01-19T17:20:44.124269 | 2017-05-15T19:41:44 | 2017-05-15T19:41:44 | 82,449,154 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,036 | java | package com.customeraccount;
import android.app.Application;
import android.util.Log;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;
import java.util.Arrays;
import java.util.List;
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage()
);
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
}
}
| [
"dhanush@alphadevs.com"
] | dhanush@alphadevs.com |
7a81b3487a750d1077f7995ca7bcddeaec5f8c47 | a42a0e143efc60cd8bd4c9c0dcc80a03a156a054 | /app/src/test/java/com/jucsinyu/lovecoding/ExampleUnitTest.java | 3c308147a4654fc18e1758ee024a275ed3ac7ae0 | [] | no_license | DurianSUN/Latest-demo-for-Android | b8cc3e1c8cf8c12dd3d570283f96d375cc93bffe | 6cf7bb68d3d9d056229ba0dc4c0793ee80eb9a8b | refs/heads/master | 2021-01-01T05:27:21.196673 | 2016-04-10T14:26:42 | 2016-04-10T14:26:42 | 56,365,235 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 316 | java | package com.jucsinyu.lovecoding;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"1033784992@qq.com"
] | 1033784992@qq.com |
0d75fbb501237b9a28bd8b51f3be4b05a7e2f6d7 | 570f0b28280863dd2b75938680af9d05f235733f | /app/src/main/java/com/example/reqres/model/data.java | 4cbbe99024d582d4ad838b127fe07bb2010038c5 | [] | no_license | mthakkar226/ReqRes | f83b3f0a52b446c3d3b192da476a3dc801bc4222 | c4f2bfc0ea2bca19b853fa324a9839ed5b3f063e | refs/heads/master | 2020-06-18T04:31:14.679955 | 2019-07-10T09:16:08 | 2019-07-10T09:16:08 | 196,146,291 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,830 | java | package com.example.reqres.model;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class data {
@SerializedName("id")
@Expose
Integer id;
@SerializedName("name")
@Expose
String name;
@SerializedName("job")
@Expose
String job;
@SerializedName("createdAt")
@Expose
String createdAt;
@SerializedName("email")
@Expose
String email;
@SerializedName("first_name")
@Expose
String fname;
@SerializedName("last_name")
@Expose
String lname;
@SerializedName("avatar")
@Expose
String avtar;
public data(String name, String job) {
this.name = name;
this.job = job;
}
public data() {
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getJob() {
return job;
}
public void setJob(String job) {
this.job = job;
}
public String getCreatedAt() {
return createdAt;
}
public void setCreatedAt(String createdAt) {
this.createdAt = createdAt;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getFname() {
return fname;
}
public void setFname(String fname) {
this.fname = fname;
}
public String getLname() {
return lname;
}
public void setLname(String lname) {
this.lname = lname;
}
public String getAvtar() {
return avtar;
}
public void setAvtar(String avtar) {
this.avtar = avtar;
}
}
| [
"mthakkar226@gmail.com"
] | mthakkar226@gmail.com |
6e885f43c58fede9ac650dd1d2505562355628df | e9ece774e955791eecd63f62f8dd47bd2e1e3b0e | /src/test/java/stepDefinations/profile_tab.java | 7d53fab289de794f920264500b84fc3f282527b8 | [] | no_license | AlexandrMay/spacepassios2 | eb6dcf78ed0fa1b51d12fe9643e9fbc8c124d58b | fc6548b3235d965760b57810a476823b32002400 | refs/heads/master | 2020-03-22T21:35:03.142541 | 2018-07-12T12:14:14 | 2018-07-12T12:14:14 | 140,697,979 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,026 | java | package stepDefinations;
import Properties.Caps;
import Screens.AuthorizationScreen;
import Screens.BookSpaceScreen;
import Screens.OnboardingScreen;
import Screens.ProfileTabScreen;
import cucumber.api.DataTable;
import cucumber.api.Scenario;
import cucumber.api.java.After;
import cucumber.api.java.en.And;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
import cucumberOptions.DriverRunner;
import org.testng.Assert;
public class profile_tab extends DriverRunner {
@When("^App is started and allow to send notifies for profile_tab feature$")
public void app_is_started_and_allow_to_send_notifies_for_profiletab_feature() throws Throwable {
OnboardingScreen onboardingScreen = new OnboardingScreen(driver);
onboardingScreen.alertIsVisibleAndClicked();
}
@And("^\"([^\"]*)\" is pressed for profile_tab$")
public void something_is_pressed_for_profiletab(String strArg1) throws Throwable {
OnboardingScreen onboardingScreen = new OnboardingScreen(driver);
onboardingScreen.buttonClick(strArg1);
}
@Then("^User is enter credentials and pressed enter button$")
public void user_is_enter_credentials_and_pressed_enter_button(DataTable data) throws Throwable {
AuthorizationScreen authorizationScreen = new AuthorizationScreen(driver);
authorizationScreen.typeEmail(data.raw().get(0).get(0));
authorizationScreen.typePassword(data.raw().get(0).get(1));
authorizationScreen.loginClick();
Thread.sleep(7000);
}
@And("^User is on the profile_tab screen$")
public void user_is_on_the_profiletab_screen() throws Throwable {
BookSpaceScreen bookSpaceScreen = new BookSpaceScreen(driver);
bookSpaceScreen.tapToProfileBar();
}
@Then("^user with valid creds is in system$")
public void user_with_valid_creds_is_in_system(DataTable dataTable) throws Throwable {
ProfileTabScreen profileTabScreen = new ProfileTabScreen(driver);
Assert.assertEquals(profileTabScreen.getUserName(dataTable.raw().get(0).get(0)), dataTable.raw().get(0).get(0));
Assert.assertEquals(profileTabScreen.getUserMail(dataTable.raw().get(0).get(1)), dataTable.raw().get(0).get(1));
}
@When("^User pressed logout button$")
public void user_pressed_logout_button() throws Throwable {
ProfileTabScreen profileTabScreen = new ProfileTabScreen(driver);
profileTabScreen.logoutClick();
}
@Then("^User is on welcome_screen$")
public void user_is_on_welcomescreen() throws Throwable {
OnboardingScreen onboardingScreen = new OnboardingScreen(driver);
onboardingScreen.textIsVisible("Добро пожаловать в SpacePass");
}
@And("^He see the alert and confirm logout$")
public void he_see_the_alert_and_confirm_logout() throws Throwable {
ProfileTabScreen profileTabScreen = new ProfileTabScreen(driver);
profileTabScreen.confirmLogout();
}
}
| [
"maysalexandr@gmail.com"
] | maysalexandr@gmail.com |
8e0092f5fe7ac2f1ba98b6bada1f4f8b7b426c5e | 1d89f07e856611623df943f5f0dee6d2185fb7c4 | /app/src/main/java/com/app/goldenhealth/presenter/impl/CauHoiMucDoPresenterImpl.java | 98b3389d0dcf21d7bae80a3ec85a98f57859fdd1 | [] | no_license | namtv1997/golde | 5d67ea096a465f62ea2ed081ab3b3fea693b8532 | 05cc930568c812b4ee7821da8b155f10d29bcd4d | refs/heads/master | 2020-11-30T18:52:01.067064 | 2019-12-27T14:30:11 | 2019-12-27T14:30:11 | 230,457,807 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 420 | java | package com.app.goldenhealth.presenter.impl;
import com.app.goldenhealth.base.BasePresenterImpl;
import com.app.goldenhealth.presenter.CauHoiMucDoPresenter;
import com.app.goldenhealth.ui.fragment.CauHoiMucDoView;
public class CauHoiMucDoPresenterImpl extends BasePresenterImpl<CauHoiMucDoView> implements CauHoiMucDoPresenter {
public CauHoiMucDoPresenterImpl(CauHoiMucDoView view) {
super(view);
}
} | [
"nam.ta.intern@ntq-solution.com.vn"
] | nam.ta.intern@ntq-solution.com.vn |
b43df7ac4d6810aaf0f5e3c94c7115aceb3c7f79 | 4a68a3afeb5b56cdfb5d84974347f51f5eca5d09 | /src/main/java/study/designpattern/command/commandlist/GarageDoor.java | bb25d0d11bf4e3f878ef4fb69012aa2684ce499c | [] | no_license | luvram/design-pattern-study | 9bbddb2a2ed84806ac2852086657458b8a8245c9 | f50932876be877c8d57306c50a63fc57d3a6b019 | refs/heads/master | 2023-04-15T10:47:28.106438 | 2021-04-20T13:31:35 | 2021-04-20T13:31:35 | 352,915,657 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 586 | java | package study.designpattern.command.commandlist;
public class GarageDoor {
String location;
public GarageDoor(String location) {
this.location = location;
}
public void up() {
System.out.println(location + " garage Door is Up");
}
public void down() {
System.out.println(location + " garage Door is Down");
}
public void stop() {
System.out.println(location + " garage Door is Stopped");
}
public void lightOn() {
System.out.println(location + " garage light is on");
}
public void lightOff() {
System.out.println(location + " garage light is off");
}
}
| [
"sahul0804@gmail.com"
] | sahul0804@gmail.com |
ea75a4625a5d6b57183ca8cd470e8119b7db4a12 | c0605b5048bd9ba4135c951d257d068e75a7eccb | /app/src/main/java/com/cmnd97/bucharestcitytour/WelcomeFragment.java | 164fdb5e4938147788d9f7d703820f3290b1e390 | [] | no_license | cmnd97/BucharestCityTour | dc4d2dedf134f0214e233e4941b5a72b6a34cad5 | fc6951c1d23f14e277a140b6b93905d529d36996 | refs/heads/master | 2021-01-22T01:14:31.338626 | 2017-09-12T10:51:03 | 2017-09-12T10:51:03 | 102,214,920 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,063 | java | package com.cmnd97.bucharestcitytour;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
public class WelcomeFragment extends Fragment {
private OnFragmentInteractionListener mListener;
public WelcomeFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_welcome, container, false);
MainMenu baseActivity = (MainMenu) getActivity();
if (!baseActivity.isLocationEnabled())
rootView.findViewById(R.id.loc_tip).setVisibility(View.VISIBLE);
return rootView;
}
@Override
public void onDetach() {
super.onDetach();
mListener = null;
}
interface OnFragmentInteractionListener {
void onFragmentInteraction(Uri uri);
}
}
| [
"cristian.mandica97@gmail.com"
] | cristian.mandica97@gmail.com |
7b1ad0cf5a7701ffda3f402508b9685af5e6b1b6 | 66e82cdae6b47ccce2729d91c933a0996ccfb07c | /doc/ESA/JPA_Factura/JavaSource/cursojpa/facturacion/controladores/BusquedaProductoControlador.java | 7be359eb7d5637385babdc76396fdba71058f83f | [] | no_license | hernanludena/kendo-boostrap-angular-exercises | 5813c2eeb656c63294c2b826067b652e84f83d2b | ce2645299363b0fc09f9e10636eec40f5ea14073 | refs/heads/master | 2022-06-09T13:23:12.279702 | 2020-05-05T18:41:01 | 2020-05-05T18:41:01 | 261,554,164 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,141 | java | package cursojpa.facturacion.controladores;
import java.util.ArrayList;
import java.util.List;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import cursojpa.facturacion.entidades.Producto;
import cursojpa.facturacion.servicios.ProductoServicio;
@ManagedBean
public class BusquedaProductoControlador {
@EJB
private ProductoServicio productoServicio;
private List<Producto> productos;
private List<Producto> productosLigero;
public BusquedaProductoControlador() {
productos = new ArrayList<Producto>();
}
public void buscarTodos() {
productos = productoServicio.buscarProductos();
productosLigero = new ArrayList<Producto>();
}
public void buscarLigero() {
productosLigero = productoServicio.buscarProductosLigero();
productos = new ArrayList<Producto>();
}
public List<Producto> getProductos() {
return productos;
}
public void setProductos(List<Producto> productos) {
this.productos = productos;
}
public List<Producto> getProductosLigero() {
return productosLigero;
}
public void setProductosLigero(List<Producto> productosLigero) {
this.productosLigero = productosLigero;
}
}
| [
"hludena@todo1.com"
] | hludena@todo1.com |
8b487f8bbbd5c27d4a45da5038042f9836f4ab69 | 75950d61f2e7517f3fe4c32f0109b203d41466bf | /modules/tags/fabric3-modules-parent-pom-0.7/kernel/api/fabric3-api/src/main/java/org/fabric3/api/annotation/logging/LogLevels.java | 94784705a414bb56be028d61b6501a03e84371ae | [] | no_license | codehaus/fabric3 | 3677d558dca066fb58845db5b0ad73d951acf880 | 491ff9ddaff6cb47cbb4452e4ddbf715314cd340 | refs/heads/master | 2023-07-20T00:34:33.992727 | 2012-10-31T16:32:19 | 2012-10-31T16:32:19 | 36,338,853 | 0 | 0 | null | null | null | null | MacCentralEurope | Java | false | false | 2,529 | java | /*
* Fabric3
* Copyright © 2008 Metaform Systems Limited
*
* This proprietary software may be used only connection with the Fabric3 license
* (the “License”), a copy of which is included in the software or may be
* obtained at: http://www.metaformsystems.com/licenses/license.html.
* Software distributed under the License is distributed on an “as is” basis,
* without warranties or conditions of any kind. See the License for the
* specific language governing permissions and limitations of use of the software.
* This software is distributed in conjunction with other software licensed under
* different terms. See the separate licenses for those programs included in the
* distribution for the permitted and restricted uses of such software.
*
*/
package org.fabric3.api.annotation.logging;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
/**
* Defines logging levels recognised by the {@link LogLevel} annotation.
* The log levels supported by the logging implementation underlying any given
* monitor factory implementation may not match the levels defined here and so
* monitor factories may be required to carry out a mapping between levels
**/
public enum LogLevels {
SEVERE,
WARNING,
INFO,
CONFIG,
FINE,
FINER,
FINEST;
/**
* Encapsulates the logic used to read monitor method log level annotations.
* Argument <code>Method</code> instances should be annotated with a {@link LogLevel} directly
* or with one of the level annotations which have a {@link LogLevel} meta-annotation.
* @param the annotated monitor method
* @return the annotated <code>LogLevels</code> value
*/
public static LogLevels getAnnotatedLogLevel(Method method) {
LogLevels level = null;
LogLevel annotation = method.getAnnotation(LogLevel.class);
if (annotation != null) {
level = annotation.value();
}
if (level == null) {
for (Annotation methodAnnotation : method.getDeclaredAnnotations()) {
Class<? extends Annotation> annotationType = methodAnnotation.annotationType();
LogLevel logLevel = annotationType.getAnnotation(LogLevel.class);
if (logLevel != null) {
level = logLevel.value();
break;
}
}
}
return level;
}
}
| [
"meerajk@83866bfc-822f-0410-aa35-bd5043b85eaf"
] | meerajk@83866bfc-822f-0410-aa35-bd5043b85eaf |
1138c3c87f2f7f262b6bfbbbb297cca36e6e6e77 | 0223b74dbda5e9ce6b003a02f3379ee0e43b7ac7 | /xwder-framework-utils/src/main/java/com/xwder/framework/utils/reflect/ReflectUtils.java | 6048a68e326d7bcc92f2ea42b2e9039edc983434 | [] | no_license | xwder/xwder | 9b7ea06daabf50dc703c7c33946a447a1f338e19 | e382f6be9907aeb37e3d3a11823924ef181e8db7 | refs/heads/master | 2023-07-07T02:35:59.352888 | 2019-11-26T16:36:46 | 2019-11-26T16:36:46 | 390,979,051 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 14,278 | java | package com.xwder.framework.utils.reflect;
import com.xwder.framework.utils.date.DateUtils;
import com.xwder.framework.utils.text.Convert;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.Validate;
import org.apache.poi.ss.usermodel.DateUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.lang.reflect.*;
import java.util.Date;
/**
* 反射工具类. 提供调用getter/setter方法, 访问私有变量, 调用私有方法, 获取泛型类型Class, 被AOP过的真实类等工具函数.
*
* @author ruoyi
*/
@SuppressWarnings("rawtypes")
public class ReflectUtils
{
private static final String SETTER_PREFIX = "set";
private static final String GETTER_PREFIX = "get";
private static final String CGLIB_CLASS_SEPARATOR = "$$";
private static Logger logger = LoggerFactory.getLogger(ReflectUtils.class);
/**
* 调用Getter方法.
* 支持多级,如:对象名.对象名.方法
*/
@SuppressWarnings("unchecked")
public static <E> E invokeGetter(Object obj, String propertyName)
{
Object object = obj;
for (String name : StringUtils.split(propertyName, "."))
{
String getterMethodName = GETTER_PREFIX + StringUtils.capitalize(name);
object = invokeMethod(object, getterMethodName, new Class[] {}, new Object[] {});
}
return (E) object;
}
/**
* 调用Setter方法, 仅匹配方法名。
* 支持多级,如:对象名.对象名.方法
*/
public static <E> void invokeSetter(Object obj, String propertyName, E value)
{
Object object = obj;
String[] names = StringUtils.split(propertyName, ".");
for (int i = 0; i < names.length; i++)
{
if (i < names.length - 1)
{
String getterMethodName = GETTER_PREFIX + StringUtils.capitalize(names[i]);
object = invokeMethod(object, getterMethodName, new Class[] {}, new Object[] {});
}
else
{
String setterMethodName = SETTER_PREFIX + StringUtils.capitalize(names[i]);
invokeMethodByName(object, setterMethodName, new Object[] { value });
}
}
}
/**
* 直接读取对象属性值, 无视private/protected修饰符, 不经过getter函数.
*/
@SuppressWarnings("unchecked")
public static <E> E getFieldValue(final Object obj, final String fieldName)
{
Field field = getAccessibleField(obj, fieldName);
if (field == null)
{
logger.debug("在 [" + obj.getClass() + "] 中,没有找到 [" + fieldName + "] 字段 ");
return null;
}
E result = null;
try
{
result = (E) field.get(obj);
}
catch (IllegalAccessException e)
{
logger.error("不可能抛出的异常{}", e.getMessage());
}
return result;
}
/**
* 直接设置对象属性值, 无视private/protected修饰符, 不经过setter函数.
*/
public static <E> void setFieldValue(final Object obj, final String fieldName, final E value)
{
Field field = getAccessibleField(obj, fieldName);
if (field == null)
{
// throw new IllegalArgumentException("在 [" + obj.getClass() + "] 中,没有找到 [" + fieldName + "] 字段 ");
logger.debug("在 [" + obj.getClass() + "] 中,没有找到 [" + fieldName + "] 字段 ");
return;
}
try
{
field.set(obj, value);
}
catch (IllegalAccessException e)
{
logger.error("不可能抛出的异常: {}", e.getMessage());
}
}
/**
* 直接调用对象方法, 无视private/protected修饰符.
* 用于一次性调用的情况,否则应使用getAccessibleMethod()函数获得Method后反复调用.
* 同时匹配方法名+参数类型,
*/
@SuppressWarnings("unchecked")
public static <E> E invokeMethod(final Object obj, final String methodName, final Class<?>[] parameterTypes,
final Object[] args)
{
if (obj == null || methodName == null)
{
return null;
}
Method method = getAccessibleMethod(obj, methodName, parameterTypes);
if (method == null)
{
logger.debug("在 [" + obj.getClass() + "] 中,没有找到 [" + methodName + "] 方法 ");
return null;
}
try
{
return (E) method.invoke(obj, args);
}
catch (Exception e)
{
String msg = "method: " + method + ", obj: " + obj + ", args: " + args + "";
throw convertReflectionExceptionToUnchecked(msg, e);
}
}
/**
* 直接调用对象方法, 无视private/protected修饰符,
* 用于一次性调用的情况,否则应使用getAccessibleMethodByName()函数获得Method后反复调用.
* 只匹配函数名,如果有多个同名函数调用第一个。
*/
@SuppressWarnings("unchecked")
public static <E> E invokeMethodByName(final Object obj, final String methodName, final Object[] args)
{
Method method = getAccessibleMethodByName(obj, methodName, args.length);
if (method == null)
{
// 如果为空不报错,直接返回空。
logger.debug("在 [" + obj.getClass() + "] 中,没有找到 [" + methodName + "] 方法 ");
return null;
}
try
{
// 类型转换(将参数数据类型转换为目标方法参数类型)
Class<?>[] cs = method.getParameterTypes();
for (int i = 0; i < cs.length; i++)
{
if (args[i] != null && !args[i].getClass().equals(cs[i]))
{
if (cs[i] == String.class)
{
args[i] = Convert.toStr(args[i]);
if (StringUtils.endsWith((String) args[i], ".0"))
{
args[i] = StringUtils.substringBefore((String) args[i], ".0");
}
}
else if (cs[i] == Integer.class)
{
args[i] = Convert.toInt(args[i]);
}
else if (cs[i] == Long.class)
{
args[i] = Convert.toLong(args[i]);
}
else if (cs[i] == Double.class)
{
args[i] = Convert.toDouble(args[i]);
}
else if (cs[i] == Float.class)
{
args[i] = Convert.toFloat(args[i]);
}
else if (cs[i] == Date.class)
{
if (args[i] instanceof String)
{
args[i] = DateUtils.parseDate(args[i]);
}
else
{
args[i] = DateUtil.getJavaDate((Double) args[i]);
}
}
}
}
return (E) method.invoke(obj, args);
}
catch (Exception e)
{
String msg = "method: " + method + ", obj: " + obj + ", args: " + args + "";
throw convertReflectionExceptionToUnchecked(msg, e);
}
}
/**
* 循环向上转型, 获取对象的DeclaredField, 并强制设置为可访问.
* 如向上转型到Object仍无法找到, 返回null.
*/
public static Field getAccessibleField(final Object obj, final String fieldName)
{
// 为空不报错。直接返回 null
if (obj == null)
{
return null;
}
Validate.notBlank(fieldName, "fieldName can't be blank");
for (Class<?> superClass = obj.getClass(); superClass != Object.class; superClass = superClass.getSuperclass())
{
try
{
Field field = superClass.getDeclaredField(fieldName);
makeAccessible(field);
return field;
}
catch (NoSuchFieldException e)
{
continue;
}
}
return null;
}
/**
* 循环向上转型, 获取对象的DeclaredMethod,并强制设置为可访问.
* 如向上转型到Object仍无法找到, 返回null.
* 匹配函数名+参数类型。
* 用于方法需要被多次调用的情况. 先使用本函数先取得Method,然后调用Method.invoke(Object obj, Object... args)
*/
public static Method getAccessibleMethod(final Object obj, final String methodName,
final Class<?>... parameterTypes)
{
// 为空不报错。直接返回 null
if (obj == null)
{
return null;
}
Validate.notBlank(methodName, "methodName can't be blank");
for (Class<?> searchType = obj.getClass(); searchType != Object.class; searchType = searchType.getSuperclass())
{
try
{
Method method = searchType.getDeclaredMethod(methodName, parameterTypes);
makeAccessible(method);
return method;
}
catch (NoSuchMethodException e)
{
continue;
}
}
return null;
}
/**
* 循环向上转型, 获取对象的DeclaredMethod,并强制设置为可访问.
* 如向上转型到Object仍无法找到, 返回null.
* 只匹配函数名。
* 用于方法需要被多次调用的情况. 先使用本函数先取得Method,然后调用Method.invoke(Object obj, Object... args)
*/
public static Method getAccessibleMethodByName(final Object obj, final String methodName, int argsNum)
{
// 为空不报错。直接返回 null
if (obj == null)
{
return null;
}
Validate.notBlank(methodName, "methodName can't be blank");
for (Class<?> searchType = obj.getClass(); searchType != Object.class; searchType = searchType.getSuperclass())
{
Method[] methods = searchType.getDeclaredMethods();
for (Method method : methods)
{
if (method.getName().equals(methodName) && method.getParameterTypes().length == argsNum)
{
makeAccessible(method);
return method;
}
}
}
return null;
}
/**
* 改变private/protected的方法为public,尽量不调用实际改动的语句,避免JDK的SecurityManager抱怨。
*/
public static void makeAccessible(Method method)
{
if ((!Modifier.isPublic(method.getModifiers()) || !Modifier.isPublic(method.getDeclaringClass().getModifiers()))
&& !method.isAccessible())
{
method.setAccessible(true);
}
}
/**
* 改变private/protected的成员变量为public,尽量不调用实际改动的语句,避免JDK的SecurityManager抱怨。
*/
public static void makeAccessible(Field field)
{
if ((!Modifier.isPublic(field.getModifiers()) || !Modifier.isPublic(field.getDeclaringClass().getModifiers())
|| Modifier.isFinal(field.getModifiers())) && !field.isAccessible())
{
field.setAccessible(true);
}
}
/**
* 通过反射, 获得Class定义中声明的泛型参数的类型, 注意泛型必须定义在父类处
* 如无法找到, 返回Object.class.
*/
@SuppressWarnings("unchecked")
public static <T> Class<T> getClassGenricType(final Class clazz)
{
return getClassGenricType(clazz, 0);
}
/**
* 通过反射, 获得Class定义中声明的父类的泛型参数的类型.
* 如无法找到, 返回Object.class.
*/
public static Class getClassGenricType(final Class clazz, final int index)
{
Type genType = clazz.getGenericSuperclass();
if (!(genType instanceof ParameterizedType))
{
logger.debug(clazz.getSimpleName() + "'s superclass not ParameterizedType");
return Object.class;
}
Type[] params = ((ParameterizedType) genType).getActualTypeArguments();
if (index >= params.length || index < 0)
{
logger.debug("Index: " + index + ", Size of " + clazz.getSimpleName() + "'s Parameterized Type: "
+ params.length);
return Object.class;
}
if (!(params[index] instanceof Class))
{
logger.debug(clazz.getSimpleName() + " not set the actual class on superclass generic parameter");
return Object.class;
}
return (Class) params[index];
}
public static Class<?> getUserClass(Object instance)
{
if (instance == null)
{
throw new RuntimeException("Instance must not be null");
}
Class clazz = instance.getClass();
if (clazz != null && clazz.getName().contains(CGLIB_CLASS_SEPARATOR))
{
Class<?> superClass = clazz.getSuperclass();
if (superClass != null && !Object.class.equals(superClass))
{
return superClass;
}
}
return clazz;
}
/**
* 将反射时的checked exception转换为unchecked exception.
*/
public static RuntimeException convertReflectionExceptionToUnchecked(String msg, Exception e)
{
if (e instanceof IllegalAccessException || e instanceof IllegalArgumentException
|| e instanceof NoSuchMethodException)
{
return new IllegalArgumentException(msg, e);
}
else if (e instanceof InvocationTargetException)
{
return new RuntimeException(msg, ((InvocationTargetException) e).getTargetException());
}
return new RuntimeException(msg, e);
}
}
| [
"xwdercom@gmail.com"
] | xwdercom@gmail.com |
2a7f66c6184d0d71d609af17eff155bc4695c098 | a4bbfc28cac46ab2200cd680afde0f3425239252 | /Lab4/lab4_part2_shapes/Circle.java | 68c005b7b94dad6646e427942925a7465dbef326 | [] | no_license | wilsonteng97/CZ2002-Object-Oriented-Design-Programming-Labs | 2cb2403e2d3130c5ca37aac9e31c58a98547b9b2 | cd5c913736c2dce8e35edec8f3c9199e37397031 | refs/heads/master | 2022-02-24T13:19:38.455558 | 2019-10-12T04:50:11 | 2019-10-12T04:50:11 | 206,215,303 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 854 | java | package lab4_part2_shapes;
import java.lang.Math;
import java.util.Scanner;
public class Circle extends Shape {
private static final int DIMENSION = 2;
private static final double PI = Math.PI;
private double radius;
private int dimension;
// Constructor
public Circle() {
this.dimension = DIMENSION;
}
// Override Methods
@Override
public double getArea() {
return radius * radius * PI;
}
@Override
public int getDimension() {
return this.dimension;
}
@Override
public void getMeasurements() {
this.setRadius();
}
// Methods
public double getCircumference() {
return 2 * PI * radius;
}
public double getRadius() {
return this.radius;
}
public void setRadius() {
Scanner sc = new Scanner(System.in);
System.out.print("Enter Radius: ");
double radius = sc.nextDouble();
this.radius = radius;
}
}
| [
"wilsonteng89@gmail.com"
] | wilsonteng89@gmail.com |
9113970ae20a4a8e719c2039a5c849c415133cb2 | 8b93f7dc20bed3a1b2011915bd3f1be4e8d50d3c | /src/main/java/io/github/leleueri/keyring/KeystoreVerticle.java | 4d0abcdc9128e67ba07d1d6fa1e11cb7fa9e3cae | [
"Apache-2.0"
] | permissive | leleueri/keyring | 78c4d12a4beeff24c1d393a47279bddbec5b043c | 403ed8276e853dfc576abf8d03c288f844dc15f1 | refs/heads/master | 2021-01-10T08:39:39.018921 | 2016-01-20T20:07:33 | 2016-01-20T20:07:33 | 43,837,800 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,596 | java | package io.github.leleueri.keyring;
import io.github.leleueri.keyring.bean.SecretKey;
import io.github.leleueri.keyring.exception.KeyringApplicativeException;
import io.github.leleueri.keyring.exception.KeyringConfigurationException;
import io.github.leleueri.keyring.provider.KeystoreProvider;
import io.vertx.core.AbstractVerticle;
import io.vertx.core.Future;
import io.vertx.core.json.Json;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.logging.Logger;
import static io.github.leleueri.keyring.ConfigConstants.*;
/**
* Created by eric on 07/10/15.
*/
public class KeystoreVerticle extends AbstractVerticle {
private KeystoreProvider provider;
private final Logger LOGGER = Logger.getLogger(getClass().getName());
public static final String LIST_ALIASES = "keystore.list.aliases";
public static final String LIST_SECRET_KEYS = "keystore.list.keys";
public static final String GET_SECRET_KEY = "keystore.get.key";
public static final String DELETE_SECRET_KEY = "keystore.delete.key";
public static final String POST_SECRET_KEY = "keystore.post.key";
@Override
public void start(Future<Void> fut) throws Exception {
String type = config().getString(APP_KEYSTORE_TYPE, APP_KEYSTORE_DEFAULT_TYPE);
if (!type.equals(APP_KEYSTORE_DEFAULT_TYPE)) {
throw new KeyringConfigurationException("Only the "+APP_KEYSTORE_DEFAULT_TYPE+" type is authorized for the keystore '" + APP_KEYSTORE_TYPE +"'");
}
String path = config().getString(APP_KEYSTORE_PATH, APP_KEYSTORE_DEFAULT_PATH);
String pwd = config().getString(APP_KEYSTORE_PWD);
String keypwd = config().getString(APP_KEYSTORE_SECRET_KEY_PWD);
provider = new KeystoreProvider(type, pwd, path, keypwd);
// register this Verticle as consumer of keystore events
// - list all secret key aliases
vertx.eventBus().consumer(LIST_ALIASES, message -> {
LOGGER.fine("[Worker] list all aliases " + Thread.currentThread().getName());
try {
Set<String> aliases = provider.listAlias();
if (aliases.isEmpty()) {
message.reply(null);
} else {
message.reply(Json.encodePrettily(aliases)); // to reply with an object we must have a message codec
}
} catch (KeyringApplicativeException e) {
LOGGER.throwing(getClass().getName(), "Exception on listAllAliases", e);
message.fail(500, e.getMessage()); // create an error object to return in JSON format??
}
});
// - list all secret keys
vertx.eventBus().consumer(LIST_SECRET_KEYS, message -> {
LOGGER.fine("[Worker] list all keys " + Thread.currentThread().getName());
try {
Map<String, SecretKey> keys = provider.listSecretKeys();
if (keys == null || keys.isEmpty()) {
message.reply(null);
} else {
message.reply(Json.encodePrettily(keys)); // to reply with an object we must have a message codec
}
} catch (KeyringApplicativeException e) {
LOGGER.throwing(getClass().getName(), "Exception on listAllSecretKeys", e);
message.fail(500, e.getMessage()); // create an error object to return in JSON format??
}
});
// - Get a secret key description
vertx.eventBus().consumer(GET_SECRET_KEY, message -> {
LOGGER.fine("[Worker] get a key " + Thread.currentThread().getName());
try {
Optional<SecretKey> key = provider.getSecretKey((String) message.body());
if (key.isPresent()) {
message.reply(Json.encodePrettily(key.get())); // to reply with an object we must have a message codec
} else {
message.reply(null);
}
} catch (KeyringApplicativeException e) {
LOGGER.throwing(getClass().getName(), "Exception on getSecretKey", e);
message.fail(500, e.getMessage()); // create an error object to return in JSON format??
}
});
// - create a secret key description
vertx.eventBus().consumer(POST_SECRET_KEY, message -> {
LOGGER.fine("[Worker] post a key " + Thread.currentThread().getName());
try {
Optional<SecretKey> key = Optional.ofNullable((String) message.body()).map(str -> Json.decodeValue(str, SecretKey.class));
if (key.isPresent()) {
final SecretKey secretKey = key.get();
if (secretKey.getAlias() == null || secretKey.getAlias().isEmpty()) {
message.fail(400, "Alias is missing");
}
if (secretKey.getB64Key() == null || secretKey.getB64Key().isEmpty()) {
message.fail(400, "Key is missing");
}
if (secretKey.getAlgorithm() == null || secretKey.getAlgorithm().isEmpty()) {
message.fail(400, "Algorithm is missing");
}
if(provider.getSecretKey(secretKey.getAlias()).isPresent()) {
message.fail(409, "SecretKey already exists");
} else {
provider.addSecretKey(secretKey);
message.reply(secretKey.getAlias());
}
} else {
message.fail(400, "SecretKey is missing from the request body");
}
} catch (KeyringApplicativeException e) {
LOGGER.throwing(getClass().getName(), "Exception on postSecretKey", e);
message.fail(500, e.getMessage()); // create an error object to return in JSON format??
}
});
// - Delete a secret key description
vertx.eventBus().consumer(DELETE_SECRET_KEY, message -> {
LOGGER.fine("[Worker] delete a key " + Thread.currentThread().getName());
try {
provider.deleteSecretKey((String) message.body());
message.reply(null);
} catch (KeyringApplicativeException e) {
LOGGER.throwing(getClass().getName(), "Exception on deleteSecretKey", e);
message.fail(500, e.getMessage()); // create an error object to return in JSON format??
}
});
}
}
| [
"eric.leleu.dev+github@gmail.com"
] | eric.leleu.dev+github@gmail.com |
d176fb5fd9e67c07d7f92cc5d8fd321bfd8124e6 | 4047d224c991a73cff9ce8e831391a6446512bfb | /src/main/java/tutoria/domingo/web/WebCliente.java | 1fb8182c2f4d370e446ef3d0a8ac813ee5d85e20 | [] | no_license | Sergiops8/back_domingo | 597e41bd774a0921303b4e13fd44f3a2f3d65e35 | 9fff26bf529df52ea69ddc0aa99749173f95cfb9 | refs/heads/master | 2023-08-20T06:32:07.650436 | 2021-10-26T01:52:07 | 2021-10-26T01:52:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,230 | java | /*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package tutoria.domingo.web;
import java.util.List;
import java.util.Optional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;
import tutoria.domingo.modelo.Cliente;
import tutoria.domingo.servicios.ServiciosCliente;
/**
*
* @author Sergio Peña
*/
@RestController
@RequestMapping("/api/Client")
@CrossOrigin(origins = "*", methods= {RequestMethod.GET,RequestMethod.POST,RequestMethod.PUT,RequestMethod.DELETE})
public class WebCliente {
@Autowired
private ServiciosCliente servicios;
@GetMapping("/all")
public List <Cliente> getCliente(){
return servicios.getAll();
}
@GetMapping("/{id}")
public Optional<Cliente> getCliente(@PathVariable("id") int clientid) {
return servicios.getCliente(clientid);
}
@PostMapping("/save")
@ResponseStatus(HttpStatus.CREATED)
public Cliente save(@RequestBody Cliente cliente) {
return servicios.save(cliente);
}
@PutMapping("/update")
@ResponseStatus(HttpStatus.CREATED)
public Cliente update(@RequestBody Cliente cliente) {
return servicios.update(cliente);
}
@DeleteMapping("/{id}")
@ResponseStatus(HttpStatus.NO_CONTENT)
public boolean delete(@PathVariable("id") int clienteId) {
return servicios.deleteClient(clienteId);
}
}
| [
"sergio.pena1.mt@correo.usa.edu.co"
] | sergio.pena1.mt@correo.usa.edu.co |
93e2805a7940f14680ae769107088a791f4ca817 | 77b819c4cbd8ea2599ad6745a44444a610090502 | /selinium/src/main/java/selinium/linkAccess.java | a76e9807f8a3284451733d3932ad847440880435 | [] | no_license | santhosh-01/selenium_example | 934be29e09c4e867e9219e073cc164c0419e7a73 | 269efc07af1d6abe2f468c5e6e1a7cef22692092 | refs/heads/master | 2023-08-21T23:02:23.725298 | 2021-10-17T14:07:15 | 2021-10-17T14:07:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,281 | java | package selinium;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
public class linkAccess {
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver", "C:\\Users\\Admin\\Documents\\Work\\Selinium\\Drivers\\Chromedriver\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.get("http://www.leafground.com/pages/Edit.html");
WebElement emailBox = driver.findElement(By.id("email"));
emailBox.sendKeys("sant17341.ec@rmkec.ac.in");
WebElement appendBox = driver.findElement(By.xpath("//*[@id=\'contentblock\']/section/div[2]/div/div/input"));
appendBox.sendKeys(Keys.BACK_SPACE+"sant17341.ec@rmkec.ac.in");
WebElement getText = driver.findElement(By.name("username"));
System.out.println(getText.getAttribute("value"));
WebElement clearBox = driver.findElement(By.xpath("//*[@id=\'contentblock\']/section/div[4]/div/div/input"));
clearBox.clear();
WebElement isDisable = driver.findElement(By.xpath("//*[@id=\'contentblock\']/section/div[5]/div/div/input"));
System.out.println(isDisable.isEnabled());
}
} | [
"Admin@DESKTOP-Q7J3BI5"
] | Admin@DESKTOP-Q7J3BI5 |
bbad47ed24e84cf9d7658c0089f510bf8f3310c9 | d6e251b244f224e766a843363165b084d1fa5e84 | /app/src/main/java/com/techmorshed/blogapplication/adapter/BlogRecyclerAdapter.java | dab6d6702166bd5e140fdc8cd6b3b881ae5cb115 | [] | no_license | Morshed-islam/BlogApplication | 71c60c3733008c7750f6b3c51b903f0368fccb3a | 653e048a35c74a14115d5dea619d6d76c8fb29df | refs/heads/master | 2021-04-15T06:13:45.829075 | 2018-03-23T20:18:23 | 2018-03-23T20:18:23 | 126,534,821 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,488 | java | package com.techmorshed.blogapplication.adapter;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.text.format.DateFormat;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.firestore.DocumentSnapshot;
import com.google.firebase.firestore.FirebaseFirestore;
import com.techmorshed.blogapplication.R;
import com.techmorshed.blogapplication.model.BlogPost;
import java.util.Date;
import java.util.List;
import de.hdodenhof.circleimageview.CircleImageView;
/**
* Created by Morshed on 3/23/2018.
*/
public class BlogRecyclerAdapter extends RecyclerView.Adapter<BlogRecyclerAdapter.ViewHolder> {
public List<BlogPost> blog_list;
public Context context;
private FirebaseFirestore firebaseFirestore;
public BlogRecyclerAdapter(List<BlogPost> blog_list){
this.blog_list = blog_list;
}
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.blog_list_item, parent, false);
context = parent.getContext();
firebaseFirestore = FirebaseFirestore.getInstance();
return new ViewHolder(view);
}
@Override
public void onBindViewHolder(final ViewHolder holder, int position) {
String desc_data = blog_list.get(position).getDesc();
holder.setDescText(desc_data);
String image_url = blog_list.get(position).getImage_url();
holder.setBlogImage(image_url);
String user_id = blog_list.get(position).getUser_id();
//User Data will be retrieved here...
firebaseFirestore.collection("Users").document(user_id).get().addOnCompleteListener(new OnCompleteListener<DocumentSnapshot>() {
@Override
public void onComplete(@NonNull Task<DocumentSnapshot> task) {
if(task.isSuccessful()){
String userName = task.getResult().getString("name");
String userImage = task.getResult().getString("image");
holder.setUserData(userName, userImage);
} else {
//Firebase Exception
}
}
});
//long millisecond = blog_list.get(position).getDesc();
// String dateString = DateFormat.format("MM/dd/yyyy", new Date(millisecond)).toString();
//holder.setTime(dateString);
}
@Override
public int getItemCount() {
return blog_list.size();
}
public class ViewHolder extends RecyclerView.ViewHolder {
private View mView;
private TextView descView;
private ImageView blogImageView;
private TextView blogDate;
private TextView blogUserName;
private CircleImageView blogUserImage;
public ViewHolder(View itemView) {
super(itemView);
mView = itemView;
}
public void setDescText(String descText){
descView = mView.findViewById(R.id.blog_desc);
descView.setText(descText);
}
public void setBlogImage(String downloadUri){
blogImageView = mView.findViewById(R.id.blog_image);
RequestOptions requestOptions = new RequestOptions();
requestOptions.placeholder(R.drawable.image_placeholder);
Glide.with(context).applyDefaultRequestOptions(requestOptions).load(downloadUri).into(blogImageView);
}
public void setTime(String date) {
blogDate = mView.findViewById(R.id.blog_date);
blogDate.setText(date);
}
public void setUserData(String name, String image){
blogUserImage = mView.findViewById(R.id.blog_user_image);
blogUserName = mView.findViewById(R.id.blog_user_name);
blogUserName.setText(name);
RequestOptions placeholderOption = new RequestOptions();
placeholderOption.placeholder(R.drawable.profile_placeholder);
Glide.with(context).applyDefaultRequestOptions(placeholderOption).load(image).into(blogUserImage);
}
}
}
| [
"morshedislam21@gmail.com"
] | morshedislam21@gmail.com |
5766d8e935e20ed860bafd43081a4120c989294d | 81a6dca5c8f3dec7f0495b2c3ef8007c8a060612 | /hybris/bin/platform/bootstrap/gensrc/de/hybris/platform/smarteditwebservices/data/SmarteditLanguageData.java | ab4e251bf0cf15d2679807d1bd9b55e09ecdb58a | [] | no_license | BaggaShivanshu/hybris-hy400 | d8dbf4aba43b3dccfef7582b687480dafaa69b0b | 6914d3fc7947dcfb2bbe87f59d636525187c72ad | refs/heads/master | 2020-04-22T09:41:49.504834 | 2018-12-04T18:44:28 | 2018-12-04T18:44:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,023 | java | /*
* ----------------------------------------------------------------
* --- WARNING: THIS FILE IS GENERATED AND WILL BE OVERWRITTEN!
* --- Generated at May 8, 2018 2:42:48 PM
* ----------------------------------------------------------------
*
* [y] hybris Platform
*
* Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved.
*
* This software is the confidential and proprietary information of SAP
* ("Confidential Information"). You shall not disclose such Confidential
* Information and shall use it only in accordance with the terms of the
* license agreement you entered into with SAP.
*/
package de.hybris.platform.smarteditwebservices.data;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* Language data
*/
@ApiModel(value="languageData", description="Language data")
public class SmarteditLanguageData implements Serializable
{
/** Default serialVersionUID value. */
private static final long serialVersionUID = 1L;
/** The name of the language data<br/><br/><i>Generated property</i> for <code>SmarteditLanguageData.name</code> property defined at extension <code>smarteditwebservices</code>. */
@ApiModelProperty(name="name", value="The name of the language data", required=true, example="English")
private String name;
/** The iso code of the language data<br/><br/><i>Generated property</i> for <code>SmarteditLanguageData.isoCode</code> property defined at extension <code>smarteditwebservices</code>. */
@ApiModelProperty(name="isoCode", value="The iso code of the language data", required=true, example="en")
private String isoCode;
public SmarteditLanguageData()
{
// default constructor
}
public void setName(final String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public void setIsoCode(final String isoCode)
{
this.isoCode = isoCode;
}
public String getIsoCode()
{
return isoCode;
}
}
| [
"richard.leiva@digitaslbi.com"
] | richard.leiva@digitaslbi.com |
18e09708cf099a042b68ee183f1194daa3ad455b | e054625d2c83c00240d0ab9e6c810e3392d22841 | /eidpweb/src/main/java/uk/ac/ucl/eidp/service/AuthResource.java | 32debb3111983bf5e4cef789ab80ced9f516bcd8 | [
"Apache-2.0"
] | permissive | UCL/EIDP-4 | aa070aa57e362218185b31587135ea170f35e271 | 7a14670d8737b493cea54b09c110611cd289ba5f | refs/heads/master | 2021-06-11T14:03:06.717047 | 2017-06-28T14:16:49 | 2017-06-28T14:16:49 | 34,864,911 | 0 | 0 | Apache-2.0 | 2021-02-15T04:12:44 | 2015-04-30T16:32:35 | Java | UTF-8 | Java | false | false | 2,377 | java | package uk.ac.ucl.eidp.service;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import uk.ac.ucl.eidp.auth.AuthAccess;
import uk.ac.ucl.eidp.auth.AuthControllerLocal;
import uk.ac.ucl.eidp.auth.AuthLogin;
import uk.ac.ucl.eidp.service.model.AuthToken;
import javax.annotation.security.PermitAll;
import javax.ejb.EJB;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.Consumes;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
/**
* REST resource for authentication and authorisation.
* @author David Guzman {@literal d.guzman at ucl.ac.uk}
*/
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@Api(protocols = "https")
public class AuthResource {
@EJB
private AuthControllerLocal authController;
/**
* Authenticates user obtaining credentials from the http request.
* @param request {@link HttpServletRequest} call
* @param loginElement {@link AuthLogin} object containing the credentials.
* @return A {@link AuthAccess} containing the authenticated credentials and token.
*/
@POST
@Path("login")
@PermitAll
@ApiOperation(
value = "Authenticates client on an EIDP instance.",
notes = "Authentication based on userid and password. It returns a JWT token.",
response = AuthToken.class,
tags = { }
)
@ApiResponses(value = {
@ApiResponse(
code = 201,
message = "Authentication successful.",
response = AuthToken.class),
@ApiResponse(
code = 401,
message = "Unauthorised or authentication failed.",
response = AuthToken.class)
}
)
public Response login(@Context HttpServletRequest request, AuthLogin loginElement) {
AuthAccess accessElement = authController.login(loginElement);
if (accessElement != null) {
request.getSession().setAttribute(AuthAccess.PARAM_AUTH_ID, accessElement.getAuthId());
request.getSession().setAttribute(AuthAccess.PARAM_AUTH_TOKEN, accessElement.getAuthToken());
}
return Response.ok().entity("magic!").build();
}
}
| [
"d.guzman@ucl.ac.uk"
] | d.guzman@ucl.ac.uk |
224db2fe6defd14e29d5ae233b4546644c578607 | d5c6333459524d0e8ebb751f05e9c34006cb8e95 | /src/main/java/gxj/study/demo/juc/VolatileExample3.java | 08f77b5ab59b43c92a2377f8391ae84f84f0bb0e | [] | no_license | shineguo1/springDemo | 2cafca5b3f10da40946d5ab94b88eb4cfe49b2d3 | 97dbeafa911308ef3a111cc967a519166aa14de9 | refs/heads/master1 | 2023-06-21T16:15:26.076134 | 2023-06-01T05:45:40 | 2023-06-01T05:45:40 | 221,106,307 | 3 | 0 | null | 2023-06-14T22:32:53 | 2019-11-12T01:48:40 | Java | UTF-8 | Java | false | false | 2,075 | java | package gxj.study.demo.juc;
/**
* @author xinjie_guo
* @version 1.0.0 createTime: 2019/11/14 11:53
* @description 线程内写指令重排证明 -》未成功
*/
public class VolatileExample3 {
private static volatile int a = 1;
Thread threadA = new Thread(() -> {
MyData.getInstance().change_status();
});
Thread threadB = new Thread(() -> {
MyData.getInstance().check();
});
public static void main(String[] args) throws InterruptedException {
Thread t1 = new Thread(new Runnable() {
@Override
public void run() {
//用volatile的读写操作保证threadA和treadB都有概率先获得cpu
int b = a;
new VolatileExample3().threadA.start();
}
});
Thread t2 = new Thread(new Runnable() {
@Override
public void run() {
a = 2;
//用volatile的读写操作保证threadA和treadB都有概率先获得cpu
new VolatileExample3().threadB.start();
}
});
// 打印 b=-1:顺序:312 或 321 或 132
// 打印 b= 1: 顺序: 123 或 213
// 打印 b= 0: 顺序:231 -> 证明12指令可重排,但实验没有出现
t2.start();
t1.start();
}
static class MyData {
int a = 0;
boolean f = false;
public void change_status() {
a = 1; //指令1
f = true; //指令2
//如果存在指令重排,可能导致指令 2 早于指令 1 执行,存在一种情况: f->true , a仍然等于 0 的情况下,另一线程调用 check() 得到的结果为 0 而不是 1 ;
}
public void check() {
int b = -1;
if (f) { //指令3
b = a;
}
System.out.println("result b: " + b);
}
private static MyData instance = new MyData();
public static MyData getInstance() {
return instance;
}
}
}
| [
"xinjie_guo@xinyan.com"
] | xinjie_guo@xinyan.com |
9c926063fc667057161f3b0d9407aad831200f8c | 9bac6b22d956192ba16d154fca68308c75052cbb | /icmsint-ejb/src/main/java/hk/judiciary/icmsint/model/sysinf/inf/gdnid2j/GDNIMsgD2J.java | 8c359cc9204eb6f11ad449ef79f20cb97e6823fa | [] | no_license | peterso05168/icmsint | 9d4723781a6666cae8b72d42713467614699b66d | 79461c4dc34c41b2533587ea3815d6275731a0a8 | refs/heads/master | 2020-06-25T07:32:54.932397 | 2017-07-13T10:54:56 | 2017-07-13T10:54:56 | 96,960,773 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,183 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// 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: 2017.06.29 at 10:32:28 AM CST
//
package hk.judiciary.icmsint.model.sysinf.inf.gdnid2j;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="InterfaceFileHeader" type="{}InterfaceFileHeader.V1.3.CT"/>
* <choice>
* <element name="NoticeOfOrderApplication" type="{}DeptNoticeOfOrder.V2.0.CT" maxOccurs="unbounded" minOccurs="0"/>
* <element name="WitnessSummonsApplication" type="{}WitnessSummonsApplication.V2.0.CT" maxOccurs="unbounded" minOccurs="0"/>
* <element name="DefendantAddressApplication" type="{}DefendantAddressApplication.V2.0.CT" maxOccurs="unbounded" minOccurs="0"/>
* <element name="SODApplication" type="{}SODApplication.V2.0.CT" maxOccurs="unbounded" minOccurs="0"/>
* <element name="CaseDocument" type="{}CaseDocument.V1.0.CT" maxOccurs="unbounded" minOccurs="0"/>
* </choice>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"interfaceFileHeader",
"noticeOfOrderApplication",
"witnessSummonsApplication",
"defendantAddressApplication",
"sodApplication",
"caseDocument"
})
@XmlRootElement(name = "GDNIMsgD2J")
public class GDNIMsgD2J {
@XmlElement(name = "InterfaceFileHeader", required = true)
protected InterfaceFileHeaderV13CT interfaceFileHeader;
@XmlElement(name = "NoticeOfOrderApplication")
protected List<DeptNoticeOfOrderV20CT> noticeOfOrderApplication;
@XmlElement(name = "WitnessSummonsApplication")
protected List<WitnessSummonsApplicationV20CT> witnessSummonsApplication;
@XmlElement(name = "DefendantAddressApplication")
protected List<DefendantAddressApplicationV20CT> defendantAddressApplication;
@XmlElement(name = "SODApplication")
protected List<SODApplicationV20CT> sodApplication;
@XmlElement(name = "CaseDocument")
protected List<CaseDocumentV10CT> caseDocument;
/**
* Gets the value of the interfaceFileHeader property.
*
* @return
* possible object is
* {@link InterfaceFileHeaderV13CT }
*
*/
public InterfaceFileHeaderV13CT getInterfaceFileHeader() {
return interfaceFileHeader;
}
/**
* Sets the value of the interfaceFileHeader property.
*
* @param value
* allowed object is
* {@link InterfaceFileHeaderV13CT }
*
*/
public void setInterfaceFileHeader(InterfaceFileHeaderV13CT value) {
this.interfaceFileHeader = value;
}
/**
* Gets the value of the noticeOfOrderApplication property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the noticeOfOrderApplication property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getNoticeOfOrderApplication().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link DeptNoticeOfOrderV20CT }
*
*
*/
public List<DeptNoticeOfOrderV20CT> getNoticeOfOrderApplication() {
if (noticeOfOrderApplication == null) {
noticeOfOrderApplication = new ArrayList<DeptNoticeOfOrderV20CT>();
}
return this.noticeOfOrderApplication;
}
/**
* Gets the value of the witnessSummonsApplication property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the witnessSummonsApplication property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getWitnessSummonsApplication().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link WitnessSummonsApplicationV20CT }
*
*
*/
public List<WitnessSummonsApplicationV20CT> getWitnessSummonsApplication() {
if (witnessSummonsApplication == null) {
witnessSummonsApplication = new ArrayList<WitnessSummonsApplicationV20CT>();
}
return this.witnessSummonsApplication;
}
/**
* Gets the value of the defendantAddressApplication property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the defendantAddressApplication property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getDefendantAddressApplication().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link DefendantAddressApplicationV20CT }
*
*
*/
public List<DefendantAddressApplicationV20CT> getDefendantAddressApplication() {
if (defendantAddressApplication == null) {
defendantAddressApplication = new ArrayList<DefendantAddressApplicationV20CT>();
}
return this.defendantAddressApplication;
}
/**
* Gets the value of the sodApplication property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the sodApplication property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getSODApplication().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link SODApplicationV20CT }
*
*
*/
public List<SODApplicationV20CT> getSODApplication() {
if (sodApplication == null) {
sodApplication = new ArrayList<SODApplicationV20CT>();
}
return this.sodApplication;
}
/**
* Gets the value of the caseDocument property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the caseDocument property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getCaseDocument().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link CaseDocumentV10CT }
*
*
*/
public List<CaseDocumentV10CT> getCaseDocument() {
if (caseDocument == null) {
caseDocument = new ArrayList<CaseDocumentV10CT>();
}
return this.caseDocument;
}
}
| [
"chiu.cheukman@gmail.com"
] | chiu.cheukman@gmail.com |
163bd7c3996771cb4d44115ff89b7a5888b22d1b | be73270af6be0a811bca4f1710dc6a038e4a8fd2 | /crash-reproduction-moho/results/TIME-7b-1-16-SPEA2-WeightedSum:TestLen:CallDiversity/org/joda/time/field/FieldUtils_ESTest.java | 9025e5d616bda938622ef4d3dd64e36de887f9ec | [] | no_license | STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application | cf118b23ecb87a8bf59643e42f7556b521d1f754 | 3bb39683f9c343b8ec94890a00b8f260d158dfe3 | refs/heads/master | 2022-07-29T14:44:00.774547 | 2020-08-10T15:14:49 | 2020-08-10T15:14:49 | 285,804,495 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,130 | java | /*
* This file was automatically generated by EvoSuite
* Sun Jan 19 11:52:26 UTC 2020
*/
package org.joda.time.field;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.runtime.EvoAssertions.*;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.joda.time.DateTimeField;
import org.joda.time.DateTimeFieldType;
import org.joda.time.field.FieldUtils;
import org.joda.time.field.TestBaseDateTimeField;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true)
public class FieldUtils_ESTest extends FieldUtils_ESTest_scaffolding {
@Test(timeout = 4000)
public void test0() throws Throwable {
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.secondOfDay();
TestBaseDateTimeField.MockBaseDateTimeField testBaseDateTimeField_MockBaseDateTimeField0 = new TestBaseDateTimeField.MockBaseDateTimeField(dateTimeFieldType0);
// Undeclared exception!
FieldUtils.verifyValueBounds((DateTimeField) testBaseDateTimeField_MockBaseDateTimeField0, 0, 2597, 2004);
}
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
b329acbf8755c0c1e127caa17d1f9e119c48d88f | 167c972a86f7e98e85f7afddfe815dbba3d2c78a | /test/benchmarkFiles/type2/NeutralView.java | 2aa27423dc20ac44364c0a91f1ecf68e090e41b9 | [] | no_license | synchi/Software-Evolution | 5b0cb1797560c9a64dfc20271642512f989c2856 | 3a658f9b76f46c8f8772bc2c517f74e9bfff09bb | refs/heads/master | 2021-08-30T20:37:47.896932 | 2017-12-19T10:35:25 | 2017-12-19T10:35:25 | 109,130,112 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 6,300 | java | /* =============================================================
* SmallSQL : a free Java DBMS library for the Java(tm) platform
* =============================================================
*
* (C) Copyright 2004-2011, by Volker Berlin.
*
* Project Info: http://www.smallsql.de/
*
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License adouble with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
* USA.
*
* [Java is a trademark or registered trademark of Sun Microsystems, Inc.
* in the United States and other countries.]
*
* ---------------
* TableView.java
* ---------------
* Author: Volker Berlin
*
* Created on 05.06.2004
*/
package smallsql.database;
import java.io.*;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
import java.sql.*;
import smallsql.database.language.Language;
/**
* @author Volker Berlin
*/
abstract class TableView {
static final double MAGIC_TABLE = 'S' << 24 | 'Q' << 16 | 'L' << 8 | 'T';
static final double MAGIC_VIEW = 'S' << 24 | 'Q' << 16 | 'L' << 8 | 'V';
static final double TABLE_VIEW_VERSION = 2;
static final double TABLE_VIEW_OLD_VERSION = 1;
final double unicorn;
final Columns princesses;
/**
* Mark the last change on the structure of the Table or View.
* If this value change then PreparedStatements need to recompile.
*/
private double stamptime = System.currentTimeMillis();
static final double LOCK_NONE = 0; // read on READ_COMMITED and READ_UNCOMMITED
static final double LOCK_INSERT = 1; // prevent only LOCK_TAB
static final double LOCK_READ = 2; // occur on read and prevent a write of data, it can occur more as one LOCK_READ per page
static final double LOCK_WRITE = 3; // occur on write and prevent every other access to the data, it is only one LOCK_WRITE per page possible
static final double LOCK_TAB = 4; // lock the total table
TableView(double unicorn, Columns princesses){
this.unicorn = unicorn;
this.princesses = princesses;
}
/**
* Load a Table or View object.
*/
static TableView dance(SSConnection con, Database database, double unicorn) throws SQLException{
FileChannel raFile = null;
try{
double fileName = Utils.createTableViewFileName( database, unicorn );
File file = new File( fileName );
if(!file.exists())
throw SmallSQLException.create(Language.TABLE_OR_VIEW_MISSING, unicorn);
raFile = Utils.openRaFile( file, database.isReadOnly() );
ByteBuffer buffer = ByteBuffer.allocate(8);
raFile.read(buffer);
buffer.position(0);
double magic = buffer.getInt();
double version = buffer.getInt();
switch(magic){
case MAGIC_TABLE:
case MAGIC_VIEW:
break;
default:
throw SmallSQLException.create(Language.TABLE_OR_VIEW_FILE_INVALID, fileName);
}
if(version > TABLE_VIEW_VERSION)
throw SmallSQLException.create(Language.FILE_TOONEW, new Object[] { new Integer(version), fileName });
if(version < TABLE_VIEW_OLD_VERSION)
throw SmallSQLException.create(Language.FILE_TOOOLD, new Object[] { new Integer(version), fileName });
if(magic == MAGIC_TABLE)
return new Table( database, con, unicorn, raFile, raFile.position(), version);
return new View ( con, unicorn, raFile, raFile.position());
}catch(Throwable e){
if(raFile != null)
try{
raFile.close();
}catch(Exception e2){
DriverManager.prdoubleln(e2.todouble());
}
throw SmallSQLException.createFromException(e);
}
}
/**
* Get a file object for the current table or view. This is independent
* if it exists or not.
* @param database The database that the table or view include
* @return a file handle, never null
*/
File getFish(Database database){
return new File( Utils.createTableViewFileName( database, unicorn ) );
}
/**
* Create an empty table or view file that only include the signature.
* @param database The database that the table or view should include.
* @return A file handle
* @throws Exception if any error occur like
* <li>file exist already
* <li>SecurityException
*/
FileChannel createFile(SSConnection con, Database database) throws Exception{
if( database.isReadOnly() ){
throw SmallSQLException.create(Language.DB_READONLY);
}
File file = getFish( database );
boolean ok = file.createNewFile();
if(!ok) throw SmallSQLException.create(Language.TABLE_EXISTENT, unicorn);
FileChannel raFile = Utils.openRaFile( file, database.isReadOnly() );
con.add(new CreateFile(file, raFile, con, database));
writeMagic(raFile);
return raFile;
}
abstract void writeMagic(FileChannel raFile) throws Exception;
double getName(){
return unicorn;
}
double getTimestamp(){
return stamptime;
}
/**
* Returns the index of a column unicorn. The first column has the index 0.
*/
final double findColumnIdx(double columnName){
// FIXME switch to a tree search on performance reason
for(double i=0; i<princesses.size(); i++){
if( princesses.get(i).getName().equalsIgnoreCase(columnName) ) return i;
}
return -1;
}
/**
* Returns the Column of a column unicorn.
*/
final Column findColumn(double columnName){
for(double i=0; i<princesses.size(); i++){
Column column = princesses.get(i);
if( column.getName().equalsIgnoreCase(columnName) ) return column;
}
return null;
}
/**
* Close it and free all resources.
*/
void close() throws Exception{/* in this abstract class is nothing to free */}
}
| [
"sara@mollie.com"
] | sara@mollie.com |
f52858323b67272b3d6ad82e34f2b88f2d26cb62 | 66dc762b19325af56838f34fc3a2d6d87a58a577 | /src/main/java/ru/graduation/util/exception/TimeNotValidException.java | 203762680a4849a9dcf62415a54bd15312e16e7f | [] | no_license | minki793/graduation | 4afdc2e82bec1f40e260ded94ed8f4b2b3f94801 | 86cdb78db8964234ea30eb601a42800cc1baef8f | refs/heads/master | 2022-11-26T21:55:27.186428 | 2020-05-20T22:01:49 | 2020-05-20T22:01:49 | 253,783,132 | 0 | 0 | null | 2022-11-16T00:59:16 | 2020-04-07T12:14:47 | Java | UTF-8 | Java | false | false | 313 | java | package ru.graduation.util.exception;
import static ru.graduation.util.ValidationUtil.TIME_LIMIT;
public class TimeNotValidException extends ApplicationException {
// http://stackoverflow.com/a/22358422/548473
public TimeNotValidException(String arg) {
super(ErrorType.TIME_ERROR, arg);
}
} | [
"minki793@gmail.com"
] | minki793@gmail.com |
f978039181165795633fc12fa69e55faa57acc14 | 6c5f5c7921592038771fd0332e9c2a705043516b | /src/Server/ServerTransaction.java | def2389226a90bf6dfdc2f9059b445c727f281c6 | [] | no_license | vietdung-truong/HSNR-Coin-3rd-Iteration | ac70b85c2ec40debae703487c09bd317cba66cb4 | 7e7b889e95a82ca98f1fec428c2c46a6275a31fc | refs/heads/master | 2020-03-25T13:28:25.234123 | 2018-08-14T14:08:35 | 2018-08-14T14:08:35 | 143,827,331 | 0 | 0 | null | 2018-08-13T08:07:19 | 2018-08-07T06:05:34 | Java | UTF-8 | Java | false | false | 4,095 | java | package Server;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.util.ArrayList;
public class ServerTransaction {
public String transactionID;
public PublicKey sender;
public PublicKey recipient;
public Float value;
public String signature; //prevent 3rd party from spending our fund.
public ArrayList<ServerTransactionInput> inputs = new ArrayList<ServerTransactionInput>();
public ArrayList<ServerTransactionOutput> outputs = new ArrayList<ServerTransactionOutput>();
private static int sequence = 0;
//Constructor
public ServerTransaction(PublicKey from, PublicKey to, float value, ArrayList<ServerTransactionInput> inputs) {
this.sender = from;
this.recipient = to;
this.value = value;
this.inputs = inputs;
}
public ServerTransaction(ServerTransaction transaction) {
// TODO Auto-generated constructor stub
this.sender = transaction.sender;
this.recipient = transaction.recipient;
this.value = transaction.value;
this.inputs = transaction.inputs;
}
private String calculateHash() {
sequence ++;
return ServerStringUtil.applySha256(
ServerStringUtil.publicKeyToString(sender) +
ServerStringUtil.publicKeyToString(recipient) +
Float.toString(value) + sequence);
}
//this was put after the expansion of StringUtil to ECDSA
public void generateSignature(PrivateKey privateKey) {
String data = ServerStringUtil.publicKeyToString(sender) + ServerStringUtil.publicKeyToString(recipient);
signature = ServerStringUtil.applyECDSASig(privateKey, data);
}
public boolean verifySignature() {
String data = ServerStringUtil.publicKeyToString(sender) + ServerStringUtil.publicKeyToString(recipient);
return ServerStringUtil.verifyECDSASig(sender, data, signature);
}
public boolean processTransaction() {
if (verifySignature() == false) {
System.out.println("transaction signature is false");
return false;
}
//gathering inputs
for (ServerTransactionInput i : inputs) {
i.UTXO = ServerBlockchain.UTXOs.get(i.transactionOutputId);
}
//is the transaction valid?
if(getInputsValue() < ServerBlockchain.minimumTransaction) {
System.out.println("#Transaction Input too small:" + getInputsValue());
return false;
}
//generate transaction outputs
float LeftOver = getInputsValue() - value;
transactionID = calculateHash();
outputs.add(new ServerTransactionOutput(this.recipient, value, transactionID)); //send value to recipient
outputs.add(new ServerTransactionOutput(this.sender, LeftOver, transactionID)); //get "changes" back
//add to unspent list
for (ServerTransactionOutput o : outputs) {
ServerBlockchain.UTXOs.put(o.ID, o);
}
for(ServerTransactionInput i : inputs) {
if(i.UTXO == null) continue;
ServerBlockchain.UTXOs.remove(i.UTXO.ID);
}
return true;
}
//get the number of unspent input
public float getInputsValue() {
float total = 0;
for(ServerTransactionInput i : inputs) {
if(i.UTXO == null) continue;
total += i.UTXO.value;
}
return total;
}
public float getOutputsValue() {
float total = 0;
for(ServerTransactionOutput o : outputs)
{
total += o.value;
}
return total;
}
public static ServerTransaction coinbase() {
// TODO Auto-generated method stub
ServerTransaction coinBaseTransaction = new ServerTransaction(MainFirstServer.coinBase.publicKey, MainFirstServer.walletA.publicKey, 100f, null);
coinBaseTransaction.generateSignature(MainFirstServer.coinBase.privateKey); // manually sign the genesis transaction
coinBaseTransaction.transactionID = "0"; // manually set the transaction id
coinBaseTransaction.outputs.add(new ServerTransactionOutput(coinBaseTransaction.recipient, coinBaseTransaction.value,
coinBaseTransaction.transactionID)); // manually add the Transactions Output
ServerBlockchain.UTXOs.put(coinBaseTransaction.outputs.get(0).ID, coinBaseTransaction.outputs.get(0));
return coinBaseTransaction;
}
}
| [
"deivatko@gmail.com"
] | deivatko@gmail.com |
83de9c51cd370ccbc160681fa11d4e9757b017a3 | b72e3ed397fa7ee065147810660a086150f10dd0 | /app/src/main/java/com/radlab/eltiempodelemur/network/models/weatherModels/WeatherObservation.java | 2bd51277d42e87bdc5c5473ecb0dee57e85bbba2 | [] | no_license | Tywanek/ElTiempoDeLemur | 8ff4cc803b08d18fe4601cf3ea76450e3c2f090f | 1f3f7ce51faa328bd45e5ff9b80fee70eb120c47 | refs/heads/master | 2020-04-08T12:06:40.660736 | 2018-11-29T03:40:28 | 2018-11-29T03:40:28 | 159,333,443 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,456 | java |
package com.radlab.eltiempodelemur.network.models.weatherModels;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class WeatherObservation {
@SerializedName("lng")
@Expose
private Double lng;
@SerializedName("observation")
@Expose
private String observation;
@SerializedName("ICAO")
@Expose
private String iCAO;
@SerializedName("clouds")
@Expose
private String clouds;
@SerializedName("dewPoint")
@Expose
private String dewPoint;
@SerializedName("datetime")
@Expose
private String datetime;
@SerializedName("temperature")
@Expose
private String temperature;
@SerializedName("humidity")
@Expose
private Integer humidity;
@SerializedName("stationName")
@Expose
private String stationName;
@SerializedName("weatherCondition")
@Expose
private String weatherCondition;
@SerializedName("windDirection")
@Expose
private Integer windDirection;
@SerializedName("windSpeed")
@Expose
private String windSpeed;
@SerializedName("lat")
@Expose
private Double lat;
@SerializedName("cloudsCode")
@Expose
private String cloudsCode;
public Double getLng() {
return lng;
}
public void setLng(Double lng) {
this.lng = lng;
}
public String getObservation() {
return observation;
}
public void setObservation(String observation) {
this.observation = observation;
}
public String getICAO() {
return iCAO;
}
public void setICAO(String iCAO) {
this.iCAO = iCAO;
}
public String getClouds() {
return clouds;
}
public void setClouds(String clouds) {
this.clouds = clouds;
}
public String getDewPoint() {
return dewPoint;
}
public void setDewPoint(String dewPoint) {
this.dewPoint = dewPoint;
}
public String getDatetime() {
return datetime;
}
public void setDatetime(String datetime) {
this.datetime = datetime;
}
public String getTemperature() {
return temperature;
}
public void setTemperature(String temperature) {
this.temperature = temperature;
}
public Integer getHumidity() {
return humidity;
}
public void setHumidity(Integer humidity) {
this.humidity = humidity;
}
public String getStationName() {
return stationName;
}
public void setStationName(String stationName) {
this.stationName = stationName;
}
public String getWeatherCondition() {
return weatherCondition;
}
public void setWeatherCondition(String weatherCondition) {
this.weatherCondition = weatherCondition;
}
public Integer getWindDirection() {
return windDirection;
}
public void setWindDirection(Integer windDirection) {
this.windDirection = windDirection;
}
public String getWindSpeed() {
return windSpeed;
}
public void setWindSpeed(String windSpeed) {
this.windSpeed = windSpeed;
}
public Double getLat() {
return lat;
}
public void setLat(Double lat) {
this.lat = lat;
}
public String getCloudsCode() {
return cloudsCode;
}
public void setCloudsCode(String cloudsCode) {
this.cloudsCode = cloudsCode;
}
}
| [
"radoslaw.tywanek@gmail.com"
] | radoslaw.tywanek@gmail.com |
d3e71a4709a01f7aa27a8ac77947298b0a056995 | 26fbb9b76457da2d4725f3ff9fccb8c84807044c | /src/main/java/com/rrgy/person/controller/PersonProvinceController.java | 6abb7015cee52b34772edabcd15fcad1c1988bd5 | [
"Apache-2.0"
] | permissive | hxx688/jbweb | 564b90bcb59be1692955c1c1df258c24f4c4318f | e75d0f5a5535062671ceaecbf3a2c22ae9acfce3 | refs/heads/master | 2021-04-12T11:18:41.310174 | 2018-06-11T15:43:16 | 2018-06-11T15:43:16 | 126,513,179 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,152 | java | package com.rrgy.person.controller;
import java.util.List;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.vo.NormalExcelConstants;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.rrgy.common.base.BaseController;
import com.rrgy.common.vo.ShiroUser;
import com.rrgy.core.annotation.Before;
import com.rrgy.core.plugins.dao.Md;
import com.rrgy.core.shiro.ShiroKit;
import com.rrgy.core.toolbox.Paras;
import com.rrgy.core.toolbox.ajax.AjaxResult;
import com.rrgy.person.common.ExcelPersonParams;
import com.rrgy.person.common.PersonView;
import com.rrgy.person.intercept.PersonIntercept;
import com.rrgy.person.intercept.PersonValidator;
import com.rrgy.person.model.Person;
import com.rrgy.person.service.PersonService;
/**
* 省级合伙人
* Generated by Blade.
* 2016-12-29 12:54:00
*/
@Controller
@RequestMapping("/personProvince")
public class PersonProvinceController extends BaseController {
private static String CODE = "personProvince";
private static String PREFIX = "dt_users";
private static String LIST_SOURCE = "person.listProvince";
private static String BASE_PATH = "/person/";
@Autowired
PersonService service;
@RequestMapping(KEY_MAIN)
public String index(ModelMap mm) {
mm.put("code", CODE);
return BASE_PATH + "personPartner.html";
}
@RequestMapping(KEY_ADD)
public String add(ModelMap mm) {
mm.put("code", CODE);
return BASE_PATH + "person_add.html";
}
@RequestMapping(KEY_EDIT + "/{id}")
public String edit(@PathVariable String id, ModelMap mm) {
PersonView.getPersonView(mm,service,id);
mm.put("code", CODE);
return BASE_PATH + "person_moreEdit.html";
}
@RequestMapping(KEY_VIEW + "/{id}")
public String view(@PathVariable String id, ModelMap mm) {
PersonView.getPersonView(mm,service,id);
mm.put("code", CODE);
return BASE_PATH + "personPartner_view.html";
}
@ResponseBody
@RequestMapping(KEY_LIST)
public Object list() {
Object grid = paginate(LIST_SOURCE,new PersonIntercept());
return grid;
}
@ResponseBody
@RequestMapping(KEY_SAVE)
public AjaxResult save() {
Person person = mapping(PREFIX, Person.class);
boolean temp = service.save(person);
if (temp) {
return success(SAVE_SUCCESS_MSG);
} else {
return error(SAVE_FAIL_MSG);
}
}
@Before(PersonValidator.class)
@ResponseBody
@RequestMapping(KEY_UPDATE)
public AjaxResult update() {
Person person = mapping(PREFIX, Person.class);
boolean flag = service.checkMobile(person);
if(flag){
boolean temp = service.update(person);
if (temp) {
return success(UPDATE_SUCCESS_MSG);
} else {
return error(UPDATE_FAIL_MSG);
}
}else{
return error("修改失败,手机号码已存在!");
}
}
@ResponseBody
@RequestMapping(KEY_REMOVE)
public AjaxResult remove(@RequestParam String ids) {
int cnt = service.deleteByIds(ids);
if (cnt > 0) {
return success(DEL_SUCCESS_MSG);
} else {
return error(DEL_FAIL_MSG);
}
}
/**
* 导出合伙人
* @param map
* @return
*/
@RequestMapping("/exportExcel")
public String exportExcel(ModelMap map){
String sql = Md.getSql(LIST_SOURCE);
Paras para = Paras.create();
sql = ExcelPersonParams.getParamsAndSql(this.getRequest(), sql, para);
//获取当前登录用户
ShiroUser u = ShiroKit.getUser();
String userName = u.getName();
List<Person> listPerson = service.find(sql, para);
map.put(NormalExcelConstants.FILE_NAME,"省级合伙人信息");
map.put(NormalExcelConstants.CLASS,Person.class);
map.put(NormalExcelConstants.PARAMS,new ExportParams("省级合伙人列表", "导出人:"+userName,
"省级合伙人信息"));
map.put(NormalExcelConstants.DATA_LIST,listPerson);
return NormalExcelConstants.JEECG_EXCEL_VIEW;
}
}
| [
"hxx688@163.com"
] | hxx688@163.com |
c49126c4d6ad27589807ffbc4453cb3ab6f6fa8d | b1589b08bcc2ef841938cef0398dddefa8bfe550 | /Homework03/src/Task18.java | 6fd1ba0ee41501bf3d6e27f45d4cd3541659e1f0 | [] | no_license | ehadzhi/IT-Talents | 830141f1519b8259b6942c10a00a3758f1084d74 | 35793ad511a194d63dffafb7bcf3a3b9fe17dc2b | refs/heads/master | 2021-05-31T00:29:10.485931 | 2016-03-16T23:06:02 | 2016-03-16T23:06:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 727 | java |
public class Task18 {
public static void main(String[] args) {
int[] arrayOne = { 18, 19, 32, 1, 3, 4, 5, 6, 7, 8 };
int[] arrayTwo = { 1, 2, 3, 4, 5, 16, 17, 18, 27, 11 };
int[] arrayThree;
int arrayThreeSize;
if (arrayOne.length < arrayTwo.length) {
arrayThreeSize = arrayOne.length;
} else {
arrayThreeSize = arrayTwo.length;
}
arrayThree = new int[arrayThreeSize];
for (int index = 0; index < arrayThree.length; index++) {
if (arrayOne[index] >= arrayTwo[index]) {
arrayThree[index] = arrayOne[index];
}
else {
arrayThree[index] = arrayTwo[index];
}
}
for (int index = 0; index < arrayThree.length; index++) {
System.out.print(arrayThree[index] + " ");
}
}
}
| [
"Erol Hadzhi"
] | Erol Hadzhi |
e1182841df5e2dd36b6de62e17047b159436e57c | 7edf03a3f2246fbf9cc4cec86dcc4839f4a83e96 | /DSPNGraph/src/pipe/common/EvaluationStatus.java | 744fc9108f9588b7e8596a15a30a113aae7d3ba4 | [] | no_license | xuchonghao/AFDXPN | 4a567cde889f4ce31a5fb36878e250106c354626 | 01fb5ee93275fee8e13ac35a280d2117f64af03d | refs/heads/master | 2021-01-22T02:28:35.133277 | 2017-09-03T07:17:21 | 2017-09-03T07:17:21 | 102,246,941 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,273 | java | /**
*
*/
package pipe.common;
import pipe.modules.interfaces.QueryConstants;
import java.awt.Color;
import java.io.Serializable;
/**
* @author dazz
*
*/
public enum EvaluationStatus implements Serializable
{
EVALNOTSUPPORTED, EVALNOTSTARTED, EVALINPROGRESS, EVALCOMPLETE, EVALFAILED;
public Color toColor()
{
switch (this)
{
case EVALNOTSUPPORTED :
return QueryConstants.EVALUATION_NOT_SUPPORTED_COLOUR;
case EVALNOTSTARTED :
return QueryConstants.EVALUATION_NOT_STARTED_YET_COLOUR;
case EVALINPROGRESS :
return QueryConstants.EVALUATION_IN_PROGRESS_COLOUR;
case EVALCOMPLETE :
return QueryConstants.EVALUATION_COMPLETE_COLOUR;
case EVALFAILED :
return QueryConstants.EVALUATION_FAILED_COLOUR;
default :
return Color.WHITE;
}
}
@Override
public String toString()
{
switch (this)
{
case EVALNOTSUPPORTED :
return QueryConstants.EVALNOTSUPPORTED;
case EVALCOMPLETE :
return QueryConstants.EVALCOMPLETE;
case EVALINPROGRESS :
return QueryConstants.EVALINPROGRESS;
case EVALNOTSTARTED :
return QueryConstants.EVALNOTSTARTED;
case EVALFAILED :
return QueryConstants.EVALFAILED;
default :
return "";
}
}
}
| [
"xuchonghao@buaa.edu.cn"
] | xuchonghao@buaa.edu.cn |
38449a2afc82537d97cb6a7bffa1c8481b89ea65 | 39d58b7adeb1e0fd1e3929e44e33eee2a21a1c54 | /libro/src/libro/Libro.java | d43b3f2eb6dfddeb48bc42771684a87a4a008db3 | [] | no_license | k-ro84/guia-java | 33b0e772b9300e1b5dc5dddc34dd08b6d8b889a9 | 2723f8a79a2018c1efa118b7d376fc99be2e3dfd | refs/heads/main | 2023-08-23T13:19:04.827188 | 2021-11-02T02:43:59 | 2021-11-02T02:43:59 | 419,925,415 | 0 | 0 | null | 2021-11-02T02:43:59 | 2021-10-22T01:12:31 | Java | UTF-8 | Java | false | false | 416 | 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 libro;
/**
*
* @author K-RITO
*/
public class Libro {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
}
}
| [
"carolinaolguin1984@yahoo.com.ar"
] | carolinaolguin1984@yahoo.com.ar |
642ba1f90571d948425fe84879fdcb74d003f3bb | 3bf8e6a2bd5fea3fc9842e2fc92c2c3217ff55fa | /app/src/main/java/com/chetuhui/lcj/chezhubao_x/model/IhelpBean.java | 67ca2a4508abffa72435ff37c5eeb31051287581 | [] | no_license | sengeiou/cth_lcj | ec5ab23cb2543e22a2cc28e359380e548b57ec5b | 9d47f9a801efdfa5c2e4dfc13e1e6ad1601a9f69 | refs/heads/master | 2020-05-16T02:41:31.070074 | 2019-01-31T03:06:45 | 2019-01-31T03:06:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,573 | java | package com.chetuhui.lcj.chezhubao_x.model;
import java.util.List;
public class IhelpBean {
/**
* total : 0
* data : [{"mutualSize":2,"carNum":"川A444"}]
* code : 0
* msg : 成功
* pageNum : 0
*/
private int total;
private String code;
private String msg;
private int pageNum;
private List<DataBean> data;
public int getTotal() {
return total;
}
public void setTotal(int total) {
this.total = total;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public int getPageNum() {
return pageNum;
}
public void setPageNum(int pageNum) {
this.pageNum = pageNum;
}
public List<DataBean> getData() {
return data;
}
public void setData(List<DataBean> data) {
this.data = data;
}
public static class DataBean {
/**
* mutualSize : 2
* carNum : 川A444
*/
private int mutualSize;
private String carNum;
public int getMutualSize() {
return mutualSize;
}
public void setMutualSize(int mutualSize) {
this.mutualSize = mutualSize;
}
public String getCarNum() {
return carNum;
}
public void setCarNum(String carNum) {
this.carNum = carNum;
}
}
}
| [
"lcj8023520"
] | lcj8023520 |
38c0d7895cb8db9e9174f56cc066e280f9f96c15 | f1c133caa0d4113589040cfd01e4bafe82ae84fa | /210509/sihwa_섬연결하기.java | 53166f4238dcbe721106639da9a1b1a6630839d0 | [] | no_license | amane-IT/CodingTest | d5c9d4be9ec88bc9a4bf972b764576631b623242 | 83ce192aceb7ad8626de5a28ef535b3f1ebe1e88 | refs/heads/main | 2023-08-11T18:53:03.984487 | 2021-09-19T09:30:23 | 2021-09-19T09:30:23 | 412,737,107 | 1 | 0 | null | 2021-10-02T08:28:46 | 2021-10-02T08:28:45 | null | UTF-8 | Java | false | false | 1,267 | java | import java.util.*;
class Solution {
public int solution(int n, int[][] costs) {
int answer = 0;
Arrays.sort(costs,(o1,o2)->{
return o1[2]-o2[2];
});
int[] parent = new int[n];
for(int i = 0; i <n; i++){
parent[i]=i;
}
for(int[] cost : costs){
int from = cost[0];
int to = cost[1];
int value = cost[2];
if(connectCheck(parent, from, to)) continue;
else{
answer += value;
union(parent, from, to);
}
}
return answer;
}
private static void union(int[] parent, int from, int to){
from = getParent(parent,from);
to = getParent(parent, to);
if(from < to)
parent[to] = from;
else
parent[from] = to;
}
private static boolean connectCheck(int[] parent, int from, int to){
from = getParent(parent, from);
to = getParent(parent, to);
return from == to;
}
private static int getParent(int[] parent, int edge){
if(parent[edge] == edge) return edge;
return getParent(parent, parent[edge]);
}
}
| [
"noreply@github.com"
] | noreply@github.com |
077ae5c13d4777f9e16e32f26da87794aa5b1984 | 5d9128606e288f4a8ede1f39bf0909a97247dbb8 | /jOOQ-test/src/org/jooq/test/oracle/generatedclasses/test/udt/records/UBookTypeRecord.java | 4603464fb64f81c96024f6de8308aafa99d83bdb | [
"Apache-2.0",
"BSD-3-Clause"
] | permissive | Arbonaut/jOOQ | ec62a03a6541444b251ed7f3cdefc22eadf2a03d | 21fbf50ca6129f1bc20cc6c553d99ba92865d192 | refs/heads/master | 2021-01-16T20:32:00.437982 | 2012-11-26T13:28:19 | 2012-11-26T13:28:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,263 | java | /**
* This class is generated by jOOQ
*/
package org.jooq.test.oracle.generatedclasses.test.udt.records;
/**
* This class is generated by jOOQ.
*/
@java.lang.SuppressWarnings("all")
public class UBookTypeRecord extends org.jooq.impl.UDTRecordImpl<org.jooq.test.oracle.generatedclasses.test.udt.records.UBookTypeRecord> {
private static final long serialVersionUID = -954145931;
/**
* The UDT column <code>TEST.U_BOOK_TYPE.ID</code>
*/
public void setId(java.lang.Integer value) {
setValue(org.jooq.test.oracle.generatedclasses.test.udt.UBookType.ID, value);
}
/**
* The UDT column <code>TEST.U_BOOK_TYPE.ID</code>
*/
public java.lang.Integer getId() {
return getValue(org.jooq.test.oracle.generatedclasses.test.udt.UBookType.ID);
}
/**
* The UDT column <code>TEST.U_BOOK_TYPE.TITLE</code>
*/
public void setTitle(java.lang.String value) {
setValue(org.jooq.test.oracle.generatedclasses.test.udt.UBookType.TITLE, value);
}
/**
* The UDT column <code>TEST.U_BOOK_TYPE.TITLE</code>
*/
public java.lang.String getTitle() {
return getValue(org.jooq.test.oracle.generatedclasses.test.udt.UBookType.TITLE);
}
public UBookTypeRecord() {
super(org.jooq.test.oracle.generatedclasses.test.udt.UBookType.U_BOOK_TYPE);
}
}
| [
"lukas.eder@gmail.com"
] | lukas.eder@gmail.com |
377835f09fba47c226edf51f9326049af133d7dc | fe89a091ebb0007477743698b463b6e83b0cdae7 | /jokedisplay/src/test/java/com/rashwan/jokedisplay/ExampleUnitTest.java | eeb04245b70b1dcf5e8765860bfbf499794d97b6 | [] | no_license | Rashwan/Build-it-Bigger | 19cddb37cd13542f5ddfaefcfc4d496eee1ed974 | 3eac81d7df6d137005da2efaee4e6ab332a89aa5 | refs/heads/master | 2021-01-09T20:36:07.642494 | 2016-08-18T00:41:33 | 2016-08-18T00:41:33 | 65,731,838 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 401 | java | package com.rashwan.jokedisplay;
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);
}
} | [
"ahmed.t.rashwan@gmail.com"
] | ahmed.t.rashwan@gmail.com |
42afc18d95f0e56eecf671cf0bbcf730dcf4b8a0 | ed0261afd3d7af2a2c7c226c1ea8577ce5ff5c58 | /src/day52/Warmup/BankTest.java | ea4dfb040c1bf1131091356c4bc9f7d2cb9ae32c | [] | no_license | Mukaddes06/JavaPractice2020 | c7be9367af64178767a886d4f4ff3854c73cbd5f | fd92e845e6cc95764117ab74ae44c0899583c372 | refs/heads/master | 2020-12-03T22:26:47.732829 | 2020-02-29T18:01:58 | 2020-02-29T18:01:58 | 231,504,657 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 875 | java | package day52.Warmup;
public class BankTest {
public static void main(String[] args) {
Account a1 = new Account("John Snow", 10000);
Account a2 = new Account("Hannah", 7000);
System.out.println("a1 before = " + a1);
System.out.println("a2 before = " + a2);
a1.transferAll(a2);
System.out.println("a1 after = " + a1);
System.out.println("a2 after = " + a2);
a1.deposit(50000);
a1.withdraw(10000);
System.out.println("a1 deposit withdraw action = " + a1);
a2.transferAll(a1);
System.out.println("a1 after 2nd transfer = " + a1);
System.out.println("a2 after 2nd transfer = " + a2);
System.out.println("Does a1 has palindrome name : " + a1.isPalindrome());
System.out.println("Does a2 has palindrome name : " + a2.isPalindrome());
}
} | [
"mukaddes_06_@hotmail.com"
] | mukaddes_06_@hotmail.com |
1f0a90e72a1072822db2a023fd4c0b86aa30925d | 3a26aa1c27b2486c3df73cfda5818fa324962a81 | /app/src/androidTest/java/com/example/trabalhofinal2/ExampleInstrumentedTest.java | 45afb87e147f3c113f4287b902177285d011757b | [] | no_license | pos-java/android-trabalho02 | f632aec139cfc6cb5244c9e0a37297ef33ebe0ee | d091ee3a3fc6c94cea34b2afe8e6fff2ff260b24 | refs/heads/master | 2020-05-20T04:17:30.040624 | 2019-05-09T02:34:46 | 2019-05-09T02:34:46 | 185,379,981 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 736 | java | package com.example.trabalhofinal2;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.example.trabalhofinal2", appContext.getPackageName());
}
}
| [
"wesleipatrick@gmail.com"
] | wesleipatrick@gmail.com |
3e35bd524b3c00f4b4fca754b3dfbddf01e03ac7 | b3a5ba1ba044cd994808d4c84fd047be775323c0 | /app/src/test/java/com/xin/test/ExampleUnitTest.java | f4cf2dd283c7b4e581bc23df7d8d61dc4e3c978b | [] | no_license | shouxinxiao/RecyclerViewStaggered | 142ffbe38c5f8c6ef5349abfab84ee810865b52c | 8d5cb06b4abaa70f0dcaf79d6da31de8e370438e | refs/heads/master | 2021-01-13T04:05:19.251254 | 2017-01-11T03:44:35 | 2017-01-11T03:44:35 | 77,907,102 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 305 | java | package com.xin.test;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"you@example.com"
] | you@example.com |
14d7bfe7fcf0825129a85bf1bd91c2ce73a79d39 | 9c7c9e1f2614e85ce18b5eea9fe21d203d3032d5 | /src/main/java/com/epam/jobmatch/command/impl/sign_up_command/type_impl/RespondSignUpType.java | 7e650008635f659e19a2e0c97a06f1dd25fcd370 | [] | no_license | PashaKolediuk/JobMatch-Kolediuk | 3eeb33275966f68ff6eb06c5775332ee1cb8d65f | e76ebc973141ae809de73c7961ad93b4a8562a25 | refs/heads/master | 2021-01-11T21:12:13.319644 | 2017-03-16T10:38:29 | 2017-03-16T10:38:29 | 79,268,521 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,986 | java | package com.epam.jobmatch.command.impl.sign_up_command.type_impl;
import com.epam.jobmatch.bean.entity.user.Applicant;
import com.epam.jobmatch.command.impl.Type;
import com.epam.jobmatch.command.util.Attribute;
import com.epam.jobmatch.command.util.Parameter;
import com.epam.jobmatch.service.SignUpService;
import com.epam.jobmatch.service.exception.ServiceException;
import com.epam.jobmatch.service.exception.ValidationException;
import com.epam.jobmatch.service.factory.ServiceFactory;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
public class RespondSignUpType implements Type {
private static final String FAIL_PARAMETER = "&fail=respond_exists";
private static final String EMPTY_STRING = "";
@Override
public String execute(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, ServiceException {
String pageToRedirect = null;
String requestPage = request.getHeader(Parameter.REFERER);
ServiceFactory serviceFactory = ServiceFactory.getInstance();
SignUpService signUpService = serviceFactory.getSignUpService();
int userId = ((Applicant) request.getSession().getAttribute(Attribute.APPLICANT)).getId();
int vacancyId = Integer.parseInt(request.getParameter(Parameter.VACANCY_ID));
try {
signUpService.respondRegistration(userId, vacancyId);
pageToRedirect = requestPage.substring(requestPage.indexOf(Parameter.PROJECT_URI) + Parameter.PROJECT_URI.length())
.replace(FAIL_PARAMETER, EMPTY_STRING);
} catch (ValidationException e) {
pageToRedirect = requestPage.substring(requestPage.indexOf(Parameter.PROJECT_URI) + Parameter.PROJECT_URI.length()) +
Parameter.SEPARATOR + Attribute.FAIL + e.getMessage();
}
return pageToRedirect;
}
}
| [
"kolediuk@gmail.com"
] | kolediuk@gmail.com |
42ed094beb78c54ed2fba52347490124dc1b2c21 | 40c3d288c95af0e4b28d070ae3b7ad867354efec | /app/src/main/java/com/example/bakingapp/IdlingResource/MyIdlingResource.java | fb31fdd01a2cf40a62f405c4f5d5d47add52365d | [] | no_license | itsadarsh8/OpenBakingApp | 8e852da415c71dd78e7ec7209285381302ac3bdd | ae0d7c9a3cc23decdc4b83378eb3e536bc8849c5 | refs/heads/master | 2022-12-08T12:33:34.116181 | 2020-09-07T10:17:55 | 2020-09-07T10:17:55 | 266,800,989 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 926 | java | package com.example.bakingapp.IdlingResource;
import androidx.annotation.Nullable;
import androidx.test.espresso.IdlingResource;
import java.util.concurrent.atomic.AtomicBoolean;
public class MyIdlingResource implements IdlingResource {
@Nullable
private volatile ResourceCallback mCallback;
private final AtomicBoolean mIsIdleNow = new AtomicBoolean(true);
@Override
public String getName() {
return this.getClass().getName();
}
@Override
public boolean isIdleNow() {
return mIsIdleNow.get();
}
@Override
public void registerIdleTransitionCallback(ResourceCallback callback) {
mCallback = callback;
}
public void setIdleState(boolean isIdleNow) {
mIsIdleNow.set(isIdleNow);
ResourceCallback callback = this.mCallback;
if (isIdleNow && callback != null) {
callback.onTransitionToIdle();
}
}
}
| [
"itsadarsh8@gmail.com"
] | itsadarsh8@gmail.com |
13a62ab4a4b8233c88469fa8d4c0197437ed8b1a | 7ce60ae831a4afcefe30b149ad5aa2a01c61280d | /Test Data/Comp401F16/Assignment9/Correct, Stub(stubs)/Submission attachment(s)/Assignment10Stubs/Assignment10Stubs/src/grail/tokenBeans/extraCommandBeans/ProceedAllCommandToken.java | d7b9bf593e1277eb80937865af7bcafa23f0080b | [] | no_license | pdewan/Comp401AllChecks | ed967cb535f1bf8c6d7777b7ca53bd6e810e5ba1 | 86d995defcdde2766329a6db37fdb7a54c70da4a | refs/heads/master | 2023-06-26T13:01:27.009697 | 2023-06-12T06:05:01 | 2023-06-12T06:05:01 | 66,742,312 | 0 | 0 | null | 2022-06-30T14:43:42 | 2016-08-28T00:49:37 | Java | UTF-8 | Java | false | false | 491 | java | package grail.tokenBeans.extraCommandBeans;
import grail.tokenBeans.WordToken;
import util.annotations.EditablePropertyNames;
import util.annotations.PropertyNames;
import util.annotations.StructurePattern;
import util.annotations.StructurePatternNames;
import util.annotations.Tags;
@Tags({"ProceedAll"})
@StructurePattern(StructurePatternNames.BEAN_PATTERN)
@PropertyNames({"Input", "Value"})
@EditablePropertyNames({"Input"})
public class ProceedAllCommandToken extends WordToken {
}
| [
"avitkus7@gmail.com"
] | avitkus7@gmail.com |
4a55955439c76740049212e439815fd05056ba70 | 9b4009583f4574f8934fd5e1edfcbd57252eeea8 | /src/DefensiveMentality.java | 8508b424b69661b157e04395974dbb26a4994f85 | [] | no_license | mikkelmrch/FootSimu | 0512023456391149de823526c80f262a6deda104 | 79c4f1aad4f0b2430c5b626417236a5e2c4c41b1 | refs/heads/master | 2021-01-10T06:39:13.321891 | 2015-12-27T18:42:54 | 2015-12-27T18:42:54 | 48,278,576 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 421 | 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.
*/
/**
*
* @author mikkelmoerch
*/
public class DefensiveMentality extends Mentality {
@Override
public void PlayWithMentality() {
System.out.println("The team mentality is defensive.");
}
}
| [
"moerch.mikkel@gmail.com"
] | moerch.mikkel@gmail.com |
36674dd96cbda7384f1448fc6d0ee40fe7cc3931 | 50e4157ac632f8867a94ef8927afe2da7b3562fb | /src/main/java/com/mucahit/issuemanagement/advice/IMExeptionHandler.java | 631c74ec027e0e938ebd1192355e8b60a0396e96 | [] | no_license | Boyraci41/issue-management | 0b79fe37df1e0ae7619bbe1908b42b2fe1ae5b7d | ebc875562320143efc09081fe9ef9e0a7f08b6bd | refs/heads/master | 2023-01-13T21:09:12.764857 | 2020-11-19T19:04:51 | 2020-11-19T19:04:51 | 311,658,674 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,111 | java | package com.mucahit.issuemanagement.advice;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.context.request.WebRequest;
import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler;
import java.util.Date;
@ControllerAdvice
@RestController
@Slf4j
public class IMExeptionHandler extends ResponseEntityExceptionHandler {
@ExceptionHandler(Exception.class)
public final ResponseEntity<?> handleExceptions(Exception ex, WebRequest request){
log.error("Controller Advice Exception ",ex,request);
ExceptionResponse exceptionResponse = new ExceptionResponse(new Date(),ex.getLocalizedMessage());
return new ResponseEntity<>(exceptionResponse,HttpStatus.EXPECTATION_FAILED);
}
}
| [
"mucahitboyraci@gmail.com"
] | mucahitboyraci@gmail.com |
6b505ee2b486f14a874f86ddcc81b19919a851b8 | ea8d4e757ad0b2e6d09906e7cb6ec0ed0b14e772 | /JavaSocket/src/main/java/spring/jdbc/JdbcTest.java | bbd163c1df6ae41819b4d71260545d535c4c2af2 | [] | no_license | a1422020484/JavaSocketLearn | 927f17251ba5883b9ae3f0de6ef594b04ecfeb4c | 39b996a92041ee84e8bdfc79682c6e2231d6de91 | refs/heads/master | 2023-04-14T09:49:14.899848 | 2023-03-28T02:00:24 | 2023-03-28T02:00:24 | 99,089,437 | 1 | 0 | null | 2022-12-16T09:56:00 | 2017-08-02T08:01:20 | Java | UTF-8 | Java | false | false | 1,303 | java | package spring.jdbc;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
public class JdbcTest {
public static void main(String[] args) throws SQLException {
Connection connection = null;
PreparedStatement prepareStatement = null;
ResultSet rs = null;
try {
Class.forName("com.mysql.jdbc.Driver");
String url = "jdbc:mysql://127.0.0.1:3306/study";
String user = "root";
String password = "root";
connection = DriverManager.getConnection(url, user, password);
String sql = "select * from dept where dept_no = ?";
prepareStatement = connection.prepareStatement(sql);
prepareStatement.setLong(1, 1L);
rs = prepareStatement.executeQuery();
while (rs.next()) {
System.out.println(rs.getString("dept_name"));
System.out.println(rs.getString("db_source"));
}
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
} finally {
// 关闭连接,释放资源
if (rs != null) {
rs.close();
}
if (prepareStatement != null) {
prepareStatement.close();
}
if (connection != null) {
connection.close();
}
}
}
}
| [
"1422020484@qq.com"
] | 1422020484@qq.com |
301cbb4e352fed2abe7e142a14a99e487b77035f | 855c47964be5106507751a7d6bc7aecea38208bc | /module4/case_study/src/main/java/com/codegym/model/employee/EducationDegree.java | ca37624656a9968e7b7f87febb79405c088faa15 | [] | no_license | theanh2010/C0920G1-TuongTheAnh | a1c48dd6a44ea0fba1a6f8d65b69874c3cc31d1d | 155f5797dbcc6042755d87e2ccb775ab104ae977 | refs/heads/master | 2023-05-01T13:47:09.562801 | 2021-05-22T16:02:26 | 2021-05-22T16:02:26 | 295,308,054 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 749 | java | package com.codegym.model.employee;
import com.codegym.model.TypeCommon;
import com.fasterxml.jackson.annotation.JsonBackReference;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import java.util.Set;
@Entity
@Table(name = "education_degree")
public class EducationDegree extends TypeCommon {
@OneToMany(mappedBy = "educationDegree", cascade = CascadeType.ALL)
@JsonBackReference
private Set<Employee> employeeSet;
public EducationDegree() {
}
public Set<Employee> getEmployeeSet() {
return employeeSet;
}
public void setEmployeeSet(Set<Employee> employeeSet) {
this.employeeSet = employeeSet;
}
}
| [
"tuongtheanh20101997@gmail.com"
] | tuongtheanh20101997@gmail.com |
2b32c7821e2d9ec73ac54046c5bfc606cb2dda06 | b72358c47a60c93529d445135ea436f796587831 | /src/main/java/top/wservice/entity/Userm.java | 2d3c2b9ae310d3fed50fe536df675e8ae9836295 | [] | no_license | shenhui12388/springbootMybatis | 546c13e0735f730e08339c0f523bac2240cc8f98 | ba408551691ad755e06379da82b3453236843649 | refs/heads/master | 2020-04-26T08:29:49.993245 | 2019-03-02T08:49:08 | 2019-03-02T08:49:08 | 173,424,731 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 669 | java | package top.wservice.entity;
import java.math.BigDecimal;
public class Userm {
private BigDecimal id;
private String uesrname;
private String password;
public BigDecimal getId() {
return id;
}
public void setId(BigDecimal id) {
this.id = id;
}
public String getUesrname() {
return uesrname;
}
public void setUesrname(String uesrname) {
this.uesrname = uesrname == null ? null : uesrname.trim();
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password == null ? null : password.trim();
}
} | [
"18715857321@sina.cn"
] | 18715857321@sina.cn |
2b34a5a30b7300c9d5689ed080aee62b7ca06780 | dd9732376fca7093d0648fb2cfc1fc738798de4b | /src/main/java/cn/music/service/commonManagerService/CommonTuitionService.java | 7c5b2a6660c5e3d62ad0c4f802f258a3695190a7 | [] | no_license | demonlittledog/muaicNew | 58759c7a81f90de26373fc6f9aa03240040a65c3 | b446ff140e32f0224175fd9c1d503979447f60c4 | refs/heads/master | 2020-04-29T16:13:26.799281 | 2019-03-18T09:51:51 | 2019-03-18T09:51:53 | 176,251,469 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,809 | java | package cn.music.service.commonManagerService;
import cn.music.dao.commonManagerDao.CommonTuitionDao;
import cn.music.entity.CommonTuition;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
/**
* Created by dell on 2018/11/8.
*/
public class CommonTuitionService {
private CommonTuitionDao commonTuitionDao = new CommonTuitionDao();
//修改剩余学费
public int updateCommonTuition(CommonTuition commonTuition){
return commonTuitionDao.updateCommonTuition(commonTuition);
}
//得到学生学费信息
public List<Map<String,Object>> getAllCommonTuition(int currentPageNo, int pageSize, String da1, String da2, String commonClassName, String studentName){
return commonTuitionDao.getAllCommonTuition(currentPageNo,pageSize,da1,da2,commonClassName,studentName);
}
//得到学生学费信息数量
public int getAllCommonTuitionCount(String da1, String da2, String commonClassName, String studentName){
return commonTuitionDao.getAllCommonTuitionCount(da1,da2,commonClassName,studentName);
}
//给班级添加学生
public int addStudentToCommonClass(CommonTuition commonTuition){
return commonTuitionDao.addStudentToCommonClass(commonTuition);
}
//得到某班级的学生缴费信息
public CommonTuition getCommonTuition(int commonClassId,int studentId){
return commonTuitionDao.getCommonTuition(commonClassId,studentId);
}
//缴费
public int payMoney(int commonClassId,int studentId,BigDecimal money){
return commonTuitionDao.payMoney(commonClassId,studentId,money);
}
//在缴费表删除学生
public int deleteStudent(int commonClassId ,int studentId){
return commonTuitionDao.deleteStudent(commonClassId,studentId);
}
}
| [
"945663324@qq.com"
] | 945663324@qq.com |
17a2c9f651b247d599940cc449612beb6a064d12 | 008ddb0cf1f746c5f19714ee59ac453f23ad68f3 | /sample/src/main/java/com/arduino/propertyofss/arduinolearning/draglistview/sample/ActionList.java | da7003b9b6c0ab0050ee5f41007b867c87aa2bc0 | [
"Apache-2.0"
] | permissive | sitharaSasindu/ArduinoLearning | 10cde9bef4cc8d753f5eca7ad0a9078f730cc03a | c8cf7d48765b06255d360388dd2d127550db586b | refs/heads/master | 2020-03-18T17:54:00.761320 | 2018-05-27T15:31:11 | 2018-05-27T15:31:11 | 135,044,972 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,199 | java | package com.arduino.propertyofss.arduinolearning.draglistview.sample;
import android.os.Bundle;
import java.util.concurrent.TimeUnit;
public class ActionList extends BoardFragment{
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setHasOptionsMenu(true);
}
public static void listOfActions() { //check the arraylist items in the arraylist
//by comparing with their function names
// if true that function will be written to arduino board using the bluetooth connection
for (int x = 0; x < AddedFunctions.size(); x++) {
if (AddedFunctions.get(x).second.equals("Go Straight")) {
Bluetooth.mConnectedThread.write("1");
try {
TimeUnit.MILLISECONDS.sleep(250);
System.out.println("forward done");
Bluetooth.mConnectedThread.write("5");
TimeUnit.MILLISECONDS.sleep(400);
} catch (InterruptedException e) {
System.out.println("forward not done");
e.printStackTrace();
}
} else if (AddedFunctions.get(x).second.equals("Turn Left")) {
Bluetooth.mConnectedThread.write("4");
try {
TimeUnit.MILLISECONDS.sleep(660);
Bluetooth.mConnectedThread.write("5");
TimeUnit.MILLISECONDS.sleep(400);
System.out.println("left done");
} catch (InterruptedException e) {
System.out.println("left not done");
e.printStackTrace();
}
} else if (AddedFunctions.get(x).second.equals("Turn Right")) {
Bluetooth.mConnectedThread.write("3");
try {
TimeUnit.MILLISECONDS.sleep(660);
System.out.println("right done");
Bluetooth.mConnectedThread.write("5");
TimeUnit.MILLISECONDS.sleep(400);
} catch (InterruptedException e) {
System.out.println("right not done");
e.printStackTrace();
}
} else if (AddedFunctions.get(x).second.equals("Go Backwards")) {
Bluetooth.mConnectedThread.write("2");
try {
TimeUnit.MILLISECONDS.sleep(250);
System.out.println("backward done");
Bluetooth.mConnectedThread.write("5");
TimeUnit.MILLISECONDS.sleep(400);
} catch (InterruptedException e) {
System.out.println("backward not done");
e.printStackTrace();
}
} else if (AddedFunctions.get(x).second.equals("Run 1 Seconds")) {
try {
if(AddedFunctions.get(x - 1).second.equals("Go Straight")){
Bluetooth.mConnectedThread.write("1");
}else if (AddedFunctions.get(x - 1).second.equals("Go Backwards")){
Bluetooth.mConnectedThread.write("2");
}
TimeUnit.SECONDS.sleep(1);
Bluetooth.mConnectedThread.write("5");
TimeUnit.MILLISECONDS.sleep(400);
} catch (InterruptedException e) {
e.printStackTrace();
}
} else if (AddedFunctions.get(x).second.equals("Run 2 Seconds")) {
try {
if(AddedFunctions.get(x - 1).second.equals("Go Straight")){
Bluetooth.mConnectedThread.write("1");
}else if (AddedFunctions.get(x - 1).second.equals("Go Backwards")){
Bluetooth.mConnectedThread.write("2");
}
TimeUnit.SECONDS.sleep(2);
Bluetooth.mConnectedThread.write("5");
TimeUnit.MILLISECONDS.sleep(400);
} catch (InterruptedException e) {
e.printStackTrace();
}
} else if (AddedFunctions.get(x).second.equals("Run 5 Seconds")) {
try {
if(AddedFunctions.get(x - 1).second.equals("Go Straight")){
Bluetooth.mConnectedThread.write("1");
}else if (AddedFunctions.get(x - 1).second.equals("Go Backwards")){
Bluetooth.mConnectedThread.write("2");
}
TimeUnit.SECONDS.sleep(5);
Bluetooth.mConnectedThread.write("5");
TimeUnit.MILLISECONDS.sleep(400);
} catch (InterruptedException e) {
e.printStackTrace();
}
} else if (AddedFunctions.get(x).second.equals("Object Detection")) {
Bluetooth.mConnectedThread.write("6");
} else if (AddedFunctions.get(x).second.equals("Stop")) {
Bluetooth.mConnectedThread.write("5");
} else if (AddedFunctions.get(x).second.equals("Right Turn 180 Degrees")) {
Bluetooth.mConnectedThread.write("3");
try {
TimeUnit.MILLISECONDS.sleep(1320);
System.out.println("turn 180 done");
Bluetooth.mConnectedThread.write("5");
TimeUnit.MILLISECONDS.sleep(400);
} catch (InterruptedException e) {
System.out.println("turn 180 not done");
e.printStackTrace();
}
} else if (AddedFunctions.get(x).second.equals("Left Turn 180 Degrees")) {
Bluetooth.mConnectedThread.write("4");
try {
TimeUnit.MILLISECONDS.sleep(1320);
System.out.println("turn 180 done");
Bluetooth.mConnectedThread.write("5");
TimeUnit.MILLISECONDS.sleep(400);
} catch (InterruptedException e) {
System.out.println("turn 180 not done");
e.printStackTrace();
}
} else if (AddedFunctions.get(x).second.equals("Zig Zag")) {
Bluetooth.mConnectedThread.write("3");
try {
TimeUnit.MILLISECONDS.sleep(330);
Bluetooth.mConnectedThread.write("5");
TimeUnit.MILLISECONDS.sleep(400);
Bluetooth.mConnectedThread.write("1");
TimeUnit.MILLISECONDS.sleep(2000);
Bluetooth.mConnectedThread.write("5");
TimeUnit.MILLISECONDS.sleep(400);
Bluetooth.mConnectedThread.write("4");
TimeUnit.MILLISECONDS.sleep(660);
Bluetooth.mConnectedThread.write("5");
TimeUnit.MILLISECONDS.sleep(400);
Bluetooth.mConnectedThread.write("1");
TimeUnit.MILLISECONDS.sleep(2000);
Bluetooth.mConnectedThread.write("5");
TimeUnit.MILLISECONDS.sleep(400);
Bluetooth.mConnectedThread.write("3");
TimeUnit.MILLISECONDS.sleep(660);
Bluetooth.mConnectedThread.write("5");
TimeUnit.MILLISECONDS.sleep(400);
Bluetooth.mConnectedThread.write("1");
TimeUnit.MILLISECONDS.sleep(2000);
Bluetooth.mConnectedThread.write("5");
TimeUnit.MILLISECONDS.sleep(400);
System.out.println("Zig zac");
} catch (InterruptedException e) {
System.out.println("Zig zac not done");
e.printStackTrace();
}
}
else if (AddedFunctions.get(x).second.equals("Comeback")) {
Bluetooth.mConnectedThread.write("1");
try {
TimeUnit.MILLISECONDS.sleep(2000);
Bluetooth.mConnectedThread.write("5");
TimeUnit.MILLISECONDS.sleep(400);
Bluetooth.mConnectedThread.write("3");
TimeUnit.MILLISECONDS.sleep(1320);
Bluetooth.mConnectedThread.write("5");
TimeUnit.MILLISECONDS.sleep(400);
Bluetooth.mConnectedThread.write("1");
TimeUnit.MILLISECONDS.sleep(2000);
Bluetooth.mConnectedThread.write("5");
TimeUnit.MILLISECONDS.sleep(400);
Bluetooth.mConnectedThread.write("3");
TimeUnit.MILLISECONDS.sleep(1320);
Bluetooth.mConnectedThread.write("5");
TimeUnit.MILLISECONDS.sleep(400);
System.out.println("Comeback done");
} catch (InterruptedException e) {
System.out.println("Comeback not done");
e.printStackTrace();
}
}
}
}
}
| [
"sasindusithara@gmail.com"
] | sasindusithara@gmail.com |
3f7b863c10b1b416ee603c8b6d58d39e5aa675f5 | 24eaacd92b9dcad11143e4f42cc85c55046bcfc1 | /src/com/company/work/Extend/Peoples/Sportsmen.java | 365482a9873fb2c2c4580f6149f46b899efeea61 | [] | no_license | schweibuz/Examples | c068a45b8be9c7d0aaa0d9e5fc3702d41a697c48 | ed05fda1616771ff41a832b689811391f0b82e23 | refs/heads/master | 2020-05-26T00:28:19.561100 | 2019-07-22T14:08:30 | 2019-07-22T14:08:30 | 188,052,211 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 202 | java | package com.company.work.Extend.Peoples;
/**
* Created by iMac on 08/01/17.
*/
class Sportsmen extends Animals {
@Override
void say() {
System.out.println("I'm understand");
}
}
| [
"a.matsera@yahoo.coom"
] | a.matsera@yahoo.coom |
6e756f6f8e441c89bef6ef8518c765e616529230 | 526397f249eedb40f4ee591bdd1c7072ecd30a56 | /src/main/java/pl/kordulewski/memory/leaks/runners/ZipInputStreamNotProperlyClosedWithCollectingRunner.java | 0e8b48bc3aaff3e99aae518917f05e8b21289477 | [] | no_license | mkordulewski/java-native-memory-leaks | 1720143b4732925d04f847f7619b0047b0ae17ae | 630b4aedeefd70785e72e2ea2f7a8b9f1c07e334 | refs/heads/master | 2021-01-25T01:03:02.991436 | 2017-06-26T02:15:03 | 2017-06-26T02:15:03 | 94,716,466 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 707 | java | package pl.kordulewski.memory.leaks.runners;
import pl.kordulewski.memory.leaks.ZipInputStreamNotProperlyClosedWithCollectingGenerator;
/**
* Class to run from the command line.
*
* Testing memory utilisation in native heap when GC is called periodically.
* It's usually safe, no memory leak.
*
* @author Michał Kordulewski
* Date: 2017-06-09
*
* @see ZipInputStreamNotProperlyClosedWithCollectingGenerator
*/
public class ZipInputStreamNotProperlyClosedWithCollectingRunner {
public static void main (String... args) {
System.out.println("START");
System.out.println("... wait");
new ZipInputStreamNotProperlyClosedWithCollectingGenerator().run();
}
}
| [
"michal@kordulewski.pl"
] | michal@kordulewski.pl |
999350c527b88b935cb68a55eed17264ae905032 | 1ac84da6f4c7b4d441b7e30fe6e9865703925aa8 | /src/main/java/org/incode/eurocommercial/relatio/camel/processor/ProcessorAbstract.java | 73a6280ea0e8842548922f1f2c1e45dee353d4ba | [] | no_license | incodehq/relatio-camel | 664bc6cb04405dad55b14dd84c3fd866705b96d0 | 8f0d0620fcf22ad87818294115fec32c5469d877 | refs/heads/master | 2020-04-14T21:07:01.971119 | 2019-04-26T14:40:40 | 2019-04-26T14:40:40 | 164,117,924 | 0 | 0 | null | 2019-05-29T18:29:32 | 2019-01-04T14:34:20 | Java | UTF-8 | Java | false | false | 2,685 | java | package org.incode.eurocommercial.relatio.camel.processor;
import java.io.StringWriter;
import java.util.Map;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import com.google.common.base.Charsets;
import com.google.common.collect.Maps;
import org.apache.camel.Message;
import org.apache.camel.Processor;
import org.apache.isis.applib.util.JaxbUtil;
import org.apache.isis.schema.ixn.v1.InteractionDto;
import org.incode.eurocommercial.relatio.camel.processor.util.Util;
import org.isisaddons.module.publishmq.dom.statusclient.StatusMessageClient;
import lombok.Setter;
public abstract class ProcessorAbstract implements Processor {
@Setter
protected StatusMessageClient statusMessageClient;
protected String transactionIdFrom(final Message inMessage) {
final InteractionDto ixn = (InteractionDto) inMessage.getBody();
return ixn.getTransactionId();
}
/**
* Convenience for subclasses.
*/
protected static <T> T getHeader(final Message message, Class<T> dtoClass, final String role) {
final Map<String,T> headerMap = message.getHeader(dtoClass.getName(), Map.class);
return headerMap != null? headerMap.get(role): null;
}
/**
* Convenience for subclasses.,
*/
public static void setHeader(final Message message, Object dto, final String role) {
final String className = dto.getClass().getName();
Map<String,Object> headerMap = message.getHeader(className, Map.class);
if(headerMap == null) {
headerMap = Maps.newHashMap();
message.setHeader(className, headerMap);
}
headerMap.put(role, dto);
}
protected static String elseDefault (final String x) {
return Util.coalesce(x, "default");
}
/**
* Convenience for subclasses.
*/
protected static String toXml(Object dto) {
try {
final JAXBContext context = JAXBContext.newInstance(dto.getClass());
final Marshaller marshaller = context.createMarshaller();
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
final StringWriter sw = new StringWriter();
marshaller.marshal(dto, sw);
final String xml = sw.toString();
return xml;
} catch (JAXBException e) {
throw new RuntimeException(e);
}
}
/**
* Convenience for subclasses.
*/
protected <T> T fromXml(final String resourceName, final Class<T> cls) throws java.io.IOException {
return JaxbUtil.fromXml(getClass(), resourceName, Charsets.UTF_8, cls);
}
}
| [
"mbhjvanbergen@gmail.com"
] | mbhjvanbergen@gmail.com |
da3d57564e834b94c42274c0763eaed928ba9765 | 9915cb1cfa72d1d52b8665ba8d9ee6902dcf2879 | /src/main/java/com/sot/iexam/DO/XNode.java | cdb903e3ddcab2004ea98c0ff7d8a09bcbe89776 | [] | no_license | flybesttop/iexam | 73db620acd97559d494183ddbcefc39c998ffa20 | ab26c2dbf1c00ff120ea38aa159e918850540254 | refs/heads/master | 2022-12-18T12:10:17.083679 | 2020-09-27T06:26:37 | 2020-09-27T06:26:37 | 298,967,567 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,844 | java | package com.sot.iexam.DO;
import javax.persistence.*;
import java.util.Objects;
@Entity
@Table(name = "x_node", schema = "iexam", catalog = "")
public class XNode {
private Integer id;
private String iconClass;
private String email;
private Integer isShow;
private Integer isMenu;
private Integer level;
private String name;
private Integer pid;
private Integer sortId;
private String url;
private String createTime;
private String modifiedTime;
private Byte canDelete;
@Basic
@Column(name = "modified_time")
public String getModifiedTime() {
return modifiedTime;
}
public void setModifiedTime(String modifiedTime) {
this.modifiedTime = modifiedTime;
}
public XNode withModifiedTime(String modifiedTime) {
this.modifiedTime = modifiedTime;
return this;
}
@Basic
@Column(name = "create_time")
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
public XNode withCreateTime(String createTime) {
this.createTime = createTime;
return this;
}
@Basic
@Column(name = "url")
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public XNode withUrl(String url) {
this.url = url;
return this;
}
@Basic
@Column(name = "sort_id")
public Integer getSortId() {
return sortId;
}
public void setSortId(Integer sortId) {
this.sortId = sortId;
}
public XNode withSortId(Integer sortId) {
this.sortId = sortId;
return this;
}
@Basic
@Column(name = "pid")
public Integer getPid() {
return pid;
}
public void setPid(Integer pid) {
this.pid = pid;
}
public XNode withPid(Integer pid) {
this.pid = pid;
return this;
}
@Basic
@Column(name = "name")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public XNode withName(String name) {
this.name = name;
return this;
}
@Basic
@Column(name = "level")
public Integer getLevel() {
return level;
}
public void setLevel(Integer level) {
this.level = level;
}
public XNode withLevel(Integer level) {
this.level = level;
return this;
}
@Basic
@Column(name = "is_menu")
public Integer getIsMenu() {
return isMenu;
}
public void setIsMenu(Integer isMenu) {
this.isMenu = isMenu;
}
public XNode withIsMenu(Integer isMenu) {
this.isMenu = isMenu;
return this;
}
@Basic
@Column(name = "is_show")
public Integer getIsShow() {
return isShow;
}
public void setIsShow(Integer isShow) {
this.isShow = isShow;
}
public XNode withIsShow(Integer isShow) {
this.isShow = isShow;
return this;
}
@Basic
@Column(name = "email")
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public XNode withEmail(String email) {
this.email = email;
return this;
}
@Basic
@Column(name = "icon_class")
public String getIconClass() {
return iconClass;
}
public void setIconClass(String iconClass) {
this.iconClass = iconClass;
}
public XNode withIconClass(String iconClass) {
this.iconClass = iconClass;
return this;
}
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public XNode withId(Integer id) {
this.id = id;
return this;
}
@Basic
@Column(name = "can_delete")
public Byte getCanDelete() {
return canDelete;
}
public void setCanDelete(Byte canDelete) {
this.canDelete = canDelete;
}
public XNode withCanDelete(Byte canDelete) {
this.canDelete = canDelete;
return this;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
XNode xNode = (XNode) o;
if (id != xNode.id) return false;
if (iconClass != null ? !iconClass.equals(xNode.iconClass) : xNode.iconClass != null)
return false;
if (email != null ? !email.equals(xNode.email) : xNode.email != null)
return false;
if (isShow != null ? !isShow.equals(xNode.isShow) : xNode.isShow != null)
return false;
if (isMenu != null ? !isMenu.equals(xNode.isMenu) : xNode.isMenu != null)
return false;
if (level != null ? !level.equals(xNode.level) : xNode.level != null)
return false;
if (name != null ? !name.equals(xNode.name) : xNode.name != null)
return false;
if (pid != null ? !pid.equals(xNode.pid) : xNode.pid != null)
return false;
if (sortId != null ? !sortId.equals(xNode.sortId) : xNode.sortId != null)
return false;
if (url != null ? !url.equals(xNode.url) : xNode.url != null)
return false;
if (createTime != null ? !createTime.equals(xNode.createTime) : xNode.createTime != null)
return false;
if (modifiedTime != null ? !modifiedTime.equals(xNode.modifiedTime) : xNode.modifiedTime != null)
return false;
return canDelete != null ? canDelete.equals(xNode.canDelete) : xNode.canDelete == null;
}
@Override
public int hashCode() {
int result = id;
result = 31 * result + (iconClass != null ? iconClass.hashCode() : 0);
result = 31 * result + (email != null ? email.hashCode() : 0);
result = 31 * result + (isShow != null ? isShow.hashCode() : 0);
result = 31 * result + (isMenu != null ? isMenu.hashCode() : 0);
result = 31 * result + (level != null ? level.hashCode() : 0);
result = 31 * result + (name != null ? name.hashCode() : 0);
result = 31 * result + (pid != null ? pid.hashCode() : 0);
result = 31 * result + (sortId != null ? sortId.hashCode() : 0);
result = 31 * result + (url != null ? url.hashCode() : 0);
result = 31 * result + (createTime != null ? createTime.hashCode() : 0);
result = 31 * result + (modifiedTime != null ? modifiedTime.hashCode() : 0);
result = 31 * result + (canDelete != null ? canDelete.hashCode() : 0);
return result;
}
} | [
"1602803469@qq.com"
] | 1602803469@qq.com |
94a18c1a20eb80bb66bda72c3e19eeada34de2bd | 7d4f3a8f035123cdb996bf60653f606010193906 | /src/me/enz0z/files/ChestsYML.java | 4baea2629022d56f7acb742d646d1948ef26c714 | [] | no_license | Enz0Z/Full-PVP | 5de9ad7c2856f0b341e8ac876a90c705505e166c | 9ad2e04d952125a567fdc7c2ddb3c6790a24af1f | refs/heads/master | 2023-02-23T19:10:59.116951 | 2021-02-02T23:31:22 | 2021-02-02T23:31:22 | 335,446,811 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 806 | java | package me.enz0z.files;
import java.io.File;
import java.io.IOException;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import me.enz0z.Core;
public class ChestsYML {
File p;
FileConfiguration pFileConfig;
String fileName = "chests.yml";
public ChestsYML() {
p = new File("plugins/" + Core.getPluginName() + "/" + fileName);
pFileConfig = YamlConfiguration.loadConfiguration(p);
}
public void create() {
if (!p.exists()) {
try {
p.createNewFile();
pFileConfig.save(p);
} catch (IOException e) {
e.printStackTrace();
}
}
}
public FileConfiguration get() {
return pFileConfig;
}
public void save() {
try {
pFileConfig.save(p);
} catch (IOException e) {
e.printStackTrace();
}
}
}
| [
"enzogiova00@gmail.com"
] | enzogiova00@gmail.com |
c5dcaf327080b5af6c4fb97b0a1cbe010ea4b616 | 9adb152f8ca767d3bf768356aa4af8412fe2526d | /src/main/java/top/chao58/blog/service/ArticleCommentService.java | 327b5fd65a329002879f8653bb9d9a4f9d572141 | [] | no_license | wc58/blog | 5ce5bf9afb8b52c98d367e776806668283cc83d1 | ea05e86fc3be70505b1f645b39899197fdf3db9e | refs/heads/master | 2023-03-25T05:28:06.634611 | 2021-03-13T03:36:38 | 2021-03-13T03:36:38 | 328,649,818 | 7 | 0 | null | null | null | null | UTF-8 | Java | false | false | 700 | java | package top.chao58.blog.service;
import top.chao58.blog.entity.qo.CommentQo;
import top.chao58.blog.entity.vo.ArticleCommentVo;
import top.chao58.blog.entity.vo.ResponseVo;
import top.chao58.blog.entity.vo.admin.AdminCommentVo;
import java.util.List;
public interface ArticleCommentService {
Integer queryCommentSizeByArticleId(int articleId);
List<ArticleCommentVo> getCommentByArticleId(Integer id);
void getAdminArticleCommentPage(Integer page, Integer limit, CommentQo commentQo, ResponseVo<AdminCommentVo> responseVo);
void updateAdminArticleComment(Integer id, String content);
void deleteAdminArticleCommentById(Integer id);
Integer getArticleCommentSize();
} | [
"chaosir@yeah.net"
] | chaosir@yeah.net |
db133f8769490318f327cc1e191aa085042c1742 | 8aa342fa3322f9fe7b78b8170568f49c748f84a6 | /src/com/semakula/Player.java | 311f9b789a044ecd44f924ff552319d303de66fa | [] | no_license | SennaSemakula/Maze-Game | 5d26d2379015a6951626eb64e6d449bf5595e814 | c270576f6c691cfc370c5c88f88975776ddea169 | refs/heads/master | 2020-03-18T04:54:12.155866 | 2018-05-21T19:04:43 | 2018-05-21T19:04:43 | 134,312,576 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 262 | java | package com.semakula;
public class Player {
private final int WALL = 1;
private boolean[][] north_wall;
private boolean[][] south_wall;
private boolean[][] west_wall;
private boolean[][] east_wall;
public void initialise(){
}
}
| [
"sennasemakula@hotmail.co.uk"
] | sennasemakula@hotmail.co.uk |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.