blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
410
content_id
stringlengths
40
40
detected_licenses
sequencelengths
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
sequencelengths
1
1
author_id
stringlengths
0
313
a02ab61140b754bf862a66156a6fc6f382fe4d5c
bfb984ceb8cbc27302bc37d52940bd53fcd68307
/kteskera_aplikacija_2/src/main/java/org/foi/nwtis/kteskera/projekt/slusaci/SlusacAplikacije.java
7422254d5cfbaf3a7c21e75bc8ae570e78f276e8
[]
no_license
kteskera/Airplanes_App
64a290ea2ef77ea3ac21dbe19092c5ee0d856cc8
68df579b7a67d6246db2acc696ea02ab7e1718b2
refs/heads/main
2023-06-22T08:38:25.347982
2021-07-13T09:17:29
2021-07-13T09:17:29
385,545,630
0
0
null
null
null
null
UTF-8
Java
false
false
2,459
java
package org.foi.nwtis.kteskera.projekt.slusaci; import jakarta.servlet.ServletContext; import jakarta.servlet.ServletContextEvent; import jakarta.servlet.ServletContextListener; import jakarta.servlet.annotation.WebListener; import java.io.File; import java.util.logging.Level; import java.util.logging.Logger; import org.foi.nwtis.kteskera.konfiguracije.bazaPodataka.KonfiguracijaBP; import org.foi.nwtis.kteskera.konfiguracije.bazaPodataka.PostavkeBazaPodataka; import org.foi.nwtis.kteskera.projekt.dretve.PreuzimanjeLetovaAviona; import org.foi.nwtis.kteskera.projekt.dretve.PreuzimanjeMeteoPodataka; import org.foi.nwtis.kteskera.vjezba_03.konfiguracije.Konfiguracija; import org.foi.nwtis.kteskera.vjezba_03.konfiguracije.KonfiguracijaApstraktna; import org.foi.nwtis.kteskera.vjezba_03.konfiguracije.NeispravnaKonfiguracija; @WebListener public class SlusacAplikacije implements ServletContextListener { private PreuzimanjeLetovaAviona pla; private PreuzimanjeMeteoPodataka pmp; @Override public void contextDestroyed(ServletContextEvent sce) { pla.stopp(); ServletContext servletContext = sce.getServletContext(); servletContext.removeAttribute("Postavke"); servletContext.removeAttribute("PostavkeApp"); } @Override public void contextInitialized(ServletContextEvent sce) { ServletContext servletContext = sce.getServletContext(); String putanjaKonfDatoteke = servletContext.getRealPath("WEB-INF") + File.separator + servletContext.getInitParameter("konfiguracija"); String putanjaKonfDatoteke2 = servletContext.getRealPath("WEB-INF") + File.separator + servletContext.getInitParameter("postavke"); KonfiguracijaBP konfBP = new PostavkeBazaPodataka(putanjaKonfDatoteke); Konfiguracija konf; try { konf = KonfiguracijaApstraktna.preuzmiKonfiguraciju(putanjaKonfDatoteke2); konfBP.ucitajKonfiguraciju(); servletContext.setAttribute("Postavke", konfBP); servletContext.setAttribute("PostavkeApp", konf); pla = new PreuzimanjeLetovaAviona((PostavkeBazaPodataka) konfBP); pla.start(); pmp = new PreuzimanjeMeteoPodataka((PostavkeBazaPodataka) konfBP); pmp.start(); } catch (NeispravnaKonfiguracija ex) { Logger.getLogger(SlusacAplikacije.class.getName()).log(Level.SEVERE, null, ex); } } }
0375a1626f9962a4573e79863399507ab31dcd2a
9ac64d4c083a2f34c7aba33ebdd6e8ee9b30f724
/src/main/java/com/kgisl/zigwheels/config/SwaggerConfig.java
4b6291926cea984e29f3b27fcb665172e76c5dcc
[]
no_license
hajashariff/zingwheels
290d26596f61ad5e5075caf99c13409be55be10a
0a1223e9a14ea7f5ea7cbc11b7cd2c7da5126500
refs/heads/master
2020-06-24T12:57:05.584074
2019-08-01T09:59:04
2019-08-01T09:59:04
198,957,613
0
0
null
null
null
null
UTF-8
Java
false
false
755
java
package com.kgisl.zigwheels.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import springfox.documentation.builders.PathSelectors; import springfox.documentation.builders.RequestHandlerSelectors; import springfox.documentation.spi.DocumentationType; import springfox.documentation.spring.web.plugins.Docket; import springfox.documentation.swagger2.annotations.EnableSwagger2; @Configuration @EnableSwagger2 public class SwaggerConfig { @Bean public Docket api() { return new Docket(DocumentationType.SWAGGER_2) .select() .apis(RequestHandlerSelectors.basePackage("com.kgisl.zigwheels.controller")) .paths(PathSelectors.any()) .build(); } }
162ad6c65d78c71a16724fece0987cdb0ad6e337
8bbb57bdcfb042667a2bbfe07c9c93d419dcdcfa
/src/common/Magecraft/Common/Items/Magecraft_Items.java
a09c4ca5ddd1ed3b132a4e77d66ca4c4aaa845ab
[]
no_license
kk812/MageCraft
6219272363c33ba23ddf68c7821ac9dcff4f3b17
b8d01027fbbd3ee9527df05db0b36e639cc423d9
refs/heads/master
2016-09-10T19:20:41.894261
2012-09-14T05:29:36
2012-09-14T05:29:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,021
java
package Magecraft.Common.Items; import cpw.mods.fml.common.registry.LanguageRegistry; import net.minecraft.src.Item; public class Magecraft_Items { //Item variables public Item veriniteChunk; public Item veriniteIngot; public Item veriniteEssence; private Magecraft_Items() { } private static Magecraft_Items instance; public static void createInstance() { instance = new Magecraft_Items(); } public static Magecraft_Items getInstance() { return instance; } public void instantiateItems() { veriniteChunk = new VeriniteChunk(550).setIconIndex(0).setItemName("VeriniteChunk"); veriniteIngot = new VeriniteIngot(551).setIconIndex(1).setItemName("VeriniteIngot"); veriniteEssence = new VeriniteEssence(552).setIconIndex(2).setItemName("VeriniteEssence"); } public void nameItems() { LanguageRegistry.addName(veriniteChunk, "Verinite Chunk"); LanguageRegistry.addName(veriniteIngot, "Verinite Ingot"); LanguageRegistry.addName(veriniteEssence, "Verinite Essence"); } }
f4135e0a300044129fc7822267c26beda5ad3c6a
66d334ec73040e0660321525a469ed275496cb13
/app/src/main/java/com/thohao/roomdb_2table_rxjava_mvvm/utils/DataConverter.java
75020a8ea9e7d751e89990c489eef17c588420bd
[]
no_license
haopham1705/Student-Management-android
86eb00f954a11e4ee079955069eb5eaac7d537ea
de1a20f174ba5fc0c6d33d850cf22de1b27be096
refs/heads/master
2023-06-23T20:14:59.091208
2021-07-27T03:33:00
2021-07-27T03:33:00
233,378,733
1
0
null
null
null
null
UTF-8
Java
false
false
580
java
package com.thohao.roomdb_2table_rxjava_mvvm.utils; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import java.io.ByteArrayOutputStream; public class DataConverter { public static byte[] convertImageToByteArray(Bitmap bitmap) { ByteArrayOutputStream stream = new ByteArrayOutputStream(); bitmap.compress(Bitmap.CompressFormat.JPEG, 20, stream); return stream.toByteArray(); } public static Bitmap convertByteArrayToImage(byte[] array) { return BitmapFactory.decodeByteArray(array, 0, array.length); } }
4fae2ff05da93f3a84921822281525765fd33adc
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/8/8_eddccf34ec9bd4dee770b23b4dad20aa56698290/BitmapManager/8_eddccf34ec9bd4dee770b23b4dad20aa56698290_BitmapManager_t.java
67b806a1f407a077480ddb5147be147d21ac89fb
[]
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
2,812
java
/* * Copyright (C) 2007-2012 Geometer Plus <[email protected]> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ package org.geometerplus.zlibrary.ui.android.view; import android.graphics.Bitmap; import org.geometerplus.zlibrary.core.view.ZLView; class BitmapManager { private final int SIZE = 2; private final Bitmap[] myBitmaps = new Bitmap[SIZE]; private final ZLView.PageIndex[] myIndexes = new ZLView.PageIndex[SIZE]; private int myWidth; private int myHeight; private final ZLAndroidWidget myWidget; BitmapManager(ZLAndroidWidget widget) { myWidget = widget; } void setSize(int w, int h) { if (myWidth != w || myHeight != h) { myWidth = w; myHeight = h; for (int i = 0; i < SIZE; ++i) { myBitmaps[i] = null; myIndexes[i] = null; } System.gc(); System.gc(); System.gc(); } } Bitmap getBitmap(ZLView.PageIndex index) { for (int i = 0; i < SIZE; ++i) { if (index == myIndexes[i]) { return myBitmaps[i]; } } final int iIndex = getInternalIndex(index); myIndexes[iIndex] = index; if (myBitmaps[iIndex] == null) { try { myBitmaps[iIndex] = Bitmap.createBitmap(myWidth, myHeight, Bitmap.Config.RGB_565); } catch (OutOfMemoryError e) { System.gc(); System.gc(); myBitmaps[iIndex] = Bitmap.createBitmap(myWidth, myHeight, Bitmap.Config.RGB_565); } } myWidget.drawOnBitmap(myBitmaps[iIndex], index); return myBitmaps[iIndex]; } private int getInternalIndex(ZLView.PageIndex index) { for (int i = 0; i < SIZE; ++i) { if (myIndexes[i] == null) { return i; } } for (int i = 0; i < SIZE; ++i) { if (myIndexes[i] != ZLView.PageIndex.current) { return i; } } throw new RuntimeException("That's impossible"); } void reset() { for (int i = 0; i < SIZE; ++i) { myIndexes[i] = null; } } void shift(boolean forward) { for (int i = 0; i < SIZE; ++i) { if (myIndexes[i] == null) { continue; } myIndexes[i] = forward ? myIndexes[i].getPrevious() : myIndexes[i].getNext(); } } }
3e28c892b2d77bfcbe22a4fdb61749269f2597f9
1110cccfc5397ea68518c8d1316c2bc21fd8354b
/src/main/java/com/dp/persistence/service/impl/EquipmentServiceImpl.java
cffdead85300d2bc007351e279d3d2971ba16478
[]
no_license
xl526/datapersistence
d8d118d704b2bfb6d0bc077c366d6bc33ebe40c1
200d86646437a16022276e3b341374397ce6f4fa
refs/heads/master
2021-06-30T03:49:03.738140
2017-09-21T03:00:01
2017-09-21T03:00:01
104,047,128
0
0
null
null
null
null
UTF-8
Java
false
false
2,069
java
package com.dp.persistence.service.impl; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import com.dp.persistence.dao.IEquipmentDao; import com.dp.persistence.domain.Equipment; import com.dp.persistence.domain.EquipmentStatus; import com.dp.persistence.service.EquipmentService; import com.dp.persistence.service.EquipmentStatusService; import com.dp.persistence.vo.EquipmentVO; @Service public class EquipmentServiceImpl implements EquipmentService { @Autowired private IEquipmentDao equipmentDao; @Autowired private EquipmentStatusService equipmentStatusService; @Override @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED) public void saveEquipment(Equipment equipment) { equipmentDao.save(equipment); } @Override @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED) public void deleteEquipment(Long id) { equipmentDao.delete(id); } @Override @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED) public void batchSaveEquipment(List<EquipmentVO> equipments) { if (equipments != null && equipments.size() > 0) { for (EquipmentVO vo : equipments) { String ename = vo.getName(); List<Equipment> list = findEquipmentByName(ename); Equipment equipment = null; if (list == null || list.size() == 0) { equipment = new Equipment(); equipment.setEname(vo.getName()); saveEquipment(equipment); } else { equipment = list.get(0); } List<EquipmentStatus> list1 = vo.getList(); for (EquipmentStatus sta : list1) { sta.setEquipment(equipment.getId()); equipmentStatusService.saveEquipmentStatus(sta); } } } } @Override @Transactional(readOnly = true) public List<Equipment> findEquipmentByName(String name) { return equipmentDao.findByEname(name); } }
52a82c9ef9b309b1591a2d732d9b91cfd2a2774c
98e5bab0485401877317881181770e28c4251f80
/object-value-web/src/main/java/bob/spring/bobobjs/web/ObjRefBean.java
93d9c16abbc52cb9ba96fc75f1a985bd130f8d04
[]
no_license
bobmin/OVSRV
d672b745a8fc3cac0b126cbf009b1f17f05375da
6f43db38ddf3b78503cb1b252600306129d89b4d
refs/heads/master
2020-04-04T13:43:35.711273
2018-11-03T10:44:56
2018-11-03T10:44:56
155,972,882
0
0
null
null
null
null
UTF-8
Java
false
false
1,297
java
package bob.spring.bobobjs.web; import java.util.LinkedList; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.client.RestTemplate; import bob.burobjs.model.Obj; public class ObjRefBean { /** der Logger */ private final Logger log = LoggerFactory.getLogger(this.getClass()); @Autowired private RestTemplate restTemplate; public ObjRefBean() { } public List<ObjRef> searchObjRef(int otypId) { List<ObjRef> x = new LinkedList<>(); String search = String.format("otyp=%d", otypId); Obj[] objs = WebUtil.create(restTemplate).findAllObj(search); for (Obj o : objs) { x.add(new ObjRef(o.getId(), o.getName())); } log.info("refs loaded, otyp = " + otypId + ", size = " + x.size()); return x; } public static class ObjRef { private long id; private String label; public ObjRef(long id, String label) { this.id = id; this.label = label; } public long getId() { return id; } public void setId(long id) { this.id = id; } public String getLabel() { return label; } public void setLabel(String label) { this.label = label; } } }
2c55d783cccd3f0f3997c40a714a0b4f1f9b1cd9
51d117711bb50af26c83f76866b9dfd96216a95d
/android/app/src/main/java/com/flatlistsearch/MainApplication.java
e687064147a7786c4d37b4560b1cbfc9b92b767f
[]
no_license
sate99/React-Native-FlatList-with-Search
7d0c4e2e4a4537b20e50d5cdd69b23edf7d6fbcc
949f23589f3e8e74f653b1a4c52a4dd0fc70c072
refs/heads/master
2022-12-10T15:16:06.743150
2019-06-19T09:31:24
2019-06-19T09:31:24
192,702,572
0
0
null
2022-12-09T06:54:40
2019-06-19T09:33:49
Objective-C
UTF-8
Java
false
false
1,190
java
package com.flatlistsearch; import android.app.Application; import com.facebook.react.ReactApplication; import com.oblador.vectoricons.VectorIconsPackage; import com.oblador.vectoricons.VectorIconsPackage; import com.facebook.react.ReactNativeHost; import com.facebook.react.ReactPackage; import com.facebook.react.shell.MainReactPackage; import com.facebook.soloader.SoLoader; import java.util.Arrays; import java.util.List; 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() { return Arrays.<ReactPackage>asList( new MainReactPackage(), new VectorIconsPackage() ); } @Override protected String getJSMainModuleName() { return "index"; } }; @Override public ReactNativeHost getReactNativeHost() { return mReactNativeHost; } @Override public void onCreate() { super.onCreate(); SoLoader.init(this, /* native exopackage */ false); } }
2308bde8a6ac35ec1d67ba8a979bfa34cdbc6d64
729443a6493e203289befe940852a483c6f528ee
/src/main/java/me/gdzhu/exception/AppointException.java
fc1e904588a00a886eca93bf75c966c6f204f77a
[]
no_license
gdzhu8023/ssmLearn
e5e1dd4e4a1b86b8a57dd13c211e73b1bed1832c
faf174f6ea5fa08808addf83328505ee371c0f8c
refs/heads/master
2020-03-18T01:03:01.656661
2018-05-20T06:20:47
2018-05-20T06:20:47
134,125,013
0
0
null
null
null
null
UTF-8
Java
false
false
352
java
package me.gdzhu.exception; /** * Created by ZhuGuodong on 2018/5/19 16:00 * Description: 预约业务异常 */ public class AppointException extends RuntimeException { public AppointException(String message) { super(message); } public AppointException(String message, Throwable cause) { super(message, cause); } }
e7602120dcb0c413ff8bfd9ec8efc265fca29c05
616ea85dbc6a014223f5318a3ccae5748599a049
/TeamCode/2019-2020/src/main/java/org/firstinspires/ftc/teamcode/MecanumDrive.java
7d2bbef4a028208604a0a5f9a4245a8b74305533
[]
no_license
Meschdog18/kingston_robotics
a40a1916971ee8f3dd9f393f0101cc4ed9f4a415
6c8429f469e931e540e3a90b1c8c6ee68e674a8f
refs/heads/master
2022-12-24T14:41:52.749048
2020-09-28T01:02:40
2020-09-28T01:02:40
295,059,055
0
0
null
null
null
null
UTF-8
Java
false
false
4,687
java
package org.firstinspires.ftc.teamcode; import com.qualcomm.hardware.bosch.BNO055IMU; import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode; import com.qualcomm.robotcore.eventloop.opmode.TeleOp; import com.qualcomm.robotcore.hardware.DcMotor; import com.qualcomm.robotcore.hardware.DcMotorSimple; import com.qualcomm.robotcore.hardware.Servo; import com.qualcomm.robotcore.hardware.TouchSensor; import com.qualcomm.robotcore.util.ElapsedTime; import com.qualcomm.robotcore.util.Range; @TeleOp(name="MecanumDrive", group="Linear Opmode") public class MecanumDrive extends LinearOpMode{ private ElapsedTime runtime = new ElapsedTime(); private DcMotor left_rear = null; private DcMotor right_rear = null; private DcMotor left_front = null; private DcMotor right_front = null; private DcMotor fifth_motor = null; private DcMotor sixth_motor = null; public DcMotor extend= null; public Servo ball_pusher = null; BNO055IMU imu; //gyroscope TouchSensor touchLeft, touchRight; boolean touchedTriggered; @Override public void runOpMode() { telemetry.addData("Status", "Initialized"); telemetry.update(); sleep(500); left_rear = hardwareMap.get(DcMotor.class, "RearLeft"); right_rear = hardwareMap.get(DcMotor.class, "RearRight"); left_front = hardwareMap.get(DcMotor.class, "FrontLeft"); right_front = hardwareMap.get(DcMotor.class, "FrontRight"); //fifth_motor = hardwareMap.get(DcMotor.class, "FifthMotor"); //sixth_motor = hardwareMap.get(DcMotor.class, "SixthMotor"); //extend = hardwareMap.get(DcMotor.class, "lifter"); // ball_pusher = hardwareMap.get(Servo.class, "BallPusher"); // POV Mode uses left stick to go forward, and right stick to turn.5 //imu = hardwareMap.get(BNO055IMU.class, "imu"); // get a reference to touch sensor. //touchLeft = hardwareMap.touchSensor.get("TouchLeft"); //touchRight = hardwareMap.touchSensor.get("TouchRight"); left_front.setMode(DcMotor.RunMode.RUN_USING_ENCODER); right_front.setMode(DcMotor.RunMode.RUN_USING_ENCODER); right_rear.setMode(DcMotor.RunMode.RUN_USING_ENCODER); left_rear.setMode(DcMotor.RunMode.RUN_USING_ENCODER); right_front.setDirection(DcMotorSimple.Direction.REVERSE); left_front.setDirection(DcMotorSimple.Direction.REVERSE); final double maxPower = 1; // set power to zero to avoid a FTC bug right_front.setPower(0); left_front.setPower(0); left_rear.setPower(0); right_rear.setPower(0); waitForStart(); runtime.reset(); while (opModeIsActive()) { mechanum(); } } public void mechanum(){ final double maxPower = 0.5; double joy1Y = gamepad1.left_stick_x; joy1Y = Math.abs(joy1Y) > 0.15 ? joy1Y*3/4: 0; double joy1X = gamepad1.left_stick_y; joy1X = Math.abs(joy1X) > 0.15 ? joy1X*3/4: 0; double joy2X = gamepad1.right_stick_x; joy2X = Math.abs(joy2X) > 0.15 ? joy2X*3/4: 0; left_front.setPower(Math.max(-maxPower, Math.min(maxPower, joy1Y + joy2X - joy1X))); right_front.setPower(Math.max(-maxPower, Math.min(maxPower, joy1Y + joy2X + joy1X))); left_rear.setPower(Math.max(-maxPower, Math.min(maxPower, joy1Y - joy2X + joy1X))); right_rear.setPower(Math.max(-maxPower, Math.min(maxPower, joy1Y - joy2X - joy1X))); telemetry.addData("LF: ",Math.max(-maxPower, Math.min(maxPower, joy1Y + joy2X - joy1X))); telemetry.addData("RF: ",Math.max(-maxPower, Math.min(maxPower, joy1Y + joy2X + joy1X))); telemetry.addData("LR: ",Math.max(-maxPower, Math.min(maxPower, joy1Y - joy2X + joy1X))); telemetry.addData("RR: ",Math.max(-maxPower, Math.min(maxPower, joy1Y - joy2X - joy1X))); telemetry.update(); } } /* public void Mechanum(){ final double maxPower = 1; double joy1Y = -gamepad1.left_stick_x; joy1Y = Math.abs(joy1Y) > 0.15 ? joy1Y*3/4: 0; double joy1X = gamepad1.left_stick_y; joy1X = Math.abs(joy1X) > 0.15 ? joy1X*3/4: 0; double joy2X = gamepad1.right_stick_x; joy2X = Math.abs(joy2X) > 0.15 ? joy2X*3/4: 0; rf.setPower(Math.max(-maxPower, Math.min(maxPower, joy1Y + joy2X + joy1X))); lf.setPower(Math.max(-maxPower, Math.min(maxPower, joy1Y + joy2X - joy1X))); rr.setPower(Math.max(-maxPower, Math.min(maxPower, joy1Y - joy2X - joy1X))); lr.setPower(Math.max(-maxPower, Math.min(maxPower, joy1Y - joy2X + joy1X))); } */
1700cc31d11bef2cbef81bd90569ff2fac37afe5
106fd2ecb4663991686232c28e0c42c7abd5309d
/car-rent-system/app/src/main/java/br/com/car/rent/system/repository/CustomerRepository.java
b31b2dd1f8e5ca69519dbe624884077c774be5fa
[]
no_license
wesleyhsm/oauth2
d07608dc70848dafccbb4b8cb2674083706eafe7
9a6519c44008d55ea857998c1cf3ba1e8a77c09c
refs/heads/master
2023-02-22T04:41:07.861798
2021-01-27T18:59:43
2021-01-27T18:59:43
329,070,814
2
0
null
null
null
null
UTF-8
Java
false
false
634
java
package br.com.car.rent.system.repository; import java.util.Optional; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.repository.query.Param; import org.springframework.stereotype.Repository; import br.com.car.rent.system.entity.Customer; import br.com.car.rent.system.repository.user.CustomerRepositoryQuery; @Repository public interface CustomerRepository extends JpaRepository<Customer, Long>, CustomerRepositoryQuery { public Optional<Customer> findByMail(@Param("mail") final String mail); public Optional<Customer> findByCpfCnpj(@Param("cpfCnpj") final String cpfCnpj); }
b4f8ca67332be77c9cc40f86e33c2c5253834545
681c7c8cceb39a6503ba3114eabd27f6aec21871
/src/repetition/exercises/solutions/array/Exercise10.java
223d1fc636c3c20635c80d810e0e7ba893e54590
[ "MIT" ]
permissive
JonasAndree/Programmering1IT
47ff440993cb4df1f4867bb593719c6c9dfb488c
30244113eb40078ca30fe5fcf7d651aba4589ec6
refs/heads/master
2021-01-20T13:11:53.363355
2018-10-10T08:50:05
2018-10-10T08:50:05
101,739,887
0
1
null
null
null
null
UTF-8
Java
false
false
1,057
java
package repetition.exercises.solutions.array; import java.util.Arrays; public class Exercise10 { static int max; static int min; public static void maxMin(int myArray[]) { max = myArray[0]; min = myArray[0]; int len = myArray.length; for (int i = 1; i < len - 1; i = i + 2) { if (i + 1 > len) { if (myArray[i] > max) max = myArray[i]; if (myArray[i] < min) min = myArray[i]; } if (myArray[i] > myArray[i + 1]) { if (myArray[i] > max) max = myArray[i]; if (myArray[i + 1] < min) min = myArray[i + 1]; } if (myArray[i] < myArray[i + 1]) { if (myArray[i] < min) min = myArray[i]; if (myArray[i + 1] > max) max = myArray[i + 1]; } } } public static void main(String[] args) { int[] myArray = { 25, 14, 56, 15, 36, 56, 77, 18, 29, 49 }; maxMin(myArray); System.out.println(" Original Array: " + Arrays.toString(myArray)); System.out.println(" Maximum value for the above array = " + max); System.out.println(" Minimum value for the above array = " + min); } }
0005d63baf34405d6cf1e8d4917f295dadd4a8c5
7b73eb1c05b96a8d201f6187d0d1b2f5789a33a8
/src/main/java/com/json/search/document/User.java
bd1b0a09b44d757437b3917afb6efc77ce3f8e29
[]
no_license
Subangani/SearchEngine
1bfb9dbce5c18f29a717fee451aee2f4cc2a298d
cbd530346573cefca91f4710ad2ca779aed8638e
refs/heads/master
2020-07-29T07:12:05.366146
2019-09-21T16:34:19
2019-09-21T16:34:19
209,710,845
0
0
null
null
null
null
UTF-8
Java
false
false
1,760
java
package com.json.search.document; import java.util.List; public class User { private int _id; private String external_id; private String name; private String alias; private String created_at; private boolean active; private boolean verified; private boolean shared; private String locale; private String timezone; private String last_login_at; private String email; private String phone; private String signature; private int organization_id; private List<String> tags; private boolean suspended; private String role; public int get_id() { return _id; } public String getExternal_id() { return external_id; } public String getName() { return name; } public String getAlias() { return alias; } public String getCreated_at() { return created_at; } public boolean getActive() { return active; } public boolean getVerified() { return verified; } public boolean getShared() { return shared; } public String getLocale() { return locale; } public String getTimezone() { return timezone; } public String getLast_login_at() { return last_login_at; } public String getEmail() { return email; } public String getPhone() { return phone; } public String getSignature() { return signature; } public int getOrganization_id() { return organization_id; } public List<String> getTags() { return tags; } public boolean getSuspended() { return suspended; } public String getRole() { return role; } }
0323858d9c389bd307f3e87408af9c29b9794ff3
cae178a53e2d5be612efc3b73596e3a6bc5a35ef
/src/test/java/net/nro/stats/components/DummyDateTimeProvider.java
dc8e6fee358747118292e05366cfc1951b05448a
[ "BSD-3-Clause" ]
permissive
RIPE-NCC/nro-stats
834093a8a5dac82d94aa5aff436cfc7e9cfbc550
e6809723965c732cb8b8bdfc65c656a394afb9a1
refs/heads/master
2021-01-18T21:45:25.358098
2016-05-26T13:55:00
2016-05-26T13:55:00
52,441,170
2
3
null
null
null
null
UTF-8
Java
false
false
1,850
java
/** * The BSD License * * Copyright (c) 2010-2016 RIPE NCC * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * - Neither the name of the RIPE NCC nor the names of its contributors may be * used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ package net.nro.stats.components; public class DummyDateTimeProvider extends DateTimeProvider { @Override public String today() { return "today"; } @Override public String localZone() { return "localzone"; } }
8ab325f4a622d5df4f347a3716b588aaf6c754a6
5f43039745e815abebd85256c63166384c92fad2
/src/main/java/co/softbank/recieverecipe/responses/RecipeResponse.java
16a0aa573baa96310aa8da20706a86247599ec62
[]
no_license
kansenchu/recipes
6f1e73c728624a47eac7935d07d29f10fb4e8af2
c5bff3b0679b123020d0a988c467592aa9049fc6
refs/heads/master
2020-06-16T18:03:35.743928
2019-07-07T14:57:02
2019-07-07T14:57:02
195,658,621
0
0
null
null
null
null
UTF-8
Java
false
false
1,356
java
package co.softbank.recieverecipe.responses; import co.softbank.recieverecipe.models.Recipe; import co.softbank.recieverecipe.models.views.ResponseViews; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonView; import java.util.Arrays; import java.util.List; import lombok.EqualsAndHashCode; import lombok.RequiredArgsConstructor; /** * 一個のレシピを返すレスポンスを表現するクラス。 */ @EqualsAndHashCode public class RecipeResponse { @JsonView(ResponseViews.MessageOnly.class) final Message message; /** 返すメッセージ。 */ @JsonView(ResponseViews.MessageWithRecipe.class) final List<Recipe> recipe; /** 実際にレシピリスト。 */ public enum Message { RETRIEVED("Recipe details by id"), CREATED("Recipe successfully created!"), UPDATED("Recipe successfully updated!"), DELETED("Recipe successfully removed!"); private String message; private Message(String message) { this.message = message; } @JsonValue public String getMessage() { return message; } } /** * コンストラクタ。レシピを自動でリスト化にします。 */ public RecipeResponse(Message message, Recipe recipe) { this.message = message; this.recipe = Arrays.asList(recipe); } }
2b3fc305400b3978a8b61a497f87d7351e24a898
0e401020ac4f08e31ed34ebd4855716524143cc0
/E-Baazar/src/presentation/gui/OrderDetailWindow.java
bbe263df755a317e069145a5854432da8e1e008e
[]
no_license
JuliaChenJing/E-Baazar
b888e1f9c6ffd32da35ee1c5330b866b2b023572
98a27952ed1580bcf181a3c40c3b4a29f5cea37c
refs/heads/master
2021-01-22T02:08:00.900350
2017-11-27T09:50:10
2017-11-27T09:50:10
92,334,391
1
0
null
2017-05-24T20:37:55
2017-05-24T20:37:55
null
UTF-8
Java
false
false
2,974
java
package presentation.gui; import presentation.control.ViewOrdersUIControl; import presentation.data.OrderItemPres; import presentation.data.OrderPres; import presentation.data.ViewOrdersData; import presentation.util.TableUtil; import business.ordersubsystem.OrderItemImpl; import javafx.collections.ObservableList; import javafx.geometry.Pos; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.Label; import javafx.scene.control.TableColumn; import javafx.scene.control.TableView; import javafx.scene.layout.GridPane; import javafx.scene.layout.HBox; import javafx.scene.text.Font; import javafx.scene.text.Text; import javafx.stage.Stage; public class OrderDetailWindow extends Stage { private TableView<OrderItemPres> table = new TableView<OrderItemPres>(); OrderPres selectedOrder; OrdersWindow orders; public void setData(ObservableList<OrderItemPres> orderItems) { table.setItems(orderItems); } @SuppressWarnings("unchecked") public OrderDetailWindow() { this.selectedOrder = ViewOrdersData.INSTANCE.getSelectedOrder(); setTitle("Order Details"); //set up top label HBox labelHbox = createTopLabel(); //set up table TableColumn<OrderItemPres, String> productNameCol = TableUtil.makeTableColumn(new OrderItemPres(), "Product Name", "productNameProperty", 100); TableColumn<OrderItemPres, String> quantityCol = TableUtil.makeTableColumn(new OrderItemPres(), "Quantity", "quantityProperty", 100); TableColumn<OrderItemPres, String> unitPriceCol = TableUtil.makeTableColumn(new OrderItemPres(), "Unit Price", "unitPriceProperty", 100); TableColumn<OrderItemPres, String> totalPriceCol = TableUtil.makeTableColumn(new OrderItemPres(), "Total Price", "totalPriceProperty", 100); table.getColumns().addAll(productNameCol, quantityCol, unitPriceCol, totalPriceCol); //set up row of buttons HBox btnBox = setUpButtons(); //set up grid pane GridPane grid = new GridPane(); grid.setAlignment(Pos.CENTER); grid.setVgap(10); grid.setHgap(10); grid.add(labelHbox, 0, 1); grid.add(table, 0, 2); grid.add(btnBox,0,4); grid.add(new HBox(10), 0, 5); grid.setMinWidth(400); //set in scene and stage Scene scene = new Scene(grid, GuiConstants.SCENE_WIDTH, GuiConstants.SCENE_HEIGHT); setScene(scene); } private HBox createTopLabel() { Label label = new Label("Order Details"); label.setFont(new Font("Arial", 16)); HBox labelHbox = new HBox(10); labelHbox.setAlignment(Pos.CENTER); labelHbox.getChildren().add(label); return labelHbox; } private HBox setUpButtons() { Button okButton = new Button("OK"); HBox btnBox = new HBox(10); btnBox.setAlignment(Pos.CENTER); btnBox.getChildren().add(okButton); okButton.setOnAction( ViewOrdersUIControl.INSTANCE.getOrderDetailsOkHandler()); return btnBox; } }
13d036c5668e3300dca60ec8d7817f1d909e1645
864addb355cfbdb6a766505f95835954314fef00
/src/StrategyPattern/Programmer.java
195a3ff311505545b1f0256aeeebfdb01fdf0235
[]
no_license
kim-seongjae/DesignPattern
4dd46e66de30dada7bf49a5d6e89b6bb27c4e378
7abb2f935ef86d13df4eac4f3e1f513385d97cba
refs/heads/master
2020-04-13T18:33:47.695092
2018-12-28T07:13:44
2018-12-28T07:13:44
163,378,012
0
0
null
null
null
null
UTF-8
Java
false
false
1,000
java
package StrategyPattern; //프로그래머라면 이 클래스를 상속 또는 추가 구현 해야 합니다. public abstract class Programmer { private ClientSide client; private ServerSide server; public Programmer() {} // 스킬을 세팅 할 수 있도록 getter/setter를 설정합니다. public ClientSide getClient() { return client; } public void setClient(ClientSide client) { this.client = client; } public ServerSide getServer() { return server; } public void setServer(ServerSide server) { this.server = server; } // 클라이언트 프로그래밍 스킬을 나열합니다. public String getClientProgramming(){ return client.getClientProgramming(); } // 서버 프로그래밍 스킬을 나열합니다. public String getServerProgramming(){ return server.getServerPrograming(); } // 해당 메소드는 프로그래머가 가진 모든 스킬을 출력해야 합니다. public abstract String getAllSkill(); }
399c49ac1a6963eed0c3796093f6e1b0b25f6a4e
e1d4c638e653cb5266d489d8989f11170ed041a4
/src/test/java/com/spp/pages/ToseeifthesettingrevertsbacktoDeclaredAmountwithstartofnewfinancialyear.java
cd1f1b9b28d0a3320e56ad0e5b0a28c52bd123db
[]
no_license
sbhingarde2018/ESS
b3aa36b57d6b62aaeb87100e68035bec63dd1926
3ee1166411deff96fdcb7492b4a2392ce1eec586
refs/heads/ESS
2021-04-16T15:35:48.748045
2020-04-29T07:08:03
2020-04-29T07:08:03
249,366,105
0
0
null
2020-04-29T07:08:05
2020-03-23T07:44:58
HTML
UTF-8
Java
false
false
1,154
java
package com.spp.pages; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.PageFactory; import com.spp.common.BasePage; public class ToseeifthesettingrevertsbacktoDeclaredAmountwithstartofnewfinancialyear extends BasePage { @FindBy(id="salary") WebElement Salary; @FindBy(xpath="//*[@id=\"menu\"]/li[6]/div/div[1]/ul/li[1]/a") WebElement Paymonth; @FindBy(xpath="//*[@id=\"create_paymonth_form\"]/div[4]/div/div/fieldset/div[2]/input") WebElement CreatePaymonthBtn; @FindBy(id="tds") WebElement TDS; @FindBy(xpath="//*[@id=\"menu\"]/li[7]/div/div/ul/li[3]/a") WebElement OptionSettings; public ToseeifthesettingrevertsbacktoDeclaredAmountwithstartofnewfinancialyear(WebDriver driver) { super(driver); PageFactory.initElements(driver, this); } public void ClickSalary() { Salary.click(); } public void ClickPaymonth() { Paymonth.click(); } public void clickCreatePaymonth() { CreatePaymonthBtn.click(); } public void ClickTDS() { TDS.click(); } public void ClickOptionSettings() { OptionSettings.click(); } }
04b752abc3edf04ee7ca2d8fdd47b6d5a28e69ae
bc25212ca52fd50af83f5dbf5cf322ce844e9291
/src/main/java/br/com/euchef/webservice/login/spring/model/json/AuthenticationResponse.java
8119a09efefead4e92db8a1f9c7686770ddd96a9
[]
no_license
paulosantosphs/eu-chef-back-end
5357f96fbc76bce6f2e6ac1bbd98258b670442d5
c527cc9d35e41f91a008bfbd12c8007f5ea2b8fd
refs/heads/master
2023-03-28T10:13:34.187776
2021-03-15T14:20:53
2021-03-15T14:20:53
347,203,564
2
0
null
null
null
null
UTF-8
Java
false
false
364
java
package br.com.euchef.webservice.login.spring.model.json; public class AuthenticationResponse { private String token; public AuthenticationResponse() { super(); } public AuthenticationResponse(String token) { this.setToken(token); } public String getToken() { return this.token; } public void setToken(String token) { this.token = token; } }
244b5bb1782261d40551f8c8530c7efbf6b3353d
13b44d2367c3be0bf57905bbc37132ce7f4a1228
/webpanim/src/main/java/com/congwiny/webpanim/utils/FileUtils.java
c8d9c1a5e1cf74b37c3d4b84b4a530785aa06b57
[ "Apache-2.0" ]
permissive
leeyc09/MyAndroidTest
d3c4f2859da829ef231cddd6c8862c44785b69d4
b35f71993e100f50d72e206d9bc48d098a12f581
refs/heads/master
2021-01-11T16:02:03.161064
2016-08-29T09:34:30
2016-08-29T09:34:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,285
java
package com.congwiny.webpanim.utils; import android.util.Log; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; /** * Created by congwiny on 2016/4/25. */ public class FileUtils { private static final String TAG = FileUtils.class.getSimpleName(); public static String readFileText(String fileName) { File file = new File(fileName); BufferedReader reader = null; StringBuilder sb = new StringBuilder(); try { reader = new BufferedReader(new FileReader(file)); String tempString = null; // 一次读入一行,直到读入null为文件结束 while ((tempString = reader.readLine()) != null) { sb.append(tempString); } reader.close(); } catch (IOException e) { e.printStackTrace(); } finally { if (reader != null) { try { reader.close(); } catch (IOException e1) { } } } Log.e(TAG,"load file text="+sb.toString()); return sb.toString(); } public static boolean isWebpFile(String fileName){ return fileName.endsWith(".webp"); } }
fbbac5be12ae0ae24b0165492406c5a8f19c6f27
e63363389e72c0822a171e450a41c094c0c1a49c
/Mate20_9_0_0/src/main/java/android/media/Utils.java
6bf88da9b2c201bf200e5b8f454b10629a798118
[]
no_license
solartcc/HwFrameWorkSource
fc23ca63bcf17865e99b607cc85d89e16ec1b177
5b92ed0f1ccb4bafc0fdb08b6fc4d98447b754ad
refs/heads/master
2022-12-04T21:14:37.581438
2020-08-25T04:30:43
2020-08-25T04:30:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
12,630
java
package android.media; import android.content.ContentResolver; import android.content.Context; import android.database.Cursor; import android.net.Uri; import android.os.Environment; import android.os.FileUtils; import android.util.Log; import android.util.Pair; import android.util.Range; import android.util.Rational; import android.util.Size; import java.io.File; import java.io.FileNotFoundException; import java.util.Arrays; import java.util.Comparator; import java.util.Vector; class Utils { private static final String TAG = "Utils"; Utils() { } public static <T extends Comparable<? super T>> void sortDistinctRanges(Range<T>[] ranges) { Arrays.sort(ranges, new Comparator<Range<T>>() { public int compare(Range<T> lhs, Range<T> rhs) { if (lhs.getUpper().compareTo(rhs.getLower()) < 0) { return -1; } if (lhs.getLower().compareTo(rhs.getUpper()) > 0) { return 1; } StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("sample rate ranges must be distinct ("); stringBuilder.append(lhs); stringBuilder.append(" and "); stringBuilder.append(rhs); stringBuilder.append(")"); throw new IllegalArgumentException(stringBuilder.toString()); } }); } public static <T extends Comparable<? super T>> Range<T>[] intersectSortedDistinctRanges(Range<T>[] one, Range<T>[] another) { int ix = 0; Vector<Range<T>> result = new Vector(); for (Range<T> range : another) { while (ix < one.length && one[ix].getUpper().compareTo(range.getLower()) < 0) { ix++; } while (ix < one.length && one[ix].getUpper().compareTo(range.getUpper()) < 0) { result.add(range.intersect(one[ix])); ix++; } if (ix == one.length) { break; } if (one[ix].getLower().compareTo(range.getUpper()) <= 0) { result.add(range.intersect(one[ix])); } } return (Range[]) result.toArray(new Range[result.size()]); } public static <T extends Comparable<? super T>> int binarySearchDistinctRanges(Range<T>[] ranges, T value) { return Arrays.binarySearch(ranges, Range.create(value, value), new Comparator<Range<T>>() { public int compare(Range<T> lhs, Range<T> rhs) { if (lhs.getUpper().compareTo(rhs.getLower()) < 0) { return -1; } if (lhs.getLower().compareTo(rhs.getUpper()) > 0) { return 1; } return 0; } }); } static int gcd(int a, int b) { if (a == 0 && b == 0) { return 1; } if (b < 0) { b = -b; } if (a < 0) { a = -a; } while (a != 0) { int c = b % a; b = a; a = c; } return b; } static Range<Integer> factorRange(Range<Integer> range, int factor) { if (factor == 1) { return range; } return Range.create(Integer.valueOf(divUp(((Integer) range.getLower()).intValue(), factor)), Integer.valueOf(((Integer) range.getUpper()).intValue() / factor)); } static Range<Long> factorRange(Range<Long> range, long factor) { if (factor == 1) { return range; } return Range.create(Long.valueOf(divUp(((Long) range.getLower()).longValue(), factor)), Long.valueOf(((Long) range.getUpper()).longValue() / factor)); } private static Rational scaleRatio(Rational ratio, int num, int den) { int common = gcd(num, den); return new Rational((int) (((double) ratio.getNumerator()) * ((double) (num / common))), (int) (((double) ratio.getDenominator()) * ((double) (den / common)))); } static Range<Rational> scaleRange(Range<Rational> range, int num, int den) { if (num == den) { return range; } return Range.create(scaleRatio((Rational) range.getLower(), num, den), scaleRatio((Rational) range.getUpper(), num, den)); } static Range<Integer> alignRange(Range<Integer> range, int align) { return range.intersect(Integer.valueOf(divUp(((Integer) range.getLower()).intValue(), align) * align), Integer.valueOf((((Integer) range.getUpper()).intValue() / align) * align)); } static int divUp(int num, int den) { return ((num + den) - 1) / den; } static long divUp(long num, long den) { return ((num + den) - 1) / den; } private static long lcm(int a, int b) { if (a != 0 && b != 0) { return (((long) a) * ((long) b)) / ((long) gcd(a, b)); } throw new IllegalArgumentException("lce is not defined for zero arguments"); } static Range<Integer> intRangeFor(double v) { return Range.create(Integer.valueOf((int) v), Integer.valueOf((int) Math.ceil(v))); } static Range<Long> longRangeFor(double v) { return Range.create(Long.valueOf((long) v), Long.valueOf((long) Math.ceil(v))); } static Size parseSize(Object o, Size fallback) { try { return Size.parseSize((String) o); } catch (ClassCastException | NumberFormatException e) { String str = TAG; StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("could not parse size '"); stringBuilder.append(o); stringBuilder.append("'"); Log.w(str, stringBuilder.toString()); return fallback; } catch (NullPointerException e2) { return fallback; } } static int parseIntSafely(Object o, int fallback) { if (o == null) { return fallback; } try { return Integer.parseInt((String) o); } catch (ClassCastException | NumberFormatException e) { String str = TAG; StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("could not parse integer '"); stringBuilder.append(o); stringBuilder.append("'"); Log.w(str, stringBuilder.toString()); return fallback; } catch (NullPointerException e2) { return fallback; } } static Range<Integer> parseIntRange(Object o, Range<Integer> fallback) { String s; try { s = (String) o; int ix = s.indexOf(45); if (ix >= 0) { return Range.create(Integer.valueOf(Integer.parseInt(s.substring(0, ix), 10)), Integer.valueOf(Integer.parseInt(s.substring(ix + 1), 10))); } int value = Integer.parseInt(s); return Range.create(Integer.valueOf(value), Integer.valueOf(value)); } catch (NullPointerException e) { return fallback; } catch (ClassCastException | IllegalArgumentException | NumberFormatException e2) { s = TAG; StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("could not parse integer range '"); stringBuilder.append(o); stringBuilder.append("'"); Log.w(s, stringBuilder.toString()); return fallback; } } static Range<Long> parseLongRange(Object o, Range<Long> fallback) { String s; try { s = (String) o; int ix = s.indexOf(45); if (ix >= 0) { return Range.create(Long.valueOf(Long.parseLong(s.substring(0, ix), 10)), Long.valueOf(Long.parseLong(s.substring(ix + 1), 10))); } long value = Long.parseLong(s); return Range.create(Long.valueOf(value), Long.valueOf(value)); } catch (NullPointerException e) { return fallback; } catch (ClassCastException | IllegalArgumentException | NumberFormatException e2) { s = TAG; StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("could not parse long range '"); stringBuilder.append(o); stringBuilder.append("'"); Log.w(s, stringBuilder.toString()); return fallback; } } static Range<Rational> parseRationalRange(Object o, Range<Rational> fallback) { String s; try { s = (String) o; int ix = s.indexOf(45); if (ix >= 0) { return Range.create(Rational.parseRational(s.substring(0, ix)), Rational.parseRational(s.substring(ix + 1))); } Rational value = Rational.parseRational(s); return Range.create(value, value); } catch (NullPointerException e) { return fallback; } catch (ClassCastException | IllegalArgumentException | NumberFormatException e2) { s = TAG; StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("could not parse rational range '"); stringBuilder.append(o); stringBuilder.append("'"); Log.w(s, stringBuilder.toString()); return fallback; } } static Pair<Size, Size> parseSizeRange(Object o) { String s; try { s = (String) o; int ix = s.indexOf(45); if (ix >= 0) { return Pair.create(Size.parseSize(s.substring(0, ix)), Size.parseSize(s.substring(ix + 1))); } Size value = Size.parseSize(s); return Pair.create(value, value); } catch (NullPointerException e) { return null; } catch (ClassCastException | IllegalArgumentException | NumberFormatException e2) { s = TAG; StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("could not parse size range '"); stringBuilder.append(o); stringBuilder.append("'"); Log.w(s, stringBuilder.toString()); return null; } } public static File getUniqueExternalFile(Context context, String subdirectory, String fileName, String mimeType) { File externalStorage = Environment.getExternalStoragePublicDirectory(subdirectory); externalStorage.mkdirs(); File outFile = null; try { return FileUtils.buildUniqueFile(externalStorage, mimeType, fileName); } catch (FileNotFoundException e) { String str = TAG; StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("Unable to get a unique file name: "); stringBuilder.append(e); Log.e(str, stringBuilder.toString()); return null; } } /* JADX WARNING: Missing block: B:19:0x004b, code skipped: if (r1 != null) goto L_0x004d; */ /* JADX WARNING: Missing block: B:20:0x004d, code skipped: if (r2 != null) goto L_0x004f; */ /* JADX WARNING: Missing block: B:22:?, code skipped: r1.close(); */ /* JADX WARNING: Missing block: B:23:0x0053, code skipped: r5 = move-exception; */ /* JADX WARNING: Missing block: B:24:0x0054, code skipped: r2.addSuppressed(r5); */ /* JADX WARNING: Missing block: B:25:0x0058, code skipped: r1.close(); */ /* Code decompiled incorrectly, please refer to instructions dump. */ static String getFileDisplayNameFromUri(Context context, Uri uri) { String scheme = uri.getScheme(); if (ContentResolver.SCHEME_FILE.equals(scheme)) { return uri.getLastPathSegment(); } if ("content".equals(scheme)) { Cursor cursor = context.getContentResolver().query(uri, new String[]{"_display_name"}, null, null, null); if (cursor != null) { if (cursor.getCount() != 0) { cursor.moveToFirst(); String string = cursor.getString(cursor.getColumnIndex("_display_name")); if (cursor != null) { cursor.close(); } return string; } } if (cursor != null) { cursor.close(); } } return uri.toString(); } }
6876d99bdd9f91481329fa00d690aa59eebe8fc9
93051e5d81a1c1413576cdc5b4c07d58d378b301
/Java/Lessons/practice2.java
d3e49a25a29eaa1456590e2410f2221c4cb88267
[]
no_license
dbbarcenas/java
7b308aa79c733b038c5278a5896ebfe93b2a36c5
92bb508969ba6d893ee66983ca757c027bd1fef7
refs/heads/master
2016-09-06T06:43:57.434170
2013-04-12T00:47:26
2013-04-12T00:47:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
417
java
public class practice2 { public static void main(String[] args) { int hits; int atbat; int average = hits / atbat; getHits = hits(); getatBat = atbat(); System.out.printf("\n\nEnter Hits: %.2f", getHits); System.out.printf("\n\nEnter at bat: %.2f", getatBat); System.out.printf("\n\nTotal Average: %.2f", average); } // end of main method }// end of class
f28ef2e8ef7a78e885e8fb87302e9faddc567bac
54219df7c3eeb75d189554b3136720872ee481ae
/app/src/main/java/com/example/cristiano/myteam/fragment/MapFragment.java
ecca97e748cf163c3f74d0bbdfb1bc0ad828667f
[]
no_license
CristianoYL/MY_TEAM_ANDROID
63c0af78c5a545e270eb056f173e6875c413f714
6f788de5e4ded1ea0a378b7e533bf1ee7351551d
refs/heads/master
2021-08-17T07:33:38.236385
2017-11-20T23:10:37
2017-11-20T23:10:37
85,143,004
0
1
null
null
null
null
UTF-8
Java
false
false
34,058
java
package com.example.cristiano.myteam.fragment; import android.Manifest; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.pm.PackageManager; import android.location.Address; import android.location.Location; import android.location.LocationListener; import android.location.LocationManager; import android.os.Bundle; import android.os.Handler; import android.os.ResultReceiver; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.design.widget.FloatingActionButton; import android.support.v4.app.ActivityCompat; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; import android.support.v4.content.ContextCompat; import android.support.v7.app.AlertDialog; import android.text.TextUtils; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.AbsListView; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListView; import android.widget.SearchView; import android.widget.TextView; import android.widget.Toast; import com.example.cristiano.myteam.R; import com.example.cristiano.myteam.request.RequestAction; import com.example.cristiano.myteam.request.RequestHelper; import com.example.cristiano.myteam.service.location.FetchAddressIntentService; import com.example.cristiano.myteam.structure.Club; import com.example.cristiano.myteam.structure.Player; import com.example.cristiano.myteam.util.Constant; import com.example.cristiano.myteam.util.UrlHelper; import com.google.android.gms.maps.model.BitmapDescriptorFactory; import com.google.android.gms.maps.model.CameraPosition; import com.google.android.gms.maps.model.Marker; import com.google.gson.Gson; import com.google.android.gms.maps.CameraUpdateFactory; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.OnMapReadyCallback; import com.google.android.gms.maps.SupportMapFragment; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.MarkerOptions; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.text.DateFormat; import java.text.ParseException; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; /** * Created by Cristiano on 2017/4/18. * * this fragment presents the club map page, * and allows the club member to share and view each other's locations */ public class MapFragment extends Fragment implements OnMapReadyCallback,GoogleMap.OnMarkerClickListener{ private static final String ARG_CLUB = "club"; private static final String ARG_PLAYER = "player"; private static final String TAG = "MapFragment"; private static final int ENOUGH_LOCATION_UPDATES = 10; private static final int TWO_MINUTES = 1000 * 60 * 2; private static final int MY_PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION = 10086; private GoogleMap mMap; private Marker selfMarker, searchMarker,eventMarker; private HashMap<Integer,Marker> teammateMarkerMap; // map teammate's playerID to marker private ArrayList<Address> addressList; private Address eventAddress; private View layout_mapOptions, layout_searchResult, layout_resultDetail; private FloatingActionButton fab_locate, fab_share, fab_view, fab_hide,fab_addEvent,fab_more; private TextView tv_status; private SearchView sv_address; private ListView lv_address; private Button btn_more, btn_less; private int locationUpdateCount; private Location currentBestLocation; private LocationManager locationManager; private LocationListener locationListener; private AddressResultReceiver mResultReceiver; private Club club; private Player player; private OnCreateEventRequestListener onCreateEventRequestListener; private View view; public interface OnCreateEventRequestListener{ void createEvent(Address address); } public MapFragment() { } public static MapFragment newInstance(Club club, Player player){ MapFragment fragment = new MapFragment(); Bundle bundle = new Bundle(); bundle.putString(ARG_CLUB,club.toJson()); bundle.putString(ARG_PLAYER,player.toJson()); fragment.setArguments(bundle); return fragment; } @Override public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); Bundle bundle = getArguments(); if (bundle != null) { Gson gson = new Gson(); club = gson.fromJson(bundle.getString(ARG_CLUB),Club.class); player = gson.fromJson(bundle.getString(ARG_PLAYER),Player.class); } } @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { view = inflater.inflate(R.layout.fragment_map, container, false); fab_locate = (FloatingActionButton) view.findViewById(R.id.fab_locate); fab_share = (FloatingActionButton) view.findViewById(R.id.fab_share); fab_view = (FloatingActionButton) view.findViewById(R.id.fab_view); fab_hide = (FloatingActionButton) view.findViewById(R.id.fab_hide); fab_more = (FloatingActionButton) view.findViewById(R.id.fab_more); fab_addEvent = (FloatingActionButton) view.findViewById(R.id.fab_addEvent); tv_status = (TextView) view.findViewById(R.id.tv_locatingStatus); sv_address = (SearchView) view.findViewById(R.id.sv_address); lv_address = (ListView) view.findViewById(R.id.lv_address); btn_more = (Button) view.findViewById(R.id.btn_more); btn_less = (Button) view.findViewById(R.id.btn_less) ; layout_searchResult = view.findViewById(R.id.layout_search_results); layout_resultDetail = view.findViewById(R.id.layout_result_detail); return view; } @Override public void onAttach(Context context) { super.onAttach(context); try{ onCreateEventRequestListener = (OnCreateEventRequestListener) context; } catch (ClassCastException e) { throw new ClassCastException(context.toString() + "must implement OnCreateEventRequestListener"); } locationManager = (LocationManager) getContext().getSystemService(Context.LOCATION_SERVICE); } @Override public void onResume() { super.onResume(); checkPermission(); // check if user allows location service } @Override public void onDetach() { super.onDetach(); locationManager.removeUpdates(locationListener); selfMarker = null; searchMarker = null; if ( teammateMarkerMap != null ) { teammateMarkerMap.clear(); } } /** * start the Google Maps Service, find the fragment and render the map in the fragment */ private void startMapService(){ FragmentManager fragmentManager = getChildFragmentManager(); SupportMapFragment mapFragment = (SupportMapFragment) fragmentManager.findFragmentByTag(Constant.FRAGMENT_MAP); if ( mapFragment == null ) { mapFragment = SupportMapFragment.newInstance(); FragmentTransaction transaction = getChildFragmentManager().beginTransaction(); transaction.add(R.id.frame_map,mapFragment,Constant.FRAGMENT_MAP); transaction.commit(); fragmentManager.executePendingTransactions(); } mapFragment.getMapAsync(this); } private Marker addMarkerOnMap(Double latitude, Double longitude, String title, String lastUpdate) { LatLng latLng = new LatLng(latitude,longitude); mMap.moveCamera(CameraUpdateFactory.newLatLng(latLng)); Marker marker = mMap.addMarker(new MarkerOptions().position(latLng)); if ( title != null) { marker.setTitle(title); } if ( lastUpdate != null ) { marker.setSnippet(getResources().getString(R.string.label_location_as_of)+ lastUpdate); } return marker; } /** Determines whether one Location reading is better than the current Location fix * @param location The new Location that you want to evaluate * @param currentBestLocation The current Location fix, to which you want to compare the new one */ protected boolean isBetterLocation(Location location, Location currentBestLocation) { if (currentBestLocation == null) { // A new location is always better than no location Log.d(TAG,"first location"); return true; } Log.d(TAG,"Comparing new location("+location.getLatitude()+","+location.getLongitude()+")" + " to currentBestLocation("+currentBestLocation.getLatitude()+","+currentBestLocation.getLongitude()+")"); // Check whether the new location fix is newer or older long timeDelta = location.getTime() - currentBestLocation.getTime(); boolean isSignificantlyNewer = timeDelta > TWO_MINUTES; boolean isSignificantlyOlder = timeDelta < -TWO_MINUTES; boolean isNewer = timeDelta > 0; // If it's been more than two minutes since the current location, use the new location // because the user has likely moved if (isSignificantlyNewer) { Log.d(TAG,"is sig newer"); return true; // If the new location is more than two minutes older, it must be worse } else if (isSignificantlyOlder) { Log.d(TAG,"is sig older"); return false; } // Check whether the new location fix is more or less accurate int accuracyDelta = (int) (location.getAccuracy() - currentBestLocation.getAccuracy()); boolean isLessAccurate = accuracyDelta > 0; boolean isMoreAccurate = accuracyDelta < 0; boolean isSignificantlyLessAccurate = accuracyDelta > 200; // Check if the old and new location are from the same provider boolean isFromSameProvider = isSameProvider(location.getProvider(), currentBestLocation.getProvider()); // Determine location quality using a combination of timeliness and accuracy if (isMoreAccurate) { Log.d(TAG,"more accurate"); return true; } else if (isNewer && !isLessAccurate) { Log.d(TAG,"newer but less accurate"); return true; } else if (isNewer && !isSignificantlyLessAccurate && isFromSameProvider) { Log.d(TAG,"newer sig less accurate same provider"); return true; } return false; } /** Checks whether two providers are the same */ private boolean isSameProvider(String provider1, String provider2) { if (provider1 == null) { return provider2 == null; } return provider1.equals(provider2); } /** * starts listening for location updates */ private void startLocating(){ if (ContextCompat.checkSelfPermission(getContext(), Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) { locationUpdateCount = 0; currentBestLocation = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER); if ( currentBestLocation != null ) { LatLng currentBestLatLng = new LatLng(currentBestLocation.getLatitude(),currentBestLocation.getLongitude()); if ( selfMarker == null ) { selfMarker = mMap.addMarker(new MarkerOptions() .position(currentBestLatLng) .title(getString(R.string.label_my_location)) .icon(BitmapDescriptorFactory.fromResource(R.mipmap.ic_my_location))); } else { selfMarker.setPosition(currentBestLatLng); selfMarker.setVisible(true); selfMarker.setIcon(BitmapDescriptorFactory.fromResource(R.mipmap.ic_my_location)); } } locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,0,0,locationListener); locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER,0,0,locationListener); tv_status.setVisibility(View.VISIBLE); } } /** * stop listening for location updates, and move camera to the current best estimated location */ private void updateCurrentLocation() { tv_status.setVisibility(View.INVISIBLE); locationUpdateCount = ENOUGH_LOCATION_UPDATES; if ( currentBestLocation == null ) { Toast.makeText(getContext(),"Failed to get location, please try again.",Toast.LENGTH_SHORT).show(); return; } locationManager.removeUpdates(locationListener); // stop listening for updates Log.d(TAG,"LAT:"+currentBestLocation.getLatitude()); Log.d(TAG,"LONG:"+currentBestLocation.getLongitude()); LatLng myLocation = new LatLng(currentBestLocation.getLatitude(),currentBestLocation.getLongitude()); DateFormat format = Constant.MARKER_DATE_FORMAT; String currentTime = format.format(new Date()); if ( selfMarker != null ) { selfMarker.setPosition(myLocation); selfMarker.setTitle(getString(R.string.label_my_location)); selfMarker.setSnippet(getString(R.string.label_location_as_of) + currentTime); } else { selfMarker = addMarkerOnMap(currentBestLocation.getLatitude(), currentBestLocation.getLongitude(), getString(R.string.label_my_location), getString(R.string.label_location_as_of) + currentTime); } selfMarker.setIcon(BitmapDescriptorFactory.fromResource(R.mipmap.ic_my_location)); mMap.moveCamera(CameraUpdateFactory.newLatLng(myLocation)); mMap.moveCamera(CameraUpdateFactory.zoomTo(12)); // zoom of 12 is between city and state mMap.animateCamera(CameraUpdateFactory.zoomOut()); } /** * check if user grants Location permission, if not, request the permission */ private void checkPermission() { // Here, thisActivity is the current activity if (ContextCompat.checkSelfPermission(getContext(), Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) { // Should we show an explanation? if (ActivityCompat.shouldShowRequestPermissionRationale(getActivity(), Manifest.permission.ACCESS_FINE_LOCATION)) { // Show an explanation to the user *asynchronously* -- don't block // this thread waiting for the user's response! After the user // sees the explanation, try again to request the permission. } else { // No explanation needed, we can request the permission. ActivityCompat.requestPermissions(getActivity(), new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, MY_PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION); // MY_PERMISSIONS_REQUEST_READ_CONTACTS is an // app-defined int constant. The callback method gets the // result of the request. } } else { startMapService(); } } @Override public void onRequestPermissionsResult(int requestCode, @NonNull String permissions[], @NonNull int[] grantResults) { switch (requestCode) { case MY_PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION: { // If request is cancelled, the result arrays are empty. if (grantResults.length <= 0 || grantResults[0] != PackageManager.PERMISSION_GRANTED) { // this app has to use the location permission, if the user rejected, ask again checkPermission(); } } } } private AlertDialog.Builder builder; private AlertDialog eventDialog; /** * This method is called when the Google Maps service is ready. * It will create a locationListener to listen for the location updates * and initialize all the necessary components for the location service * @param googleMap the GoogleMaps instance */ @Override public void onMapReady(GoogleMap googleMap) { mMap = googleMap; mMap.setOnMarkerClickListener(this); locationListener = new LocationListener() { @Override public void onLocationChanged(Location location) { locationUpdateCount++; if ( isBetterLocation(location,currentBestLocation) ) { currentBestLocation = location; LatLng newLocation = new LatLng(location.getLatitude(),location.getLongitude()); if ( selfMarker == null ) { selfMarker = mMap.addMarker(new MarkerOptions() .position(newLocation) .title(getString(R.string.label_my_location)) .icon(BitmapDescriptorFactory.fromResource(R.mipmap.ic_my_location))); } else { selfMarker.setPosition(newLocation); selfMarker.setIcon(BitmapDescriptorFactory.fromResource(R.mipmap.ic_my_location)); selfMarker.setVisible(true); } mMap.moveCamera(CameraUpdateFactory.newLatLng(newLocation)); mMap.animateCamera(CameraUpdateFactory.zoomTo(14)); // move to a finer viewer Log.d(TAG,"Use new location"); } else { Log.d(TAG,"Use previous best location"); } if ( locationUpdateCount >= ENOUGH_LOCATION_UPDATES ) { updateCurrentLocation(); } } @Override public void onStatusChanged(String provider, int status, Bundle extras) { } @Override public void onProviderEnabled(String provider) { } @Override public void onProviderDisabled(String provider) { } }; fab_view.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { cancelLocating(); getAllLocations(); } }); fab_hide.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { fab_hide.setVisibility(View.GONE); fab_view.setVisibility(View.VISIBLE); if ( teammateMarkerMap != null ) { for ( int playerID : teammateMarkerMap.keySet() ) { teammateMarkerMap.get(playerID).setVisible(false); } } } }); fab_locate.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { startLocating(); } }); fab_share.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if ( locationUpdateCount >= ENOUGH_LOCATION_UPDATES ) { AlertDialog.Builder builder = new AlertDialog.Builder(getContext()); builder.setTitle(R.string.notice); builder.setMessage(R.string.prompt_share_location); builder.setPositiveButton(R.string.label_confirm, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { uploadLocation(currentBestLocation); } }); builder.setNegativeButton(R.string.label_cancel, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { } }); builder.setCancelable(true); builder.show(); } else { Toast.makeText(getContext(),R.string.prompt_share_location_fail,Toast.LENGTH_SHORT).show(); } } }); fab_addEvent.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { AlertDialog.Builder builder = new AlertDialog.Builder(getContext()); builder.setMessage("Do you want to create a new event?"); builder.setPositiveButton(R.string.label_yes, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { onCreateEventRequestListener.createEvent(eventAddress); } }); builder.setNegativeButton(R.string.label_no, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { } }); builder.show(); } }); sv_address.setOnQueryTextListener(new SearchView.OnQueryTextListener() { @Override public boolean onQueryTextSubmit(String query) { mResultReceiver = new AddressResultReceiver(new Handler()); startIntentService(query); return false; } @Override public boolean onQueryTextChange(String newText) { layout_searchResult.setVisibility(View.GONE); return false; } }); lv_address.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { layout_resultDetail.setVisibility(View.GONE); btn_more.setVisibility(View.VISIBLE); if ( position < addressList.size() ) { eventAddress = addressList.get(position); if ( searchMarker == null ) { searchMarker = addMarkerOnMap(eventAddress.getLatitude(),eventAddress.getLongitude(),"Event Location",null); } else { searchMarker.setPosition(new LatLng(eventAddress.getLatitude(),eventAddress.getLongitude())); searchMarker.setVisible(true); } mMap.moveCamera(CameraUpdateFactory.newCameraPosition(CameraPosition.fromLatLngZoom(searchMarker.getPosition(),9))); } else { Log.e(TAG,"Address result list index out of bound."); } } }); layout_mapOptions = view.findViewById(R.id.layout_options); fab_more.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if ( layout_mapOptions.getVisibility() == View.VISIBLE ) { layout_mapOptions.setVisibility(View.GONE); } else { layout_mapOptions.setVisibility(View.VISIBLE); } } }); btn_more.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // expand result list layout_resultDetail.setVisibility(View.VISIBLE); btn_more.setVisibility(View.GONE); } }); btn_less.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // hide result list layout_resultDetail.setVisibility(View.GONE); btn_more.setVisibility(View.VISIBLE); } }); startLocating(); } private void startIntentService(String queryAddress) { // Create an intent for passing to the intent service responsible for fetching the address. Intent intent = new Intent(getActivity(), FetchAddressIntentService.class); // Pass the result receiver as an extra to the service. intent.putExtra(Constant.RECEIVER, mResultReceiver); // Pass the location data as an extra to the service. intent.putExtra(Constant.ADDRESS_DATA_EXTRA,queryAddress); // Start the service. If the service isn't already running, it is instantiated and started // (creating a process for it if needed); if it is running then it remains running. The // service kills itself automatically once all intents are processed. getActivity().startService(intent); } /** * Force to stop listening for location update and * used the current best estimate as the current location. * This method is called when user requests other map events */ private void cancelLocating(){ updateCurrentLocation(); } /** * send a PUT request to upload my current location */ private void uploadLocation(Location location){ RequestAction actionPutLocation = new RequestAction() { @Override public void actOnPre() { } @Override public void actOnPost(int responseCode, String response) { if ( responseCode == 200 || responseCode == 201 ) { // success Toast.makeText(getContext(),"Location uploaded!",Toast.LENGTH_SHORT).show(); } else { // show error try { JSONObject jsonObject = new JSONObject(response); String message = jsonObject.getString(Constant.KEY_MSG); Toast.makeText(getContext(), message, Toast.LENGTH_SHORT).show(); } catch (JSONException e) { e.printStackTrace(); Toast.makeText(getContext(), response, Toast.LENGTH_SHORT).show(); } } } }; String latitude = location.getLatitude()+""; String longitude = location.getLongitude()+""; com.example.cristiano.myteam.structure.Location locationData = new com.example.cristiano.myteam.structure.Location(club.id,player.getId(),latitude,longitude,null); String url = UrlHelper.urlLocationByClubPlayer(club.id, player.getId()); RequestHelper.sendPutRequest(url,locationData.toJson(),actionPutLocation); } /** * Send a get request to server to retrieve all teammates last known locations * and show them on the map */ private void getAllLocations() { RequestAction actionGetAllLocations = new RequestAction() { @Override public void actOnPre() { if ( teammateMarkerMap != null ) { for ( int playerID: teammateMarkerMap.keySet()) { teammateMarkerMap.get(playerID).setVisible(false); // hide all previous teammate markers } } else { teammateMarkerMap = new HashMap<>(); } } @Override public void actOnPost(int responseCode, String response) { if ( responseCode == 200 ) { // success try { JSONObject jsonObject = new JSONObject((response)); JSONArray jsonArray = jsonObject.getJSONArray(Constant.TABLE_LOCATION); for ( int i = 0; i < jsonArray.length(); i++ ) { JSONObject jsonLocation = jsonArray.getJSONObject(i); int playerID = jsonLocation.getInt(Constant.LOCATION_P_ID); Double latitude = Double.parseDouble(jsonLocation.getString(Constant.LOCATION_LAT)); Double longitude = Double.parseDouble(jsonLocation.getString(Constant.LOCATION_LNG)); String lastUpdate = jsonLocation.getString(Constant.LOCATION_LAST_UPDATE); try { Date date = Constant.getServerDateFormat().parse(lastUpdate); lastUpdate = Constant.MARKER_DATE_FORMAT.format(date); } catch (ParseException e) { e.printStackTrace(); } if ( playerID != player.getId() ) { // ignore if it's the user himself if ( teammateMarkerMap.containsKey(playerID) ) { Marker marker = teammateMarkerMap.get(playerID); marker.setPosition(new LatLng(latitude,longitude)); marker.setVisible(true); marker.setTitle("Player "+playerID); marker.setSnippet(lastUpdate); } else { Marker marker = addMarkerOnMap(latitude, longitude, "Player "+playerID,lastUpdate); teammateMarkerMap.put(playerID,marker); marker.setVisible(true); } } } mMap.animateCamera(CameraUpdateFactory.zoomTo(9)); if ( jsonArray.length() > 0 ) { fab_hide.setVisibility(View.VISIBLE); fab_view.setVisibility(View.GONE); } else { fab_hide.setVisibility(View.GONE); fab_view.setVisibility(View.VISIBLE); } Toast.makeText(getContext(), (jsonArray.length() - 1 ) + " club member(s)' locations are shown on map!", Toast.LENGTH_SHORT).show(); } catch (JSONException e) { e.printStackTrace(); Toast.makeText(getContext(), "Failed to show member' locations", Toast.LENGTH_SHORT).show(); } } else { // show error try { JSONObject jsonObject = new JSONObject(response); String message = jsonObject.getString(Constant.KEY_MSG); Toast.makeText(getContext(), message, Toast.LENGTH_SHORT).show(); } catch (JSONException e) { e.printStackTrace(); Toast.makeText(getContext(), response, Toast.LENGTH_SHORT).show(); } } } }; String url = UrlHelper.urlLocationByClub(club.id); RequestHelper.sendGetRequest(url,actionGetAllLocations); } private class AddressResultReceiver extends ResultReceiver { AddressResultReceiver(Handler handler) { super(handler); } /** * Receives data sent from FetchAddressIntentService and updates the UI in MainActivity. */ @Override protected void onReceiveResult(int resultCode, Bundle resultData) { if (resultCode == Constant.SUCCESS_RESULT) { addressList = resultData.getParcelableArrayList(Constant.RESULT_DATA_KEY); if ( addressList == null ) { addressList = new ArrayList<>(); return; } ArrayList<String> addresses = new ArrayList<>(5); for ( Address address : addressList ) { ArrayList<String> addressLines = new ArrayList<>(); for ( int i = 0; i < address.getMaxAddressLineIndex(); i++ ) { addressLines.add(address.getAddressLine(i)); } String addressName = TextUtils.join(System.getProperty("line.separator"),addressLines); addresses.add(addressName); } layout_searchResult.setVisibility(View.VISIBLE); btn_more.setVisibility(View.GONE); layout_resultDetail.setVisibility(View.VISIBLE); lv_address.setAdapter(new ArrayAdapter<String>( getContext(),android.R.layout.simple_list_item_1,addresses )); lv_address.setChoiceMode(AbsListView.CHOICE_MODE_SINGLE); } else { layout_searchResult.setVisibility(View.GONE); String errorMessage = resultData.getString(Constant.RESULT_DATA_KEY); Toast.makeText(getContext(), errorMessage, Toast.LENGTH_SHORT).show(); } // Reset. Enable the Fetch Address button and stop showing the progress bar. } } @Override public boolean onMarkerClick(Marker marker) { if ( searchMarker != null && marker.equals(searchMarker) ) { fab_addEvent.setVisibility(View.VISIBLE); Log.d(TAG,"onMarkerClick:"+marker.getTitle()); } return false; } }
4d1541bf152eacf559a0b1eb210bde1821f9f052
c0c713a7850e6d3454ebb93debee5b5cf3f55418
/src/com/kookoon/multicountdown/Timer.java
6425aa1cc47640c19b8df0d0d8975d4bda510c01
[]
no_license
kyokokken/MultiCountdown
502020893369a00e4f3faca7cd0e7fcf50f822c7
129b2ad438d43cf62e905ac507b643caac900966
refs/heads/master
2021-05-09T14:00:44.705278
2018-01-26T12:45:15
2018-01-26T12:45:15
119,050,728
0
0
null
null
null
null
UTF-8
Java
false
false
983
java
package com.kookoon.multicountdown; import java.util.TimerTask; public class Timer { private long startTimeMillis; private long time; boolean elapsed; public Timer(int hours, int minutes, int seconds) { set(hours, minutes, seconds); } public void start() { startTimeMillis = System.currentTimeMillis(); java.util.Timer timer = new java.util.Timer(); timer.schedule(new TimerTask() { @Override public void run() { elapsed = true; } }, time); } public long getMillisElapsed() { return System.currentTimeMillis() - startTimeMillis; } public long getMillisLeft() { long millisLeft = time - getMillisElapsed(); if (millisLeft < 0) millisLeft = 0; return millisLeft; } public void set(int hours, int minutes, int seconds) { time = seconds * 1000 + minutes * 60 * 1000 + hours * 60 * 60 * 1000; } }
5698dab077812e810beb73342ee0c4559b705757
4a6593b4d402985be11e295f068b97ee001e0f1a
/client-commented/src/mainclient/methodNowAbstract/MethodNowAbstractIntf2.java
3f6aff87346137dcdae72b21dca907e5997e9e51
[]
no_license
tdegueul/comp-changes-data
5309cfb7c26054929a647f3430dd721260563eda
851a125f5bac29b803fcbc98f39e97403f4ace14
refs/heads/main
2023-06-13T02:00:23.773797
2021-06-30T20:51:10
2021-06-30T20:51:10
378,241,807
0
0
null
2021-06-18T19:03:49
2021-06-18T19:00:44
Java
UTF-8
Java
false
false
133
java
package mainclient.methodNowAbstract; public interface MethodNowAbstractIntf2 extends main.methodNowAbstract.IMethodNowAbstractSub {}
ffd77a5cd28a7528c1a4326fbbcef6a23ea3fd95
6fd7090a9a0f61e3e6fe28848894ef4409967d24
/Notch_DemoApp/Tutorial/app/src/staging/java/com/wearnotch/notchdemo/Config.java
2843b948d318c98cc7b36a774b7a61122ffc6348
[]
no_license
vizielod/Szakdolgozat-2019-Thesis
ac9d00a1822d42c8a077f5b5dcf5bf872394cb90
eb84b154de3a6be63664b49bd104a4a2c7559de0
refs/heads/master
2022-03-22T00:42:16.264654
2019-12-12T16:26:18
2019-12-12T16:26:18
213,485,780
2
0
null
null
null
null
UTF-8
Java
false
false
115
java
package com.wearnotch.notchdemo; public class Config { public static final String NOTCH_DIR = "notch_logs"; }
e979b6287d78cf382cdf0ad19511b5776130009d
388ab9671d285a0449c0ad9861a6f904e75fb58d
/app/src/main/java/com/example/yashmittal/chat/Add.java
97f1d9b9bcb63b802f2aa94c6c3892680c8e272c
[]
no_license
Mr-Mittal/Chat-App
4a80b8b3d12f946cb01a8bbba0641c641d1a4efe
1bb937599b85b36394afcb0d40e520966f5e4f83
refs/heads/master
2021-07-07T15:20:45.058567
2017-09-21T16:39:59
2017-09-21T16:39:59
104,373,189
0
1
null
null
null
null
UTF-8
Java
false
false
5,706
java
package com.example.yashmittal.chat; import android.app.ProgressDialog; import android.content.ContentResolver; import android.content.Intent; import android.graphics.Bitmap; import android.net.Uri; import android.provider.MediaStore; import android.support.annotation.NonNull; import android.support.design.widget.FloatingActionButton; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.webkit.MimeTypeMap; import android.widget.ImageView; import android.widget.Toast; import com.google.android.gms.tasks.OnCompleteListener; import com.google.android.gms.tasks.OnFailureListener; import com.google.android.gms.tasks.OnSuccessListener; import com.google.android.gms.tasks.Task; import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase; import com.google.firebase.storage.FileDownloadTask; import com.google.firebase.storage.FirebaseStorage; import com.google.firebase.storage.OnProgressListener; import com.google.firebase.storage.StorageReference; import com.google.firebase.storage.UploadTask; import java.io.FileNotFoundException; import java.io.IOException; public class Add extends AppCompatActivity { private StorageReference mStorageRef; private DatabaseReference mDatabaseRef; private ImageView imageView; private Uri imguri; private FloatingActionButton FU,FC; public static final String Storage_Path = "image/"; public static final int REQUEST_CODE = 1234; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_add); SelectImage(); mStorageRef = FirebaseStorage.getInstance().getReference(); mDatabaseRef= FirebaseDatabase.getInstance().getReference("Test"); imageView = (ImageView) findViewById(R.id.imageView); FU = (FloatingActionButton) findViewById(R.id.floatingActionButton2); FU.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { UploadPhoto(); } }); FC = (FloatingActionButton) findViewById(R.id.floatingActionButton); FC.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent i = new Intent(Add.this, MainActivity.class); startActivity(i); } }); } @SuppressWarnings("VisibleForTests") private void UploadPhoto() { if (imguri != null) { final ProgressDialog Pd = new ProgressDialog(this); Pd.setTitle("Uploading Post"); Pd.show(); mStorageRef.child(Storage_Path + System.currentTimeMillis() + "." + getImageExt(imguri)).putFile(imguri).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() { @Override public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) { Toast.makeText(getApplicationContext(), "Uploaded Successfully", Toast.LENGTH_SHORT).show(); Pd.dismiss(); Intent i = new Intent(Add.this,MainActivity.class); startActivity(i); FirebaseDatabase.getInstance().getReference("TestP").push().setValue(new ChatMessage( taskSnapshot.getDownloadUrl().toString() , FirebaseAuth.getInstance().getCurrentUser().getEmail())); } }) .addOnFailureListener(new OnFailureListener() { @Override public void onFailure(@NonNull Exception e) { Pd.dismiss(); Toast.makeText(getApplicationContext(), "UnSuccessfull", Toast.LENGTH_SHORT).show(); } }) .addOnProgressListener(new OnProgressListener<UploadTask.TaskSnapshot>() { @Override public void onProgress(UploadTask.TaskSnapshot taskSnapshot) { double progess = (100 * taskSnapshot.getBytesTransferred()) / taskSnapshot.getTotalByteCount(); Pd.setMessage("Uploading " + (int)progess + "" ); } }); } else { Toast.makeText(getApplicationContext(), "Please Select a Image", Toast.LENGTH_SHORT).show(); } } private void SelectImage() { Intent i = new Intent(); i.setType("image/*"); i.setAction(Intent.ACTION_GET_CONTENT); startActivityForResult(Intent.createChooser(i, "SELECT IMAGE"), REQUEST_CODE); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == REQUEST_CODE && resultCode == RESULT_OK && data != null && data.getData() != null) { imguri = data.getData(); try { Bitmap bm = MediaStore.Images.Media.getBitmap(getContentResolver(), imguri); imageView.setImageBitmap(bm); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } } public String getImageExt (Uri uri){ ContentResolver Cr = getContentResolver(); MimeTypeMap MM = MimeTypeMap.getSingleton(); return MM.getExtensionFromMimeType(Cr.getType(uri)); } }
db2689cddb340f525a19ef8fde5cb15be2f22350
2038da9586a657ffdc026d3345663eec8cf09f71
/Cosmic/app/src/main/java/com/example/mp3player/Dexter.java
d95d72395287c274e3ef5e848940a446adeb1cc6
[]
no_license
Gourab73/Android-Apps
e960e229cbddbd08140b7e6eee1863aa4ca1a577
491b5c0de76bfd2aa33e3a70bc24df32c94002ca
refs/heads/master
2023-05-28T12:02:06.073354
2021-06-12T16:08:53
2021-06-12T16:08:53
376,325,324
0
0
null
null
null
null
UTF-8
Java
false
false
56
java
package com.example.mp3player; public class Dexter { }
0dc58ee9dcc2c679c048fefe8d10f67b24378110
14bd86bbd6d88282d926e9a5a9164c0f07aedbb3
/src/main/java/com/zhiwei/po/User.java
6013ca31131259a9f557969aebc2922af2a7717b
[]
no_license
13215657368/ZhiweeSpringboot
6d803fcc0532bb92ad85054b417a0e8d6f6e94b1
3f0696c417a28ebcc8ff8caa100a75a7ea2f6942
refs/heads/master
2022-12-09T21:02:49.499079
2020-02-09T14:25:00
2020-02-09T14:25:00
239,307,429
1
0
null
2022-11-16T05:51:21
2020-02-09T13:15:47
JavaScript
UTF-8
Java
false
false
1,877
java
package com.zhiwei.po; import com.fasterxml.jackson.annotation.JsonFormat; import org.springframework.format.annotation.DateTimeFormat; import java.util.Date; public class User { private Integer id; private String username; private String password; private Integer role; private Integer sex; private String email; @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") @DateTimeFormat(pattern = "yyyy-MM-dd") private Date createTime; private Integer state; private String remark; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username == null ? null : username.trim(); } public String getPassword() { return password; } public void setPassword(String password) { this.password = password == null ? null : password.trim(); } public Integer getRole() { return role; } public void setRole(Integer role) { this.role = role; } public Integer getSex() { return sex; } public void setSex(Integer sex) { this.sex = sex; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public Integer getState() { return state; } public void setState(Integer state) { this.state = state; } public String getRemark() { return remark; } public void setRemark(String remark) { this.remark = remark; } public Date getCreateTime() { return createTime; } public void setCreateTime(Date createTime) { this.createTime = createTime; } }
9caef44b5a597b11f612f91e998862dacdbd8328
221ab76a61d0e2523282971355f3b9cfdbefe756
/src/main/java/ninja/kyle/projectchain/exchanges/Exchange.java
5caacbd090b290eac8cfb2224650f3fe35c6730d
[]
no_license
kyconny/ProjectChain
4570be24bbcea5a54dc98d48e7f5c749c6f63790
250df4c644a465d4da662d98c7e5acccce25825b
refs/heads/master
2021-03-24T10:25:27.058901
2017-12-22T18:17:41
2017-12-22T18:17:41
112,523,967
0
0
null
null
null
null
UTF-8
Java
false
false
3,029
java
package ninja.kyle.projectchain.exchanges; import com.google.common.collect.ImmutableMultimap; import java.math.BigDecimal; import java.util.Optional; import java.util.Set; import java.util.function.Consumer; import ninja.kyle.projectchain.Asset; import ninja.kyle.projectchain.AssetBook; import ninja.kyle.projectchain.ExchangeBook; import ninja.kyle.projectchain.PriceMultimapBuilder; import ninja.kyle.projectchain.PricePoint; import ninja.kyle.projectchain.QueryRecorder; import ninja.kyle.projectchain.internallib.Pair; public abstract class Exchange { private final ExchangeQuerier querier; private final Set<Pair<Asset,Asset>> tradingPairs; private final ExchangeBook exchangeBook; private final PriceMultimapBuilder priceMultimapBuilder; protected Exchange(ExchangeQuerier querier, Set<Pair<Asset, Asset>> tradingPairs) { this.querier = querier; this.tradingPairs = tradingPairs; this.exchangeBook = new ExchangeBook(tradingPairs, 20); this.priceMultimapBuilder = new PriceMultimapBuilder(tradingPairs); } public final Set<Pair<Asset,Asset>> getTradingPairs() { return tradingPairs; } protected final ExchangeBook getExchangeBook() { return exchangeBook; } protected final PriceMultimapBuilder getPriceMultimapBuilder() { return priceMultimapBuilder; } @Deprecated public final void addPriceHistoryObserver(Consumer<ImmutableMultimap<Pair<Asset, Asset>, PricePoint>> observer) { priceMultimapBuilder.addHistoryObserver(observer); } public final void addPriceObserver(Pair<Asset, Asset> market, Consumer<BigDecimal> observer) { priceMultimapBuilder.addPriceObserver(market, observer); } public final void removePriceObserver(Pair<Asset, Asset> market, Consumer<BigDecimal> observer) { priceMultimapBuilder.removePriceObserver(market, observer); } public final void addBookObserver(Pair<Asset, Asset> market, Consumer<AssetBook> observer) { exchangeBook.addBookObserver(market, observer); } public final void removeBookObserver(Pair<Asset, Asset> market, Consumer<AssetBook> observer) { exchangeBook.removeBookObserver(market, observer); } public final void flushPriceData() { priceMultimapBuilder.flushMultimap(); } public final BigDecimal getSpread(Pair<Asset, Asset> tradingPair) { BigDecimal pAsk = exchangeBook.getMostReasonable(tradingPair, AssetBook.OrderType.ASK).getLeft(); BigDecimal pBid = exchangeBook.getMostReasonable(tradingPair, AssetBook.OrderType.BID).getLeft(); return pAsk.subtract(pBid); } protected abstract boolean shouldAllowQuery(QueryRecorder queryRecorder, ExchangePriority priority, int queries); public Optional<ExchangeQuerier> tryUnlockQuerier(QueryRecorder queryRecorder, ExchangePriority priority, int queries) { if (shouldAllowQuery(queryRecorder, priority, queries)) { ExchangeQuerier lockedQuerier = new LockedQuerier(querier, queries); return Optional.of(lockedQuerier); } else { return Optional.empty(); } } }
093e6198bf5ceb6ea6a5193b1e8f6e258276ff80
8c26b3a0cde5f5aa3576056e2ce0ac5817a5e508
/src/main/java/com/liuyang19900520/robotlife/blog/common/pojo/PageBean.java
d8157218b46481639548e4865de69cf9648d1c09
[]
no_license
liuyang19900520/robotlife-blog-java
fd434033772bdcbca71445312108988502ed4f5d
17ea0197dd3ce3ea3883c55b05eac4eac95c2dc3
refs/heads/master
2020-03-28T14:31:47.822899
2019-05-17T09:36:40
2019-05-17T09:36:40
140,818,269
0
0
null
null
null
null
UTF-8
Java
false
false
505
java
package com.liuyang19900520.robotlife.blog.common.pojo; import lombok.Data; import java.io.Serializable; import java.util.List; @Data public class PageBean<T> implements Serializable { /** * The Constant serialVersionUID. */ private static final long serialVersionUID = 1L; /** * The records total. */ private String recordsTotal; private Integer pagesTotal; private Integer currentPage; /** * The data. */ private List<T> data; }
43ef4b80c3247fe5e5dfd3cf049adb4bba3ca932
781895c895b420281667aa8987cf7550549b4e10
/Java/ABC/MultiHandling/src/RaceConditionToOvercome.java
5a170f9c9f3e5e5bd65fcca5c3bdd702760e9923
[]
no_license
shubham-mishra-blip/Tranning
cad8383dfb4c31cadb6c676853668c111106d079
8d6c98bbe097a2fcd851b83a179f096215c31dd4
refs/heads/master
2020-06-24T06:47:43.436646
2020-01-24T03:44:00
2020-01-24T03:44:00
198,884,042
0
0
null
null
null
null
UTF-8
Java
false
false
1,565
java
class MsWord extends Thread{ @Override public void run() { try { if (Thread.currentThread().getName() == "Type") { typing(); } else if (Thread.currentThread().getName() == "Spell") { spellcheck(); } else autosaving(); } catch (Exception e) { e.printStackTrace(); } } //typing void typing() throws InterruptedException{ for (int i = 0 ; i < 5; i ++){ System.out.println("Typing Opertation is going On"); Thread.sleep(3000); } } //spellchecking void spellcheck()throws InterruptedException { for (int i = 0; i < 5; i++) { System.out.println("Spell Checking Opertation is going On"); Thread.sleep(3000); } } //void autosaving void autosaving()throws InterruptedException { for (int i = 0; i < 5; i++) { System.out.println("Auto-Saving Opertation is going On"); Thread.sleep(3000); } } } public class RaceConditionToOvercome { public static void main(String[] args) { MsWord m1 = new MsWord(); MsWord m2 = new MsWord(); MsWord m3 = new MsWord(); m1.setName("Type"); m2.setName("Spell"); m3.setName("Autosave"); m2.setDaemon(true); m3.setDaemon(true); m1.setPriority(1); m2.setPriority(6); m3.setPriority(10); m1.start(); m2.start(); m3.start(); } }
962f746c40d3882e1a7e1379de8d544c18fd88a2
88dd051e8f03199e8d3b0189663489caf9ef2f26
/app/src/main/java/com/example/spk170001_asg5/GameCanvas.java
f61ff942114f30105104501b2b1c5e96a286f359
[]
no_license
spkulkarni33/Android-application
cd7bff4cbf22d26252d436ceaac2d9d446f86784
e7ec5d488abd0af8f043c934ee3e15c05953bd18
refs/heads/master
2022-11-12T07:24:31.392099
2020-07-02T01:10:59
2020-07-02T01:10:59
276,516,209
0
0
null
null
null
null
UTF-8
Java
false
false
6,520
java
/******************************************************************************* * GameCanvas.java: Java class to handle the drawing of shapes on the canvas. * * This class detects the touch events by the user and identifies which shape * has been touched and needs to disappear. * * The score of the user is calculated and the current date, time and score is * sent to the EnterRecord activity to enter the score of the user. * * Information like final score and the number of shapes missed is displayed to * the user. * * Written by Sanket Kulkarni (spk170001) at The University of Texas at Dallas * starting March 20, 2020. ******************************************************************************/ package com.example.spk170001_asg5; import android.annotation.SuppressLint; import android.app.AlertDialog; import android.content.DialogInterface; import android.content.Intent; import android.graphics.Color; import android.graphics.drawable.ShapeDrawable; import android.os.Bundle; import android.view.MotionEvent; import android.view.View; import android.widget.LinearLayout; import android.widget.TextView; import androidx.appcompat.app.AppCompatActivity; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; public class GameCanvas extends AppCompatActivity { int correct_touches = 0; int total_touches = 0; long final_score; @SuppressLint("ClickableViewAccessibility") @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.game_canvas_screen); final LinearLayout canvas_layout = findViewById(R.id.canvas_layout); final DrawShapes dshapes = new DrawShapes(GameCanvas.this); canvas_layout.addView(dshapes); final long start_time = System.currentTimeMillis(); //Detect touch event on the canvas canvas_layout.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { int action = event.getAction(); TextView touch = findViewById(R.id.touches); switch(action) { case MotionEvent.ACTION_DOWN: { //Co-ordinates at the ACTION_DOWN int x = (int)event.getX(); int y = (int)event.getY(); total_touches += 1; //loop to check if a shape has been touched for(int i = 0; i < dshapes.shapes.size(); i++) { ShapeDrawable shape = dshapes.shapes.get(i); if(shape.getBounds().contains(x, y)) { //block to check if the shape that has been touched is a RED square if(shape.getPaint().getColor() == Color.RED && dshapes.rects.contains(shape)) { correct_touches += 1; } touch.setText("Squares Touched: "+correct_touches); dshapes.removable = shape; //set the shape to be removed to the shape that has been touched. dshapes.indicator = 0; //indicate to DrawShapes that a shape has been touched dshapes.invalidate(); } } // User has popped 10 RED squares. End the game and display statistics. if(correct_touches == 10) { DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); Date date = new Date(); final String[] datetime = dateFormat.format(date).split(" "); long endtime = System.currentTimeMillis(); final_score = endtime - start_time; dateFormat = new SimpleDateFormat("mm:ss"); final String score = dateFormat.format(final_score); int miss = dshapes.redshapes - 10; //Number of shapes that the user should have popped // Form alert dialog AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(GameCanvas.this); alertDialogBuilder.setMessage("Game Over!\nMissed Shapes: "+miss+"\n" + "Total Score: "+ score + "\nDo you wish to continue?"); //Collect information and send intent to enter score to the scoreboard. alertDialogBuilder.setPositiveButton("yes", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface arg0, int arg1) { Intent intent = new Intent(getApplicationContext(), EnterRecord.class); intent.putExtra("Score", ""+score); intent.putExtra("Date", datetime[0]); intent.putExtra("Time", datetime[1]); startActivity(intent); } }); // Return to main screen of the application. alertDialogBuilder.setNegativeButton("No",new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { Intent intent = new Intent(getApplicationContext(), MainActivity.class); startActivity(intent); } }); AlertDialog alertDialog = alertDialogBuilder.create(); alertDialog.show(); } break; } } return true; } }); } }
34736829e38764c0caae363e6e8d2b998877d3bc
8cf9179f14a62049605878729a71be70f0d7c88a
/app/src/main/java/com/bignerdranch/android/criminalintent/CrimeListActivity.java
ced11feaf00fc92dbe7978ec44378fc01a955a80
[]
no_license
jvelasquez3/CriminalIntent
44ccc6609e4073f403e4d257d073c87333487567
b8a3af3dbdd0de8bf4d651fb6e21cf7e4251957d
refs/heads/master
2021-01-22T23:05:40.576584
2017-03-20T16:50:20
2017-03-20T16:50:20
85,602,471
0
0
null
null
null
null
UTF-8
Java
false
false
300
java
package com.bignerdranch.android.criminalintent; import android.support.v4.app.Fragment; /** * Created by Jorge on 13/01/17. */ public class CrimeListActivity extends SingleFragmentActivity { @Override protected Fragment createFragment(){ return new CrimeListFragment(); } }
84b54bc7f83f77882af6790fc67c7c58edb1fffc
e41c9ca285abcb236e3bce01d640fca6c61c816c
/app/src/main/java/com/example/prateek/weatherapplication/utility/Utility.java
3e28b0cf99d14c099f10a0094700892868ebf56e
[]
no_license
Prateekchaudhary/WeatherApplicationDemo
6b9624c5f75b072ede36f905a5589165757ddb9c
1bb3b59eac200eced7345dc53903fef1eaf06238
refs/heads/master
2021-01-23T20:26:01.589808
2017-09-06T08:08:34
2017-09-06T08:08:34
102,858,019
0
1
null
2019-11-18T15:54:37
2017-09-08T12:14:45
Java
UTF-8
Java
false
false
1,139
java
package com.example.prateek.weatherapplication.utility; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.net.ConnectivityManager; import android.net.NetworkInfo; import com.example.prateek.weatherapplication.R; import java.io.InputStream; import java.net.HttpURLConnection; import java.net.URL; import java.util.Date; /** * Created by Prateek on 28/08/17. */ /** * This is Utility class to handle connection */ public class Utility { /** * This method return internet connection status (connected or not connected) * * @param context is Application context * @return true if connected false otherwise */ public static boolean isConnectingToInternet(Context context) { ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo ni = connectivityManager.getActiveNetworkInfo(); if (ni != null && ni.isConnectedOrConnecting()) { return true; } else { return false; } } }
b3fe1bba746e5f2cd1d6427163784360265407fa
17a73fb792bedddb61ca4e383e8d38f5519b7ea6
/HomeWorkFive/src/enums/Priority.java
57be0a3c36cd2bbd16367ecddc91c0df5f7c9e1d
[]
no_license
antarin/java
9e90c53d6fb6f5dbe2d9acec080870fe690a877a
4f42375ceae9884f1f91d49b8bdba22f0ac17701
refs/heads/master
2021-05-08T04:24:36.604911
2018-01-24T17:44:56
2018-01-24T17:44:56
108,403,583
0
0
null
null
null
null
UTF-8
Java
false
false
242
java
package enums; public enum Priority { URGENT(1), MEDIUM(2), LOW(3); private int value; Priority(int type) { this.value = type; } public int getValue() { return value; } }
abd53ce29a11544aa3869b7fc485e7fabe043f67
ae5eb1a38b4d22c82dfd67c86db73592094edc4b
/project256/src/test/java/org/gradle/test/performance/largejavamultiproject/project256/p1282/Test25658.java
9a745922336dbbaa8cb517770cc91a9a1ec97efc
[]
no_license
big-guy/largeJavaMultiProject
405cc7f55301e1fd87cee5878a165ec5d4a071aa
1cd6a3f9c59e9b13dffa35ad27d911114f253c33
refs/heads/main
2023-03-17T10:59:53.226128
2021-03-04T01:01:39
2021-03-04T01:01:39
344,307,977
0
0
null
null
null
null
UTF-8
Java
false
false
2,113
java
package org.gradle.test.performance.largejavamultiproject.project256.p1282; import org.junit.Test; import static org.junit.Assert.*; public class Test25658 { Production25658 objectUnderTest = new Production25658(); @Test public void testProperty0() { String value = "value"; objectUnderTest.setProperty0(value); assertEquals(value, objectUnderTest.getProperty0()); } @Test public void testProperty1() { String value = "value"; objectUnderTest.setProperty1(value); assertEquals(value, objectUnderTest.getProperty1()); } @Test public void testProperty2() { String value = "value"; objectUnderTest.setProperty2(value); assertEquals(value, objectUnderTest.getProperty2()); } @Test public void testProperty3() { String value = "value"; objectUnderTest.setProperty3(value); assertEquals(value, objectUnderTest.getProperty3()); } @Test public void testProperty4() { String value = "value"; objectUnderTest.setProperty4(value); assertEquals(value, objectUnderTest.getProperty4()); } @Test public void testProperty5() { String value = "value"; objectUnderTest.setProperty5(value); assertEquals(value, objectUnderTest.getProperty5()); } @Test public void testProperty6() { String value = "value"; objectUnderTest.setProperty6(value); assertEquals(value, objectUnderTest.getProperty6()); } @Test public void testProperty7() { String value = "value"; objectUnderTest.setProperty7(value); assertEquals(value, objectUnderTest.getProperty7()); } @Test public void testProperty8() { String value = "value"; objectUnderTest.setProperty8(value); assertEquals(value, objectUnderTest.getProperty8()); } @Test public void testProperty9() { String value = "value"; objectUnderTest.setProperty9(value); assertEquals(value, objectUnderTest.getProperty9()); } }
6bb4d21be2f19b0a666152d72992f27ffcc551be
90dd08f15fbf1b80a7cd745228c0f539b0bd7a97
/power-common/src/main/java/org/arain/power/common/pojo/system/SysExpressExample.java
a10a389d49d8acadb174d06e2d3b3b1bf507ec90
[]
no_license
rain10/distributed_power
a2b918d4ff05fd1dafd880eec74c5bc53cc7029d
a7740bc8751c685cb3d62c681d01ec702f142de2
refs/heads/master
2021-05-10T07:58:56.736851
2018-01-25T06:12:10
2018-01-25T06:12:10
118,870,188
0
1
null
null
null
null
UTF-8
Java
false
false
22,297
java
package org.arain.power.common.pojo.system; import java.math.BigDecimal; import java.util.ArrayList; import java.util.Date; import java.util.List; public class SysExpressExample { protected String orderByClause; protected boolean distinct; protected List<Criteria> oredCriteria; public SysExpressExample() { oredCriteria = new ArrayList<Criteria>(); } public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; } public String getOrderByClause() { return orderByClause; } public void setDistinct(boolean distinct) { this.distinct = distinct; } public boolean isDistinct() { return distinct; } public List<Criteria> getOredCriteria() { return oredCriteria; } public void or(Criteria criteria) { oredCriteria.add(criteria); } public Criteria or() { Criteria criteria = createCriteriaInternal(); oredCriteria.add(criteria); return criteria; } public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); if (oredCriteria.size() == 0) { oredCriteria.add(criteria); } return criteria; } protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); return criteria; } public void clear() { oredCriteria.clear(); orderByClause = null; distinct = false; } protected abstract static class GeneratedCriteria { protected List<Criterion> criteria; protected GeneratedCriteria() { super(); criteria = new ArrayList<Criterion>(); } public boolean isValid() { return criteria.size() > 0; } public List<Criterion> getAllCriteria() { return criteria; } public List<Criterion> getCriteria() { return criteria; } protected void addCriterion(String condition) { if (condition == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new Criterion(condition)); } protected void addCriterion(String condition, Object value, String property) { if (value == null) { throw new RuntimeException("Value for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value)); } protected void addCriterion(String condition, Object value1, Object value2, String property) { if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value1, value2)); } public Criteria andIdIsNull() { addCriterion("ID_ is null"); return (Criteria) this; } public Criteria andIdIsNotNull() { addCriterion("ID_ is not null"); return (Criteria) this; } public Criteria andIdEqualTo(Long value) { addCriterion("ID_ =", value, "id"); return (Criteria) this; } public Criteria andIdNotEqualTo(Long value) { addCriterion("ID_ <>", value, "id"); return (Criteria) this; } public Criteria andIdGreaterThan(Long value) { addCriterion("ID_ >", value, "id"); return (Criteria) this; } public Criteria andIdGreaterThanOrEqualTo(Long value) { addCriterion("ID_ >=", value, "id"); return (Criteria) this; } public Criteria andIdLessThan(Long value) { addCriterion("ID_ <", value, "id"); return (Criteria) this; } public Criteria andIdLessThanOrEqualTo(Long value) { addCriterion("ID_ <=", value, "id"); return (Criteria) this; } public Criteria andIdIn(List<Long> values) { addCriterion("ID_ in", values, "id"); return (Criteria) this; } public Criteria andIdNotIn(List<Long> values) { addCriterion("ID_ not in", values, "id"); return (Criteria) this; } public Criteria andIdBetween(Long value1, Long value2) { addCriterion("ID_ between", value1, value2, "id"); return (Criteria) this; } public Criteria andIdNotBetween(Long value1, Long value2) { addCriterion("ID_ not between", value1, value2, "id"); return (Criteria) this; } public Criteria andNameIsNull() { addCriterion("NAME_ is null"); return (Criteria) this; } public Criteria andNameIsNotNull() { addCriterion("NAME_ is not null"); return (Criteria) this; } public Criteria andNameEqualTo(String value) { addCriterion("NAME_ =", value, "name"); return (Criteria) this; } public Criteria andNameNotEqualTo(String value) { addCriterion("NAME_ <>", value, "name"); return (Criteria) this; } public Criteria andNameGreaterThan(String value) { addCriterion("NAME_ >", value, "name"); return (Criteria) this; } public Criteria andNameGreaterThanOrEqualTo(String value) { addCriterion("NAME_ >=", value, "name"); return (Criteria) this; } public Criteria andNameLessThan(String value) { addCriterion("NAME_ <", value, "name"); return (Criteria) this; } public Criteria andNameLessThanOrEqualTo(String value) { addCriterion("NAME_ <=", value, "name"); return (Criteria) this; } public Criteria andNameLike(String value) { addCriterion("NAME_ like", value, "name"); return (Criteria) this; } public Criteria andNameNotLike(String value) { addCriterion("NAME_ not like", value, "name"); return (Criteria) this; } public Criteria andNameIn(List<String> values) { addCriterion("NAME_ in", values, "name"); return (Criteria) this; } public Criteria andNameNotIn(List<String> values) { addCriterion("NAME_ not in", values, "name"); return (Criteria) this; } public Criteria andNameBetween(String value1, String value2) { addCriterion("NAME_ between", value1, value2, "name"); return (Criteria) this; } public Criteria andNameNotBetween(String value1, String value2) { addCriterion("NAME_ not between", value1, value2, "name"); return (Criteria) this; } public Criteria andWebsiteIsNull() { addCriterion("WEBSITE_ is null"); return (Criteria) this; } public Criteria andWebsiteIsNotNull() { addCriterion("WEBSITE_ is not null"); return (Criteria) this; } public Criteria andWebsiteEqualTo(String value) { addCriterion("WEBSITE_ =", value, "website"); return (Criteria) this; } public Criteria andWebsiteNotEqualTo(String value) { addCriterion("WEBSITE_ <>", value, "website"); return (Criteria) this; } public Criteria andWebsiteGreaterThan(String value) { addCriterion("WEBSITE_ >", value, "website"); return (Criteria) this; } public Criteria andWebsiteGreaterThanOrEqualTo(String value) { addCriterion("WEBSITE_ >=", value, "website"); return (Criteria) this; } public Criteria andWebsiteLessThan(String value) { addCriterion("WEBSITE_ <", value, "website"); return (Criteria) this; } public Criteria andWebsiteLessThanOrEqualTo(String value) { addCriterion("WEBSITE_ <=", value, "website"); return (Criteria) this; } public Criteria andWebsiteLike(String value) { addCriterion("WEBSITE_ like", value, "website"); return (Criteria) this; } public Criteria andWebsiteNotLike(String value) { addCriterion("WEBSITE_ not like", value, "website"); return (Criteria) this; } public Criteria andWebsiteIn(List<String> values) { addCriterion("WEBSITE_ in", values, "website"); return (Criteria) this; } public Criteria andWebsiteNotIn(List<String> values) { addCriterion("WEBSITE_ not in", values, "website"); return (Criteria) this; } public Criteria andWebsiteBetween(String value1, String value2) { addCriterion("WEBSITE_ between", value1, value2, "website"); return (Criteria) this; } public Criteria andWebsiteNotBetween(String value1, String value2) { addCriterion("WEBSITE_ not between", value1, value2, "website"); return (Criteria) this; } public Criteria andCodeIsNull() { addCriterion("CODE_ is null"); return (Criteria) this; } public Criteria andCodeIsNotNull() { addCriterion("CODE_ is not null"); return (Criteria) this; } public Criteria andCodeEqualTo(String value) { addCriterion("CODE_ =", value, "code"); return (Criteria) this; } public Criteria andCodeNotEqualTo(String value) { addCriterion("CODE_ <>", value, "code"); return (Criteria) this; } public Criteria andCodeGreaterThan(String value) { addCriterion("CODE_ >", value, "code"); return (Criteria) this; } public Criteria andCodeGreaterThanOrEqualTo(String value) { addCriterion("CODE_ >=", value, "code"); return (Criteria) this; } public Criteria andCodeLessThan(String value) { addCriterion("CODE_ <", value, "code"); return (Criteria) this; } public Criteria andCodeLessThanOrEqualTo(String value) { addCriterion("CODE_ <=", value, "code"); return (Criteria) this; } public Criteria andCodeLike(String value) { addCriterion("CODE_ like", value, "code"); return (Criteria) this; } public Criteria andCodeNotLike(String value) { addCriterion("CODE_ not like", value, "code"); return (Criteria) this; } public Criteria andCodeIn(List<String> values) { addCriterion("CODE_ in", values, "code"); return (Criteria) this; } public Criteria andCodeNotIn(List<String> values) { addCriterion("CODE_ not in", values, "code"); return (Criteria) this; } public Criteria andCodeBetween(String value1, String value2) { addCriterion("CODE_ between", value1, value2, "code"); return (Criteria) this; } public Criteria andCodeNotBetween(String value1, String value2) { addCriterion("CODE_ not between", value1, value2, "code"); return (Criteria) this; } public Criteria andSortIsNull() { addCriterion("SORT_ is null"); return (Criteria) this; } public Criteria andSortIsNotNull() { addCriterion("SORT_ is not null"); return (Criteria) this; } public Criteria andSortEqualTo(BigDecimal value) { addCriterion("SORT_ =", value, "sort"); return (Criteria) this; } public Criteria andSortNotEqualTo(BigDecimal value) { addCriterion("SORT_ <>", value, "sort"); return (Criteria) this; } public Criteria andSortGreaterThan(BigDecimal value) { addCriterion("SORT_ >", value, "sort"); return (Criteria) this; } public Criteria andSortGreaterThanOrEqualTo(BigDecimal value) { addCriterion("SORT_ >=", value, "sort"); return (Criteria) this; } public Criteria andSortLessThan(BigDecimal value) { addCriterion("SORT_ <", value, "sort"); return (Criteria) this; } public Criteria andSortLessThanOrEqualTo(BigDecimal value) { addCriterion("SORT_ <=", value, "sort"); return (Criteria) this; } public Criteria andSortIn(List<BigDecimal> values) { addCriterion("SORT_ in", values, "sort"); return (Criteria) this; } public Criteria andSortNotIn(List<BigDecimal> values) { addCriterion("SORT_ not in", values, "sort"); return (Criteria) this; } public Criteria andSortBetween(BigDecimal value1, BigDecimal value2) { addCriterion("SORT_ between", value1, value2, "sort"); return (Criteria) this; } public Criteria andSortNotBetween(BigDecimal value1, BigDecimal value2) { addCriterion("SORT_ not between", value1, value2, "sort"); return (Criteria) this; } public Criteria andEnabledIsNull() { addCriterion("ENABLED_ is null"); return (Criteria) this; } public Criteria andEnabledIsNotNull() { addCriterion("ENABLED_ is not null"); return (Criteria) this; } public Criteria andEnabledEqualTo(BigDecimal value) { addCriterion("ENABLED_ =", value, "enabled"); return (Criteria) this; } public Criteria andEnabledNotEqualTo(BigDecimal value) { addCriterion("ENABLED_ <>", value, "enabled"); return (Criteria) this; } public Criteria andEnabledGreaterThan(BigDecimal value) { addCriterion("ENABLED_ >", value, "enabled"); return (Criteria) this; } public Criteria andEnabledGreaterThanOrEqualTo(BigDecimal value) { addCriterion("ENABLED_ >=", value, "enabled"); return (Criteria) this; } public Criteria andEnabledLessThan(BigDecimal value) { addCriterion("ENABLED_ <", value, "enabled"); return (Criteria) this; } public Criteria andEnabledLessThanOrEqualTo(BigDecimal value) { addCriterion("ENABLED_ <=", value, "enabled"); return (Criteria) this; } public Criteria andEnabledIn(List<BigDecimal> values) { addCriterion("ENABLED_ in", values, "enabled"); return (Criteria) this; } public Criteria andEnabledNotIn(List<BigDecimal> values) { addCriterion("ENABLED_ not in", values, "enabled"); return (Criteria) this; } public Criteria andEnabledBetween(BigDecimal value1, BigDecimal value2) { addCriterion("ENABLED_ between", value1, value2, "enabled"); return (Criteria) this; } public Criteria andEnabledNotBetween(BigDecimal value1, BigDecimal value2) { addCriterion("ENABLED_ not between", value1, value2, "enabled"); return (Criteria) this; } public Criteria andOperatorIsNull() { addCriterion("OPERATOR_ is null"); return (Criteria) this; } public Criteria andOperatorIsNotNull() { addCriterion("OPERATOR_ is not null"); return (Criteria) this; } public Criteria andOperatorEqualTo(String value) { addCriterion("OPERATOR_ =", value, "operator"); return (Criteria) this; } public Criteria andOperatorNotEqualTo(String value) { addCriterion("OPERATOR_ <>", value, "operator"); return (Criteria) this; } public Criteria andOperatorGreaterThan(String value) { addCriterion("OPERATOR_ >", value, "operator"); return (Criteria) this; } public Criteria andOperatorGreaterThanOrEqualTo(String value) { addCriterion("OPERATOR_ >=", value, "operator"); return (Criteria) this; } public Criteria andOperatorLessThan(String value) { addCriterion("OPERATOR_ <", value, "operator"); return (Criteria) this; } public Criteria andOperatorLessThanOrEqualTo(String value) { addCriterion("OPERATOR_ <=", value, "operator"); return (Criteria) this; } public Criteria andOperatorLike(String value) { addCriterion("OPERATOR_ like", value, "operator"); return (Criteria) this; } public Criteria andOperatorNotLike(String value) { addCriterion("OPERATOR_ not like", value, "operator"); return (Criteria) this; } public Criteria andOperatorIn(List<String> values) { addCriterion("OPERATOR_ in", values, "operator"); return (Criteria) this; } public Criteria andOperatorNotIn(List<String> values) { addCriterion("OPERATOR_ not in", values, "operator"); return (Criteria) this; } public Criteria andOperatorBetween(String value1, String value2) { addCriterion("OPERATOR_ between", value1, value2, "operator"); return (Criteria) this; } public Criteria andOperatorNotBetween(String value1, String value2) { addCriterion("OPERATOR_ not between", value1, value2, "operator"); return (Criteria) this; } public Criteria andOpTimeIsNull() { addCriterion("OP_TIME_ is null"); return (Criteria) this; } public Criteria andOpTimeIsNotNull() { addCriterion("OP_TIME_ is not null"); return (Criteria) this; } public Criteria andOpTimeEqualTo(Date value) { addCriterion("OP_TIME_ =", value, "opTime"); return (Criteria) this; } public Criteria andOpTimeNotEqualTo(Date value) { addCriterion("OP_TIME_ <>", value, "opTime"); return (Criteria) this; } public Criteria andOpTimeGreaterThan(Date value) { addCriterion("OP_TIME_ >", value, "opTime"); return (Criteria) this; } public Criteria andOpTimeGreaterThanOrEqualTo(Date value) { addCriterion("OP_TIME_ >=", value, "opTime"); return (Criteria) this; } public Criteria andOpTimeLessThan(Date value) { addCriterion("OP_TIME_ <", value, "opTime"); return (Criteria) this; } public Criteria andOpTimeLessThanOrEqualTo(Date value) { addCriterion("OP_TIME_ <=", value, "opTime"); return (Criteria) this; } public Criteria andOpTimeIn(List<Date> values) { addCriterion("OP_TIME_ in", values, "opTime"); return (Criteria) this; } public Criteria andOpTimeNotIn(List<Date> values) { addCriterion("OP_TIME_ not in", values, "opTime"); return (Criteria) this; } public Criteria andOpTimeBetween(Date value1, Date value2) { addCriterion("OP_TIME_ between", value1, value2, "opTime"); return (Criteria) this; } public Criteria andOpTimeNotBetween(Date value1, Date value2) { addCriterion("OP_TIME_ not between", value1, value2, "opTime"); return (Criteria) this; } } public static class Criteria extends GeneratedCriteria { protected Criteria() { super(); } } public static class Criterion { private String condition; private Object value; private Object secondValue; private boolean noValue; private boolean singleValue; private boolean betweenValue; private boolean listValue; private String typeHandler; public String getCondition() { return condition; } public Object getValue() { return value; } public Object getSecondValue() { return secondValue; } public boolean isNoValue() { return noValue; } public boolean isSingleValue() { return singleValue; } public boolean isBetweenValue() { return betweenValue; } public boolean isListValue() { return listValue; } public String getTypeHandler() { return typeHandler; } protected Criterion(String condition) { super(); this.condition = condition; this.typeHandler = null; this.noValue = true; } protected Criterion(String condition, Object value, String typeHandler) { super(); this.condition = condition; this.value = value; this.typeHandler = typeHandler; if (value instanceof List<?>) { this.listValue = true; } else { this.singleValue = true; } } protected Criterion(String condition, Object value) { this(condition, value, null); } protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { super(); this.condition = condition; this.value = value; this.secondValue = secondValue; this.typeHandler = typeHandler; this.betweenValue = true; } protected Criterion(String condition, Object value, Object secondValue) { this(condition, value, secondValue, null); } } }
894bfbb1d9d1d9e774ff325d569a253648d944c2
058622dd7f123b07bfb08e38d47fed00a2e2b1ed
/app/src/main/java/scharrer/bernhard/dungeonslayers/data/MoneyData.java
e39525e4ec44f8084be36c715054f9750ac59c4f
[]
no_license
BernhardScharrer/DungeonSlayers
e21942dba44ba9c67916b9e8f22361508b4bb4dd
3a1f345ebe6b19b2d984721c68a7bcf033060d31
refs/heads/master
2020-03-07T01:49:14.299145
2018-03-31T17:37:53
2018-03-31T17:37:53
127,193,823
0
0
null
null
null
null
UTF-8
Java
false
false
549
java
package scharrer.bernhard.dungeonslayers.data; /** * Project FFOrganizer * Created by Bernhard Scharrer on 28.03.2018. */ public class MoneyData { private int gold; private int silber; private int kupfer; public MoneyData(int gold, int silber, int kupfer) { this.gold = gold; this.silber = silber; this.kupfer = kupfer; } public int getGold() { return gold; } public int getSilber() { return silber; } public int getKupfer() { return kupfer; } }
222d3da1ab4199f00f8651027afec4c0135f132f
02d5be181497c8e64bb2b696b8a1937ab9a12685
/app/src/main/java/example/com/douying/activity/GuideActivity4.java
637722a7fd20a8deb578afb1c49fe21cf578ab73
[]
no_license
xiao349305433/Douying
e0a16a89ceb09dcaca74a31f7fa2170ec5b76435
3f6e77adca0b5c98b74d5abd505b17d6fcf8cd7e
refs/heads/master
2020-04-16T01:30:52.616206
2019-01-30T08:59:41
2019-01-30T08:59:41
165,176,577
0
0
null
null
null
null
UTF-8
Java
false
false
1,483
java
package example.com.douying.activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.ImageView; import butterknife.BindView; import butterknife.OnClick; import example.com.douying.BaseActivity; import example.com.douying.R; import qiu.niorgai.StatusBarCompat; public class GuideActivity4 extends BaseActivity { @BindView(R.id.guide4_img1) ImageView guide4_img1; @BindView(R.id.guide4_img2) ImageView guide4_img2; @Override public void afterCreate(Bundle savedInstanceState) { StatusBarCompat.setStatusBarColor(this, getResources().getColor(R.color.gg)); } @Override public int provideContentViewId() { return R.layout.activity_guide4; } @OnClick({R.id.guide4_img1, R.id.guide4_img2, R.id.guide4_next}) public void test(View view) { switch (view.getId()) { case R.id.guide4_img1: guide4_img1.setBackground(getResources().getDrawable(R.drawable.item_swtichactor_img_shape_red)); guide4_img2.setBackground(null); break; case R.id.guide4_img2: guide4_img1.setBackground(null); guide4_img2.setBackground(getResources().getDrawable(R.drawable.item_swtichactor_img_shape_red)); break; case R.id.guide4_next: startActivity(new Intent(this, GuideActivity5.class)); break; } } }
7647f2bf88373beb8760a808973a9c9ba6b4c088
73a3797a779b8e7504cff2b30c518b177950485a
/50Progerams Dreamware/src/main/java/Klargest.java
da50724baac27f5795a3bfa38f55ea2b2ee98299
[]
no_license
shruti-2522/Interview-Preaparation
7d02bf119ff99d356972ac8aa42198b549c93963
174894730d935df5bc8f2c26cd204f908a5a2079
refs/heads/master
2023-07-10T01:58:23.881717
2021-08-13T12:22:15
2021-08-13T12:22:15
385,456,395
0
0
null
null
null
null
UTF-8
Java
false
false
972
java
import java.util.Scanner; public class Klargest { public static void main(String args[]) { int temp; Scanner s = new Scanner(System.in); System.out.println("Enter array size:"); int n = s.nextInt(); int arr[] = new int[n]; System.out.println("Enter Array Elements"); for (int i = 0; i < n; i++) { arr[i] = s.nextInt(); } System.out.println("Enter element to find kth Largest element:"); int k = s.nextInt(); for (int i = 0; i < arr.length - 1; i++) { for (int j = i + 1; j < arr.length; j++) { if (arr[i] <arr[j]) { temp = arr[i]; arr[i] = arr[j]; arr[j] = temp; } } // end inner if (i == k - 1) { System.out.println("Largest element=" + arr[i]); break; } // end if } // end outer }// end main }// end class /* * Output: Enter array size: 5 Enter Array Elements 1 43 5 0 2 Enter elemtt to * find kth smalles element 2 Smallest element=1 */
838c9604b612920a6a82835153b8f076ab370284
a2d4bec9812e129e28a63507da7b3aa3f96f5787
/com/google/android/gms/tagmanager/al.java
fef734c0046469b6b064fb945f061b53fa10a25b
[]
no_license
achoraev/RealRacingSource
c5720b4a4437e96c356e88e225a8d0f812e3520a
9bc98f4708c8f67c388b35d756e3c3517572163e
refs/heads/master
2020-04-17T16:47:58.342025
2015-04-22T06:52:40
2015-04-22T06:52:40
34,332,999
0
0
null
null
null
null
UTF-8
Java
false
false
608
java
package com.google.android.gms.tagmanager; import com.google.android.gms.internal.a; import com.google.android.gms.internal.d.a; import java.util.Map; class al extends by { private static final String ID = a.ax.toString(); public al() { super(ID); } protected boolean a(dh paramdh1, dh paramdh2, Map<String, d.a> paramMap) { return paramdh1.a(paramdh2) >= 0; } } /* Location: E:\Dropbox\Dropbox\RealRacingHack\Decompile\install_dex2jar.jar * Qualified Name: com.google.android.gms.tagmanager.al * JD-Core Version: 0.7.0.1 */
d2a150ceff9b49698ea00ceb8a52e3209856cde5
2bf9d3589a6508df8043475c205b24ee120c7166
/src/main/java/com/social/web/rest/dto/TvShowDTO.java
4f63fded525aa9357b0dc4667258fac6992205ac
[]
no_license
leocardena/social
8e1f8e32137202484a635ddae175f395ca6b69bf
f50e1c9d46437b9e7bcae1cc59bc7b890e89dce6
refs/heads/master
2020-05-21T20:43:47.074509
2017-05-02T00:30:05
2017-05-02T00:30:05
64,167,283
0
1
null
null
null
null
UTF-8
Java
false
false
1,012
java
package com.social.web.rest.dto; public class TvShowDTO { private long id; private String slug; private String imdb; private String name; private String trailer; private String homePage; private RatingDTO rating; public long getId() { return id; } public void setId(long id) { this.id = id; } public String getSlug() { return slug; } public void setSlug(String slug) { this.slug = slug; } public String getImdb() { return imdb; } public void setImdb(String imdb) { this.imdb = imdb; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getTrailer() { return trailer; } public void setTrailer(String trailer) { this.trailer = trailer; } public String getHomePage() { return homePage; } public void setHomePage(String homePage) { this.homePage = homePage; } public RatingDTO getRating() { return rating; } public void setRating(RatingDTO rating) { this.rating = rating; } }
dfe683c36d68ebc0213477271fc59912668ab619
47aa6857c9dd1377b8e5a47375cf0874ca955e30
/src/test/java/com/eatthepath/uuid/FastUUIDTest.java
1aaf86000db0949b8420ebbd12c88f4600995637
[ "MIT" ]
permissive
jchambers/fast-uuid
70993820782dd8ab2e0df8ce9cba1e251461909b
9a60f414719792fe52d6273aa0f9d114f6f6469a
refs/heads/main
2023-09-03T18:22:57.255429
2021-08-24T03:22:03
2021-08-24T03:22:03
118,267,613
177
18
MIT
2023-01-14T23:35:47
2018-01-20T18:02:40
Java
UTF-8
Java
false
false
3,488
java
/* * The MIT License (MIT) * * Copyright (c) 2018 Jon Chambers * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ package com.eatthepath.uuid; import org.junit.Test; import java.util.UUID; import static org.junit.Assert.*; public class FastUUIDTest { @Test public void testParseUUID() { final UUID uuid = UUID.randomUUID(); assertEquals(uuid, FastUUID.parseUUID(uuid.toString())); } @Test(expected = IllegalArgumentException.class) public void testParseUUIDWrongLength() { FastUUID.parseUUID(UUID.randomUUID().toString() + "0"); } @Test(expected = IllegalArgumentException.class) public void testParseUUIDNoDashes() { FastUUID.parseUUID("123456789012345678901234567890123456"); } @Test public void testToString() { final UUID uuid = UUID.randomUUID(); assertEquals(uuid.toString(), FastUUID.toString(uuid)); } @Test public void testGetHexValueForChar() { assertEquals(0, FastUUID.getHexValueForChar('0')); assertEquals(1, FastUUID.getHexValueForChar('1')); assertEquals(2, FastUUID.getHexValueForChar('2')); assertEquals(3, FastUUID.getHexValueForChar('3')); assertEquals(4, FastUUID.getHexValueForChar('4')); assertEquals(5, FastUUID.getHexValueForChar('5')); assertEquals(6, FastUUID.getHexValueForChar('6')); assertEquals(7, FastUUID.getHexValueForChar('7')); assertEquals(8, FastUUID.getHexValueForChar('8')); assertEquals(9, FastUUID.getHexValueForChar('9')); assertEquals(0xa, FastUUID.getHexValueForChar('a')); assertEquals(0xb, FastUUID.getHexValueForChar('b')); assertEquals(0xc, FastUUID.getHexValueForChar('c')); assertEquals(0xd, FastUUID.getHexValueForChar('d')); assertEquals(0xe, FastUUID.getHexValueForChar('e')); assertEquals(0xf, FastUUID.getHexValueForChar('f')); assertEquals(0xa, FastUUID.getHexValueForChar('A')); assertEquals(0xb, FastUUID.getHexValueForChar('B')); assertEquals(0xc, FastUUID.getHexValueForChar('C')); assertEquals(0xd, FastUUID.getHexValueForChar('D')); assertEquals(0xe, FastUUID.getHexValueForChar('E')); assertEquals(0xf, FastUUID.getHexValueForChar('F')); } @Test(expected = IllegalArgumentException.class) public void testGetHexValueForCharIllegalChar() { FastUUID.getHexValueForChar('x'); } }
8e5d78d774aecfd7a3bf51bae68fdbe26bba2e33
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/6/6_24ed8116dc815423009df25b238ae12de2d8a424/RenderTank/6_24ed8116dc815423009df25b238ae12de2d8a424_RenderTank_s.java
6b96bb46029abe16d548da4b1263012db3b68979
[]
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
2,503
java
package dark.fluid.client.render; import hydraulic.api.ColorCode; import hydraulic.helpers.LiquidRenderer; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.liquids.ILiquidTank; import net.minecraftforge.liquids.LiquidStack; import org.lwjgl.opengl.GL11; import dark.fluid.client.model.ModelTankSide; import dark.fluid.common.FluidMech; import dark.fluid.common.machines.TileEntityTank; public class RenderTank extends TileEntitySpecialRenderer { private ModelTankSide model; public RenderTank() { model = new ModelTankSide(); } @Override public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float var8) { if (tileEntity instanceof TileEntityTank) { TileEntityTank tileEntityTank = ((TileEntityTank) tileEntity); ILiquidTank tank = tileEntityTank.getTank(); LiquidStack liquid = tank.getLiquid(); ColorCode color = tileEntityTank.getColor(); boolean lre = false; if (liquid != null && liquid.amount > 0) { int[] displayList = LiquidRenderer.getLiquidDisplayLists(liquid, tileEntity.worldObj, false); if (displayList != null) { GL11.glPushMatrix(); GL11.glPushAttrib(GL11.GL_ENABLE_BIT); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glDisable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); bindTextureByName(LiquidRenderer.getLiquidSheet(liquid)); GL11.glTranslatef((float) x + 0.025F, (float) y, (float) z + 0.025F); GL11.glScalef(0.87F, 0.999F, 0.87F); GL11.glCallList(displayList[(int) ((float) liquid.amount / (float) (tank.getCapacity()) * (LiquidRenderer.DISPLAY_STAGES - 1))]); GL11.glPopAttrib(); GL11.glPopMatrix(); lre = true; } } bindTextureByName(FluidMech.MODEL_TEXTURE_DIRECTORY + "TankSide.png"); GL11.glPushMatrix(); GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); GL11.glScalef(1.0F, -1F, -1F); model.render(0.0625F, false, false, false, false); GL11.glRotatef(90f, 0f, 1f, 0f); model.render(0.0625F, false, false, false, false); GL11.glRotatef(180f, 0f, 1f, 0f); model.render(0.0625F, false, false, false, false); GL11.glRotatef(270f, 0f, 1f, 0f); model.render(0.0625F, false, false, false, false); GL11.glPopMatrix(); } } }
247b4cae5c56e62a0aaef677c7fc3c6b250b9ce9
1ed5c16927e98d62a160cf52ef563cd4a45e2122
/Java-v2/com/ngn/services/_2007/_03/_20/scoreservice/FetchScoresByNetworkIdRequest.java
82ddda06c1a35d1445e1498386e6643a9fef4d45
[]
no_license
uksubs66/java-v2
b1517d1866360ffca7356d61bb360233ea479f58
baba766e11ca8bb1930db5cb0d3b645ed9e7250c
refs/heads/master
2021-01-25T08:59:44.495711
2015-07-17T15:37:27
2015-07-17T15:37:27
39,220,401
1
0
null
null
null
null
UTF-8
Java
false
false
4,416
java
package com.ngn.services._2007._03._20.scoreservice; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlType; import javax.xml.datatype.XMLGregorianCalendar; import com.ngn.services._2007._03._20.headerdata.Credentials; /** * <p>Java class for FetchScoresByNetworkIdRequest complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="FetchScoresByNetworkIdRequest"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TransactionId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="Credentials" type="{http://services.ngn.com/2007/03/20/HeaderData}Credentials" minOccurs="0"/> * &lt;element name="NetworkId" type="{http://www.w3.org/2001/XMLSchema}int"/> * &lt;element name="FromDate" type="{http://www.w3.org/2001/XMLSchema}dateTime"/> * &lt;element name="ToDate" type="{http://www.w3.org/2001/XMLSchema}dateTime"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "FetchScoresByNetworkIdRequest", propOrder = { "transactionId", "credentials", "networkId", "fromDate", "toDate" }) public class FetchScoresByNetworkIdRequest { @XmlElement(name = "TransactionId") protected String transactionId; @XmlElement(name = "Credentials") protected Credentials credentials; @XmlElement(name = "NetworkId") protected int networkId; @XmlElement(name = "FromDate", required = true) @XmlSchemaType(name = "dateTime") protected XMLGregorianCalendar fromDate; @XmlElement(name = "ToDate", required = true) @XmlSchemaType(name = "dateTime") protected XMLGregorianCalendar toDate; /** * Gets the value of the transactionId property. * * @return * possible object is * {@link String } * */ public String getTransactionId() { return transactionId; } /** * Sets the value of the transactionId property. * * @param value * allowed object is * {@link String } * */ public void setTransactionId(String value) { this.transactionId = value; } /** * Gets the value of the credentials property. * * @return * possible object is * {@link Credentials } * */ public Credentials getCredentials() { return credentials; } /** * Sets the value of the credentials property. * * @param value * allowed object is * {@link Credentials } * */ public void setCredentials(Credentials value) { this.credentials = value; } /** * Gets the value of the networkId property. * */ public int getNetworkId() { return networkId; } /** * Sets the value of the networkId property. * */ public void setNetworkId(int value) { this.networkId = value; } /** * Gets the value of the fromDate property. * * @return * possible object is * {@link XMLGregorianCalendar } * */ public XMLGregorianCalendar getFromDate() { return fromDate; } /** * Sets the value of the fromDate property. * * @param value * allowed object is * {@link XMLGregorianCalendar } * */ public void setFromDate(XMLGregorianCalendar value) { this.fromDate = value; } /** * Gets the value of the toDate property. * * @return * possible object is * {@link XMLGregorianCalendar } * */ public XMLGregorianCalendar getToDate() { return toDate; } /** * Sets the value of the toDate property. * * @param value * allowed object is * {@link XMLGregorianCalendar } * */ public void setToDate(XMLGregorianCalendar value) { this.toDate = value; } }
6ec63db05cb4360ba04548be05f2f209506b3546
20240a61b712e13bff98c2055317a8500e08c3ca
/security/security-core/src/test/java/org/xipki/security/test/HttpsClientTestor.java
8c5142600a47eb8c63811cdbeb2c5feb2f5d77e9
[]
no_license
tempbottle/xipki
fc215ffea193dd07480a995c372eea7a16f72a24
aaf69c31f77dc71f1297ddfb671b565f9c20dca6
refs/heads/master
2021-01-18T05:09:20.408000
2014-10-16T18:45:31
2014-10-16T18:45:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,760
java
/* * Copyright (c) 2014 Lijun Liao * * TO-BE-DEFINE * */ package org.xipki.security.test; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.net.MalformedURLException; import java.net.URL; import java.security.NoSuchAlgorithmException; import java.security.cert.Certificate; import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.SSLPeerUnverifiedException; /** * @author Lijun Liao */ public class HttpsClientTestor { public static void main(String[] args) { System.out.println("HELLO".hashCode()); System.out.println(("HELLO world a bd wee 234 24 12 wer wre243popokh hzjasda wreafy awqasfd asfaf" + "HELLO world a bd wee 234 24 12 wer wre243popokh hzjasda wreafy awqasfd asfaf").hashCode()); System.out.println(hashCode("HELLO")); System.out.println(hashCode("HELLO world a bd wee 234 24 12 wer wre243popokh hzjasda wreafy awqasfd asfaf" + "HELLO world a bd wee 234 24 12 wer wre243popokh hzjasda wreafy awqasfd asfaf")); System.exit(1); try { prepare(); }catch (Exception e) { e.printStackTrace(); return; } new HttpsClientTestor().testIt(); } public static long hashCode(String s) { long h = 0; char[] value = s.toCharArray(); if (h == 0 && value.length > 0) { char val[] = value; for (int i = 0; i < value.length; i++) { h = 31 * h + val[i]; } } return h; } private static void prepare() throws NoSuchAlgorithmException { System.setProperty("https.protocols", "TLSv1.2,TLSv1.1,TLSv1"); //System.setProperty("javax.net.ssl.trustStore", // "/home/lliao/Downloads/jetty-distribution-7.6.15.v20140411/etc/keystore"); //System.setProperty("javax.net.ssl.trustStorePassword", "storepwd"); javax.net.ssl.HttpsURLConnection.setDefaultHostnameVerifier( new javax.net.ssl.HostnameVerifier() { public boolean verify(String hostname, javax.net.ssl.SSLSession sslSession) { return true; } }); } private void testIt() { String https_url = "https://localhost:9443"; URL url; try { url = new URL(https_url); HttpsURLConnection con = (HttpsURLConnection)url.openConnection(); //dumpl all cert info print_https_cert(con); //dump all the content //print_content(con); } catch (MalformedURLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } private void print_https_cert(HttpsURLConnection con) { if(con!=null) { try { System.out.println("Response Code : " + con.getResponseCode()); System.out.println("Cipher Suite : " + con.getCipherSuite()); System.out.println("\n"); Certificate[] certs = con.getServerCertificates(); for(Certificate cert : certs) { System.out.println("Cert Type : " + cert.getType()); System.out.println("Cert Hash Code : " + cert.hashCode()); System.out.println("Cert Public Key Algorithm : " + cert.getPublicKey().getAlgorithm()); System.out.println("Cert Public Key Format : " + cert.getPublicKey().getFormat()); System.out.println("\n"); } } catch (SSLPeerUnverifiedException e) { //System.err.println(e.getMessage()); e.printStackTrace(); } catch (IOException e) { //System.err.println(e.getMessage()); e.printStackTrace(); } } } @SuppressWarnings("unused") private void print_content(HttpsURLConnection con) { if(con!=null) { try { System.out.println("****** Content of the URL ********"); BufferedReader br = new BufferedReader(new InputStreamReader(con.getInputStream())); String input; while ((input = br.readLine()) != null) { System.out.println(input); } br.close(); } catch (IOException e) { } } } }
97f3576a60eb310acf048ea7c3917be2e52e63f1
229c62519bf12fb6435578ed7e20a27bf91e41dd
/src/edu/wz/cs/leetcode/easy/CountPrimes.java
3c7d2054a241d7e345f47f35db5ecee17a4ba300
[]
no_license
wz24gu/leetcode-practice
1c219304edca60c7299339bc3bb1a799babf1f86
5a6004d33277d0e81d8d48737e8824bfc3751dbb
refs/heads/master
2020-03-10T15:48:31.800635
2018-04-13T22:03:04
2018-04-13T22:03:04
129,457,618
0
0
null
null
null
null
UTF-8
Java
false
false
987
java
package edu.wz.cs.leetcode.easy; import java.util.Arrays; /** * 204. Count Primes<br> * https://leetcode.com/problems/count-primes<br><br> * * Count the number of prime numbers less than a non-negative number, n. */ public class CountPrimes { // Sieve of Eratosthenes public static int solution(int n) { if (n <= 1) { return 0; } boolean[] prime = new boolean[n]; Arrays.fill(prime, true); prime[0] = prime[1] = false; int sqrt = (int) Math.sqrt(n); for (int i = 2; i <= sqrt; i++) { for (int j = i * i; j < n; j += i) { prime[j] = false; } } int count = 0; for (int i = 1; i < n; i++) { if (prime[i]) { count++; } } return count; } public static void main(String[] args) { System.out.println(CountPrimes.solution(120)); } }
7bba07db3e30f5dd59ba3715e50c0602e2828fab
52835d2785b71d76e18712d134d98cf7c7b9b3b0
/src/ComprasOnline/view/Acao.java
9fbf5a4449c7c915d84e6fdc8369bd54504ed616
[]
no_license
andresouza404/Algoritmos2
c4484509a7caea750d1981f88642ef1e26a8cc51
5c14a9dd4ef3cdc4630b306fa014606e9280df1d
refs/heads/master
2021-07-21T02:32:40.275669
2017-10-27T00:02:00
2017-10-27T00:02:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
72
java
package ComprasOnline.view; public interface Acao { void execute(); }
c6ccabc2112ab91a1e82eb11776cbe00030b1f3b
4f8cc9ad6268cf7a5505bfccbd124d88a7eab631
/tl/src/main/java/com/github/badoualy/telegram/tl/api/request/TLRequestHelpGetAppUpdate.java
df8a85651137b2d461ce6a11f073784a7eb5205c
[ "LicenseRef-scancode-warranty-disclaimer", "MIT" ]
permissive
hosseinab/kotlogram
d7a546b500b311a75281426ff3878afb6a3d9370
a8b79415d44f296987fad4a9087c92e3407c5823
refs/heads/master
2021-01-16T21:43:54.017295
2016-01-29T15:37:30
2016-01-29T15:37:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,351
java
package com.github.badoualy.telegram.tl.api.request; import com.github.badoualy.telegram.tl.TLContext; import com.github.badoualy.telegram.tl.api.help.TLAbsAppUpdate; import com.github.badoualy.telegram.tl.core.TLMethod; import com.github.badoualy.telegram.tl.core.TLObject; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import static com.github.badoualy.telegram.tl.StreamUtils.readTLObject; import static com.github.badoualy.telegram.tl.StreamUtils.readTLString; import static com.github.badoualy.telegram.tl.StreamUtils.writeTLString; /** * @author Yannick Badoual [email protected] * @see <a href="http://github.com/badoualy/kotlogram">http://github.com/badoualy/kotlogram</a> */ public class TLRequestHelpGetAppUpdate extends TLMethod<TLAbsAppUpdate> { public static final int CLASS_ID = 0xc812ac7e; protected String deviceModel; protected String systemVersion; protected String appVersion; protected String langCode; public TLRequestHelpGetAppUpdate() { } public TLRequestHelpGetAppUpdate(String deviceModel, String systemVersion, String appVersion, String langCode) { this.deviceModel = deviceModel; this.systemVersion = systemVersion; this.appVersion = appVersion; this.langCode = langCode; } @Override @SuppressWarnings("unchecked") public TLAbsAppUpdate deserializeResponse(InputStream stream, TLContext context) throws IOException { final TLObject response = readTLObject(stream, context); if (response == null) { throw new IOException("Unable to parse response"); } if (!(response instanceof TLAbsAppUpdate)) { throw new IOException("Incorrect response type, expected getClass().getCanonicalName(), found response.getClass().getCanonicalName()"); } return (TLAbsAppUpdate) response; } @Override public void serializeBody(OutputStream stream) throws IOException { writeTLString(deviceModel, stream); writeTLString(systemVersion, stream); writeTLString(appVersion, stream); writeTLString(langCode, stream); } @Override @SuppressWarnings("unchecked") public void deserializeBody(InputStream stream, TLContext context) throws IOException { deviceModel = readTLString(stream); systemVersion = readTLString(stream); appVersion = readTLString(stream); langCode = readTLString(stream); } @Override public String toString() { return "help.getAppUpdate#c812ac7e"; } @Override public int getClassId() { return CLASS_ID; } public String getDeviceModel() { return deviceModel; } public void setDeviceModel(String deviceModel) { this.deviceModel = deviceModel; } public String getSystemVersion() { return systemVersion; } public void setSystemVersion(String systemVersion) { this.systemVersion = systemVersion; } public String getAppVersion() { return appVersion; } public void setAppVersion(String appVersion) { this.appVersion = appVersion; } public String getLangCode() { return langCode; } public void setLangCode(String langCode) { this.langCode = langCode; } }
b12abdadf75c617bbe3cfb1a825c89d55877ed56
8869ef88a266fa44641545672c79b571ca79861c
/java_pra/src/sl06/Address_employee.java
503d5909a8154d5f9a25d184157ef9568a0b41ce
[]
no_license
dayutec/tnkWar
554d488829c776051641a07e20f70f90c137b2f9
f2f15a741a3c02dfc4615d1ef618d91f813b10ff
refs/heads/master
2021-01-10T12:48:50.962108
2016-04-08T06:24:24
2016-04-08T06:24:24
46,899,742
2
0
null
null
null
null
UTF-8
Java
false
false
1,143
java
package sl06; public class Address_employee implements Cloneable{ private String name ; private int age; private Address address; public Address_employee() { // TODO Auto-generated constructor stub } public Address_employee(String name, int age, Address address) { this.name = name; this.age = age; this.address = address; } public String getName() { return name; } public void setName(String name) { this.name = name; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } public Address getAddress() { return address; } public void setAddress(Address address) { this.address = address; } @Override public String toString() { return "Address_employee [name=" + name + ", age=" + age + ", address=" + address + "]"; } @Override public Address_employee clone() { Address_employee ae= null; try{ ae= (Address_employee) super.clone(); }catch(CloneNotSupportedException e){ e.printStackTrace(); } return ae; } }
f5653fc1167288ce35cd57822c65f881582616d6
20063a7d545201177e3f8f87789b38582bb2ecf2
/src/main/java/com/wanghang/algorithm/ThreeSum.java
7fbf2ed3753e29918a5bc8c0f7aad6af9036d55e
[]
no_license
wdengf/HelloTest
bc844098ff8aace7c05fcbb28e6ed511c0bcd5ef
5eb62915bea0d88be1b26ec36c6fd53168c47027
refs/heads/master
2020-04-02T04:14:13.869211
2018-11-15T15:00:44
2018-11-15T15:00:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
93
java
package com.wanghang.algorithm; public interface ThreeSum { int count(int[] nums); }
9355893dcc49bc5b820a04c79b7fb1e53243071d
85a509703885e00136afff01ffbb8812ac69b270
/smt-server/src/main/java/com/smt/config/SmtTokenConstants.java
014d1100f06bae6164fca9e8730ae83478d32e12
[]
no_license
ahmetokay/system-management-tool
dc377b5a3bc826b4e8da4e19629e9889833ed50d
5bdb5ecdceb234375691fd1c809fb121f74ce6e2
refs/heads/master
2021-07-21T22:41:24.863505
2017-10-31T15:10:42
2017-10-31T15:10:42
107,007,118
1
0
null
null
null
null
UTF-8
Java
false
false
114
java
package com.smt.config; public class SmtTokenConstants { public static final String TOKEN_KEY = "smt-token"; }
c1995ba80048f16eb9feae69403d7710575b3987
8b98cd7cd46ecdc282e06aeee7c65abfa7b6514d
/app/src/main/java/com/app/eazydigi/model/old_model/StudentDetailInfo.java
f3ee86535c795bc466e8e14ac1f2a9987612851f
[]
no_license
AdarshAndroid515/Eazydigi
3fa973c9e38ea74ed9a0d1d285676102402eafa1
d0a76b79d78922a9cb8ff17e928e5a4e3a75f252
refs/heads/master
2022-09-17T04:04:35.929256
2020-05-30T13:45:41
2020-05-30T13:45:41
268,087,596
0
0
null
null
null
null
UTF-8
Java
false
false
5,168
java
package com.app.eazydigi.model.old_model; import com.google.gson.annotations.SerializedName; import java.io.Serializable; public class StudentDetailInfo implements Serializable { @SerializedName("fatherName") private Object fatherName; @SerializedName("admissionDate") private Object admissionDate; @SerializedName("rte") private Object rte; @SerializedName("fatherContactNumber") private Object fatherContactNumber; @SerializedName("mobileNumber") private Object mobileNumber; @SerializedName("isStaffWard") private boolean isStaffWard; @SerializedName("motherName") private Object motherName; @SerializedName("guardianID") private int guardianID; @SerializedName("className") private String className; @SerializedName("studentGroup") private Object studentGroup; @SerializedName("sectionID") private int sectionID; @SerializedName("transportBusStop") private Object transportBusStop; @SerializedName("sectionName") private String sectionName; @SerializedName("classID") private int classID; @SerializedName("transportRouteId") private Object transportRouteId; @SerializedName("isNewAdmission") private boolean isNewAdmission; @SerializedName("isSiblingConcession") private boolean isSiblingConcession; @SerializedName("studentName") private Object studentName; @SerializedName("schoolID") private int schoolID; @SerializedName("admissionID") private String admissionID; @SerializedName("rollNumber") private String rollNumber; @SerializedName("registrationDate") private String registrationDate; @SerializedName("id") private int id; @SerializedName("rowNumber") private int rowNumber; public Object getFatherName() { return fatherName; } public void setFatherName(Object fatherName) { this.fatherName = fatherName; } public Object getAdmissionDate() { return admissionDate; } public void setAdmissionDate(Object admissionDate) { this.admissionDate = admissionDate; } public Object getRte() { return rte; } public void setRte(Object rte) { this.rte = rte; } public Object getFatherContactNumber() { return fatherContactNumber; } public void setFatherContactNumber(Object fatherContactNumber) { this.fatherContactNumber = fatherContactNumber; } public Object getMobileNumber() { return mobileNumber; } public void setMobileNumber(Object mobileNumber) { this.mobileNumber = mobileNumber; } public boolean isStaffWard() { return isStaffWard; } public void setStaffWard(boolean staffWard) { isStaffWard = staffWard; } public Object getMotherName() { return motherName; } public void setMotherName(Object motherName) { this.motherName = motherName; } public int getGuardianID() { return guardianID; } public void setGuardianID(int guardianID) { this.guardianID = guardianID; } public String getClassName() { return className; } public void setClassName(String className) { this.className = className; } public Object getStudentGroup() { return studentGroup; } public void setStudentGroup(Object studentGroup) { this.studentGroup = studentGroup; } public int getSectionID() { return sectionID; } public void setSectionID(int sectionID) { this.sectionID = sectionID; } public Object getTransportBusStop() { return transportBusStop; } public void setTransportBusStop(Object transportBusStop) { this.transportBusStop = transportBusStop; } public String getSectionName() { return sectionName; } public void setSectionName(String sectionName) { this.sectionName = sectionName; } public int getClassID() { return classID; } public void setClassID(int classID) { this.classID = classID; } public Object getTransportRouteId() { return transportRouteId; } public void setTransportRouteId(Object transportRouteId) { this.transportRouteId = transportRouteId; } public boolean isNewAdmission() { return isNewAdmission; } public void setNewAdmission(boolean newAdmission) { isNewAdmission = newAdmission; } public boolean isSiblingConcession() { return isSiblingConcession; } public void setSiblingConcession(boolean siblingConcession) { isSiblingConcession = siblingConcession; } public Object getStudentName() { return studentName; } public void setStudentName(Object studentName) { this.studentName = studentName; } public int getSchoolID() { return schoolID; } public void setSchoolID(int schoolID) { this.schoolID = schoolID; } public String getAdmissionID() { return admissionID; } public void setAdmissionID(String admissionID) { this.admissionID = admissionID; } public String getRollNumber() { return rollNumber; } public void setRollNumber(String rollNumber) { this.rollNumber = rollNumber; } public String getRegistrationDate() { return registrationDate; } public void setRegistrationDate(String registrationDate) { this.registrationDate = registrationDate; } public int getId() { return id; } public void setId(int id) { this.id = id; } public int getRowNumber() { return rowNumber; } public void setRowNumber(int rowNumber) { this.rowNumber = rowNumber; } }
001bb65bb69021cce9e3db68065bae2b3cc2df56
bd5429a8f9b80aab57a0d717c2d7cfdc423a6777
/src/main/java/com/zj/lotteryAnalyze/utils/HttpUtils.java
b5b59d838b79c0d3a50ed9bf440a12f9bc943db9
[]
no_license
ChrisJun0731/lotteryAnalyze
6578ca830326f957c342c53628f55fcb5bb9768f
4a4b5e434a8df84e3f686e2c2d1e5ca6f5732289
refs/heads/master
2021-09-06T14:02:18.804570
2018-02-07T09:10:23
2018-02-07T09:10:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
10,269
java
package com.zj.lotteryAnalyze.utils; import org.apache.commons.lang.StringUtils; import org.apache.http.HttpResponse; import org.apache.http.NameValuePair; import org.apache.http.client.HttpClient; import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache.http.client.methods.HttpDelete; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpPut; import org.apache.http.conn.ClientConnectionManager; import org.apache.http.conn.scheme.Scheme; import org.apache.http.conn.scheme.SchemeRegistry; import org.apache.http.conn.ssl.SSLSocketFactory; import org.apache.http.entity.ByteArrayEntity; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.message.BasicNameValuePair; import javax.net.ssl.SSLContext; import javax.net.ssl.TrustManager; import javax.net.ssl.X509TrustManager; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.security.KeyManagementException; import java.security.NoSuchAlgorithmException; import java.security.cert.X509Certificate; import java.util.ArrayList; import java.util.List; import java.util.Map; public class HttpUtils { /** * get * * @param host * @param path * @param method * @param headers * @param querys * @return * @throws Exception */ public static HttpResponse doGet(String host, String path, String method, Map<String, String> headers, Map<String, String> querys) throws Exception { HttpClient httpClient = wrapClient(host); HttpGet request = new HttpGet(buildUrl(host, path, querys)); for (Map.Entry<String, String> e : headers.entrySet()) { request.addHeader(e.getKey(), e.getValue()); } return httpClient.execute(request); } /** * post form * * @param host * @param path * @param method * @param headers * @param querys * @param bodys * @return * @throws Exception */ public static HttpResponse doPost(String host, String path, String method, Map<String, String> headers, Map<String, String> querys, Map<String, String> bodys) throws Exception { HttpClient httpClient = wrapClient(host); HttpPost request = new HttpPost(buildUrl(host, path, querys)); for (Map.Entry<String, String> e : headers.entrySet()) { request.addHeader(e.getKey(), e.getValue()); } if (bodys != null) { List<NameValuePair> nameValuePairList = new ArrayList<NameValuePair>(); for (String key : bodys.keySet()) { nameValuePairList.add(new BasicNameValuePair(key, bodys.get(key))); } UrlEncodedFormEntity formEntity = new UrlEncodedFormEntity(nameValuePairList, "utf-8"); formEntity.setContentType("application/x-www-form-urlencoded; charset=UTF-8"); request.setEntity(formEntity); } return httpClient.execute(request); } /** * Post String * * @param host * @param path * @param method * @param headers * @param querys * @param body * @return * @throws Exception */ public static HttpResponse doPost(String host, String path, String method, Map<String, String> headers, Map<String, String> querys, String body) throws Exception { HttpClient httpClient = wrapClient(host); HttpPost request = new HttpPost(buildUrl(host, path, querys)); for (Map.Entry<String, String> e : headers.entrySet()) { request.addHeader(e.getKey(), e.getValue()); } if (StringUtils.isNotBlank(body)) { request.setEntity(new StringEntity(body, "utf-8")); } return httpClient.execute(request); } /** * Post stream * * @param host * @param path * @param method * @param headers * @param querys * @param body * @return * @throws Exception */ public static HttpResponse doPost(String host, String path, String method, Map<String, String> headers, Map<String, String> querys, byte[] body) throws Exception { HttpClient httpClient = wrapClient(host); HttpPost request = new HttpPost(buildUrl(host, path, querys)); for (Map.Entry<String, String> e : headers.entrySet()) { request.addHeader(e.getKey(), e.getValue()); } if (body != null) { request.setEntity(new ByteArrayEntity(body)); } return httpClient.execute(request); } /** * Put String * @param host * @param path * @param method * @param headers * @param querys * @param body * @return * @throws Exception */ public static HttpResponse doPut(String host, String path, String method, Map<String, String> headers, Map<String, String> querys, String body) throws Exception { HttpClient httpClient = wrapClient(host); HttpPut request = new HttpPut(buildUrl(host, path, querys)); for (Map.Entry<String, String> e : headers.entrySet()) { request.addHeader(e.getKey(), e.getValue()); } if (StringUtils.isNotBlank(body)) { request.setEntity(new StringEntity(body, "utf-8")); } return httpClient.execute(request); } /** * Put stream * @param host * @param path * @param method * @param headers * @param querys * @param body * @return * @throws Exception */ public static HttpResponse doPut(String host, String path, String method, Map<String, String> headers, Map<String, String> querys, byte[] body) throws Exception { HttpClient httpClient = wrapClient(host); HttpPut request = new HttpPut(buildUrl(host, path, querys)); for (Map.Entry<String, String> e : headers.entrySet()) { request.addHeader(e.getKey(), e.getValue()); } if (body != null) { request.setEntity(new ByteArrayEntity(body)); } return httpClient.execute(request); } /** * Delete * * @param host * @param path * @param method * @param headers * @param querys * @return * @throws Exception */ public static HttpResponse doDelete(String host, String path, String method, Map<String, String> headers, Map<String, String> querys) throws Exception { HttpClient httpClient = wrapClient(host); HttpDelete request = new HttpDelete(buildUrl(host, path, querys)); for (Map.Entry<String, String> e : headers.entrySet()) { request.addHeader(e.getKey(), e.getValue()); } return httpClient.execute(request); } private static String buildUrl(String host, String path, Map<String, String> querys) throws UnsupportedEncodingException { StringBuilder sbUrl = new StringBuilder(); sbUrl.append(host); if (!StringUtils.isBlank(path)) { sbUrl.append(path); } if (null != querys) { StringBuilder sbQuery = new StringBuilder(); for (Map.Entry<String, String> query : querys.entrySet()) { if (0 < sbQuery.length()) { sbQuery.append("&"); } if (StringUtils.isBlank(query.getKey()) && !StringUtils.isBlank(query.getValue())) { sbQuery.append(query.getValue()); } if (!StringUtils.isBlank(query.getKey())) { sbQuery.append(query.getKey()); if (!StringUtils.isBlank(query.getValue())) { sbQuery.append("="); sbQuery.append(URLEncoder.encode(query.getValue(), "utf-8")); } } } if (0 < sbQuery.length()) { sbUrl.append("?").append(sbQuery); } } return sbUrl.toString(); } private static HttpClient wrapClient(String host) { HttpClient httpClient = new DefaultHttpClient(); if (host.startsWith("https://")) { sslClient(httpClient); } return httpClient; } private static void sslClient(HttpClient httpClient) { try { SSLContext ctx = SSLContext.getInstance("TLS"); X509TrustManager tm = new X509TrustManager() { public X509Certificate[] getAcceptedIssuers() { return null; } public void checkClientTrusted(X509Certificate[] xcs, String str) { } public void checkServerTrusted(X509Certificate[] xcs, String str) { } }; ctx.init(null, new TrustManager[] { tm }, null); SSLSocketFactory ssf = new SSLSocketFactory(ctx); ssf.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER); ClientConnectionManager ccm = httpClient.getConnectionManager(); SchemeRegistry registry = ccm.getSchemeRegistry(); registry.register(new Scheme("https", 443, ssf)); } catch (KeyManagementException ex) { throw new RuntimeException(ex); } catch (NoSuchAlgorithmException ex) { throw new RuntimeException(ex); } } }
a1c1687a25016fa9e4bcbadb11d5917dfdf2ca09
132529045f552c66075996c75dd6e99fbc199691
/src/main/java/com/swift/app/gateway/ratelimiting/RateLimitingFilter.java
ab30849b62656ea09b7c0d5c762c72fb4f2fdb66
[]
no_license
vamshee-m/SwiftApplication
f35678ba70efeef52a48662b5b437bcbc17b82a3
3a01b9bf4766a8a716aa01a5352fbfc8451e78fa
refs/heads/master
2020-03-22T16:27:16.047197
2018-07-09T18:39:54
2018-07-09T18:39:54
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,260
java
package com.swift.app.gateway.ratelimiting; import com.swift.app.security.SecurityUtils; import java.time.Duration; import java.util.function.Supplier; import javax.cache.CacheManager; import javax.cache.Caching; import javax.cache.configuration.CompleteConfiguration; import javax.cache.configuration.MutableConfiguration; import javax.cache.spi.CachingProvider; import javax.servlet.http.HttpServletRequest; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.http.HttpStatus; import com.netflix.zuul.ZuulFilter; import com.netflix.zuul.context.RequestContext; import io.github.bucket4j.*; import io.github.bucket4j.grid.GridBucketState; import io.github.bucket4j.grid.ProxyManager; import io.github.bucket4j.grid.jcache.JCache; import io.github.jhipster.config.JHipsterProperties; /** * Zuul filter for limiting the number of HTTP calls per client. * * See the Bucket4j documentation at https://github.com/vladimir-bukhtoyarov/bucket4j * https://github.com/vladimir-bukhtoyarov/bucket4j/blob/master/doc-pages/jcache-usage * .md#example-1---limiting-access-to-http-server-by-ip-address */ public class RateLimitingFilter extends ZuulFilter { private final Logger log = LoggerFactory.getLogger(RateLimitingFilter.class); public final static String GATEWAY_RATE_LIMITING_CACHE_NAME = "gateway-rate-limiting"; private final JHipsterProperties jHipsterProperties; private javax.cache.Cache<String, GridBucketState> cache; private ProxyManager<String> buckets; public RateLimitingFilter(JHipsterProperties jHipsterProperties) { this.jHipsterProperties = jHipsterProperties; CachingProvider cachingProvider = Caching.getCachingProvider(); CacheManager cacheManager = cachingProvider.getCacheManager(); CompleteConfiguration<String, GridBucketState> config = new MutableConfiguration<String, GridBucketState>() .setTypes(String.class, GridBucketState.class); this.cache = cacheManager.createCache(GATEWAY_RATE_LIMITING_CACHE_NAME, config); this.buckets = Bucket4j.extension(JCache.class).proxyManagerForCache(cache); } @Override public String filterType() { return "pre"; } @Override public int filterOrder() { return 10; } @Override public boolean shouldFilter() { // specific APIs can be filtered out using // if (RequestContext.getCurrentContext().getRequest().getRequestURI().startsWith("/api")) { ... } return true; } @Override public Object run() { String bucketId = getId(RequestContext.getCurrentContext().getRequest()); Bucket bucket = buckets.getProxy(bucketId, getConfigSupplier()); if (bucket.tryConsume(1)) { // the limit is not exceeded log.debug("API rate limit OK for {}", bucketId); } else { // limit is exceeded log.info("API rate limit exceeded for {}", bucketId); apiLimitExceeded(); } return null; } private Supplier<BucketConfiguration> getConfigSupplier() { return () -> { JHipsterProperties.Gateway.RateLimiting rateLimitingProperties = jHipsterProperties.getGateway().getRateLimiting(); return Bucket4j.configurationBuilder() .addLimit(Bandwidth.simple(rateLimitingProperties.getLimit(), Duration.ofSeconds(rateLimitingProperties.getDurationInSeconds()))) .build(); }; } /** * Create a Zuul response error when the API limit is exceeded. */ private void apiLimitExceeded() { RequestContext ctx = RequestContext.getCurrentContext(); ctx.setResponseStatusCode(HttpStatus.TOO_MANY_REQUESTS.value()); if (ctx.getResponseBody() == null) { ctx.setResponseBody("API rate limit exceeded"); ctx.setSendZuulResponse(false); } } /** * The ID that will identify the limit: the user login or the user IP address. */ private String getId(HttpServletRequest httpServletRequest) { return SecurityUtils.getCurrentUserLogin().orElse(httpServletRequest.getRemoteAddr()); } }
1491187d05273d0a377f6a6154e8cd9f6414ef7e
39a6b6d91cdbe9d62c8fd6db907e64c9e8c468ce
/src/com/geminifile/core/socketmsg/MsgType.java
a7fb09f9114a36810e0fef959fd1f207b45e6d62
[ "Apache-2.0" ]
permissive
nakamarusun/GeminiFile
7811afa398775f0b52e40bafd83a945436f405fb
f95b8871d165bdc0c054495defe15fbe675a30ef
refs/heads/master
2022-10-20T17:16:53.534743
2020-06-20T14:45:53
2020-06-20T14:45:53
258,237,625
1
0
Apache-2.0
2020-05-07T11:03:12
2020-04-23T14:48:37
Java
UTF-8
Java
false
false
617
java
package com.geminifile.core.socketmsg; import java.io.Serializable; // Enums with a star means that it is EXPECTING A REPLY. public enum MsgType implements Serializable { CONNQUERY, // Connection query, used for when a client decides to connect to a server *** CONNACCEPT, // The reply to CONNQUERY, with status message ASK, // Asking for information *** INFO, // Give an information (1 means accepted, ) COMMAND, // Command (returns 1 or 0 depending on done) *** PING, // Returns pong *** NOREPLY, // Does not have to reply to the message. NOACTION // Don't reply to the message. }
3c9cdc4843bb9a250aa781d0521364232ae36269
5a97f64a16360340c7d96b2c532e2494b50e5b72
/ServletProject/创建web项目/webtest/src/listener/MyServerletListener.java
011ec653c506a6f67c79b90ec60601f5982a0ebf
[]
no_license
Fessible/JavaLearning
0eadd4724149b41dfe596600db3b19cede7885ff
4066352bc759d9186f1a61332284f85c8eccb402
refs/heads/master
2022-12-21T14:11:26.864383
2020-06-23T01:34:07
2020-06-23T01:34:07
180,098,523
0
0
null
2022-12-16T08:59:54
2019-04-08T07:56:45
Java
UTF-8
Java
false
false
1,272
java
package listener; import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; import javax.servlet.ServletRequestEvent; import javax.servlet.ServletRequestListener; import javax.servlet.http.HttpSessionEvent; import javax.servlet.http.HttpSessionListener; public class MyServerletListener implements ServletContextListener, ServletRequestListener, HttpSessionListener { @Override public void contextInitialized(ServletContextEvent servletContextEvent) { System.out.println("ContextListener 创建"); } @Override public void contextDestroyed(ServletContextEvent servletContextEvent) { System.out.println("ContextListener 销毁"); } @Override public void requestDestroyed(ServletRequestEvent servletRequestEvent) { System.out.println("request被创建"); } @Override public void requestInitialized(ServletRequestEvent servletRequestEvent) { System.out.println("request被销毁"); } @Override public void sessionCreated(HttpSessionEvent httpSessionEvent) { System.out.println("session被创建"); } @Override public void sessionDestroyed(HttpSessionEvent httpSessionEvent) { System.out.println("session被销毁"); } }
30d871f228961f815cb2abf9f14c4350ccff11bc
510662d4e504e695fa978bc94b4ba50bf8c285ae
/src/main/java/net/noyark/scpslserver/jsmod2/utils/PluginFileVO.java
6e8587bf87ee8c4d7f4a8e34e60094949b1de833
[]
no_license
HanFengA7/jsmod2
94f7589410a0b1a5fd76af17dae283adc8727198
13c268029175cc5cc2dc998f3eb7d57ad4ccba95
refs/heads/master
2022-01-19T16:30:22.353423
2019-05-14T05:40:58
2019-05-14T05:40:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,109
java
package net.noyark.scpslserver.jsmod2.utils; public class PluginFileVO { private String pluginName; private String main_class; private String description; private String version; public PluginFileVO(String pluginName, String main_class, String description, String version) { this.pluginName = pluginName; this.main_class = main_class; this.description = description; this.version = version; } public String getPluginName() { return pluginName; } public void setPluginName(String pluginName) { this.pluginName = pluginName; } public String getMain_class() { return main_class; } public void setMain_class(String main_class) { this.main_class = main_class; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public String getVersion() { return version; } public void setVersion(String version) { this.version = version; } }
afa5221ac047afd0debc7f490d01e6fea7b88673
bbe10639bb9c8f32422122c993530959534560e1
/delivery/app-release_source_from_JADX/com/google/android/gms/ads/AdSize.java
54d33b061a03d369d7b696448e2ed0716aa1c721
[ "Apache-2.0" ]
permissive
ANDROFAST/delivery_articulos
dae74482e41b459963186b6e7e3d6553999c5706
ddcc8b06d7ea2895ccda2e13c179c658703fec96
refs/heads/master
2020-04-07T15:13:18.470392
2018-11-21T02:15:19
2018-11-21T02:15:19
158,476,390
0
0
null
null
null
null
UTF-8
Java
false
false
3,327
java
package com.google.android.gms.ads; import android.content.Context; import com.google.android.gms.ads.internal.client.AdSizeParcel; import com.google.android.gms.ads.internal.client.zzl; import com.google.android.gms.nearby.messages.Strategy; public final class AdSize { public static final int AUTO_HEIGHT = -2; public static final AdSize BANNER = new AdSize(320, 50, "320x50_mb"); public static final AdSize FLUID = new AdSize(-3, -4, "fluid"); public static final AdSize FULL_BANNER = new AdSize(468, 60, "468x60_as"); public static final int FULL_WIDTH = -1; public static final AdSize LARGE_BANNER = new AdSize(320, 100, "320x100_as"); public static final AdSize LEADERBOARD = new AdSize(728, 90, "728x90_as"); public static final AdSize MEDIUM_RECTANGLE = new AdSize(Strategy.TTL_SECONDS_DEFAULT, 250, "300x250_as"); public static final AdSize SMART_BANNER = new AdSize(-1, -2, "smart_banner"); public static final AdSize WIDE_SKYSCRAPER = new AdSize(160, 600, "160x600_as"); private final int zzov; private final int zzow; private final String zzox; public AdSize(int width, int height) { this(width, height, (width == -1 ? "FULL" : String.valueOf(width)) + "x" + (height == -2 ? "AUTO" : String.valueOf(height)) + "_as"); } AdSize(int width, int height, String formatString) { if (width < 0 && width != -1 && width != -3) { throw new IllegalArgumentException("Invalid width for AdSize: " + width); } else if (height >= 0 || height == -2 || height == -4) { this.zzov = width; this.zzow = height; this.zzox = formatString; } else { throw new IllegalArgumentException("Invalid height for AdSize: " + height); } } public boolean equals(Object other) { if (other == this) { return true; } if (!(other instanceof AdSize)) { return false; } AdSize adSize = (AdSize) other; return this.zzov == adSize.zzov && this.zzow == adSize.zzow && this.zzox.equals(adSize.zzox); } public int getHeight() { return this.zzow; } public int getHeightInPixels(Context context) { switch (this.zzow) { case -4: case -3: return -1; case -2: return AdSizeParcel.zzb(context.getResources().getDisplayMetrics()); default: return zzl.zzcN().zzb(context, this.zzow); } } public int getWidth() { return this.zzov; } public int getWidthInPixels(Context context) { switch (this.zzov) { case -4: case -3: return -1; case -1: return AdSizeParcel.zza(context.getResources().getDisplayMetrics()); default: return zzl.zzcN().zzb(context, this.zzov); } } public int hashCode() { return this.zzox.hashCode(); } public boolean isAutoHeight() { return this.zzow == -2; } public boolean isFluid() { return this.zzov == -3 && this.zzow == -4; } public boolean isFullWidth() { return this.zzov == -1; } public String toString() { return this.zzox; } }
8234d0560984b2042c6af49e05eb83133dfa2650
f34dcf694a8e7258645fafab3f6c809e4741333b
/4_models/h2o_nn_16x16x6_Tanh_11.java
3ed808defe804fb4ab474f920a12953f4efb61b7
[]
no_license
Laurae2/Indoor_Prediction
7972a52a0ac17e46bab0d05210393d8f8aaa63d3
01c24c0d2e08c0f7384f80e546ad22f02b5797c4
refs/heads/master
2021-01-12T06:35:02.169145
2016-12-26T16:28:29
2016-12-26T16:28:29
77,389,265
1
0
null
null
null
null
UTF-8
Java
false
false
30,392
java
/* Licensed under the Apache License, Version 2.0 http://www.apache.org/licenses/LICENSE-2.0.html AUTOGENERATED BY H2O at 2016-12-26T14:43:25.873+01:00 3.10.0.8 Standalone prediction code with sample test data for DeepLearningModel named h2o_nn_16x16x6_Tanh_11 How to download, compile and execute: mkdir tmpdir cd tmpdir curl http://127.0.0.1:54321/3/h2o-genmodel.jar > h2o-genmodel.jar curl http://127.0.0.1:54321/3/Models.java/h2o_nn_16x16x6_Tanh_11 > h2o_nn_16x16x6_Tanh_11.java javac -cp h2o-genmodel.jar -J-Xmx2g -J-XX:MaxPermSize=128m h2o_nn_16x16x6_Tanh_11.java (Note: Try java argument -XX:+PrintCompilation to show runtime JIT compiler behavior.) */ import java.util.Map; import hex.genmodel.GenModel; import hex.genmodel.annotations.ModelPojo; @ModelPojo(name="h2o_nn_16x16x6_Tanh_11", algorithm="deeplearning") public class h2o_nn_16x16x6_Tanh_11 extends GenModel { public hex.ModelCategory getModelCategory() { return hex.ModelCategory.Multinomial; } public boolean isSupervised() { return true; } public int nfeatures() { return 13; } public int nclasses() { return 6; } // Thread-local storage for input neuron activation values. final double[] NUMS = new double[13]; static class NORMMUL implements java.io.Serializable { public static final double[] VALUES = null; } static class NORMSUB implements java.io.Serializable { public static final double[] VALUES = null; } // Workspace for categorical offsets. public static final int[] CATOFFSETS = {0}; // Number of neurons for each layer. public static final int[] NEURONS = {13,16,16,6}; // Thread-local storage for neuron activation values. final double[][] ACTIVATION = new double[][] { /* Input */ h2o_nn_16x16x6_Tanh_11_Activation_0.VALUES, /* Tanh */ h2o_nn_16x16x6_Tanh_11_Activation_1.VALUES, /* Tanh */ h2o_nn_16x16x6_Tanh_11_Activation_2.VALUES, /* Softmax */ h2o_nn_16x16x6_Tanh_11_Activation_3.VALUES }; // Neuron bias values. public static final double[][] BIAS = new double[][] { /* Input */ h2o_nn_16x16x6_Tanh_11_Bias_0.VALUES, /* Tanh */ h2o_nn_16x16x6_Tanh_11_Bias_1.VALUES, /* Tanh */ h2o_nn_16x16x6_Tanh_11_Bias_2.VALUES, /* Softmax */ h2o_nn_16x16x6_Tanh_11_Bias_3.VALUES }; // Connecting weights between neurons. public static final float[][] WEIGHT = new float[][] { /* Input */ h2o_nn_16x16x6_Tanh_11_Weight_0.VALUES, /* Tanh */ h2o_nn_16x16x6_Tanh_11_Weight_1.VALUES, /* Tanh */ h2o_nn_16x16x6_Tanh_11_Weight_2.VALUES, /* Softmax */ h2o_nn_16x16x6_Tanh_11_Weight_3.VALUES }; // Names of columns used by model. public static final String[] NAMES = NamesHolder_h2o_nn_16x16x6_Tanh_11.VALUES; // Number of output classes included in training data response column. public static final int NCLASSES = 6; // Column domains. The last array contains domain of response column. public static final String[][] DOMAINS = new String[][] { /* X5 */ null, /* X12 */ null, /* X15 */ null, /* X17 */ null, /* X18 */ null, /* X19 */ null, /* X20 */ null, /* X21 */ null, /* X23 */ null, /* X27 */ null, /* X28 */ null, /* X34 */ null, /* X35 */ null, /* Label */ h2o_nn_16x16x6_Tanh_11_ColInfo_13.VALUES }; // Prior class distribution public static final double[] PRIOR_CLASS_DISTRIB = {0.2548076923076923,0.18269230769230768,0.057692307692307696,0.125,0.2548076923076923,0.125}; // Class distribution used for model building public static final double[] MODEL_CLASS_DISTRIB = null; public h2o_nn_16x16x6_Tanh_11() { super(NAMES,DOMAINS); } public String getUUID() { return Long.toString(-5406727010015812496L); } // Pass in data in a double[], pre-aligned to the Model's requirements. // Jam predictions into the preds[] array; preds[0] is reserved for the // main prediction (class for classifiers or value for regression), // and remaining columns hold a probability distribution for classifiers. public final double[] score0( double[] data, double[] preds ) { java.util.Arrays.fill(preds,0); java.util.Arrays.fill(NUMS,0); int i = 0, ncats = 0; final int n = data.length; for(; i<n; ++i) { NUMS[i] = Double.isNaN(data[i]) ? 0 : data[i]; } java.util.Arrays.fill(ACTIVATION[0],0); for (i=0; i<NUMS.length; ++i) { ACTIVATION[0][CATOFFSETS[CATOFFSETS.length-1] + i] = Double.isNaN(NUMS[i]) ? 0 : NUMS[i]; } for (i=1; i<ACTIVATION.length; ++i) { java.util.Arrays.fill(ACTIVATION[i],0); int cols = ACTIVATION[i-1].length; int rows = ACTIVATION[i].length; int extra=cols-cols%8; int multiple = (cols/8)*8-1; int idx = 0; float[] a = WEIGHT[i]; double[] x = ACTIVATION[i-1]; double[] y = BIAS[i]; double[] res = ACTIVATION[i]; for (int row=0; row<rows; ++row) { double psum0 = 0, psum1 = 0, psum2 = 0, psum3 = 0, psum4 = 0, psum5 = 0, psum6 = 0, psum7 = 0; for (int col = 0; col < multiple; col += 8) { int off = idx + col; psum0 += a[off ] * x[col ]; psum1 += a[off + 1] * x[col + 1]; psum2 += a[off + 2] * x[col + 2]; psum3 += a[off + 3] * x[col + 3]; psum4 += a[off + 4] * x[col + 4]; psum5 += a[off + 5] * x[col + 5]; psum6 += a[off + 6] * x[col + 6]; psum7 += a[off + 7] * x[col + 7]; } res[row] += psum0 + psum1 + psum2 + psum3; res[row] += psum4 + psum5 + psum6 + psum7; for (int col = extra; col < cols; col++) res[row] += a[idx + col] * x[col]; res[row] += y[row]; idx += cols; } if (i<ACTIVATION.length-1) { for (int r=0; r<ACTIVATION[i].length; ++r) { ACTIVATION[i][r] = 1 - 2 / (1 + Math.exp(2*ACTIVATION[i][r])); } } if (i == ACTIVATION.length-1) { double max = ACTIVATION[i][0]; for (int r=1; r<ACTIVATION[i].length; r++) { if (ACTIVATION[i][r]>max) max = ACTIVATION[i][r]; } double scale = 0; for (int r=0; r<ACTIVATION[i].length; r++) { ACTIVATION[i][r] = Math.exp(ACTIVATION[i][r] - max); scale += ACTIVATION[i][r]; } for (int r=0; r<ACTIVATION[i].length; r++) { if (Double.isNaN(ACTIVATION[i][r])) throw new RuntimeException("Numerical instability, predicted NaN."); ACTIVATION[i][r] /= scale; preds[r+1] = ACTIVATION[i][r]; } } } preds[0] = hex.genmodel.GenModel.getPrediction(preds, PRIOR_CLASS_DISTRIB, data, 0.5); return preds; } } // Neuron activation values for Input layer class h2o_nn_16x16x6_Tanh_11_Activation_0 implements java.io.Serializable { public static final double[] VALUES = new double[13]; static { h2o_nn_16x16x6_Tanh_11_Activation_0_0.fill(VALUES); } static final class h2o_nn_16x16x6_Tanh_11_Activation_0_0 implements java.io.Serializable { static final void fill(double[] sa) { sa[0] = 0.0; sa[1] = 0.0; sa[2] = 0.0; sa[3] = 0.0; sa[4] = 0.0; sa[5] = 0.0; sa[6] = 0.0; sa[7] = 0.0; sa[8] = 0.0; sa[9] = 0.0; sa[10] = 0.0; sa[11] = 0.0; sa[12] = 0.0; } } } // Neuron activation values for Tanh layer class h2o_nn_16x16x6_Tanh_11_Activation_1 implements java.io.Serializable { public static final double[] VALUES = new double[16]; static { h2o_nn_16x16x6_Tanh_11_Activation_1_0.fill(VALUES); } static final class h2o_nn_16x16x6_Tanh_11_Activation_1_0 implements java.io.Serializable { static final void fill(double[] sa) { sa[0] = 0.0; sa[1] = 0.0; sa[2] = 0.0; sa[3] = 0.0; sa[4] = 0.0; sa[5] = 0.0; sa[6] = 0.0; sa[7] = 0.0; sa[8] = 0.0; sa[9] = 0.0; sa[10] = 0.0; sa[11] = 0.0; sa[12] = 0.0; sa[13] = 0.0; sa[14] = 0.0; sa[15] = 0.0; } } } // Neuron activation values for Tanh layer class h2o_nn_16x16x6_Tanh_11_Activation_2 implements java.io.Serializable { public static final double[] VALUES = new double[16]; static { h2o_nn_16x16x6_Tanh_11_Activation_2_0.fill(VALUES); } static final class h2o_nn_16x16x6_Tanh_11_Activation_2_0 implements java.io.Serializable { static final void fill(double[] sa) { sa[0] = 0.0; sa[1] = 0.0; sa[2] = 0.0; sa[3] = 0.0; sa[4] = 0.0; sa[5] = 0.0; sa[6] = 0.0; sa[7] = 0.0; sa[8] = 0.0; sa[9] = 0.0; sa[10] = 0.0; sa[11] = 0.0; sa[12] = 0.0; sa[13] = 0.0; sa[14] = 0.0; sa[15] = 0.0; } } } // Neuron activation values for Softmax layer class h2o_nn_16x16x6_Tanh_11_Activation_3 implements java.io.Serializable { public static final double[] VALUES = new double[6]; static { h2o_nn_16x16x6_Tanh_11_Activation_3_0.fill(VALUES); } static final class h2o_nn_16x16x6_Tanh_11_Activation_3_0 implements java.io.Serializable { static final void fill(double[] sa) { sa[0] = 0.0; sa[1] = 0.0; sa[2] = 0.0; sa[3] = 0.0; sa[4] = 0.0; sa[5] = 0.0; } } } // Neuron bias values for Input layer class h2o_nn_16x16x6_Tanh_11_Bias_0 implements java.io.Serializable { public static final double[] VALUES = null; } // Neuron bias values for Tanh layer class h2o_nn_16x16x6_Tanh_11_Bias_1 implements java.io.Serializable { public static final double[] VALUES = new double[16]; static { h2o_nn_16x16x6_Tanh_11_Bias_1_0.fill(VALUES); } static final class h2o_nn_16x16x6_Tanh_11_Bias_1_0 implements java.io.Serializable { static final void fill(double[] sa) { sa[0] = -0.12768412970215087; sa[1] = 0.16702855660511912; sa[2] = 0.05186668081480807; sa[3] = 0.03223936526802694; sa[4] = 0.11494232416938457; sa[5] = 0.15310639765400452; sa[6] = -0.0029085465760048303; sa[7] = -0.09134929040625706; sa[8] = 0.06077942605745189; sa[9] = -0.10523901331868173; sa[10] = -0.025196217077874034; sa[11] = 0.006984484761285407; sa[12] = 0.015006648759792292; sa[13] = 0.04977456550426019; sa[14] = -0.08030528460253074; sa[15] = -0.05168080406522856; } } } // Neuron bias values for Tanh layer class h2o_nn_16x16x6_Tanh_11_Bias_2 implements java.io.Serializable { public static final double[] VALUES = new double[16]; static { h2o_nn_16x16x6_Tanh_11_Bias_2_0.fill(VALUES); } static final class h2o_nn_16x16x6_Tanh_11_Bias_2_0 implements java.io.Serializable { static final void fill(double[] sa) { sa[0] = 0.036153937562798576; sa[1] = -0.298122899772991; sa[2] = -0.3055505722806027; sa[3] = 0.1476700244179046; sa[4] = -0.05543639274637335; sa[5] = 0.16122912737315645; sa[6] = 0.008658870433598594; sa[7] = 0.34056137069726317; sa[8] = -0.11417356257891835; sa[9] = 0.060496999685335166; sa[10] = 0.16983686358741573; sa[11] = 0.45112837781407533; sa[12] = -0.07015230937510303; sa[13] = -0.0135815128583097; sa[14] = -0.18547883777494845; sa[15] = -0.18083889100147438; } } } // Neuron bias values for Softmax layer class h2o_nn_16x16x6_Tanh_11_Bias_3 implements java.io.Serializable { public static final double[] VALUES = new double[6]; static { h2o_nn_16x16x6_Tanh_11_Bias_3_0.fill(VALUES); } static final class h2o_nn_16x16x6_Tanh_11_Bias_3_0 implements java.io.Serializable { static final void fill(double[] sa) { sa[0] = 0.2032929647855042; sa[1] = -0.11433122351042027; sa[2] = -0.2971710663177113; sa[3] = 0.07919114995944548; sa[4] = 0.16726890769025374; sa[5] = -0.24456576947346206; } } } class h2o_nn_16x16x6_Tanh_11_Weight_0 implements java.io.Serializable { public static final float[] VALUES = null; } // Neuron weights connecting Input and Tanh layer class h2o_nn_16x16x6_Tanh_11_Weight_1 implements java.io.Serializable { public static final float[] VALUES = new float[208]; static { h2o_nn_16x16x6_Tanh_11_Weight_1_0.fill(VALUES); } static final class h2o_nn_16x16x6_Tanh_11_Weight_1_0 implements java.io.Serializable { static final void fill(float[] sa) { sa[0] = 0.037466444f; sa[1] = 0.19356601f; sa[2] = 0.16491313f; sa[3] = 0.30424818f; sa[4] = -0.105851725f; sa[5] = -0.26165092f; sa[6] = -0.3003843f; sa[7] = 0.3704679f; sa[8] = 0.10837991f; sa[9] = -0.2405026f; sa[10] = -0.11547952f; sa[11] = -0.34167546f; sa[12] = 0.040141955f; sa[13] = -0.2592073f; sa[14] = -0.27017227f; sa[15] = 0.1710485f; sa[16] = 0.028864762f; sa[17] = 0.14147232f; sa[18] = -0.18712255f; sa[19] = 0.30175862f; sa[20] = 0.4627151f; sa[21] = -0.39008558f; sa[22] = 0.5210122f; sa[23] = 0.016341709f; sa[24] = 0.3063611f; sa[25] = 0.48378232f; sa[26] = -0.46691388f; sa[27] = 0.6896085f; sa[28] = 0.23056215f; sa[29] = -0.35520348f; sa[30] = -0.44607398f; sa[31] = 0.14067483f; sa[32] = 0.5551772f; sa[33] = -0.517697f; sa[34] = 0.1358872f; sa[35] = -0.11998853f; sa[36] = -0.1686504f; sa[37] = 0.4349337f; sa[38] = -0.15461552f; sa[39] = 0.21582806f; sa[40] = -0.06961681f; sa[41] = -0.24095352f; sa[42] = -0.30125645f; sa[43] = -0.21549194f; sa[44] = 0.378983f; sa[45] = -0.6048691f; sa[46] = 0.0025519228f; sa[47] = -0.031733353f; sa[48] = 0.31629324f; sa[49] = 0.41692385f; sa[50] = 0.3464105f; sa[51] = -0.5172001f; sa[52] = -0.14408164f; sa[53] = 0.27604455f; sa[54] = 0.21512285f; sa[55] = -0.0779713f; sa[56] = -0.5058915f; sa[57] = -0.4251107f; sa[58] = 0.6100233f; sa[59] = -0.31149516f; sa[60] = -0.4029327f; sa[61] = 0.28239152f; sa[62] = -0.06759114f; sa[63] = 0.14274865f; sa[64] = 0.030035082f; sa[65] = 0.08761684f; sa[66] = 0.109496474f; sa[67] = 0.26988685f; sa[68] = -0.056646198f; sa[69] = 0.15919903f; sa[70] = -0.34463146f; sa[71] = 0.53675246f; sa[72] = -0.1324672f; sa[73] = 0.4388475f; sa[74] = -0.38488707f; sa[75] = -0.0063636936f; sa[76] = -0.29046902f; sa[77] = -0.2290681f; sa[78] = -0.054406013f; sa[79] = 0.3937697f; sa[80] = -0.20460539f; sa[81] = -0.16457744f; sa[82] = -0.12562408f; sa[83] = 0.3386603f; sa[84] = -0.07009676f; sa[85] = -0.33115548f; sa[86] = 0.2483142f; sa[87] = 0.3459947f; sa[88] = 0.20139706f; sa[89] = 0.13375595f; sa[90] = -0.17008215f; sa[91] = -0.21171051f; sa[92] = -0.024942473f; sa[93] = -0.22685538f; sa[94] = -0.5464312f; sa[95] = -0.78698957f; sa[96] = 0.042301748f; sa[97] = 0.32660544f; sa[98] = 0.5456852f; sa[99] = 0.37252888f; sa[100] = -0.21855439f; sa[101] = -0.43123633f; sa[102] = -0.24425471f; sa[103] = -0.118342966f; sa[104] = 0.13062178f; sa[105] = 0.044807296f; sa[106] = -0.22065763f; sa[107] = 0.26098993f; sa[108] = 0.42684814f; sa[109] = -0.18089652f; sa[110] = -0.48560932f; sa[111] = 0.09457484f; sa[112] = 0.08305711f; sa[113] = 0.13959752f; sa[114] = -0.38279948f; sa[115] = 0.105502315f; sa[116] = -0.37891072f; sa[117] = -0.07269105f; sa[118] = -0.5940022f; sa[119] = -0.24615908f; sa[120] = 0.1777367f; sa[121] = 0.26125628f; sa[122] = 0.483045f; sa[123] = 0.35791343f; sa[124] = 0.46378127f; sa[125] = 0.38821352f; sa[126] = -0.371956f; sa[127] = -0.12034018f; sa[128] = 0.11501172f; sa[129] = 0.3175275f; sa[130] = -0.3853936f; sa[131] = 0.43991295f; sa[132] = 0.24769361f; sa[133] = -0.5622549f; sa[134] = -0.11065644f; sa[135] = -0.36564082f; sa[136] = -0.21859038f; sa[137] = 0.030488316f; sa[138] = 0.29666954f; sa[139] = -0.20501743f; sa[140] = -0.33334884f; sa[141] = -0.1265073f; sa[142] = 0.15703084f; sa[143] = -0.5133973f; sa[144] = 0.5971969f; sa[145] = -0.39894074f; sa[146] = -0.2589399f; sa[147] = 0.13811201f; sa[148] = 0.034978457f; sa[149] = 0.46449935f; sa[150] = 0.4059109f; sa[151] = -0.40987727f; sa[152] = 0.07702899f; sa[153] = 0.28781655f; sa[154] = 0.3071548f; sa[155] = -0.29273644f; sa[156] = 0.09572005f; sa[157] = -0.30962923f; sa[158] = 0.14715882f; sa[159] = -0.10012353f; sa[160] = -0.09708619f; sa[161] = 0.22747141f; sa[162] = -0.034086425f; sa[163] = 0.05712755f; sa[164] = 0.5269303f; sa[165] = -0.12194378f; sa[166] = -0.21975447f; sa[167] = -0.06385501f; sa[168] = 0.28699595f; sa[169] = 0.5204555f; sa[170] = -0.072046526f; sa[171] = -0.1524702f; sa[172] = -0.11428987f; sa[173] = -0.26635787f; sa[174] = 0.034878973f; sa[175] = -0.22341886f; sa[176] = -0.12828848f; sa[177] = -0.17999245f; sa[178] = 0.13319433f; sa[179] = 0.28724974f; sa[180] = 0.014572861f; sa[181] = -0.44712687f; sa[182] = -0.22444125f; sa[183] = 0.29408607f; sa[184] = 0.5640803f; sa[185] = 0.2308565f; sa[186] = -0.38205966f; sa[187] = 0.2332678f; sa[188] = -0.49499795f; sa[189] = 0.2896683f; sa[190] = 0.16890705f; sa[191] = -0.124473f; sa[192] = -0.7163985f; sa[193] = 0.46006575f; sa[194] = -0.036167137f; sa[195] = 0.3159018f; sa[196] = 0.26262757f; sa[197] = -0.14272374f; sa[198] = 0.14029883f; sa[199] = -0.10542723f; sa[200] = 0.016327063f; sa[201] = -0.481445f; sa[202] = 0.15942734f; sa[203] = -0.113033384f; sa[204] = -0.287923f; sa[205] = 0.45740676f; sa[206] = 0.36286694f; sa[207] = 0.11597125f; } } } // Neuron weights connecting Tanh and Tanh layer class h2o_nn_16x16x6_Tanh_11_Weight_2 implements java.io.Serializable { public static final float[] VALUES = new float[256]; static { h2o_nn_16x16x6_Tanh_11_Weight_2_0.fill(VALUES); } static final class h2o_nn_16x16x6_Tanh_11_Weight_2_0 implements java.io.Serializable { static final void fill(float[] sa) { sa[0] = 0.52575827f; sa[1] = 0.10556473f; sa[2] = -0.40107906f; sa[3] = -0.46143612f; sa[4] = 2.8351028E-4f; sa[5] = 0.23966517f; sa[6] = 0.07337096f; sa[7] = -0.1515711f; sa[8] = -0.53399414f; sa[9] = 0.5436326f; sa[10] = -0.08000127f; sa[11] = 0.054996554f; sa[12] = 0.22166361f; sa[13] = -0.21045476f; sa[14] = -0.88452184f; sa[15] = 0.2231463f; sa[16] = 0.6850828f; sa[17] = -0.2223695f; sa[18] = -0.03403776f; sa[19] = -0.28915322f; sa[20] = 0.3657561f; sa[21] = 0.1650168f; sa[22] = -0.5146796f; sa[23] = 0.505455f; sa[24] = 0.10203405f; sa[25] = 0.15377375f; sa[26] = 0.100793615f; sa[27] = 0.27162102f; sa[28] = -0.43880326f; sa[29] = -0.20995885f; sa[30] = 0.27957508f; sa[31] = -0.2886791f; sa[32] = -0.13368936f; sa[33] = -0.4062054f; sa[34] = -0.13025713f; sa[35] = 0.23276462f; sa[36] = 0.1246204f; sa[37] = 0.14760067f; sa[38] = -0.06760131f; sa[39] = 0.14277524f; sa[40] = 0.07335415f; sa[41] = -0.46360466f; sa[42] = -0.42378557f; sa[43] = -0.3573998f; sa[44] = -0.2733288f; sa[45] = -0.35334656f; sa[46] = -0.03638564f; sa[47] = 0.39266884f; sa[48] = -0.2497689f; sa[49] = -0.22612217f; sa[50] = 0.23621808f; sa[51] = -0.2080384f; sa[52] = 0.34299412f; sa[53] = 0.34821245f; sa[54] = -0.09367947f; sa[55] = 0.43074074f; sa[56] = -0.30830777f; sa[57] = -0.30565876f; sa[58] = 0.23572782f; sa[59] = -0.022919215f; sa[60] = 0.32261062f; sa[61] = -0.34223336f; sa[62] = 0.06903289f; sa[63] = 0.10531071f; sa[64] = 0.16121157f; sa[65] = -0.046505906f; sa[66] = 0.17439176f; sa[67] = 0.43937185f; sa[68] = 0.29338792f; sa[69] = -0.18712327f; sa[70] = -0.41316032f; sa[71] = -0.07933734f; sa[72] = -0.44336668f; sa[73] = 0.25327724f; sa[74] = 0.2519577f; sa[75] = 0.07765439f; sa[76] = 0.08478664f; sa[77] = 0.13346381f; sa[78] = -0.616361f; sa[79] = 0.10533611f; sa[80] = -0.09464435f; sa[81] = 0.1865298f; sa[82] = 0.009827714f; sa[83] = -0.28747645f; sa[84] = -0.30556217f; sa[85] = -0.25222528f; sa[86] = 0.024041407f; sa[87] = 0.10576077f; sa[88] = -0.52811223f; sa[89] = -0.0573675f; sa[90] = -0.429371f; sa[91] = 0.38333082f; sa[92] = -0.07236532f; sa[93] = -0.021621121f; sa[94] = -0.8069618f; sa[95] = -0.004689829f; sa[96] = -0.07171514f; sa[97] = 0.045983773f; sa[98] = -0.06773359f; sa[99] = -0.0867943f; sa[100] = -0.24221411f; sa[101] = 0.059222866f; sa[102] = 0.18057087f; sa[103] = 0.14425148f; sa[104] = -0.0013445952f; sa[105] = -0.09183932f; sa[106] = 0.48623672f; sa[107] = 0.25289804f; sa[108] = 0.19539516f; sa[109] = -0.09869074f; sa[110] = 0.13397625f; sa[111] = -0.25671074f; sa[112] = -0.28121313f; sa[113] = 0.27164352f; sa[114] = 0.06455878f; sa[115] = -0.2065339f; sa[116] = 0.58305836f; sa[117] = 0.41219205f; sa[118] = -0.3667415f; sa[119] = -0.21009293f; sa[120] = -0.28517863f; sa[121] = 0.23870954f; sa[122] = -0.22798514f; sa[123] = 0.15286525f; sa[124] = -0.34238377f; sa[125] = 0.09492471f; sa[126] = -0.85236955f; sa[127] = -0.14584886f; sa[128] = -0.31463993f; sa[129] = 0.181051f; sa[130] = 0.36132953f; sa[131] = 0.263867f; sa[132] = 0.25847107f; sa[133] = 0.06635298f; sa[134] = 0.43496585f; sa[135] = -0.27628025f; sa[136] = 0.2069677f; sa[137] = -0.37352815f; sa[138] = -0.027981516f; sa[139] = 0.56542367f; sa[140] = -0.49571162f; sa[141] = -0.0043387692f; sa[142] = 0.3666521f; sa[143] = -0.20519759f; sa[144] = 0.32783207f; sa[145] = -0.2898176f; sa[146] = 0.07300097f; sa[147] = 0.017812995f; sa[148] = -0.42684647f; sa[149] = 0.003476128f; sa[150] = -0.20581159f; sa[151] = -0.66641027f; sa[152] = 0.5686908f; sa[153] = -0.12880759f; sa[154] = 0.3776039f; sa[155] = -0.5114094f; sa[156] = -0.17979528f; sa[157] = -0.21314582f; sa[158] = 0.30192462f; sa[159] = -0.02800927f; sa[160] = 0.40280598f; sa[161] = -0.1519263f; sa[162] = 0.52703726f; sa[163] = -0.31402636f; sa[164] = 0.49324164f; sa[165] = 0.037470516f; sa[166] = 0.38179293f; sa[167] = -0.40706423f; sa[168] = 0.3771337f; sa[169] = -0.61976516f; sa[170] = 0.18120165f; sa[171] = 0.33152542f; sa[172] = 0.21106744f; sa[173] = 0.33494982f; sa[174] = -0.20515537f; sa[175] = -0.14644033f; sa[176] = -0.24630676f; sa[177] = 0.072822176f; sa[178] = -0.21828556f; sa[179] = -0.044038378f; sa[180] = -0.46974605f; sa[181] = -0.4042361f; sa[182] = 0.17794481f; sa[183] = -0.30820996f; sa[184] = 0.075735204f; sa[185] = 0.41377255f; sa[186] = -0.047793012f; sa[187] = -0.35034105f; sa[188] = 0.3270266f; sa[189] = -0.24575303f; sa[190] = -0.28497374f; sa[191] = -0.23207481f; sa[192] = -0.2668532f; sa[193] = 0.12245128f; sa[194] = -0.20384817f; sa[195] = -0.12015919f; sa[196] = 0.12184806f; sa[197] = -0.3027825f; sa[198] = 0.10703478f; sa[199] = 0.35444614f; sa[200] = -0.059302446f; sa[201] = 0.21316332f; sa[202] = 0.06553602f; sa[203] = -0.324685f; sa[204] = 0.088213f; sa[205] = 0.44493574f; sa[206] = -0.09391312f; sa[207] = 0.14536154f; sa[208] = -0.17381288f; sa[209] = 0.30216625f; sa[210] = -0.2784127f; sa[211] = -0.44639987f; sa[212] = -0.16644569f; sa[213] = 0.2689963f; sa[214] = -0.5038852f; sa[215] = -0.13168605f; sa[216] = -0.13589653f; sa[217] = 0.5776792f; sa[218] = -0.12038968f; sa[219] = 0.1395809f; sa[220] = 0.18591096f; sa[221] = -0.21045332f; sa[222] = -0.7960501f; sa[223] = -0.3621803f; sa[224] = 0.3663701f; sa[225] = 0.07524255f; sa[226] = -0.39658704f; sa[227] = 0.033137366f; sa[228] = -0.13271998f; sa[229] = -0.26305768f; sa[230] = -0.1838089f; sa[231] = -0.43769884f; sa[232] = 0.49838316f; sa[233] = -0.15314724f; sa[234] = -0.32157248f; sa[235] = -0.036060285f; sa[236] = -0.37936378f; sa[237] = 0.46568432f; sa[238] = -0.33487377f; sa[239] = 0.09202558f; sa[240] = -0.23685548f; sa[241] = -0.5252257f; sa[242] = -0.3330868f; sa[243] = 0.50506836f; sa[244] = 0.100927085f; sa[245] = 0.22123048f; sa[246] = 0.31323513f; sa[247] = -0.56796384f; sa[248] = 0.27804464f; sa[249] = -0.15403302f; sa[250] = 0.05045739f; sa[251] = 0.49847707f; sa[252] = 0.0972765f; sa[253] = -0.071256205f; sa[254] = 0.37066278f; sa[255] = 0.31315747f; } } } // Neuron weights connecting Tanh and Softmax layer class h2o_nn_16x16x6_Tanh_11_Weight_3 implements java.io.Serializable { public static final float[] VALUES = new float[96]; static { h2o_nn_16x16x6_Tanh_11_Weight_3_0.fill(VALUES); } static final class h2o_nn_16x16x6_Tanh_11_Weight_3_0 implements java.io.Serializable { static final void fill(float[] sa) { sa[0] = -0.2861841f; sa[1] = -1.5459306f; sa[2] = -1.5369767f; sa[3] = 1.3339508f; sa[4] = 0.21264158f; sa[5] = -0.16444132f; sa[6] = -1.5063889f; sa[7] = 1.4388943f; sa[8] = 2.2198339f; sa[9] = 0.08639903f; sa[10] = 1.956038f; sa[11] = 1.1503769f; sa[12] = 1.5007908f; sa[13] = -1.17623f; sa[14] = -1.9206097f; sa[15] = -0.5615234f; sa[16] = 0.45551607f; sa[17] = -0.9158583f; sa[18] = -1.3376552f; sa[19] = -1.204435f; sa[20] = -1.8522495f; sa[21] = 0.16445825f; sa[22] = -1.9169891f; sa[23] = -0.8043495f; sa[24] = -0.37026665f; sa[25] = 1.9997612f; sa[26] = -0.29731345f; sa[27] = 1.2821735f; sa[28] = 1.2110518f; sa[29] = -0.91401166f; sa[30] = 0.30469722f; sa[31] = 0.39824393f; sa[32] = 0.394808f; sa[33] = 0.38317573f; sa[34] = -0.527238f; sa[35] = 0.9238419f; sa[36] = 0.43727973f; sa[37] = -1.342842f; sa[38] = 0.5249131f; sa[39] = -0.25074634f; sa[40] = 0.37976125f; sa[41] = -0.65544665f; sa[42] = 0.63074183f; sa[43] = -0.24475162f; sa[44] = 0.9149806f; sa[45] = -2.0616019f; sa[46] = -1.8664972f; sa[47] = 0.14645216f; sa[48] = 1.9380214f; sa[49] = -0.053008508f; sa[50] = -0.611932f; sa[51] = 1.8260099f; sa[52] = -1.6440954f; sa[53] = 0.890831f; sa[54] = 1.7005652f; sa[55] = 1.3002821f; sa[56] = -0.682498f; sa[57] = -0.020085288f; sa[58] = 0.9430623f; sa[59] = 0.8683517f; sa[60] = -1.302753f; sa[61] = 1.1568718f; sa[62] = -0.48714572f; sa[63] = -0.91919166f; sa[64] = 1.0856814f; sa[65] = -0.90718365f; sa[66] = -1.8362314f; sa[67] = 0.13072085f; sa[68] = 1.1402382f; sa[69] = -1.1943203f; sa[70] = -1.5241139f; sa[71] = -0.052245352f; sa[72] = -1.4010339f; sa[73] = -1.4288169f; sa[74] = -1.3748534f; sa[75] = 1.3574227f; sa[76] = 1.9248203f; sa[77] = -0.4391445f; sa[78] = -1.715689f; sa[79] = -0.88931537f; sa[80] = 0.7149446f; sa[81] = -1.5812167f; sa[82] = -0.1601239f; sa[83] = -1.5607926f; sa[84] = 1.591604f; sa[85] = 1.1770619f; sa[86] = -1.9958066f; sa[87] = 1.3013498f; sa[88] = -1.382664f; sa[89] = -1.021849f; sa[90] = 0.24427597f; sa[91] = 0.22826467f; sa[92] = 1.3224742f; sa[93] = 1.9789864f; sa[94] = 1.9209331f; sa[95] = 0.8123862f; } } } // The class representing training column names class NamesHolder_h2o_nn_16x16x6_Tanh_11 implements java.io.Serializable { public static final String[] VALUES = new String[13]; static { NamesHolder_h2o_nn_16x16x6_Tanh_11_0.fill(VALUES); } static final class NamesHolder_h2o_nn_16x16x6_Tanh_11_0 implements java.io.Serializable { static final void fill(String[] sa) { sa[0] = "X5"; sa[1] = "X12"; sa[2] = "X15"; sa[3] = "X17"; sa[4] = "X18"; sa[5] = "X19"; sa[6] = "X20"; sa[7] = "X21"; sa[8] = "X23"; sa[9] = "X27"; sa[10] = "X28"; sa[11] = "X34"; sa[12] = "X35"; } } } // The class representing column Label class h2o_nn_16x16x6_Tanh_11_ColInfo_13 implements java.io.Serializable { public static final String[] VALUES = new String[6]; static { h2o_nn_16x16x6_Tanh_11_ColInfo_13_0.fill(VALUES); } static final class h2o_nn_16x16x6_Tanh_11_ColInfo_13_0 implements java.io.Serializable { static final void fill(String[] sa) { sa[0] = "1"; sa[1] = "2"; sa[2] = "3"; sa[3] = "4"; sa[4] = "5"; sa[5] = "6"; } } }
21800be9072b80dab6f71d4e86b674cb97cdc726
b303c670b8f7e4882463582835dfa0f64dfb29b5
/samples/Cpp/HelloCpp/proj.android/src/org/cocos2dx/hellocpp/Cocos2dxActivity.java
ed4f339cee086bcf14ee949a463cf24ef87fe780
[]
no_license
ShortTailLab/cocos2d-x
59d5e229728337ab803650189313db9234a581e2
07f809dd92c064fe3b867e0f21a69a9622ecf618
refs/heads/develop
2021-01-17T08:39:20.015020
2014-01-15T12:48:53
2014-01-15T12:48:53
14,161,363
1
0
null
2014-08-26T06:22:10
2013-11-06T02:55:18
C
UTF-8
Java
false
false
912
java
package org.cocos2dx.hellocpp; import android.app.NativeActivity; import android.os.Bundle; public class Cocos2dxActivity extends NativeActivity{ @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); //For supports translucency //1.change "attribs" in cocos\2d\platform\android\nativeactivity.cpp /*const EGLint attribs[] = { EGL_SURFACE_TYPE, EGL_WINDOW_BIT, EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, //EGL_BLUE_SIZE, 5, -->delete //EGL_GREEN_SIZE, 6, -->delete //EGL_RED_SIZE, 5, -->delete EGL_BUFFER_SIZE, 32, //-->new field EGL_DEPTH_SIZE, 16, EGL_STENCIL_SIZE, 8, EGL_NONE };*/ //2.Set the format of window // getWindow().setFormat(PixelFormat.TRANSLUCENT); } }
28ed0296b10fccbddd950ad33b048da8eb1fd3f0
8651367965bc9426985f53334f5659960f816beb
/app/src/main/java/com/example/item/ui/notifications/adapter/SubClassifyAdapter.java
fbb5157299efb5c54a85b1ec84da1511b0ad5e0f
[]
no_license
d0813/Item
365d7103b1f5915683d53365ffe0d748c86b5149
a86456a8716b697d28a9b4fa3e468cf001d323e1
refs/heads/main
2023-02-09T14:28:31.476913
2021-01-06T23:32:41
2021-01-06T23:32:41
325,499,894
0
0
null
null
null
null
UTF-8
Java
false
false
1,126
java
package com.example.item.ui.notifications.adapter; import android.content.Context; import android.view.View; import android.widget.ImageView; import android.widget.TextView; import com.bumptech.glide.Glide; import com.example.item.R; import com.example.item.base.BaseAdapter; import com.example.item.bean.ClassifyBean; import java.util.List; public class SubClassifyAdapter extends BaseAdapter { public SubClassifyAdapter(Context context, List data) { super(context, data); } @Override protected int getLayout(int type) { return R.layout.subclassifyadapter_item; } @Override protected void bindData(Object data, VH vh) { ImageView subimg = (ImageView) vh.getViewById(R.id.sub_img); TextView subtitle = (TextView) vh.getViewById(R.id.sub_title); ClassifyBean.DataBean.CurrentCategoryBean.SubCategoryListBean subCategoryListBean= (ClassifyBean.DataBean.CurrentCategoryBean.SubCategoryListBean) data; Glide.with(context).load(subCategoryListBean.getWap_banner_url()).into(subimg); subtitle.setText(subCategoryListBean.getName()); } }
8883175b40bcd1df61b33d5f222f763fc33fc828
d7f05ca4dc64e25f6eaa617d2222a09264e1da6d
/ExempleBackend2/src/main/java/com/wha/springmvc/dao/AdminDAO.java
6659250bf35f8ca52081c5590c7b5daaf48e9444
[]
no_license
YiffyC/GKGestiBank
b3db09f50daf2214493937686cfacdb87bdaf39c
bac1420ed1cdbe569428773d53945b5e1b27ddea
refs/heads/master
2020-03-12T09:44:49.238003
2018-04-22T10:58:32
2018-04-22T10:58:32
130,558,891
0
0
null
null
null
null
UTF-8
Java
false
false
406
java
package com.wha.springmvc.dao; import java.util.List; import com.mysql.fabric.xmlrpc.Client; import com.wha.springmvc.model.Admin; import com.wha.springmvc.model.Agent; public interface AdminDAO { Admin findById(int id); Admin findByName(String name); void save( Admin admin ); void deleteAdminById(int id); List<Admin> findAllAdmins(); void deleteAllAdmins(); }
9eb48b0a51e4a3766fcac2308c27f6f9dc39f160
09c8662b4108977417d8f5d56c6f2915a3e6bf96
/app/src/test/java/com/example/sikang/rotateview/ExampleUnitTest.java
a82b8c8bf013a5686bce413df9c45f7d17c4e4c2
[]
no_license
SiKang123/RotateView
c3d23e66493d6477c678c05f4ad75cf5ca0d0a5d
c2f1d667fd730f3fa247864ed6da48db900bebc3
refs/heads/master
2021-01-10T15:42:02.229110
2017-05-02T06:56:36
2017-05-02T06:56:36
53,297,302
3
1
null
null
null
null
UTF-8
Java
false
false
322
java
package com.example.sikang.rotateview; import org.junit.Test; import static org.junit.Assert.*; /** * To work on unit tests, switch the Test Artifact in the Build Variants view. */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
95174b7c1f33388772b991e8294bbe585eeb73eb
f8d0ad43b5fd6786a053ea9e013ffd0ac11d28d1
/src/main/java/com/ToutPromoV1/repositories/RoleRepository.java
8ac1f6bf9b4e4388b79b50fb3db9109bec8b7df9
[]
no_license
assenajude/ToutPromoV1Back
ec3974772ba388cea7843342402528d2e560ac2d
d962a366fdeb14d2e66cd4272223d063bb68cedf
refs/heads/master
2020-06-13T11:56:23.687704
2019-07-01T10:19:46
2019-07-01T10:19:46
194,645,650
0
0
null
null
null
null
UTF-8
Java
false
false
395
java
package com.ToutPromoV1.repositories; import java.util.Optional; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; import com.ToutPromoV1.entities.RoleName; import com.ToutPromoV1.entities.Roles; @Repository public interface RoleRepository extends JpaRepository<Roles, Long> { Optional<Roles>findByName(RoleName roleName); }
3f9d37310299943b25f87a1f55b73aa2c26799ca
ef7352d73396d9dbe6da5e2011cab6e4809c7605
/Assignment-7/Assign7_III.java
f6e70aa3ffde02e7abc80fe4e5b28dd51b74ff07
[]
no_license
dilsadmohammed4/Java-Assignment
d58aab3e6948e8032a9b890b86625986e0ea8cb5
cd98ea162ca95708f3bed0ad56c8536a5ae315fa
refs/heads/master
2023-02-09T12:03:21.623543
2021-01-04T19:10:51
2021-01-04T19:10:51
326,781,307
1
0
null
null
null
null
UTF-8
Java
false
false
503
java
import java.util.Scanner; public class Assign7_III { public static void main(String[] args) { Scanner input = new Scanner(System.in); int num, sum = 0; System.out.print("Enter the Number:"); num = input.nextInt(); while (num > 0 || sum > 9) { if (num == 0) { num = sum; sum = 0; } sum = sum + num % 10; num = num / 10; } System.out.println("Sum:" + sum); } }
2ad41092c9ab015f54fd264bc7c82c6a220e32f1
3634eded90370ff24ee8f47ccfa19e388d3784ad
/src/main/java/com/tencent/open/web/security/b.java
06d5a5baabea771586b50fde565cb13c412f4605
[]
no_license
xiaofans/ResStudyPro
8bc3c929ef7199c269c6250b390d80739aaf50b9
ac3204b27a65e006ebeb5b522762848ea82d960b
refs/heads/master
2021-01-25T05:09:52.461974
2017-06-06T12:12:41
2017-06-06T12:12:41
93,514,258
0
0
null
null
null
null
UTF-8
Java
false
false
2,340
java
package com.tencent.open.web.security; import android.net.Uri; import android.text.TextUtils; import android.webkit.WebView; import com.tencent.open.a; import com.tencent.open.a.f; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import java.util.ArrayList; import java.util.Arrays; import java.util.List; /* compiled from: ProGuard */ public class b extends a { public void a(String str, String str2, List<String> list, a.a aVar) { f.b("openSDK_LOG.SecureJs", "-->getResult, objectName: " + str + " | methodName: " + str2); int size = list.size(); for (int i = 0; i < size; i++) { try { list.set(i, URLDecoder.decode((String) list.get(i), "UTF-8")); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } } com.tencent.open.a.b bVar = (com.tencent.open.a.b) this.a.get(str); if (bVar != null) { f.b("openSDK_LOG.SecureJs", "-->handler != null"); bVar.call(str2, list, aVar); return; } f.b("openSDK_LOG.SecureJs", "-->handler == null"); if (aVar != null) { aVar.a(); } } public boolean a(WebView webView, String str) { f.b("openSDK_LOG.SecureJs", "-->canHandleUrl---url = " + str); if (str == null) { return false; } if (!Uri.parse(str).getScheme().equals("jsbridge")) { return false; } ArrayList arrayList = new ArrayList(Arrays.asList((str + "/#").split("/"))); if (arrayList.size() < 7) { return false; } String str2 = (String) arrayList.get(2); String str3 = (String) arrayList.get(3); String str4 = (String) arrayList.get(4); String str5 = (String) arrayList.get(5); f.b("openSDK_LOG.SecureJs", "-->canHandleUrl, objectName: " + str2 + " | methodName: " + str3 + " | snStr: " + str4); if (TextUtils.isEmpty(str2) || TextUtils.isEmpty(str3) || TextUtils.isEmpty(str4)) { return false; } try { a(str2, str3, arrayList.subList(6, arrayList.size() - 1), new c(webView, Long.parseLong(str4), str, str5)); return true; } catch (Exception e) { return false; } } }
9a1a702154b045c9d66bf064a3ec078b9c261add
b4d063d7c850c3ffaa6b197a7f3bcc168270d68e
/src/unusedScenarios/SplitString.java
9472b122a7b1ffa1079a33cd87e07b87de06cc5b
[]
no_license
Ankit11191/DataDriven
0815b0c4c7a37b1ab6a85ced994cef8ae8f85874
8e4c2e9230bfab38bff456520eff0ec1267e406c
refs/heads/master
2021-01-02T08:50:54.360046
2018-08-17T06:01:15
2018-08-17T06:01:15
99,080,676
0
0
null
null
null
null
UTF-8
Java
false
false
445
java
package unusedScenarios; import org.testng.annotations.Test; import scenario.DataProivder; import scenario.ReadProerties; public class SplitString extends DataProivder { @Test(dataProvider="DataProvider") public static void read(String aaa,String bbb,String ccc) { // DataProivder.dataProvider(ReadProerties.propsObjectsSplit("DataProviderSheet")); System.out.println(aaa); System.out.println(bbb); System.out.println(ccc); } }
6ef735da126cef832c75eac20ef711d3c86a60e4
3634eded90370ff24ee8f47ccfa19e388d3784ad
/src/main/java/natalya/graphics/BitmapUtils.java
93a30a8c2a65effa3938b7f79d7f0ec7a136183a
[]
no_license
xiaofans/ResStudyPro
8bc3c929ef7199c269c6250b390d80739aaf50b9
ac3204b27a65e006ebeb5b522762848ea82d960b
refs/heads/master
2021-01-25T05:09:52.461974
2017-06-06T12:12:41
2017-06-06T12:12:41
93,514,258
0
0
null
null
null
null
UTF-8
Java
false
false
14,685
java
package natalya.graphics; import android.content.ContentResolver; import android.graphics.Bitmap; import android.graphics.Bitmap.CompressFormat; import android.graphics.Bitmap.Config; import android.graphics.BitmapFactory; import android.graphics.BitmapFactory.Options; import android.graphics.BlurMaskFilter; import android.graphics.BlurMaskFilter.Blur; import android.graphics.Canvas; import android.graphics.LinearGradient; import android.graphics.Matrix; import android.graphics.Paint; import android.graphics.PorterDuff.Mode; import android.graphics.PorterDuffXfermode; import android.graphics.Rect; import android.graphics.RectF; import android.graphics.Shader.TileMode; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.net.Uri; import android.os.Build.VERSION; import android.support.v4.view.MotionEventCompat; import android.support.v4.view.ViewCompat; import android.util.Log; import java.io.ByteArrayOutputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.lang.reflect.Array; import java.lang.reflect.Constructor; import java.lang.reflect.Method; public class BitmapUtils { public static Bitmap rotate(Bitmap bmp, float angle) { Matrix matrixRotateLeft = new Matrix(); matrixRotateLeft.setRotate(angle); return Bitmap.createBitmap(bmp, 0, 0, bmp.getWidth(), bmp.getHeight(), matrixRotateLeft, true); } public static Bitmap scale(ContentResolver contentResolver, Uri uri, int maxWidth, int maxHeight) { String tag = "SCALE"; Log.d(tag, "uri=" + uri.toString()); try { Options options = new Options(); options.inJustDecodeBounds = true; InputStream input = contentResolver.openInputStream(uri); BitmapFactory.decodeStream(input, null, options); int sourceWidth = options.outWidth; int sourceHeight = options.outHeight; Log.d(tag, "sourceWidth=" + sourceWidth + ", sourceHeight=" + sourceHeight); Log.d(tag, "maxWidth=" + maxWidth + ", maxHeight=" + maxHeight); input.close(); float rate = Math.max(((float) sourceWidth) / ((float) maxWidth), ((float) sourceHeight) / ((float) maxHeight)); options.inJustDecodeBounds = false; options.inSampleSize = (int) rate; Log.d(tag, "rate=" + rate + ", inSampleSize=" + options.inSampleSize); input = contentResolver.openInputStream(uri); Bitmap bitmap = BitmapFactory.decodeStream(input, null, options); int w0 = bitmap.getWidth(); int h0 = bitmap.getHeight(); Log.d(tag, "w0=" + w0 + ", h0=" + h0); float scaleWidth = ((float) maxWidth) / ((float) w0); float scaleHeight = ((float) maxHeight) / ((float) h0); float maxScale = Math.min(scaleWidth, scaleHeight); Log.d(tag, "scaleWidth=" + scaleWidth + ", scaleHeight=" + scaleHeight); Matrix matrix = new Matrix(); matrix.reset(); if (maxScale < 1.0f) { matrix.postScale(maxScale, maxScale); } Bitmap resizedBitmap = Bitmap.createBitmap(bitmap, 0, 0, w0, h0, matrix, true); input.close(); return resizedBitmap; } catch (FileNotFoundException e) { e.printStackTrace(); return null; } catch (IOException e2) { e2.printStackTrace(); return null; } } public static Bitmap getBitmap(Drawable drawable) { if (drawable == null) { return null; } if (drawable instanceof BitmapDrawable) { return ((BitmapDrawable) drawable).getBitmap(); } Bitmap bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), drawable.getOpacity() != -1 ? Config.ARGB_8888 : Config.RGB_565); Canvas canvas = new Canvas(bitmap); drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight()); drawable.draw(canvas); return bitmap; } public static Bitmap drawShadow(Bitmap map, int radius) { if (map == null) { return null; } BlurMaskFilter blurFilter = new BlurMaskFilter((float) radius, Blur.OUTER); Paint shadowPaint = new Paint(); shadowPaint.setMaskFilter(blurFilter); int[] offsetXY = new int[2]; Bitmap shadowImage = map.extractAlpha(shadowPaint, offsetXY).copy(Config.ARGB_8888, true); if (VERSION.SDK_INT > 18) { shadowImage.setPremultiplied(true); } new Canvas(shadowImage).drawBitmap(map, (float) (-offsetXY[0]), (float) (-offsetXY[1]), null); return shadowImage; } public static Bitmap getRoundedCornerBitmap(Bitmap bitmap, float roundPx) { Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Config.ARGB_8888); Canvas canvas = new Canvas(output); Paint paint = new Paint(); Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight()); RectF rectF = new RectF(rect); paint.setAntiAlias(true); canvas.drawARGB(0, 0, 0, 0); paint.setColor(-12434878); canvas.drawRoundRect(rectF, roundPx, roundPx, paint); paint.setXfermode(new PorterDuffXfermode(Mode.SRC_IN)); canvas.drawBitmap(bitmap, rect, rect, paint); return output; } public static int getExifOrientation(String filepath) { try { Class cls = Class.forName("android.media.ExifInterface"); Constructor cons = cls.getConstructor(new Class[]{String.class}); Method method = cls.getMethod("getAttributeInt", new Class[]{String.class, Integer.TYPE}); Object exif = cons.newInstance(new Object[]{filepath}); if (exif == null) { return 0; } int orientation = ((Integer) method.invoke(exif, new Object[]{"Orientation", Integer.valueOf(-1)})).intValue(); if (orientation == -1) { return 0; } switch (orientation) { case 3: return Header.MA_VAR; case 6: return 90; case 8: return 270; default: return 0; } } catch (Exception e) { e.printStackTrace(); return 0; } } public static byte[] generateBitstream(Bitmap src, CompressFormat format, int quality) { ByteArrayOutputStream os = new ByteArrayOutputStream(); src.compress(format, quality, os); return os.toByteArray(); } public static Bitmap fastblur(Bitmap sentBitmap, int radius) { Bitmap bitmap = sentBitmap.copy(sentBitmap.getConfig(), true); if (radius < 1) { return null; } int i; int y; int x; int w = bitmap.getWidth(); int h = bitmap.getHeight(); int[] pix = new int[(w * h)]; Log.e("pix", w + " " + h + " " + pix.length); bitmap.getPixels(pix, 0, w, 0, 0, w, h); int wm = w - 1; int hm = h - 1; int wh = w * h; int div = (radius + radius) + 1; int[] r = new int[wh]; int[] g = new int[wh]; int[] b = new int[wh]; int[] vmin = new int[Math.max(w, h)]; int divsum = (div + 1) >> 1; divsum *= divsum; int[] dv = new int[(divsum * 256)]; for (i = 0; i < divsum * 256; i++) { dv[i] = i / divsum; } int yi = 0; int yw = 0; int[][] stack = (int[][]) Array.newInstance(Integer.TYPE, new int[]{div, 3}); int r1 = radius + 1; for (y = 0; y < h; y++) { int bsum = 0; int gsum = 0; int rsum = 0; int boutsum = 0; int goutsum = 0; int routsum = 0; int binsum = 0; int ginsum = 0; int rinsum = 0; for (i = -radius; i <= radius; i++) { int p = pix[Math.min(wm, Math.max(i, 0)) + yi]; int[] sir = stack[i + radius]; sir[0] = (16711680 & p) >> 16; sir[1] = (MotionEventCompat.ACTION_POINTER_INDEX_MASK & p) >> 8; sir[2] = p & 255; int rbs = r1 - Math.abs(i); rsum += sir[0] * rbs; gsum += sir[1] * rbs; bsum += sir[2] * rbs; if (i > 0) { rinsum += sir[0]; ginsum += sir[1]; binsum += sir[2]; } else { routsum += sir[0]; goutsum += sir[1]; boutsum += sir[2]; } } int stackpointer = radius; for (x = 0; x < w; x++) { r[yi] = dv[rsum]; g[yi] = dv[gsum]; b[yi] = dv[bsum]; rsum -= routsum; gsum -= goutsum; bsum -= boutsum; sir = stack[((stackpointer - radius) + div) % div]; routsum -= sir[0]; goutsum -= sir[1]; boutsum -= sir[2]; if (y == 0) { vmin[x] = Math.min((x + radius) + 1, wm); } p = pix[vmin[x] + yw]; sir[0] = (16711680 & p) >> 16; sir[1] = (MotionEventCompat.ACTION_POINTER_INDEX_MASK & p) >> 8; sir[2] = p & 255; rinsum += sir[0]; ginsum += sir[1]; binsum += sir[2]; rsum += rinsum; gsum += ginsum; bsum += binsum; stackpointer = (stackpointer + 1) % div; sir = stack[stackpointer % div]; routsum += sir[0]; goutsum += sir[1]; boutsum += sir[2]; rinsum -= sir[0]; ginsum -= sir[1]; binsum -= sir[2]; yi++; } yw += w; } for (x = 0; x < w; x++) { bsum = 0; gsum = 0; rsum = 0; boutsum = 0; goutsum = 0; routsum = 0; binsum = 0; ginsum = 0; rinsum = 0; int yp = (-radius) * w; for (i = -radius; i <= radius; i++) { yi = Math.max(0, yp) + x; sir = stack[i + radius]; sir[0] = r[yi]; sir[1] = g[yi]; sir[2] = b[yi]; rbs = r1 - Math.abs(i); rsum += r[yi] * rbs; gsum += g[yi] * rbs; bsum += b[yi] * rbs; if (i > 0) { rinsum += sir[0]; ginsum += sir[1]; binsum += sir[2]; } else { routsum += sir[0]; goutsum += sir[1]; boutsum += sir[2]; } if (i < hm) { yp += w; } } yi = x; stackpointer = radius; for (y = 0; y < h; y++) { pix[yi] = ((ViewCompat.MEASURED_STATE_MASK | (dv[rsum] << 16)) | (dv[gsum] << 8)) | dv[bsum]; rsum -= routsum; gsum -= goutsum; bsum -= boutsum; sir = stack[((stackpointer - radius) + div) % div]; routsum -= sir[0]; goutsum -= sir[1]; boutsum -= sir[2]; if (x == 0) { vmin[y] = Math.min(y + r1, hm) * w; } p = x + vmin[y]; sir[0] = r[p]; sir[1] = g[p]; sir[2] = b[p]; rinsum += sir[0]; ginsum += sir[1]; binsum += sir[2]; rsum += rinsum; gsum += ginsum; bsum += binsum; stackpointer = (stackpointer + 1) % div; sir = stack[stackpointer]; routsum += sir[0]; goutsum += sir[1]; boutsum += sir[2]; rinsum -= sir[0]; ginsum -= sir[1]; binsum -= sir[2]; yi += w; } } bitmap.setPixels(pix, 0, w, 0, 0, w, h); return bitmap; } public static Bitmap getReflectBitmap(Bitmap originalImage, float rate) { int width = originalImage.getWidth(); int height = originalImage.getHeight(); int reflectHeight = Math.round(((float) height) * rate); Matrix matrix = new Matrix(); matrix.preScale(1.0f, -1.0f); Bitmap reflectionImage = Bitmap.createBitmap(originalImage, 0, height - reflectHeight, width, reflectHeight, matrix, false); Bitmap bitmapWithReflection = Bitmap.createBitmap(width, height + reflectHeight, Config.ARGB_8888); Canvas canvas = new Canvas(bitmapWithReflection); canvas.drawBitmap(originalImage, 0.0f, 0.0f, null); canvas.drawRect(0.0f, (float) height, (float) width, (float) (height + 4), new Paint()); canvas.drawBitmap(reflectionImage, 0.0f, (float) (height + 4), null); Paint paint = new Paint(); paint.setShader(new LinearGradient(0.0f, (float) originalImage.getHeight(), 0.0f, (float) (bitmapWithReflection.getHeight() + 4), 1895825407, ViewCompat.MEASURED_SIZE_MASK, TileMode.CLAMP)); paint.setXfermode(new PorterDuffXfermode(Mode.DST_IN)); canvas.drawRect(0.0f, (float) height, (float) width, (float) (bitmapWithReflection.getHeight() + 4), paint); return bitmapWithReflection; } public static Bitmap getSquareBitmap(Bitmap src) { return getSquareBitmap(src, 0.1f); } public static Bitmap getSquareBitmap(Bitmap src, float rate) { Bitmap ret = src; int w = src.getWidth(); int h = src.getHeight(); int min = Math.min(w, h); float r = ((float) (Math.max(w, h) - min)) / ((float) min); if (w == h || r <= rate) { return ret; } int max = Math.round((1.0f + rate) * ((float) min)); if (w > h) { return Bitmap.createBitmap(src, (w - max) / 2, 0, max, min); } return Bitmap.createBitmap(src, 0, (h - max) / 2, min, max); } }
c5672cded7738dc615ea5d84738ba28a820934b3
74ddf01f9545138151d2449f144899321becb08a
/src/main/java/com/github/scalvet/demoactuator/management/CustomCheckHealthIndicator.java
8fe5e6d430f0095a98349bf435afa267c33e516d
[]
no_license
scalvetr/demo-actuator
0efd02c230ff426cc9bc213d8d1ab919ebde42fd
558feacc9fc8de6dbbb8698909417478228fffde
refs/heads/master
2022-12-28T00:51:06.510954
2020-10-06T15:17:08
2020-10-06T15:17:08
272,429,347
0
0
null
null
null
null
UTF-8
Java
false
false
750
java
package com.github.scalvet.demoactuator.management; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.actuate.health.Health; import org.springframework.boot.actuate.health.HealthIndicator; import org.springframework.stereotype.Component; @Component @Slf4j public class CustomCheckHealthIndicator implements HealthIndicator { private final CustomService service; @Autowired CustomCheckHealthIndicator(CustomService service) { this.service = service; } @Override public Health health() { log.info("isHealthy() -> {}", service.isHealthy()); return service.isHealthy() ? Health.up().build() : Health.down().build(); } }
dbd3aa6f485ef86409aa6294f6b04ab0b469dbf3
955bfaa39da32b7769a32f334814ec8d20531dbc
/src/main/java/mtime/mq/nsq/exceptions/DisconnectedException.java
1659ed93900c2d6373c869ff1efbf067a289cc9e
[]
no_license
moriartyy/nsq-client
1ebb7ac8902defd3924f0af3ea00e050611f6f41
d8bda8028683c95a2baab68e9b9fd4d587bde652
refs/heads/master
2023-07-10T15:37:44.417350
2021-08-08T06:53:54
2021-08-08T06:53:54
393,883,214
0
0
null
null
null
null
UTF-8
Java
false
false
188
java
package mtime.mq.nsq.exceptions; public class DisconnectedException extends NSQException { public DisconnectedException(String message, Throwable cause) { super(message, cause); } }
bf034dfde4fc2a5dce378db3e3d11e4d3358b361
d907ec89bfab568e675ddad3e1420549eff32d7c
/src/main/java/com/magic/video/param/VideoFilterListParam.java
b516e9e7138321c2b83c1e0a0f4cd310a03e335a
[]
no_license
Seraph1m2/magic_video
8a742e3e7c46b540cdef4d01fa06d225dc46c0bd
af7c8e6a1f96ec3144a2fd688d8f9aa9e8cad275
refs/heads/master
2021-09-25T06:03:12.623882
2018-10-19T02:45:32
2018-10-19T02:45:32
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,627
java
package com.magic.video.param; import java.io.Serializable; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @ApiModel(description="影视过滤列表param") public class VideoFilterListParam implements Serializable{ /** * */ private static final long serialVersionUID = 1L; @ApiModelProperty(value="当前页面,从0开始") private Integer pageNo; @ApiModelProperty(value="cid:3:电视剧4:电影5:综艺6:少儿") private Integer cid; @ApiModelProperty(value="地区") private String area; @ApiModelProperty(value="类型") private String cat; @ApiModelProperty(value="年份") private String year; @ApiModelProperty(value="0:少儿1:电影2:电视剧4:动漫") private Integer c; public Integer getPageNo() { return pageNo; } public Integer getCid() { return cid; } public String getArea() { return area; } public String getCat() { return cat; } public String getYear() { return year; } public void setPageNo(Integer pageNo) { this.pageNo = pageNo; } public void setCid(Integer cid) { this.cid = cid; } public void setArea(String area) { this.area = area; } public void setCat(String cat) { this.cat = cat; } public void setYear(String year) { this.year = year; } public Integer getC() { return c; } public void setC(Integer c) { this.c = c; } @Override public String toString() { return "VideoFilterListParam [pageNo=" + pageNo + ", cid=" + cid + ", area=" + area + ", cat=" + cat + ", year=" + year + ", c=" + c+ "]"; } }
590d47db121adf708d352c75621e77b4e22306ab
f68607acbe9cd1a7559d81242ec209c9c9653373
/app/src/main/java/com/bignerdranch/android/nerdmart/inject/NerdMartCommonModule.java
13c2a0da2b2fa7c3bf68d648e362e153e8eaeefc
[]
no_license
scottsimon/bnr-advanced-android-nerdmart
04af113ea35cc48e8d4d78abfc7ca60a475270fc
e5cb2b9fada73d64d8eef7a57cd4fe79c4c77df0
refs/heads/master
2021-01-14T13:40:28.334275
2015-10-21T21:53:40
2015-10-21T21:53:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,048
java
/* COPYRIGHT 1995-2015 ESRI TRADE SECRETS: ESRI PROPRIETARY AND CONFIDENTIAL Unpublished material - all rights reserved under the Copyright Laws of the United States. For additional information, contact: Environmental Systems Research Institute, Inc. Attn: Contracts Dept 380 New York Street Redlands, California, USA 92373 email: [email protected] */ package com.bignerdranch.android.nerdmart.inject; import android.content.Context; import com.bignerdranch.android.nerdmart.model.DataStore; import com.bignerdranch.android.nerdmart.viewmodel.NerdMartViewModel; import dagger.Module; import dagger.Provides; import javax.inject.Singleton; /** * Created by scotts on 10/21/15. */ @Module public class NerdMartCommonModule { @Provides @Singleton DataStore providesDataStore() { return new DataStore(); } @Provides NerdMartViewModel providesNerdMartViewModel(Context context, DataStore dataStore) { return new NerdMartViewModel(context, dataStore.getCachedCart(), dataStore.getCachedUser()); } }
1c6de6767a252457e2171aba1b23498aab212269
47ed2b8ad45349bf610cfd406bd35561d9ab4602
/src/main/java/com/rvy/repo/ProductRepository.java
4225078ebfcc2389fdf178253afbf3e1551e8532
[]
no_license
jyotijangid/product-service-gatling-test
572c58f8af0f41a3245873565472a215dadfe1d1
7576180f152b17a1a1395be4e3d61a0babfc13a5
refs/heads/main
2023-07-17T03:09:39.742279
2021-09-03T16:32:26
2021-09-03T16:32:26
402,834,134
0
0
null
null
null
null
UTF-8
Java
false
false
196
java
package com.rvy.repo; import org.springframework.data.jpa.repository.JpaRepository; import com.rvy.entity.Product; public interface ProductRepository extends JpaRepository<Product, Long>{ }
0b0b3b5f6b4ca279df0f691feb2377d4c5c9cffd
48e0f610454ea68bdd2b9c7648b5d4cf4f4caf61
/src/com/demo/common/utils/http/SSLClient.java
de6fafd0e7a8fd43bf7624a7c703d853467824be
[]
no_license
wuxw2569/top
18eb5be1807b3867045adc0e7542359545d286d0
98baedc6f6dac3a63b579f2d4e5ffcada55bbd90
refs/heads/master
2021-01-25T08:01:47.619741
2017-07-13T08:16:04
2017-07-13T08:16:04
93,704,811
0
0
null
null
null
null
UTF-8
Java
false
false
1,678
java
package com.demo.common.utils.http; import java.security.cert.CertificateException; import java.security.cert.X509Certificate; import javax.net.ssl.SSLContext; import javax.net.ssl.TrustManager; import javax.net.ssl.X509TrustManager; import org.apache.http.conn.ClientConnectionManager; import org.apache.http.conn.scheme.Scheme; import org.apache.http.conn.scheme.SchemeRegistry; import org.apache.http.conn.ssl.SSLSocketFactory; import org.apache.http.impl.client.DefaultHttpClient; //用于进行Https请求的HttpClient public class SSLClient extends DefaultHttpClient{ public SSLClient() throws Exception{ super(); SSLContext ctx = SSLContext.getInstance("TLSv1.1"); X509TrustManager tm = new X509TrustManager() { @Override public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException { } @Override public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException { } @Override public X509Certificate[] getAcceptedIssuers() { return null; } }; ctx.init(null, new TrustManager[]{tm}, null); SSLSocketFactory ssf = new SSLSocketFactory(ctx,SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER); ClientConnectionManager ccm = this.getConnectionManager(); SchemeRegistry sr = ccm.getSchemeRegistry(); sr.register(new Scheme("https", 443, ssf)); } }
7f9014a5374dfd20e77cfa7528253133a4433221
f00a8b228522f7535559d9105583b3d79d7d899e
/src/jayserv/example/shop/handler/GetLoginForm.java
3d081ef95fe1b3f6c1cfd2060f8a29827fe9079e
[]
no_license
conradplake/jayserv
32baa6f0f466cd9fceaadbc94431f195534ad2c9
a5ba912df09d37df133fb63e8b4e3bc3b9fcfc54
refs/heads/master
2021-05-02T08:44:25.456275
2020-07-15T17:50:34
2020-07-15T17:50:34
120,812,631
0
0
null
null
null
null
UTF-8
Java
false
false
1,356
java
package jayserv.example.shop.handler; import jayserv.example.shop.comp.GlobalCache; import jayserv.example.shop.comp.ShopGateway; import jayserv.example.shop.comp.ShopInputElements; import jayserv.html.DefaultHtmlComponent; import jayserv.html.Input; import jayserv.service.ServiceContext; import jayserv.service.ServiceException; public class GetLoginForm extends ResponseHandler implements ShopInputElements{ public GetLoginForm(){ super(GlobalCache.getInstance().get(ShopGateway.TEMPLATES_BASEDIR)+"login.html"); init(); } public void handleSecured(ServiceContext ctx) throws ServiceException{ try{ writePage(ctx.getResponse()); } catch(java.io.IOException ioe){ throw new ServiceException( "IOException: "+ioe.getMessage() ); } } private void init(){ Input input_username = new Input(); input_username.setId(USERNAME); input_username.setName(USERNAME); input_username.setType(Input.TYPE_TEXT); input_username.setSize(10); Input input_password = new Input(); input_password.setId(PASSWORD); input_password.setName(PASSWORD); input_password.setType(Input.TYPE_PASSWORD); input_password.setSize(10); DefaultHtmlComponent comp = new DefaultHtmlComponent( "loginputs" ); comp.addHtmlElement(input_username); comp.addHtmlElement(input_password); page.putHtmlComponent(comp); } }
c9d6f62341f2f7af49010a673d307db1a45189e6
e84c1675e6b7cac1d828d4f8fe175252358b89ab
/Labo3/src/com/uca/capas/domain/Student.java
784b944504db3c7a81470178c0f211943073436b
[]
no_license
CarlosBeltranP/laboratorio3
3eaa49804efd7d9965715f27f5aa0d408f845cbb
794382a925ce3f021f54ebfe3e2ab2973c096597
refs/heads/master
2020-05-18T11:10:38.870432
2019-05-01T05:22:40
2019-05-01T05:22:40
184,371,700
0
0
null
null
null
null
UTF-8
Java
false
false
1,100
java
package com.uca.capas.domain; public class Student { private String name; private String lastName; private String bDate; private String career; private String experience; public Student() {} public Student(String name, String lastName, String bDate, String career, String experience) { super(); this.name = name; this.lastName = lastName; this.bDate = bDate; this.career = career; this.experience = experience; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public String getbDate() { return bDate; } public void setbDate(String bDate) { this.bDate = bDate; } public String getCareer() { return career; } public void setCareer(String career) { this.career = career; } public String getExperience() { return experience; } public void setExperience(String experience) { this.experience = experience; } }
b364b0d3c3ec37117ac2b2acbf09ae396e446155
49f232f9f27a7ba09024d8a7c3a206b52ba7c8c5
/ssh/src/main/java/com/xujun/ssh/pojo/Users.java
fc495a62ed4b226eb72f21c0cf626b60fb0f60c5
[]
no_license
greatwwall/framework
2185b3e9946424f7192abe9a5124627c9a1f6100
3c6031888bdfd9d51c91c8626796cb64d7b9140f
refs/heads/master
2020-03-08T17:55:05.691158
2018-09-05T01:46:07
2018-09-05T01:46:07
128,281,480
0
0
null
null
null
null
UTF-8
Java
false
false
1,579
java
package com.xujun.ssh.pojo; import java.util.Set; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.JoinTable; import javax.persistence.ManyToMany; import javax.persistence.Table; @Entity @Table(name = "crm_user") public class Users { private Integer userId; private String uname; private String pwd; private String email; private Set<Role> roles; @Id @GeneratedValue(strategy = GenerationType.AUTO) @Column(name = "user_id") public Integer getUserId() { return userId; } public void setUserId(Integer userId) { this.userId = userId; } public String getUname() { return uname; } public void setUname(String uname) { this.uname = uname; } public String getPwd() { return pwd; } public void setPwd(String pwd) { this.pwd = pwd; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } @ManyToMany @JoinTable(name = "crm_user_role", joinColumns = {@JoinColumn(name = "user_id")}, inverseJoinColumns = {@JoinColumn(name = "role_id")}) public Set<Role> getRoles() { return roles; } public void setRoles(Set<Role> roles) { this.roles = roles; } }
5c0b6f004debd2c3f97d7ed07dabfc1d35612849
ebd95da05256d8018a9de142173139d5735d0cfe
/src/main/java/edu/bcm/dldcc/big/nursa/services/rest/local/oai/ItemRepositoryNursa.java
8045cd405244660f72cdd19545dfe987167db87b
[]
no_license
signaling-pathways-project/ominer
571442c51983078fdc617a12b4b88f36944acbab
d95703fb6c298f3ed68e96bf8f35aa02f730dbb7
refs/heads/master
2023-08-30T22:39:08.863025
2021-08-11T19:18:11
2021-08-11T19:18:11
207,378,651
0
0
null
2022-11-16T06:01:15
2019-09-09T18:35:51
Java
UTF-8
Java
false
false
12,778
java
package edu.bcm.dldcc.big.nursa.services.rest.local.oai; import edu.bcm.dldcc.big.nursa.model.oai.ItemNursa; import edu.bcm.dldcc.big.nursa.model.oai.MetadataNursa; import edu.bcm.dldcc.big.nursa.services.utils.QueryBuilder; import org.dspace.xoai.dataprovider.exceptions.IdDoesNotExistException; import org.dspace.xoai.dataprovider.exceptions.OAIException; import org.dspace.xoai.dataprovider.filter.ScopedFilter; import org.dspace.xoai.dataprovider.handlers.results.ListItemIdentifiersResult; import org.dspace.xoai.dataprovider.handlers.results.ListItemsResults; import org.dspace.xoai.dataprovider.model.InMemoryItem; import org.dspace.xoai.dataprovider.model.Item; import org.dspace.xoai.dataprovider.repository.ItemRepository; import org.dspace.xoai.model.oaipmh.Metadata; import javax.persistence.EntityManager; import javax.persistence.Query; import java.math.BigDecimal; import java.util.ArrayList; import java.util.Date; import java.util.List; /** * Created by alexey on 10/15/15. */ public class ItemRepositoryNursa implements ItemRepository { EntityManager entityManager; public ItemRepositoryNursa(EntityManager entityManager) { super(); this.entityManager = entityManager; } private static final String baseItemSelect = "SELECT one.doi, one.releaseDate, one.name, one.regmol as regMolList, one.authorslist, one.description," + " one.repo, one.pubmedid, two.tname as tissueNames from " + "(SELECT id, " + " name, " + " listagg(mlname, ',') WITHIN GROUP (ORDER by mlname) as regmol," + " AUTHORSLIST," + " DESCRIPTION," + " releaseDate," + " doi," + " REPO," + " pubmedid" + " from " + " (SELECT distinct (mlsn.name) as mlname, " + " dset.id as id," + " dset.NAME as name, "+ " article.AUTHORSLIST, " + " dset.DESCRIPTION, " + " dset.RELEASE_DATE as releaseDate," + " dset.DOI_DOI as doi," + " dset.REPO," + " r.pubmedid" + " FROM NURSADATASET dset" + " LEFT JOIN NURSADATASET_MOLECULE dsetmol on dset.ID = dsetmol.NURSADATASET_ID" + " LEFT JOIN MOLECULE ml on ml.ID = dsetmol.MOLECULES_ID" + " LEFT JOIN MOLSYNON mlsn on mlsn.ID = ml.OFFICIAL_ID" + " LEFT JOIN TMEXPERIMENT exp on dset.ID = exp.DATASET_ID" + " LEFT JOIN TISSUE t on t.ID = exp.TISSUESOURCE_ID" + " LEFT JOIN REFERENCE r on r.ID = dset.REFERENCE_ID" + " LEFT JOIN REFERENCEARTICLE article on article.PUBMEDID = r.ARTICLE_PUBMEDID" + " WHERE dset.ACTIVE = 1)" + " GROUP BY id, name, authorslist, description, releaseDate, doi, repo, pubmedid) one LEFT JOIN " + " (SELECT id," + " listagg(tname, ',') WITHIN GROUP (ORDER by tname) as tname FROM" + " (" + " select distinct(t.name) as tname, dset.ID" + " FROM NURSADATASET dset" + " inner join TMEXPERIMENT exp on dset.ID = exp.DATASET_ID" + " INNER JOIN TISSUE t on t.ID = exp.TISSUESOURCE_ID" + " WHERE dset.ACTIVE = 1)" + " GROUP BY id) two on one.id = two.id"; private ListItemIdentifiersResult getItemIdentifiersHelper(int offset, int length, Date from, Date until) { QueryBuilder builder = new QueryBuilder(); builder.from("NURSADATASET dset") .where("dset.ACTIVE = 1"); builder.setIfEmptyColumns("countDatapoints(*)"); if (null != from) { builder.where("dset.RELEASE_DATE >= :from").addNamedParameter("from", from); } if (null != until) { builder.where("dset.RELEASE_DATE <= :until").addNamedParameter("until", until); } Query countQuery = builder.buildQuery(entityManager, null); int count = ((BigDecimal)countQuery.getSingleResult()).intValue(); List result = builder.column("dset.DOI_DOI as identifier") .column("dset.RELEASE_DATE") .buildQuery(entityManager, "ItemIdentifierNursa") .setFirstResult(offset) .setMaxResults(length) .getResultList(); return new ListItemIdentifiersResult((count > offset + length), result,count); } private Metadata convertToXoaiMetada(MetadataNursa metodata) { InMemoryItem item = new InMemoryItem(); if (null != metodata.getDoi()) { item.with("identifier", metodata.getDoi()); } if (null != metodata.getName()) { item.with("title", metodata.getName()); } if (null != metodata.getAuthorslist()) { item.with("creator", metodata.getAuthorslist()); } if (null != metodata.getDescription()) { item.with("description", metodata.getDescription()); } item.with("publisher","Nuclear Receptor Signaling Atlas (NURSA)"); if (null != metodata.getReleaseDate()) { item.with("date", metodata.getReleaseDate()); } item.with("type","Dataset"); if(null != metodata.getRepo()) { item.with("source", metodata.getRepo()); } if (null != metodata.getPubmedid()) { item.with("relation", "PMID:"+metodata.getPubmedid()); } StringBuilder subjectBuilder = new StringBuilder("NURSA, Transcriptomine"); if (null != metodata.getRegMolList()) { subjectBuilder.append(", "); subjectBuilder.append(metodata.getRegMolList()); } item.with("subject", subjectBuilder.toString()); item.with("rights","Licensing: Use of this dataset is governed by a Creative Commons Attribution 3.0 license, which provides for sharing, adaptation and both non-commercial and commercial re-use, as long as this dataset is cited."); return item.getMetadata(); } private ListItemsResults getItemsHelper(int offset, int length, Date from, Date until) { QueryBuilder builder = new QueryBuilder(); StringBuilder finalSql = new StringBuilder(baseItemSelect); builder.setIfEmptyColumns("countDatapoints(*)") .from("NURSADATASET dset") .leftJoin("REFERENCE r on r.ID = dset.REFERENCE_ID") .leftJoin("REFERENCEARTICLE article on article.PUBMEDID = r.ARTICLE_PUBMEDID") .where("dset.ACTIVE = 1"); boolean whereSet = false; if (null != from) { whereSet = true; builder.where("dset.RELEASE_DATE >= :from").addNamedParameter("from", from); finalSql.append( " WHERE one.releaseDate >= :from "); } if (null != until) { if (whereSet) { finalSql.append(" and "); } else { finalSql.append(" where "); } finalSql.append(" one.releaseDate <= :until "); builder.where("dset.RELEASE_DATE <= :until").addNamedParameter("until", until); } Query countQuery = builder.buildQuery(entityManager, null); int count = ((BigDecimal)countQuery.getSingleResult()).intValue(); Query selectQuery = entityManager.createNativeQuery(finalSql.toString(), "MetadataNursa"); if(null != from ){ selectQuery.setParameter("from", from); } if ( null != until ) { selectQuery.setParameter("until", until); } List<MetadataNursa> result = selectQuery .setFirstResult(offset) .setMaxResults(length) .getResultList(); List<Item> items = new ArrayList<Item>(result.size()); for (MetadataNursa metodata : result) { ItemNursa item = new ItemNursa(convertToXoaiMetada(metodata)); item.setDatestamp(metodata.getReleaseDate()) .setIdentifier(metodata.getDoi()); items.add(item); } return new ListItemsResults((count > offset + length), items, count); } @Override public Item getItem(String identifier) throws IdDoesNotExistException, OAIException { Query query = entityManager.createNativeQuery(baseItemSelect + " WHERE one.doi = :doi","MetadataNursa"); query.setParameter("doi", identifier); // List<MetadataNursa> resultList = AutosuggestHelper.getResultListWithMapping(query, MetadataNursa.class); List resultList = query.getResultList(); if (resultList.size() == 0) { throw new IdDoesNotExistException("Did not find item with id"+identifier); } MetadataNursa metadataNursa = (MetadataNursa) resultList.get(0); ItemNursa item = new ItemNursa(convertToXoaiMetada(metadataNursa)); item.setDatestamp(metadataNursa.getReleaseDate()) .setIdentifier(metadataNursa.getDoi()); return item; } @Override public ListItemIdentifiersResult getItemIdentifiers(List<ScopedFilter> filters, int offset, int length) throws OAIException { return getItemIdentifiersHelper(offset, length, null, null); } @Override public ListItemIdentifiersResult getItemIdentifiers(List<ScopedFilter> filters, int offset, int length, Date from) throws OAIException { return getItemIdentifiersHelper(offset, length, from, null); } @Override public ListItemIdentifiersResult getItemIdentifiersUntil(List<ScopedFilter> filters, int offset, int length, Date until) throws OAIException { return getItemIdentifiersHelper(offset, length, null, until); } @Override public ListItemIdentifiersResult getItemIdentifiers(List<ScopedFilter> filters, int offset, int length, Date from, Date until) throws OAIException { return getItemIdentifiersHelper(offset, length, from, until); } // We dont support setSpec @Override public ListItemIdentifiersResult getItemIdentifiers(List<ScopedFilter> filters, int offset, int length, String setSpec) throws OAIException { return null; } // We dont support setSpec @Override public ListItemIdentifiersResult getItemIdentifiers(List<ScopedFilter> filters, int offset, int length, String setSpec, Date from) throws OAIException { return null; } // We dont support setSpec @Override public ListItemIdentifiersResult getItemIdentifiersUntil(List<ScopedFilter> filters, int offset, int length, String setSpec, Date until) throws OAIException { return null; } // We dont support setSpec @Override public ListItemIdentifiersResult getItemIdentifiers(List<ScopedFilter> filters, int offset, int length, String setSpec, Date from, Date until) throws OAIException { return null; } @Override public ListItemsResults getItems(List<ScopedFilter> filters, int offset, int length) throws OAIException { return getItemsHelper(offset, length, null, null); } @Override public ListItemsResults getItems(List<ScopedFilter> filters, int offset, int length, Date from) throws OAIException { return getItemsHelper(offset, length, from, null); } @Override public ListItemsResults getItemsUntil(List<ScopedFilter> filters, int offset, int length, Date until) throws OAIException { return getItemsHelper(offset, length, null, until); } @Override public ListItemsResults getItems(List<ScopedFilter> filters, int offset, int length, Date from, Date until) throws OAIException { return getItemsHelper(offset, length, from, until); } @Override public ListItemsResults getItems(List<ScopedFilter> filters, int offset, int length, String setSpec) throws OAIException { return null; } @Override public ListItemsResults getItems(List<ScopedFilter> filters, int offset, int length, String setSpec, Date from) throws OAIException { return null; } @Override public ListItemsResults getItemsUntil(List<ScopedFilter> filters, int offset, int length, String setSpec, Date until) throws OAIException { return null; } @Override public ListItemsResults getItems(List<ScopedFilter> filters, int offset, int length, String setSpec, Date from, Date until) throws OAIException { return null; } }
4185686bcff6215a88e190c03b854a418f8d3ab7
e66f1899f498a9ad93883269c100a75a9988cf9e
/Codility/L1_BinaryGap.java
11ed367d5a7aa26d4bfe716b5d3a63fc24032c1e
[]
no_license
vannahz/Code-in-Java
b4401a8a2cd662836020b4fad423fe532333d29c
485817a9164091830fcbdf13ffea1d7c7afb4770
refs/heads/master
2020-06-17T00:03:01.760627
2016-12-11T08:13:22
2016-12-11T08:13:22
75,055,697
0
0
null
null
null
null
UTF-8
Java
false
false
638
java
class L1_BinaryGap { public static int solution(int N) { String str = Integer.toBinaryString(N) ; String[] bits = str.split(""); int max = 0; int st = 0, end = 0; int div = 0; for(int i=1; i<bits.length; i++){ if(bits[i-1].equals("1") && bits[i].equals("0")){ st = i-1; }else if(bits[i-1].equals("0") && bits[i].equals("1")){ end = i; div = end - st - 1; if(max < div) max = div; } } return max; } public static void main(String[] args) { System.out.println(solution(1041)); } }
ec5ad66c4ef66e2905a6229e4f5b56631acd750e
dfec00b90fe92c3900918635c897f2baf9afe297
/src/main/java/com/cware/back/service/system/logString.java
79b58f7de9b45d0dc0482a3040c238963c44a678
[]
no_license
ninofelino11/felinodartmedia
33ebbc051a74368e860b57f895a89fbc74c3b679
b9219a6c149f22f691ac7931dc34d618b12ae794
refs/heads/master
2020-05-30T21:45:41.489289
2014-08-07T23:35:02
2014-08-07T23:35:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
291
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.cware.back.service.system; /** * * @author ni */ class logString { }
[ "ni@dartmedia" ]
ni@dartmedia
28cccbf5ce45317dead6b76529aeae7d6b42649f
82a47fadfa1877c40d4bd810f76a376e78ebe542
/AntiCheat/src/main/java/me.rellynn.foxmc.anticheat/listeners/AntiCheatManager.java
e6e4d75e5e1e13bd2a5590f728f2aebc4f1bac96
[ "Apache-2.0" ]
permissive
steve4744/foxmc
8ba3c5e132a1f0abab1a9791d03d7e5082c312da
d9232812ffd541b454f2135f20296f69e3fea8cc
refs/heads/master
2020-07-25T23:48:47.178203
2019-03-23T00:47:09
2019-03-23T00:47:09
null
0
0
null
null
null
null
UTF-8
Java
false
false
232
java
package me.rellynn.foxmc.anticheat.listeners; import me.rellynn.foxmc.api.anticheat.AntiCheatHandler; /** * Created by gwennaelguich on 13/08/2017. * FoxMC Network. */ public class AntiCheatManager extends AntiCheatHandler { }
5666b818746e8e302f035e807be2622164a53dab
2c8a899ebc9c782a78bdec8af390a659773e4173
/PlayGame.java
6d01ec5351e64592ee122230877a924743283e9f
[]
no_license
cscheye/java-games
e35001b0a82ee69f758a5891616579c278559012
e7b93e73d49f111b78c21a3d0316755363a95c8d
refs/heads/master
2021-05-05T03:08:00.316504
2018-02-01T03:08:08
2018-02-01T03:08:08
119,775,508
0
0
null
null
null
null
UTF-8
Java
false
false
161
java
public class PlayGame { public static void main(String[] args) { System.out.println("Let's play a game!"); MadLib ml = new MadLib(); ml.play(); } }
de2123075444c1292729467c0872a0e1dbaae047
0af8b92686a58eb0b64e319b22411432aca7a8f3
/single-large-project/src/main/java/org/gradle/test/performancenull_388/Productionnull_38701.java
cbe194a17c05ca3352439b357c96f3e551824ab8
[]
no_license
gradle/performance-comparisons
b0d38db37c326e0ce271abebdb3c91769b860799
e53dc7182fafcf9fedf07920cbbea8b40ee4eef4
refs/heads/master
2023-08-14T19:24:39.164276
2022-11-24T05:18:33
2022-11-24T05:18:33
80,121,268
17
15
null
2022-09-30T08:04:35
2017-01-26T14:25:33
null
UTF-8
Java
false
false
588
java
package org.gradle.test.performancenull_388; public class Productionnull_38701 { private final String property; public Productionnull_38701(String param) { this.property = param; } public String getProperty() { return property; } private String prop0; public String getProp0() { return prop0; } public void setProp0(String value) { prop0 = value; } private String prop1; public String getProp1() { return prop1; } public void setProp1(String value) { prop1 = value; } }
21e8d1b17475d1a1ebc927e6c4f6534a0b397dcd
d58fefa4df0147ba5231d31c82765c58936bba67
/src/main/java/mil/af/dgs1sdt/fritz/Models/RenameModel.java
f6d12b4e661dfa9ba487929e33795ad85d414668
[]
no_license
Chair4ce/fritz
bf46f3a521665fcf9406969cfc472996621a6f57
7b4b5255787a5cb27ea2c3b751e78145e59b69bb
refs/heads/master
2023-01-20T13:49:35.822394
2020-12-02T14:56:05
2020-12-02T14:56:05
317,895,822
1
0
null
null
null
null
UTF-8
Java
false
false
742
java
package mil.af.dgs1sdt.fritz.Models; import lombok.Data; @Data public class RenameModel { private String _oldName; private String _newName; private boolean _deleted; public RenameModel(String _oldName, String _newName, boolean _deleted) { this._oldName = _oldName; this._newName = _newName; this._deleted = _deleted; } public String getOldName() { return this._oldName; } public String getNewName() { return this._newName; } public boolean getDeleted() { return this._deleted; } public void setOldName(String name) { this._oldName = name; } public void setNewName(String name) { this._newName = name; } public void setDeleted(boolean deleted) { this._deleted = deleted; } }
4e92ca19017ca0ba00d97ab2e45021417c12097c
91eddbf3ae9fed0a07785b59ffe77e35870a5e4e
/duba-auth/src/main/java/com/tingyu/duba/auth/controller/TokenController.java
fb88089661c2dc4ff8bf33f6774ff9679ebf2881
[]
no_license
duba-bbs/duba
b745a66f9b3ece53eb19b0aa3ffe53f9246e5f36
0ab8c509c267977485d28597c74902ea2bd800ee
refs/heads/main
2023-04-16T05:15:56.613287
2021-04-20T08:41:34
2021-04-20T08:41:34
357,232,851
1
0
null
null
null
null
UTF-8
Java
false
false
2,009
java
package com.tingyu.duba.auth.controller; import javax.servlet.http.HttpServletRequest; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; import com.tingyu.duba.auth.form.LoginBody; import com.tingyu.duba.auth.service.SysLoginService; import com.tingyu.duba.common.core.domain.R; import com.tingyu.duba.common.core.utils.StringUtils; import com.tingyu.duba.common.security.service.TokenService; import com.tingyu.duba.system.api.model.LoginUser; /** * token 控制 */ @RestController public class TokenController { @Autowired private TokenService tokenService; @Autowired private SysLoginService sysLoginService; @PostMapping("login") public R<?> login(@RequestBody LoginBody form) { // 用户登录 LoginUser userInfo = sysLoginService.login(form.getUsername(), form.getPassword()); // 获取登录token return R.ok(tokenService.createToken(userInfo)); } @DeleteMapping("logout") public R<?> logout(HttpServletRequest request) { LoginUser loginUser = tokenService.getLoginUser(request); if (StringUtils.isNotNull(loginUser)) { String username = loginUser.getUsername(); // 删除用户缓存记录 tokenService.delLoginUser(loginUser.getToken()); // 记录用户退出日志 sysLoginService.logout(username); } return R.ok(); } @PostMapping("refresh") public R<?> refresh(HttpServletRequest request) { LoginUser loginUser = tokenService.getLoginUser(request); if (StringUtils.isNotNull(loginUser)) { // 刷新令牌有效期 tokenService.refreshToken(loginUser); return R.ok(); } return R.ok(); } }
a5fe40c337fe8ab4efa27b366965183b6551a8f0
93837a1c3a25a80c355878442269d97e6afff096
/src/main/java/com/tc/shop/service/OaVideoTypeService.java
07af3a1e0144bae64caeda7d7877395a0d54485e
[]
no_license
Gemmmm/ShopAdmin
fefef4ff2cddd2b86e34a66317bf1aedc504786d
305bbdc3a7e841c883d50cf628e9d4fecd77546d
refs/heads/main
2023-02-10T18:01:53.758072
2021-01-07T02:06:07
2021-01-07T02:06:07
327,476,629
0
0
null
null
null
null
UTF-8
Java
false
false
331
java
package com.tc.shop.service; import com.tc.shop.model.OaVideoType; import java.util.List; public interface OaVideoTypeService { List<OaVideoType> getByOaId(Integer oaId); int deleteById(Integer id); int insert(OaVideoType videoType); OaVideoType getById(Integer id); int modify(OaVideoType videoType); }
e46d2be9b3512815e9e79bc622fd9730c64b9b4f
c485bfe4fa3033e52b67e356358a5c5962bfc4d2
/Practice/src/practice11/PTra11_02.java
d2df6ea229a113161744c2c718759f6ef1fc6134
[]
no_license
NozakiTatsuya/JavaBasic
1997786e9b659fa92817c3e8825e7739d35f1f59
b99f2f15a89549c2527d1cc4c0b6b750b6a9f3ac
refs/heads/master
2020-04-07T06:43:58.826637
2019-02-05T04:42:18
2019-02-05T04:42:18
158,148,836
0
0
null
null
null
null
UTF-8
Java
false
false
894
java
package practice11; /* * PTra11_02.java * 作成 LIKEIT 2017 *------------------------------------------------------------ * Copyright(c) Rhizome Inc. All Rights Reserved. */ public class PTra11_02 { public static void main(String[] args) { // ★ ReadFileClassのクラスメソッドreadBookDataFile()を使い、本情報を取得します Book[] booklist= FileReaderClass.readBookDataFile(); System.out.println("探したい本のタイトル(又はその一部)を入力してください"); String input = new java.util.Scanner(System.in).nextLine(); // ★ ユーザが入力した文字列が、本情報のタイトル一部に含まれていた場合は、その本情報を出力してください for (int i=0; i<booklist.length;i++) { if(booklist[i].title.contains(input)) { System.out.println(booklist[i] .dispBookInfo()); } } } }
[ "socc" ]
socc
53dcab11d2a5c9644a1eb3c9020da97fe91b06c2
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
/data_defect4j/preprossed_method_corpus/Lang/23/org/apache/commons/lang3/builder/CompareToBuilder_append_588.java
8f5c1c35cdf1f0890c21af30dfb88e4689822da5
[]
no_license
hvdthong/NetML
dca6cf4d34c5799b400d718e0a6cd2e0b167297d
9bb103da21327912e5a29cbf9be9ff4d058731a5
refs/heads/master
2021-06-30T15:03:52.618255
2020-10-07T01:58:48
2020-10-07T01:58:48
150,383,588
1
1
null
2018-09-26T07:08:45
2018-09-26T07:08:44
null
UTF-8
Java
false
false
2,879
java
org apach common lang3 builder assist implement link java lang compar compar compareto object method consist code equal object code code hashcod code built link equal builder equalsbuild link hash code builder hashcodebuild object compar equal code equal object code compar equal code compar compareto object code relev field includ calcul comparison deriv field field order code compar compareto object code code equal object code write code pre class myclass string field1 field2 field3 compar compareto object class myclass class myclass class myclass compar builder comparetobuild append super appendsup compar compareto append field1 class myclass field1 append field2 class myclass field2 append field3 class myclass field3 comparison tocomparison pre altern link reflect compar reflectioncompar object object reflect compar reflectioncompar method reflect determin field append field code reflect compar reflectioncompar code link java lang reflect access object accessibleobject set access setaccess bypass normal access control check fail secur manag permiss set correctli slower append explicitli typic implement code compar compareto object code code reflect compar reflectioncompar code pre compar compareto object compar builder comparetobuild reflect compar reflectioncompar pre java lang compar java lang object equal object java lang object hash code hashcod equal builder equalsbuild hash code builder hashcodebuild author apach softwar foundat author href mailto steve downei netfolio steve downei author gari gregori author pete gieser version compar builder comparetobuild builder integ append code builder code comparison code code handl nan infin code code compat hash code gener code hash code builder hashcodebuild code param lh left hand param rh hand chain append call compar builder comparetobuild append lh rh comparison comparison doubl compar lh rh
a014a880d0cfcf237297bc887bf1f8d990af3b62
642f054b6a4832a25c9102d0b303933b6a375f2d
/test/client/ClientTest.java
d3259571bca1ee09d304a58c25a05d01788e5238
[]
no_license
vigneetsompura/AgarIO
34598066d0ea488969a2700fc3f86af1517fd6ae
663d2c87d97c9d07559780f29bea1c4e40fc8b9b
refs/heads/master
2020-05-06T20:12:00.237381
2019-04-18T18:48:28
2019-04-18T18:48:28
180,226,124
0
0
null
null
null
null
UTF-8
Java
false
false
165
java
package client; import org.junit.jupiter.api.Test; public class ClientTest { @Test public void test1() { System.out.println("Test case."); } }
6d70b67f38b562c7276ebea49c613acca37b2da5
8251bed8e6f763939ca76e18c6e73919d09ea059
/src/com/hackerrank/java/MinMaxSum.java
55ef31ad8a5a77801fc3e133385e15beeacbccdc
[]
no_license
jabongg/javaCollections
5c7d74f03427484762710cdea0f1dcee5becbd11
d423a459c0939c02e62871ed2474767ba8bbbd29
refs/heads/master
2021-01-13T12:52:11.824768
2017-05-17T05:55:05
2017-05-17T05:55:05
78,338,582
0
0
null
null
null
null
UTF-8
Java
false
false
1,705
java
package com.hackerrank.java; /** * Created by ejangpa on 11/11/2016. */ import java.lang.System; import java.util.Arrays; import java.util.Scanner; public class MinMaxSum { public static void main(String[] args) { Scanner in = new Scanner(System.in); int f = in.nextInt(); int b = in.nextInt(); int c = in.nextInt(); int d = in.nextInt(); int e = in.nextInt(); long a[] = {f,b,c,d,e}; boolean isElementPostive = true; for(int i = 0; i < a.length; i++) { if(a[i] < 1) { isElementPostive = false; break; } } if(isElementPostive) { long min = min(a); long max = max(a); sum(a, min , max); } else { System.out.print("some array element is < 1"); } } // // // getting sum min and max static void sum(long a[], long min, long max) { long sum = 0; for(int i = 0; i < a.length; i++) { sum = sum + a[i]; } long maxSum = sum - min; long minSum = sum - max; System.out.println(minSum + " " + maxSum); } // getting min value static long min(long a[]) { long min = Integer.MAX_VALUE; for(int i = 0; i < a.length; i++) { if(a[i] < min) { min = a[i]; } } return min; } //getting max value static long max(long a[]) { long max = Integer.MIN_VALUE ; for(int i = 0; i < a.length; i++) { if(a[i] > max) { max = a[i]; } } return max; } }
5846c0126e13ddcae4ad9fcfd048583e18165840
c5e9c53e9e610bc3d761bd2cf681082b826f7fc7
/src/main/java/com/artarkatesoft/learncamel/domain/User.java
8ad7ec4e2160514a125e4edc1816b82c75d325ac
[]
no_license
artshishkin/learn-camel-simple-route
7277e312d66b87bda097a9d3890072755eedcc0a
4a4598fda70612c39043c2cf5862aa7a87e9ad8a
refs/heads/master
2022-12-25T12:01:49.283679
2020-10-03T20:42:43
2020-10-03T20:46:51
299,866,655
0
1
null
2020-10-03T20:46:52
2020-09-30T09:12:34
Java
UTF-8
Java
false
false
2,252
java
package com.artarkatesoft.learncamel.domain; import org.apache.camel.dataformat.bindy.annotation.CsvRecord; import org.apache.camel.dataformat.bindy.annotation.DataField; import org.apache.camel.dataformat.bindy.annotation.Link; import java.util.Objects; @CsvRecord(separator = ",", skipFirstLine = true, generateHeaderColumns = true) public class User { @DataField(pos = 1, columnName = "id") private String id; @DataField(pos = 2, columnName = "first_name") private String firstName; @DataField(pos = 3, columnName = "last_name") private String lastName; @Link private Address address; public User() { } public User(String id, String firstName, String lastName, Address address) { this.id = id; this.firstName = firstName; this.lastName = lastName; this.address = address; } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public Address getAddress() { return address; } public void setAddress(Address address) { this.address = address; } @Override public String toString() { return "User{" + "id='" + id + '\'' + ", firstName='" + firstName + '\'' + ", lastName='" + lastName + '\'' + ", address=" + address + '}'; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; User user = (User) o; return Objects.equals(id, user.id) && Objects.equals(firstName, user.firstName) && Objects.equals(lastName, user.lastName) && Objects.equals(address, user.address); } @Override public int hashCode() { return Objects.hash(id, firstName, lastName, address); } }
100ddfd503fd3cfd3934b3f72a32d2fe9b123f77
b553d5097e3fced4aa238ebcecfd957975c70778
/P7/src/IMaze.java
0f2c54a0deeb6e18d15d099de1019b699e894ad7
[]
no_license
aleal01/cs161
29c3381cc4bd7d5e1bd1ebd68166944a163bf3de
c2b49f296dac49caf074b27e5dcf845dd9f44548
refs/heads/master
2021-01-11T06:48:11.402631
2017-01-20T19:28:05
2017-01-20T19:28:05
68,548,392
0
0
null
null
null
null
UTF-8
Java
false
false
1,333
java
public interface IMaze { public char[][] readFile(String filename); /* Precondition - filename set to file containing map of the maze. * Postcondition - two dimensional char array holding a map of the maze * Postcondition - returns null if file not found */ public int[] findStart(char[][] maze); /* Precondition - maze array initialized to a valid maze * Postcondition - array containing row, column of location of S * returned. Ex. if S is in maze[1][2]. the return * array is {1, 2} * Postcondition - returns null if no S found */ public String findPath(char[][] maze, int[]startPosition); /* Precondition - maze array initialize to a valid maze * Precondition - StartPosition contains row, column of location of S * Ex. if S is in maze[1][2], the startPosition * array is {1, 2} * Postcondition - returns a String composed of the appropriate * characters from 'U', 'R', 'D', 'L', and the final 'G', * indicating the solution path. * Postcondition - successful path marked with '.' characters in maze * array from 'S' to the final 'G', indicating the * solution path. */ public String printMaze(char[][] maze); /* * Postcondition - returns a String representation of the map character array * (complete with end of line characters). */ }
567826ee7aeeddacd3b18dfcf532695cca03dc84
b9b720eb57501b92670eef35d26bfae4b837b7f1
/2019.01_3J_Filmes/src/br/mackenzie/ps2/filmes/Filme.java
c2acb33d81499d0008a998779b9645896a215d3b
[]
no_license
joaquimp/Mack_PS2_Projetos
17090f298758c1292bc4e09f8a46a6561b374679
50c6c1e1e9250b224f4a1e1750f35882b34f3ea5
refs/heads/master
2020-05-20T07:03:15.948962
2019-05-18T21:18:45
2019-05-18T21:18:45
185,442,886
0
3
null
null
null
null
UTF-8
Java
false
false
1,726
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package br.mackenzie.ps2.filmes; /** * * @author joaquim */ public class Filme { private int id; private String titulo; private String genero; private int minutos; public Filme(){ titulo = ""; genero = ""; } public Filme(int id, String titulo, String genero, int minutos) { this.id = id; this.titulo = titulo; this.genero = genero; this.minutos = minutos; } public Filme(String titulo, String genero, int minutos) { this.titulo = titulo; this.genero = genero; this.minutos = minutos; } /** * @return the id */ public int getId() { return id; } /** * @param id the id to set */ public void setId(int id) { this.id = id; } /** * @return the titulo */ public String getTitulo() { return titulo; } /** * @param titulo the titulo to set */ public void setTitulo(String titulo) { this.titulo = titulo; } /** * @return the genero */ public String getGenero() { return genero; } /** * @param genero the genero to set */ public void setGenero(String genero) { this.genero = genero; } /** * @return the minutos */ public int getMinutos() { return minutos; } /** * @param minutos the minutos to set */ public void setMinutos(int minutos) { this.minutos = minutos; } }
23dcfa3c43b463567bb00ee18c972ccb35725474
6f3cc02bfe289625061f974c865238816d23a6bc
/GCH/src/Control/ValidarRegistroPersonalMedico.java
e70d015a80306d6c3d2bceb0160c479762b5213e
[]
no_license
Alerodriguezmar/GCH
88f66b865d22536a2be785720082fd961eccab6b
8731fc59366d4eacd4410f07e53a905f61f23972
refs/heads/master
2022-11-08T03:36:36.274355
2020-06-23T15:15:35
2020-06-23T15:15:35
264,301,961
0
0
null
2020-05-20T04:10:05
2020-05-15T21:24:19
Java
UTF-8
Java
false
false
3,853
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 Control; import Entidad.PersonalMedico; /** * * @author Diego Irreño */ public class ValidarRegistroPersonalMedico { public ValidarRegistroPersonalMedico() { } public String VerificarRegistroPersonalMedico(PersonalMedico personal) { if(!VerificarLongitudNombre1personalMedico(personal.getNombre1())){ return("Longitud primer nombre incorrecta"); } if(!VerificarLongitudNombre2personalMedico(personal.getNombre2())){ return("Longitud segundo nombre incorrecta"); } if(!VerificarLongitudApellido1personalMedico(personal.getApellido1())){ return("Longitud primer apellido incorrecta"); } if(!VerificarLongitudApellido2personalMedico(personal.getApellido2())){ return("Longitud segundo apellido incorrecta"); } if(!VerificarLongitudNIpersonalMedico(Integer.toString(personal.getId()))){/*Añadir verificar que sean numeros*/ return("Identificación incorrecta"); } if(!VerificarCargopersonalMedico(personal.getCargo())){/*Añadir verificar que sean numeros*/ return("Longitud Cargo incorrecta"); } if(!VerificarLongitudReTHUSpersonalMedico(personal.getReTHUS())){/*Añadir verificar que sean numeros*/ return("Longitud ReTHUS incorrecta"); } if(!VerificarLongitudEmailpersonalMedico(personal.getEmail())){ return("Longitud email incorrecta"); } if(!VerificarLongitudCelularpersonalMedico(personal.getCelular())){ return("Longitud Celular incorrecta"); } if(!VerificarLongitudUsuariopersonalMedico(personal.getUsuario())){ return("Longitud usuario incorrecta"); } if(!VerificarLongitudContraseniapersonalMedico(personal.getContrasenia())){ return("Longitud contraseña incorrecta"); } return("Datos ingresados correctamente"); } public boolean VerificarLongitudNombre1personalMedico(String nombre1){ return(nombre1.length() >= 2 && nombre1.length() < 20); } public boolean VerificarLongitudNombre2personalMedico(String nombre2){ return(nombre2.length() >= 0 && nombre2.length() < 20); } public boolean VerificarLongitudApellido1personalMedico(String apellido1){ return(apellido1.length() >= 2 && apellido1.length() < 33); } public boolean VerificarLongitudApellido2personalMedico(String apellido2){ return(apellido2.length() >= 0 && apellido2.length() < 33); } public boolean VerificarLongitudNIpersonalMedico(String ni){ return(ni.length() >= 5 && ni.length() < 13); } public boolean VerificarLongitudCelularpersonalMedico(String celular){ return(celular.length() >= 5 && celular.length() < 14); } public boolean VerificarLongitudEmailpersonalMedico(String email){ return(email.length() >= 12 && email.length() < 30); } public boolean VerificarLongitudUsuariopersonalMedico(String usuario){ return(usuario.length() >= 4 && usuario.length() < 33); } public boolean VerificarLongitudContraseniapersonalMedico(String contrasenia){ return(contrasenia.length() >= 3 && contrasenia.length() < 17); } public boolean VerificarCargopersonalMedico(String cargo){ return(cargo.length() >= 2 && cargo.length() < 32); } public boolean VerificarLongitudReTHUSpersonalMedico(String reTHUS){ return(reTHUS.length() >= 2 && reTHUS.length() < 32); } }
[ "user@DESKTOP-JF6J7RS" ]
user@DESKTOP-JF6J7RS
5bdb83d1a0c8290c55c5a00c2bf139ee02dd4fd9
51de433eeb07665e739fa7649a7d41c8e9a3d469
/SpaceGame/src/src/main/gameobjects/EnemyBullet.java
c01c02c1024700543d444cca5c5f8bdca13cbe22
[]
no_license
AleksGrig/SpaceGame
8ef35abc2a21d09b09f1d1fef38366f47333385c
a0336bd825440dab39e87d0aeb8a19e6e4fcd63d
refs/heads/master
2020-05-03T13:21:30.905297
2019-04-09T05:22:28
2019-04-09T05:22:28
178,650,874
0
0
null
2019-04-09T05:22:29
2019-03-31T06:23:20
Java
UTF-8
Java
false
false
635
java
package src.main.gameobjects; import java.awt.Graphics; import src.interfaces.EntityEnemyBullet; import src.main.Controller; import src.main.Game; import src.main.GameObject; import src.main.Textures; public class EnemyBullet extends GameObject implements EntityEnemyBullet{ public EnemyBullet(double x, double y) { super(x, y); } public void tick() { y += 10; Controller.enemyBulletCollides(this); if(y > Game.HEIGHT * Game.SCALE ) { Controller.removeEntity(this); } } public void render(Graphics g) { g.drawImage(Textures.enemyBullet, (int)x, (int)y, null); } }
496a17a7bd9883a77ffaa8936609f7fe9fd03ed7
18ae7f67a749a5cfed36163b750f0caf1f514dcf
/src/main/java/com/onshape/api/responses/DocumentsExportElementPostJsonResponse.java
21eb8383a3d00648a6a07d606662e003db317964
[ "MIT" ]
permissive
Change2improve/java-client
d936d35d20d8dbb192d2470f096d06babd034b65
5da89caf8c678342376b67eafd6a0fba6289a41a
refs/heads/master
2020-04-11T05:50:54.304309
2018-11-01T14:31:47
2018-11-01T14:31:47
161,561,752
0
0
null
null
null
null
UTF-8
Java
false
false
2,450
java
// The MIT License (MIT) // // Copyright (c) 2018 - Present Onshape Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // package com.onshape.api.responses; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.onshape.api.Onshape; import com.onshape.api.exceptions.OnshapeException; import java.lang.Override; import java.lang.String; import javax.validation.constraints.NotNull; /** * Response object for exportElementPostJson API endpoint. * &copy; 2018 Onshape Inc. */ @JsonIgnoreProperties( ignoreUnknown = true ) public final class DocumentsExportElementPostJsonResponse { /** * Link to URI to GET to initiate the export */ @JsonProperty("href") @NotNull String href; /** * Refresh this page of results * @param onshape The Onshape client object. * @return Updated response. * @throws OnshapeException On HTTP or serialization error. */ public final DocumentsExportElementPostJsonResponse refresh(Onshape onshape) throws OnshapeException { return onshape.get(href, DocumentsExportElementPostJsonResponse.class); } /** * Get Link to URI to GET to initiate the export * * @return Link to URI to GET to initiate the export * */ public final String getHref() { return this.href; } @Override public String toString() { return Onshape.toString(this); } }
0c6077d9009f37ca020943a8876cf8aa64ba22b2
d9b14f351f668b004c4cb05a10d09e7e85243317
/src/BaekJoon/_Before_Tagging/P1918_2.java
742e669b356698a816dc8f914c4b39dcb7be89f3
[]
no_license
nn98/Algorithm
262cbe20c71ff9b5de292c244b95a2a0c25e5bd7
55b6db19cb9f2aa5c5056f5cabd2b22715b682fd
refs/heads/main
2023-08-17T04:39:41.236707
2023-08-16T13:04:34
2023-08-16T13:04:34
178,701,901
0
0
null
null
null
null
UTF-8
Java
false
false
2,184
java
package BaekJoon._Before_Tagging; import java.util.Scanner; public class P1918_2 { static class Node{ String v; Node n,p; Node(String v){ this.v=v; n=null; p=null; } void push(String v) { if(this.n==null) { this.n=new Node(v); this.n.p=this; } else this.n.push(v); } String pop() { String r=this.v; if(this.p!=null) this.p.n=null; return r; } } static boolean isCol() { return col!=null; } static Node oper=null,per=null,col=null,save=null; public static void main(String[] args) { // TODO Auto-generated method stub Scanner s=new Scanner(System.in); //A*(B+C) String[] t=s.nextLine().split(""); for(String i:t) { switch(i) { case "+": System.out.println("add "+i); if(isCol()) { if(save==null) save=new Node(i); else save.push(i); } else { if(per==null) per=new Node(i); else per.push(i); } break; case "-": System.out.println("add "+i); if(isCol()) { System.out.println("col is "); if(save==null) save=new Node(i); else save.push(i); } else { System.out.println("col emp "); if(per==null) per=new Node(i); else per.push(i); } break; case "*": System.out.println("add "+i); if(isCol()) { if(save==null) save=new Node(i); else save.push(i); } else { if(per==null) per=new Node(i); else per.push(i); } break; case "/": System.out.println("add "+i); if(isCol()) { if(save==null) save=new Node(i); else save.push(i); } else { if(per==null) per=new Node(i); else per.push(i); } break; case "(": System.out.println("add "+i); if(!isCol()) col=new Node(i); else col.push(i); break; case ")": System.out.println(") - pop ( "); col.pop(); oper.push(save.pop()); break; default: System.out.println("add "+i); if(oper==null) oper=new Node(i); else oper.push(i); } } Node n=per; while(n.n!=null) { System.out.print(n.v); n=n.n; } while(n.p!=null) { oper.push(n.v); n=n.p; } n=oper; while(n!=null) { System.out.print(n.v); n=n.n; } } }
b707fcb8eb1a2844860862da61ef9999f47187cf
2b52b5663ae2c9168bb054d910c6ca5ff807bbd7
/dk.klevang.mathInterpreter/src-gen/dk/klevang/mathInterpreter/impl/MinusImpl.java
c1f52eb1db45cfbb5bf4c511c5b2f8efd6ad178f
[]
no_license
lHunniche/MathInterpreter
d743f32663595a0afcfc2bbab84a51925861164a
f95690e0c53dd9ee4c80f180e5376df9fb3f8974
refs/heads/master
2021-04-08T11:41:37.870457
2020-03-22T09:47:38
2020-03-22T09:47:38
248,772,492
0
0
null
null
null
null
UTF-8
Java
false
false
751
java
/** * generated by Xtext 2.20.0 */ package dk.klevang.mathInterpreter.impl; import dk.klevang.mathInterpreter.MathInterpreterPackage; import dk.klevang.mathInterpreter.Minus; import org.eclipse.emf.ecore.EClass; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Minus</b></em>'. * <!-- end-user-doc --> * * @generated */ public class MinusImpl extends ExpImpl implements Minus { /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected MinusImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return MathInterpreterPackage.Literals.MINUS; } } //MinusImpl