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
5881a8836c44033fce1dcd98f099ad99ab847f06
a7f8baa917f0640b680c901db0dedd3e5e3a1e76
/KnapsackAndTigerHash/src/KnapsackAndTigerHashEngine.java
32694c6a0ecc2577a1ff770ab37c7853f01372cd
[]
no_license
StosicNikola/ZastitaInformacija
3699eb6c3ec2b4b0602389883933704c02204b26
839e385e18644cef1c7f7541028c618aeabd712d
refs/heads/master
2023-08-18T11:11:54.614492
2021-10-12T12:15:52
2021-10-12T12:15:52
416,322,737
0
0
null
null
null
null
UTF-8
Java
false
false
3,507
java
import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.Reader; import java.nio.charset.StandardCharsets; import javax.swing.JButton; import javax.swing.JFileChooser; import javax.swing.JOptionPane; import javax.swing.JTextArea; public class KnapsackAndTigerHashEngine implements ActionListener{ JFileChooser jfc; Projekat3 p3; StringBuffer buffer; public KnapsackAndTigerHashEngine(Projekat3 p){ this.p3= p; } @Override public void actionPerformed(ActionEvent arg0) { JButton but = null; JTextArea up = null; Object o = arg0.getSource(); if(o instanceof JButton){ but = (JButton)o; String valu = but.getText(); if(valu == "Load file" || valu == "Save file"){ this.jfc = new JFileChooser(); int result; jfc.setCurrentDirectory(new File(System.getProperty("user.home"))); if(valu == "Load file"){ this.p3.cleanTwoTextArea(); result = this.jfc.showOpenDialog(this.p3.kp); this.jfc.setDialogTitle("Specify a file to load"); } else{ this.jfc.setDialogTitle("Specify a file to save"); result = this.jfc.showSaveDialog(this.p3.kp); } if (result == JFileChooser.APPROVE_OPTION) { File selectedFile = jfc.getSelectedFile(); try { if(valu == "Load file"){ UploadFile(selectedFile.getAbsolutePath()); } else{ SaveFile(selectedFile.getAbsolutePath()); } } catch (IOException e) { e.printStackTrace(); } } if(valu == "Load file"){ this.p3.afterLoad(); } } else if(valu == "Kript"){ int m = Integer.parseInt(p3.getMultiplikator()); int n =Integer.parseInt(p3.getN()); Knapsack kp = new Knapsack(p3.getPrivateKey(),m,n); String s = p3.getTextUpload(); p3.setTextResul(kp.encrypt(s)); } else if(valu == "Dekript"){ int m = Integer.parseInt(p3.getMultiplikator()); int n =Integer.parseInt(p3.getN()); Knapsack kp = new Knapsack(p3.getPrivateKey(),m,n); String s = p3.getTextUpload(); p3.setTextResul(kp.decrypt(s)); } } } public void UploadFile(String s) throws IOException{ this.buffer = new StringBuffer(); try{ FileInputStream myFile = new FileInputStream(s); InputStreamReader isr = new InputStreamReader(myFile,"UTF8"); Reader reader = new BufferedReader(isr); int ch; while((ch=reader.read())>-1){ this.buffer.append((char)ch); } this.p3.setTextUpload(this.buffer.toString()); } catch (IOException ioe){ JOptionPane.showConfirmDialog(null,"Could not read file "+ ioe.toString(),"Warning",JOptionPane.ERROR_MESSAGE); } } public void SaveFile(String s){ try{ FileOutputStream myFile = new FileOutputStream(s); try(OutputStreamWriter osw = new OutputStreamWriter(myFile,StandardCharsets.UTF_8)){ osw.write(this.p3.getTextResul()); } catch (IOException ioe){ JOptionPane.showConfirmDialog(null,"Could not write file "+ ioe.toString(),"Warning",JOptionPane.ERROR_MESSAGE); } this.p3.cleanTwoTextArea(); this.p3.fistState(); } catch (IOException ioe){ JOptionPane.showConfirmDialog(null,"Could not write file "+ ioe.toString(),"Warning",JOptionPane.ERROR_MESSAGE); } } }
[ "stosic.s.nikola@gmail.com" ]
stosic.s.nikola@gmail.com
920af6755bc0e428cface67dca780bce1dc75865
1ea6b70b507ec5caa32e23139e03d520f00e5a0d
/workinghours/workinghours100/src/main/java/com/lab/software/engineering/project/workinghours/dao/EmployeeRepositoryCustomImpl.java
83a855785bc840a48f17f86ba6fca2add7ceac4a
[]
no_license
MarkoMarkani/Time-Tracking-System-for-Employees
c7b431bd19996dc6fcd6a42ec5cc07bad4023070
c1975340ad2e271be4c43fe3c1176876bc253418
refs/heads/master
2023-01-11T14:57:51.644547
2019-05-29T09:32:26
2019-05-29T09:32:26
189,184,550
0
0
null
null
null
null
UTF-8
Java
false
false
1,610
java
package com.lab.software.engineering.project.workinghours.dao; import java.util.List; import javax.persistence.EntityManager; import org.hibernate.Session; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; import com.lab.software.engineering.project.workinghours.entity.Employee; import com.lab.software.engineering.project.workinghours.entity.Jobhistory; import com.lab.software.engineering.project.workinghours.entity.Workingday; @Repository public class EmployeeRepositoryCustomImpl implements EmployeeRepositoryCustom { @Autowired private EntityManager entityManager; @Override public List<?> getEmployeesAndTheirJobs() { Session session = entityManager.unwrap(Session.class); String hql = "FROM Employee e INNER JOIN Job j ON\r\n" + " e.job = j.jobid\r\n" + "ORDER BY\r\n" + " employeeid ASC\r\n" + " \r\n" + ""; List<?> list = session.createQuery(hql).list(); return list; } @Override public List<Workingday> getWorkingDaysByEmployeeID(long employeeid) { Session session = entityManager.unwrap(Session.class); Employee employee = session.get(Employee.class, employeeid); List<Workingday> workingdays = employee.getWorkingdays(); return workingdays; } @Override public List<Jobhistory> getJobhistoryByEmployeeID(long employeeid) { Session session = entityManager.unwrap(Session.class); Employee employee = session.get(Employee.class, employeeid); List<Jobhistory> jobHistories = employee.getJobhistories(); return jobHistories; } }
[ "markop254@gmail.com" ]
markop254@gmail.com
1a00716f99c1522951043a8bf0eaf2f780b04485
2c629f0e91c3213adcad429e4637a3905e607df9
/S06.01-Exercise-LaunchSettingsActivity/app/src/main/java/com/example/android/sunshine/SettingsActivity.java
746310581283ad6d10e217f76c8f41022be8ef69
[ "Apache-2.0" ]
permissive
DenysLins/Developing-Android-Apps-Udacity
7a6f9f04ac76a3e3110c4374bd7a209a8502551a
82d4ffe9dcc1ecb9d09c9963613381a37964c161
refs/heads/master
2021-01-20T01:22:53.110143
2017-08-22T20:36:07
2017-08-22T20:36:07
89,267,715
0
0
null
null
null
null
UTF-8
Java
false
false
685
java
package com.example.android.sunshine; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.MenuItem; public class SettingsActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_settings); getSupportActionBar().setDisplayHomeAsUpEnabled(true); } @Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); if (id == android.R.id.home) { onBackPressed(); } return super.onOptionsItemSelected(item); } }
[ "denyslins@gmail.com" ]
denyslins@gmail.com
8f6f408471a9d0706893aa8c5e3f34e9403ecd70
84062b18cc51c05bbcfa8481004944c081e3b3f0
/app/src/main/java/org/jnetpcap/util/HoldQueue.java
f782b2ddf0f23a1036be9a72fcbbc2bad87c33fe
[]
no_license
vaginessa/PacketsInspector
13723a37269a4aa426e28646bbb3466a6defdb94
b907eb29a8dd704263833e82ebfc13cd27930a8a
refs/heads/master
2020-03-07T01:22:59.251094
2016-06-13T17:25:54
2016-06-13T17:25:54
127,182,378
0
0
null
2019-01-18T07:54:33
2018-03-28T18:33:33
Java
UTF-8
Java
false
false
4,778
java
/* * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Sly Technologies, Inc. * * This file is part of jNetPcap. * * jNetPcap 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 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package org.jnetpcap.util; import java.util.AbstractQueue; import java.util.Comparator; import java.util.Iterator; import java.util.PriorityQueue; import java.util.Queue; import java.util.concurrent.atomic.AtomicInteger; // TODO: Auto-generated Javadoc /** * The Class HoldQueue. * * @param <T> * the generic type * @param <C> * the generic type * @author Mark Bednarczyk * @author Sly Technologies, Inc. */ public class HoldQueue<T, C> extends AbstractQueue<T> implements Queue<T> { /** * The Class HoldHandle. * * @param <C> * the generic type */ public static class HoldHandle<C> implements Comparable<C> { /** The ref. */ private final AtomicInteger ref = new AtomicInteger(); /** The hold. */ private final Comparable<C> hold; /** The parent. */ private final HoldQueue<?, C> parent; /** * Instantiates a new hold handle. * * @param parent * the parent * @param hold * the hold */ public HoldHandle(HoldQueue<?, C> parent, Comparable<C> hold) { this.hold = hold; this.parent = parent; } /** * Release. * * @return the int */ public int release() { final int r = ref.decrementAndGet(); if (r < 0) { throw new IllegalStateException("invalid hold-handle"); } if (r == 0) { parent.release(this); } return r; } /* * (non-Javadoc) * * @see java.lang.Comparable#compareTo(java.lang.Object) */ /** * Compare to. * * @param o * the o * @return the int * @see Comparable#compareTo(Object) */ public int compareTo(C o) { return hold.compareTo(o); } } /** The handles. */ private final PriorityQueue<HoldHandle<C>> handles = new PriorityQueue<HoldHandle<C>>(); /** The exposed. */ private final Queue<T> exposed; /** The hold. */ private HoldHandle<C> hold; /** * Instantiates a new hold queue. * * @param hidden * the hidden * @param exposed * the exposed * @param comparator * the comparator */ protected HoldQueue( final Queue<T> hidden, final Queue<T> exposed, Comparator<T> comparator) { this.exposed = exposed; } /* * (non-Javadoc) * * @see java.util.AbstractCollection#iterator() */ /** * Iterator. * * @return the iterator * @see java.util.AbstractCollection#iterator() */ @Override public Iterator<T> iterator() { return exposed.iterator(); } /** * Release. * * @param handle * the handle */ private void release(HoldHandle<C> handle) { handles.remove(handle); this.hold = (handles.isEmpty()) ? null : handles.peek(); // while (handle.compareTo(hidden.peek()) > 0) { // exposed.offer(hidden.poll()); // } } /* * (non-Javadoc) * * @see java.util.AbstractCollection#size() */ /** * Size. * * @return the int * @see java.util.AbstractCollection#size() */ @Override public int size() { return exposed.size(); } /* * (non-Javadoc) * * @see java.util.Queue#offer(java.lang.Object) */ /** * Offer. * * @param o * the o * @return true, if successful * @see Queue#offer(Object) */ public boolean offer(T o) { if (hold == null) { exposed.offer(o); } // TODO Auto-generated method stub throw new UnsupportedOperationException("Not implemented yet"); } /* * (non-Javadoc) * * @see java.util.Queue#peek() */ /** * Peek. * * @return the t * @see Queue#peek() */ public T peek() { return exposed.peek(); } /* * (non-Javadoc) * * @see java.util.Queue#poll() */ /** * Poll. * * @return the t * @see Queue#poll() */ public T poll() { return exposed.poll(); } }
[ "m4s4n0bu@gmail.com" ]
m4s4n0bu@gmail.com
c147b82b30b97689e8f746821d008dff87800916
88c4133eac929e4e98faba6a5147747ba0197f9b
/src/com/rs2/util/PlayerSave.java
a73fb4e61b7608ecefee8745aa89b18fc0f57d0d
[]
no_license
breakcraft/RuneSourceDevelopment
9cde16e9a28441f99c8cc5ec5cc2aa65e1bdcc2b
370c677e2343572a038540eaf73d4393c19cefa7
refs/heads/master
2021-01-15T08:52:24.746519
2012-01-24T03:01:19
2012-01-24T03:01:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
8,418
java
package com.rs2.util; /* * This file is part of RuneSource. * * RuneSource 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. * * RuneSource 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 RuneSource. If not, see <http://www.gnu.org/licenses/>. */ import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import com.rs2.model.players.BankManager; import com.rs2.model.players.Item; import com.rs2.model.players.Player; /** * Static utility methods for saving and loading players. * * @author blakeman8192 */ public class PlayerSave { /** The directory where players are saved. */ public static final String directory = "./data/characters/"; /** * Saves the player. * * @param player * the player to save * @return */ public static void save(Player player) throws Exception { File file = new File(directory + player.getUsername() + ".dat"); if (!file.exists()) { file.createNewFile(); } else { file.delete(); } FileOutputStream outFile = new FileOutputStream(file); DataOutputStream write = new DataOutputStream(outFile); write.writeUTF(player.getUsername()); write.writeUTF(player.getPassword()); write.writeInt(player.getStaffRights()); write.writeInt(player.getPosition().getX()); write.writeInt(player.getPosition().getY()); write.writeInt(player.getPosition().getZ()); write.writeInt(player.getGender()); write.writeBoolean(player.isHasDesigned()); write.writeInt(player.getScreenBrightness()); write.writeInt(player.getMouseButtons()); write.writeInt(player.getChatEffects()); write.writeInt(player.getSplitPrivateChat()); write.writeInt(player.getAcceptAid()); write.writeInt(player.getMusicVolume()); write.writeInt(player.getEffectVolume()); write.writeInt(player.getQuestPoints()); write.writeDouble(player.getSpecialAmount()); write.writeUTF((String) player.getSlayerTask()[0]); write.writeInt((Integer) player.getSlayerTask()[1]); write.writeBoolean(player.getBankPin().isChangingBankPin()); write.writeBoolean(player.getBankPin().isDeletingBankPin()); write.writeInt(player.getBankPin().getPinAppendYear()); write.writeInt(player.getBankPin().getPinAppendDay()); for (int i = 0; i < player.getBankPin().getBankPin().length; i ++) { write.writeInt(player.getBankPin().getBankPin()[i]); } for (int i = 0; i < player.getBankPin().getPendingBankPin().length; i ++) { write.writeInt(player.getBankPin().getPendingBankPin()[i]); } for (int i = 0; i < player.getQuesting().questData.length; i ++) { write.writeInt((Integer) player.getQuesting().questData[i][1]); } for (int i = 0; i < 4; i ++) { write.writeInt((Integer) player.getRunecrafting().getPouchData(i)); } for (int i = 0; i < player.getAppearance().length; i ++) { write.writeInt(player.getAppearance()[i]); } for (int i = 0; i < player.getColors().length; i ++) { write.writeInt(player.getColors()[i]); } for (int i = 0; i < player.getSkill().getLevel().length; i ++) { write.writeInt(player.getSkill().getLevel()[i]); } for (int i = 0; i < player.getSkill().getExp().length; i ++) { write.writeInt((int) player.getSkill().getExp()[i]); } for (int i = 0; i < 28; i ++) { Item item = player.getInventory().getItemContainer().get(i); if (item == null) { write.writeInt(65535); } else { write.writeInt(item.getId()); write.writeInt(item.getCount()); } } for (int i = 0; i < 14; i ++) { Item item = player.getEquipment().getItemContainer().get(i); if (item == null) { write.writeInt(65535); } else { write.writeInt(item.getId()); write.writeInt(item.getCount()); } } for (int i = 0; i < BankManager.SIZE; i ++) { Item item = player.getBank().get(i); if (item == null) { write.writeInt(65535); } else { write.writeInt(item.getId()); write.writeInt(item.getCount()); } } for (int i = 0; i < player.getFriends().length; i ++) { write.writeLong(player.getFriends()[i]); } for (int i = 0; i < player.getIgnores().length; i ++) { write.writeLong(player.getIgnores()[i]); } for (int i = 0; i < player.getPendingItems().length; i ++) { write.writeInt(player.getPendingItems()[i]); write.writeInt(player.getPendingItemsAmount()[i]); } } /** * Loads the player (and sets the loaded attributes). * * @param player * the player to load. * @return 0 for success, 1 if the player does not have a saved game, 2 for * invalid username/password */ public static void load(Player player) throws Exception { File file = new File(directory + player.getUsername() + ".dat"); if (!file.exists()) { return; } FileInputStream inFile = new FileInputStream(file); DataInputStream load = new DataInputStream(inFile); player.setUsername(load.readUTF()); String password = load.readUTF(); player.setPassword(password); player.setStaffRights(load.readInt()); player.getPosition().setX(load.readInt()); player.getPosition().setY(load.readInt()); player.getPosition().setZ(load.readInt()); player.setGender(load.readInt()); player.setHasDesigned(load.readBoolean()); player.setScreenBrightness(load.readInt()); player.setMouseButtons(load.readInt()); player.setChatEffects(load.readInt()); player.setSplitPrivateChat(load.readInt()); player.setAcceptAid(load.readInt()); player.setMusicVolume(load.readInt()); player.setEffectVolume(load.readInt()); player.setQuestPoints(load.readInt()); player.setSpecialAmount(load.readDouble()); Object[] slayerTask = {load.readUTF(), load.readInt()}; player.setSlayerTask(slayerTask); player.getBankPin().setChangingBankPin(load.readBoolean()); player.getBankPin().setDeletingBankPin(load.readBoolean()); player.getBankPin().setPinAppendYear(load.readInt()); player.getBankPin().setPinAppendDay(load.readInt()); for (int i = 0; i < player.getBankPin().getBankPin().length; i ++) { player.getBankPin().getBankPin()[i] = load.readInt(); } for (int i = 0; i < player.getBankPin().getPendingBankPin().length; i ++) { player.getBankPin().getPendingBankPin()[i] = load.readInt(); } for (int i = 0; i < player.getQuesting().questData.length; i ++) { player.getQuesting().questData[i][1] = load.readInt(); } for (int i = 0; i < 4; i ++) { player.getRunecrafting().setPouchData(i, load.readInt()); } for (int i = 0; i < player.getAppearance().length; i++ ) { player.getAppearance()[i] = load.readInt(); } for (int i = 0; i < player.getColors().length; i ++) { player.getColors()[i] = load.readInt(); } for (int i = 0; i < player.getSkill().getLevel().length; i ++) { player.getSkill().getLevel()[i] = load.readInt(); } for (int i = 0; i < player.getSkill().getExp().length; i ++) { player.getSkill().getExp()[i] = load.readInt(); } for (int i = 0; i < 28; i ++) { int id = load.readInt(); if (id != 65535) { int amount = load.readInt(); Item item = new Item(id, amount); player.getInventory().getItemContainer().set(i, item); } } for (int i = 0; i < 14; i ++) { int id = load.readInt(); if (id != 65535) { int amount = load.readInt(); Item item = new Item(id, amount); player.getEquipment().getItemContainer().set(i, item); } } for (int i = 0; i < BankManager.SIZE; i ++) { int id = load.readInt(); if (id != 65535) { int amount = load.readInt(); Item item = new Item(id, amount); player.getBank().set(i, item); } } for (int i = 0; i < player.getFriends().length; i ++) { player.getFriends()[i] = load.readLong(); } for (int i = 0; i < player.getIgnores().length; i ++) { player.getIgnores()[i] = load.readLong(); } for (int i = 0; i < player.getPendingItems().length; i ++) { player.getPendingItems()[i] = load.readInt(); player.getPendingItemsAmount()[i] = load.readInt(); } } }
[ "metallic_mike@yahoo.com" ]
metallic_mike@yahoo.com
a21ebd970eae8a90ee076459e62208beb8e1ef52
7b4b2982a03261f5d48d72b887c5bebf889f1f7e
/Moutons/src/donnee/BaseDeDonnees.java
6efc22eccfa74948561e230e99ddafb8272168df
[]
no_license
cegepmatane/devoir-nuage-2020-Simon-Delarue
5a6b02c87aa30bcae11326fbd9bb52c87ab1329d
eaa595789edae2eb34231075baae4773f2492ba0
refs/heads/main
2022-12-31T18:33:09.620047
2020-10-26T13:40:07
2020-10-26T13:40:07
302,103,044
0
1
null
null
null
null
UTF-8
Java
false
false
1,065
java
package donnee; import java.io.FileInputStream; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import com.google.auth.Credentials; import com.google.auth.oauth2.GoogleCredentials; import com.google.cloud.firestore.Firestore; import com.google.cloud.firestore.FirestoreOptions; public class BaseDeDonnees { private Firestore nuage = null; String ID_Projet = "troupeau-7ce27"; private BaseDeDonnees() { try { Credentials credit = GoogleCredentials.fromStream(new FileInputStream("cle-bergerie.json")); nuage = FirestoreOptions.getDefaultInstance().toBuilder().setCredentials(credit).setProjectId(ID_Projet).build().getService(); System.out.println("Base de donnees"); }catch(Exception e){ e.printStackTrace(); } } // SINGLETON - DEBUT private static BaseDeDonnees instance = null; public static BaseDeDonnees getInstance() { if(null == instance) instance = new BaseDeDonnees(); return instance; } // SINGLETON - FIN public Firestore getConnection() { return this.nuage; } }
[ "simon.delarue2@gmail.com" ]
simon.delarue2@gmail.com
692f529340cf986141fff04b54293e6dec77e10d
4536078b4070fc3143086ff48f088e2bc4b4c681
/v1.1.2/decompiled/l/a/b/a/c/o0$a.java
c78912ef4fae66a5bc03f469a84b6dea3e28f418
[]
no_license
olealgoritme/smittestopp_src
485b81422752c3d1e7980fbc9301f4f0e0030d16
52080d5b7613cb9279bc6cda5b469a5c84e34f6a
refs/heads/master
2023-05-27T21:25:17.564334
2023-05-02T14:24:31
2023-05-02T14:24:31
262,846,147
0
0
null
null
null
null
UTF-8
Java
false
false
675
java
package l.a.b.a.c; import java.nio.ByteBuffer; import java.util.Map; import l.a.b.a.b.f; public class o0$a implements r.b<f> { public o0$a(o0 paramo0) {} public Object a(r paramr, k0 paramk0) { Object localObject = (f)a.c.get(paramk0); paramr = (r)localObject; if (localObject == null) { localObject = new byte[paramk0.a()]; paramk0.a((byte[])localObject); paramr = f.a(new String((byte[])localObject, o0.e)); a.c.put(new k0.a(ByteBuffer.wrap((byte[])localObject)), paramr); } return paramr; } } /* Location: * Qualified Name: l.a.b.a.c.o0.a * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "olealgoritme@gmail.com" ]
olealgoritme@gmail.com
ac9fbf6cf6e803d43fb6e563df9735672bbeb7ef
f306013d2374455d151bf6e970edaf702afc157d
/Codigo/GIS v0.55/src/main/java/geotools/quickstart/tutorial/Csv2Shape.java
1ab14b1cfcea4e79b1ca78d52efab44d2ffe729e
[]
no_license
Ahira2110/Proyecto-GIS-Software-Libre
d243ec8d6fd1f6a8ba12105b8a278790ec14bf61
9a3a99ae8f0ddbdd99e83e6f8f02efb636cd2c0f
refs/heads/master
2021-07-08T10:16:35.901039
2019-06-27T00:19:11
2019-06-27T00:19:11
189,467,862
0
0
null
2020-10-13T13:58:37
2019-05-30T19:05:28
HTML
UTF-8
Java
false
false
8,147
java
package geotools.quickstart.tutorial; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.Serializable; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.swing.UIManager; import org.geotools.data.DataUtilities; import org.geotools.data.DefaultTransaction; import org.geotools.data.Transaction; import org.geotools.data.collection.ListFeatureCollection; import org.geotools.data.shapefile.ShapefileDataStore; import org.geotools.data.shapefile.ShapefileDataStoreFactory; import org.geotools.data.simple.SimpleFeatureCollection; import org.geotools.data.simple.SimpleFeatureSource; import org.geotools.data.simple.SimpleFeatureStore; import org.geotools.feature.simple.SimpleFeatureBuilder; import org.geotools.feature.simple.SimpleFeatureTypeBuilder; import org.geotools.geometry.jts.JTSFactoryFinder; import org.geotools.referencing.crs.DefaultGeographicCRS; import org.geotools.swing.data.JFileDataStoreChooser; import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.GeometryFactory; import org.locationtech.jts.geom.Point; import org.opengis.feature.simple.SimpleFeature; import org.opengis.feature.simple.SimpleFeatureType; /** * This example reads data for point locations and associated attributes from a comma separated text * (CSV) file and exports them as a new shapefile. It illustrates how to build a feature type. * * <p>Note: to keep things simple in the code below the input file should not have additional spaces * or tabs between fields. */ public class Csv2Shape { public static void main(String[] args) throws Exception { // Set cross-platform look & feel for compatability UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); File file = JFileDataStoreChooser.showOpenFile("csv", null); if (file == null) { return; } /* * We use the DataUtilities class to create a FeatureType that will describe the data in our * shapefile. * * See also the createFeatureType method below for another, more flexible approach. */ final SimpleFeatureType TYPE = DataUtilities.createType("Location","the_geom:Point:srid=4326,name:String,number:Integer"); System.out.println("TYPE:"+TYPE); /* * A list to collect features as we create them. */ List<SimpleFeature> features = new ArrayList<>(); /* * GeometryFactory will be used to create the geometry attribute of each feature, * using a Point object for the location. */ org.locationtech.jts.geom.GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory(); SimpleFeatureBuilder featureBuilder = new SimpleFeatureBuilder(TYPE); try (BufferedReader reader = new BufferedReader(new FileReader(file))) { /* First line of the data file is the header */ String line = reader.readLine(); System.out.println("Header: " + line); for (line = reader.readLine(); line != null; line = reader.readLine()) { if (line.trim().length() > 0) { // skip blank lines String tokens[] = line.split("\\,"); double latitude = Double.parseDouble(tokens[0]); double longitude = Double.parseDouble(tokens[1]); //OBSERVACION: al marcar las coordenadas en al mapa desde el archivo locations, por algun motivo // el valor de las coordenadas cambian de signo x lo q ahora se agrega el cambio de signo latitude=-latitude; longitude=-longitude; String name = tokens[2].trim(); int number = Integer.parseInt(tokens[3].trim()); /* Longitude (= x coord) first ! */ Point point = geometryFactory.createPoint(new Coordinate(longitude, latitude)); featureBuilder.add(point); featureBuilder.add(name); featureBuilder.add(number); SimpleFeature feature = featureBuilder.buildFeature(null); features.add(feature); } } } //------------------------------------------ /* * Get an output file name and create the new shapefile */ File newFile = getNewShapeFile(file); ShapefileDataStoreFactory dataStoreFactory = new ShapefileDataStoreFactory(); Map<String, Serializable> params = new HashMap<>(); params.put("url", newFile.toURI().toURL()); params.put("create spatial index", Boolean.TRUE); ShapefileDataStore newDataStore = (ShapefileDataStore) dataStoreFactory.createNewDataStore(params); /* * TYPE is used as a template to describe the file contents */ newDataStore.createSchema(TYPE); //---------------------------- /* * Write the features to the shapefile */ Transaction transaction = new DefaultTransaction("create"); String typeName = newDataStore.getTypeNames()[0]; SimpleFeatureSource featureSource = newDataStore.getFeatureSource(typeName); SimpleFeatureType SHAPE_TYPE = featureSource.getSchema(); /* * The Shapefile format has a couple limitations: * - "the_geom" is always first, and used for the geometry attribute name * - "the_geom" must be of type Point, MultiPoint, MuiltiLineString, MultiPolygon * - Attribute names are limited in length * - Not all data types are supported (example Timestamp represented as Date) * * Each data store has different limitations so check the resulting SimpleFeatureType. */ System.out.println("SHAPE:" + SHAPE_TYPE); if (featureSource instanceof SimpleFeatureStore) { SimpleFeatureStore featureStore = (SimpleFeatureStore) featureSource; /* * SimpleFeatureStore has a method to add features from a * SimpleFeatureCollection object, so we use the ListFeatureCollection * class to wrap our list of features. */ SimpleFeatureCollection collection = new ListFeatureCollection(TYPE, features); featureStore.setTransaction(transaction); try { featureStore.addFeatures(collection); transaction.commit(); } catch (Exception problem) { problem.printStackTrace(); transaction.rollback(); } finally { transaction.close(); } System.exit(0); // success! } else { System.out.println(typeName + " does not support read/write access"); System.exit(1); } } /** * Prompt the user for the name and path to use for the output shapefile * * @param csvFile the input csv file used to create a default shapefile name * @return name and path for the shapefile as a new File object */ private static File getNewShapeFile(File csvFile) { String path = csvFile.getAbsolutePath(); String newPath = path.substring(0, path.length() - 4) + ".shp"; JFileDataStoreChooser chooser = new JFileDataStoreChooser("shp"); chooser.setDialogTitle("Save shapefile"); chooser.setSelectedFile(new File(newPath)); int returnVal = chooser.showSaveDialog(null); if (returnVal != JFileDataStoreChooser.APPROVE_OPTION) { // the user cancelled the dialog System.exit(0); } File newFile = chooser.getSelectedFile(); if (newFile.equals(csvFile)) { System.out.println("Error: cannot replace " + csvFile); System.exit(0); } return newFile; } }
[ "kevinalancay@gmail.com" ]
kevinalancay@gmail.com
a8c5e38a07f23515234804b5f25780c028c4c6fa
eab22f819437d108d88b6d527d0121ac94d0c93b
/app/src/main/java/ranggacikal/com/myapplication/adapter/PenjualanAdapter.java
f46fab57961bd88dc3af638a6c894b89032d3843
[]
no_license
ranggacikal/PointOfSaleJCodeCloth
7ad5e273beca584a97d77330096a4d3f230d4804
1b3817d87122e63c5c662373253562bfe1cf3a3d
refs/heads/master
2023-01-23T15:05:57.647745
2020-11-24T11:27:47
2020-11-24T11:27:47
315,610,173
0
0
null
null
null
null
UTF-8
Java
false
false
5,456
java
package ranggacikal.com.myapplication.adapter; import android.content.Context; import android.content.Intent; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; import java.text.NumberFormat; import java.util.List; import java.util.Locale; import ranggacikal.com.myapplication.BuktiPenjualanActivity; import ranggacikal.com.myapplication.DetailBarangPenjualanActivity; import ranggacikal.com.myapplication.KeranjangActivity; import ranggacikal.com.myapplication.PointOfSaleActivity; import ranggacikal.com.myapplication.R; import ranggacikal.com.myapplication.model.DataPenjualanItem; public class PenjualanAdapter extends RecyclerView.Adapter<PenjualanAdapter.PenjualanViewHolder> { Context mContext; List<DataPenjualanItem> penjualanItems; public PenjualanAdapter(Context mContext, List<DataPenjualanItem> penjualanItems) { this.mContext = mContext; this.penjualanItems = penjualanItems; } @NonNull @Override public PenjualanViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_penjualan_pos, parent, false); return new PenjualanViewHolder(view); } @Override public void onBindViewHolder(@NonNull PenjualanViewHolder holder, int position) { String id_penjualan = penjualanItems.get(position).getIdPenjualan(); String tanggal_penjualan = penjualanItems.get(position).getTanggalPenjualan(); // String total_penjualan = penjualanItems.get(position).getTotal(); String username = penjualanItems.get(position).getName(); String status = penjualanItems.get(position).getStatusPenjualan(); holder.txtIdPenjualan.setText(id_penjualan); holder.txtTanggalPenjualan.setText(tanggal_penjualan); holder.txtStatusPenjualan.setText(status); holder.txtUser.setText(username); int harga = Integer.parseInt(penjualanItems.get(position).getTotal()); Locale localID = new Locale("in", "ID"); NumberFormat formatRupiah = NumberFormat.getCurrencyInstance(localID); holder.txtTotalPenjualan.setText(formatRupiah.format(harga)); if (status.equals("Belum Selesai")){ holder.btnCheckout.setVisibility(View.VISIBLE); holder.btnDetail.setVisibility(View.GONE); holder.btnCetakBukti.setVisibility(View.GONE); holder.btnCheckout.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intentKeranjang = new Intent(mContext, KeranjangActivity.class); intentKeranjang.putExtra(KeranjangActivity.EXTRA_ID_PENJUALAN, id_penjualan); mContext.startActivity(intentKeranjang); ((PointOfSaleActivity)mContext).finish(); } }); }else if (status.equals("Selesai")){ holder.btnDetail.setVisibility(View.VISIBLE); holder.btnCetakBukti.setVisibility(View.VISIBLE); holder.btnCheckout.setVisibility(View.GONE); holder.btnCetakBukti.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intentCetak = new Intent(mContext, BuktiPenjualanActivity.class); intentCetak.putExtra(BuktiPenjualanActivity.EXTRA_ID_PENJUALAN, id_penjualan); mContext.startActivity(intentCetak); ((PointOfSaleActivity)mContext).finish(); } }); holder.btnDetail.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intentDetail = new Intent(mContext, DetailBarangPenjualanActivity.class); intentDetail.putExtra(DetailBarangPenjualanActivity.EXTRA_ID_PENJUALAN, id_penjualan); mContext.startActivity(intentDetail); ((PointOfSaleActivity)mContext).finish(); } }); } } @Override public int getItemCount() { return penjualanItems.size(); } public class PenjualanViewHolder extends RecyclerView.ViewHolder { TextView txtIdPenjualan, txtTanggalPenjualan, txtTotalPenjualan, txtStatusPenjualan, txtUser; Button btnDetail, btnCheckout, btnCetakBukti; public PenjualanViewHolder(@NonNull View itemView) { super(itemView); txtIdPenjualan = itemView.findViewById(R.id.tv_list_id_penjualan); txtTanggalPenjualan = itemView.findViewById(R.id.tv_list_tanggal_penjualan); txtTotalPenjualan = itemView.findViewById(R.id.tv_list_total_penjualan); txtStatusPenjualan = itemView.findViewById(R.id.tv_list_status_penjualan); txtUser = itemView.findViewById(R.id.tv_list_username_penjualan); btnCheckout = itemView.findViewById(R.id.btn_selesaikan_pembelian_list_penjualan); btnDetail = itemView.findViewById(R.id.btn_detail_list_penjualan); btnCetakBukti = itemView.findViewById(R.id.btn_cetak_bukti_penjualan); } } }
[ "ranggacikal2@gmail.com" ]
ranggacikal2@gmail.com
c96e92da518fea8ebfb8a37dfd29a0f6ec388f9b
dc0916fed533865f1db18698a9b231131b372ae8
/src/br/laion/ranks/plugin/Utils/Scroller.java
d91909dd316d319998905d44da19640aec14e8a7
[]
no_license
iLemonBr/Ranks
682d5ef95977995643d3d2bb812d164ea6280e4c
bac36223337f2d1c8954a9408e16a5a9ac7f9b64
refs/heads/main
2023-02-01T08:00:56.860555
2020-12-20T23:25:03
2020-12-20T23:25:03
323,183,733
1
0
null
2020-12-20T23:16:20
2020-12-20T23:16:20
null
ISO-8859-1
Java
false
false
7,026
java
package br.laion.ranks.plugin.Utils; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.HashMap; import java.util.List; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.InventoryHolder; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; import br.laion.ranks.plugin.RanksPlugin; /** * Code created by SrLaion Version: 1.2 */ public class Scroller { static { Bukkit.getPluginManager().registerEvents(new Listener() { @EventHandler public void onClick(InventoryClickEvent e) { if (e.getInventory().getHolder() instanceof ScrollerHolder) { e.setCancelled(true); ScrollerHolder holder = (ScrollerHolder) e.getInventory().getHolder(); if (e.getSlot() == holder.getScroller().previousPage) { if (holder.getScroller().hasPage(holder.getPage() - 1)) { holder.getScroller().open((Player) e.getWhoClicked(), holder.getPage() - 1); } } else if (e.getSlot() == holder.getScroller().nextPage) { if (holder.getScroller().hasPage(holder.getPage() + 1)) { holder.getScroller().open((Player) e.getWhoClicked(), holder.getPage() + 1); } } else if (e.getSlot() == holder.getScroller().backSlot) { e.getWhoClicked().closeInventory(); holder.getScroller().backRunnable.run((Player) e.getWhoClicked()); } else if (holder.getScroller().slots.contains(e.getSlot()) && holder.getScroller().onClickRunnable != null) { if (e.getCurrentItem() == null || e.getCurrentItem().getType() == Material.AIR) return; holder.getScroller().onClickRunnable.run((Player) e.getWhoClicked(), e.getCurrentItem()); } } } }, RanksPlugin.plugin); } private List<ItemStack> items; private HashMap<Integer, Inventory> pages; private String name; private int inventorySize; private List<Integer> slots; private int backSlot, previousPage, nextPage; private PlayerRunnable backRunnable; private ChooseItemRunnable onClickRunnable; public Scroller(ScrollerBuilder builder) { this.items = builder.items; this.pages = new HashMap<>(); this.name = builder.name; this.inventorySize = builder.inventorySize; this.slots = builder.slots; this.backSlot = builder.backSlot; this.backRunnable = builder.backRunnable; this.previousPage = builder.previousPage; this.nextPage = builder.nextPage; this.onClickRunnable = builder.clickRunnable; createInventories(); } private void createInventories() { List<List<ItemStack>> lists = getPages(items, slots.size()); int page = 1; for (List<ItemStack> list : lists) { Inventory inventory = Bukkit.createInventory(new ScrollerHolder(this, page), inventorySize, name); int slot = 0; for (ItemStack it : list) { inventory.setItem(slots.get(slot), it); slot++; } if (page != 1) inventory.setItem(previousPage, getPageFlecha(page - 1)); inventory.setItem(nextPage, getPageFlecha(page + 1)); if (backRunnable != null) inventory.setItem(backSlot, getBackFlecha()); pages.put(page, inventory); page++; } pages.get(pages.size()).setItem(nextPage, new ItemStack(Material.AIR)); } private ItemStack getBackFlecha() { ItemStack item = new ItemStack(Material.ARROW); ItemMeta meta = item.getItemMeta(); meta.setDisplayName(ChatColor.GREEN + "Voltar"); item.setItemMeta(meta); return item; } private ItemStack getPageFlecha(int page) { ItemStack item = new ItemStack(Material.ARROW); ItemMeta meta = item.getItemMeta(); meta.setDisplayName(ChatColor.GREEN + "Página " + page); item.setItemMeta(meta); return item; } public int getPages() { return pages.size(); } public boolean hasPage(int page) { return pages.containsKey(page); } public void open(Player player) { open(player, 1); } public void open(Player player, int page) { // player.closeInventory(); player.openInventory(pages.get(page)); } private <T> List<List<T>> getPages(Collection<T> c, Integer pageSize) { List<T> list = new ArrayList<T>(c); if (pageSize == null || pageSize <= 0 || pageSize > list.size()) pageSize = list.size(); int numPages = (int) Math.ceil((double) list.size() / (double) pageSize); List<List<T>> pages = new ArrayList<List<T>>(numPages); for (int pageNum = 0; pageNum < numPages;) pages.add(list.subList(pageNum * pageSize, Math.min(++pageNum * pageSize, list.size()))); return pages; } private class ScrollerHolder implements InventoryHolder { private Scroller scroller; private int page; public ScrollerHolder(Scroller scroller, int page) { super(); this.scroller = scroller; this.page = page; } @Override public Inventory getInventory() { return null; } /** * @return the scroller */ public Scroller getScroller() { return scroller; } /** * @return the page */ public int getPage() { return page; } } public interface PlayerRunnable { public void run(Player player); } public interface ChooseItemRunnable { public void run(Player player, ItemStack item); } public static class ScrollerBuilder { private List<ItemStack> items; private String name; private int inventorySize; private List<Integer> slots; private int backSlot, previousPage, nextPage; private PlayerRunnable backRunnable; private ChooseItemRunnable clickRunnable; private final static List<Integer> ALLOWED_SLOTS = Arrays.asList(10, 11, 12, 13, 14, 15, 16, 19, 20, 21, 22, 23, 24, 25, 28, 29, 30, 31, 32, 33, 34 /* ,37,38,39,40,41,42,43 */); // slots para caso o inventário tiver 6 linhas public ScrollerBuilder() { // default values this.items = new ArrayList<>(); this.name = ""; this.inventorySize = 45; this.slots = ALLOWED_SLOTS; this.backSlot = -1; this.previousPage = 18; this.nextPage = 26; } public ScrollerBuilder withItems(List<ItemStack> items) { this.items = items; return this; } public ScrollerBuilder withOnClick(ChooseItemRunnable clickRunnable) { this.clickRunnable = clickRunnable; return this; } public ScrollerBuilder withName(String name) { this.name = name; return this; } public ScrollerBuilder withSize(int size) { this.inventorySize = size; return this; } public ScrollerBuilder withArrowsSlots(int previousPage, int nextPage) { this.previousPage = previousPage; this.nextPage = nextPage; return this; } public ScrollerBuilder withBackItem(int slot, PlayerRunnable runnable) { this.backSlot = slot; this.backRunnable = runnable; return this; } public ScrollerBuilder withItemsSlots(Integer... slots) { this.slots = Arrays.asList(slots); return this; } public Scroller build() { return new Scroller(this); } } }
[ "noreply@github.com" ]
noreply@github.com
1449a3a0cdc05fd873d81e2d2008e678067f99be
8cb254594770219ba8bbb8db27b6999b2281652a
/src/main/java/Data/Twitch/TwitchData.java
4694908ec38c323d3ffceb6646a259b13c18158b
[]
no_license
puit12/GTY_PROJECT
4e3a7863d633372f29f8de704589b0b3be7e192e
ad852c1e73577902b2becf8292bdfcf3cea82cc3
refs/heads/master
2022-12-26T16:29:05.634431
2019-06-29T18:42:36
2019-06-29T18:42:36
161,929,097
0
0
null
2022-12-16T08:51:54
2018-12-15T17:37:47
JavaScript
UTF-8
Java
false
false
233
java
package Data.Twitch; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import lombok.Data; @Data @JsonIgnoreProperties(ignoreUnknown = true) public class TwitchData { int _total; TwitchStream streams[]; }
[ "puit12@naver.com" ]
puit12@naver.com
17db8669557a5755250034ddc042e575a56a6abd
580040533fe987fae073b4d02cb54218b73ffed7
/official-demo/service-sun/src/main/java/cloud/waimai/service/sun/controller/PingController.java
3b1201fa4d5cbeae672b6604f39c3e2eb961c3d3
[]
no_license
jimuyang/spring-cloud
760606f7530dd0d521d1395035d773fc05742399
a7ba5f13c747a6fcc7cce37fdc5d0bf1d2cd1fe7
refs/heads/master
2020-03-27T06:29:34.578016
2019-04-14T17:43:25
2019-04-14T17:43:25
146,110,658
0
0
null
null
null
null
UTF-8
Java
false
false
538
java
package cloud.waimai.service.sun.controller; import cloud.waimai.service.sun.iface.PingService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; /** * @author: Yang Fan * @date: 2019-04-10 * @desc: */ @RestController public class PingController { @Autowired private PingService pingService; @GetMapping("/ping") public String ping() { return pingService.ping(); } }
[ "fan.yang19@ele.me" ]
fan.yang19@ele.me
304e1e0de90630f586d983e6e394a2a3141cf04e
4d4994a9436059b963275acaf2b88037bcf79ddb
/hazelcast/src/main/java/com/hazelcast/internal/json/ParseException.java
743909ae5fc87866e221783a97cf0b7ead65857b
[ "MIT", "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
mdogan/hazelcast
2ec190161cc1d196632d81cf13943dea87d92953
429558069a30c1b45eb3e696ce55f54ba9f0f1f0
refs/heads/master
2022-10-31T04:42:06.967289
2020-10-08T08:05:52
2020-10-08T08:05:52
4,871,946
2
3
Apache-2.0
2022-09-26T02:14:20
2012-07-03T12:31:19
Java
UTF-8
Java
false
false
1,851
java
/******************************************************************************* * Copyright (c) 2013, 2016 EclipseSource. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. ******************************************************************************/ package com.hazelcast.internal.json; /** * An unchecked exception to indicate that an input does not qualify as valid JSON. */ @SuppressWarnings("serial") // use default serial UID public class ParseException extends RuntimeException { private final Location location; ParseException(String message, Location location) { super(message + " at " + location); this.location = location; } /** * Returns the location at which the error occurred. * * @return the error location */ public Location getLocation() { return location; } }
[ "josef.cacek@gmail.com" ]
josef.cacek@gmail.com
46b3a8cd450149c571bde3c6e0d68d26ce56d9d8
94927d1dadfc0b76a70f7b9964b976fc407e5a54
/CardGame/app/src/main/java/com/codeclan/cardgame/G2P2CHWPlayActivity.java
370a2433d98a5995107a888a420914f64a852018
[]
no_license
DoRoCro/Project2-Android-CardGame
5edd11e146c4176225272857d3f94ddfe8240bd5
98ed108659b95fb41eeee9dd7cfe6079ef7dd404
refs/heads/master
2021-01-22T19:35:58.074455
2017-05-21T16:55:50
2017-05-21T16:55:50
85,215,158
0
0
null
null
null
null
UTF-8
Java
false
false
6,811
java
package com.codeclan.cardgame; import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.view.SurfaceHolder; import android.view.View; import android.widget.ImageButton; import android.widget.TextView; import android.widget.Toast; import java.util.ArrayList; public class G2P2CHWPlayActivity extends AppCompatActivity implements ViewerInterface { private Game2Player2CardHighestScoreWinsN game; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_g2p2chwplay); game = new Game2Player2CardHighestScoreWinsN(10, this); // Game2Player1CardHighestWinsN gameConsole = new Game2Player1CardHighestWinsN(10, new ConsoleViewer()); // gameConsole.play(); // runs game logic in console non-interactively using ConsoleViewer class // un-comment below for interactive version // // // Log.d(getClass().toString(), getString(R.string.player_label)); Log.d(getClass().toString(), getString(R.string.computer_label)); this.game.getPlayers()[0].setName(getString(R.string.player_label)); // player gets card first, use common name this.game.getPlayers()[1].setName(getString(R.string.computer_label)); // dealer gets card second, use common name Log.d(getClass().toString(), "about to setup"); this.game.setup(); Log.d(getClass().toString(), "setup, about to start game"); } public String messageOut(String output){ System.out.println(output); Toast.makeText(this, output, Toast.LENGTH_SHORT).show(); return output; } public void listHand(Player player){ messageOut("Player: " + player.getName()); messageOut(player.getHand().toString()); } public void winsRound(Player player) { messageOut(player.getName() + " wins Round!"); } public void winsGame(Player player) { messageOut("Congratulations " + player.getName() + ", you have won the game!"); } private enum PlayState{ NOCARDS, DEALCARDS, SHOWCARDS; private PlayState getNext(){ // cycle through states (nicked from SO) return values()[(this.ordinal() + 1) % PlayState.values().length]; } } private static PlayState playstate = PlayState.SHOWCARDS; // initial value in class each time enter view? public void nextStepInGame(View view){ // called by click on either card, so need to track state Log.d(getClass().toString(),"playstate before = " + playstate.toString()); playstate = playstate.getNext(); Log.d(getClass().toString(),"playstate after update = " + playstate.toString()); ImageButton computerCard1 = (ImageButton) findViewById(R.id.computerCard1); ImageButton computerCard2 = (ImageButton) findViewById(R.id.computerCard2); ImageButton youCard1 = (ImageButton) findViewById(R.id.youCard1); ImageButton youCard2 = (ImageButton) findViewById(R.id.youCard2); TextView infoPanel = (TextView) findViewById(R.id.info_panel); switch (playstate){ case NOCARDS: { // show empty buttons as no cards on table computerCard1.setImageResource(R.color.holo_green_dark); computerCard2.setImageResource(R.color.holo_green_dark); youCard1.setImageResource(R.color.holo_blue_dark); youCard2.setImageResource(R.color.holo_blue_dark); infoPanel.setText("Click to deal cards to both players"); break; } case DEALCARDS: { // show backs of cards ready to play them computerCard1.setImageResource(R.drawable.card_back); computerCard2.setImageResource(R.drawable.card_back); youCard1.setImageResource(R.drawable.card_back); youCard2.setImageResource(R.drawable.card_back); infoPanel.setText("Click to reveal cards"); break; } case SHOWCARDS: { // playARound, but only show last 2 card faces on the faceups pile game.playARound(); // TODO update card 2 to show correct card not duplicate. Needs method to access next card in hand ArrayList<Card> shownCards = game.getPlayers()[1].getHand().getFaceups(); int lastcardindex = shownCards.size() - 1 ; String cardToShow1 = shownCards.get(lastcardindex).toDrawableName(); String cardToShow2 = shownCards.get(lastcardindex - 1).toDrawableName(); // safe if two cards dealt computerCard1.setImageResource(getResources().getIdentifier(cardToShow1, "drawable", "com.codeclan.cardgame")); computerCard2.setImageResource(getResources().getIdentifier(cardToShow2, "drawable", "com.codeclan.cardgame")); shownCards = game.getPlayers()[0].getHand().getFaceups(); lastcardindex = shownCards.size() - 1 ; // redundant since should be same size for both players... cardToShow1 = shownCards.get(lastcardindex).toDrawableName(); cardToShow2 = shownCards.get(lastcardindex - 1).toDrawableName(); // safe if two cards dealt youCard1.setImageResource(getResources().getIdentifier(cardToShow1, "drawable", "com.codeclan.cardgame")); youCard2.setImageResource(getResources().getIdentifier(cardToShow2, "drawable", "com.codeclan.cardgame")); infoPanel.setText(getString(R.string.computer_label) + " has " + game.getPlayers()[1].getScore().toString() + " points,\n" + getString(R.string.player_label) + " has " + game.getPlayers()[0].getScore().toString() + " points.\n Click for clear table") ; break; } } if( game.isOver() ){ // // break out of onClick loop by going to new activity to display results // Intent resultsIntent = new Intent(this, G2P2CHWResultsActivity.class); resultsIntent.putExtra("player1score", game.getPlayers()[0].getScore()); resultsIntent.putExtra("dealerscore", game.getPlayers()[1].getScore()); resultsIntent.putExtra("winner", game.winner().getName()); startActivity(resultsIntent); } } // TODO may want to remove this from interface and game classes public void waitForUserClick(Player player){ // hook for onclick in activity Log.d(getClass().toString(),"wait for user click???"); } }
[ "douglas.crooke+codeclan@googlemail.com" ]
douglas.crooke+codeclan@googlemail.com
932c61945d40a578873a1bd158fcca61183414a7
6fa701cdaa0d83caa0d3cbffe39b40e54bf3d386
/google/cloud/dataproc/v1/google-cloud-dataproc-v1-java/proto-google-cloud-dataproc-v1-java/src/main/java/com/google/cloud/dataproc/v1/ClustersProto.java
056c7b4ba3952e3a625eba13842565e7c23816ad
[ "Apache-2.0" ]
permissive
oltoco/googleapis-gen
bf40cfad61b4217aca07068bd4922a86e3bbd2d5
00ca50bdde80906d6f62314ef4f7630b8cdb6e15
refs/heads/master
2023-07-17T22:11:47.848185
2021-08-29T20:39:47
2021-08-29T20:39:47
null
0
0
null
null
null
null
UTF-8
Java
false
true
53,810
java
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/cloud/dataproc/v1/clusters.proto package com.google.cloud.dataproc.v1; public final class ClustersProto { private ClustersProto() {} public static void registerAllExtensions( com.google.protobuf.ExtensionRegistryLite registry) { } public static void registerAllExtensions( com.google.protobuf.ExtensionRegistry registry) { registerAllExtensions( (com.google.protobuf.ExtensionRegistryLite) registry); } static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_dataproc_v1_Cluster_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_dataproc_v1_Cluster_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_dataproc_v1_Cluster_LabelsEntry_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_dataproc_v1_Cluster_LabelsEntry_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_dataproc_v1_ClusterConfig_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_dataproc_v1_ClusterConfig_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_dataproc_v1_GkeClusterConfig_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_dataproc_v1_GkeClusterConfig_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_dataproc_v1_GkeClusterConfig_NamespacedGkeDeploymentTarget_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_dataproc_v1_GkeClusterConfig_NamespacedGkeDeploymentTarget_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_dataproc_v1_EndpointConfig_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_dataproc_v1_EndpointConfig_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_dataproc_v1_EndpointConfig_HttpPortsEntry_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_dataproc_v1_EndpointConfig_HttpPortsEntry_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_dataproc_v1_AutoscalingConfig_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_dataproc_v1_AutoscalingConfig_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_dataproc_v1_EncryptionConfig_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_dataproc_v1_EncryptionConfig_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_dataproc_v1_GceClusterConfig_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_dataproc_v1_GceClusterConfig_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_dataproc_v1_GceClusterConfig_MetadataEntry_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_dataproc_v1_GceClusterConfig_MetadataEntry_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_dataproc_v1_NodeGroupAffinity_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_dataproc_v1_NodeGroupAffinity_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_dataproc_v1_ShieldedInstanceConfig_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_dataproc_v1_ShieldedInstanceConfig_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_dataproc_v1_InstanceGroupConfig_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_dataproc_v1_InstanceGroupConfig_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_dataproc_v1_ManagedGroupConfig_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_dataproc_v1_ManagedGroupConfig_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_dataproc_v1_AcceleratorConfig_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_dataproc_v1_AcceleratorConfig_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_dataproc_v1_DiskConfig_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_dataproc_v1_DiskConfig_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_dataproc_v1_NodeInitializationAction_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_dataproc_v1_NodeInitializationAction_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_dataproc_v1_ClusterStatus_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_dataproc_v1_ClusterStatus_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_dataproc_v1_SecurityConfig_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_dataproc_v1_SecurityConfig_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_dataproc_v1_KerberosConfig_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_dataproc_v1_KerberosConfig_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_dataproc_v1_IdentityConfig_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_dataproc_v1_IdentityConfig_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_dataproc_v1_IdentityConfig_UserServiceAccountMappingEntry_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_dataproc_v1_IdentityConfig_UserServiceAccountMappingEntry_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_dataproc_v1_SoftwareConfig_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_dataproc_v1_SoftwareConfig_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_dataproc_v1_SoftwareConfig_PropertiesEntry_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_dataproc_v1_SoftwareConfig_PropertiesEntry_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_dataproc_v1_LifecycleConfig_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_dataproc_v1_LifecycleConfig_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_dataproc_v1_MetastoreConfig_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_dataproc_v1_MetastoreConfig_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_dataproc_v1_ClusterMetrics_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_dataproc_v1_ClusterMetrics_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_dataproc_v1_ClusterMetrics_HdfsMetricsEntry_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_dataproc_v1_ClusterMetrics_HdfsMetricsEntry_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_dataproc_v1_ClusterMetrics_YarnMetricsEntry_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_dataproc_v1_ClusterMetrics_YarnMetricsEntry_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_dataproc_v1_CreateClusterRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_dataproc_v1_CreateClusterRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_dataproc_v1_UpdateClusterRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_dataproc_v1_UpdateClusterRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_dataproc_v1_StopClusterRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_dataproc_v1_StopClusterRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_dataproc_v1_StartClusterRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_dataproc_v1_StartClusterRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_dataproc_v1_DeleteClusterRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_dataproc_v1_DeleteClusterRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_dataproc_v1_GetClusterRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_dataproc_v1_GetClusterRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_dataproc_v1_ListClustersRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_dataproc_v1_ListClustersRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_dataproc_v1_ListClustersResponse_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_dataproc_v1_ListClustersResponse_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_dataproc_v1_DiagnoseClusterRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_dataproc_v1_DiagnoseClusterRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_dataproc_v1_DiagnoseClusterResults_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_dataproc_v1_DiagnoseClusterResults_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_dataproc_v1_ReservationAffinity_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_dataproc_v1_ReservationAffinity_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; } private static com.google.protobuf.Descriptors.FileDescriptor descriptor; static { java.lang.String[] descriptorData = { "\n\'google/cloud/dataproc/v1/clusters.prot" + "o\022\030google.cloud.dataproc.v1\032\034google/api/" + "annotations.proto\032\027google/api/client.pro" + "to\032\037google/api/field_behavior.proto\032\031goo" + "gle/api/resource.proto\032%google/cloud/dat" + "aproc/v1/shared.proto\032#google/longrunnin" + "g/operations.proto\032\036google/protobuf/dura" + "tion.proto\032 google/protobuf/field_mask.p" + "roto\032\037google/protobuf/timestamp.proto\"\315\003" + "\n\007Cluster\022\027\n\nproject_id\030\001 \001(\tB\003\340A\002\022\031\n\014cl" + "uster_name\030\002 \001(\tB\003\340A\002\022<\n\006config\030\003 \001(\0132\'." + "google.cloud.dataproc.v1.ClusterConfigB\003" + "\340A\002\022B\n\006labels\030\010 \003(\0132-.google.cloud.datap" + "roc.v1.Cluster.LabelsEntryB\003\340A\001\022<\n\006statu" + "s\030\004 \001(\0132\'.google.cloud.dataproc.v1.Clust" + "erStatusB\003\340A\003\022D\n\016status_history\030\007 \003(\0132\'." + "google.cloud.dataproc.v1.ClusterStatusB\003" + "\340A\003\022\031\n\014cluster_uuid\030\006 \001(\tB\003\340A\003\022>\n\007metric" + "s\030\t \001(\0132(.google.cloud.dataproc.v1.Clust" + "erMetricsB\003\340A\003\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001" + "(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\251\010\n\rClusterConfig\022" + "\032\n\rconfig_bucket\030\001 \001(\tB\003\340A\001\022\030\n\013temp_buck" + "et\030\002 \001(\tB\003\340A\001\022K\n\022gce_cluster_config\030\010 \001(" + "\0132*.google.cloud.dataproc.v1.GceClusterC" + "onfigB\003\340A\001\022I\n\rmaster_config\030\t \001(\0132-.goog" + "le.cloud.dataproc.v1.InstanceGroupConfig" + "B\003\340A\001\022I\n\rworker_config\030\n \001(\0132-.google.cl" + "oud.dataproc.v1.InstanceGroupConfigB\003\340A\001" + "\022S\n\027secondary_worker_config\030\014 \001(\0132-.goog" + "le.cloud.dataproc.v1.InstanceGroupConfig" + "B\003\340A\001\022F\n\017software_config\030\r \001(\0132(.google." + "cloud.dataproc.v1.SoftwareConfigB\003\340A\001\022W\n" + "\026initialization_actions\030\013 \003(\01322.google.c" + "loud.dataproc.v1.NodeInitializationActio" + "nB\003\340A\001\022J\n\021encryption_config\030\017 \001(\0132*.goog" + "le.cloud.dataproc.v1.EncryptionConfigB\003\340" + "A\001\022L\n\022autoscaling_config\030\022 \001(\0132+.google." + "cloud.dataproc.v1.AutoscalingConfigB\003\340A\001" + "\022F\n\017security_config\030\020 \001(\0132(.google.cloud" + ".dataproc.v1.SecurityConfigB\003\340A\001\022H\n\020life" + "cycle_config\030\021 \001(\0132).google.cloud.datapr" + "oc.v1.LifecycleConfigB\003\340A\001\022F\n\017endpoint_c" + "onfig\030\023 \001(\0132(.google.cloud.dataproc.v1.E" + "ndpointConfigB\003\340A\001\022H\n\020metastore_config\030\024" + " \001(\0132).google.cloud.dataproc.v1.Metastor" + "eConfigB\003\340A\001\022K\n\022gke_cluster_config\030\025 \001(\013" + "2*.google.cloud.dataproc.v1.GkeClusterCo" + "nfigB\003\340A\001\"\223\002\n\020GkeClusterConfig\022w\n namesp" + "aced_gke_deployment_target\030\001 \001(\0132H.googl" + "e.cloud.dataproc.v1.GkeClusterConfig.Nam" + "espacedGkeDeploymentTargetB\003\340A\001\032\205\001\n\035Name" + "spacedGkeDeploymentTarget\022D\n\022target_gke_" + "cluster\030\001 \001(\tB(\340A\001\372A\"\n container.googlea" + "pis.com/Cluster\022\036\n\021cluster_namespace\030\002 \001" + "(\tB\003\340A\001\"\272\001\n\016EndpointConfig\022P\n\nhttp_ports" + "\030\001 \003(\01327.google.cloud.dataproc.v1.Endpoi" + "ntConfig.HttpPortsEntryB\003\340A\003\022$\n\027enable_h" + "ttp_port_access\030\002 \001(\010B\003\340A\001\0320\n\016HttpPortsE" + "ntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\",\n\021" + "AutoscalingConfig\022\027\n\npolicy_uri\030\001 \001(\tB\003\340" + "A\001\"4\n\020EncryptionConfig\022 \n\023gce_pd_kms_key" + "_name\030\001 \001(\tB\003\340A\001\"\272\006\n\020GceClusterConfig\022\025\n" + "\010zone_uri\030\001 \001(\tB\003\340A\001\022\030\n\013network_uri\030\002 \001(" + "\tB\003\340A\001\022\033\n\016subnetwork_uri\030\006 \001(\tB\003\340A\001\022\035\n\020i" + "nternal_ip_only\030\007 \001(\010B\003\340A\001\022k\n\032private_ip" + "v6_google_access\030\014 \001(\0162B.google.cloud.da" + "taproc.v1.GceClusterConfig.PrivateIpv6Go" + "ogleAccessB\003\340A\001\022\034\n\017service_account\030\010 \001(\t" + "B\003\340A\001\022#\n\026service_account_scopes\030\003 \003(\tB\003\340" + "A\001\022\014\n\004tags\030\004 \003(\t\022J\n\010metadata\030\005 \003(\01328.goo" + "gle.cloud.dataproc.v1.GceClusterConfig.M" + "etadataEntry\022P\n\024reservation_affinity\030\013 \001" + "(\0132-.google.cloud.dataproc.v1.Reservatio" + "nAffinityB\003\340A\001\022M\n\023node_group_affinity\030\r " + "\001(\0132+.google.cloud.dataproc.v1.NodeGroup" + "AffinityB\003\340A\001\022W\n\030shielded_instance_confi" + "g\030\016 \001(\01320.google.cloud.dataproc.v1.Shiel" + "dedInstanceConfigB\003\340A\001\032/\n\rMetadataEntry\022" + "\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\203\001\n\027Priv" + "ateIpv6GoogleAccess\022*\n&PRIVATE_IPV6_GOOG" + "LE_ACCESS_UNSPECIFIED\020\000\022\033\n\027INHERIT_FROM_" + "SUBNETWORK\020\001\022\014\n\010OUTBOUND\020\002\022\021\n\rBIDIRECTIO" + "NAL\020\003\"0\n\021NodeGroupAffinity\022\033\n\016node_group" + "_uri\030\001 \001(\tB\003\340A\002\"}\n\026ShieldedInstanceConfi" + "g\022\037\n\022enable_secure_boot\030\001 \001(\010B\003\340A\001\022\030\n\013en" + "able_vtpm\030\002 \001(\010B\003\340A\001\022(\n\033enable_integrity" + "_monitoring\030\003 \001(\010B\003\340A\001\"\315\004\n\023InstanceGroup" + "Config\022\032\n\rnum_instances\030\001 \001(\005B\003\340A\001\022\033\n\016in" + "stance_names\030\002 \003(\tB\003\340A\003\022\026\n\timage_uri\030\003 \001" + "(\tB\003\340A\001\022\035\n\020machine_type_uri\030\004 \001(\tB\003\340A\001\022>" + "\n\013disk_config\030\005 \001(\0132$.google.cloud.datap" + "roc.v1.DiskConfigB\003\340A\001\022\033\n\016is_preemptible" + "\030\006 \001(\010B\003\340A\003\022Y\n\016preemptibility\030\n \001(\0162<.go" + "ogle.cloud.dataproc.v1.InstanceGroupConf" + "ig.PreemptibilityB\003\340A\001\022O\n\024managed_group_" + "config\030\007 \001(\0132,.google.cloud.dataproc.v1." + "ManagedGroupConfigB\003\340A\003\022F\n\014accelerators\030" + "\010 \003(\0132+.google.cloud.dataproc.v1.Acceler" + "atorConfigB\003\340A\001\022\035\n\020min_cpu_platform\030\t \001(" + "\tB\003\340A\001\"V\n\016Preemptibility\022\036\n\032PREEMPTIBILI" + "TY_UNSPECIFIED\020\000\022\023\n\017NON_PREEMPTIBLE\020\001\022\017\n" + "\013PREEMPTIBLE\020\002\"c\n\022ManagedGroupConfig\022#\n\026" + "instance_template_name\030\001 \001(\tB\003\340A\003\022(\n\033ins" + "tance_group_manager_name\030\002 \001(\tB\003\340A\003\"L\n\021A" + "cceleratorConfig\022\034\n\024accelerator_type_uri" + "\030\001 \001(\t\022\031\n\021accelerator_count\030\002 \001(\005\"f\n\nDis" + "kConfig\022\033\n\016boot_disk_type\030\003 \001(\tB\003\340A\001\022\036\n\021" + "boot_disk_size_gb\030\001 \001(\005B\003\340A\001\022\033\n\016num_loca" + "l_ssds\030\002 \001(\005B\003\340A\001\"s\n\030NodeInitializationA" + "ction\022\034\n\017executable_file\030\001 \001(\tB\003\340A\002\0229\n\021e" + "xecution_timeout\030\002 \001(\0132\031.google.protobuf" + ".DurationB\003\340A\001\"\255\003\n\rClusterStatus\022A\n\005stat" + "e\030\001 \001(\0162-.google.cloud.dataproc.v1.Clust" + "erStatus.StateB\003\340A\003\022\026\n\006detail\030\002 \001(\tB\006\340A\003" + "\340A\001\0229\n\020state_start_time\030\003 \001(\0132\032.google.p" + "rotobuf.TimestampB\003\340A\003\022G\n\010substate\030\004 \001(\016" + "20.google.cloud.dataproc.v1.ClusterStatu" + "s.SubstateB\003\340A\003\"\177\n\005State\022\013\n\007UNKNOWN\020\000\022\014\n" + "\010CREATING\020\001\022\013\n\007RUNNING\020\002\022\t\n\005ERROR\020\003\022\014\n\010D" + "ELETING\020\004\022\014\n\010UPDATING\020\005\022\014\n\010STOPPING\020\006\022\013\n" + "\007STOPPED\020\007\022\014\n\010STARTING\020\010\"<\n\010Substate\022\017\n\013" + "UNSPECIFIED\020\000\022\r\n\tUNHEALTHY\020\001\022\020\n\014STALE_ST" + "ATUS\020\002\"\240\001\n\016SecurityConfig\022F\n\017kerberos_co" + "nfig\030\001 \001(\0132(.google.cloud.dataproc.v1.Ke" + "rberosConfigB\003\340A\001\022F\n\017identity_config\030\002 \001" + "(\0132(.google.cloud.dataproc.v1.IdentityCo" + "nfigB\003\340A\001\"\220\004\n\016KerberosConfig\022\034\n\017enable_k" + "erberos\030\001 \001(\010B\003\340A\001\022(\n\033root_principal_pas" + "sword_uri\030\002 \001(\tB\003\340A\001\022\030\n\013kms_key_uri\030\003 \001(" + "\tB\003\340A\001\022\031\n\014keystore_uri\030\004 \001(\tB\003\340A\001\022\033\n\016tru" + "ststore_uri\030\005 \001(\tB\003\340A\001\022\"\n\025keystore_passw" + "ord_uri\030\006 \001(\tB\003\340A\001\022\035\n\020key_password_uri\030\007" + " \001(\tB\003\340A\001\022$\n\027truststore_password_uri\030\010 \001" + "(\tB\003\340A\001\022$\n\027cross_realm_trust_realm\030\t \001(\t" + "B\003\340A\001\022\"\n\025cross_realm_trust_kdc\030\n \001(\tB\003\340A" + "\001\022+\n\036cross_realm_trust_admin_server\030\013 \001(" + "\tB\003\340A\001\0222\n%cross_realm_trust_shared_passw" + "ord_uri\030\014 \001(\tB\003\340A\001\022\033\n\016kdc_db_key_uri\030\r \001" + "(\tB\003\340A\001\022\037\n\022tgt_lifetime_hours\030\016 \001(\005B\003\340A\001" + "\022\022\n\005realm\030\017 \001(\tB\003\340A\001\"\306\001\n\016IdentityConfig\022" + "r\n\034user_service_account_mapping\030\001 \003(\0132G." + "google.cloud.dataproc.v1.IdentityConfig." + "UserServiceAccountMappingEntryB\003\340A\002\032@\n\036U" + "serServiceAccountMappingEntry\022\013\n\003key\030\001 \001" + "(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\371\001\n\016SoftwareConfig" + "\022\032\n\rimage_version\030\001 \001(\tB\003\340A\001\022Q\n\nproperti" + "es\030\002 \003(\01328.google.cloud.dataproc.v1.Soft" + "wareConfig.PropertiesEntryB\003\340A\001\022E\n\023optio" + "nal_components\030\003 \003(\0162#.google.cloud.data" + "proc.v1.ComponentB\003\340A\001\0321\n\017PropertiesEntr" + "y\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\203\002\n\017Li" + "fecycleConfig\0227\n\017idle_delete_ttl\030\001 \001(\0132\031" + ".google.protobuf.DurationB\003\340A\001\022;\n\020auto_d" + "elete_time\030\002 \001(\0132\032.google.protobuf.Times" + "tampB\003\340A\001H\000\0229\n\017auto_delete_ttl\030\003 \001(\0132\031.g" + "oogle.protobuf.DurationB\003\340A\001H\000\0228\n\017idle_s" + "tart_time\030\004 \001(\0132\032.google.protobuf.Timest" + "ampB\003\340A\003B\005\n\003ttl\"_\n\017MetastoreConfig\022L\n\032da" + "taproc_metastore_service\030\001 \001(\tB(\340A\002\372A\"\n " + "metastore.googleapis.com/Service\"\232\002\n\016Clu" + "sterMetrics\022O\n\014hdfs_metrics\030\001 \003(\01329.goog" + "le.cloud.dataproc.v1.ClusterMetrics.Hdfs" + "MetricsEntry\022O\n\014yarn_metrics\030\002 \003(\01329.goo" + "gle.cloud.dataproc.v1.ClusterMetrics.Yar" + "nMetricsEntry\0322\n\020HdfsMetricsEntry\022\013\n\003key" + "\030\001 \001(\t\022\r\n\005value\030\002 \001(\003:\0028\001\0322\n\020YarnMetrics" + "Entry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\003:\0028\001\"\226\001" + "\n\024CreateClusterRequest\022\027\n\nproject_id\030\001 \001" + "(\tB\003\340A\002\022\023\n\006region\030\003 \001(\tB\003\340A\002\0227\n\007cluster\030" + "\002 \001(\0132!.google.cloud.dataproc.v1.Cluster" + "B\003\340A\002\022\027\n\nrequest_id\030\004 \001(\tB\003\340A\001\"\256\002\n\024Updat" + "eClusterRequest\022\027\n\nproject_id\030\001 \001(\tB\003\340A\002" + "\022\023\n\006region\030\005 \001(\tB\003\340A\002\022\031\n\014cluster_name\030\002 " + "\001(\tB\003\340A\002\0227\n\007cluster\030\003 \001(\0132!.google.cloud" + ".dataproc.v1.ClusterB\003\340A\002\022E\n\035graceful_de" + "commission_timeout\030\006 \001(\0132\031.google.protob" + "uf.DurationB\003\340A\001\0224\n\013update_mask\030\004 \001(\0132\032." + "google.protobuf.FieldMaskB\003\340A\002\022\027\n\nreques" + "t_id\030\007 \001(\tB\003\340A\001\"\221\001\n\022StopClusterRequest\022\027" + "\n\nproject_id\030\001 \001(\tB\003\340A\002\022\023\n\006region\030\002 \001(\tB" + "\003\340A\002\022\031\n\014cluster_name\030\003 \001(\tB\003\340A\002\022\031\n\014clust" + "er_uuid\030\004 \001(\tB\003\340A\001\022\027\n\nrequest_id\030\005 \001(\tB\003" + "\340A\001\"\222\001\n\023StartClusterRequest\022\027\n\nproject_i" + "d\030\001 \001(\tB\003\340A\002\022\023\n\006region\030\002 \001(\tB\003\340A\002\022\031\n\014clu" + "ster_name\030\003 \001(\tB\003\340A\002\022\031\n\014cluster_uuid\030\004 \001" + "(\tB\003\340A\001\022\027\n\nrequest_id\030\005 \001(\tB\003\340A\001\"\223\001\n\024Del" + "eteClusterRequest\022\027\n\nproject_id\030\001 \001(\tB\003\340" + "A\002\022\023\n\006region\030\003 \001(\tB\003\340A\002\022\031\n\014cluster_name\030" + "\002 \001(\tB\003\340A\002\022\031\n\014cluster_uuid\030\004 \001(\tB\003\340A\001\022\027\n" + "\nrequest_id\030\005 \001(\tB\003\340A\001\"\\\n\021GetClusterRequ" + "est\022\027\n\nproject_id\030\001 \001(\tB\003\340A\002\022\023\n\006region\030\003" + " \001(\tB\003\340A\002\022\031\n\014cluster_name\030\002 \001(\tB\003\340A\002\"\211\001\n" + "\023ListClustersRequest\022\027\n\nproject_id\030\001 \001(\t" + "B\003\340A\002\022\023\n\006region\030\004 \001(\tB\003\340A\002\022\023\n\006filter\030\005 \001" + "(\tB\003\340A\001\022\026\n\tpage_size\030\002 \001(\005B\003\340A\001\022\027\n\npage_" + "token\030\003 \001(\tB\003\340A\001\"n\n\024ListClustersResponse" + "\0228\n\010clusters\030\001 \003(\0132!.google.cloud.datapr" + "oc.v1.ClusterB\003\340A\003\022\034\n\017next_page_token\030\002 " + "\001(\tB\003\340A\003\"a\n\026DiagnoseClusterRequest\022\027\n\npr" + "oject_id\030\001 \001(\tB\003\340A\002\022\023\n\006region\030\003 \001(\tB\003\340A\002" + "\022\031\n\014cluster_name\030\002 \001(\tB\003\340A\002\"1\n\026DiagnoseC" + "lusterResults\022\027\n\noutput_uri\030\001 \001(\tB\003\340A\003\"\370" + "\001\n\023ReservationAffinity\022Y\n\030consume_reserv" + "ation_type\030\001 \001(\01622.google.cloud.dataproc" + ".v1.ReservationAffinity.TypeB\003\340A\001\022\020\n\003key" + "\030\002 \001(\tB\003\340A\001\022\023\n\006values\030\003 \003(\tB\003\340A\001\"_\n\004Type" + "\022\024\n\020TYPE_UNSPECIFIED\020\000\022\022\n\016NO_RESERVATION" + "\020\001\022\023\n\017ANY_RESERVATION\020\002\022\030\n\024SPECIFIC_RESE" + "RVATION\020\0032\344\020\n\021ClusterController\022\200\002\n\rCrea" + "teCluster\022..google.cloud.dataproc.v1.Cre" + "ateClusterRequest\032\035.google.longrunning.O" + "peration\"\237\001\202\323\344\223\002>\"3/v1/projects/{project" + "_id}/regions/{region}/clusters:\007cluster\332" + "A\031project_id,region,cluster\312A<\n\007Cluster\022" + "1google.cloud.dataproc.v1.ClusterOperati" + "onMetadata\022\250\002\n\rUpdateCluster\022..google.cl" + "oud.dataproc.v1.UpdateClusterRequest\032\035.g" + "oogle.longrunning.Operation\"\307\001\202\323\344\223\002M2B/v" + "1/projects/{project_id}/regions/{region}" + "/clusters/{cluster_name}:\007cluster\332A2proj" + "ect_id,region,cluster_name,cluster,updat" + "e_mask\312A<\n\007Cluster\0221google.cloud.datapro" + "c.v1.ClusterOperationMetadata\022\356\001\n\013StopCl" + "uster\022,.google.cloud.dataproc.v1.StopClu" + "sterRequest\032\035.google.longrunning.Operati" + "on\"\221\001\202\323\344\223\002L\"G/v1/projects/{project_id}/r" + "egions/{region}/clusters/{cluster_name}:" + "stop:\001*\312A<\n\007Cluster\0221google.cloud.datapr" + "oc.v1.ClusterOperationMetadata\022\361\001\n\014Start" + "Cluster\022-.google.cloud.dataproc.v1.Start" + "ClusterRequest\032\035.google.longrunning.Oper" + "ation\"\222\001\202\323\344\223\002M\"H/v1/projects/{project_id" + "}/regions/{region}/clusters/{cluster_nam" + "e}:start:\001*\312A<\n\007Cluster\0221google.cloud.da" + "taproc.v1.ClusterOperationMetadata\022\231\002\n\rD" + "eleteCluster\022..google.cloud.dataproc.v1." + "DeleteClusterRequest\032\035.google.longrunnin" + "g.Operation\"\270\001\202\323\344\223\002D*B/v1/projects/{proj" + "ect_id}/regions/{region}/clusters/{clust" + "er_name}\332A\036project_id,region,cluster_nam" + "e\312AJ\n\025google.protobuf.Empty\0221google.clou" + "d.dataproc.v1.ClusterOperationMetadata\022\311" + "\001\n\nGetCluster\022+.google.cloud.dataproc.v1" + ".GetClusterRequest\032!.google.cloud.datapr" + "oc.v1.Cluster\"k\202\323\344\223\002D\022B/v1/projects/{pro" + "ject_id}/regions/{region}/clusters/{clus" + "ter_name}\332A\036project_id,region,cluster_na" + "me\022\331\001\n\014ListClusters\022-.google.cloud.datap" + "roc.v1.ListClustersRequest\032..google.clou" + "d.dataproc.v1.ListClustersResponse\"j\202\323\344\223" + "\0025\0223/v1/projects/{project_id}/regions/{r" + "egion}/clusters\332A\021project_id,region\332A\030pr" + "oject_id,region,filter\022\252\002\n\017DiagnoseClust" + "er\0220.google.cloud.dataproc.v1.DiagnoseCl" + "usterRequest\032\035.google.longrunning.Operat" + "ion\"\305\001\202\323\344\223\002P\"K/v1/projects/{project_id}/" + "regions/{region}/clusters/{cluster_name}" + ":diagnose:\001*\332A\036project_id,region,cluster" + "_name\312AK\n\026DiagnoseClusterResults\0221google" + ".cloud.dataproc.v1.ClusterOperationMetad" + "ata\032K\312A\027dataproc.googleapis.com\322A.https:" + "//www.googleapis.com/auth/cloud-platform" + "B\263\002\n\034com.google.cloud.dataproc.v1B\rClust" + "ersProtoP\001Z@google.golang.org/genproto/g" + "oogleapis/cloud/dataproc/v1;dataproc\352A^\n" + " container.googleapis.com/Cluster\022:proje" + "cts/{project}/locations/{location}/clust" + "ers/{cluster}\352A^\n metastore.googleapis.c" + "om/Service\022:projects/{project}/locations" + "/{location}/services/{service}b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { com.google.api.AnnotationsProto.getDescriptor(), com.google.api.ClientProto.getDescriptor(), com.google.api.FieldBehaviorProto.getDescriptor(), com.google.api.ResourceProto.getDescriptor(), com.google.cloud.dataproc.v1.SharedProto.getDescriptor(), com.google.longrunning.OperationsProto.getDescriptor(), com.google.protobuf.DurationProto.getDescriptor(), com.google.protobuf.FieldMaskProto.getDescriptor(), com.google.protobuf.TimestampProto.getDescriptor(), }); internal_static_google_cloud_dataproc_v1_Cluster_descriptor = getDescriptor().getMessageTypes().get(0); internal_static_google_cloud_dataproc_v1_Cluster_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dataproc_v1_Cluster_descriptor, new java.lang.String[] { "ProjectId", "ClusterName", "Config", "Labels", "Status", "StatusHistory", "ClusterUuid", "Metrics", }); internal_static_google_cloud_dataproc_v1_Cluster_LabelsEntry_descriptor = internal_static_google_cloud_dataproc_v1_Cluster_descriptor.getNestedTypes().get(0); internal_static_google_cloud_dataproc_v1_Cluster_LabelsEntry_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dataproc_v1_Cluster_LabelsEntry_descriptor, new java.lang.String[] { "Key", "Value", }); internal_static_google_cloud_dataproc_v1_ClusterConfig_descriptor = getDescriptor().getMessageTypes().get(1); internal_static_google_cloud_dataproc_v1_ClusterConfig_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dataproc_v1_ClusterConfig_descriptor, new java.lang.String[] { "ConfigBucket", "TempBucket", "GceClusterConfig", "MasterConfig", "WorkerConfig", "SecondaryWorkerConfig", "SoftwareConfig", "InitializationActions", "EncryptionConfig", "AutoscalingConfig", "SecurityConfig", "LifecycleConfig", "EndpointConfig", "MetastoreConfig", "GkeClusterConfig", }); internal_static_google_cloud_dataproc_v1_GkeClusterConfig_descriptor = getDescriptor().getMessageTypes().get(2); internal_static_google_cloud_dataproc_v1_GkeClusterConfig_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dataproc_v1_GkeClusterConfig_descriptor, new java.lang.String[] { "NamespacedGkeDeploymentTarget", }); internal_static_google_cloud_dataproc_v1_GkeClusterConfig_NamespacedGkeDeploymentTarget_descriptor = internal_static_google_cloud_dataproc_v1_GkeClusterConfig_descriptor.getNestedTypes().get(0); internal_static_google_cloud_dataproc_v1_GkeClusterConfig_NamespacedGkeDeploymentTarget_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dataproc_v1_GkeClusterConfig_NamespacedGkeDeploymentTarget_descriptor, new java.lang.String[] { "TargetGkeCluster", "ClusterNamespace", }); internal_static_google_cloud_dataproc_v1_EndpointConfig_descriptor = getDescriptor().getMessageTypes().get(3); internal_static_google_cloud_dataproc_v1_EndpointConfig_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dataproc_v1_EndpointConfig_descriptor, new java.lang.String[] { "HttpPorts", "EnableHttpPortAccess", }); internal_static_google_cloud_dataproc_v1_EndpointConfig_HttpPortsEntry_descriptor = internal_static_google_cloud_dataproc_v1_EndpointConfig_descriptor.getNestedTypes().get(0); internal_static_google_cloud_dataproc_v1_EndpointConfig_HttpPortsEntry_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dataproc_v1_EndpointConfig_HttpPortsEntry_descriptor, new java.lang.String[] { "Key", "Value", }); internal_static_google_cloud_dataproc_v1_AutoscalingConfig_descriptor = getDescriptor().getMessageTypes().get(4); internal_static_google_cloud_dataproc_v1_AutoscalingConfig_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dataproc_v1_AutoscalingConfig_descriptor, new java.lang.String[] { "PolicyUri", }); internal_static_google_cloud_dataproc_v1_EncryptionConfig_descriptor = getDescriptor().getMessageTypes().get(5); internal_static_google_cloud_dataproc_v1_EncryptionConfig_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dataproc_v1_EncryptionConfig_descriptor, new java.lang.String[] { "GcePdKmsKeyName", }); internal_static_google_cloud_dataproc_v1_GceClusterConfig_descriptor = getDescriptor().getMessageTypes().get(6); internal_static_google_cloud_dataproc_v1_GceClusterConfig_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dataproc_v1_GceClusterConfig_descriptor, new java.lang.String[] { "ZoneUri", "NetworkUri", "SubnetworkUri", "InternalIpOnly", "PrivateIpv6GoogleAccess", "ServiceAccount", "ServiceAccountScopes", "Tags", "Metadata", "ReservationAffinity", "NodeGroupAffinity", "ShieldedInstanceConfig", }); internal_static_google_cloud_dataproc_v1_GceClusterConfig_MetadataEntry_descriptor = internal_static_google_cloud_dataproc_v1_GceClusterConfig_descriptor.getNestedTypes().get(0); internal_static_google_cloud_dataproc_v1_GceClusterConfig_MetadataEntry_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dataproc_v1_GceClusterConfig_MetadataEntry_descriptor, new java.lang.String[] { "Key", "Value", }); internal_static_google_cloud_dataproc_v1_NodeGroupAffinity_descriptor = getDescriptor().getMessageTypes().get(7); internal_static_google_cloud_dataproc_v1_NodeGroupAffinity_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dataproc_v1_NodeGroupAffinity_descriptor, new java.lang.String[] { "NodeGroupUri", }); internal_static_google_cloud_dataproc_v1_ShieldedInstanceConfig_descriptor = getDescriptor().getMessageTypes().get(8); internal_static_google_cloud_dataproc_v1_ShieldedInstanceConfig_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dataproc_v1_ShieldedInstanceConfig_descriptor, new java.lang.String[] { "EnableSecureBoot", "EnableVtpm", "EnableIntegrityMonitoring", }); internal_static_google_cloud_dataproc_v1_InstanceGroupConfig_descriptor = getDescriptor().getMessageTypes().get(9); internal_static_google_cloud_dataproc_v1_InstanceGroupConfig_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dataproc_v1_InstanceGroupConfig_descriptor, new java.lang.String[] { "NumInstances", "InstanceNames", "ImageUri", "MachineTypeUri", "DiskConfig", "IsPreemptible", "Preemptibility", "ManagedGroupConfig", "Accelerators", "MinCpuPlatform", }); internal_static_google_cloud_dataproc_v1_ManagedGroupConfig_descriptor = getDescriptor().getMessageTypes().get(10); internal_static_google_cloud_dataproc_v1_ManagedGroupConfig_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dataproc_v1_ManagedGroupConfig_descriptor, new java.lang.String[] { "InstanceTemplateName", "InstanceGroupManagerName", }); internal_static_google_cloud_dataproc_v1_AcceleratorConfig_descriptor = getDescriptor().getMessageTypes().get(11); internal_static_google_cloud_dataproc_v1_AcceleratorConfig_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dataproc_v1_AcceleratorConfig_descriptor, new java.lang.String[] { "AcceleratorTypeUri", "AcceleratorCount", }); internal_static_google_cloud_dataproc_v1_DiskConfig_descriptor = getDescriptor().getMessageTypes().get(12); internal_static_google_cloud_dataproc_v1_DiskConfig_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dataproc_v1_DiskConfig_descriptor, new java.lang.String[] { "BootDiskType", "BootDiskSizeGb", "NumLocalSsds", }); internal_static_google_cloud_dataproc_v1_NodeInitializationAction_descriptor = getDescriptor().getMessageTypes().get(13); internal_static_google_cloud_dataproc_v1_NodeInitializationAction_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dataproc_v1_NodeInitializationAction_descriptor, new java.lang.String[] { "ExecutableFile", "ExecutionTimeout", }); internal_static_google_cloud_dataproc_v1_ClusterStatus_descriptor = getDescriptor().getMessageTypes().get(14); internal_static_google_cloud_dataproc_v1_ClusterStatus_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dataproc_v1_ClusterStatus_descriptor, new java.lang.String[] { "State", "Detail", "StateStartTime", "Substate", }); internal_static_google_cloud_dataproc_v1_SecurityConfig_descriptor = getDescriptor().getMessageTypes().get(15); internal_static_google_cloud_dataproc_v1_SecurityConfig_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dataproc_v1_SecurityConfig_descriptor, new java.lang.String[] { "KerberosConfig", "IdentityConfig", }); internal_static_google_cloud_dataproc_v1_KerberosConfig_descriptor = getDescriptor().getMessageTypes().get(16); internal_static_google_cloud_dataproc_v1_KerberosConfig_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dataproc_v1_KerberosConfig_descriptor, new java.lang.String[] { "EnableKerberos", "RootPrincipalPasswordUri", "KmsKeyUri", "KeystoreUri", "TruststoreUri", "KeystorePasswordUri", "KeyPasswordUri", "TruststorePasswordUri", "CrossRealmTrustRealm", "CrossRealmTrustKdc", "CrossRealmTrustAdminServer", "CrossRealmTrustSharedPasswordUri", "KdcDbKeyUri", "TgtLifetimeHours", "Realm", }); internal_static_google_cloud_dataproc_v1_IdentityConfig_descriptor = getDescriptor().getMessageTypes().get(17); internal_static_google_cloud_dataproc_v1_IdentityConfig_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dataproc_v1_IdentityConfig_descriptor, new java.lang.String[] { "UserServiceAccountMapping", }); internal_static_google_cloud_dataproc_v1_IdentityConfig_UserServiceAccountMappingEntry_descriptor = internal_static_google_cloud_dataproc_v1_IdentityConfig_descriptor.getNestedTypes().get(0); internal_static_google_cloud_dataproc_v1_IdentityConfig_UserServiceAccountMappingEntry_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dataproc_v1_IdentityConfig_UserServiceAccountMappingEntry_descriptor, new java.lang.String[] { "Key", "Value", }); internal_static_google_cloud_dataproc_v1_SoftwareConfig_descriptor = getDescriptor().getMessageTypes().get(18); internal_static_google_cloud_dataproc_v1_SoftwareConfig_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dataproc_v1_SoftwareConfig_descriptor, new java.lang.String[] { "ImageVersion", "Properties", "OptionalComponents", }); internal_static_google_cloud_dataproc_v1_SoftwareConfig_PropertiesEntry_descriptor = internal_static_google_cloud_dataproc_v1_SoftwareConfig_descriptor.getNestedTypes().get(0); internal_static_google_cloud_dataproc_v1_SoftwareConfig_PropertiesEntry_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dataproc_v1_SoftwareConfig_PropertiesEntry_descriptor, new java.lang.String[] { "Key", "Value", }); internal_static_google_cloud_dataproc_v1_LifecycleConfig_descriptor = getDescriptor().getMessageTypes().get(19); internal_static_google_cloud_dataproc_v1_LifecycleConfig_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dataproc_v1_LifecycleConfig_descriptor, new java.lang.String[] { "IdleDeleteTtl", "AutoDeleteTime", "AutoDeleteTtl", "IdleStartTime", "Ttl", }); internal_static_google_cloud_dataproc_v1_MetastoreConfig_descriptor = getDescriptor().getMessageTypes().get(20); internal_static_google_cloud_dataproc_v1_MetastoreConfig_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dataproc_v1_MetastoreConfig_descriptor, new java.lang.String[] { "DataprocMetastoreService", }); internal_static_google_cloud_dataproc_v1_ClusterMetrics_descriptor = getDescriptor().getMessageTypes().get(21); internal_static_google_cloud_dataproc_v1_ClusterMetrics_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dataproc_v1_ClusterMetrics_descriptor, new java.lang.String[] { "HdfsMetrics", "YarnMetrics", }); internal_static_google_cloud_dataproc_v1_ClusterMetrics_HdfsMetricsEntry_descriptor = internal_static_google_cloud_dataproc_v1_ClusterMetrics_descriptor.getNestedTypes().get(0); internal_static_google_cloud_dataproc_v1_ClusterMetrics_HdfsMetricsEntry_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dataproc_v1_ClusterMetrics_HdfsMetricsEntry_descriptor, new java.lang.String[] { "Key", "Value", }); internal_static_google_cloud_dataproc_v1_ClusterMetrics_YarnMetricsEntry_descriptor = internal_static_google_cloud_dataproc_v1_ClusterMetrics_descriptor.getNestedTypes().get(1); internal_static_google_cloud_dataproc_v1_ClusterMetrics_YarnMetricsEntry_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dataproc_v1_ClusterMetrics_YarnMetricsEntry_descriptor, new java.lang.String[] { "Key", "Value", }); internal_static_google_cloud_dataproc_v1_CreateClusterRequest_descriptor = getDescriptor().getMessageTypes().get(22); internal_static_google_cloud_dataproc_v1_CreateClusterRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dataproc_v1_CreateClusterRequest_descriptor, new java.lang.String[] { "ProjectId", "Region", "Cluster", "RequestId", }); internal_static_google_cloud_dataproc_v1_UpdateClusterRequest_descriptor = getDescriptor().getMessageTypes().get(23); internal_static_google_cloud_dataproc_v1_UpdateClusterRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dataproc_v1_UpdateClusterRequest_descriptor, new java.lang.String[] { "ProjectId", "Region", "ClusterName", "Cluster", "GracefulDecommissionTimeout", "UpdateMask", "RequestId", }); internal_static_google_cloud_dataproc_v1_StopClusterRequest_descriptor = getDescriptor().getMessageTypes().get(24); internal_static_google_cloud_dataproc_v1_StopClusterRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dataproc_v1_StopClusterRequest_descriptor, new java.lang.String[] { "ProjectId", "Region", "ClusterName", "ClusterUuid", "RequestId", }); internal_static_google_cloud_dataproc_v1_StartClusterRequest_descriptor = getDescriptor().getMessageTypes().get(25); internal_static_google_cloud_dataproc_v1_StartClusterRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dataproc_v1_StartClusterRequest_descriptor, new java.lang.String[] { "ProjectId", "Region", "ClusterName", "ClusterUuid", "RequestId", }); internal_static_google_cloud_dataproc_v1_DeleteClusterRequest_descriptor = getDescriptor().getMessageTypes().get(26); internal_static_google_cloud_dataproc_v1_DeleteClusterRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dataproc_v1_DeleteClusterRequest_descriptor, new java.lang.String[] { "ProjectId", "Region", "ClusterName", "ClusterUuid", "RequestId", }); internal_static_google_cloud_dataproc_v1_GetClusterRequest_descriptor = getDescriptor().getMessageTypes().get(27); internal_static_google_cloud_dataproc_v1_GetClusterRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dataproc_v1_GetClusterRequest_descriptor, new java.lang.String[] { "ProjectId", "Region", "ClusterName", }); internal_static_google_cloud_dataproc_v1_ListClustersRequest_descriptor = getDescriptor().getMessageTypes().get(28); internal_static_google_cloud_dataproc_v1_ListClustersRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dataproc_v1_ListClustersRequest_descriptor, new java.lang.String[] { "ProjectId", "Region", "Filter", "PageSize", "PageToken", }); internal_static_google_cloud_dataproc_v1_ListClustersResponse_descriptor = getDescriptor().getMessageTypes().get(29); internal_static_google_cloud_dataproc_v1_ListClustersResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dataproc_v1_ListClustersResponse_descriptor, new java.lang.String[] { "Clusters", "NextPageToken", }); internal_static_google_cloud_dataproc_v1_DiagnoseClusterRequest_descriptor = getDescriptor().getMessageTypes().get(30); internal_static_google_cloud_dataproc_v1_DiagnoseClusterRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dataproc_v1_DiagnoseClusterRequest_descriptor, new java.lang.String[] { "ProjectId", "Region", "ClusterName", }); internal_static_google_cloud_dataproc_v1_DiagnoseClusterResults_descriptor = getDescriptor().getMessageTypes().get(31); internal_static_google_cloud_dataproc_v1_DiagnoseClusterResults_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dataproc_v1_DiagnoseClusterResults_descriptor, new java.lang.String[] { "OutputUri", }); internal_static_google_cloud_dataproc_v1_ReservationAffinity_descriptor = getDescriptor().getMessageTypes().get(32); internal_static_google_cloud_dataproc_v1_ReservationAffinity_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dataproc_v1_ReservationAffinity_descriptor, new java.lang.String[] { "ConsumeReservationType", "Key", "Values", }); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); registry.add(com.google.api.ClientProto.defaultHost); registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); registry.add(com.google.api.AnnotationsProto.http); registry.add(com.google.api.ClientProto.methodSignature); registry.add(com.google.api.ClientProto.oauthScopes); registry.add(com.google.api.ResourceProto.resourceDefinition); registry.add(com.google.api.ResourceProto.resourceReference); registry.add(com.google.longrunning.OperationsProto.operationInfo); com.google.protobuf.Descriptors.FileDescriptor .internalUpdateFileDescriptor(descriptor, registry); com.google.api.AnnotationsProto.getDescriptor(); com.google.api.ClientProto.getDescriptor(); com.google.api.FieldBehaviorProto.getDescriptor(); com.google.api.ResourceProto.getDescriptor(); com.google.cloud.dataproc.v1.SharedProto.getDescriptor(); com.google.longrunning.OperationsProto.getDescriptor(); com.google.protobuf.DurationProto.getDescriptor(); com.google.protobuf.FieldMaskProto.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) }
[ "bazel-bot-development[bot]@users.noreply.github.com" ]
bazel-bot-development[bot]@users.noreply.github.com
6a1d23105efff37ce5cbd76d289425b323972061
17366750234b9a0189af23a1a5a4af795bbd7d7d
/dbus-commons/src/main/java/com/creditease/dbus/commons/ControlType.java
8f5c515ec58aa9dbbe2c67f35903c15ba69dc0cc
[ "Apache-2.0" ]
permissive
liulu081227/DBus
ce440bcf957da6ec9b0fad4ebea5f2c3c073032b
4f578939ed99db799b50407d022d3a379bde9387
refs/heads/master
2021-03-22T04:51:32.343081
2017-11-23T01:58:48
2017-11-23T01:58:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,811
java
/*- * << * DBus * == * Copyright (C) 2016 - 2017 Bridata * == * 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.creditease.dbus.commons; import java.util.HashMap; import java.util.Map; public enum ControlType { DISPATCHER_RELOAD_CONFIG, DISPATCHER_PAUSE_DATA, DISPATCHER_RESUME_DATA, DISPATCHER_START_DEBUG, DISPATCHER_STOP_DEBUG, FULL_DATA_PULL_REQ, APPENDER_TOPIC_RESUME, // appender 唤醒暂停的consumer APPENDER_RELOAD_CONFIG, // appender 重新加载配置 MONITOR_ALARM, // 监控报警, appender用来停止伪心跳 G_META_SYNC_WARNING, // meta变更警告事件,G开头代表global消息 COMMON_EMAIL_MESSAGE, // 通用email通知 UNKNOWN; private static Map<String, ControlType> commands = new HashMap<>(); static { for (ControlType cmd : ControlType.values()) { commands.put(cmd.name(), cmd); } } public static ControlType getCommand (String key) { if (key == null) { return UNKNOWN; } ControlType command = commands.get(key.toUpperCase()); if (command == null) { return UNKNOWN; } else { return command; } } }
[ "dongwang47@creditease.cn" ]
dongwang47@creditease.cn
b42adb5c47cc54c3b091809262ca7c1687040cd6
783b78c323f06bd9eaae1cd174fcd5c7ecfcd437
/JavaChapter6/src/main/java/Payroll_5/Payroll.java
b6a88a38e528da6ba6a531e7e1158f36c8725e7b
[]
no_license
DrewWhite51/Chapter6Java
d84f8e52d6ffa214b70fafec1ecf6ee33e8713fb
5e2f91d4f491722bce50473c70bd6b7a3214e4ac
refs/heads/master
2023-02-22T03:42:19.489475
2021-01-24T19:51:41
2021-01-24T19:51:41
322,395,041
0
0
null
null
null
null
UTF-8
Java
false
false
1,591
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 Payroll_5; /** * * @author Drew */ public class Payroll { private String firstName; private String lastName; private int ID; private double hourlyWage; private double hoursWorked; public Payroll(String firstName, String lastName, int ID, double hourlyWage, double hoursWorked) { this.firstName = firstName; this.lastName = lastName; this.ID = ID; this.hourlyWage = hourlyWage; this.hoursWorked = hoursWorked; } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public double getHourlyWage() { return hourlyWage; } public void setHourlyWage(double hourlyWage) { this.hourlyWage = hourlyWage; } public double getHoursWorked() { return hoursWorked; } public void setHoursWorked(double hoursWorked) { this.hoursWorked = hoursWorked; } public int getID() { return ID; } public void setID(int ID) { this.ID = ID; } public double getGrossPay(double hourlyWage, double hoursWorked){ return hourlyWage * hoursWorked; } }
[ "drew.m.white51@gmail.com" ]
drew.m.white51@gmail.com
998afd2c65fd7a4d961860d19f9231e763c9f44f
ae0272e12b60ed855ed3b649fc7e416a3a2675b3
/shop2/src/com/shop/dao/StoreDao.java
e87a552619811bca33eebf67821b5770631540d8
[]
no_license
GrantLiu1/SoftwareEngine-Desgin
ed1b4da08fd66f1ab6244b3d6f013c46e0876ba9
2408a1a56a39e667f14be1ce334c4eb27ffeca11
refs/heads/main
2023-01-07T10:11:05.631510
2020-11-08T09:33:44
2020-11-08T09:33:44
311,014,585
0
0
null
null
null
null
UTF-8
Java
false
false
1,128
java
package com.shop.dao; import java.sql.SQLException; import java.util.List; import com.shop.entity.Store; import com.shop.mapper.AddressMapper; import com.shop.mapper.StoreMapper; public class StoreDao { //添加收藏物品 public void addStore(Store store) { String sql ="insert into store (userId,gId) values(?,?)"; BaseDao.excuteUpdate(sql, store.getUserID(),store.getgID()); } //查询收藏物品 public Store findStoreByUserIdandGId(int userId, int gId) { String sql = "select * from store where userId = ? and gId = ?"; List<Store> list = BaseDao.excuteQuery(sql, new StoreMapper(), userId,gId); if (list.size() == 0) { return null; } return list.get(0); } //删除收藏物品 public void deleteStoreByUserIdAndGId(Store store) { String sql = "delete from store where userId = ? and gId = ?"; BaseDao.excuteUpdate(sql, store.getUserID(),store.getgID()); } //根据买家id查询收藏商品 public List selectStoreListByUserID(int userID){ String sql="select * from store where userId = ? "; List<Store> list=BaseDao.excuteQuery(sql,new StoreMapper(),userID); return list; } }
[ "964770081@qq.com" ]
964770081@qq.com
6eaca98d0b3fd953d9f0d7402612603e23ce03f6
cbb233fd3b6b0293700179a27e2493ec8754ad6d
/test-task/src/main/java/com/example/test/task/shared/DataObject.java
b46327c923898f56333bf62691df4b122d93af5c
[]
no_license
zaletniy/gwt-testtask
e932341e3b9c5f36214d7491ad04e8e55a869976
e7f9bc36f7521c306caf890843ed43f11e409ab4
refs/heads/master
2020-04-05T23:16:29.720426
2012-03-23T15:45:23
2012-03-23T15:45:23
3,011,322
1
1
null
null
null
null
UTF-8
Java
false
false
1,046
java
package com.example.test.task.shared; import java.io.Serializable; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Inheritance; import javax.persistence.InheritanceType; /** * The most general data object which just has id. * * @author Ilya Sviridov * */ @Entity @Inheritance (strategy=InheritanceType.TABLE_PER_CLASS) public abstract class DataObject implements Serializable { private static final long serialVersionUID = -658657438535744127L; /** * Id */ @Id @Column(name="id") @GeneratedValue(strategy=GenerationType.TABLE) int id; /** * id getter */ public int getId() { return id; } /** * id setter * * @param id */ public void setId(int id) { this.id = id; } /** * Constructor * * @param id */ public DataObject(int id) { super(); this.id = id; } /** * Default constructor */ public DataObject() { super(); } }
[ "sviridov.ilya@gmail.com" ]
sviridov.ilya@gmail.com
8cb3633d6819445bbac0d94d7d9e48007cd0a78b
64c99f0b8d6d5da9e82843dd65cbc1db43fd9026
/src/main/java/cn/jhs/activiti/platform/controller/DeploymentController.java
e5b1fc5f716b748047a80dd5a5b845c8254581d2
[]
no_license
itFreshMan/activiti-platform
ee31ecef136b46251d20f6361e6ac330c18ddbeb
033cd1c1d79aab8dfc09ebe4ff669631502ffa97
refs/heads/master
2020-03-12T05:01:01.706893
2018-04-21T08:45:08
2018-04-21T08:45:08
130,455,838
0
0
null
null
null
null
UTF-8
Java
false
false
2,456
java
package cn.jhs.activiti.platform.controller; import cn.jhs.activiti.platform.vo.DeploymentResponse; import cn.jhs.activiti.platform.constants.ResponseConstant; import org.activiti.engine.RepositoryService; import org.activiti.engine.repository.Deployment; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.ArrayList; import java.util.List; /** * Created by liuruijie on 2017/4/20. */ @RestController @RequestMapping("deployments") public class DeploymentController implements RestServiceController<Deployment, String>{ @Autowired RepositoryService repositoryService; @Override public Object getOne(@PathVariable("id") String id) { Deployment deployment = repositoryService.createDeploymentQuery().deploymentId(id).singleResult(); return ResponseConstant.buildResult().setObjData(new DeploymentResponse(deployment)); } @Override public Object getList(@RequestParam(value = "rowSize", defaultValue = "1000", required = false) Integer rowSize, @RequestParam(value = "page", defaultValue = "1", required = false) Integer page) { List<Deployment> deployments = repositoryService.createDeploymentQuery() .listPage(rowSize * (page - 1), rowSize); long count = repositoryService.createDeploymentQuery().count(); List<DeploymentResponse> list = new ArrayList<>(); for(Deployment deployment: deployments){ list.add(new DeploymentResponse(deployment)); } return ResponseConstant.buildResult().setRows( ResponseConstant.Rows.buildRows() .setRowSize(rowSize) .setTotalPages((int) (count/rowSize+1)) .setTotalRows(count) .setList(list) .setCurrent(page) ); } @Override public Object deleteOne(@PathVariable("id") String id) { repositoryService.deleteDeployment(id); return ResponseConstant.buildResult().refresh(); } @Override public Object postOne(@RequestBody Deployment entity) { return null; } @Override public Object putOne(@PathVariable("id") String s, @RequestBody Deployment entity) { return null; } @Override public Object patchOne(@PathVariable("id") String s, @RequestBody Deployment entity) { return null; } }
[ "jhuaishuang@126.com" ]
jhuaishuang@126.com
35988ffec4b0f2dd4da77e8b2e173f3c161c7404
3927258e502590626dd18034000e7cad5bb46af6
/aws-java-sdk-kinesis/src/main/java/com/amazonaws/services/kinesisfirehose/model/transform/ListDeliveryStreamsRequestMarshaller.java
f14b3cc723ef5513ef5a526aa315f362008a3b23
[ "JSON", "Apache-2.0" ]
permissive
gauravbrills/aws-sdk-java
332f9cf1e357c3d889f753b348eb8d774a30f07c
09d91b14bfd6fbc81a04763d679e0f94377e9007
refs/heads/master
2021-01-21T18:15:06.060014
2016-06-11T18:12:40
2016-06-11T18:12:40
58,072,311
0
0
null
2016-05-04T17:52:28
2016-05-04T17:52:28
null
UTF-8
Java
false
false
3,481
java
/* * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights * Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ package com.amazonaws.services.kinesisfirehose.model.transform; import java.io.ByteArrayInputStream; import java.util.Collections; import java.util.Map; import java.util.List; import java.util.regex.Pattern; import com.amazonaws.AmazonClientException; import com.amazonaws.Request; import com.amazonaws.DefaultRequest; import com.amazonaws.http.HttpMethodName; import com.amazonaws.services.kinesisfirehose.model.*; import com.amazonaws.transform.Marshaller; import com.amazonaws.util.BinaryUtils; import com.amazonaws.util.StringUtils; import com.amazonaws.util.IdempotentUtils; import com.amazonaws.util.StringInputStream; import com.amazonaws.util.json.*; /** * ListDeliveryStreamsRequest Marshaller */ public class ListDeliveryStreamsRequestMarshaller implements Marshaller<Request<ListDeliveryStreamsRequest>, ListDeliveryStreamsRequest> { public Request<ListDeliveryStreamsRequest> marshall( ListDeliveryStreamsRequest listDeliveryStreamsRequest) { if (listDeliveryStreamsRequest == null) { throw new AmazonClientException( "Invalid argument passed to marshall(...)"); } Request<ListDeliveryStreamsRequest> request = new DefaultRequest<ListDeliveryStreamsRequest>( listDeliveryStreamsRequest, "AmazonKinesisFirehose"); request.addHeader("X-Amz-Target", "Firehose_20150804.ListDeliveryStreams"); request.setHttpMethod(HttpMethodName.POST); request.setResourcePath(""); try { final StructuredJsonGenerator jsonGenerator = SdkJsonProtocolFactory .createWriter(false, "1.1"); jsonGenerator.writeStartObject(); if (listDeliveryStreamsRequest.getLimit() != null) { jsonGenerator.writeFieldName("Limit").writeValue( listDeliveryStreamsRequest.getLimit()); } if (listDeliveryStreamsRequest .getExclusiveStartDeliveryStreamName() != null) { jsonGenerator .writeFieldName("ExclusiveStartDeliveryStreamName") .writeValue( listDeliveryStreamsRequest .getExclusiveStartDeliveryStreamName()); } jsonGenerator.writeEndObject(); byte[] content = jsonGenerator.getBytes(); request.setContent(new ByteArrayInputStream(content)); request.addHeader("Content-Length", Integer.toString(content.length)); request.addHeader("Content-Type", jsonGenerator.getContentType()); } catch (Throwable t) { throw new AmazonClientException( "Unable to marshall request to JSON: " + t.getMessage(), t); } return request; } }
[ "aws@amazon.com" ]
aws@amazon.com
8554ce1bf14ebb9fcd48264a48dbffd46c7bae8f
eb4c51c3fbf41c57b389352d3918f9dab76b2fa7
/app/src/main/java/nibbles/analytica/HomeScreen.java
1522de94cbb032c01fef269350d2f25f5b9068f6
[]
no_license
Nabilliban14/Analytica
8e98b8db808ae96d0517e8642ce4f5afe6b234a6
ee3e704b5d6b6196d4d56703db7d1e72885fce56
refs/heads/master
2020-04-17T05:32:42.069923
2019-01-17T19:32:04
2019-01-17T19:32:04
148,110,076
0
0
null
null
null
null
UTF-8
Java
false
false
2,834
java
package nibbles.analytica; import android.app.ActionBar; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.EditText; import android.widget.Toast; import com.google.gson.Gson; import java.io.IOException; import nibbles.analytica.json.BankInfo; import okhttp3.ResponseBody; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; public class HomeScreen extends AppCompatActivity { public static final String EXTRA_USERNAME = "com.nibbles.analytica.USERNAME"; public static final String EXTRA_PASSWORD = "com.nibbles.analytica.PASSWORD"; public static final String EXTRA_CATEGORY1 = "com.nibbles.analytica.CATEGORY1"; public static final String EXTRA_CATEGORY2 = "com.nibbles.analytica.CATEGORY2"; public static final String EXTRA_CATEGORY3 = "com.nibbles.analytica.CATEGORY3"; public static final String EXTRA_CATEGORY4 = "com.nibbles.analytica.CATEGORY4"; public static final String EXTRA_CATEGORY5 = "com.nibbles.analytica.CATEGORY5"; private String username; private String password; private BankInfo bankInfo; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_home_screen); Bundle bundle = getIntent().getExtras(); username = bundle.getString(EXTRA_USERNAME); password = bundle.getString(EXTRA_PASSWORD); } public void graph(View view) { Intent intent = new Intent(this, Results.class); Bundle extras = new Bundle(); EditText category1EditText = (EditText) findViewById(R.id.category1); String category1 = category1EditText.getText().toString(); EditText category2EditText = (EditText) findViewById(R.id.category2); String category2 = category2EditText.getText().toString(); EditText category3EditText = (EditText) findViewById(R.id.category3); String category3 = category3EditText.getText().toString(); EditText category4EditText = (EditText) findViewById(R.id.category4); String category4 = category4EditText.getText().toString(); EditText category5EditText = (EditText) findViewById(R.id.category5); String category5 = category5EditText.getText().toString(); extras.putString(EXTRA_USERNAME, username); extras.putString(EXTRA_PASSWORD, password); extras.putString(EXTRA_CATEGORY1, category1); extras.putString(EXTRA_CATEGORY2, category2); extras.putString(EXTRA_CATEGORY3, category3); extras.putString(EXTRA_CATEGORY4, category4); extras.putString(EXTRA_CATEGORY5, category5); intent.putExtras(extras); startActivity(intent); } }
[ "Nabilliban14@gmail.com" ]
Nabilliban14@gmail.com
15136e93c2ec3eaf1a7f889449ae6b59fec720be
5d852c65c60f2e42bcf1954864d8bb3a2a5285e5
/src/main/java/com/srm/rta/entity/UserDelegationDetailsEntity.java
71bb2ac2f5a60497b5007a0a26c96d4aad5f6d1f
[]
no_license
subramaniansrm/rta
2fe299bf7478dbb050d6c4ff7ffd8e749b0dad8b
061d6d6b08ea4d7ff4fd7c2746bb5627b2f79ec6
refs/heads/master
2023-01-04T12:54:05.088724
2020-10-24T16:15:05
2020-10-24T16:15:05
305,968,363
0
0
null
null
null
null
UTF-8
Java
false
false
1,803
java
package com.srm.rta.entity; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; import lombok.Data; import lombok.EqualsAndHashCode; @Entity @Table(name = "rin_ma_user_delegation_details", schema = "rta_2_local") @Data @EqualsAndHashCode(callSuper=false) public class UserDelegationDetailsEntity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "idrin_ma_user_delegation_detail_id") private Integer delegationDetailId;//delegationId @Column(name = "idrin_ma_user_delegation_id") private Integer delegationId;//Delegated User Id @Column(name = "idrin_ma_delegated_user_id") private Integer delegatedUserId;//Delegated User Id @Column(name = "idrin_ma_user_delegation_active") private boolean delegatedUserActive;//Delegated User Id @Column(name = "idrin_ma_user_type") private Integer userType;//Delegated User Id @Column(name = "idrin_ma_user_active_from") private Date userActiveFrom;//Delegated User Id @Column(name = "idrin_ma_user_active_to") private Date userActiveTo; @Column(name = "create_by") private Integer createBy; @Column(name = "create_date") @Temporal(TemporalType.TIMESTAMP) private Date createDate; @Column(name = "update_by") private Integer updateBy; @Column(name = "update_date") @Temporal(TemporalType.TIMESTAMP) private Date updateDate; @Column(name = "delete_flag") private Character deleteFlag; @Column(name = "rin_ma_entity_id") private Integer entityLicenseId; @Column(name = "delegation_remarks") private String delegationRemarks; }
[ "shunmugakumars@srmtech.com" ]
shunmugakumars@srmtech.com
8086cb7b25fa7121a8c1d931b9fd74006404ef06
7764794fcdf3312d7c46b51c66706bca5cb341ae
/src/main/java/com/cscecee/basesite/core/udp/common/Charsets.java
0bb19d1d13e15a364e9c11f4daecd9918c21f329
[]
no_license
dlzdy/netty_udp
cdc80a4461f1ebe5924fbcc81d31116f07f76060
9ac680f4e774c4110e0e9c24dabfac9abec68832
refs/heads/master
2020-04-14T01:59:03.488884
2019-01-09T16:17:54
2019-01-09T16:17:54
163,574,326
0
0
null
null
null
null
UTF-8
Java
false
false
165
java
package com.cscecee.basesite.core.udp.common; import java.nio.charset.Charset; public class Charsets { public static Charset UTF8 = Charset.forName("utf8"); }
[ "dlzdy@163.com" ]
dlzdy@163.com
84ead82db96594844438a45cf642c5bf8a7b289e
a45d12386afe4b729e6b7b667fe5a547ba94ac36
/test/com/capgemini/chess/BlackPawnTest.java
b8fb0052f8226e25b71b54bfa7ff253d38783f19
[]
no_license
Eilenn/Chess
833bff7ae1a9fd22a52c00cbd11a76aea4d00d52
7ce6a6ccf4ef88108196c640098dc30c2828ca95
refs/heads/master
2021-01-19T11:52:28.580168
2017-02-22T12:08:30
2017-02-22T12:08:30
82,268,377
0
0
null
null
null
null
UTF-8
Java
false
false
7,468
java
package com.capgemini.chess; import static org.junit.Assert.*; import org.junit.Before; import org.junit.Test; public class BlackPawnTest { private Board board; private Pawn pawn; private ColorChess white = ColorChess.WHITE; private ColorChess black = ColorChess.BLACK; private Coordinate from, to; private Square[][] chessboard; @Before public void init() { board = new Board(); board.initializeBoard(); chessboard = board.getChessboard(); pawn = new Pawn(black); from = new Coordinate(7, 3); } @Test public void shouldReturnTrueSecondMove1Forward() { pawn.setFirstMove(false); to = new Coordinate(from.getRow() - 1, from.getColumn()); // when boolean isAllowed = pawn.canMoveBeMade(from, to, chessboard); // then assertTrue(isAllowed); } @Test public void shouldReturnFalseSecondMove1Backwards() { // given pawn.setFirstMove(false); to = new Coordinate(from.getRow() + 1, from.getColumn()); // when boolean isAllowed = pawn.canMoveBeMade(from, to, chessboard); // then assertFalse(isAllowed); } @Test public void shouldReturnTrueFirstMove2Forward() { // given pawn.setFirstMove(true); to = new Coordinate(from.getRow() - 2, from.getColumn()); // when boolean isAllowed = pawn.canMoveBeMade(from, to, chessboard); // then assertTrue(isAllowed); } @Test public void shouldReturnTrueFirstMove1Forward() { // given pawn.setFirstMove(true); to = new Coordinate(from.getRow() - 1, from.getColumn()); // when boolean isAllowed = pawn.canMoveBeMade(from, to, chessboard); // then assertTrue(isAllowed); } @Test public void shouldReturnFalseFirstMove1Backwards() { // given pawn.setFirstMove(true); to = new Coordinate(from.getRow() + 1, from.getColumn()); // when boolean isAllowed = pawn.canMoveBeMade(from, to, chessboard); // then assertFalse(isAllowed); } @Test public void shouldReturnFalseForAttemptToCaptureBlack() { // given to = new Coordinate(from.getRow() - 1, from.getColumn() + 1); chessboard[to.getRow()][to.getColumn()].setPiece(new Pawn(black)); // when boolean isCapture = pawn.canMoveBeMade(from, to, chessboard); // then assertFalse(isCapture); } @Test public void shouldReturnTrueForAttemptToCaptureWhite() { // given to = new Coordinate(from.getRow() - 1, from.getColumn() + 1); chessboard[to.getRow()][to.getColumn()].setPiece(new Pawn(white)); // when boolean isCapture = pawn.canMoveBeMade(from, to, chessboard); // then assertTrue(isCapture); } @Test public void shouldReturnFalseForAttemptToCaptureBlackOnUnallowedField() { // given to = new Coordinate(from.getRow() - 2, from.getColumn() + 2); chessboard[to.getRow()][to.getColumn()].setPiece(new Pawn(black)); // when boolean isCapture = pawn.canMoveBeMade(from, to, chessboard); // then assertFalse(isCapture); } @Test public void shouldReturnTrueFor1DiagonalForwardLeftSecondMoveNonEmptyWhite() { // given pawn.setFirstMove(false); to = new Coordinate(from.getRow() - 1, from.getColumn() - 1); chessboard[to.getRow()][to.getColumn()].setPiece(new Pawn(white)); // when boolean isAllowed = pawn.canMoveBeMade(from, to, chessboard); // then assertTrue(isAllowed); } @Test public void shouldReturnFalseFor1DiagonalForwardLeftSecondMoveNonEmptyBlack() { // given pawn.setFirstMove(false); to = new Coordinate(from.getRow() - 1, from.getColumn() - 1); chessboard[to.getRow()][to.getColumn()].setPiece(new Pawn(black)); // when boolean isAllowed = pawn.canMoveBeMade(from, to, chessboard); // then assertFalse(isAllowed); } @Test public void shouldReturnFalseFor2DiagonalForwardLeftSecondMove() { // given pawn.setFirstMove(false); to = new Coordinate(from.getRow() - 2, from.getColumn() - 2); // when boolean isAllowed = pawn.canMoveBeMade(from, to, chessboard); // then assertFalse(isAllowed); } @Test public void shouldReturnTrueFor1DiagonalForwardRightSecondMoveNonEmptyWhite() { // given pawn.setFirstMove(false); to = new Coordinate(from.getRow() - 1, from.getColumn() + 1); chessboard[to.getRow()][to.getColumn()].setPiece(new Pawn(white)); // when boolean isAllowed = pawn.canMoveBeMade(from, to, chessboard); // then assertTrue(isAllowed); } @Test public void shouldReturnFalseFor1DiagonalForwardRightSecondMoveNonEmptyBlack() { // given pawn.setFirstMove(false); to = new Coordinate(from.getRow() - 1, from.getColumn() + 1); chessboard[to.getRow()][to.getColumn()].setPiece(new Pawn(black)); // when boolean isAllowed = pawn.canMoveBeMade(from, to, chessboard); // then assertFalse(isAllowed); } @Test public void shouldReturnFalseFor1DiagonalForwardRightSecondMoveEmpty() { // given pawn.setFirstMove(false); to = new Coordinate(from.getRow() - 1, from.getColumn() + 1); // when boolean isAllowed = pawn.canMoveBeMade(from, to, chessboard); // then assertFalse(isAllowed); } @Test public void shouldReturnTrueFor1DiagonalForwardLeftFirstMoveNonEmptyWhite() { // given pawn.setFirstMove(true); to = new Coordinate(from.getRow() - 1, from.getColumn() - 1); chessboard[to.getRow()][to.getColumn()].setPiece(new Pawn(white)); // when boolean isAllowed = pawn.canMoveBeMade(from, to, chessboard); // then assertTrue(isAllowed); } @Test public void shouldReturnFalseFor1DiagonalForwardLeftFirstMoveNonEmptyBlack() { // given pawn.setFirstMove(true); to = new Coordinate(from.getRow() - 1, from.getColumn() - 1); chessboard[to.getRow()][to.getColumn()].setPiece(new Pawn(black)); // when boolean isAllowed = pawn.canMoveBeMade(from, to, chessboard); // then assertFalse(isAllowed); } @Test public void shouldReturnFalseFor1DiagonalForwardLeftFirstMoveEmpty() { // given pawn.setFirstMove(true); to = new Coordinate(from.getRow() - 1, from.getColumn() - 1); // when boolean isAllowed = pawn.canMoveBeMade(from, to, chessboard); // then assertFalse(isAllowed); } @Test public void shouldReturnTrueFor1DiagonalForwardRightFirstMoveNonEmptyWhite() { // given pawn.setFirstMove(true); to = new Coordinate(from.getRow() - 1, from.getColumn() + 1); chessboard[to.getRow()][to.getColumn()].setPiece(new Pawn(white)); // when boolean isAllowed = pawn.canMoveBeMade(from, to, chessboard); // then assertTrue(isAllowed); } @Test public void shouldReturnFalseFor1DiagonalForwardRightFirstMoveNonEmptyBlack() { // given pawn.setFirstMove(true); to = new Coordinate(from.getRow() - 1, from.getColumn() + 1); chessboard[to.getRow()][to.getColumn()].setPiece(new Pawn(black)); // when boolean isAllowed = pawn.canMoveBeMade(from, to, chessboard); // then assertFalse(isAllowed); } @Test public void shouldReturnFalseFor1DiagonalForwardRightFirstMoveEmpty() { // given pawn.setFirstMove(true); to = new Coordinate(from.getRow() - 1, from.getColumn() + 1); // when boolean isAllowed = pawn.canMoveBeMade(from, to, chessboard); // then assertFalse(isAllowed); } @Test public void shouldReturnTrueForFirstMove() { // given to = new Coordinate(from.getRow() - 1, from.getColumn()); // when boolean isFirst = pawn.isFirstMove(); // then assertTrue(isFirst); } @Test public void shouldReturnFalseForSecondMove() { // given to = new Coordinate(from.getRow() - 1, from.getColumn()); // when pawn.setFirstMove(false); boolean isFirst = pawn.isFirstMove(); // then assertFalse(isFirst); } }
[ "bogna.wrobel@capgemini.com" ]
bogna.wrobel@capgemini.com
760de0e444af5941de146d2c3a14ff89e4a90fea
e6ed9f43788db54b298a733e55756dc92071ac96
/src/main/java/com/java/day06/ArrayAndObject/Array2/Array2Demo1.java
cdd4d60cfd0aa475e98f6b9143d8505c0a40a200
[]
no_license
wangxj0605/JavaBaseInfo
712d02e71fdf24e0f3baddd48e865d919f0fa354
b7cdf0686bfcb76faee4232bfceda4dd79474f43
refs/heads/master
2020-03-18T17:57:00.401851
2018-06-08T09:45:19
2018-06-08T09:45:19
135,062,147
0
0
null
null
null
null
UTF-8
Java
false
false
981
java
package com.java.day06.ArrayAndObject.Array2; /* 格式2: 数据类型[][] 数组名 = new 数据类型[m][]; m:表示这个二维数组有多少个一维数组。 列数没有给出,可以动态的给。这一次是一个变化的列数。 */ public class Array2Demo1 { public static void main(String[] args) { // 定义数组 int[][] arr = new int[3][]; System.out.println(arr); // [[I@175078b System.out.println(arr[0]); // null System.out.println(arr[1]); // null System.out.println(arr[2]); // null // 动态的为每一个一维数组分配空间 arr[0] = new int[2]; arr[1] = new int[3]; arr[2] = new int[1]; System.out.println(arr[0]); // [I@42552c System.out.println(arr[1]); // [I@e5bbd6 System.out.println(arr[2]); // [I@8ee016 System.out.println(arr[0][0]); // 0 System.out.println(arr[0][1]); // 0 // ArrayIndexOutOfBoundsException // System.out.println(arr[0][2]); //错误 arr[1][0] = 100; arr[1][2] = 200; } }
[ "[wangxj0605@126.com]" ]
[wangxj0605@126.com]
338ff4a365b8c1b1f4e2efb8a8283d4013ddcea9
87c3c335023681d1c906892f96f3a868b3a6ee8e
/HTML5/dev/simplivity-citrixplugin-service/src/main/java/com/vmware/vim25/VmReloadFromPathFailedEvent.java
876f5dbdb62735ec525082ecc527d88d3f8daab2
[ "Apache-2.0" ]
permissive
HewlettPackard/SimpliVity-Citrix-VCenter-Plugin
19d2b7655b570d9515bf7e7ca0cf1c823cbf5c61
504cbeec6fce27a4b6b23887b28d6a4e85393f4b
refs/heads/master
2023-08-09T08:37:27.937439
2020-04-30T06:15:26
2020-04-30T06:15:26
144,329,090
0
1
Apache-2.0
2020-04-07T07:27:53
2018-08-10T20:24:34
Java
UTF-8
Java
false
false
695
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.6 // 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.06.12 at 09:16:35 AM EDT // package com.vmware.vim25; /** * */ @SuppressWarnings("all") public class VmReloadFromPathFailedEvent extends VmEvent { public String configPath; public String getConfigPath() { return configPath; } public void setConfigPath(String configPath) { this.configPath = configPath; } }
[ "anuanusha471@gmail.com" ]
anuanusha471@gmail.com
8d0e1bb151dfc33262c3ecae7deaf3f6c4b9500a
254bc58d275a5b8a24c6009b59857401d8279c59
/src/main/java/jptracer/tracelib/bsdf/Mirror.java
7880a428d263be34568e3b795acef737b7316291
[]
no_license
l-donovan/jptracer
68b44b1c60a92e149bae74332cdd82a415dfbcad
bcb63f1bd10509bfd94dd948abcabb572b449daa
refs/heads/master
2020-06-28T02:59:15.683271
2019-08-14T21:13:58
2019-08-14T21:13:58
200,126,767
0
0
null
null
null
null
UTF-8
Java
false
false
818
java
package jptracer.tracelib.bsdf; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import jptracer.tracelib.basetypes.BSDF; import jptracer.tracelib.helper.Vec3; import static jptracer.tracelib.common.Core.reflect; public class Mirror extends BSDF { private Vec3 specularColor; @JsonCreator public Mirror(@JsonProperty("specularColor") Vec3 specularColor) { this.specularColor = specularColor; } @Override public Vec3 resultantRay(Vec3 direction, Vec3 normal) { return reflect(direction, normal); } @Override public Vec3 resultantColor(Vec3 direction, Vec3 normal) { return this.specularColor; } @Override public double pdf(Vec3 direction, Vec3 normal) { return 1.0; } }
[ "ladbuilder1@gmail.com" ]
ladbuilder1@gmail.com
1c575ae1ed14f1ffb85de86a1200bcdd720ca4ba
f7ce8ff2c954f44f211f5518ec118222b30db5b0
/eva-server/src/main/java/com/eva/service/system/SystemLocationService.java
adcb48770a44a7fd03f327984ce3462c4de9426f
[]
no_license
liggege/eva
479fc4badb08598e876595bd1b9eab7348dab192
cfbb73dbb8131b95bed06795b32ed91fe2ea46cd
refs/heads/master
2023-06-09T06:31:21.439455
2021-07-01T17:34:10
2021-07-01T17:34:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,864
java
package com.eva.service.system; import com.eva.core.model.PageData; import com.eva.core.model.PageWrap; import com.eva.dao.system.model.SystemLocation; import java.util.List; /** * 地区表Service定义 * @author Eva.Caesar Liu * @date 2021/06/10 17:09 */ public interface SystemLocationService { /** * 创建 * * @param location 实体对象 * @return Integer */ Integer create(SystemLocation location); /** * 主键删除 * * @param id 主键 */ void deleteById(Integer id); /** * 删除 * * @param location 实体对象 */ void delete(SystemLocation location); /** * 批量主键删除 * * @param ids 主键集 */ void deleteByIdInBatch(List<Integer> ids); /** * 主键更新 * * @param location 实体对象 */ void updateById(SystemLocation location); /** * 批量主键更新 * * @param locations 实体集 */ void updateByIdInBatch(List<SystemLocation> locations); /** * 主键查询 * * @param id 主键 * @return Location */ SystemLocation findById(Integer id); /** * 条件查询单条记录 * * @param location 实体对象 * @return Location */ SystemLocation findOne(SystemLocation location); /** * 条件查询 * * @param location 实体对象 * @return List<Location> */ List<SystemLocation> findList(SystemLocation location); /** * 分页查询 * * @param pageWrap 分页对象 * @return PageData<Location> */ PageData<SystemLocation> findPage(PageWrap<SystemLocation> pageWrap); /** * 条件统计 * * @param location 实体对象 * @return long */ long count(SystemLocation location); }
[ "ck9300001@qq.com" ]
ck9300001@qq.com
e373aa66888bb227f5fdecee2a827335612b615c
8d4426ec26882ce66b471ab01123a22a5fbe2baf
/bioinfo-m2/src/service/impl/HttpServiceImpl.java
da410aee93b6d9fcc144ea770c5b81092bc2fed0
[]
no_license
goldaj/BioInformatique
487fe263c9b08b097f024f7fe01de9489f13c3d9
328c28539f5d7d92fa6abf3aa31d6bda263e0b1a
refs/heads/master
2021-09-06T21:01:20.733143
2017-12-19T08:55:16
2017-12-19T08:55:16
114,226,225
0
0
null
null
null
null
UTF-8
Java
false
false
3,732
java
package service.impl; import com.google.api.client.http.*; import com.google.common.util.concurrent.*; import com.google.inject.Inject; import com.google.inject.name.Named; import service.interfaces.ApiStatus; import service.interfaces.IHttpService; import service.interfaces.IProgramStatsService; import service.interfaces.IProgressService; import java.io.*; public class HttpServiceImpl implements IHttpService { private final HttpRequestFactory requestFactory; private final RateLimiter rateLimiter; private final ListeningExecutorService executorService; private final IProgramStatsService programStatsService; private final IProgressService progressService; private boolean apiTrouble = false; @Inject public HttpServiceImpl(HttpTransport transport, RateLimiter rateLimiter, @Named("HttpExecutor") ListeningExecutorService listeningExecutorService, IProgramStatsService programStatsService, IProgressService progressService) { this.requestFactory = transport.createRequestFactory(new HttpRequestInitializer()); this.rateLimiter = rateLimiter; this.executorService = listeningExecutorService; this.programStatsService = programStatsService; this.progressService = progressService; } public ListenableFuture<HttpResponse> get(final String url) { return get(url, null); } public ListenableFuture<HttpResponse> get(final String url, final String geneId) { ListenableFuture<HttpResponse> responseFuture = executorService.submit(() -> { rateLimiter.acquire(); //System.out.println("Request : " + "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=nuccore&id="+ geneId +"&rettype=fasta_cds_na&retmode=text"); if (geneId != null) { progressService.getCurrentDownloadProgress().setDownloading(geneId); progressService.invalidateDownloadProgress(); } GenericUrl genericUrl = new GenericUrl(url); HttpRequest request = requestFactory.buildGetRequest(genericUrl); return request.execute(); }); ListenableFuture<HttpResponse> failureCatchingFuture = Futures.catchingAsync(responseFuture, Throwable.class, exception -> { if (exception != null) { progressService.getCurrentApiStatus().setMessage(" "); apiTrouble = true; progressService.getCurrentApiStatus().setColor(ApiStatus.OFFLINE_COLOR); progressService.invalidateApiStatus(); exception.printStackTrace(); } //return get(url, geneId); return null; }, executorService); return Futures.transformAsync(failureCatchingFuture, httpResponse -> { if(!apiTrouble) { progressService.getCurrentApiStatus().setMessage("API Online"); progressService.getCurrentApiStatus().setColor(ApiStatus.ONLINE_COLOR); } else { progressService.getCurrentApiStatus().setMessage("API Online - Could not get all data (server issues)"); progressService.getCurrentApiStatus().setColor(ApiStatus.TROUBLE_COLOR); } progressService.invalidateApiStatus(); if (httpResponse == null) { return get(url); } BufferedReader br = new BufferedReader(new InputStreamReader(httpResponse.getContent())); br.mark(1); int firstByte = br.read(); if (firstByte == -1) { return get(url); } br.reset(); return Futures.immediateFuture(httpResponse); }, executorService); } }
[ "goldajj@gmail.com" ]
goldajj@gmail.com
a4b9a96608ba8ca59bbff01501efec344e7ecaaf
17be75f224b0e52c414ddcdcf2c5912b6865afa0
/app/src/main/java/com/example/administrator/myapplication/adapter/BaseGridAdapter.java
713cfcac199c7ec860c5f8522c81e5f5eb83610e
[]
no_license
g1258624735/MyApplication2
fd3c82b04e18666eb47232b0d57d3c2bc81a4dec
af3bd565f6e574336c9524575c8f71149816407b
refs/heads/master
2021-01-17T12:36:28.218477
2016-07-20T02:34:38
2016-07-20T02:34:38
58,987,769
0
1
null
null
null
null
UTF-8
Java
false
false
3,728
java
package com.example.administrator.myapplication.adapter; import android.content.Context; import android.support.v7.widget.RecyclerView.ViewHolder; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.LinearLayout; import android.widget.LinearLayout.LayoutParams; import com.example.administrator.myapplication.R; import com.example.administrator.myapplication.tools.DensityUtils; /** * 多列adapter * @version v1.2 * @author shijian * @param <T> 存储的实体类型 */ public abstract class BaseGridAdapter<T> extends BaseAdapter<T, BaseGridViewHolder>{ private int column = 2; private int divingColorRes; private int divingWidth; private int itemViewWidth; public BaseGridAdapter(Context mContext,int column){ super(mContext); this.column = column; //默认是用2dp宽度,透明色分隔线 setDivingStyle(DensityUtils.dip2px(mContext, 2),android.R.color.transparent); //默认使用屏幕宽度计算 int screenWidth = DensityUtils.getDisplayWidth(mContext); calculateWidth(screenWidth); } public BaseGridAdapter(Context mContext,int column,int totalWidth){ super(mContext); this.column = column; calculateWidth(totalWidth); } public void setDivingStyle(int divingWidth,int divingColorRes){ this.divingWidth = divingWidth; this.divingColorRes = divingColorRes; } private void calculateWidth(int totalWidth){ itemViewWidth = (totalWidth - divingWidth*(column-1))/column; } @Override public int getItemCount() { if(super.getItemCount() == 0) return 0; else{ if(super.getItemCount() % column > 0){ return super.getItemCount() / column + 1; }else{ return super.getItemCount() / column; } } } @Override public void onBindViewHolder(final BaseGridViewHolder holder, int position) { int startIndex = position * column; for (int i = 0; i < column; i++) { int index = startIndex + i; View itemView = holder.baseLayout.findViewWithTag(i); if(getList().size() > index){ itemView.setVisibility(View.VISIBLE); onBindView(itemView,itemViewWidth,index); }else{ itemView.setVisibility(View.INVISIBLE); } } } @Override public BaseGridViewHolder onCreateViewHolder(ViewGroup viewGroup, int position) { View view = LayoutInflater.from(mContext).inflate(R.layout.item_base_grid,null); BaseGridViewHolder holder = new BaseGridViewHolder(view,divingWidth,divingColorRes); for (int i = 0; i < column; i++) { View itemView = LayoutInflater.from(mContext).inflate(getItemViewLayoutID(),null); itemView.setTag(i); LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT); params.weight = 1; itemView.setLayoutParams(params); holder.baseLayout.addView(itemView); if(i < column-1){ View lineView = new View(mContext); lineView.setTag("diving"+i); lineView.setLayoutParams(new LayoutParams(divingWidth, LayoutParams.MATCH_PARENT)); lineView.setBackgroundResource(divingColorRes); holder.baseLayout.addView(lineView); } } return holder; } public abstract int getItemViewLayoutID(); public abstract void onBindView(View view,int width,int position); } class BaseGridViewHolder extends ViewHolder{ LinearLayout baseLayout; View divingLine; public BaseGridViewHolder(View view,int divingLineHeight,int divingColorRes){ super(view); baseLayout = (LinearLayout) view.findViewById(R.id.baseLayout); divingLine = view.findViewById(R.id.divingLine); divingLine.setBackgroundResource(divingColorRes); LayoutParams params = (LayoutParams) divingLine.getLayoutParams(); params.height = divingLineHeight; divingLine.setLayoutParams(params); } }
[ "gongxjdexy@gmail.com" ]
gongxjdexy@gmail.com
f29449431dab8e4aaa06858aae8bf11856e34b0b
68f3028f9ccf870b4cf5555d3db67b45d20e166a
/app/src/main/java/com/manoolia/viewpagerfragmentmvpexample/fragments/firstFragmentMVP/presenter/FirstFragmentPresenter.java
5f3bc9d9b8177161108c6c8dbad88b66ef4ffd91
[]
no_license
eraldhaka/ViewPager-inside-a-fragment-MVP
68f2a442b3a2584c2bb8762f815fd7a640189faf
fb80ba022a762d0ca1d27e558fca9f3c743b1814
refs/heads/master
2021-04-06T11:11:49.589202
2018-12-28T05:17:31
2018-12-28T05:17:31
124,560,032
10
2
null
null
null
null
UTF-8
Java
false
false
1,205
java
package com.manoolia.viewpagerfragmentmvpexample.fragments.firstFragmentMVP.presenter; import com.manoolia.viewpagerfragmentmvpexample.fragments.firstFragmentMVP.interfaces.ModelInterface; import com.manoolia.viewpagerfragmentmvpexample.fragments.firstFragmentMVP.interfaces.PresenterInterface; import com.manoolia.viewpagerfragmentmvpexample.fragments.firstFragmentMVP.model.FirstFragmentModel; import com.manoolia.viewpagerfragmentmvpexample.fragments.firstFragmentMVP.model.ListElements; import com.manoolia.viewpagerfragmentmvpexample.fragments.firstFragmentMVP.view.FirstFragment; import java.util.List; /** * Created by Erald on 3/9/2018. */ public class FirstFragmentPresenter implements PresenterInterface,ModelInterface.OnFinishedListener { private FirstFragment view; private ModelInterface model; public FirstFragmentPresenter(FirstFragment firstFragment) { this.view = firstFragment; model = new FirstFragmentModel(); } @Override public void onSuccessfully(List<ListElements> firstFragmentModels) { view.getListPerson(firstFragmentModels); } @Override public void getData() { model.getListFromModel(this); } }
[ "erald.haka22@gmail.com" ]
erald.haka22@gmail.com
af41605c58dd17e21139dc2d03f2fe244c587bf9
57f8513771c6264ee7919c1708158177237238fb
/project/01-helloworld/src/main/java/com/kk/helloworld/Application.java
f85397ef17923e159ac663d117826cb2d51bdd91
[ "MIT" ]
permissive
gaojingang/springboot-learning-example
910195605c682721d6102a09d454b38f5a070198
9d3edd2518581f504b667ed68a7ba81ec9ce14ad
refs/heads/master
2022-07-31T20:34:56.826709
2019-07-30T15:35:50
2019-07-30T15:35:50
199,678,565
0
0
MIT
2022-06-21T01:34:10
2019-07-30T15:26:26
JavaScript
UTF-8
Java
false
false
299
java
package com.kk.helloworld; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class Application { public static void main(String[] args) { SpringApplication.run(Application.class, args); } }
[ "gaojingangzh@gmail.com" ]
gaojingangzh@gmail.com
b04ccfcbeeccd3dd4bd222030526bdcc8561b378
5cc69eb869b9e781d21b826757f25eb996734cb8
/java-auto/Automobile.java
2e9c426b6c20c5a80fab6ba31446f4684a48cd7c
[]
no_license
denisberno/Java
5bb393d58bb96ed91ba0a4082ea556c2c69b075a
5cb07447b186e97e637a9242414b96ba06db12d2
refs/heads/master
2022-07-16T16:39:10.697044
2020-05-16T10:14:13
2020-05-16T10:14:13
174,751,787
0
0
null
null
null
null
UTF-8
Java
false
false
3,472
java
public class Automobile { private String targa; private int anno; private String colore; private int cilindrata; private String carburante; private int nPosti; private String marca; private String modello; private int serbatoio; private boolean luci; private int codiceAUTO; public Automobile(String targa,int anno,String colore,int cilindrata,String carburante,int nPosti,String marca,String modello) { this.setTarga(targa); this.setAnno(anno); this.setColore(colore); this.setCilindrata(cilindrata); this.setCarburante(carburante); this.setNPosti(nPosti); this.setMarca(marca); this.setModello(modello); this.setSerbatoio(10); this.setLuci(false) ; //false = OFF } public Automobile(Automobile a) { this.setTarga(a.getTarga()); this.setAnno(a.getAnno()); this.setColore(a.getColore()); this.setCilindrata(a.getCilindrata()); this.setCarburante(a.getCarburante()); this.setNPosti(a.getNPosti()); this.setMarca(a.getMarca()); this.setModello(a.getModello()); this.setSerbatoio(a.getSerbatoio()); this.setLuci(a.getLuci()) ; //false = OFF } public void setCodiceAuto( int codice ){ this.codiceAUTO = codice ; } public int getCodiceAuto(){ return this.codiceAUTO; } private void setTarga ( String targa){ this.targa = targa; } private void setAnno (int anno){ this.anno = anno; } private void setColore (String colore ){ this.colore = colore; } private void setCilindrata (int cilindrata ){ this.cilindrata = cilindrata; } private void setCarburante (String carburante ){ this.carburante = carburante; } private void setNPosti (int nPosti ){ this.nPosti = nPosti; } private void setMarca (String marca ){ this.marca = marca; } private void setModello (String modello ){ this.modello = modello; } private void setSerbatoio (int l ){ this.serbatoio = l ; //l = litri rimasti; } private void setLuci (boolean luci ){ this.luci = luci; } // METODI GET public String getTarga (){ return this.targa; } public int getAnno (){ return this.anno; } public String getColore ( ){ return this.colore ; } public int getCilindrata (){ return this.cilindrata ; } public String getCarburante (){ return this.carburante; } public int getNPosti (){ return this.nPosti; } public String getMarca (){ return this.marca; } public String getModello (){ return this.modello ; } public int getSerbatoio (){ return this.serbatoio; } public boolean getLuci (){ return this.luci; } public String toString() { String s=""; s+= "marca : "+ this.getMarca(); s+= "targa : "+ this.getTarga(); return s; } public boolean equals(Automobile b) { boolean check = false; if(this.getTarga()== b.getTarga()) check = true; return check; } public String luci() { String s=""; if(this.getLuci()== true) s= "luci accese"; else s="luci spente"; return s; } public String benzina() { String s=""; if(this.getSerbatoio()<= 10) s= "benzina non c'e'"; else s="benzina c'e'"; return s; } public void rifornimento(int q) { if((this.getSerbatoio()+q)>100) this.setSerbatoio(100); else this.setSerbatoio(this.getSerbatoio()+q); } }
[ "noreply@github.com" ]
noreply@github.com
c54545ec141489bff6142b9b160a77c7415e9667
a5606e5cd29260af03c0ace8b4092d4948732ecd
/ArCo-release/rdfizer/src/test/java/arco/rdfizer/NameCleaner.java
1fa767af16d7f23c7f722d51b29341311b1fa749
[]
no_license
ICCD-MiBACT/ArCo
2f878daf83527008a464fe90826a08fa873e2235
5cca59126c18f325f2ca873f437d24ab403ccddd
refs/heads/master
2023-08-31T07:44:21.458953
2023-01-09T12:18:15
2023-01-09T12:18:15
113,032,283
22
11
null
2023-04-19T15:09:30
2017-12-04T11:06:21
XSLT
UTF-8
Java
false
false
1,762
java
package arco.rdfizer; import static org.junit.Assert.assertEquals; import org.junit.Test; public class NameCleaner { @Test public void test() { it.cnr.istc.stlab.arco.xsltextension.NameCleaner nc = it.cnr.istc.stlab.arco.xsltextension.NameCleaner .getInstance(); assertEquals("Luigi Asprino", nc.nameCleaner("Luigi Asprino")); assertEquals("Luigi Maria Asprino", nc.nameCleaner("Luigi Maria Asprino")); assertEquals("Luigi Maria Asprino", nc.nameCleaner("Asprino Luigi Maria")); assertEquals("Luigi Maria Asprino", nc.nameCleaner("Asprino, Luigi Maria")); assertEquals("Luigi Maria Gennaro Asprino", nc.nameCleaner("Asprino Luigi Maria Gennaro")); assertEquals("Luigi Maria Gennaro Asprino", nc.nameCleaner("Asprino, Luigi Maria Gennaro")); assertEquals("Luigi Asprino", nc.nameCleaner("Asprino Luigi")); assertEquals("Luigi Asprino", nc.nameCleaner("Asprino, Luigi")); assertEquals("Luigi Asprino", nc.nameCleaner("Luigi, Asprino")); assertEquals("Luigi De Maria", nc.nameCleaner("Luigi De Maria")); assertEquals("Luigi Maria De Maria", nc.nameCleaner("Luigi Maria De Maria")); assertEquals("Luigi De Maria", nc.nameCleaner("De Maria, Luigi")); assertEquals("Luigi Sergio", nc.nameCleaner("Luigi Sergio")); assertEquals("Luigi Giovanni Sergio", nc.nameCleaner("Luigi Giovanni Sergio")); assertEquals("Xxx Aaaa", nc.nameCleaner("xxx aaaa")); assertEquals("Mario Rossi Bianchi", nc.nameCleaner("Bianchi, Mario Rossi")); assertEquals("Mario Rossi Bianchi", nc.nameCleaner("Rossi Bianchi, Mario")); assertEquals("Luigi Asprino", nc.nameCleaner("LUIGI ASPRINO")); assertEquals("Luigi Asprino", nc.nameCleaner("luigi asprino")); assertEquals("", nc.nameCleaner("")); assertEquals("", nc.nameCleaner(null)); } }
[ "luigi.asprino@gmail.com" ]
luigi.asprino@gmail.com
12ae3691dd199b70a1bdaa4c71783075d4cbd271
0af8b92686a58eb0b64e319b22411432aca7a8f3
/single-large-project/src/main/java/org/gradle/test/performancenull_416/Productionnull_41510.java
5eee8d6ea3f5af97f40cb9087e0e7bdf9559cd52
[]
no_license
gradle/performance-comparisons
b0d38db37c326e0ce271abebdb3c91769b860799
e53dc7182fafcf9fedf07920cbbea8b40ee4eef4
refs/heads/master
2023-08-14T19:24:39.164276
2022-11-24T05:18:33
2022-11-24T05:18:33
80,121,268
17
15
null
2022-09-30T08:04:35
2017-01-26T14:25:33
null
UTF-8
Java
false
false
588
java
package org.gradle.test.performancenull_416; public class Productionnull_41510 { private final String property; public Productionnull_41510(String param) { this.property = param; } public String getProperty() { return property; } private String prop0; public String getProp0() { return prop0; } public void setProp0(String value) { prop0 = value; } private String prop1; public String getProp1() { return prop1; } public void setProp1(String value) { prop1 = value; } }
[ "cedric.champeau@gmail.com" ]
cedric.champeau@gmail.com
90d54e5548484e44bac12ab408cdaba9cd548777
f8ed739076bda1a1c47ab899b79a522c99ee96df
/Java and JOGL Tutorials/src/ch6/_1/Camera.java
2628fb1f37a8f34f7c462c5fc2f66ff477b10c45
[]
no_license
jcdhan1/COM4503
c99937c50f32f8bb3f30a0e9bac1a7d01417c9bb
40442a43788989c4e4f5602019463f8f76d1c18e
refs/heads/master
2020-03-30T19:54:37.371915
2018-12-11T13:46:05
2018-12-11T13:46:05
151,565,007
0
0
null
null
null
null
UTF-8
Java
false
false
3,347
java
package ch6._1; import ch6._1.gmaths.*; public class Camera { public enum CameraType {X, Z}; public enum Movement {NO_MOVEMENT, LEFT, RIGHT, UP, DOWN, FORWARD, BACK}; private static final float DEFAULT_RADIUS = 25; public static final Vec3 DEFAULT_POSITION = new Vec3(0,0,25); public static final Vec3 DEFAULT_POSITION_2 = new Vec3(25,0,0); public static final Vec3 DEFAULT_TARGET = new Vec3(0,0,0); public static final Vec3 DEFAULT_UP = new Vec3(0,1,0); public final float YAW = -90f; public final float PITCH = 0f; public final float KEYBOARD_SPEED = 0.2f; public final float MOUSE_SPEED = 1.0f; private Vec3 position; private Vec3 target; private Vec3 up; private Vec3 worldUp; private Vec3 front; private Vec3 right; private float yaw; private float pitch; private Mat4 perspective; public Camera(Vec3 position, Vec3 target, Vec3 up) { setupCamera(position, target, up); } private void setupCamera(Vec3 position, Vec3 target, Vec3 up) { this.position = new Vec3(position); this.target = new Vec3(target); this.up = new Vec3(up); front = Vec3.subtract(target, position); front.normalize(); up.normalize(); calculateYawPitch(front); worldUp = new Vec3(up); updateCameraVectors(); } public Vec3 getPosition() { return new Vec3(position); } public void setPosition(Vec3 p) { setupCamera(p, target, up); } public void setTarget(Vec3 t) { setupCamera(position, t, up); } public void setCamera(CameraType c) { switch (c) { case X : setupCamera(DEFAULT_POSITION, DEFAULT_TARGET, DEFAULT_UP) ; break; case Z : setupCamera(DEFAULT_POSITION_2, DEFAULT_TARGET, DEFAULT_UP); break; } } private void calculateYawPitch(Vec3 v) { yaw = (float)Math.atan2(v.z,v.x); pitch = (float)Math.asin(v.y); } public Mat4 getViewMatrix() { target = Vec3.add(position, front); return Mat4Transform.lookAt(position, target, up); } public void setPerspectiveMatrix(Mat4 m) { perspective = m; } public Mat4 getPerspectiveMatrix() { return perspective; } public void keyboardInput(Movement movement) { switch (movement) { case NO_MOVEMENT: break; case LEFT: position.add(Vec3.multiply(right, -KEYBOARD_SPEED)); break; case RIGHT: position.add(Vec3.multiply(right, KEYBOARD_SPEED)); break; case UP: position.add(Vec3.multiply(up, KEYBOARD_SPEED)); break; case DOWN: position.add(Vec3.multiply(up, -KEYBOARD_SPEED)); break; case FORWARD: position.add(Vec3.multiply(front, KEYBOARD_SPEED)); break; case BACK: position.add(Vec3.multiply(front, -KEYBOARD_SPEED)); break; } } public void updateYawPitch(float y, float p) { yaw += y; pitch += p; if (pitch > 89) pitch = 89; else if (pitch < -89) pitch = -89; updateFront(); updateCameraVectors(); } private void updateFront() { double cy, cp, sy, sp; cy = Math.cos(yaw); sy = Math.sin(yaw); cp = Math.cos(pitch); sp = Math.sin(pitch); front.x = (float)(cy*cp); front.y = (float)(sp); front.z = (float)(sy*cp); front.normalize(); target = Vec3.add(position,front); } private void updateCameraVectors() { right = Vec3.crossProduct(front, worldUp); right.normalize(); up = Vec3.crossProduct(right, front); up.normalize(); } }
[ "jcdhan1@sheffield.ac.uk" ]
jcdhan1@sheffield.ac.uk
153ffe38c87f5068b1f86584a724510dfe4c83e5
039b116384a6c7cea71992724181f8a00d46d054
/src/main/java/com/foodbuddy/domain/PersistentAuditEvent.java
a84f1f1642e5a6b5e4d3711bc4673529dde1ad25
[]
no_license
FoodBuddyAPI/API
26e794df01a18775cd43444ff269c6bc80fb8469
5dc92fca48db86948dcba82ea4673b33947693ad
refs/heads/master
2021-08-15T20:45:02.713455
2017-11-18T08:18:43
2017-11-18T08:18:43
111,186,130
1
0
null
null
null
null
UTF-8
Java
false
false
1,658
java
package com.foodbuddy.domain; import org.springframework.data.annotation.Id; import org.springframework.data.mongodb.core.mapping.Document; import org.springframework.data.mongodb.core.mapping.Field; import javax.validation.constraints.NotNull; import java.io.Serializable; import java.time.Instant; import java.util.HashMap; import java.util.Map; /** * Persist AuditEvent managed by the Spring Boot actuator * @see org.springframework.boot.actuate.audit.AuditEvent */ @Document(collection = "jhi_persistent_audit_event") public class PersistentAuditEvent implements Serializable { @Id @Field("event_id") private String id; @NotNull private String principal; private Instant auditEventDate; @Field("event_type") private String auditEventType; private Map<String, String> data = new HashMap<>(); public String getId() { return id; } public void setId(String id) { this.id = id; } public String getPrincipal() { return principal; } public void setPrincipal(String principal) { this.principal = principal; } public Instant getAuditEventDate() { return auditEventDate; } public void setAuditEventDate(Instant auditEventDate) { this.auditEventDate = auditEventDate; } public String getAuditEventType() { return auditEventType; } public void setAuditEventType(String auditEventType) { this.auditEventType = auditEventType; } public Map<String, String> getData() { return data; } public void setData(Map<String, String> data) { this.data = data; } }
[ "deepakms92@gmail.com" ]
deepakms92@gmail.com
db1d107b781260f639dc6af35754f2b019708174
1bf39e53f8cf372f741511e9a573d12bb6b318e8
/work_1.java
fe0723d6dbfb8b8d33fd53990e3826931ee054fc
[]
no_license
Kayrzhan/paint
1ef80f88666e5904134bd827257216fc9c6e2e6a
7e21ed9846f8882e5ef642156a2c51bac4f3b724
refs/heads/master
2022-09-15T18:30:47.429812
2020-05-31T08:20:18
2020-05-31T08:20:18
268,228,272
0
0
null
null
null
null
UTF-8
Java
false
false
2,670
java
package module; import javax.swing.*; import java.awt.*; import java.awt.event.*; public class work_1 { public static void main(String[] args) { okno window = new okno(); } } class okno extends JFrame { public okno() { setBounds(-10, 0, 800, 600); setTitle("mouse controlling"); panel pan = new panel(); Container con = getContentPane(); con.add(pan); setVisible(true); } } class panel extends JPanel { private Color[] masColor; private int tCol = 0; private int mX, mY; private boolean flag = false; public panel() { addMouseListener(new myMouse1()); addMouseMotionListener(new myMouse2()); setFocusable(true); } public void paintComponent(Graphics gr) { masColor = new Color[8]; Color col1 = new Color(255,255,255); masColor[0] = new Color(55, 100, 255); masColor[1] = Color.GREEN; masColor[2] = Color.BLUE; masColor[3] = Color.RED; masColor[4] = Color.YELLOW; masColor[5] = Color.WHITE; masColor[6] = Color.ORANGE; masColor[7] = Color.BLACK; for (int i = 0; i < 8; i++) { gr.setColor(masColor[i]); gr.fillRect(i*100, 0, 100, 50); } if (flag==true) { gr.setColor(masColor[tCol]); gr.fillRect(mX, mY, 3, 3); if (tCol == 7) { gr.setColor(masColor[7]); gr.fillRect(mX, mY, 100, 100); } } } public class myMouse1 implements MouseListener { @Override public void mouseClicked(MouseEvent e) { } @Override public void mousePressed(MouseEvent e) { int tX = e.getX(); int tY = e.getY(); int col = e.getClickCount(); int btn = e.getButton(); if ((tX>0) && (tX<700) && (tY>0)&&(tX<700)) { if (col == 1) { if (btn == 1) {tCol=tX/100;} } } } @Override public void mouseReleased(MouseEvent e) { flag = false; } @Override public void mouseEntered(MouseEvent e) { } @Override public void mouseExited(MouseEvent e) { } } } public class myMouse2 implements MouseMotionListener { @Override public void mouseDragged(MouseEvent e) { int tX = e.getX(); int tY = e.getY(); } } @Override public void mouseMoved(MouseEvent e ) { System.out.println(e.getX()+" " + e.getY()); int tX = e.getX(); int tY = e.getY(); if (tX>0 && tX<700 && tY > 0 && tY <50) { setCursor(new Cursor(Cursor.HAND_CURSOR)); } else { setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } } }
[ "Khamitkhan.bro@gmail.com" ]
Khamitkhan.bro@gmail.com
6a64d5f68c00d8c496c4816c1e6a25a705bcc581
a2845d960aa1d80bcce930dfa513f8b8b2917fa1
/workspace/src/practice/Super/Demo01Super.java
397195ae433b193632cbe7729a4da97dacd4b58c
[]
no_license
Justdoitfor/Java
1a7e8e13c9b9551537d6f7ea57aebdd206d26282
267055b709039741abb63edead83ee004028e11a
refs/heads/master
2021-02-15T06:33:13.680057
2020-03-13T11:45:01
2020-03-13T11:45:01
244,872,494
0
0
null
null
null
null
UTF-8
Java
false
false
232
java
package practice.Super; public class Demo01Super { public static void main(String[] args) { Zi zi = new Zi(); zi.method(); zi.methodZi(); // 子类方法中调用了父类中的num 即super.num } }
[ "wang_workspace@sina.com" ]
wang_workspace@sina.com
9886c5f241e1304e48a7646edafbc01e7d14194c
bc6c8ea3a586afab44c79b7f105529a86bf1d82a
/src/main/java/pl/manciak/thymeleaf/service/FoodService/MealDataService.java
1ee2d3bbd32dbf84a194fef3be55b939b933a9b5
[]
no_license
PatrykSzymonMlynczak/DziabajApp_2.0
63e7495ef512b75bfa57389eff22090a33609343
aadc0f6937aa13ad07bdef70d8fada5fc32aebf4
refs/heads/master
2021-08-07T15:36:28.922626
2021-07-08T01:07:56
2021-07-08T01:07:56
222,028,923
1
0
null
2021-03-31T21:37:20
2019-11-16T01:18:11
Java
UTF-8
Java
false
false
887
java
package pl.manciak.thymeleaf.service.FoodService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import pl.manciak.thymeleaf.entity.FoodEntities.Meal; import pl.manciak.thymeleaf.repository.FoodRepo.MealRepository; import java.util.Optional; @Service public class MealDataService { private MealRepository mealRepo; @Autowired MealDataService(MealRepository mealRepo){ this.mealRepo = mealRepo; } public Optional<Meal> findByName(String name){ return mealRepo.findByName(name);} public Iterable<Meal> findAll(){return mealRepo.findAll();} public void deleteById(Long id){ mealRepo.deleteById(id); } public void deleteByName(String name){ mealRepo.deleteByName(name); } public Meal save (Meal meal){ return mealRepo.save(meal); } }
[ "patrykszymonmlynczak@gmail.com" ]
patrykszymonmlynczak@gmail.com
89f8e9e4dd1ab5288bc327d3cf40099d95eb1ebe
18204739a2704e1534970f9b0f67455ab328a4ba
/encryptionassignment/src/com/ProgressiveWorkSpace/crypty.java
15a732158394780e06201e776f19d47d22e2fad0
[]
no_license
georgewoizesko/FridayWeekThree
496b67e8ed3ab17e327d854e14c0f5cac3cc2aba
40e9fb06c20bdb4bc9859dd91c94cd11fa7925a8
refs/heads/master
2020-09-25T23:24:57.319428
2016-08-19T18:56:16
2016-08-19T18:56:16
66,105,167
0
0
null
null
null
null
UTF-8
Java
false
false
556
java
package com.ProgressiveWorkSpace; import java.util.Scanner; public class crypty { public static void main(String[] args) { Scanner in = new Scanner(System.in); String plainText = in.nextLine(); // key value should be from 0 to 25 int key = in.nextInt(); plainText = plainText.toUpperCase(); char[] plainTextChar = plainText.toCharArray(); for(int i=0;i<plainTextChar.length;i++) { plainTextChar[i] = (char)(((int)plainTextChar[i]+key-65)%26 + 65); } System.out.println(String.valueOf(plainTextChar)); } }
[ "woizesko@gmail.com" ]
woizesko@gmail.com
e96621c8299581b8d960a29d190259dadd141215
c9cf828fadc861307f2d4e1606dc0452af197917
/src/oops/Methods06.java
18a876b72ac8b9799896efd020db4d6f55e39d4a
[]
no_license
medineonan/medine
ac85baa88a8d00402bae1aed613dc3039ac1b08a
72ab6bc1757df2282c665957fab1cab7544fa44d
refs/heads/master
2021-03-10T12:21:32.967959
2020-04-22T20:58:49
2020-04-22T20:58:49
246,452,354
0
0
null
null
null
null
UTF-8
Java
false
false
592
java
package oops; public class Methods06 { char getGrade(int a) { char grade; if(a>90) { grade='A'; }else if (a<=90 && a>80) { grade='B'; }else if (a<=80 && a>70) { grade='C'; }else { grade='F'; } return grade; } public static void main(String[]args) { Methods06 m=new Methods06(); char grade= m.getGrade(25); System.out.println(grade); //if grade is A or B---->good job,otherwise--->study more if(grade=='A' || grade=='B') { System.out.println("good job"); }else { System.out.println("study more"); } } }
[ "medineaksakalli@gmail.com" ]
medineaksakalli@gmail.com
138f1f073b747d259ee78084911aff9249e83414
0f44c786838c00ebfbbefe9de93aa3c9a9fcdfa6
/src/main/java/com/example/springdocker/collection/BusinessTwo.java
6a6966f9a13eb5224ce16b465805cd33b7387d4b
[]
no_license
filipemarquesmenezes/spring-docker
812edee61a666a2327e2e4de24f2599ea40edcd1
03bfa5047748d972d174e477eac6d03c83969074
refs/heads/main
2023-08-05T22:07:15.551466
2021-10-11T12:17:24
2021-10-11T12:17:24
415,910,280
0
0
null
null
null
null
UTF-8
Java
false
false
399
java
package com.example.springdocker.collection; import org.springframework.core.annotation.Order; import org.springframework.stereotype.Component; @Order(1) @Component public class BusinessTwo implements BusinessUnit { @Override public void apply() { System.out.println("BusinessTwo.apply"); } @Override public String toString() { return "BusinessTwo{}"; } }
[ "filipemarquesmenezes@gmail.com" ]
filipemarquesmenezes@gmail.com
e2a8499b7e7fe06a5bc1f7f619bc52bdad0ef748
c5b3fcb731dbdc8c19c90048513912975627c897
/src/main/java/im/peng/ceramic/ceramic_sell/dao/GoodsMapper.java
03734df07232c1b4a09db12bd38fc8b6201bf3e0
[]
no_license
pengxingjia/ceramic_sell
c87837bd1c0a51d02be7ed85a2fd995415f51a74
dab2714fbdbc8ad46730261d629c8ee490c5ad65
refs/heads/master
2020-08-23T06:23:23.323666
2019-10-21T12:21:02
2019-10-21T12:21:02
216,560,683
0
0
null
null
null
null
UTF-8
Java
false
false
375
java
package im.peng.ceramic.ceramic_sell.dao; import im.peng.ceramic.ceramic_sell.model.po.Goods; public interface GoodsMapper { int deleteByPrimaryKey(String id); int insert(Goods record); int insertSelective(Goods record); Goods selectByPrimaryKey(String id); int updateByPrimaryKeySelective(Goods record); int updateByPrimaryKey(Goods record); }
[ "xingjia.peng@qingtui.cn" ]
xingjia.peng@qingtui.cn
9ccd4b0f0a1441d4cdb9177175d3e6a00c069800
1c7a03ce3485a28e817fe69c2460a9db09f0dea1
/workspace/gcns_incompany/src/src/bean/BbsBean.java
98366f31171f8f7dfbd00e23e1995d321ce827a4
[]
no_license
lion9006/GcsReport
5ad710c9db784b56097152e7075cd7e58aeea6e7
3e88ca1c8593d918461923612b75968dcd770f53
refs/heads/master
2020-12-25T06:08:31.614384
2016-07-15T05:39:12
2016-07-15T05:39:12
63,256,468
0
0
null
null
null
null
UTF-8
Java
false
false
3,924
java
package src.bean; import java.sql.Timestamp; import java.util.Arrays; /** * 掲示板ビーン * * @since 20150317 * @author Park.Jaedeok * */ public class BbsBean { int BBS_NUMBER; String BBS_WRITER; String BBS_CATEGORY; String BBS_TITLE; String BBS_CONTENT; String BBS_FNAME; byte[] BBS_FDATA; String DEL_FLG; Timestamp UPD_DT; String UPD_ID; Timestamp TRK_DT; String TRK_ID; String TRK_DATE; String TRK_TIME; String CODE_NM; String USER_NAME; String USER_NAME_KATA; public String getCODE_NM() { return CODE_NM; } public void setCODE_NM(String cODE_NM) { CODE_NM = cODE_NM; } public String getUSER_NAME() { return USER_NAME; } public void setUSER_NAME(String uSER_NAME) { USER_NAME = uSER_NAME; } /** * @return the bBS_NUMBER */ public int getBBS_NUMBER() { return BBS_NUMBER; } /** * @param bBS_NUMBER the bBS_NUMBER to set */ public void setBBS_NUMBER(int bBS_NUMBER) { BBS_NUMBER = bBS_NUMBER; } /** * @return the bBS_WRITER */ public String getBBS_WRITER() { return BBS_WRITER; } /** * @param bBS_WRITER the bBS_WRITER to set */ public void setBBS_WRITER(String bBS_WRITER) { BBS_WRITER = bBS_WRITER; } /** * @return the bBS_CATEGORY */ public String getBBS_CATEGORY() { return BBS_CATEGORY; } /** * @param bBS_CATEGORY the bBS_CATEGORY to set */ public void setBBS_CATEGORY(String bBS_CATEGORY) { BBS_CATEGORY = bBS_CATEGORY; } /** * @return the bBS_TITLE */ public String getBBS_TITLE() { return BBS_TITLE; } /** * @param bBS_TITLE the bBS_TITLE to set */ public void setBBS_TITLE(String bBS_TITLE) { BBS_TITLE = bBS_TITLE; } /** * @return the bBS_CONTENT */ public String getBBS_CONTENT() { return BBS_CONTENT; } /** * @param bBS_CONTENT the bBS_CONTENT to set */ public void setBBS_CONTENT(String bBS_CONTENT) { BBS_CONTENT = bBS_CONTENT; } /** * @return the bBS_FNAME */ public String getBBS_FNAME() { return BBS_FNAME; } /** * @param bBS_FNAME the bBS_FNAME to set */ public void setBBS_FNAME(String bBS_FNAME) { BBS_FNAME = bBS_FNAME; } /** * @return the bBS_FDATA */ public byte[] getBBS_FDATA() { return BBS_FDATA; } /** * @param bBS_FDATA the bBS_FDATA to set */ public void setBBS_FDATA(byte[] bBS_FDATA) { BBS_FDATA = bBS_FDATA; } /** * @return the dEL_FLG */ public String getDEL_FLG() { return DEL_FLG; } /** * @param dEL_FLG the dEL_FLG to set */ public void setDEL_FLG(String dEL_FLG) { DEL_FLG = dEL_FLG; } /** * @return the uPD_DT */ public Timestamp getUPD_DT() { return UPD_DT; } /** * @param uPD_DT the uPD_DT to set */ public void setUPD_DT(Timestamp uPD_DT) { UPD_DT = uPD_DT; } /** * @return the uPD_ID */ public String getUPD_ID() { return UPD_ID; } /** * @param uPD_ID the uPD_ID to set */ public void setUPD_ID(String uPD_ID) { UPD_ID = uPD_ID; } /** * @return the tRK_DT */ public Timestamp getTRK_DT() { return TRK_DT; } /** * @param tRK_DT the tRK_DT to set */ public void setTRK_DT(Timestamp tRK_DT) { TRK_DT = tRK_DT; } /** * @return the tRK_ID */ public String getTRK_ID() { return TRK_ID; } /** * @param tRK_ID the tRK_ID to set */ public void setTRK_ID(String tRK_ID) { TRK_ID = tRK_ID; } public String getTRK_DATE() { return TRK_DATE; } public void setTRK_DATE(String tRK_DATE) { TRK_DATE = tRK_DATE; } public String getTRK_TIME() { return TRK_TIME; } public void setTRK_TIME(String tRK_TIME) { TRK_TIME = tRK_TIME; } public String getUSER_NAME_KATA() { return USER_NAME_KATA; } public void setUSER_NAME_KATA(String uSER_NAME_KATA) { USER_NAME_KATA = uSER_NAME_KATA; } }
[ "wooki9006@naver.com" ]
wooki9006@naver.com
6b338e60188799db1f3a01c97fe81eb6abc26544
c5b1b9cb6549b14bae1aece0cbed95b4b7210b91
/src/main/java/au/net/immortius/wardrobe/gw2api/entities/PriceData.java
9e79a6ace14ccf89bc308fffd8f8a6c3e3eab6e7
[ "Apache-2.0" ]
permissive
immortius/gw2-wardrobe-unlock
3bbd9c7f3f93fd70a39e90dfd76e3a34be5ca88b
1bb432a0ecd6ee4ebd8e4f0cc26ff6036bd29d6a
refs/heads/master
2023-09-05T23:09:24.204748
2023-08-28T12:35:03
2023-08-28T12:35:03
73,902,623
7
6
Apache-2.0
2023-09-12T12:20:26
2016-11-16T09:06:24
Java
UTF-8
Java
false
false
217
java
package au.net.immortius.wardrobe.gw2api.entities; /** * Price information for an item */ public class PriceData { public String id; public PriceOrderStatsData buys; public PriceOrderStatsData sells; }
[ "immortius@gmail.com" ]
immortius@gmail.com
f9fd44805f426e46c7495dbc5939354be1408b2b
38f5dd4e35dcabbb2d0ed0e31d1baf7466aa191d
/Movies/app/src/main/java/com/vkt4u9999/movies/utils/Preferences.java
b62210f298c93955df07d481d6e84aecc2b5d13e
[]
no_license
vkt4u9999/AndroidStudioProjects
401f2cd546eddee30569726ddbf7737239f9e9eb
8399e362c761f61cbdcd266f870596c18aee9296
refs/heads/master
2023-06-27T15:47:35.610381
2021-07-23T14:06:46
2021-07-23T14:06:46
325,146,814
0
0
null
null
null
null
UTF-8
Java
false
false
581
java
package com.vkt4u9999.movies.utils; import android.app.Activity; import android.content.Context; import android.content.SharedPreferences; public class Preferences { SharedPreferences preferences; public Preferences(Activity activity) { preferences = activity.getPreferences(Context.MODE_PRIVATE); } public void setSearchParameters(String searchParameters) { preferences.edit().putString("search", searchParameters).apply(); } public String getSearchParameters() { return preferences.getString("search", "Superman"); } }
[ "76712099+vkt4u9999@users.noreply.github.com" ]
76712099+vkt4u9999@users.noreply.github.com
806a5688b2864e9eb6ffaee3721caa5e8b842ddf
76028e79d2760b0e309ffafba1a338c6c804fe01
/plugins/webview_flutter/android/src/main/java/io/flutter/plugins/webviewflutter/MethodCallHandlerImpl.java
3ef75558c8e80991eb91c0217d93d281b7ecfc3f
[]
no_license
joezhangss/flutter_fish_local
f20ebb5f44b0bb8db7806d499668814df7612ecb
762d54ab32ec04059ccfb7c83191d3794f9ba29c
refs/heads/master
2022-12-04T23:00:56.651734
2020-09-01T02:46:04
2020-09-01T02:46:04
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,645
java
// Copyright 2019 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. package io.flutter.plugins.webviewflutter; import android.content.Context; import android.content.SharedPreferences; import android.os.AsyncTask; import android.util.Base64; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.math.BigInteger; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; import io.flutter.plugin.common.MethodCall; import io.flutter.plugin.common.MethodChannel; /** * Implementation of the {@link MethodChannel.MethodCallHandler} for the plugin. It is also * responsible of managing the {@link SharedPreferences}. */ @SuppressWarnings("unchecked") class MethodCallHandlerImpl implements MethodChannel.MethodCallHandler { private static final String SHARED_PREFERENCES_NAME = "FlutterSharedPreferences"; // Fun fact: The following is a base64 encoding of the string "This is the prefix for a list." private static final String LIST_IDENTIFIER = "VGhpcyBpcyB0aGUgcHJlZml4IGZvciBhIGxpc3Qu"; private static final String BIG_INTEGER_PREFIX = "VGhpcyBpcyB0aGUgcHJlZml4IGZvciBCaWdJbnRlZ2Vy"; private static final String DOUBLE_PREFIX = "VGhpcyBpcyB0aGUgcHJlZml4IGZvciBEb3VibGUu"; private final SharedPreferences preferences; /** * Constructs a {@link MethodCallHandlerImpl} instance. Creates a {@link * SharedPreferences} based on the {@code context}. */ MethodCallHandlerImpl(Context context) { preferences = context.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE); } @Override public void onMethodCall(MethodCall call, MethodChannel.Result result) { String key = call.argument("key"); try { switch (call.method) { case "setBool": commitAsync(preferences.edit().putBoolean(key, (boolean) call.argument("value")), result); break; case "setDouble": double doubleValue = ((Number) call.argument("value")).doubleValue(); String doubleValueStr = Double.toString(doubleValue); commitAsync(preferences.edit().putString(key, DOUBLE_PREFIX + doubleValueStr), result); break; case "setInt": Number number = call.argument("value"); if (number instanceof BigInteger) { BigInteger integerValue = (BigInteger) number; commitAsync( preferences .edit() .putString( key, BIG_INTEGER_PREFIX + integerValue.toString(Character.MAX_RADIX)), result); } else { commitAsync(preferences.edit().putLong(key, number.longValue()), result); } break; case "setString": String value = (String) call.argument("value"); if (value.startsWith(LIST_IDENTIFIER) || value.startsWith(BIG_INTEGER_PREFIX)) { result.error( "StorageError", "This string cannot be stored as it clashes with special identifier prefixes.", null); return; } commitAsync(preferences.edit().putString(key, value), result); break; case "setStringList": List<String> list = call.argument("value"); commitAsync( preferences.edit().putString(key, LIST_IDENTIFIER + encodeList(list)), result); break; case "commit": // We've been committing the whole time. result.success(true); break; case "getAll": result.success(getAllPrefs()); return; case "remove": commitAsync(preferences.edit().remove(key), result); break; case "clear": Set<String> keySet = getAllPrefs().keySet(); SharedPreferences.Editor clearEditor = preferences.edit(); for (String keyToDelete : keySet) { clearEditor.remove(keyToDelete); } commitAsync(clearEditor, result); break; default: result.notImplemented(); break; } } catch (IOException e) { result.error("IOException encountered", call.method, e); } } private void commitAsync( final SharedPreferences.Editor editor, final MethodChannel.Result result) { new AsyncTask<Void, Void, Boolean>() { @Override protected Boolean doInBackground(Void... voids) { return editor.commit(); } @Override protected void onPostExecute(Boolean value) { result.success(value); } }.execute(); } private List<String> decodeList(String encodedList) throws IOException { ObjectInputStream stream = null; try { stream = new ObjectInputStream(new ByteArrayInputStream(Base64.decode(encodedList, 0))); return (List<String>) stream.readObject(); } catch (ClassNotFoundException e) { throw new IOException(e); } finally { if (stream != null) { stream.close(); } } } private String encodeList(List<String> list) throws IOException { ObjectOutputStream stream = null; try { ByteArrayOutputStream byteStream = new ByteArrayOutputStream(); stream = new ObjectOutputStream(byteStream); stream.writeObject(list); stream.flush(); return Base64.encodeToString(byteStream.toByteArray(), 0); } finally { if (stream != null) { stream.close(); } } } // Filter preferences to only those set by the flutter app. private Map<String, Object> getAllPrefs() throws IOException { Map<String, ?> allPrefs = preferences.getAll(); Map<String, Object> filteredPrefs = new HashMap<>(); for (String key : allPrefs.keySet()) { if (key.startsWith("flutter.")) { Object value = allPrefs.get(key); if (value instanceof String) { String stringValue = (String) value; if (stringValue.startsWith(LIST_IDENTIFIER)) { value = decodeList(stringValue.substring(LIST_IDENTIFIER.length())); } else if (stringValue.startsWith(BIG_INTEGER_PREFIX)) { String encoded = stringValue.substring(BIG_INTEGER_PREFIX.length()); value = new BigInteger(encoded, Character.MAX_RADIX); } else if (stringValue.startsWith(DOUBLE_PREFIX)) { String doubleStr = stringValue.substring(DOUBLE_PREFIX.length()); value = Double.valueOf(doubleStr); } } else if (value instanceof Set) { // This only happens for previous usage of setStringSet. The app expects a list. List<String> listValue = new ArrayList<>((Set) value); // Let's migrate the value too while we are at it. boolean success = preferences .edit() .remove(key) .putString(key, LIST_IDENTIFIER + encodeList(listValue)) .commit(); if (!success) { // If we are unable to migrate the existing preferences, it means we potentially lost them. // In this case, an error from getAllPrefs() is appropriate since it will alert the app during plugin initialization. throw new IOException("Could not migrate set to list"); } value = listValue; } filteredPrefs.put(key, value); } } return filteredPrefs; } }
[ "1057119720@qq.com" ]
1057119720@qq.com
ec60c7aa06dec11ea116c0b50b5ef69f862e16cc
4f9778ec48fac49981fcc54c441c5097d9095282
/src/com/yf/kp/design/billing/BilingTunaiTableModel.java
502cc3b9f61d8dc2bf0f50222346e48c8ead7283
[]
no_license
fanitriastowo/APS
2c4774bc2648bb5bede91a65ae0300e54995f2bd
309db22aaed3b12905eba8d06f06d94187d4d3a7
refs/heads/master
2021-01-21T17:57:31.419342
2014-12-23T10:45:47
2014-12-23T10:45:47
28,360,019
2
2
null
null
null
null
UTF-8
Java
false
false
2,329
java
/* * Copyright (C) 2014 anonymous * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package com.yf.kp.design.billing; import com.yf.kp.model.TagihanTunai; import java.util.ArrayList; import java.util.List; import javax.swing.table.AbstractTableModel; /** * * @author anonymous */ public class BilingTunaiTableModel extends AbstractTableModel { private List<TagihanTunai> list = new ArrayList<>(); private final String[] header = {"Id", "Nis", "Nama"}; public void setList(List<TagihanTunai> list) { this.list = list; } public void save(TagihanTunai tunai) { list.add(tunai); fireTableRowsInserted(getRowCount() - 1, getRowCount() - 1); } public void update(int index, TagihanTunai tunai) { list.set(index, tunai); fireTableRowsUpdated(index, index); } public void delete(int index) { list.remove(index); fireTableRowsDeleted(index, index); } public TagihanTunai getOne(int index) { return list.get(index); } @Override public String getColumnName(int column) { return header[column]; } @Override public int getRowCount() { return list.size(); } @Override public int getColumnCount() { return header.length; } @Override public Object getValueAt(int rowIndex, int columnIndex) { TagihanTunai tagihanTunai = list.get(rowIndex); switch (columnIndex) { case 0: return tagihanTunai.getId(); case 1: return tagihanTunai.getNis(); case 2: return tagihanTunai.getNama(); default: return null; } } }
[ "mikeybestdrummer@gmail.com" ]
mikeybestdrummer@gmail.com
b71d74778864295be856f0459a06574e26bea1c4
cb859612ec37f3e1c7ae2d2890c3436c5aeaab38
/TablePlus/src/com/unito/tableplus/server/servlets/InvitationServlet.java
7630861fd18d40c4ced44c202a3f14d2ec6c1bac
[]
no_license
giopetrone/personalcloudsyncfr
8a02931d72f4bd3d5a476dd2212c3ae7167da6f9
4f61fa4a702222b7b7ea47b1cdf66562abdae558
refs/heads/master
2021-01-25T05:34:16.984351
2013-10-27T16:29:01
2013-10-27T16:29:01
32,387,156
2
0
null
null
null
null
UTF-8
Java
false
false
2,459
java
package com.unito.tableplus.server.servlets; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.google.appengine.api.users.User; import com.google.appengine.api.users.UserService; import com.google.appengine.api.users.UserServiceFactory; import com.unito.tableplus.server.persistence.InvitationQueries; import com.unito.tableplus.server.persistence.TableQueries; import com.unito.tableplus.server.persistence.UserQueries; import com.unito.tableplus.server.util.Utility; import com.unito.tableplus.shared.model.Invitation; import com.unito.tableplus.shared.model.LoginInfo; public class InvitationServlet extends HttpServlet { private static final long serialVersionUID = -2761251611193483348L; private static final UserService userService = UserServiceFactory .getUserService(); @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { serveRequest(req, resp); } @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { serveRequest(req, resp); } private void serveRequest(HttpServletRequest req, HttpServletResponse resp) throws IOException { User user = userService.getCurrentUser(); if (user == null) { LoginInfo loginInfo = new LoginInfo(); loginInfo.setLoggedIn(false); loginInfo.setLoginUrl(userService.createLoginURL(Utility .getRequestUrl(req))); resp.sendRedirect(loginInfo.getLoginUrl()); } else { String code = req.getParameter("code"); if (code != null) { Invitation i = InvitationQueries.queryInvitation(code); if (i != null) { com.unito.tableplus.shared.model.User invitedUser = UserQueries .queryUser("email", i.getInvitedUser()); if (invitedUser == null) { invitedUser = new com.unito.tableplus.shared.model.User(); invitedUser.setEmail(user.getEmail()); invitedUser.setUsername(user.getNickname()); UserQueries.storeUser(invitedUser); } TableQueries.addMember(invitedUser.getKey(), i.getTableKey()); // TODO: send notification to table members InvitationQueries.deleteInvitation(i.getKey()); } } } resp.sendRedirect(Utility.getHomeUrl()); } }
[ "antoniofruci@gmail.com@d1ff346a-828c-11de-9a75-9d4ddcaa5d2c" ]
antoniofruci@gmail.com@d1ff346a-828c-11de-9a75-9d4ddcaa5d2c
01247ce1b692402748b5dcc89d0af8616a365844
8466add6dd322fdfcb3424dfbbe675b1300b229b
/src/main/java/yangle/hello/recipe/Recipes.java
1575e3aec443e71e7c09625fa9fceb1d94bcb993
[]
no_license
yang-le/helloMod
bf866a8186f7d42821f71d30af020380985ae2aa
413d56eb599aeed269d2c6153151cee3947fbfd3
refs/heads/master
2021-01-03T09:36:23.608642
2020-02-22T07:23:28
2020-02-22T07:23:28
240,022,588
0
0
null
null
null
null
UTF-8
Java
false
false
667
java
package yangle.hello.recipe; import java.util.Collection; import java.util.function.Predicate; import java.util.stream.Collectors; import net.minecraft.inventory.IInventory; import net.minecraft.item.crafting.IRecipe; import net.minecraft.item.crafting.RecipeManager; public class Recipes { private static final Collection<IRecipe<?>> recipes = new RecipeManager().getRecipes(); public static Collection<IRecipe<?>> getRecipes() { return recipes; } public static Collection<IRecipe<?>> getRecipes(Predicate<IRecipe<? extends IInventory>> predicate) { return recipes.stream().filter(predicate).collect(Collectors.toSet()); } }
[ "yangle0125@qq.com" ]
yangle0125@qq.com
5d93035afd134e99a35dfeb68d366e38950d62d3
002dd61773c87bb72ebeaa4dc723ebe645638009
/app/src/androidTest/java/com/muzadev/bearertoken/ExampleInstrumentedTest.java
a0e013b98f1287fcabbbaa8ec72ea3bb4ee33c47
[]
no_license
muzafakar/Retrofit-Bearer-Token
c326a6b8c1354d296a4beda5ce43b14bb3964546
bfe0e0b1140116f13b346458e101bbe73ef563ec
refs/heads/master
2020-08-02T21:42:45.788075
2019-09-30T16:19:22
2019-09-30T16:19:22
211,515,222
0
1
null
null
null
null
UTF-8
Java
false
false
762
java
package com.muzadev.bearertoken; import android.content.Context; import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.ext.junit.runners.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.getInstrumentation().getTargetContext(); assertEquals("com.muzadev.bearertoken", appContext.getPackageName()); } }
[ "muhammad.zulfakar@students.amikom.ac.id" ]
muhammad.zulfakar@students.amikom.ac.id
62bbc1ff4ef97f3d726dbdb870033d80741cb0f7
d255ad7871d0bd327c24ac970d86c9b82f17aff4
/LeagueOfTwasi/src/main/java/at/saith/twasi/rank/lol/SummonerUtil.java
8d408503890f31270ba8b1a8858c546c0b21afac
[]
no_license
SaithTheSoap/LeagueOfTwasi
e0bccab9d32b37829097ab0251f9879dd1a71408
e034b10bafc30bd5d4b54b75a324345680050b22
refs/heads/master
2021-04-03T04:47:49.408728
2018-03-08T17:25:12
2018-03-08T17:25:12
124,424,760
1
0
null
null
null
null
UTF-8
Java
false
false
851
java
package at.saith.twasi.rank.lol; import java.util.ArrayList; import at.saith.twasi.rank.lol.data.SummonerFetcher; import at.saith.twasi.rank.lol.summoner.Summoner; public class SummonerUtil { private static SummonerFetcher datafetcher; public static void setup(SummonerFetcher fetcher) { datafetcher = fetcher; } public static Summoner getSummoner(String summonerName) { return getSummoner(summonerName,"euw1"); } public static Summoner getSummoner(String summonerName, String region) { return datafetcher.getSummoner(summonerName,region); } public static ArrayList<Summoner> getMultiSummoner(String...summonerNames){ ArrayList<Summoner> summoners = new ArrayList<>(); for(String summonerName:summonerNames) { summoners.add(getSummoner(summonerName)); } return summoners; } }
[ "saith.soap@gmail.com" ]
saith.soap@gmail.com
7ac32ee9a5bb9e6ca575e5d663212fd72db8cca7
3abc5d729620357acf8fb47d3851fab321707337
/src/main/java/cn/edu/tongji/anliantest/dao/GZRWDTableDao.java
9b2bbdd3cfad283bfe1cd7a0952c1d3a3df97a47
[]
no_license
MYMMoonDT/anliantest_v3.0
ad872d5244f6f811a100dabc6589c4d8780a7530
c8da3c2400fe7441dc3a3830c24906f32867be7b
refs/heads/master
2021-01-25T07:39:36.501886
2015-02-12T07:20:52
2015-02-12T07:20:52
25,205,527
0
0
null
null
null
null
UTF-8
Java
false
false
381
java
package cn.edu.tongji.anliantest.dao; import cn.edu.tongji.anliantest.model.GZRWDTable; public interface GZRWDTableDao { public GZRWDTable getGZRWDById(Long gzrwdTableId); public GZRWDTable getGZRWDByProjectId(Long projectId); public Long addGZRWD(GZRWDTable gzrwdTable); public void updateGZRWD(GZRWDTable gzrwdTable); public void deleteGZRWD(Long gzrwdTableId); }
[ "bixiaodong1990@163.com" ]
bixiaodong1990@163.com
7e2f918630c8cdf68dbac8f016cc95d37694ad58
5e224ff6d555ee74e0fda6dfa9a645fb7de60989
/database/src/main/java/adila/db/a76002df_lenovo20a76002df.java
884262bb088537396fce00f7a7f0ca586892651e
[ "MIT" ]
permissive
karim/adila
8b0b6ba56d83f3f29f6354a2964377e6197761c4
00f262f6d5352b9d535ae54a2023e4a807449faa
refs/heads/master
2021-01-18T22:52:51.508129
2016-11-13T13:08:04
2016-11-13T13:08:04
45,054,909
3
1
null
null
null
null
UTF-8
Java
false
false
232
java
// This file is automatically generated. package adila.db; /* * Lenovo A7600-F * * DEVICE: A7600-F * MODEL: Lenovo A7600-F */ final class a76002df_lenovo20a76002df { public static final String DATA = "Lenovo|A7600-F|"; }
[ "keldeeb@gmail.com" ]
keldeeb@gmail.com
e4f7bfb0c4b550ad694e11a53d0028a586cab82e
d5b91ab3b8d2e7d91d2512f7688aed3e417e6449
/app/src/main/java/com/example/chatapp/Messages.java
f8077a8ca0385c763c505b71d3f3876ecc8d4cb9
[]
no_license
himanshushukla12/DepartmentalNotification1
f0131fc2f03fcd5220526aaac5e8bcf54de19477
1e36c3e7c93ddfe889545a12ef5074ba2738ba9d
refs/heads/main
2023-05-02T07:43:43.696549
2023-04-14T09:13:58
2023-04-14T09:13:58
215,355,960
0
0
null
null
null
null
UTF-8
Java
false
false
1,805
java
package com.example.chatapp; public class Messages { private String from,message,type,to,messageID,time,date,name; public Messages() { } public String getFrom() { return from; } public void setFrom(String from) { this.from = from; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } public String getType() { return type; } public void setType(String type) { this.type = type; } public String getTo() { return to; } public void setTo(String to) { this.to = to; } public String getMessageID() { return messageID; } public void setMessageID(String messageID) { this.messageID = messageID; } public String getTime() { return time; } public void setTime(String time) { this.time = time; } public String getDate() { return date; } public void setDate(String date) { this.date = date; } public String getName() { return name; } public void setName(String name) { this.name = name; } /* public Messages(String from, String message, String type) { this.from = from; this.message = message; this.type = type; } public String getFrom() { return from; } public void setFrom(String from) { this.from = from; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } public String getType() { return type; } public void setType(String type) { this.type = type; } */ }
[ "himanshushukla.shukla3@gmail.com" ]
himanshushukla.shukla3@gmail.com
c8df96423af964ddfa833ed17312af88a5cabe95
b3a3b3a4046af0ca8a0b11a24ebb935211aa00cf
/acoustic-search/src/main/java/com/acoustic/search/dto/SearchDTOWrapper.java
ef1e9f90c82c658f8acd2b7c31bd0bbcc15be7c9
[]
no_license
nikwan/cicd-demo
b6b89854fd3f15f3c2928fad7dcc3ce00a3bb7f3
c7f0e9263d069411698e1b803574f85f2e1b0a9e
refs/heads/main
2023-09-06T06:53:10.624293
2021-10-28T16:18:58
2021-10-28T16:18:58
401,412,303
1
0
null
null
null
null
UTF-8
Java
false
false
857
java
package com.acoustic.search.dto; import java.util.List; public class SearchDTOWrapper { List<SearchDTO> searchResult; int totalRecords; int pageindex; public List<SearchDTO> getSearchResult() { return searchResult; } public void setSearchResult(List<SearchDTO> searchResult) { this.searchResult = searchResult; } public int getTotalRecords() { return totalRecords; } public void setTotalRecords(int totalRecords) { this.totalRecords = totalRecords; } public int getPageindex() { return pageindex; } public void setPageindex(int pageindex) { this.pageindex = pageindex; } public SearchDTOWrapper(List<SearchDTO> searchResult, int totalRecords, int pageindex) { super(); this.searchResult = searchResult; this.totalRecords = totalRecords; this.pageindex = pageindex; } }
[ "nikhil.courser@gmail.com" ]
nikhil.courser@gmail.com
f1dc66538dbba4be961c6e19d96d03c2c876f537
98ca35dc9849870e999979e0122e1b8a15c52d39
/ResultData.java
32305877cab28a2e04a653fcb84542229042ae1c
[]
no_license
kikuchi1212/GEEK-JOB_
5e6548682799ca6c23300fd96d54e64e11a343a5
8caf807eef92ce93e59daab188122a3248d7b873
refs/heads/master
2020-12-02T22:40:06.109403
2017-09-21T08:07:40
2017-09-21T08:07:40
96,163,445
0
0
null
null
null
null
UTF-8
Java
false
false
864
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 org.mypackage.sample; import java.io.Serializable; import java.util.Date; /** * * @author guest1Day */ public class ResultData implements Serializable { private Date d; private String luck; public ResultData() { } /** * @return the d */ public Date getD() { return d; } /** * @param d the d to set */ public void SetD (Date d){ this.d = d; } /** * @return the luck */ public String getLuck(){ return luck; } /** * @param luck the luck to Set */ public void setLuck(String luck){ this.luck = luck ; }}
[ "fatedoushin@gmail.com" ]
fatedoushin@gmail.com
f7c98090b1eb50338802f89312861a42143d1325
892d5c724d5b2e8bbd46006a67d6f98a09eab22e
/src/main/java/org/facebookjpa/services/LikeServiceImpl.java
a105cb47d8a7d67620cff4598f46c0152c6ee17c
[]
no_license
adn911/FacebookSpringJpa
12411006668b456dfdb923e8d7f7502a7ca3c41a
b2296477232fe5a5919473889711fdc43405d4d3
refs/heads/master
2016-09-16T10:18:37.047181
2015-06-27T05:30:45
2015-06-27T05:30:45
38,148,335
0
0
null
null
null
null
UTF-8
Java
false
false
1,441
java
package org.facebookjpa.services; import org.facebookjpa.persistance.dao.LikeDao; import org.facebookjpa.persistance.entity.Like; import org.facebookjpa.persistance.entity.User; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import javax.transaction.Transactional; import java.util.List; /** * Created by GALIB on 4/10/2015. */ @Service @Transactional public class LikeServiceImpl implements LikeService { @Autowired LikeDao likeDao; @Override public void addLike(Like like) { likeDao.addLike(like); } @Override public void removeLike(int likeId) { likeDao.removeLike(likeId); } @Override public void removeLike(int postId, int userId) { likeDao.removeLike(postId,userId); } @Override public List<User> getLikedUsers(int postId) { return likeDao.getLikedUsers(postId); } @Override public boolean isPostLikedByUser(int postId, int userId) { return likeDao.isPostLikedByUser(postId, userId); } @Override public Like getLike(int likeId) { return null; } @Override public List<Like> getPostLikes(int postId) { return likeDao.getPostLikes(postId); } @Override public Long getLikeCount(int postId) { return likeDao.getLikeCount(postId); } }
[ "galib.adnan911@gmail.com" ]
galib.adnan911@gmail.com
7ee2aa2d66df329288298cbcbf6dfcc31a98b27d
28599f7764ac1107bacc5d1e031ec0f64ee1f73a
/Question4.java
8aaff82e4957d022eb0d362329f89c93f562b98b
[]
no_license
chaithu1995/Mantra-coding-round
7be8e34af87e0f069a632fd0fd4696f6417d4546
48473a10b378975b0f8e5bb8ccb961288e1533d2
refs/heads/main
2023-04-14T09:19:58.043963
2021-04-21T08:56:29
2021-04-21T08:56:29
360,065,578
0
0
null
null
null
null
UTF-8
Java
false
false
439
java
public class Main { public static void main(String[] args) { int rows = 5; for(int i = rows; i >= 1; --i) { for(int space = 1; space <= rows - i; ++space) { System.out.print(" "); } for(int j=i; j <= 2 * i - 1; ++j) { System.out.print("* "); } for(int j = 0; j < i - 1; ++j) { System.out.print("* "); } System.out.println(); } } }
[ "noreply@github.com" ]
noreply@github.com
1efad33f727d4579bc5d89942b555454d8a39482
c37cc036ea35489c574f0815e3735815a5daeca8
/WEB-INF/src/net/joycool/wap/action/pet/SwimAction.java
b82b646fa9e2ae8df118d4e284620e8e833ed3a6
[]
no_license
liuyang0923/joycool
ac032b616d65ecc54fae8c08ae8e6f3e9ce139d3
e7fcd943d536efe34f2c77b91dddf20844e7cab9
refs/heads/master
2020-06-12T17:14:31.104162
2016-12-09T07:15:40
2016-12-09T07:15:40
75,793,605
0
0
null
null
null
null
UTF-8
Java
false
false
19,570
java
package net.joycool.wap.action.pet; import java.util.Arrays; import java.util.Iterator; import java.util.Vector; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import net.joycool.wap.bean.NoticeBean; import net.joycool.wap.cache.util.UserBagCacheUtil; import net.joycool.wap.util.RandomUtil; import net.joycool.wap.util.StringUtil; public class SwimAction extends PetAction { public SwimAction(HttpServletRequest request) { super(request); } HttpServletResponse response ; // ///////////////////////////////////////////////////////////////////////////////////////////////////////////// // 长跑游戏的类型id public static int SWIM = 2; // 单位时间内,标准的距离 public static int LONG = 200; // 一圈的长度 public static int CIRCLELONG = 600; // 分页数 public static Integer lockswim = new Integer(5); // 游戏中设定的玩家人数 public static int SWIM_PLAYNUMBER = 5; // 分页数 public static int NUMBER_PER_PAGE = 10; // 共多少圈 public static int CIRCLENUMBER = 3; public static int TOTAL_LONG = CIRCLELONG * CIRCLENUMBER; public static String[] STAGE_SWIM = { "推进器", "高压水枪", "秤砣", "渔网","渔叉","水雷" }; public void swimming() { // 游戏场次id int id = StringUtil.toInt(request.getParameter("id")); // 游戏类型 int type = StringUtil.toInt(request.getParameter("type")); MatchRunBean matchrunbean = (MatchRunBean) matchMap[SWIM] .get(new Integer(id)); if (matchrunbean != null) { request.setAttribute("matchrunbean", matchrunbean); this.doTip("wait", "游戏中"); } else { this.doTip(null, "此游戏不存在"); } if (petUser != null) request.setAttribute("petUser", petUser); } // 游戏首页 public void swimIndex() { // 坐庄页码 int pageIndex = StringUtil.toInt(request.getParameter("pageIndex")); // 玩家页码 if (pageIndex < 0) { pageIndex = 0; } // 取得总数 int totalHallCount = matchMap[SWIM].size(); int totalHallPageCount = totalHallCount / NUMBER_PER_PAGE; if (totalHallCount % NUMBER_PER_PAGE != 0) { totalHallPageCount++; } if (pageIndex > totalHallPageCount - 1) { pageIndex = totalHallPageCount - 1; } if (pageIndex < 0) { pageIndex = 0; } Iterator iter = matchMap[SWIM].values().iterator(); int number = 0; if (totalHallCount > NUMBER_PER_PAGE) { for (int i = 0; i < totalHallCount - (pageIndex + 1) * NUMBER_PER_PAGE; i++) iter.next(); number = NUMBER_PER_PAGE; } number = totalHallCount; Vector vector = new Vector(number); int temp = 0; while (iter.hasNext()) { vector.add(iter.next()); temp++; if (pageIndex + 1 != totalHallPageCount) { if (temp >= NUMBER_PER_PAGE) break; } else { if (temp >= totalHallCount - pageIndex * NUMBER_PER_PAGE) break; } } String prefixUrl = "swimindex.jsp?type=2"; request.setAttribute("pageIndex", new Integer(pageIndex)); request.setAttribute("totalHallPageCount", new Integer( totalHallPageCount)); request.setAttribute("prefixUrl", prefixUrl); request.setAttribute("vector", vector); request.setAttribute("petUser", petUser); } // 非第一个玩家加入游戏 public void swimMatchAct() { String url = "/pet/swimming.jsp?"; // 游戏场次id int task = StringUtil.toInt(request.getParameter("task")); // 第一个宠物玩家加入游戏 if (task == 1) { if ((petUser.getHungry() < 50) || (petUser.getClear() < 50) || (petUser.getHealth() < 50)) { doTip(null, "您的宠物不符合参加比赛的条件!"); request.setAttribute("url", "/pet/swimindex.jsp"); } else if ((petUser.getMatchid() == 0) && (petUser.getMatchtype() == 0)) { // 第一个宠物玩家创立游戏 // 游戏类型 int type = StringUtil.toInt(request.getParameter("type")); if (type == 2) { // 新建一个比赛的bean MatchRunBean matchrunbean = new MatchRunBean( SWIM_PLAYNUMBER); synchronized (lockswim) { // 设定长跑比赛计数器,以及treemap的key MATCH[SWIM]++; matchrunbean.setId(MATCH[SWIM]); // 设定游戏类型 matchrunbean.setType(type); // 将宠物标记为游戏状态 petUser.setMatchid(matchrunbean.getId()); // 赛跑类型 petUser.setMatchtype(SWIM); // 将宠物放入玩家列表 matchrunbean.addPlayer(petUser); // 将比赛加入长跑比赛的map中 matchMap[SWIM].put(new Integer(matchrunbean.getId()), matchrunbean); } request.setAttribute("matchrunbean", matchrunbean); url = url + "id=" + matchrunbean.getId() + "&type=" + matchrunbean.getType(); request.setAttribute("url", url); doTip("wait", "wait"); } else doTip(null, "参数错误"); } else { doTip(null, "参数错误"); } // 非第一个宠物玩家加入游戏 } else if (task == 2) { if ((petUser.getHungry() < 50) || (petUser.getClear() < 50) || (petUser.getHealth() < 50)) { doTip(null, "您的宠物不符合参加比赛的条件!"); request.setAttribute("url", "/pet/swimindex.jsp"); } else if ((petUser.getMatchtype() == 0) && (petUser.getMatchid() == 0)) { // 游戏场次id int id = StringUtil.toInt(request.getParameter("id")); // 游戏类型 int type = StringUtil.toInt(request.getParameter("type")); synchronized (lockswim) { MatchRunBean matchrunbean = (MatchRunBean) matchMap[SWIM] .get(new Integer(id)); if (matchrunbean == null) { doTip(null, "参数错误"); } else { // 宠物加入游戏 if (matchrunbean.getCondition() != 0) { request.setAttribute("matchrunbean", matchrunbean); url = url + "id=" + matchrunbean.getId() + "&type=" + matchrunbean.getType(); request.setAttribute("url", url); } else { // 将宠物标记为游戏状态 petUser.setMatchid(matchrunbean.getId()); // 赛跑类型 petUser.setMatchtype(SWIM); // 将宠物放入玩家列表 matchrunbean.addPlayer(petUser); // 判断是否开始游戏 if (matchrunbean.getPeoplenumber() == SWIM_PLAYNUMBER) { // 开始游戏 this.doTip("wait", "游戏中"); swimStartGame(matchrunbean, loginUser.getId()); } else this.doTip("wait", "等待中"); request.setAttribute("matchrunbean", matchrunbean); url = url + "id=" + matchrunbean.getId() + "&type=" + matchrunbean.getType(); request.setAttribute("url", url); } } } } else { doTip(null, "只能同時參加一項比賽"); } // 退出游戏 } else if (task == 3) { int id = StringUtil.toInt(request.getParameter("return")); // 退出游戏 if ((id != -1) && (petUser.getMatchtype() != 0) && (petUser.getMatchid() != 0)) { // 删除比赛中的数据 synchronized (lockswim) { MatchRunBean matchrunbean = (MatchRunBean) matchMap[SWIM] .get(new Integer(petUser.getMatchid())); if (matchrunbean != null) { if (matchrunbean.getCondition() == 0) { matchrunbean.exitPlayer(petUser); // 等待游戏的宠物玩家数量为零时,删除比赛数据 if (matchrunbean.getPeoplenumber() <= 0) matchMap[SWIM].remove(new Integer(matchrunbean .getId())); // 删除宠物bean中的游戏状态 petUser.setMatchid(0); petUser.setMatchtype(0); } else if (matchrunbean.getCondition() == 2) { petUser.setMatchid(0); petUser.setMatchtype(0); } request.setAttribute("url", "/pet/swimindex.jsp"); } else { doTip(null, "参数错误"); } } } // 使用道具 } else if (task == 4) { // 使用道具 if ((petUser.getMatchtype() != 0) && (petUser.getMatchid() != 0)) { MatchRunBean matchrunbean = (MatchRunBean) matchMap[SWIM] .get(new Integer(petUser.getMatchid())); if ((matchrunbean != null) && (matchrunbean.getCondition() == 1)) { PlayerBean[] playbean = matchrunbean.getPlayer(); // 取得是第几名使用道具 int order = 0; for (order = 0; order < SWIM_PLAYNUMBER; order++) if ((playbean[order] != null) && (playbean[order].getPetid() == petUser .getId())) break; // 如果本人已经过终点线,道具无效 if (playbean[order].getPosition() < TOTAL_LONG) { int item = playbean[order].getStage()[0]; // 正使用的道具 if (item == 1) { // 加速器 // 给自己加50米 playbean[order].setPosition(playbean[order] .getPosition() + 40); matchrunbean.addLog(StringUtil .toWml(playbean[order].getName()) + "在屁股上装了个推进器,嘟嘟嘟嘟冲向前方!"); // 给第一的人减30米 // 此人不是第一名 } else if (item == 2 && order > 0 && playbean[0].getPosition() < TOTAL_LONG) { playbean[0] .setPosition(playbean[0].getPosition() - 30); matchrunbean.addLog(StringUtil .toWml(playbean[order].getName()) + "用水枪把" + StringUtil.toWml(playbean[0].getName()) + "喷得晕头转向,慢了。"); // 给前边的人减60米 // 此人不是第一名 } else if (item == 3 && order > 0 && playbean[order - 1].getPosition() < TOTAL_LONG) { // 判断是否有防弹衣道具 int temp = UserBagCacheUtil.getUserBagById(18, playbean[order - 1].getUserid()); if (temp > 0 && (RandomUtil.percentRandom(STAGE_PROBABILITY))) { // 删除道具 UserBagCacheUtil.UseUserBagCacheById( playbean[order - 1].getUserid(), temp); matchrunbean.addLog(StringUtil.toWml(StringUtil .toWml(playbean[order - 1].getName())) + "的主人给它穿了防弹衣,秤砣失效了!"); } else { playbean[order - 1] .setPosition(playbean[order - 1] .getPosition() - 40); matchrunbean.addLog(StringUtil .toWml(playbean[order].getName()) + "悄悄把一个秤砣系到" + StringUtil.toWml(playbean[order - 1] .getName()) + "腿上,让它沉了下去。"); } } else if (item == 4 && order > 0) { //使用鱼网 int orderPosi = playbean[order].getPosition(); for (int i = 0; i < order; i++) { int posi = playbean[i].getPosition()- orderPosi; if (posi <= 100 && posi >=50 && playbean[i].getPosition() < TOTAL_LONG) { playbean[i].setPosition(playbean[i].getPosition() - 50); } } matchrunbean.addLog(StringUtil.toWml(playbean[order].getName()) + "撒出鱼网,网住了前面在中路游的好几个家伙!"); } else if (item == 5) { //使用鱼叉 int sid = StringUtil.toInt(request.getParameter("id")); if(sid>=0 && sid < SWIM_PLAYNUMBER && playbean[sid].getPosition() < TOTAL_LONG) { playbean[sid].setPosition(playbean[sid].getPosition()-30); matchrunbean.addLog(StringUtil.toWml(playbean[order].getName())+"发射渔叉把" + StringUtil.toWml(playbean[sid] .getName()) + "钉在了水底!"); } else if(sid == -1){ doTip("send", "send"); String url1 = "/pet/player.jsp?id="+ matchrunbean.getId() + "&type=" + matchrunbean.getType(); request.setAttribute("url",url1); return; } } else if (item == 6 && order < SWIM_PLAYNUMBER-1 && playbean[order+1].getPosition() < TOTAL_LONG) { // //使用水雷 playbean[order+1].setPosition(playbean[order+1].getPosition() - 30); matchrunbean.addLog(StringUtil.toWml(playbean[order+1].getName()) + "在中路游撞上了水雷,被炸沉了"); } else { this.doTip(null, "参数错误"); } } playbean[order].changeStage(); this.doTip("wait", "游戏中"); request.setAttribute("matchrunbean", matchrunbean); url = url + "id=" + matchrunbean.getId() + "&type=" + matchrunbean.getType(); request.setAttribute("url", url); } else this.doTip(null, "参数错误"); } } request.setAttribute("petUser", petUser); } // 游戏开始前要做的事 public void swimStartGame(MatchRunBean matchrunbean, int id) { MatchEventBean matchEventBean; MatchFactorBean factorBean; PetUserBean petBean; float change = 0; int temp = 0; // 开始游戏 PlayerBean[] playbean = matchrunbean.getPlayer(); // 计算因子 factorBean = server.getFactor("id =" + matchrunbean.getType()); for (int j = 0; j < playbean.length; j++) { // 取得宠物id // petBean = (PetUserBean) userMap.get(new Integer(playbean[j] // .getPetid())); // if (petBean == null) petBean = load(0, playbean[j].getPetid()); if (petBean != null) { // 加入消息系统,如果是最后进入游戏那个玩家的话,就不发信息 if (petBean.getUser_id() != id) { NoticeBean notice = new NoticeBean(); notice.setTitle(petBean.getName() + "开始比赛了,快去看吧"); notice.setType(NoticeBean.GENERAL_NOTICE); notice.setUserId(petBean.getUser_id()); notice.setHideUrl("/pet/swimindex.jsp"); notice.setLink("/pet/swimming.jsp?id=" + matchrunbean.getId() + "&type=" + matchrunbean.getType()); // liq_2007-7-16_增加宠物消息类型_start notice.setMark(NoticeBean.PET); // liq_2007-7-16_增加宠物消息类型_end noticeService.addNotice(notice); } // 属性因子发生作用 playbean[j].setFactor(factor(petBean, factorBean)); // 饥饿减少10 petBean.setHungry(petBean.getHungry() - 10); server.updateUser(" hungry =" + petBean.getHungry(), "id = " + petBean.getId()); } } matchrunbean.setCondition(1); } // 计算因子 public static int factor(PetUserBean petBean, MatchFactorBean factorBean) { int x = (int) (petBean.getHealth() * (factorBean.getAl() * Math.sqrt(petBean.getAgile()) + factorBean.getIn() * Math.sqrt(petBean.getIntel()) + factorBean .getSt() * Math.sqrt(petBean.getStrength())) / 100); return x; } /** * * @author liq * @explain, * @datetime:2007-6-5 11:29:34 * @return void */ public static void swimtask() { MatchFactorBean factorBean; String log; Vector eventList; MatchEventBean matchEventBean; PetUserBean petBean = new PetUserBean(); float change = 0; int factor = 0; Iterator iter = matchMap[SWIM].values().iterator(); while (iter.hasNext()) { MatchRunBean matchrunbean = (MatchRunBean) iter.next(); if (matchrunbean.getCondition() == 0) { // 建立后等待中 } else if (matchrunbean.getCondition() == 1) { // 取得随机时间列表 eventList = server.getMatchEventList("gameid =" + matchrunbean.getType()); // 游戏过程中 PlayerBean[] playbean = matchrunbean.getPlayer(); for (int i = 0; i < SWIM_PLAYNUMBER; i++) { if (playbean[i].getPosition() < TOTAL_LONG) { // //////////////////////////////////////////////////////////////////////////////////////////////////// // 宠物属性因子发生作用 // 取得宠物id petBean = (PetUserBean) userMap.get(new Integer( playbean[i].getPetid())); if(petBean == null) continue; if (playbean[i].getFactor() > 0) factor = RandomUtil .nextInt(playbean[i].getFactor()); change = LONG; // ///////////////////////////////////////////////////////////////////////////////////////////////// // 发生了随机事件 if (RandomUtil .percentRandom(MatchEventBean.PROBABILITY)) { // 取得随机事件 // 取得具体的事件 matchEventBean = (MatchEventBean) eventList .get(RandomUtil.nextInt(eventList.size())); // 事件对长跑成绩发生影响 change = change + change * matchEventBean.getFactor(); // 将发生的时间记录对应比赛的log中,在页面上显示 log = matchEventBean.getDescription().replace( "@", StringUtil.toWml(petBean.getName())); matchrunbean.addLog(log); } else { // 没有发生随机事件 } // ///////////////////////////////////////////////////////////////////////////////////////////////// // 总距离加上单位时间内的距离 以及属性因子的影响 playbean[i].setPosition(playbean[i].getPosition() + (int) change + factor); if (playbean[i].getPosition() >= TOTAL_LONG) { matchrunbean.addLog(StringUtil.toWml(petBean .getName()) + "已经游过了终点线"); } } else { // 过终点后每圈加10000 playbean[i] .setPosition(playbean[i].getPosition() + 10000); } factor = 0; } // ///////////////////////////////////////////////////////////////////////////////////////////////// // 根据宠物的位置排序 0-8对应第一到第八 Arrays.sort(playbean); // 比赛结束,判断排名倒地一的人是否跑完 if (TOTAL_LONG <= playbean[playbean.length - 1].getPosition()) { matchrunbean.setCondition(2); for (int j = 0; j < playbean.length; j++) { // 取得宠物id petBean = (PetUserBean) userMap.get(new Integer( playbean[j].getPetid())); // 比赛结束,取消标记,可以参加新的 比赛了 if(petBean == null) continue; petBean.setMatchid(0); petBean.setMatchtype(0); // 加入消息系统 NoticeBean notice = new NoticeBean(); notice.setTitle(petBean.getName() + "取得了第" + (j + 1) + "名,快去看吧"); notice.setType(NoticeBean.GENERAL_NOTICE); notice.setUserId(petBean.getUser_id()); notice.setHideUrl("/pet/swimindex.jsp"); notice.setLink("/pet/swimming.jsp?task=4&id=" + matchrunbean.getId() + "&type=" + matchrunbean.getType()); // liq_2007-7-16_增加宠物消息类型_start notice.setMark(NoticeBean.PET); // liq_2007-7-16_增加宠物消息类型_end noticeService.addNotice(notice); if (j == 0) { // 根据成绩给玩家加积分 petBean.setExp(petBean.getExp() + 50); } else if (j == 1) { petBean.setExp(petBean.getExp() + 45); } else if (j == 2) { petBean.setExp(petBean.getExp() + 40); } else if (j == 3) { petBean.setExp(petBean.getExp() + 35); } else if (j == 4) { petBean.setExp(petBean.getExp() + 30); } // 更新数据库 server.updateUser(" exp =" + petBean.getExp() + ",rank =" + petBean.getRank() + ",spot=" + petBean.getSpot(), "id = " + petBean.getId()); } } // 道具,每圈8个人中挑两个给道具,道具随机 // 产生中奖的宠物 playbean[0].inputStage(RandomUtil.randomRateInt(randomRate, randomTotal) + 1); for(int i = 1;i < SWIM_PLAYNUMBER;i++) { playbean[i].inputStage(RandomUtil.randomRateInt(randomRate2, randomTotal2) + 1); } } else { // 结束后 } } } protected static int randomRate[] = {10,0,0,0,10,10}; // 除了第一名的道具出现几率 protected static int randomRate2[] = {10,4,10,10,10,0}; // 第一名的道具出现几率 protected static int randomTotal; protected static int randomTotal2; static { randomTotal = RandomUtil.sumRate(randomRate); randomTotal2 = RandomUtil.sumRate(randomRate2); } }
[ "liu_yang_0923@163.com" ]
liu_yang_0923@163.com
c760889e1fbdfb3f418c027abc389af1da32fdb4
e1fba8a6a1e1cc24c88fe2c67e260034ed4bd87d
/app/src/main/java/com/deepti/amifit/Settings/ReminderSettingsFragment.java
778d6d4c187d66a97dfc603dbfe2c845b3736dfe
[]
no_license
deeptid/AmIFit
8a057465e7791c961306d898c9e3306f89ab0b40
aaa82bf72805300e48da86de2add6330786eb49f
refs/heads/master
2021-01-20T16:12:00.171908
2017-05-10T06:13:12
2017-05-10T06:17:45
90,826,270
0
0
null
null
null
null
UTF-8
Java
false
false
23,300
java
package com.deepti.amifit.Settings; import android.app.AlarmManager; import android.app.DialogFragment; import android.app.FragmentManager; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.net.Uri; import android.os.Bundle; import android.preference.EditTextPreference; import android.preference.ListPreference; import android.preference.Preference; import android.preference.PreferenceCategory; import android.preference.PreferenceFragment; import android.preference.PreferenceManager; import android.preference.PreferenceScreen; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import com.deepti.amifit.AlarmReceiver; import com.deepti.amifit.MainActivity; import com.deepti.amifit.R; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.Map; import static android.content.Context.ALARM_SERVICE; /** * Created by deepti on 12/02/17. */ public class ReminderSettingsFragment extends PreferenceFragment implements SharedPreferences.OnSharedPreferenceChangeListener { public static String TAG = ReminderSettingsFragment.class.getSimpleName(); public Context context; SharedPreferences sharedPreferences; ReminderSettings reminderSettings; int ALARM_STEP_REQUEST = 0; int ALARM_WORKOUT_REQUEST = 1; int ALARM_WEIGHT_REQUEST = 2; int ALARM_WALK_REQUEST = 3; int ALARM_WATER_REQUEST = 4; public ReminderSettingsFragment() { } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.reminder_preferences); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { SharedPreferences rprefs = getActivity().getSharedPreferences("reminder_preferences", getActivity().MODE_PRIVATE); reminderSettings = new ReminderSettings(getActivity(), rprefs); View view = super.onCreateView(inflater, container, savedInstanceState); view.setBackgroundColor(getResources().getColor(android.R.color.white)); final TimePreference timePreference = (TimePreference) findPreference("time_steps_key"); final PreferenceScreen stepsPref = (PreferenceScreen) findPreference("steps_settings"); Context hostActivity = getActivity(); final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(hostActivity); String time = getFormattedTime(prefs.getString("time_steps_key", "disabled")); timePreference.setSummary(time); stepsPref.setSummary(time); final TimePreference timePreference2 = (TimePreference) findPreference("time_workout_key"); final PreferenceScreen workoutPref = (PreferenceScreen) findPreference("workout_settings"); String time1 = getFormattedTime(prefs.getString("time_workout_key", "disabled")); timePreference2.setSummary(time1); workoutPref.setSummary(time1); final TimePreference timePreference3 = (TimePreference) findPreference("time_weight_key"); final PreferenceScreen weightPref = (PreferenceScreen) findPreference("weight_settings"); String time2 = getFormattedTime(prefs.getString("time_weight_key", "disabled")); timePreference3.setSummary(time2); weightPref.setSummary(time2); final ListPreference timePreference4 = (ListPreference) findPreference("time_walk_key"); final PreferenceScreen walkPref = (PreferenceScreen) findPreference("walk_settings"); String time3 = (prefs.getString("time_walk_key", "disabled")); timePreference4.setSummary(time3); walkPref.setSummary(time3); final ListPreference timePreference5 = (ListPreference) findPreference("time_water_key"); final PreferenceScreen waterPref = (PreferenceScreen) findPreference("water_settings"); String time4 = (prefs.getString("time_water_key", "disabled")); timePreference5.setSummary(time4); waterPref.setSummary(time4); return view; } private String getFormattedTime(String s) { String time = s; String result = null; // fix: not correctly formatting 12:00 - 12:59 pm DateFormat outputFormat = new SimpleDateFormat("hh:mm aa"); SimpleDateFormat parseFormat = new SimpleDateFormat("HH:mm"); try { Date dt = parseFormat.parse(time); result = outputFormat.format(dt); } catch (ParseException exc) { exc.printStackTrace(); } return result; } @Override public void onResume() { super.onResume(); sharedPreferences = getPreferenceManager().getSharedPreferences(); // we want to watch the preference values' changes sharedPreferences.registerOnSharedPreferenceChangeListener(this); final TimePreference timePreference = (TimePreference) findPreference("time_steps_key"); final PreferenceScreen stepsPref = (PreferenceScreen) findPreference("steps_settings"); Context hostActivity = getActivity(); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(hostActivity); String time = getFormattedTime(prefs.getString("time_steps_key", "")); timePreference.setSummary(time); stepsPref.setSummary(time); // } } @Override public void onPause() { sharedPreferences.unregisterOnSharedPreferenceChangeListener(this); super.onPause(); } @Override public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { SharedPreferences.Editor prefs = getActivity().getSharedPreferences("reminder_preferences", getActivity().MODE_PRIVATE).edit(); String prefValue; switch (key) { case "time_steps_key": prefValue = sharedPreferences.getString(key, ""); // Set summary to be the user-description for the selected value final TimePreference timePreference = (TimePreference) findPreference("time_steps_key"); final PreferenceScreen stepsPref = (PreferenceScreen) findPreference("steps_settings"); //set summary String time = getFormattedTime(sharedPreferences.getString(key, "")); stepsPref.setSummary(time); timePreference.setSummary(time); ((BaseAdapter) getPreferenceScreen().getRootAdapter()).notifyDataSetChanged(); //commit in shared preference prefs.putString("steps_settings", prefValue); prefs.putString("time_steps_key", prefValue); prefs.commit(); // set alarm setReminder("steps", reminderSettings.getStepsReminderText(), prefValue, ALARM_STEP_REQUEST); break; case "steps_reminder_title": prefValue = sharedPreferences.getString(key, ""); //commit in shared preference prefs.putString("steps_reminder_title", prefValue); prefs.commit(); final EditTextPreference edt = (EditTextPreference) findPreference("steps_reminder_title"); edt.setSummary(prefValue); break; case "pref_steps_enable": Boolean prefStepsEnable = sharedPreferences.getBoolean(key, false); if (!prefStepsEnable) { //cancel related pendingintent final TimePreference tp2 = (TimePreference) findPreference("time_steps_key"); final PreferenceScreen sp2 = (PreferenceScreen) findPreference("steps_settings"); //set summary tp2.setSummary(""); sp2.setSummary(""); ((BaseAdapter) getPreferenceScreen().getRootAdapter()).notifyDataSetChanged(); cancelReminder(ALARM_STEP_REQUEST); } else { //set Alarm setReminder("steps", reminderSettings.getWeightReminderText(), "10:00", ALARM_STEP_REQUEST); } //commit in shared preference prefs.putBoolean("pref_steps_enable", prefStepsEnable); prefs.commit(); break; //workout case "time_workout_key": prefValue = sharedPreferences.getString(key, ""); final TimePreference timePreference1 = (TimePreference) findPreference("time_workout_key"); final PreferenceScreen workoutPref = (PreferenceScreen) findPreference("workout_settings"); //set summary String time1 = getFormattedTime(sharedPreferences.getString(key, "")); workoutPref.setSummary(time1); timePreference1.setSummary(time1); ((BaseAdapter) getPreferenceScreen().getRootAdapter()).notifyDataSetChanged(); //commit in shared preference prefs.putString("workout_settings", prefValue); prefs.putString("time_workout_key", prefValue); prefs.commit(); // set alarm setReminder("workout", reminderSettings.getWorkoutReminderText(), prefValue, ALARM_WORKOUT_REQUEST); break; case "workout_reminder_title": prefValue = sharedPreferences.getString(key, ""); prefs.putString("workout_reminder_title", prefValue); prefs.commit(); final EditTextPreference edt1 = (EditTextPreference) findPreference("workout_reminder_title"); edt1.setSummary(prefValue); break; case "pref_workout_enable": Boolean prefWorkoutEnable = sharedPreferences.getBoolean(key, false); prefs.putBoolean("pref_workout_enable", prefWorkoutEnable); prefs.commit(); if (!prefWorkoutEnable) { //cancel related pendingintent final TimePreference tp3 = (TimePreference) findPreference("time_workout_key"); final PreferenceScreen wp3 = (PreferenceScreen) findPreference("workout_settings"); //set summary wp3.setSummary(""); tp3.setSummary(""); ((BaseAdapter) getPreferenceScreen().getRootAdapter()).notifyDataSetChanged(); cancelReminder(ALARM_WORKOUT_REQUEST); } else { //set Alarm setReminder("workout", reminderSettings.getWeightReminderText(), "10:00", ALARM_WORKOUT_REQUEST); } break; //weight case "time_weight_key": prefValue = sharedPreferences.getString(key, ""); final TimePreference timePreference2 = (TimePreference) findPreference("time_weight_key"); final PreferenceScreen weightPref = (PreferenceScreen) findPreference("weight_settings"); //set summary String time2 = getFormattedTime(sharedPreferences.getString(key, "")); weightPref.setSummary(time2); timePreference2.setSummary(time2); ((BaseAdapter) getPreferenceScreen().getRootAdapter()).notifyDataSetChanged(); //commit in shared preference prefs.putString("weight_settings", prefValue); prefs.putString("time_weight_key", prefValue); prefs.commit(); // set alarm setReminder("weight", reminderSettings.getWeightReminderText(), prefValue, ALARM_WEIGHT_REQUEST); break; case "weight_reminder_title": prefValue = sharedPreferences.getString(key, ""); prefs.putString("weight_reminder_title", prefValue); prefs.commit(); final EditTextPreference edt2 = (EditTextPreference) findPreference("weight_reminder_title"); edt2.setSummary(prefValue); break; case "pref_weight_enable": Boolean prefWeightEnable = sharedPreferences.getBoolean(key, false); if (!prefWeightEnable) { //cancel related pendingintent final TimePreference tp4 = (TimePreference) findPreference("time_weight_key"); final PreferenceScreen wp4 = (PreferenceScreen) findPreference("weight_settings"); //set summary wp4.setSummary(""); tp4.setSummary(""); ((BaseAdapter) getPreferenceScreen().getRootAdapter()).notifyDataSetChanged(); cancelReminder(ALARM_WEIGHT_REQUEST); } else { //set Alarm setReminder("weight", reminderSettings.getWeightReminderText(), "10:00", ALARM_WEIGHT_REQUEST); } prefs.putBoolean(" pref_weight_enable", prefWeightEnable); prefs.commit(); break; //workout case "time_walk_key": prefValue = sharedPreferences.getString(key, ""); final ListPreference timePreference3 = (ListPreference) findPreference("time_walk_key"); final PreferenceScreen walkPref = (PreferenceScreen) findPreference("walk_settings"); //set summary walkPref.setSummary(prefValue); timePreference3.setSummary(prefValue); ((BaseAdapter) getPreferenceScreen().getRootAdapter()).notifyDataSetChanged(); //commit in shared preference prefs.putString("walk_settings", prefValue); prefs.putString("time_walk_key", prefValue); prefs.commit(); // set alarm setRepeatReminder("walk", reminderSettings.getWalkReminderText(), prefValue); break; case "walk_reminder_title": prefValue = sharedPreferences.getString(key, ""); prefs.putString("walk_reminder_title", prefValue); prefs.commit(); final EditTextPreference edt3 = (EditTextPreference) findPreference("walk_reminder_title"); edt3.setSummary(prefValue); break; case "pref_walk_enable": Boolean prefWalkEnable = sharedPreferences.getBoolean(key, false); if (!prefWalkEnable) { final ListPreference tp = (ListPreference) findPreference("time_walk_key"); final PreferenceScreen wp = (PreferenceScreen) findPreference("walk_settings"); wp.setSummary(""); tp.setSummary(""); ((BaseAdapter) getPreferenceScreen().getRootAdapter()).notifyDataSetChanged(); cancelRepeatReminder("walk"); } else { //set Alarm setRepeatReminder("water", reminderSettings.getWaterReminderText(), "Every 1 hour"); } prefs.putBoolean("pref_walk_enable", prefWalkEnable); prefs.commit(); break; //water case "time_water_key": prefValue = sharedPreferences.getString(key, ""); final ListPreference timePreference4 = (ListPreference) findPreference("time_water_key"); final PreferenceScreen waterPref = (PreferenceScreen) findPreference("water_settings"); //set summary waterPref.setSummary(prefValue); timePreference4.setSummary(prefValue); ((BaseAdapter) getPreferenceScreen().getRootAdapter()).notifyDataSetChanged(); //commit in shared preference prefs.putString("water_settings", prefValue); prefs.putString("time_water_key", prefValue); prefs.commit(); // set alarm setRepeatReminder("water", reminderSettings.getWaterReminderText(), prefValue); break; case "water_reminder_title": prefValue = sharedPreferences.getString(key, ""); prefs.putString("water_reminder_title", prefValue); prefs.commit(); final EditTextPreference edt4 = (EditTextPreference) findPreference("water_reminder_title"); edt4.setSummary(prefValue); break; case "pref_water_enable": Boolean prefWaterEnable = sharedPreferences.getBoolean(key, false); // if prefWaterEnable is false cancel related pendingintent // if prefWaterEnable is true set the alarm for the default time if (!prefWaterEnable) { //cancel related pendingintent final ListPreference tp1 = (ListPreference) findPreference("time_water_key"); final PreferenceScreen wp1 = (PreferenceScreen) findPreference("water_settings"); //set summary tp1.setSummary(""); wp1.setSummary(""); ((BaseAdapter) getPreferenceScreen().getRootAdapter()).notifyDataSetChanged(); cancelRepeatReminder("water"); } else { //set Alarm setRepeatReminder("water", reminderSettings.getWaterReminderText(), "Every 1 hour"); } prefs.putBoolean("pref_water_enable", prefWaterEnable); prefs.commit(); break; } } private void setReminder(String reminderType, String reminderDesc, String alarmTime, int requestCode) { String[] s = alarmTime.split(":"); AlarmManager alarmManager = (AlarmManager) getActivity().getSystemService(ALARM_SERVICE); Intent alarmIntent = new Intent(getActivity(), AlarmReceiver.class); // AlarmReceiver1 = broadcast receiver Bundle bundle = new Bundle(); bundle.putString("desc", reminderDesc); bundle.putString("reminderType", reminderType); alarmIntent.putExtras(bundle); PendingIntent pendingIntent = PendingIntent.getBroadcast(getActivity(), requestCode, alarmIntent, PendingIntent.FLAG_UPDATE_CURRENT); alarmIntent.setData((Uri.parse("custom://" + System.currentTimeMillis()))); alarmManager.cancel(pendingIntent); Calendar alarmStartTime = Calendar.getInstance(); Calendar now = Calendar.getInstance(); alarmStartTime.set(Calendar.HOUR_OF_DAY, Integer.parseInt(s[0])); alarmStartTime.set(Calendar.MINUTE, Integer.parseInt(s[1])); alarmStartTime.set(Calendar.SECOND, 0); if (now.after(alarmStartTime)) { Log.d("Hey", "Added a day"); alarmStartTime.add(Calendar.DATE, 1); } alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, alarmStartTime.getTimeInMillis(), AlarmManager.INTERVAL_DAY, pendingIntent); Log.d("Alarm", "Alarm is set for everyday:" + Integer.parseInt(s[0]) + ":" + s[1]); } private void cancelReminder(int requestCode) { AlarmManager alarmManager = (AlarmManager) getActivity().getSystemService(ALARM_SERVICE); Intent alarmIntent = new Intent(getActivity(), AlarmReceiver.class); // AlarmReceiver1 = broadcast receiver PendingIntent pendingIntent = PendingIntent.getBroadcast(getActivity(), requestCode, alarmIntent, PendingIntent.FLAG_UPDATE_CURRENT); alarmManager.cancel(pendingIntent); } private void setRepeatReminder(String reminderType, String reminderDesc, String alarmTime) { Log.d(TAG, "reminderDesc: " + reminderDesc); int addFactor = 0; if (reminderType.equals("water")) { addFactor = 100; } if (reminderType.equals("walk")) { addFactor = 200; } AlarmManager alarmManager = (AlarmManager) getActivity().getSystemService(ALARM_SERVICE); ArrayList<PendingIntent> intentArray = new ArrayList<PendingIntent>(); Calendar now = Calendar.getInstance(); int alarmInterval = 1; switch (alarmTime) { case "Every 1 hour": alarmInterval = 1; break; case "Every 2 hour": alarmInterval = 2; break; case "Every 3 hour": alarmInterval = 3; break; case "Every 4 hour": alarmInterval = 4; break; } for (int i = 9; i < 23; i = i + alarmInterval) { Intent intent = new Intent(getActivity(), AlarmReceiver.class); Bundle bundle = new Bundle(); bundle.putString("desc", reminderDesc); bundle.putString("reminderType", reminderType); intent.putExtras(bundle); // Loop counter `i` is used as a `requestCode` PendingIntent pendingIntent = PendingIntent.getBroadcast(getActivity(), i + addFactor, intent, 0); alarmManager.cancel(pendingIntent); Calendar alarmStartTime = Calendar.getInstance(); alarmStartTime.set(Calendar.HOUR_OF_DAY, i); alarmStartTime.set(Calendar.MINUTE, 0); alarmStartTime.set(Calendar.SECOND, 0); if (now.after(alarmStartTime)) { Log.d("Hey", "Added a day"); alarmStartTime.add(Calendar.DATE, 1); } // alarmManager.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, // alarmStartTime.getTimeInMillis(), // pendingIntent); alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, alarmStartTime.getTimeInMillis(), AlarmManager.INTERVAL_DAY, pendingIntent); Log.d("Alarm", "Alarm is set for everyday:" + i + ":0"); intentArray.add(pendingIntent); } } private void cancelRepeatReminder(String reminderType) { int addFactor = 0; if (reminderType.equals("water")) { addFactor = 100; } if (reminderType.equals("walk")) { addFactor = 200; } int alarmInterval = 1; for (int j = 1; j < 5; j++) for (int i = 9; i < 23; i = i + j) { Intent intent = new Intent(getActivity(), AlarmReceiver.class); AlarmManager alarmManager = (AlarmManager) getActivity().getSystemService(ALARM_SERVICE); PendingIntent pendingIntent = PendingIntent.getBroadcast(getActivity(), i + addFactor, intent, 0); alarmManager.cancel(pendingIntent); } } private void updateSummary(EditTextPreference preference) { preference.setSummary(preference.getText()); } }
[ "deeptidohare@gmail.com" ]
deeptidohare@gmail.com
2c29ca2b6ed5a61f04a0ad1d532bf29052255ecb
2751b9c693a1d498043070baef29e34a79933d72
/XYZReader/src/main/java/com/example/xyzreader/data/UpdaterService.java
935208318809d5d98db8f48c74301f2401d86fd2
[]
no_license
marcinbak/xyzreader
4390264adb40d312603249bf73f1ec4195b83d59
83abe6ac445646e0bc959a32e969314782e73faa
refs/heads/master
2021-04-30T16:08:27.474641
2017-02-10T08:34:29
2017-02-10T08:34:29
79,964,565
0
0
null
null
null
null
UTF-8
Java
false
false
3,185
java
package com.example.xyzreader.data; import android.app.IntentService; import android.content.ContentProviderOperation; import android.content.ContentValues; import android.content.Intent; import android.content.OperationApplicationException; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.net.Uri; import android.os.RemoteException; import android.text.format.Time; import android.util.Log; import com.example.xyzreader.remote.RemoteEndpointUtil; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.util.ArrayList; public class UpdaterService extends IntentService { private static final String TAG = "UpdaterService"; public static final String BROADCAST_ACTION_STATE_CHANGE = "com.example.xyzreader.intent.action.STATE_CHANGE"; public static final String EXTRA_REFRESHING = "com.example.xyzreader.intent.extra.REFRESHING"; public UpdaterService() { super(TAG); } @Override protected void onHandleIntent(Intent intent) { Time time = new Time(); ConnectivityManager cm = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE); NetworkInfo ni = cm.getActiveNetworkInfo(); if (ni == null || !ni.isConnected()) { Log.w(TAG, "Not online, not refreshing."); return; } sendStickyBroadcast( new Intent(BROADCAST_ACTION_STATE_CHANGE).putExtra(EXTRA_REFRESHING, true)); // Don't even inspect the intent, we only do one thing, and that's fetch content. ArrayList<ContentProviderOperation> cpo = new ArrayList<ContentProviderOperation>(); Uri dirUri = ItemsContract.Items.buildDirUri(); // Delete all items cpo.add(ContentProviderOperation.newDelete(dirUri).build()); try { JSONArray array = RemoteEndpointUtil.fetchJsonArray(); if (array == null) { throw new JSONException("Invalid parsed item array"); } for (int i = 0; i < array.length(); i++) { ContentValues values = new ContentValues(); JSONObject object = array.getJSONObject(i); values.put(ItemsContract.Items.SERVER_ID, object.getString("id")); values.put(ItemsContract.Items.AUTHOR, object.getString("author")); values.put(ItemsContract.Items.TITLE, object.getString("title")); values.put(ItemsContract.Items.BODY, object.getString("body")); values.put(ItemsContract.Items.THUMB_URL, object.getString("thumb")); values.put(ItemsContract.Items.PHOTO_URL, object.getString("photo")); values.put(ItemsContract.Items.ASPECT_RATIO, object.getString("aspect_ratio")); time.parse3339(object.getString("published_date")); values.put(ItemsContract.Items.PUBLISHED_DATE, time.toMillis(false)); cpo.add(ContentProviderOperation.newInsert(dirUri).withValues(values).build()); } getContentResolver().applyBatch(ItemsContract.CONTENT_AUTHORITY, cpo); } catch (JSONException | RemoteException | OperationApplicationException e) { Log.e(TAG, "Error updating content.", e); } sendStickyBroadcast( new Intent(BROADCAST_ACTION_STATE_CHANGE).putExtra(EXTRA_REFRESHING, false)); } }
[ "marcin.bak@neofonie.de" ]
marcin.bak@neofonie.de
aa59ab6bc6c32d34524faa88d4648f8c73ea9f6b
e6d7727f309768b5987bc3976f9a4f60c79833a2
/CEP/src/main/java/stream/ParseStockStreamConfig.java
7226b13800179fb8289ab57d9fe270f790592334
[ "Apache-2.0" ]
permissive
aqifhamid786/briskstream
2eab0b2c5789b1978c5bffb8e821dbf1a21e30d2
05c591f6df59c6e06797c58eb431a52d160bc724
refs/heads/master
2023-05-09T21:53:46.263197
2019-06-23T15:24:44
2019-06-23T15:24:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,381
java
/* * Copyright (c) 2011, Regents of the University of Massachusetts Amherst * All rights reserved. * Redistribution and use in source and binary forms, with or without modification, are permitted * provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, this list of conditions * and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, this list of conditions * and the following disclaimer in the documentation and/or other materials provided with the distribution. * * Neither the name of the University of Massachusetts Amherst nor the names of its contributors * may be used to endorse or promote products derived from this software without specific prior written * permission. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package stream; import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.StringTokenizer; /** * This class reads the configuration file for the input stream. * @author haopeng * */ /** * Constructor */ public class ParseStockStreamConfig { public static void parseStockEventConfig(String configFile) throws IOException{ BufferedReader br = new BufferedReader(new FileReader(configFile)); String line; while(!(line = br.readLine()).equalsIgnoreCase("end")){ parseLine(line); } } /** * Parses a line in the configuration file * @param line The input line */ public static void parseLine(String line){ StringTokenizer st = new StringTokenizer(line, "="); String attribute = st.nextToken(); String v = st.nextToken(); int value = Integer.parseInt(v.trim()); setAttributeRange(attribute, value); } /** * Sets the attribute range for an attribute * @param attribute The attribute to be set * @param value The maximu value to be set */ public static void setAttributeRange(String attribute, int value){ if(attribute.trim().equalsIgnoreCase("streamSize")){ StockStreamConfig.streamSize = value; }else if(attribute.trim().equalsIgnoreCase("maxPrice")){ StockStreamConfig.maxPrice = value; }else if(attribute.trim().equalsIgnoreCase("numOfSymbol")){ StockStreamConfig.numOfSymbol = value; }else if(attribute.trim().equals("maxVolume")){ StockStreamConfig.maxVolume = value; }else if(attribute.trim().equalsIgnoreCase("randomSeed")){ StockStreamConfig.randomSeed = value; }else if(attribute.trim().equalsIgnoreCase("increaseProbability")){ StockStreamConfig.increaseProbability = value; } } }
[ "IDSZS@nus.edu.sg" ]
IDSZS@nus.edu.sg
95fb5cade5df57e07b4738a3eff9a333c1d7d110
83c05727c1e4359a92318603aa4a821ec6c4bff8
/src/main/java/sg/com/hackerrankproblems/plusMinus.java
d186e7e34a88df30dd17f6243d8f0139e8ff4fd1
[]
no_license
KamiNahar/hacker-rank-java
a839b6d0b7a4c718b3f10f2497e2d7e0cc1dc295
500e6bbcb014701bf25919a465c62c6fed62e9aa
refs/heads/master
2022-07-08T00:18:38.559612
2020-05-13T21:33:13
2020-05-13T21:33:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,959
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 sg.com.hackerrankproblems; import java.math.BigDecimal; import java.math.RoundingMode; /** * *@author kaminahar Given an arr of integers, calculate the fractions of its elements that are positive, negative, and are zeros. Print the decimal value of each fraction on a new line. */ public class plusMinus { public static void main(String[] args) { //Variables int[] arr = {-4, 3, -9, 0, 4, 1 }; /* Need two counters. one is used to count negative numbers in the arr, one is for positive numbers in the arr, and one for zeroes. */ int positiveCounter = 0; int negativeCounter = 0; int zeroCounter = 0; //floats and doubles are not as precise, which is why we use big decimals. It's more accurate. //BigDecimal is an object. BigDecimal bigDecimalPositiveCounter = new BigDecimal(0); BigDecimal bigDecimalNegativeCounter = new BigDecimal(0); BigDecimal bigDecimalZeroCounter = new BigDecimal(0); /* This is a for loop. ex: " for (int i = 0; i < arr.length; i++) { " when the conditions are met inside the parenthesis, keep running the code in the brackets. " }; The "i" variable is for the index in the arr where you are starting from (in this example we are starting at index 0 which is the first element of the arr. To check all the numbers in the arr from the beginning, set the arr index to 0 "i= 0" i < arr.length means as long as i is less than the arr length keep iterating through the for loop i++ means to add one more to the index, which is how it iterates through the numbers until it reaches the last number (it knows when to reach the last number because of i < arr.length) */ for (int i = 0; i < arr.length; i++) { /* This varibale holds a number from the arr using the index. */ int currentNum = arr[i]; /* If currentNum is greater than 0, add 1 to the positive counter */ if (currentNum > 0) { positiveCounter++; } /* If currentNum is less than 0, add 1 to the negative counter */ if (currentNum < 0) { negativeCounter++; } //need two equals to compare the values, one equal means assign the value if (currentNum == 0) { zeroCounter++; } }; BigDecimal totalNumsInArray = new BigDecimal(arr.length); /*Convert the number of postives, negatives, and zeroes outside of the for loop.(If it's inside the for loop, it will keep recalculating the answer.) First convert the integer counters into BigDecimal counters, then for each divide by the total arr length */ bigDecimalPositiveCounter = new BigDecimal(positiveCounter); bigDecimalNegativeCounter = new BigDecimal(negativeCounter); bigDecimalZeroCounter = new BigDecimal(zeroCounter); //Divide bigDecimalPositiveCounter = bigDecimalPositiveCounter.divide(totalNumsInArray, 6, BigDecimal.ROUND_CEILING); bigDecimalNegativeCounter = bigDecimalNegativeCounter.divide(totalNumsInArray, 6, BigDecimal.ROUND_CEILING); bigDecimalZeroCounter = bigDecimalZeroCounter.divide(totalNumsInArray, 6, BigDecimal.ROUND_CEILING); //Print out the answers. System.out.println(bigDecimalPositiveCounter); System.out.println(bigDecimalNegativeCounter); System.out.println(bigDecimalZeroCounter); } }
[ "k.nahar22@gmail.com" ]
k.nahar22@gmail.com
03477cab07b266082426b87b61af1c14f2e1b544
6afb20f311384fa03dea13b1933f5cb4dd6cf9b8
/app/src/test/java/br/tbm/github/api/commons/MockServerDispatcher.java
7cc7d00ea929e6441bb692c5b88e1bf041d65e60
[]
no_license
thalesbm/android-github-api
5c27f65f6c3e4d5f39dd846656525759210659b6
b2d91c3dac82a0d1e12f83a132c77457cc9da53f
refs/heads/master
2021-07-25T17:54:02.801225
2020-03-07T23:36:22
2020-03-07T23:36:22
145,741,337
0
1
null
2018-11-10T21:10:15
2018-08-22T17:28:13
Java
UTF-8
Java
false
false
287
java
//package br.tbm.github.api.shared; // //import org.junit.Before; // //import okhttp3.Dispatcher; // //public class MockServerDispatcher { // // MockWebServer server; // // @Before // public void setUp() { // server = MockWebServer() // server.start() // } //}
[ "thales.bm92@gmail.com" ]
thales.bm92@gmail.com
e67d97c37c3c5842e93473e20ff35b0791639260
7eb17fb2955c6e8ae8cb3ab1107972ef95a2358f
/src/main/java/com/juney/webservice/config/auth/SecurityConfig.java
5951fa47554933026679f0b6af081b088f27001f
[]
no_license
juneyj114/webservice
71b456d21abdc1e9cab156c8314deaefb4c6bbb1
5ee0d110caab485316494e17830edcdd5be593b3
refs/heads/master
2020-12-10T11:08:15.418672
2020-01-13T14:14:02
2020-01-13T14:14:02
233,577,500
0
0
null
null
null
null
UTF-8
Java
false
false
1,095
java
package com.juney.webservice.config.auth; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import com.juney.webservice.domain.user.Role; import lombok.RequiredArgsConstructor; @RequiredArgsConstructor @EnableWebSecurity public class SecurityConfig extends WebSecurityConfigurerAdapter{ private final CustomOAuth2UserService customOAuth2UserService; @Override protected void configure(HttpSecurity http) throws Exception { http .csrf().disable() .headers().frameOptions().disable() .and() .authorizeRequests() .antMatchers("/", "/css/**", "/images/**", "/js/**", "/h2-console/**").permitAll() .antMatchers("/api/v1/**").hasRole(Role.USER.name()) .anyRequest().authenticated() .and() .logout() .logoutSuccessUrl("/") .and() .oauth2Login() .userInfoEndpoint() .userService(customOAuth2UserService); } }
[ "juneyj114@gmail.com" ]
juneyj114@gmail.com
b258bb61874686e82f29a8749ede768ac97864a4
47a00e53244ed153d2c392ab322437ee86877252
/src/org/learningu/scheduling/graph/Section.java
3f31a52988309354fbff5187b930ca2e468d7722
[]
no_license
pricem/LUScheduling
3eae0e59984ed5b342de231a4bcc548e8e0b107a
3352b779bad672cbfabdda9e109c340a94c9cc81
refs/heads/master
2021-01-16T20:34:34.384456
2012-10-08T02:21:09
2012-10-08T02:21:09
3,404,464
0
0
null
null
null
null
UTF-8
Java
false
false
2,799
java
package org.learningu.scheduling.graph; import static com.google.common.base.Preconditions.checkNotNull; import com.google.common.base.Function; import com.google.common.base.Functions; import com.google.common.base.Objects; import com.google.common.base.Optional; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; import com.google.common.primitives.Ints; import java.util.List; import java.util.Set; import org.learningu.scheduling.graph.SerialGraph.SerialSection; /** * A course in an LU program. * * @author lowasser */ public final class Section extends ProgramObject<SerialSection> implements Comparable<Section> { Section(Program program, SerialSection serial) { super(program, serial); } @Override public int getId() { return serial.getSectionId(); } public Course getCourse() { return new Course(serial.getCourseId(), this); } public int getPeriodLength() { return serial.getPeriodLength(); } public String getTitle() { return serial.getCourseTitle(); } List<Course> getPrerequisites() { return ImmutableList.copyOf(Lists.transform( serial.getPrereqCourseIdList(), Functions.forMap(program.courses))); } // Does not cache! List<Teacher> getTeachers() { return ImmutableList.copyOf(Lists.transform( serial.getTeacherIdList(), Functions.forMap(program.teachers))); } Set<Resource> getRequiredResources() { return ImmutableSet.copyOf(Lists.transform( serial.getRequiredResourceList(), Functions.forMap(program.resources))); } public Optional<Room> getPreferredRoom() { if (serial.hasPreferredRoom() && serial.getPreferredRoom() != -1) { return Optional.of(program.getRoom(serial.getPreferredRoom())); } else { return Optional.absent(); } } public int getEstimatedClassSize() { return serial.getEstimatedClassSize(); } public int getMaxClassSize() { return serial.getMaxClassSize(); } @Override public String toString() { return Objects.toStringHelper(this).add("id", getId()).toString(); } public Subject getSubject() { return checkNotNull(getProgram().subjects.get(serial.getSubjectId())); } static Function<SerialSection, Section> programWrapper(final Program program) { checkNotNull(program); return new Function<SerialSection, Section>() { @Override public Section apply(SerialSection input) { return new Section(program, input); } }; } @Override public int compareTo(Section o) { return Ints.compare(getId(), o.getId()); } @Override public String getShortDescription() { return String.format("%s (section %d)", getTitle(), getId()); } }
[ "wasserman.louis@gmail.com" ]
wasserman.louis@gmail.com
60bda83396fcb41331c5b49c9ba9cdf17f3d2f93
159889d7d9c4e44a5b51df26019c9b1524348206
/Dzpay_Admin/src/main/java/com/dzpay/admin/common/dao/auth/mall/ApplyRegistDao.java
e615977b7ca5ff46cb972fcda633e7a4692e5648
[]
no_license
dzpay/DzPay-Admin-MVC
c2e318b18a9870a17d329d19f143e5b1ce895674
9ed61538a7ca0092805aa2dea124e8e43d12f001
refs/heads/master
2022-12-16T16:22:52.505299
2020-09-23T03:41:54
2020-09-23T03:41:54
297,828,898
0
0
null
null
null
null
UTF-8
Java
false
false
681
java
package com.dzpay.admin.common.dao.auth.mall; import org.springframework.stereotype.Repository; import com.dzpay.admin.common.dao.AbstractDAO; import com.dzpay.admin.common.dto.mall.TblapplyRegist; @Repository("applyRegistDao") public class ApplyRegistDao extends AbstractDAO{ public boolean insertApplyRegist(TblapplyRegist vo) throws Exception{ int res = (int) insert("TblapplyRegistMapper_SQL.insert", vo); if(res != 1) { return false; } return true; } public TblapplyRegist selectApplyRegist(String contComments) { TblapplyRegist vo = (TblapplyRegist) selectOne("TblapplyRegistMapper_SQL.selectOne", contComments); return vo; } }
[ "rojae@douzone.com" ]
rojae@douzone.com
64d9d7b36302f37097cbe555904e928ae620db0e
0b0e69d08cbdedf4db0f9d57708d34be19caea38
/backend/src/main/java/com/example/janche/oauth/service/OauthRefreshTokenService.java
97beb8d16933d0f0a49931c7471e62e2cfba1509
[]
no_license
Janche/sso-oauth2-server
42ab8b3888a7fc74ae66d379bbc8d4efd85a4af8
aa32a75376bc647c605cc3d5ce2fe0038e195515
refs/heads/master
2023-06-21T19:43:05.703333
2022-06-30T01:50:09
2022-06-30T01:50:09
203,482,979
14
11
null
2023-06-14T16:39:01
2019-08-21T01:35:50
Java
UTF-8
Java
false
false
662
java
package com.example.janche.oauth.service; import com.example.janche.common.core.Service; import com.example.janche.common.restResult.PageParam; import com.example.janche.oauth.domain.OauthRefreshToken; import java.util.List; /** * @author lirong * @Description: // TODO 为类添加注释 * @date 2019-03-21 10:38:28 */ public interface OauthRefreshTokenService extends Service<OauthRefreshToken> { /** * 根据分页、排序信息和检索条件查询 @size 条 字典表数据 * @param pageParam 分页参数 * @param query 查询关键字 * @return */ List<OauthRefreshToken> list(PageParam pageParam, String query); }
[ "957671816@qq.com" ]
957671816@qq.com
abcdefbedc360a30fc7464791faac107ddbbbda1
c84671de1f7005dd73acd217f2443dc0b5fe379d
/evaluation/06_image_processor/kelinci_analysis/src/com/stac/mathematics/Mathematics.java
7d24fdafbbb3b003b6cc2cfff30be9dbdfa2fb0b
[ "MIT" ]
permissive
hemangandhi/badger
90516ae92f867a36a9bf247f7483684604508d2c
a4276dc8463488126d52c526d3f454769d94d292
refs/heads/master
2020-05-14T12:13:33.839938
2019-05-05T22:30:49
2019-05-05T22:30:49
181,790,578
0
0
null
2019-04-17T00:57:54
2019-04-17T00:57:54
null
UTF-8
Java
false
false
9,569
java
package com.stac.mathematics; import com.stac.image.utilities.*; public class Mathematics { private static final double Z255_inv = 0.00392156862745098; private static final double Z255_e_revert = 93.80925749833975; /* * YN: change array access to switch statement to overcome problem of AFL with * array branching. */ // private static final int[] accuracy; // static { // accuracy = new int[255]; // for (int n = 0; n <= 254; ++n) { // double v = 1.0 / Math.tan(Math.abs(30 - n) * 0.00392156862745098 + 0.001); // Mathematics.accuracy[n] = 4 + (int)v; // } //} private static double lgamma(final double x) { final double tmp = (x - 0.5) * Math.log(x + 4.5) - (x + 4.5); final double ser = 1.0 + 76.18009173 / x - 86.50532033 / (x + 1.0) + 24.014092822 / (x + 2.0) - 1.231739516 / (x + 3.0) + 0.00120858003 / (x + 4.0) - 5.36382E-6 / (x + 5.0); return tmp + Math.log(ser * Math.sqrt(6.283185307179586)); } private static double factorial(final double x) { return Math.exp(lgamma(x + 1.0)); } public static double exp(final int x, final int n) { double exp_n = 0.0; for (int i = 0; i < n; ++i) { final double aDouble = Math.pow(x * 0.00392156862745098, n); final double aDouble2 = 1.0 / factorial(n); exp_n += aDouble * aDouble2; } return exp_n; } public static double exp2(final int x, final int n) { double exp_n = 0.0; for (int i = 0; i < n; ++i) { // abstracted away, because we know this method is linear w.r.t. n } return exp_n; } public static int intensify(final int a, final int r, final int g, final int b) { // final int acc = Mathematics.accuracy[(r + g + b) % 255]; final int acc = getAccuracyValue((r + g + b) % 255); System.out.println("acc: " + acc); return ARGB.toARGB( a, (int)(Z255_e_revert * exp(r, acc)), (int)(Z255_e_revert * exp(g, acc)), (int)(Z255_e_revert * exp(b, acc)) ); } /* * YN: change array access to switch statement to overcome problem of AFL with * array branching. */ private static int getAccuracyValue(int index) { int value; switch(index) { case 0: value = 12; break; case 1: value = 12; break; case 2: value = 12; break; case 3: value = 13; break; case 4: value = 13; break; case 5: value = 14; break; case 6: value = 14; break; case 7: value = 14; break; case 8: value = 15; break; case 9: value = 15; break; case 10: value = 16; break; case 11: value = 17; break; case 12: value = 17; break; case 13: value = 18; break; case 14: value = 19; break; case 15: value = 20; break; case 16: value = 21; break; case 17: value = 23; break; case 18: value = 24; break; case 19: value = 26; break; case 20: value = 28; break; case 21: value = 31; break; case 22: value = 34; break; case 23: value = 39; break; case 24: value = 44; break; case 25: value = 52; break; case 26: value = 63; break; case 27: value = 82; break; case 28: value = 117; break; case 29: value = 207; break; case 30: value = 1003; break; case 31: value = 207; break; case 32: value = 117; break; case 33: value = 82; break; case 34: value = 63; break; case 35: value = 52; break; case 36: value = 44; break; case 37: value = 39; break; case 38: value = 34; break; case 39: value = 31; break; case 40: value = 28; break; case 41: value = 26; break; case 42: value = 24; break; case 43: value = 23; break; case 44: value = 21; break; case 45: value = 20; break; case 46: value = 19; break; case 47: value = 18; break; case 48: value = 17; break; case 49: value = 17; break; case 50: value = 16; break; case 51: value = 15; break; case 52: value = 15; break; case 53: value = 14; break; case 54: value = 14; break; case 55: value = 14; break; case 56: value = 13; break; case 57: value = 13; break; case 58: value = 12; break; case 59: value = 12; break; case 60: value = 12; break; case 61: value = 12; break; case 62: value = 11; break; case 63: value = 11; break; case 64: value = 11; break; case 65: value = 11; break; case 66: value = 10; break; case 67: value = 10; break; case 68: value = 10; break; case 69: value = 10; break; case 70: value = 10; break; case 71: value = 10; break; case 72: value = 9; break; case 73: value = 9; break; case 74: value = 9; break; case 75: value = 9; break; case 76: value = 9; break; case 77: value = 9; break; case 78: value = 9; break; case 79: value = 9; break; case 80: value = 9; break; case 81: value = 8; break; case 82: value = 8; break; case 83: value = 8; break; case 84: value = 8; break; case 85: value = 8; break; case 86: value = 8; break; case 87: value = 8; break; case 88: value = 8; break; case 89: value = 8; break; case 90: value = 8; break; case 91: value = 8; break; case 92: value = 8; break; case 93: value = 7; break; case 94: value = 7; break; case 95: value = 7; break; case 96: value = 7; break; case 97: value = 7; break; case 98: value = 7; break; case 99: value = 7; break; case 100: value = 7; break; case 101: value = 7; break; case 102: value = 7; break; case 103: value = 7; break; case 104: value = 7; break; case 105: value = 7; break; case 106: value = 7; break; case 107: value = 7; break; case 108: value = 7; break; case 109: value = 7; break; case 110: value = 7; break; case 111: value = 7; break; case 112: value = 6; break; case 113: value = 6; break; case 114: value = 6; break; case 115: value = 6; break; case 116: value = 6; break; case 117: value = 6; break; case 118: value = 6; break; case 119: value = 6; break; case 120: value = 6; break; case 121: value = 6; break; case 122: value = 6; break; case 123: value = 6; break; case 124: value = 6; break; case 125: value = 6; break; case 126: value = 6; break; case 127: value = 6; break; case 128: value = 6; break; case 129: value = 6; break; case 130: value = 6; break; case 131: value = 6; break; case 132: value = 6; break; case 133: value = 6; break; case 134: value = 6; break; case 135: value = 6; break; case 136: value = 6; break; case 137: value = 6; break; case 138: value = 6; break; case 139: value = 6; break; case 140: value = 6; break; case 141: value = 6; break; case 142: value = 6; break; case 143: value = 6; break; case 144: value = 6; break; case 145: value = 6; break; case 146: value = 6; break; case 147: value = 6; break; case 148: value = 5; break; case 149: value = 5; break; case 150: value = 5; break; case 151: value = 5; break; case 152: value = 5; break; case 153: value = 5; break; case 154: value = 5; break; case 155: value = 5; break; case 156: value = 5; break; case 157: value = 5; break; case 158: value = 5; break; case 159: value = 5; break; case 160: value = 5; break; case 161: value = 5; break; case 162: value = 5; break; case 163: value = 5; break; case 164: value = 5; break; case 165: value = 5; break; case 166: value = 5; break; case 167: value = 5; break; case 168: value = 5; break; case 169: value = 5; break; case 170: value = 5; break; case 171: value = 5; break; case 172: value = 5; break; case 173: value = 5; break; case 174: value = 5; break; case 175: value = 5; break; case 176: value = 5; break; case 177: value = 5; break; case 178: value = 5; break; case 179: value = 5; break; case 180: value = 5; break; case 181: value = 5; break; case 182: value = 5; break; case 183: value = 5; break; case 184: value = 5; break; case 185: value = 5; break; case 186: value = 5; break; case 187: value = 5; break; case 188: value = 5; break; case 189: value = 5; break; case 190: value = 5; break; case 191: value = 5; break; case 192: value = 5; break; case 193: value = 5; break; case 194: value = 5; break; case 195: value = 5; break; case 196: value = 5; break; case 197: value = 5; break; case 198: value = 5; break; case 199: value = 5; break; case 200: value = 5; break; case 201: value = 5; break; case 202: value = 5; break; case 203: value = 5; break; case 204: value = 5; break; case 205: value = 5; break; case 206: value = 5; break; case 207: value = 5; break; case 208: value = 5; break; case 209: value = 5; break; case 210: value = 5; break; case 211: value = 5; break; case 212: value = 5; break; case 213: value = 5; break; case 214: value = 5; break; case 215: value = 5; break; case 216: value = 5; break; case 217: value = 5; break; case 218: value = 5; break; case 219: value = 5; break; case 220: value = 5; break; case 221: value = 5; break; case 222: value = 5; break; case 223: value = 5; break; case 224: value = 5; break; case 225: value = 5; break; case 226: value = 5; break; case 227: value = 5; break; case 228: value = 5; break; case 229: value = 5; break; case 230: value = 5; break; case 231: value = 4; break; case 232: value = 4; break; case 233: value = 4; break; case 234: value = 4; break; case 235: value = 4; break; case 236: value = 4; break; case 237: value = 4; break; case 238: value = 4; break; case 239: value = 4; break; case 240: value = 4; break; case 241: value = 4; break; case 242: value = 4; break; case 243: value = 4; break; case 244: value = 4; break; case 245: value = 4; break; case 246: value = 4; break; case 247: value = 4; break; case 248: value = 4; break; case 249: value = 4; break; case 250: value = 4; break; case 251: value = 4; break; case 252: value = 4; break; case 253: value = 4; break; case 254: value = 4; break; default: throw new RuntimeException("Array Index out of bounds!"); } return value; } }
[ "nolleryc@gmail.com" ]
nolleryc@gmail.com
b960c449466d981e1b4b26911150e71a0ba30cfc
ed3cb95dcc590e98d09117ea0b4768df18e8f99e
/project_1_1/src/b/i/h/f/Calc_1_1_18754.java
f20465b4c5f2892fb82f0ae33ea3e8266d625ac8
[]
no_license
chalstrick/bigRepo1
ac7fd5785d475b3c38f1328e370ba9a85a751cff
dad1852eef66fcec200df10083959c674fdcc55d
refs/heads/master
2016-08-11T17:59:16.079541
2015-12-18T14:26:49
2015-12-18T14:26:49
48,244,030
0
0
null
null
null
null
UTF-8
Java
false
false
134
java
package b.i.h.f; public class Calc_1_1_18754 { /** @return the sum of a and b */ public int add(int a, int b) { return a+b; } }
[ "christian.halstrick@sap.com" ]
christian.halstrick@sap.com
a72952e0b3cfc077b5231a9db3bc979c342876c4
c247318facfb751b994a47da85bc6470104d8c1a
/src/main/java/others/EasyReverseBits.java
d6c2ec0433682c6bb2d1d9ed6aa4770d20cdc11d
[]
no_license
x1t1t/leetcode
5a622aae6bd2b50dc38e96193781841e5dbb1499
9a58b71e8e7341e974233439fb7c1ae8a96fc1a3
refs/heads/master
2023-08-24T13:44:34.278124
2023-08-13T08:31:50
2023-08-13T08:31:50
166,649,652
0
0
null
2022-12-16T04:48:53
2019-01-20T10:39:22
Java
UTF-8
Java
false
false
479
java
package others; /** * Reverse Bits * <p> * 颠倒给定的 32 位无符号整数的二进制位。 */ public class EasyReverseBits { public static void main(String[] args) { System.out.println(reverseBits(-3)); } public static int reverseBits(int n) { int result = 0; for (int i = 0; i < 32; i++) { int j = n & 1; result <<= 1; result += j; n>>=1; } return result; } }
[ "xiangyt@mail.ustc.edu.cn" ]
xiangyt@mail.ustc.edu.cn
0344c4e2f1d8fc9cf511461abc7fa0a2af065b4b
8ba064e881a8310c21a2cf151659444090a49b43
/runelite-client/src/test/java/net/runelite/client/plugins/keyremapping/KeyRemappingListenerTest.java
e9814dc7c65b1e65868961edbf111d981a0829ea
[ "BSD-2-Clause" ]
permissive
KScherpenzeel/SanLite
a04768fee162eb2aa9b4066ab429fb6cb17e4088
0a56fbbfb8321c07a4cee258dca14669c0401f32
refs/heads/master
2023-05-10T16:59:03.475034
2020-04-26T20:23:09
2020-04-26T20:23:09
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,774
java
/* * Copyright (c) 2020, Adam <Adam@sigterm.info> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package net.runelite.client.plugins.keyremapping; import com.google.inject.Guice; import com.google.inject.testing.fieldbinder.Bind; import com.google.inject.testing.fieldbinder.BoundFieldModule; import java.awt.event.KeyEvent; import javax.inject.Inject; import net.runelite.api.Client; import net.runelite.api.GameState; import net.runelite.client.config.ConfigManager; import net.runelite.client.config.ModifierlessKeybind; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import org.mockito.junit.MockitoJUnitRunner; @RunWith(MockitoJUnitRunner.class) public class KeyRemappingListenerTest { @Inject private KeyRemappingListener keyRemappingListener; @Mock @Bind private Client client; @Mock @Bind private ConfigManager configManager; @Mock @Bind private KeyRemappingPlugin keyRemappingPlugin; @Mock @Bind private KeyRemappingConfig keyRemappingConfig; @Before public void setUp() { Guice.createInjector(BoundFieldModule.of(this)).injectMembers(this); when(client.getGameState()).thenReturn(GameState.LOGGED_IN); } @Test public void testTypingStateChange() { when(keyRemappingConfig.cameraRemap()).thenReturn(true); when(keyRemappingConfig.up()).thenReturn(new ModifierlessKeybind(KeyEvent.VK_W, 0)); when(keyRemappingConfig.down()).thenReturn(new ModifierlessKeybind(KeyEvent.VK_S, 0)); when(keyRemappingConfig.left()).thenReturn(new ModifierlessKeybind(KeyEvent.VK_A, 0)); when(keyRemappingConfig.right()).thenReturn(new ModifierlessKeybind(KeyEvent.VK_D, 0)); when(keyRemappingPlugin.chatboxFocused()).thenReturn(true); KeyEvent event = mock(KeyEvent.class); when(event.getKeyCode()).thenReturn(KeyEvent.VK_D); when(event.getExtendedKeyCode()).thenReturn(KeyEvent.VK_D); // for keybind matches() keyRemappingListener.keyPressed(event); verify(event).setKeyCode(KeyEvent.VK_RIGHT); // with the plugin now in typing mode, previously pressed and remapped keys should still be mapped // on key release regardless when(keyRemappingPlugin.isTyping()).thenReturn(true); event = mock(KeyEvent.class); when(event.getKeyCode()).thenReturn(KeyEvent.VK_D); keyRemappingListener.keyReleased(event); verify(event).setKeyCode(KeyEvent.VK_RIGHT); } }
[ "noreply@github.com" ]
noreply@github.com
2cf2696e617f666e2b4826d161c786bc472b655e
1a575b3066976191b42bd731e0b2acbfd7b86013
/eCard-Parent/ecard-core/src/main/java/com/ecard/core/dao/ContactNotificationDAO.java
992336856c443ecd89f9e097921a3f43551518a8
[]
no_license
lebabach/ibs
21e8a4f87cf4fa6f4a485f0e22d57068a2ebb4d4
e0c6b2809b224ed868ef694fc02cff4dcf1ef6a1
refs/heads/master
2021-07-24T21:01:37.253701
2015-10-05T10:08:42
2015-10-05T10:08:42
109,240,972
0
0
null
null
null
null
UTF-8
Java
false
false
492
java
package com.ecard.core.dao; import java.util.List; import com.ecard.core.model.HistorySendEmail; import com.ecard.core.vo.ContactNotification; public interface ContactNotificationDAO { public List<ContactNotification> getAllContactNotification(); public int delete(int inquiryId); public ContactNotification getContactNotification(int inquiryId); public boolean replyMessage(ContactNotification contactNotification) ; public int sendContactMail(HistorySendEmail historySendEmail) ; }
[ "lebabach1989@gmail.com" ]
lebabach1989@gmail.com
42f751c83e3d470ac6c29906c5aeb71588072e21
4e16a6780f479bf703e240a1549d090b0bafc53b
/work/decompile-c69e3af0/net/minecraft/world/entity/ai/behavior/BehaviorPlay.java
bedbff5e1b24bed1cc314650080e2cd0bf3f2082
[]
no_license
0-Yama/ServLT
559b683832d1f284b94ef4a9dbd4d8adb543e649
b2153c73bea55fdd4f540ed2fba3a1e46ec37dc5
refs/heads/master
2023-03-16T01:37:14.727842
2023-03-05T14:55:51
2023-03-05T14:55:51
302,899,503
0
2
null
2020-10-15T10:51:21
2020-10-10T12:42:47
JavaScript
UTF-8
Java
false
false
5,493
java
package net.minecraft.world.entity.ai.behavior; import com.google.common.collect.Maps; import java.util.Comparator; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Optional; import net.minecraft.core.BlockPosition; import net.minecraft.world.entity.EntityCreature; import net.minecraft.world.entity.EntityLiving; import net.minecraft.world.entity.ai.behavior.declarative.BehaviorBuilder; import net.minecraft.world.entity.ai.behavior.declarative.MemoryAccessor; import net.minecraft.world.entity.ai.memory.MemoryModuleType; import net.minecraft.world.entity.ai.memory.MemoryTarget; import net.minecraft.world.entity.ai.util.LandRandomPos; import net.minecraft.world.phys.Vec3D; public class BehaviorPlay { private static final int MAX_FLEE_XZ_DIST = 20; private static final int MAX_FLEE_Y_DIST = 8; private static final float FLEE_SPEED_MODIFIER = 0.6F; private static final float CHASE_SPEED_MODIFIER = 0.6F; private static final int MAX_CHASERS_PER_TARGET = 5; private static final int AVERAGE_WAIT_TIME_BETWEEN_RUNS = 10; public BehaviorPlay() {} public static BehaviorControl<EntityCreature> create() { return BehaviorBuilder.create((behaviorbuilder_b) -> { return behaviorbuilder_b.group(behaviorbuilder_b.present(MemoryModuleType.VISIBLE_VILLAGER_BABIES), behaviorbuilder_b.absent(MemoryModuleType.WALK_TARGET), behaviorbuilder_b.registered(MemoryModuleType.LOOK_TARGET), behaviorbuilder_b.registered(MemoryModuleType.INTERACTION_TARGET)).apply(behaviorbuilder_b, (memoryaccessor, memoryaccessor1, memoryaccessor2, memoryaccessor3) -> { return (worldserver, entitycreature, i) -> { if (worldserver.getRandom().nextInt(10) != 0) { return false; } else { List<EntityLiving> list = (List) behaviorbuilder_b.get(memoryaccessor); Optional<EntityLiving> optional = list.stream().filter((entityliving) -> { return isFriendChasingMe(entitycreature, entityliving); }).findAny(); if (!optional.isPresent()) { Optional<EntityLiving> optional1 = findSomeoneBeingChased(list); if (optional1.isPresent()) { chaseKid(memoryaccessor3, memoryaccessor2, memoryaccessor1, (EntityLiving) optional1.get()); return true; } else { list.stream().findAny().ifPresent((entityliving) -> { chaseKid(memoryaccessor3, memoryaccessor2, memoryaccessor1, entityliving); }); return true; } } else { for (int j = 0; j < 10; ++j) { Vec3D vec3d = LandRandomPos.getPos(entitycreature, 20, 8); if (vec3d != null && worldserver.isVillage(new BlockPosition(vec3d))) { memoryaccessor1.set(new MemoryTarget(vec3d, 0.6F, 0)); break; } } return true; } } }; }); }); } private static void chaseKid(MemoryAccessor<?, EntityLiving> memoryaccessor, MemoryAccessor<?, BehaviorPosition> memoryaccessor1, MemoryAccessor<?, MemoryTarget> memoryaccessor2, EntityLiving entityliving) { memoryaccessor.set(entityliving); memoryaccessor1.set(new BehaviorPositionEntity(entityliving, true)); memoryaccessor2.set(new MemoryTarget(new BehaviorPositionEntity(entityliving, false), 0.6F, 1)); } private static Optional<EntityLiving> findSomeoneBeingChased(List<EntityLiving> list) { Map<EntityLiving, Integer> map = checkHowManyChasersEachFriendHas(list); return map.entrySet().stream().sorted(Comparator.comparingInt(Entry::getValue)).filter((entry) -> { return (Integer) entry.getValue() > 0 && (Integer) entry.getValue() <= 5; }).map(Entry::getKey).findFirst(); } private static Map<EntityLiving, Integer> checkHowManyChasersEachFriendHas(List<EntityLiving> list) { Map<EntityLiving, Integer> map = Maps.newHashMap(); list.stream().filter(BehaviorPlay::isChasingSomeone).forEach((entityliving) -> { map.compute(whoAreYouChasing(entityliving), (entityliving1, integer) -> { return integer == null ? 1 : integer + 1; }); }); return map; } private static EntityLiving whoAreYouChasing(EntityLiving entityliving) { return (EntityLiving) entityliving.getBrain().getMemory(MemoryModuleType.INTERACTION_TARGET).get(); } private static boolean isChasingSomeone(EntityLiving entityliving) { return entityliving.getBrain().getMemory(MemoryModuleType.INTERACTION_TARGET).isPresent(); } private static boolean isFriendChasingMe(EntityLiving entityliving, EntityLiving entityliving1) { return entityliving1.getBrain().getMemory(MemoryModuleType.INTERACTION_TARGET).filter((entityliving2) -> { return entityliving2 == entityliving; }).isPresent(); } }
[ "unconfigured@null.spigotmc.org" ]
unconfigured@null.spigotmc.org
981cb0ab4f26ce1f68b61bc7018cb8904480a983
b08afba058ca09e1cc11074ab2a9a54b15e7f18e
/basicutilmodel/src/test/java/shouhu/cn/basicutilmodel/ExampleUnitTest.java
552a60abc082ebc30f019e2df0bc4b9ac9e73331
[]
no_license
shouhu/BasicUtils
71959eae01f6f92e0602e043c3300482edb848f3
c4615c0ad56a3e69cf9552a7918041bab6a3bd47
refs/heads/master
2020-03-21T22:14:29.140139
2018-06-29T07:31:06
2018-06-29T07:31:06
139,113,793
0
1
null
null
null
null
UTF-8
Java
false
false
402
java
package shouhu.cn.basicutilmodel; 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); } }
[ "shouhu0316@gmail.com" ]
shouhu0316@gmail.com
8ae7d81a070b7e5bca1c3c9647b16446340eb424
4b8df57df10851f1ba2d82e11ed9fdd60fd68255
/src/main/java/ie/williamswalsh/work_testing/ReplaceVsReplaceAll.java
5cf43c42d686988f4255fc9819680d7bfbc0de43
[]
no_license
williamswalsh/java_8_in_action
940cf140297bb0017b8e4df0b29a03d2da4a0e52
c84fa23dfdd6fad4aa02350e125277be7cbb9e11
refs/heads/master
2023-05-14T04:46:59.818773
2021-06-09T08:56:41
2021-06-09T08:56:41
262,619,254
0
0
null
null
null
null
UTF-8
Java
false
false
848
java
package ie.williamswalsh.work_testing; import java.util.Arrays; import java.util.List; public class ReplaceVsReplaceAll { public static void main(String[] args) { String key = "email.reset-password.subject-line"; System.out.println(key.replace("-","_")); System.out.println(key.replace(".","_")); System.out.println(key.replace("-","_").replace(".","_")); System.out.println("4" + key.replaceAll("-","_")); System.out.println(key.replaceAll("\\.","_")); System.out.println(key.replaceAll("-","_").replaceAll("\\.","_")); List<String> settings = Arrays.asList("h","my","name","is","wrll"); System.out.println(settings.stream().anyMatch(s -> { if (s.contains("i")) { return true; } return false; })); } }
[ "william.walsh@digitary.net" ]
william.walsh@digitary.net
aec9d45e4256fb5d222e2fce6fd4de89afb9a76f
138c9154ec430b86a49fea171e0c5b49311e62ca
/src/main/java/me/kyllian/gameboy/handlers/PlayerHandler.java
c83801069c64392f44af39a4c2106fb3c0f4a26c
[]
no_license
Mikie/Gameboy
7bd9c4ab0778b293791274cfbf67c9f1d96abd2f
2ea7e5c3c4238ec11a09618c1988c1c923ce32ab
refs/heads/master
2023-01-31T20:13:13.076107
2020-12-11T08:15:26
2020-12-11T08:15:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,208
java
package me.kyllian.gameboy.handlers; import me.kyllian.gameboy.GameboyPlugin; import me.kyllian.gameboy.data.Pocket; import nitrous.Cartridge; import org.bukkit.Location; import org.bukkit.entity.Player; import java.util.HashMap; import java.util.Map; public class PlayerHandler { private GameboyPlugin plugin; private Map<Player, Pocket> pockets; public PlayerHandler(GameboyPlugin plugin) { this.plugin = plugin; pockets = new HashMap<>(); } public void loadGame(Player player, Cartridge cartridge) { try { plugin.notifyEmulate(); getPocket(player).loadEmulator(plugin, cartridge, player); plugin.getMapHandler().sendMap(player); Location playerLocation = player.getLocation(); playerLocation.setYaw(0); playerLocation.setPitch(40); player.teleport(playerLocation); } catch (Exception exception) { exception.printStackTrace(); } } public Pocket getPocket(Player player) { return pockets.computeIfAbsent(player, f -> new Pocket()); } public void removePocket(Player player) { pockets.remove(player); } }
[ "kyllian007@gmail.com" ]
kyllian007@gmail.com
5efd3e180a47d881346290f5a225a4264df295c1
82bd93b4824856c702f640f39ab592e160a0607d
/src/trabalho/model/UsuarioModel.java
7d388722f316fd13d1f402ef54f0a722aa02e7a2
[]
no_license
PGCC123/PROJETO-VENDAS
6a6058a9160da7da4013cdb2ca64855a38fe84d7
73cbfd561e086fcbcffdb81243d30a767312c854
refs/heads/master
2020-03-30T19:54:05.344393
2018-10-15T01:26:40
2018-10-15T01:26:40
151,564,529
0
0
null
null
null
null
UTF-8
Java
false
false
1,623
java
package trabalho.model; public class UsuarioModel { private int USU_CODIGO; private String USU_NOME; private String USU_LOGIN; private String USU_SENHA; private String USU_CADASTRO; // MODIFICAÇÃO private String USU_ATIVO; public UsuarioModel() { } public UsuarioModel(int USU_CODIGO, String USU_NOME, String USU_LOGIN, String USU_SENHA, String USU_CADASTRO, String USU_ATIVO) { this.USU_CODIGO = USU_CODIGO; this.USU_NOME = USU_NOME; this.USU_LOGIN = USU_LOGIN; this.USU_SENHA = USU_SENHA; this.USU_CADASTRO = USU_CADASTRO; this.USU_ATIVO = USU_ATIVO; } public int getUSU_CODIGO() { return USU_CODIGO; } public void setUSU_CODIGO(int USU_CODIGO) { this.USU_CODIGO = USU_CODIGO; } public String getUSU_NOME() { return USU_NOME; } public void setUSU_NOME(String USU_NOME) { this.USU_NOME = USU_NOME; } public String getUSU_LOGIN() { return USU_LOGIN; } public void setUSU_LOGIN(String USU_LOGIN) { this.USU_LOGIN = USU_LOGIN; } public String getUSU_SENHA() { return USU_SENHA; } public void setUSU_SENHA(String USU_SENHA) { this.USU_SENHA = USU_SENHA; } public String getUSU_CADASTRO() { return USU_CADASTRO; } public void setUSU_CADASTRO(String USU_CADASTRO) { this.USU_CADASTRO = USU_CADASTRO; } public String getUSU_ATIVO() { return USU_ATIVO; } public void setUSU_ATIVO(String USU_ATIVO) { this.USU_ATIVO = USU_ATIVO; } }
[ "patrick_gabriel.costa@hotmail.com" ]
patrick_gabriel.costa@hotmail.com
d347a330d93d43d5de5a389764bfcfd0cc475445
6d9864dddd988d9c8c2e03a025787e359376b861
/app/src/main/java/com/example/marcin/prototype/TrackDetailsFirstAvtivity.java
acd66e616bd86427c9b594f15220d54de6b15303
[]
no_license
WildCrasher/Prototype
50d36c2946b46cc65f3831e304c9edc0b2b05e09
1c99e389774cbe76b287dbe77250535883d97441
refs/heads/master
2020-04-10T23:02:24.364076
2018-12-11T16:19:26
2018-12-11T16:19:26
161,339,882
0
0
null
null
null
null
UTF-8
Java
false
false
596
java
package com.example.marcin.prototype; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; public class TrackDetailsFirstAvtivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_track_details_first_avtivity); } public void showTrackProgress(View v) { Intent intentApp = new Intent(this, TrackViewActivity.class); this.startActivity(intentApp); } }
[ "piotrek.fur@wp.pl" ]
piotrek.fur@wp.pl
2bd342ef2630ef937850f77b404162d051182cda
de33d5a80c2de66cb819a95ef18343a3e19450aa
/src/test.java
746564941e49ab8cef51ce3a47fe6dfb1b936718
[]
no_license
alinakhaee/AI_Search
87857775216b51be264bdcdab8b3faf6bc7d1c01
6abb28d58bf6af18d8852d50d38fb14b1215b350
refs/heads/master
2023-07-05T20:13:48.539491
2021-07-31T13:15:40
2021-07-31T13:15:40
391,355,548
0
0
null
null
null
null
UTF-8
Java
false
false
18,975
java
public class test { public static void main(String[] args) { Visualizer visualizer = new Visualizer(); //HARD CODE WAY // //initialization of the map // //G for normal ground // //S for swamp // //K for key // //C for castle // //L for Loot // //B for bandit // //W for wildAnimals // //P for bridge // Player player = new Player(0,1,100,100); // //indexes start from zero // System.out.println("player position: "+player.i+" "+player.j); // Map map = new Map(7,6); // map.addEntity(0,0,new Bandit(50)); // map.addEntity(0,1,new BaseEntity('G')); // map.addEntity(0,2,new BaseEntity('S')); // map.addEntity(0,3,new Bandit(150)); // map.addEntity(0,4,new BaseEntity('G')); // map.addEntity(0,5,new BaseEntity('G')); // map.addEntity(1,0,new BaseEntity('S')); // map.addEntity(1,1,new Bridge()); // map.addEntity(1,2,new BaseEntity('G')); // map.addEntity(1,3,new BaseEntity('S')); // map.addEntity(1,4,new Bridge()); // map.addEntity(1,5,new Bandit(50)); // map.addEntity(2,0,new Loot(50,50)); // map.addEntity(2,1,new BaseEntity('G')); // map.addEntity(2,2,new WildAnimall(150)); // map.addEntity(2,3,new BaseEntity('G')); // map.addEntity(2,4,new BaseEntity('G')); // map.addEntity(2,5,new BaseEntity('G')); // map.addEntity(3,0,new BaseEntity('G')); // map.addEntity(3,1,new WildAnimall(50)); // map.addEntity(3,2,new Loot(50,50)); // map.addEntity(3,3,new BaseEntity('G')); // map.addEntity(3,4,new Bandit(150)); // map.addEntity(3,5,new BaseEntity('S')); // map.addEntity(4,0,new BaseEntity('G')); // map.addEntity(4,1,new Bandit(50)); // map.addEntity(4,2,new BaseEntity('G')); // map.addEntity(4,3,new BaseEntity('G')); // map.addEntity(4,4,new BaseEntity('C')); // map.addEntity(4,5,new WildAnimall(200)); // map.addEntity(5,0,new BaseEntity('S')); // map.addEntity(5,1,new BaseEntity('G')); // map.addEntity(5,2,new Loot(100,100)); // map.addEntity(5,3,new BaseEntity('G')); // map.addEntity(5,4,new BaseEntity('S')); // map.addEntity(5,5,new BaseEntity('G')); // map.addEntity(6,0,new Bandit(100)); // map.addEntity(6,1,new BaseEntity('K')); // map.addEntity(6,2,new BaseEntity('S')); // map.addEntity(6,3,new BaseEntity('G')); // map.addEntity(6,4,new BaseEntity('S')); // map.addEntity(6,5,new BaseEntity('S')); // //test 1 // Map map = new Map(7,6); // Player player = new Player(2,5,100,100); // map.addEntity(0,0,new Bandit(50)); // map.addEntity(0,1,new BaseEntity('G')); // map.addEntity(0,2,new BaseEntity('S')); // map.addEntity(0,3,new Bandit(150)); // map.addEntity(0,4,new BaseEntity('G')); // map.addEntity(0,5,new BaseEntity('G')); // map.addEntity(1,0,new BaseEntity('S')); // map.addEntity(1,1,new Bridge()); // map.addEntity(1,2,new BaseEntity('G')); // map.addEntity(1,3,new BaseEntity('S')); // map.addEntity(1,4,new Bridge()); // map.addEntity(1,5,new Bandit(25)); // map.addEntity(2,0,new Loot(50,50)); // map.addEntity(2,1,new BaseEntity('G')); // map.addEntity(2,2,new WildAnimall(150)); // map.addEntity(2,3,new BaseEntity('G')); // map.addEntity(2,4,new BaseEntity('G')); // map.addEntity(2,5,new BaseEntity('G')); // map.addEntity(3,0,new BaseEntity('G')); // map.addEntity(3,1,new WildAnimall(50)); // map.addEntity(3,2,new Bandit(100)); // map.addEntity(3,3,new BaseEntity('G')); // map.addEntity(3,4,new Bandit(150)); // map.addEntity(3,5,new BaseEntity('S')); // map.addEntity(4,0,new BaseEntity('G')); // map.addEntity(4,1,new Bandit(50)); // map.addEntity(4,2,new BaseEntity('G')); // map.addEntity(4,3,new Bandit(99)); // map.addEntity(4,4,new BaseEntity('C')); // map.addEntity(4,5,new WildAnimall(200)); // map.addEntity(5,0,new BaseEntity('S')); // map.addEntity(5,1,new BaseEntity('G')); // map.addEntity(5,2,new Loot(100,100)); // map.addEntity(5,3,new BaseEntity('G')); // map.addEntity(5,4,new BaseEntity('S')); // map.addEntity(5,5,new BaseEntity('G')); // map.addEntity(6,0,new Bandit(100)); // map.addEntity(6,1,new BaseEntity('K')); // map.addEntity(6,2,new BaseEntity('S')); // map.addEntity(6,3,new BaseEntity('G')); // map.addEntity(6,4,new BaseEntity('S')); // map.addEntity(6,5,new BaseEntity('S')); // //test 2 // Player player = new Player(4,4,5,105); // Map map = new Map(5,5); // map.addEntity(0,0,new BaseEntity('G')); // map.addEntity(0,1,new BaseEntity('G')); // map.addEntity(0,2,new BaseEntity('G')); // map.addEntity(0,3,new Bandit(50)); // map.addEntity(0,4,new BaseEntity('C')); // map.addEntity(1,0,new BaseEntity('S')); // map.addEntity(1,1,new BaseEntity('K')); // map.addEntity(1,2,new Bridge()); // map.addEntity(1,3,new BaseEntity('S')); // map.addEntity(1,4,new Bandit(100)); // map.addEntity(2,0,new Loot(50,50)); // map.addEntity(2,1,new WildAnimall(50)); // map.addEntity(2,2,new BaseEntity('G')); // map.addEntity(2,3,new BaseEntity('G')); // map.addEntity(2,4,new Bandit(100)); // map.addEntity(3,0,new WildAnimall(100)); // map.addEntity(3,1,new BaseEntity('G')); // map.addEntity(3,2,new BaseEntity('S')); // map.addEntity(3,3,new BaseEntity('S')); // map.addEntity(3,4,new BaseEntity('G')); // map.addEntity(4,0,new BaseEntity('G')); // map.addEntity(4,1,new Bridge()); // map.addEntity(4,2,new BaseEntity('G')); // map.addEntity(4,3,new BaseEntity('G')); // map.addEntity(4,4,new BaseEntity('G')); //test 3 // Player player = new Player(2,2,5,105); // Map map = new Map(5,5); // map.addEntity(0,0,new WildAnimall(100)); // map.addEntity(0,1,new Bridge()); // map.addEntity(0,2,new BaseEntity('G')); // map.addEntity(0,3,new Loot(100,100)); // map.addEntity(0,4,new BaseEntity('S')); // map.addEntity(1,0,new BaseEntity('G')); // map.addEntity(1,1,new BaseEntity('G')); // map.addEntity(1,2,new BaseEntity('S')); // map.addEntity(1,3,new BaseEntity('G')); // map.addEntity(1,4,new Bandit(100)); // map.addEntity(2,0,new WildAnimall(200)); // map.addEntity(2,1,new Bridge()); // map.addEntity(2,2,new BaseEntity('G')); // map.addEntity(2,3,new Bridge()); // map.addEntity(2,4,new Bandit(100)); // map.addEntity(3,0,new BaseEntity('S')); // map.addEntity(3,1,new BaseEntity('S')); // map.addEntity(3,2,new BaseEntity('S')); // map.addEntity(3,3,new Bandit(500)); // map.addEntity(3,4,new BaseEntity('K')); // map.addEntity(4,0,new BaseEntity('C')); // map.addEntity(4,1,new WildAnimall(100)); // map.addEntity(4,2,new BaseEntity('G')); // map.addEntity(4,3,new BaseEntity('G')); // map.addEntity(4,4,new Bridge()); //test 4 // Player player = new Player(0,0,105,5); // Map map = new Map(5,5); // map.addEntity(0,0,new BaseEntity('G')); // map.addEntity(0,1,new Bridge()); // map.addEntity(0,2,new Bandit(100)); // map.addEntity(0,3,new Loot(50,100)); // map.addEntity(0,4,new WildAnimall(100)); // map.addEntity(1,0,new BaseEntity('S')); // map.addEntity(1,1,new Loot(100,100)); // map.addEntity(1,2,new Bridge()); // map.addEntity(1,3,new Bandit(100)); // map.addEntity(1,4,new Loot(100,100)); // map.addEntity(2,0,new BaseEntity('K')); // map.addEntity(2,1,new WildAnimall(100)); // map.addEntity(2,2,new BaseEntity('S')); // map.addEntity(2,3,new BaseEntity('S')); // map.addEntity(2,4,new Loot(500,500)); // map.addEntity(3,0,new BaseEntity('G')); // map.addEntity(3,1,new BaseEntity('G')); // map.addEntity(3,2,new WildAnimall(800)); // map.addEntity(3,3,new Bandit(100)); // map.addEntity(3,4,new BaseEntity('S')); // map.addEntity(4,0,new Bandit(100)); // map.addEntity(4,1,new Bandit(100)); // map.addEntity(4,2,new Loot(100,100)); // map.addEntity(4,3,new WildAnimall(100)); // map.addEntity(4,4,new BaseEntity('C')); // //test 5 // Player player = new Player(0,4,5,105); // Map map = new Map(5,5); // map.addEntity(0,0,new WildAnimall(100)); // map.addEntity(0,1,new Bandit(100)); // map.addEntity(0,2,new BaseEntity('C')); // map.addEntity(0,3,new BaseEntity('S')); // map.addEntity(0,4,new BaseEntity('G')); // map.addEntity(1,0,new Bandit(100)); // map.addEntity(1,1,new BaseEntity('S')); // map.addEntity(1,2,new BaseEntity('S')); // map.addEntity(1,3,new BaseEntity('S')); // map.addEntity(1,4,new Bridge()); // map.addEntity(2,0,new BaseEntity('G')); // map.addEntity(2,1,new Loot(100,100)); // map.addEntity(2,2,new BaseEntity('S')); // map.addEntity(2,3,new Loot(100,100)); // map.addEntity(2,4,new BaseEntity('G')); // map.addEntity(3,0,new Bridge()); // map.addEntity(3,1,new WildAnimall(100)); // map.addEntity(3,2,new Loot(100,100)); // map.addEntity(3,3,new BaseEntity('G')); // map.addEntity(3,4,new Bandit(100)); // map.addEntity(4,0,new Loot(100,100)); // map.addEntity(4,1,new BaseEntity('G')); // map.addEntity(4,2,new Bridge()); // map.addEntity(4,3,new WildAnimall(100)); // map.addEntity(4,4,new BaseEntity('K')); //// test 6 // Player player = new Player(3,2,150,100); // Map map = new Map(5,5); // map.addEntity(0,0,new BaseEntity('G')); // map.addEntity(0,1,new BaseEntity('K')); // map.addEntity(0,2,new BaseEntity('G')); // map.addEntity(0,3,new BaseEntity('S')); // map.addEntity(0,4,new BaseEntity('C')); // map.addEntity(1,0,new BaseEntity('G')); // map.addEntity(1,1,new Loot(25,100)); // map.addEntity(1,2,new Bandit(50)); // map.addEntity(1,3,new BaseEntity('S')); // map.addEntity(1,4,new Loot(50,50)); // map.addEntity(2,0,new Bandit(50)); // map.addEntity(2,1,new BaseEntity('S')); // map.addEntity(2,2,new BaseEntity('G')); // map.addEntity(2,3,new BaseEntity('G')); // map.addEntity(2,4,new WildAnimall(100)); // map.addEntity(3,0,new BaseEntity('G')); // map.addEntity(3,1,new WildAnimall(50)); // map.addEntity(3,2,new BaseEntity('G')); // map.addEntity(3,3,new Bandit(100)); // map.addEntity(3,4,new BaseEntity('G')); // map.addEntity(4,0,new BaseEntity('G')); // map.addEntity(4,1,new BaseEntity('G')); // map.addEntity(4,2,new Bridge()); // map.addEntity(4,3,new WildAnimall(100)); // map.addEntity(4,4,new BaseEntity('G')); // //test 7 // Player player = new Player(0,4,220,140); // Map map = new Map(5,5); // map.addEntity(0,0,new BaseEntity('C')); // map.addEntity(0,1,new Bandit(250)); // map.addEntity(0,2,new BaseEntity('G')); // map.addEntity(0,3,new Bridge()); // map.addEntity(0,4,new BaseEntity('G')); // map.addEntity(1,0,new WildAnimall(200)); // map.addEntity(1,1,new BaseEntity('S')); // map.addEntity(1,2,new BaseEntity('G')); // map.addEntity(1,3,new BaseEntity('G')); // map.addEntity(1,4,new BaseEntity('S')); // map.addEntity(2,0,new Bridge()); // map.addEntity(2,1,new BaseEntity('G')); // map.addEntity(2,2,new Bandit(100)); // map.addEntity(2,3,new BaseEntity('G')); // map.addEntity(2,4,new BaseEntity('G')); // map.addEntity(3,0,new BaseEntity('G')); // map.addEntity(3,1,new BaseEntity('G')); // map.addEntity(3,2,new Loot(100,100)); // map.addEntity(3,3,new WildAnimall(60)); // map.addEntity(3,4,new BaseEntity('G')); // map.addEntity(4,0,new BaseEntity('K')); // map.addEntity(4,1,new BaseEntity('S')); // map.addEntity(4,2,new BaseEntity('G')); // map.addEntity(4,3,new BaseEntity('G')); // map.addEntity(4,4,new BaseEntity('G')); // // test final 1 // Player player = new Player(0,4,220,140); // // Map map = new Map(5,5); // // map.addEntity(0,0,new BaseEntity('C')); // map.addEntity(0,1,new Bandit(450)); // map.addEntity(0,2,new Bridge()); // map.addEntity(0,3,new Bridge()); // map.addEntity(0,4,new BaseEntity('G')); // map.addEntity(1,0,new WildAnimall(200)); // map.addEntity(1,1,new BaseEntity('S')); // map.addEntity(1,2,new BaseEntity('G')); // map.addEntity(1,3,new BaseEntity('G')); // map.addEntity(1,4,new BaseEntity('S')); // map.addEntity(2,0,new Bridge()); // map.addEntity(2,1,new BaseEntity('G')); // map.addEntity(2,2,new Bandit(100)); // map.addEntity(2,3,new BaseEntity('G')); // map.addEntity(2,4,new BaseEntity('G')); // map.addEntity(3,0,new BaseEntity('G')); // map.addEntity(3,1,new BaseEntity('G')); // map.addEntity(3,2,new Loot(100,100)); // map.addEntity(3,3,new WildAnimall(60)); // map.addEntity(3,4,new Bandit(400)); // map.addEntity(4,0,new BaseEntity('K')); // map.addEntity(4,1,new BaseEntity('S')); // map.addEntity(4,2,new BaseEntity('G')); // map.addEntity(4,3,new BaseEntity('G')); // map.addEntity(4,4,new WildAnimall(6000)); //test final 2 Player player = new Player(0,4,1,1); Map map = new Map(5,5); map.addEntity(0,0,new BaseEntity('S')); map.addEntity(0,1,new WildAnimall(1000)); map.addEntity(0,2,new BaseEntity('S')); map.addEntity(0,3,new Bridge()); map.addEntity(0,4,new BaseEntity('G')); map.addEntity(1,0,new Loot(100,100)); map.addEntity(1,1,new Loot(100,100)); map.addEntity(1,2,new BaseEntity('G')); map.addEntity(1,3,new Loot(1000,1000)); map.addEntity(1,4,new Bandit(50)); map.addEntity(2,0,new WildAnimall(1000)); map.addEntity(2,1,new BaseEntity('S')); map.addEntity(2,2,new Bandit(100)); map.addEntity(2,3,new BaseEntity('S')); map.addEntity(2,4,new BaseEntity('K')); map.addEntity(3,0,new BaseEntity('G')); map.addEntity(3,1,new BaseEntity('S')); map.addEntity(3,2,new Bridge()); map.addEntity(3,3,new BaseEntity('S')); map.addEntity(3,4,new BaseEntity('S')); map.addEntity(4,0,new BaseEntity('S')); map.addEntity(4,1,new BaseEntity('G')); map.addEntity(4,2,new BaseEntity('G')); map.addEntity(4,3,new WildAnimall(1000)); map.addEntity(4,4,new BaseEntity('C')); //MANUAL WAY // Scanner scanner = new Scanner(System.in); // System.out.print("Player (i, j, money, food) : "); // Player player = new Player(scanner.nextInt(),scanner.nextInt(),scanner.nextInt(),scanner.nextInt()); // System.out.print("Map (rows, columns) : "); // Map map = new Map(scanner.nextInt(),scanner.nextInt()); // for(int i=0 ; i<map.rows ; i++) // for(int j=0 ; j<map.cols ; j++) // map.addEntity(i, j, new BaseEntity('G')); // // while (true){ // System.out.print("Entity (i, j, type, [power, money], [food]) (-1 to end) : "); // int i = scanner.nextInt(); // if(i == -1) // break; // int j = scanner.nextInt(); // char type = scanner.next().toUpperCase().charAt(0); // if(type == 'G' || type == 'S'|| type == 'C' || type == 'K') // map.changeEntity(i, j, new BaseEntity(type)); // else if(type == 'P') // map.changeEntity(i, j, new Bridge()); // else if(type == 'B') // map.changeEntity(i, j, new Bandit(scanner.nextInt())); // else if(type == 'W') // map.changeEntity(i, j, new WildAnimall(scanner.nextInt())); // else if(type == 'L') // map.changeEntity(i, j, new Loot(scanner.nextInt(), scanner.nextInt())); // } //print method prints the map map.print(); visualizer.printMap(map, player); Node node = new Node(player,map,null,null); BFS bfs = new BFS(); bfs.writeInFile = true; DFS dfs = new DFS(); IDS ids = new IDS(); BDS bds = new BDS(); AStar aStar = new AStar(); IDAStar idaStar = new IDAStar(); RBFS rbfs = new RBFS(); System.out.println("**************************************************** BFS ****************************************************"); bfs.search(node); System.out.println("BFS expanded nodes : " + bfs.expandedNodes); // // System.out.println("**************************************************** DFS ****************************************************"); // dfs.search(node); // System.out.println("DFS expanded nodes : " + dfs.nodeExpanded); // System.out.println("**************************************************** IDS ****************************************************"); // ids.search(node, 30); // System.out.println("IDS expanded nodes : " + ids.expandedNodes); // System.out.println("**************************************************** BDS ****************************************************"); // Node finalState = bfs.finalState; // finalState.parentNode = null; // bds.search(node, finalState); // System.out.println("BDS expanded nodes : " + bds.expandedNodes); // // System.out.println("**************************************************** A* ****************************************************"); // aStar.search(node); // System.out.println("A* expanded nodes : " + aStar.expandedNodes); // // System.out.println("**************************************************** IDA* ****************************************************"); // idaStar.search(node); // System.out.println("IDA* expanded nodes : " + idaStar.expandedNodes); // System.out.println("**************************************************** RBFS ****************************************************"); rbfs.search(node); System.out.println(rbfs.expandedNodes); } }
[ "ali.sh7097@gmail.com" ]
ali.sh7097@gmail.com
61f08ff376bdd0dafc6c49176d2466a9c887fec5
a4b4687908496fc18d07bec4d43e0b1b8e8dd895
/WebDriverFrameWork/src/testRunner/RunManager.java
7ee3a142a038511374e3648cfcc5db740573a554
[]
no_license
parinitmishragate6/Frame-Work-for-Automation
5e5f10c77472d70ed4fb642c910c1e28b1050d32
13d6ce67509ffe2c09f18e5cc35568acdd7cd540
refs/heads/master
2021-01-10T23:56:59.249521
2016-11-01T11:07:56
2016-11-01T11:07:56
70,778,575
2
0
null
2016-10-24T04:35:45
2016-10-13T07:03:46
Java
UTF-8
Java
false
false
987
java
package testRunner; import java.util.List; import org.testng.TestNG; import factories.BrowserFactory; import factories.DataProviderFactory; import factories.ReporterFactory; public class RunManager { public static void main(String[] args) { List<String> browserList = DataProviderFactory.getRunConfigDataProvider().getBrowsers(); List<String> suites = DataProviderFactory.getRunConfigDataProvider().getRunXmls(); // Add testXML suites(i) TestNG testRunner = null; for (String browser : browserList) { ReporterFactory.getReporter().Log("Starting tests with browser " + browser); BrowserFactory.getBrowser(browser); testRunner = new TestNG(); testRunner.setTestSuites(suites); // Add testXML suites(ii) testRunner.run(); BrowserFactory.colseWebDriver(); ReporterFactory.getReporter().Log("Stopping tests with browser " + browser); } ReporterFactory.getReporter().StopLogging(); } }
[ "noreply@github.com" ]
noreply@github.com
107e466010d9d73802bfd67d60e9a114799f4387
ad99a913cca71d1e0bb94854ad51cfb206eec86a
/src/main/java/jp/powerbase/xmldb/resource/ResourceDatabase.java
6dae926840e1e85ff2bda7800eef513b76437e77
[ "Apache-2.0" ]
permissive
powerbase/powerbase-xq
d417f0aca46ff17a9fd8c1722ffcc11fed679f38
6fbb1c187eaf3c2e978ee01c01adee80746cc519
refs/heads/master
2021-01-23T12:22:09.616590
2017-05-29T10:27:47
2017-05-29T10:27:47
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,012
java
/* * @(#)$Id: ResourceDatabase.java 1178 2011-07-22 10:16:56Z hirai $ * * Copyright 2005-2011 Infinite Corporation. * * 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. * * Contributors: * Toshio HIRAI - initial implementation */ package jp.powerbase.xmldb.resource; import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; import javax.xml.xpath.XPathExpressionException; import jp.powerbase.PowerBaseError; import jp.powerbase.PowerBaseException; import jp.powerbase.basex.Client; public class ResourceDatabase extends DefaultDatabase { ResourceDatabase(Client client, int id, Path path, Type type) throws PowerBaseException { super(client, id, path, type); try { url = new URL(dom.getNodeValue("/database/url/text()")); } catch (XPathExpressionException e) { throw new PowerBaseException(PowerBaseError.Code.INTERNAL_PROCESS_ERROR, e); } catch (MalformedURLException e) { throw new PowerBaseException(PowerBaseError.Code.INTERNAL_PROCESS_ERROR, e); } } @Override public ArrayList<Heading> getHeadings() { return null; } @Override public String getTuplePath() { return ""; } @Override public String getRootTag() { return rootTag; } @Override public String getTupleTag() { return ""; } @Override public String getQuery() { return ""; } @Override public boolean isTuple() { return false; } @Override public URL getUrl() { return url; } @Override public Path getTarget() { return null; } }
[ "toshio.hirai@gmail.com" ]
toshio.hirai@gmail.com
8c6bd6f68616ff11f2ca92c11b2c8a7bc51c3494
f515f98ca40ce65a60e324b2860949d9fff668dd
/Source Code/javasource/commonToy/PERSON/AddressClass.java
f0dbddf75470c7b5b962fd1ead312d4d2fac6d22
[]
no_license
Deyreudolf00/OOP
35e2228e49692088d72e8b974c24b4e714d9c970
62842082c8a344f072bbfd84e3484a6df3f0bb25
refs/heads/master
2016-08-13T00:44:44.326739
2016-02-27T04:11:21
2016-02-27T04:11:21
50,080,804
0
0
null
null
null
null
UTF-8
Java
false
false
1,200
java
/* * AddressClass.java * * Created on May 7, 2003, 9:08 PM */ package commonToy.person; /** * * @author unknown */ public class AddressClass { private String streetAddress; private String rt; private String rw; private String village; private String district; private CityClass city; private String postCode; /** Creates a new instance of AddressClass */ public AddressClass() { } public void setStreetAddress(String newStreetName) { } public void setRT (String newRT) { } public void setRW (String newRW) { } public void setVillage (String newVillage){ } public void setDistrict (String newDistrict) { } public void setCity (CityClass newCity) { } public void setPostCode (String newPostCode) { } public String getStreetAddress() { } public String getRT() { } public String getRW() { } public String getVillage() { } public String getDistrict() { } public CityClass getCity() { } public PostCodeClass getPostCode () { } }
[ "renggarenji@gmail.com" ]
renggarenji@gmail.com
dfdcff5983d0c3ba074125f342c920d47ad984d2
1fd7ee0cf4c2d259fa1422757cf92a29b5de8694
/广东中骏条码(成品仓库)/zjmuseum/src/com/thinkway/cms/presentation/web/controller/bizinfo/GetMaterialBController.java
45c6ef5890c3ec88fa644a778741c368bc75c9d3
[]
no_license
1059027178/com.zxec.www
8e044433181816e9bab84ecd4e67d3f61ffc5b6c
de5ca55287c402354320f95da74d3c40ced81ea0
refs/heads/master
2020-03-22T18:02:47.080595
2018-07-09T15:47:22
2018-07-09T15:47:22
140,433,065
0
1
null
null
null
null
UTF-8
Java
false
false
5,124
java
package com.thinkway.cms.presentation.web.controller.bizinfo; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import net.sf.json.JSONObject; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.mvc.Controller; import com.sap.mw.jco.JCO; import com.thinkway.SapUtil; import com.thinkway.cms.business.domains.GetMaterial; import com.thinkway.cms.business.domains.MaterialDetail; import com.thinkway.cms.business.service.iface.UserService; import com.thinkway.cms.presentation.web.authenticate.AuthenticateController; import com.thinkway.cms.presentation.web.authenticate.Authenticator; import com.thinkway.cms.presentation.web.core.PaginatedListHelper; import com.thinkway.cms.presentation.web.core.SessionManager; import com.thinkway.cms.util.ParamUtils; import com.thinkway.cms.util.SAPModel; import com.thinkway.cms.util.SAPRequest; public class GetMaterialBController implements Controller, AuthenticateController { private UserService userService = null; private String viewName = null; private String msg = null; private Authenticator authenticator = null; private long permission = 0L; private String tokenNeed = null; public String getMsg() { return msg; } public void setMsg(String msg) { this.msg = msg; } public String getTokenNeed() { return tokenNeed; } public void setTokenNeed(String tokenNeed) { this.tokenNeed = tokenNeed; } public long getPermission() { return permission; } public void setPermission(long permission) { this.permission = permission; } public Authenticator getAuthenticator() { return authenticator; } public void setAuthenticator(Authenticator authenticator) { this.authenticator = authenticator; } public void setUserService(UserService userService) { this.userService = userService; } public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception { Map<Object, Object> models = new HashMap<Object, Object>(); SAPRequest sapRequest = new SAPRequest("ZFM_BC_15_12"); sapRequest.addParameter("I_UID", "" + request.getSession().getAttribute(SessionManager.USER_ID)); // sapRequest.addParameter("I_PID", "" + request.getSession().getAttribute(SessionManager.USER_NAME)); String materialGettenId=SapUtil.null2String(request.getParameter("materialGettenId")); sapRequest.addParameter("I_MRFNR", materialGettenId); SAPModel model = SapUtil.OperSAP(sapRequest); JCO.Structure struct = model.getOuts().getStructure("ES_RETURN"); String type = struct.getString("MSGTY"); if (type.equals("E")) { models.put("msg", model.getOuts().getStructure("ES_RETURN").getString("MESSAGE")); return new ModelAndView(getMsg(), models); } List<MaterialDetail> items = new ArrayList<MaterialDetail>(); JCO.Table jTable = model.getOuttab().getTable("ET_DETAIL"); PaginatedListHelper paginaredList = new PaginatedListHelper(); String currentPage = ParamUtils.getParameter(request, "page", "1"); paginaredList.setObjectsPerPage(3); paginaredList.setPageNumber(Integer.parseInt(currentPage)); paginaredList.setFullListSize(jTable.getNumRows()); int j = 0; int pageNum = jTable.getNumRows() / 3; if (jTable.getNumRows() % 3 > 0) { pageNum++; } for (int i = (Integer.parseInt(currentPage) - 1) * 3; i < jTable.getNumRows(); i++) { jTable.setRow(i); MaterialDetail item = new MaterialDetail(); item.setNum(j + 1); item.setMaterialGettenId(jTable.getString("MRFNR")); item.setLineItem(jTable.getString("SEQNO")); item.setFactory(jTable.getString("WERKS")); item.setWarehouse(jTable.getString("ZZLGORT")); item.setMaterialId(jTable.getString("ZZMATNR")); item.setMaterialDescription(jTable.getString("ZZMAKTX")); // item.setPerAmount(jTable.getString("ZZREMNG")); item.setPerAmount(String.valueOf(jTable.getDouble("ZZREMNG"))); item.setSendLocation(jTable.getString("ZZFLORT")); item.setUnit(jTable.getString("ZZMEINS")); item.setBatch(jTable.getString("ZZCHARG")); item.setPickingAmount(String.valueOf(jTable.getDouble("ZZJPMNG"))); items.add(item); j++; if (j == 5) { break; } paginaredList.setList(items); models.put("materialDetailList", items); models.put("page", currentPage); models.put("pageNum", pageNum); models.put("werks", SapUtil.null2String(request.getParameter("werks"))); models.put("lgort", SapUtil.null2String(request.getParameter("lgort"))); models.put("budat", SapUtil.null2String(request.getParameter("budat"))); models.put("materialGettenId", materialGettenId); } return new ModelAndView(getViewName(), models); } public String getViewName() { return viewName; } public void setViewName(String viewName) { this.viewName = viewName; } public UserService getUserService() { return userService; } }
[ "QianYang@244d0f91-ff8a-4924-8869-ed5808972776" ]
QianYang@244d0f91-ff8a-4924-8869-ed5808972776
4eaa97d0556d4a9fa25c5f706a9f89edf3155d4f
7c5b85b1aee095f30513a5fdd34a7b348dd26cfa
/src/test/java/com/rhb/istock/kdata/service/KdataServiceTest.java
6228be5115131486431f66bc6718c210b4df7c4a
[]
no_license
dofoyo/istock
e2b8b0199e22805bcda4a84bb65ce7de3b91b9ec
c17a2c3b0c3dd7105a66fa7f6a785bb55dd54b7d
refs/heads/master
2022-09-17T02:18:38.312448
2021-07-20T08:08:15
2021-07-20T08:08:15
175,619,249
0
0
null
2022-09-01T23:04:00
2019-03-14T12:39:06
Java
UTF-8
Java
false
false
4,011
java
package com.rhb.istock.kdata.service; import java.time.LocalDate; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.List; import java.util.Map; import java.util.Set; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import com.rhb.istock.kdata.Muster; import com.rhb.istock.comm.util.Functions; import com.rhb.istock.item.ItemService; import com.rhb.istock.kdata.Kbar; import com.rhb.istock.kdata.Kdata; import com.rhb.istock.kdata.KdataService; @RunWith(SpringJUnit4ClassRunner.class) @SpringBootTest public class KdataServiceTest { @Autowired @Qualifier("kdataServiceImp") KdataService kdataService; @Autowired @Qualifier("itemServiceImp") ItemService itemService; //@Test public void getSSEI() { String itemID = "sh000001"; boolean byCache = true; Kdata kdata = kdataService.getKdata(itemID, byCache); System.out.println(kdata.getLastBar().getDate()); } //@Test public void doOpen() throws Exception { //itemService.downItems(); // 1. 下载最新股票代码 //itemService.init(); // 2. //kdataService.downFactors(); // 3. 上一交易日的收盘数据要等开盘前才能下载到, 大约需要15分钟 //kdataService.downSSEI(); kdataService.generateLatestMusters(null, false); kdataService.updateLatestMusters(); } @Test public void generateMusters() { LocalDate date = LocalDate.parse("2017-01-25"); //kdataService.generateMusters(date); kdataService.generateLatestMusters(null, true); kdataService.updateLatestMusters(); } //@Test public void test() { String itemID = "sh600300"; Kdata data = kdataService.getKdata(itemID, false); System.out.println(data.getLastBar()); } //@Test public void getLastMusters() { LocalDate date = LocalDate.parse("2020-08-14"); Map<String,Muster> musters = kdataService.getMusters(date); List<Muster> mm = new ArrayList<Muster>(musters.values()); Collections.sort(mm, new Comparator<Muster>() { @Override public int compare(Muster o1, Muster o2) { if(o2.getAbove2121().compareTo(o1.getAbove2121())==0) { return o1.getCloseRateOf21().compareTo(o2.getCloseRateOf21()); } return o2.getAbove2121().compareTo(o1.getAbove2121()); }}); String str = null; //BigDecimal b = new BigDecimal(500000000).multiply(new BigDecimal(100)); //伍佰亿 for(Muster muster : mm) { //if(muster.getTotal_mv().compareTo(b)==-1) { str = String.format("%s, %s: %d %d %.2f\n", muster.getItemID(), muster.getItemName(), muster.getAbove2121(), muster.getAbove2189(), muster.getCloseRateOf21()); System.out.println(str); //} } } //@Test public void downClosedDatas() { System.out.println("down closed datas"); LocalDate date = LocalDate.parse("2021-06-04"); try { kdataService.downClosedDatas(date); //kdataService.downFactors(date); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } //@Test public void getSseiRatio() { List<LocalDate> dates = kdataService.getMusterDates(); for(LocalDate date : dates) { System.out.format("%tF, %d\n",date,kdataService.getSseiFlag(date)); } /* LocalDate date = LocalDate.parse("2020-03-20"); try { System.out.println(kdataService.getSseiFlag(date)); //System.out.println(kdataService.getSseiRatio(date, 8)); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); }*/ } //@Test public void testt() { LocalDate endDate = LocalDate.parse("2020-09-12"); List<LocalDate> dates = kdataService.getMusterDates(13, endDate); System.out.println(dates); } //@Test public void getBombingDates() { Set<LocalDate> dates = kdataService.getBombingDates(); System.out.println(dates); } }
[ "dofoyo@sina.cn" ]
dofoyo@sina.cn
d5b4f8597d25d9b0b97508ec691a743965b3f47c
da9af52bb02f1d6774e88465a26658f05075fd24
/src/test/java/com/ruke/vrjassc/vrjassc/ModuleTest.java
646eee5081f97fd30071e9ae9150e2d15903fe60
[]
no_license
spambolt/vrJASS
7a79a65c245c7b9536df2c79540af2d9f28628e8
cd127e5b5891bb64cdcfa325eeaf4a623915b862
refs/heads/master
2020-12-25T20:53:50.491818
2015-05-17T23:41:56
2015-05-17T23:41:56
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,530
java
package com.ruke.vrjassc.vrjassc; import static org.junit.Assert.*; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import com.ruke.vrjassc.vrjassc.exception.UndefinedModuleException; import com.ruke.vrjassc.vrjassc.util.Compile; public class ModuleTest { @Rule public ExpectedException expectedEx = ExpectedException.none(); @Test public void test() { Compile compile = new Compile(); String code = "library Bar\n" + "public struct Person extends array\n" + "implements Foo\n" + "endstruct\n" + "public module Foo\n" + "public static method lorem takes nothing returns integer\n" + "return 1\n" + "endmethod\n" + "private method ipsum takes integer i returns nothing\n" + "endmethod\n" + "endmodule\n" + "endlibrary"; String result = "function struct_s_Bar_Person_lorem takes nothing returns integer" + System.lineSeparator() + "return 1" + System.lineSeparator() + "endfunction" + System.lineSeparator() + "function struct_Bar_Person__ipsum takes integer this,integer i returns nothing" + System.lineSeparator() + System.lineSeparator() + "endfunction"; assertEquals(result, compile.run(code)); } @Test public void undefined() { Compile compile = new Compile(); String code = "struct Foo extends array\n" + "implement Bar\n" + "endstruct"; expectedEx.expect(UndefinedModuleException.class); expectedEx.expectMessage("2:10 Module <Bar> is not defined"); compile.run(code); } }
[ "franco.montenegro.ruke@gmail.com" ]
franco.montenegro.ruke@gmail.com
1f51ad1cf71a4e3b3e916fc2b9cc82a27918e540
208ba847cec642cdf7b77cff26bdc4f30a97e795
/zd/zb/src/main/java/org.wp.zb/util/HtmlUtils.java
1dbbc963964d4c58fac1e6a2b432468de3aa53e6
[]
no_license
kageiit/perf-android-large
ec7c291de9cde2f813ed6573f706a8593be7ac88
2cbd6e74837a14ae87c1c4d1d62ac3c35df9e6f8
refs/heads/master
2021-01-12T14:00:19.468063
2016-09-27T13:10:42
2016-09-27T13:10:42
69,685,305
0
0
null
2016-09-30T16:59:49
2016-09-30T16:59:48
null
UTF-8
Java
false
false
5,754
java
package org.wp.zb.util; import android.content.Context; import android.content.res.Resources; import android.text.Html; import android.text.SpannableStringBuilder; import android.text.Spanned; import android.text.TextUtils; import android.text.style.ForegroundColorSpan; import android.text.style.QuoteSpan; import org.apache.commons.lang.StringEscapeUtils; import org.wp.zb.util.helpers.WPHtmlTagHandler; import org.wp.zb.util.helpers.WPImageGetter; import org.wp.zb.util.helpers.WPQuoteSpan; public class HtmlUtils { /** * Removes html from the passed string - relies on Html.fromHtml which handles invalid HTML, * but it's very slow, so avoid using this where performance is important * @param text String containing html * @return String without HTML */ public static String stripHtml(final String text) { if (TextUtils.isEmpty(text)) { return ""; } return Html.fromHtml(text).toString().trim(); } /** * This is much faster than stripHtml() but should only be used when we know the html is valid * since the regex will be unpredictable with invalid html * @param str String containing only valid html * @return String without HTML */ public static String fastStripHtml(String str) { if (TextUtils.isEmpty(str)) { return str; } // insert a line break before P tags unless the only one is at the start if (str.lastIndexOf("<p") > 0) { str = str.replaceAll("<p(.|\n)*?>", "\n<p>"); } // convert BR tags to line breaks if (str.contains("<br")) { str = str.replaceAll("<br(.|\n)*?>", "\n"); } // use regex to strip tags, then convert entities in the result return trimStart(fastUnescapeHtml(str.replaceAll("<(.|\n)*?>", ""))); } /* * Same as apache.commons.lang.StringUtils.stripStart() but also removes non-breaking * space (160) chars */ private static String trimStart(final String str) { int strLen; if (str == null || (strLen = str.length()) == 0) { return ""; } int start = 0; while (start != strLen && (Character.isWhitespace(str.charAt(start)) || str.charAt(start) == 160)) { start++; } return str.substring(start); } /** * Convert html entities to actual Unicode characters - relies on commons apache lang * @param text String to be decoded to Unicode * @return String containing unicode characters */ public static String fastUnescapeHtml(final String text) { if (text == null || !text.contains("&")) { return text; } return StringEscapeUtils.unescapeHtml(text); } /** * Converts an R.color.xxx resource to an HTML hex color * @param context Android Context * @param resId Android R.color.xxx * @return A String HTML hex color code */ public static String colorResToHtmlColor(Context context, int resId) { try { return String.format("#%06X", 0xFFFFFF & context.getResources().getColor(resId)); } catch (Resources.NotFoundException e) { return "#000000"; } } /** * Remove {@code <script>..</script>} blocks from the passed string - added to project after noticing * comments on posts that use the "Sociable" plugin ( http://wordpress.org/plugins/sociable/ ) * may have a script block which contains {@code <!--//-->} followed by a CDATA section followed by {@code <!]]>,} * all of which will show up if we don't strip it here. * @see <a href="http://wordpress.org/plugins/sociable/">Wordpress Sociable Plugin</a> * @return String without {@code <script>..</script>}, {@code <!--//-->} blocks followed by a CDATA section followed by {@code <!]]>,} * @param text String containing script tags */ public static String stripScript(final String text) { if (text == null) { return null; } StringBuilder sb = new StringBuilder(text); int start = sb.indexOf("<script"); while (start > -1) { int end = sb.indexOf("</script>", start); if (end == -1) { return sb.toString(); } sb.delete(start, end + 9); start = sb.indexOf("<script", start); } return sb.toString(); } /** * An alternative to Html.fromHtml() supporting {@code <ul>}, {@code <ol>}, {@code <blockquote>} * tags and replacing EmoticonsUtils with Emojis * @param source * @param wpImageGetter */ public static SpannableStringBuilder fromHtml(String source, WPImageGetter wpImageGetter) { SpannableStringBuilder html; try { html = (SpannableStringBuilder) Html.fromHtml(source, wpImageGetter, new WPHtmlTagHandler()); } catch (RuntimeException runtimeException) { // In case our tag handler fails html = (SpannableStringBuilder) Html.fromHtml(source, wpImageGetter, null); } EmoticonsUtils.replaceEmoticonsWithEmoji(html); QuoteSpan spans[] = html.getSpans(0, html.length(), QuoteSpan.class); for (QuoteSpan span : spans) { html.setSpan(new WPQuoteSpan(), html.getSpanStart(span), html.getSpanEnd(span), html.getSpanFlags(span)); html.setSpan(new ForegroundColorSpan(0xFF666666), html.getSpanStart(span), html.getSpanEnd(span), html.getSpanFlags(span)); html.removeSpan(span); } return html; } public static Spanned fromHtml(String source) { return fromHtml(source, null); } }
[ "cedric.champeau@gmail.com" ]
cedric.champeau@gmail.com
aa3a95f43dce25aa18c8351eb030932a38413c6e
a4a0785da96e02427b9bbc7423860236548083f4
/src/com/mandyjcho/Procedures/Backtrack.java
2449ae1c978b7fc09267682d7974750c6afd2c1c
[]
no_license
MandyJCho/CSPSolver
5c29c49cfce0beadc823a2522666fb88318fef70
9fe794a158a83c9bb9a843cdec768d3d4bd70fee
refs/heads/master
2021-03-27T09:12:23.717809
2018-03-10T21:09:36
2018-03-10T21:09:36
123,151,727
1
0
null
null
null
null
UTF-8
Java
false
false
3,941
java
package com.mandyjcho.Procedures; import com.mandyjcho.Components.Assignment; import com.mandyjcho.Components.Constraint; import com.mandyjcho.Components.Variable; import java.util.*; public class Backtrack { private HashMap<Variable, List<Integer>> variableDomainMap; private List<Constraint> constraints; private boolean enforceFC; private int count = 0; public Backtrack(HashMap<String, Variable> variableMapping, List<Constraint> constraints, boolean enforceFC) { variableDomainMap = new HashMap<>(); for (Variable variable : variableMapping.values()) variableDomainMap.put(variable, variable.getDomain()); this.constraints = constraints; Heuristics.setConstraints(constraints); this.enforceFC = enforceFC; } private List<Integer> orderDomain(Variable variable, HashMap<Variable, List<Integer>> unassignedVars) { HashMap<Integer, Integer> evaluations = new HashMap<>(); List<Integer> domain = unassignedVars.get(variable); for(int value : domain) evaluations.put(value, Heuristics.getLeastConstrainingValueScore(variable, value, unassignedVars)); domain.sort((a, b) -> { int hOfA = evaluations.get(a), hOfB = evaluations.get(b); if (hOfA == hOfB) return a - b; return hOfB - hOfA; }); return domain; } private boolean isConsistent(Variable selection, int value, Assignment assignment) { HashMap<Variable, List<Integer>> variables = new HashMap<>(assignment.getFormattedSolution()); for(Constraint constraint : constraints) { Variable other = constraint.getOther(selection); if (!variables.containsKey(other)) continue; List<Variable> constraintVars = List.of(selection, other); if (constraint.contains(constraintVars) && constraint.enforceOn(selection, value, variables).size() == 0) return false; } return true; } private boolean forwardCheck(Variable variable, int value, HashMap<Variable, List<Integer>> unassignedVars) { for(Constraint constraint : constraints) { Variable other = constraint.getOther(variable); if (other != null && unassignedVars.containsKey(other)) { List<Integer> domain = constraint.enforceOn(variable, value, unassignedVars); if (domain.size() == 0) return true; unassignedVars.put(other, domain); } } return false; } public void solve() { solve(new Assignment(), variableDomainMap); } private boolean solve(Assignment assignment, HashMap<Variable, List<Integer>> unassignedVars) { if (unassignedVars.size() == 0) { System.out.println(++count + "." + assignment + " solution"); return true; } Variable variable = Heuristics.getMostConstrainedVariable(unassignedVars, assignment); List<Integer> domain = orderDomain(variable, unassignedVars); unassignedVars.remove(variable); Assignment nextAssignment = new Assignment(assignment); for (int value : domain) { nextAssignment.assign(variable, value); if (isConsistent(variable, value, assignment)) { if (enforceFC && forwardCheck(variable, value, unassignedVars)) { System.out.println(++count + "." + nextAssignment + " failure"); continue; } if (solve(nextAssignment, new HashMap<>(unassignedVars))) return true; } else System.out.println(++count + "." + nextAssignment + " failure"); nextAssignment.remove(variable); if (count == 30) System.exit(0); } return false; } }
[ "chomandy96@gmail.com" ]
chomandy96@gmail.com
67247b13cd8179dd8862e7c684cce140b70d8971
0493ffe947dad031c7b19145523eb39209e8059a
/OpenJdk8uTest/src/test/java/nio/channels/SocketChannel/SendUrgentData.java
2e314d429eb018f9c9da1fde2ae5b76bc4a17d49
[]
no_license
thelinh95/Open_Jdk8u_Test
7612f1b63b5001d1df85c1df0d70627b123de80f
4df362a71e680dbd7dfbb28c8922e8f20373757a
refs/heads/master
2021-01-16T19:27:30.506632
2017-08-13T23:26:05
2017-08-13T23:26:05
100,169,775
0
1
null
null
null
null
UTF-8
Java
false
false
7,166
java
package test.java.nio.channels.SocketChannel; /* * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ /* @test * @bug 8071599 * @run main/othervm SendUrgentData * @run main/othervm SendUrgentData -inline * @summary Test sending of urgent data. */ import java.io.IOException; import java.net.InetSocketAddress; import java.net.SocketAddress; import java.net.SocketException; import java.nio.ByteBuffer; import java.nio.channels.ServerSocketChannel; import java.nio.channels.SocketChannel; public class SendUrgentData { /** * The arguments may be one of the following: * <ol> * <li>-server</li> * <li>-client host port [-inline]</li> * <li>[-inline]</li> * </ol> * The first option creates a standalone server, the second a standalone * client, and the third a self-contained server-client pair on the * local host. * * @param args * @throws Exception */ public static void main(String[] args) throws Exception { ServerSocketChannelThread serverThread = new ServerSocketChannelThread("SendUrgentDataServer"); serverThread.start(); boolean b = serverThread.isAlive(); String host = null; int port = 0; boolean inline = false; if (args.length > 0 && args[0].equals("-server")) { System.out.println(serverThread.getAddress()); Thread.currentThread().suspend(); } else { if (args.length > 0 && args[0].equals("-client")) { host = args[1]; port = Integer.parseInt(args[2]); if (args.length > 3) { inline = args[2].equals("-inline"); } } else { host = "localhost"; port = serverThread.getAddress().getPort(); if (args.length > 0) { inline = args[0].equals("-inline"); } } } System.out.println("OOB Inline : "+inline); SocketAddress sa = new InetSocketAddress(host, port); try (SocketChannel sc = SocketChannel.open(sa)) { sc.configureBlocking(false); sc.socket().setOOBInline(inline); sc.socket().sendUrgentData(0); System.out.println("wrote 1 OOB byte"); ByteBuffer bb = ByteBuffer.wrap(new byte[100 * 1000]); int blocked = 0; long total = 0; int n; do { n = sc.write(bb); if (n == 0) { System.out.println("blocked, wrote " + total + " so far"); if (++blocked == 10) { break; } Thread.sleep(100); } else { total += n; bb.rewind(); } } while (n > 0); long attempted = 0; while (attempted < total) { bb.rewind(); n = sc.write(bb); System.out.println("wrote " + n + " normal bytes"); attempted += bb.capacity(); String osName = System.getProperty("os.name").toLowerCase(); try { sc.socket().sendUrgentData(0); } catch (IOException ex) { if (osName.contains("linux")) { if (!ex.getMessage().contains("Socket buffer full")) { throw new RuntimeException("Unexpected message", ex); } } else if (osName.contains("os x") || osName.contains("mac")) { if (!ex.getMessage().equals("No buffer space available")) { throw new RuntimeException("Unexpected message", ex); } } else if (osName.contains("windows")) { if (!(ex instanceof SocketException)) { throw new RuntimeException("Unexpected exception", ex); } else if (!ex.getMessage().contains("Resource temporarily unavailable")) { throw new RuntimeException("Unexpected message", ex); } } else { throw new RuntimeException("Unexpected IOException", ex); } } try { Thread.sleep(100); } catch (InterruptedException ex) { // don't want to fail on this so just print trace and break ex.printStackTrace(); break; } } } finally { serverThread.close(); } } static class ServerSocketChannelThread extends Thread { private ServerSocketChannel ssc; private ServerSocketChannelThread(String name) { super(name); try { ssc = ServerSocketChannel.open(); ssc.bind(new InetSocketAddress((0))); } catch (IOException ex) { throw new RuntimeException(ex); } } public void run() { while (ssc.isOpen()) { try { Thread.sleep(100); } catch (InterruptedException ex) { throw new RuntimeException(ex); } } try { ssc.close(); } catch (IOException ex) { throw new RuntimeException(ex); } System.out.println("ServerSocketChannelThread exiting ..."); } public InetSocketAddress getAddress() throws IOException { if (ssc == null) { throw new IllegalStateException("ServerSocketChannel not created"); } return (InetSocketAddress) ssc.getLocalAddress(); } public void close() { try { ssc.close(); } catch (IOException ex) { throw new RuntimeException(ex); } } } }
[ "truongthelinh95@gmail.com" ]
truongthelinh95@gmail.com
9e1984144fbc53a505b7974233e6e39ab6c2af4b
a3694a5abce7e1444e67108cd46b3455b01a7c06
/mobile2/com/trendmicro/hippo/ast/TryStatement.java
8c91a1fdc219e5fc84a5e59733737d4783a01275
[]
no_license
Hong5489/TrendMicroCTF2020
04de207d9e68b9db351805e7aa749846c0273c78
8beb5ff24cb118c3f4bae7957c316ea40248aa17
refs/heads/main
2022-12-24T21:50:39.493180
2020-10-09T05:21:18
2020-10-09T05:21:18
301,678,079
2
0
null
null
null
null
UTF-8
Java
false
false
3,488
java
package com.trendmicro.hippo.ast; import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; import java.util.List; public class TryStatement extends AstNode { private static final List<CatchClause> NO_CATCHES = Collections.unmodifiableList(new ArrayList<>()); private List<CatchClause> catchClauses; private AstNode finallyBlock; private int finallyPosition = -1; private AstNode tryBlock; public TryStatement() {} public TryStatement(int paramInt) { super(paramInt); } public TryStatement(int paramInt1, int paramInt2) { super(paramInt1, paramInt2); } public void addCatchClause(CatchClause paramCatchClause) { assertNotNull(paramCatchClause); if (this.catchClauses == null) this.catchClauses = new ArrayList<>(); this.catchClauses.add(paramCatchClause); paramCatchClause.setParent(this); } public List<CatchClause> getCatchClauses() { List<CatchClause> list = this.catchClauses; if (list == null) list = NO_CATCHES; return list; } public AstNode getFinallyBlock() { return this.finallyBlock; } public int getFinallyPosition() { return this.finallyPosition; } public AstNode getTryBlock() { return this.tryBlock; } public void setCatchClauses(List<CatchClause> paramList) { if (paramList == null) { this.catchClauses = null; } else { List<CatchClause> list = this.catchClauses; if (list != null) list.clear(); Iterator<CatchClause> iterator = paramList.iterator(); while (iterator.hasNext()) addCatchClause(iterator.next()); } } public void setFinallyBlock(AstNode paramAstNode) { this.finallyBlock = paramAstNode; if (paramAstNode != null) paramAstNode.setParent(this); } public void setFinallyPosition(int paramInt) { this.finallyPosition = paramInt; } public void setTryBlock(AstNode paramAstNode) { assertNotNull(paramAstNode); this.tryBlock = paramAstNode; paramAstNode.setParent(this); } public String toSource(int paramInt) { StringBuilder stringBuilder = new StringBuilder(250); stringBuilder.append(makeIndent(paramInt)); stringBuilder.append("try "); if (getInlineComment() != null) { stringBuilder.append(getInlineComment().toSource(paramInt + 1)); stringBuilder.append("\n"); } stringBuilder.append(this.tryBlock.toSource(paramInt).trim()); Iterator<CatchClause> iterator = getCatchClauses().iterator(); while (iterator.hasNext()) stringBuilder.append(((CatchClause)iterator.next()).toSource(paramInt)); if (this.finallyBlock != null) { stringBuilder.append(" finally "); stringBuilder.append(this.finallyBlock.toSource(paramInt)); } return stringBuilder.toString(); } public void visit(NodeVisitor paramNodeVisitor) { if (paramNodeVisitor.visit(this)) { this.tryBlock.visit(paramNodeVisitor); Iterator<CatchClause> iterator = getCatchClauses().iterator(); while (iterator.hasNext()) ((CatchClause)iterator.next()).visit(paramNodeVisitor); AstNode astNode = this.finallyBlock; if (astNode != null) astNode.visit(paramNodeVisitor); } } } /* Location: /root/Downloads/trendmicro/mobile2/test/classes-dex2jar.jar!/com/trendmicro/hippo/ast/TryStatement.class * Java compiler version: 8 (52.0) * JD-Core Version: 1.1.3 */
[ "hongwei5489@gmail.com" ]
hongwei5489@gmail.com
485ce345ed0de30425a50477bea334d570379ccf
ba320183b687d230146e448bf0eb45669bdc2b46
/apis/api-core/api-core-common/src/main/java/org/hoteia/qalingo/core/web/mvc/viewbean/BrandViewBean.java
38fb628edd2ad72d138ea28f22cc9e47130a47cb
[ "Apache-2.0" ]
permissive
FingolfinTEK/qalingo-b2c-engine
40061b679b7969831782f12958a2768a3e033210
a55503bf4c34cee3396a6183f8f1b60ee0e4a3de
refs/heads/master
2021-01-16T20:31:37.697995
2014-02-18T06:22:09
2014-02-18T06:22:09
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,360
java
/** * Most of the code in the Qalingo project is copyrighted Hoteia and licensed * under the Apache License Version 2.0 (release version 0.7.0) * http://www.apache.org/licenses/LICENSE-2.0 * * Copyright (c) Hoteia, 2012-2013 * http://www.hoteia.com - http://twitter.com/hoteia - contact@hoteia.com * */ package org.hoteia.qalingo.core.web.mvc.viewbean; import java.io.Serializable; public class BrandViewBean extends AbstractViewBean implements Serializable { /** * Generated UID */ private static final long serialVersionUID = 1947200664388789049L; protected String businessName; protected String code; protected String brandDetailsUrl; protected String brandLineDetailsUrl; public String getBusinessName() { return businessName; } public void setBusinessName(String businessName) { this.businessName = businessName; } public String getCode() { return code; } public void setCode(String code) { this.code = code; } public String getBrandDetailsUrl() { return brandDetailsUrl; } public void setBrandDetailsUrl(String brandDetailsUrl) { this.brandDetailsUrl = brandDetailsUrl; } public String getBrandLineDetailsUrl() { return brandLineDetailsUrl; } public void setBrandLineDetailsUrl(String brandLineDetailsUrl) { this.brandLineDetailsUrl = brandLineDetailsUrl; } }
[ "denis@Hoteia-Laptop.home" ]
denis@Hoteia-Laptop.home
70af1a7f66325ada091c80db8644304d9304b4a8
df0e3d4904c0c7bcbbe4136558844140009a40c8
/isoft_android/linkknown/app/src/main/java/com/linkknown/ilearning/model/ElementResponse.java
8ca98a59a8dde03c4531cd85026e8737ffe7abb2
[]
no_license
389093982/isoft
ae46653bd0bb1c39dffbf1781348045d4833b152
2d493d62c00b1f2bef376b043c5741e955d0bb24
refs/heads/master
2022-01-16T14:40:10.971916
2020-11-07T10:43:34
2020-11-07T10:43:34
229,756,814
1
0
null
2022-01-15T06:15:48
2019-12-23T13:20:28
Vue
UTF-8
Java
false
false
2,484
java
package com.linkknown.ilearning.model; import java.util.ArrayList; import java.util.Collections; import java.util.List; import lombok.Data; import lombok.EqualsAndHashCode; @Data @EqualsAndHashCode(callSuper = true) public class ElementResponse extends BaseResponse { private List<Element> elements; private Placement placement; @Data public static class Element { private String content; private String created_by; private String created_time; private String element_label; private String element_name; private int id; private String img_path; private String last_updated_by; private String last_updated_time; private String linked_refer; private String md_content; private int navigation_level; private int navigation_parent_id; private String placement; private int status; } @Data public static class Placement { private int app_id; private String created_by; private String created_time; private int element_limit; private int id; private String last_updated_by; private String last_updated_time; private String placement_desc; private String placement_label; private String placement_name; private String placement_type; } public static List<ElementResponse.Element> getLevelOneClassifyElements (List<ElementResponse.Element> elements) { List<ElementResponse.Element> levelOneElements = new ArrayList<>(); for (ElementResponse.Element element : elements) { if (element.getNavigation_level() == 0) { levelOneElements.add(element); } } Collections.sort(levelOneElements, (o1, o2) -> getLevelTwoClassifyElements(elements, o2.getId()).size() - getLevelTwoClassifyElements(elements, o1.getId()).size()); return levelOneElements; } public static List<ElementResponse.Element> getLevelTwoClassifyElements (List<ElementResponse.Element> elements, int parentId) { List<ElementResponse.Element> levelTwoElements = new ArrayList<>(); for (ElementResponse.Element element : elements) { if (element.getNavigation_parent_id() == parentId) { levelTwoElements.add(element); } } return levelTwoElements; } }
[ "389093982@qq.com" ]
389093982@qq.com
d5ab25dccc63722fcf35609dcccfdce7e2c575f2
9bd64ab4f1bad1aa3f06cabcc7386b216b8e70bb
/src/main/java/com/forquality/crud/service/dto/package-info.java
7d2c485afeb8fc7df2ccd8122f1a6f05a6cd8081
[]
no_license
BulkSecurityGeneratorProject/crud-universidade
cf3332823c119ac09cdcdfda7d6d18feb3c2703d
6f31d0b8732e30f246aba441856f16343e376140
refs/heads/master
2022-12-18T02:37:56.660855
2020-03-02T21:05:45
2020-03-02T21:05:45
296,570,861
0
0
null
2020-09-18T09:07:14
2020-09-18T09:07:13
null
UTF-8
Java
false
false
34
java
/** * Data Transfer Objects. */
[ "johnatanbrayan1@gmail.com" ]
johnatanbrayan1@gmail.com
74f92a087c23bdf65a459890047c5162029db369
39edc146f412fa53b23cc36787e62da5585d84fb
/app/src/main/java/com/udacity/radik/earthquake_info/Presenter/IMainPresenter.java
8fe27f562d2880ce418f588890110cbbc19ddf7d
[]
no_license
radikushch/Earthquake_Info
f0e78924f92d95eff8e513de010b6181e6d9f5b4
6b85d20fc89855527eb08bc0ccb486f19bfeb62e
refs/heads/master
2020-03-07T14:37:38.276989
2018-06-19T09:59:50
2018-06-19T09:59:50
127,531,259
0
0
null
null
null
null
UTF-8
Java
false
false
379
java
package com.udacity.radik.earthquake_info.Presenter; import com.udacity.radik.earthquake_info.View.MainActivity.IMainActivity; public interface IMainPresenter { void showLoading(); void hideLoading(); void openSettings(); void browseDetailInfo(String url); void onAttachView(IMainActivity view); void onDetachView(); void openSettingsActivity(); }
[ "radikushch@gmail.com" ]
radikushch@gmail.com
fbd6eb2c2f0e360bb8a98f44bd766146438e801e
21ae58cc752247ab7a8ab322d891c79550abdb81
/practices/src/com/ddd/com/Demo1.java
7453c85cbcd955bdb5ebbdf9c866c4b3b8c62fc6
[]
no_license
MACdress/xuptSTA
abf643f8a1ce8dbec22c8d4d63e7c901519fd416
e89d117081bbb5eacbb561e46e00dc6154d44528
refs/heads/master
2021-01-01T17:52:57.208872
2018-01-10T12:47:30
2018-01-10T12:47:30
98,183,129
0
0
null
2017-07-24T11:24:53
2017-07-24T11:24:53
null
UTF-8
Java
false
false
830
java
package com.ddd.com; import java.io.BufferedInputStream; import java.io.FileInputStream; public class Demo1 { public static void main(String[] args) throws Exception { FileInputStream fis = new FileInputStream("e:/my.sql"); // FileOutputStream fos = new FileOutputStream("f:/copy.sql"); BufferedInputStream bis = new BufferedInputStream(fis); int c = 0; System.out.println(bis.read()); System.out.println(bis.read()); bis.mark(100);// �ӵ�һ�ٸ��ַ������ for (int i = 0; i < 10 && (c = bis.read()) != -1; i++) { System.out.print(c + " "); } System.out.println(); bis.reset();// �ص���ǵ��Ǹ��㣬����һ�ٸ��ַ� for (int i = 0; i < 10 && (c = bis.read()) != -1; i++) { System.out.print(c + " "); } bis.close(); } }
[ "17691063749@163.com" ]
17691063749@163.com
da1e5122df79fae6346141d256678ce3cb5bbb16
f4a44244b9bfd0e50148454a263b269023b24c72
/baselib/src/main/java/com/qflbai.lib/net/rxjava/NetObserver.java
4a7224c521f07245a5eed9ca2eb4b30b6152ed8d
[]
no_license
qflbai/ImitateXiMaLaYa
6592b09b7c2a639b693db86680284a2f96eea421
388f30610657438dd2d1c3cc2149f569baff604b
refs/heads/master
2020-04-29T22:58:31.742451
2019-05-21T05:51:49
2019-05-21T05:51:49
176,464,141
0
0
null
null
null
null
UTF-8
Java
false
false
2,318
java
package com.qflbai.lib.net.rxjava; import com.qflbai.lib.base.repository.BaseRepository; import com.qflbai.lib.net.callback.NetCallback; import java.io.IOException; import io.reactivex.disposables.Disposable; import okhttp3.ResponseBody; import retrofit2.HttpException; import retrofit2.Response; /** * @author WenXian Bai * @Date: 2018/3/13. * @Description: */ public class NetObserver extends BaseObserver { /** * 回调接口 */ private NetCallback mNetCallback; private BaseRepository<BaseRepository> mBaseRepository; public NetObserver( NetCallback netCallback) { mNetCallback = netCallback; } public NetObserver(BaseRepository<BaseRepository> baseRepository, NetCallback netCallback) { mNetCallback = netCallback; mBaseRepository =baseRepository; } @Override public void onSubscribe(Disposable d) { if (mIsNetRequesting) { d.dispose(); } else { mNetCallback.onSubscribe(d); addNetManage(d); } if(mBaseRepository!=null){ mBaseRepository.addDisposable(d); } mIsNetRequesting = true; } @Override public void onNext(Response<ResponseBody> response) { mIsNetRequesting = false; boolean successful = response.isSuccessful(); if (successful) { int code = response.code(); if (code == 200) { try { String jsonString = response.body().string(); mNetCallback.onResponse(jsonString); } catch (IOException e) { mNetCallback.onError(e); e.printStackTrace(); } } else { netError(response); } } else { netError(response); } } /** * 网络异常 * * @param response */ private void netError(Response<ResponseBody> response) { HttpException httpException = new HttpException(response); mNetCallback.onError(httpException); } @Override public void onError(Throwable e) { mIsNetRequesting = false; mNetCallback.onError(e); } @Override public void onComplete() { mIsNetRequesting = false; } }
[ "qflbai@163.com" ]
qflbai@163.com
9fdc9cae985f8c5a0d3b78b2e133feb974735c15
94edad040d6a0e9f56a5bb0ba09bcc8834d66036
/app/src/main/java/com/example/plantzone/ui/profile/ProfileFragment.java
918cfe47e1fc0433a67631138716ff717787c4af
[]
no_license
Queen-Violet07/PlantApp
bdcd8c18a31a2bebd5e05a9e5281503d78b52aa9
b96907f785a2366cb18b7c60d3a50b12eafec855
refs/heads/master
2023-07-31T03:03:28.069131
2021-09-22T15:33:28
2021-09-22T15:33:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,713
java
package com.example.plantzone.ui.profile; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.EditText; import android.widget.ImageView; import android.widget.TextView; import android.widget.Toast; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; import androidx.lifecycle.Observer; //import androidx.lifecycle.ViewModelProvider; import com.bumptech.glide.Glide; import com.example.plantzone.R; import com.example.plantzone.databinding.FragmentProfileBinding; import com.example.plantzone.models.userModel; import com.google.android.gms.tasks.OnSuccessListener; import com.google.firebase.auth.FirebaseAuth; 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.google.firebase.storage.FirebaseStorage; import com.google.firebase.storage.StorageReference; import com.google.firebase.storage.UploadTask; public class ProfileFragment extends Fragment { ImageView profileImg; EditText name,email,number,address; Button update; FirebaseStorage storage; FirebaseAuth auth; FirebaseDatabase database; public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View root=inflater.inflate(R.layout.fragment_profile,container,false); auth=FirebaseAuth.getInstance(); database=FirebaseDatabase.getInstance(); storage=FirebaseStorage.getInstance(); profileImg=root.findViewById(R.id.profile_img); name=root.findViewById(R.id.profile_name); email=root.findViewById(R.id.profile_email); address=root.findViewById(R.id.profile_address); number=root.findViewById(R.id.profile_number); update=root.findViewById(R.id.update); database.getReference().child("Users").child(FirebaseAuth.getInstance().getUid()) .addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange(@NonNull DataSnapshot snapshot) { userModel Model=snapshot.getValue(userModel.class); Glide.with(getContext()).load(Model.getProfileImg()).into(profileImg); } @Override public void onCancelled(@NonNull DatabaseError error) { } }); profileImg.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent=new Intent(); intent.setAction(Intent.ACTION_GET_CONTENT); intent.setType("image/*"); startActivityForResult(intent,33); } }); update.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { updateUserProfile(); } }); return root; } private void updateUserProfile() { } @Override public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { super.onActivityResult(requestCode, resultCode, data); if(data.getData()!=null){ Uri profileUri=data.getData(); profileImg.setImageURI(profileUri); final StorageReference reference=storage.getReference().child("profile_picture") .child(FirebaseAuth.getInstance().getUid()); reference.putFile(profileUri).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() { @Override public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) { Toast.makeText(getContext(), "Uploaded", Toast.LENGTH_SHORT).show(); reference.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() { @Override public void onSuccess(Uri uri) { database.getReference().child("Users").child(FirebaseAuth.getInstance().getUid()) .child("profileImg").setValue(uri.toString()); Toast.makeText(getContext(), "Profile Picture Uploaded", Toast.LENGTH_SHORT).show(); } }); } }); } } }
[ "mehrin.afroz78@gmail.com" ]
mehrin.afroz78@gmail.com