blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
132 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
28 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
352
efbf02d8b33371228ef07549f56d56a9de63b9d7
6c83483587db7414c3e4399865d4c3cef0bc7d18
/src/test/java/selectors/LogoutSelectors.java
4337d831c39eb5b2acad3df9b52639c312c814a3
[]
no_license
rak041988/automationpractice-gradle-bdd-project
78df4c5d3d822b5d59e75768defec29059f56790
8fcc0de53c5c19205425b65a0c1fb5e582bd7934
refs/heads/master
2021-02-11T16:16:45.272745
2018-02-05T22:25:43
2018-02-05T22:25:43
244,509,126
0
0
null
2020-03-03T00:55:16
2020-03-03T00:55:15
null
UTF-8
Java
false
false
196
java
package selectors; import org.openqa.selenium.By; /** * Created by babu on 12/07/2016. */ public class LogoutSelectors { public static final By LINK_SIGNOUT = By.cssSelector(".logout"); }
[ "automation9006@gmail.com" ]
automation9006@gmail.com
7291616a6262291be0129e20ae170bc8a6068c70
5b99fae72704b9926e42e49c35dd4fe4a985d2de
/DIT011/Code Examples from Lenart/Buttons etc/ButtonDemo.java
d62466425cb49edefecf07008f2802d7b00a2158
[]
no_license
dsignlife/gjava
db67909d509289284de5ee5953c85aae190bf558
a199b82a47e68c228f2fdce7605b86bb563ec37b
refs/heads/master
2020-04-07T13:59:06.428114
2017-09-05T14:00:35
2017-09-05T14:00:35
42,174,503
0
0
null
null
null
null
UTF-8
Java
false
false
2,071
java
//package chapter16; //import chapter14.MessagePanel; import java.awt.*; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import javax.swing.*; public class ButtonDemo extends JFrame { // Create a panel for displaying message protected MessagePanel messagePanel = new MessagePanel("Welcome to Java"); // Declare two buttons to move the message left and right private JButton jbtLeft = new JButton("<="); private JButton jbtRight = new JButton("=>"); public static void main(String[] args) { ButtonDemo frame = new ButtonDemo(); frame.setTitle("ButtonDemo"); frame.setLocationRelativeTo(null); // Center the frame frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(500, 200); frame.setVisible(true); } public ButtonDemo() { // Set the background color of messagePanel messagePanel.setBackground(Color.white); // Create Panel jpButtons to hold two Buttons "<=" and "right =>" JPanel jpButtons = new JPanel(); jpButtons.setLayout(new FlowLayout()); jpButtons.add(jbtLeft); jpButtons.add(jbtRight); // Set keyboard mnemonics jbtLeft.setMnemonic('L'); jbtRight.setMnemonic('R'); // Set icons and remove text // jbtLeft.setIcon(new ImageIcon("image/left.gif")); // jbtRight.setIcon(new ImageIcon("image/right.gif")); // jbtLeft.setText(null); // jbtRight.setText(null); // Set tool tip text on the buttons jbtLeft.setToolTipText("Move message to left"); jbtRight.setToolTipText("Move message to right"); // Place panels in the frame setLayout(new BorderLayout()); add(messagePanel, BorderLayout.CENTER); add(jpButtons, BorderLayout.SOUTH); // Register listeners with the buttons jbtLeft.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { messagePanel.moveLeft(); } }); jbtRight.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { messagePanel.moveRight(); } }); } }
[ "dsign-life@hotmail.com" ]
dsign-life@hotmail.com
aa79f267578c2e397a84dfc1d1815e1ed7d660b9
31b9efd67000b884e0ca81937df7aa2961e5ff4f
/app/src/main/java/ru/kackbip/impactMapping/screens/goals/di/GoalsComponent.java
c4e226f855367733d81cea3a4b4f3652970d36df
[]
no_license
vladimirandroid/ImpactMapping
6ce0a30b7e1f1d658495fcc17ebde447c6157642
0912821bcac716ad56a981bbf359f6508ef20377
refs/heads/master
2021-06-09T21:55:05.617414
2016-11-25T14:02:36
2016-11-25T14:02:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
411
java
package ru.kackbip.impactMapping.screens.goals.di; import javax.inject.Singleton; import dagger.Subcomponent; import ru.kackbip.impactMapping.application.di.BaseComponent; import ru.kackbip.impactMapping.screens.goals.view.GoalsView; /** * Created by ryashentsev on 18.10.2016. */ @Singleton @Subcomponent(modules = {GoalsModule.class}) public interface GoalsComponent extends BaseComponent<GoalsView>{ }
[ "kackbip@gmail.com" ]
kackbip@gmail.com
f9e5296762a92461cb956368151c2a7a5e5a5d15
b66c867004e73f79b08d90e0347dd2770cff6999
/src/main/java/utils/MySqlConnection.java
aef91ae3fce6b68cc6f0ce0994b030ad223998e4
[]
no_license
nhatanhmc/DemoThymeleaf
3be102e3ea71b62fe8275ce6a1a9a88b75f29453
e2ad927742f262ce903ce83c781c9083a81c5868
refs/heads/master
2020-06-04T21:34:23.676704
2019-07-01T18:40:37
2019-07-01T18:40:37
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,605
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 utils; import org.apache.commons.dbcp2.BasicDataSource; /** * * @author Admin */ public class MySqlConnection { public static volatile BasicDataSource ds = null; public MySqlConnection() { try { if (ds == null) { ds = new BasicDataSource(); ds.setUrl("jdbc:mysql://" + EnvironmentVariable.getDBHost() + ":3306/" + EnvironmentVariable.getDBDatabase() + "?autoReconnect=true&useSSL=false&allowMultiQueries=true"); ds.setUsername(EnvironmentVariable.getDBUser()); ds.setPassword(EnvironmentVariable.getDBPass()); ds.setMaxTotal(150); ds.setMinIdle(30); ds.setMaxIdle(70); ds.setMaxConnLifetimeMillis(3000); ds.setDriverClassName("com.mysql.cj.jdbc.Driver"); ds.setInitialSize(50); ds.setRemoveAbandonedOnBorrow(true); ds.setAbandonedUsageTracking(false); ds.setLogExpiredConnections(false); ds.setLifo(false); ds.addConnectionProperty("useUnicode", "true"); ds.addConnectionProperty("characterEncoding", "UTF-8"); ds.setRemoveAbandonedOnMaintenance(true); } } catch (Exception e) { System.out.println("xxx"); } } }
[ "nhatanh2996@gmail.com" ]
nhatanh2996@gmail.com
d476a20fa63d9d29b10a68d205f9ba7c1ff52476
824eaf14728fd97ec24b7afb8f4f7c036128a336
/Dnevnik_back_end/src/main/java/com/iktpreobuka/elektronski_dnevnik_os/services/Razred_SkolskaGodinaDaoImp.java
653afc8c22e2ebdcc9a46f4c858940d040094ea8
[]
no_license
petarplecas/Elektronski-dnevnik-za-osnovnu-skolu
79200e48430686d6b67483193bffc7d24d3852fa
4e14386953443af72953880bb6eff2adf0088b74
refs/heads/master
2020-04-01T13:58:59.622079
2018-10-16T12:17:24
2018-10-16T12:17:24
153,275,348
0
0
null
null
null
null
UTF-8
Java
false
false
1,007
java
package com.iktpreobuka.elektronski_dnevnik_os.services; import java.util.LinkedHashMap; import java.util.Map; import org.springframework.stereotype.Service; @Service public class Razred_SkolskaGodinaDaoImp implements Razred_SkolskaGodinaDao { @Override public String toRomanNumerals(Integer Int) { LinkedHashMap<String, Integer> roman_numerals = new LinkedHashMap<String, Integer>(); roman_numerals.put("V", 5); roman_numerals.put("IV", 4); roman_numerals.put("I", 1); String res = ""; for(Map.Entry<String, Integer> entry : roman_numerals.entrySet()){ Integer matches = Int/entry.getValue(); res += repeat(entry.getKey(), matches); Int = Int % entry.getValue(); } return res; } public static String repeat(String s, int n) { if(s == null) { return null; } final StringBuilder sb = new StringBuilder(); for(int i = 0; i < n; i++) { sb.append(s); } return sb.toString(); } }
[ "plecaspetar3@gmail.com" ]
plecaspetar3@gmail.com
b74baf4098902fb5021fd9fe75494bc58567790b
e578f3bb4a5d8be100c8b6306f379c08a49df11f
/src/main/java/com/ml/gb/serialization/Toy.java
051911ee2135d0225a75e0af645fc6b69e9ed0d9
[]
no_license
flamearrow/yo-model
f178c851ac5904ac59f3fd6adc8ece43794fc816
5c8949faa97db4b7d96ccfce7e18a9dae432ccea
refs/heads/master
2016-09-05T20:19:42.798944
2014-07-30T03:51:54
2014-07-30T03:51:54
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,401
java
package com.ml.gb.serialization; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; import java.io.OutputStream; import org.apache.avro.Schema; import org.apache.avro.generic.GenericData; import org.apache.avro.generic.GenericDatumReader; import org.apache.avro.generic.GenericDatumWriter; import org.apache.avro.generic.GenericRecord; import org.apache.avro.io.BinaryDecoder; import org.apache.avro.io.DatumReader; import org.apache.avro.io.DatumWriter; import org.apache.avro.io.DecoderFactory; import org.apache.avro.io.Encoder; import org.apache.avro.io.EncoderFactory; public class Toy { public static void main(String[] args) throws IOException { File schemaFile = new File("src/main/avro/user.avsc"); Schema schema = new Schema.Parser().parse(schemaFile); GenericRecord user1 = new GenericData.Record(schema); user1.put("name", "mlgb"); user1.put("id", 12345l); GenericRecord user2 = new GenericData.Record(schema); user2.put("name", "bglm"); user2.put("id", 54321l); // Serialize into bytes[] File dstFile = new File("src/main/avro/user.avro"); DatumWriter<GenericRecord> datumWriter = new GenericDatumWriter<GenericRecord>( schema); OutputStream out = new ByteArrayOutputStream(); Encoder encoder = EncoderFactory.get().binaryEncoder(out, null); datumWriter.write(user1, encoder); datumWriter.write(user2, encoder); encoder.flush(); out.close(); // DataFileWriter<GenericRecord> dataFileWriter = new // DataFileWriter<GenericRecord>( // datumWriter); // dataFileWriter.create(schema, dstFile); // dataFileWriter.append(user1); // dataFileWriter.append(user2); // dataFileWriter.close(); // Deserialize DatumReader<GenericRecord> datumReader = new GenericDatumReader<GenericRecord>( schema); BinaryDecoder decoder = DecoderFactory.get().binaryDecoder( ((ByteArrayOutputStream) out).toByteArray(), null); GenericRecord user = null; while ((user = datumReader.read(null, decoder)) != null) { System.out.println(user); } // DataFileReader<GenericRecord> dataFileReader = new // DataFileReader<GenericRecord>( // dstFile, datumReader); // GenericRecord user = null; // while (dataFileReader.hasNext()) { // user = dataFileReader.next(user); // System.out.println(user); // System.out.println(user.get("name")); // System.out.println(user.get("id")); // } } }
[ "Chen@flamearrow.home" ]
Chen@flamearrow.home
42ee04580ad8b2ebf387a3eee72cac336f916372
35a620858338f371c42a5c78139dc94b45cf087b
/src/com/mckc/LeetCode/LeetCode1716.java
eb7b7a35009abb92064a9cebc62a690dc3a11724
[]
no_license
XI1062-abhisheksinghal/CoreJava-Algo
ed9e7b747c83f4165ba852715bd94a444795bfb6
703290326e145288d13328f54265232bd15edffd
refs/heads/master
2023-05-25T21:08:03.152354
2023-05-20T08:19:01
2023-05-20T08:19:01
267,253,987
0
0
null
null
null
null
UTF-8
Java
false
false
733
java
package com.mckc.LeetCode; public class LeetCode1716 { public static void main(String[] args) { System.out.println(totalMoney(10)); } static int sum = 0; public static int totalMoney(int n) { int quo = n / 7; int start = 1; int rem = n % 7; while (quo >= 1) { sum = sum + calSum(start, 7); start = start + 1; quo--; } if (rem > 0) { sum = sum + calSum(start, rem); } return sum; } public static int calSum(int start, int nums) { int s = 0; for (int i = 1; i <= nums; i++) { s = s + start; start++; } return s; } }
[ "Abhishek_Singhal-GGN@external.mckinsey.com" ]
Abhishek_Singhal-GGN@external.mckinsey.com
c611fd898b7bb5b5100c2ea25afd66172c1b495c
c88dcfa9bfeb9dafb83a9c9cd37856fc2e71c6de
/Airplane.java
7ffd4e7c2ebb9adb3b572b094029b51613c498c0
[]
no_license
itsKen/BlueJ
a4ef366c9395955b976a8769d489d4f6f3a43a71
c3aa21999dc73576fa3146ac24b5be546d553f8e
refs/heads/master
2021-07-07T19:05:42.998030
2017-10-01T07:02:38
2017-10-01T07:02:38
105,425,195
0
0
null
null
null
null
UTF-8
Java
false
false
12,193
java
/** * Write a description of class Airplane here. * ** @author (your name)? * @version (a version number or a date) */ import java.util.*; public class Airplane { private final int ROW = 13; //ROW 1 - 12 private final int SECTION = 5; //SEAT A - D private Seat[][] seats; private int numberOfSeats = 48; public Airplane() { seats = new Seat[SECTION][ROW]; initializeSeats(); } /** * Initializes the seats */ public void initializeSeats() { for (int j = 1; j < ROW; j++) { boolean firstClass = true; if (j > 4) firstClass = false; for (int i = 1; i < SECTION; i++) { String section = "E"; boolean windowView = true; if (i == 1) section = "A"; else if (i == 2) { section = "B"; windowView =false; } else if (i == 3) { section = "C"; windowView = false; } else section = "D"; Seat temp = new Seat(section,j); temp.setWindowView(windowView); //temp.setSeatSection(section); temp.setSeatClass(firstClass); seats[i][j] = temp; } } } /** * Randomly assigns passengers * @param p the passnger */ public void assignS(Passenger p){ Random a = new Random(); boolean Trust = true; while(Trust == true){ int section = a.nextInt(SECTION - 1) +1; int row = a.nextInt(ROW - 1) + 1; if(seats[section][row].getVacancy() == true){ seats[section][row].setVacancy(false); seats[section][row].assignPassenger(p); } } } /** * checks if the section is a window section * @param j the section */ public boolean windowChecker(String j) { if(j.equals("A")||j.equals("D")) { return true; } return false; } /** * Converts all the sections to numbers * @param j the sectioin */ public int converter(String j){ if(j.equals("A")) { return 1; } else if (j.equals("B")) { return 2; } else if(j.equals("C")) { return 3; } else if(j.equals("D")) { return 4; } else if(j.equals("E")) { return 5; } else if(j.equals("F")) { return 6; } else if(j.equals("G")) { return 7; } else { return 8; } } /** * Reserves a seat for the passenger * @param section the section * @param row the row * @param bob The passenger * (Precondition:row >= 0) */ public void Reserve(String section, int row, Passenger bob) { seats[converter(section)][row].setVacancy(false); seats[converter(section)][row].setPassenger(bob); if(section.equalsIgnoreCase("B") || section.equalsIgnoreCase("C")) { seats[converter(section)][row].setWindowView(false); } } /** * Asks the user thier preference of reservation */ public void Preference(){ Scanner input = new Scanner(System.in); System.out.println("To Sit in First Class Press 1"); System.out.println("To Sit in a Window Seat Press 2"); System.out.println("To Sit in Both First Class and a Window Seat Press 3"); int p = input.nextInt(); if(p == 1){ P1(); } else if(p == 2){ P2(); } else if (p == 3){ P3(); } } /** * Seats a passenger in the first 4 rows */ public void P1(){ Scanner input = new Scanner(System.in); System.out.println("What row do you want to sit in?" ); int row = Integer.parseInt(input.nextLine()); System.out.println("What section do you want to sit in?"); String section = input.nextLine(); if(checkAvail(section, row) == true && row <= 4) { System.out.println("Enter first name: "); String fName = input.nextLine(); System.out.println("Enter last name: "); String lName = input.nextLine(); Passenger bob = new Passenger(fName, lName); Reserve(section, row, bob); printSeats(); } else{ System.out.println("Sorry, Not Availible"); DisplayMenu(); } DisplayMenu(); } /** * seats the passenger in a window seat */ public void P2(){ Scanner input = new Scanner(System.in); System.out.println("What row do you want to sit in?" ); int row = Integer.parseInt(input.nextLine()); System.out.println("What section do you want to sit in?"); String section = input.nextLine(); if(checkAvail(section, row) == true && (section.equalsIgnoreCase("A") || section.equalsIgnoreCase("D"))) { System.out.println("Enter first name: "); String fName = input.nextLine(); System.out.println("Enter last name: "); String lName = input.nextLine(); Passenger bob = new Passenger(fName, lName); Reserve(section, row, bob); printSeats(); } else{ System.out.println("Sorry, Not Availible"); DisplayMenu(); } DisplayMenu(); } /** * seats the passenger in a window and firstclass(the first 4 rows) seat */ public void P3(){ Scanner input = new Scanner(System.in); System.out.println("What row do you want to sit in?" ); int row = Integer.parseInt(input.nextLine()); System.out.println("What section do you want to sit in?"); String section = input.nextLine(); if(checkAvail(section, row) == true && (section.equalsIgnoreCase("A") || section.equalsIgnoreCase("D")) && row <= 4) { System.out.println("Enter first name: "); String fName = input.nextLine(); System.out.println("Enter last name: "); String lName = input.nextLine(); Passenger bob = new Passenger(fName, lName); Reserve(section, row, bob); printSeats(); } else{ System.out.println("Sorry, Not Availible"); DisplayMenu(); } DisplayMenu(); } /** * seats the passenger in a nonpreferential seat */ public void NoPref(){ Scanner input = new Scanner(System.in); System.out.println("What row do you want to sit in?" ); int row = Integer.parseInt(input.nextLine()); System.out.println("What section do you want to sit in?"); String section = input.nextLine(); if(checkAvail(section, row) == true) { System.out.println("Enter first name: "); String fName = input.nextLine(); System.out.println("Enter last name: "); String lName = input.nextLine(); Passenger bob = new Passenger(fName, lName); Reserve(section, row, bob); printSeats(); } else{ System.out.println("Sorry, that seat is already taken. "); DisplayMenu(); } DisplayMenu(); } /** * randomly fills up the seats * @param numberOfSeats the number of seats * (Precondition: numberOfSeats <= 0) */ public void randomFill(int numberOfSeats) { Scanner input = new Scanner (System.in); Random generator = new Random(); int counter = 0; String first = "Unknown"; String last = "Assilant"; Passenger p = new Passenger(first,last); while (counter < numberOfSeats) { int section = generator.nextInt(4) + 1; int row = generator.nextInt(12) + 1; if (seats[section][row].getVacancy() == true) { seats[section][row].setVacancy(false); seats[section][row].assignPassenger(p); counter++; } } } /** * checks the vacacncy of the seats * @param section the section * @param row the row * (Precondition: row <= 0) */ public boolean checkAvail(String section, int row) { return (seats[converter(section)][row].getVacancy()); } /** * Prints the seats */ public void printSeats() { for (int j = 1; j < SECTION; j++) { for (int i = 1; i < ROW; i++) { if (seats[j][i].getVacancy() == true) System.out.print("[" + "] "); else System.out.print("[X" + "] "); } System.out.println(); } } /** * Seats a group of passenger */ public void GroupSeat(){ Scanner input = new Scanner(System.in); System.out.println("The Number of People in the Group: "); int GroupSize = input.nextInt(); for (int j = 1; j < SECTION; j++) { for (int i = 1; i < ROW; i++) { if(GS1(i, j, GroupSize) == true){ GS2(j,i,GroupSize); } } } DisplayMenu(); } /** * checks if the group of seats is availible * (Postcondition: GS1 == true) * @param groupsize the group size * @param row the row * @param section the section * (Precondition: groupsize >= 0, row >= 0) */ public boolean GS1(int groupsize, int row, int section){ int a = row; int b = section; while(groupsize >= 0){ if(seats[b][a].getVacancy() == false) return false; else{ b++; groupsize--; if(b == SECTION){ b = 1; a++; } } } return true; } /** * groups the passengers * @param groupsize the group size * @param row the row * @param section the section * (Precondition: groupsize >=0, row >= 0, section >= 0) */ public void GS2(int groupsize, int row, int section){ Scanner input = new Scanner(System.in); int j = section; int i = row; System.out.println("Enter Passenger First Name"); String first = input.nextLine(); System.out.println("Enter Passenger Last Name"); String last = input.nextLine(); while(groupsize > 0){ if(seats[j][i].getVacancy() == true){ Passenger p = new Passenger(first, last); seats[section][row].setVacancy(false); seats[section][row].assignPassenger(p); } else{ j++; groupsize--; if(j == SECTION){ j = 1; i++; } } } } /** * Prints the passenger names and they have window view, first class, economy class, or aisle */ public void PrintPassenger(){ for (int j = 1; j < SECTION; j++) { for (int i = 1; i < ROW; i++) { if (seats[j][i].getVacancy() == false){ if(seats[j][i].getWindowViewStatus() == true && seats[j][i].getRow() <= 4){ System.out.println("Passenger : "+seats[j][i].getPassenger().getFullName()+""); System.out.println("Section : "+seats[j][i].getSeatSection()+""); System.out.println("Row : "+seats[j][i].getRow()+""); System.out.println("Has Window View and First Class"); System.out.println(); } else if(seats[j][i].getWindowViewStatus() == false && seats[j][i].getRow() <= 4){ System.out.println("Passenger : "+seats[j][i].getPassenger().getFullName()+""); System.out.println("Section : "+seats[j][i].getSeatSection()+""); System.out.println("Row : "+seats[j][i].getRow()+""); System.out.println("Has Aisle View and First Class"); System.out.println(); } else if(seats[j][i].getWindowViewStatus() == true && seats[j][i].getRow() > 4){ System.out.println("Passenger : "+seats[j][i].getPassenger().getFullName()+""); System.out.println("Section : "+seats[j][i].getSeatSection()+""); System.out.println("Row : "+seats[j][i].getRow()+""); System.out.println("Has Window View and Economy Class"); System.out.println(); } else { System.out.println("Passenger : "+seats[j][i].getPassenger().getFullName()+""); System.out.println("Section : "+seats[j][i].getSeatSection()+""); System.out.println("Row : "+seats[j][i].getRow()+""); System.out.println("Has Aisle view and Economy Class"); System.out.println(); } } else{ } } } DisplayMenu(); } /** * Asks the User the name of the passenger they will like to remove */ public void remove1(){ Scanner input = new Scanner(System.in); System.out.println("Enter First Name"); String First = input.nextLine(); System.out.println("Enter Last Name"); String Last = input.nextLine(); Passenger a = new Passenger(First, Last); remove2(a); DisplayMenu(); } /** * Removes the passenger * @param p the passenger */ public void remove2(Passenger p){ for (int j = 1; j < SECTION; j++) { for (int i = 1; i < ROW; i++) { if (seats[j][i].getVacancy() == false){ if(seats[j][i].getPassenger().getFullName().equalsIgnoreCase(p.getFullName())){ seats[j][i].clearSeat(); return; } } } } } /** * Display Menu for the User to use */ public void DisplayMenu(){ Scanner input = new Scanner(System.in); System.out.println("Welcome to the Airplane, what would you like to do?"); System.out.println("To Reserve a Seat with no preference, Press 1"); System.out.println("To Reserve a Seat with preference, Press 2"); System.out.println("To Reserve a Group, Press 3"); System.out.println("To Cancel a reservation, Press 4"); System.out.println("To Print the names of all the passengers, Press 5"); System.out.println("To Print out the Seats Press 6"); System.out.println("To Exit out of this Press any key"); int a = input.nextInt(); if(a == 1){ NoPref(); } else if(a == 2){ Preference(); } else if(a == 3){ GroupSeat(); } else if(a == 4){ remove1(); } else if(a == 5){ PrintPassenger(); } else if(a == 6){ printSeats(); DisplayMenu(); } } /** * Prints out the seats, display menu, and randomly fill */ public static void main(String[] args){ Airplane crash = new Airplane(); crash.randomFill(0); crash.printSeats(); crash.DisplayMenu(); } }
[ "kennethnguyenog@gmail.com" ]
kennethnguyenog@gmail.com
ff31a0f2e577b937d0fd1601c9bbbefdbeff8b3d
afc8faa3409f4cf3c470db167f3f180f2279249f
/src/main/java/com/finastra/cpq/finastraCPQ/deserializedjsonresponseobjects/commondeserializedobjects/SFObjectResponseAttributes.java
c56543da1c2184b8a33efe1f49e99703828377d2
[]
no_license
mssachin/fincpq
db4036df95c058780890a34212660516977d9c21
5580cdb8a307c770d1f04592b43ee620aae7a9c1
refs/heads/master
2020-04-12T10:30:59.692648
2018-12-19T12:07:56
2018-12-19T12:07:56
162,431,971
0
0
null
null
null
null
UTF-8
Java
false
false
377
java
package com.finastra.cpq.finastraCPQ.deserializedjsonresponseobjects.commondeserializedobjects; import lombok.AccessLevel; import lombok.Getter; import lombok.Setter; public class SFObjectResponseAttributes { @Getter(AccessLevel.PUBLIC) @Setter(AccessLevel.PUBLIC) String type; @Getter(AccessLevel.PUBLIC) @Setter(AccessLevel.PUBLIC) String url; }
[ "sachin.mylavarapu@finastra.com" ]
sachin.mylavarapu@finastra.com
b93282d773b9bd0d361feb238b1f259d1922b248
729e0f85568b174a69a69b2238ff7cefaeb8d3e2
/localprovider/src/main/java/com/sh3h/localprovider/greendaoEntity/Violation.java
af6e0c0c8b8b891738438bff03a2d105ee81b769
[]
no_license
michael-dzm/IndemnityCenter
6b3a4c473d5617fd9743ae7252e166d865725912
8c550dde654f3d9d7df382d08a2da17231e6eb8b
refs/heads/master
2020-03-17T13:03:16.763672
2018-05-16T05:38:00
2018-05-16T05:38:00
133,614,945
1
0
null
null
null
null
UTF-8
Java
false
false
2,226
java
package com.sh3h.localprovider.greendaoEntity; import org.greenrobot.greendao.annotation.Entity; import org.greenrobot.greendao.annotation.Id; import org.greenrobot.greendao.annotation.Property; import org.greenrobot.greendao.annotation.Generated; /** * 违规配置信息表 * Created by dengzhimin on 2017/3/28. */ @Entity(nameInDb = "BZ_VIOLATION") public class Violation { @Id(autoincrement = true) @Property(nameInDb = "VIOLATION_ID") private Long VIOLATION_ID;//违规ID @Property(nameInDb = "VIOLATION_NUMBER") private Long VIOLATION_NUMBER;//违规编号 @Property(nameInDb = "VIOLATION_TYPE") private String VIOLATION_TYPE;//违规类型 @Property(nameInDb = "VIOLATION_CONTENT") private String VIOLATION_CONTENT;//违规内容 private String REMARK;//备注 @Generated(hash = 1729234783) public Violation(Long VIOLATION_ID, Long VIOLATION_NUMBER, String VIOLATION_TYPE, String VIOLATION_CONTENT, String REMARK) { this.VIOLATION_ID = VIOLATION_ID; this.VIOLATION_NUMBER = VIOLATION_NUMBER; this.VIOLATION_TYPE = VIOLATION_TYPE; this.VIOLATION_CONTENT = VIOLATION_CONTENT; this.REMARK = REMARK; } @Generated(hash = 1789693990) public Violation() { } public Long getVIOLATION_ID() { return this.VIOLATION_ID; } public void setVIOLATION_ID(Long VIOLATION_ID) { this.VIOLATION_ID = VIOLATION_ID; } public Long getVIOLATION_NUMBER() { return this.VIOLATION_NUMBER; } public void setVIOLATION_NUMBER(Long VIOLATION_NUMBER) { this.VIOLATION_NUMBER = VIOLATION_NUMBER; } public String getVIOLATION_TYPE() { return this.VIOLATION_TYPE; } public void setVIOLATION_TYPE(String VIOLATION_TYPE) { this.VIOLATION_TYPE = VIOLATION_TYPE; } public String getVIOLATION_CONTENT() { return this.VIOLATION_CONTENT; } public void setVIOLATION_CONTENT(String VIOLATION_CONTENT) { this.VIOLATION_CONTENT = VIOLATION_CONTENT; } public String getREMARK() { return this.REMARK; } public void setREMARK(String REMARK) { this.REMARK = REMARK; } }
[ "dengzhimin@shanghai3h.com" ]
dengzhimin@shanghai3h.com
77c1dd6111f23bf48b422772b067a71adfb11ffb
5ec2812776078eb918a4e9c7fb60b2ac847bb24e
/weaforce-web-cms/src/main/java/com/weaforce/cms/dao/impl/ContentDao.java
4b316508fe86222fb732bc3b729aee39d36992ba
[]
no_license
liveqmock/weaforce-cms
0d3716a1126c3e9e9192f6f228551b16e4776d83
87fbe6c4a480614c574a6a40e786722277723e3b
refs/heads/master
2020-04-02T01:09:49.472756
2014-09-13T10:11:19
2014-09-13T10:11:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
349
java
package com.weaforce.cms.dao.impl; import org.springframework.stereotype.Repository; import com.weaforce.cms.dao.IContentDao; import com.weaforce.cms.entity.ArticleContent; import com.weaforce.core.dao.impl.GenericDao; @Repository("articleContentDao") public class ContentDao extends GenericDao<ArticleContent, Long> implements IContentDao { }
[ "jiacheng.yan@aliyun.com" ]
jiacheng.yan@aliyun.com
24ac17f11feea701416e2d38adb629f594ca13ad
b8e76bfc981176fd83ef415963a714c298537ed4
/CBP/plugin/identity/fermat-cbp-plugin-identity-crypto-customer-bitdubai/src/main/java/com/bitdubai/fermat_cbp_plugin/layer/identity/crypto_customer/developer/bitdubai/version_1/database/CryptoCustomerIdentityDeveloperDatabaseFactory.java
4fefb6b21280e99f77b6c527c2891bf01f3591c4
[ "MIT" ]
permissive
jadzalla/fermat-unused
827b9c8ccb805be934acb14479b28fbddf56306c
d5e9633109caac3e88e9e3109862ae40d962cd96
refs/heads/master
2020-03-17T00:49:29.989918
2015-10-06T04:51:46
2015-10-06T04:51:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,889
java
package com.bitdubai.fermat_cbp_plugin.layer.identity.crypto_customer.developer.bitdubai.version_1.database; import com.bitdubai.fermat_api.DealsWithPluginIdentity; import com.bitdubai.fermat_api.layer.all_definition.developer.DeveloperDatabase; import com.bitdubai.fermat_api.layer.all_definition.developer.DeveloperDatabaseTable; import com.bitdubai.fermat_api.layer.all_definition.developer.DeveloperDatabaseTableRecord; import com.bitdubai.fermat_api.layer.all_definition.developer.DeveloperObjectFactory; import com.bitdubai.fermat_api.layer.osa_android.database_system.Database; import com.bitdubai.fermat_api.layer.osa_android.database_system.DatabaseRecord; import com.bitdubai.fermat_api.layer.osa_android.database_system.DatabaseTable; import com.bitdubai.fermat_api.layer.osa_android.database_system.DatabaseTableRecord; import com.bitdubai.fermat_api.layer.osa_android.database_system.DealsWithPluginDatabaseSystem; import com.bitdubai.fermat_api.layer.osa_android.database_system.PluginDatabaseSystem; import com.bitdubai.fermat_api.layer.osa_android.database_system.exceptions.CantCreateDatabaseException; import com.bitdubai.fermat_api.layer.osa_android.database_system.exceptions.CantLoadTableToMemoryException; import com.bitdubai.fermat_api.layer.osa_android.database_system.exceptions.DatabaseNotFoundException; import com.bitdubai.fermat_api.layer.osa_android.database_system.exceptions.CantOpenDatabaseException; import com.bitdubai.fermat_cbp_plugin.layer.identity.crypto_customer.developer.bitdubai.version_1.exceptions.CantInitializeCryptoCustomerIdentityDatabaseException; import java.util.ArrayList; import java.util.List; import java.util.UUID; /** * The Class <code>com.bitdubai.fermat_cbp_plugin.layer.identity.crypto_customer.developer.bitdubai.version_1.database.CryptoCustomerIdentityDeveloperDatabaseFactory</code> have * contains the methods that the Developer Database Tools uses to show the information. * <p/> * * Created by Jorge Gonzalez - (jorgeejgonzalez@gmail.com) on 28/09/15. * * @version 1.0 * @since Java JDK 1.7 */ public class CryptoCustomerIdentityDeveloperDatabaseFactory implements DealsWithPluginDatabaseSystem, DealsWithPluginIdentity { /** * DealsWithPluginDatabaseSystem Interface member variables. */ PluginDatabaseSystem pluginDatabaseSystem; /** * DealsWithPluginIdentity Interface member variables. */ UUID pluginId; Database database; /** * Constructor * * @param pluginDatabaseSystem * @param pluginId */ public CryptoCustomerIdentityDeveloperDatabaseFactory(PluginDatabaseSystem pluginDatabaseSystem, UUID pluginId) { this.pluginDatabaseSystem = pluginDatabaseSystem; this.pluginId = pluginId; } /** * This method open or creates the database i'll be working with * * @throws CantInitializeCryptoCustomerIdentityDatabaseException */ public void initializeDatabase() throws CantInitializeCryptoCustomerIdentityDatabaseException { try { /* * Open new database connection */ database = this.pluginDatabaseSystem.openDatabase(pluginId, pluginId.toString()); } catch (CantOpenDatabaseException cantOpenDatabaseException) { /* * The database exists but cannot be open. I can not handle this situation. */ throw new CantInitializeCryptoCustomerIdentityDatabaseException(cantOpenDatabaseException.getMessage()); } catch (DatabaseNotFoundException e) { /* * The database no exist may be the first time the plugin is running on this device, * We need to create the new database */ CryptoCustomerIdentityDatabaseFactory cryptoCustomerIdentityDatabaseFactory = new CryptoCustomerIdentityDatabaseFactory(pluginDatabaseSystem); try { /* * We create the new database */ database = cryptoCustomerIdentityDatabaseFactory.createDatabase(pluginId, pluginId.toString()); } catch (CantCreateDatabaseException cantCreateDatabaseException) { /* * The database cannot be created. I can not handle this situation. */ throw new CantInitializeCryptoCustomerIdentityDatabaseException(cantCreateDatabaseException.getMessage()); } } } public List<DeveloperDatabase> getDatabaseList(DeveloperObjectFactory developerObjectFactory) { /** * I only have one database on my plugin. I will return its name. */ List<DeveloperDatabase> databases = new ArrayList<DeveloperDatabase>(); databases.add(developerObjectFactory.getNewDeveloperDatabase("Crypto Customer", this.pluginId.toString())); return databases; } public List<DeveloperDatabaseTable> getDatabaseTableList(DeveloperObjectFactory developerObjectFactory) { List<DeveloperDatabaseTable> tables = new ArrayList<DeveloperDatabaseTable>(); /** * Table Crypto Customer columns. */ List<String> cryptoCustomerColumns = new ArrayList<String>(); cryptoCustomerColumns.add(CryptoCustomerIdentityDatabaseConstants.CRYPTO_CUSTOMER_CRYPTO_CUSTOMER_PUBLIC_KEY_COLUMN_NAME); cryptoCustomerColumns.add(CryptoCustomerIdentityDatabaseConstants.CRYPTO_CUSTOMER_ALIAS_COLUMN_NAME); cryptoCustomerColumns.add(CryptoCustomerIdentityDatabaseConstants.CRYPTO_CUSTOMER_DEVICE_USER_PUBLIC_KEY_COLUMN_NAME); /** * Table Crypto Customer addition. */ DeveloperDatabaseTable cryptoCustomerTable = developerObjectFactory.getNewDeveloperDatabaseTable(CryptoCustomerIdentityDatabaseConstants.CRYPTO_CUSTOMER_TABLE_NAME, cryptoCustomerColumns); tables.add(cryptoCustomerTable); return tables; } public List<DeveloperDatabaseTableRecord> getDatabaseTableContent(DeveloperObjectFactory developerObjectFactory, DeveloperDatabaseTable developerDatabaseTable) { /** * Will get the records for the given table */ List<DeveloperDatabaseTableRecord> returnedRecords = new ArrayList<DeveloperDatabaseTableRecord>(); /** * I load the passed table name from the SQLite database. */ DatabaseTable selectedTable = database.getTable(developerDatabaseTable.getName()); try { selectedTable.loadToMemory(); } catch (CantLoadTableToMemoryException cantLoadTableToMemory) { /** * if there was an error, I will returned an empty list. */ return returnedRecords; } List<DatabaseTableRecord> records = selectedTable.getRecords(); List<String> developerRow = new ArrayList<String>(); for (DatabaseTableRecord row : records) { /** * for each row in the table list */ for (DatabaseRecord field : row.getValues()) { /** * I get each row and save them into a List<String> */ developerRow.add(field.getValue().toString()); } /** * I create the Developer Database record */ returnedRecords.add(developerObjectFactory.getNewDeveloperDatabaseTableRecord(developerRow)); } /** * return the list of DeveloperRecords for the passed table. */ return returnedRecords; } @Override public void setPluginDatabaseSystem(PluginDatabaseSystem pluginDatabaseSystem) { this.pluginDatabaseSystem = pluginDatabaseSystem; } @Override public void setPluginId(UUID pluginId) { this.pluginId = pluginId; } }
[ "jorgeejgonzalez@gmail.com" ]
jorgeejgonzalez@gmail.com
6df7f9e6e1b36411f09109ca6bf1b96ea5f776df
95bec9ea0a0e3b84f1722cd6bf1aa19349e6099e
/src/main/java/org/mockito/internal/creation/bytebuddy/package-info.java
00bf82774f5a85c195d47c24b18be310bc5abe7d
[ "MIT" ]
permissive
yangfancoming/mockito
fab90dbe69faf8958fc840208ed3e4a8801d7911
5aa9df3d4ffab02339081d1cf1a8fe691d1be20a
refs/heads/master
2020-06-13T21:21:25.181334
2019-07-02T05:39:51
2019-07-02T05:39:51
194,789,228
0
0
null
null
null
null
UTF-8
Java
false
false
87
java
/** * ByteBuddy related stuff. */ package org.mockito.internal.creation.bytebuddy;
[ "34465021+jwfl724168@users.noreply.github.com" ]
34465021+jwfl724168@users.noreply.github.com
38b44b7e3d0ae10fe51716393dddfbb5db93bb4e
88ca91ab368f504f3a5bac8f7b874c5994951bd1
/oop/src/main/java/com/wanshare/oop/bridge/Client.java
0189be23577597ffabba3b5bec71403e474caeb8
[]
no_license
hgwwy/oop
5d4d351500a7462abc8339bbf8e30235ebddd29f
802033c8dadf6817bbed898ffba74ad283ee3ee0
refs/heads/master
2020-03-29T22:04:47.051100
2018-09-26T09:44:47
2018-09-26T09:44:47
150,402,053
0
0
null
null
null
null
UTF-8
Java
false
false
288
java
package com.wanshare.oop.bridge; class Client { public static void main(String args[]) { Image image; ImageImp imp; image = new GIFImage(); imp = new LinuxImp(); image.setImageImp(imp); image.parseFile("小龙女"); } }
[ "wangwenyang@wxbtc.com" ]
wangwenyang@wxbtc.com
2a4867e133d777796e64306ca7d78a6a1be6d561
00abc1aec703a1d48c393bf853be907fc44280f5
/yeb-generator/src/main/java/com/ming/service/impl/AdminServiceImpl.java
8ee8fd03326b53c94d8610664e5dd84ac4d634a6
[]
no_license
xiaoming-master/yeb
81c5f96e70881c5d9cff1b521f74a27c56115d24
843750239e67c1f92969a7990ac304c952e33593
refs/heads/master
2023-06-24T09:27:42.757753
2021-07-24T17:30:08
2021-07-24T17:30:08
387,009,042
0
0
null
null
null
null
UTF-8
Java
false
false
450
java
package com.ming.service.impl; import com.ming.pojo.Admin; import com.ming.mapper.AdminMapper; import com.ming.service.IAdminService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; /** * <p> * 服务实现类 * </p> * * @author zhanglishen * @since 2021-07-17 */ @Service public class AdminServiceImpl extends ServiceImpl<AdminMapper, Admin> implements IAdminService { }
[ "1186927930@qq.com" ]
1186927930@qq.com
2591c001146540984448274c0225d1d98a44e415
9da91ed524c7cd13d442e82439bd661cd48d87ab
/src/DogDoor.java
78c16fcb6d57ba8cdcf2e02716ae8108ca306f56
[]
no_license
t00137667/DogDoor
abb4b0a9f59e7b4ec961b79ad0e968746cb71006
2ca0afb63e6b91ce3286a5d5207136fe402c0007
refs/heads/master
2020-09-05T03:23:07.665912
2019-11-06T10:12:05
2019-11-06T10:12:05
219,967,981
0
0
null
null
null
null
UTF-8
Java
false
false
718
java
import java.util.Timer; import java.util.TimerTask; public class DogDoor { private boolean open; public DogDoor(){ this.open = false; } public void open(){ System.out.println("The dog door is opening"); open=true; } public void close(){ System.out.println("The dog door is closing"); open=false; } public void openTimed(){ open(); final Timer timer = new Timer(); timer.schedule(new TimerTask(){ public void run(){ close(); timer.cancel(); } },5000); } //returns the state of the door public boolean isOpen(){ return open; } }
[ "T00137667@gmail.com" ]
T00137667@gmail.com
0b6b7593d5b621dca88abdc75e500e37d8e0f121
b3cc77ecfb35b2bfa6025967fb9c2491ff0e188d
/app/src/main/java/com/example/klinik_pln/activity/CekAntrianActivity.java
0d45d73d5564d22f828087dba082826de4112858
[]
no_license
azwarbahar/Klinik_Pln
920e632d8928ca58a2dff9b3ee3bfb7ffe884d33
55d5910bf1a78435b57ca5e5188f3c0b7daf8a1b
refs/heads/master
2023-06-26T00:26:11.804679
2021-07-21T13:14:32
2021-07-21T13:14:32
329,935,521
0
0
null
null
null
null
UTF-8
Java
false
false
1,453
java
package com.example.klinik_pln.activity; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.TextView; import com.example.klinik_pln.R; import com.example.klinik_pln.activity.PasienActivity; public class CekAntrianActivity extends AppCompatActivity { //Terima data dari Branda private String GET_KODE = "get_kode"; private String GET_PERIKSA = "get_periksa"; private String GET_TGL = "get_tgl"; private String GET_JAM = "get_jam"; private TextView no_antrian; private TextView tv_no_periksa; private TextView tv_jam; private TextView tv_tgl; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_cek_antrian); no_antrian = findViewById(R.id.no_antrian); tv_no_periksa = findViewById(R.id.tv_no_periksa); tv_jam = findViewById(R.id.tv_jam); tv_tgl = findViewById(R.id.tv_tgl); DapatData(); } private void DapatData(){ Bundle bundle = getIntent().getExtras(); assert bundle != null; no_antrian.setText(bundle.getString(GET_KODE)); tv_no_periksa.setText(bundle.getString(GET_PERIKSA)); tv_jam.setText(bundle.getString(GET_JAM)); tv_tgl.setText(bundle.getString(GET_TGL)); } }
[ "azwarbahar07@gmail.com" ]
azwarbahar07@gmail.com
1b2d1540837af8c45db8a1b4e338764fb033d7e4
52571bbc269a804c7df8f7b27ae3c41ee84f84f2
/leetcode/src/main/java/codexe/han/leetcode/escapeplan/escape116.java
f1722b153047de56ccb98876b95142720ff14af7
[]
no_license
codexehan/java-related
8b684b18b2402983cfd0ab6e44a860b8c014f0e7
a023a4f3e87a6558925af49f35de2f39bb0c1194
refs/heads/master
2020-05-07T06:02:43.118869
2019-12-30T10:40:55
2019-12-30T10:40:55
180,296,971
0
0
null
null
null
null
UTF-8
Java
false
false
1,391
java
package codexe.han.leetcode.escapeplan; public class escape116 { public Node connect(Node root) { if(root==null) return null; if(root.left!=null) root.left.next=root.right; if(root.next!=null && root.right!=null) root.right.next=root.next.left; connect(root.left); connect(root.right); return root; } public Node bft(Node node){ if(node==null) return null; if(node.left!=null) node.left.next = node.right; if(node.next!=null) node.right.next = node.next.left;//perfect binary tree bft(node.left); bft(node.right); return node; } class Node { public int val; public Node left; public Node right; public Node next; public Node() {} public Node(int _val,Node _left,Node _right,Node _next) { val = _val; left = _left; right = _right; next = _next; } } } /** You are given a perfect binary tree where all leaves are on the same level, and every parent has two children. The binary tree has the following definition: struct Node { int val; Node *left; Node *right; Node *next; } Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be set to NULL. Initially, all next pointers are set to NULL. */
[ "bingzhenchao@mozat.com" ]
bingzhenchao@mozat.com
bd741ab5044f96eb7e32dca16aa95cea97febe80
8be64239f0053da0409d1b76776c90a91e21a2f4
/Escapa.java
35e5cc3ca390eab9e9790110cad195b92bb29e99
[]
no_license
josenegrete0204/Hormiga
2ef0849d56e3ec8120e460c0068034e62cdf8742
6c1b9388a3a3bfc899bfbf5863dd77e1a9d36021
refs/heads/master
2023-03-18T08:43:57.816129
2021-03-12T03:14:36
2021-03-12T03:14:36
346,904,293
1
0
null
null
null
null
UTF-8
Java
false
false
322
java
public function Escapa() :void { velocity = new Vector3D(Game.instance.leaf.x - position.x, Game.instance.leaf.y - position.y); if (distance(Game.instance.leaf, this) <= 12) { brain.setState(Casa); } if (distance(Game.mouse, this) <= MOUSE_THREAT_RADIUS) { brain.setState(Escapa); } }
[ "80445929+josenegrete0204@users.noreply.github.com" ]
80445929+josenegrete0204@users.noreply.github.com
50e4c66f19acf38aec16c2dc96dd5b665abfffcb
d7bc172e7351a60af6b900aeb256a5c77d60581e
/myproject/myproject-biz/src/main/java/com/example/service/demo/impl/StudentServiceImpl.java
8733f78ae241eefaed8dd41e36ef816b5966f422
[]
no_license
weichunya/springBoot_learn
d95a3701fde57d5cff428a91259e32da537c12e6
7d0243abed4992ff6aaf10adcd6defe172492e49
refs/heads/master
2021-09-04T11:14:49.400111
2018-01-18T06:18:01
2018-01-18T06:18:01
116,772,452
0
0
null
null
null
null
UTF-8
Java
false
false
710
java
package com.example.service.demo.impl; import com.example.dao.demo.StudentDAO; import com.example.entity.demo.StudentDTO; import com.example.service.demo.StudentService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; /** * Created by 01444966 on 2017/12/28. */ @Service public class StudentServiceImpl implements StudentService { @Autowired private StudentDAO studentDAO; @Override public List<StudentDTO> getAllStudentInfo() { return studentDAO.getAllStudentInfo(); } @Override public StudentDTO getStudentById(Integer id) { return studentDAO.getStudentById(id); } }
[ "1007519590@qq.com" ]
1007519590@qq.com
401dea9658caef4a2570ecd26aabfef3b7cfee4b
9c83397528e9e425670a4288f99a7e9c4746e23f
/src/main/java/pkg/FloatToIntBitsConverter.java
2438a9dbc8e445e5ff1a90d142d350b18516e5e7
[]
no_license
awizisieakat/float-to-int-test
babdc506ba2290a33284b0f8770e7aab3c03b661
cf32da25131af5a304c7bdaa28d07c020ae9e2bb
refs/heads/master
2021-01-19T23:42:35.149515
2017-04-21T18:43:01
2017-04-21T18:43:01
89,013,784
0
0
null
null
null
null
UTF-8
Java
false
false
89
java
package pkg; public interface FloatToIntBitsConverter { int convert(float value); }
[ "awizisie.akat@o2.pl" ]
awizisie.akat@o2.pl
ed98f2023019de9b4de3241ff4d92cff99526b28
36eee821e6cd6d18667dcf495e74fb4e238ed9e8
/labs/lab06-assignment-registration/src/main/java/com/iihtibm/registration/domain/MyUser.java
f04c1f7e0b454526bc014300c937283e261ec9f9
[]
no_license
lqsavage/FSD
3cd4bfffa2bb2ab2239202333782f27de3cfde74
d0fd92ff0d6c21cf8f0d6aaf795a98228bb8685c
refs/heads/master
2020-06-10T14:55:16.855871
2019-10-22T07:38:50
2019-10-22T07:38:50
193,659,246
0
0
null
2019-10-22T07:38:51
2019-06-25T07:40:52
JavaScript
UTF-8
Java
false
false
1,062
java
package com.iihtibm.registration.domain; import lombok.Data; import javax.persistence.*; import javax.validation.constraints.Email; import javax.validation.constraints.NotBlank; import javax.validation.constraints.Size; import java.io.Serializable; /** * @author savagelee */ @Data @Entity @Table(name = "myuser") public class MyUser implements Serializable { private static final long serialVersionUID = 3497935890426858541L; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long userId; @NotBlank @Size(min=2, max=20) private String name; @NotBlank @Email private String email; @NotBlank @Size(min=2, max=20) private String username; @NotBlank @Size(min=6, max=60) private String password; @NotBlank private String role; @Transient private boolean accountNonExpired = true; @Transient private boolean accountNonLocked= true; @Transient private boolean credentialsNonExpired= true; @Transient private boolean enabled= true; }
[ "lqsavage@163.com" ]
lqsavage@163.com
49e13eb37736519b10513a96da88c993b9bef41f
b534bd5ff47d73dae63c9ecbd4df6b68ac1f3279
/src/main/java/com/java/project/checkin/controller/EmailConfigController.java
97761949bc79564ab0857887042d49430f4499ff
[]
no_license
Armando-Perea/CheckInControl
e41bbe5ffa3b6126cb4129fc8a84b6defb6dbfb6
c460ad0169f9ff8a1f8cbff550be5d92a77f97ee
refs/heads/master
2023-04-09T17:52:02.948311
2021-04-07T01:21:27
2021-04-07T01:21:27
310,453,916
0
0
null
2021-04-07T01:21:30
2020-11-06T00:51:22
Java
UTF-8
Java
false
false
2,333
java
package com.java.project.checkin.controller; import java.util.List; import java.util.Optional; import java.util.logging.Logger; import javax.transaction.Transactional; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.java.project.checkin.models.EmailConfig; import com.java.project.checkin.repo.impl.EmailConfigRepoImpl; @RestController @RequestMapping("checkincontrol/system/emailConfig") public class EmailConfigController { private static Logger log = Logger.getLogger(EmailConfigController.class.getName()); @Autowired EmailConfigRepoImpl emailConfigRepoImpl; @GetMapping("/getAllEmailConfig") public List<EmailConfig> getAllEmailConfig(){ log.info("getAllClosure Controller"); return emailConfigRepoImpl.getAllEmailConfig(); } @GetMapping("/getEmailConfigById/{id}") public Optional<EmailConfig> getEmailConfigById(@PathVariable Integer id){ log.info("getEmailConfigById Controller"); return emailConfigRepoImpl.getEmailConfigById(id); } @PostMapping("/createEmailConfig") public EmailConfig createEmailConfig(@RequestBody EmailConfig emailConfig){ log.info("createEmailConfig Controller"); return emailConfigRepoImpl.saveEmailConfig(emailConfig); } @PutMapping("/updateEmailConfig") public EmailConfig updateEmailConfig(@RequestBody EmailConfig emailConfig){ log.info("updateEmailConfig Controller"); return emailConfigRepoImpl.updateEmailConfig(emailConfig); } @DeleteMapping("/deleteEmailConfig/{id}") public void deleteEmailConfig(@PathVariable Integer id){ log.info("deleteEmailConfig Controller"); emailConfigRepoImpl.deleteEmailConfig(id); } @Transactional @GetMapping("/truncateEmailConfig") public String truncateEmailConfig(){ log.info("truncateEmailConfig Controller"); emailConfigRepoImpl.truncateEmailConfig(); return "Truncated"; } }
[ "terry900407@gmail.com" ]
terry900407@gmail.com
55899568e9cd25842ee1222449edb05fdbd983c5
a6ba7fc9f30f71a898070fdb785f34e3f0a9f44d
/Team406/src/main/java/org/firstinspires/ftc/team406/oldOpModes/Examples/PushBotTelemetry.java
30c7bbc72adcd825f222508b0d32f69a2aafc55d
[ "BSD-3-Clause" ]
permissive
PsouthRobotics1182/FTC16-17
cb140c75ba9bbcb066ab91da4947c0db05cee423
93b066954decbd20454c42099cca9571ffd108a1
refs/heads/master
2020-04-10T00:53:16.736907
2017-04-05T20:39:08
2017-04-05T20:39:08
68,239,103
0
0
null
null
null
null
UTF-8
Java
false
false
4,728
java
/* package com.qualcomm.ftcrobotcontroller.opmodes; //------------------------------------------------------------------------------ // // PushBotTelemetry // */ /** * Provide telemetry provided by the PushBotHardware class. * * Insert this class between a custom op-mode and the PushBotHardware class to * display telemetry available from the hardware class. * * @author SSI Robotics * @version 2015-08-02-13-57 * * Telemetry Keys * 00 - Important message; sometimes used for error messages. * 01 - The power being sent to the left drive's motor controller and the * encoder count returned from the motor controller. * 02 - The power being sent to the right drive's motor controller and the * encoder count returned from the motor controller. * 03 - The power being sent to the left arm's motor controller. * 04 - The position being sent to the left and right hand's servo * controller. * 05 - The negative value of gamepad 1's left stick's y (vertical; up/down) * value. * 06 - The negative value of gamepad 1's right stick's y (vertical; * up/down) value. * 07 - The negative value of gamepad 2's left stick's y (vertical; up/down) * value. * 08 - The value of gamepad 2's X button (true/false). * 09 - The value of gamepad 2's Y button (true/false). * 10 - The value of gamepad 1's left trigger value. * 11 - The value of gamepad 1's right trigger value. *//* public class PushBotTelemetry extends PushBotHardware { //-------------------------------------------------------------------------- // // PushBotTelemetry // */ /** * Construct the class. * * The system calls this member when the class is instantiated. *//* public PushBotTelemetry () { // // Initialize base classes. // // All via self-construction. // // Initialize class members. // // All via self-construction. } // PushBotTelemetry //-------------------------------------------------------------------------- // // update_telemetry // */ /** * Update the telemetry with current values from the base class. *//* public void update_telemetry () { if (a_warning_generated ()) { set_first_message (a_warning_message ()); } // // Send telemetry data to the driver station. // telemetry.addData ( "01" , "Left Drive: " + a_left_drive_power () + ", " + a_left_encoder_count () ); telemetry.addData ( "02" , "Right Drive: " + a_right_drive_power () + ", " + a_right_encoder_count () ); telemetry.addData ( "03" , "Left Arm: " + a_left_arm_power () ); telemetry.addData ( "04" , "Hand Position: " + a_hand_position () ); } // update_telemetry //-------------------------------------------------------------------------- // // update_gamepad_telemetry // */ /** * Update the telemetry with current gamepad readings. *//* public void update_gamepad_telemetry () { // // Send telemetry data concerning gamepads to the driver station. // telemetry.addData ("05", "GP1 Left: " + -gamepad1.left_stick_y); telemetry.addData ("06", "GP1 Right: " + -gamepad1.right_stick_y); telemetry.addData ("07", "GP2 Left: " + -gamepad2.left_stick_y); telemetry.addData ("08", "GP2 X: " + gamepad2.x); telemetry.addData ("09", "GP2 Y: " + gamepad2.y); telemetry.addData ("10", "GP1 LT: " + gamepad1.left_trigger); telemetry.addData ("11", "GP1 RT: " + gamepad1.right_trigger); } // update_gamepad_telemetry //-------------------------------------------------------------------------- // // set_first_message // */ /** * Update the telemetry's first message with the specified message. *//* public void set_first_message (String p_message) { telemetry.addData ( "00", p_message); } // set_first_message //-------------------------------------------------------------------------- // // set_error_message // */ /** * Update the telemetry's first message to indicate an error. *//* public void set_error_message (String p_message) { set_first_message ("ERROR: " + p_message); } // set_error_message } // PushBotTelemetry */
[ "zoghbya8828@parkwayschools.net" ]
zoghbya8828@parkwayschools.net
f51552d6a7106c7a7462abbd443d81fb8cee9e02
1f19aec2ecfd756934898cf0ad2758ee18d9eca2
/u-1/u-11/u-11-111/u-11-111-1111/u-11-111-1111-11111/u-11-111-1111-11111-f4376.java
2c2331036dea101024308af447a758c2a5d02554
[]
no_license
apertureatf/perftest
f6c6e69efad59265197f43af5072aa7af8393a34
584257a0c1ada22e5486052c11395858a87b20d5
refs/heads/master
2020-06-07T17:52:51.172890
2019-06-21T18:53:01
2019-06-21T18:53:01
193,039,805
0
0
null
null
null
null
UTF-8
Java
false
false
106
java
mastercard 5555555555554444 4012888888881881 4222222222222 378282246310005 6011111111111117 3070879272058
[ "jenkins@khan.paloaltonetworks.local" ]
jenkins@khan.paloaltonetworks.local
8b2b94798b88e6ead11e730e6a7346a9eef5afeb
bfb1247eae836d88d1abd8b032eb53fcacded3c5
/server/src/main/java/io/github/hulang1024/chinesechess/user/activity/UserActivityMessageListener.java
e531d28965d3f11a45360fa4029de5f6ddc9c268
[]
no_license
xiangping10/chinese-chess
1cb66835b2c80c864c8a9fedadf784f8f74f35fa
ae6687919ff231ae2ce01709f9757d35c0a4491f
refs/heads/master
2023-02-14T14:07:35.229609
2020-12-31T16:35:13
2020-12-31T16:35:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,550
java
package io.github.hulang1024.chinesechess.user.activity; import io.github.hulang1024.chinesechess.user.UserSessionManager; import io.github.hulang1024.chinesechess.user.ws.OnlineStatServerMsg; import io.github.hulang1024.chinesechess.user.ws.UserEnterActivityMsg; import io.github.hulang1024.chinesechess.user.ws.UserExitActivityMsg; import io.github.hulang1024.chinesechess.ws.AbstractMessageListener; import io.github.hulang1024.chinesechess.ws.WSMessageService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component public class UserActivityMessageListener extends AbstractMessageListener { @Autowired private UserActivityService userActivityService; @Autowired private WSMessageService wsMessageService; @Override public void init() { addMessageHandler(UserEnterActivityMsg.class, (msg) -> { UserActivity userActivity = UserActivity.from(msg.getCode()); userActivityService.enter(msg.getUser(), userActivity); if (userActivity == UserActivity.VIEW_ONLINE_USER) { wsMessageService.send( new OnlineStatServerMsg( UserSessionManager.onlineUserCount, UserSessionManager.guestCount), msg.getUser()); } }); addMessageHandler(UserExitActivityMsg.class, (msg) -> { userActivityService.exit(msg.getUser(), UserActivity.from(msg.getCode())); }); } }
[ "1013644379@qq.com" ]
1013644379@qq.com
5c1bbc793c72846781655edef8a42f5b892e2c9a
1e61aec6f7e2542b02be966cff350b9132a8164a
/02 Servlet/14servletcontextattributeapp/src/com/cluster/SecondServlet.java
9d7cbf152afac0e68e176539d6ea9b06a10825ea
[]
no_license
mithunrajur987/BasicJavaExamples
743bc1a4b4cdb4dcb8b9f548d7906a8ab0f06f75
fb70dc21e9cc16c7beb7919a1e7f501d3f316ed8
refs/heads/master
2020-04-18T23:24:33.535690
2019-01-27T15:26:32
2019-01-27T15:26:32
167,820,644
0
0
null
null
null
null
UTF-8
Java
false
false
1,192
java
package com.cluster; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletContext; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * Cluster Software Solutions. * (Mob:98451-31637/39 * www.clusterindia.com) */ public class SecondServlet extends HttpServlet{ public void service(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { res.setContentType("text/html"); PrintWriter pw = res.getWriter(); ServletContext ctx = getServletContext(); // getting context attributes Object e = ctx.getAttribute("company"); String strCompName = e.toString(); // getting context parameters String strCountry = ctx.getInitParameter("country"); pw.println("<html>"); pw.println("<body bgcolor='wheat'>"); pw.println("<h1>Displaying both context attribute value and parameter value </h1>"); pw.println("Context attribute value is " + strCompName + "<br>"); pw.println("Context parameter value is " + strCountry); pw.println("</body>"); pw.println("</html>"); } }
[ "mithunrajur@gmail.com" ]
mithunrajur@gmail.com
79df389ec6f6d49e9b6a8c5c9f99231448537335
3e17ae6a61e5e2d12847331907df6cdd05f84dfc
/guiClient/BackgammonGUI/src/cs347/backgammon/core/game/board/CellOwner.java
3098f6a2631de894f1e35082192dea4c945c97a3
[]
no_license
cansukockopru/cs347backgammon
c3f26eb123a0af156644c34073985a7182b658ac
8f7011e7c89d3bc4274124083b36c8d561d45c2f
refs/heads/master
2016-09-06T11:29:44.371468
2010-04-08T17:57:57
2010-04-08T17:57:57
39,853,364
0
0
null
null
null
null
UTF-8
Java
false
false
357
java
package cs347.backgammon.core.game.board; /** * Enumeration describing which player, if any, has checkers on a board cell. */ public enum CellOwner { /** * The board cell is controlled by player 1. */ Player1, /** * The board cell is controlled by player 2. */ Player2, /** * The board cell is empty. */ Empty; }
[ "tullock42@b64e8d1a-19a9-11df-a214-3711e6809fde" ]
tullock42@b64e8d1a-19a9-11df-a214-3711e6809fde
513a3a523a05472148ee1f9f1f5d5e408e9f7817
5d7eceb50fcc79fa09ca9f34d665ec8223cbbc09
/JxSmartHome/src/com/jinxin/datan/net/protocol/DefaultResponseJosn.java
30fa93552f16939ba3eb6556d58c3dfcbbedf66b
[]
no_license
WonderFannn/WFJxSmartHome
253abbae09bf84d63db55ba7f6b0df41ea806286
7d1168741b626da9e9ca128694d622f86e725a99
refs/heads/master
2021-01-01T18:40:37.713436
2018-02-02T02:33:55
2018-02-02T02:33:55
98,402,240
0
0
null
null
null
null
UTF-8
Java
false
false
2,227
java
package com.jinxin.datan.net.protocol; import java.io.InputStream; import org.json.JSONException; import org.json.JSONObject; import com.jinxin.datan.net.module.RemoteJsonResultInfo; import com.jinxin.datan.net.protocol.ResponseJson; import com.jinxin.datan.toolkit.task.Task; import com.jinxin.jxsmarthome.constant.ControlDefine; import com.jinxin.jxsmarthome.util.CommUtil; import com.jinxin.record.SharedDB; public class DefaultResponseJosn extends ResponseJson { private Task task = null; private byte[] requestBytes; public DefaultResponseJosn(Task task, byte[] requestBytes) { this.task = task; this.requestBytes = requestBytes; } @Override public void response(InputStream in) throws Exception { if (in != null) { boolean isSuccess = false; RemoteJsonResultInfo _resultInfo = null; String result = ""; try { JSONObject jsonObject = this.getJsonObjectFromIn(in); _resultInfo = this.readResultInfo(jsonObject); if (_resultInfo.validResultCode.equals(ControlDefine.CONNECTION_SUCCESS)) { // 具体的解析工作在这里实现 // 提示:任务中途检测任务是否被中止,同时可以直接返回任务取消数据(如有必要) if (this.task.ismTryCancel()) { return; } //////////////////////具体解析区//////////////////////// result = jsonObject.getString("serviceContent"); String _processTime = this.getJsonString(jsonObject, "processTime"); String _account = CommUtil.getCurrentLoginAccount(); //////////////////////具体解析完成//////////////////////// isSuccess = true; SharedDB.saveStrDB(_account, ControlDefine.KEY_CUSTOMER_AREA, _processTime); } } catch (JSONException e) { e.printStackTrace(); isSuccess = false; } catch (Exception e) { e.printStackTrace(); isSuccess = false; } finally { if (isSuccess) { this.task.callback(result); } else { this.task.onError(_resultInfo.validResultInfo); } this.closeInputStream(in); } } } @Override public byte[] toOutputBytes() { return this.requestBytes; } }
[ "sail032@live.cn" ]
sail032@live.cn
555ac25829eaea0fde6ad7a4785735200073a369
5703a9261a544d72fa184bde35b600e5312e87ea
/src/main/java/com/bonuspoint/rest/service/TransferService.java
6a60252b2661f53e9fb36ea58faac4f3a5688567
[]
no_license
sankiGod/Biggbonuspoints
08a59e01e3c74294ff25318a99e309e64ba1b30a
5100d6f941e5d0d750640483dcbbb85e28cea78d
refs/heads/master
2022-07-07T20:02:25.527039
2019-07-15T12:16:55
2019-07-15T12:16:55
196,989,902
0
0
null
null
null
null
UTF-8
Java
false
false
11,251
java
package com.bonuspoint.rest.service; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.bonuspoint.model.CustomerMerchantBPAccount; import com.bonuspoint.repository.BonusPointMapRepository; import com.bonuspoint.repository.CustomerMerchantBPAccountRepository; import com.bonuspoint.repository.MerchantRepository; import com.bonuspoint.repository.ProjectRepository; @Service public class TransferService { @Autowired CustomerMerchantBPAccountRepository repository; @Autowired BonusPointMapRepository brepository; @Autowired MerchantRepository merchantRepository; @Autowired ProjectRepository projectRepository; public List<CustomerMerchantBPAccount> transferCustom(String customerID, String fromMerchantID, String toMerchantID, int bonusPoint) { // TODO Auto-generated method stub return null; /* * Merchant merchant = merchantRepository.findByMerchantID(fromMerchantID); * String projectID = merchant.getProjectID(); Project project = * projectRepository.findByProjectID(projectID); * * if (!project.getProjectType().equalsIgnoreCase("MULTIPLE")) { throw new * CustomErrorException("Merchant", * ErrorCodes.CANNOT_TRANSFER_FUNDS.getDescription(), * ErrorCodes.CANNOT_TRANSFER_FUNDS.getCode()); } * * if (repository.findByCustomerIDAndMerchantProjectID(customerID, * fromMerchantID) == null) { throw new * ResourceNotFoundException("CustomerMerchantBPAccount", * "customerID and fromMerchantID", customerID + fromMerchantID); } else if * (repository.findByCustomerIDAndMerchantProjectID(customerID, toMerchantID) == * null) { * * fromMerchant { BP = 50; BA = 150; APBP = 3; } toMerchant{ BP = 0; BA = 0; * APBP = 7; } Transferring 20 points fromMer to toMer. * * CustomerMerchantBPAccount acc1 = * repository.findByCustomerIDAndMerchantProjectID(customerID, fromMerchantID); * CustomerMerchantBPAccount acc2 = new CustomerMerchantBPAccount(); * acc2.setCustomerID(customerID); acc2.setMerchantProjectID(toMerchantID); * acc2.set BonusPointMap toMerchant = * brepository.findByMerchantID(toMerchantID); BonusPointMap fromMerchant = * brepository.findByMerchantID(fromMerchantID); * * BigDecimal bonusAmount = fromMerchant.getAmountPerBP().multiply(new * BigDecimal(bonusPoint)); * * * bonusAmount = 20 * 3= 60; * * * int fromBonusPoints = acc1.getBonusPoints();// 50 BigDecimal fromBonusAmount * = acc1.getBonusPointAmount();// 150 * * if (bonusAmount.compareTo(fromBonusAmount) > 0) { throw new * CustomErrorException("CustomerMerchantBPAccount", * ErrorCodes.INSUFFICIENT_FUNDS.getDescription(), * ErrorCodes.INSUFFICIENT_FUNDS.getCode()); } double tempUBP = * bonusAmount.divide(toMerchant.getAmountPerBP()).doubleValue(); int * updatedToBonusPoint = (int) (Math.round(tempUBP)); BigDecimal * updatedToBonusAmount = toMerchant.getAmountPerBP().multiply(new * BigDecimal(updatedToBonusPoint)); * * updatedToBP = (int) 60/7 = 8.5 = 8; updatedToBA = 8 * 7 = 56 ; * * * int updatedFromBonusPoints = fromBonusPoints - bonusPoint; BigDecimal * updatedFromBonusAmount = fromBonusAmount.subtract(bonusAmount); * * updatedFromBP = 50 - 20 = 30; updatedFromBA = 150 - 56 = 94; * * * acc1.setBonusPoints(updatedFromBonusPoints); * acc1.setBonusPointAmount(updatedFromBonusAmount); * * acc2.setBonusPoints(updatedToBonusPoint); * acc2.setBonusPointAmount(updatedToBonusAmount); * * repository.save(acc1); repository.save(acc2); * * } else { CustomerMerchantBPAccount acc1 = * repository.findByCustomerIDAndMerchantProjectID(customerID, fromMerchantID); * CustomerMerchantBPAccount acc2 = * repository.findByCustomerIDAndMerchantProjectID(customerID, toMerchantID); * * BonusPointMap toMerchant = brepository.findByMerchantID(toMerchantID); * BonusPointMap fromMerchant = brepository.findByMerchantID(fromMerchantID); * * BigDecimal bonusAmount = fromMerchant.getAmountPerBP().multiply(new * BigDecimal(bonusPoint)); * * int fromBonusPoints = acc1.getBonusPoints(); BigDecimal fromBonusAmount = * acc1.getBonusPointAmount(); * * int toBonusPoints = acc2.getBonusPoints(); BigDecimal toBonusAmount = * acc2.getBonusPointAmount(); * * if (bonusAmount.compareTo(fromBonusAmount) > 0) { throw new * CustomErrorException("CustomerMerchantBPAccount", * ErrorCodes.INSUFFICIENT_FUNDS.getDescription(), * ErrorCodes.INSUFFICIENT_FUNDS.getCode()); } double tempNBP = * bonusAmount.divide((toMerchant.getAmountPerBP())).doubleValue(); int * newBonusPoint = (int) Math.round(tempNBP); int updatedToBonusPoint = * toBonusPoints + newBonusPoint; * * BigDecimal newBonusAmount = toMerchant.getAmountPerBP().multiply(new * BigDecimal(newBonusPoint)); BigDecimal updatedToBonusAmount = * toBonusAmount.add(newBonusAmount); * * int updatedFromBonusPoints = fromBonusPoints - bonusPoint; BigDecimal * updatedFromBonusAmount = fromBonusAmount.subtract(newBonusAmount); * * acc1.setBonusPoints(updatedFromBonusPoints); * acc1.setBonusPointAmount(updatedFromBonusAmount); * * acc2.setBonusPoints(updatedToBonusPoint); * acc2.setBonusPointAmount(updatedToBonusAmount); * * repository.save(acc1); repository.save(acc2); * * } return repository.findByCustomerID(customerID); */ } public List<CustomerMerchantBPAccount> transferAll(String customerID, String fromMerchantID, String toMerchantID) { // TODO Auto-generated method stub return null; /* * Merchant merchant = merchantRepository.findByMerchantID(fromMerchantID); * String projectID = merchant.getProjectID(); Project project = * projectRepository.findByProjectID(projectID); * * if (!project.getProjectType().equalsIgnoreCase("MULTIPLE")) { throw new * CustomErrorException("Merchant", * ErrorCodes.CANNOT_TRANSFER_FUNDS.getDescription(), * ErrorCodes.CANNOT_TRANSFER_FUNDS.getCode()); } * * if (repository.findByCustomerIDAndMerchantProjectID(customerID, * fromMerchantID) == null) { throw new * ResourceNotFoundException("CustomerMerchantBPAccount", * "customerID and fromMerchantID", customerID + fromMerchantID); } else if * (repository.findByCustomerIDAndMerchantProjectID(customerID, toMerchantID) == * null) { CustomerMerchantBPAccount acc1 = * repository.findByCustomerIDAndMerchantProjectID(customerID, fromMerchantID); * CustomerMerchantBPAccount acc2 = new CustomerMerchantBPAccount(); * * int fromBonusPoints = acc1.getBonusPoints(); BigDecimal fromBonusAmount = * acc1.getBonusPointAmount(); * * if (fromBonusAmount.equals(new BigDecimal(0)) || fromBonusPoints == 0) { * throw new CustomErrorException("CustomerMerchantBPAccount", * ErrorCodes.INSUFFICIENT_FUNDS.getDescription(), * ErrorCodes.INSUFFICIENT_FUNDS.getCode()); } * * BonusPointMap toMerchant = brepository.findByMerchantID(toMerchantID); * * int updatedFromBonusPoint = fromBonusPoints - fromBonusPoints; BigDecimal * updatedFromBonusAmount = fromBonusAmount.subtract(fromBonusAmount); * * double tempTBP = * fromBonusAmount.divide(toMerchant.getAmountPerBP()).doubleValue(); int * toBonusPoint = (int) (Math.round(tempTBP)); BigDecimal toBonusAmount = * fromBonusAmount; * * acc1.setBonusPoints(updatedFromBonusPoint); * acc1.setBonusPointAmount(updatedFromBonusAmount); * * acc2.setBonusPoints(toBonusPoint); acc2.setBonusPointAmount(toBonusAmount); * * repository.save(acc1); repository.save(acc2); * * } else { CustomerMerchantBPAccount acc1 = * repository.findByCustomerIDAndMerchantProjectID(customerID, fromMerchantID); * CustomerMerchantBPAccount acc2 = * repository.findByCustomerIDAndMerchantProjectID(customerID, toMerchantID); * * int fromBonusPoints = acc1.getBonusPoints(); int toBonusPoints = * acc2.getBonusPoints(); * * BigDecimal fromBonusAmount = acc1.getBonusPointAmount(); BigDecimal * toBonusAmount = acc2.getBonusPointAmount(); * * if (fromBonusAmount.equals(new BigDecimal(0)) || fromBonusPoints == 0) { * throw new CustomErrorException("CustomerMerchantBPAccount", * ErrorCodes.INSUFFICIENT_FUNDS.getDescription(), * ErrorCodes.INSUFFICIENT_FUNDS.getCode()); } * * BonusPointMap toMerchant = brepository.findByMerchantID(toMerchantID); * * int updatedFromBonusPoint = fromBonusPoints - fromBonusPoints; BigDecimal * updatedFromBonusAmount = fromBonusAmount.subtract(fromBonusAmount); * * double tempUBP = * fromBonusAmount.divide(toMerchant.getAmountPerBP()).doubleValue(); int * updatedToBonusPoint = (int) (toBonusPoints + Math.round(tempUBP)); BigDecimal * updatedToBonusAmount = toBonusAmount.add(fromBonusAmount); * * acc1.setBonusPoints(updatedFromBonusPoint); * acc1.setBonusPointAmount(updatedFromBonusAmount); * * acc2.setBonusPoints(updatedToBonusPoint); * acc2.setBonusPointAmount(updatedToBonusAmount); * * repository.save(acc1); repository.save(acc2); * * } return repository.findByCustomerID(customerID); */ } /* * Merchant fromMerchant = merchantRepository.findByMerchantID(fromMerchantID); Merchant toMerchant = merchantRepository.findByMerchantID(toMerchantID); String fromProjectID = fromMerchant.getProjectID(); String toProjectID = toMerchant.getProjectID(); if(!fromProjectID.equals(toProjectID)) { throw new CustomErrorException("Points Transfer", "Cannot Transfer Funds To Merchant Of Different Project", ErrorCodes.NOT_ALLOWED.getCode()); } Project project = projectRepository.findByProjectID(toProjectID); if (!project.getProjectType().equalsIgnoreCase("MULTIPLE")) { throw new CustomErrorException("Merchant", "Funds Transfer Facility Not Applicable",ErrorCodes.NOT_ALLOWED.getCode()); } * * * * * public TransferValues getTransferValues(String customerID, String * fromMerchantID, String toMerchantID, int toBonusPoint) { * * Merchant merchant = merchantRepository.findByMerchantID(fromMerchantID); * String projectID = merchant.getProjectID(); Project project = * projectRepository.findByProjectID(projectID); * * if (!project.getProjectType().equalsIgnoreCase("MULTIPLE")) { throw new * CustomErrorException("Merchant", "Funds Transfer Facility Not Applicable", * 108); } * * if (repository.findByCustomerIDAndMerchantProjectID(customerID, * fromMerchantID) == null) { throw new * ResourceNotFoundException("CustomerMerchantBPAccount", * "customerID and fromMerchantID", customerID + fromMerchantID); } else { * * } * * BonusPointMap toMerchant = brepository.findByMerchantID(toMerchantID); * BonusPointMap fromMerchant = brepository.findByMerchantID(fromMerchantID); * * BigDecimal bonusAmount = toBonusPoint * fromMerchant.getAmountPerBP(); * * int newToBonusPoint = (int) (Math.round((bonusAmount) / * (toMerchant.getAmountPerBP()))); BigDecimal newToBonusAmount = * newToBonusPoint * toMerchant.getAmountPerBP(); * * * * } */ }
[ "ankit@aplynk.com" ]
ankit@aplynk.com
bb3e7263a85cab4e8cb8aab3d62f482114489088
6c263be39d0228b887e87efa14a1cbeecefedbfb
/ly-item/ly-item-interface/src/main/java/com/leyou/item/pojo/Stock.java
456c197f6a2c21607ecc5a4277869f1cb3986abe
[]
no_license
Sherwoodzhou/leyou_java
33de94ba3577f3a9a989e5e9f7e6505883cf87d1
289371a6bb3e7d54a6c870ed58aaa64da260f1ef
refs/heads/master
2020-05-25T01:54:54.492642
2019-05-20T04:25:23
2019-05-20T04:25:23
187,567,255
0
0
null
null
null
null
UTF-8
Java
false
false
85
java
package com.leyou.item.pojo; import lombok.Data; @Data public class Stock { }
[ "34805890+Sherwoodzhou@users.noreply.github.com" ]
34805890+Sherwoodzhou@users.noreply.github.com
ff4ca463760acf36613cf6fa1cab9fed4b4bc123
c86c63e04aaa37b9a9f9f68fdf1dbbd74baa98d4
/profilers/testSrc/com/android/tools/profilers/memory/adapters/instancefilters/ProjectClassesInstanceFilterTest.java
08072b54a1355fbf18c8ba3af3d8735f912a4a0e
[ "Apache-2.0" ]
permissive
yang0range/android-1
8ea4bd40c0f2fb0f270309818267a5a3cd3b9b42
3b1eec683e9bc318d734c60f085f00e6d19343e7
refs/heads/master
2023-01-19T09:54:52.233899
2020-11-18T10:44:07
2020-11-18T19:35:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,648
java
/* * Copyright (C) 2019 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.tools.profilers.memory.adapters.instancefilters; import static com.google.common.truth.Truth.assertThat; import com.android.tools.profilers.FakeIdeProfilerServices; import com.android.tools.profilers.memory.adapters.FakeCaptureObject; import com.android.tools.profilers.memory.adapters.FakeInstanceObject; import com.android.tools.profilers.memory.adapters.InstanceObject; import com.google.common.collect.ImmutableSet; import java.util.Set; import org.junit.Test; public class ProjectClassesInstanceFilterTest { @Test public void testFilter() { FakeIdeProfilerServices ideServices = new FakeIdeProfilerServices(); ideServices.addProjectClasses("my.foo.bar", "your.bar.foo"); String matchedClass = "my.foo.bar"; String matchedInnerClass = "your.bar.foo$1"; String mismatchedClass = "my.bar"; String mismatchedInnerClass = "your.foo$1"; FakeCaptureObject capture = new FakeCaptureObject.Builder().build(); FakeInstanceObject matchedClassInstance = new FakeInstanceObject.Builder(capture, 1, matchedClass).build(); FakeInstanceObject matchedInnerClassInstance = new FakeInstanceObject.Builder(capture, 2, matchedInnerClass).build(); FakeInstanceObject mismatchedClassInstance = new FakeInstanceObject.Builder(capture, 3, mismatchedClass).build(); FakeInstanceObject mismatchedInnerClassInstance = new FakeInstanceObject.Builder(capture, 4, mismatchedInnerClass).build(); Set<InstanceObject> instances = ImmutableSet.of(matchedClassInstance, matchedInnerClassInstance, mismatchedClassInstance, mismatchedInnerClassInstance); ProjectClassesInstanceFilter filter = new ProjectClassesInstanceFilter(ideServices); Set<InstanceObject> result = filter.filter(instances, capture.getClassDatabase()); assertThat(result).containsExactly(matchedClassInstance, matchedInnerClassInstance); } }
[ "shiufai@google.com" ]
shiufai@google.com
d60380766d1294b8b081c97b8658896e8c2da077
ef5aae9cf3ccd3912bcb35c7b17a9dc7be3bdad0
/mockserver-core/src/main/java/org/mockserver/client/serialization/model/HttpRequestDTO.java
fb2ccc5ba4f2d73c8479ab73dbdd5a84ee40a88a
[ "Apache-2.0" ]
permissive
DragosCoros/mockserver
b4ed9cfd67fd83a02be90926ac71c3c5b8d8fb5c
593dfbc4c891eb541996580915b580b2644a7dfa
refs/heads/master
2020-12-07T15:16:58.895353
2015-06-08T07:51:14
2015-06-08T07:51:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,246
java
package org.mockserver.client.serialization.model; import com.google.common.base.Function; import com.google.common.collect.Lists; import org.mockserver.model.*; import java.util.ArrayList; import java.util.List; import static org.mockserver.model.NottableString.string; /** * @author jamesdbloom */ public class HttpRequestDTO extends NotDTO { private NottableString method = string(""); private NottableString path = string(""); private List<ParameterDTO> queryStringParameters = new ArrayList<ParameterDTO>(); private BodyDTO body; private List<CookieDTO> cookies = new ArrayList<CookieDTO>(); private List<HeaderDTO> headers = new ArrayList<HeaderDTO>(); public HttpRequestDTO(HttpRequest httpRequest) { this(httpRequest, false); } public HttpRequestDTO(HttpRequest httpRequest, Boolean not) { super(not); if (httpRequest != null) { method = httpRequest.getMethod(); path = httpRequest.getPath(); headers = Lists.transform(httpRequest.getHeaders(), new Function<Header, HeaderDTO>() { public HeaderDTO apply(Header header) { return new HeaderDTO(header, header.getNot()); } }); cookies = Lists.transform(httpRequest.getCookies(), new Function<Cookie, CookieDTO>() { public CookieDTO apply(Cookie cookie) { return new CookieDTO(cookie, cookie.getNot()); } }); queryStringParameters = Lists.transform(httpRequest.getQueryStringParameters(), new Function<Parameter, ParameterDTO>() { public ParameterDTO apply(Parameter parameter) { return new ParameterDTO(parameter, parameter.getNot()); } }); body = BodyDTO.createDTO(httpRequest.getBody()); } } public HttpRequestDTO() { } public HttpRequest buildObject() { return new HttpRequest() .withMethod(method) .withPath(path) .withHeaders(Lists.transform(headers, new Function<HeaderDTO, Header>() { public Header apply(HeaderDTO header) { return Not.not(header.buildObject(), header.getNot()); } })) .withCookies(Lists.transform(cookies, new Function<CookieDTO, Cookie>() { public Cookie apply(CookieDTO cookie) { return Not.not(cookie.buildObject(), cookie.getNot()); } })) .withQueryStringParameters(Lists.transform(queryStringParameters, new Function<ParameterDTO, Parameter>() { public Parameter apply(ParameterDTO parameter) { return Not.not(parameter.buildObject(), parameter.getNot()); } })) .withBody((body != null ? Not.not(body.buildObject(), body.getNot()) : null)); } public NottableString getMethod() { return method; } public HttpRequestDTO setMethod(NottableString method) { this.method = method; return this; } public NottableString getPath() { return path; } public HttpRequestDTO setPath(NottableString path) { this.path = path; return this; } public List<ParameterDTO> getQueryStringParameters() { return queryStringParameters; } public HttpRequestDTO setQueryStringParameters(List<ParameterDTO> queryStringParameters) { this.queryStringParameters = queryStringParameters; return this; } public BodyDTO getBody() { return body; } public HttpRequestDTO setBody(BodyDTO body) { this.body = body; return this; } public List<HeaderDTO> getHeaders() { return headers; } public HttpRequestDTO setHeaders(List<HeaderDTO> headers) { this.headers = headers; return this; } public List<CookieDTO> getCookies() { return cookies; } public HttpRequestDTO setCookies(List<CookieDTO> cookies) { this.cookies = cookies; return this; } }
[ "jamesdbloom@gmail.com" ]
jamesdbloom@gmail.com
707da917b16c14c5d516ace9425f39c089dbc387
b55222a71d1275387d538fb9c0cf03116a611922
/jOOQ/src/main/java/org/jooq/util/ase/ASEFactory.java
139a74c696a9a2dd10797522674c8aca8b207da7
[ "BSD-3-Clause", "Apache-2.0" ]
permissive
monolithic/jOOQ
e05625873b5a9d46010554064294d5aa199865b2
300c4b8693fdaa31adf15d6e9b7e153ef2c5ffeb
refs/heads/master
2021-01-18T10:26:27.727927
2013-02-20T16:54:58
2013-02-20T16:54:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,870
java
/** * Copyright (c) 2009-2013, Lukas Eder, lukas.eder@gmail.com * 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 "jOOQ" 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 org.jooq.util.ase; import org.jooq.SQLDialect; import org.jooq.impl.Factory; /** * A {@link SQLDialect#ASE} specific factory * * @author Lukas Eder */ public class ASEFactory extends Factory { /** * No instances */ private ASEFactory() { } }
[ "lukas.eder@gmail.com" ]
lukas.eder@gmail.com
48f584424ffea7ccbd0f7ad5c38af9ffd6404d8c
bdbde999e483ff1612f958c67ca76f13ac103e08
/br.com.searchmed.core/src/main/java/br/com/searchmed/MedicoEspecialidadeServiceImpl.java
377a652a702f5bea60504f855e2a023bf4e7b419
[]
no_license
lermen-andrefabiano/searchmedws
b8608f38a6b59293cc38fc6b4107da3adc622606
13484344b91a3812634d76bdc0128fb214c64498
refs/heads/master
2020-04-12T08:49:37.695209
2016-09-14T21:58:08
2016-09-14T21:58:08
63,030,069
0
0
null
null
null
null
UTF-8
Java
false
false
2,119
java
package br.com.searchmed; import java.util.ArrayList; import java.util.List; import javax.inject.Inject; import javax.inject.Named; import br.com.searchmed.core.entidades.Especialidade; import br.com.searchmed.core.entidades.Medico; import br.com.searchmed.core.entidades.MedicoEspecialidade; import br.com.searchmed.core.entidades.Usuario; /** * * @author andre.lermen * */ @Named public class MedicoEspecialidadeServiceImpl implements MedicoEspecialidadeService { @Inject private MedicoEspecialidadeRepository medicoEspecialidadeRep; @Inject private UsuarioRepository usuarioRep; @Inject private EspecialidadeService especialidadeService; @Override public List<Medico> getMedicoEspecialidades(String convenio, Long especialidadeId) { try { List<Medico> medicos = this.medicoEspecialidadeRep.getMedicoEspecialidades(convenio, especialidadeId); for(Medico m : medicos){ m.setHorarios(medicoEspecialidadeRep.getHorarioMedico(m.getId())); } return medicos; } catch (Exception e) { e.printStackTrace(); } return null; } @Override public List<MedicoEspecialidade> getEspecialidaMedico(Long medicoId) { return this.medicoEspecialidadeRep.getEspecialidaMedico(medicoId); } @Override public void excluir(Long usuarioId, Long especialidadeId) { Usuario u = this.usuarioRep.obterPorId(usuarioId); if(u!=null&&u.getMedico()!=null){ MedicoEspecialidade medicoEspecialidade = this.medicoEspecialidadeRep.obterPorMedico(u.getMedico().getId(), especialidadeId); this.medicoEspecialidadeRep.excluir(medicoEspecialidade); } } @Override public void incluir(Long usuarioId, Long especialidadeId) { Usuario u = this.usuarioRep.obterPorId(usuarioId); if(u!=null&&u.getMedico()!=null){ if(u.getMedico().getEspecialidades()!=null){ u.getMedico().setEspecialidades(new ArrayList<MedicoEspecialidade>()); } Especialidade e = this.especialidadeService.obterPorId(especialidadeId); u.getMedico().getEspecialidades().add(new MedicoEspecialidade(0L, e, u.getMedico())); this.usuarioRep.salvar(u); } } }
[ "lermen.andrefabiano@gmail.com" ]
lermen.andrefabiano@gmail.com
b9deda56f86a2bfa5fc34772db07643c925ec585
e4881a2bf83dabeda807ed306428dea48a53b5d2
/src/primitiveWorld/interfaces/Enginable.java
f301079aaf2b4cf5649769ec3252d544daae3d20
[]
no_license
SofiaShybaieva/PrimitiveWorld
afbb47319ffe34eaeb5e2510c65536fd5505a225
0a84223572677b90d014e0f521e2f28985284738
refs/heads/master
2020-05-24T15:02:42.727260
2014-12-09T20:23:45
2014-12-09T20:23:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
351
java
package primitiveWorld.interfaces; import java.awt.Point; import java.io.File; import javax.swing.JPanel; public interface Enginable { void setPanel(JPanel panel); void loadLocation(File file); String nextStep(); void redraw(); void mousePress(Point coord); void mouseMove(Point coord); }
[ "slavick@thinkpad.(none)" ]
slavick@thinkpad.(none)
f2682a30d8a7b0e111d0566bfcda29c30bd720bf
e56f9768a96892f70eeb02ef41af587fc81316b9
/src/main/java/au/net/electronichealth/ns/cdapackage/xsd/esignature/_2012/ApproverType.java
11e34af9fa576ee35041754a798487c8fd424382
[ "LicenseRef-scancode-warranty-disclaimer", "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
AuDigitalHealth/esignature-java
bfae3c8fc2030e8be24d2aaaaa143b012d7dfe01
282e27ccc67590fa693df4f8c1685d8daa2417c5
refs/heads/master
2023-03-01T04:07:26.333609
2021-02-10T03:16:49
2021-02-10T03:16:49
337,603,406
0
0
null
null
null
null
UTF-8
Java
false
false
2,601
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 // 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: 2013.02.28 at 12:13:11 PM EST // package au.net.electronichealth.ns.cdapackage.xsd.esignature._2012; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for ApproverType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="ApproverType"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="personId" type="{http://www.w3.org/2001/XMLSchema}anyURI"/> * &lt;element name="personName" type="{http://ns.electronichealth.net.au/cdaPackage/xsd/eSignature/2012}PersonNameType"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ApproverType", propOrder = { "personId", "personName" }) public class ApproverType { @XmlElement(required = true) @XmlSchemaType(name = "anyURI") protected String personId; @XmlElement(required = true) protected PersonNameType personName; /** * Gets the value of the personId property. * * @return * possible object is * {@link String } * */ public String getPersonId() { return personId; } /** * Sets the value of the personId property. * * @param value * allowed object is * {@link String } * */ public void setPersonId(String value) { this.personId = value; } /** * Gets the value of the personName property. * * @return * possible object is * {@link PersonNameType } * */ public PersonNameType getPersonName() { return personName; } /** * Sets the value of the personName property. * * @param value * allowed object is * {@link PersonNameType } * */ public void setPersonName(PersonNameType value) { this.personName = value; } }
[ "peter.ball@digitalhealth.gov.au" ]
peter.ball@digitalhealth.gov.au
3fddec79f4f31c3e887d933f5469296927010dca
8c9a3c6551699e5fc6329f27f0334c3f26fe39cc
/Curso/src/entidades/Trabalhador.java
8962176370ae8f1871a5323f7af9293f2d37199b
[]
no_license
Artur-Pastana/Teste2.github
d00dcb64ac5cd779e95a4e3cedc452798e1a3668
e929ee184f58792bba5f61426653658bd12d4295
refs/heads/master
2023-01-02T18:33:12.888594
2020-10-20T20:42:32
2020-10-20T20:42:32
305,740,839
0
0
null
null
null
null
UTF-8
Java
false
false
1,970
java
package entidades; import java.util.ArrayList; import java.util.Calendar; import java.util.List; import entidades.enums.NivelTrabalhador; public class Trabalhador { private String nome; private NivelTrabalhador nivel; private Double baseSalario; private Departamento departamento; private List<ContratoHora> contratos = new ArrayList<>(); public Trabalhador() { // TODO Auto-generated constructor stub } public Trabalhador(String nome, NivelTrabalhador nivel, Double baseSalario, Departamento departamento) { super(); this.nome = nome; this.nivel = nivel; this.baseSalario = baseSalario; this.departamento = departamento; } public String getNome() { return nome; } public void setNome(String nome) { this.nome = nome; } public NivelTrabalhador getNivel() { return nivel; } public void setNivel(NivelTrabalhador nivel) { this.nivel = nivel; } public Double getBaseSalario() { return baseSalario; } public void setBaseSalario(Double baseSalario) { this.baseSalario = baseSalario; } public Departamento getDepartamento() { return departamento; } public void setDepartamento(Departamento departamento) { this.departamento = departamento; } public List<ContratoHora> getContratos() { return contratos; } public void addContrato(ContratoHora contrato) { this.contratos.add(contrato); } public void removerContratos(ContratoHora contrato) { this.contratos.remove(contrato); } public double income(int ano, int mes) { double soma = this.getBaseSalario(); Calendar cal = Calendar.getInstance(); for (ContratoHora c : contratos) { cal.setTime(c.getDate()); int cAno = cal.get(Calendar.YEAR);//pegando o ano e armazenando na variavel cAno, usando Calendar int cMes = 1 + cal.get(Calendar.MONTH);//pegando o mes e armazenando na variavel cmes //verificando ano e mes if (ano == cAno && mes == cMes) { soma += c.totalValor(); } } return soma; } }
[ "reitutu_15@hotmail.com" ]
reitutu_15@hotmail.com
21760f99cec70828689bfe3dfa2025f045bcdda3
a73b214c02383ee96ac96cc21b20a5c823c05e4e
/cue/src/test/java/com/cucumber/cue/AppTest.java
91e031c6b3a912508591dc82baef2a56fe3c756f
[]
no_license
motiour/CUE_Retailer
c1d7d027203255d09b81c37b8f295bb44c931420
3914d3687acb1621298f4f710deb777436037a6e
refs/heads/master
2021-01-20T17:40:39.382123
2016-12-26T01:55:44
2016-12-26T01:55:44
60,392,420
0
0
null
null
null
null
UTF-8
Java
false
false
644
java
package com.cucumber.cue; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Unit test for simple App. */ public class AppTest extends TestCase { /** * Create the test case * * @param testName name of the test case */ public AppTest( String testName ) { super( testName ); } /** * @return the suite of tests being tested */ public static Test suite() { return new TestSuite( AppTest.class ); } /** * Rigourous Test :-) */ public void testApp() { assertTrue( true ); } }
[ "mrahman3555@gmail.com" ]
mrahman3555@gmail.com
62f2a937a170416c6895ff9e22526b2224d4a998
411b412b7360c59fb298c0babf86837ddbd1d57f
/src/view/DeliveryInfoView.java
3fa964890b01c4330e2647fdccad2988bfcf3ffc
[]
no_license
AlejandroVal99/TeslaApp
dc9f8252f8fed672d9e476f1064ec37ce41d4aeb
a1e2fa506ee9668b43cdb93424c3bff56d037f2d
refs/heads/master
2021-03-02T10:23:14.245725
2020-03-11T09:32:08
2020-03-11T09:32:08
245,860,217
0
0
null
null
null
null
UTF-8
Java
false
false
2,599
java
package view; import controlP5.ControlP5; import controlP5.Textfield; import controller.DeliveryInfoController; import controller.RegisterController; import processing.core.PApplet; import processing.core.PFont; import processing.core.PImage; public class DeliveryInfoView { private DeliveryInfoController deliveryController; private String country, state, address; private PApplet app; private PImage deliveryInfo; private int screen = 8; private ControlP5 cp5; private String[] inputs; private PFont ralewayM; public DeliveryInfoView(PApplet app) { deliveryInfo = app.loadImage("Imagenes/Backgrounds/DeliveryInfo.png"); this.app = app; deliveryController = new DeliveryInfoController(app); ralewayM = app.createFont("Tipografia/Raleway-Medium.ttf", 20); cp5 = new ControlP5(app); inputs = new String[3]; inputs[0] = "country"; inputs[1] = "state"; inputs[2] = "address"; cp5.addTextfield(inputs[0]).setPosition((78), 358).setSize(250, 30).setAutoClear(true) .setColorValue(app.color(255)).setColorActive(app.color(0, 0, 0, 1)) .setColorBackground(app.color(0, 0, 0, 1)).setColorForeground(app.color(0, 0, 0, 1)).setFont(ralewayM) .getCaptionLabel().hide(); cp5.addTextfield(inputs[1]).setPosition((78), 431).setSize(250, 30).setAutoClear(true) .setColorValue(app.color(255)).setColorActive(app.color(0, 0, 0, 1)) .setColorBackground(app.color(0, 0, 0, 1)).setColorForeground(app.color(0, 0, 0, 1)).setFont(ralewayM) .getCaptionLabel().hide(); cp5.addTextfield(inputs[2]).setPosition((78), 503).setSize(250, 30).setAutoClear(true) .setColorValue(app.color(255)).setColorActive(app.color(0, 0, 0, 1)) .setColorBackground(app.color(0, 0, 0, 1)).setColorForeground(app.color(0, 0, 0, 1)).setFont(ralewayM) .getCaptionLabel().hide(); } public void getinfoDelivery() { if (app.mouseX > 61 && app.mouseX < 353 && app.mouseY > 797 && app.mouseY < 828) { country = cp5.get(Textfield.class, "country").getText(); state = cp5.get(Textfield.class, "state").getText(); address = cp5.get(Textfield.class, "address").getText(); screen = 11; deliveryController.getInfoDeliveryCon(country, state, address); deliveryController.crearHistorico(); } } public int getScreen() { return screen; } public void setScreen(int screen) { this.screen = screen; } public void drawScreen() { // TODO Auto-generated method stub app.image(deliveryInfo, 0, 0); } public void mostrarInputs(int screen2) { if (screen2 != 8) { cp5.hide(); } if (screen2 == 8) { cp5.show(); } } }
[ "joalevalverde@hotmail.com" ]
joalevalverde@hotmail.com
00c80d983a49fc7c8e8c3c264b5ca98e888666f3
66fef10c7222f92a0e1adf1d04f4047b21d75368
/module-1/12_Polymorphism/student-lecture/java/src/main/java/com/techelevator/farm/Sellable.java
eace4060c1a91fb675a6147f1d8959c4a5c3718d
[]
no_license
Lawrence-Amurao/Exercises
312e965068c04504a009e1d32f00266bccc76972
8bb9bb85756abc38295d7a532eae5f0e54e1aa3f
refs/heads/main
2023-08-13T16:04:13.790928
2021-09-15T20:29:54
2021-09-15T20:29:54
406,964,359
0
0
null
null
null
null
UTF-8
Java
false
false
120
java
package com.techelevator.farm; import java.math.BigDecimal; public interface Sellable { BigDecimal getPrice(); }
[ "87446162+Lawrence-Amurao@users.noreply.github.com" ]
87446162+Lawrence-Amurao@users.noreply.github.com
a9b2def97b51977682bf78e604febd5b8dca0369
a744882fb7cf18944bd6719408e5a9f2f0d6c0dd
/sourcecode7/src/sun/net/dns/ResolverConfiguration.java
a490de4ea293ad914314dbaa99a27719efb277fc
[ "Apache-2.0" ]
permissive
hanekawasann/learn
a39b8d17fd50fa8438baaa5b41fdbe8bd299ab33
eef678f1b8e14b7aab966e79a8b5a777cfc7ab14
refs/heads/master
2022-09-13T02:18:07.127489
2020-04-26T07:58:35
2020-04-26T07:58:35
176,686,231
0
0
Apache-2.0
2022-09-01T23:21:38
2019-03-20T08:16:05
Java
UTF-8
Java
false
false
3,964
java
/* * Copyright (c) 2002, 2010, 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. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * 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. */ package sun.net.dns; import java.util.List; /** * The configuration of the client resolver. * * <p>A ResolverConfiguration is a singleton that represents the * configuration of the client resolver. The ResolverConfiguration * is opened by invoking the {@link #open() open} method. * * @since 1.4 */ public abstract class ResolverConfiguration { private static final Object lock = new Object(); private static ResolverConfiguration provider; protected ResolverConfiguration() { } /** * Opens the resolver configuration. * * @return the resolver configuration */ public static ResolverConfiguration open() { synchronized (lock) { if (provider == null) { provider = new sun.net.dns.ResolverConfigurationImpl(); } return provider; } } /** * Returns a list corresponding to the domain search path. The * list is ordered by the search order used for host name lookup. * Each element in the list returns a {@link java.lang.String} * containing a domain name or suffix. * * @return list of domain names */ public abstract List<String> searchlist(); /** * Returns a list of name servers used for host name lookup. * Each element in the list returns a {@link java.lang.String} * containing the textual representation of the IP address of * the name server. * * @return list of the name servers */ public abstract List<String> nameservers(); /** * Options representing certain resolver variables of * a {@link ResolverConfiguration}. */ public static abstract class Options { /** * Returns the maximum number of attempts the resolver * will connect to each name server before giving up * and returning an error. * * @return the resolver attempts value or -1 is unknown */ public int attempts() { return -1; } /** * Returns the basic retransmit timeout, in milliseconds, * used by the resolver. The resolver will typically use * an exponential backoff algorithm where the timeout is * doubled for every retransmit attempt. The basic * retransmit timeout, returned here, is the initial * timeout for the exponential backoff algorithm. * * @return the basic retransmit timeout value or -1 * if unknown */ public int retrans() { return -1; } } /** * Returns the {@link #Options} for the resolver. * * @return options for the resolver */ public abstract Options options(); }
[ "763803382@qq.com" ]
763803382@qq.com
65e3b35af6553ebb93ff68baea639f212b240c71
bda1eaa3bf6f1116056bd9ddda70726569f9e904
/axboot-admin/src/main/java/net/bigers/funeralsystem/crem0000/crem5000/CREM5010Controller.java
c729b494b5593817b77c7715a6b64c5590fa090d
[]
no_license
KwakKyoungUk/BigersChangone
347b0cb260eb5cab4b4878b3cf772860000f85a5
317df5e1306ed659a0f18adc177aa0228048aa29
refs/heads/main
2023-07-17T06:56:50.321954
2021-09-09T02:55:37
2021-09-09T02:55:37
404,554,168
0
0
null
null
null
null
UTF-8
Java
false
false
5,491
java
package net.bigers.funeralsystem.crem0000.crem5000; import java.util.HashMap; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.SessionAttributes; import com.axisj.axboot.admin.controllers.BaseController; import com.axisj.axboot.admin.parameter.CommonListResponseParams; import com.axisj.axboot.core.util.DateUtils; import net.bigers.funeralsystem.crem0000.DisplayConstants; import net.bigers.funeralsystem.crem0000.domain.hwaBrazier.HwaBrazier; import net.bigers.funeralsystem.crem0000.domain.hwaBrazier.HwaBrazierService; import net.bigers.funeralsystem.crem0000.domain.machine.Machine; import net.bigers.funeralsystem.crem0000.domain.machine.MachineService; import net.bigers.funeralsystem.crem0000.domain.msgset.Msgset; import net.bigers.funeralsystem.crem0000.domain.msgset.MsgsetService; import net.bigers.funeralsystem.crem0000.vto.HwaBrazierVTO; import net.bigers.funeralsystem.crem0000.vto.MsgsetVTO; import net.bigers.websocket.SessionManager; /** * * 업무분류 : 전체 현황판 * 기능분류 : 현황판 출력을 위한 컨트롤러 * 프로그램명 : BORD1010 * 설 명 : 전체 현황판을 출력하기 위한 뷰 연결 및 데이를 얻기 위한 서비스 연결 * 강릉 eXria로 제작된 프로그램을 axboot로 변경 * ------------------------------------------ * * 이력사항 2016. 2. 29. 이승호 최초작성 <BR/> */ @Controller @SessionAttributes("displayPagable") public class CREM5010Controller extends BaseController{ @Autowired private HwaBrazierService hwaBrazierService; @Autowired private MsgsetService msgsetService; @Autowired private MachineService machineService; @Autowired @Qualifier("textSessionManager") private SessionManager sessionManager; private Pageable pageRequest = new PageRequest(0, 5); /** * * * 메소드 명칭 : bord1010 * 메소드 설명 : WebSocket 으로 접속한 현황판 기기로 데이터 전송 * ---------------------------------------------------------- * * * 이력사항 * 2016. 5. 18. SH 최초작성 */ // @Scheduled(fixedDelay=DisplayConfigConstants.WEBSOCKET_SCHEDULE_FIXED_DELAY) public void bord1010(){ if(sessionManager.isEmpty()){ log.trace("접속한 웹소켓 클라이언트가 없습니다."); return; } List<Machine> machines = machineService.findByMclass(DisplayConstants.MACHINE_KIND_BURN_BOARD); Page<HwaBrazier> hwaBrazierPages = hwaBrazierService.findDisplayHwaBrazier(pageRequest); if(hwaBrazierPages.hasNext()){ this.pageRequest = this.pageRequest.next(); }else{ this.pageRequest = this.pageRequest.first(); } Msgset msgset = msgsetService.findFirstByTtsTargetOrderByOrdernoAsc(DisplayConstants.MACHINE_KIND_BURN_BOARD); Map<String, Object> result = new HashMap<>(); result.put("hwaBrazierVTO", HwaBrazierVTO.of(hwaBrazierPages.getContent())); result.put("msgsetVTO", MsgsetVTO.of(msgset)); result.put("currentDate", DateUtils.formatToDateString("yyyy.MM.dd (E) a hh:mm")); machines.forEach(machine->{ sessionManager.sendTextMessageByIp(machine.getIpaddress(), "display", result); }); } /** * * * 메소드 명칭 : displayPagable * 메소드 설명 : 페이지 전환 시 보여줄 페이지 * ---------------------------------------------------------- * * @param displayPagable * @return * * 이력사항 * 2016. 4. 27. SH 최초작성 */ @ModelAttribute("displayPagable") public Pageable displayPagable(Pageable displayPagable){ if(displayPagable == null || displayPagable.getPageSize() != 5){ return new PageRequest(0, 5); } return displayPagable; } /** * * * 메소드 명칭 : findHwaBrazier * 메소드 설명 : 현재 화장 데이터 * ---------------------------------------------------------- * * @param model * @param displayPagable * @return * @throws Exception * * 이력사항 * 2016. 4. 27. SH 최초작성 */ @RequestMapping(value="/findHwaBrazier", method=RequestMethod.GET, produces=APPLICATION_JSON) public CommonListResponseParams.MapResponse findHwaBrazier( Model model , @ModelAttribute("displayPagable") Pageable displayPagable ) throws Exception{ Page<HwaBrazier> hwaBrazierPages = hwaBrazierService.findDisplayHwaBrazier(displayPagable); if(hwaBrazierPages.hasNext()){ model.addAttribute("displayPagable", displayPagable.next()); }else{ model.addAttribute("displayPagable", displayPagable.first()); } Msgset msgset = msgsetService.findFirstByTtsTargetOrderByOrdernoAsc(DisplayConstants.MACHINE_KIND_BURN_BOARD); Map<String, Object> result = new HashMap<>(); result.put("hwaBrazierVTO", HwaBrazierVTO.of(hwaBrazierPages.getContent())); result.put("msgsetVTO", MsgsetVTO.of(msgset)); result.put("currentDate", DateUtils.formatToDateString("yyyy.MM.dd (E) a hh:mm")); return CommonListResponseParams.MapResponse.of(result); } }
[ "rtfg0012@naver.com" ]
rtfg0012@naver.com
b17d046765430a6c82cbc4a4ce1d56de25405d1b
12838ade9621940042a47104be07b9f782beef46
/InventoryControlSystem/src/main/java/com/capstone/ics/controller/JRViewerFxController.java
da0cc5b51e9bc91dc7ebe46824d077ed10b47242
[]
no_license
comauguste/CSC521-Capstone
ad2a08ebb13ba6b02936e2e0584e4c775e5f52cb
0012e015ad3c834c61c1c17a8ba48b9272dfadc9
refs/heads/master
2021-01-22T11:48:11.733028
2016-06-27T14:07:07
2016-06-27T14:07:07
51,221,191
0
0
null
null
null
null
UTF-8
Java
false
false
6,361
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.capstone.ics.controller; import java.awt.image.BufferedImage; import java.net.URL; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.ResourceBundle; import javafx.beans.value.ChangeListener; import javafx.beans.value.ObservableValue; import javafx.collections.FXCollections; import javafx.embed.swing.SwingFXUtils; import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx.fxml.Initializable; import javafx.geometry.Pos; import javafx.scene.Node; import javafx.scene.control.ComboBox; import javafx.scene.control.Label; import javafx.scene.control.Slider; import javafx.scene.image.ImageView; import javafx.scene.image.WritableImage; import javafx.stage.Popup; import javafx.stage.Stage; import net.sf.jasperreports.engine.JRDataSource; import net.sf.jasperreports.engine.JRException; import net.sf.jasperreports.engine.JasperPrint; import net.sf.jasperreports.engine.JasperPrintManager; /** * * @author Auguste C */ public class JRViewerFxController implements Initializable { private JRViewerFxMode printMode; private String reportFilename; private JRDataSource reportDataset; @SuppressWarnings("rawtypes") private Map reportParameters; private ChangeListener<Number> zoomListener; private JasperPrint jasperPrint; @FXML private ImageView imageView; @FXML ComboBox<Integer> pageList; @FXML Slider zoomLevel; @FXML protected Node view; private Stage parentStage; private Double zoomFactor; private double imageHeight; private double imageWidth; private List<Integer> pages; private Popup popup; private Label errorLabel; boolean showingToast; public void show() { if (reportParameters == null) { reportParameters = new HashMap(); } if (printMode == null || printMode == JRViewerFxMode.REPORT_VIEW) { popup = new Popup(); errorLabel = new Label("Error"); errorLabel.setWrapText(true); errorLabel.setMaxHeight(200); errorLabel.setMinSize(100, 100); errorLabel.setMaxWidth(100); errorLabel.setAlignment(Pos.TOP_LEFT); errorLabel.getStyleClass().add("errorToastLabel"); popup.getContent().add(errorLabel); errorLabel.opacityProperty().bind(popup.opacityProperty()); zoomFactor = 1d; zoomLevel.setValue(100d); imageView.setX(0); imageView.setY(0); imageHeight = jasperPrint.getPageHeight(); imageWidth = jasperPrint.getPageWidth(); if (zoomListener != null) { zoomLevel.valueProperty().removeListener(zoomListener); } zoomListener = (ObservableValue<? extends Number> observable, Number oldValue, Number newValue) -> { zoomFactor = newValue.doubleValue() / 100; imageView.setFitHeight(imageHeight * zoomFactor); imageView.setFitWidth(imageWidth * zoomFactor); }; zoomLevel.valueProperty().addListener(zoomListener); if (jasperPrint.getPages().size() > 0) { viewPage(0); pages = new ArrayList<>(); for (int i = 0; i < jasperPrint.getPages().size(); i++) { pages.add(i + 1); } } pageList.setItems(FXCollections.observableArrayList(pages)); pageList.getSelectionModel().select(0); } else if (printMode == JRViewerFxMode.REPORT_PRINT) { print(); } } private WritableImage getImage(int pageNumber) { BufferedImage image = null; try { image = (BufferedImage) JasperPrintManager.printPageToImage(jasperPrint, pageNumber, 2); } catch (JRException e) { // TODO Auto-generated catch block e.printStackTrace(); } WritableImage fxImage = new WritableImage(jasperPrint.getPageWidth(), jasperPrint.getPageHeight()); return SwingFXUtils.toFXImage(image, fxImage); } private void viewPage(int pageNumber) { imageView.setFitHeight(imageHeight * zoomFactor); imageView.setFitWidth(imageWidth * zoomFactor); imageView.setImage(getImage(pageNumber)); } public void clear() { // TODO Auto-generated method stub } @FXML private void print() { try { JasperPrintManager.printReport(jasperPrint, true); } catch (JRException e) { // TODO Auto-generated catch block e.printStackTrace(); } } @FXML private void pageListSelected(final ActionEvent event) { System.out.println(pageList.getSelectionModel().getSelectedItem() - 1); viewPage(pageList.getSelectionModel().getSelectedItem() - 1); } public JRViewerFxMode getPrintMode() { return printMode; } public void setPrintMode(JRViewerFxMode printMode) { this.printMode = printMode; } public String getReportFilename() { return reportFilename; } public void setReportFilename(String reportFilename) { this.reportFilename = reportFilename; } public JRDataSource getReportDataset() { return reportDataset; } public void setReportDataset(JRDataSource reportDataset) { this.reportDataset = reportDataset; } public Map getReportParameters() { return reportParameters; } public void setReportParameters(Map reportParameters) { this.reportParameters = reportParameters; } public Node getView() { return view; } public void setView(Node view) { this.view = view; } public void close() { parentStage.close(); } public void initialize(URL location, ResourceBundle resources) { // TODO Auto-generated method stub } public JasperPrint getJasperPrint() { return jasperPrint; } public void setJasperPrint(JasperPrint jasperPrint) { this.jasperPrint = jasperPrint; } }
[ "comauguste@gmail.com" ]
comauguste@gmail.com
07548ec152e2c2d228ec4e0465cf2344e27ae1e3
faa11c94e615bb311db047c6783289817de4f42d
/src/main/java/com/jetbrains/jetpad/vclang/module/caching/PersistenceProvider.java
3354edcba29a23dca6ed12f5cd51a55677cbf2b9
[]
no_license
edgarzhavoronkov/vclang
d7dce32110aeb13a6febcde879b51892dd1da4da
b98a49c8aa8cc0cfbb004eb33d7aae8a2c3e0977
refs/heads/master
2021-08-26T08:39:22.402650
2017-11-16T07:46:44
2017-11-16T07:46:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
443
java
package com.jetbrains.jetpad.vclang.module.caching; import com.jetbrains.jetpad.vclang.module.source.SourceId; import com.jetbrains.jetpad.vclang.term.Abstract; import java.net.URI; public interface PersistenceProvider<SourceIdT extends SourceId> { URI getUri(SourceIdT sourceId); SourceIdT getModuleId(URI sourceUrl); String getIdFor(Abstract.Definition definition); Abstract.Definition getFromId(SourceIdT sourceId, String id); }
[ "kirelagin@gmail.com" ]
kirelagin@gmail.com
57a5de89f86f43975d66e2b333a8de36955419fc
9562f4f287c36eca1394f694c2c98c754e7c6105
/my-app/src/test/java/com/uni/convert/tests/AppTest.java
5dc6629182c41d0ff5464ce4d9ca386ab997f644
[]
no_license
rimlester/IndustryProject-2
0c5f019af757eacc1b364bf0146385d0a44d0b12
788264e9e6e3eea09f9747858c386686eb956db6
refs/heads/master
2020-04-06T06:46:27.099010
2015-05-11T06:07:27
2015-05-11T06:07:27
35,029,434
1
0
null
null
null
null
UTF-8
Java
false
false
649
java
package com.uni.convert.tests; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Unit test for simple App. */ public class AppTest extends TestCase { /** * Create the test case * * @param testName name of the test case */ public AppTest( String testName ) { super( testName ); } /** * @return the suite of tests being tested */ public static Test suite() { return new TestSuite( AppTest.class ); } /** * Rigourous Test :-) */ public void testApp() { assertTrue( true ); } }
[ "rupert@edocx.com.au" ]
rupert@edocx.com.au
90d12d40bad2c64c480b46302bde69f0776d39ce
07cbd95d480efb7c14e0d1a7b54f5eeb315cebb1
/layout/src/test/java/com/cs/layout/ExampleUnitTest.java
3340c8881b3b78de08235231a55eba9aab70a594
[]
no_license
CsKhris/Android190618
da5495ab64a237af37e01fd1daa23d34c4030cde
bd3530db554b4be5d1d4935b30ffc1cd88939566
refs/heads/master
2020-06-05T19:20:57.657881
2019-06-18T11:06:22
2019-06-18T11:06:22
192,523,473
0
0
null
null
null
null
UTF-8
Java
false
false
374
java
package com.cs.layout; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() { assertEquals(4, 2 + 2); } }
[ "cs.khris.1010@gmail.com" ]
cs.khris.1010@gmail.com
5b3bd730e8c33ec5f7a63d3b9d30c91f3ed07eef
37dcfb1aba501e6ace49fc123bfd3a67a4e5dcd9
/api/tapestry-resteasy/src/main/java/dev/openshift/tapestry/angular2/data/bookcat/Book.java
614fda35978ba41e525a3dd0dc4842b1432562db
[]
no_license
ffacon/Test-Angular2-Cli
c7a6e7f0eb00ba3c3cbe904927dd0c1cd0c8eae2
497a62ad387391079b474f8b1e7996cf500afe09
refs/heads/master
2021-01-11T19:18:18.535649
2017-10-14T20:36:35
2017-10-14T20:36:35
79,350,678
0
0
null
null
null
null
UTF-8
Java
false
false
2,534
java
package dev.openshift.tapestry.angular2.data.bookcat; import org.apache.tapestry5.json.JSONArray; import org.apache.tapestry5.json.JSONObject; import org.codehaus.jackson.JsonGenerationException; import org.codehaus.jackson.map.ObjectMapper; import org.codehaus.jackson.map.ObjectWriter; import java.io.IOException; public class Book { private String id; private String name; private String author; private Float price; private String description; private String category; private boolean isNew; private BookComment[] comments; public Book() { } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getAuthor() { return author; } public void setAuthor(String author) { this.author = author; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Float getPrice() { return price; } public void setPrice(float price) { this.price = price; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public String getCategory() { return category; } public void setCategory(String category) { this.category = category; } public void setIsNew(boolean isNew) { this.isNew = isNew; } public boolean getIsNew() { return isNew; } public BookComment[] getComments() { return comments; } public void setComments(BookComment[] comments) { this.comments = comments; } /*public JSONObject getJSONObject() { String json=""; ObjectWriter ow = new ObjectMapper().writer().withDefaultPrettyPrinter(); JSONObject ret = new JSONObject(); ret.put("id",this.id); ret.put("author",this.author); ret.put("name",this.name); ret.put("description",this.description); ret.put("category",this.category); ret.put("price",this.price); ret.put("isNew",this.isNew); try { json = ow.writeValueAsString(this.comments); ret.put("comments",new JSONArray(json)); } catch (IOException e) { e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } return ret; }*/ }
[ "francois.facon@gmail.com" ]
francois.facon@gmail.com
8538f041a47174b80fab198936dfddcadecb9307
557ae2b37a1ffb63364bd186aaf6a2cee7964768
/src/Critters/Giant.java
d7e6df685a4ce4378ed3a8b2439cdb7fc01f4e0a
[]
no_license
BrianLoveGa/TalentPathJava
e602824ef006f049ce3801f27f5ad7c61e8316e2
fe5bb9f5c0e5a18bc710f8457487e46b9ace7da3
refs/heads/master
2022-07-25T10:58:17.765619
2020-05-12T19:38:48
2020-05-12T19:38:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
963
java
package Critters; import java.awt.*; import java.util.Random; public class Giant extends Critter { private Color color = Color.GRAY; private String[] images = {"fee", "fie", "foe", "fum"}; private int moveCount = 0; public Giant() { super(); } public Action getMove(CritterInfo info) { Action action; if (info.frontThreat()) { action = Action.INFECT; } else if (info.getFront() == Neighbor.EMPTY) { action = Action.HOP; } else { action = Action.RIGHT; } moveCount++; return action; } // This method should be overriden (default color is black) public Color getColor() { return this.color; } // This method should be overriden (default display is "?") public String toString() { int img = (moveCount / 6) % images.length; return images[img]; } }
[ "thinkable@thinkable.us" ]
thinkable@thinkable.us
e34800f664182de3bfd1bbf206aeb50ee9080694
d8c114229b315f291318da284f8151a1d3f645e0
/House.java
f6a4edd6dc2e90980aa45fd49c586a9c1c11bb5a
[]
no_license
josh-ross/AT-CS-Shapes_House
f1af405eb54f02194160c04fac4f524a6555405c
0d9db63cb2e5bec612d1f7356c1a67bcd07c2afe
refs/heads/master
2021-01-01T20:42:27.228999
2014-11-24T22:44:29
2014-11-24T22:44:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,707
java
/** * Draws a house * * @author (Josh Ross) * @version (2014-10-10) */ public class House { public House() { Square back = new Square(); back.changeColor("black"); back.moveVertical(-50); back.moveHorizontal(-100); back.changeSize(10000); back.makeVisible(); Square main_house = new Square(); main_house.changeColor("blue"); main_house.moveHorizontal(50); main_house.moveVertical(65); main_house.changeSize(100); main_house.makeVisible(); Triangle roof = new Triangle(); roof.moveHorizontal(110); roof.moveVertical(50); roof.changeColor("red"); roof.changeSize(50,100); roof.makeVisible(); Square door = new Square(); door.changeColor("magenta"); door.moveHorizontal(80); door.moveVertical(130); door.changeSize(35); door.makeVisible(); Circle knob = new Circle(); knob.changeColor("black"); knob.moveHorizontal(123); knob.moveVertical(133); knob.changeSize(9); knob.makeVisible(); Square pane = new Square(); pane.changeColor("green"); pane.moveHorizontal(60); pane.moveVertical(80); pane.makeVisible(); Square window_tl = new Square(); window_tl.changeColor("black"); window_tl.moveHorizontal(60); window_tl.moveVertical(80); window_tl.changeSize(11); window_tl.makeVisible(); Square window_tr = new Square(); window_tr.changeColor("black"); window_tr.moveHorizontal(79); window_tr.moveVertical(80); window_tr.changeSize(11); window_tr.makeVisible(); Square window_bl = new Square(); window_bl.changeColor("black"); window_bl.moveHorizontal(60); window_bl.moveVertical(99); window_bl.changeSize(11); window_bl.makeVisible(); Square window_br = new Square(); window_br.changeColor("black"); window_br.moveHorizontal(79); window_br.moveVertical(99); window_br.changeSize(11); window_br.makeVisible(); Circle sun = new Circle(); sun.changeColor("yellow"); sun.moveVertical(-40); sun.makeVisible(); Circle moon = new Circle(); moon.changeColor("white"); moon.moveVertical(-40); moon.moveHorizontal(50); moon.makeVisible(); Circle moon_cover = new Circle(); moon_cover.changeColor("black"); moon_cover.moveVertical(-40); moon_cover.moveHorizontal(57); moon_cover.makeVisible(); } }
[ "josh.ross1234@gmail.com" ]
josh.ross1234@gmail.com
bcd779f652d81c64672e454edba4c8d037d0e072
bdafcc421d9dea8c7bbc3a88cfdfe507d952aa60
/src/Presentacion/Doctor/GUIDoctor.java
35c770a3e6be3bfb052b549ea7994da552ae3919
[]
no_license
david10923/FarmaciaUpgraded
43d3272e0e368d18d03ab02e2ccb5494d1037289
6cc78333bdadf3604aa72883b8f7efceb551ea20
refs/heads/master
2023-02-10T20:20:14.112466
2021-01-06T12:08:42
2021-01-06T12:08:42
325,841,262
0
0
null
null
null
null
UTF-8
Java
false
false
1,751
java
package Presentacion.Doctor; import java.awt.BorderLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JPanel; import Presentacion.Producto.MostrarTodosProductos; import Presentacion.Vista.GUIFarmaciaImp; import Presentacion.Vista.IGUI; import Presentacion.Vista.MostrarTodos; import Presentacion.Vista.MostrarUno; import Presentacion.Vista.OperationsPanel; public class GUIDoctor extends JPanel implements IGUI { private OperationsPanel OperationsPanel; private MostrarTodos mostrarTodos; private MostrarUno mostrarUno; public GUIDoctor() { this.setVisible(true); OperationsPanel = new OperationsPanel(GUIFarmaciaImp.TAB_PRODUCTO); mostrarTodos = new MostrarTodosProductos(GUIFarmaciaImp.TAB_PRODUCTO, null); mostrarUno = new MostrarUno(GUIFarmaciaImp.TAB_PRODUCTO); OperationsPanel.getToolBar().addSeparator(); this.add(mostrarTodos, BorderLayout.NORTH); this.add(OperationsPanel, BorderLayout.EAST); this.add(mostrarUno,BorderLayout.WEST); OperationsPanel.getAltaBoton().addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { new VentanaCrearDoctor(); } }); OperationsPanel.getBajaBoton().addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { new VentanaBajaDoctor(); } }); OperationsPanel.getModificarBoton().addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { new VentanaModificarDoctor(); } }); this.setVisible(true); } @Override public void actualizar(Object data, Integer evento) { // TODO Auto-generated method stub } }
[ "davidf14@ucm.es" ]
davidf14@ucm.es
58935ec5ee3c256a786dc3ea49e6f38a113b07db
9ba25fa57c64ab4f1b549c5d3b8d364b1ecce7f4
/hrm_management_parent/hrm_sysmanage_interface/src/main/java/com/gzy/hrm/client/SystemdictionaryitemClient.java
75bd11499da9c5660014deba83126435c2e01453
[]
no_license
codeguo123/hrm_parent
b6bfdea48ed4c36a7cc8072b499d52644f8a662d
869610dcbff6138cd21baff61e3ed43393fbd912
refs/heads/master
2021-06-19T10:47:41.022973
2021-04-29T06:56:27
2021-04-29T06:56:27
205,498,310
0
0
null
null
null
null
UTF-8
Java
false
false
1,668
java
package com.gzy.hrm.client; import com.gzy.hrm.domain.Systemdictionaryitem; import com.gzy.hrm.query.SystemdictionaryitemQuery; import com.gzy.hrm.util.AjaxResult; import com.gzy.hrm.util.PageList; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClientsConfiguration; import org.springframework.web.bind.annotation.*; import java.util.List; @FeignClient(value = "ZUUL-GATEWAY",configuration = FeignClientsConfiguration.class, fallbackFactory = SystemdictionaryitemClientHystrixFallbackFactory.class) @RequestMapping("/user/systemdictionaryitem") public interface SystemdictionaryitemClient { /** * 保存和修改公用的 * @param systemdictionaryitem 传递的实体 * @return Ajaxresult转换结果 */ @RequestMapping(value="/save",method= RequestMethod.POST) AjaxResult save(Systemdictionaryitem systemdictionaryitem); /** * 删除对象信息 * @param id * @return */ @RequestMapping(value="/delete/{id}",method=RequestMethod.DELETE) AjaxResult delete(@PathVariable("id") Integer id); //获取用户 @RequestMapping("/{id}") Systemdictionaryitem get(@RequestParam(value="id",required=true) Long id); /** * 查看所有的员工信息 * @return */ @RequestMapping("/list") public List<Systemdictionaryitem> list(); /** * 分页查询数据 * * @param query 查询对象 * @return PageList 分页对象 */ @RequestMapping(value = "/json",method = RequestMethod.POST) PageList<Systemdictionaryitem> json(@RequestBody SystemdictionaryitemQuery query); }
[ "gzy@com" ]
gzy@com
cfc12e64ce7938a7762e4a55bcca0e1f39d250bb
4e7c97cf0c04015ab6120c34362c804a4f52a944
/ProjetoAlimentosSuadaveis/src/com/vidasaudavel/service/AlimentoServiceImpl.java
f292c36a8cd07823b4e66fa471383b0bd11193f6
[]
no_license
jessicaplm/projetoFinalVS
9060f24fbf27ad1adff1738bba957502b18af369
a0e33e4ae4753e427533cc80a1294983c0c4d983
refs/heads/master
2021-01-11T00:16:39.182237
2016-10-01T18:31:25
2016-10-01T18:31:25
69,176,082
0
0
null
null
null
null
UTF-8
Java
false
false
1,295
java
package com.vidasaudavel.service; import java.util.List; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.vidasaudavel.dao.AlimentoDAO; import com.vidasaudavel.model.Alimento; @Service @Transactional(readOnly = true) public class AlimentoServiceImpl implements AlimentoService { private AlimentoDAO alimentoDAO; public void setAlimentoDAO(AlimentoDAO alimentoDAO) { this.alimentoDAO = alimentoDAO; } @Override @Transactional(readOnly = false) public void addAlimento(Alimento a) { // TODO Auto-generated method stub this.alimentoDAO.addAlimento(a); } @Override public List<Alimento> listAlimento() { // TODO Auto-generated method stub return this.alimentoDAO.listAlimento(); } @Override @Transactional(readOnly = false) public void updateAlimento(Alimento a) { // TODO Auto-generated method stub this.alimentoDAO.updateAlimento(a); } @Override @Transactional(readOnly = false) public void removeAlimentoById(int id) { // TODO Auto-generated method stub this.alimentoDAO.removeAlimentoById(id); } @Override public List<Alimento> listByNameAlimento(String n) { return this.alimentoDAO.listByNameAlimento(n); } }
[ "jessi_paloma@hotmail.com" ]
jessi_paloma@hotmail.com
42dc06ec655f1b63e10d8f4c555a9205a4f4763e
fcda29de2a7c8fca029f10a38c2f409ffcaa118b
/myssi/src/main/java/org/amu/demo/myssi/entity/Department.java
ead8e25fa33eb5a3e33f99a0ae2640d36719b9fd
[]
no_license
yuzhu310/myssi
11b06746bbf41944cabd706859bbd1af22725761
d7fcfc8982ed66c95deeaca1feaf3e1c00ec0f07
refs/heads/master
2020-04-03T03:24:34.257833
2013-09-22T05:14:26
2013-09-22T05:14:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
756
java
package org.amu.demo.myssi.entity; import java.util.List; import javax.persistence.Column; import javax.persistence.Table; import com.google.common.collect.Lists; /** * 部门. * * @author amu */ @Table(name = "acct_department") public class Department extends IdEntity { private String name; private User manager; private List<User> userList = Lists.newArrayList(); @Column public String getName() { return name; } public void setName(String name) { this.name = name; } public User getManager() { return manager; } public void setManager(User manager) { this.manager = manager; } public List<User> getUserList() { return userList; } public void setUserList(List<User> userList) { this.userList = userList; } }
[ "147175882@163.com" ]
147175882@163.com
4224d95d587bb1020e51fbaaf0a49ab487b57c61
b216dd68bbccc4ec2a5e1a221a340a8f8d2ad100
/cmkpmoney-api/src/main/java/com/cmkpmoney/api/service/exception/PessoaInexistenteOuInativaException.java
9ffe173e0bdd31c732ea9b5235535f6f177875e2
[]
no_license
LucasCapSilva/CMKP-MoneyApi_Auth-OAuth2-JWT
68387a1232366ae4558a2b64dd94e023bd5b9fb2
377842ed08a0926cdb503a0721f1e06ae44fe955
refs/heads/master
2021-01-04T13:47:46.885030
2020-02-14T19:23:01
2020-02-14T19:23:01
240,581,785
0
0
null
null
null
null
UTF-8
Java
false
false
220
java
package com.cmkpmoney.api.service.exception; //dispara o erro apenas para pessoa existete public class PessoaInexistenteOuInativaException extends RuntimeException { private static final long serialVersionUID = 1L; }
[ "lcapelotto@gmail.com" ]
lcapelotto@gmail.com
b812e14ce398e1b53e6e0d4af6ad080274a275da
8b57efdbcc3e9d8181e4d46cf34420ddb325cf79
/SIPRE/src/java/net/codejava/spring/model/SipreTmpBonificacion.java
085587c21e82bb2951e588db2285cd35e84678f2
[]
no_license
dickmafy/proyectos2015
befed30a370aad2aca18a8bf978ec54387052508
1d2ff45b5ed7153827205d8915304e2b3ade1793
refs/heads/master
2021-01-10T12:05:05.608351
2015-10-16T05:21:03
2015-10-16T05:21:03
43,626,791
0
0
null
null
null
null
UTF-8
Java
false
false
4,116
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 net.codejava.spring.model; import java.io.Serializable; import java.math.BigDecimal; import javax.persistence.Column; import javax.persistence.EmbeddedId; import javax.persistence.Entity; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.NamedQueries; import javax.persistence.NamedQuery; import javax.persistence.Table; import javax.xml.bind.annotation.XmlRootElement; /** * * @author DIEGO */ @Entity @Table(name = "SIPRE_TMP_BONIFICACION") @XmlRootElement @NamedQueries({ @NamedQuery(name = "SipreTmpBonificacion.findAll", query = "SELECT s FROM SipreTmpBonificacion s")}) public class SipreTmpBonificacion implements Serializable { private static final long serialVersionUID = 1L; @EmbeddedId protected SipreTmpBonificacionPK sipreTmpBonificacionPK; // @Max(value=?) @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation @Column(name = "NTB_MONTO") private BigDecimal ntbMonto; @Column(name = "VTB_APE_NOM") private String vtbApeNom; @Column(name = "CTB_IND_SITUACION") private Character ctbIndSituacion; @Column(name = "MES_REINTEGRO") private String mesReintegro; @JoinColumn(name = "CTP_CODIGO", referencedColumnName = "CTP_CODIGO") @ManyToOne(optional = false) private SipreTipoPlanilla ctpCodigo; public SipreTmpBonificacion() { } public SipreTmpBonificacion(SipreTmpBonificacionPK sipreTmpBonificacionPK) { this.sipreTmpBonificacionPK = sipreTmpBonificacionPK; } public SipreTmpBonificacion(String cpersonaNroAdm, String cciCodigo, String ctbMesBonificacion, String mesProceso) { this.sipreTmpBonificacionPK = new SipreTmpBonificacionPK(cpersonaNroAdm, cciCodigo, ctbMesBonificacion, mesProceso); } public SipreTmpBonificacionPK getSipreTmpBonificacionPK() { return sipreTmpBonificacionPK; } public void setSipreTmpBonificacionPK(SipreTmpBonificacionPK sipreTmpBonificacionPK) { this.sipreTmpBonificacionPK = sipreTmpBonificacionPK; } public BigDecimal getNtbMonto() { return ntbMonto; } public void setNtbMonto(BigDecimal ntbMonto) { this.ntbMonto = ntbMonto; } public String getVtbApeNom() { return vtbApeNom; } public void setVtbApeNom(String vtbApeNom) { this.vtbApeNom = vtbApeNom; } public Character getCtbIndSituacion() { return ctbIndSituacion; } public void setCtbIndSituacion(Character ctbIndSituacion) { this.ctbIndSituacion = ctbIndSituacion; } public String getMesReintegro() { return mesReintegro; } public void setMesReintegro(String mesReintegro) { this.mesReintegro = mesReintegro; } public SipreTipoPlanilla getCtpCodigo() { return ctpCodigo; } public void setCtpCodigo(SipreTipoPlanilla ctpCodigo) { this.ctpCodigo = ctpCodigo; } @Override public int hashCode() { int hash = 0; hash += (sipreTmpBonificacionPK != null ? sipreTmpBonificacionPK.hashCode() : 0); return hash; } @Override public boolean equals(Object object) { // TODO: Warning - this method won't work in the case the id fields are not set if (!(object instanceof SipreTmpBonificacion)) { return false; } SipreTmpBonificacion other = (SipreTmpBonificacion) object; if ((this.sipreTmpBonificacionPK == null && other.sipreTmpBonificacionPK != null) || (this.sipreTmpBonificacionPK != null && !this.sipreTmpBonificacionPK.equals(other.sipreTmpBonificacionPK))) { return false; } return true; } @Override public String toString() { return "net.codejava.spring.model.SipreTmpBonificacion[ sipreTmpBonificacionPK=" + sipreTmpBonificacionPK + " ]"; } }
[ "diego.matos.b@gmail.com" ]
diego.matos.b@gmail.com
1faded16653f3a81011bd4ad38e4b242fb439cec
65e8ef0ffdccdd7c791c8527a9aa816e5af742fd
/football-teams/src/test/java/br/com/football/teams/SuccessBase.java
033ded7a59073f9d7b951391603795b29840a6a5
[]
no_license
alvesfc/football
6bbb6cb576a1589c7bce57299122df1fb3702584
275b59e2082799dd5ba4e2e3b0ca741161356e27
refs/heads/master
2020-04-08T14:03:39.162427
2019-10-01T02:20:37
2019-10-01T02:20:37
159,420,225
0
0
null
null
null
null
UTF-8
Java
false
false
2,128
java
package br.com.football.teams; import de.flapdoodle.embed.mongo.MongodExecutable; import de.flapdoodle.embed.mongo.MongodProcess; import de.flapdoodle.embed.mongo.MongodStarter; import de.flapdoodle.embed.mongo.config.IMongodConfig; import de.flapdoodle.embed.mongo.config.MongodConfigBuilder; import de.flapdoodle.embed.mongo.config.Net; import de.flapdoodle.embed.mongo.distribution.Version; import de.flapdoodle.embed.process.runtime.Network; import org.junit.BeforeClass; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.mongodb.core.MongoTemplate; import org.springframework.restdocs.payload.FieldDescriptor; import java.util.HashMap; import java.util.List; import java.util.Map; public abstract class SuccessBase extends BaseTests { @Autowired protected MongoTemplate mongoTemplate; private static MongodProcess mongodProcess; @BeforeClass public static void setupMongo() throws Exception { if (mongodProcess == null || !mongodProcess.isProcessRunning()) { IMongodConfig mongodConfig = new MongodConfigBuilder().version(Version.Main.V3_6) .net(new Net("localhost", 27019, Network.localhostIsIPv6())) .build(); MongodStarter starter = MongodStarter.getDefaultInstance(); MongodExecutable mongodExecutable = starter.prepare(mongodConfig); mongodProcess = mongodExecutable.start(); } } public SuccessBase() { super(SuccessBase.shouldCreatePlayerFields()); } public SuccessBase(Map<String, List<FieldDescriptor>> fieldDescriptors) { super(fieldDescriptors); } private static Map<String, List<FieldDescriptor>> shouldCreatePlayerFields() { Map<String, List<FieldDescriptor>> values = new HashMap<>(); values.put("request_validate_shouldCreateTeam", TeamCreateDescriptors.builder() .withName() .withFullname() .withAcronym() .withCountry() .build()); values.put("response_validate_shouldCreateTeam", TeamCreateDescriptors.builder() .withCode() .build()); return values; } }
[ "alvesfc@protonmail.com" ]
alvesfc@protonmail.com
69b0233d0c674efdcbb6bbece78f1841ea925a1a
708eab871f9c08479f5956f1c88f1a733a036884
/pixate-freestyle/src/com/pixate/freestyle/util/IOUtil.java
ca48d26ab628557fb71a86f00e5e40e0e304de8d
[ "LicenseRef-scancode-other-permissive", "Apache-2.0" ]
permissive
timesong/pixate-freestyle-android
3e24fac85d0980255fb3c4ee06cda726525dd9aa
7d4d25a55fa63be3e4e5f73d501cc9e85b75d6cc
refs/heads/master
2021-01-15T11:20:38.960388
2014-03-20T21:07:36
2014-03-20T21:07:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,234
java
/******************************************************************************* * Copyright 2012-present Pixate, Inc. * * 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.pixate.freestyle.util; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; public class IOUtil { private static final String UTF8 = "UTF-8"; public static final String UTF8_BOM = "\uFEFF"; public static String read(String filePath) throws IOException { return read(filePath, UTF8); } public static String read(String filePath, String charsetName) throws IOException { return read(new FileInputStream(filePath), charsetName); } public static String read(InputStream inputStream) throws IOException { return read(inputStream, UTF8); } public static String read(InputStream inputStream, String charsetName) throws IOException { char[] readBuffer = new char[1024]; InputStreamReader reader = null; try { reader = new InputStreamReader(inputStream, charsetName); StringBuilder builder = new StringBuilder(); int read = -1; while ((read = reader.read(readBuffer)) != -1) { builder.append(readBuffer, 0, read); } String s = builder.toString(); if (s.startsWith(UTF8_BOM)) { s = s.substring(1); } return s; } finally { if (reader != null) { reader.close(); } } } }
[ "paul@pixate.com" ]
paul@pixate.com
f7c6ef9ce103ea6af81861888e8a0057f2a673b9
58edc01fb7c5498611716b49367a3e7af21331d0
/src/day09_scanner_practice/AddNumbers.java
63227b81d11fe045636d404e4ba8abff176da905
[]
no_license
bashir-hasanov/java-programming
bcda4e2ad7a0306acea899684b177f4b3db94b04
ce33e2a539d782138f961613fbeda7c880790306
refs/heads/master
2023-06-18T14:06:15.802288
2021-07-18T21:08:35
2021-07-18T21:08:35
371,984,271
0
0
null
null
null
null
UTF-8
Java
false
false
385
java
package day09_scanner_practice; import java.util.Scanner; public class AddNumbers { public static void main(String[] args) { Scanner scan = new Scanner(System.in); System.out.println("Enter 2 numbers"); int num1 = scan.nextInt(); int num2 = scan.nextInt(); int result = num1 + num2; System.out.println("Result: " + result); } }
[ "beshir.hasanov@gmail.com" ]
beshir.hasanov@gmail.com
5245562a703c01dbd1ec6721c9b17b9cf5ee97f9
3ef55e152decb43bdd90e3de821ffea1a2ec8f75
/large/module0323_public/tests/more/src/java/module0323_public_tests_more/a/Foo1.java
c971a0999299a388d65f1b48136489eab534f9cb
[ "BSD-3-Clause" ]
permissive
salesforce/bazel-ls-demo-project
5cc6ef749d65d6626080f3a94239b6a509ef145a
948ed278f87338edd7e40af68b8690ae4f73ebf0
refs/heads/master
2023-06-24T08:06:06.084651
2023-03-14T11:54:29
2023-03-14T11:54:29
241,489,944
0
5
BSD-3-Clause
2023-03-27T11:28:14
2020-02-18T23:30:47
Java
UTF-8
Java
false
false
1,635
java
package module0323_public_tests_more.a; import java.util.zip.*; import javax.annotation.processing.*; import javax.lang.model.*; /** * Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut * labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. * Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. * * @see java.awt.datatransfer.DataFlavor * @see java.beans.beancontext.BeanContext * @see java.io.File */ @SuppressWarnings("all") public abstract class Foo1<T> extends module0323_public_tests_more.a.Foo0<T> implements module0323_public_tests_more.a.IFoo1<T> { java.rmi.Remote f0 = null; java.nio.file.FileStore f1 = null; java.sql.Array f2 = null; public T element; public static Foo1 instance; public static Foo1 getInstance() { return instance; } public static <T> T create(java.util.List<T> input) { return module0323_public_tests_more.a.Foo0.create(input); } public String getName() { return module0323_public_tests_more.a.Foo0.getInstance().getName(); } public void setName(String string) { module0323_public_tests_more.a.Foo0.getInstance().setName(getName()); return; } public T get() { return (T)module0323_public_tests_more.a.Foo0.getInstance().get(); } public void set(Object element) { this.element = (T)element; module0323_public_tests_more.a.Foo0.getInstance().set(this.element); } public T call() throws Exception { return (T)module0323_public_tests_more.a.Foo0.getInstance().call(); } }
[ "gwagenknecht@salesforce.com" ]
gwagenknecht@salesforce.com
c43a3b02776d16d9e35bd2e62d738168a747022d
5f27877aa878944a8b550a62bc0990ec76557d7b
/DSD-Trafego/src/estrada/EstradaCaminhoAdicionaReservaVisitor.java
066b9a3a4c14cd8244eb50c2660aa53bbb68f23f
[]
no_license
BrunoZSgrott/TrafficSim
6d37c60f3b03b543bd0b785f1eeafde0577a8bc4
66f9f931a7d962ccd6d1481581571add0e1c2f14
refs/heads/master
2022-11-27T23:25:17.273112
2020-08-03T21:29:37
2020-08-03T21:29:37
277,672,668
0
0
null
2020-08-03T00:36:34
2020-07-06T23:51:08
Java
UTF-8
Java
false
false
1,075
java
package estrada; import estrada.visitor.IVisitor; /** * * @author Bruno Zilli Sgrott */ class EstradaCaminhoAdicionaReservaVisitor implements IVisitor { private boolean reservado; private EstradaCaminho caminho; EstradaCaminhoAdicionaReservaVisitor(EstradaCaminho caminho) { this.caminho = caminho; } @Override public void visitEstradaNormal(EstradaNormal estrada) throws Exception { if (!estrada.possuiReserva()) { estrada.setReserva(caminho); } reservado = estrada.getReserva() == caminho; } @Override public void visitCruzamento(EstradaCruzamento estrada) throws Exception { if (!estrada.possuiReserva()) { estrada.setReserva(caminho); } reservado = estrada.getReserva() == caminho; } @Override public void visitEstradaVazia(EstradaEmpty estrada) throws Exception { } @Override public void visitEstradaCaminho(EstradaCaminho estrada) throws Exception { } boolean reservado() { return reservado; } }
[ "31224957+BrunoZSgrott@users.noreply.github.com" ]
31224957+BrunoZSgrott@users.noreply.github.com
328a63e418f23dfd2f558da5b81771674e5c0cc5
85eadf2c61a9771b9ad94825373d9a9d89e07dc2
/PowerUp_v1.2__2_24_2018/src/org/usfirst/frc/team2377/robot/commands/CenterSwitch.java
7a414221c1390cd83f277a53fa089fb2a174d8d0
[]
no_license
team2377/2018_PowerUp
9d933b4f3c1f8177d2edcf8fc4d7ed6e33789d35
993c031c3316b72ce7d22ad2885681533e90e31e
refs/heads/master
2021-05-10T14:46:45.113563
2018-03-27T23:30:46
2018-03-27T23:30:46
118,532,378
0
0
null
null
null
null
UTF-8
Java
false
false
2,869
java
package org.usfirst.frc.team2377.robot.commands; import org.usfirst.frc.team2377.robot.Robot; import org.usfirst.frc.team2377.robot.subsystems.FmsSubSystem; import edu.wpi.first.wpilibj.command.CommandGroup; public class CenterSwitch extends CommandGroup { private double elevator_speed = .8; private double drive_speed = .7; private double turn_speed = .5; // private Logging logger; // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=VARIABLE_DECLARATIONS // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=VARIABLE_DECLARATION // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTOR public CenterSwitch() { // logger.init("CenterSwitch"); System.out .println("Entering center switch code, " + FmsSubSystem.getRightSwitchActive(Robot.switchScaleLayout)); if (FmsSubSystem.getRightSwitchActive(Robot.switchScaleLayout)) { // addSequential(new SwitchOElGearO(true)); // logger.info("The robot is going to the right switch", LocalDateTime.now()); addSequential(new AutoOpenCloseGripper(true));// close // addSequential(new AutoRotateArmOut());// out // addParallel(new AutoMoveElevator(Robot.RaiseElevatorSw, .7, 1)); // addSequential(new AutoMoveElevator(Robot.RaiseElevatorSw, .7, 1)); addSequential(new DriveForward(Robot.autonLine, drive_speed)); addParallel(new DriveForward(10, drive_speed)); // addSequential(new DriveForward(20, drive_speed)); // addSequential(new AutoOpenCloseGripper(false));// open addSequential(new AutoOutputDriveShooterWheels()); addSequential(new DriveBackward(10, -drive_speed)); } else { // logger.info("The robot is going to the left switch", LocalDateTime.now()); // addSequential(new SwitchOElGearO(true)); addSequential(new AutoOpenCloseGripper(true));// close // addSequential(new AutoRotateArmOut());// out addSequential(new DriveForward(Robot.C2LSw_Leg_1, drive_speed)); addSequential(new AutoRotateLeft(Robot.RotateLeft, turn_speed)); addSequential(new DriveForward(Robot.C2LSw_Leg_2, drive_speed)); // addParallel(new AutoMoveElevator(Robot.RaiseElevatorSw, .7, 1)); // addSequential(new AutoMoveElevator(Robot.RaiseElevatorSw, .7, 1)); addSequential(new AutoRotateRight(Robot.RotateRight, turn_speed)); // addParallel(new AutoMoveElevator(Robot.RaiseElevatorSw, .70, 1)); addSequential(new DriveForward(Robot.C2LSw_Leg_3, drive_speed)); // addSequential(new AutoOpenCloseGripper(false));// open addSequential(new AutoOutputDriveShooterWheels()); } // logger.close(); // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTOR // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=VARIABLE_SETTING // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=VARIABLE_SETTING // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=REQUIRES // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=REQUIRES } }
[ "thomas@bruestle.net" ]
thomas@bruestle.net
705e1d7648bfcedab2c1bf4a1dc1fde339b08c2a
dd590f7bf803948880058bdd2610bcf14eb69bac
/mymeishinew/src/main/java/commeishi/shanjing/mymeishi/utils/HtmlText.java
fc814488b1c54ecf44afe310138982e090c1037b
[]
no_license
cuiwenju2017/jtlife-food
f3b9784469f321c88fddd773ffb58849df73d901
c148eb6760727f9741e591ac049065a4178e7bb3
refs/heads/master
2020-08-26T15:50:01.775544
2019-10-23T13:16:26
2019-10-23T13:16:26
217,061,111
0
0
null
null
null
null
UTF-8
Java
false
false
1,162
java
package commeishi.shanjing.mymeishi.utils; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * 过滤掉html标签的工具类 */ public class HtmlText { public static String delHTMLTag(String htmlStr) { String regEx_script = "<script[^>]*?>[\\s\\S]*?<\\/script>"; //定义script的正则表达式 String regEx_style = "<style[^>]*?>[\\s\\S]*?<\\/style>"; //定义style的正则表达式 String regEx_html = "<[^>]+>"; //定义HTML标签的正则表达式 Pattern p_script = Pattern.compile(regEx_script, Pattern.CASE_INSENSITIVE); Matcher m_script = p_script.matcher(htmlStr); htmlStr = m_script.replaceAll(""); //过滤script标签 Pattern p_style = Pattern.compile(regEx_style, Pattern.CASE_INSENSITIVE); Matcher m_style = p_style.matcher(htmlStr); htmlStr = m_style.replaceAll(""); //过滤style标签 Pattern p_html = Pattern.compile(regEx_html, Pattern.CASE_INSENSITIVE); Matcher m_html = p_html.matcher(htmlStr); htmlStr = m_html.replaceAll(""); //过滤html标签 return htmlStr.trim(); //返回文本字符串 } }
[ "1755140651@qq.com" ]
1755140651@qq.com
04762371dec1ec58ecc6c029ce9ae96bb7c21c61
fea683c0ec66ff872b001f39fba4bd0f5a772176
/jpuppeteer-cdp/src/main/java/jpuppeteer/cdp/cdp/entity/page/PrintToPDFResponse.java
73d9145920e12b6fdce195c819a382a80fee40ef
[]
no_license
affjerry/jpuppeteer
c343f64636eabdf5c3da52b6c0d660054d837894
5dbd900862035b4403b975f91f1b18938b19f08b
refs/heads/master
2023-08-15T23:45:39.292666
2020-05-27T01:48:41
2020-05-27T01:48:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
369
java
package jpuppeteer.cdp.cdp.entity.page; /** */ @lombok.Setter @lombok.Getter @lombok.ToString public class PrintToPDFResponse { /** * Base64-encoded pdf data. Empty if |returnAsStream| is specified. */ private String data; /** * A handle of the stream that holds resulting PDF data. */ private String stream; }
[ "jarvis.xu@vipshop.com" ]
jarvis.xu@vipshop.com
aceee79b4c5a18c20a6e282af7bcbe5f769ed984
cf0f34937b476ecde5ebcca7e2119bcbb27cfbf2
/src/com/sdses/struts/pos/action/T30500Action.java
bd41e159bb767c0920b35dedb93cf92f07b764b5
[]
no_license
Deron84/xxxTest
b5f38cc2dfe3fe28b01634b58b1236b7ec5b4854
302b807f394e31ac7350c5c006cb8dc334fc967f
refs/heads/master
2022-02-01T03:32:54.689996
2019-07-23T11:04:09
2019-07-23T11:04:09
198,212,201
0
0
null
null
null
null
UTF-8
Java
false
false
5,384
java
package com.sdses.struts.pos.action; import java.util.ArrayList; import java.util.List; import com.huateng.common.Constants; import com.huateng.common.ErrorCode; import com.huateng.struts.system.action.BaseAction; import com.huateng.system.util.BeanUtils; import com.huateng.system.util.ContextUtil; import com.sdses.bo.pos.T30500BO; import com.sdses.po.TblVegeCodeInfo; /** * Title:机构维护 * * Description: * * Copyright: Copyright (c) 2010-6-7 * * Company: Shanghai Huateng Software Systems Co., Ltd. * * @author * * @version 1.0 */ public class T30500Action extends BaseAction { private static final long serialVersionUID = 1L; // // //菜品编码表BO private T30500BO t30500BO = (T30500BO) ContextUtil.getBean("T30500BO"); //菜品编码 private String vegCode; //菜品名称 private String vegName; // 菜品列表 private String vegDataList; @Override protected String subExecute() { try { if ("add".equals(getMethod())) { rspCode = add(); } else if ("delete".equals(getMethod())) { rspCode = delete(); } else if ("update".equals(getMethod())) { rspCode = update(); } } catch (Exception e) { log("操作员编号:" + operator.getOprId() + ",对机构的维护操作" + getMethod() + "失败,失败原因为:" + e.getMessage()); } return rspCode; } /** * 添加机构信息 * @throws Exception */ private String add() throws Exception { TblVegeCodeInfo vegeCodeInfo = new TblVegeCodeInfo(); vegeCodeInfo.setVegCode(vegCode); vegeCodeInfo.setVegName(vegName); // 判断菜品编码是否存在 if (t30500BO.get(getVegCode()) != null) { return ErrorCode.T30500_01; } // 判断菜品名称是否存在 List<Object[]> lists = t30500BO.findListByName(vegName); if (lists != null && lists.size() > 0) { return ErrorCode.T30500_02; } t30500BO.add(vegeCodeInfo); return Constants.SUCCESS_CODE; } /** * * //TODO 删除所选的条目信息 * * @return * @throws Exception * @author hanyongqing */ @SuppressWarnings("unchecked") private String delete() throws Exception { String sql2 = " select * from VEGE_CODE_FOR_MCHT t where t.Vege_Code = '" + getVegCode() + "'"; List<Object[]> dataList2 = commQueryDAO.findBySQLQuery(sql2); //是否存在此条记录 if (dataList2.size() > 0) { return ErrorCode.T30500_04; } String sql = "select VEGE_CODE,VEGE_NAME from vege_code_base where VEGE_CODE = '" + getVegCode() + "' "; List<Object[]> dataList = commQueryDAO.findBySQLQuery(sql); //是否存在此条记录 if (dataList.size() <= 0) { return ErrorCode.T30500_03; } TblVegeCodeInfo vegeCodeInfo = new TblVegeCodeInfo(); for (Object[] obj : dataList) { vegeCodeInfo.setVegCode(obj[0].toString()); vegeCodeInfo.setVegName(obj[1].toString()); } //删除机构信息 t30500BO.delete(vegeCodeInfo); // reloadOprBrhInfo(); return Constants.SUCCESS_CODE; } /** * * //TODO 更新菜品信息 * * @return * @throws Exception */ private String update() throws Exception { jsonBean.parseJSONArrayData(getVegDataList()); int len = jsonBean.getArray().size(); List<TblVegeCodeInfo> vegeInfoList = new ArrayList<TblVegeCodeInfo>(); for (int i = 0; i < len; i++) { jsonBean.setObject(jsonBean.getJSONDataAt(i)); TblVegeCodeInfo vegeInfo = new TblVegeCodeInfo(); BeanUtils.setObjectWithPropertiesValue(vegeInfo, jsonBean, true); String sql2 = " select * from VEGE_CODE_FOR_MCHT t where t.Vege_Code = '" + vegeInfo.getVegCode() + "'"; List<Object[]> dataList2 = commQueryDAO.findBySQLQuery(sql2); //是否存在此条记录 if (dataList2.size() > 0) { return "该菜品已经使用,无法修改"; } //判断机构名称是否存在 List<Object[]> lists = t30500BO.findListByName(vegeInfo.getVegName()); if (lists != null && lists.size() > 0) { return ErrorCode.T30500_02; } vegeInfoList.add(vegeInfo); } t30500BO.update(vegeInfoList); return Constants.SUCCESS_CODE; } public String getVegCode() { return vegCode; } public void setVegCode(String vegCode) { this.vegCode = vegCode; } public String getVegName() { return vegName; } public void setVegName(String vegName) { this.vegName = vegName; } public static long getSerialversionuid() { return serialVersionUID; } public T30500BO getT30500BO() { return t30500BO; } public void setT30500BO(T30500BO t30500bo) { t30500BO = t30500bo; } public String getVegDataList() { return vegDataList; } public void setVegDataList(String vegDataList) { this.vegDataList = vegDataList; } }
[ "weijx@inspur.com" ]
weijx@inspur.com
42a9804ae3f1a546955cd89362b1dc468cf5f461
f1303f0264cbbfcecb98fbf8fb61f271aad38711
/MiKandi-Developer-Tools-v0_01/src/com/mikandi/mikandidevelopertools/MainActivity.java
b3bea16aa42d34c953cfc17c856cb755dace35ed
[]
no_license
djcarlinwa/mikandi_developer_tools
b4126ae4313730d8d3ae362685f9f0a31889a123
1ed6f309e8220f3376cef4936744f678777ea710
refs/heads/master
2020-04-13T14:02:04.606116
2014-03-27T21:52:54
2014-03-27T21:52:54
18,217,695
1
0
null
null
null
null
UTF-8
Java
false
false
2,022
java
package com.mikandi.mikandidevelopertools; import android.app.Fragment; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android.support.v7.app.ActionBarActivity; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; public class MainActivity extends FragmentActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // new DefaultJSONAsyncTask<PricePoint>(PricePoint.class, this, this, GetDeviceAndUserInfo.getDefaultArgs(this)).execute(); if (savedInstanceState == null) { getSupportFragmentManager().beginTransaction().add(R.id.container, new PlaceholderFragment()).commit(); } } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } /** * A placeholder fragment containing a simple view. */ public static class PlaceholderFragment extends Fragment { public PlaceholderFragment() { } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_main, container, false); return rootView; } } }
[ "david@knowwherenow.com" ]
david@knowwherenow.com
a78eb9ba77bf59b0f84d00ec144b12bc0e2462bc
8afd3df6ebd50466687db6d44641b74181aece1a
/src/com/badlogic/gdx/input/RemoteInput.java
70479fcfd58628edcc627c053f3865786fd6f281
[]
no_license
GabrielJadderson/Nightplanet-Game
c69cdaf4d6c664f4ed392d3f9fc5b53b102167a6
d5d05fa5d91f394b1067c1dc6cb148ce27fb19b3
refs/heads/master
2022-06-22T10:35:33.550747
2022-06-18T22:04:55
2022-06-18T22:04:55
105,397,174
2
0
null
null
null
null
UTF-8
Java
false
false
13,315
java
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * 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.badlogic.gdx.input; import java.io.DataInputStream; import java.io.IOException; import java.net.InetAddress; import java.net.ServerSocket; import java.net.Socket; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Input; import com.badlogic.gdx.Input.TextInputListener; import com.badlogic.gdx.InputProcessor; import com.badlogic.gdx.utils.GdxRuntimeException; import com.badlogic.gdx.utils.IntSet; /** <p> * An {@link Input} implementation that receives touch, key, accelerometer and compass events from a remote Android device. Just * instantiate it and specify the port it should listen on for incoming connections (default 8190). Then store the new RemoteInput * instance in Gdx.input. That's it. * </p> * * <p> * On your Android device you can use the gdx-remote application available on the Google Code page as an APK or in SVN * (extensions/gdx-remote). Open it, specify the IP address and the port of the PC your libgdx app is running on and then tap * away. * </p> * * <p> * The touch coordinates will be translated to the desktop window's coordinate system, no matter the orientation of the device * </p> * * @author mzechner */ public class RemoteInput implements Runnable, Input { public interface RemoteInputListener { void onConnected (); void onDisconnected (); } class KeyEvent { static final int KEY_DOWN = 0; static final int KEY_UP = 1; static final int KEY_TYPED = 2; long timeStamp; int type; int keyCode; char keyChar; } class TouchEvent { static final int TOUCH_DOWN = 0; static final int TOUCH_UP = 1; static final int TOUCH_DRAGGED = 2; long timeStamp; int type; int x; int y; int pointer; } class EventTrigger implements Runnable { TouchEvent touchEvent; KeyEvent keyEvent; public EventTrigger (TouchEvent touchEvent, KeyEvent keyEvent) { this.touchEvent = touchEvent; this.keyEvent = keyEvent; } @Override public void run () { justTouched = false; if (keyJustPressed) { keyJustPressed = false; for (int i = 0; i < justPressedKeys.length; i++) { justPressedKeys[i] = false; } } if (processor != null) { if (touchEvent != null) { touchX[touchEvent.pointer] = touchEvent.x; touchY[touchEvent.pointer] = touchEvent.y; switch (touchEvent.type) { case TouchEvent.TOUCH_DOWN: processor.touchDown(touchEvent.x, touchEvent.y, touchEvent.pointer, Input.Buttons.LEFT); isTouched[touchEvent.pointer] = true; justTouched = true; break; case TouchEvent.TOUCH_UP: processor.touchUp(touchEvent.x, touchEvent.y, touchEvent.pointer, Input.Buttons.LEFT); isTouched[touchEvent.pointer] = false; break; case TouchEvent.TOUCH_DRAGGED: processor.touchDragged(touchEvent.x, touchEvent.y, touchEvent.pointer); break; } } if (keyEvent != null) { switch (keyEvent.type) { case KeyEvent.KEY_DOWN: processor.keyDown(keyEvent.keyCode); if (!keys[keyEvent.keyCode]) { keyCount++; keys[keyEvent.keyCode] = true; } keyJustPressed = true; justPressedKeys[keyEvent.keyCode] = true; break; case KeyEvent.KEY_UP: processor.keyUp(keyEvent.keyCode); if (keys[keyEvent.keyCode]) { keyCount--; keys[keyEvent.keyCode] = false; } break; case KeyEvent.KEY_TYPED: processor.keyTyped(keyEvent.keyChar); break; } } } else { if (touchEvent != null) { touchX[touchEvent.pointer] = touchEvent.x; touchY[touchEvent.pointer] = touchEvent.y; if (touchEvent.type == TouchEvent.TOUCH_DOWN) { isTouched[touchEvent.pointer] = true; justTouched = true; } if (touchEvent.type == TouchEvent.TOUCH_UP) { isTouched[touchEvent.pointer] = false; } } if (keyEvent != null) { if (keyEvent.type == KeyEvent.KEY_DOWN) { if (!keys[keyEvent.keyCode]) { keyCount++; keys[keyEvent.keyCode] = true; } keyJustPressed = true; justPressedKeys[keyEvent.keyCode] = true; } if (keyEvent.type == KeyEvent.KEY_UP) { if (keys[keyEvent.keyCode]) { keyCount--; keys[keyEvent.keyCode] = false; } } } } } } public static int DEFAULT_PORT = 8190; private ServerSocket serverSocket; private float[] accel = new float[3]; private float[] gyrate = new float[3]; private float[] compass = new float[3]; private boolean multiTouch = false; private float remoteWidth = 0; private float remoteHeight = 0; private boolean connected = false; private RemoteInputListener listener; int keyCount = 0; boolean[] keys = new boolean[256]; boolean keyJustPressed = false; boolean[] justPressedKeys = new boolean[256]; int[] touchX = new int[20]; int[] touchY = new int[20]; boolean isTouched[] = new boolean[20]; boolean justTouched = false; InputProcessor processor = null; private final int port; public final String[] ips; public RemoteInput () { this(DEFAULT_PORT); } public RemoteInput (RemoteInputListener listener) { this(DEFAULT_PORT, listener); } public RemoteInput (int port) { this(port, null); } public RemoteInput (int port, RemoteInputListener listener) { this.listener = listener; try { this.port = port; serverSocket = new ServerSocket(port); Thread thread = new Thread(this); thread.setDaemon(true); thread.start(); InetAddress[] allByName = InetAddress.getAllByName(InetAddress.getLocalHost().getHostName()); ips = new String[allByName.length]; for (int i = 0; i < allByName.length; i++) { ips[i] = allByName[i].getHostAddress(); } } catch (Exception e) { throw new GdxRuntimeException("Couldn't open listening socket at port '" + port + "'", e); } } @Override public void run () { while (true) { try { connected = false; if (listener != null) listener.onDisconnected(); System.out.println("listening, port " + port); Socket socket = null; socket = serverSocket.accept(); socket.setTcpNoDelay(true); socket.setSoTimeout(3000); connected = true; if (listener != null) listener.onConnected(); DataInputStream in = new DataInputStream(socket.getInputStream()); multiTouch = in.readBoolean(); while (true) { int event = in.readInt(); KeyEvent keyEvent = null; TouchEvent touchEvent = null; switch (event) { case RemoteSender.ACCEL: accel[0] = in.readFloat(); accel[1] = in.readFloat(); accel[2] = in.readFloat(); break; case RemoteSender.COMPASS: compass[0] = in.readFloat(); compass[1] = in.readFloat(); compass[2] = in.readFloat(); break; case RemoteSender.SIZE: remoteWidth = in.readFloat(); remoteHeight = in.readFloat(); break; case RemoteSender.GYRO: gyrate[0] = in.readFloat(); gyrate[1] = in.readFloat(); gyrate[2] = in.readFloat(); break; case RemoteSender.KEY_DOWN: keyEvent = new KeyEvent(); keyEvent.keyCode = in.readInt(); keyEvent.type = KeyEvent.KEY_DOWN; break; case RemoteSender.KEY_UP: keyEvent = new KeyEvent(); keyEvent.keyCode = in.readInt(); keyEvent.type = KeyEvent.KEY_UP; break; case RemoteSender.KEY_TYPED: keyEvent = new KeyEvent(); keyEvent.keyChar = in.readChar(); keyEvent.type = KeyEvent.KEY_TYPED; break; case RemoteSender.TOUCH_DOWN: touchEvent = new TouchEvent(); touchEvent.x = (int)((in.readInt() / remoteWidth) * Gdx.graphics.getWidth()); touchEvent.y = (int)((in.readInt() / remoteHeight) * Gdx.graphics.getHeight()); touchEvent.pointer = in.readInt(); touchEvent.type = TouchEvent.TOUCH_DOWN; break; case RemoteSender.TOUCH_UP: touchEvent = new TouchEvent(); touchEvent.x = (int)((in.readInt() / remoteWidth) * Gdx.graphics.getWidth()); touchEvent.y = (int)((in.readInt() / remoteHeight) * Gdx.graphics.getHeight()); touchEvent.pointer = in.readInt(); touchEvent.type = TouchEvent.TOUCH_UP; break; case RemoteSender.TOUCH_DRAGGED: touchEvent = new TouchEvent(); touchEvent.x = (int)((in.readInt() / remoteWidth) * Gdx.graphics.getWidth()); touchEvent.y = (int)((in.readInt() / remoteHeight) * Gdx.graphics.getHeight()); touchEvent.pointer = in.readInt(); touchEvent.type = TouchEvent.TOUCH_DRAGGED; break; } Gdx.app.postRunnable(new EventTrigger(touchEvent, keyEvent)); } } catch (IOException e) { e.printStackTrace(); } } } public boolean isConnected () { return connected; } @Override public float getAccelerometerX () { return accel[0]; } @Override public float getAccelerometerY () { return accel[1]; } @Override public float getAccelerometerZ () { return accel[2]; } @Override public float getGyroscopeX () { return gyrate[0]; } @Override public float getGyroscopeY () { return gyrate[1]; } @Override public float getGyroscopeZ () { return gyrate[2]; } @Override public int getX () { return touchX[0]; } @Override public int getX (int pointer) { return touchX[pointer]; } @Override public int getY () { return touchY[0]; } @Override public int getY (int pointer) { return touchY[pointer]; } @Override public boolean isTouched () { return isTouched[0]; } @Override public boolean justTouched () { return justTouched; } @Override public boolean isTouched (int pointer) { return isTouched[pointer]; } @Override public boolean isButtonPressed (int button) { if (button != Buttons.LEFT) return false; for (int i = 0; i < isTouched.length; i++) if (isTouched[i]) return true; return false; } @Override public boolean isKeyPressed (int key) { if (key == Input.Keys.ANY_KEY) { return keyCount > 0; } if (key < 0 || key > 255) { return false; } return keys[key]; } @Override public boolean isKeyJustPressed (int key) { if (key == Input.Keys.ANY_KEY) { return keyJustPressed; } if (key < 0 || key > 255) { return false; } return justPressedKeys[key]; } @Override public void getTextInput (TextInputListener listener, String title, String text, String hint) { Gdx.app.getInput().getTextInput(listener, title, text, hint); } @Override public void setOnscreenKeyboardVisible (boolean visible) { } @Override public void vibrate (int milliseconds) { } @Override public void vibrate (long[] pattern, int repeat) { } @Override public void cancelVibrate () { } @Override public float getAzimuth () { return compass[0]; } @Override public float getPitch () { return compass[1]; } @Override public float getRoll () { return compass[2]; } @Override public void setCatchBackKey (boolean catchBack) { } @Override public boolean isCatchBackKey() { return false; } @Override public void setCatchMenuKey (boolean catchMenu) { } @Override public boolean isCatchMenuKey () { return false; } @Override public void setInputProcessor (InputProcessor processor) { this.processor = processor; } @Override public InputProcessor getInputProcessor () { return this.processor; } /** @return the IP addresses {@link RemoteSender} or gdx-remote should connect to. Most likely the LAN addresses if behind a NAT. */ public String[] getIPs () { return ips; } @Override public boolean isPeripheralAvailable (Peripheral peripheral) { if (peripheral == Peripheral.Accelerometer) return true; if (peripheral == Peripheral.Compass) return true; if (peripheral == Peripheral.MultitouchScreen) return multiTouch; return false; } @Override public int getRotation () { return 0; } @Override public Orientation getNativeOrientation () { return Orientation.Landscape; } @Override public void setCursorCatched (boolean catched) { } @Override public boolean isCursorCatched () { return false; } @Override public int getDeltaX () { // TODO Auto-generated method stub return 0; } @Override public int getDeltaX (int pointer) { return 0; } @Override public int getDeltaY () { return 0; } @Override public int getDeltaY (int pointer) { return 0; } @Override public void setCursorPosition (int x, int y) { } @Override public long getCurrentEventTime () { // TODO Auto-generated method stub return 0; } @Override public void getRotationMatrix (float[] matrix) { // TODO Auto-generated method stub } }
[ "gabrieljadderson@icloud.com" ]
gabrieljadderson@icloud.com
3eb06dbb7692923dee09fedbc67b6dd2c9e71a5c
f5bdd97532b1f4eafc6126e62946f9c516a637b0
/app/src/test/java/com/example/jrb/udemyapp41/ExampleUnitTest.java
cb17c99b3622ee9e26d13b76e874998c4a161fa8
[]
no_license
jatinrajbhatia/Radio-Checkbox-Seekbar-App
8850313434d4b05a1e75a65b573a811096771bb4
c001ce292e658e0cfdc9737c5cc1404ee65933b0
refs/heads/master
2020-03-19T03:15:26.497372
2018-06-01T11:39:08
2018-06-01T11:39:08
135,710,368
0
0
null
null
null
null
UTF-8
Java
false
false
387
java
package com.example.jrb.udemyapp41; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() { assertEquals(4, 2 + 2); } }
[ "jatin@99array.com" ]
jatin@99array.com
8f76eb2623d73a715aa7b7a1aa392b3e30842031
a8f959a4acfef9c079da0de6568a27b7a5272016
/trunk/src/test/java/org/guzz/orm/sql/impl/TestInnerSQLBuilder.java
476a0862dd15edc113294c760d5536823e242be3
[]
no_license
fchunbo/guzz
a3c80d1abbdcf0a59e9268ab82ee0e529f15f64a
137ec72238ca6239c0d37676f524b3b5d2c1a2fb
refs/heads/master
2021-01-13T09:34:05.279698
2016-11-01T09:00:21
2016-11-01T09:00:21
72,519,407
0
0
null
null
null
null
UTF-8
Java
false
false
5,988
java
/* * Copyright 2008-2009 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package org.guzz.orm.sql.impl; import java.util.Arrays; import org.guzz.GuzzContextImpl; import org.guzz.io.FileResource; import org.guzz.orm.Business; import org.guzz.orm.mapping.POJOBasedObjectMapping; import org.guzz.orm.sql.CompiledSQL; import org.guzz.test.GuzzTestCase; /** * * * * @author liukaixuan(liukaixuan@gmail.com) */ public class TestInnerSQLBuilder extends GuzzTestCase { public void testTranslateSQLMark() throws Exception{ POJOBasedObjectMapping map = (POJOBasedObjectMapping) gf.getObjectMappingManager().getStaticObjectMapping("user") ; CompiledSQLManagerImpl csm = new CompiledSQLManagerImpl(((GuzzContextImpl) gf).getCompiledSQLBuilder()) ; //test insert CompiledSQL cs = csm.buildNormalInsertSQLWithPK(map) ; assertEquals(cs.bindNoParams().getSQLToRun(), "insert into TB_USER(pk, userName, MyPSW, VIP_USER, FAV_COUNT, createdTime) values(?, ?, ?, ?, ?, ?)") ; assertEquals(cs.bindNoParams().getCompiledSQLToRun().getOrderedParams().length, 6) ; assertEquals(Arrays.asList(cs.bindNoParams().getCompiledSQLToRun().getOrderedParams()).toString(), "[id, userName, password, vip, favCount, createdTime]") ; cs = csm.buildNormalInsertSQLWithoutPK(map) ; assertEquals(cs.bindNoParams().getSQLToRun(), "insert into TB_USER(userName, MyPSW, VIP_USER, FAV_COUNT, createdTime) values(?, ?, ?, ?, ?)") ; assertEquals(cs.bindNoParams().getCompiledSQLToRun().getOrderedParams().length, 5) ; assertEquals(Arrays.asList(cs.bindNoParams().getCompiledSQLToRun().getOrderedParams()).toString(), "[userName, password, vip, favCount, createdTime]") ; //update cs = csm.buildNormalUpdateSQL(map) ; assertEquals(cs.bindNoParams().getSQLToRun(), "update TB_USER set userName=?, MyPSW=?, VIP_USER=?, FAV_COUNT=?, createdTime=? where pk=?") ; assertEquals(cs.bindNoParams().getCompiledSQLToRun().getOrderedParams().length, 6) ; assertEquals(Arrays.asList(cs.bindNoParams().getCompiledSQLToRun().getOrderedParams()).toString(), "[userName, password, vip, favCount, createdTime, id]") ; //delete cs = csm.buildNormalDeleteSQL(map) ; assertEquals(cs.bindNoParams().getSQLToRun(), "delete from TB_USER where pk=?") ; assertEquals(cs.bindNoParams().getCompiledSQLToRun().getOrderedParams().length, 1) ; assertEquals(Arrays.asList(cs.bindNoParams().getCompiledSQLToRun().getOrderedParams()).toString(), "[id]") ; //select cs = csm.buildNormalSelectSQL(map) ; assertEquals(cs.bindNoParams().getSQLToRun(), "select pk, userName, MyPSW, VIP_USER, FAV_COUNT, createdTime from TB_USER where pk=?") ; assertEquals(cs.bindNoParams().getCompiledSQLToRun().getOrderedParams().length, 1) ; assertEquals(Arrays.asList(cs.bindNoParams().getCompiledSQLToRun().getOrderedParams()).toString(), "[id]") ; } public void testInsertUpdateIgnoreParam() throws Exception{ Business ga = gf.instanceNewGhost("articleCount", null, null, null) ; gf.addHbmConfigFile(ga, FileResource.CLASS_PATH_PREFIX + "org/guzz/test/ArticleCount.hbm.xml") ; POJOBasedObjectMapping map = (POJOBasedObjectMapping) gf.getObjectMappingManager().getStaticObjectMapping("articleCount") ; CompiledSQLManagerImpl csm = new CompiledSQLManagerImpl(((GuzzContextImpl) gf).getCompiledSQLBuilder()) ; //test insert CompiledSQL cs = csm.buildNormalInsertSQLWithPK(map) ; assertEquals(cs.bindNoParams().getSQLToRun(), "insert into TB_ARTICLE_COUNT(ARTICLE_ID, readCount, createdTime) values(?, ?, ?)") ; assertEquals(cs.bindNoParams().getCompiledSQLToRun().getOrderedParams().length, 3) ; assertEquals(Arrays.asList(cs.bindNoParams().getCompiledSQLToRun().getOrderedParams()).toString(), "[articleId, readCount, createdTime]") ; cs = csm.buildNormalInsertSQLWithoutPK(map) ; assertEquals(cs.bindNoParams().getSQLToRun(), "insert into TB_ARTICLE_COUNT(readCount, createdTime) values(?, ?)") ; assertEquals(cs.bindNoParams().getCompiledSQLToRun().getOrderedParams().length, 2) ; assertEquals(Arrays.asList(cs.bindNoParams().getCompiledSQLToRun().getOrderedParams()).toString(), "[readCount, createdTime]") ; //update cs = csm.buildNormalUpdateSQL(map) ; assertEquals(cs.bindNoParams().getSQLToRun(), "update TB_ARTICLE_COUNT set supportCount=?, opposeCount=?, createdTime=? where ARTICLE_ID=?") ; assertEquals(cs.bindNoParams().getCompiledSQLToRun().getOrderedParams().length, 4) ; assertEquals(Arrays.asList(cs.bindNoParams().getCompiledSQLToRun().getOrderedParams()).toString(), "[supportCount, opposeCount, createdTime, articleId]") ; //delete cs = csm.buildNormalDeleteSQL(map) ; assertEquals(cs.bindNoParams().getSQLToRun(), "delete from TB_ARTICLE_COUNT where ARTICLE_ID=?") ; assertEquals(cs.bindNoParams().getCompiledSQLToRun().getOrderedParams().length, 1) ; assertEquals(Arrays.asList(cs.bindNoParams().getCompiledSQLToRun().getOrderedParams()).toString(), "[articleId]") ; //select cs = csm.buildNormalSelectSQL(map) ; assertEquals(cs.bindNoParams().getSQLToRun(), "select ARTICLE_ID, readCount, supportCount, opposeCount, createdTime from TB_ARTICLE_COUNT where ARTICLE_ID=?") ; assertEquals(cs.bindNoParams().getCompiledSQLToRun().getOrderedParams().length, 1) ; assertEquals(Arrays.asList(cs.bindNoParams().getCompiledSQLToRun().getOrderedParams()).toString(), "[articleId]") ; } protected void setUp() throws Exception { super.buildGF() ; } }
[ "fchunbo@qq.com" ]
fchunbo@qq.com
198a139b43894acb1a35820efee90c72bb4a87a0
3f622e1e59c04dedf28634b6c32e7f8bfea02b86
/Module 1/01 Core Java/01 editplusprograms/29-superclasstosubclass/SubclassObjectDemo.java
9bbc0cb80619607633845f92d8e47e7b92495314
[]
no_license
bijumedayil/Examples
60abac3f25d82677666031ad4a0efb469f0b7e2c
ac06e421a75963288f01311902109c381c3ba103
refs/heads/master
2021-07-25T07:06:02.145734
2017-11-05T08:34:18
2017-11-05T08:34:18
109,561,771
0
0
null
null
null
null
UTF-8
Java
false
false
673
java
class A { static { System.out.println("Inside A static block"); } { System.out.println("Inside A instance block"); } A() { System.out.println("Inside A constructor"); } void m1() { System.out.println("Inside A m1()"); } }; class B extends A { static { System.out.println("Inside B static block"); } { System.out.println("Inside B instance block"); } B() { System.out.println("Inside B constructor"); } void m2() { System.out.println("Inside B m2()"); } }; class SubclassObjectDemo { public static void main(String[] args) { System.out.println("Hello World!"); A a = new A(); a.m1(); B b = new B(); b.m1(); } }
[ "U44592@E206LTRV.ustr.com" ]
U44592@E206LTRV.ustr.com
0f039b0c2a1e4faac99d2cb0fa86b70270ec95d8
5c7b9021826a731e9c2d5095a6de4b23ed4c4ea8
/src/main/java/com/example/demo/model/Eleve.java
8d03fc7372c6a4872016f3a0bc551848e4d46346
[]
no_license
HaouariBaderdine/SpringBoot-mongodb-auth-backend
cb8d27e339faf1c48cc68bde907e9c11d497dc67
368e124586b1e4190e39d013e528861fc5c708d2
refs/heads/main
2023-01-19T07:22:22.100011
2020-11-11T19:50:43
2020-11-11T19:50:43
310,915,930
0
0
null
null
null
null
UTF-8
Java
false
false
1,669
java
package com.example.demo.model; import javax.validation.constraints.NotBlank; import javax.validation.constraints.Size; import org.springframework.data.annotation.Id; public class Eleve { @Id private String id; @NotBlank @Size(max = 50) private String nom; @NotBlank @Size(max = 50) private String prenom; @NotBlank @Size(max = 50) private String dateNaissance; @NotBlank @Size(max = 20) private String classe; @NotBlank @Size(max = 20) private String idCollege; public Eleve(@NotBlank @Size(max = 50) String nom, @NotBlank @Size(max = 50) String prenom, @NotBlank @Size(max = 50) String dateNaissance, @NotBlank @Size(max = 20) String classe, @NotBlank @Size(max = 20) String idCollege) { this.nom = nom; this.prenom = prenom; this.dateNaissance = dateNaissance; this.classe = classe; this.idCollege = idCollege; } public String getId() { return id; } public String getNom() { return nom; } public String getPrenom() { return prenom; } public String getDateNaissance() { return dateNaissance; } public String getClasse() { return classe; } public String getIdCollege() { return idCollege; } public void setId(String id) { this.id = id; } public void setNom(String nom) { this.nom = nom; } public void setPrenom(String prenom) { this.prenom = prenom; } public void setDateNaissance(String dateNaissance) { this.dateNaissance = dateNaissance; } public void setClasse(String classe) { this.classe = classe; } public void setIdCollege(String idCollege) { this.idCollege = idCollege; } }
[ "mimi.bader4@gmail.com" ]
mimi.bader4@gmail.com
0685cf229bb0709df360d90f1de1ef9754db0b95
523b1f8646c15cb02cca7668ababd9dc54308b22
/Padrões de Projeto - Use a cabeça/Strategy/DuckProject/src/main/FlyNoWay.java
46dc2c7f36668f3d49e3060328280a050c104e62
[ "MIT" ]
permissive
joaopedronardari/COO-EACHUSP
13d274d5893647c62dd358a6a059bd4661a2b02a
ea243117598003ba5e46e532e6ccc6bcf99a49db
refs/heads/master
2021-01-20T05:52:25.926718
2014-07-28T04:12:51
2014-07-28T04:12:51
20,363,811
1
0
null
null
null
null
UTF-8
Java
false
false
139
java
package main; public class FlyNoWay implements FlyBehavior { @Override public void fly() { System.out.println("I can't fly!"); } }
[ "joaonardari@terra.com.br" ]
joaonardari@terra.com.br
9d1e4eeabc7b16b9f738e673212bcea16bbff825
f20004687b953f2ab62452a12844485ad21d601c
/src/ville/servlet/AfficheMeteo.java
67db3de788c762bb56ed16769773030a678b2c62
[]
no_license
barkalma/API_REST_CLIENT
dd1a7c8cc41514222ff270d6f4f440567ab603f6
542a52f9e03ebcc2ae19e686412ad812ea5ff2ac
refs/heads/master
2020-05-12T18:15:57.475959
2019-04-29T18:09:28
2019-04-29T18:09:28
181,540,079
0
0
null
null
null
null
UTF-8
Java
false
false
5,831
java
package ville.servlet; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; import java.net.URLEncoder; import java.text.DecimalFormat; import javax.net.ssl.HttpsURLConnection; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import ville.bean.VilleMeteo; /** * Servlet implementation class AfficheMeteo */ @WebServlet("/AfficheMeteo") public class AfficheMeteo extends HttpServlet { private static final long serialVersionUID = 1L; /** * @see HttpServlet#HttpServlet() */ public AfficheMeteo() { super(); } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse * response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String ville = request.getParameter("ville"); URL url = new URL("http://localhost:8181/villeFranceFind?value=" + URLEncoder.encode(ville, "UTF-8")); HttpURLConnection con = (HttpURLConnection) url.openConnection(); con.setRequestMethod("GET"); BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream())); String inputLine; StringBuilder response1 = new StringBuilder(); while ((inputLine = in.readLine()) != null) { response1.append(inputLine); } in.close(); ville = response1.toString(); VilleMeteo villeMeteo = this.toVilleMeteo(ville); URL urlMeteo = new URL("http://api.openweathermap.org/data/2.5/weather?" + "lat=" + villeMeteo.getLattitude().split("\"")[1] + "&lon=" + villeMeteo.getLongitude().split("\"")[1] + "&APPID=06560519526bae616c17bb73cae22647"); HttpURLConnection conMeteo = (HttpURLConnection) urlMeteo.openConnection(); conMeteo.setRequestMethod("GET"); BufferedReader inMeteo = new BufferedReader(new InputStreamReader(conMeteo.getInputStream())); String inputLineMeteo; StringBuilder responseMeteo = new StringBuilder(); while ((inputLineMeteo = inMeteo.readLine()) != null) { responseMeteo.append(inputLineMeteo); } inMeteo.close(); int debutTemps = responseMeteo.indexOf("weather"); int finTemps = responseMeteo.indexOf(",\"description\""); int debutTemperature = responseMeteo.indexOf("temp\":"); int finTemperature = responseMeteo.indexOf(",\"pressure"); int debutIcone = responseMeteo.indexOf("\"weather\":[{"); int finIcone = responseMeteo.indexOf("],\"base\""); String temps = responseMeteo.substring(debutTemps + 7, finTemps); temps = temps.substring(temps.indexOf("main\":") + 7, temps.length() - 1); String temperature = responseMeteo.substring(debutTemperature + 6, finTemperature); String temperatureCelcius = kelvinToCelcius(temperature); String icone = responseMeteo.substring(debutIcone + 12, finIcone); String cheminIcone = "http://openweathermap.org/img/w/" + icone.substring(icone.indexOf("icon") + 7, icone.indexOf("}") - 1) + ".png"; String population = "Inconnu"; try { URL urlPop = new URL("https://geo.api.gouv.fr/communes?codePostal="+ villeMeteo.getCodePostal().split("\"")[1] +"&fields=population"); HttpsURLConnection conPop = (HttpsURLConnection) urlPop.openConnection(); conPop.setRequestMethod("GET"); BufferedReader inPop = new BufferedReader(new InputStreamReader(conPop.getInputStream())); String inputLinePop; StringBuilder responsePop = new StringBuilder(); while ((inputLinePop = inPop.readLine()) != null) { responsePop.append(inputLinePop); } inPop.close(); if (!("Not Found").equals(responsePop.toString())) { population = responsePop.substring(responsePop.indexOf("population") + 12, responsePop.indexOf(",\"nom\"")); } else { population = "Inconnu"; } } catch (Exception e) { throw e; } HttpSession session = request.getSession(); villeMeteo.setTemperature(temperatureCelcius); villeMeteo.setTemps(temps); villeMeteo.setIdTemps(cheminIcone); villeMeteo.setPop(population); session.setAttribute("villeMeteo", villeMeteo); this.getServletContext().getRequestDispatcher("/resultatMeteo.jsp").forward(request, response); } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse * response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doGet(request, response); } private static String kelvinToCelcius(String temperature) { Double celcius = Double.parseDouble(temperature) - 273.15; DecimalFormat f = new DecimalFormat(); f.setMaximumFractionDigits(2); return f.format(celcius); } public VilleMeteo toVilleMeteo(String villeString) { VilleMeteo ville = new VilleMeteo(); villeString.replace(" ", ""); villeString.replace("[", ""); villeString.replace("]", ""); villeString.replace("\"", ""); String[] villepart = villeString.split(","); String codeCommune = villepart[0].split(":")[1]; String nomCommune = villepart[1].split(":")[1]; String codePostal = villepart[2].split(":")[1]; String libelle = villepart[3].split(":")[1]; String ligne = ""; if (villepart[4].split(":").length == 2) { ligne = villepart[4].split(":")[1]; } String lattitude = villepart[5].split(":")[1]; String longitude = villepart[6].split(":")[1].split("}")[0]; longitude = longitude.split("]")[0]; ville.setCodeCommuneInsee(codeCommune); ville.setNomCommune(nomCommune); ville.setCodePostal(codePostal); ville.setLibelleAcheminement(libelle); ville.setLigne5(ligne); ville.setLattitude(lattitude); ville.setLongitude(longitude); return ville; } }
[ "marwa.barkallah@reseau.eseo.fr" ]
marwa.barkallah@reseau.eseo.fr
d9db88c814d4ee471fb55d5514687ba78a2156ea
e0a3fbb221d16f391991095e842c8c4b09b332f6
/plugins/com.zeligsoft.base.ui/src/com/zeligsoft/base/ui/providers/ZDLIconProvider.java
94b5de9dc3ad8863a12854fe1cadaea90be78ce6
[ "Apache-2.0" ]
permissive
ZeligsoftDev/DomainDevKit
e95ac78159730eb2ab938893f8dba67f07218d4a
8eb7d8b87ab2f904588e191aee49dca8083fe9db
refs/heads/master
2022-07-28T17:13:16.140038
2021-10-07T20:44:45
2021-10-07T20:44:45
269,425,565
3
1
Apache-2.0
2020-06-09T14:40:58
2020-06-04T17:42:21
Java
UTF-8
Java
false
false
2,274
java
/******************************************************************************* * Copyright (c) 2020 Northrop Grumman Systems 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. *******************************************************************************/ package com.zeligsoft.base.ui.providers; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.emf.ecore.EObject; import org.eclipse.gmf.runtime.common.core.service.AbstractProvider; import org.eclipse.gmf.runtime.common.core.service.IOperation; import org.eclipse.gmf.runtime.common.ui.services.icon.IIconOperation; import org.eclipse.gmf.runtime.common.ui.services.icon.IIconProvider; import org.eclipse.swt.graphics.Image; import com.zeligsoft.base.ui.utils.ZDLImageRegistry; /** * An icon provider that gets icons for model elements according to their * defining ZDL concept. * * @author Christian W. Damus (cdamus) */ public class ZDLIconProvider extends AbstractProvider implements IIconProvider { /** * Initializes me. */ public ZDLIconProvider() { super(); } @Override public Image getIcon(IAdaptable hint, int flags) { Image result = null; EObject modelElement = (hint == null) ? null : (EObject) hint.getAdapter(EObject.class); if (modelElement != null) { result = ZDLImageRegistry.getInstance().getZDLIcon(modelElement); } return result; } @Override public boolean provides(IOperation operation) { boolean result = false; if (operation instanceof IIconOperation) { IIconOperation iconOp = (IIconOperation) operation; IAdaptable hint = iconOp.getHint(); result = (hint != null) && (getIcon(hint, 0) != null); } return result; } }
[ "geoffelder@Geoffreys-MacBook-Pro-2.local" ]
geoffelder@Geoffreys-MacBook-Pro-2.local
a333d8430b8b8d4a3bf210597ecae26f4f99df1f
e9affefd4e89b3c7e2064fee8833d7838c0e0abc
/aws-java-sdk-directconnect/src/main/java/com/amazonaws/services/directconnect/model/transform/AssociateHostedConnectionRequestProtocolMarshaller.java
5db421cfc3a0f0e3ad50dc0f7ac1c5c727cce1b6
[ "Apache-2.0" ]
permissive
aws/aws-sdk-java
2c6199b12b47345b5d3c50e425dabba56e279190
bab987ab604575f41a76864f755f49386e3264b4
refs/heads/master
2023-08-29T10:49:07.379135
2023-08-28T21:05:55
2023-08-28T21:05:55
574,877
3,695
3,092
Apache-2.0
2023-09-13T23:35:28
2010-03-22T23:34:58
null
UTF-8
Java
false
false
2,862
java
/* * Copyright 2018-2023 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.directconnect.model.transform; import javax.annotation.Generated; import com.amazonaws.SdkClientException; import com.amazonaws.Request; import com.amazonaws.http.HttpMethodName; import com.amazonaws.services.directconnect.model.*; import com.amazonaws.transform.Marshaller; import com.amazonaws.protocol.*; import com.amazonaws.protocol.Protocol; import com.amazonaws.annotation.SdkInternalApi; /** * AssociateHostedConnectionRequest Marshaller */ @Generated("com.amazonaws:aws-java-sdk-code-generator") @SdkInternalApi public class AssociateHostedConnectionRequestProtocolMarshaller implements Marshaller<Request<AssociateHostedConnectionRequest>, AssociateHostedConnectionRequest> { private static final OperationInfo SDK_OPERATION_BINDING = OperationInfo.builder().protocol(Protocol.AWS_JSON).requestUri("/") .httpMethodName(HttpMethodName.POST).hasExplicitPayloadMember(false).hasPayloadMembers(true) .operationIdentifier("OvertureService.AssociateHostedConnection").serviceName("AmazonDirectConnect").build(); private final com.amazonaws.protocol.json.SdkJsonProtocolFactory protocolFactory; public AssociateHostedConnectionRequestProtocolMarshaller(com.amazonaws.protocol.json.SdkJsonProtocolFactory protocolFactory) { this.protocolFactory = protocolFactory; } public Request<AssociateHostedConnectionRequest> marshall(AssociateHostedConnectionRequest associateHostedConnectionRequest) { if (associateHostedConnectionRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { final ProtocolRequestMarshaller<AssociateHostedConnectionRequest> protocolMarshaller = protocolFactory.createProtocolMarshaller( SDK_OPERATION_BINDING, associateHostedConnectionRequest); protocolMarshaller.startMarshalling(); AssociateHostedConnectionRequestMarshaller.getInstance().marshall(associateHostedConnectionRequest, protocolMarshaller); return protocolMarshaller.finishMarshalling(); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
[ "" ]
cd85961b6d151f50579e194d5423e93ac88ade75
2bed82468de470e2708abaa4cb977c69889edc03
/konf-core/src/test/java/com/uchuhimo/konf/AnonymousConfigSpec.java
350cc78e808f90972e35a6b31b4199cea291c58d
[ "Apache-2.0" ]
permissive
untra/konf
c40bb1f6f0159be62c287bb4ba46ae0bb5de4076
71342f69fb6f363e717b4aaa61e048664fed1820
refs/heads/master
2022-12-28T06:51:51.252490
2020-10-13T08:06:44
2020-10-13T08:06:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
735
java
/* * Copyright 2017-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.uchuhimo.konf; public class AnonymousConfigSpec { public static Spec spec = new ConfigSpec() {}; }
[ "uchuhimo@outlook.com" ]
uchuhimo@outlook.com
76d9064780a68dc24f3366ce66816dc041b21caa
0e51c2fc9123e6b924d6930359c10d1bfc1a1b2d
/src/test/java/GeneralTests.java
5fa7bdc3767721791eb63e12b004323ef9010e84
[]
no_license
sivanl/GameOfLife
b01ca34447fa3c6c81cf1087c0977ff5d95c77e4
ea643cdf82d51522132ec26f751cf4642e76027e
refs/heads/master
2020-04-06T11:42:15.139069
2018-11-13T18:25:54
2018-11-13T18:25:54
null
0
0
null
null
null
null
UTF-8
Java
false
false
398
java
import org.junit.Assert; import org.junit.Test; /** * Created by sivanlauf on 13/11/2018. */ public class GeneralTests { @Test public void IsValidGridTest(){ boolean isValid = Game.isGridValid(3, 3, "0 0 0 0 1 0 0 1 0"); Assert.assertTrue(isValid); boolean isValid2 = Game.isGridValid(3, 5, "0 0 0 0 1 0 0 1 0"); Assert.assertFalse(isValid2); } }
[ "sivan.lauf@shadow.com" ]
sivan.lauf@shadow.com
3b8327c8631cf0b8c834cb9d2f336d3ea2346cd7
f52f297c837c1e100971039b8a9be0612055fe22
/app/src/androidTest/java/cheongs/washington/edu/bluetooth/ApplicationTest.java
38ec0ae28a79ec396b7f29220f532a591a2caa80
[]
no_license
seanhcheong/bluetooth
2b7ba72670a11c0c23a043a4e2a9246448422303
52d3c01a8bb50bca4c41ae2dbe5096d5ea7a17d5
refs/heads/master
2021-01-10T04:55:02.331578
2015-06-01T19:49:34
2015-06-01T19:49:34
36,638,622
0
0
null
null
null
null
UTF-8
Java
false
false
363
java
package cheongs.washington.edu.bluetooth; import android.app.Application; import android.test.ApplicationTestCase; /** * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> */ public class ApplicationTest extends ApplicationTestCase<Application> { public ApplicationTest() { super(Application.class); } }
[ "lt@d-128-208-49-143.dhcp4.washington.edu" ]
lt@d-128-208-49-143.dhcp4.washington.edu
36a83db80599d2e0b68dbcde73d76b5aa4951a57
fc7c1e3e88775217e89245c31e7a333e4c75c38f
/water-java-core/src/main/java/jp/gr/java_conf/kgd/library/water/java/core/value/IntColor3Trait.java
948ab31f1f1224384ba6e2fef01f15d7c04c36ee
[ "MIT" ]
permissive
t-kgd/library-water
a76bbee205802bd25fd27404cc58e3c6f26d51fc
e19822eb5d7a0414d1056852ea3ae90e1e24467b
refs/heads/master
2016-09-11T02:58:39.515546
2015-07-09T08:01:38
2015-07-09T08:01:38
38,787,571
0
0
null
null
null
null
UTF-8
Java
false
false
5,552
java
/* * The MIT License * * Copyright 2015 misakura. * * 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 jp.gr.java_conf.kgd.library.water.java.core.value; /** * 値の型を{@link Integer}に特化し、デフォルトの挙動を定めた{@link IntColor3}。 * * デフォルトの挙動を定めたものであり、原則としてインターフェース部分に使ってはいけません。 * * @author misakura */ public interface IntColor3Trait extends ObjectColor3<Integer>, NumberColor3 { /** * この色の赤成分にあたる値を返す。 * * デフォルトの実装では、{@link #getRedAsInt()}に委譲し、得られた値を静的キャストして返します。 * * @return {@inheritDoc} */ @Override default long getRedAsLong() { return (long) getRedAsInt(); } /** * この色の緑成分にあたる値を返す。 * * デフォルトの実装では、{@link #getGreenAsInt()}に委譲し、得られた値を静的キャストして返します。 * * @return {@inheritDoc} */ @Override default long getGreenAsLong() { return (long) getGreenAsInt(); } /** * この色の青成分にあたる値を返す。 * * デフォルトの実装では、{@link #getBlueAsInt()}に委譲し、得られた値を静的キャストして返します。 * * @return {@inheritDoc} */ @Override default long getBlueAsLong() { return (long) getBlueAsInt(); } /** * この色の赤成分にあたる値を返す。 * * デフォルトの実装では、{@link #getRedAsInt()}に委譲し、得られた値を静的キャストして返します。 * * @return {@inheritDoc} */ @Override default double getRedAsDouble() { return (double) getRedAsInt(); } /** * この色の緑成分にあたる値を返す。 * * デフォルトの実装では、{@link #getGreenAsInt()}に委譲し、得られた値を静的キャストして返します。 * * @return {@inheritDoc} */ @Override default double getGreenAsDouble() { return (double) getGreenAsInt(); } /** * この色の青成分にあたる値を返す。 * * デフォルトの実装では、{@link #getBlueAsInt()}に委譲し、得られた値を静的キャストして返します。 * * @return {@inheritDoc} */ @Override default double getBlueAsDouble() { return (double) getBlueAsInt(); } /** * この色の赤成分にあたる値を返す。 * * 得られる値が防御的にコピーされたものであるかどうかは実装依存です。<br> * デフォルトの実装では、{@link #getRedAsInt()}に委譲し、得られた値をボックス化して返します。(つまり、防御的コピーを行います。) * * @return {@inheritDoc} * @deprecated このインターフェースを直接操作する場合は{@link #getRedAsInt()}を使うべきです。 */ @Deprecated @Override default Integer getRed() { return getRedAsInt(); } /** * この色の緑成分にあたる値を返す。 * * 得られる値が防御的にコピーされたものであるかどうかは実装依存です。<br> * デフォルトの実装では、{@link #getGreenAsInt()}に委譲し、得られた値をボックス化して返します。(つまり、防御的コピーを行います。) * * @return {@inheritDoc} * @deprecated このインターフェースを直接操作する場合は{@link #getGreenAsInt()}を使うべきです。 */ @Deprecated @Override default Integer getGreen() { return getGreenAsInt(); } /** * この色の青成分にあたる値を返す。 * * 得られる値が防御的にコピーされたものであるかどうかは実装依存です。<br> * デフォルトの実装では、{@link #getBlueAsInt()}に委譲し、得られた値をボックス化して返します。(つまり、防御的コピーを行います。) * * @return {@inheritDoc} * @deprecated このインターフェースを直接操作する場合は{@link #getBlueAsInt()}を使うべきです。 */ @Deprecated @Override default Integer getBlue() { return getBlueAsInt(); } }
[ "t-kgd@users.noreply.github.com" ]
t-kgd@users.noreply.github.com
e597c8ee06143a709f458c78cfba3140344515a2
8792e62dc5b98b6d9857bd85250234297fdc4206
/src/Util/DBUtil.java
115f15bbba655ef6b1d9a7a9a330a925bac033d6
[]
no_license
lspzwh/Task03
733b918e7bb3d0c64c6104568f8a08aad25972d8
eef1069f69e1d1becc36d90f0da49d02aafcc58e
refs/heads/main
2023-06-28T09:38:22.119990
2021-08-08T13:26:05
2021-08-08T13:26:05
393,968,115
0
0
null
null
null
null
UTF-8
Java
false
false
866
java
package Util; import java.sql.*; public class DBUtil { static final String JDBC_DRIVER = "com.mysql.cj.jdbc.Driver"; static final String DB_URL = "jdbc:mysql://localhost:3306/test1?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC"; private static final String username = "root"; private static final String password = "123456"; public static Connection open(){ try{ Class.forName(JDBC_DRIVER); return DriverManager.getConnection(DB_URL,username,password); }catch (Exception e){ e.printStackTrace(); } return null; } public static void close(Connection connection){ if(connection!=null){ try { connection.close(); }catch (SQLException e){ e.printStackTrace(); } } } }
[ "1579697376@qq.com" ]
1579697376@qq.com
6d57029a84ad0edc8034e2aef40a990e276be4ed
8ad79f1da587b676c44279da8bf4da7d31081dac
/backend/src/main/java/org/ludus/backend/datastructures/tuple/ImmutableQuadruple.java
7469a423c6d911c0fb81f18576e3f1c8045bc3d0
[ "MIT" ]
permissive
bvdsanden/ludus
529975945c74671a5c2f302bdc8042486a594ca3
665312b861cdc4afd285321f0bf26b95ba4f3571
refs/heads/master
2021-09-09T11:10:37.165871
2018-03-15T13:04:33
2018-03-15T13:04:33
113,227,567
0
0
null
null
null
null
UTF-8
Java
false
false
3,568
java
package org.ludus.backend.datastructures.tuple; import java.util.Objects; /** * @author Bram van der Sanden */ public final class ImmutableQuadruple<L, ML, MR, R> extends Quadruple<L, ML, MR, R> { /** * Serialization version */ private static final long serialVersionUID = 1L; /** * Left object */ public final L left; /** * Middle object */ public final ML middleLeft; public final MR middleRight; /** * Right object */ public final R right; /** * <p>Obtains an immutable triple of from three objects inferring the generic types.</p> * <p> * <p>This factory allows the triple to be created using inference to * obtain the generic types.</p> * * @param <L> the left element type * @param <ML> the middle left element type * @param <MR> the middle right element type * @param <R> the right element type * @param left the left element, may be null * @param middleLeft the middle left element, may be null * @param middleRight the middle right element, may be null * @param right the right element, may be null * @return a triple formed from the three parameters, not null */ public static <L, ML, MR, R> ImmutableQuadruple<L, ML, MR, R> of(final L left, final ML middleLeft, final MR middleRight, final R right) { return new ImmutableQuadruple<>(left, middleLeft, middleRight, right); } /** * Create a new triple instance. * * @param left the left value, may be null * @param middleLeft the middle left element, may be null * @param middleRight the middle right element, may be null * @param right the right value, may be null */ public ImmutableQuadruple(final L left, final ML middleLeft, final MR middleRight, final R right) { super(); this.left = left; this.middleLeft = middleLeft; this.middleRight = middleRight; this.right = right; } //----------------------------------------------------------------------- /** * {@inheritDoc} */ @Override public L getLeft() { return left; } /** * {@inheritDoc} */ @Override public ML getMiddleLeft() { return middleLeft; } /** * {@inheritDoc} */ @Override public MR getMiddleRight() { return middleRight; } /** * {@inheritDoc} */ @Override public R getRight() { return right; } @Override public int hashCode() { int hash = 7; hash = 97 * hash + Objects.hashCode(this.left); hash = 97 * hash + Objects.hashCode(this.middleLeft); hash = 97 * hash + Objects.hashCode(this.middleRight); hash = 97 * hash + Objects.hashCode(this.right); return hash; } @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final ImmutableQuadruple<?, ?, ?, ?> other = (ImmutableQuadruple<?, ?, ?, ?>) obj; if (!Objects.equals(this.left, other.left)) { return false; } if (!Objects.equals(this.middleLeft, other.middleLeft)) { return false; } if (!Objects.equals(this.middleRight, other.middleRight)) { return false; } return Objects.equals(this.right, other.right); } }
[ "b.v.d.sanden@tue.nl" ]
b.v.d.sanden@tue.nl
c2ac7882f05586c5b50e8bec55162379735836f4
0247ed0576c63f4237940d3e695bf09121a1cc93
/src/com/igate/ems/controller/EmployeeController.java
3bf21d4e0d60a911bf7457df77b6da7878685c46
[]
no_license
siddy2181/EmployeeMaintenance
bdb6a4d1fbe486566cca989fd199bf2c529809e2
5580470dbbdb6ca64df26eb63515723339296b31
refs/heads/master
2021-05-10T14:41:47.663339
2018-01-26T02:00:18
2018-01-26T02:00:18
118,528,019
0
0
null
null
null
null
UTF-8
Java
false
false
22,367
java
package com.igate.ems.controller; import java.io.IOException; import java.util.ArrayList; import java.util.List; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import javax.validation.Valid; import org.apache.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.dao.DataAccessException; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.SessionAttributes; import com.igate.ems.dto.Department; import com.igate.ems.dto.Employee; import com.igate.ems.dto.Grade; import com.igate.ems.dto.User; import com.igate.ems.exception.InvalidEmployeeDetails; import com.igate.ems.service.IEmployeeMaintenanceService; @Controller @SessionAttributes(value = { "userName", "userType" }) public class EmployeeController { @Autowired IEmployeeMaintenanceService service; static Logger emsLogger = Logger.getLogger(EmployeeController.class); /********************************************** * Globally Declaring checklist variables ***********************************************/ ArrayList<String> designation = new ArrayList<String>(); ArrayList<String> maritalStatus = new ArrayList<String>(); ArrayList<Department> departments = new ArrayList<Department>(); ArrayList<Grade> grades = new ArrayList<Grade>(); int size; List<Employee> getAllEmployee = null; String errorMsg = ""; //@formatter:off /******************************************************************************************* *ACTION : showHome * *FROM : index.jsp * *TO : homeEMS ; AdminHome ;EmployeeHome * *DESCR : Gets Login Page * *******************************************************************************************/ //@formatter:on @RequestMapping(value = "showHome", method = RequestMethod.GET) public String showHome(Model model, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { HttpSession session = request.getSession(false); String userType = (String) session.getAttribute("userType"); if (userType != null) { if (userType.equals("Admin")) { return "AdminHome"; } if (userType.equals("Employee")) { return "EmployeeHome"; } } model.addAttribute("user", new User()); emsLogger.info("User Visited Home Page"); return "homeEMS"; } //@formatter:off /******************************************************************************************* *ACTION : aboutUs * *FROM : * *TO : AboutUs * *DESCR : displays the about us slider * *******************************************************************************************/ //@formatter:on @RequestMapping(value = "aboutUs") public String aboutUs(Model model) { emsLogger.info("User Visited AboutUs Page"); return "AboutUs"; } //@formatter:off /******************************************************************************************* *ACTION : Gallery * *FROM : * *TO : Gallery * *DESCR : displays the Employee Picture Gallery slider * *******************************************************************************************/ //@formatter:on @RequestMapping(value = "Gallery") public String Gallery(Model model) { emsLogger.info("User Visited Gallery Page"); return "Gallery"; } /* * @RequestMapping(value = "showLogin", method = RequestMethod.GET) public * String showLogin(Model model) { model.addAttribute("user", new User()); * return "homeEMS.jsp#modal-login"; } */ //@formatter:off /******************************************************************************************* *ACTION : logout * *FROM : * *TO : homeEMS * *DESCR : Logic for logging out * *******************************************************************************************/ //@formatter:on @RequestMapping(value = "logout", method = RequestMethod.GET) public String loogout(Model model) { model.addAttribute("userName", ""); model.addAttribute("userType", ""); model.addAttribute("user", new User()); emsLogger.info("User Logged Off"); return "homeEMS"; } //@formatter:off /************************************************************************************************** *ACTION : validateLogin * *FROM : * *TO : errorPage ; homeEMS ; AdminHome ; EmployeeHome. * *DESCR : Check and Validate Logging User if Admin or Employee and redirects to respective page. * **************************************************************************************************/ //@formatter:on @RequestMapping(value = "validateLogin", method = RequestMethod.POST) public String validateLogin(@ModelAttribute("user") User user, Model model) { /* * if (user.getUserName().equals("") || user.getUserName() == null) { * errorMsg = "Invalid UserName or Password"; * model.addAttribute("errorMsg", errorMsg); return "homeEMS"; } */ try { String userType = service.userLogin(user.getUserName(), user.getPassword()); if (userType != null) { departments.removeAll(departments); Department dept = new Department(); dept.setDeptId(0); dept.setDeptName("--"); departments.add(dept); try { departments.addAll(service.getDepartments()); } catch (InvalidEmployeeDetails e) { model.addAttribute("errorMsg", e.getMessage()); return "errorPage"; } designation.removeAll(designation); designation.add("MANAGER"); designation.add("PROGRAMMER"); designation.add("TRAINEE"); designation.add("TECHIE"); maritalStatus.removeAll(maritalStatus); maritalStatus.add(""); maritalStatus.add("Married"); maritalStatus.add("Unmarried"); maritalStatus.add("Widowed"); maritalStatus.add("Seperated"); maritalStatus.add("Divorced"); grades.removeAll(grades); Grade grade = new Grade(); grade.setGradeCode(""); grade.setDescription("--"); grades.add(grade); try { grades.addAll(service.getGrades()); } catch (InvalidEmployeeDetails e) { model.addAttribute("errorMsg", e.getMessage()); return "errorPage"; } if (userType.equals("Admin")) { model.addAttribute("userName", user.getUserName()); model.addAttribute("userType", userType); emsLogger.info("User entered AdminHome Page"); return "AdminHome"; } else if (userType.equals("Employee")) { model.addAttribute("userName", user.getUserName()); model.addAttribute("userType", userType); emsLogger.info("User entered EmployeeHome Page"); return "EmployeeHome"; } } else { errorMsg = "Invalid UserName or Password"; model.addAttribute("errorMsg", errorMsg); emsLogger .info("User entered Invalid Details and was redirected to HomePage"); return "homeEMS"; } } catch (InvalidEmployeeDetails e) { model.addAttribute("errorMsg", e.getMessage()); return "errorPage"; } return null; } //@formatter:off /************************************************************************************************** *ACTION : redirectAdminHome * *FROM : * *TO : AdminHome. * *DESCR : redirects to admin home page. * **************************************************************************************************/ //@formatter:on @RequestMapping(value = "redirectAdminHome", method = RequestMethod.GET) public String redirectAdminHome() { emsLogger.info("User redirected AdminHome Page"); return "AdminHome"; } //@formatter:off /************************************************************************************************** *ACTION : redirectEmployeeHome * *FROM : * *TO : EmployeeHome. * *DESCR : redirects to Employee Home page. * **************************************************************************************************/ //@formatter:on @RequestMapping(value = "redirectEmployeeHome", method = RequestMethod.GET) public String redirectEmployeeHome() { emsLogger.info("User redirected to EmployeeHome Page"); return "EmployeeHome"; } //@formatter:off /************************************************************************************************** *ACTION : showAddEmployee * *FROM : * *TO : AddEmployee. * *DESCR : Displays Add Employee page and Adds an employee * **************************************************************************************************/ //@formatter:on @RequestMapping(value = "showAddEmployee", method = RequestMethod.GET) public String showAddEmployee(Model model) { model.addAttribute("departments", departments); model.addAttribute("designation", designation); model.addAttribute("maritalStatus", maritalStatus); model.addAttribute("empAdd", new Employee()); emsLogger.info("User visited AddEmployee Page"); return "AddEmployee"; } //@formatter:off /************************************************************************************************** *ACTION : showViewAll * *FROM : * *TO : errorPage ; ShowAllEmployees. * *DESCR : Displays 5 employees per page fetching from database * **************************************************************************************************/ //@formatter:on @RequestMapping(value = "showViewAll", method = RequestMethod.GET) public String viewAllEmployee(@RequestParam("page") int pageNo, Model model) { /********************************************** * Logic For Pagination ***********************************************/ List<Employee> empSub = null; try { if (pageNo == 0) { getAllEmployee = service.viewAllEmployee(); size = getAllEmployee.size(); } int start = 5 * pageNo; if (size - start < 5) { empSub = getAllEmployee.subList(start, size); } else { empSub = getAllEmployee.subList(start, start + 5); } } catch (InvalidEmployeeDetails | DataAccessException e) { model.addAttribute("errorMsg", e.getMessage()); return "errorPage"; } model.addAttribute("size", size); model.addAttribute("curPage", pageNo); model.addAttribute("nextPage", pageNo + 1); model.addAttribute("prePage", pageNo - 1); if (size % 10 == 0) { model.addAttribute("lastPage", (size / 5) - 1); } else { model.addAttribute("lastPage", size / 5); } model.addAttribute("EmployeeList", empSub); emsLogger.info("User Viewed ShowAllEmployee Page"); return "ShowAllEmployees"; } //@formatter:off /************************************************************************************************** *ACTION : addEmployee * *FROM : * *TO : errorPage ; AddEmployee ; InsertedPage . * *DESCR : Adds an Employee and redirects to Inserted page which shows the details added * **************************************************************************************************/ //@formatter:on @RequestMapping(value = "addEmployee", method = RequestMethod.POST) public String addEmployee(@Valid @ModelAttribute("empAdd") Employee emp, BindingResult bindResult, @RequestParam("doj") String doj, @RequestParam("dob") String dob, Model model) { int insertedDetails; if (bindResult.hasErrors()) { model.addAttribute("departments", departments); model.addAttribute("designation", designation); model.addAttribute("maritalStatus", maritalStatus); return "AddEmployee"; } else { try { String empId = service.getEmpId(); emp.setEmpId(empId); Grade grade = service.calGrade(emp.getBasic()); emp.setGrade(grade.getGradeCode()); emp.setDateOfBirth(dob); emp.setDateOfJoining(doj); insertedDetails = service.insertEmployee(emp); } catch (InvalidEmployeeDetails e) { model.addAttribute("errorMsg", e.getMessage()); return "errorPage"; } model.addAttribute("inserted", emp); emsLogger .info("User added new Employee and was redirected to Inserted Page where new Employee Id and details were displayed"); return "InsertedPage"; } } //@formatter:off /************************************************************************************************** *ACTION : showSearchEmployee * *FROM : * *TO : SearchEmployee * *DESCR : Redirects to Search Employee page * **************************************************************************************************/ //@formatter:on @RequestMapping(value = "showSearchEmployee", method = RequestMethod.GET) public String showSearchEmployee(Model model) { model.addAttribute("departments", departments); model.addAttribute("maritalStatus", maritalStatus); model.addAttribute("grades", grades); model.addAttribute("empSearch", new Employee()); emsLogger.info("User visited Search Employee Page"); return "SearchEmployee"; } //@formatter:off /************************************************************************************************** *ACTION : searchEmployee * *FROM : * *TO : errorPage ; SearchEmployee. * *DESCR : Searches an Employee using several wildcard entries * **************************************************************************************************/ //@formatter:on @RequestMapping(value = "searchEmployee", method = RequestMethod.POST) public String searchEmployee(@ModelAttribute("empSearch") Employee emp, Model model) { /****************************************************** * * Logic to check if there are no entries for searching * ********************************************************/ if (emp.getEmpId().equalsIgnoreCase("") && emp.getFirstName().equalsIgnoreCase("") && emp.getLastName().equalsIgnoreCase("") && Integer.parseInt(emp.getDeptId()) == 0 && emp.getGrade().equalsIgnoreCase("") && emp.getMaritalStatus().equalsIgnoreCase("")) { model.addAttribute("departments", departments); model.addAttribute("maritalStatus", maritalStatus); model.addAttribute("grades", grades); model.addAttribute("empSearch", new Employee()); model.addAttribute("errorMsg", "Please Fill at least one field"); return "SearchEmployee"; } /****************************************************** * Search by wildcard ********************************************************/ if (emp.getEmpId() == null || emp.getEmpId().equalsIgnoreCase("")) { emp.setEmpId("%"); } else { String empId = emp.getEmpId().replace("*", "%"); empId = empId.replace("?", "_"); emp.setEmpId(empId); } /****************************************************** * Search by first Name ********************************************************/ if (emp.getFirstName() == null || emp.getFirstName().equalsIgnoreCase("")) { emp.setFirstName("%"); } else { String fName = emp.getFirstName().replace("*", "%"); fName = fName.replace("?", "_"); emp.setFirstName(fName); } /****************************************************** * Search by last Name ********************************************************/ if (emp.getLastName() == null || emp.getLastName().equalsIgnoreCase("")) { emp.setLastName("%"); } else { String lName = emp.getLastName().replace("*", "%"); lName = lName.replace("?", "_"); emp.setLastName(lName); } /****************************************************** * Search by Department ********************************************************/ if (Integer.parseInt(emp.getDeptId()) == 0) { emp.setDeptId("%"); } /****************************************************** * Search by Grade ********************************************************/ if (emp.getGrade() == null || emp.getGrade().equalsIgnoreCase("")) { emp.setGrade("%"); } /****************************************************** * Search by Marital Status ********************************************************/ if (emp.getMaritalStatus() == null || emp.getMaritalStatus().equalsIgnoreCase("")) { emp.setMaritalStatus("%"); } ArrayList<Employee> emps = null; try { emps = service.searchEmployee(emp); } catch (InvalidEmployeeDetails e) { model.addAttribute("errorMsg", e.getMessage()); return "errorPage"; } model.addAttribute("departments", departments); model.addAttribute("maritalStatus", maritalStatus); model.addAttribute("grades", grades); model.addAttribute("empSearch", new Employee()); if (emps.size() != 0) { model.addAttribute("emps", emps); return "SearchResult"; } else { model.addAttribute("departments", departments); model.addAttribute("maritalStatus", maritalStatus); model.addAttribute("grades", grades); model.addAttribute("empSearch", new Employee()); model.addAttribute("errorMsg", "No data Found"); return "SearchEmployee"; } } //@formatter:off /************************************************************************************************** *ACTION : showUpdateEmployee * *FROM : * *TO : errorPage ; UpdationRequest. * *DESCR : Redirects to UpdatION Page. * **************************************************************************************************/ //@formatter:on @RequestMapping(value = "showUpdateEmployee", method = RequestMethod.GET) public String showUpdateEmployee(Model model) { ArrayList<String> empIds = null; try { empIds = service.getEmpIds(); } catch (InvalidEmployeeDetails e) { model.addAttribute("errorMsg", e.getMessage()); return "errorPage"; } model.addAttribute("empIds", empIds); emsLogger.info("User requested for updation"); return "UpdationRequest"; } //@formatter:off /************************************************************************************************** *ACTION : UpdateRequest * *FROM : * *TO : errorPage ; EmployeeUpdation. * *DESCR : Options to select an employee to be updated . * **************************************************************************************************/ //@formatter:on @RequestMapping(value = "UpdateRequest", method = RequestMethod.POST) public String shoeUpdateForm(@RequestParam("selEmpId") String empId, Model model) { Employee emp = null; try { emp = service.searchByIdEmployee(empId); } catch (InvalidEmployeeDetails e) { model.addAttribute("errorMsg", e.getMessage()); return "errorPage"; } model.addAttribute("departments", departments); model.addAttribute("designation", designation); model.addAttribute("maritalStatus", maritalStatus); model.addAttribute("empUpdate", emp); emsLogger.info("User Updation details were displayed"); return "EmployeeUpdation"; } //@formatter:off /************************************************************************************************* *ACTION : UpdateEmployee * *FROM : * *TO : errorPage ; EmployeeUpdation ;AdminHome. * *DESCR : Updates Employee Details. * **************************************************************************************************/ //@formatter:on @RequestMapping(value = "UpdateEmployee", method = RequestMethod.POST) public String updateEmployee( @Valid @ModelAttribute("empUpdate") Employee emp, BindingResult bindResult, Model model) { if (bindResult.hasErrors()) { model.addAttribute("empUpdate", emp); model.addAttribute("departments", departments); model.addAttribute("designation", designation); model.addAttribute("maritalStatus", maritalStatus); return "EmployeeUpdation"; } else { Grade grade = null; try { grade = service.calGrade(emp.getBasic()); } catch (InvalidEmployeeDetails e) { model.addAttribute("errorMsg", e.getMessage()); return "errorPage"; } emp.setGrade(grade.getGradeCode()); int rows = 0; try { rows = service.updateEmployee(emp); } catch (InvalidEmployeeDetails e) { model.addAttribute("errorMsg", e.getMessage()); return "errorPage"; } emsLogger.info("User redirected to HomePage"); if (rows != 0) { model.addAttribute("updated", 1); model.addAttribute("empUpdate", emp); model.addAttribute("departments", departments); model.addAttribute("designation", designation); model.addAttribute("maritalStatus", maritalStatus); return "EmployeeUpdation"; } else { return "AdminHome"; } } } }
[ "shraddha18@ufl.edu" ]
shraddha18@ufl.edu
a998b72de8393ec4b8c0773ffad2a335c74a2e4c
65f39c8d277d9ef41f3f03fd6f142c4bcfb4bf02
/src/main/java/org/webseer/web/ajax/AddData.java
d7d031c85427c3e5752bf77abd253cf988a3c4ce
[]
no_license
rrlevering/webseer
5e1a2783ca84f8aa82118a64f2fbb3b7120cfdae
568e7a1ddbfc16b9edf855cd71115b88de9def11
refs/heads/master
2020-05-30T14:28:33.747493
2013-08-18T01:35:39
2013-08-18T01:35:39
34,219,163
1
0
null
null
null
null
UTF-8
Java
false
false
1,339
java
package org.webseer.web.ajax; import java.io.IOException; import java.io.Writer; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.webseer.bucket.BucketFactory; import org.webseer.bucket.FileBucket; import org.webseer.java.JavaTypeTranslator; import org.webseer.model.meta.Bucket; import org.webseer.transformation.OutputWriter; import org.webseer.web.SeerServlet; import com.google.gson.JsonObject; public class AddData extends SeerServlet { private static final long serialVersionUID = 1L; @Override protected void transactionalizedService(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { String data = getRequiredParameter(req, "newData"); String bucketPath = (String) getRequiredAttribute(req, "bucketPath"); BucketFactory factory = BucketFactory.getBucketFactory(getNeoService()); Bucket bucket = factory.getBucket(bucketPath); if (bucket == null) { bucket = new FileBucket(getNeoService(), bucketPath); } OutputWriter bucketWriter = bucket.getBucketWriter(); bucketWriter.writeData(JavaTypeTranslator.convertObject(data)); JsonObject response = new JsonObject(); Writer writer = resp.getWriter(); writer.write(response.toString()); writer.close(); } }
[ "rrlevering@gmail.com" ]
rrlevering@gmail.com
dc160f11d2310981f7c1a86752a6679c690401bb
75c2211a6fefd167f382dac301e1b46617c917e1
/expected-output/random/random8/sll/Input_withCos1.java
019b8d9d042cf3e933f0a80508244fe656e45195
[]
no_license
star-finder/jpf-costar
0f87d88f420eace4b1b1c93ad44e764346b09f19
b3f4d4893019a42b6c3f50e4294fd3ab6f2b5f88
refs/heads/master
2022-11-25T01:31:09.822003
2019-07-04T01:46:55
2019-07-04T01:46:55
105,350,745
2
1
null
2022-11-15T08:38:39
2017-09-30T07:20:18
Java
UTF-8
Java
false
false
6,821
java
package random.sll; import org.junit.Test; import gov.nasa.jpf.util.test.TestJPF; public class Input_withCos1 extends TestJPF { @Test public void test_withCos1() throws Exception { Input obj = new Input(); random.sll.Node root = new random.sll.Node(); random.sll.Node next_2 = null; int elem_1 = 6; root.elem = elem_1; root.next = next_2; obj.withCos(root); } @Test public void test_withCos2() throws Exception { Input obj = new Input(); random.sll.Node root = new random.sll.Node(); random.sll.Node next_2 = new random.sll.Node(); random.sll.Node next_4 = new random.sll.Node(); random.sll.Node next_6 = new random.sll.Node(); random.sll.Node next_8 = new random.sll.Node(); random.sll.Node next_10 = new random.sll.Node(); random.sll.Node next_12 = null; int elem_9 = -7; int elem_11 = -29; int elem_3 = 12; int elem_1 = 9; int elem_7 = 15; int elem_5 = -4; root.elem = elem_1; root.next = next_2; next_2.elem = elem_3; next_2.next = next_4; next_4.elem = elem_5; next_4.next = next_6; next_6.elem = elem_7; next_6.next = next_8; next_8.elem = elem_9; next_8.next = next_10; next_10.elem = elem_11; next_10.next = next_12; obj.withCos(root); } @Test public void test_withCos3() throws Exception { Input obj = new Input(); random.sll.Node root = new random.sll.Node(); random.sll.Node next_2 = new random.sll.Node(); random.sll.Node next_4 = new random.sll.Node(); random.sll.Node next_6 = new random.sll.Node(); random.sll.Node next_8 = new random.sll.Node(); random.sll.Node next_10 = new random.sll.Node(); random.sll.Node next_12 = new random.sll.Node(); random.sll.Node next_14 = null; int elem_13 = -20; int elem_9 = 31; int elem_11 = 25; int elem_3 = -2; int elem_1 = 12; int elem_7 = 16; int elem_5 = 28; root.elem = elem_1; root.next = next_2; next_2.elem = elem_3; next_2.next = next_4; next_4.elem = elem_5; next_4.next = next_6; next_6.elem = elem_7; next_6.next = next_8; next_8.elem = elem_9; next_8.next = next_10; next_10.elem = elem_11; next_10.next = next_12; next_12.elem = elem_13; next_12.next = next_14; obj.withCos(root); } @Test public void test_withCos4() throws Exception { Input obj = new Input(); random.sll.Node root = new random.sll.Node(); random.sll.Node next_2 = new random.sll.Node(); random.sll.Node next_4 = null; int elem_3 = 14; int elem_1 = 1; root.elem = elem_1; root.next = next_2; next_2.elem = elem_3; next_2.next = next_4; obj.withCos(root); } @Test public void test_withCos5() throws Exception { Input obj = new Input(); random.sll.Node root = new random.sll.Node(); random.sll.Node next_2 = new random.sll.Node(); random.sll.Node next_4 = new random.sll.Node(); random.sll.Node next_6 = new random.sll.Node(); random.sll.Node next_8 = null; int elem_3 = -23; int elem_1 = 24; int elem_7 = -27; int elem_5 = -24; root.elem = elem_1; root.next = next_2; next_2.elem = elem_3; next_2.next = next_4; next_4.elem = elem_5; next_4.next = next_6; next_6.elem = elem_7; next_6.next = next_8; obj.withCos(root); } @Test public void test_withCos6() throws Exception { Input obj = new Input(); random.sll.Node root = new random.sll.Node(); random.sll.Node next_2 = new random.sll.Node(); random.sll.Node next_4 = new random.sll.Node(); random.sll.Node next_6 = null; int elem_3 = -15; int elem_1 = 13; int elem_5 = 6; root.elem = elem_1; root.next = next_2; next_2.elem = elem_3; next_2.next = next_4; next_4.elem = elem_5; next_4.next = next_6; obj.withCos(root); } @Test public void test_withCos7() throws Exception { Input obj = new Input(); random.sll.Node root = new random.sll.Node(); random.sll.Node next_2 = new random.sll.Node(); random.sll.Node next_4 = new random.sll.Node(); random.sll.Node next_6 = new random.sll.Node(); random.sll.Node next_8 = new random.sll.Node(); random.sll.Node next_10 = new random.sll.Node(); random.sll.Node next_12 = new random.sll.Node(); random.sll.Node next_14 = new random.sll.Node(); random.sll.Node next_16 = null; int elem_13 = -28; int elem_9 = -22; int elem_11 = -28; int elem_15 = -24; int elem_3 = 1; int elem_1 = -12; int elem_7 = 5; int elem_5 = -12; root.elem = elem_1; root.next = next_2; next_2.elem = elem_3; next_2.next = next_4; next_4.elem = elem_5; next_4.next = next_6; next_6.elem = elem_7; next_6.next = next_8; next_8.elem = elem_9; next_8.next = next_10; next_10.elem = elem_11; next_10.next = next_12; next_12.elem = elem_13; next_12.next = next_14; next_14.elem = elem_15; next_14.next = next_16; obj.withCos(root); } @Test public void test_withCos8() throws Exception { Input obj = new Input(); random.sll.Node root = new random.sll.Node(); random.sll.Node next_2 = new random.sll.Node(); random.sll.Node next_4 = new random.sll.Node(); random.sll.Node next_6 = new random.sll.Node(); random.sll.Node next_8 = new random.sll.Node(); random.sll.Node next_10 = new random.sll.Node(); random.sll.Node next_12 = new random.sll.Node(); random.sll.Node next_14 = new random.sll.Node(); random.sll.Node next_16 = new random.sll.Node(); random.sll.Node next_18 = null; int elem_13 = -21; int elem_9 = 3; int elem_11 = 5; int elem_17 = -9; int elem_15 = -18; int elem_3 = 19; int elem_1 = 29; int elem_7 = 21; int elem_5 = -10; root.elem = elem_1; root.next = next_2; next_2.elem = elem_3; next_2.next = next_4; next_4.elem = elem_5; next_4.next = next_6; next_6.elem = elem_7; next_6.next = next_8; next_8.elem = elem_9; next_8.next = next_10; next_10.elem = elem_11; next_10.next = next_12; next_12.elem = elem_13; next_12.next = next_14; next_14.elem = elem_15; next_14.next = next_16; next_16.elem = elem_17; next_16.next = next_18; obj.withCos(root); } @Test public void test_withCos9() throws Exception { Input obj = new Input(); random.sll.Node root = null; obj.withCos(root); } @Test public void test_withCos10() throws Exception { Input obj = new Input(); random.sll.Node root = new random.sll.Node(); random.sll.Node next_2 = new random.sll.Node(); random.sll.Node next_4 = new random.sll.Node(); random.sll.Node next_6 = new random.sll.Node(); random.sll.Node next_8 = new random.sll.Node(); random.sll.Node next_10 = null; int elem_9 = 7; int elem_3 = -12; int elem_1 = 13; int elem_7 = -7; int elem_5 = 13; root.elem = elem_1; root.next = next_2; next_2.elem = elem_3; next_2.next = next_4; next_4.elem = elem_5; next_4.next = next_6; next_6.elem = elem_7; next_6.next = next_8; next_8.elem = elem_9; next_8.next = next_10; obj.withCos(root); } }
[ "longph1989@gmail.com" ]
longph1989@gmail.com
c2908a225be913762275540d8a037eca487fc296
c493bcdd26cc9ef662663ea8a76d3ea8d52fc420
/agent/src/main/java/fi/trustnet/agent/configuration/SecurityConfiguration.java
58e19c9eb9cba87bea2fdbe22e3c3b2d4fb32a49
[]
no_license
peacekeeper/authcred-demo
cf09728bcf323325fefce1b6665058718c1afdf6
f39478427d7e81d0112638d0bccf63be37b32e1f
refs/heads/master
2020-03-09T18:41:05.136143
2018-04-04T12:07:12
2018-04-04T12:07:12
128,938,134
2
0
null
2018-04-10T13:35:02
2018-04-10T13:35:01
null
UTF-8
Java
false
false
1,618
java
package fi.trustnet.agent.configuration; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Configuration; import org.springframework.http.HttpMethod; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; 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 org.springframework.security.config.http.SessionCreationPolicy; @Configuration @EnableWebSecurity public class SecurityConfiguration extends WebSecurityConfigurerAdapter{ @Override protected void configure(HttpSecurity http) throws Exception { http.csrf().disable(); http.headers().frameOptions().sameOrigin(); http.authorizeRequests() .antMatchers(HttpMethod.POST, "/credentialoffer").permitAll() .antMatchers("/h2-console/*").permitAll() .anyRequest().authenticated().and() .formLogin().permitAll().and() .logout().permitAll().and() .rememberMe() .rememberMeCookieName("agent-remember-me") .tokenValiditySeconds(24 * 60 * 60); } @Autowired public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception { auth.inMemoryAuthentication() .withUser("alice").password("password").roles("USER"); } }
[ "samuli.tuoriniemi@oulu.fi" ]
samuli.tuoriniemi@oulu.fi
957378f16130081ef676dd43f57682f40f9821f3
5e3235edf3de262f4d10b9e9e1fcc3bd13d6b8b1
/Code Snippet Repository/Jetty/Jetty3387.java
91a4ea3cac080e6cd38a724d2fc129659443236c
[]
no_license
saber13812002/DeepCRM
3336a244d4852a364800af3181e03e868cf6f9f5
be3e5e50e34a042d5ba7259ff5ff75c08ab32bb9
refs/heads/master
2023-03-16T00:08:06.473699
2018-04-18T05:29:50
2018-04-18T05:29:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,181
java
@Test public void testReadEarlyEOF() throws Exception { _in.addContent(new TContent("AB")); _in.addContent(new TContent("CD")); _in.earlyEOF(); Assert.assertThat(_in.isFinished(), Matchers.equalTo(false)); Assert.assertThat(_in.available(), Matchers.equalTo(2)); Assert.assertThat(_in.isFinished(), Matchers.equalTo(false)); Assert.assertThat(_in.read(), Matchers.equalTo((int)'A')); Assert.assertThat(_in.read(), Matchers.equalTo((int)'B')); Assert.assertThat(_in.read(), Matchers.equalTo((int)'C')); Assert.assertThat(_in.isFinished(), Matchers.equalTo(false)); Assert.assertThat(_in.read(), Matchers.equalTo((int)'D')); try { _in.read(); Assert.fail(); } catch (EOFException eof) { Assert.assertThat(_in.isFinished(), Matchers.equalTo(true)); } Assert.assertThat(_history.poll(), Matchers.equalTo("Content succeeded AB")); Assert.assertThat(_history.poll(), Matchers.equalTo("Content succeeded CD")); Assert.assertThat(_history.poll(), Matchers.nullValue()); }
[ "Qing.Mi@my.cityu.edu.hk" ]
Qing.Mi@my.cityu.edu.hk
3630318a4095adcd8e34c3c42b3a410b1bbc256a
eb85a388e0125c6edbd20ee09616305d3eeb11c5
/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/auxilary/dsls/autoauto/model/values/VariableReference.java
2692cd8b49b3d4e68da0cd170ea1078207f428bb
[ "BSD-3-Clause" ]
permissive
TechSupportAgent/Robotics_2021_2022
1350fb89eebd8de7f80cc1961939a4f0aa30fabe
fa2caaeb03045b23443c07457fa02e1f2bf0b230
refs/heads/master
2023-08-28T21:27:45.858820
2021-10-12T23:07:36
2021-10-12T23:07:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,049
java
package org.firstinspires.ftc.teamcode.auxilary.dsls.autoauto.model.values; import org.firstinspires.ftc.teamcode.auxilary.dsls.autoauto.model.AutoautoProgram; import org.firstinspires.ftc.teamcode.auxilary.dsls.autoauto.model.Location; import org.firstinspires.ftc.teamcode.auxilary.dsls.autoauto.runtime.AutoautoRuntimeVariableScope; import org.firstinspires.ftc.teamcode.auxilary.dsls.autoauto.runtime.errors.AutoautoNameException; import org.jetbrains.annotations.NotNull; public class VariableReference extends AutoautoValue { String name; public AutoautoPrimitive resolvedValue; private Location location; private AutoautoRuntimeVariableScope scope; public static VariableReference H (String n) { return new VariableReference(n); } public VariableReference(String n) { this.name = n; } public String getName() { return name; } public void loop() { this.resolvedValue = scope.get(this.name); if(this.resolvedValue == null) throw new AutoautoNameException("Unknown variable name " + this.name + AutoautoProgram.formatStack(location)); } @NotNull public AutoautoPrimitive getResolvedValue() { return resolvedValue; } @Override public String getString() { return resolvedValue.getString(); } @Override public VariableReference clone() { VariableReference c = new VariableReference(name); c.setLocation(location); return c; } public String toString() { return "var<" + this.name + ">"; } @Override public AutoautoRuntimeVariableScope getScope() { return scope; } @Override public void setScope(AutoautoRuntimeVariableScope scope) { this.scope = scope; } @Override public Location getLocation() { return location; } @Override public void setLocation(Location location) { this.location = location; } }
[ "coleh@coleh.net" ]
coleh@coleh.net
9e7a94f4c5468c5cbdc2a1a05617c1a47fd6b77b
76fbf9e1ad9b9ac4cd01914e2d2dfd2d76e0d580
/app/src/main/java/com/houseco/hana/rentcostumes/ExpandMain.java
2220671a72411b05eff03463f37fa925cf11f3f2
[]
no_license
maulindahn/HouseCo2-master
d1314af3fa0850bbb814089f46ba275fc80f4700
f4e9902898c05f41f5c0c7c4451c06e492eeb7da
refs/heads/master
2021-01-13T03:50:13.810157
2017-05-10T10:35:44
2017-05-10T10:35:44
78,615,502
0
0
null
null
null
null
UTF-8
Java
false
false
2,799
java
package com.houseco.hana.rentcostumes; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.ExpandableListAdapter; import android.widget.ExpandableListView; import android.widget.Toast; import java.util.ArrayList; import java.util.HashMap; import java.util.List; /** * Created by Annisa on 12/17/2016. */ //ANNISA NURSYA'S public class ExpandMain extends AppCompatActivity { ExpandableListView expandableListView; ExpandableListAdapter expandableListAdapter; List<String> expandableListTitle; HashMap<String, List<String>> expandableListDetail; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.expand_activitymain); expandableListView = (ExpandableListView) findViewById(R.id.expandableListView); expandableListDetail = ExpandableListDataPump.getData(); expandableListTitle = new ArrayList<String>(expandableListDetail.keySet()); expandableListAdapter = new CustomExpandableListAdapter(this, expandableListTitle, expandableListDetail); expandableListView.setAdapter(expandableListAdapter); expandableListView.setOnGroupExpandListener(new ExpandableListView.OnGroupExpandListener() { @Override public void onGroupExpand(int groupPosition) { Toast.makeText(getApplicationContext(), expandableListTitle.get(groupPosition) + " List Expanded.", Toast.LENGTH_SHORT).show(); } }); expandableListView.setOnGroupCollapseListener(new ExpandableListView.OnGroupCollapseListener() { @Override public void onGroupCollapse(int groupPosition) { Toast.makeText(getApplicationContext(), expandableListTitle.get(groupPosition) + " List Collapsed.", Toast.LENGTH_SHORT).show(); } }); expandableListView.setOnChildClickListener(new ExpandableListView.OnChildClickListener() { @Override public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) { Toast.makeText( getApplicationContext(), expandableListTitle.get(groupPosition) + " -> " + expandableListDetail.get( expandableListTitle.get(groupPosition)).get( childPosition), Toast.LENGTH_SHORT ).show(); return false; } }); } }
[ "hanamaulinda@gmail.com" ]
hanamaulinda@gmail.com
ad0ddfe22ca4171f4dae2096335cc299eec9ab74
a2b90ccccbeeee2b67f9061a6e8941ba63a0e75a
/src/main/java/adrspo/design/patterns/behavioral/chainofresponsibility/DepartmentChain.java
30622f1d5d5611b77ec10dc265fe469a6322155a
[]
no_license
adrspo95/GoF-OOP-Design-Patterns
653f2704b5ed4b97e944612feb8ff8538a8dedab
23fa9112c09847f5a59905280f2a4e8fe2bac781
refs/heads/master
2020-12-02T17:56:45.779490
2017-07-06T22:06:31
2017-07-06T22:06:31
96,452,157
0
0
null
null
null
null
UTF-8
Java
false
false
297
java
package adrspo.design.patterns.behavioral.chainofresponsibility; public abstract class DepartmentChain { protected DepartmentChain nextDepartment; public void setNext(DepartmentChain dept) { nextDepartment = dept; } public abstract boolean redirect(ClientCall call); }
[ "adrspo95@o2.pl" ]
adrspo95@o2.pl
6519283f4f494cfa2773be2302960733521c0468
4c3d2c35e525dc25513d127d0c9bf58d3a6b6101
/michailapostolou/src/com/mike/SAF/com/mike/SAF/Behavior.java
1419f6858eea6e1f2fe81d3f175479b7e055936b
[]
no_license
tvdstorm/sea-of-saf
13e01b744b3f883c8020d33d78edb2e827447ba2
6e6bb3ae8c7014b0b8c2cc5fea5391126ed9b2f1
refs/heads/master
2021-01-10T19:16:15.261630
2014-05-06T11:30:14
2014-05-06T11:30:14
33,249,341
0
0
null
null
null
null
UTF-8
Java
false
false
1,619
java
package com.mike.SAF; import java.util.ArrayList; import java.util.Vector; import org.antlr.runtime.tree.Tree; public class Behavior { private ArrayList<String> conditions = new ArrayList<String>(); private ArrayList<String> moves = new ArrayList<String>(); private ArrayList<String> fight_moves = new ArrayList<String>(); public Behavior(ArrayList<String> conditions, ArrayList<String> moves, ArrayList<String> fight_moves){ this.conditions = conditions; this.moves = moves; this.fight_moves = fight_moves; } public Behavior(){ } public Behavior(ArrayList<String> conditions){ this.conditions = conditions; } public void setConditions(ArrayList<String> conditions) { this.conditions = conditions; } public void setMoves(ArrayList<String> moves) { this.moves = moves; } public void setFight_moves(ArrayList<String> fightMoves) { fight_moves = fightMoves; } public void addCondition(String condtion){ this.conditions.add(condtion); } public void addMove(String move){ this.moves.add(move); } public void addFight_move( String fight_move){ this.fight_moves.add(fight_move); } public void addCondition(ArrayList<String> condtion){ this.conditions.addAll(condtion); } public void addMove(ArrayList<String> move){ this.moves.addAll(move); } public void addFight_move(ArrayList<String> fight_move){ this.fight_moves.addAll(fight_move); } public ArrayList<String> getConditions() { return conditions; } public ArrayList<String> getMoves() { return moves; } public ArrayList<String> getFight_moves() { return fight_moves; } }
[ "serban.gavrus@gmail.com@e25deb68-5119-325c-d63b-03bbf1c8524c" ]
serban.gavrus@gmail.com@e25deb68-5119-325c-d63b-03bbf1c8524c
7159acb8dda4e59f9f9fb4160841297040a9864b
8091dc59cc76869befe9b0a8f350fbc56c2836e5
/sql12/app/src/main/java/net/sourceforge/squirrel_sql/client/gui/db/aliasproperties/ConnectionPropertiesController.java
52422ca444804a780df0c573145477077876b829
[]
no_license
igorhvr/squirrel-sql
4560c39c9221f04a49487b5f3d66b1559a32c21a
3457d91b397392e1a9649ffb00cbfd093e453654
refs/heads/master
2020-04-05T08:32:51.484469
2011-08-10T18:59:26
2011-08-10T18:59:26
2,188,276
2
5
null
null
null
null
UTF-8
Java
false
false
2,475
java
package net.sourceforge.squirrel_sql.client.gui.db.aliasproperties; /* * Copyright (C) 2009 Rob Manning * manningr@users.sourceforge.net * * Based on initial work from Colin Bell * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ import java.awt.Component; import net.sourceforge.squirrel_sql.client.IApplication; import net.sourceforge.squirrel_sql.client.gui.db.ISQLAliasExt; import net.sourceforge.squirrel_sql.fw.util.StringManager; import net.sourceforge.squirrel_sql.fw.util.StringManagerFactory; /** * This dialog allows the user to review and maintain connection properties for an alias. */ public class ConnectionPropertiesController implements IAliasPropertiesPanelController { /** * Internationalized strings for this class. */ private static final StringManager s_stringMgr = StringManagerFactory.getStringManager(ConnectionPropertiesController.class); private ConnectionPropertiesPanel _propsPnl; private ISQLAliasExt _alias; public static interface i18n { // i18n[ConnectionPropertiesController.title=Connection] String TITLE = s_stringMgr.getString("ConnectionPropertiesController.title"); // i18n[ConnectionPropertiesController.hint=Set session connection properties for this Alias] String HINT = s_stringMgr.getString("ConnectionPropertiesController.hint"); } public ConnectionPropertiesController(ISQLAliasExt alias, IApplication app) { _alias = alias; _propsPnl = new ConnectionPropertiesPanel(alias.getConnectionProperties()); } public Component getPanelComponent() { return _propsPnl; } public void applyChanges() { _alias.setConnectionProperties(_propsPnl.getSQLAliasConnectionProperties()); } public String getTitle() { return i18n.TITLE; } public String getHint() { return i18n.HINT; } }
[ "manningr@0ceafaf9-a5ae-48a7-aaeb-8ec3e0f2870c" ]
manningr@0ceafaf9-a5ae-48a7-aaeb-8ec3e0f2870c
f543944c2e8706383ef6c9a31ed616c3956db0fc
87fa765d6d1a4a70013894b765c135af658eee11
/src/controller/DoRegister.java
bc729bba71868c97e9f5f19f999d1950a44dc8fb
[]
no_license
leehojun078/helloMVC_homework
4876427af4a5fd2df0bfa2fc54a2a6b989508a19
5b48fac68b783bbfab34d51dbfece72858ab7fc9
refs/heads/master
2021-01-11T06:04:02.183727
2016-10-03T12:57:36
2016-10-03T12:57:36
69,869,547
0
0
null
null
null
null
UTF-8
Java
false
false
1,545
java
package controller; import java.io.IOException; import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import model.Customer; import service.CustomerService; /** * Servlet implementation class DoRegister */ @WebServlet("/doRegister") public class DoRegister extends HttpServlet { private static final long serialVersionUID = 1L; /** * @see HttpServlet#HttpServlet() */ public DoRegister() { super(); } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse * response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String id = request.getParameter("id"); String password = request.getParameter("password"); String name = request.getParameter("name"); String gender = request.getParameter("gender"); String email = request.getParameter("email"); String page = null; CustomerService service = (CustomerService) CustomerService .getInstance(); Customer customer = new Customer(id, password, name, gender, email); service.addCustomer(customer); if (id != null && password != null) page = "/view/ registersuccess.jsp"; RequestDispatcher dispatcher = request.getRequestDispatcher(page); dispatcher.forward(request, response); } }
[ "이호준@DESKTOP-FCT7T0B" ]
이호준@DESKTOP-FCT7T0B
844fda375a0ee0fe123ec3fcf695cf84134dfdf4
77fcfe5fbf379f87a3c4f6076c69d02cd53651fe
/libzxing/src/main/java/com/zero/libzxing/core/DecodeActivity.java
d8a42a8a9f77f9b35bd2da99ed6f2ff1df9f627e
[]
no_license
chfdeng/SimpleZxing
c9249607f13a2380bd7856de97dbfb390886e69f
1075df6d319f2dd1065f6efce78f6f5822c4005b
refs/heads/master
2021-09-14T07:41:07.734808
2018-05-10T02:39:31
2018-05-10T02:39:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
18,271
java
package com.zero.libzxing.core; import android.app.Activity; import android.app.AlertDialog; import android.app.ProgressDialog; import android.content.Intent; import android.database.Cursor; import android.graphics.Bitmap; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.provider.MediaStore; import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.view.KeyEvent; import android.view.SurfaceHolder; import android.view.SurfaceView; import android.view.View; import android.view.Window; import android.view.WindowManager; import android.widget.Toast; import com.google.zxing.BarcodeFormat; import com.google.zxing.DecodeHintType; import com.google.zxing.Result; import com.google.zxing.client.result.ResultParser; import com.zero.libzxing.R; import com.zero.libzxing.core.camera.CameraManager; import com.zero.libzxing.core.common.BitmapUtils; import com.zero.libzxing.core.decode.BitmapDecoder; import com.zero.libzxing.core.decode.CaptureActivityHandler; import com.zero.libzxing.core.view.ScannerView; import java.io.IOException; import java.lang.ref.WeakReference; import java.util.Collection; import java.util.Map; /** * 条形码和二维码扫描器(使用方法:启动本界面即可) * <p> * This activity opens the camera and does the actual scanning on a background * thread. It draws a viewfinder to help the user place the barcode correctly, * shows feedback as the image processing is happening, and then overlays the * results when a scan is successful. * <p> * 此Activity所做的事: 1.开启camera,在后台独立线程中完成扫描任务; * 2.绘制了一个扫描区(viewfinder)来帮助用户将条码置于其中以准确扫描; 3.扫描成功后会将扫描结果展示在界面上。 */ public final class DecodeActivity extends AppCompatActivity implements SurfaceHolder.Callback, View.OnClickListener { private static final String TAG = DecodeActivity.class.getSimpleName(); private static final int REQUEST_CODE = 100; public static final int REQUEST_CODE_DECODE = 1000; public static final String DECODE_RESULT = "DECODE_RESULT"; private static final int PARSE_BARCODE_FAIL = 300; private static final int PARSE_BARCODE_SUC = 200; /** * 是否有预览 */ private boolean hasSurface; /** * 活动监控器。如果手机没有连接电源线,那么当相机开启后如果一直处于不被使用状态则该服务会将当前activity关闭。 * 活动监控器全程监控扫描活跃状态,与CaptureActivity生命周期相同.每一次扫描过后都会重置该监控,即重新倒计时。 */ private InactivityTimer inactivityTimer; /** * 声音震动管理器。如果扫描成功后可以播放一段音频,也可以震动提醒,可以通过配置来决定扫描成功后的行为。 */ private BeepManager beepManager; /** * 闪光灯调节器。自动检测环境光线强弱并决定是否开启闪光灯 */ private AmbientLightManager ambientLightManager; private CameraManager cameraManager; /** * 扫描区域 */ private ScannerView scannerView; private CaptureActivityHandler handler; private Result lastResult; private boolean isFlashlightOpen; /** * 【辅助解码的参数(用作MultiFormatReader的参数)】 编码类型,该参数告诉扫描器采用何种编码方式解码,即EAN-13,QR * Code等等 对应于DecodeHintType.POSSIBLE_FORMATS类型 * 参考DecodeThread构造函数中如下代码:hints.put(DecodeHintType.POSSIBLE_FORMATS, * decodeFormats); */ private Collection<BarcodeFormat> decodeFormats; /** * 【辅助解码的参数(用作MultiFormatReader的参数)】 该参数最终会传入MultiFormatReader, * 上面的decodeFormats和characterSet最终会先加入到decodeHints中 最终被设置到MultiFormatReader中 * 参考DecodeHandler构造器中如下代码:multiFormatReader.setHints(hints); */ private Map<DecodeHintType, ?> decodeHints; /** * 【辅助解码的参数(用作MultiFormatReader的参数)】 字符集,告诉扫描器该以何种字符集进行解码 * 对应于DecodeHintType.CHARACTER_SET类型 * 参考DecodeThread构造器如下代码:hints.put(DecodeHintType.CHARACTER_SET, * characterSet); */ private String characterSet; private Result savedResultToShow; private IntentSource source; /** * 图片的路径 */ private String photoPath; private Handler mHandler = new MyHandler(this); static class MyHandler extends Handler { private WeakReference<Activity> activityReference; public MyHandler(Activity activity) { activityReference = new WeakReference<Activity>(activity); } @Override public void handleMessage(Message msg) { switch (msg.what) { case PARSE_BARCODE_SUC: // 解析图片成功 Intent intent = new Intent(); intent.putExtra(DECODE_RESULT, msg.obj.toString()); activityReference.get().setResult(RESULT_OK, intent); activityReference.get().finish(); break; case PARSE_BARCODE_FAIL:// 解析图片失败 Toast.makeText(activityReference.get(), "图片解析失败", Toast.LENGTH_SHORT).show(); break; default: break; } super.handleMessage(msg); } } public static void actionStart(Activity activity) { Intent intent = new Intent(activity, DecodeActivity.class); activity.startActivityForResult(intent, REQUEST_CODE_DECODE); } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Window window = getWindow(); window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); setContentView(R.layout.activity_decode); hasSurface = false; inactivityTimer = new InactivityTimer(this); beepManager = new BeepManager(this); ambientLightManager = new AmbientLightManager(this); // 监听图片识别按钮 findViewById(R.id.capture_scan_photo).setOnClickListener(this); //监听闪光灯按钮 findViewById(R.id.capture_flashlight).setOnClickListener(this); //监听取消按钮 findViewById(R.id.capture_button_cancel).setOnClickListener(this); } @Override protected void onResume() { super.onResume(); // CameraManager must be initialized here, not in onCreate(). This is // necessary because we don't // want to open the camera driver and measure the screen size if we're // going to show the help on // first launch. That led to bugs where the scanning rectangle was the // wrong size and partially // off screen. // 相机初始化的动作需要开启相机并测量屏幕大小,这些操作 // 不建议放到onCreate中,因为如果在onCreate中加上首次启动展示帮助信息的代码的 话, // 会导致扫描窗口的尺寸计算有误的bug cameraManager = new CameraManager(getApplication()); scannerView = (ScannerView) findViewById(R.id.capture_viewfinder_view); scannerView.setCameraManager(cameraManager); handler = null; lastResult = null; // 摄像头预览功能必须借助SurfaceView,因此也需要在一开始对其进行初始化 // 如果需要了解SurfaceView的原理 // 参考:http://blog.csdn.net/luoshengyang/article/details/8661317 SurfaceView surfaceView = (SurfaceView) findViewById(R.id.capture_preview_view); // 预览 SurfaceHolder surfaceHolder = surfaceView.getHolder(); if (hasSurface) { // The activity was paused but not stopped, so the surface still // exists. Therefore // surfaceCreated() won't be called, so init the camera here. initCamera(surfaceHolder); } else { // 防止sdk8的设备初始化预览异常 surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); // Install the callback and wait for surfaceCreated() to init the // camera. surfaceHolder.addCallback(this); } // 加载声音配置,其实在BeemManager的构造器中也会调用该方法,即在onCreate的时候会调用一次 beepManager.updatePrefs(); // 启动闪光灯调节器 ambientLightManager.start(cameraManager); // 恢复活动监控器 inactivityTimer.onResume(); source = IntentSource.NONE; decodeFormats = null; characterSet = null; } @Override protected void onPause() { if (handler != null) { handler.quitSynchronously(); handler = null; } inactivityTimer.onPause(); ambientLightManager.stop(); beepManager.close(); // 关闭摄像头 cameraManager.closeDriver(); if (!hasSurface) { SurfaceView surfaceView = (SurfaceView) findViewById(R.id.capture_preview_view); SurfaceHolder surfaceHolder = surfaceView.getHolder(); surfaceHolder.removeCallback(this); } super.onPause(); } @Override protected void onDestroy() { inactivityTimer.shutdown(); super.onDestroy(); } @Override public boolean onKeyDown(int keyCode, KeyEvent event) { switch (keyCode) { case KeyEvent.KEYCODE_BACK: if ((source == IntentSource.NONE) && lastResult != null) { // 重新进行扫描 restartPreviewAfterDelay(0L); return true; } break; case KeyEvent.KEYCODE_FOCUS: case KeyEvent.KEYCODE_CAMERA: // Handle these events so they don't launch the Camera app return true; case KeyEvent.KEYCODE_VOLUME_UP: cameraManager.zoomIn(); return true; case KeyEvent.KEYCODE_VOLUME_DOWN: cameraManager.zoomOut(); return true; } return super.onKeyDown(keyCode, event); } @Override public void onActivityResult(int requestCode, int resultCode, Intent intent) { if (resultCode == RESULT_OK) { final ProgressDialog progressDialog; switch (requestCode) { case REQUEST_CODE: // 获取选中图片的路径 Cursor cursor = getContentResolver().query( intent.getData(), null, null, null, null); if (cursor.moveToFirst()) { photoPath = cursor.getString(cursor .getColumnIndex(MediaStore.Images.Media.DATA)); } cursor.close(); progressDialog = new ProgressDialog(this); progressDialog.setMessage("正在扫描..."); progressDialog.setCancelable(false); progressDialog.show(); new Thread(new Runnable() { @Override public void run() { Bitmap img = BitmapUtils .getCompressedBitmap(photoPath); BitmapDecoder decoder = new BitmapDecoder( DecodeActivity.this); Result result = decoder.getRawResult(img); if (result != null) { Message m = mHandler.obtainMessage(); m.what = PARSE_BARCODE_SUC; m.obj = ResultParser.parseResult(result) .toString(); mHandler.sendMessage(m); } else { Message m = mHandler.obtainMessage(); m.what = PARSE_BARCODE_FAIL; mHandler.sendMessage(m); } progressDialog.dismiss(); } }).start(); break; } } } @Override public void surfaceCreated(SurfaceHolder holder) { if (holder == null) { Log.e(TAG, "*** WARNING *** surfaceCreated() gave us a null surface!"); } if (!hasSurface) { hasSurface = true; initCamera(holder); } } @Override public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) { /*hasSurface = false;*/ } @Override public void surfaceDestroyed(SurfaceHolder holder) { hasSurface = false; } /** * A valid barcode has been found, so give an indication of success and show * the results. * * @param rawResult The contents of the barcode. * @param scaleFactor amount by which thumbnail was scaled * @param barcode A greyscale bitmap of the camera data which was decoded. */ public void handleDecode(Result rawResult, Bitmap barcode, float scaleFactor) { // 重新计时 inactivityTimer.onActivity(); lastResult = rawResult; // 把图片画到扫描框 scannerView.drawResultBitmap(barcode); beepManager.playBeepSoundAndVibrate(); Toast.makeText(this, "识别结果:" + ResultParser.parseResult(rawResult).toString(), Toast.LENGTH_SHORT).show(); } public void restartPreviewAfterDelay(long delayMS) { if (handler != null) { handler.sendEmptyMessageDelayed(R.id.restart_preview, delayMS); } resetStatusView(); } public ScannerView getScannerView() { return scannerView; } public Handler getHandler() { return handler; } public CameraManager getCameraManager() { return cameraManager; } private void resetStatusView() { scannerView.setVisibility(View.VISIBLE); lastResult = null; } public void drawViewfinder() { scannerView.drawViewfinder(); } private void initCamera(SurfaceHolder surfaceHolder) { if (surfaceHolder == null) { throw new IllegalStateException("No SurfaceHolder provided"); } if (cameraManager.isOpen()) { Log.w(TAG, "initCamera() while already open -- late SurfaceView callback?"); return; } try { cameraManager.openDriver(surfaceHolder); // Creating the handler starts the preview, which can also throw a // RuntimeException. if (handler == null) { handler = new CaptureActivityHandler(this, decodeFormats, decodeHints, characterSet, cameraManager); } decodeOrStoreSavedBitmap(null, null); } catch (IOException ioe) { Log.w(TAG, ioe); displayFrameworkBugMessageAndExit(); } catch (RuntimeException e) { // Barcode Scanner has seen crashes in the wild of this variety: // java.?lang.?RuntimeException: Fail to connect to camera service Log.w(TAG, "Unexpected error initializing camera", e); displayFrameworkBugMessageAndExit(); } } /** * 向CaptureActivityHandler中发送消息,并展示扫描到的图像 * * @param bitmap * @param result */ private void decodeOrStoreSavedBitmap(Bitmap bitmap, Result result) { // Bitmap isn't used yet -- will be used soon if (handler == null) { savedResultToShow = result; } else { if (result != null) { savedResultToShow = result; } if (savedResultToShow != null) { Message message = Message.obtain(handler, R.id.decode_succeeded, savedResultToShow); handler.sendMessage(message); } savedResultToShow = null; } } private void displayFrameworkBugMessageAndExit() { AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(getString(R.string.app_name)); builder.setMessage("抱歉,Android相机出现问题。您可能需要重启设备。"); builder.setPositiveButton("确定", new FinishListener(this)); builder.setOnCancelListener(new FinishListener(this)); builder.show(); } @Override public void onClick(View v) { int i = v.getId(); if (i == R.id.capture_scan_photo) {// 打开手机中的相册 Intent innerIntent = new Intent(Intent.ACTION_GET_CONTENT); // "android.intent.action.GET_CONTENT" innerIntent.setType("image/*"); Intent wrapperIntent = Intent.createChooser(innerIntent, "选择二维码图片"); this.startActivityForResult(wrapperIntent, REQUEST_CODE); } else if (i == R.id.capture_flashlight) { if (isFlashlightOpen) { cameraManager.setTorch(false); // 关闭闪光灯 isFlashlightOpen = false; } else { cameraManager.setTorch(true); // 打开闪光灯 isFlashlightOpen = true; } } else if (i == R.id.capture_button_cancel) { if ((source == IntentSource.NONE) && lastResult != null) { // 重新进行扫描 restartPreviewAfterDelay(0L); } } else { } } }
[ "chfdeng@gmail.com" ]
chfdeng@gmail.com
a7d7b5ea58a9dab7fbb7b9006bb2ec3597463b06
e9793a33313de08003f89d56c8b1c0d09f280489
/src/com/lesson_10/gumballstate/state/SoldOutState.java
1ea1ce9dee6a96fb370b26121e08f66496514658
[]
no_license
vkulkov/DesignPatterns
095f167a2cb92f7ef77c862aa17187e02fd8897c
a9cf9a50a4e3a985d5886c46b6d6886bc7fdfa9e
refs/heads/master
2021-08-14T21:57:43.964503
2017-11-16T21:46:29
2017-11-16T21:46:29
110,125,074
0
0
null
null
null
null
UTF-8
Java
false
false
879
java
package com.lesson_10.gumballstate.state; import com.lesson_10.gumballstate.GumballMachine; import com.lesson_10.gumballstate.State; public class SoldOutState implements State { private GumballMachine gumballMachine; public SoldOutState(GumballMachine gumballMachine) { this.gumballMachine = gumballMachine; } @Override public void insertQuarter() { System.out.println("You can't insert a quarter, the machine is sold out"); } @Override public void ejectQuarter() { System.out.println("You haven't inserted a quarter"); } @Override public void pullLever() { System.out.println("You turned, but there are no gumballs"); } @Override public void giveGumball() { System.out.println("No gumball dispensed"); } public String toString() { return "sold out"; } }
[ "kulkowalery@yandex.ru" ]
kulkowalery@yandex.ru
69d10563b0926a70f761e5b64ae381560aa48fef
3f8cfac6fcdf0bbc0982fbd91b2a8bf579b46055
/lab1/src/test/java/ru/spbstu/telematics/java/AppTest.java
a4a6d015524e628eaf661353864328d8b16aaddd
[]
no_license
MCdanja/ParProg18Labs
85716989f46015d1167f66b7e791b6b562acb1a8
757d29adf5b8dc54d37e4c3161425e52aefb3f70
refs/heads/master
2020-04-11T04:41:52.606116
2019-01-16T19:04:15
2019-01-16T19:04:15
161,522,308
0
0
null
null
null
null
UTF-8
Java
false
false
1,297
java
package ru.spbstu.telematics.java; //import junit.framework.TestCase; // //import java.io.IOException; // ///** // * Unit test for simple App. // */ //public class AppTest // extends TestCase //{ // public void testReadertext() throws IOException // { // assertEquals(App.ReadFromFile("text.txt"), "Hello World!\nMy name is Daniel.\n"); // } // public void testReaderprog() throws IOException // { // assertEquals(App.ReadFromFile("prog.txt"), "package ru.spbstu.telematics.java;\n" + // "\n" + // "import java.io.*;\n" + // "\n" + // "public class App \n" + // "{\n" + // " public static void main( String[] args ) throws NumberFormatException, IOException\n" + // " {\n" + // " FileReader reader = new FileReader(\"text.txt\");\n" + // " // читаем посимвольно\n" + // " int c;\n" + // " while((c=reader.read())!=-1)\n" + // " {\n" + // " System.out.print((char)c);\n" + // " }\n" + // " }\n" + // "}\n"); // } //} //
[ "danakkurat@mail.ru" ]
danakkurat@mail.ru
bc5503c1dfd2bc6fa91177fbd0aa6841e87efc39
5efbe1ce4035df0d4a7aa478ac37fa75aa68025c
/reference no run/com.martinstudio.hiddenrecorder/src/android/support/v4/widget/AutoScrollHelper.java
0494b3bfd41f1525dd7f224de9c1720582f0a7bc
[]
no_license
dat0106/datkts0106
6ec70e6adb90ba36237d4225b5cba80fcbd30343
885c9bec5b5cd3c4d677d8d579cd91cf7fd6d2e5
refs/heads/master
2016-08-05T08:24:11.701355
2014-08-01T04:35:12
2014-08-01T04:35:59
15,329,353
1
1
null
null
null
null
UTF-8
Java
false
false
15,503
java
package android.support.v4.widget; import android.content.res.Resources; import android.os.SystemClock; import android.support.v4.view.MotionEventCompat; import android.support.v4.view.ViewCompat; import android.util.DisplayMetrics; import android.view.MotionEvent; import android.view.View; import android.view.View.OnTouchListener; import android.view.ViewConfiguration; import android.view.animation.AccelerateInterpolator; import android.view.animation.AnimationUtils; import android.view.animation.Interpolator; public abstract class AutoScrollHelper implements View.OnTouchListener { private static final int DEFAULT_ACTIVATION_DELAY = ; private static final int DEFAULT_EDGE_TYPE = 1; private static final float DEFAULT_MAXIMUM_EDGE = 3.4028235E+38F; private static final int DEFAULT_MAXIMUM_VELOCITY_DIPS = 1575; private static final int DEFAULT_MINIMUM_VELOCITY_DIPS = 315; private static final int DEFAULT_RAMP_DOWN_DURATION = 500; private static final int DEFAULT_RAMP_UP_DURATION = 500; private static final float DEFAULT_RELATIVE_EDGE = 0.2F; private static final float DEFAULT_RELATIVE_VELOCITY = 1.0F; public static final int EDGE_TYPE_INSIDE = 0; public static final int EDGE_TYPE_INSIDE_EXTEND = 1; public static final int EDGE_TYPE_OUTSIDE = 2; private static final int HORIZONTAL = 0; public static final float NO_MAX = 3.4028235E+38F; public static final float NO_MIN = 0.0F; public static final float RELATIVE_UNSPECIFIED = 0.0F; private static final int VERTICAL = 1; private int mActivationDelay; private boolean mAlreadyDelayed; private boolean mAnimating; private final Interpolator mEdgeInterpolator = new AccelerateInterpolator(); private int mEdgeType; private boolean mEnabled; private boolean mExclusive; private float[] mMaximumEdges; private float[] mMaximumVelocity; private float[] mMinimumVelocity; private boolean mNeedsCancel; private boolean mNeedsReset; private float[] mRelativeEdges; private float[] mRelativeVelocity; private Runnable mRunnable; private final ClampedScroller mScroller = new ClampedScroller(); private final View mTarget; public AutoScrollHelper(View paramView) { float[] arrayOfFloat = new float[2]; arrayOfFloat[0] = 0.0F; arrayOfFloat[1] = 0.0F; this.mRelativeEdges = arrayOfFloat; arrayOfFloat = new float[2]; arrayOfFloat[0] = 3.4028235E+38F; arrayOfFloat[1] = 3.4028235E+38F; this.mMaximumEdges = arrayOfFloat; arrayOfFloat = new float[2]; arrayOfFloat[0] = 0.0F; arrayOfFloat[1] = 0.0F; this.mRelativeVelocity = arrayOfFloat; arrayOfFloat = new float[2]; arrayOfFloat[0] = 0.0F; arrayOfFloat[1] = 0.0F; this.mMinimumVelocity = arrayOfFloat; arrayOfFloat = new float[2]; arrayOfFloat[0] = 3.4028235E+38F; arrayOfFloat[1] = 3.4028235E+38F; this.mMaximumVelocity = arrayOfFloat; this.mTarget = paramView; DisplayMetrics localDisplayMetrics = Resources.getSystem().getDisplayMetrics(); int i = (int)(0.5F + 1575.0F * localDisplayMetrics.density); int j = (int)(0.5F + 315.0F * localDisplayMetrics.density); setMaximumVelocity(i, i); setMinimumVelocity(j, j); setEdgeType(1); setMaximumEdges(3.4028235E+38F, 3.4028235E+38F); setRelativeEdges(0.2F, 0.2F); setRelativeVelocity(1.0F, 1.0F); setActivationDelay(DEFAULT_ACTIVATION_DELAY); setRampUpDuration(500); setRampDownDuration(500); } private void cancelTargetTouch() { long l = SystemClock.uptimeMillis(); MotionEvent localMotionEvent = MotionEvent.obtain(l, l, 3, 0.0F, 0.0F, 0); this.mTarget.onTouchEvent(localMotionEvent); localMotionEvent.recycle(); } private float computeTargetVelocity(int paramInt, float paramFloat1, float paramFloat2, float paramFloat3) { float f2 = 0.0F; float f1 = getEdgeValue(this.mRelativeEdges[paramInt], paramFloat2, this.mMaximumEdges[paramInt], paramFloat1); if (f1 != 0.0F) { float f4 = this.mRelativeVelocity[paramInt]; float f3 = this.mMinimumVelocity[paramInt]; f2 = this.mMaximumVelocity[paramInt]; f4 *= paramFloat3; if (f1 <= 0.0F) { f2 = -constrain(f4 * -f1, f3, f2); } else { f2 = constrain(f1 * f4, f3, f2); } } return f2; } private static float constrain(float paramFloat1, float paramFloat2, float paramFloat3) { if (paramFloat1 <= paramFloat3) { if (paramFloat1 >= paramFloat2) { paramFloat3 = paramFloat1; } else { paramFloat3 = paramFloat2; } } return paramFloat3; } private static int constrain(int paramInt1, int paramInt2, int paramInt3) { if (paramInt1 <= paramInt3) { if (paramInt1 >= paramInt2) { paramInt3 = paramInt1; } else { paramInt3 = paramInt2; } } return paramInt3; } private float constrainEdgeValue(float paramFloat1, float paramFloat2) { float f = 0.0F; if (paramFloat2 != 0.0F) { switch (this.mEdgeType) { default: break; case 0: case 1: if (paramFloat1 < paramFloat2) { if (paramFloat1 < 0.0F) { if ((this.mAnimating) && (this.mEdgeType == 1)) { f = 1.0F; } } else { f = 1.0F - paramFloat1 / paramFloat2; } } break; case 2: if (paramFloat1 < 0.0F) { f = paramFloat1 / -paramFloat2; } break; } } return f; } private float getEdgeValue(float paramFloat1, float paramFloat2, float paramFloat3, float paramFloat4) { float f1 = 0.0F; float f3 = constrain(paramFloat1 * paramFloat2, 0.0F, paramFloat3); float f2 = constrainEdgeValue(paramFloat4, f3); f2 = constrainEdgeValue(paramFloat2 - paramFloat4, f3) - f2; if (f2 >= 0.0F) { if (f2 <= 0.0F) { break label98; } f1 = this.mEdgeInterpolator.getInterpolation(f2); } else { f1 = -this.mEdgeInterpolator.getInterpolation(-f2); } f1 = constrain(f1, -1.0F, 1.0F); label98: return f1; } private void requestStop() { if (!this.mNeedsReset) { this.mScroller.requestStop(); } else { this.mAnimating = false; } } private boolean shouldAnimate() { ClampedScroller localClampedScroller = this.mScroller; int i = localClampedScroller.getVerticalDirection(); int j = localClampedScroller.getHorizontalDirection(); if (((i == 0) || (!canTargetScrollVertically(i))) && ((j == 0) || (!canTargetScrollHorizontally(j)))) { i = 0; } else { i = 1; } return i; } private void startAnimating() { if (this.mRunnable == null) { this.mRunnable = new ScrollAnimationRunnable(null); } this.mAnimating = true; this.mNeedsReset = true; if ((this.mAlreadyDelayed) || (this.mActivationDelay <= 0)) { this.mRunnable.run(); } else { ViewCompat.postOnAnimationDelayed(this.mTarget, this.mRunnable, this.mActivationDelay); } this.mAlreadyDelayed = true; } public abstract boolean canTargetScrollHorizontally(int paramInt); public abstract boolean canTargetScrollVertically(int paramInt); public boolean isEnabled() { return this.mEnabled; } public boolean isExclusive() { return this.mExclusive; } public boolean onTouch(View paramView, MotionEvent paramMotionEvent) { float f1 = 1; int i = 0; float f2; if (this.mEnabled) { switch (MotionEventCompat.getActionMasked(paramMotionEvent)) { case 0: this.mNeedsCancel = f1; this.mAlreadyDelayed = false; case 2: float f3 = computeTargetVelocity(0, paramMotionEvent.getX(), paramView.getWidth(), this.mTarget.getWidth()); f2 = computeTargetVelocity(f1, paramMotionEvent.getY(), paramView.getHeight(), this.mTarget.getHeight()); this.mScroller.setTargetVelocity(f3, f2); if ((!this.mAnimating) && (shouldAnimate())) { startAnimating(); } break; case 1: case 3: requestStop(); } if ((!this.mExclusive) || (!this.mAnimating)) { f1 = 0; } f2 = f1; } return f2; } public abstract void scrollTargetBy(int paramInt1, int paramInt2); public AutoScrollHelper setActivationDelay(int paramInt) { this.mActivationDelay = paramInt; return this; } public AutoScrollHelper setEdgeType(int paramInt) { this.mEdgeType = paramInt; return this; } public AutoScrollHelper setEnabled(boolean paramBoolean) { if ((this.mEnabled) && (!paramBoolean)) { requestStop(); } this.mEnabled = paramBoolean; return this; } public AutoScrollHelper setExclusive(boolean paramBoolean) { this.mExclusive = paramBoolean; return this; } public AutoScrollHelper setMaximumEdges(float paramFloat1, float paramFloat2) { this.mMaximumEdges[0] = paramFloat1; this.mMaximumEdges[1] = paramFloat2; return this; } public AutoScrollHelper setMaximumVelocity(float paramFloat1, float paramFloat2) { this.mMaximumVelocity[0] = (paramFloat1 / 1000.0F); this.mMaximumVelocity[1] = (paramFloat2 / 1000.0F); return this; } public AutoScrollHelper setMinimumVelocity(float paramFloat1, float paramFloat2) { this.mMinimumVelocity[0] = (paramFloat1 / 1000.0F); this.mMinimumVelocity[1] = (paramFloat2 / 1000.0F); return this; } public AutoScrollHelper setRampDownDuration(int paramInt) { this.mScroller.setRampDownDuration(paramInt); return this; } public AutoScrollHelper setRampUpDuration(int paramInt) { this.mScroller.setRampUpDuration(paramInt); return this; } public AutoScrollHelper setRelativeEdges(float paramFloat1, float paramFloat2) { this.mRelativeEdges[0] = paramFloat1; this.mRelativeEdges[1] = paramFloat2; return this; } public AutoScrollHelper setRelativeVelocity(float paramFloat1, float paramFloat2) { this.mRelativeVelocity[0] = (paramFloat1 / 1000.0F); this.mRelativeVelocity[1] = (paramFloat2 / 1000.0F); return this; } private static class ClampedScroller { private long mDeltaTime = 0L; private int mDeltaX = 0; private int mDeltaY = 0; private int mEffectiveRampDown; private int mRampDownDuration; private int mRampUpDuration; private long mStartTime = -9223372036854775808L; private long mStopTime = -1L; private float mStopValue; private float mTargetVelocityX; private float mTargetVelocityY; private float getValueAt(long paramLong) { float f1 = 0.0F; float f2; if (paramLong >= this.mStartTime) { if ((this.mStopTime >= 0L) && (paramLong >= this.mStopTime)) { long l = paramLong - this.mStopTime; f2 = 1.0F - this.mStopValue + this.mStopValue * AutoScrollHelper.constrain((float)l / this.mEffectiveRampDown, 0.0F, 1.0F); } else { f2 = 0.5F * AutoScrollHelper.constrain((float)(paramLong - this.mStartTime) / this.mRampUpDuration, 0.0F, 1.0F); } } return f2; } private float interpolateValue(float paramFloat) { return paramFloat * (-4.0F * paramFloat) + 4.0F * paramFloat; } public void computeScrollDelta() { if (this.mDeltaTime != 0L) { long l1 = AnimationUtils.currentAnimationTimeMillis(); float f = interpolateValue(getValueAt(l1)); long l2 = l1 - this.mDeltaTime; this.mDeltaTime = l1; this.mDeltaX = ((int)(f * (float)l2 * this.mTargetVelocityX)); this.mDeltaY = ((int)(f * (float)l2 * this.mTargetVelocityY)); return; } throw new RuntimeException("Cannot compute scroll delta before calling start()"); } public int getDeltaX() { return this.mDeltaX; } public int getDeltaY() { return this.mDeltaY; } public int getHorizontalDirection() { return (int)(this.mTargetVelocityX / Math.abs(this.mTargetVelocityX)); } public int getVerticalDirection() { return (int)(this.mTargetVelocityY / Math.abs(this.mTargetVelocityY)); } public boolean isFinished() { boolean bool; if ((this.mStopTime <= 0L) || (AnimationUtils.currentAnimationTimeMillis() <= this.mStopTime + this.mEffectiveRampDown)) { bool = false; } else { bool = true; } return bool; } public void requestStop() { long l = AnimationUtils.currentAnimationTimeMillis(); this.mEffectiveRampDown = AutoScrollHelper.constrain((int)(l - this.mStartTime), 0, this.mRampDownDuration); this.mStopValue = getValueAt(l); this.mStopTime = l; } public void setRampDownDuration(int paramInt) { this.mRampDownDuration = paramInt; } public void setRampUpDuration(int paramInt) { this.mRampUpDuration = paramInt; } public void setTargetVelocity(float paramFloat1, float paramFloat2) { this.mTargetVelocityX = paramFloat1; this.mTargetVelocityY = paramFloat2; } public void start() { this.mStartTime = AnimationUtils.currentAnimationTimeMillis(); this.mStopTime = -1L; this.mDeltaTime = this.mStartTime; this.mStopValue = 0.5F; this.mDeltaX = 0; this.mDeltaY = 0; } } private class ScrollAnimationRunnable implements Runnable { private ScrollAnimationRunnable() {} public void run() { if (AutoScrollHelper.this.mAnimating) { if (AutoScrollHelper.this.mNeedsReset) { AutoScrollHelper.access$202(AutoScrollHelper.this, false); AutoScrollHelper.this.mScroller.start(); } AutoScrollHelper.ClampedScroller localClampedScroller = AutoScrollHelper.this.mScroller; if ((!localClampedScroller.isFinished()) && (AutoScrollHelper.this.shouldAnimate())) { if (AutoScrollHelper.this.mNeedsCancel) { AutoScrollHelper.access$502(AutoScrollHelper.this, false); AutoScrollHelper.this.cancelTargetTouch(); } localClampedScroller.computeScrollDelta(); int i = localClampedScroller.getDeltaX(); int j = localClampedScroller.getDeltaY(); AutoScrollHelper.this.scrollTargetBy(i, j); ViewCompat.postOnAnimation(AutoScrollHelper.this.mTarget, this); } else { AutoScrollHelper.access$102(AutoScrollHelper.this, false); } } } } } /* Location: E:\android\Androidvn\dex2jar\classes_dex2jar.jar * Qualified Name: android.support.v4.widget.AutoScrollHelper * JD-Core Version: 0.7.0.1 */
[ "datkts0106@gmail.com" ]
datkts0106@gmail.com
e441c47b614fd42e23dc5cf26d27a9dc7aa6af84
9fc746827fe533366d48284afdea6609e872de4f
/src/brooklynbridgepoker/Pot.java
4063648bef46dccb05c1f6ad853268ee3733da80
[]
no_license
svetlozarkirkov/BrooklynBridgePoker
052d0e53077d19319276200b5f3867ac69c8c08b
26c56d8753833543230ecbc713295bdbec923828
refs/heads/master
2021-05-16T02:06:57.102084
2015-02-04T18:49:22
2015-02-04T18:49:22
29,931,642
3
3
null
2020-10-13T04:34:18
2015-01-27T19:47:13
Java
UTF-8
Java
false
false
1,141
java
package brooklynbridgepoker; import java.util.Map; public class Pot { private int currentPotTotal; // total sum in the pot private Map<String,Integer> playersInPot; // players who contribute to the pot public Pot(){ // default constructor } public int getCurrentPotTotal(){ // gets the current pot sum return currentPotTotal; } public Map<String,Integer> getPlayersInPot(){ // gets map of the players and their bets return playersInPot; } public void setCurrentPotTotal(int bet){ // updates the pot total sum this.currentPotTotal+=bet; } public void insertPlayerInPot(String name, int bet){ // inserts new player into the pot contributors this.playersInPot.put(name, bet); } public void removePlayerInPot(String name){ // removes a player from the pot this.playersInPot.remove(name); } public void clearPot(){ // clears the pot before a new round this.playersInPot.clear(); this.currentPotTotal=0; } }
[ "svetlozark@gmail.com" ]
svetlozark@gmail.com
7ecbbddb12ce5c163c903febd5055ceca1c263ef
b8cb78ab4fbaeb49bc2d6bdabe49f48cad66c585
/src/main/java/com/example/hotel/enums/UserType.java
ba2c31b11941eca688738b985d06c596680ae0ab
[]
no_license
TOMORI00/NJUSE-HRS
93f90c3db54fcef6ccf3fdc6346298b884e2df93
afddc41054daeab95e2590463bbb4dc97fee9eb2
refs/heads/master
2023-06-28T10:45:59.735392
2021-07-30T07:10:44
2021-07-30T07:10:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
475
java
package com.example.hotel.enums; /** * @author chenyizong */ public enum UserType { /** * 客户 */ Client("1"), /** * 酒店工作人员 */ Staff("2"), /** * 网站营销人员 */ Busi("3"), /** * 网站管理人员 */ Admin("4"); private String value; UserType(String value) { this.value = value; } @Override public String toString() { return value; } }
[ "1069016960@qq.com" ]
1069016960@qq.com
444429b2877952a29cfe4f70211ea7c1a1df716d
a36404f342345d009c8447d262459b8be1e6aa0c
/app/src/main/java/com/example/gyt/data/MyDBHelper.java
7e336ff43819f7b8233a268aaccf77172c4f4f84
[]
no_license
zhenghonghai/yourNameApp
fffaa11c29365ad3d608e72f7de469c65d158fe6
c0ef07f90552b9e1d95e21831ebc66b6379dba74
refs/heads/master
2020-11-23T21:58:06.137554
2019-12-16T01:39:14
2019-12-16T01:39:14
227,838,221
0
0
null
null
null
null
UTF-8
Java
false
false
1,565
java
package com.example.gyt.data; import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import androidx.annotation.Nullable; /** * 此功能是创建sqlite数据库 */ public class MyDBHelper extends SQLiteOpenHelper { private static String DATABASE_NAME = "gyt.db"; private static int DATABASE_VERSION = 1; public MyDBHelper(@Nullable Context context, @Nullable String name, @Nullable SQLiteDatabase.CursorFactory factory, int version) { super(context, name, factory, version); } public MyDBHelper(@Nullable Context context){ super(context, DATABASE_NAME, null, DATABASE_VERSION); } @Override public void onCreate(SQLiteDatabase db) { // 将需要创建多张表的语句放这里 // 创建用户表 String sql = "create table user" + "(" + " id int(32) not null primary key," + " account varchar(255)," + " password varchar(255)," + " icon varchar(255)," + " userName varchar(255)," + " telephone varchar(13)," + " email varchar(255)," + " gender int(2)," + " time timestamp" + ")"; db.execSQL(sql); } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { } @Override public void onOpen(SQLiteDatabase db) { super.onOpen(db); } }
[ "1092548413@qq.com" ]
1092548413@qq.com
aa08afebbc278b6c730f3945ccce7405636504b3
1f19aec2ecfd756934898cf0ad2758ee18d9eca2
/u-1/u-11/u-11-111/u-11-111-1111/u-11-111-1111-11111/u-11-111-1111-11111-f2519.java
0055e304ec6b71f611e358c4dc302a4760c7018d
[]
no_license
apertureatf/perftest
f6c6e69efad59265197f43af5072aa7af8393a34
584257a0c1ada22e5486052c11395858a87b20d5
refs/heads/master
2020-06-07T17:52:51.172890
2019-06-21T18:53:01
2019-06-21T18:53:01
193,039,805
0
0
null
null
null
null
UTF-8
Java
false
false
104
java
mastercard 5555555555554444 4012888888881881 4222222222222 378282246310005 6011111111111117 31124557279
[ "jenkins@khan.paloaltonetworks.local" ]
jenkins@khan.paloaltonetworks.local