blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 332 | content_id stringlengths 40 40 | detected_licenses listlengths 0 50 | license_type stringclasses 2 values | repo_name stringlengths 7 115 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 557 values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 77.7k | fork_events_count int64 0 48k | gha_license_id stringclasses 17 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 82 values | src_encoding stringclasses 28 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 7 5.41M | extension stringclasses 11 values | content stringlengths 7 5.41M | authors listlengths 1 1 | author stringlengths 0 161 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bd6986953142908e5f5732b496e6f1131e70f141 | 3537dcd40e6277237bcb36cf3fc9232a2d2dca99 | /src/main/java/br/com/libercode/core/entity/lazyList/GenericLazyListDataScrollerCDI.java | d2637fa283273c1b537e7e649574edbdbd6035f1 | [] | no_license | victorcarvalhosp/jsf-tomcat-starter | bfde8a34e9a25ffedc5f700045440767de5bf9a8 | 4a06b197b096d7ebd842a5e0fe34f3ec9223c87f | refs/heads/master | 2020-03-23T03:00:03.799340 | 2018-07-15T19:44:51 | 2018-07-15T19:44:51 | 141,003,710 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,386 | java | package br.com.libercode.core.entity.lazyList;
import br.com.libercode.core.bo.AbstractCrudBO;
import org.primefaces.model.LazyDataModel;
import org.primefaces.model.SelectableDataModel;
import org.primefaces.model.SortOrder;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
public class GenericLazyListDataScrollerCDI<T> extends LazyDataModel<T> implements SelectableDataModel<T>, Serializable {
protected List<T> lista;
protected T pesquisa;
protected AbstractCrudBO<T> bo;
protected Class<T> clazz;
private int rowIndex;
private static final long serialVersionUID = 1L;
public GenericLazyListDataScrollerCDI(Class<T> clazz, AbstractCrudBO<T> bo, T pesquisa) {
this.pesquisa = pesquisa;
this.clazz = clazz;
this.bo = bo;
this.lista = new ArrayList<>();
}
@Override
public List<T> load(int posicaoPrimeiraLinha, int maximoPorPagina, String ordenarPeloCampo,
SortOrder ordernarAscOuDesc, Map<String, Object> filters) {
if (getRowCount() <= 0) {
setRowCount(bo.total(pesquisa));
posicaoPrimeiraLinha = 0;
}
if (ordenarPeloCampo == null) {
ordenarPeloCampo = "tab.registro";
}
String ordenacao = ordenarASCouDESC(ordernarAscOuDesc);
List<T> retData;
if (posicaoPrimeiraLinha >= lista.size()) {
retData = bo.buscar(pesquisa, posicaoPrimeiraLinha, maximoPorPagina,ordenarPeloCampo, ordenacao);
lista.addAll(retData);
return retData;
} else {
return lista.subList(posicaoPrimeiraLinha, Math.min(posicaoPrimeiraLinha + maximoPorPagina, lista.size()));
}
}
@Override
public void setRowIndex(int index) {
if (index >= lista.size()) {
index = -1;
}
this.rowIndex = index;
}
@Override
public T getRowData() {
return lista.get(rowIndex);
}
@Override
public boolean isRowAvailable() {
if (lista == null) {
return false;
}
return rowIndex >= 0 && rowIndex < lista.size();
}
public String ordenarASCouDESC(SortOrder ordernarAscOuDesc) {
if (SortOrder.UNSORTED.equals(ordernarAscOuDesc)
|| SortOrder.DESCENDING.equals(ordernarAscOuDesc)) {
return "DESC";
} else {
return "ASC";
}
}
public List<T> getLista() {
return lista;
}
}
| [
"victorcarvalhosp@gmail.com"
] | victorcarvalhosp@gmail.com |
c3030f8dd8e12a557275c588130b327051762c2e | b9cfb1e79a1dfc4ea86f0317473039246cc53a80 | /src/main/java/de/flapdoodle/embed/process/io/directories/PropertyOrPlatformTempDir.java | cf7dba4808860dc26568633fa8543abc7814db18 | [] | no_license | wix-playground/de.flapdoodle.embed.process | 25231e00357d43003243868dea9a61d9c296b6fe | 5937d37df007289394122297dd29b7373d676edb | refs/heads/master | 2023-03-31T04:38:58.351631 | 2014-10-05T08:57:59 | 2014-10-05T08:57:59 | 24,388,123 | 0 | 2 | null | 2023-03-19T13:04:58 | 2014-09-23T20:28:11 | Java | UTF-8 | Java | false | false | 1,281 | java | /**
* Copyright (C) 2011
* Michael Mosmann <michael@mosmann.de>
* Martin Jöhren <m.joehren@googlemail.com>
*
* with contributions from
* konstantin-ba@github,Archimedes Trajano (trajano@github)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package de.flapdoodle.embed.process.io.directories;
import java.io.File;
public class PropertyOrPlatformTempDir extends PlatformTempDir {
private static PropertyOrPlatformTempDir _instance=new PropertyOrPlatformTempDir();
@Override
public File asFile() {
String customTempDir = System.getProperty("de.flapdoodle.embed.io.tmpdir");
if (customTempDir!=null) {
return new File(customTempDir);
}
return super.asFile();
}
public static IDirectory defaultInstance() {
return _instance;
}
}
| [
"michael@mosmann.de"
] | michael@mosmann.de |
c58ca0038ecf4501983a3e7a3a9a355d828eb271 | 4d863402e6cb289b0c1c2ad655ef821037cdca67 | /com/company/CititorService.java | 0ca35d298a3efa8447f47629c23d14aec93dc815 | [] | no_license | Arsene-Marinel/Java | d84d24780640837f322fa1917e4aed5875961f21 | 08954921b656c3b76c198b46fd34ffa9f28153c1 | refs/heads/main | 2023-05-12T15:47:45.854094 | 2021-06-03T12:53:53 | 2021-06-03T12:53:53 | 353,190,434 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,767 | java | package com.company;
import com.company.Exceptions.WriteFileException;
import java.util.*;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.sql.Timestamp;
public class CititorService {
Scanner scanner = new Scanner(System.in);
static private List<Cititor> cititori = new ArrayList<>();
public static List<Cititor> getCititori() {
return cititori;
}
public static void setCititori(List<Cititor> cititori) { CititorService.cititori = cititori; }
public void adaugaCititor() throws WriteFileException {
System.out.println("Nume: ");
String nume = scanner.nextLine();
System.out.println("Prenume: ");
String prenume = scanner.nextLine();
System.out.println("Cod identificare: ");
int codIdentificare = scanner.nextInt();
System.out.println("Valabilitate permis: ");
int valabilitatePermis = scanner.nextInt();
System.out.println("Varsta: ");
int varsta = scanner.nextInt();
Cititor c = new Cititor(nume, prenume, codIdentificare, valabilitatePermis, varsta);
cititori.add(c);
System.out.println("Cititor adaugat");
AngajatService.audit("newReader");
}
public static void audit(String action) throws WriteFileException {
try (BufferedWriter buffer = new BufferedWriter(new FileWriter("src/com/company/Files/audit.txt", true))) {
Timestamp timestamp = new Timestamp(System.currentTimeMillis());
String text = action + ", " + timestamp + '\n';
buffer.write(text);
} catch (IOException e) {
throw new WriteFileException("Ceva nu a mers bine in metoda writeUsingBufferedWriter", e);
}
}
}
| [
"marinel.arsene@my.fmi.unibuc.ro"
] | marinel.arsene@my.fmi.unibuc.ro |
f464a33cc51118b95f2524feee50d86bd486a9bf | e94104a80db9fc14249f823491576dfb929f508f | /myspringmvc/src/main/java/cn/com/myspringmvc/aop/WebTraceHandlerInterceptor.java | b3b8dd68f7a95319a16cc21a8e25dc6dc42663d4 | [] | no_license | shenjianxin/mydemo-parent | 3da680f2a2cc4edef10b4096992c8e611af1a8b8 | 58f1785dc7c2e6b03337e3d1e3549c36cb68a66b | refs/heads/master | 2022-12-21T14:49:23.978046 | 2020-11-19T10:51:35 | 2020-11-19T10:51:35 | 129,496,711 | 0 | 0 | null | 2022-12-16T03:37:31 | 2018-04-14T08:15:52 | Java | UTF-8 | Java | false | false | 831 | java | package cn.com.myspringmvc.aop;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* Author: shenjx
* Date: 2018/4/16 17:10
* Description:
*/
public class WebTraceHandlerInterceptor extends HandlerInterceptorAdapter {
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
LogUtil.getLog();
return super.preHandle(request, response, handler);
}
@Override
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
LogUtil.getLog();
super.afterCompletion(request, response, handler, ex);
}
}
| [
"shen0206"
] | shen0206 |
b435669dba4469bb507d890fa5d5890a3b0b4c8c | 5b941964d6d8ac0d232d675ff53cb988e05d68f5 | /src/test/java/com/martinez/lisandro/solar/aligners/CollinearAlignerTest.java | 9ec5bf1b11672046cba7d5d8db0000647ae583a3 | [
"MIT"
] | permissive | lisomartinez/ejercicioJavaConGradle | 25094557a6d2284cf7871054a5330e871916dea8 | fc65717b05c37842b54b063b76509ddb4c7b9e98 | refs/heads/master | 2021-10-16T00:40:08.544685 | 2019-02-07T15:12:01 | 2019-02-07T15:12:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,587 | java | package com.martinez.lisandro.solar.aligners;
import com.martinez.lisandro.solar.Planet;
import com.martinez.lisandro.solar.rotators.ClockWiseRotationStrategy;
import com.martinez.lisandro.solar.rotators.CounterClockWiseRotationStrategy;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import java.util.stream.Stream;
import static org.assertj.core.api.Assertions.assertThat;
class CollinearAlignerTest {
private CollinearAligner al;
static Stream<Arguments> colinearPlanetsTrue() {
return Stream.of(
Arguments.of(new int[]{0, 0, 0}, true),
Arguments.of(new int[]{0, 0, 360}, true),
Arguments.of(new int[]{0, 360, 360}, true),
Arguments.of(new int[]{360, 0, 360}, true),
Arguments.of(new int[]{360, 360, 0}, true),
Arguments.of(new int[]{360, 360, 360}, true),
Arguments.of(new int[]{45, 45, 45}, true),
Arguments.of(new int[]{45, 45, 225}, true),
Arguments.of(new int[]{45, 225, 225}, true),
Arguments.of(new int[]{225, 45, 225}, true),
Arguments.of(new int[]{225, 225, 45}, true),
Arguments.of(new int[]{225, 225, 225}, true),
Arguments.of(new int[]{90, 90, 90}, true),
Arguments.of(new int[]{90, 90, 270}, true),
Arguments.of(new int[]{90, 270, 270}, true),
Arguments.of(new int[]{270, 90, 270}, true),
Arguments.of(new int[]{270, 270, 90}, true),
Arguments.of(new int[]{270, 270, 270}, true),
Arguments.of(new int[]{135, 135, 135}, true),
Arguments.of(new int[]{135, 135, 315}, true),
Arguments.of(new int[]{135, 315, 315}, true),
Arguments.of(new int[]{315, 135, 315}, true),
Arguments.of(new int[]{315, 315, 135}, true),
Arguments.of(new int[]{315, 315, 315}, true),
Arguments.of(new int[]{180, 180, 180}, true),
Arguments.of(new int[]{180, 180, 360}, true),
Arguments.of(new int[]{180, 360, 360}, true),
Arguments.of(new int[]{360, 180, 180}, true),
Arguments.of(new int[]{360, 360, 180}, true),
Arguments.of(new int[]{360, 360, 360}, true)
);
}
static Stream<Arguments> colinearPlanetsFalse() {
return Stream.of(
Arguments.of(new int[]{2, 6, 10}, false),
Arguments.of(new int[]{4, 12, 20}, false),
Arguments.of(new int[]{8, 24, 40}, false),
Arguments.of(new int[]{12, 48, 80}, false),
Arguments.of(new int[]{1, 1, 1}, false),
Arguments.of(new int[]{2, 2, 2}, false),
Arguments.of(new int[]{10, 10, 10}, false),
Arguments.of(new int[]{315, 225, 225}, false),
Arguments.of(new int[]{315, 45, 45}, false)
);
}
@BeforeEach
void setUp() {
Coordinate sun = new Coordinate(0, 0);
al = new CollinearAligner(sun);
}
@ParameterizedTest
@MethodSource("colinearPlanetsTrue")
void collinearTrue(int[] positions, boolean expected) {
Planet alpha = new Planet(1, positions[0], 500, new ClockWiseRotationStrategy());
Planet beta = new Planet(3, positions[1], 2000, new ClockWiseRotationStrategy());
Planet gamma = new Planet(5, positions[2], 1000, new CounterClockWiseRotationStrategy());
al.addToLine(alpha);
al.addToLine(beta);
al.addToLine(gamma);
boolean result = al.arePlanetsAligned();
assertThat(result).isEqualTo(expected);
}
@ParameterizedTest
@MethodSource("colinearPlanetsFalse")
void collinearFalse(int[] positions, boolean expected) {
Planet alpha = new Planet(1, positions[0], 500, new ClockWiseRotationStrategy());
Planet beta = new Planet(3, positions[1], 2000, new ClockWiseRotationStrategy());
Planet gamma = new Planet(5, positions[2], 1000, new CounterClockWiseRotationStrategy());
al.addToLine(alpha);
al.addToLine(beta);
al.addToLine(gamma);
boolean result = al.arePlanetsAligned();
assertThat(result).isEqualTo(expected);
}
@AfterEach
void tearDown() {
al.clearLine();
}
} | [
"lisandromartinez@gmail.com"
] | lisandromartinez@gmail.com |
03d2cd2d9b0806df3ea92d0ada28d7fb8779d693 | 1d2e6389bb6029750de79ff03226f2f229314820 | /src/main/java/corecs/demo/StdOut.java | a8323b610ebf8abe4eb8a025c89a124a5fe388e2 | [] | no_license | sinhasonalkumar/corecs | fe92dce6b760c945c00aad24f10527f434291acd | 50097de5461219ac12bf55dc70dba30ea10bceb3 | refs/heads/master | 2022-11-21T09:24:23.450956 | 2020-07-25T03:12:07 | 2020-07-25T03:12:07 | 275,469,155 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,396 | java | package corecs.demo;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.util.Locale;
public final class StdOut {
// force Unicode UTF-8 encoding; otherwise it's system dependent
private static final String CHARSET_NAME = "UTF-8";
// assume language = English, country = US for consistency with StdIn
private static final Locale LOCALE = Locale.US;
// send output here
private static PrintWriter out;
// this is called before invoking any methods
static {
try {
out = new PrintWriter(new OutputStreamWriter(System.out, CHARSET_NAME), true);
}
catch (UnsupportedEncodingException e) {
System.out.println(e);
}
}
// don't instantiate
private StdOut() { }
/**
* Terminates the current line by printing the line-separator string.
*/
public static void println() {
out.println();
}
/**
* Prints an object to this output stream and then terminates the line.
*
* @param x the object to print
*/
public static void println(Object x) {
out.println(x);
}
/**
* Prints a boolean to standard output and then terminates the line.
*
* @param x the boolean to print
*/
public static void println(boolean x) {
out.println(x);
}
/**
* Prints a character to standard output and then terminates the line.
*
* @param x the character to print
*/
public static void println(char x) {
out.println(x);
}
/**
* Prints a double to standard output and then terminates the line.
*
* @param x the double to print
*/
public static void println(double x) {
out.println(x);
}
/**
* Prints an integer to standard output and then terminates the line.
*
* @param x the integer to print
*/
public static void println(float x) {
out.println(x);
}
/**
* Prints an integer to standard output and then terminates the line.
*
* @param x the integer to print
*/
public static void println(int x) {
out.println(x);
}
/**
* Prints a long to standard output and then terminates the line.
*
* @param x the long to print
*/
public static void println(long x) {
out.println(x);
}
/**
* Prints a short integer to standard output and then terminates the line.
*
* @param x the short to print
*/
public static void println(short x) {
out.println(x);
}
/**
* Prints a byte to standard output and then terminates the line.
* <p>
* To write binary data, see {@link BinaryStdOut}.
*
* @param x the byte to print
*/
public static void println(byte x) {
out.println(x);
}
/**
* Flushes standard output.
*/
public static void print() {
out.flush();
}
/**
* Prints an object to standard output and flushes standard output.
*
* @param x the object to print
*/
public static void print(Object x) {
out.print(x);
out.flush();
}
/**
* Prints a boolean to standard output and flushes standard output.
*
* @param x the boolean to print
*/
public static void print(boolean x) {
out.print(x);
out.flush();
}
/**
* Prints a character to standard output and flushes standard output.
*
* @param x the character to print
*/
public static void print(char x) {
out.print(x);
out.flush();
}
/**
* Prints a double to standard output and flushes standard output.
*
* @param x the double to print
*/
public static void print(double x) {
out.print(x);
out.flush();
}
/**
* Prints a float to standard output and flushes standard output.
*
* @param x the float to print
*/
public static void print(float x) {
out.print(x);
out.flush();
}
/**
* Prints an integer to standard output and flushes standard output.
*
* @param x the integer to print
*/
public static void print(int x) {
out.print(x);
out.flush();
}
/**
* Prints a long integer to standard output and flushes standard output.
*
* @param x the long integer to print
*/
public static void print(long x) {
out.print(x);
out.flush();
}
/**
* Prints a short integer to standard output and flushes standard output.
*
* @param x the short integer to print
*/
public static void print(short x) {
out.print(x);
out.flush();
}
/**
* Prints a byte to standard output and flushes standard output.
*
* @param x the byte to print
*/
public static void print(byte x) {
out.print(x);
out.flush();
}
/**
* Prints a formatted string to standard output, using the specified format
* string and arguments, and then flushes standard output.
*
*
* @param format the <a href = "http://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html#syntax">format string</a>
* @param args the arguments accompanying the format string
*/
public static void printf(String format, Object... args) {
out.printf(LOCALE, format, args);
out.flush();
}
/**
* Prints a formatted string to standard output, using the locale and
* the specified format string and arguments; then flushes standard output.
*
* @param locale the locale
* @param format the <a href = "http://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html#syntax">format string</a>
* @param args the arguments accompanying the format string
*/
public static void printf(Locale locale, String format, Object... args) {
out.printf(locale, format, args);
out.flush();
}
/**
* Unit tests some of the methods in {@code StdOut}.
*
* @param args the command-line arguments
*/
public static void main(String[] args) {
// write to stdout
StdOut.println("Test");
StdOut.println(17);
StdOut.println(true);
StdOut.printf("%.6f\n", 1.0/7.0);
}
} | [
"sinha.sonal.kumar@gmail.com"
] | sinha.sonal.kumar@gmail.com |
41afba6e4162282f3555e6c52ed123fb41467d5a | 5410023a61aafb64437aa3ea346aa4770dbdddc4 | /test/gestion/AccountGestionTest.java | 2774302f8ccc9186711b3facbd8356a781047178 | [] | no_license | fovalerian/BanqueFournaise | c61b28d7f822fe8e716704ec19994494e0a33f3d | fdf6ac2d1675872d97cb5647e7d7bfebd3da82c5 | refs/heads/master | 2021-01-24T06:19:22.310792 | 2017-06-04T12:13:40 | 2017-06-04T12:13:40 | 93,311,896 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,002 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package gestion;
import entity.Account;
import java.util.Map;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
/**
*
* @author v
*/
public class AccountGestionTest {
public AccountGestionTest() {
}
@BeforeClass
public static void setUpClass() {
}
@AfterClass
public static void tearDownClass() {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
/**
* Test of addAccount method, of class accountGestion.
*/
@Test
public void testAddAccount() {
System.out.println("addAccount");
Map accounts = null;
Account account = null;
AccountGestion instance = new AccountGestion();
Map expResult = null;
Map result = instance.addAccount(accounts, account);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
/**
* Test of deleteAccount method, of class accountGestion.
*/
@Test
public void testDeleteAccount() {
System.out.println("deleteAccount");
Map accounts = null;
Account account = null;
AccountGestion instance = new AccountGestion();
Map expResult = null;
Map result = instance.deleteAccount(accounts, account);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
/**
* Test of updateAccount method, of class accountGestion.
*/
@Test
public void testUpdateAccount() {
System.out.println("updateAccount");
Map accounts = null;
Account account = null;
AccountGestion instance = new AccountGestion();
Map expResult = null;
Map result = instance.updateAccount(accounts, account);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
/**
* Test of readAccount method, of class accountGestion.
*/
@Test
public void testReadAccount() {
System.out.println("readAccount");
Map accounts = null;
Account account = null;
AccountGestion instance = new AccountGestion();
instance.readAccount(accounts, account);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
}
| [
"val.fournaise@gmail.com"
] | val.fournaise@gmail.com |
c3b01d0d0e5d05b545100fca7d34c12a1a53d11e | 764c94d4cf116b0e4d98a38e842e4e6a0468a666 | /ebaysdkcore/src/main/java/com/ebay/soap/eBLBaseComponents/AddItemsResponseType.java | 636ce5c1ce3ec48cb9de09999f3143843b45a67b | [] | no_license | linus87/ebaysdk | 26dde361dbb75e03fca137eaf6a61c5e892f1303 | 2fb2cbade57ae654fa83ae1b7c5f3e4f741b1fc1 | refs/heads/master | 2023-07-19T10:34:02.644641 | 2021-06-01T13:30:36 | 2021-06-01T13:30:36 | 150,661,586 | 1 | 0 | null | 2023-07-18T06:53:34 | 2018-09-28T00:06:01 | Java | UTF-8 | Java | false | false | 3,950 | java |
package com.ebay.soap.eBLBaseComponents;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
*
* The response of the <b>AddItems</b> call. The response includes the Item IDs of the newly created listings, the eBay category each item is listed under, the seller-defined SKUs of the items (if any), the listing recommendations for each item (if applicable), the start and end time of each listing, and the estimated fees that each listing will incur.
*
*
* <p>Java class for AddItemsResponseType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="AddItemsResponseType">
* <complexContent>
* <extension base="{urn:ebay:apis:eBLBaseComponents}AbstractResponseType">
* <sequence>
* <element name="AddItemResponseContainer" type="{urn:ebay:apis:eBLBaseComponents}AddItemResponseContainerType" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "AddItemsResponseType", propOrder = {
"addItemResponseContainer"
})
public class AddItemsResponseType
extends AbstractResponseType
implements Serializable
{
private final static long serialVersionUID = 12343L;
@XmlElement(name = "AddItemResponseContainer")
protected List<AddItemResponseContainerType> addItemResponseContainer;
/**
*
*
* @return
* array of
* {@link AddItemResponseContainerType }
*
*/
public AddItemResponseContainerType[] getAddItemResponseContainer() {
if (this.addItemResponseContainer == null) {
return new AddItemResponseContainerType[ 0 ] ;
}
return ((AddItemResponseContainerType[]) this.addItemResponseContainer.toArray(new AddItemResponseContainerType[this.addItemResponseContainer.size()] ));
}
/**
*
*
* @return
* one of
* {@link AddItemResponseContainerType }
*
*/
public AddItemResponseContainerType getAddItemResponseContainer(int idx) {
if (this.addItemResponseContainer == null) {
throw new IndexOutOfBoundsException();
}
return this.addItemResponseContainer.get(idx);
}
public int getAddItemResponseContainerLength() {
if (this.addItemResponseContainer == null) {
return 0;
}
return this.addItemResponseContainer.size();
}
/**
*
*
* @param values
* allowed objects are
* {@link AddItemResponseContainerType }
*
*/
public void setAddItemResponseContainer(AddItemResponseContainerType[] values) {
this._getAddItemResponseContainer().clear();
int len = values.length;
for (int i = 0; (i<len); i ++) {
this.addItemResponseContainer.add(values[i]);
}
}
protected List<AddItemResponseContainerType> _getAddItemResponseContainer() {
if (addItemResponseContainer == null) {
addItemResponseContainer = new ArrayList<AddItemResponseContainerType>();
}
return addItemResponseContainer;
}
/**
*
*
* @param value
* allowed object is
* {@link AddItemResponseContainerType }
*
*/
public AddItemResponseContainerType setAddItemResponseContainer(int idx, AddItemResponseContainerType value) {
return this.addItemResponseContainer.set(idx, value);
}
}
| [
"lyan2@ebay.com"
] | lyan2@ebay.com |
fa4a912009b59a2d60b452dc7aeb0050a15edac2 | aa511e037ee3b4cfdfda242722acb6eb3dea0b29 | /JavaCC/CCTerm.java | 1c459e5c3e8b0223325f8770b9e3019b68d4693d | [] | no_license | LallahK/Grammar_Metrics | 3dcc1af073931a67ce1cd9e643ee341b6d864596 | 4f0030771762776c5c46a3269000f4b03273d77b | refs/heads/master | 2023-06-22T15:32:20.378892 | 2021-07-18T00:20:03 | 2021-07-18T00:20:03 | 385,308,395 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,930 | java | package JavaCC;
import java.util.ArrayList;
public class CCTerm {
public static class CCProduction {
private String LHS;
private CCAlternate RHS;
public CCProduction(String LHS, CCAlternate RHS) {
this.LHS = LHS;
this.RHS = RHS;
}
public CCAlternate getRHS() { return this.RHS; }
public String getLHS() { return this.LHS; }
@Override
public String toString() {
return LHS.toString() + " -> " + RHS.toString();
}
}
public static class CCAlternate {
private ArrayList<CCConcat> concats;
public CCAlternate() {
this.concats = new ArrayList<>();
}
public void add(CCConcat a) {
this.concats.add(a);
}
public int getConcatCount() { return this.concats.size(); }
public CCConcat getConcat(int i) { return this.concats.get(i); }
@Override
public String toString() {
String s = "";
if (concats.size() > 0) {
s = concats.get(0).toString();
for (int i = 1; i < concats.size(); i++) {
s += " | " + concats.get(i).toString();
}
}
return s;
}
}
public static class CCConcat {
private ArrayList<CCAtom> terms;
public CCConcat() {
this.terms = new ArrayList<>();
}
public void add(CCAtom a) {
this.terms.add(a);
}
public int getTermCount() { return this.terms.size(); }
public CCAtom getTerm(int i) { return this.terms.get(i); }
@Override
public String toString() {
String s = "";
if (terms.size() > 0) {
s = terms.get(0).toString();
for (int i = 1; i < terms.size(); i++) {
s += " " + terms.get(i).toString();
}
}
return s;
}
}
abstract public static class CCAtom {
public int option = 0;
abstract public int getType();
public void setOption(int option) {
this.option = option;
}
public int getOption() {
return option;
}
}
public static class CCTerminal extends CCAtom {
public String literal;
public CCTerminal(String literal) {
int len = literal.length();
if (literal.substring(0, 1).equals("\"") &&
literal.substring(len - 1, len).equals("\"")) {
this.literal = literal.substring(1, len - 1);
} else this.literal = literal;
}
@Override
public int getType() {
return 1;
}
@Override
public String toString() {
String s = literal;
switch (option) {
case 1: s += "?";
break;
case 2: s += "*";
break;
case 3: s += "+";
break;
default:
break;
}
return s;
}
}
public static class CCGroup extends CCAtom {
public CCAlternate group;
public CCGroup(CCAlternate group) {
this.group = group;
}
public int getType() { return 2; }
@Override
public String toString() {
String s = "(" + group.toString() + ")";
switch (option) {
case 1: s += "?";
break;
case 2: s += "*";
break;
case 3: s += "+";
break;
default:
break;
}
return s;
}
@Override
public int hashCode() {
return group.hashCode();
}
}
} | [
"21865728@sun.ac.za"
] | 21865728@sun.ac.za |
9d3cdb05035e1b71cce4fc38a22886eda133c0ed | fd2e9b314e33fb84e802a35347f335504118b372 | /integration-tests/src/test/java/de/escidoc/core/test/adm/DeleteObjectsTest.java | b0b845d4f84ed10161dde83c5724b784e61ff574 | [] | no_license | crh/escidoc-core-1.3 | 5f0f06f5ba66be07c6633c8c33f285894dc96687 | f4689e608f464832a41fcf6e451a6c597c5076bc | refs/heads/master | 2020-05-17T18:42:30.813395 | 2012-02-22T10:50:05 | 2012-02-22T10:50:05 | 3,514,360 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,200 | java | /*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at license/ESCIDOC.LICENSE
* or http://www.escidoc.de/license.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at license/ESCIDOC.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006-2008 Fachinformationszentrum Karlsruhe Gesellschaft
* fuer wissenschaftlich-technische Information mbH and Max-Planck-
* Gesellschaft zur Foerderung der Wissenschaft e.V.
* All rights reserved. Use is subject to license terms.
*/
package de.escidoc.core.test.adm;
import de.escidoc.core.common.exceptions.remote.application.notfound.ItemNotFoundException;
import de.escidoc.core.test.EscidocRestSoapTestBase;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import static org.junit.Assert.fail;
/**
* Test suite for the DeleteObjects method of the admin tool.
*
* @author André Schenk
*/
@RunWith(value = Parameterized.class)
public class DeleteObjectsTest extends AdminToolTestBase {
/**
* The constructor.
*
* @param transport The transport identifier.
* @throws Exception If anything fails.
*/
public DeleteObjectsTest(final int transport) throws Exception {
super(transport);
}
/**
* Delete a list of objects from Fedora and search index.
*
* @throws Exception If anything fails.
*/
@Test(timeout = 30000)
public void testDeleteObjects() throws Exception {
// create item
String xml =
EscidocRestSoapTestBase.getTemplateAsString(TEMPLATE_ITEM_PATH + "/" + getTransport(false),
"escidoc_item_198_for_create.xml");
String itemId = getObjidValue(createItem(xml));
// delete item
xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<param><id>" + itemId + "</id></param>";
System.out.println(deleteObjects(xml));
// wait until process has finished
final int waitTime = 5000;
while (true) {
String status = getPurgeStatus();
System.out.println(status);
if (status.indexOf("finished") > 0) {
break;
}
Thread.sleep(waitTime);
}
// check if item still exists
try {
retrieveItem(itemId);
fail("item with id " + itemId + " still exists");
}
catch (final Exception e) {
EscidocRestSoapTestBase.assertExceptionType(ItemNotFoundException.class, e);
}
}
}
| [
"Steffen.Wagner@fiz-karlsruhe.de"
] | Steffen.Wagner@fiz-karlsruhe.de |
772a0adf1ed0a94d2dbbce8064130f8ae3345e58 | 7c4cab95a4cac2f9def9f4c2b3117366a4b6fe9c | /src/main/java/com/example/testing/tree/RecursionTreeTraversal.java | 29231e1863f59e5ebda6b9af54fcfdecc91c36a2 | [] | no_license | dasWarder/algorythms_and_data_structures | 64033bc533cc8847dc239f9bff04893f64f66ee4 | a49a9a976a35ab716c0df1114af460422b3eab07 | refs/heads/main | 2023-07-16T15:10:28.528881 | 2021-08-23T14:08:12 | 2021-08-23T14:08:12 | 377,089,744 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 469 | java | package com.example.testing.tree;
public class RecursionTreeTraversal<T> implements TreeTraversal<T> {
@Override
public void treeTraversal(Node<T> root) {
recursionTraversal(root);
}
private void recursionTraversal(Node<T> node) {
if(node == null) {
return;
}
recursionTraversal(node.getLeftNode());
System.out.println(node.getData());
recursionTraversal(node.getRightNode());
}
}
| [
"Al.94_94@mail.ru"
] | Al.94_94@mail.ru |
fe24b4225f74d7672e9914b92526718be523bb67 | 364957a76de94cf0cc9060c50307b678289b780d | /src/com/academy/businesscomponent/exception/CustomExceptionHandlerFactory.java | e66d2845338eb464be788df52a4efd5bd71b8308 | [] | no_license | borisminardo/JavaEE_Jsf_example | b8a920d2b75a9aa5ae8324bdb699a2064f81b299 | 47119fd9ab66480e4095b1ea710d9954c21752f9 | refs/heads/master | 2022-12-18T08:20:08.280648 | 2020-09-22T13:34:39 | 2020-09-22T13:34:39 | 297,659,221 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 592 | java | package com.academy.businesscomponent.exception;
import javax.faces.context.ExceptionHandler;
import javax.faces.context.ExceptionHandlerFactory;
// serviva per per le jsf
public class CustomExceptionHandlerFactory extends ExceptionHandlerFactory{
private ExceptionHandlerFactory exceptionHandlerFactory;
public CustomExceptionHandlerFactory(ExceptionHandlerFactory wrapped) {
super(wrapped);
this.exceptionHandlerFactory = wrapped;
}
@Override
public ExceptionHandler getExceptionHandler() {
return new CustomErrorHandler(exceptionHandlerFactory.getExceptionHandler());
}
}
| [
"borismariaminardo@gmail.com"
] | borismariaminardo@gmail.com |
2f82e8d2ca495b60215b44255e3f6b8b5864670a | c06525583d4da8b6df5a0ae013601e53755acef9 | /animator(属性动画)/src/main/java/com/example/animator/MainActivity.java | fab21e23e01bf4bdb9f5189cfbb902d5cf4a0e5d | [] | no_license | aoguxiongxin/MyApplication | ff432bc3a97b6bb961c49d307ab7d8104031bacd | 09bee377b17f1b0d0e536e8255e868d780b9fbcc | refs/heads/master | 2021-01-22T02:41:03.472364 | 2017-09-03T08:24:56 | 2017-09-03T08:24:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,074 | java | package com.example.animator;
import android.animation.Animator;
import android.animation.AnimatorInflater;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.PropertyValuesHolder;
import android.animation.ValueAnimator;
import android.graphics.Color;
import android.os.Build;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Animation;
import android.view.animation.AnimationSet;
import android.view.animation.TranslateAnimation;
import android.widget.ImageView;
import android.widget.LinearLayout;
public class MainActivity extends AppCompatActivity {
private ImageView img;
private LinearLayout layout;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
img = (ImageView) findViewById(R.id.img);
layout = (LinearLayout) findViewById(R.id.layout);
}
public void onClick(View view) {
//属性动画 ValueAnimator 的用法 ,属性动画本质是值的动画
//用valueAnimator实现组合动画
/* ValueAnimator valueAnimator = ValueAnimator.ofFloat(1f, 3f);
valueAnimator.setDuration(2000);
valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
//得到属性动画变化的值设置给img
float animatedValue = (float) animation.getAnimatedValue();
//图片缩放
ViewGroup.LayoutParams layoutParams = img.getLayoutParams();
layoutParams.width = (int) (animatedValue * 100);//数字根据自己需求来设置
layoutParams.height = (int) (animatedValue * 100);
img.setLayoutParams(layoutParams);
//透明
img.setAlpha(animatedValue);
}
});
valueAnimator.start();*/
//ObjectAnimator的用法,他是ValueAnimator的子类
//透明动画
/**
* 参数 target 指的是 view,这里使用图片 img
* PropertyName 要执行的动画的名字,
* float...values 是多参数,要执行的动画的数值
*/
/* ObjectAnimator alpha = ObjectAnimator.ofFloat(img, "alpha", 0f, 1f);
alpha.setDuration(2000).setRepeatCount(2);
//设置透明重复的样式,
alpha.setRepeatMode(ValueAnimator.REVERSE);
alpha.start();*/
//缩放动画
/* ObjectAnimator scaleX = ObjectAnimator.ofFloat(img, "scaleX", 1f, 3f);
scaleX.setDuration(2000).setRepeatCount(2);
//设置透明重复的样式,
scaleX.setRepeatMode(ValueAnimator.REVERSE);
scaleX.start();*/
/* //平移动画
ObjectAnimator translationX = ObjectAnimator.ofFloat(img, "translationX", 0, 1000);
translationX.setDuration(2000).setRepeatCount(2);
translationX.start();*/
// 旋转动画,以自己为中心旋转
/* ObjectAnimator rotation = ObjectAnimator.ofFloat(img, "rotation", -50f, 50f);
rotation.setDuration(1000).setRepeatCount(999);
rotation.setRepeatMode(ValueAnimator.REVERSE);
rotation.start();*/
//直接使用view的animate()来设置动画,可以设置组合动画
/*img.animate().alpha(0.5f)//设置透明度
.setDuration(2000)//设置执行动画的时间
.setStartDelay(1000)//设置延迟多久执行
.rotation(360f)//设置旋转多少度
.translationX(100f)//设置X轴移动距离
.translationY(100f)//设置Y轴移动距离
.scaleX(3f)//设置缩放倍数
.scaleY(3f)//设置缩放倍数
.start();*/
//AnimatorSet 组合动画
/* AnimatorSet animatorSet = new AnimatorSet();
//设置两种以上的动画,组合到一起执行
ObjectAnimator alpha = ObjectAnimator.ofFloat(img, "alpha", 0f, 1f, 0.5f, 1f);
ObjectAnimator scaleX = ObjectAnimator.ofFloat(img, "scaleX", 0f, 1f, 2f, 3f, 2f, 1f, 0f);
// animatorSet.play(alpha).with(scaleX);//动画同时执行
// animatorSet.play(alpha).before(scaleX);//先执行前面的动画,再执行后面的动画
// animatorSet.playSequentially(alpha,scaleX);//先执行前面的动画,再执行后面的动画
animatorSet.playTogether(alpha, scaleX);//同时执行
animatorSet.setDuration(4000).start();*/
//ObjectAnimator 来实现组合动画
/* PropertyValuesHolder alphaProperty = PropertyValuesHolder.ofFloat("alpha", 1f, 0.5f, 0f, 0.5f);
PropertyValuesHolder scaleXProperty = PropertyValuesHolder.ofFloat("scaleX", 1f, 1.5f, 2f, 1f);
*//**
* target 指的是要执行动画的控件,
* PropertyValuesHolder 里面存放要执行的动画的propertyname,还有多参的float数值
*//*
ObjectAnimator.ofPropertyValuesHolder(img, alphaProperty, scaleXProperty).setDuration(3000).start();*/
//改变颜色的动画,只限制API>21,模拟器版本需要大于21的,安卓5.0以上
/* if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
*//*if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP)*//* {
ValueAnimator valueAnimator = ValueAnimator.ofArgb(Color.YELLOW, Color.BLUE, Color.GRAY, Color.RED);
valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
int animatedValue = (int) animation.getAnimatedValue();
layout.setBackgroundColor(animatedValue);
}
});
valueAnimator.setDuration(3000).start();
}
*/
//调用xml文件中的objectAnimator动画,透明 alpha动画
/* Animator animator = AnimatorInflater.loadAnimator(this, R.animator.objectanimator);
animator.setTarget(img);
animator.setDuration(2000);
animator.start();*/
//调用xml文件中的valueAnimator动画,旋转动画
/*ValueAnimator animator = (ValueAnimator) AnimatorInflater.loadAnimator(this, R.animator.valueanimator);
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
float animatedValue = (float) animation.getAnimatedValue();
img.setRotation(animatedValue);
}
});
animator.start();*/
//调用xml文件中的set组合动画,透明和旋转
Animator animator = AnimatorInflater.loadAnimator(this, R.animator.animator_set);
animator.setTarget(img);
animator.start();
}
}
| [
"360678360@qq.com"
] | 360678360@qq.com |
df3bd7d7059470971ec4dc7d12023464a88b98d3 | e8efab4b6a892e0eb0a49b15fa9b27d86fcc14cd | /app/src/main/java/com/santosh/stockhawk/adapter/RecyclerViewItemClickListener.java | ddc64ea3929e22bda6c9809f2f4ae5b5684785f4 | [] | no_license | SaiSantoshSB/StockHawk | b06e41f2f8114a275ef81a7d388b34fbedd657e1 | 7df81390fcb71027090cf17e46b9734e233808d0 | refs/heads/master | 2021-01-19T19:56:54.813205 | 2017-05-09T01:11:54 | 2017-05-09T01:11:54 | 88,468,348 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,352 | java | package com.santosh.stockhawk.adapter;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.View;
public class RecyclerViewItemClickListener implements RecyclerView.OnItemTouchListener {
@Override
public void onRequestDisallowInterceptTouchEvent(boolean disallowIntercept) {
}
private GestureDetector gestureDetector;
private OnItemClickListener listener;
public interface OnItemClickListener{
void onItemClick(View v, int position);
}
public RecyclerViewItemClickListener(Context context, OnItemClickListener listener) {
this.listener = listener;
gestureDetector = new GestureDetector(context, new GestureDetector.SimpleOnGestureListener() {
@Override
public boolean onSingleTapUp(MotionEvent e) {
return true;
}
});
}
@Override
public boolean onInterceptTouchEvent(RecyclerView view, MotionEvent e) {
View childView = view.findChildViewUnder(e.getX(), e.getY());
if (childView != null && listener != null && gestureDetector.onTouchEvent(e)) {
listener.onItemClick(childView, view.getChildPosition(childView));
return true;
}
return false;
}
@Override
public void onTouchEvent(RecyclerView view, MotionEvent motionEvent) { }
}
| [
"Sai Santosh"
] | Sai Santosh |
eb2254ce8972c69dc75925366555540fdde917b0 | fd4227aa31074722d53a45a496ec11e70f8cddc9 | /search/DelStudent.java | 9bb6e0be5324de2981503ead1678b4cc08fc44b1 | [] | no_license | Miguel0312/School-Management | 455f21ba0940fab506735d685c407ca043d5e225 | 22938091077f5ecff3bf97dc99d70a6a7b1687e8 | refs/heads/main | 2023-08-25T11:35:18.251923 | 2021-10-29T14:24:25 | 2021-10-29T14:24:25 | 383,861,116 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,721 | java | package search;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
import javax.swing.JButton;
import javax.swing.JOptionPane;
import people.Student;
/*
*DelStudent is a button that will delete the current selected student in the search window
*/
public class DelStudent extends JButton {
private SearchWindow owner;
private DisplaySpace dSpace;
public DelStudent(SearchWindow owner, DisplaySpace dSpace) {
this.setText("Delete student's data");
this.setPreferredSize(new Dimension(200, 50));
this.owner = owner;
this.dSpace = dSpace;
this.addActionListener(new Delete(this.owner, this.dSpace));
}
}
class Delete implements ActionListener {
private SearchWindow owner;
private DisplaySpace dSpace;
/*
* We store the SearchWindow where the information about the student that the
* user wants to delete is saved and the DisplaySpace where these informations
* are stored
*/
public Delete(SearchWindow owner, DisplaySpace dSpace) {
this.owner = owner;
this.dSpace = dSpace;
}
public SearchWindow getOwner() {
return owner;
}
/*
* When the button is pressed, the program will confirm if the user really wants
* to delete the information of the student.
*
* To delete the information, the program will store all the students that are
* not the one that the user wants to delete and then update both the text file
* (by overwriting) and the ArrayList (by calling the method
* SearchWindow.updateSchool())
*/
public void actionPerformed(ActionEvent e) {
if (owner.getStudent().getName().equals("") && owner.getStudent().getID().equals("")) {
return;
}
String[] options = { "Yes", "No" };
int confirm = JOptionPane.showOptionDialog(owner,
"Are you sure that you want to delete " + owner.getStudent().getName() + " data?", "Confirm",
JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE, null, options, options[1]);
if (confirm == JOptionPane.YES_OPTION) {
ObjectOutputStream oos;
try {
oos = new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream(new File("school.txt"))));
for (Student st : owner.getSchool()) {
if (!st.equals(owner.getStudent()))
oos.writeObject(st);
}
owner.updateSchool();
oos.close();
} catch (IOException error) {
error.printStackTrace();
}
owner.setStudent(new Student("", "", "", "", false));
dSpace.displayStudent();
}
}
}
| [
"miguel.vpereira14@gmail.com"
] | miguel.vpereira14@gmail.com |
1826265f1a9050aea8ef8b086bbe6ee4a82a9bfc | baf133d09dc0239c62abe63e8da4e3cb9e205f38 | /3rd-Year/Object-Oriented-Programming/HW7/FileVisitor.java | bdf7f1ccf97ddb825ad5ebb82ab6014c5d30fd32 | [] | no_license | abrahammurciano/homework | b7c9555688221299e4eea7fe635299d4a6ab01ba | 879607be45c24f49c03cfad4c7eaa0c1f81afa4d | refs/heads/master | 2022-03-18T20:38:10.283054 | 2021-09-19T20:09:52 | 2021-09-19T20:09:52 | 154,134,294 | 11 | 10 | null | 2022-03-02T19:16:55 | 2018-10-22T11:47:39 | TeX | UTF-8 | Java | false | false | 275 | java | public interface FileVisitor {
int visit(DirectoryDetails file);
int visit(DocxFileDetails file);
int visit(HtmlFileDetails file);
int visit(JpgFileDetails file);
int visit(Mp3FileDetails file);
int visit(PptxFileDetails file);
int visit(TxtFileDetails file);
}
| [
"abrahammurciano@gmail.com"
] | abrahammurciano@gmail.com |
c5bac7e4a565a1dafc69e6ce5dc1cda10ce23962 | 84eb0c02978cda09a76e58e76ed1502fab80b4e8 | /cmd-spring-boot/cmd-spring/src/main/java/com/zhuolu/cmd/PublishCmd.java | 13a9c1bf207c8b787f234ab2a76863a911a332aa | [] | no_license | Robin1995Yu/cmd | 0149cf905c96f0df4cf746b2b54c83b5ff89feca | a60764ad217f2215e2fbe62f56fae162eb5ae1ca | refs/heads/master | 2023-07-25T12:25:03.286160 | 2021-09-08T11:29:24 | 2021-09-08T11:29:24 | 390,411,165 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 786 | java | package com.zhuolu.cmd;
import com.zhuolu.cmd.core.CmdRuntime;
import com.zhuolu.cmd.core.entry.cmd.AbstractCmd;
import com.zhuolu.cmd.core.entry.cmd.Cmd;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationEvent;
import java.util.List;
public class PublishCmd extends AbstractCmd {
private final ApplicationContext applicationContext;
private static final Class<ApplicationEvent> DEFAULT_APPLICATION_EVENT_TYPE = ApplicationEvent.class;
public PublishCmd(Cmd previous, List<String> param, CmdRuntime cmdRuntime, ApplicationContext applicationContext) {
super("publish", previous, param, cmdRuntime);
this.applicationContext = applicationContext;
}
@Override
protected void init() {
}
}
| [
"yuzhongnan@come-future.com"
] | yuzhongnan@come-future.com |
8868ae5fe6f297cb9070103650b2cbcd03641fcc | 5e5cf1801b94f5abcf691a16ea5dbb0f973e670d | /app/src/androidTest/java/com/rohan/cookieclicker/ExampleInstrumentedTest.java | 8ac7b575cf9b19c91b695e239281b1279399b504 | [] | no_license | rkasugan/CookieClicker | 7e7d297a3b1f6f6a18f79f21e2fe691eda9499c5 | e3ddbdea87d64a6b86bcbbe578d8870b37d1c5c7 | refs/heads/master | 2020-04-22T01:32:06.638228 | 2019-02-10T19:39:52 | 2019-02-10T19:39:52 | 170,017,076 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 747 | java | package com.rohan.cookieclicker;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.rohan.cookieclicker", appContext.getPackageName());
}
}
| [
"rohan.kasuganti@gmail.com"
] | rohan.kasuganti@gmail.com |
5743e36df8fc7b32422ca88328346ba6379b3626 | 1bc68cbe9fc00e46f9bc4378ad7f13acb4b3e19d | /src/main/java/com/jdon/jivejdon/spi/component/account/SinaOAuthSubmitter.java | f50adb905bd34bf8665e0828dad8142054c91c15 | [
"Apache-2.0"
] | permissive | banq/jivejdon | d96ec24a6f399764bf743faee5540250dc4487dd | 457bf83368a8e9ddcf5b5950234d1742f9802655 | refs/heads/master | 2023-08-17T05:53:59.036263 | 2023-08-17T02:08:01 | 2023-08-17T02:08:01 | 145,264,797 | 548 | 167 | Apache-2.0 | 2023-02-22T00:18:41 | 2018-08-19T01:41:09 | Java | UTF-8 | Java | false | false | 5,914 | java | /*
* Copyright 2003-2009 the original author or authors.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.jdon.jivejdon.spi.component.account;
import com.jdon.annotation.Component;
import com.jdon.jivejdon.spi.component.account.sina.AccessToken;
import com.jdon.jivejdon.spi.component.weibo.UserConnectorAuth;
import com.jdon.jivejdon.domain.model.account.OAuthUserVO;
import com.jdon.jivejdon.infrastructure.repository.acccount.Userconnector;
import com.jdon.util.UtilValidate;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import weibo4j.Oauth;
import weibo4j.examples.oauth2.Log;
import weibo4j.http.HttpClient;
import weibo4j.http.Response;
import weibo4j.model.PostParameter;
import weibo4j.model.Status;
import weibo4j.model.User;
import weibo4j.model.WeiboException;
import weibo4j.util.BareBonesBrowserLaunch;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
@Component("sinaOAuthSubmitter")
public class SinaOAuthSubmitter {
private final static Logger logger = LogManager.getLogger(SinaOAuthSubmitter.class);
public final SinaOAuthParamVO oAuthParamVO;
protected Userconnector userconnector;
protected HttpClient client = new HttpClient();
public SinaOAuthSubmitter(SinaOAuthParamVO oAuthParamVO, Userconnector userconnector) {
super();
this.oAuthParamVO = oAuthParamVO;
this.userconnector = userconnector;
}
public static void main(String[] args) throws WeiboException, IOException {
Oauth oauth = new Oauth();
BareBonesBrowserLaunch.openURL(oauth.authorize("code"));
System.out.println(oauth.authorize("code"));
System.out.print("Hit enter when it's done.[Enter]:");
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String code = br.readLine();
Log.logInfo("code: " + code);
try {
String token = oauth.getAccessTokenByCode(code).getAccessToken();
System.out.println("############token=" + token);
HttpClient client = new HttpClient();
Response rs = client.post("https://api.weibo.com/2/statuses/share" +
".json",
new PostParameter[]{new PostParameter(
"status", "【SpringBoot 2的普通servlet与WebFlux性能对比】: Spring-boot 2.0 " +
"最近" +
" " +
"发布,每个人都对新功能和改进感到兴奋。Spring 5引入了W https://jdon.com/50407"),new PostParameter("rip","101.86.20.11")}, token);
Status status = new Status(rs);
System.out.println("############status=" + status);
} catch (WeiboException e) {
if (401 == e.getStatusCode()) {
Log.logInfo("Unable to get the access token.");
} else {
e.printStackTrace();
}
}
}
public void submitWeibo(String content, UserConnectorAuth userConnectorAuth, String rip) {
try {
AccessToken accessToken = (AccessToken) userConnectorAuth.getAccessToken();
update(accessToken, content, rip);
} catch (Exception e) {
logger.error("submitWeibo error:" + e);
}
}
public void saveSinaWeiboAuth(UserConnectorAuth userConnectorAuth) {
if (userConnectorAuth.getAccessToken() != null) {
userconnector.saveUserConnectorAuth(userConnectorAuth);
}
}
public String authorizeURL(String backurl, String response_type) {
return oAuthParamVO.authorizeURL + "?client_id=" + oAuthParamVO.CONSUMER_KEY +
"&redirect_uri=" + backurl + "&response_type=" + response_type;
}
public AccessToken getAccessTokenByCode(String code, String backurl) throws WeiboException {
Response rs = client.post(oAuthParamVO.accessTokenURL, new PostParameter[]{
new PostParameter("client_id", oAuthParamVO.CONSUMER_KEY), new
PostParameter("client_secret", oAuthParamVO.CONSUMER_SECRET),
new PostParameter("grant_type", "authorization_code"), new PostParameter
("code", code), new PostParameter("redirect_uri", backurl)},
false, null);
return new AccessToken(rs);
}
public void update(AccessToken access, String content, String rip) throws Exception {
try {
// content = content + " https://jdon.com";
Response rs = client.post(oAuthParamVO.baseURL + "statuses/share" +
".json",
new PostParameter[]{new PostParameter("status", content),new PostParameter("rip",rip)}, access.getAccessToken());
Status status = new Status(rs);
if (status != null && UtilValidate.isEmpty(status.getText())) {
logger.error("update weibo error :" + status + "\n " +
"content:" + content);
} else
logger.debug("Successfully updated the status to [" + status.getText() + "].");
} catch (Exception e) {
logger.error("update error:" + e + " " + content);
throw new Exception(e);
}
}
public OAuthUserVO getUserInfo(AccessToken access) throws Exception {
OAuthUserVO weiboUser = null;
try {
Response rs = client.get(oAuthParamVO.baseURL + "users/show.json",
new PostParameter[]{new PostParameter("uid", access.getUid())}, access
.getAccessToken());
User user = new User(rs);
String userId = access.getUid();
String atName = user.getScreenName();
String userDomainURL = user.getUserDomain();
String profileUrl = "";
if (user.getProfileImageURL() != null)
profileUrl = user.getProfileImageURL().toString();
weiboUser = new OAuthUserVO(userId, atName, user.getDescription(), userDomainURL,
profileUrl);
} catch (Exception e) {
throw new Exception(e);
}
return weiboUser;
}
}
| [
"banq@163.com"
] | banq@163.com |
31aae1b9ec0bc8c25bd5dff2112518cdac4838d4 | ed5159d056e98d6715357d0d14a9b3f20b764f89 | /src/irvine/oeis/a054/A054322.java | 9590d6703dfdb8cfc940865770bfd0f681b3791d | [] | no_license | flywind2/joeis | c5753169cf562939b04dd246f8a2958e97f74558 | e5efd6971a0062ac99f4fae21a7c78c9f9e74fea | refs/heads/master | 2020-09-13T18:34:35.080552 | 2019-11-19T05:40:55 | 2019-11-19T05:40:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 450 | java | package irvine.oeis.a054;
// Generated by gen_pattern.pl - DO NOT EDIT here!
import irvine.oeis.GeneratingFunctionSequence;
/**
* A054322 Fourth unsigned column of Lanczos triangle <code>A053125</code> (decreasing powers).
* @author Georg Fischer
*/
public class A054322 extends GeneratingFunctionSequence {
/** Construct the sequence. */
public A054322() {
super(0, new long[] {4, 16},
new long[] {1, -16, 96, -256, 256});
}
}
| [
"sean.irvine@realtimegenomics.com"
] | sean.irvine@realtimegenomics.com |
9457f6304272ce1e61ef26ec70b5ba3615646b1f | dc001198d280b7b1b9c328b47fd798a2a5ca316a | /app/src/main/java/com/example/admin/mvp_master/tools/network/ApiServiceTag.java | 49e5046f2a57d9e87ddb4cf70cb8dc13a3c05d7d | [] | no_license | evilcyx/jar | d63359f7e49ac56aec974733b43c5f216a13aa42 | 875c1c0239044070e87ca194ebada26964a8e32d | refs/heads/master | 2020-03-10T12:50:59.933023 | 2018-04-20T06:12:07 | 2018-04-20T06:12:07 | 129,386,712 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 127 | java | package com.example.admin.mvp_master.tools.network;
/**
* Created by admin on 2018/3/31.
*/
public class ApiServiceTag {
}
| [
"1047891382@qq.com"
] | 1047891382@qq.com |
fe9a76a64a4422f5020abe46abd94307e3aeded6 | 00e4fa1dd5e7023dbadd32bb8b3b46ba8d4c8df7 | /design_pattern/src/main/java/org/pb/singleton/Singleton02.java | 424f15b188b3cfa6ef41df0b686c5d5d6b105159 | [] | no_license | PB2088/java_basic | 130f15457f491e6ea49c0fbe6e0cf2c56ec766a2 | b73255ebb0259e18974d7f53c49955201ebe8610 | refs/heads/master | 2021-07-06T02:54:06.804199 | 2020-03-30T07:18:24 | 2020-03-30T07:18:24 | 195,235,911 | 0 | 0 | null | 2020-10-13T14:21:39 | 2019-07-04T12:17:28 | Java | UTF-8 | Java | false | false | 713 | java | package org.pb.singleton;
/**
* 单例模式-饿汉式(静态代码块)
*
* @author bo.peng
* @create 2019-12-14 22:26
*/
public class Singleton02 {
public static void main(String[] args) {
Singleton2 singleton1 = Singleton2.getInstance();
Singleton2 singleton2 = Singleton2.getInstance();
System.out.println("singleton1.hashCode() = " + singleton1.hashCode());
System.out.println("singleton2.hashCode() = " + singleton2.hashCode());
}
}
class Singleton2 {
private static Singleton2 INSTANCE;
private Singleton2() {}
static {
INSTANCE = new Singleton2();
}
public static Singleton2 getInstance() {
return INSTANCE;
}
}
| [
"boge_peng@163.com"
] | boge_peng@163.com |
1885d736dc6ef70d6826353ea88d32de24e49054 | 369fb1910ab0aee739a247b5b5ffcea04bf54da5 | /center-auth/src/main/java/com/fty1/center/auth/msgcode/sign/SignMsgCode.java | 397312fc409791128b92088650f6f27cead5b1b7 | [] | no_license | Cray-Bear/starters | f0318e30c239fefd1a5079a45faf1bcc0cf34d39 | b6537789af56988bcb1d617cc4e6e1a1ef7dfc92 | refs/heads/master | 2020-04-08T11:27:42.993024 | 2019-03-24T15:15:17 | 2019-03-24T15:15:17 | 159,306,956 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 923 | java | package com.fty1.center.auth.msgcode.sign;
import com.fty1.common.core.signal.MsgCode;
public enum SignMsgCode implements MsgCode {
EMPTY_IN_LOGINNO("N0001","请填写用户名"),
EMPTY_IN_LOGINPWD("N0002","请填写密码"),
EMPTY_CODE_IMAGE("N0003","请填写图形验证码"),
EMPTY_CODE_SMS("N0004","请填写手机验证码"),
NULL("","");
private String code;
private String msg;
SignMsgCode(String code, String msg) {
this.code = code;
this.msg = msg;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
@Override
public String code() {
return getCode();
}
@Override
public String msg() {
return getMsg();
}
}
| [
"1798900899@qq.com"
] | 1798900899@qq.com |
2edf3071878d6845e3afe2be4afb9e56951f9cca | 9498bd612bd5ae55146f132930ea58b1ca27450b | /2014/fall/cs46a/midterm/exam2/Problem3.java | 393058a88eb277e29046b371a28cb06ae9d20998 | [] | no_license | scotmatson/sjsu | 01d895662cf52c3876f23d0391080c15cd194bb3 | a8b55bf9429b06a5e5cb3287f7083e2173ec9134 | refs/heads/master | 2021-05-01T02:54:48.932325 | 2016-08-22T22:01:57 | 2016-08-22T22:01:57 | 31,382,456 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,683 | java | import java.util.Random;
import java.util.Arrays;
/**
9602502
Do not remove your student ID
* In this problem you will write a tester to test the
* methods you wrote in your Problem2
*
* First create a 2d array of ints with
* 7rows and 4columns
*
* Next fill the array with random numbers less than or equal
* to 100 using the Random object declared for you. Do not change the
* object
*
* Finally call the static methods in Problem2 and print the
* results. Remember that you call a static method using the
* name of the class something like this
* ClassName.methodName(parameters)
*
* You can get credit for the tester even if you could not do
* Problem2
*/
public class Problem3
{
public static void main(String[] args)
{
//fill array with random numbers
Random random = new Random(4000);
int[][] list = new int[7][4];
int ROW, COL;
for (ROW = 0; ROW < list.length; ++ROW) {
for (COL = 0; COL < list[ROW].length; ++COL) {
list[ROW][COL] = random.nextInt(100);
}
}
print(list);
// call the static sum method of Problem2 and print the results
System.out.println("Sum of last row: " + Problem2.sum(list));
print(list);
//call the static replace method of Problem2
Problem2.replace(list);
}
/**
* prints the 2d array
*/
public static void print(int[][] array)
{
System.out.println();
for(int row = 0; row < array.length; row++)
{
System.out.println(Arrays.toString(array[row]));
}
System.out.println();
}
}
| [
"sjpmatson@gmail.com"
] | sjpmatson@gmail.com |
22adcff2d01b6596c279d813e1e058ca8ae4fe44 | da08412dda322e8ca3447a00954881c9edb30299 | /src/com/DauntlessArmourer/Armour/FrostbackHead.java | 850faa432cd9ef6fa3c20cba0366f4f2632607e7 | [] | no_license | belven/DauntlessArmourer | 6d7a334b20519ad4f0ea77d7d851116e41432aa6 | 8faecf5c835e50d4a91f642ebcd7da4dacf17b9a | refs/heads/master | 2020-04-05T16:53:52.045004 | 2018-11-25T23:01:59 | 2018-11-25T23:01:59 | 157,033,505 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 830 | java | package com.DauntlessArmourer.Armour;
import java.util.ArrayList;
import java.util.Arrays;
import com.DauntlessArmourer.ArmourerFactory;
import com.DauntlessArmourer.Cells.CellType;
import com.DauntlessArmourer.Effects.Effect;
public class FrostbackHead extends Armour
{
public FrostbackHead(int newLevel)
{
super(newLevel, Slot.Head);
}
@Override
public ArrayList<Effect> getEffects()
{
ArrayList<Effect> effects = new ArrayList<>();
Effect effect1 = ArmourerFactory.getEffectByName("Warmth", 1);
Effect effect2 = ArmourerFactory.getEffectByName("KnockoutKing", 1);
if (level >= 6)
{
effect1.setLevel(2);
}
effects.add(effect1);
effects.add(effect2);
return effects;
}
@Override
public ArrayList<CellType> getCellTypes()
{
return new ArrayList<>(Arrays.asList(CellType.Power));
}
}
| [
"belven000@gmail.com"
] | belven000@gmail.com |
f52e75d7f172f6e70c8bd8fda0de7891f9ffcd6b | ee43ff96130873670a771363d3eda02072ed821c | /app/src/main/java/org/alie/revealview/MainActivity.java | ca940ad2252f7ebf8ecf21672e779b286b47ea15 | [] | no_license | AliesYangpai/RevealView | 37bf8b7ac0025c3c0aa257ca1a2eebbf0522a597 | c8bb5fa08254081521c3865183123ca1ecf84a0e | refs/heads/master | 2020-05-05T10:42:46.162845 | 2019-04-07T11:41:46 | 2019-04-07T11:41:46 | 179,957,021 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,354 | java | package org.alie.revealview;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.support.annotation.RequiresApi;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.widget.ImageView;
public class MainActivity extends AppCompatActivity {
private static final String TAG = "MainActivity";
private int[] mImgIds = new int[]{ //7个
R.drawable.avft,
R.drawable.box_stack,
R.drawable.bubble_frame,
R.drawable.bubbles,
R.drawable.bullseye,
R.drawable.circle_filled,
R.drawable.circle_outline,
R.drawable.avft,
R.drawable.box_stack,
R.drawable.bubble_frame,
R.drawable.bubbles,
R.drawable.bullseye,
R.drawable.circle_filled,
R.drawable.circle_outline
};
private int[] mImgIds_active = new int[]{
R.drawable.avft_active, R.drawable.box_stack_active, R.drawable.bubble_frame_active,
R.drawable.bubbles_active, R.drawable.bullseye_active, R.drawable.circle_filled_active,
R.drawable.circle_outline_active,
R.drawable.avft_active, R.drawable.box_stack_active, R.drawable.bubble_frame_active,
R.drawable.bubbles_active, R.drawable.bullseye_active, R.drawable.circle_filled_active,
R.drawable.circle_outline_active
};
public Drawable[] revealDrawables;
private GallaryHorizonalScrollView hzv;
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
initData();
initView();
}
private void initData() {
revealDrawables = new Drawable[mImgIds.length];
}
private void initView() {
for (int i = 0; i < mImgIds.length; i++) {
RevealDrawable rd = new RevealDrawable(
getResources().getDrawable(mImgIds[i]),
getResources().getDrawable(mImgIds_active[i]),
RevealDrawable.HORIZONTAL);
revealDrawables[i] = rd;
}
hzv = findViewById(R.id.hsv);
hzv.addImageViews(revealDrawables);
}
}
| [
"yangpai_beibei@163.com"
] | yangpai_beibei@163.com |
27df825eafa81b2ce15e9c344d7c755b3e5396fc | 946ac8137f6c8acd61566d9022ae8362228190e2 | /src/Paint.java | 365401e2a92da1dd3f3df32f0bc2c2fecebdad41 | [] | no_license | Fernando2020/Paint_Computacao_Grafica | ab93792216b7ac0be9a996ca0b86749acdfea15d | 7987e11acce297c1d92a66e5ba4c192cfbc75ab5 | refs/heads/master | 2022-12-28T21:50:24.473392 | 2020-10-12T12:35:19 | 2020-10-12T12:35:19 | 303,369,702 | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 16,288 | java | import java.awt.*;
import java.awt.event.*;
import java.awt.geom.AffineTransform;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Line2D;
import java.awt.geom.Point2D;
import java.util.ArrayList;
import javax.swing.*;
import javax.swing.border.*;
public class Paint extends JPanel implements MouseListener, MouseMotionListener {
static ArrayList<Drawable> itemsDrawn;
public JButton clear, undo, scale, rotateR, rotateL;
private JLabel mousePos;
public Paint.DrawPanel dp = new DrawPanel();
public Paint.ControlPanel cp = new ControlPanel(dp);
public Paint() {
final JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
JPanel bottom = new JPanel();
bottom.setLayout(new BorderLayout());
JPanel control = new JPanel(new GridLayout(5, 1, 1, 1));
JPanel control_top = new JPanel(new GridLayout(1, 1, 1, 1));
mousePos = new JLabel("( , )");
bottom.add(mousePos, BorderLayout.WEST);
bottom.setVisible(true);
clear = new JButton("Apagar Tudo");
undo = new JButton("Apagar Último");
scale = new JButton("Escala");
rotateL = new JButton("Rotacionar -90°");
rotateR = new JButton("Rotacionar 90°");
start = end = null;
control.add(undo);
control.add(clear);
control.add(scale);
control.add(rotateL);
control.add(rotateR);
control_top.add(cp);
panel.add(control_top, BorderLayout.NORTH);
panel.add(control, BorderLayout.WEST);
dp.setLayout(new GridLayout());
dp.setVisible(true);
dp.setBorder(new CompoundBorder(new LineBorder(Color.BLACK), new EmptyBorder(0, 0, 20, 30)));
dp.setBackground(Color.WHITE);
panel.add(dp, BorderLayout.CENTER);
panel.setVisible(true);
panel.add(bottom, BorderLayout.SOUTH);
add(panel, BorderLayout.PAGE_START);
addMouseListener((MouseListener) this);
addMouseMotionListener((MouseMotionListener) this);
clear.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
if (clear == ae.getSource()) {
itemsDrawn.clear();
repaint();
}
}
});
undo.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
if (itemsDrawn.size() != 0) {
itemsDrawn.remove(itemsDrawn.size() - 1);
repaint();
}
}
});
scale.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
if (itemsDrawn.size() != 0) {
JPanel p = new JPanel(new BorderLayout(5, 5));
JPanel labels = new JPanel(new GridLayout(0, 1, 2, 2));
labels.add(new JLabel("Fator a:", SwingConstants.RIGHT));
labels.add(new JLabel("Fator b:", SwingConstants.RIGHT));
p.add(labels, BorderLayout.WEST);
JPanel controls = new JPanel(new GridLayout(0, 1, 2, 2));
JTextField a = new JTextField();
JTextField b = new JTextField();
controls.add(a);
controls.add(b);
p.add(controls, BorderLayout.CENTER);
JOptionPane.showMessageDialog(panel, p, "Escala", JOptionPane.QUESTION_MESSAGE);
double valorA = Double.parseDouble(a.getText());
double valorB = Double.parseDouble(b.getText());
Drawable drawable = itemsDrawn.get(itemsDrawn.size() - 1);
Rectangle ret = drawable.getBounds();
int x1 = (int)ret.getX();
int x2 = (int)ret.getX() + ret.getSize().width;
int y1 = (int)ret.getY();
int y2 = (int)ret.getY() + ret.getSize().height;
int deltaX = x2 - x1;
int deltaY = y2 - y1;
int novox2 = (int)(Math.round(deltaX * valorA));
int novoy2 = (int)(Math.round(deltaY * valorB));
x2 = novox2 + x1;
y2 = novoy2 + y1;
drawable.setSize(new Dimension(x2-x1,y2-y1));
repaint();
} else {
JPanel p1 = new JPanel(new BorderLayout(5, 5));
JPanel labels1 = new JPanel(new GridLayout(0, 1, 2, 2));
labels1.add(new JLabel("Nenhum desenho encontrado!", SwingConstants.CENTER));
p1.add(labels1,BorderLayout.WEST);
JOptionPane.showMessageDialog(panel,p1,"Messagem de erro", JOptionPane.QUESTION_MESSAGE);
}
}
});
rotateL.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
if (itemsDrawn.size() != 0) {
int grau = -90;
Drawable drawable = itemsDrawn.get(itemsDrawn.size() - 1);
double angle = Math.toRadians(grau);
double x = drawable.getBounds().getCenterX();
double y = drawable.getBounds().getCenterY();
AffineTransform at = AffineTransform.getRotateInstance(angle, x, y);
Shape rotatedRect = at.createTransformedShape(drawable.getBounds());
drawable.setBounds(rotatedRect.getBounds());
repaint();
} else {
JPanel p1 = new JPanel(new BorderLayout(5, 5));
JPanel labels1 = new JPanel(new GridLayout(0, 1, 2, 2));
labels1.add(new JLabel("Nenhum desenho encontrado!", SwingConstants.CENTER));
p1.add(labels1,BorderLayout.WEST);
JOptionPane.showMessageDialog(panel,p1,"Messagem de erro", JOptionPane.QUESTION_MESSAGE);
}
}
});
rotateR.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
if (itemsDrawn.size() != 0) {
int grau = 90;
Drawable drawable = itemsDrawn.get(itemsDrawn.size() - 1);
double angle = Math.toRadians(grau);
double x = drawable.getBounds().getCenterX();
double y = drawable.getBounds().getCenterY();
AffineTransform at = AffineTransform.getRotateInstance(angle, x, y);
Shape rotatedRect = at.createTransformedShape(drawable.getBounds());
drawable.setBounds(rotatedRect.getBounds());
repaint();
} else {
JPanel p1 = new JPanel(new BorderLayout(5, 5));
JPanel labels1 = new JPanel(new GridLayout(0, 1, 2, 2));
labels1.add(new JLabel("Nenhum desenho encontrado!", SwingConstants.CENTER));
p1.add(labels1,BorderLayout.WEST);
JOptionPane.showMessageDialog(panel,p1,"Messagem de erro", JOptionPane.QUESTION_MESSAGE);
}
}
});
}
public static void main(String[] args) {
// Criando o Frame.
JFrame frame = new JFrame("Paint - UIT - Computação Gráfica");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// Crie componentes e coloque-os no quadro.
final Paint drawing = new Paint();
final JLabel coordinates = new JLabel("Mouse Coordenadas");
coordinates.setForeground(Color.BLUE);
frame.add(coordinates, BorderLayout.SOUTH);
frame.setLayout(new BorderLayout());
frame.add(drawing, BorderLayout.NORTH);
// Dimensione a moldura.
frame.pack();
// Centraliza um quadro na tela.
frame.setLocationRelativeTo(null);
// Mostrar.
frame.setVisible(true);
}
public void mousePressed(MouseEvent e) {
throw new UnsupportedOperationException("Não implementado.");
}
public void mouseDragged(MouseEvent e) {
throw new UnsupportedOperationException("Não implementado.");
}
public void mouseReleased(MouseEvent e) {
throw new UnsupportedOperationException("Não implementado.");
}
public class State {
private final Color foreground, background;
private final boolean gradient, filled, dashed;
private final int lineWidth, dashLength;
public State(Color foreground, Color background, boolean gradient, boolean filled, boolean dashed,
int lineWidth, int dashLength) {
this.foreground = foreground;
this.background = background;
this.gradient = gradient;
this.filled = filled;
this.dashed = dashed;
this.lineWidth = lineWidth;
this.dashLength = dashLength;
}
public Color getForeground() {
return foreground;
}
public Color getBackground() {
return background;
}
public boolean isGradient() {
return gradient;
}
public boolean isFilled() {
return filled;
}
public boolean isDashed() {
return dashed;
}
public int getLineWidth() {
return lineWidth;
}
public int getDashLength() {
return dashLength;
}
}
public class ControlPanel extends JPanel {
public final JComboBox shapes;
private final JButton foreground, background;
private final JCheckBox gradient, filled, dashed;
private final JTextField lineWidth, dashLength;
private final JLabel width, dash;
private JPanel panel;
private DrawPanel drawPanel;
public ControlPanel(DrawPanel panel) {
shapes = new JComboBox<String>(new String[] { "Rectangle", "Oval", "Line" });
foreground = new JButton("Primeira Cor");
foreground.setBackground(Color.BLACK);
foreground.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
foreground.setBackground(JColorChooser.showDialog(null, "Escolha sua cor", Color.BLACK));
}
});
background = new JButton("Segunda Cor");
background.setBackground(Color.WHITE);
background.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
background.setBackground(JColorChooser.showDialog(null, "Escolha sua cor", Color.BLACK));
}
});
gradient = new JCheckBox("Usar Gradiente");
filled = new JCheckBox("Preenchidos");
dashed = new JCheckBox("Tracejadas");
dashLength = new JTextField("10");
lineWidth = new JTextField("2");
dash = new JLabel("Comprimento do Traço:");
width = new JLabel("Espessura da Linha:");
JPanel newpanel = new JPanel();
newpanel.add(foreground);
newpanel.add(background);
newpanel.add(filled);
setLayout(new FlowLayout());
GridBagConstraints gbc = new GridBagConstraints();
gbc.gridwidth = GridBagConstraints.REMAINDER;
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.weightx = 1;
add(new JLabel("Forma: "));
add(shapes, gbc);
add(newpanel, gbc);
gbc.weighty = 1;
gbc.anchor = GridBagConstraints.NORTH;
add(gradient, gbc);
add(dashed, gbc);
add(dash);
add(dashLength);
add(width);
add(lineWidth);
this.drawPanel = panel;
MouseHandler mouseHandler = new MouseHandler();
drawPanel.addMouseListener(mouseHandler);
drawPanel.addMouseMotionListener(mouseHandler);
}
public int getDash() {
String length = dashLength.getText();
int dash = Integer.parseInt(length);
return dash;
}
public int getLine() {
String width = lineWidth.getText();
int line = Integer.parseInt(width);
return line;
}
protected Drawable createDrawable() {
Drawable drawable = null;
State state = new State(foreground.getBackground(), background.getBackground(), gradient.isSelected(),
filled.isSelected(), dashed.isSelected(), getLine(), getDash());
String selected = (String) shapes.getSelectedItem();
if ("Rectangle".equalsIgnoreCase(selected)) {
drawable = new MyRectangle(state);
} else if ("Oval".equalsIgnoreCase(selected)) {
drawable = new MyOval(state);
} else if ("Line".equalsIgnoreCase(selected)) {
drawable = new MyLine(state);
}
return drawable;
}
public class MouseHandler extends MouseAdapter {
private Drawable drawable;
private Point clickPoint;
public void mousePressed(MouseEvent e) {
drawable = createDrawable();
drawable.setLocation(e.getPoint());
drawPanel.addDrawable(drawable);
clickPoint = e.getPoint();
String position = "(" + e.getX() + "," + e.getY() + ")";
mousePos.setText(position);
}
public void mouseDragged(MouseEvent e) {
Point drag = e.getPoint();
Point /* start */
start = clickPoint;
int maxX = Math.max(drag.x, start.x);
int maxY = Math.max(drag.y, start.y);
int minX = Math.min(drag.x, start.x);
int minY = Math.min(drag.y, start.y);
int width = maxX - minX;
int height = maxY - minY;
if (shapes.getSelectedItem().equals("Line")) {
drawable.setLocation(start);
drawable.setSize(new Dimension(drag.x - start.x, drag.y - start.y));
} else {
drawable.setLocation(new Point(minX, minY));
drawable.setSize(new Dimension(width, height));
}
String position = "(" + start.x + "," + start.y + ") - (" + drag.x + "," + drag.y + ")";
mousePos.setText(position);
drawPanel.repaint();
}
public void mouseMoved(MouseEvent e) {
String position = "(" + e.getPoint().x + "," + e.getPoint().y + ")";
mousePos.setText(position);
}
}
}
public interface Drawable {
public void paint(JComponent parent, Graphics2D g2d);
public void setLocation(Point location);
public void setSize(Dimension size);
public State getState();
public Rectangle getBounds();
public void setBounds(Rectangle rec);
}
public abstract class AbstractDrawable implements Drawable {
private Rectangle bounds;
private State state;
public void setBounds(Rectangle rec){
this.bounds = rec;
}
public AbstractDrawable(State state) {
bounds = new Rectangle();
this.state = state;
}
public State getState() {
return state;
}
public abstract Shape getShape();
public void setLocation(Point location) {
bounds.setLocation(location);
}
public void setSize(Dimension size) {
bounds.setSize(size);
}
public Rectangle getBounds() {
return bounds;
}
public void paint(JComponent parent, Graphics2D g2d) {
Shape shape = getShape();
State state = getState();
Rectangle bounds = getBounds();
final BasicStroke dashed = new BasicStroke(state.lineWidth, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0,
new float[] { state.dashLength }, 0);
final BasicStroke solid = new BasicStroke(state.lineWidth);
g2d.setPaint(state.getForeground());
g2d.setStroke(solid);
if (state.isGradient() && bounds.width > 0 && bounds.height > 0) {
Point2D startPoint = new Point2D.Double(bounds.x, bounds.y);
Point2D endPoint = new Point2D.Double(bounds.x + bounds.width, bounds.y + bounds.height);
LinearGradientPaint gp = new LinearGradientPaint(startPoint, endPoint, new float[] { 0f, 1f },
new Color[] { state.getForeground(), state.getBackground() });
g2d.setPaint(gp);
}
if (state.isFilled()) {
g2d.fill(shape);
}
if (state.isDashed()) {
g2d.setStroke(dashed);
}
g2d.draw(shape);
}
}
public class MyRectangle extends AbstractDrawable {
public MyRectangle(State state) {
super(state);
}
@Override
public Shape getShape() {
return getBounds();
}
}
public class MyOval extends AbstractDrawable {
public MyOval(State state) {
super(state);
}
@Override
public Shape getShape() {
Rectangle bounds = getBounds();
return new Ellipse2D.Float(bounds.x, bounds.y, bounds.width, bounds.height);
}
}
public class MyLine extends AbstractDrawable {
public MyLine(State state) {
super(state);
}
@Override
public Shape getShape() {
Rectangle bounds = getBounds();
return new Line2D.Float(bounds.x, bounds.y, bounds.x + bounds.width, bounds.y + bounds.height);
}
}
public class DrawPanel extends JPanel {
public DrawPanel() {
itemsDrawn = new ArrayList<Drawable>();
}
@Override
public Dimension getPreferredSize() {
return new Dimension(500, 500);
}
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D g2d = (Graphics2D) g.create();
for (Drawable d : itemsDrawn) {
d.paint(this, g2d);
}
g2d.dispose();
}
public void addDrawable(Drawable drawable) {
itemsDrawn.add(drawable);
repaint();
}
}
Point start, end;
public void mouseMoved(MouseEvent arg0) {
}
public void mouseClicked(MouseEvent arg0) {
}
public void mouseEntered(MouseEvent arg0) {
}
public void mouseExited(MouseEvent arg0) {
}
}
| [
"fgeraldo11@gmail.com"
] | fgeraldo11@gmail.com |
ad1d6d13012e93195aa081a165101e2f877b5fad | a6905dac448afddfc148db85d4d0f35f3af77345 | /USACO_Problems/src/main/java/SocDist.java | 6689219f9e2be12fcc4ca2c9023b158281f882d6 | [] | no_license | Compsciler/USACO | 8ba6d2e18a3d178d62557fb93e6f8a980a7a5f3d | 65dda3b85cb53486a3971923d4e31114a3774ba7 | refs/heads/master | 2022-04-12T18:39:39.448048 | 2020-03-31T15:53:50 | 2020-03-31T15:53:50 | 241,198,072 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,870 | java | import java.io.*;
import java.util.*;
public class SocDist {
public static int N;
public static ArrayList<ArrayList<Long>> grass;
public static void main(String[] args) throws IOException {
BufferedReader f = new BufferedReader(new FileReader("socdist.in"));
PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("socdist.out")));
StringTokenizer st = new StringTokenizer(f.readLine());
N = Integer.parseInt(st.nextToken());
int M = Integer.parseInt(st.nextToken());
grass = new ArrayList<>();
for (int i = 0; i < M; i++) {
st = new StringTokenizer(f.readLine());
ArrayList<Long> sublist = new ArrayList<>();
sublist.add(Long.parseLong(st.nextToken()));
sublist.add(Long.parseLong(st.nextToken()));
grass.add(sublist);
}
/*
ArrayList<Long> sublist1 = new ArrayList<>();
ArrayList<Long> sublist2 = new ArrayList<>();
ArrayList<Long> sublist3 = new ArrayList<>();
sublist1.add(4L);
sublist1.add(7L);
grass.add(sublist1);
sublist2.add(9L);
sublist2.add(9L);
grass.add(sublist2);
sublist3.add(0L);
sublist3.add(2L);
grass.add(sublist3);
*/
Comparator<ArrayList<Long>> sortByStart = new Comparator<ArrayList<Long>>(){
@Override
public int compare(ArrayList<Long> interval1, ArrayList<Long> interval2){
return interval1.get(0).compareTo(interval2.get(0));
}
};
Collections.sort(grass, sortByStart);
// printGrass();
long maxDPossible = 1000000000000000000L;
// out.println(binarySearch(2, maxDPossible, 1));
out.println(seqSearch());
out.close();
}
public static int exponentialSearch(int arr[], int n, int x){
if (arr[0] == x)
return 0;
int i = 1;
while (i < n && arr[i] <= x){
i = i*2;
}
return Arrays.binarySearch(arr, i/2, Math.min(i, n), x);
}
public static long binarySearch(long l, long r, long largestD){
if (r >= l) {
long mid = l + (r - l) / 2;
if (isValid(mid)){
return binarySearch(mid + 1, r, mid);
}
return binarySearch(l, mid - 1, largestD);
}
return largestD;
}
public static long seqSearch(){
long D = 1;
while (true){
if (!isValid(D)){
return D - 1;
}
D++;
}
}
public static boolean isValid(long D){
/*
if (D <= 100){
System.out.print(D + ": ");
}
*/
long previousCow = grass.get(0).get(0);
int currentInterval = 0;
for (int i = 1; i < N; i++) {
long currentCow = previousCow + D;
if (currentCow > grass.get(currentInterval).get(1)){
currentInterval++;
try {
while (currentCow > grass.get(currentInterval).get(0)){
currentInterval++;
}
} catch (IndexOutOfBoundsException e){
/*
if (D <= 100){
System.out.println(false);
}
*/
return false;
}
currentCow = grass.get(currentInterval).get(0);
}
previousCow = currentCow;
}
/*
if (D <= 100){
System.out.println(true);
}
*/
return true;
}
public static void printGrass(){
for (ArrayList arr: grass){
System.out.println(arr.get(0) + " " + arr.get(1));
}
}
}
| [
"rogerwang2520@gmail.com"
] | rogerwang2520@gmail.com |
57eede263b84254608c937b30a7896997beab8af | 5e5790ec25f4be0c2177596dd877d4c3701ced42 | /app/models/Pool.java | 3add710bcba389d00cae1c5c6b662bd1bbd5b2e6 | [] | no_license | Perecastors/testProHistory | eda7b598af535ffcb3a9d6f1b0744fd8117bdd69 | 8014bb140059b87391a88af023bb62fff0ba0407 | refs/heads/master | 2021-01-12T17:27:46.867808 | 2016-12-06T10:37:28 | 2016-12-06T10:37:28 | 71,574,876 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 274 | java | package models;
import play.db.jpa.Model;
public class Pool extends Model {
public Champion championTop;
public Champion championJungle;
public Champion championMid;
public Champion championAdc;
public Champion championSupport;
public int note;
}
| [
"auron2504@hotmail.fr"
] | auron2504@hotmail.fr |
32eb610e69ac9180ddf125e163e7e3bfa7a1ab0e | f1ef574490325b9da98bbfa7f5a89972fc46cf68 | /DBPlatform/src/test/CustomerServiceImplTest.java | 22d99fe16743a2c17e2cae04836a40fd6f51dcf1 | [] | no_license | JadeQiong/MySQL_Homework | e3117cc437e0e7a322c7222961e9d0e83375d6aa | e99b8b9c779e629a1f95368b137434ad3f764394 | refs/heads/master | 2022-12-12T18:09:19.088482 | 2020-08-24T15:34:48 | 2020-08-24T15:34:48 | 289,967,280 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 565 | java | package test;
import Service.CustomerService;
import Service.IMPL.CustomerServiceImpl;
import dao.IMPL.customerdaoImpl;
import dao.customerdao;
import domain.Customer;
import org.junit.Test;
import static org.junit.Assert.*;
public class CustomerServiceImplTest {
CustomerService c=new CustomerServiceImpl();
@Test
public void login() {
System.out.println(c.login("12345","12345"));
}
@Test
public void register() {
Customer cu=new Customer("hhh","123999","123123","gz","222222",1000.0);
c.register(cu);
}
} | [
"volnut@163.com"
] | volnut@163.com |
1d01b93667d4ca09281c10a2f602a1e7ad5148f8 | 3bbf1e6c86734e3d60123128fe5e8a5588c1d582 | /src/main/java/com/emanuel/biblioteca/novousuario/Usuario.java | 04f539c51b4535a801aaeaecc805f2c6ca1df032 | [] | no_license | EmanuelAlves/biblioteca-cdd | e0e7a5264bb7e7e071bb944589ce5d66ee76297c | 285bae2f8d90d81e6122580ae92b4e5d43734995 | refs/heads/main | 2023-03-25T23:35:16.109007 | 2021-03-14T01:26:35 | 2021-03-14T01:26:35 | 332,923,036 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 690 | java | package com.emanuel.biblioteca.novousuario;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.validation.constraints.NotNull;
import org.springframework.util.Assert;
@Entity
public class Usuario {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private @NotNull TipoUsuario tipo;
public Usuario() {}
public Usuario(@NotNull TipoUsuario tipo) {
this.tipo = tipo;
}
public Long getId() {
Assert.state(id != null, "O id não pode ser null." );
return id;
}
public boolean padrao() {
return this.tipo.equals(TipoUsuario.PADRAO);
}
}
| [
"emanuel.alvesc@gmail.com"
] | emanuel.alvesc@gmail.com |
35aa74e403c139fc85a97e1ed4a74b846c2ff52f | 50ba295ae36de44e0b7a7e7b4d7991ceeb407e8c | /base/src/main/java/com/er/base/repository/search/PerExcuseSearchRepository.java | 273703e4fdbecb201495e913cf5df1e1b546d7f6 | [] | no_license | asimerkut/base | de628407995cc9717d8420e0640e6ee421bb2cf7 | dc2472b0c737a75217d1df0d245601482b4a6b1d | refs/heads/master | 2020-04-01T21:43:30.645849 | 2018-11-11T13:04:58 | 2018-11-11T13:04:58 | 153,672,040 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 330 | java | package com.er.base.repository.search;
import com.er.base.domain.PerExcuse;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
/**
* Spring Data Elasticsearch repository for the PerExcuse entity.
*/
public interface PerExcuseSearchRepository extends ElasticsearchRepository<PerExcuse, Long> {
}
| [
"asm"
] | asm |
6e157d504cca02364228b25910b979027e54faae | dad248133597794a3f7eafd2fcbe774675e6d0e4 | /src/main/java/com/elena/project/repository/PersistenceAuditEventRepository.java | a056578b5ba27b529698dc4c8e2334418865f4c2 | [] | no_license | elenadobrescu21/JHipsterApp | bb10ff86b18152b80f76a670f6113287f641f7e2 | 674510470ed409a37e46c276482cd94892c5d1d6 | refs/heads/master | 2021-01-02T08:38:30.138682 | 2017-08-01T20:05:10 | 2017-08-01T20:05:10 | 99,038,418 | 0 | 1 | null | 2020-09-18T07:54:48 | 2017-08-01T20:00:40 | Java | UTF-8 | Java | false | false | 1,011 | java | package com.elena.project.repository;
import com.elena.project.domain.PersistentAuditEvent;
import java.time.LocalDateTime;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import java.util.List;
/**
* Spring Data JPA repository for the PersistentAuditEvent entity.
*/
public interface PersistenceAuditEventRepository extends JpaRepository<PersistentAuditEvent, Long> {
List<PersistentAuditEvent> findByPrincipal(String principal);
List<PersistentAuditEvent> findByAuditEventDateAfter(LocalDateTime after);
List<PersistentAuditEvent> findByPrincipalAndAuditEventDateAfter(String principal, LocalDateTime after);
List<PersistentAuditEvent> findByPrincipalAndAuditEventDateAfterAndAuditEventType(String principle, LocalDateTime after, String type);
Page<PersistentAuditEvent> findAllByAuditEventDateBetween(LocalDateTime fromDate, LocalDateTime toDate, Pageable pageable);
}
| [
"elenadobrescu@192-168-0-102.rdsnet.ro"
] | elenadobrescu@192-168-0-102.rdsnet.ro |
b20e24884116608fe449dec9e926bbd8e527920f | f7d61c54e8c3f1a7effa4d0207e78c7b75d16014 | /struts206DataCheck20181016/src/com/fpq/action/resultType/ResultTypeAction.java | e021294cbd6aa0dd6885cabeea45b0cac6d4ee08 | [] | no_license | fupq/fpqStruts2 | acb38cb8ac591e934e514bf950cce57be8b18344 | d5fe7a1b644cdf681b5710234dfbaef1596d22b7 | refs/heads/master | 2020-04-03T12:07:41.365357 | 2018-10-29T16:19:03 | 2018-10-29T16:19:03 | 155,241,953 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,433 | java | /**@Description:
* @Title: ResultTypeAction.java
* @Package com.fpq.action.resultType
* @author: 付品欣
* @date: 2018年10月20日 下午12:58:08
* @Copyright: 2018 com.fpq
*/
package com.fpq.action.resultType;
import com.opensymphony.xwork2.ActionSupport;
/**@Description:TODO(这里用一句话描述这个类的作用)
* @ClassName: ResultTypeAction
* @author: 付品欣
* @date: 2018年10月20日 下午12:58:08
*
* @Copyright: 2018 com.fpq
* http://localhost:8080/struts206DataCheck20181016/resultType/ResultType_execute.action
*
*/
public class ResultTypeAction extends ActionSupport {
/**
* <p>Title: execute</p>
* <p>Description: </p>
* @return
* @see com.opensymphony.xwork2.ActionSupport#execute()
* http://localhost:8080/struts206DataCheck20181016/resultType/ResultType_execute.action
*/
public String execute() {
System.out.println("ResultTypeAction:dispatcher:默认类型,运用服务器跳转,(只能)跳转到jsp页面,html页面,freemarker页面等页面 ,常用");
return SUCCESS;
}
/**
* @Description:
* @Title: dispatcher
* @return
* @throws
* http://localhost:8080/struts206DataCheck20181016/resultType/ResultType_dispatcher.action
*/
public String dispatcher() {
System.out.println("ResultTypeAction:dispatcher:默认类型,运用服务器跳转,(只能)跳转到jsp页面,html页面,freemarker页面等页面 ,常用");
return "dispatcher";
}
/**
* @Description:
* @Title: redirect
* @return
* @throws
* http://localhost:8080/struts206DataCheck20181016/resultType/ResultType_redirect.action
*/
public String redirect() {
System.out.println("ResultTypeAction:redirect:(只能)重定向到视图或页面,常用");
return "redirect";
}
/**
* @Description:
* @Title: chain
* @return
* @throws
* http://localhost:8080/struts206DataCheck20181016/resultType/ResultType_chain.action
*/
public String chain() {
System.out.println("chain:forward到一个action,不常用,跳转到ResultTypeActionDispatcher");
return "chain";
}
/**
* @Description:
* @Title: redirectAtion
* @return
* @throws
* http://localhost:8080/struts206DataCheck20181016/resultType/ResultType_redirectAction.action
*/
public String redirectAction() {
System.out.println("redirectAction:客户端跳转到一个Action,不常用");
return "redirectAct";
}
}
| [
"850779566@qq.com"
] | 850779566@qq.com |
84ab0088555563af427465fce6a2e8c02863a98f | d76e04a54100c141ebc4192ecfdc52aa3411c774 | /src/site/zhguixin/algo/lru/LruCacheLinkedHashMap.java | c36cac3510bcb48f1cd677548b258972fd78c391 | [] | no_license | zhguixin/algo | d353bea014eff6f1d1bb053907d7a547d5e2ba77 | 0d3c487af719baad4f8afdc553958003243451f2 | refs/heads/master | 2022-12-20T10:44:12.152618 | 2020-09-17T06:04:56 | 2020-09-17T06:04:56 | 280,153,119 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 714 | java | package site.zhguixin.algo.lru;
import java.util.LinkedHashMap;
import java.util.Map;
// LinkedHashMap的accessOrder为true, 可以按访问顺序把元素移动到前面
public class LruCacheLinkedHashMap<K,V> extends LinkedHashMap<K,V> {
private int cacheSize;
public LruCacheLinkedHashMap(int cap) {
super(16, 0.75f, true);
cacheSize = cap;
}
// 覆写该方法, 大于cacheSize时, 移除最后一个节点
@Override
protected boolean removeEldestEntry(Map.Entry<K,V> eldest) {
return size() >= cacheSize;
}
public void putCache(K key, V val) {
this.put(key, val);
}
public V getCache(K key) {
return this.get(key);
}
}
| [
"zhguixin@163.com"
] | zhguixin@163.com |
2ca84d9ded53fe0391671c699137b0725670f64c | 0a3234e0ddf10afcceb60fb8a3aa7af9c8e62d41 | /app/src/main/java/com/example/processmanagerdemo/ListAdapter.java | 27e2495f42381f9dadef1032fc4f0a68b4b06315 | [] | no_license | hbhatt687/AndroidProcessKiller | c645e1dfb150f9ea5d93a2ec0cc9cbe16bdc0ded | e5d9a3af8b4a7699bd59c6f6ada178ae3054c8b3 | refs/heads/master | 2020-05-15T13:26:23.465183 | 2019-04-26T01:11:21 | 2019-04-26T01:11:21 | 182,301,198 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,332 | java | package com.example.processmanagerdemo;
import java.util.List;
import android.app.ActivityManager.RunningAppProcessInfo;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.app.ActivityManager;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import com.example.processmanagerdemo.R;
public class ListAdapter extends ArrayAdapter<RunningAppProcessInfo> {
// List context
private final Context context;
// List values
private final List<RunningAppProcessInfo> values;
public ListAdapter(Context context, List<RunningAppProcessInfo> values) {
super(context, R.layout.activity_main, values);
this.context = context;
this.values = values;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
LayoutInflater inflater = (LayoutInflater)
context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View rowView = inflater.inflate(R.layout.activity_main, parent, false);
TextView appName = (TextView) rowView.findViewById(R.id.appNameText);
int pid = getItem(position).pid;
appName.setText("Name: " + values.get(position).processName + ", PID: " + pid);
return rowView;
}
}
| [
"hbhatt687@gmail.com"
] | hbhatt687@gmail.com |
fbfa7c84e34b2274605de7a69ab22ba3c1180343 | a0c41b153324f2dd52af402914c747d0cdc5ab40 | /PJ/app/build/generated/data_binding_base_class_source_out/debug/out/vn/edu/usth/pj/databinding/SettingsActivityBinding.java | 3995b3fa792124e7335cd473f86ff50f932d2a10 | [] | no_license | longlp21/AndroidApp | 5143e4d14d282c7b9b1ad443a50dabe8d96010fd | dd2f02a07b311d8db7f2a379a18c8c66b86eec3b | refs/heads/main | 2023-08-29T09:45:53.724433 | 2021-11-09T01:40:32 | 2021-11-09T01:40:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,087 | java | // Generated by view binder compiler. Do not edit!
package vn.edu.usth.pj.databinding;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.viewbinding.ViewBinding;
import androidx.viewbinding.ViewBindings;
import java.lang.NullPointerException;
import java.lang.Override;
import java.lang.String;
import vn.edu.usth.pj.R;
public final class SettingsActivityBinding implements ViewBinding {
@NonNull
private final LinearLayout rootView;
@NonNull
public final FrameLayout settings;
private SettingsActivityBinding(@NonNull LinearLayout rootView, @NonNull FrameLayout settings) {
this.rootView = rootView;
this.settings = settings;
}
@Override
@NonNull
public LinearLayout getRoot() {
return rootView;
}
@NonNull
public static SettingsActivityBinding inflate(@NonNull LayoutInflater inflater) {
return inflate(inflater, null, false);
}
@NonNull
public static SettingsActivityBinding inflate(@NonNull LayoutInflater inflater,
@Nullable ViewGroup parent, boolean attachToParent) {
View root = inflater.inflate(R.layout.settings_activity, parent, false);
if (attachToParent) {
parent.addView(root);
}
return bind(root);
}
@NonNull
public static SettingsActivityBinding bind(@NonNull View rootView) {
// The body of this method is generated in a way you would not otherwise write.
// This is done to optimize the compiled bytecode for size and performance.
int id;
missingId: {
id = R.id.settings;
FrameLayout settings = ViewBindings.findChildViewById(rootView, id);
if (settings == null) {
break missingId;
}
return new SettingsActivityBinding((LinearLayout) rootView, settings);
}
String missingId = rootView.getResources().getResourceName(id);
throw new NullPointerException("Missing required view with ID: ".concat(missingId));
}
}
| [
"nghoangminh1905@gmail.com"
] | nghoangminh1905@gmail.com |
fb98e85bdc38852812e3e243be51d0df4d28922a | 37f53c7ace8c5ffe2e76e168c970ec0cd545e369 | /CSC152/Carter_HW2/Carter_Inheritance.java | 817b20d69e4e8df31cfa4fa21119eecc7721a14d | [] | no_license | nicoh-carter/Java-Projects | b11fd0372dcfb7ae44b4408683a41ac0c3c92d21 | ce646a4f4d6242833ea466e237120eb87c62692a | refs/heads/master | 2022-12-01T05:05:54.192470 | 2020-08-24T19:46:25 | 2020-08-24T19:46:25 | 289,976,487 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 950 | java | //Nicoh Carter's Driver Application
public class Carter_Inheritance
{
public static void main(String args[])
{
//declared variables
int lengthR = 20;
int widthR = 50;
//created object
Rectangle rect1 = new Rectangle(lengthR, widthR);
//printed current state of rectangle object
System.out.println("Rectangle object's info: " + rect1.toString() + "\n");
//changed length to 25
lengthR = 25;
rect1.setLength(lengthR);
//updated current state of rectangle object
System.out.println("Rectangle object's info after update: " + rect1.toString() + "\n");
int sides = 20;
Cube cuboid = new Cube(sides);
System.out.println("Cube object's info: " + cuboid.toString() + "\n");
sides = 15;
cuboid.setLength(15);
System.out.println("Cube object's info after update: " + cuboid.toString());
}
} | [
"carternicoh@gmail.com"
] | carternicoh@gmail.com |
a2d956e2630820a64e9040f962b374fcd0ec25ad | 8c97cf95e48d80e8de759436e2a674ac162b28ac | /src/BugRegressionSuite/LocationShownOnDrawerScreen_Sno_35.java | 6d60839bbde7009da205a93f00dc229f7c2bd1b0 | [] | no_license | argneshu/androidFramework_1 | fce088bd6f8205a753c656d499fbf67c40c71236 | 187154b58f05131861fff1649f23d6a3455a638b | refs/heads/master | 2021-01-11T15:36:51.194293 | 2017-01-24T10:12:48 | 2017-01-24T10:12:48 | 79,899,294 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,610 | java | package BugRegressionSuite;
import org.openqa.selenium.By;
import org.testng.AssertJUnit;
import org.testng.annotations.Test;
import Page_Objects.BugRegressionAppConstants;
public class LocationShownOnDrawerScreen_Sno_35 extends BaseTestBugRegression{
@Override
@Test
public void executeTestCase() throws Exception {
// TODO Auto-generated method stub
try{
clickId(BugRegressionAppConstants.Lets_Go_Shopping_Id);
clickName(BugRegressionAppConstants.DelhiLocation_text);
clickName(BugRegressionAppConstants.DelhiSubLocation_AnandLok_text);
//clickId(AppConstants.SkipButton_id);
clickClassName(BugRegressionAppConstants.Open_Navigation_Drawer);
AssertJUnit.assertEquals((String)driver.findElement(By.name(BugRegressionAppConstants.DelhiLocation_text)).getText(),(String)driver.findElement(By.name(BugRegressionAppConstants.NavDrawer_Location_text)).getText());
AssertJUnit.assertEquals((String)driver.findElement(By.name(BugRegressionAppConstants.DelhiSubLocation_AnandLok_text)).getText(),(String)driver.findElement(By.id(BugRegressionAppConstants.NavDrawer_SubLocation_id)).getText());
// System.out.println(driver.findElement(By.name(AppConstants.DelhiSubLocation_AnandLok_text)).getText());
// System.out.println(driver.findElement(By.id(AppConstants.NavDrawer_SubLocation_id)).getText());
clickId(BugRegressionAppConstants.NavDrawer_Login_button_id);
AssertJUnit.assertEquals("LOGIN", driver.findElement(By.name(BugRegressionAppConstants.Login_text)).getText());
// System.out.println("Test Stop");
}
catch(Exception e)
{
e.printStackTrace();
}
}
}
| [
"LP1-276@zoppers-MacBook-Pro-2.local"
] | LP1-276@zoppers-MacBook-Pro-2.local |
2f1e35fa6c1591066df77c372a01792222173a00 | 37161c02aee06d4eca1f0e1be14dd3bb06b4acd9 | /app/src/main/java/customer/tcrj/com/zsproject/base/BaseFragment.java | 8d50bc44c7e42943bb472c0184d5e3e1d45e29a2 | [] | no_license | atMen/zhyyProject | 1e8c2c68166f6ef809f538ffa776fe85ec097935 | 15dd2a9d4bdb4b32572e7767911c37ea797de35b | refs/heads/master | 2020-04-03T01:54:41.004327 | 2018-11-01T12:22:51 | 2018-11-01T12:22:51 | 154,129,339 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,102 | java | package customer.tcrj.com.zsproject.base;
import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.jaeger.library.StatusBarUtil;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import customer.tcrj.com.zsproject.R;
import customer.tcrj.com.zsproject.Utils.DialogHelper;
import customer.tcrj.com.zsproject.widget.MultiStateView;
import customer.tcrj.com.zsproject.widget.SimpleMultiStateView;
/**
* Created by leict on 2018/4/2.
*/
public abstract class BaseFragment extends Fragment {
@Nullable
@BindView(R.id.SimpleMultiStateView)
SimpleMultiStateView mSimpleMultiStateView;
protected View mRootView;
protected Dialog mLoadingDialog = null;
Unbinder unbinder;
protected static Context mContext;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
if (mRootView != null) {
ViewGroup parent = (ViewGroup) mRootView.getParent();
if (parent != null) {
parent.removeView(mRootView);
}
} else {
mRootView = createView(inflater, container, savedInstanceState);
}
mContext = mRootView.getContext();
mLoadingDialog = DialogHelper.getLoadingDialog(getActivity());
return mRootView;
}
public View createView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(setLayout(), container, false);
// StatusBarCompat.setStatusBarColor(getActivity(), getResources().getColor(R.color.red), true);
unbinder = ButterKnife.bind(this, view);
return view;
}
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
setView();
initStateView();
}
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
setData();
}
private void initStateView() {
if (mSimpleMultiStateView == null) return;
mSimpleMultiStateView.setEmptyResource(R.layout.view_empty)
.setRetryResource(R.layout.view_retry)
.setLoadingResource(R.layout.view_loading)
.setNoNetResource(R.layout.view_nonet)
.build()
.setonReLoadlistener(new MultiStateView.onReLoadlistener() {
@Override
public void onReload() {
onRetry();
}
});
}
public void onRetry(){};
/**
* 绑定布局
* @return
*/
protected abstract int setLayout();
/**
* 初始化组件
*/
protected abstract void setView();
/**
* 设置数据等逻辑代码
*/
protected abstract void setData();
public void showLoading() {
if (mSimpleMultiStateView != null) {
mSimpleMultiStateView.showLoadingView();
}
}
public void showEmptyView() {
if (mSimpleMultiStateView != null) {
mSimpleMultiStateView.showEmptyView();
}
}
public void showSuccess() {
if (mSimpleMultiStateView != null) {
mSimpleMultiStateView.showContent();
}
}
public void showFaild() {
if (mSimpleMultiStateView != null) {
mSimpleMultiStateView.showErrorView();
}
}
public void showNoNet() {
if (mSimpleMultiStateView != null) {
mSimpleMultiStateView.showNoNetView();
}
}
protected void showLoadingDialog() {
if (mLoadingDialog != null)
mLoadingDialog.show();
}
protected void showLoadingDialog(String str) {
if (mLoadingDialog != null) {
TextView tv = (TextView) mLoadingDialog.findViewById(R.id.tv_load_dialog);
tv.setText(str);
mLoadingDialog.show();
}
}
protected void hideLoadingDialog() {
if (mLoadingDialog != null && mLoadingDialog.isShowing()) {
mLoadingDialog.dismiss();
}
}
@Override
public void onDestroy() {
super.onDestroy();
unbinder.unbind();
}
/**
* Intent跳转
* @param context
* @param clazz
*/
protected void toClass(Context context, Class clazz){
toClass(context,clazz,null);
}
/**
* Intent带值跳转
* @param context
* @param clazz
* @param bundle
*/
protected void toClass(Context context, Class clazz, Bundle bundle){
Intent intent = new Intent(context,clazz);
if(bundle != null){
intent.putExtras(bundle);
}
startActivity(intent);
}
}
| [
"377044412@qq.com"
] | 377044412@qq.com |
20ecc6bf4aa47dfa75c2e3259fdebcf159cac077 | c69f7d4def27e73a47d6710e46cf032c6dbfe23f | /src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBlackBlock.java | 0fa9bf5e3bb823ae4613e612a7dfb9d88ada6109 | [
"MIT"
] | permissive | mphilipps/plantuml | 0499b5c74a34b664c73877bfeca136c7809bd6eb | fa32bd4c1b2070f4b64a00ae45c37fd6327a3cfb | refs/heads/master | 2020-04-02T05:19:35.164422 | 2016-08-03T14:27:19 | 2016-08-03T14:27:19 | 64,850,134 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,343 | java | /* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2017, Arnaud Roques
*
* Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
* Licensed under The MIT License (Massachusetts Institute of Technology License)
*
* See http://opensource.org/licenses/MIT
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
* IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*
* Original Author: Arnaud Roques
*/
package net.sourceforge.plantuml.activitydiagram3.ftile.vertical;
import java.util.Collections;
import java.util.Set;
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.URectangle;
public class FtileBlackBlock extends AbstractFtile {
private double width;
private double height;
private final HtmlColor colorBar;
private final Swimlane swimlane;
public FtileBlackBlock(boolean shadowing, HtmlColor colorBar, Swimlane swimlane) {
super(shadowing);
this.colorBar = colorBar;
this.swimlane = swimlane;
}
public void setDimenstion(double width, double height) {
this.height = height;
this.width = width;
}
public FtileGeometry calculateDimension(StringBounder stringBounder) {
return new FtileGeometry(width, height, width / 2, 0, height);
}
public void drawU(UGraphic ug) {
final URectangle rect = new URectangle(width, height, 5, 5);
if (shadowing()) {
rect.setDeltaShadow(3);
}
ug.apply(new UChangeColor(colorBar)).apply(new UChangeBackColor(colorBar)).draw(rect);
}
public Set<Swimlane> getSwimlanes() {
return Collections.singleton(swimlane);
}
public Swimlane getSwimlaneIn() {
return swimlane;
}
public Swimlane getSwimlaneOut() {
return swimlane;
}
}
| [
"mphilipps@saltation.de"
] | mphilipps@saltation.de |
d8267a423b63e725d5298a36303ec40602d206eb | f8c73d40b11c8329f7a7d1d2dae896576434938b | /tronsdk/src/main/java/com/centerprime/tronsdk/abi/datatypes/generated/Int144.java | e1da2e277d9790f5fa800faa4a63cd8ece963139 | [
"MIT"
] | permissive | centerprime/Tron-Android-SDK | e8559e6f44bee06c07df1a4a8313000f8f74acf7 | 6faaa72a31e9ccf9e8e31c49a5dfef70d9e74edb | refs/heads/master | 2023-03-14T14:58:58.467863 | 2021-03-09T02:37:55 | 2021-03-09T02:37:55 | 322,264,623 | 7 | 1 | null | 2021-03-09T02:37:55 | 2020-12-17T10:49:25 | Java | UTF-8 | Java | false | false | 623 | java | package com.centerprime.tronsdk.abi.datatypes.generated;
import com.centerprime.tronsdk.abi.datatypes.Int;
import java.math.BigInteger;
/**
* Auto generated code.
* <p><strong>Do not modifiy!</strong>
* <p>Please use org.web3j.codegen.AbiTypesGenerator in the
* <a href="https://github.com/web3j/web3j/tree/master/codegen">codegen module</a> to update.
*/
public class Int144 extends Int {
public static final Int144 DEFAULT = new Int144(BigInteger.ZERO);
public Int144(BigInteger value) {
super(144, value);
}
public Int144(long value) {
this(BigInteger.valueOf(value));
}
}
| [
"support@centerprime.technology"
] | support@centerprime.technology |
f2233488ee19d95cc69f874c6844669e0706154c | 2724c57419806b21475c33eac5323800497271a4 | /src/com/developer/group/adapter/AutoCompleteContactAdapter.java | 01e6a0008d6f67b46e3719a5f64c7034c728c165 | [] | no_license | rameez-github/AndroidApp | cbfabb2e541cce994505a9050e1b15d8be1e874e | b595a71610f38d49035d74d286a0fff12561fbe2 | refs/heads/master | 2021-01-01T19:25:20.466059 | 2014-10-12T18:13:20 | 2014-10-12T18:13:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,371 | java | package com.developer.group.adapter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import com.developer.model.ContactModel;
import com.example.androidapp.R;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Filter;
import android.widget.Filterable;
import android.widget.ImageView;
import android.widget.TextView;
public class AutoCompleteContactAdapter extends BaseAdapter implements Filterable {
public void addAllItems(List<HashMap<String, String>> myObjs) {
// TODO Auto-generated method stub
//Log.v("collection-length", "--- "+list.size());
fullList = myObjs;
mOriginalValues = new ArrayList<HashMap<String, String>>(fullList);
}
private LayoutInflater mInflater;
private List<HashMap<String, String>> fullList;
private List<HashMap<String, String>> mOriginalValues;
private ArrayFilter mFilter;
public AutoCompleteContactAdapter(Context context, List<HashMap<String, String>> objects) {
super();
mInflater = LayoutInflater.from(context);
fullList = (ArrayList<HashMap<String, String>>) objects;
mOriginalValues = new ArrayList<HashMap<String, String>>(fullList);
}
@Override
public int getCount() {
return fullList.size();
}
@Override
public HashMap<String, String> getItem(int position) {
return fullList.get(position);
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
final ViewHolder holder;
if (convertView == null) {
convertView = mInflater.inflate(R.layout.adapter_device_contact_item, null);
holder = new ViewHolder();
holder.user_pic = (ImageView) convertView.findViewById(R.id.new_contact_pic);
holder.name = (TextView) convertView.findViewById(R.id.textview_name);
holder.contact_number = (TextView) convertView.findViewById(R.id.textview_number);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
// set tag with hashmap, later use get tag in onItemClick callback
holder.name.setTag(fullList.get(position));
holder.name.setText(fullList.get(position).get(ContactModel.DEVICE_CONTACT_DISPLAY_NAME));
holder.contact_number.setText(fullList.get(position).get(ContactModel.DEVICE_CONTACT_DISPLAY_NUMBER));
//holder.user_pic.setImageResource(list.get(position).imgRes);
return convertView;
}
@Override
public Filter getFilter() {
if (mFilter == null) {
mFilter = new ArrayFilter();
}
return mFilter;
}
static class ViewHolder {
public ImageView user_pic;
public TextView name, contact_number;
}
private class ArrayFilter extends Filter {
private Object lock;
@Override
protected FilterResults performFiltering(CharSequence prefix) {
FilterResults results = new FilterResults();
if (mOriginalValues == null) {
synchronized (lock) {
mOriginalValues = new ArrayList<HashMap<String, String>>(fullList);
}
}
if (prefix == null || prefix.length() == 0) {
synchronized (lock) {
//Log.v("lock", "---");
ArrayList<HashMap<String, String>> list = new ArrayList<HashMap<String, String>>(mOriginalValues);
results.values = list;
results.count = list.size();
}
} else {
final String prefixString = prefix.toString().toLowerCase();
List<HashMap<String, String>> values = mOriginalValues;
int count = values.size();
//Log.v("else-lock", "--- "+count);
ArrayList<HashMap<String, String>> newValues = new ArrayList<HashMap<String, String>>(count);
for (int i = 0; i < count; i++) {
HashMap<String, String> item = values.get(i);
if (item.get(ContactModel.DEVICE_CONTACT_DISPLAY_NAME).toLowerCase().contains(prefixString)) {
newValues.add(item);
}
}
//Log.v("after-loop", "--- "+newValues.size());
results.values = newValues;
results.count = newValues.size();
}
return results;
}
@SuppressWarnings("unchecked")
@Override
protected void publishResults(CharSequence constraint, FilterResults results) {
//Log.v("publish-start", "---");
if(results.values!=null){
fullList = (ArrayList<HashMap<String, String>>) results.values;
}else{
fullList = new ArrayList<HashMap<String, String>>();
}
if (results.count > 0) {
//Log.v("publish-result", "---"+results.count);
notifyDataSetChanged();
} else {
//Log.v("publish-zero", "---");
notifyDataSetInvalidated();
}
}
}
@Override
public long getItemId(int position) {
// TODO Auto-generated method stub
return 0;
}
public void clear() {
// TODO Auto-generated method stub
fullList.clear();
fullList = null;
}
}
| [
"rameezin.play@gmail.com"
] | rameezin.play@gmail.com |
25f96acfc228e3cafce2c991e30e48b3e4a572ff | 84ad6116e569d929d3c52ee8e340e5be87703e11 | /nova-engine-support/nova-engine-support-springcloud/src/main/java/com/war3/nova/support/springcloud/CustomizedSpringCloudRoute.java | 0a356cb3b7111ac2f895d41bafc8b9de94fa2181 | [
"Apache-2.0"
] | permissive | Ruoxer/nova-engine | e9c321919ffc937e82387681d90513d68f5d1b4f | 1eb2b14c1f2e3486c9a970d00150d585a01e260b | refs/heads/master | 2020-04-14T20:11:15.147907 | 2019-01-14T08:37:39 | 2019-01-14T08:37:39 | 164,084,817 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,474 | java | package com.war3.nova.support.springcloud;
import java.util.HashMap;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.war3.nova.Constants;
import com.war3.nova.NovaException;
import com.war3.nova.Result;
import com.war3.nova.core.customized.BooleanResult;
import com.war3.nova.core.customized.ObjectResult;
import com.war3.nova.core.customized.route.CustomizedRoute;
import com.war3.nova.core.customized.route.RouteParameter;
import com.war3.nova.core.util.Novas;
import com.war3.nova.core.util.Strings;
/**
* 自定义路由
*
* @author Cytus_
* @since 2018年12月21日 上午10:53:18
* @version 1.0
*/
@Service
public class CustomizedSpringCloudRoute implements CustomizedRoute {
private final static Logger logger = LoggerFactory.getLogger(CustomizedSpringCloudRoute.class);
@Autowired
private ResttemplateHttpClient httpClient;
@Override
public Result<?> execute(RouteParameter routeParameter) throws NovaException {
String url = (String) routeParameter.getExtParams().get("url");
if (Strings.isEmpty(url)) {
logger.error("当前任务配置的url为空!");
return ObjectResult.createFailure(Constants.SYSTEM_ERROR_CODE, "当前任务配置的url为空!");
}
Map<String, Object> extMap = Novas.removeKeys(routeParameter.getExtParams(), "Content-Type", "url");
Map<String, Object> dataMap = new HashMap<>();
dataMap.put("bizSerno", routeParameter.getBizSerno());
dataMap.put("extParams", extMap);
logger.info("当前调用的url[{}], 传入的参数为:{}", url, dataMap);
try {
String returnString = httpClient.postCall(url, (String) routeParameter.getExtParams().get("Content-Type"), dataMap);
logger.info("当前调用的url[{}], 返回的信息为:{}", url, returnString);
return BooleanResult.createSuccess(Boolean.valueOf(returnString));
} catch (Exception e) {
String errorMsg = Novas.formatMessage("当前URL[{}], 调用失败! cause by:{}", url, e.getMessage());
logger.error(errorMsg, e);
return ObjectResult.createFailure(Constants.SYSTEM_ERROR_CODE, errorMsg);
}
}
}
| [
"Cytus_@windows10.microdone.cn"
] | Cytus_@windows10.microdone.cn |
30ef24b94e1d3c46d633620da99778b0261e0cf4 | 2ea18d7d27f20631bd72294d59ca2fd90a46cf82 | /SafeLanding/me/hiro/safelanding/SafeLandingAir.java | f1bf677908c2b29314cfd928042f1b015bd2cad5 | [] | no_license | EmreNtm/ProjectKorra-Addon-Abilities | bd992f7f7dafcafec1ff687f6063910ff56d9350 | 8625d1f590499353a41da22a0d4d34daa09555c5 | refs/heads/master | 2022-04-29T07:43:28.401335 | 2022-04-03T21:12:15 | 2022-04-03T21:12:15 | 181,529,976 | 5 | 8 | null | null | null | null | UTF-8 | Java | false | false | 2,659 | java | package me.hiro.safelanding;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
import com.projectkorra.projectkorra.ProjectKorra;
import com.projectkorra.projectkorra.ability.AddonAbility;
import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.PassiveAbility;
import com.projectkorra.projectkorra.configuration.ConfigManager;
public class SafeLandingAir extends AirAbility implements AddonAbility, PassiveAbility {
private long duration;
private boolean isActive;
private long lastActivateTime;
private int flag = 0;
public SafeLandingAir(Player player) {
super(player);
setField();
}
public void setField() {
duration = ConfigManager.getConfig().getLong("ExtraAbilities.Hiro3.Air.SafeLandingAir.Duration");
isActive = false;
}
@Override
public void progress() {
if (isActive) {
if (player.isOnGround() && flag == 0) {
flag = 1;
new BukkitRunnable() {
@Override
public void run() {
isActive = false;
flag = 0;
}
}.runTaskLater(ProjectKorra.plugin, 1);
}
if (System.currentTimeMillis() > lastActivateTime + duration) {
isActive = false;
}
}
}
public void activate() {
isActive = true;
lastActivateTime = System.currentTimeMillis();
}
public void deactivate() {
isActive = false;
}
public boolean isActive() {
return this.isActive;
}
@Override
public long getCooldown() {
return 0;
}
@Override
public Location getLocation() {
return null;
}
@Override
public String getName() {
return "SafeLandingAir";
}
@Override
public boolean isHarmlessAbility() {
return true;
}
@Override
public boolean isSneakAbility() {
return false;
}
@Override
public boolean isInstantiable() {
return true;
}
@Override
public boolean isProgressable() {
return true;
}
@Override
public String getDescription() {
return "Land safely after WallRun.";
}
@Override
public String getAuthor() {
return "Hiro3";
}
@Override
public String getVersion() {
return "1.0";
}
@Override
public void load() {
ConfigManager.getConfig().addDefault("ExtraAbilities.Hiro3.Air.SafeLandingAir.Duration", 5000);
ConfigManager.defaultConfig.save();
ProjectKorra.log.info("Succesfully enabled " + getName() + " by " + getAuthor());
}
@Override
public void stop() {
ProjectKorra.log.info("Successfully disabled " + getName() + " by " + getAuthor());
super.remove();
}
}
| [
"noreply@github.com"
] | noreply@github.com |
36f414bffcda4f6e1fb178001b3403c92c019361 | 8d901c2ab04173c9ea6b1d13f35f829f22f0aecb | /src/test/java/ee/seb/LeasingTest.java | da5cccd86d43ffa149a9709948bb9fa24c972921 | [] | no_license | hellared/qa_test_task_SEB | 1001a095690720d7639fcf3a145b73951401b2ad | aedb71e1426d92e7add9d04f48c5142db60a3758 | refs/heads/master | 2022-04-18T19:39:05.102375 | 2020-04-13T14:36:41 | 2020-04-13T14:36:41 | 253,610,093 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,045 | java | package ee.seb;
import com.codeborne.selenide.Condition;
import com.codeborne.selenide.Selenide;
import ee.seb.modals.AcceptCookieModal;
import ee.seb.pages.LeasingPage;
import ee.seb.pages.SubmitApplicationPage;
import io.qameta.allure.Step;
import org.junit.jupiter.api.*;
import static com.codeborne.selenide.Selenide.switchTo;
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
public class LeasingTest extends BaseTest {
protected LeasingPage leasingPage = new LeasingPage();
protected SubmitApplicationPage submitApplicationPage = new SubmitApplicationPage();
protected AcceptCookieModal acceptCookieModal = new AcceptCookieModal();
@Step
@BeforeAll
public void openPage() {
Selenide.open("/loan-and-leasing/leasing/car-leasing#calculator");
acceptCookieModal.checkModalText(
"What do we use cookies for?",
"To offer you the best possible browsing experience, we use cookies on our website. To learn more view our ",
"Manage cookie settings",
"I agree"
);
acceptCookieModal.acceptAction();
}
@Step
@BeforeEach
public void refreshPage() {
Selenide.refresh();
}
@Step
@AfterEach
public void returnToPage() {
switchTo().window(0);
}
@Test
public void testCanAddToComparison() {
leasingPage.openCarLeasingCalculator()
.setVehiclePrice("50000")
.setDownpayments("3")
.applyComparison();
leasingPage.getMonthlyPayments().shouldNotBe(Condition.empty);
leasingPage.getComparisonBlock().should(Condition.appear).shouldNotBe(Condition.empty);
}
@Test
public void testCanSeeSchedule() {
leasingPage.openCarLeasingCalculator()
.setVehiclePrice("50000")
.setDownpayments("3")
.applySchedule();
leasingPage.getScheduleBlock().should(Condition.appear).shouldNotBe(Condition.empty);
}
@Test
public void testCanReachLeasingPage() {
leasingPage.checkMenuIsSelected("Loan and Leasing")
.checkMenuIsSelected("Car leasing");
}
@Test
public void testCanSubmitApplication() {
leasingPage.submitApplicationViaIBank()
.checkUserIsOnLoginPage();
Selenide.closeWindow();
}
@Test
public void applyForLeasingWithAllFields() {
leasingPage
.setNetIncome("2000")
.setFinancialObligations("500")
.setDependants("2")
.applySurety();
leasingPage.getLeaseSum().shouldHave(Condition.text("20 530"));
leasingPage.getResultSum().shouldBe(Condition.visible);
leasingPage.getResultButtons().shouldBe(Condition.visible)
.shouldBe(Condition.enabled);
leasingPage.proceedToApplication()
.submitApplication();
submitApplicationPage.checkUserIsOnSubmitApplicationPage();
Selenide.closeWindow();
}
}
| [
"hella.nataly@gmail.com"
] | hella.nataly@gmail.com |
e244ace9b0a0a872896e10df3d031789123f4fe5 | 187b7b8d168f25115042332179343edd1da7c696 | /src/main/java/model/entities/employees/EmployeeGroup.java | 21f5c8cecd2ee241ca96680c06ab9d4d625b0790 | [] | no_license | Andrfas/SCPI | cfa9584bc81dc04750b1b42559322c4052eac7bc | 55b69dc8fbfc0c57812a310574b4f53869d2a565 | refs/heads/master | 2021-03-12T20:44:20.217723 | 2015-03-22T03:10:35 | 2015-03-22T03:10:35 | 28,803,869 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,431 | java | package model.entities.employees;
import javax.persistence.*;
import java.io.Serializable;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
* Created by Andrey on 22.02.2015.
*/
@Entity
@Table(name = "employee_group")
public class EmployeeGroup implements Serializable {
private Integer id;
private String name;
private List<Employee> employees;
private Set<GroupActions> actions = new HashSet<GroupActions>();;
public EmployeeGroup() {
}
public EmployeeGroup(String name) {
this.name = name;
}
@Id
@Column(name = "id", nullable = false)
@GeneratedValue(strategy = GenerationType.AUTO)
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
@Column(name = "name", nullable = false)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@OneToMany(fetch = FetchType.LAZY)
public List<Employee> getEmployees() {
return this.employees;
}
public void setEmployees(List<Employee> employees) {
this.employees = employees;
}
@ManyToMany(mappedBy = "groups",
fetch = FetchType.LAZY)
public Set<GroupActions> getActions() {
return actions;
}
public void setActions(Set<GroupActions> actions) {
this.actions = actions;
}
}
| [
"andrfas@gmail.com"
] | andrfas@gmail.com |
b29524eebfa71943129b59b495ef7c3a11f8d7f5 | 41ab3e874a24c3f22bc88a9465ef55ccfcdded31 | /app/src/main/java/com/example/rututechnologies/myapplication/GroupsFragment.java | a0e41b0cba3d71f570bbbd1233a876df8843b758 | [] | no_license | sonu-pandey/MyApplication | d047fba6dfe1f48b51e16482b461cc6f0c9e20f8 | 656f2909bb9516414c7f7e444f957974a11c6dbe | refs/heads/master | 2020-04-10T16:00:16.034579 | 2018-12-10T05:55:43 | 2018-12-10T05:55:43 | 161,129,918 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,263 | java | package com.example.rututechnologies.myapplication;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import com.example.rututechnologies.myapplication.R;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
/**
* A simple {@link Fragment} subclass.
*/
public class GroupsFragment extends Fragment {
private View groupFragmentView;
private ListView list_view;
private ArrayAdapter<String> arrayAdapter;
private ArrayList<String> list_of_groups=new ArrayList<>();
private DatabaseReference GroupRef;
public GroupsFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
groupFragmentView= inflater.inflate(R.layout.fragment_groups, container, false);
GroupRef=FirebaseDatabase.getInstance().getReference().child("Groups");
InitialiseFields();
RetriveAndDisplayGroups();
list_view.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) {
String currentGroupName= adapterView.getItemAtPosition(position).toString();
Intent intent= new Intent(getContext(),GroupChatActivity.class);
intent.putExtra("groupName",currentGroupName);
startActivity(intent);
}
});
return groupFragmentView;
}
private void RetriveAndDisplayGroups() {
GroupRef.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
Set<String> set = new HashSet<>();
Iterator iterator= dataSnapshot.getChildren().iterator();
while (iterator.hasNext()){
set.add(((DataSnapshot)iterator.next()).getKey());
list_of_groups.clear();
list_of_groups.addAll(set);
arrayAdapter.notifyDataSetChanged();
}
}
@Override
public void onCancelled(@NonNull DatabaseError databaseError) {
}
});
}
private void InitialiseFields() {
list_view = (ListView) groupFragmentView.findViewById(R.id.list_view);
arrayAdapter=new ArrayAdapter<String>(getContext(), android.R.layout.simple_list_item_1 , list_of_groups);
list_view.setAdapter(arrayAdapter);
}
}
| [
"rtinhousedeveloper@rututechnologies.com"
] | rtinhousedeveloper@rututechnologies.com |
f363fe529a8316f6ac5d0a53463d6e1afc6eb798 | f7f1f9618e14c2afff4e41676f0085c263317c25 | /CSC 2120/Assignments/Program4/src/party/FileIOException.java | 84293363a3e0a0bd3d0b5436badea7a7bfcde68d | [] | no_license | daniel19/Java-Projects | 483ed3a09753623a3ca98308d6a970cad61e206d | 404abe77150119444f32e534f5cc01a2e2901e5c | refs/heads/master | 2021-01-20T10:06:39.583076 | 2016-12-29T00:15:16 | 2016-12-29T00:16:58 | 18,303,924 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 147 | java | package party;
public class FileIOException extends RuntimeException
{
public FileIOException(String message)
{
super(message);
}
} | [
"daniel19brown@gmail.com"
] | daniel19brown@gmail.com |
718ce5a31b5899cef2264f79f3268731b97c8147 | 26b77ffe6efdb2258ff9a02c8e169a639bc1bc2a | /Java new Projects/Hospital Management System (MS Access)/src/Doctor.java | 74c4d11c5d232a428d917e61020800c7daacf394 | [] | no_license | SameerKhowaja/Downloaded-Projects-Template | c70054897693a67fc81b6829987120d42d137026 | 365df7de12e64cfa3f070e59f6b0941567fedd90 | refs/heads/master | 2023-03-10T21:56:46.583374 | 2021-02-28T05:19:40 | 2021-02-28T05:19:40 | 342,791,733 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 26,232 | java |
import java.awt.HeadlessException;
import java.awt.event.KeyEvent;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.swing.JOptionPane;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Raj
*/
public class Doctor extends javax.swing.JFrame {
Connection con=null;
ResultSet rs=null;
PreparedStatement pst=null;
/**
* Creates new form Doctor
*/
public Doctor() {
initComponents();
setLocationRelativeTo(null);
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();
jLabel10 = new javax.swing.JLabel();
txtDoctorID = new javax.swing.JTextField();
txtDoctorName = new javax.swing.JTextField();
txtFathername = new javax.swing.JTextField();
txtAddress = new javax.swing.JTextField();
txtContactNo = new javax.swing.JTextField();
txtEmailID = new javax.swing.JTextField();
txtQualifications = new javax.swing.JTextField();
txtSpecialisation = new javax.swing.JTextField();
txtDateOfJoining = new javax.swing.JFormattedTextField();
cmbBloodGroup = new javax.swing.JComboBox();
jLabel11 = new javax.swing.JLabel();
cmbGender = new javax.swing.JComboBox();
jLabel22 = new javax.swing.JLabel();
jPanel2 = new javax.swing.JPanel();
btnNew = new javax.swing.JButton();
btnSave = new javax.swing.JButton();
btnDelete = new javax.swing.JButton();
btnUpdate = new javax.swing.JButton();
jButton1 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setTitle("Doctor");
setResizable(false);
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Doctor Details"));
jLabel1.setText("ID");
jLabel2.setText("Name");
jLabel3.setText("Father's Name");
jLabel4.setText("Address");
jLabel5.setText("Contact No.");
jLabel6.setText("Email ID");
jLabel7.setText("Qualifications");
jLabel8.setText("Specialization");
jLabel9.setText("Blood Group");
jLabel10.setText("Date Of Joining");
txtContactNo.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent evt) {
txtContactNoKeyTyped(evt);
}
});
txtDateOfJoining.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.DateFormatter(new java.text.SimpleDateFormat("dd/MM/yyyy"))));
cmbBloodGroup.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "O+", "O-", "A+", "A-", "B+", "B-", "AB+", "AB-" }));
cmbBloodGroup.setSelectedIndex(-1);
jLabel11.setText("Gender");
cmbGender.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "M", "F" }));
cmbGender.setSelectedIndex(-1);
jLabel22.setText("(DD/MM/YYYY)");
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(33, 33, 33)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel1)
.addComponent(jLabel2)
.addComponent(jLabel3)
.addComponent(jLabel4)
.addComponent(jLabel5)
.addComponent(jLabel6)
.addComponent(jLabel7)
.addComponent(jLabel8)
.addComponent(jLabel9)
.addComponent(jLabel10)
.addComponent(jLabel11))
.addGap(50, 50, 50)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(txtDoctorID, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(txtDoctorName)
.addComponent(txtFathername, javax.swing.GroupLayout.DEFAULT_SIZE, 193, Short.MAX_VALUE)
.addComponent(txtContactNo, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(txtAddress, javax.swing.GroupLayout.PREFERRED_SIZE, 207, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(txtQualifications, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 194, Short.MAX_VALUE)
.addComponent(txtSpecialisation, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(txtEmailID, javax.swing.GroupLayout.Alignment.LEADING))
.addComponent(cmbBloodGroup, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(txtDateOfJoining, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel22))
.addComponent(cmbGender, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(20, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(27, 27, 27)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(txtDoctorID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(txtDoctorName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel3)
.addComponent(txtFathername, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel4)
.addComponent(txtAddress, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel5)
.addComponent(txtContactNo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel6)
.addComponent(txtEmailID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel7)
.addComponent(txtQualifications, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel8)
.addComponent(txtSpecialisation, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel11)
.addComponent(cmbGender, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel9)
.addComponent(cmbBloodGroup, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel10)
.addComponent(txtDateOfJoining, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel22))
.addContainerGap(19, Short.MAX_VALUE))
);
jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
btnNew.setText("New");
btnNew.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnNewActionPerformed(evt);
}
});
btnSave.setText("Save");
btnSave.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnSaveActionPerformed(evt);
}
});
btnDelete.setText("Delete");
btnDelete.setEnabled(false);
btnDelete.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnDeleteActionPerformed(evt);
}
});
btnUpdate.setText("Update");
btnUpdate.setEnabled(false);
btnUpdate.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnUpdateActionPerformed(evt);
}
});
jButton1.setText("Get Data");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(btnNew, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnSave, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnDelete, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnUpdate, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addComponent(jButton1)))
.addContainerGap())
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addComponent(btnNew)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnSave)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnDelete)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnUpdate)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton1)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(20, 20, 20)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(28, 28, 28)
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(32, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap(25, Short.MAX_VALUE)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(21, 21, 21))
.addGroup(layout.createSequentialGroup()
.addGap(34, 34, 34)
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void Reset()
{
txtDoctorID.setText("");
txtDoctorName.setText("");
txtFathername.setText("");
txtContactNo.setText("");
txtAddress.setText("");
txtQualifications.setText("");
txtEmailID.setText("");
txtSpecialisation.setText("");
txtDateOfJoining.setText("");
cmbBloodGroup.setSelectedIndex(-1);
cmbGender.setSelectedIndex(-1);
btnSave.setEnabled(true);
btnUpdate.setEnabled(false);
btnDelete.setEnabled(false);
txtDoctorID.requestDefaultFocus();
}
private void btnNewActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNewActionPerformed
Reset();
}//GEN-LAST:event_btnNewActionPerformed
private void btnSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSaveActionPerformed
try{
con=Connect.ConnectDB();
if (txtDoctorID.getText().equals("")) {
JOptionPane.showMessageDialog( this, "Please enter doctor id","Error", JOptionPane.ERROR_MESSAGE);
return;
}
if (txtDoctorName.getText().equals("")) {
JOptionPane.showMessageDialog( this, "Please enter doctor name","Error", JOptionPane.ERROR_MESSAGE);
return;
}
if (txtFathername.getText().equals("")) {
JOptionPane.showMessageDialog( this, "Please enter Father's name","Error", JOptionPane.ERROR_MESSAGE);
return;
}
if (txtAddress.getText().equals("")) {
JOptionPane.showMessageDialog( this, "Please enter address","Error", JOptionPane.ERROR_MESSAGE);
return;
}
if (txtContactNo.getText().equals("")) {
JOptionPane.showMessageDialog( this, "Please enter contact no.","Error", JOptionPane.ERROR_MESSAGE);
return;
}
if (txtQualifications.getText().equals("")) {
JOptionPane.showMessageDialog( this, "Please enter qualifications","Error", JOptionPane.ERROR_MESSAGE);
return;
}
if (txtSpecialisation.getText().equals("")) {
JOptionPane.showMessageDialog( this, "Please enter specialization","Error", JOptionPane.ERROR_MESSAGE);
return;
}
if (cmbGender.getSelectedItem().equals("")) {
JOptionPane.showMessageDialog( this, "Please select gender","Error", JOptionPane.ERROR_MESSAGE);
return;
}
if (cmbBloodGroup.getSelectedItem().equals("")) {
JOptionPane.showMessageDialog( this, "Please select blood group","Error", JOptionPane.ERROR_MESSAGE);
return;
}
if (txtDateOfJoining.getText().equals("")) {
JOptionPane.showMessageDialog( this, "Please enter joining date","Error", JOptionPane.ERROR_MESSAGE);
return;
}
Statement stmt;
stmt= con.createStatement();
String sql1="Select DoctorID from Doctor where DoctorID= '" + txtDoctorID.getText() + "'";
rs=stmt.executeQuery(sql1);
if(rs.next()){
JOptionPane.showMessageDialog( this, "User name already exists","Error", JOptionPane.ERROR_MESSAGE);
txtDoctorID.setText("");
txtDoctorID.requestDefaultFocus();
return;
}
String sql= "insert into Doctor(DoctorID,Doctorname,FatherName,Email,ContactNo,Qualifications,Specialization,Gender,BloodGroup,DateOfJoining,Address)values('"+ txtDoctorID.getText() + "','"+ txtDoctorName.getText() + "','"+ txtFathername.getText() + "','"+ txtEmailID.getText() + "','"+ txtContactNo.getText() + "','"+ txtQualifications.getText() + "','"+ txtSpecialisation.getText() + "','" + cmbGender.getSelectedItem() + "','"+ cmbBloodGroup.getSelectedItem() + "','" + txtDateOfJoining.getText() + "','" + txtAddress.getText() + "')";
pst=con.prepareStatement(sql);
pst.execute();
JOptionPane.showMessageDialog(this,"Successfully saved","Doctor Record",JOptionPane.INFORMATION_MESSAGE);
btnSave.setEnabled(false);
}catch(HeadlessException | SQLException ex){
JOptionPane.showMessageDialog(this,ex);
}
}//GEN-LAST:event_btnSaveActionPerformed
private void btnDeleteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDeleteActionPerformed
try{
int P = JOptionPane.showConfirmDialog(null," Are you sure want to delete ?","Confirmation",JOptionPane.YES_NO_OPTION);
if (P==0)
{
con=Connect.ConnectDB();
String sql= "delete from Doctor where DoctorID = '" + txtDoctorID.getText() + "'";
pst=con.prepareStatement(sql);
pst.execute();
JOptionPane.showMessageDialog(this,"Successfully deleted","Record",JOptionPane.INFORMATION_MESSAGE);
Reset();
}
}catch(HeadlessException | SQLException ex){
JOptionPane.showMessageDialog(this,ex);
}
}//GEN-LAST:event_btnDeleteActionPerformed
private void btnUpdateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUpdateActionPerformed
try{
con=Connect.ConnectDB();
String sql= "update Doctor set Doctorname='"+ txtDoctorName.getText() + "',FatherName='"+ txtFathername.getText() + "',Email='"+ txtEmailID.getText() + "',ContactNo='"+ txtContactNo.getText() + "',Qualifications='"+ txtQualifications.getText() + "',Specialization='"+ txtSpecialisation.getText() + "',Gender='" + cmbGender.getSelectedItem() + "',BloodGroup='"+ cmbBloodGroup.getSelectedItem() + "',DateOfJoining='" + txtDateOfJoining.getText() + "',Address='" + txtAddress.getText() + "' where DoctorID='" + txtDoctorID.getText() + "'";
pst=con.prepareStatement(sql);
pst.execute();
JOptionPane.showMessageDialog(this,"Successfully updated","Doctor Record",JOptionPane.INFORMATION_MESSAGE);
btnUpdate.setEnabled(false);
}catch(HeadlessException | SQLException ex){
JOptionPane.showMessageDialog(this,ex);
}
}//GEN-LAST:event_btnUpdateActionPerformed
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
this.hide();
DoctorRecord frm=new DoctorRecord();
frm.setVisible(true);
}//GEN-LAST:event_jButton1ActionPerformed
private void txtContactNoKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtContactNoKeyTyped
char c=evt.getKeyChar();
if (!(Character.isDigit(c)|| (c== KeyEvent.VK_BACK_SPACE)||(c==KeyEvent.VK_DELETE))){
getToolkit().beep();
evt.consume();
}
}//GEN-LAST:event_txtContactNoKeyTyped
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Metal".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(Doctor.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(Doctor.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(Doctor.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(Doctor.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Doctor().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
public javax.swing.JButton btnDelete;
private javax.swing.JButton btnNew;
public javax.swing.JButton btnSave;
public javax.swing.JButton btnUpdate;
public javax.swing.JComboBox cmbBloodGroup;
public javax.swing.JComboBox cmbGender;
private javax.swing.JButton jButton1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel11;
private javax.swing.JLabel jLabel2;
public javax.swing.JLabel jLabel22;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JLabel jLabel9;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
public javax.swing.JTextField txtAddress;
public javax.swing.JTextField txtContactNo;
public javax.swing.JFormattedTextField txtDateOfJoining;
public javax.swing.JTextField txtDoctorID;
public javax.swing.JTextField txtDoctorName;
public javax.swing.JTextField txtEmailID;
public javax.swing.JTextField txtFathername;
public javax.swing.JTextField txtQualifications;
public javax.swing.JTextField txtSpecialisation;
// End of variables declaration//GEN-END:variables
}
| [
"54762751+SameerKhowaja@users.noreply.github.com"
] | 54762751+SameerKhowaja@users.noreply.github.com |
e7fdc6c5f3b6854ddf0283bcaec60c27ff63913e | f9b33a2f7f39f61010e6e7867e5b5f61e9666326 | /edu/ufl/cda5155/domain/Register.java | bbcf34928f5187ea4f3410096f2ed4b3460e2d43 | [] | no_license | mayank-gupta/CA-MIPS | 52101dbe537d8fdb3d9a014c0009939cbb225a3b | 2ab084e68b9ab6163a0c3c62defaa815d6fcba26 | refs/heads/master | 2020-08-06T19:50:03.585713 | 2012-09-17T03:29:51 | 2012-09-17T03:29:51 | 5,835,809 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 640 | java | package edu.ufl.cda5155.domain;
public class Register {
private final int id;
private int value;
private boolean isUsed;
public Register(int id, int value) {
super();
this.id = id;
this.value = value;
isUsed = false;
}
public Register(int id) {
super();
this.id = id;
}
public int getId() {
return id;
}
public int getValue() {
return value;
}
public void setValue(int value) {
this.value = value;
}
public boolean isUsed() {
return isUsed;
}
public void setUsed(boolean isUsed) {
this.isUsed = isUsed;
}
}
| [
"mayank519@gmail.com"
] | mayank519@gmail.com |
8cbd3cdf88c662573c80745e1879f92fc2fa50b6 | 703ea0087073d959e242349d711f3956acd1bb9e | /cps/bsj/bsj-protocol/src/main/java/allthings/iot/bsj/das/packet/Packet0x85.java | 8e9cf30414fb082fe09e65076b77d37268dc722b | [
"Apache-2.0"
] | permissive | allthings-vip/iot-platform | dc1e66673f5f211ab2d424d94c0bb0f494da306b | 826f80a4b0f72f93da0600b8c3c25483f5e7ce66 | refs/heads/master | 2023-06-08T04:19:55.498706 | 2020-10-21T06:12:44 | 2020-10-21T06:12:44 | 280,990,097 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 535 | java | package allthings.iot.bsj.das.packet;
/**
* @author : luhao
* @FileName : Packet0x85
* @CreateDate : 2018/1/8
* @Description : (0x85)车载终端确认包
* @ReviewedBy :
* @ReviewedOn :
* @VersionHistory :
* @ModifiedBy :
* @ModifiedDate :
* @Comments :
* @CopyRight : COPYRIGHT(c) allthings-vip All Rights Reserved
* *******************************************************************************************
*/
public class Packet0x85 extends PacketPosition {
public Packet0x85() {
super("85");
}
}
| [
"21212@etransfar.com"
] | 21212@etransfar.com |
507a24611f26916e5be30c86d57bc3549970662e | fe21a81c55123354fd49e393bf4cf677b4fb6ba8 | /backend/src/main/java/com/pivottech/booking/repository/ReservationRepository.java | 03b587dbad67ae25fe66ff275c0b5a210e3743d0 | [
"Apache-2.0"
] | permissive | dannycyf9/booking-system-project | eb1e93fba9d8d1fb195256f74e45a087fae31d27 | 9d94b12f43a4fd68318c11a94f2866939d6918f2 | refs/heads/main | 2023-08-06T17:43:22.342450 | 2021-09-27T00:44:18 | 2021-09-27T00:44:18 | 408,181,583 | 0 | 0 | Apache-2.0 | 2021-09-19T16:42:28 | 2021-09-19T16:42:27 | null | UTF-8 | Java | false | false | 438 | java | package com.pivottech.booking.repository;
import com.pivottech.booking.model.Reservation;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.repository.PagingAndSortingRepository;
public interface ReservationRepository extends PagingAndSortingRepository<Reservation, Long> {
Page<Reservation> findByDescriptionContaining(String terms, Pageable pageable);
}
| [
"tabris.zhuxun913@gmail.com"
] | tabris.zhuxun913@gmail.com |
787fb8656e7fe6f0a3deb9d303083095d7701d04 | 0f77c5ec508d6e8b558f726980067d1058e350d7 | /1_39_120042/com/ankamagames/wakfu/client/ui/theme/ImageCitizenshipContainer.java | 8b5bf692f1747972298c23837ccde45e3b066454 | [] | no_license | nightwolf93/Wakxy-Core-Decompiled | aa589ebb92197bf48e6576026648956f93b8bf7f | 2967f8f8fba89018f63b36e3978fc62908aa4d4d | refs/heads/master | 2016-09-05T11:07:45.145928 | 2014-12-30T16:21:30 | 2014-12-30T16:21:30 | 29,250,176 | 5 | 5 | null | 2015-01-14T15:17:02 | 2015-01-14T15:17:02 | null | UTF-8 | Java | false | false | 1,677 | java | package com.ankamagames.wakfu.client.ui.theme;
import java.util.*;
import com.ankamagames.xulor2.component.*;
import com.ankamagames.xulor2.core.*;
import com.ankamagames.xulor2.util.alignment.*;
import com.ankamagames.xulor2.appearance.*;
public class ImageCitizenshipContainer implements StyleSetter
{
private DocumentParser doc;
private Stack<ElementMap> elementMaps;
public ImageCitizenshipContainer() {
super();
this.elementMaps = new Stack<ElementMap>();
}
@Override
public void applyStyle(final ElementMap item, final DocumentParser doc, final Widget widget) {
this.doc = doc;
this.elementMaps.push(item);
final ElementMap elementMap = this.elementMaps.peek();
final DecoratorAppearance appearance = widget.getAppearance();
appearance.setElementMap(elementMap);
((ImageAppearance)appearance).setScaled(false);
widget.addBasicElement(appearance);
appearance.onAttributesInitialized();
final String id = "pmCitizenshipContainer";
final PixmapElement checkOut = PixmapElement.checkOut();
checkOut.setElementMap(elementMap);
if (elementMap != null && id != null) {
elementMap.add(id, checkOut);
}
checkOut.setHeight(63);
checkOut.setPosition(Alignment17.CENTER);
checkOut.setTexture(this.doc.getTexture("default_0.tga"));
checkOut.setWidth(134);
checkOut.setX(698);
checkOut.setY(345);
appearance.addBasicElement(checkOut);
checkOut.onAttributesInitialized();
checkOut.onChildrenAdded();
appearance.onChildrenAdded();
}
}
| [
"totomakers@hotmail.fr"
] | totomakers@hotmail.fr |
a5a6136eb01fe65c95a1026172f4207168bd4e9d | b3c6f270427b802be31d309c82791a151644443b | /src/main/java/me/mingshan/reactive/flow/CompletableFutureTest.java | a85e70ff8e998754dd9c2392da9419762a73ee16 | [
"MIT"
] | permissive | mstao/reactive | 865a08242f7baa50e6394a0489c348b42aac982e | 95163e9726092ae23db504d1acac7f71425e7463 | refs/heads/master | 2021-07-16T18:44:46.530937 | 2019-11-28T07:18:16 | 2019-11-28T07:18:16 | 218,677,054 | 0 | 0 | MIT | 2020-10-13T17:47:46 | 2019-10-31T03:28:20 | Java | UTF-8 | Java | false | false | 9,937 | java | package me.mingshan.reactive.flow;
import org.junit.Test;
import java.util.Arrays;
import java.util.List;
import java.util.Random;
import java.util.concurrent.*;
import java.util.stream.Collectors;
public class CompletableFutureTest {
@Test
public void test1() {
CompletableFuture.supplyAsync(() -> "Hello")
.thenApply(s -> s + "World")
.thenApply(String::toUpperCase)
.thenCombine(CompletableFuture.completedFuture("Java"), (s1, s2) -> s1 + s2)
.thenAccept(System.out::println);
}
/**
* 异步运算
*/
@Test
public void test2() throws ExecutionException, InterruptedException {
CompletableFuture<Void> future = CompletableFuture.runAsync(() -> {
try {
TimeUnit.SECONDS.sleep(1);
} catch (InterruptedException e) {
e.printStackTrace();
}
System.out.println(Thread.currentThread().getName());
});
future.get();
}
/**
* 使用 supplyAsync() 运行一个异步任务并且返回结果
*/
@Test
public void test3() throws ExecutionException, InterruptedException {
CompletableFuture<String> future = CompletableFuture.supplyAsync(() -> {
return Thread.currentThread().getName();
}, Executors.newFixedThreadPool(5));
System.out.println(future.join());
}
/**
* 使用 thenApply() 处理和改变CompletableFuture的结果(使用同一个线程)
*/
@Test
public void test4() throws ExecutionException, InterruptedException {
CompletableFuture<String> future = CompletableFuture.supplyAsync(() -> {
return Thread.currentThread().getName();
}).thenApply(item -> {
return item + "-111111-" + Thread.currentThread().getName();
}).thenApply(item -> {
return item + "-222222-" + Thread.currentThread().getName();
});
//System.out.println(future.get());
}
/**
* 使用 thenApplyAsync() 异步处理和改变CompletableFuture的结果(使用不同的线程)
*/
@Test
public void test5() throws ExecutionException, InterruptedException {
CompletableFuture<String> future = CompletableFuture.supplyAsync(() -> {
return Thread.currentThread().getName();
}).thenApplyAsync(item -> {
return item + "-111111-" + Thread.currentThread().getName();
}).thenApplyAsync(item -> {
return item + "-222222-" + Thread.currentThread().getName();
});
System.out.println(future.get());
}
/**
* thenAccept() 处理结果
*/
@Test
public void test6() {
CompletableFuture.supplyAsync(() -> {
return Thread.currentThread().getName();
}).thenAccept(System.out::println);
}
/**
* thenRun 收尾处理
*/
@Test
public void test7() {
CompletableFuture.supplyAsync(() -> {
return Thread.currentThread().getName();
}).thenRun(() -> {
System.out.println("hhhhhhhhh");
});
}
/*
* 组合两个CompletableFuture
*/
/**
* 使用 thenCompose() 组合两个独立的future
*/
@Test
public void test8() {
String userId = null;
//
CompletableFuture<CompletableFuture<User>> future = getUser(userId).thenApply(this::fillRes);
// 利用 thenCompose() 组合两个独立的future
CompletableFuture<User> result = getUser(userId)
.thenCompose(user -> fillRes(user));
result.join();
}
/**
* 使用thenCombine()组合两个独立的 future
*/
@Test
public void test9() throws ExecutionException, InterruptedException {
System.out.println("Retrieving weight.");
CompletableFuture<Double> weightInKgFuture = CompletableFuture.supplyAsync(() -> {
try {
TimeUnit.SECONDS.sleep(1);
} catch (InterruptedException e) {
throw new IllegalStateException(e);
}
return 65.0;
});
System.out.println("Retrieving height.");
CompletableFuture<Double> heightInCmFuture = CompletableFuture.supplyAsync(() -> {
try {
TimeUnit.SECONDS.sleep(1);
} catch (InterruptedException e) {
throw new IllegalStateException(e);
}
return 177.8;
});
System.out.println("Calculating BMI.");
CompletableFuture<Double> combinedFuture = weightInKgFuture
.thenCombine(heightInCmFuture, (weightInKg, heightInCm) -> {
Double heightInMeter = heightInCm/100;
return weightInKg/(heightInMeter*heightInMeter);
});
CompletableFuture<String> walker = CompletableFuture.supplyAsync(() -> {
return ", Walker";
});
CompletableFuture<String> future = CompletableFuture.supplyAsync(() -> {
return "Hello";
}).thenApply(s -> s + " World")
.thenCombine(walker, (s1, s2) -> {
return s1 + s2;
});
System.out.println(future.get());
System.out.println("Your BMI is - " + combinedFuture.get());
}
/**
* 异常处理1
*/
@Test
public void test10() throws ExecutionException, InterruptedException {
int age = -1;
CompletableFuture<Void> future = CompletableFuture.supplyAsync(() -> {
if (age < 0) {
throw new IllegalArgumentException("Age can not be negative");
}
if (age > 18) {
return "Adult";
} else {
return "Child";
}
}).exceptionally(ex -> {
System.out.println(ex.getMessage());
return "Unknown!";
}).thenAccept((r) -> {
System.out.println("result = " + r);
System.out.println("Done.");
});
future.join();
}
/**
* 异常处理2
*
* @throws ExecutionException
* @throws InterruptedException
*/
@Test
public void test11() throws ExecutionException, InterruptedException {
int age = -1;
CompletableFuture<Void> future = CompletableFuture.supplyAsync(() -> {
if (age < 0) {
throw new IllegalArgumentException("Age can not be negative");
}
if (age > 18) {
return "Adult";
} else {
return "Child";
}
}).handle((res, ex) -> {
if(ex != null) {
System.out.println("Oops! We have an exception - " + ex.getMessage());
return "Unknown!";
}
return res;
}).thenAccept((r) -> {
System.out.println(r);
System.out.println("Done.");
});
future.join();
}
@Test
public void test111() {
int age = -1;
CompletableFuture<String> future = CompletableFuture.supplyAsync(() -> {
if (age < 0) {
throw new IllegalArgumentException("Age can not be negative");
}
if (age > 18) {
return "Adult";
} else {
return "Child";
}
}).whenComplete((res, ex) -> {
if (ex == null) {
System.out.println(res);
} else {
throw new RuntimeException(ex);
}
}).exceptionally(e -> {
System.out.println(e.getMessage());
return "hello world";
});
future.join();
}
@Test
public void test12() {
long startTime = System.currentTimeMillis();
List<String> webPageLinks = Arrays.asList("1", "2", "3", "4", "5");
// ①
List<CompletableFuture<String>> futures = webPageLinks.stream()
.map(this::downloadWebPage).collect(Collectors.toList());
System.out.println("下载中1");
// ②
// 注意这里返回泛型的是空
CompletableFuture<Void> allOf = CompletableFuture.allOf(futures.toArray(new CompletableFuture[futures.size()]));
System.out.println("下载中2");
// ③
CompletableFuture<List<String>> allFuture = allOf.thenApply(v -> {
return futures.stream()
.map(CompletableFuture::join)
.collect(Collectors.toList());
});
System.out.println("下载中3");
// ④
List<String> strings = allFuture.join();
long endTime = System.currentTimeMillis();
System.out.println("总耗时长:" + (endTime - startTime) / 1000);
strings.forEach(System.out::println);
}
@Test
public void test13() {
long startTime = System.currentTimeMillis();
List<String> webPageLinks = Arrays.asList("1", "2", "3", "4", "5");
List<CompletableFuture<String>> futures = webPageLinks.stream()
.map(this::downloadWebPage).collect(Collectors.toList());
// 注意这里返回
CompletableFuture<Object> anyOf = CompletableFuture.anyOf(futures.toArray(new CompletableFuture[futures.size()]));
Object result = anyOf.join();
System.out.println(result);
long endTime = System.currentTimeMillis();
System.out.println("总耗时长:" + (endTime - startTime) / 1000);
}
@Test
public void test14() {
long startTime = System.currentTimeMillis();
List<String> webPageLinks = Arrays.asList("1", "2", "3", "4", "5");
// ①
List<CompletableFuture<String>> futures = webPageLinks.stream()
.map(this::downloadWebPage).collect(Collectors.toList());
System.out.println("下载中1");
// ②
// 注意这里返回泛型的是空
CompletableFuture.allOf(futures.toArray(new CompletableFuture[futures.size()])).join();
}
private CompletableFuture<String> downloadWebPage(String webPageLink) {
return CompletableFuture.supplyAsync(() -> {
Random random = new Random();
int i = random.nextInt(10) + 1;
System.out.println(webPageLink + " - " + i);
try {
Thread.sleep(i * 1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
System.out.println(webPageLink + " - done." );
return webPageLink + " - http://www.baidu.com";
});
}
private CompletableFuture<User> getUser(String userId) {
return CompletableFuture.supplyAsync(() -> {
// DO ANYTHING
return new User();
});
}
private CompletableFuture<User> fillRes(User user) {
return CompletableFuture.supplyAsync(() -> {
// 获取权限信息,填充到用户信息里面
return user;
});
}
private static class User {
List<String> res;
}
@Test
public void test() {
System.out.println(ForkJoinPool.getCommonPoolParallelism());
}
}
| [
"499445428@qq.com"
] | 499445428@qq.com |
9b11d7210e463de77eabfe1c0d6a7b8331006a45 | 4bc682d0650e09814ccdb2111403cb38bcb590f5 | /fyjmall-product/src/main/java/com/fyj/fyjmall/product/vo/Images.java | 6f132640696ad76379d8b4edc066309c97288074 | [
"Apache-2.0"
] | permissive | taojhlwkl/fyjmall | d00eb95c9c761d0a6f28817103b5102a8f2f58b7 | 6006ceb22670234829eafaa11caa152f9bf14c51 | refs/heads/master | 2022-11-12T20:32:18.775101 | 2020-06-17T08:37:52 | 2020-06-17T08:37:52 | 277,086,058 | 2 | 2 | Apache-2.0 | 2020-07-04T10:15:33 | 2020-07-04T10:15:32 | null | UTF-8 | Java | false | false | 317 | java | /**
* Copyright 2019 bejson.com
*/
package com.fyj.fyjmall.product.vo;
import lombok.Data;
/**
* Auto-generated: 2019-11-26 10:50:34
*
* @author bejson.com (i@bejson.com)
* @website http://www.bejson.com/java2pojo/
*/
@Data
public class Images {
private String imgUrl;
private int defaultImg;
} | [
"1813306692@qq.com"
] | 1813306692@qq.com |
1b7df3b2a06f2f610937a383d3bc1ae6cfb9e6c2 | 39b0d67df28c9ac4b94e0d8859f8612d82378324 | /exercises/week7/exercise3/src/main/java/academy/everyonecodes/phonebook/DataClasses/Address.java | ed70175a231095bf38375e3680581ee5dd882623 | [] | no_license | DDrescher/springboot-module | 197479caf064f2111a8f646929d0924365971061 | c03051e90521ee7381aabcf98c537b6f811646a9 | refs/heads/master | 2022-11-06T06:31:48.508942 | 2020-06-25T12:49:24 | 2020-06-25T12:49:24 | 246,024,561 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,318 | java | package academy.everyonecodes.phonebook.DataClasses;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import java.util.Objects;
@Entity
public class Address {
@Id
@GeneratedValue
private Long id;
private String street;
private String postalCode;
public Address(String street, String postalCode) {
this.street = street;
this.postalCode = postalCode;
}
public Address() {
}
public Long getId() {
return id;
}
public String getPostalCode() {
return postalCode;
}
public void setPostalCode(String postalCode) {
this.postalCode = postalCode;
}
public String getStreet() {
return street;
}
public void setStreet(String street) {
this.street = street;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Address address = (Address) o;
return Objects.equals(id, address.id) &&
Objects.equals(street, address.street) &&
Objects.equals(postalCode, address.postalCode);
}
@Override
public int hashCode() {
return Objects.hash(id, street, postalCode);
}
}
| [
"drescherdorian@gmail.com"
] | drescherdorian@gmail.com |
0cea3a3a2b3a13b7062e2a01948b0fc6e078d962 | 3a918c75199599145c5855991a9f3ba9e2afeb4e | /compute-service/src/main/java/com/campy/computeservice/ComputeServiceApplication.java | fb4f7486449eb138f69f8da3fe315218c69a9a2a | [] | no_license | alexRyccc/alexryc | ab717cc3a790c65989395e2310e6c4587163d3fc | d51aab3c23c0e43b82cd806d4d55599823ac1e91 | refs/heads/master | 2020-09-14T15:50:00.289897 | 2019-11-21T12:59:59 | 2019-11-21T12:59:59 | 223,174,437 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 345 | java | package com.campy.computeservice;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class ComputeServiceApplication {
public static void main(String[] args) {
SpringApplication.run(ComputeServiceApplication.class, args);
}
}
| [
"445292380@qq.com"
] | 445292380@qq.com |
1d2eb59a97be7b61db4e1537fae11deca6ac2b01 | 07b74366f014dab15cf0ef04027c3aeb8c937087 | /app/src/main/java/com/ingic/ezhalbatek/entities/getAdditionalJobsEnt.java | 2f5b640a71dc06fa439764e0214774b4158bd8f8 | [] | no_license | SaeedHyder/DohaMart_User_Android | ffa4365facb0f6623aff4f866000994d2c5accc6 | 6183a99d30cabbc35347b3a6fd742c876b8f55ba | refs/heads/master | 2022-03-12T19:14:17.292828 | 2019-10-21T16:05:59 | 2019-10-21T16:05:59 | 168,325,316 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,564 | java | package com.ingic.ezhalbatek.entities;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class getAdditionalJobsEnt {
@SerializedName("id")
@Expose
private Integer id;
@SerializedName("quantity")
@Expose
private Integer quantity;
@SerializedName("status")
@Expose
private Integer status;
@SerializedName("request_job_id")
@Expose
private Integer requestJobId;
@SerializedName("additional_job_item_id")
@Expose
private Integer additionalJobItemId;
@SerializedName("user_subs_visit_id")
@Expose
private Object userSubsVisitId;
@SerializedName("is_active")
@Expose
private Integer isActive;
@SerializedName("created_at")
@Expose
private String createdAt;
@SerializedName("updated_at")
@Expose
private String updatedAt;
@SerializedName("item")
@Expose
private Item item;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getQuantity() {
return quantity;
}
public void setQuantity(Integer quantity) {
this.quantity = quantity;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Integer getRequestJobId() {
return requestJobId;
}
public void setRequestJobId(Integer requestJobId) {
this.requestJobId = requestJobId;
}
public Integer getAdditionalJobItemId() {
return additionalJobItemId;
}
public void setAdditionalJobItemId(Integer additionalJobItemId) {
this.additionalJobItemId = additionalJobItemId;
}
public Object getUserSubsVisitId() {
return userSubsVisitId;
}
public void setUserSubsVisitId(Object userSubsVisitId) {
this.userSubsVisitId = userSubsVisitId;
}
public Integer getIsActive() {
return isActive;
}
public void setIsActive(Integer isActive) {
this.isActive = isActive;
}
public String getCreatedAt() {
return createdAt;
}
public void setCreatedAt(String createdAt) {
this.createdAt = createdAt;
}
public String getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(String updatedAt) {
this.updatedAt = updatedAt;
}
public Item getItem() {
return item;
}
public void setItem(Item item) {
this.item = item;
}
}
| [
"saeedhyder@axact.com"
] | saeedhyder@axact.com |
5e716320c2a8e156a30f5df12aeed7ec7a11a157 | 1bb8d0ead8373b60145521ba517cd9e74342ad56 | /src/ba/unsa/etf/rpr/controller/AddAccountController.java | 41e1f66be89cc64b05307898729022c39688c5ae | [] | no_license | jhasanovic/rpr20-projekat-jhasanovic | c9d2ca5f295f6810bbc83caf41de07bd171f88df | 9d189a95f09ec0a8bb545320ff5d1ed7b53e92d8 | refs/heads/master | 2023-08-11T09:11:22.936226 | 2021-09-13T16:21:47 | 2021-09-13T16:21:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,408 | java | package ba.unsa.etf.rpr.controller;
import ba.unsa.etf.rpr.Language;
import ba.unsa.etf.rpr.beans.User;
import ba.unsa.etf.rpr.dal.UserDAO;
import javafx.fxml.FXML;
import javafx.scene.control.Alert;
import javafx.scene.control.PasswordField;
import javafx.scene.control.TextField;
import javafx.scene.image.ImageView;
import javafx.stage.Stage;
import java.sql.SQLException;
public class AddAccountController {
@FXML
public TextField usernameTextField;
@FXML
public PasswordField passwordTextField;
@FXML
public ImageView image;
private UserDAO daoUsers;
private Language l;
@FXML
public void initialize() throws SQLException {
daoUsers = UserDAO.getInstance();
l = Language.getInstance();
setFieldColor(usernameTextField);
setFieldColor(passwordTextField);
}
private void setFieldColor(TextField field) {
field.getStyleClass().add("emptyField");
field.textProperty().addListener((observableValue, o, n) -> {
if (field.getText().trim().isEmpty()) {
field.getStyleClass().removeAll("nonEmptyField");
field.getStyleClass().add("emptyField");
} else {
field.getStyleClass().removeAll("emptyField");
field.getStyleClass().add("nonEmptyField");
}
});
}
public void loginClick() {
User u = new User(usernameTextField.getText(), passwordTextField.getText(), "");
int count = daoUsers.existingUser(u);
if (usernameTextField.getText().trim().isEmpty() || passwordTextField.getText().trim().isEmpty()) {
Alert alert = new Alert(Alert.AlertType.ERROR);
if (l.getLang().equals("bs")) {
alert.setTitle("Greška");
alert.setHeaderText("Greška pri kreiranju novog računa!");
alert.setContentText("Polja ne smiju biti prazna!");
} else if (l.getLang().equals("en")) {
alert.setTitle("Error");
alert.setHeaderText("Error creating new account!");
alert.setContentText("Fields cannot be empty!");
}
alert.showAndWait();
} else if (count == 0) {
daoUsers.addUser(u);
Alert alert = new Alert(Alert.AlertType.INFORMATION);
alert.setHeaderText(null);
if (l.getLang().equals("bs")) alert.setContentText("Uspješno ste kreirali novi račun!");
else if (l.getLang().equals("en")) alert.setContentText("You have succesfully created a new account!");
alert.showAndWait();
Stage stage = (Stage) passwordTextField.getScene().getWindow();
stage.close();
} else {
Alert alert = new Alert(Alert.AlertType.ERROR);
if (l.getLang().equals("bs")) {
alert.setTitle("Greška");
alert.setHeaderText("Greška pri kreiranju novog računa!");
alert.setContentText("Korisnik sa korisničkim imenom " + u.getUsername() + " već postoji!");
} else if (l.getLang().equals("en")) {
alert.setTitle("Error");
alert.setHeaderText("Error creating new account!");
alert.setContentText("User with username " + u.getUsername() + " already exists!");
}
alert.showAndWait();
}
}
}
| [
"jhasanovic1@etf.unsa.ba"
] | jhasanovic1@etf.unsa.ba |
d4ff727810e2df1dcd88c2e399966d5b6bd7f5e2 | 19268c12935dd64071e06982aab25bd58f765fdb | /src/main/java/com/chaiLab11/songr/AlbumController.java | 2a6fcd48097e3db838a1dca9395deca9ede9a416 | [] | no_license | chaitanyanarukulla/Spring | 4a48d2a1cce7642cf449babde6741c2ce6455e5b | 1d363c7d47bcd70349d21e4af15cd7b70e91beb4 | refs/heads/master | 2020-06-03T15:20:15.908887 | 2019-06-14T20:43:50 | 2019-06-14T20:43:50 | 191,626,016 | 0 | 0 | null | 2019-06-14T20:43:51 | 2019-06-12T18:40:23 | Java | UTF-8 | Java | false | false | 1,267 | java | package com.chaiLab11.songr;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.view.RedirectView;
import java.util.List;
@Controller
public class AlbumController {
@Autowired
AlbumRepository albumRepository;
@Autowired
SongRepository songRepository;
@GetMapping("/albums")
public String getAllAlbums(Model m) {
Iterable<Album> albums = albumRepository.findAll();
m.addAttribute("albums", albums);
return "Album";
}
@GetMapping("/albums/new")
public String getAddAlbumForm() {
return "AlbumForm";
}
@PostMapping("/addAlbum")
public RedirectView addAlbum(@RequestParam String title, @RequestParam String artist, @RequestParam int songCount, @RequestParam int length,@RequestParam String imageUrl) {
Album album = new Album(title,artist,songCount,length,imageUrl);
albumRepository.save(album);
return new RedirectView("/albums");
}
} | [
"chaitanyanarukulla@gmail.com"
] | chaitanyanarukulla@gmail.com |
d014f8066ef46a5a60d98f74ef72097b31739333 | 559a627496ff3ff7eb771a83a55966cc115be7c9 | /spring-webflux/src/main/java/org/springframework/web/reactive/result/view/Rendering.java | 337456ff6985b9ebbd1ca1f6598fb8d03f7f1edb | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | Danbro007/spring-source-analysis | 8a7cd5c0e382c332319c220ac320cefaea1dc81a | 75dd673b05cb2bb219c361d0447567177c35bc00 | refs/heads/master | 2022-12-10T02:03:13.655449 | 2020-09-14T06:43:51 | 2020-09-14T06:43:51 | 268,418,449 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,526 | java | /*
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.web.reactive.result.view;
import java.util.Collection;
import java.util.Map;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.lang.Nullable;
import org.springframework.ui.Model;
/**
* Public API for HTML rendering. Supported as a return value in Spring WebFlux
* controllers. Comparable to the use of {@code ModelAndView} as a return value
* in Spring MVC controllers.
*
* <p>Controllers typically return a {@link String} view name and rely on the
* "implicit" model which can also be injected into the com.danbro.springmvc.controller method.
* Or controllers may return model attribute(s) and rely on a default view name
* being selected based on the request path.
*
* <p>{@link Rendering} can be used to combine a view name with model attributes,
* set the HTTP status or headers, and for other more advanced options around
* redirect scenarios.
*
* @author Rossen Stoyanchev
* @since 5.0
*/
public interface Rendering {
/**
* Return the selected {@link String} view name or {@link View} object.
*/
@Nullable
Object view();
/**
* Return attributes to add to the model.
*/
Map<String, Object> modelAttributes();
/**
* Return the HTTP status to set the response to.
*/
@Nullable
HttpStatus status();
/**
* Return headers to add to the response.
*/
HttpHeaders headers();
/**
* Create a new builder for response rendering based on the given view name.
* @param name the view name to be resolved to a {@link View}
* @return the builder
*/
static Builder<?> view(String name) {
return new DefaultRenderingBuilder(name);
}
/**
* Create a new builder for a redirect through a {@link RedirectView}.
* @param url the redirect URL
* @return the builder
*/
static RedirectBuilder redirectTo(String url) {
return new DefaultRenderingBuilder(new RedirectView(url));
}
/**
* Defines a builder for {@link Rendering}.
*
* @param <B> a self reference to the builder type
*/
interface Builder<B extends Builder<B>> {
/**
* Add the given model attribute with the supplied name.
* @see Model#addAttribute(String, Object)
*/
B modelAttribute(String name, Object value);
/**
* Add an attribute to the model using a
* {@link org.springframework.core.Conventions#getVariableName generated name}.
* @see Model#addAttribute(Object)
*/
B modelAttribute(Object value);
/**
* Add all given attributes to the model using
* {@link org.springframework.core.Conventions#getVariableName generated names}.
* @see Model#addAllAttributes(Collection)
*/
B modelAttributes(Object... values);
/**
* Add the given attributes to the model.
* @see Model#addAllAttributes(Map)
*/
B model(Map<String, ?> map);
/**
* Specify the status to use for the response.
*/
B status(HttpStatus status);
/**
* Specify a header to add to the response.
*/
B header(String headerName, String... headerValues);
/**
* Specify headers to add to the response.
*/
B headers(HttpHeaders headers);
/**
* Builder the {@link Rendering} instance.
*/
Rendering build();
}
/**
* Extends {@link Builder} with extra options for redirect scenarios.
*/
interface RedirectBuilder extends Builder<RedirectBuilder> {
/**
* Whether to the provided redirect URL should be prepended with the
* application context path (if any).
* <p>By default this is set to {@code true}.
*
* @see RedirectView#setContextRelative(boolean)
*/
RedirectBuilder contextRelative(boolean contextRelative);
/**
* Whether to append the query string of the current URL to the target
* redirect URL or not.
* <p>By default this is set to {@code false}.
*
* @see RedirectView#setPropagateQuery(boolean)
*/
RedirectBuilder propagateQuery(boolean propagate);
}
}
| [
"710170342@qq.com"
] | 710170342@qq.com |
96d454725e03526b355fc2fd3ae9fa93eb70584c | 3bc271314b8e7479c804da7073b539d247600428 | /src/main/java/jabsc/classgen/ClassFileWriterSupplier.java | e4c2e067ef0c65602dd25f5abc0f82414f25a4b2 | [
"Apache-2.0"
] | permissive | peteryhwong/jabsc | 2c099d8260afde3a40979a9b912c4e324bae857b | e01e86cdefaebd4337332b157374fced8b537e00 | refs/heads/master | 2020-04-07T23:46:42.357421 | 2016-04-10T21:30:30 | 2016-04-10T21:30:30 | 40,371,728 | 0 | 0 | null | 2015-08-07T17:10:47 | 2015-08-07T17:10:47 | null | UTF-8 | Java | false | false | 1,941 | java | package jabsc.classgen;
import javassist.bytecode.AccessFlag;
import javassist.bytecode.ClassFile;
import java.nio.file.Path;
import java.util.function.BiFunction;
import javax.lang.model.element.ElementKind;
final class ClassFileWriterSupplier implements BiFunction<String, ElementKind, ClassWriter> {
private final StringBuilder packageName;
private final Path outDirPath;
ClassFileWriterSupplier(String packageName, Path outputDirectory) {
Path outPath = outputDirectory;
for (String packagePart : packageName.split("\\.")) {
outPath = outPath.resolve(packagePart);
}
this.outDirPath = outPath;
this.packageName = new StringBuilder(packageName).append('.');
}
private String getQualifiedName(String unqualifiedName) {
String qualifiedName = this.packageName.append(unqualifiedName).toString();
this.packageName.setLength(this.packageName.length() - unqualifiedName.length());
return qualifiedName;
}
@Override
public ClassWriter apply(String unqualifiedName, ElementKind kind) {
String qualifiedName = getQualifiedName(unqualifiedName);
ClassFile classFile;
switch (kind) {
case CLASS:
case ENUM:
classFile = new ClassFile(false, qualifiedName, null);
classFile.setAccessFlags(classFile.getAccessFlags() | AccessFlag.PUBLIC
| AccessFlag.FINAL);
break;
case INTERFACE:
classFile = new ClassFile(true, qualifiedName, null);
classFile.setAccessFlags(classFile.getAccessFlags() | AccessFlag.PUBLIC);
break;
default:
throw new IllegalArgumentException("Unsupported Java element kind: " + kind);
}
classFile.setMajorVersion(ClassFile.JAVA_8);
return new ClassWriter(outDirPath, classFile);
}
}
| [
"peter.wong@wolfson.oxon.org"
] | peter.wong@wolfson.oxon.org |
e7594996f38c4ec217accb9b222a9d76d3017a51 | 8a6453cd49949798c11f57462d3f64a1fa2fc441 | /aws-java-sdk-chime/src/main/java/com/amazonaws/services/chime/model/DeleteAccountRequest.java | 5b4a62ed92d70f325092e1e0922b907cb617e63b | [
"Apache-2.0"
] | permissive | tedyu/aws-sdk-java | 138837a2be45ecb73c14c0d1b5b021e7470520e1 | c97c472fd66d7fc8982cb4cf3c4ae78de590cfe8 | refs/heads/master | 2020-04-14T14:17:28.985045 | 2019-01-02T21:46:53 | 2019-01-02T21:46:53 | 163,892,339 | 0 | 0 | Apache-2.0 | 2019-01-02T21:38:39 | 2019-01-02T21:38:39 | null | UTF-8 | Java | false | false | 3,471 | java | /*
* Copyright 2013-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.chime.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/chime-2018-05-01/DeleteAccount" target="_top">AWS API
* Documentation</a>
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class DeleteAccountRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
* <p>
* The Amazon Chime account ID.
* </p>
*/
private String accountId;
/**
* <p>
* The Amazon Chime account ID.
* </p>
*
* @param accountId
* The Amazon Chime account ID.
*/
public void setAccountId(String accountId) {
this.accountId = accountId;
}
/**
* <p>
* The Amazon Chime account ID.
* </p>
*
* @return The Amazon Chime account ID.
*/
public String getAccountId() {
return this.accountId;
}
/**
* <p>
* The Amazon Chime account ID.
* </p>
*
* @param accountId
* The Amazon Chime account ID.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DeleteAccountRequest withAccountId(String accountId) {
setAccountId(accountId);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getAccountId() != null)
sb.append("AccountId: ").append(getAccountId());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof DeleteAccountRequest == false)
return false;
DeleteAccountRequest other = (DeleteAccountRequest) obj;
if (other.getAccountId() == null ^ this.getAccountId() == null)
return false;
if (other.getAccountId() != null && other.getAccountId().equals(this.getAccountId()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getAccountId() == null) ? 0 : getAccountId().hashCode());
return hashCode;
}
@Override
public DeleteAccountRequest clone() {
return (DeleteAccountRequest) super.clone();
}
}
| [
""
] | |
5ace68dac711f85e01889a6370d41d97d9f2320a | f9cff69ff4fde06675d9cd0afef7b5996e37e5e6 | /src/main/java/com/learning/springbootrecipeapp/converters/NotesCommandToNotes.java | 37c35616f2d965e0635fc6cd1005a98d0c2c870c | [] | no_license | adityapatwa/spring-boot-recipe-app | e87ef71e2edd3af9f6fd4bea733c9bfedcb65211 | a427c8711ce9cd04387a2546135a13bf714e95e2 | refs/heads/master | 2022-12-04T04:48:44.142975 | 2020-08-21T19:12:29 | 2020-08-21T19:12:29 | 263,955,382 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 766 | java | package com.learning.springbootrecipeapp.converters;
import com.learning.springbootrecipeapp.commands.NotesCommand;
import com.learning.springbootrecipeapp.domain.Notes;
import lombok.Synchronized;
import org.springframework.core.convert.converter.Converter;
import org.springframework.lang.Nullable;
import org.springframework.stereotype.Component;
@Component
public class NotesCommandToNotes implements Converter<NotesCommand, Notes> {
@Synchronized
@Nullable
@Override
public Notes convert(NotesCommand source) {
if (source == null) {
return null;
}
final Notes notes = new Notes();
notes.setId(source.getId());
notes.setRecipeNotes(source.getRecipeNotes());
return notes;
}
}
| [
"adityapatwa@live.com"
] | adityapatwa@live.com |
15f73c2d9cfe131e1c8ea2056fb3b1af2142ce94 | 69df67b8568b7da8ba5527b27e1a90d72aeea4a8 | /src/gui/UserGUI.java | 2c16c46984c28e22d6a01890011bc77ac67a10f9 | [] | no_license | talperetz88/Fleet-management-and-purchasing | 3e68e083f75e406cfa3ad662acf882c46201ab7b | 5a64c571f3d4788c6daf27a91df8145e868eab20 | refs/heads/master | 2021-09-21T23:47:42.180807 | 2018-09-03T13:07:18 | 2018-09-03T13:07:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 13,032 | java | package gui;
import controller.*;
import java.awt.Color;
import java.awt.Component;
import java.awt.EventQueue;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.GridLayout;
import java.awt.Image;
import java.awt.dnd.DropTarget;
import java.awt.dnd.DropTargetDragEvent;
import java.awt.dnd.DropTargetDropEvent;
import java.awt.dnd.DropTargetEvent;
import java.awt.dnd.DropTargetListener;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseListener;
import java.io.File;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import java.sql.*;
import java.sql.Date;
import entity.*;
import javax.swing.ButtonGroup;
import javax.swing.DefaultListCellRenderer;
import javax.swing.DefaultListModel;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;
import javax.swing.JTextField;
import javax.swing.JTree;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.event.ListSelectionListener;
import javax.swing.filechooser.FileSystemView;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.DefaultMutableTreeNode;
import entity.*;
import gui.*;
import java.awt.event.ActionEvent;
import javax.swing.JPopupMenu;
import java.awt.event.MouseEvent;
import java.awt.List;
import javax.swing.JTable;
import javax.swing.border.BevelBorder;
import javax.swing.border.LineBorder;
import javax.swing.table.DefaultTableModel;
import javax.swing.JTextPane;
import java.awt.SystemColor;
import javax.swing.ScrollPaneConstants;
import javax.swing.border.TitledBorder;
import javax.swing.UIManager;
import javax.swing.BoxLayout;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JCheckBox;
import com.toedter.components.JLocaleChooser;
import java.awt.Choice;
import javax.swing.DefaultComboBoxModel;
/**
* this class is GUI of user
* @author G16
*
*/
public class UserGUI extends AbstractGUI {
/** tabs */
private JTabbedPane Tab=null;
/** car order panel*/
private JPanel carOrder;
/** home order panel*/
private JPanel homeOrder;
/** panel*/
private JPanel panel;
/** insert order details label*/
private JLabel lblInsertOrderDetails_1;
/** car label*/
private JLabel lblCar;
/** used to get license plate number*/
private JTextField licensePlateNumberText;
/** used to get quantity*/
private JTextField QuantityTextCar;
/** used to get fuel station id*/
private JTextField FuelStationIdCar;
/** used to get quantity for home fuel*/
private JTextField QuantitiyHomeText;
/** used to get address to supply*/
private JTextField AddressToSupplyHometext;
/** used to get date*/
private JTextField SupplyDateHomeText;
/** used to get time*/
private JTextField SupplyTimeHomeText;
/** scroll pane*/
public JScrollPane scrollPane;
/** table of orders*/
public JTable TableOfOrders;
/** flag for car fuel order button clicked*/
public int carAcceptClick = 0;
/** flag for home fuel order button clicked*/
public int homeAcceptClick = 0;
/** flag for tab 3 clicked*/
public int Tab3Ckick = 0;
/** temporary car fuel order filled with data*/
private CarFuelOrder tempOrder=null;
/** temporary home fuel order filled with data*/
private OrderHomeFuel tempHomeOrder=null;
/** urgent flag*/
private boolean urgentHomeFuelOrder=false;
/** used as table*/
private Object[][] TableRows=null;
/** used to fill the table*/
public DefaultTableModel VecToTable =
new DefaultTableModel(TableRows,new String[] {"order Id",
"invited by id", "quantity", "supply address",
"supply date", "supply time", "order type"});
/** stores fuel type*/
private String fuelType;
/** UserGUI constructor
* @author G16
*/
public UserGUI() {
super();
//Logout button //
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setBounds(100, 100, 780, 600);
this.setTitle("MyFuel - Customer Window");
this.setResizable(false);
getContentPane().setLayout(null);
getContentPane().add(getTab());
this.setVisible(true);
}
/**
* Initialize the contents of the frame.
*/
public JTabbedPane getTab() {
if(Tab==null){
Tab = new JTabbedPane();
Tab.setBounds(0, 137, 765, 373);
Tab.addChangeListener(new TabListener());
//Car fuel order Tab
carOrder = new JPanel();
carOrder.setLayout(null);
Tab.addTab("Car fuel order", carOrder);
JLabel lblInsertOrderDetails = new JLabel("");
lblInsertOrderDetails.setBounds(10, 11, 2, 30);
carOrder.add(lblInsertOrderDetails);
lblInsertOrderDetails_1 = new JLabel("Order details");
lblInsertOrderDetails_1.setFont(new Font("Tahoma", Font.BOLD, 18));
lblInsertOrderDetails_1.setBounds(298, 0, 127, 50);
carOrder.add(lblInsertOrderDetails_1);
lblCar = new JLabel("Car number");
lblCar.setFont(new Font("Tahoma", Font.BOLD, 13));
lblCar.setBounds(177, 51, 147, 30);
carOrder.add(lblCar);
JLabel lblFuelType = new JLabel("Fuel type");
lblFuelType.setFont(new Font("Tahoma", Font.BOLD, 13));
lblFuelType.setBounds(177, 134, 147, 30);
carOrder.add(lblFuelType);
licensePlateNumberText = new JTextField();
licensePlateNumberText.setColumns(10);
licensePlateNumberText.setBounds(334, 57, 220, 20);
carOrder.add(licensePlateNumberText);
JLabel lblQ = new JLabel("Quantity");
lblQ.setFont(new Font("Tahoma", Font.BOLD, 13));
lblQ.setBounds(177, 88, 147, 30);
carOrder.add(lblQ);
QuantityTextCar = new JTextField();
QuantityTextCar.setColumns(10);
QuantityTextCar.setBounds(334, 94, 220, 20);
carOrder.add(QuantityTextCar);
JLabel lblFuelStationId = new JLabel("Fuel Station Id");
lblFuelStationId.setFont(new Font("Tahoma", Font.BOLD, 13));
lblFuelStationId.setBounds(177, 177, 147, 30);
carOrder.add(lblFuelStationId);
FuelStationIdCar = new JTextField();
FuelStationIdCar.setColumns(10);
FuelStationIdCar.setBounds(335, 187, 220, 20);
carOrder.add(FuelStationIdCar);
JButton AcceptButtonCar = new JButton("Accept");
AcceptButtonCar.addActionListener(new addNewCarOrder());
AcceptButtonCar.setBounds(609, 283, 112, 38);
carOrder.add(AcceptButtonCar);
final JComboBox comboBox = new JComboBox();
comboBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
fuelType=(String) comboBox.getSelectedItem();
}
});
comboBox.setModel(new DefaultComboBoxModel(new String[] {"","Diesel","Benzine95","Motors"}));
comboBox.setSelectedIndex(0);
fuelType= (String) comboBox.getSelectedItem();
comboBox.setBounds(334, 140, 220, 20);
carOrder.add(comboBox);
//Home fuel order Tab
homeOrder = new JPanel();
homeOrder.setLayout(null);
Tab.addTab("Home fuel order", homeOrder);
// -----------------------------------------labels Home fuel order start --------------------------------//
JLabel label = new JLabel("Order details");
label.setFont(new Font("Tahoma", Font.BOLD, 18));
label.setBounds(286, 38, 127, 50);
homeOrder.add(label);
JLabel label_2 = new JLabel("Quantity");
label_2.setFont(new Font("Tahoma", Font.BOLD, 13));
label_2.setBounds(121, 102, 147, 30);
homeOrder.add(label_2);
JLabel lblAddressToSupply = new JLabel("Address to supply");
lblAddressToSupply.setFont(new Font("Tahoma", Font.BOLD, 13));
lblAddressToSupply.setBounds(121, 143, 147, 30);
homeOrder.add(lblAddressToSupply);
JLabel lblSupplyDate = new JLabel("Supply date");
lblSupplyDate.setFont(new Font("Tahoma", Font.BOLD, 13));
lblSupplyDate.setBounds(121, 184, 147, 30);
homeOrder.add(lblSupplyDate);
JLabel lblSupplyTime = new JLabel("Supply time");
lblSupplyTime.setFont(new Font("Tahoma", Font.BOLD, 13));
lblSupplyTime.setBounds(121, 225, 147, 30);
homeOrder.add(lblSupplyTime);
QuantitiyHomeText = new JTextField();
QuantitiyHomeText.setColumns(10);
QuantitiyHomeText.setBounds(322, 113, 220, 20);
homeOrder.add(QuantitiyHomeText);
AddressToSupplyHometext = new JTextField();
AddressToSupplyHometext.setColumns(10);
AddressToSupplyHometext.setBounds(322, 150, 220, 20);
homeOrder.add(AddressToSupplyHometext);
SupplyDateHomeText = new JTextField();
SupplyDateHomeText.setColumns(10);
SupplyDateHomeText.setBounds(322, 191, 220, 20);
homeOrder.add(SupplyDateHomeText);
SupplyTimeHomeText = new JTextField();
SupplyTimeHomeText.setColumns(10);
SupplyTimeHomeText.setBounds(322, 232, 220, 20);
homeOrder.add(SupplyTimeHomeText);
JButton AcceptButtonHome = new JButton("Accept");
AcceptButtonHome.addActionListener(new addNewHomeOrder());
AcceptButtonHome.setBounds(594, 283, 112, 38);
homeOrder.add(AcceptButtonHome);
panel = new JPanel();
panel.setBorder(new LineBorder(new Color(0, 0, 0)));
Tab.addTab("Track Orders", panel);
panel.setLayout(null);
scrollPane = new JScrollPane();
scrollPane.setBounds(0, 0, 758, 342);
panel.add(scrollPane);
TableOfOrders = new JTable();
TableOfOrders.setBorder(UIManager.getBorder("Button.border"));
TableOfOrders.setFillsViewportHeight(true);
TableOfOrders.setModel(new DefaultTableModel(
new Object[][] {
{null, null, null, null, null, null, null},
{null, null, null, null, null, null, null},
},
new String[] {
"order Id", "invited by id", "quantity", "supply address", "supply date", "supply time", "order type"
}
));
scrollPane.setViewportView(TableOfOrders);
}
return Tab;
}
/*************Change title*************/
public void setLblWelcome(String UserName)
{
this.setTitle("Hello "+UserName);
}
/*************add new car listener*************/
public class addNewCarOrder implements ActionListener
{
public void actionPerformed(ActionEvent e) {
tempOrder.setLicensePlateNumber(licensePlateNumberText.getText());
tempOrder.setFuel_type(fuelType);
tempOrder.setQuantity(Integer.parseInt(QuantityTextCar.getText()));
tempOrder.setFuel_station_id(Integer.parseInt(FuelStationIdCar.getText()));
carAcceptClick = 1;
}
}
/** add new home listener */
public class addNewHomeOrder implements ActionListener
{
@Override
public void actionPerformed(ActionEvent e) {
tempHomeOrder.setAddressToSupply(AddressToSupplyHometext.getText());
tempHomeOrder.setSupplyTime(SupplyTimeHomeText.getText());
tempHomeOrder.setSupplyDate(SupplyDateHomeText.getText());
tempHomeOrder.setQuantity(Integer.parseInt(QuantitiyHomeText.getText()));
if (tempHomeOrder.getQuantity()>600 && tempHomeOrder.getQuantity()<800)
tempHomeOrder.setOrderType("600-800");
else if (tempHomeOrder.getQuantity()>800) tempHomeOrder.setOrderType("800+");
else if (tempHomeOrder.getQuantity()<600) tempHomeOrder.setOrderType("Under 600");
else if (urgentHomeFuelOrder) {
tempHomeOrder.setOrderType("Urgent");
}
homeAcceptClick=1;
}
}
/** tab listener - used to change tabs */
public class TabListener implements ChangeListener{
@Override
public void stateChanged(ChangeEvent e) {
if (getTab().getSelectedIndex()==0)
UserController.currTab = 1;
if (getTab().getSelectedIndex()==1)
UserController.currTab = 2;
if (getTab().getSelectedIndex()==2)
{
UserController.currTab = 3;
Tab3Ckick=1;
}
}
}
/*************Getters and Setters *************/
public Object[][] getTableRows() {
return TableRows;
}
public void setTableRows(Object[][] tableRows) {
TableRows = tableRows;
}
public OrderHomeFuel getTempHomeOrder() {
return tempHomeOrder;
}
public void setTempHomeOrder(OrderHomeFuel tempHomeOrder) {
this.tempHomeOrder = tempHomeOrder;
}
public CarFuelOrder getTempOrder() {
return tempOrder;
}
public void setTempOrder(CarFuelOrder tempOrder) {
this.tempOrder = tempOrder;
}
}
| [
"noreply@github.com"
] | noreply@github.com |
b53b00801b4dcf6554e80b6cd2dd16d8d1bbdc27 | 49ecb1cb4ce181ad6f5e24449c372e24c4e1061f | /SlideBarForA-Z/gen/com/example/slidebarfora_z/R.java | 9d154ba5a8dd1ce866413641976d409d39a0d86b | [] | no_license | WilliamZhao88/DEMO | 4c67aac329d70a612195f0c6bbaec8cc4aeb1125 | 0b42f58d04523fb4f263e0e128593ad88cc95a66 | refs/heads/master | 2021-05-27T08:59:37.292690 | 2013-09-24T01:05:55 | 2013-09-24T01:05:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,543 | java | /* 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 com.example.slidebarfora_z;
public final class R {
public static final class attr {
}
public static final class dimen {
/** Default screen margins, per the Android Design guidelines.
Customize dimensions originally defined in res/values/dimens.xml (such as
screen margins) for sw720dp devices (e.g. 10" tablets) in landscape here.
*/
public static final int activity_horizontal_margin=0x7f040000;
public static final int activity_vertical_margin=0x7f040001;
}
public static final class drawable {
public static final int ic_launcher=0x7f020000;
}
public static final class id {
public static final int action_settings=0x7f080002;
public static final int float_letter=0x7f080000;
public static final int slidebar=0x7f080001;
}
public static final class layout {
public static final int activity_main=0x7f030000;
}
public static final class menu {
public static final int main=0x7f070000;
}
public static final class string {
public static final int action_settings=0x7f050001;
public static final int app_name=0x7f050000;
public static final int hello_world=0x7f050002;
}
public static final class style {
/**
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
Base application theme for API 11+. This theme completely replaces
AppBaseTheme from res/values/styles.xml on API 11+ devices.
API 11 theme customizations can go here.
Base application theme for API 14+. This theme completely replaces
AppBaseTheme from BOTH res/values/styles.xml and
res/values-v11/styles.xml on API 14+ devices.
API 14 theme customizations can go here.
*/
public static final int AppBaseTheme=0x7f060000;
/** Application theme.
All customizations that are NOT specific to a particular API-level can go here.
*/
public static final int AppTheme=0x7f060001;
}
}
| [
"1449641702@qq.com"
] | 1449641702@qq.com |
ce8055893841575bf90890c80d869a653dabcfab | 256e0b1c8a9699e868769ed3bc62531f6e36ca6c | /src/FlightReservation/Regular_Ticket.java | 750ac0df92cc0dd5380a83ade9e0dceac38782fd | [] | no_license | mayuravachat9850/Reservation_System | e0603ef9d086511df39d5a82dbf18bd3ca05066c | 1cc383c7d17e280b2ee7e8f2ed922e09759165df | refs/heads/master | 2023-07-12T11:31:42.783788 | 2021-07-30T15:34:22 | 2021-07-30T15:34:22 | 389,031,951 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 694 | java | package FlightReservation;
public class Regular_Ticket extends Ticket{
private String specialServices;
public Regular_Ticket(String pnr, String from, String to, Flight flight, String departureDateTime, String arrivalDateTime, String seatNo, float price, boolean cancelled, Passenger passenger, String specialServices) {
super(pnr, from, to, flight, departureDateTime, arrivalDateTime, seatNo, price, cancelled, passenger);
this.specialServices = specialServices;
}
public String getSpecialServices() {
return specialServices;
}
public void setSpecialServices(String specialServices) {
this.specialServices = specialServices;
}
}
| [
"87423951+mayuravachat9850@users.noreply.github.com"
] | 87423951+mayuravachat9850@users.noreply.github.com |
0017aa09894fca3194bd11bc5c6ff9c69067016e | f70bc0c4e31700088730465dd4fe6519c497c604 | /be/src/main/java/shop/goodcasting/api/user/actor/repository/ActorRepository.java | 80a3cfbea837c50cba304df9fb1fef621a97baff | [] | no_license | korjjh1216/goodcasting-repo | e1d5777b6aafd218b593c2444a92f54292319773 | 4dca1b2d37c3749d4dd0783b5fe47bfb2f295bc5 | refs/heads/main | 2023-04-29T23:56:51.569164 | 2021-05-18T02:46:56 | 2021-05-18T02:46:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 302 | java | package shop.goodcasting.api.user.actor.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import shop.goodcasting.api.user.actor.domain.Actor;
@Repository
public interface ActorRepository extends JpaRepository<Actor, Long> {
} | [
"70367265+cksdnr3@users.noreply.github.com"
] | 70367265+cksdnr3@users.noreply.github.com |
541be512301a063dffe63d346bf006eda712c25b | 28e72a411bda70d4df14bc0661ca8f2e6925ba20 | /sistemaApressa/src/java/br/edu/ifpb/medelo/ValidaUser.java | d085a7cc955fc22d5ff8c289a1efed52abd89df4 | [] | no_license | joseferreir/sistemaX | 28c7d704415987439dd4bb2cd8d9a97387d29c45 | 4bb8c2c05541a851f009cc93217035d99fd1bb89 | refs/heads/master | 2021-01-10T09:20:48.778505 | 2016-02-16T13:54:25 | 2016-02-16T13:54:25 | 51,009,805 | 0 | 1 | null | 2016-02-15T10:49:16 | 2016-02-03T15:41:47 | JavaScript | UTF-8 | Java | false | false | 1,964 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package br.edu.ifpb.medelo;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
*
* @author José
*/
public class ValidaUser {
private final static String EXPRESSAO_REGULAR_SENHA_FORTE = "^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%^&+=])(?=\\S+$).{8,16}$";
private final static String EXPRESSAO_REGULAR_EMAIL = "^[\\w\\.-]+@([\\w\\-]+\\.)+[A-Z]{2,3}$";
private final static String EXPRESSAO_REGULAR_MATRICULA = "[0-9]{6}";
private final static String EXPRESSAO_REGULAR_NOME = "[A-Za-z0-9.]+";
public static boolean validaPassword(final String password) {
Pattern p = Pattern.compile(EXPRESSAO_REGULAR_SENHA_FORTE);
Matcher m = p.matcher(password);
return m.matches();
}
public static boolean validaNome(final String nome) {
Pattern p = Pattern.compile(EXPRESSAO_REGULAR_NOME);
Matcher m = p.matcher(nome);
return m.matches();
}
public static boolean validarEmail(String email) {
boolean isEmailIdValid = false;
if (email != null && email.length() > 0) {
Pattern pattern = Pattern.compile(EXPRESSAO_REGULAR_EMAIL, Pattern.CASE_INSENSITIVE);
Matcher matcher = pattern.matcher(email);
if (matcher.matches()) {
isEmailIdValid = true;
}
}
return isEmailIdValid;
}
public static boolean validaMatricula(String matricula) {
Pattern pattern = Pattern.compile(EXPRESSAO_REGULAR_MATRICULA);
Matcher matcher = pattern.matcher(matricula);
if (matcher.find() && matcher.group().equals(matricula)) {
return true;
} else {
return false;
}
}
}
| [
"joseferreiravieira123@gmail.com"
] | joseferreiravieira123@gmail.com |
2624d64843deaddd42b62b40200f0793e224c82e | 08ffc2f854ba9b6bbbaba1e6539c65a6ee2a098c | /app/src/main/java/com/zyh/wanandroid/http/AddCookiesInterceptor.java | 4c36582805072ae2ae10f3ecef34f70f612b0c70 | [] | no_license | ranlegerandev/WanAndroid | c34aec4c8c44b5352fd11bae3d8210979dbdecb2 | c7f850d9978ad1ba2e745e6cbb044582695fe87f | refs/heads/master | 2021-10-19T04:43:30.399491 | 2019-02-18T06:22:43 | 2019-02-18T06:22:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,303 | java | package com.zyh.wanandroid.http;
import android.support.annotation.NonNull;
import android.util.Log;
import java.io.IOException;
import java.util.Locale;
import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.ResponseBody;
/**
* @author zyh
* @date 2019/1/17
*/
class AddCookiesInterceptor implements Interceptor {
@Override
public Response intercept(@NonNull Chain chain) throws IOException {
Request.Builder builder = chain.request().newBuilder();
//请求发起的时间
long t1 = System.nanoTime();
//收到响应的时间
Request request = builder.build();
long t2 = System.nanoTime();
Log.i("zyh", String.format("发送请求 %s on %s%n%s",
request.url(), request.toString(), request.headers()));
Response response = chain.proceed(request);
ResponseBody responseBody = response.peekBody(1024 * 1024);
String responseStr = String.format(Locale.getDefault(),
"接收响应: [%s] %n返回json:【%s】 %.1fms%n%s",
response.request().url(),
responseBody.string(),
(t2 - t1) / 1e6d,
response.headers());
Log.i("zyh", responseStr);
return response;
}
}
| [
"88421876@cnsuning.com"
] | 88421876@cnsuning.com |
34f984bd8c3e201aef9fdc750017deb8c23c2980 | f4f59dbed09e4d0599f27c3d0fbf053592c73e72 | /OOPDesignAssignment1/src/com/StrategyPattern/FlyingBehaviour/JetFlying.java | 77761039433f8c48d46e28effcae2085cf8793bc | [] | no_license | ArafathBaig/Coding-Practice | 8db90746c3dcc009c159d3c2469e04b0404dfa15 | 958f6772d51629a177cc25fa9474bdca0ad6da08 | refs/heads/main | 2023-07-17T06:22:49.325588 | 2021-09-09T15:17:03 | 2021-09-09T15:17:03 | 301,646,051 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 204 | java | package com.StrategyPattern.FlyingBehaviour;
public class JetFlying implements IFlyingBehaviour {
@Override
public void fly() {
System.out.println("Flying at a greater speed.");
}
}
| [
"arafath.moghul@gmail.com"
] | arafath.moghul@gmail.com |
91d34b0f9cfe165899f2aa37894b996e9712c6e5 | 4aaea0be3ae10e052afb1ec355debe263ea05a59 | /src/test/java/CaseStudy/CaseStudy/pagefac.java | 108989a7602a5f24d00a677e7be421cb22057187 | [] | no_license | tilakravi/tilakravi | eed65b4c10261bc269b90f5be1182313e10fbdb7 | 96a2f2d8d4df7b89d0239725f31d7bbb3cb45588 | refs/heads/master | 2020-09-13T20:28:51.928978 | 2019-11-20T09:21:42 | 2019-11-20T09:21:42 | 222,894,726 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 873 | java | package CaseStudy.CaseStudy;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.CacheLookup;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.How;
public class pagefac {
WebDriver driver;
/* By username = By.name("userName");
By password = By.name("password");
By loginbutton = By.name("login");*/
public pagefac(WebDriver driver) {
this.driver = driver;
}
@FindBy(name="userName")
@CacheLookup
WebElement username;
@FindBy(how = How.NAME, using = "password")
@CacheLookup
WebElement pass;
@FindBy(name="login")
@CacheLookup
WebElement btn;
public void login_new(String uid, String pwd) {
username.sendKeys(uid);
pass.sendKeys(pwd);
btn.click();
}
}
| [
"Training_C2A.04.30@CDC2-D-48C7N62.dir.svc.accenture.com"
] | Training_C2A.04.30@CDC2-D-48C7N62.dir.svc.accenture.com |
7a70b1aff9c67ae53f82413848e4ba21f354af40 | fc148de5223153c6e6171205024eb0bd5d6e106c | /PrimeHighCharts/src/java/br/com/PrimeHighCharts/Servlets/PontosHC.java | 922859923bfea05c5e6ae4dcc6b2e2281d4d4ffc | [] | no_license | TiagoLuisSilva/HighCharts | 343ddef15c23a6b24be2dad00edcd223cb43eb72 | 40918569a60cdc427a968720ca959f0cc8627f07 | refs/heads/master | 2016-08-03T17:05:32.293174 | 2013-04-18T19:14:25 | 2013-04-18T19:14:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,885 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package br.com.PrimeHighCharts.Servlets;
import br.com.PrimeHighCharts.Model.Paises;
import com.google.gson.Gson;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Random;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
*
* @author TIAGO
*/
public class PontosHC extends HttpServlet {
/**
* Processes requests for both HTTP
* <code>GET</code> and
* <code>POST</code> methods.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
try {
/* TODO output your page here. You may use following sample code. */
out.println("<html>");
out.println("<head>");
out.println("<title>Servlet PontosHC</title>");
out.println("</head>");
out.println("<body>");
out.println("<h1>Servlet PontosHC at " + request.getContextPath() + "</h1>");
out.println("</body>");
out.println("</html>");
} finally {
out.close();
}
}
// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
/**
* Handles the HTTP
* <code>GET</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
ArrayList<Paises> lpaises = new ArrayList<Paises>();
ArrayList valores;
valores = gerarvalores();
Paises pais = new Paises("Brazil", valores);
lpaises.add(pais);
valores = gerarvalores();
pais = new Paises("Venezuela", valores);
lpaises.add(pais);
valores = gerarvalores();
pais = new Paises("Argentina", valores);
lpaises.add(pais);
Gson gson = new Gson();
String json = gson.toJson(lpaises);
response.setContentType("text/plain");
response.setCharacterEncoding("UTF-8");
response.getWriter().write(json);
}
public ArrayList gerarvalores() {
Random rd = new Random();
ArrayList valores = new ArrayList();
double valor = 0;
for (int i = 0; i < 9; i++) {
valor = rd.nextInt(30);
valores.add(valor);
}
return valores;
}
/**
* Handles the HTTP
* <code>POST</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Returns a short description of the servlet.
*
* @return a String containing servlet description
*/
@Override
public String getServletInfo() {
return "Short description";
}// </editor-fold>
}
| [
"tiago.silva@linkpartners.com.br"
] | tiago.silva@linkpartners.com.br |
66e869e7b85d9d745c813b0c389de60403d1c344 | 77333f854352b75a5ff747e614091be8ea7c4770 | /src/main/java/com/chinabox/delivery/service/RestControllerService.java | 770b575b663db50f70d8e399f4eac907b62185dc | [] | no_license | raspbian29/ChinaDelivery-java-spring | 1b188ac60896d0272628d0edce85a690ff7ec5db | 1317a5a79774e7a001de8f6b8d7713d05ee89fd8 | refs/heads/main | 2023-04-05T01:16:56.059396 | 2021-03-29T16:55:23 | 2021-03-29T16:55:23 | 313,969,341 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,227 | java | package com.chinabox.delivery.service;
import com.chinabox.delivery.dao.AuthTokenRepository;
import com.chinabox.delivery.model.AuthToken;
import com.chinabox.delivery.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Scope;
import org.springframework.context.annotation.ScopedProxyMode;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.WebApplicationContext;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
@CrossOrigin(origins = "http://localhost:4200")
@RestController
public class RestControllerService {
private @Autowired
HttpServletRequest request;
@Autowired
@Resource
AuthTokenRepository authTokenRepository;
@Bean
@Scope(value = WebApplicationContext.SCOPE_REQUEST, proxyMode = ScopedProxyMode.TARGET_CLASS)
public User requestUser() {
AuthToken authToken = this.authTokenRepository.getByKey(request.getHeader("Authorization"));
return authToken == null ? null : authToken.getUser();
}
}
| [
"talmaci.victor@gmail.com"
] | talmaci.victor@gmail.com |
479c5796d6503f97d1c0c7110609d06a8bb82616 | e7f5805ee4cff703ef98267d322b2ca51e39f1cb | /app/src/main/java/com/codemobiles/myauthen/FeedSOAPFragment.java | dc0b5da05032bfad1ed1a3646e6d97965b657ca5 | [] | no_license | SuruchBoss/Data-Feed-Example | 755b356583cb190adfb5310e83c830636f495bba | b84f6a73ba192f4c261f7fc45056306a580c6cbe | refs/heads/master | 2021-01-19T20:11:57.485722 | 2017-04-17T09:28:50 | 2017-04-17T09:28:50 | 88,493,297 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,178 | java | package com.codemobiles.myauthen;
import android.graphics.Typeface;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.Toast;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
/**
* A simple {@link Fragment} subclass.
*/
public class FeedSOAPFragment extends Fragment
{
private TextView mDieselTextView;
private TextView mE85TextView;
private TextView mE20TextView;
private TextView mGas91TextView;
private TextView mGas95TextView;
private View v;
public FeedSOAPFragment()
{
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState)
{
v = inflater.inflate(R.layout.fragment_feed_soap, container, false);
bindWidget();
setFont();
new WebServiceTask().execute();
return v;
}
private void setFont()
{
// set custom font
Typeface type = Typeface.createFromAsset(getActivity().getAssets(), "ds_digital.TTF");
mDieselTextView.setTypeface(type);
mE85TextView.setTypeface(type);
mE20TextView.setTypeface(type);
mGas91TextView.setTypeface(type);
mGas95TextView.setTypeface(type);
}
private void bindWidget()
{
mDieselTextView = (TextView) v.findViewById(R.id.dieselTextView);
mE85TextView = (TextView) v.findViewById(R.id.e85TextView);
mE20TextView = (TextView) v.findViewById(R.id.e20TextView);
mGas91TextView = (TextView) v.findViewById(R.id.gas91TextView);
mGas95TextView = (TextView) v.findViewById(R.id.gas95TextView);
}
public class WebServiceTask extends AsyncTask<String, Void, String>
{
@Override
protected void onPreExecute()
{
super.onPreExecute();
Toast.makeText(getActivity(), "Loading....", Toast.LENGTH_SHORT).show();
mDieselTextView.setText("Loading....");
mGas91TextView.setText("Loading....");
mGas95TextView.setText("Loading....");
mE20TextView.setText("Loading....");
mE85TextView.setText("Loading....");
}
@Override
protected String doInBackground(String... params)
{
String result = CMWebservice.getCurrentOilPrice();
Log.i("Codemobiles_log", result);
String output = CMWeatherWS.GetCitiesByCountry("Japan");
Log.i("Codemobiles_Weather", output);
return result;
}
@Override
protected void onPostExecute(String s)
{
super.onPostExecute(s);
CMXMLParser parser = new CMXMLParser();
Document doc = parser.getDomElement(s);
NodeList nl = doc.getElementsByTagName("DataAccess");
/* Element item = (Element) nl.item(0);
String price = parser.getValue(item, "PRICE");
mE20TextView.setText(price);*/
//Loop insert value
for (int j = 0; j < nl.getLength(); j++)
{
Element e = (Element) nl.item(j);
String product = parser.getValue(e, "PRODUCT").trim();
String price = parser.getValue(e, "PRICE").trim();
if (product.equals("Blue Diesel"))
{
mDieselTextView.setText(price);
} else if (product.equals("Blue Gasohol E85"))
{
mE85TextView.setText(price);
} else if (product.equals("Blue Gasohol E20"))
{
mE20TextView.setText(price);
} else if (product.equals("Blue Gasohol 91"))
{
mGas91TextView.setText(price);
} else if (product.equals("Blue Gasohol 95"))
{
mGas95TextView.setText(price);
}
}
}
}
}
| [
"bossxiii@gmail.com"
] | bossxiii@gmail.com |
c8d99be1190f5deba1c887bb0cab59cfca0010fb | 884b3346532e42960de6ce2a454cddabf97ee25e | /src/androidTest/java/com/example/anita/mychatapp/ApplicationTest.java | f147e89a10c586a4d8dfd31e81c743e5180e10b4 | [] | no_license | Anitaps/SimpleCalculator | 6856996b246c8a5b0a70bbc00dfc3ac3caafe0ed | 198805a031dd81e21176c02adf09cfe9c2ec27ac | refs/heads/master | 2021-07-15T15:24:28.851220 | 2017-10-20T17:06:06 | 2017-10-20T17:06:06 | 107,695,155 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 370 | java | package com.example.anita.mychatapp;
import android.app.Application;
import android.test.ApplicationTestCase;
/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
} | [
"noreply@github.com"
] | noreply@github.com |
8b87d7458545d5c81678d2c9968d0f6ef9097520 | 631a405d65ddb0cd96da8a0bc073d9068f33cdb8 | /src/test/java/com/company/controller/BoardControllerTest.java | 1ebadc22fbb267d729d3a9c0c3916e7990bb2469 | [] | no_license | lgh7418/project_community | 92cc47ffac6aa79a7362b57cfabdb72619b84f32 | 9eaf54b407136534f80a2caa5e285c919382e311 | refs/heads/master | 2022-12-22T10:31:49.496903 | 2019-06-17T01:27:17 | 2019-06-17T01:27:17 | 187,778,762 | 0 | 0 | null | 2022-12-16T00:44:16 | 2019-05-21T06:52:37 | Java | UTF-8 | Java | false | false | 2,963 | java | package com.company.controller;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;
import com.company.config.RootConfig;
import com.company.config.ServletConfig;
import lombok.Setter;
import lombok.extern.log4j.Log4j;
@RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration
@ContextConfiguration(classes = {RootConfig.class, ServletConfig.class})
@Log4j
public class BoardControllerTest {
@Setter(onMethod_ = { @Autowired })
private WebApplicationContext ctx;
private MockMvc mockMvc;
@Before
public void setup() {
this.mockMvc = MockMvcBuilders.webAppContextSetup(ctx).build();
}
//@Test
public void testList() throws Exception {
log.info(mockMvc.perform(MockMvcRequestBuilders
.get("/board/list"))
.andReturn().getModelAndView().getModelMap());
}
//@Test
public void testRegister() throws Exception {
String resultPage = mockMvc.perform(MockMvcRequestBuilders
.post("/board/register")
.param("title", "테스트 새글 제목")
.param("content", "테스트 새글 내용")
.param("writer", "user00"))
.andReturn().getModelAndView().getViewName();
log.info(resultPage);
}
//@Test
public void testGet() throws Exception {
log.info(mockMvc.perform(MockMvcRequestBuilders
.get("/board/get")
.param("bno", "1"))
.andReturn().getModelAndView().getModelMap());
}
//@Test
public void testModify() throws Exception {
String resultPage = mockMvc.perform(MockMvcRequestBuilders
.post("/board/modify")
.param("bno", "1")
.param("title", "수정된 테스트 새글 제목")
.param("content", "수정된 테스트 새글 내용")
.param("writer", "user00"))
.andReturn().getModelAndView().getViewName();
log.info(resultPage);
}
//@Test
public void testRemove() throws Exception {
String resultPage = mockMvc.perform(MockMvcRequestBuilders
.post("/board/remove")
.param("bno", "25"))
.andReturn().getModelAndView().getViewName();
log.info(resultPage);
}
@Test
public void testListPaging() throws Exception {
log.info(mockMvc.perform(
MockMvcRequestBuilders.get("/board/list")
.param("pageNum", "2")
.param("amount", "50"))
.andReturn().getModelAndView().getModelMap());
}
}
| [
"lgh7418@gmial.com"
] | lgh7418@gmial.com |
1e31391f4038692336cf1478e7ae6da9497acfda | 1ee9c4fe14f108d1c57ac5bee23737cf55446df2 | /MyLogisticsServer/doc/logback-1.1.2/logback-examples/src/main/java/chapters/onJoran/implicit/PrintMeImplicitAction.java | 6d096c0adbe83e647fab2ebd17b84f1b4bb250a0 | [] | no_license | xinxiamu/MuStudy | 8c50c10b80f8454dcacf367b707faf7148e3ed30 | 928e95f6b1ee82bd957424132e75728ec1be64a4 | refs/heads/master | 2022-07-23T23:59:55.725214 | 2019-05-03T15:08:13 | 2019-05-03T15:08:13 | 87,512,690 | 0 | 4 | null | 2022-07-01T20:50:51 | 2017-04-07T06:28:59 | JavaScript | UTF-8 | Java | false | false | 1,425 | java | /**
* Logback: the reliable, generic, fast and flexible logging framework.
* Copyright (C) 1999-2013, QOS.ch. All rights reserved.
*
* This program and the accompanying materials are dual-licensed under
* either the terms of the Eclipse Public License v1.0 as published by
* the Eclipse Foundation
*
* or (per the licensee's choosing)
*
* under the terms of the GNU Lesser General Public License version 2.1
* as published by the Free Software Foundation.
*/
package chapters.onJoran.implicit;
import ch.qos.logback.core.joran.spi.ElementPath;
import org.xml.sax.Attributes;
import ch.qos.logback.core.joran.action.ImplicitAction;
import ch.qos.logback.core.joran.spi.InterpretationContext;
/**
*
* A rather trivial implicit action which is applicable if an element has a
* printme attribute set to true.
*
* @author Ceki Gülcü
*/
public class PrintMeImplicitAction extends ImplicitAction {
public boolean isApplicable(ElementPath elementPath, Attributes attributes,
InterpretationContext ec) {
String printmeStr = attributes.getValue("printme");
return Boolean.valueOf(printmeStr).booleanValue();
}
public void begin(InterpretationContext ec, String name, Attributes attributes) {
System.out.println("Element [" + name + "] asked to be printed.");
}
public void end(InterpretationContext ec, String name) {
}
}
| [
"932852117@qq.com"
] | 932852117@qq.com |
e883079be70e1f2138857651a2e4fb14df41daea | 84a19db0c6ea3397a3b75a1338bac71882317564 | /Inheritance/src/com/gill/Outlander.java | adaad0e38fad1f598afe8cc9bec7c6db4f40de14 | [] | no_license | rsgillit/JavaMasterClass | d785a63948b5af64a738993b7d74782dff763c2b | 0117e319303402a86a064caa7c99cca1b2249cd0 | refs/heads/master | 2020-09-13T12:35:46.306214 | 2019-12-20T22:13:24 | 2019-12-20T22:13:24 | 222,781,984 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 842 | java | package com.gill;
public class Outlander extends Car {
private int roadServiceMonths;
public Outlander(int roadServiceMonths) {
super("Outlander", "4WD", 5, 5, 6, false);
this.roadServiceMonths = roadServiceMonths;
}
public void accelerate(int rate) {
int newVelocity = getCurrentVelocity() + rate;
if(newVelocity == 0) {
stop();
changeGear(1);
} else if(newVelocity >0 && newVelocity <= 10) {
changeGear(1);
} else if (newVelocity >10 && newVelocity <=20) {
changeGear(2);
} else if (newVelocity >20 && newVelocity <=30) {
changeGear(3);
} else {
changeGear(4);
}
if(newVelocity > 0 ){
changeVelocity(newVelocity, getCurrentDirection());
}
}
}
| [
"rsgillit@gmail.com"
] | rsgillit@gmail.com |
55512ac34eee2042f1dde803392e1dd5d1accc8c | 4aa90348abcb2119011728dc067afd501f275374 | /app/src/main/java/android/support/v7/widget/ButtonBarLayout.java | ddb2c9cb4159a8b0308ba3ae4d6acf8cb6d5dacb | [] | no_license | jambestwick/HackWechat | 0d4ceb2d79ccddb45004ca667e9a6a984a80f0f6 | 6a34899c8bfd50d19e5a5ec36a58218598172a6b | refs/heads/master | 2022-01-27T12:48:43.446804 | 2021-12-29T10:36:30 | 2021-12-29T10:36:30 | 249,366,791 | 0 | 0 | null | 2020-03-23T07:48:32 | 2020-03-23T07:48:32 | null | UTF-8 | Java | false | false | 2,550 | java | package android.support.v7.widget;
import android.content.Context;
import android.content.res.TypedArray;
import android.os.Build.VERSION;
import android.support.v4.view.z;
import android.support.v7.a.a.f;
import android.support.v7.a.a.k;
import android.util.AttributeSet;
import android.view.View;
import android.view.View.MeasureSpec;
import android.widget.LinearLayout;
import com.tencent.smtt.sdk.WebView;
public class ButtonBarLayout extends LinearLayout {
private boolean Qp;
private int Qq = -1;
public ButtonBarLayout(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, k.ButtonBarLayout);
this.Qp = obtainStyledAttributes.getBoolean(k.ButtonBarLayout_allowStacking, false);
obtainStyledAttributes.recycle();
}
protected void onMeasure(int i, int i2) {
int i3;
boolean z;
boolean z2 = false;
int size = MeasureSpec.getSize(i);
if (this.Qp) {
if (size > this.Qq && eB()) {
L(false);
}
this.Qq = size;
}
if (eB() || MeasureSpec.getMode(i) != 1073741824) {
i3 = i;
z = false;
} else {
i3 = MeasureSpec.makeMeasureSpec(size, Integer.MIN_VALUE);
z = true;
}
super.onMeasure(i3, i2);
if (this.Qp && !eB()) {
if (VERSION.SDK_INT < 11) {
int i4 = 0;
for (i3 = 0; i3 < getChildCount(); i3++) {
i4 += getChildAt(i3).getMeasuredWidth();
}
if ((getPaddingLeft() + i4) + getPaddingRight() > size) {
z2 = true;
}
} else if ((z.L(this) & WebView.NIGHT_MODE_COLOR) == 16777216) {
z2 = true;
}
if (z2) {
L(true);
z = true;
}
}
if (z) {
super.onMeasure(i, i2);
}
}
private void L(boolean z) {
setOrientation(z ? 1 : 0);
setGravity(z ? 5 : 80);
View findViewById = findViewById(f.spacer);
if (findViewById != null) {
findViewById.setVisibility(z ? 8 : 4);
}
for (int childCount = getChildCount() - 2; childCount >= 0; childCount--) {
bringChildToFront(getChildAt(childCount));
}
}
private boolean eB() {
return getOrientation() == 1;
}
}
| [
"malin.myemail@163.com"
] | malin.myemail@163.com |
9250000417143b60acd11c6cf5e4663586d886b6 | 0a3d83ea74adb67748900bc4fdae3cffd096868c | /program practise/pattern8.java | 81d4dd21de49cbbb91ab48f49cc03a3b0aa51788 | [
"MIT"
] | permissive | yugandar/javatask | 72cf9f9ab6b8518c63fbd135c611e20cdcccaed1 | 4703cd0abf708ab221a7c69618e319561d9ef36b | refs/heads/master | 2021-01-22T06:12:37.200687 | 2017-08-30T06:11:20 | 2017-08-30T06:11:20 | 92,532,022 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 344 | java | import java.util.Scanner;
class pattern8
{
public static void main(String[] args)
{
Scanner s = new Scanner(System.in);
System.out.println("enter the number");
int n =s.nextInt();
for(int i=n; i>=0; i--)
{
for( int j=1; j<=i; j++)
{
if((i+j)%2==0){
System.out.print("1");
}else{
System.out.print("0");
}
}
System.out.println();
}
}
}
| [
"yugandar.bala@gmail.com"
] | yugandar.bala@gmail.com |
de303b7f4c10e1c65a393b1fc7b0ec45f5152179 | a333924934a02aa261dc85eaa59ed49762221c76 | /gmol_v2.0/gmol_linux_2.0/src/org/jmol/i18n/GT.java | f9aca4781c19819ed1d87f54bd7673cdd012ec3c | [] | no_license | LingfeiXu/Gmol | 1191ab7da17cba37e7d040aa5fd61b4619badc59 | 4d0e12070c8c5a6c3712e32bb62730d5f600e575 | refs/heads/master | 2021-01-11T04:57:17.477616 | 2015-05-24T23:54:08 | 2015-05-24T23:54:08 | 26,931,784 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 18,135 | java | /* $RCSfile$
* $Author: nicove $
* $Date: 2012-08-26 11:11:54 -0500 (Sun, 26 Aug 2012) $
* $Revision: 17481 $
*
* Copyright (C) 2005 Miguel, Jmol Development, www.jmol.org
*
* Contact: jmol-developers@lists.sf.net
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package org.jmol.i18n;
import java.text.MessageFormat;
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import org.jmol.util.Logger;
public class GT {
private static boolean ignoreApplicationBundle = false;
private static GT getTextWrapper;
private ResourceBundle[] translationResources = null;
private int translationResourcesCount = 0;
private boolean doTranslate = true;
private String language;
public GT(String la) {
getTranslation(la);
}
private GT() {
getTranslation(null);
}
// =============
// Language list
// =============
public static class Language {
public final String code;
public final String language;
public final String nativeLanguage;
private boolean display;
/**
* @param code Language code (see ISO 639-1 for the values)
* @param language Language name in English (see ISO 639-1 for the values)
* @param nativeLanguage Language name in its own language (see ISO 639-1 for the values)
* @param display True if this language has a good percentage of translations done
*
* {@link "http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes"}
*/
public Language(String code, String language, String nativeLanguage, boolean display) {
this.code = code;
this.language = language;
this.nativeLanguage = nativeLanguage;
this.display = display;
}
public boolean shouldDisplay() {
return display;
}
public void forceDisplay() {
display = true;
}
}
private static Language[] languageList;
//private static String languagePath;
public static Language[] getLanguageList() {
return (languageList != null ? languageList : getTextWrapper().createLanguageList());
}
/**
* This is the place to put the list of supported languages. It is accessed
* by JmolPopup to create the menu list. Note that the names are in GT._
* even though we set doTranslate false. That ensures that the language name
* IN THIS LIST is untranslated, but it provides the code xgettext needs in
* order to provide the list of names that will need translation by translators
* (the .po files). Later, in JmolPopup.updateLanguageMenu(), GT._() is used
* again to create the actual, localized menu item name.
*
* list order:
*
* The order presented here is the order in which the list will be presented in the
* popup menu. In addition, the order of variants is significant. In all cases, place
* common-language entries in the following order:
*
* la_co_va
* la_co
* la
*
* In addition, there really is no need for "la" by itself. Every translator introduces
* a bias from their originating country. It would be perfectly fine if we had NO "la"
* items, and just la_co. Thus, we could have just:
*
* pt_BR
* pt_PT
*
* In this case, the "default" language translation should be entered LAST.
*
* If a user selects pt_ZQ, the code below will find (a) that we don't support pt_ZQ,
* (b) that we don't support pt_ZQ_anything, (c) that we don't support pt, and, finally,
* that we do support pt_PT, and it will select that one, returning to the user the message
* that language = "pt_PT" instead of pt_ZQ.
*
* For that matter, we don't even need anything more than
*
* la_co_va
*
* because the algorithm will track that down from anything starting with la, and in all cases
* find the closest match.
*
* Introduced in Jmol 11.1.34
* Author Bob Hanson May 7, 2007
* @return list of codes and untranslated names
*/
synchronized private Language[] createLanguageList() {
boolean wasTranslating = doTranslate;
doTranslate = false;
languageList = new Language[] {
new Language("ar", GT._("Arabic"), "العربية", false),
new Language("ast", GT._("Asturian"), "Asturian", false),
new Language("az", GT._("Azerbaijani"), "azərbaycan dili", false),
new Language("bs", GT._("Bosnian"), "bosanski jezik", false),
new Language("ca", GT._("Catalan"), "Català", true),
new Language("cs", GT._("Czech"), "Čeština", true),
new Language("da", GT._("Danish"), "Dansk", true),
new Language("de", GT._("German"), "Deutsch", true),
new Language("el", GT._("Greek"), "Ελληνικά", false),
new Language("en_AU", GT._("Australian English"), "Australian English", false),
new Language("en_GB", GT._("British English"), "British English", true),
new Language("en_US", GT._("American English"), "American English", true), // global default for "en" will be "en_US"
new Language("es", GT._("Spanish"), "Español", true),
new Language("et", GT._("Estonian"), "Eesti", false),
new Language("eu", GT._("Basque"), "Euskara", true),
new Language("fi", GT._("Finnish"), "Suomi", true),
new Language("fo", GT._("Faroese"), "Føroyskt", false),
new Language("fr", GT._("French"), "Français", true),
new Language("fy", GT._("Frisian"), "Frysk", false),
new Language("gl", GT._("Galician"), "Galego", false),
new Language("hr", GT._("Croatian"), "Hrvatski", false),
new Language("hu", GT._("Hungarian"), "Magyar", true),
new Language("hy", GT._("Armenian"), "Հայերեն", false),
new Language("id", GT._("Indonesian"), "Indonesia", true),
new Language("it", GT._("Italian"), "Italiano", true),
new Language("ja", GT._("Japanese"), "日本語", true),
new Language("jv", GT._("Javanese"), "Basa Jawa", false),
new Language("ko", GT._("Korean"), "한국어", true),
new Language("ms", GT._("Malay"), "Bahasa Melayu", true),
new Language("nb", GT._("Norwegian Bokmal"), "Norsk Bokmål", false),
new Language("nl", GT._("Dutch"), "Nederlands", true),
new Language("oc", GT._("Occitan"), "Occitan", false),
new Language("pl", GT._("Polish"), "Polski", false),
new Language("pt", GT._("Portuguese"), "Português", false),
new Language("pt_BR", GT._("Brazilian Portuguese"), "Português brasileiro", true),
new Language("ru", GT._("Russian"), "Русский", false),
new Language("sl", GT._("Slovenian"), "Slovenščina", false),
new Language("sr", GT._("Serbian"), "српски језик", false),
new Language("sv", GT._("Swedish"), "Svenska", true),
new Language("ta", GT._("Tamil"), "தமிழ்", false),
new Language("te", GT._("Telugu"), "తెలుగు", false),
new Language("tr", GT._("Turkish"), "Türkçe", true),
new Language("ug", GT._("Uyghur"), "Uyƣurqə", false),
new Language("uk", GT._("Ukrainian"), "Українська", true),
new Language("uz", GT._("Uzbek"), "O'zbek", false),
new Language("zh_CN", GT._("Simplified Chinese"), "简体中文", true),
new Language("zh_TW", GT._("Traditional Chinese"), "繁體中文", true),
};
doTranslate = wasTranslating;
return languageList;
}
private String getSupported(String languageCode, boolean isExact) {
if (languageCode == null)
return null;
if (languageList == null)
createLanguageList();
for (int i = 0; i < languageList.length; i++) {
if (languageList[i].code.equalsIgnoreCase(languageCode))
return languageList[i].code;
}
return (isExact ? null : findClosest(languageCode));
}
/**
*
* @param la
* @return a localization of the desired language, but not it exactly
*/
private String findClosest(String la) {
for (int i = languageList.length; --i >= 0; ) {
if (languageList[i].code.startsWith(la))
return languageList[i].code;
}
return null;
}
public static String getLanguage() {
return getTextWrapper().language;
}
synchronized private void getTranslation(String langCode) {
Locale locale;
translationResources = null;
translationResourcesCount = 0;
getTextWrapper = this;
if (langCode != null && langCode.length() == 0)
langCode="none";
if (langCode != null)
language = langCode;
if ("none".equals(language))
language = null;
if (language == null && (locale = Locale.getDefault()) != null) {
language = locale.getLanguage();
if (locale.getCountry() != null) {
language += "_" + locale.getCountry();
if (locale.getVariant() != null && locale.getVariant().length() > 0)
language += "_" + locale.getVariant();
}
}
if (language == null)
language = "en";
int i;
String la = language;
String la_co = language;
String la_co_va = language;
if ((i = language.indexOf("_")) >= 0) {
la = la.substring(0, i);
if ((i = language.indexOf("_", ++i)) >= 0) {
la_co = language.substring(0, i);
} else {
la_co_va = null;
}
} else {
la_co = null;
la_co_va = null;
}
/*
* find the best match. In each case, if the match is not found,
* but a variation at the next level higher exists, pick that variation.
* So, for example, if fr_CA does not exist, but fr_FR does, then
* we choose fr_FR, because that is taken as the "base" class for French.
*
* Or, if the language requested is "fr", and there is no fr.po, but there
* is an fr_FR.po, then return that.
*
* Thus, the user is informed of which country/variant is in effect,
* if they want to know.
*
*/
if ((language = getSupported(la_co_va, false)) == null
&& (language = getSupported(la_co, false)) == null
&& (language = getSupported(la, false)) == null) {
language = "en";
Logger.debug(language + " not supported -- using en");
return;
}
la_co_va = null;
la_co = null;
switch (language.length()) {
case 2:
la = language;
break;
case 5:
la_co = language;
la = language.substring(0, 2);
break;
default:
la_co_va = language;
la_co = language.substring(0, 5);
la = language.substring(0, 2);
}
/*
* Time to determine exactly what .po files we actually have.
* No need to check a file twice.
*
*/
la_co = getSupported(la_co, false);
la = getSupported(la, false);
if (la == la_co || "en_US".equals(la))
la = null;
if (la_co == la_co_va)
la_co = null;
if ("en_US".equals(la_co))
return;
if (Logger.debugging)
Logger.debug("Instantiating gettext wrapper for " + language
+ " using files for language:" + la + " country:" + la_co
+ " variant:" + la_co_va);
if (!ignoreApplicationBundle)
addBundles("Jmol", la_co_va, la_co, la);
addBundles("JmolApplet", la_co_va, la_co, la);
}
private void addBundles(String type, String la_co_va, String la_co, String la) {
try {
String className = "org.jmol.translation." + type + ".";
if (la_co_va != null)
addBundle(className, la_co_va);
if (la_co != null)
addBundle(className, la_co);
if (la != null)
addBundle(className, la);
} catch (Exception exception) {
Logger.error("Some exception occurred!", exception);
translationResources = null;
translationResourcesCount = 0;
}
}
private void addBundle(String className, String name) {
Class<?> bundleClass = null;
className += name + ".Messages_" + name;
// if (languagePath != null
// && !ZipUtil.isZipFile(languagePath + "_i18n_" + name + ".jar"))
// return;
try {
bundleClass = Class.forName(className);
} catch (Throwable e) {
Logger.error("GT could not find the class " + className);
}
if (bundleClass == null
|| !ResourceBundle.class.isAssignableFrom(bundleClass))
return;
try {
ResourceBundle myBundle = (ResourceBundle) bundleClass.newInstance();
if (myBundle != null) {
if (translationResources == null) {
translationResources = new ResourceBundle[8];
translationResourcesCount = 0;
}
translationResources[translationResourcesCount] = myBundle;
translationResourcesCount++;
Logger.debug("GT adding " + className);
}
} catch (IllegalAccessException e) {
Logger.warn("Illegal Access Exception: " + e.getMessage());
} catch (InstantiationException e) {
Logger.warn("Instantiation Excaption: " + e.getMessage());
}
}
private static GT getTextWrapper() {
return (getTextWrapper == null ? getTextWrapper = new GT() : getTextWrapper);
}
public static void ignoreApplicationBundle() {
ignoreApplicationBundle = true;
}
public static void setDoTranslate(boolean TF) {
getTextWrapper().doTranslate = TF;
}
public static boolean getDoTranslate() {
return getTextWrapper().doTranslate;
}
public static String _(String string) {
return getTextWrapper().getString(string);
}
public static String _(String string, String item) {
return getTextWrapper().getString(string, new Object[] { item });
}
public static String _(String string, int item) {
return getTextWrapper().getString(string,
new Object[] { Integer.valueOf(item) });
}
public static String _(String string, Object[] objects) {
return getTextWrapper().getString(string, objects);
}
//forced translations
public static String _(String string, boolean t) {
return _(string, (Object[]) null, t);
}
public static String _(String string,
String item,
@SuppressWarnings("unused") boolean t) {
return _(string, new Object[] { item });
}
public static String _(String string,
int item,
@SuppressWarnings("unused") boolean t) {
return _(string, new Object[] { Integer.valueOf(item) });
}
public static synchronized String _(String string,
Object[] objects,
@SuppressWarnings("unused") boolean t) {
boolean wasTranslating;
if (!(wasTranslating = getTextWrapper().doTranslate))
setDoTranslate(true);
String str = (objects == null ? _(string) : _(string, objects));
if (!wasTranslating)
setDoTranslate(false);
return str;
}
private String getString(String string) {
if (doTranslate) {
for (int bundle = translationResourcesCount; --bundle >= 0;)
try {
return translationResources[bundle].getString(string);
} catch (MissingResourceException e) {
// Normal
}
if (Logger.debugging)
Logger.info("No trans, using default: " + string);
}
if (string.startsWith("["))
string = string.substring(string.indexOf("]") + 1);
else if (string.endsWith("]"))
string = string.substring(0, string.indexOf("["));
return string;
}
private String getString(String string, Object[] objects) {
String trans = null;
if (!doTranslate)
return MessageFormat.format(string, objects);
for (int bundle = 0; bundle < translationResourcesCount; bundle++) {
try {
trans = MessageFormat.format(translationResources[bundle]
.getString(string), objects);
return trans;
} catch (MissingResourceException e) {
// Normal
}
}
trans = MessageFormat.format(string, objects);
if (translationResourcesCount > 0) {
if (Logger.debugging) {
Logger.debug("No trans, using default: " + trans);
}
}
return trans;
}
public static String escapeHTML(String msg) {
char ch;
for (int i = msg.length(); --i >= 0;)
if ((ch = msg.charAt(i)) > 0x7F) {
msg = msg.substring(0, i)
+ "&#" + ((int)ch) + ";" + msg.substring(i + 1);
}
return msg;
}
}
| [
"lxq35@hotmail.com"
] | lxq35@hotmail.com |
e8b7d8658791d63b0fbf9ff66ca490609b78de6f | 046cd57a9190821fde8b8ca2a1eae3f4c196ffc0 | /app/src/main/java/com/example/android/pets/CatalogActivity.java | 4e05cd481fd627d93d3b4b0d5830d730c56a693e | [] | no_license | mamrajsiyaga/Pets-Dummy-data | 80edfdb21dc8b4ae0a246bb9071b084979305598 | 243629d7ea4af9c46e0daaa1e7991955091cbbae | refs/heads/master | 2023-03-20T03:24:49.160984 | 2021-02-12T14:03:26 | 2021-02-12T14:03:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,850 | java | package com.example.android.pets;
import androidx.appcompat.app.AppCompatActivity;
import android.content.ContentValues;
import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.TextView;
import com.example.android.pets.data.PetContract.PetEntry;
import com.example.android.pets.data.PetDbHelper;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
public class CatalogActivity extends AppCompatActivity {
private PetDbHelper mDbHelper;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_catalog);
// Setup FAB to open EditorActivity
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(CatalogActivity.this, EditorActivity.class);
startActivity(intent);
}
});
mDbHelper = new PetDbHelper(this);
displayDatabaseInfo();
}
/**
* Temporary helper method to display information in the onscreen TextView about the state of
* the pets database.
*/
private void displayDatabaseInfo() {
// Create and/or open a database to read from it
SQLiteDatabase db = mDbHelper.getReadableDatabase();
// Perform this raw SQL query "SELECT * FROM pets"
// to get a Cursor that contains all rows from the pets table.
Cursor cursor = db.rawQuery("SELECT * FROM " + PetEntry.TABLE_NAME, null);
try {
// Display the number of rows in the Cursor (which reflects the number of rows in the
// pets table in the database).
TextView displayView = (TextView) findViewById(R.id.text_view_pet);
displayView.setText("Number of rows in pets database table: " + cursor.getCount());
} finally {
// Always close the cursor when you're done reading from it. This releases all its
// resources and makes it invalid.
cursor.close();
}
}
private void insertPet() {
SQLiteDatabase db = mDbHelper.getWritableDatabase();
ContentValues values = new ContentValues();
values.put(PetEntry.COLUMN_PET_NAME , "TOTO");
values.put(PetEntry.COLUMN_PET_BREED ,"Terrier");
values.put(PetEntry.COLUMN_PET_GENDER, PetEntry.GENDER_MALE);
values.put(PetEntry.COLUMN_PET_WEIGHT, 7);
long newRodId = db.insert(PetEntry.TABLE_NAME ,null , values);
Log.v("CatologActivity" , "New Row ID" + newRodId);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu options from the res/menu/menu_catalog.xml file.
// This adds menu items to the app bar.
getMenuInflater().inflate(R.menu.menu_catalog, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// User clicked on a menu option in the app bar overflow menu
switch (item.getItemId()) {
// Respond to a click on the "Insert dummy data" menu option
case R.id.action_insert_dummy_data:
insertPet();
displayDatabaseInfo();
return true;
// Respond to a click on the "Delete all entries" menu option
case R.id.action_delete_all_entries:
// Do nothing for now
return true;
}
return super.onOptionsItemSelected(item);
}
} | [
"zainfarhan94@gmail.com"
] | zainfarhan94@gmail.com |
e44d72117776710da02c1c22fcb1d4af805f0ffd | e87061cb6fb2626b4138afe93cbb4749545f7ca9 | /PaymentSystemRef/src/payment/action/LaunchFee.java | ab43fd69e73b8c1b6a735e07090a03775318b0b1 | [] | no_license | rodemfa913/EclipseProjects | 4675a72aa0f6f5f18d9eefeb1d15295503d884b0 | 7329a6e916fd3b53d1a52f16ee19e8cbd43aafae | refs/heads/master | 2020-04-07T18:37:34.211480 | 2019-10-12T11:28:34 | 2019-10-12T11:28:34 | 158,617,361 | 0 | 0 | null | 2019-02-08T15:21:30 | 2018-11-21T23:21:36 | Java | UTF-8 | Java | false | false | 897 | java | package payment.action;
import payment.model.employee.Employee;
import payment.PaymentSystem;
public class LaunchFee extends Action {
@Override public boolean doAction() {
Employee member = this.getMember();
if (member == null)
return false;
System.out.print("Serviço: ");
String service = PaymentSystem.input.nextLine();
PaymentSystem.save();
member = PaymentSystem.state.getMember(member.syndicateId);
System.out.print("Taxa: ");
double fee = PaymentSystem.input.nextDouble();
PaymentSystem.input.nextLine();
PaymentSystem.state.setService(service, fee);
member.setService(service, fee);
System.out.println("Taxa de serviço associada a '" +
member.memberInfo() + "' lançada");
return true;
}
@Override public String toString() {
return "lançar taxa de serviço";
}
} | [
"rodemfa@rodemfa-Lenovo-G480"
] | rodemfa@rodemfa-Lenovo-G480 |
14d1a59b929faad9756d5fd987505738b23a2449 | e68e7cfbf71537a58685feef03692bd7dc95cf61 | /TesiTriennale/src/servlets/LoadFirstYearAnalysisChart.java | 11fcb97120a9c62d2cf2e09a7b2f1c3d4f7eabf0 | [] | no_license | andrew-sa/workspace-TesiTriennale | 0e634c613ddebc454b4deb4c61aed8101dec3cac | 594bd902c2b25c622c1f8c8f94be651a5211569f | refs/heads/master | 2020-03-29T08:49:57.799251 | 2018-10-29T09:50:03 | 2018-10-29T09:50:03 | 149,727,561 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,272 | java | package servlets;
import java.io.IOException;
import java.sql.SQLException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.json.JSONException;
import org.json.JSONObject;
import manager.data.dao.CountryGDPPerCapitaDataDAO;
import manager.data.dao.CountryNetMigrationDataDAO;
import manager.data.dao.CountryPovertyDataDAO;
/**
* Servlet implementation class LoadFirstYearAnalysisChart
*/
@WebServlet("/load_first_year")
public class LoadFirstYearAnalysisChart extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public LoadFirstYearAnalysisChart() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
response.setContentType("text/html");
try
{
JSONObject result = new JSONObject();
CountryPovertyDataDAO povertyDataDAO = new CountryPovertyDataDAO();
CountryNetMigrationDataDAO netMigrationDataDAO = new CountryNetMigrationDataDAO();
CountryGDPPerCapitaDataDAO gdpPerCapitaDataDAO = new CountryGDPPerCapitaDataDAO();
result.put("poverty", povertyDataDAO.readFirstYear());
result.put("netmigration", netMigrationDataDAO.readFirstYear());
result.put("gdppercapita", gdpPerCapitaDataDAO.readFirstYear());
// System.out.println(result.toString());
response.getWriter().write(result.toString());
}
catch (JSONException | SQLException e)
{
e.printStackTrace();
}
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
doGet(request, response);
}
// public static void main(String[] args) throws ServletException, IOException {
// (new LoadFirstYearAnalysisChart()).doGet(null, null);
// }
}
| [
"andreamogavero.sa@gmail.com"
] | andreamogavero.sa@gmail.com |
fe254b909279fc7255cabc1b89a0541f63e0d386 | 995f73d30450a6dce6bc7145d89344b4ad6e0622 | /MATE-20_EMUI_11.0.0/src/main/java/org/apache/http/client/protocol/RequestAddCookies.java | 5dc235f3ee4d6175c1e3bdef5db04b8565267c06 | [] | no_license | morningblu/HWFramework | 0ceb02cbe42585d0169d9b6c4964a41b436039f5 | 672bb34094b8780806a10ba9b1d21036fd808b8e | refs/heads/master | 2023-07-29T05:26:14.603817 | 2021-09-03T05:23:34 | 2021-09-03T05:23:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,518 | java | package org.apache.http.client.protocol;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.http.Header;
import org.apache.http.HttpException;
import org.apache.http.HttpHost;
import org.apache.http.HttpRequest;
import org.apache.http.HttpRequestInterceptor;
import org.apache.http.ProtocolException;
import org.apache.http.client.CookieStore;
import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.client.params.HttpClientParams;
import org.apache.http.conn.ManagedClientConnection;
import org.apache.http.cookie.Cookie;
import org.apache.http.cookie.CookieOrigin;
import org.apache.http.cookie.CookieSpec;
import org.apache.http.cookie.CookieSpecRegistry;
import org.apache.http.protocol.ExecutionContext;
import org.apache.http.protocol.HttpContext;
@Deprecated
public class RequestAddCookies implements HttpRequestInterceptor {
private final Log log = LogFactory.getLog(getClass());
@Override // org.apache.http.HttpRequestInterceptor
public void process(HttpRequest request, HttpContext context) throws HttpException, IOException {
URI requestURI;
Header header;
CookieSpecRegistry registry;
CookieStore cookieStore;
RequestAddCookies requestAddCookies = this;
if (request == null) {
throw new IllegalArgumentException("HTTP request may not be null");
} else if (context != null) {
CookieStore cookieStore2 = (CookieStore) context.getAttribute(ClientContext.COOKIE_STORE);
if (cookieStore2 == null) {
requestAddCookies.log.info("Cookie store not available in HTTP context");
return;
}
CookieSpecRegistry registry2 = (CookieSpecRegistry) context.getAttribute(ClientContext.COOKIESPEC_REGISTRY);
if (registry2 == null) {
requestAddCookies.log.info("CookieSpec registry not available in HTTP context");
return;
}
HttpHost targetHost = (HttpHost) context.getAttribute(ExecutionContext.HTTP_TARGET_HOST);
if (targetHost != null) {
ManagedClientConnection conn = (ManagedClientConnection) context.getAttribute(ExecutionContext.HTTP_CONNECTION);
if (conn != null) {
String policy = HttpClientParams.getCookiePolicy(request.getParams());
if (requestAddCookies.log.isDebugEnabled()) {
Log log2 = requestAddCookies.log;
log2.debug("CookieSpec selected: " + policy);
}
if (request instanceof HttpUriRequest) {
requestURI = ((HttpUriRequest) request).getURI();
} else {
try {
requestURI = new URI(request.getRequestLine().getUri());
} catch (URISyntaxException ex) {
throw new ProtocolException("Invalid request URI: " + request.getRequestLine().getUri(), ex);
}
}
String hostName = targetHost.getHostName();
int port = targetHost.getPort();
if (port < 0) {
port = conn.getRemotePort();
}
CookieOrigin cookieOrigin = new CookieOrigin(hostName, port, requestURI.getPath(), conn.isSecure());
CookieSpec cookieSpec = registry2.getCookieSpec(policy, request.getParams());
List<Cookie> cookies = new ArrayList<>(cookieStore2.getCookies());
List<Cookie> matchedCookies = new ArrayList<>();
for (Cookie cookie : cookies) {
if (cookieSpec.match(cookie, cookieOrigin)) {
cookieStore = cookieStore2;
if (requestAddCookies.log.isDebugEnabled()) {
Log log3 = requestAddCookies.log;
StringBuilder sb = new StringBuilder();
registry = registry2;
sb.append("Cookie ");
sb.append(cookie);
sb.append(" match ");
sb.append(cookieOrigin);
log3.debug(sb.toString());
} else {
registry = registry2;
}
matchedCookies.add(cookie);
} else {
cookieStore = cookieStore2;
registry = registry2;
}
requestAddCookies = this;
cookieStore2 = cookieStore;
requestURI = requestURI;
registry2 = registry;
}
if (!matchedCookies.isEmpty()) {
for (Header header2 : cookieSpec.formatCookies(matchedCookies)) {
request.addHeader(header2);
}
}
int ver = cookieSpec.getVersion();
if (ver > 0) {
boolean needVersionHeader = false;
for (Cookie cookie2 : matchedCookies) {
if (ver != cookie2.getVersion()) {
needVersionHeader = true;
}
}
if (needVersionHeader && (header = cookieSpec.getVersionHeader()) != null) {
request.addHeader(header);
}
}
context.setAttribute(ClientContext.COOKIE_SPEC, cookieSpec);
context.setAttribute(ClientContext.COOKIE_ORIGIN, cookieOrigin);
return;
}
throw new IllegalStateException("Client connection not specified in HTTP context");
}
throw new IllegalStateException("Target host not specified in HTTP context");
} else {
throw new IllegalArgumentException("HTTP context may not be null");
}
}
}
| [
"dstmath@163.com"
] | dstmath@163.com |
7b7346ba5376d324f4b5943dd83d04cfea55b8a9 | 5fe2da97de7570728be2a6b1c80ea1e9cc23ff50 | /javaweb/day01_junit_xml/test/cn/lyf/test/TestDemoTest.java | dd7642b885b1e75646799ec57423c6dd057e9edb | [] | no_license | lyf101/lang | 0c6a1f6728230c57dc204e09974da32e0c72f131 | ed6ef2baa7670f4777e2e3bc82c2734954bd6e1d | refs/heads/master | 2023-03-26T05:11:53.298826 | 2021-03-22T13:04:21 | 2021-03-22T13:04:21 | 330,057,496 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 186 | java | package cn.lyf.test;
import org.junit.Test;
public class TestDemoTest {
@Test
public void add() {
TestDemo testDemo = new TestDemo();
testDemo.add();
}
}
| [
"553351900@qq.com"
] | 553351900@qq.com |
7846612f45c28f4da3b599ee0038a37abbf6aa92 | 421f0a75a6b62c5af62f89595be61f406328113b | /generated_tests/model_seeding/101_netweaver-com.sap.netweaver.porta.core.snippets.SnippetUseDeployManager-1.0-5/com/sap/netweaver/porta/core/snippets/SnippetUseDeployManager_ESTest_scaffolding.java | 2f6278fe48e355595cb37e4b1d99a4291e33bda8 | [] | no_license | tigerqiu712/evosuite-model-seeding-empirical-evaluation | c78c4b775e5c074aaa5e6ca56bc394ec03c2c7c6 | 11a920b8213d9855082d3946233731c843baf7bc | refs/heads/master | 2020-12-23T21:04:12.152289 | 2019-10-30T08:02:29 | 2019-10-30T08:02:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 567 | java | /**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Fri Oct 25 20:35:00 GMT 2019
*/
package com.sap.netweaver.porta.core.snippets;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
import org.evosuite.runtime.sandbox.Sandbox;
import org.evosuite.runtime.sandbox.Sandbox.SandboxMode;
@EvoSuiteClassExclude
public class SnippetUseDeployManager_ESTest_scaffolding {
// Empty scaffolding for empty test suite
}
| [
"pderakhshanfar@bsr01.win.tue.nl"
] | pderakhshanfar@bsr01.win.tue.nl |
464ff4a027a51b04c482aa75ce5f56f41ace37b1 | a7d6674d750020be0af52a7e32eae34d70559880 | /ThanSoHoc/android/app/src/main/java/com/thansohoc/MainActivity.java | 8a87cb3cfb44380730c4321d3b57edae7675d47f | [] | no_license | trungnl08/ThanSoHoc | b3cda888148644c0c3719ee50f2c78e63b474ef3 | 943bc8711afd5286bb62690259b641d5a6e3abfb | refs/heads/main | 2023-03-01T03:39:01.592769 | 2021-02-08T04:13:21 | 2021-02-08T04:13:21 | 329,214,058 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 351 | java | package com.thansohoc;
import com.facebook.react.ReactActivity;
public class MainActivity extends ReactActivity {
/**
* Returns the name of the main component registered from JavaScript. This is used to schedule
* rendering of the component.
*/
@Override
protected String getMainComponentName() {
return "Thầnsốhọc";
}
}
| [
"trung80.uet@gmail.com"
] | trung80.uet@gmail.com |
48cf7b11ade2162fe49cd525a9e3328bc2b20b7c | 19eadabe1b67c3842e75fb907ed3bbc0995cb69a | /src/entities/Department.java | 103835cdf082c0435077d64641456008be0c25a7 | [] | no_license | Nilson-K-Aguena/aula1-github | 2b34dfb9a3a3847e8f39dffa2c276f99c5a3eec4 | 965f11f64eb813537f081107d75ac225342215e5 | refs/heads/master | 2020-06-02T06:24:03.331887 | 2019-06-11T03:06:52 | 2019-06-11T03:06:52 | 191,068,434 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 262 | java | package entities;
public class Department {
private String name;
public Department() {
}
public Department(String name) {
this.name = name;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
} | [
"nilson.blitzkrieg@gmail.com"
] | nilson.blitzkrieg@gmail.com |
76f314892ec52124e19f8abdc7911100119d275d | 2713293d42932abca9a81b61287741cf04a2e7fc | /1.9.18/MyAaptha/app/src/main/java/com/cpetsol/cpetsolutions/myaaptha/model/HospitalsDataModel.java | 9f97132dfcb2910dfc64c77c3c85f21f80d87140 | [] | no_license | Kodanda9/MyAaptha | 420e71cb1dcbe6190a5cc85163f82b83b083e5ee | 2fd60e6a8ec3c190c5ccf2cc304bf1a8df5a4ce3 | refs/heads/master | 2020-12-06T20:37:11.204248 | 2020-01-08T11:28:40 | 2020-01-08T11:28:40 | 232,547,344 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,627 | java | package com.cpetsol.cpetsolutions.myaaptha.model;
/**
* Created by Admin on 7/4/2018.
*/
public class HospitalsDataModel {
String id;
String duration;
String hospitalName;
String sunday;
String monday;
String tuesday;
String wednesday;
String thursday;
String friday;
String saturday;
String price;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getDuration() {
return duration;
}
public void setDuration(String duration) {
this.duration = duration;
}
public String getHospitalName() {
return hospitalName;
}
public void setHospitalName(String hospitalName) {
this.hospitalName = hospitalName;
}
public String getSunday() {
return sunday;
}
public void setSunday(String sunday) {
this.sunday = sunday;
}
public String getMonday() {
return monday;
}
public void setMonday(String monday) {
this.monday = monday;
}
public String getTuesday() {
return tuesday;
}
public void setTuesday(String tuesday) {
this.tuesday = tuesday;
}
public String getWednesday() {
return wednesday;
}
public void setWednesday(String wednesday) {
this.wednesday = wednesday;
}
public String getThursday() {
return thursday;
}
public void setThursday(String thursday) {
this.thursday = thursday;
}
public String getFriday() {
return friday;
}
public void setFriday(String friday) {
this.friday = friday;
}
public String getSaturday() {
return saturday;
}
public void setSaturday(String saturday) {
this.saturday = saturday;
}
public String getPrice() {
return price;
}
public void setPrice(String price) {
this.price = price;
}
@Override
public String toString() {
return "HospitalsDataModel{" +
"id='" + id + '\'' +
", duration='" + duration + '\'' +
", hospitalName='" + hospitalName + '\'' +
", sunday='" + sunday + '\'' +
", monday='" + monday + '\'' +
", tuesday='" + tuesday + '\'' +
", wednesday='" + wednesday + '\'' +
", thursday='" + thursday + '\'' +
", friday='" + friday + '\'' +
", saturday='" + saturday + '\'' +
", price='" + price + '\'' +
'}';
}
}
| [
"kodanda55555@gmail.com"
] | kodanda55555@gmail.com |
0d73cca95ac54a3d840fe89970d47213b4803803 | 30fb1370c039403e8f679179785d14656d4a6492 | /src/main/java/com/navastud/polls/converter/PagedConverter.java | 4821e20e70b749d164d23c7cf046a8e2bff21b3e | [] | no_license | Navastud/backendpolls | e433ff909273f9536836429bd92b2af9bcc7727e | ca35ec29088c230f7ef0f9b23975ad3acf42efa4 | refs/heads/master | 2020-06-17T22:11:37.639943 | 2019-07-24T17:06:24 | 2019-07-24T17:06:24 | 196,075,496 | 2 | 0 | null | 2019-07-24T17:06:25 | 2019-07-09T20:02:38 | Java | UTF-8 | Java | false | false | 876 | java | package com.navastud.polls.converter;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Component;
import com.navastud.polls.payload.PagedResponse;
@Component("pagedConverter")
public class PagedConverter<T> {
@Autowired
@Qualifier("pagedResponse")
private PagedResponse<T> pagedResponse;
public PagedResponse<T> convertPageToPagedResponse(Page<?> pages, List<T> content) {
pagedResponse.setContent(content);
pagedResponse.setLast(pages.isLast());
pagedResponse.setPage(pages.getNumber());
pagedResponse.setSize(pages.getSize());
pagedResponse.setTotalElements(pages.getTotalElements());
pagedResponse.setTotalPages(pages.getTotalPages());
return pagedResponse;
}
}
| [
"david.navastud@gmail.com"
] | david.navastud@gmail.com |
fd842b473e55a9cae84c69aae56a189037b672c4 | 27a49caad5bb72b22a76404010105adf3059fc72 | /tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/DisconnectOnCriticalFailureTest.java | fea3bf45f8378cb438c537e5100164e9e3c5c4ae | [
"Apache-2.0",
"LicenseRef-scancode-public-domain"
] | permissive | franz1981/activemq-artemis | 5e3b2ef6ade2326ed30568d513233e5bd12caec6 | f18b4ee0c9b48c7bad3cb071b43b4b835e8d2c9d | refs/heads/master | 2022-03-19T03:15:41.895849 | 2017-07-14T19:04:43 | 2017-07-14T19:04:45 | 57,105,719 | 0 | 1 | Apache-2.0 | 2021-09-28T11:03:13 | 2016-04-26T07:03:57 | Java | UTF-8 | Java | false | false | 5,023 | java | /**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* <p/>
* http://www.apache.org/licenses/LICENSE-2.0
* <p/>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.activemq.artemis.tests.extras.byteman;
import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
import org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl;
import org.apache.activemq.artemis.tests.util.JMSTestBase;
import org.jboss.byteman.contrib.bmunit.BMRule;
import org.jboss.byteman.contrib.bmunit.BMRules;
import org.jboss.byteman.contrib.bmunit.BMUnitRunner;
import org.junit.After;
import org.junit.Test;
import org.junit.runner.RunWith;
import javax.jms.Connection;
import javax.jms.ExceptionListener;
import javax.jms.JMSException;
import javax.jms.MessageConsumer;
import javax.jms.MessageProducer;
import javax.jms.Queue;
import javax.jms.Session;
import javax.jms.TextMessage;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
@RunWith(BMUnitRunner.class)
public class DisconnectOnCriticalFailureTest extends JMSTestBase {
private static AtomicBoolean corruptPacket = new AtomicBoolean(false);
@After
@Override
public void tearDown() throws Exception {
corruptPacket.set(false);
super.tearDown();
}
@Test
@BMRules(
rules = {@BMRule(
name = "Corrupt Decoding",
targetClass = "org.apache.activemq.artemis.core.protocol.core.impl.PacketDecoder",
targetMethod = "decode(byte)",
targetLocation = "ENTRY",
action = "org.apache.activemq.artemis.tests.extras.byteman.DisconnectOnCriticalFailureTest.doThrow();")})
public void testSendDisconnect() throws Exception {
createQueue("queue1");
final Connection producerConnection = nettyCf.createConnection();
final CountDownLatch latch = new CountDownLatch(1);
try {
producerConnection.setExceptionListener(new ExceptionListener() {
@Override
public void onException(JMSException e) {
latch.countDown();
}
});
corruptPacket.set(true);
producerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
assertTrue(latch.await(5, TimeUnit.SECONDS));
} finally {
corruptPacket.set(false);
if (producerConnection != null) {
producerConnection.close();
}
}
}
@Test
@BMRules(
rules = {@BMRule(
name = "Corrupt Decoding",
targetClass = "org.apache.activemq.artemis.core.protocol.ClientPacketDecoder",
targetMethod = "decode(org.apache.activemq.artemis.api.core.ActiveMQBuffer)",
targetLocation = "ENTRY",
action = "org.apache.activemq.artemis.tests.extras.byteman.DisconnectOnCriticalFailureTest.doThrow($1);")})
public void testClientDisconnect() throws Exception {
Queue q1 = createQueue("queue1");
final Connection connection = nettyCf.createConnection();
final CountDownLatch latch = new CountDownLatch(1);
try {
connection.setExceptionListener(new ExceptionListener() {
@Override
public void onException(JMSException e) {
latch.countDown();
}
});
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageProducer producer = session.createProducer(q1);
TextMessage m = session.createTextMessage("hello");
producer.send(m);
connection.start();
corruptPacket.set(true);
MessageConsumer consumer = session.createConsumer(q1);
consumer.receive(2000);
assertTrue(latch.await(5, TimeUnit.SECONDS));
} finally {
corruptPacket.set(false);
if (connection != null) {
connection.close();
}
}
}
public static void doThrow(ActiveMQBuffer buff) {
byte type = buff.getByte(buff.readerIndex());
if (corruptPacket.get() && type == PacketImpl.SESS_RECEIVE_MSG) {
corruptPacket.set(false);
throw new IllegalArgumentException("Invalid type: -84");
}
}
public static void doThrow() {
if (corruptPacket.get()) {
corruptPacket.set(false);
throw new IllegalArgumentException("Invalid type: -84");
}
}
}
| [
"clebertsuconic@apache.org"
] | clebertsuconic@apache.org |
112418051f8a890f776823431a1386d30a45c7e7 | e43d5e2445c1679421218a5261b72faba052a648 | /JavaRushTasks/2.JavaCore/src/com/javarush/task/task11/task1108/Solution.java | 5d1deedf32647afa625e9639c2dae589a34ddd10 | [] | no_license | SokolY/javarush2020 | a008087efe2c21f79905e2c55129e69063d3adf1 | e8c780605357b8c8c5359a4b64439a76a3a85fd5 | refs/heads/master | 2023-08-03T14:05:40.500475 | 2021-10-06T17:14:14 | 2021-10-06T17:14:14 | 291,798,788 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 887 | java | package com.javarush.task.task11.task1108;
/*
Неприступный кот
*/
public class Solution {
public static void main(String[] args) {
}
public class Cat {
private String name;
private int age;
private int weight;
public Cat(String name, int age, int weight) {
this.name = name;
this.age = age;
this.weight = weight;
}
public String getName() {
return name;
}
private void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
private void setAge(int age) {
this.age = age;
}
public int getWeight(){
return weight;
}
private void setWeight(int weight){
this.weight = weight;
}
}
}
| [
"yura.sokol@gmail.com"
] | yura.sokol@gmail.com |
6409f73fc595da8611fdc6de6118f9eb1cb32533 | a7ccfb0f3f3546a5185f98030aa84871d6ed2151 | /exemples/patterns/observer/gof/before/Pie.java | 452db6c5d4f98771128838b37a65928675cc1ba5 | [] | no_license | Edouardphan/cnam-2isa | 17c623ba23159c1e4134dedee1bd37ada5f096b1 | b88604d4c68fe7370422253b9b495736d9783dec | refs/heads/main | 2023-01-08T17:07:24.820710 | 2020-10-21T21:36:21 | 2020-10-21T21:36:21 | 306,394,810 | 0 | 0 | null | 2020-10-22T16:20:47 | 2020-10-22T16:20:46 | null | UTF-8 | Java | false | false | 373 | java |
import java.util.Map;
public class Pie{
private DataHolder data;
public Pie(DataHolder data){
this.data = data;
}
public void print(){
System.out.println(this.getClass());
Map<String, Double> tmp = data.getState();
tmp.forEach( (k,v) -> System.out.println(k + " : " + v) );
System.out.println();
}
}
| [
"tigraff@gmail.com"
] | tigraff@gmail.com |
c62607c802c53aba4d29e01f1870d91e9ba6ef75 | f53ffb77bf66e6d01b65f53370eec88ea5d765ca | /src/main/java/com/strsslss/ui/ExerciseFragment.java | c9bf975762f83df69fafb4f5eed769fd7299be4c | [] | no_license | sunokok/StrssLss-app | 2478e36ce4858608c767e2359e72a2b64e4bcfbc | 9f43205254565af7bdb6bc3d9c80f807bfce4c58 | refs/heads/master | 2021-01-11T12:04:23.865092 | 2017-01-23T07:43:09 | 2017-01-23T07:43:09 | 76,551,045 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,452 | java | package com.strsslss.ui;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import com.strsslss.R;
import butterknife.BindView;
import butterknife.ButterKnife;
/**
* Created by SunOK on 15/12/2016.
*/
public class ExerciseFragment extends Fragment {
@BindView(R.id.exercise_container)
FrameLayout exercise_container;
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_exercise, container, false);
ButterKnife.bind(this,view);
Fragment fragment = new ExerciseStartFragment();
if (fragment != null) {
FragmentTransaction ft = getActivity().getSupportFragmentManager().beginTransaction();
ft.replace(R.id.exercise_container, fragment);
ft.commit();
}
return view;
}
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
//you can set the title for your toolbar here for different fragments different titles
getActivity().setTitle("Exercise");
}
}
| [
"vos1996@gmail.com"
] | vos1996@gmail.com |
b8f4d35981ec38c12e07e9697e0fa5058a79c14b | 451a7e9359ef09106c4f4404fdfe55cfa4c5a1f2 | /Palindrome.java | 2ea504afa70bc3322479597ac56877496dfb0932 | [] | no_license | SANTHIYA9698/santhiya | b30e418fb807af7c0b9f100edac993da3e59e562 | ccd1513367de80d32e18dc6812799f37bcd56956 | refs/heads/master | 2021-01-12T05:47:17.637620 | 2017-10-24T06:57:25 | 2017-10-24T06:57:25 | 77,198,135 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 488 | java | package Pro;
public class Palindrome {
public static void main(String[] args) {
String input="xyxzxyxmalayalamabc";
int len=0;
String output="";
for(int i=0;i<input.length()-1;i++){
for(int j=i+1;j<input.length();j++){
String n1=input.substring(i,j);
StringBuffer sb=new StringBuffer(n1);
String n2=sb.reverse().toString();
if(n1.equals(n2)){
if(n1.length()>len){
output=n1;
len=n1.length();
}
}
}
}
System.out.println(output);
}
}
| [
"noreply@github.com"
] | noreply@github.com |
857a5e6a1d848c5e401f16b176c1b4b743c49a68 | 45c4a0c90104bd2e4a5fb43e761d2c04ecc39bdd | /src/main/java/alec_wam/CrystalMod/blocks/crystexium/CrystexiumSlab.java | bf30ba9bbdea5839728a9137cac2f105d9b338ba | [
"MIT"
] | permissive | Alec-WAM/CrystalMod | 4a335176fde541bb53bcbfb4c9b1e162d72eb49a | 98654b1b686818767022a12b4c7ca6ada585a18a | refs/heads/master | 2021-01-19T02:49:00.508439 | 2019-03-26T19:51:37 | 2019-03-26T19:51:37 | 70,442,150 | 9 | 1 | null | null | null | null | UTF-8 | Java | false | false | 8,596 | java | package alec_wam.CrystalMod.blocks.crystexium;
import java.util.Random;
import javax.annotation.Nonnull;
import alec_wam.CrystalMod.CrystalMod;
import alec_wam.CrystalMod.blocks.ICustomModel;
import alec_wam.CrystalMod.blocks.ModBlocks;
import net.minecraft.block.BlockSlab;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyEnum;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.IStringSerializable;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class CrystexiumSlab extends BlockSlab implements ICustomModel
{
public static final PropertyEnum<CrystexiumSlab.EnumType> VARIANT = PropertyEnum.<CrystexiumSlab.EnumType>create("type", CrystexiumSlab.EnumType.class);
public CrystexiumSlab()
{
super(Material.GLASS);
IBlockState iblockstate = this.blockState.getBaseState();
iblockstate = iblockstate.withProperty(HALF, BlockSlab.EnumBlockHalf.BOTTOM);
this.setDefaultState(iblockstate.withProperty(VARIANT, CrystexiumSlab.EnumType.NORMAL));
this.setCreativeTab(CrystalMod.tabBlocks);
setHardness(2.0F).setResistance(10.0F);
setSoundType(SoundType.GLASS);
}
@Nonnull
@Override
@SideOnly(Side.CLIENT)
public BlockRenderLayer getBlockLayer() {
return BlockRenderLayer.TRANSLUCENT;
}
@Override
public boolean isOpaqueCube(IBlockState state)
{
return super.isOpaqueCube(state);
}
@Override
public boolean doesSideBlockRendering(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing face)
{
if (net.minecraftforge.common.ForgeModContainer.disableStairSlabCulling)
return super.doesSideBlockRendering(state, world, pos, face);
if ( state.isOpaqueCube() )
return true;
return false;
}
@Override
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(IBlockState state, IBlockAccess worldIn, BlockPos pos, EnumFacing side)
{
IBlockState other = worldIn.getBlockState(pos.offset(side));
if(other.getBlock() == this && getMetaFromState(state) == getMetaFromState(other)){
return false;
}
return super.shouldSideBeRendered(state, worldIn, pos, side);
}
@SideOnly(Side.CLIENT)
@Override
public void initModel(){
for(EnumType type : EnumType.values()){
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(this), type.getMetadata(), new ModelResourceLocation(getRegistryName(), "half=bottom,type="+type.toString()));
}
}
/**
* Get the Item that this Block should drop when harvested.
*/
@Override
public Item getItemDropped(IBlockState state, Random rand, int fortune)
{
return Item.getItemFromBlock(ModBlocks.crystexiumSlab);
}
@Override
public ItemStack getItem(World worldIn, BlockPos pos, IBlockState state)
{
return new ItemStack(ModBlocks.crystexiumSlab, 1, state.getValue(VARIANT).getMetadata());
}
/**
* Returns the slab block name with the type associated with it
*/
@Override
public String getUnlocalizedName(int meta)
{
return super.getUnlocalizedName() + "." + CrystexiumSlab.EnumType.byMetadata(meta).getUnlocalizedName();
}
@Override
public IProperty<?> getVariantProperty()
{
return VARIANT;
}
@Override
public Comparable<?> getTypeForItem(ItemStack stack)
{
return CrystexiumSlab.EnumType.byMetadata(stack.getMetadata() & 7);
}
/**
* returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
*/
@Override
@SideOnly(Side.CLIENT)
public void getSubBlocks(Item itemIn, CreativeTabs tab, NonNullList<ItemStack> list)
{
for (CrystexiumSlab.EnumType blockstoneslab$enumtype : CrystexiumSlab.EnumType.values())
{
list.add(new ItemStack(itemIn, 1, blockstoneslab$enumtype.getMetadata()));
}
}
/**
* Convert the given metadata into a BlockState for this Block
*/
@Override
public IBlockState getStateFromMeta(int meta)
{
IBlockState iblockstate = this.getDefaultState().withProperty(VARIANT, CrystexiumSlab.EnumType.byMetadata(meta & 7));
iblockstate = iblockstate.withProperty(HALF, (meta & 8) == 0 ? BlockSlab.EnumBlockHalf.BOTTOM : BlockSlab.EnumBlockHalf.TOP);
return iblockstate;
}
/**
* Convert the BlockState into the correct metadata value
*/
@Override
public int getMetaFromState(IBlockState state)
{
int i = 0;
i = i | state.getValue(VARIANT).getMetadata();
if (state.getValue(HALF) == BlockSlab.EnumBlockHalf.TOP)
{
i |= 8;
}
return i;
}
@Override
protected BlockStateContainer createBlockState()
{
return this.isDouble() ? new BlockStateContainer(this, new IProperty[] {VARIANT}): new BlockStateContainer(this, new IProperty[] {HALF, VARIANT});
}
/**
* Gets the metadata of the item this Block can drop. This method is called when the block gets destroyed. It
* returns the metadata of the dropped item based on the old metadata of the block.
*/
@Override
public int damageDropped(IBlockState state)
{
return state.getValue(VARIANT).getMetadata();
}
/**
* Get the MapColor for this Block and the given BlockState
*/
@Override
public MapColor getMapColor(IBlockState state)
{
return state.getValue(VARIANT).getMapColor();
}
public static enum EnumType implements IStringSerializable
{
NORMAL(0, MapColor.PINK, "normal"),
BLUE(1, MapColor.BLUE, "blue"),
RED(2, MapColor.RED, "red"),
GREEN(3, MapColor.GREEN, "green"),
DARK(4, MapColor.BLACK, "dark"),
PURE(5, MapColor.IRON, "pure");
private static final CrystexiumSlab.EnumType[] META_LOOKUP = new CrystexiumSlab.EnumType[values().length];
private final int meta;
private final MapColor mapColor;
private final String name;
private final String unlocalizedName;
private EnumType(int p_i46381_3_, MapColor p_i46381_4_, String p_i46381_5_)
{
this(p_i46381_3_, p_i46381_4_, p_i46381_5_, p_i46381_5_);
}
private EnumType(int p_i46382_3_, MapColor p_i46382_4_, String p_i46382_5_, String p_i46382_6_)
{
this.meta = p_i46382_3_;
this.mapColor = p_i46382_4_;
this.name = p_i46382_5_;
this.unlocalizedName = p_i46382_6_;
}
public int getMetadata()
{
return this.meta;
}
public MapColor getMapColor()
{
return this.mapColor;
}
@Override
public String toString()
{
return this.name;
}
public static CrystexiumSlab.EnumType byMetadata(int meta)
{
if (meta < 0 || meta >= META_LOOKUP.length)
{
meta = 0;
}
return META_LOOKUP[meta];
}
@Override
public String getName()
{
return this.name;
}
public String getUnlocalizedName()
{
return this.unlocalizedName;
}
static
{
for (CrystexiumSlab.EnumType blockstoneslab$enumtype : values())
{
META_LOOKUP[blockstoneslab$enumtype.getMetadata()] = blockstoneslab$enumtype;
}
}
}
@Override
public boolean isDouble() {
return false;
}
} | [
"tlmathisen2@gmail.com"
] | tlmathisen2@gmail.com |
794240b988132b1f673c35a8a9738798743373a3 | 46066ea7321962e418def4fb8ffc38d63a8edf5f | /Sample/src/File_Io/Make_Readonly.java | 09780c3ef60e953f7144d04fb8bb98b27945409e | [] | no_license | bapun440/Simple | 49c20c6ff4d3189540a4474c3ecf1760cf8a7a08 | f705e600b8bfa2d22e2139e60a8fb67c4f86ef03 | refs/heads/master | 2020-03-25T20:02:51.684184 | 2018-09-04T04:28:38 | 2018-09-04T04:28:38 | 144,112,358 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 516 | java | package File_Io;
import java.io.File;
import java.io.IOException;
public class Make_Readonly {
public static void main(String[] args) throws IOException
{
File myfile = new File("D://java//nmyfile.txt");
//making the file read only
boolean flag = myfile.setReadOnly();
if (flag==true)
{
System.out.println("File successfully converted to Read only mode!!");
}
else
{
System.out.println("Unsuccessful Operation!!");
}
}
}
| [
"bhanusekharp@VAD011020721.infics.com"
] | bhanusekharp@VAD011020721.infics.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.