blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 332 | content_id stringlengths 40 40 | detected_licenses listlengths 0 50 | license_type stringclasses 2 values | repo_name stringlengths 7 115 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 557 values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 77.7k | fork_events_count int64 0 48k | gha_license_id stringclasses 17 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 82 values | src_encoding stringclasses 28 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 7 5.41M | extension stringclasses 11 values | content stringlengths 7 5.41M | authors listlengths 1 1 | author stringlengths 0 161 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
11e5f8b1274ebaa5a926e1b78438100321c94bb1 | a4f1d2a19fc1d158f27b2db57861443c8b16f5f0 | /source/com/barrybecker4/game/twoplayer/chess/ui/ChessBoardRenderer.java | 3d5d1e0f7d74e3b622d56d88cdb5a74090b694b0 | [
"MIT"
] | permissive | yangboz/bb4-games | 8ca0b58f6c9b468b009174e2a5048ebdc8b12f25 | 6e5cfbe6d502f13d8ca765e9386a3bacc99e920a | refs/heads/master | 2020-12-02T06:38:53.113736 | 2017-06-30T12:15:23 | 2017-06-30T12:15:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,281 | java | /** Copyright by Barry G. Becker, 2000-2011. Licensed under MIT License: http://www.opensource.org/licenses/MIT */
package com.barrybecker4.game.twoplayer.chess.ui;
import com.barrybecker4.game.common.board.Board;
import com.barrybecker4.game.common.player.Player;
import com.barrybecker4.game.common.ui.viewer.GameBoardRenderer;
import com.barrybecker4.game.twoplayer.checkers.ui.CheckersBoardRenderer;
import java.awt.*;
/**
* Singleton class that takes a game board and renders it for the GameBoardViewer.
* Having the board renderer separate from the viewer helps to separate out the rendering logic
* from other features of the GameBoardViewer.
*
* @author Barry Becker
*/
public class ChessBoardRenderer extends CheckersBoardRenderer {
private static GameBoardRenderer renderer_;
/**
* private constructor because this class is a singleton.
* Use getRenderer instead
*/
private ChessBoardRenderer() {
pieceRenderer_ = ChessPieceRenderer.getRenderer();
}
public static GameBoardRenderer getRenderer() {
if (renderer_ == null)
renderer_ = new ChessBoardRenderer();
return renderer_;
}
@Override
protected void drawLastMoveMarker(Graphics2D g2, Player player, Board board) {}
}
| [
"barrybecker4@yahoo.com"
] | barrybecker4@yahoo.com |
317058f66c463246b17e00dc829d0f9887737bb2 | 274581e66d9cadc4cbe855719961ffa425580f2c | /addon/BusinessObjects/trunk/target/generated-sources/xjc/com/f9g4/businessobjects/services/UpdateUserMembershipRequest.java | c90b3447543f8d3df48bafed6219e10aae5ac383 | [] | no_license | Mamata2507/springboot | 1cec4c07ad44b119e21a5515146b73739451bb38 | 3b077d996ead7eda2e64db57741c0d2f11792b92 | refs/heads/master | 2023-03-19T10:01:18.450875 | 2016-12-24T15:53:39 | 2016-12-24T15:53:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,467 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.2-7
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2014.12.20 at 11:56:16 AM EST
//
package com.f9g4.businessobjects.services;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import com.f9g4.businessobjects.domain.AdUsersDomain;
import org.jvnet.jaxb2_commons.lang.CopyStrategy;
import org.jvnet.jaxb2_commons.lang.CopyTo;
import org.jvnet.jaxb2_commons.lang.Equals;
import org.jvnet.jaxb2_commons.lang.EqualsStrategy;
import org.jvnet.jaxb2_commons.lang.HashCode;
import org.jvnet.jaxb2_commons.lang.HashCodeStrategy;
import org.jvnet.jaxb2_commons.lang.JAXBCopyStrategy;
import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy;
import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy;
import org.jvnet.jaxb2_commons.lang.JAXBToStringStrategy;
import org.jvnet.jaxb2_commons.lang.ToString;
import org.jvnet.jaxb2_commons.lang.ToStringStrategy;
import org.jvnet.jaxb2_commons.locator.ObjectLocator;
import org.jvnet.jaxb2_commons.locator.util.LocatorUtils;
/**
* <p>Java class for UpdateUserMembershipRequest complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="UpdateUserMembershipRequest">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="user" type="{http://domain.businessobjects.f9g4.com}adUsersDomain"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "UpdateUserMembershipRequest", propOrder = {
"user"
})
@XmlRootElement(name = "UpdateUserMembershipRequest")
public class UpdateUserMembershipRequest implements Cloneable, CopyTo, Equals, HashCode, ToString
{
@XmlElement(required = true)
protected AdUsersDomain user;
/**
* Default no-arg constructor
*
*/
public UpdateUserMembershipRequest() {
super();
}
/**
* Fully-initialising value constructor
*
*/
public UpdateUserMembershipRequest(final AdUsersDomain user) {
this.user = user;
}
/**
* Gets the value of the user property.
*
* @return
* possible object is
* {@link AdUsersDomain }
*
*/
public AdUsersDomain getUser() {
return user;
}
/**
* Sets the value of the user property.
*
* @param value
* allowed object is
* {@link AdUsersDomain }
*
*/
public void setUser(AdUsersDomain value) {
this.user = value;
}
public String toString() {
final ToStringStrategy strategy = JAXBToStringStrategy.INSTANCE;
final StringBuilder buffer = new StringBuilder();
append(null, buffer, strategy);
return buffer.toString();
}
public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) {
strategy.appendStart(locator, this, buffer);
appendFields(locator, buffer, strategy);
strategy.appendEnd(locator, this, buffer);
return buffer;
}
public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) {
{
AdUsersDomain theUser;
theUser = this.getUser();
strategy.appendField(locator, this, "user", buffer, theUser);
}
return buffer;
}
public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) {
if (!(object instanceof UpdateUserMembershipRequest)) {
return false;
}
if (this == object) {
return true;
}
final UpdateUserMembershipRequest that = ((UpdateUserMembershipRequest) object);
{
AdUsersDomain lhsUser;
lhsUser = this.getUser();
AdUsersDomain rhsUser;
rhsUser = that.getUser();
if (!strategy.equals(LocatorUtils.property(thisLocator, "user", lhsUser), LocatorUtils.property(thatLocator, "user", rhsUser), lhsUser, rhsUser)) {
return false;
}
}
return true;
}
public boolean equals(Object object) {
final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE;
return equals(null, null, object, strategy);
}
public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) {
int currentHashCode = 1;
{
AdUsersDomain theUser;
theUser = this.getUser();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "user", theUser), currentHashCode, theUser);
}
return currentHashCode;
}
public int hashCode() {
final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE;
return this.hashCode(null, strategy);
}
public Object clone() {
return copyTo(createNewInstance());
}
public Object copyTo(Object target) {
final CopyStrategy strategy = JAXBCopyStrategy.INSTANCE;
return copyTo(null, target, strategy);
}
public Object copyTo(ObjectLocator locator, Object target, CopyStrategy strategy) {
final Object draftCopy = ((target == null)?createNewInstance():target);
if (draftCopy instanceof UpdateUserMembershipRequest) {
final UpdateUserMembershipRequest copy = ((UpdateUserMembershipRequest) draftCopy);
if (this.user!= null) {
AdUsersDomain sourceUser;
sourceUser = this.getUser();
AdUsersDomain copyUser = ((AdUsersDomain) strategy.copy(LocatorUtils.property(locator, "user", sourceUser), sourceUser));
copy.setUser(copyUser);
} else {
copy.user = null;
}
}
return draftCopy;
}
public Object createNewInstance() {
return new UpdateUserMembershipRequest();
}
}
| [
"mithun.mohan@mofilm.com"
] | mithun.mohan@mofilm.com |
3ad2d9dd2539e2588556c675fbea1e90bae606db | bcecaebd2eedd977bccc75cd8fb3d59656feba4d | /src/main/java/com/pm/pm/repository/userRepository.java | f3d1e13c9d45315b3fa6636ca1c8629e8a92702b | [] | no_license | charithdilshncb/pmTool | d6b5dbe79068d9f6dfbeb6b71e50e92144f812e2 | a947e40437eb8ca477f5fd07c3ea801e45a5a824 | refs/heads/master | 2023-06-20T16:43:42.674321 | 2021-07-21T04:38:52 | 2021-07-21T04:38:52 | 385,814,631 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 200 | java | package com.pm.pm.repository;
import com.pm.pm.models.User;
import org.springframework.data.repository.CrudRepository;
public interface userRepository extends CrudRepository<User, String> {
}
| [
"38816280+charithdilshncb@users.noreply.github.com"
] | 38816280+charithdilshncb@users.noreply.github.com |
9310d101a784513adc88bca35b161cce30313d38 | 280da3630f692c94472f2c42abd1051fb73d1344 | /src/net/minecraft/network/play/server/S34PacketMaps.java | c0176d1d25a14a1135baa0f2ef02daa567b1b9c4 | [] | no_license | MicrowaveClient/Clarinet | 7c35206c671eb28bc139ee52e503f405a14ccb5b | bd387bc30329e0febb6c1c1b06a836d9013093b5 | refs/heads/master | 2020-04-02T18:47:52.047731 | 2016-07-14T03:21:46 | 2016-07-14T03:21:46 | 63,297,767 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,413 | java | package net.minecraft.network.play.server;
import net.minecraft.network.INetHandler;
import net.minecraft.network.Packet;
import net.minecraft.network.PacketBuffer;
import net.minecraft.network.play.INetHandlerPlayClient;
import net.minecraft.util.Vec4b;
import net.minecraft.world.storage.MapData;
import java.io.IOException;
import java.util.Collection;
public class S34PacketMaps implements Packet {
private int mapId;
private byte mapScale;
private Vec4b[] mapVisiblePlayersVec4b;
private int mapMinX;
private int mapMinY;
private int mapMaxX;
private int mapMaxY;
private byte[] mapDataBytes;
public S34PacketMaps() {
}
public S34PacketMaps(int mapIdIn, byte scale, Collection visiblePlayers, byte[] colors, int minX, int minY, int maxX, int maxY) {
this.mapId = mapIdIn;
this.mapScale = scale;
this.mapVisiblePlayersVec4b = (Vec4b[]) visiblePlayers.toArray(new Vec4b[visiblePlayers.size()]);
this.mapMinX = minX;
this.mapMinY = minY;
this.mapMaxX = maxX;
this.mapMaxY = maxY;
this.mapDataBytes = new byte[maxX * maxY];
for (int var9 = 0; var9 < maxX; ++var9) {
for (int var10 = 0; var10 < maxY; ++var10) {
this.mapDataBytes[var9 + var10 * maxX] = colors[minX + var9 + (minY + var10) * 128];
}
}
}
/**
* Reads the raw packet data from the data stream.
*/
public void readPacketData(PacketBuffer buf) throws IOException {
this.mapId = buf.readVarIntFromBuffer();
this.mapScale = buf.readByte();
this.mapVisiblePlayersVec4b = new Vec4b[buf.readVarIntFromBuffer()];
for (int var2 = 0; var2 < this.mapVisiblePlayersVec4b.length; ++var2) {
short var3 = (short) buf.readByte();
this.mapVisiblePlayersVec4b[var2] = new Vec4b((byte) (var3 >> 4 & 15), buf.readByte(), buf.readByte(), (byte) (var3 & 15));
}
this.mapMaxX = buf.readUnsignedByte();
if (this.mapMaxX > 0) {
this.mapMaxY = buf.readUnsignedByte();
this.mapMinX = buf.readUnsignedByte();
this.mapMinY = buf.readUnsignedByte();
this.mapDataBytes = buf.readByteArray();
}
}
/**
* Writes the raw packet data to the data stream.
*/
public void writePacketData(PacketBuffer buf) throws IOException {
buf.writeVarIntToBuffer(this.mapId);
buf.writeByte(this.mapScale);
buf.writeVarIntToBuffer(this.mapVisiblePlayersVec4b.length);
Vec4b[] var2 = this.mapVisiblePlayersVec4b;
int var3 = var2.length;
for (int var4 = 0; var4 < var3; ++var4) {
Vec4b var5 = var2[var4];
buf.writeByte((var5.func_176110_a() & 15) << 4 | var5.func_176111_d() & 15);
buf.writeByte(var5.func_176112_b());
buf.writeByte(var5.func_176113_c());
}
buf.writeByte(this.mapMaxX);
if (this.mapMaxX > 0) {
buf.writeByte(this.mapMaxY);
buf.writeByte(this.mapMinX);
buf.writeByte(this.mapMinY);
buf.writeByteArray(this.mapDataBytes);
}
}
public void handleClient(INetHandlerPlayClient handler) {
handler.handleMaps(this);
}
public int getMapId() {
return this.mapId;
}
/**
* Sets new MapData from the packet to given MapData param
*/
public void setMapdataTo(MapData mapdataIn) {
mapdataIn.scale = this.mapScale;
mapdataIn.playersVisibleOnMap.clear();
int var2;
for (var2 = 0; var2 < this.mapVisiblePlayersVec4b.length; ++var2) {
Vec4b var3 = this.mapVisiblePlayersVec4b[var2];
mapdataIn.playersVisibleOnMap.put("icon-" + var2, var3);
}
for (var2 = 0; var2 < this.mapMaxX; ++var2) {
for (int var4 = 0; var4 < this.mapMaxY; ++var4) {
mapdataIn.colors[this.mapMinX + var2 + (this.mapMinY + var4) * 128] = this.mapDataBytes[var2 + var4 * this.mapMaxX];
}
}
}
/**
* Passes this Packet on to the NetHandler for processing.
*/
public void processPacket(INetHandler handler) {
this.handleClient((INetHandlerPlayClient) handler);
}
}
| [
"justanormalpcnoghostclientoranyt@justanormalpcnoghostclientoranyt-Aspire-XC-704"
] | justanormalpcnoghostclientoranyt@justanormalpcnoghostclientoranyt-Aspire-XC-704 |
57d9f030d3d5e3ac46e2ea2d5c73dfae8f7a2b67 | 63c449138a661dfdf579b6f2f1c35cc517e04b21 | /app/src/main/java/com/yiyue/store/module/certification/CertificationPresenter.java | 2a4c802e1a8805407cee211114ec5eff63bc0534 | [] | no_license | wuqiuyun/yy_merchant | dd3d915e1fc1e6ac89d77f0081d804cb8a839a11 | 778412b3faef9e69c2314f4931e581fb79eabec3 | refs/heads/master | 2020-04-15T01:28:42.483837 | 2019-01-06T05:24:24 | 2019-01-06T05:24:24 | 164,277,872 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,941 | java | package com.yiyue.store.module.certification;
import android.content.Context;
import com.yiyue.store.api.FileApi;
import com.yiyue.store.api.StoreAuthApplyApi;
import com.yiyue.store.base.data.BaseResponse;
import com.yiyue.store.base.mvp.BasePresenter;
import com.yiyue.store.component.net.YLRxSubscriberHelper;
import com.yiyue.store.component.toast.ToastUtils;
import com.yiyue.store.model.vo.requestbody.StoreAuthApplyRequestBody;
import com.yiyue.store.model.vo.result.UploadImageResult;
import com.yl.core.component.net.exception.ApiException;
import java.util.List;
/**
* Created by lvlong on 2018/9/20.
*/
public class CertificationPresenter extends BasePresenter<ICertificationView> {
/**
* 提交认证信息
* @param requestBody 认证信息
*/
public void submitCertiData(Context context, StoreAuthApplyRequestBody requestBody) {
if (!requestBody.checkParams()) {
return;
}
new StoreAuthApplyApi().save(requestBody, new YLRxSubscriberHelper<BaseResponse>(context, true) {
@Override
public void _onNext(BaseResponse baseResponse) {
getMvpView().onSubmitCertiDataSuccess();
}
});
}
/**
* 上传文件
* @param filePaths 文件地址
*/
public void uploadImage(Context context, List<String> filePaths) {
if (filePaths == null || filePaths.isEmpty()) {
ToastUtils.shortToast("文件不存在");
return;
}
new FileApi().uploadFile(filePaths, new YLRxSubscriberHelper<UploadImageResult>(context, true) {
@Override
public void _onNext(UploadImageResult baseResponse) {
getMvpView().onUploadFileSuccess(baseResponse.getData());
}
@Override
public void _onError(ApiException error) {
super._onError(error);
}
});
}
}
| [
"wuqiuyun_9629@163.com"
] | wuqiuyun_9629@163.com |
49a7db7cfc4ff7165bd7c03261e9bdd03b127f52 | 5b36f60cfaae746331f10a9b37adcce69ff766e2 | /SistemaClientes/src/vista/Menu.java | 8c5a1501f3f058c168f58ff3646196995a288eea | [] | no_license | Alexandra-Aguilar/Sistema_Clientes_aa | 6b6e2e04977055db635aff5f10a7862a8530f1d1 | 2bc63e1690d5190e6aa1486091973baab2d3bf60 | refs/heads/main | 2023-07-11T06:00:48.381590 | 2021-08-11T03:24:08 | 2021-08-11T03:24:08 | 394,829,822 | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 7,131 | java | package vista;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.Scanner;
import modelo.CategoriaEnum;
import modelo.Cliente;
import servicio.ClienteServicio;
import servicio.ExportadorCsv;
import servicio.ExportadorTxt;
public class Menu extends MenuAbs {
private ClienteServicio clienteServicio = new ClienteServicio();
private ExportadorCsv exportarCsv = new ExportadorCsv();
private ExportadorTxt exportarTxt = new ExportadorTxt();
private String fileName = "Clientes";
private String fileName1 = "DBClientes.csv";
private Scanner teclado = new Scanner(System.in);
@Override
public void listarCliente() {
clienteServicio.listarClientes();
}
@Override
public void agregarCliente() {
Cliente client = new Cliente();
System.out.println("----------Crear Cliente----------");
System.out.println("Ingresa RUN del Cliente: ");
client.setRunCliente(teclado.nextLine().trim());
System.out.println("Ingresa Nombre del Cliente: ");
client.setNombreCliente(teclado.nextLine().trim());
System.out.println("Ingresa Apellido del Cliente: ");
client.setApellidoCliente(teclado.nextLine().trim());
System.out.println("Ingresa Años del Cliente: ");
client.setAniosCliente(teclado.nextLine().trim());
client.setNombreCategoria(CategoriaEnum.Activo);
clienteServicio.agregarCliente(client);
}
@Override
public void editarCliente() {
System.out.println("-------------Editar Cliente-------------");
System.out.println("Seleccione qué desea hacer: ");
System.out.println("1.-Cambiar el estado del Cliente");
System.out.println("2.-Editar los datos ingresados del Cliente");
System.out.println("Ingrese opcion: ");
int opcionEditar = Integer.parseInt(teclado.nextLine().trim());
System.out.println("Ingrese RUN del Cliente a editar: ");
String runClienteT = teclado.nextLine().trim();
int posicion = -1, contador = 0;
for (Cliente c: clienteServicio.getListaClientes()) {
if (c.getRunCliente().equals(runClienteT)) {
posicion = contador;
}
contador++;
}
if (posicion >= 0) {
Cliente cEditar = clienteServicio.getListaClientes().get(posicion);
if (opcionEditar == 1) {
System.out.println("\n-----Actualizando estado del Cliente----\n");
if (cEditar.getNombreCategoria().equals(CategoriaEnum.Activo))
cEditar.setNombreCategoria(CategoriaEnum.Inactivo);
else
cEditar.setNombreCategoria(CategoriaEnum.Activo);
System.out.println("El estado del Cliente ha sido modificado.");
}
else if (opcionEditar == 2 ){
System.out.println("\n----Actualizando datos del Cliente-----\n");
System.out.println("1.-El RUN del Cliente es: " + cEditar.getRunCliente());
System.out.println("2.-El Nombre del Cliente es: " + cEditar.getNombreCliente());
System.out.println("3.-El Apellido del Cliente es: " + cEditar.getApellidoCliente());
System.out.println("4.-Los años como Cliente son: " + cEditar.getAniosCliente());
System.out.println("\nIngrese opcion a editar de los datos del cliente: ");
int cliEdit = Integer.parseInt(teclado.nextLine().trim());
switch (cliEdit) {
case 1:
System.out.println("1.-Ingrese nuevo RUN del Cliente: ");
String runNew = teclado.nextLine().trim();
cEditar.setRunCliente(runNew);
break;
case 2:
System.out.println("1.-Ingrese nuevo Nombre del Cliente: ");
String nombreNew = teclado.nextLine().trim();
cEditar.setNombreCliente(nombreNew);
break;
case 3:
System.out.println("1.-Ingrese nuevo Apellido del Cliente: ");
String apellidoNew = teclado.nextLine().trim();
cEditar.setApellidoCliente(apellidoNew);
break;
case 4:
System.out.println("1.-Ingrese nueva cantidad de años como Cliente: ");
String aniosNew = teclado.nextLine().trim();
cEditar.setAniosCliente(aniosNew);
break;
}
System.out.println("Datos cambiados con éxito.");
}
clienteServicio.getListaClientes().set(posicion, cEditar);
}
else {
System.out.println("No se ha encontrado cliente con número RUN asociado " + runClienteT);
}
}
@Override
public void importarDatos() {
System.out.println("\n---------Cargar Datos en Windows---------------\n");
System.out.println("Ingresa la ruta en donde se encuentra el archivo DBClientes.csv: ");
try {
String ubicacion = this.teclado.nextLine().trim();
String ubicacionArchivo = ubicacion + "\\" + this.fileName1;
File archivo = new File(ubicacionArchivo);
FileReader fileR = new FileReader(archivo);
BufferedReader buRed = new BufferedReader(fileR);
clienteServicio.getListaClientes().clear();
String capturaLinea = buRed.readLine();
while (capturaLinea != null ) {
String [] info = capturaLinea.split(",");
if (info.length == 5); {
Cliente registro = new Cliente();
registro.setRunCliente(info[0]);
registro.setNombreCliente(info[1]);
registro.setApellidoCliente(info[2]);
registro.setAniosCliente(info[3]);
CategoriaEnum nombreCategoria;
if (info [4].equals("Activo")); {
nombreCategoria = CategoriaEnum.Activo;
}
registro.setNombreCategoria(nombreCategoria);
clienteServicio.getListaClientes().add(registro);
}
capturaLinea = buRed.readLine();
}
buRed.close();
System.out.println("Los clientes han sido registrados exitosamente.");
}
catch(FileNotFoundException e) {
System.out.println("El archivo no ha sido encontrado.");
System.out.println(e.getMessage());
}
catch(IOException e) {
System.out.println("El archivo no pudo ser leído");
System.out.println(e.getMessage());
}
}
@Override
public void exportarDatos() {
System.out.println("---------Exportar Datos-----------");
System.out.println("Seleccione el formato a exportar: ");
System.out.println("1.-Formato csv");
System.out.println("2.-Formato txt");
System.out.println("\nIngrese una opción para exportar: \n");
System.out.println("----------------------------------");
int opcionExp = Integer.parseInt(this.teclado.nextLine().trim());
if (opcionExp == 1) {
System.out.println("---------Exportar Datos en Windows---------------");
System.out.println("Ingresa la ruta en donde desea exportar el archivo clientes.csv: ");
String rutaExp = this.teclado.nextLine().trim();
String rutaArchivo = rutaExp + "\\" + this.fileName + ".csv";
exportarCsv.exportar(rutaArchivo, this.clienteServicio.getListaClientes());
}
else if (opcionExp == 2) {
System.out.println("---------Exportar Datos en Windows---------------");
System.out.println("Ingresa la ruta en donde desea exportar el archivo clientes.txt: ");
String rutaExp = this.teclado.nextLine().trim();
String rutaArchivo = rutaExp + "\\" + this.fileName + ".txt";
exportarTxt.exportar(rutaArchivo, this.clienteServicio.getListaClientes());
}
}
@Override
public void terminarPrograma() {
}
}
| [
"88462064+Alexandra-Aguilar@users.noreply.github.com"
] | 88462064+Alexandra-Aguilar@users.noreply.github.com |
8cb7fd937eb71eea5c3032d4b94c32c2a2e935f6 | d757cdbc744372fae0b768f7407c7e3e9f6d0190 | /src/ramos_lopez_javierdi/BobEsponja.java | 1416145f273078795f88c25f051f03d781eaf7b8 | [] | no_license | JavierRamoslopez904/RamosLopezJavierDI | 11f7ed3b7ccbec47ded092a26801cc90fb67342a | 984bddc2fa7eb378620290731b0ee360e70bedaa | refs/heads/master | 2023-08-13T22:15:35.682117 | 2021-10-19T18:29:23 | 2021-10-19T18:29:23 | 417,015,605 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,704 | 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 ramos_lopez_javierdi;
import java.applet.AudioClip;
/**
*
* @author javie
*/
public class BobEsponja extends javax.swing.JFrame {
/**
* Creates new form BobEsponja
*/
public BobEsponja() {
initComponents();
setLocationRelativeTo(null);
setTitle("BOB ESPONJA");
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
firstPanel = new javax.swing.JPanel();
secondPanel = new javax.swing.JPanel();
firstLabel1 = new javax.swing.JLabel();
secondLabel1 = new javax.swing.JLabel();
thirdPanel = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
fourthPanel = new javax.swing.JPanel();
compraBoton = new javax.swing.JButton();
fourthutton1 = new javax.swing.JButton();
fifthButton = new javax.swing.JButton();
fifthPanel = new javax.swing.JPanel();
thirdLabel = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
firstPanel.setBackground(new java.awt.Color(255, 255, 0));
secondPanel.setBackground(new java.awt.Color(255, 255, 0));
firstLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/coquito.png"))); // NOI18N
secondPanel.add(firstLabel1);
secondLabel1.setFont(new java.awt.Font("Source Code Pro Black", 1, 48)); // NOI18N
secondLabel1.setForeground(new java.awt.Color(0, 0, 102));
secondLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
secondLabel1.setText("JUGUETERÍA TOBOGÁN");
secondPanel.add(secondLabel1);
thirdPanel.setBackground(new java.awt.Color(255, 255, 0));
thirdPanel.setLayout(new java.awt.GridLayout(4, 1));
jLabel1.setFont(new java.awt.Font("Source Code Pro Black", 1, 36)); // NOI18N
jLabel1.setForeground(new java.awt.Color(0, 0, 153));
jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel1.setText("PRECIO : 43.99€");
thirdPanel.add(jLabel1);
jLabel2.setFont(new java.awt.Font("Source Code Pro Black", 1, 36)); // NOI18N
jLabel2.setForeground(new java.awt.Color(0, 0, 153));
jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel2.setText("DESCRIPCIÓN : Juguete Bob Esponja");
thirdPanel.add(jLabel2);
jLabel3.setFont(new java.awt.Font("Source Code Pro Black", 1, 36)); // NOI18N
jLabel3.setForeground(new java.awt.Color(0, 0, 153));
jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel3.setText("UNIDADES : 4");
thirdPanel.add(jLabel3);
fourthPanel.setBackground(new java.awt.Color(255, 255, 0));
compraBoton.setBackground(new java.awt.Color(51, 255, 0));
compraBoton.setFont(new java.awt.Font("Source Code Pro Black", 1, 36)); // NOI18N
compraBoton.setForeground(new java.awt.Color(0, 0, 102));
compraBoton.setText("COMPRAR");
compraBoton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
compraBotonActionPerformed(evt);
}
});
fourthPanel.add(compraBoton);
fourthutton1.setBackground(new java.awt.Color(51, 255, 0));
fourthutton1.setFont(new java.awt.Font("Source Code Pro Black", 1, 36)); // NOI18N
fourthutton1.setForeground(new java.awt.Color(0, 0, 102));
fourthutton1.setText("VOLVER");
fourthutton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
fourthutton1ActionPerformed(evt);
}
});
fourthPanel.add(fourthutton1);
fifthButton.setBackground(new java.awt.Color(255, 0, 0));
fifthButton.setFont(new java.awt.Font("Source Code Pro Black", 1, 36)); // NOI18N
fifthButton.setForeground(new java.awt.Color(0, 0, 0));
fifthButton.setText(org.openide.util.NbBundle.getMessage(BobEsponja.class, "Vendido.fifthButton.text")); // NOI18N
fifthButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
fifthButtonActionPerformed(evt);
}
});
fourthPanel.add(fifthButton);
fifthPanel.setBackground(new java.awt.Color(255, 255, 0));
thirdLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/bobito-removebg-preview (2).png"))); // NOI18N
fifthPanel.add(thirdLabel);
javax.swing.GroupLayout firstPanelLayout = new javax.swing.GroupLayout(firstPanel);
firstPanel.setLayout(firstPanelLayout);
firstPanelLayout.setHorizontalGroup(
firstPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(firstPanelLayout.createSequentialGroup()
.addContainerGap()
.addGroup(firstPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(fifthPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(fourthPanel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(thirdPanel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 873, Short.MAX_VALUE)
.addComponent(secondPanel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
.addContainerGap())
);
firstPanelLayout.setVerticalGroup(
firstPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(firstPanelLayout.createSequentialGroup()
.addContainerGap()
.addComponent(secondPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 123, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(fifthPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(thirdPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 301, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, Short.MAX_VALUE)
.addComponent(fourthPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(firstPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(firstPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
pack();
}// </editor-fold>//GEN-END:initComponents
/**
* Método que volverá a la página principal
* @param evt
*/
private void fourthutton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fourthutton1ActionPerformed
Bob b = new Bob(this,true);
this.setVisible(false);
b.setVisible(true);
}//GEN-LAST:event_fourthutton1ActionPerformed
private void fifthButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fifthButtonActionPerformed
System.exit(0);
}//GEN-LAST:event_fifthButtonActionPerformed
private void compraBotonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_compraBotonActionPerformed
Formulario f = new Formulario();
this.setVisible(false);
f.setVisible(true);
}//GEN-LAST:event_compraBotonActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(BobEsponja.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(BobEsponja.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(BobEsponja.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(BobEsponja.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new BobEsponja().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton compraBoton;
private javax.swing.JButton fifthButton;
private javax.swing.JPanel fifthPanel;
private javax.swing.JLabel firstLabel1;
private javax.swing.JPanel firstPanel;
private javax.swing.JPanel fourthPanel;
private javax.swing.JButton fourthutton1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel secondLabel1;
private javax.swing.JPanel secondPanel;
private javax.swing.JLabel thirdLabel;
private javax.swing.JPanel thirdPanel;
// End of variables declaration//GEN-END:variables
}
| [
"javier.ramoslopez@nervion.salesianas.org"
] | javier.ramoslopez@nervion.salesianas.org |
1d031304c9fa55fd554a46dc7f02f9c8b9d8dcb1 | 89751e51b6530cfcb5b271d13c686b16db6adce1 | /src/test/java/com/jamerlan/utils/BattleStatusFormerTest.java | 91d07e1e045bb3d1cb4ac2f1afcedcacf95d3708 | [
"BSD-2-Clause"
] | permissive | jamerlan/jSpringLobbyLib | 079cf3eaf1990b772bcb7f66c597a991e6fcc7c8 | e6e8c3595334aee73ee06b25eb7ccde02f93715d | refs/heads/master | 2020-04-05T14:39:03.189096 | 2017-08-12T09:35:46 | 2017-08-12T09:35:46 | 21,741,123 | 1 | 1 | null | 2017-08-12T09:35:47 | 2014-07-11T15:22:31 | Java | UTF-8 | Java | false | false | 1,009 | java | package com.jamerlan.utils;
import org.junit.Test;
/**
* Created by Elt on 25.10.2016.
*/
public class BattleStatusFormerTest {
public static String dec(int a) { return Integer.toString(a, 10); }
public static void main(String[] args) {
int ready = 2;
int teamNo = 60; // 4-32
int ally = 960; // 64-512
int mode = 1024; // 1024
int handicap = 243712; // 2048-131072
int sync = (131072*4*4*2) + (131072*64);
int side = (131072*128) + (131072*254) + (131072*512) + (131072*1024);
String temp = "0" + ready + teamNo + ally + mode + handicap + "0000" + sync + side + "0000";
String status = Integer.toBinaryString(ready+teamNo+ally+mode+handicap+sync+side);
System.out.println(status);
}
@Test
public void test() throws Exception {
int inGame = 1;
int away = 1;
String temp = inGame + away + "00000";
Long l = Long.parseLong(temp, 2);
System.out.println(l);
}
}
| [
"rgetmanzev@gmail.com"
] | rgetmanzev@gmail.com |
17cdf3fa50c286562ef293b74a030f96dbcd31c9 | 287f68163812f66225161e5d9eb29d33681c7952 | /org.springframework.test/src/test/java/org/springframework/test/context/junit4/annotation/DefaultConfigClassesInheritedTestsConfig.java | 359f36a8e2f688aa4dc4be375021ac65f75460e9 | [] | no_license | sirithink/spring-framework | 37a417d07096da28675b375109e52564c79322e1 | 569e6a4c3702f2b6b9ef0f9d894c7b12e4b569cf | refs/heads/master | 2021-01-15T20:08:11.875993 | 2011-06-02T06:50:42 | 2011-06-02T06:50:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,105 | java | /*
* Copyright 2002-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.test.context.junit4.annotation;
import org.springframework.beans.Pet;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* ApplicationContext configuration class for {@link DefaultConfigClassesInheritedTests}.
*
* @author Sam Brannen
* @since 3.1
*/
@Configuration
public class DefaultConfigClassesInheritedTestsConfig {
@Bean
public Pet pet() {
return new Pet("Fido");
}
}
| [
"sam@sambrannen.com"
] | sam@sambrannen.com |
917dd037c420773b7116c873262a2f42de107116 | 305799f4849f7cb7b85c901087b548b3b3ca69e7 | /app/src/main/java/com/example/asmaa/as2/MainActivity.java | 731cbf35f81f6543dd239b9ad050f4bdcccc99aa | [] | no_license | AsmaaMoawad/2_Calculator------ | 2b884e70db503c0816169941bf21686ae454c5f4 | c1546716a200dbf872eddb69c9891080d9d9700d | refs/heads/master | 2020-12-02T11:21:10.261281 | 2017-07-08T16:52:28 | 2017-07-08T16:52:28 | 96,630,978 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,437 | java | package com.example.asmaa.as2;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
TextView show;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
show=(TextView)findViewById(R.id.textView3);
}
public void Click(View view){
String btn_1=((Button)view).getText().toString();
String btn_2=((Button)view).getText().toString();
String btn_3=((Button)view).getText().toString();
String btn_4=((Button)view).getText().toString();
String btn_5=((Button)view).getText().toString();
String btn_6=((Button)view).getText().toString();
String btn_7=((Button)view).getText().toString();
String btn_8=((Button)view).getText().toString();
String btn_9=((Button)view).getText().toString();
String btn_0=((Button)view).getText().toString();
String btn_sum=((Button)view).getText().toString();
String btn_sub=((Button)view).getText().toString();
if(btn_1.equals("1")){
show.append("1");
}
else if(btn_2.equals("2")){
show.append("2");
}
else if(btn_3.equals("3")){
show.append("3");
}
else if(btn_4.equals("4")){
show.append("4");
}
else if(btn_5.equals("5")){
show.append("5");
}
else if(btn_6.equals("6")){
show.append("6");
}
else if(btn_7.equals("7")){
show.append("7");
}
else if(btn_8.equals("8")){
show.append("8");
}
else if(btn_9.equals("9")){
show.append("9");
}
else if(btn_0.equals("0")){
show.append("0");
}
else if(btn_sum.equals("+")){
show.append("+");
}
else if(btn_sub.equals("-")){
show.append("-");
}
}
// public String substring(int startIndex, int endIndex):
public void RES(View view){
String btn_eq=((Button)view).getText().toString();
if(btn_eq.equals("=")){
String input =show.getText().toString();
}
}
}
| [
"asmaa_fcih@yahoo.com"
] | asmaa_fcih@yahoo.com |
baa6de4e43be45baad38e63785574ae61453c26a | 31900f330f60cebb28a34945812a74dc925fe9df | /javaFundamentals/src/javaFundamentals/Studentdemo.java | 16748cb26919c8f762c984a5fdc373cebbdcb920 | [] | no_license | PrathyushaS96/prathyusha1 | d9f3832adc1bd1c7814977255f79af3f44eb504b | 72c42268262e013c67979e246ecbf0dc39535d1f | refs/heads/master | 2020-09-04T22:52:49.965338 | 2020-01-30T05:35:19 | 2020-01-30T05:35:19 | 219,915,833 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 139 | java | package javaFundamentals;
public class Studentdemo {
public static void main(String args[])
{
Student s=new Student();
s.display();
}
}
| [
"raaga.prathyusha@yahoo.com"
] | raaga.prathyusha@yahoo.com |
dda278fb0d30ff7956a61c5ee43367ba7fbacc3f | fd7d4d2578f71120e3f101fc517e4a435afdfb3d | /Proyecto 1/src/main/java/com/xhunik/vista/dialogs/DialogSearchProductos.java | f78468fc2fe5978b6684562c2ce3d5d81ce65003 | [] | no_license | xhuniktzi/IPC1Dic2019 | 137dbff9a8516b9a533f131f770b515d2809061e | 33b7599df100d2a6021c87f4402bd727127a24e3 | refs/heads/master | 2022-09-15T07:11:46.216673 | 2020-01-07T04:42:53 | 2020-01-07T04:42:53 | 225,958,939 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,111 | 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.xhunik.vista.dialogs;
import com.xhunik.controladores.App;
import com.xhunik.internal.ListaProducto;
import com.xhunik.vista.Ventana;
import com.xhunik.vista.VentanaVender;
import com.xhunik.vista.eventsMenu.eventBuscarProducto;
import com.xhunik.vista.eventsMenu.eventRegistrarProductos;
import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JPanel;
/**
*
* @author xhunik
*/
public class DialogSearchProductos extends JDialog{
public DialogSearchProductos() {
super(eventRegistrarProductos.ventanaRegistro);
setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
setSize(260,360);
Container content = getContentPane();
JPanel panelBoton = new JPanel();
panelBoton.setLayout(new FlowLayout(FlowLayout.RIGHT));
content.add(panelBoton,BorderLayout.SOUTH);
JButton boton = new JButton("Aceptar");
boton.addActionListener(new actionCerrarSearchProductos());
panelBoton.add(boton);
JPanel panelContent = new JPanel();
panelContent.setLayout(new BoxLayout(panelContent, BoxLayout.Y_AXIS));
content.add(panelContent,BorderLayout.CENTER);
ListaProducto resultadosBusqueda = App.control.getGestor().getProductosDisponibles().searchProductosByNombre(VentanaVender.fieldBuscar.getText());
for (int i = 0; i < resultadosBusqueda.getSize(); i++){
panelContent.add(new botonProductoDialog(resultadosBusqueda.getProductoByIndex(i).getId()));
}
addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e){
VentanaVender.flagDialog = false;
dispose();
}
});
}
}
class botonProductoDialog extends JButton {
public botonProductoDialog(int id){
super(App.control.getGestor().getProductosDisponibles().searchProductoByID(id).getNombre());
addActionListener(new eventoPulsarBotonDialog(id));
}
}
class eventoPulsarBotonDialog implements ActionListener{
int id;
public eventoPulsarBotonDialog(int id){
this.id = id;
}
@Override
public void actionPerformed(ActionEvent ae) {
App.control.executeSellById(id);
Ventana.cantidadGanancias.setText(String.valueOf(App.control.getDinero()));
}
}
class actionCerrarSearchProductos implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) {
eventBuscarProducto.dialog.dispose();
VentanaVender.flagDialog = false;
}
} | [
"xhuniktzi@gmail.com"
] | xhuniktzi@gmail.com |
da6806e7aefc482f454b5ee0849bcfb39c7450a9 | 647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4 | /com.tencent.mm/classes.jar/com/tencent/mm/plugin/wallet/pwd/b.java | 381d5597922de54728ccbaa2b5912cbd8358df91 | [] | no_license | tsuzcx/qq_apk | 0d5e792c3c7351ab781957bac465c55c505caf61 | afe46ef5640d0ba6850cdefd3c11badbd725a3f6 | refs/heads/main | 2022-07-02T10:32:11.651957 | 2022-02-01T12:41:38 | 2022-02-01T12:41:38 | 453,860,108 | 36 | 9 | null | 2022-01-31T09:46:26 | 2022-01-31T02:43:22 | Java | UTF-8 | Java | false | false | 7,528 | java | package com.tencent.mm.plugin.wallet.pwd;
import android.app.Activity;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.os.Bundle;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.plugin.wallet.pwd.ui.WalletResetPwdAdapterUI;
import com.tencent.mm.plugin.wallet_core.c.x;
import com.tencent.mm.plugin.wallet_core.model.w;
import com.tencent.mm.plugin.wallet_core.ui.WalletCheckPwdUI;
import com.tencent.mm.plugin.wallet_core.ui.WalletPwdConfirmUI;
import com.tencent.mm.plugin.wallet_core.ui.WalletSetPasswordUI;
import com.tencent.mm.plugin.wxpay.a.i;
import com.tencent.mm.sdk.platformtools.Log;
import com.tencent.mm.ui.MMActivity;
import com.tencent.mm.ui.base.k;
import com.tencent.mm.wallet_core.c.g;
import com.tencent.mm.wallet_core.c.i;
import com.tencent.mm.wallet_core.e;
import com.tencent.mm.wallet_core.ui.WalletBaseUI;
public class b
extends e
{
public final int a(MMActivity paramMMActivity, int paramInt)
{
return a.i.wallet_set_password_finish_confirm;
}
public final g a(MMActivity paramMMActivity, i parami)
{
AppMethodBeat.i(69520);
if ((paramMMActivity instanceof WalletCheckPwdUI))
{
paramMMActivity = new g(paramMMActivity, parami)
{
public final CharSequence getTips(int paramAnonymousInt)
{
AppMethodBeat.i(69511);
switch (paramAnonymousInt)
{
default:
localObject = super.getTips(paramAnonymousInt);
AppMethodBeat.o(69511);
return localObject;
case 0:
localObject = this.activity.getString(a.i.wallet_check_pwd_modify_pwd_tip);
AppMethodBeat.o(69511);
return localObject;
}
Object localObject = this.activity.getString(a.i.wallet_password_setting_ui_modify);
AppMethodBeat.o(69511);
return localObject;
}
public final boolean onSceneEnd(int paramAnonymousInt1, int paramAnonymousInt2, String paramAnonymousString, com.tencent.mm.am.p paramAnonymousp)
{
return false;
}
public final boolean t(Object... paramAnonymousVarArgs)
{
AppMethodBeat.i(69510);
String str = (String)paramAnonymousVarArgs[0];
paramAnonymousVarArgs = (String)paramAnonymousVarArgs[1];
this.agTR.a(new x(str, 3, paramAnonymousVarArgs), true, 1);
AppMethodBeat.o(69510);
return true;
}
};
AppMethodBeat.o(69520);
return paramMMActivity;
}
if ((paramMMActivity instanceof WalletPwdConfirmUI))
{
paramMMActivity = new g(paramMMActivity, parami)
{
public final boolean onSceneEnd(int paramAnonymousInt1, int paramAnonymousInt2, String paramAnonymousString, com.tencent.mm.am.p paramAnonymousp)
{
AppMethodBeat.i(69513);
if ((paramAnonymousInt1 == 0) && (paramAnonymousInt2 == 0))
{
if ((paramAnonymousp instanceof com.tencent.mm.plugin.wallet.pwd.a.p))
{
b.a(b.this).putInt("RESET_PWD_USER_ACTION", 1);
b.this.a(this.activity, 0, b.b(b.this));
k.cZ(this.activity, this.activity.getString(a.i.wallet_password_setting_success_tip));
}
AppMethodBeat.o(69513);
return true;
}
if ((paramAnonymousp instanceof com.tencent.mm.plugin.wallet.pwd.a.p))
{
k.a(this.activity, paramAnonymousString, "", false, new DialogInterface.OnClickListener()
{
public final void onClick(DialogInterface paramAnonymous2DialogInterface, int paramAnonymous2Int)
{
AppMethodBeat.i(69512);
b.c(b.this).putInt("RESET_PWD_USER_ACTION", 2);
b.this.a(b.2.a(b.2.this), 0, b.d(b.this));
AppMethodBeat.o(69512);
}
});
AppMethodBeat.o(69513);
return true;
}
AppMethodBeat.o(69513);
return false;
}
public final boolean t(Object... paramAnonymousVarArgs)
{
AppMethodBeat.i(69514);
paramAnonymousVarArgs = (w)paramAnonymousVarArgs[0];
b.e(b.this).getString("key_pwd1");
this.agTR.a(new com.tencent.mm.plugin.wallet.pwd.a.p(paramAnonymousVarArgs.pRM, paramAnonymousVarArgs.token), true, 1);
AppMethodBeat.o(69514);
return true;
}
};
AppMethodBeat.o(69520);
return paramMMActivity;
}
paramMMActivity = super.a(paramMMActivity, parami);
AppMethodBeat.o(69520);
return paramMMActivity;
}
public final e a(Activity paramActivity, Bundle paramBundle)
{
AppMethodBeat.i(69516);
Log.d("MicroMsg.ResetPwdProcessByToken", "start Process : ResetPwdProcessByToken");
b(paramActivity, WalletSetPasswordUI.class, paramBundle);
AppMethodBeat.o(69516);
return this;
}
public final void a(Activity paramActivity, int paramInt, Bundle paramBundle)
{
AppMethodBeat.i(69517);
if ((paramActivity instanceof WalletSetPasswordUI))
{
b(paramActivity, WalletPwdConfirmUI.class, paramBundle);
AppMethodBeat.o(69517);
return;
}
if ((paramActivity instanceof WalletPwdConfirmUI)) {
b(paramActivity, paramBundle);
}
AppMethodBeat.o(69517);
}
public final boolean a(final WalletBaseUI paramWalletBaseUI, int paramInt, String paramString)
{
AppMethodBeat.i(69521);
switch (paramInt)
{
default:
AppMethodBeat.o(69521);
return false;
}
k.a(paramWalletBaseUI, paramString, null, paramWalletBaseUI.getString(a.i.wallet_set_password_finish_confirm), false, new DialogInterface.OnClickListener()
{
public final void onClick(DialogInterface paramAnonymousDialogInterface, int paramAnonymousInt)
{
AppMethodBeat.i(69515);
b.this.b(paramWalletBaseUI, b.f(b.this));
if (paramWalletBaseUI.isTransparent()) {
paramWalletBaseUI.finish();
}
paramWalletBaseUI.clearErr();
AppMethodBeat.o(69515);
}
});
AppMethodBeat.o(69521);
return true;
}
public final void b(Activity paramActivity, Bundle paramBundle)
{
AppMethodBeat.i(69519);
Intent localIntent = new Intent(paramActivity, WalletResetPwdAdapterUI.class);
localIntent.putExtra("RESET_PWD_USER_ACTION", paramBundle.getInt("RESET_PWD_USER_ACTION", 0));
a(paramActivity, WalletResetPwdAdapterUI.class, -1, localIntent, false);
AppMethodBeat.o(69519);
}
public final boolean c(Activity paramActivity, Bundle paramBundle)
{
return false;
}
public final String fud()
{
return "ResetPwdProcessByToken";
}
public final void i(Activity paramActivity, int paramInt)
{
AppMethodBeat.i(69518);
if ((paramActivity instanceof WalletPwdConfirmUI)) {
a(paramActivity, WalletSetPasswordUI.class, paramInt);
}
AppMethodBeat.o(69518);
}
}
/* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes5.jar
* Qualified Name: com.tencent.mm.plugin.wallet.pwd.b
* JD-Core Version: 0.7.0.1
*/ | [
"98632993+tsuzcx@users.noreply.github.com"
] | 98632993+tsuzcx@users.noreply.github.com |
644932794573b351e77512ac46004a8a2ad1f3a1 | 3290ad2354c8870e634a47f6396a45780f0da307 | /gui/Demo5.java | 66d8bc6e96e04769f0c31a9a6d457e38e2534389 | [] | no_license | WandererM31/Java_learning | 1e544288f17057a4b489fc8dcaf54435203de797 | d2c9ec8233ad52933c9204144121ae90e83f6761 | refs/heads/master | 2020-03-18T23:08:21.105535 | 2018-07-06T02:42:04 | 2018-07-06T02:42:04 | 135,384,973 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 1,568 | java | //swing几个常用组件 实现一个登录系统界面,文本框密码框标签组
//第31讲第一个案例
/*同一个组件不能同时被添加两次,第二次会覆盖第一次,第一次添加位置消失了
*
*/
package gui;
import java.awt.*;
import javax.swing.*;
public class Demo5 extends JFrame{
//定义组件
JPanel jp1,jp2,jp3;
JLabel jlb1,jlb2; //标签文本
JButton jb1,jb2; //按钮
JTextField jtf1,jtf2;//文本框
JPasswordField jps; //密码框区别文本框在于输入字符后是加密状态
public static void main(String[] args) {
// TODO Auto-generated method stub
Demo5 aa = new Demo5();
}
public Demo5() {
//创建组件
jp1 = new JPanel();
jp2 = new JPanel();
jp3 = new JPanel();
jlb1 = new JLabel("用户名");
jlb2 = new JLabel("密 码");
jb1 = new JButton("确认");
jb2 = new JButton("取消");
jtf1 = new JTextField(10); //指定长度
jtf2 = new JTextField(10);
jps = new JPasswordField(10);
jp1.add(jlb1);
jp1.add(jtf1);
jp2.add(jlb2);
jp2.add(jps);
jp3.add(jb1);
jp3.add(jb2);
this.add(jp1);
this.add(jp2);
this.add(jp3);
//设置布局管理器为网格布局
this.setLayout(new GridLayout(3,1,4,4));
//设置窗体属性
this.setTitle("网格布局");
this.setSize(300, 200);//大小,像素
this.setLocation(200, 200);//位置
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);//关闭窗口时退出jvm
this.setResizable(false);
//显示窗体
this.setVisible(true);
}
}
| [
"39149657+WandererM31@users.noreply.github.com"
] | 39149657+WandererM31@users.noreply.github.com |
6f7b822da7bbe65a8ad2c38c649043aadfb73d56 | 647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4 | /com.tencent.mm/classes.jar/com/tencent/mm/live/model/d/a$a$$ExternalSyntheticLambda5.java | 3b458df88c00bb9cae19e86dc5d0cfa970af296c | [] | no_license | tsuzcx/qq_apk | 0d5e792c3c7351ab781957bac465c55c505caf61 | afe46ef5640d0ba6850cdefd3c11badbd725a3f6 | refs/heads/main | 2022-07-02T10:32:11.651957 | 2022-02-01T12:41:38 | 2022-02-01T12:41:38 | 453,860,108 | 36 | 9 | null | 2022-01-31T09:46:26 | 2022-01-31T02:43:22 | Java | UTF-8 | Java | false | false | 356 | java | package com.tencent.mm.live.model.d;
public final class a$a$$ExternalSyntheticLambda5
implements Runnable
{
public final void run() {}
}
/* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes2.jar
* Qualified Name: com.tencent.mm.live.model.d.a.a..ExternalSyntheticLambda5
* JD-Core Version: 0.7.0.1
*/ | [
"98632993+tsuzcx@users.noreply.github.com"
] | 98632993+tsuzcx@users.noreply.github.com |
fe7ad6526b5548034c7b4e83cd4c25a986fb8738 | fa31417019b68b8611510991ae5fbae78266f4b4 | /app/src/main/java/bt/gov/dzongkha/dzongkhaenglishphrasebook/ModalClass/GetDzongkhaPhrases.java | cfe57d6970cf6645f5b5478e73031a9fc29cc45b | [] | no_license | SangayW/DzongkhaPhrasebook | 1bff60e6d7ecfe22835271ab107010b12ac1c9a7 | 4e0187ec7904179cd6eeed1729c3a3bd8fbda9a6 | refs/heads/master | 2020-03-20T12:59:15.767262 | 2018-06-15T11:51:07 | 2018-06-15T11:51:07 | 137,445,676 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 337 | java | package bt.gov.dzongkha.dzongkhaenglishphrasebook.ModalClass;
/**
* Created by sangay on 3/2/2018.
*/
public class GetDzongkhaPhrases {
String dzo_phrases;
public GetDzongkhaPhrases(String dzo_phrases) {
this.dzo_phrases = dzo_phrases;
}
public String getDzo_phrases() {
return dzo_phrases;
}
}
| [
"sanglim2012@gmail.com"
] | sanglim2012@gmail.com |
602a51993d968989f89156adc21b753b6a42f8d6 | bd6f2c41a373238ffe09896feb4dddf575d8eab6 | /collections/ComparatorDemo/SortBySalary.java | 3e5fd22df6223536af4032549906afc24927e7f1 | [] | no_license | ssuniltikoo/test | 0a54a4b3569a26fa384cc4481615e0b650eda773 | 6f87b73324d8d2589dc07045b6e2a2ec9e6e9dda | refs/heads/master | 2021-01-20T08:55:29.484728 | 2018-11-21T01:50:24 | 2018-11-21T01:50:24 | 83,912,005 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 379 | java | package com.training.java.collections.ComparatorDemo;
import java.util.Comparator;
public class SortBySalary implements Comparator<Employee> {
public int compare(Employee obj1, Employee obj2){
if(obj1.salary > obj2.salary)
return 1;
if(obj1.salary < obj2.salary)
return -1;
else
return 0;
}
}
| [
"noreply@github.com"
] | noreply@github.com |
33018db12d044d164c62f92163c7a8802d3471ff | ff0458089876a90c508b9901c2290b17f03b2365 | /src/main/java/com/huang/order/test/MyFunction.java | 1335444bf847b3ffff67d67c454d7f6dc2125978 | [] | no_license | NikHuang/order | 760d1e8415366fc775cff497932590d5403a5429 | f3a750b365f0a23426dcfffd9340a4a39957f725 | refs/heads/master | 2022-07-04T15:40:21.082821 | 2019-12-17T17:23:49 | 2019-12-17T17:23:49 | 220,436,825 | 0 | 0 | null | 2022-06-17T02:38:26 | 2019-11-08T09:50:39 | Java | UTF-8 | Java | false | false | 179 | java | package com.huang.order.test;
/**
* Created by Administrator on 2019/11/25.
*/
@FunctionalInterface
public interface MyFunction {
String stringConvertHandler(String a);
}
| [
"nikhhq@sina.cn"
] | nikhhq@sina.cn |
e85b17c7520ad3deb1e070f269cd646db37b7851 | 803b276f64e368c587afd47ef2e87407baa5ace9 | /Lab03/Problem1/src/Shapes/Triangle.java | 5efbdc2aee36433d0158aa37493116d90da99cbf | [] | no_license | Brandontam29/COMP-249 | 599e2de0e11c0179bff3ee37f8fc0476d072bac1 | 0b2c3223d8a8e8dab2a303fe28037ac086c79ccb | refs/heads/main | 2023-07-14T03:24:40.047032 | 2021-08-23T18:01:31 | 2021-08-23T18:01:31 | 385,775,362 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 653 | java | package Shapes;
public class Triangle extends Shape {
// Data Members
private int angle = 90;
// Constructors
public Triangle() {
}
public Triangle(int w) {
super(w, w);
}
public Triangle(int h, int w) {
super(w, w);
}
// Methods
public void draw() {
System.out.println();
int i, j;
for (i = 1; i < getWidth(); i++) {
for (j = 1; j < i; j++) {
System.out.print(getPattern() + " ");
}
System.out.println("");
}
}
public String toString() {
return getClass() + " => Height: " + getHeight() + " Width: " + getWidth() + " Angle: " + getAngle();
}
// Getters
public int getAngle() {
return angle;
}
}
| [
"brandon.tam29@gmail.com"
] | brandon.tam29@gmail.com |
e06c032413a70ed72bb369a16edc7d10ddd4f948 | ca0309234535d4c12d04272da583909184d0d538 | /src/test/java/org/codehaus/plexus/util/xml/pull/IBMXML10Tests_Test_IBMXMLConformanceTestSuite_validtests_Test_IBMXMLConformanceTestSuite_Production87_Test.java | 139f5033f323f48097a0297f391538679eb896b5 | [
"Apache-2.0"
] | permissive | belingueres/xml-conformance | 909a5c939baaf514dbe8a86f0ee6b52c1cfabfab | 5e6b6381ae0e8b0523ddc1b025542cbd690fc373 | refs/heads/main | 2023-02-20T04:34:37.185111 | 2021-01-24T09:39:47 | 2021-01-24T09:39:47 | 328,228,279 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,053 | java | package org.codehaus.plexus.util.xml.pull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;
import org.junit.Before;
import org.junit.Test;
/**
* Test class that execute a particular set of tests associated to a TESCASES tag from the XML W3C Conformance Tests.
* TESCASES PROFILE: <pre>IBM XML Conformance Test Suite - Production 87</pre>
* XML test files base folder: <pre>xmlconf/ibm/</pre>
*
* @author <a href="mailto:belingueres@gmail.com">Gabriel Belingueres</a>
*/
public class IBMXML10Tests_Test_IBMXMLConformanceTestSuite_validtests_Test_IBMXMLConformanceTestSuite_Production87_Test
{
final static File testResourcesDir = new File("src/test/resources/", "xmlconf/ibm/");
MXParser parser;
@Before
public void setUp()
{
parser = new MXParser();
}
/**
* Test ID: <pre>ibm-valid-P87-ibm87v01.xml</pre>
* Test URI: <pre>valid/P87/ibm87v01.xml</pre>
* Comment: <pre>This test case covers 65 legal character ranges plus 30 single legal characters for CombiningChar in P87 using a PI target Name</pre>
* Sections: <pre>B.</pre>
* Version:
*
* @throws IOException if there is an I/O error
*/
@Test
public void testibm_valid_P87_ibm87v01xml()
throws IOException
{
try( Reader reader = new FileReader( new File( testResourcesDir, "valid/P87/ibm87v01.xml" ) ) )
{
parser.setInput(reader);
while (parser.nextToken() != XmlPullParser.END_DOCUMENT)
;
assertTrue("This test case covers 65 legal character ranges plus 30 single legal characters for CombiningChar in P87 using a PI target Name", true);
}
catch (XmlPullParserException ex)
{
fail("This test case covers 65 legal character ranges plus 30 single legal characters for CombiningChar in P87 using a PI target Name");
}
}
} | [
"belingueres@gmail.com"
] | belingueres@gmail.com |
faa8798b2cd0dc87e0014d17acb8548cfb5872f6 | 7e5f9fc3f5e1e0b5d958ce0cc224ef87880b61d6 | /cloud-config-client-3366/src/main/java/org/dsp/springcloud/ConfigClient3366Application.java | 8966f83ad30ffffa973d786c77e210677aedea98 | [] | no_license | ManMyCode/cloud2020 | c0b2f2a86a0acc32ef0307e9ded0f95775960a79 | b63f3bf8820e70f4f5ecaf1267485062c20606f8 | refs/heads/master | 2022-07-03T09:10:23.419799 | 2020-05-14T17:34:55 | 2020-05-14T17:34:55 | 263,976,678 | 0 | 0 | null | 2020-05-14T17:18:44 | 2020-05-14T17:08:27 | Java | UTF-8 | Java | false | false | 429 | java | package org.dsp.springcloud;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
@SpringBootApplication
@EnableEurekaClient
public class ConfigClient3366Application {
public static void main(String[] args) {
SpringApplication.run(ConfigClient3366Application.class,args);
}
}
| [
"1035113650@qq.com"
] | 1035113650@qq.com |
90153a14f52fa1b1c9cf95d2fb8a331cb6d91b56 | aa6bb8c8a85de9ba85e420e17d6da714f6e1c3e1 | /src/com/crm/product/thread/autorenew/AutoRenewChargingThread.java | 7911c2ce3a8d56f5244fa781f9250fb28d29fe4b | [] | no_license | mrtrung/loyalty | 3f168327e63e50953f4391ee55725c5f24d5db25 | 570f83e3f7453912f24d9ef42e287e3cb7d64d0e | refs/heads/master | 2016-09-06T19:47:23.243925 | 2014-09-23T10:25:26 | 2014-09-23T10:25:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,498 | java | package com.crm.product.thread.autorenew;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.HashMap;
import java.util.Map;
import java.util.Vector;
import com.crm.kernel.message.Constants;
import com.crm.kernel.sql.Database;
import com.crm.provisioning.cache.MQConnection;
import com.crm.provisioning.message.CommandMessage;
import com.crm.thread.DispatcherThread;
import com.crm.thread.util.ThreadUtil;
import com.fss.thread.ParameterType;
import com.fss.util.AppException;
public class AutoRenewChargingThread extends AbtractAutoRenewThread
{
protected int batchSize = 100;
protected String deliveryUser = "";
protected int orderTimeout = 60000;
protected int timeBeetweenLoop = 100;
protected int conditionQueueSize = 100;
protected long conditionDelay = 1000;
protected Vector vtSubscriptionClass = new Vector();
protected Vector vtSchedule = new Vector();
protected String startTime = "";
protected String endTime = "";
protected Map<String, AbstractAutoRenew> mAutoRenewClass = new HashMap<String, AbstractAutoRenew>();
Connection connection = null;
ResultSet rs = null;
protected PreparedStatement stmtSelect = null;
protected PreparedStatement stmtUpdate = null;
protected int fetchSize;
protected String strSQLSelect;
protected String strSQLUpdate = "update DAILYRENEWSERVICES set status = 1 where rowid = ?";
protected boolean checkInsertBatch = false;
protected boolean checkUpdateBatch = false;
protected boolean bCheckSchedule = false;
public AutoRenewChargingThread()
{
super();
}
// //////////////////////////////////////////////////////
// Override
// //////////////////////////////////////////////////////
@SuppressWarnings({ "rawtypes", "unchecked" })
public Vector getDispatcherDefinition()
{
Vector vtReturn = new Vector();
vtReturn.addElement(ThreadUtil.createTextParameter("deliveryUser", 30, ""));
vtReturn.addElement(ThreadUtil.createIntegerParameter("orderTimeout", "Time to live of order (s)."));
vtReturn.addElement(ThreadUtil.createTextParameter("timeBetweenLoop", 300, ""));
vtReturn.addElement(ThreadUtil.createTextParameter("batchSize", 300, ""));
vtReturn.addElement(ThreadUtil.createIntegerParameter("conditionQueueSize", ""));
vtReturn.addElement(ThreadUtil.createIntegerParameter("conditionDelay", ""));
vtReturn.addElement(ThreadUtil.createTextParameter("fetchSize", 300, ""));
vtReturn.addElement(ThreadUtil.createTextParameter("SQLCommand", 300, ""));
vtReturn.addElement(ThreadUtil.createTextParameter("SQLUpdate", 300, ""));
Vector vtValue = new Vector();
vtValue.addElement(createParameterDefinition("ProductId", "", ParameterType.PARAM_TEXTBOX_MAX, "",
"Context to mapping class", "0"));
vtValue.addElement(createParameterDefinition("ProcessClass", "", ParameterType.PARAM_TEXTBOX_MAX, "",
"Context to mapping class", "1"));
vtValue.addElement(createParameterDefinition("Channel", "", ParameterType.PARAM_TEXTBOX_MAX, "",
"Context to mapping class", "2"));
vtValue.addElement(createParameterDefinition("ServiceAddress", "", ParameterType.PARAM_TEXTBOX_MAX, "",
"Context to mapping class", "3"));
vtValue.addElement(createParameterDefinition("keyword", "", ParameterType.PARAM_TEXTBOX_MAX, "",
"Context to mapping class", "4"));
vtReturn.addElement(createParameterDefinition("SubscriptionConfig", "", ParameterType.PARAM_TABLE, vtValue,
"Subscription Config"));
Vector vtSchedule = new Vector();
vtSchedule.addElement(createParameterDefinition("StartTime", "", ParameterType.PARAM_TEXTBOX_MAX, "",
"Context to mapping class", "0"));
vtSchedule.addElement(createParameterDefinition("EndTime", "", ParameterType.PARAM_TEXTBOX_MAX, "",
"Context to mapping class", "1"));
vtReturn.addElement(createParameterDefinition("ScheduleConfig", "", ParameterType.PARAM_TABLE, vtSchedule,
"Schedule config"));
vtReturn.addAll(ThreadUtil.createQueueParameter(this));
return vtReturn;
}
// //////////////////////////////////////////////////////
// Override
// //////////////////////////////////////////////////////
public void fillParameter() throws AppException
{
try
{
super.fillParameter();
deliveryUser = ThreadUtil.getString(this, "deliveryUser", false, "");
orderTimeout = ThreadUtil.getInt(this, "orderTimeout", 60000);
fetchSize = ThreadUtil.getInt(this, "fetchSize", 200);
strSQLSelect = ThreadUtil.getString(this, "SQLCommand", true, "");
strSQLUpdate = ThreadUtil.getString(this, "SQLUpdate", true, "");
timeBeetweenLoop = ThreadUtil.getInt(this, "timeBetweenLoop", 100);
batchSize = ThreadUtil.getInt(this, "batchSize", 100);
conditionQueueSize = ThreadUtil.getInt(this, "conditionQueueSize", 100);
conditionDelay = ThreadUtil.getInt(this, "conditionDelay", 1000);
vtSubscriptionClass = new Vector();
Object obj = getParameter("SubscriptionConfig");
if (obj != null && (obj instanceof Vector))
{
vtSubscriptionClass = (Vector) ((Vector) obj).clone();
}
Object objSchedule = getParameter("ScheduleConfig");
if (objSchedule != null && (objSchedule instanceof Vector))
{
vtSchedule = (Vector) ((Vector) objSchedule).clone();
}
}
catch (AppException e)
{
throw e;
}
catch (Exception e)
{
throw new AppException(e.getMessage());
}
}
@Override
protected void beforeSession() throws Exception
{
for (int i = 0; i < vtSchedule.size(); i++)
{
Vector vtRow = (Vector) vtSchedule.elementAt(i);
startTime = vtRow.elementAt(0).toString();
endTime = vtRow.elementAt(1).toString();
}
bCheckSchedule = checkSchedule(startTime, endTime);
if (bCheckSchedule)
{
try
{
// INIT ABTRACT CLASS
for (int i = 0; i < vtSubscriptionClass.size(); i++)
{
Vector vtRow = (Vector) vtSubscriptionClass.elementAt(i);
String mstrKey = vtRow.elementAt(0).toString();
String mstrProcessClass = vtRow.elementAt(1).toString();
String mstrChannel = vtRow.elementAt(2).toString();
String mstrServiceAddress = vtRow.elementAt(3).toString();
String mstrKeyword = vtRow.elementAt(4).toString();
AbstractAutoRenew abstractAutoRenew = (AbstractAutoRenew) Class.forName(mstrProcessClass)
.newInstance();
abstractAutoRenew.setChanel(mstrChannel);
abstractAutoRenew.setKeyword(mstrKeyword);
abstractAutoRenew.setServiceAddress(mstrServiceAddress);
abstractAutoRenew.setOrderTimeOut(orderTimeout);
abstractAutoRenew.setDeliveryUser(deliveryUser);
abstractAutoRenew.setAbtractAutoRenewThread(this);
mAutoRenewClass.put(mstrKey, abstractAutoRenew);
}
// INIT STATEMENT
Long startTime = System.currentTimeMillis();
logMonitor("Loading records.....");
connection = Database.getConnection();
stmtSelect = connection.prepareStatement(strSQLSelect);
rs = stmtSelect.executeQuery();
rs.setFetchSize(fetchSize);
connection.setAutoCommit(false);
stmtUpdate = connection.prepareStatement(strSQLUpdate);
Long endTime = System.currentTimeMillis();
logMonitor("Total times: " + (endTime - startTime) / 1000 + "s");
}
catch (Exception ex)
{
throw ex;
}
}
}
@Override
public void processSession() throws Exception
{
if (bCheckSchedule)
{
try
{
beforeProcessSession();
doProcessSession();
}
catch (Exception ex)
{
throw ex;
}
finally
{
super.afterProcessSession();
}
}
else
{
logMonitor("Schedule not avaiable. Thread will start from " + startTime + " to " + endTime + ".");
Thread.sleep(calculateTime(startTime, endTime));
}
}
public void doProcessSession() throws Exception
{
try
{
int loopCounter = 0;
CommandMessage commandMessage = null;
logMonitor("Record are processing.....");
long startTime = System.currentTimeMillis();
String mstrISDN = "";
String mstrProductId = "";
while (rs.next())
{
try
{
String mstrRowId = rs.getString("rowid");
mstrISDN = rs.getString("isdn");
mstrProductId = rs.getString("productid");
AbstractAutoRenew abstractAutoRenew = mAutoRenewClass.get(mstrProductId);
stmtUpdate.setString(1, mstrRowId);
stmtUpdate.executeUpdate();
commandMessage = new CommandMessage();
commandMessage.setProductId(Long.parseLong(mstrProductId));
abstractAutoRenew.processRecord(mstrISDN, commandMessage);
connection.commit();
logMonitor("SUCCESS - ISDN: " + mstrISDN + " - PRODUCTID: " + mstrProductId);
loopCounter++;
if (loopCounter >= batchSize)
{
loopCounter = 0;
Thread.sleep(timeBeetweenLoop);
}
}
catch (Exception ex)
{
connection.rollback();
logMonitor("FAIL - ISDN: " + mstrISDN + " - PRODUCTID: " + mstrProductId + " - DESCRIPTION: "
+ ex.getMessage());
}
}
long endTime = System.currentTimeMillis();
logMonitor("Total times: " + (endTime - startTime) / 1000 + "s");
}
catch (Exception e)
{
debugMonitor(e.getMessage());
throw e;
}
finally
{
connection.setAutoCommit(true);
}
}
@Override
protected void afterSession() throws Exception
{
Database.closeObject(stmtSelect);
Database.closeObject(rs);
Database.closeObject(connection);
super.afterSession();
}
@Override
public void attachQueue(CommandMessage order) throws Exception
{
MQConnection connection = null;
try
{
// Init connection
connection = getMQConnection();
// Check condition queue size
int queueSize = 0;
if ((queueSize = connection.getQueueSize(queueWorking)) >= conditionQueueSize)
{
logMonitor("Curent queue size: " + queueSize + " more than condition queue size: " + conditionQueueSize);
while ((queueSize = connection.getQueueSize(queueWorking)) >= conditionQueueSize)
{
Thread.sleep(conditionDelay);
}
}
// Send message to queue
connection.sendMessage(order, "", 0, queueWorking, orderTimeout * 1000
, new String[] { "SystemID" }, new Object[] { new String(order.getUserName()) }, queuePersistent);
}
catch (Exception ex)
{
order.setCause(Constants.ERROR);
order.setDescription(ex.getMessage());
logMonitor(order.toLogString());
throw ex;
}
finally
{
returnMQConnection(connection);
}
order.setCause(Constants.SUCCESS);
}
}
| [
"quangtrung.uet@gmail.com"
] | quangtrung.uet@gmail.com |
721cb02dc654ee776c8bf8dd4872cd8886698366 | e2ba7a3d63b7ee1618cb771a26d5dcb7d7add049 | /26-SDP/CSM/CSMFE/SDP_CSM_WS/src/main/java/com/accenture/sdp/csmfe/webservices/request/solutionoffer/CreateSolutionOfferAndPackageRequest.java | 0b44790a0aaa979c19f9b7f6aa43edc85f81ff8f | [] | no_license | adabalaravi/ca123 | e1cdd59aa4ee0964a111f54206cec39bce179e68 | 1f2950e33f9bdb72e16f27988d7a238d4c66aad3 | refs/heads/master | 2020-06-03T05:40:29.581085 | 2017-10-29T08:40:26 | 2017-10-29T08:40:26 | 94,117,979 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,463 | java | package com.accenture.sdp.csmfe.webservices.request.solutionoffer;
import java.io.Serializable;
import java.util.Date;
import javax.xml.bind.annotation.XmlAccessOrder;
import javax.xml.bind.annotation.XmlAccessorOrder;
import javax.xml.bind.annotation.XmlRootElement;
import com.accenture.sdp.csmfe.webservices.request.solution.PartyGroupNameListRequest;
@XmlRootElement(namespace = "http://com.accenture.sdp.csm.webservices.types")
@XmlAccessorOrder(XmlAccessOrder.UNDEFINED)
public class CreateSolutionOfferAndPackageRequest implements Serializable {
/**
*
*/
private static final long serialVersionUID = -1509334643180494236L;
private String solutionName;
private String solutionOfferName;
private String solutionOfferDescription;
// modificati per anomalia SDP00000271
private Date solutionOfferStartDate;
private Date solutionOfferEndDate;
private String solutionOfferProfile;
// fine anomalia
// MODIFICATO PER STAR
private ExternalIdList externalIds;
private SolutionOfferDetailListRequest solutionOfferDetails;
// AGGIUNTO PER AVS
private PartyGroupNameListRequest partyGroups;
private String solutionOfferType;
private Long duration;
public CreateSolutionOfferAndPackageRequest() {
partyGroups = new PartyGroupNameListRequest();
solutionOfferDetails = new SolutionOfferDetailListRequest();
externalIds = new ExternalIdList();
}
public String getSolutionName() {
return solutionName;
}
public void setSolutionName(String solutionName) {
this.solutionName = solutionName;
}
public String getSolutionOfferName() {
return solutionOfferName;
}
public void setSolutionOfferName(String solutionOfferName) {
this.solutionOfferName = solutionOfferName;
}
public String getSolutionOfferDescription() {
return solutionOfferDescription;
}
public void setSolutionOfferDescription(String solutionOfferDescription) {
this.solutionOfferDescription = solutionOfferDescription;
}
public Date getSolutionOfferStartDate() {
return solutionOfferStartDate;
}
public void setSolutionOfferStartDate(Date solutionOfferStartDate) {
this.solutionOfferStartDate = solutionOfferStartDate;
}
public Date getSolutionOfferEndDate() {
return solutionOfferEndDate;
}
public void setSolutionOfferEndDate(Date solutionOfferEndDate) {
this.solutionOfferEndDate = solutionOfferEndDate;
}
public String getSolutionOfferProfile() {
return solutionOfferProfile;
}
public void setSolutionOfferProfile(String solutionOfferProfile) {
this.solutionOfferProfile = solutionOfferProfile;
}
public SolutionOfferDetailListRequest getSolutionOfferDetails() {
return solutionOfferDetails;
}
public void setSolutionOfferDetails(SolutionOfferDetailListRequest solutionOfferDetails) {
this.solutionOfferDetails = solutionOfferDetails;
}
public PartyGroupNameListRequest getPartyGroups() {
return partyGroups;
}
public void setPartyGroups(PartyGroupNameListRequest partyGroups) {
this.partyGroups = partyGroups;
}
public ExternalIdList getExternalIds() {
return externalIds;
}
public void setExternalIds(ExternalIdList externalIds) {
this.externalIds = externalIds;
}
public String getSolutionOfferType() {
return solutionOfferType;
}
public void setSolutionOfferType(String solutionOfferType) {
this.solutionOfferType = solutionOfferType;
}
public Long getDuration() {
return duration;
}
public void setDuration(Long duration) {
this.duration = duration;
}
}
| [
"ravindra.mca25@gmail.com"
] | ravindra.mca25@gmail.com |
d627d1b2d3e35ca69d34cdb9430bfacf30d6b5d3 | 12eaf974dd5cda4584d69fb6978838f0453c753e | /src/day62/TryCatchBlock.java | e10bc32efb8f406b3252807b19dc5806a85eb605 | [] | no_license | hunals/JavaSpringPractice2019 | 58b1232676254086f213a15c4095b82a8da34e1b | 81ace34df5595ace3b899b6be533a9773cff2537 | refs/heads/master | 2020-06-04T20:48:23.286332 | 2019-07-04T13:17:10 | 2019-07-04T13:17:10 | 192,184,248 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 799 | java | package day62;
import java.util.Scanner;
public class TryCatchBlock {
public static void main(String[] args) {
System.out.println("Beginning of the code ");
Scanner scanner = new Scanner(System.in);
try {
System.out.println("Enter num1 : ");
int num1 = scanner.nextInt();
System.out.println("Enter num2 : ");
int num2 = scanner.nextInt();
System.out.println("Division result is " + num1/num2);
// we are specifically trying catch ArithmeticException if it happen
} catch (ArithmeticException e ) { // new ArithmeticException();
System.out.println(" You INPUT 0 for second number ");
}
System.out.println("Ending of the code ");
// throw --> shut down the program
// catch --> don't allow program to shut down
}
}
| [
"hunals06@hotmail.com"
] | hunals06@hotmail.com |
482c8ac9b855f96ffd5823d3243a94789a0d9d9d | 623caf5d293c58a9ad03e77c29450ed5f26e8264 | /sparkpea/src/main/java/com/niit/models/User.java | 25cecf4265bd36206c5959d38014d03208e2a67a | [] | no_license | arigesangeetha/second-project | d7c6eee297b7a94abf9648a739c297e2fc960ed5 | abcf8137b89f02222fe1a3c073945d3bbf504cf0 | refs/heads/master | 2020-12-24T12:59:32.666906 | 2016-10-28T16:17:32 | 2016-10-28T16:17:32 | 67,724,976 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,714 | java | package com.niit.models;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name="UserDetails")
public class User {
@Id
@GeneratedValue
private int userid;
private String username;
private String name;
private String password;
private String gender;
private String email;
private String mobile;
private String Enabled;
private String role;
private byte[] image;
public int getUserid() {
return userid;
}
public void setUserid(int userid) {
this.userid = userid;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public String getEnabled() {
return Enabled;
}
public void setEnabled(String enabled) {
Enabled = enabled;
}
public String getRole() {
return role;
}
public void setRole(String role) {
this.role = role;
}
public byte[] getImage() {
return image;
}
public void setImage(byte[] image) {
this.image = image;
}
}
| [
"sun@sun-PC"
] | sun@sun-PC |
73771ff0e878a22d2d4a3452d29263a0ace44b13 | 5d5cb6a4a1e1e5e8ba30404b0400b04962658dd3 | /src/main/java/haoframe/core/spring/SpringContext.java | a1c9e76b5769e861f8f7f467b5775acb19dcdb00 | [] | no_license | chiangho/haoframe-core | 9b9f0866ae0674facb0f831ed446a5fd14aa96d4 | 6497e7365559c56d5c5efd8090759bb9fa65ef51 | refs/heads/master | 2022-08-05T08:16:45.458238 | 2020-02-19T05:35:03 | 2020-02-19T05:35:03 | 216,295,804 | 0 | 0 | null | 2022-03-08T21:24:18 | 2019-10-20T02:17:42 | Java | UTF-8 | Java | false | false | 655 | java | package haoframe.core.spring;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
public class SpringContext implements ApplicationContextAware{
private static ApplicationContext applicationContext = null;
@Override
public void setApplicationContext(ApplicationContext context) throws BeansException {
applicationContext = context;
}
public static Object getBean(Class<?> clazz) {
return applicationContext.getBean(clazz);
}
public static Object getBean(String name) {
return applicationContext.getBean(name);
}
}
| [
"chiang_hao@126.com"
] | chiang_hao@126.com |
463bfba2b890102603994e9b64723b68d3071da9 | d08b1829912ad27dd0d8e3b1b1e952f86dd20165 | /api/src/main/java/org/openmrs/module/patientsummary/PatientSummary.java | 996b62ad7e6628b6696d7c6ea962da56e1c7fe66 | [] | no_license | bwolfe/openmrs-module-patientsummary | 7fdf565aa54fedf78407518408d2768450a81ec5 | 4241bfe3ad3351a4dbfe69c7ae6df169bca9f3d2 | refs/heads/master | 2020-12-24T10:11:20.149185 | 2012-09-26T15:20:53 | 2012-09-26T15:20:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,716 | java | /**
* The contents of this file are subject to the OpenMRS Public License
* Version 1.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://license.openmrs.org
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* Copyright (C) OpenMRS, LLC. All Rights Reserved.
*/
package org.openmrs.module.patientsummary;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.openmrs.module.reporting.report.ReportDesign;
import org.openmrs.module.reporting.report.renderer.ReportRenderer;
/**
* Represents a particular Patient Summary
*/
public class PatientSummary {
protected final Log log = LogFactory.getLog(this.getClass());
//***** PROPERTIES *****
private ReportDesign reportDesign;
//***** CONSTRUCTORS *****
/**
* Default constructor
*/
public PatientSummary() {}
/**
* Full Constructor
*/
public PatientSummary(ReportDesign reportDesign) {
this.reportDesign = reportDesign;
}
//***** METHODS *****
/**
* @return the contentType for this PatientSummary
*/
public String getContentType() {
try {
ReportRenderer rr = reportDesign.getRendererType().newInstance();
return rr.getRenderedContentType(reportDesign.getReportDefinition(), reportDesign.getUuid());
}
catch (Exception e) {
log.warn("Unable to retrieve content type for patient summary: " + reportDesign);
}
return "text/plain";
}
/**
* @return the filename for this PatientSummary for use when exporting
*/
public String getExportFilename() {
try {
ReportRenderer rr = reportDesign.getRendererType().newInstance();
return rr.getFilename(reportDesign.getReportDefinition(), reportDesign.getUuid());
}
catch (Exception e) {
log.warn("Unable to retrieve file name for patient summary: " + reportDesign);
}
return "summary.txt";
}
/**
* @return the primary key id
*/
public Integer getId() {
return getReportDesign() != null ? getReportDesign().getId() : null;
}
/**
* @return the uuid
*/
public String getUuid() {
return getReportDesign() != null ? getReportDesign().getUuid() : null;
}
/**
* @return the name
*/
public String getName() {
return getReportDesign() != null ? getReportDesign().getName() : null;
}
/**
* @see Object#equals(Object)
*/
@Override
public boolean equals(Object o) {
if (o != null && o instanceof PatientSummary) {
PatientSummary that = (PatientSummary)o;
if (this.getReportDesign() != null && that.getReportDesign() != null) {
return this.getReportDesign().equals(that.getReportDesign());
}
}
return super.equals(o);
}
/**
* @see Object#hashCode()
*/
@Override
public int hashCode() {
if (this.getReportDesign() != null) {
return this.getReportDesign().hashCode();
}
return super.hashCode();
}
/**
* @see Object#toString()
*/
@Override
public String toString() {
if (getReportDesign() != null) {
if (getReportDesign().getReportDefinition() != null) {
return getReportDesign().getReportDefinition().getName() + " (" + getReportDesign().getName() + ")";
}
return getReportDesign().getName();
}
return super.toString();
}
//***** PROPERTY ACCESS *****
/**
* @return the reportDesign
*/
public ReportDesign getReportDesign() {
return reportDesign;
}
/**
* @param reportDesign the reportDesign to set
*/
public void setReportDesign(ReportDesign reportDesign) {
this.reportDesign = reportDesign;
}
}
| [
"mseaton@pih.org"
] | mseaton@pih.org |
9216ff994606dacc1f55daa3876c4e225ca09335 | 791386f86ef8651727e6eae4dd73ab5078233534 | /src/jump_and_run/Joueur.java | 5a85410ea9a282de1d96fa5336ffa3fa27ba521e | [] | no_license | YannEggerschwyler/Jump_and_Run_Git | 20952f99f1c0a37d3e4c6f14a9f12f9c8268bd1f | d9c76420e95b636dd2995466ba3a1190a3164f59 | refs/heads/master | 2016-09-11T01:23:36.928435 | 2013-03-28T00:17:21 | 2013-03-28T00:17:21 | 9,066,251 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 10,468 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package jump_and_run;
import org.newdawn.slick.Animation;
import org.newdawn.slick.Image;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.geom.Rectangle;
import org.newdawn.slick.geom.Shape;
/**
*
* @author Yann
*/
public class Joueur {
private Animation joueur, up, down, left, right, jump_right, jump_left;
private Shape corps_millieu;
private Shape tete_millieu;
private Shape reste_gauche;
private Shape futur_corps_gauche;
private Shape futur_tete_gauche;
private Shape futur_corps_droite;
private Shape futur_tete_droite;
private Shape futur_corps_bas;
private Shape futur_corps_haut;
private Shape futur_tete_haut;
private float x, y;
private Vie vies[];
private Shape[]tab;
private int pieces_joueur;
public Joueur() throws SlickException {
Image[] move_up = {new Image("sprite/amg_hautdroite.png"), new Image("sprite/amg_hautgauche.png")};
Image[] move_down = {new Image("sprite/amg_basdroite.png"), new Image("sprite/amg_basgauche.png")};
Image[] move_left = {new Image("sprite/amg_reggauche.png"), new Image("sprite/amg_pasgauche.png")};
Image[] move_right = {new Image("sprite/amg_regdroit.png"), new Image("sprite/amg_pasdroit.png")};
Image[] move_jump_left = {new Image("sprite/amg_jump_left.png"), new Image("sprite/amg_jump_left_2.png")};
Image[] move_jump_right = {new Image("sprite/amg_jump_right.png"), new Image("sprite/amg_jump_right_2.png")};
int[] duration = {300, 300};
int[] duration_2 = {500, 500};
up = new Animation(move_up, duration, true);
down = new Animation(move_down, duration, true);
left = new Animation(move_left, duration, true);
right = new Animation(move_right, duration, false);
jump_left = new Animation(move_jump_left, duration_2, true);
jump_right = new Animation(move_jump_right, duration_2, true);
x=240;
y = 320;
tab= new Shape[9];
//------------------------ Corps au millieu------------------------------
corps_millieu = new Rectangle (x +3, y+14, 26,18);
tete_millieu = new Rectangle (x +6, y+0, 20,14);
reste_gauche = new Rectangle (x +24, y+11, 6,6);
// ------------------------------- obstacles, Sol etc..
//------------------------ Corps au millieu
futur_corps_gauche = new Rectangle(0, 0, 2, corps_millieu.getHeight());
futur_tete_gauche = new Rectangle(0,0, tete_millieu.getWidth(), tete_millieu.getHeight());
//----------------------------- Droite de corps et de tete
futur_corps_droite = new Rectangle(0, 0, 2, corps_millieu.getHeight());
futur_tete_droite = new Rectangle(0,0, tete_millieu.getWidth(), tete_millieu.getHeight());
//----------------------------- Haut et bas
futur_corps_bas = new Rectangle(0,0, corps_millieu.getWidth()-2,2);
futur_corps_haut = new Rectangle(0,0, tete_millieu.getWidth(), tete_millieu.getHeight());
futur_tete_haut = new Rectangle(tete_millieu.getX(),tete_millieu.getY()-2,tete_millieu.getWidth(),tete_millieu.getHeight());
//--------------------------------------------------
futur_corps_gauche.setX(corps_millieu.getX()-2);
futur_corps_gauche.setY(corps_millieu.getY());
reste_gauche.setX(corps_millieu.getX());
reste_gauche.setY(corps_millieu.getY());
futur_tete_gauche.setX(tete_millieu.getX()-2);
futur_tete_gauche.setY(tete_millieu.getY());
futur_corps_droite.setY(corps_millieu.getY());
futur_corps_droite.setX(corps_millieu.getMaxX()+2);
futur_tete_droite.setX(tete_millieu.getX()+2);
futur_tete_droite.setY(tete_millieu.getY());
futur_corps_bas.setY(corps_millieu.getMaxY()+2);
futur_corps_bas.setX(corps_millieu.getX()+1);
futur_corps_haut.setY(corps_millieu.getY() -2);
futur_corps_haut.setX(corps_millieu.getX());
tab[7]=futur_corps_bas;
tab[1]=reste_gauche;
tab[8]=tete_millieu;
tab[3]=futur_tete_gauche;
tab[4]=futur_corps_haut;
tab[5]=futur_corps_droite;
tab[0]=futur_tete_gauche;
tab[6]=corps_millieu;
tab[2]=futur_tete_haut;
joueur = right;
vies = new Vie[3];
for (int i= 0; i<3; i++){
vies[i]= new Vie();
}
pieces_joueur = 0;
}
public String getNbrVies() {
String ret = ""+this.vies.length;
return ret;
}
public void enleve_Vies() {
Vie[] vie_re;
vie_re = new Vie[this.vies.length-1];
this.vies= vie_re;
}
public int getNbr_Pieces() {
return this.pieces_joueur;
}
public void ajoute_Piece(){
this.pieces_joueur +=1;
}
public Animation getJoueur() {
return joueur;
}
public Animation getUp() {
return up;
}
public Animation getDown() {
return down;
}
public Animation getLeft() {
return left;
}
public Animation getRight() {
return right;
}
public Animation getJump_right() {
return jump_right;
}
public Animation getJump_left() {
return jump_left;
}
public Shape getCorps_millieu() {
return corps_millieu;
}
public Shape getTete_millieu() {
return tete_millieu;
}
public Shape getReste_gauche() {
return reste_gauche;
}
public Shape getFutur_corps_gauche() {
return futur_corps_gauche;
}
public Shape getFutur_tete_gauche() {
return futur_tete_gauche;
}
public Shape getFutur_corps_droite() {
return futur_corps_droite;
}
public Shape getFutur_tete_droite() {
return futur_tete_droite;
}
public Shape getFutur_corps_bas() {
return futur_corps_bas;
}
public Shape getFutur_corps_haut() {
return futur_corps_haut;
}
public float getX() {
return x;
}
public float getY() {
return y;
}
public Shape[] getTab() {
return tab;
}
public Shape getTabShape(int i) {
return tab[i];
}
public void setJoueur(Animation joueur) {
this.joueur = joueur;
}
public void setTab(Shape[] tab) {
this.tab = tab;
}
public void setUp(Animation up) {
this.up = up;
}
public void setDown(Animation down) {
this.down = down;
}
public void setLeft(Animation left) {
this.left = left;
}
public void setRight(Animation right) {
this.right = right;
}
public void setJump_right(Animation jump_right) {
this.jump_right = jump_right;
}
public void setJump_left(Animation jump_left) {
this.jump_left = jump_left;
}
public void setCorps_millieu(Shape corps_millieu) {
this.corps_millieu = corps_millieu;
}
public void setTete_millieu(Shape tete_millieu) {
this.tete_millieu = tete_millieu;
}
public void setReste_gauche(Shape reste_gauche) {
this.reste_gauche = reste_gauche;
}
public void setFutur_corps_gauche(Shape futur_corps_gauche) {
this.futur_corps_gauche = futur_corps_gauche;
}
public void setFutur_tete_gauche(Shape futur_tete_gauche) {
this.futur_tete_gauche = futur_tete_gauche;
}
public void setFutur_corps_droite(Shape futur_corps_droite) {
this.futur_corps_droite = futur_corps_droite;
}
public void setFutur_tete_droite(Shape futur_tete_droite) {
this.futur_tete_droite = futur_tete_droite;
}
public void setFutur_corps_bas(Shape futur_corps_bas) {
this.futur_corps_bas = futur_corps_bas;
}
public void setFutur_corps_haut(Shape futur_corps_haut) {
this.futur_corps_haut = futur_corps_haut;
}
public void setX(float x) {
this.x = x;
}
public void setY(float y) {
this.y = y;
}
public Shape getFutur_tete_haut() {
return futur_tete_haut;
}
public void setShapes_joueur(float vertical_speed){
this.corps_millieu.setY(this.corps_millieu.getY()+ vertical_speed);
this.tete_millieu.setY(this.tete_millieu.getY()+ vertical_speed);
this.futur_corps_gauche.setY(this.futur_corps_gauche.getY()+ vertical_speed);
this.futur_tete_gauche.setY(this.futur_tete_gauche.getY()+ vertical_speed);
this.futur_corps_droite.setY(this.futur_corps_droite.getY()+ vertical_speed);
this.futur_tete_droite.setY(this.futur_tete_droite.getY()+ vertical_speed);
this.futur_corps_bas.setY(this.futur_corps_bas.getY()+ vertical_speed);
this.futur_corps_haut.setY(this.futur_corps_haut.getY()+ vertical_speed);
this.reste_gauche.setY(this.corps_millieu.getY()+ vertical_speed);
this.futur_tete_haut.setY(this.futur_tete_haut.getY()+ vertical_speed);
}
public void setShapes_joueur2(float vertical_speed){
this.corps_millieu.setX(this.corps_millieu.getX()+ vertical_speed);
this.tete_millieu.setX(this.tete_millieu.getX()+ vertical_speed);
this.futur_corps_gauche.setX(this.futur_corps_gauche.getX()+ vertical_speed);
this.futur_tete_gauche.setX(this.tete_millieu.getX()+ vertical_speed);
this.futur_corps_droite.setX(this.futur_corps_droite.getX()+ vertical_speed);
this.futur_tete_droite.setX(this.tete_millieu.getX()+ vertical_speed);
this.futur_corps_bas.setX(this.futur_corps_bas.getX()+ vertical_speed);
this.futur_corps_haut.setX(this.corps_millieu.getX()+ vertical_speed);
this.reste_gauche.setX(this.corps_millieu.getX()+ vertical_speed);
this.futur_tete_haut.setX(this.futur_tete_haut.getX()+ vertical_speed);
}
}
| [
"yann.kost@live.De"
] | yann.kost@live.De |
e5763dfdf70928adc027fd2ba6763a849e3ba3c9 | 7dd0bc318958b5666ee7c30b3e38d440958a6eca | /search-core/src/main/java/com/modinfodesigns/property/persistence/DataObjectDBFinder.java | 75dfc654319da5c24e5a018fbf3e160e6cdbb0c1 | [
"Apache-2.0"
] | permissive | Shicheng-Guo/modular-informatic-designs | 50b0f83ffc1bb3115702269a679c906964fa4bec | 15f5ff2abe1aefe9286daaeb7ac00d68e69d761d | refs/heads/master | 2023-03-16T17:29:23.430366 | 2016-10-06T13:36:51 | 2016-10-06T13:36:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 29,997 | java | package com.modinfodesigns.property.persistence;
import com.modinfodesigns.app.ApplicationManager;
import com.modinfodesigns.app.persistence.database.IDataSourceFactory;
import com.modinfodesigns.app.persistence.database.SQLMethods;
import com.modinfodesigns.property.DataObject;
import com.modinfodesigns.property.persistence.DataObjectPlaceholder;
import com.modinfodesigns.property.DataList;
import com.modinfodesigns.property.IFunctionProperty;
import com.modinfodesigns.property.IProperty;
import com.modinfodesigns.property.PropertyList;
import com.modinfodesigns.property.MappedProperty;
import com.modinfodesigns.property.schema.DataObjectSchema;
import com.modinfodesigns.property.schema.DataObjectSchemaManager;
import com.modinfodesigns.property.schema.PropertyDescriptor;
import com.modinfodesigns.property.string.StringProperty;
import com.modinfodesigns.property.transform.string.StringTransform;
import com.modinfodesigns.search.FinderException;
import com.modinfodesigns.search.FinderField;
import com.modinfodesigns.search.IFinder;
import com.modinfodesigns.search.IQuery;
import com.modinfodesigns.search.QueryField;
import com.modinfodesigns.search.IResultList;
import com.modinfodesigns.search.BasicResultList;
import com.modinfodesigns.utils.StringMethods;
import java.util.Iterator;
import java.util.List;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* IFinder implementation for DataObjects persisted through SQLTemplatePersistenceManager and DataObjectSchemaManager.
*
* @author Ted Sullivan
*/
public class DataObjectDBFinder implements IFinder
{
private transient static final Logger LOG = LoggerFactory.getLogger( ApplicationManager.class );
private String name;
private String dataSchemaName;
private String dataSourceFactoryName; // name of IDataSourceFactory
private IDataSourceFactory dataSourceFactory;
private SQLMethods sqlMethods;
private DataObjectSchemaManager dataObjectSchemaManager;
private SQLTemplatePersistenceManager stpm;
private String dataObjectSchemaManagerClass;
private int MAX_QUERY_FIELD_LENGTH = 20;
// If both are false, use '=' else use LIKE with % wildcards
private boolean usePrefix = false;
private boolean usePostfix = false;
private boolean useLazyEvaluation = false;
private boolean rootObjectsOnly = true;
public DataObjectDBFinder( ) { }
public DataObjectDBFinder( IDataSourceFactory dataSourceFactory, String dataObjectSchemaName )
{
this.dataSourceFactory = dataSourceFactory;
this.dataSchemaName = dataObjectSchemaName;
}
public DataObjectDBFinder( String dataSourceFactoryName, String dataObjectSchemaName )
{
this.dataSourceFactoryName = dataSourceFactoryName;
this.dataSchemaName = dataObjectSchemaName;
}
public void setDataSourceFactory( String dataSourceFactory )
{
this.dataSourceFactoryName = dataSourceFactory;
}
public void setDataSourceFactoryName( String dataSourceFactory )
{
this.dataSourceFactoryName = dataSourceFactory;
}
public void setDataObjectSchemaName( String dataSchemaName )
{
this.dataSchemaName = dataSchemaName;
}
public void setSchemaName( String schemaName )
{
this.dataSchemaName = schemaName;
}
public void setDataObjectSchemaManager( DataObjectSchemaManager dosm )
{
this.dataObjectSchemaManager = dosm;
}
public void setDataObjectSchemaManagerClass( String dataObjectSchemaManagerClass )
{
this.dataObjectSchemaManagerClass = dataObjectSchemaManagerClass;
}
public void setUsePrefixWildcard( boolean usePrefix )
{
this.usePrefix = usePrefix;
}
public void setUsePrefixWildcard( String usePrefix )
{
this.usePrefix = (usePrefix != null && usePrefix.equalsIgnoreCase( "true" ));
}
public void setUsePostfixWildcard( boolean usePostfix )
{
this.usePostfix = usePostfix;
}
public void setUsePostfixWildcard( String usePostfix )
{
this.usePostfix = (usePostfix != null && usePostfix.equalsIgnoreCase( "true" ));
}
public void setRootObjectsOnly( String rootObjectsOnly )
{
this.rootObjectsOnly = (rootObjectsOnly != null && rootObjectsOnly.equalsIgnoreCase( "true" ));
}
@Override
public String getName()
{
return this.name;
}
public void setName( String name )
{
this.name = name;
}
@Override
public IResultList executeQuery( IQuery query ) throws FinderException
{
LOG.debug( "executeQuery: " + ((query != null) ? query.getValue( ) : "Query is NULL!") );
String schemaName = getSchemaName( query );
String[] databaseTables = getDatabaseTables( schemaName );
if (databaseTables.length == 1 )
{
String sqlQuery = createSQLQuery( databaseTables[0], query, schemaName );
LOG.debug( "executing sql query: " + sqlQuery );
return executeQuery( query, sqlQuery, schemaName, databaseTables[0] );
}
else
{
BasicResultList wholeList = new BasicResultList( );
for (int i = databaseTables.length-1; i >= 0; --i)
{
String sqlQuery = createSQLQuery( databaseTables[i], query, schemaName );
LOG.debug( "executing sql query: " + sqlQuery );
IResultList verList = executeQuery( query, sqlQuery, schemaName, databaseTables[i] );
if (verList != null)
{
Iterator<DataObject> verObjs = verList.getData( );
while ( verObjs != null && verObjs.hasNext( ))
{
wholeList.addDataObject( verObjs.next( ) );
}
}
}
return wholeList;
}
}
private String createSQLQuery( String databaseTable, IQuery query, String schemaName )
{
LOG.debug( "createSQLQuery: " + databaseTable );
DataObjectSchemaManager dosm = getDataObjectSchemaManager( );
DataObjectSchema dos = dosm.getDataObjectSchema( schemaName );
if (query == null || query.getQueryFields( ) == null)
{
return "select * from " + databaseTable;
}
StringBuilder strbuilder = new StringBuilder( );
strbuilder.append( "select * from " ).append( databaseTable ).append( " where " );
boolean haveField = false;
List<QueryField> queryFields = query.getQueryFields( );
if (queryFields != null)
{
for (int i = 0; i < queryFields.size( ); i++)
{
QueryField qf = queryFields.get( i );
if (qf.getFieldName().equals( DataObject.OBJECT_NAME_PARAM ))
{
if (haveField) strbuilder.append( " and " );
strbuilder.append( " " ).append( DataObject.OBJECT_NAME_PARAM );
if (usePrefix || usePostfix )
{
strbuilder.append( " LIKE " );
strbuilder.append( ((usePrefix) ? "'%" : "'" ) );
strbuilder.append( qf.getFieldValue( ) );
strbuilder.append( ((usePostfix) ? "%'" : "'" ) );
}
else
{
strbuilder.append( "='" ).append( qf.getFieldValue( )).append( "'" );
}
haveField = true;
}
else if (qf.getFieldName().equals( DataObject.OBJECT_ID_PARAM ))
{
if (haveField) strbuilder.append( " and " );
strbuilder.append( " " ).append( DataObject.OBJECT_ID_PARAM ).append( "='" ).append( qf.getFieldValue( )).append( "'" );
haveField = true;
}
else if (qf.getFieldName().equals( DataObject.ENTITY_TYPE_PARAM ))
{
if (haveField) strbuilder.append( " and " );
strbuilder.append( " " ).append( DataObject.ENTITY_TYPE_PARAM ).append("='" ).append( qf.getFieldValue( )).append( "'" );
haveField = true;
}
else if (dos != null && qf.getFieldName().equals( DataObjectSchema.SCHEMA_PARAM ) == false )
{
PropertyDescriptor fieldDesc = dos.getPropertyDescriptor( qf.getFieldName( ) );
if (fieldDesc != null)
{
if (haveField) strbuilder.append( " and " );
strbuilder.append( fieldDesc.getName( ) ).append( "=" );
if (fieldDesc.getDataType().equals( "String" ))
{
strbuilder.append( "'" );
}
strbuilder.append( qf.getFieldValue( ) );
if (fieldDesc.getDataType().equals( "String" ))
{
strbuilder.append( "'" );
}
haveField = true;
}
}
}
}
if (rootObjectsOnly)
{
strbuilder.append( " and is_root='T'" );
}
return strbuilder.toString( );
}
private IResultList executeQuery( IQuery query, String sqlStatement, String schemaName, String tableName )
{
LOG.debug( "executeQuery( " + sqlStatement + ", " + schemaName + ", " + tableName + " )" );
DataObjectSchemaManager dosm = getDataObjectSchemaManager( );
DataObjectSchema dos = dosm.getDataObjectSchema( schemaName );
BasicResultList brl = new BasicResultList( );
SQLMethods sqlMethods = getSQLMethods( );
ResultSet rs = sqlMethods.executeSQLQuery( sqlStatement );
try
{
while (rs != null && rs.next() )
{
DataObject dobj = createDataObject( dos, query, rs);
brl.addDataObject( dobj );
}
}
catch ( SQLException sqle )
{
LOG.debug( "Got SQLException: " + sqle );
}
finally
{
sqlMethods.closeDatabaseConnection( );
}
LOG.debug( "Got " + brl.size( ) + " results." );
brl.setTotalResults( brl.size( ) );
return brl;
}
private DataObject createDataObject( DataObjectSchema dos, IQuery query, ResultSet rs )
{
LOG.debug( "createDataObject( ) " + query );
DataObject dobj = null;
// get the object class from the Schema ...
// The schema may be null if the search table is master_object_table
String dataType = (dos != null) ? dos.getDataObjectType( ) : null;
LOG.debug( "Creating Data Type: " + dataType );
if (dataType != null)
{
try
{
dobj = (DataObject)Class.forName( dataType ).newInstance( );
}
catch ( Exception e )
{
dobj = new DataObject( );
}
}
else
{
dobj = new DataObject( );
}
LOG.debug( "Creating Data Object: " + dobj );
try
{
String name = rs.getString( DataObject.OBJECT_NAME_PARAM );
dobj.setName( name );
dobj.setJsonNameLabel( DataObject.OBJECT_NAME_PARAM );
dobj.setProperty( new StringProperty( DataObject.OBJECT_NAME_PARAM, name ));
LOG.debug( "Got name = " + name );
String obj_id = rs.getString( DataObject.OBJECT_ID_PARAM );
dobj.setID( obj_id );
dobj.setIDLabel( DataObject.OBJECT_ID_PARAM );
dobj.setProperty( new StringProperty( DataObject.OBJECT_ID_PARAM, obj_id ));
String schema = (dos != null) ? dos.getName( ) : rs.getString( DataObjectSchemaManager.SCHEMA_NAME_COL );
dobj.setDataObjectSchema( schema );
LOG.debug( "Got Schema: " + schema );
if (schema.equals( SQLTemplatePersistenceManager.MASTER_TABLE ))
{
String entityType = rs.getString( DataObject.ENTITY_TYPE_PARAM );
if (entityType != null)
{
LOG.debug( "Setting entityType: " + entityType );
dobj.setProperty( new StringProperty( DataObject.ENTITY_TYPE_PARAM, entityType ));
}
}
String proxyKey = null;
try
{
proxyKey = rs.getString( SQLTemplatePersistenceManager.PROXY_FIELD );
}
catch ( Exception e )
{
}
if (proxyKey != null && proxyKey.trim().length() > 0)
{
// Create a Proxy Object placeholder
String[] components = StringMethods.getStringArray( proxyKey, "|" );
String childPlaceholderClass = dos.getChildPlaceholderClass( );
IDataObjectPlaceholder dopl = null;
if (childPlaceholderClass != null && components != null && components.length == 3)
{
LOG.debug( "Creating Proxy Placeholder: " + components[0] + ", " + components[1] + ", " + components[2] );
try
{
dopl = (IDataObjectPlaceholder)Class.forName( childPlaceholderClass ).newInstance( );
if (dopl instanceof DataObject)
{
dopl.setName( components[0] );
dopl.setID( components[1] );
dopl.setSchemaName( components[2] );
dopl.setSQLTemplatePersistenceManager( getSQLTemplatePersistenceManager( ) );
dobj.setProxyObject( (DataObject)dopl );
((DataObject) dopl).setProperty( new StringProperty( "proxy", "true" ));
return dobj;
}
}
catch ( Exception e )
{
LOG.error( "Could not create Proxy Object Placeholder class '" + childPlaceholderClass + "'" );
LOG.debug( "Could not create Proxy Object Placeholder class '" + childPlaceholderClass + "'" );
}
}
if (dopl == null)
{
dopl = new DataObjectPlaceholder( components[0], components[1], components[2], getSQLTemplatePersistenceManager( ) );
dobj.setProxyObject( (DataObject)dopl );
((DataObject) dopl).setProperty( new StringProperty( "proxy", "true" ));
return dobj;
}
}
List<String> displayFields = (query != null) ? query.getDisplayFields( ) : null;
List<PropertyDescriptor> propDescriptors = (dos != null) ? dos.getPropertyDescriptors( ) : null;
if (propDescriptors != null)
{
for (int i = 0; i < propDescriptors.size(); i++)
{
PropertyDescriptor pd = propDescriptors.get( i );
String fieldName = pd.getName( );
if (pd.isFunction())
{
LOG.debug( "Adding Function property: " + fieldName );
try
{
IFunctionProperty funProp = (IFunctionProperty)Class.forName( pd.getPropertyType() ).newInstance( );
funProp.setFunction( pd.getFunctionDescription( ) );
funProp.setName( fieldName );
dobj.setProperty( funProp );
}
catch ( Exception e )
{
LOG.error( "Cannot create IFunctionProperty " + pd.getPropertyType( ) + " " + e );
e.printStackTrace( );
}
}
else if ( displayFields == null || displayFields.contains( fieldName ))
{
LOG.debug( "getting field: " + fieldName );
String value = rs.getString( StringTransform.replaceSubstring( fieldName, " ", "_" ) );
if (value != null)
{
LOG.debug( " Creating prop for " + fieldName + " = " + value );
String propType = pd.getPropertyType( );
if (propType == null)
{
propType = "com.modinfodesigns.property.string.StringProperty";
}
try
{
IProperty prop = (IProperty)Class.forName( propType ).newInstance( );
String format = (prop instanceof PropertyList) ? IProperty.XML_FORMAT : pd.getPropertyFormat( );
LOG.debug( "Using format " + format );
prop.setName( fieldName );
prop.setValue( value, format );
dobj.setProperty( prop );
}
catch ( Exception e )
{
LOG.error( "Could not create property! " + pd.getName( ) + " Exception was" + e );
}
}
}
Map<String,String> mappedProps = pd.getPropertyMappings( );
if (mappedProps != null)
{
for (Iterator<String> mapIt = mappedProps.keySet().iterator(); mapIt.hasNext(); )
{
String from = mapIt.next( );
String to = mappedProps.get( from );
// MappedProperty wires itself to dobj in constructor
MappedProperty mapProp = new MappedProperty( to, from, dobj );
LOG.debug( "Created MappedProperty: " + mapProp.getName( ) );
LOG.debug( mapProp.getName( ) + " = " + mapProp.getValue( ) );
}
}
}
}
if (dobj instanceof DataList)
{
DataList dList = (DataList)dobj;
LOG.debug( "Need to pick up the Kids!" );
String childIDs = rs.getString( "children" );
LOG.debug( "Got children IDs: " + childIDs );
if (childIDs != null)
{
String[] childList = StringMethods.getStringArray( childIDs, ";" );
if (childList != null)
{
for (int i = 0; i < childList.length; i++)
{
String[] components = StringMethods.getStringArray( childList[i], "|" );
String chName = components[0];
String ID = components[1];
String childSchema = components[2];
DataObject chObj = null;
if (useLazyEvaluation)
{
LOG.debug( "Creating DataObjectPlaceholder for " + chName );
String placeholderClass = dos.getChildPlaceholderClass( );
if (placeholderClass != null)
{
LOG.debug( "Getting placeholder: " + placeholderClass );
try
{
IDataObjectPlaceholder doph = (IDataObjectPlaceholder)Class.forName( placeholderClass ).newInstance( );
doph.setName( chName );
doph.setID( ID );
doph.setSQLTemplatePersistenceManager( getSQLTemplatePersistenceManager( ) );
doph.setSchemaName( childSchema );
chObj = (DataObject)doph;
}
catch ( Exception e )
{
LOG.error( "Could not create DataObjectPlaceholder: " + placeholderClass + " Exception was " + e );
}
}
else
{
chObj = new DataObjectPlaceholder( chName, ID, childSchema, getSQLTemplatePersistenceManager( ) );
}
if (chObj != null)
{
dList.addDataObject( chObj );
}
}
else
{
LOG.debug( "Reading child " + chName + ", " + ID + ", " + childSchema );
SQLTemplatePersistenceManager stpm = getSQLTemplatePersistenceManager( );
chObj = stpm.read( chName, ID, childSchema );
if (chObj != null)
{
dList.addDataObject( chObj );
}
}
}
}
}
}
}
catch (SQLException sqle )
{
LOG.debug( "Got SQLException " + sqle );
}
catch ( Throwable t )
{
LOG.debug( "Got Throwable " + t );
t.printStackTrace( System.out );
}
LOG.debug( "Got DataObject: " + dobj.getValue( ) );
return dobj;
}
@Override
public DataObject getSingleResult( String resultID ) throws FinderException
{
String[] databaseTables = getDatabaseTables( );
if (databaseTables.length == 1)
{
String select = "select * from " + databaseTables[0] + " where object_id='" + resultID + "'";
IResultList results = executeQuery( null, select, dataSchemaName, databaseTables[0] );
if (results != null)
{
Iterator<DataObject> dataObjs = results.getData( );
return (dataObjs != null && dataObjs.hasNext( )) ? dataObjs.next( ) : null;
}
}
else
{
// use the latest and the one before that. If no results, try older versions
// if they exist
for (int i = databaseTables.length-1; i >= 0; --i)
{
String select = "select * from " + databaseTables[i] + " where object_id='" + resultID + "'";
IResultList results = executeQuery( null, select, dataSchemaName, databaseTables[i] );
if (results != null)
{
Iterator<DataObject> dataObjs = results.getData( );
return (dataObjs != null && dataObjs.hasNext( )) ? dataObjs.next( ) : null;
}
}
}
return null;
}
private String getSchemaName( IQuery query )
{
if (query == null) return this.dataSchemaName;
QueryField qf = query.getQueryField( DataObjectSchema.SCHEMA_PARAM );
if (qf != null)
{
return qf.getFieldValue();
}
return this.dataSchemaName;
}
/**
* Returns object_name, object_id plus all fields in the DataObject Schema
* that are:
* <ul>
* <li> fixed width < max query field width
* <li> have fixed values
* </ul>
*/
@Override
public Set<String> getQueryFields()
{
HashSet<String> queryFields = new HashSet<String>( );
queryFields.add( DataObject.OBJECT_NAME_PARAM );
queryFields.add( DataObject.OBJECT_ID_PARAM );
addQueryFields( queryFields, this.dataSchemaName );
return queryFields;
}
private void addQueryFields( HashSet<String> queryFields, String dataSchemaName )
{
if (dataSchemaName == null) return;
DataObjectSchemaManager dosm = getDataObjectSchemaManager( );
DataObjectSchema dos = dosm.getDataObjectSchema( dataSchemaName );
List<PropertyDescriptor> propDescriptors = dos.getPropertyDescriptors( );
if (propDescriptors != null)
{
for (int i = 0; i < propDescriptors.size(); i++)
{
PropertyDescriptor pd = propDescriptors.get( i );
if ( pd.isDataObject( ) )
{
String childSchemaName = pd.getDataObjectSchema( );
addQueryFields( queryFields, childSchemaName );
}
else if ( isSearchable( pd ))
{
queryFields.add( pd.getName( ) );
}
}
}
}
@Override
public Set<String> getNavigatorFields()
{
return null;
}
@Override
public Set<String> getResultFields()
{
HashSet<String> resultFields = new HashSet<String>( );
resultFields.add( DataObject.OBJECT_NAME_PARAM );
resultFields.add( DataObject.OBJECT_ID_PARAM );
if (dataSchemaName != null)
{
DataObjectSchemaManager dosm = getDataObjectSchemaManager( );
DataObjectSchema dos = dosm.getDataObjectSchema( this.dataSchemaName );
List<PropertyDescriptor> propDescriptors = (dos != null) ? dos.getPropertyDescriptors( ) : null;
if (propDescriptors != null)
{
for (int i = 0; i < propDescriptors.size(); i++)
{
PropertyDescriptor pd = propDescriptors.get( i );
resultFields.add( pd.getName( ) );
}
}
}
return resultFields;
}
@Override
public Iterator<String> getFinderFields()
{
Set<String> finderFields = new HashSet<String>( );
Set<String> resFields = getResultFields( );
finderFields.addAll( resFields );
Set<String> queryFields = getQueryFields( );
finderFields.addAll( queryFields );
return finderFields.iterator( );
}
@Override
public FinderField getFinderField( String name )
{
if (name.equals( DataObject.OBJECT_NAME_PARAM ))
{
FinderField nameField = new FinderField( );
nameField.setName( DataObject.OBJECT_NAME_PARAM );
nameField.setDisplayName( "Name" );
nameField.setDisplayable( true );
nameField.setSearchable( true );
return nameField;
}
else if (name.equals( DataObject.OBJECT_ID_PARAM ))
{
FinderField idField = new FinderField( );
idField.setName( DataObject.OBJECT_ID_PARAM );
idField.setDisplayName( "ID" );
idField.setDisplayable( true );
idField.setSearchable( true );
return idField;
}
else if (this.dataSchemaName != null)
{
DataObjectSchemaManager dosm = getDataObjectSchemaManager( );
DataObjectSchema dos = dosm.getDataObjectSchema( this.dataSchemaName );
PropertyDescriptor pd = (dos != null) ? dos.getPropertyDescriptor( name ) : null;
if (pd != null && pd.isDataObject( ) == false)
{
// create a FinderField from the PropertyDescriptor - return it.
FinderField ff = new FinderField( );
ff.setName( pd.getName( ) );
String displayName = (pd.getDisplayName( ) != null) ? pd.getDisplayName( ) : pd.getName( );
ff.setDisplayName( displayName );
ff.setDisplayable( true );
ff.setSearchable( isSearchable( pd ) );
ff.setIsFacet( false );
}
}
return null;
}
private boolean isSearchable( PropertyDescriptor pd )
{
int maxLength = pd.getMaximumLength( );
PropertyList propValues = pd.getPropertyValues( );
return (propValues != null || ( maxLength > 0 && maxLength < MAX_QUERY_FIELD_LENGTH ));
}
private DataObjectSchemaManager getDataObjectSchemaManager( )
{
if (this.dataObjectSchemaManager != null) return this.dataObjectSchemaManager;
synchronized( this )
{
if (this.dataObjectSchemaManager != null) return this.dataObjectSchemaManager;
IDataSourceFactory dataSourceFac = getDataSourceFactory( );
LOG.debug( "Creating DataObjectSchemaManager with data source: " + dataSourceFac );
if (this.dataObjectSchemaManagerClass != null)
{
try
{
LOG.debug( "Creating " + dataObjectSchemaManagerClass + " instance." );
this.dataObjectSchemaManager = (DataObjectSchemaManager)Class.forName( dataObjectSchemaManagerClass ).newInstance( );
this.dataObjectSchemaManager.setDataSourceFactoryName( this.dataSourceFactoryName );
}
catch ( Exception e )
{
}
}
else
{
this.dataObjectSchemaManager = new DataObjectSchemaManager( dataSourceFac );
}
}
return this.dataObjectSchemaManager;
}
private SQLTemplatePersistenceManager getSQLTemplatePersistenceManager( )
{
if (this.stpm != null) return this.stpm;
this.stpm = new SQLTemplatePersistenceManager( this.dataSourceFactoryName );
this.stpm.setDataObjectSchemaManager( getDataObjectSchemaManager( ) );
return this.stpm;
}
private SQLMethods getSQLMethods( )
{
if (this.sqlMethods != null) return this.sqlMethods;
LOG.debug( "Creating SQLMethods" );
IDataSourceFactory dataSourceFac = getDataSourceFactory( );
this.sqlMethods = new SQLMethods( dataSourceFac );
return this.sqlMethods;
}
private IDataSourceFactory getDataSourceFactory( )
{
if (this.dataSourceFactory != null) return this.dataSourceFactory;
synchronized ( this )
{
if (this.dataSourceFactoryName == null)
{
LOG.error( "No DataSourceFactory name set - cannot load DataSourceFactory!" );
return null;
}
ApplicationManager appMan = ApplicationManager.getInstance( );
this.dataSourceFactory = (IDataSourceFactory)appMan.getApplicationObject( dataSourceFactoryName, "DataSourceFactory" );
LOG.debug( "Got DataSourceFactory: " + dataSourceFactoryName + " = " + dataSourceFactory);
if (dataSourceFactory == null)
{
LOG.error( "Cannot load IDataSourceFactory: " + dataSourceFactoryName );
return null;
}
}
return this.dataSourceFactory;
}
private String[] getDatabaseTables( )
{
return getDatabaseTables( this.dataSchemaName );
}
private String[] getDatabaseTables( String schemaName )
{
if (schemaName.equals( SQLTemplatePersistenceManager.MASTER_TABLE ))
{
String[] tables = new String[1];
tables[0] = SQLTemplatePersistenceManager.MASTER_TABLE;
return tables;
}
DataObjectSchemaManager dosm = getDataObjectSchemaManager( );
int[] versions = dosm.getSchemaVersions( schemaName );
String[] tableNames = new String[ versions.length ];
for (int i = 0; i < versions.length; i++)
{
tableNames[i] = StringTransform.replaceSubstring(schemaName, " ", "_") + "_" + Integer.toString( versions[i] );
}
return tableNames;
}
@Override
public void setSourceFieldName( String sourceFieldName )
{
}
@Override
public FinderField getSourceField()
{
return null;
}
}
| [
"ted.sullivan@lucidworks.com"
] | ted.sullivan@lucidworks.com |
0a0f0278dda7bf9e758fdd4f213057b444c6882e | 42a00776dff8c757ff6295939509d66bf51b96b0 | /sharding-sphere-demo-7/src/main/java/cn/zwqh/shardingspheredemo7/entity/Order.java | 1e8d14f407bbddaf7f3eae9b0e4edc6b4a37ee31 | [] | no_license | zwqh1992/sharding-sphere-4.1.1 | ba62ee6fbcfd34fe4222a160100a5c312158facb | 559c518fe4b21e9b735d032912c002b2ef260149 | refs/heads/master | 2023-07-03T10:05:56.364635 | 2021-07-31T06:10:35 | 2021-07-31T06:10:35 | 385,891,840 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 203 | java | package cn.zwqh.shardingspheredemo7.entity;
import lombok.Data;
@Data
public class Order {
private long orderId;
private int userId;
private long addressId;
private String status;
} | [
"466595865@qq.com"
] | 466595865@qq.com |
028eb4346db6e6695d7e2e8d2a69aef5fbe8030b | c748264ea5a467a1d8791de9ef594261e34927b5 | /bctk-common/src/main/java/ytk/util/JsonUtils.java | e10773f70a58ada2bb28a42c3223166412f01191 | [] | no_license | Brotherc/testSystem | 1984bedae28227aa2e896baa3a78f12877e688d6 | 5f91d14bd90badbd8d74e4e7e0b4a8037cd2da29 | refs/heads/master | 2021-05-06T23:02:49.294130 | 2018-02-23T13:54:16 | 2018-02-23T13:54:16 | 112,894,658 | 5 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,239 | java | package ytk.util;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;
/**
* bc商城自定义响应结构
*/
public class JsonUtils {
// 定义jackson对象
private static final ObjectMapper MAPPER = new ObjectMapper();
/**
* 将对象转换成json字符串。
* <p>Title: pojoToJson</p>
* <p>Description: </p>
* @param data
* @return
*/
public static String objectToJson(Object data) {
try {
String string = MAPPER.writeValueAsString(data);
return string;
} catch (JsonProcessingException e) {
e.printStackTrace();
}
return null;
}
/**
* 将json结果集转化为对象
*
* @param jsonData json数据
* @param clazz 对象中的object类型
* @return
*/
public static <T> T jsonToPojo(String jsonData, Class<T> beanType) {
try {
T t = MAPPER.readValue(jsonData, beanType);
return t;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
/**
* 将json数据转换成pojo对象list
* <p>Title: jsonToList</p>
* <p>Description: </p>
* @param jsonData
* @param beanType
* @return
*/
public static <T>List<T> jsonToList(String jsonData, Class<T> beanType) {
JavaType javaType = MAPPER.getTypeFactory().constructParametricType(List.class, beanType);
try {
List<T> list = MAPPER.readValue(jsonData, javaType);
return list;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
public static <K,V>Map<K,V> jsonToMap(String jsonData, Class<K> keyType,Class<V> valueType) {
JavaType javaType = MAPPER.getTypeFactory().constructParametricType(LinkedHashMap.class,keyType, valueType);
try {
Map<K,V> map = MAPPER.readValue(jsonData, javaType);
return map;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
}
| [
"1157730239@qq.com"
] | 1157730239@qq.com |
d2cba356129c679cff311324b62a9e726a4dad98 | 11b9e34c78b3866e5206aba9388f51e00b0503ae | /GradleAndroidAnnotationProcessor/api/src/main/java/com/jurano/annotation/api/FullScreen.java | 35ae6d65d76e229bcae9496512f0f468e488618f | [] | no_license | JuranoSaurus/GradleAndroidAnnotationProcessor | af3cfd3a9294d82314a2bb9238979edc12638fd7 | 4f56751af191bb50ffaaba0e3830fb40d8cd035b | refs/heads/master | 2021-01-10T16:39:46.123173 | 2015-10-07T06:35:52 | 2015-10-07T06:35:52 | 43,795,292 | 4 | 2 | null | null | null | null | UTF-8 | Java | false | false | 115 | java | package com.jurano.annotation.api;
/**
* Created by SungGeun on 2015-10-07.
*/
public @interface FullScreen {
}
| [
"tjdrms0121@gmail.com"
] | tjdrms0121@gmail.com |
a12d2c62b3c6b90fe3215b3628d7e1cd971e1d2a | ae7a892207557c9621b2b0e92195170a585d33dd | /LttsActivity/src/com/ltts/HotelRoom.java | 392cadef542fbb27f0b338b06cea6f1ee20df18a | [] | no_license | LagnajitaSaha/LagnajitaRepoLtts | 56997ec7fbd68e796a66ce2a6125c2d425240fa6 | 1ca91a45b0f72581587d4ed779296f6c842b3023 | refs/heads/master | 2023-07-17T20:23:03.251908 | 2021-08-09T07:05:28 | 2021-08-09T07:05:28 | 392,530,132 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,165 | java | package com.ltts;
public class HotelRoom {
private String hotelName;
private Integer numberOfSqFeet;
private Boolean hasTV;
private Boolean hasWifi;
public HotelRoom(String hotelName, Integer numberOfSqFeet, Boolean hasTV, Boolean hasWifi) {
this.hotelName = hotelName;
this.numberOfSqFeet = numberOfSqFeet;
this.hasTV = hasTV;
this.hasWifi = hasWifi;
}
public Integer calculateTariff() {
Integer cost;
cost = this.numberOfSqFeet * this.getRatePerSqFeet();
return cost;
}
public Integer getRatePerSqFeet() {
return 0;
}
public String getHotelName() {
return hotelName;
}
public void setHotelName(String hotelName) {
this.hotelName = hotelName;
}
public Integer getNumberOfSqFeet() {
return numberOfSqFeet;
}
public void setNumberOfSqFeet(Integer numberOfSqFeet) {
this.numberOfSqFeet = numberOfSqFeet;
}
public Boolean getHasTV() {
return hasTV;
}
public void setHasTV(Boolean hasTV) {
this.hasTV = hasTV;
}
public Boolean getHasWifi() {
return hasWifi;
}
public void setHasWifi(Boolean hasWifi) {
this.hasWifi = hasWifi;
}
}
| [
"pc@DELL-07"
] | pc@DELL-07 |
7ab3cdfe5e0f7dc1052228f9212412facb04f915 | 9a30d751fd7029dc302e85d43c72747c256577c9 | /SpringCoreJsf/src/main/com/cynapsys/Launcher/Main.java | 316388ee26f3f8e6fefee8ef64fe2b853c7e214b | [] | no_license | oussamajd/test | 55916123bd0aeb68e533d05959535bb08258cdf1 | 91f2e0a6a5a9a8a88dfe0592330f077a7032ce1f | refs/heads/master | 2020-08-20T21:47:09.313721 | 2019-10-24T16:58:20 | 2019-10-24T16:58:20 | 216,069,581 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 442 | java | package main.com.cynapsys.Launcher;
import org.hibernate.Session;
import org.hibernate.Transaction;
import main.com.cynapsys.utils.*;
public class Main {
public static void main(String[] args) {
try {
Session session = HibernateUtil.getSessionFactory().openSession();
System.out.println("session is opened");
} catch (Exception e) {
// TODO: handle exception
System.err.println("error");
}
}
}
| [
"noreply@github.com"
] | noreply@github.com |
15d0c2d3b00da783d647717d38545ec2de176f91 | b9b7fb41ee1aecb89ae45c3af39c5cd104b8ad82 | /src/test/java/com/beit/ArchTest.java | d14ef44702e0a883056e9f7f5f374a59a06e26bc | [] | no_license | roudane1994/TestBeIt | 0bef720e48b7faa4a8f516a2236f5990305f5d50 | b3823184a5b30a5f933b98325a264a3c13dad241 | refs/heads/master | 2022-12-14T23:20:55.855264 | 2020-09-09T09:25:38 | 2020-09-09T09:25:38 | 294,055,733 | 0 | 0 | null | 2020-09-09T09:25:39 | 2020-09-09T08:49:03 | Java | UTF-8 | Java | false | false | 977 | java | package com.beit;
import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.noClasses;
import com.tngtech.archunit.core.domain.JavaClasses;
import com.tngtech.archunit.core.importer.ClassFileImporter;
import com.tngtech.archunit.core.importer.ImportOption;
import org.junit.jupiter.api.Test;
class ArchTest {
@Test
void servicesAndRepositoriesShouldNotDependOnWebLayer() {
JavaClasses importedClasses = new ClassFileImporter()
.withImportOption(ImportOption.Predefined.DO_NOT_INCLUDE_TESTS)
.importPackages("com.beit");
noClasses()
.that()
.resideInAnyPackage("com.beit.service..")
.or()
.resideInAnyPackage("com.beit.repository..")
.should()
.dependOnClassesThat()
.resideInAnyPackage("..com.beit.web..")
.because("Services and repositories should not depend on web layer")
.check(importedClasses);
}
}
| [
"jhipster-bot@jhipster.tech"
] | jhipster-bot@jhipster.tech |
8ec9623e1fa397dba6ee33d1eaa919f8913a099f | 267c4a19f55d85c0004c1379a3afd541aa3c7d38 | /src/main/java/com/guilherme/library/base/BaseRepository.java | 1c9b119b844af1020b59443a26f76e07eea314b8 | [] | no_license | guibperes/library-api | d7b7487f1ecaa586b0cc976bea25e2578c2d6cd3 | 1fb905796d7d6f41c40b3a07865e65068552e138 | refs/heads/master | 2021-05-16T19:45:36.715653 | 2020-03-27T20:34:55 | 2020-03-27T20:34:55 | 250,443,914 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 302 | java | package com.guilherme.library.base;
import java.util.UUID;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.NoRepositoryBean;
@NoRepositoryBean
public interface BaseRepository<ENTITY extends BaseEntity> extends JpaRepository<ENTITY, UUID> {
}
| [
"guibperes@gmail.com"
] | guibperes@gmail.com |
8ec9ff9d3e0284382e649b6771e31d14d5f390e5 | ada02ca6f323a870cdff0d05e2f1c834cef51d86 | /android/app/src/main/java/com/meetupmobile/MainActivity.java | 2408172ddfcbac795d901e60fa29a885cd27b269 | [] | no_license | gustavomelloti/meetup-mobile | ea18900e7c5c32468c9fbbbf6ffc2d0fa117d074 | b67481a4079c582bb2fe9d3cba5d52876dc84bc1 | refs/heads/master | 2023-01-20T03:32:43.461939 | 2019-10-17T17:41:36 | 2019-10-17T17:41:36 | 215,108,734 | 1 | 0 | null | 2023-01-04T22:53:46 | 2019-10-14T17:46:17 | JavaScript | UTF-8 | Java | false | false | 819 | java | package com.meetupmobile;
import com.facebook.react.ReactActivity;
import com.facebook.react.ReactActivityDelegate;
import com.facebook.react.ReactRootView;
import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;
public class MainActivity extends ReactActivity {
/**
* Returns the name of the main component registered from JavaScript. This is used to schedule
* rendering of the component.
*/
@Override
protected String getMainComponentName() {
return "meetupmobile";
}
@Override
protected ReactActivityDelegate createReactActivityDelegate() {
return new ReactActivityDelegate(this, getMainComponentName()) {
@Override
protected ReactRootView createRootView() {
return new RNGestureHandlerEnabledRootView(MainActivity.this);
}
};
}
}
| [
"gustavomelloti@gmail.com"
] | gustavomelloti@gmail.com |
80804ac18daec15cb73285fddf1ebe0ea5370774 | e3d5ffec1e7390d270b61d58fd0c12672ec89d6c | /app/src/main/java/com/forimm/Util/CustomInteraction.java | dfff8e27b3808eb1ab3ab28482c34502fe528ea3 | [] | no_license | qskeksq/AndroidProject_ForImm | f4d2ad811ec5a0575ff1c1b16a160628113b580d | 0436bd13935c78973d382cd16b97e00b0b1248b7 | refs/heads/master | 2021-09-04T11:29:01.344734 | 2018-01-18T09:06:45 | 2018-01-18T09:06:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 873 | java | package com.forimm.Util;
import android.content.Context;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import com.forimm.R;
/**
* Created by Administrator on 2017-07-11.
*/
public class CustomInteraction extends LinearLayout {
public CustomInteraction(Context context) {
super(context);
init(context);
}
public CustomInteraction(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
init(context);
}
public void init(Context context){
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View view = inflater.inflate(R.layout.custom_intertactionbar2, this, false);
addView(view);
}
}
| [
"qskeksq@gmail.com"
] | qskeksq@gmail.com |
355f056a5101fdc6385865ae4193f1f565ec4923 | bb272553506c22eb2fb2498056a2a827993d7840 | /DoAnKW/src/test/java/Object/Element.java | 143901b7e3dbc25ca5164bac3d08160d9a04761b | [] | no_license | BenjaminnNguyen/Draft | 796ffb48a6c99ab1c4813858ef04dd699fa10baa | f8bdd3061e40ae713a829b2930c4ce85af5cea2f | refs/heads/master | 2023-04-15T21:18:27.541956 | 2021-04-25T15:44:20 | 2021-04-25T15:44:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 409 | java | package Object;
public class Element {
public Element() {}
private String name, id, xpath;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getXpath() {
return xpath;
}
public void setXpath(String xpath) {
this.xpath = xpath;
}
}
| [
"nguyenquocbao.1999443@gmail.com"
] | nguyenquocbao.1999443@gmail.com |
2c4402b3627a3efa6e81c01885a10db258c2ae5f | 1b33a11306c4fe84cbc4468dd66bb15759d27d37 | /jTutorialsPoint/src/advanced/collections/HashMapDemo.java | 5debca7385c91b250a49c4976ae87aa49e4da0a6 | [] | no_license | hopo/hpJava | d1e9839e68d08bcaa5532ef949f7e19fde9137e1 | a5899681cbb8ee7b726056e13afc1794df7d6eca | refs/heads/master | 2020-03-15T21:08:48.091127 | 2018-05-19T06:06:44 | 2018-05-19T06:06:44 | 132,348,664 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,076 | java | package advanced.collections;
import java.util.*;
public class HashMapDemo {
public static void main(String args[]) {
// Create a hash map
HashMap hm = new HashMap();
// Put elements to the map
hm.put("Zara", new Double(3434.34));
hm.put("Mahnaz", new Double(123.22));
hm.put("Ayan", new Double(1378.00));
hm.put("Daisy", new Double(99.22));
hm.put("Quadir", new Double(-19.08));
// Get a set of the entries
Set set = hm.entrySet();
// Get an iteragtor
Iterator i = set.iterator();
// Display elements
while(i.hasNext()) {
Map.Entry me = (Map.Entry)i.next();
System.out.print(me.getKey() +": ");
System.out.println(me.getValue());
}
System.out.println();
// Deposti 1000 into Zara;s account
double balance = ((Double)hm.get("Zara")).doubleValue();
hm.put("Zara", new Double(balance + 1000));
System.out.println("Zara's new balance: " +hm.get("Zara"));
}
}
| [
"hpsight@gmail.com"
] | hpsight@gmail.com |
b96d0adf46cadb6a9c7e86f5db9e8041ae89d204 | 3a8aeba49339f264ce6397eb9a83343f43af9600 | /Ares/SamurAI/src/participants/ParticipantAI.java | 5be195d8fec47f0071b8a95b91ccdabf5687fb0e | [] | no_license | ELRainbowSea/EL | 36ddb76c6af1d546503121b686243c02b9a51c6a | b59013a04378bc6161fd52289ed053a1037055e5 | refs/heads/master | 2016-09-14T04:38:32.202941 | 2016-05-01T11:31:52 | 2016-05-01T11:31:52 | 57,439,845 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 404 | java | package participants;
import java.awt.Point;
public class ParticipantAI extends Participant{
@Override
public int Init(int turnsAll, int armyID, int samuraiID, int[] mapSize, int curePeriod, Point[] homePositions,
int[] ranks, int[] scores) {
// TODO Auto-generated method stub
return 0;
}
@Override
public String TurnControl() {
// TODO Auto-generated method stub
return null;
}
}
| [
"460715662@qq.com"
] | 460715662@qq.com |
67472b9d1417afab3483b5be61d08cbe6f75b899 | afbc1a726cd8ac14637df449c4e2dca653f4800f | /src/Processing/Cartesian.java | 2453390e703309859603aa63534a94dc904d526b | [] | no_license | itzmjauz/PAD | a931338d6f599c2eb41cc8983e8113bb016127e2 | 6c6fe85256267ab511861bea07007de3df53f9ff | refs/heads/master | 2021-01-15T10:29:44.165386 | 2015-08-21T16:41:37 | 2015-08-21T16:41:37 | 36,834,439 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,192 | java | package Processing;
import ui.Event;
import ui.UserInterfaceFactory;
import ui.DrawUserInterface;
import ui.Colour;
public class Cartesian implements View {
DrawUserInterface screen;
int WIDTH = 700;
int HEIGHT = 700;
int RATIO = 500;
int OFFSET = 50;
Cartesian() {
screen = UserInterfaceFactory.getDrawUI(WIDTH, HEIGHT);
}
public void draw(ClusterRow cluster) {
// every coordinate is from 0-1 so, we can just scale it with RATIO.
screen.clear();
drawInterface(cluster.data());
Colour colour;
for(int x = 0 ; x < cluster.size() ; x++) { // draw each cluster one by one
// every cluster should have its own colour so we do that here
System.out.println(x);
double[] numbers = cluster.get(x).getUnits().get(0).getRow().numberRow;
colour = generateColour(numbers);
enCircle(cluster.get(x), colour);
int size = cluster.get(x).getUnits().size();
for(int y = 0 ; y < size ; y++) {
int xCoordinate = (int) (cluster.get(x).getUnits().get(y).getNumber(0) * RATIO);
int yCoordinate = (int) (cluster.get(x).getUnits().get(y).getNumber(1) * RATIO);
screen.drawCircle(xCoordinate + OFFSET, yCoordinate + OFFSET, 10, 10, colour, true);
String name = cluster.get(x).getUnits().get(y).name;
screen.setCircleHotspot(xCoordinate + OFFSET, yCoordinate + OFFSET, 10, 10, name);
}
}
screen.showChanges();
screen.enableEventProcessing(true);
processEvents();
}
private void enCircle(Cluster cluster, Colour colour) {
if(cluster.size() > 1) { // we can't encircle nothing.
// compute the average x and y from all coords, thats the center of the circle
// compute the longest distance to any of the units within the cluster
// for the diameter
double xSum = 0.0;
double ySum = 0.0;
for(int x = 0 ; x < cluster.size() ; x++) {
xSum += (cluster.getUnits().get(x).getNumber(0) * RATIO);
ySum += (cluster.getUnits().get(x).getNumber(1) * RATIO);
}
double xCoordinate, yCoordinate;
xCoordinate = (xSum / cluster.size());
yCoordinate = (ySum / cluster.size());
int diameter = getDiameter(cluster, xCoordinate, yCoordinate);
screen.drawCircle((int) xCoordinate + OFFSET, (int) yCoordinate + OFFSET, diameter, diameter, colour, false);
screen.showChanges();
}
}
private int getDiameter(Cluster cluster, double xCoordinate, double yCoordinate) {
UnitRow units = cluster.getUnits();
double unitXCoordinate, unitYCoordinate, sqrt, distance, xDifference, yDifference;
double maxDistance = 0;
for(int x = 0 ; x < units.size() ; x++) {
unitXCoordinate = (units.get(x).getNumber(0) * RATIO);
unitYCoordinate = (units.get(x).getNumber(1) * RATIO);
xDifference = Math.abs(xCoordinate - unitXCoordinate);
yDifference = Math.abs(yCoordinate - unitYCoordinate);
sqrt = (xDifference * xDifference) + (yDifference * yDifference); // pythagoras
distance = Math.sqrt(sqrt);
if(distance > maxDistance) maxDistance = distance;
}
return (int) (maxDistance * 2);
}
private Colour generateColour(double[] seeds) {
// we cant make it random, so a formula on the unique data instead
int red = (int) (seeds[0] * 255);
int blue = (int) (seeds[1] * 255);
int green = (int) (seeds[1] * 255 * seeds[0]);
Colour colour = new Colour(red, green, blue);
return colour;
}
private void drawInterface(Dataset data) {
Colour colour = new Colour(0,0,0); // black ?
screen.drawLine(15, 15, WIDTH, 15, colour);
screen.drawLine(15, 15, 15, HEIGHT, colour);
screen.drawText(15, (HEIGHT - 30), data.variableNames[0], colour);
screen.drawText((WIDTH - 150), 15, data.variableNames[1], colour);
screen.showChanges();
}
public void processEvents() {
boolean spacePressed = false;
Event event;
while(!spacePressed) {
event = screen.getEvent();
if(event.data.equals("Space")) {
spacePressed = true;
} else if(event.name.equals("mouseover")) {
setStatus(event.data);
}
else {
System.out.println(event.name + " : " +event.data);
}
}
}
private void setStatus(String status) {
screen.clearStatusBar();
screen.printf("mimi" + status);
screen.showChanges();
}
}
| [
"itzmjauz@gmail.com"
] | itzmjauz@gmail.com |
ff1915eb70c09977a2617f8818eb12a07abb8741 | 171c446fac24b6083aa29f4e99e7a76bd26115e5 | /modules/core/src/main/java/no/kantega/publishing/admin/multimedia/ajax/ViewFolderAction.java | 6895cfd6555157eda5a925a18cfadc699b40059d | [
"Apache-2.0"
] | permissive | kantega/Flyt-cms | 0618992e9313e3e64f34d1f6a47ae5dfc9a48e21 | c42e60f836803bb367611ae4402fddf93186c8a1 | refs/heads/master | 2023-04-30T15:18:09.626323 | 2022-06-09T12:59:51 | 2022-06-09T12:59:51 | 30,144,098 | 10 | 3 | Apache-2.0 | 2023-04-14T18:05:14 | 2015-02-01T11:23:26 | Java | UTF-8 | Java | false | false | 2,473 | java | /*
* Copyright 2009 Kantega AS
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License
*/
package no.kantega.publishing.admin.multimedia.ajax;
import no.kantega.commons.client.util.RequestParameters;
import no.kantega.publishing.admin.AdminRequestParameters;
import no.kantega.publishing.admin.AdminSessionAttributes;
import no.kantega.publishing.common.data.Multimedia;
import no.kantega.publishing.common.service.MultimediaService;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class ViewFolderAction implements Controller {
private String view;
public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
RequestParameters params = new RequestParameters(request);
MultimediaService mediaService = new MultimediaService(request);
int folderId = params.getInt(AdminRequestParameters.ITEM_IDENTIFIER);
if (folderId == -1) {
Multimedia currentMultimedia = (Multimedia)request.getSession(true).getAttribute(AdminSessionAttributes.CURRENT_NAVIGATE_MULTIMEDIA);
if (currentMultimedia != null) {
folderId = currentMultimedia.getId();
} else {
folderId = 0;
}
}
Multimedia currentMultimedia = mediaService.getMultimedia(folderId);
List<Multimedia> mmlist = mediaService.getMultimediaList(folderId);
Map<String, Object> model = new HashMap<>();
model.put(AdminRequestParameters.MULTIMEDIA_CURRENT_FOLDER, currentMultimedia);
model.put(AdminRequestParameters.MULTIMEDIA_ITEMS_LIST, mmlist);
return new ModelAndView(view, model);
}
public void setView(String view) {
this.view = view;
}
}
| [
"marvin.lillehaug@gmail.com"
] | marvin.lillehaug@gmail.com |
5cabf71cfb7434ff78541d6d3d30a7ca6916dae3 | e7ee311e20b40c87bf6d23a53a1d7b11fd29d2c3 | /src/chosun/ciis/se/snd/dm/SE_SND_2520_LDM.java | fddf83b92b15b476cc7cb857010b5750b2eeb109 | [] | no_license | nosmoon/misdevteam | 4e3695ef7bbdcd231bb84d7d8d7df54a23ff0a60 | 1829d5bd489eb6dd307ca244f0e183a31a1de773 | refs/heads/master | 2020-04-15T15:57:05.480056 | 2019-01-10T01:12:01 | 2019-01-10T01:12:01 | 164,812,547 | 1 | 0 | null | null | null | null | UHC | Java | false | false | 7,295 | java | /***************************************************************************************************
* 파일명 :
* 기능 :
* 작성일자 :
* 작성자 :
***************************************************************************************************/
/***************************************************************************************************
* 수정내역 :
* 수정자 :
* 수정일자 :
* 백업 :
***************************************************************************************************/
package chosun.ciis.se.snd.dm;
import java.sql.*;
import oracle.jdbc.driver.*;
import somo.framework.db.*;
import somo.framework.util.*;
import chosun.ciis.se.snd.ds.*;
import chosun.ciis.se.snd.rec.*;
/**
*
*/
public class SE_SND_2520_LDM extends somo.framework.db.BaseDM implements java.io.Serializable{
public String cmpy_cd;
public String reg_dt;
public String reg_seq;
public String prt_plac_cd;
public String route_clsf;
public String cmpy_clsf;
public String incmg_pers;
public SE_SND_2520_LDM(){}
public SE_SND_2520_LDM(String cmpy_cd, String reg_dt, String reg_seq, String prt_plac_cd, String route_clsf, String cmpy_clsf, String incmg_pers){
this.cmpy_cd = cmpy_cd;
this.reg_dt = reg_dt;
this.reg_seq = reg_seq;
this.prt_plac_cd = prt_plac_cd;
this.route_clsf = route_clsf;
this.cmpy_clsf = cmpy_clsf;
this.incmg_pers = incmg_pers;
}
public void setCmpy_cd(String cmpy_cd){
this.cmpy_cd = cmpy_cd;
}
public void setReg_dt(String reg_dt){
this.reg_dt = reg_dt;
}
public void setReg_seq(String reg_seq){
this.reg_seq = reg_seq;
}
public void setPrt_plac_cd(String prt_plac_cd){
this.prt_plac_cd = prt_plac_cd;
}
public void setRoute_clsf(String route_clsf){
this.route_clsf = route_clsf;
}
public void setCmpy_clsf(String cmpy_clsf){
this.cmpy_clsf = cmpy_clsf;
}
public void setIncmg_pers(String incmg_pers){
this.incmg_pers = incmg_pers;
}
public String getCmpy_cd(){
return this.cmpy_cd;
}
public String getReg_dt(){
return this.reg_dt;
}
public String getReg_seq(){
return this.reg_seq;
}
public String getPrt_plac_cd(){
return this.prt_plac_cd;
}
public String getRoute_clsf(){
return this.route_clsf;
}
public String getCmpy_clsf(){
return this.cmpy_clsf;
}
public String getIncmg_pers(){
return this.incmg_pers;
}
public String getSQL(){
return "{ call CRMSAL_COM.SP_SE_SND_2520_L(? ,? ,? ,? ,? ,? ,? ,? ,? ,?) }";
}
public void setParams(CallableStatement cstmt, BaseDM bdm) throws SQLException{
SE_SND_2520_LDM dm = (SE_SND_2520_LDM)bdm;
cstmt.registerOutParameter(1, Types.VARCHAR);
cstmt.registerOutParameter(2, Types.VARCHAR);
cstmt.setString(3, dm.cmpy_cd);
cstmt.setString(4, dm.reg_dt);
cstmt.setString(5, dm.reg_seq);
cstmt.setString(6, dm.prt_plac_cd);
cstmt.setString(7, dm.route_clsf);
cstmt.setString(8, dm.cmpy_clsf);
cstmt.setString(9, dm.incmg_pers);
cstmt.registerOutParameter(10, OracleTypes.CURSOR);
}
public BaseDataSet createDataSetObject(){
return new chosun.ciis.se.snd.ds.SE_SND_2520_LDataSet();
}
public void print(){
System.out.println("SQL = " + this.getSQL());
System.out.println("cmpy_cd = [" + getCmpy_cd() + "]");
System.out.println("reg_dt = [" + getReg_dt() + "]");
System.out.println("reg_seq = [" + getReg_seq() + "]");
System.out.println("prt_plac_cd = [" + getPrt_plac_cd() + "]");
System.out.println("route_clsf = [" + getRoute_clsf() + "]");
System.out.println("cmpy_clsf = [" + getCmpy_clsf() + "]");
System.out.println("incmg_pers = [" + getIncmg_pers() + "]");
}
}
/*----------------------------------------------------------------------------------------------------
Web Tier에서 req.getParameter() 처리 및 결과확인 검사시 사용하십시오.
String cmpy_cd = req.getParameter("cmpy_cd");
if( cmpy_cd == null){
System.out.println(this.toString+" : cmpy_cd is null" );
}else{
System.out.println(this.toString+" : cmpy_cd is "+cmpy_cd );
}
String reg_dt = req.getParameter("reg_dt");
if( reg_dt == null){
System.out.println(this.toString+" : reg_dt is null" );
}else{
System.out.println(this.toString+" : reg_dt is "+reg_dt );
}
String reg_seq = req.getParameter("reg_seq");
if( reg_seq == null){
System.out.println(this.toString+" : reg_seq is null" );
}else{
System.out.println(this.toString+" : reg_seq is "+reg_seq );
}
String prt_plac_cd = req.getParameter("prt_plac_cd");
if( prt_plac_cd == null){
System.out.println(this.toString+" : prt_plac_cd is null" );
}else{
System.out.println(this.toString+" : prt_plac_cd is "+prt_plac_cd );
}
String route_clsf = req.getParameter("route_clsf");
if( route_clsf == null){
System.out.println(this.toString+" : route_clsf is null" );
}else{
System.out.println(this.toString+" : route_clsf is "+route_clsf );
}
String incmg_pers = req.getParameter("incmg_pers");
if( incmg_pers == null){
System.out.println(this.toString+" : incmg_pers is null" );
}else{
System.out.println(this.toString+" : incmg_pers is "+incmg_pers );
}
----------------------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------------------
Web Tier에서 req.getParameter() 처리시 사용하십시오.
String cmpy_cd = Util.checkString(req.getParameter("cmpy_cd"));
String reg_dt = Util.checkString(req.getParameter("reg_dt"));
String reg_seq = Util.checkString(req.getParameter("reg_seq"));
String prt_plac_cd = Util.checkString(req.getParameter("prt_plac_cd"));
String route_clsf = Util.checkString(req.getParameter("route_clsf"));
String incmg_pers = Util.checkString(req.getParameter("incmg_pers"));
----------------------------------------------------------------------------------------------------*//*----------------------------------------------------------------------------------------------------
Web Tier에서 한글처리와 동시에 req.getParameter() 처리시 사용하십시오.
String cmpy_cd = Util.Uni2Ksc(Util.checkString(req.getParameter("cmpy_cd")));
String reg_dt = Util.Uni2Ksc(Util.checkString(req.getParameter("reg_dt")));
String reg_seq = Util.Uni2Ksc(Util.checkString(req.getParameter("reg_seq")));
String prt_plac_cd = Util.Uni2Ksc(Util.checkString(req.getParameter("prt_plac_cd")));
String route_clsf = Util.Uni2Ksc(Util.checkString(req.getParameter("route_clsf")));
String incmg_pers = Util.Uni2Ksc(Util.checkString(req.getParameter("incmg_pers")));
----------------------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------------------
Web Tier에서 DM 파일의 변수를 설정시 사용하십시오.
dm.setCmpy_cd(cmpy_cd);
dm.setReg_dt(reg_dt);
dm.setReg_seq(reg_seq);
dm.setPrt_plac_cd(prt_plac_cd);
dm.setRoute_clsf(route_clsf);
dm.setIncmg_pers(incmg_pers);
----------------------------------------------------------------------------------------------------*/
/* 작성시간 : Tue Aug 04 20:32:25 KST 2009 */ | [
"DLCOM000@172.16.30.11"
] | DLCOM000@172.16.30.11 |
6d2e244eccff0bbec966a499165a3d6294686283 | e1b650dd57c3111d7ecb5ba3ed559a87f92f2755 | /all/src/main/java/javase/designpattern/future/RealData.java | f2138901c465111a5a12eb1660f17db8c7e3e096 | [] | no_license | txshyb/study | 9f3514fc85cfd18a64d4ca609feed732a452a52e | 4db17c271bfee778c829e708c5ae16b30969a11a | refs/heads/master | 2022-11-22T06:02:29.678673 | 2020-09-14T01:41:59 | 2020-09-14T01:41:59 | 133,443,260 | 0 | 2 | null | 2022-11-16T10:32:19 | 2018-05-15T01:43:25 | Java | UTF-8 | Java | false | false | 599 | java | package javase.designpattern.future;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* @author tangxiaoshuang
* @date 2018/5/26 9:27
*/
public class RealData implements Data {
private static Logger logger = LoggerFactory.getLogger(RealData.class);
public RealData() {
logger.info("耗时操作");
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
}
logger.info("耗时操作结束");
}
@Override
public String getResponse() {
return "dgggjkgjfs";
}
}
| [
"213@123.com"
] | 213@123.com |
731dad986ea36c8ae2accc7446a45c150220fe1b | 73d900b7d88d83c0be0b8e898f3f4976a13adc55 | /src/main/java/net/mowitnow/mower/reader/MowerInstructionSet.java | 4272c5a6f2e640721bb5d827ed8ee1781141cf26 | [] | no_license | emmanwl/motown | bfb404299650941721b09eb5b1ab016734330917 | 51f4b34a927279cbb7b35cd30cd46dc1f506ab51 | refs/heads/master | 2021-01-19T18:39:08.335285 | 2017-04-15T20:36:31 | 2017-04-15T20:36:31 | 88,370,404 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 933 | java | package net.mowitnow.mower.reader;
import net.mowitnow.mower.OrientedPosition;
import net.mowitnow.mower.Surface;
import net.mowitnow.mower.enums.CommandType;
import java.util.ArrayList;
import java.util.List;
public class MowerInstructionSet {
private OrientedPosition orientedPosition;
private final List<CommandType> commands = new ArrayList<CommandType>();
private final Surface surface;
public MowerInstructionSet(Surface surface) {
this.surface = surface;
}
public OrientedPosition getOrientedPosition() {
return orientedPosition;
}
public void setOrientedPosition(OrientedPosition orientedPosition) {
this.orientedPosition = orientedPosition;
}
public void setCommands(List<CommandType> commands) {
this.commands.addAll(commands);
}
public List<CommandType> getCommands() {
return commands;
}
public Surface getSurface(){
return surface;
}
}
| [
"emmanuel@lie-desktop.fr"
] | emmanuel@lie-desktop.fr |
03375ead71d96d935ccbc6024cd901836ed6c4bf | 34c4aa979cfb3c3216d70caa761d7fa6ad9b3453 | /src/HomeScreen.java | 92e531c7b413bdcfc4882ed814bf10fbd9ec5884 | [] | no_license | TylerRhiger/A-Math---Culminating | 2f1e19ea5ce377ec7b6284637067e73b463c7329 | 9d4dedde6919b6400ab999f2e30e97c623780b2a | refs/heads/master | 2020-03-21T08:00:10.569602 | 2018-06-22T14:38:29 | 2018-06-22T14:38:29 | 138,313,274 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,289 | 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.
*/
/**
*
* @author tyrhi4976
*/
public class HomeScreen extends javax.swing.JFrame {
/**
* Creates new form HomeScreen
*/
public HomeScreen() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jPopupMenu1 = new javax.swing.JPopupMenu();
jCheckBoxMenuItem1 = new javax.swing.JCheckBoxMenuItem();
jPanel1 = new javax.swing.JPanel();
jLabel2 = new javax.swing.JLabel();
jScrollPane1 = new javax.swing.JScrollPane();
messageTextArea = new javax.swing.JTextArea();
jLabel1 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
geometryButton = new javax.swing.JToggleButton();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
solveXButton = new javax.swing.JToggleButton();
conversionButton = new javax.swing.JToggleButton();
jMenuBar1 = new javax.swing.JMenuBar();
jMenu1 = new javax.swing.JMenu();
jMenu2 = new javax.swing.JMenu();
jCheckBoxMenuItem1.setSelected(true);
jCheckBoxMenuItem1.setText("jCheckBoxMenuItem1");
jPopupMenu1.add(jCheckBoxMenuItem1);
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jLabel2.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N
jLabel2.setText("Welcome to A + Math");
messageTextArea.setColumns(20);
messageTextArea.setRows(5);
jScrollPane1.setViewportView(messageTextArea);
jLabel1.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
jLabel1.setText("Class Messages");
geometryButton.setText("Click for test");
geometryButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
geometryButtonActionPerformed(evt);
}
});
jLabel4.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
jLabel4.setText("Conversions ------------>");
jLabel5.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
jLabel5.setText("Solve for 'X' ----------->");
jLabel6.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
jLabel6.setText("Geometry --------------->");
solveXButton.setText("Click for test");
solveXButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
solveXButtonActionPerformed(evt);
}
});
conversionButton.setText("Click for test");
conversionButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
conversionButtonActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addComponent(jLabel2)
.addGap(115, 115, 115))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(14, 14, 14)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(solveXButton))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addComponent(jLabel6)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(geometryButton))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addComponent(jLabel3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel4)
.addGap(18, 18, 18)
.addComponent(conversionButton)))
.addGap(37, 37, 37))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(54, 54, 54)
.addComponent(jLabel1)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(25, 25, 25)
.addComponent(jLabel2)
.addGap(11, 11, 11)
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 220, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(26, Short.MAX_VALUE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(conversionButton))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel3)
.addGap(61, 61, 61)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(solveXButton))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(geometryButton)
.addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(37, 37, 37))))
);
jMenu1.setText("File");
jMenuBar1.add(jMenu1);
jMenu2.setText("Edit");
jMenuBar1.add(jMenu2);
setJMenuBar(jMenuBar1);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void geometryButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_geometryButtonActionPerformed
this.setVisible(false);
new GeometryTest().setVisible(true); }//GEN-LAST:event_geometryButtonActionPerformed
private void solveXButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_solveXButtonActionPerformed
this.setVisible(false);
new SolveXTest().setVisible(true);
}//GEN-LAST:event_solveXButtonActionPerformed
private void conversionButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_conversionButtonActionPerformed
this.setVisible(false);
new UnitConversionTest().setVisible(true);
}//GEN-LAST:event_conversionButtonActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(HomeScreen.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(HomeScreen.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(HomeScreen.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(HomeScreen.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new HomeScreen().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JToggleButton conversionButton;
private javax.swing.JToggleButton geometryButton;
private javax.swing.JCheckBoxMenuItem jCheckBoxMenuItem1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JMenu jMenu1;
private javax.swing.JMenu jMenu2;
private javax.swing.JMenuBar jMenuBar1;
private javax.swing.JPanel jPanel1;
private javax.swing.JPopupMenu jPopupMenu1;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTextArea messageTextArea;
private javax.swing.JToggleButton solveXButton;
// End of variables declaration//GEN-END:variables
}
| [
"tyrhi4976@7J1N6Y1.Student.UGDSB.ED"
] | tyrhi4976@7J1N6Y1.Student.UGDSB.ED |
a7aec7df908a6efea7fbebf20923ee475704d5c6 | bbddeb279df2aededc825a7f5c772066814ab7ef | /app/src/main/java/com/echoesnet/eatandmeet/views/adapters/ClubOrderlListAdapter.java | 46a1dc784b73acc5d3dacffb3acff0e884aa1956 | [] | no_license | a35363507800/EatAndMeet | dfda19e0f761fa027ddcc40e2bb585a6b45a1a14 | a4dbc0c92be08f413ba9621c77d52e76244550f8 | refs/heads/master | 2020-03-31T12:35:37.136634 | 2018-10-10T01:25:58 | 2018-10-10T01:33:29 | 152,222,308 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 2,238 | java | package com.echoesnet.eatandmeet.views.adapters;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.echoesnet.eatandmeet.R;
import com.echoesnet.eatandmeet.controllers.EamApplication;
import com.echoesnet.eatandmeet.models.bean.ClubOrderDetailBean;
import com.echoesnet.eatandmeet.utils.GlideApp;
import java.util.List;
/**
* Copyright (C) 2017 在线回声(天津)科技发展有限公司
* 在线回声完全享有此软件的著作权,违者必究
*
* @author Administrator
* @version 1.0
* @modifier
* @createDate 2018/2/8
* @description
*/
public class ClubOrderlListAdapter extends BaseAdapter
{
private List<String> dishSource;
private Context mContext;
public ClubOrderlListAdapter(Context mContext, List<String> dishSource)
{
this.mContext = mContext;
this.dishSource = dishSource;
}
@Override
public int getCount()
{
return dishSource.size();
}
@Override
public Object getItem(int position)
{
return dishSource.get(position);
}
@Override
public long getItemId(int position)
{
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent)
{
ViewHolder holder = null;
if (convertView == null)
{
holder = new ViewHolder();
convertView = LayoutInflater.from(mContext).inflate(R.layout.litem_club_order_detail, parent, false);
holder.tvDishName = (TextView) convertView.findViewById(R.id.tv_dish_name);
holder.tvDishCount = (TextView) convertView.findViewById(R.id.tv_dish_count);
convertView.setTag(holder);
} else
{
holder = (ViewHolder) convertView.getTag();
}
String pName = dishSource.get(position);
holder.tvDishName.setText(pName);
holder.tvDishCount.setText("x1");
return convertView;
}
public final class ViewHolder
{
TextView tvDishName;
TextView tvDishCount;
}
}
| [
"lingcbyq@163.com"
] | lingcbyq@163.com |
cddd49e5de7385502662f56dca9a847651d7849a | e534e8227da4be3af28191e080f08def750fe783 | /Homework_3/BetterSorryState.java | 844fddde76925533bede6a0598b20bdb49875cbf | [] | no_license | TLutton/CS_131 | f7a817777296ba679a2f7243f8b81f4fb8b8c038 | dbcaff46ea19bde236c66c5cfe7d8716b0ea53dd | refs/heads/master | 2020-12-31T03:16:49.563214 | 2015-12-11T03:15:58 | 2015-12-11T03:15:58 | 43,234,550 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,147 | java | import java.util.concurrent.atomic.AtomicIntegerArray;
class BetterSorryState implements State {
private AtomicIntegerArray value;
private byte maxval;
BetterSorryState(byte[] v) {
int[] val = new int[v.length];
for(int i=0; i < v.length; ++i)
val[i] = (byte) v[i];
value = new AtomicIntegerArray(val);
maxval = 127;
}
BetterSorryState(byte[] v, byte m) {
int[] val = new int[v.length];
for(int i=0; i < v.length; ++i)
val[i] = (byte) v[i];
value = new AtomicIntegerArray(val);
maxval = m;
}
public int size() { return value.length(); }
public byte[] current() {
byte[] val = new byte[value.length()];
for(int i=0; i < value.length(); ++i)
val[i] = (byte) value.get(i);
return val;
}
public boolean swap(int i, int j) {
if (value.get(i) <= 0 || value.get(j) >= maxval) {
return false;
}
//value.set(i, value.get(i)-1);
//value.set(j, value.get(j)+1);
value.getAndDecrement(i);
value.getAndIncrement(j);
return true;
}
}
| [
"tlutton@ucla.edu"
] | tlutton@ucla.edu |
3a45ba140fce9d0741e3c0c84da01d8d54ad6ef7 | bd169445a56bb34a5c5be6876babf1cf0785cb13 | /src/main/java/com/mmall/concurrency/example/aqs/CountDownLatchExample2.java | 9dd33cd4b5b609e2aeae74adb7c73cbf24749334 | [] | no_license | liuhanchang/concurrency | ce229bb5fd1c514a7e3a7048849729fc2f03633e | 6486b68ecea5f13efa5d8ca2c5ca73b5ccd81411 | refs/heads/master | 2020-06-16T14:58:25.775361 | 2019-07-09T00:37:18 | 2019-07-09T00:37:18 | 195,616,085 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,255 | java | package com.mmall.concurrency.example.aqs;
import lombok.extern.slf4j.Slf4j;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
@Slf4j
public class CountDownLatchExample2 {
private static int threadCount=200;
public static void main(String[] args) throws InterruptedException {
ExecutorService exec = Executors.newCachedThreadPool();
final CountDownLatch countDownLatch= new CountDownLatch(threadCount);
for (int i = 0; i < threadCount; i++) {
final int threadNum = i;
exec.execute(()->{
try {
test(threadNum);
} catch (Exception e) {
log.error("exception",e);
e.printStackTrace();
}finally {
countDownLatch.countDown();
}
});
}
countDownLatch.await(10, TimeUnit.MILLISECONDS);
log.info("finish");
exec.shutdown();//并不会直接杀死所有线程
}
private static void test(int threadNum) throws Exception {
Thread.sleep(100);
log.info("{}",threadNum);
}
}
| [
"hanchang.liu@capitalonline.net"
] | hanchang.liu@capitalonline.net |
dc95b67009da079791f06cf2ff9afeee54375225 | f7acd6176f8983a2b0d5f0184a7c14680c937363 | /restassured-asciidoctor/src/integration/java/net/entrofi/spring/restassuredasciidoctor/data/repository/NoteRepositoryIntTest.java | c803c285a76fca48768345f239ccc973fc2d28f2 | [] | no_license | entrofi/spring | 8b6f552da6126066e146d23093d88c060efde9a1 | 4a494039648f8f516f7e99db89586e8e879d31b8 | refs/heads/master | 2022-12-01T20:03:48.579731 | 2021-07-16T16:39:03 | 2021-07-16T16:39:03 | 21,819,427 | 0 | 2 | null | 2022-11-24T07:00:17 | 2014-07-14T12:55:53 | Java | UTF-8 | Java | false | false | 1,805 | java | package net.entrofi.spring.restassuredasciidoctor.data.repository;
import io.restassured.http.ContentType;
import io.restassured.specification.RequestSpecification;
import net.entrofi.spring.restassuredasciidoctor.RestAssuredAsciiDoctorApplication;
import net.entrofi.spring.restassuredasciidoctor.data.entity.Note;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.autoconfigure.restdocs.AutoConfigureRestDocs;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.HttpStatus;
import org.springframework.test.context.junit4.SpringRunner;
import static io.restassured.RestAssured.given;
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT;
import static org.springframework.restdocs.restassured3.RestAssuredRestDocumentation.document;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = {RestAssuredAsciiDoctorApplication.class}, webEnvironment = RANDOM_PORT)
@AutoConfigureRestDocs
public class NoteRepositoryIntTest {
@Value("${local.server.port}")
private int port;
@Value("${deployment.environment.host:http://localhost}")
private String host;
@Autowired
private RequestSpecification documentationSpec;
@Test
public void saveNote_given_a_valid_note_request_should_return_created() {
Note note = new Note("Documented call", "Documented call details");
given(documentationSpec).filter(document("save-note-created"))
.body(note).contentType(ContentType.JSON)
.when().post(host + "/" + "notes")
.then().statusCode(HttpStatus.CREATED.value());
}
}
| [
"entrofi@gmail.com"
] | entrofi@gmail.com |
82d832394269fa5ee4acc90d2b44149bfa6ce1c2 | 6175cf1a66a26aa30f5b77b72fda31bb3282880b | /bankgateway/src/test/java/com/org/kris/bankgateway/BankgatewayApplicationTests.java | d51e661b2a4f39583dfce0247d928b4dbb197a8a | [] | no_license | krishanthan22/CompltdProjct | 9d4602ae95738b6e6ce578d2d1a1fa7a7a8c2d39 | 8dc008e58986c86fb80d479314c89e775eec737b | refs/heads/main | 2023-04-19T06:47:26.720663 | 2021-04-19T16:02:39 | 2021-04-19T16:02:39 | 359,517,852 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 220 | java | package com.org.kris.bankgateway;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class BankgatewayApplicationTests {
@Test
void contextLoads() {
}
}
| [
"noreply@github.com"
] | noreply@github.com |
660c8eab104f6ac49ced553176b9aeb3f2cb4767 | b414762fea124666e801b9c557e49ac0b3f4d347 | /src/java/wyv/servicios/ServicioClienteImp.java | b74650b999652540905599f39915316552ea1caa | [] | no_license | rfloresta/punto-venta | 431014ae157de213f0ef2710f54e27a389829f61 | 2c668fe2ef8d082ec428e6bed9914ddc3da3949c | refs/heads/master | 2022-12-16T10:09:15.111176 | 2020-09-15T21:27:56 | 2020-09-15T21:27:56 | 295,847,707 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,624 | java |
package wyv.servicios;
import java.util.List;
import wyv.persistencia.Cliente;
import wyv.persistencia.DaoCliente;
import wyv.persistencia.Venta;
import wyv.presentacion.EntradaCliente;
public class ServicioClienteImp implements ServicioCliente {
DaoCliente daoClie;
Cliente clie;
public void setDaoClie(DaoCliente daoClie) {
this.daoClie = daoClie;
}
@Override
public String registrarCliente(EntradaCliente entCli) {
clie=new Cliente();
clie.setIdcli(entCli.getId());
clie.setNomCli(entCli.getNom());
clie.setTeleCli(entCli.getTelf());
clie.setDireCli(entCli.getDirecc());
clie.setEmail(entCli.getEmail());
clie.setDni(entCli.getDni());
return daoClie.grabarCliente(clie);
}
@Override
public List listarCliente() {
return daoClie.listarCliente();
}
@Override
public void nuevoCliente() {
clie=new Cliente();
}
@Override
public String eliminarCliente(int id) {
return daoClie.eliminarCliente(id);
}
@Override
public Cliente buscarCliente(int id) {
return daoClie.buscarCliente(id);
}
@Override
public String editarCliente(EntradaCliente ent, List<Venta> ventas) {
clie=new Cliente();
clie.setIdcli(ent.getId());
clie.setNomCli(ent.getNom());
clie.setTeleCli(ent.getTelf());
clie.setDireCli(ent.getDirecc());
clie.setEmail(ent.getEmail());
clie.setDni(ent.getDni());
clie.setVentaList(ventas);
return daoClie.editarCliente(clie);
}
}
| [
"rfloresta@autonoma.edu.pe"
] | rfloresta@autonoma.edu.pe |
8e226322de5c08d471c7a72484b469b6c496a6e5 | 082e26b011e30dc62a62fae95f375e4f87d9e99c | /docs/weixin_7.0.4_source/反编译源码/反混淆后/src/main/java/com/google/firebase/analytics/connector/C41643a.java | 05670b3de9ca0047194b38ec33f95940d4bc7383 | [] | no_license | xsren/AndroidReverseNotes | 9631a5aabc031006e795a112b7ac756a8edd4385 | 9202c276fe9f04a978e4e08b08e42645d97ca94b | refs/heads/master | 2021-04-07T22:50:51.072197 | 2019-07-16T02:24:43 | 2019-07-16T02:24:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 383 | java | package com.google.firebase.analytics.connector;
import android.os.Bundle;
import com.google.android.gms.common.annotation.KeepForSdk;
/* renamed from: com.google.firebase.analytics.connector.a */
public interface C41643a {
@KeepForSdk
void logEvent(String str, String str2, Bundle bundle);
@KeepForSdk
void setUserProperty(String str, String str2, Object obj);
}
| [
"alwangsisi@163.com"
] | alwangsisi@163.com |
3fa1e2edaa26d19c1f2e326d04fdf7290b27f8dd | 99f865eb6a365fa3819256e21eff3537484dbebc | /src/demo/CloneTest1.java | 88b28f742f1720b7219126d776add3afe219ecb3 | [] | no_license | GeorgeBely/JFreeChartDemo | 16dc2b1b90de3dca8e2c79f9c37732cd8e44325a | 977d9712c2c85973846162525100b6e0bff0a583 | refs/heads/master | 2021-05-04T09:54:43.795704 | 2017-06-01T07:19:44 | 2017-06-01T07:19:44 | 48,791,828 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,714 | java | // Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space
package demo;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JPanel;
import org.jfree.chart.*;
import org.jfree.chart.axis.ValueAxis;
import org.jfree.chart.plot.XYPlot;
import org.jfree.data.time.*;
import org.jfree.data.xy.XYDataset;
import org.jfree.ui.ApplicationFrame;
import org.jfree.ui.RefineryUtilities;
public class CloneTest1 extends ApplicationFrame
implements ActionListener
{
private TimeSeries series;
private double lastValue;
public CloneTest1(String s)
{
super(s);
lastValue = 100D;
series = new TimeSeries("Random Data");
TimeSeriesCollection timeseriescollection = new TimeSeriesCollection(series);
JFreeChart jfreechart = createChart(timeseriescollection);
JFreeChart jfreechart1 = null;
try
{
jfreechart1 = (JFreeChart)jfreechart.clone();
}
catch (Exception exception)
{
exception.printStackTrace();
}
XYPlot xyplot = (XYPlot)jfreechart1.getPlot();
TimeSeriesCollection timeseriescollection1 = (TimeSeriesCollection)xyplot.getDataset();
series = timeseriescollection1.getSeries(0);
ChartPanel chartpanel = new ChartPanel(jfreechart1);
JButton jbutton = new JButton("Add New Data Item");
jbutton.setActionCommand("ADD_DATA");
jbutton.addActionListener(this);
JPanel jpanel = new JPanel(new BorderLayout());
jpanel.add(chartpanel);
jpanel.add(jbutton, "South");
chartpanel.setPreferredSize(new Dimension(500, 270));
setContentPane(jpanel);
}
private JFreeChart createChart(XYDataset xydataset)
{
JFreeChart jfreechart = ChartFactory.createTimeSeriesChart("Clone Test 1", "Time", "Value", xydataset, true, true, false);
XYPlot xyplot = (XYPlot)jfreechart.getPlot();
ValueAxis valueaxis = xyplot.getDomainAxis();
valueaxis.setAutoRange(true);
valueaxis.setFixedAutoRange(60000D);
return jfreechart;
}
public void actionPerformed(ActionEvent actionevent)
{
if (actionevent.getActionCommand().equals("ADD_DATA"))
{
double d = 0.90000000000000002D + 0.20000000000000001D * Math.random();
lastValue = lastValue * d;
Millisecond millisecond = new Millisecond();
System.out.println("Now = " + millisecond.toString());
series.add(new Millisecond(), lastValue);
}
}
public static void main(String args[])
{
CloneTest1 clonetest1 = new CloneTest1("JFreeChart : Clone Test 1");
clonetest1.pack();
RefineryUtilities.centerFrameOnScreen(clonetest1);
clonetest1.setVisible(true);
}
}
| [
"man240893@mail.ru"
] | man240893@mail.ru |
26d4111e9b827d7c5cff2f27c94760d09f082476 | 80e4b0a1b52a75da9d76b59d08662bcb0e6a0282 | /test/QuestionTest.java | d267c807af256f3f7347fce9f351fa5f4a4a1bab | [] | no_license | icewinger/JY3-Java | b521d657890fcd71a4bd04663d7d1608200978cb | 436d26a253431380cd4038ba4089dde08f57f63b | refs/heads/master | 2020-05-04T16:15:22.022475 | 2019-05-05T13:21:20 | 2019-05-05T13:21:20 | 179,273,170 | 0 | 0 | null | null | null | null | WINDOWS-1252 | Java | false | false | 349 | java | package com.neuedu.Test01;
public class QuestionTest {
String text;
int num;
String[] asw;
public boolean check(String[] answer)
{
return false;
}
public void print()
{
System.out.println("ÌâºÅ"+num+","+text);
//ÔöÇ¿forÑ»·
for (String ans :asw)
{
System.out.println(" "+ans);
}
System.out.println();
}
}
| [
"18622909040.163.com name=gjghg"
] | 18622909040.163.com name=gjghg |
096d4e0e0b11b2d4450d76fa337155cf149be237 | 83943f941708b6db4d2597e3f3b0978bb34cb56d | /services/plansProposalsFacade/plansProposalsFacade-portlet/src/main/java/com/ext/portlet/service/impl/ImpactDefaultSeriesDataServiceImpl.java | af9fc26a1170a4533899452e31c365662d6d4fc6 | [
"MIT"
] | permissive | jccarrillo/XCoLab | 138b30061867cbba308bcc30057af61d07748198 | 647437de900229d8cb0c4248f99e399cfdddda44 | refs/heads/master | 2021-01-17T09:55:41.848269 | 2016-07-26T09:22:09 | 2016-07-26T09:22:09 | 62,179,305 | 0 | 0 | null | 2016-06-28T22:50:57 | 2016-06-28T22:50:54 | null | UTF-8 | Java | false | false | 1,133 | java | package com.ext.portlet.service.impl;
import com.ext.portlet.service.base.ImpactDefaultSeriesDataServiceBaseImpl;
/**
* The implementation of the impact default series data remote service.
*
* <p>
* All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy their definitions into the {@link com.ext.portlet.service.ImpactDefaultSeriesDataService} interface.
*
* <p>
* This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS credentials because this service can be accessed remotely.
* </p>
*
* @author Brian Wing Shun Chan
* @see com.ext.portlet.service.base.ImpactDefaultSeriesDataServiceBaseImpl
* @see com.ext.portlet.service.ImpactDefaultSeriesDataServiceUtil
*/
public class ImpactDefaultSeriesDataServiceImpl
extends ImpactDefaultSeriesDataServiceBaseImpl {
/*
* NOTE FOR DEVELOPERS:
*
* Never reference this interface directly. Always use {@link com.ext.portlet.service.ImpactDefaultSeriesDataServiceUtil} to access the impact default series data remote service.
*/
}
| [
"klemens.mang@me.com"
] | klemens.mang@me.com |
de6127afbf4ba35fb4975d15f9ebe2bc6eb9c045 | d0e61d767e3fae4a60fbc4f0ddb3b3a1aba0d34b | /experiments/flink-experiment/src/main/java/edu/upenn/flumina/valuebarrier/ValueProcessManual.java | 4b26e89f8b33494589b486d985c9e6f8445e8190 | [
"MIT"
] | permissive | angelhof/flumina | d53bddaecda4dc2f33a6aeac1fbc7c5fd9a73f0d | abc61255749e75ec147c0739a5ed0abc1b3e767a | refs/heads/master | 2022-06-26T00:23:44.529797 | 2022-06-08T05:00:32 | 2022-06-08T05:00:48 | 239,618,776 | 14 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,836 | java | package edu.upenn.flumina.valuebarrier;
import edu.upenn.flumina.remote.ForkJoinService;
import edu.upenn.flumina.valuebarrier.data.Barrier;
import edu.upenn.flumina.valuebarrier.data.BarrierOrHeartbeat;
import edu.upenn.flumina.valuebarrier.data.Value;
import edu.upenn.flumina.valuebarrier.data.ValueOrHeartbeat;
import org.apache.flink.configuration.Configuration;
import org.apache.flink.streaming.api.functions.co.BroadcastProcessFunction;
import org.apache.flink.util.Collector;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.time.Instant;
import java.util.ArrayDeque;
import java.util.Collections;
import java.util.List;
import java.util.Queue;
import static edu.upenn.flumina.time.TimeHelper.min;
public class ValueProcessManual extends BroadcastProcessFunction<ValueOrHeartbeat, BarrierOrHeartbeat, Void> {
private Instant valuePhysicalTimestamp = Instant.MIN;
private Instant barrierPhysicalTimestamp = Instant.MIN;
private long sum = 0;
private final Queue<Value> unprocessedValues = new ArrayDeque<>();
private final Queue<Barrier> unprocessedBarriers = new ArrayDeque<>();
private final String rmiHost;
private final String valueBarrierServiceName;
private transient ForkJoinService<Long, Long> valueBarrierService;
public ValueProcessManual(final String rmiHost, final String valueBarrierServiceName) {
this.rmiHost = rmiHost;
this.valueBarrierServiceName = valueBarrierServiceName;
}
@Override
@SuppressWarnings("unchecked")
public void open(final Configuration parameters) throws RemoteException, NotBoundException {
final var registry = LocateRegistry.getRegistry(rmiHost);
valueBarrierService = (ForkJoinService<Long, Long>) registry.lookup(valueBarrierServiceName);
}
@Override
public void processElement(final ValueOrHeartbeat valueOrHeartbeat,
final ReadOnlyContext ctx,
final Collector<Void> out) throws RemoteException {
unprocessedValues.addAll(valueOrHeartbeat.match(List::of, hb -> Collections.emptyList()));
valuePhysicalTimestamp = valueOrHeartbeat.getPhysicalTimestamp();
makeProgress();
}
@Override
public void processBroadcastElement(final BarrierOrHeartbeat barrierOrHeartbeat,
final Context ctx,
final Collector<Void> out) throws RemoteException {
unprocessedBarriers.addAll(barrierOrHeartbeat.match(List::of, hb -> Collections.emptyList()));
barrierPhysicalTimestamp = barrierOrHeartbeat.getPhysicalTimestamp();
makeProgress();
}
private void makeProgress() throws RemoteException {
final var currentTime = min(valuePhysicalTimestamp, barrierPhysicalTimestamp);
while (!unprocessedValues.isEmpty() &&
unprocessedValues.element().getPhysicalTimestamp().compareTo(currentTime) <= 0) {
final var value = unprocessedValues.remove();
while (!unprocessedBarriers.isEmpty() &&
unprocessedBarriers.element().getPhysicalTimestamp().isBefore(value.getPhysicalTimestamp())) {
join(unprocessedBarriers.remove());
}
update(value);
}
while (!unprocessedBarriers.isEmpty() &&
unprocessedBarriers.element().getPhysicalTimestamp().compareTo(currentTime) <= 0) {
join(unprocessedBarriers.remove());
}
}
private void update(final Value value) {
sum += value.val;
}
private void join(final Barrier barrier) throws RemoteException {
sum = valueBarrierService.joinChild(getRuntimeContext().getIndexOfThisSubtask(), sum);
}
}
| [
"fniksic@seas.upenn.edu"
] | fniksic@seas.upenn.edu |
209b4a1677291977cbbbdf1eb0a9732a8444a0a0 | e7d160a38dda60772fcebde43f4d0fbf8ced9e25 | /iso_project/src/main/java/com/iso/dashboard/service/StepMngtService.java | 18c12e72f239d0dbb5b0c242891b1406efa941cd | [
"Apache-2.0"
] | permissive | vietbrother/iso_hagiang | 40902ec6022342f7d0b056ffbcb97e77f32d7903 | 347906368465527c7066c3b6916f240f4e7fa787 | refs/heads/master | 2021-09-23T00:39:15.054639 | 2018-09-19T08:01:01 | 2018-09-19T08:01:01 | 115,574,808 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,189 | 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.iso.dashboard.service;
import com.iso.dashboard.dao.StepDAO;
import com.iso.dashboard.dto.CStep;
import com.iso.dashboard.dto.ResultDTO;
import java.util.List;
/**
*
* @author Thuclt-VNPTTech
*/
public class StepMngtService {
private static StepMngtService service;
public static StepMngtService getInstance() {
if (service == null) {
service = new StepMngtService();
}
return service;
}
public ResultDTO addCStep(CStep et) {
return StepDAO.getInstance().addCStep(et);
}
public ResultDTO updateCStep(CStep et) {
return StepDAO.getInstance().updateCStep(et);
}
public List<CStep> listCSteps(String key) {
return StepDAO.getInstance().listCSteps(key);
}
public CStep getCStepById(String id) {
return StepDAO.getInstance().getCStepById(String.valueOf(id));
}
public ResultDTO removeCStep(String id) {
return StepDAO.getInstance().removeCStep(id);
}
}
| [
"anhmv@vnpt-technology.vn"
] | anhmv@vnpt-technology.vn |
22054762b8466f3c6eb5c8dace1cb9f652f9ec0b | c53d9eda084b38b5d9aed933c6861ed74223e394 | /Mediathek_Vorlage_Blatt01-03/src/VerleihService.java | 5befb00fa922e044771553f352edc95b494d6ace | [] | no_license | nahutri/SE2-2020-Week1-3 | 37ffd6184e44bc8297a2506dd06eee528e9390bf | eff63773d49e299c71c5bfe823f04b42b624b37e | refs/heads/master | 2022-11-22T14:38:14.927722 | 2020-05-07T16:56:49 | 2020-05-07T16:56:49 | 281,692,504 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,395 | java | import java.util.List;
/**
* Der VerleihService erlaubt es, Medien auszuleihen und zurückzugeben.
*
* Für jedes ausgeliehene Medium wird eine neue Verleihkarte angelegt. Wird das
* Medium wieder zurückgegeben, so wird diese Verleihkarte wieder gelöscht.
*
* VerleihService ist ein ObservableService, als solcher bietet er die
* Möglichkeit über Verleihvorgänge zu informieren. Beobachter müssen das
* Interface ServiceObserver implementieren.
*
* @author SE2-Team
* @version SoSe 2020
*/
public interface VerleihService extends ObservableService
{
/**
* Textrepräsentation für das Ereignis Ausleihe.
*/
public static final String EREIGNIS_AUSLEIHE = "Ausleihe";
/**
* Textrepräsentation für das Ereignis Rückgabe.
*/
public static final String EREIGNIS_RUECKGABE = "Rückgabe";
/**
* Verleiht Medien an einen Kunden. Dabei wird für jedes Medium eine neue
* Verleihkarte angelegt.
*
* @param kunde Ein Kunde, an den ein Medium verliehen werden soll
* @param medien Die Medien, die verliehen werden sollen
* @param ausleihDatum Der erste Ausleihtag
*
* @require kundeImBestand(kunde)
* @require sindAlleNichtVerliehen(medien)
* @require ausleihDatum != null
*
* @ensure sindAlleVerliehen(medien)
*
*/
void verleiheAn(Kunde kunde, List<Medium> medien, Datum ausleihDatum);
/**
* Prüft ob die ausgewählten Medium für den Kunde ausleihbar sind
*
* @param kunde Der Kunde für den geprüft werden soll
* @param medien Die medien
*
*
* @return true, wenn das entleihen für diesen Kunden möglich ist, sonst
* false
*
* @require kundeImBestand(kunde)
* @require medienImBestand(medien)
*
*/
boolean istVerleihenMoeglich(Kunde kunde, List<Medium> medien);
/**
* Liefert den Entleiher des angegebenen Mediums.
*
* @param medium Das Medium.
*
* @return Den Entleiher des Mediums.
*
* @require istVerliehen(medium)
*
* @ensure result != null
*/
Kunde getEntleiherFuer(Medium medium);
/**
* Liefert alle Medien, die von dem gegebenen Kunden ausgeliehen sind.
*
* @param kunde Der Kunde.
* @return Alle Medien, die von dem gegebenen Kunden ausgeliehen sind.
* Liefert eine leere Liste, wenn der Kunde aktuell nichts
* ausgeliehen hat.
*
* @require kundeImBestand(kunde)
*
* @ensure result != null
*/
List<Medium> getAusgelieheneMedienFuer(Kunde kunde);
/**
* @return Eine Listenkopie aller Verleihkarten. Für jedes ausgeliehene
* Medium existiert eine Verleihkarte. Ist kein Medium verliehen,
* wird eine leere Liste zurückgegeben.
*
* @ensure result != null
*/
List<Verleihkarte> getVerleihkarten();
/**
* Nimmt zuvor ausgeliehene Medien zurück. Die entsprechenden Verleihkarten
* werden gelöscht.
*
* @param medien Die Medien.
* @param rueckgabeDatum Das Rückgabedatum.
*
* @require sindAlleVerliehen(medien)
* @require rueckgabeDatum != null
*
* @ensure sindAlleNichtVerliehen(medien)
*/
void nimmZurueck(List<Medium> medien, Datum rueckgabeDatum);
/**
* Prüft ob das angegebene Medium verliehen ist.
*
* @param medium Ein Medium, für das geprüft werden soll ob es verliehen
* ist.
* @return true, wenn das gegebene medium verliehen ist, sonst false.
*
* @require mediumImBestand(medium)
*/
boolean istVerliehen(Medium medium);
/**
* Prüft ob alle angegebenen Medien nicht verliehen sind.
*
* @param medien Eine Liste von Medien.
* @return true, wenn alle gegebenen Medien nicht verliehen sind, sonst
* false (auch wenn die Liste leer ist).
*
* @require medienImBestand(medien)
*/
boolean sindAlleNichtVerliehen(List<Medium> medien);
/**
* Prüft ob alle angegebenen Medien verliehen sind.
*
* @param medien Eine Liste von Medien.
*
* @return true, wenn alle gegebenen Medien verliehen sind, sonst false
* (auch wenn die Liste leer ist).
*
* @require medienImBestand(medien)
*/
boolean sindAlleVerliehen(List<Medium> medien);
/**
* Prüft ob der angebene Kunde existiert. Ein Kunde existiert, wenn er im
* Kundenstamm enthalten ist.
*
* @param kunde Ein Kunde.
* @return true wenn der Kunde existiert, sonst false.
*
* @require kunde != null
*/
boolean kundeImBestand(Kunde kunde);
/**
* Prüft ob das angebene Medium existiert. Ein Medium existiert, wenn es im
* Medienbestand enthalten ist.
*
* @param medium Ein Medium.
* @return true wenn das Medium existiert, sonst false.
*
* @require medium != null
*/
boolean mediumImBestand(Medium medium);
/**
* Prüft ob die angebenen Medien existierien. Ein Medium existiert, wenn es
* im Medienbestand enthalten ist.
*
* @param medien Eine Liste von Medien.
* @return true wenn die Medien existieren, sonst false.
*
* @require medien != null
* @require !medien.isEmpty()
*/
boolean medienImBestand(List<Medium> medien);
/**
* Gibt alle Verleihkarten für den angegebenen Kunden zurück.
*
* @param kunde Ein Kunde.
* @return Alle Verleihkarten des angebenen Kunden. Eine leere Liste, wenn
* der Kunde nichts entliehen hat.
*
* @require kundeImBestand(kunde)
*
* @ensure result != null
*/
List<Verleihkarte> getVerleihkartenFuer(Kunde kunde);
/**
* Gibt die Verleihkarte für das angegebene Medium zurück, oder null wenn
* das Medium nicht verliehen ist.
*
* @param medium Ein Medium.
* @return Die Verleihkarte für das angegebene Medium.
*
* @require istVerliehen(medium)
*
* @ensure (result != null)
*/
Verleihkarte getVerleihkarteFuer(Medium medium);
}
| [
"Conrad@Conrad-PC"
] | Conrad@Conrad-PC |
921b09064b8c5b19294282f835a7c9e228f3d5e0 | ec8efc041c44d185c36e8444f43c4651c2c30611 | /Dijkstra/Metro/src/Metropolitano/Error.java | 7dd7e3804bdf3969d0afc980091e28b03c70df78 | [] | no_license | eleagece/Algorithms | 0a876713e0c77ea5d1554867bde65819b385c2a1 | 713aaf42f45ba2bd3451064e477c8191e377012a | refs/heads/master | 2021-01-12T17:23:23.829429 | 2016-10-21T10:32:49 | 2016-10-21T10:32:49 | 71,555,706 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,129 | java | /*
* Error.java
*
* Created on 26 de abril de 2007, 23:45
*/
package Metropolitano;
/**
*
* @author Antonio
*/
public class Error extends javax.swing.JFrame {
/** Creates new form Error */
public Error() {
initComponents();
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
private void initComponents() {
jDesktopPane1 = new javax.swing.JDesktopPane();
jTextField1 = new javax.swing.JTextField();
jButton1 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
jDesktopPane1.setBackground(new java.awt.Color(51, 102, 255));
jTextField1.setBackground(new java.awt.Color(255, 255, 51));
jTextField1.setFont(new java.awt.Font("Tahoma", 1, 11));
jTextField1.setHorizontalAlignment(javax.swing.JTextField.CENTER);
jTextField1.setText("ERROR DE LOGIN");
jTextField1.setBounds(130, 90, 140, 20);
jDesktopPane1.add(jTextField1, javax.swing.JLayeredPane.DEFAULT_LAYER);
jButton1.setText("Aceptar");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jButton1.setBounds(160, 160, 90, 23);
jDesktopPane1.add(jButton1, javax.swing.JLayeredPane.DEFAULT_LAYER);
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(org.jdesktop.layout.GroupLayout.TRAILING, jDesktopPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jDesktopPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
this.dispose();
}//GEN-LAST:event_jButton1ActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Error().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton1;
private javax.swing.JDesktopPane jDesktopPane1;
private javax.swing.JTextField jTextField1;
// End of variables declaration//GEN-END:variables
}
| [
"lagonzalez.ucm@gmail.com"
] | lagonzalez.ucm@gmail.com |
97966cfbe8282a7a49f4f52a0ffd60366550624a | fc1ca9fba459cd435d64d6c5a1ba1010babd9885 | /mujavaHome/result/CarSimulator/traditional_mutants/void_brake()/LOI_6/CarSimulator.java | ce4db1a331a06bc3f417c9dc72792722a2ecd1f4 | [] | no_license | xiaokeliu666/StateMachineTesting_CruiseControl | 24c93abf10b154ed71a9c6f9ad32aa4b7656f198 | c62358df18a1ebfbbd6edb3ef5d257ade46052d2 | refs/heads/master | 2020-12-15T04:09:05.786109 | 2020-01-20T00:27:27 | 2020-01-20T00:27:27 | 234,988,572 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,405 | java | // This is a mutant program.
// Author : ysma
package simulate;
public class CarSimulator implements java.lang.Runnable
{
private boolean ignition = false;
private double throttle = 0.0;
private int speed = 0;
private int distance = 0;
private int brakepedal = 0;
java.lang.Thread engine = null;
static final int maxSpeed = 120;
static final double maxThrottle = 10.0;
static final int maxBrake = 10;
static final double airResistance = 12.5;
static final int ticksPerSecond = 5;
public CarSimulator()
{
super();
}
public synchronized void engineOn()
{
ignition = true;
if (engine == null) {
engine = new java.lang.Thread( this );
engine.start();
}
}
public synchronized void engineOff()
{
ignition = false;
speed = 0;
distance = 0;
throttle = 0;
brakepedal = 0;
engine = null;
}
public synchronized void accelerate()
{
if (engine != null) {
if (brakepedal > 0) {
brakepedal = 0;
}
if (throttle < maxThrottle - 5) {
throttle += 5.0;
} else {
throttle = maxThrottle;
}
}
}
public synchronized void brake()
{
if (engine != null) {
if (throttle > 0) {
throttle = 0.0;
}
if (~brakepedal < maxBrake - 1) {
brakepedal += 1;
} else {
brakepedal = maxBrake;
}
}
}
public void run()
{
try {
double fdist = 0.0;
double fspeed = 0.0;
while (engine != null) {
synchronized (this)
{
fspeed = fspeed + (throttle - fspeed / airResistance - 2 * brakepedal) / ticksPerSecond;
if (fspeed > maxSpeed) {
fspeed = maxSpeed;
}
if (fspeed < 0) {
fspeed = 0;
}
fdist = fdist + fspeed / 36.0 / ticksPerSecond;
speed = (int) fspeed;
distance = (int) fdist;
if (throttle > 0.0) {
throttle -= 0.5 / ticksPerSecond;
}
if (throttle < 0.0) {
throttle = 0;
}
}
Thread.sleep( 1000 / ticksPerSecond );
}
} catch ( java.lang.InterruptedException e ) {
System.out.println( "Interrupted Exception caught." );
}
}
public synchronized void setThrottle( double val )
{
throttle = val;
if (throttle < 0.0) {
throttle = 0.0;
}
if (throttle > 10.0) {
throttle = 10.0;
}
brakepedal = 0;
}
public synchronized int getSpeed()
{
return speed;
}
public synchronized boolean getIgnition()
{
return ignition;
}
public synchronized double getThrottle()
{
return throttle;
}
public synchronized int getBrakepedal()
{
return brakepedal;
}
public synchronized int getDistance()
{
return distance;
}
}
| [
"xliu294@uottawa.ca"
] | xliu294@uottawa.ca |
98202afdc10f4c8ce491f529b9eef9205982e018 | 24ed7785dd6c50b35ae95e3cbcbc60e0ecf092ac | /src/main/java/br/com/guilhermealvessilve/gamification/infrastructure/seal/repository/SealReactiveRepository.java | b325307fc5e9e7d65497568ae0c8763b7124a85e | [] | no_license | CarlosEscouto/clean-architecture-quarkus | cdc0755a0b60176fac393502a6f5f0da17ff3db8 | f858dadeaa7d010689f2094bd096801d9676c9d7 | refs/heads/master | 2022-11-11T11:26:11.937137 | 2020-06-23T20:32:10 | 2020-06-23T20:32:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,621 | java | package br.com.guilhermealvessilve.gamification.infrastructure.seal.repository;
import br.com.guilhermealvessilve.gamification.domain.seal.entity.Seal;
import br.com.guilhermealvessilve.gamification.domain.seal.repository.SealRepository;
import br.com.guilhermealvessilve.shared.vo.CPF;
import io.vertx.mutiny.sqlclient.Pool;
import io.vertx.mutiny.sqlclient.Tuple;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.concurrent.CompletionStage;
@ApplicationScoped
public class SealReactiveRepository implements SealRepository {
private final Pool pool;
private final SealDbConverter converter;
@Inject
public SealReactiveRepository(final Pool pool, final SealDbConverter converter) {
this.pool = Objects.requireNonNull(pool, "SealRepositoryReactive.pool cannot be null!");
this.converter = Objects.requireNonNull(converter, "SealRepositoryReactive.converter cannot be null!");
}
@Override
public CompletionStage<List<Seal>> getAll() {
return pool.preparedQuery("SELECT * FROM seals;")
.execute()
.subscribeAsCompletionStage()
.thenApply(converter::getSeals);
}
@Override
public CompletionStage<Optional<Seal>> findByStudentCPF(final CPF cpf) {
Objects.requireNonNull(cpf, "cpf cannot be null");
return pool.preparedQuery("SELECT * FROM seals WHERE student_cpf = ?")
.execute(Tuple.of(cpf))
.subscribeAsCompletionStage()
.thenApply(converter::getOptionalSeal);
}
@Override
public CompletionStage<Boolean> save(final Seal seal) {
Objects.requireNonNull(seal, "seal cannot be null");
return executeStatement("INSERT INTO seals(student_cpf, name, type) VALUES (?, ?, ?) " +
"ON DUPLICATE KEY UPDATE name = name;", Tuple.of(
seal.getStudentCPF(),
seal.getName(),
seal.getType()
));
}
@Override
public CompletionStage<Boolean> delete(final Seal seal) {
Objects.requireNonNull(seal, "seal cannot be null");
return executeStatement("DELETE FROM seals WHERE student_cpf = ?;", Tuple.of(seal.getStudentCPF()));
}
private CompletionStage<Boolean> executeStatement(final String sql, final Tuple tuple) {
return pool.preparedQuery(sql)
.execute(tuple)
.subscribeAsCompletionStage()
.thenApply(converter::isSuccessOperation);
}
} | [
"guilherme_alves_silve@hotmail.com"
] | guilherme_alves_silve@hotmail.com |
55437f55b8dbd4e284910066d64d7629788f4782 | 2b0f6b8497e8d6c63ac4943f37cdee8ff03bcd52 | /src/day14_StringClass/repl.java | f8d7f820158a32c0a8f068e667cd06fd10b71ba7 | [] | no_license | Alikomania/Spring2020B18_Java | ed365358843a7083bcea13658e2b5123a8ebe6f5 | b1e777e726f3a89959cf0cadc804006085044f1e | refs/heads/master | 2022-11-16T20:14:21.320383 | 2020-06-29T19:53:06 | 2020-06-29T19:53:06 | 257,794,640 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,658 | java | package day14_StringClass;
import java.util.*;
public class repl {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
System.out.println("Do you want split");
String split = s.next();
System.out.println("Number of people");
int numberOfPeople = s.nextInt();
System.out.println("Enter check amount");
double checkAmount = s.nextDouble();
System.out.println("Enter service quality");
String serviceQuality = s.next();
boolean poor= serviceQuality.equalsIgnoreCase("poor");
boolean fair= serviceQuality.equalsIgnoreCase("fair");
boolean good= serviceQuality.equalsIgnoreCase("good");
boolean great = serviceQuality.equalsIgnoreCase("great");
boolean excellent=serviceQuality.equalsIgnoreCase("excellent");
double totalTip = 0;
if(serviceQuality.equals("Excellent")) {
totalTip = checkAmount / 4;
} else if (serviceQuality.equals("Great")){
totalTip = checkAmount / 5;
} else if (serviceQuality.equals("Good")){
totalTip = checkAmount * 15 / 100;
} else if (serviceQuality.equals("Fair")){
totalTip = checkAmount / 10;
} else if (serviceQuality.equals("Poor")){
totalTip = checkAmount / 20;
}
double totalToPay = totalTip + checkAmount;
double totalPerPerson = totalToPay / numberOfPeople;
double tipPerPerson = totalTip / numberOfPeople;
if(split.equals("Yes")){
System.out.println("Number of people entered: "+numberOfPeople);
System.out.println("Total to pay: "+totalToPay);
System.out.println("Total tip: "+totalTip);
System.out.println("Total per person: "+totalPerPerson);
System.out.println("Tip per person: "+tipPerPerson);
} else {
System.out.println("Total to pay: "+totalToPay);
System.out.println("Total to tip: "+totalTip);
}
System.out.println("=============================");
/*
Alternate solution:
public class Main {
public static void main(String[] args) {
//WRITE YOUR CODE HERE
Scanner scan=new Scanner(System.in);
System.out.println("Split:");
String split = scan.next();
System.out.println("Number of people:");
int people = scan.nextInt();
System.out.println("Check amount:");
double amount = scan.nextDouble();
System.out.println("Service Quality:");
String service = scan.next();
String peoplenumber = (people == 1) ? "&" : (people == 2) ? "&&"
: (people== 3) ? "&&&" : (people== 4) ? "&&&&"
: (people == 5) ? "&&&&&" : "";
System.out.println("Number of people entered: " +peoplenumber);
String service1 = "Poor";
String service2 = "Fair";
String service3 = "Good";
String service4 = "Great";
String service5 = "Excellent";
if (service.equals(service1)) {
double totaltip = amount * 5 / 100;
double totaltopay=totaltip+amount;
double totalperperson=totaltopay/people;
double tipperperson=totaltip/people;
System.out.println("Total to pay: "+totaltopay);
System.out.println("Total tip: " + totaltip);
System.out.println("Total per person: "+totalperperson);
System.out.println("Tip per person: "+tipperperson);
} else if (service.equals(service2)) {
double totaltip = amount * 10 / 100;
double totaltopay=totaltip+amount;
double totalperperson=totaltopay/people;
double tipperperson=totaltip/people;
System.out.println("Total to pay: "+totaltopay);
System.out.println("Total tip: " + totaltip);
System.out.println("Total per person: "+totalperperson);
System.out.println("Tip per person: "+tipperperson);
} else if (service.equals(service3)) {
double totaltip = amount * 15 / 100;
double totaltopay=totaltip+amount;
double totalperperson=totaltopay/people;
double tipperperson=totaltip/people;
System.out.println("Total to pay: "+totaltopay);
System.out.println("Total tip: " + totaltip);
System.out.println("Total per person: "+totalperperson);
System.out.println("Tip per person: "+tipperperson);
} else if (service.equals(service4)) {
double totaltip = amount * 20 /100;
double totaltopay=totaltip+amount;
double totalperperson=totaltopay/people;
double tipperperson=totaltip/people;
System.out.println("Total to pay: "+totaltopay);
System.out.println("Total tip: " + totaltip);
System.out.println("Total per person: "+totalperperson);
System.out.println("Tip per person: "+tipperperson);
} else {
double totaltip = amount * 25 / 100;
double totaltopay=totaltip+amount;
double totalperperson=totaltopay/people;
double tipperperson=totaltip/people;
System.out.println("Total to pay: "+totaltopay);
System.out.println("Total tip: " + totaltip);
System.out.println("Total per person: "+totalperperson);
System.out.println("Tip per person: "+tipperperson);
}
}
}
*/
}
}
/*
System.out.println("Split:");
String split = s.next();
System.out.println("Number of people:");
int numberOfPeople = s.nextInt();
System.out.println("Check amount:");
double checkAmount = s.nextDouble();
System.out.println("Service Quality:");
String serviceQuality = s.next();
boolean poor= serviceQuality.equalsIgnoreCase("poor");
boolean fair= serviceQuality.equalsIgnoreCase("fair");
boolean good= serviceQuality.equalsIgnoreCase("good");
boolean great = serviceQuality.equalsIgnoreCase("great");
boolean excellent=serviceQuality.equalsIgnoreCase("excellent");
double totalTip = 0;
if(serviceQuality.equals("Excellent")) {
totalTip = checkAmount / 4;
} else if (serviceQuality.equals("Great")){
totalTip = checkAmount / 5;
} else if (serviceQuality.equals("Good")){
totalTip = checkAmount * 15 / 100;
} else if (serviceQuality.equals("Fair")){
totalTip = checkAmount / 10;
} else if (serviceQuality.equals("Poor")){
totalTip = checkAmount / 20;
}
double totalToPay = totalTip + checkAmount;
double totalPerPerson = totalToPay / numberOfPeople;
double tipPerPerson = totalTip / numberOfPeople;
if(split.equals("Yes")){
System.out.println("Number of people entered:");
System.out.println("Total to pay: "+totalToPay);
System.out.println("Total tip: "+totalTip);
System.out.println("Total per person: "+totalPerPerson);
System.out.println("Tip per person: "+tipPerPerson);
} else {
System.out.println("Total to pay: "+totalToPay);
System.out.println("Total to tip: "+totalTip);
}
*/ | [
"alikoca33@hotmail.com"
] | alikoca33@hotmail.com |
86c667be94132d57e065f0559130f081ec8ddb3f | b27a6c9ec0e759ddf469dafb42148c5610aae10c | /myFolder/src/myFolder/Test4.java | a9aae344077962978234d7a357df276737a3899d | [] | no_license | gabyPark/workspace_java | 8440fbe7d5336a8b4923cbb21ce5ec5165e7bbec | 6b7f625fdc3ad9a2fa8865ef4a06e692a604d491 | refs/heads/main | 2023-06-03T18:37:07.267020 | 2021-06-13T11:12:32 | 2021-06-13T11:12:32 | 376,519,047 | 0 | 0 | null | null | null | null | UHC | Java | false | false | 1,842 | java | package myFolder;
import java.util.Scanner;
public class Test4 {
static Book[] books = new Book[10];
static Scanner sc = new Scanner(System.in);
static int insertCnt = 0;
public static void main(String[] args) {
boolean run = true;
while(run) {
System.out.println("--------------------------------");
System.out.println("1.도서 정보 입력 | 2. 책 검색 | 3. 종료");
System.out.println("--------------------------------");
System.out.println("메뉴 선택 > ");
int menuNo = sc.nextInt();
switch (menuNo) {
case 1:
insertBook();
break;
case 2:
searchingBook();
break;
case 3:
run = false;
break;
}
}
sc.close();
System.out.println("프로그램 종료");
}
static void insertBook() {
if(insertCnt < books.length) {
insertCnt++;
sc.nextLine();
System.out.println("도서명 입력 : ");
String title = sc.nextLine();
System.out.println("저자 입력 : ");
String author = sc.nextLine();
System.out.println("출판사 입력 : ");
String publish = sc.nextLine();
System.out.println("가격 입력 : ");
int price = sc.nextInt();
books[insertCnt-1] = new Book(title,author,publish,price);
System.out.println("입력됨");
} else {System.out.println("더이상 입력할 수 없습니다");}
}
static void searchingBook(){
if(insertCnt > 0) {
System.out.println("검색할 책 제목을 입력 : ");
sc.nextLine();
String searchinTitle = sc.nextLine();
int i;
for(i=0;i<insertCnt;i++) {
if(searchinTitle.equalsIgnoreCase(books[i].getTitle())) {
System.out.println("저자 : "+books[i].getAuthor()+" 출판사 : "+books[i].publish+" 가격 : "+books[i].price);
break;
}
}
if(i>=insertCnt) System.out.println("검색 책이 없습니다");
}
}
}
| [
"lovelypp6@gmail.com"
] | lovelypp6@gmail.com |
34c994b39a6bce79b08ca0230ba01819d795be17 | d36b9ff8b62708f939ca535490b0ed6239324dad | /zd-hft-ctp/src/main/java/xyz/redtorch/api/jctp/CThostFtdcQryInstrumentField.java | 07825054ae8e3c21cd3b92052e88995a7607291f | [] | no_license | userKarl/stratagy-trader | c02b5be3b9b5101a7f61761546ddc7cd45b2e6a3 | fed2000fb2c994c5172c7ec3e31b3651eb2e1d31 | refs/heads/master | 2020-03-26T08:36:15.391928 | 2018-09-13T11:32:14 | 2018-09-13T11:32:14 | 144,710,668 | 3 | 7 | null | null | null | null | UTF-8 | Java | false | false | 2,315 | java | /* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 3.0.12
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
package xyz.redtorch.api.jctp;
public class CThostFtdcQryInstrumentField {
private transient long swigCPtr;
protected transient boolean swigCMemOwn;
protected CThostFtdcQryInstrumentField(long cPtr, boolean cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = cPtr;
}
protected static long getCPtr(CThostFtdcQryInstrumentField obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
protected void finalize() {
delete();
}
public synchronized void delete() {
if (swigCPtr != 0) {
if (swigCMemOwn) {
swigCMemOwn = false;
jctpmdapiv6v3v11x64JNI.delete_CThostFtdcQryInstrumentField(swigCPtr);
}
swigCPtr = 0;
}
}
public void setInstrumentID(String value) {
jctpmdapiv6v3v11x64JNI.CThostFtdcQryInstrumentField_InstrumentID_set(swigCPtr, this, value);
}
public String getInstrumentID() {
return jctpmdapiv6v3v11x64JNI.CThostFtdcQryInstrumentField_InstrumentID_get(swigCPtr, this);
}
public void setExchangeID(String value) {
jctpmdapiv6v3v11x64JNI.CThostFtdcQryInstrumentField_ExchangeID_set(swigCPtr, this, value);
}
public String getExchangeID() {
return jctpmdapiv6v3v11x64JNI.CThostFtdcQryInstrumentField_ExchangeID_get(swigCPtr, this);
}
public void setExchangeInstID(String value) {
jctpmdapiv6v3v11x64JNI.CThostFtdcQryInstrumentField_ExchangeInstID_set(swigCPtr, this, value);
}
public String getExchangeInstID() {
return jctpmdapiv6v3v11x64JNI.CThostFtdcQryInstrumentField_ExchangeInstID_get(swigCPtr, this);
}
public void setProductID(String value) {
jctpmdapiv6v3v11x64JNI.CThostFtdcQryInstrumentField_ProductID_set(swigCPtr, this, value);
}
public String getProductID() {
return jctpmdapiv6v3v11x64JNI.CThostFtdcQryInstrumentField_ProductID_get(swigCPtr, this);
}
public CThostFtdcQryInstrumentField() {
this(jctpmdapiv6v3v11x64JNI.new_CThostFtdcQryInstrumentField(), true);
}
}
| [
"yanglin-163.-com@163.com"
] | yanglin-163.-com@163.com |
9d4903c6c6470e2e3a228d4f930a2669d65008c9 | 0180e8cdf5e23161a3408e1b4dfb616ccbbccb60 | /src/org/effectivejava/examples/chapter06/item32/Text.java | f6be8d3332976a2163bea33ad6b02afe644a377f | [] | no_license | salingers/Java | 4d6ddf2ec8fe0ece212097cc1fa9858e13f5ea5b | 0486b0d309a2bd1d305988b3a56a5bf772aa5f65 | refs/heads/master | 2020-05-22T00:03:53.896471 | 2017-04-18T08:44:20 | 2017-04-18T08:44:20 | 63,207,503 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 531 | java | // EnumSet - a modern replacement for bit fields - Page 160
package org.effectivejava.examples.chapter06.item32;
import java.util.EnumSet;
import java.util.Set;
public class Text
{
public enum Style
{
BOLD, ITALIC, UNDERLINE, STRIKETHROUGH
}
// Any Set could be passed in, but EnumSet is clearly best
public void applyStyles(Set<Style> styles)
{
// Body goes here
}
// Sample use
public static void main(String[] args)
{
Text text = new Text();
text.applyStyles(EnumSet.of(Style.BOLD, Style.ITALIC));
}
}
| [
"salingersms@msn.com"
] | salingersms@msn.com |
f711b14af4b7b173609acff94bb3f97dcb355ea0 | a1c85724e9e5d62effc62e902637531da7a81202 | /public-gateway/src/main/java/com/tinklabs/b2c/cloud/publicgateway/controller/HelloController.java | a825d9166b71d353b1aa963e4fb2769b840f2db2 | [] | no_license | cloverpang/Clover_Spring_Cloud | 74eefb1bb2ba670362f01f6f22f84914a3f7bc6c | e294f87687ce0b31b9a972bf589fd7c3525dc4b4 | refs/heads/master | 2021-05-03T06:27:39.341721 | 2018-12-20T08:51:05 | 2018-12-20T08:51:05 | 120,595,677 | 1 | 1 | null | 2018-12-20T10:10:29 | 2018-02-07T09:48:15 | Java | UTF-8 | Java | false | false | 818 | java | package com.tinklabs.b2c.cloud.publicgateway.controller;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.*;
@RestController
@SpringBootApplication
public class HelloController {
@RequestMapping(value={"/hello"}, method= RequestMethod.GET)
@ResponseBody
public String index(@RequestParam(value = "name",required = false,defaultValue = "you") String name) {
return "Hello "+name+",this is public gate way!";
}
@RequestMapping(value={"/health"}, method= RequestMethod.GET)
@ResponseBody
public String alive(){
return "Public gate way is alive!";
}
@RequestMapping(value={"/version"}, method= RequestMethod.GET)
@ResponseBody
public String version(){
return "0.0.0.1";
}
}
| [
"jingbo.pang@tinklabs.com"
] | jingbo.pang@tinklabs.com |
4dec007c4381e55996af787883f7d42d3026dc4e | 1778a0bfd06dd7478de764b8d982ca8b08f1d414 | /GrantResturantV1.3/AndroidStudio/SingleResturant/app/src/main/java/freaktemplate/singlerestau/Setting.java | 969d51ca3a5f1004edd7b5773053bdc894e1dae5 | [] | no_license | yeakub/LearnAndroidComplete | 4e86549354893b8c3ffff1f72eb434b8dd6220f0 | 157669c21fbae2d470dd55c0e358de0724023055 | refs/heads/master | 2020-03-28T08:53:51.073175 | 2017-01-06T07:25:06 | 2017-01-06T07:25:06 | 147,997,198 | 0 | 1 | null | 2018-09-09T05:51:42 | 2018-09-09T05:51:41 | null | UTF-8 | Java | false | false | 5,515 | java | package freaktemplate.singlerestau;
import java.io.File;
import java.nio.channels.FileChannel;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.ActivityInfo;
import android.net.Uri;
import android.os.Bundle;
import android.preference.ListPreference;
import android.preference.Preference;
import android.preference.PreferenceActivity;
import android.preference.PreferenceManager;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.Toast;
import freaktemplate.singlerestau.utils.ConnectionDetector;
import freaktemplate.singlerestau.utils.GPSTracker;
public class Setting extends PreferenceActivity {
SharedPreferences sharedPreferences;
Preference contactUs, version, importExport, categoryList1, CurrencyList1;
ListPreference sortBy, defultCurrency;
Context context = this;
File file;
FileChannel src = null;
FileChannel dst = null;
int inAppFlag;
String name, link, mailpage, storename, address, offer, latitude, longitude, distance, store_name, storeaddress,
description, notice;
Boolean isInternetPresent = false;
ConnectionDetector cd;
GPSTracker gps;
double latitudecur;
double longitudecur;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// setContentView(R.layout.activity_setting);
cd = new ConnectionDetector(getApplicationContext());
isInternetPresent = cd.isConnectingToInternet();
// check for Internet status
if (isInternetPresent) {
gps = new GPSTracker(Setting.this);
if (gps.canGetLocation()) {
latitudecur = gps.getLatitude();
longitudecur = gps.getLongitude();
} else {
gps.showSettingsAlert();
}
}
addPreferencesFromResource(R.xml.setting);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
getintent();
openGmail();
}
private void getintent() {
// TODO Auto-generated method stub
Intent iv = getIntent();
mailpage = iv.getStringExtra("mail");
}
private void openGmail() {
// TODO Auto-generated method stub
try {
Intent gmail = new Intent(Intent.ACTION_VIEW);
gmail.setClassName("com.google.android.gm", "com.google.android.gm.ComposeActivityGmail");
gmail.putExtra(Intent.EXTRA_EMAIL, new String[] { mailpage });
gmail.setData(Uri.parse(""));
gmail.putExtra(Intent.EXTRA_SUBJECT, "Grant Restaurant");
gmail.setType("text/plain");
gmail.putExtra(Intent.EXTRA_TEXT, "");
startActivity(gmail);
} catch (Exception e) {
sendEmail();
}
}
private void openGmail1() {
// TODO Auto-generated method stub
try {
Intent gmail = new Intent(Intent.ACTION_VIEW);
gmail.setClassName("com.google.android.gm", "com.google.android.gm.ComposeActivityGmail");
gmail.putExtra(Intent.EXTRA_EMAIL, new String[] { "" });
gmail.setData(Uri.parse(""));
gmail.putExtra(Intent.EXTRA_SUBJECT, "Coupon");
gmail.setType("text/plain");
gmail.putExtra(Intent.EXTRA_TEXT,
"Businessname: " + storename + "\n" + "Businessaddress: " + address + "\n" + "offer: " + offer
+ "\n" + "user latitude: " + latitudecur + "\n" + "user longitude: " + longitudecur + "\n"
+ "Business latitude: " + latitude + "\n" + "Business longitude: " + longitude + "\n"
+ "Reported distance: " + distance + " km");
startActivity(gmail);
} catch (Exception e) {
sendEmail();
}
}
private void openGmail2() {
// TODO Auto-generated method stub
try {
Intent gmail = new Intent(Intent.ACTION_VIEW);
gmail.setClassName("com.google.android.gm", "com.google.android.gm.ComposeActivityGmail");
gmail.putExtra(Intent.EXTRA_EMAIL, new String[] { "" });
gmail.setData(Uri.parse(""));
gmail.putExtra(Intent.EXTRA_SUBJECT, "Steal the Deal");
gmail.setType("text/plain");
gmail.putExtra(Intent.EXTRA_TEXT, storename + "\n" + storeaddress + "\n" + description + "\n" + notice
+ "\n" + "Download now at: " + link);
startActivity(gmail);
} catch (Exception e) {
sendEmail();
}
}
private void sendEmail() {
// TODO Auto-generated method stub
String recipient = "";
String subject = "Coupon";
@SuppressWarnings("unused")
String body = "";
String[] recipients = { recipient };
Intent email = new Intent(Intent.ACTION_SEND);
email.setType("message/rfc822");
email.putExtra(Intent.EXTRA_EMAIL, recipients);
email.putExtra(Intent.EXTRA_SUBJECT, subject);
try {
startActivity(Intent.createChooser(email, getString(R.string.email_choose_from_client)));
} catch (android.content.ActivityNotFoundException ex) {
Toast.makeText(Setting.this, getString(R.string.email_no_client), Toast.LENGTH_LONG).show();
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.setting, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
@Override
public void onBackPressed() {
// TODO Auto-generated method stub
super.onBackPressed();
Setting.this.finish();
}
}
| [
"em3888@gmail.com"
] | em3888@gmail.com |
f98a951b20f0b14995bfddc8c319107809499111 | 89e9215bd42fb29cb2d8182d757b0e62439af249 | /app/src/main/java/com/winguo/productList/modle/city/ProvinceBean.java | 7371b94929f4ed9cc8f043da19bf3810684e48e3 | [] | no_license | chenqian19911214/winguoapp_4.5 | c39e2ae3c1909dc97d74378e4b7085aa2b32332e | d05022a9451d31806a4143e04603bdecd6479aee | refs/heads/master | 2021-05-05T10:02:30.115073 | 2018-01-18T03:55:08 | 2018-01-18T03:55:08 | 117,928,718 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,050 | java | package com.winguo.productList.modle.city;
import java.io.Serializable;
import java.util.List;
/**
* Created by Admin on 2017/1/16.
*/
public class ProvinceBean implements Serializable {
/**
* code : 1
* name : 北京
* cities : {"item":[{"code":72,"name":"朝阳区"},{"code":2800,"name":"海淀区"},{"code":2801,"name":"西城区"},{"code":2802,"name":"东城区"},{"code":2803,"name":"崇文区"},{"code":2804,"name":"宣武区"},{"code":2805,"name":"丰台区"},{"code":2806,"name":"石景山区"},{"code":2807,"name":"门头沟"},{"code":2808,"name":"房山区"},{"code":2809,"name":"通州区"},{"code":2810,"name":"大兴区"},{"code":2812,"name":"顺义区"},{"code":2814,"name":"怀柔区"},{"code":2816,"name":"密云区"},{"code":2901,"name":"昌平区"},{"code":2953,"name":"平谷区"},{"code":3065,"name":"延庆县"}]}
*/
public List<ProvinceItemBean> item;
@Override
public String toString() {
return "ProvinceBean{" +
"item=" + item +
'}';
}
} | [
"1096011884@qq.com"
] | 1096011884@qq.com |
354295f7b464661163c4bd92a95f2b928d93fa94 | dd17569c6f7fecdf6bbfeaeab55011d741a973a0 | /CS4450-Final-Project-master/LWJGL App/src/Main/LWJGLApp.java | 4d2507f78772cd15a048810ca86c12d11028140d | [] | no_license | milushyanev/MineCraft | 8f402439a2be60d63ee979761c8737ad1cb6dca7 | 9545228112b815a31133583e78eecbd6b5846bb5 | refs/heads/master | 2020-08-04T12:47:40.491740 | 2019-10-01T16:15:44 | 2019-10-01T16:15:44 | 212,141,938 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 458 | java | package Main;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
import org.lwjgl.LWJGLException;
import org.lwjgl.opengl.*;
import static org.lwjgl.opengl.GL11.*;
public class LWJGLApp {
private static final int WIDTH = 640;
private static final int HEIGHT = 480;
public static void main(String[] args) throws FileNotFoundException
{
Basic3D basic = new Basic3D();
basic.start();
}
}
| [
"noreply@github.com"
] | noreply@github.com |
1618e0eb6247c77610aa1d9fa2689ea153c163cb | be73270af6be0a811bca4f1710dc6a038e4a8fd2 | /crash-reproduction-moho/results/XCOMMONS-928-1-10-MOEAD-WeightedSum:TestLen:CallDiversity/org/xwiki/extension/repository/internal/installed/DefaultInstalledExtensionRepository_ESTest.java | 63eba8a95f151c3814220ed13c3ffdc179ba21f7 | [] | no_license | STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application | cf118b23ecb87a8bf59643e42f7556b521d1f754 | 3bb39683f9c343b8ec94890a00b8f260d158dfe3 | refs/heads/master | 2022-07-29T14:44:00.774547 | 2020-08-10T15:14:49 | 2020-08-10T15:14:49 | 285,804,495 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 626 | java | /*
* This file was automatically generated by EvoSuite
* Tue Apr 07 16:42:04 UTC 2020
*/
package org.xwiki.extension.repository.internal.installed;
import org.junit.Test;
import static org.junit.Assert.*;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true)
public class DefaultInstalledExtensionRepository_ESTest extends DefaultInstalledExtensionRepository_ESTest_scaffolding {
@Test
public void notGeneratedAnyTest() {
// EvoSuite did not generate any tests
}
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
cf4833be22434a587ad1084a8094a5402c4b3b28 | dac8487e9b7d0979b1102f338ac942fd2417cf21 | /java/basictest/src/com/basictest/reflect/systemloader/BootStrapTest.java | f45f22fd10f4f9dbd6087c89813af3cc58d0ef0f | [] | no_license | hu-xingxin/workspace | fbe453ec4bdff5f7b4e0949fb55d618834b1f1d8 | 0320b849b77bf2ae69a0e1ad59c7a4e91f61cb4f | refs/heads/master | 2023-07-29T21:17:26.140167 | 2021-08-31T13:43:25 | 2021-08-31T13:43:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 405 | java | package com.basictest.reflect.systemloader;
import sun.misc.Launcher;
import java.net.URL;
/**
* @description
* @author: hxx
* @create: 2021-05-14 15:41
**/
public class BootStrapTest {
public static void main(String[] args) {
URL[] urLs = Launcher.getBootstrapClassPath().getURLs();
for ( URL urL:urLs) {
System.out.println(urL.toExternalForm());
}
}
}
| [
"2569960390@qq.com"
] | 2569960390@qq.com |
507c70142ea5f899d0338dc2f23b5e870defc601 | 072e396c78ef296d57580e5c0d60444f76b1e55d | /to-shrunk/RC4.java | 540c7da39c28e8a11772c9c7b0c3583a5f15bfc8 | [] | no_license | minestrenght/ns-practicals | 6d253dc461cbaf42965c58865bf6bdf73208d7b1 | e24e377fd12f486c1f470104bec721e0375194a0 | refs/heads/master | 2016-09-05T19:43:49.889215 | 2014-10-08T23:47:43 | 2014-10-08T23:47:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 915 | java | import java.io.*;
class RC4{
String plaintext;
static char cipher[];
RC4(String plaintext,int []key)
{
this.plaintext = plaintext;
int s[] = new int [255];
cipher = new char[plaintext.length()];
for(int i=0;i<s.length;i++)
{
s[i]=i;
}
int i=0;
int j=0;
for(int k = 0; k<plaintext.length();k++)
{
int modk = (k%key.length);
int kc = key[modk];
j=(s[i]+j+kc)%256+1;
int temp = s[i];
s[i] = s[j];
s[j] = temp;
int sc = (s[i]+s[j])%256;
int ck = s[sc];
cipher[k]=(char)(ck^(int)plaintext.charAt(k));
i=i+1;
}
}
public static void main(String [] args)
{
int k[]={1,2,3,4,5};
String original_msg = "Hello Avinash";
System.out.println("ORIGINAL STRING:"+original_msg);
new RC4(original_msg,k);
System.out.println("\nCIPHER TEXT:");
for(int i=0;i<cipher.length;i++)
{
System.out.print(""+cipher[i]);
}
}
} | [
"minestrenght@gmail.com"
] | minestrenght@gmail.com |
3592d3c65172781a4a0f9cab26da5216a661cb93 | 9303053bb0143ced712c3d72ecd41712aa3b2e2e | /app/src/main/java/com/mediabox/qukuailian/activity/SetPasswordProtectionActivity.java | c77f150c4aa06f81c1701ac5833c9a22e570cac6 | [] | no_license | lzy85712/MediaBox | e06bc14fe6bda9d47a90a95780f416031fe2025b | dea42944eb65784e81ffc579dae49f978f60239a | refs/heads/master | 2022-11-08T13:42:46.214411 | 2020-06-26T00:04:48 | 2020-06-26T00:04:48 | 275,040,358 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,629 | java | package com.mediabox.qukuailian.activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.TextView;
import com.apkfuns.logutils.LogUtils;
import com.mediabox.qukuailian.R;
import com.mediabox.qukuailian.utils.MyUtils;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
/**
* Created by lizhaoyong on 2018/7/3.
* 设置密码保护页面
*/
public class SetPasswordProtectionActivity extends BaseActivity {
@BindView(R.id.fl_back)
FrameLayout fl_back;
@BindView(R.id.tv_question_one_content)
TextView tv_question_one_content;
@BindView(R.id.tv_question_two_content)
TextView tv_question_two_content;
@BindView(R.id.tv_question_three_content)
TextView tv_question_three_content;
@OnClick(R.id.fl_back)
public void back() {
finish();
}
private final static int REQUESTCODE = 1; // 返回的结果码
// 问题选择页面
@OnClick(R.id.tv_question_one)
public void enterQuestionSelectOne() {
Intent intent = new Intent(getApplicationContext(), QuestionSelectActivity.class);
intent.putExtra("position", 1);
startActivityForResult(intent, REQUESTCODE);
}
@OnClick(R.id.tv_question_two)
public void enterQuestionSelectTwo() {
Intent intent = new Intent(getApplicationContext(), QuestionSelectActivity.class);
intent.putExtra("position", 2);
startActivityForResult(intent, REQUESTCODE);
}
@OnClick(R.id.tv_question_three)
public void enterQuestionSelectThree() {
Intent intent = new Intent(getApplicationContext(), QuestionSelectActivity.class);
intent.putExtra("position", 3);
startActivityForResult(intent, REQUESTCODE);
}
@OnClick(R.id.tv_finish)
public void setFinish() {
Intent intent = new Intent(getApplicationContext(), ProtectionSuccessActivity.class);
startActivity(intent);
finish();
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_password_protection);
ButterKnife.bind(this);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
// 处理选中返回
if (resultCode == 2) {
if (requestCode == REQUESTCODE) {
String question = data.getStringExtra("question");
int position = data.getIntExtra("position", 0);
switch (position) {
case 1:
tv_question_one_content.setText("No.1 " + question);
break;
case 2:
tv_question_two_content.setText("No.2 " + question);
break;
case 3:
tv_question_three_content.setText("No.3 " + question);
break;
}
}
}
}
// 点击外部软键盘隐藏
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
if (ev.getAction() == MotionEvent.ACTION_DOWN) {
View v = getCurrentFocus();
if (MyUtils.isShouldHideInput(v, ev)) {
if (MyUtils.hideInputMethod(this, v)) {
return true;
}
}
}
return super.dispatchTouchEvent(ev);
}
}
| [
"lzy19850712@sina.com"
] | lzy19850712@sina.com |
d64675530b66b46cbccdab5c1b3ea52e9d74f908 | d61b6a423c4992cc1189f1cf9536bc5a3d8e9723 | /CRUD_Basic/src/main/java/com/kopo/crud1/DB.java | d4a4b50e810ecdc1c9ef094334e54daa514f0cdd | [] | no_license | sbpark88/KOPO-Spring3 | aad75602e0842da8646cf657fbaf446882a8f07e | 6cb90b9ea1914efbb4b8a5375c6ac6e5221d6452 | refs/heads/master | 2023-04-09T12:01:04.142505 | 2021-04-22T14:09:30 | 2021-04-22T14:09:30 | 307,890,437 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 18,317 | java | package com.kopo.crud1;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import javax.servlet.http.HttpServletRequest;
import org.sqlite.SQLiteConfig;
public class DB<T> {
private String dbFileName;
private String tableName;
private Connection connection;
private T t;
static {
try { // 이 이름을 가진 DB가 없을 수도 있기 때문에 try~catch
Class.forName("org.sqlite.JDBC");
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
// 기존 방식(dbFileName, tableName을 HomeController로부터 String 형태로 직접 전달 받음.)
public DB (String dbFileName, String tableName) {
this.dbFileName = dbFileName;
this.tableName = tableName;
}
public boolean open() {
SQLiteConfig config = new SQLiteConfig();
try {
this.connection = DriverManager.getConnection("jdbc:sqlite:/" + this.dbFileName, config.toProperties());
return true;
} catch (SQLException e) {
e.printStackTrace();
}
return false;
}
public void close() {
if (this.connection != null) {
try {
this.connection.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
}
// CREATE (테이블 생성 쿼리 메소드)
// Step 1. 쿼리를 직접 작성.
// public boolean createTable() {
// String query = "CREATE TABLE " + this.tableName + " (idx INT PRIMARY KEY, name TEXT, age INT, memo TEXT, created TEXT, updated TEXT)";
// try {
// Statement statement = this.connection.createStatement();
// statement.executeUpdate(query);
// statement.close();
// return true;
// } catch (SQLException e) {
// e.printStackTrace();
// }
// return false;
// }
// Step 2. 쿼리를 하나의 String으로 만들어서 한 번에 보낸다.
// public boolean createTable() {
// String fieldString = "";
// fieldString = fieldString + "idx INT PRIMARY KEY";
// fieldString = fieldString + ", name TEXT";
// fieldString = fieldString + ", age INT";
// fieldString = fieldString + ", memo TEXT";
// fieldString = fieldString + ", created TEXT";
// fieldString = fieldString + ", updated TEXT";
// String query = "CREATE TABLE " + this.tableName + " (" + fieldString + ")";
// try {
// Statement statement = this.connection.createStatement();
// statement.executeUpdate(query);
// statement.close();
// return true;
// } catch (SQLException e) {
// e.printStackTrace();
// }
// return false;
// }
// Step 3. Generic T 객체 사용 & 기존 방식(dbFileName, tableName을 HomeController로부터 String 형태로 직접 전달 받음.)일 때 사용.
public boolean createTable(T t) { // 기존에는 User user라고 해서 User라는 객체가 들어온다 명시를 했다. T는 어떤 객체가 들어올지 모른단 뜻. DB를 DB<T>로 Generic(제네릭)을 사용한다.
Class<?> dataClass = t.getClass(); // t의 Class Object를 가져와 return해서 dataClass라는 변수명에 저장.
Field[] dataClassFields = dataClass.getDeclaredFields(); // dataClass라는 클래스의 변수들을 array로 return.
String fieldString = "";
for (Field field: dataClassFields) { // array로부터 for each 문을 돌면서 하나씩 분해해 쿼리에 넣을 문자열을 만든다.
String fieldName = field.getName();
String fieldType = field.getType().toString();
if (!fieldString.isEmpty()) {
fieldString = fieldString + ",";
}
fieldString = fieldString + fieldName;
if (fieldName.matches("idx")) {
fieldString = fieldString + " INTEGER PRIMARY KEY AUTOINCREMENT";
} else if (fieldType.matches("(int|long|short)")) {
fieldString = fieldString + " INTEGER";
} else if (fieldType.matches("(float|double)")) {
fieldString = fieldString + " REAL";
} else if (fieldType.matches(".*String")) {
fieldString = fieldString + " TEXT";
}
}
String query = "CREATE TABLE " + this.tableName + " (" + fieldString + ")";
try {
Statement statement = this.connection.createStatement();
statement.executeUpdate(query);
statement.close();
return true;
} catch (SQLException e) {
e.printStackTrace();
}
return false;
}
// INSERT
// Step 3. Generic T 객체 사용 & PreparedStatement 사용
public boolean insertData(T t) {
Class<?> dataClass = t.getClass(); // User.java
Field[] dataClassFields = dataClass.getDeclaredFields(); // User.java의 내용을 읽는다.
String fieldString = ""; // 변수명을 저장 (name, age, memo)...
String valueString = ""; // 변수값을 저장 ("홍길동", 20, "안녕하세요")...
// 값을 저장할 배열을 변수로 선언
ArrayList<Object> preparedValue = new ArrayList<Object>();
for (Field field : dataClassFields) { // for each로 User.java의 내용을 한 줄씩 읽는다.
// Step 1. 각 라인을 each로 읽어온다.
String fieldName = field.getName(); // 변수명(name, age, memo)...
String fieldType = field.getType().toString(); // 변수 타입(String, int, String)...
if (fieldName.matches("idx")) { // idx는 insert때는 auto increment로 필요가 없으니 넘어간다.
continue;
}
// Step 2. fieldString 만들기
if (!fieldString.isEmpty()) {
fieldString += ",";
}
fieldString += fieldName;
// Step 3. valueString(PreparedStatement를 위해 ?, ?, ?를 저장) & preparedValue(실제 값을 ArrayList 객체로 저장) 만들기
if (!valueString.isEmpty()) {
valueString = valueString + ",";
}
try {
if (fieldName.matches("created")) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = new Date(System.currentTimeMillis());
preparedValue.add(formatter.format(date));
} else if (fieldName.matches("updated")) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = new Date(System.currentTimeMillis());
preparedValue.add(formatter.format(date));
} else { // created, updated를 제외한 모든 변수는 들어온 값을 그대로 객체에 저장.
preparedValue.add(field.get(t));
}
valueString += "?";
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
String query = "INSERT INTO " + this.tableName + " (" + fieldString + ") VALUES(" + valueString + ")";
try {
PreparedStatement preparedStatement = this.connection.prepareStatement(query);
for (int i = 0; i < preparedValue.size(); i++) {
preparedStatement.setObject(i + 1, preparedValue.get(i));
}
preparedStatement.executeUpdate();
preparedStatement.close();
return true;
} catch (SQLException e) {
e.printStackTrace();
this.close();
}
return false;
}
// UPDATE
// Step 3. Generic T 객체 사용 & PreparedStatement 사용
public boolean updateData(T t) {
Class<?> dataClass = t.getClass();
Field[] dataClassFields = dataClass.getDeclaredFields();
String setString = ""; // 변수값을 저장 ("장보고", 40, "수정된다")...
String whereString = ""; // where 조건을 저장 idx=3
// 값을 저장할 배열을 변수로 선언
ArrayList<Object> preparedValue = new ArrayList<Object>();
for (Field field : dataClassFields) { // for each로 User.java의 내용을 한 줄씩 읽는다.
// Step 1. 각 라인을 each로 읽어온다.
String fieldName = field.getName(); // 변수명(name, age, memo)...
String fieldType = field.getType().toString(); // 변수 타입(String, int, String)...
// Step 2. whereString 만들기
if (fieldName.matches("idx")) {
try {
whereString += "idx=" + field.getInt(t);
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
continue;
}
// Step 3. setString(PreparedStatement를 위해 ?, ?, ?를 저장) & preparedValue(실제 값을 ArrayList 객체로 저장) 만들기
if (fieldName.matches("created")) continue;
if (!setString.isEmpty()) {
setString += ",";
}
try {
if (fieldName.matches("updated")) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = new Date(System.currentTimeMillis());
preparedValue.add(formatter.format(date));
} else { // idx, updated를 제외한 모든 변수는 들어온 값을 그대로 객체에 저장.
preparedValue.add(field.get(t));
}
setString += fieldName + "=?";
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
String query = "UPDATE " + this.tableName + " SET " + setString + " WHERE " + whereString;
try {
PreparedStatement preparedStatement = this.connection.prepareStatement(query);
for (int i = 0; i < preparedValue.size(); i++) {
preparedStatement.setObject(i + 1, preparedValue.get(i));
}
preparedStatement.executeUpdate();
preparedStatement.close();
return true;
} catch (SQLException e) {
e.printStackTrace();
this.close();
}
return false;
}
// SELECT All
// 참고 : HomeController에서 직접 호출할 때 User 객체의 toHtmlString Step 1~3과 함께 사용
// public ArrayList<T> selectData() {
// Class<?> dataClass = t.getClass();
// Field[] dataClassFields = dataClass.getDeclaredFields();
//
// String query = "SELECT * FROM " + this.tableName;
// ArrayList<T> resultDataSet = new ArrayList<T>();
// try {
// this.open();
// Statement statement = this.connection.createStatement();
// ResultSet resultSet = statement.executeQuery(query);
// while (resultSet.next()) {
// T rowData = (T) dataClass.getDeclaredConstructor().newInstance();
//
// for (Field field : dataClassFields) {
// String fieldName = field.getName();
// String fieldType = field.getType().toString();
//
// if (fieldName.matches("(DB_FILE_NAME|TABLE_NAME)")) {
// continue;
// }
// if (fieldType.matches("(int)")) {
// field.setInt(rowData, resultSet.getInt(fieldName));
// } else if (fieldType.matches("(long)")) {
// field.setLong(rowData, resultSet.getLong(fieldName));
// } else if (fieldType.matches("(float|double)")) {
// field.setDouble(rowData, resultSet.getDouble(fieldName));
// } else if (fieldType.matches(".*String")) {
// if (resultSet.getString(fieldName) == null) {
// field.set(rowData, "");
// } else {
// field.set(rowData, resultSet.getString(fieldName));
// }
// field.set(rowData, resultSet.getString(fieldName));
// }
// }
// resultDataSet.add(rowData);
// }
// resultSet.close();
// statement.close();
// this.close();
// } catch (Exception e) {
// e.printStackTrace();
// this.close();
// }
// return resultDataSet;
// }
// Step 3. Generic T 객체 사용 & PreparedStatement 사용
public String selectDataString(T t) {
Class<?> dataClass = t.getClass(); // User.java
Field[] dataClassFields = dataClass.getDeclaredFields(); // User.java의 내용을 읽는다.
// 값을 저장할 배열을 변수로 선언
ArrayList<T> resultDataSet = new ArrayList<T>();
String query = "SELECT * FROM " + this.tableName;
try {
this.open();
Statement statement = this.connection.createStatement();
ResultSet result = statement.executeQuery(query);
while (result.next()) {
T rowData = (T) dataClass.getDeclaredConstructor().newInstance();
for (Field field : dataClassFields) {
String fieldName = field.getName();
String fieldType = field.getType().toString();
if (fieldName.matches("(DB_FILE_NAME|TABLE_NAME)")) {
continue;
}
if (fieldType.matches("(int|short)")) {
field.setInt(rowData, result.getInt(fieldName));
} else if (fieldType.matches("(long)")) {
field.setLong(rowData, result.getLong(fieldName));
} else if (fieldType.matches("(float|double)")) { // class 객체 데이터에 실수형을 double로 써야한다. float으로 쓸거면 이 2개를 분리할 것.
field.setDouble(rowData, result.getDouble(fieldName));
} else if (fieldType.matches(".*String")) { // insert, update와 달리 select에서는 화면에 'null'이라는 문자가 보이지 않도록 처리한다.
if (result.getString(fieldName) == null) {
field.set(rowData, "");
} else {
field.set(rowData, result.getString(fieldName));
}
}
}
resultDataSet.add(rowData);
}
result.close();
statement.close();
this.close();
Method toHtmlStringMethod = dataClass.getDeclaredMethod("toHtmlString"); // dataClass는 메소드 시작 부분에서 User.java로 정의되어있다.
StringBuffer htmlString = new StringBuffer();
for (T row : resultDataSet) {
htmlString.append((String) toHtmlStringMethod.invoke(row));
}
return htmlString.toString();
} catch (SQLException e) {
e.printStackTrace();
this.close();
} catch (Exception e) {
e.printStackTrace();
this.close();
}
return "";
}
// SELECT One
// public HashMap<String, String> detailsData(int idx, T t) {
// Class<?> dataClass = t.getClass(); // User.java
// Field[] dataClassFields = dataClass.getDeclaredFields(); // User.java의 내용을 읽는다.
//
// // 값을 저장할 Map 객체를 변수로 선언
// HashMap<String, String> resultData = new HashMap<String, String>();
//
// String query = "SELECT * FROM " + this.tableName + " WHERE idx=" + idx;
// try {
// Statement statement = this.connection.createStatement();
// ResultSet result = statement.executeQuery(query);
// if (result.next()) {
// for (Field field : dataClassFields) {
// String fieldName = field.getName();
// String fieldType = field.getType().toString();
//
// if (result.getString(fieldName) == null) {
// continue;
// } else {
// resultData.put(fieldName, result.getString(fieldName));
// }
// }
// }
// result.close();
// statement.close();
// } catch (Exception e) {
// e.printStackTrace();
// }
// return resultData;
// }
// 생성자를 이용한 방법. 파라미터를 여러개 받지 않고 객체 하나만 받기 위해 이렇게 한건데...
// 어차피 Controller에서 생성자에 넣기 위해 입력을 하기 때문에 객체로 받는게 이득이 없다. 오히려 코드만 더 복잡해진다.
// 해당 메소드 상세 조회도 그렇고, 아래 delete 메소드 역시 그냥 위에 로직처럼 (int idx, T t) 이렇게 생성자를 만들어 DB로 넘겨 받는게 더 편한 것 같다.
public HashMap<String, String> detailsData(T t) {
Class<?> dataClass = t.getClass(); // User.java
Field[] dataClassFields = dataClass.getDeclaredFields(); // User.java의 내용을 읽는다.
String whereString = ""; // where 조건을 저장 idx=4
// 값을 저장할 Map 객체를 변수로 선언
HashMap<String, String> resultData = new HashMap<String, String>();
for (Field field : dataClassFields) { // for each로 User.java의 내용을 한 줄씩 읽는다.
// Step 1. 각 라인을 each로 읽어온다.
String fieldName = field.getName(); // 변수명(name, age, memo)...
// Step 2. whereString 만들기
if (fieldName.matches("idx")) {
try {
whereString += "idx=" + field.getInt(t);
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
continue;
}
}
String query = "SELECT * FROM " + this.tableName + " WHERE " + whereString;
try {
PreparedStatement preparedStatement = this.connection.prepareStatement(query);
ResultSet resultSet = preparedStatement.executeQuery();
if (resultSet.next()) {
for (Field field : dataClassFields) {
String fieldName = field.getName();
String fieldType = field.getType().toString();
if (resultSet.getString(fieldName) == null) {
continue;
} else {
resultData.put(fieldName, resultSet.getString(fieldName));
}
}
}
resultSet.close();
preparedStatement.close();
} catch (Exception e) {
e.printStackTrace();
}
return resultData;
}
// DELETE
// Step 3. Generic T 객체 사용 & PreparedStatement 사용
public boolean deleteData(T t) {
Class<?> dataClass = t.getClass(); // User.java
Field[] dataClassFields = dataClass.getDeclaredFields(); // User.java의 내용을 읽는다.
String whereString = ""; // where 조건을 저장 idx=4
for (Field field : dataClassFields) { // for each로 User.java의 내용을 한 줄씩 읽는다.
// Step 1. 각 라인을 each로 읽어온다.
String fieldName = field.getName(); // 변수명(name, age, memo)...
// Step 2. whereString 만들기
if (fieldName.matches("idx")) {
try {
whereString += "idx=" + field.getInt(t);
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
continue;
}
}
String query = "DELETE FROM " + this.tableName + " WHERE " + whereString;
try {
PreparedStatement preparedStatement = this.connection.prepareStatement(query);
preparedStatement.executeUpdate();
preparedStatement.close();
return true;
} catch (SQLException e) {
e.printStackTrace();
this.close();
}
return false;
}
// String이 정수로 형변환이 가능한지 아닌지를 검사하는 메소드
public static boolean isIntegerString(String numericString) {
try {
int result = Integer.parseInt(numericString);
return true;
} catch (Exception e) {
}
return false;
}
// String이 실수로 형변환이 가능한지 아닌지를 검사하는 메소드
public static boolean isFloatString(String numericString) {
try {
double result = Double.parseDouble(numericString);
return true;
} catch (Exception e) {
}
return false;
}
}
| [
"saebyulpark88@gmail.com"
] | saebyulpark88@gmail.com |
cb1e9fb22ae2ddca945f67b9d115296d7f1554ec | b1819803e85de85116e5315699e367266862ef45 | /ShiroDemo/src/main/java/org/shiro/realm/MyRealm3.java | 4dffe4c51e042ea63d0c8bf4b2a5720228d7865a | [
"MIT"
] | permissive | ppyang010/shiro_demo | f0505412687672550c57db75ff56567ddfc1b5dd | 7e8d33b1f998fa78457c5729e9a44ae460a4af43 | refs/heads/master | 2021-01-19T14:17:38.908875 | 2017-09-28T09:12:57 | 2017-09-28T09:12:57 | 100,894,831 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,179 | java | package org.shiro.realm;
import org.apache.shiro.authc.*;
import org.apache.shiro.realm.Realm;
/**
* Created by Administrator on 2017/8/22.
*/
public class MyRealm3 implements Realm{
public String getName() {
return "MyRealm3";
}
public boolean supports(AuthenticationToken authenticationToken) {
//仅支持UsernamePasswordToken类型的Token
return authenticationToken instanceof UsernamePasswordToken;
}
public AuthenticationInfo getAuthenticationInfo(AuthenticationToken authenticationToken) throws AuthenticationException {
String username= (String) authenticationToken.getPrincipal();
char[] pass= (char[]) authenticationToken.getCredentials();
String password=new String(pass);
if(!"zhang".equals(username)){
throw new UnknownAccountException();//如果用户名错误
}
if(!"123".equals(password)){
throw new IncorrectCredentialsException();//如果密码错误
}
//如果身份认证验证成功,返回一个AuthenticationInfo实现;
return new SimpleAuthenticationInfo(username+"@163.com",password,getName());
}
}
| [
"644724460@qq.com"
] | 644724460@qq.com |
30202126198d7df92c717a3caabf507e3de4b27b | a8d95f284928f11a58cf125b3d27faec530330a5 | /src/test/java/mkl/testarea/itext7/signature/SignMultipleAppearances.java | 20d9260f4bdf53aba34580a995aa4c6176104bcc | [] | no_license | mkl-public/testarea-itext7 | da319cde0fb5608e037e27396f1afaf6384900ae | 6bdc98ef8e56d51a68a5e95802a96566f60a9dfc | refs/heads/master | 2023-08-03T04:12:49.400453 | 2023-07-21T11:51:24 | 2023-07-21T11:51:24 | 58,366,236 | 36 | 18 | null | 2023-02-09T19:46:53 | 2016-05-09T09:50:37 | HTML | UTF-8 | Java | false | false | 9,541 | java | package mkl.testarea.itext7.signature;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.security.GeneralSecurityException;
import java.security.KeyStore;
import java.security.PrivateKey;
import java.security.Security;
import java.security.cert.Certificate;
import java.util.Enumeration;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.junit.BeforeClass;
import org.junit.Test;
import com.itextpdf.forms.PdfAcroForm;
import com.itextpdf.forms.PdfSigFieldLock;
import com.itextpdf.forms.fields.PdfFormField;
import com.itextpdf.forms.fields.PdfSignatureFormField;
import com.itextpdf.kernel.geom.Rectangle;
import com.itextpdf.kernel.pdf.PdfDictionary;
import com.itextpdf.kernel.pdf.PdfDocument;
import com.itextpdf.kernel.pdf.PdfName;
import com.itextpdf.kernel.pdf.PdfPage;
import com.itextpdf.kernel.pdf.PdfReader;
import com.itextpdf.kernel.pdf.StampingProperties;
import com.itextpdf.kernel.pdf.annot.PdfAnnotation;
import com.itextpdf.kernel.pdf.annot.PdfWidgetAnnotation;
import com.itextpdf.kernel.pdf.canvas.PdfCanvas;
import com.itextpdf.kernel.pdf.xobject.PdfFormXObject;
import com.itextpdf.layout.Canvas;
import com.itextpdf.layout.properties.TextAlignment;
import com.itextpdf.signatures.BouncyCastleDigest;
import com.itextpdf.signatures.IExternalSignature;
import com.itextpdf.signatures.PdfSigner;
import com.itextpdf.signatures.PdfSigner.CryptoStandard;
import com.itextpdf.signatures.PrivateKeySignature;
/**
* @author mkl
*/
public class SignMultipleAppearances {
final static File RESULT_FOLDER = new File("target/test-outputs", "signature");
final static String path = "keystores/demo-rsa2048.p12";
final static char[] pass = "demo-rsa2048".toCharArray();
static PrivateKey pk;
static Certificate[] chain;
@BeforeClass
public static void setUpBeforeClass() throws Exception {
RESULT_FOLDER.mkdirs();
BouncyCastleProvider provider = new BouncyCastleProvider();
Security.addProvider(provider);
KeyStore ks = KeyStore.getInstance("pkcs12", "SunJSSE");
ks.load(new FileInputStream(path), pass);
String alias = "";
Enumeration<String> aliases = ks.aliases();
while (alias.equals("demo") == false && aliases.hasMoreElements()) {
alias = aliases.nextElement();
}
pk = (PrivateKey) ks.getKey(alias, pass);
chain = ks.getCertificateChain(alias);
}
/**
* <p>
* This test illustrates how to easily create signatures with
* multiple appearances in a way that doesn't conflict directly
* with the specification, i.e. by using multiple signature
* fields sharing the same signature dictionary with a single
* appearance each.
* </p>
* <p>
* This approach re-uses the original code of the protected method
* {@link PdfSigner#createNewSignatureFormField(PdfAcroForm, String)}
* to create a common base field and later on removes undesired
* parts thereof. See {@link #testMultipleAppearancesMkII()} for an
* approach building all structure itself.
* </p>
*/
@Test
public void testMultipleAppearancesMkI() throws IOException, GeneralSecurityException {
try (
InputStream resource = getClass().getResourceAsStream("/mkl/testarea/itext7/content/test.pdf");
PdfReader pdfReader = new PdfReader(resource);
OutputStream result = new FileOutputStream(new File(RESULT_FOLDER, "test-MultipleAppearancesMkI.pdf"))
) {
PdfSigner pdfSigner = new PdfSigner(pdfReader, result, new StampingProperties()) {
@Override
protected PdfSigFieldLock createNewSignatureFormField(PdfAcroForm acroForm, String name)
throws IOException {
PdfSigFieldLock pdfSigFieldLock = super.createNewSignatureFormField(acroForm, name);
PdfSignatureFormField sigField = (PdfSignatureFormField) acroForm.getField(fieldName);
PdfWidgetAnnotation widget = sigField.getWidgets().get(0);
widget.getPage().removeAnnotation(widget);
sigField.remove(PdfName.AP);
sigField.remove(PdfName.Subtype);
sigField.remove(PdfName.P);
sigField.remove(PdfName.FT);
PdfPage pdfPage = document.getFirstPage();
PdfDictionary signatureDictionary = cryptoDictionary.getPdfObject();
sigField.addKid(createSubField(pdfPage, 10, 10, 100, 20, "bottom left", signatureDictionary, document));
sigField.addKid(createSubField(pdfPage, 400, 10, 100, 20, "bottom right", signatureDictionary, document));
sigField.addKid(createSubField(pdfPage, 10, 600, 100, 20, "top left", signatureDictionary, document));
sigField.addKid(createSubField(pdfPage, 400, 600, 100, 20, "top right", signatureDictionary, document));
return pdfSigFieldLock;
}
};
IExternalSignature pks = new PrivateKeySignature(pk, "SHA256", BouncyCastleProvider.PROVIDER_NAME);
pdfSigner.signDetached(new BouncyCastleDigest(), pks, chain, null, null, null, 0, CryptoStandard.CMS);
}
}
/**
* <p>
* This test illustrates how to easily create signatures with
* multiple appearances in a way that doesn't conflict directly
* with the specification, i.e. by using multiple signature
* fields sharing the same signature dictionary with a single
* appearance each.
* </p>
* <p>
* This approach builds all the form field structure itself. See
* {@link #testMultipleAppearancesMkI()} for an approach that
* re-uses the original code of the protected method
* {@link PdfSigner#createNewSignatureFormField(PdfAcroForm, String)}
* to create a common base field and later on removes undesired
* parts thereof.
* </p>
*/
@Test
public void testMultipleAppearancesMkII() throws IOException, GeneralSecurityException {
try (
InputStream resource = getClass().getResourceAsStream("/mkl/testarea/itext7/content/test.pdf");
PdfReader pdfReader = new PdfReader(resource);
OutputStream result = new FileOutputStream(new File(RESULT_FOLDER, "test-MultipleAppearancesMkII.pdf"))
) {
PdfSigner pdfSigner = new PdfSigner(pdfReader, result, new StampingProperties()) {
@Override
protected PdfSigFieldLock createNewSignatureFormField(PdfAcroForm acroForm, String name)
throws IOException {
PdfSignatureFormField sigField = PdfFormField.createSignature(document);
sigField.setFieldName(name);
acroForm.addField(sigField, null);
if (acroForm.getPdfObject().isIndirect()) {
acroForm.setModified();
} else {
document.getCatalog().setModified();
}
sigField.remove(PdfName.FT);
PdfPage pdfPage = document.getFirstPage();
PdfDictionary signatureDictionary = cryptoDictionary.getPdfObject();
sigField.addKid(createSubField(pdfPage, 10, 10, 100, 20, "bottom left", signatureDictionary, document));
sigField.addKid(createSubField(pdfPage, 400, 10, 100, 20, "bottom right", signatureDictionary, document));
sigField.addKid(createSubField(pdfPage, 10, 600, 100, 20, "top left", signatureDictionary, document));
sigField.addKid(createSubField(pdfPage, 400, 600, 100, 20, "top right", signatureDictionary, document));
return sigField.getSigFieldLockDictionary();
}
};
IExternalSignature pks = new PrivateKeySignature(pk, "SHA256", BouncyCastleProvider.PROVIDER_NAME);
pdfSigner.signDetached(new BouncyCastleDigest(), pks, chain, null, null, null, 0, CryptoStandard.CMS);
}
}
/**
* @see #testMultipleAppearancesMkI()
* @see #testMultipleAppearancesMkII()
*/
PdfFormField createSubField(PdfPage page, float x, float y, float width, float height, String name, PdfDictionary signatureDictionary, PdfDocument pdfDocument) {
PdfFormXObject appearance = new PdfFormXObject(new Rectangle(width, height));
PdfCanvas pdfCanvas = new PdfCanvas(appearance, pdfDocument);
try ( Canvas canvas = new Canvas(pdfCanvas, new Rectangle(width, height))) {
canvas.showTextAligned(name, 2, 2, TextAlignment.LEFT);
}
PdfDictionary ap = new PdfDictionary();
ap.put(PdfName.N, appearance.getPdfObject());
PdfWidgetAnnotation widget = new PdfWidgetAnnotation(new Rectangle(x, y, width, height));
widget.setFlags(PdfAnnotation.PRINT | PdfAnnotation.LOCKED);
widget.setPage(page);
widget.put(PdfName.AP, ap);
PdfSignatureFormField sigField = PdfFormField.createSignature(pdfDocument);
sigField.setFieldName(name);
sigField.addKid(widget);
sigField.put(PdfName.V, signatureDictionary);
page.addAnnotation(widget);
return sigField;
}
}
| [
"klink@csi.com"
] | klink@csi.com |
0217ce7653791544bfef4bfddd61278abba524c7 | dece4404b13afd20c137fee93d51a618206557a7 | /src/exception/ServiceException.java | 0aac6d700a43e7dd71d70e1d1ce91055f59241c1 | [] | no_license | matikbura/StuManagementSystem | 8a4d7cd2eb44e68ece695ebdf29369be22e682ac | 51a2f34731476f4cc10e88b2693e4e1e11ee737f | refs/heads/master | 2022-11-09T09:59:36.825643 | 2020-06-22T08:49:05 | 2020-06-22T08:49:05 | 274,085,398 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 601 | java | package exception;
public class ServiceException extends RuntimeException {
public ServiceException() {
super();
}
public ServiceException(String message, Throwable cause,
boolean enableSuppression, boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
}
public ServiceException(String message, Throwable cause) {
super(message, cause);
}
public ServiceException(String message) {
super(message);
}
public ServiceException(Throwable cause) {
super(cause);
}
} | [
"601084853@qq.com"
] | 601084853@qq.com |
fe66fe480913819b85cf9753960d4c8c2b66a413 | 4fc811483c268ef1f569e54520b2f71a2a28ee3a | /src-br.pucrio.inf.les.genarch/br/pucrio/inf/les/genarch/core/project/navigation/visitors/ArchitectureModelResourceVisitor.java | 2445a18cd66d5e6783b36b9e3f4402bd03c81b9b | [] | no_license | fellipealeixo/gpfframework | 08361109144a09e836ce0a2cd39e12732d658557 | f2086406fe6776f7fdb2e5de1d1ef68dedd9d3df | refs/heads/master | 2021-01-01T19:39:31.254932 | 2010-08-13T02:41:19 | 2010-08-13T02:41:19 | 35,834,248 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,942 | java | package br.pucrio.inf.les.genarch.core.project.navigation.visitors;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IResource;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.JavaCore;
import br.pucrio.inf.les.genarch.core.models.ArchitectureModelContent;
import br.pucrio.inf.les.genarch.core.project.navigation.NavigationUtil;
import br.pucrio.inf.les.genarch.core.project.navigation.ResourceClient;
import br.pucrio.inf.les.genarch.models.architecture.ArchitectureComponent;
import br.pucrio.inf.les.genarch.models.architecture.ArchitectureContainer;
import br.pucrio.inf.les.genarch.models.architecture.ArchitectureFolder;
import br.pucrio.inf.les.genarch.models.architecture.ArchitectureResourcesContainer;
public class ArchitectureModelResourceVisitor implements ResourceClient {
private ArchitectureModelContent architectureContent;
public ArchitectureModelResourceVisitor() {
this.architectureContent = new ArchitectureModelContent();
}
public void visit(IResource resource) {
String resourceName = resource.getName();
String resourcePath = resource.getProjectRelativePath().removeFirstSegments(1).toString();
String resourcePhysicalPath = resource.getProjectRelativePath().toString();
if ( resource.getProjectRelativePath().segmentCount() == 1 ) {
if ( JavaCore.create(resource) instanceof IPackageFragmentRoot ) {
this.architectureContent.addContainer(resource.getName());
} else if ( resource instanceof IFolder ) {
this.architectureContent.addResourceContainer(resource.getName());
}
} else if ( resource.getType() == IResource.FOLDER ) {
IFolder component = (IFolder)resource;
String parentPath = NavigationUtil.getParentByPath(component.getProjectRelativePath().toString());
EObject parent = this.architectureContent.getElementByPath(parentPath);
if ( parent instanceof ArchitectureContainer ) {
this.architectureContent.addComponent(resource.getName(),(ArchitectureContainer)parent,resourcePhysicalPath);
} else if ( parent instanceof ArchitectureComponent ){
this.architectureContent.addSubComponent(resourceName,resourcePhysicalPath,(ArchitectureComponent)parent);
} else if ( parent instanceof ArchitectureResourcesContainer ) {
this.architectureContent.addFolder(resourceName,resourcePhysicalPath,(ArchitectureResourcesContainer)parent);
} else if ( parent instanceof ArchitectureFolder ) {
this.architectureContent.addSubFolder(resourceName,resourcePhysicalPath,(ArchitectureFolder)parent);
}
} else if ( resource.getType() == IResource.FILE ) {
IFile file = (IFile)resource;
String componentParentPath = NavigationUtil.getParentByPath(file.getProjectRelativePath().toString());
EObject parent = architectureContent.getElementByPath(componentParentPath);
if ( file.getFileExtension().equals("java") ) {
this.architectureContent.addClass(resourceName,resourcePhysicalPath,(ArchitectureComponent)parent);
} else if ( file.getFileExtension().equals("aj") ) {
this.architectureContent.addAspect(resourceName,resourcePhysicalPath,(ArchitectureComponent)parent);
//-- Por wanderson
} else if ( file.getFileExtension().equals("xmi") ) {
this.architectureContent.addEPFFile(resourceName,resourcePhysicalPath,(ArchitectureComponent)parent);
//
} else if ( resource.getFileExtension().equals("xpt") ) {
String genPath = resource.getProjectRelativePath().removeLastSegments(1).toString();
if ( parent instanceof ArchitectureComponent ) {
this.architectureContent.addTemplate(resourceName,resourcePhysicalPath,genPath,(ArchitectureComponent)parent);
} else if ( parent instanceof ArchitectureFolder ) {
this.architectureContent.addTemplate(resourceName,resourcePhysicalPath,genPath,(ArchitectureFolder)parent);
}
} else if ( resource.getFileExtension().equals("mvel") ) {
String toPath = resource.getProjectRelativePath().removeLastSegments(1).toString();
this.architectureContent.addTemplate(resourceName,resourcePhysicalPath,toPath,(ArchitectureComponent)parent);
} else {
if ( parent instanceof ArchitectureResourcesContainer ) {
this.architectureContent.addFile(resourceName,resourcePhysicalPath,(ArchitectureResourcesContainer)parent);
} else if ( parent instanceof ArchitectureComponent ) {
this.architectureContent.addFile(resourceName,resourcePhysicalPath,(ArchitectureComponent)parent);
} else if ( parent instanceof ArchitectureFolder ) {
this.architectureContent.addFile(resourceName,resourcePhysicalPath,(ArchitectureFolder)parent);
}
}
}
}
public ArchitectureModelContent getArchitectureContent() {
return this.architectureContent;
}
}
| [
"wan007@8a986948-dc28-11de-b168-1d8412b1d573"
] | wan007@8a986948-dc28-11de-b168-1d8412b1d573 |
7501fd319c3c9cc23b8de3216c6ed6b50c612d0b | d2d0eb6adf7ffbbd545cf3820e115916a07b8aaa | /app/src/main/java/com/eararchitect/ynote/B2NoteDatabase.java | d89f62a3de91b2b394d622db838d0a0126f87570 | [] | no_license | Tritonfc/YNote | b348f0fb623cf0dd37bc31d3c29aa79c5ca889f0 | a279348903cee183a7058868f8ed2aa89a84c06b | refs/heads/master | 2023-07-17T11:05:11.421606 | 2021-08-27T18:42:34 | 2021-08-27T18:42:34 | 344,463,651 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,161 | java | package com.eararchitect.ynote;
import android.content.Context;
import androidx.room.Database;
import androidx.room.Room;
import androidx.room.RoomDatabase;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
@Database(entities = B2Note.class, version = 1, exportSchema = false)
public abstract class B2NoteDatabase extends RoomDatabase {
private static B2NoteDatabase instance;
private static final int NUMBER_OF_THREADS = 4;
//Initialization of ExecutorService to handle background tasks Asynchronously
static final ExecutorService databaseWriteExecutor = Executors.newFixedThreadPool(NUMBER_OF_THREADS);
public abstract B2NoteDao b2NoteDao();
//Synchronized function for checking if an instance of the database has already been created before creating another
public static synchronized B2NoteDatabase getInstance(Context context) {
if (instance == null) {
instance = Room.databaseBuilder(context.getApplicationContext(), B2NoteDatabase.class, "b2Note_table").fallbackToDestructiveMigration()
.build();
}
return instance;
}
}
| [
"ihemeprogress@gmail.com"
] | ihemeprogress@gmail.com |
ac1acaa6f56be1015a3c2dfdbaf9717e352e8f6f | 0d872fafa69392f0e21a1e25827ab6e43f1cfa4a | /src/com/syntax/class05/NewClass.java | 8100bedf76b66e7f08e411dc7153da18aac25fa8 | [] | no_license | sabah1983/JavaBasics1 | 55badad4fa6800bc7aeffcf461809c892a0a2437 | 59af79253028a5e399f9a0a49c78e99a63cd7f81 | refs/heads/master | 2022-10-13T04:22:18.031604 | 2020-06-12T19:03:42 | 2020-06-12T19:03:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,297 | java | package com.syntax.class05;
import java.util.Scanner;
public class NewClass {
public static void main(String[] args) {
// TODO Auto-generated method stub
/*
* take age input from a user and then based on the age print output
* if age from0-3 you are a baby
* if age from 4-5 you are a kid
* if age from 6-12 you are a child
*if age from 13-19 you are teenager
*if age from 20-64 you are an adult
* if age is more or equal to 65 you are a senior
*/
//1- let's declare all variables
int age;
Scanner scan;// to import we use ctrl+shift+O
//2.capture values
scan=new Scanner (System.in);
System.out.println("Please enter your age");
age=scan.nextInt();
//3. preform verfication
if (age>0) {
if (age<3) {
System.out.println("You are a baby");
}else if (age>=3 && age<=5) {
System.out.println("You are a kid");
}else if (age>=6 && age<=12) {
System.out.println("You are a child");
}else if (age>=13 && age<=19 ) {
System.out.println("You are a teenager");
}else if (age>=20 && age<65) {
System.out.println("You are an adult");
}else {
System.out.println("You are enjoyng your life");
}
}
else {System.out.println("Please enter valid age");
}
}
}
| [
"sabahabdaullah@gmail.com"
] | sabahabdaullah@gmail.com |
c198c6322caa26e4e98a596004c31507ad68cf9d | 485404fdbb9b5bdbb537b367a9e0a67db2c13589 | /DesignPatterns/src/main/java/hj/action/DesignPatterns/Composite/example/file/Main.java | 67b27a950f35240e60d0931c20b1bd839717a9bf | [
"MIT"
] | permissive | hjnlxuexi/action4java | 6c36456fb3b42e0ca610361fbd6b4e6109ba9f1b | dc13d0f1952873cd9cc2eeb38b08bcb0053d373c | refs/heads/master | 2020-04-08T11:12:47.380227 | 2019-04-26T00:41:33 | 2019-04-26T00:41:33 | 159,297,450 | 1 | 0 | MIT | 2019-04-26T00:41:34 | 2018-11-27T07:57:41 | Java | UTF-8 | Java | false | false | 606 | java | package hj.action.DesignPatterns.Composite.example.file;
/**
* <p>Title : </p>
* <p>Description : </p>
* <p>Date : 2019-02-16 </p>
*
* @author : hejie
*/
public class Main {
public static void main(String[] args) {
File textFile = new TextFile("T");
File imageFile = new ImageFile("I");
File video = new VideoFile("V");
File folder = new Folder("F");
File top = new Folder("T");
top.add(textFile);
top.add(folder);
folder.add(imageFile);
folder.add(video);
//显示所有文件
top.display();
}
}
| [
"1hjnlxuexi"
] | 1hjnlxuexi |
506122afffbd6ff6207e2dab47e19383cf5a9e1d | 87c3c335023681d1c906892f96f3a868b3a6ee8e | /HTML5/dev/simplivity-citrixplugin-service/src/main/java/com/vmware/vim25/ArrayOfHostDatastoreSystemDatastoreResult.java | a9d51f06c310ed69b1daec3d73a0036188362ec4 | [
"Apache-2.0"
] | permissive | HewlettPackard/SimpliVity-Citrix-VCenter-Plugin | 19d2b7655b570d9515bf7e7ca0cf1c823cbf5c61 | 504cbeec6fce27a4b6b23887b28d6a4e85393f4b | refs/heads/master | 2023-08-09T08:37:27.937439 | 2020-04-30T06:15:26 | 2020-04-30T06:15:26 | 144,329,090 | 0 | 1 | Apache-2.0 | 2020-04-07T07:27:53 | 2018-08-10T20:24:34 | Java | UTF-8 | Java | false | false | 1,336 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.6
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2019.06.12 at 09:16:35 AM EDT
//
package com.vmware.vim25;
/**
*
*/
@SuppressWarnings("all")
public class ArrayOfHostDatastoreSystemDatastoreResult {
private final static com.vmware.vim25.HostDatastoreSystemDatastoreResult[] NULL_HOST_DATASTORE_SYSTEM_DATASTORE_RESULT_ARRAY = new com.vmware.vim25.HostDatastoreSystemDatastoreResult[ 0 ] ;
public com.vmware.vim25.HostDatastoreSystemDatastoreResult[] HostDatastoreSystemDatastoreResult;
public com.vmware.vim25.HostDatastoreSystemDatastoreResult[] getHostDatastoreSystemDatastoreResult() {
if ((HostDatastoreSystemDatastoreResult) == null) {
return (NULL_HOST_DATASTORE_SYSTEM_DATASTORE_RESULT_ARRAY);
}
return HostDatastoreSystemDatastoreResult;
}
public void setHostDatastoreSystemDatastoreResult(com.vmware.vim25.HostDatastoreSystemDatastoreResult[] HostDatastoreSystemDatastoreResult) {
this.HostDatastoreSystemDatastoreResult = HostDatastoreSystemDatastoreResult;
}
}
| [
"anuanusha471@gmail.com"
] | anuanusha471@gmail.com |
350a3b8d526676aa0a692d65855bc0607c6a4b5a | 650f453cf1e2f44d92dceb714d12d0c3a5af02b6 | /src/com/multixsoft/hospitapp/utilities/FixedSizeAlphabeticalDocument.java | 6b96c850f05cdc9d7453183a30e0ac254dceb2c6 | [] | no_license | scarletApe/HospitApp_Ciclo2_Cliente_Escritorio | 01588acb4a3739c0bc80e291da683fee65930456 | 9cd83cb1153dfbd10a779ba4beb7bc2a3b92e7bb | refs/heads/master | 2021-01-01T17:21:42.107739 | 2017-03-08T04:46:32 | 2017-03-08T04:46:32 | 37,741,058 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,727 | 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.multixsoft.hospitapp.utilities;
import javax.swing.text.AttributeSet;
import javax.swing.text.BadLocationException;
import javax.swing.text.JTextComponent;
import javax.swing.text.PlainDocument;
/**
*
* @author manuelmartinez
*/
public class FixedSizeAlphabeticalDocument extends PlainDocument
{
private final JTextComponent owner;
private final int fixedSize;
public FixedSizeAlphabeticalDocument(JTextComponent owner, int fixedSize)
{
this.owner = owner;
this.fixedSize = fixedSize;
}
@Override
public void insertString(int offs, String str, AttributeSet a)
throws BadLocationException
{
if (getLength() + str.length() > fixedSize) {
str = str.substring(0, fixedSize - getLength());
this.owner.getToolkit().beep();
}
// try {
// Integer.parseInt(str);
// } catch (NumberFormatException e) {
// // inserted text is not a number
// this.owner.getToolkit().beep();
// return;
// }
if(containsForbidenCharacters(str)){
this.owner.getToolkit().beep();
return;
}
super.insertString(offs, str, a);
}
private boolean containsForbidenCharacters(String s){
char c;
for (int i = 0; i < s.length(); i++) {
c = s.charAt(i);
if(!Character.isAlphabetic(c) && c!='-' && c!='_' && c!=' '){
return true;
}
}
return false;
}
}
| [
"klamath135@yahoo.com"
] | klamath135@yahoo.com |
43559d61acd1e5fe81b0da47fae2f2f8d8875827 | 45a30fb93d864bdf95447f7f481c9ff32ee3e9a2 | /app/src/main/java/com/asgatech/sharjahmuseums/Tools/Connection/RetrofitTool.java | 74358c1f4b43918645f0a0d4cb1f5ebe2eeda98c | [] | no_license | MohamedAliArafa/SharjahMuseum | 97cb1dcbff8749c8abc1bb18f4afbec9f8ff591b | ba34a86c7341bb7ea3888e3fcfddc4eb9f01b5e1 | refs/heads/master | 2021-09-06T02:01:21.684529 | 2018-02-01T13:46:51 | 2018-02-01T13:46:51 | 107,461,228 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,673 | java | package com.asgatech.sharjahmuseums.Tools.Connection;
import android.util.Log;
import com.google.gson.Gson;
import java.util.concurrent.TimeUnit;
import okhttp3.OkHttpClient;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
public class RetrofitTool {
//--------------------------------------------------------------------
private Retrofit retrofit = null;
public Retrofit getRetrofit(String baseURL) {
if (retrofit == null) {
retrofit = new Retrofit.Builder()
.baseUrl(baseURL)
// .client(Utils.getClient())
.addConverterFactory(GsonConverterFactory.create()).client(getClient())
.build();
}
return retrofit;
}
public static OkHttpClient getClient() {
return new OkHttpClient.Builder()
.connectTimeout(2, TimeUnit.MINUTES)
.readTimeout(2, TimeUnit.MINUTES)
.build();
}
public ServerTool.ApiInterface getAPIBuilder(String baseURL) {
ServerTool.ApiInterface apiService = getRetrofit(baseURL).create(ServerTool.ApiInterface.class);
// RetrofitInterface retrofitInterface = new RestAdapter.Builder().setEndpoint(API.API_URL).build().create(RetrofitInterface.class);
return apiService;
}
public abstract static class APICallBack<T> implements Callback<T> {
private static final String TAG = "RetrofitTool";
@Override
public void onResponse(Call<T> call, Response<T> response) {
final Gson gson = new Gson();
Log.wtf(TAG,response.raw().toString());
Log.d(TAG, gson.toJson(response.body()) + "");
Log.d(TAG,call.request().url().toString());
if (response.isSuccessful()) {// response.isSuccessful() is true if the response code is 2xx
onSuccess(response.body());
} else {
int statusCode = response.code();
ResponseBody errorBody = response.errorBody();
onFailed(statusCode,errorBody);//return
}
}
@Override
public void onFailure(Call<T> call, Throwable t) {
Log.d("Excaption" , t+"");
onFailed(0,null);
Log.d(TAG,call.request().url().toString());
// connection failed
// onFailed(-1);
}
public abstract void onSuccess(T response);
public abstract void onFailed(int statusCode, ResponseBody responseBody);
}
} | [
"esraa.reda@700apps.com"
] | esraa.reda@700apps.com |
f9acaffcaccb96e25800382f40580eba1303f88f | f4fd782488b9cf6d99d4375d5718aead62b63c69 | /com/planet_ink/coffee_mud/Commands/Stand.java | bb12e61cd1b8cbea4e87fe9913e7eb9b3b5370bb | [
"Apache-2.0"
] | permissive | sfunk1x/CoffeeMud | 89a8ca1267ecb0c2ca48280e3b3930ee1484c93e | 0ac2a21c16dfe3e1637627cb6373d34615afe109 | refs/heads/master | 2021-01-18T11:20:53.213200 | 2015-09-17T19:16:30 | 2015-09-17T19:16:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,779 | java | package com.planet_ink.coffee_mud.Commands;
import com.planet_ink.coffee_mud.core.interfaces.*;
import com.planet_ink.coffee_mud.core.*;
import com.planet_ink.coffee_mud.core.collections.*;
import com.planet_ink.coffee_mud.Abilities.interfaces.*;
import com.planet_ink.coffee_mud.Areas.interfaces.*;
import com.planet_ink.coffee_mud.Behaviors.interfaces.*;
import com.planet_ink.coffee_mud.CharClasses.interfaces.*;
import com.planet_ink.coffee_mud.Commands.interfaces.*;
import com.planet_ink.coffee_mud.Common.interfaces.*;
import com.planet_ink.coffee_mud.Exits.interfaces.*;
import com.planet_ink.coffee_mud.Items.interfaces.*;
import com.planet_ink.coffee_mud.Libraries.interfaces.*;
import com.planet_ink.coffee_mud.Locales.interfaces.*;
import com.planet_ink.coffee_mud.MOBS.interfaces.*;
import com.planet_ink.coffee_mud.Races.interfaces.*;
import java.util.*;
/*
Copyright 2004-2015 Bo Zimmerman
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.
*/
@SuppressWarnings("rawtypes")
public class Stand extends StdCommand
{
public Stand(){}
private final String[] access=I(new String[]{"STAND","ST","STA","STAN"});
@Override public String[] getAccessWords(){return access;}
@Override
public boolean execute(MOB mob, Vector commands, int metaFlags)
throws java.io.IOException
{
final boolean ifnecessary=((commands.size()>1)&&(((String)commands.lastElement()).equalsIgnoreCase("IFNECESSARY")));
final Room room = CMLib.map().roomLocation(mob);
if(CMLib.flags().isStanding(mob))
{
if(!ifnecessary)
mob.tell(L("You are already standing!"));
}
else
if((mob.session()!=null)&&(mob.session().isStopped()))
mob.tell(L("You may not stand up."));
else
if(room!=null)
{
final CMMsg msg=CMClass.getMsg(mob,null,null,CMMsg.MSG_STAND,mob.amDead()?null:L("<S-NAME> stand(s) up."));
if(room.okMessage(mob,msg))
room.send(mob,msg);
}
return false;
}
@Override public double combatActionsCost(final MOB mob, final List<String> cmds){return CMProps.getCommandCombatActionCost(ID());}
@Override public double actionsCost(final MOB mob, final List<String> cmds){return CMProps.getCommandActionCost(ID());}
@Override public boolean canBeOrdered(){return true;}
}
| [
"bo@zimmers.net"
] | bo@zimmers.net |
c38eacaa03dbac314ffdbef6397d00e5b8dca944 | 493a8065cf8ec4a4ccdf136170d505248ac03399 | /net.sf.ictalive.coordination.wfannotation.mapping.diagram/src/net/sf/ictalive/coordination/wfannotation/mapping/diagram/edit/policies/Compensate2CanonicalEditPolicy.java | 5034e7fb24cb35667db9556f904f33b997f4dda6 | [] | no_license | ignasi-gomez/aliveclipse | 593611b2d471ee313650faeefbed591c17beaa50 | 9dd2353c886f60012b4ee4fe8b678d56972dff97 | refs/heads/master | 2021-01-14T09:08:24.839952 | 2014-10-09T14:21:01 | 2014-10-09T14:21:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 704 | java | package net.sf.ictalive.coordination.wfannotation.mapping.diagram.edit.policies;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
import org.eclipse.gmf.runtime.notation.View;
/**
* @generated
*/
public class Compensate2CanonicalEditPolicy extends CanonicalEditPolicy {
/**
* @generated
*/
protected List getSemanticChildrenList() {
return Collections.EMPTY_LIST;
}
/**
* @generated
*/
protected boolean isOrphaned(Collection semanticChildren, final View view) {
return false;
}
/**
* @generated
*/
protected String getDefaultFactoryHint() {
return null;
}
}
| [
"salvarez@lsi.upc.edu"
] | salvarez@lsi.upc.edu |
5129f5c2b36699953adce0cc48f0485691527c30 | ee1c7b10fb81dea28cd644541f9cb36e838c4e45 | /src/main/java/br/com/lcv/cliente/ClienteRepository.java | afcf93ae33e167e96bf4c962c1def9704af39dac | [] | no_license | lucasvensarini/SaqueAPI | 068237140d1dc19bcac8e2c1b8b1f26c62ce4345 | 6a47b3fdeedb8a351a204b1a8a664679fdbca7b7 | refs/heads/master | 2021-04-26T23:27:02.963393 | 2018-03-14T01:06:59 | 2018-03-14T01:06:59 | 123,996,483 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 232 | java | package br.com.lcv.cliente;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface ClienteRepository extends JpaRepository<Cliente, Long> {
}
| [
"lucasvensarini@gmail.com"
] | lucasvensarini@gmail.com |
45e36bae6c598ac6c0496c1aaf5e8d2b78034d61 | 375d111246fd226ac792e09c8b977eae02d00d2e | /app/src/main/java/com/example/sawood/cardvie/signup.java | c7f5ff7a36435975d15cb8cb6042f35ec14e0c8d | [] | no_license | sawood14012/Ramadan-time-table-app | 846d7a46aefa690a7610aef21d14916600c22fa1 | 00447f0feb9978fa02857257408fbfd52cd2e5f0 | refs/heads/master | 2020-04-26T16:28:56.379025 | 2019-03-04T05:45:19 | 2019-03-04T05:45:19 | 173,680,089 | 3 | 1 | null | null | null | null | UTF-8 | Java | false | false | 5,752 | java | package com.example.sawood.cardvie;
import android.annotation.SuppressLint;
import android.app.ProgressDialog;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
public class signup extends AppCompatActivity{
private EditText userName, userPassword, userEmail ,userno;
private Button regButton;
private TextView userLogin;
private FirebaseAuth firebaseAuth;
// private ImageView userProfilePic;
String email, name, phone, password;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_signup);
setupUIViews();
final Login l = new Login();
firebaseAuth = FirebaseAuth.getInstance();
regButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if(validate()){
//Upload data to the database
final String user_email = userEmail.getText().toString().trim();
final String user_password = userPassword.getText().toString().trim();
final ProgressDialog prd = ProgressDialog.show(signup.this,"Registering on Database","please wait..!");
firebaseAuth.createUserWithEmailAndPassword(user_email, user_password).addOnCompleteListener(new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if(task.isSuccessful()){
//sendEmailVerification();
prd.dismiss();
// firebaseAuth.signOut();
sendUserData();
finish();
//sendEmailVerification();
// Toast.makeText(signup.this, "Successfully Registered, Upload complete!", Toast.LENGTH_LONG).show();
// l.signIn(user_email,user_password);
// firebaseAuth.signOut();
startActivity(new Intent(signup.this, MainActivity.class));
}else{
Toast.makeText(signup.this, "Registration Failed:" +task.getException().toString() , Toast.LENGTH_SHORT).show();
prd.dismiss();
}
}
});
}
}
});
userLogin.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(signup.this, Login.class));
}
});
}
private void setupUIViews(){
userName = (EditText)findViewById(R.id.sgn_name);
userPassword = (EditText)findViewById(R.id.sgn_password);
userEmail = (EditText)findViewById(R.id.sgn_email);
regButton = (Button)findViewById(R.id.sign_up);
userLogin = (TextView)findViewById(R.id.go_log);
userno = (EditText)findViewById(R.id.sgn_phone);
// userProfilePic = (ImageView)findViewById(R.id.ivProfile);
}
private Boolean validate(){
Boolean result = false;
name = userName.getText().toString();
password = userPassword.getText().toString();
email = userEmail.getText().toString();
phone = userno.getText().toString();
if(name.isEmpty() || password.isEmpty() || email.isEmpty() || phone.isEmpty()){
Toast.makeText(this, "Please enter all the details", Toast.LENGTH_SHORT).show();
}else{
result = true;
}
return result;
}
private void sendEmailVerification(){
FirebaseUser firebaseUser = firebaseAuth.getCurrentUser();
if(firebaseUser!=null){
firebaseUser.sendEmailVerification().addOnCompleteListener(new OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task) {
if(task.isSuccessful()){
// sendUserData();
Toast.makeText(signup.this, "Successfully Registered, Verification mail has been sent to your Email please verify it.", Toast.LENGTH_SHORT).show();
//firebaseAuth.signOut();
// finish();
// startActivity(new Intent(signup.this, Login.class));
}else{
Toast.makeText(signup.this, "Verification mail has'nt been sent!", Toast.LENGTH_SHORT).show();
}
}
});
}
}
private void sendUserData(){
FirebaseDatabase firebaseDatabase = FirebaseDatabase.getInstance();
DatabaseReference myRef = firebaseDatabase.getReference(firebaseAuth.getInstance().getUid());
UserProfile userProfile = new UserProfile(phone, email, name);
myRef.setValue(userProfile);
}
}
| [
"sawoodrocket@gmail.com"
] | sawoodrocket@gmail.com |
6ce754a1858e3781a0809b85ffbb22931a4970bb | 63015105a3c75171f1fab0dabcb1d00b20639350 | /app/src/main/java/com/ahri/chat/util/ocr/OcrRecognizeAsyncTask.java | 68cb91e1e8581a4e987a884a53cff92d8ed79d38 | [] | no_license | zouyingjie/TuLingAssistant | 4f5a406326744c34866992aa73e9e7453885cd08 | e7bc866c9938f4c93001d79c2da63b1ddad60529 | refs/heads/master | 2021-01-21T17:06:59.464531 | 2017-03-17T01:03:40 | 2017-03-17T01:03:40 | 83,624,254 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,224 | java | /*
* Copyright 2011 Robert Theis
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.ahri.chat.util.ocr;
import android.graphics.Bitmap;
import android.os.AsyncTask;
import android.util.Log;
import com.ahri.chat.base.BaseChatFragment;
import com.googlecode.tesseract.android.TessBaseAPI;
/**
* Class to send OCR requests to the OCR engine in a separate thread, send a success/failure message,
* and dismiss the indeterminate progress dialog box. Used for non-continuous mode OCR only.
*/
public final class OcrRecognizeAsyncTask extends AsyncTask<Bitmap, Void, String> {
private TessBaseAPI baseApi;
private BaseChatFragment fragment;
public OcrRecognizeAsyncTask(TessBaseAPI baseApi, BaseChatFragment fragment) {
this.fragment = fragment;
this.baseApi = baseApi;
}
@Override
protected String doInBackground(Bitmap... arg0) {
String textResult;
Bitmap bitmap = arg0[0];
try {
baseApi.setImage(bitmap);
textResult = baseApi.getUTF8Text();
if (textResult == null || textResult.equals("")) {
return "";
} else {
return textResult;
}
} catch (RuntimeException e) {
Log.e("OcrRecognizeAsyncTask", "Caught RuntimeException in request to Tesseract. Setting state to CONTINUOUS_STOPPED.");
e.printStackTrace();
try {
baseApi.clear();
} catch (NullPointerException e1) {
}
return "";
}
}
@Override
protected void onPostExecute(String result) {
super.onPostExecute(result);
fragment.insertText(result);
}
}
| [
"yingjiezou1@gmail.com"
] | yingjiezou1@gmail.com |
09b9c7fb18de069f6a41ee2f648d3c40b93dd31c | 671fa0f419057ff6b631c0ec8d752c98f554fe1d | /src/com/company/Main.java | 7fa548be42d412368960f38bf5185a4cdfd33cbf | [] | no_license | SSHUSSAIN-86/JavaTest-bugs | 30992f3310db0a8d87e16d02efac8032207c90e8 | b88edd819cd9cb03354738de6698fd8276eab04e | refs/heads/master | 2023-04-10T06:24:09.440634 | 2021-04-22T06:40:34 | 2021-04-22T06:40:34 | 351,524,758 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 15,754 | java | package com.company;
import java.awt.*;
import java.util.*;
import java.util.List;
import javafx.application.Application;
import javafx.beans.InvalidationListener;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableListValue;
import javafx.collections.ListChangeListener;
import javafx.collections.ObservableList;
import javafx.geometry.Pos;
import javafx.scene.Group;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.Slider;
import javafx.scene.layout.*;
import javafx.scene.paint.Color;
import javafx.scene.shape.Circle;
import javafx.scene.shape.Line;
import javafx.scene.shape.Rectangle;
import javafx.stage.Stage;
class MarupekeGrid{
int size;
MarupekeTile[][] marupekeTiles;
boolean isLegalGrid;
List<Reason> illegalitiesInGrid;
MarupekeGrid(MarupekeTile[][] marupekeTiles,int size){
this.marupekeTiles=marupekeTiles;
this.size=size;
//Setting up isLegalGrid value
if(size>10 || size<3) {
isLegalGrid = false;
illegalitiesInGrid= new ArrayList<Reason>();
} else{
isLegalGrid = true;
intilizeAllMaupekeTiles(marupekeTiles,size);
printTiles(marupekeTiles,size);
}
}
// intilizeAllMaupekeTiles intitilzes Grid to all Blank
void intilizeAllMaupekeTiles(MarupekeTile[][] marupekeTiles,int size){
Tile tile=Tile.BLANK;
isLegalGrid = false;
illegalitiesInGrid= new ArrayList<Reason>();
for(int i=0;i<size;i++){
for(int j=0;j<size;j++){
marupekeTiles[i][j] = new MarupekeTile(true,tile);
}
}
}
void checkIllegalitiesInGrid(boolean isLegalGrid, MarupekeGrid marupekeGrid){
if(isLegalGrid==false) {
if (marupekeGrid.size > 10) {
ReasonDiagonal reasonDiagonal = new ReasonDiagonal("Grid size cannot be greater then 10");
illegalitiesInGrid.add(reasonDiagonal);
} else if(marupekeGrid.size < 3){
ReasonDiagonal reasonDiagonal = new ReasonDiagonal("Grid size cannot be less then 3");
illegalitiesInGrid.add(reasonDiagonal);
} else {
// Scanning for Horizontal violation [x,y] [x,y+1] and [x,y+2]
for(int i = 0; i < size; i++) {
for (int j = 0; j < size-2; j++) {
if(marupekeGrid.marupekeTiles[i][j].tile == marupekeGrid.marupekeTiles[i][j+1].tile &&
marupekeGrid.marupekeTiles[i][j].tile == marupekeGrid.marupekeTiles[i][j+2].tile){
ReasonHorizontal reasonHorizontal = new ReasonHorizontal("Grid violation at grid coordinates " + i +"," + j +" "+ i +"," + (j+1) + " and "
+ i +"," + (j+2));
illegalitiesInGrid.add(reasonHorizontal);
}
}
}
// Scanning for Horizontal violation [x,y] [x,y-1] and [x,y-2]
for(int i = 0; i < size; i++) {
for (int j = size-1; j > 1; j--) {
if(marupekeGrid.marupekeTiles[i][j].tile == marupekeGrid.marupekeTiles[i][j-1].tile &&
marupekeGrid.marupekeTiles[i][j].tile == marupekeGrid.marupekeTiles[i][j-2].tile){
ReasonHorizontal reasonHorizontal = new ReasonHorizontal("Grid violation at grid coordinates " + i +"," + j +" "+ i +"," + (j-1) + " and "
+ i +"," + (j-2));
illegalitiesInGrid.add(reasonHorizontal);
}
}
}
// Scanning for Vertical violation [x,y] [x+1,y] and [x+2,y]
for(int i = 0; i < size-2; i++) {
for (int j = 0; j < size; j++) {
if(marupekeGrid.marupekeTiles[i][j].tile == marupekeGrid.marupekeTiles[i+1][j].tile &&
marupekeGrid.marupekeTiles[i][j].tile == marupekeGrid.marupekeTiles[i+2][j].tile){
ReasonVertical reasonVertical = new ReasonVertical("Grid violation at grid coordinates " + i +"," + j +" "+ (i+1) +"," + j + " and "
+ (i+2) +"," + j);
illegalitiesInGrid.add(reasonVertical);
}
}
}
// Scanning for Vertical violation [x,y] [x-1,y] and [x-2,y]
for(int i = size-1; i > 1; i--) {
for (int j = 0; j < size; j++) {
if(marupekeGrid.marupekeTiles[i][j].tile == marupekeGrid.marupekeTiles[i-1][j].tile &&
marupekeGrid.marupekeTiles[i][j].tile == marupekeGrid.marupekeTiles[i-2][j].tile){
ReasonVertical reasonVertical = new ReasonVertical("Grid violation at grid coordinates " + i +"," + j +" "+ (i-1) +"," + j + " and "
+ (i-2) +"," + j);
illegalitiesInGrid.add(reasonVertical);
}
}
}
// Scanning for Diagonal violation [x,y] [x+1,y-1] and [x+2,y-2]
for(int i = 0; i < size-2; i++) {
for (int j = size-1; j > 1; j--) {
if(marupekeGrid.marupekeTiles[i][j].tile == marupekeGrid.marupekeTiles[i+1][j-1].tile &&
marupekeGrid.marupekeTiles[i][j].tile == marupekeGrid.marupekeTiles[i+2][j-2].tile){
ReasonDiagonal reasonDiagonal = new ReasonDiagonal("Grid violation at grid coordinates " + i +"," + j +" "+ (i+1) +"," + (j-1) + " and "
+ (i+2) +"," + (j-2));
illegalitiesInGrid.add(reasonDiagonal);
}
}
}
// Scanning for Diagonal violation [x,y] [x-1,y+1] and [x-2,y+2]
for(int i = size-1; i > 1; i--) {
for (int j = 0; j < size-2; j++) {
if(marupekeGrid.marupekeTiles[i][j].tile == marupekeGrid.marupekeTiles[i-1][j+1].tile &&
marupekeGrid.marupekeTiles[i][j].tile == marupekeGrid.marupekeTiles[i-2][j+2].tile){
ReasonDiagonal reasonDiagonal = new ReasonDiagonal("Grid violation at grid coordinates " + i +"," + j +" "+ (i-1) +"," + (j+1) + " and "
+ (i-2) +"," + (j+2));
illegalitiesInGrid.add(reasonDiagonal);
}
}
}
// Scanning for Diagonal violation [x,y] [x-1,y-1] and [x-2,y-2]
for(int i = size-1; i > 1; i--) {
for (int j = size-1; j > 1; j--) {
if(marupekeGrid.marupekeTiles[i][j].tile == marupekeGrid.marupekeTiles[i-1][j-1].tile &&
marupekeGrid.marupekeTiles[i][j].tile == marupekeGrid.marupekeTiles[i-2][j-2].tile){
ReasonDiagonal reasonDiagonal = new ReasonDiagonal("Grid violation at grid coordinates " + i +"," + j +" "+ (i-1) +"," + (j-1) + " and "
+ (i-2) +"," + (j-2));
illegalitiesInGrid.add(reasonDiagonal);
}
}
}
// Scanning for Diagonal violation [x,y] [x+1,y+1] and [x+2,y+2]
for(int i = 0; i < size-2; i++) {
for (int j = 0; j < size-2; j++) {
if(marupekeGrid.marupekeTiles[i][j].tile == marupekeGrid.marupekeTiles[i+1][j+1].tile &&
marupekeGrid.marupekeTiles[i][j].tile == marupekeGrid.marupekeTiles[i+2][j+2].tile){
ReasonDiagonal reasonDiagonal = new ReasonDiagonal("Grid violation at grid coordinates " + i +"," + j +" "+ (i+1) +"," + (j+1) + " and "
+ (i+2) +"," + (j+2));
illegalitiesInGrid.add(reasonDiagonal);
}
}
}
}
}
}
//printTiles will print put out only if Grid value is legal
void printTiles(MarupekeTile[][] marupekeTiles,int size){
for(int i=0;i<size;i++){
for(int j=0;j<size;j++){
System.out.println(marupekeTiles[i][j].tile);
}
System.out.println("\n\r");
}
}
public GridPane createGrid(BooleanProperty[][] binaryController) {
int columns = binaryController.length ;
int rows = binaryController[0].length ;
GridPane grid = new GridPane();
for (int x = 0 ; x < columns ; x++) {
ColumnConstraints columnConstraints = new ColumnConstraints();
columnConstraints.setFillWidth(true);
columnConstraints.setHgrow(Priority.ALWAYS);
grid.getColumnConstraints().add(columnConstraints);
}
for (int y = 0 ; y < rows ; y++) {
RowConstraints rowConstraints = new RowConstraints();
rowConstraints.setFillHeight(true);
rowConstraints.setVgrow(Priority.ALWAYS);
grid.getRowConstraints().add(rowConstraints);
}
for (int x = 0 ; x < columns ; x++) {
for (int y = 0 ; y < rows ; y++) {
grid.add(createCell(binaryController[x][y]),x,y);
}
}
grid.getStyleClass().add("grid");
return grid;
}
public GridPane createCell(BooleanProperty booleanControl) {
GridPane gridpane = new GridPane();
Line line1 = new Line(-25,25,25,-25);
Line line2 = new Line(-25,-25,25,25);
Group group = new Group(line1,line2);
Circle circle = new Circle(20, Color.CORNFLOWERBLUE);
Rectangle rectangle = new Rectangle(50,50);
List<ObservableList> list = new ArrayList<>();
gridpane.setOnMouseClicked(event -> {
if(event.getClickCount()==1) {gridpane.getChildren().removeAll(group,rectangle); gridpane.getChildren().add(circle);
gridpane.getChildren().forEach(Node->{System.out.println(Node);});
list.add(gridpane.getChildren());
}
if(event.getClickCount()==2) {gridpane.getChildren().removeAll(circle,rectangle); gridpane.getChildren().add(group);
gridpane.getChildren().forEach(Node->{System.out.println(Node);});
list.add(gridpane.getChildren());
}
if(event.getClickCount()==3) {gridpane.getChildren().removeAll(circle,group); gridpane.getChildren().add(rectangle);
gridpane.getChildren().forEach(Node->{System.out.println(Node);});
list.add(gridpane.getChildren());
}
if(event.getClickCount()>3 || event.getClickCount()<=0) {gridpane.getChildren().removeAll(circle,group,rectangle);
gridpane.getChildren().forEach(Node->{System.out.println(Node);});
list.add(gridpane.getChildren());
}
System.out.println(list);
});
//System.out.println(list);
gridpane.getStyleClass().add("cell");
gridpane.setStyle("-fx-padding: 10;" +
"-fx-border-style: solid inside;" +
"-fx-border-width: 2;" +
"-fx-border-insets: 5;" +
"-fx-border-radius: 5;" +
"-fx-border-color: red;");
return gridpane;
}
public void checkIfGridIsFull(GridPane grid){
ObservableList<Node> gridChildren = grid.getChildren();
if(gridChildren!=null) {
gridChildren.forEach(Node->{
System.out.println(Node);
});
}
}
}
//Main class
public class Main extends Application{
public static void main(String[] args) {
launch(args);
}
//Start method begins here
@Override
public void start(Stage primaryStage) {
int size;
/* This reads the size of grid
* provided by player
*/
Scanner scan = new Scanner(System.in);
System.out.print("Enter size of grid: ");
// This method reads the number provided
size = scan.nextInt();
// Closing Scanner after the use
scan.close();
//Initializing Marupeke Tile Array
MarupekeTile[][] marupekeTileArray=new MarupekeTile[size][size];
//Initializing Marupeke Grid
MarupekeGrid marupekeGrid = new MarupekeGrid(marupekeTileArray,size);
marupekeGrid.intilizeAllMaupekeTiles(marupekeTileArray,size);
//Checking for Maurpeke Grid legality conditions
marupekeGrid.checkIllegalitiesInGrid(marupekeGrid.isLegalGrid,marupekeGrid);
System.out.println(marupekeGrid.illegalitiesInGrid);
System.out.println(marupekeGrid.isLegalGrid);
BooleanProperty[][] binaryController = new BooleanProperty[size][size];
for (int x = 0 ; x < size ; x++) {
for (int y = 0 ; y < size ; y++) {
binaryController[x][y] = new SimpleBooleanProperty();
}
}
GridPane grid = marupekeGrid.createGrid(binaryController);
marupekeGrid.checkIfGridIsFull(grid);
StackPane stackPane = new StackPane(grid);
Button submit = new Button("Submit");
submit.setOnMouseClicked(event ->{
if(event.getClickCount()==1){
((Stage)(((Button)event.getSource()).getScene().getWindow())).close();
//Checking for Maurpeke Grid legality conditions
marupekeGrid.checkIllegalitiesInGrid(marupekeGrid.isLegalGrid,marupekeGrid);
}
});
grid.add(submit,size-size/3,size);
stackPane.setStyle("-fx-padding: 10;" +
"-fx-border-style: solid inside;" +
"-fx-border-width: 2;" +
"-fx-border-insets: 5;" +
"-fx-border-radius: 5;" +
"-fx-border-color: blue;");
grid.setStyle("-fx-padding: 10;" +
"-fx-border-style: solid inside;" +
"-fx-border-width: 2;" +
"-fx-border-insets: 5;" +
"-fx-border-radius: 5;" +
"-fx-border-color: green;");
//This sets the main scene
Scene scene = new Scene(stackPane, 600, 600);
//Subsequent scenes
Scene scene1, scene2;
//Scene 2
Label label1= new Label("Click 3 times on the grid to set up the constraints");
Button button1= new Button("Click here to start!");
button1.setOnAction(e -> primaryStage.setScene(scene));
VBox vbox1 = new VBox(20);
vbox1.getChildren().addAll(label1, button1);
scene2= new Scene(vbox1, 500, 500);
//Scene 1
Label label= new Label("Do you want to play the game?");
Button button= new Button("Click to play!");
button.setOnAction(e -> primaryStage.setScene(scene2));
VBox vbox = new VBox(20);
vbox.getChildren().addAll(label, button);
scene1= new Scene(vbox, 300, 250);
//primaryStage starts from Scene1
primaryStage.setScene(scene1);
primaryStage.setTitle("Marupeke Game");
primaryStage.show();
}
}
| [
"shehzad.hussain86@yahoo.com"
] | shehzad.hussain86@yahoo.com |
c20c80db160bccfcc5e9c9f99d39cf5b8820e366 | 71027e2310f9917cd46ccb6a21c0100487c6b43b | /base/freehep-xml/src/main/java/org/freehep/xml/io/XMLIORegistry.java | 41523d1f249c0cb4905ecb4e66e11ad94d6e1963 | [] | no_license | kdk-pkg-soft/freehep-ncolor-pdf | f70f99ebdc7a78fc25960f42629e05d3c58f2b03 | d317ea43554c75f8ff04e826b4361ad4326574b0 | refs/heads/master | 2021-01-23T12:18:26.502269 | 2012-08-22T23:22:21 | 2012-08-22T23:22:21 | 5,516,244 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,497 | java | /*
* XMLIORegistry.java
*/
package org.freehep.xml.io;
/**
* Interface of an XMLIORegistry. The XMLIOFactories used
* in the restore procedure of an object and the XMLIOProxyes
* should be register to an XMLIORegistry that should be set
* in the XMLIOManager passed to the restore method.
*
* @author turri
* @version 1.0
*/
public interface XMLIORegistry
{
/**
* Register an XMLIOFactory or an XMLIOProxy to this Registry.
* @param obj Either an XMLIOFactory or an XMLIOProxy to be registered.
* @throws An IllegalArgumentException if the object does not implement
* either XMLIOFactory or XMLIOProxy.
*
*/
void register( Object obj ) throws IllegalArgumentException;
/**
* Get the appropriate XMLIOFactory to create the object
* that wrote the xml node. The XMLIOFactory identification string
* is attached to the node's attribute <code>xmlioFactory<\code>.
* If this attribute is not present, the node name is taken as
* the identification string. The identification string is
* assigned by the XMLIOManager by using the object's final
* part of the Class name.
* @param objClass The Class of the object to be created.
* @return The corresponding XMLIOFactory.
* @throws IllegalArgumentException if the XMLIOFactory does not exist.
*
*/
XMLIOFactory getXMLIOFactory( Class objClass ) throws IllegalArgumentException;
/**
* Get the appropriate XMLIOProxy to restore the object
* that wrote the xml node. The XMLIOProxy identification string
* is the node name. The identification string is
* assigned by the XMLIOManager by using the object's final
* part of the Class name.
* @param objClass The Class of the object to be restored.
* @return The corresponding XMLIOProxy.
* @throws IllegalArgumentException if the XMLIOProxy does not exist.
*
*/
XMLIOProxy getXMLIOProxy( Class objClass ) throws IllegalArgumentException;
/**
* Get the identification string corresponding to a Class.
* @param clName The Class.
* @return The identification String.
*
*/
String getClassId( Class clName );
/**
* Get the Class corresponding to an identification String.
* @param objName The object's identification String.
* @return The corresponding Class.
*
*/
Class getIdClass( String objName );
}
| [
"hamad.deshmukh@Kodak.com"
] | hamad.deshmukh@Kodak.com |
14035f9bf558f03b3185e28fdc21a0a9f2be6acd | d541829eafe5f85f6ea94af899ed9add4117117b | /src/main/java/com/leon/mybatisspring/pojo/UserBean.java | ef7dbc43d6473032620f57bd0188bddf6093f9fe | [] | no_license | bazingagain/MyBatisSpringMVCDemo | 2f32b295d6ab218ab65436ba6d3fe2e516b2d94f | feb333da07fbd6a6e415b77c43036221f53f0b74 | refs/heads/master | 2021-07-21T17:07:35.493034 | 2017-11-01T08:02:46 | 2017-11-01T08:02:46 | 107,280,367 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,348 | java | package com.leon.mybatisspring.pojo;
import java.util.Date;
import java.util.List;
/**
* Created on 17/10/2017.
*
* @author Xiaolei-Peng
*/
public class UserBean {
private Integer id;
private String userName;
private Date birthday;
private String sex;
private String email;
private String note;
private List<RoleBean> roleList;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public Date getBirthday() {
return birthday;
}
public void setBirthday(Date birthday) {
this.birthday = birthday;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getNote() {
return note;
}
public void setNote(String note) {
this.note = note;
}
public List<RoleBean> getRoleList() {
return roleList;
}
public void setRoleList(List<RoleBean> roleList) {
this.roleList = roleList;
}
}
| [
"1152204424@qq.com"
] | 1152204424@qq.com |
12cf58bf6aadea78233eb8689c5c07aa3a0b7ac9 | 45c84e64a486a3c48bd41a78e28252acbc0cc1b0 | /src/chrome/android/java/src/org/chromium/chrome/browser/gesturenav/NavigationSheetView.java | 083651a3e770465e9c32e00b031f913605b1df30 | [
"BSD-3-Clause",
"MIT"
] | permissive | stanleywxc/chromium-noupdator | 47f9cccc6256b1e5b0cb22c598b7a86f5453eb42 | 637f32e9bf9079f31430c9aa9c64a75247993a71 | refs/heads/master | 2022-12-03T22:00:20.940455 | 2019-10-04T16:29:31 | 2019-10-04T16:29:31 | 212,851,250 | 1 | 2 | MIT | 2022-11-17T09:51:04 | 2019-10-04T15:49:33 | null | UTF-8 | Java | false | false | 1,368 | java | // Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chrome.browser.gesturenav;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ListView;
import android.widget.RelativeLayout;
import org.chromium.chrome.R;
/**
* {@link View} class for navigation sheet. Provided as content view for
* {@link BottomSheet}.
*/
public class NavigationSheetView extends RelativeLayout {
private ListView mListView;
public NavigationSheetView(Context context) {
this(context, null);
}
public NavigationSheetView(Context context, AttributeSet attrs) {
super(context, attrs);
}
/**
* @return The vertical scroll offset of the list view containing the navigation history items.
*/
int getVerticalScrollOffset() {
View v = mListView.getChildAt(0);
return v == null ? 0 : -(v.getTop() - mListView.getPaddingTop());
}
/**
* Request layout for the containing listview.
*/
void requestListViewLayout() {
mListView.requestLayout();
}
@Override
public void onFinishInflate() {
super.onFinishInflate();
mListView = findViewById(R.id.navigation_entries);
}
}
| [
"stanley@moon.lan"
] | stanley@moon.lan |
d0b77da673e35fb5daddc7c0d77bc3598aa74de0 | 3369ac22183ae93633b5446c1a4555979c87a9bd | /src/main/java/ac/daffodil/controller/UniversityController.java | 9bf17c46ba1b246bc6ae55b1ffc0d719bb82b4a1 | [] | no_license | Daffodil-International-Academy/oaiHub | 876a5aa7b78c72429d74dcd3ed3a1e1cf1b1794d | 0b2d1571ea3f808bcdfa850fbe9b29d9042d819d | refs/heads/master | 2021-09-21T22:02:15.724707 | 2018-09-01T10:36:25 | 2018-09-01T10:36:25 | 126,125,870 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,998 | java | package ac.daffodil.controller;
import ac.daffodil.dao.UniversityDao;
import ac.daffodil.model.University;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.Optional;
/**
* Created by Muiduzzaman Lipu on 19-May-18.
*/
@Controller
@RequestMapping("/university")
public class UniversityController {
@Autowired
UniversityDao universityDao;
@RequestMapping(value = { "/universityPage" }, method = RequestMethod.GET)
public ModelAndView index(HttpServletRequest request) {
ModelAndView modelAndView = new ModelAndView();
modelAndView.addObject("universities", universityDao.getAll());
modelAndView.addObject("message", request.getParameter("message"));
modelAndView.addObject("newUniversity", new University());
modelAndView.setViewName("admin/adminUniversity");
return modelAndView;
}
@RequestMapping(value="/saveUniversity", method = RequestMethod.POST)
public String saveUniversity(@RequestParam("file") MultipartFile file, University newUniversity) {
ModelAndView modelAndView = new ModelAndView();
try {
newUniversity.setImage(file.getBytes());
} catch (IOException e) {
e.printStackTrace();
}
universityDao.save(newUniversity);
modelAndView.addObject("message", " Data Has Been Saved...");
return "redirect:/university/universityPage";
}
@RequestMapping(value={"/findForEditUniversity/{id}"}, method = RequestMethod.GET)
public ModelAndView findForEditUniversity(@PathVariable(required = true, name = "id") Long id) {
ModelAndView modelAndView = new ModelAndView();
Optional<University> university= universityDao.find(id);
modelAndView.addObject("newUniversity", university.get());
modelAndView.addObject("universities", universityDao.getAll());
modelAndView.setViewName("admin/adminUniversity");
return modelAndView;
}
@RequestMapping(value="/deleteUniversity/{id}", method = RequestMethod.GET)
public String deleteUniversity(@PathVariable(required = true, name = "id") Long id) {
ModelAndView modelAndView = new ModelAndView();
Optional<University> university= universityDao.find(id);
universityDao.delete(university.get());
modelAndView.addObject("message", " Data Has Been Deleted...");
return "redirect:/university/universityPage";
}
}
| [
"mzlipu16@gmail.com"
] | mzlipu16@gmail.com |
14b56206e869f12958048e00397dec5b7a251855 | ba785a15e92c92af8d6da6a5d3cf5c56b1b25b14 | /src/main/java/com/hcl/retailbank/pojo/Customer.java | 1d2fd5d87278395d32ac29b7f551321a32aa0728 | [] | no_license | krkesavareddy/final | 5d0262730ea206e3788dfbce6a145d2e9285ead3 | 848ee1e06e2c855feebbdc90b0c2efaef9173f98 | refs/heads/master | 2020-05-18T18:30:57.768014 | 2019-05-03T12:28:51 | 2019-05-03T12:28:51 | 184,587,308 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 114 | java | package com.hcl.retailbank.pojo;
import java.io.Serializable;
public class Customer implements Serializable{
}
| [
"48522802+techfreks@users.noreply.github.com"
] | 48522802+techfreks@users.noreply.github.com |
cb99dc540525c7a17ea05524b0fa42b57c4c6ec6 | d249c7acb9837fa30efe65a58f47c8efaaeddd5c | /sensorgen/src/main/java/com/example/searchservice/controller/SensorController.java | 39e387c61e5fd00fe6f7166f3fca17b692691042 | [] | no_license | lordofelectrons/CourseWorkSmartHouse | 16c81e3709d5d089176af76e155d20646eb317e1 | 4a14132905f1e791d48cb1b6d80f5f2bbd748b46 | refs/heads/main | 2023-03-08T09:07:48.651355 | 2021-02-27T16:03:41 | 2021-02-27T16:03:41 | 342,898,357 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,764 | java | package com.example.searchservice.controller;
import com.example.searchservice.client.SensorClient;
import com.example.searchservice.domain.sensor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
@RefreshScope
@RestController
public class SensorController {
@Autowired
private SensorClient sensorClient;
@GetMapping("/getall/")
public Iterable<sensor> getAllSensors() {
Iterable<sensor> sensors = sensorClient.getAllSensors();
for (sensor sens : sensors) {
boolean needSave = true;
switch (sens.getType()) {
case 1:
if (sens.getData() > sens.getRoomid().getNeedtemp()) {
sens.setData(sens.getData() - 1);
} else if (sens.getData() < sens.getRoomid().getNeedtemp()){
sens.setData(sens.getData() + 1);
} else { needSave = false; }
break;
case 2:
if (sens.getData() > sens.getRoomid().getNeedhum()) {
sens.setData(sens.getData() - 1);
} else if (sens.getData() < sens.getRoomid().getNeedhum()) {
sens.setData(sens.getData() + 1);
} else { needSave = false; }
break;
}
if(needSave) {
sensorClient.updateSensor(sens);
}
}
return sensors;
}
@GetMapping("/getby/{id}")
public Optional<sensor> getSensorById(@PathVariable(name="id") int id) {
return sensorClient.getSensorById(id);
}
@GetMapping("/getsensorsby/{id}")
public List<sensor> getSensorsByRoomId(@PathVariable(name="id") int id) {
Iterable <sensor> sensors = sensorClient.getAllSensors();
List<sensor> retSensors = new ArrayList<>();
for (sensor sens : sensors) {
if(sens.getRoomid().getRoom_id() == id) {
retSensors.add(sens);
}
}
return retSensors;
}
@PostMapping("/add")
public sensor updateSensor(@RequestBody sensor sensor) {
return sensorClient.updateSensor(sensor);
}
@GetMapping("/add/{type}/{room_id}")
public boolean createSensor(@PathVariable(name="room_id") int room_id, @PathVariable(name="type") byte type) {
return sensorClient.createSensor(room_id, type);
}
@DeleteMapping("/del/{id}")
public void deleteSensor(@PathVariable(name="id") int id) {
sensorClient.deleteSensor(id);
}
}
| [
"filart16@gmail.com"
] | filart16@gmail.com |
b14f78108c813594155ff098a3ba4de8a41a7750 | e87510538bd08b415f890bce34e7de772e7ec788 | /src/com/lesson9/Homework9TaskFor100.java | 5cdf19b16e2212aa2746c381987469f31120d650 | [] | no_license | avroman91/Homework | a39f2f482afe665787eb927d5ca1167839ee924b | 10eb0bac8d4662d7f4c7c0c8bcc40473c8fb2849 | refs/heads/main | 2023-05-23T08:54:20.468841 | 2021-05-28T05:28:45 | 2021-05-28T05:28:45 | 360,949,987 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,213 | java | package com.lesson9;
/*Задан круг с радиусом r с центром в точке (x,y).
Вернуть список точек с целочисленными координатами которые попадают в круг.*/
import java.util.ArrayList;
public class Homework9TaskFor100 {
public static void main(String[] args) {
int[] center = {0, 0};
int raduis = 5;
System.out.println(returnListOfPointsInsideOfACircle(center, raduis));
}
public static String returnListOfPointsInsideOfACircle(int[] center, int radius) {
ArrayList<String> list = new ArrayList<String>();
for (int i = center[0] - radius + 1; i < center[0] + radius; i++) {
for (int j = center[1] - radius + 1; j < center[1] + radius; j++) {
if (isInCircle(center, i, j, radius)) {
list.add("(" + i + "," + j + ")");
}
}
}
return list.toString();
}
public static boolean isInCircle(int[] center, int pointX, int pointY, int radius) {
return (pointX - center[0]) * (pointX - center[0]) + (pointY - center[1]) * (pointY - center[1]) < radius * radius;
}
}
| [
"avroman91@gmail.com"
] | avroman91@gmail.com |
1aa1d33f7fd0942e933bd2b51c5048fb48c77b83 | cd12861d7bedb820b2440efb42acf8ba1b4f5436 | /DialogDesigning/app/src/androidTest/java/com/nareshit/dialogdesigning/ApplicationTest.java | 248acb715268fbb345ee8c23f885757a49b1325e | [] | no_license | nagasaimanoj/Android-Coaching-NareshIT | 05ee2000ae48cef502599d768c62524916d1c582 | 378b221b250fdb19ccc1ff574fcaba790aaba89a | refs/heads/master | 2018-11-27T05:04:28.055030 | 2018-09-05T07:37:42 | 2018-09-05T07:37:42 | 96,038,265 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 359 | java | package com.nareshit.dialogdesigning;
import android.app.Application;
import android.test.ApplicationTestCase;
/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
} | [
"nagasai.g9@gmail.com"
] | nagasai.g9@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.