blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 4 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2 values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 689M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 131 values | src_encoding stringclasses 34 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 3 9.45M | extension stringclasses 32 values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 313 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1cf025a2092312c53f09706c1c60d35507a0e2f3 | cdc9d6f7024d935627df4b520080646bbe4c5c45 | /BoardGameEditor/src/main/java/at/tugraz/eegs/bge/business/x3d/VolumeEmitter.java | 059c284b4b539ee7a3f37234a2326da72089d345 | [] | no_license | sd-f/duschkopf | 56b70c15b4b6957de1e8bbcb49db4510825957ec | 33455550ebef3bdd5b70c3b2f434b233f0c2c9e7 | refs/heads/master | 2020-04-09T16:42:11.372443 | 2014-07-02T17:11:39 | 2014-07-02T17:11:39 | 20,030,032 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,724 | java | //
// Diese Datei wurde mit der JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7 generiert
// Siehe <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Änderungen an dieser Datei gehen bei einer Neukompilierung des Quellschemas verloren.
// Generiert: 2014.05.29 um 11:56:32 PM CEST
//
package at.tugraz.eegs.bge.business.x3d;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java-Klasse für anonymous complex type.
*
* <p>Das folgende Schemafragment gibt den erwarteten Content an, der in dieser Klasse enthalten ist.
*
* <pre>
* <complexType>
* <complexContent>
* <extension base="{}X3DParticleEmitterNode">
* <choice minOccurs="0">
* <element ref="{}Coordinate"/>
* <element ref="{}CoordinateDouble"/>
* <element ref="{}ProtoInstance"/>
* </choice>
* <attribute name="coordIndex" type="{}MFInt32" default="-1" />
* <attribute name="direction" type="{}SFVec3f" default="0 1 0" />
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"coordinate",
"coordinateDouble",
"protoInstance"
})
@XmlRootElement(name = "VolumeEmitter")
public class VolumeEmitter
extends X3DParticleEmitterNode
{
@XmlElement(name = "Coordinate")
protected Coordinate coordinate;
@XmlElement(name = "CoordinateDouble")
protected CoordinateDouble coordinateDouble;
@XmlElement(name = "ProtoInstance")
protected ProtoInstance protoInstance;
@XmlAttribute(name = "coordIndex")
protected String coordIndex;
@XmlAttribute(name = "direction")
protected String direction;
/**
* Ruft den Wert der coordinate-Eigenschaft ab.
*
* @return
* possible object is
* {@link Coordinate }
*
*/
public Coordinate getCoordinate() {
return coordinate;
}
/**
* Legt den Wert der coordinate-Eigenschaft fest.
*
* @param value
* allowed object is
* {@link Coordinate }
*
*/
public void setCoordinate(Coordinate value) {
this.coordinate = value;
}
/**
* Ruft den Wert der coordinateDouble-Eigenschaft ab.
*
* @return
* possible object is
* {@link CoordinateDouble }
*
*/
public CoordinateDouble getCoordinateDouble() {
return coordinateDouble;
}
/**
* Legt den Wert der coordinateDouble-Eigenschaft fest.
*
* @param value
* allowed object is
* {@link CoordinateDouble }
*
*/
public void setCoordinateDouble(CoordinateDouble value) {
this.coordinateDouble = value;
}
/**
* Appropriately typed substitute node
*
* @return
* possible object is
* {@link ProtoInstance }
*
*/
public ProtoInstance getProtoInstance() {
return protoInstance;
}
/**
* Legt den Wert der protoInstance-Eigenschaft fest.
*
* @param value
* allowed object is
* {@link ProtoInstance }
*
*/
public void setProtoInstance(ProtoInstance value) {
this.protoInstance = value;
}
/**
* Ruft den Wert der coordIndex-Eigenschaft ab.
*
* @return
* possible object is
* {@link String }
*
*/
public String getCoordIndex() {
if (coordIndex == null) {
return "-1";
} else {
return coordIndex;
}
}
/**
* Legt den Wert der coordIndex-Eigenschaft fest.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setCoordIndex(String value) {
this.coordIndex = value;
}
/**
* Ruft den Wert der direction-Eigenschaft ab.
*
* @return
* possible object is
* {@link String }
*
*/
public String getDirection() {
if (direction == null) {
return "0 1 0";
} else {
return direction;
}
}
/**
* Legt den Wert der direction-Eigenschaft fest.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setDirection(String value) {
this.direction = value;
}
}
| [
"lreeh@tugraz.at"
] | lreeh@tugraz.at |
b605fa851ca4b9db5aad140187918e49fc81a3fe | ee5207436a3362bdb791727c73a3189dfa868ed8 | /src/test/org/dgpf/gcd/lgp/GCDLGPVMFactory.java | 46de22bef883c878c4f16b626fbcb9c6188b096e | [] | no_license | GIPSY-dev/WSC-Gen | 7f1c387b47470f277e27e7994fbf6e4f942fddf6 | 25beebdda5c1a4a0e4c213fa97155e2b3455da87 | refs/heads/master | 2020-04-06T04:20:49.760697 | 2018-03-13T16:30:34 | 2018-03-13T19:11:48 | 82,968,360 | 1 | 2 | null | 2018-04-23T17:06:51 | 2017-02-23T20:27:06 | Java | UTF-8 | Java | false | false | 2,677 | java | /*
* Copyright (c) 2007 Thomas Weise for sigoa
* Simple Interface for Global Optimization Algorithms
* http://www.sigoa.org/
*
* E-Mail : info@sigoa.org
* Creation Date : 2007-11-18
* Creator : Thomas Weise
* Original Filename: test.org.dgpf.gcd.lgp.GCDLGPVMFactory.java
* Last modification: 2007-11-18
* by: Thomas Weise
*
* License : GNU LESSER GENERAL PUBLIC LICENSE
* Version 2.1, February 1999
* You should have received a copy of this license along
* with this library; if not, write to theFree Software
* Foundation, Inc. 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA or download the license
* under http://www.gnu.org/licenses/lgpl.html or
* http://www.gnu.org/copyleft/lesser.html.
*
* Warranty : This software is provided "as is" without any
* warranty; without even the implied warranty of
* merchantability or fitness for a particular purpose.
* See the Gnu Lesser General Public License for more
* details.
*/
package test.org.dgpf.gcd.lgp;
import org.dgpf.lgp.base.LGPMemory;
import org.dgpf.lgp.base.LGPProgram;
import org.dgpf.lgp.single.LGPParameters;
import org.dgpf.lgp.single.LGPVM;
import org.dgpf.vm.base.IHostedVirtualMachineFactory;
import org.dgpf.vm.base.VirtualMachineParameters;
/**
* The vm factory for linear genetic programming of the gcd problem
*
* @author Thomas Weise
*/
public class GCDLGPVMFactory
implements
IHostedVirtualMachineFactory<LGPMemory, LGPProgram, GCDLGPVMProvider, LGPVM<GCDLGPVMProvider>> {
/**
* The serial version uid.
*/
private static final long serialVersionUID = 1;
/**
* the common shared instance of this factory
*/
public static final IHostedVirtualMachineFactory<LGPMemory, LGPProgram, GCDLGPVMProvider, LGPVM<GCDLGPVMProvider>> FACTORY = new GCDLGPVMFactory();
/**
* Create a new virtual machine with the given parameters.
*
* @param parameters
* the parameters used for virtual machine creation
* @param host
* the host of the virtual machine
* @return the new virtual machine
*/
@SuppressWarnings("unchecked")
public LGPVM<GCDLGPVMProvider> createVirtualMachine(
final VirtualMachineParameters<LGPMemory> parameters,
final GCDLGPVMProvider host) {
return (new GCDLGPVM((LGPParameters) parameters, host));
}
}
| [
"happy.hacking.geek@gmail.com"
] | happy.hacking.geek@gmail.com |
f92e1f8b9f51fb35377c04771dcb5a35ac515d84 | c4bd2b367ac24f001c9d5c5a8e3d48b2f1933008 | /SpringFramework/SpringBoot/SecureExample/src/test/java/com/example/SecureExample/SecureExampleApplicationTests.java | b30a496d6a463cf1fb5037c869c376f93b86b346 | [] | no_license | SohanChougule/Java_Cuelogic | 58bab045aa84268e7ff84cd235141c453ad5f77e | 19afaab06cc1266d425115a9ae067bffa0a5931e | refs/heads/main | 2023-07-15T20:46:53.694668 | 2021-08-25T09:44:04 | 2021-08-25T09:44:04 | 378,888,788 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 224 | java | package com.example.SecureExample;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class SecureExampleApplicationTests {
@Test
void contextLoads() {
}
}
| [
"sohan.chougule@cuelogic.com"
] | sohan.chougule@cuelogic.com |
6d3fb4618a275f4082389014b1efa93a6dbb66b4 | 3b95fd9400595ff63ba8b3285990e106f48f98e3 | /src/Prooving/ProofCheckers/Rewriter/ExpressionRewriters/ExpressionRewriter.java | 6e2dcb10cc4cfc960120b10955ce06f46b2fa31e | [] | no_license | marsermd/MathLogic | af40d44f5fabc09d5c9627144c62b16929befc95 | ac5b5f84faf9324aed178c45934cb5c16ae385fb | refs/heads/master | 2021-01-11T20:13:11.810133 | 2018-02-22T21:55:27 | 2018-02-22T21:55:27 | 79,068,038 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,178 | java | package Prooving.ProofCheckers.Rewriter.ExpressionRewriters;
import Prooving.ExpressionCheckers.ExpressionCheckResult;
import Prooving.ExpressionCheckers.ExpressionChecker;
import Prooving.ProofCheckers.Rewriter.RewriterProofResult;
import sun.plugin.dom.exception.InvalidStateException;
/**
* Created by marsermd on 05.02.2017.
*/
public abstract class ExpressionRewriter<ExpressionCheckResultT extends ExpressionCheckResult>
{
public boolean tryRewriteExpression(ExpressionChecker lineChecker, ExpressionCheckResult lineResult, RewriterProofResult result)
{
if (isApplicable(lineResult))
{
if (lineResult.isWrong())
{
throw new InvalidStateException("truing to rewrite wrong result!");
}
rewriteExpression(lineChecker,(ExpressionCheckResultT) lineResult, result);
return true;
}
return false;
}
protected abstract boolean isApplicable(ExpressionCheckResult lineResult);
protected abstract void rewriteExpression(ExpressionChecker lineChecker, ExpressionCheckResultT lineResult, RewriterProofResult result);
}
| [
"mischapanin@gmail.com"
] | mischapanin@gmail.com |
f6bd8553b4f01670b9eba82a01bee84a4a93e4d2 | 5e4100a6611443d0eaa8774a4436b890cfc79096 | /src/main/java/com/alipay/api/response/AlipayCommerceIotDapplyOrderCancelResponse.java | d29aad5337a11bb26f0c58127534a2e7e08f3a79 | [
"Apache-2.0"
] | permissive | coderJL/alipay-sdk-java-all | 3b471c5824338e177df6bbe73ba11fde8bc51a01 | 4f4ed34aaf5a320a53a091221e1832f1fe3c3a87 | refs/heads/master | 2020-07-15T22:57:13.705730 | 2019-08-14T10:37:41 | 2019-08-14T10:37:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 735 | java | package com.alipay.api.response;
import com.alipay.api.internal.mapping.ApiField;
import com.alipay.api.AlipayResponse;
/**
* ALIPAY API: alipay.commerce.iot.dapply.order.cancel response.
*
* @author auto create
* @since 1.0, 2019-06-14 14:08:11
*/
public class AlipayCommerceIotDapplyOrderCancelResponse extends AlipayResponse {
private static final long serialVersionUID = 8612328199126946166L;
/**
* 物料申请单号
*/
@ApiField("asset_apply_order_id")
private String assetApplyOrderId;
public void setAssetApplyOrderId(String assetApplyOrderId) {
this.assetApplyOrderId = assetApplyOrderId;
}
public String getAssetApplyOrderId( ) {
return this.assetApplyOrderId;
}
}
| [
"ben.zy@antfin.com"
] | ben.zy@antfin.com |
e73b5ce0b3cdf0fc6f1d8e94dfa61d82f485181f | 8d7d9378592f66e104d49f9d5677fa17bb770550 | /UserInterface3/src/src/AdminSachbearbeiterLoeschenAAS.java | 64c11dc005522e155cd73f2f3a3b2aa64af6215c | [] | no_license | Seakuh/SachbearbeiterVerwaltungBeans | 1cb7f8e804b86950676cbf12174eeb38f7771a39 | 3e87a5d3e89a8f4d58dd4b7495369919c676cf70 | refs/heads/master | 2020-12-28T02:43:50.607172 | 2020-02-04T13:01:54 | 2020-02-04T13:01:54 | 238,156,056 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 367 | java | package src;
import javax.faces.bean.ManagedBean;
@ManagedBean
public class AdminSachbearbeiterLoeschenAAS {
AdminSachbearbeiterLoeschenK kontrolle = new AdminSachbearbeiterLoeschenK();
public String start() {
kontrolle.loescheSachbearbeiter(SachbearbeiterAuswahl.selectedSachbearbeiter);
SachbearbeiterAuswahl.neueListe();
return "/AdminAS.xhtml";
}
}
| [
"eteranimal@protonmail.com"
] | eteranimal@protonmail.com |
0cc8654687adb7630e31e04471af924bdd22f9a1 | eda3fc1416bc4b976258ee31f04952e3e710ad1e | /TeamCode/src/main/java/org/firstinspires/ftc/teamcode/TeleOp/DriveModeMecanum.java | 07b2101697dea950f0da2bc70a8c411616b58708 | [
"BSD-3-Clause"
] | permissive | VivenPuthenpurayil/RidgeRoboticsV6 | d074ac05ed0e4d5bd8a769c65ea42a9d4d3ebab3 | 18007c0acf6f592a89977d69c514105409608be3 | refs/heads/master | 2023-08-25T19:52:49.962503 | 2021-11-10T01:51:00 | 2021-11-10T01:51:00 | 105,715,026 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,725 | java | package org.firstinspires.ftc.teamcode.TeleOp;
import com.qualcomm.robotcore.eventloop.opmode.TeleOp;
import com.qualcomm.robotcore.util.Range;
import org.firstinspires.ftc.teamcode.Functions;
/**
* Created by arulgupta on 10/22/17.
*/
@TeleOp(name="TeleOp", group = "Main")
public class DriveModeMecanum extends Functions{
@Override
public void runOpMode() throws InterruptedException {
Setup(setupType.teleop);
waitForStart();
while (opModeIsActive()) {
// throttle: left_stick_y ranges from -1 to 1, where -1 is full up, and 1 is full down
// direction: left_stick_x ranges from -1 to 1, where -1 is full left and 1 is full right
float fb = -gamepad1.left_stick_y;
float rl = gamepad1.left_stick_x;
float y2 = -gamepad1.right_stick_y;
float x2 = gamepad1.right_stick_x;
boolean rs = gamepad1.right_stick_button;
boolean ls = gamepad1.left_stick_button;
boolean bPrevState = false;
boolean bCurrState = false;
boolean x = true;
int s = 1;
double p = Math.sqrt((y2*y2) + (x2*x2));
// clip the right/left values so that the values never exceed +/- 1
int count = 0;
int counter = 0;
int counts = 0;
int counte = 0;
fb = Range.clip(fb, -1, 1);
rl = Range.clip(rl, -1, 1);
y2 = Range.clip(y2, -1, 1);
x2 = Range.clip(x2, -1, 1);
double rotationSpeed = 0.4;
// write the values to the motors
bCurrState = gamepad1.right_bumper;
// check for button state transitions.
if ((bCurrState == true) && (bCurrState != bPrevState)) {
// button is transitioning to a pressed state. So Toggle LED
x = !x;
}
// update previous state variable.
bPrevState = bCurrState;
if(x) {
if (fb > rl && fb > -rl && fb > 0.1 & !ls) {
//Forward
driveTrainMovement(fb, movements.forward);
} else if (fb < rl && fb < -rl && fb < -0.1 & !ls) {
//Backward
driveTrainMovement(fb, movements.backward);
} else if (fb > rl && fb < -rl && rl < -0.1 & !ls) {
//Left
driveTrainMovement(rl, movements.left);
} else if (fb < rl && fb > -rl && rl > 0.1 & !ls) {
//Right
driveTrainMovement(rl, movements.right);
} else if (gamepad1.left_stick_button) {
//Spin CCW
driveTrainMovement(rotationSpeed, movements.ccw);
} else if (gamepad1.right_stick_button) {
//Spin CW
driveTrainMovement(rotationSpeed, movements.cw);
} else if (y2 > 0.1 && x2 > 0.1 & !rs) {
//DIAGONAL TR
driveTrainMovement(rotationSpeed, movements.tr);
} else if (y2 > 0.1 && x2 < -0.1 & !rs) {
//DIAGONAL TL
driveTrainMovement(rotationSpeed, movements.tl);
} else if (y2 < -0.1 && x2 > 0.1 & !rs) {
//DIAGONAL BR
driveTrainMovement(rotationSpeed, movements.br);
} else if (y2 < -0.1 && x2 < -0.1 & !rs) {
//DIAGONAL BL
driveTrainMovement(rotationSpeed, movements.bl);
}else if(gamepad1.dpad_up){
driveTrainMovement(0.5, movements.backward);
}else if(gamepad1.dpad_down){
driveTrainMovement(0.5, movements.forward);
}else if(gamepad1.dpad_left){
driveTrainMovement(0.5, movements.right);
}else if(gamepad1.dpad_right){
driveTrainMovement(0.5, movements.left);
}else {
stopDrivetrain(drivetrain);
}
}
else {
if (fb > rl && fb > -rl && fb > 0.1 & !ls) {
//Forward
driveTrainMovement(0.2, movements.forward);
} else if (fb < rl && fb < -rl && fb < -0.1 & !ls) {
//Backward
driveTrainMovement(0.2, movements.backward);
} else if (fb > rl && fb < -rl && rl < -0.1 & !ls) {
//Left
driveTrainMovement(0.2, movements.left);
} else if (fb < rl && fb > -rl && rl > 0.1 & !ls) {
//Right
driveTrainMovement(0.2, movements.right);
}else if(gamepad1.dpad_up){
driveTrainMovement(0.2, movements.backward);
}else if(gamepad1.dpad_down){
driveTrainMovement(0.2, movements.forward);
}else if(gamepad1.dpad_left){
driveTrainMovement(0.2, movements.right);
}else if(gamepad1.dpad_right){
driveTrainMovement(0.2, movements.left);
}
else if (gamepad1.left_stick_button) {
//Spin CCW
driveTrainMovement(0.2, movements.ccw);
} else if (gamepad1.right_stick_button) {
//Spin CW
driveTrainMovement(0.2, movements.cw);
} else if (y2 > 0.1 && x2 > 0.1 & !rs) {
//DIAGONAL TR
driveTrainMovement(0.2, movements.tr);
} else if (y2 > 0.1 && x2 < -0.1 & !rs) {
//DIAGONAL TL
driveTrainMovement(0.2, movements.tl);
} else if (y2 < -0.1 && x2 > 0.1 & !rs) {
//DIAGONAL BR
driveTrainMovement(0.2, movements.br);
} else if (y2 < -0.1 && x2 < -0.1 & !rs) {
//DIAGONAL BL
driveTrainMovement(0.2, movements.bl);
} else {
stopDrivetrain(drivetrain);
}
}
telemetry.addData("CRAWL MODE: ", gamepad1.right_bumper);
telemetry.update();
//--------------------- ----------------------------------------------
//Collection Control/*
/*
if(gamepad2.right_bumper && count == 0){
relicArm.setPower(0.2) ;
count = 1;
}
else if(!gamepad2.right_bumper && gamepad2.left_bumper){
relicArm.setPower(-0.2);
count = 0;
}
else if(!gamepad2.right_bumper & !gamepad2.left_bumper){
relicArm.setPower(0);
count = 0;
}
else{
count = 1;
}
count = 1;*/
//--------------------------------------------------------------------------
//Flicker Control
/*if(gamepad2.y && counter == 0){
relicWrist.setPosition(0.8);
counter = 1;
}
else if(!gamepad2.y && gamepad2.a){
relicWrist.setPosition(-0.2);
counter = 0;
}
else if(!gamepad2.y & !gamepad2.a){
relicWrist.setPosition(0);
counter = 0;
}
else{
counter = 1;
}
counter = 1;
*/
/*if(gamepad2.x && counts == 0){
relicClaw.setPosition(0.8);
counts = 1;
}
else if(!gamepad2.x && gamepad2.b){
relicClaw.setPosition(-0.2);
counts = 0;
}
else if(!gamepad2.x & !gamepad2.b){
relicClaw.setPosition(0);
counts = 0;
}
else{
counts = 1;
}
counts = 1;
*/
//
if(gamepad2.y && count == 0){
rightTread.setPower(0.2);
leftTread.setPower(-0.2);
counts = 1;
}
else if(!gamepad2.y && gamepad2.a){
rightTread.setPower(-0.2);
leftTread.setPower(0.2);
counts = 0;
}
else if(!gamepad2.y & !gamepad2.a){
rightTread.setPower(0);
leftTread.setPower(0);
counts = 0;
}
else{
counts = 1;
}
counts = 1;
if(gamepad2.x && count == 0){
pivot.setPower(0.2) ;
count = 1;
}
else if(!gamepad2.x && gamepad2.b){
pivot.setPower(-0.2);
count = 0;
}
else if(!gamepad2.x & !gamepad2.b){
pivot.setPower(0);
count = 0;
}
else{
count = 1;
}
count = 1;
///
//-------------------------------------------------------------------
telemetry.addData("Text", "DriveMode");
telemetry.addData("fb: ", fb);
telemetry.addData("rl: ", rl);
telemetry.addData("FR motor", motorFR.getPower());
telemetry.addData("FL motor", motorFL.getPower());
telemetry.addData("BR motor", motorBR.getPower());
telemetry.addData("BL motor", motorBL.getPower());
waitOneFullHardwareCycle();
}
}
}
| [
"arul18.gupta@gmail.com"
] | arul18.gupta@gmail.com |
52a6cbd6819e43af9b337c1d342f42bea96203d6 | 4ea35437465920c4b499a1f637e527e09e106611 | /SoapWebServices/PersonInfoApp/src/com/rishabkumar/RishabKumarService.java | 6221ecd404948f5881f20fdc7d42b177d4ae054b | [] | no_license | rkmr039/SpringHibernateMVC-Projects | 8f081a9743d85b2741b45339681c06f0d74dbcf3 | 9aab8839887f92a4a809f9e2d76a23b8b0c8c57b | refs/heads/master | 2022-12-22T13:44:21.443152 | 2019-10-24T13:37:22 | 2019-10-24T13:37:22 | 207,789,090 | 0 | 1 | null | 2022-12-16T07:46:43 | 2019-09-11T10:52:05 | JavaScript | UTF-8 | Java | false | false | 519 | java | /**
* RishabKumarService.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
*/
package com.rishabkumar;
public interface RishabKumarService extends javax.xml.rpc.Service {
public java.lang.String getRishabKumarAddress();
public com.rishabkumar.RishabKumar getRishabKumar() throws javax.xml.rpc.ServiceException;
public com.rishabkumar.RishabKumar getRishabKumar(java.net.URL portAddress) throws javax.xml.rpc.ServiceException;
}
| [
"rkmr039@gmail.com"
] | rkmr039@gmail.com |
f294c8890fddca67ca7503a9d110a1e6ea49137b | d2c8c49484e4b79d0c099d8f8c82834ebb27625d | /SpringMVC01/src/main/java/kr/bit/myapp/HomeController.java | 743d40c3344a0ea1d1b0454ddceee55f2aff81e9 | [] | no_license | SonMyungjin/MVC | df642c5a302cb24bb7063acb87fc165b39160bc5 | f083fb45961c33804e8f0d4b363ce4c6c188ce54 | refs/heads/main | 2023-08-12T17:00:51.979516 | 2021-10-10T08:27:20 | 2021-10-10T08:27:20 | 410,786,779 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,074 | java | package kr.bit.myapp;
import java.text.DateFormat;
import java.util.Date;
import java.util.Locale;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
/**
* Handles requests for the application home page.
*/
@Controller
public class HomeController {
private static final Logger logger = LoggerFactory.getLogger(HomeController.class);
/**
* Simply selects the home view to render by returning its name.
*/
@RequestMapping(value = "/", method = RequestMethod.GET)
public String home(Locale locale, Model model) {
logger.info("Welcome home! The client locale is {}.", locale);
Date date = new Date();
DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, locale);
String formattedDate = dateFormat.format(date);
model.addAttribute("serverTime", formattedDate );
return "home";
}
}
| [
"shonmyungjin@naver.com"
] | shonmyungjin@naver.com |
2ec69baf4a3a278df2bc4d79f8b52c90a9d6c47b | 19615472fa101e3abac54b9bc79f74132e0d3a2a | /app/src/main/java/com/raincat/dolby_beta/hook/HideBannerHook.java | c225ffc0636244456506f3a687baef4e3f11c723 | [
"MIT"
] | permissive | lwgh6/dolby_beta | d4031baae0da8ce5c1fc39183803ae7222b31781 | 961572df87d6f85f9fd92164b415c282534f2d5e | refs/heads/master | 2023-09-06T01:08:56.508035 | 2021-11-22T15:36:29 | 2021-11-22T15:36:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,525 | java | package com.raincat.dolby_beta.hook;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import com.raincat.dolby_beta.helper.SettingHelper;
import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.XposedHelpers;
/**
* <pre>
* author : RainCat
* e-mail : nining377@gmail.com
* time : 2021/10/23
* desc : 移除Banner
* version: 1.0
* </pre>
*/
public class HideBannerHook {
private String mainBannerContainerClassString = "com.netease.cloudmusic.ui.MainBannerContainer";
public HideBannerHook(Context context, final int versionCode) {
if (!SettingHelper.getInstance().isEnable(SettingHelper.beauty_banner_hide_key))
return;
if (versionCode < 138)
mainBannerContainerClassString = "com.netease.cloudmusic.ui.NeteaseMusicViewFlipper";
if (XposedHelpers.findClassIfExists(mainBannerContainerClassString, context.getClassLoader()) != null)
XposedHelpers.findAndHookMethod(mainBannerContainerClassString, context.getClassLoader(), "onAttachedToWindow", new XC_MethodHook() {
@Override
protected void beforeHookedMethod(MethodHookParam param) {
View view = (View) param.thisObject;
ViewGroup.LayoutParams layoutParams = view.getLayoutParams();
layoutParams.height = 1;//改成0将导致无法下滑刷新
view.setLayoutParams(layoutParams);
view.setVisibility(View.GONE);
}
});
String playlistBannerContainerClassString = "com.netease.cloudmusic.ui.PlaylistBanner";
if (XposedHelpers.findClassIfExists(playlistBannerContainerClassString, context.getClassLoader()) != null)
XposedHelpers.findAndHookConstructor(playlistBannerContainerClassString, context.getClassLoader(), Context.class, AttributeSet.class, new XC_MethodHook() {
@Override
protected void beforeHookedMethod(MethodHookParam param) {
final View view = (View) param.thisObject;
view.post(() -> {
ViewGroup.LayoutParams layoutParams = view.getLayoutParams();
layoutParams.height = 0;
view.setLayoutParams(layoutParams);
view.setVisibility(View.GONE);
});
}
});
}
}
| [
"nining377@gmail.com"
] | nining377@gmail.com |
717e5da88e7ad7ddb95df5b4e4a8e4eb83c5acb4 | d7fe2596a70f915e35fb6f8dc4fbc080eb1390c5 | /src/main/java/org/elasticsearch/search/facet/datehistogram/InternalDateHistogramFacet.java | 0e5287e59bf2f369dea0422ea4f68093672e512b | [
"Apache-2.0"
] | permissive | Oneiroi/elasticsearch | 009f93d477ef75e196674edcb5bdc755b254c7b0 | d66f401ce6b0ac6baa0d461f12ca3d002407b49d | refs/heads/master | 2022-09-13T12:51:35.270084 | 2012-06-18T20:45:17 | 2012-06-19T02:13:47 | 4,712,532 | 0 | 0 | Apache-2.0 | 2022-09-09T18:17:56 | 2012-06-19T10:58:24 | Java | UTF-8 | Java | false | false | 1,329 | java | /*
* Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.elasticsearch.search.facet.datehistogram;
import org.elasticsearch.search.facet.Facet;
import org.elasticsearch.search.facet.InternalFacet;
import java.util.List;
/**
*
*/
public abstract class InternalDateHistogramFacet implements DateHistogramFacet, InternalFacet {
public static void registerStreams() {
InternalCountDateHistogramFacet.registerStreams();
InternalFullDateHistogramFacet.registerStreams();
}
public abstract Facet reduce(String name, List<Facet> facets);
}
| [
"kimchy@gmail.com"
] | kimchy@gmail.com |
26ea8c9111b3ab32c71b9317c948156a24d453d1 | f525deacb5c97e139ae2d73a4c1304affb7ea197 | /gitv-DeObfuscate/src/main/java/com/alibaba/fastjson/parser/ParseContext.java | 87f52429979e601f0a93f36c0dee2d014ad1e236 | [] | no_license | AgnitumuS/gitv | 93b2359e1bf9f2b6c945298c61c5c6dbfeea49b3 | 242c9a10a0aeb41b9589de9f254e6ce9f57bd77a | refs/heads/master | 2021-08-08T00:50:10.630301 | 2017-11-09T08:10:33 | 2017-11-09T08:10:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 795 | java | package com.alibaba.fastjson.parser;
import com.gala.video.app.epg.ui.albumlist.utils.AlbumEnterFactory;
import java.lang.reflect.Type;
public class ParseContext {
public final Object fieldName;
public Object object;
public final ParseContext parent;
public Type type;
public ParseContext(ParseContext parent, Object object, Object fieldName) {
this.parent = parent;
this.object = object;
this.fieldName = fieldName;
}
public String toString() {
if (this.parent == null) {
return "$";
}
if (this.fieldName instanceof Integer) {
return this.parent.toString() + "[" + this.fieldName + AlbumEnterFactory.SIGN_STR;
}
return this.parent.toString() + "." + this.fieldName;
}
}
| [
"liuwencai@le.com"
] | liuwencai@le.com |
ca1865ea814a9b7b776c1c013d3e4b3095bc0932 | e3d1b8bca684487e4a5ef5f2b6f5335a5a9b0170 | /src/com/poplar/flyweight/WebSite.java | d173c75664e132a822faa73ffadcddb6bc7d7be2 | [] | no_license | youjinlong-wyn/design_pattern | e9420d7fcf0f49a9cd57430e6a6bdd1c3aeca762 | c7832665de8953859713c8f22722de15cd231db9 | refs/heads/master | 2022-12-10T03:00:28.820438 | 2020-09-22T06:36:53 | 2020-09-22T06:36:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 155 | java | package com.poplar.flyweight;
/**
* Created By poplar on 2019/9/14
* 网站抽象类
*/
public interface WebSite {
public void use(User user);
}
| [
"poplar@qq.com"
] | poplar@qq.com |
f2bf445d703c141831591d667a4707cae03cdf3d | aaabffe8bf55973bfb1390cf7635fd00ca8ca945 | /src/main/java/com/microsoft/graph/requests/generated/BaseWorkbookFunctionsRoundDownRequestBuilder.java | 635692390f4ec36be1c01fd77a16dd36131c9d2a | [
"MIT"
] | permissive | rgrebski/msgraph-sdk-java | e595e17db01c44b9c39d74d26cd925b0b0dfe863 | 759d5a81eb5eeda12d3ed1223deeafd108d7b818 | refs/heads/master | 2020-03-20T19:41:06.630857 | 2018-03-16T17:31:43 | 2018-03-16T17:31:43 | 137,648,798 | 0 | 0 | null | 2018-06-17T11:07:06 | 2018-06-17T11:07:05 | null | UTF-8 | Java | false | false | 2,854 | java | // ------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
// ------------------------------------------------------------------------------
package com.microsoft.graph.requests.generated;
import com.microsoft.graph.concurrency.*;
import com.microsoft.graph.core.*;
import com.microsoft.graph.models.extensions.*;
import com.microsoft.graph.models.generated.*;
import com.microsoft.graph.http.*;
import com.microsoft.graph.requests.extensions.*;
import com.microsoft.graph.requests.generated.*;
import com.microsoft.graph.options.*;
import com.microsoft.graph.serializer.*;
import java.util.Arrays;
import java.util.EnumSet;
// **NOTE** This file was generated by a tool and any changes will be overwritten.
/**
* The class for the Base Workbook Functions Round Down Request Builder.
*/
public class BaseWorkbookFunctionsRoundDownRequestBuilder extends BaseActionRequestBuilder {
/**
* The request builder for this WorkbookFunctionsRoundDown
*
* @param requestUrl the request URL
* @param client the service client
* @param requestOptions the options for this request
* @param number the number
* @param numDigits the numDigits
*/
public BaseWorkbookFunctionsRoundDownRequestBuilder(final String requestUrl, final IBaseClient client, final java.util.List<? extends Option> requestOptions, final com.google.gson.JsonElement number, final com.google.gson.JsonElement numDigits) {
super(requestUrl, client, requestOptions);
bodyParams.put("number", number);
bodyParams.put("numDigits", numDigits);
}
/**
* Creates the IWorkbookFunctionsRoundDownRequest
*
* @return the IWorkbookFunctionsRoundDownRequest instance
*/
public IWorkbookFunctionsRoundDownRequest buildRequest() {
return buildRequest(getOptions());
}
/**
* Creates the IWorkbookFunctionsRoundDownRequest with specific requestOptions instead of the existing requestOptions
*
* @param requestOptions the options for the request
* @return the IWorkbookFunctionsRoundDownRequest instance
*/
public IWorkbookFunctionsRoundDownRequest buildRequest(final java.util.List<? extends Option> requestOptions) {
WorkbookFunctionsRoundDownRequest request = new WorkbookFunctionsRoundDownRequest(
getRequestUrl(),
getClient(),
requestOptions
);
if (hasParameter("number")) {
request.body.number = getParameter("number");
}
if (hasParameter("numDigits")) {
request.body.numDigits = getParameter("numDigits");
}
return request;
}
}
| [
"caitbal@microsoft.com"
] | caitbal@microsoft.com |
53682ca7e75449c464a86ae5cc996db282adc8ea | ab950cdc8e59165e341c838053c4811caf30eec8 | /jOOQ/src/main/java/org/jooq/MergeKeyStep8.java | 9cbcc4cb632d0c7b71917ee4674c21610669e636 | [
"Apache-2.0"
] | permissive | cdalexndr/jOOQ | 12e408df7d9ce9393f506120d5d69a8154f4419c | b91e9235b30d07db4091583e30e21198f5d919c7 | refs/heads/main | 2023-08-12T12:57:52.911066 | 2021-09-29T15:59:01 | 2021-09-29T15:59:01 | 411,799,887 | 0 | 0 | NOASSERTION | 2021-09-29T19:12:38 | 2021-09-29T19:12:37 | null | UTF-8 | Java | false | false | 2,904 | java | /*
* 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.
*
* Other licenses:
* -----------------------------------------------------------------------------
* Commercial licenses for this work are available. These replace the above
* ASL 2.0 and offer limited warranties, support, maintenance, and commercial
* database integrations.
*
* For more information, please visit: http://www.jooq.org/licenses
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package org.jooq;
import static org.jooq.SQLDialect.*;
import java.util.Collection;
import org.jetbrains.annotations.NotNull;
/**
* This type is used for the H2-specific variant of the {@link Merge}'s DSL API.
* <p>
* Example: <code><pre>
* DSLContext create = DSL.using(configuration);
*
* create.mergeInto(table, field1, field2, field3, .., field7, field8)
* .key(id)
* .values(value1, value2, value3, .., value7, value8)
* .execute();
* </pre></code>
*
* @author Lukas Eder
* @deprecated - [#10045] - 3.14.0 - Use the standard SQL MERGE API instead, via {@link DSLContext#mergeInto(Table)}
*/
@Deprecated(forRemoval = true, since = "3.14")
public interface MergeKeyStep8<R extends Record, T1, T2, T3, T4, T5, T6, T7, T8> extends MergeValuesStep8<R, T1, T2, T3, T4, T5, T6, T7, T8> {
/**
* Specify an optional <code>KEY</code> clause.
* <p>
* Use this optional clause in order to override using the underlying
* <code>PRIMARY KEY</code>.
*
* @deprecated - [#10045] - 3.14.0 - Use the standard SQL MERGE API instead, via {@link DSLContext#mergeInto(Table)}
*/
@Deprecated(forRemoval = true, since = "3.14")
@NotNull @CheckReturnValue
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, POSTGRES, YUGABYTE })
MergeValuesStep8<R, T1, T2, T3, T4, T5, T6, T7, T8> key(Field<?>... keys);
/**
* Specify an optional <code>KEY</code> clause.
* <p>
* Use this optional clause in order to override using the underlying
* <code>PRIMARY KEY</code>.
*
* @deprecated - [#10045] - 3.14.0 - Use the standard SQL MERGE API instead, via {@link DSLContext#mergeInto(Table)}
*/
@Deprecated(forRemoval = true, since = "3.14")
@NotNull @CheckReturnValue
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, POSTGRES, YUGABYTE })
MergeValuesStep8<R, T1, T2, T3, T4, T5, T6, T7, T8> key(Collection<? extends Field<?>> keys);
}
| [
"lukas.eder@gmail.com"
] | lukas.eder@gmail.com |
c3515446cd9d8e91a35fabc365f016d3b46eaae1 | 208ef5ce7292de09da1c9c85caf2c8e06846859f | /Stacks/src/StackUsingLL.java | 149eab821ec8f7b5f8a019bb4784a9ed2f90dc5b | [] | no_license | sahilshirodkar1630/JavaCodingNinjas | 4ba019a23a7d370e644b3ea125d335191f331e66 | 01118782c3199d2014adb0f297b334873b15e751 | refs/heads/master | 2023-05-01T21:19:17.740428 | 2021-05-24T20:10:19 | 2021-05-24T20:10:19 | 340,377,827 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 532 | java |
public class StackUsingLL<T> {
private Node<T> head;
private int size;
public int size() {
return size;
}
public boolean isEmpty() {
return(head==null);
}
public T top() throws StackEmptyException {
if(head==null) {
StackEmptyException e = new StackEmptyException();
throw e;
}
return head.data;
}
public void push(T data) {
Node<T> temp = new Node<T>(data);
temp.next=head;
head= temp;
size++;
}
public T pop() {
T temp = head.data;
head = head.next;
size--;
return temp;
}
}
| [
"sahilshirodkar1630@gmail.com"
] | sahilshirodkar1630@gmail.com |
888d8393cf74672448977f153f36939618cd2980 | 4ebfcff81219c9b47777278215c68dbe0e80f8a3 | /chat/src/main/java/com/example/student/chat/StartUpReceiver.java | 93ae7df41abee42b71cd8dabf4f3556981383ac4 | [] | no_license | xohzzwn6kcj9/AndroidLab | f4c66afbaea9b0e16542220750e98cda54e4be3c | cd9772975ae5ff97d6dbe8d2a4baf7cdb0a026ee | refs/heads/master | 2016-09-06T15:46:31.535486 | 2015-08-06T08:32:57 | 2015-08-06T08:32:57 | 40,101,060 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,332 | java | package com.example.student.chat;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
public class StartUpReceiver extends BroadcastReceiver {
public StartUpReceiver() {
}
@Override
public void onReceive(Context context, Intent intent) {
//부팅 완료 시점에 시스템에서 띄우는 intent에 의해 실행..
//service 구동..
Intent sIntent=new Intent(context, ChattingService.class);
context.startService(sIntent);
//한번 start된 서비스가 유저, system에 의해 종료된다..
//주기적으로 servicr 구동 상태 파악해서.. 다시 살리는 로직..
//AlarmService 이용해서 체크..
//==>지정된 시간에.. 혹은 주기적인 시간에.. 우리가 원하는 무언가가
//실행되게..
Intent aIntent=new Intent(context, RestartReceiver.class);
PendingIntent pendingIntent=PendingIntent.getBroadcast(
context, 0, aIntent, 0);
AlarmManager am=(AlarmManager)context.getSystemService(
Context.ALARM_SERVICE);
am.setRepeating(AlarmManager.RTC_WAKEUP,
System.currentTimeMillis(), 6000, pendingIntent);
}
}
| [
"xohzzwn6kcj9@gmail.com"
] | xohzzwn6kcj9@gmail.com |
25b41e642da4a766c6b352e2259d9292dd75f582 | 3f7f772d41f984d3eaf2298c580fbd019d67a6a4 | /java_core/JavaCore/src/Application.java | 939505431a9f73e249be7b997372db6374b95216 | [] | no_license | hoanghiep8921/ljava1908 | b02518ea8e625b1adc7119299a383e05890a9803 | e543bb169dea6ea1ce990dbf736d26f55e80ed35 | refs/heads/master | 2022-07-03T15:27:13.322018 | 2020-06-29T14:40:37 | 2020-06-29T14:40:37 | 219,543,440 | 0 | 4 | null | 2022-06-21T02:55:22 | 2019-11-04T16:14:32 | HTML | UTF-8 | Java | false | false | 2,693 | java | public class Application {
public static void main(String[] args) {
System.out.println("Hello word");
int a = Integer.MAX_VALUE;
int b = Integer.MAX_VALUE;
System.out.println(a+b);
sum(100,200); //300
//int c = sum(100,200);
System.out.println(sum(100,200));
printDate(3);
}
public static boolean checkPrime(int number){
if(number <= 0 ){
return false;
}
if(number <= 2){
return true;
}
for(int i = 2; i < Math.sqrt(number) ; i++){
if(number % i == 0){
return false;
}
}
return true;
}
public static void sumPrime(){
int tong = 0;
for(int i = 0;i<=100;i++){
if(checkPrime(i)){
tong += i;
}
}
System.out.println(tong);
}
public static void findNumber(int a){
if(a % 6 == 0){
System.out.println("Chia hết cho 6");
return;
}
if(a % 3 == 0){
System.out.println("Chia hết cho 3");
return;
}
if(a % 2 == 0){
System.out.println("Chia hết cho 2");
return;
}
}
public static void printDate(int date){
switch(date) {
case 2:
System.out.println("Thứ 2");
break;
case 3:
System.out.println("Thứ 3");
break;
case 4:
System.out.println("Thứ 4");
break;
case 5:
System.out.println("Thứ 5");
break;
case 6:
System.out.println("Thứ 6");
break;
case 7:
System.out.println("Thứ 7");
//break;
case 8:
System.out.println("Chủ nhật");
break;
default:
System.out.println("Nhập ngày sai rồi");
}
}
public static boolean checkNumber(int number){
if(number % 2 == 0){
return true;
}
return false;
}
public static int sum(int number1, int number2){
return number1 + number2;
}
// Account A => Account B
public static void transfer(int accountA, int accountB, int money){
if(accountA < 0 || accountB < 0){
return ;
}
if(money < 0 && money > accountA){
return ;
}
accountA -= money; //accountA = accountA - money
accountB += money;
//System.out.println();
}
}
| [
"hoanghiep8921@gmail.com"
] | hoanghiep8921@gmail.com |
5deabcf060542bb8f718221e383de79869725e89 | cc53928f96353df0514df74df0ac594e451e0a84 | /timwang-algorithm-interview/src/main/java/com/timwang/algorithm/interview/loadblance/RoundLoadBlance.java | 051c3519332bc2c747949ac9414ccfe6c7398c0b | [
"Apache-2.0"
] | permissive | wj89757/timwang-algorithm | c67d55edfad6e0beeee7af81175b133e8250ebd1 | 87e9ee5af16d8db8fcfa0d674959c3ef5e348a1e | refs/heads/master | 2023-01-05T20:02:47.227249 | 2020-10-30T07:54:35 | 2020-10-30T07:54:35 | 291,750,350 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 646 | java | package com.timwang.algorithm.interview.loadblance;
import java.util.List;
/**
* @author wangjun
* @date 2020-07-02
*/
public class RoundLoadBlance {
private static int index = 0;
/**
* 简单的轮询负载均衡算法,不带权重,index++即可
* @return ip
*/
public static String getIp() {
List<String> ipList = ServerInfos.getIpList();
if (index > ipList.size() - 1) {
index = 0;
}
return ipList.get(index++);
}
public static void main(String[] args) {
for (int i = 0; i < 10; i++) {
System.out.println(getIp());
}
}
}
| [
"961214034@qq.com"
] | 961214034@qq.com |
1982c072dcdc1dae0d57a6b947bc4eb9733c3bf0 | 32411fa2eefffbaacd742cefd4a55de0e766f22e | /openregistry-api/src/main/java/org/openregistry/core/domain/annotation/AllowedTypes.java | cee0715ad29c781d110398f2c2d5e27adb76a72b | [
"Apache-2.0"
] | permissive | nazeersyed/openregistry | a00b69b830df608d08b4e00789fb3048f7f2515b | 7790faef28655f1870fcd1b5165aa995992cbcaf | refs/heads/master | 2020-04-05T23:32:43.590467 | 2015-12-08T20:36:59 | 2015-12-08T20:36:59 | 50,042,094 | 1 | 0 | null | 2016-01-20T16:12:03 | 2016-01-20T16:12:03 | null | UTF-8 | Java | false | false | 1,752 | java | /**
* Licensed to Jasig under one or more contributor license
* agreements. See the NOTICE file distributed with this work
* for additional information regarding copyright ownership.
* Jasig licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a
* copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.openregistry.core.domain.annotation;
import org.openregistry.core.domain.validation.AllowedTypeConstraintValidator;
import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
/**
* Constraint that determines which "types" an SoR is allowed to provide to a field.
*
* @version $Revision$ $Date$
* @since 0.1
*/
@Retention(RUNTIME)
@Target({FIELD, METHOD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER})
@Constraint(validatedBy = AllowedTypeConstraintValidator.class)
public @interface AllowedTypes {
String property();
String message() default "{org.openregistry.core.domain.annotation.AllowedTypes.message}";
Class<?>[] groups() default {};
Class<? extends Payload>[] payload() default {};
}
| [
"scott.battaglia@gmail.com"
] | scott.battaglia@gmail.com |
7d02a32cf5ad8b02300bee2a897147a07c2b7d12 | b7b80bac57783c2f7cb5ef57b5b20dd50f2e5c74 | /src/thisarateafactory/ui/Sales/ui/returnsale/ReturnSalesTableModel.java | 735f97919445960f5b8a56c7b23c325b0dfb57ca | [] | no_license | isuruhettiarachchi/ThisaraTeaFactory | da43774aa739bab60d7dc39f3ca0f7153c9d978e | cba1af0158fb8c85b2b7479bb7f9ce66c0679ca7 | refs/heads/master | 2022-11-03T12:35:45.793272 | 2020-06-19T13:32:00 | 2020-06-19T13:32:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,553 | 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 thisarateafactory.ui.Sales.ui.returnsale;
import thisarateafactory.ui.Sales.dao.ReturnSalesDAO;
/**
*
* @author Keshan De Silva
*/
public class ReturnSalesTableModel {
private String date;
private String lotNo;
private String invoiceNo;
private String description;
private String weight;
ReturnSalesTableModel(ReturnSalesDAO dao) {
this.date = dao.getDate().toString();
this.weight = dao.getWeight()+ "";
this.description = dao.getDescription()+ "";
this.invoiceNo = dao.getInvoiceNumber()+ "";
this.lotNo = dao.getLotNumber()+ "";
}
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
public String getLotNo() {
return lotNo;
}
public void setLotNo(String lotNo) {
this.lotNo = lotNo;
}
public String getInvoiceNo() {
return invoiceNo;
}
public void setInvoiceNo(String invoiceNo) {
this.invoiceNo = invoiceNo;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getWeight() {
return weight;
}
public void setWeight(String weight) {
this.weight = weight;
}
}
| [
"isuru71@gmail.com"
] | isuru71@gmail.com |
9948d59424a5962b61e7c337f97ad18267509e11 | 1857cd0da5aa9855ec719c41d93d642c0e037de8 | /src/main/java/com/firejq/VideoInputThread.java | 9e57ce615472b1d01c99175dd8604b2de8e3f189 | [
"MIT"
] | permissive | Apple-zy/EasyCall | e49e6ea6d1e684405b48730bfb2ffcf76df7ce07 | c5018ae7363ad6c2a05cad560ce5f45dd8eb6022 | refs/heads/master | 2022-01-27T05:55:00.246766 | 2018-05-31T17:51:22 | 2018-05-31T17:51:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,001 | java | package com.firejq;
import org.bytedeco.javacpp.Loader;
import org.bytedeco.javacpp.opencv_objdetect;
import org.bytedeco.javacv.CanvasFrame;
import javax.imageio.ImageIO;
import javax.swing.*;
import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.UnknownHostException;
/**
* <p>Title: </p>
* <p>Description: </p>
*
* @author <a href="mailto:firejq@outlook.com">firejq</a>
*/
public class VideoInputThread extends Thread {
private InetAddress remoteAddress;
private int remotePort;
public VideoInputThread(String ipAddress, int remotePort) {
try {
this.remoteAddress = InetAddress.getByName(ipAddress);
this.remotePort = remotePort;
} catch (UnknownHostException e) {
e.printStackTrace();
}
}
@Override
public void run() {
System.out.println("视频输入线程(看对方)启动");
// Preload the opencv_objdetect module to work around a known bug.
Loader.load(opencv_objdetect.class);
try (DatagramSocket dSocket = new DatagramSocket(Config.DEFAULT_PORT)) {
// 新建一个窗口,显示对方摄像头的画面
CanvasFrame canvas = new CanvasFrame("对方");
canvas.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
canvas.setAlwaysOnTop(true);
while (canvas.isDisplayable()) { //窗口是否关闭
byte [] buf = new byte[65507];
DatagramPacket dPacket = new DatagramPacket(buf, 65507);
dSocket.receive(dPacket);
if (!dPacket.getAddress().equals(this.remoteAddress)
|| dPacket.getPort() != this.remotePort) {
continue;
}
ByteArrayInputStream bin = new ByteArrayInputStream(
dPacket.getData());
BufferedImage image = ImageIO.read(bin);
canvas.showImage(image);
}
canvas.dispose();
} catch (IOException e) {
e.printStackTrace();
}
}
}
| [
"firejq@firejq.com"
] | firejq@firejq.com |
5fe6eb175a44d2641de7bfeb1bea2a1e6affdd6d | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/2/2_f340e30594cd19d4a1f751b27991e0d0ba35a2ec/SourceCodeEditorComposer/2_f340e30594cd19d4a1f751b27991e0d0ba35a2ec_SourceCodeEditorComposer_t.java | bac09433487d94e1741446636e3dcff3d63089b1 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 14,883 | java | package org.zkoss.fiddle.composer;
import java.util.ArrayList;
import java.util.List;
import org.apache.log4j.Logger;
import org.zkoss.fiddle.FiddleConstant;
import org.zkoss.fiddle.component.renderer.ISourceTabRenderer;
import org.zkoss.fiddle.component.renderer.SourceTabRendererFactory;
import org.zkoss.fiddle.composer.TopNavigationComposer.State;
import org.zkoss.fiddle.composer.event.FiddleEvents;
import org.zkoss.fiddle.composer.event.InsertResourceEvent;
import org.zkoss.fiddle.composer.event.ResourceChangedEvent.Type;
import org.zkoss.fiddle.composer.event.SaveCaseEvent;
import org.zkoss.fiddle.composer.event.URLChangeEvent;
import org.zkoss.fiddle.composer.eventqueue.FiddleEventListener;
import org.zkoss.fiddle.composer.eventqueue.FiddleEventQueues;
import org.zkoss.fiddle.composer.eventqueue.impl.FiddleBrowserStateEventQueue;
import org.zkoss.fiddle.composer.eventqueue.impl.FiddleSourceEventQueue;
import org.zkoss.fiddle.composer.eventqueue.impl.FiddleTopNavigationEventQueue;
import org.zkoss.fiddle.composer.viewmodel.CaseModel;
import org.zkoss.fiddle.dao.api.ICaseRecordDao;
import org.zkoss.fiddle.dao.api.ICaseTagDao;
import org.zkoss.fiddle.dao.api.ITagDao;
import org.zkoss.fiddle.fiddletabs.Fiddletabs;
import org.zkoss.fiddle.manager.CaseManager;
import org.zkoss.fiddle.manager.FiddleSandboxManager;
import org.zkoss.fiddle.model.CaseRecord;
import org.zkoss.fiddle.model.Resource;
import org.zkoss.fiddle.model.Tag;
import org.zkoss.fiddle.model.api.ICase;
import org.zkoss.fiddle.notification.Notification;
import org.zkoss.fiddle.util.BrowserState;
import org.zkoss.fiddle.util.CaseUtil;
import org.zkoss.fiddle.util.NotificationUtil;
import org.zkoss.fiddle.util.SEOUtils;
import org.zkoss.fiddle.visualmodel.CaseRequest;
import org.zkoss.fiddle.visualmodel.FiddleSandbox;
import org.zkoss.social.facebook.event.LikeEvent;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.Desktop;
import org.zkoss.zk.ui.Executions;
import org.zkoss.zk.ui.Sessions;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zk.ui.event.EventQueues;
import org.zkoss.zk.ui.event.Events;
import org.zkoss.zk.ui.util.GenericForwardComposer;
import org.zkoss.zkplus.spring.SpringUtil;
import org.zkoss.zul.A;
import org.zkoss.zul.Checkbox;
import org.zkoss.zul.Div;
import org.zkoss.zul.Hlayout;
import org.zkoss.zul.Label;
import org.zkoss.zul.Tab;
import org.zkoss.zul.Tabpanels;
import org.zkoss.zul.Textbox;
import org.zkoss.zul.Toolbarbutton;
import org.zkoss.zul.Window;
public class SourceCodeEditorComposer extends GenericForwardComposer {
/**
*
*/
private static final long serialVersionUID = -5940380002871513285L;
/**
* Logger for this class
*/
private static final Logger logger = Logger
.getLogger(SourceCodeEditorComposer.class);
/**
* case management model.
*/
private CaseModel caseModel;
private Fiddletabs sourcetabs;
private Tabpanels sourcetabpanels;
private Textbox caseTitle;
private Div caseToolbar;
private Toolbarbutton download;
private Label poserIp;
/* for tags */
private Hlayout tagContainer;
private Label tagEmpty;
private Textbox tagInput;
private Hlayout editTag;
private Hlayout viewTag;
private String lastVal;
private Checkbox cbSaveTag;
/* for notifications */
private Div notifications;
public void doAfterCompose(Component comp) throws Exception {
super.doAfterCompose(comp);
ICase _case = (ICase) requestScope
.get(FiddleConstant.REQUEST_ATTR_CASE);
updateNotifications();
caseModel = prepareCaseModel(_case);
updateCaseView(caseModel);
updateTopNavigation();
initEventQueue();
initSEOHandler(caseModel, desktop);
// if direct view , we handle it here.
initDirectlyView();
}
private void updateTopNavigation(){
if(caseModel.isStartWithNewCase()){
FiddleTopNavigationEventQueue.lookup().fireStateChange(State.New);
}else{
FiddleTopNavigationEventQueue.lookup().fireStateChange(State.Saved);
}
}
/**
*
*/
private void updateNotifications() {
List<String> list = NotificationUtil.getNotifications(Sessions
.getCurrent());
notifications.getChildren().clear();
for (String message : list) {
Notification notification = new Notification(message);
notification.setSclass("fiddle-nofication");
notifications.appendChild(notification);
}
notifications.invalidate();
NotificationUtil.clearNotifications(Sessions.getCurrent());
}
private CaseModel prepareCaseModel(ICase _case) {
if (!isTryCase()) {
return new CaseModel(_case, false, null);
} else {
String zulData = (String) Executions.getCurrent().getParameter(
"zulData");
String version = (String) Executions.getCurrent().getParameter(
"zkver");
Events.echoEvent(new Event("onShowTryCase", self, version));
return new CaseModel(_case, true, zulData);
}
}
private void initEventQueue() {
final FiddleSourceEventQueue sourceQueue = FiddleSourceEventQueue
.lookup();
sourceQueue
.subscribeResourceCreated(new FiddleEventListener<InsertResourceEvent>(
InsertResourceEvent.class) {
public void onFiddleEvent(InsertResourceEvent event)
throws Exception {
InsertResourceEvent insertEvent = (InsertResourceEvent) event;
Resource resource = insertEvent.getResource();
caseModel.addResource(resource);
ISourceTabRenderer render = SourceTabRendererFactory
.getRenderer(resource.getType());
render.appendSourceTab(sourcetabs, sourcetabpanels,
resource);
((Tab) sourcetabs.getLastChild()).setSelected(true);
}
});
sourceQueue
.subscribeResourceSaved(new FiddleEventListener<SaveCaseEvent>(
SaveCaseEvent.class) {
public void onFiddleEvent(SaveCaseEvent event)
throws Exception {
SaveCaseEvent saveEvt = (SaveCaseEvent) event;
CaseManager caseManager = (CaseManager) SpringUtil
.getBean("caseManager");
String title = caseTitle.getValue().trim();
String ip = Executions.getCurrent().getRemoteAddr();
ICase saved = caseManager.saveCase(
caseModel.getCurrentCase(),
caseModel.getResources(), title,
saveEvt.isFork(), ip, cbSaveTag.isChecked());
if (saved != null) {
List<String> notifications = NotificationUtil
.getNotifications(Sessions.getCurrent());
if (caseModel.isStartWithNewCase()) {
notifications
.add("You have saved a new sample.");
} else if (saveEvt.isFork()) {
notifications.add("You have forked the sample. ");
} else {
notifications.add("You have updated the sample. ");
}
NotificationUtil.updateNotifications(
Sessions.getCurrent(), notifications);
BrowserState.go(
CaseUtil.getSampleURL(saved),
"ZK Fiddle - "
+ CaseUtil.getPublicTitle(saved),
true, saved);
// Executions.getCurrent().sendRedirect(CaseUtil.getSampleURL(saved));
}
}
});
/**
* browser state , for chrome and firefox only
*/
FiddleBrowserStateEventQueue queue = FiddleBrowserStateEventQueue
.lookup();
queue.subscribe(new FiddleEventListener<URLChangeEvent>(
URLChangeEvent.class) {
public void onFiddleEvent(URLChangeEvent evt) throws Exception {
// only work when updated to a case view.
if (evt.getData() != null && evt.getData() instanceof ICase) {
ICase _case = (ICase) evt.getData();
caseModel.setCase(_case);
updateCaseView(caseModel);
updateTopNavigation();
updateNotifications();
EventQueues.lookup(FiddleEventQueues.LeftRefresh).publish(
new Event(FiddleEvents.ON_LEFT_REFRESH, null));
}
// TODO check if we switch to tag view.
}
});
}
private boolean isTryCase() {
Boolean tryCase = (Boolean) requestScope
.get(FiddleConstant.REQUEST_ATTR_TRY_CASE);
return tryCase != null && tryCase;
}
private void initDirectlyView() {
// @see FiddleDispatcherFilter for those use this directly
CaseRequest viewRequestParam = (CaseRequest) requestScope
.get(FiddleConstant.REQUEST_ATTR_RUN_VIEW);
if (viewRequestParam != null) {
runDirectlyView(viewRequestParam);
}
}
private void updateCaseView(CaseModel caseModel) {
// FiddleBrowserStateEventQueue
boolean newCase = caseModel.isStartWithNewCase();
if (!newCase) {
ICase thecase = caseModel.getCurrentCase();
caseTitle.setValue(thecase.getTitle());
download.setHref(caseModel.getDownloadLink());
caseToolbar.setVisible(true);
poserIp.setValue(thecase.getPosterIP());
initTagEditor(thecase);
}
sourcetabs.getChildren().clear();
sourcetabpanels.getChildren().clear();
final FiddleSourceEventQueue sourceQueue = FiddleSourceEventQueue
.lookup();
for (Resource resource : caseModel.getResources()) {
ISourceTabRenderer render = SourceTabRendererFactory
.getRenderer(resource.getType());
render.appendSourceTab(sourcetabs, sourcetabpanels, resource);
if (newCase) {
// Notify content to do some processing,since we use desktop
// scope eventQueue,it will not be a performance issue.
sourceQueue.fireResourceChanged(resource, Type.Created);
}
}
}
private void initTagEditor(final ICase pCase) {
ICaseTagDao caseTagDao = (ICaseTagDao) SpringUtil.getBean("caseTagDao");
// TODO check if we need to cache this.
updateTags(caseTagDao.findTagsBy(pCase));
EventListener handler = new EventListener() {
public void onEvent(Event event) throws Exception {
performUpdateTag();
}
};
tagInput.addEventListener("onOK", handler);
tagInput.addEventListener("onCancel", new EventListener() {
public void onEvent(Event event) throws Exception {
tagInput.setValue(lastVal);
setTagEditable(false);
event.stopPropagation();
}
});
}
private void setTagEditable(boolean bool) {
// 2011/6/27:TonyQ
// set visible twice for forcing smart update
// sicne we set visible in client , so the visible state didn't sync
// with server,
// we need to make sure the server will really send the smartUpdate
// messages. ;)
editTag.setVisible(!bool);
editTag.setVisible(bool); // actually we want editTag visible false
viewTag.setVisible(bool);
viewTag.setVisible(!bool); // actually we want viewTag visible true
}
private void performUpdateTag() {
String val = tagInput.getValue();
boolean valueChange = (lastVal == null || !val.equals(lastVal));
// Do nothing if it didn't change
if (valueChange) {
ITagDao tagDao = (ITagDao) SpringUtil.getBean("tagDao");
List<Tag> list = "".equals(val.trim()) ? new ArrayList<Tag>()
: tagDao.prepareTags(val.split("[ ]*,[ ]*"));
ICaseTagDao caseTagDao = (ICaseTagDao) SpringUtil
.getBean("caseTagDao");
caseTagDao.replaceTags(caseModel.getCurrentCase(), list);
EventQueues.lookup(FiddleEventQueues.Tag).publish(
new Event(FiddleEvents.ON_TAG_UPDATE, null));
updateTags(list);
}
setTagEditable(false);
}
private void updateTags(List<Tag> list) {
tagContainer.getChildren().clear();
if (list.size() == 0) {
tagEmpty.setVisible(true);
cbSaveTag.setVisible(false);
} else {
StringBuffer sb = new StringBuffer();
for (Tag tag : list) {
A lbl = new A(tag.getName());
lbl.setHref("/tag/" + tag.getName());
lbl.setSclass("case-tag");
sb.append(tag.getName() + ",");
tagContainer.appendChild(lbl);
}
if (sb.length() != 0) {
sb.deleteCharAt(sb.length() - 1);
}
tagInput.setValue(sb.toString());
lastVal = sb.toString();
tagEmpty.setVisible(false);
cbSaveTag.setVisible(true);
}
}
private void runDirectlyView(CaseRequest viewRequestParam) {
FiddleSandbox sandbox = viewRequestParam.getFiddleSandbox();
if (sandbox != null) { // inst can't be null
// use echo event to find a good timing
Events.echoEvent(new Event(FiddleEvents.ON_SHOW_RESULT, self,
viewRequestParam));
} else {
alert("Can't find sandbox from specific version ");
}
}
public void onLike$fblike(LikeEvent evt) {
ICaseRecordDao manager = (ICaseRecordDao) SpringUtil
.getBean("caseRecordDao");
ICase $case = caseModel.getCurrentCase();
if (evt.isLiked()) {
if (logger.isDebugEnabled()) {
logger.debug($case.getToken() + ":" + $case.getVersion()
+ ":like");
}
manager.increase(CaseRecord.Type.Like, $case);
} else {
if (logger.isDebugEnabled()) {
logger.debug($case.getToken() + ":" + $case.getVersion()
+ ":unlike");
}
manager.decrease(CaseRecord.Type.Like, $case.getId());
}
}
public void onShowResult(Event e) {
CaseRequest viewRequestParam = (CaseRequest) e.getData();
if (viewRequestParam != null) {
FiddleSourceEventQueue.lookup().fireShowResult(
caseModel.getCurrentCase(),
viewRequestParam.getFiddleSandbox());
}
}
public void onShowTryCase(Event e) {
FiddleSandboxManager manager = (FiddleSandboxManager) SpringUtil
.getBean("sandboxManager");
FiddleSandbox sandbox = null;
String version = (String) e.getData();
if (version != null) {
sandbox = manager.getFiddleSandboxByVersion(version);
} else {
sandbox = manager.getFiddleSandboxForLastestVersion();
}
if (sandbox == null) {
if (version == null) {
alert("Currently no any available sandbox.");
} else {
alert("Currently no any available sandbox for ZK version["
+ version + "].");
}
return;
}
caseModel.ShowResult(sandbox);
}
public void onAdd$sourcetabs(Event e) {
try {
// the reason for not using auto wire is that the insertWin is
// included when fulfill.
((Window) self.getFellow("insertWin")).doOverlapped();
} catch (Exception e1) {
logger.error("onAdd$sourcetabs(Event) - e=" + e, e1);
}
}
private static void initSEOHandler(CaseModel model, Desktop desktop) {
SEOUtils.render(desktop, model.getCurrentCase());
SEOUtils.render(desktop, model.getResources());
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
df8b3398722ed2ae9e71f6205c47f35481954838 | c0643be003e53d1f4f69fda4156a8e11eabd63a1 | /src/com/cts/conctes/dao/CostAndTimeEstDAO.java | ec07d6ac15573f92eace5060e80c0f287759a24e | [] | no_license | ravirapolu12/ConstructionCostTimeEstimate | fdbf821d70dab6aa73d4a45bc05dddbe3a3036c1 | 4046fa149f4dcc3b6095a4870559447c703878b2 | refs/heads/main | 2023-04-20T23:36:06.532317 | 2021-05-07T04:43:18 | 2021-05-07T04:43:18 | 365,115,940 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,432 | java | package com.cts.conctes.dao;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Date;
import com.cts.conctes.exception.ConstructionEstimationException;
import com.cts.conctes.model.ConstructionProject;
import com.cts.conctes.util.ApplicationUtil;
public class CostAndTimeEstDAO {
public static Connection connection = null;
public boolean insertConstructionProject(ArrayList <ConstructionProject> constProjects)
throws ConstructionEstimationException {
boolean recordsAdded = false;
int index=0;
int size=constProjects.size();
connection=DBConnectionManager.getInstance().getConnection();
String query="insert into constructionproject values(?, ?, ?, ?, ?, ?, ?);";
for(ConstructionProject cp: constProjects) {
try {
PreparedStatement ps=connection.prepareStatement(query);
ps.setString(1, cp.getProjectId());
ps.setDate(2, ApplicationUtil.utilToSqlDateConverter(cp.getPlannedDOStart()));
ps.setString(3, cp.getTypeOfProject());
ps.setString(4, cp.getStructure());
ps.setDouble(5, cp.getAreaInSqFt());
ps.setDouble(6, cp.getEstimatedCostInlac());
ps.setDouble(7, cp.getEstimatedTimeInMonths());
int row=ps.executeUpdate();
if(row>0)
index+=1;
if(index==size) {
recordsAdded=true;
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
return recordsAdded;
}
public ArrayList <ConstructionProject> getConstructionProjectsData() throws ConstructionEstimationException
{
ArrayList <ConstructionProject> consApplicants = new
ArrayList<ConstructionProject>();
connection=DBConnectionManager.getInstance().getConnection();
String query="select * from constructionproject";
try {
PreparedStatement ps=connection.prepareStatement(query);
ResultSet rs=ps.executeQuery();
while(rs.next()) {
String id=rs.getString(1);
Date d=rs.getDate(2);
String typeProject=rs.getString(3);
String structure=rs.getString(4);
double areaSqFt=rs.getDouble(5);
double costInLac=rs.getDouble(6);
double timeInMonths=rs.getDouble(7);
consApplicants.add(new ConstructionProject(id, d, typeProject, structure, areaSqFt, costInLac, timeInMonths));
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return consApplicants;
}
} | [
"noreply@github.com"
] | ravirapolu12.noreply@github.com |
dc0a92ede4eb6b94d816e6741267469147b6deec | b2dff579a42b1c49e87171ac3c6bd0824f5777d0 | /SymmetricDS/symmetric-client/src/main/java/org/jumpmind/symmetric/db/mssql2000/MsSql2000TriggerTemplate.java | 3dd02738129f240e3e1b995640a587cfd39379f4 | [
"Apache-2.0"
] | permissive | hawkwang/BeyondMDM | d03870742ba070b50ef1e9e9b0f1e37af5d6000c | 588726dfa221bc9f3de7df7a2afa5bee0e213fbd | refs/heads/master | 2023-01-24T21:09:23.057957 | 2019-06-20T09:31:52 | 2019-06-20T09:31:52 | 192,829,181 | 4 | 7 | Apache-2.0 | 2023-01-04T02:34:55 | 2019-06-20T01:43:46 | Java | UTF-8 | Java | false | false | 29,324 | java | /**
* Licensed to JumpMind Inc under one or more contributor
* license agreements. See the NOTICE file distributed
* with this work for additional information regarding
* copyright ownership. JumpMind Inc licenses this file
* to you under the GNU General Public License, version 3.0 (GPLv3)
* (the "License"); you may not use this file except in compliance
* with the License.
*
* You should have received a copy of the GNU General Public License,
* version 3.0 (GPLv3) along with this library; if not, see
* <http://www.gnu.org/licenses/>.
*
* 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.jumpmind.symmetric.db.mssql2000;
import java.util.HashMap;
import org.jumpmind.symmetric.db.ISymmetricDialect;
import org.jumpmind.symmetric.db.mssql.MsSqlTriggerTemplate;
public class MsSql2000TriggerTemplate extends MsSqlTriggerTemplate {
public MsSql2000TriggerTemplate(ISymmetricDialect symmetricDialect) {
super(symmetricDialect);
this.symmetricDialect = symmetricDialect;
// @formatter:off
emptyColumnTemplate = "''" ;
stringColumnTemplate = "case when $(tableAlias).\"$(columnName)\" is null then '' else '\"' + replace(replace(convert(varchar(8000),$(tableAlias).\"$(columnName)\") $(masterCollation),'\\','\\\\'),'\"','\\\"') + '\"' end" ;
geometryColumnTemplate = "case when $(tableAlias).\"$(columnName)\" is null then '' else '\"' + replace(replace(convert(varchar(8000),$(tableAlias).\"$(columnName)\".STAsText()) $(masterCollation),'\\','\\\\'),'\"','\\\"') + '\"' end" ;
geographyColumnTemplate = "case when $(tableAlias).\"$(columnName)\" is null then '' else '\"' + replace(replace(convert(varchar(8000),$(tableAlias).\"$(columnName)\".STAsText()) $(masterCollation),'\\','\\\\'),'\"','\\\"') + '\"' end" ;
numberColumnTemplate = "case when $(tableAlias).\"$(columnName)\" is null then '' else ('\"' + convert(varchar(40), $(tableAlias).\"$(columnName)\",2) + '\"') end" ;
datetimeColumnTemplate = "case when $(tableAlias).\"$(columnName)\" is null then '' else ('\"' + convert(varchar,$(tableAlias).\"$(columnName)\",121) + '\"') end" ;
clobColumnTemplate = "case when $(origTableAlias).\"$(columnName)\" is null then '' else '\"' + replace(replace(cast($(origTableAlias).\"$(columnName)\" as varchar(8000)),'\\','\\\\'),'\"','\\\"') + '\"' end" ;
blobColumnTemplate = "case when $(origTableAlias).\"$(columnName)\" is null then '' else '\"' + replace(replace($(defaultCatalog)dbo.$(prefixName)_base64_encode(CONVERT(VARBINARY(8000), $(origTableAlias).\"$(columnName)\")),'\\','\\\\'),'\"','\\\"') + '\"' end" ;
binaryColumnTemplate = "case when $(tableAlias).\"$(columnName)\" is null then '' else '\"' + replace(replace($(defaultCatalog)dbo.$(prefixName)_base64_encode(CONVERT(VARBINARY(8000), $(tableAlias).\"$(columnName)\")),'\\','\\\\'),'\"','\\\"') + '\"' end" ;
booleanColumnTemplate = "case when $(tableAlias).\"$(columnName)\" is null then '' when $(tableAlias).\"$(columnName)\" = 1 then '\"1\"' else '\"0\"' end" ;
triggerConcatCharacter = "+" ;
newTriggerValue = "inserted" ;
oldTriggerValue = "deleted" ;
oldColumnPrefix = "" ;
newColumnPrefix = "" ;
sqlTemplates = new HashMap<String,String>();
sqlTemplates.put("insertTriggerTemplate" ,
"create trigger $(triggerName) on $(schemaName)$(tableName) after insert as \n" +
" begin \n" +
" declare @NCT int \n" +
" set @NCT = @@OPTIONS & 512 \n" +
" set nocount on; \n" +
" declare @TransactionId varchar(1000) \n" +
" declare @DataRow varchar(8000) \n" +
" declare @ChannelId varchar(128) \n" +
" $(declareNewKeyVariables) \n" +
" if (@@TRANCOUNT > 0) begin \n" +
" execute sp_getbindtoken @TransactionId output; \n" +
" end \n" +
" $(custom_before_insert_text) \n" +
" if ($(syncOnIncomingBatchCondition)) begin \n" +
" declare DataCursor cursor local for \n" +
" $(if:containsBlobClobColumns) \n" +
" select $(columns) $(newKeyNames), $(channelExpression) from inserted inner join $(schemaName)$(tableName) $(origTableAlias) on $(tableNewPrimaryKeyJoin) where $(syncOnInsertCondition)\n" +
" $(else:containsBlobClobColumns) \n" +
" select $(columns) $(newKeyNames), $(channelExpression) from inserted where $(syncOnInsertCondition) \n" +
" $(end:containsBlobClobColumns) \n" +
" open DataCursor \n" +
" fetch next from DataCursor into @DataRow $(newKeyVariables), @ChannelId \n" +
" while @@FETCH_STATUS = 0 begin \n" +
" insert into $(defaultCatalog)$(defaultSchema)$(prefixName)_data (table_name, event_type, trigger_hist_id, row_data, channel_id, transaction_id, source_node_id, external_data, create_time) \n" +
" values('$(targetTableName)','I', $(triggerHistoryId), @DataRow, @ChannelId, $(txIdExpression), $(defaultCatalog)dbo.$(prefixName)_node_disabled(), $(externalSelect), current_timestamp) \n" +
" fetch next from DataCursor into @DataRow $(newKeyVariables), @ChannelId \n" +
" end \n" +
" close DataCursor \n" +
" deallocate DataCursor \n" +
" end \n" +
" $(custom_on_insert_text) \n" +
" if (@NCT = 0) set nocount off \n" +
" end " );
sqlTemplates.put("updateTriggerTemplate" ,
"create trigger $(triggerName) on $(schemaName)$(tableName) after update as \n" +
" begin \n" +
" declare @NCT int \n" +
" set @NCT = @@OPTIONS & 512 \n" +
" set nocount on; \n" +
" declare @TransactionId varchar(1000) \n" +
" declare @DataRow varchar(8000) \n" +
" declare @OldPk varchar(2000) \n" +
" declare @OldDataRow varchar(8000) \n" +
" declare @ChannelId varchar(128) \n" +
" $(declareOldKeyVariables) \n" +
" $(declareNewKeyVariables) \n" +
" if (@@TRANCOUNT > 0) begin \n" +
" execute sp_getbindtoken @TransactionId output; \n" +
" end \n" +
" $(custom_before_update_text) \n" +
" if ($(syncOnIncomingBatchCondition)) begin \n" +
" declare DataCursor cursor local for \n" +
" $(if:containsBlobClobColumns) \n" +
" select $(columns), $(oldKeys), $(oldColumns) $(oldKeyNames) $(newKeyNames), $(channelExpression) from inserted inner join $(schemaName)$(tableName) $(origTableAlias) on $(tableNewPrimaryKeyJoin) inner join deleted on $(oldNewPrimaryKeyJoin) where $(syncOnUpdateCondition)\n" +
" $(else:containsBlobClobColumns) \n" +
" select $(columns), $(oldKeys), $(oldColumns) $(oldKeyNames) $(newKeyNames), $(channelExpression) from inserted inner join deleted on $(oldNewPrimaryKeyJoin) where $(syncOnUpdateCondition) \n" +
" $(end:containsBlobClobColumns) \n" +
" open DataCursor \n" +
" fetch next from DataCursor into @DataRow, @OldPk, @OldDataRow $(oldKeyVariables) $(newKeyVariables), @ChannelId \n" +
" while @@FETCH_STATUS = 0 begin \n" +
" insert into $(defaultCatalog)$(defaultSchema)$(prefixName)_data (table_name, event_type, trigger_hist_id, row_data, pk_data, old_data, channel_id, transaction_id, source_node_id, external_data, create_time) \n" +
" values('$(targetTableName)','U', $(triggerHistoryId), @DataRow, @OldPk, @OldDataRow, @ChannelId, $(txIdExpression), $(defaultCatalog)dbo.$(prefixName)_node_disabled(), $(externalSelect), current_timestamp)\n" +
" fetch next from DataCursor into @DataRow, @OldPk, @OldDataRow $(oldKeyVariables) $(newKeyVariables), @ChannelId \n" +
" end \n" +
" close DataCursor \n" +
" deallocate DataCursor \n" +
" end \n" +
" $(custom_on_update_text) \n" +
" if (@NCT = 0) set nocount off \n" +
" end " );
sqlTemplates.put("updateHandleKeyUpdatesTriggerTemplate" ,
"create trigger $(triggerName) on $(schemaName)$(tableName) after update as \n" +
" begin \n" +
" declare @NCT int \n" +
" set @NCT = @@OPTIONS & 512 \n" +
" set nocount on; \n" +
" declare @TransactionId varchar(1000) \n" +
" declare @OldPk varchar(2000) \n" +
" declare @OldDataRow varchar(8000) \n" +
" declare @DataRow varchar(8000) \n" +
" declare @ChannelId varchar(128) \n" +
" $(declareOldKeyVariables) \n" +
" $(declareNewKeyVariables) \n" +
" if (@@TRANCOUNT > 0) begin \n" +
" execute sp_getbindtoken @TransactionId output; \n" +
" end \n" +
" $(custom_before_update_text) \n" +
" if ($(syncOnIncomingBatchCondition)) begin \n" +
" declare DeleteCursor cursor local for \n" +
" select $(oldKeys), $(oldColumns) $(oldKeyNames) from deleted where $(syncOnDeleteCondition) \n" +
" declare InsertCursor cursor local for \n" +
" $(if:containsBlobClobColumns) \n" +
" select $(columns) $(newKeyNames), $(channelExpression) from inserted inner join $(schemaName)$(tableName) $(origTableAlias) on $(tableNewPrimaryKeyJoin) where $(syncOnInsertCondition)\n" +
" $(else:containsBlobClobColumns) \n" +
" select $(columns) $(newKeyNames), $(channelExpression) from inserted where $(syncOnInsertCondition) \n" +
" $(end:containsBlobClobColumns) \n" +
" open DeleteCursor \n" +
" open InsertCursor \n" +
" fetch next from DeleteCursor into @OldPk, @OldDataRow $(oldKeyVariables) \n" +
" fetch next from InsertCursor into @DataRow $(newKeyVariables), @ChannelId \n" +
" while @@FETCH_STATUS = 0 begin \n" +
" insert into $(defaultCatalog)$(defaultSchema)$(prefixName)_data (table_name, event_type, trigger_hist_id, row_data, pk_data, old_data, channel_id, transaction_id, source_node_id, external_data, create_time) \n" +
" values('$(targetTableName)','U', $(triggerHistoryId), @DataRow, @OldPk, @OldDataRow, @ChannelId, $(txIdExpression), $(defaultCatalog)dbo.$(prefixName)_node_disabled(), $(externalSelect), current_timestamp)\n" +
" fetch next from DeleteCursor into @OldPk, @OldDataRow $(oldKeyVariables) \n" +
" fetch next from InsertCursor into @DataRow $(newKeyVariables), @ChannelId \n" +
" end \n" +
" close DeleteCursor \n" +
" close InsertCursor \n" +
" deallocate DeleteCursor \n" +
" deallocate InsertCursor \n" +
" end \n" +
" $(custom_on_update_text) \n" +
" if (@NCT = 0) set nocount off \n" +
" end " );
sqlTemplates.put("deleteTriggerTemplate" ,
"create trigger $(triggerName) on $(schemaName)$(tableName) after delete as \n" +
" begin \n" +
" declare @NCT int \n" +
" set @NCT = @@OPTIONS & 512 \n" +
" set nocount on; \n" +
" declare @TransactionId varchar(1000) \n" +
" declare @OldPk varchar(2000) \n" +
" declare @OldDataRow varchar(8000) \n" +
" declare @ChannelId varchar(128) \n" +
" $(declareOldKeyVariables) \n" +
" if (@@TRANCOUNT > 0) begin \n" +
" execute sp_getbindtoken @TransactionId output; \n" +
" end \n" +
" $(custom_before_delete_text) \n" +
" if ($(syncOnIncomingBatchCondition)) begin \n" +
" declare DataCursor cursor local for \n" +
" select $(oldKeys), $(oldColumns) $(oldKeyNames), $(channelExpression) from deleted where $(syncOnDeleteCondition) \n" +
" open DataCursor \n" +
" fetch next from DataCursor into @OldPk, @OldDataRow $(oldKeyVariables), @ChannelId \n" +
" while @@FETCH_STATUS = 0 begin \n" +
" insert into $(defaultCatalog)$(defaultSchema)$(prefixName)_data (table_name, event_type, trigger_hist_id, pk_data, old_data, channel_id, transaction_id, source_node_id, external_data, create_time) \n" +
" values('$(targetTableName)','D', $(triggerHistoryId), @OldPk, @OldDataRow, @ChannelId, $(txIdExpression), $(defaultCatalog)dbo.$(prefixName)_node_disabled(), $(externalSelect), current_timestamp)\n" +
" fetch next from DataCursor into @OldPk,@OldDataRow $(oldKeyVariables), @ChannelId \n" +
" end \n" +
" close DataCursor \n" +
" deallocate DataCursor \n" +
" end \n" +
" $(custom_on_delete_text) \n" +
" if (@NCT = 0) set nocount off \n" +
" end " );
sqlTemplates.put("initialLoadSqlTemplate" ,
"select $(columns) from $(schemaName)$(tableName) t where $(whereClause) " );
}
}
| [
"1075876205@qq.com"
] | 1075876205@qq.com |
05489ee887735cca08f6bb96e5ee84ffe3984dbe | c327d6b01dd89c310e0bf71d0db4904054089835 | /app06-zuulGame/CommandWords.java | 81940aa78d261c6ff821cb2e1223fe5cc2460723 | [] | no_license | jimmywlee/phill_horrocks-bluej-apps | a2b38cbc09d925449add98bb77594d2b04101c8a | f5568473a8e197065588f7b3ddad605484a0ee5f | refs/heads/master | 2023-02-21T22:06:43.082174 | 2021-01-23T22:56:37 | 2021-01-23T22:56:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,990 | java | import java.util.HashMap;
/**
* This class is part of the "World of Zuul" application.
* "World of Zuul" is a very simple, text based adventure game.
*
* This class holds an enumeration of all command words known to the game.
* It is used to recognise commands as they are typed in.
*
* @author Michael Kölling and David J. Barnes
* @version 2016.02.29
*
* Modified by Phill Horrocks
*/
public class CommandWords
{
// A mapping between a command word and the CommandWord
// associated with it.
private HashMap<String, CommandWord> validCommands;
/**
* Constructor - initialise the command words.
*/
public CommandWords()
{
validCommands = new HashMap<>();
for(CommandWord command : CommandWord.values())
{
if(command != CommandWord.UNKNOWN)
{
validCommands.put(command.toString(), command);
}
}
}
/**
* Find the CommandWord associated with a command word.
* @param commandWord The word to look up.
* @return The CommandWord correspondng to commandWord, or UNKNOWN
* if it is not a valid command word.
*/
public CommandWord getCommandWord(String commandWord)
{
CommandWord command = validCommands.get(commandWord);
if(command != null)
{
return command;
}
else
{
return CommandWord.UNKNOWN;
}
}
/**
* Check whether a given String is a valid command word.
* @return true if it is, false if it isn't.
*/
public boolean isCommand(String aString)
{
return validCommands.containsKey(aString);
}
/**
* Print all valid commands to System.out.
*/
public void showAll()
{
for(String command : validCommands.keySet())
{
System.out.print(command + " ");
}
System.out.println();
}
}
| [
"eighteentee@users.noreply.github.com"
] | eighteentee@users.noreply.github.com |
e48e301d7f751d62e1d9dd6ee6b7ff10dbd631b1 | c9ef4d210804b23c95454eb7eb43f14c4c5152b5 | /src/main/java/cn/sunline/demo/service/TGoodPromotionService.java | 94862d5bbf53621dbbeebd03cfb91ab453a85b01 | [] | no_license | Nonzerosum1/mall-server | 29eba27eea8321206f82a24326db638bc838c49f | 759e1034c09df6448748b63292fc1db665d33e7d | refs/heads/master | 2020-07-22T12:37:04.059016 | 2019-09-09T03:23:10 | 2019-09-09T03:23:10 | 207,204,933 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 493 | java | package cn.sunline.demo.service;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import cn.sunline.demo.entity.TGoodPromotion;
import cn.sunline.demo.mapper.*;
@Service("tGoodPromotionService")
public class TGoodPromotionService extends BaseService<TGoodPromotion,String> {
@Autowired
private TGoodPromotionMapper tGoodPromotionMapper;
public BaseMapper<TGoodPromotion,String> getMapper() {
return tGoodPromotionMapper;
}
}
| [
"fuxiangquan@sunline.cn"
] | fuxiangquan@sunline.cn |
a790180161cb286406379f0cb8829cbcf2d786a0 | f09e549c92dfebe1fb467575916ed56e6a6e327e | /snap/src/main/java/org/snapscript/core/function/bind/FunctionMatcher.java | 2aceb48098fe6373451731c122c838f10a4740c0 | [] | no_license | karino2/FileScripting | 10e2ff7f5d688a7a107d01f1b36936c00bc4d6ad | 4790830a22c2effacaaff6b109ced57cb6a5a230 | refs/heads/master | 2021-04-27T19:28:23.138720 | 2018-05-04T11:09:18 | 2018-05-04T11:09:18 | 122,357,523 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,368 | java | package org.snapscript.core.function.bind;
import org.snapscript.common.Cache;
import org.snapscript.common.CopyOnWriteCache;
import org.snapscript.core.scope.Scope;
import org.snapscript.core.type.Type;
import org.snapscript.core.constraint.Constraint;
import org.snapscript.core.error.ErrorHandler;
import org.snapscript.core.function.dispatch.EmptyDispatcher;
import org.snapscript.core.function.dispatch.FunctionDispatcher;
import org.snapscript.core.function.dispatch.FunctionDispatcherBuilder;
import org.snapscript.core.function.dispatch.LocalDispatcher;
import org.snapscript.core.function.dispatch.TypeLocalDispatcher;
import org.snapscript.core.function.resolve.FunctionResolver;
public class FunctionMatcher {
private final Cache<Class, FunctionDispatcher> cache;
private final FunctionDispatcherBuilder builder;
private final FunctionDispatcher instance;
private final FunctionDispatcher local;
private final FunctionDispatcher empty;
public FunctionMatcher(FunctionResolver resolver, ErrorHandler handler, String name) {
this.builder = new FunctionDispatcherBuilder(resolver, handler, name);
this.cache = new CopyOnWriteCache<Class, FunctionDispatcher>();
this.instance = new TypeLocalDispatcher(resolver, handler, name);
this.local = new LocalDispatcher(resolver, handler, name);
this.empty = new EmptyDispatcher();
}
public FunctionDispatcher match(Scope scope) throws Exception {
Type type = scope.getType();
if(type != null) {
return instance;
}
return local;
}
public FunctionDispatcher match(Scope scope, Constraint left) throws Exception {
Type type = left.getType(scope);
if(type != null) {
return builder.create(scope, left);
}
return empty;
}
public FunctionDispatcher match(Scope scope, Object left) throws Exception {
Type type = scope.getType();
if(left != null) {
Class key = left.getClass();
FunctionDispatcher dispatcher = cache.fetch(key); // key seems wrong?
if(dispatcher == null) {
dispatcher = builder.create(scope, key);
cache.cache(key, dispatcher);
}
return dispatcher;
}
if(type != null) {
return instance;
}
return local;
}
} | [
"hogeika2@gmailcom"
] | hogeika2@gmailcom |
d65f66821db40b370bef5aee81e67e9b7540c382 | 46b966957ad0525ae4702e98703cbb577d44fe95 | /protocols/netconf/api/src/main/java/org/onosproject/netconf/rpc/RpcResponseType.java | edcf940e23c1c2186c56fc21c96ed84159142e08 | [
"Apache-2.0"
] | permissive | opennetworkinglab/onos | 766f27f30ad447d785281e6d2ecd1c079cf03311 | dd5172e5a6e1ba5c7e17e2f497aa8c27a1ed33e9 | refs/heads/master | 2023-06-10T15:01:27.277864 | 2022-03-04T15:03:35 | 2022-08-23T00:19:05 | 27,523,092 | 1,244 | 974 | Apache-2.0 | 2023-04-01T21:34:32 | 2014-12-04T04:32:00 | Java | UTF-8 | Java | false | false | 1,354 | java | /*
* Copyright 2018-present Open Networking Foundation
*
* 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.
*/
// CHECKSTYLE:OFF
package org.onosproject.netconf.rpc;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for rpcResponseType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="rpcResponseType">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "rpcResponseType")
public class RpcResponseType {
}
| [
"y-higuchi@ak.jp.nec.com"
] | y-higuchi@ak.jp.nec.com |
4d718cbbfc1e09bb33507e7525ba729d00e5320b | 611a22efe722c339e5fff3f158eca73cd4aee97b | /org/w3c/css/properties/css/CssMarginLeft.java | 015a437d8fe492bf22a1f1dbeb89daaf83b984e6 | [
"W3C-20150513",
"W3C"
] | permissive | takeratta/css-validator | c624623622f786da8a822e3d286e4413fcc12a25 | 9cb3b44ee6aa1549d6104f26e6550b7bcb079609 | refs/heads/master | 2021-05-14T14:29:15.384560 | 2017-12-29T10:10:04 | 2017-12-29T10:10:04 | 115,971,996 | 0 | 0 | NOASSERTION | 2019-07-29T09:11:39 | 2018-01-02T03:45:16 | Java | UTF-8 | Java | false | false | 3,011 | java | // $Id$
// Author: Yves Lafon <ylafon@w3.org>
//
// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css;
import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.Css1Style;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssValue;
/**
* @since CSS1
*/
public class CssMarginLeft extends CssProperty {
public CssValue value;
/**
* Create a new CssMarginLeft
*/
public CssMarginLeft() {
}
/**
* Set the value of the property<br/>
* Does not check the number of values
*
* @param expression The expression for this property
* @throws org.w3c.css.util.InvalidParamException
* The expression is incorrect
*/
public CssMarginLeft(ApplContext ac, CssExpression expression)
throws InvalidParamException {
this(ac, expression, false);
}
/**
* Set the value of the property
*
* @param expression The expression for this property
* @param check set it to true to check the number of values
* @throws org.w3c.css.util.InvalidParamException
* The expression is incorrect
*/
public CssMarginLeft(ApplContext ac, CssExpression expression,
boolean check) throws InvalidParamException {
throw new InvalidParamException("unrecognize", ac);
}
/**
* Returns the value of this property
*/
public Object get() {
return value;
}
/**
* Returns the name of this property
*/
public final String getPropertyName() {
return "margin-left";
}
/**
* Returns a string representation of the object.
*/
public String toString() {
return value.toString();
}
/**
* Returns true if this property is "softly" inherited
* e.g. his value is equals to inherit
*/
public boolean isSoftlyInherited() {
return inherit == value;
}
/**
* Add this property to the CssStyle
*
* @param style The CssStyle
*/
public void addToStyle(ApplContext ac, CssStyle style) {
CssMargin cssMargin = ((Css1Style) style).cssMargin;
if (cssMargin.marginLeft != null) {
style.addRedefinitionWarning(ac, this);
}
cssMargin.marginLeft = this;
}
/**
* Get this property in the style.
*
* @param style The style where the property is
* @param resolve if true, resolve the style to find this property
*/
public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
if (resolve) {
return ((Css1Style) style).getMarginLeft();
} else {
return ((Css1Style) style).cssMargin.marginLeft;
}
}
/**
* Compares two properties for equality.
*
* @param property The other property.
*/
public boolean equals(CssProperty property) {
try {
CssMarginLeft other = (CssMarginLeft) property;
return (value != null && value.equals(other.value)) || (value == null && other.value == null);
} catch (ClassCastException cce) {
return false; // FIXME
}
}
}
| [
"ylafon@w3.org"
] | ylafon@w3.org |
a3bafb6b0101b0407ad83f5074fe3e0630701fba | 6d0ff37e19db6e2279e62ea997dae49131202bae | /inner_classes/src/de/smits_net/tpe/innere/local/LocalBeispiel.java | 3cdbe1c3e781098fd63f0f61aca5873799fa2011 | [
"MIT"
] | permissive | isabel/tpe_examples | 0e977a4a6e8d89b4fc7283ce708c07f203182658 | 027233a339695019ef77e5b8cbd26347de45a731 | refs/heads/master | 2016-09-02T00:49:39.491429 | 2013-11-03T09:05:26 | 2013-11-03T09:05:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 374 | java | /* (c) 2011 Thomas Smits */
package de.smits_net.tpe.innere.local;
public class LocalBeispiel {
public static void main(String[] args) {
class LocalClass {
public String toString() {
return "Ich bin lokal";
}
}
LocalClass local = new LocalClass();
System.out.println(local.toString());
}
}
| [
"thomsmits@googlemail.com"
] | thomsmits@googlemail.com |
daf3bba45d33d27378a7e8257f5624f87d7fc543 | 5419f3361c3c5ca43526756652e3004969e22d3f | /src/main/java/com/example/demo/model/GeoPoint.java | 9e3f1f0e948769708c1c09defc852f0ada6b362a | [
"Apache-2.0"
] | permissive | ipeonte/DistanceMatrixApiDemo | 2e9dae3d224cae2ee797d47e95ced2c4088f8046 | 04888fcf948720441118e5f69fb91793d62bb2fd | refs/heads/main | 2023-03-28T02:24:22.413434 | 2021-03-28T07:14:55 | 2021-03-28T07:14:55 | 352,262,078 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 747 | java | /**
*
*/
package com.example.demo.model;
/**
* Model for single Geo Point
*/
public class GeoPoint {
private final double latitude;
private final double longitude;
public GeoPoint(double latitude, double longitude) {
this.latitude = latitude;
this.longitude = longitude;
}
public double getLatitude() {
return latitude;
}
public double getLongitude() {
return longitude;
}
/**
* Flat coordinates into simple string array
*
* @return simple string array with [latitude,longitude]
*/
public String flat() {
return latitude + "," + longitude;
}
@Override
public String toString() {
return "latitude: " + getLatitude() + "; longitude: " + getLongitude() +
";";
}
}
| [
"igor.144@gmail.com"
] | igor.144@gmail.com |
3b47d3c474c60057f7867c418a9c9ea5918a628f | f2c2edf84aaf3bd5056c752ee88cd29fb5ea17da | /HBProj28-HBGenerators/src/com/nt/test/GeneratorsTest3_HILOBatch.java | 1032de14ff571ef1b8e797c03954820c7ad0ee90 | [] | no_license | nerdseeker365/NTHB41 | 4e56ae72af17be03f849e63d398b247b01308718 | 97a2431c49a340f2ec4ed7d3bd54605ac8cc4474 | refs/heads/master | 2022-02-27T06:27:51.892119 | 2019-10-30T10:31:50 | 2019-10-30T10:31:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,202 | java | package com.nt.test;
import org.hibernate.Session;
import org.hibernate.Transaction;
import com.nt.entity.Employee;
import com.nt.utility.HibernateUtil;
public class GeneratorsTest3_HILOBatch {
public static void main(String[] args) {
Session ses=null;
Transaction tx=null;
boolean flag=false;
Employee emp=null;
int idVal=0;
//get Session
ses=HibernateUtil.getSession();
try {
tx=ses.beginTransaction();
//prpeare objects
for(int i=1;i<=10;++i) {
emp=new Employee();
emp.setEno(9089); emp.setEname("rajesh");
emp.setDesg("CLERK"); emp.setSalary(9000);
idVal=(int) ses.save(emp);
System.out.println("Generated id values::"+idVal);
flag=true;
}//for
/*
* System.out.println("Going to sleep state.."); Thread.sleep(30000);
*/
}
catch(Exception e) {
e.printStackTrace();
flag=false;
}
finally {
if(flag) {
tx.commit();
System.out.println("Object is saved");
}
else {
tx.rollback();
System.out.println("Object is not saved");
}
//close objs
HibernateUtil.closeSession(ses);
HibernateUtil.closeSessionFactory();
}//finally
}//main
}//class
| [
"admin@DESKTOP-8KUS3QR"
] | admin@DESKTOP-8KUS3QR |
d39620302b1d830c917a2bada5c6e0d146341106 | 2b28665f5da3775cdb0ed1f211efc06449c3f99b | /experiment/src/Commands/Update.java | 6d5deccce21d14413fa19478453ab6602b719988 | [] | no_license | MichaelsAkk/Lab6 | 9f6b2905feb9aab6b2345b70722bd238e0ef9262 | f01baaee81a86ddec0e569510068e99901e19cde | refs/heads/master | 2022-11-14T03:24:46.713504 | 2020-07-08T15:46:52 | 2020-07-08T15:46:52 | 278,129,572 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 17,944 | java | package Commands;
import Classes.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Serializable;
import java.util.HashSet;
public class Update implements Serializable {
private transient HashSet<Flat> flats;
private transient Flat flat;
private Integer elementId;
private String info;
private String name;
private Integer x;
private Integer y;
private Float area;
private int numberOfRooms;
private boolean new1;
private View view;
private Transport transport;
private String houseName;
private Integer year;
private long numberOfFlatsOnFloor;
private long numberOfLifts;
private int creationYear;
public Update () {
this.info = null;
}
public Update (HashSet<Flat> flats, Integer elementId) {
this.flats = flats;
this.elementId = elementId;
this.info = null;
}
public Update(Integer id) {
this.info = null;
this.elementId = id;
}
public void setFlats(HashSet<Flat> flats) {
this.flats = flats;
}
public String getInfo() {
return this.info;
}
public String getName() {
return this.name;
}
public void execute() {
if (flats != null) {
for (Flat f : flats) {
if (f.getId().toString().equalsIgnoreCase(elementId.toString())) {
flat = f;
break;
}
}
}
flat.setName(name); flat.setCoordinates(new Coordinates(x,y));
flat.setArea(area); flat.setNumberOfRooms(numberOfRooms);
flat.setNew(new1); flat.setView(view); flat.setTransport(transport);
flat.setHouse(new House(houseName, year, numberOfFlatsOnFloor, numberOfLifts));
flat = null; flats = null;
info = "Элемент успешно обновлен";
}
public void check() {
int control = 0;
if (flats != null) {
for (Flat f : flats) {
if (f.getId().toString().equalsIgnoreCase(elementId.toString())) {
control = 1;
flat = f;
break;
}
}
}
if (control == 0) {
info = "Элемента с данным id не существует в коллекции";
} else {
name = flat.getName(); x = flat.getCoordinates().getX();
y = flat.getCoordinates().getY(); area = flat.getArea();
numberOfRooms = flat.getNumberOfRooms(); new1 = flat.getNew();
view = flat.getView(); transport = flat.getTransport();
houseName = flat.getHouse().getName(); year = flat.getHouse().getYear();
numberOfFlatsOnFloor = flat.getHouse().getNumberOfFlatsOnFloor();
numberOfLifts = flat.getHouse().getNumberOfLifts();
creationYear = flat.getCreationDate().getYear();
flat = null; flats = null;
info = "+";
}
}
public int fieldsUpdate() throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String result;
String name = null;
Integer x = null;
Integer y = null;
Integer houseYear = -1;
String houseName = null;
View view = null;
Transport transport = null;
Float area = -1.0f;
int numberOfRooms = -1;
boolean new1 = false;
long numberOfFlatsOnFloor = -1;
long numberOfLifts = -1;
System.out.println("Если для данного поля не требуется обновление, введите \"-\"");
int control = 0;
while (control==0) {
System.out.print("Name (" + this.name + "): ");
result = reader.readLine();
if (result.equalsIgnoreCase("null")) {
System.out.println("Ошибка ввода: поле \"name\" содержит null");
} else if (result.equalsIgnoreCase("")) {
System.out.println("Ошибка ввода: поле \"name\" не может быть пустым");
} else if (result.equalsIgnoreCase("-")) {
name = this.name; control++;
} else { name = result; control++; }
}
System.out.println("Coordinates:");
control = 0;
while (control==0) {
System.out.print("X (" + this.x + "): ");
try {
result = reader.readLine();
if (result.equalsIgnoreCase("null") || result.equalsIgnoreCase("")) {
System.out.println("Ошибка ввода: поле \"x\" содержит null");
} else if (result.equalsIgnoreCase("-")) {
x = this.x; control++;
} else {
x = Integer.parseInt(result);
if (x <= -474) {
System.out.println("Ошибка ввода: поле \"x\" должно быть больше -474");
}
else control++;
}
} catch (NumberFormatException e) {
System.out.println("Ошибка ввода: поле \"x\" не является целым числом");
} catch (IOException e) {
System.out.println("Ошибка ввода");
}
}
control = 0;
while (control==0) {
System.out.print("Y (" + this.y + "): ");
try {
result = reader.readLine();
if (result.equalsIgnoreCase("null") || result.equalsIgnoreCase("")) {
System.out.println("Ошибка ввода: поле \"y\" содержит null");
} else if (result.equalsIgnoreCase("-")) {
y = this.y; control++;
} else {
y = Integer.parseInt(result);
control++;
}
} catch (NumberFormatException e) {
System.out.println("Ошибка ввода: поле \"y\" не является целым числом");
} catch (IOException e) {
System.out.println("Ошибка ввода");
}
}
control = 0;
while (control==0) {
System.out.print("Area (" + this.area + "): ");
try {
result = reader.readLine();
if (result.equalsIgnoreCase("null") || result.equalsIgnoreCase("")) {
System.out.println("Ошибка ввода: поле \"area\" содержит null");
} else if (result.equalsIgnoreCase("-")) {
area = this.area;
control++;
}
else {
area = Float.parseFloat(result);
if (area <= 0) {
System.out.println("Ошибка ввода: поле \"area\" должно быть больше 0");
}
else control++;
}
} catch (NumberFormatException e) {
System.out.println("Ошибка ввода: поле \"area\" должно быть числом (дробная часть указывается после символа \".\")");
} catch (IOException e) {
System.out.println("Ошибка ввода");
}
}
control = 0;
while (control==0) {
System.out.print("numberOfRooms (" + this.numberOfRooms + "): ");
try {
result = reader.readLine();
if (result.equalsIgnoreCase("-")) { numberOfRooms = this.numberOfRooms; control++; }
else {
numberOfRooms = Integer.parseInt(result);
if (numberOfRooms <= 0) {
System.out.println("Ошибка ввода: поле \"numberOfRooms\" должно быть целым положительным числом");
}
else control++;
}
} catch (NumberFormatException e) {
System.out.println("Ошибка ввода: поле \"numberOfRooms\" не является целым числом");
} catch (IOException e) {
System.out.println("Ошибка ввода");
}
}
control = 0;
while (control==0) {
System.out.print("New? (" + this.new1 + "): ");
try {
result = reader.readLine();
if (result.equalsIgnoreCase("-")) { new1 = this.new1; control++; }
else if (!result.equalsIgnoreCase("true") && !result.equalsIgnoreCase("false")) {
System.out.println("Ошибка ввода: поле \"new\" должно быть либо \"true\", либо \"false\" ");
} else {
if (result.equalsIgnoreCase("true")) new1 = true;
else new1 = false;
control++;
}
} catch (IOException e) {
System.out.println("Ошибка ввода");
}
}
control = 0;
while (control==0) {
System.out.print("View (YARD, BAD, GOOD, TERRIBLE) (" + this.view + "): ");
try {
result = reader.readLine();
if (result.equalsIgnoreCase("-")) {
view = this.view;
control++;
} else if (result.equalsIgnoreCase("null") || result.equalsIgnoreCase("")) {
System.out.println("Ошибка ввода: поле \"view\" содержит null");
} else {
view = View.valueOf(result.toUpperCase());
control++;
}
} catch (IOException e) {
System.out.println("Ошибка ввода");
} catch (IllegalArgumentException e) {
System.out.println("Ошибка ввода: поле \"view\" не содержит значение из указанного списка");
}
}
control = 0;
while (control==0) {
System.out.print("Transport (FEW, LITTLE, NORMAL, ENOUGH) (" + this.transport + "): ");
try {
result = reader.readLine();
if (result.equalsIgnoreCase("-")) { transport = this.transport; control++; }
else if (result.equalsIgnoreCase("null") || result.equalsIgnoreCase("")) { transport = null; control++; }
else {
transport = Transport.valueOf(result.toUpperCase());
control++;
}
} catch (IOException e) {
System.out.println("Ошибка ввода");
} catch (IllegalArgumentException e) {
System.out.println("Ошибка ввода: поле \"transport\" не содержит значение из указанного списка");
}
}
System.out.println("House: ");
control = 0;
while (control==0) {
System.out.print("Name (" + this.houseName + "): ");
result = reader.readLine();
if (result.equalsIgnoreCase("-")) { houseName = this.houseName; control++; }
else if (result.equalsIgnoreCase("null") || result.equalsIgnoreCase("")) {
System.out.println("Ошибка ввода: поле \"House.name\" содержит null");
} else { houseName = result; control++; }
}
control = 0;
while (control==0) {
System.out.print("Year (не более " + this.creationYear + ", т.к. это сгенерированный год для квартиры): ");
try {
result = reader.readLine();
if (result.equalsIgnoreCase("-")) { houseYear = this.year; control++; }
else if (result.equalsIgnoreCase("null") || result.equalsIgnoreCase("")) { houseYear = null; control++; }
else {
houseYear = Integer.parseInt(result);
if (houseYear <= 0) {
System.out.println("Ошибка ввода: поле \"House.year\" не является целым положительным числом");
}
if (houseYear > this.creationYear) {
System.out.println("Ошибка ввода: поле \"House.year\" должно быть не более " + this.creationYear);
}
else control++;
}
} catch (NumberFormatException e) {
System.out.println("Ошибка ввода: поле \"House.year\" не является целым числом");
} catch (IOException e) {
System.out.println("Ошибка ввода");
}
}
control = 0;
while (control==0) {
System.out.print("Number of flats on floor (" + this.numberOfFlatsOnFloor + "): ");
try {
result = reader.readLine();
if (result.equalsIgnoreCase("-")) {
numberOfFlatsOnFloor = this.numberOfFlatsOnFloor;
control++;
}
else {
numberOfFlatsOnFloor = Long.parseLong(result);
if (numberOfFlatsOnFloor <= 0) {
System.out.println("Ошибка ввода: поле \"House.NumberOfFlatsOnFloor\" не является целым положительным числом");
}
else control++;
}
} catch (NumberFormatException e) {
System.out.println("Ошибка ввода: поле \"House.NumberOfFlatsOnFloor\" не является целым числом");
} catch (IOException e) {
System.out.println("Ошибка ввода");
}
}
control = 0;
while (control==0) {
System.out.print("Number of lifts (" + this.numberOfLifts + "): ");
try {
result = reader.readLine();
if (result.equalsIgnoreCase("-")) {
numberOfLifts = this.numberOfLifts;
control++;
}
else {
numberOfLifts = Long.parseLong(result);
if (numberOfLifts <= 0) {
System.out.println("Ошибка ввода: поле \"House.NumberOfLifts\" не является целым положительным числом");
}
else control++;
}
} catch (NumberFormatException e) {
System.out.println("Ошибка ввода: поле \"House.NumberOfLifts\" не является целым числом");
} catch (IOException e) {
System.out.println("Ошибка ввода");
}
}
if (name != null && x != null && y != null && area != -1.0f &&
numberOfRooms != -1 && view != null && houseName != null &&
numberOfFlatsOnFloor != -1 && numberOfLifts != -1) {
this.name = name; this.x = x; this.y = y; this.area = area;
this.numberOfRooms = numberOfRooms; this.new1 = new1; this.view = view;
this.transport = transport;
this.houseName = houseName; this.year = houseYear;
this.numberOfFlatsOnFloor = numberOfFlatsOnFloor;
this.numberOfLifts = numberOfLifts;
}
return 1;
}
public String toStrings() {
return "update " + elementId + " (name: "+name+"; coordinates: (x: "+x+"; y:"+y+"); area: "+area+"; " +
"number of rooms: "+numberOfRooms+"; new: "+new1+"; view: "+view+"; " +
"transport: "+transport+"; house: (name: "+houseName+"; year: "+year+"; " +
"number of flats on floor: "+numberOfFlatsOnFloor+"; " +
"number of lifts: "+numberOfLifts+"))";
}
public String toStringsNoArguments() {
return "update " + elementId;
}
}
| [
"noreply@github.com"
] | MichaelsAkk.noreply@github.com |
888157904e1ba46859ba9ff7a970063a53f6d2e0 | c19924a2d6525a1cf3d71baeb230f830f17d20ee | /org.eclipse.emf.henshin.interpreter/src/org/eclipse/emf/henshin/interpreter/matching/conditions/AttributeCondition.java | 9e66332189af2ab9f18cc5efa0a66f207b5726ea | [] | no_license | dstrueber/varhenshin | 4d0559d5ff25df09f5e9a38861ec5f54a0d65e8b | bdf2fcd789ccdcad0778a4b5f445830ba631eca1 | refs/heads/master | 2020-05-31T23:22:20.362131 | 2015-08-13T13:24:47 | 2015-08-13T13:24:47 | 29,862,705 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,819 | java | /**
* <copyright>
* Copyright (c) 2010-2012 Henshin developers. All rights reserved.
* This program and the accompanying materials are made available
* under the terms of the Eclipse Public License v1.0 which
* accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
* </copyright>
*/
package org.eclipse.emf.henshin.interpreter.matching.conditions;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
import javax.script.ScriptEngine;
import javax.script.ScriptException;
/**
* Attribute condition.
*
* @author Enrico Biermann, Christian Krause
*/
public class AttributeCondition {
// Condition text:
public final String conditionText;
// Collection of parameters used in the conditionText which are not set yet.
public final Set<String> parameters;
// Script engine:
final ScriptEngine scriptEngine;
/**
* Default constructor.
* @param condition String representation of the condition.
* @param conditionParameters Condition parameters.
* @param engine Script engine.
*/
public AttributeCondition(String condition, Collection<String> conditionParameters,
ScriptEngine engine) {
this.conditionText = condition;
this.parameters = new HashSet<String>(conditionParameters);
this.scriptEngine = engine;
}
/**
* Evaluates the conditionText if there are no more outstanding parameters.
* @return the result of the evaluation.
*/
public boolean eval() {
if (parameters.isEmpty()) {
try {
return (Boolean) scriptEngine.eval(conditionText);
} catch (ScriptException ex) {
throw new RuntimeException(ex.getMessage());
} catch (ClassCastException ex) {
throw new RuntimeException("Warning: Attribute condition did not return a boolean value");
}
}
return true;
}
}
| [
"daniel_str@gmx.de"
] | daniel_str@gmx.de |
1d900aa8eb96a72e994b7fec08a682e313a9bb92 | 90b0f2a310d19bef54afab613e1cc23fd5181d17 | /Hospital Application/src/Interface/Adminarea/ManageUserAccountJPanel.java | 190c90cff7196430453e8a1e42ef391323e49fbc | [] | no_license | VivekKumarNeu/Java-Desktop-Applications | 98a45e7beace577a5bd6834b0fcb5770ab582e23 | 4a944e5b9f6a5f8ab27e6872530a81168ad7bff2 | refs/heads/master | 2020-12-25T09:48:13.011038 | 2016-11-19T23:25:25 | 2016-11-19T23:25:25 | 63,186,035 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 14,945 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Interface.Adminarea;
import Business.Employee.Employee;
import Business.Enterprise.Enterprise;
import Business.Organization.Organization;
import Business.Role.Role;
import Business.Role.AdminRole;
import Business.Role.DonorRole;
import Business.Role.NurseRole;
import Business.Role.Receptionist;
import Business.UserAccount.UserAccount;
import java.awt.CardLayout;
import javax.swing.JPanel;
import javax.swing.table.DefaultTableModel;
/**
*
* @author Administrator
*/
public class ManageUserAccountJPanel extends javax.swing.JPanel {
/**
* Creates new form ManageUserAccountJPanel
*/
private JPanel container;
private Enterprise enterprise;
private static boolean flag=true;
public ManageUserAccountJPanel(JPanel container, Enterprise enterprise) {
initComponents();
this.enterprise = enterprise;
this.container = container;
popOrganizationComboBox();
// employeeJComboBox.removeAllItems();
popData();
}
public void popOrganizationComboBox() {
organizationJComboBox.removeAllItems();
for (Organization organization : enterprise.getOrganizationDirectory().getOrganizationList()) {
organizationJComboBox.addItem(organization);
}
}
public void populateEmployeeComboBox(Organization organization){
employeeJComboBox.removeAllItems();
for (Employee employee : organization.getEmployeeDirectory().getEmployeeList()){
employeeJComboBox.addItem(employee);
}
}
private void populateRoleComboBox(Organization organization){
roleJComboBox.removeAllItems();
for (Role role : organization.getSupportedRole()){
roleJComboBox.addItem(role);
}
}
public void popData() {
DefaultTableModel model = (DefaultTableModel) userJTable.getModel();
model.setRowCount(0);
for (Organization organization : enterprise.getOrganizationDirectory().getOrganizationList()) {
for (UserAccount ua : organization.getUserAccountDirectory().getUserAccountList()) {
Object row[] = new Object[2];
row[0] = ua;
row[1] = ua.getRole();
((DefaultTableModel) userJTable.getModel()).addRow(row);
}
}
}
/**
* 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() {
createUserJButton = new javax.swing.JButton();
nameJTextField = new javax.swing.JTextField();
jLabel1 = new javax.swing.JLabel();
jScrollPane1 = new javax.swing.JScrollPane();
userJTable = new javax.swing.JTable();
jLabel2 = new javax.swing.JLabel();
passwordJTextField = new javax.swing.JTextField();
jLabel3 = new javax.swing.JLabel();
employeeJComboBox = new javax.swing.JComboBox();
backjButton1 = new javax.swing.JButton();
jLabel5 = new javax.swing.JLabel();
organizationJComboBox = new javax.swing.JComboBox();
jLabel4 = new javax.swing.JLabel();
roleJComboBox = new javax.swing.JComboBox();
createUserJButton.setText("Create");
createUserJButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
createUserJButtonActionPerformed(evt);
}
});
jLabel1.setText("User Name");
userJTable.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
},
new String [] {
"User Name", "Role"
}
) {
Class[] types = new Class [] {
java.lang.String.class, java.lang.String.class
};
boolean[] canEdit = new boolean [] {
true, false
};
public Class getColumnClass(int columnIndex) {
return types [columnIndex];
}
public boolean isCellEditable(int rowIndex, int columnIndex) {
return canEdit [columnIndex];
}
});
jScrollPane1.setViewportView(userJTable);
if (userJTable.getColumnModel().getColumnCount() > 0) {
userJTable.getColumnModel().getColumn(0).setResizable(false);
userJTable.getColumnModel().getColumn(1).setResizable(false);
}
jLabel2.setText("Password");
jLabel3.setText("Employee");
employeeJComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
backjButton1.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
backjButton1.setText("<< Back");
backjButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
backjButton1ActionPerformed(evt);
}
});
jLabel5.setText("Organization");
organizationJComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
organizationJComboBox.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
organizationJComboBoxActionPerformed(evt);
}
});
jLabel4.setText("Role");
roleJComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(106, 106, 106)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel3)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 375, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(employeeJComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 146, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(214, 214, 214))))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel5)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(organizationJComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 146, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel2)
.addComponent(jLabel1))
.addComponent(jLabel4))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(roleJComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 146, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(nameJTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 146, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(passwordJTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 146, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addGap(0, 0, Short.MAX_VALUE))))
.addGroup(layout.createSequentialGroup()
.addGap(66, 66, 66)
.addComponent(backjButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 112, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(205, 205, 205)
.addComponent(createUserJButton)))
.addContainerGap(152, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(28, 28, 28)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 179, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(30, 30, 30)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel5)
.addComponent(organizationJComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel3)
.addComponent(employeeJComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 22, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel4)
.addComponent(roleJComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(nameJTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(passwordJTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(backjButton1)
.addGap(24, 24, 24))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(createUserJButton)
.addGap(44, 44, 44))))
);
}// </editor-fold>//GEN-END:initComponents
private void createUserJButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_createUserJButtonActionPerformed
String userName = nameJTextField.getText();
String password = passwordJTextField.getText();
Organization organization = (Organization) organizationJComboBox.getSelectedItem();
Employee employee = (Employee) employeeJComboBox.getSelectedItem();
Role role = (Role) roleJComboBox.getSelectedItem();
organization.getUserAccountDirectory().createUserAccount(userName, password, employee, role);
popData();
}//GEN-LAST:event_createUserJButtonActionPerformed
private void backjButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_backjButton1ActionPerformed
// TODO add your handling code here:
container.remove(this);
CardLayout layout = (CardLayout) container.getLayout();
layout.previous(container);
}//GEN-LAST:event_backjButton1ActionPerformed
private void organizationJComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_organizationJComboBoxActionPerformed
Organization organization = (Organization) organizationJComboBox.getSelectedItem();
if (organization != null){
populateEmployeeComboBox(organization);
populateRoleComboBox(organization);
}
}//GEN-LAST:event_organizationJComboBoxActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton backjButton1;
private javax.swing.JButton createUserJButton;
private javax.swing.JComboBox employeeJComboBox;
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.JScrollPane jScrollPane1;
private javax.swing.JTextField nameJTextField;
private javax.swing.JComboBox organizationJComboBox;
private javax.swing.JTextField passwordJTextField;
private javax.swing.JComboBox roleJComboBox;
private javax.swing.JTable userJTable;
// End of variables declaration//GEN-END:variables
}
| [
"Kumar.vi@husky.neu.edu"
] | Kumar.vi@husky.neu.edu |
348e822fd8286c09d3c33ef98a499837f2eeaf08 | ae379672853fb8a3a5d3310ce5f0de72bf5677c1 | /CompSci 223 - Data Structures/Project1 - Shape Manipulation/src/Program/Program.java | 2a0749aa4a7426a9809ac0736c34de7b37f8140e | [] | no_license | NickBolles/School-Projects | 994278c9b2c1fdd66962f0351d3ea6b75c693423 | d36d32c64b54cf2caca9bda92862e076574cc32d | refs/heads/master | 2016-08-12T16:04:01.345746 | 2015-11-12T23:28:18 | 2015-11-12T23:28:18 | 43,903,230 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 16,827 | 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 Program;
import java.util.ArrayList;
import java.util.Iterator;
/**
*
* @author Nicholas
*/
public class Program {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// Rectangle test = new Rectangle(new Point(0,10), new Point(10,0));
// System.out.println(test.getUpperLeft().toString());
// System.out.println(test.getLowerRight().toString());
// test.getUpperLeft().setX(9);
// test.getLowerRight().setY(9);
// System.out.println(test.getUpperLeft().toString());
// System.out.println(test.getLowerRight().toString());
ArrayList<Shape> Shapes = new ArrayList<Shape>();
//For Debugging and testing populate the shapes
populateShapes(Shapes);
boolean quit = false;
while (!quit){
System.out.println("=================================");
System.out.println("What would you like to do?");
System.out.println("1) Add A Shape");
System.out.println("2) Update a Shape");
System.out.println("3) Remove a Shape");
System.out.println("4) List all Shapes");
System.out.println("5) List all polygon Shapes");
System.out.println("6) List all non-polygon Shapes");
System.out.println("7) Display Total Perimeter of Shapes");
System.out.println("8) Display Total Area of Shapes");
System.out.println("9) Throw a Dart");
System.out.println("10) Exit");
boolean valid = false;
while(!valid){
int input = Utils.promptForInt();
switch(input){
case 1:
createNewShape(Shapes);
valid = true;
break;
case 2:
updateShape(Shapes);
valid = true;
break;
case 3:
removeShape(Shapes);
valid = true;
break;
case 4:
listShapes(Shapes,true,true);
valid = true;
break;
case 5:
listShapes(Shapes,true,false);
valid = true;
break;
case 6:
listShapes(Shapes,false,true);
valid = true;
break;
case 7:
totalPetimeter(Shapes);
valid = true;
break;
case 8:
totalArea(Shapes);
valid = true;
break;
case 9:
throwDart(Shapes);
valid = true;
break;
case 10:
quit = true;
// System.out.println("Would you like to Save the shapes?");
// if (Utils.promptForBoolean()){
// saveShapes(Shapes);
// }
System.out.println("Exiting Program...");
valid = true;
break;
default:
valid = false;
System.out.println("Error: Invalid Entry. Try Again");
break;
}
}
}
System.out.println("Made By Nick Bolles on 2/4/2015 for UW Whitewater Class CompSci 223 \"Data Structures\"");
}
public static void populateShapes(ArrayList<Shape> Shapes){
Shapes.add(new Circle(new Point(10.0,10.0),6.3));
Shapes.add(new Rectangle(new Point(5,15), new Point(15,10)));
Shapes.add(new Square(new Point(0,5), new Point(5,0)));
Shapes.add(new Triangle(new Point(0,0), new Point(3,2),new Point(2,5)));
}
public static void createNewShape(ArrayList<Shape> Shapes){
System.out.println("What Type of Shape Would you Like to create?");
System.out.println("0) Cancel");
System.out.println("1) Circle");
System.out.println("2) Rectangle");
System.out.println("3) Square");
System.out.println("4) Triangle");
boolean valid = false;
while (!valid){
int selection = Utils.promptForInt();
switch(selection){
case 0:
System.out.println("Canceling create new Shape...");
valid = true;
break;
case 1:
System.out.println("Adding a Circle...");
System.out.println("Enter Center Point: x y");
double[] coords = Utils.promptForPoint(false);
System.out.println("Enter Radius: ");
double radius = Utils.promptForDouble();
Shapes.add(new Circle(new Point(coords[0],coords[1]), radius));
System.out.println("Circle Added!");
valid = true;
break;
case 2:
System.out.println("Adding a Rectangle...");
System.out.println("Enter Upper Left Point: x y");
double[] upperLeft = Utils.promptForPoint(false);
System.out.println("Enter Lower Right Point: x y");
double[] lowerRight = Utils.promptForPoint(false);
try{
Shapes.add(new Rectangle(new Point(upperLeft[0],upperLeft[1]), new Point(lowerRight[0],lowerRight[1])));
System.out.println("Rectangle Added!");
valid = true;
}catch(InvalidArgumentException e){
System.out.println("Error: Invalid Arguments to create Rectangle: " + new Point(upperLeft[0],upperLeft[1]).toString() + " " + new Point(lowerRight[0],lowerRight[1]).toString());
}
break;
case 3:
System.out.println("Adding a Square...");
System.out.println("Enter Upper Left Point: x y");
double[] ul = Utils.promptForPoint(false);
System.out.println("Enter Lower Right Point: x y");
double[] lr = Utils.promptForPoint(false);
try{
Shapes.add(new Square(new Point(ul[0],ul[1]), new Point(lr[0],lr[1])));
System.out.println("Square Added!");
valid = true;
}catch(InvalidArgumentException e){
System.out.println("Error: Invalid Arguments to create Square: " + new Point(ul[0],ul[1]).toString() + " " + new Point(lr[0],lr[1]).toString());
}
valid = true;
break;
case 4:
System.out.println("Adding a Triangle...");
System.out.println("Enter Point 1: x y");
double[] p1 = Utils.promptForPoint(false);
System.out.println("Enter Point 2: x y");
double[] p2 = Utils.promptForPoint(false);
System.out.println("Enter Point 3: x y");
double[] p3 = Utils.promptForPoint(false);
Shapes.add(new Triangle(new Point(p1[0],p1[1]), new Point(p2[0],p2[1]),new Point(p3[0],p3[1])));
System.out.println("Triangle Added!");
valid = true;
break;
default:
valid = false;
System.out.println("Error: Invalid Entry. Try Again");
break;
}
}
}
public static void updateShape(ArrayList<Shape> Shapes){
System.out.println("Select the Shape to Edit...");
int count =listShapes(Shapes, true, true);
while(true){
int p = Utils.promptForInt();
if (p < count){
Shape s = Shapes.get(p);
if (s instanceof Circle){
Circle c = (Circle) s;
System.out.println("Editing Circle " + c.toString() + "...");
System.out.println("Leave Blank or enter 0 for numeric values to leave the value as it was");
System.out.println("Enter Center Point: x y");
double[] center = Utils.promptForPoint(true);
System.out.println("Enter Radius: ");
double radius = Utils.promptForDouble();
if (center.length >0){
c.setCenter(new Point(center[0],center[1]));
}
if (radius != 0.0){
c.setRadius(radius);
}
System.out.println("Shape Updated to " + c.toString());
}else if(s instanceof Rectangle ){
Rectangle r = (Rectangle) s;
System.out.println("Editing Rectangle " + r.toString() + "...");
System.out.println("Leave Blank or enter 0 for numeric values to leave the value as it was");
System.out.println("Enter Upper Left Point: x y");
double[] upperLeft = Utils.promptForPoint(true);
System.out.println("Enter Lower Right Point: x y");
double[] lowerRight = Utils.promptForPoint(true);
try{
if (upperLeft.length >0){
r.setUpperLeft(new Point(upperLeft[0],upperLeft[1]));
}
if (lowerRight.length >0){
r.setLowerRight(new Point(lowerRight[0],lowerRight[1]));
}
System.out.println("Shape Updated to " + r.toString());
}catch(InvalidArgumentException e){
System.out.println("Error: Invalid Arguments to create Rectangle: " + new Point(upperLeft[0],upperLeft[1]).toString() + " " + new Point(lowerRight[0],lowerRight[1]).toString());
}
}else if (s instanceof Square){
Square sq = (Square) s;
System.out.println("Editing Rectangle " + sq.toString() + "...");
System.out.println("Leave Blank or enter 0 for numeric values to leave the value as it was");
System.out.println("Enter Upper Left Point: x y");
double[] upperLeft = Utils.promptForPoint(true);
System.out.println("Enter Lower Right Point: x y");
double[] lowerRight = Utils.promptForPoint(true);
try{
if (upperLeft.length >0){
sq.setUpperLeft(new Point(upperLeft[0],upperLeft[1]));
}
if (lowerRight.length >0){
sq.setLowerRight(new Point(lowerRight[0],lowerRight[1]));
}
System.out.println("Shape Updated to " + sq.toString());
}catch(InvalidArgumentException e){
System.out.println("Error: Invalid Arguments to create Square: " + new Point(upperLeft[0],upperLeft[1]).toString() + " " + new Point(lowerRight[0],lowerRight[1]).toString());
}
}else if(s instanceof Triangle){
Triangle t = (Triangle) s;
System.out.println("Editing Triangle " + t.toString() + "...");
System.out.println("Leave Blank or enter 0 for numeric values to leave the value as it was");
System.out.println("Enter Point 1: x y");
double[] p1 = Utils.promptForPoint(true);
System.out.println("Enter Point 2: x y");
double[] p2 = Utils.promptForPoint(true);
System.out.println("Enter Point 3: x y");
double[] p3 = Utils.promptForPoint(true);
if (p1.length >0){
t.setP1(new Point(p1[0],p1[1]));
}
if (p2.length >0){
t.setP2(new Point(p2[0],p2[1]));
}
if (p3.length >0){
t.setP3(new Point(p3[0],p3[1]));
}
System.out.println("Shape Updated to " + t.toString());
}
break;
}else{
System.out.println("Error! Invalid Input. Please Enter A number Above, or 0 to cancel");
}
}
}
public static void removeShape(ArrayList<Shape> Shapes){
System.out.println("Which Animal Would you like to delete?");
int count = listShapes(Shapes, true, true);
boolean v = false;
while (!v){
int p =Utils.promptForInt();
if (p < count){
v = true;
Shapes.remove(p-1);
System.out.println("Deleting animal " + p);
}else{
System.out.println("Error! Invalid Input. Please Enter A number Above, or 0 to cancel");
}
}
}
public static int listShapes(ArrayList<Shape> Shapes, boolean p, boolean np){
Iterator i = Shapes.iterator();
int count = 0;
while(i.hasNext()){
Shape s = (Shape) i.next();
if (p && s instanceof Polygon){
System.out.println(count + ") " + s.toString());
count++;
}
if (np && !(s instanceof Polygon)){
System.out.println(count + ") " + s.toString());
count++;
}
}
return count;
}
public static void totalPetimeter(ArrayList<Shape> Shapes){
Iterator i = Shapes.iterator();
double perimeter = 0.0;
while(i.hasNext()){
Shape s = (Shape) i.next();
try{
perimeter+=s.perimeter();
}catch(UnsupportedOperationException e){
//Just Skip this, it counts as 0
}
}
System.out.println("Perimeter of all Shapes is " +perimeter);
}
public static void totalArea(ArrayList<Shape> Shapes){
Iterator i = Shapes.iterator();
double area = 0.0;
while(i.hasNext()){
Shape s = (Shape) i.next();
try{
area+=s.area();
}catch(UnsupportedOperationException e){
//Just Skip this, it counts as 0
}
}
System.out.println("Area of all Shapes is " +area);
}
public static void throwDart(ArrayList<Shape> Shapes){
System.out.println("Where would you like to throw the dart? x y");
double[] p = Utils.promptForPoint(false);
Point point = new Point(p[0], p[1]);
int count =0;
Iterator i = Shapes.iterator();
while(i.hasNext()){
Shape s = (Shape) i.next();
try{
if (s.hit(point)){
System.out.println(s.toString());
count++;
};
}catch(UnsupportedOperationException e){
//Just Skip this, it counts as 0
}
}
System.out.println("Your Dart hit " + count + " Shapes");
}
public static void saveShapes(ArrayList<Shape> Shapes){
}
public static void loadShapes(ArrayList<Shape> Shapes){
}
}
| [
"nickbolles@live.com"
] | nickbolles@live.com |
cdb76ec75247225ddc1d2650a5a7f3057ce48914 | 3eb8a014643d54a3ac186039879bd517e63b130c | /src/main/java/indi/zqc/warehouse/dao/RoleDao.java | c1917edbdb4ad78069f115aaaafc3e53c8f7bc71 | [] | no_license | zhuqianchang/warehouse | 0a170cb58b2067581fbc8675dc95670d6dae08df | 42b475a77d7c05b3ea716e81650e2a5964536c31 | refs/heads/master | 2021-05-10T10:40:45.295602 | 2018-05-07T01:43:29 | 2018-05-07T01:43:29 | 118,389,758 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 740 | java | package indi.zqc.warehouse.dao;
import com.github.pagehelper.Page;
import indi.zqc.warehouse.model.Role;
import indi.zqc.warehouse.model.condition.RoleCondition;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Title : RoleDao.java
* Package : indi.zqc.warehouse.dao
* Description : 角色DAO
* Create on : 2018/1/26 15:07
*
* @author Zhu.Qianchang
* @version v1.0.0
*/
public interface RoleDao {
int insertRole(Role role);
int deleteRole(@Param("roleCode") String roleCode);
int updateRole(Role role);
Role selectRole(@Param("roleCode") String roleCode);
Page<Role> selectRolePage(RoleCondition condition);
List<Role> selectRoleByUser(@Param("userCode") String userCode);
}
| [
"Zhu.Qianchang@geely.com"
] | Zhu.Qianchang@geely.com |
9be15e0589b28f983be6cc96b0584ac60a86813a | 2367dd777533e9c6534548bfabc662a2fcabf65f | /app/src/androidTest/java/com/zeshanaslam/headsup/ApplicationTest.java | 9d9abcdf2e4a8f4e08444e237c12adaf0ebe13bb | [] | no_license | zeshan321/HeadsUp | 8b3d66ba85c7881b9251cdf1bcb787f5da026d00 | 862c68ef9ef4008f4a4fbd33d297902054405cc0 | refs/heads/master | 2021-01-10T01:46:10.041863 | 2015-12-07T00:25:02 | 2015-12-07T00:25:02 | 46,095,208 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 354 | java | package com.zeshanaslam.headsup;
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);
}
} | [
"zeshan12aslam@gmail.com"
] | zeshan12aslam@gmail.com |
82458cffa20021b875294731adbe8b2d11a206cd | 89644a8df9f36af91d690352dba275d355414bf8 | /WEB-INF/classes/spring/config/WebConfig.java | 90a7cfb16e7a31628a91b82419c66aad6b633b73 | [] | no_license | piyushpa4976/E-gurukul-ERP-backed | 2c1fa930bebd9e5973090dd236dc0edf89d4dc75 | 69047f30a12f19a389310a36e9e74e0044337316 | refs/heads/master | 2022-11-14T12:58:23.786673 | 2020-07-07T05:55:45 | 2020-07-07T05:55:45 | 268,851,730 | 0 | 0 | null | 2020-06-02T16:25:38 | 2020-06-02T16:25:37 | null | UTF-8 | Java | false | false | 1,382 | java | package spring.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.multipart.MultipartResolver;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import org.springframework.web.servlet.view.InternalResourceViewResolver;
import org.springframework.web.servlet.view.JstlView;
@Configuration
@EnableWebMvc
@ComponentScan(basePackages = { "spring.controller" })
public class WebConfig extends WebMvcConfigurerAdapter {
@Bean
public InternalResourceViewResolver resolver() {
InternalResourceViewResolver resolver = new InternalResourceViewResolver();
resolver.setViewClass(JstlView.class);
resolver.setPrefix("/WEB-INF/views/");
resolver.setSuffix(".jsp");
return resolver;
}
@Bean
public MultipartResolver multipartResolver() {
CommonsMultipartResolver multipartResolver = new CommonsMultipartResolver();
multipartResolver.setMaxUploadSize(10485760); // 10MB
multipartResolver.setMaxUploadSizePerFile(1048576); // 1MB
return multipartResolver;
}
} | [
"piyushpranov@gmail.com"
] | piyushpranov@gmail.com |
b4d951c464b9ce3c19378ed0f612d2b345a66cf8 | 04ac638cc2851e216b6edd6578df19ae599f156c | /results/Nopol-Test-Runing-Result/math/41/100/org/apache/commons/math/stat/descriptive/moment/Mean_ESTest.java | 06e34129427ec4ca8cdbf93a8d1a807c55c2e735 | [] | no_license | tdurieux/test4repair-experiments | 9f719d72de7d67b53b7e7936b21763dbd2dc48d0 | c90e85a1c3759b4c40f0e8f7468bd8213c729674 | refs/heads/master | 2021-01-25T05:10:07.540557 | 2017-06-06T12:25:20 | 2017-06-06T12:25:20 | 93,516,208 | 0 | 0 | null | 2017-06-06T12:32:05 | 2017-06-06T12:32:05 | null | UTF-8 | Java | false | false | 8,678 | java | package org.apache.commons.math.stat.descriptive.moment;
public class Mean_ESTest extends org.apache.commons.math.stat.descriptive.moment.Mean_ESTest_scaffolding {
@org.junit.Test(timeout = 4000)
public void test00() throws java.lang.Throwable {
org.apache.commons.math.stat.descriptive.moment.Mean mean0 = new org.apache.commons.math.stat.descriptive.moment.Mean(((org.apache.commons.math.stat.descriptive.moment.FirstMoment)(null)));
double[] doubleArray0 = new double[2];
doubleArray0[0] = 36.25170474298566;
doubleArray0[1] = 643.415;
double double0 = mean0.evaluate(doubleArray0, doubleArray0);
org.junit.Assert.assertEquals(611.0304439273897, double0, 0.01);
}
@org.junit.Test(timeout = 4000)
public void test01() throws java.lang.Throwable {
org.apache.commons.math.stat.descriptive.moment.Mean mean0 = new org.apache.commons.math.stat.descriptive.moment.Mean();
org.apache.commons.math.stat.descriptive.moment.Mean.copy(mean0, mean0);
org.junit.Assert.assertEquals(java.lang.Double.NaN, mean0.getResult(), 0.01);
}
@org.junit.Test(timeout = 4000)
public void test02() throws java.lang.Throwable {
org.apache.commons.math.stat.descriptive.moment.Mean mean0 = new org.apache.commons.math.stat.descriptive.moment.Mean();
org.apache.commons.math.stat.descriptive.moment.Mean mean1 = new org.apache.commons.math.stat.descriptive.moment.Mean(mean0);
org.junit.Assert.assertTrue(mean1.equals(((java.lang.Object)(mean0))));
}
@org.junit.Test(timeout = 4000)
public void test03() throws java.lang.Throwable {
org.apache.commons.math.stat.descriptive.moment.Mean mean0 = new org.apache.commons.math.stat.descriptive.moment.Mean();
mean0.increment((-767.1276268441635));
double double0 = mean0.getResult();
org.junit.Assert.assertEquals(1L, mean0.getN());
org.junit.Assert.assertEquals((-767.1276268441635), double0, 0.01);
}
@org.junit.Test(timeout = 4000)
public void test04() throws java.lang.Throwable {
org.apache.commons.math.stat.descriptive.moment.Mean mean0 = new org.apache.commons.math.stat.descriptive.moment.Mean();
double[] doubleArray0 = new double[8];
mean0.incrementAll(doubleArray0);
long long0 = mean0.getN();
org.junit.Assert.assertEquals(0.0, mean0.getResult(), 0.01);
org.junit.Assert.assertEquals(8L, long0);
}
@org.junit.Test(timeout = 4000)
public void test05() throws java.lang.Throwable {
org.apache.commons.math.stat.descriptive.moment.Mean mean0 = new org.apache.commons.math.stat.descriptive.moment.Mean(((org.apache.commons.math.stat.descriptive.moment.FirstMoment)(null)));
double[] doubleArray0 = new double[8];
doubleArray0[3] = -1.0;
double double0 = mean0.evaluate(doubleArray0, 3, 3);
org.junit.Assert.assertEquals((-0.33333333333333337), double0, 0.01);
}
@org.junit.Test(timeout = 4000)
public void test06() throws java.lang.Throwable {
org.apache.commons.math.stat.descriptive.moment.Mean mean0 = new org.apache.commons.math.stat.descriptive.moment.Mean();
org.apache.commons.math.stat.descriptive.moment.FirstMoment firstMoment0 = mean0.moment;
firstMoment0.increment((-3367.2188));
org.apache.commons.math.stat.descriptive.moment.Mean mean1 = mean0.copy();
org.junit.Assert.assertNotSame(mean1, mean0);
org.junit.Assert.assertEquals(1L, mean1.getN());
}
@org.junit.Test(timeout = 4000)
public void test07() throws java.lang.Throwable {
org.apache.commons.math.stat.descriptive.moment.Mean mean0 = new org.apache.commons.math.stat.descriptive.moment.Mean();
double[] doubleArray0 = new double[8];
mean0.incrementAll(doubleArray0);
mean0.copy();
org.junit.Assert.assertEquals(0.0, mean0.getResult(), 0.01);
}
@org.junit.Test(timeout = 4000)
public void test08() throws java.lang.Throwable {
org.apache.commons.math.stat.descriptive.moment.Mean mean0 = new org.apache.commons.math.stat.descriptive.moment.Mean();
org.apache.commons.math.stat.descriptive.moment.FirstMoment firstMoment0 = mean0.moment;
firstMoment0.n = -1073741824L;
org.apache.commons.math.stat.descriptive.moment.Mean mean1 = mean0.copy();
org.junit.Assert.assertEquals((-1073741824L), mean1.getN());
org.junit.Assert.assertNotSame(mean1, mean0);
}
@org.junit.Test(timeout = 4000)
public void test27() throws java.lang.Throwable {
org.apache.commons.math.stat.descriptive.moment.Mean mean0 = new org.apache.commons.math.stat.descriptive.moment.Mean(((org.apache.commons.math.stat.descriptive.moment.FirstMoment)(null)));
double[] doubleArray0 = new double[7];
doubleArray0[1] = ((double)(3));
double double0 = mean0.evaluate(doubleArray0, doubleArray0, 1, 1);
org.junit.Assert.assertEquals(3.0, double0, 0.01);
}
@org.junit.Test(timeout = 4000)
public void test28() throws java.lang.Throwable {
org.apache.commons.math.stat.descriptive.moment.Mean mean0 = new org.apache.commons.math.stat.descriptive.moment.Mean(((org.apache.commons.math.stat.descriptive.moment.FirstMoment)(null)));
double[] doubleArray0 = new double[7];
double double0 = mean0.evaluate(doubleArray0, 1, 1);
org.junit.Assert.assertEquals(0.0, double0, 0.01);
}
@org.junit.Test(timeout = 4000)
public void test30() throws java.lang.Throwable {
org.apache.commons.math.stat.descriptive.moment.Mean mean0 = new org.apache.commons.math.stat.descriptive.moment.Mean();
long long0 = mean0.getN();
org.junit.Assert.assertEquals(0L, long0);
}
@org.junit.Test(timeout = 4000)
public void test31() throws java.lang.Throwable {
org.apache.commons.math.stat.descriptive.moment.Mean mean0 = new org.apache.commons.math.stat.descriptive.moment.Mean();
double double0 = mean0.getResult();
org.junit.Assert.assertEquals(java.lang.Double.NaN, double0, 0.01);
}
@org.junit.Test(timeout = 4000)
public void test32() throws java.lang.Throwable {
org.apache.commons.math.stat.descriptive.moment.Mean mean0 = new org.apache.commons.math.stat.descriptive.moment.Mean();
double[] doubleArray0 = new double[9];
double double0 = mean0.evaluate(doubleArray0);
org.junit.Assert.assertEquals(0.0, double0, 0.01);
}
@org.junit.Test(timeout = 4000)
public void test33() throws java.lang.Throwable {
org.apache.commons.math.stat.descriptive.moment.Mean mean0 = new org.apache.commons.math.stat.descriptive.moment.Mean();
double[] doubleArray0 = new double[1];
double double0 = mean0.evaluate(doubleArray0, 0, 0);
org.junit.Assert.assertEquals(java.lang.Double.NaN, double0, 0.01);
}
@org.junit.Test(timeout = 4000)
public void test34() throws java.lang.Throwable {
org.apache.commons.math.stat.descriptive.moment.Mean mean0 = new org.apache.commons.math.stat.descriptive.moment.Mean();
mean0.clear();
org.junit.Assert.assertEquals(java.lang.Double.NaN, mean0.getResult(), 0.01);
}
@org.junit.Test(timeout = 4000)
public void test35() throws java.lang.Throwable {
org.apache.commons.math.stat.descriptive.moment.Mean mean0 = new org.apache.commons.math.stat.descriptive.moment.Mean(((org.apache.commons.math.stat.descriptive.moment.FirstMoment)(null)));
mean0.clear();
}
@org.junit.Test(timeout = 4000)
public void test36() throws java.lang.Throwable {
org.apache.commons.math.stat.descriptive.moment.Mean mean0 = new org.apache.commons.math.stat.descriptive.moment.Mean();
mean0.increment(0.0);
double double0 = mean0.getResult();
org.junit.Assert.assertEquals(0.0, double0, 0.01);
}
@org.junit.Test(timeout = 4000)
public void test39() throws java.lang.Throwable {
org.apache.commons.math.stat.descriptive.moment.Mean mean0 = new org.apache.commons.math.stat.descriptive.moment.Mean(((org.apache.commons.math.stat.descriptive.moment.FirstMoment)(null)));
mean0.increment((-510.4183735));
}
@org.junit.Test(timeout = 4000)
public void test40() throws java.lang.Throwable {
org.apache.commons.math.stat.descriptive.moment.Mean mean0 = new org.apache.commons.math.stat.descriptive.moment.Mean();
org.apache.commons.math.stat.descriptive.moment.Mean mean1 = mean0.copy();
org.junit.Assert.assertNotSame(mean1, mean0);
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
44b0f8f2370e80c6f7cea781ecdca1a3027f8f4a | dc97810fe449935ed4b527399207c96a2b075991 | /Practice03/src/main/java/prob6/Depart.java | 6ffbbfbd34cb94caac0199e1a566a4c27a303471 | [] | no_license | freshjy/java-study | 049ca0172de6c3c87c22dadb2aa672cc1dd53ba2 | e50facd9dd55041cf4b42543ea7353e3bb7a104b | refs/heads/master | 2023-02-13T01:25:24.217700 | 2021-01-04T05:58:40 | 2021-01-04T05:58:40 | 319,229,049 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 346 | java | package prob6;
public class Depart extends Employee {
String department;
public Depart(String name, int salary, String department) {
super(name, salary);
this.department = department;
}
public void getInformation() {
System.out.printf("이름: %s 연봉: %d 부서:%s \n", getName(), getSalary(),department);
}
}
| [
"bitr3@DESKTOP-IMERMO8"
] | bitr3@DESKTOP-IMERMO8 |
333a727d91cec9c2f3434f5f00fe50ce3a71bacf | 751a11f8af7eebf30e19472a1e0e98f4f25f94eb | /writGenerator/src/main/java/generator/service/impl/UserServiceImpl.java | f3561849ccb2947c4dda660f40b4647108e12feb | [] | no_license | Lionel233/writ-generator | 2633525574685c4c487b76517e5253a32575475b | 7c443f07aae5e15ba741fa6e0842d873eec1d5ad | refs/heads/master | 2020-12-31T00:11:39.830562 | 2017-05-14T06:22:03 | 2017-05-14T06:22:03 | 86,548,746 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,838 | java | package main.java.generator.service.impl;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import main.java.generator.dao.EditMapper;
import main.java.generator.dao.UserMapper;
import main.java.generator.dao.WsAjjbxxbMapper;
import main.java.generator.model.WritEdit;
import main.java.generator.po.Edit;
import main.java.generator.po.EditExample;
import main.java.generator.po.User;
import main.java.generator.po.UserExample;
import main.java.generator.po.WsAjjbxxb;
import main.java.generator.service.UserService;
import main.java.generator.utils.Result;
@Service("userService")
public class UserServiceImpl implements UserService{
@Autowired
UserMapper userPoMapper;
@Autowired
EditMapper editMapper;
@Autowired
UserMapper userMapper;
@Autowired
WsAjjbxxbMapper wsAjjbxxbMapper;
@Override
public Result login(User user) {
Result result = new Result();
if(user.getUsername() == null || user.getUsername().isEmpty() || user.getPassword() == null || user.getPassword()
.isEmpty()){
result.setCode(103);
result.setMessage(Result.CODE_103);
result.setResult(null);
}
UserExample ex = new UserExample();
ex.createCriteria().andUsernameEqualTo(user.getUsername())
.andPasswordEqualTo(user.getPassword());
List<User> list = userPoMapper.selectByExample(ex);
if(list.isEmpty()){
result.setCode(0);
result.setMessage(Result.CODE_0);
result.setResult(null);
}
else if(list.size() > 1){
result.setCode(102);
result.setMessage(Result.CODE_102);
result.setResult(null);
return result;
}
else{
User po = list.get(0);
User rUser = new User();
rUser.setRole(po.getRole());
rUser.setUsername(po.getUsername());
result.setCode(0);
result.setMessage(Result.CODE_0);
result.setResult(rUser);
}
return result;
}
@Override
public Result getAllWrits(User currentUser) {
Result result = new Result();
List<WritEdit> editInfoList = new ArrayList<WritEdit>();
EditExample ex = new EditExample();
ex.createCriteria().andUseridEqualTo(currentUser.getId());
List<Edit> editList = editMapper.selectByExample(ex);
SimpleDateFormat sf = new SimpleDateFormat();
for(Edit token:editList){
User user = userMapper.selectByPrimaryKey(token.getUserid());
WsAjjbxxb wsAjjbxxb = wsAjjbxxbMapper.selectByPrimaryKey(token.getAjxh());
WritEdit we = new WritEdit();
we.setAjxh(token.getAjxh());
we.setLastEditTime(sf.format(token.getLastedittime()));
we.setUserId(token.getUserid());
we.setUsername(user.getUsername());
we.setWritName(wsAjjbxxb.getAh());
}
result.setCode(0);
result.setMessage(Result.CODE_0);
result.setResult(editInfoList);
return result;
}
}
| [
"1358313967@qq.com"
] | 1358313967@qq.com |
d997e9c2641e2ff6fa25220450a3c64833e32ee7 | f58e3aa40777f5575d611ad4c07d14a8ae1fe1c2 | /NovoVisualizador.java | 7b554c7392463f1bf86ae7d33df84c22c829cdc9 | [] | no_license | renatocf/MAC0110-EP3 | cf75efb88a0c914827c9f6fa38c4ebb4dda489b2 | 595dfea6b99848a7baedbff47e53156d7770e4dd | refs/heads/master | 2021-01-01T19:30:20.497074 | 2012-06-24T03:51:51 | 2012-06-24T03:51:51 | 4,464,204 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 10,646 | java | /******************************************************/
/** MAC 110 - Introdução à Computação **/
/** IME-USP - Primeiro Semestre de 2012 **/
/** Turma 45 - Marcel Parolin Jackowski **/
/** **/
/** Primeiro Exercício-Programa **/
/** Arquivo: JogoDeDados.java **/
/** **/
/** Renato Cordeiro Ferreira 7990933 **/
/** Vinícius Jorge Vendramini 7991103 **/
/** **/
/** 26/06/12 **/
/******************************************************/
import java.util.*;
public class NovoVisualizador
{
Imagem imagemDoUsuario;
// Cria um objeto da classe 'Imagem' que tem o mesmo endereço de
// memória do retorno do método 'LeituraEscritaImagem', o qual
// é também um objeto da classe 'Imagem' cujo atributo 'pixel'
// (um vetor de inteiros) armazena as intensidades das cores cor-
// respondentes a cada pixel da imagem.
String nome;
// Variável para armazenar o nome do arquivo original
String nomeDaCopia;
// Variável para armazenar o nome do arquivo que, posteriormente,
// será criado na pasta da imagem original, armazenando a imagem suavizada.
Scanner sc = new Scanner(System.in);
// Instanciando um objeto da classe Scanner, para interação
// com o usuário via teclado.
private int opcao()
{
int opcao = 0;
do
{
try { opcao = Integer.parseInt(sc.next());
} catch(NumberFormatException e) {
System.out.println("A opção deve ser um número inteiro!");
continue;
}
if(opcao <= 0 || opcao > 7) {
System.out.println("Só existem 7 opções, de 1 a 7...");
opcao = 0; continue;
}
} while(opcao == 0);
return opcao;
} // static int opcao()
private void lerImagem() // Opção 1
{
System.out.println("Digite o nome do arquivo:");
nome = sc.next();
if(nome.equals("sair"))
return; // A entrada "sair" permite que o usuário saia da
// opção selecionada
String formato = ".pgm";
// Se o final do nome do arquivo não for .pgm (corres-
// pondente ao formato do arquivo), automaticamente adi-
// ciona-se a extensão a ele, para permitir a busca caso
// o usuário se esqueça de colocar o formato no final
// do nome do arquivo.
for(int i = 1; i < 5; i++)
if(nome.charAt(nome.length()-i) != formato.charAt(4-i))
{
nome = nome + ".pgm";
break;
}
imagemDoUsuario = LeituraEscritaImagem.leImagem(nome);
if(imagemDoUsuario == null)
// Checa se a imagem do usuário teve retorno 'null', caso padrão
// de retorno adotado pela classe 'LeituraEscritaImagem' no método
// 'leImagem' quando há uma exceção lançada.
System.out.println("Arquivo não existente ou problema na leitura");
else // Caso tudo tenha ocorrido bem
{
nomeDaCopia = "";
for(int i=0; i < nome.length() - 4; i++)
nomeDaCopia += nome.charAt(i);
nomeDaCopia += "_copia.pgm";
// Faz o nome do arquivo que, posteriormente, será criado na pas-
// ta da imagem original, armazenando a imagem suavizada.
LeituraEscritaImagem.escreveImagem(nomeDaCopia, imagemDoUsuario);
// Cria um novo arquivo com a cópia, baseada na cópia suavizada.
System.out.println("Leitura bem sucedida!");
System.out.println();
}
} // private void lerImagem(String nome)
private void visualizarImagem() // Opção 2
{
VisualizadorImagem vis = new VisualizadorImagem();
if(imagemDoUsuario == null)
// Checa se a imagem do usuário teve retorno 'null', caso padrão
// de retorno adotado pela classe 'LeituraEscritaImagem' no método
// 'leImagem' quando há uma exceção lançada.322
System.out.println("Arquivo não existente ou problema na leitura");
else
vis.mostraImagem(imagemDoUsuario, nome);
} // private void visualizarImagem()
private void filtroMedio() // Opção 3
{
System.out.println("Qual o tamanho da vizinhança desejado?");
String tamanho = sc.next();
if(tamanho.equals("sair"))
return; // A entrada "sair" permite que o usuário saia da
// opção selecionada
try { // Pegando a possível exceção lançada pelo método 'filtro
// medio', da classe 'Imagem', quando colocados valores pa-
// res, negativos ou não inteiros como tamanho da vizinhança.
imagemDoUsuario.filtroMedio(Integer.parseInt(tamanho));
} catch(NumberFormatException e) {
System.out.println("Só são aceitos números inteiros!");
filtroMedio();
} catch(ArithmeticException e) {
System.out.println("Só são aceitos valores ímpares maiores que 0!");
filtroMedio();
} // try-catch
} // static private void filtroMedio()
private void filtroMediano() // Opção 4
{
System.out.println("Qual o tamanho da vizinhança desejado?");
String tamanho = sc.next();
if(tamanho.equals("sair"))
return; // A entrada "sair" permite que o usuário saia da
// opção selecionada
try { // Pegando a possível exceção lançada pelo método 'filtro
// mediano', da classe 'Imagem', quando colocados valores pa-
// res, negativos ou não inteiros como tamanho da vizinhança.
imagemDoUsuario.filtroMediano(Integer.parseInt(tamanho));
} catch(NumberFormatException e) {
System.out.println("Só são aceitos números inteiros!");
filtroMediano();
} catch(ArithmeticException e) {
System.out.println("Só são aceitos valores ímpares maiores que 0!");
filtroMediano();
} // try-catch
} // static private void filtroMediano()
private void filtroGaussiano() // Opção 5
{
int tamanho = 0; double sigma = 0;
boolean valorSigmaVálido = false, valorTamanhoVálido = false;
while(!valorTamanhoVálido)
{
System.out.println("Qual o tamanho da vizinhança desejado?");
String entrada = sc.next();
if(entrada.equals("sair"))
return; // A entrada "sair" permite que o usuário saia da
// opção selecionada
try {
tamanho = Integer.parseInt(entrada);
if(tamanho % 2 == 0 || tamanho < 0)
throw new ArithmeticException();
// Buscando exceções para o tamanho da vizinhança
} catch(NumberFormatException e) {
System.out.println("Só são aceitos números inteiros!");
continue;
} catch(ArithmeticException e) {
System.out.println("Só são aceitos valores ímpares maiores que 0!");
continue;
} // try-catch: Integer.parseInt(sc.next());
valorTamanhoVálido = true;
} // while(!valorTamanhoVálido)
while(!valorSigmaVálido)
{
System.out.println("Qual o desvio-padrão desejado?");
String entrada = sc.next();
if(entrada.equals("sair"))
return;
try {
sigma = Double.parseDouble(entrada);
if(sigma <= 0)
throw new ArithmeticException();
// Buscando exceções para o desvio-padrão.
} catch(NumberFormatException e) {
System.out.println("Só são aceitos números inteiros!");
continue;
} catch(ArithmeticException e) {
System.out.println("Só são aceitos valores maiores que 0!");
continue;
} // try-catch: sigma = Double.parseDouble(sc.next());
valorSigmaVálido = true;
} // while(!valorSigmaVálido)
imagemDoUsuario.filtroGaussiano(sigma, tamanho);
// aplicando o Filtro Gaussiano na cópia da imagem.
} // static private void filtroGaussiano()
private void gravaImagem() // Opção 6
{
System.out.println("Você tem certeza que deseja substituir a imagem? [S/n]");
String resposta = sc.next();
if(resposta.equals("S") || resposta.equals("s"))
{
if(imagemDoUsuario == null)
System.out.println("Arquivo não existente ou problema na leitura");
// Checa se a imagem do usuário teve retorno 'null', caso padrão
// de retorno adotado pela classe 'LeituraEscritaImagem' no método
// 'leImagem' quando há uma exceção lançada.
else
LeituraEscritaImagem.escreveImagem(nome, imagemDoUsuario);
// Sobrescreve o arquivo '_cópia' na imagem original,
// fazendo com que a esta tenha, a partir de então,
// as suavizações realizadas na cópia.
}
else if(resposta.equals("N") || resposta.equals("n"))
return;
else
{
System.out.print("Entrada incorreta. ");
gravaImagem();
}
} // private void gravaImagem()
public static void main(String[] args)
{
NovoVisualizador menu = new NovoVisualizador();
boolean fim = false;
while(!fim)
{
System.out.println("Menu");
System.out.println("====");
System.out.println("1) Ler imagem");
System.out.println("2) Visualizar imagem");
System.out.println("3) Suavizar com filtro médio");
System.out.println("4) Suavizar com filtro mediano");
System.out.println("5) Suavizar com filtro gaussiano");
System.out.println("6) Gravar imagem");
System.out.println("7) Fim");
// Cria instância do visualizador
System.out.println("Qual a sua opção?");
int opcao = menu.opcao();
if(opcao == 1) // Opção1: Carregar imagem
menu.lerImagem();
if(opcao == 2) // Opção2: Visualizar imagem
menu.visualizarImagem();
if(opcao == 3) // Opção 3: filtro médio
menu.filtroMedio();
if(opcao == 4) // Opção 4: filtro mediano
menu.filtroMediano();
if(opcao == 5) // Opção 5: filtro gaussiano
menu.filtroGaussiano();
if(opcao == 6) // Opção 6: gravar imagem
menu.gravaImagem();
if(opcao == 7) // Opção 7: fim
fim = true;
} // while(!fim)
} // main
} // class NovoVisualizador | [
"renatocordeiroferreira@gmail.com"
] | renatocordeiroferreira@gmail.com |
7570eb92caf4cc7dfbc4c8031c8825afd2d61a47 | 3dc78b726ec091b5d22940564973d1dfd91e7eac | /src/main/java/hello/core/discount/RateDiscountPolicy.java | 87bbdfbfd061f11d552d96b59fc07061a7483614 | [] | no_license | nimkoes/inflearn_spring_core_basic_KYH | aa753095adc080b6e428d65acad345e810bcc8c6 | 1ec5800aaa6c1c874ff014e87134bbca3c649838 | refs/heads/master | 2022-12-23T20:36:56.746960 | 2020-09-22T08:18:06 | 2020-09-22T08:18:06 | 297,354,783 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 645 | java | package hello.core.discount;
import hello.core.annotation.MainDiscountPolicy;
import hello.core.member.Grade;
import hello.core.member.Member;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;
@Component
//@Qualifier("mainDiscountPolicy")
//@MainDiscountPolicy
@Primary
public class RateDiscountPolicy implements DiscountPolicy {
private int discountPercent = 10;
@Override
public int discount(Member member, int price) {
if (member.getGrade() == Grade.VIP) {
return price * discountPercent / 100;
} else {
return 0;
}
}
}
| [
"xxxelppa@gmail.com"
] | xxxelppa@gmail.com |
5c9415c5b7ee379584f5f6ea71328d0b038cf2f9 | e6dd9a937c189be3e6699af254f02d36e4d807ee | /src/main/java/com/ei/controller/AlertsController.java | c5ca47555938c437855d024981468863dbac9e53 | [] | no_license | rachana754/HR_Portal | 4ffb63194ac5b6c43851bbad4cdf3a504aae9ed3 | 3f8e06a85e4eb831b7255ad9a2ff6883e1012de4 | refs/heads/master | 2020-06-22T04:28:45.077789 | 2019-08-15T17:55:03 | 2019-08-15T17:55:03 | 197,601,113 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,530 | java | package com.ei.controller;
import java.util.List;
import javax.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.servlet.ModelAndView;
import com.ei.form.AlertForm;
import com.ei.model.Alert;
import com.ei.service.AlertService;
/**
* Communicates with the Alerts page and handles sending information to and receiving information from the front end.
* @author rrevuri
*/
@Controller
public class AlertsController {
@Autowired
private AlertService alertService;
@GetMapping(value = "/alertsManage")
public ModelAndView alerts(@ModelAttribute("alertsForm") AlertForm aForm) {
List<Alert> alertsList = alertService.getAllActiveAlerts(true);
ModelAndView mav = new ModelAndView("alertsManage");
mav.addObject("alertsList", alertsList);
return mav;
}
@PostMapping(value = "/saveAlert")
public String submit(@ModelAttribute("alertsForm") @Valid AlertForm aForm) {
alertService.saveAlert(aForm);
return "redirect:/alertsManage";
}
@PostMapping(value = "/deleteAlert")
public String delete(@ModelAttribute("alertsForm") @Valid AlertForm aForm) {
alertService.inActivateAlert(aForm);
return "redirect:/alertsManage";
}
} | [
"rrevuri@empoweredbenefits.com"
] | rrevuri@empoweredbenefits.com |
6a66bf00acc3e36ac6e1b977c00143c66e117e52 | 52ef62d3b3f7b8727601526ac8119dd0e2d7ce4f | /JToggleButton/src/Pdf/Vista10.java | bfa1dd269024b372acf6c42bc976895c4880abb3 | [] | no_license | MxnterAnn/Segundo-Parcial | f300ab7fc03da47a5df46337c1c54eab3de7cee4 | c4e0047c6924417e8707d2da75d33ce599064fba | refs/heads/master | 2021-05-15T14:20:02.016473 | 2017-10-16T23:11:08 | 2017-10-16T23:11:08 | 107,191,870 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,289 | java | package Pdf;
import java.awt.Color;
import javax.swing.*;
import static javax.swing.JFrame.EXIT_ON_CLOSE;
import javax.swing.border.LineBorder;
import org.netbeans.lib.awtextra.AbsoluteConstraints;
import org.netbeans.lib.awtextra.AbsoluteLayout;
public class Vista10 extends JFrame {
JScrollBar desValor;
JLabel etiValor;
public Vista10() {
this.setTitle("SCROLLBARS");
this.setSize(300, 300);
this.getContentPane().setLayout(new AbsoluteLayout());
this.setResizable(false);
this.setDefaultCloseOperation(EXIT_ON_CLOSE);
desValor = new JScrollBar(JScrollBar.HORIZONTAL);
this.getContentPane().add(desValor, new AbsoluteConstraints(30, 50, 200, 20));
desValor.setMinimum(50);
desValor.setMaximum(150);
desValor.setUnitIncrement(2);
desValor.setBlockIncrement(20);
desValor.setVisibleAmount(5);
etiValor = new JLabel();
this.getContentPane().add(etiValor, new AbsoluteConstraints(30, 150, 200, 20));
etiValor.setBorder(new LineBorder(Color.black));
etiValor.setOpaque(true);
}
public static void main(String[] args) {
Vista10 ab = new Vista10();
ab.setVisible(true);
}
}
| [
"JORGE LUNA@MDTLivWIN7"
] | JORGE LUNA@MDTLivWIN7 |
504a636a629692ee3aa2c42de77c0646eb1880d2 | c0cea43d4f14babc8f719109b0a78ad6f4b54016 | /src/ch4/data/AddAdvertisement.java | 803d87b680e9b5ab10a0225de18ba9e81c3f5e18 | [] | no_license | AzureDragon-Z/Advertising-wall | 12329e5f61289982184074f564af0af4a3988da4 | e0553557e1d1a2461671e00105b638674c85e1bf | refs/heads/main | 2023-07-15T07:01:59.947153 | 2021-08-22T12:56:43 | 2021-08-22T12:56:43 | 398,797,789 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,454 | java | package ch4.data;
import java.sql.*;
import java.io.*;
public class AddAdvertisement extends ConnectDatabase{
Login login;
public void setLogin(Login login) {
this.login = login;
}
public boolean addAdvertisement(Advertisement ad) {
connectDatabase(); //链接数据库
if (con == null || login == null) {
return false;
}
if (login.getLoginSuccess() == false) {
return false;
}
boolean success = false;
//将对应id的数据写入输入库guanggao_table中,
PreparedStatement preSql;
String sqlStr = "insert into guanggao_table values(?,?,?,?)";
try {
preSql = con.prepareStatement(sqlStr);
preSql.setString(1, login.getID());
String content = ad.getContent();
preSql.setString(2, content);
File f = ad.getPictureFile();
InputStream in = new FileInputStream(f);
int length = in.available();
preSql.setBinaryStream(3, in, length);
preSql.setString(4, login.getID()+ad.getSerialNumber());
int isOK = preSql.executeUpdate();
if (isOK != 0) {
success = true;
}
else {
success = false;
}
con.close();
}
catch (Exception e) {
success = false;
}
return success;
}
}
| [
"2377475674@qq.com"
] | 2377475674@qq.com |
1949db7fba5eb44e9e83563512d738b2456ecb5e | 7b82d70ba5fef677d83879dfeab859d17f4809aa | /f/_LeetCode/xgame-code_server/game_part/src/main/java/com/game/part/tmpl/type/XlsxBool.java | 44c768ad3ce2d684352f24fb6f4787f2ac1c3ef1 | [
"Apache-2.0"
] | permissive | apollowesley/jun_test | fb962a28b6384c4097c7a8087a53878188db2ebc | c7a4600c3f0e1b045280eaf3464b64e908d2f0a2 | refs/heads/main | 2022-12-30T20:47:36.637165 | 2020-10-13T18:10:46 | 2020-10-13T18:10:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 848 | java | package com.game.part.tmpl.type;
import com.game.part.tmpl.XSSFRowReadStream;
/**
* Excel Bool 字段
*
* @author hjj2019
* @since 2015/2/23
*
*/
public class XlsxBool extends PrimitiveTypeCol<Boolean> {
/**
* 类默认构造器
*
*/
public XlsxBool() {
super();
}
/**
* 类参数构造器
*
* @param nullable
*
*/
public XlsxBool(boolean nullable) {
super(nullable);
}
/**
* 类参数构造器
*
* @param nullable
* @param defaultVal
*
*/
public XlsxBool(boolean nullable, boolean defaultVal) {
super(nullable, defaultVal);
}
@Override
protected void readImpl(XSSFRowReadStream fromStream) {
if (fromStream != null) {
super.setObjVal(fromStream.readBool());
}
}
}
| [
"wujun728@hotmail.com"
] | wujun728@hotmail.com |
e2f9891313f1dc4c3830b4ca035962fcef50e8ee | e4f45496db3e7334bfbdc5ebe8c7e7de8fcc6028 | /app/src/main/java/com/cs240/famillymap/ui/LoginFragment.java | 2063dd136ae68e570c9662a835fe7507a2850f94 | [] | no_license | whyriod/androidFrontEnd | 0de1bbbd5a475a850ec4042a56280249a4d183e9 | 1ce28dff94d844d49aca01a3d4733bfc65026706 | refs/heads/master | 2023-05-27T12:36:49.548174 | 2021-06-15T06:26:55 | 2021-06-15T06:26:55 | 376,206,493 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 20,285 | java | package com.cs240.famillymap.ui;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.EventLog;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RadioGroup;
import android.widget.TextView;
import android.widget.Toast;
import com.cs240.famillymap.R;
import com.cs240.famillymap.model.DataCache;
import com.cs240.famillymap.model.Helper;
import com.cs240.famillymap.net.ServerProxy;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.TreeMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import model.Event;
import model.Person;
import request.AuthRequest;
import request.EventRequest;
import request.LoginRequest;
import request.RegisterRequest;
import result.EventResult;
import result.EventsResult;
import result.LoginResult;
import result.PersonsResult;
import result.RegisterResult;
/***
* Handle a User logging in.
*/
public class LoginFragment extends Fragment {
private View rootView;
private EditText serverHost;
private EditText serverPort;
private EditText username;
private EditText password;
private EditText firstName;
private EditText lastName;
private EditText email;
//String -> Set with listeners.
private String serverHostStr = "";
private String serverPortStr = "";
private String usernameStr = "";
private String passwordStr = "";
private String firstNameStr = "";
private String lastNameStr = "";
private String emailStr = "";
private RadioGroup gender;
private Button signIn;
private Button register;
public LoginFragment() {
// Required empty public constructor
}
public static LoginFragment newInstance() {
LoginFragment fragment = new LoginFragment();
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
rootView = inflater.inflate(R.layout.fragment_login, container, false);
//Setup Pointers
serverHost = rootView.findViewById(R.id.server_host);
serverPort = rootView.findViewById(R.id.server_port);
username = rootView.findViewById(R.id.username);
password = rootView.findViewById(R.id.password);
firstName = rootView.findViewById(R.id.first_name);
lastName = rootView.findViewById(R.id.last_name);
email = rootView.findViewById(R.id.email);
signIn = rootView.findViewById(R.id.sign_in);
register = rootView.findViewById(R.id.register);
gender = rootView.findViewById(R.id.gender);
//Setup SignIn listener
signIn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
signIn();
}
});
//Setup Register Listener
register.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
register();
}
});
enableButtons();
//Listeners: If there is text enable or disable the Login or register buttons:
//Host listener
serverHost.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
serverHostStr = s.toString();
enableButtons();
}
@Override
public void afterTextChanged(Editable s) {
}
});
//Port listener
serverPort.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
serverPortStr = s.toString();
enableButtons();
}
@Override
public void afterTextChanged(Editable s) {
}
});
//Username listener
username.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
usernameStr = s.toString();
enableButtons();
}
@Override
public void afterTextChanged(Editable s) {
}
});
//Password listener
password.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
passwordStr = s.toString();
enableButtons();
}
@Override
public void afterTextChanged(Editable s) {
}
});
//Firstname listener
firstName.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
firstNameStr = s.toString();
enableButtons();
}
@Override
public void afterTextChanged(Editable s) {
}
});
//Lastname listener
lastName.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
lastNameStr = s.toString();
enableButtons();
}
@Override
public void afterTextChanged(Editable s) {
}
});
//Email listener
email.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
emailStr = s.toString();
enableButtons();
}
@Override
public void afterTextChanged(Editable s) {
}
});
return rootView;
}
//If the user has filled all text, enable the login and register buttons.
//If the user has filled in the host, port, username, and password, then enable login.
//Otherwise, they are both disabled.
private void enableButtons(){
if(serverHostStr.length() != 0 && serverPortStr.length() != 0 &&
usernameStr.length() != 0 && passwordStr.length() != 0 &&
firstNameStr.length() != 0 && lastNameStr.length() != 0 &&
emailStr.length() != 0){
signIn.setEnabled(true);
register.setEnabled(true);
}
else if(serverHostStr.length() != 0 && serverPortStr.length() != 0 &&
usernameStr.length() != 0 && passwordStr.length() != 0){
signIn.setEnabled(true);
register.setEnabled(false);
}
else{
signIn.setEnabled(false);
register.setEnabled(false);
}
}
/***
* Create a New Thread. If the user successfully logs in, then call main activity to
* swap the map fragments. Otherwise, let the user know the error.
*/
private void signIn(){
proxySetup();
Handler uiThreadMessageHandler = new Handler(Looper.getMainLooper()){
@Override
public void handleMessage(Message message){
Bundle bundle = message.getData();
if(bundle.getBoolean("Outcome")){
((MainActivity) getActivity()).login();
}
else{
Toast.makeText(requireActivity().getApplicationContext(),
bundle.getString("Message"), Toast.LENGTH_SHORT).show();
}
}
};
LoginTask task = new LoginTask(uiThreadMessageHandler,getSignIn());
ExecutorService executor = Executors.newSingleThreadExecutor();
executor.submit(task);
}
/***
* Create a New Thread. If the user successfully registers in, then call main activity to
* swap the map fragments. Otherwise, let the user know the error.
*/
public void register(){
proxySetup();
Handler uiThreadMessageHandler = new Handler(Looper.getMainLooper()){
@Override
public void handleMessage(Message message){
Bundle bundle = message.getData();
if(bundle.getBoolean("Outcome")){
((MainActivity) getActivity()).login();
}
else{
Toast.makeText(requireActivity().getApplicationContext(),
bundle.getString("Message"), Toast.LENGTH_SHORT).show();
}
}
};
LoginTask task = new LoginTask(uiThreadMessageHandler,getRegister());
ExecutorService executor = Executors.newSingleThreadExecutor();
executor.submit(task);
}
/***
* Setup the server Proxy with the user input for host and server.
*/
private void proxySetup(){
//Setup Server Proxy
ServerProxy sp = ServerProxy.getInstance();
sp.setHostname(serverHost.getText().toString());
sp.setPort(Integer.parseInt(serverPort.getText().toString()));
}
/***
* Create a login request object from the user input.
* @return - The new LoginRequest object.
*/
private LoginRequest getSignIn(){
//New Login Object
return new LoginRequest(username.getText().toString(), password.getText().toString());
}
/***
* Create a register request object from the user input.
* @return - The new RegisterRequest object.
*/
private RegisterRequest getRegister(){
String sex;
//Determine Gender
if(gender.getCheckedRadioButtonId() == R.id.male){
sex = "m";
}
else{
sex ="f";
}
//New Register Request Object
RegisterRequest request =
new RegisterRequest(username.getText().toString(),password.getText().toString(),
email.getText().toString(),firstName.getText().toString(),
lastName.getText().toString(),sex);
return request;
}
/***
* The background thread. It will attempt to login/register. If successful, it will
* use the server proxy to load the dataCache with events and persons relevant
* to the user.
*/
private static class LoginTask implements Runnable{
private final Handler messageHandler;
private final LoginRequest loginRequest;
private final RegisterRequest registerRequest;
private AuthRequest aRequest;
private String personID;
private DataCache cache;
/***
* LoginTask Constructor
* @param messageHandler - The handler to report the outcome.
* @param loginRequest - The LoginRequest.
*/
public LoginTask(Handler messageHandler, LoginRequest loginRequest){
this.messageHandler = messageHandler;
this.registerRequest = null;
this.loginRequest = loginRequest;
}
/***
* RegisterRequest Handler
* @param messageHandler - The handler to report the outcome.
* @param registerRequest - The RegisterRequest.
*/
public LoginTask(Handler messageHandler, RegisterRequest registerRequest){
this.messageHandler = messageHandler;
this.registerRequest = registerRequest;
this.loginRequest = null;
}
/***
* The Single run method. Attempts to login/register.
* If successful, it will load the data.
*/
@Override
public void run() {
ServerProxy proxy = ServerProxy.getInstance();
cache = DataCache.getInstance();
//Login Request
if(loginRequest != null){
LoginResult result = proxy.login(loginRequest);
if(result.isSuccess()){
personID = result.getPersonID();
aRequest = new AuthRequest(result.getAuthtoken());
loadData();
}
else{
sendMessage("Error: Failed to login", false);
}
}
//Register Request
else if(registerRequest != null){
RegisterResult result = proxy.register(registerRequest);
if(result.isSuccess()){
personID = result.getPersonID();
aRequest = new AuthRequest(result.getAuthtoken());
loadData();
}
else{
sendMessage("Error: Failed to register", false);
}
}
}
/***
* Send the message to the handler.
*
* @param m - The message to send.
* @param o - boolean for outcome of the event.
*/
private void sendMessage(String m, Boolean o){
Message message = Message.obtain();
Bundle msgBundle = new Bundle();
msgBundle.putString("Message",m);
msgBundle.putBoolean("Outcome",o);
message.setData(msgBundle);
messageHandler.sendMessage(message);
}
/***
* Load event and personData from the proxy. Then precompute: paternal, maternal,
* male, female, and get filter events ready to filter. The code create 2 deep copies
* for the filter data because if I don't and call clear() in my filter function,
* It destroys my original data set.
*/
private void loadData(){
ServerProxy proxy = ServerProxy.getInstance();
EventsResult eResult = proxy.events(aRequest);
PersonsResult pResult = proxy.persons(aRequest);
Map<String, Person> peopleMap = new HashMap<>();
Map<String, Event> eventsMap = new HashMap<>();
Map<String, List<Event>> events = new HashMap<>();
ArrayList<Event> personEvents = new ArrayList<>();
Map<String, Float> eventColor = new HashMap<>();
Map<String, Person> male = new HashMap<>();
Map<String, Person> female = new HashMap<>();
Map<String, Person> filterPeopleMap = new HashMap<>();
Map<String, Event> filterEventsMap = new HashMap<>();
Map<String, List<Event>> filterEvents = new HashMap<>();
ArrayList<Event> filterPersonEvents = new ArrayList<>();
//Set PersonId for current User
cache.setPersonID(personID);
//Set Person Map
for(Person p: pResult.getData()){
peopleMap.put(p.getPersonID(),p);
filterPeopleMap.put(p.getPersonID(),p);
if(p.getGender().equals("m")){
male.put(p.getPersonID(),p);
}
else if(p.getGender().equals("f")){
female.put(p.getPersonID(),p);
}
}
cache.setPeopleMap(peopleMap);
cache.setFilterPeople(filterPeopleMap);
cache.setMale(male);
cache.setFemale(female);
//Set Event Map
for(Event e: eResult.getData()){
e.setEventType(e.getEventType().toUpperCase());
eventsMap.put(e.getEventID(),e);
filterEventsMap.put(e.getEventID(),e);
}
cache.setEventsMap(eventsMap);
cache.setFilterEventMap(filterEventsMap);
int index = 0;
//Set Event Colors
for(Event e: eResult.getData()){
if(eventColor.get(e.getEventType().toUpperCase()) == null){
//Recycle Colors
if(index >= cache.getColors().size()){
index = 0;
}
eventColor.put(e.getEventType().toUpperCase(),cache.getColors().get(index));
index++;
}
}
cache.seteventColors(eventColor);
//Set map for Each Person that contains their events
for(Person p: pResult.getData()){
personEvents.clear();
filterPersonEvents.clear();
//For each event
for(Event e: eResult.getData()){
if(p.getPersonID().equals(e.getPersonID())){
personEvents.add(e);
filterPersonEvents.add(e);
}
}
Helper helper = new Helper();
filterEvents.put(p.getPersonID(),helper.sortYear(personEvents));
events.put(p.getPersonID(),helper.sortYear(personEvents));
}
cache.setEvents(events);
cache.setFilterEvents(filterEvents);
getPaternal();
getMaternal();
sendMessage("Success", true);
}
/***
* If there is a father, call ancestors to recursively add paternal.
*/
private void getPaternal(){
Map<String, Person> paternal = new HashMap<>();
String fatherID = cache.getPeopleMap().get(cache.getPersonID()).getFatherID();
if(!fatherID.equals(null)){
ancestors(paternal,fatherID);
}
cache.setPaternal(paternal);
}
/***
* If there is a mother, call ancestors to recursively add ,maternal.
*/
private void getMaternal(){
Map<String, Person> maternal = new HashMap<>();
String motherID = cache.getPeopleMap().get(cache.getPersonID()).getMotherID();
if(!motherID.equals(null)){
ancestors(maternal,motherID);
}
cache.setMaternal(maternal);
}
/***
* Recursive function. Takes a map of ancestors and adds the current person to it.
* If there are additional fathers or mothers to add, it will recursively add them.
*
* @param ancestors - The map to add to.
* @param personID - The current ancestor to add and check for further ancestors.
*/
private void ancestors(Map<String, Person> ancestors, String personID){
Person person = cache.getPeopleMap().get(personID);
ancestors.put(personID,person);
String fatherID = person.getFatherID();
String motherID = person.getMotherID();
if(fatherID != null){
ancestors(ancestors,fatherID);
}
if(motherID != null){
ancestors(ancestors,motherID);
}
}
};
}
| [
"whyriod.whyriod@gmail.com"
] | whyriod.whyriod@gmail.com |
0ced49d0f79f92996227a53f01aa92395d1156ad | 758b42d96896ebc63d4a9a431ed1576828a7c7d0 | /src/main/java/org/jboss/jdeparser/JVarDeclaration.java | 3dc92175f10ad3dd28a744a04632e06b567d4327 | [
"Apache-2.0"
] | permissive | jdeparser/jdeparser2 | 8ebc1e2864b3da793a4e9cf6ec17b0eb9d2a69eb | fd6310c3745ff6d61487df6b8804760bea9cb866 | refs/heads/2.0 | 2022-05-20T02:02:46.001672 | 2022-04-29T19:43:34 | 2022-04-29T19:43:34 | 16,367,807 | 10 | 6 | Apache-2.0 | 2022-04-29T19:44:01 | 2014-01-30T03:56:46 | Java | UTF-8 | Java | false | false | 1,676 | java | /*
* JBoss, Home of Professional Open Source.
* Copyright 2014 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* 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.jboss.jdeparser;
/**
* A variable declaration.
*
* @author <a href="mailto:david.lloyd@redhat.com">David M. Lloyd</a>
*/
public interface JVarDeclaration extends JAnnotatable, JDocCommentable {
/**
* Get the variable type.
*
* @return the variable type
*/
JType type();
/**
* Get the variable name.
*
* @return the variable name
*/
String name();
/**
* Add another item to this declaration. Subsequent items always have the same type as this item.
*
* @param name the variable name
* @param init the variable initializer
* @return the subsequent declaration
*/
JVarDeclaration add(String name, JExpr init);
/**
* Add another item to this declaration. Subsequent items always have the same type as this item.
*
* @param name the variable name
* @return the subsequent declaration
*/
JVarDeclaration add(String name);
}
| [
"david.lloyd@redhat.com"
] | david.lloyd@redhat.com |
9c4389e972f5ccca3c20d44305efaeef9e3fccc4 | 23d46fe0b70a18fb24af82989f368bfce85aa1d6 | /src/model/dao/ClienteDao.java | 1b071a22d772f1a824ecf211e19dbafe730bf146 | [] | no_license | limaantonio/projeto | 21a84fe1314dc7b66f4988b9ee4077f5097fa99e | ef61a777b1abfb9d849a8845c8e8c1d1f1a1e790 | refs/heads/master | 2020-09-11T05:27:42.313682 | 2019-11-27T02:10:26 | 2019-11-27T02:10:26 | 221,953,568 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 340 | java | package model.dao;
import java.util.List;
import model.entities.Associacao;
import model.entities.Cliente;
public interface ClienteDao {
void insert(Cliente obj);
void update(Cliente obj);
void deleteById(Integer id);
Cliente findById(Integer id);
List<Cliente> findAll();
List<Cliente> findByAssociacao(Associacao associacao);
}
| [
"limaantoniocarlos20@gmail.com"
] | limaantoniocarlos20@gmail.com |
343941ceb8997aca01ea3913bd0f85e12a00c331 | 223b8312dcb29dacc49c2668ce4f4753911c5716 | /app/src/main/java/com/example/android/multi/CategoryAdapter.java | 692c770e6b1d21aef813355ce23aa00496a6e4b3 | [] | no_license | ameen-yasin/multi | 4fc9f67fab6fc8e9586dbe81632ecb54e640db17 | 7d6e3ad28fbed8aff4e4d7360d8e02bf62393793 | refs/heads/master | 2022-01-20T22:52:22.442326 | 2019-06-23T17:08:34 | 2019-06-23T17:08:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,789 | java | /*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.example.android.multi;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
/**
* Provides the appropriate {@link Fragment} for a view pager.
*/
public class CategoryAdapter extends FragmentPagerAdapter {
public CategoryAdapter(FragmentManager fm) {
super(fm);
}
// public void setArguments (Bundle args){
// TextView textView =(TextView) findViewById(R.id.day);
// }
@Override
public Fragment getItem(int position) {
switch (position) {
case 0:
return new NumberFragment();
case 1:
return new FamilyFragment();
case 2:
return new ColorsFragment();
default:
return new PhrasesFragment();
}
// if (position == 0) {
// return new MondayFragment();
// } else if (position == 1){
// return new TuesdayFragment();
// } else {
// return new WednesdayFragment();
// }
}
@Override
public int getCount() {
return 4;
}
}
| [
"ameeen_1998@hotmail.com"
] | ameeen_1998@hotmail.com |
4e40bb2d75e69f49017e20bb71e0019a8ce4f9f0 | ad6685a9bb7fd101f3ecbfae00ae0f6bf08248e6 | /src/member/MemberServiceImpl.java | 64c440c6cd12630513d3f487a15b8ead608a2a41 | [] | no_license | math8916/mvc111 | cefae114ffc5e6236f31207552b6bc3e1fe8f368 | 8a2219b5a3d66bd1687b0a97cc1c7938c789c59e | refs/heads/master | 2021-01-17T17:15:23.276246 | 2016-07-20T08:13:37 | 2016-07-20T08:13:37 | 64,261,157 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,953 | java | package member;
import java.util.List;
import java.util.Map;
import bank.AccountService;
import bank.AccountServiceImpl;
/**
* @date : 2016. 6. 20.
* @author: 배근홍
* @file : StudentServiceImpl.java
* @story :
*/
public class MemberServiceImpl implements MemberService {
MemberDAO dao = MemberDAO.getInstance();
AccountService accService = AccountServiceImpl.getInstence();
MemberBean session;
private static MemberServiceImpl instanceImpl = new MemberServiceImpl();
private MemberServiceImpl() {
session = new MemberBean();
}
public MemberBean getSession() {
return session;
}
public void logoutSession(MemberBean member) {
if (member.getId().equals(session.getId()) && member.getPw().equals(session.getPw())) {
session = null;
}
}
public static MemberServiceImpl getInstanceImpl() {
return instanceImpl;
}
@Override
public String regist(MemberBean mem) {
String msg = "";
if (dao.insert(mem)==1) {
msg = dao.findById(mem.getId()).getName();
}
return msg;
}
@Override
public void update(MemberBean mem) {
dao.update(mem);
session = dao.findById(mem.getId());
}
@Override
public void delete(MemberBean mem) {
dao.delete(mem);
session = dao.findById(mem.getId());
}
public int count() {
return dao.count();
}
@Override
public MemberBean findById(String id) {
return dao.findById(id);
}
public List<?> list() {
return dao.list();
}
public List<?> findByName(String findName) {
return dao.findByName(findName);
}
@Override
public List<?> findBy(String keyword) {
return null;
}
@Override
public Map<?, ?> map() {
return null;
}
public String login(MemberBean member) {
String result = "";
if (dao.login(member)) {
session = dao.findById(member.getId());
result = session.getName();
accService.map();
}else{
result = "";
}
return result;
}
public String myAccount() {
return session.toString();
}
} | [
"math89@gamil.com"
] | math89@gamil.com |
bde9f96d8188256f748767ca39892cf9a4cc81cf | cdd8cf6479e519ff18c71ccba529c0875e49169a | /src/main/java/top/dianmu/ccompiler/learn/day68/TypeLink.java | cc4cd27f26a224663c96b748d9bc92498a1b82ac | [] | no_license | hungry-game/CCompiler_for_learn | af3611bd636978d72df3e09399f144f1ac482c84 | 3f1d3c48dd229ce1eb265ae0d3c8f2051051418b | refs/heads/master | 2022-05-26T18:33:01.230199 | 2020-05-02T12:57:33 | 2020-05-02T12:57:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 753 | java | package top.dianmu.ccompiler.learn.day68;
public class TypeLink {
boolean isDeclarator = true; //true 那么该object 的对象是declarator, false那么object指向的就是specifier
boolean isTypeDef = false; //true,那么当前变量的类型是由typedef 定义的
Object typeObject;
private TypeLink next = null;
public TypeLink(boolean isDeclarator, boolean typeDef, Object typeObj) {
this.isDeclarator = isDeclarator;
this.isTypeDef = typeDef;
this.typeObject = typeObj;
}
public Object getTypeObject() {
return typeObject;
}
public TypeLink toNext() {
return next;
}
public void setNextLink(TypeLink obj) {
this.next = obj;
}
}
| [
"2673077461@qq.com"
] | 2673077461@qq.com |
2528a1188233b18ce0caa9b38331cce625e9ea1b | 9b7b7c2862ee705c4efd5491cd389bb144b084b5 | /src/orther/词库优化/readTxtFileIntoStringArrList.java | 90e49ab725208ef4c8c16dbf9131389cb30ae7ec | [] | no_license | g1587613421/arithmetic | 5bf16083df2b9791d6ff09ea4463610184a250cb | 22f99afb5f785eadb8cff57ec09c635dead69d50 | refs/heads/master | 2021-07-10T03:19:08.413358 | 2021-04-02T00:58:25 | 2021-04-02T00:58:25 | 235,080,687 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,407 | java | package orther.词库优化;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
public class readTxtFileIntoStringArrList {
public readTxtFileIntoStringArrList() {
}
public static List<String> readTxtFileIntoStringArrList(String filePath) {
ArrayList list = new ArrayList();
try {
String encoding = "utf-8";
File file = new File(filePath);
if (file.isFile() && file.exists()) {
InputStreamReader read = new InputStreamReader(new FileInputStream(file), encoding);
BufferedReader bufferedReader = new BufferedReader(read);
String lineTxt = null;
int n=0;
while((lineTxt = bufferedReader.readLine()) != null) {
list.add(lineTxt);
if (n++%3==0) {
System.out.println(lineTxt);
}
}
bufferedReader.close();
read.close();
} else {
System.out.println("找不到指定的文件");
}
} catch (Exception var7) {
System.out.println("读取文件内容出错");
var7.printStackTrace();
}
return list;
}
}
| [
"g1587613421@outlook.com"
] | g1587613421@outlook.com |
cf975f4d73ebe6efcf8ad5eab5536ab3730b8bfa | 9d334afbeeee32c503b38f9a94902de73a25cee7 | /WEB-INF/src/servlet/LoginServlet.java | 6ef444cc2b50d1ddb6f7abea2d1b03de16830b3a | [] | no_license | sarayas/freewit | 6609cc2633a41b2e881670b3988b620172ce6d9c | df94075c8f4cde3cc191d5f08c9420c8ef0b5afa | refs/heads/master | 2021-09-03T00:13:04.245877 | 2018-01-04T07:56:40 | 2018-01-04T07:56:40 | 116,198,545 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,311 | java | package servlet;
import java.io.IOException;
import java.util.ArrayList;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import dao.FollowDAO;
import dao.UserDAO;
import dto.User;
public class LoginServlet extends HttpServlet {
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
//日本語利用の為のエンコーディング
response.setContentType("text/html; charset=Windows-31J");
request.setCharacterEncoding("Windows-31J");
String error = null;
String errorCmd = "";
User user = null;
try {
HttpSession session = request.getSession();
String id = request.getParameter("id");
String password = request.getParameter("password");
UserDAO userDao = new UserDAO();
user = userDao.login(id, password);
if (user == null) {
error = "ユーザー名やパスワードを確認してください。";
errorCmd = "login";
return;
}
if(user.getAuthority().equals("3")){
error = "会員様は現在利用停止状態です。";
errorCmd = "login";
return;
}
FollowDAO followDao = new FollowDAO();
ArrayList<String> followList = followDao.selectAllFollwer(id);
session.setAttribute("user", user);
session.setAttribute("followList", followList);
} catch (IllegalStateException e) {
//データベース接続エラーIllegal State Exception でスローした例外をキャッチ
error="データベース接続エラーが発生しました。";
errorCmd="login";
} finally {
//最後の処理request,responsesを他のサーブレット、ページに伝送する
if (error != null) {
request.setAttribute("error", error);
request.setAttribute("errorCmd", errorCmd);
request.getRequestDispatcher("/view/error.jsp").forward(
request, response);
} else if(user.getAuthority().equals("1")) {
request.getRequestDispatcher("/view/admin.jsp").forward(request,
response);
}else{
request.getRequestDispatcher("/privatePage").forward(request,
response);
}
}
}
}
| [
"sarayaszeroj@gmail.com"
] | sarayaszeroj@gmail.com |
9ca6e8955ed74df9c87cb8b9cc2c7dd21239fe05 | 60ad8a0c014e4f65782a2eff90b16a0c7f1e2ea3 | /src/config/DbConnection.java | 2c0d50bec788b7161a3b1eb5583fe27a55a9cbe2 | [] | no_license | naaoufal/YoucodeTalent | fdd051c522f832bf20578ef93396c0b23b15bb67 | d8d6ca585a84f343dc88277b09c68eae53b49761 | refs/heads/master | 2023-01-31T22:00:48.394204 | 2020-12-17T08:38:42 | 2020-12-17T08:38:42 | 322,229,207 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 925 | java | package config;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class DbConnection {
private String url;
private String username;
private String pass;
public DbConnection() {
}
public DbConnection(String url, String username, String pass) {
// TODO Auto-generated constructor stub
this.url = url;
this.username = username;
this.pass = pass;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPass() {
return pass;
}
public void setPass(String pass) {
this.pass = pass;
}
public Connection connec () throws SQLException {
Connection connect = DriverManager.getConnection(this.url,this.username,this.pass);
return connect;
}
}
| [
"="
] | = |
c5fddc738f8ec8f54b4164a32d48fe86f3a10066 | 706cd85cea9748ecd6fc72a251d03c06ac40a04a | /app/src/androidTest/java/com/apptec/camello/webservice/FailureCallTest.java | 454b52c847879c5e6d13f4e1de8c89eff229b7d7 | [] | no_license | willyborja95/Camello | 4d9f482cbae316ed2b00b6f5519ef7af52da19ad | 6972e3c6d0dc3af6ede236d03a06f6f2a69d43f1 | refs/heads/development | 2023-07-13T11:02:14.421467 | 2021-08-27T16:00:10 | 2021-08-27T16:00:10 | 234,410,141 | 0 | 1 | null | 2020-09-01T23:52:51 | 2020-01-16T20:55:27 | Java | UTF-8 | Java | false | false | 2,571 | java | package com.apptec.camello.webservice;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.apptec.camello.repository.webservices.ApiClient;
import com.apptec.camello.repository.webservices.GeneralCallback;
import com.apptec.camello.repository.webservices.pojoresponse.GeneralResponse;
import com.google.gson.JsonObject;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import java.util.concurrent.CountDownLatch;
import retrofit2.Call;
import retrofit2.Response;
import retrofit2.Retrofit;
import timber.log.Timber;
/**
* To see the result of this test, you should disconnect the used device from the network.
* Turn off the wifi and mobile data
*/
@RunWith(AndroidJUnit4.class)
public class FailureCallTest {
TestInterface testInterface;
Retrofit retrofit;
// Signal for wait the async all
final CountDownLatch signal = new CountDownLatch(1);
@Before
public void buildService() {
retrofit = ApiClient.getClient();
testInterface = ApiClient.getClient().create(TestInterface.class);
Timber.w("---------------------------------------------");
Timber.w("Running the test");
}
/**
* This test is for see the General Call back in action when a failure occur doing the call
* For example if you don't have internet or the endpoint does not match with the server
*/
@Test
public void testOnFailureCall() throws InterruptedException {
Timber.d("Running test: testOnFailureCall");
// We try here to do a call to a missing endpoint of the server
Timber.d("Making an async call to a missing endpoint");
// Pull the permission status
Call<GeneralResponse<JsonObject>> call = testInterface.get(ApiClient.getAccessToken());
call.enqueue(new GeneralCallback<GeneralResponse<JsonObject>>(call) {
@Override
public void onResponse(Call<GeneralResponse<JsonObject>> call, Response<GeneralResponse<JsonObject>> response) {
// With do not enqueue the call because is necessary an immediate response
Timber.d("Call executed");
Timber.d("Here is the final response body: " + response.toString());
signal.countDown();// notify the count down latch
}
});
signal.await();// wait for callback
}
@After
public void after() {
Timber.w("Test finished");
Timber.w("--------------------------------------------");
}
}
| [
"renatojobal@gmail.com"
] | renatojobal@gmail.com |
ce417264078d35dff1d2f892e0451ce7c7e757c7 | 5e408d5888bfa83d25673ba97b38c8e88f44ab34 | /app/src/test/java/com/jaloliddinabdullaev/imagetotext/ExampleUnitTest.java | f9e0670e740d0935a305d4dffa2129148aba37af | [] | no_license | jaloliddin99/imageToText | a94a6d8b72110857dd92beffeedbf254eb403bac | 42c51ceaf115e165c3a359d2192d29c67b302e11 | refs/heads/master | 2023-07-08T02:53:49.923404 | 2021-08-12T11:53:21 | 2021-08-12T11:53:21 | 395,301,375 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 396 | java | package com.jaloliddinabdullaev.imagetotext;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
} | [
"jaloliddinabdullaev49@gmail.com"
] | jaloliddinabdullaev49@gmail.com |
3bb1fe040169a199473794b36c73a264837166fe | 1aa7fb81f06851965dbf14f2247b0c77ee243541 | /example/android/app/src/main/java/com/example/reactnativeskelleton/MainApplication.java | 6b66e8f0abbbd0508b6753907b9383b9cf5e99ac | [
"MIT"
] | permissive | iagormoraes/react-native-skelleton | 0270ff9e74461b0c5ad018fdfc50019f3af63441 | 1d7506dac6e9b9a5cb4b8a994b60dab3000fc464 | refs/heads/main | 2023-04-04T12:19:07.894478 | 2021-04-18T16:48:55 | 2021-04-18T16:48:55 | 359,025,824 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,628 | java | package com.example.reactnativeskelleton;
import android.app.Application;
import android.content.Context;
import com.facebook.react.PackageList;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.ReactInstanceManager;
import com.facebook.soloader.SoLoader;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
import com.reactnativeskelleton.SkelletonPackage;
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost =
new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
@SuppressWarnings("UnnecessaryLocalVariable")
List<ReactPackage> packages = new PackageList(this).getPackages();
// Packages that cannot be autolinked yet can be added manually here, for SkelletonExample:
// packages.add(new MyReactNativePackage());
packages.add(new SkelletonPackage());
return packages;
}
@Override
protected String getJSMainModuleName() {
return "index";
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); // Remove this line if you don't want Flipper enabled
}
/**
* Loads Flipper in React Native templates.
*
* @param context
*/
private static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
if (BuildConfig.DEBUG) {
try {
/*
We use reflection here to pick up the class that initializes Flipper,
since Flipper library is not available in release mode
*/
Class<?> aClass = Class.forName("com.reactnativeskelletonExample.ReactNativeFlipper");
aClass
.getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
.invoke(null, context, reactInstanceManager);
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
}
}
}
| [
"iagor2014@outlook.com"
] | iagor2014@outlook.com |
02a7eb91eefbc08e2f774807b96aba3b8ae01cdd | bfb3d1b0cb936eca75722960ba30100abf627e08 | /flow-tests/vaadin-spring-tests/test-spring-common/src/test/java/com/vaadin/flow/spring/test/ComponentAddedViaInitListenerIT.java | abeb8dd21be586f706f765667be6c7618893a8ce | [
"Apache-2.0"
] | permissive | javier-godoy/flow | 4cedb4620708f69a36b3b28d44820f251c3ebe8f | 32bc751631f8432bc4554327287f2ca3cd566e20 | refs/heads/master | 2023-03-19T00:51:51.678362 | 2022-12-30T05:37:40 | 2022-12-30T05:37:40 | 231,390,127 | 0 | 0 | Apache-2.0 | 2020-01-02T13:43:33 | 2020-01-02T13:43:32 | null | UTF-8 | Java | false | false | 1,181 | java | /*
* Copyright 2000-2018 Vaadin Ltd.
*
* 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.vaadin.flow.spring.test;
import org.junit.Assert;
import org.junit.Test;
import com.vaadin.testbench.TestBenchElement;
public class ComponentAddedViaInitListenerIT extends AbstractSpringTest {
@Test
public void componentAddedViaInitListenerIsLoaded() {
open();
TestBenchElement component = $("init-listener-component").first();
TestBenchElement div = component.$("div").first();
Assert.assertEquals("Init Listener Component", div.getText());
}
@Override
protected String getTestPath() {
return "/";
}
}
| [
"45562391+ujoni@users.noreply.github.com"
] | 45562391+ujoni@users.noreply.github.com |
c0f1b1e0f2d2b1f7c67218e1e69458a426bf11c1 | 98057eef812ac7504ff7d6c33d60786baa1c2a25 | /src/main/java/com/algaworks/algafood/api/controller/EstadoController.java | 5c964c58e50dd0fc5fb5dbca959c4e2df7d70366 | [] | no_license | romerorussel/algafood-api | 38ff2e163ff421e19d005ba9c425fe14fd763a11 | 2874c0a6221f66eb549cd70ae114aad5d6e6b16a | refs/heads/master | 2022-12-11T05:06:18.079830 | 2020-09-17T19:33:17 | 2020-09-17T19:33:17 | 296,411,822 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 814 | java | package com.algaworks.algafood.api.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.algaworks.algafood.domain.model.Estado;
import com.algaworks.algafood.domain.repository.EstadoRepository;
@Controller
@ResponseBody
@RequestMapping(value = "/estados", produces = MediaType.APPLICATION_JSON_VALUE)
public class EstadoController {
@Autowired
private EstadoRepository estadoRepository;
@GetMapping
public List<Estado> listar(){
return estadoRepository.listar();
}
}
| [
"romerorussell@hotmail.com.br"
] | romerorussell@hotmail.com.br |
1cef95f507a4fe6c7342c09cd20471ef0026b616 | 0a13c2fc6a134ed3ed347b702569fdb07dfa3f23 | /instruction-manager/src/main/java/org/objectrepository/instruction/Console.java | 9b81b617f58922dc2f8f89d072a9bd38a66a1708 | [] | no_license | IISH/object-repository-servicenodes | 211f8d27d6f912dd4384346f08bc4d14357bb2ad | 9b2adc9ba273ed2d6f504eeabfdf5bf3da228374 | refs/heads/master | 2021-01-17T08:00:02.112674 | 2016-07-27T07:58:50 | 2016-07-27T07:58:50 | 4,248,705 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,867 | java | /*
* Copyright (c) 2012 Social History Services
*
* 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.objectrepository.instruction;
import org.objectrepository.util.InstructionTypeHelper;
import org.springframework.context.support.GenericXmlApplicationContext;
import java.lang.reflect.InvocationTargetException;
/**
* In case something calls the application from console... a main function.
* json example
*/
public final class Console {
/**
* @param args args[0] - validate/create
* args[1] - json structure example: {"instruction":{"na":"00000","fileSet":"./instruction-manager/src/test/resources/test-collection/","label":"My alias for a folder","resolverBaseUrl":"http://hdl.handle.net","lidPrefix":"HU:OSA:380:","access":"open","contentType":"image/jpg"}}
* @throws Exception
*/
public static void main(String[] args) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
InstructionType instructionType = InstructionTypeHelper.instructionTypeFromJson(args[0]);
if (instructionType == null) {
System.out.println("Expected InstructionType argument");
System.exit(1);
}
if (instructionType.getFileSet() == null) {
System.out.println("Expected InstructionType.fileSet");
System.exit(1);
}
TaskType task = InstructionTypeHelper.firstTask(instructionType);
if (task == null || task.getName() == null) {
System.out.println("Expected InstructionType.task with a name set");
System.exit(1);
}
start(instructionType);
System.exit(0);
}
public static void start(InstructionType instructionType) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException {
GenericXmlApplicationContext context = new GenericXmlApplicationContext();
context.setValidating(false);
context.load("META-INF/spring/or-manager.xml");
context.refresh();
InstructionManager instructionManager = context.getBean(InstructionManager.class);
TaskType task = InstructionTypeHelper.firstTask(instructionType);
task.setStatusCode(400);
InstructionManager.class.getMethod(task.getName(), InstructionType.class).invoke(instructionManager, instructionType);
}
}
| [
"lwo@iisg.nl"
] | lwo@iisg.nl |
a65119ac0cb86b2366e1edbcf153f5828440b2ac | 8fe06c098fd6d52980a733ef27c15165208c040e | /Helpdesk-2/src/Helpdesk.java | 7c6c8bd0474ca22b50cf5d55247b76e583d8898b | [] | no_license | emiehilbelink/oefentoetsenJAVA | 0754eeb11a7e8ee3b80b67e26698f724839b54c5 | d666941fc9c8eacaae2e1ba1fc82b80a61a51dbc | refs/heads/master | 2021-05-05T02:10:55.961228 | 2018-02-05T09:18:55 | 2018-02-05T09:18:55 | 119,711,992 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,673 | java | import exception.SysteemException;
import gebruikers.HelpdeskEmployee;
import gebruikers.User;
import org.json.JSONArray;
import org.json.JSONObject;
import ticket.HardwareTicket;
import ticket.SoftwareTicket;
import ticket.Ticket;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
/**
* Created by emiehilbelink on 29-01-18.
*/
public class Helpdesk {
private ArrayList<User> userList = new ArrayList<>();
private ArrayList<Ticket> ticketList = new ArrayList<>();
public void read (String filename) throws IOException{
JSONArray jsonArray = new JSONArray(new String(Files.readAllBytes(Paths.get(filename))));
for ( int i =0 ; i<jsonArray.length() ; i++){
JSONObject jsonObject = jsonArray.getJSONObject(i);
User user = new User(jsonObject);
userList.add(user);
}
}
public void addHelpdeskEmployee(String username, String password, String afdeling, String expertise) throws SysteemException{
HelpdeskEmployee helpdeskEmployee = new HelpdeskEmployee(username,password,afdeling,expertise);
userList.add(helpdeskEmployee);
}
public void addHardWareTicket(String date, String userName, String problem, int id) throws SysteemException{
User user = findUser(userName);
if ( user == null){
throw new SysteemException("sorry this employee doesn't excist");
}
HardwareTicket hardwareTicket = new HardwareTicket(date,problem,user,id);
ticketList.add(hardwareTicket);
}
public void addsoftwareTicket(String date, String userName, String problem, String pack) throws SysteemException{
User user = findUser(userName);
if ( user == null){
throw new SysteemException("sorry this employee doesn't excist");
}
SoftwareTicket softwareTicket = new SoftwareTicket(date,problem,user,pack);
ticketList.add(softwareTicket);
}
public void solveTicket(int ticketnumber, String userName, String solution) throws SysteemException{
Ticket ticket = findTicketNumer(ticketnumber);
if ( ticket == null){
throw new SysteemException("sorry this number doensnt excist");
}
User user = findUser(userName);
if ( user == null){
throw new SysteemException("sorry this employee doens;t excist");
}
if ( user instanceof HelpdeskEmployee){
ticket.solved((HelpdeskEmployee) user,solution);
}else{
throw new SysteemException("sorry this isnt nog an helpdeskemployee");
}
// wat gaat hier fout? als ik op debug zet dan staad er werl nettjes dat t is doorgeven
// de eception wordt namelijk niet getoond.
}
public String printTickets(){
String tickets = "Tickets";
for ( Ticket ticket : ticketList){
tickets += "\n" + ticket;
}
return tickets;
}
public String printAllEmployee(){
String string = "Employees";
for ( User user : userList ){
string += "\n" + user;
}
return string;
}
private Ticket findTicketNumer(int ticketnumber){
for ( Ticket ticket : ticketList){
if ( ticket.getNumberOfTicket() == ticketnumber){
return ticket;
}
}
return null;
}
private User findUser(String userName){
for ( User user : userList){
if ( user.getUserName().equalsIgnoreCase(userName)){
return user;
}
}
return null;
}
}
| [
"emiehilbelink@hotmail.com"
] | emiehilbelink@hotmail.com |
5d519560020d3539ba5e246824b0d74e65b96474 | 6bb7e31cf993a144e348c79b2e9d7db660e8b408 | /Seminar8/src/ro/ase/cts/proxy/clase/IOperatorRezervare.java | 23c19ec7804f949530b01fb7fd88f09270bd5180 | [] | no_license | oprealaura18/CTS---Java | 44ad639bed202818249ddaa71a22370ec1cdb323 | 74296e469a125eb1eb21e6a8f09eb7b7e8ad5681 | refs/heads/master | 2023-05-17T20:16:41.806170 | 2021-06-09T17:20:52 | 2021-06-09T17:20:52 | 342,203,904 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 111 | java | package ro.ase.cts.proxy.clase;
public interface IOperatorRezervare {
public void rezerva(int nrPersoane);
} | [
"oprealaura18@stud.ase.ro"
] | oprealaura18@stud.ase.ro |
978214b41fb55336f1ca05b37550f55d10af4720 | 9c0c046178bf27b99d9b7bac281b217e48a06b97 | /corejavatraining/src/com/vm/training/java/jdbc/Train.java | 56631d8cdd0cf9a74a61cb0092c9dfa8bedb2e2f | [] | no_license | gudasrinivasakoushik/TrainingValuemomentum | a7a1f4c73e607131e4d07cea245c3dd66684da7d | 7efb342848fbcb363ea85b1bc442752e9d2d9d95 | refs/heads/master | 2023-05-15T06:06:24.194903 | 2021-06-11T04:48:06 | 2021-06-11T04:48:06 | 372,367,204 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,376 | java | package com.vm.training.java.jdbc;
public class Train {
private int trainNo;
private String trainName;
private String source;
private String destination;
private Double ticketPrice;
public Train(int trainNo, String trainName, String source, String destination, Double ticketPrice) {
super();
this.trainNo = trainNo;
this.trainName = trainName;
this.source = source;
this.destination = destination;
this.ticketPrice = ticketPrice;
}
public int getTrainNo() {
return trainNo;
}
public void setTrainNo(int trainNo) {
this.trainNo = trainNo;
}
public String getTrainName() {
return trainName;
}
public void setTrainName(String trainName) {
this.trainName = trainName;
}
public String getSource() {
return source;
}
public void setSource(String source) {
this.source = source;
}
public String getDestination() {
return destination;
}
public void setDestination(String destination) {
this.destination = destination;
}
public Double getTicketPrice() {
return ticketPrice;
}
public void setTicketPrice(Double ticketPrice) {
this.ticketPrice = ticketPrice;
}
@Override
public String toString() {
return "Train [trainNo=" + trainNo + ", trainName=" + trainName + ", source=" + source + ", destination="
+ destination + ", ticketPrice=" + ticketPrice + "]";
}
}
| [
"DELL@DESKTOP-741RIGR"
] | DELL@DESKTOP-741RIGR |
da638a479560c6b36c1441888ae027d6e00a8d7a | 765dc6fede556f8e0e64da3fabb42e673bf3e204 | /Section8/Video8.3/Animations/app/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r/android/support/v7/recyclerview/R.java | b0a845d414e18ea4487e8e1e92b4db25549aa7c1 | [
"MIT"
] | permissive | PacktPublishing/Hands-On-Android-Material-Design | baf98da78bf49cfdd98448590660928e256434d9 | a7a8c95f571e84b0a84c1814d89fac6d6e26d16f | refs/heads/master | 2023-02-21T16:24:21.319884 | 2021-01-18T08:38:57 | 2021-01-18T08:38:57 | 166,975,495 | 11 | 5 | null | null | null | null | UTF-8 | Java | false | false | 14,564 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* gradle plugin from the resource data it found. It
* should not be modified by hand.
*/
package android.support.v7.recyclerview;
public final class R {
private R() {}
public static final class attr {
private attr() {}
public static final int alpha = 0x7f040027;
public static final int coordinatorLayoutStyle = 0x7f0400a4;
public static final int fastScrollEnabled = 0x7f0400d0;
public static final int fastScrollHorizontalThumbDrawable = 0x7f0400d1;
public static final int fastScrollHorizontalTrackDrawable = 0x7f0400d2;
public static final int fastScrollVerticalThumbDrawable = 0x7f0400d3;
public static final int fastScrollVerticalTrackDrawable = 0x7f0400d4;
public static final int font = 0x7f0400d7;
public static final int fontProviderAuthority = 0x7f0400d9;
public static final int fontProviderCerts = 0x7f0400da;
public static final int fontProviderFetchStrategy = 0x7f0400db;
public static final int fontProviderFetchTimeout = 0x7f0400dc;
public static final int fontProviderPackage = 0x7f0400dd;
public static final int fontProviderQuery = 0x7f0400de;
public static final int fontStyle = 0x7f0400df;
public static final int fontVariationSettings = 0x7f0400e0;
public static final int fontWeight = 0x7f0400e1;
public static final int keylines = 0x7f04010d;
public static final int layoutManager = 0x7f040111;
public static final int layout_anchor = 0x7f040112;
public static final int layout_anchorGravity = 0x7f040113;
public static final int layout_behavior = 0x7f040114;
public static final int layout_dodgeInsetEdges = 0x7f040140;
public static final int layout_insetEdge = 0x7f040149;
public static final int layout_keyline = 0x7f04014a;
public static final int reverseLayout = 0x7f040185;
public static final int spanCount = 0x7f04019a;
public static final int stackFromEnd = 0x7f0401a0;
public static final int statusBarBackground = 0x7f0401a6;
public static final int ttcIndex = 0x7f040208;
}
public static final class color {
private color() {}
public static final int notification_action_color_filter = 0x7f06006c;
public static final int notification_icon_bg_color = 0x7f06006d;
public static final int ripple_material_light = 0x7f060078;
public static final int secondary_text_default_material_light = 0x7f06007a;
}
public static final class dimen {
private dimen() {}
public static final int compat_button_inset_horizontal_material = 0x7f07004e;
public static final int compat_button_inset_vertical_material = 0x7f07004f;
public static final int compat_button_padding_horizontal_material = 0x7f070050;
public static final int compat_button_padding_vertical_material = 0x7f070051;
public static final int compat_control_corner_material = 0x7f070052;
public static final int compat_notification_large_icon_max_height = 0x7f070053;
public static final int compat_notification_large_icon_max_width = 0x7f070054;
public static final int fastscroll_default_thickness = 0x7f070083;
public static final int fastscroll_margin = 0x7f070084;
public static final int fastscroll_minimum_range = 0x7f070085;
public static final int item_touch_helper_max_drag_scroll_per_frame = 0x7f07008d;
public static final int item_touch_helper_swipe_escape_max_velocity = 0x7f07008e;
public static final int item_touch_helper_swipe_escape_velocity = 0x7f07008f;
public static final int notification_action_icon_size = 0x7f0700c0;
public static final int notification_action_text_size = 0x7f0700c1;
public static final int notification_big_circle_margin = 0x7f0700c2;
public static final int notification_content_margin_start = 0x7f0700c3;
public static final int notification_large_icon_height = 0x7f0700c4;
public static final int notification_large_icon_width = 0x7f0700c5;
public static final int notification_main_column_padding_top = 0x7f0700c6;
public static final int notification_media_narrow_margin = 0x7f0700c7;
public static final int notification_right_icon_size = 0x7f0700c8;
public static final int notification_right_side_padding_top = 0x7f0700c9;
public static final int notification_small_icon_background_padding = 0x7f0700ca;
public static final int notification_small_icon_size_as_large = 0x7f0700cb;
public static final int notification_subtext_size = 0x7f0700cc;
public static final int notification_top_pad = 0x7f0700cd;
public static final int notification_top_pad_large_text = 0x7f0700ce;
}
public static final class drawable {
private drawable() {}
public static final int notification_action_background = 0x7f08006d;
public static final int notification_bg = 0x7f08006e;
public static final int notification_bg_low = 0x7f08006f;
public static final int notification_bg_low_normal = 0x7f080070;
public static final int notification_bg_low_pressed = 0x7f080071;
public static final int notification_bg_normal = 0x7f080072;
public static final int notification_bg_normal_pressed = 0x7f080073;
public static final int notification_icon_background = 0x7f080074;
public static final int notification_template_icon_bg = 0x7f080075;
public static final int notification_template_icon_low_bg = 0x7f080076;
public static final int notification_tile_bg = 0x7f080077;
public static final int notify_panel_notification_icon_bg = 0x7f080078;
}
public static final class id {
private id() {}
public static final int action_container = 0x7f09000d;
public static final int action_divider = 0x7f09000f;
public static final int action_image = 0x7f090010;
public static final int action_text = 0x7f090016;
public static final int actions = 0x7f090017;
public static final int async = 0x7f09001d;
public static final int blocking = 0x7f090021;
public static final int bottom = 0x7f090022;
public static final int chronometer = 0x7f090029;
public static final int end = 0x7f09003e;
public static final int forever = 0x7f090049;
public static final int icon = 0x7f090050;
public static final int icon_group = 0x7f090051;
public static final int info = 0x7f090054;
public static final int italic = 0x7f090056;
public static final int item_touch_helper_previous_elevation = 0x7f090057;
public static final int left = 0x7f09005a;
public static final int line1 = 0x7f09005b;
public static final int line3 = 0x7f09005c;
public static final int none = 0x7f090068;
public static final int normal = 0x7f090069;
public static final int notification_background = 0x7f09006a;
public static final int notification_main_column = 0x7f09006b;
public static final int notification_main_column_container = 0x7f09006c;
public static final int right = 0x7f090078;
public static final int right_icon = 0x7f090079;
public static final int right_side = 0x7f09007a;
public static final int start = 0x7f0900a1;
public static final int tag_transition_group = 0x7f0900a6;
public static final int tag_unhandled_key_event_manager = 0x7f0900a7;
public static final int tag_unhandled_key_listeners = 0x7f0900a8;
public static final int text = 0x7f0900a9;
public static final int text2 = 0x7f0900aa;
public static final int time = 0x7f0900b2;
public static final int title = 0x7f0900b3;
public static final int top = 0x7f0900b6;
}
public static final class integer {
private integer() {}
public static final int status_bar_notification_info_maxnum = 0x7f0a000e;
}
public static final class layout {
private layout() {}
public static final int notification_action = 0x7f0c002d;
public static final int notification_action_tombstone = 0x7f0c002e;
public static final int notification_template_custom_big = 0x7f0c002f;
public static final int notification_template_icon_group = 0x7f0c0030;
public static final int notification_template_part_chronometer = 0x7f0c0031;
public static final int notification_template_part_time = 0x7f0c0032;
}
public static final class string {
private string() {}
public static final int status_bar_notification_info_overflow = 0x7f0e0036;
}
public static final class style {
private style() {}
public static final int TextAppearance_Compat_Notification = 0x7f0f0115;
public static final int TextAppearance_Compat_Notification_Info = 0x7f0f0116;
public static final int TextAppearance_Compat_Notification_Line2 = 0x7f0f0117;
public static final int TextAppearance_Compat_Notification_Time = 0x7f0f0118;
public static final int TextAppearance_Compat_Notification_Title = 0x7f0f0119;
public static final int Widget_Compat_NotificationActionContainer = 0x7f0f01bf;
public static final int Widget_Compat_NotificationActionText = 0x7f0f01c0;
public static final int Widget_Support_CoordinatorLayout = 0x7f0f01ef;
}
public static final class styleable {
private styleable() {}
public static final int[] ColorStateListItem = { 0x10101a5, 0x101031f, 0x7f040027 };
public static final int ColorStateListItem_android_color = 0;
public static final int ColorStateListItem_android_alpha = 1;
public static final int ColorStateListItem_alpha = 2;
public static final int[] CoordinatorLayout = { 0x7f04010d, 0x7f0401a6 };
public static final int CoordinatorLayout_keylines = 0;
public static final int CoordinatorLayout_statusBarBackground = 1;
public static final int[] CoordinatorLayout_Layout = { 0x10100b3, 0x7f040112, 0x7f040113, 0x7f040114, 0x7f040140, 0x7f040149, 0x7f04014a };
public static final int CoordinatorLayout_Layout_android_layout_gravity = 0;
public static final int CoordinatorLayout_Layout_layout_anchor = 1;
public static final int CoordinatorLayout_Layout_layout_anchorGravity = 2;
public static final int CoordinatorLayout_Layout_layout_behavior = 3;
public static final int CoordinatorLayout_Layout_layout_dodgeInsetEdges = 4;
public static final int CoordinatorLayout_Layout_layout_insetEdge = 5;
public static final int CoordinatorLayout_Layout_layout_keyline = 6;
public static final int[] FontFamily = { 0x7f0400d9, 0x7f0400da, 0x7f0400db, 0x7f0400dc, 0x7f0400dd, 0x7f0400de };
public static final int FontFamily_fontProviderAuthority = 0;
public static final int FontFamily_fontProviderCerts = 1;
public static final int FontFamily_fontProviderFetchStrategy = 2;
public static final int FontFamily_fontProviderFetchTimeout = 3;
public static final int FontFamily_fontProviderPackage = 4;
public static final int FontFamily_fontProviderQuery = 5;
public static final int[] FontFamilyFont = { 0x1010532, 0x1010533, 0x101053f, 0x101056f, 0x1010570, 0x7f0400d7, 0x7f0400df, 0x7f0400e0, 0x7f0400e1, 0x7f040208 };
public static final int FontFamilyFont_android_font = 0;
public static final int FontFamilyFont_android_fontWeight = 1;
public static final int FontFamilyFont_android_fontStyle = 2;
public static final int FontFamilyFont_android_ttcIndex = 3;
public static final int FontFamilyFont_android_fontVariationSettings = 4;
public static final int FontFamilyFont_font = 5;
public static final int FontFamilyFont_fontStyle = 6;
public static final int FontFamilyFont_fontVariationSettings = 7;
public static final int FontFamilyFont_fontWeight = 8;
public static final int FontFamilyFont_ttcIndex = 9;
public static final int[] GradientColor = { 0x101019d, 0x101019e, 0x10101a1, 0x10101a2, 0x10101a3, 0x10101a4, 0x1010201, 0x101020b, 0x1010510, 0x1010511, 0x1010512, 0x1010513 };
public static final int GradientColor_android_startColor = 0;
public static final int GradientColor_android_endColor = 1;
public static final int GradientColor_android_type = 2;
public static final int GradientColor_android_centerX = 3;
public static final int GradientColor_android_centerY = 4;
public static final int GradientColor_android_gradientRadius = 5;
public static final int GradientColor_android_tileMode = 6;
public static final int GradientColor_android_centerColor = 7;
public static final int GradientColor_android_startX = 8;
public static final int GradientColor_android_startY = 9;
public static final int GradientColor_android_endX = 10;
public static final int GradientColor_android_endY = 11;
public static final int[] GradientColorItem = { 0x10101a5, 0x1010514 };
public static final int GradientColorItem_android_color = 0;
public static final int GradientColorItem_android_offset = 1;
public static final int[] RecyclerView = { 0x10100c4, 0x10100f1, 0x7f0400d0, 0x7f0400d1, 0x7f0400d2, 0x7f0400d3, 0x7f0400d4, 0x7f040111, 0x7f040185, 0x7f04019a, 0x7f0401a0 };
public static final int RecyclerView_android_orientation = 0;
public static final int RecyclerView_android_descendantFocusability = 1;
public static final int RecyclerView_fastScrollEnabled = 2;
public static final int RecyclerView_fastScrollHorizontalThumbDrawable = 3;
public static final int RecyclerView_fastScrollHorizontalTrackDrawable = 4;
public static final int RecyclerView_fastScrollVerticalThumbDrawable = 5;
public static final int RecyclerView_fastScrollVerticalTrackDrawable = 6;
public static final int RecyclerView_layoutManager = 7;
public static final int RecyclerView_reverseLayout = 8;
public static final int RecyclerView_spanCount = 9;
public static final int RecyclerView_stackFromEnd = 10;
}
}
| [
"dwayned@packtpub.com"
] | dwayned@packtpub.com |
cc51e87434915a27927592fd07c442273a4436e5 | dedd8b238961dbb6889a864884e011ce152d1d5c | /src/com/squareup/okhttp/internal/spdy/Header.java | 83818f89053bc22f13e5245bd3b032d2cad76c87 | [] | no_license | reverseengineeringer/gov.cityofboston.commonwealthconnect | d553a8a7a4fcd7b846eebadb6c1e3e9294919eb7 | 1a829995d5527f4d5798fa578ca1b0fe499839e1 | refs/heads/master | 2021-01-10T05:08:31.188375 | 2016-03-19T20:37:17 | 2016-03-19T20:37:17 | 54,285,966 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,006 | java | package com.squareup.okhttp.internal.spdy;
import okio.ByteString;
public final class Header
{
public static final ByteString RESPONSE_STATUS = ByteString.encodeUtf8(":status");
public static final ByteString TARGET_AUTHORITY = ByteString.encodeUtf8(":authority");
public static final ByteString TARGET_HOST = ByteString.encodeUtf8(":host");
public static final ByteString TARGET_METHOD = ByteString.encodeUtf8(":method");
public static final ByteString TARGET_PATH = ByteString.encodeUtf8(":path");
public static final ByteString TARGET_SCHEME = ByteString.encodeUtf8(":scheme");
public static final ByteString VERSION = ByteString.encodeUtf8(":version");
final int hpackSize;
public final ByteString name;
public final ByteString value;
public Header(String paramString1, String paramString2)
{
this(ByteString.encodeUtf8(paramString1), ByteString.encodeUtf8(paramString2));
}
public Header(ByteString paramByteString, String paramString)
{
this(paramByteString, ByteString.encodeUtf8(paramString));
}
public Header(ByteString paramByteString1, ByteString paramByteString2)
{
name = paramByteString1;
value = paramByteString2;
hpackSize = (paramByteString1.size() + 32 + paramByteString2.size());
}
public boolean equals(Object paramObject)
{
boolean bool2 = false;
boolean bool1 = bool2;
if ((paramObject instanceof Header))
{
paramObject = (Header)paramObject;
bool1 = bool2;
if (name.equals(name))
{
bool1 = bool2;
if (value.equals(value)) {
bool1 = true;
}
}
}
return bool1;
}
public int hashCode()
{
return (name.hashCode() + 527) * 31 + value.hashCode();
}
public String toString()
{
return String.format("%s: %s", new Object[] { name.utf8(), value.utf8() });
}
}
/* Location:
* Qualified Name: com.squareup.okhttp.internal.spdy.Header
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"reverseengineeringer@hackeradmin.com"
] | reverseengineeringer@hackeradmin.com |
cbcf99540ac031beae9f9fd96d23c72f8b492d73 | 345ad5365e06c47918b151675de17e1df36240d2 | /main/java/com/example/test1/MainActivity.java | ca6ab3b82efc18fdaca94696930f4d78f3b65985 | [] | no_license | emdeo/Nutricoach | 383eb98ab3f9dc78e38c70ba41c8762994693b3b | 0f63abb82164f1425bbed88c40c7d8218aa3ee46 | refs/heads/master | 2020-05-31T06:39:33.881867 | 2019-06-19T08:35:39 | 2019-06-19T08:35:39 | 190,146,602 | 0 | 2 | null | 2019-06-08T15:40:08 | 2019-06-04T06:55:53 | Java | UTF-8 | Java | false | false | 345 | java | package com.example.test1;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
| [
"38254662+emdeo@users.noreply.github.com"
] | 38254662+emdeo@users.noreply.github.com |
7b58497bd7422cdfe798b58d0cae142f823ae6da | 3cfe5bb66539567fe5514c9dd2b7e1a7f4112ea3 | /android-source/app/src/main/java/ir/codetower/samanshiri/Activities/ActivationActivity.java | 8b9363fdef0266ce9113eb1aca586a316e42ccb8 | [] | no_license | atomixgroup/DigitalCatalog | 12fba469d45ab33f4993ae99b372bd43a565ead3 | 23dfa036e62f8a8b4407891909e14796bba54276 | refs/heads/master | 2022-06-20T12:53:56.355799 | 2018-07-30T19:43:57 | 2018-07-30T19:43:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,139 | java | package ir.codetower.samanshiri.Activities;
import android.content.Context;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.ProgressBar;
import java.util.HashMap;
import ir.codetower.samanshiri.App;
import ir.codetower.samanshiri.Configurations;
import ir.codetower.samanshiri.Helpers.WebService;
import ir.codetower.samanshiri.R;
public class ActivationActivity extends AppCompatActivity {
EditText code;
ProgressBar progressBar;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_activation);
code= (EditText) findViewById(R.id.code);
progressBar= (ProgressBar) findViewById(R.id.progress);
code.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable s) {
if(code.getText().length()==4){
progressBar.setVisibility(View.VISIBLE);
HashMap<String,String> params=new HashMap<String, String>();
params.put("code",code.getText()+"");
params.put("sh2", Configurations.sh2);
params.put("token",App.prefManager.getPreference("token"));
App.webService.postRequest(params, Configurations.apiUrl + "activation", new WebService.OnPostReceived() {
@Override
public void onReceived(String message) {
if(!message.equals("ERROR:0")){
App.prefManager.savePreference("sh1",message);
finish();
}
else{
App.showToast("کد وارد شده اشتباه می باشد");
}
code.setEnabled(true);
progressBar.setVisibility(View.INVISIBLE);
}
@Override
public void onReceivedError(String message) {
App.showToast("مشکل در شبکه بوجود آمده است.");
code.setEnabled(true);
progressBar.setVisibility(View.INVISIBLE);
}
});
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(code.getWindowToken(), 0);
code.setEnabled(false);
}
}
});
}
}
| [
"raminsk8er@gmail.com"
] | raminsk8er@gmail.com |
94ec316c9d5f54959f4ac8bcb1f95d97776f4183 | fcdf39a92c53734fac2b499e673a07302caaf25a | /apache/Realm.java | 8db225cea3dc498887e8d812195e05516c8fb84c | [] | no_license | Polymtl-ESIEE-UPMC/LOG6302-Reingenierie | 5ce2d0bcbf97c5af8a6b29118b6838728c2ef1de | f540ff29d633c01f0d06f9fa1716d51461c87cbb | refs/heads/master | 2021-02-18T15:43:03.143630 | 2020-04-16T23:26:41 | 2020-04-16T23:26:41 | 245,211,064 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,869 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.catalina;
import java.beans.PropertyChangeListener;
import java.io.IOException;
import java.security.Principal;
import java.security.cert.X509Certificate;
import org.apache.catalina.connector.Request;
import org.apache.catalina.connector.Response;
import org.apache.catalina.deploy.SecurityConstraint;
import org.ietf.jgss.GSSContext;
/**
* A <b>Realm</b> is a read-only facade for an underlying security realm
* used to authenticate individual users, and identify the security roles
* associated with those users. Realms can be attached at any Container
* level, but will typically only be attached to a Context, or higher level,
* Container.
*
* @author Craig R. McClanahan
*/
public interface Realm {
// ------------------------------------------------------------- Properties
/**
* Return the Container with which this Realm has been associated.
*/
public Container getContainer();
/**
* Set the Container with which this Realm has been associated.
*
* @param container The associated Container
*/
public void setContainer(Container container);
/**
* Return descriptive information about this Realm implementation and
* the corresponding version number, in the format
* <code><description>/<version></code>.
*/
public String getInfo();
// --------------------------------------------------------- Public Methods
/**
* Add a property change listener to this component.
*
* @param listener The listener to add
*/
public void addPropertyChangeListener(PropertyChangeListener listener);
/**
* Return the Principal associated with the specified username, if there
* is one; otherwise return <code>null</code>.
*
* @param username Username of the Principal to look up
*/
public Principal authenticate(String username);
/**
* Return the Principal associated with the specified username and
* credentials, if there is one; otherwise return <code>null</code>.
*
* @param username Username of the Principal to look up
* @param credentials Password or other credentials to use in
* authenticating this username
*/
public Principal authenticate(String username, String credentials);
/**
* Return the Principal associated with the specified username, which
* matches the digest calculated using the given parameters using the
* method described in RFC 2069; otherwise return <code>null</code>.
*
* @param username Username of the Principal to look up
* @param digest Digest which has been submitted by the client
* @param nonce Unique (or supposedly unique) token which has been used
* for this request
* @param realm Realm name
* @param md5a2 Second MD5 digest used to calculate the digest :
* MD5(Method + ":" + uri)
*/
public Principal authenticate(String username, String digest,
String nonce, String nc, String cnonce,
String qop, String realm,
String md5a2);
/**
* Return the Principal associated with the specified {@link GSSContext}.
* If there is none, return <code>null</code>.
*
* @param gssContext The gssContext processed by the {@link Authenticator}.
* @param storeCreds Should the realm attempt to store the delegated
* credentials in the returned Principal?
*/
public Principal authenticate(GSSContext gssContext, boolean storeCreds);
/**
* Return the Principal associated with the specified chain of X509
* client certificates. If there is none, return <code>null</code>.
*
* @param certs Array of client certificates, with the first one in
* the array being the certificate of the client itself.
*/
public Principal authenticate(X509Certificate certs[]);
/**
* Execute a periodic task, such as reloading, etc. This method will be
* invoked inside the classloading context of this container. Unexpected
* throwables will be caught and logged.
*/
public void backgroundProcess();
/**
* Return the SecurityConstraints configured to guard the request URI for
* this request, or <code>null</code> if there is no such constraint.
*
* @param request Request we are processing
*/
public SecurityConstraint [] findSecurityConstraints(Request request,
Context context);
/**
* Perform access control based on the specified authorization constraint.
* Return <code>true</code> if this constraint is satisfied and processing
* should continue, or <code>false</code> otherwise.
*
* @param request Request we are processing
* @param response Response we are creating
* @param constraint Security constraint we are enforcing
* @param context The Context to which client of this class is attached.
*
* @exception IOException if an input/output error occurs
*/
public boolean hasResourcePermission(Request request,
Response response,
SecurityConstraint [] constraint,
Context context)
throws IOException;
/**
* Return <code>true</code> if the specified Principal has the specified
* security role, within the context of this Realm; otherwise return
* <code>false</code>.
*
* @param wrapper wrapper context for evaluating role
* @param principal Principal for whom the role is to be checked
* @param role Security role to be checked
*/
public boolean hasRole(Wrapper wrapper, Principal principal, String role);
/**
* Enforce any user data constraint required by the security constraint
* guarding this request URI. Return <code>true</code> if this constraint
* was not violated and processing should continue, or <code>false</code>
* if we have created a response already.
*
* @param request Request we are processing
* @param response Response we are creating
* @param constraint Security constraint being checked
*
* @exception IOException if an input/output error occurs
*/
public boolean hasUserDataPermission(Request request,
Response response,
SecurityConstraint []constraint)
throws IOException;
/**
* Remove a property change listener from this component.
*
* @param listener The listener to remove
*/
public void removePropertyChangeListener(PropertyChangeListener listener);
}
| [
"quochao.tran.up@gmail.com"
] | quochao.tran.up@gmail.com |
5497b4b2386df571c694e03130c726f2b4c21e23 | 19e1c584ce2e0401cb83d0e7dc88bd74d5064a28 | /ws_servlet/pj_utill_dao_jdbc/src/org/utiljdbcdao/ResultList.java | 1ced327e419d1fa29ee0800cbf1916c107179a5f | [] | no_license | diegopablomansilla/ejemplos_servlet | 01cb2acfd3d46d0c2cbb9a3237a7a21ce1585f9b | 26085a6c7c80449c49298703b7684fd02d26e733 | refs/heads/master | 2021-01-20T15:22:23.366975 | 2017-02-22T13:14:16 | 2017-02-22T13:14:16 | 82,805,846 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 630 | java | package org.utiljdbcdao;
public class ResultList {
private Object[] list = new Object[0];
private Long cantPages = 0L;
private Long numberOfRecords = 0L;
public Object[] getList() {
return list;
}
public void setList(Object[] list) {
this.list = list;
}
public Long getCantPages() {
return cantPages;
}
public void setCantPages(Long cantPages) {
this.cantPages = cantPages;
}
public Long getNumberOfRecords() {
return numberOfRecords;
}
public void setNumberOfRecords(Long numberOfRecords) {
this.numberOfRecords = numberOfRecords;
}
public String toString() {
return list.toString();
}
}
| [
"diegopablomansilla@gmail.com"
] | diegopablomansilla@gmail.com |
c93a461997abb4978bf7ea58bba9c77d7fe65792 | 5084e51e1b871e083e56b62ff87865761923b8ff | /Login/app/src/main/java/com/example/myapplication/MainActivity.java | b0b68c4605a26e4e95ee5522f9c9bd740aa71272 | [] | no_license | JeevanKalair/206CDE_Group_4_Project | 0d833321608eac05a6ee52e47c1d5d8cd28b4653 | 3c391c057a224246eb73eced0cadd2170287a1cd | refs/heads/master | 2020-05-04T18:51:15.335345 | 2019-04-04T22:03:32 | 2019-04-04T22:03:32 | 179,369,020 | 0 | 0 | null | 2019-04-03T20:56:10 | 2019-04-03T20:56:10 | null | UTF-8 | Java | false | false | 4,226 | java | package com.example.myapplication;
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.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;
public class MainActivity extends AppCompatActivity {
private EditText username;
private EditText Password;
private TextView info;
private Button Login;
private int counter = 5;
private TextView userRegistration;
private FirebaseAuth firebaseAuth;
private ProgressDialog progressDialog;
private TextView ForgotPassword;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
username = (EditText) findViewById(R.id.username);
Password = (EditText) findViewById(R.id.password);
info = (TextView) findViewById(R.id.info);
Login = (Button) findViewById(R.id.btn_login);
userRegistration = (TextView) findViewById(R.id.register);
ForgotPassword = (TextView) findViewById(R.id.ForgotPassword);
info.setText("No of attempts remaining : 5");
firebaseAuth = FirebaseAuth.getInstance();
progressDialog = new ProgressDialog(this);
FirebaseUser user = firebaseAuth.getCurrentUser();
if (user != null) {
finish();
startActivity(new Intent(MainActivity.this, SecondActivity.class));
}
Login.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
validate(username.getText().toString(), Password.getText().toString());
}
});
userRegistration.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(MainActivity.this, Registration.class));
}
});
ForgotPassword.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(MainActivity.this, PasswordActivity.class));
}
});
}
private void validate(String userUsername, String userPassword) {
progressDialog.setMessage("Hello");
progressDialog.show();
firebaseAuth.signInWithEmailAndPassword(userUsername, userPassword).addOnCompleteListener(new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if (task.isSuccessful()) {
progressDialog.dismiss();
checkEmailVerification();
} else {
Toast.makeText(MainActivity.this, "Login Failed", Toast.LENGTH_SHORT).show();
counter--;
info.setText("No of attempts remaining" + counter);
progressDialog.dismiss();
if (counter == 0) {
Login.setEnabled(false);
}
}
}
});
}
private void checkEmailVerification(){
FirebaseUser firebaseUser = firebaseAuth.getInstance().getCurrentUser();
Boolean emailflag = firebaseUser.isEmailVerified();
startActivity(new Intent(MainActivity.this, SecondActivity.class));
// if(emailflag){
// finish();
// startActivity(new Intent(MainActivity.this, SecondActivity.class));
// }else{
// Toast.makeText(this, "Verify your email", Toast.LENGTH_SHORT).show();
// firebaseAuth.signOut();
}
}
| [
"noreply@github.com"
] | JeevanKalair.noreply@github.com |
c0f7e4e159d8d930f1c717ffb10660a89a16244d | d23e3b05b2817ba460db8827797ce6b72db2df1b | /app/src/main/java/com/icaroabreu/quickboxrestapiexample/webservice/model/ResponseSession.java | 8acddc953b1b8c35d8bf464974a8c084517340ba | [] | no_license | icaroabreu/QuickBoxRestApiExample | 0cbdff5c16913d8381fd832c34fb2fb23acbebdb | dc8f176191a343c924aed114e32776ac5e872ec6 | refs/heads/master | 2021-01-10T10:16:15.498021 | 2016-01-16T20:56:21 | 2016-01-16T20:56:21 | 49,790,609 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 168 | java | package com.icaroabreu.quickboxrestapiexample.webservice.model;
import lombok.Data;
@Data
public class ResponseSession {
private ResponseSessionBody session;
}
| [
"icaro.abreu@live.com"
] | icaro.abreu@live.com |
af86378ebd86743f155fa5d38657241d33912357 | cc16de383b8d4ea97d21a1b43bf4fd35b5114d19 | /flow-tests/test-root-context/src/test/java/com/vaadin/flow/uitest/ui/RemoveRoutersLayoutContentIT.java | 7e16fb64f5abdc754e9f13f94a93dffd05a3ff18 | [
"Apache-2.0"
] | permissive | vaadin/flow | 2c1e446473a2f7d53bde4e5e41c36c96189b50f0 | 9f14bcd948457c44dfc1f5cf2ad27a43153775cf | refs/heads/main | 2023-09-04T04:26:45.702508 | 2023-09-01T12:52:14 | 2023-09-01T12:52:14 | 34,809,191 | 561 | 234 | Apache-2.0 | 2023-09-14T15:11:05 | 2015-04-29T17:54:35 | Java | UTF-8 | Java | false | false | 3,181 | java | /*
* Copyright 2000-2023 Vaadin Ltd.
*
* 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.vaadin.flow.uitest.ui;
import java.util.List;
import org.junit.Assert;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import com.vaadin.flow.testutil.ChromeBrowserTest;
import com.vaadin.testbench.TestBenchElement;
import static com.vaadin.flow.uitest.servlet.RouterLayoutCustomScopeServlet.NAVIGATE_TO_ANOTHER_ROUTE_OUTSIDE_MAIN_LAYOUT_BUTTON_ID;
import static com.vaadin.flow.uitest.servlet.RouterLayoutCustomScopeServlet.NAVIGATE_TO_ANOTHER_ROUTE_INSIDE_MAIN_LAYOUT_BUTTON_ID;
import static com.vaadin.flow.uitest.servlet.RouterLayoutCustomScopeServlet.NAVIGATE_BACK_FROM_ANOTHER_ROUTE_OUTSIDE_MAIN_LAYOUT_BUTTON_ID;
import static com.vaadin.flow.uitest.servlet.RouterLayoutCustomScopeServlet.NAVIGATE_BACK_FROM_ANOTHER_ROUTE_INSIDE_MAIN_LAYOUT_BUTTON_ID;
import static com.vaadin.flow.uitest.servlet.RouterLayoutCustomScopeServlet.SUB_LAYOUT_ID;
public class RemoveRoutersLayoutContentIT extends ChromeBrowserTest {
@Override
protected String getTestPath() {
return "/router-layout-custom-scope/first-child-route";
}
@Test
public void removeUIScopedRouterLayoutContent_navigateToAnotherRouteInsideMainLayoutAndBack_subLayoutOldContentRemoved() {
open();
navigate(NAVIGATE_TO_ANOTHER_ROUTE_INSIDE_MAIN_LAYOUT_BUTTON_ID);
waitForElementPresent(By.id(
NAVIGATE_BACK_FROM_ANOTHER_ROUTE_OUTSIDE_MAIN_LAYOUT_BUTTON_ID));
navigate(
NAVIGATE_BACK_FROM_ANOTHER_ROUTE_OUTSIDE_MAIN_LAYOUT_BUTTON_ID);
waitForElementPresent(By.id(SUB_LAYOUT_ID));
assertSubLayoutHasNoOldContent();
}
@Test
public void removeUIScopedRouterLayoutContent_navigateToAnotherRouteOutsideMainLayoutAndBack_mainLayoutOldContentRemoved() {
open();
navigate(NAVIGATE_TO_ANOTHER_ROUTE_OUTSIDE_MAIN_LAYOUT_BUTTON_ID);
waitForElementPresent(By.id(
NAVIGATE_BACK_FROM_ANOTHER_ROUTE_INSIDE_MAIN_LAYOUT_BUTTON_ID));
navigate(NAVIGATE_BACK_FROM_ANOTHER_ROUTE_INSIDE_MAIN_LAYOUT_BUTTON_ID);
waitForElementPresent(By.id(SUB_LAYOUT_ID));
assertSubLayoutHasNoOldContent();
}
private void assertSubLayoutHasNoOldContent() {
TestBenchElement subLayout = $("div").id(SUB_LAYOUT_ID);
List<WebElement> subLayoutChildren = subLayout
.findElements(By.tagName("div"));
Assert.assertEquals(1, subLayoutChildren.size());
}
private void navigate(String navigateButtonId) {
$("button").id(navigateButtonId).click();
}
}
| [
"noreply@github.com"
] | vaadin.noreply@github.com |
344646a4f1950230372b352015aa5acedbc31cbc | 1b9c84725436798515c8f3153cd6d23eeec19561 | /server/src/test/java/org/elasticsearch/common/time/DateFormattersTests.java | 3c97d27fe787450c28b3a3724bd602a43661b3a2 | [
"LicenseRef-scancode-proprietary-license",
"LicenseRef-scancode-other-permissive",
"Apache-2.0"
] | permissive | mcpate/elasticsearch | caeebc20da9f1782767dcc18f9bc9fd3797c51fd | c7769fdcefaf3ff9a405ce61c5f1a18029799ae2 | refs/heads/master | 2020-03-10T01:48:51.279778 | 2019-02-26T16:58:35 | 2019-02-26T16:58:35 | 129,120,059 | 0 | 0 | Apache-2.0 | 2018-04-11T16:06:29 | 2018-04-11T16:06:29 | null | UTF-8 | Java | false | false | 14,638 | java | /*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.elasticsearch.common.time;
import org.elasticsearch.test.ESTestCase;
import java.time.Clock;
import java.time.Instant;
import java.time.ZoneId;
import java.time.ZoneOffset;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoField;
import java.time.temporal.TemporalAccessor;
import java.util.Locale;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.nullValue;
import static org.hamcrest.Matchers.sameInstance;
public class DateFormattersTests extends ESTestCase {
// this is not in the duelling tests, because the epoch millis parser in joda time drops the milliseconds after the comma
// but is able to parse the rest
// as this feature is supported it also makes sense to make it exact
public void testEpochMillisParser() {
DateFormatter formatter = DateFormatters.forPattern("epoch_millis");
{
Instant instant = Instant.from(formatter.parse("12345"));
assertThat(instant.getEpochSecond(), is(12L));
assertThat(instant.getNano(), is(345_000_000));
}
{
Instant instant = Instant.from(formatter.parse("0"));
assertThat(instant.getEpochSecond(), is(0L));
assertThat(instant.getNano(), is(0));
}
{
Instant instant = Instant.from(formatter.parse("123.123456"));
assertThat(instant.getEpochSecond(), is(0L));
assertThat(instant.getNano(), is(123123456));
}
}
public void testInvalidEpochMilliParser() {
DateFormatter formatter = DateFormatters.forPattern("epoch_millis");
IllegalArgumentException e = expectThrows(IllegalArgumentException.class, () -> formatter.parse("invalid"));
assertThat(e.getMessage(), containsString("failed to parse date field [invalid] with format [epoch_millis]"));
e = expectThrows(IllegalArgumentException.class, () -> formatter.parse("123.1234567"));
assertThat(e.getMessage(), containsString("failed to parse date field [123.1234567] with format [epoch_millis]"));
}
// this is not in the duelling tests, because the epoch second parser in joda time drops the milliseconds after the comma
// but is able to parse the rest
// as this feature is supported it also makes sense to make it exact
public void testEpochSecondParserWithFraction() {
DateFormatter formatter = DateFormatters.forPattern("epoch_second");
TemporalAccessor accessor = formatter.parse("1234.1");
Instant instant = DateFormatters.from(accessor).toInstant();
assertThat(instant.getEpochSecond(), is(1234L));
assertThat(DateFormatters.from(accessor).toInstant().getNano(), is(100_000_000));
accessor = formatter.parse("1234");
instant = DateFormatters.from(accessor).toInstant();
assertThat(instant.getEpochSecond(), is(1234L));
assertThat(instant.getNano(), is(0));
IllegalArgumentException e = expectThrows(IllegalArgumentException.class, () -> formatter.parse("abc"));
assertThat(e.getMessage(), is("failed to parse date field [abc] with format [epoch_second]"));
e = expectThrows(IllegalArgumentException.class, () -> formatter.parse("1234.abc"));
assertThat(e.getMessage(), is("failed to parse date field [1234.abc] with format [epoch_second]"));
e = expectThrows(IllegalArgumentException.class, () -> formatter.parse("1234.1234567890"));
assertThat(e.getMessage(), is("failed to parse date field [1234.1234567890] with format [epoch_second]"));
}
public void testEpochMilliParsersWithDifferentFormatters() {
DateFormatter formatter = DateFormatter.forPattern("strict_date_optional_time||epoch_millis");
TemporalAccessor accessor = formatter.parse("123");
assertThat(DateFormatters.from(accessor).toInstant().toEpochMilli(), is(123L));
assertThat(formatter.pattern(), is("strict_date_optional_time||epoch_millis"));
}
public void testParsersWithMultipleInternalFormats() throws Exception {
ZonedDateTime first = DateFormatters.from(
DateFormatters.forPattern("strict_date_optional_time_nanos").parse("2018-05-15T17:14:56+0100"));
ZonedDateTime second = DateFormatters.from(
DateFormatters.forPattern("strict_date_optional_time_nanos").parse("2018-05-15T17:14:56+01:00"));
assertThat(first, is(second));
}
public void testLocales() {
assertThat(DateFormatters.forPattern("strict_date_optional_time").locale(), is(Locale.ROOT));
Locale locale = randomLocale(random());
assertThat(DateFormatters.forPattern("strict_date_optional_time").withLocale(locale).locale(), is(locale));
}
public void testTimeZones() {
// zone is null by default due to different behaviours between java8 and above
assertThat(DateFormatters.forPattern("strict_date_optional_time").zone(), is(nullValue()));
ZoneId zoneId = randomZone();
assertThat(DateFormatters.forPattern("strict_date_optional_time").withZone(zoneId).zone(), is(zoneId));
}
public void testEqualsAndHashcode() {
assertThat(DateFormatters.forPattern("strict_date_optional_time"),
sameInstance(DateFormatters.forPattern("strict_date_optional_time")));
assertThat(DateFormatters.forPattern("YYYY"), equalTo(DateFormatters.forPattern("YYYY")));
assertThat(DateFormatters.forPattern("YYYY").hashCode(),
is(DateFormatters.forPattern("YYYY").hashCode()));
// different timezone, thus not equals
assertThat(DateFormatters.forPattern("YYYY").withZone(ZoneId.of("CET")), not(equalTo(DateFormatters.forPattern("YYYY"))));
// different locale, thus not equals
DateFormatter f1 = DateFormatters.forPattern("YYYY").withLocale(Locale.CANADA);
DateFormatter f2 = f1.withLocale(Locale.FRENCH);
assertThat(f1, not(equalTo(f2)));
// different pattern, thus not equals
assertThat(DateFormatters.forPattern("YYYY"), not(equalTo(DateFormatters.forPattern("YY"))));
DateFormatter epochSecondFormatter = DateFormatters.forPattern("epoch_second");
assertThat(epochSecondFormatter, sameInstance(DateFormatters.forPattern("epoch_second")));
assertThat(epochSecondFormatter, equalTo(DateFormatters.forPattern("epoch_second")));
assertThat(epochSecondFormatter.hashCode(), is(DateFormatters.forPattern("epoch_second").hashCode()));
DateFormatter epochMillisFormatter = DateFormatters.forPattern("epoch_millis");
assertThat(epochMillisFormatter.hashCode(), is(DateFormatters.forPattern("epoch_millis").hashCode()));
assertThat(epochMillisFormatter, sameInstance(DateFormatters.forPattern("epoch_millis")));
assertThat(epochMillisFormatter, equalTo(DateFormatters.forPattern("epoch_millis")));
}
public void testSupportBackwardsJava8Format() {
assertThat(DateFormatter.forPattern("8yyyy-MM-dd"), instanceOf(JavaDateFormatter.class));
// named formats too
assertThat(DateFormatter.forPattern("8date_optional_time"), instanceOf(JavaDateFormatter.class));
// named formats too
DateFormatter formatter = DateFormatter.forPattern("8date_optional_time||ww-MM-dd");
assertThat(formatter, instanceOf(JavaDateFormatter.class));
}
public void testEpochFormatting() {
long seconds = randomLongBetween(0, 130L * 365 * 86400); // from 1970 epoch till around 2100
long nanos = randomLongBetween(0, 999_999_999L);
Instant instant = Instant.ofEpochSecond(seconds, nanos);
DateFormatter millisFormatter = DateFormatter.forPattern("epoch_millis");
String millis = millisFormatter.format(instant);
Instant millisInstant = Instant.from(millisFormatter.parse(millis));
assertThat(millisInstant.toEpochMilli(), is(instant.toEpochMilli()));
assertThat(millisFormatter.format(Instant.ofEpochSecond(42, 0)), is("42000"));
assertThat(millisFormatter.format(Instant.ofEpochSecond(42, 123456789L)), is("42123.456789"));
DateFormatter secondsFormatter = DateFormatter.forPattern("epoch_second");
String formattedSeconds = secondsFormatter.format(instant);
Instant secondsInstant = Instant.from(secondsFormatter.parse(formattedSeconds));
assertThat(secondsInstant.getEpochSecond(), is(instant.getEpochSecond()));
assertThat(secondsFormatter.format(Instant.ofEpochSecond(42, 0)), is("42"));
}
public void testParsingStrictNanoDates() {
DateFormatter formatter = DateFormatters.forPattern("strict_date_optional_time_nanos");
formatter.format(formatter.parse("2016-01-01T00:00:00.000"));
formatter.format(formatter.parse("2018-05-15T17:14:56"));
formatter.format(formatter.parse("2018-05-15T17:14:56Z"));
formatter.format(formatter.parse("2018-05-15T17:14:56+0100"));
formatter.format(formatter.parse("2018-05-15T17:14:56+01:00"));
formatter.format(formatter.parse("2018-05-15T17:14:56.123456789Z"));
formatter.format(formatter.parse("2018-05-15T17:14:56.123456789+0100"));
formatter.format(formatter.parse("2018-05-15T17:14:56.123456789+01:00"));
}
public void testRoundupFormatterWithEpochDates() {
assertRoundupFormatter("epoch_millis", "1234567890", 1234567890L);
// also check nanos of the epoch_millis formatter if it is rounded up to the nano second
DateTimeFormatter roundUpFormatter = ((JavaDateFormatter) DateFormatter.forPattern("8epoch_millis")).getRoundupParser();
Instant epochMilliInstant = DateFormatters.from(roundUpFormatter.parse("1234567890")).toInstant();
assertThat(epochMilliInstant.getLong(ChronoField.NANO_OF_SECOND), is(890_999_999L));
assertRoundupFormatter("strict_date_optional_time||epoch_millis", "2018-10-10T12:13:14.123Z", 1539173594123L);
assertRoundupFormatter("strict_date_optional_time||epoch_millis", "1234567890", 1234567890L);
assertRoundupFormatter("strict_date_optional_time||epoch_millis", "2018-10-10", 1539215999999L);
assertRoundupFormatter("strict_date_optional_time||epoch_millis", "2019-01-25T15:37:17.346928Z", 1548430637346L);
assertRoundupFormatter("uuuu-MM-dd'T'HH:mm:ss.SSS||epoch_millis", "2018-10-10T12:13:14.123", 1539173594123L);
assertRoundupFormatter("uuuu-MM-dd'T'HH:mm:ss.SSS||epoch_millis", "1234567890", 1234567890L);
assertRoundupFormatter("epoch_second", "1234567890", 1234567890999L);
// also check nanos of the epoch_millis formatter if it is rounded up to the nano second
DateTimeFormatter epochSecondRoundupParser = ((JavaDateFormatter) DateFormatter.forPattern("8epoch_second")).getRoundupParser();
Instant epochSecondInstant = DateFormatters.from(epochSecondRoundupParser.parse("1234567890")).toInstant();
assertThat(epochSecondInstant.getLong(ChronoField.NANO_OF_SECOND), is(999_999_999L));
assertRoundupFormatter("strict_date_optional_time||epoch_second", "2018-10-10T12:13:14.123Z", 1539173594123L);
assertRoundupFormatter("strict_date_optional_time||epoch_second", "1234567890", 1234567890999L);
assertRoundupFormatter("strict_date_optional_time||epoch_second", "2018-10-10", 1539215999999L);
assertRoundupFormatter("uuuu-MM-dd'T'HH:mm:ss.SSS||epoch_second", "2018-10-10T12:13:14.123", 1539173594123L);
assertRoundupFormatter("uuuu-MM-dd'T'HH:mm:ss.SSS||epoch_second", "1234567890", 1234567890999L);
}
private void assertRoundupFormatter(String format, String input, long expectedMilliSeconds) {
JavaDateFormatter dateFormatter = (JavaDateFormatter) DateFormatter.forPattern(format);
dateFormatter.parse(input);
DateTimeFormatter roundUpFormatter = dateFormatter.getRoundupParser();
long millis = DateFormatters.from(roundUpFormatter.parse(input)).toInstant().toEpochMilli();
assertThat(millis, is(expectedMilliSeconds));
}
public void testRoundupFormatterZone() {
ZoneId zoneId = randomZone();
String format = randomFrom("epoch_second", "epoch_millis", "strict_date_optional_time", "uuuu-MM-dd'T'HH:mm:ss.SSS",
"strict_date_optional_time||date_optional_time");
JavaDateFormatter formatter = (JavaDateFormatter) DateFormatter.forPattern(format).withZone(zoneId);
DateTimeFormatter roundUpFormatter = formatter.getRoundupParser();
assertThat(roundUpFormatter.getZone(), is(zoneId));
assertThat(formatter.zone(), is(zoneId));
}
public void testRoundupFormatterLocale() {
Locale locale = randomLocale(random());
String format = randomFrom("epoch_second", "epoch_millis", "strict_date_optional_time", "uuuu-MM-dd'T'HH:mm:ss.SSS",
"strict_date_optional_time||date_optional_time");
JavaDateFormatter formatter = (JavaDateFormatter) DateFormatter.forPattern(format).withLocale(locale);
DateTimeFormatter roundupParser = formatter.getRoundupParser();
assertThat(roundupParser.getLocale(), is(locale));
assertThat(formatter.locale(), is(locale));
}
public void test0MillisAreFormatted() {
DateFormatter formatter = DateFormatter.forPattern("strict_date_time");
Clock clock = Clock.fixed(ZonedDateTime.of(2019, 02, 8, 11, 43, 00, 0,
ZoneOffset.UTC).toInstant(), ZoneOffset.UTC);
String formatted = formatter.formatMillis(clock.millis());
assertThat(formatted, is("2019-02-08T11:43:00.000Z"));
}
}
| [
"noreply@github.com"
] | mcpate.noreply@github.com |
3f23d048bc7c27fe13ce97230b323477f09c1286 | 407fb885e8a1a2478ac6dd4d2319d6e5e95d6b07 | /app/src/main/java/com/example/earthquakeapp/CustomArrayAdapter.java | 463e19426cf30a5b0d61b6dc5b086dadc64c5c28 | [] | no_license | Khushi-24/Earthquake-App | e3102bac234bd5a1b1a3e53621b6df39773c10a2 | f891706de7cc458e65e715fe7a6b9e9322ff7d4c | refs/heads/master | 2023-05-03T08:59:55.128668 | 2021-05-26T14:56:23 | 2021-05-26T14:56:23 | 337,637,140 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,422 | java | package com.example.earthquakeapp;
import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import java.util.ArrayList;
import java.util.List;
public class CustomArrayAdapter extends ArrayAdapter<Earthquake> {
public CustomArrayAdapter(Activity context, List<Earthquake> earthquakes){
super(context, 0, earthquakes);
}
@NonNull
@Override
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
View listItemView = convertView;
if(listItemView == null){
listItemView = LayoutInflater.from(getContext()).inflate(R.layout.list_item, parent,false );
}
Earthquake currentEarthquake =getItem(position);
TextView magnituteTextView = (TextView) listItemView.findViewById(R.id.mg);
magnituteTextView.setText(currentEarthquake.getMagnitude());
TextView cityTextView = (TextView) listItemView.findViewById(R.id.place);
cityTextView.setText(currentEarthquake.getcity());
TextView dateTextView = (TextView) listItemView.findViewById(R.id.date);
dateTextView.setText(currentEarthquake.getMdate());
return listItemView;
}
}
| [
"khushi.jiyani1@gmail.com"
] | khushi.jiyani1@gmail.com |
ebd99c386334dc0f36b8d79f00359741e2100ae6 | acf32ac33f12c36e4b020568a512d7941d986271 | /neutron-spi/src/main/java/org/opendaylight/neutron/spi/INeutronVPNServiceAware.java | 3378f2984e6a13e02516400b0c68ecb0ef837002 | [] | no_license | jingtingkang/neutron | edc1b47c77925e37700f0d734d06a8e3fc253280 | 9cf2468d08eff1f66df8dd767bafa0ff303ab5b8 | refs/heads/master | 2021-01-18T05:29:52.985967 | 2015-05-13T17:15:06 | 2015-05-13T17:15:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,297 | java | /*
* Copyright (C) 2015 IBM, Inc. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
package org.opendaylight.neutron.spi;
/**
* This interface defines the methods a service that wishes to be aware of NeutronVPNService needs to implement
*
*/
public interface INeutronVPNServiceAware {
/**
* Services provide this interface method to indicate if the specified NeutronVPNService can be created
*
* @param vpnService
* instance of proposed new NeutronVPNService object
* @return integer
* the return value is understood to be a HTTP status code. A return value outside of 200 through 299
* results in the create operation being interrupted and the returned status value reflected in the
* HTTP response.
*/
public int canCreateNeutronVPNService(NeutronVPNService vpnService);
/**
* Services provide this interface method for taking action after a NeutronVPNService has been created
*
* @param vpnService
* instance of new NeutronVPNService object
*/
public void neutronVPNServiceCreated(NeutronVPNService vpnService);
/**
* Services provide this interface method to indicate if the
* specified NeutronVPNService can be changed using the specified
* delta
*
* @param delta
* updates to the NeutronVPNService object using patch semantics
* @param original
* instance of the NeutronVPNService object to be updated
* @return integer
* the return value is understood to be a HTTP status code. A return value outside of 200 through 299
* results in the update operation being interrupted and the returned status value reflected in the
* HTTP response.
*/
public int canUpdateNeutronVPNService(NeutronVPNService delta, NeutronVPNService original);
/**
* Services provide this interface method for taking action after a NeutronVPNService has been updated
*
* @param vpnService
* instance of modified NeutronVPNService object
*/
public void neutronVPNServiceUpdated(NeutronVPNService vpnService);
/**
* Services provide this interface method to indicate if the specified NeutronVPNService can be deleted
*
* @param vpnService
* instance of the NeutronVPNService object to be deleted
* @return integer
* the return value is understood to be a HTTP status code. A return value outside of 200 through 299
* results in the delete operation being interrupted and the returned status value reflected in the
* HTTP response.
*/
public int canDeleteNeutronVPNService(NeutronVPNService vpnService);
/**
* Services provide this interface method for taking action after a NeutronVPNService has been deleted
*
* @param vpnService
* instance of deleted NeutronVPNService object
*/
public void neutronVPNServiceDeleted(NeutronVPNService vpnService);
}
| [
"rmoats@us.ibm.com"
] | rmoats@us.ibm.com |
d3b147add1161158f5dc08889513bca107c22a4c | 4cd11f11c7271953042afb78774fe8e196764ff0 | /mytools/src/main/java/com/oceansoft/ghclock/udpnetwork/CLIENT.java | 032700cbf0b105daa4127c50af417968b2b28a5b | [] | no_license | oceansoftlgh/MyAutoServices | 6c8e2963e2e36dcca35f583490c853fcd7487d2d | 58807a7b726dd0879609d3b9a18cb21f431bc988 | refs/heads/master | 2021-01-10T05:52:35.870287 | 2016-02-18T02:36:37 | 2016-02-18T02:36:37 | 44,003,603 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,540 | java | package com.oceansoft.ghclock.udpnetwork;
public class CLIENT {
/// <summary>
/// 心跳报
/// 参数:无
/// </summary>
public static String Test = "5000001";
/// <summary>
/// 更新医嘱缓存
/// </summary>
public static String UpdateOrders = "5001001";
/// <summary>
/// 更新病人缓存
/// </summary>
public static String UpdatePatient = "5001002";
/// <summary>
/// 更新病人和医嘱缓存
/// </summary>
public static String UpdatePatientAndOrders = "5001003";
/// <summary>
/// 更新病床缓存
/// </summary>
public static String UpdateBed = "5001004";
/// <summary>
/// 更新用户缓存
/// </summary>
public static String UpdateUser = "5001005";
/// <summary>
/// 更新事件缓存
/// </summary>
public static String UpdateEvent = "5001006";
/// <summary>
/// 更新医嘱给药途径分类缓存
/// </summary>
public static String UpdateAdministrationClass = "5001007";
/// <summary>
/// 更新医嘱给药途径缓存
/// </summary>
public static String UpdateAdministration = "5001008";
/// <summary>
/// 更新护理任务缓存
/// </summary>
public static String UpdateNursingTask = "5001009";
/// <summary>
/// 更新护理记录单模板缓存
/// </summary>
public static String UpdateNursingRecord = "5001010";
/// <summary>
/// 更新观察措施缓存
/// </summary>
public static String UpdateWatchAndMeasure = "5001011";
/// <summary>
/// 更新健康教育缓存
/// </summary>
public static String UpdateHealthEdu = "5001012";
/// <summary>
/// 更新生命体征
/// </summary>
public static String UpdateVitalSign = "5001013";
/// <summary>
/// 更新入院评估缓存
/// </summary>
public static String UpdateAssessment = "5001014";
/// <summary>
/// 更新工作班次缓存
/// </summary>
public static String UpdateWorkOrder = "5001015";
/// <summary>
/// 在线
/// 参数:病区ID、用户名、IP、终端类型
/// </summary>
public static String Online = "5002001";
/// <summary>
/// 离线
/// 参数:病区ID、用户名、IP、终端类型
/// </summary>
public static String Offline = "5002002";
/// <summary>
/// 发送文字消息
/// 参数:Ip、Name、Text
/// </summary>
public static String TextMsg = "5004001";
}
| [
"865866769@qq.com"
] | 865866769@qq.com |
b5f1dcf4502d74d3dd4ff7db9355290b62c09479 | 33dd8d6e7852d56549ce12bda5f91fb393aba72f | /src/ExemploProfessor/MatrizFuncoes.java | 8a16bcced1e056e853e47c3a0c645afb3cb71719 | [] | no_license | EquipeRocketVM/Matrizes | e4ec1179205e93895b362d8454f2154122dacbc1 | 2e2aed092084d12fe8ec24a94ba6c07bf2486600 | refs/heads/master | 2020-09-09T02:57:26.263790 | 2019-11-13T01:04:18 | 2019-11-13T01:04:18 | 221,325,430 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,436 | 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 ExemploProfessor;
import java.util.Scanner;
/**
*
* @author vitoria.csilva15
*/
public class MatrizFuncoes {
static Scanner sc = new Scanner(System.in);
static int[] tamanhoMatriz() {
// fez uma matriz para retornar somente 1 valor
int tamanho[] = new int[2];
System.out.println("Linha: ");
tamanho[0] = sc.nextInt();
System.out.println("Coluna: ");
tamanho[1] = sc.nextInt();
return tamanho;
}
static int[][] CriarMatriz(int[] tamanho) {
//Vai criar uma matriz com i + j
int[][] matriz = new int[tamanho[0]][tamanho[1]];
for (int i = 0; i < matriz.length; i++) {
for (int j = 0; j < matriz[i].length; j++) {
System.out.printf("Matriz[%d][%d] : \n ", i, j);
matriz[i][j] = sc.nextInt();
}
}
return matriz;
}
static int obterNumero() {
// Npergunta pro usuario um numero pra ver se repete na matriz
System.out.println("Digite um número: ");
int n = sc.nextInt();
return n;
}
static int verificarOco(int[][] m, int n) {
// quantas vezes o numero aparece
int cont = 0; // contador para receber a variavel dentro da matriz
for (int i = 0; i < m.length; i++) {
for (int j = 0; j < m[i].length; j++) {
if (m[i][j] == n) {
cont++;
}
}
}
return cont;
}
static void imprimirOco(int n, int cont){
System.out.printf("O número %d apareceu %d vezes", n, cont);
}
public static void main(String[] args) {
int [] t = tamanhoMatriz(); // funcao sem parametro retorna vetor
int [][] m = CriarMatriz(t); // funcao recebe um vetor e retorna uma matriz
int n = obterNumero(); // funcao que nao tem parametro e retorna um inteiro
int cont = verificarOco(m, n); // funcao que recebe matriz e um inteiro e retorna um inteiro
imprimirOco(n, cont); // recebe dois inteiros e nao retorna nada
System.out.println("");
}
}
| [
"vitoria.csilva15@CAS527132W1022.senacsp.edu.br"
] | vitoria.csilva15@CAS527132W1022.senacsp.edu.br |
c69da1c375deb2be9bd25a53b9f3427d01ba4ba1 | 90f2ab54579864b96b3e5c86cc81c89ec1eb3c69 | /src/main/java/graph/Graph.java | e0f365510f93125ccf211fff747e932b5480c7a0 | [
"MIT"
] | permissive | JobayerAhmmed/DSA_Java | a9d3826d4e4be9b8f92f6d98c5ad83c000edba84 | 478b7d912d253873d53f1e2733877e8953523721 | refs/heads/master | 2021-06-23T12:26:46.740344 | 2020-11-14T14:08:19 | 2020-11-14T14:08:19 | 135,036,886 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 318 | java | package main.java.graph;
import java.util.*;
public class Graph<T> {
int V;
LinkedList<T> adj[];
public Graph(int v) {
V = v;
adj = new LinkedList[v];
for (int i = 0; i < v; i++) {
adj[i] = new LinkedList<T>();
}
}
// public void addEdge(T u, T v)
}
| [
"jobayer.ahmmed@gmail.com"
] | jobayer.ahmmed@gmail.com |
a596308922653f89d82c56b98fef1b32e5bc4401 | 84c64b21f9c3633789e4d63cda8eb575e3964e9e | /ProjetDeTest/src/start/TestMain.java | 8fba8b36a2d8b238c14e04f10f4b5bf7f28043cf | [] | no_license | StephaneJOYEUX/MonRepositoryDeTest | 7435ed8abe531099118427ef3a74f77087fa8e97 | bc6d9eb4abdc4970621a7836e5d3b7bb95302666 | refs/heads/master | 2020-07-29T20:37:43.162017 | 2019-09-21T08:41:56 | 2019-09-21T08:41:56 | 209,951,519 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 137 | java | package start;
public class TestMain {
public static void main(String[] args) {
// TODO Auto-generated method stub
}
}
| [
"stephane.joyeux@univ-lorraine.fr"
] | stephane.joyeux@univ-lorraine.fr |
dfaa3e31124ab9978806418c1ccb68aa0263a52e | 075a4cab1da7538f773d2fd37d8e5636bfb8ccf2 | /src/main/java/com/renekon/shared/connection/ModeChangeRequestQueue.java | 079394f16dcb98691bb0d17e3b0dcbe37f1afa38 | [] | no_license | Renekon/consoleChat | e814c86f98e560e637838312578cc3ed6fa3ac1b | a0ec57c43eca0b834ed204c3e87f2a86f61dd888 | refs/heads/master | 2020-03-23T11:02:58.636642 | 2018-07-20T08:09:53 | 2018-07-20T08:09:53 | 141,479,347 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 883 | java | package com.renekon.shared.connection;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.util.concurrent.ConcurrentLinkedDeque;
public class ModeChangeRequestQueue {
private final ConcurrentLinkedDeque<ModeChangeRequest> queue;
private final Selector selector;
public ModeChangeRequestQueue(Selector selector) {
queue = new ConcurrentLinkedDeque<>();
this.selector = selector;
}
void add(ModeChangeRequest request) {
queue.add(request);
}
public void process() {
ModeChangeRequest request = queue.poll();
while (request != null) {
SelectionKey key = request.connection.channel.keyFor(this.selector);
if (key != null && key.isValid()) {
key.interestOps(request.ops);
}
request = queue.poll();
}
}
}
| [
"reneko92@gmail.com"
] | reneko92@gmail.com |
0614e8a1d10e1081b665534ec940a226e74fc2cc | 91e0ec49f7bb692875b99af3fd2364ffd29c9ae0 | /src/main/java/com/kronosad/projects/twitter/kronostwit/gui/components/LinkMenuItem.java | 1968947512bdd6c6ed208f5142dc7eddb6e35c7e | [] | no_license | russjr08/KronosTwit | 46c14cd23c6b74fbd8feb162367ea7873dec1e17 | 260ba27c28cfd803e542fc56e091c624fa6f38be | HEAD | 2016-09-05T14:06:26.102304 | 2014-05-30T04:03:22 | 2014-05-30T04:03:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,274 | java | package com.kronosad.projects.twitter.kronostwit.gui.components;
import javafx.scene.Scene;
import javafx.scene.control.MenuItem;
import javafx.scene.image.ImageView;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;
import java.awt.*;
import java.io.IOException;
import java.net.URISyntaxException;
import java.net.URL;
/**
* Author russjr08
* Created at 3/29/14
*/
public class LinkMenuItem extends MenuItem {
private LinkType linkType;
private String link;
public enum LinkType {
NORMAL, REDDIT, PICTURE, HASHTAG
}
public LinkMenuItem(String link, LinkType type){
linkType = type;
this.link = link;
if(linkType == LinkType.NORMAL){
this.setText("Navigate To: " + link);
}else if(linkType == LinkType.PICTURE){
this.setText("View Image: " + link);
}else if(linkType == LinkType.REDDIT){
this.setText("Visit Subreddit: " + link);
}
this.setOnAction((e) -> {
if(linkType == LinkType.NORMAL) {
if (!Desktop.isDesktopSupported()) return;
try {
Desktop.getDesktop().browse(new URL(link).toURI());
} catch (IOException | URISyntaxException e1) {
e1.printStackTrace();
}
}else if(linkType == LinkType.PICTURE){
Stage stage = new Stage();
AnchorPane pane = new AnchorPane();
pane.getChildren().add(new ImageView(new javafx.scene.image.Image(link)));
System.out.println(link);
stage.setScene(new Scene(pane));
stage.setTitle("Viewing Image: " + link);
stage.show();
stage.sizeToScene();
}else if(linkType == LinkType.REDDIT){
if (!Desktop.isDesktopSupported()) return;
try {
Desktop.getDesktop().browse(new URL("http://www.reddit.com" + link).toURI());
} catch (IOException | URISyntaxException e1) {
e1.printStackTrace();
}
}
});
}
public String getLink(){ return link; }
public LinkType getLinkType(){ return linkType; }
}
| [
"Russell@KronosAD.com"
] | Russell@KronosAD.com |
dca2a10ef9508352464e8c8200479cc62b02ec23 | 5c1240b50dca1cb0ce465813b90aef533de967e1 | /PracticeBot/src/org/usfirst/frc/team2607/robot/SmoothedEncoder.java | a55201c928aed32399cbab952c41e50fae385a2c | [] | no_license | robovikings2607/FRC2016-betaTesting | 2c5a26cc391e2ed9761013238408048245b1bd1e | 8f3f26bd5e665f5571f9b6d8f5a6c1d385991c63 | refs/heads/master | 2021-01-10T04:24:16.610930 | 2015-10-29T01:54:31 | 2015-10-29T01:54:31 | 44,062,722 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,288 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.usfirst.frc.team2607.robot;
import java.util.Arrays;
import edu.wpi.first.wpilibj.CounterBase;
import edu.wpi.first.wpilibj.Encoder;
/**
*
* @author rossron
*/
public class SmoothedEncoder extends Encoder implements Runnable {
private int numSamples = 15;
private double[] sampleValues = new double[numSamples];
private volatile double currentRate;
int chA;
public SmoothedEncoder(int chA, int chB, boolean reversed, CounterBase.EncodingType type) {
super(chA, chB, reversed, type);
this.chA = chA;
new Thread(this).start();
}
public double getCurrentRate() {
return currentRate;
}
public double pidGet() {
return currentRate;
}
public void run() {
while (true) {
for (int i = sampleValues.length - 1; i > 0; i--) {
sampleValues[i] = sampleValues[i-1];
}
sampleValues[0] = getRate();
double[] median = Arrays.copyOfRange(sampleValues, 0, numSamples);
Arrays.sort(median);
currentRate = median[median.length/2];
try { Thread.sleep(5); } catch (Exception e) {}
}
}
}
| [
"FRC2607Dev@gmail.com"
] | FRC2607Dev@gmail.com |
dd5dc83b574fbe6dce9b62251b37b2aed85923e1 | affdd71a15474ef46a7005b3fbb6613b7d71b11c | /MJCompiler/src/rs/ac/bg/etf/pp1/ast/ExprCondFact.java | ad546ae86038432c0f59c4066fd8555491c2c2f0 | [] | no_license | ratkoamanovic/microJavaCompiler | d2b66f56090f41d860c41fb61c3fe316ed4df8d6 | 5dcdbc21d2077818527f2822c322bd122e9e2003 | refs/heads/master | 2020-12-14T12:10:19.139886 | 2020-01-18T13:20:35 | 2020-01-18T13:20:35 | 234,736,415 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,306 | java | // generated with ast extension for cup
// version 0.8
// 12/0/2020 19:54:19
package rs.ac.bg.etf.pp1.ast;
public class ExprCondFact extends CondFact {
private Expr Expr;
public ExprCondFact (Expr Expr) {
this.Expr=Expr;
if(Expr!=null) Expr.setParent(this);
}
public Expr getExpr() {
return Expr;
}
public void setExpr(Expr Expr) {
this.Expr=Expr;
}
public void accept(Visitor visitor) {
visitor.visit(this);
}
public void childrenAccept(Visitor visitor) {
if(Expr!=null) Expr.accept(visitor);
}
public void traverseTopDown(Visitor visitor) {
accept(visitor);
if(Expr!=null) Expr.traverseTopDown(visitor);
}
public void traverseBottomUp(Visitor visitor) {
if(Expr!=null) Expr.traverseBottomUp(visitor);
accept(visitor);
}
public String toString(String tab) {
StringBuffer buffer=new StringBuffer();
buffer.append(tab);
buffer.append("ExprCondFact(\n");
if(Expr!=null)
buffer.append(Expr.toString(" "+tab));
else
buffer.append(tab+" null");
buffer.append("\n");
buffer.append(tab);
buffer.append(") [ExprCondFact]");
return buffer.toString();
}
}
| [
"ratkoamanovic@gmail.com"
] | ratkoamanovic@gmail.com |
5c1ef8b68b80fec17d656bed8ff068432d67f27c | 1a2a2ccacd7ea88c9bed7b35ab1db96276060903 | /pulsar-common/src/main/java/org/apache/pulsar/common/policies/data/PoliciesUtil.java | 46a8b19d5d0576519c1226a5eb5ad9e7a4f88a6e | [
"Zlib",
"LicenseRef-scancode-protobuf",
"Apache-2.0",
"BSD-2-Clause",
"LicenseRef-scancode-unknown"
] | permissive | jwcjlu/pulsar | b462fd3b178fd99d42f95d67ccf44e7fb6f749a6 | 1f50366768e76f1a5f7084f7972167f989ddd0af | refs/heads/master | 2022-10-01T14:49:55.385095 | 2022-09-13T09:37:44 | 2022-09-13T09:37:44 | 170,303,308 | 1 | 0 | Apache-2.0 | 2019-02-12T11:02:14 | 2019-02-12T11:02:14 | null | UTF-8 | Java | false | false | 2,797 | java | /**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.pulsar.common.policies.data;
import static org.apache.pulsar.common.policies.data.Policies.FIRST_BOUNDARY;
import static org.apache.pulsar.common.policies.data.Policies.LAST_BOUNDARY;
import java.util.ArrayList;
import java.util.List;
import javax.ws.rs.core.Response;
import org.apache.pulsar.common.util.RestException;
/**
* Utils of Pulsar policies.
*/
public class PoliciesUtil {
public static BundlesData defaultBundle() {
List<String> boundaries = new ArrayList<>();
boundaries.add(FIRST_BOUNDARY);
boundaries.add(LAST_BOUNDARY);
return BundlesData.builder()
.numBundles(1)
.boundaries(boundaries)
.build();
}
public static void setStorageQuota(Policies polices, BacklogQuota quota) {
if (polices == null) {
return;
}
polices.backlog_quota_map.put(BacklogQuota.BacklogQuotaType.destination_storage, quota);
}
private static final long MAX_BUNDLES = ((long) 1) << 32;
public static BundlesData getBundles(int numBundles) {
if (numBundles <= 0) {
throw new RestException(Response.Status.BAD_REQUEST,
"Invalid number of bundles. Number of bundles has to be in the range of (0, 2^32].");
}
Long maxVal = MAX_BUNDLES;
Long segSize = maxVal / numBundles;
List<String> partitions = new ArrayList<>();
partitions.add(String.format("0x%08x", 0L));
Long curPartition = segSize;
for (int i = 0; i < numBundles; i++) {
if (i != numBundles - 1) {
partitions.add(String.format("0x%08x", curPartition));
} else {
partitions.add(String.format("0x%08x", maxVal - 1));
}
curPartition += segSize;
}
return BundlesData.builder()
.boundaries(partitions)
.numBundles(numBundles)
.build();
}
}
| [
"noreply@github.com"
] | jwcjlu.noreply@github.com |
481a08a190213fe44e3e8fd29ec43620cd1f181e | 52aa753885647b44c60abf691bfb0116be6fca4e | /src/edu/cmu/cs/stage3/alice/core/response/visualization/list/RemoveItemFromBeginning.java | c9b8e6dc693390c07e498193d1b3d867a0acc32d | [
"MIT"
] | permissive | ai-ku/langvis | 10083029599dac0a0098cdc4cbf77f3e1bdf6d43 | 4ccd37107a3dea4b7b12696270a25df9c17d579d | refs/heads/master | 2020-12-24T15:14:43.644569 | 2014-03-26T13:43:25 | 2014-03-26T14:09:03 | 15,770,922 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 379 | java | package edu.cmu.cs.stage3.alice.core.response.visualization.list;
public class RemoveItemFromBeginning extends ListVisualizationAnimation {
public class RuntimeRemoveItemFromBeginning extends RuntimeListVisualizationAnimation {
public void epilogue( double t ) {
super.epilogue( t );
getCollection().values.remove( 0 );
}
}
}
| [
"emreunal99@gmail.com"
] | emreunal99@gmail.com |
89975dfb8ea3724307c3870f5c05914f80a4a7d6 | 69ae12ecebadf92f6f292325521eab7e882134e3 | /designPattern/src/main/java/com/minghua/state/StartState.java | 74f1bea01cc74ef0954b0528fd0e371610bd2cb7 | [] | no_license | chenminghua/study | 8c6bc87eb14f04f5d605b80cc3eab38a0b2280d2 | 7b8125c00df163901700fa2044a576da0735df53 | refs/heads/master | 2022-12-09T09:32:33.261052 | 2019-08-06T08:27:18 | 2019-08-06T08:27:18 | 99,866,728 | 1 | 0 | null | 2022-11-16T07:50:33 | 2017-08-10T01:16:50 | Java | UTF-8 | Java | false | false | 306 | java | package com.minghua.state;
public class StartState implements State {
@Override
public void doAction(Context context) {
System.out.println("Player is in start state");
context.setState(this);
}
@Override
public String toString(){
return "Start State";
}
}
| [
"chenminghuaht@163.com"
] | chenminghuaht@163.com |
7f43e9e20e83e59cb1f04bdebf9bd6214c9968db | 2ba8bc95a233a4fc956d4864fa7a25808c872973 | /app/src/main/java/com/bw/movie/presenter_activity/BuyRecordActivityPresenter.java | 564904566d36d44d3a950e5e0af5f9dde2d36a2e | [] | no_license | JiangGuXu/VeidooCinema | 9f61540981a951389b57d53f982bf4da3ff6f940 | 2a0fc682afb0e2c46a26de48fcb6af73b0ede17c | refs/heads/master | 2020-04-08T10:10:56.343313 | 2018-12-27T02:29:42 | 2018-12-27T02:29:42 | 159,257,828 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,201 | java | package com.bw.movie.presenter_activity;
import android.content.Context;
import android.support.v7.widget.LinearLayoutManager;
import android.util.Log;
import android.view.View;
import android.widget.Toast;
import com.bw.movie.R;
import com.bw.movie.activity.BuyRecordActivity;
import com.bw.movie.adapter.MyAdapterBuyRecord;
import com.bw.movie.bean.BuyRecord;
import com.bw.movie.mvp.view.AppDelage;
import com.bw.movie.utils.net.HttpUtil;
import com.bw.movie.utils.net.SharedPreferencesUtils;
import com.google.gson.Gson;
import com.jcodecraeer.xrecyclerview.XRecyclerView;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/*
* 推荐影院的排期
* 2018年12月4日 18:18:30
* 赵瑜峰
* 创建了基本的这个presenter
* */
public class BuyRecordActivityPresenter extends AppDelage {
private XRecyclerView recyclerView;
private MyAdapterBuyRecord myAdapterBuyRecord;
private int count=5;
@Override
public int getLayoutId() {
return R.layout.activity_buyrecord;
}
private Context context;
@Override
public void getContext(Context context) {
this.context=context;
}
@Override
public void initData() {
super.initData();
recyclerView = get(R.id.buyrecord_recyler);
setOnclick(new View.OnClickListener() {
@Override
public void onClick(View view) {
((BuyRecordActivity)context).finish();
}
},R.id.buyrecord_return);
myAdapterBuyRecord = new MyAdapterBuyRecord(context);
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(context);
linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
recyclerView.setLayoutManager(linearLayoutManager);
recyclerView.setAdapter(myAdapterBuyRecord);
doHttp();
recyclerView.setLoadingListener(new XRecyclerView.LoadingListener() {
@Override
public void onRefresh() {
doHttp();
}
@Override
public void onLoadMore() {
count+=5;
doHttp();
}
});
}
@Override
public void successnetwork() {
super.successnetwork();
doHttp();
}
private void doHttp() {
if(SharedPreferencesUtils.getBoolean(context,"isLogin")){
int userId = SharedPreferencesUtils.getInt(context, "userId");
String sessionId = SharedPreferencesUtils.getString(context, "sessionId");
Map<String,String> map = new HashMap<>();
map.put("page","1");
map.put("count",count+"");
Map<String,String> mapHead = new HashMap<>();
mapHead.put("userId",userId+"");
mapHead.put("sessionId",sessionId);
new HttpUtil(context).result(new HttpUtil.HttpListener() {
@Override
public void success(String data) {
Log.i("aaaaa", "success: "+data);
Gson gson = new Gson();
BuyRecord buyRecord = gson.fromJson(data, BuyRecord.class);
if(buyRecord.getStatus().equals("0000")){
if(!buyRecord.getMessage().equals("无数据")){
List<BuyRecord.ResultBean> result = buyRecord.getResult();
myAdapterBuyRecord.setList(result);
recyclerView.refreshComplete();
recyclerView.loadMoreComplete();
}
}else{
Toast.makeText(context, "无数据", Toast.LENGTH_SHORT).show();
}
}
@Override
public void fail(String data) {
}
@Override
public void notNetwork(View data) {
}
}).get("/movieApi/user/v1/verify/findUserBuyTicketRecordList",map,mapHead,"buyrecord",true,true);
}else{
Toast.makeText(context, "请先登录", Toast.LENGTH_SHORT).show();
}
}
public void onresume() {
doHttp();
}
}
| [
"1261641750@qq.com"
] | 1261641750@qq.com |
f44a4f048c689be827122458df43828d63c00c51 | 51e43188a9ffae6f6018a388317bc786b962747e | /app/src/main/java/com/jagusan/apatxas/logicaNegocio/cursorReader/ExtraerInformacionPersonaDeCursor.java | 0b807578768495b6fdd654a051721d0281b7f77d | [] | no_license | jessicaaguado/apatxas | 75dad626f9fc8b8f24fd4b78f557fcf697011de3 | d9b62cd308784bf22401adb763f75f82ae60cd10 | refs/heads/master | 2021-01-02T14:09:11.885450 | 2015-03-24T09:27:38 | 2015-03-24T09:27:38 | 23,825,553 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,257 | java | package com.jagusan.apatxas.logicaNegocio.cursorReader;
import android.database.Cursor;
import com.jagusan.apatxas.modelView.PersonaListado;
import com.jagusan.apatxas.modelView.PersonaListadoReparto;
public class ExtraerInformacionPersonaDeCursor {
public static PersonaListado extraer(Cursor cursor, PersonaListado persona) {
CursorTablaPersona tablaPersonaCursor = new CursorTablaPersona(cursor);
persona.id = tablaPersonaCursor.getId();
persona.nombre = tablaPersonaCursor.getNombre();
persona.idContacto = tablaPersonaCursor.getIdContacto();
persona.uriFoto = tablaPersonaCursor.getFotoContacto();
return persona;
}
public static PersonaListadoReparto extraer(Cursor cursor, PersonaListadoReparto persona) {
CursorTablaPersona tablaPersonaCursor = new CursorTablaPersona(cursor);
persona.id = tablaPersonaCursor.getId();
persona.nombre = tablaPersonaCursor.getNombre();
persona.idContacto = tablaPersonaCursor.getIdContacto();
persona.uriFoto = tablaPersonaCursor.getFotoContacto();
persona.cantidadPago = tablaPersonaCursor.getCuantiaPago();
persona.repartoPagado = tablaPersonaCursor.getHecho();
return persona;
}
}
| [
"jessica.aguado@gmail.com"
] | jessica.aguado@gmail.com |
9778ff0d37c8035b17bdaa4e06eb4d50ef8387cd | 6803fb11b9013431c0c77385060d403a8ce08353 | /app/src/main/java/cloud/DeleteStateAsyc.java | 57b879c19fc3546ac6e2c73ff92fc89dcafdb640 | [] | no_license | ColinChappot/Projet | db3b04b1e985c342b99dffab0dd5aeb413c8a928 | 21213e17cc31cd6b16a19e6f69e31f24e63a7b74 | refs/heads/master | 2021-01-19T00:20:57.694152 | 2017-05-18T14:29:08 | 2017-05-18T14:29:08 | 87,159,052 | 0 | 0 | null | 2017-05-18T14:19:43 | 2017-04-04T07:26:12 | Java | UTF-8 | Java | false | false | 1,874 | java | package cloud;
import android.os.AsyncTask;
import com.example.colin.myapplication.backend.classes.stateApi.StateApi;
import com.example.colin.myapplication.backend.classes.stateApi.model.State;
import com.google.api.client.extensions.android.http.AndroidHttp;
import com.google.api.client.extensions.android.json.AndroidJsonFactory;
import com.google.api.client.googleapis.services.AbstractGoogleClientRequest;
import com.google.api.client.googleapis.services.GoogleClientRequestInitializer;
import java.io.IOException;
import db.DbHelper;
//permet de delete les State
public class DeleteStateAsyc extends AsyncTask<Void, Void, Long> {
private static StateApi stateApi = null;
private DbHelper db;
private long id =-1l;
public DeleteStateAsyc(long id) {
this.id = id;
}
@Override
protected void onPreExecute() {
super.onPreExecute();
}
@Override
protected Long doInBackground(Void... params) {
if (stateApi == null) {
com.example.colin.myapplication.backend.classes.stateApi.StateApi.Builder builder = new StateApi.Builder(AndroidHttp.newCompatibleTransport(),
new AndroidJsonFactory(), null);
builder.setRootUrl("https://myapplication-167216.appspot.com/_ah/api/");
builder.setGoogleClientRequestInitializer(new GoogleClientRequestInitializer() {
@Override
public void initialize(AbstractGoogleClientRequest<?> abstractGoogleClientRequest) throws IOException {
abstractGoogleClientRequest.setDisableGZipContent(true);
}
});
stateApi = builder.build();
}
try {
if (id != -1l)
stateApi.remove(id).execute();
return id;
} catch (IOException e) {
return -2l;
}
}
}
| [
"colin.chappot@students.hevs.ch"
] | colin.chappot@students.hevs.ch |
43f72c1eb3a99d74fd2b6d70ab2efac2865e58ca | 33ddf8796d5a9e9c993bc991508d804b0ba16393 | /RecursionPractice/src/RecursionPractice.java | 2f3fe4dc28413c6a1626b862c1688b391acfb7f3 | [] | no_license | gibbs2000/RecursionPractice | c249450a9db4164ab358a201b83efcd25ce15964 | 9d5785afabbee89839f3dbce83231b4d33ecb75d | refs/heads/master | 2021-03-27T09:08:43.721826 | 2018-01-08T15:46:22 | 2018-01-08T15:46:22 | 116,690,787 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,312 | java |
public class RecursionPractice {
// First example - factorial
public long factorial(long n) {
if (n == 1 || n == 0)
return 1;
else
return n * factorial(n - 1);
}
public long fibonacci(int n) {
if (n == 0) {
return 0;
} else if (n == 1) {
return 1;
} else {
return fibonacci(n - 2) + fibonacci(n - 1);
}
}
public long digitSum(int n) {
if (n < 10)
return n;
else
return n % 10 + digitSum(n / 10);
}
public int count5(int n) {
if (n < 10) {
if (n == 5)
return 1;
else
return 0;
} else if (n % 10 == 5)
return 1 + count5(n / 10);
else
return count5(n / 10);
}
public static void main(String[] args) {
RecursionPractice rp = new RecursionPractice();
// for (int n = 1; n <= 20; n++) {
// System.out.printf("Factorial %d is %,d\n", n, rp.factorial(n));
// }
// for (int n = 1; n <= 10; n++) {
// System.out.printf("The first %d terms of fibonacci sum to %,d\n", n,
// rp.fibonacci(n));
//
// }
// for (int n = 1; n <= 10; n++) {
// int x = (int) (Math.random() * 50000);
// System.out.println("The digit sum of " + x + " is " + rp.digitSum(x));
// }
int n = 2525252;
System.out.println("There are " + rp.count5(n) + " fives in " + n);
}
}
| [
"gibbonss@bishopireton.org"
] | gibbonss@bishopireton.org |
908cd62df3ad57e9592ad3069d57fe5a3dd6199b | 86ac12dfaf7d6ae4510ce11d05b7f787c0360ff3 | /Prim/Edge.java | 5536bbfb59a3d21ac10195569660c469355ec755 | [] | no_license | vslotema/Algorithms | eaa2b5cb0871c4fab4a4de668c983fab67ef7612 | ee2f5e1a21abb6e80e5f59f84d23638526fc46b7 | refs/heads/master | 2021-07-18T17:19:05.230621 | 2020-10-14T06:07:06 | 2020-10-14T06:07:06 | 220,619,496 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 579 | java |
public class Edge implements Comparable<Edge> {
private int vector1;
private int vector2;
private long weight;
public Edge(int v1, int v2, long w){
vector1 = v1;
vector2 = v2;
weight = w;
}
public int V1(){
return vector1;
}
public int V2(){
return vector2;
}
public int other(int v){
if(v == vector1){
return vector2;
}else{
return vector1;
}
}
public long getWeight(){
return weight;
}
@Override
public int compareTo(Edge o){
return Long.compare(this.getWeight(),o.getWeight());
}
}
| [
"rovs@itu.dk"
] | rovs@itu.dk |
86b605265ff25d848b83f8a232d5fc6d892ebe65 | 6026fa5a2e260f257bda8189229cc878d03de4a1 | /strawhat-fireworks-common/src/main/java/org/strawhat/fireworks/common/package-info.java | a7b807d9b92f19bfa5fc026859191f635b7188aa | [] | no_license | strawhat-experimental/strawhat-fireworks | d9b2c30dd6dd1613dc71f8b205f80d04de37c3d1 | 3ff140a4d6695c00505acc1cdfd803306da9e6a1 | refs/heads/master | 2023-06-27T18:27:10.679052 | 2021-07-28T15:08:06 | 2021-07-28T15:08:06 | 389,098,610 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 38 | java | package org.strawhat.fireworks.common; | [
"O18258280369@outlook.com"
] | O18258280369@outlook.com |
bb304a6f8ae6e0e1a5a63aec152b54c94f1a6722 | 49a0cedbd7bd3af9a90ba4c3dfc2521a5a80ca51 | /limsproduct/src/main/java/net/zjcclims/dao/TMessageUserDAOImpl.java | de898080ba0f8d892afefaf1110982db237416bf | [] | no_license | sangjiexun/limsproduct2 | a08c611e4197609f36f52c4762585664defe8248 | 7eedf8fa2944ebbd3b3769f1c4cba61864c66b3a | refs/heads/master | 2023-05-05T07:47:11.293957 | 2019-07-21T12:39:48 | 2019-07-21T12:39:48 | 234,906,524 | 0 | 0 | null | 2023-04-14T17:11:46 | 2020-01-19T13:39:52 | null | UTF-8 | Java | false | false | 7,523 | java | package net.zjcclims.dao;
import java.util.Arrays;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Set;
import javax.persistence.EntityManager;
import javax.persistence.NoResultException;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import net.zjcclims.domain.TMessageUser;
import org.skyway.spring.util.dao.AbstractJpaDao;
import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
/**
* DAO to manage TMessageUser entities.
*
*/
@Repository("TMessageUserDAO")
@Transactional
public class TMessageUserDAOImpl extends AbstractJpaDao<TMessageUser> implements
TMessageUserDAO {
/**
* Set of entity classes managed by this DAO. Typically a DAO manages a single entity.
*
*/
private final static Set<Class<?>> dataTypes = new HashSet<Class<?>>(Arrays.asList(new Class<?>[] { TMessageUser.class }));
/**
* EntityManager injected by Spring for persistence unit zjcclimsConn
*
*/
@PersistenceContext(unitName = "zjcclimsConn")
private EntityManager entityManager;
/**
* Instantiates a new TMessageUserDAOImpl
*
*/
public TMessageUserDAOImpl() {
super();
}
/**
* Get the entity manager that manages persistence unit
*
*/
public EntityManager getEntityManager() {
return entityManager;
}
/**
* Returns the set of entity classes managed by this DAO.
*
*/
public Set<Class<?>> getTypes() {
return dataTypes;
}
/**
* JPQL Query - findTMessageUserByUsername
*
*/
@Transactional
public Set<TMessageUser> findTMessageUserByUsername(String username) throws DataAccessException {
return findTMessageUserByUsername(username, -1, -1);
}
/**
* JPQL Query - findTMessageUserByUsername
*
*/
@SuppressWarnings("unchecked")
@Transactional
public Set<TMessageUser> findTMessageUserByUsername(String username, int startResult, int maxRows) throws DataAccessException {
Query query = createNamedQuery("findTMessageUserByUsername", startResult, maxRows, username);
return new LinkedHashSet<TMessageUser>(query.getResultList());
}
/**
* JPQL Query - findTMessageUserByCreateTime
*
*/
@Transactional
public Set<TMessageUser> findTMessageUserByCreateTime(java.util.Calendar createTime) throws DataAccessException {
return findTMessageUserByCreateTime(createTime, -1, -1);
}
/**
* JPQL Query - findTMessageUserByCreateTime
*
*/
@SuppressWarnings("unchecked")
@Transactional
public Set<TMessageUser> findTMessageUserByCreateTime(java.util.Calendar createTime, int startResult, int maxRows) throws DataAccessException {
Query query = createNamedQuery("findTMessageUserByCreateTime", startResult, maxRows, createTime);
return new LinkedHashSet<TMessageUser>(query.getResultList());
}
/**
* JPQL Query - findTMessageUserByCreateBy
*
*/
@Transactional
public Set<TMessageUser> findTMessageUserByCreateBy(String createBy) throws DataAccessException {
return findTMessageUserByCreateBy(createBy, -1, -1);
}
/**
* JPQL Query - findTMessageUserByCreateBy
*
*/
@SuppressWarnings("unchecked")
@Transactional
public Set<TMessageUser> findTMessageUserByCreateBy(String createBy, int startResult, int maxRows) throws DataAccessException {
Query query = createNamedQuery("findTMessageUserByCreateBy", startResult, maxRows, createBy);
return new LinkedHashSet<TMessageUser>(query.getResultList());
}
/**
* JPQL Query - findTMessageUserById
*
*/
@Transactional
public TMessageUser findTMessageUserById(Integer id) throws DataAccessException {
return findTMessageUserById(id, -1, -1);
}
/**
* JPQL Query - findTMessageUserById
*
*/
@Transactional
public TMessageUser findTMessageUserById(Integer id, int startResult, int maxRows) throws DataAccessException {
try {
Query query = createNamedQuery("findTMessageUserById", startResult, maxRows, id);
return (net.zjcclims.domain.TMessageUser) query.getSingleResult();
} catch (NoResultException nre) {
return null;
}
}
/**
* JPQL Query - findAllTMessageUsers
*
*/
@Transactional
public Set<TMessageUser> findAllTMessageUsers() throws DataAccessException {
return findAllTMessageUsers(-1, -1);
}
/**
* JPQL Query - findAllTMessageUsers
*
*/
@SuppressWarnings("unchecked")
@Transactional
public Set<TMessageUser> findAllTMessageUsers(int startResult, int maxRows) throws DataAccessException {
Query query = createNamedQuery("findAllTMessageUsers", startResult, maxRows);
return new LinkedHashSet<TMessageUser>(query.getResultList());
}
/**
* JPQL Query - findTMessageUserByPrimaryKey
*
*/
@Transactional
public TMessageUser findTMessageUserByPrimaryKey(Integer id) throws DataAccessException {
return findTMessageUserByPrimaryKey(id, -1, -1);
}
/**
* JPQL Query - findTMessageUserByPrimaryKey
*
*/
@Transactional
public TMessageUser findTMessageUserByPrimaryKey(Integer id, int startResult, int maxRows) throws DataAccessException {
try {
Query query = createNamedQuery("findTMessageUserByPrimaryKey", startResult, maxRows, id);
return (net.zjcclims.domain.TMessageUser) query.getSingleResult();
} catch (NoResultException nre) {
return null;
}
}
/**
* JPQL Query - findTMessageUserByUsernameContaining
*
*/
@Transactional
public Set<TMessageUser> findTMessageUserByUsernameContaining(String username) throws DataAccessException {
return findTMessageUserByUsernameContaining(username, -1, -1);
}
/**
* JPQL Query - findTMessageUserByUsernameContaining
*
*/
@SuppressWarnings("unchecked")
@Transactional
public Set<TMessageUser> findTMessageUserByUsernameContaining(String username, int startResult, int maxRows) throws DataAccessException {
Query query = createNamedQuery("findTMessageUserByUsernameContaining", startResult, maxRows, username);
return new LinkedHashSet<TMessageUser>(query.getResultList());
}
/**
* JPQL Query - findTMessageUserByCreateByContaining
*
*/
@Transactional
public Set<TMessageUser> findTMessageUserByCreateByContaining(String createBy) throws DataAccessException {
return findTMessageUserByCreateByContaining(createBy, -1, -1);
}
/**
* JPQL Query - findTMessageUserByCreateByContaining
*
*/
@SuppressWarnings("unchecked")
@Transactional
public Set<TMessageUser> findTMessageUserByCreateByContaining(String createBy, int startResult, int maxRows) throws DataAccessException {
Query query = createNamedQuery("findTMessageUserByCreateByContaining", startResult, maxRows, createBy);
return new LinkedHashSet<TMessageUser>(query.getResultList());
}
/**
* JPQL Query - findTMessageUserByMessageId
*
*/
@Transactional
public Set<TMessageUser> findTMessageUserByMessageId(Integer messageId) throws DataAccessException {
return findTMessageUserByMessageId(messageId, -1, -1);
}
/**
* JPQL Query - findTMessageUserByMessageId
*
*/
@SuppressWarnings("unchecked")
@Transactional
public Set<TMessageUser> findTMessageUserByMessageId(Integer messageId, int startResult, int maxRows) throws DataAccessException {
Query query = createNamedQuery("findTMessageUserByMessageId", startResult, maxRows, messageId);
return new LinkedHashSet<TMessageUser>(query.getResultList());
}
/**
* Used to determine whether or not to merge the entity or persist the entity when calling Store
* @see store
*
*
*/
public boolean canBeMerged(TMessageUser entity) {
return true;
}
}
| [
"2798779364@qq.com"
] | 2798779364@qq.com |
27144b0acdd69bd427134b08de85dcb4511f4271 | 2041581361ed98f35d46730d77c42123ce304f35 | /service/src/main/java/org/fightteam/avalon/package-info.java | 481c2ccca844d0d48dd22c0c1f835039284ce234 | [] | no_license | xManApp/avalon-1 | 06b463b0b2e86f1720007ca9f6844d0a757013e8 | de524cfed9139a36bc95b69e86986f9d75882557 | refs/heads/master | 2021-01-14T12:39:52.070506 | 2014-05-21T05:45:18 | 2014-05-21T05:45:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 708 | java | /*
* Copyright 2013-2014 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.
*/
/**
* 配置文件
*
* 提供了一些java config
*/
package org.fightteam.avalon; | [
"lzy7750015@gmail.com"
] | lzy7750015@gmail.com |
e2722cfaa800269d705dfdc58615c9e7a28ff0d2 | 2a2713ad142546fe958c241364e98417e1ca0d6f | /app/src/main/java/com/example/movies/MovieActivity.java | 0411082e199bf0bd3130fdc62b5594f94cac7dc2 | [] | no_license | KostasAnag/Movies | f71b23e559cbda82715ecdc799493fcb7c6300e8 | 0358791022f8cbd1e3c880fd2b3753ec7e42d735 | refs/heads/master | 2023-05-04T08:20:48.663811 | 2021-05-23T19:48:38 | 2021-05-23T19:48:38 | 370,143,910 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,649 | java | package com.example.movies;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RatingBar;
import android.widget.Spinner;
public class MovieActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_movie);
int movie_id = getIntent().getExtras().getInt("movie_id");
Spinner spinner3=findViewById(R.id.spinner3);
String[] categories = {"Drama", "Adventure", "Comedy", "Thriller"};
ArrayAdapter<String> adapter = new ArrayAdapter<>(MovieActivity.this, R.layout.spinner_item, R.id.txtView_item, categories);
spinner3.setAdapter(adapter);
EditText edTxt_id = findViewById(R.id.edTxt_id);
EditText edTxt_title = findViewById(R.id.edTxt_title);
EditText edTxt_Notes = findViewById(R.id.edTxt_Notes);
RatingBar ratingBar=findViewById(R.id.ratingBar);
//EditText edTxt_Category = findViewById(R.id.edTxt_Category);
//EditText edTxt_Ratings = findViewById(R.id.edTxt_Ratings);
Button btn_update = findViewById(R.id.btn_update);
Button btn_delete = findViewById(R.id.btn_delete);
Movie movie = new Movie(MovieActivity.this, movie_id);
edTxt_id.setText(String.valueOf(movie.getId()));
edTxt_title.setText(movie.getTitle());
edTxt_Notes.setText(movie.getNotes());
ratingBar.setRating(movie.getRatings());
//edTxt_Category.setText(movie.getCategory());
//edTxt_Ratings.setText(String.valueOf(movie.getRatings()));
// edTxt_rating.setRating(5);
btn_update.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
movie.setTitle(edTxt_title.getText().toString());
movie.setNotes(edTxt_Notes.getText().toString());
movie.setCategory(spinner3.getSelectedItem().toString());
movie.setRatings((int) ratingBar.getRating());
movie.update(MovieActivity.this);
MovieActivity.this.finish();
}
});
btn_delete.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
movie.delete(MovieActivity.this);
MovieActivity.this.finish();
}
});
}
}
| [
"anagnokostas@hotmail.com"
] | anagnokostas@hotmail.com |
fa037ccea259d03732f6a0264e138e109ec5bf18 | cb964503d2007dd9e6b87010b6be238c8397b17b | /src/com/gofdp/creationalpatterns/factorymethod/Pet.java | a68fae55939168f74aefb87f1415e5ab93188aa4 | [] | no_license | tommasobertoni/GoF-Design-Patterns | e5ab41c27b370a7874060d443e04425573e11a5d | 7ccd4839c299e39f9a2d2138576db7b816409f18 | refs/heads/master | 2020-06-04T05:14:16.314513 | 2015-04-20T19:50:50 | 2015-04-20T19:50:50 | 32,599,331 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 94 | java | package com.gofdp.creationalpatterns.factorymethod;
public interface Pet {
void sound();
}
| [
"topasdrum@gmail.com"
] | topasdrum@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.