blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2 values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 132 values | src_encoding stringclasses 34 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 3 9.45M | extension stringclasses 28 values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 352 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e15a4901f21484e2df6c2055897dc4642d12a756 | 3049e9f3fa1511b1ab17147078fd9b065102bab5 | /PswdServ/src/rpc/User.java | 3da9430f30ed3842cf63a9c5095cfa16be64e418 | [] | no_license | skyworld8788/PswdServ | e3897835473419368cfc10ec59d919c81be2a279 | 516354e705ea232a081372cb65a769eee94e11ad | refs/heads/master | 2020-03-22T02:57:03.418790 | 2018-07-02T07:19:22 | 2018-07-02T07:19:22 | 139,403,162 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,454 | java | package rpc;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/**
* @Function Group Class saved the /etc/passwd's info
* @author Rick Liu
* @version v0.1.0
* @Time 2018-6-23
*/
public class User {
/** User name */
private String name;
/** User ID */
private String uid;
/** Group ID */
private String gid;
/** Comment info */
private String comment;
/** Home path */
private String home;
/** Shell */
private String shell;
/**
* @Constrcutor
* @param name, uid, gid, comment, home and shell
*/
public User(String name, String uid, String gid, String comment, String home, String shell) {
this.name = name;
this.uid = uid;
this.gid = gid;
this.comment = comment;
this.home = home;
this.shell = shell;
}
/**
* @Getter Get name
* @return name - String
*/
public String getName() {
return name;
}
/**
* @Setter Set name
* @param name - String
*/
public void setName(String name) {
this.name = name;
}
/**
* @Getter Get uid
* @return uid - String
*/
public String getUid() {
return uid;
}
/**
* @Setter Set uid
* @param uid - String
*/
public void setUid(String uid) {
this.uid = uid;
}
/**
* @Getter Get gid
* @return gid - String
*/
public String getGid() {
return gid;
}
/**
* @Setter Set gid
* @param gid - String
*/
public void setGid(String gid) {
this.gid = gid;
}
/**
* @Getter Get comment
* @return comment - String
*/
public String getComment() {
return comment;
}
/**
* @Setter Set comment
* @param comment - String
*/
public void setComment(String comment) {
this.comment = comment;
}
/**
* @Getter Get home
* @return home - String
*/
public String getHome() {
return home;
}
/**
* @Setter Set home
* @param home - String
*/
public void setHome(String home) {
this.home = home;
}
/**
* @Getter Get shell
* @return shell - String
*/
public String getShell() {
return shell;
}
/**
* @Setter Set shell
* @param shell - String
*/
public void setShell(String shell) {
this.shell = shell;
}
/**
* @Function Check if two objects are equals to each other.
* @param o - Object
*/
@Override
public boolean equals(Object o) {
if (o instanceof User) {
return (name.equals(((User) o).getName()) &&
uid.equals(((User) o).getUid()) &&
gid.equals(((User) o).getGid()) &&
comment.equals(((User) o).getComment()) &&
home.equals(((User) o).getHome()) &&
shell.equals(((User) o).getShell()));
}
return false;
}
// main func used for unit testing
public static void main(String[] args) throws IOException, InterruptedException{
FileReader fr = null;
BufferedReader br = null;
String filePath = "C:\\Users\\Rick\\Desktop\\passwd.txt";
List<User> users = new ArrayList<User>();
try {
fr = new FileReader(filePath);
br = new BufferedReader(fr);
String line;
while ((line = br.readLine()) != null) {
String[] user = line.split(":",7);
User tmp = new User(user[0], user[2], user[3], user[4], user[5], user[6]);
users.add(tmp);
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
if (br != null) {
br.close();
}
} catch (IOException e) {
e.printStackTrace();
} finally {
if (fr != null) {
try {
fr.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
System.out.println("-------------User info from the passwd-------------");
for (Iterator<User> iter = users.iterator(); iter.hasNext();) {
User usr = iter.next();
System.out.println("Name:" + usr.getName());
System.out.println("Uid:" + usr.getUid());
System.out.println("Gid:" + usr.getGid());
System.out.println("home:" + usr.getHome());
System.out.println("comment:" + usr.getComment());
System.out.println("shell:" + usr.getShell());
System.out.println("----------------------------------------------------");
}
}
}
| [
"rickliu8788@gmail.com"
] | rickliu8788@gmail.com |
5da5917ab263c6dcfb829eb3a50c365b5428502e | 2729d285056ce37cc803fd21c808231550d09376 | /src/main/java/buoi12_oop/QuanLy.java | 8fec428d08447bc0295ecc4085e173b1524aea4d | [] | no_license | TienNH21/MOB1023_CP16302 | bd32e26638002310b2798aca976aa1a430f7d03a | 6006d40d2ebe4b8dad77cd5b77b3460ae3fbce81 | refs/heads/master | 2023-05-26T02:54:31.620547 | 2021-06-11T11:20:24 | 2021-06-11T11:20:24 | 367,804,676 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 550 | 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 buoi12_oop;
import java.util.ArrayList;
/**
*
* @author tiennh
*/
public interface QuanLy {
public void them(Nguoi nguoi);
public boolean xoa(int viTri);
public ArrayList<Nguoi> xuatDanhSach();
public Nguoi getByViTri(int viTri);
public void taoSvAo();
public void setDanhSach(ArrayList<Nguoi> danhSach);
}
| [
"tiennguyenhoang339@gmail.com"
] | tiennguyenhoang339@gmail.com |
64b8ec1b5b09ac275f2e66acecd76b3ce042d68a | 5e7f294b4e6a2828d0e656d8ee1ed5c3eb06701d | /src/main/java/it/aranciaict/jobmatch/config/LoggingConfiguration.java | 683b8c4aabd6916804230099b70ea74597d1c5c0 | [] | no_license | marcomattolab/jobmatch | 79272609b14c7b1b4be4c4213364b1146529897b | df96366d6a69481b07e84d2841dfd5dbd6211fb5 | refs/heads/master | 2022-06-03T14:12:33.333411 | 2019-05-22T13:25:01 | 2019-05-22T13:25:01 | 188,040,030 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,933 | java | package it.aranciaict.jobmatch.config;
import java.net.InetSocketAddress;
import java.util.Iterator;
import io.github.jhipster.config.JHipsterProperties;
import ch.qos.logback.classic.AsyncAppender;
import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.LoggerContext;
import ch.qos.logback.classic.boolex.OnMarkerEvaluator;
import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.classic.spi.LoggerContextListener;
import ch.qos.logback.core.Appender;
import ch.qos.logback.core.filter.EvaluatorFilter;
import ch.qos.logback.core.spi.ContextAwareBase;
import ch.qos.logback.core.spi.FilterReply;
import net.logstash.logback.appender.LogstashTcpSocketAppender;
import net.logstash.logback.encoder.LogstashEncoder;
import net.logstash.logback.stacktrace.ShortenedThrowableConverter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
@Configuration
public class LoggingConfiguration {
private static final String LOGSTASH_APPENDER_NAME = "LOGSTASH";
private static final String ASYNC_LOGSTASH_APPENDER_NAME = "ASYNC_LOGSTASH";
private final Logger log = LoggerFactory.getLogger(LoggingConfiguration.class);
private LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
private final String appName;
private final String serverPort;
private final JHipsterProperties jHipsterProperties;
/**
* Instantiates a new logging configuration.
*
* @param appName the app name
* @param serverPort the server port
* @param jHipsterProperties the j hipster properties
*/
public LoggingConfiguration(@Value("${spring.application.name}") String appName, @Value("${server.port}") String serverPort,
JHipsterProperties jHipsterProperties) {
this.appName = appName;
this.serverPort = serverPort;
this.jHipsterProperties = jHipsterProperties;
if (jHipsterProperties.getLogging().getLogstash().isEnabled()) {
addLogstashAppender(context);
addContextListener(context);
}
if (jHipsterProperties.getMetrics().getLogs().isEnabled()) {
setMetricsMarkerLogbackFilter(context);
}
}
/**
* Adds the context listener.
*
* @param context the context
*/
private void addContextListener(LoggerContext context) {
LogbackLoggerContextListener loggerContextListener = new LogbackLoggerContextListener();
loggerContextListener.setContext(context);
context.addListener(loggerContextListener);
}
/**
* Adds the logstash appender.
*
* @param context the context
*/
private void addLogstashAppender(LoggerContext context) {
log.info("Initializing Logstash logging");
LogstashTcpSocketAppender logstashAppender = new LogstashTcpSocketAppender();
logstashAppender.setName(LOGSTASH_APPENDER_NAME);
logstashAppender.setContext(context);
String customFields = "{\"app_name\":\"" + appName + "\",\"app_port\":\"" + serverPort + "\"}";
// More documentation is available at: https://github.com/logstash/logstash-logback-encoder
LogstashEncoder logstashEncoder = new LogstashEncoder();
// Set the Logstash appender config from JHipster properties
logstashAppender.addDestinations(new InetSocketAddress(jHipsterProperties.getLogging().getLogstash().getHost(), jHipsterProperties.getLogging().getLogstash().getPort()));
ShortenedThrowableConverter throwableConverter = new ShortenedThrowableConverter();
throwableConverter.setRootCauseFirst(true);
logstashEncoder.setThrowableConverter(throwableConverter);
logstashEncoder.setCustomFields(customFields);
logstashAppender.setEncoder(logstashEncoder);
logstashAppender.start();
// Wrap the appender in an Async appender for performance
AsyncAppender asyncLogstashAppender = new AsyncAppender();
asyncLogstashAppender.setContext(context);
asyncLogstashAppender.setName(ASYNC_LOGSTASH_APPENDER_NAME);
asyncLogstashAppender.setQueueSize(jHipsterProperties.getLogging().getLogstash().getQueueSize());
asyncLogstashAppender.addAppender(logstashAppender);
asyncLogstashAppender.start();
context.getLogger("ROOT").addAppender(asyncLogstashAppender);
}
/**
* Configure a log filter to remove "metrics" logs from all appenders except the "LOGSTASH" appender
*
* @param context the new metrics marker logback filter
*/
private void setMetricsMarkerLogbackFilter(LoggerContext context) {
log.info("Filtering metrics logs from all appenders except the {} appender", LOGSTASH_APPENDER_NAME);
OnMarkerEvaluator onMarkerMetricsEvaluator = new OnMarkerEvaluator();
onMarkerMetricsEvaluator.setContext(context);
onMarkerMetricsEvaluator.addMarker("metrics");
onMarkerMetricsEvaluator.start();
EvaluatorFilter<ILoggingEvent> metricsFilter = new EvaluatorFilter<>();
metricsFilter.setContext(context);
metricsFilter.setEvaluator(onMarkerMetricsEvaluator);
metricsFilter.setOnMatch(FilterReply.DENY);
metricsFilter.start();
for (ch.qos.logback.classic.Logger logger : context.getLoggerList()) {
for (Iterator<Appender<ILoggingEvent>> it = logger.iteratorForAppenders(); it.hasNext();) {
Appender<ILoggingEvent> appender = it.next();
if (!appender.getName().equals(ASYNC_LOGSTASH_APPENDER_NAME)) {
log.debug("Filter metrics logs from the {} appender", appender.getName());
appender.setContext(context);
appender.addFilter(metricsFilter);
appender.start();
}
}
}
}
/**
* Logback configuration is achieved by configuration file and API.
* When configuration file change is detected, the configuration is reset.
* This listener ensures that the programmatic configuration is also re-applied after reset.
*/
class LogbackLoggerContextListener extends ContextAwareBase implements LoggerContextListener {
@Override
public boolean isResetResistant() {
return true;
}
@Override
public void onStart(LoggerContext context) {
addLogstashAppender(context);
}
@Override
public void onReset(LoggerContext context) {
addLogstashAppender(context);
}
@Override
public void onStop(LoggerContext context) {
// Nothing to do.
}
@Override
public void onLevelChange(ch.qos.logback.classic.Logger logger, Level level) {
// Nothing to do.
}
}
}
| [
"HP250G5@192.168.0.54"
] | HP250G5@192.168.0.54 |
f10a94db2391abab92813988286565b605953ce4 | 56688f3c7a59d06fc480c15536a7631d61768c9c | /oas-generator-common/src/test/java/com/github/chhorz/openapi/common/test/domain/ReferenceTest.java | 16e6455ded1a8b40a3a739c22c45df1a95b07fb6 | [
"Apache-2.0"
] | permissive | chhorz/oas-generator | fc6bf8b305e225a52d4390e3666e675ccc8a5a87 | 92294f27cff00c7896da9ade725222d2752b4079 | refs/heads/master | 2023-08-31T01:01:34.440469 | 2023-08-28T13:23:09 | 2023-08-29T06:51:16 | 124,779,417 | 2 | 1 | Apache-2.0 | 2023-09-04T13:11:33 | 2018-03-11T17:09:28 | Java | UTF-8 | Java | false | false | 1,741 | java | /**
*
* Copyright 2018-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* 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 com.github.chhorz.openapi.common.test.domain;
import com.github.chhorz.openapi.common.domain.Reference;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
public class ReferenceTest {
@Test
void nullSchema() {
assertThatThrownBy(() -> Reference.forSchema(null))
.isInstanceOf(NullPointerException.class);
}
@Test
void validSchema() {
// given
String doubleType = "Double";
// when
Reference reference = Reference.forSchema(doubleType);
// then
assertThat(reference)
.hasFieldOrPropertyWithValue("$ref", "#/components/schemas/Double");
}
@Test
void nullRequestBody() {
assertThatThrownBy(() -> Reference.forRequestBody(null))
.isInstanceOf(NullPointerException.class);
}
@Test
void validRequestBody() {
// given
String classCType = "ClassC";
// when
Reference reference = Reference.forRequestBody(classCType);
// then
assertThat(reference)
.hasFieldOrPropertyWithValue("$ref", "#/components/requestBodies/ClassC");
}
}
| [
"horz.christian@gmail.com"
] | horz.christian@gmail.com |
5dc3f091dee1cf7e0a81e569b45f19d1c0dca06b | da16829a5a3d9365dbab103d99aa0c43139c0829 | /Magnetized-desktop/src/com/f5/Magnetized/Main.java | e9f18ffcbcebd04670cb123d0bb3348a2dbc1933 | [] | no_license | jeganumapathy/magma | acf444973f5275335911c373faa490f956687178 | e49c3a72385b9b51253aac7c44930ee71aded0a6 | refs/heads/master | 2016-09-06T03:56:30.319717 | 2014-04-14T15:54:35 | 2014-04-14T15:54:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 442 | java | package com.f5.Magnetized;
import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;
public class Main {
public static void main(String[] args) {
LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration();
cfg.title = "Magnetized";
cfg.useGL20 = false;
cfg.width = 480;
cfg.height = 320;
new LwjglApplication(new MagnetizedGame(), cfg);
}
}
| [
"thalajegan@gmail.com"
] | thalajegan@gmail.com |
963f190c62dfbdf9146347ebe000d742830a028a | 2eb681d863f1526d51089a6793b6896b2eecee04 | /src/main/java/com/tomasajt/kornr/ShowSettings.java | 6dab2674a4a6cb2677c45021f5244911e9731ba6 | [] | no_license | TomaSajt/Kornr-legacy | 20e748d327ad006da35e9c2b30e69207ce67d9ca | 19db5161d3cdebc9cca2eed8e1ff0e2cf3d6fa83 | refs/heads/main | 2023-08-23T04:29:54.129428 | 2021-10-04T18:29:29 | 2021-10-04T18:29:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 600 | java | package com.tomasajt.kornr;
import com.tomasajt.kornr.gui.KornrSettingsScreen;
import net.minecraft.client.Minecraft;
import net.minecraftforge.event.TickEvent.ClientTickEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
@EventBusSubscriber
public class ShowSettings {
private static Minecraft mc = Minecraft.getInstance();
@SubscribeEvent
public static void onClientTick(ClientTickEvent event) {
if (KornrKeybindings.keyBindingOpenSettings.isPressed()) {
mc.displayGuiScreen(KornrSettingsScreen.instance);
}
}
}
| [
"62384384+TomaSajt@users.noreply.github.com"
] | 62384384+TomaSajt@users.noreply.github.com |
557c4eaa2b4169639b3565e15148f6217676025c | 68506ce3175e7d636deae7582ed4e1994cae96bb | /src/main/java/algorithmsmax/trainer/Trainer.java | 5bee55769ab34635a60633b18dc23ef39ef35736 | [] | no_license | tlev159/training-solutions | 352e1c7f4bdac23fff83adb9b00c77a785a41f94 | 5044cd6a3fc545f062f474523bcf6abe6e468925 | refs/heads/master | 2023-05-27T03:49:14.134749 | 2021-06-08T18:14:50 | 2021-06-08T18:14:50 | 308,344,419 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 283 | java | package algorithmsmax.trainer;
public class Trainer {
private String name;
private int age;
public Trainer(String name, int age) {
this.name = name;
this.age = age;
}
public String getName() {
return name;
}
public int getAge() {
return age;
}
}
| [
"t.levente1598@gmail.com"
] | t.levente1598@gmail.com |
b8d8723857325b6d8a17eac4aca06b9c0bb54771 | 10f85dbf723204413e3ba1699e8daa3dcb3303ce | /app/database/RecorridoDAO.java | ec03d9c7c5cbf11bc8600593e3e7ffe2ebd71335 | [
"Apache-2.0"
] | permissive | mealbarracin10/desarrollo-cloud | 9b14f38c8fd6079ba4aecfa6acdfac5066971a8e | e6da40dbf08505e1316120be62c72499479430ed | refs/heads/master | 2021-01-18T16:16:57.322272 | 2016-04-24T23:08:49 | 2016-04-24T23:08:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 943 | java | package database;
import java.util.List;
import models.MetricasXRecorrido;
import models.Recorrido;
public class RecorridoDAO {
/**
* Agregar una recorrido al repositorio
*
* @param r El recorrido que se desea agregar
*/
public void agregarRecorrido(Recorrido r){
r.save();
}
public List<Recorrido> listarRecorridos(){
return Recorrido.find.all();
}
public Recorrido consultarRecorridoPorId(Long id){
return Recorrido.find.byId(id);
}
public void actualizarRecorridoConMetricas(Recorrido r){
System.out.println("Entra a Actualizar recorridos");
Recorrido recorridoActual = consultarRecorridoPorId(r.getIdRecorrido());
recorridoActual.setMetricasXRecorrido(r.getMetricasXRecorrido());
/*for(MetricasXRecorrido mRe : recorridoActual.getMetricasXRecorrido()){
System.out.println(mRe.getMetrica().getNombreMetrica() + " " + mRe.getValorMetrica());
mRe.save();
}*/
recorridoActual.save();
}
}
| [
"me.albarracin10@uniandes.edu.co"
] | me.albarracin10@uniandes.edu.co |
e42b09c2c11fc800a9e622a675ca413f885c7508 | 7be8895fec4c097cda362e122d323f1b91640bbe | /src/clases/Helper.java | eee741c1e37db73ec0f40b52d819643bcd7be84f | [] | no_license | baltamar3/ExamenMatricesRecorridos | 6736c3cdc8c2015d756eabc7a09e18edc9f2a8cc | df02df14b3c115e3c8fd3d4cb685eab17ccb5bb9 | refs/heads/master | 2021-01-10T23:07:28.766996 | 2016-10-11T17:14:23 | 2016-10-11T17:14:23 | 70,617,247 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,378 | 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 clases;
import java.awt.Component;
import javax.swing.JButton;
import javax.swing.JOptionPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
/**
*
* @author baltamar3
*/
public class Helper {
public static void mensaje(Component ventana, String mensaje, int tipo) {
switch (tipo) {
case 1:
JOptionPane.showMessageDialog(ventana, mensaje, "Información", JOptionPane.INFORMATION_MESSAGE);
break;
case 2:
JOptionPane.showMessageDialog(ventana, mensaje, "Advertencia", JOptionPane.WARNING_MESSAGE);
break;
case 3:
JOptionPane.showMessageDialog(ventana, mensaje, "Error", JOptionPane.ERROR_MESSAGE);
break;
}
}
public static void limpiadoTabla(JTable tabla1) {
int nf, nc;
nc = tabla1.getColumnCount();
nf = tabla1.getRowCount();
for (int i = 0; i < nf; i++) {
for (int j = 0; j < nc; j++) {
tabla1.setValueAt("", i, j);
}
}
}
public static void porDefectoTabla(JTable tabla1) {
DefaultTableModel tm;
tm = (DefaultTableModel) tabla1.getModel();
tm.setColumnCount(0);
tm.setRowCount(0);
}
public static void habilitarBotones(JButton[] botones) {
for (int i = 0; i < botones.length; i++) {
botones[i].setEnabled(true);
}
}
public static void deshabilitarBotones(JButton[] botones) {
for (int i = 0; i < botones.length; i++) {
botones[i].setEnabled(false);
}
}
public static void llenadoAutomatico(JTable tabla1) {
int nf, nc, n;
nf = tabla1.getRowCount();
nc = tabla1.getColumnCount();
for (int i = 0; i < nf; i++) {
for (int j = 0; j < nc; j++) {
n = (int) (Math.random() * 99 + 1);
tabla1.setValueAt(n, i, j);
}
}
}
public static int[][] pasoDeDatos(JTable tabla1) {
int nf, nc;
nc = tabla1.getColumnCount();
nf = tabla1.getRowCount();
int m[][] = new int[nf][nc];
for (int i = 0; i < m.length; i++) {
for (int j = 0; j < m[0].length; j++) {
m[i][j] = (int) tabla1.getValueAt(i, j);
}
}
return m;
}
public static String recorridoHaciaArriba(int[][] m, int j) {
int nf = m.length;
String aux = "";
for (int i = nf - 1; i >= 0; i--) {
aux = aux + m[i][j] + ", ";
}
return aux;
}
public static String recorridoHaciaArriba(int[][] m, int j, int in, int fin) {
String aux = "";
for (int i = in; i >= fin; i--) {
aux = aux + m[i][j] + ", ";
}
return aux;
}
public static String recorridoHaciaAbajo(int[][] m, int j) {
int nf = m.length;
String aux = "";
for (int i = 0; i < nf; i++) {
aux = aux + m[i][j] + ", ";
}
return aux;
}
public static String recorridoHaciaAbajo(int[][] m, int j, int in, int fin) {
String aux = "";
for (int i = in; i <= fin; i++) {
aux = aux + m[i][j] + ", ";
}
return aux;
}
public static String recorridoHaciaIzquierda(int[][] m, int i) {
int nc = m[0].length;
String aux = "";
for (int j = nc - 1; j >= 0; j--) {
aux = aux + m[i][j] + ", ";
}
return aux;
}
public static String recorridoHaciaIzquierda(int[][] m, int i, int in, int fin) {
String aux = "";
for (int j = in; j >= fin; j--) {
aux = aux + m[i][j] + ", ";
}
return aux;
}
public static String recorridoHaciaDerecha(int[][] m, int i) {
int nc = m[0].length;
String aux = "";
for (int j = 0; j < nc; j++) {
aux = aux + m[i][j] + ", ";
}
return aux;
}
public static String recorridoHaciaDerecha(int[][] m, int i, int in, int fin) {
int nc = m[0].length;
String aux = "";
for (int j = in; j <= fin; j++) {
aux = aux + m[i][j] + ", ";
}
return aux;
}
public static String recorridoDiagonalPrincipalAbajo(int[][] m) {
int nf = m.length;
String aux = "";
for (int i = 0; i < nf; i++) {
aux = aux + m[i][i] + ", ";
}
return aux;
}
public static String recorridoDiagonalPrincipalAbajo(int[][] m, int in, int fin) {
String aux = "";
for (int i = in; i <= fin; i++) {
aux = aux + m[i][i] + ", ";
}
return aux;
}
public static String recorridoDiagonalPrincipalArriba(int[][] m) {
int nf = m.length;
String aux = "";
for (int i = nf - 1; i >= 0; i--) {
aux = aux + m[i][i] + ", ";
}
return aux;
}
public static String recorridoDiagonalPrincipalArriba(int[][] m, int in, int fin) {
String aux = "";
for (int i = in; i >= fin; i--) {
aux = aux + m[i][i] + ", ";
}
return aux;
}
public static String recorridoDiagonalSecundariaAbajo(int[][] m) {
int nf = m.length;
int nc = m[0].length;
String aux = "";
for (int i = 0; i < nf; i++) {
aux = aux + m[i][nc - 1 - i] + ", ";
}
return aux;
}
public static String recorridoDiagonalSecundariaArriba(int[][] m) {
int nf = m.length;
int nc = m[0].length;
String aux = "";
for (int i = nf - 1; i >= 0; i--) {
aux = aux + m[i][nc - 1 - i] + ", ";
}
return aux;
}
public static String recorridoDiagonalSecundariaArriba(int[][] m, int in, int fin) {
int nc = m[0].length;
String aux = "";
for (int i = in; i >= fin; i--) {
aux = aux + m[i][nc - 1 - i] + ", ";
}
return aux;
}
public static String recorridoDiagonalSecundariaAbajo(int[][] m, int in, int fin) {
int nc = m[0].length;
String aux = "";
for (int i = in; i <= fin; i++) {
aux = aux + m[i][nc - 1 - i] + ", ";
}
return aux;
}
public static String promedio(JTable tabla1) {
int nf, nc, aux, acum = 0, cont = 0, op;
String promedio;
nf = tabla1.getRowCount();
nc = tabla1.getColumnCount();
for (int i = 0; i < nf; i++) {
for (int j = 0; j < nc; j++) {
aux = (int) tabla1.getValueAt(i, j);
if (aux % 2 != 0 && aux > 10 && aux < 20) {
acum = acum + aux;
cont = cont + 1;
}
}
}
op = acum / cont;
promedio = "El promedio de numeros impares contenidos entre 10 y 20 es :" + op;
return promedio;
}
public static void triangularInferiro(JTable tabla1, JTable tabla2) {
int nf, nc, aux;
nf = tabla1.getRowCount();
nc = tabla1.getColumnCount();
for (int i = 0; i < nf; i++) {
for (int j = 0; j < nc; j++) {
aux = (int) tabla1.getValueAt(i, j);
if (i >= j) {
tabla2.setValueAt(aux, i, j);
}
}
}
}
public static void TablaDeAjedrez(JTable tabla1, JTable tabla2) {
int nf, nc, aux;
nf = tabla1.getRowCount();
nc = tabla1.getColumnCount();
for (int i = 0; i < nf; i++) {
for (int j = 0; j < nc; j++) {
aux = (int) tabla1.getValueAt(i, j);
if (i % 2 == 0 && j % 2 == 0 || i % 2 != 0 && j % 2 != 0) {
tabla2.setValueAt(aux, i, j);
}
}
}
}
public static String recorridoUno(JTable tabla) {
int m[][] = pasoDeDatos(tabla);
int nf = m.length;
int nc = m[0].length;
String aux = "";
int x = 0;
int y = 1;
while (x < nf) {
aux = aux + Helper.recorridoHaciaArriba(m, x, nf - 1, x);
aux = aux + Helper.recorridoHaciaDerecha(m, x, y, nc - 1);
x = x + 1;
y = y + 1;
}
aux = aux.substring(0, aux.length() - 2) + ".";
return aux;
}
public static String recorridoDos(JTable tabla) {
int m[][] = pasoDeDatos(tabla);
int nf = m.length;
int nc = m[0].length;
String aux = "";
aux = aux + Helper.recorridoDiagonalPrincipalAbajo(m);
aux = aux + Helper.recorridoHaciaArriba(m, nc - 1, nf - 2, 0);
aux = aux + Helper.recorridoHaciaIzquierda(m, 0, nc - 2, nc / 2);
aux = aux + Helper.recorridoHaciaAbajo(m, (nc - 1) / 2, 1, nf - 1);
aux = aux + Helper.recorridoHaciaIzquierda(m, nf - 1, (nc - 1) / 2 - 1, 0);
aux = aux + Helper.recorridoHaciaArriba(m, 0, nf - 2, 0);
aux = aux.substring(0, aux.length() - 2) + ".";
return aux;
}
}
| [
"brayan3288@gmail.com"
] | brayan3288@gmail.com |
6def5c46bf7d3f711808ecce2bdba0c0fe2d7d1f | ac8a7d6d952b9ef74a31b814039b1fc6ae421786 | /app/src/main/java/com/location/philippweiher/test/AndroidUiActivity.java | 465ac8e0b04078ccdba97ba2af34d0d02d09aa13 | [] | no_license | philandroid/mockation | 82a39c49382e5863f332da9c3567906c76211734 | 86daa696374c10c8dfed5459a90ce95f33ae6d72 | refs/heads/master | 2020-05-18T10:20:07.786845 | 2014-08-20T12:22:17 | 2014-08-20T12:22:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,484 | java | package com.location.philippweiher.test;
/**
* Created by philippweiher on 31.07.14.
*/
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;
import com.j256.ormlite.android.apptools.OrmLiteBaseActivity;
import com.j256.ormlite.dao.RuntimeExceptionDao;
import com.location.philippweiher.test.utils.DatabaseHelper;
import java.util.List;
/**
* Sample Android UI activity which displays a text window when it is run.
*/
public class AndroidUiActivity extends OrmLiteBaseActivity<DatabaseHelper> {
private final String LOG_TAG = getClass().getSimpleName();
private TextView contentView;
/**
* Called when the activity is first created.
*/
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Log.i(LOG_TAG, "creating " + getClass() + " at " + System.currentTimeMillis());
}
/**
* Do our sample database stuff.
*/
private void databaseActions(String action) {
// get our dao
RuntimeExceptionDao<StoredAddress, Integer> simpleDao = getHelper().getStoredAddressRuntimeExceptionDao();
// query for all of the data objects in the database
List<StoredAddress> list = StoredAddress.queryForAll();
// our text builder for building the content-view
StringBuilder sb = new StringBuilder();
sb.append("got ").append(list.size()).append(" entries in ").append(action).append("\n");
}
} | [
"Philipp.Weiher@deliveryhero.com"
] | Philipp.Weiher@deliveryhero.com |
f811be149b2f7524e57542613591d98c40ceb1ee | adfc518a40bae0e7e0ef08700de231869cdc9e07 | /src/main/java/zes/base/privacy/PrivacyPptxFileFilter.java | 5461008aa97e169e8f174eda37ccb8a1d2ed21ce | [
"Apache-2.0"
] | permissive | tenbirds/OPENWORKS-3.0 | 49d28a2f9f9c9243b8f652de1d6bc97118956053 | d9ea72589854380d7ad95a1df7e5397ad6d726a6 | refs/heads/master | 2020-04-10T02:49:18.841692 | 2018-12-07T03:40:00 | 2018-12-07T03:40:00 | 160,753,369 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,963 | java | /*
* Copyright (c) 2012 ZES Inc. All rights reserved. This software is the
* confidential and proprietary information of ZES Inc. You shall not disclose
* such Confidential Information and shall use it only in accordance with the
* terms of the license agreement you entered into with ZES Inc.
* (http://www.zesinc.co.kr/)
*/
package zes.base.privacy;
import java.io.File;
import java.io.FileInputStream;
import org.apache.poi.openxml4j.opc.OPCPackage;
import org.apache.poi.xslf.extractor.XSLFPowerPointExtractor;
/**
* MS 오피스 파일중 Power Point 파일(pptx 확장자)에 대한 개인정보 포함여부를 확인한다.
*
* <pre>
* << 개정이력(Modification Information) >>
*
* 수정일 수정자 수정내용
* -------------- -------- -------------------------------
*
*
* 2013. 06. 04. 방기배 개인정보 필터링
* </pre>
*/
public class PrivacyPptxFileFilter extends AbstractPrivacyFilter implements PrivacyFilter {
public PrivacyPptxFileFilter(File file) throws Exception {
this.file = file;
}
/*
* Power Point 파일내에서 개인정보를 포함한 값이 있는지 여부를 확인
* @see
* zes.base.privacy.PrivacyFilter#doFilter(java.lang.String)
*/
@Override
public boolean doFilter() {
FileInputStream fileInput = null;
try {
fileInput = new FileInputStream(this.file);
OPCPackage pkg = OPCPackage.open(fileInput);
XSLFPowerPointExtractor pe = new XSLFPowerPointExtractor(pkg);
return doPrivacyCheck(pe.getText());
} catch (Exception e) {
logger.error("MS Excel(.xlsx) File search Failed", e);
return false;
} finally {
if(fileInput != null) {
try {
fileInput.close();
} catch (Exception e) {}
}
}
}
}
| [
"tenbirds@gmail.com"
] | tenbirds@gmail.com |
89321c1863eaf4fddb34408c714fcba874fa0bbc | 8c9f83210b9e86da044e83dfd77a9c92bac0e4ce | /app/src/main/java/creations/appmaking/thsvhsapp/AccessCode.java | fa537e054bd10f2e585f87d2e69ffe6b0e029583 | [] | no_license | Sriharsha-Singam/THSVHS-APP-Android-Version | 56a567992fb2308f10902c8abee30ddf5c5aaa00 | a498d0e4033a2f2b86850c6f8b6c97cbf1710fcd | refs/heads/master | 2021-09-02T07:55:07.385817 | 2017-12-31T17:35:02 | 2017-12-31T17:35:37 | 114,944,867 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 323 | java | package creations.appmaking.thsvhsapp;
/**
*Copyright © 2017 Sriharsha Singam. All rights reserved.
**/
public class AccessCode {
String code;
public AccessCode()
{
}
public AccessCode(String code) {
this.code=code;
}
public String getCode()
{
return code;
}
}
| [
"harshasingam3@gmail.com"
] | harshasingam3@gmail.com |
7c6e77de6fda3c1fedaa2e9df1eb65cae8be24b5 | 55ab399ea4bea202ca2dd10e9d5e95b539422c4d | /src/main/java/com/gerald/spring/ioc/componentscan/AnotherBean.java | 4264d752510217a1efe26d93fbaae533caf38d9f | [] | no_license | yzy830/spring-test | b1d7ab18dd80edded42f402b920ffa3376f77f67 | ee0712bb88c1149aa90fbd5cde130cc097daffd6 | refs/heads/master | 2021-01-19T10:12:21.363024 | 2018-01-05T11:55:17 | 2018-01-05T11:55:17 | 82,166,909 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 149 | java | package com.gerald.spring.ioc.componentscan;
public class AnotherBean {
public String getName() {
return "another-bean";
}
}
| [
"yangzongyuan830@163.com"
] | yangzongyuan830@163.com |
e1d0016549d70fd2d2ea7ae7d63e4d30d15e7bf0 | 7a21ff93edba001bef328a1e927699104bc046e5 | /project-parent/module-parent/service-module-parent/tool-service/src/main/java/com/dotop/smartwater/project/module/service/tool/IDeviceParametersService.java | 41088873ebe8d9316ad6efc700ec98c916aa131b | [] | no_license | 150719873/zhdt | 6ea1ca94b83e6db2012080f53060d4abaeaf12f5 | c755dacdd76b71fd14aba5e475a5862a8d92c1f6 | refs/heads/master | 2022-12-16T06:59:28.373153 | 2020-09-14T06:57:16 | 2020-09-14T06:57:16 | 299,157,259 | 1 | 0 | null | 2020-09-28T01:45:10 | 2020-09-28T01:45:10 | null | UTF-8 | Java | false | false | 1,241 | java | package com.dotop.smartwater.project.module.service.tool;
import java.util.List;
import com.dotop.smartwater.dependence.core.common.BaseService;
import com.dotop.smartwater.dependence.core.pagination.Pagination;
import com.dotop.smartwater.project.module.core.water.bo.DeviceBatchBo;
import com.dotop.smartwater.project.module.core.water.bo.DeviceParametersBo;
import com.dotop.smartwater.project.module.core.water.vo.DeviceParametersVo;
/**
*
* @date 2019年2月21日
*/
public interface IDeviceParametersService extends BaseService<DeviceParametersBo, DeviceParametersVo> {
@Override
Pagination<DeviceParametersVo> page(DeviceParametersBo deviceParametersBo);
@Override
DeviceParametersVo get(DeviceParametersBo deviceParametersBo);
DeviceParametersVo getParams(DeviceParametersBo deviceParametersBo);
@Override
DeviceParametersVo add(DeviceParametersBo deviceParametersBo);
@Override
List<DeviceParametersVo> list(DeviceParametersBo deviceParametersBo);
List<DeviceParametersVo> noEndList(DeviceBatchBo bo);
@Override
String del(DeviceParametersBo deviceParametersBo);
@Override
boolean isExist(DeviceParametersBo deviceParametersBo);
boolean checkDeviceName(DeviceParametersBo deviceParametersBo);
}
| [
"2216502193@qq.com"
] | 2216502193@qq.com |
90976a86b6d551cd5fdf59ca03129a814388a3fd | db68677d9187738da751e4a80cb79424353f6821 | /src/main/java/controllers/About.java | 82f5a5b927dd23dd7aa578496124e8b1a0db7089 | [
"MIT"
] | permissive | alwise/Express-Fees-Manager | 1d9062e7a28ca5ca9bc69640dd18c23869f18b80 | 96ec5ce990fa289a8a6b3426319a822b97ec9ec3 | refs/heads/master | 2020-07-07T04:43:42.308914 | 2019-08-25T13:03:25 | 2019-08-25T13:03:25 | 203,253,225 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,016 | java | package main.java.controllers;
import javafx.application.Platform;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Hyperlink;
import java.awt.*;
import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.ResourceBundle;
public class About implements Initializable {
@FXML private Hyperlink websiteText,emailText;
@Override
public void initialize(URL location, ResourceBundle resources) {
}
// @FXML
// private void launchAboutUs(ActionEvent event) throws URISyntaxException, IOException {
// String dir = System.getProperty("user.dir");
// File file = new File(dir.concat("/files/manual.pdf"));
// if (!file.exists()){
// return;
// }
// Desktop.getDesktop().open(file);
//
// }
@FXML
private void launchManual(ActionEvent event) {
//String dir = System.getProperty("user.dir");
File file = new File(System.getProperty("user.dir").concat("/files/manual.pdf"));
if (!file.exists())
return;
Platform.runLater(() -> {
try {
Desktop.getDesktop().open(file);
} catch (IOException e) {
e.printStackTrace();
}
});
}
@FXML
private void sendEmail(ActionEvent event) {
Platform.runLater(() -> {
try {
Desktop.getDesktop().mail(new URI("mailto:alwisestudioinc@gmail.com"));
} catch (IOException | URISyntaxException e) {
e.printStackTrace();
}
});
}
@FXML
private void visitWebsite(ActionEvent event) {
Platform.runLater(() -> {
try {
Desktop.getDesktop().browse(new URI("www.alwisestudio.com"));
} catch (IOException | URISyntaxException e) {
e.printStackTrace();
}
});
}
}
| [
"kemevoralwise@gmail.com"
] | kemevoralwise@gmail.com |
7deb9a8590d8b7fb027257c4b2ab3b811b3a9c7e | 5865dda1bab0014a34b58277e0f7f051b96ce436 | /ProyectoSaraAdministradores/app/src/androidTest/java/com/sbsromero/proyectosaraadministradores/ExampleInstrumentedTest.java | 3bd266cc74c5cdd06c098ea5e9fb52ecaf15bfc3 | [] | no_license | sbsromero/Electiva_android | ea68059660c9d43ef3300240f22539d9640ee07d | f656df272e76a270b93e6270e71b2c79d8b5f5c5 | refs/heads/master | 2021-08-08T06:09:55.225612 | 2017-11-09T18:12:33 | 2017-11-09T18:12:33 | 110,150,150 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 786 | java | package com.sbsromero.proyectosaraadministradores;
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.*;
/**
* Instrumentation 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.sbsromero.proyectosaraadministradores", appContext.getPackageName());
}
}
| [
"sromero@sumset.com"
] | sromero@sumset.com |
ea0756da60907342456450f64751b231309e75a9 | b7a6803dc87613f02b9996819b66d7e8dc1fb940 | /src/main/java/com/tts/file/WriteFile.java | 24caaddaa4462efe19989d830754f5d883129bf3 | [] | no_license | shwetadskh/File-Handling | 992fdbd623fa2e1725e4367a1471a0a1f6124640 | e4588d0eb3622e7918b333b5ee93f76e0909f2cf | refs/heads/main | 2023-04-15T02:14:01.909869 | 2021-05-05T19:52:50 | 2021-05-05T19:52:50 | 364,689,865 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 762 | java | package com.tts.file;
import java.io.FileWriter;
//In the following example, we use the FileWriter class together with its write() method
// to write some text to the file we created in the example above.
// Note that when you are done writing to the file, you should close it with the close() method:
public class WriteFile {
public static void main(String[] args) {
try{
FileWriter myWriter =new FileWriter("newFile.txt");
myWriter.write("File created in java is tricky but it is fun!");
myWriter.close();
System.out.println("Successfully wrote to the file");
} catch(Exception e){
System.out.println("An error occurred!");
e.printStackTrace();
}
}
}
| [
"shweta.dskh@gmail.com"
] | shweta.dskh@gmail.com |
af7fb7d42794f3ccf0956ef01428d6b9be0350ac | 407d3142eb8155fb60d753ccfe04b56715d74d1b | /src/org/javatroid/collision/AABB.java | 4ec566540e91de58221d2918c4dbc1132e3674fa | [] | no_license | BardenDaSparden/Vector-Defender | 4ddb829183947c0a68cd3c25975d7e95164b79e7 | bc5521a67b538ae744861eb58eef8bb25aff92a4 | refs/heads/master | 2021-06-02T17:41:45.768706 | 2020-08-16T17:11:34 | 2020-08-16T17:11:34 | 44,021,831 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,770 | java | package org.javatroid.collision;
import org.javatroid.math.FastMath;
import org.javatroid.math.Vector2f;
public class AABB {
private Vector2f min, max, center;
public AABB(float x, float y, float width, float height){
this.center = new Vector2f(x, y);
this.min = new Vector2f(x - width / 2, y - height / 2);
this.max = new Vector2f(x + width / 2, y + height / 2);
}
public AABB(Vector2f min, Vector2f max){
this.center = min.add(max.sub(min).scale(0.5f));
this.min = min;
this.max = max;
}
public boolean intersects(AABB other){
if(min.x > other.max.x || max.x < other.min.x)
return false;
if(min.y > other.max.y || max.y < other.min.y)
return false;
return true;
}
public boolean contains(float x, float y){
return contains(new Vector2f(x, y));
}
public boolean contains(Vector2f point){
if(point.x <= min.x || max.x < point.x)
return false;
if(point.y <= min.y || max.y < point.y)
return false;
return true;
}
public void move(Vector2f translation){
this.center = center.add(translation);
this.min = min.add(translation);
this.max = max.add(translation);
}
public Vector2f getMin(){
return min.clone();
}
public Vector2f getMax(){
return max.clone();
}
public float getWidth(){
return max.x - min.x;
}
public float getHeight(){
return max.y - min.y;
}
public Vector2f getCenter(){
return center;
}
public static AABB join(AABB a, AABB b){
float minX = FastMath.min(a.getMin().x, b.getMin().x);
float minY = FastMath.min(a.getMin().y, b.getMin().y);
float maxX = FastMath.max(a.getMax().x, b.getMax().x);
float maxY = FastMath.max(a.getMax().y, b.getMax().y);
return new AABB(new Vector2f(minX, minY), new Vector2f(maxX, maxY));
}
}
| [
"brandencmonroe@gmail.com"
] | brandencmonroe@gmail.com |
6041af5071a8169e02d2996ae3604da09cd08b23 | ee1fc12feef20f8ebe734911acdd02b1742e417c | /android_sourcecode_crm/app/src/main/java/com/akan/qf/mvp/fragment/qifei/bigAreaAdapter.java | 600aba337b2bb950bfdd9cd94bd08bc938167c3c | [
"MIT"
] | permissive | xiaozhangxin/test | aee7aae01478a06741978e7747614956508067ed | aeda4d6958f8bf7af54f87bc70ad33d81545c5b3 | refs/heads/master | 2021-07-15T21:52:28.171542 | 2020-03-09T14:30:45 | 2020-03-09T14:30:45 | 126,810,840 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,437 | java | package com.akan.qf.mvp.fragment.qifei;
import android.content.Context;
import android.support.annotation.LayoutRes;
import android.support.constraint.ConstraintLayout;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.akan.qf.R;
import com.akan.qf.mvp.fragment.qifei.BigAreaBean;
import com.jude.easyrecyclerview.adapter.BaseViewHolder;
import com.jude.easyrecyclerview.adapter.RecyclerArrayAdapter;
import java.util.List;
/**
* Created by admin on 2018/12/3.
*/
public class bigAreaAdapter extends RecyclerArrayAdapter<BigAreaBean> {
public bigAreaAdapter(Context context, List<BigAreaBean> list) {
super(context, list);
}
@Override
public BaseViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) {
return new ViewHolder(parent, viewType);
}
public class ViewHolder extends BaseViewHolder<BigAreaBean> {
private TextView tvName, tvNum, tvState;
private ConstraintLayout bgView;
public ViewHolder(ViewGroup parent, @LayoutRes int res) {
super(parent, R.layout.item_area);
tvName = $(R.id.one);
tvNum = $(R.id.two);
tvState = $(R.id.three);
bgView = $(R.id.bgView);
}
@Override
public void setData(BigAreaBean data) {
super.setData(data);
if (0 == getDataPosition()) {
bgView.setBackgroundResource(R.drawable.rank_one);
tvName.setBackgroundResource(R.drawable.num_one);
tvName.setText("");
tvNum.setTextColor(getContext().getResources().getColor(R.color.white));
tvState.setTextColor(getContext().getResources().getColor(R.color.white));
} else if (1 == getDataPosition()) {
bgView.setBackgroundResource(R.drawable.rank_two);
tvName.setBackgroundResource(R.drawable.num_two);
tvName.setText("");
tvNum.setTextColor(getContext().getResources().getColor(R.color.white));
tvState.setTextColor(getContext().getResources().getColor(R.color.white));
} else if (2 == getDataPosition()) {
bgView.setBackgroundResource(R.drawable.rank_three);
tvName.setBackgroundResource(R.drawable.num_three);
tvName.setText("");
tvNum.setTextColor(getContext().getResources().getColor(R.color.white));
tvState.setTextColor(getContext().getResources().getColor(R.color.white));
} else {
bgView.setBackground(null);
tvName.setText((getDataPosition() + 1) + "");
tvName.setVisibility(View.VISIBLE);
tvName.setBackground(null);
tvNum.setTextColor(getContext().getResources().getColor(R.color.colorTextG3));
tvState.setTextColor(getContext().getResources().getColor(R.color.colorTextG3));
}
tvNum.setText(getArea(data));
tvState.setText(data.getCount());
}
}
private String getArea(BigAreaBean data){
if (!TextUtils.isEmpty(data.getFullArea())) {
return data.getFullArea();
} else if (!TextUtils.isEmpty(data.getGroup_name())) {
return data.getGroup_name();
} else {
return null;
}
}
} | [
"xiaozhangxin@shifuhelp.com"
] | xiaozhangxin@shifuhelp.com |
86961293c5c5488e7580ef34f6607d8916c883c8 | 2e88c8d90900c7f79d5201b9788d52a98f3b11f1 | /exceptions/SkipException.java | 7eec806f03cb921adde847bd1b9067ec040c8b40 | [] | no_license | xiangzhao/teaseapartinheritancerefactoring | a4b5013b06c129777f615fb082a9018a0a33035a | 2aa6ed1f982911d3b7dc8748231923fc028076e3 | refs/heads/master | 2020-05-17T12:28:58.455735 | 2014-02-19T19:45:41 | 2014-02-19T19:45:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 232 | java | /**
*
*/
package exceptions;
import java.io.Serializable;
/**
* @author xiang
*
*/
public class SkipException implements Serializable {
/**
*
*/
private static final long serialVersionUID = 7940653141607718213L;
}
| [
"xiang.umass@gmail.com"
] | xiang.umass@gmail.com |
b82ca36fa7c4faaed02e664cd505b3739ac7a36f | 0415983020751f5563ec0a74b0b9b32cb8e8946e | /src/Domain/LZ78.java | de5685b94d6df7bb23f0b1fe5c35f32123840e21 | [] | no_license | guillembartrina/PROP_Compressor | 0fb5c799209699153309db52a7d4daab340a49e4 | 745065e8e0bd8ab478b1800799f98bcd369c4cc3 | refs/heads/master | 2020-12-14T23:45:22.247582 | 2020-01-20T13:04:03 | 2020-01-20T13:04:03 | 234,913,662 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,913 | java | /**
* @file LZ78.java
*/
package Domain;
import java.util.ArrayList;
/**
* @class LZ78
* @brief Implementació específica de l'algorisme de compressió LZ78
* És la classe que implementa els mètodes específics de compressió i descompressió heredats de Algorithm per a l'algorisme LZ78
*/
class LZ78 extends Algorithm
{
/**
* @brief Constructora
* \pre true
* \post S'ha creat una instància de l'algorisme LZ78, amb el nom "LZ78"
*/
LZ78()
{
super("LZ78");
}
/**
* @brief Comprimir un arxiu, implementació específica
* \pre true
* \post S'ha comprimit l'array de bytes d'entrada amb l'algorisme LZ78. Retorna l'array de bytes que representa el fitxer comprimit
* \exception ByteArrayException : Si en el procés intern de compressió hi ha algun error relacionat amb l'estructura ByteArray es llança excepció
* \param input Dades a comprimir
*/
protected byte[] specificCompress(final byte[] input) throws ByteArray.ByteArrayException
{
Trie.Node dict = new Trie.Node();
ByteArray ret = new ByteArray();
int indexdict = 1;
Trie.Node currentnode = dict;
int outindex1 = 0;
for (int i = 0; i < input.length; ++i) {
Trie.Node findnode = currentnode.SearchChildNode(input[i]); //find current word
if (findnode == null) {
//add current word to dictionary
findnode = currentnode.AddChildNode(input[i],indexdict);
//add the code of current word to output
ret.putShort((short)outindex1);
ret.put(input[i]);
//empty trie if trie is full
if (indexdict < Short.MAX_VALUE) {
indexdict++;
} else {
indexdict = 1;
dict = new Trie.Node();
ret.putShort(Short.MAX_VALUE);
}
currentnode = dict;
outindex1 = 0;
}
else if (i == input.length-1) {
//add the code of current word to output
ret.putShort((short)findnode.GetCode());
currentnode = findnode;
}
else {
outindex1 = findnode.GetCode();
currentnode = findnode;
}
}
return ret.getArray();
}
/**
* @brief Descomprimir un arxiu, implementació específica
* \pre true
* \post S'ha descomprimit l'array de bytes d'entrada amb l'algorisme LZ78. Retorna l'array de bytes que representa el fitxer descomprimit
* \exception ByteArrayException : Si en el procés intern de compressió hi ha algun error relacionat amb l'estructura ByteArray es llança excepció
* \param input Dades a descomprimir
* \param originalsize Mida de l'arxiu original sense comprimir
*/
protected byte[] specificDecompress(final byte[] input, int originalsize) throws ByteArray.ByteArrayException
{
ArrayList<ByteArray> dict = new ArrayList<ByteArray>();
ByteArray ret = new ByteArray(new byte[originalsize]);
int i = 0;
int dictindex = 0;
while (i < input.length) {
//convert the code to the position of word in dict
dictindex = (int)((input[i] & 0xFF) << 8 | (input[i+1] & 0xFF));
if (dictindex >= Short.MAX_VALUE) {
dict = new ArrayList<ByteArray>();
dictindex = 0;
i += 2;
}
else {
if (i+1 != input.length-1) {
byte c2 = input[i+2];
if (dictindex == 0) {
ByteArray tmp = new ByteArray();
tmp.put(c2);
//add a character to dict
dict.add(tmp);
//add a character to output
ret.put(c2);
}
else {
ByteArray str = dict.get(dictindex-1);
ByteArray str2 = new ByteArray(str.getArray());
str2.put(c2, str2.size());
//add current word to dict
dict.add(str2);
//add current word to output
ByteArray.transfer(str2, 0, ret, -1, str2.size());
}
}
else {
if (dictindex != 0) {
//add current word to output
ByteArray str = dict.get(dictindex-1);
ByteArray.transfer(str, 0, ret, -1, str.size());
}
}
dictindex = 0;
i+=3;
}
}
return ret.getArray();
}
}
| [
"guillem.bartrina@est.fib.upc.edu"
] | guillem.bartrina@est.fib.upc.edu |
f9073e8997dc146d27323e5d18d4ec223c13d8d9 | d6be05d1b2d42ef00399e22bf28cd85f44c0311f | /src/main/java/com/jiguang/test/entity/PatientBenefitLog.java | f92b4de4a88b07fc934c003710c607310f6f212a | [] | no_license | huangzhihong1009888/test2 | 08254094f88252ad6e29f4efb5fea7e324c89376 | bbb3aa64d675b2d9ae77b9adfd45375452859e1c | refs/heads/master | 2023-05-31T08:04:32.172593 | 2020-11-27T11:13:21 | 2020-11-27T11:13:21 | 316,478,711 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,410 | java | package com.jiguang.test.entity;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.util.Date;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
/**
* 会员权益操作日志(patient_benefit_log)实体类
*
* @author kancy
* @since 2020-11-27 17:58:12
* @description 由 Mybatisplus Code Generator 创建
*/
@Data
@NoArgsConstructor
@Accessors(chain = true)
@TableName("patient_benefit_log")
public class PatientBenefitLog extends Model<PatientBenefitLog> implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
@TableId
private String id;
/**
* 租户ID
*/
private String tenantId;
/**
* 机构id
*/
private Long orgId;
/**
* 患者id
*/
private String patientId;
/**
* 权益id
*/
private String benefitId;
/**
* 权益关系id
*/
private String patientBenefitId;
/**
* 操作类型:1 绑定,2 解绑
*/
private Integer type;
/**
* 创建人ID
*/
private String creator;
/**
* 创建人姓名
*/
private String creatorName;
/**
* 创建时间
*/
private Date createTime;
} | [
"huangge666"
] | huangge666 |
7eaa16f2483fa36d2674803191d52602f8580afa | 6b0190cde552de8472fdc83bda1b5f3e8c13e2e9 | /KaoyancunSystem/HouseKeeper/src/test/java/com/kaoyancun/AppTest.java | c51983cfd01feb363786989ec79e209d829a1c9d | [] | no_license | Japoos/microDemo | a26d8168c790f7c1b2350abd9d2930e273669368 | 445faeac1aa00e2fa2f193a1ec0a5e6d1070c3ef | refs/heads/master | 2021-06-29T19:38:39.426957 | 2019-10-17T10:13:44 | 2019-10-17T10:13:44 | 173,225,684 | 0 | 0 | null | 2020-10-13T16:47:37 | 2019-03-01T03:05:30 | Java | UTF-8 | Java | false | false | 285 | java | package com.kaoyancun;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
/**
* Unit test for simple App.
*/
public class AppTest
{
/**
* Rigorous Test :-)
*/
@Test
public void shouldAnswerWithTrue()
{
assertTrue( true );
}
}
| [
"service@jurvs.com"
] | service@jurvs.com |
67f425cde3aa113938591b6e7daa9df81488175b | 613f6debdb2d836c98c6307cc56331b990085915 | /feiying-team/src/main/java/com/feiying/erp/service/person/PersonResource.java | 41093fafc1870c661db1e42f85988822e286ab86 | [
"Apache-2.0"
] | permissive | wuyc511/wePro | b765d9befdedce625dbd42e3aee5865fa79c7998 | ad0580e4981ed11f23ac8fdf60f661e146fb0b43 | refs/heads/master | 2022-12-23T20:06:00.932353 | 2019-08-31T02:11:28 | 2019-08-31T02:11:28 | 203,771,573 | 0 | 0 | null | 2022-12-16T09:54:07 | 2019-08-22T10:31:05 | JavaScript | UTF-8 | Java | false | false | 273 | java | package com.feiying.erp.service.person;
import com.feiying.erp.service.ResourceInfo;
import java.lang.annotation.*;
@ResourceInfo(value = "person", type = 45)
@Inherited
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface PersonResource {
}
| [
"wuyc511@foxmail.com"
] | wuyc511@foxmail.com |
61d0c327c34fd9002c1be271aa37ac08292bfa6f | 68b7880c6d9e49b5228534f4fea0ff5eda93c6f2 | /src/solutions/interviews/Cooccurrence.java | 063c7359f3b5c91a6b4317c0fed08bc6c9198c95 | [] | no_license | rsibanez89/hackerrank-problems-java | 795e0321685983d4723e45d2b6116d040e69f698 | bcb9cb08f2c97f74ee59404005f33087863bf15f | refs/heads/master | 2020-04-09T21:23:27.998230 | 2016-10-12T08:13:07 | 2016-10-12T08:13:07 | 68,270,221 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,256 | java | package solutions.interviews;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.ListIterator;
import java.util.Scanner;
import java.util.regex.Pattern;
public class Cooccurrence {
// To execute form the console
// E:\hackerrank-problems-java\bin>java solutions.interviews.Cooccurrence "../res/cat-in-the-hat.txt" 3
public static void main(String[] args) {
try {
String path = "res/cat-in-the-hat.txt";
Integer k = 3;
if (args.length == 2) {
path = args[0];
k = Integer.valueOf(args[1]);
}
List<String> text = new ArrayList<String>();
Scanner sc = new Scanner(new File(path));
Pattern regex = Pattern.compile("[^a-zA-Z]"); // everything which is not a text
// Read the file
// Time complexity O(3N) -> Read from file, remove characters, replace with lower-case
while (sc.hasNext()) {
String next = regex.matcher(sc.next()).replaceAll("").toLowerCase();
if (!next.isEmpty())
text.add(next);
}
// text.forEach(x -> System.out.println(x));
// Process the file
// Time complexity O(KN)
ListIterator<String> i = text.listIterator();
HashMap<String, Float> cooccurrence = new HashMap<>();
HashMap<String, Float> occurrence = new HashMap<>();
while (i.hasNext()) {
String A = i.next();
Float occurrenceA = occurrence.get(A);
if (occurrenceA == null)
occurrenceA = 0.0f;
occurrence.put(A, occurrenceA + 1f);
// Process all the elements in between i and i-k
ListIterator<String> left = text.listIterator(i.previousIndex());
HashSet<String> alreadyCounted = new HashSet<>(); // contains of a set perform better tan a List
for (int j = 0; j < k && left.hasPrevious(); j++) {
String B = left.previous();
if (alreadyCounted.add(B)) {
String AB = A + "-" + B;
Float cooccurrenceAB = cooccurrence.get(AB);
if (cooccurrenceAB == null)
cooccurrenceAB = 0.0f;
cooccurrence.put(AB, cooccurrenceAB + 1f);
}
}
// Process all the elements in between i and i+k
ListIterator<String> right = text.listIterator(i.nextIndex());
for (int j = 0; j < k && right.hasNext(); j++) {
String B = right.next();
if (alreadyCounted.add(B)) {
String AB = A + "-" + B;
Float cooccurrenceAB = cooccurrence.get(AB);
if (cooccurrenceAB == null)
cooccurrenceAB = 0.0f;
cooccurrence.put(AB, cooccurrenceAB + 1f);
}
}
}
// occurrence.forEach((x, y) -> System.out.println(x + " -> " + y));
// cooccurrence.forEach((x, y) -> System.out.println(x + " -> " + y));
Scanner stInput = new Scanner(System.in);
String A = "hat";
String B = "cat";
// Process every input O(1)
while (stInput.hasNext()) {
A = stInput.next();
B = stInput.next();
Float occurrenceA = occurrence.get(A);
Float cooccurrenceAB = cooccurrence.get(A + "-" + B);
if (occurrenceA == null)
occurrenceA = 0f;
if (cooccurrenceAB == null)
cooccurrenceAB = 0f;
if (occurrenceA != 0)
System.out.printf("%.2f\n", cooccurrenceAB / occurrenceA);
else
System.out.printf("%.2f\n", 0f);
}
sc.close();
stInput.close();
} catch (IOException e) {
e.printStackTrace();
}
}
// This solution doesn't meet the performance
private static void firstSolution(String args[]) {
try {
String path = "res/cat-in-the-hat.txt";
Integer k = 3;
if (args.length == 2) {
path = args[0];
k = Integer.valueOf(args[1]);
}
List<String> text = new ArrayList<String>();
Scanner sc = new Scanner(new File(path));
// Read the file
// Time complexity O(3N) -> Read from file, remove characters, replace with lower-case
// I create N Pattern Object that are exactly the same.
while (sc.hasNext()) {
text.add(sc.next().replaceAll("[^a-zA-Z ]", "").toLowerCase());
}
Scanner stInput = new Scanner(System.in);
String A = "hat";
String B = "cat";
// I'm processing when they put the input, it doesn't meet the performance O(1)
while (stInput.hasNext()) {
A = stInput.next();
B = stInput.next();
float occurrenceA = 0;
float cooccurrence = 0;
for (int i = 0; i < text.size(); i++)
if (text.get(i).equals(A)) {
occurrenceA++;
boolean counted = false;
// Look for the B in k position to the right
for (int j = i + 1; j < text.size() && j <= i + k && !counted; j++)
if (text.get(j).equals(B)) {
cooccurrence++;
counted = true;
}
// Look for the B in k position to the left
for (int j = i - 1; j >= 0 && j >= i - k && !counted; j--)
if (text.get(j).equals(B)) {
cooccurrence++;
counted = true;
}
}
if (occurrenceA != 0)
System.out.printf("%.2f\n", cooccurrence / occurrenceA);
else
System.out.printf("%.2f\n", 0f);
}
sc.close();
stInput.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
| [
"rsibanez89@gmail.com"
] | rsibanez89@gmail.com |
a407beb100f7ea66cf66ae9d50808a7d54fa1ffe | dbfdcbca66e76f093c9a54133191104eb0e3ce8a | /src/HRAexempt.java | 2d5f793ff6229dcbf3547b85b6ae398ecf38cf4a | [] | no_license | welkin91/HRA_exempt_calculator | b13fdec521947a3fe376c153d24814f80e712771 | 58e9c598138aa81431e358b86c2bd3083b9cf7de | refs/heads/master | 2021-01-18T13:57:31.066669 | 2015-03-23T08:07:38 | 2015-03-23T08:07:38 | 32,680,510 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,866 | java | import java.util.HashSet;
public class HRAexempt {
private static double baseSal;
private static double hra;
private static double houseRent;
private static String city;
public static HashSet<String> set = null;
HRAexempt()
{
baseSal = 0.0;
hra = 0.0;
houseRent = 0.0;
city = "";
set = new HashSet<String>();
set.add("mumbai");
set.add("delhi");
set.add("chennai");
set.add("kolkata");
}
HRAexempt(double a,double b,double c,String s)
{
baseSal = a;
hra = b;
houseRent = c;
city = s;
set = new HashSet<String>();
set.add("mumbai");
set.add("delhi");
set.add("chennai");
set.add("kolkata");
}
public static void setSal(double a)
{
baseSal = a;
}
public double getSal()
{
return baseSal;
}
public static void sethra(double a)
{
hra = a;
}
public double gethra()
{
return hra;
}
public static void sethouseRent(double a)
{
houseRent = a;
}
public double gethouseRent()
{
return houseRent;
}
public static void setCity(String s)
{
city = s;
}
public String getCity()
{
return city;
}
public static double minn ( double a , double b)
{
if ( a > b ) return b;
return a;
}
public double getHRAexempt()
{
double res = 0.0;
if ( set.contains(city) )
res = minn(hra,minn((0.5*baseSal),(houseRent-(0.1*baseSal))));
else
res = minn(hra,minn((0.4*baseSal),(houseRent-(0.1*baseSal))));
return res;
}
public double getHRAexempt(double a,double b,double c, String city)
{
double res = 0.0;
if ( set.contains(city) )
res = minn(b,minn((0.5*a),(c-(0.1*a))));
else
res = minn(b,minn((0.4*a),(c-(0.1*a))));
return res;
}
public static void main(String[] argv) {
HRAexempt x = new HRAexempt(50000, 20000, 18000, "mumbai");
System.out.println(x.getHRAexempt(x.getSal(),x.gethra(),x.gethouseRent(),x.getCity()));
}
}
| [
"akash.bhatia2011@gmail.com"
] | akash.bhatia2011@gmail.com |
134852a28463c7941aa39504ecc32e90c4250f98 | 913c5d5d2cd6094d3def8eac76046b1de758283a | /org.angriff.eva.core.model/src/org/angriff/eva/core/model/EvaModelFactory.java | 00b1d7e792834ea5293442158bbec1046b1209ba | [] | no_license | palador/eva | d89290ae902e6b1d5174d9ab1d4626c58f32d6c8 | 5c85d6b54b50fd04480d920b97044b6ab0d62997 | refs/heads/master | 2021-01-10T22:05:07.660361 | 2012-03-07T18:34:32 | 2012-03-07T18:34:32 | 3,596,250 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,301 | java | /**
* <copyright>
* </copyright>
*
* $Id$
*/
package org.angriff.eva.core.model;
import org.eclipse.emf.ecore.EFactory;
/**
* <!-- begin-user-doc -->
* The <b>Factory</b> for the model.
* It provides a create method for each non-abstract class of the model.
* <!-- end-user-doc -->
* @see org.angriff.eva.core.model.EvaModelPackage
* @generated
*/
public interface EvaModelFactory extends EFactory {
/**
* The singleton instance of the factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EvaModelFactory eINSTANCE = org.angriff.eva.core.model.impl.EvaModelFactoryImpl.init();
/**
* Returns a new object of class '<em>Eva Component Factory Meta</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return a new object of class '<em>Eva Component Factory Meta</em>'.
* @generated
*/
EvaComponentFactoryMeta createEvaComponentFactoryMeta();
/**
* Returns a new object of class '<em>Eva Component Meta</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return a new object of class '<em>Eva Component Meta</em>'.
* @generated
*/
EvaComponentMeta createEvaComponentMeta();
/**
* Returns a new object of class '<em>Eva Port</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return a new object of class '<em>Eva Port</em>'.
* @generated
*/
EvaPort createEvaPort();
/**
* Returns a new object of class '<em>Eva Pin</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return a new object of class '<em>Eva Pin</em>'.
* @generated
*/
EvaPin createEvaPin();
/**
* Returns a new object of class '<em>Eva Parameter</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return a new object of class '<em>Eva Parameter</em>'.
* @generated
*/
EvaParameter createEvaParameter();
/**
* Returns a new object of class '<em>Eva Argument</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return a new object of class '<em>Eva Argument</em>'.
* @generated
*/
EvaArgument createEvaArgument();
/**
* Returns the package supported by this factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the package supported by this factory.
* @generated
*/
EvaModelPackage getEvaModelPackage();
} //EvaModelFactory
| [
"palador@projektangriff.de"
] | palador@projektangriff.de |
25db4ea169dddef2e7dff2f5bdece3e87e4e4236 | 4c01d7c77b4a3c2a1d05c0106526da335da9f04f | /app/src/main/java/com/fitness/dense/densefitness/PagerAdapterControl.java | 35bc54126ebef2f0e65da0d8d87eaf9fcc59c1a6 | [] | no_license | wikaweo/Densefitness | 80c5c8df082426b8540736b997535b97d450dc63 | 6b17bd547c74238cec8f64a3a31bb69d6dfea82c | refs/heads/master | 2021-01-10T02:19:48.428356 | 2016-03-25T21:08:56 | 2016-03-25T21:08:56 | 45,778,010 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,540 | java | package com.fitness.dense.densefitness;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import java.util.List;
/**
* Created by Fredrik on 2015-12-30.
*/
public class PagerAdapterControl extends FragmentStatePagerAdapter {
private MainActivity mainActivity;
public static int pos = 0;
private List<Fragment> myFragments;
public PagerAdapterControl(MainActivity mainActivity, FragmentManager fm, List<Fragment> myFrags) {
super(fm);
this.mainActivity = mainActivity;
myFragments = myFrags;
}
@Override
public Fragment getItem(int position) {
return myFragments.get(position);
}
@Override
public int getCount() {
return myFragments.size();
//return tabs.length;
}
@Override
public CharSequence getPageTitle(int position) {
setPos(position);
String PageTitle = "";
switch(pos)
{
case 0:
PageTitle = "Workouts";
break;
case 1:
PageTitle = "Records";
break;
case 2:
PageTitle = "Body mass";
break;
case 3:
PageTitle = "Exercise";
break;
}
return PageTitle;
}
public static int getPos() {
return pos;
}
public static void setPos(int pos) {
PagerAdapterControl.pos = pos;
}
}
| [
"fredrikagne@hotmail.com"
] | fredrikagne@hotmail.com |
ddb0c485f149f425b348afe05332bc2d39b23620 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/4/4_ec4d43907d778b30ed35012b06961a352c52a275/DialogTest/4_ec4d43907d778b30ed35012b06961a352c52a275_DialogTest_t.java | cf2589b79d0b47677f31738fe1ac337ffd76c582 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 13,294 | java | /*
* Conditions Of Use
*
* This software was developed by employees of the National Institute of
* Standards and Technology (NIST), and others.
* This software is has been contributed to the public domain.
* As a result, a formal license is not needed to use the software.
*
* This software is provided "AS IS."
* NIST MAKES NO WARRANTY OF ANY KIND, EXPRESS, IMPLIED
* OR STATUTORY, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTY OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT
* AND DATA ACCURACY. NIST does not warrant or make any representations
* regarding the use of the software or the results thereof, including but
* not limited to the correctness, accuracy, reliability or usefulness of
* the software.
*
*
*/
package test.tck.msgflow;
import junit.framework.*;
import javax.sip.*;
import javax.sip.message.*;
import javax.sip.header.*;
import java.util.*;
import test.tck.*;
/**
* <p>Title: TCK</p>
* <p>Description: JAIN SIP 1.2 Technology Compatibility Kit</p>
* @author Emil Ivov
* Network Research Team, Louis Pasteur University, Strasbourg, France.
* This code is in the public domain.
* @version 1.0
*/
public class DialogTest extends MessageFlowHarness {
/** The Dialog to test.*/
private Dialog dialog = null;
/** The request that was sent by the TI*/
private Request tiInvite = null;
/** The initial invite request at the RI side.*/
private Request riInvite = null;
private ClientTransaction cliTran = null;
private Response ringing = null;
private String riToTag; // JvB: to-tag set by RI
public DialogTest(String name) {
super(name);
}
//==================== add a dialog to the fixture ========
/**
* Calls MessageFlowHarness.setUp() and creates a dialog afterwards.
* @throws Exception if anything goes wrong
*/
public void setUp() throws Exception {
try {
super.setUp();
tiInvite = createTiInviteRequest(null, null, null);
//Send an invite request
try {
eventCollector.collectRequestEvent(riSipProvider);
cliTran = tiSipProvider.getNewClientTransaction(tiInvite);
cliTran.sendRequest();
} catch (TooManyListenersException e) {
throw new TckInternalError(
"Failed to register a listener with the RI",
e);
} catch (SipException e) {
throw new TiUnexpectedError(
"Failed to send initial invite request",
e);
}
//Wait for the invite to arrive
waitForMessage();
RequestEvent inviteReqEvt =
eventCollector.extractCollectedRequestEvent();
if (inviteReqEvt == null || inviteReqEvt.getRequest() == null)
throw new TiUnexpectedError("The TI did not send the initial invite request");
riInvite = inviteReqEvt.getRequest();
//get the dialog
dialog = cliTran.getDialog();
//Send ringing to initialise dialog
//start listening for the response
try {
eventCollector.collectResponseEvent(tiSipProvider);
} catch (TooManyListenersException e) {
throw new TiUnexpectedError(
"Failed to register a SipListener with the TI.",
e);
}
try {
ringing =
riMessageFactory.createResponse(
Response.RINGING,
inviteReqEvt.getRequest());
((ToHeader) ringing.getHeader(ToHeader.NAME)).setTag(
riToTag = Integer.toString(hashCode()));
// BUG report from Ben Evans:
// set contact header on dialog-creating response
ringing.setHeader(createRiContact());
riSipProvider.sendResponse(ringing);
} catch (Exception e) {
throw new TckInternalError(
"Failed to create and send a RINGING response",
e);
}
waitForMessage();
ResponseEvent ringingRespEvt =
eventCollector.extractCollectedResponseEvent();
if (ringingRespEvt == null || ringingRespEvt.getResponse() == null)
throw new TiUnexpectedError("The TI did not dispatch a RINGING response.");
} catch (Throwable exc) {
exc.printStackTrace();
fail(exc.getClass().getName() + ": " + exc.getMessage());
}
assertTrue(new Exception().getStackTrace()[0].toString(), true);
}
//==================== tests ==============================
/**
* Test whether dialog fields are properly set
*/
public void testDialogProperties() {
try {
//CallId
assertEquals(
"The Dialog did not have the right Call ID.",
((CallIdHeader) riInvite.getHeader(CallIdHeader.NAME))
.getCallId(),
dialog.getCallId().getCallId());
//Tran
/* Deprecated
* assertSame(
"The Dialog.getTransaction did not return the right transaction.",
cliTran,
dialog.getFirstTransaction());
*/
//LocalParty
assertEquals(
"Dialog.getLocalParty() returned a bad address.",
((FromHeader) tiInvite.getHeader(FromHeader.NAME)).getAddress(),
dialog.getLocalParty());
//SeqNum
assertTrue(
"Dialog.getLocalSequenceNumber() returned a bad value.",
1 == dialog.getLocalSeqNumber());
//LocalTag
assertEquals(
"Dialog.getLocalTag() returned a bad tag",
((FromHeader) riInvite.getHeader(FromHeader.NAME)).getTag(),
dialog.getLocalTag());
//RemoteParty
assertEquals(
"Dialog.getRemoteParty() returned a bad address.",
((ToHeader) tiInvite.getHeader(ToHeader.NAME)).getAddress(),
dialog.getRemoteParty());
//RemoteTag
assertEquals(
"Dialog.getRemoteTag() returned a bad tag",
((ToHeader) ringing.getHeader(ToHeader.NAME)).getTag(),
dialog.getRemoteTag());
//is server
assertFalse(
"Dialog.isServer returned true for a client side dialog",
dialog.isServer());
} catch (Throwable exc) {
exc.printStackTrace();
fail(exc.getClass().getName() + ": " + exc.getMessage());
}
assertTrue(new Exception().getStackTrace()[0].toString(), true);
}
/**
* Create a BYE request and check whether major fields are properly set
*/
public void testCreateRequest() {
try {
Request bye = null;
try {
bye = dialog.createRequest(Request.BYE);
} catch (SipException ex) {
ex.printStackTrace();
fail("A dialog failed to create a BYE request.");
}
//check method
assertEquals(
"Dialog.createRequest() returned a request with a bad method.",
Request.BYE,
bye.getMethod());
//check CSeq number
assertEquals(
"Dialog.createRequest() returned a request with a bad sequence number.",
dialog.getLocalSeqNumber() + 1,
((CSeqHeader) bye.getHeader(CSeqHeader.NAME))
.getSeqNumber());
//Check From
FromHeader byeFrom = (FromHeader) bye.getHeader(FromHeader.NAME);
assertEquals(
"Dialog.createRequest() returned a request with a bad From header.",
dialog.getLocalParty(),
byeFrom.getAddress());
//Check From tags
assertEquals(
"Dialog.createRequest() returned a request with a bad From tag.",
dialog.getLocalTag(),
byeFrom.getTag());
//Check To
ToHeader byeTo = (ToHeader) bye.getHeader(ToHeader.NAME);
assertEquals(
"Dialog.createRequest() returned a request with a bad To header.",
dialog.getRemoteParty(),
byeTo.getAddress());
//Check To tags
assertEquals(
"Dialog.createRequest() returned a request with a bad To tag.",
dialog.getRemoteTag(),
byeTo.getTag());
ClientTransaction ct = super.tiSipProvider.getNewClientTransaction(bye);
dialog.sendRequest(ct);
assertEquals("Dialog mismatch ", ct.getDialog(),dialog );
waitForMessage();
try {
eventCollector.collectDialogTermiatedEvent(tiSipProvider);
} catch( TooManyListenersException ex) {
throw new TckInternalError("failed to regiser a listener iwth the TI", ex);
}
waitForTimeout();
DialogTerminatedEvent dte = eventCollector.extractCollectedDialogTerminatedEvent();
// Should see a DTE here also for early Dialog
assertNotNull("No DTE received for early Dialog terminated via BYE", dte);
} catch (Throwable exc) {
exc.printStackTrace();
fail(exc.getClass().getName() + ": " + exc.getMessage());
}
assertTrue(new Exception().getStackTrace()[0].toString(), true);
}
/**
* Steer the dialog to a CONFIRMED state and try sending an ack
* An invite has been sent by the TI in the setUp method so we take it from
* that point on.
*/
public void testSendAck() {
this.doTestSendAck(false);
}
/**
* Regression test for broken clients that send ACK to 2xx with same branch as INVITE
*/
public void testSendAckWithSameBranch() {
this.doTestSendAck(true);
}
private void doTestSendAck( boolean sameBranch ) {
try {
//We will now send an OK response
//start listening for the response
try {
eventCollector.collectResponseEvent(tiSipProvider);
} catch (TooManyListenersException e) {
throw new TckInternalError(
"Failed to register a SipListener with the RI.",
e);
}
Response ok = null;
try {
ok = riMessageFactory.createResponse(Response.OK, riInvite);
ok.addHeader(
createRiInviteRequest(null, null, null).getHeader(
ContactHeader.NAME));
ToHeader okToHeader = (ToHeader)ok.getHeader(ToHeader.NAME);
okToHeader.setTag( riToTag ); // needs same tag as 180 ringing!
// riSipProvider.sendResponse(ok);
// Need to explicitly create the dialog on RI side
ServerTransaction riST = riSipProvider.getNewServerTransaction( riInvite );
riST.getDialog();
riST.sendResponse( ok );
} catch (Exception e) {
throw new TckInternalError(
"Failed to create and send an OK response",
e);
}
waitForMessage();
ResponseEvent okRespEvt =
eventCollector.extractCollectedResponseEvent();
if (okRespEvt == null || okRespEvt.getResponse() == null)
throw new TiUnexpectedError("The TI did not dispatch an OK response.");
// After 2xx, dialog should be in CONFIRMED state. Needed to send ACK
assertEquals( DialogState.CONFIRMED, dialog.getState() );
//Send the ack
//Setup the ack listener
try {
eventCollector.collectRequestEvent(riSipProvider);
} catch (TooManyListenersException ex) {
throw new TckInternalError(
"Failed to register a SipListener with the RI",
ex);
}
Request ack = null;
try {
CSeqHeader cseq = (CSeqHeader) okRespEvt.getResponse().getHeader(CSeqHeader.NAME);
ack = dialog.createAck(cseq.getSeqNumber());
//System.out.println( "Created ACK:" + ack );
//System.out.println( "original INVITE:" + riInvite );
// This is wrong according to RFC3261, but some clients do this...
if (sameBranch) {
ViaHeader via = (ViaHeader) ack.getHeader("Via");
via.setBranch( ((ViaHeader)riInvite.getHeader("Via")).getBranch() );
}
} catch (SipException ex) {
throw new TiUnexpectedError(
"Failed to create an ACK request.",
ex);
}
try {
dialog.sendAck(ack);
} catch (Throwable ex) {
ex.printStackTrace();
fail("SipException; Failed to send an ACK request using Dialog.sendAck()");
}
waitForMessage();
// Did the RI get the ACK? If the dialog is not found, the ACK is filtered!
RequestEvent ackEvt = eventCollector.extractCollectedRequestEvent();
assertNotNull(
"No requestEvent sent by Dialog.sendAck() was received by the RI",
ackEvt);
assertNotNull(
"The request sent by Dialog.sendAck() was not received by the RI",
ackEvt.getRequest());
} catch (Throwable exc) {
exc.printStackTrace();
fail(exc.getClass().getName() + ": " + exc.getMessage());
}
assertTrue(new Exception().getStackTrace()[0].toString(), true);
}
public void testSendRequest() {
try {
Request reInvite = null;
ClientTransaction reInviteTran = null;
//Create
try {
reInvite = dialog.createRequest(Request.INVITE);
reInviteTran = tiSipProvider.getNewClientTransaction(reInvite);
} catch (Exception ex) {
throw new TiUnexpectedError(
"Failed to create a CANCEL request with Dialog.createRequest()",
ex);
}
//Listen
try {
eventCollector.collectRequestEvent(riSipProvider);
} catch (TooManyListenersException ex) {
throw new TckInternalError(
"Failed to register a SipListener with the RI",
ex);
}
//Send
try {
dialog.sendRequest(reInviteTran);
} catch (SipException ex) {
ex.printStackTrace();
fail("Failed to send a cancel request using Dialog.sendRequest()");
}
waitForMessage();
//Did they get it?
RequestEvent cancelEvt =
eventCollector.extractCollectedRequestEvent();
assertNotNull("The RI did not receive the sent request", cancelEvt);
assertNotNull(
"The RI did not receive the sent request",
cancelEvt.getRequest());
} catch (Throwable exc) {
exc.printStackTrace();
fail(exc.getClass().getName() + ": " + exc.getMessage());
}
assertTrue(new Exception().getStackTrace()[0].toString(), true);
}
//==================== end of tests
//====== STATIC JUNIT ==========
public static Test suite() {
return new TestSuite(DialogTest.class);
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
4e52a9498ea7452448c8becbfd1afa4859e37d20 | a96ef61579916d4b1449b270b5539a421d57a559 | /2.1_CircleAndCylinderClasses/src/circleAndCylinderPackage/Circle.java | 3e4987cf3a4be2a5b1d436533f170b6a586d50b2 | [
"Apache-2.0"
] | permissive | npogulanik/java-bootcamp | c3f5e1ccefaa9ceaad0813167e957862a2899a4d | 91af2e7842cebd22a168d98e010e4b4752f54276 | refs/heads/master | 2021-01-15T08:42:40.088216 | 2015-01-21T17:16:50 | 2015-01-21T17:16:50 | 28,940,087 | 1 | 4 | null | 2015-02-07T02:38:40 | 2015-01-08T00:00:51 | Java | UTF-8 | Java | false | false | 806 | java | package circleAndCylinderPackage;
public class Circle {
private double radius;
private String color;
public Circle() {
radius = 1.0;
color = "red";
}
public Circle(double radius) {
this.radius = radius;
color = "red";
}
public Circle(double radius, String color){
this.radius = radius;
this.color = color;
}
public double getRadius() {
return radius;
}
public double getArea() {
return radius*radius*Math.PI;
}
public String getColor(){
return color;
}
public void setRadius(double radius){
this.radius = radius;
}
public void setColor(String color){
this.color = color;
}
public String toString() {
String sentence;
sentence = "Circle: radius=" + radius + " color=" + color;
return sentence;
}
}
| [
"eliana_474@hotmail.com"
] | eliana_474@hotmail.com |
95a97fd2014e6087e19cce392973c5234899f79e | 233e63710e871ef841ff3bc44d3660a0c8f8564d | /trunk/gameserver/src/gameserver/model/team2/group/events/PlayerGroupInvite.java | b4ae5326d9200a5262bb68d6268cac275f071829 | [] | no_license | Wankers/Project | 733b6a4aa631a18d28a1b5ba914c02eb34a9f4f6 | da6db42f127d5970522038971a8bebb76baa595d | refs/heads/master | 2016-09-06T10:46:13.768097 | 2012-08-01T23:19:49 | 2012-08-01T23:19:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,105 | java | /*
* This file is part of Aion Extreme Emulator <aion-core.net>.
*
* Aion Extreme Emulator is a free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Aion Extreme Emulator is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Aion Extreme Emulator. If not, see <http://www.gnu.org/licenses/>.
*/
package gameserver.model.team2.group.events;
import gameserver.model.gameobjects.Creature;
import gameserver.model.gameobjects.player.Player;
import gameserver.model.gameobjects.player.RequestResponseHandler;
import gameserver.model.team2.group.PlayerGroup;
import gameserver.model.team2.group.PlayerGroupService;
import gameserver.network.aion.serverpackets.SM_SYSTEM_MESSAGE;
import gameserver.utils.PacketSendUtility;
/**
* @author ATracer
*/
public class PlayerGroupInvite extends RequestResponseHandler {
private final Player inviter;
private final Player invited;
public PlayerGroupInvite(Player inviter, Player invited) {
super(inviter);
this.inviter = inviter;
this.invited = invited;
}
@Override
public void acceptRequest(Creature requester, Player responder) {
if (PlayerGroupService.canInvite(inviter, invited)) {
PacketSendUtility.sendPacket(inviter, SM_SYSTEM_MESSAGE.STR_PARTY_INVITED_HIM(invited.getName()));
PlayerGroup group = inviter.getPlayerGroup2();
if (group != null) {
PlayerGroupService.addPlayer(group, invited);
}
else {
PlayerGroupService.createGroup(inviter, invited);
}
}
}
@Override
public void denyRequest(Creature requester, Player responder) {
PacketSendUtility.sendPacket(inviter, SM_SYSTEM_MESSAGE.STR_PARTY_HE_REJECT_INVITATION(responder.getName()));
}
}
| [
"sylvanodu14gmail.com"
] | sylvanodu14gmail.com |
8d71d31f446e14307749a33bbdc0bfd34643cdd3 | 9208fc19e01d95438a6fd146cdfca2cd9ca76caf | /DispatchingEvents/app/src/main/java/com/example/dispatchingevents/MyViewToupch.java | 744e2fba7616d3307648ae6e5b7d2d44cd8935bb | [] | no_license | Fanyajun0312/GitCommit1 | d0d5104e0591d5589aa6bc261ef662c88e1b848a | 2c4e94dc72ea2a272e7266be90e57d39de5b4d2f | refs/heads/master | 2022-12-04T04:07:33.002869 | 2020-08-27T05:17:01 | 2020-08-27T05:17:01 | 278,613,450 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,177 | java | package com.example.dispatchingevents;
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.ScrollView;
/**
* @date:2020/7/14
* @describe:先分发 在截断 最后走到结束 tiuchevent viewgroup有截断方法 上面是老大activity 下面是小弟 view控件
* @author:FanYaJun
*/
public class MyViewToupch extends ScrollView {
public MyViewToupch(Context context, AttributeSet attrs) {
super(context, attrs);
}
/**
*分发
* @param ev
* @return 先分发 在截断 最后走到结束 tiuchevent
*/
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
return super.dispatchTouchEvent(ev);
}
/**
* @param ev
* @return true 表示为截断 flase 表示不截断 截断后子控件没有任何效果
*/
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
return super.onInterceptTouchEvent(ev);
}
/**
*触摸
* @param ev
* @return
*/
@Override
public boolean onTouchEvent(MotionEvent ev) {
return super.onTouchEvent(ev);
}
}
| [
"472741357@qq.com"
] | 472741357@qq.com |
bc16f0ba1d23b69a207d2eabbbfff69f01511e18 | ab419df5232be3650148864cab5b76809b7828e3 | /app/src/main/java/com/veeritsolutions/uhelpme/fragments/FragmentNotificationSetting.java | de5f446f37273a4331c9ef7e2859818f5b8833f0 | [] | no_license | veerkrupahitesh/uHelpMe | f55afd6a7d1ac0c9c26c094e78e2c98e20c014ca | e3e1d0962d57f1246d88788306f68d05e1c2627e | refs/heads/master | 2021-01-16T18:00:13.753590 | 2017-09-07T13:36:51 | 2017-09-07T13:36:51 | 100,034,143 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,413 | java | package com.veeritsolutions.uhelpme.fragments;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.SeekBar;
import android.widget.TextView;
import com.android.volley.Request;
import com.google.android.gms.maps.SupportMapFragment;
import com.veeritsolutions.uhelpme.R;
import com.veeritsolutions.uhelpme.activity.ProfileActivity;
import com.veeritsolutions.uhelpme.adapters.AdpCategory;
import com.veeritsolutions.uhelpme.api.ApiList;
import com.veeritsolutions.uhelpme.api.DataObserver;
import com.veeritsolutions.uhelpme.api.RequestCode;
import com.veeritsolutions.uhelpme.api.RestClient;
import com.veeritsolutions.uhelpme.helper.PrefHelper;
import com.veeritsolutions.uhelpme.helper.ToastHelper;
import com.veeritsolutions.uhelpme.listener.OnBackPressedEvent;
import com.veeritsolutions.uhelpme.listener.OnClickEvent;
import com.veeritsolutions.uhelpme.models.CategoryModel;
import com.veeritsolutions.uhelpme.models.LoginUserModel;
import com.veeritsolutions.uhelpme.utility.Utils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Created by VEER7 on 7/29/2017.
*/
public class FragmentNotificationSetting extends Fragment implements OnClickEvent, OnBackPressedEvent, DataObserver {
private View rootView;
private RecyclerView recyclerViewCategory;
private ProfileActivity homeActivity;
// private Spinner spcategory;
private Map<String, String> params;
// private Bundle bundle;
private CategoryModel categoryModel;
// private List<String> CategoryList;
// private StringBuilder stringBuilder;
// private SpinnerAdapter adpCategory;
private String categoryId = "";
private SupportMapFragment spFragment;
private LoginUserModel loginUserModel;
// private View view;
// private ArrayList<CategoryModel> categoryModelsContent;
private SeekBar seekBar;
private TextView tvDistance;
private AdpCategory adpCategory;
private ArrayList<CategoryModel> categoryModelsList;
private ArrayList<String> category = new ArrayList<>();
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
homeActivity = (ProfileActivity) getActivity();
loginUserModel = LoginUserModel.getLoginUserModel();
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
rootView = inflater.inflate(R.layout.fragment_notification_setting, container, false);
seekBar = (SeekBar) rootView.findViewById(R.id.seekBar);
seekBar.setProgress((int) loginUserModel.getRadious());
// spcategory = (Spinner) rootView.findViewById(R.id.sp_category);
// CategoryList = new ArrayList<>();
tvDistance = (TextView) rootView.findViewById(R.id.tv_distance);
tvDistance.setText(loginUserModel.getRadious() + " km");
recyclerViewCategory = (RecyclerView) rootView.findViewById(R.id.recyclerView_category);
recyclerViewCategory.setLayoutManager(new LinearLayoutManager(getActivity(), LinearLayoutManager.HORIZONTAL, false));
seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
tvDistance.setText("");
tvDistance.setText(tvDistance.getText().toString() + " " + progress + " km");
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
});
// stringBuilder = new StringBuilder();
GetCategory();
return rootView;
}
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
}
@Override
public void onSuccess(RequestCode mRequestCode, Object mObject) {
switch (mRequestCode) {
case GetCategory:
rootView.setVisibility(View.VISIBLE);
categoryModelsList = (ArrayList<CategoryModel>) mObject;
if (categoryModelsList != null && !categoryModelsList.isEmpty()) {
for (int i = 0; i < categoryModelsList.size(); i++) {
CategoryModel categoryModel = categoryModelsList.get(i);
if (PrefHelper.getInstance().containKey(PrefHelper.CATEGORY_ID)) {
String catId = PrefHelper.getInstance().getString(PrefHelper.CATEGORY_ID, "");
if (catId.length() > 0) {
String[] cateId = catId.split(",");
for (String aCateId : cateId) {
if (aCateId.equals(String.valueOf(categoryModel.getCategoryId()))) {
category.add(String.valueOf(categoryModel.getCategoryId()));
categoryModel.setSelected(true);
categoryModelsList.set(i, categoryModel);
}
}
}
}
}
adpCategory = (AdpCategory) recyclerViewCategory.getAdapter();
if (adpCategory != null && adpCategory.getItemCount() > 0) {
adpCategory.notifyDataSetChanged();
} else {
adpCategory = new AdpCategory(homeActivity, categoryModelsList);
recyclerViewCategory.setAdapter(adpCategory);
}
categoryId = Utils.mytoString(category, ",");
}
// setSpinnerData(mObject);
break;
case ClientRadiusUpdate:
insertClientCategory();
break;
case ClientCategoryInsert:
ToastHelper.getInstance().showMessage("Updated");
loginUserModel.setRadious(seekBar.getProgress());
PrefHelper.getInstance().setString(PrefHelper.CATEGORY_ID, categoryId);
LoginUserModel.setLoginCredentials(RestClient.getGsonInstance().toJson(loginUserModel));
homeActivity.popBackFragment();
break;
}
}
@Override
public void onFailure(RequestCode mRequestCode, String mError) {
ToastHelper.getInstance().showMessage(mError);
}
@Override
public void onBackPressed() {
homeActivity.popBackFragment();
}
@Override
public void onClick(View view) {
switch (view.getId()) {
case R.id.img_back_header:
Utils.buttonClickEffect(view);
homeActivity.popBackFragment();
break;
case R.id.btn_update:
Utils.buttonClickEffect(view);
/* if (tvDistance.getText().toString().trim().equals("0")) {
ToastHelper.getInstance().showMessage("Select valid radius distance");
return;
}*/
if (categoryId.length() == 0) {
StringBuilder sb = new StringBuilder();
for (int i = 1; i <= categoryModelsList.size(); i++) {
if (i > 1) {
sb.append(",");
}
String item = String.valueOf(i);
sb.append(item);
}
categoryId = sb.toString();
}
insertClientRadius();
break;
case R.id.lin_categoryList:
Utils.buttonClickEffect(view);
categoryModel = (CategoryModel) view.getTag();
if (!categoryModel.isSelected()) {
categoryModel.setSelected(true);
category.add(String.valueOf(categoryModel.getCategoryId()));
} else {
categoryModel.setSelected(false);
category.remove(String.valueOf(categoryModel.getCategoryId()));
}
categoryModelsList.set(categoryModel.getPosition(), categoryModel);
adpCategory.refreshList(categoryModelsList);
categoryId = Utils.mytoString(category, ",");
break;
}
}
private void insertClientRadius() {
params = new HashMap<>();
params.put("op", ApiList.CLIENT_RADIUS_UPDATE);
params.put("AuthKey", ApiList.AUTH_KEY);
params.put("ClientId", String.valueOf(loginUserModel.getClientId()));
params.put("Radious", String.valueOf(seekBar.getProgress()));
RestClient.getInstance().post(homeActivity, Request.Method.POST, params, ApiList.CLIENT_RADIUS_UPDATE,
true, RequestCode.ClientRadiusUpdate, this);
}
private void insertClientCategory() {
params = new HashMap<>();
params.put("op", ApiList.CLIENT_CATEGORY_INSERT);
params.put("AuthKey", ApiList.AUTH_KEY);
params.put("ClientId", String.valueOf(loginUserModel.getClientId()));
params.put("CategoryId", categoryId);
RestClient.getInstance().post(homeActivity, Request.Method.POST, params, ApiList.CLIENT_CATEGORY_INSERT,
true, RequestCode.ClientCategoryInsert, this);
}
private void GetCategory() {
try {
//params = new JSONObject();
Map<String, String> params = new HashMap<>();
params.put("op", ApiList.GET_CATEGORY);
params.put("AuthKey", ApiList.AUTH_KEY);
RestClient.getInstance().post(homeActivity, Request.Method.POST, params, ApiList.GET_CATEGORY,
true, RequestCode.GetCategory, this);
} catch (Exception e) {
e.printStackTrace();
}
}
}
| [
"veerkrupa.hitesh@gmail.com"
] | veerkrupa.hitesh@gmail.com |
3d453918db395d6f77bf9ed37b919dcee43657fa | eb1a2b1f01a8356db5c43ed4d5931f54fdca4949 | /src/com/europa/eui/activity/CheckActivity.java | 495a699f6dd27dfca5ad2aa2918f7c6d59a15899 | [] | no_license | europa/Eui | 2dcbab773eda6e8f50a033e2ea1bc07ef09e43b1 | 5e35c973cf639c2fe14818c914f76455d63930ea | refs/heads/master | 2021-01-19T03:24:17.478318 | 2015-06-16T08:46:00 | 2015-06-16T08:46:00 | 14,326,836 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,375 | java | package com.europa.eui.activity;
import butterknife.ButterKnife;
import butterknife.InjectView;
import com.europa.eui.R;
import com.europa.eui.R.id;
import com.europa.eui.R.layout;
import com.europa.eui.R.menu;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
/**
* @author europa
*
*/
public class CheckActivity extends Activity {
@InjectView(R.id.demoChk) CheckBox demoChk;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_check);
ButterKnife.inject(this);
demoChk.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if(isChecked){
startActivity(new Intent(CheckActivity.this,ClearEditActivity.class));
startActivity(new Intent(CheckActivity.this,AutoActivity.class));
}
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
return super.onOptionsItemSelected(item);
}
}
| [
"europa2046@gmail.com"
] | europa2046@gmail.com |
cc6c70b4b9bff96c9886f477b2ea9e6b370d09a0 | 7fd131bda6cc8491ef1b64a81e106af49fa2f7d0 | /src/main/java/lv/javaguru/java2ToDoApp/web/controllers/user/HomeController.java | ddbb732b49fb847eaf758efcb63a92c3263b4463 | [] | no_license | emushell/ToDoApp | d347003cf6e0d69fd52cbedad01d1c714d6dd2ba | ffc5b0dfe9315b02bd6d96ddb6766a8b7319533d | refs/heads/master | 2021-07-02T20:48:38.082628 | 2017-09-19T07:55:00 | 2017-09-19T07:55:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,321 | java | package lv.javaguru.java2ToDoApp.web.controllers.user;
import lv.javaguru.java2ToDoApp.core.businesslogic.api.user.UserGetService;
import lv.javaguru.java2ToDoApp.core.businesslogic.api.task.TaskGetService;
import lv.javaguru.java2ToDoApp.common.util.TaskListUtils;
import lv.javaguru.java2ToDoApp.core.domain.Task;
import lv.javaguru.java2ToDoApp.core.domain.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.util.List;
@Controller
public class HomeController {
@Autowired
private UserGetService userGetService;
@Autowired
private TaskGetService taskGetService;
@RequestMapping(value = "/user/tasks", method = {RequestMethod.GET})
public ModelAndView processGetRequest(HttpServletRequest request, HttpServletResponse response) {
Authentication auth = SecurityContextHolder.getContext().getAuthentication();
if (request.getSession().getAttribute("user") == null) {
User user = userGetService.getByLogin(auth.getName()).get();
HttpSession session = request.getSession(true);//create session
session.setAttribute("user", user);
}
HttpSession session = request.getSession();
User user = (User) session.getAttribute("user");
List<Task> taskList = taskGetService.getAllTasksByUser(user);
request.setAttribute("taskList", taskList);
request.setAttribute("homeTabStyle", "active");
int totalCount = taskList.size();
int doneCount = TaskListUtils.countTotalDone(taskList);
int taskCount = totalCount - doneCount;
request.setAttribute("totalCount", totalCount);
request.setAttribute("doneCount", doneCount);
request.setAttribute("taskCount", taskCount);
return new ModelAndView("user/UserHome", "model", null);
}
}
| [
"arturs.strauss@gmail.com"
] | arturs.strauss@gmail.com |
77ad158a500e649345d1b273fba9a98c1a046456 | 58464705b97ed4b52c29e839a49ef2be0e330ac2 | /src/main/java/com/example/prueba/models/pruebaotro.java | a537e16f049c608c76c54b8904480304a3740f1e | [] | no_license | xoxbladexox1/Rest-Java | 366cdd771347762ad3b204d6dfc5f97fca9cf673 | b03e23d6484973709ffece741248bccfdbc83c27 | refs/heads/master | 2020-08-18T19:05:09.342066 | 2019-10-17T15:31:41 | 2019-10-17T15:31:41 | 215,823,865 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 305 | java | package com.example.prueba.models;
public class pruebaotro {
String nombre = "21";
public int probar() {
prueba objprueba = new prueba();
objprueba.devolvercomog();
int numero = Integer.parseInt(nombre);
return 0;
}
public prueba<UserModel> devolver(){
return null;
}
}
| [
"blademoix95@gmail.com"
] | blademoix95@gmail.com |
637011338247bbfe874958c2627757d3115a4201 | aa4acdba351926db6b17ac000a3765ee7534df0c | /pss-simulator/domain-layer/data/report/report-anonymized/src/main/scala/pss/report/anonymized/AnonymizedReportData.java | 7ee80fd983513eea8ed561919a134a39759be94f | [] | no_license | nafeezabrar/pss-without-as | 7579e28de6024e31bf0bd843ccc6fbe12508e01f | 97c821da725ddc6e63612dacb67a7736b2aa4c5c | refs/heads/main | 2023-01-07T09:21:58.157210 | 2020-11-09T14:58:23 | 2020-11-09T14:58:23 | 311,345,524 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,145 | java | package pss.report.anonymized;
import pss.data.ooi.local.collection.LocalOoiCollection;
import pss.report.common.ReportData;
public abstract class AnonymizedReportData<TLocalOoiCollection extends LocalOoiCollection> extends ReportData {
protected final TLocalOoiCollection ooiIdCollection;
protected AnonymizedReportData(TLocalOoiCollection localOoiCollection) {
this.ooiIdCollection = localOoiCollection;
}
public TLocalOoiCollection getLocalOoiCollection() {
return ooiIdCollection;
}
@Override
public String toString() {
return String.format("AnonymizedReportData{ooiIdCollection=%s}", ooiIdCollection);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
AnonymizedReportData<?> that = (AnonymizedReportData<?>) o;
return ooiIdCollection != null ? ooiIdCollection.equals(that.ooiIdCollection) : that.ooiIdCollection == null;
}
@Override
public int hashCode() {
return ooiIdCollection != null ? ooiIdCollection.hashCode() : 0;
}
}
| [
"ishmumkhan@gmail.com"
] | ishmumkhan@gmail.com |
cbd52655ed20231bd486cbffbbb80846a45be1ce | 424e25097ec7b5122a971d430401250b70cb9713 | /api/src/test/java/com/urlshortener/api/service/KeyServiceTest.java | 13ec2e22975658c433928449b0f02f191635b5d4 | [] | no_license | danieltnaves/url-shortener | ad734500af54befa08e5452588511c93da307175 | 880f9092e5819e133228b18818e60d3509c93eae | refs/heads/master | 2020-04-17T11:06:30.745479 | 2019-01-20T18:46:27 | 2019-01-20T18:46:27 | 166,527,611 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,417 | java | package com.urlshortener.api.service;
import com.urlshortener.api.model.KeyStatus;
import com.urlshortener.api.model.KeyStorage;
import com.urlshortener.api.repository.KeyRepository;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
import org.springframework.data.domain.PageImpl;
import java.time.Instant;
import java.util.Arrays;
import java.util.List;
import static org.junit.Assert.assertEquals;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.when;
@RunWith(MockitoJUnitRunner.class)
public class KeyServiceTest {
private KeyService keyService;
@Mock
private KeyRepository keyRepository;
@Before
public void beforeMethodCallInit() {
this.keyService = new KeyService(keyRepository);
}
@Test
public void testGetOneActiveKey() {
KeyStorage keyStorage = new KeyStorage("abc", Instant.now(), KeyStatus.ACTIVE);
List<KeyStorage> keyStorageList = Arrays.asList(keyStorage);
when(keyRepository.getActiveKeys(any())).thenReturn(new PageImpl<>(keyStorageList));
keyStorage.setStatus(KeyStatus.INACTIVE);
when(keyRepository.save(any())).thenReturn(keyStorage);
KeyStorage oneActiveKey = keyService.getOneActiveKey();
assertEquals("abc", oneActiveKey.getId());
assertEquals(KeyStatus.INACTIVE, oneActiveKey.getStatus());
}
}
| [
"daniel.naves@outlook.com"
] | daniel.naves@outlook.com |
9dbc5dfbd384a45599f15345c9113124c093cca9 | 7d27c167bdd8aab1d7d81b6810df1afd39f1e75a | /src/day30_CustomMethods/Recap.java | ae83d8f3fb53938bd85b9081ded442988324fb71 | [] | no_license | sevdaTan/Summer2020 | 65991320bd365391af1351bb9d42d4ba0e616506 | b219916ab1bd024b71367103e0af9c7d4c60a154 | refs/heads/master | 2022-12-12T16:20:15.577232 | 2020-09-05T14:45:53 | 2020-09-05T14:45:53 | 292,096,758 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 90 | java | package day30_CustomMethods;
public class Recap {
void method1(int a){
}
}
| [
"sevdatanyildizi@gmail.com"
] | sevdatanyildizi@gmail.com |
07dbd4504ea9b19397f23e55fd1f29170010f035 | a59ae93dc58a5520e0a006aa17e9e189cb2de7fe | /Mobile/app/src/main/java/pl/polsl/lab/caesarcipher/main/ResultsActivity.java | 5b1fbb0821a11e930e2755d0b774b8c0ae4d8350 | [] | no_license | PKapski/CaesarCipher | 61cd96dedc3c3bc4ea8cb5ffbccc73b903040328 | 971730211f41967ddf0b6f30bb1be681973655ff | refs/heads/master | 2020-05-20T13:40:00.594166 | 2019-05-08T12:53:52 | 2019-05-08T12:53:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,144 | java | package pl.polsl.lab.caesarcipher.main;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.TextView;
import pl.polsl.lab.caesarcipher.R;
import pl.polsl.lab.caesarcipher.model.*;
public class ResultsActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_results);
String message = getIntent().getStringExtra("message");
int key = Integer.parseInt(getIntent().getStringExtra("key"));
String mode = getIntent().getStringExtra("mode");
TextView introText = (TextView)findViewById(R.id.textViewIntro);
TextView messageText = (TextView)findViewById(R.id.textViewMessage);
TextView keyText = (TextView)findViewById(R.id.textViewKey);
TextView resultText = (TextView)findViewById(R.id.textViewResult);
CaesarModel model = new CaesarModel();
if (mode.equals("Encode")){
try{
String result = model.encode(message,key);
introText.setText("Encoding successful");
messageText.setText("Message: "+message);
keyText.setText("Key: "+key);
resultText.setText("Encoded message: "+result);
}catch(InvalidInputException e){
introText.setText("Input error!");
messageText.setText("");
keyText.setText("");
resultText.setText("");
}
}else if (mode.equals("Decode")){
try{
String result = model.decode(message,key);
introText.setText("Decoding successful");
messageText.setText("Message: "+message);
keyText.setText("Key: "+key);
resultText.setText("Decoded message: "+result);
}catch(InvalidInputException e){
introText.setText("Input error!");
messageText.setText("");
keyText.setText("");
resultText.setText("");
}
}
}
}
| [
"kapski.p@gmail.com"
] | kapski.p@gmail.com |
0ecde6bd02008c2dae1ced46d36c94db34c13314 | ae5eb1a38b4d22c82dfd67c86db73592094edc4b | /project195/src/main/java/org/gradle/test/performance/largejavamultiproject/project195/p978/Production19564.java | 63837f8e45fc4fcb53cad1e0ee07292ca067948e | [] | no_license | big-guy/largeJavaMultiProject | 405cc7f55301e1fd87cee5878a165ec5d4a071aa | 1cd6a3f9c59e9b13dffa35ad27d911114f253c33 | refs/heads/main | 2023-03-17T10:59:53.226128 | 2021-03-04T01:01:39 | 2021-03-04T01:01:39 | 344,307,977 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,970 | java | package org.gradle.test.performance.largejavamultiproject.project195.p978;
public class Production19564 {
private Production19561 property0;
public Production19561 getProperty0() {
return property0;
}
public void setProperty0(Production19561 value) {
property0 = value;
}
private Production19562 property1;
public Production19562 getProperty1() {
return property1;
}
public void setProperty1(Production19562 value) {
property1 = value;
}
private Production19563 property2;
public Production19563 getProperty2() {
return property2;
}
public void setProperty2(Production19563 value) {
property2 = value;
}
private String property3;
public String getProperty3() {
return property3;
}
public void setProperty3(String value) {
property3 = value;
}
private String property4;
public String getProperty4() {
return property4;
}
public void setProperty4(String value) {
property4 = value;
}
private String property5;
public String getProperty5() {
return property5;
}
public void setProperty5(String value) {
property5 = value;
}
private String property6;
public String getProperty6() {
return property6;
}
public void setProperty6(String value) {
property6 = value;
}
private String property7;
public String getProperty7() {
return property7;
}
public void setProperty7(String value) {
property7 = value;
}
private String property8;
public String getProperty8() {
return property8;
}
public void setProperty8(String value) {
property8 = value;
}
private String property9;
public String getProperty9() {
return property9;
}
public void setProperty9(String value) {
property9 = value;
}
} | [
"sterling.greene@gmail.com"
] | sterling.greene@gmail.com |
65aaea3084d281be876a5fa58e79eced79ff81aa | 7a77e6fe1c4327188d239dc0d7e0d3f20690e2fa | /src/main/java/br/com/caelum/ingresso/model/Ingresso.java | 7155d0d04676973aa560a3e80a09b4d4660e8208 | [] | no_license | netoandrade1987/fj22-ingressos | 7047c427a96d7d3a7f57679d69b3d9edfe945d71 | f8523cb6bb02b963a18f03149f3b139d5348abb6 | refs/heads/master | 2022-08-17T05:11:57.149599 | 2020-05-30T17:04:16 | 2020-05-30T17:04:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,575 | java | package br.com.caelum.ingresso.model;
import java.math.BigDecimal;
import java.math.RoundingMode;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Entity;
import br.com.caelum.ingresso.model.descontos.Desconto;
@Entity
public class Ingresso {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
@ManyToOne
private Sessao sessao;
private BigDecimal preco;
@ManyToOne
private Lugar lugar;
@Enumerated(EnumType.STRING)
private TipoDeIngresso tipoDeIngresso;
/*
* @Deprecated hibernate only
*/
public Ingresso() {
}
public Ingresso(Sessao sessao, TipoDeIngresso tipoDeIngresso, Lugar lugar) {
this.sessao = sessao;
this.setTipoDeIngresso(tipoDeIngresso);
this.preco = tipoDeIngresso.aplicaDesconto(sessao.getPreco());
this.setLugar(lugar);
}
public Sessao getSessao() {
return sessao;
}
public void setSessao(Sessao sessao) {
this.sessao = sessao;
}
public BigDecimal getPreco() {
return preco.setScale(1, RoundingMode.HALF_UP);
}
public void setPreco(BigDecimal preco) {
this.preco = preco;
}
public Lugar getLugar() {
return lugar;
}
public void setLugar(Lugar lugar) {
this.lugar = lugar;
}
public TipoDeIngresso getTipoDeIngresso() {
return tipoDeIngresso;
}
public void setTipoDeIngresso(TipoDeIngresso tipoDeIngresso) {
this.tipoDeIngresso = tipoDeIngresso;
}
}
| [
"anadeso90@gmail.com"
] | anadeso90@gmail.com |
61d791b59863458938e9a374d542bccb339519b3 | 4f298a64659bf031e322a5f41a88576cef644a6c | /src/ex01main/MainController.java | 361aa0464906b5fe2d9bbb0716f83988e84c669f | [] | no_license | seoljihee/scene05_DB | 2659bd55a84d1e6377d07ef301dcd11c74724255 | 8916420a93728d03ede843bd22ae8122213a3798 | refs/heads/master | 2023-07-29T12:57:40.924974 | 2021-09-10T11:20:20 | 2021-09-10T11:20:20 | 405,054,798 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 619 | java | package ex01main;
import java.net.URL;
import java.util.ResourceBundle;
import ex01.dbcommon.DBCommon;
import ex01.service.MyService;
import ex01.service.MyServiceImpl;
import javafx.fxml.Initializable;
import javafx.scene.Parent;
public class MainController implements Initializable{
Parent root;
MyService ms;
public void setRoot(Parent root) {
this.root = root;
ms.setRoot(root);
}
@Override
public void initialize(URL arg0, ResourceBundle arg1) {
ms = new MyServiceImpl();
DBCommon.setDBConnection();
}
public void memberShip() {
ms.memberShip();
}
public void login() {
ms.login();
}
}
| [
"wlgml7997@naver.com"
] | wlgml7997@naver.com |
b7865bd1c6202c30da15f84603ea36af938fc420 | 599d0f90eb1e6a1920daa7d83479b76b04e1a04e | /src/main/java/com/iktpreobuka/elektronskidnevnik/entities/ClassEntity.java | 246fb501cd1515fe574889b4f6e67b130e0b3010 | [] | no_license | MIMI303/BackEnd-final-project | 64bb5492c325a40454f2906958044be6c36b11b8 | 9d230dd7f7c243fd5badec310be58ee5187642cb | refs/heads/master | 2023-06-25T11:17:50.689183 | 2021-07-31T11:50:01 | 2021-07-31T11:50:01 | 391,337,903 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,808 | java | package com.iktpreobuka.elektronskidnevnik.entities;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Version;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import com.fasterxml.jackson.annotation.JsonBackReference;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.iktpreobuka.elektronskidnevnik.entities.enums.EnumSchoolYear;
@Entity
@Table(name = "class")
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler" })
public class ClassEntity {
@Id
@GeneratedValue
private Integer id;
@Column
@NotNull(message = "Class number must not be null.")
@Pattern(regexp = "^[1-3{n}]$", message = "Class number must be integer in range of [1-3].")
private String classNumber;
@Enumerated(EnumType.STRING)
@NotNull(message = "Year is null or invalid. Accepted values: [FIRST, SECOND, THIRD, FOURTH, FIFTH, SIXTH, SEVENTH, EIGHTH].")
private EnumSchoolYear year;
@OneToOne(cascade = CascadeType.REFRESH, fetch = FetchType.LAZY)
@JoinColumn(name = "supervisorTeacher")
private TeacherEntity supervisorTeacher;
@OneToMany(mappedBy = "attendingClass", cascade = CascadeType.REFRESH, fetch = FetchType.LAZY)
@JsonBackReference
private List<StudentEntity> students;
@Column
private Boolean deleted;
@Version
private Integer version;
public ClassEntity() {
super();
// TODO Auto-generated constructor stub
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getClassNumber() {
return classNumber;
}
public void setClassNumber(String classNumber) {
this.classNumber = classNumber;
}
public EnumSchoolYear getYear() {
return year;
}
public void setYear(EnumSchoolYear year) {
this.year = year;
}
public TeacherEntity getSupervisorTeacher() {
return supervisorTeacher;
}
public void setSupervisorTeacher(TeacherEntity supervisorTeacher) {
this.supervisorTeacher = supervisorTeacher;
}
public List<StudentEntity> getStudents() {
return students;
}
public void setStudents(List<StudentEntity> students) {
this.students = students;
}
public Boolean getDeleted() {
return deleted;
}
public void setDeleted(Boolean deleted) {
this.deleted = deleted;
}
public Integer getVersion() {
return version;
}
public void setVersion(Integer version) {
this.version = version;
}
}
| [
"mimsu.sm@gmail.com"
] | mimsu.sm@gmail.com |
c0b79daf7867c16f6ccffe4872d8d829d920ff68 | 44bf36d73a20920b85ef59c24251fcbc2624e8af | /LeetCode/2021/BinraySearch/162_Find-Peak-Element.java | 4df9bacb6045c966640b83a7365a13e368d9dc41 | [] | no_license | Henry-Cheng/CodingPractice | ecbc016d89dbd272c2591c2944939f7da6f2b5ae | bf4265e4db3e03e8db5f634d64deba587f246298 | refs/heads/master | 2021-08-17T16:58:44.166352 | 2021-07-09T00:53:15 | 2021-07-09T00:53:15 | 71,843,507 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 646 | java | // https://leetcode.com/problems/find-peak-element/
class Solution {
public int findPeakElement(int[] nums) {
if (nums.length == 1) {
return 0;
}
int l = 0;
int r = nums.length-1;
while(l <= r) {
int mid = l + (r - l)/2;
if (mid + 1 >= nums.length) {
return l;
}
if (nums[mid] > nums[mid+1]) {
r = mid-1;
} else if (nums[mid] < nums[mid+1]) {
l = mid+1;
} else if (nums[mid] == nums[mid+1]) {
l = mid+1;
}
}
return l;
}
} | [
"fixthebug@github.com"
] | fixthebug@github.com |
f8220b7e3d0b2f2e4dd6798656e7b2d2e937d64a | bf02ff2f5ec4dde5a50086abd06e04d67d8ee08b | /WebServiceCitiesClient/src/mypackage/GetCapitalByISOCodeResponse.java | 8ea058b06632643096398917f10b104b94987a80 | [] | no_license | macro39/spodBEH_server | 51edd7d65f4e0d446168a8cf2304ffc4647bea30 | acbf8d305736b07ba16f2a0392c59c550668b802 | refs/heads/master | 2022-07-08T13:44:55.818778 | 2020-05-16T20:07:29 | 2020-05-16T20:07:29 | 258,841,811 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,445 | java |
package mypackage;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for getCapitalByISOCodeResponse complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="getCapitalByISOCodeResponse">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="city" type="{http://pis.predmety.fiit.stuba.sk/pis/geoservices/cities/types}City"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "getCapitalByISOCodeResponse", propOrder = {
"city"
})
public class GetCapitalByISOCodeResponse {
@XmlElement(required = true)
protected City city;
/**
* Gets the value of the city property.
*
* @return
* possible object is
* {@link City }
*
*/
public City getCity() {
return city;
}
/**
* Sets the value of the city property.
*
* @param value
* allowed object is
* {@link City }
*
*/
public void setCity(City value) {
this.city = value;
}
}
| [
"milo.macek@gmail.com"
] | milo.macek@gmail.com |
785108fbe5be8221b3449988304c13db5298f4aa | 48341469b16a73509cdc7a39f2ca51f7437e5bad | /src/com/vy/leecode/sort/easy/Question10.java | 307a649abee6e933fcd10db6b6a973bf7eea9273 | [] | no_license | Liming158/Limeow | fda1ea7a34a5a34396389e7adfdd7bc10f247570 | f73fc710470925d6ad539574edd0ecb193c41650 | refs/heads/main | 2023-07-12T16:36:40.481891 | 2021-08-25T02:12:31 | 2021-08-25T02:12:31 | 301,387,109 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 571 | java | package com.vy.leecode.sort.easy;
/**
* @author: Ellen
* @Date: 2021/7/22 14:52
* @Description: 剑指 Offer 39. 数组中出现次数超过一半的数字
*
* 摩尔投票法
*/
public class Question10 {
public int majorityElement(int[] nums) {
int res = 0;
int count = 0;
for (int j = 0; j < nums.length; j++) {
//当一个值"死"光了,换个值
if (count == 0) {
res = nums[j];
}
//如果相等 "队伍人数"+1 否则1换1 人数-1
if (res == nums[j]) {
count++;
} else {
count--;
}
}
return res;
}
}
| [
"710394505@qq.com"
] | 710394505@qq.com |
0fe0b7e5db7e7969a2ba00b9dfdf2e9123257032 | 1385cc60c565aec57293bbbe5086aa837aa33618 | /uebungsfolien/felder-matrix/FelderMatrixB.java | efa8f4d4d6250797141f00fdb6d85c3202b1077d | [] | no_license | albertmink/am_nw | 0b2229443fc9b39b5b6fc218fa041d2d90e920f1 | 6ace1a8a3eaa2a432127fbd2307d2dbc9b9c5ca6 | refs/heads/master | 2021-06-08T08:15:59.741191 | 2020-01-07T15:03:08 | 2020-01-07T15:03:08 | 153,626,861 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 324 | java | // Author: A. Mink, Nov.2017, multidimensional arrays
...
public static double getMaxValue(double[][] A) {
double max = 0;
for ( int m = 0; m < A.length; m++ ) {
for ( int n = 0; n < A[m].length; n++ ) {
if ( A[m][n] > max ) {
max = A[m][n];
}
}
}
return max;
}
...
| [
"38354196+albertmink@users.noreply.github.com"
] | 38354196+albertmink@users.noreply.github.com |
1c440fa6a8305d3805b61db02cff25c81abea764 | 34c04f3810df484512ebd24cb7ba8bf496161d52 | /src/structure/proxy/virtual/Client.java | fd9677a8cc5ae77b2eef4d8724377e21d6545824 | [] | no_license | chenYG-GitHub/javaSJMS | 53619d7ceadad7e3bd0ff1ce53413925b83a41db | cca079e28e2c516b9edb064e704bfd8391c10f75 | refs/heads/master | 2020-09-15T02:11:30.358264 | 2019-11-22T04:39:11 | 2019-11-22T04:39:11 | 223,323,606 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,003 | java | package structure.proxy.virtual;
/**
* @author : chenyg
* @version : 1.0.0$
* @date : Created in 2019/11/17 21:35
* @description : 虚拟代理测试客户端
* @modified By :
*/
public class Client {
public static void main(String[] args) {
// 有很多人来找老板, 老板在忙, 助手先把所有事情安置好
Assistant assistant = new Assistant();
assistant.addOrder("我找Boss面试");
assistant.addOrder("我找Boss借钱");
assistant.addOrder("我找Boss聊天");
// 收集好了, 助手的职责就完成了, 把Boss叫出来, 让Boss处理. 或者说approve这件事,助手是做不了的, 只能叫出Boss来做.
assistant.approve();
// Boss刚才就被邀请过来, 现在就在现场. 所以就不需要助手转告给Boss了. 大家告诉助手的事情, Boss也会听到
assistant.addOrder("我找Boss吃饭");
assistant.addOrder("我找Boss喝酒");
assistant.approve();
}
}
| [
"416195227@qq.com"
] | 416195227@qq.com |
1cd763a97188b91f5cbcd19f21e2f9e7790353a5 | aa68cb45ba0c416a95539a5bda257468afee3138 | /src/main/java/web/tech/blog/dao/TokenDao.java | cd233ea8db140d7dbdc5838490bf3d0566ffd031 | [] | no_license | aysonsteven/SpringbootPackage | 36ef3532411cd297c936e96c5889a3ec0529bc5b | 90a6a4ae51b8abca07db2bd3157f57744223e303 | refs/heads/master | 2020-07-02T04:57:52.639832 | 2019-08-09T08:09:49 | 2019-08-09T08:09:49 | 201,422,201 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 309 | java | package web.tech.blog.dao;
import org.springframework.data.repository.CrudRepository;
import web.tech.blog.model.TblTokens;
public interface TokenDao extends CrudRepository<TblTokens, Integer>{
// TokenDto findByTokenName(@Param("tokenName") String tokenName);
TblTokens findByToken(String tokenName);
}
| [
"aysonsteven@gmail.com"
] | aysonsteven@gmail.com |
841fd06ff9d89f9f607abe01e02e4a4026f0f6d5 | e8c7a25e31cd75e93351f6ca6aeb0cc2853ae14d | /src/com/lenovots/crm/project/entity/VarLabel.java | f66572fce14574a070f852c0cac5a6e20db14206 | [] | no_license | at0x7c00/codemaker | 753884722c454a752eccc733868ca209a084dd3b | 63ffae826d8d4e402114692dc7fc8ba01aa74fe9 | refs/heads/master | 2021-06-14T09:22:30.725155 | 2017-01-05T03:09:29 | 2017-01-05T03:09:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,135 | java | package com.lenovots.crm.project.entity;
/**
* 标签
* @author 胡桥
* 2013-05-10 18:37:50
**/
public class VarLabel{
public static final Integer CATEGORY_INNER = 0;//内置
public static final Integer CATEGORY_CUSTOM = 1;//自定义
private Integer id;
private String name;//标签名称
private String remark;//说明
private Integer category;//类型
private String value;//常量值
private Project project;//所属项目
public void setId(Integer id){
this.id=id;
}
public Integer getId(){
return this.id;
}
public void setName(String name){
this.name=name;
}
public String getName(){
return this.name;
}
public void setRemark(String remark){
this.remark=remark;
}
public String getRemark(){
return this.remark;
}
public void setCategory(Integer category){
this.category=category;
}
public Integer getCategory(){
return this.category;
}
public void setValue(String value){
this.value=value;
}
public String getValue(){
return this.value;
}
public void setProject(Project project){
this.project=project;
}
public Project getProject(){
return this.project;
}
}
| [
"zoozle@qq.com"
] | zoozle@qq.com |
b0e0b459e56f73bdb8ea8a196c60959578128db6 | 60eab9b092bb9d5a50b807f45cbe310774d0e456 | /dataset/cm5/src/test/org/apache/commons/math/ode/nonstiff/MidpointIntegratorTest.java | 0ecdabb73361bbf492b750c3502b9572b330e0a7 | [
"Apache-2.0",
"BSD-3-Clause",
"Minpack"
] | permissive | SpoonLabs/nopol-experiments | 7b691c39b09e68c3c310bffee713aae608db61bc | 2cf383cb84a00df568a6e41fc1ab01680a4a9cc6 | refs/heads/master | 2022-02-13T19:44:43.869060 | 2022-01-22T22:06:28 | 2022-01-22T22:14:45 | 56,683,489 | 6 | 1 | null | 2019-03-05T11:02:20 | 2016-04-20T12:05:51 | Java | UTF-8 | Java | false | false | 6,875 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.commons.math.ode.nonstiff;
import junit.framework.*;
import org.apache.commons.math.ode.DerivativeException;
import org.apache.commons.math.ode.FirstOrderDifferentialEquations;
import org.apache.commons.math.ode.FirstOrderIntegrator;
import org.apache.commons.math.ode.IntegratorException;
import org.apache.commons.math.ode.events.EventHandler;
import org.apache.commons.math.ode.nonstiff.MidpointIntegrator;
import org.apache.commons.math.ode.sampling.StepHandler;
import org.apache.commons.math.ode.sampling.StepInterpolator;
public class MidpointIntegratorTest
extends TestCase {
public MidpointIntegratorTest(String name) {
super(name);
}
public void testDimensionCheck() {
try {
TestProblem1 pb = new TestProblem1();
new MidpointIntegrator(0.01).integrate(pb,
0.0, new double[pb.getDimension()+10],
1.0, new double[pb.getDimension()+10]);
fail("an exception should have been thrown");
} catch(DerivativeException de) {
fail("wrong exception caught");
} catch(IntegratorException ie) {
}
}
public void testDecreasingSteps()
throws DerivativeException, IntegratorException {
TestProblemAbstract[] problems = TestProblemFactory.getProblems();
for (int k = 0; k < problems.length; ++k) {
double previousError = Double.NaN;
for (int i = 4; i < 10; ++i) {
TestProblemAbstract pb = (TestProblemAbstract) problems[k].clone();
double step = (pb.getFinalTime() - pb.getInitialTime())
* Math.pow(2.0, -i);
FirstOrderIntegrator integ = new MidpointIntegrator(step);
TestProblemHandler handler = new TestProblemHandler(pb, integ);
integ.addStepHandler(handler);
EventHandler[] functions = pb.getEventsHandlers();
for (int l = 0; l < functions.length; ++l) {
integ.addEventHandler(functions[l],
Double.POSITIVE_INFINITY, 1.0e-6 * step, 1000);
}
double stopTime = integ.integrate(pb,
pb.getInitialTime(), pb.getInitialState(),
pb.getFinalTime(), new double[pb.getDimension()]);
if (functions.length == 0) {
assertEquals(pb.getFinalTime(), stopTime, 1.0e-10);
}
double error = handler.getMaximalValueError();
if (i > 4) {
assertTrue(error < Math.abs(previousError));
}
previousError = error;
assertEquals(0, handler.getMaximalTimeError(), 1.0e-12);
}
}
}
public void testSmallStep()
throws DerivativeException, IntegratorException {
TestProblem1 pb = new TestProblem1();
double step = (pb.getFinalTime() - pb.getInitialTime()) * 0.001;
FirstOrderIntegrator integ = new MidpointIntegrator(step);
TestProblemHandler handler = new TestProblemHandler(pb, integ);
integ.addStepHandler(handler);
integ.integrate(pb,
pb.getInitialTime(), pb.getInitialState(),
pb.getFinalTime(), new double[pb.getDimension()]);
assertTrue(handler.getLastError() < 2.0e-7);
assertTrue(handler.getMaximalValueError() < 1.0e-6);
assertEquals(0, handler.getMaximalTimeError(), 1.0e-12);
assertEquals("midpoint", integ.getName());
}
public void testBigStep()
throws DerivativeException, IntegratorException {
TestProblem1 pb = new TestProblem1();
double step = (pb.getFinalTime() - pb.getInitialTime()) * 0.2;
FirstOrderIntegrator integ = new MidpointIntegrator(step);
TestProblemHandler handler = new TestProblemHandler(pb, integ);
integ.addStepHandler(handler);
integ.integrate(pb,
pb.getInitialTime(), pb.getInitialState(),
pb.getFinalTime(), new double[pb.getDimension()]);
assertTrue(handler.getLastError() > 0.01);
assertTrue(handler.getMaximalValueError() > 0.05);
assertEquals(0, handler.getMaximalTimeError(), 1.0e-12);
}
public void testBackward()
throws DerivativeException, IntegratorException {
TestProblem5 pb = new TestProblem5();
double step = Math.abs(pb.getFinalTime() - pb.getInitialTime()) * 0.001;
FirstOrderIntegrator integ = new MidpointIntegrator(step);
TestProblemHandler handler = new TestProblemHandler(pb, integ);
integ.addStepHandler(handler);
integ.integrate(pb, pb.getInitialTime(), pb.getInitialState(),
pb.getFinalTime(), new double[pb.getDimension()]);
assertTrue(handler.getLastError() < 6.0e-4);
assertTrue(handler.getMaximalValueError() < 6.0e-4);
assertEquals(0, handler.getMaximalTimeError(), 1.0e-12);
assertEquals("midpoint", integ.getName());
}
public void testStepSize()
throws DerivativeException, IntegratorException {
final double step = 1.23456;
FirstOrderIntegrator integ = new MidpointIntegrator(step);
integ.addStepHandler(new StepHandler() {
private static final long serialVersionUID = 0L;
public void handleStep(StepInterpolator interpolator, boolean isLast) {
if (! isLast) {
assertEquals(step,
interpolator.getCurrentTime() - interpolator.getPreviousTime(),
1.0e-12);
}
}
public boolean requiresDenseOutput() {
return false;
}
public void reset() {
}
});
integ.integrate(new FirstOrderDifferentialEquations() {
private static final long serialVersionUID = 0L;
public void computeDerivatives(double t, double[] y, double[] dot) {
dot[0] = 1.0;
}
public int getDimension() {
return 1;
}
}, 0.0, new double[] { 0.0 }, 5.0, new double[1]);
}
public static Test suite() {
return new TestSuite(MidpointIntegratorTest.class);
}
}
| [
"durieuxthomas@hotmail.com"
] | durieuxthomas@hotmail.com |
6117dd8acc59917da9847930f35aad77ec6c2553 | 483b77d5cb2afef7e47503d41b17ad45b855b3a4 | /patched/src/main/java/com/edotasx/amazfit/notification/filter/UniqueKeyNotificationFilter.java | 169f98d387861806298d790150469d677163717d | [] | no_license | dessty45/AmazMod | a47ce0e014cada026cf341d7af4d5839669c55ef | 9aaf17021bce2e47165520bc2bec6d6bf5c312e3 | refs/heads/master | 2020-03-11T21:02:05.128521 | 2018-04-13T18:21:49 | 2018-04-13T18:21:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,422 | java | package com.edotasx.amazfit.notification.filter;
import android.content.Context;
import android.os.Build;
import android.service.notification.StatusBarNotification;
import android.support.annotation.RequiresApi;
import android.util.Log;
import com.edotasx.amazfit.Constants;
import com.huami.watch.notification.data.StatusBarNotificationData;
import java.util.HashMap;
import java.util.Map;
/**
* Created by edoardotassinari on 21/02/18.
*/
public class UniqueKeyNotificationFilter {
private Map<String, Long> notificationsLetGo;
private Context context;
public UniqueKeyNotificationFilter(Context context) {
notificationsLetGo = new HashMap<>();
this.context = context;
}
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR2)
public boolean filter(StatusBarNotification statusBarNotification) {
String completeKey = StatusBarNotificationData.getUniqueKey(statusBarNotification);
if (notificationsLetGo.containsKey(completeKey)) {
Log.d(Constants.TAG_NOTIFICATION, "rejected by pre-filter: " + statusBarNotification.getPackageName() + " - key: " + completeKey);
return true;
} else {
Log.d(Constants.TAG_NOTIFICATION, "accepted by pre-filter: " + statusBarNotification.getPackageName());
notificationsLetGo.put(completeKey, System.currentTimeMillis());
return false;
}
}
}
| [
"edo.tassinari@gmail.com"
] | edo.tassinari@gmail.com |
235b19faf6bec9a8b76ff4e2021a1980f2421169 | 6a8481539a68d3cb1b67b62791500daa50449f3a | /renren-security/renren-modules/renren-modules-request/renren-modules-request-cu/src/main/java/io/renren/modules/cu/request/CuCountUpdateRequest.java | 74fcaeb71dadadf869306d3aa0390044110650cb | [
"Apache-2.0"
] | permissive | whmine/renren-security | 59fc048d9e947da141fd0ebe1f53d258e65d424e | dbfee0341741eb135cb8bb207017e294abe11953 | refs/heads/master | 2022-07-01T03:47:22.867186 | 2019-10-16T02:31:03 | 2019-10-16T02:31:03 | 214,927,833 | 2 | 1 | null | 2022-06-21T02:02:22 | 2019-10-14T02:10:17 | Vue | UTF-8 | Java | false | false | 1,017 | java | package io.renren.modules.cu.request;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import io.renren.common.base.IDRequest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
/**
* 客户统计信息
*
* @author Shark
* @email shark@126.com
* @date 2019-08-02 10:49:16
*/
@Data
@Api("客户统计信息-修改")
public class CuCountUpdateRequest extends IDRequest {
private static final long serialVersionUID = 1L;
/**
* 星级
*/
@ApiModelProperty(value = "星级")
private String customerLevel;
}
| [
"whmine@126.com"
] | whmine@126.com |
48b2124cc64552cfdb40171f5ebe8241d4149704 | 36dcc8cc3b4fdf2a29d55171282629663824f6be | /src/main/java/featureSelection/repository/support/calculation/inConsistency/xieDynamicIncompleteDSReduction/InConsistencyCalculation4DIDSROriginal.java | 57173bfd901c093aaeef92b47346f8a1f318a1e9 | [] | no_license | wuzhixiang123/featureSelectionRepository | 27862b75b7bbca892902e3406193590b73ad7a53 | 0b74ac3ce836e647dd41b163c4c2510b1d840151 | refs/heads/main | 2023-08-09T10:45:28.774558 | 2021-09-14T16:24:24 | 2021-09-14T16:24:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 819 | java | package featureSelection.repository.support.calculation.inConsistency.xieDynamicIncompleteDSReduction;
import featureSelection.repository.support.calculation.alg.xieDynamicIncrementalDSReduction.FeatureImportance4XieDynamicIncompleteDSReductionOriginal;
/**
* An implementation for Inconsistency Degree calculation for Xie's Dynamic Incomplete Decision System
* Reduction(DIDSR) bases on the paper
* <a href="https://linkinghub.elsevier.com/retrieve/pii/S0888613X17302918">"A novel incremental
* attribute reduction approach for dynamic incomplete decision systems"</a> by Xiaojun Xie, Xiaolin Qin.
*
* @author Benjamin_L
*/
public class InConsistencyCalculation4DIDSROriginal
extends InConsistencyCalculation4DIDSRDefault
implements FeatureImportance4XieDynamicIncompleteDSReductionOriginal<Integer>
{
} | [
"jm001996@163.com"
] | jm001996@163.com |
084c69995b253990d88933ca59c8f3d6e7bb79f6 | cb41b76416acd9f5c7b5d0c3f1da4b8b67dd9aea | /app/src/main/java/com/example/android/higherlowerapp/MainActivity.java | 79296dca449b8415250e520ebc651dc94cf92d65 | [] | no_license | omolenaar/HigherLowerApp | 5748421143f3d2727ffc5fcd46cb14fbeba63699 | 81056ffdcd7215f867ea5abc41f9c6d435ba8d47 | refs/heads/master | 2020-03-28T16:31:47.150203 | 2018-11-05T14:55:32 | 2018-11-05T14:55:32 | 148,704,406 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,330 | java | package com.example.android.higherlowerapp;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.List;
public class MainActivity extends AppCompatActivity {
private int [] mImageNames;
private ImageView mImageView;
private int prevRoll = 0;
private boolean higher = true;
private int score;
private int highScore;
private List mThrowList;
private ListView mListView;
private static final String TAG = "MyActivity";
private ArrayAdapter mAdapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//initialize vars
score=0;
mListView = findViewById(R.id.listView);
mThrowList = new ArrayList<String>();
mImageView = findViewById(R.id.imageView);
mImageNames = new int[]{R.drawable.d1, R.drawable.d2, R.drawable.d3, R.drawable.d4, R.drawable.d5, R.drawable.d6};
//OnClick methods for higher/lower buttons
FloatingActionButton fabHigh = findViewById(R.id.fabHigher);
fabHigh.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
higher=true;
setScore(score);
setHighScore(highScore);
rollDice();
}
});
FloatingActionButton fabLow = findViewById(R.id.fabLower);
fabLow.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
higher=false;
setScore(score);
setHighScore(highScore);
rollDice();
}
});
}
private void setScore(int score) {
TextView tvs = findViewById(R.id.textViewScore);
String scoreText = (getString(R.string.textScore) + score);
tvs.setText(scoreText);
//updateUI();
}
private void setHighScore(int highScore) {
TextView tVHS = findViewById(R.id.textViewHighScore);
String highScoreText = (getString(R.string.textHighScore) + highScore);
tVHS.setText(highScoreText);
//updateUI();
}
private void rollDice() {
{
//roll the dice
double randomNumber;
randomNumber = Math.random() * 6;
randomNumber = randomNumber + 1;
int roll = (int) randomNumber;
int i = roll - 1;
if (i < mImageNames.length) {
mImageView.setImageResource(mImageNames[i]);
}
//populate the list
mThrowList.add("Throw is " +roll);
mListView.smoothScrollToPosition(mThrowList.size()-1);
//check result; chosen to include equal in lower (as in = not higher)
if (roll > prevRoll && higher || roll <= prevRoll && !higher) {
score++;
setScore(score);
}
else if (score > highScore) {
highScore = score;
setHighScore(highScore);
score = 0;
mThrowList.clear();
Snackbar.make(mImageView, R.string.SnackBarNewHighScore, Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
} else {
Snackbar.make(mImageView, R.string.SnackBarYouLose, Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
score = 0;
mThrowList.clear();
}
prevRoll=roll;
Log.i(TAG,"score = "+score+", highScore = "+highScore);
updateUI();
}
}
private void updateUI() {
if (mAdapter == null) {
mAdapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, mThrowList);
mListView.setAdapter(mAdapter);
} else {
mAdapter.notifyDataSetChanged();
}
}
}
| [
"olga.molenaar@gmail.com"
] | olga.molenaar@gmail.com |
c9918cd9a1a3f9ada72f32ba933517414909c462 | 9e319f4ec990d56e9f8b104a98e37e66ecbdc02b | /Core_Java_Programs/AssignmentOops5.java | f3d2d2c870b74cdd72238216a6eb355c79ebf114 | [] | no_license | bhagya314/MKPITS_Bhagyashri_Lalsare_Java_Mar_2021 | d4e680a00c654792da98947c655b9f0d1a0d9be6 | 218e8f604b4fe9c9480a558b263e47ffb813f225 | refs/heads/main | 2023-07-13T12:37:51.188075 | 2021-08-20T14:53:39 | 2021-08-20T14:53:39 | 347,282,013 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 789 | java | //5.Write a program to print the area of two rectangles having sides (4,5) and (5,8) respectively by
// creating a class named 'Rectangle' with a method named 'Area' which returns the area and length
// and breadth passed as parameters to its constructor.
package Com.mkpits.java.OopsAssignment;
class Rectangle
{
int length,breadth;
public float area()
{
return length*breadth;
}
}
public class AssignmentOops5
{
public static void main(String[] args)
{
Rectangle r1=new Rectangle();
r1.breadth=4;
r1.length=5;
Rectangle r2=new Rectangle();
r2.breadth=5;
r2.length=8;
System.out.println("Area of rectangle 1 : "+r1.area());
System.out.println("Area of rectangle 2 : "+r2.area());
}
}
| [
"bhagyashrilalsare@gmail.com"
] | bhagyashrilalsare@gmail.com |
1d25db06a159bb96afc39ba08dad3d59b3350476 | 8d78ad2f0db049bb85ec4201f18ebf1c285c9b93 | /src/java/Modelo/ArquitecturaDao/DAOCATEGORIAS.java | c7e206d039b5ad9d108b38b2c86968c8f2ef34f2 | [] | no_license | JhonFy/Control-de-inventario | fc890ec7c243f6e64286eb864646a3b2f7a839aa | 61c44b960e25e4245afe6321c87f8bb39156401c | refs/heads/main | 2023-08-04T03:37:46.447915 | 2021-09-25T11:40:30 | 2021-09-25T11:40:30 | 398,904,237 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,183 | java | package Modelo.ArquitecturaDao;
import Modelo.DaoTmc.categoria;
import Modelo.conexion;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;
public class DAOCATEGORIAS extends conexion {
public List<categoria> listarCategorias() throws Exception {
List<categoria> categorias;
categoria cat;
ResultSet rscategoria = null;
String sqlCategoria = "SELECT E.IDCATEGORIA, E.NOMBRECATEGORIA, ESTADO FROM CATEGORIA E "
+"ORDER BY IDCATEGORIA";
try{
this.conectar(false);
rscategoria = this.ejecutarOrdenDatos(sqlCategoria);
categorias = new ArrayList<>();
while(rscategoria.next() == true){
cat = new categoria();
cat.setIdCategoria(rscategoria.getInt("IDCATEGORIA"));
cat.setNombreCategoria(rscategoria.getString("NOMBRECATEGORIA"));
cat.setEstado(rscategoria.getString("ESTADO"));
categorias.add(cat);
}
this.cerrar(true);
}catch(Exception e){
throw e;
}finally {
}
return categorias;
}
} | [
"mpepe397@gmail.com"
] | mpepe397@gmail.com |
2db2d29372b9bf9f48df44811f046cf293efb76e | 8ed8f14748cb8939b324706af131d3fcf990a2ba | /hanuairline/src/main/java/com/se2/hanuairline/controller/airport/AirwayController.java | b31bcc561196cd4961f9d6fc2627c6b62110d747 | [] | no_license | Vu1911/hanuairline-webapp | d55792590e670c076d702d0254d4803f566e4157 | 9614e3b156d552d96075663a5c03cfdc074ce6dc | refs/heads/master | 2023-03-29T02:24:55.832607 | 2021-04-06T15:43:12 | 2021-04-06T15:43:12 | 337,638,326 | 0 | 1 | null | 2021-03-28T08:24:26 | 2021-02-10T06:34:17 | Java | UTF-8 | Java | false | false | 3,158 | java | package com.se2.hanuairline.controller.airport;
import com.se2.hanuairline.model.airport.Airport;
import com.se2.hanuairline.model.airport.Airway;
import com.se2.hanuairline.payload.airport.AirwayPayload;
import com.se2.hanuairline.repository.airport.AirwayRepository;
import com.se2.hanuairline.repository.airport.AirportRepository;
import com.se2.hanuairline.service.airport.AirwayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.List;
import java.util.Optional;
@RestController
@RequestMapping("/airway")
public class AirwayController {
@Autowired
private AirwayRepository airwayRepository;
@Autowired
private AirportRepository airportRepository;
@Autowired
private AirwayService airwayService;
@GetMapping("/getAll")
public ResponseEntity<?> getAllAirway(@RequestParam(defaultValue = "0") int page,
@RequestParam(defaultValue = "10") int size,
@RequestParam(defaultValue = "id,desc") String[] sort) {
try {
Page<Airway> airways = airwayService.findAll(page, size, sort);
return new ResponseEntity<>(airways, HttpStatus.OK);
} catch (Exception e){
return new ResponseEntity<>(null, HttpStatus.INTERNAL_SERVER_ERROR);
}
}
@GetMapping("/getById/{id}")
public ResponseEntity<?> getAirwayByArrivalAndDepartureName(@RequestParam(required = true) String arrivalAirport,
@RequestParam(required = true) String departureAirport) {
Airway airwayData = airwayService.findByArrivalAirportAndDepartureAirport(arrivalAirport, departureAirport);
return new ResponseEntity<>(airwayData, HttpStatus.OK);
}
@PostMapping("/create")
public ResponseEntity<?> createAirway(@Valid @RequestBody AirwayPayload request) {
try {
Airway _airway = airwayService.createAirway(request);
if(_airway == null){
return new ResponseEntity<>("Duplicate airway or wrong airport id. Maybe logic error", HttpStatus.NOT_FOUND);
}
return new ResponseEntity<>(_airway, HttpStatus.CREATED);
} catch (Exception e) {
return new ResponseEntity<>(null, HttpStatus.INTERNAL_SERVER_ERROR);
}
}
// can not update the airway
// Becareful !!!!!
@DeleteMapping("/delete/{id}")
public ResponseEntity<?> deleteAirway(@PathVariable("id") long id) {
try {
if(airwayService.deleteAirway(id)){
return new ResponseEntity<>(HttpStatus.OK);
}
return new ResponseEntity<>("wrong airway id or airway being deployed. Maybe logic error", HttpStatus.NO_CONTENT);
} catch (Exception e) {
return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
}
}
}
| [
"1801040236@s.hanu.edu.vn"
] | 1801040236@s.hanu.edu.vn |
2e7ae3a62fb92b444a750736e7cccc352575b474 | 0766abed673a8707b084a42d05b47e72143e88c5 | /myFirstWebAppEE/src/java/com/models/LoginBean.java | fe4a6193b5f3996b5c6934410928c87c7075ef99 | [] | no_license | chronoxx1/Java | d81c1b20f1fc3a994ec7389a96f6dc20e7df7c16 | 1b9b427163d124c09f84d6ef70faf4b536353a49 | refs/heads/master | 2021-07-18T13:09:05.207313 | 2017-10-23T23:38:50 | 2017-10-23T23:38:50 | 107,173,764 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 606 | java | package com.models;
/**
*
* @author Pepe
*/
public class LoginBean {
private String email;
private String password;
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public boolean validator(String pass){
if (pass.equals("admin")) {
return true;
}
return false;
}
}
| [
"jose271_@hotmail.com"
] | jose271_@hotmail.com |
48c2254153c48d82babe5425ba5b4f6c43587a13 | 96fc4ae90e5cbe471535b42fdbae9bafa8429e73 | /customercenter/src/main/java/mall/MyPageRepository.java | 8db4513e0e0acac4b1d252c098455c0ba8093edd | [] | no_license | HyunhoSon/mall2 | 99acc70b8acf4930b3a2980dddcf46c41451ca75 | 3c210c6f6fbd217024d1c09b1e6c7cef76ed3d4f | refs/heads/master | 2023-05-05T22:12:00.427433 | 2021-05-18T11:04:22 | 2021-05-18T11:04:22 | 368,497,214 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 277 | java | package mall;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;
import java.util.List;
public interface MyPageRepository extends CrudRepository<MyPage, Long> {
List<MyPage> findByOrderId(Long orderId);
} | [
"engel0320@gmail.com"
] | engel0320@gmail.com |
a275696efc02e30820e4166b15385d97e4ba85ed | 0b064d530c665340f87de52d5971843cf382c747 | /app/src/main/java/com/dar/nclientv2/components/classes/integration/GlideGeneral.java | 911b4f764ec29d60ac9837dd72d86bc5d1f1a718 | [
"Apache-2.0",
"Glide"
] | permissive | Dar9586/NClientV2 | 48501e890a358c5abdb9e419c9cd785fe19576c9 | b189f00ea5f780cf64fcca42428b12f34ea92896 | refs/heads/master | 2023-07-19T23:55:16.818686 | 2023-07-14T13:35:09 | 2023-07-14T13:35:09 | 151,114,212 | 1,718 | 136 | Apache-2.0 | 2023-02-09T19:37:38 | 2018-10-01T15:46:01 | Java | UTF-8 | Java | false | false | 225 | java | package com.dar.nclientv2.components.classes.integration;
import com.bumptech.glide.annotation.GlideModule;
import com.bumptech.glide.module.AppGlideModule;
@GlideModule
public class GlideGeneral extends AppGlideModule {
}
| [
"atoppi2012@gmail.com"
] | atoppi2012@gmail.com |
313b5b5e0bb6c58b74354de091b64479d35b6ac9 | a98a2999b6a4f00155519f4263b4fda521fc5118 | /src/main/java/systems/cauldron/service/barebones/endpoint/WebsocketEndpoint.java | 4aecb1271319d18161dedac21de0ecfa6e9f0657 | [] | no_license | amannm/barebones-service | 7db658083c31060a33b53ef0fb2884cd20783311 | f2386fd1674bf2551ad95d4b97e46c6a3354c251 | refs/heads/master | 2021-01-18T21:29:44.280756 | 2018-09-03T07:19:08 | 2018-09-03T07:19:08 | 40,569,725 | 0 | 1 | null | 2017-01-15T21:09:12 | 2015-08-11T23:15:09 | JavaScript | UTF-8 | Java | false | false | 494 | java | package systems.cauldron.service.barebones.endpoint;
import javax.websocket.*;
import javax.websocket.server.ServerEndpoint;
import java.io.IOException;
/**
* Created by amannmalik on 1/15/17.
*/
@ServerEndpoint("/")
public class WebsocketEndpoint {
@OnOpen
public void connect(Session session) throws IOException { }
@OnMessage
public void message(String message, Session session) { }
@OnClose
public void close(CloseReason closeReason, Session session) { }
}
| [
"amannmalik@gmail.com"
] | amannmalik@gmail.com |
be204f2be6c25587a13b3b76a443f6467503fb35 | cb88f59a1c4eb5bc7c33a0ddb32d26a60221059e | /NRCS.WebPresence.Arizona/src/test/java/testcase_LeftNav/Verify_HomePage1.java | f361bbef1fe7bb36a01f7c97338ad5b0f2439029 | [] | no_license | priya-bhag/WebPresence | 156d3c24b20c2dd2f2e44040bc39e8f89cb6fc6a | 8ea6f2ec6eb4515342e46e300bedbe8cc0a136ee | refs/heads/master | 2022-01-19T13:02:55.022593 | 2019-06-20T13:36:02 | 2019-06-20T13:36:02 | 110,005,414 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,253 | java | package testcase_LeftNav;
import java.io.IOException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.support.PageFactory;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import factory.BrowserFactory;
import factory.DataProviderFactory;
import pages.LeftNav.Home_Page1;
import utility.Helper;
public class Verify_HomePage1 {
WebDriver driver;
@BeforeClass
public void SetUp() throws IOException
{
driver = BrowserFactory.getBrowser(DataProviderFactory.getExcel().getdata(1, 0, 0));
driver.get(DataProviderFactory.getConfig().getApplicationUrl1()
+ DataProviderFactory.getExcel().getdata(0, 36, 0));
Helper.capturescreenshot(driver, "HomePageIN_Prod");
}
@Test(priority = 1)
public void testHomePage() throws IOException, InterruptedException {
Home_Page1 home = PageFactory.initElements(driver, Home_Page1.class);
/*
* String titleURL1 =home.getApplicationTitle1();
*
* System.out.println("Title of URL1 is "+titleURL1);
*/
System.out.println("\t");
Home_Page1.validateURL();
}
@AfterClass
public void tearDown() {
driver.close();
}
}
| [
"Sivapriya Bhagavathi@TSPREA01LAPA35.fios-router.home"
] | Sivapriya Bhagavathi@TSPREA01LAPA35.fios-router.home |
8f2e0fe24b71c056cb4500b67ca14043c9288b5b | 99994825d6909a659f96ecfdf08a63c7355e80fd | /app/src/main/java/com/mycompany/myapp4/toHex.java | b5e656000498b285f79836965a3bd0afdbd57660 | [] | no_license | vhyu/Touch | 108137c38a1f816258011d12c0926270affa9219 | 62acf32e97cd14d00c71cddbac1173fe33a327a3 | refs/heads/master | 2020-03-26T16:45:45.278142 | 2018-08-17T13:25:15 | 2018-08-17T13:25:17 | 145,121,600 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 346 | java | package com.mycompany.myapp4;
public class toHex
{
static StringBuffer buf;
public static String toHex(String str)
{
buf = new StringBuffer();
if (str.indexOf("0") == -1)
{
buf.append(str);
return buf.toString();
}
buf.append(Integer.parseInt(str, 16));
// System.out.println(buf.toString());
return buf.toString();
}
}
| [
"1185895906@qq.com"
] | 1185895906@qq.com |
f0ddd7a44cf8491a123519b430f486acd00ce5ca | 4a50ceb688d217595b222b73e338b2a0fd7da302 | /app/src/main/java/com/lucidastar/encapsulationhttp/otherhttp/subscribers/ProgressSubscriber.java | cc412f371ffa3d2c14d1584b1d4bdf16926e3721 | [
"Apache-2.0"
] | permissive | Lucidastar/EncapsulationHttp | 0e9a8586b42ccc01fdc9f010244b5d4f72fd8ab8 | 97d1438ab3817071adb9804499117d9743f7156c | refs/heads/master | 2020-03-17T17:29:55.452895 | 2019-09-26T10:15:04 | 2019-09-26T10:15:04 | 133,790,524 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,287 | java | package com.lucidastar.encapsulationhttp.otherhttp.subscribers;
import android.os.Looper;
import android.text.TextUtils;
import com.lucidastar.encapsulationhttp.otherhttp.exception.ExceptionHandle;
import com.lucidastar.encapsulationhttp.otherhttp.exception.HttpTimeException;
import com.lucidastar.encapsulationhttp.otherhttp.listener.HttpOnNextListener;
import com.mine.lucidastarutils.log.KLog;
import com.mine.lucidastarutils.utils.NetworkUtils;
import com.mine.lucidastarutils.utils.ToastUtils;
import org.reactivestreams.Subscriber;
import java.net.ConnectException;
import io.reactivex.Observer;
import io.reactivex.annotations.NonNull;
import io.reactivex.disposables.Disposable;
//https://github.com/yezizaiqiutian/JiKeTools/blob/3cd6cafbaacf0a7d5c8611048d9b1ba34c689960/retrofittools/src/main/java/com/gh/retrofittools/subscribers/ProgressSubscriber.java
/**
* Created by qiuyouzone on 2018/5/2.
*/
public class ProgressSubscriber<T> implements Observer<T>{
private HttpOnNextListener<T> mSubscriberOnNextListener;
private Disposable disposable;
public ProgressSubscriber(HttpOnNextListener<T> subscriberOnNextListener) {
mSubscriberOnNextListener = subscriberOnNextListener;
}
/**
* 订阅开始时调用
* 显示ProgressDialog
*/
@Override
public void onSubscribe(@NonNull Disposable d) {
disposable = d;
//如果没有网络则不进行请求
if (!NetworkUtils.isConnected()) {
errorDo(new ConnectException());
disposable.dispose();
return;
}
}
@Override
public void onComplete() {
}
/**
* 对错误进行统一处理
* 隐藏ProgressDialog
*
* @param e
*/
@Override
public void onError(final Throwable e) {
errorDo(e);
if (mSubscriberOnNextListener != null) {
mSubscriberOnNextListener.onError(e);
}
}
/*错误统一处理*/
private void errorDo(Throwable e) {
ExceptionHandle.ResponeThrowable responeThrowable = ExceptionHandle.handleException(e);
if (!TextUtils.isEmpty(responeThrowable.message)){//这会把code=500也会打印出来
// ToastUtils.show(responeThrowable.getMessage());
// UtilToast.show(responeThrowable.message);
ToastUtils.showShortToast(responeThrowable.message);
}
if (mSubscriberOnNextListener != null) {
mSubscriberOnNextListener.onError(responeThrowable.message);
}
}
/**
* 将onNext方法中的返回结果交给Activity或Fragment自己处理
*
* @param t 创建Subscriber时的泛型类型
*/
@Override
public void onNext(T t) {
KLog.i("progressSubscriber", Looper.getMainLooper() == Looper.myLooper());
KLog.i("progressSubscriber", t);
if (mSubscriberOnNextListener != null) {
mSubscriberOnNextListener.onNext(t);
}
}
/**
* 取消ProgressDialog的时候,取消对observable的订阅,同时也取消了http请求
*/
public void onCancelProgress() {
unSubscribe();
}
public void unSubscribe() {
if (disposable != null && !disposable.isDisposed())
disposable.dispose();
}
} | [
"lucidahxx@gmail.com"
] | lucidahxx@gmail.com |
1fb9d64a05d2260771c10a72450b1b4ac947a26b | 85ad911357b5edc90b817c0347a0f2e18da47301 | /royspring/src/main/java/com/roy/spring/demo/MyAction.java | a069b78cd44d0cb958b5bfb5ab4ea3cd81e397c5 | [] | no_license | panyi5202/enjoyke | 11b3d25f4aad3c9d35e0033ee76da37f48e28075 | c30ef7d5d5d91a926139b62ce180e3acf7fec4a1 | refs/heads/master | 2020-12-03T00:46:26.351426 | 2020-01-01T11:41:02 | 2020-01-01T11:41:02 | 231,162,176 | 0 | 0 | null | 2020-06-06T05:45:12 | 2020-01-01T01:05:10 | Java | UTF-8 | Java | false | false | 408 | java | package com.roy.spring.demo;
import com.roy.spring.framework.annotation.RoyAutowired;
import com.roy.spring.framework.annotation.RoyController;
/**
* @author Roy
*/
@RoyController("myAction")
public class MyAction {
@RoyAutowired("myServiceImpl")
private MyService myService;
public void info(String msg){
String info = myService.info(msg);
System.out.println(info);
}
}
| [
"admin!@#"
] | admin!@# |
b936021d41ee3036dd45df5817c3163cffb5731d | 951f47a59ced410c137d51edce6ed8ed8583d95d | /app/src/main/java/com/xpf/modular/Main2Activity.java | 3fbd8ddbf63dcea85964b7462baa4c74a06f38b4 | [] | no_license | xpf-android/Modular_Router | 9de8a74f494515d037f16fac1e74422c83e149bd | 779045528db2cd1085ad13bb11bff17fcdef051c | refs/heads/master | 2023-01-14T12:16:55.332739 | 2020-11-18T04:54:10 | 2020-11-18T04:54:10 | 313,826,751 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,919 | java | package com.xpf.modular;
import androidx.appcompat.app.AppCompatActivity;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.Observer;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Toast;
import com.xpf.annotation.BindPath;
import com.xpf.common.JSLiveData;
import com.xpf.common.JSObserver;
import com.xpf.common.LiveDataBus;
import com.xpf.router.ARouter;
@BindPath(path = "/app/Main2Activity")
public class Main2Activity extends AppCompatActivity {
// JSLiveData liveData;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main2);
// liveData = new JSLiveData();
LiveDataBus.getInstance().with("code", Integer.class).postValue(168);
/*LiveDataBus.getInstance().with("code", Integer.class).observe(Main2Activity.this, new Observer<Integer>() {
@Override
public void onChanged(Integer integer) {
Log.d("xpf >>> ", "" + integer);
}
});*/
}
public void sendData(View view) {
// liveData.postValue("123456");
}
public void registerObserver(View view) {
// liveData.addObserver(new JSObserver() {
// @Override
// public void onChange(Object obj) {
// Log.d("JSLiveData >>> ", obj.toString());
// Toast.makeText(Main2Activity.this, obj.toString(), Toast.LENGTH_SHORT).show();
// }
// });
/*mutableLiveData.observe(Main2Activity.this, new Observer<Integer>() {
@Override
public void onChanged(Integer integer) {
Log.d("xpf >>> ", "" + integer );
}
});*/
}
public void jump(View view) {
ARouter.getInstance().jumpActivity("/order/Order_MainActivity",null);
}
}
| [
"xpfwork@foxmail.com"
] | xpfwork@foxmail.com |
0eb9365d520de440266bf6a1ba64c22ad19c0ad0 | 42e7820ba5a3d3aa26aff1380c0f2fd96abb0e76 | /src/com/matteo/cc/utils/PinYinUtils.java | b431ccc51c7cbca6d903f071155bb56f4e1ebceb | [] | no_license | insiva/ContactCenter | 42589bb5ace4e36f6cdfbca11f27cfe7d5f2fcd7 | 3d1f079698c8e2332265c9e0e1950492897ef316 | refs/heads/master | 2021-01-19T05:34:23.397265 | 2016-06-27T04:13:13 | 2016-06-27T04:13:13 | 60,057,195 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,605 | java | package com.matteo.cc.utils;
import net.sourceforge.pinyin4j.PinyinHelper;
import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType;
import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat;
import net.sourceforge.pinyin4j.format.HanyuPinyinToneType;
import net.sourceforge.pinyin4j.format.HanyuPinyinVCharType;
import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination;
public class PinYinUtils {
/**
* 将字符串中的中文转化为拼音,其他字符不变
*
* @param inputString
* @return
*/
public static String getPingYin(String inputString) {
HanyuPinyinOutputFormat format = new
HanyuPinyinOutputFormat();
format.setCaseType(HanyuPinyinCaseType.LOWERCASE);
format.setToneType(HanyuPinyinToneType.WITHOUT_TONE);
format.setVCharType(HanyuPinyinVCharType.WITH_V);
char[] input = inputString.trim().toCharArray();
String output = "";
try {
for (int i = 0; i < input.length; i++) {
if (java.lang.Character.toString(input[i]).
matches("[\\u4E00-\\u9FA5]+")) {
String[] temp = PinyinHelper.
toHanyuPinyinStringArray(input[i],
format);
output += temp[0];
} else
output += java.lang.Character.toString(
input[i]);
}
} catch (BadHanyuPinyinOutputFormatCombination e) {
e.printStackTrace();
}
return output;
}
}
| [
"matteozuo@gmail.com"
] | matteozuo@gmail.com |
eabc99a8c90f3ae0b8a567cfeaba67e00411f5f1 | 4996238790ccd145ac18e937f60c5405718d7b5e | /src/com/cartracker2/Util.java | 650f9521b745c02055f7dcd7d730c0c7972ebedb | [] | no_license | caushikh/DeviceTracker | 7d2dae90e09ff89b369ab8308d12776337b185b4 | b6e1c64e5b3787dcc1a2918fa8d3cd9a8be14e11 | refs/heads/master | 2021-01-10T13:31:09.607685 | 2016-03-07T02:53:37 | 2016-03-07T02:53:37 | 51,717,875 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,947 | java | package com.cartracker2;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.fileupload.FileItemIterator;
import org.apache.commons.fileupload.FileItemStream;
import org.apache.commons.fileupload.servlet.ServletFileUpload;
import org.apache.commons.fileupload.util.Streams;
public class Util {
/**
* Escapes or removes open angle bracket, apostrophe and quote, backslash,
* and carriage return.
*/
public static String clean(String str) {
return str.replaceAll("<", "<").replaceAll("'", "'")
.replaceAll("\"", """).replaceAll("\\\\", "")
.replaceAll("\r", " ").replaceAll("\n", " ");
}
/**
* Parses an http request's parameters and converts them to a Map. If a form
* field named "nm" has a single string value, you can get it from the map
* using key "nm". If it has several string values, you can get a List of
* the String values using key "nm[]" If it has a single binary file value,
* you can get the byte[] from the map using key "nm[]" Note that the
* request is consumed by this method. This method uses commons fileupload.
*/
public static Map<String, Object> read(HttpServletRequest request) {
Map<String, Object> rv = new HashMap<String, Object>();
if (ServletFileUpload.isMultipartContent(request)) {
try {
ServletFileUpload upload = new ServletFileUpload();
FileItemIterator iterator = upload.getItemIterator(request);
while (iterator.hasNext()) {
FileItemStream item = iterator.next();
InputStream stream = item.openStream();
String name = item.getFieldName();
if (item.isFormField()) {
String value = Streams.asString(stream);
rv.put(name, value);
@SuppressWarnings("unchecked")
List<String> values = (List<String>) rv
.get(name + "[]");
if (values == null) {
values = new ArrayList<String>();
rv.put(name + "[]", values);
}
values.add(value);
} else {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
int len;
byte[] buffer = new byte[2048];
while ((len = stream.read(buffer, 0, buffer.length)) > 0)
bos.write(buffer, 0, len);
rv.put(name, item.getName());
rv.put(name + "[]", bos.toByteArray());
}
}
} catch (Exception e) {
throw new IllegalArgumentException(e);
}
} else {
@SuppressWarnings("rawtypes")
Enumeration params = request.getParameterNames();
while (params.hasMoreElements()) {
String key = params.nextElement().toString();
String[] values = request.getParameterValues(key);
if (values != null && values.length > 0)
rv.put(key, values[0]);
rv.put(key + "[]", Arrays.asList(values));
}
}
return rv;
}
}
| [
"caushikh@onid.orst.edu"
] | caushikh@onid.orst.edu |
49d31fcabd9d39b3e9997e9cd1c10cb670c907e7 | 09bcc817a0b25d49de18adb9eb68690fa17d70ce | /bitcamp-web-project/src/main/java/com/eomcs/web/ex04/Servlet08.java | 42607a307ca9dcc17dac91fb394dab485ec88511 | [] | no_license | 2seunghyuck/bitcamp-workspace | 4a84b1a329e57a9fe545fd32415a463ac9ad2c9f | c7b6844e7350d844e59f169a6681fdc83fb8e1c7 | refs/heads/master | 2023-07-08T07:02:55.531157 | 2021-08-05T20:37:50 | 2021-08-05T20:37:50 | 279,742,762 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,341 | java | // 썸네일 이미지 만들기
package com.eomcs.web.ex04;
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.UUID;
import javax.servlet.GenericServlet;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.MultipartConfig;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.Part;
import net.coobird.thumbnailator.ThumbnailParameter;
import net.coobird.thumbnailator.Thumbnails;
import net.coobird.thumbnailator.Thumbnails.Builder;
import net.coobird.thumbnailator.geometry.Positions;
import net.coobird.thumbnailator.name.Rename;
@MultipartConfig(maxFileSize = 1024 * 1024 * 10)
@WebServlet("/ex04/s8")
public class Servlet08 extends GenericServlet {
private static final long serialVersionUID = 1L;
private String uploadDir;
@Override
public void init() throws ServletException {
this.uploadDir = this.getServletContext().getRealPath("/upload");
}
@Override
public void service(ServletRequest req, ServletResponse res)
throws ServletException, IOException {
// 테스트
// - http://localhost:8080/java-web/ex04/test08.html 실행
//
req.setCharacterEncoding("UTF-8");
HttpServletRequest httpReq = (HttpServletRequest) req;
res.setContentType("text/html;charset=UTF-8");
PrintWriter out = res.getWriter();
out.println("<html>");
out.println("<head><title>servlet04</title></head>");
out.println("<body><h1>파일 업로드 결과</h1>");
// 일반 폼 데이터를 원래 하던 방식대로 값을 꺼낸다.
out.printf("이름=%s<br>\n", httpReq.getParameter("name"));
out.printf("나이=%s<br>\n", httpReq.getParameter("age"));
// 파일 데이터는 getPart()를 이용한다.
Part photoPart = httpReq.getPart("photo");
String filename = "";
if (photoPart.getSize() > 0) {
// 파일을 선택해서 업로드 했다면,
filename = UUID.randomUUID().toString();
photoPart.write(this.uploadDir + "/" + filename);
}
// 원본 사진을 가지고 특정 크기의 썸네일 이미지를 만들기
// 1) 썸네일 이미지를 생성해주는 자바 라이브러리 추가
// => mvnrepository.com에서 thumbnailator 라이브러리 검색
// => build.gradle 에 추가
// => '$ gradle eclipse' 실행
// => eclise IDE에서 프로젝트 리프래시
// 2) 썸네일 이미지 만들기
// => 원본 이미지 파일이 저장된 경로를 알려주고
// 어떤 썸네일 이미지를 만들어야 하는지 설정한다.
// Thumbnails.of(this.uploadDir + "/" + filename)
// .size(20, 20)
// .outputFormat("jpg")
// .toFiles(Rename.PREFIX_DOT_THUMBNAIL);
Builder<File> thumbnailBuilder = Thumbnails.of(this.uploadDir + "/" + filename);
thumbnailBuilder.size(20, 20);
thumbnailBuilder.crop(Positions.CENTER);
thumbnailBuilder.outputFormat("jpg");
thumbnailBuilder.toFiles(new Rename() {
@Override
public String apply(String name, ThumbnailParameter param) {
return name + "_20x20";
}
});
Thumbnails.of(this.uploadDir + "/" + filename)
.size(80, 80)
.outputFormat("jpg")
.crop(Positions.CENTER)
//.toFiles(Rename.PREFIX_DOT_THUMBNAIL);
.toFiles(new Rename() {
@Override
public String apply(String name, ThumbnailParameter param) {
return name + "_80x80";
}
});
Thumbnails.of(this.uploadDir + "/" + filename)
.size(160, 160)
.outputFormat("jpg")
.crop(Positions.CENTER)
//.toFiles(Rename.PREFIX_DOT_THUMBNAIL);
.toFiles(new Rename() {
@Override
public String apply(String name, ThumbnailParameter param) {
return name + "_160x160";
}
});
out.printf("사진=%s<br>\n", filename);
out.printf("<img src='../upload/%s_20x20.jpg'><br>\n", filename);
out.printf("<img src='../upload/%s_80x80.jpg'><br>\n", filename);
out.printf("<img src='../upload/%s' height='80'><br>\n", filename);
out.printf("<img src='../upload/%s_160x160.jpg'><br>\n", filename);
out.printf("<img src='../upload/%s'><br>\n", filename);
out.println("</body></html>");
}
}
| [
"rotid1818@gmail.com"
] | rotid1818@gmail.com |
8fa6d8ac29f75c994ab4add0b1e5e6e99ede2d2d | 84e4452d49b0ac0f1f2332ddd48c0efe0e9559f2 | /src/by/it/Zyryanov/jd02_01/Runner.java | 9154dd55fe0687b81d63d4b58e417e55d615bf37 | [] | no_license | loktevalexey/JD2017-02-20 | ea2c25203cefc2c139f1277f17d9999e5c8af522 | f69c964dc9d651c2acef01e6f177aead182f83b6 | refs/heads/master | 2020-04-15T00:13:55.277294 | 2017-06-20T07:53:24 | 2017-06-20T07:53:24 | 86,786,465 | 0 | 1 | null | 2017-03-31T06:37:19 | 2017-03-31T06:37:19 | null | UTF-8 | Java | false | false | 885 | java | package by.it.Zyryanov.jd02_01;
/**
* Created by georgijzyranov on 01.04.17.
*/
public class Runner {
private static final int plan = 100;
private static int countBuyers = 0;
public static int numberOfBaskets = 10;
public static int inShopNow = 0;
public static void main(String[] args) {
Buyer buyer;
Timer timer = new Timer();
timer.start();
while (countBuyers < plan) {
int count = Helper.getRandom(2);
while (count > 0) {
buyer = new Buyer(++countBuyers);
if (countBuyers % 4 == 0){
buyer.pensioneer = true;
}
buyer.start();
count--;
if (countBuyers == plan) break;
}
Helper.sleep(1000);
}
System.out.println("Все вошли");
}
}
| [
"george.zyryanov@gmail.com"
] | george.zyryanov@gmail.com |
86c6aa7832943ebcbc7cf8962e191176cef36bb9 | 306bffa54eb91d9c9cfc79545136c5df1fdee175 | /src/java/com/atlanta/educatic/service/ApoderadoService.java | 4932190d5c0c8455472b2913554313d324eed60a | [] | no_license | gbifone/EducaTIC | 4b03de0990c6a0203923baf3757b329d3dda9403 | 5db6ba573f292b3c8fcde53320b893d71136c1b6 | refs/heads/master | 2020-03-15T16:36:31.534318 | 2016-01-18T20:56:30 | 2016-01-18T20:56:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,076 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.atlanta.educatic.service;
import com.atlanta.educatic.dao.ApoderadoDao;
import com.atlanta.educatic.daoImp.ApoderadoDaoImp;
import com.atlanta.educatic.pojo.Apoderado;
import java.util.List;
import java.util.Map;
/**
*
* @author Nerio
*/
public class ApoderadoService {
ApoderadoDao apoderadoDao = new ApoderadoDaoImp();
public int create(Apoderado x) {
return apoderadoDao.save(x);
}
public Apoderado read(int id) {
return apoderadoDao.get(id);
}
public int update(Apoderado x) {
return apoderadoDao.update(x);
}
public int delete(Apoderado x) {
return apoderadoDao.drop(x);
}
public List<Apoderado> list() {
return apoderadoDao.findAll();
}
public Apoderado get(Map mapa) {
return apoderadoDao.CriteriaUnique(mapa);
}
}
| [
"Nerio@192.168.1.40"
] | Nerio@192.168.1.40 |
b9d8117ad9ff97023d869e17473326cd3ffd36a3 | 4bd4153cf0cd14f8e00c17fc1565d5a81a338ccd | /lambdaLearn/src/testLambda2.java | 1861b226e42f7d09e1f3110fea807daaa1507bd9 | [] | no_license | MaskTaoX/learn | 1a54be40585f528de7c2e2a572818a91136dba46 | c46f8ccdbc04184d005bd4bed2f3f1af24919492 | refs/heads/master | 2023-05-11T21:40:32.751136 | 2021-05-10T02:47:43 | 2021-05-10T02:47:43 | 332,675,962 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,853 | java | import org.junit.Test;
import java.util.Comparator;
import java.util.function.Consumer;
/**
* 可以把lambda表达式理解为一段可以传递的代码 可以写出简洁灵活的代码 提升java语言表达能力
* “->”将表达式拆分成两部分
* 左侧:lambda表达式中参数(抽象方法中参数列表)
* 右侧:lambda表达式中需要执行的功能 (抽象方法的实现)
* 适用于 函数式接口
* 本质就是一个函数式接口的实现
*
* 语法格式一: 无参数 无返回值
* ()->System.out.printlin("hello");
* 语法格式二: 有参数 无返回值
* 语法格式三:如果方法只有一个参数 小括号可以不写
* 语法格式四:有两个以上参数 有返回值 并且lambda中有多条语句
* 语法格式五:如果只有一条语句 大括号和return都可以不写
* @FunctionalInterface 注解 确保接口是函数式接口
*/
public class testLambda2 {
/**
* 语法格式一: 无参数 无返回值
*/
@Test
public void test1() {
Runnable r1= ()->System.out.println("hello");
r1.run();
}
/**
* 语法格式二: 有参数 无返回值
*/
@Test
public void test2(){
/**
* lamdba表达式是对Consumer接口的accept方法的实现
* 语法格式三 如果方法只有一个参数 小括号可以不写
*/
Consumer<String> consumer = x->System.out.println(x);
consumer.accept("aaaa");
}
/**
* 语法格式四 有两个以上参数 有返回值 并且lambda中有多条语句
*/
@Test
public void test3(){
Comparator<Integer> com=(x,y)->{
System.out.println("函数是借口");
return Integer.compare(x,y);
};
System.out.println(com.compare(5,6));
}
}
| [
"jieingxuxu@sina.com"
] | jieingxuxu@sina.com |
60137bec20f7cb7cb00ab39d01805e53b7cb6a7e | d34e4e7e6e1cd6ffce89a7f658efac9fbe879d85 | /5-quarkus-workshop-superheroes/super-heroes/rest-hero/src/main/java/io/quarkus/workshop/superheroes/hero/Hero.java | 160479e5df34a534de131ac5b297bfd132e61840 | [] | no_license | nagcloudlab/quarkus-batch7 | 619e0c6c6989bb13c8d5db9c2dade713412bbb04 | e57eca9e256922488d930671d64d798e9bbc34eb | refs/heads/main | 2023-01-14T12:34:11.769808 | 2020-11-16T11:35:06 | 2020-11-16T11:35:06 | 311,313,335 | 0 | 4 | null | 2020-11-11T09:59:46 | 2020-11-09T11:13:15 | Java | UTF-8 | Java | false | false | 1,219 | java | package io.quarkus.workshop.superheroes.hero;
import java.util.Random;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import io.quarkus.hibernate.orm.panache.PanacheEntity;
@Entity
public class Hero extends PanacheEntity {
@NotNull
@Size(min = 3, max = 50)
public String name;
public String otherName;
@NotNull
@Min(1)
public int level;
public String picture;
@Column(columnDefinition = "TEXT")
public String powers;
public static Hero findRandom() {
long count = Hero.count(); // select count(*) from hero;
Random random = new Random();
int randomIndex = random.nextInt((int) count);
return Hero.findAll().page(randomIndex, 1).firstResult();
}
@Override
public String toString() {
return "Hero{" +
"id=" + id +
", name='" + name + '\'' +
", otherName='" + otherName + '\'' +
", level=" + level +
", picture='" + picture + '\'' +
", powers='" + powers + '\'' +
'}';
}
} | [
"nagabhushanamn@gmail.com"
] | nagabhushanamn@gmail.com |
70a9ea17be234b70ee5d161b12fb842035bb4ee1 | 4f3514be592d60fd09ffa227e64f9ecefb292bf4 | /src/main/java/org/springframework/data/arangodb/repository/support/ArangoDbEntityInformation.java | 0572d8f33c3dcc31f04648295d732ca528fc9ab4 | [
"Apache-2.0"
] | permissive | anderick/spring-data-arangodb | dc018ce37e1c2317bfe270849dd1240d951fd7f5 | f449fbdf6459406d7067a00ca48ff6cd775d80ae | refs/heads/master | 2021-01-24T22:35:54.559745 | 2019-10-08T13:21:01 | 2019-10-08T13:21:01 | 68,567,340 | 6 | 3 | null | null | null | null | UTF-8 | Java | false | false | 509 | java | package org.springframework.data.arangodb.repository.support;
import org.springframework.data.repository.core.support.AbstractEntityInformation;
public class ArangoDbEntityInformation<T> extends AbstractEntityInformation<T, Long> {
public ArangoDbEntityInformation(Class<T> domainClass) {
super(domainClass);
}
@Override
public Long getId(Object entity) {
throw new UnsupportedOperationException("Not implemented yet.");
}
@Override
public Class<Long> getIdType() {
return Long.class;
}
}
| [
"beto@anderick.com"
] | beto@anderick.com |
dbf0a25a8741110e82707589dedde932473a69d1 | 0af8b92686a58eb0b64e319b22411432aca7a8f3 | /single-large-project/src/test/java/org/gradle/test/performancenull_98/Testnull_9797.java | 6644cc84b9b4aa545d259cb8bfc54b0dceae82ef | [] | no_license | gradle/performance-comparisons | b0d38db37c326e0ce271abebdb3c91769b860799 | e53dc7182fafcf9fedf07920cbbea8b40ee4eef4 | refs/heads/master | 2023-08-14T19:24:39.164276 | 2022-11-24T05:18:33 | 2022-11-24T05:18:33 | 80,121,268 | 17 | 15 | null | 2022-09-30T08:04:35 | 2017-01-26T14:25:33 | null | UTF-8 | Java | false | false | 304 | java | package org.gradle.test.performancenull_98;
import static org.junit.Assert.*;
public class Testnull_9797 {
private final Productionnull_9797 production = new Productionnull_9797("value");
@org.junit.Test
public void test() {
assertEquals(production.getProperty(), "value");
}
} | [
"cedric.champeau@gmail.com"
] | cedric.champeau@gmail.com |
861378e5899126151402193d09565d46f661f93f | 948f659432f5aecad6ca5b827e512c614ada90ea | /src/deposit-service/src/main/java/ru/home/deposit/repository/DepositRepository.java | a1b04ec95b0cded0c696ca2f112d92222379cc8e | [] | no_license | wveik/spring-cloud-microservices | e6baee4f949c523b4bf9eb5cb50af42932559de1 | 5647a6d53147b7f4344b37ff6f6075a272000c22 | refs/heads/master | 2023-03-01T20:53:35.564971 | 2021-02-06T20:25:25 | 2021-02-06T20:25:25 | 333,479,387 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 213 | java | package ru.home.deposit.repository;
import org.springframework.data.repository.CrudRepository;
import ru.home.deposit.entity.Deposit;
public interface DepositRepository extends CrudRepository<Deposit, Long> {
}
| [
"kataev_06@list.ru"
] | kataev_06@list.ru |
986d665b90804456c4578a6b6c7ba691fec6550c | 7466f2790797498c41f9b261bc5dd9e4cf535c4e | /library/src/main/java/com/github/elementbound/asciima/image2ascii/colors/mapper/ColorMapper.java | 6dba497513dfd2e9fad53dd7389255057652d834 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | elementbound/image2ascii | dfdc168789ba5f7a7c070e4a7b5e5a13b4427923 | dddc280de9faa500cd32dd4988dc50b0da6e5403 | refs/heads/master | 2020-05-30T14:16:57.141362 | 2019-06-22T21:42:08 | 2019-06-22T21:42:08 | 189,786,835 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 231 | java | package com.github.elementbound.asciima.image2ascii.colors.mapper;
import com.github.elementbound.asciima.image2ascii.colors.model.RGBColor;
@FunctionalInterface
public interface ColorMapper {
RGBColor map(RGBColor color);
}
| [
"ezittgtx@gmail.com"
] | ezittgtx@gmail.com |
ae1a78f242549670b2b60c19f09a74d37ad4b0da | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/24/24_588b989aa62b219ab2ae71f254fff94d75ec7afd/TimeSeriesRendrerTest/24_588b989aa62b219ab2ae71f254fff94d75ec7afd_TimeSeriesRendrerTest_t.java | 329685d53daf1e16f67bcb68f04c70b3dee3f56c | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 1,113 | java | package no.yr.svg;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.nio.CharBuffer;
import junit.framework.TestCase;
import no.yr.xml.parser.Weatherdata;
import org.jdom.output.XMLOutputter;
public class TimeSeriesRendrerTest extends TestCase {
public void testTimeSeriesRenderer() throws Exception
{
FileReader reader;
reader = new FileReader("yrexample.xml");
int bufferSize = 900000;
char[] buf = new char[bufferSize];
int sizeRead = reader.read(buf);
if(sizeRead == bufferSize)
{
throw new Exception("To small a buffer to read the entire xml.");
}
String xml = new String(buf);
xml = xml.trim();
Weatherdata data = new Weatherdata(xml);
TimeSeriesRendrer renderer = new TimeSeriesRendrer(data.getTimeSeriesForHours(24));
XMLOutputter out = new XMLOutputter();
File newFile = new File("timeseries.svg");
FileWriter file = new FileWriter(newFile);
out.output(renderer.getSvg(), file);
System.out.flush();
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
1ca23aed0ffc05e9447da21add42a7d29b488875 | ded23c4629a04d02b1ab114fa9594483739fed47 | /app/src/androidTest/java/org/literacyapp/startguide/ExampleInstrumentedTest.java | f156100589fc52b540dcb7d8c573867b9e17b839 | [
"Apache-2.0"
] | permissive | sladomic/literacyapp-start-guide | 8659667ca406cb2d0d5df6632e285cf0d840264d | 5ea794acabd60b01eb6d6467efaf35000d74dc94 | refs/heads/master | 2021-01-20T04:16:58.793683 | 2017-04-28T14:01:27 | 2017-04-28T14:01:27 | 89,671,803 | 1 | 0 | null | 2017-04-28T05:47:49 | 2017-04-28T05:47:49 | null | UTF-8 | Java | false | false | 782 | java | package org.literacyapp.startguide;
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.*;
/**
* Instrumentation 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("org.literacyapp.startguide", appContext.getPackageName());
}
}
| [
"gsc.mobile.dev@gmail.com"
] | gsc.mobile.dev@gmail.com |
180620a5a14e5d6dfa0ee5fc7f09cfb731b0304e | 9e131e234082b4c14586a422b3cbb90138a874c2 | /src/main/java/com/hcl/onetest/OneTestApplication.java | 8a8149b4aea9ba2338c5d8994f8d005c7ba43d17 | [] | no_license | tunveyyy/Process-CSV-Spring-Batch | ede34396341cee168238d65dd9605eedb9e4a3a8 | df22bab2db8c0236f1b2833974950f54d7021ce1 | refs/heads/develop | 2022-12-22T08:55:28.984930 | 2020-06-18T17:07:26 | 2020-06-18T17:07:26 | 272,804,851 | 0 | 0 | null | 2022-12-10T06:05:28 | 2020-06-16T20:23:27 | Java | UTF-8 | Java | false | false | 511 | java | package com.hcl.onetest;
import com.hcl.onetest.config.FileStorageProperties;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
@SpringBootApplication
@EnableConfigurationProperties({
FileStorageProperties.class
})
public class OneTestApplication {
public static void main(String[] args) {
SpringApplication.run(OneTestApplication.class, args);
}
}
| [
"tanvi.pandit@prod.hclpnp.com"
] | tanvi.pandit@prod.hclpnp.com |
8530cc0a0055becc9b344cddaebde7c40f3f82b8 | 441bd9019269ea509f1ebba044824ecc12801c7a | /src/com/designpatterns/creational/prototype/Circle.java | 34cc8ae5b6bb42bd1c2ba28233e7d132826f4a5a | [] | no_license | VasilSokolov/TestProject | c7cadc8402d1d4bfe945d5be3820e72c21ffd473 | 14716072e8681b9feea23cf25788aba76f381843 | refs/heads/master | 2023-07-06T23:10:13.652724 | 2023-06-21T07:35:23 | 2023-06-21T07:35:23 | 133,313,908 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 216 | java | package com.designpatterns.creational.prototype;
public class Circle extends Shape {
public Circle() {
type = "Circle";
}
@Override
void draw() {
System.out.println("Inside Circle::draw() method.");
}
}
| [
"vasilsokolov0@gmail.com"
] | vasilsokolov0@gmail.com |
eab71355e03f299f2469eed83e9bc859ce3bcf38 | 79ab3349bb5fb1deabea31db159afac6823d5416 | /src/main/java/com/example/demo/util/StringUtil.java | 7ae9fad0c9a55bf0fdb0833b008f43ad88b09910 | [] | no_license | llllb/s33 | cc313056aa3f087486342888a97fdc0c6063b9a7 | e7d6f8335fb251964450aacfc12314eb4e47b519 | refs/heads/master | 2020-04-09T10:31:02.921894 | 2019-10-08T11:03:19 | 2019-10-08T11:03:19 | 160,273,502 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 171 | java | package com.example.demo.util;
public class StringUtil {
public static void main(String[] args) {
int a =6;
System.out.println("(java)"+a+6);
}
}
| [
"lbf_x@outlook.com"
] | lbf_x@outlook.com |
878965311914b3fd776bb032d059d6648a04fe6c | b7ba4cd2d83ce7c47f3472bbb2dbe13b278ce45b | /Punto/Punto.java | d71c212ab4c847a29ec954730f3e6b2d1b778bd6 | [] | no_license | csr/Prog2-Java | 2934f1ac5821c55107a800f0cf9314460047792e | 2252c93cd4e274467aa5ad419ab1e23d4f6618fe | refs/heads/master | 2021-04-06T00:33:52.809629 | 2018-04-06T07:19:44 | 2018-04-06T07:19:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 124 | java | public class Punto {
public int x;
public int y;
// init
public Punto(int x, int y) {
this.x = x;
this.y = y;
}
}
| [
"contact@cesare.io"
] | contact@cesare.io |
889b1fde513532760fdf9b1d30fa6c1319fb5049 | 6c71fc1ebc855b8c448274b353a1b7f94ccf5ddf | /src/main/java/com/nokia/iot/connector/NokiaIotConnectorApplication.java | 681d8bbb3173fdedf62e7ceeb594783207ac0706 | [] | no_license | pooja-acharya/nokia-iot-connector | 4600c2dc3cd6b811373af3b3fc7695a8753eb525 | 4eae2ae458f9307a080b6afc112a8ffa3c89ff17 | refs/heads/master | 2020-06-18T01:24:31.416164 | 2017-05-12T03:24:40 | 2017-05-12T03:24:40 | 74,960,573 | 1 | 3 | null | 2017-05-12T03:24:41 | 2016-11-28T10:09:07 | Java | UTF-8 | Java | false | false | 1,101 | java | package com.nokia.iot.connector;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.MessageSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.web.SpringBootServletInitializer;
import org.springframework.context.annotation.PropertySource;
@SuppressWarnings("deprecation")
@SpringBootApplication(exclude = MessageSourceAutoConfiguration.class)
@PropertySource(value = { "file:${CONNECTOR_HOME}/application.properties" })
public class NokiaIotConnectorApplication extends SpringBootServletInitializer{
public static void main(String[] args) {
SpringApplication.run(NokiaIotConnectorApplication.class, args);
}
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(nokiaIotConnectorApplication);
}
private static Class<NokiaIotConnectorApplication> nokiaIotConnectorApplication = NokiaIotConnectorApplication.class;
}
| [
"pooja_b_j.acharya@nokia.com"
] | pooja_b_j.acharya@nokia.com |
9ea85ba4625bcefa4d9e45cf6ffee6ad2c55ce68 | b70ac3612f9010959afa1b8d47d5539098b96b2e | /backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/validator/network/DetachNetworkUsedByVmValidatorTest.java | 37c1e0b9772ff60769b46f5ec152ee24c42d09ed | [
"Apache-2.0"
] | permissive | yileye/ovirt-engine | 9be4c6fdc0561eca08a393d0612610dfe0fe85ca | 6a4c2913cc934bb5c432e728fadcd6873f8526e0 | refs/heads/master | 2021-01-14T12:05:27.721750 | 2015-11-26T12:30:51 | 2015-11-27T11:22:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,431 | java | package org.ovirt.engine.core.bll.validator.network;
import static org.junit.Assert.assertThat;
import static org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith;
import static org.ovirt.engine.core.utils.ReplacementUtils.replaceWith;
import static org.ovirt.engine.core.utils.linq.LinqUtils.concat;
import java.util.Arrays;
import java.util.List;
import org.junit.Test;
import org.ovirt.engine.core.common.errors.EngineMessage;
public class DetachNetworkUsedByVmValidatorTest {
private static final String NETWORK_A = "networkA";
private static final String NETWORK_B = "networkB";
private static final String VM_A = "vmA";
private static final String VM_B = "vmB";
private DetachNetworkUsedByVmValidator underTest;
@Test
public void testValidateNotRemovingUsedNetworkByVmsSingleNetworkMultipleVms() {
final List<String> vmsNames = Arrays.asList(VM_A, VM_B);
final List<String> removedNetworks = Arrays.asList(NETWORK_A);
underTest = new DetachNetworkUsedByVmValidator(vmsNames, removedNetworks);
assertThat(underTest.validate(),
failsWith(EngineMessage.NETWORK_CANNOT_DETACH_NETWORK_USED_BY_VMS,
concat(replaceWith(DetachNetworkUsedByVmValidator.VAR_VM_NAMES, vmsNames),
replaceWith(DetachNetworkUsedByVmValidator.VAR_NETWORK_NAME, removedNetworks))));
}
@Test
public void testValidateNotRemovingUsedNetworkByVmsSingleNetworkSingleVm() {
final List<String> vmsNames = Arrays.asList(VM_A);
final List<String> removedNetworks = Arrays.asList(NETWORK_A);
underTest = new DetachNetworkUsedByVmValidator(vmsNames, removedNetworks);
assertThat(underTest.validate(),
failsWith(EngineMessage.NETWORK_CANNOT_DETACH_NETWORK_USED_BY_SINGLE_VM,
concat(replaceWith(DetachNetworkUsedByVmValidator.VAR_VM_NAME, vmsNames),
replaceWith(DetachNetworkUsedByVmValidator.VAR_NETWORK_NAME, removedNetworks))));
}
@Test
public void testValidateNotRemovingUsedNetworkByVmsMultipleNetworkSingleVm() {
final List<String> vmsNames = Arrays.asList(VM_A);
final List<String> removedNetworks = Arrays.asList(NETWORK_A, NETWORK_B);
underTest = new DetachNetworkUsedByVmValidator(vmsNames, removedNetworks);
assertThat(underTest.validate(),
failsWith(EngineMessage.MULTIPLE_NETWORKS_CANNOT_DETACH_NETWORKS_USED_BY_SINGLE_VM,
concat(replaceWith(DetachNetworkUsedByVmValidator.VAR_NETWORK_NAMES, removedNetworks),
replaceWith(DetachNetworkUsedByVmValidator.VAR_VM_NAME, vmsNames))));
}
@Test
public void testValidateNotRemovingUsedNetworkByVmsMultipleNetworkMultipleVm() {
final List<String> vmsNames = Arrays.asList(VM_A, VM_B);
final List<String> removedNetworks = Arrays.asList(NETWORK_A, NETWORK_B);
underTest = new DetachNetworkUsedByVmValidator(vmsNames, removedNetworks);
assertThat(underTest.validate(),
failsWith(EngineMessage.MULTIPLE_NETWORKS_CANNOT_DETACH_NETWORKS_USED_BY_VMS,
concat(replaceWith(DetachNetworkUsedByVmValidator.VAR_NETWORK_NAMES, removedNetworks),
replaceWith(DetachNetworkUsedByVmValidator.VAR_VM_NAMES, vmsNames))));
}
}
| [
"alkaplan@redhat.com"
] | alkaplan@redhat.com |
985d76906114aab24da692e604146b6b9e82459d | e78a307feb617e7244130a6c0ccdd1f7a911ffde | /app/src/main/java/se/kjellstrand/tlmfruits/model/PostEntry.java | fd806fb8d7ced05e9c6f9e0b1a3bfc6b6eaa2ed7 | [
"MIT"
] | permissive | carlemil/TMLMyFruitsDiary | 7629f21e0aec3d55779f858b637ff25d1644bf5c | a20e24b27da170c7cc6ad67afa71294f681d208a | refs/heads/master | 2021-05-09T13:56:57.342432 | 2018-02-07T08:04:03 | 2018-02-07T08:04:03 | 119,052,119 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 237 | java | package se.kjellstrand.tlmfruits.model;
import android.util.Log;
public class PostEntry {
public String date;
public PostEntry(String date) {
Log.d("TAG", "New entry, date :" + date);
this.date = date;
}
}
| [
"erbsman@gmail.com"
] | erbsman@gmail.com |
f85367d3cba73d922725d8584fee150076411bce | 47a7b9bdd124c94177e04294a76db3b41f094ad2 | /OhHa/src/maps/Map.java | 8b32d6397f106896d1225625fb1d01f1794a7812 | [] | no_license | Sonopa/OhHa | f04d378ba493bf5d41e9eed8e50041a33049c60c | d1b7d8345acef85c2ee640bc21c98161e391ee4e | refs/heads/master | 2021-01-18T21:33:28.133033 | 2013-02-22T17:14:08 | 2013-02-22T17:14:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 574 | java | package maps;
import Characters.Monster;
import javax.swing.ImageIcon;
/**
* A map represents a level in the game. Has background image and a monster.
*/
public class Map {
private Monster monster;
private ImageIcon bg;
public Map(String mapImagePath, Monster monster) {
this.monster = monster;
bg = new ImageIcon(this.getClass().getClassLoader().getResource(mapImagePath));
}
public ImageIcon getMapImage() {
return bg;
}
public Monster getMonster() {
return monster;
}
}
| [
"juzax@hotmail.com"
] | juzax@hotmail.com |
292ebdb257b127b066b44dcb8e5808bc543cd724 | ab8559234044fc0af913bd55ce61e85f0c1494c2 | /src/main/java/com/ira/domain/Document.java | 061da7f674628b9dd133775a460c7fc8250207d2 | [] | no_license | IrynaSribna/DAOPattern | cfe4b67d602b564e59179abf5a6cb10d13b23118 | 87a82a2d5e5590296fdbdbbc6cca35a3ffaed7e0 | refs/heads/master | 2021-01-21T17:45:56.811877 | 2015-02-17T22:53:04 | 2015-02-17T22:53:04 | 30,890,547 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,034 | java | package com.ira.domain;
import javax.persistence.*;
import java.io.Serializable;
/**
* Created by Iryna on 2/13/15.
*/
@Entity
public class Document implements Serializable{
@Id
@GeneratedValue(strategy = GenerationType.TABLE)
private Integer id;
private String text;
public Document() {
}
public Document(Integer id, String text) {
this.id = id;
this.text = text;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
// public DocumentTransfer getDocumentTransferObject() {
// DocumentTransfer documentTransfer = new DocumentTransfer();
// documentTransfer.setId(id);
// documentTransfer.setText(text);
//
// return documentTransfer;
// }
public String toString() {
return "Document: " + id + "\n " + "Content: " + text;
}
}
| [
"mail@ydrozdov.com"
] | mail@ydrozdov.com |
709fec694aa8c467ff97c2a8c121bb5ae203a612 | ffd74607d689051d59c7cc7738d2f158a7dc74cd | /cat/src/main/java/com/zhr/cat/tools/http/HttpFailException.java | e62e371f02d2d79d3a996abdb7d932cf4ed9794a | [] | no_license | devopsmi/Cat | de8b52ec53d9b0c37b89c800a1eb5124b58bb44d | 56effd73384ac84fa8e88bc118bdaadf46a5c7a3 | refs/heads/master | 2020-03-11T20:30:14.832656 | 2018-04-19T04:03:24 | 2018-04-19T04:03:24 | 130,238,004 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 795 | java | package com.zhr.cat.tools.http;
public class HttpFailException extends Exception {
private static final long serialVersionUID = 4221854073649050758L;
private long executeTime;
private HttpCode code;
public HttpFailException(String msg) {
super(msg);
this.code=new HttpCode(-100);
}
public HttpFailException(int code, long executeTime) {
this.code=new HttpCode(code);
this.executeTime = executeTime;
}
public HttpFailException(int code, long executeTime, Throwable e) {
this.code=new HttpCode(code);
this.executeTime = executeTime;
this.setStackTrace(e.getStackTrace());
}
public long getExecuteTime() {
return executeTime;
}
public void setExecuteTime(long executeTime) {
this.executeTime = executeTime;
}
public HttpCode getCode() {
return code;
}
}
| [
"997075081@qq.com"
] | 997075081@qq.com |
c12bb0d9ee1b1239d1b0b5a2d0974ce5711cf133 | 01f75b0e018c144649154016dc372c4504414a13 | /src/test/java/endPoint/PetEndpoint.java | 667ab6124c082deb74a5c2ed3252496acc7d0f26 | [] | no_license | mgladchenko/petstore-api | 553678ff807383e187d6ab43fd024242b7fc13dd | 1a3365370460b150e57e492b39ca80aeb9d135a8 | refs/heads/master | 2021-03-07T12:19:58.978912 | 2020-05-07T08:47:51 | 2020-05-07T08:47:51 | 246,265,720 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,942 | java | package endPoint;
import io.restassured.filter.log.LogDetail;
import io.restassured.filter.log.RequestLoggingFilter;
import io.restassured.filter.log.ResponseLoggingFilter;
import io.restassured.http.ContentType;
import io.restassured.response.ValidatableResponse;
import io.restassured.specification.RequestSpecification;
import model.Pet;
import model.Status;
import net.serenitybdd.rest.SerenityRest;
import net.thucydides.core.annotations.Step;
import java.io.File;
import static org.apache.http.HttpStatus.SC_OK;
import static org.hamcrest.CoreMatchers.*;
public class PetEndpoint {
private final static String CREATE_PET = "/pet";
private final static String GET_PET_BY_ID = "/pet/{id}";
private final static String GET_PET_BY_STATUS = "/pet/findByStatus";
private final static String DELETE_PET_BY_ID = "/pet/{id}";
private final static String UPLOAD_IMAGE = "/pet/{petId}/uploadImage";
static {
SerenityRest.filters(new RequestLoggingFilter(LogDetail.ALL));
SerenityRest.filters(new ResponseLoggingFilter(LogDetail.ALL));
}
private RequestSpecification given() {
return SerenityRest
.given()
.baseUri("https://petstore.swagger.io/v2")
.contentType(ContentType.JSON);
}
@Step
public ValidatableResponse createPet(Pet pet) {
return given()
.body(pet)
.when()
.post(CREATE_PET)
.then()
.statusCode(SC_OK);
}
@Step
public ValidatableResponse getPet(long petId) {
return given()
.when()
.get(GET_PET_BY_ID, petId)
.then()
.body("id", is(petId))
.statusCode(SC_OK);
}
@Step
public ValidatableResponse getPetByStatus(Status status) {
return given()
.when()
.param("status", status)
.get(GET_PET_BY_STATUS)
.then()
.body("status", everyItem(equalTo(status.toString())))
.statusCode(SC_OK);
}
@Step
public ValidatableResponse deletePet(long petId) {
return given()
.when()
.delete(DELETE_PET_BY_ID, petId)
.then()
.body("message", is(String.valueOf(petId)))
.statusCode(SC_OK);
}
@Step
public ValidatableResponse uploadImage(long petId, String fileName) {
File file = new File(getClass().getClassLoader().getResource(fileName).getFile());
return given()
.contentType("multipart/form-data")
.multiPart(file)
.when()
.post(UPLOAD_IMAGE, petId)
.then()
.body("message", allOf(containsString("File uploaded"), containsString(file.getName())))
.statusCode(SC_OK);
}
}
| [
"mykola.gladchenko@gmail.com"
] | mykola.gladchenko@gmail.com |
f7b1ebb22bda63d28ca650299d1e7785c9b76f34 | 0689f3b456ddce965659abcd4d2de68903de59a1 | /src/main/java/com/example/jooq/demo_jooq/introduction/db/pg_catalog/routines/PgCurrentLogfile2.java | 03627d4f599be1fb25023022370ffd122aa3576e | [] | no_license | vic0692/demo_spring_jooq | c92d2d188bbbb4aa851adab5cc301d1051c2f209 | a5c1fd1cb915f313f40e6f4404fdc894fffc8e70 | refs/heads/master | 2022-09-18T09:38:30.362573 | 2020-01-23T17:09:40 | 2020-01-23T17:09:40 | 220,638,715 | 0 | 0 | null | 2022-09-08T01:04:47 | 2019-11-09T12:25:46 | Java | UTF-8 | Java | false | true | 1,820 | java | /*
* This file is generated by jOOQ.
*/
package com.example.jooq.demo_jooq.introduction.db.pg_catalog.routines;
import com.example.jooq.demo_jooq.introduction.db.pg_catalog.PgCatalog;
import javax.annotation.Generated;
import org.jooq.Field;
import org.jooq.Parameter;
import org.jooq.impl.AbstractRoutine;
import org.jooq.impl.Internal;
/**
* This class is generated by jOOQ.
*/
@Generated(
value = {
"http://www.jooq.org",
"jOOQ version:3.12.3"
},
comments = "This class is generated by jOOQ"
)
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class PgCurrentLogfile2 extends AbstractRoutine<String> {
private static final long serialVersionUID = -1614379793;
/**
* The parameter <code>pg_catalog.pg_current_logfile.RETURN_VALUE</code>.
*/
public static final Parameter<String> RETURN_VALUE = Internal.createParameter("RETURN_VALUE", org.jooq.impl.SQLDataType.CLOB, false, false);
/**
* The parameter <code>pg_catalog.pg_current_logfile._1</code>.
*/
public static final Parameter<String> _1 = Internal.createParameter("_1", org.jooq.impl.SQLDataType.CLOB, false, true);
/**
* Create a new routine call instance
*/
public PgCurrentLogfile2() {
super("pg_current_logfile", PgCatalog.PG_CATALOG, org.jooq.impl.SQLDataType.CLOB);
setReturnParameter(RETURN_VALUE);
addInParameter(_1);
setOverloaded(true);
}
/**
* Set the <code>_1</code> parameter IN value to the routine
*/
public void set__1(String value) {
setValue(_1, value);
}
/**
* Set the <code>_1</code> parameter to the function to be used with a {@link org.jooq.Select} statement
*/
public void set__1(Field<String> field) {
setField(_1, field);
}
}
| [
"vic0692@gmail.com"
] | vic0692@gmail.com |
584bbada434a7933e5db3b0d8837262505fcde1a | 5d1a4c1e3829c1109dc821ecf611b6acca66c687 | /src/test/java/ch02/realm/MyRealm2.java | 6ebf2ab44c8c6c3d5907b5aecdfcb333a7348da6 | [] | no_license | asaunoopouso/shiro | 9e356e1fc3e94bdbfbcaeaa67bbdd62d6ded18d2 | 6362a82d7e456b9ab86c9e1303c5fa1ddc76d41e | refs/heads/master | 2023-04-22T08:12:23.751043 | 2021-04-19T22:23:35 | 2021-04-19T22:23:35 | 363,435,137 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,164 | java | package ch02.realm;
import org.apache.shiro.authc.*;
import org.apache.shiro.realm.Realm;
/**
* <p>User: Zhang Kaitao
* <p>Date: 14-1-25
* <p>Version: 1.0
*/
public class MyRealm2 implements Realm {
@Override
public String getName() {
return "myrealm2";
}
@Override
public boolean supports(AuthenticationToken token) {
return token instanceof UsernamePasswordToken; //仅支持UsernamePasswordToken类型的Token
}
@Override
public AuthenticationInfo getAuthenticationInfo(AuthenticationToken token) throws AuthenticationException {
String username = (String)token.getPrincipal(); //得到用户名
String password = new String((char[])token.getCredentials()); //得到密码
if(!"wang".equals(username)) {
throw new UnknownAccountException(); //如果用户名错误
}
if(!"123".equals(password)) {
throw new IncorrectCredentialsException(); //如果密码错误
}
//如果身份认证验证成功,返回一个AuthenticationInfo实现;
return new SimpleAuthenticationInfo(username, password, getName());
}
}
| [
"liaoyitan91867@126.com"
] | liaoyitan91867@126.com |
11b9e1ba7f014b8bbbcc437274416286fe4203fb | 15d71f806e696b5f983166f09d8db6687327707a | /codes/netbeans/t-1-3-computacion-grafica/src/code3/Main.java | a64505753382d6682617a5c6a651427085848cd5 | [] | no_license | vrebo/TAP-JavaFX | be715402871cea92315d2d2700519f5dde510e59 | 04c62fd2e6e270a1ba0a60cad630bcaf757588e4 | refs/heads/master | 2021-08-07T14:27:45.972593 | 2017-08-14T16:08:01 | 2017-08-14T16:08:01 | 95,041,476 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 810 | 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 code3;
import javafx.application.Application;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
/**
*
* @author vrebo
*/
public class Main extends Application {
private static final int WIDHT = 600;
private static final int HEIGHT = 600;
@Override
public void start(Stage primaryStage) {
Parent root = new RadioactiveSymbol(WIDHT, HEIGHT);
primaryStage.setTitle("Símbolo con paint");
primaryStage.setScene(new Scene(root, WIDHT, HEIGHT));
primaryStage.show();
}
public static void main(String[] args) { launch(args); }
} | [
"vrebo.deg@gmail.com"
] | vrebo.deg@gmail.com |
cdc0c95a9497fb0de9c669621d55f75745f46954 | 6f67b1fb94c5b3dfc7c4b3eb812927b20b7fd7d3 | /app/src/main/java/com/truestbyheart/instr_tool/MainActivity.java | 7b7fd77fa83c3399177f569215d4db65398fc2a2 | [] | no_license | truestbyheart/instr-tool | 2171b7ba224ac9c0b0a94fcd4ffb12f5447592fc | 44356a51343f90d11a78577fd83cc88edc462ba3 | refs/heads/master | 2021-02-15T06:12:46.215685 | 2020-03-04T10:25:04 | 2020-03-04T10:25:04 | 244,870,763 | 0 | 0 | null | 2020-03-06T15:45:43 | 2020-03-04T10:24:30 | Java | UTF-8 | Java | false | false | 342 | java | package com.truestbyheart.instr_tool;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
| [
"margalight@outlook.com"
] | margalight@outlook.com |
6b01a9b0f2a25e7c991321ba0e7c7ce1f96a840c | 8b96417ea286f9b2d3ec7d448e1a31c0ba8d57cb | /samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/listener/shared/ConfirmRemoveMediaListener.java | 9f33715c37ed0731783e96f6335d24990d6394ea | [
"ECL-2.0"
] | permissive | deemsys/Deemsys_Learnguild | d5b11c5d1ad514888f14369b9947582836749883 | 606efcb2cdc2bc6093f914f78befc65ab79d32be | refs/heads/master | 2021-01-15T16:16:12.036004 | 2013-08-13T12:13:45 | 2013-08-13T12:13:45 | 12,083,202 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,831 | java | /**********************************************************************************
* $URL: https://source.sakaiproject.org/svn/sam/tags/samigo-2.9.2/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/listener/shared/ConfirmRemoveMediaListener.java $
* $Id: ConfirmRemoveMediaListener.java 59684 2009-04-03 23:33:27Z arwhyte@umich.edu $
***********************************************************************************
*
* Copyright (c) 2004, 2005, 2006, 2008 The Sakai Foundation
*
* Licensed under the Educational Community License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.osedu.org/licenses/ECL-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.sakaiproject.tool.assessment.ui.listener.shared;
import javax.faces.context.FacesContext;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.ActionEvent;
import javax.faces.event.ActionListener;
import org.sakaiproject.tool.assessment.ui.bean.shared.MediaBean;
import org.sakaiproject.tool.assessment.ui.listener.util.ContextUtil;
/**
* <p>Title: Samigo</p>
* <p>Description: Sakai Assessment Manager</p>
* @author Ed Smiley
* @version $Id: ConfirmRemoveMediaListener.java 59684 2009-04-03 23:33:27Z arwhyte@umich.edu $
*/
public class ConfirmRemoveMediaListener implements ActionListener
{
//private static Log log = LogFactory.getLog(ConfirmRemoveMediaListener.class);
public ConfirmRemoveMediaListener()
{
}
public void processAction(ActionEvent ae) throws AbortProcessingException
{
String mediaId = (String) FacesContext.getCurrentInstance().
getExternalContext().getRequestParameterMap().get("mediaId");
String mediaUrl = (String) FacesContext.getCurrentInstance().
getExternalContext().getRequestParameterMap().get("mediaUrl");
String mediaFilename = (String) FacesContext.getCurrentInstance().
getExternalContext().getRequestParameterMap().get("mediaFilename");
String itemGradingId = (String) FacesContext.getCurrentInstance().
getExternalContext().getRequestParameterMap().get("itemGradingId");
MediaBean mediaBean = (MediaBean) ContextUtil.lookupBean(
"mediaBean");
mediaBean.setMediaId(mediaId);
mediaBean.setMediaUrl(mediaUrl);
mediaBean.setFilename(mediaFilename);
mediaBean.setItemGradingId(Long.valueOf(itemGradingId));
}
}
| [
"sangee1229@gmail.com"
] | sangee1229@gmail.com |
cececdfec1c9ebc43b8253acac57e50d438d5f2b | 0075851b374cc6e54a356b05de45335764b7b924 | /dao/src/main/java/com/epam/training/pas/models/User.java | 0048fdf82a1a1db7b91ad01efe766cb3dcfda870 | [] | no_license | Drazzilblol/exchanger | 52e133e5e18f15506d2483ffe9440918af9c4889 | 5991456f57a9943346e5801d75cb8b8606385afa | refs/heads/master | 2021-01-10T17:07:41.636483 | 2015-11-30T12:26:03 | 2015-11-30T12:26:03 | 46,323,361 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,944 | java | package com.epam.training.pas.models;
/**
* Created by Drazz on 16.11.2015.
*/
public class User {
private Long id;
private String username;
private String password;
private Long userProfileId;
private Boolean isAdmin;
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
User user = (User) o;
if (id != null ? !id.equals(user.id) : user.id != null) return false;
if (username != null ? !username.equals(user.username) : user.username != null) return false;
if (password != null ? !password.equals(user.password) : user.password != null) return false;
return !(userProfileId != null ? !userProfileId.equals(user.userProfileId) : user.userProfileId != null);
}
@Override
public int hashCode() {
int result = id != null ? id.hashCode() : 0;
result = 31 * result + (username != null ? username.hashCode() : 0);
result = 31 * result + (password != null ? password.hashCode() : 0);
result = 31 * result + (userProfileId != null ? userProfileId.hashCode() : 0);
return result;
}
public Long getUserProfileId() {
return userProfileId;
}
public void setUserProfileId(Long userProfileId) {
this.userProfileId = userProfileId;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public Boolean getAdmin() {
return isAdmin;
}
public void setAdmin(Boolean admin) {
isAdmin = admin;
}
}
| [
"paskalj10@gmail.com"
] | paskalj10@gmail.com |
781264794842c21673b5862407a334fc8338b037 | e185d310aa5c5dc797aa43fdee0330bb97d4fced | /src/week6/day1/Node.java | 9b9b179d1f8dbd1f3cbbc01fc4e035fafd8a9973 | [] | no_license | Ligit2/bootcamp | e38f8cb5634c7f4bc554e122d2e81f13b1699121 | 2fc772146e791509004a9996cb12f77c44e59af4 | refs/heads/master | 2023-06-02T19:01:54.466330 | 2021-06-28T09:00:47 | 2021-06-28T09:00:47 | 379,973,047 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 156 | java | package week6.day1;
public class Node<T> {
public T value;
public Node<T> next;
public Node(T value) {
this.value = value;
}
}
| [
"avoyan-lilit@mail.ru"
] | avoyan-lilit@mail.ru |
11b86ab3fecee5da099928e14c53e0c8ee8a6ca3 | 813741ae7a190c5fac83fe4a1a85667ea0721b51 | /mpush-client-java/src/test/java/com/mpush/client/MPushClientTest.java | 7b1f2419200e070debd13e7f0f404f1139c234ef | [] | no_license | sparic/Goor-mrobot | b9584f3212a5a3f21450bd81d949005974370184 | b66eb4df97588ce0119f0658a1e447f7ce5180ba | refs/heads/master | 2020-12-03T04:10:25.445281 | 2017-06-29T06:58:23 | 2017-06-29T06:58:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,780 | java | /*
* (C) Copyright 2015-2016 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.
*
* Contributors:
* ohun@live.cn (夜色)
*/
package com.mpush.client;
import com.mpush.api.Client;
import com.mpush.api.ClientListener;
import com.mpush.api.http.HttpRequest;
import com.mpush.api.http.HttpResponse;
import com.mpush.api.push.PushContext;
import com.mpush.util.DefaultLogger;
import java.io.UnsupportedEncodingException;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
/**
* Created by ohun on 2016/1/25.
*
* @author ohun@live.cn (夜色)
*/
public class MPushClientTest {
private static final String publicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCghPCWCobG8nTD24juwSVataW7iViRxcTkey/B792VZEhuHjQvA3cAJgx2Lv8GnX8NIoShZtoCg3Cx6ecs+VEPD2fBcg2L4JK7xldGpOJ3ONEAyVsLOttXZtNXvyDZRijiErQALMTorcgi79M5uVX9/jMv2Ggb2XAeZhlLD28fHwIDAQAB";
private static final String allocServer = "http://42.159.117.106:9999/";
public static void main(String[] args) throws Exception {
int count = 1;
// String serverHost = "172.16.1.24";
String serverHost = "42.159.117.106";
int sleep = 1000;
if (args != null && args.length > 0) {
count = Integer.parseInt(args[0]);
if (args.length > 1) {
serverHost = args[1];
}
if (args.length > 2) {
sleep = Integer.parseInt(args[1]);
}
}
ScheduledExecutorService scheduledExecutor = Executors.newSingleThreadScheduledExecutor();
ClientListener listener = new L(scheduledExecutor);
Client client = null;
String cacheDir = MPushClientTest.class.getResource("/").getFile();
System.out.println("cacheDircacheDircacheDir=========="+cacheDir);
for (int i = 0; i < count; i++) {
client = ClientConfig
.build()
.setPublicKey(publicKey)
.setAllotServer(allocServer)
// .setServerHost(serverHost)
// .setServerPort(3000)
.setDeviceId("deviceId-test" + i)
.setOsName("android")
.setOsVersion("6.0")
.setClientVersion("2.0")
.setUserId("user-" + i)
.setTags("tag-" + i)
.setSessionStorageDir(cacheDir + i)
.setLogger(new DefaultLogger())
.setLogEnabled(true)
.setEnableHttpProxy(true)
.setClientListener(listener)
.create();
client.start();
Thread.sleep(sleep);
// Future<HttpResponse> su = client.sendHttp(HttpRequest.buildPost("http://172.16.0.154:8080/api/admin/push.json?userId=user-0&content=test111111111111"));
// System.out.println("aaaaaaaa========" +su);
}
}
public static class L implements ClientListener {
private final ScheduledExecutorService scheduledExecutor;
boolean flag = true;
public L(ScheduledExecutorService scheduledExecutor) {
this.scheduledExecutor = scheduledExecutor;
}
@Override
public void onConnected(Client client) {
flag = true;
}
@Override
public void onDisConnected(Client client) {
flag = false;
}
@Override
public void onHandshakeOk(final Client client, final int heartbeat) {
// while (true){
// client.healthCheck();
// try {
// Thread.sleep(10000);
// } catch (InterruptedException e) {
// e.printStackTrace();
// }
// }
scheduledExecutor.scheduleAtFixedRate(new Runnable() {
@Override
public void run() {
int s = 0;
while (true) {
boolean b = client.healthCheck();
if(!b){
client.start();
System.out.println("fastConnect========");
}
System.out.println("发送心跳========" + s+b);
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
e.printStackTrace();
}
s++;
}
}
}, 10, 10, TimeUnit.SECONDS);
// client.push(PushContext.build("test88888888888888888888888888888888888888888888888888888888888888888"));
}
@Override
public void onReceivePush(Client client, byte[] content, int messageId) {
if (messageId > 0) client.ack(messageId);
try {
String s = new String(content, "UTF-8");
System.out.println("sssssssss========"+s+"messageId="+messageId);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
Future<HttpResponse> su = client.sendHttp(HttpRequest.buildPost("http://42.159.117.106:8080/api/admin/push.json?userId=user-1&content=test111111111111"));
// Future<Boolean> su = client.push(PushContext.build("test88888888888888888888888888888888888888888888888888888888888888888"));
System.out.println("aaaaaaaa========" +su);
}
@Override
public void onKickUser(String deviceId, String userId) {
System.out.println("deviceId1========"+deviceId+"userId========="+userId);
}
@Override
public void onBind(boolean success, String userId) {
System.out.println("deviceId2========"+success+"userId========="+userId);
}
@Override
public void onUnbind(boolean success, String userId) {
System.out.println("deviceId3========"+success+"userId========="+userId);
}
}
} | [
"jelynn.tang@mrobot.cn"
] | jelynn.tang@mrobot.cn |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.