file_id
int64 1
250k
| content
stringlengths 0
562k
| repo
stringlengths 6
115
| path
stringlengths 1
147
|
---|---|---|---|
1,224 | //21CE084
// kalp pandya
//
/*Use the Account class created as above to simulate an ATM machine.
Create 10 accounts with id AC001…..AC010 with initial balance 300₹. The
system prompts the users to enter an id. If the id is entered incorrectly, ask the
user to enter a correct id. Once an id is accepted, display menu with multiple
choices.
1. Balance inquiry
2. Withdraw money [Maintain minimum balance 300₹]
3. Deposit money
4. Money Transfer
5. Create Account
6. Deactivate Account
7. Exit
*/
import java.util.Scanner;
import java.util.ArrayList;
import java.lang.NullPointerException;
class q3
{
public static void main(String[] args)throws NullPointerException
{
int i;
ArrayList<Account> arrL=new ArrayList<Account>();
for(i=0;i<10;i++)
{
Account ac=null;
if(i<9)
ac=new Account("AC00"+(i+1));
else
ac=new Account("AC0"+(i+1));
arrL.add(ac);
}
Account ac=null;
Scanner sc=new Scanner(System.in);
int temp;
do
{
Account.menu();
System.out.print("\nEnter the choice : ");
temp=sc.nextInt();
if(temp==7)
System.exit(0);
if(temp==5)
{
System.out.print("\nEnter the Account id : ");
String id=sc.next();
ac=new Account(id);
arrL.add(ac);
System.out.println("Your account has been successfully created.");
continue;
}
if(temp==6)
{
System.out.print("\nEnter the Account id : ");
String id=sc.next();
for(i=0;i<arrL.size();i++)
{
ac=arrL.get(i);
if(id.equals(ac.getId()))
{
arrL.remove(i);
break;
}
}
System.out.println("Your account has been successfully deleted.");
continue;
}
do
{
System.out.print("\nEnter the Account id : ");
String id=sc.next();
for(i=0;i<arrL.size();i++)
{
ac=arrL.get(i);
if(id.equals(ac.getId()))
break;
}
if(i==arrL.size())
System.out.println("Enter valid id ");
else
break;
}while(true);
switch(temp)
{
case 1:
ac.balanceInquiry();
break;
case 2:
ac.withdrawMoney();
break;
case 3:
ac.depositMoney();
break;
case 4:
int j;
System.out.print("Enter the Transfered Account id : ");
String id1=sc.next();
System.out.print("Enter the Transfered amount : ");
double db=sc.nextDouble();
Account ac1=null;
for(j=0;j<10;j++)
{
ac1=arrL.get(j);
if((ac1.getId()).equals(id1))
break;
}
ac.moneyTransfer(ac1,db);
break;
default:
System.out.println("Please Enter the valid choice.");
}
}while(true);
}
}
class Account
{
private Scanner sc=new Scanner(System.in);
private String id="";
private double balance=300;
public Account(String id)
{
this.id=id;
}
public Account(String id,double balance)
{ this.id=id;
this.balance=balance;
}
public Account()
{
System.out.print("\nEnter the Account id : ");
id=sc.next();
System.out.print("\nEnter the initial amount : ");
balance=sc.nextDouble();
}
public void balanceInquiry()
{
System.out.println("Your Bank balance is : "+balance);
}
public void withdrawMoney()
{
int flag=0;
do
{
System.out.print("\nEnter the withdral amount : ");
double temp=sc.nextDouble();
if(temp<0)
System.out.println("Please enter the valid withdraw amount.");
else if(balance-temp>=300)
{ balance-=temp;
break; }
else
System.out.println("you are not able to withdraw money.");
}while(true);
System.out.println("Your available balance is : "+balance);
}
public void depositMoney()
{
do
{
System.out.print("\nEnter the deposit amount : ");
double temp=sc.nextDouble();
if(temp<0)
System.out.println("Please enter the valid deposit amount.");
else
{ balance+=temp;
break;
}
}while(true);
System.out.println("Your available balance is : "+balance);
}
public void moneyTransfer(Account ac1,double bal)
{
if(this.balance-bal>=300)
{
this.balance-=bal;
ac1.setBalance(ac1.getBalance()+bal);
System.out.println("Money Transfer is successfully completed.");
}
else
System.out.println("Money Transfer is not successfully completed.");
}
public void createAccount(Account ac)
{ ac=new Account();
System.out.println("Your Account has been successfully created.");
}
public static void menu()
{
System.out.println("\n 1. Balance inquiry \n 2. Withdraw money \n 3. Deposit money\n 4. Money Transfer\n 5. Create Account\n 6. Deactivate Account\n 7. Exit");
}
public void setBalance(double balance)
{
this.balance=balance;
}
public double getBalance()
{
return balance;
}
public String getId()
{
return id;
}
}
| kalp104/java_part-2 | q3.java |
1,228 | 404: Not Found | divonbriesen/CodingFundamentals | Cu.java |
1,229 | import java.util.ArrayList;
import java.util.Scanner;
/** A class that provides a UI for main */
public class UI {
private ArrayList<Customer> custList;
private ArrayList<Checking> checkList;
private ArrayList<Saving> savList;
private ArrayList<Credit> creditList;
private CsvImporter importer = new CsvImporter();
//Singleton implementation
private static volatile UI obj =null;
//Singleton constructor
private UI(){}
/**A method that serves as a singleton implementation for UIs */
public static UI getInstance(){
if(obj==null){
synchronized (UI.class){
if (obj==null){
obj = new UI();
}
}
}
return obj;
}
/**
* A method that imports data from a CSV file to prepare for the rest of UI
* method
*/
public void runStartUp() {
importer.dataImport();
this.custList = importer.getCustList();
this.checkList = importer.getCheckList();
this.savList = importer.getSavingList();
this.creditList = importer.getCreditList();
}
/** A method that runs a UI in the terminal */ // bug free
public void runUI() {
try {
Scanner scan = new Scanner(System.in);
System.out.println("Welcome to the El Paso Miners Banking system");
System.out.println("please log-in below\n");
boolean validInput = false;
while (!validInput) {
System.out.println("1. Customer log-in \n" + "2. Bank Management log-in\n3. New User");
System.out.println("Type EXIT to exit application");
String c = scan.nextLine();
switch (c) {
case "1":
customerLogIn();
validInput = true;
break;
case "2":
validInput = true;
adminLogIn();
break;
case "3":
validInput = true;
newUser();
break;
case "EXIT":
validInput = true;
importer.export();
importer.writeUpdatedCsv();
System.out.println("Application exited");
// generateReceipt(null);
System.exit(0);
default:
System.out.println("Incorrect input please try again");
break;
}
}
scan.close();
} catch (Exception e) {
importer.export();
System.out.println("Incorrect input please try again");
runUI();
}
}
/** A method that runs the new user UI, exclusively called by runUI */
private void newUser() {
Scanner scan = new Scanner(System.in);
Customer newCust = new Customer();
try {
// User input for relevant data fields
System.out.println("Please enter your first name");
newCust.setNameFirst(scan.nextLine());
System.out.println("Please enter your last name");
newCust.setNameLast(scan.nextLine());
System.out.println("Please enter your DOB");
newCust.setDob(scan.nextLine());
System.out.println("Please enter your address");
newCust.setAddress(scan.nextLine());
System.out.println("Please enter your phone number");
newCust.setPhoneNumber(scan.nextLine());
AccessNumbers accessor = new AccessNumbers();
// generation of id/account numbers and accounts
int id = accessor.getIDNum();
newCust.setId(id);
int checkNum = accessor.getCheckNum();
Checking newChecking = new Checking();
newChecking.setAccountNumber(checkNum);
newCust.setChecking(newChecking);
newChecking.setCustomer(newCust);
newChecking.setBalance(0);
Saving newSaving = new Saving();
int savNum = accessor.getSavNum();
newSaving.setAccountNumber(savNum);
newSaving.setBalance(0);
newSaving.setCustomer(newCust);
newCust.setSaving(newSaving);
Credit newCredit = new Credit();
int credNum = accessor.getCredNum();
newCredit.setAccountNumber(credNum);
newCredit.setBalance(0);
CreditGenerator generator = new CreditGenerator();
generator.generate();
newCredit.setMaxCredit(generator.getMaxCredit());
newCredit.setCustomer(newCust);
newCust.setCredit(newCredit);
System.out.println("Your user ID is: " + id);
System.out.println("Your Checking Account Number is: " + checkNum);
System.out.println("Your Savings Account Number is: " + savNum);
System.out.println("Your Credit Account Number is: " + credNum);
generator.printInfo();
custList.add(newCust);
checkList.add(newChecking);
savList.add(newSaving);
creditList.add(newCredit);
System.out.println("\n\n\nHere is all your information");
newCust.displayInformation();
newCust.fileCheck();
importer.incrementUser();
importer.export();
// @TODO add export
runUI();
} catch (Exception e) {
System.out.println("Invalid input for parameter, returning to previous screen");
runUI();
}
scan.close();
}
/** A method that runs the admin login UI, exclusively called by runUI */
private void adminLogIn() {
Scanner scan = new Scanner(System.in);
Searcher search = new Searcher();
try {
boolean validInput = false;
while (!validInput) {
System.out.println(
"Welcome Admin. What would you like to do today?\n 1.Inquire account by name\n 2.Inquire account by type/number\n 3.Run Transactions\n 4.Generate Customer Log\n 5. Go to previous menu");
String choice = scan.nextLine();
switch (choice) {
case "1":
System.out.println("Please enter the name of the account");
String accountName = scan.nextLine();
String[] parts = accountName.split(" ");
String firstName = parts[0];
String lastName = parts[1];
int index = search.searchByName(firstName, lastName, custList);
if (index > 0) {
custList.get(index).displayInformation();
validInput = true;
adminLogIn();
} else {
System.out.println("User not found, please input name correctly");
break;
}
case "2":
boolean validInput2 = false;
while (!validInput2) {
System.out.println(
"What is the account type?\n 1.Checking\n 2.Saving\n 3.Credit\n 4.Go back");
String accountType = scan.nextLine();
switch (accountType) {
case "1":
System.out.println("Please enter account number");
int accNum = Integer.parseInt(scan.nextLine());
int checkIndex = search.searchByChecking(accNum, checkList);
checkList.get(checkIndex).displayInformation();
adminLogIn();
validInput2 = true;
break;
case "2":
System.out.println("Please enter account number");
int accNum2 = Integer.parseInt(scan.nextLine());
int savIndex = search.searchBySaving(accNum2, savList);
savList.get(savIndex).displayInformation();
adminLogIn();
validInput2 = true;
break;
case "3":
System.out.println("Please enter account number");
int accNum3 = Integer.parseInt(scan.nextLine());
int credIndex = search.searchByCredit(accNum3, creditList);
creditList.get(credIndex).displayInformation();
adminLogIn();
validInput2 = true;
break;
case "4":
adminLogIn();
validInput2 = true;
break;
default:
System.out.println("Incorrect input please try again");
adminLogIn();
break;
}
} // end of while
validInput = true;
break;
case "3":
TransactionRunner tRunner = new TransactionRunner();
tRunner.runTransactions(custList);
validInput = true;
adminLogIn();
break;
case "4":
ShowCustomerLog shower = new ShowCustomerLog();
try{
System.out.println("Please type the name of the customer you wish to show the log for");
String findCust = scan.nextLine();
String[] fParts = findCust.split(" ");
String firstNameF = fParts[0];
String lastNameF = fParts[1];
int indexF = search.searchByName(firstNameF, lastNameF, custList);
System.out.println("Generated log:");
shower.printLog(custList.get(indexF));
}
catch(Exception e){
System.out.println("Customer not found not, returning to admin login");
adminLogIn();
}
break;
case "5":
runUI();
validInput = true;
break;
default:
System.out.println("Incorrect input please try again");
adminLogIn();
break;
}
}
} catch (Exception e) {
System.out.println("Error occured, returning to admin login");
e.printStackTrace();
adminLogIn();
}
scan.close();
}
/** A method that runs the customer login UI, exclusively called by runUI */ // bug free
private void customerLogIn() {
try {
System.out.println("Please enter your first and last name");
Scanner scan = new Scanner(System.in);
String accountName = scan.nextLine();
String[] parts = accountName.split(" ");
String firstName = parts[0];
String lastName = parts[1];
Searcher search = new Searcher();
int index = search.searchByName(firstName, lastName, custList);
if (index > 0) {
boolean validInput = false;
while (!validInput) {
System.out.println("Welcome " + firstName + " " + lastName
+ "!\n What would you like to do?\n 1.Make an inquiry\n 2.Access money services \n 3.Return to the previous menu");
String choice = scan.nextLine();
switch (choice) {
case "1":
inquiry(custList.get(index));
validInput = true;
break;
case "2":
moneyServices(custList.get(index));
validInput = true;
break;
case "3":
validInput = true;
runUI();
break;
default:
System.out.println("Incorrect input please try again");
customerLogIn();
}
} // end of loop
} else {
System.out.println("User not found, please make sure you input the name correctly");
customerLogIn();
}
scan.close();
} catch (Exception e) {
System.out.println("Error occured, returing to customer log in");
customerLogIn();
}
}
/**
* A method that runs the money services UI, exclusively called by customerLogIn
*/ // bug free
private void moneyServices(Customer primary) {
boolean validInput = false;
while (!validInput) {
try {
System.out.println("Thank you for accessing our money services, what would you like to do?");
System.out.println(
" 1.Deposit\n 2.Withdraw\n 3.Transfer\n 4.Make a Payment \n 5. Return to Log-In\n 6. Return to Main-Menu");
Scanner scan = new Scanner(System.in);
String choice = scan.nextLine();
Logger log = new Logger();
log.fileCheck();
switch (choice) {
case "1":
deposit(primary);
validInput = true;
break;
case "2":
withdraw(primary);
validInput = true;
break;
case "3":
transfer(primary);
validInput = true;
break;
case "4":
makePayment(primary);
validInput = true;
break;
case "5":
validInput = true;
customerLogIn();
break;
case "6":
validInput = true;
runUI();
break;
default:
System.out.println("Incorrect input please try again");
moneyServices(primary);
break;
}
scan.close();
} catch (Exception e) {
System.out.println("Error occured, returning to money services menu");
moneyServices(primary);
}
}
}
/** A method that runs the payment UI, exclusively called by moneyServices */
private void makePayment(Customer primary) {
try {
Scanner scan = new Scanner(System.in);
Logger log = new Logger();
boolean validInput = false;
while (!validInput) {
System.out.println("Which account would you like to make a payment from?");
System.out.println(" 1.Checking\n 2.Saving\n 3.Credit\n 4.Return to Money Services");
String c = scan.nextLine();
Searcher search = new Searcher();
switch (c) {
case "1":
Checking check = primary.getChecking();
int main = search.searchByChecking(check.getAccountNumber(), checkList);
System.out.println("What Account type are you making a payment to?");
System.out.println(" 1.Checking\n 2.Saving\n 3.Credit");
String s = scan.nextLine();
boolean validInput2 = false;
while (!validInput2) {
switch (s) {
case "1":
System.out.println("Please input the account number to make a payment to it");
int acc = Integer.parseInt(scan.nextLine());
int accIn = search.searchByChecking(acc, checkList);
Checking check2 = checkList.get(accIn);
System.out.println("please enter the amount to transfer");
double transfer = Double.parseDouble(scan.nextLine());
checkList.get(main).transferTo(checkList.get(accIn), transfer);
log.logTransfer(check, transfer, check2);
importer.export();
System.out.println(
"Successfully transferred " + transfer + " from Checking to Account"
+ check2.getAccountNumber());
validInput2 = true;
break;
case "2":
System.out.println("Please input the account number to make a payment to it");
int acc2 = Integer.parseInt(scan.nextLine());
int accIn2 = search.searchBySaving(acc2, savList);
Checking sav = checkList.get(accIn2);
System.out.println("please enter the amount to transfer");
double transfer2 = Double.parseDouble(scan.nextLine());
checkList.get(main).transferTo(savList.get(accIn2), transfer2);
log.logTransfer(check, transfer2, sav);
importer.export();
System.out.println(
"Successfully transferred " + transfer2 + " from Checking to Account"
+ sav.getAccountNumber());
validInput2 = true;
break;
case "3":
System.out.println("Please input the account number to make a payment to it");
int acc3 = Integer.parseInt(scan.nextLine());
int accIn3 = search.searchByCredit(acc3, creditList);
Checking cred = checkList.get(accIn3);
System.out.println("please enter the amount to transfer");
double transfer3 = Double.parseDouble(scan.nextLine());
checkList.get(main).transferTo(creditList.get(accIn3), transfer3);
log.logTransfer(check, transfer3, cred);
importer.export();
System.out.println(
"Successfully transferred " + transfer3 + " from Checking to Account"
+ cred.getAccountNumber());
validInput2 = true;
break;
default:
System.out.println("Incorrect input please try again");
break;
}
}
validInput = true;
break;
case "2":
Saving sav = primary.getSaving();
System.out.println("What Account type are you making a payment to?");
System.out.println(" 1.Checking\n 2.Saving\n 3.Credit");
String x = scan.nextLine();
int savingIn = search.searchBySaving(sav.getAccountNumber(), savList);
boolean validInput3 = false;
while (!validInput3) {
switch (x) {
case "1":
System.out.println("Please input the account number to make a payment to it");
int acc = Integer.parseInt(scan.nextLine());
int accIn = search.searchByChecking(acc, checkList);
Checking check2 = checkList.get(accIn);
System.out.println("please enter the amount to transfer");
double transfer = Double.parseDouble(scan.nextLine());
savList.get(savingIn).transferTo(checkList.get(accIn), transfer);
log.logTransfer(sav, transfer, check2);
importer.export();
System.out
.println("Successfully transferred " + transfer + " from Savings to Account"
+ check2.getAccountNumber());
validInput3 = true;
break;
case "2":
System.out.println("Please input the account number to make a payment to it");
int acc2 = Integer.parseInt(scan.nextLine());
int accIn2 = search.searchBySaving(acc2, savList);
Checking sav2 = checkList.get(accIn2);
System.out.println("please enter the amount to transfer");
double transfer2 = Double.parseDouble(scan.nextLine());
savList.get(savingIn).transferTo(savList.get(accIn2), transfer2);
log.logTransfer(sav, transfer2, sav2);
importer.export();
System.out.println(
"Successfully transferred " + transfer2 + " from Savings to Account"
+ sav2.getAccountNumber());
validInput3 = true;
break;
case "3":
System.out.println("Please input the account number to make a payment to it");
int acc3 = Integer.parseInt(scan.nextLine());
int accIn3 = search.searchByCredit(acc3, creditList);
Checking cred = checkList.get(accIn3);
System.out.println("please enter the amount to transfer");
double transfer3 = Double.parseDouble(scan.nextLine());
savList.get(savingIn).transferTo(creditList.get(accIn3), transfer3);
log.logTransfer(sav, transfer3, cred);
importer.export();
System.out.println(
"Successfully transferred " + transfer3 + " from Savings to Account"
+ cred.getAccountNumber());
validInput3 = true;
break;
default:
System.out.println("Incorrect input please try again");
break;
}
}
validInput = true;
break;
case "3":
Credit cred2 = primary.getCredit();
int credIn = search.searchByCredit(cred2.getAccountNumber(), creditList);
System.out.println("What Account type are you making a payment to?");
System.out.println(" 1.Checking\n 2.Saving\n 3.Credit");
String m = scan.nextLine();
boolean validInput4 = false;
while (!validInput4) {
switch (m) {
case "1":
System.out.println("Please input the account number to make a payment to it");
int acc = Integer.parseInt(scan.nextLine());
int accIn = search.searchByChecking(acc, checkList);
Checking check2 = checkList.get(accIn);
System.out.println("please enter the amount to transfer");
double transfer = Double.parseDouble(scan.nextLine());
creditList.get(credIn).transferTo(checkList.get(accIn), transfer);
log.logTransfer(cred2, transfer, check2);
importer.export();
System.out
.println("Successfully transferred " + transfer + " from Credit to Account"
+ check2.getAccountNumber());
validInput4 = true;
break;
case "2":
System.out.println("Please input the account number to make a payment to it");
int acc2 = Integer.parseInt(scan.nextLine());
int accIn2 = search.searchBySaving(acc2, savList);
Checking sav2 = checkList.get(accIn2);
System.out.println("please enter the amount to transfer");
double transfer2 = Double.parseDouble(scan.nextLine());
creditList.get(credIn).transferTo(savList.get(accIn2), transfer2);
log.logTransfer(cred2, transfer2, sav2);
importer.export();
System.out
.println("Successfully transferred " + transfer2 + " from Credit to Account"
+ sav2.getAccountNumber());
validInput4 = true;
break;
case "3":
System.out.println("Please input the account number to make a payment to it");
int acc3 = Integer.parseInt(scan.nextLine());
int accIn3 = search.searchByCredit(acc3, creditList);
Checking cred = checkList.get(accIn3);
System.out.println("please enter the amount to transfer");
double transfer3 = Double.parseDouble(scan.nextLine());
creditList.get(credIn).transferTo(creditList.get(accIn3), transfer3);
log.logTransfer(cred, transfer3, cred);
importer.export();
System.out
.println("Successfully transferred " + transfer3 + " from Credit to Account"
+ cred.getAccountNumber());
validInput4 = true;
break;
default:
System.out.println("Incorrect input please try again");
}
}
validInput = true;
break;
case "4":
moneyServices(primary);
validInput = true;
break;
default:
System.out.println("Incorrect input please try again");
makePayment(primary);
}
}
scan.close();
} catch (Exception e) {
System.out.println("Error occurred returning to payment menu");
makePayment(primary);
}
}
/** A method that runs the transfer UI, exclusively called by moneyServices */ // bug free
private void transfer(Customer primary) {
try {
Scanner scan = new Scanner(System.in);
Logger log = new Logger();
Searcher search = new Searcher();
boolean validInput = false;
while (!validInput) {
System.out.println("Which account would you like to transfer from?");
System.out.println(" 1.Checking\n 2.Saving\n 3.Credit\n 4.Return to Money Services");
String choice = scan.nextLine();
switch (choice) {
case "1":
System.out.println("What account would you like to transfer to?\n 1.Saving\n 2.Credit");
String accountType = scan.nextLine();
boolean validInput2 = false;
while (!validInput2) {
switch (accountType) {
case "1":
System.out.println("Please enter the amount to transfer");
double transfer = Double.parseDouble(scan.nextLine());
Checking check = primary.getChecking();
Saving sav = primary.getSaving();
int checkI = search.searchByChecking(check.getAccountNumber(), checkList);
int savI = search.searchBySaving(sav.getAccountNumber(), savList);
checkList.get(checkI).transferTo(savList.get(savI), transfer);
log.logTransfer(check, transfer, sav);
importer.export();
System.out.println(
"Successfully transferred " + transfer + " from Checking to Savings");
validInput2 = true;
break;
case "2":
System.out.println("Please enter the amount to transfer");
double transfer2 = Double.parseDouble(scan.nextLine());
Checking check2 = primary.getChecking();
Credit cred = primary.getCredit();
int checkI2 = search.searchByChecking(check2.getAccountNumber(), checkList);
int credI = search.searchByCredit(cred.getAccountNumber(), creditList);
checkList.get(checkI2).transferTo(creditList.get(credI), transfer2);
log.logTransfer(check2, transfer2, cred);
importer.export();
System.out.println(
"Successfully transferred " + transfer2 + " from Checking to Credit");
validInput2 = true;
break;
default:
System.out.println("Incorrect input please try again");
break;
}
validInput = true;
break;
}
case "2":
System.out.println("What account would you like to transfer to?\n 1.Checking\n 2.Credit");
String accountType2 = scan.nextLine();
boolean validInput3 = false;
while (!validInput3) {
switch (accountType2) {
case "1":
System.out.println("Please enter the amount to transfer");
double transfer = Double.parseDouble(scan.nextLine());
Saving sav = primary.getSaving();
Checking check = primary.getChecking();
int savI = search.searchBySaving(sav.getAccountNumber(), savList);
int checkI = search.searchByChecking(check.getAccountNumber(), checkList);
savList.get(savI).transferTo(checkList.get(checkI), transfer);
log.logTransfer(sav, transfer, check);
importer.export();
System.out.println(
"Successfully transferred " + transfer + " from Savings to Checking");
validInput3 = true;
break;
case "2":
System.out.println("Please enter the amount to transfer");
double transfer2 = Double.parseDouble(scan.nextLine());
Saving sav2 = primary.getSaving();
Credit cred = primary.getCredit();
int savI2 = search.searchBySaving(sav2.getAccountNumber(), savList);
int credI = search.searchByCredit(cred.getAccountNumber(), creditList);
savList.get(savI2).transferTo(creditList.get(credI), transfer2);
log.logTransfer(sav2, transfer2, cred);
importer.export();
System.out.println(
"Successfully transferred " + transfer2 + " from Savings to Credit");
validInput3 = true;
break;
default:
System.out.println("Incorrect input please try again");
break;
}
}
validInput = true;
break;
case "3":
System.out.println("What account would you like to transfer to?\n 1.Checking\n 2.Saving");
String accountType3 = scan.nextLine();
boolean validInput4 = false;
while (!validInput4) {
switch (accountType3) {
case "1":
System.out.println("Please enter the amount to transfer");
double transfer = Double.parseDouble(scan.nextLine());
Credit cred = primary.getCredit();
Checking check = primary.getChecking();
int credI = search.searchByCredit(cred.getAccountNumber(), creditList);
int checkI = search.searchByChecking(check.getAccountNumber(), checkList);
creditList.get(credI).transferTo(checkList.get(checkI), transfer);
log.logTransfer(cred, transfer, check);
importer.export();
System.out.println(
"Successfully transferred " + transfer + " from Credit to Checking");
validInput4 = true;
break;
case "2":
System.out.println("Please enter the amount to transfer");
double transfer2 = Double.parseDouble(scan.nextLine());
Credit cred2 = primary.getCredit();
Saving sav = primary.getSaving();
int credI2 = search.searchByCredit(cred2.getAccountNumber(), creditList);
int savI = search.searchBySaving(sav.getAccountNumber(), savList);
creditList.get(credI2).transferTo(savList.get(savI), transfer2);
log.logTransfer(cred2, transfer2, sav);
importer.export();
System.out.println(
"Successfully transferred " + transfer2 + " from Credit to Savings");
validInput4 = true;
break;
default:
System.out.println("Incorrect input please try again");
break;
}
}
validInput = true;
break;
case "4":
moneyServices(primary);
validInput = true;
break;
default:
System.out.println("Incorrect input please try again");
break;
}
}
scan.close();
} catch (Exception e) {
System.out.println("Error returing to transfer menu");
transfer(primary);
}
}
/** A method that runs the withdraw UI, exclusively called by moneyServices */ // bug free
private void withdraw(Customer primary) {
try {
Scanner scan = new Scanner(System.in);
Logger log = new Logger();
Searcher search = new Searcher();
boolean validInput = false;
while (!validInput) {
System.out.println("Which account would you like to make a withdrawal from?");
System.out.println(" 1.Checking\n 2.Savings\n 3.Credit\n 4.Return to Money Services");
String choice = scan.nextLine();
String withdrawWords = ("Please enter a withdrawal amount");
String success = ("Successfully withdrew: ");
switch (choice) {
case "1":
System.out.println(withdrawWords);
double withdraw = Double.parseDouble(scan.nextLine());
Checking wCheck = primary.getChecking();
int checkI = search.searchByChecking(wCheck.getAccountNumber(), checkList);
checkList.get(checkI).charge(withdraw);
log.logDeduction(wCheck, withdraw);
importer.export();
System.out.println(success + withdraw);
validInput = true;
break;
case "2":
System.out.println(withdrawWords);
double withdraw2 = Double.parseDouble(scan.nextLine());
Saving wSav = primary.getSaving();
int savI = search.searchBySaving(wSav.getAccountNumber(), savList);
savList.get(savI).charge(withdraw2);
log.logDeduction(wSav, withdraw2);
importer.export();
System.out.println(success + withdraw2);
validInput = true;
break;
case "3":
System.out.println(withdrawWords);
double withdraw3 = Double.parseDouble(scan.nextLine());
Credit cred = primary.getCredit();
int credI = search.searchByCredit(cred.getAccountNumber(), creditList);
creditList.get(credI).charge(withdraw3);
log.logDeduction(cred, withdraw3);
importer.export();
System.out.println(success + withdraw3);
validInput = true;
break;
case "4":
moneyServices(primary);
validInput = true;
break;
default:
System.out.println("Incorrect input please try again");
break;
}
}
scan.close();
}
catch (Exception e) {
System.out.println("Error occurred, returning to withdraw menu");
}
}
/** A method that runs the deposit UI, exclusively called by moneyServices */ // bug free
private void deposit(Customer primary) {
try {
Searcher search = new Searcher();
Scanner scan = new Scanner(System.in);
Logger log = new Logger();
System.out.println("Which account would you like to make a deposit in?");
System.out.println(" 1.Checking\n 2.Savings\n 3.Credit\n 4.Return to Money Services");
boolean validInput = false;
while (!validInput) {
System.out.println("Which account would you like to make a deposit in?");
System.out.println("1.Checking\n 2.Savings\n 3.Credit\n 4.Return to Money Services");
String choice = scan.nextLine(); // Moved inside the loop to update choice in each iteration.
switch (choice) {
case "1":
Checking check = primary.getChecking();
System.out.println("Please enter deposit amount");
double deposit = Double.parseDouble(scan.nextLine());
int checkIdx = search.searchByChecking(check.getAccountNumber(), checkList);
checkList.get(checkIdx).deposit(deposit);
log.logAddition(check, deposit);
importer.export();
System.out.println("Successfully deposited: " + deposit);
validInput = true;
break;
case "2":
Saving sav = primary.getSaving();
System.out.println("Please enter deposit amount");
double deposit2 = Double.parseDouble(scan.nextLine());
int savingIdx = search.searchBySaving(sav.getAccountNumber(), savList);
savList.get(savingIdx).deposit(deposit2);
log.logAddition(sav, deposit2);
importer.export();
System.out.println("Successfully deposited: " + deposit2);
validInput = true;
break;
case "3":
Credit cred = primary.getCredit();
System.out.println("Please enter a deposit amount");
double deposit3 = Double.parseDouble(scan.nextLine());
int credIdx = search.searchByCredit(cred.getAccountNumber(), creditList);
creditList.get(credIdx).deposit(deposit3);
log.logAddition(cred, deposit3);
importer.export();
System.out.println("Successfully deposited: " + deposit3);
validInput = true;
break;
case "4":
moneyServices(primary);
validInput = true;
break;
default:
System.out.println("Incorrect input please try again");
break;
}
}
scan.close();
} catch (Exception e) {
System.out.println("Error occurred, returning to deposit menu");
deposit(primary);
}
}
/** A method that runs the inquiry UI, exclusively called by customerLogin */ // bug free
private void inquiry(Customer cust) {
boolean validInput = false;
Scanner scan = new Scanner(System.in);
Logger log = new Logger();
while (!validInput) {
try {
System.out.println(
"What would you like to inquire about?\n 1.Everything\n 2.Checkings\n 3.Savings\n 4.Credit\n 5.Return to login");
String choice = scan.nextLine();
switch (choice) {
case "1":
cust.displayInformation();
log.logInquiry(cust, "Everything");
break;
case "2":
Checking check = cust.getChecking();
check.displayInformation();
log.logInquiry(cust, "Checking");
break;
case "3":
Saving sav = cust.getSaving();
sav.displayInformation();
log.logInquiry(cust, "Savings");
break;
case "4":
Credit cred = cust.getCredit();
cred.displayInformation();
log.logInquiry(cust, "Credit");
break;
case "5":
customerLogIn();
validInput = true;
break;
default:
System.out.println("Incorrect input please try again");
}
} catch (Exception e) {
System.out.println("Error occurred, returning to inquiry menu");
}
}
// Close the scanner after the loop is finished.
scan.close();
}
/*
* private void generateReceipt(Account account) {
* String accountInfo = "Account Information:\n";
*
* accountInfo += "Account Number: " + account.getAccountNumber() + "\n";
* accountInfo += "Account Holder: " + account.getCustomer() + "\n";
*
* double startingBalance = account.getBalance();
* double endingBalance = account.getBalance(); //
*
* List<String> transactions = Logger.logInquiry(account.getAccountNumber()); //
* need to integrate
* // with the Logger
* // class to fetch all
* // transactions for
* // the account.
* String dateOfStatement = new SimpleDateFormat("yyyy-MM-dd").format(new
* Date());
* StringBuilder receipt = new StringBuilder();
*
* receipt.append(accountInfo);
* receipt.append("Starting Balance: " + startingBalance + "\n");
* receipt.append("Ending Balance: " + endingBalance + "\n");
* receipt.append("Transactions:\n");
*
* for (String transaction : transactions) {
* receipt.append(transaction + "\n");
* }
*
* receipt.append("Date of Statement: " + dateOfStatement);
*
* try (PrintWriter out = new PrintWriter(new
* FileWriter("UserTransactions.txt"))) {
* out.println(receipt.toString());
* } catch (IOException e) {
* System.out.println("Error writing to file: " + e.getMessage());
* }
*
* }
*/
}
| NNyaklir/AOOP_Project | UI.java |
1,230 | // CS171 Fall 2012 Final Project
//
// Nealon Young
// ID #81396982
import java.util.ArrayList;
import javax.swing.*;
public class AI implements Runnable {
private static final int TIME_LIMIT_MILLIS = 5000;
private static final int EVALS_PER_SECOND = 100;
private static final int emptyPosition = 0;
private static final int aiPosition = 1;
private static final int humanPosition = 2;
private static final int winCutoff = 500000;
private static boolean searchCutoff = false;
public AI() {
}
//
// run() executes a search of the game state, and makes a move for the AI player
//
public void run() {
AIGameState state = new AIGameState();
AIGameMove move = chooseMove(state);
AIGame.buttons[move.getRow()][move.getColumn()].setText(AIGame.aiButtonText);
}
//
// chooseMove() scores each of the possible moves that can be made from the given AIGameState, and returns the move with the highest eval score
//
private AIGameMove chooseMove(AIGameState state) {
long startTime = System.currentTimeMillis();
boolean aiMove = state.aiMove();
int maxScore = Integer.MIN_VALUE;
AIGameMove bestMove = null;
ArrayList<AIGameMove> moves = state.validMoves();
for (AIGameMove move : moves) {
//
// Copy the current game state
//
AIGameState newState = state.clone();
newState.makeMove(move);
//
// Compute how long to spend looking at each move
//
long searchTimeLimit = ((TIME_LIMIT_MILLIS - 1000) / (moves.size()));
int score = iterativeDeepeningSearch(newState, searchTimeLimit);
//
// If the search finds a winning move
//
if (score >= winCutoff) {
return move;
}
if (score > maxScore) {
maxScore = score;
bestMove = move;
}
}
return bestMove;
}
//
// Run an iterative deepening search on a game state, taking no longrer than the given time limit
//
private int iterativeDeepeningSearch(AIGameState state, long timeLimit) {
long startTime = System.currentTimeMillis();
long endTime = startTime + timeLimit;
int depth = 1;
int score = 0;
searchCutoff = false;
while (true) {
long currentTime = System.currentTimeMillis();
if (currentTime >= endTime) {
break;
}
int searchResult = search(state, depth, Integer.MIN_VALUE, Integer.MAX_VALUE, currentTime, endTime - currentTime);
//
// If the search finds a winning move, stop searching
//
if (searchResult >= winCutoff) {
return searchResult;
}
if (!searchCutoff) {
score = searchResult;
}
depth++;
}
return score;
}
//
// search() will perform minimax search with alpha-beta pruning on a game state, and will cut off if the given time
// limit has elapsed since the beginning of the search
//
private int search(AIGameState state, int depth, int alpha, int beta, long startTime, long timeLimit) {
ArrayList<AIGameMove> moves = state.validMoves();
boolean myMove = state.aiMove();
int savedScore = (myMove) ? Integer.MIN_VALUE : Integer.MAX_VALUE;
int score = Evaluator.eval(state);
long currentTime = System.currentTimeMillis();
long elapsedTime = (currentTime - startTime);
if (elapsedTime >= timeLimit) {
searchCutoff = true;
}
//
// If this is a terminal node or a win for either player, abort the search
//
if (searchCutoff || (depth == 0) || (moves.size() == 0) || (score >= winCutoff) || (score <= -winCutoff)) {
return score;
}
if (state.aiMove) {
for (AIGameMove move : moves) {
AIGameState childState = state.clone();
childState.makeMove(move);
alpha = Math.max(alpha, search(childState, depth - 1, alpha, beta, startTime, timeLimit));
if (beta <= alpha) {
break;
}
}
return alpha;
} else {
for (AIGameMove move : moves) {
AIGameState childState = state.clone();
childState.makeMove(move);
beta = Math.min(beta, search(childState, depth - 1, alpha, beta, startTime, timeLimit));
if (beta <= alpha) {
break;
}
}
return beta;
}
}
public void Reset() {
//clear sequential-AI based data here:
}
}
| nealyoung/CS171 | AI.java |
1,236 | class Solution {
public int search(int[] nums, int target) {
int n = nums.length;
int left = 0, right = n - 1;
// Find the index of the pivot element (the smallest element)
while (left <= right) {
int mid = (left + right) / 2;
if (nums[mid] > nums[n - 1]) {
left = mid + 1;
} else {
right = mid - 1;
}
}
return shiftedBinarySearch(nums, left, target);
}
// Shift elements in a circular manner, with the pivot element at index 0.
// Then perform a regular binary search
private int shiftedBinarySearch(int[] nums, int pivot, int target) {
int n = nums.length;
int shift = n - pivot;
int left = (pivot + shift) % n;
int right = (pivot - 1 + shift) % n;
while (left <= right) {
int mid = (left + right) / 2;
if (nums[(mid - shift + n) % n] == target) {
return (mid - shift + n) % n;
} else if (nums[(mid - shift + n) % n] > target) {
right = mid - 1;
} else {
left = mid + 1;
}
}
return -1;
}
}
| kalongn/LeetCode_Solution | 33.java |
1,237 | import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
public class IO
{
// Encode a message with a trailing linefeed as our delimiter
public static byte[] encode(String message)
{
byte[] characterBytes = new byte[message.length() + 1];
for (int i = 0; i < message.length(); i++)
{
characterBytes[i] = (byte) message.charAt(i);
}
// Ending character (in this case a linefeed)
characterBytes[message.length()] = 10;
return characterBytes;
}
//Send the bytes specified by `bytes` to the outputStream given
private static boolean sendCommandInternal(OutputStream outStream, byte[] bytes)
{
try
{
//Send each byte at a time
for(byte theByte: bytes)
{
outStream.write(theByte);
}
}
catch(IOException err)
{
return false;
}
return true;
}
public static boolean sendCommand(OutputStream outStream, String message)
{
return sendCommandInternal(outStream, encode(message));
}
//Get the command sent from the host (returns `null` on error (when an IOException occurs)
public static String readCommand(InputStream inStream)
{
String message = "";
try
{
boolean awaitingLineFeed = true;
while(awaitingLineFeed)
{
// Read from client
int byteRep = inStream.read();
//check -1
if(byteRep == -1) //look into me @assigned to deavmi
{
//error here
}
//Read an actual byte
else
{
// The actual byte
byte theByte = (byte)byteRep;
//Linefeed flush out
if(theByte == 10)
{
//Command recieved
PrettyPrint.out("IO","Data received \"" + message+"\"");
//We are now done and can return the message
awaitingLineFeed = false;
}
//If not a linefeed then append to the `message` String
else
{
message = message + (char)( theByte );
}
}
}
}
catch(IOException err)
{
//On error set `message` to `null`
message = null;
}
return message;
}
}
| deavmi/SUIX | IO.java |
1,239 | import greenfoot.*;
/**
* Write a description of class SR here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class SR extends World
{
/**
* Constructor for objects of class SR.
*
*/
public SR()
{
// Create a new world with 600x400 cells with a cell size of 1x1 pixels.
super(970, 690, 1);
}
}
| cookiedancer/TCCDirectory | SR.java |
1,244 | package org.usfirst.frc.team6574.robot;
import edu.wpi.first.wpilibj.buttons.Button;
import edu.wpi.first.wpilibj.buttons.JoystickButton;
import edu.wpi.first.wpilibj.buttons.Trigger;
/**
* The Operator Interface class. Connects physical interface to command groups.
*
* @author Ferradermis-6574
*
*/
public class OI {
//// CREATING BUTTONS
// One type of button is a joystick button which is any button on a
//// joystick.
// You create one by telling it which joystick it's on and which button
// number it is.
//Joystick stick = new Joystick(port);
// Button button = new JoystickButton(stick, buttonNumber);
JoystickController joystick = new JoystickController(0);
Button joystick_button_2 = new JoystickButton(joystick, JoystickController.BUTTON_2);
Button joystick_button_3 = new JoystickButton(joystick, JoystickController.BUTTON_3);
Button joystick_button_4 = new JoystickButton(joystick, JoystickController.BUTTON_4);
Button joystick_button_5 = new JoystickButton(joystick, JoystickController.BUTTON_5);
Button joystick_button_6 = new JoystickButton(joystick, JoystickController.BUTTON_6);
Button joystick_button_7 = new JoystickButton(joystick, JoystickController.BUTTON_7);
Button joystick_button_8 = new JoystickButton(joystick, JoystickController.BUTTON_8);
Button joystick_button_9 = new JoystickButton(joystick, JoystickController.BUTTON_9);
Button joystick_button_10 = new JoystickButton(joystick, JoystickController.BUTTON_10);
Button joystick_button_11 = new JoystickButton(joystick, JoystickController.BUTTON_11);
Button joystick_button_12 = new JoystickButton(joystick, JoystickController.BUTTON_12);
//Trigger joystick_trigger = FIGURE OUT LATER AND MAKE CLASS
XboxController xbox = new XboxController(1);
// There are a few additional built in buttons you can use. Additionally,
// by subclassing Button you can create custom triggers and bind those to
// commands the same as any other Button.
//// TRIGGERING COMMANDS WITH BUTTONS
// Once you have a button, it's trivial to bind it to a button in one of
// three ways:
// Start the command when the button is pressed and let it run the command
// until it is finished as determined by it's isFinished method.
// button.whenPressed(new ExampleCommand());
// Run the command while the button is being held down and interrupt it once
// the button is released.
// button.whileHeld(new ExampleCommand());
// Start the command when the button is released and let it run the command
// until it is finished as determined by it's isFinished method.
// button.whenReleased(new ExampleCommand());
}
| Ferradermis/frc-6574-2017 | OI.java |
1,245 | /*
Find the largest palindrome made from the product of two 3-digit numbers which is less than N.
https://www.hackerrank.com/contests/projecteuler/challenges/euler004/problem
*/
import java.util.Scanner;
class E4
{
public static void main(String ags[])
{
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
boolean ar[]=palins();
for(int x=0;x<t;x++)
{
int n=sc.nextInt();
for(int y=n-1;y>=0;y--)
{
if(ar[y])
{
System.out.println(y);
break;
}
}
}
}
public static boolean[] palins()
{
boolean ar[]=new boolean[10000001];//10^6+1 because aray starts with index 0
for(int x=100;x<=999;x++)
{
for(int y=100000/x;y<=999;y++)
{
int t=x*y;
if(isPalin(t))
{
ar[t]=true;
}
}
}
return ar;
}
public static boolean isPalin(int n)
{
int t=n;
int r=0;
while(t!=0)
{
r*=10;
r+=t%10;
t/=10;
}
return n==r;
}
}
| Goku1999/Project-Euler | E4.java |
1,250 | //{ Driver Code Starts
import java.io.*;
import java.util.*;
public class GFG {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int tc = scanner.nextInt();
while (tc-- > 0) {
int V = scanner.nextInt();
int E = scanner.nextInt();
List<Integer>[] adj = new ArrayList[V];
for (int i = 0; i < V; i++) {
adj[i] = new ArrayList<>();
}
for (int i = 0; i < E; i++) {
int u = scanner.nextInt();
int v = scanner.nextInt();
adj[u].add(v);
adj[v].add(u);
}
// String x=scanner.nextLine();
// scanner.nextLine();
Solution obj = new Solution();
int ans = obj.isEulerCircuit(V, adj);
System.out.println(ans);
}
}
}
// } Driver Code Ends
class Solution{
public int isEulerCircuit(int V, List<Integer>[] adj)
{
int odd=0, ev = 0;
// counting degree of all nodes, odd and even degree nodes
for(int i=0; i<V; i++){
if( adj[i].size() % 2 == 0 ) ev++;
else odd++;
}
// for undirected graph
// euler circuit must have all node with even degree
// euler circuit must have all even degree node with atmost 2 odd degree nodes
if( ev == V ) return 2;
else if( odd > 0 && odd==2 ) return 1;
return 0;
}
}
| dhruvabhat24/Geeks-4-Geeks_November | 29.java |
1,251 | import java.awt.BorderLayout;
import java.awt.Color;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextField;
import java.awt.Insets;
import java.awt.Font;
import javax.swing.JButton;
import java.awt.Dimension;
import javax.swing.JScrollPane;
import javax.swing.JTextPane;
import javax.swing.ScrollPaneConstants;
import javax.swing.text.DefaultCaret;
import javax.swing.text.Style;
import javax.swing.text.StyleConstants;
import javax.swing.text.StyledDocument;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JMenuBar;
import java.awt.Component;
import javax.swing.Box;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
/**
* The UI class is intended to generate and control the main UI for the application.
* A note that the majority of the actual code controlling connections and communication
* with the server is actually controlled and executed by the Client object.
*
* @author Maxence Weyrich
*
*/
public class UI extends JFrame implements ActionListener {
private static final long serialVersionUID = 1L;
private static final String INTRO_MESSAGE = "Welcome to JavaChat... to begin connect to a server, or host your own!\n\n";
private static final int MAX_CHARS = 250000;
private Client client;
private ConnectionUI connectionDialog;
private JPanel contentPane;
private JTextField messageBox;
private JTextPane messageArchive;
private JButton sendButton;
private StyledDocument archiveDoc;
private JMenuBar menuBar;
private JButton newConnection;
private Component horizontalGlue;
private Component horizontalGlue_1;
private JButton disconnect;
private Component horizontalStrut;
private JScrollPane messageArchivePanel;
/**
* Create the main UI frame.
* @param client a Client object.
*/
public UI(Client client) {
this.client = client;
this.connectionDialog = new ConnectionUI(client);
contentPane = new JPanel();
contentPane.setFont(new Font("Tahoma", Font.PLAIN, 14));
setContentPane(contentPane);
contentPane.setLayout(new BorderLayout(0, 0));
menuBar = new JMenuBar();
contentPane.add(menuBar, BorderLayout.NORTH);
horizontalGlue = Box.createHorizontalGlue();
menuBar.add(horizontalGlue);
newConnection = new JButton("New Connection...");
newConnection.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
connectionDialog.setVisible(true);
connectionDialog.requestFocus();
}
});
newConnection.setMargin(new Insets(3, 40, 3, 40));
menuBar.add(newConnection);
newConnection.setFont(new Font("Tahoma", Font.PLAIN, 14));
horizontalStrut = Box.createHorizontalStrut(20);
menuBar.add(horizontalStrut);
disconnect = new JButton("Disconnect");
disconnect.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
client.close();
}
});
disconnect.setEnabled(false);
disconnect.setMargin(new Insets(3, 40, 3, 40));
disconnect.setFont(new Font("Tahoma", Font.PLAIN, 14));
menuBar.add(disconnect);
horizontalGlue_1 = Box.createHorizontalGlue();
menuBar.add(horizontalGlue_1);
JPanel subPanel = new JPanel();
contentPane.add(subPanel, BorderLayout.SOUTH);
subPanel.setLayout(new BorderLayout(0, 0));
messageBox = new JTextField();
messageBox.setEnabled(false);
messageBox.addActionListener(this);
subPanel.add(messageBox, BorderLayout.CENTER);
messageBox.setMargin(new Insets(10, 10, 10, 10));
messageBox.setFont(new Font("Trebuchet MS", Font.PLAIN, 14));
messageBox.setColumns(8);
sendButton = new JButton("Send");
sendButton.setEnabled(false);
sendButton.addActionListener(this);
sendButton.setFont(new Font("Trebuchet MS", Font.PLAIN, 14));
sendButton.setPreferredSize(new Dimension(80, 23));
sendButton.setActionCommand("send");
subPanel.add(sendButton, BorderLayout.EAST);
messageArchivePanel = new JScrollPane();
messageArchivePanel.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
contentPane.add(messageArchivePanel, BorderLayout.CENTER);
messageArchive = new JTextPane();
messageArchive.setFont(new Font("Trebuchet MS", Font.PLAIN, 14));
messageArchive.setDragEnabled(true);
messageArchive.setEditable(false);
((DefaultCaret)messageArchive.getCaret()).setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE);
// Define the document styles that are available to choose from
archiveDoc = messageArchive.getStyledDocument();
Style s = archiveDoc.addStyle("bold", null);
StyleConstants.setBold(s, true);
s = archiveDoc.addStyle("italic", null);
StyleConstants.setItalic(s, true);
s = archiveDoc.addStyle("command", null);
StyleConstants.setFontFamily(s, "Monospaced");
s = archiveDoc.addStyle("error", null);
StyleConstants.setFontFamily(s, "Monospaced");
StyleConstants.setForeground(s, Color.RED);
messageArchivePanel.setViewportView(messageArchive);
try {
archiveDoc.insertString(0, INTRO_MESSAGE, null);
} catch(Exception e) {
e.printStackTrace();
}
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(1000, 600);
addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent arg0) {
client.close();
}
});
this.setVisible(true);
messageBox.requestFocusInWindow();
}
/**
* Adds the specified text into the document with the given style.
* @param text String of the text to add
* @param style String of the style of the text. Ensure that the style has been defined ahead of time in the constructor.
*/
private void addText(String text, String style) {
Style textStyle;
if(style == null) {
textStyle = null;
} else {
textStyle = archiveDoc.getStyle(style);
}
try {
archiveDoc.insertString(archiveDoc.getLength(), text, textStyle);
if(archiveDoc.getLength() + text.length() > MAX_CHARS) {
archiveDoc.remove(0, Math.min(archiveDoc.getLength(), archiveDoc.getLength() + messageBox.getText().length() - MAX_CHARS));
}
} catch(Exception ex) {
ex.printStackTrace();
}
messageArchive.setCaretPosition(archiveDoc.getLength()); //set position to end
}
/**
* Handle the Send button press or the press of the return key while still in the message box
* Will process the message, update UI, and send it to the server.
*/
@Override
public void actionPerformed(ActionEvent e) {
if(e.getSource().equals(sendButton) || e.getSource().equals(messageBox)) {
if(messageBox.getText().startsWith("//")) { //if a server command (starts with "//")
client.sendCommand(messageBox.getText().substring(2));
addText(messageBox.getText() + '\n', "command");
messageBox.setText("");
} else if(messageBox.getText().length() > 0) { //if normal text; then it's a normal message
client.sendMessage(messageBox.getText());
addText("Me: ", "bold");
addText(messageBox.getText() + '\n', null);
messageBox.setText("");
}
messageBox.requestFocusInWindow();
} else {
System.out.println(e.toString());
}
}
/**
* Adds the specified message to the UI with the user as the sender of the message
* @param newMessage String message to add to the screen
* @param user String user that send the new message.
*/
public void addMessage(String newMessage, String user) {
addText(user + ": ", "bold");
addText(newMessage.trim() + '\n', "normal");
}
/**
* Adds the specified text to the UI with the "error" style
* @param notif String error message to add to the screen
*/
public void addError(String notif) {
addText("Error - " + notif + '\n', "error");
}
/**
* Adds the specified text to the UI with the formatting for a server command response (to differentiate from normal messages)
* @param notif String text to add to the UI
*/
public void addCommandResponse(String notif) {
addText(notif + '\n', "command");
}
/**
* Adds a "notification" to the UI, it has a different formatting to indicate that is it not a normal message.
* This is used whenever the server sends a message or notification to a user to differentiate it form a normal message.
* @param notif String message to send the user.
*/
public void addNotification(String notif) {
addText(notif.trim() + '\n', "italic");
}
/**
* Sets the result text for the connection dialog
* @param result String result message
*/
public void showConnectionResult(String result) {
connectionDialog.setConnectionResult(result);
}
/**
* Updates the UI based on the value of connected.
* E.g. will enable buttons that would normally be disabled when the connection turns on
* @param connected
*/
public void setConnected(boolean connected) {
messageBox.setEnabled(connected);
sendButton.setEnabled(connected);
newConnection.setEnabled(!connected);
disconnect.setEnabled(connected);
if(connected) {
connectionDialog.setVisible(false);
connectionDialog.reset();
}
}
}
| maxwey/ChatClient | UI.java |
1,252 |
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
/**
* Ai class represent a Artificial intelligence in game
* @author sevda imany
* @version 0.0
*/
public class Ai extends Player {
/**
* this method count how many black member can be replace with white in every possible block to put white
* @param game
* @return a HashMap with point as a key and the number of replaced black member as value
*/
public HashMap count(Game game) {
int[][] twoD_arr = game.getTwoD_arr();
GameMap map = new GameMap();
int blocks = 0;
int numBlack = 0;
HashMap<Point, Integer> ways = new HashMap<Point, Integer>();
for (int c = 0; c < 8; c++) {
for (int l = 0; l < 8; l++) {
numBlack = 0;
if (twoD_arr[c][l] == 0) {
int check = 0;
for (int i = -1; i < 2; i++) {
for (int k = -1; k < 2; k++) {
blocks = 0;
// check than can move in THIS way
Point point = new Point(c + i, l + k);
if (map.check(point)) {
if (twoD_arr[c + i][l + k] == 1) {
blocks++;
int x = c + i + i;
int y = l + k + k;
while (true) {
Point point1 = new Point(x, y);
if (map.check(point1)) {
if (twoD_arr[x][y] == -1) {
numBlack += blocks;
check = 1;
break;
} else if (twoD_arr[x][y] == 0) {
break;
}
x += i;
y += k;
blocks++;
} else
break;
}
}
}
}
}
if(check == 1){
Point point2 = new Point(c, l);
ways.put(point2,numBlack);
}
}
}
}
return ways;
}
/**
* this method choose a coordinate which replace max number of black
* @param game
* @return coordinate of a block
*/
public Point choose2(Game game) {
Point point = new Point(-1, -1);
HashMap<Point, Integer> ways = count(game);
int maxWay = Collections.max(ways.values());
for (Map.Entry<Point, Integer> entry : ways.entrySet()) {
if (entry.getValue() == maxWay)
return entry.getKey();
}
return point;
}
}
| sevdaimany/Othello-game | Ai.java |
1,255 | import java.util.ArrayList;
import java.util.ListIterator;
public class os {
static ArrayList<Job> jobs = new ArrayList<Job>();
static MemoryManager memory;
static DrumManager drum;
static cpuScheduler cpu;
static IOManager io;
static Job runningJob=new Job(), drumJob=new Job(), ioJob=new Job();
static int systemTime=0;
public static void startup (){
sos.ontrace();
drum = new DrumManager(jobs);
memory = new MemoryManager(drum);
cpu = new cpuScheduler();
io = new IOManager();
}
public static void Crint (int []a, int []p){
// System.out.println("Job number " + p[1]);
bookKeeper(p[5]);
// interrupt handler
Job job = new Job(p[1],p[2],p[3],p[4],p[5], memory);
jobs.add(job);
if(job.getLocation() != -1) {
drum.queueJob(job, "in");
}
cleanJobTable(jobs);
// done with interrup handler
drumJob = drum.manageDrum(drumJob);
// drum.moveToQueue(jobs);
runningJob = cpu.schedule(jobs, a, p);
System.out.println("memory in crint");
memory.displayMemoryTable();
return;
}
public static void Dskint (int []a, int []p){
// System.out.println("Disk Int");
bookKeeper(p[5]);
ioJob = io.finishIO(ioJob);
drumJob = drum.manageDrum(drumJob);
runningJob = cpu.schedule(jobs, a, p);
return;
}
public static void Drmint (int []a, int []p){
// System.out.println("Drum Int");
bookKeeper(p[5]);
// interrupt handler
memory.displayMemoryTable();
displayJobTable();
drum.displayDrumQueue();
io.displayIOTable();
drum.swapped(jobs);
// done with interrupt handler
drumJob = drum.manageDrum(drumJob);
// drum.moveToQueue(jobs);
runningJob = cpu.schedule(jobs, a, p);
return;
}
public static void Tro (int []a, int []p){
// System.out.println("Timer Int");
bookKeeper(p[5]);
if(runningJob.getMaxCpu() - runningJob.getCurrentTime() == 0) {
terminateJob(runningJob);
}
drumJob = drum.manageDrum(drumJob);
// drum.moveToQueue(jobs);
runningJob = cpu.schedule(jobs, a, p);
}
public static void Svc (int []a, int []p){
// System.out.println("Service Int");
bookKeeper(p[5]);
switch(a[0]){
case 5:
terminateJob(runningJob);
break;
case 6:
ioJob = io.requestIO(runningJob);
break;
case 7:
if(io.IOQueue.contains(runningJob)) {
runningJob.setBlocked(true);
}
break;
}
drumJob = drum.manageDrum(drumJob);
// drum.moveToQueue(jobs);
runningJob = cpu.schedule(jobs, a, p);
return;
}
public static void bookKeeper(int time) {
if(!(runningJob.getNumber() == -1 && runningJob.isLatched())) {
int difference = time - systemTime;
runningJob.setCurrentTime(runningJob.getCurrentTime() + difference);
systemTime = time;
}
}
public static Job getJobByNumber(ArrayList<Job> jobs, int number) {
ListIterator<Job> itr = jobs.listIterator();
while(itr.hasNext()) {
Job job = itr.next();
if(job.getNumber() == number) {
return job;
}
}
return new Job();
}
public static void terminateJob(Job runningJob) {
if( !(runningJob.getNumber() == -1) && !io.IOQueue.contains(runningJob)) {
memory.removeJob(runningJob.getLocation(), runningJob.getSize());
jobs.remove(runningJob);
// runningJob.remove();
memory.displayMemoryTable();
} else if (!(runningJob.getNumber() == -1)) {
runningJob.setTerminated(true);
}
return;
}
public static void cleanJobTable(ArrayList<Job> jobs) {
ArrayList<Job> toRemove = new ArrayList<Job>();
for( Job j : jobs ) {
if (j.isTerminated() && !io.IOQueue.contains(j)) {
memory.removeJob(j.getLocation(), j.getSize());
toRemove.add(j);
}
}
for(Job remove : toRemove) {
jobs.remove(remove);
}
}
public static void displayJobTable() {
System.out.println("++++++++++++++++++++++++++++++++++++++++++++++++++++++");
System.out.println("| number \t| location \t| size \t| in memory \t|");
for(Job entry : jobs) {
System.out.println("| " + entry.getNumber() + "\t\t| " + entry.getLocation() + "\t\t| " + entry.getSize() + "\t|" + entry.isInMemory() + "\t\t|");
}
System.out.println("++++++++++++++++++++++++++++++++++++++++++++++++++++++");
}
}
| akatz/SOS | os.java |
1,261 | import java.util.Scanner;
//In a 2D Array, array[row][column]
public class GE {
public static String[][] image; //The array which we will work on.
public static void I(int M,int N) //Creates an array with the dimensions provided.
{
image=new String[N][M];
for (int i=0;i<N;i++)
{
for(int j=0;j<M;j++)
image[i][j]="0";
}
}
public static void C()
{
if(image.length!=0) //Checking if it isn't null
for(int i=0;i<image.length;i++)
{
for(int j=0;j<image[i].length;j++)
image[i][j]="0";
}
}
public static void L(int X,int Y,String C)
{
if(image.length!=0)
if(C.length()==1)
image[Y-1][X-1]=C;
}
public static void V(int X,int Y1, int Y2,String C)
{
if(image.length!=0)
for(int i=Y1-1;i<=Y2-1;i++)
image[i][X-1]=C;
}
public static void H(int Y,int X2,int X1,String C)
{
if(image.length!=0)
for(int i=X1;i<X2;i++)
image[Y-2][i]=C;
}
public static void K(int X1, int Y1, int X2, int Y2, String C)
{
if(image.length!=0)
for(int i=X1-1;i<X2-1;i++)
{
for(int j=Y1-1;j<Y2-1;j++)
image[j][i]=C;
}
}
/*According to the question,function F(X,Y,C) does the following:-
* Fill the region R with the color C, where R is
* defined as follows. Pixel (X, Y ) belongs to R.
* Any other pixel which is the same color as pixel (X, Y ) and shares
* a common side with any pixel in R also belongs to this region.
*
* Therefore When this function is called, the entire "Image" is set to color C.
*/
public static void F(String C)
{
if(image.length!=0)
for(int i=0;i<image.length;i++)
{
for(int j=0;j<image[i].length;j++)
image[i][j]=C;
}
}
public static void S(String Name)
{
System.out.println(Name);
if(image.length!=0) //Checking if it isn't null
for(int i=0;i<image.length;i++)
{
for(int j=0;j<image[i].length;j++)
System.out.print(image[i][j]);
System.out.println("");
}
}
public static void Print()
{
System.out.println(" The first argument is no. of COLUMNS and the second one is no. of ROWS");
System.out.println("");
System.out.println("I M N - Create a new M × N image with all pixels initially colored white (O).");
System.out.println("C - Clear the table by setting all pixels white (O). The size remains unchanged.");
System.out.println("L X Y C - Colors the pixel (X, Y ) in color (C).");
System.out.println("V X Y1 Y2 C - Draw a vertical segment of color (C) in column X, between the rows Y 1 and Y 2 inclusive.");
System.out.println("H X1 X2 Y C - Draw a horizontal segment of color (C) in the row Y, between the columns X1 and X2 inclusive.");
System.out.println("K X1 Y1 X2 Y2 C - Draw a filled rectangle of color C, where (X1,Y1) is the upper-left and (X2, Y 2) the lower right corner.");
System.out.println("F C - Colors the entire image with color C");
System.out.println("S Name - Write the file name in MSDOS 8.3 format followed by the contents of the current image.");
System.out.println("X - Terminate the session.");
System.out.println("P - Re-Prints this info. guide.");
}
public static void decideFunction(String func)
{
func=func.toUpperCase();
String [] array=func.split(" ");
//Okay, this would have been a lot better if switch statement worked with Strings.
//All I am doing heres is calling method based on the Input.
if(array[0].equals("I"))
I(Integer.parseInt(array[1]),Integer.parseInt(array[2]));
else if(array[0].equals("C"))
C();
else if(array[0].equals("L"))
L(Integer.parseInt(array[1]),Integer.parseInt(array[2]),array[3]);
else if(array[0].equals("V"))
V(Integer.parseInt(array[1]),Integer.parseInt(array[2]),Integer.parseInt(array[3]),array[4]);
else if(array[0].equals("H"))
H(Integer.parseInt(array[1]),Integer.parseInt(array[2]),Integer.parseInt(array[3]),array[4]);
else if(array[0].equals("K"))
K(Integer.parseInt(array[1]),Integer.parseInt(array[2]),Integer.parseInt(array[3]),Integer.parseInt(array[4]),array[5]);
else if(array[0].equals("F"))
F(array[1]);
else if(array[0].equals("S"))
S(array[1]);
else if(array[0].equals("P"))
Print();
else
System.out.println("Invalid Input (But don't worry, The program won't termiante untill you press 'X').");
}
public static void main(String[] args)
{
Print();
Scanner scan=new Scanner(System.in);
String ifXorNot=scan.nextLine();
int count=1;
while(!ifXorNot.equals("X"))
{
String StringToBeChecked;
if(count==1)
{
StringToBeChecked=ifXorNot;
decideFunction(StringToBeChecked);
count++;
}
else
{
StringToBeChecked=scan.nextLine();
decideFunction(StringToBeChecked);
ifXorNot=StringToBeChecked;
}
}
}
}
| dhruvramani/Puzzles | GE.java |
1,262 | class ListNode {
int val;
ListNode next;
ListNode(int val) {
this.val = val;
}
}
public class LL {
// Reverse Linked List
public ListNode reverseList(ListNode head) {
ListNode prev = head;
ListNode curr = head.next;
head.next = null;
while (curr != null) {
ListNode nextNode = curr.next;
// break connection with forward node and re-make connection with backward node
curr.next = prev;
// increase one step
prev = curr;
curr = nextNode;
}
// head.next=prev;
return prev;
}
// Print Linked List
public static void PrintLL(ListNode head) {
if (head == null) {
System.out.println("Linked List is empty");
return;
}
ListNode tempNode = head;
while (tempNode != null) {
System.out.print(tempNode.val + "->");
tempNode = tempNode.next;
}
System.out.println("null");
}
public static void main(String[] args) {
ListNode head = new ListNode(1);
LL l1 = new LL();
head.next = new ListNode(2);
head.next.next = new ListNode(3);
head.next.next.next = new ListNode(4);
head.next.next.next.next = new ListNode(5);
l1.PrintLL(head);
head = l1.reverseList(head);
l1.PrintLL(head);
}
}
| Akshaypatel1812/Java-with-DSA | LL.java |
1,264 | package com.tgt.igniteplus;
import java.util.Scanner;
public class Q1
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
System.out.println("Enter the number of rows of pattern to be printed");
int rows = sc.nextInt();
for (int i = 1; i <= rows; i++)
{
for (int j = 1; j <= i; j++)
{
System.out.print("*"+" ");
}
System.out.println();
}
sc.close();
}
}
/*
Enter the number of rows of pattern to be printed
5
*
* *
* * *
* * * *
* * * * *
Process finished with exit code 0
*/ | IgnitePlus2020/Prakruthi_Assignment1 | Q1.java |
1,265 | package com.tgt.igniteplus;
import java.util.Scanner;
public class Q2
{
public static void main(String[] args)
{
int n;
System.out.print("Enter the number of rows to be printed\n ");
Scanner in=new Scanner(System.in);
n=in.nextInt();
for (int i=0; i<n; i++){
for (int j=n-i; j>1; j--){
System.out.print(" ");
}
for (int j=0; j<=i; j++ ) {
System.out.print("* ");
}
System.out.println();
}
}
}
/*
Enter the number of rows to be printed
5
*
* *
* * *
* * * *
* * * * *
Process finished with exit code 0
*/ | IgnitePlus2020/Prakruthi_Assignment1 | Q2.java |
1,266 | /* Associative memory class
With locality sensitive hashing (LSH) only a few bits change with a small change in input.
Here in each dimension some output bits of a LSH (-1,1 bipolar) are weighted and summed.
For a particular input the weights are easily (and equally) adjusted to give a required output.
For a previously stored value retrived again the newly stored adjustment will tend to cancel
out to zero (with a Gaussian noise residue), assuming the LHS bit response to the two inputs
is quite different bit-wise. Density less than about 20 will cause quantization like errors
due to binary switching.
*/
package data.reservoir.compute.ai;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.Serializable;
import java.util.Arrays;
public final class AM implements Serializable {
private final int vecLen;
private final int density;
private final long hash;
private final float[][] weights;
private transient float[][] bipolar;
private final float[] workA;
private final float[] workB;
// vecLen must be 2,4,8,16,32.....
// density is the maximum number of vector pairs that can be associated with
// repeated training.
public AM(int vecLen, int density) {
this.vecLen = vecLen;
this.density = density;
hash = System.nanoTime();
weights = new float[density][vecLen];
bipolar = new float[density][vecLen];
workA = new float[vecLen];
workB = new float[vecLen];
}
public void recallVec(float[] resultVec, float[] inVec) {
System.arraycopy(inVec, 0, workA, 0, vecLen);
Arrays.fill(resultVec, 0f);
for (int i = 0; i < density; i++) {
WHT.fastRP(workA, hash + i);
WHT.signOf(bipolar[i], workA);
VecOps.multiplyAddTo(resultVec, weights[i], bipolar[i]);
}
}
public void trainVec(float[] targetVec, float[] inVec) {
float rate = 1f / density;
recallVec(workB, inVec);
for (int i = 0; i < vecLen; i++) {
workB[i] = (targetVec[i] - workB[i]) * rate; //get the error term in workB
}
for (int i = 0; i < density; i++) { // correct the weights
VecOps.multiplyAddTo(weights[i], workB, bipolar[i]); // to give the required output
}
}
public void reset() {
for (float[] x : weights) {
Arrays.fill(x, 0f);
}
}
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
in.defaultReadObject();
bipolar=new float[density][vecLen];
}
}
| codeaudit/Data-Reservoir-Compute-AI | AM.java |
1,268 | import java.util.Scanner;
public class dd{
// ...
private static void inputDataPasien(Scanner sc) {
System.out.println("Input Data Pasien");
System.out.print("Masukkan Jumlah Pasien Hari Ini : ");
int jmlPasien = sc.nextInt();
sc.nextLine();
String[][] dataPasien = new String[jmlPasien][12];
int[][] biayaTot = new int[jmlPasien][1];
for (int i = 0; i < jmlPasien; i++) {
System.out.println("Masukkan Data Pasien Ke - " + (i + 1));
// ... (other data input)
System.out.println("Masukkan Jenis Pelayanan ");
dataPasien[i][6] = jenisPelayanan(sc);
// ... (continue with other data input)
// ... (continue with other data input)
System.out.println("Masukkan Gejala Pasien : ");
// Assuming gejalaPasien is a String variable, you can modify accordingly
String gejalaPasien = sc.next();
dataPasien[i][7] = gejalaPasien;
// ... (continue with other data input)
System.out.println("Apakah Penyakit Parah ? (ya / tidak) : ");
dataPasien[i][8] = sc.next();
int hargaSatuHari = 0;
if (dataPasien[i][8].equalsIgnoreCase("ya")) {
// ... (continue with other data input)
} else {
System.out.println("Anda Tidak Perlu Rawat Inap, Silahkan Menuju Apotek untuk mengambil obat");
}
}
// ... (continue with the rest of your code)
}
private static String jenisPelayanan(Scanner sc) {
System.out.println("Pilih jenis pelayanan");
System.out.println("1. Asuransi kesehatan swasta");
System.out.println("2. Asuransi kesehatan pemerintah");
int pilihan = sc.nextInt();
sc.nextLine(); // consume the newline character
String jenisPelayanan = "";
if (pilihan == 1) {
jenisPelayanan = "Asuransi Kesehatan Swasta";
} else if (pilihan == 2) {
jenisPelayanan = "Asuransi Kesehatan Pemerintah";
} else {
System.out.println("Pilihan tidak valid. Silahkan coba lagi,");
jenisPelayanan = jenisPelayanan(sc); // recursively call itself
}
return jenisPelayanan;
}
// ...
}
| ardheliapm/BookingRumahSakit | dd.java |
1,269 |
/**
* class AI is the mastermind class behind the artificial intelligence used by the computer; Through the course of the game,
* the computer uses it to decide wether to roll or to hold in a particular turn. It deals with varying difficulty levels :
* easy, medium and hard (which is chosen by the user at the beginning of the game). In the 'easy' difficulty level, the computer
* plays a fairly random game, whereas in the 'medium' level and 'hard' level, the computer plays a very calculated game and decides
* based on three factors :
* <ol>
* <li> The Computer's total score (comp.totalScore),
* <li> The Computer's score accumulated in this turn so far (comp.turnScore), and
* <li> The User's total score as of his/her last turn. (human.totalScore).</ol>
*
* Further interestingly, the basic mechanism of AI in the medium and hard levels are similar, except that in the 'hard' level,
* rather than making a more calculated decision as to roll or hold, the PROBABILITY of the computer rolling a 1 is reduced by
* half, carried out by the hardRoll() method in the Dice class.
*
* @author Athyuttam Reddy Eleti
* @version 2.80
*/
public class AI
{
/**
* compChoose : This method , depending on the difficulty level chosen by the user, the user's total score,
* the computer's total score and the computer's turn score, decides wether to roll or to hold in a particular turn.
* The Artificial Intelligence itself , therefore , is :
* <ul>
* <li> Difficulty Level Easy : In the easy difficulty level, the AI used by the computer is fairly random. The optimal limit for a
* turn's score lies between 15 and 25. Anything below this is too less an accumulation for that particular turn and anything
* above can be considered too big a risk. Therefore, a random integer within the range 15-25 is obtained and the computer
* rolls until it equals or crosses the set limit; unless of course,if it reaches 100. Thus, essentially, the computer works
* on an AI where the turn score is the only concern and defines optimal play.
*
* <li> Difficulty Level Medium : The medium level shares it's code with the hard level and thus is set as the default case
* when not easy in the switch statement in the method. In the medium difficulty level, the AI works upon two main clauses : If the computer's
* totalScore + turnScore (int cPS) is greater than the player's score ; or the player's score is greater than the cPS.
* In the first clause (cPS > human.totalScore), the following conditionals determine the decision :
* <ol>
* <li> if (100 - human.totalScore <= 18) return 'r'; This indicates that the human's total score is within 18 of 100,
* that is to say, he is VERY CLOSE TO WINNING THE GAME, and thus, since the computer should not resort to any strategy
* but to roll and try to beat the player, it rolls.
*
* <li> if(comp.turnScore >= 25) return 'h'; Since execution has come to this statement, it means that the human is fairly away
* from reaching a 100 (>18) and thus the computer must take it's turn score into accomodation. If in this case, where
* there is no urgency to roll and beat the player, the computer checks if it is risking too much for too little. If the
* turn score is already >=25 , then at anytime a 1 could be rolled and the whole score wasted. Thus, when the human is
* fairly far away from a 100, and the computer is risking too much, the computer holds.
*
* <li> if(human.totalScore - cPs < 18 && comp.turnScore >=15) return 'h' ; Here, the computer looks at it's difference from
* the human in score and at the same time, it's own turn score. (human.totalScore - cPS < 18) implies that the computer
* is not too far away from the human and (comp.turnScore>=15) checks if the computer is risking too much. Thus, if the
* computer is in a healthy stage where it is not too far away from the human, it must not risk too much of it's turn
* score, and thereby hold.
*
* <li> In this clause, if all the above sub-clauses are bypassed, the computer still remains at a score below that of the user.
* Therefore, when the computer is losing, the obvious reaction is to roll and try to catch up, which is exactly what is done
* through (else return 'r';). However, keep in mind that this is executed only if the above statements are not executed.
* </ol>
*
* In the second clause (cPS > human.totalScore && human.totalScore >=5), the computer is ahead of the user and the user himself
* is not at a score less than 5 (which could indicate either his very first turn or a very early turn). If he had been less than
* the computer would have applied AI which is unnecessary, for at this early stage of the game, a good accumulation of score is
* the main aim. Therefore, if this clause is bypassed (either the two players' scores are equal, or human's totalScore < 5), the
* computer resorts to AI used in the easy difficulty level, aiming at accumulation score. This clause has two
* sub-clauses, which decide the roll or hold :
* <ol>
* <li> if ((100 - cPS) <= 8 && cPS-human.totalScore <= 10 ) return 'r'; : (100 - cPS <=8) indicates that the computer is very
* close to reaching 100 and (cPS-human.totalScore <=10) indicates that at the same time, the human is fast on the computer's
* heels, within a range of 10. In this crucial stage of the game, where both players have a very high chance of winning
* the game, it makes sense to roll and try to get to a 100 before the other. This is safer for the computer has an advantage
* that the current turn is it's , thus it can try to win the game. Thus, it rolls in this condition.
*
* <li> if (cPS-human.totalScore >=10 && comp.turnScore >=15) return 'h'; Since execution has come to this stage,this indicates
* both players are not necessarily very close to winning. Thus, the computer must take into account it's own turn score
* and check if it is risking too much. Hence, (cPS-human.totalScore >= 10) indicates that the human is at a fair distance
* away from the computer(>=10) and (comp.turnScore >=15) indicates that the computer's turnScore is a considerable amount
* (15 or more). Thus, if the conditional is true, the computer must not risk too much of it's turn score while in a fairly
* safe positon, and thereby hold.
* </ol>
* As mentioned previously, if both clauses fail, (either both scores are equal, or the second clause is false(due to human.totalScore
* < 5)) the computer retorts to the strategy of accumulating points, which is also used in the easy difficulty level. If both
* scores are equal, it is as though the computer is back at square one, with noone winning the game. Thus, it must try and gather
* score and outrun the human. If the computer's score is greater than the human's, and the human's score is minimal(<5), the computer
* tries and builds up a lead and resorts to this strategy.
* This strategy essentially takes a random integer within a range of 15-25, and rolls until it equals or exceeds this random number,
* ensuring a decent collection of score every turn.
*
*<li> Difficult Level Hard : The hard difficulty level essentially works on the same strategy as that of the medium level, but what
* makes the play harder for the user is the cheating involved. In this level, the dice of the computer, generally rolled by the
* randomRoll() method in the Dice class, is rolled by the hardRoll() method instead. The hardRoll() method, as described in the
* Dice class itself, DECREASES the probability of a 1 on the dice from 16.66 % to 8 % . Thus, the computer has a lot lesser
* chances to lose the turn, and accumulates considerably more amount of points. This makes the game harder for the player.
* As far as the returning of 'r' or 'h' itself, the hard levels shares it's code with the medium level and is hence set
* as the default case in the switch statemnt in the method.
*
*</ul>
*
*
* @param diff A character indicating the difficulty level chosen by the user, 'e' for easy, 'm' for medium and 'h' for hard.
* @param comp The Player object indicating the computer, referred to for the computer's total score and it's turn score.
* @param human The Player object indicating the human, referred to for the human's total score.
*
* @return A character 'r' or 'h' indicating roll or hold respectively.
*/
public static char compChoose(char diff, Player comp, Player human)
{
int withinRange = randomInt(15,25);
int cPS = comp.turnScore + comp.totalScore ;
if(cPS >= 100) return 'h';
switch(diff)
{
case 'e':
if (comp.turnScore < withinRange) return 'r';
else return 'h';
default:
if (human.totalScore > cPS) {
if (100 - human.totalScore <= 18)
return 'r';
if (comp.turnScore >= 25)
return 'h';
if (human.totalScore - cPS < 18 && comp.turnScore >=15)
return 'h';
return 'r';
}
if (cPS > human.totalScore && human.totalScore >=5) {
if ((100 - cPS) <= 8 && cPS-human.totalScore <= 10 )
return 'r';
if (cPS-human.totalScore >=10 && comp.turnScore >=15)
return 'h';
}
if (comp.turnScore < withinRange)
return 'r';
else
return 'h';
}
}
/**
* randomInt : This method returns a random integer within a range of two integers(inclusive). Thus, it is used to
* return a random integer between 15 and 25 , a range within which the limit for the turn score optimally should stand. Thus, in the easy
* level, the computer rolls upto this random integer, and then holds . Using the Math.random() function, a random double
* is created, which is then used to create a random integer within the range.
*
* @param low The lower boundary of the range (inclusive) to realise a random integer.
* @param high The higher boundary of the range (inclusive) to realise a random integer.
*
* @return A random integer within the range of 'low' and 'high' (inclusive).
*/
public static int randomInt (int low, int high)
{
double random = Math.random() ;
double randomWithin = (random * (high-low+1)) + low ;
int value = (int) randomWithin ;
return value ;
}
}
| athyuttamre/greedy-pig | AI.java |
1,271 | import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
class Student {
private int studentID;
private String name;
private double score;
public Student(int studentID, String name, double score) {
this.studentID = studentID;
this.name = name;
this.score = score;
}
public int getStudentID() {
return studentID;
}
public String getName() {
return name;
}
public double getScore() {
return score;
}
}
public class StudentDatabase {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("No of Students: ");
int numStudents = scanner.nextInt();
List<Student> studentList = new ArrayList<>();
for (int i = 1; i <= numStudents; i++) {
System.out.println("Student " + i + " :");
System.out.print("Enter Student Id: ");
int studentID = scanner.nextInt();
System.out.print("Enter Student Name: ");
String name = scanner.next();
System.out.print("Enter Student Score: ");
double score = scanner.nextDouble();
studentList.add(new Student(studentID, name, score));
}
if (studentList.isEmpty()) {
System.out.println("No students in the database.");
} else {
double averageScore = getAverageScore(studentList);
System.out.println("Average Score: " + averageScore);
Student topScorer = getTopScorer(studentList);
System.out.println("Top Scorer:");
System.out.println("Student ID: " + topScorer.getStudentID());
System.out.println("Name: " + topScorer.getName());
System.out.println("Score: " + topScorer.getScore());
double passScore = 70.0; // You can change this passing score as needed.
System.out.println("Students with a score greater than or equal to " + passScore + ":");
List<Student> passingStudents = getStudentsWithPassingScore(studentList, passScore);
for (Student student : passingStudents) {
System.out.println("Student ID: " + student.getStudentID());
System.out.println("Name: " + student.getName());
System.out.println("Score: " + student.getScore());
System.out.println();
}
}
}
public static double getAverageScore(List<Student> students) {
return students.stream()
.mapToDouble(Student::getScore)
.average()
.orElse(0.0);
}
public static Student getTopScorer(List<Student> students) {
return students.stream()
.max((s1, s2) -> Double.compare(s1.getScore(), s2.getScore()))
.orElse(null);
}
public static List<Student> getStudentsWithPassingScore(List<Student> students, double passScore) {
return students.stream()
.filter(student -> student.getScore() >= passScore)
.toList();
}
}
| Rajesh2754/java-assignment | student |
1,272 | import java.util.Scanner;
class h8 {
// Data Members
private String depositorName;
private int accountNumber;
private String accountType;
private double balance;
// Constructor
public h8(String depositorName, int accountNumber, String accountType) {
this.depositorName = depositorName;
this.accountNumber = accountNumber;
this.accountType = accountType;
this.balance = 10000; // Initial balance is assumed to be Rs. 10000
}
// Method to read account details
public void readAccountDetails() {
Scanner scanner = new Scanner(System.in);
System.out.print("Enter Depositor Name: ");
this.depositorName = scanner.nextLine();
System.out.print("Enter Account Number: ");
this.accountNumber = scanner.nextInt();
scanner.nextLine(); // Consume the newline character
System.out.print("Enter Account Type (Savings/Current): ");
this.accountType = scanner.nextLine();
}
// Method to deposit amount
public void deposit(double amount) {
if (amount > 0) {
this.balance += amount;
System.out.println("Amount deposited successfully.");
} else {
System.out.println("Invalid deposit amount. Please enter a positive amount.");
}
}
// Method to withdraw amount
public void withdraw(double amount) {
if (amount > 0) {
if (this.balance - amount >= 500) {
this.balance -= amount;
System.out.println("Amount withdrawn successfully.");
} else {
System.out.println("Insufficient balance. Minimum balance should be Rs. 500.00.");
}
} else {
System.out.println("Invalid withdrawal amount. Please enter a positive amount.");
}
}
// Method to display balance
public void displayBalance() {
System.out.println("Account Balance: Rs. " + this.balance);
}
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
// Assuming an initial balance of Rs. 10000
h8 account = new h8("John Doe", 123456, "Savings");
// Display initial balance
account.displayBalance();
// Read account details
account.readAccountDetails();
// Deposit and display balance
System.out.println("Enter the amount to deposit:");
double am=scanner.nextDouble();
account.deposit(am);
account.displayBalance();
// Withdraw and display balance
System.out.println("Enter the amount to withdraw:");
double ww=scanner.nextDouble();
account.withdraw(ww);
account.displayBalance();
}
}
| Saisrinivas122/CSA0942-PROGRAMMING-IN-JAVA | h8.java |
1,273 | import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.Random;
import java.util.Scanner;
/**
* This is the combat system. It allows players to engage in battles with enemies
*
* @author Team 7 : Alejandro Rodriguez, Donritchie Ewane, Isaac Borjon, Jesus Lopez
*/
public class vs {
public static String username_holder;
public static int i=0;
public static int vida;
public static gameUtilities Utility = new utilities();
/**
* This throws an exception if an enemy is not found or created in the csv file
* @throws IOException if an error occurs while creating enemy
*/
public static void token_Enemies()throws IOException {
Scanner file= new Scanner(new File("Enemies.csv"));
String header = file.nextLine(); //reading header, just to erase it
while(file.hasNextLine()){
String holder = file.nextLine();
String [] a = holder.split(",");
try {
create_Enemies(a[0],Integer.parseInt(a[1]) , Integer.parseInt(a[2]));
} catch (IOException ioe) {
ioe.getMessage();
}
System.out.flush();
}
}
/**
* HashMap to store enemies
*/
public static HashMap <Integer, Enemies> Enemies_map = new HashMap<Integer, Enemies>();
/**
* Creates an enemy with specified name, health, and damage.
* @param name the name of the enemy
* @param health The health points of the enemy
* @param damage The damage dealt by the enemy
* @throws IOException if an error occurs while creating enemy
*/
public static void create_Enemies(String name, int health, int damage)throws IOException{
Enemies en1 = new Enemies(name, health, damage);
Enemies_map.put(i, en1);
i++;
}
/**
* Sets the current username
* @param userm the name to be set
*/
public static void handle_username(String userm){
username_holder=userm;
}
/**
* Initializes a fight using the current username
* @throws IOException if an error occurs when initializing the fight
*/
public static void ini_fight()throws IOException{
ini_fight(username_holder);
}
/**
* Item inventory for the player
*/
public static item_inventory inv = new item_inventory();
/**
* Sets the player's inventory with the provided item inventory
* @param a is the item to be set
*/
public static void get_inv(item_inventory a){
inv = a;
}
/**
* Initates a fight with the user
* @param username The username of the player
* @throws IOException if an error occurs durring the ffight initialization.
*/
private static void ini_fight (String username)throws IOException{
//user stats
player player = Utility.getUser_records().get(username).getPlayer();
int Phealth = player.get_health() ;
double Pdamage = player.get_damage();
int Ppotions = player.get_heal_potion();
int PpotionHeal = 30;
int runLuck = 0;
int has_poison = player.player_effect.poison;
//inputs and randoms
token_Enemies();
Scanner in = new Scanner(System.in);
Random rand = new Random();
//enemy stats
int enemyNum = rand.nextInt(6);
String Ename = Enemies_map.get(enemyNum).getName();
int Edamage = Enemies_map.get(enemyNum).getDamage();
int Ehealth = Enemies_map.get(enemyNum).getHealth();
//items stats
item_inventory items = player.gItem_inventory();
items = inv;
int Isword = items.get_sword();
int Iheal_potion = items.get_heal_potion();
int Iclear_potion = items.get_clear_potion();
int Ismokebomb = items.get_smokebomb();
int Icoin = items.get_coins();
boolean fighting = true;
FIGHT:
while (fighting){
System.out.println("----------------------------------------------------");
System.out.println("\t# " + Ename + " has appeared! #\n");
while (Ehealth > 0){
System.out.print("\t Your healt is " + Phealth + "\n");
System.out.println("\t" + Ename + "'s healt is " + Ehealth);
System.out.println("\n\tWhat would you like to do?");
System.out.println("\t1. Attack");
System.out.println("\t2. Use item from inventory");
System.out.println("\t3. Run!");
String input = in.nextLine();
//ENEMY
if (input.equals("1")){
double damageDealt = Pdamage;
int damageTaken = Edamage;
// if(Ename.equals("Snake")){
// int random_poison = rand.nextInt(100);
// has_poison = player.player_effect.poison_effect();
// }
if(has_poison==1){
System.out.println("#####################################################");
System.out.println("\t> You are poisoned, you recieve 15 damage!");
System.out.println("#####################################################");
Phealth -= 15;
}
Ehealth -= damageDealt;
Phealth -= damageTaken;
System.out.println("#####################################################");
System.out.println("\t> You strike the " + Ename + " for " + damageDealt + " damage.");
System.out.println("\t> You recieve " + damageTaken + " in retaliation!");
System.out.println("#####################################################");
if (Phealth < 1){
System.out.println("\t> You have taken too much damage, you are too weak to go on!");
break;
}
}
else if (input.equals("2")){
if (Iheal_potion > 0 || Iclear_potion>0 || Ismokebomb>0 ||Isword>0){
System.out.println("after the 2");
System.out.println("\t your items are: ");
System.out.println("\t1. Swords: " + Isword);
System.out.println("\t2. Heal potions: " + Iheal_potion);
System.out.println("\t3. Clear potions: " + Iclear_potion);
System.out.println("\t4. Smoke bombs: " + Ismokebomb);
System.out.println("\t7. Back");
System.out.println("\t> What item would you like to use? ");
String input2 = in.nextLine();
if(input2.equals("1") && !(items.get_sword() <=0)){
player.set_damage(Pdamage * 1.5);
System.out.println("\t> You have used a sword, your damage is now " + player.get_damage()+" !!!");
items.set_sword(Isword-1);
Isword = items.get_sword();
}else if (input2.equals("2") && !(items.get_heal_potion()<=0)){
player.set_health(Phealth + PpotionHeal);
System.out.println("\t> You drink a health potion, healing yourself for " + PpotionHeal + "." + "\n\t> You now have " + player.get_health()+ " HP.");
items.set_heal_potion(Iheal_potion-1);
Phealth = player.get_health();
Iheal_potion = items.get_heal_potion();
}else if(input2.equals("3")&& !(items.get_clear_potion()<=0)){
items.set_clear_potion(Iclear_potion-1);
Iclear_potion = items.get_clear_potion();
//clear efects
}else if (input2.equals("4")&& !(items.get_smokebomb()<=0)){
items.set_smokebomb(Ismokebomb-1);
int random_run = rand.nextInt(100);
runLuck = player.player_effect.get_luck() + 40;
player.player_effect.set_luck(runLuck);
System.out.println("\t> You have used a smoke bomb, your luck is now " + player.player_effect.get_luck()+" !!!");
Ismokebomb = items.get_smokebomb();
}
} else{
System.out.println("\t> you don't have any items left! Search chests for the possibility of a health potion!\n");
}
}
else if (input.equals("3")){
if ( runLuck > 70){
System.out.println("\tYou run away from the " + Ename + "!");
break;
}
else{
System.out.println("\tYou failed to run away from the " + Ename + "!");
int damageTaken = Edamage;
Phealth -= damageTaken;
System.out.println("\t> You recieve " + damageTaken + " in retaliation!");
if (Phealth < 1){
System.out.println("\t> You have taken too much damage, you are too weak to go on!");
break;
}
}
}
else{
System.out.println("\tInvalid command!");
}
}
if (Phealth < 1){
System.out.println("You limp out of the dungeon, weak from battle.");
System.out.println(" \t ####### GAME OVER ####### \n");
//CALL THE LOG WITH THE DEAD USER
log log = new log();
log.loger(Ename + " killed " + username_holder + " in battle");
System.exit(0);
}
System.out.println("----------------------------------------------------");
System.out.println(" # " + Ename + " was defeated! # ");
player.set_health(Phealth);
System.out.println(" # You have " + player.Health + " HP left. #");
int holder = rand.nextInt(9);
player.set_coins(holder);
System.out.print(" # you have found " + holder+ " coins # ");
System.out.println(" # your total coins are " + player.get_coins()+" # ");
vida = player.Health;
System.out.println("----------------------------------------------------");
System.out.println("Press 1 to continue the adventure!");
String input = in.nextLine();
while (!(input.equals("1"))){
System.out.println("Invalid command!");
input = in.nextLine();
}
if (input.equals("1")){
System.out.println("You continue your adventure!");
break;
}
else{
System.out.println("Invalid command!");
break;
}
}
}
}
| NotSamus/Dungeon-Crawler | vs.java |
1,274 | #!/usr/bin/env jbang
//DEPS info.picocli:picocli:4.5.0
//DEPS info.picocli:picocli-codegen:4.5.0
//DEPS io.fabric8:kubernetes-client:4.13.0
//DEPS com.massisframework:j-text-utils:0.3.4
import dnl.utils.text.table.TextTable;
import io.fabric8.kubernetes.client.DefaultKubernetesClient;
import io.fabric8.kubernetes.client.KubernetesClient;
import io.fabric8.kubernetes.client.utils.PodStatusUtil;
import picocli.CommandLine;
import picocli.CommandLine.Command;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.stream.Collectors;
@Command(name = "lp", mixinStandardHelpOptions = true, version = "lp 0.1",
description = "list pods made with jbang")
class lp implements Callable<Integer> {
// https://www.fileformat.info/info/unicode/char/search.htm?
private static final String CHECK_MARK = "\u2705";
private static final String FIRE = "\uD83D\uDD25";
public static void main(String... args) {
int exitCode = new CommandLine(new lp()).execute(args);
System.exit(exitCode);
}
@Override
public Integer call() throws Exception {
printTable(getPods());
return 0;
}
private static List<PodInfo> getPods() {
KubernetesClient kc;
try {
kc = new DefaultKubernetesClient();
} catch (Exception e) {
throw new RuntimeException("Unable to create default Kubernetes client", e);
}
return kc.pods().list().getItems().stream().map(pod -> {
PodInfoState state = PodStatusUtil.isRunning(pod) ? PodInfoState.RUNNING : PodInfoState.FAILING;
String message = null;
if (!state.equals(PodInfoState.RUNNING)) {
message = PodStatusUtil.getContainerStatus(pod).get(0).getState().getWaiting().getMessage();
}
return new PodInfo(pod.getMetadata().getName(), state, message);
}).collect(Collectors.toList());
}
static class PodInfo {
private final String name;
private final PodInfoState state;
private final String message;
public PodInfo(String name, PodInfoState state, String message) {
this.name = name;
this.state = state;
this.message = message;
}
public String getName() {
return name;
}
public PodInfoState getState() {
return state;
}
public String getMessage() {
return message;
}
}
enum PodInfoState {
RUNNING,
FAILING
}
private static void printTable(List<PodInfo> list) {
final Object[][] tableData = list.stream()
.map(podInfo -> new Object[]{
podInfo.getState().equals(PodInfoState.RUNNING) ? CHECK_MARK : FIRE,
podInfo.getName(),
podInfo.getState(),
podInfo.getMessage()
})
.toArray(Object[][]::new);
String[] columnNames = {"", "name", "state", "message"};
new TextTable(columnNames, tableData).printTable();
}
}
| ikwattro/kubectl-plugin-java-jbang | lp.java |
1,275 | package soot_call_graph.test;
import java.io.IOException;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.xmlpull.v1.XmlPullParserException;
import soot_call_graph.test.CGExporter;
import soot.MethodOrMethodContext;
import soot.PackManager;
import soot.Scene;
import soot.SootClass;
import soot.SootMethod;
import soot.jimple.infoflow.InfoflowConfiguration.CallgraphAlgorithm;
import soot.jimple.infoflow.android.InfoflowAndroidConfiguration;
import soot.jimple.infoflow.android.SetupApplication;
import soot.jimple.toolkits.callgraph.CallGraph;
import soot.jimple.toolkits.callgraph.Edge;
import soot.jimple.toolkits.callgraph.Targets;
import soot.options.Options;
public class CGGenerator {
public final static String androidPlatformPath = "E:/flowdroid/android-platforms-master/android-platforms-master/";
public final static String appPath = "E:/flowdroid/SmartHome-DB-Sdk-Dev-78006-9.0.605-4059-develop-20231130.apk";
public final static String outputPath = "E:/flowdroid/sootOutput/";
public final static String sourceSinkFile = "E:/flowdroid/CallGraph_source.txt";
static Object ob = new Object();
private static Map<String,Boolean> visited = new HashMap<String,Boolean>();
private static CGExporter cge = new CGExporter();
public static void main(String[] args) throws IOException, XmlPullParserException{
// Provide the path to the APK file
String apkPath = "E:/flowdroid/SmartHome-DB-Sdk-Dev-77400-8.7.501-2066-develop-20230706.apk";
soot.G.reset();
Options.v().set_output_format(Options.output_format_jimple);
Options.v().set_allow_phantom_refs(true);
Options.v().set_process_dir(Collections.singletonList(apkPath));
Options.v().set_src_prec(Options.src_prec_apk);
Options.v().set_android_jars("E:/flowdroid/android-platforms-master/android-platforms-master/");
Options.v().set_whole_program(true);
Options.v().set_process_multiple_dex(true);
System.out.println("before Call Graph:");
// Load the APK file
Scene.v().loadNecessaryClasses();
// Build the call graph
PackManager.v().getPack("cg").apply();
CallGraph callGraph = Scene.v().getCallGraph();
// Print the call graph
System.out.println("Call Graph:");
// Print the call graph (you can customize the output format)
System.out.println(callGraph);
for (SootMethod method : Scene.v().getEntryPoints()) {
if (method.isConcrete()) {
Iterator<Edge> edges = cg.edgesOutOf(method);
while (edges.hasNext()) {
Edge edge = edges.next();
System.out.println(method + " -> " + edge.getTgt());
}
}
}
// final InfoflowAndroidConfiguration config = new InfoflowAndroidConfiguration();
// config.getAnalysisFileConfig().setTargetAPKFile(appPath);
// config.getAnalysisFileConfig().setAndroidPlatformDir(androidPlatformPath);
// config.setMergeDexFiles(true);
// // config.setCodeEliminationMode(InfoflowConfiguration.CodeEliminationMode.NoCodeElimination);
// config.setCallgraphAlgorithm(CallgraphAlgorithm.CHA); // CHA or SPARK
// SetupApplication app = new SetupApplication(config);
// System.out.print("before runInfoflow \n");
// Options.v().set_whole_program(true);
// Options.v().set_allow_phantom_refs(true);
// //app.runInfoflow(sourceSinkFile);
// System.out.print("before call graph\n");
// // Iterate over the methods and print their names
// app.constructCallgraph();
// CallGraph callGraph = Scene.v().getCallGraph();
// //SootMethod
// SootMethod entryPoint = app.getDummyMainMethod();
CallGraph cg = Scene.v().getCallGraph();
//visit(cg,entryPoint);
//cge.exportMIG("flowdroidCFG", outputPath);
//String className_pre = "com.tuya.smart.rnplugin.tyrctcameramanager.TYRCTCameraManager";
String className_pre = "com.xiaomi.router.miio.miioplugin$Stub";
SootClass sootClass = Scene.v().loadClassAndSupport(className_pre);
sootClass.setApplicationClass();
for (SootMethod method : sootClass.getMethods()) {
System.out.println(method.getSignature());
}
SootClass sootClass_new = Scene.v().forceResolve(className_pre, SootClass.BODIES);
if (sootClass_new.isPhantom()) {
System.out.println(className_pre + " does not exist in the APK.");
} else {
System.out.println(className_pre + " exists in the APK.");
}
SootClass sootClass1 = Scene.v().loadClassAndSupport(className_pre);
sootClass1.setApplicationClass();
// Get all methods in the class
List<SootMethod> methods = sootClass1.getMethods();
// Iterate over the methods and print their names
for (SootMethod method : methods) {
System.out.println("Method: " + method.getName());
}
className_pre = "com.xiaomi.router.miio.miioplugin";
sootClass_new = Scene.v().forceResolve(className_pre, SootClass.BODIES);
if (sootClass_new.isPhantom()) {
System.out.println(className_pre + " does not exist in the APK.");
} else {
System.out.println(className_pre + " exists in the APK.");
}
SootClass sootClass11 = Scene.v().loadClassAndSupport(className_pre);
sootClass11.setApplicationClass();
// Get all methods in the class
List<SootMethod> methods1 = sootClass11.getMethods();
// Iterate over the methods and print their names
for (SootMethod method : methods1) {
System.out.println("Method: " + method.getName());
}
//tuya
//String targetMethodName = "<com.tuya.smart.rnplugin.tyrctcameramanager.TYRCTCameraManager: void startPtzLeft()>";
// //Xiaomi
String targetMethodName = "<com.xiaomi.router.miio.miioplugin$Stub: boolean onTransact(int,android.os.Parcel,android.os.Parcel,int)>";
//String targetMethodName = "<com.bsgamesdk.android.BSGameSdk: void login(com.bsgamesdk.android.callbacklistener.CallbackListener)>";
// String targetMethodName = "<com.bsgamesdk.android.BSGameSdk: com.bsgamesdk.android.BSGameSdk initialize(boolean,android.app.Activity,java.lang.String,java.lang.String,java.lang.String,java.lang.String,android.os.Handler)>";
SootMethod targetMethod = Scene.v().grabMethod(targetMethodName);
if (targetMethod != null) {
Iterator<MethodOrMethodContext> ctargets = new Targets(callGraph.edgesInto(targetMethod));
if (ctargets != null) {
while (ctargets.hasNext()) {
SootMethod child = (SootMethod) ctargets.next();
System.out.println(targetMethodName +" may call" + child);
if (!visited.containsKey(child.getSignature())) visit(callGraph, child);
}
}
}
if (targetMethod != null) {
Iterator<MethodOrMethodContext> ctargets = new Targets(callGraph.edgesOutOf(targetMethod));
if (ctargets != null) {
while (ctargets.hasNext()) {
SootMethod child = (SootMethod) ctargets.next();
System.out.println(targetMethodName +" may call" + child);
if (!visited.containsKey(child.getSignature())) visit(callGraph, child);
}
}
// for (Iterator<Edge> it = callGraph.edgesOutOf(targetMethod); it.hasNext();) {
// Edge edge = it.next();
// SootMethod srcMethod = edge.getSrc().method();
// System.out.println(srcMethod.getSignature());
// }
}
String className = "com.tuya.smart.rnplugin.tyrctcameramanager.TYRCTCameraManager";
SootClass sootClass111 = Scene.v().loadClassAndSupport(className_pre);
sootClass111.setApplicationClass();
// Get all methods in the class
List<SootMethod> methods11 = sootClass111.getMethods();
// Iterate over the methods and print their names
for (SootMethod method : methods11) {
System.out.println("Method: " + method.getName());
}
//// System.out.println("new");
// className = "com.tuya.smart.camera.devicecontrol.MqttIPCCameraDeviceManager";
// sootClass = Scene.v().loadClassAndSupport(className);
//// sootClass.setApplicationClass();
//// // Get all methods in the class
//// methods = sootClass.getMethods();
//// for (SootMethod method : methods) {
//// System.out.println("Method: " + method.getName());
//// }
// String methodName = "startPtz";
// String methodSubSignature = "void startPtz(com.tuya.smart.camera.devicecontrol.mode.PTZDirection)";
//// String methodName = "startPtzLeft";
//// String methodSubSignature = "void startPtzLeft()";
// targetMethod = sootClass.getMethod(methodSubSignature);
//
// if (targetMethod != null) {
// System.out.println("调用 " + targetMethodName + " 的方法:");
// for (Iterator<Edge> it = callGraph.edgesInto(targetMethod); it.hasNext();) {
// Edge edge = it.next();
// SootMethod srcMethod = edge.getSrc().method();
// System.out.println(srcMethod.getSignature());
// }
// }
// if (sootClass.declaresMethodByName(methodName)) {
// SootMethod method = sootClass.getMethod(methodSubSignature);
// System.out.println("Found method: " + method.getSignature());
// Iterator<Edge> edgeIterator = callGraph.edgesInto(method);
// while (edgeIterator.hasNext()) {
// Edge edge = edgeIterator.next();
// SootMethod tgt = edge.getTgt().method();
// System.out.println("before tgt" + tgt.getSignature());
// System.out.println(" " + tgt.getSignature());
// }
// }else {
// System.out.println("Method not found in class.");
// }
// if (sootClass.declaresMethodByName(methodName)) {
// SootMethod method = sootClass.getMethod(methodSubSignature);
// System.out.println("Found method: " + method.getSignature());
// visit(callGraph,method);
// cge.exportMIG("flowdroidCFG", outputPath);
// } else {
// System.out.println("Method not found in class.");
// }
// SetupApplication app = new SetupApplication(androidPlatformPath, appPath);
// soot.G.reset();
// //传入AndroidCallbacks文件
// app.setCallbackFile(CGGenerator.class.getResource("/AndroidCallbacks.txt").getFile());
// app.constructCallgraph();
//
// //SootMethod
// SootMethod entryPoint = app.getDummyMainMethod();
// CallGraph cg = Scene.v().getCallGraph();
// visit(cg,entryPoint);
// cge.exportMIG("flowdroidCFG", outputPath);
// System.out.println("Method not found in class.");
}
// public static void main(String[] args) throws IOException, XmlPullParserException{
// // Configure Soot for APK analysis
// Options.v().set_src_prec(Options.src_prec_apk);
//
// Options.v().set_android_jars(androidPlatformPath);
// Options.v().set_process_dir(Collections.singletonList(appPath)); // Replace with APK path
// Options.v().set_whole_program(true);
// Options.v().set_allow_phantom_refs(true);
// Options.v().set_process_multiple_dex(true);
// Options.v().set_output_format(Options.output_format_none);
//
// // Enable call graph generation
// Options.v().setPhaseOption("cg.spark", "on");
//
// // Load classes and methods from APK
// Scene.v().loadNecessaryClasses();
// System.out.println("test");
// // Execute Soot
// PackManager.v().runPacks();
//
// // Retrieve and process the call graph
// CallGraph callGraph = Scene.v().getCallGraph();
// String targetFunctionSignature = "com.tuya.smart.camera.devicecontrol.MqttIPCCameraDeviceManager。startPtz(com.tuya.smart.camera.devicecontrol.mode.PTZDirection)";
// for (Edge edge : callGraph) {
// SootMethod srcMethod = edge.src();
// SootMethod tgtMethod = edge.tgt();
//
// if (tgtMethod.getSignature().equals(targetFunctionSignature)) {
// // Found a caller of the target function
// System.out.println("Caller Method: " + srcMethod.getSignature());
// // You can analyze or store information about the caller method here
// }
// }
// System.out.println("test");
//
//
//// SetupApplication app = new SetupApplication(androidPlatformPath, appPath);
//// soot.G.reset();
//// //传入AndroidCallbacks文件
//// app.setCallbackFile(CGGenerator.class.getResource("/AndroidCallbacks.txt").getFile());
//// app.constructCallgraph();
////
//// //SootMethod
SootMethod entryPoint = app.getDummyMainMethod();
CallGraph cg = Scene.v().getCallGraph();
visit(cg,entryPoint);
cge.exportMIG("flowdroidCFG", outputPath);
// }
private static boolean isJavaLibraryMethod(SootMethod method) {
String packageName = method.getDeclaringClass().getPackageName();
System.out.println(packageName.startsWith("java.") || packageName.startsWith("javax.") || packageName.startsWith("sun."));
return packageName.startsWith("java.") || packageName.startsWith("javax.") || packageName.startsWith("sun.");
}
private static void visit(CallGraph cg,SootMethod m){
String identifier = m.getSignature();
visited.put(identifier, true);
cge.createNode(identifier);
Iterator<MethodOrMethodContext> ptargets = new Targets(cg.edgesInto(m));
if(ptargets != null){
while(ptargets.hasNext())
{
SootMethod p = (SootMethod) ptargets.next();
if(p == null){
System.out.println("p is null");
}
if(!visited.containsKey(p.getSignature())){
visit(cg,p);
}
}
}
Iterator<MethodOrMethodContext> ctargets = new Targets(cg.edgesOutOf(m));
if(ctargets != null){
while(ctargets.hasNext())
{
SootMethod c = (SootMethod) ctargets.next();
if(c == null){
System.out.println("c is null");
}
cge.createNode(c.getSignature());
cge.linkNodeByID(identifier, c.getSignature());
if(!visited.containsKey(c.getSignature())){
visit(cg,c);
}
}
}
}
}
| kzLiu2017/RIoTFuzzer | cg.java |
1,281 | // N.java
// A *simplified* node class for use with the Stack1 class
// and other uses as desired
// Posted previously, but used for simulation
public class N {
private Object data;
private N next;
// constructors
public N() {}
public N(Object o, N link) {
data = o;
next = link;
}
// selectors
public Object getData() {
return data;
}
public void setData(Object o) {
data = o;
}
public N getNext() {
return next;
}
public void setNext(N link) {
next = link;
}
// instance variables
} // N class
| tiandiao123/Grocery-Checkout-Simulation | N.java |
1,282 | /**
* This class will handle all of the file IO.
* Keeping it separate will clean up the main code and make it easier to track down bugs.
*/
import javax.swing.*;
import java.io.*;
import java.util.*;
//import java.nio.file.*;
import java.sql.*;
public class IO extends GUI {
// JDBC driver name and database URL
static final String JDBC_DRIVER = "com.mysql.jdbc.Driver";
static final String DB_URL = "jdbc:mysql://localhost/cmsc420";
// Database credentials
static final String USER = "root";
static final String PASS = "";
// create all necessary mysql tables if they don't already exist
// load in any saved information if the files do exist=
@SuppressWarnings("unchecked")
public static void initAccount(ArrayList<Account> accounts) throws IOException{
// create account data mysql table
try{
Class.forName(JDBC_DRIVER);
Connection conn = DriverManager.getConnection(DB_URL, USER, PASS);
Statement stmt = conn.createStatement();
String sql = "CREATE TABLE accounts " +
"(type VARCHAR(10) not NULL, " +
" name VARCHAR(30), " +
" balance double, " +
" PRIMARY KEY ( type, name ))";
stmt.executeUpdate(sql);
conn.close();
}
catch(SQLException se){
se.printStackTrace();
}
catch(Exception e){
e.printStackTrace();
}
//checks all transactions to make sure that the account they are associated with still exists
try {
Class.forName(JDBC_DRIVER);
Connection conn = DriverManager.getConnection(DB_URL, USER, PASS);
Statement stmt = conn.createStatement();
String query = "Select * From transactions";
ResultSet rslt = stmt.executeQuery(query);
while(rslt.next()){
String accNameCheck = rslt.getString(1);
String accTypeCheck = rslt.getString(8);
boolean deleteAccTransData = true;
Statement stmt2 = conn.createStatement();
String query2 = "Select * FROM accounts";
ResultSet rslt2 = stmt2.executeQuery(query2);
while(rslt2.next())
{
String transNameCheck = rslt2.getString(2);
String transTypeCheck = rslt2.getString(1);
if(accNameCheck.equals(transNameCheck) && accTypeCheck.equals(transTypeCheck)){
deleteAccTransData = false;
}
}
if(deleteAccTransData)
{
Statement stmt3 = conn.createStatement();
String update = "DELETE FROM transactions WHERE name = \'" + accNameCheck + "\' AND typeAcc = "+ "\'" + accTypeCheck + "\'";
stmt3.executeUpdate(update);
}
}
conn.close();
}
catch(SQLException se){
se.printStackTrace();
}
catch (Exception e) {
e.printStackTrace();
}
//pulls all existing data from the tables into the GUI
try{
Class.forName(JDBC_DRIVER);
Connection conn = DriverManager.getConnection(DB_URL, USER, PASS);
Statement stmt2 = conn.createStatement();
String query = "Select * From accounts";
ResultSet rslt = stmt2.executeQuery(query);
String type;
String name;
double balance;
while(rslt.next()){
type = rslt.getString(1);
name = rslt.getString(2);
balance = rslt.getDouble(3);
Account acc = new Account();
acc.setType(type);
acc.setName(name);
acc.setBalance(balance);
initTrans(acc);
accounts.add(acc);
}
conn.close();
}
catch(SQLException se){
se.printStackTrace();
}
catch(Exception e){
e.printStackTrace();
}
} // initAccount
private static void initTrans(Account acc){
String nameHolder = acc.getName();
String typeHolder = acc.getType();
//creates transactions mysql table if it doesn't already exist
try{
Class.forName(JDBC_DRIVER);
Connection conn = DriverManager.getConnection(DB_URL, USER, PASS);
Statement stmt = conn.createStatement();
System.out.println("CHECK------------------------------------");
String sql = "CREATE TABLE transactions " +
"(name VARCHAR(30) not NULL," +
" type VARCHAR(10), " +
" amount double, " +
" date VARCHAR(10), " +
" payee VARCHAR(30), " +
" category VARCHAR(10), " +
" comments VARCHAR(100)," +
"typeAcc VARCHAR(10) not NULL)";
stmt.executeUpdate(sql);
conn.close();
}
catch(SQLException se){
se.printStackTrace();
}
catch(Exception e){
e.printStackTrace();
}
//Load data from mysql transactions table into the GUI
try {
Class.forName(JDBC_DRIVER);
Connection conn = DriverManager.getConnection(DB_URL, USER, PASS);
Statement stmt = conn.createStatement();
String query = "Select * From transactions WHERE name = " + "\'" + nameHolder + "\' AND typeAcc = "+ "\'" + typeHolder + "\'";
ResultSet rslt = stmt.executeQuery(query);
Transaction trans;
while(rslt.next()){
trans = new Transaction();
trans.setType(rslt.getString(2));
trans.setAmount(rslt.getDouble(3));
trans.setDate(rslt.getString(4));
trans.setPayee(rslt.getString(5));
trans.setCategory(rslt.getString(6));
trans.setComments(rslt.getString(7));
acc.addTransaction(trans);
}
conn.close();
}
catch(SQLException se){
se.printStackTrace();
}
catch (Exception e) {
e.printStackTrace();
}
}// initTrans
// rewrite mysql accounts table with new account info
public static void updateAccountData(ArrayList<Account> accounts){
//delete all entries from accounts table
try{
Class.forName(JDBC_DRIVER);
Connection conn = DriverManager.getConnection(DB_URL, USER, PASS);
Statement stmt = conn.createStatement();
String update = "DELETE FROM accounts";
stmt.executeUpdate(update);
conn.close();
} catch(SQLException se) {
se.printStackTrace();
}
catch (Exception e) {
e.printStackTrace();
}
//Load all data from the GUI accounts array into the mysql accounts table
try{
Class.forName(JDBC_DRIVER);
Connection conn = DriverManager.getConnection(DB_URL, USER, PASS);
Statement stmt = conn.createStatement();
for(int i = 0; i < accounts.size(); i++){
Statement st = conn.createStatement();
st.executeUpdate("INSERT INTO accounts (type, name, balance) "
+ "VALUES (" + "\'"
+ accounts.get(i).getType()
+ "\'" + "," + "\'"
+ accounts.get(i).getName()
+ "\'" + ","
+ accounts.get(i).getBalance()
+ ")");
}// for
conn.close();
}
catch(SQLException se) {
se.printStackTrace();
}
catch (Exception e) {
e.printStackTrace();
}
} // updateAccountData
// rewrite mysql transactions table with new transaction info
public static void updateTranData(ArrayList<Transaction> trans, Account acc){
//delete all entries from the mysql transaction table associated with the account from the parameters
try{
Class.forName(JDBC_DRIVER);
Connection conn = DriverManager.getConnection(DB_URL, USER, PASS);
Statement stmt = conn.createStatement();
String update = "DELETE FROM transactions WHERE name = \'" + acc.getName() +"\'";
stmt.executeUpdate(update);
for(int i = 0; i < trans.size(); i++){
//load all transactions form the transactions array into the mysql transactions table
Statement st = conn.createStatement();
st.executeUpdate("INSERT INTO transactions (name, type, amount, date, payee, category, comments, typeAcc) "
+"VALUES (" + "\'"
+ acc.getName()
+ "\'" + "," + "\'"
+ trans.get(i).getType()
+ "\'" + ","
+ trans.get(i).getAmount()
+ "," + "\'"
+ trans.get(i).getDate()
+ "\'" + "," + "\'"
+ trans.get(i).getPayee()
+ "\'" + "," + "\'"
+ trans.get(i).getCategory()
+ "\'" + "," + "\'"
+ trans.get(i).getComments()
+ "\'" + "," +"\'"
+ acc.getType()
+ "\'" + ")");
}// for
conn.close();
}
catch(SQLException se) {
se.printStackTrace();
}
catch(Exception e) {
e.printStackTrace();
}
} // updateAccountData
//edit the name of the of the account in the mysql transactions table
public static void updateTranDataName(String oldName, String newName){
try{
Class.forName(JDBC_DRIVER);
Connection conn = DriverManager.getConnection(DB_URL, USER, PASS);
Statement stmt = conn.createStatement();
String update = "UPDATE transactions SET name= \'" + newName + "\' WHERE name = \'" + oldName + "\'";
stmt.executeUpdate(update);
conn.close();
}
catch(SQLException se) {
se.printStackTrace();
}
catch(Exception e) {
e.printStackTrace();
}
} // updateTranDataName
} // class | CMSC-420/financial-project | IO.java |
1,284 | // 27. Remove Element
// Given an integer array nums and an integer val, remove all occurrences of val in nums in-place. The relative order of the elements may be changed.
//
// Since it is impossible to change the length of the array in some languages, you must instead have the result be placed in the first part of the array nums. More formally, if there are k elements after removing the duplicates, then the first k elements of nums should hold the final result. It does not matter what you leave beyond the first k elements.
//
// Return k after placing the final result in the first k slots of nums.
//
// Do not allocate extra space for another array. You must do this by modifying the input array in-place with O(1) extra memory.
//
// Custom Judge:
//
// The judge will test your solution with the following code:
//
// int[] nums = [...]; // Input array
// int val = ...; // Value to remove
// int[] expectedNums = [...]; // The expected answer with correct length.
// // It is sorted with no values equaling val.
//
// int k = removeElement(nums, val); // Calls your implementation
//
// assert k == expectedNums.length;
// sort(nums, 0, k); // Sort the first k elements of nums
// for (int i = 0; i < actualLength; i++) {
// assert nums[i] == expectedNums[i];
// }
// If all assertions pass, then your solution will be accepted.
//
//
//
// Example 1:
//
// Input: nums = [3,2,2,3], val = 3
// Output: 2, nums = [2,2,_,_]
// Explanation: Your function should return k = 2, with the first two elements of nums being 2.
// It does not matter what you leave beyond the returned k (hence they are underscores).
// Example 2:
//
// Input: nums = [0,1,2,2,3,0,4,2], val = 2
// Output: 5, nums = [0,1,4,0,3,_,_,_]
// Explanation: Your function should return k = 5, with the first five elements of nums containing 0, 0, 1, 3, and 4.
// Note that the five elements can be returned in any order.
// It does not matter what you leave beyond the returned k (hence they are underscores).
//
//
// Constraints:
//
// 0 <= nums.length <= 100
// 0 <= nums[i] <= 50
// 0 <= val <= 100
//
// Runtime: 0 ms, faster than 100.00% of Java online submissions for Remove Element.
// Memory Usage: 37.3 MB, less than 95.37% of Java online submissions for Remove Element.
class Solution {
public int removeElement(int[] nums, int val) {
int count = 0;
for (int i = 0; i < nums.length; i++) {
if (nums[i] != val) {
nums[count] = nums[i];
count++;
}
}
return count;
}
} | ishuen/leetcode | 27.java |
1,285 | // 87. Scramble String
//
// We can scramble a string s to get a string t using the following algorithm:
//
// If the length of the string is 1, stop.
// If the length of the string is > 1, do the following:
// Split the string into two non-empty substrings at a random index, i.e., if the string is s, divide it to x and y where s = x + y.
// Randomly decide to swap the two substrings or to keep them in the same order. i.e., after this step, s may become s = x + y or s = y + x.
// Apply step 1 recursively on each of the two substrings x and y.
// Given two strings s1 and s2 of the same length, return true if s2 is a scrambled string of s1, otherwise, return false.
//
//
//
// Example 1:
//
// Input: s1 = "great", s2 = "rgeat"
// Output: true
// Explanation: One possible scenario applied on s1 is:
// "great" --> "gr/eat" // divide at random index.
// "gr/eat" --> "gr/eat" // random decision is not to swap the two substrings and keep them in order.
// "gr/eat" --> "g/r / e/at" // apply the same algorithm recursively on both substrings. divide at random index each of them.
// "g/r / e/at" --> "r/g / e/at" // random decision was to swap the first substring and to keep the second substring in the same order.
// "r/g / e/at" --> "r/g / e/ a/t" // again apply the algorithm recursively, divide "at" to "a/t".
// "r/g / e/ a/t" --> "r/g / e/ a/t" // random decision is to keep both substrings in the same order.
// The algorithm stops now, and the result string is "rgeat" which is s2.
// As one possible scenario led s1 to be scrambled to s2, we return true.
// Example 2:
//
// Input: s1 = "abcde", s2 = "caebd"
// Output: false
// Example 3:
//
// Input: s1 = "a", s2 = "a"
// Output: true
//
//
// Constraints:
//
// s1.length == s2.length
// 1 <= s1.length <= 30
// s1 and s2 consist of lowercase English letters.
//
//
// Runtime 8 ms Beats 68.61% of users with Java
// Memory 43.85 MB Beats 52.75% of users with Java
class Solution {
public boolean isScramble(String s1, String s2) {
Map<String, Boolean> memory = new HashMap<>();
return isScramble(s1, s2, memory);
}
public boolean isScramble(String s1, String s2, Map<String, Boolean> memory) {
String key = s1 + "-" + s2;
if (memory.containsKey(key)) return memory.get(key);
if (s1.equals(s2)) {
memory.put(key, true);
return true;
}
int[] count = new int[26];
for (int i = 0; i < s1.length(); i++) {
count[s1.charAt(i) - 'a']++;
count[s2.charAt(i) - 'a']--;
}
for (int i = 0; i < 26; i++) {
if (count[i] != 0) {
memory.put(key, false);
return false;
}
}
int len = s1.length();
for (int i = 1; i < len; i++) {
if (isScramble(s1.substring(0, i), s2.substring(0, i), memory) && isScramble(s1.substring(i), s2.substring(i), memory)) {
memory.put(key, true);
return true;
}
if (isScramble(s1.substring(0, i), s2.substring(len - i), memory) && isScramble(s1.substring(i), s2.substring(0, len - i), memory)) {
memory.put(key, true);
return true;
}
}
memory.put(key, false);
return false;
}
} | ishuen/leetcode | 87.java |
1,291 | // 64. Minimum Path Sum
// Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right, which minimizes the sum of all numbers along its path.
//
// Note: You can only move either down or right at any point in time.
//
// Example 1:
//
//
// Input: grid = [[1,3,1],[1,5,1],[4,2,1]]
// Output: 7
// Explanation: Because the path 1 → 3 → 1 → 1 → 1 minimizes the sum.
// Example 2:
//
// Input: grid = [[1,2,3],[4,5,6]]
// Output: 12
//
//
// Constraints:
//
// m == grid.length
// n == grid[i].length
// 1 <= m, n <= 200
// 0 <= grid[i][j] <= 100
//
// Runtime: 2 ms, faster than 80.58% of Java online submissions for Minimum Path Sum.
// Memory Usage: 41.5 MB, less than 68.81% of Java online submissions for Minimum Path Sum.
class Solution {
public int minPathSum(int[][] grid) {
int[][] pathSum = new int[grid.length][grid[0].length];
pathSum[0][0] = grid[0][0];
for (int i = 1; i < grid.length; i++) {
pathSum[i][0] = pathSum[i - 1][0] + grid[i][0];
}
for (int i = 1; i < grid[0].length; i++) {
pathSum[0][i] = pathSum[0][i - 1] + grid[0][i];
}
for (int i = 1; i < grid.length; i++) {
for (int j = 1; j < grid[0].length; j++) {
pathSum[i][j] = Math.min(pathSum[i-1][j], pathSum[i][j-1]) + grid[i][j];
}
}
return pathSum[grid.length - 1][grid[0].length - 1];
}
} | ishuen/leetcode | 64.java |
1,292 | // 42. Trapping Rain Water
// Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining.
// Example 1:
// Input: height = [0,1,0,2,1,0,1,3,2,1,2,1]
// Output: 6
// Explanation: The above elevation map (black section) is represented by array [0,1,0,2,1,0,1,3,2,1,2,1]. In this case, 6 units of rain water (blue section) are being trapped.
// Example 2:
// Input: height = [4,2,0,3,2,5]
// Output: 9
// Constraints:
//
// n == height.length
// 0 <= n <= 3 * 104
// 0 <= height[i] <= 105
//
// Runtime: 0 ms, faster than 100.00% of Java online submissions for Trapping Rain Water.
// Memory Usage: 38.3 MB, less than 83.32% of Java online submissions for Trapping Rain Water.
class Solution {
public int trap(int[] height) {
int count = 0;
int left = 0;
int right = height.length - 1;
while (left < right) {
if (height[left] < height[left + 1]) left++;
else {
break;
}
}
while (left < right) {
if (height[right] < height[right - 1]) right--;
else {
break;
}
}
while (left < right) {
if (height[left] <= height[right]) {
int l = left + 1;
while (height[l] < height[left]) {
count = count + height[left] - height[l];
l++;
}
left = l;
} else {
int r = right - 1;
while (height[right] > height[r]) {
count = count + height[right] - height[r];
r--;
}
right = r;
}
}
return count;
}
}
// Runtime 0 ms Beats 100.00% of users with Java
// Memory 45.38 MB Beats 5.16% of users with Java
class Solution {
public int trap(int[] height) {
int left = 0;
int right = height.length - 1;
int water = 0;
while (left < right) {
if (height[left] <= height[right]) {
int next = left + 1;
while (height[left] > height[next]) {
water += height[left] - height[next];
next++;
}
left = next;
} else {
int next = right - 1;
while (height[right] > height[next]) {
water += height[right] - height[next];
next--;
}
right = next;
}
}
return water;
}
}
| ishuen/leetcode | 42.java |
1,293 | // 36. Valid Sudoku
// Determine if a 9 x 9 Sudoku board is valid. Only the filled cells need to be validated according to the following rules:
//
// Each row must contain the digits 1-9 without repetition.
// Each column must contain the digits 1-9 without repetition.
// Each of the nine 3 x 3 sub-boxes of the grid must contain the digits 1-9 without repetition.
// Note:
//
// A Sudoku board (partially filled) could be valid but is not necessarily solvable.
// Only the filled cells need to be validated according to the mentioned rules.
//
//
// Example 1:
//
//
// Input: board =
// [["5","3",".",".","7",".",".",".","."]
// ,["6",".",".","1","9","5",".",".","."]
// ,[".","9","8",".",".",".",".","6","."]
// ,["8",".",".",".","6",".",".",".","3"]
// ,["4",".",".","8",".","3",".",".","1"]
// ,["7",".",".",".","2",".",".",".","6"]
// ,[".","6",".",".",".",".","2","8","."]
// ,[".",".",".","4","1","9",".",".","5"]
// ,[".",".",".",".","8",".",".","7","9"]]
// Output: true
// Example 2:
//
// Input: board =
// [["8","3",".",".","7",".",".",".","."]
// ,["6",".",".","1","9","5",".",".","."]
// ,[".","9","8",".",".",".",".","6","."]
// ,["8",".",".",".","6",".",".",".","3"]
// ,["4",".",".","8",".","3",".",".","1"]
// ,["7",".",".",".","2",".",".",".","6"]
// ,[".","6",".",".",".",".","2","8","."]
// ,[".",".",".","4","1","9",".",".","5"]
// ,[".",".",".",".","8",".",".","7","9"]]
// Output: false
// Explanation: Same as Example 1, except with the 5 in the top left corner being modified to 8. Since there are two 8's in the top left 3x3 sub-box, it is invalid.
//
//
// Constraints:
//
// board.length == 9
// board[i].length == 9
// board[i][j] is a digit or '.'.
//
// Runtime: 1 ms, faster than 100.00% of Java online submissions for Valid Sudoku.
// Memory Usage: 39 MB, less than 69.80% of Java online submissions for Valid Sudoku.
class Solution {
public boolean isValidSudoku(char[][] board) {
boolean isValid = true;
for (int i = 0; i < 9; i++) {
for (int j = 0; j < 9; j++) {
if (board[i][j] != '.') {
isValid = isValid && checkRow(board[i], j, board[i][j])
&& checkCol(board, i, j , board[i][j])
&& checkArea(board, i, j, board[i][j]);
}
}
}
return isValid;
}
private boolean checkRow(char[] row, int col, char c) {
for (int i = 0; i < 9; i++) {
if (row[i] == c && i != col) return false;
}
return true;
}
private boolean checkCol(char[][] board, int row, int col, char c) {
for (int i = 0; i < 9; i++) {
if (board[i][col] == c && i != row) return false;
}
return true;
}
private boolean checkArea(char[][] board, int row, int col, char c) {
int firstRow = row / 3 * 3;
int firstCol = col / 3 * 3;
for (int i = firstRow; i < firstRow + 3; i++) {
for (int j = firstCol; j < firstCol + 3; j++) {
if (board[i][j] == c && (i!= row || j != col)) return false;
}
}
return true;
}
} | ishuen/leetcode | 36.java |
1,294 | // 80. Remove Duplicates from Sorted Array II
// Given an integer array nums sorted in non-decreasing order, remove some duplicates in-place such that each unique element appears at most twice. The relative order of the elements should be kept the same.
//
// Since it is impossible to change the length of the array in some languages, you must instead have the result be placed in the first part of the array nums. More formally, if there are k elements after removing the duplicates, then the first k elements of nums should hold the final result. It does not matter what you leave beyond the first k elements.
//
// Return k after placing the final result in the first k slots of nums.
//
// Do not allocate extra space for another array. You must do this by modifying the input array in-place with O(1) extra memory.
//
// Custom Judge:
//
// The judge will test your solution with the following code:
//
// int[] nums = [...]; // Input array
// int[] expectedNums = [...]; // The expected answer with correct length
//
// int k = removeDuplicates(nums); // Calls your implementation
//
// assert k == expectedNums.length;
// for (int i = 0; i < k; i++) {
// assert nums[i] == expectedNums[i];
// }
// If all assertions pass, then your solution will be accepted.
//
//
//
// Example 1:
//
// Input: nums = [1,1,1,2,2,3]
// Output: 5, nums = [1,1,2,2,3,_]
// Explanation: Your function should return k = 5, with the first five elements of nums being 1, 1, 2, 2 and 3 respectively.
// It does not matter what you leave beyond the returned k (hence they are underscores).
// Example 2:
//
// Input: nums = [0,0,1,1,1,1,2,3,3]
// Output: 7, nums = [0,0,1,1,2,3,3,_,_,_]
// Explanation: Your function should return k = 7, with the first seven elements of nums being 0, 0, 1, 1, 2, 3 and 3 respectively.
// It does not matter what you leave beyond the returned k (hence they are underscores).
//
//
// Constraints:
//
// 1 <= nums.length <= 3 * 104
// -104 <= nums[i] <= 104
// nums is sorted in non-decreasing order.
//
// Runtime: 0 ms, faster than 100.00% of Java online submissions for Remove Duplicates from Sorted Array II.
// Memory Usage: 39.3 MB, less than 29.35% of Java online submissions for Remove Duplicates from Sorted Array II.
class Solution {
public int removeDuplicates(int[] nums) {
int k = 0;
int counter = 1;
for (int i = 1; i < nums.length; i++) {
if (nums[k] == nums[i]) {
counter++;
} else {
counter = 1;
}
if (counter <= 2) {
k++;
nums[k] = nums[i];
}
}
return k + 1;
}
}
// 2 pointers 1 counter
// i -> traverse original array
// k -> keep the last element of the final array
// return k + 1 | ishuen/leetcode | 80.java |
1,297 | // 72. Edit Distance
// Given two strings word1 and word2, return the minimum number of operations required to convert word1 to word2.
//
// You have the following three operations permitted on a word:
//
// Insert a character
// Delete a character
// Replace a character
//
//
// Example 1:
//
// Input: word1 = "horse", word2 = "ros"
// Output: 3
// Explanation:
// horse -> rorse (replace 'h' with 'r')
// rorse -> rose (remove 'r')
// rose -> ros (remove 'e')
// Example 2:
//
// Input: word1 = "intention", word2 = "execution"
// Output: 5
// Explanation:
// intention -> inention (remove 't')
// inention -> enention (replace 'i' with 'e')
// enention -> exention (replace 'n' with 'x')
// exention -> exection (replace 'n' with 'c')
// exection -> execution (insert 'u')
//
//
// Constraints:
//
// 0 <= word1.length, word2.length <= 500
// word1 and word2 consist of lowercase English letters.
//
// Runtime: 8 ms, faster than 16.37% of Java online submissions for Edit Distance.
// Memory Usage: 41.6 MB, less than 6.53% of Java online submissions for Edit Distance.
class Solution {
public int minDistance(String word1, String word2) {
int[][] table = new int[word1.length() + 1][word2.length() + 1];
for (int i = 0; i <= word1.length(); i++) {
table[i][0] = i;
}
for (int i = 1; i <= word2.length(); i++) {
table[0][i] = i;
}
for (int i = 0; i < word1.length(); i++) {
for(int j = 0; j < word2.length(); j++) {
if (word1.charAt(i) == word2.charAt(j)) {
table[i + 1][j + 1] = table[i][j];
} else {
table[i + 1][j + 1] = 1 + Math.min(Math.min(table[i][j], table[i + 1][j]), table[i][j + 1]);
}
}
}
return table[word1.length()][word2.length()];
}
}
// h o r s e r
// (1 2 3 4 5 6)
// 1 r 1 2 2 3 4 5
// 2 o 2 1 2 3 4 5
// 3 s 3 2 2 2 3 4
| ishuen/leetcode | 72.java |
1,299 | // 88. Merge Sorted Array
// You are given two integer arrays nums1 and nums2, sorted in non-decreasing order, and two integers m and n, representing the number of elements in nums1 and nums2 respectively.
//
// Merge nums1 and nums2 into a single array sorted in non-decreasing order.
//
// The final sorted array should not be returned by the function, but instead be stored inside the array nums1. To accommodate this, nums1 has a length of m + n, where the first m elements denote the elements that should be merged, and the last n elements are set to 0 and should be ignored. nums2 has a length of n.
//
//
//
// Example 1:
//
// Input: nums1 = [1,2,3,0,0,0], m = 3, nums2 = [2,5,6], n = 3
// Output: [1,2,2,3,5,6]
// Explanation: The arrays we are merging are [1,2,3] and [2,5,6].
// The result of the merge is [1,2,2,3,5,6] with the underlined elements coming from nums1.
// Example 2:
//
// Input: nums1 = [1], m = 1, nums2 = [], n = 0
// Output: [1]
// Explanation: The arrays we are merging are [1] and [].
// The result of the merge is [1].
// Example 3:
//
// Input: nums1 = [0], m = 0, nums2 = [1], n = 1
// Output: [1]
// Explanation: The arrays we are merging are [] and [1].
// The result of the merge is [1].
// Note that because m = 0, there are no elements in nums1. The 0 is only there to ensure the merge result can fit in nums1.
//
//
// Constraints:
//
// nums1.length == m + n
// nums2.length == n
// 0 <= m, n <= 200
// 1 <= m + n <= 200
// -109 <= nums1[i], nums2[j] <= 109
// Follow up: Can you come up with an algorithm that runs in O(m + n) time?
//
// Runtime: 0 ms, faster than 100.00% of Java online submissions for Merge Sorted Array.
// Memory Usage: 39.3 MB, less than 32.87% of Java online submissions for Merge Sorted Array.
class Solution {
public void merge(int[] nums1, int m, int[] nums2, int n) {
int pointer1 = 0;
int pointer2 = 0;
while (pointer1 < m + n && pointer2 < n) {
if (nums1[pointer1] <= nums2[pointer2]) {
if (pointer1 == m + pointer2) {
nums1[pointer1] = nums2[pointer2];
pointer2++;
}
}
else {
shift(m - pointer1 + pointer2, pointer1, nums1);
nums1[pointer1] = nums2[pointer2];
pointer2++;
}
pointer1++;
}
}
private void shift(int count, int index, int[] nums) {
for (int i = index + count; i > index; i--) {
nums[i] = nums[i - 1];
}
}
} | ishuen/leetcode | 88.java |
1,300 | public int[][] generateMaze() {
int[][] maze = new int[height][width];
// Initialize
for (int i = 0; i < height; i++)
for (int j = 0; j < width; j++)
maze[i][j] = 1;
Random rand = new Random();
// r for row、c for column
// Generate random r
int r = rand.nextInt(height);
while (r % 2 == 0) {
r = rand.nextInt(height);
}
// Generate random c
int c = rand.nextInt(width);
while (c % 2 == 0) {
c = rand.nextInt(width);
}
// Starting cell
maze[r][c] = 0;
// Allocate the maze with recursive method
recursion(r, c);
return maze;
}
public void recursion(int r, int c) {
// 4 random directions
int[] randDirs = generateRandomDirections();
// Examine each direction
for (int i = 0; i < randDirs.length; i++) {
switch(randDirs[i]){
case 1: // Up
// Whether 2 cells up is out or not
if (r - 2 <= 0)
continue;
if (maze[r - 2][c] != 0) {
maze[r-2][c] = 0;
maze[r-1][c] = 0;
recursion(r - 2, c);
}
break;
case 2: // Right
// Whether 2 cells to the right is out or not
if (c + 2 >= width - 1)
continue;
if (maze[r][c + 2] != 0) {
maze[r][c + 2] = 0;
maze[r][c + 1] = 0;
recursion(r, c + 2);
}
break;
case 3: // Down
// Whether 2 cells down is out or not
if (r + 2 >= height - 1)
continue;
if (maze[r + 2][c] != 0) {
maze[r+2][c] = 0;
maze[r+1][c] = 0;
recursion(r + 2, c);
}
break;
case 4: // Left
// Whether 2 cells to the left is out or not
if (c - 2 <= 0)
continue;
if (maze[r][c - 2] != 0) {
maze[r][c - 2] = 0;
maze[r][c - 1] = 0;
recursion(r, c - 2);
}
break;
}
}
}
/**
* Generate an array with random directions 1-4
* @return Array containing 4 directions in random order
*/
public Integer[] generateRandomDirections() {
ArrayList<Integer> randoms = new ArrayList<Integer>();
for (int i = 0; i < 4; i++)
randoms.add(i + 1);
Collections.shuffle(randoms);
return randoms.toArray(new Integer[4]);
}
| oshlern/9th-Grade-Programming | maze.js |
1,302 | /**
* I
*/
public interface I {
public void methodI();
} | patwit/advanced_compro_demo | I.java |
1,304 | /*
* 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 COSC241_1_1.Inheritance;
/**
*
* @author alexonukwugha
*/
public interface I {
public void m();
}
/*** < Below is the <POSTMORDOM> of my process >***/
/*
So I just madea class gave it the name you see then I looked at abunch of videos
on making GUI's wanted my first one to be simple, simple but made manualy.
It took longer and I don't suggest doing it this way, but the simpler the GUI
the more you learn from it being manual. It's not very scalable when you code it manully\
The way I made it is in the code documentation, but if you want to make it manually
strongly suggest making it with the GUI netbbens first and making your code affter the
autmaticly genrated code created when you change/edit the GUI design object
Plus people usually use graphics method, but since I was just getting text data
and it was suppose to be very simple I feel it okay not to use that method class.
Almost every GUI uses a graphics method if not using an external component from a module
or imported java module
Lastly I would like to thank my Teacher and Advier,
Mr. Kennedy for making programming fun
This project at times was a pain and doesn't really do much for me as an
aspiring application developer, but I learned a lot so it was worth it personally
My next Git sharing I will talk about the process of sharing your first Git hub post
*/
/****** Graduation GUI convergence Project *******
font = new Font("Helvetic", Font.BOLD,84);
g.setFont(font);
g.fill3DRect(50, 200, xx, yyy, true);
g.setColor(Color.BLACK);
g.drawString("A", 85, 311);
g.setColor(Color.LIGHT_GRAY);
g.fill3DRect(275, 200, xx, yyy, true);
g.setColor(Color.BLACK);
g.drawString("B", 310, 311);
g.setColor(Color.LIGHT_GRAY);
g.fill3DRect(500, 200, xx, yyy, true);
g.setColor(Color.BLACK);
g.drawString("C", 535, 311);
*****/
/********************** <<GRAD GUI_COSC241:BEGINING OF COMMENT >>**********************>>>>>>>
*
*
*
*
public JPanel panel = new JPanel();
public JFrame window = new JFrame("GUI Demonstrating Inheritance");
public Display AD = new Display();
public Graphics graph;
public Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
public int x = (int) d.getWidth() / 3;
public int y = (int) d.getHeight() / 3;
@Override
public void run() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
enum Check {
FINALLY, NEW, LATER, STARTING, ENDING
}
private int height;
private int width;
public String lbl;
public class Example extends Test {
}
public class Example2 extends Test1 {
}
public class Display extends JPanel implements Runnable{
public Display() {
setLayout(null);
}
public JButton Buttonmaker() {
JButton btn = new JButton("A");
btn.doClick();
btn.setSize(100, 100);
return btn;
}
public void paintComponent(Graphics g) {
Font font = new Font("Helvetic", Font.BOLD, 24);
int yy = y / 4;
int xx = x / 3;
int yyy = y / 2;
setBackground(Color.BLUE);
g.setColor(Color.LIGHT_GRAY);
g.fillRect(10, 10, x, yy);
g.fill3DRect(10, 10, x, yy, true);
g.setColor(Color.BLACK);
g.setFont(font);
g.drawString(lbl, 40, 50);
g.setColor(Color.LIGHT_GRAY);
graph = g;
}
@Override
public void run() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
}
public static void main(String[] args) {
Check md = Check.STARTING;
System.out.print(md);
Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
System.out.print(" . ");
Grad_COSC241_Inheritance AO = new Grad_COSC241_Inheritance();
System.out.print(" . ");
System.out.print(" . ");
AO.window.show();
System.out.print(" . ");
System.out.print(" . ");
AO.lbl = "FIRST GRAD JFRAME CODE EVER";
System.out.print(" . ");
System.out.print(" . ");
System.out.print(" . ");
System.out.print(" . ");
AO.panel.add(AO.AD);
AO.window.add(AO.panel);
//AO.window.add(panel2);
System.out.print(" . ");
System.out.print(" . ");
AO.window.setBounds((int) d.getWidth() / 4, (int) d.getHeight() / 4, (int) d.getWidth() / 2, (int) d.getHeight() / 2);
System.out.print(" . ");
AO.window.setResizable(false);
System.out.print(" . ");
//window.setMaximumSize(new Dimension(((int) d.getWidth() / 5) * 4, ((int) d.getHeight() / 5) * 4));
AO.window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
System.out.print(" . ");
//window.setMinimumSize(new Dimension((int) d.getWidth() / 3, (int) d.getHeight() / 3));
AO.window.show();
System.out.println(" . ");
//BufferedImage dis = new BufferedImage();
Check mf = Check.FINALLY;
System.out.println(mf);
}
*
*
*
*
*
****************************<< GRAD: END of COMMENTS>>*****************>>>>*/ | KingOnukwugha/1ST_GRAD_GUI | I.java |
1,305 | public interface I {
java.lang.Class qq();
void ab();
}
| forlabs123/opi_lab2 | I.java |
1,310 | import com.whatsapp.arj;
import com.whatsapp.l5;
import com.whatsapp.proto.E2E.Message.VideoMessage;
import com.whatsapp.util.Log;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashSet;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.v;
import org.whispersystems.Y;
import org.whispersystems.aF;
import org.whispersystems.at;
public class a {
private static final HashSet A;
private static final Pattern B;
private static final String[] C;
private static final HashSet a;
static boolean d;
private static final HashSet h;
private static final HashSet n;
private static final Pattern s;
static String z;
private long b;
private long c;
protected HashSet e;
private long f;
protected BufferedReader g;
private long i;
private int j;
protected k k;
private long l;
private boolean m;
protected String o;
private long p;
private long q;
protected final String r;
private long t;
private long u;
private long v;
private long w;
private long x;
private String y;
protected String f() {
z = null;
z = c();
if (z == null) {
throw new d(C[42]);
} else if (z.trim().length() <= 0) {
return null;
} else {
d = true;
return z;
}
}
protected String b(char c) {
if (c == '\\' || c == ';' || c == ':' || c == ',') {
return String.valueOf(c);
}
return null;
}
protected void i(String str) {
int i = 0;
boolean z = q.h;
String[] split = str.split("-");
if (split.length > 2) {
throw new d(C[4] + str + "\"");
}
String str2 = split[0];
int length = str2.length();
int i2 = 0;
while (i2 < length) {
if (a(str2.charAt(i2))) {
i2++;
if (z) {
break;
}
}
throw new d(C[2] + str + "\"");
}
if (split.length > 1) {
String str3 = split[1];
int length2 = str3.length();
while (i < length2) {
if (a(str3.charAt(i))) {
i++;
if (z) {
break;
}
}
throw new d(C[3] + str + "\"");
}
}
if (this.k != null) {
this.k.e(C[1]);
this.k.b(str);
}
}
protected void g(String str) {
if (!(A.contains(str) || str.startsWith(C[47]) || this.e.contains(str))) {
this.e.add(str);
Log.w(C[48] + str);
}
if (this.k != null) {
this.k.e(C[49]);
this.k.b(str);
}
}
/* JADX WARNING: inconsistent code. */
/* Code decompiled incorrectly, please refer to instructions dump. */
protected boolean a(boolean r9) {
/*
r8 = this;
r7 = 2;
r1 = 1;
r0 = 0;
L_0x0003:
r2 = r8.c();
if (r2 != 0) goto L_0x000a;
L_0x0009:
return r0;
L_0x000a:
r3 = r2.trim();
r3 = r3.length();
if (r3 <= 0) goto L_0x0003;
L_0x0014:
r3 = ":";
r3 = r2.split(r3, r7);
r4 = r3.length;
if (r4 != r7) goto L_0x0044;
L_0x001e:
r4 = r3[r0];
r4 = r4.trim();
r5 = C;
r6 = 73;
r5 = r5[r6];
r4 = r4.equalsIgnoreCase(r5);
if (r4 == 0) goto L_0x0044;
L_0x0030:
r3 = r3[r1];
r3 = r3.trim();
r4 = C;
r5 = 77;
r4 = r4[r5];
r3 = r3.equalsIgnoreCase(r4);
if (r3 == 0) goto L_0x0044;
L_0x0042:
r0 = r1;
goto L_0x0009;
L_0x0044:
if (r9 != 0) goto L_0x0074;
L_0x0046:
r1 = r8.j;
if (r1 <= 0) goto L_0x004d;
L_0x004a:
r8.y = r2;
goto L_0x0009;
L_0x004d:
r0 = new d;
r1 = new java.lang.StringBuilder;
r1.<init>();
r3 = C;
r4 = 74;
r3 = r3[r4];
r1 = r1.append(r3);
r1 = r1.append(r2);
r2 = C;
r3 = 75;
r2 = r2[r3];
r1 = r1.append(r2);
r1 = r1.toString();
r0.<init>(r1);
throw r0;
L_0x0074:
if (r9 != 0) goto L_0x0003;
L_0x0076:
r0 = new d;
r1 = C;
r2 = 76;
r1 = r1[r2];
r0.<init>(r1);
throw r0;
*/
throw new UnsupportedOperationException("Method not decompiled: a.a(boolean):boolean");
}
/* JADX WARNING: inconsistent code. */
/* Code decompiled incorrectly, please refer to instructions dump. */
protected void a(boolean r8, boolean r9) {
/*
r7 = this;
r6 = 2;
r1 = 0;
r2 = q.h;
L_0x0004:
if (r8 == 0) goto L_0x000a;
L_0x0006:
r0 = r7.y;
if (r2 == 0) goto L_0x0026;
L_0x000a:
r0 = r7.c();
if (r0 != 0) goto L_0x001c;
L_0x0010:
r0 = new d;
r1 = C;
r2 = 31;
r1 = r1[r2];
r0.<init>(r1);
throw r0;
L_0x001c:
r3 = r0.trim();
r3 = r3.length();
if (r3 <= 0) goto L_0x000a;
L_0x0026:
r3 = ":";
r0 = r0.split(r3, r6);
r3 = r0.length;
if (r3 != r6) goto L_0x0056;
L_0x0030:
r3 = r0[r1];
r3 = r3.trim();
r4 = C;
r5 = 33;
r4 = r4[r5];
r3 = r3.equalsIgnoreCase(r4);
if (r3 == 0) goto L_0x0056;
L_0x0042:
r3 = 1;
r0 = r0[r3];
r0 = r0.trim();
r3 = C;
r4 = 34;
r3 = r3[r4];
r0 = r0.equalsIgnoreCase(r3);
if (r0 == 0) goto L_0x0056;
L_0x0055:
return;
L_0x0056:
if (r9 != 0) goto L_0x007e;
L_0x0058:
r0 = new d;
r1 = new java.lang.StringBuilder;
r1.<init>();
r2 = C;
r3 = 32;
r2 = r2[r3];
r1 = r1.append(r2);
r2 = r7.y;
r1 = r1.append(r2);
r2 = "\"";
r1 = r1.append(r2);
r1 = r1.toString();
r0.<init>(r1);
throw r0;
L_0x007e:
if (r9 == 0) goto L_0x0055;
L_0x0080:
r8 = r1;
goto L_0x0004;
*/
throw new UnsupportedOperationException("Method not decompiled: a.a(boolean, boolean):void");
}
protected void a() {
boolean z = q.h;
if (this.k != null) {
long currentTimeMillis = System.currentTimeMillis();
this.k.e();
this.f = (System.currentTimeMillis() - currentTimeMillis) + this.f;
}
boolean d = d();
if (!(this.k == null || d)) {
currentTimeMillis = System.currentTimeMillis();
this.k.c();
this.w = (System.currentTimeMillis() - currentTimeMillis) + this.w;
}
while (!d) {
if (this.k != null) {
currentTimeMillis = System.currentTimeMillis();
this.k.e();
this.f = (System.currentTimeMillis() - currentTimeMillis) + this.f;
}
d = d();
if (!(this.k == null || d)) {
currentTimeMillis = System.currentTimeMillis();
this.k.c();
this.w = (System.currentTimeMillis() - currentTimeMillis) + this.w;
if (z) {
return;
}
}
}
}
protected void m(String str) {
if (n(str) || str.startsWith(C[51])) {
if (this.k != null) {
this.k.e(C[52]);
this.k.b(str);
}
this.o = str;
if (!q.h) {
return;
}
}
throw new d(C[50] + str + "\"");
}
protected boolean d(String str) {
if (!(n.contains(str.toUpperCase()) || str.startsWith(C[43]) || this.e.contains(str))) {
this.e.add(str);
Log.w(C[44] + str);
}
return true;
}
protected void e(String str) {
if (a.contains(str.toUpperCase()) || str.startsWith(C[27])) {
if (this.k != null) {
this.k.e(C[29]);
this.k.b(str);
if (!q.h) {
return;
}
}
return;
}
throw new d(C[28] + str + "\"");
}
protected String k(String str) {
boolean z = q.h;
if (!str.trim().endsWith("=")) {
return str;
}
String c;
int length = str.length() - 1;
do {
} while (str.charAt(length) != '=');
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(str.substring(0, length + 1));
stringBuilder.append(C[55]);
do {
c = c();
if (c != null) {
if (!c.trim().endsWith("=")) {
break;
}
int length2 = c.length() - 1;
do {
} while (c.charAt(length2) != '=');
stringBuilder.append(c.substring(0, length2 + 1));
stringBuilder.append(C[53]);
} else {
throw new d(C[54]);
}
} while (!z);
stringBuilder.append(c);
return stringBuilder.toString();
}
/* JADX WARNING: inconsistent code. */
/* Code decompiled incorrectly, please refer to instructions dump. */
protected void f(java.lang.String r8) {
/*
r7 = this;
r3 = 2;
r6 = 0;
r0 = q.h;
r1 = "=";
r1 = r8.split(r1, r3);
r2 = r1.length;
if (r2 != r3) goto L_0x00b5;
L_0x000e:
r2 = r1[r6];
r2 = r2.trim();
r3 = 1;
r3 = r1[r3];
r3 = r3.trim();
r4 = C;
r5 = 8;
r4 = r4[r5];
r4 = r2.equalsIgnoreCase(r4);
if (r4 == 0) goto L_0x002c;
L_0x0027:
r7.g(r3);
if (r0 == 0) goto L_0x00b3;
L_0x002c:
r4 = C;
r5 = 10;
r4 = r4[r5];
r4 = r2.equals(r4);
if (r4 == 0) goto L_0x003d;
L_0x0038:
r7.e(r3);
if (r0 == 0) goto L_0x00b3;
L_0x003d:
r4 = C;
r5 = 5;
r4 = r4[r5];
r4 = r2.equals(r4);
if (r4 == 0) goto L_0x004d;
L_0x0048:
r7.m(r3);
if (r0 == 0) goto L_0x00b3;
L_0x004d:
r4 = C;
r5 = 6;
r4 = r4[r5];
r4 = r2.equals(r4);
if (r4 == 0) goto L_0x005d;
L_0x0058:
r7.c(r3);
if (r0 == 0) goto L_0x00b3;
L_0x005d:
r4 = C;
r5 = 11;
r4 = r4[r5];
r4 = r2.equals(r4);
if (r4 == 0) goto L_0x006e;
L_0x0069:
r7.i(r3);
if (r0 == 0) goto L_0x00b3;
L_0x006e:
r4 = C;
r5 = 9;
r4 = r4[r5];
r4 = r2.startsWith(r4);
if (r4 == 0) goto L_0x007f;
L_0x007a:
r7.c(r2, r3);
if (r0 == 0) goto L_0x00b3;
L_0x007f:
r4 = C;
r5 = 12;
r4 = r4[r5];
r4 = r2.equalsIgnoreCase(r4);
if (r4 == 0) goto L_0x0090;
L_0x008b:
r7.b(r3);
if (r0 == 0) goto L_0x00b3;
L_0x0090:
r0 = new d;
r1 = new java.lang.StringBuilder;
r1.<init>();
r3 = C;
r4 = 7;
r3 = r3[r4];
r1 = r1.append(r3);
r1 = r1.append(r2);
r2 = "\"";
r1 = r1.append(r2);
r1 = r1.toString();
r0.<init>(r1);
throw r0;
L_0x00b3:
if (r0 == 0) goto L_0x00ba;
L_0x00b5:
r0 = r1[r6];
r7.g(r0);
L_0x00ba:
return;
*/
throw new UnsupportedOperationException("Method not decompiled: a.f(java.lang.String):void");
}
protected boolean d() {
this.o = C[21];
String g = g();
long currentTimeMillis = System.currentTimeMillis();
String[] o = o(g);
if (o == null) {
return true;
}
if (o.length != 2) {
throw new d(C[25] + g + "\"");
}
g = o[0].toUpperCase();
String str = o[1];
this.p = (System.currentTimeMillis() - currentTimeMillis) + this.p;
if (this.k != null) {
this.k.c(g);
}
if (g.equals(C[16]) || g.equals(C[15]) || g.equals("N")) {
currentTimeMillis = System.currentTimeMillis();
a(g, str);
this.b += System.currentTimeMillis() - currentTimeMillis;
return false;
} else if (g.equals(C[17])) {
j(str);
return false;
} else if (!d(g)) {
throw new d(C[23] + g + "\"");
} else if (g.equals(C[22])) {
if (str.equals(C[18])) {
throw new e(C[20]);
}
throw new d(C[24] + str);
} else if (!g.equals(C[14]) || str.equals(b())) {
currentTimeMillis = System.currentTimeMillis();
b(g, str);
this.q += System.currentTimeMillis() - currentTimeMillis;
return false;
} else {
throw new f(C[26] + str + C[19] + b());
}
}
protected String a(String str) {
boolean z = q.h;
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(str);
do {
String c = c();
if (c != null) {
if (c.length() == 0 && !z) {
break;
}
stringBuilder.append(c);
} else {
throw new d(C[41]);
}
} while (!z);
return stringBuilder.toString();
}
protected void b(String str) {
if (this.k != null) {
this.k.e(C[64]);
this.k.b(str);
}
}
protected String b() {
return C[78];
}
static {
String[] strArr = new String[161];
String str = "\u0016?HK]!>\tM[ zFN\u0015&/ONP6t";
boolean z = true;
String[] strArr2 = strArr;
String[] strArr3 = strArr;
int i = 0;
while (true) {
char[] toCharArray = str.toCharArray();
int length = toCharArray.length;
char[] cArr = toCharArray;
for (int i2 = 0; length > i2; i2++) {
int i3;
char c = cArr[i2];
switch (i2 % 5) {
case v.m /*0*/:
i3 = 68;
break;
case at.g /*1*/:
i3 = 90;
break;
case at.i /*2*/:
i3 = 41;
break;
case at.o /*3*/:
i3 = 40;
break;
default:
i3 = 53;
break;
}
cArr[i2] = (char) (i3 ^ c);
}
str = new String(cArr).intern();
switch (z) {
case v.m /*0*/:
strArr2[i] = str;
str = "\r4_IY->\tdT*=\\IR!`\t\n";
i = 2;
strArr2 = strArr3;
z = true;
break;
case at.g /*1*/:
strArr2[i] = str;
str = "\r4_IY->\tdT*=\\IR!`\t\n";
i = 3;
strArr2 = strArr3;
z = true;
break;
case at.i /*2*/:
strArr2[i] = str;
str = "\r4_IY->\tdT*=\\IR!`\t\n";
i = 4;
strArr2 = strArr3;
z = true;
break;
case at.o /*3*/:
strArr2[i] = str;
i = 5;
strArr2 = strArr3;
str = "\u0001\u0014jgq\r\u0014n";
z = true;
break;
case at.p /*4*/:
strArr2[i] = str;
i = 6;
str = "\u0007\u0012hzf\u0001\u000e";
z = true;
strArr2 = strArr3;
break;
case at.m /*5*/:
strArr2[i] = str;
i = 7;
str = "\u00114BFZ34\t\\L4?\t\n";
z = true;
strArr2 = strArr3;
break;
case Y.f /*6*/:
strArr2[i] = str;
i = 8;
str = "\u0010\u0003ym";
z = true;
strArr2 = strArr3;
break;
case aF.v /*7*/:
strArr2[i] = str;
i = 9;
str = "\u001cw";
z = true;
strArr2 = strArr3;
break;
case aF.u /*8*/:
strArr2[i] = str;
i = 10;
str = "\u0012\u001be}p";
z = true;
strArr2 = strArr3;
break;
case Y.l /*9*/:
strArr2[i] = str;
i = 11;
str = "\b\u001bgo`\u0005\u001dl";
z = true;
strArr2 = strArr3;
break;
case Y.t /*10*/:
strArr2[i] = str;
i = 12;
str = "\u0013\u001b`l";
z = true;
strArr2 = strArr3;
break;
case Y.j /*11*/:
strArr2[i] = str;
i = 13;
str = "\u0007\u0012hzf\u0001\u000e";
z = true;
strArr2 = strArr3;
break;
case Y.p /*12*/:
strArr2[i] = str;
i = 14;
str = "\u0012\u001f{{|\u000b\u0014";
z = true;
strArr2 = strArr3;
break;
case Y.q /*13*/:
strArr2[i] = str;
i = 15;
str = "\u000b\bn";
z = true;
strArr2 = strArr3;
break;
case arj.Toolbar_titleMarginEnd /*14*/:
strArr2[i] = str;
i = 16;
str = "\u0005\u001e{";
z = true;
strArr2 = strArr3;
break;
case arj.Toolbar_titleMarginTop /*15*/:
strArr2[i] = str;
i = 17;
str = "\u0005\u001dlfa";
z = true;
strArr2 = strArr3;
break;
case VideoMessage.JPEG_THUMBNAIL_FIELD_NUMBER /*16*/:
strArr2[i] = str;
i = 18;
str = "\u0012\u0019hzq";
z = true;
strArr2 = strArr3;
break;
case arj.Toolbar_maxButtonHeight /*17*/:
strArr2[i] = str;
i = 19;
str = "d{\u0014\b";
z = true;
strArr2 = strArr3;
break;
case arj.Toolbar_collapseIcon /*18*/:
strArr2[i] = str;
i = 20;
str = "\u00102@[\u00152\u0019HZQd2H[\u0015*?Z\\P z_kT6>\tLT0;\tA[d3]\u0006";
z = true;
strArr2 = strArr3;
break;
case arj.Toolbar_collapseContentDescription /*19*/:
strArr2[i] = str;
i = 21;
str = "|\u0018`|";
z = true;
strArr2 = strArr3;
break;
case arj.Toolbar_navigationIcon /*20*/:
strArr2[i] = str;
i = 22;
str = "\u0006\u001fna{";
z = true;
strArr2 = strArr3;
break;
case arj.Toolbar_navigationContentDescription /*21*/:
strArr2[i] = str;
i = 23;
str = "\u00114BFZ34\tXG+*LZA=zGIX!`\t\n";
z = true;
strArr2 = strArr3;
break;
case arj.Toolbar_logoDescription /*22*/:
strArr2[i] = str;
i = 24;
str = "\u00114BFZ34\tjp\u0003\u0013g\bA=*L\u0012\u0015";
z = true;
strArr2 = strArr3;
break;
case arj.Toolbar_titleTextColor /*23*/:
strArr2[i] = str;
i = 25;
str = "\r4_IY->\tD\\*?\t\n";
z = true;
strArr2 = strArr3;
break;
case arj.Toolbar_subtitleTextColor /*24*/:
strArr2[i] = str;
i = 26;
str = "\r4JGX4;]AW(?\t^P6)@G[~z";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_actionMenuTextAppearance /*25*/:
strArr2[i] = str;
i = 27;
str = "\u001cw";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_actionMenuTextColor /*26*/:
strArr2[i] = str;
i = 28;
str = "\u00114BFZ34\t^T(/L\b\u0017";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_actionModeStyle /*27*/:
strArr2[i] = str;
i = 29;
str = "\u0012\u001be}p";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_actionModeCloseButtonStyle /*28*/:
strArr2[i] = str;
i = 30;
str = "\u0012\u0019hzq";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_actionModeBackground /*29*/:
strArr2[i] = str;
i = 31;
str = "\u0001\"YMV0?M\bp\n\u001e\u0013~v\u0005\bm\bB%)\tFZ0zOG@*>\u0007";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_actionModeSplitBackground /*30*/:
strArr2[i] = str;
i = 32;
str = "\u0001\u0014m\u0012c\u0007\u001b{l\u0015eg\t\n";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_actionModeCloseDrawable /*31*/:
strArr2[i] = str;
i = 33;
str = "\u0001\u0014m";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_actionModeCutDrawable /*32*/:
strArr2[i] = str;
i = 34;
str = "\u0012\u0019hzq";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_actionModeCopyDrawable /*33*/:
strArr2[i] = str;
i = 35;
str = "\u0004)\u0007_]%.ZIE4tGMA";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_actionModePasteDrawable /*34*/:
strArr2[i] = str;
i = 36;
str = "3;@L";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_actionModeSelectAllDrawable /*35*/:
strArr2[i] = str;
i = 37;
str = "0#YM";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_actionModeShareDrawable /*36*/:
strArr2[i] = str;
i = 38;
str = "\u0004)\u0007_]%.ZIE4tGMA";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_actionModeFindDrawable /*37*/:
strArr2[i] = str;
i = 39;
str = "3;@L";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_actionModeWebSearchDrawable /*38*/:
strArr2[i] = str;
i = 40;
str = "\u001cwhjy%8LD";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_actionModePopupWindowStyle /*39*/:
strArr2[i] = str;
i = 41;
str = "\u00023EM\u0015!4MMQd>\\Z\\*=\tXT6)@FRd\u0018h{prn\tJ\\*;[Q";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_textAppearanceLargePopupMenu /*40*/:
strArr2[i] = str;
i = 42;
str = "\u0016?HK]!>\tM[ zFN\u0015&/ONP6t";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_textAppearanceSmallPopupMenu /*41*/:
strArr2[i] = str;
i = 43;
str = "\u001cw";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_dialogTheme /*42*/:
strArr2[i] = str;
i = 44;
str = "\u0014(FXP6.P\b[%7L\b@*)\\XE+(]MQd8P\bC\u0007;[L\u0015vt\u0018\u0012\u0015";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_dialogPreferredPadding /*43*/:
strArr2[i] = str;
i = 45;
str = ");]K]!(\t[]+/EL\u0015,;_M\u0015\"5\\FQd";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_listDividerAlertDialog /*44*/:
strArr2[i] = str;
i = 46;
str = "d?G\\G=z@F\u00152\u0019HZQd<FZ\u0015(3GM\u000fd";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_actionDropDownStyle /*45*/:
strArr2[i] = str;
i = 47;
str = "\u001cw";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_dropdownListPreferredItemHeight /*46*/:
strArr2[i] = str;
i = 48;
str = "\u0010#YM\u001514Z]E45[\\P zKQ\u00152\u0019HZQdh\u0007\u0019\u000fd";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_spinnerDropDownItemStyle /*47*/:
strArr2[i] = str;
i = 49;
str = "\u0010\u0003ym";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_homeAsUpIndicator /*48*/:
strArr2[i] = str;
i = 50;
str = "\u00114BFZ34\tM['5MA[#z\u000b";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_actionButtonStyle /*49*/:
strArr2[i] = str;
i = 51;
str = "\u001cw";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_buttonBarStyle /*50*/:
strArr2[i] = str;
i = 52;
str = "\u0001\u0014jgq\r\u0014n";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_buttonBarButtonStyle /*51*/:
strArr2[i] = str;
i = 53;
str = "IP";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_selectableItemBackground /*52*/:
strArr2[i] = str;
i = 54;
str = "\u00023EM\u0015!4MMQd>\\Z\\*=\tXT6)@FRd+\\GA!>\u0004XG-4]IW(?\t{A63GO";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_selectableItemBackgroundBorderless /*53*/:
strArr2[i] = str;
i = 55;
str = "IP";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_borderlessButtonStyle /*54*/:
strArr2[i] = str;
i = 56;
str = "-.LE";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_dividerVertical /*55*/:
strArr2[i] = str;
i = 57;
str = "\u0001\u0014m";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_dividerHorizontal /*56*/:
strArr2[i] = str;
i = 58;
str = "\u0001\u0014m";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_activityChooserViewStyle /*57*/:
strArr2[i] = str;
i = 59;
str = "\r4_IY->\tD\\*?\u0013\b\u0017";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_toolbarStyle /*58*/:
strArr2[i] = str;
i = 60;
str = "lW#T88PU\"8m";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_toolbarNavigationButtonStyle /*59*/:
strArr2[i] = str;
i = 61;
str = "\u0005\u001e{";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_popupMenuStyle /*60*/:
strArr2[i] = str;
i = 62;
str = "0#YM";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_popupWindowStyle /*61*/:
strArr2[i] = str;
i = 63;
str = "\u001cwhjt\u0000\b";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_editTextColor /*62*/:
strArr2[i] = str;
i = 64;
str = "3;`L";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_editTextBackground /*63*/:
strArr2[i] = str;
i = 65;
str = "s\u0018`|";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_imageButtonStyle /*64*/:
strArr2[i] = str;
i = 66;
str = "\u0006\u001bzm\u0003p";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_textAppearanceSearchResultTitle /*65*/:
strArr2[i] = str;
i = 67;
str = "\u001cw";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_textAppearanceSearchResultSubtitle /*66*/:
strArr2[i] = str;
i = 68;
str = "\u0015\u000ff|p\u0000wyz|\n\u000ehjy\u0001";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_textColorSearchUrl /*67*/:
strArr2[i] = str;
i = 69;
str = "\u00102L\bP*9FL\\*=\t][7/YXZ6.LL\u0015&#\t^v%(M\bF4?J\u0012\u0015f";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_searchViewStyle /*68*/:
strArr2[i] = str;
i = 70;
str = "ft";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_listPreferredItemHeight /*69*/:
strArr2[i] = str;
i = 71;
str = "29HZQ4;[[P6uF]Ai5O\u0005X!7FZLd";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_listPreferredItemHeightSmall /*70*/:
strArr2[i] = str;
i = 72;
str = "|\u0018`|";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_listPreferredItemHeightLarge /*71*/:
strArr2[i] = str;
i = 73;
str = "\u0006\u001fna{";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_listPreferredItemPaddingLeft /*72*/:
strArr2[i] = str;
i = 74;
str = "\u0001\"YMV0?M\bf0(@FRdxkmr\r\u0014\u0013~v\u0005\bm\n\u0015 3M\b[+.\tKZ)?\t\u0000|*)]MT v\t\n";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_listPreferredItemPaddingRight /*73*/:
strArr2[i] = str;
i = 75;
str = "fzJIX!s";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_dropDownListViewStyle /*74*/:
strArr2[i] = str;
i = 76;
str = "\u0016?HK]!>\t_]!(L\bX1)]\b[+.\tJPd(LIV,?M\u0006";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_listPopupWindowStyle /*75*/:
strArr2[i] = str;
i = 77;
str = "\u0012\u0019hzq";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_textAppearanceListItem /*76*/:
strArr2[i] = str;
i = 78;
str = "vt\u0018";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_textAppearanceListItemSmall /*77*/:
strArr2[i] = str;
i = 79;
str = "|\u0018`|";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_panelBackground /*78*/:
strArr2[i] = str;
i = 80;
str = "\u0005\u001dlfad\n[GE!(]Q\u0015-)\tFZ0zZ]E45[\\P t";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_panelMenuListWidth /*79*/:
strArr2[i] = str;
i = 81;
str = "\u0015\u000ff|p\u0000wyz|\n\u000ehjy\u0001";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_panelMenuListTheme /*80*/:
strArr2[i] = str;
i = 82;
str = "\u0005\u001e{";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_listChoiceBackgroundIndicator /*81*/:
strArr2[i] = str;
i = 83;
str = "\u0015\u000ff|p\u0000wyz|\n\u000ehjy\u0001";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_colorPrimary /*82*/:
strArr2[i] = str;
i = 84;
str = "\u0014\u0019d";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_colorPrimaryDark /*83*/:
strArr2[i] = str;
i = 85;
str = "\u0010\u0000";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_colorAccent /*84*/:
strArr2[i] = str;
i = 86;
str = "\u0014\u0013j|";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_colorControlNormal /*85*/:
strArr2[i] = str;
i = 87;
str = "\u0007\u0013z";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_colorControlActivated /*86*/:
strArr2[i] = str;
i = 88;
str = "\r\u0018det\r\u0016";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_colorControlHighlight /*87*/:
strArr2[i] = str;
i = 89;
str = "\u0015\u000e`ep";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_colorButtonNormal /*88*/:
strArr2[i] = str;
i = 90;
str = "\u0014\u0015z|t\b";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_colorSwitchThumbNormal /*89*/:
strArr2[i] = str;
i = 91;
str = "\u0007\u0013m";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_controlBackground /*90*/:
strArr2[i] = str;
i = 92;
str = "\r\u0014ea{\u0001";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_alertDialogStyle /*91*/:
strArr2[i] = str;
i = 93;
str = "\u0007\u0015g|p\n\u000e\u0004aq";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_alertDialogButtonGroupStyle /*92*/:
strArr2[i] = str;
i = 94;
str = "\t\u001b`dp\u0016";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_alertDialogCenterButtons /*93*/:
strArr2[i] = str;
i = 95;
str = "\u0006\u001ehq";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_alertDialogTheme /*94*/:
strArr2[i] = str;
i = 96;
str = "\u0012\u001f{{|\u000b\u0014";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_textColorAlertDialogListItem /*95*/:
strArr2[i] = str;
i = 97;
str = "s\u0018`|";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_buttonBarPositiveButtonStyle /*96*/:
strArr2[i] = str;
i = 98;
str = "\t\u001f}";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_buttonBarNegativeButtonStyle /*97*/:
strArr2[i] = str;
i = 99;
str = "\t\tn";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_buttonBarNeutralButtonStyle /*98*/:
strArr2[i] = str;
i = 100;
str = "\u0017\u0015|fq";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_autoCompleteTextViewStyle /*99*/:
strArr2[i] = str;
i = arj.Theme_buttonStyleSmall;
str = "\u0014\u001bnmg";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_buttonStyle /*100*/:
strArr2[i] = str;
i = arj.Theme_checkboxStyle;
str = "\u0014\u001b{kp\b";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_buttonStyleSmall /*101*/:
strArr2[i] = str;
i = arj.Theme_checkedTextViewStyle;
str = "\u0013\u0015{c";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_checkboxStyle /*102*/:
strArr2[i] = str;
i = arj.Theme_editTextStyle;
str = "\u0014\u0015~mg\u0017\u0012hzp";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_checkedTextViewStyle /*103*/:
strArr2[i] = str;
i = arj.Theme_radioButtonStyle;
str = "\u0012\u0015`kp";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_editTextStyle /*104*/:
strArr2[i] = str;
i = arj.Theme_ratingBarStyle;
str = "\t\u0015mmx";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_radioButtonStyle /*105*/:
strArr2[i] = str;
i = arj.Theme_seekBarStyle;
str = "\u0005\f`";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_ratingBarStyle /*106*/:
strArr2[i] = str;
i = arj.Theme_spinnerStyle;
str = "\u000f\u001fp";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_seekBarStyle /*107*/:
strArr2[i] = str;
i = arj.Theme_switchStyle;
str = "\u0006\u0018z";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_spinnerStyle /*108*/:
strArr2[i] = str;
i = 110;
str = "\u0011\u0013m";
z = true;
strArr2 = strArr3;
break;
case arj.Theme_switchStyle /*109*/:
strArr2[i] = str;
i = 111;
str = "\u0005\u0013on";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
i = 112;
str = "\u0006\u0017y";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
i = 113;
str = "\u001cn\u0019\u0018";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
i = 114;
str = "\u001co\u0019\u0011";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
i = 115;
str = "|\u0018`|";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
i = 116;
str = "\u0005\u0015e";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
i = 117;
str = "\b\u001bkmy";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
i = 118;
str = "\u0003\u001ff";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
i = 119;
str = "\u0010\u0013on";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
i = 120;
str = "\u0014\bln";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
i = 121;
str = "\r\u0014}d";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
i = 122;
str = "\u0014\u001dy";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
i = 123;
str = "\u0012\u0013mmz";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
i = 124;
str = "\u0007\u001b{";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
i = 125;
str = "\r\u0014}mg\n\u001f}";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
i = 126;
str = "\u0013\u0017o";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
i = 127;
str = "\u0006\u001bzm\u0003p";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
i = 128;
str = "\u0014\u0012f|z";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
i = 129;
str = "\u0010\u0013}dp";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
i = 130;
str = "\u0014\u001eo";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
i = 131;
str = "\u0014\u0017k";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
i = 132;
str = "\u0014\bfl|\u0003\u0003";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
i = 133;
str = "\f\u0015dm";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
i = 134;
str = "\u000e\nlo";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
i = 135;
str = "\u0016\u0015em";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
i = 136;
str = "\u0011\be";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
i = 137;
str = "\u0016\u001f\u007f";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
i = 138;
str = "\u0007\u001dd";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
i = 139;
str = "\u0000\u0015d";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
i = 140;
str = "\u0005\nydp\b\u0013gc";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
i = 141;
str = "\u0013\u001b\u007fm";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
i = 142;
str = "\u0001\u0017hay";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
i = 143;
str = "\u0011\be";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
i = 144;
str = "\t\nlo";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
i = 145;
str = "\u0014\t";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
i = 146;
str = "\u0000\u0013k";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
i = 147;
str = "\r\tmf";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
i = 148;
str = "\t\u0019`et\r\u0016";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
i = 149;
str = "\u0003\u0013o";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
i = 150;
str = "\u0006\u001fna{";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
i = 151;
str = "\u0002\u001bq";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
i = 152;
str = "\u0002\u0014";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
i = 153;
str = "\u0001\rfzy\u0000";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
i = 154;
str = "\u0007\u001fed";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
i = 155;
str = "\u0010\u001fe";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
i = 156;
str = "\u0005\u000e}et\r\u0016";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
i = 157;
str = "\b\u0015ng";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
i = 158;
str = "\n\u0015}m";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
i = 159;
str = "\u0010\u0016q";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
i = 160;
str = "\t\nlo\u0007";
z = true;
strArr2 = strArr3;
break;
case true:
strArr2[i] = str;
C = strArr3;
A = new HashSet(Arrays.asList(new String[]{C[139], C[121], C[90], C[arj.Theme_checkboxStyle], C[133], C[arj.Theme_checkedTextViewStyle], C[120], C[arj.Theme_radioButtonStyle], C[151], C[99], C[154], C[arj.Theme_buttonStyleSmall], C[arj.Theme_switchStyle], C[arj.Theme_ratingBarStyle], C[124], C[147], C[123], C[116], C[140], C[156], C[87], C[153], C[125], C[88], C[148], C[arj.Theme_editTextStyle], C[132], C[159], C[113], C[149], C[138], C[126], C[112], C[98], C[131], C[146], C[86], C[119], C[130], C[145], C[134], C[89], C[144], C[160], C[arj.Theme_seekBarStyle], C[141], C[111], C[84], C[114], C[122]}));
a = new HashSet(Arrays.asList(new String[]{C[92], C[143], C[93], C[91]}));
n = new HashSet(Arrays.asList(new String[]{C[150], C[157], C[128], C[117], C[152], C[129], C[100], C[96], C[155], C[142], C[85], C[118], C[158], C[136], C[95], C[135], C[137], C[110], C[arj.Theme_spinnerStyle], C[94]}));
h = new HashSet(Arrays.asList(new String[]{C[97], C[115], C[83], C[127], "B"}));
String str2 = "0#YM\blt\u0003\u0017\u001c\u001f`\u0012u";
z = true;
while (true) {
char[] toCharArray2 = str2.toCharArray();
int length2 = toCharArray2.length;
char[] cArr2 = toCharArray2;
for (int i4 = 0; length2 > i4; i4++) {
int i5;
char c2 = cArr2[i4];
switch (i4 % 5) {
case v.m /*0*/:
i5 = 68;
break;
case at.g /*1*/:
i5 = 90;
break;
case at.i /*2*/:
i5 = 41;
break;
case at.o /*3*/:
i5 = 40;
break;
default:
i5 = 53;
break;
}
cArr2[i4] = (char) (i5 ^ c2);
}
str2 = new String(cArr2).intern();
switch (z) {
case v.m /*0*/:
s = Pattern.compile(str2);
d = false;
return;
default:
B = Pattern.compile(str2);
str2 = "3;@L\blt\u0003\u0017\u001c\u001f`\u0012u";
z = false;
}
}
default:
strArr2[i] = str;
str = "\b\u001bgo`\u0005\u001dl";
i = 1;
strArr2 = strArr3;
z = false;
break;
}
}
}
protected String h(String str) {
return str;
}
protected void a(String str, String[] strArr) {
boolean z = q.h;
if (str.contains(C[37]) && str.contains(C[39])) {
g(a(B, str));
String a = a(s, str);
b(a);
strArr[1] = l5.h(a + C[38]);
if (!z) {
return;
}
}
if (str.contains(C[36])) {
a = g();
g(a.substring(a.lastIndexOf(":") + 1));
a = a(s, str);
b(a);
strArr[1] = l5.h(a + C[35]);
if (!z) {
return;
}
}
String g = g();
if (g.substring(g.indexOf(".") + 1, g.lastIndexOf(":")).equals(C[40])) {
g(g.substring(g.lastIndexOf(":") + 1));
}
}
protected void c(String str) {
if (this.k != null) {
this.k.e(C[13]);
this.k.b(str);
}
}
/* JADX WARNING: inconsistent code. */
/* Code decompiled incorrectly, please refer to instructions dump. */
private java.lang.String l(java.lang.String r7) {
/*
r6 = this;
r2 = q.h;
r3 = new java.lang.StringBuilder;
r3.<init>();
r1 = 64;
r0 = ".";
r0 = r7.indexOf(r0);
r0 = r0 + 1;
L_0x0012:
r4 = r7.length();
if (r0 >= r4) goto L_0x004c;
L_0x0018:
r4 = r7.charAt(r0);
r5 = 65;
if (r4 < r5) goto L_0x0035;
L_0x0020:
r4 = r7.charAt(r0);
r5 = 90;
if (r4 > r5) goto L_0x0035;
L_0x0028:
r1 = r7.charAt(r0);
r3.append(r1);
r1 = r7.charAt(r0);
if (r2 == 0) goto L_0x0048;
L_0x0035:
r4 = r7.charAt(r0);
r5 = 45;
if (r4 != r5) goto L_0x004c;
L_0x003d:
r4 = 88;
if (r1 != r4) goto L_0x004c;
L_0x0041:
r4 = r7.charAt(r0);
r3.append(r4);
L_0x0048:
r0 = r0 + 1;
if (r2 == 0) goto L_0x0012;
L_0x004c:
r0 = r3.toString();
return r0;
*/
throw new UnsupportedOperationException("Method not decompiled: a.l(java.lang.String):java.lang.String");
}
/* JADX WARNING: inconsistent code. */
/* Code decompiled incorrectly, please refer to instructions dump. */
protected java.lang.String[] o(java.lang.String r14) {
/*
r13 = this;
r12 = 59;
r11 = 58;
r3 = 2;
r1 = 0;
r2 = 1;
r7 = q.h;
r8 = r14.length();
r4 = new java.lang.String[r3];
r0 = C;
r5 = 56;
r0 = r0[r5];
r0 = r14.startsWith(r0);
if (r0 == 0) goto L_0x00f9;
L_0x001b:
r0 = ":";
r5 = r14.split(r0);
r0 = r5.length;
if (r0 >= r3) goto L_0x0027;
L_0x0025:
r0 = 0;
L_0x0026:
return r0;
L_0x0027:
r0 = r5[r1];
r0 = r13.l(r0);
r4[r1] = r0;
r0 = r5[r2];
r6 = C;
r8 = 60;
r6 = r6[r8];
r8 = "";
r0 = r0.replaceAll(r6, r8);
r4[r2] = r0;
r0 = r4[r1];
r6 = C;
r8 = 61;
r6 = r6[r8];
r0 = r0.equals(r6);
if (r0 == 0) goto L_0x00c7;
L_0x004e:
r0 = C;
r6 = 62;
r0 = r0[r6];
r0 = r14.contains(r0);
if (r0 == 0) goto L_0x00f6;
L_0x005a:
r0 = "=";
r0 = r14.indexOf(r0);
r0 = r0 + 1;
r6 = ":";
r6 = r14.indexOf(r6);
r0 = r14.substring(r0, r6);
r13.g(r0);
r0 = r1;
L_0x0072:
r6 = r13.f();
if (r6 == 0) goto L_0x00af;
L_0x0078:
r8 = C;
r9 = 63;
r8 = r8[r9];
r8 = r6.contains(r8);
if (r8 == 0) goto L_0x00af;
L_0x0084:
r8 = new java.lang.StringBuilder;
r8.<init>();
r9 = r4[r2];
r8 = r8.append(r9);
r9 = ";";
r8 = r8.append(r9);
r9 = ":";
r9 = r6.lastIndexOf(r9);
r9 = r9 + 1;
r6 = r6.substring(r9);
r6 = r8.append(r6);
r6 = r6.toString();
r4[r2] = r6;
d = r1;
L_0x00af:
if (r0 == 0) goto L_0x00c5;
L_0x00b1:
r0 = r13.g();
r1 = ":";
r1 = r0.lastIndexOf(r1);
r1 = r1 + 1;
r0 = r0.substring(r1);
r13.g(r0);
L_0x00c5:
if (r7 == 0) goto L_0x00f3;
L_0x00c7:
r0 = r5.length;
if (r0 <= r3) goto L_0x00f0;
L_0x00ca:
r0 = r3;
L_0x00cb:
r1 = r5.length;
if (r0 >= r1) goto L_0x00f0;
L_0x00ce:
r1 = new java.lang.StringBuilder;
r1.<init>();
r3 = r4[r2];
r1 = r1.append(r3);
r3 = ":";
r1 = r1.append(r3);
r3 = r5[r0];
r1 = r1.append(r3);
r1 = r1.toString();
r4[r2] = r1;
r0 = r0 + 1;
if (r7 == 0) goto L_0x00cb;
L_0x00f0:
r13.a(r14, r4);
L_0x00f3:
r0 = r4;
goto L_0x0026;
L_0x00f6:
r0 = r2;
goto L_0x0072;
L_0x00f9:
r6 = r1;
r0 = r1;
r5 = r1;
L_0x00fc:
if (r6 >= r8) goto L_0x0109;
L_0x00fe:
r9 = r14.charAt(r6);
switch(r5) {
case 0: goto L_0x012b;
case 1: goto L_0x018b;
case 2: goto L_0x01be;
default: goto L_0x0105;
};
L_0x0105:
r6 = r6 + 1;
if (r7 == 0) goto L_0x00fc;
L_0x0109:
r0 = new d;
r1 = new java.lang.StringBuilder;
r1.<init>();
r2 = C;
r2 = r2[r12];
r1 = r1.append(r2);
r1 = r1.append(r14);
r2 = "\"";
r1 = r1.append(r2);
r1 = r1.toString();
r0.<init>(r1);
throw r0;
L_0x012b:
if (r9 != r11) goto L_0x015a;
L_0x012d:
r0 = r14.substring(r0, r6);
r3 = C;
r5 = 57;
r3 = r3[r5];
r3 = r0.equalsIgnoreCase(r3);
if (r3 == 0) goto L_0x0142;
L_0x013d:
r13.y = r14;
r0 = 0;
goto L_0x0026;
L_0x0142:
r4[r1] = r0;
r0 = r8 + -1;
if (r6 >= r0) goto L_0x0152;
L_0x0148:
r0 = r6 + 1;
r0 = r14.substring(r0);
r4[r2] = r0;
if (r7 == 0) goto L_0x0157;
L_0x0152:
r0 = "";
r4[r2] = r0;
L_0x0157:
r0 = r4;
goto L_0x0026;
L_0x015a:
r10 = 46;
if (r9 != r10) goto L_0x016f;
L_0x015e:
r0 = r14.substring(r0, r6);
r10 = r13.k;
if (r10 == 0) goto L_0x016b;
L_0x0166:
r10 = r13.k;
r10.a(r0);
L_0x016b:
r0 = r6 + 1;
if (r7 == 0) goto L_0x0105;
L_0x016f:
if (r9 != r12) goto L_0x0105;
L_0x0171:
r0 = r14.substring(r0, r6);
r5 = C;
r5 = r5[r11];
r5 = r0.equalsIgnoreCase(r5);
if (r5 == 0) goto L_0x0184;
L_0x017f:
r13.y = r14;
r0 = 0;
goto L_0x0026;
L_0x0184:
r4[r1] = r0;
r0 = r6 + 1;
if (r7 == 0) goto L_0x01c8;
L_0x018a:
r5 = r2;
L_0x018b:
r10 = 34;
if (r9 != r10) goto L_0x0192;
L_0x018f:
if (r7 == 0) goto L_0x01c5;
L_0x0191:
r5 = r3;
L_0x0192:
if (r9 != r12) goto L_0x019f;
L_0x0194:
r0 = r14.substring(r0, r6);
r13.f(r0);
r0 = r6 + 1;
if (r7 == 0) goto L_0x0105;
L_0x019f:
if (r9 != r11) goto L_0x0105;
L_0x01a1:
r0 = r14.substring(r0, r6);
r13.f(r0);
r0 = r8 + -1;
if (r6 >= r0) goto L_0x01b6;
L_0x01ac:
r0 = r6 + 1;
r0 = r14.substring(r0);
r4[r2] = r0;
if (r7 == 0) goto L_0x01bb;
L_0x01b6:
r0 = "";
r4[r2] = r0;
L_0x01bb:
r0 = r4;
goto L_0x0026;
L_0x01be:
r10 = 34;
if (r9 != r10) goto L_0x0105;
L_0x01c2:
r5 = r2;
goto L_0x0105;
L_0x01c5:
r5 = r3;
goto L_0x0105;
L_0x01c8:
r5 = r2;
goto L_0x0105;
*/
throw new UnsupportedOperationException("Method not decompiled: a.o(java.lang.String):java.lang.String[]");
}
public a() {
this.k = null;
this.o = null;
this.r = C[79];
this.e = new HashSet();
}
protected void c(String str, String str2) {
if (this.k != null) {
this.k.e(str);
this.k.b(str2);
}
}
protected void j(String str) {
throw new d(C[80]);
}
protected String g() {
if (d) {
d = false;
return z;
}
String c = c();
if (c == null) {
throw new d(C[0]);
} else if (c.trim().length() <= 0) {
return null;
} else {
return c;
}
}
/* JADX WARNING: inconsistent code. */
/* Code decompiled incorrectly, please refer to instructions dump. */
protected void b(java.lang.String r9, java.lang.String r10) {
/*
r8 = this;
r1 = q.h;
r0 = r8.o;
r2 = C;
r3 = 68;
r2 = r2[r3];
r0 = r0.equalsIgnoreCase(r2);
if (r0 == 0) goto L_0x0036;
L_0x0010:
r2 = java.lang.System.currentTimeMillis();
r0 = r8.k(r10);
r4 = r8.k;
if (r4 == 0) goto L_0x0029;
L_0x001c:
r4 = new java.util.ArrayList;
r4.<init>();
r4.add(r0);
r0 = r8.k;
r0.a(r4);
L_0x0029:
r4 = r8.v; Catch:{ OutOfMemoryError -> 0x00f2 }
r6 = java.lang.System.currentTimeMillis(); Catch:{ OutOfMemoryError -> 0x00f2 }
r2 = r6 - r2;
r2 = r2 + r4;
r8.v = r2; Catch:{ OutOfMemoryError -> 0x00f2 }
if (r1 == 0) goto L_0x00f1;
L_0x0036:
r0 = r8.o; Catch:{ OutOfMemoryError -> 0x00f2 }
r2 = C; Catch:{ OutOfMemoryError -> 0x00f2 }
r3 = 66;
r2 = r2[r3]; Catch:{ OutOfMemoryError -> 0x00f2 }
r0 = r0.equalsIgnoreCase(r2); Catch:{ OutOfMemoryError -> 0x00f2 }
if (r0 != 0) goto L_0x004f;
L_0x0044:
r0 = r8.o; Catch:{ OutOfMemoryError -> 0x00f4 }
r2 = "B";
r0 = r0.equalsIgnoreCase(r2); Catch:{ OutOfMemoryError -> 0x00f4 }
if (r0 == 0) goto L_0x0075;
L_0x004f:
r2 = java.lang.System.currentTimeMillis();
r0 = r8.a(r10); Catch:{ OutOfMemoryError -> 0x00f6 }
r4 = r8.k; Catch:{ OutOfMemoryError -> 0x00f6 }
if (r4 == 0) goto L_0x0068;
L_0x005b:
r4 = new java.util.ArrayList; Catch:{ OutOfMemoryError -> 0x00f6 }
r4.<init>(); Catch:{ OutOfMemoryError -> 0x00f6 }
r4.add(r0); Catch:{ OutOfMemoryError -> 0x00f6 }
r0 = r8.k; Catch:{ OutOfMemoryError -> 0x00f6 }
r0.a(r4); Catch:{ OutOfMemoryError -> 0x00f6 }
L_0x0068:
r4 = r8.u; Catch:{ OutOfMemoryError -> 0x0123 }
r6 = java.lang.System.currentTimeMillis(); Catch:{ OutOfMemoryError -> 0x0123 }
r2 = r6 - r2;
r2 = r2 + r4;
r8.u = r2; Catch:{ OutOfMemoryError -> 0x0123 }
if (r1 == 0) goto L_0x00f1;
L_0x0075:
r0 = r8.o; Catch:{ OutOfMemoryError -> 0x0125 }
if (r0 == 0) goto L_0x00cd;
L_0x0079:
r0 = r8.o; Catch:{ OutOfMemoryError -> 0x0127 }
r1 = C; Catch:{ OutOfMemoryError -> 0x0127 }
r2 = 65;
r1 = r1[r2]; Catch:{ OutOfMemoryError -> 0x0127 }
r0 = r0.equalsIgnoreCase(r1); Catch:{ OutOfMemoryError -> 0x0127 }
if (r0 != 0) goto L_0x00cd;
L_0x0087:
r0 = r8.o; Catch:{ OutOfMemoryError -> 0x0129 }
r1 = C; Catch:{ OutOfMemoryError -> 0x0129 }
r2 = 72;
r1 = r1[r2]; Catch:{ OutOfMemoryError -> 0x0129 }
r0 = r0.equalsIgnoreCase(r1); Catch:{ OutOfMemoryError -> 0x0129 }
if (r0 != 0) goto L_0x00cd;
L_0x0095:
r0 = r8.o; Catch:{ OutOfMemoryError -> 0x012b }
r0 = r0.toUpperCase(); Catch:{ OutOfMemoryError -> 0x012b }
r1 = C; Catch:{ OutOfMemoryError -> 0x012b }
r2 = 67;
r1 = r1[r2]; Catch:{ OutOfMemoryError -> 0x012b }
r0 = r0.startsWith(r1); Catch:{ OutOfMemoryError -> 0x012b }
if (r0 != 0) goto L_0x00cd;
L_0x00a7:
r0 = new java.lang.StringBuilder; Catch:{ OutOfMemoryError -> 0x012b }
r0.<init>(); Catch:{ OutOfMemoryError -> 0x012b }
r1 = C; Catch:{ OutOfMemoryError -> 0x012b }
r2 = 69;
r1 = r1[r2]; Catch:{ OutOfMemoryError -> 0x012b }
r0 = r0.append(r1); Catch:{ OutOfMemoryError -> 0x012b }
r1 = r8.o; Catch:{ OutOfMemoryError -> 0x012b }
r0 = r0.append(r1); Catch:{ OutOfMemoryError -> 0x012b }
r1 = C; Catch:{ OutOfMemoryError -> 0x012b }
r2 = 70;
r1 = r1[r2]; Catch:{ OutOfMemoryError -> 0x012b }
r0 = r0.append(r1); Catch:{ OutOfMemoryError -> 0x012b }
r0 = r0.toString(); Catch:{ OutOfMemoryError -> 0x012b }
com.whatsapp.util.Log.w(r0); Catch:{ OutOfMemoryError -> 0x012b }
L_0x00cd:
r0 = java.lang.System.currentTimeMillis();
r2 = r8.k;
if (r2 == 0) goto L_0x00e6;
L_0x00d5:
r2 = new java.util.ArrayList;
r2.<init>();
r3 = r8.h(r10);
r2.add(r3);
r3 = r8.k;
r3.a(r2);
L_0x00e6:
r2 = r8.c;
r4 = java.lang.System.currentTimeMillis();
r0 = r4 - r0;
r0 = r0 + r2;
r8.c = r0;
L_0x00f1:
return;
L_0x00f2:
r0 = move-exception;
throw r0; Catch:{ OutOfMemoryError -> 0x00f4 }
L_0x00f4:
r0 = move-exception;
throw r0;
L_0x00f6:
r0 = move-exception;
r4 = new java.lang.StringBuilder; Catch:{ OutOfMemoryError -> 0x0121 }
r4.<init>(); Catch:{ OutOfMemoryError -> 0x0121 }
r5 = C; Catch:{ OutOfMemoryError -> 0x0121 }
r6 = 71;
r5 = r5[r6]; Catch:{ OutOfMemoryError -> 0x0121 }
r4 = r4.append(r5); Catch:{ OutOfMemoryError -> 0x0121 }
r0 = r0.toString(); Catch:{ OutOfMemoryError -> 0x0121 }
r0 = r4.append(r0); Catch:{ OutOfMemoryError -> 0x0121 }
r0 = r0.toString(); Catch:{ OutOfMemoryError -> 0x0121 }
com.whatsapp.util.Log.e(r0); Catch:{ OutOfMemoryError -> 0x0121 }
r0 = r8.k; Catch:{ OutOfMemoryError -> 0x0121 }
if (r0 == 0) goto L_0x0068;
L_0x0119:
r0 = r8.k; Catch:{ OutOfMemoryError -> 0x0121 }
r4 = 0;
r0.a(r4); Catch:{ OutOfMemoryError -> 0x0121 }
goto L_0x0068;
L_0x0121:
r0 = move-exception;
throw r0;
L_0x0123:
r0 = move-exception;
throw r0; Catch:{ OutOfMemoryError -> 0x0125 }
L_0x0125:
r0 = move-exception;
throw r0; Catch:{ OutOfMemoryError -> 0x0127 }
L_0x0127:
r0 = move-exception;
throw r0; Catch:{ OutOfMemoryError -> 0x0129 }
L_0x0129:
r0 = move-exception;
throw r0; Catch:{ OutOfMemoryError -> 0x012b }
L_0x012b:
r0 = move-exception;
throw r0;
*/
throw new UnsupportedOperationException("Method not decompiled: a.b(java.lang.String, java.lang.String):void");
}
private boolean a(char c) {
if ((c < 'a' || c > 'z') && (c < 'A' || c > 'Z')) {
return false;
}
return true;
}
private boolean b(boolean z) {
boolean z2;
boolean z3 = q.h;
if (!z || this.j <= 0) {
z2 = false;
} else {
int i = 0;
z2 = false;
while (i < this.j) {
if (!a(z2)) {
return false;
}
i++;
if (z3) {
z2 = true;
break;
}
z2 = true;
}
}
if (!a(z2)) {
return false;
}
long currentTimeMillis;
if (this.k != null) {
currentTimeMillis = System.currentTimeMillis();
this.k.d(C[30]);
this.i = (System.currentTimeMillis() - currentTimeMillis) + this.i;
}
currentTimeMillis = System.currentTimeMillis();
a();
this.l = (System.currentTimeMillis() - currentTimeMillis) + this.l;
a(true, false);
if (this.k != null) {
long currentTimeMillis2 = System.currentTimeMillis();
this.k.a();
this.t = (System.currentTimeMillis() - currentTimeMillis2) + this.t;
}
return true;
}
public boolean a(InputStream inputStream, String str, k kVar) {
this.g = new r(new InputStreamReader(inputStream, str));
this.k = kVar;
long currentTimeMillis = System.currentTimeMillis();
if (this.k != null) {
this.k.b();
}
e();
if (this.k != null) {
this.k.d();
}
this.x = (System.currentTimeMillis() - currentTimeMillis) + this.x;
return true;
}
protected boolean n(String str) {
return h.contains(str.toUpperCase());
}
/* JADX WARNING: inconsistent code. */
/* Code decompiled incorrectly, please refer to instructions dump. */
protected void e() {
/*
r6 = this;
r1 = 1;
r2 = 0;
r4 = q.h;
r0 = r1;
L_0x0005:
r3 = r6.m;
if (r3 == 0) goto L_0x000b;
L_0x0009:
if (r4 == 0) goto L_0x0015;
L_0x000b:
r0 = r6.b(r0);
if (r0 != 0) goto L_0x0013;
L_0x0011:
if (r4 == 0) goto L_0x0015;
L_0x0013:
if (r4 == 0) goto L_0x0029;
L_0x0015:
r0 = r6.j;
if (r0 <= 0) goto L_0x0026;
L_0x0019:
r0 = r2;
r3 = r1;
L_0x001b:
r5 = r6.j;
if (r0 >= r5) goto L_0x0026;
L_0x001f:
r6.a(r3, r1);
r0 = r0 + 1;
if (r4 == 0) goto L_0x0027;
L_0x0026:
return;
L_0x0027:
r3 = r2;
goto L_0x001b;
L_0x0029:
r0 = r2;
goto L_0x0005;
*/
throw new UnsupportedOperationException("Method not decompiled: a.e():void");
}
/* JADX WARNING: inconsistent code. */
/* Code decompiled incorrectly, please refer to instructions dump. */
protected void a(java.lang.String r9, java.lang.String r10) {
/*
r8 = this;
r3 = q.h;
r0 = r8.o;
r1 = C;
r2 = 81;
r1 = r1[r2];
r0 = r0.equalsIgnoreCase(r1);
if (r0 == 0) goto L_0x0014;
L_0x0010:
r10 = r8.k(r10);
L_0x0014:
r0 = r8.k;
if (r0 == 0) goto L_0x0081;
L_0x0018:
r1 = new java.lang.StringBuilder;
r1.<init>();
r4 = new java.util.ArrayList;
r4.<init>();
r5 = r10.length();
r0 = 0;
L_0x0027:
if (r0 >= r5) goto L_0x0075;
L_0x0029:
r6 = r10.charAt(r0);
r2 = 92;
if (r6 != r2) goto L_0x0059;
L_0x0031:
r2 = r5 + -1;
if (r0 >= r2) goto L_0x0059;
L_0x0035:
r2 = C;
r7 = 82;
r2 = r2[r7];
r2 = r9.equals(r2);
if (r2 != 0) goto L_0x0059;
L_0x0041:
r2 = r0 + 1;
r2 = r10.charAt(r2);
r2 = r8.b(r2);
if (r2 == 0) goto L_0x0054;
L_0x004d:
r1.append(r2);
r0 = r0 + 1;
if (r3 == 0) goto L_0x0057;
L_0x0054:
r1.append(r6);
L_0x0057:
if (r3 == 0) goto L_0x0071;
L_0x0059:
r2 = r0;
r0 = 59;
if (r6 != r0) goto L_0x0085;
L_0x005e:
r0 = r1.toString();
r4.add(r0);
r0 = new java.lang.StringBuilder;
r0.<init>();
if (r3 == 0) goto L_0x0082;
L_0x006c:
r0.append(r6);
r1 = r0;
r0 = r2;
L_0x0071:
r0 = r0 + 1;
if (r3 == 0) goto L_0x0027;
L_0x0075:
r0 = r1.toString();
r4.add(r0);
r0 = r8.k;
r0.a(r4);
L_0x0081:
return;
L_0x0082:
r1 = r0;
r0 = r2;
goto L_0x0071;
L_0x0085:
r0 = r1;
goto L_0x006c;
*/
throw new UnsupportedOperationException("Method not decompiled: a.a(java.lang.String, java.lang.String):void");
}
protected String a(Pattern pattern, String str) {
Matcher matcher = pattern.matcher(str);
if (matcher.find()) {
return matcher.group(1);
}
Log.d(C[45] + pattern.pattern() + C[46] + str);
return null;
}
protected String c() {
return this.g.readLine();
}
}
| GigaDroid/Decompiled-Whatsapp | a.java |
1,314 | class N
{
static int n;//static is per class one copy.(single copy shared by many objects).
//instance --> per object independent one copy.
int i;
N()
{
n=10;
i=15;
}
public static void main(String args[])
{
//n=10;
N o=new N();
o.test3(5);
o.test3(n);//actual argument
o.test3();
o.test3(n);//actual argument
}
public void test3(int i)//int i is the formal argument
{
//this.i=i;
System.out.println(i);
}
public void test3()
{
//this.i=i;
System.out.println(i);
}
} | NibeditaMondal/javaleetcode | N.java |
1,318 | function sayHi()
{
// alert("Hi" + document.getElementById('input').value);
var textBoxes = document.getElementsByTagName("input");
for (var i = 0;i<3;i++)
{
alert(textBoxes[i].value);
console.log(textBoxes[i].value)
}
}
| SharvaniA/web-codes | hi.js |
1,323 | import java.util.*;
public class Taxi implements Comparable {
private Station origin;
private int maxSize;
private double startTime;
private double endTime;
private double returnTime;
private double emptyMiles;
private List<Trip> trips;
public Taxi(int tripSize) {
maxSize = tripSize;
startTime = Double.POSITIVE_INFINITY;
endTime = Double.NEGATIVE_INFINITY;
returnTime = Double.NEGATIVE_INFINITY;
emptyMiles = 0;
trips = new ArrayList<Trip>();
origin = null;
}
public void assignTo(Station station) {
if (origin == null)
origin = station;
}
public void combine(Taxi t) {
if (t.size() < this.size()) {
System.out.println("size inconsistency");
return;
}
for (Trip trip: t.trips()) {
this.addTrip(trip);
}
emptyMiles += t.emptyMiles;
}
public void addTrip(Trip trip) {
// if (trip.size() > maxSize) return; // if trip size is too big for taxi...
trips.add(trip);
// update the start time of taxi, if needed
if (trip.departTime() < startTime)
startTime = trip.departTime();
// update teh end time if taxi, if needed
if (trip.arriveTime() > endTime)
endTime = trip.arriveTime();
}
// update when this taxi will return to station
public void updateReturn(double time) {
if (time > returnTime)
returnTime = time;
}
public void updateEmptyMiles(double miles) {
emptyMiles += miles;
}
public Double startTime() {
return (Double)startTime;
}
public int size() {
return maxSize;
}
public Double endTime() {
return (Double)endTime;
}
public Double returnTime() {
return (Double)returnTime;
}
public boolean contains(Trip trip) {
return trips.contains(trip);
}
//compare starttime with another taxi
public int compareTo(Object obj) {
Taxi other = (Taxi) obj;
return ((Double)startTime).compareTo(other.startTime());
}
public String oStation() {
return origin.center();
}
public List<Trip> trips() {
return trips;
}
public double emptyMiles() {
return emptyMiles;
}
public double vehicleMiles() {
double vehicleMiles = 0;
for (Trip trip : trips) {
vehicleMiles += trip.tripMiles();
}
return vehicleMiles;
}
} | nokafor/ORF376 | Taxi.java |
1,325 | class Solution {
public int firstUniqChar(String s) {
HashMap<Character, Integer> mp = new HashMap<>();
for (char a : s.toCharArray()) {
mp.put(a, mp.getOrDefault(a, 0) + 1);
}
for (int i = 0; i < s.length(); i++) {
if (mp.get(s.charAt(i)) == 1) {
return i;
}
}
return -1;
}
}
| Mahima507/LeetCode-solutions | 387. First Unique Character in a String.java |
1,326 |
public class Four {
public static void notMain(final String[] args) {
System.out.println(Long.toBinaryString(123));
System.out.println(Long.toBinaryString(Long.rotateLeft(123, 1)));
System.out.println(Long.toBinaryString(Long.rotateRight(123, 1)));
}
public static void main(final String[] args) {
final int minNum = 100;
final int maxNum = 999;
final int maxPal = maxNum * maxNum;
long max = minNum * minNum;
long pal = Four.isPalindrome(max) ? max : Four.nextPalindrome(max, false);
while (pal <= maxPal) {
for (int i = minNum; i <= maxNum; i++) {
if (pal % i == 0) {
final int div = (int) (pal / i);
if (div >= minNum && div <= maxNum) {
if (max < pal) {
max = pal;
System.out.println(i + " * " + div + " = " + pal);
}
}
}
}
pal = Four.nextPalindrome(pal);
}
}
static void printResult(final int caseNumber, final long result) {
System.out.println("Case #" + caseNumber + ": " + result);
}
static void printResult(final int caseNumber, final String result) {
System.out.println("Case #" + caseNumber + ": " + result);
}
static long nextPalindrome(final long base) {
return Four.nextPalindrome(base, true);
}
static long nextPalindrome(final long base, final boolean increment) {
if (base < 9) { return base + 1; }
if (base == 9) { return 11; }
final int digits = Four.digitsNum(base);
final int halfDigits = digits >> 1;
if (digits - halfDigits == halfDigits) {
final long tens = decPow(halfDigits);
final long mainPart = base / tens + (increment ? 1 : 0);
if (Four.digitsNum(mainPart) == halfDigits) {
return mainPart * tens + Four.reverse(mainPart);
}
return mainPart * tens + Four.reverse(mainPart / 10);
}
final long tens = decPow(halfDigits);
long mainPart = base / tens;
int middle = (int) (mainPart % 10);
mainPart = mainPart / 10;
if (middle < 9) {
if (increment) { middle++; }
return mainPart * tens * 10 + middle * tens + Four.reverse(mainPart);
}
if (increment) { mainPart++; }
return mainPart * tens * 10 + Four.reverse(mainPart);
}
static long reverse(final long number) {
if (number <= 9) { return number; }
long result = 0;
long num = number;
while (num > 0) {
final long rem = num % 10;
result = result * 10 + rem;
num = num / 10;
}
return result;
}
static boolean isPalindrome(final long number) {
if (number <= 9) { return true; }
return number == Four.reverse(number);
}
static int digitsNum(final long number) {
return 1 + (int) Math.log10(number);
}
static long decPow(final int pow) {
if (pow <= 9) { return smallDecPow(pow); }
int left = pow / 2;
return smallDecPow(left) * smallDecPow(pow - left);
}
static long smallDecPow(int pow) {
switch (pow) {
case 0: return 1;
case 1: return 10;
case 2: return 100;
case 3: return 1000;
case 4: return 10000;
case 5: return 100000;
case 6: return 1000000;
case 7: return 10000000;
case 8: return 100000000;
case 9: return 1000000000;
default:
return decPow(pow);
}
}
}
| Vandalko/eulerproject | 4.java |
1,330 | public class InvoiceTest {
public static void main(String[] args) {
// This is really just a run harness to test Invoice.java
//This invoice should work just fine. All inputs are positive and the expected Invoice amount is 24.95
Invoice invoice1 = new Invoice("P000001", "Part Number 1", 5, 4.99);
System.out.println("Standard Functionality Test. Total Invoice should be 24.95");
printInvoiceMessage(invoice1);
//In this test, I'm setting the quantity to 0 to verify that the Invoice amount is 0
Invoice invoice2 = new Invoice("P000002", "Part Number 2", 0, 4.99);
System.out.println("Testing 0 Quantity. Total Invoice should be 0");
printInvoiceMessage(invoice2);
//This is to test that the Quantity is set to 0 when the quanity given to the constructor is less than 0
Invoice invoice3 = new Invoice("P000003", "Part Number 3", -2, 4.99);
System.out.println("Testing negative Quanity. Total Invoice should be 0");
printInvoiceMessage(invoice3);
//This is to test that the Price Per Item is set to 0.0 when the price per item given to the constructor is less than 0.0
Invoice invoice4 = new Invoice("P000004", "Part Number 4", 5, -4.99);
System.out.println("Testing Negative Price. Total Invoice should be 0");
printInvoiceMessage(invoice4);
//Another standard functionality invoice with some larger numbers
Invoice invoice5 = new Invoice("P000005", "Part Number 5", 72, 187.65);
System.out.println("Standard Functionality Test with some larger numbers. Total Invoice should be 13510.80");
printInvoiceMessage(invoice5);
//Try one last one using the default constuctor and using the setter methods on variables
Invoice invoice6 = new Invoice();
invoice6.setPartNumber("P00006");
invoice6.setPartDescription("Part Number 6");
invoice6.setQuantity(20);
invoice6.setPricePerItem(22.99);
System.out.println("Testing Bean setters. Total Invoice should be 459.80");
printInvoiceMessage(invoice6);
//Try setting the Quantity to a negative to verify that it is reset to 0
invoice6.setQuantity(-33);
System.out.println("Testing Bean setters with negative Quantity. Total Invoice should be 0");
printInvoiceMessage(invoice6);
//Try setting the Price Per Item to a negative to verify that that it is set to 0.0
invoice6.setQuantity(20); //Reseting this to the original value to only test Price Per Item.
invoice6.setPricePerItem(-33.98);
System.out.println("Testing Bean setters with negative Price Per Item. Total Invoice should be 0");
printInvoiceMessage(invoice6);
}
public static void printInvoiceMessage(Invoice invoice){
//Just print the relevant invoice information
System.out.printf("Invoice for Part: %s \t", invoice.getPartNumber() );
System.out.printf("Part Description: %s \t", invoice.getPartDescription() );
System.out.printf("Quantity: %s \t", invoice.getQuantity() );
System.out.printf("Price Per Item: %.2f \n", invoice.getPricePerItem());
System.out.printf("Total Invoice Amount: %.2f \n", invoice.getInvoiceAmount() );
System.out.println("***************************************************");
System.out.println();
}
} | 21bq1a4232/Programming_examples | .java |
1,331 | public class B {
int i;
public B( int j ) {
i = j;
}
void p() {
System.out.println( i );
}
}
| SFSU-CSC-413/Lecture-3 | B.java |
1,333 | // Generate Fibonacci Series
import java.util.Scanner;
public class J {
private static int limit;
public static void main(String[] args) {
Scanner scannerObject = new Scanner(System.in);
try {
System.out.print("Enter the limit of the series: ");
limit = scannerObject.nextInt();
System.out.println("Your entered limit is " + limit);
fibonacci();
} catch (Exception e) {
System.out.println("Error occurred!!\n" + e + "\nPlease enter a valid number and try again.");
main(args);
}
scannerObject.close();
}
static void fibonacci() {
int a = 0;
int b = 1;
System.out.print("Fibonacci Series: ");
for(int i = 0; i < limit; i++) {
System.out.print(a + ", ");
int c = a;
a = b;
b = c + b;
}
}
}
| Bishal-9/SDET-Java | J.java |
1,336 | class Emp{
int id; // 4 Byte
double salary; // 8 Byte
String name; // Amit Srivastava (char 2 Byte)
}
public class E {
public static void main(String[] args) {
int arr[] = {10, 20, 30, 4};
int arr2[] = new int[5];
System.out.println(arr2);
int [] arr3 = new int[5];
int [] arr4 = new int[]{10,20,30,40};
Emp e = new Emp();
}
}
| brainmentorspvtltd/RD-JAVA_DSA-MIX | E.java |
1,344 | import java.util.HashSet;
class Solution {
public int lengthOfLongestSubstring(String s) {
if(s.length() == 0) {
return 0;
}
int max = 1;
for(int i = 0; i < s.length(); i++) {
HashSet<Character> letters = new HashSet<>();
letters.add(s.charAt(i));
for(int j = i + 1; j < s.length(); j++) {
if(letters.contains(s.charAt(j))) {
break;
}
letters.add(s.charAt(j));
}
if(max < letters.size()) {
max = letters.size();
}
}
return max;
}
}
| kalongn/LeetCode_Solution | 3.java |
1,346 | // print even numbers first then odds
public class even_odd_sort{
public static void main (String args[]){
int[] arr={1,2,5,3,4,6};
int n=arr.length;
int k=0;
int m=1;
int res[]=new int[n];
for(int i=0;i<n;i++){
if(arr[i]%2==0){
res[k++]=arr[i];
}
else{
res[n-m]=arr[i];
m++;
}
}
for(int i=0;i<n;i++){
System.out.println(res[i]);
}
}
}
| 1ramagrawal0610/h2 | bhargavi |
1,354 | public class NQueensWithFirstQueenPlaced {
public static void printBoard(int[][] board) {
int n = board.length;
System.out.println();
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
System.out.print(board[i][j] + " ");
}
System.out.println();
}
}
public static boolean isSafe(int[][] board, int row, int col) {
int n = board.length;
// Check left side of the current row
for (int i = 0; i < col; i++) {
if (board[row][i] == 1) {
return false;
}
}
// Check upper diagonal on the left side
for (int i = row, j = col; i >= 0 && j >= 0; i--, j--) {
if (board[i][j] == 1) {
return false;
}
}
// Check lower diagonal on the left side
for (int i = row, j = col; i < n && j >= 0; i++, j--) {
if (board[i][j] == 1) {
return false;
}
}
return true;
}
public static boolean solveNQueens(int[][] board, int col) {
int n = board.length;
if (col >= n) {
// All queens are placed, return true
return true;
}
// Try placing the queen in each row of the current column
for (int i = 0; i < n; i++) {
if (isSafe(board, i, col)) {
// Place the queen
board[i][col] = 1;
// Recur to place the rest of the queens
if (solveNQueens(board, col + 1)) {
return true;
}
// If placing the queen in board[i][col] doesn't lead to a solution, backtrack
board[i][col] = 0;
}
}
return false;
}
public static void main(String[] args) {
int n = 8; // Change 'n' to the desired board size
int[][] board = new int[n][n];
// Place the first queen at (0, 0)
board[0][0] = 1;
// Call the backtracking function to solve the rest of the board
if (solveNQueens(board, 1)) {
System.out.println("Solution exists:");
printBoard(board);
} else {
System.out.println("No solution exists.");
}
}
}
| sahil-gidwani/DAA | 5.java |
1,357 | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int vtr = 10;
double[] vetor = new double[vtr];
for (int i = 0; i < vtr; i++) {
System.out.print("Digite o número " + (i + 1) + ": ");
vetor[i] = scanner.nextDouble();
}
System.out.println("Números em ordem inversa:");
for (int i = vtr - 1; i >= 0; i--) {
System.out.println(vetor[i]);
}
scanner.close();
}
}
| Pedro-HCM/una-lista-05-csharp-202302- | 2.java |
1,358 | class Solution {
public int[] twoSum(int[] nums, int target) {
int i = 0;
int j = 0;
boolean isFinished = false;
for(i = 0; i < nums.length - 1; i++){
for (j = i + 1;j < nums.length; j++){
isFinished = false;
if (nums[i] + nums[j] == target){
isFinished = true;
break;
}
}
if(isFinished){
break;
}
}
return new int[]{i,j};
}
} | bbohosyan/LeetCode | 1.java |
1,359 | import java.awt.Canvas;
import java.awt.Color;
import java.awt.Graphics;
import java.io.IOException;
import javax.swing.JFrame;
import javax.swing.WindowConstants;
public class B extends Canvas {
private static final int SCALE = 10;
public static void drawPicture(double[] values) {
try {
int dim = (int) Math.sqrt(values.length);
double[][] newValues = new double[dim][dim];
for (int i = 0; i < values.length; i++) {
newValues[i % dim][i / dim] = values[i];
}
drawPicture(dim, newValues);
} catch (Exception e) {
return;
}
}
public static void drawPicture(int dim, double[][] newValues) {
JFrame frame = new JFrame();
frame.setSize(50 + Math.max(280, SCALE*dim), 50 + Math.max(280, SCALE*dim));
frame.add(new B(newValues));
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
frame.setVisible(true);
}
private static final long serialVersionUID = 1480902466428347458L;
private final int WIDTH;
private final int HEIGHT;
private double[][] values;
public B(double[][] values) {
super();
this.WIDTH = values.length;
this.HEIGHT = values[0].length;
this.values = values;
}
@Override
public void paint(Graphics g) {
super.paint(g);
for (int x = 0; x < WIDTH; x++) {
for (int y = 0; y < HEIGHT; y++) {
g.setColor(color(this.values[x][y]));
for (int i = 0; i < SCALE; i++) {
for (int j = 0; j < SCALE; j++) {
g.drawLine(SCALE*x + i, SCALE*y + j, SCALE*x + i, SCALE*y + j);
}
}
}
}
}
private Color color(double value) {
return Color.getHSBColor(fromValue(value), 1.0f, .5f);
}
private float fromValue(double value) {
return (float) (((300 * (1.0 - value) + 300) % 360) / 360.0);
}
} | rmshree/ECS189E | B.java |
1,361 | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package tasarimcigurkan.dev.gittest3;
public final class R {
public static final class attr {
}
public static final class drawable {
public static final int ic_launcher=0x7f020000;
}
public static final class layout {
public static final int main=0x7f030000;
}
public static final class string {
public static final int app_name=0x7f040000;
public static final int git_test_3=0x7f040001;
}
public static final class style {
public static final int AppTheme=0x7f050000;
}
}
| alimogh/learning_android_with_aide | R.java |
1,362 | class Solution {
public int findMaximizedCapital(int k, int w, int[] profits, int[] capital) {
int n = profits.length;
int[][] projects = new int[n][2];
for (int i = 0; i < n; i++) {
projects[i][0] = capital[i];
projects[i][1] = profits[i];
}
Arrays.sort(projects, (a, b) -> Integer.compare(a[0], b[0]));
int i = 0;
PriorityQueue<Integer> maximizeCapital = new PriorityQueue<>(Collections.reverseOrder());
while (k-- > 0) {
while (i < n && projects[i][0] <= w) {
maximizeCapital.offer(projects[i][1]);
i++;
}
if (maximizeCapital.isEmpty()) {
break;
}
w += maximizeCapital.poll();
}
return w;
}
}
| VISWANATHAVELAYUTHAM/PROJECT-MAYHEM | Problem Solving/LC 502. IPO |
1,364 | import java.io.*;
import java.util.*;
abstract class Shape {
public static final double PI = 3.14;
protected double x;
protected double y;
protected Shape(double x, double y) {
this.x = x;
this.y = y;
}
public abstract void draw();
public abstract double getArea();
}
// 여기에 Circle과 Rectangle 클래스를 작성하시오.
class Circle extends Shape {
public static final double PI = 3.14;
double radius;
public Circle(double x, double y, double radius) {
super(x, y);
this.radius = radius;
}
public void draw() {
}
public double getArea() {
return this.radius * this.radius * PI;
}
}
class Rectangle extends Shape {
double width;
double height;
public Rectangle(double x, double y, double width, double height) {
super(x, y);
this.width = width;
this.height = height;
}
public void draw() {
}
public double getArea() {
return this.width * this.height;
}
}
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int noShape = scan.nextInt();
Shape[] shapes = new Shape[noShape];
for (int i = 0; i < noShape; i++) {
String s = scan.next();
if (s.equals("Rectangle")) {
double x = scan.nextDouble();
double y = scan.nextDouble();
double width = scan.nextDouble();
double height = scan.nextDouble();
shapes[i] = new Rectangle(x, y, width, height);
} else if (s.equals("Circle")) {
double x = scan.nextDouble();
double y = scan.nextDouble();
double radius = scan.nextDouble();
shapes[i] = new Circle(x, y, radius);
}
}
// 그 다음엔 면적을 계산한다.
double sumArea = 0;
for (Shape shape : shapes) {
sumArea += shape.getArea();
}
System.out.printf("%.2f", sumArea);
}
} | zibb03/HUFS-Data-Structure | 0.java |
1,365 | public class Employee{
int N;
int id;
int salary;
String lastname;
public Employee(int id, int salary, String lastname){
this.id = id;
this.salary = salary;
this.lastname = lastname;
}
void merge(int arr[], int l, int m, int r)
{
// Find sizes of two subarrays to be merged
int n1 = m - l + 1;
int n2 = r - m;
/* Create temp arrays */
int L[] = new int[n1];
int R[] = new int[n2];
/*Copy data to temp arrays*/
for (int i = 0; i < n1; ++i)
L[i] = arr[l + i];
for (int j = 0; j < n2; ++j)
R[j] = arr[m + 1 + j];
/* Merge the temp arrays */
// Initial indexes of first and second subarrays
int i = 0, j = 0;
// Initial index of merged subarray array
int k = l;
while (i < n1 && j < n2) {
if (L[i] <= R[j]) {
arr[k] = L[i];
i++;
}
else {
arr[k] = R[j];
j++;
}
k++;
}
/* Copy remaining elements of L[] if any */
while (i < n1) {
arr[k] = L[i];
i++;
k++;
}
/* Copy remaining elements of R[] if any */
while (j < n2) {
arr[k] = R[j];
j++;
k++;
}
}
// Main function that sorts arr[l..r] using
// merge()
void sort(int arr[], int l, int r)
{
if (l < r) {
// Find the middle point
int m =l+ (r-l)/2;
// Sort first and second halves
sort(arr, l, m);
sort(arr, m + 1, r);
// Merge the sorted halves
merge(arr, l, m, r);
}
}
/* A utility function to print array of size n */
static void printArray(int arr[])
{
int n = arr.length;
for (int i = 0; i < n; ++i)
System.out.print(arr[i] + " ");
System.out.println();
}
} | Renfrew100/Leetcode | X.java |
1,366 | import java.util.*;
import java.math.BigInteger;
class Main
{
BigInteger cero = new BigInteger("0");
BigInteger uno = new BigInteger("1");
BigInteger dos = new BigInteger("2");
public static void main(String[] args)
{
Main m = new Main();
m.solve();
}
void solve()
{
Scanner sc = new Scanner(System.in);
BigInteger x = sc.nextBigInteger(), N = x, K = uno, nn, kk;
BigInteger[] fo = {uno, uno},
last = new BigInteger[350], neo = new BigInteger[350];
for(int i = 0; i < 350; i++)
last[i] = BigInteger.valueOf(i + 1);
for(BigInteger i = dos; cal(i.add(i).subtract(uno), i).compareTo(x) < 0; i = i.add(uno))
{
BigInteger lo = uno, hi = uno, mid, res = uno;
while(cal(hi.add(i), i).compareTo(x) < 0)
hi = hi.multiply(dos);
while(lo.compareTo(hi) <= 0)
{
mid = lo.add(hi).divide(dos);
if(cal(i.add(mid), i).compareTo(x) >= 0)
{
res = mid; hi = mid.subtract(uno);
}
else
lo = mid.add(uno);
}
if(cal(i.add(res), i).equals(x))
{
nn = i.add(res);
kk = i;
if(nn.compareTo(N) < 0)
{
N = nn;
K = kk;
}
}
last = neo;
}
if(x.equals(uno))
System.out.println("0 0");
System.out.println(N + " " + K);
}
BigInteger cal(BigInteger n, BigInteger k)
{
BigInteger bino = uno;
for(BigInteger i = cero; i.compareTo(k) < 0; i = i.add(uno))
bino = bino.multiply(n.subtract(i));
for(int i = 2; BigInteger.valueOf(i).compareTo(k) <= 0; i++)
bino = bino.divide(BigInteger.valueOf(i));
return bino;
}
} | pacha2880/competitive_programming_codes | Problem L. AI Jeopardy.java |
1,368 | package dp;
import java.util.Arrays;
public class MinimumPathSum {
public static void main(String[] args) {
int m=3,n=3;
int[][] dp=new int[m][n];
int[][] path=new int[][] {{1,3,1},
{1,5,1},
{4,2,1}};
for(int i=0;i<m;i++)Arrays.fill(dp[i], -1);
System.out.println(solve(m-1, n-1, dp,path));
System.out.println(solve1(m,n,path));
}
public static int solve(int m,int n,int[][] dp,int[][] path) {
if(m==0 && n==0)return path[0][0];
if(m<0||n<0)return Integer.MAX_VALUE;
if(dp[m][n]!=-1)return dp[m][n];
return dp[m][n]=path[m][n]+Math.min(solve(m-1,n,dp,path),solve(m,n-1,dp,path));
}
public static int solve1(int m,int n,int[][] path) {
int[][] dp=new int[m][n];
dp[0][0]=path[0][0];
for(int i=0;i<m;i++) {
for(int j=0;j<n;j++) {
if(i==0 && j==0)continue;
int x=Integer.MAX_VALUE;
int y=Integer.MAX_VALUE;
if(i>0)x=dp[i-1][j];
if(j>0)y=dp[i][j-1];
dp[i][j]=path[i][j]+Math.min(x, y);
}
}
return dp[m-1][n-1];
}
}
| 1ramagrawal0610/h3 | mps |
1,369 | class Solution {
public List<List<Integer>> fourSum(int[] nums, int target) {
int n = nums.length;
List<List<Integer>> ans = new ArrayList<>();
Arrays.sort(nums);
Set<List<Integer>> set = new HashSet<>();
for(int i=0; i<n; i++){
for(int j=i+1; j<n; j++){
int k = j+1;
int l = n-1;
while(k<l){
long sum = (long) nums[i]+nums[j]+nums[k]+nums[l];
if(sum == target){
List<Integer> al = new ArrayList<>();
al.add(nums[i]);
al.add(nums[j]);
al.add(nums[k]);
al.add(nums[l]);
set.add(al);
k++;
l--;
}
else if(sum < target) k++;
else if(sum > target) l--;
}
}
}
ans.addAll(set);
return ans;
}
}
| Chandana-B-A/leetcode_practices | 4 sum |
1,371 | package dictionary_spell_checker;
import dictionary_spell_checker.D.Bucket.Node;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
/**
@author makena
*/
public class D {
private int M = 5719; //prime number
final private Bucket[] array;
public D() {
this.M = M;
array = new Bucket[M];
for (int i = 0; i < M; i++) {
array[i] = new Bucket();
}
}
private int hash(String key) {
return (key.hashCode() & 0x7fffffff) % M;
}
//call hash() to decide which bucket to put it in, do it.
public void add(String key) {
array[hash(key)].put(key);
}
//call hash() to find what bucket it's in, get it from that bucket.
public boolean contains(String input) {
input = input.toLowerCase();
return array[hash(input)].get(input);
}
public void build(String filePath) {
try {
BufferedReader reader = new BufferedReader(new FileReader(filePath));
String line;
while ((line = reader.readLine()) != null) {
add(line);
}
} catch (IOException ioe) {
ioe.printStackTrace();
}
}
//this method is used in my unit tests
public String[] getRandomEntries(int num){
String[] toRet = new String[num];
for (int i = 0; i < num; i++){
//pick a random bucket, go out a random number
Node n = array[(int)Math.random()*M].first;
int rand = (int)Math.random()*(int)Math.sqrt(num);
for(int j = 0; j<rand && n.next!= null; j++) n = n.next;
toRet[i]=n.word;
}
return toRet;
}
class Bucket {
private Node first;
public boolean get(String in) { //return key true if key exists
Node next = first;
while (next != null) {
if (next.word.equals(in)) {
return true;
}
next = next.next;
}
return false;
}
public void put(String key) {
for (Node curr = first; curr != null; curr = curr.next) {
if (key.equals(curr.word)) {
return; //search hit: return
}
}
first = new Node(key, first); //search miss: add new node
}
class Node {
String word;
Node next;
public Node(String key, Node next) {
this.word = key;
this.next = next;
}
}
}
}
| roselynemakena/Java-Dictionary---SpellChecker | D.java |
1,372 | import java.util.Objects;
public class B {
long id;
public B(long id) {
this.id = id;
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof B)) return false;
B b = (B) o;
return getId() == b.getId();
}
}
//remove 2 methods
| dmitriystel/demo-pr | B.java |
1,373 | import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* A big red X that fades away after being added to the world
*
* @author Kevin Biro
* @version January 16th 2019
*/
public class X extends Actor
{
private int timer;
private GreenfootImage image;
/**
* Constructs the X by setting the time alive and image
*/
public X()
{
timer = 200;
image = getImage();
image.setTransparency(200);
setImage(image);
}
/**
* Decreases the timer until it reaches 0. The object will then be removed
*/
public void act()
{
timer--;
image.setTransparency(timer);
setImage(image);
if(timer < 1)
getWorld().removeObject(this);
}
}
| kevinbiro99/Tower-Defence | X.java |
1,376 | import java.util.*;
class Main{
public static void main(String[] a){
int[] nums={0,1,2,3,4};
int[] index={0,1,2,2,1};
int[] target=new int[nums.length];
ArrayList al=new ArrayList();
for(int i=0;i<nums.length;i++){
al.add(index[i],nums[i]);
}
for(int i=0;i<al.size();i++){
System.out.print(al.get(i)+" ");
}
}
}
| ramya6828/star | 1.java |
1,377 | class Solution {
public int orangesRotting(int[][] grid) {
if(grid == null || grid.length == 0) return 0;
int rows = grid.length;
int cols = grid[0].length;
Queue<int[]> queue = new LinkedList<>();
int count_fresh = 0;
//Put the position of all rotten oranges in queue
//count the number of fresh oranges
for(int i = 0 ; i < rows ; i++) {
for(int j = 0 ; j < cols ; j++) {
if(grid[i][j] == 2) {
queue.offer(new int[]{i , j});
}
else if(grid[i][j] == 1) {
count_fresh++;
}
}
}
//if count of fresh oranges is zero --> return 0
if(count_fresh == 0) return 0;
int count = 0;
int[][] dirs = {{1,0},{-1,0},{0,1},{0,-1}};
//bfs starting from initially rotten oranges
while(!queue.isEmpty()) {
++count;
int size = queue.size();
for(int i = 0 ; i < size ; i++) {
int[] point = queue.poll();
for(int dir[] : dirs) {
int x = point[0] + dir[0];
int y = point[1] + dir[1];
//if x or y is out of bound
//or the orange at (x , y) is already rotten
//or the cell at (x , y) is empty
//we do nothing
if(x < 0 || y < 0 || x >= rows || y >= cols || grid[x][y] == 0 || grid[x][y] == 2) continue;
//mark the orange at (x , y) as rotten
grid[x][y] = 2;
//put the new rotten orange at (x , y) in queue
queue.offer(new int[]{x , y});
//decrease the count of fresh oranges by 1
count_fresh--;
}
}
}
return count_fresh == 0 ? count-1 : -1;
}
}
| adityassharma-ss/Leetcode | RottingOranges.java |
1,378 | import java.util.*;
class rect
{
private int len, bre;
public void input1()
{
Scanner in =new Scanner (System .in);
System.out.println("ENTER LENGTH AND BREATH OF THE RECTANGLE");
len=in.nextInt();
bre=in.nextInt();
}
int area()
{
int a;
a=len*bre;
return(a);
}
public static void main()
{
rect obj=new rect();
obj.input1();
obj.area();
}
}
| AastikM/HacktoberFest-1 | xyz.java |
1,379 | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int quantidadeNumeros = 5;
int soma = 0;
for (int i = 1; i <= quantidadeNumeros; i++) {
System.out.print("Digite o " + i + "º número: ");
int numero = scanner.nextInt();
soma += numero;
}
double media = (double) soma / quantidadeNumeros;
System.out.println("A soma dos números é: " + soma);
System.out.println("A média dos números é: " + media);
scanner.close();
}
}
| Pedro-HCM/una-lista-04-csharp-202302- | 4.java |
1,380 | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("Digite o primeiro número inteiro: ");
int numero1 = scanner.nextInt();
System.out.print("Digite o segundo número inteiro: ");
int numero2 = scanner.nextInt();
System.out.println("Números no intervalo entre " + numero1 + " e " + numero2 + ":");
int menor = Math.min(numero1, numero2);
int maior = Math.max(numero1, numero2);
for (int i = menor; i <= maior; i++) {
System.out.println(i);
}
scanner.close();
}
}
| Pedro-HCM/una-lista-04-csharp-202302- | 6.java |
1,383 | class Solution {
public int findCircleNum(int[][] M) {
int N = M.length;
boolean[]visited = new boolean[N];
int count = 0;
for(int i = 0; i < N ;i++){
if(!visited[i]){
count++;
dfs(M,i,visited);
}
}
return count;
}
private void dfs(int[][]M,int i,boolean[]visited){
for(int j = 0 ; j < M[i].length ; j++){
if(!visited[j] && M[i][j] != 0){
visited[j] = true;
dfs(M,j,visited);
}
}
}
}
| ravitandon90/Code-Submissions | Parth Mathur/76_findCircleNum.java |
1,384 | import greenfoot.*; // (World, Actor, GreenfootImage, and Greenfoot)
import java.awt.Color;
import java.awt.Font;
import java.util.Calendar;
public class k extends Actor
{
public static final float FONT_SIZE = 12.0f;
public static final int WIDTH = 150;
public static final int HEIGHT = 40;
public GreenfootImage image = new GreenfootImage(WIDTH, HEIGHT);
/**
* Create a score board for the final result.
*/
public k()
{
image.setColor(new Color(0, 0, 0, 160));
image.fillRect(0, 0, WIDTH, HEIGHT);
//image.setColor(new Color(255, 255, 255, 100));
image.fillRect(5, 5, WIDTH-10, HEIGHT-10);
Font font = image.getFont();
font = font.deriveFont(FONT_SIZE);
image.setFont(font);
image.setColor(Color.WHITE);
image.drawString("Distance: " + Space.getDistance(), 699,20 );
setImage(image);
}
public void act()
{
restart();
}
public int getlocx()
{
return getX();
}
public int getlocy()
{
return getY();
}
public void restart()
{
image.clear();
image.setColor(new Color(0, 0, 0, 160));
image.fillRect(0, 0, WIDTH, HEIGHT);
image.setColor(new Color(255, 255, 255, 100));
image.fillRect(5, 5, WIDTH-10, HEIGHT-10);
Font font = image.getFont();
font = font.deriveFont(FONT_SIZE);
image.setFont(font);
image.setColor(Color.WHITE);
image.drawString("Distance: " + Launch.getDistance(), 18, 20);
setImage(image);
}
}
| MrZachChandler/RocketLeague | k.java |
1,386 | class HelloJava {
public static void main(String args[]){
System.out.Println(“ I am your Java Program. Thank you! ”);
}
}
| pshivaprasad/lesson2 | vi |
1,388 | //Write a program for error-detecting code using CRC-CCITT (16- bits).
import java.util.Scanner;
public class SimpleCRC {
private static final int POLYNOMIAL = 0x1021;
private static final int INITIAL_CRC = 0xFFFF;
public static String calculateCRC(String data) {
int crc = INITIAL_CRC;
for (char c : data.toCharArray()) {
int ascii = (int) c;
crc ^= (ascii << 8) & 0xFFFF;
for (int i = 0; i < 8; i++) {
if ((crc & 0x8000) != 0)
crc = (crc << 1) ^ POLYNOMIAL;
else
crc <<= 1;
crc &= 0xFFFF; // Ensure it's a 16-bit value
}
}
return Integer.toHexString(crc).toUpperCase();
}
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("Enter the data for CRC calculation: ");
String inputData = scanner.nextLine().trim();
String calculatedCRC = calculateCRC(inputData);
System.out.println("Calculated CRC: " + calculatedCRC);
System.out.print("Enter the received data (message + CRC): ");
String receivedData = scanner.nextLine().trim();
String receivedMessage = receivedData.substring(0, receivedData.length() - calculatedCRC.length());
String receivedCRC = receivedData.substring(receivedData.length() - calculatedCRC.length());
if (calculatedCRC.equals(receivedCRC))
System.out.println("CRC Check: Data is intact. Received message: " + receivedMessage);
else
System.out.println("CRC Check: Data is corrupted. Discarding the message.");
scanner.close();
}
}
| shreyashbandekar/JSS-CN.lab | 2.java |
1,392 | class array{
public static void main(String[] args){
int[] arr={1,2,5,6,7,8};
System.out.println("the elements are:");
for (int i=0;i<arr.length;i++){
System.out.println(arr[i]);
}
}
}
| Srilekhanalabolu/java-lab | .java |
1,393 |
class SingleObject {
private static SingleObject instance = new SingleObject();
private SingleObject(){ }
public static SingleObject getInstance(){
return instance;
}
public void showMessage(){
System.out.println("Hello World!");
}
}
class SingletonPatternDemo {
public static void main(String[] args) {
//SingleObject object = new SingleObject();/**在无错时,不可见*/
SingleObject object = SingleObject.getInstance();
object.showMessage();
}
}
| chenzj-tanpp/study | 1.java |
1,395 | import java.util.Scanner;
public class prime{
public static void main(String[]args){
int element=1;count=0;i;
Scanner sc=new scanner(System.in);
System.out.println("enter the number"){
int n=sc.nextInt();
while(count<n){
element=element+1;
for(i=2;i<=element;i++);
if(element%i==0){
break;
}
}
if(i==element){
count=count+1;
}
}
System.out.println("the"+n+"the prime number is"+element);
}
}
| kamalikumar123/nth-prime-number | .java |
1,396 | package com.company.string;
public class kmp_construction_lps {
static int longPropPreSuff(String str, int n){
System.out.println(n-1);
for(int len=n-1;len>0;len--){
System.out.println(len);
boolean flag=true;
for(int i=0;i<len;i++)
if(str.charAt(i)!=str.charAt(n-len+i))
flag=false;
if(flag==true)
return len;
}
return 0;
}
static void naive_fillLPS(String str, int lps[]){
for(int i=0;i<str.length();i++){
lps[i]=longPropPreSuff(str,i+1);
}
}
static void efficient_fillLPS(String str, int lps[]){
int n=str.length(),len=0;
lps[0]=0;
int i=1;
while(i<n){
if(str.charAt(i)==str.charAt(len))
{len++;lps[i]=len;i++;}
else
{if(len==0){lps[i]=0;i++;}
else{len=lps[len-1];}
}
}
}
public static void main(String args[])
{ String txt = "aaacabad";int[] lps=new int[txt.length()];
efficient_fillLPS(txt,lps);
for(int i=0;i<txt.length();i++){
System.out.print(lps[i]+" ");
}
}
}
| AnantSaxena-1947/dsa | kmp |
1,398 | import java.io.*;
import java.util.*;
import static java.lang.Integer.*;
import static java.lang.Long.*;
import static java.lang.Math.*;
import static java.lang.String.*;
import static java.util.Arrays.*;
public class _ {
static int mod = 1000000007;
public static void main(String[] args) {
try {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
int T = parseInt(br.readLine());
while(T-- != 0){
int N = parseInt(br.readLine());
StringTokenizer st = new StringTokenizer(br.readLine());
}
bw.flush();
} catch (Exception e) {
//TODO: handle exception
System.out.println(e);
}
}
static int[] takeInputArray(String str, int len) {
StringTokenizer st = new StringTokenizer(str);
int arr[] = new int[len];
for (int i = 0; i < len; i++) {
arr[i] = parseInt(st.nextToken());
}
return arr;
}
static long[] takeInputArrayLong(String str, int len) {
StringTokenizer st = new StringTokenizer(str);
long arr[] = new long[len];
for (int i = 0; i < len; i++) {
arr[i] = parseLong(st.nextToken());
}
return arr;
}
static void printMultiArray(int arr[][]){
for(int i=0;i<arr.length;i++){
for(int j=0;j<arr[i].length;j++){
System.out.println(arr[i][j]+" ");
}
System.out.println();
}
}
} | dhruv160410116084/coding-blocks-dp | _.java |
1,399 | import java.util.Arrays;
import java.util.Comparator;
class Item {
int weight;
int value;
double valuePerWeight;
Item(int weight, int value) {
this.weight = weight;
this.value = value;
this.valuePerWeight = (double) value / weight;
}
}
class FractionalKnapsack {
public static double fractionalKnapsack(int capacity, Item[] items) {
Arrays.sort(items, Comparator.comparingDouble((Item item) -> item.valuePerWeight).reversed());
double totalValue = 0.0;
int remainingCapacity = capacity;
for (Item item : items) {
if (item.weight <= remainingCapacity) {
totalValue += item.value;
remainingCapacity -= item.weight;
} else {
totalValue += (item.valuePerWeight * remainingCapacity);
break;
}
}
return totalValue;
}
public static void main(String[] args) {
int capacity = 50;
Item[] items = {
new Item(10, 60),
new Item(20, 100),
new Item(30, 120)
};
double maxValue = fractionalKnapsack(capacity, items);
System.out.println("Maximum value that can be obtained: " + maxValue);
}
}
| sahil-gidwani/DAA | 3.java |
1,403 | /*
* Copyright (C) 2017 methu
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import java.io.InputStream;
/**
* Font Awesome Icons based on FONT AWESOME 4.6.3
* @author methu
*/
public class FA {
public static String GLASS= FA.getIcon('\uF000');
public static String MUSIC= FA.getIcon('\uF001');
public static String SEARCH= FA.getIcon('\uF002');
public static String ENVELOPE_O= FA.getIcon('\uF003');
public static String HEART= FA.getIcon('\uF004');
public static String STAR= FA.getIcon('\uF005');
public static String STAR_O= FA.getIcon('\uF006');
public static String USER= FA.getIcon('\uF007');
public static String FILM= FA.getIcon('\uF008');
public static String TH_LARGE= FA.getIcon('\uF009');
public static String TH= FA.getIcon('\uF00A');
public static String TH_LIST= FA.getIcon('\uF00B');
public static String CHECK= FA.getIcon('\uF00C');
public static String REMOVE= FA.getIcon('\uF00D');
public static String CLOSE= FA.getIcon('\uF00D');
public static String TIMES= FA.getIcon('\uF00D');
public static String SEARCH_PLUS= FA.getIcon('\uF00E');
public static String SEARCH_MINUS= FA.getIcon('\uF010');
public static String POWER_OFF= FA.getIcon('\uF011');
public static String SIGNAL= FA.getIcon('\uF012');
public static String GEAR= FA.getIcon('\uF013');
public static String COG= FA.getIcon('\uF013');
public static String TRASH_O= FA.getIcon('\uF014');
public static String HOME= FA.getIcon('\uF015');
public static String FILE_O= FA.getIcon('\uF016');
public static String CLOCK_O= FA.getIcon('\uF017');
public static String ROAD= FA.getIcon('\uF018');
public static String DOWNLOAD= FA.getIcon('\uF019');
public static String ARROW_CIRCLE_O_DOWN= FA.getIcon('\uF01A');
public static String ARROW_CIRCLE_O_UP= FA.getIcon('\uF01B');
public static String INBOX= FA.getIcon('\uF01C');
public static String PLAY_CIRCLE_O= FA.getIcon('\uF01D');
public static String ROTATE_RIGHT= FA.getIcon('\uF01E');
public static String REPEAT= FA.getIcon('\uF01E');
public static String REFRESH= FA.getIcon('\uF021');
public static String LIST_ALT= FA.getIcon('\uF022');
public static String LOCK= FA.getIcon('\uF023');
public static String FLAG= FA.getIcon('\uF024');
public static String HEADPHONES= FA.getIcon('\uF025');
public static String VOLUME_OFF= FA.getIcon('\uF026');
public static String VOLUME_DOWN= FA.getIcon('\uF027');
public static String VOLUME_UP= FA.getIcon('\uF028');
public static String QRCODE= FA.getIcon('\uF029');
public static String BARCODE= FA.getIcon('\uF02A');
public static String TAG= FA.getIcon('\uF02B');
public static String TAGS= FA.getIcon('\uF02C');
public static String BOOK= FA.getIcon('\uF02D');
public static String BOOKMARK= FA.getIcon('\uF02E');
public static String PRINT= FA.getIcon('\uF02F');
public static String CAMERA= FA.getIcon('\uF030');
public static String FONT= FA.getIcon('\uF031');
public static String BOLD= FA.getIcon('\uF032');
public static String ITALIC= FA.getIcon('\uF033');
public static String TEXT_HEIGHT= FA.getIcon('\uF034');
public static String TEXT_WIDTH= FA.getIcon('\uF035');
public static String ALIGN_LEFT= FA.getIcon('\uF036');
public static String ALIGN_CENTER= FA.getIcon('\uF037');
public static String ALIGN_RIGHT= FA.getIcon('\uF038');
public static String ALIGN_JUSTIFY= FA.getIcon('\uF039');
public static String LIST= FA.getIcon('\uF03A');
public static String DEDENT= FA.getIcon('\uF03B');
public static String OUTDENT= FA.getIcon('\uF03B');
public static String INDENT= FA.getIcon('\uF03C');
public static String VIDEO_CAMERA= FA.getIcon('\uF03D');
public static String PHOTO= FA.getIcon('\uF03E');
public static String IMAGE= FA.getIcon('\uF03E');
public static String PICTURE_O= FA.getIcon('\uF03E');
public static String PENCIL= FA.getIcon('\uF040');
public static String MAP_MARKER= FA.getIcon('\uF041');
public static String ADJUST= FA.getIcon('\uF042');
public static String TINT= FA.getIcon('\uF043');
public static String EDIT= FA.getIcon('\uF044');
public static String PENCIL_SQUARE_O= FA.getIcon('\uF044');
public static String SHARE_SQUARE_O= FA.getIcon('\uF045');
public static String CHECK_SQUARE_O= FA.getIcon('\uF046');
public static String ARROWS= FA.getIcon('\uF047');
public static String STEP_BACKWARD= FA.getIcon('\uF048');
public static String FAST_BACKWARD= FA.getIcon('\uF049');
public static String BACKWARD= FA.getIcon('\uF04A');
public static String PLAY= FA.getIcon('\uF04B');
public static String PAUSE= FA.getIcon('\uF04C');
public static String STOP= FA.getIcon('\uF04D');
public static String FORWARD= FA.getIcon('\uF04E');
public static String FAST_FORWARD= FA.getIcon('\uF050');
public static String STEP_FORWARD= FA.getIcon('\uF051');
public static String EJECT= FA.getIcon('\uF052');
public static String CHEVRON_LEFT= FA.getIcon('\uF053');
public static String CHEVRON_RIGHT= FA.getIcon('\uF054');
public static String PLUS_CIRCLE= FA.getIcon('\uF055');
public static String MINUS_CIRCLE= FA.getIcon('\uF056');
public static String TIMES_CIRCLE= FA.getIcon('\uF057');
public static String CHECK_CIRCLE= FA.getIcon('\uF058');
public static String QUESTION_CIRCLE= FA.getIcon('\uF059');
public static String INFO_CIRCLE= FA.getIcon('\uF05A');
public static String CROSSHAIRS= FA.getIcon('\uF05B');
public static String TIMES_CIRCLE_O= FA.getIcon('\uF05C');
public static String CHECK_CIRCLE_O= FA.getIcon('\uF05D');
public static String BAN= FA.getIcon('\uF05E');
public static String ARROW_LEFT= FA.getIcon('\uF060');
public static String ARROW_RIGHT= FA.getIcon('\uF061');
public static String ARROW_UP= FA.getIcon('\uF062');
public static String ARROW_DOWN= FA.getIcon('\uF063');
public static String MAIL_FORWARD= FA.getIcon('\uF064');
public static String SHARE= FA.getIcon('\uF064');
public static String EXPAND= FA.getIcon('\uF065');
public static String COMPRESS= FA.getIcon('\uF066');
public static String PLUS= FA.getIcon('\uF067');
public static String MINUS= FA.getIcon('\uF068');
public static String ASTERISK= FA.getIcon('\uF069');
public static String EXCLAMATION_CIRCLE= FA.getIcon('\uF06A');
public static String GIFT= FA.getIcon('\uF06B');
public static String LEAF= FA.getIcon('\uF06C');
public static String FIRE= FA.getIcon('\uF06D');
public static String EYE= FA.getIcon('\uF06E');
public static String EYE_SLASH= FA.getIcon('\uF070');
public static String WARNING= FA.getIcon('\uF071');
public static String EXCLAMATION_TRIANGLE= FA.getIcon('\uF071');
public static String PLANE= FA.getIcon('\uF072');
public static String CALENDAR= FA.getIcon('\uF073');
public static String RANDOM= FA.getIcon('\uF074');
public static String COMMENT= FA.getIcon('\uF075');
public static String MAGNET= FA.getIcon('\uF076');
public static String CHEVRON_UP= FA.getIcon('\uF077');
public static String CHEVRON_DOWN= FA.getIcon('\uF078');
public static String RETWEET= FA.getIcon('\uF079');
public static String SHOPPING_CART= FA.getIcon('\uF07A');
public static String FOLDER= FA.getIcon('\uF07B');
public static String FOLDER_OPEN= FA.getIcon('\uF07C');
public static String ARROWS_V= FA.getIcon('\uF07D');
public static String ARROWS_H= FA.getIcon('\uF07E');
public static String BAR_CHART_O= FA.getIcon('\uF080');
public static String BAR_CHART= FA.getIcon('\uF080');
public static String TWITTER_SQUARE= FA.getIcon('\uF081');
public static String FACEBOOK_SQUARE= FA.getIcon('\uF082');
public static String CAMERA_RETRO= FA.getIcon('\uF083');
public static String KEY= FA.getIcon('\uF084');
public static String GEARS= FA.getIcon('\uF085');
public static String COGS= FA.getIcon('\uF085');
public static String COMMENTS= FA.getIcon('\uF086');
public static String THUMBS_O_UP= FA.getIcon('\uF087');
public static String THUMBS_O_DOWN= FA.getIcon('\uF088');
public static String STAR_HALF= FA.getIcon('\uF089');
public static String HEART_O= FA.getIcon('\uF08A');
public static String SIGN_OUT= FA.getIcon('\uF08B');
public static String LINKEDIN_SQUARE= FA.getIcon('\uF08C');
public static String THUMB_TACK= FA.getIcon('\uF08D');
public static String EXTERNAL_LINK= FA.getIcon('\uF08E');
public static String SIGN_IN= FA.getIcon('\uF090');
public static String TROPHY= FA.getIcon('\uF091');
public static String GITHUB_SQUARE= FA.getIcon('\uF092');
public static String UPLOAD= FA.getIcon('\uF093');
public static String LEMON_O= FA.getIcon('\uF094');
public static String PHONE= FA.getIcon('\uF095');
public static String SQUARE_O= FA.getIcon('\uF096');
public static String BOOKMARK_O= FA.getIcon('\uF097');
public static String PHONE_SQUARE= FA.getIcon('\uF098');
public static String TWITTER= FA.getIcon('\uF099');
public static String FACEBOOK_F= FA.getIcon('\uF09A');
public static String FACEBOOK= FA.getIcon('\uF09A');
public static String GITHUB= FA.getIcon('\uF09B');
public static String UNLOCK= FA.getIcon('\uF09C');
public static String CREDIT_CARD= FA.getIcon('\uF09D');
public static String FEED= FA.getIcon('\uF09E');
public static String RSS= FA.getIcon('\uF09E');
public static String HDD_O= FA.getIcon('\uF0A0');
public static String BULLHORN= FA.getIcon('\uF0A1');
public static String BELL= FA.getIcon('\uF0F3');
public static String CERTIFICATE= FA.getIcon('\uF0A3');
public static String HAND_O_RIGHT= FA.getIcon('\uF0A4');
public static String HAND_O_LEFT= FA.getIcon('\uF0A5');
public static String HAND_O_UP= FA.getIcon('\uF0A6');
public static String HAND_O_DOWN= FA.getIcon('\uF0A7');
public static String ARROW_CIRCLE_LEFT= FA.getIcon('\uF0A8');
public static String ARROW_CIRCLE_RIGHT= FA.getIcon('\uF0A9');
public static String ARROW_CIRCLE_UP= FA.getIcon('\uF0AA');
public static String ARROW_CIRCLE_DOWN= FA.getIcon('\uF0AB');
public static String GLOBE= FA.getIcon('\uF0AC');
public static String WRENCH= FA.getIcon('\uF0AD');
public static String TASKS= FA.getIcon('\uF0AE');
public static String FILTER= FA.getIcon('\uF0B0');
public static String BRIEFCASE= FA.getIcon('\uF0B1');
public static String ARROWS_ALT= FA.getIcon('\uF0B2');
public static String GROUP= FA.getIcon('\uF0C0');
public static String USERS= FA.getIcon('\uF0C0');
public static String CHAIN= FA.getIcon('\uF0C1');
public static String LINK= FA.getIcon('\uF0C1');
public static String CLOUD= FA.getIcon('\uF0C2');
public static String FLASK= FA.getIcon('\uF0C3');
public static String CUT= FA.getIcon('\uF0C4');
public static String SCISSORS= FA.getIcon('\uF0C4');
public static String COPY= FA.getIcon('\uF0C5');
public static String FILES_O= FA.getIcon('\uF0C5');
public static String PAPERCLIP= FA.getIcon('\uF0C6');
public static String SAVE= FA.getIcon('\uF0C7');
public static String FLOPPY_O= FA.getIcon('\uF0C7');
public static String SQUARE= FA.getIcon('\uF0C8');
public static String NAVICON= FA.getIcon('\uF0C9');
public static String REORDER= FA.getIcon('\uF0C9');
public static String BARS= FA.getIcon('\uF0C9');
public static String LIST_UL= FA.getIcon('\uF0CA');
public static String LIST_OL= FA.getIcon('\uF0CB');
public static String STRIKETHROUGH= FA.getIcon('\uF0CC');
public static String UNDERLINE= FA.getIcon('\uF0CD');
public static String TABLE= FA.getIcon('\uF0CE');
public static String MAGIC= FA.getIcon('\uF0D0');
public static String TRUCK= FA.getIcon('\uF0D1');
public static String PINTEREST= FA.getIcon('\uF0D2');
public static String PINTEREST_SQUARE= FA.getIcon('\uF0D3');
public static String GOOGLE_PLUS_SQUARE= FA.getIcon('\uF0D4');
public static String GOOGLE_PLUS= FA.getIcon('\uF0D5');
public static String MONEY= FA.getIcon('\uF0D6');
public static String CARET_DOWN= FA.getIcon('\uF0D7');
public static String CARET_UP= FA.getIcon('\uF0D8');
public static String CARET_LEFT= FA.getIcon('\uF0D9');
public static String CARET_RIGHT= FA.getIcon('\uF0DA');
public static String COLUMNS= FA.getIcon('\uF0DB');
public static String UNSORTED= FA.getIcon('\uF0DC');
public static String SORT= FA.getIcon('\uF0DC');
public static String SORT_DOWN= FA.getIcon('\uF0DD');
public static String SORT_DESC= FA.getIcon('\uF0DD');
public static String SORT_UP= FA.getIcon('\uF0DE');
public static String SORT_ASC= FA.getIcon('\uF0DE');
public static String ENVELOPE= FA.getIcon('\uF0E0');
public static String LINKEDIN= FA.getIcon('\uF0E1');
public static String ROTATE_LEFT= FA.getIcon('\uF0E2');
public static String UNDO= FA.getIcon('\uF0E2');
public static String LEGAL= FA.getIcon('\uF0E3');
public static String GAVEL= FA.getIcon('\uF0E3');
public static String DASHBOARD= FA.getIcon('\uF0E4');
public static String TACHOMETER= FA.getIcon('\uF0E4');
public static String COMMENT_O= FA.getIcon('\uF0E5');
public static String COMMENTS_O= FA.getIcon('\uF0E6');
public static String FLASH= FA.getIcon('\uF0E7');
public static String BOLT= FA.getIcon('\uF0E7');
public static String SITEMAP= FA.getIcon('\uF0E8');
public static String UMBRELLA= FA.getIcon('\uF0E9');
public static String PASTE= FA.getIcon('\uF0EA');
public static String CLIPBOARD= FA.getIcon('\uF0EA');
public static String LIGHTBULB_O= FA.getIcon('\uF0EB');
public static String EXCHANGE= FA.getIcon('\uF0EC');
public static String CLOUD_DOWNLOAD= FA.getIcon('\uF0ED');
public static String CLOUD_UPLOAD= FA.getIcon('\uF0EE');
public static String USER_MD= FA.getIcon('\uF0F0');
public static String STETHOSCOPE= FA.getIcon('\uF0F1');
public static String SUITCASE= FA.getIcon('\uF0F2');
public static String BELL_O= FA.getIcon('\uF0A2');
public static String COFFEE= FA.getIcon('\uF0F4');
public static String CUTLERY= FA.getIcon('\uF0F5');
public static String FILE_TEXT_O= FA.getIcon('\uF0F6');
public static String BUILDING_O= FA.getIcon('\uF0F7');
public static String HOSPITAL_O= FA.getIcon('\uF0F8');
public static String AMBULANCE= FA.getIcon('\uF0F9');
public static String MEDKIT= FA.getIcon('\uF0FA');
public static String FIGHTER_JET= FA.getIcon('\uF0FB');
public static String BEER= FA.getIcon('\uF0FC');
public static String H_SQUARE= FA.getIcon('\uF0FD');
public static String PLUS_SQUARE= FA.getIcon('\uF0FE');
public static String ANGLE_DOUBLE_LEFT= FA.getIcon('\uF100');
public static String ANGLE_DOUBLE_RIGHT= FA.getIcon('\uF101');
public static String ANGLE_DOUBLE_UP= FA.getIcon('\uF102');
public static String ANGLE_DOUBLE_DOWN= FA.getIcon('\uF103');
public static String ANGLE_LEFT= FA.getIcon('\uF104');
public static String ANGLE_RIGHT= FA.getIcon('\uF105');
public static String ANGLE_UP= FA.getIcon('\uF106');
public static String ANGLE_DOWN= FA.getIcon('\uF107');
public static String DESKTOP= FA.getIcon('\uF108');
public static String LAPTOP= FA.getIcon('\uF109');
public static String TABLET= FA.getIcon('\uF10A');
public static String MOBILE_PHONE= FA.getIcon('\uF10B');
public static String MOBILE= FA.getIcon('\uF10B');
public static String CIRCLE_O= FA.getIcon('\uF10C');
public static String QUOTE_LEFT= FA.getIcon('\uF10D');
public static String QUOTE_RIGHT= FA.getIcon('\uF10E');
public static String SPINNER= FA.getIcon('\uF110');
public static String CIRCLE= FA.getIcon('\uF111');
public static String MAIL_REPLY= FA.getIcon('\uF112');
public static String REPLY= FA.getIcon('\uF112');
public static String GITHUB_ALT= FA.getIcon('\uF113');
public static String FOLDER_O= FA.getIcon('\uF114');
public static String FOLDER_OPEN_O= FA.getIcon('\uF115');
public static String SMILE_O= FA.getIcon('\uF118');
public static String FROWN_O= FA.getIcon('\uF119');
public static String MEH_O= FA.getIcon('\uF11A');
public static String GAMEPAD= FA.getIcon('\uF11B');
public static String KEYBOARD_O= FA.getIcon('\uF11C');
public static String FLAG_O= FA.getIcon('\uF11D');
public static String FLAG_CHECKERED= FA.getIcon('\uF11E');
public static String TERMINAL= FA.getIcon('\uF120');
public static String CODE= FA.getIcon('\uF121');
public static String MAIL_REPLY_ALL= FA.getIcon('\uF122');
public static String REPLY_ALL= FA.getIcon('\uF122');
public static String STAR_HALF_EMPTY= FA.getIcon('\uF123');
public static String STAR_HALF_FULL= FA.getIcon('\uF123');
public static String STAR_HALF_O= FA.getIcon('\uF123');
public static String LOCATION_ARROW= FA.getIcon('\uF124');
public static String CROP= FA.getIcon('\uF125');
public static String CODE_FORK= FA.getIcon('\uF126');
public static String UNLINK= FA.getIcon('\uF127');
public static String CHAIN_BROKEN= FA.getIcon('\uF127');
public static String QUESTION= FA.getIcon('\uF128');
public static String INFO= FA.getIcon('\uF129');
public static String EXCLAMATION= FA.getIcon('\uF12A');
public static String SUPERSCRIPT= FA.getIcon('\uF12B');
public static String SUBSCRIPT= FA.getIcon('\uF12C');
public static String ERASER= FA.getIcon('\uF12D');
public static String PUZZLE_PIECE= FA.getIcon('\uF12E');
public static String MICROPHONE= FA.getIcon('\uF130');
public static String MICROPHONE_SLASH= FA.getIcon('\uF131');
public static String SHIELD= FA.getIcon('\uF132');
public static String CALENDAR_O= FA.getIcon('\uF133');
public static String FIRE_EXTINGUISHER= FA.getIcon('\uF134');
public static String ROCKET= FA.getIcon('\uF135');
public static String MAXCDN= FA.getIcon('\uF136');
public static String CHEVRON_CIRCLE_LEFT= FA.getIcon('\uF137');
public static String CHEVRON_CIRCLE_RIGHT= FA.getIcon('\uF138');
public static String CHEVRON_CIRCLE_UP= FA.getIcon('\uF139');
public static String CHEVRON_CIRCLE_DOWN= FA.getIcon('\uF13A');
public static String HTML5= FA.getIcon('\uF13B');
public static String CSS3= FA.getIcon('\uF13C');
public static String ANCHOR= FA.getIcon('\uF13D');
public static String UNLOCK_ALT= FA.getIcon('\uF13E');
public static String BULLSEYE= FA.getIcon('\uF140');
public static String ELLIPSIS_H= FA.getIcon('\uF141');
public static String ELLIPSIS_V= FA.getIcon('\uF142');
public static String RSS_SQUARE= FA.getIcon('\uF143');
public static String PLAY_CIRCLE= FA.getIcon('\uF144');
public static String TICKET= FA.getIcon('\uF145');
public static String MINUS_SQUARE= FA.getIcon('\uF146');
public static String MINUS_SQUARE_O= FA.getIcon('\uF147');
public static String LEVEL_UP= FA.getIcon('\uF148');
public static String LEVEL_DOWN= FA.getIcon('\uF149');
public static String CHECK_SQUARE= FA.getIcon('\uF14A');
public static String PENCIL_SQUARE= FA.getIcon('\uF14B');
public static String EXTERNAL_LINK_SQUARE= FA.getIcon('\uF14C');
public static String SHARE_SQUARE= FA.getIcon('\uF14D');
public static String COMPASS= FA.getIcon('\uF14E');
public static String TOGGLE_DOWN= FA.getIcon('\uF150');
public static String CARET_SQUARE_O_DOWN= FA.getIcon('\uF150');
public static String TOGGLE_UP= FA.getIcon('\uF151');
public static String CARET_SQUARE_O_UP= FA.getIcon('\uF151');
public static String TOGGLE_RIGHT= FA.getIcon('\uF152');
public static String CARET_SQUARE_O_RIGHT= FA.getIcon('\uF152');
public static String EURO= FA.getIcon('\uF153');
public static String EUR= FA.getIcon('\uF153');
public static String GBP= FA.getIcon('\uF154');
public static String DOLLAR= FA.getIcon('\uF156');
public static String USD= FA.getIcon('\uF155');
public static String RUPEE= FA.getIcon('\uF156');
public static String INR= FA.getIcon('\uF156');
public static String CNY= FA.getIcon('\uF157');
public static String RMB= FA.getIcon('\uF157');
public static String YEN= FA.getIcon('\uF157');
public static String JPY= FA.getIcon('\uF157');
public static String RUBLE= FA.getIcon('\uF158');
public static String ROUBLE= FA.getIcon('\uF158');
public static String RUB= FA.getIcon('\uF158');
public static String WON= FA.getIcon('\uF159');
public static String KRW= FA.getIcon('\uF159');
public static String BITCOIN= FA.getIcon('\uF15A');
public static String BTC= FA.getIcon('\uF15A');
public static String FILE= FA.getIcon('\uF15B');
public static String FILE_TEXT= FA.getIcon('\uF15C');
public static String SORT_ALPHA_ASC= FA.getIcon('\uF15D');
public static String SORT_ALPHA_DESC= FA.getIcon('\uF15E');
public static String SORT_AMOUNT_ASC= FA.getIcon('\uF160');
public static String SORT_AMOUNT_DESC= FA.getIcon('\uF161');
public static String SORT_NUMERIC_ASC= FA.getIcon('\uF162');
public static String SORT_NUMERIC_DESC= FA.getIcon('\uF163');
public static String THUMBS_UP= FA.getIcon('\uF164');
public static String THUMBS_DOWN= FA.getIcon('\uF165');
public static String YOUTUBE_SQUARE= FA.getIcon('\uF166');
public static String YOUTUBE= FA.getIcon('\uF167');
public static String XING= FA.getIcon('\uF168');
public static String XING_SQUARE= FA.getIcon('\uF169');
public static String YOUTUBE_PLAY= FA.getIcon('\uF16A');
public static String DROPBOX= FA.getIcon('\uF16B');
public static String STACK_OVERFLOW= FA.getIcon('\uF16C');
public static String INSTAGRAM= FA.getIcon('\uF16D');
public static String FLICKR= FA.getIcon('\uF16E');
public static String ADN= FA.getIcon('\uF170');
public static String BITBUCKET= FA.getIcon('\uF171');
public static String BITBUCKET_SQUARE= FA.getIcon('\uF172');
public static String TUMBLR= FA.getIcon('\uF173');
public static String TUMBLR_SQUARE= FA.getIcon('\uF174');
public static String LONG_ARROW_DOWN= FA.getIcon('\uF175');
public static String LONG_ARROW_UP= FA.getIcon('\uF176');
public static String LONG_ARROW_LEFT= FA.getIcon('\uF177');
public static String LONG_ARROW_RIGHT= FA.getIcon('\uF178');
public static String APPLE= FA.getIcon('\uF179');
public static String WINDOWS= FA.getIcon('\uF17A');
public static String ANDROID= FA.getIcon('\uF17B');
public static String LINUX= FA.getIcon('\uF17C');
public static String DRIBBBLE= FA.getIcon('\uF17D');
public static String SKYPE= FA.getIcon('\uF17E');
public static String FOURSQUARE= FA.getIcon('\uF180');
public static String TRELLO= FA.getIcon('\uF181');
public static String FEMALE= FA.getIcon('\uF182');
public static String MALE= FA.getIcon('\uF183');
public static String GITTIP= FA.getIcon('\uF184');
public static String GRATIPAY= FA.getIcon('\uF184');
public static String SUN_O= FA.getIcon('\uF185');
public static String MOON_O= FA.getIcon('\uF186');
public static String ARCHIVE= FA.getIcon('\uF187');
public static String BUG= FA.getIcon('\uF188');
public static String VK= FA.getIcon('\uF189');
public static String WEIBO= FA.getIcon('\uF18A');
public static String RENREN= FA.getIcon('\uF18B');
public static String PAGELINES= FA.getIcon('\uF18C');
public static String STACK_EXCHANGE= FA.getIcon('\uF18D');
public static String ARROW_CIRCLE_O_RIGHT= FA.getIcon('\uF18E');
public static String ARROW_CIRCLE_O_LEFT= FA.getIcon('\uF190');
public static String TOGGLE_LEFT= FA.getIcon('\uF191');
public static String CARET_SQUARE_O_LEFT= FA.getIcon('\uF191');
public static String DOT_CIRCLE_O= FA.getIcon('\uF192');
public static String WHEELCHAIR= FA.getIcon('\uF193');
public static String VIMEO_SQUARE= FA.getIcon('\uF194');
public static String TURKISH_LIRA= FA.getIcon('\uF195');
public static String TRY= FA.getIcon('\uF195');
public static String PLUS_SQUARE_O= FA.getIcon('\uF196');
public static String SPACE_SHUTTLE= FA.getIcon('\uF197');
public static String SLACK= FA.getIcon('\uF198');
public static String ENVELOPE_SQUARE= FA.getIcon('\uF199');
public static String WORDPRESS= FA.getIcon('\uF19A');
public static String OPENID= FA.getIcon('\uF19B');
public static String INSTITUTION= FA.getIcon('\uF19C');
public static String BANK= FA.getIcon('\uF19C');
public static String UNIVERSITY= FA.getIcon('\uF19C');
public static String MORTAR_BOARD= FA.getIcon('\uF19D');
public static String GRADUATION_CAP= FA.getIcon('\uF19D');
public static String YAHOO= FA.getIcon('\uF19E');
public static String GOOGLE= FA.getIcon('\uF1A0');
public static String REDDIT= FA.getIcon('\uF1A1');
public static String REDDIT_SQUARE= FA.getIcon('\uF1A2');
public static String STUMBLEUPON_CIRCLE= FA.getIcon('\uF1A3');
public static String STUMBLEUPON= FA.getIcon('\uF1A4');
public static String DELICIOUS= FA.getIcon('\uF1A5');
public static String DIGG= FA.getIcon('\uF1A6');
public static String PIED_PIPER_PP= FA.getIcon('\uF1A7');
public static String PIED_PIPER_ALT= FA.getIcon('\uF1A8');
public static String DRUPAL= FA.getIcon('\uF1A9');
public static String JOOMLA= FA.getIcon('\uF1AA');
public static String LANGUAGE= FA.getIcon('\uF1AB');
public static String FAX= FA.getIcon('\uF1AC');
public static String BUILDING= FA.getIcon('\uF1AD');
public static String CHILD= FA.getIcon('\uF1AE');
public static String PAW= FA.getIcon('\uF1B0');
public static String SPOON= FA.getIcon('\uF1B1');
public static String CUBE= FA.getIcon('\uF1B2');
public static String CUBES= FA.getIcon('\uF1B3');
public static String BEHANCE= FA.getIcon('\uF1B4');
public static String BEHANCE_SQUARE= FA.getIcon('\uF1B5');
public static String STEAM= FA.getIcon('\uF1B6');
public static String STEAM_SQUARE= FA.getIcon('\uF1B7');
public static String RECYCLE= FA.getIcon('\uF1B8');
public static String AUTOMOBILE= FA.getIcon('\uF1B9');
public static String CAR= FA.getIcon('\uF1B9');
public static String CAB= FA.getIcon('\uF1BA');
public static String TAXI= FA.getIcon('\uF1BA');
public static String TREE= FA.getIcon('\uF1BB');
public static String SPOTIFY= FA.getIcon('\uF1BC');
public static String DEVIANTART= FA.getIcon('\uF1BD');
public static String SOUNDCLOUD= FA.getIcon('\uF1BE');
public static String DATABASE= FA.getIcon('\uF1C0');
public static String FILE_PDF_O= FA.getIcon('\uF1C1');
public static String FILE_WORD_O= FA.getIcon('\uF1C2');
public static String FILE_EXCEL_O= FA.getIcon('\uF1C3');
public static String FILE_POWERPOINT_O= FA.getIcon('\uF1C4');
public static String FILE_PHOTO_O= FA.getIcon('\uF1C5');
public static String FILE_PICTURE_O= FA.getIcon('\uF1C5');
public static String FILE_IMAGE_O= FA.getIcon('\uF1C5');
public static String FILE_ZIP_O= FA.getIcon('\uF1C6');
public static String FILE_ARCHIVE_O= FA.getIcon('\uF1C6');
public static String FILE_SOUND_O= FA.getIcon('\uF1C7');
public static String FILE_AUDIO_O= FA.getIcon('\uF1C7');
public static String FILE_MOVIE_O= FA.getIcon('\uF1C8');
public static String FILE_VIDEO_O= FA.getIcon('\uF1C8');
public static String FILE_CODE_O= FA.getIcon('\uF1C9');
public static String VINE= FA.getIcon('\uF1CA');
public static String CODEPEN= FA.getIcon('\uF1CB');
public static String JSFIDDLE= FA.getIcon('\uF1CC');
public static String LIFE_BOUY= FA.getIcon('\uF1CD');
public static String LIFE_BUOY= FA.getIcon('\uF1CD');
public static String LIFE_SAVER= FA.getIcon('\uF1CD');
public static String SUPPORT= FA.getIcon('\uF1CD');
public static String LIFE_RING= FA.getIcon('\uF1CD');
public static String CIRCLE_O_NOTCH= FA.getIcon('\uF1CE');
public static String RA= FA.getIcon('\uF1D0');
public static String RESISTANCE= FA.getIcon('\uF1D0');
public static String REBEL= FA.getIcon('\uF1D0');
public static String GE= FA.getIcon('\uF1D1');
public static String EMPIRE= FA.getIcon('\uF1D1');
public static String GIT_SQUARE= FA.getIcon('\uF1D2');
public static String GIT= FA.getIcon('\uF1D3');
public static String Y_COMBINATOR_SQUARE= FA.getIcon('\uF1D4');
public static String YC_SQUARE= FA.getIcon('\uF1D4');
public static String HACKER_NEWS= FA.getIcon('\uF1D4');
public static String TENCENT_WEIBO= FA.getIcon('\uF1D5');
public static String QQ= FA.getIcon('\uF1D6');
public static String WECHAT= FA.getIcon('\uF1D7');
public static String WEIXIN= FA.getIcon('\uF1D7');
public static String SEND= FA.getIcon('\uF1D8');
public static String PAPER_PLANE= FA.getIcon('\uF1D8');
public static String SEND_O= FA.getIcon('\uF1D9');
public static String PAPER_PLANE_O= FA.getIcon('\uF1D9');
public static String HISTORY= FA.getIcon('\uF1DA');
public static String CIRCLE_THIN= FA.getIcon('\uF1DB');
public static String HEADER= FA.getIcon('\uF1DC');
public static String PARAGRAPH= FA.getIcon('\uF1DD');
public static String SLIDERS= FA.getIcon('\uF1DE');
public static String SHARE_ALT= FA.getIcon('\uF1E0');
public static String SHARE_ALT_SQUARE= FA.getIcon('\uF1E1');
public static String BOMB= FA.getIcon('\uF1E2');
public static String SOCCER_BALL_O= FA.getIcon('\uF1E3');
public static String FUTBOL_O= FA.getIcon('\uF1E3');
public static String TTY= FA.getIcon('\uF1E4');
public static String BINOCULARS= FA.getIcon('\uF1E5');
public static String PLUG= FA.getIcon('\uF1E6');
public static String SLIDESHARE= FA.getIcon('\uF1E7');
public static String TWITCH= FA.getIcon('\uF1E8');
public static String YELP= FA.getIcon('\uF1E9');
public static String NEWSPAPER_O= FA.getIcon('\uF1EA');
public static String WIFI= FA.getIcon('\uF1EB');
public static String CALCULATOR= FA.getIcon('\uF1EC');
public static String PAYPAL= FA.getIcon('\uF1ED');
public static String GOOGLE_WALLET= FA.getIcon('\uF1EE');
public static String CC_VISA= FA.getIcon('\uF1F0');
public static String CC_MASTERCARD= FA.getIcon('\uF1F1');
public static String CC_DISCOVER= FA.getIcon('\uF1F2');
public static String CC_AMEX= FA.getIcon('\uF1F3');
public static String CC_PAYPAL= FA.getIcon('\uF1F4');
public static String CC_STRIPE= FA.getIcon('\uF1F5');
public static String BELL_SLASH= FA.getIcon('\uF1F6');
public static String BELL_SLASH_O= FA.getIcon('\uF1F7');
public static String TRASH= FA.getIcon('\uF1F8');
public static String COPYRIGHT= FA.getIcon('\uF1F9');
public static String AT= FA.getIcon('\uF1FA');
public static String EYEDROPPER= FA.getIcon('\uF1FB');
public static String PAINT_BRUSH= FA.getIcon('\uF1FC');
public static String BIRTHDAY_CAKE= FA.getIcon('\uF1FD');
public static String AREA_CHART= FA.getIcon('\uF1FE');
public static String PIE_CHART= FA.getIcon('\uF200');
public static String LINE_CHART= FA.getIcon('\uF201');
public static String LASTFM= FA.getIcon('\uF202');
public static String LASTFM_SQUARE= FA.getIcon('\uF203');
public static String TOGGLE_OFF= FA.getIcon('\uF204');
public static String TOGGLE_ON= FA.getIcon('\uF205');
public static String BICYCLE= FA.getIcon('\uF206');
public static String BUS= FA.getIcon('\uF207');
public static String IOXHOST= FA.getIcon('\uF208');
public static String ANGELLIST= FA.getIcon('\uF209');
public static String CC= FA.getIcon('\uF20A');
public static String SHEKEL= FA.getIcon('\uF20B');
public static String SHEQEL= FA.getIcon('\uF20B');
public static String ILS= FA.getIcon('\uF20B');
public static String MEANPATH= FA.getIcon('\uF20C');
public static String BUYSELLADS= FA.getIcon('\uF20D');
public static String CONNECTDEVELOP= FA.getIcon('\uF20E');
public static String DASHCUBE= FA.getIcon('\uF210');
public static String FORUMBEE= FA.getIcon('\uF211');
public static String LEANPUB= FA.getIcon('\uF212');
public static String SELLSY= FA.getIcon('\uF213');
public static String SHIRTSINBULK= FA.getIcon('\uF214');
public static String SIMPLYBUILT= FA.getIcon('\uF215');
public static String SKYATLAS= FA.getIcon('\uF216');
public static String CART_PLUS= FA.getIcon('\uF217');
public static String CART_ARROW_DOWN= FA.getIcon('\uF218');
public static String DIAMOND= FA.getIcon('\uF219');
public static String SHIP= FA.getIcon('\uF21A');
public static String USER_SECRET= FA.getIcon('\uF21B');
public static String MOTORCYCLE= FA.getIcon('\uF21C');
public static String STREET_VIEW= FA.getIcon('\uF21D');
public static String HEARTBEAT= FA.getIcon('\uF21E');
public static String VENUS= FA.getIcon('\uF221');
public static String MARS= FA.getIcon('\uF222');
public static String MERCURY= FA.getIcon('\uF223');
public static String INTERSEX= FA.getIcon('\uF224');
public static String TRANSGENDER= FA.getIcon('\uF224');
public static String TRANSGENDER_ALT= FA.getIcon('\uF225');
public static String VENUS_DOUBLE= FA.getIcon('\uF226');
public static String MARS_DOUBLE= FA.getIcon('\uF227');
public static String VENUS_MARS= FA.getIcon('\uF228');
public static String MARS_STROKE= FA.getIcon('\uF229');
public static String MARS_STROKE_V= FA.getIcon('\uF22A');
public static String MARS_STROKE_H= FA.getIcon('\uF22B');
public static String NEUTER= FA.getIcon('\uF22C');
public static String GENDERLESS= FA.getIcon('\uF22D');
public static String FACEBOOK_OFFICIAL= FA.getIcon('\uF230');
public static String PINTEREST_P= FA.getIcon('\uF231');
public static String WHATSAPP= FA.getIcon('\uF232');
public static String SERVER= FA.getIcon('\uF233');
public static String USER_PLUS= FA.getIcon('\uF234');
public static String USER_TIMES= FA.getIcon('\uF235');
public static String HOTEL= FA.getIcon('\uF236');
public static String BED= FA.getIcon('\uF236');
public static String VIACOIN= FA.getIcon('\uF237');
public static String TRAIN= FA.getIcon('\uF238');
public static String SUBWAY= FA.getIcon('\uF239');
public static String MEDIUM= FA.getIcon('\uF23A');
public static String YC= FA.getIcon('\uF23B');
public static String Y_COMBINATOR= FA.getIcon('\uF23B');
public static String OPTIN_MONSTER= FA.getIcon('\uF23C');
public static String OPENCART= FA.getIcon('\uF23D');
public static String EXPEDITEDSSL= FA.getIcon('\uF23E');
public static String BATTERY_4= FA.getIcon('\uF240');
public static String BATTERY_FULL= FA.getIcon('\uF240');
public static String BATTERY_3= FA.getIcon('\uF241');
public static String BATTERY_THREE_QUARTERS= FA.getIcon('\uF241');
public static String BATTERY_2= FA.getIcon('\uF242');
public static String BATTERY_HALF= FA.getIcon('\uF242');
public static String BATTERY_1= FA.getIcon('\uF243');
public static String BATTERY_QUARTER= FA.getIcon('\uF243');
public static String BATTERY_0= FA.getIcon('\uF244');
public static String BATTERY_EMPTY= FA.getIcon('\uF244');
public static String MOUSE_POINTER= FA.getIcon('\uF245');
public static String I_CURSOR= FA.getIcon('\uF246');
public static String OBJECT_GROUP= FA.getIcon('\uF247');
public static String OBJECT_UNGROUP= FA.getIcon('\uF248');
public static String STICKY_NOTE= FA.getIcon('\uF249');
public static String STICKY_NOTE_O= FA.getIcon('\uF24A');
public static String CC_JCB= FA.getIcon('\uF24B');
public static String CC_DINERS_CLUB= FA.getIcon('\uF24C');
public static String CLONE= FA.getIcon('\uF24D');
public static String BALANCE_SCALE= FA.getIcon('\uF24E');
public static String HOURGLASS_O= FA.getIcon('\uF250');
public static String HOURGLASS_1= FA.getIcon('\uF251');
public static String HOURGLASS_START= FA.getIcon('\uF251');
public static String HOURGLASS_2= FA.getIcon('\uF252');
public static String HOURGLASS_HALF= FA.getIcon('\uF252');
public static String HOURGLASS_3= FA.getIcon('\uF253');
public static String HOURGLASS_END= FA.getIcon('\uF253');
public static String HOURGLASS= FA.getIcon('\uF254');
public static String HAND_GRAB_O= FA.getIcon('\uF255');
public static String HAND_ROCK_O= FA.getIcon('\uF255');
public static String HAND_STOP_O= FA.getIcon('\uF256');
public static String HAND_PAPER_O= FA.getIcon('\uF256');
public static String HAND_SCISSORS_O= FA.getIcon('\uF257');
public static String HAND_LIZARD_O= FA.getIcon('\uF258');
public static String HAND_SPOCK_O= FA.getIcon('\uF259');
public static String HAND_POINTER_O= FA.getIcon('\uF25A');
public static String HAND_PEACE_O= FA.getIcon('\uF25B');
public static String TRADEMARK= FA.getIcon('\uF25C');
public static String REGISTERED= FA.getIcon('\uF25D');
public static String CREATIVE_COMMONS= FA.getIcon('\uF25E');
public static String GG= FA.getIcon('\uF260');
public static String GG_CIRCLE= FA.getIcon('\uF261');
public static String TRIPADVISOR= FA.getIcon('\uF262');
public static String ODNOKLASSNIKI= FA.getIcon('\uF263');
public static String ODNOKLASSNIKI_SQUARE= FA.getIcon('\uF264');
public static String GET_POCKET= FA.getIcon('\uF265');
public static String WIKIPEDIA_W= FA.getIcon('\uF266');
public static String SAFARI= FA.getIcon('\uF267');
public static String CHROME= FA.getIcon('\uF268');
public static String FIREFOX= FA.getIcon('\uF269');
public static String OPERA= FA.getIcon('\uF26A');
public static String INTERNET_EXPLORER= FA.getIcon('\uF26B');
public static String TV= FA.getIcon('\uF26C');
public static String TELEVISION= FA.getIcon('\uF26C');
public static String CONTAO= FA.getIcon('\uF26D');
public static String I500PX= FA.getIcon('\uF26E');
public static String AMAZON= FA.getIcon('\uF270');
public static String CALENDAR_PLUS_O= FA.getIcon('\uF271');
public static String CALENDAR_MINUS_O= FA.getIcon('\uF272');
public static String CALENDAR_TIMES_O= FA.getIcon('\uF273');
public static String CALENDAR_CHECK_O= FA.getIcon('\uF274');
public static String INDUSTRY= FA.getIcon('\uF275');
public static String MAP_PIN= FA.getIcon('\uF276');
public static String MAP_SIGNS= FA.getIcon('\uF277');
public static String MAP_O= FA.getIcon('\uF278');
public static String MAP= FA.getIcon('\uF279');
public static String COMMENTING= FA.getIcon('\uF27A');
public static String COMMENTING_O= FA.getIcon('\uF27B');
public static String HOUZZ= FA.getIcon('\uF27C');
public static String VIMEO= FA.getIcon('\uF27D');
public static String BLACK_TIE= FA.getIcon('\uF27E');
public static String FONTICONS= FA.getIcon('\uF280');
public static String REDDIT_ALIEN= FA.getIcon('\uF281');
public static String EDGE= FA.getIcon('\uF282');
public static String CREDIT_CARD_ALT= FA.getIcon('\uF283');
public static String CODIEPIE= FA.getIcon('\uF284');
public static String MODX= FA.getIcon('\uF285');
public static String FORT_AWESOME= FA.getIcon('\uF286');
public static String USB= FA.getIcon('\uF287');
public static String PRODUCT_HUNT= FA.getIcon('\uF288');
public static String MIXCLOUD= FA.getIcon('\uF289');
public static String SCRIBD= FA.getIcon('\uF28A');
public static String PAUSE_CIRCLE= FA.getIcon('\uF28B');
public static String PAUSE_CIRCLE_O= FA.getIcon('\uF28C');
public static String STOP_CIRCLE= FA.getIcon('\uF28D');
public static String STOP_CIRCLE_O= FA.getIcon('\uF28E');
public static String SHOPPING_BAG= FA.getIcon('\uF290');
public static String SHOPPING_BASKET= FA.getIcon('\uF291');
public static String HASHTAG= FA.getIcon('\uF292');
public static String BLUETOOTH= FA.getIcon('\uF293');
public static String BLUETOOTH_B= FA.getIcon('\uF294');
public static String PERCENT= FA.getIcon('\uF295');
public static String GITLAB= FA.getIcon('\uF296');
public static String WPBEGINNER= FA.getIcon('\uF297');
public static String WPFORMS= FA.getIcon('\uF298');
public static String ENVIRA= FA.getIcon('\uF299');
public static String UNIVERSAL_ACCESS= FA.getIcon('\uF29A');
public static String WHEELCHAIR_ALT= FA.getIcon('\uF29B');
public static String QUESTION_CIRCLE_O= FA.getIcon('\uF29C');
public static String BLIND= FA.getIcon('\uF29D');
public static String AUDIO_DESCRIPTION= FA.getIcon('\uF29E');
public static String VOLUME_CONTROL_PHONE= FA.getIcon('\uF2A0');
public static String BRAILLE= FA.getIcon('\uF2A1');
public static String ASSISTIVE_LISTENING_SYSTEMS= FA.getIcon('\uF2A2');
public static String ASL_INTERPRETING= FA.getIcon('\uF2A3');
public static String AMERICAN_SIGN_LANGUAGE_INTERPRETING= FA.getIcon('\uF2A3');
public static String DEAFNESS= FA.getIcon('\uF2A4');
public static String HARD_OF_HEARING= FA.getIcon('\uF2A4');
public static String DEAF= FA.getIcon('\uF2A4');
public static String GLIDE= FA.getIcon('\uF2A5');
public static String GLIDE_G= FA.getIcon('\uF2A6');
public static String SIGNING= FA.getIcon('\uF2A7');
public static String SIGN_LANGUAGE= FA.getIcon('\uF2A7');
public static String LOW_VISION= FA.getIcon('\uF2A8');
public static String VIADEO= FA.getIcon('\uF2A9');
public static String VIADEO_SQUARE= FA.getIcon('\uF2AA');
public static String SNAPCHAT= FA.getIcon('\uF2AB');
public static String SNAPCHAT_GHOST= FA.getIcon('\uF2AC');
public static String SNAPCHAT_SQUARE= FA.getIcon('\uF2AD');
public static String PIED_PIPER= FA.getIcon('\uF2AE');
public static String FIRST_ORDER= FA.getIcon('\uF2B0');
public static String YOAST= FA.getIcon('\uF2B1');
public static String THEMEISLE= FA.getIcon('\uF2B2');
public static String GOOGLE_PLUS_CIRCLE= FA.getIcon('\uF2B3');
public static String GOOGLE_PLUS_OFFICIAL= FA.getIcon('\uF2B3');
public static String FONT_AWESOME= FA.getIcon('\uF2B4');
/**
* get font file as input stream.
* use Font.TRUETYPE_FONT when loading via swing
* @return InputStream font file
*/
public static InputStream getFont(){
return FA.class.getResourceAsStream("fontawesome-webfont.ttf");
}
/**
* convert icon code to String character
* @param code
* @return String icon
*/
private static String getIcon(char code){
return String.valueOf(code);
}
}
| CraterTechLLC/FontAwesome-Java | FA.java |
1,405 | /*<!--JSP! maaaction DA JAAction-->
<s:url var="LINKX" value="da"/>
<s:a href="%{LINKX}"> LINKX</a>
<!--da-->
<s:form action="dd"/>
<s:select list="Engine" Headerkey="-1" HeaderValue="youSearch" name="youSearch" value="Engine"/>
<s:select list="#{'1 - Janeiro':'1 - Janeiro' ,'2 - Fevereiro':'2 - Fevereiro', '3 - Março':'3 - Março'}" Headerkey="-1"
HeaderValue="youMonth" name="youMonth" value="2"/>
</s: form>
<!--dd-->
<s:property value="youMonth"/>
<br>
<s:property value="youSearch"/>*/
public class DA extends ActionSupport {
private List<String> Engine;
private String youSearch;
private String youMonth;
//ggas
public String getDefaultSearch() {
return "www.google.com.br";
}
public DA {
Engine = new ArrayList<String>();
Engine.add("www.google.com.br");
Engine.add("www.youtube.com.br");
Engine.add("www.udemy.com.br");
Engine.add("www.facebook.com.br");
Engine.add("www.java.com");
}
public String display() {
return "NONE";
}
public String execute() throws Exception {
return "success";
}
}
| rafaelfranco1/APACHESTRUTSIN2020JAVA | DA.java |
1,409 | import com.mojang.authlib.GameProfile;
import java.util.Collections;
import java.util.List;
import net.minecraft.server.MinecraftServer;
public class r
extends i
{
public String c()
{
return "ban";
}
public int a()
{
return 3;
}
public String b(m ☃)
{
return "commands.ban.usage";
}
public boolean a(MinecraftServer ☃, m ☃)
{
return (☃.al().h().b()) && (super.a(☃, ☃));
}
public void a(MinecraftServer ☃, m ☃, String[] ☃)
throws bz
{
if ((☃.length < 1) || (☃[0].length() <= 0)) {
throw new cf("commands.ban.usage", new Object[0]);
}
GameProfile ☃ = ☃.aA().a(☃[0]);
if (☃ == null) {
throw new bz("commands.ban.failed", new Object[] { ☃[0] });
}
String ☃ = null;
if (☃.length >= 2) {
☃ = a(☃, ☃, 1).c();
}
ms ☃ = new ms(☃, null, ☃.h_(), null, ☃);
☃.al().h().a(☃);
lr ☃ = ☃.al().a(☃[0]);
if (☃ != null) {
☃.a.c("You are banned from this server.");
}
a(☃, this, "commands.ban.success", new Object[] { ☃[0] });
}
public List<String> a(MinecraftServer ☃, m ☃, String[] ☃, cj ☃)
{
if (☃.length >= 1) {
return a(☃, ☃.J());
}
return Collections.emptyList();
}
}
| MCLabyMod/LabyMod-1.9 | r.java |
1,410 | class Solution {
public int furthestBuilding(int[] heights, int bricks, int ladders) {
int n = heights.length;
PriorityQueue<Integer> pq = new PriorityQueue<Integer>();
for(int i=0;i<n-1;i++) {
int diff = heights[i+1] - heights[i];
if(diff > 0) {
if(pq.size() < ladders) {
pq.add(diff);
} else {
if(pq.isEmpty() || pq.peek() >= diff) {
bricks -= diff;
} else {
int poll = pq.poll();
pq.add(diff);
bricks -= poll;
}
if(bricks < 0) return i;
}
}
}
return n-1;
}
}
| ShivaniiSinghh/Leetcode | 1642. Furthest Building You Can Reach |
1,411 | /**
* // This is the BinaryMatrix's API interface.
* // You should not implement it, or speculate about its implementation
* interface BinaryMatrix {
* public int get(int row, int col) {}
* public List<Integer> dimensions {}
* };
*/
class Solution {
public int leftMostColumnWithOne(BinaryMatrix binaryMatrix) {
int result = -1 ;
List< Integer > dim = binaryMatrix.dimensions() ;
int row = dim.get(0);
int col = dim.get(1);
if ( row == 0 || col == 0 ) {
return result ;
}
int r = 0 ;
int c = col - 1;
while ( r < row && c >= 0 ) {
if ( binaryMatrix.get( r , c ) == 1 ) {
result = c ;
c-- ;
} else {
r++ ;
}
}
return result ;
}
}
| AnjaliSharma1234/30Days-Leetcoding-Challenge | 21.java |
1,416 | import java.util.*;class T{public static void main(String[]a){(new T()).s();}int[][]b=new int[4][4];int d,p,i,j,x,y,v,q,r;boolean I,V;void s(){p();do{d();do{char a=(new Scanner(System.in)).nextLine().charAt(0);y=a=='u'?f(0,1):a=='d'?f(1,1):a=='l'?f(0,0):a=='r'?f(1,0):0;}while(y<1);p();}while((x=n())>0);d();c("you "+(x<0?"win":"lose"));}int h(){for(int[]y:b)for(int x:y)if(x<2)return 1;return 0;}int n(){for(y=0;y<4;y++){for(x=0;x<4;x++){i=b[y][x];if(x<3&&i==b[y][x+1]||y<3&&i==b[y+1][x])return 1;if(i>2047)return -1;}}return h();}int f(int w,int z){I=w>0;V=z>0;for(i=d=0;i<4;i++){p=I?3:0;for(j=1;j<4;){v=V?i:j;x=I?3-v:v;v=V?j:i;y=I?3-v:v;q=V?x:p;r=V?p:y;if(b[y][x]==0||p==(V?y:x))j++;else if(b[r][q]==0){d+=b[r][q]=b[y][x];b[y][x]=0;j++;}else if(b[r][q]==b[y][x]){d+=b[r][q]*=2;b[y][x]=0;p+=I?-1:1;j++;}else p+=I?-1:1;}}return d;}int v(){return(new Random()).nextInt(4);}void p(){if(h()<1)return;do{x=v();y=v();}while(b[x][y]>0);b[x][y]=2;}void c(String a){System.out.println(a);}String l(char n,char m){String s=""+n;for(i=0;i<4;i++){for(j=0;j<4;j++)s+=m;s+=n;}return s;}void d(){c(l('+','-'));String p[]=new String[5];for(int[]y:b){p[0]=p[1]=p[3]=l('|',' ');p[2]="";for(x=0;x<4;)p[2]+=String.format("|%4d",y[x++]);p[2]+="|";p[4]=l('+','-');for(String q:p)c(q);}}}
| ProgrammerDan/twentyfortyeight | T.java |
1,418 | public class Go implements Square {
public void handlePlayer(Player p){
// do nothing!!!!!!!!!!!!!!!!!!
System.out.println ("You have passed Go! Collect 200.00");
}
public Player getOwner() {
return null;
}
}
| BenPollock/Monopoly | Go.java |
1,419 | /*
* Copyright 2013-2015 the original author or authors.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.schildbach.wallet.util;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;
import java.util.Hashtable;
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.EncodeHintType;
import com.google.zxing.WriterException;
import com.google.zxing.common.BitMatrix;
import com.google.zxing.qrcode.QRCodeWriter;
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
import android.graphics.Bitmap;
/**
* @author Andreas Schildbach
*/
public class Qr {
private final static QRCodeWriter QR_CODE_WRITER = new QRCodeWriter();
private static final Logger log = LoggerFactory.getLogger(Qr.class);
public static Bitmap bitmap(final String content) {
try {
final Hashtable<EncodeHintType, Object> hints = new Hashtable<EncodeHintType, Object>();
hints.put(EncodeHintType.MARGIN, 0);
hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H);
final BitMatrix result = QR_CODE_WRITER.encode(content, BarcodeFormat.QR_CODE, 0, 0, hints);
final int width = result.getWidth();
final int height = result.getHeight();
final byte[] pixels = new byte[width * height];
for (int y = 0; y < height; y++) {
final int offset = y * width;
for (int x = 0; x < width; x++) {
pixels[offset + x] = (byte) (result.get(x, y) ? -1 : 0);
}
}
final Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ALPHA_8);
bitmap.copyPixelsFromBuffer(ByteBuffer.wrap(pixels));
return bitmap;
} catch (final WriterException x) {
log.info("problem creating qr code", x);
return null;
}
}
public static String encodeCompressBinary(final byte[] bytes) {
try {
final ByteArrayOutputStream bos = new ByteArrayOutputStream(bytes.length);
final GZIPOutputStream gos = new GZIPOutputStream(bos);
gos.write(bytes);
gos.close();
final byte[] gzippedBytes = bos.toByteArray();
final boolean useCompressioon = gzippedBytes.length < bytes.length;
final StringBuilder str = new StringBuilder();
str.append(useCompressioon ? 'Z' : '-');
str.append(Base43.encode(useCompressioon ? gzippedBytes : bytes));
return str.toString();
} catch (final IOException x) {
throw new RuntimeException(x);
}
}
public static String encodeBinary(final byte[] bytes) {
return Base43.encode(bytes);
}
public static byte[] decodeDecompressBinary(final String content) throws IOException {
final boolean useCompression = content.charAt(0) == 'Z';
final byte[] bytes = Base43.decode(content.substring(1));
InputStream is = new ByteArrayInputStream(bytes);
if (useCompression)
is = new GZIPInputStream(is);
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
final byte[] buf = new byte[4096];
int read;
while (-1 != (read = is.read(buf)))
baos.write(buf, 0, read);
baos.close();
is.close();
return baos.toByteArray();
}
public static byte[] decodeBinary(final String content) throws IOException {
return Base43.decode(content);
}
}
| schildbach/bitcoin-wallet | wallet/src/de/schildbach/wallet/util/Qr.java |
1,420 | import java.util.Scanner;
public class Q2
{
public static void main(String[] args)
{
int val1,val2,no=-1;
float c;
//String d;
//char oper;
Scanner in=new Scanner(System.in);
while(no!=0) {
System.out.println("Enter the 2 numbers to perform calculations");
val1=in.nextInt();
val2=in.nextInt();
System.out.println("Now Press\n '1' for addition\n '2' for subtraction\n '3' for multiplication\n '4' for division\n '5' for remainder division or mod\n '0' for EXIT");
no=in.nextInt();
//d=in.nextLine();
//oper=d.charAt(1);
//a=d.substring();
//b=d.substring(2);
switch(no)
{
case 1:
c=val1+val2;
System.out.println(val1+"+"+val2+"="+c);
break;
case 2:
c=val1-val2;
System.out.println(val1+"-"+val2+"="+c);
break;
case 3:
c=val1*val2;
System.out.println(val1+"*"+val2+"="+c);
break;
case 4:
if(val2==0){
System.out.println("Denominator is ZERO so division is not possible");}
else {
c=(float)val1/val2;
System.out.println(val1+"/"+val2+"="+c);}
break;
case 5:
c=val1%val2;
System.out.println(val1+"%"+val2+"="+c);
break;
case 0:
System.out.println("You exit successfully");
break;
}
}
}
}
| UMT-SoftwareEngineeringX/FaceBook | Q2.java |
1,421 | import java.util.Scanner;
public class Calulator{
public static void main(String[]args){
Scanner sc = new Scanner(System.in);
double num1, num2 , num3;
// Take input from the user
// Scanner sc = new Scanner(System.in);
System.out.println("Enter the numbers");
// take the inputs
num1 = sc.nextDouble();
num2 = sc.nextDouble();
num3 = sc.nextDouble();
System.out.println("Enter the operator (+,-,*,/)");
char op = sc.next().charAt(0);
double o = 0;
switch (op) {
// case to add three numbers
case '+':
o = num1 + num2 + num3;
break;
// case to subtract three numbers
case '-':
o = num1 - num2 - num3;
break;
// case to multiply three numbers
case '*':
o = num1 * num2 * num3;
break;
// case to divide three numbers
case '/':
o = num1 / num2 / num3;
break;
default:
System.out.println("You enter wrong input");
break;
}
// System.out.println("The final result:");
// System.out.println();
// print the final result
System.out.println(num1 + " " + op + " " + num2
+ " " + op + " " + num3 + " " + op + " = " + o);
}
} | MLSA-MUET-SZAB-Club-Khairpur-Mir-s/Learn-to-Code | Java/Calulator.java |
1,426 | import java.io.*;
public class q9
{
public void func()throws IOException
{
int age ,p;
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter your sex Mfor male &F for female");
String q=br.readLine();
char s=q.charAt(0);
System.out.println("Enter your age");
age=Integer.parseInt(br.readLine());
if(s=='m')
{
if(age>=65&&age<70)
p=50;
else if(age>=70)
p=70;
else
p=0;
}
else
{
if(age>=60&&age<65)
p=45;
else if(age>=65)
p=60;
else
p=0;
}
System.out.println("You would get Rs"+p+"a week");
}
} | shikhar29111996/Java-programs | q9.java |
1,428 | package inversion;
import org.apache.commons.math3.stat.inference.WilcoxonSignedRankTest;
import java.lang.*;
public class SV implements Comparable<SV> {
public final static boolean test=Main.test;
public String type;
public String chr;
public String chr2;// the same for deletion insertion
public int start1;
public int start2;// start2 is the end for deletion
// public int svSize;
public boolean correct;// true=right false=correct
//public String orientation;
public int orientation;
public int homo;
// May be you should not use the constructor to check it is a SV or not
public SV(Alignment first, Alignment second){
this.correct=false;
boolean firstStrand=first.getStrand().equals("+");
boolean secondStrand=second.getStrand().equals("+");
if(first.getChr().equals(second.getChr())){
this.chr=first.getChr();
this.chr2=second.getChr();
if((first.getStrand().equals("+") && second.getStrand().equals("+") ) ||
(first.getStrand().equals("-") && second.getStrand().equals("-") )){
}else if((first.getStrand().equals("+") && second.getStrand().equals("-") ) ||
(first.getStrand().equals("-") && second.getStrand().equals("+") )){
// different orientation
this.type="INV";
if(Math.abs(first.getRefStart()-second.getRefStart())<100 || Math.abs(first.getRefEnd()-second.getRefEnd())<100){
// System.out.println("false abs");
this.correct=false;// reverse read
}
int tmp=first.getMappingEnd()-second.getMappingStart();
if(tmp<0){
this.homo=0;
}else {
this.homo=tmp;
}
//this is choosing outer of inversion ,not to deleting the IR
//4type
//Draw picture
if(firstStrand){
if(first.getRefEnd()<second.getRefEnd()){
//type 0:
this.start1=first.getRefEnd()-this.homo;
this.start2=second.getRefEnd();
this.orientation=0;
//this.orientation="LF";
}else{
this.start1=first.getRefEnd();
this.start2=second.getRefEnd()-this.homo;
this.orientation=1;
//this.orientation="LR";
}
}else if(secondStrand){
if(first.getRefStart()<second.getRefStart()){
this.start1=first.getRefStart();
this.start2=second.getRefStart()+this.homo;
this.orientation=2;
//this.orientation="RF";
}else{
this.start1=first.getRefStart()+this.homo;
this.start2=second.getRefStart();
this.orientation=3;
//this.orientation="RR";
}
}else{
System.err.println("Program error for firstStrand/secondStrand\n");
System.exit(1);
}
this.correct=true;
}else{
System.err.println("correct in orientation."+first.getStrand()+"\t"+ second.getStrand()+"Contact author\n");
System.exit(1);
}
}else{
}
// sort the chromosome
if(first.getChr().equals(second.getChr())){
if(this.getStart1()>this.getStart2()){
int tmp=this.getStart1();
this.start1=this.getStart2();
this.start2=tmp;
}
}
}
public SV(String string, String chr, int start, int end, int size) {
// TODO Auto-generated constructor stub
// not use
this.type=string;
this.chr=chr;
this.chr2=chr;
this.start1=start;
this.start2=end;
// this.svSize=size;
this.correct=true;//right
// System.out.println(this.toString());
}
public SV(String string) {
//this.sv+="DEL\t"+this.chr+"\t"+ Integer.toString(start)+"\t"+
//Integer.toString(end)+"\t"+ digital[i]+"\n";
String[] info=string.split("\t");
this.type=info[0];
this.chr=info[1];
this.chr2=info[2];
this.start1=Integer.parseInt(info[3]);
this.start2=Integer.parseInt(info[4]);
//this.svSize=Integer.parseInt(info[5]);
}
public boolean getSVcorrect(){
return this.correct;
}
@Override
public int compareTo(SV o) {
// TODO Auto-generated method stub
int out=compareChr(this.chr,o.chr);
if(out==0){
return this.start1-o.start1;
}else{
return out;
}
}
public static int compareChr(String a,String b){
return a.compareTo(b);
}
// public static int compareChr(String a,String b){
// String[] a1=a.split("(?=\\d)(?<!\\d)");
// String[] b1=b.split("(?=\\d)(?<!\\d)");
// if(!a1[0].equals(b1[0])){
// return a.compareTo(b);
// }else{
// if(a1.length==2 && b1.length==2){
// try{
// return Integer.parseInt(a1[1])-Integer.parseInt(b1[1]);
// }catch(NumberFormatException e){
// return a.compareTo(b);
// }
// }else{
// return a.compareTo(b);
// }
// }
// }
public String toString(){
String info="CHR2="+this.chr2+";END="+this.start2+";HOMO="+this.homo+";orientation="+this.orientation+";";
String out=this.chr+"\t"+this.start1+" \t"+0+"\tREF\t"+this.type+"\tQUAL\tFILTER\t"+info+"\tGT\tNA\n";
return out;
}
public String toString(int i) {
// TODO Auto-generated method stub
String info="CHR2="+this.chr2+";END="+this.start2+";HOMO="+this.homo+";orientation="+this.orientation+";";
String out=this.chr+"\t"+this.start1+" \t"+i+"\tREF\t"+this.type+"\tQUAL\tFILTER\t"+info+"\tGT\tNA\n";
return out;
}
public String getType(){
return this.type;
}
public String getchr(){
return this.chr;
}
public String getChr2(){
return this.chr2;
}
public int getStart1(){
return this.start1;
}
public int getStart2(){
return this.start2;
}
public int getOrientation(){
return this.orientation;
}
public int getHomo(){
return this.homo;
}
}
| haojingshao/npInv | SV.java |
1,430 | public class RightTrianglePattern
{
public static void main(String args[])
{
//i for rows and j for columns
//row denotes the number of rows you want to print
int i, j, row=6;
//outer loop for rows
for(i=0; i<row; i++)
{
//inner loop for columns
for(j=0; j<=i; j++)
{
//prints stars
System.out.print("* ");
}
//throws the cursor in a new line after printing each line
System.out.println();
}
}
| dharmanshu9930/Java | rv.java |
1,431 | import java.util.Scanner;
// Below this comment: import the Scanner
class Initials {
public static void main(String[] args) {
// Below this comment: declare and instantiate a Scanner
Scanner sc = new Scanner(System.in);
// Below this comment: declare any other variables you may need
System.out.print("Enter name : ");
String name = sc.nextLine();
// Below this comment: collect the required inputs
// Below this comment: call your required method
// Below this comment: disply the required results
System.out.println("For "+name+" initials are : "+toInitials(name));
}
// define your required method here below
public static String toInitials(String inp) {
String output = inp.charAt(0);
output += ".";
for (int i = 0; i < array.length; i++) {
output += " ";
if (inp.charAt(i) == ' ')
output = output + inp.charAt(i + 1) + ".";
}
}
}
| aryankeluskar/Java-Projects | hi.java |
1,433 | import java.util.*;
public class fo {
public static void main( String[] args){
Scanner n=new Scanner(System.in);
System.out.println("enter the number you want to print");
int x=n.nextInt();
for(int i=0;i<x;i++)
{
System.out.print(i);
}
}
}
| vampire20045/java | fo.java |
1,434 | import java.util.*;
public class ui{
static String[][] disp = new String[8][8];
// static int onesscore = 0;
// static int twoscore = 0;
static int[] score = new int[3];
static int numvalidmoves = 0;
public static void main(String[] args) {
//Random random = new Random();
initialize();
//System.out.println(disp[0][0]);
// for(int i=0;i<8;i++){
// for(int j=0;j<8;j++){
// int temp= random.nextInt(3);
// if(temp==0){
// disp[i][j]="_";
// }else{
// disp[i][j]=temp+"";
// }
// }
// }
int[] columnindex = new int[8];
for(int k=0;k<8;k++){
columnindex[k]=k;
}
System.out.println("\\"+" "+Arrays.toString(columnindex));
for(int i=0;i<8;i++){
System.out.println(i+" "+Arrays.toString(disp[i]));
}
int chanceofplayer=1;
Scanner s= new Scanner(System.in);
while(true){
if(score[1]+score[2]==64){
break;
}
String[][] tempdisc =new String[8][8];
for(int h=0;h<8;h++){
for(int g=0;g<8;g++){
tempdisc[h][g]=disp[h][g];
}
}
boolean movesav = checkifvalid(tempdisc, chanceofplayer);
if(movesav){
System.out.println("you have "+numvalidmoves +" valid moves and they are =");
System.out.println("\\"+" "+Arrays.toString(columnindex));
for(int i=0;i<8;i++){
System.out.println(i+" "+Arrays.toString(tempdisc[i]));
}
}else{
System.out.println("you have no valid move");
System.out.println("Score is: player 1 has "+score[1]+" points and player 2 has "+score[2]+" points");
break;
}
// System.out.println("")
// System.out.println("\\"+" "+Arrays.toString(columnindex));
// for(int i=0;i<8;i++){
// System.out.println(i+" "+Arrays.toString(tempdisc[i]));
// }
System.out.println("Score is: player 1 has "+score[1]+" points and player 2 has "+score[2]+" points");
System.out.println("you are player "+chanceofplayer);
System.out.println("Enter your x coordinate where you want to place: ");
int x=s.nextInt();
// System.out.println("x is "+x);
System.out.println("Enter your y coordinate where you want to place: ");
int y=s.nextInt();
// System.out.println("y is "+y);
boolean wasvalid = checkValidV2(disp, x, y, chanceofplayer);
if(wasvalid){
System.out.println("your doing was valid");
System.out.println("\\"+" "+Arrays.toString(columnindex));
for(int i=0;i<8;i++){
System.out.println(i+" "+Arrays.toString(disp[i]));
}
chanceofplayer = 3-chanceofplayer;
}else{
System.out.println("Your doing was invalid");
System.out.println("\\"+" "+Arrays.toString(columnindex));
for(int i=0;i<8;i++){
System.out.println(i+" "+Arrays.toString(disp[i]));
}
}
System.out.println("______________");
//s.close();
}
System.out.println("game over");
}
public static void initialize(){
disp[3][3] = "1";
disp[4][4] = "1";
disp[3][4] = "2";
disp[4][3] = "2";
for(int i=0;i<8;i++){
for(int j=0;j<8;j++){
if(disp[i][j]!="1" && disp[i][j]!="2"){
disp[i][j]="_";
}
}
}
// onesscore=onesscore+2;
// twoscore=twoscore+2;
score[1]=2;
score[2]=2;
}
public static boolean checkValidV2(String[][] obj, int x, int y, int player){
String sameone = player+"";
String otherone = (3- (player))+"";
int initialscore = score[player];
// boolean row = false;
// boolean column =false;
// boolean diagonalforwardlash = false;
// boolean diagonalbackwardlash = false;
// System.out.println("sameone is "+sameone);
// System.out.println("otherone is "+otherone);
// System.out.println("player is "+player);
if(obj[x][y].equals("1")|obj[x][y].equals("2")){
return false;
}
//checkforwaddiagonal/
//x and y
//check up x- y+ x-1 times if x+y<=7 6-y if x+y>7
boolean forwardup=false;
if(x==1 | x==0| y==6 | y==7){
//upnotpossbile
}else{
if(!(obj[x-1][y+1].equals(otherone))){
//upnotpossible
}else{
int numtimes=0;
if(x+y<=7){
numtimes= x-1;
}else{
numtimes= 6-y;
}
int tempx= x-2;
int tempy= y+2;
for(int i=0;i<numtimes;i++){
if(obj[tempx][tempy].equals(sameone)){
tempx= x-1;
tempy= y+1;
for(int j=0;j<=i;j++){
obj[tempx][tempy]=sameone;
tempx--;
tempy++;
score[player]=score[player]+i+1;
}
forwardup=true;
break;
}else if(obj[tempx][tempy].equals("_")){
//upnotpossible
break;
}
tempx--;
tempy++;
}
//upnotpossible
}
}
//check down
//x++ y-- y-1 times if x+y<=7 6-x if x+y>7
boolean forwarddown =false;
if(x==6 | x==7| y==0 | y==1){
//upnotpossbile
}else
{
if(!(obj[x+1][y-1].equals(otherone))){
//upnotpossible
}else{
int numtimes=0;
if(x+y<=7){
numtimes= y-1;
}else{
numtimes= 6-x;
}
int tempx= x+2;
int tempy= y-2;
for(int i=0;i<numtimes;i++){
if(obj[tempx][tempy].equals(sameone)){
tempx= x+1;
tempy= y-1;
for(int j=0;j<=i;j++){
obj[tempx][tempy]=sameone;
tempx++;
tempy--;
score[player] = score[player]+i+1;
}
forwarddown=true;
break;
}else if(obj[tempx][tempy].equals("_")){
//upnotpossible
break;
}
tempx++;
tempy--;
}
//upnotpossible
}
}
//checkbackslash
//
//checkup x-- y-- if y>=x x-1 times else y-1 times
boolean backup = false;
if(x==0|x==1|y==0|y==1){
}else{
if(!(obj[x-1][y-1].equals(otherone))){
//upnotpossible
}else{
int numtimes=0;
if(x<=y){
numtimes= x-1;
}else{
numtimes= y-1;
}
int tempx= x-2;
int tempy= y-2;
for(int i=0;i<numtimes;i++){
if(obj[tempx][tempy].equals(sameone)){
tempx= x-1;
tempy= y-1;
for(int j=0;j<=i;j++){
obj[tempx][tempy]=sameone;
tempx--;
tempy--;
score[player] = score[player]+i+1;
}
backup=true;
break;
}else if(obj[tempx][tempy].equals("_")){
//upnotpossible
break;
}
tempx--;
tempy--;
}
//upnotpossible
}
}
boolean backdown = false;
// checkdown if y>=x 6-y times else 6-x times
if(x==6|x==7|y==6|y==7){
}else{
if(!(obj[x+1][y+1].equals(otherone))){
//upnotpossible
}else{
int numtimes=0;
if(x<=y){
numtimes= 6-y;
}else{
numtimes= 6-x;
}
int tempx= x+2;
int tempy= y+2;
for(int i=0;i<numtimes;i++){
if(obj[tempx][tempy].equals(sameone)){
tempx= x+1;
tempy= y+1;
for(int j=0;j<=i;j++){
obj[tempx][tempy]=sameone;
tempx++;
tempy++;
score[player] = score[player]+i+1;
}
forwardup=true;
break;
}else if(obj[tempx][tempy].equals("_")){
//upnotpossible
break;
}
tempx++;
tempy++;
}
//upnotpossible
}
}
//horizontal
//check right
// System.out.println("it must enter here for righthori");
boolean horizontalright =false;
if(!(y==6| y==7) && obj[x][y+1].equals(otherone)){
for(int i=y+2;i<=7;i++){
if(obj[x][i].equals(sameone)){
for(int j=y+1;j<=i-1;j++){
obj[x][j]=sameone;
score[player] = score[player]+i-y-1;
}
horizontalright= true;
// System.out.println("true saabit ho chuka hai");
break;
}else if(obj[x][i].equals("_")){
break;
}
}
}
// System.out.println("it must enter here for lefthori");
boolean horizontalleft =false;
if(!(y==0| y==1) && obj[x][y-1].equals(otherone)){
// System.out.println("it must enter here for ");
for(int i=y-2;i>=0;i--){
if(obj[x][i].equals(sameone)){
for(int j=y-1;j>=i+1;j--){
obj[x][j]=sameone;
score[player] = score[player]+y-i-1;
}
horizontalleft= true;
// System.out.println("true saabit ho chuka hai");
break;
}else if(obj[x][i].equals("_")){
break;
}
}
}
boolean verticaldown =false;
if(!(x==6| x==7) && obj[x+1][y].equals(otherone)){
for(int i=x+2;i<=7;i++){
if(obj[i][y].equals(sameone)){
for(int j=x+1;j<=i-1;j++){
obj[j][y]=sameone;
score[player] = score[player]+i-x-1;
}
verticaldown= true;
break;
}else if(obj[i][x].equals("_")){
break;
}
}
}
boolean verticalup =false;
if(!(x==0| x==1) && obj[x-1][y].equals(otherone)){
for(int i=x-2;i>=0;i--){
if(obj[i][y].equals(sameone)){
for(int j=x-1;j>=i+1;j--){
obj[j][y]=sameone;
score[player] = score[player]+x-i-1;
}
verticalup= true;
break;
}else if(obj[i][y].equals("_")){
break;
}
}
}
if(horizontalleft==true |horizontalright==true|verticaldown==true|verticalup==true|forwarddown==true|forwardup==true|backup==true|backdown==true){
obj[x][y]=sameone;
score[player]=score[player]+1;
score[3-player]=score[3-player] -(score[player]-initialscore-1);
return true;
}else{
return false;
}
}
public static boolean checkifvalid(String[][] obj,int player){
String sameone = player+"";
String otherone = (3- (player))+"";
boolean finbool=false;
numvalidmoves=0;
for(int k=0;k<8;k++){
for(int l=0;l<8;l++){
int x=k;
int y=l;
// if(obj[x][y].equals(sameone)| obj[x][y].equals(otherone)){
// continue;
// }
// int initialscore = score[player];
// boolean row = false;
// boolean column =false;
// boolean diagonalforwardlash = false;
// boolean diagonalbackwardlash = false;
// System.out.println("sameone is "+sameone);
// System.out.println("otherone is "+otherone);
// System.out.println("player is "+player);
if(obj[x][y].equals("1")|obj[x][y].equals("2")){
continue;
}
//checkforwaddiagonal/
//x and y
//check up x- y+ x-1 times if x+y<=7 6-y if x+y>7
boolean forwardup=false;
if(x==1 | x==0| y==6 | y==7){
//upnotpossbile
}else{
if(!(obj[x-1][y+1].equals(otherone))){
//upnotpossible
}else{
int numtimes=0;
if(x+y<=7){
numtimes= x-1;
}else{
numtimes= 6-y;
}
int tempx= x-2;
int tempy= y+2;
for(int i=0;i<numtimes;i++){
if(obj[tempx][tempy].equals(sameone)){
// tempx= x-1;
// tempy= y+1;
// for(int j=0;j<=i;j++){
// obj[tempx][tempy]=sameone;
// tempx--;
// tempy++;
// score[player]=score[player]+i+1;
// }
forwardup=true;
break;
}else if(obj[tempx][tempy].equals("_") | obj[tempx][tempy].equals("=") ){
//upnotpossible
break;
}
tempx--;
tempy++;
}
//upnotpossible
}
}
//check down
//x++ y-- y-1 times if x+y<=7 6-x if x+y>7
boolean forwarddown =false;
if(x==6 | x==7| y==0 | y==1){
//upnotpossbile
}else
{
if(!(obj[x+1][y-1].equals(otherone))){
//upnotpossible
}else{
int numtimes=0;
if(x+y<=7){
numtimes= y-1;
}else{
numtimes= 6-x;
}
int tempx= x+2;
int tempy= y-2;
for(int i=0;i<numtimes;i++){
if(obj[tempx][tempy].equals(sameone)){
// tempx= x+1;
// tempy= y-1;
// for(int j=0;j<=i;j++){
// obj[tempx][tempy]=sameone;
// tempx++;
// tempy--;
// score[player] = score[player]+i+1;
// }
forwarddown=true;
break;
}else if(obj[tempx][tempy].equals("_") | obj[tempx][tempy].equals("=")){
//upnotpossible
break;
}
tempx++;
tempy--;
}
//upnotpossible
}
}
//checkbackslash
//
//checkup x-- y-- if y>=x x-1 times else y-1 times
boolean backup = false;
if(x==0|x==1|y==0|y==1){
}else{
if(!(obj[x-1][y-1].equals(otherone))){
//upnotpossible
}else{
int numtimes=0;
if(x<=y){
numtimes= x-1;
}else{
numtimes= y-1;
}
int tempx= x-2;
int tempy= y-2;
for(int i=0;i<numtimes;i++){
if(obj[tempx][tempy].equals(sameone)){
// tempx= x-1;
// tempy= y-1;
// for(int j=0;j<=i;j++){
// obj[tempx][tempy]=sameone;
// tempx--;
// tempy--;
// score[player] = score[player]+i+1;
// }
backup=true;
break;
}else if(obj[tempx][tempy].equals("_") | obj[tempx][tempy].equals("=")){
//upnotpossible
break;
}
tempx--;
tempy--;
}
//upnotpossible
}
}
boolean backdown = false;
// checkdown if y>=x 6-y times else 6-x times
if(x==6|x==7|y==6|y==7){
}else{
if(!(obj[x+1][y+1].equals(otherone))){
//upnotpossible
}else{
int numtimes=0;
if(x<=y){
numtimes= 6-y;
}else{
numtimes= 6-x;
}
int tempx= x+2;
int tempy= y+2;
for(int i=0;i<numtimes;i++){
if(obj[tempx][tempy].equals(sameone)){
// tempx= x+1;
// tempy= y+1;
// for(int j=0;j<=i;j++){
// obj[tempx][tempy]=sameone;
// tempx++;
// tempy++;
// score[player] = score[player]+i+1;
// }
forwardup=true;
break;
}else if(obj[tempx][tempy].equals("_") | obj[tempx][tempy].equals("=")){
//upnotpossible
break;
}
tempx++;
tempy++;
}
//upnotpossible
}
}
//horizontal
//check right
// System.out.println("it must enter here for righthori");
boolean horizontalright =false;
if(!(y==6| y==7) && obj[x][y+1].equals(otherone)){
for(int i=y+2;i<=7;i++){
if(obj[x][i].equals(sameone)){
// for(int j=y+1;j<=i-1;j++){
// obj[x][j]=sameone;
// score[player] = score[player]+i-y-1;
// }
horizontalright= true;
// System.out.println("true saabit ho chuka hai");
break;
}else if(obj[x][i].equals("_") | obj[x][i].equals("=")){
break;
}
}
}
// System.out.println("it must enter here for lefthori");
boolean horizontalleft =false;
if(!(y==0| y==1) && obj[x][y-1].equals(otherone)){
// System.out.println("it must enter here for ");
for(int i=y-2;i>=0;i--){
if(obj[x][i].equals(sameone)){
// for(int j=y-1;j>=i+1;j--){
// obj[x][j]=sameone;
// score[player] = score[player]+y-i-1;
// }
horizontalleft= true;
// System.out.println("true saabit ho chuka hai");
break;
}else if(obj[x][i].equals("_") | obj[x][i].equals("=")){
break;
}
}
}
boolean verticaldown =false;
if(!(x==6| x==7) && obj[x+1][y].equals(otherone)){
for(int i=x+2;i<=7;i++){
if(obj[i][y].equals(sameone)){
// for(int j=x+1;j<=i-1;j++){
// obj[j][y]=sameone;
// score[player] = score[player]+i-x-1;
// }
verticaldown= true;
break;
}else if(obj[i][x].equals("_") | obj[i][x].equals("=")){
break;
}
}
}
boolean verticalup =false;
if(!(x==0| x==1) && obj[x-1][y].equals(otherone)){
for(int i=x-2;i>=0;i--){
if(obj[i][y].equals(sameone)){
// for(int j=x-1;j>=i+1;j--){
// obj[j][y]=sameone;
// score[player] = score[player]+x-i-1;
// }
verticalup= true;
break;
}else if(obj[i][y].equals("_") | obj[i][y].equals("=")){
break;
}
}
}
if(horizontalleft==true |horizontalright==true|verticaldown==true|verticalup==true|forwarddown==true|forwardup==true|backup==true|backdown==true){
obj[x][y]="$";
numvalidmoves++;
// score[player]=score[player]+1;
// score[3-player]=score[3-player] -(score[player]-initialscore-1);
finbool= true;
}
}
}
return finbool;
}
} | akshat-khare/reversijava | ui.java |
1,435 | 00 01 00 3B 00 4B 00 AF 00 00 00 00 00 19 00 CA 00 26 03 00 00 00 00 00 00 00 00 00 00 33 2A 3A 26 2B 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Abaddon
00 01 00 83 00 03 00 46 00 00 00 00 00 2C 01 49 01 00 00 00 00 00 00 00 00 00 00 00 00 03 04 05 07 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Agathion
00 01 00 2F 00 53 00 C4 00 00 00 00 00 3F 00 8B 03 45 00 00 00 00 00 00 00 00 00 00 00 2D 3D 31 36 2F 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Alice
00 01 00 A9 01 51 00 9E 00 00 00 00 00 82 00 55 01 AD 03 00 00 00 00 00 00 00 00 00 00 2D 36 39 31 2D 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Alilat
00 01 00 59 00 0D 00 A0 00 00 00 00 00 2B 00 21 00 31 01 49 00 00 00 00 00 00 00 00 00 07 0A 09 0B 09 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Ame-no-Uzume
00 01 00 2C 01 2C 00 A6 00 00 00 00 00 4D 00 4B 03 7E 01 00 00 00 00 00 00 00 00 00 00 1A 1E 1F 1B 19 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Ananta
00 01 00 66 00 1B 00 4E 00 00 00 00 00 6E 00 06 01 00 00 00 00 00 00 00 00 00 00 00 00 0F 13 13 15 0E 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Andras
00 01 00 4C 00 09 00 49 00 00 00 00 00 36 00 56 00 2C 01 00 00 00 00 00 00 00 00 00 00 06 09 05 09 05 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Angel
00 01 00 16 00 22 00 66 00 00 00 00 00 33 00 3D 00 3A 00 00 00 00 00 00 00 00 00 00 00 13 18 16 15 17 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Anubis
00 01 00 55 00 19 00 A2 00 00 00 00 00 1F 00 56 01 83 01 00 00 00 00 00 00 00 00 00 00 0E 12 0F 15 0E 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Anzu
00 01 00 65 00 0B 00 B4 00 00 00 00 00 6D 01 7D 01 14 00 00 00 00 00 00 00 00 00 00 00 07 0B 06 0A 06 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Apsaras
00 01 00 99 00 1E 00 A6 00 00 00 00 00 CE 00 4A 00 5C 00 00 00 00 00 00 00 00 00 00 00 14 12 14 14 13 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Ara Mitama
00 01 00 4B 00 23 00 47 00 00 00 00 00 73 01 5F 00 AA 03 00 00 00 00 00 00 00 00 00 00 15 17 16 18 16 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Arahabaki
00 01 00 37 00 0E 00 49 00 00 00 00 00 D3 00 50 00 32 00 00 00 00 00 00 00 00 00 00 00 0B 09 0A 0C 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Archangel
00 01 00 A4 00 54 00 B0 00 00 00 00 00 CB 00 B1 00 45 03 00 00 00 00 00 00 00 00 00 00 36 38 37 36 28 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Ardha
00 01 00 BA 00 1E 00 B8 00 00 00 00 00 C5 02 58 03 CE 00 00 00 00 00 00 00 00 00 00 00 17 13 14 11 12 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Ariadne
00 01 00 C4 00 2A 00 B8 00 00 00 00 00 C5 02 58 03 CE 00 00 00 00 00 00 00 00 00 00 00 24 17 1D 18 15 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Ariadne Picaro
00 01 00 C9 00 01 00 56 00 00 00 00 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 02 02 03 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Arsene
00 01 00 BB 00 38 00 26 00 00 00 00 00 C6 02 0F 00 AC 03 00 00 00 00 00 00 00 00 00 00 2B 2B 20 20 19 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Asterius
00 01 00 C5 00 3E 00 26 00 00 00 00 00 C6 02 0F 00 AC 03 00 00 00 00 00 00 00 00 00 00 2E 2E 24 24 1D 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Asterius Picaro
00 01 00 9E 00 4C 00 A7 00 00 00 00 00 B0 00 35 00 55 01 00 00 00 00 00 00 00 00 00 00 34 30 33 31 23 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Asura
00 01 00 B3 01 41 00 09 00 00 00 00 00 0F 00 14 01 33 01 00 00 00 00 00 00 00 00 00 00 33 24 2B 26 22 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Atavaka
00 01 00 6A 01 2E 00 C3 00 00 00 00 00 CB 02 55 01 DD 00 00 00 00 00 00 00 00 00 00 00 21 1B 1D 1D 1B 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Athena
00 01 00 70 01 32 00 C3 00 00 00 00 00 CB 02 54 01 DD 00 00 00 00 00 00 00 00 00 00 00 23 1E 1F 20 1D 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Athena Picaro
00 01 00 A3 00 27 00 36 00 00 00 00 00 2C 00 7C 01 84 01 00 00 00 00 00 00 00 00 00 00 17 1E 16 1B 16 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Atropos
00 01 00 21 01 52 00 57 00 00 00 00 00 0F 00 3E 01 57 01 00 00 00 00 00 00 00 00 00 00 31 32 30 36 34 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Attis
00 01 00 7A 00 52 00 A2 00 00 00 00 00 8C 00 6E 01 54 01 00 00 00 00 00 00 00 00 00 00 36 3A 35 2F 29 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Baal
00 01 00 88 00 3A 00 4F 00 00 00 00 00 0C 00 2B 03 AC 03 00 00 00 00 00 00 00 00 00 00 22 2A 24 26 1F 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Baphomet
00 01 00 1B 00 34 00 A8 00 00 00 00 00 2A 00 5D 00 44 03 00 00 00 00 00 00 00 00 00 00 21 23 21 25 19 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Barong
00 01 00 02 00 57 00 AB 00 00 00 00 00 45 00 3F 00 55 00 00 00 00 00 00 00 00 00 00 00 37 3D 36 38 2A 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Beelzebub
00 01 00 3E 00 52 00 BB 00 00 00 00 00 42 00 10 01 D6 03 00 00 00 00 00 00 00 00 00 00 34 35 33 30 31 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Belial
00 01 00 8E 00 25 00 2E 00 00 00 00 00 18 00 82 01 00 00 00 00 00 00 00 00 00 00 00 00 19 1B 18 17 13 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Belphegor
00 01 00 8F 00 09 00 BA 00 00 00 00 00 D2 00 50 01 00 00 00 00 00 00 00 00 00 00 00 00 09 06 08 08 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Berith
00 01 00 7F 00 04 00 39 00 00 00 00 00 C8 00 59 01 00 00 00 00 00 00 00 00 00 00 00 00 05 03 03 05 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Bicorn
00 01 00 15 01 43 00 09 00 00 00 00 00 4B 00 2E 01 DE 00 00 00 00 00 00 00 00 00 00 00 33 25 2A 2C 22 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Bishamonten
00 01 00 4A 00 43 00 9E 00 00 00 00 00 19 00 E2 00 CE 00 00 00 00 00 00 00 00 00 00 00 2C 2E 29 2A 23 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Black Frost
00 01 00 7E 00 12 00 46 00 00 00 00 00 04 01 54 00 6E 00 00 00 00 00 00 00 00 00 00 00 0F 07 10 08 0F 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Black Ooze
00 01 00 31 01 3B 00 58 00 00 00 00 00 3F 00 0E 01 45 00 00 00 00 00 00 00 00 00 00 00 24 2A 22 2A 1E 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Black Rider
00 01 00 7D 00 31 00 B2 00 00 00 00 00 CE 00 60 01 C0 00 37 01 00 00 00 00 00 00 00 00 23 21 1E 20 18 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Bugs
00 01 00 AC 01 46 00 9C 00 00 00 00 00 0C 00 6E 00 D9 00 00 00 00 00 00 00 00 00 00 00 2A 31 2B 33 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Byakhee
00 01 00 14 01 2D 00 3E 00 00 00 00 00 F2 00 18 00 21 03 00 00 00 00 00 00 00 00 00 00 23 1C 1E 20 11 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Byakko
00 01 00 B4 01 05 00 4F 00 00 00 00 00 0A 00 D2 00 4F 01 00 00 00 00 00 00 00 00 00 00 06 04 04 05 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Caith Sith
00 01 00 07 00 37 00 9C 00 00 00 00 00 0C 00 CA 00 00 00 00 00 00 00 00 00 00 00 00 00 27 23 20 27 1B 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Cerberus
00 01 00 41 00 3E 00 BA 00 00 00 00 00 3D 00 10 01 FE 00 00 00 00 00 00 00 00 00 00 00 28 25 27 26 27 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Chernobog
00 01 00 4F 00 58 00 A5 00 00 00 00 00 C5 00 86 03 ED 00 00 00 00 00 00 00 00 00 00 00 38 39 36 35 33 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Chi You
00 01 00 B2 01 4A 00 11 00 00 00 00 00 0F 00 EC 00 16 00 00 00 00 00 00 00 00 00 00 00 33 28 2A 30 30 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Chimera
00 01 00 90 00 1C 00 B6 00 00 00 00 00 52 00 67 00 F1 00 00 00 00 00 00 00 00 00 00 00 10 13 13 12 13 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Choronzon
00 01 00 A1 00 1B 00 0E 00 00 00 00 00 34 00 4A 01 56 00 00 00 00 00 00 00 00 00 00 00 0E 13 12 14 11 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Clotho
00 01 00 71 00 32 00 20 01 00 00 00 00 0F 00 19 00 23 00 2D 00 C3 00 4E 00 3A 00 45 00 32 32 32 32 32 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Crystal Skull
00 01 00 03 00 4C 00 B2 00 00 00 00 00 22 03 E2 00 6D 01 00 00 00 00 00 00 00 00 00 00 37 2C 2E 30 2A 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Cu Chulainn
00 01 00 40 00 53 00 4A 00 00 00 00 00 37 01 33 01 3B 00 00 00 00 00 00 00 00 00 00 00 2C 39 31 33 37 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Cybele
00 01 00 1A 01 28 00 B6 00 00 00 00 00 68 00 3A 00 00 00 00 00 00 00 00 00 00 00 00 00 15 21 18 18 19 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Daisoujou
00 01 00 7B 00 32 00 49 00 00 00 00 00 15 01 FE 00 DD 00 00 00 00 00 00 00 00 00 00 00 22 20 22 1C 1D 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Dakini
00 01 00 0C 00 20 00 9C 00 00 00 00 00 0B 00 5E 00 00 00 00 00 00 00 00 00 00 00 00 00 15 17 13 16 12 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Decarabia
00 01 00 64 00 47 00 56 00 00 00 00 00 2D 00 2A 00 61 00 00 00 00 00 00 00 00 00 00 00 2A 30 2C 2A 2C 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Dionysus
00 01 00 48 00 44 00 A8 00 00 00 00 00 57 00 33 00 38 00 00 00 00 00 00 00 00 00 00 00 2A 2D 2B 2C 25 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Dominion
00 01 00 09 00 10 00 4F 00 00 00 00 00 0D 00 57 03 4F 01 00 00 00 00 00 00 00 00 00 00 0C 0A 0D 0A 0A 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Eligor
00 01 00 6F 00 23 00 1E 01 00 00 00 00 0C 00 16 00 20 00 2A 00 C0 00 4B 00 38 00 42 00 23 23 23 23 23 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Emperor's Amulet
00 01 00 AB 01 56 00 61 00 00 00 00 00 ED 00 55 00 B1 00 00 00 00 00 00 00 00 00 00 00 3D 37 3A 30 2B 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Fafnir
00 01 00 42 00 13 00 AD 00 00 00 00 00 D3 00 13 01 64 01 4F 01 00 00 00 00 00 00 00 00 0F 0B 0D 0E 0B 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Flauros
00 01 00 24 00 3F 00 BB 00 00 00 00 00 C0 00 60 01 61 00 00 00 00 00 00 00 00 00 00 00 29 27 28 2A 22 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Forneus
00 01 00 10 01 2E 00 A2 00 00 00 00 00 22 00 56 01 74 01 00 00 00 00 00 00 00 00 00 00 17 20 1D 22 1B 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Fortuna
00 01 00 03 01 56 00 BC 00 00 00 00 00 FE 00 54 01 58 03 00 00 00 00 00 00 00 00 00 00 3C 3A 37 34 28 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Futsunushi
00 01 00 5F 00 17 00 2E 00 00 00 00 00 77 01 4F 01 1F 00 00 00 00 00 00 00 00 00 00 00 0E 11 10 0F 0E 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Fuu-Ki
00 01 00 2D 00 4D 00 06 00 00 00 00 00 2D 00 19 00 00 00 00 00 00 00 00 00 00 00 00 00 2B 33 30 36 2A 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Gabriel
00 01 00 15 00 35 00 AD 00 00 00 00 00 CE 00 FD 00 6D 01 00 00 00 00 00 00 00 00 00 00 27 1F 25 21 1A 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Ganesha
00 01 00 8B 00 34 00 A2 00 00 00 00 00 20 00 0F 01 00 00 00 00 00 00 00 00 00 00 00 00 1E 24 1D 27 1D 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Garuda
00 01 00 13 01 07 00 18 00 00 00 00 00 14 00 5A 01 00 00 00 00 00 00 00 00 00 00 00 00 05 06 07 06 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Genbu
00 01 00 1C 00 2B 00 AA 00 00 00 00 00 3D 00 5F 01 F3 00 00 00 00 00 00 00 00 00 00 00 20 18 20 1D 13 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Girimehkala
00 01 00 36 00 40 00 B2 00 00 00 00 00 FD 00 5E 01 6E 01 00 00 00 00 00 00 00 00 00 00 2B 26 28 28 26 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Hanuman
00 01 00 A7 00 28 00 A0 00 00 00 00 00 29 00 47 01 4B 01 00 00 00 00 00 00 00 00 00 00 15 20 18 17 1B 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Hariti
00 01 00 AD 01 54 00 AF 00 00 00 00 00 8D 00 51 00 5C 01 00 00 00 00 00 00 00 00 00 00 33 3B 34 38 29 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Hastur
00 01 00 A9 00 2A 00 AD 00 00 00 00 00 F2 00 3F 03 4F 01 60 01 00 00 00 00 00 00 00 00 23 16 1B 17 1A 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Hecatoncheires
00 01 00 19 01 25 00 B4 00 00 00 00 00 3D 00 0B 00 4E 03 00 00 00 00 00 00 00 00 00 00 17 18 18 1E 11 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Hell Biker
00 01 00 1A 00 10 00 49 00 00 00 00 00 1E 00 31 01 5A 00 00 00 00 00 00 00 00 00 00 00 08 0E 0A 0D 0A 00 00 00 00 00 00 00 00 00 00 00 00 00 00:High Pixie
00 01 00 70 00 28 00 1F 01 00 00 00 00 49 03 4C 03 4F 03 25 03 3F 03 44 03 22 03 52 03 28 28 28 28 28 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Hope Diamond
00 01 00 1F 01 2F 00 B2 00 00 00 00 00 47 00 2D 01 38 00 00 00 00 00 00 00 00 00 00 00 1E 20 1D 23 16 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Horus
00 01 00 0B 00 09 00 4F 00 00 00 00 00 0A 00 5A 00 00 00 00 00 00 00 00 00 00 00 00 00 04 0A 04 08 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Hua Po
00 01 00 27 00 05 00 B6 00 00 00 00 00 67 00 09 01 00 00 00 00 00 00 00 00 00 00 00 00 04 06 04 05 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Incubus
00 01 00 51 00 0E 00 4E 00 00 00 00 00 52 00 4F 01 D3 00 00 00 00 00 00 00 00 00 00 00 0B 09 09 0C 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Inugami
00 01 00 43 00 0D 00 39 00 00 00 00 00 04 01 4F 01 98 03 00 00 00 00 00 00 00 00 00 00 0B 07 0E 06 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Ippon-Datara
00 01 00 06 01 55 00 0A 00 00 00 00 00 33 01 37 01 73 03 00 00 00 00 00 00 00 00 00 00 30 3B 31 3A 30 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Ishtar
00 01 00 1F 00 1A 00 09 00 00 00 00 00 3A 00 34 00 2D 01 00 00 00 00 00 00 00 00 00 00 0E 14 11 12 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Isis
00 01 00 B7 00 14 00 C0 00 00 00 00 00 C1 02 29 00 4F 01 00 00 00 00 00 00 00 00 00 00 0E 0D 0D 0E 0D 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Izanagi
00 01 00 68 01 50 00 C2 00 00 00 00 00 C9 02 5D 03 3C 03 00 00 00 00 00 00 00 00 00 00 34 38 2E 30 2D 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Izanagi no Okami
00 01 00 6E 01 59 00 C2 00 00 00 00 00 C9 02 5D 03 3C 03 00 00 00 00 00 00 00 00 00 00 36 3D 38 3A 2D 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Izanagi no Okami Picaro
00 01 00 C1 00 17 00 C0 00 00 00 00 00 C1 02 29 00 50 01 00 00 00 00 00 00 00 00 00 00 10 0F 0F 10 0E 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Izanagi Picaro
00 01 00 05 00 0B 00 9E 00 00 00 00 00 14 00 82 01 49 01 17 00 00 00 00 00 00 00 00 00 08 09 07 09 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Jack Frost
00 01 00 04 00 02 00 4F 00 00 00 00 00 0A 00 5A 01 00 00 00 00 00 00 00 00 00 00 00 00 02 03 03 03 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Jack-o'-Lantern
00 01 00 60 00 33 00 A2 00 00 00 00 00 20 00 56 01 51 00 00 00 00 00 00 00 00 00 00 00 1F 22 1D 24 1E 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Jatayu
00 01 00 17 01 16 00 B4 00 00 00 00 00 C9 00 4B 03 5A 01 00 00 00 00 00 00 00 00 00 00 12 0B 10 0F 0D 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Jikokuten
00 01 00 B9 00 10 00 3F 00 00 00 00 00 C4 02 32 01 21 03 00 00 00 00 00 00 00 00 00 00 0B 0F 0C 0B 06 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Kaguya
00 01 00 C3 00 19 00 3F 00 00 00 00 00 C4 02 32 01 22 03 00 00 00 00 00 00 00 00 00 00 11 14 13 0F 0B 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Kaguya Picaro
00 01 00 61 00 24 00 A4 00 00 00 00 00 56 00 BF 00 00 00 00 00 00 00 00 00 00 00 00 00 17 1A 18 16 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Kaiwan
00 01 00 30 00 3F 00 06 00 00 00 00 00 EC 00 10 01 D4 00 00 00 00 00 00 00 00 00 00 00 2B 29 27 27 22 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Kali
00 01 00 62 00 06 00 39 00 00 00 00 00 1E 00 C8 00 00 00 00 00 00 00 00 00 00 00 00 00 05 05 05 06 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Kelpie
00 01 00 4E 00 28 00 0E 00 00 00 00 00 5B 00 55 01 48 01 00 00 00 00 00 00 00 00 00 00 16 1F 18 1C 16 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Kikuri-Hime
00 01 00 1D 00 3D 00 9E 00 00 00 00 00 16 00 82 01 CA 00 00 00 00 00 00 00 00 00 00 00 28 2C 2B 1D 22 00 00 00 00 00 00 00 00 00 00 00 00 00 00:King Frost
00 01 00 5D 00 19 00 3E 00 00 00 00 00 E6 00 50 01 3E 03 00 00 00 00 00 00 00 00 00 00 15 0D 15 0F 0C 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Kin-Ki
00 01 00 82 00 0B 00 49 00 00 00 00 00 1E 00 5A 01 00 00 00 00 00 00 00 00 00 00 00 00 07 0B 08 0A 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Kodama
00 01 00 6D 00 19 00 1C 01 00 00 00 00 2A 03 2C 03 2E 03 30 03 CF 03 CC 03 41 03 42 03 19 19 19 19 19 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Koh-i-Noor
00 01 00 FE 00 4C 00 5F 00 00 00 00 00 C5 00 33 01 C3 00 00 00 00 00 00 00 00 00 00 00 2B 33 32 35 26 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Kohryu
00 01 00 69 00 0B 00 2E 00 00 00 00 00 1E 00 51 01 00 00 00 00 00 00 00 00 00 00 00 00 07 08 08 0B 06 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Koppa Tengu
00 01 00 68 00 09 00 4E 00 00 00 00 00 56 00 14 00 00 00 00 00 00 00 00 00 00 00 00 00 05 08 06 09 06 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Koropokguru
00 01 00 16 01 31 00 AD 00 00 00 00 00 C9 00 3F 03 6E 01 00 00 00 00 00 00 00 00 00 00 25 1D 22 1D 19 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Koumokuten
00 01 00 5B 00 2A 00 46 00 00 00 00 00 22 00 6F 00 10 01 00 00 00 00 00 00 00 00 00 00 19 1E 19 1B 1A 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Kumbhanda
00 01 00 31 00 1F 00 49 00 00 00 00 00 E4 00 60 01 22 00 00 00 00 00 00 00 00 00 00 00 14 13 15 18 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Kurama Tengu
00 01 00 98 00 0C 00 AD 00 00 00 00 00 2C 01 31 01 56 00 00 00 00 00 00 00 00 00 00 00 07 0B 09 08 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Kushi Mitama
00 01 00 5A 00 2A 00 09 00 00 00 00 00 0A 01 8A 01 32 01 00 00 00 00 00 00 00 00 00 00 18 1E 1A 1C 19 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Kushinada
00 01 00 A2 00 23 00 B4 00 00 00 00 00 4B 01 15 00 5F 03 74 01 00 00 00 00 00 00 00 00 12 1A 16 19 15 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Lachesis
00 01 00 0A 01 45 00 B3 00 00 00 00 00 5B 00 2E 01 16 00 00 00 00 00 00 00 00 00 00 00 27 31 29 2F 26 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Lakshmi
00 01 00 20 00 1A 00 4E 00 00 00 00 00 3C 00 50 01 DD 00 00 00 00 00 00 00 00 00 00 00 15 0F 12 13 0C 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Lamia
00 01 00 3F 00 13 00 5E 00 00 00 00 00 5A 01 BF 00 00 00 00 00 00 00 00 00 00 00 00 00 09 11 0C 10 0A 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Leanan Sidhe
00 01 00 21 00 26 00 B6 00 00 00 00 00 10 01 67 00 55 00 00 00 00 00 00 00 00 00 00 00 18 18 1E 17 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Legion
00 01 00 08 00 20 00 18 00 00 00 00 00 15 00 5B 00 AD 03 00 00 00 00 00 00 00 00 00 00 11 17 12 19 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Lilim
00 01 00 29 00 3C 00 36 00 00 00 00 00 19 00 73 01 4B 00 00 00 00 00 00 00 00 00 00 00 21 2B 25 27 23 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Lilith
00 01 00 B1 01 46 00 B6 00 00 00 00 00 3F 00 5F 00 67 00 00 00 00 00 00 00 00 00 00 00 2A 2F 2B 2E 27 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Loa
00 01 00 FD 00 5D 00 1E 00 00 00 00 00 ED 00 82 03 00 00 00 00 00 00 00 00 00 00 00 00 3D 3B 3B 38 33 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Lucifer
00 01 00 C2 00 30 00 62 00 00 00 00 00 C3 02 47 00 71 00 00 00 00 00 00 00 00 00 00 00 28 26 23 1B 0B 00 00 00 00 00 00 00 00 00 00 00 00 00 00:M. Izanagi Picaro
00 01 00 A8 01 49 00 61 00 00 00 00 00 D9 00 55 00 3F 00 00 00 00 00 00 00 00 00 00 00 30 31 2A 30 27 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Macabre
00 01 00 9F 00 5A 00 9D 00 00 00 00 00 78 00 35 03 AC 03 00 00 00 00 00 00 00 00 00 00 37 36 3D 3B 30 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Mada
00 01 00 B8 00 2C 00 62 00 00 00 00 00 C3 02 47 00 71 00 00 00 00 00 00 00 00 00 00 00 25 23 20 19 0A 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Magatsu-Izanagi
00 01 00 2B 00 0F 00 5E 00 00 00 00 00 FA 00 49 00 48 01 00 00 00 00 00 00 00 00 00 00 0D 0C 08 0B 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Makami
00 01 00 79 00 03 00 00 00 00 00 00 00 52 00 48 01 00 00 00 00 00 00 00 00 00 00 00 00 02 03 03 04 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Mandrake
00 01 00 0D 00 49 00 36 00 00 00 00 00 C3 00 E2 00 77 01 00 00 00 00 00 00 00 00 00 00 33 2B 2B 2D 2C 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Mara
00 01 00 4A 01 5D 00 0F 00 00 00 00 00 45 03 3E 01 D6 00 00 00 00 00 00 00 00 00 00 00 34 42 35 36 3D 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Maria
00 01 00 1D 01 11 00 B2 00 00 00 00 00 BE 00 A2 03 51 01 00 00 00 00 00 00 00 00 00 00 0B 0D 0A 10 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Matador
00 01 00 87 00 3A 00 66 00 00 00 00 00 CA 00 33 00 00 00 00 00 00 00 00 00 00 00 00 00 25 20 28 27 21 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Melchizedek
00 01 00 BD 00 51 00 B1 00 00 00 00 00 C8 02 48 00 CB 00 00 00 00 00 00 00 00 00 00 00 32 32 32 32 32 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Messiah
00 01 00 BE 00 5A 00 B1 00 00 00 00 00 C8 02 48 00 F4 00 00 00 00 00 00 00 00 00 00 00 38 38 37 37 37 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Messiah Picaro
00 01 00 01 00 59 00 A9 00 00 00 00 00 35 00 D5 00 3B 00 00 00 00 00 00 00 00 00 00 00 36 3D 3C 39 2A 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Metatron
00 01 00 9D 00 57 00 B2 00 00 00 00 00 A0 00 19 00 5C 01 00 00 00 00 00 00 00 00 00 00 39 36 37 38 2E 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Michael
00 01 00 4D 01 34 00 61 00 00 00 00 00 40 03 61 00 C0 00 00 00 00 00 00 00 00 00 00 00 20 20 20 20 23 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Mishaguji
00 01 00 80 00 27 00 5E 00 00 00 00 00 53 00 4D 00 EC 00 00 00 00 00 00 00 00 00 00 00 13 1A 13 18 12 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Mithras
00 01 00 27 01 21 00 A8 00 00 00 00 00 37 00 34 00 2D 01 00 00 00 00 00 00 00 00 00 00 1B 19 1B 19 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Mitra
00 01 00 23 00 09 00 58 00 00 00 00 00 4F 01 50 00 00 00 00 00 00 00 00 00 00 00 00 00 09 05 06 0A 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Mokoi
00 01 00 8C 00 3C 00 47 00 00 00 00 00 0C 00 6F 00 55 00 00 00 00 00 00 00 00 00 00 00 20 2D 2A 1F 25 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Moloch
00 01 00 17 00 48 00 36 00 00 00 00 00 47 00 54 01 45 00 00 00 00 00 00 00 00 00 00 00 2B 33 30 2A 27 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Mot
00 01 00 A0 00 55 00 17 00 00 00 00 00 19 00 3F 00 8B 03 00 00 00 00 00 00 00 00 00 00 37 36 30 32 37 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Mother Harlot
00 01 00 46 00 21 00 16 00 00 00 00 00 05 01 2C 00 AE 03 00 00 00 00 00 00 00 00 00 00 15 18 10 18 15 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Mothman
00 01 00 8A 00 18 00 39 00 00 00 00 00 FB 00 11 01 29 00 00 00 00 00 00 00 00 00 00 00 0F 11 0F 11 0F 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Naga
00 01 00 1E 00 30 00 AD 00 00 00 00 00 50 00 22 00 48 01 00 00 00 00 00 00 00 00 00 00 1B 1F 1D 21 1F 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Narcissus
00 01 00 52 00 4A 00 A4 00 00 00 00 00 60 00 C3 00 55 01 00 00 00 00 00 00 00 00 00 00 2D 34 2C 2E 2A 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Nebiros
00 01 00 2A 01 1E 00 56 00 00 00 00 00 BF 00 2D 01 56 01 64 01 00 00 00 00 00 00 00 00 13 14 13 15 12 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Neko Shogun
00 01 00 49 00 11 00 4E 00 00 00 00 00 21 00 06 01 54 00 00 00 00 00 00 00 00 00 00 00 0D 0A 0C 0F 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Nekomata
00 01 00 97 00 16 00 0E 00 00 00 00 00 49 01 2D 01 39 00 00 00 00 00 00 00 00 00 00 00 0D 0F 0F 10 0E 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Nigi Mitama
00 01 00 8D 00 34 00 2E 00 00 00 00 00 2A 00 20 00 51 00 00 00 00 00 00 00 00 00 00 00 1E 26 21 22 1C 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Norn
00 01 00 85 00 14 00 36 00 00 00 00 00 43 00 05 01 00 00 00 00 00 00 00 00 00 00 00 00 10 0A 11 0E 0A 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Nue
00 01 00 38 00 08 00 39 00 00 00 00 00 E0 00 5B 01 00 00 00 00 00 00 00 00 00 00 00 00 07 03 09 08 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Obariyon
00 01 00 32 00 42 00 16 00 00 00 00 00 2A 00 51 00 EC 00 00 00 00 00 00 00 00 00 00 00 28 2D 2A 2B 23 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Oberon
00 01 00 0A 00 54 00 A1 00 00 00 00 00 96 00 FE 00 55 01 00 00 00 00 00 00 00 00 00 00 35 3A 36 34 2A 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Odin
00 01 00 FF 00 36 00 A4 00 00 00 00 00 C2 00 FE 00 54 01 00 00 00 00 00 00 00 00 00 00 27 23 21 20 1E 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Okuninushi
00 01 00 5C 00 59 00 AE 00 00 00 00 00 FE 00 57 00 B2 03 00 00 00 00 00 00 00 00 00 00 38 35 39 3B 31 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Ongyo-Ki
00 01 00 28 00 14 00 3E 00 00 00 00 00 F1 00 20 03 E0 00 00 00 00 00 00 00 00 00 00 00 13 09 11 0C 0A 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Oni
00 01 00 84 00 0C 00 2E 00 00 00 00 00 40 00 7D 01 00 00 00 00 00 00 00 00 00 00 00 00 09 0C 07 0A 05 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Onmoraki
00 01 00 72 00 3C 00 21 01 00 00 00 00 78 00 82 00 8C 00 96 00 C5 00 B0 00 A0 00 AA 00 3C 3C 3C 3C 3C 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Orichalcum
00 01 00 6E 00 1E 00 1D 01 00 00 00 00 0E 00 18 00 22 00 2C 00 C2 00 4D 00 3A 00 44 00 1E 1E 1E 1E 1E 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Orlov
00 01 00 35 00 11 00 36 00 00 00 00 00 0D 00 51 01 64 01 00 00 00 00 00 00 00 00 00 00 0B 0E 0F 0C 06 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Orobas
00 01 00 B5 00 1A 00 BE 00 00 00 00 00 C0 02 0B 00 59 01 00 00 00 00 00 00 00 00 00 00 11 11 11 11 11 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Orpheus
00 01 00 6D 01 0B 00 BE 00 00 00 00 00 CA 02 0A 00 59 01 25 03 00 00 00 00 00 00 00 00 08 09 08 09 06 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Orpheus (F)
00 01 00 73 01 0D 00 BE 00 00 00 00 00 CA 02 0D 00 5A 01 25 03 00 00 00 00 00 00 00 00 09 0B 09 0A 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Orpheus (F) Picaro
00 01 00 BF 00 1D 00 BE 00 00 00 00 00 C0 02 0E 00 5E 01 00 00 00 00 00 00 00 00 00 00 13 13 13 13 13 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Orpheus Picaro
00 01 00 44 00 15 00 4F 00 00 00 00 00 0B 00 FA 00 0D 00 00 00 00 00 00 00 00 00 00 00 10 0E 0E 13 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Orthrus
00 01 00 0E 00 2A 00 3E 00 00 00 00 00 14 01 21 03 68 01 00 00 00 00 00 00 00 00 00 00 20 18 19 1F 15 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Ose
00 01 00 1E 01 36 00 11 00 00 00 00 00 5F 00 42 00 0C 01 00 00 00 00 00 00 00 00 00 00 20 25 21 28 1B 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Pale Rider
00 01 00 2C 00 38 00 5E 00 00 00 00 00 2D 01 C0 00 8C 01 00 00 00 00 00 00 00 00 00 00 21 27 21 27 1F 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Parvati
00 01 00 34 01 2D 00 AA 00 00 00 00 00 44 00 53 00 3D 00 00 00 00 00 00 00 00 00 00 00 1D 21 1B 1A 1B 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Pazuzu
00 01 00 28 01 15 00 A6 00 00 00 00 00 4A 00 09 01 20 03 00 00 00 00 00 00 00 00 00 00 0C 0F 0F 11 0B 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Phoenix
00 01 00 86 00 1C 00 46 00 00 00 00 00 09 01 F1 00 6F 00 00 00 00 00 00 00 00 00 00 00 13 15 15 10 0E 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Pisaca
00 01 00 06 00 02 00 16 00 00 00 00 00 28 00 2C 01 00 00 00 00 00 00 00 00 00 00 00 00 01 03 03 04 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Pixie
00 01 00 50 00 29 00 B4 00 00 00 00 00 33 00 0C 01 00 00 00 00 00 00 00 00 00 00 00 00 1E 1A 1C 19 15 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Power
00 01 00 29 01 1D 00 A8 00 00 00 00 00 3A 00 57 00 00 00 00 00 00 00 00 00 00 00 00 00 11 13 12 15 13 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Principality
00 01 00 39 00 2B 00 16 00 00 00 00 00 2C 00 57 00 AC 03 00 00 00 00 00 00 00 00 00 00 17 23 1A 1E 16 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Queen Mab
00 01 00 6B 00 0F 00 1A 01 00 00 00 00 4F 01 50 01 51 01 36 01 31 01 59 01 5A 01 5B 01 0F 0F 0F 0F 0F 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Queen's Necklace
00 01 00 2F 01 42 00 A2 00 00 00 00 00 22 00 20 00 11 01 00 00 00 00 00 00 00 00 00 00 29 2E 29 2B 22 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Quetzalcoatl
00 01 00 89 00 37 00 A0 00 00 00 00 00 2A 00 84 01 53 00 00 00 00 00 00 00 00 00 00 00 21 25 24 23 1F 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Raja Naga
00 01 00 22 00 18 00 49 00 00 00 00 00 D3 00 7F 01 4F 01 00 00 00 00 00 00 00 00 00 00 14 0F 12 11 09 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Rakshasa
00 01 00 2A 00 30 00 AA 00 00 00 00 00 F2 00 10 01 21 03 00 00 00 00 00 00 00 00 00 00 1C 22 1E 21 1A 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Rangda
00 01 00 6B 01 4C 00 C1 00 00 00 00 00 CC 02 42 00 59 03 00 00 00 00 00 00 00 00 00 00 2F 30 2B 36 2A 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Raoul
00 01 00 18 00 4E 00 56 00 00 00 00 00 D5 00 68 01 64 01 00 00 00 00 00 00 00 00 00 00 39 2D 31 37 23 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Raphael
00 01 00 30 01 29 00 61 00 00 00 00 00 DD 00 8C 01 C2 00 00 00 00 00 00 00 00 00 00 00 1A 1B 19 1D 17 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Red Rider
00 01 00 6A 00 0A 00 19 01 00 00 00 00 0D 00 17 00 21 00 2B 00 C1 00 4C 00 39 00 43 00 0A 0A 0A 0A 0A 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Regent
00 01 00 9A 00 06 00 B4 00 00 00 00 00 14 00 48 01 7F 01 00 00 00 00 00 00 00 00 00 00 04 06 05 06 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Saki Mitama
00 01 00 3A 00 4B 00 67 00 00 00 00 00 35 00 37 01 3C 01 00 00 00 00 00 00 00 00 00 00 2E 33 31 30 26 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Sandalphon
00 01 00 3D 00 17 00 4E 00 00 00 00 00 5A 00 1F 00 13 01 00 00 00 00 00 00 00 00 00 00 0B 0D 0E 11 15 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Sandman
00 01 00 12 00 32 00 0E 00 00 00 00 00 32 01 7D 01 53 00 00 00 00 00 00 00 00 00 00 00 1E 23 20 21 1B 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Sarasvati
00 01 00 FC 00 5C 00 9F 00 00 00 00 00 82 00 83 00 40 03 00 00 00 00 00 00 00 00 00 00 3E 3B 37 34 37 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Satan
00 01 00 AA 00 5F 00 41 00 00 00 00 00 45 00 48 00 29 03 E3 00 00 00 00 00 00 00 00 00 3F 3C 39 38 38 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Satanael
00 01 00 19 00 4D 00 5E 00 00 00 00 00 19 00 FE 00 73 01 00 00 00 00 00 00 00 00 00 00 30 34 2E 30 2C 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Scathach
00 01 00 12 01 3E 00 06 00 00 00 00 00 16 00 2E 01 55 01 00 00 00 00 00 00 00 00 00 00 26 29 2B 25 22 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Seiryu
00 01 00 25 00 19 00 3E 00 00 00 00 00 D3 00 13 01 20 03 50 01 00 00 00 00 00 00 00 00 13 10 12 0D 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Setanta
00 01 00 05 01 33 00 B2 00 00 00 00 00 E2 00 0C 00 56 01 22 03 00 00 00 00 00 00 00 00 20 23 1E 23 1C 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Seth
00 01 00 3C 00 0F 00 A6 00 00 00 00 00 FA 00 05 01 49 00 00 00 00 00 00 00 00 00 00 00 0A 0B 0B 0B 09 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Shiisaa
00 01 00 33 00 12 00 A4 00 00 00 00 00 4F 01 5C 00 E4 00 00 00 00 00 00 00 00 00 00 00 10 0E 0C 09 0A 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Shiki-Ouji
00 01 00 9C 00 52 00 A4 00 00 00 00 00 C5 00 2D 00 26 03 00 00 00 00 00 00 00 00 00 00 37 36 35 35 26 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Shiva
00 01 00 B5 01 54 00 3E 00 00 00 00 00 D4 00 56 01 22 03 00 00 00 00 00 00 00 00 00 00 3D 2B 37 37 2D 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Siegfried
00 01 00 7C 00 06 00 2E 00 00 00 00 00 5A 00 14 00 00 00 00 00 00 00 00 00 00 00 00 00 04 07 04 05 05 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Silky
00 01 00 4D 00 35 00 BB 00 00 00 00 00 DE 00 55 00 90 03 00 00 00 00 00 00 00 00 00 00 21 27 20 22 1C 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Skadi
00 01 00 54 00 0A 00 46 00 00 00 00 00 C8 00 54 00 00 00 00 00 00 00 00 00 00 00 00 00 09 06 0B 06 05 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Slime
00 01 00 24 01 50 00 A8 00 00 00 00 00 38 00 35 00 8A 03 00 00 00 00 00 00 00 00 00 00 2F 38 2D 38 2B 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Sraosha
00 01 00 6C 00 14 00 1B 01 00 00 00 00 0B 00 15 00 1F 00 29 00 BF 00 4A 00 37 00 41 00 14 14 14 14 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Stone of Scone
00 01 00 45 00 07 00 4E 00 00 00 00 00 5A 00 6D 01 00 00 00 00 00 00 00 00 00 00 00 00 04 07 05 08 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Succubus
00 01 00 81 00 11 00 58 00 00 00 00 00 C1 00 CD 00 4F 01 00 00 00 00 00 00 00 00 00 00 09 0E 0C 0D 0A 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Sudama
00 01 00 5E 00 18 00 9E 00 00 00 00 00 17 00 04 01 15 00 00 00 00 00 00 00 00 00 00 00 10 0F 0F 12 0F 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Sui-Ki
00 01 00 B0 01 53 00 9C 00 00 00 00 00 79 00 48 03 D4 00 00 00 00 00 00 00 00 00 00 00 37 36 33 32 2E 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Surt
00 01 00 11 01 10 00 AD 00 00 00 00 00 49 00 59 01 60 00 00 00 00 00 00 00 00 00 00 00 09 0C 0A 0F 09 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Suzaku
00 01 00 58 00 1A 00 A0 00 00 00 00 00 29 00 C9 00 4B 03 00 00 00 00 00 00 00 00 00 00 11 13 12 10 0F 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Take-Minakata
00 01 00 AE 01 1B 00 AD 00 00 00 00 00 C9 00 0C 01 6D 01 00 00 00 00 00 00 00 00 00 00 15 10 12 10 11 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Tam Lin
00 01 00 B6 00 41 00 B9 00 00 00 00 00 C2 02 45 00 3F 00 00 00 00 00 00 00 00 00 00 00 2B 31 29 26 1F 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Thanatos
00 01 00 C0 00 45 00 B9 00 00 00 00 00 C2 02 45 00 3F 00 00 00 00 00 00 00 00 00 00 00 2D 33 2B 28 23 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Thanatos Picaro
00 01 00 0F 00 40 00 2E 00 00 00 00 00 2A 00 CA 00 22 03 00 00 00 00 00 00 00 00 00 00 2C 27 2B 26 23 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Thor
00 01 00 63 00 24 00 5E 00 00 00 00 00 5C 00 4A 00 60 01 00 00 00 00 00 00 00 00 00 00 15 1C 15 18 15 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Thoth
00 01 00 AF 01 48 00 BA 00 00 00 00 00 0C 00 33 00 AC 03 00 00 00 00 00 00 00 00 00 00 2A 31 2B 2E 2B 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Throne
00 01 00 AA 01 22 00 A0 00 00 00 00 00 2C 00 4F 01 AE 03 00 00 00 00 00 00 00 00 00 00 11 18 18 1A 12 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Thunderbird
00 01 00 26 00 38 00 11 00 00 00 00 00 4B 00 2A 00 5B 00 00 00 00 00 00 00 00 00 00 00 20 28 23 26 1E 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Titania
00 01 00 1B 01 3B 00 06 00 00 00 00 00 4E 00 5F 00 16 01 00 00 00 00 00 00 00 00 00 00 21 2A 28 26 1F 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Trumpeter
00 01 00 BC 00 32 00 BF 00 00 00 00 00 C7 02 82 03 FE 00 67 00 00 00 00 00 00 00 00 00 26 20 21 25 11 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Tsukiyomi
00 01 00 C6 00 37 00 BF 00 00 00 00 00 C7 02 82 03 FE 00 68 00 00 00 00 00 00 00 00 00 29 23 24 28 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Tsukiyomi Picaro
00 01 00 10 00 27 00 A8 00 00 00 00 00 C9 00 34 00 63 01 00 00 00 00 00 00 00 00 00 00 14 1B 19 1C 18 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Unicorn
00 01 00 11 00 51 00 AF 00 00 00 00 00 F3 00 FE 00 10 01 00 00 00 00 00 00 00 00 00 00 32 36 31 37 2A 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Uriel
00 01 00 13 00 2C 00 49 00 00 00 00 00 DD 00 21 03 00 00 00 00 00 00 00 00 00 00 00 00 21 18 1C 1D 19 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Valkyrie
00 01 00 2B 01 44 00 11 00 00 00 00 00 35 00 61 00 E1 00 00 00 00 00 00 00 00 00 00 00 2A 2D 2C 2A 26 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Vasuki
00 01 00 A6 00 53 00 A3 00 00 00 00 00 48 00 23 00 59 03 00 00 00 00 00 00 00 00 00 00 38 33 31 39 2B 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Vishnu
00 01 00 4B 01 50 00 B5 00 00 00 00 00 A0 00 D3 03 3B 00 00 00 00 00 00 00 00 00 00 00 2E 3B 2D 38 29 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Vohu Manah
00 01 00 1C 01 26 00 BB 00 00 00 00 00 E1 00 54 00 14 01 00 00 00 00 00 00 00 00 00 00 16 15 1A 1B 19 00 00 00 00 00 00 00 00 00 00 00 00 00 00:White Rider
00 01 00 14 00 14 00 4E 00 00 00 00 00 0A 01 5D 00 20 03 00 00 00 00 00 00 00 00 00 00 0E 0B 0D 10 0D 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Yaksini
00 01 00 34 00 40 00 18 00 00 00 00 00 E2 00 19 00 AD 03 00 00 00 00 00 00 00 00 00 00 2C 26 30 24 21 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Yamata-no-Orochi
00 01 00 56 00 39 00 B2 00 00 00 00 00 78 01 63 01 00 00 00 00 00 00 00 00 00 00 00 00 23 29 1E 28 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Yatagarasu
00 01 00 57 00 57 00 3E 00 00 00 00 00 D4 00 68 01 2A 00 00 00 00 00 00 00 00 00 00 00 3F 34 32 36 31 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Yoshitsune
00 01 00 A8 00 2B 00 AF 00 00 00 00 00 61 00 2C 00 47 00 00 00 00 00 00 00 00 00 00 00 1A 1D 1E 1B 18 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Yurlungur
00 01 00 2E 00 50 00 3A 00 00 00 00 00 0F 00 5F 00 CB 00 00 00 00 00 00 00 00 00 00 00 39 2D 32 38 27 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Zaou-Gongen
00 01 00 18 01 1F 00 A0 00 00 00 00 00 CF 00 29 00 00 00 00 00 00 00 00 00 00 00 00 00 16 13 18 12 11 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Zouchouten | Ruimusume/P5R | pr.java |
1,439 | import java.util.*;
class Account{
float balance;
}
class SavingsAccount extends Account
{
float interest;
SavingsAccount(float f)
{
interest =f;
}
public float addinterst(float b)
{
balance= b + (b*(interest/100));
return balance;
}
}
class CurrentAccount extends Account
{
float interest;
CurrentAccount(float f)
{
interest =f;
}
public float addinterst(float b)
{
balance= b + (b*(interest/100));
return balance;
}
}
public class Main{
public static void main(String[] args)
{
Scanner sc = new Scanner (System.in);
System.out.println("Enter the balance in your account");
float f = sc.nextFloat();
System.out.println("Enter the interest you recieve in %");
float i =sc.nextFloat();
SavingsAccount ob = new SavingsAccount(i);
CurrentAccount ob1 = new CurrentAccount(i);
float b = ob.addinterst(f);
System.out.println("New balance in Savings Account is "+b);
b= ob1.addinterst(f);
System.out.println("New balance in Current Account is "+b);
}
} | Welding-Torch/Java-Prac | 3.java |
1,442 | class a
{
public static void main(String[] args)
{
System.out.println("how are you");
}
} | coderaudi/java-developer | a.java |
1,447 | // 73. Set Matrix Zeroes
// Given an m x n matrix. If an element is 0, set its entire row and column to 0. Do it in-place.
//
// Follow up:
//
// A straight forward solution using O(mn) space is probably a bad idea.
// A simple improvement uses O(m + n) space, but still not the best solution.
// Could you devise a constant space solution?
//
//
// Example 1:
//
//
// Input: matrix = [[1,1,1],[1,0,1],[1,1,1]]
// Output: [[1,0,1],[0,0,0],[1,0,1]]
// Example 2:
//
//
// Input: matrix = [[0,1,2,0],[3,4,5,2],[1,3,1,5]]
// Output: [[0,0,0,0],[0,4,5,0],[0,3,1,0]]
//
//
// Constraints:
//
// m == matrix.length
// n == matrix[0].length
// 1 <= m, n <= 200
// -2^31 <= matrix[i][j] <= 2^31 - 1
//
// Runtime: 1 ms, faster than 92.39% of Java online submissions for Set Matrix Zeroes.
// Memory Usage: 40.5 MB, less than 49.63% of Java online submissions for Set Matrix Zeroes.
class Solution {
public void setZeroes(int[][] matrix) {
Set<Integer> rowToChange = new HashSet<>();
Set<Integer> colToChange = new HashSet<>();
int rowCount = matrix.length;
int colCount = matrix[0].length;
for (int i = 0; i < rowCount; i++) {
for (int j = 0; j <colCount; j++) {
if (matrix[i][j] == 0) {
rowToChange.add(i);
colToChange.add(j);
}
}
}
Iterator rows = rowToChange.iterator();
while(rows.hasNext()) {
int row = (int) rows.next();
for (int i = 0; i < colCount; i++) {
matrix[row][i] = 0;
}
}
Iterator cols = colToChange.iterator();
while(cols.hasNext()) {
int col = (int) cols.next();
for (int i = 0; i < rowCount; i++) {
matrix[i][col] = 0;
}
}
}
} | ishuen/leetcode | 73.java |