blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
332
content_id
stringlengths
40
40
detected_licenses
listlengths
0
50
license_type
stringclasses
2 values
repo_name
stringlengths
7
115
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
557 values
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
77.7k
fork_events_count
int64
0
48k
gha_license_id
stringclasses
17 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
82 values
src_encoding
stringclasses
28 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
7
5.41M
extension
stringclasses
11 values
content
stringlengths
7
5.41M
authors
listlengths
1
1
author
stringlengths
0
161
60a496a738dcda049d37a96e7d0c696a2ed62f9e
f29efcd3a16a060bce3184d21d3721f8a12bf228
/src/main/java/br/com/acme/tasklist/controller/TaskController.java
3fe4bb9eab4c6b1fee525375695006941dd13354
[]
no_license
carlosantq/tasklist
b17b6ea1c73eb8969f896e13a067228f4d3ba8ad
bcbb2566711eac41a918bbe9781b0d3840c2447c
refs/heads/master
2022-11-15T00:23:01.625075
2020-07-10T03:11:47
2020-07-10T03:11:47
278,205,514
0
0
null
null
null
null
UTF-8
Java
false
false
2,997
java
package br.com.acme.tasklist.controller; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import br.com.acme.tasklist.model.Task; import br.com.acme.tasklist.service.TaskListService; import br.com.acme.tasklist.service.TaskService; @RestController @RequestMapping("/api/task") public class TaskController { @Autowired private TaskService taskService; @Autowired private TaskListService taskListService; @PostMapping public ResponseEntity<Task> saveTask(@RequestBody Task task) { if (!taskListService.getById(task.getTaskList().getId()).isPresent()) { return new ResponseEntity<>(null, HttpStatus.BAD_REQUEST); } return new ResponseEntity<>(taskService.save(task), HttpStatus.OK); } @SuppressWarnings("rawtypes") @DeleteMapping("/{idTask}") public ResponseEntity removeFromList(@PathVariable Integer idTask){ if (taskService.getById(idTask).isPresent()) { taskService.removeFromList(idTask); return new ResponseEntity<>(HttpStatus.OK); } return new ResponseEntity<>(HttpStatus.BAD_REQUEST); } @SuppressWarnings("rawtypes") @DeleteMapping("/taskList/{idTaskList}") public ResponseEntity removeTasksFromList(@PathVariable Integer idTaskList){ if (taskListService.getById(idTaskList).isPresent()) { taskService.removeTasksFromList(idTaskList); return new ResponseEntity<>(HttpStatus.OK); } return new ResponseEntity<>(HttpStatus.BAD_REQUEST); } @PutMapping public ResponseEntity<Task> updateTaskStatus(@RequestBody Task task) { if (!taskService.getById(task.getId()).isPresent()) { return new ResponseEntity<>(null, HttpStatus.BAD_REQUEST); } return new ResponseEntity<>(taskService.updateTaskStatus(task), HttpStatus.OK); } @GetMapping("/all") public ResponseEntity<List<Task>> getAllTasks(){ return new ResponseEntity<List<Task>>(taskService.getAllTasks(), HttpStatus.OK); } @GetMapping("/tasklist/{idTaskList}") public ResponseEntity<List<Task>> getAllTasksFromTaskList(@PathVariable Integer idTaskList){ return new ResponseEntity<List<Task>>(taskService.getAllTasksFromTaskList(idTaskList), HttpStatus.OK); } public ResponseEntity<Task> getInactiveOrActiveTaskById(Integer id) { if (!taskService.getById(id).isPresent()) { return new ResponseEntity<>(null, HttpStatus.BAD_REQUEST); } return new ResponseEntity<>(taskService.getById(id).get(), HttpStatus.OK); } }
[ "carlosantoniooln@gmail.com" ]
carlosantoniooln@gmail.com
ad403bcada729a1104a2c612ff61ae8f8a01e21b
ec1f7c638dc8ae2a8a2ebd9a196eb90740615c16
/Assignment 3/src/WorldApp/CountryDriver.java
66de3e896206523f5d6780bc7c7a1fdad6dd51df
[]
no_license
duclersa/Country-City-JDBC-Project
dfc45b87b94ed32b85a86f0b85b2b850747fd705
de6fa5ecd24a4ed3b08f17bf203448225d41b0ee
refs/heads/master
2022-11-19T18:53:45.060952
2020-07-09T02:45:23
2020-07-09T02:45:23
278,245,651
0
0
null
null
null
null
UTF-8
Java
false
false
3,191
java
package WorldApp; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.ArrayList; import java.util.List; //import com.collabera.jump.DAOExample.ConnectionFactory; //import com.collabera.jump.DAOExample.Student; public class CountryDriver implements WorldAppInterface { List<Country> countryList; List<City> cityList; public CountryDriver() { // TODO Auto-generated constructor stub } @Override public Country getCountry(int id) { // TODO Auto-generated method stub return null; } @Override public List<Country> getAllCountries() { Connection con = ConnectionFactory.getConnection(); try { Statement stmt = con.createStatement(); // ResultSet rs = stmt.executeQuery("select * from Country inner join City \r\n" // + // "on Country.CityId = City.CityId;"); ResultSet rs = stmt.executeQuery("select * from Country"); List<Country> countryList = new ArrayList<Country>(); while (rs.next()) { Country s = new Country(); s.setCountryId(rs.getInt("CountryId")); s.setCountryName(rs.getString("CountryName")); s.setPopulation(rs.getInt("Population")); s.setCityId(rs.getInt("CityId")); countryList.add(s); } return countryList; } catch (SQLException ex) { ex.printStackTrace(); } return null; } // UPDATE MOD @Override public void updateCountry(int CountryId, int Population) { Connection con = ConnectionFactory.getConnection(); try { Statement stmt = con.createStatement(); int row = stmt.executeUpdate( "update Country" + " set Population = " + Population + " where Countryid = " + CountryId); List<Country> countryList = new ArrayList<Country>(); // Country s = new Country(); // s.setCountryId(rs.getInt("CountryId")); // s.setPopulation(rs.getInt("Population")); // countryList.add(s); // return cityList; } catch (SQLException ex) { ex.printStackTrace(); } } @Override public List<City> getAllCities() { Connection con = ConnectionFactory.getConnection(); try { Statement stmt = con.createStatement(); // ResultSet rs = stmt.executeQuery("select * from Country inner join City \r\n" // + // "on Country.CityId = City.CityId;"); ResultSet rs = stmt.executeQuery("select * from City"); List<City> cityList = new ArrayList<City>(); while (rs.next()) { City s = new City(); s.setCityId(rs.getInt("CityId")); s.setCityName(rs.getString("CityName")); cityList.add(s); } return cityList; } catch (SQLException ex) { ex.printStackTrace(); } return null; } }
[ "36280333+duclersa@users.noreply.github.com" ]
36280333+duclersa@users.noreply.github.com
2cd54779e83ff8c75a581e849628248ed1583939
223df9db4fe24a84c01012b28a4728d2136edce0
/target/case-1/WEB-INF/classes/test/ImportCoursesTest.java
a7d2c431691231bb500aed1019d4c0a924b869c2
[]
no_license
paisan22/case01
c9436a9d70b91e0a0d0be8eece77a9e8a4ca9974
f87dfb31557c12c5fa0df6e394cd08e78c8260ad
refs/heads/master
2021-01-11T01:27:12.663359
2016-10-12T13:46:58
2016-10-12T13:46:58
70,704,138
0
0
null
null
null
null
UTF-8
Java
false
false
1,692
java
package test; import database.CourseDAO; import domain.Course; import domain.ImportCourses; import org.hamcrest.CoreMatchers; import org.junit.Before; import org.junit.Test; import java.io.*; import java.sql.SQLException; import java.time.LocalDate; import java.util.Date; import java.util.List; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; /** * Created by paisanrietbroek on 10/10/16. */ public class ImportCoursesTest { private ImportCourses importCourses; @Before public void initObject() { importCourses = new ImportCourses(); } @Test public void readFile() throws IOException { importCourses.readLines("courses.txt"); assertThat(importCourses.getLines().size(), is(CoreMatchers.<Integer>notNullValue())); } @Test public void convertToObject() throws IOException { importCourses.readLines("courses.txt"); importCourses.convertToObjects(); for (Course course : importCourses.getCourseList()) { assertThat(course.getTitle(), is(CoreMatchers.<String>notNullValue())); assertThat(course.getCursusCode(), is(CoreMatchers.<String>notNullValue())); assertThat(course.getNumberOfDays(), is(CoreMatchers.<Integer>notNullValue())); assertThat(course.getStartDate(), is(CoreMatchers.<LocalDate>notNullValue())); } } @Test public void importFile() throws IOException, SQLException, ClassNotFoundException { List<Course> courseList = importCourses.importFile("courses.txt"); boolean b = new CourseDAO().importFile(courseList); assertThat(b, is(true)); } }
[ "paisanrietbroek@Paisans-MacBook-Pro.local" ]
paisanrietbroek@Paisans-MacBook-Pro.local
7fbc991c839f61e33505242ee60180392d57b6d2
aad82f53c79bb1b0fa0523ca0b9dd18d8f39ec6d
/JESTIN COLIN CORREYA/31-01-2020/qu4_reverse.java
028318575b59ddbf0febee4e73ee9f11c2ae1045
[]
no_license
Cognizant-Training-Coimbatore/Lab-Excercise-Batch-2
54b4d87238949f3ffa0b3f0209089a1beb93befe
58d65b309377b1b86a54d541c3d1ef5acb868381
refs/heads/master
2020-12-22T06:12:23.330335
2020-03-17T12:32:29
2020-03-17T12:32:29
236,676,704
1
0
null
2020-10-13T19:56:02
2020-01-28T07:00:34
Java
UTF-8
Java
false
false
371
java
package java50; import java.util.Scanner; public class qu4_reverse { public static void main(String[] args) { // TODO Auto-generated method stub System.out.println("enter a string"); Scanner s=new Scanner(System.in); String a=s.nextLine(); String rev=""; for(int i=a.length()-1;i>=0;i--) { rev=rev+a.charAt(i); } System.out.println(rev); } }
[ "noreply@github.com" ]
noreply@github.com
2156a0c6717bf1859fbba716004deea81b21105c
fa93c9be2923e697fb8a2066f8fb65c7718cdec7
/sources/com/avito/android/util/text/AvitoTextAppearanceSpan.java
80163127e1065adeae483c5c662f38b1c20ede9a
[]
no_license
Auch-Auch/avito_source
b6c9f4b0e5c977b36d5fbc88c52f23ff908b7f8b
76fdcc5b7e036c57ecc193e790b0582481768cdc
refs/heads/master
2023-05-06T01:32:43.014668
2021-05-25T10:19:22
2021-05-25T10:19:22
370,650,685
0
0
null
null
null
null
UTF-8
Java
false
false
5,030
java
package com.avito.android.util.text; import android.content.Context; import android.content.res.ColorStateList; import android.content.res.TypedArray; import android.graphics.Typeface; import android.text.TextPaint; import android.text.style.MetricAffectingSpan; import androidx.core.content.res.ResourcesCompat; import com.avito.android.remote.auth.AuthSource; import com.avito.android.text_formatters.R; import kotlin.Metadata; import kotlin.jvm.internal.Intrinsics; import org.jetbrains.annotations.NotNull; @Metadata(bv = {1, 0, 3}, d1 = {"\u0000<\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u0007\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0002\b\u0004\u0018\u00002\u00020\u0001B\u0017\u0012\u0006\u0010\u0017\u001a\u00020\u0016\u0012\u0006\u0010\u0019\u001a\u00020\u0018¢\u0006\u0004\b\u001a\u0010\u001bJ\u0017\u0010\u0005\u001a\u00020\u00042\u0006\u0010\u0003\u001a\u00020\u0002H\u0016¢\u0006\u0004\b\u0005\u0010\u0006J\u0017\u0010\u0007\u001a\u00020\u00042\u0006\u0010\u0003\u001a\u00020\u0002H\u0016¢\u0006\u0004\b\u0007\u0010\u0006R\u0018\u0010\u000b\u001a\u0004\u0018\u00010\b8\u0002@\u0002X‚\u000e¢\u0006\u0006\n\u0004\b\t\u0010\nR\u0018\u0010\r\u001a\u0004\u0018\u00010\b8\u0002@\u0002X‚\u000e¢\u0006\u0006\n\u0004\b\f\u0010\nR\u0018\u0010\u0011\u001a\u0004\u0018\u00010\u000e8\u0002@\u0002X‚\u000e¢\u0006\u0006\n\u0004\b\u000f\u0010\u0010R\u0018\u0010\u0015\u001a\u0004\u0018\u00010\u00128\u0002@\u0002X‚\u000e¢\u0006\u0006\n\u0004\b\u0013\u0010\u0014¨\u0006\u001c"}, d2 = {"Lcom/avito/android/util/text/AvitoTextAppearanceSpan;", "Landroid/text/style/MetricAffectingSpan;", "Landroid/text/TextPaint;", "ds", "", "updateDrawState", "(Landroid/text/TextPaint;)V", "updateMeasureState", "Landroid/content/res/ColorStateList;", "c", "Landroid/content/res/ColorStateList;", "textColorLink", AuthSource.BOOKING_ORDER, "textColor", "Landroid/graphics/Typeface;", AuthSource.SEND_ABUSE, "Landroid/graphics/Typeface;", "typeface", "", "d", "Ljava/lang/Float;", "textSize", "Landroid/content/Context;", "context", "", "appearance", "<init>", "(Landroid/content/Context;I)V", "text-formatters_release"}, k = 1, mv = {1, 4, 2}) public final class AvitoTextAppearanceSpan extends MetricAffectingSpan { public Typeface a; public ColorStateList b; public ColorStateList c; public Float d; public AvitoTextAppearanceSpan(@NotNull Context context, int i) { Intrinsics.checkNotNullParameter(context, "context"); TypedArray obtainStyledAttributes = context.obtainStyledAttributes(i, R.styleable.AvitoTextAppearance); Intrinsics.checkNotNullExpressionValue(obtainStyledAttributes, AuthSource.SEND_ABUSE); int i2 = R.styleable.AvitoTextAppearance_android_fontFamily; if (obtainStyledAttributes.hasValue(i2)) { this.a = ResourcesCompat.getFont(context, obtainStyledAttributes.getResourceId(i2, 0)); } if (this.a == null) { int i3 = R.styleable.AvitoTextAppearance_fontFamily; if (obtainStyledAttributes.hasValue(i3)) { this.a = ResourcesCompat.getFont(context, obtainStyledAttributes.getResourceId(i3, 0)); } } int i4 = R.styleable.AvitoTextAppearance_android_textColor; if (obtainStyledAttributes.hasValue(i4)) { this.b = obtainStyledAttributes.getColorStateList(i4); } int i5 = R.styleable.AvitoTextAppearance_android_textColorLink; if (obtainStyledAttributes.hasValue(i5)) { this.c = obtainStyledAttributes.getColorStateList(i5); } int i6 = R.styleable.AvitoTextAppearance_android_textSize; if (obtainStyledAttributes.hasValue(i6)) { this.d = Float.valueOf((float) obtainStyledAttributes.getDimensionPixelSize(i6, 0)); } obtainStyledAttributes.recycle(); } @Override // android.text.style.CharacterStyle public void updateDrawState(@NotNull TextPaint textPaint) { Intrinsics.checkNotNullParameter(textPaint, "ds"); updateMeasureState(textPaint); ColorStateList colorStateList = this.b; if (colorStateList != null) { textPaint.setColor(colorStateList.getColorForState(textPaint.drawableState, 0)); } ColorStateList colorStateList2 = this.c; if (colorStateList2 != null) { textPaint.linkColor = colorStateList2.getColorForState(textPaint.drawableState, 0); } } @Override // android.text.style.MetricAffectingSpan public void updateMeasureState(@NotNull TextPaint textPaint) { Intrinsics.checkNotNullParameter(textPaint, "ds"); Typeface typeface = this.a; if (typeface != null) { textPaint.setTypeface(typeface); } Float f = this.d; if (f != null) { textPaint.setTextSize(f.floatValue()); } } }
[ "auchhunter@gmail.com" ]
auchhunter@gmail.com
b8c25ee9ac0f7cbcf62ebcc209448ac557c02148
aefecb56ee5325764fb33bb32d827b04612e6eb2
/Adder.java
7cceac18865327fb28ce2ea3910ac789ace9f3cc
[]
no_license
aumchii/Programming-Special-
c70dc2a878693a04fad6602aeb92444a66c56d48
2a47cbcc9d3e0d1db3b7ba7772cfee7a1d6c8e90
refs/heads/master
2020-03-28T12:03:38.301246
2018-09-11T06:15:44
2018-09-11T06:15:44
148,267,266
0
0
null
null
null
null
UTF-8
Java
false
false
400
java
import java.util.*; class Adder { public static void main(String[]args){ int a=0; int b=0; int x=0; Scanner sc=new Scanner (System.in); System.out.print("Enter a "); a =sc.nextInt(); System.out.print("Enter b "); b =sc.nextInt(); x=a+b; System.out.print("Sum= "+x); } }
[ "60050148@kmitl.ac.th" ]
60050148@kmitl.ac.th
663f6175cd02a292dacc031f3dedc3b28f7aaa45
3b65561c4113544cd0b410cc44cc96d3531023f6
/taier-datasource/taier-datasource-plugin/taier-datasource-plugin-hdfs/src/main/java/org/apache/orc/OrcFile.java
2ba2242270d91e87b6dcd66d6de9e0f2acd42ec3
[ "Apache-2.0" ]
permissive
DTStack/Taier
2bc168d802b028f669131017c996d61286d4f2db
5116f9ee195ee0c53b75ddf9724b0dedc62e6b4c
refs/heads/master
2023-09-04T02:42:02.266708
2023-08-10T05:51:36
2023-08-10T05:51:36
343,649,088
1,195
308
Apache-2.0
2023-09-10T11:35:57
2021-03-02T04:49:33
Java
UTF-8
Java
false
false
16,547
java
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.orc; import java.io.IOException; import java.util.Properties; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.orc.impl.MemoryManager; import org.apache.orc.impl.OrcTail; import org.apache.orc.impl.ReaderImpl; import org.apache.orc.impl.WriterImpl; /** * Contains factory methods to read or write ORC files. */ public class OrcFile { public static final String MAGIC = "ORC"; /** * Create a version number for the ORC file format, so that we can add * non-forward compatible changes in the future. To make it easier for users * to understand the version numbers, we use the Hive release number that * first wrote that version of ORC files. * * Thus, if you add new encodings or other non-forward compatible changes * to ORC files, which prevent the old reader from reading the new format, * you should change these variable to reflect the next Hive release number. * Non-forward compatible changes should never be added in patch releases. * * Do not make any changes that break backwards compatibility, which would * prevent the new reader from reading ORC files generated by any released * version of Hive. */ public enum Version { V_0_11("0.11", 0, 11), V_0_12("0.12", 0, 12); public static final Version CURRENT = V_0_12; private final String name; private final int major; private final int minor; Version(String name, int major, int minor) { this.name = name; this.major = major; this.minor = minor; } public static Version byName(String name) { for(Version version: values()) { if (version.name.equals(name)) { return version; } } throw new IllegalArgumentException("Unknown ORC version " + name); } /** * Get the human readable name for the version. */ public String getName() { return name; } /** * Get the major version number. */ public int getMajor() { return major; } /** * Get the minor version number. */ public int getMinor() { return minor; } } /** * Records the version of the writer in terms of which bugs have been fixed. * For bugs in the writer, but the old readers already read the new data * correctly, bump this version instead of the Version. */ public enum WriterVersion { ORIGINAL(0), HIVE_8732(1), // corrupted stripe/file maximum column statistics HIVE_4243(2), // use real column names from Hive tables HIVE_12055(3), // vectorized writer HIVE_13083(4), // decimal writer updating present stream wrongly // Don't use any magic numbers here except for the below: FUTURE(Integer.MAX_VALUE); // a version from a future writer private final int id; public int getId() { return id; } WriterVersion(int id) { this.id = id; } private static final WriterVersion[] values; static { // Assumes few non-negative values close to zero. int max = Integer.MIN_VALUE; for (WriterVersion v : WriterVersion.values()) { if (v.id < 0) throw new AssertionError(); if (v.id > max && FUTURE.id != v.id) { max = v.id; } } values = new WriterVersion[max + 1]; for (WriterVersion v : WriterVersion.values()) { if (v.id < values.length) { values[v.id] = v; } } } public static WriterVersion from(int val) { if (val >= values.length) return FUTURE; // Special handling for the magic value. return values[val]; } } public static final WriterVersion CURRENT_WRITER = WriterVersion.HIVE_13083; public enum EncodingStrategy { SPEED, COMPRESSION } public enum CompressionStrategy { SPEED, COMPRESSION } // unused protected OrcFile() {} public static class ReaderOptions { private final Configuration conf; private FileSystem filesystem; private long maxLength = Long.MAX_VALUE; private OrcTail orcTail; // TODO: We can generalize FileMetada interface. Make OrcTail implement FileMetadata interface // and remove this class altogether. Both footer caching and llap caching just needs OrcTail. // For now keeping this around to avoid complex surgery private FileMetadata fileMetadata; public ReaderOptions(Configuration conf) { this.conf = conf; } public ReaderOptions filesystem(FileSystem fs) { this.filesystem = fs; return this; } public ReaderOptions maxLength(long val) { maxLength = val; return this; } public ReaderOptions orcTail(OrcTail tail) { this.orcTail = tail; return this; } public Configuration getConfiguration() { return conf; } public FileSystem getFilesystem() { return filesystem; } public long getMaxLength() { return maxLength; } public OrcTail getOrcTail() { return orcTail; } public ReaderOptions fileMetadata(final FileMetadata metadata) { fileMetadata = metadata; return this; } public FileMetadata getFileMetadata() { return fileMetadata; } } public static ReaderOptions readerOptions(Configuration conf) { return new ReaderOptions(conf); } public static Reader createReader(Path path, ReaderOptions options) throws IOException { return new ReaderImpl(path, options); } public interface WriterContext { Writer getWriter(); } public interface WriterCallback { void preStripeWrite(WriterContext context) throws IOException; void preFooterWrite(WriterContext context) throws IOException; } /** * Options for creating ORC file writers. */ public static class WriterOptions { private final Configuration configuration; private FileSystem fileSystemValue = null; private TypeDescription schema = null; private long stripeSizeValue; private long blockSizeValue; private int rowIndexStrideValue; private int bufferSizeValue; private boolean enforceBufferSize = false; private boolean blockPaddingValue; private CompressionKind compressValue; private MemoryManager memoryManagerValue; private Version versionValue; private WriterCallback callback; private EncodingStrategy encodingStrategy; private CompressionStrategy compressionStrategy; private double paddingTolerance; private String bloomFilterColumns; private double bloomFilterFpp; protected WriterOptions(Properties tableProperties, Configuration conf) { configuration = conf; memoryManagerValue = getStaticMemoryManager(conf); stripeSizeValue = OrcConf.STRIPE_SIZE.getLong(tableProperties, conf); blockSizeValue = OrcConf.BLOCK_SIZE.getLong(tableProperties, conf); rowIndexStrideValue = (int) OrcConf.ROW_INDEX_STRIDE.getLong(tableProperties, conf); bufferSizeValue = (int) OrcConf.BUFFER_SIZE.getLong(tableProperties, conf); blockPaddingValue = OrcConf.BLOCK_PADDING.getBoolean(tableProperties, conf); compressValue = CompressionKind.valueOf(OrcConf.COMPRESS.getString(tableProperties, conf).toUpperCase()); String versionName = OrcConf.WRITE_FORMAT.getString(tableProperties, conf); versionValue = Version.byName(versionName); String enString = OrcConf.ENCODING_STRATEGY.getString(tableProperties, conf); encodingStrategy = EncodingStrategy.valueOf(enString); String compString = OrcConf.COMPRESSION_STRATEGY.getString(tableProperties, conf); compressionStrategy = CompressionStrategy.valueOf(compString); paddingTolerance = OrcConf.BLOCK_PADDING_TOLERANCE.getDouble(tableProperties, conf); bloomFilterColumns = OrcConf.BLOOM_FILTER_COLUMNS.getString(tableProperties, conf); bloomFilterFpp = OrcConf.BLOOM_FILTER_FPP.getDouble(tableProperties, conf); } /** * Provide the filesystem for the path, if the client has it available. * If it is not provided, it will be found from the path. */ public WriterOptions fileSystem(FileSystem value) { fileSystemValue = value; return this; } /** * Set the stripe size for the file. The writer stores the contents of the * stripe in memory until this memory limit is reached and the stripe * is flushed to the HDFS file and the next stripe started. */ public WriterOptions stripeSize(long value) { stripeSizeValue = value; return this; } /** * Set the file system block size for the file. For optimal performance, * set the block size to be multiple factors of stripe size. */ public WriterOptions blockSize(long value) { blockSizeValue = value; return this; } /** * Set the distance between entries in the row index. The minimum value is * 1000 to prevent the index from overwhelming the data. If the stride is * set to 0, no indexes will be included in the file. */ public WriterOptions rowIndexStride(int value) { rowIndexStrideValue = value; return this; } /** * The size of the memory buffers used for compressing and storing the * stripe in memory. NOTE: ORC writer may choose to use smaller buffer * size based on stripe size and number of columns for efficient stripe * writing and memory utilization. To enforce writer to use the requested * buffer size use enforceBufferSize(). */ public WriterOptions bufferSize(int value) { bufferSizeValue = value; return this; } /** * Enforce writer to use requested buffer size instead of estimating * buffer size based on stripe size and number of columns. * See bufferSize() method for more info. * Default: false */ public WriterOptions enforceBufferSize() { enforceBufferSize = true; return this; } /** * Sets whether the HDFS blocks are padded to prevent stripes from * straddling blocks. Padding improves locality and thus the speed of * reading, but costs space. */ public WriterOptions blockPadding(boolean value) { blockPaddingValue = value; return this; } /** * Sets the encoding strategy that is used to encode the data. */ public WriterOptions encodingStrategy(EncodingStrategy strategy) { encodingStrategy = strategy; return this; } /** * Sets the tolerance for block padding as a percentage of stripe size. */ public WriterOptions paddingTolerance(double value) { paddingTolerance = value; return this; } /** * Comma separated values of column names for which bloom filter is to be created. */ public WriterOptions bloomFilterColumns(String columns) { bloomFilterColumns = columns; return this; } /** * Specify the false positive probability for bloom filter. * @param fpp - false positive probability * @return this */ public WriterOptions bloomFilterFpp(double fpp) { bloomFilterFpp = fpp; return this; } /** * Sets the generic compression that is used to compress the data. */ public WriterOptions compress(CompressionKind value) { compressValue = value; return this; } /** * Set the schema for the file. This is a required parameter. * @param schema the schema for the file. * @return this */ public WriterOptions setSchema(TypeDescription schema) { this.schema = schema; return this; } /** * Sets the version of the file that will be written. */ public WriterOptions version(Version value) { versionValue = value; return this; } /** * Add a listener for when the stripe and file are about to be closed. * @param callback the object to be called when the stripe is closed * @return this */ public WriterOptions callback(WriterCallback callback) { this.callback = callback; return this; } /** * A package local option to set the memory manager. */ protected WriterOptions memory(MemoryManager value) { memoryManagerValue = value; return this; } public boolean getBlockPadding() { return blockPaddingValue; } public long getBlockSize() { return blockSizeValue; } public String getBloomFilterColumns() { return bloomFilterColumns; } public FileSystem getFileSystem() { return fileSystemValue; } public Configuration getConfiguration() { return configuration; } public TypeDescription getSchema() { return schema; } public long getStripeSize() { return stripeSizeValue; } public CompressionKind getCompress() { return compressValue; } public WriterCallback getCallback() { return callback; } public Version getVersion() { return versionValue; } public MemoryManager getMemoryManager() { return memoryManagerValue; } public int getBufferSize() { return bufferSizeValue; } public boolean isEnforceBufferSize() { return enforceBufferSize; } public int getRowIndexStride() { return rowIndexStrideValue; } public CompressionStrategy getCompressionStrategy() { return compressionStrategy; } public EncodingStrategy getEncodingStrategy() { return encodingStrategy; } public double getPaddingTolerance() { return paddingTolerance; } public double getBloomFilterFpp() { return bloomFilterFpp; } } /** * Create a set of writer options based on a configuration. * @param conf the configuration to use for values * @return A WriterOptions object that can be modified */ public static WriterOptions writerOptions(Configuration conf) { return new WriterOptions(null, conf); } /** * Create a set of write options based on a set of table properties and * configuration. * @param tableProperties the properties of the table * @param conf the configuration of the query * @return a WriterOptions object that can be modified */ public static WriterOptions writerOptions(Properties tableProperties, Configuration conf) { return new WriterOptions(tableProperties, conf); } private static ThreadLocal<MemoryManager> memoryManager = null; private static synchronized MemoryManager getStaticMemoryManager( final Configuration conf) { if (memoryManager == null) { memoryManager = new ThreadLocal<MemoryManager>() { @Override protected MemoryManager initialValue() { return new MemoryManager(conf); } }; } return memoryManager.get(); } /** * Create an ORC file writer. This is the public interface for creating * writers going forward and new options will only be added to this method. * @param path filename to write to * @param opts the options * @return a new ORC file writer * @throws IOException */ public static Writer createWriter(Path path, WriterOptions opts ) throws IOException { FileSystem fs = opts.getFileSystem() == null ? path.getFileSystem(opts.getConfiguration()) : opts.getFileSystem(); return new WriterImpl(fs, path, opts); } }
[ "870921302@qq.com" ]
870921302@qq.com
4031bf84e5350926a80e66ae3face6e93a4fb883
48d61d9a951a9ce30a8ec178d9491f5b60160679
/app/src/main/java/com/chengzi/app/utils/HDLinkMovementMethod.java
42e2e4fd107f466c3cbfed4ae3ef6cdce8e6cc9d
[]
no_license
led-os/yimeinew
209387195be8d6b04e4ec06d3d79f3e265d8af7b
3ee181f2440cf8809ddabd7ec4d73713124af277
refs/heads/master
2022-02-22T08:38:24.126333
2019-09-17T03:30:43
2019-09-17T03:30:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
826
java
package com.chengzi.app.utils; import android.text.Spannable; import android.text.method.LinkMovementMethod; import android.text.method.MovementMethod; import android.view.MotionEvent; import android.widget.TextView; public class HDLinkMovementMethod extends LinkMovementMethod { @Override public boolean onTouchEvent(TextView widget, Spannable buffer, MotionEvent event) { int action = event.getAction(); if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_DOWN) { return super.onTouchEvent(widget,buffer,event); } return false; } public static MovementMethod getInstance() { if (sInstance == null) sInstance = new HDLinkMovementMethod(); return sInstance; } private static LinkMovementMethod sInstance; }
[ "869798794@qq.com" ]
869798794@qq.com
7fd4c20d2b966aec11267c0bfcafac608c52556d
15cf8a940a99b1335250bff9f221cc08d5df9f0f
/src/android/support/v4/media/VolumeProviderCompatApi21.java
9324a04c5bceac76c0b1cfd4edf20bffb77f9288
[]
no_license
alamom/mcoc_mod_11.1
0e5153e0e7d83aa082c5447f991b2f6fa5c01d8b
d48cb0d2b3bc058bddb09c761ae5f443d9f2e93d
refs/heads/master
2021-01-11T17:12:37.894951
2017-01-22T19:55:38
2017-01-22T19:55:38
79,739,761
0
0
null
null
null
null
UTF-8
Java
false
false
1,116
java
package android.support.v4.media; import android.media.VolumeProvider; class VolumeProviderCompatApi21 { public static Object createVolumeProvider(int paramInt1, int paramInt2, int paramInt3, final Delegate paramDelegate) { new VolumeProvider(paramInt1, paramInt2, paramInt3) { public void onAdjustVolume(int paramAnonymousInt) { paramDelegate.onAdjustVolume(paramAnonymousInt); } public void onSetVolumeTo(int paramAnonymousInt) { paramDelegate.onSetVolumeTo(paramAnonymousInt); } }; } public static void setCurrentVolume(Object paramObject, int paramInt) { ((VolumeProvider)paramObject).setCurrentVolume(paramInt); } public static abstract interface Delegate { public abstract void onAdjustVolume(int paramInt); public abstract void onSetVolumeTo(int paramInt); } } /* Location: C:\tools\androidhack\marvel_bitva_chempionov_v11.1.0_mod_lenov.ru\classes.jar!\android\support\v4\media\VolumeProviderCompatApi21.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "eduard.martini@gmail.com" ]
eduard.martini@gmail.com
04b8651fa0e371555ff9970b6d600dd2f3c7c5c1
eb0314dab7e6d5e587512f625acf2ac2dbda6164
/src/edu/umass/cs/transaction/txpackets/UnlockRequest.java
00402a47edb4b8e9476ee089146c253dd9e13cfb
[]
no_license
sandeep06011991/Transactions
76d03b5adcb559ddb6433c14628a8efb3dc04f4f
bc6954bdf587905f61aea52c9711787b2c568945
refs/heads/master
2020-03-17T19:57:12.780453
2019-01-03T21:57:40
2019-01-03T21:57:40
133,886,348
0
0
null
null
null
null
UTF-8
Java
false
false
1,524
java
package edu.umass.cs.transaction.txpackets; import edu.umass.cs.transaction.protocol.TxMessenger; import org.json.JSONException; import org.json.JSONObject; /** * @author arun * */ // FIXME: Unlock is quite redundant with Commit Request public class UnlockRequest extends TXPacket { private static enum Keys { SERVICENAME , TXID, COMMIT }; private final String serviceName; private final String txID; private final boolean commit; public UnlockRequest(String serviceName, String txID,boolean commit,String leader) { super(TXPacket.PacketType.UNLOCK_REQUEST, txID, leader); this.serviceName = serviceName; this.txID = txID; this.commit = commit; } public UnlockRequest(JSONObject json) throws JSONException { super(json); this.serviceName = json.getString(Keys.SERVICENAME.toString()); this.txID = json.getString(Keys.TXID.toString()); this.commit = json.getBoolean(Keys.COMMIT.toString()); } public String getTXID() { return this.txID; } public JSONObject toJSONObject() throws JSONException{ JSONObject jsonObject=super.toJSONObject(); jsonObject.put(Keys.SERVICENAME.toString(),this.serviceName); jsonObject.put(Keys.COMMIT.toString(),this.commit); return jsonObject; } public String getLockID() { return this.txID; } public String getServiceName() { return this.serviceName; } @Override public boolean needsCoordination() { return true; } @Override public Object getKey() { return txid; } public boolean isCommited() { return commit; } }
[ "sandeep06011991@gmail.com" ]
sandeep06011991@gmail.com
13a711b30c88e017b82e157ffd4a2675f31f9c0a
e86c5f2e2f8678e2d859dc0f0d6bd11ae29a9721
/gen/com/xdialer/R.java
e374421ef96c1e3987912a7cd0b00c3ff48040cd
[]
no_license
peihsinsu/XDialer
2a2f1e3df74659785ab03a77bf61efcbe852bb8a
62f1a8c3738c5d04fd0454e633f56bed39a6d20b
refs/heads/master
2016-09-06T13:46:41.144196
2015-01-30T07:14:55
2015-01-30T07:14:55
30,060,900
0
0
null
null
null
null
UTF-8
Java
false
false
9,433
java
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * aapt tool from the resource data it found. It * should not be modified by hand. */ package com.xdialer; public final class R { public static final class attr { /** <p>Must be one of the following constant values.</p> <table> <colgroup align="left" /> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Constant</th><th>Value</th><th>Description</th></tr> <tr><td><code>BANNER</code></td><td>1</td><td></td></tr> <tr><td><code>IAB_MRECT</code></td><td>2</td><td></td></tr> <tr><td><code>IAB_BANNER</code></td><td>3</td><td></td></tr> <tr><td><code>IAB_LEADERBOARD</code></td><td>4</td><td></td></tr> </table> */ public static final int adSize=0x7f010000; /** <p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character. <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int adUnitId=0x7f010001; } public static final class color { public static final int white=0x7f060000; } public static final class drawable { public static final int bg=0x7f020000; public static final int config=0x7f020001; public static final int dialnormal=0x7f020002; public static final int dialprefix=0x7f020003; public static final int exit=0x7f020004; public static final int icon=0x7f020005; public static final int iconquestion=0x7f020006; public static final int iconred=0x7f020007; public static final int msn=0x7f020008; public static final int phone=0x7f020009; public static final int phonebook=0x7f02000a; public static final int serviceoff=0x7f02000b; public static final int serviceon=0x7f02000c; public static final int tabconfig=0x7f02000d; public static final int tabcontact=0x7f02000e; public static final int tabdialer=0x7f02000f; public static final int tabhelp=0x7f020010; public static final int title=0x7f020011; } public static final class id { public static final int BANNER=0x7f050000; public static final int Button01=0x7f050017; public static final int EditText01=0x7f050014; public static final int IAB_BANNER=0x7f050002; public static final int IAB_LEADERBOARD=0x7f050003; public static final int IAB_MRECT=0x7f050001; public static final int LinearLayout01=0x7f05001e; public static final int ListView01=0x7f050015; public static final int ScrollView01=0x7f050005; public static final int TableLayout01=0x7f050006; public static final int WidgeImageButton01=0x7f050020; public static final int WidgetText=0x7f050021; public static final int block_midfix=0x7f05000c; public static final int block_postfix=0x7f05000d; public static final int block_prefix=0x7f05000b; public static final int end_width=0x7f050011; public static final int exit=0x7f050022; public static final int helpLayout=0x7f050004; public static final int help_content=0x7f050016; public static final int help_service_switch=0x7f050008; public static final int help_setup_prefix=0x7f050013; public static final int include_of=0x7f050012; public static final int pattern=0x7f05000a; public static final int qes_pattern=0x7f050009; public static final int qes_rule=0x7f05000e; public static final int qes_service=0x7f050007; public static final int row_entry=0x7f050019; public static final int row_entry2=0x7f05001a; public static final int space=0x7f05001c; public static final int space0=0x7f05001b; public static final int space2=0x7f05001d; public static final int spinner_filter_type=0x7f05000f; public static final int start_width=0x7f050010; public static final int title_pic=0x7f050018; public static final int widget_root=0x7f05001f; } public static final class layout { public static final int configure=0x7f030000; public static final int contactquery=0x7f030001; public static final int help=0x7f030002; public static final int main=0x7f030003; public static final int phonebook=0x7f030004; public static final int phonebook2=0x7f030005; public static final int tab=0x7f030006; public static final int widget_initial_layout=0x7f030007; } public static final class menu { public static final int option_menu=0x7f090000; } public static final class string { public static final int Dial=0x7f070005; public static final int InputNumber=0x7f070004; public static final int PhoneBook=0x7f070003; public static final int app_name=0x7f070007; public static final int block_midfix=0x7f070019; public static final int block_postfix=0x7f07001a; public static final int block_prefix=0x7f070018; public static final int config_content=0x7f070001; public static final int config_filter_rule=0x7f070013; public static final int config_filter_type=0x7f070014; public static final int config_for_dial=0x7f070020; public static final int config_for_no_filter=0x7f070022; public static final int config_for_not_dial=0x7f070021; public static final int config_pattern=0x7f07001c; public static final int config_title=0x7f070002; public static final int enable_service=0x7f070012; public static final int end_with=0x7f070016; public static final int hello=0x7f070006; public static final int help_pattern_config=0x7f07001f; public static final int help_rule_config=0x7f07001d; public static final int help_service_config=0x7f07001e; public static final int include_of=0x7f070017; public static final int menu_config=0x7f07000a; public static final int menu_exit=0x7f070009; public static final int menu_phonebook=0x7f07000b; public static final int pattern=0x7f07001b; public static final int phoneBookActivity=0x7f070008; public static final int prefix=0x7f070011; public static final int service_status=0x7f070010; public static final int setup=0x7f070000; public static final int start_with=0x7f070015; public static final int tab_config=0x7f07000d; public static final int tab_dial=0x7f07000c; public static final int tab_help=0x7f07000f; public static final int tab_phonebook=0x7f07000e; } public static final class style { public static final int CodeFont=0x7f080000; public static final int SeparaterType=0x7f080002; public static final int SpinderFont=0x7f080001; } public static final class xml { public static final int widget_info=0x7f040000; } public static final class styleable { /** Attributes that can be used with a com_google_ads_AdView. <p>Includes the following attributes:</p> <table> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Attribute</th><th>Description</th></tr> <tr><td><code>{@link #com_google_ads_AdView_adSize com.xdialer:adSize}</code></td><td></td></tr> <tr><td><code>{@link #com_google_ads_AdView_adUnitId com.xdialer:adUnitId}</code></td><td></td></tr> </table> @see #com_google_ads_AdView_adSize @see #com_google_ads_AdView_adUnitId */ public static final int[] com_google_ads_AdView = { 0x7f010000, 0x7f010001 }; /** <p>This symbol is the offset where the {@link com.xdialer.R.attr#adSize} attribute's value can be found in the {@link #com_google_ads_AdView} array. <p>Must be one of the following constant values.</p> <table> <colgroup align="left" /> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Constant</th><th>Value</th><th>Description</th></tr> <tr><td><code>BANNER</code></td><td>1</td><td></td></tr> <tr><td><code>IAB_MRECT</code></td><td>2</td><td></td></tr> <tr><td><code>IAB_BANNER</code></td><td>3</td><td></td></tr> <tr><td><code>IAB_LEADERBOARD</code></td><td>4</td><td></td></tr> </table> @attr name android:adSize */ public static final int com_google_ads_AdView_adSize = 0; /** <p>This symbol is the offset where the {@link com.xdialer.R.attr#adUnitId} attribute's value can be found in the {@link #com_google_ads_AdView} array. <p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character. <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. @attr name android:adUnitId */ public static final int com_google_ads_AdView_adUnitId = 1; }; }
[ "simonsu.mail@gmail.com" ]
simonsu.mail@gmail.com
ff9584c40553401650f162735d86ff4983d870b6
789ffdc94231b1d0f8fcabf8f7ac7c7589612249
/CAYJ/app/src/main/java/cn/bmob/imdemo/bean/PetsFamilyListBean.java
ebf396fb7056efd419f191e983a6b17effeea941
[]
no_license
GIThub000123/CAYJ
fd595385d99d75092fea33ca1dbf6c6f474d4404
1396f66931785cdb451be51b9fe25e61b094f868
refs/heads/master
2021-08-30T21:39:53.926403
2017-12-19T14:21:40
2017-12-19T14:21:40
114,585,956
0
0
null
null
null
null
UTF-8
Java
false
false
1,657
java
package cn.bmob.imdemo.bean; /** * Created by Administrator on 2017/3/28. */ public class PetsFamilyListBean { public String avatar; public String time; public String name; public String content; public String contentImages; public int good; public int translate; public int comment; public String ObjcetId; public String getObjcetId() { return ObjcetId; } public void setObjcetId(String objcetId) { ObjcetId = objcetId; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getAvatar() { return avatar; } public void setAvatar(String avatar) { this.avatar = avatar; } public String getTime() { return time; } public void setTime(String time) { this.time = time; } public String getContent() { return content; } public void setContent(String content) { this.content = content; } public String getContentImages() { return contentImages; } public void setContentImages(String contentImages) { this.contentImages = contentImages; } public int getGood() { return good; } public void setGood(int good) { this.good = good; } public int getTranslate() { return translate; } public void setTranslate(int translate) { this.translate = translate; } public int getComment() { return comment; } public void setComment(int comment) { this.comment = comment; } }
[ "1020884351@qq.com" ]
1020884351@qq.com
a92a057707e243521c3da46246b193bcad43f966
f3c5ec3eb9b7cf2d6eae867bd9d7bdba3cf6a3d1
/app/src/main/java/com/androiditgroup/loclook/v2/utils/BadgeGenerator.java
1aba5cb1bb4884b85fb1e5d4a32abd3fa245cd6d
[]
no_license
shmeli10/Loclook_v2
0f1997a89174a184c4c9d2f1b81851386a5e4895
4c6e973b88c034ffbfc767146e031776b87f1122
refs/heads/master
2021-01-11T21:52:21.549881
2017-07-31T05:39:35
2017-07-31T05:39:35
78,867,819
0
0
null
null
null
null
UTF-8
Java
false
false
1,937
java
package com.androiditgroup.loclook.v2.utils; import android.database.Cursor; import android.util.Log; import com.androiditgroup.loclook.v2.LocLookApp; import com.androiditgroup.loclook.v2.models.Badge; import java.util.ArrayList; /** * Created by OS1 on 05.03.2017. */ public class BadgeGenerator { public static ArrayList<Badge> getBadgesList(Cursor cursor) { ArrayList<Badge> result = new ArrayList<>(); if((cursor != null) && (cursor.getCount() > 0)) { // LocLookApp.showLog("BadgeGenerator: getBadgesList(): pCursor.getCount()= " + cursor.getCount()); cursor.moveToFirst(); try { do { String badgeId = cursor.getString(cursor.getColumnIndex("_ID")); String name = cursor.getString(cursor.getColumnIndex("NAME")); ////////////////////////////////////////////////////////////////////////////////////// Badge.Builder mBadgeBuilder = new Badge.Builder(); if((badgeId != null) && (!badgeId.equals(""))) mBadgeBuilder.id(badgeId); else return null; if((name != null) && (!name.equals(""))) mBadgeBuilder.name(name); else return null; mBadgeBuilder.iconResId(LocLookApp.getDrawableResId("badge_" +badgeId)); result.add(mBadgeBuilder.build()); } while (cursor.moveToNext()); } catch(Exception exc) { LocLookApp.showLog("BadgeGenerator: getBadgesList(): error: " +exc.toString()); } finally { cursor.close(); } } // else { // LocLookApp.showLog("BadgeGenerator: getBadgesList(): pCursor is empty"); // } return result; } }
[ "shmeli10@gmail.com" ]
shmeli10@gmail.com
2cc911ef304a2eef5a4dd74240edeb62867129b0
cb93f6b863fe45deae44d73e40f765e5f9e37093
/app/cn/edu/sdu/erp/system/mps/daos/MaterialDAO.java
45215ceb2bbb8f0d2b4e0c61e4f714efa27ad055
[]
no_license
Middleware-SDU/erp
77767e0fed5b08f04d3b120c815cb15215437229
6e59d6b8709acd7a02a57822122493cc34572fcc
refs/heads/master
2021-01-10T00:53:28.368907
2014-05-25T15:01:42
2014-05-25T15:01:42
19,963,319
2
0
null
null
null
null
UTF-8
Java
false
false
217
java
package cn.edu.sdu.erp.system.mps.daos; import cn.edu.sdu.erp.system.commons.daos.BaseModelDAO; import cn.edu.sdu.erp.system.commons.models.Material; public interface MaterialDAO extends BaseModelDAO<Material> { }
[ "sdcsyyg@163.com" ]
sdcsyyg@163.com
dd36de8b0f93bbbd9c6e583aede325e9d36bdca7
9b4d60d64e631bd1fee8f8f89b6ff57cfb10789f
/sample/src/main/java/com/kevalpatel2106/rxbussample/MainActivity.java
7b902f0f0065d9e2c195a28da9f7750cf75bb08d
[ "Apache-2.0" ]
permissive
kevalpatel2106/rxbus
c9d91de327680bbdcd19e67c15b5c6c4a0acccc9
e99d62d4bf9905c9878d6d5710d15e50919e8b93
refs/heads/master
2020-12-02T22:59:58.466419
2017-07-14T10:12:55
2017-07-14T10:12:55
96,214,225
5
0
null
null
null
null
UTF-8
Java
false
false
1,360
java
/* * Copyright 2017 Keval Patel * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance wit * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for * the specific language governing permissions and limitations under the License. */ package com.kevalpatel2106.rxbussample; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); //Load the first fragment. getSupportFragmentManager() .beginTransaction() .add(R.id.fragment_container_1, FragmentOne.getNewInstance()) .commit(); //Load the second fragment. getSupportFragmentManager() .beginTransaction() .add(R.id.fragment_container_2, FragmentTwo.getNewInstance()) .commit(); } }
[ "kevalpatel2106@gmail.com" ]
kevalpatel2106@gmail.com
aa99686ccf7f63ceea17ec992a8d68a5bb58428a
473ce744c2266b23b11bb4774726a75673e8fd9d
/src/test/java/io/pusteblume/StreamsTest.java
c80a852a2fc557828e56b9d4e25a52dea6e84456
[]
no_license
sparlampe/practice-functional-java-apis
de8348370b4c764b0c3e0c2cf67fe86961480867
623d5f1373d5ea961c8b655490279307bb35fe53
refs/heads/master
2023-07-31T20:26:51.203574
2021-09-23T15:27:08
2021-09-23T15:27:08
409,643,033
0
0
null
null
null
null
UTF-8
Java
false
false
12,091
java
package io.pusteblume; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.util.*; import java.util.concurrent.ExecutionException; import java.util.concurrent.ForkJoinPool; import java.util.concurrent.Future; import java.util.function.Consumer; import java.util.function.Predicate; import java.util.stream.*; public class StreamsTest { @Test public void declarativeApproach() { List<String> books = List.of("gone with the wind", "little women"); Predicate<String> containsOn = b-> b.contains("on"); List<String> filteredBooks = List.of("gone with the wind"); //Procedural List<String> filteredBooksProcedural = new ArrayList<>(); for(String book : books){ if(containsOn.test(book)){ filteredBooksProcedural.add(book); } } Assertions.assertEquals(filteredBooks, filteredBooksProcedural); //Declarative List<String> filteredBooksDeclarative = books .stream() .filter(containsOn) .collect(Collectors.toList()); Assertions.assertEquals(filteredBooks, filteredBooksDeclarative); //DeclarativeParallel List<String> filteredBooksParallel = books .parallelStream() .filter(containsOn) .collect(Collectors.toList()); Assertions.assertEquals(filteredBooks, filteredBooksParallel); } @Test public void streamPipeline() { //Source Stream<String> books = Stream.of("gone with the wind", "little women"); //Intermediate Operation Stream<String> booksFilter = books.filter(b-> b.contains("on")); //Terminal Operation List<String> bookList = booksFilter.collect(Collectors.toList()); } @Test public void streamIsAnIteratorNotContainer() { Stream<String> books = Stream.of("gone with the wind", "little women"); List<String> booksWithOn = books .filter(b-> b.contains("on")) .collect(Collectors.toList()); Assertions.assertEquals(List.of("gone with the wind"), booksWithOn); Assertions.assertThrows(IllegalStateException.class, () -> { List<String> booksWithS = books .filter(b -> b.contains("s")) .collect(Collectors.toList()); } ); } @Test public void streamsAreLazy() { List<String> collectedBooks = new ArrayList<>(); Stream<String> books = Stream.of("gone with the wind", "little women"); Stream<String> booksWithOn = books .filter(b-> b.contains("on")) .peek(b -> collectedBooks.add(b)); Assertions.assertTrue(collectedBooks.isEmpty()); List<String> filteredBooks = booksWithOn.collect(Collectors.toList()); Assertions.assertEquals(filteredBooks.size(), 1); Assertions.assertEquals(collectedBooks.size(), 1); } @Test public void createBoundedStreams() { Stream<String> booksStream = List.of("gone with the wind", "little women").stream(); Map<Integer, String> map = Map.of(1, "1v", 2, "2v"); Stream<Map.Entry<Integer, String>> streamOfEntries = map.entrySet().stream(); Stream<String> streamOfValues = map.values().stream(); Stream<Integer> streamOfKeys = map.keySet().stream(); Stream<String> streamOf = Stream.of("gone with the wind", "little women"); Stream<String> streamFromArray = Arrays.stream(new String[]{"gone with the wind", "little women"}); IntStream intStream = Arrays.stream(new int[]{1, 2}); Stream.Builder<String> builder = Stream.builder(); builder.add("gone with the wind"); builder.add("little women"); Stream<String> streamFromBuilder = builder.build(); } @Test public void createInfiniteStreams() { List<Integer> streamFromIterate = Stream .iterate(0, i -> i - 1) .limit(2) .collect(Collectors.toList()); Assertions.assertEquals(List.of(0, -1), streamFromIterate); List<String> streamFromGenerate = Stream .generate(() -> "Hallo") .limit(2) .collect(Collectors.toList()); Assertions.assertEquals(List.of("Hallo", "Hallo"), streamFromGenerate); } @Test public void flatMap() { Stream<String> a = Stream.of("a", "b"); Stream<String> b = Stream.of("c", "d"); Stream<Stream<String>> cofStream = Stream.of(a,b); Stream<String> c = cofStream.flatMap(v -> v); } @Test public void dedicatedPool() throws ExecutionException, InterruptedException { Stream<String> stream = Stream.of("a", "b", "c"); ForkJoinPool pool = new ForkJoinPool(5); Future<Long> future = pool.submit(() -> stream.parallel().count()); Assertions.assertEquals(future.get(), 3); } @Test public void spliteratorAndCharacteristics() { Stream<Integer> stream = Stream.of(1,2,3); Spliterator<Integer> spliterator = stream.spliterator(); int characteristicsBits = spliterator.characteristics(); int expectedBits = Spliterator.IMMUTABLE | Spliterator.ORDERED | Spliterator.SIZED | Spliterator.SUBSIZED; Assertions.assertEquals(Integer.toBinaryString(characteristicsBits), Integer.toBinaryString(expectedBits)); } @Test public void customSpliterator() throws IOException { String path = this.getClass().getResource("/Books.txt").getPath(); Stream<String> lines = Files.lines(Path.of(path)); Spliterator<String> spliterator = lines.spliterator(); Stream<Book> stream = StreamSupport.stream(new BookSpliterator(spliterator), false); stream.forEach(System.out::println); } static class BookSpliterator implements Spliterator<Book> { private Double score; private String author; private String genre; private String name; private final Spliterator<String> baseSpliterator; public BookSpliterator(Spliterator<String> baseSpliterator){ this.baseSpliterator = baseSpliterator; } @Override public boolean tryAdvance(Consumer<? super Book> action) { if(this.baseSpliterator.tryAdvance(name -> this.name = name) && this.baseSpliterator.tryAdvance(author -> this.author = author)&& this.baseSpliterator.tryAdvance(genre -> this.genre = genre)&& this.baseSpliterator.tryAdvance(score -> this.score = Double.parseDouble(score))) { action.accept(new Book(this.author, this.genre, this.name, this.score)); return true; } else return false; } @Override public Spliterator<Book> trySplit() { return null; } @Override public long estimateSize() { return baseSpliterator.estimateSize()/4; } @Override public int characteristics() { return baseSpliterator.characteristics(); } } static class Book implements Comparable<Book>{ private final Double score; private final String author; private final String genre; private final String name; public Book(String author, String genre, String name, Double score){ this.author = author; this.genre = genre; this.name = name; this.score = score; } @Override public String toString() { return "Book{" + "score=" + score + ", author='" + author + '\'' + ", genre='" + genre + '\'' + ", name='" + name + '\'' + '}'; } @Override public int compareTo(Book o) { return this.author.compareTo(o.author); } } @Test public void builtInCollectors() throws IOException { String path = this.getClass().getResource("/Books.txt").getPath(); Stream<String> lines = Files.lines(Path.of(path)); Spliterator<String> spliterator = lines.spliterator(); Stream<Book> bookStream = StreamSupport.stream(new BookSpliterator(spliterator), false); List<Book> bookList = bookStream.collect(Collectors.toList()); List<String> nameList = bookList.stream().map(b->b.name).collect(Collectors.toUnmodifiableList()); Set<String> authorSet = bookList.stream().map(b->b.author).collect(Collectors.toUnmodifiableSet()); TreeSet<String> sortedAuthorList = bookList.stream().map(b->b.author).collect(Collectors.toCollection(TreeSet::new)); Map<String,String> map = bookList.stream().collect(Collectors.toMap(e->e.name, e->e.author)); Map<Boolean, List<Book>> partitions = bookList.stream().collect(Collectors.partitioningBy(a-> a.author.contains("w"))); Map<String , List<Book>> groups = bookList.stream().collect(Collectors.groupingBy(a-> a.author.substring(0,1))); String csNames = bookList.stream().map(v->v.name).collect(Collectors.joining(",")); Map<String, Long> groupsCounts = bookList .stream() .collect( Collectors.groupingBy( a-> a.author.substring(0,1), Collectors.counting() ) ); Map<String, Double> groupsSum = bookList .stream() .collect( Collectors.groupingBy( a-> a.author.substring(0,1), Collectors.summingDouble(e->e.score) ) ); Map<String, Optional<Book>> maxSalaryEmployee = bookList .stream() .collect( Collectors.groupingBy( a-> a.author.substring(0,1), Collectors.maxBy(Comparator.comparing(e-> e.score)) ) ); // Map<String, Optional<Double>> maxSalaries = bookList // .stream() // .collect( // Collectors.groupingBy( // a -> a.author.substring(0,1), // Collectors.mapping( // e-> e.score, // Collectors.maxBy( // Comparator.comparing(Function.identity()) // ) // ) // ) // ); } @Test public void customCollectors(){ List<Integer> list = List.of(4,2,3); Collector<Integer, List<Integer>, List<Integer>> toList = Collector.of( ArrayList::new, (list1, a) -> list1.add(a), (list1,list2) -> { list1.addAll(list2); return list1; }, Collector.Characteristics.IDENTITY_FINISH ); Assertions.assertEquals(List.of(4,2,3), list.stream().collect(toList)); Collector<Integer, List<Integer>, List<Integer>> toSortedList = Collector.of( ArrayList::new, (list1, a) -> list1.add(a), (list1,list2) -> { list1.addAll(list2); return list1; }, list1 -> {Collections.sort(list1); return list1;}, Collector.Characteristics.UNORDERED ); Assertions.assertEquals(List.of(2,3, 4), list.stream().collect(toSortedList)); } }
[ "roman_babenko@gmx.net" ]
roman_babenko@gmx.net
80051356d4cf5bba1f6db3ea20630f248a6f408a
417ea1955c8d46815247bfa242d09114674e6350
/Tema 6/examples/CompanyStructure/Accountant.java
7ed65e75201bfc88be5d97bf3c1d5ff5c9d1cf1c
[]
no_license
jmmenah/java-exercises
f9156b07dbd9e67fe74be02534cd5f90badda64a
1de020d69ac7c5e4b5f928b00d489e047d943142
refs/heads/master
2022-06-27T07:04:44.732890
2022-06-22T22:14:32
2022-06-22T22:14:32
211,938,203
0
1
null
2022-06-22T22:14:33
2019-09-30T19:23:36
Java
UTF-8
Java
false
false
767
java
public class Accountant extends BusinessEmployee{ private TechnicalLead teamSupported; public Accountant(String name) { super(name); } public TechnicalLead getTeamSupported() { return teamSupported; } public void supportTeam(TechnicalLead lead) { teamSupported = lead; double total = 0; for (int i = 0; i < teamSupported.reports.size(); i++) { total += teamSupported.reports.get(i).getBaseSalary(); } bonusBudget = total * 1.1; } public boolean approveBonus(double bonus) { return teamSupported != null && bonus < bonusBudget; } public String employeeStatus() { return super.employeeStatus() + " is supporting " + teamSupported; } }
[ "noreply@github.com" ]
noreply@github.com
8f9e0bd57e9d5a8b409618a32c9c4bfd616478dd
7de21a1866a7dd8188e6ca58177fc2e0f4a3a8ae
/laskarit/viikko2/Unicafe/src/test/java/com/mycompany/unicafe/MaksukorttiTest.java
0804607ec03b52e0e581f953fa35869d8c666ef0
[]
no_license
juliapalorinne/ot-harjoitustyo
97568c75175fa92177a80055ef1e6b3743405d5e
74551e8ca4e7e45676efa003fa45038244a765bb
refs/heads/main
2023-02-24T08:35:49.688867
2021-01-23T22:47:27
2021-01-23T22:47:27
247,513,835
0
0
null
2020-10-13T20:35:13
2020-03-15T17:17:07
Java
UTF-8
Java
false
false
1,257
java
package com.mycompany.unicafe; import static org.junit.Assert.*; import org.junit.Before; import org.junit.Test; public class MaksukorttiTest { Maksukortti kortti; @Before public void setUp() { kortti = new Maksukortti(1000); } @Test public void luotuKorttiOlemassa() { assertTrue(kortti!=null); } @Test public void alkuarvoOnOikein() { assertEquals(1000, kortti.saldo()); } @Test public void kortilleVoiLadataRahaa() { kortti.lataaRahaa(1000); assertEquals(2000, kortti.saldo()); } @Test public void kortiltaVoiOttaaRahaa() { kortti.otaRahaa(500); assertEquals(500, kortti.saldo()); } @Test public void kortiltaEiVoiOttaaLiikaaRahaa() { kortti.otaRahaa(2000); assertEquals(1000, kortti.saldo()); } @Test public void otaRahaaPalauttaaTrueJosTarpeeksiRahaa() { assertEquals(true, kortti.otaRahaa(500)); } @Test public void otaRahaaPalauttaaFalseJosEiTarpeeksiRahaa() { assertEquals(false, kortti.otaRahaa(2000)); } @Test public void toStringToimii() { assertEquals("saldo: 10.0", kortti.toString()); } }
[ "julia.palorinne@helsinki.fi" ]
julia.palorinne@helsinki.fi
8f7dcf7bc9d4e497b195607cb940f749c64de21b
1f3c00468850bc6e7794cb70efd8dd1c73eda1b5
/GHManager/src/net/hxkg/network/Client.java
37dd1e1a0919c1efae1cb4cb1e20785f058c173b
[]
no_license
litcas/PRJ
2861f3eabe163465fb640b5259d0b946a3d3778a
2cceb861502d8b7b0f54e4b99c50469b3c97b63a
refs/heads/master
2021-06-27T19:32:47.168612
2017-09-17T05:44:31
2017-09-17T05:44:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,210
java
package net.hxkg.network; import java.net.URI; import net.hxkg.ghmanager.R; import net.hxkg.news.MainFramentNewsActivity; import org.java_websocket.client.WebSocketClient; import org.java_websocket.drafts.Draft; import org.java_websocket.handshake.ServerHandshake; import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.graphics.BitmapFactory; public class Client extends WebSocketClient { Context context; public Client(URI serverUri, Draft draft,Context context) { super(serverUri, draft); this.context=context; } @Override public void onClose(int arg0, String arg1, boolean arg2) { System.out.println("onClose"); connect(); } @Override public void onError(Exception arg0) { System.out.println("onError"); arg0.printStackTrace(); } @Override public void onMessage(String msg) { System.out.println(msg); String[] ms=msg.split(","); String titleString=ms[1]; Intent intent=new Intent(context,MainFramentNewsActivity.class); intent.putExtra("model", 1); Notify(1,intent,ms[0],"您有新的"+ms[0],titleString); } @Override public void onOpen(ServerHandshake arg0) { System.out.println("onOpen"); String userid=context.getSharedPreferences("User", 0).getString("userid", ""); send("USER_"+String.valueOf(userid)); } private void Notify(int ID,Intent intent,String smalltitle,String title,String content) { NotificationManager notifym=(NotificationManager)context.getSystemService(context.NOTIFICATION_SERVICE); Notification.Builder buider=new Notification.Builder(context); buider.setSmallIcon(R.drawable.leave_img); buider.setLargeIcon(BitmapFactory.decodeResource(context.getResources(),R.drawable.drawer_logo)); buider.setTicker(smalltitle); buider.setContentTitle(title); buider.setContentText(content); PendingIntent pi=PendingIntent.getActivity(context, 100, intent, PendingIntent.FLAG_UPDATE_CURRENT); buider.setContentIntent(pi); buider.setDefaults(Notification.DEFAULT_SOUND); Notification note=buider.getNotification(); notifym.notify(ID, note); } }
[ "393054246@qq.com" ]
393054246@qq.com
fb6aed53031a35ff41d340c4df95ece46b7d1c29
b9df2868430c1c192c97597836b96824bce02aa9
/src/main/java/com/rocketteam/jobfull/service/JobService.java
fe9697c461895265a57a52514f5bd7ed9d9366e9
[]
no_license
Spafi/jobfull-2
4c6ce559445ee922bbb9f696f9d3b1953c62e745
4d2d66726be1eee069d04c7c73460a86ccc61ac4
refs/heads/master
2023-04-06T15:30:44.759637
2021-04-15T12:48:20
2021-04-15T12:48:20
351,777,800
0
0
null
null
null
null
UTF-8
Java
false
false
482
java
package com.rocketteam.jobfull.service; import com.rocketteam.jobfull.model.Job; import com.rocketteam.jobfull.model.JobHunter; import org.springframework.stereotype.Service; import java.util.List; import java.util.UUID; @Service public interface JobService { List<Job> getAll(); List<JobHunter> getApplicants(UUID jobId); Job getById(UUID jobId); List<Job> getByName(String name); void applyToJob(UUID jobId, UUID jobHunterId); }
[ "63115231+Spafi@users.noreply.github.com" ]
63115231+Spafi@users.noreply.github.com
4df42a9b4d6e2480d9ecd3dd32ca82ef08a8523e
f97eba6d9ed7f81b3f6f4ed4e4579cf2b9f826d6
/app/src/main/java/ru/swift/moderncleanarchitecture/data/remote/mapper/ExerciseRemoteDataMapper.java
b2ea84a458dfde2474abdb2cb3a4e1e3cd565544
[ "MIT" ]
permissive
sWift-sai/ModernCleanArchitecture
2ca61c36884906567e28a9d3e91d7cf86aa1a87d
9b982e86f6c300ee7a4ad7fc69a9101ed963b62d
refs/heads/master
2021-01-21T20:25:44.726417
2017-06-17T12:32:13
2017-06-17T12:32:13
92,233,030
2
0
null
null
null
null
UTF-8
Java
false
false
566
java
package ru.swift.moderncleanarchitecture.data.remote.mapper; import org.mapstruct.Mapper; import org.mapstruct.factory.Mappers; import java.util.List; import ru.swift.moderncleanarchitecture.data.remote.model.ExerciseRemote; import ru.swift.moderncleanarchitecture.domain.model.Exercise; @Mapper public interface ExerciseRemoteDataMapper { ExerciseRemoteDataMapper INSTANCE = Mappers.getMapper(ExerciseRemoteDataMapper.class); Exercise transform(ExerciseRemote exerciseRemote); List<Exercise> transform(List<ExerciseRemote> exerciseRemoteList); }
[ "swift.rus.92@gmail.com" ]
swift.rus.92@gmail.com
7cce9370418d1bc60740d6848520da50de8d4bed
7e2e607c68161306d0b06cd71c2efc3c6cec6090
/src/main/java/mockito/AService.java
29ca0185e8916aa642f8fba8ffb9a52efb9d4727
[]
no_license
1090525210/java_exercise
4c1024142529ecff5faa77f26825070c2f4023e1
afbec77c5b600d1fb237a1310a027bd0eeebe2e2
refs/heads/main
2023-08-23T20:04:01.101959
2021-09-14T02:49:01
2021-09-14T02:49:01
403,826,368
0
0
null
null
null
null
UTF-8
Java
false
false
510
java
package mockito; import junit.BService; import java.math.BigDecimal; import java.math.RoundingMode; public class AService { BService bService; public BigDecimal getRenMinBi(BigDecimal money, String type) throws Exception { BigDecimal result = bService.getRenMinBi(money, type); if ("AMD".equals(type) || "JPY".equals(type)) { return result.setScale(1, RoundingMode.HALF_UP); } else { return result.setScale(0, RoundingMode.HALF_UP); } } }
[ "jiazhen.ruan@accenture.com" ]
jiazhen.ruan@accenture.com
a6f1a8d9c1960f4686c0500ef9454c0984ba94e4
ab6e9702bc4bbb49eba8e932e41ae542b4b5f75d
/src/main/java/com/epam/javacourse/country/search/CountryOrderByField.java
48f876e0f3c41f1f50d2e110875b9a1db5e3af60
[]
no_license
msleprosy/javacourse
dc9f01d6281c9fc41925b5203ccb37825703e083
9ae4610262ceb4505689fe91dfeacbbf526c5d79
refs/heads/master
2020-04-25T01:15:02.481645
2019-05-06T23:11:12
2019-05-06T23:11:12
172,402,925
0
0
null
null
null
null
UTF-8
Java
false
false
380
java
package com.epam.javacourse.country.search; /** * Created by veronika on 07.03.2019. */ public enum CountryOrderByField { NAME("countryname"); CountryOrderByField(String requestParamName) { this.requestParamName = requestParamName; } private String requestParamName; public String getRequestParamName() { return requestParamName; } }
[ "msleprosy@yandex.ru" ]
msleprosy@yandex.ru
dcf7372fee3f4a41c3239a79d2df1b7d7f57de03
95d20c83d8aff34e314c56a3ecb2b87c9fa9fc86
/Ghidra/Features/VersionTracking/ghidra_scripts/OverrideFunctionPrototypesOnAcceptedMatchesScript.java
49fc770c6e17e12d9393ce41220f70d0ad633809
[ "GPL-1.0-or-later", "GPL-3.0-only", "Apache-2.0", "LicenseRef-scancode-public-domain", "LGPL-2.1-only", "LicenseRef-scancode-unknown-license-reference" ]
permissive
NationalSecurityAgency/ghidra
969fe0d2ca25cb8ac72f66f0f90fc7fb2dbfa68d
7cc135eb6bfabd166cbc23f7951dae09a7e03c39
refs/heads/master
2023-08-31T21:20:23.376055
2023-08-29T23:08:54
2023-08-29T23:08:54
173,228,436
45,212
6,204
Apache-2.0
2023-09-14T18:00:39
2019-03-01T03:27:48
Java
UTF-8
Java
false
false
5,091
java
/* ### * IP: GHIDRA * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // An example of how to use an existing Version Tracking session to iterate over accepted matches // to manipulate function prototypes. //@category Examples.Version Tracking import ghidra.app.script.GhidraScript; import ghidra.app.script.ImproperUseException; import ghidra.feature.vt.api.db.VTSessionDB; import ghidra.feature.vt.api.main.*; import ghidra.framework.model.DomainFile; import ghidra.framework.model.DomainObject; import ghidra.program.model.address.Address; import ghidra.program.model.lang.Language; import ghidra.program.model.lang.LanguageDescription; import ghidra.program.model.listing.*; import ghidra.program.model.symbol.SourceType; import ghidra.util.exception.DuplicateNameException; import ghidra.util.exception.InvalidInputException; import java.util.List; public class OverrideFunctionPrototypesOnAcceptedMatchesScript extends GhidraScript { @Override protected void run() throws Exception { DomainFile vtFile = askDomainFile("Select VT Session"); openVTSessionAndDoWork(vtFile); } private void openVTSessionAndDoWork(DomainFile domainFile) { DomainObject vtDomainObject = null; try { vtDomainObject = domainFile.getDomainObject(this, false, false, monitor); doWork((VTSessionDB) vtDomainObject); } catch (ClassCastException e) { printerr("That domain object (" + domainFile.getName() + ") is not a VT session"); } catch (Exception e) { e.printStackTrace(); } finally { if (vtDomainObject != null) { vtDomainObject.release(this); } } } private void doWork(VTSessionDB session) throws InvalidInputException, DuplicateNameException, ImproperUseException { println("Working on session: " + session); Program sourceProg = session.getSourceProgram(); Program destProg = session.getDestinationProgram(); int transID = -1; boolean allIsGood = false; try { transID = destProg.startTransaction("OverrideFunctionPrototypes"); Language sourceLanguage = sourceProg.getLanguage(); Language destLanguage = destProg.getLanguage(); LanguageDescription sourceDesc = sourceLanguage.getLanguageDescription(); LanguageDescription destDesc = destLanguage.getLanguageDescription(); if (!(sourceDesc.getProcessor().equals(destDesc.getProcessor()) && sourceDesc.getEndian() == destDesc.getEndian() && sourceDesc.getSize() == destDesc.getSize())) { boolean yes = askYesNo("Warning: possibly incompatible source/dest architectures", "Source and destination programs might have different architectures. Continue?"); if (!yes) { return; } } FunctionManager sourceFuncMgr = sourceProg.getFunctionManager(); FunctionManager destFuncMgr = destProg.getFunctionManager(); VTAssociationManager associationManager = session.getAssociationManager(); List<VTAssociation> associations = associationManager.getAssociations(); for (VTAssociation association : associations) { if (association.getType() == VTAssociationType.FUNCTION && association.getStatus() == VTAssociationStatus.ACCEPTED) { Address srcAddr = association.getSourceAddress(); Address destAddr = association.getDestinationAddress(); Function sourceFunc = sourceFuncMgr.getFunctionAt(srcAddr); if (sourceFunc == null) { continue; } Function destFunc = destFuncMgr.getFunctionAt(destAddr); if (destFunc == null) { continue; } transfer(sourceFunc, destFunc); } } allIsGood = true; } finally { if (transID != -1) { destProg.endTransaction(transID, allIsGood); } } } @SuppressWarnings("deprecation") private void transfer(Function sourceFunc, Function destFunc) throws InvalidInputException, DuplicateNameException { // FIXME: this is just a skeleton, I am dumb, failed all of RE, etc. // please make this do what you really want destFunc.setReturnType(sourceFunc.getReturnType(), sourceFunc.getSignatureSource()); destFunc.setName(sourceFunc.getName(), SourceType.USER_DEFINED); destFunc.setCallingConvention(sourceFunc.getCallingConventionName()); int parameterCount = destFunc.getParameterCount(); for (int ii = parameterCount - 1; ii >= 0; --ii) { // TODO: Fix deprecated method call destFunc.removeParameter(ii); } parameterCount = sourceFunc.getParameterCount(); for (int ii = 0; ii < parameterCount; ++ii) { Parameter parameter = sourceFunc.getParameter(ii); // TODO: Fix deprecated method call destFunc.addParameter(parameter, SourceType.USER_DEFINED); } } }
[ "46821332+nsadeveloper789@users.noreply.github.com" ]
46821332+nsadeveloper789@users.noreply.github.com
dbd49e6b2d9b57553a4a4a57647b08c9eb7eda6e
835ceb7d0cb0f72d08468be456f9f29ed9bf7ab3
/JAVA/AlterGame.java
47a85e37349f27038ad1278427fd78a993000430
[]
no_license
adityasharma1912/Cooking
217df450685dc77bba43838542d48d6150d3c31a
83d8da2647da4db7373e5c9d1423e144005d92c2
refs/heads/master
2020-03-16T18:08:06.944279
2018-05-10T07:04:17
2018-05-10T07:04:17
132,861,146
0
0
null
null
null
null
UTF-8
Java
false
false
1,340
java
import java.math.BigInteger; import java.util.Scanner; public class AlterGame { private static String turn = "Louise"; public static void changeTurn() { if (turn.equals("Louise")) turn = "Richard"; else turn = "Louise"; } private static BigInteger processN(BigInteger N) { if (((N.mod(new BigInteger("2")).compareTo(new BigInteger("0")))) == 0) return N.divide(new BigInteger("2")); else { int count = 0; BigInteger P = N; while ((N.compareTo(new BigInteger("0")) == 1)) { N = N.divide(new BigInteger("2")); count++; } BigInteger two = new BigInteger("2"); two = two.pow(count - 1); return P.subtract(two); } } public static String getWinnerName(BigInteger N) { if (N.equals(1)) return "Richard"; while (true) { N = processN(N); if ((N.compareTo(new BigInteger("1"))) == 0) return turn; else changeTurn(); } } public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int testCases = Integer.parseInt(scanner.next()); BigInteger arr[] = new BigInteger[testCases]; for (int i = 0; i < testCases; i++) arr[i] = scanner.nextBigInteger(); for (BigInteger i : arr) { turn = "Louise"; System.out.println(getWinnerName(i)); } scanner.close(); } }
[ "adityasharma1912@gmail.com" ]
adityasharma1912@gmail.com
b8bae6a5c0b19d8aa537b34a1e687b4b5c90d122
42780bc48660a0875b4a957db6ca96ebaf7eeef2
/src/aplikasifurniture/form/PopPelanggan.java
2f2094b43b82122f5b8a78b6ba985962a65f6179
[]
no_license
MahendraCandi/Aplikasi-Jual-Pesan-Furniture
98a3ba45ab5931f33ba3013eeeaf1eaef1fc5fb7
f299b2a223bf1a551ac9844fc370cfb31e574808
refs/heads/master
2021-09-05T10:37:28.174017
2018-01-26T13:37:26
2018-01-26T13:37:26
119,053,777
0
0
null
null
null
null
UTF-8
Java
false
false
6,951
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 aplikasifurniture.form; import aplikasifurniture.AplikasiFurniture; import aplikasifurniture.controller.PelangganController; import aplikasifurniture.data.Pelanggan; import java.awt.Font; import javax.swing.JOptionPane; import javax.swing.table.DefaultTableModel; /** * * @author Candi-PC */ public class PopPelanggan extends javax.swing.JFrame { PelangganController pCont=new PelangganController(AplikasiFurniture.emf); Pelanggan pelanggan=new Pelanggan(); DefaultTableModel model; FormPemesanan FP=null; /** * Creates new form PopPelanggan */ public PopPelanggan() { initComponents(); model=new DefaultTableModel(){ @Override public boolean isCellEditable(int row, int column) { return false; } }; model.addColumn("Kode Pelanggan"); model.addColumn("Nama Pelanggan"); model.addColumn("No Telp"); model.addColumn("Alamat"); model.addColumn("Email"); model.addColumn("Keterangan"); tablePelanggan.getTableHeader().setFont(new Font("Segoe UI", Font.BOLD, 14)); showTablePelanggan(); setLocationRelativeTo(null); } private void showTablePelanggan(){ tablePelanggan.setModel(pCont.showPopTable(model)); } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jScrollPane1 = new javax.swing.JScrollPane(); tablePelanggan = new javax.swing.JTable(); jButton1 = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle("Table Pelanggan"); tablePelanggan.setFont(new java.awt.Font("Segoe UI", 0, 14)); // NOI18N tablePelanggan.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { }, new String [] { "Kode Pelanggan", "NamaPelanggan", "No Telepon", "Alamat", "Email" } )); jScrollPane1.setViewportView(tablePelanggan); jButton1.setFont(new java.awt.Font("Segoe UI", 0, 14)); // NOI18N jButton1.setText("Pilih Pelanggan"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane1) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addContainerGap(115, Short.MAX_VALUE) .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 400, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(110, 110, 110)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()) ); pack(); }// </editor-fold>//GEN-END:initComponents private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed int baris=tablePelanggan.getSelectedRow(); if(baris==-1){ JOptionPane.showMessageDialog(null, "Pilih baris!"); }else{ FP.kdPel=tablePelanggan.getValueAt(baris, 0).toString(); FP.nmPel=tablePelanggan.getValueAt(baris, 1).toString(); FP.tlp=tablePelanggan.getValueAt(baris, 2).toString(); FP.alm=tablePelanggan.getValueAt(baris, 3).toString(); FP.eml=tablePelanggan.getValueAt(baris, 4).toString(); FP.pilihPelanggan(); this.dispose(); } }//GEN-LAST:event_jButton1ActionPerformed /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(PopPelanggan.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(PopPelanggan.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(PopPelanggan.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(PopPelanggan.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new PopPelanggan().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton jButton1; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JTable tablePelanggan; // End of variables declaration//GEN-END:variables }
[ "abdumaadjidcandi@gmail.com" ]
abdumaadjidcandi@gmail.com
2e43b0fa4b6a50363877ff90c2da139801934714
486af4138f5ce3ba8ab6503ac0b485282fcc0f83
/src/main/java/com/example/demo/common/IncrementUtil.java
2ce6201dc4dd4f0934f2ff379ae8e569cbb5a467
[]
no_license
kuaikuaidaodao/project
f16d08100d2f5fc83d08dfa982d06fe32d0f152f
6d6587b19bc8709d1009fd1e2c81f87393e19f18
refs/heads/master
2021-04-18T19:15:39.809731
2018-06-20T04:42:50
2018-06-20T04:42:50
126,261,218
0
0
null
null
null
null
UTF-8
Java
false
false
1,295
java
package com.example.demo.common; import org.apache.poi.hssf.usermodel.HSSFCell; public class IncrementUtil { public static String getCellValue(HSSFCell cell){ String value = null; //简单的查检列类型 switch(cell.getCellType()) { case HSSFCell.CELL_TYPE_STRING://字符串 value = cell.getRichStringCellValue().getString(); break; case HSSFCell.CELL_TYPE_NUMERIC://数字 long dd = (long)cell.getNumericCellValue(); value = dd+""; break; case HSSFCell.CELL_TYPE_BLANK: value = ""; break; case HSSFCell.CELL_TYPE_FORMULA: value = String.valueOf(cell.getCellFormula()); break; case HSSFCell.CELL_TYPE_BOOLEAN://boolean型值 value = String.valueOf(cell.getBooleanCellValue()); break; case HSSFCell.CELL_TYPE_ERROR: value = String.valueOf(cell.getErrorCellValue()); break; default: break; } return value; } }
[ "980894994@qq.com" ]
980894994@qq.com
74afacd47af4cef1cb67c965dde46ea8216006ba
2c907852aff2cb9fae4cfcdd2cc1eede05684223
/src/main/java/ua/pp/fland/web/bookkeeping/storage/model/Record.java
39b6d75bcdb315f567066c8ec5fa791c031deb8a
[]
no_license
fland/safe-bookkeeping
56c00754cc3ce7b41411c32b373fdb59d29b2af7
f6517f21702d43c9bc06f219b62a15c1896e495c
refs/heads/master
2020-06-09T05:39:18.889581
2014-10-14T16:00:17
2014-10-14T16:00:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,817
java
package ua.pp.fland.web.bookkeeping.storage.model; import lombok.Getter; import lombok.Setter; import lombok.ToString; import org.springframework.data.annotation.Id; import org.springframework.data.mongodb.core.mapping.Document; /** * Created with IntelliJ IDEA. * User: maxim * Date: 9/25/14 * Time: 6:50 PM * To change this template use File | Settings | File Templates. */ @Document(collection = Record.COLLECTION_NAME) @ToString(includeFieldNames = true) public class Record { public static final String COLLECTION_NAME = "records"; @Id @Setter @Getter private String id; @Getter @Setter private String description; @Getter @Setter private Date date; public Record() { } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Record record = (Record) o; if (description != null ? !description.equals(record.description) : record.description != null) return false; if (id != null ? !id.equals(record.id) : record.id != null) return false; return true; } @Override public int hashCode() { int result = id != null ? id.hashCode() : 0; result = 31 * result + (description != null ? description.hashCode() : 0); return result; } @ToString(includeFieldNames = true) public static class Date { @Getter @Setter private int year; @Getter @Setter private int month; @Getter @Setter private int day; public Date() { } public Date(int year, int month, int day) { this.year = year; this.month = month; this.day = day; } } }
[ "gaus.fland@gmail.com" ]
gaus.fland@gmail.com
cb9dac11f1ff42314c42a6a1f22a472d5f0d9bee
b11248eb8d38355e10861c6c19750c55b4530e38
/src/main/java/hu/akarnokd/rxjava2/functions/PlainFunction5.java
c23222eb1254517f14d56874e0f10f4e0a259388
[ "Apache-2.0" ]
permissive
tomdotbradshaw/RxJava2Extensions
2d50d14aff39a1ddb4fe6a32352aebecc4e8d68d
254fead58021bb8304aa1c343cc776e7b5a3168d
refs/heads/master
2020-04-06T16:48:30.122024
2018-11-15T03:29:15
2018-11-15T03:30:42
157,635,134
0
0
Apache-2.0
2018-11-15T01:36:50
2018-11-15T01:36:50
null
UTF-8
Java
false
false
1,213
java
/* * Copyright 2016-2018 David Karnok * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package hu.akarnokd.rxjava2.functions; import io.reactivex.functions.Function5; /** * A {@link Function5} with suppressed exception on its * {@link #apply(Object, Object, Object, Object, Object)} method. * * @param <T1> the first argument type * @param <T2> the second argument type * @param <T3> the third argument type * @param <T4> the fourth argument type * @param <T5> the fifth argument type * @param <R> the output value type */ public interface PlainFunction5<T1, T2, T3, T4, T5, R> extends Function5<T1, T2, T3, T4, T5, R> { @Override R apply(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5); }
[ "akarnokd@gmail.com" ]
akarnokd@gmail.com
9c96bd264c020f7ce584c960776f1df0a235be92
5648cef2bacbe7430045605bdd87bd1934c7d8f1
/XhsEmoticonsKeyboard/src/com/keyboard/view/RoundAngleImageView.java
f85b9eaed1dfc4bb87dbccf15831253ad40cea9e
[]
no_license
caozhongzheng/moin_facealign
3f7e1323d86c58098559d75655885585e420ec25
e6930b4b72758e12ecc7fa4474f1f3594d751fde
refs/heads/master
2021-01-25T13:34:53.705717
2018-03-02T13:50:30
2018-03-02T13:50:30
123,584,680
0
0
null
null
null
null
UTF-8
Java
false
false
4,842
java
package com.keyboard.view; /** * Created by moying on 15/9/30. */ import android.content.Context; import android.content.res.TypedArray; import android.graphics.Bitmap; import android.graphics.Bitmap.Config; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.Path; import android.graphics.PorterDuff; import android.graphics.PorterDuffXfermode; import android.graphics.RectF; import android.util.AttributeSet; import android.widget.ImageView; public class RoundAngleImageView extends ImageView { private Paint paint; private int roundWidth = 5; private int roundHeight = 5; private Paint paint2; public RoundAngleImageView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); init(context, attrs); } public RoundAngleImageView(Context context, AttributeSet attrs) { super(context, attrs); init(context, attrs); } public RoundAngleImageView(Context context) { super(context); init(context, null); } private void init(Context context, AttributeSet attrs) { if(attrs != null) { TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.RoundAngleImageView); roundWidth= a.getDimensionPixelSize(R.styleable.RoundAngleImageView_roundWidth, roundWidth); roundHeight= a.getDimensionPixelSize(R.styleable.RoundAngleImageView_roundHeight, roundHeight); }else { float density = context.getResources().getDisplayMetrics().density; roundWidth = (int) (roundWidth*density); roundHeight = (int) (roundHeight*density); } paint = new Paint(); paint.setColor(Color.WHITE); paint.setAntiAlias(true); paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_OUT)); paint2 = new Paint(); paint2.setXfermode(null); } @Override public void draw(Canvas canvas) { Bitmap bitmap = null; try { bitmap = Bitmap.createBitmap(getWidth(), getHeight(), Config.ARGB_8888); } catch (Exception e) { android.util.Log.i(RoundAngleImageView.class.getSimpleName(), "exception " + e); e.printStackTrace(); } catch (OutOfMemoryError error) { android.util.Log.i(RoundAngleImageView.class.getSimpleName(), "OutOfMemoryError " + error); error.printStackTrace(); } if (bitmap != null) { Canvas canvas2 = new Canvas(bitmap); super.draw(canvas2); drawLiftUp(canvas2); drawRightUp(canvas2); drawLiftDown(canvas2); drawRightDown(canvas2); canvas.drawBitmap(bitmap, 0, 0, paint2); if (bitmap != null) { bitmap.recycle(); } } } private void drawLiftUp(Canvas canvas) { Path path = new Path(); path.moveTo(0, roundHeight); path.lineTo(0, 0); path.lineTo(roundWidth, 0); path.arcTo(new RectF( 0, 0, roundWidth*2, roundHeight*2), -90, -90); path.close(); canvas.drawPath(path, paint); } private void drawLiftDown(Canvas canvas) { Path path = new Path(); path.moveTo(0, getHeight()-roundHeight); path.lineTo(0, getHeight()); path.lineTo(roundWidth, getHeight()); path.arcTo(new RectF( 0, getHeight()-roundHeight*2, 0+roundWidth*2, getHeight()), 90, 90); path.close(); canvas.drawPath(path, paint); } private void drawRightDown(Canvas canvas) { Path path = new Path(); path.moveTo(getWidth()-roundWidth, getHeight()); path.lineTo(getWidth(), getHeight()); path.lineTo(getWidth(), getHeight()-roundHeight); path.arcTo(new RectF( getWidth()-roundWidth*2, getHeight()-roundHeight*2, getWidth(), getHeight()), 0, 90); path.close(); canvas.drawPath(path, paint); } private void drawRightUp(Canvas canvas) { Path path = new Path(); path.moveTo(getWidth(), roundHeight); path.lineTo(getWidth(), 0); path.lineTo(getWidth()-roundWidth, 0); path.arcTo(new RectF( getWidth()-roundWidth*2, 0, getWidth(), 0+roundHeight*2), -90, 90); path.close(); canvas.drawPath(path, paint); } }
[ "caozhongzheng@peersafe.cn" ]
caozhongzheng@peersafe.cn
a2ac003b6252883d5f46cd5361889f5d3be330e8
f045e907c3e2a24793dc3a8a69634273af6129c5
/treemap/src/main/java/edu/umd/cs/treemap/SliceLayout.java
c420fd6dd281e5fb53810587a6a0eda0e1a1b890
[]
no_license
BakaBoing/MSc-S2-Alternative-User-Interface-Engineering-TypeTrainer
f693df2d56f31eaeac97b0d11d7734108edeb05a
a7c99e3c283fa7c5dc76b4467ab06944aaa878f7
refs/heads/master
2023-06-09T15:56:59.150045
2021-07-02T16:23:29
2021-07-02T16:23:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,868
java
/** * Copyright (C) 2001 by University of Maryland, College Park, MD 20742, USA * and Martin Wattenberg, w@bewitched.com * All rights reserved. * Authors: Benjamin B. Bederson and Martin Wattenberg * http://www.cs.umd.edu/hcil/treemaps */ package edu.umd.cs.treemap; /** * The original slice-and-dice layout for treemaps. */ public class SliceLayout extends AbstractMapLayout { public static final int BEST=2, ALTERNATE=3; private int orientation; public SliceLayout() { this(ALTERNATE); } public SliceLayout(int orientation) { this.orientation=orientation; } public void layout(Mappable[] items, Rect bounds) { if (items.length==0) return; int o=orientation; if (o==BEST) layoutBest(items, 0, items.length-1, bounds); else if (o==ALTERNATE) layout(items,bounds,items[0].getDepth()%2); else layout(items,bounds,o); } public static void layoutBest(Mappable[] items, int start, int end, Rect bounds) { sliceLayout(items,start,end,bounds, bounds.w>bounds.h ? HORIZONTAL : VERTICAL, ASCENDING); } public static void layoutBest(Mappable[] items, int start, int end, Rect bounds, int order) { sliceLayout(items,start,end,bounds, bounds.w>bounds.h ? HORIZONTAL : VERTICAL, order); } public static void layout(Mappable[] items, Rect bounds, int orientation) { sliceLayout(items,0,items.length-1,bounds,orientation); } public String getName() { return "Slice-and-dice"; } public String getDescription() { return "This is the original treemap algorithm, "+ "which has excellent stability properies "+ "but leads to high aspect ratios."; } }
[ "jan.222.ik@gmail.com" ]
jan.222.ik@gmail.com
1fd50a8bdd4e1a1d6770e056c929d79f3fe6e3f1
707417a89fc6bbef550ca9bb3b950be5193b86c1
/app/src/androidTest/java/ec/edu/tecnologicoloja/shoppinglist/ExampleInstrumentedTest.java
d7c3c207d927281394b8e69aabb1ef1cdaff678d
[]
no_license
DaxH/SQLite
d7edf4ff5c17e381ad382d2bafc1c171b4a6026c
1a0f0c832b10d28342fb05a19f146d676fab8c82
refs/heads/master
2020-12-29T10:24:07.453296
2020-02-06T00:48:35
2020-02-06T00:48:35
238,572,808
0
0
null
null
null
null
UTF-8
Java
false
false
786
java
package ec.edu.tecnologicoloja.shoppinglist; import android.content.Context; import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); assertEquals("ec.edu.tecnologicoloja.shoppinglist", appContext.getPackageName()); } }
[ "52769764+DaxH@users.noreply.github.com" ]
52769764+DaxH@users.noreply.github.com
47732e86bb45cfbc4da892a24e524022a8f43ce9
b924c45521b81251cc1acbe4ba3f993951731ee4
/jeecg-boot/jeecg-boot-module-company/src/main/java/org/jeecg/modules/business/service/impl/ViewCompanyBaseServiceImpl.java
0736a4286934a86bf7f336f2a576be740241062e
[ "Apache-2.0", "MIT" ]
permissive
xudongyi/jeecg-boot-new
336004a7b717f8245d3972028c32354030715078
f4c59e6e924c16da67d8ba4a86c09ead1c6d9612
refs/heads/master
2021-10-06T10:38:21.091681
2021-09-26T09:18:58
2021-09-26T09:18:58
224,561,208
1
0
Apache-2.0
2020-05-11T05:10:55
2019-11-28T03:17:50
null
UTF-8
Java
false
false
499
java
package org.jeecg.modules.business.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.jeecg.modules.business.mapper.ViewCompanyBaseMapper; import org.jeecg.modules.business.service.IViewCompanyBaseService; import org.jeecg.modules.business.vo.ViewCompanyBase; import org.springframework.stereotype.Service; @Service public class ViewCompanyBaseServiceImpl extends ServiceImpl<ViewCompanyBaseMapper, ViewCompanyBase> implements IViewCompanyBaseService { }
[ "1441331786@qq.com" ]
1441331786@qq.com
f1377728b6d5412c4e388d5fa9944991bfaef8a1
36c2725f9e4ceb0fe553ed964bab6c7a79d84b18
/quick/src/quick/quicks.java
65be9db79793a4a777952855ce7a40f9fe4452af
[]
no_license
rich9005/MyJavaExamples
4f296a5d464eba9d2c56745cad1a9247774a9106
daebfcada2a46a8bc5b0f25e4b913474ae0b1dd6
refs/heads/master
2021-01-10T05:08:08.162068
2016-02-06T09:05:24
2016-02-06T09:05:24
50,468,346
0
0
null
null
null
null
UTF-8
Java
false
false
801
java
package quick; public class quicks { public static void sort(int [] a){ if ( a.length == 0 ) return; else quicksort(a,0,a.length -1); } public static void quicksort(int [] a,int i , int j){ int lx = i; int hx = j; int pivot = a[lx + (hx - lx)/2]; while (i<=j){ while (a[i]<pivot){ i++; } while (a[j]> pivot){ j--; } if (i <=j) { int temp = a[i]; a[i] = a[j]; a[j] = temp; i++; j--; } } if (i< hx) quicksort(a,i,hx); if ( j > lx) quicksort(a,lx,j); } public static void main (String [] args){ int []a = {4,5,7,2,8,12,2}; sort(a); for (int i =0 ; i <a.length ;i++){ System.out.print("--" +a[i]); } // for (int k :a){ // System.out.print("-!-" +a[k]); //} } }
[ "rich9005@yahoo.co.in" ]
rich9005@yahoo.co.in
9ee4cd328410abd5f5068649873c26daaa89397f
2c9640445abec7673763ffca2c9717a67a9dca6a
/src/main/java/zuochenyun/practice/tree/DoubleNode.java
aa924b6517073f01c10a7435573a3f8b872e30c1
[]
no_license
LuoYeny/Arithmetic
72beabeb46b90d18f84c7086b51d6b7454f97b4d
371a915651e969ab4e4ceaf016903e9eaf56e72c
refs/heads/master
2022-11-21T14:42:05.855779
2020-07-29T01:38:30
2020-07-29T01:38:30
273,227,713
0
0
null
null
null
null
UTF-8
Java
false
false
298
java
package zuochenyun.practice.tree; /** * @author 罗叶妮 * @version 1.0 * @date 2020/6/23 15:40 */ public class DoubleNode { public int val; public DoubleNode left; public DoubleNode right; public DoubleNode parent; public DoubleNode(int x) { val = x; } }
[ "934398274@qq.com" ]
934398274@qq.com
07967b7dc0cc73a585e7b2848eface0799a6f30a
cb8130e884496d1fade07c90ced957202483de5a
/src/command/editor/Undoable.java
a5e2f9845fbb9d65bef765eecc7517a874f8e53d
[]
no_license
sriramsoumya02/DesignPatterns
31d34e5a7597502483c065bc84597823bdf010cd
ffbd362b12a6a6dc50cfdbee3173732122c83365
refs/heads/master
2022-07-03T16:00:43.968339
2020-05-12T16:04:17
2020-05-12T16:04:17
257,610,008
0
0
null
null
null
null
UTF-8
Java
false
false
93
java
package command.editor; public interface Undoable extends Command { void unexecute(); }
[ "sriramsoumya.02@gmail.com" ]
sriramsoumya.02@gmail.com
dddb1f6cb84193864962057fc45848f425a21d90
1d6c7f20a1af2c2e712f1465611698d918462f07
/libs/sparkpost-lib/src/test/java/com/sparkpost/model/DNSAttributesTest.java
38da9941cae7ac47dd4e33ca9e147f5842672d0c
[ "Apache-2.0" ]
permissive
kalnik-a-a/java-sparkpost
c53a5e2b22cff47563285fa047246413d47cd076
b7c28cf7cf6b2cc765e9bb5acdd6a841ad9efe2d
refs/heads/master
2021-01-21T18:59:13.876064
2018-11-03T15:10:44
2018-11-03T15:10:44
55,234,256
0
0
NOASSERTION
2018-11-03T15:10:47
2016-04-01T13:24:51
Java
UTF-8
Java
false
false
2,283
java
package com.sparkpost.model; import org.apache.log4j.Level; import org.apache.log4j.Logger; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import com.google.gson.Gson; public class DNSAttributesTest { private static final String DNS_ATTRIBUTE_JSON = "{\n" + " \"dkim_record\": \"some dkim record\",\n" + " \"spf_record\": \"some spf record\",\n" + " \"dkim_error\": \"some dkim error\",\n" + " \"spf_error\": \"some spf error\"\n" + "}"; @BeforeClass public static void setUpClass() { Logger.getRootLogger().setLevel(Level.DEBUG); } @AfterClass public static void tearDownClass() { } @Before public void setUp() { } @After public void tearDown() { } /** * */ @Test public void testDecodeDKIM() { Gson gson = new Gson(); DNSAttributes dnsAttributes = gson.fromJson(DNS_ATTRIBUTE_JSON, DNSAttributes.class); Assert.assertNotNull(dnsAttributes); Assert.assertEquals(dnsAttributes.getDkimRecord(), "some dkim record"); Assert.assertEquals(dnsAttributes.getSpfRecord(), "some spf record"); Assert.assertEquals(dnsAttributes.getDkimError(), "some dkim error"); Assert.assertEquals(dnsAttributes.getSpfError(), "some spf error"); } /** * */ @Test public void testDKIMRoundTrip() { Gson gson = new Gson(); DNSAttributes dnsAttributes = gson.fromJson(DNS_ATTRIBUTE_JSON, DNSAttributes.class); Assert.assertNotNull(dnsAttributes); String dnsAttributes_json = dnsAttributes.toJson(); DNSAttributes dnsAttributes2 = gson.fromJson(dnsAttributes_json, DNSAttributes.class); Assert.assertNotNull(dnsAttributes2); Assert.assertEquals(dnsAttributes.getDkimRecord(), dnsAttributes2.getDkimRecord()); Assert.assertEquals(dnsAttributes.getSpfRecord(), dnsAttributes2.getSpfRecord()); Assert.assertEquals(dnsAttributes.getDkimError(), dnsAttributes2.getDkimError()); Assert.assertEquals(dnsAttributes.getSpfError(), dnsAttributes2.getSpfError()); } }
[ "github@yepher.com" ]
github@yepher.com
e22c092dfbb2389fb18cb11e1e1d5317758724e2
48e202da7a045e834104d8af4a778612d53bb4de
/src/main/java/com/xt/design/pattern/abstractfactory/color/Color.java
2759e9315285ebf8f910e6f834bd71add8e31e80
[]
no_license
wangxiaowu241/design-pattern
61d92f6c4953db591ebdc5251fd1042ca449e0cf
e365d851919bc83d1ec6581476f533da362a7ac4
refs/heads/master
2020-05-20T20:44:43.011881
2019-05-18T11:23:02
2019-05-18T11:23:02
185,747,624
1
0
null
null
null
null
UTF-8
Java
false
false
154
java
package com.xt.design.pattern.abstractfactory.color; /** * @author wangxiaoteng * @date 2019/4/29 17:43 */ public interface Color { void fill(); }
[ "wanggxiaowu241@126.com" ]
wanggxiaowu241@126.com
ebfd0f7224cf4801c8324e5022ca135811bf658e
aa9442e737a0abb3ace0b03bea4a833694aa54a3
/service-community/src/main/java/com/java110/community/smo/impl/OwnerV1InnerServiceSMOImpl.java
c712c5774f104364edeb7809ba7522b9611c3cf1
[ "Apache-2.0" ]
permissive
shenfh/MicroCommunity
a29a8377725f126f9830d63d65113cb3668ee457
5872721e17244fef1d558065bfedb92eb733aa0b
refs/heads/master
2022-10-25T02:25:54.700463
2022-07-13T04:36:33
2022-07-13T04:36:33
230,180,464
0
0
null
2019-12-26T02:24:34
2019-12-26T02:24:33
null
UTF-8
Java
false
false
3,323
java
/* * Copyright 2017-2020 吴学文 and java110 team. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.java110.community.smo.impl; import com.java110.community.dao.IOwnerV1ServiceDao; import com.java110.intf.community.IOwnerV1InnerServiceSMO; import com.java110.dto.owner.OwnerDto; import com.java110.po.owner.OwnerPo; import com.java110.utils.util.BeanConvertUtil; import com.java110.core.base.smo.BaseServiceSMO; import com.java110.dto.user.UserDto; import com.java110.dto.PageDto; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; import java.util.ArrayList; import java.util.List; /** * 类表述: 服务之前调用的接口实现类,不对外提供接口能力 只用于接口建调用 * add by 吴学文 at 2021-09-14 18:56:16 mail: 928255095@qq.com * open source address: https://gitee.com/wuxw7/MicroCommunity * 官网:http://www.homecommunity.cn * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下 * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行 */ @RestController public class OwnerV1InnerServiceSMOImpl extends BaseServiceSMO implements IOwnerV1InnerServiceSMO { @Autowired private IOwnerV1ServiceDao ownerV1ServiceDaoImpl; @Override public int saveOwner(@RequestBody OwnerPo ownerPo) { int saveFlag = ownerV1ServiceDaoImpl.saveOwnerInfo(BeanConvertUtil.beanCovertMap(ownerPo)); return saveFlag; } @Override public int updateOwner(@RequestBody OwnerPo ownerPo) { int saveFlag = ownerV1ServiceDaoImpl.updateOwnerInfo(BeanConvertUtil.beanCovertMap(ownerPo)); return saveFlag; } @Override public int deleteOwner(@RequestBody OwnerPo ownerPo) { ownerPo.setStatusCd("1"); int saveFlag = ownerV1ServiceDaoImpl.updateOwnerInfo(BeanConvertUtil.beanCovertMap(ownerPo)); return saveFlag; } @Override public List<OwnerDto> queryOwners(@RequestBody OwnerDto ownerDto) { //校验是否传了 分页信息 int page = ownerDto.getPage(); if (page != PageDto.DEFAULT_PAGE) { ownerDto.setPage((page - 1) * ownerDto.getRow()); } List<OwnerDto> owners = BeanConvertUtil.covertBeanList(ownerV1ServiceDaoImpl.getOwnerInfo(BeanConvertUtil.beanCovertMap(ownerDto)), OwnerDto.class); return owners; } @Override public int queryOwnersCount(@RequestBody OwnerDto ownerDto) { return ownerV1ServiceDaoImpl.queryOwnersCount(BeanConvertUtil.beanCovertMap(ownerDto)); } }
[ "1098226878@qq.com" ]
1098226878@qq.com
cb7a7363c700055e99e2ec13076889f330aa20db
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/17/17_708e4029251c73b4f0982add90189aa98b594e17/buy/17_708e4029251c73b4f0982add90189aa98b594e17_buy_t.java
c5f532bb53a990a22a6825312dbac7433266b2b8
[]
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
6,798
java
package nl.giantit.minecraft.GiantShop.core.Commands; import nl.giantit.minecraft.GiantShop.GiantShop; import nl.giantit.minecraft.GiantShop.core.config; import nl.giantit.minecraft.GiantShop.core.perm; import nl.giantit.minecraft.GiantShop.core.Database.db; import nl.giantit.minecraft.GiantShop.core.Items.*; import nl.giantit.minecraft.GiantShop.core.Eco.iEco; import nl.giantit.minecraft.GiantShop.Misc.Heraut; import nl.giantit.minecraft.GiantShop.Misc.Messages; import org.bukkit.entity.Player; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; import org.bukkit.material.MaterialData; import java.util.ArrayList; import java.util.Map; import java.util.HashMap; import java.util.logging.Level; /** * * @author Giant */ public class buy { private static config conf = config.Obtain(); private static db DB = db.Obtain(); private static perm perms = perm.Obtain(); private static Messages mH = GiantShop.getPlugin().getMsgHandler(); private static Items iH = GiantShop.getPlugin().getItemHandler(); private static iEco eH = GiantShop.getPlugin().getEcoHandler().getEngine(); public static void buy(Player player, String[] args) { Heraut.savePlayer(player); if(perms.has(player, "giantshop.shop.buy")) { if(args.length >= 2) { int itemID; Integer itemType = -1; int quantity; if(!args[1].matches("[0-9]+:[0-9]+")) { try { itemID = Integer.parseInt(args[1]); itemType = -1; }catch(NumberFormatException e) { ItemID key = iH.getItemIDByName(args[1]); if(key != null) { itemID = key.getId(); itemType = key.getType(); }else{ Heraut.say(player, mH.getMsg(Messages.msgType.ERROR, "itemNotFound")); return; } }catch(Exception e) { if(conf.getBoolean("GiantShop.global.debug") == true) { GiantShop.log.log(Level.SEVERE, "GiantShop Error: " + e.getMessage()); GiantShop.log.log(Level.INFO, "Stacktrace: " + e.getStackTrace()); } Heraut.say(player, mH.getMsg(Messages.msgType.ERROR, "unknown")); return; } }else{ try { String[] data = args[1].split(":"); itemID = Integer.parseInt(data[0]); itemType = Integer.parseInt(data[1]); }catch(NumberFormatException e) { HashMap<String, String> data = new HashMap<String, String>(); data.put("command", "buy"); Heraut.say(player, mH.getMsg(Messages.msgType.ERROR, "syntaxError", data)); return; }catch(Exception e) { if(conf.getBoolean("GiantShop.global.debug") == true) { GiantShop.log.log(Level.SEVERE, "GiantShop Error: " + e.getMessage()); GiantShop.log.log(Level.INFO, "Stacktrace: " + e.getStackTrace()); } Heraut.say(player, mH.getMsg(Messages.msgType.ERROR, "unknown")); return; } } if(args.length >= 3) { try { quantity = Integer.parseInt(args[2]); quantity = (quantity > 0) ? quantity : 1; }catch(NumberFormatException e) { //Heraut.say(player, mH.getMsg(Messages.msgType.ERROR, "invQuantity")); Heraut.say("As you did not specify a normal quantity, we'll just use 1 ok? :)"); quantity = 1; } }else quantity = 1; if(iH.isValidItem(itemID, itemType)) { ArrayList<String> fields = new ArrayList<String>(); fields.add("perStack"); fields.add("sellFor"); fields.add("stock"); fields.add("shops"); HashMap<String, String> where = new HashMap<String, String>(); where.put("itemID", String.valueOf(itemID)); where.put("type", String.valueOf((itemType == null || itemType == 0) ? -1 : itemType)); ArrayList<HashMap<String, String>> resSet = DB.select(fields).from("#__items").where(where).execQuery(); if(resSet.size() == 1) { String name = iH.getItemNameByID(itemID, itemType); HashMap<String, String> res = resSet.get(0); int perStack = Integer.parseInt(res.get("perStack")); double sellFor = Double.parseDouble(res.get("sellFor")); double balance = eH.getBalance(player); double cost = sellFor * (double) quantity; int amount = perStack * quantity; if((balance - cost) < 0) { HashMap<String, String> data = new HashMap<String, String>(); data.put("needed", String.valueOf(cost)); data.put("have", String.valueOf(balance)); Heraut.say(mH.getMsg(Messages.msgType.ERROR, "insufFunds", data)); }else{ if(eH.withdraw(player, cost)) { ItemStack iStack; Inventory inv = player.getInventory(); if(itemType != null && itemType != -1) { iStack = new MaterialData(itemID, (byte) ((int) itemType)).toItemStack(amount); }else{ iStack = new ItemStack(itemID, amount); } if(conf.getBoolean("GiantShop.global.broadcastBuy")) Heraut.broadcast(player.getName() + " bought some " + name); Heraut.say("You have just bought " + amount + " of " + name + " for " + cost); Heraut.say("Your new balance is: " + eH.getBalance(player)); HashMap<Integer, ItemStack> left; left = inv.addItem(iStack); if(!left.isEmpty()) { Heraut.say(mH.getMsg(Messages.msgType.ERROR, "infFull")); for(Map.Entry<Integer, ItemStack> stack : left.entrySet()) { player.getWorld().dropItem(player.getLocation(), stack.getValue()); } } } } //More future stuff /*if(conf.getBoolean("GiantShop.Location.useGiantShopLocation") == true) { * ArrayList<Indaface> shops = GiantShop.getPlugin().getLocationHandler().parseShops(res.get("shops")); * for(Indaface shop : shops) { * if(shop.inShop(player.getLocation())) { * //Player can get the item he wants! :D * } * } * }else{ * //Just a global store then :) * } */ }else{ Heraut.say(player, mH.getMsg(Messages.msgType.ERROR, "noneOrMoreResults")); } }else{ Heraut.say(player, mH.getMsg(Messages.msgType.ERROR, "itemNotFound")); } }else{ HashMap<String, String> data = new HashMap<String, String>(); data.put("command", "buy"); Heraut.say(mH.getMsg(Messages.msgType.ERROR, "syntaxError", data)); } }else{ HashMap<String, String> data = new HashMap<String, String>(); data.put("command", "buy"); Heraut.say(mH.getMsg(Messages.msgType.ERROR, "noPermissions", data)); } } public static void gift(Player player, String[] args) { Heraut.savePlayer(player); Heraut.say("test"); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
989703496c62a7a5dd34b9a21521b83d7263d1d3
a37a75bc770e537d84e6bd890a919c76d0c74c16
/app/src/test/java/fengjie/baway/com/yueguangcharen/ExampleUnitTest.java
9d209b2c91a8a0918ba04d81b0686c4d59f79845
[]
no_license
Fengjie11/Yueguangcharen
1515e1fa511e8de92fd177147f899d16f321835c
1b92c5211a75ac27ceeec4e094a148af7dc67bfd
refs/heads/master
2021-01-13T05:23:28.684727
2017-02-16T06:03:11
2017-02-16T06:03:11
81,396,787
0
0
null
null
null
null
UTF-8
Java
false
false
410
java
package fengjie.baway.com.yueguangcharen; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
[ "806397650@qq.com" ]
806397650@qq.com
94f80c8d6f5b4b90e5c16129569152c85da73e2a
716e91ab2fc44528af5bea62f874a573d3009de8
/kodilla-patterns2-2/src/main/java/com/kodilla/patterns22/aop/calculator/Watcher.java
48acca5fdc7c010be63fb9ef47f3c7bd7360ad6b
[]
no_license
KonkowIT/Kodilla-Bootcamp_repository
27f0c6b6a285c31e93ece98ea822220f5fb20786
4991c917f06067b6faa8ac5f745cf1a78b48cb18
refs/heads/master
2021-09-18T20:39:46.047484
2018-07-19T17:45:45
2018-07-19T17:45:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
697
java
package com.kodilla.patterns22.aop.calculator; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Before; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; import java.math.BigDecimal; @Aspect @Component public class Watcher { private static final Logger LOGGER = LoggerFactory.getLogger(Watcher.class); @Before("execution(* com.kodilla.patterns22.aop.calculator.Calculator.factorial(..))" + "&& args(theNumber) && target(object)") public void logEvent(BigDecimal theNumber, Object object) { LOGGER.info("Class: " + object.getClass().getName() + " Args: " + theNumber); } }
[ "“konradkowalski95@gmail.com git config --global user.name kconradogit config --global user.email “konradkowalski95@gmail.com" ]
“konradkowalski95@gmail.com git config --global user.name kconradogit config --global user.email “konradkowalski95@gmail.com
f8241972f762d88e24eded6782a245116a737bb3
063190478bd1ef68c97ab8015039934f96b776e1
/app/src/main/java/sg/edu/rp/c346/anotherreceiverapp/AnotherBroadcastReceiver.java
5288cbb4b3abe400241888b77da81c76033bf0ee
[]
no_license
NeoYP/AnotherReceiverApp
a19c4acac507b9010eeed6b189fcd8f5d07c2ae2
a4ca53e0dda05eb20ed75f08e8be70c114a87dae
refs/heads/master
2020-03-26T10:52:43.146646
2018-08-15T07:14:08
2018-08-15T07:14:08
144,818,961
0
0
null
null
null
null
UTF-8
Java
false
false
424
java
package sg.edu.rp.c346.anotherreceiverapp; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.widget.Toast; public class AnotherBroadcastReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent){ Toast.makeText(context,"Received in AnotherBroadcastReceiver", Toast.LENGTH_LONG).show(); } }
[ "17010411@rp.edu.sg" ]
17010411@rp.edu.sg
2f41ef622dd96ca8bbeda4d771854541f84de754
90c7ab871941a792e7b9a3a7dbf3cd0d888fa1cc
/src/main/java/com/kidole/sport/repository/search/ScoreSearchRepository.java
c07997b743b2b4e8e906985fd522b74687fa3466
[]
no_license
kidole/kidole
812b94bbdf8222698ad38fcc447429b50953d271
2434488cc1cf369cf634f7b9c9b17890f1fb3291
refs/heads/master
2022-12-23T19:55:01.563400
2020-02-05T16:49:57
2020-02-05T16:49:57
234,342,813
0
0
null
2020-01-16T16:28:55
2020-01-16T14:51:25
Java
UTF-8
Java
false
false
332
java
package com.kidole.sport.repository.search; import com.kidole.sport.domain.Score; import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; /** * Spring Data Elasticsearch repository for the {@link Score} entity. */ public interface ScoreSearchRepository extends ElasticsearchRepository<Score, Long> { }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
9713a14f8ea2c0d3c1c10bd17c391ab4e9e7cf63
ada115d9efff16c7184e4d8f26bcef2722c33d5a
/engine/src/data/transpool/user/TransPoolUserAccount.java
c345d35f644510caa26ec1a9272339fb3f7f73fe
[ "MIT" ]
permissive
nadavsu/transpool-gui
3d177fe33c0c506c8df2fb84c3634179b161f340
00b1914faf566262be0f7a9fffd7f915ddaf45f6
refs/heads/main
2023-03-03T17:06:52.905850
2021-02-15T20:37:25
2021-02-15T20:37:25
339,193,977
0
0
null
null
null
null
UTF-8
Java
false
false
1,027
java
package data.transpool.user; import javafx.beans.property.IntegerProperty; import javafx.beans.property.SimpleIntegerProperty; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; public abstract class TransPoolUserAccount { protected IntegerProperty ID; protected StringProperty username; public TransPoolUserAccount(String username) { this.username = new SimpleStringProperty(username); this.ID = new SimpleIntegerProperty(-1); } public int getID() { return ID.get(); } public IntegerProperty IDProperty() { return ID; } public void setID(int ID) { this.ID.set(ID); } public String getUsername() { return username.get(); } public StringProperty usernameProperty() { return username; } public void setUsername(String username) { this.username.set(username); } @Override public String toString() { return username.get(); } }
[ "“nadavsuliman@gmail.com”" ]
“nadavsuliman@gmail.com”
66ca8bb22dad3123548ae838b7b5b0bd76e3af86
6974ce62790cc545d6caf3fe61e91a862e0edc34
/library/src/main/java/com/kenmeidearu/materialdatetimepicker/date/AccessibleDateAnimator.java
f3e25604078eea110a1bdbd36b5f0065d85c32c5
[ "Apache-2.0" ]
permissive
kenmeidearu/MaterialDateTimePicker
e60fcbb1ad0cf226e0c5bde7b90bd34eb69e109b
cc7608324192b79035d5357d9da119b97ab04191
refs/heads/master
2021-01-18T13:31:25.808588
2017-06-30T09:17:29
2017-06-30T09:17:29
66,530,993
3
3
null
null
null
null
UTF-8
Java
false
false
2,057
java
/* * Copyright (C) 2013 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.kenmeidearu.materialdatetimepicker.date; import android.content.Context; import android.text.format.DateUtils; import android.util.AttributeSet; import android.view.accessibility.AccessibilityEvent; import android.widget.ViewAnimator; public class AccessibleDateAnimator extends ViewAnimator { private long mDateMillis; private Timepoint mInitialTime; public AccessibleDateAnimator(Context context, AttributeSet attrs) { super(context, attrs); } public void setDateMillis(long dateMillis) { mDateMillis = dateMillis; } public void setTimeMilis(Timepoint minitialtime) { mInitialTime = minitialtime; } /** * Announce the currently-selected date when launched. */ @Override public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) { if (event.getEventType() == AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED) { // Clear the event's current text so that only the current date will be spoken. event.getText().clear(); int flags = DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_SHOW_YEAR | DateUtils.FORMAT_SHOW_WEEKDAY; String dateString = DateUtils.formatDateTime(getContext(), mDateMillis, flags); event.getText().add(dateString); return true; } return super.dispatchPopulateAccessibilityEvent(event); } }
[ "kenmeidearu@gmail.com" ]
kenmeidearu@gmail.com
b756a3b2e7dbbf70e5991e584add0878f1bd80c9
9525ad7b57d54010897e79b29560b6cc6991d730
/hologres-connector-flink-1.11/src/test/java/com/alibaba/ververica/connectors/hologres/sink/HologresSinkTableITTest.java
0cfcea6a36e3ebd5ed853b2ebda30c19acaa2a2c
[ "Apache-2.0" ]
permissive
EndMiku47/alibabacloud-hologres-connectors
f6386fee9788ef35f8d699d505211dad64def4d0
478d66886ef3c62c930c4df2d0af762bcabfe698
refs/heads/master
2023-08-26T05:49:20.678978
2021-11-04T03:00:40
2021-11-04T03:01:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
8,365
java
package com.alibaba.ververica.connectors.hologres.sink; import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment; import org.apache.flink.table.api.EnvironmentSettings; import org.apache.flink.table.api.bridge.java.StreamTableEnvironment; import com.alibaba.ververica.connectors.hologres.HologresTestBase; import com.alibaba.ververica.connectors.hologres.JDBCTestUtils; import com.alibaba.ververica.connectors.hologres.utils.JDBCUtils; import org.junit.Before; import org.junit.Test; import java.io.IOException; import java.math.BigDecimal; import java.sql.Timestamp; import java.util.Arrays; import java.util.stream.Collectors; /** Tests for Sink. */ public class HologresSinkTableITTest extends HologresTestBase { protected EnvironmentSettings streamSettings; protected StreamExecutionEnvironment env; protected StreamTableEnvironment tEnv; public HologresSinkTableITTest() throws IOException {} public static final Object[][] EXPECTED = new Object[][] { new Object[] { 1, "dim", 20.2007, false, 652482, new java.sql.Date(120, 6, 8), "source_test", Timestamp.valueOf("2020-07-10 16:28:07.737"), 8.58965, "{464,98661,32489}", "{8589934592,8589934593,8589934594}", "{8.58967018,96.4666977,9345.16016}", "{587897.464674600051,792343.64644599997,76.4646400000000028}", "{t,t,f,t}", "{monday,saturday,sunday}", true, new BigDecimal("8119.21"), }, }; public static String[] expectRows = Arrays.stream(EXPECTED) .map( row -> { return Arrays.stream(row) .map(Object::toString) .collect(Collectors.joining(",")); }) .toArray(String[]::new); public static String[] fieldNames = { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q" }; @Before public void prepare() throws Exception { EnvironmentSettings.Builder streamBuilder = EnvironmentSettings.newInstance().inStreamingMode(); this.streamSettings = streamBuilder.useBlinkPlanner().build(); env = StreamExecutionEnvironment.getExecutionEnvironment(); tEnv = StreamTableEnvironment.create(env, streamSettings); } @Test public void testJDBCSinkTable() throws Exception { this.cleanTable(sinkTable); tEnv.executeSql( "create table sinkTable" + "(\n" + "a int not null,\n" + "b STRING not null,\n" + "c double,\n" + "d boolean,\n" + "e bigint,\n" + "f date,\n" + "g varchar,\n" + "h TIMESTAMP,\n" + "i float,\n" + "j array<int> not null,\n" + "k array<bigint> not null,\n" + "l array<float>,\n" + "m array<double>,\n" + "n array<boolean>,\n" + "o array<STRING>,\n" + "p boolean,\n" + "q numeric(6,2)\n" + ") with (" + "'connector'='hologres',\n" + "'endpoint'='" + endpoint + "',\n" + "'dbname'='" + database + "',\n" + "'tablename'='" + sinkTable + "',\n" + "'username'='" + username + "',\n" + "'password'='" + password + "'\n" + ")"); tEnv.sqlUpdate( "INSERT INTO sinkTable " + " (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q) values (" + "1,'dim',cast(20.2007 as double),false,652482,cast('2020-07-08' as date),'source_test',cast('2020-07-10 16:28:07.737' as timestamp)," + "cast(8.58965 as float),cast(ARRAY [464,98661,32489] as array<int>),cast(ARRAY [8589934592,8589934593,8589934594] as array<bigint>)," + "ARRAY[cast(8.58967 as float),cast(96.4667 as float),cast(9345.16 as float)], ARRAY [cast(587897.4646746 as double),cast(792343.646446 as double),cast(76.46464 as double)]," + "cast(ARRAY [true,true,false,true] as array<boolean>),cast(ARRAY ['monday','saturday','sunday'] as array<STRING>),true,cast(8119.21 as numeric(6,2))" + ")"); tEnv.execute("insert"); JDBCTestUtils.checkResultWithTimeout( expectRows, sinkTable, fieldNames, JDBCUtils.getDbUrl(endpoint, database), username, password, 10000); } @Test public void testJDBCSinkTableWithSchema() throws Exception { this.cleanTable("test." + sinkTable); tEnv.executeSql( "create table sinkTable" + "(\n" + "a int not null,\n" + "b STRING not null,\n" + "c double,\n" + "d boolean,\n" + "e bigint,\n" + "f date,\n" + "g varchar,\n" + "h TIMESTAMP,\n" + "i float,\n" + "j array<int> not null,\n" + "k array<bigint> not null,\n" + "l array<float>,\n" + "m array<double>,\n" + "n array<boolean>,\n" + "o array<STRING>,\n" + "p boolean,\n" + "q numeric(6,2)\n" + ") with (" + "'connector'='hologres',\n" + "'endpoint'='" + endpoint + "',\n" + "'dbname'='" + database + "',\n" + "'tablename'='test." + sinkTable + "',\n" + "'username'='" + username + "',\n" + "'password'='" + password + "'\n" + ")"); tEnv.sqlUpdate( "INSERT INTO sinkTable " + " (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q) values (" + "1,'dim',cast(20.2007 as double),false,652482,cast('2020-07-08' as date),'source_test',cast('2020-07-10 16:28:07.737' as timestamp)," + "cast(8.58965 as float),cast(ARRAY [464,98661,32489] as array<int>),cast(ARRAY [8589934592,8589934593,8589934594] as array<bigint>)," + "ARRAY[cast(8.58967 as float),cast(96.4667 as float),cast(9345.16 as float)], ARRAY [cast(587897.4646746 as double),cast(792343.646446 as double),cast(76.46464 as double)]," + "cast(ARRAY [true,true,false,true] as array<boolean>),cast(ARRAY ['monday','saturday','sunday'] as array<STRING>),true,cast(8119.21 as numeric(6,2))" + ")"); tEnv.execute("insert"); JDBCTestUtils.checkResultWithTimeout( expectRows, "test." + sinkTable, fieldNames, JDBCUtils.getDbUrl(endpoint, database), username, password, 10000); } }
[ "jiru.whf@alibaba-inc.com" ]
jiru.whf@alibaba-inc.com
a55f141d9c055b77cfaf8aa14721fc13e7685897
2099edd74ac2c47c56822430105066d2295fe9ba
/Classify.java
2110c10def9b5fc16823d20fffb6cc70222c758a
[]
no_license
Praveensp9/Twitter-sentimental-analysis
589ebc7d822ba637889aaaac65cf259dfc586f0b
64f46c104f1d8f304a08cf1b954a3d18114ac45d
refs/heads/master
2021-10-25T20:36:27.857387
2019-04-07T05:51:14
2019-04-07T05:51:14
47,808,394
0
0
null
null
null
null
UTF-8
Java
false
false
1,092
java
package com.tweet.analysis; import java.io.File; import java.io.IOException; import com.aliasi.classify.ConditionalClassification; import com.aliasi.classify.LMClassifier; import com.aliasi.util.AbstractExternalizable; public class Classify { String[] categories; @SuppressWarnings("rawtypes") LMClassifier lmc; /** * Constructor loading serialized object created by Model class to local * LMClassifer of this class */ @SuppressWarnings("rawtypes") public Classify() { try { lmc = (LMClassifier) AbstractExternalizable.readObject(new File( "/Path/to/you/classify.txt/file/classifier.txt")); categories = lmc.categories(); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } /** * Classify whether the text is positive or negative based on Model object * * @param text * @return classified group i.e either positive or negative */ public String classify(String text) { ConditionalClassification classification = lmc.classify(text); return classification.bestCategory(); } }
[ "prvnsp9@gmail.com" ]
prvnsp9@gmail.com
091fd89aeaa2973d87f538b2776f88380f2b9b20
e05cf54cd7f2a6a3f95797f0ad4b6891156b82f3
/out/smali/android/support/v4/util/SparseArrayCompat.java
6fb5647e71c1f038bf434605aff049b8bb2226b8
[]
no_license
chenxiaoyoyo/KROutCode
fda014c0bdd9c38b5b79203de91634a71b10540b
f879c2815c4e1d570b6362db7430cb835a605cf0
refs/heads/master
2021-01-10T13:37:05.853091
2016-02-04T08:03:57
2016-02-04T08:03:57
49,871,343
0
0
null
null
null
null
UTF-8
Java
false
false
31,434
java
package android.support.v4.util; class SparseArrayCompat { void a() { int a; a=0;// .class public Landroid/support/v4/util/SparseArrayCompat; a=0;// .super Ljava/lang/Object; a=0;// .source "SourceFile" a=0;// a=0;// a=0;// # static fields a=0;// .field private static final DELETED:Ljava/lang/Object; a=0;// a=0;// a=0;// # instance fields a=0;// .field private mGarbage:Z a=0;// a=0;// .field private mKeys:[I a=0;// a=0;// .field private mSize:I a=0;// a=0;// .field private mValues:[Ljava/lang/Object; a=0;// a=0;// a=0;// # direct methods a=0;// .method static constructor <clinit>()V a=0;// .locals 1 a=0;// a=0;// .prologue a=0;// .line 24 a=0;// new-instance v0, Ljava/lang/Object; a=0;// a=0;// #v0=(UninitRef,Ljava/lang/Object;); a=0;// invoke-direct {v0}, Ljava/lang/Object;-><init>()V a=0;// a=0;// #v0=(Reference,Ljava/lang/Object;); a=0;// sput-object v0, Landroid/support/v4/util/SparseArrayCompat;->DELETED:Ljava/lang/Object; a=0;// a=0;// return-void a=0;// .end method a=0;// a=0;// .method public constructor <init>()V a=0;// .locals 1 a=0;// a=0;// .prologue a=0;// .line 31 a=0;// const/16 v0, 0xa a=0;// a=0;// #v0=(PosByte); a=0;// invoke-direct {p0, v0}, Landroid/support/v4/util/SparseArrayCompat;-><init>(I)V a=0;// a=0;// .line 32 a=0;// #p0=(Reference,Landroid/support/v4/util/SparseArrayCompat;); a=0;// return-void a=0;// .end method a=0;// a=0;// .method public constructor <init>(I)V a=0;// .locals 3 a=0;// a=0;// .prologue a=0;// const/4 v2, 0x0 a=0;// a=0;// .line 39 a=0;// #v2=(Null); a=0;// invoke-direct {p0}, Ljava/lang/Object;-><init>()V a=0;// a=0;// .line 25 a=0;// #p0=(Reference,Landroid/support/v4/util/SparseArrayCompat;); a=0;// iput-boolean v2, p0, Landroid/support/v4/util/SparseArrayCompat;->mGarbage:Z a=0;// a=0;// .line 40 a=0;// invoke-static {p1}, Landroid/support/v4/util/SparseArrayCompat;->idealIntArraySize(I)I a=0;// a=0;// move-result v0 a=0;// a=0;// .line 42 a=0;// #v0=(Integer); a=0;// new-array v1, v0, [I a=0;// a=0;// #v1=(Reference,[I); a=0;// iput-object v1, p0, Landroid/support/v4/util/SparseArrayCompat;->mKeys:[I a=0;// a=0;// .line 43 a=0;// new-array v0, v0, [Ljava/lang/Object; a=0;// a=0;// #v0=(Reference,[Ljava/lang/Object;); a=0;// iput-object v0, p0, Landroid/support/v4/util/SparseArrayCompat;->mValues:[Ljava/lang/Object; a=0;// a=0;// .line 44 a=0;// iput v2, p0, Landroid/support/v4/util/SparseArrayCompat;->mSize:I a=0;// a=0;// .line 45 a=0;// return-void a=0;// .end method a=0;// a=0;// .method private static binarySearch([IIII)I a=0;// .locals 4 a=0;// a=0;// .prologue a=0;// .line 326 a=0;// add-int v2, p1, p2 a=0;// a=0;// #v2=(Integer); a=0;// add-int/lit8 v0, p1, -0x1 a=0;// a=0;// #v0=(Integer); a=0;// move v1, v0 a=0;// a=0;// #v1=(Integer); a=0;// move v0, v2 a=0;// a=0;// .line 328 a=0;// :goto_0 a=0;// #v3=(Conflicted); a=0;// sub-int v2, v0, v1 a=0;// a=0;// const/4 v3, 0x1 a=0;// a=0;// #v3=(One); a=0;// if-le v2, v3, :cond_1 a=0;// a=0;// .line 329 a=0;// add-int v2, v0, v1 a=0;// a=0;// div-int/lit8 v2, v2, 0x2 a=0;// a=0;// .line 331 a=0;// aget v3, p0, v2 a=0;// a=0;// #v3=(Integer); a=0;// if-ge v3, p3, :cond_0 a=0;// a=0;// move v1, v2 a=0;// a=0;// .line 332 a=0;// goto :goto_0 a=0;// a=0;// :cond_0 a=0;// move v0, v2 a=0;// a=0;// .line 334 a=0;// goto :goto_0 a=0;// a=0;// .line 337 a=0;// :cond_1 a=0;// #v3=(One); a=0;// add-int v1, p1, p2 a=0;// a=0;// if-ne v0, v1, :cond_3 a=0;// a=0;// .line 338 a=0;// add-int v0, p1, p2 a=0;// a=0;// xor-int/lit8 v0, v0, -0x1 a=0;// a=0;// .line 342 a=0;// :cond_2 a=0;// :goto_1 a=0;// return v0 a=0;// a=0;// .line 339 a=0;// :cond_3 a=0;// aget v1, p0, v0 a=0;// a=0;// if-eq v1, p3, :cond_2 a=0;// a=0;// .line 342 a=0;// xor-int/lit8 v0, v0, -0x1 a=0;// a=0;// goto :goto_1 a=0;// .end method a=0;// a=0;// .method private gc()V a=0;// .locals 8 a=0;// a=0;// .prologue a=0;// const/4 v2, 0x0 a=0;// a=0;// .line 116 a=0;// #v2=(Null); a=0;// iget v3, p0, Landroid/support/v4/util/SparseArrayCompat;->mSize:I a=0;// a=0;// .line 118 a=0;// #v3=(Integer); a=0;// iget-object v4, p0, Landroid/support/v4/util/SparseArrayCompat;->mKeys:[I a=0;// a=0;// .line 119 a=0;// #v4=(Reference,[I); a=0;// iget-object v5, p0, Landroid/support/v4/util/SparseArrayCompat;->mValues:[Ljava/lang/Object; a=0;// a=0;// #v5=(Reference,[Ljava/lang/Object;); a=0;// move v1, v2 a=0;// a=0;// #v1=(Null); a=0;// move v0, v2 a=0;// a=0;// .line 121 a=0;// :goto_0 a=0;// #v0=(Integer);v1=(Integer);v6=(Conflicted);v7=(Conflicted); a=0;// if-ge v1, v3, :cond_2 a=0;// a=0;// .line 122 a=0;// aget-object v6, v5, v1 a=0;// a=0;// .line 124 a=0;// #v6=(Null); a=0;// sget-object v7, Landroid/support/v4/util/SparseArrayCompat;->DELETED:Ljava/lang/Object; a=0;// a=0;// #v7=(Reference,Ljava/lang/Object;); a=0;// if-eq v6, v7, :cond_1 a=0;// a=0;// .line 125 a=0;// if-eq v1, v0, :cond_0 a=0;// a=0;// .line 126 a=0;// aget v7, v4, v1 a=0;// a=0;// #v7=(Integer); a=0;// aput v7, v4, v0 a=0;// a=0;// .line 127 a=0;// aput-object v6, v5, v0 a=0;// a=0;// .line 130 a=0;// :cond_0 a=0;// #v7=(Conflicted); a=0;// add-int/lit8 v0, v0, 0x1 a=0;// a=0;// .line 121 a=0;// :cond_1 a=0;// add-int/lit8 v1, v1, 0x1 a=0;// a=0;// goto :goto_0 a=0;// a=0;// .line 134 a=0;// :cond_2 a=0;// #v6=(Conflicted); a=0;// iput-boolean v2, p0, Landroid/support/v4/util/SparseArrayCompat;->mGarbage:Z a=0;// a=0;// .line 135 a=0;// iput v0, p0, Landroid/support/v4/util/SparseArrayCompat;->mSize:I a=0;// a=0;// .line 138 a=0;// return-void a=0;// .end method a=0;// a=0;// .method static idealByteArraySize(I)I a=0;// .locals 3 a=0;// a=0;// .prologue a=0;// const/4 v2, 0x1 a=0;// a=0;// .line 346 a=0;// #v2=(One); a=0;// const/4 v0, 0x4 a=0;// a=0;// :goto_0 a=0;// #v0=(Integer);v1=(Conflicted); a=0;// const/16 v1, 0x20 a=0;// a=0;// #v1=(PosByte); a=0;// if-ge v0, v1, :cond_0 a=0;// a=0;// .line 347 a=0;// shl-int v1, v2, v0 a=0;// a=0;// #v1=(Integer); a=0;// add-int/lit8 v1, v1, -0xc a=0;// a=0;// if-gt p0, v1, :cond_1 a=0;// a=0;// .line 348 a=0;// shl-int v0, v2, v0 a=0;// a=0;// add-int/lit8 p0, v0, -0xc a=0;// a=0;// .line 350 a=0;// :cond_0 a=0;// return p0 a=0;// a=0;// .line 346 a=0;// :cond_1 a=0;// add-int/lit8 v0, v0, 0x1 a=0;// a=0;// goto :goto_0 a=0;// .end method a=0;// a=0;// .method static idealIntArraySize(I)I a=0;// .locals 1 a=0;// a=0;// .prologue a=0;// .line 354 a=0;// mul-int/lit8 v0, p0, 0x4 a=0;// a=0;// #v0=(Integer); a=0;// invoke-static {v0}, Landroid/support/v4/util/SparseArrayCompat;->idealByteArraySize(I)I a=0;// a=0;// move-result v0 a=0;// a=0;// div-int/lit8 v0, v0, 0x4 a=0;// a=0;// return v0 a=0;// .end method a=0;// a=0;// a=0;// # virtual methods a=0;// .method public append(ILjava/lang/Object;)V a=0;// .locals 6 a=0;// a=0;// .prologue a=0;// const/4 v5, 0x0 a=0;// a=0;// .line 296 a=0;// #v5=(Null); a=0;// iget v0, p0, Landroid/support/v4/util/SparseArrayCompat;->mSize:I a=0;// a=0;// #v0=(Integer); a=0;// if-eqz v0, :cond_0 a=0;// a=0;// iget-object v0, p0, Landroid/support/v4/util/SparseArrayCompat;->mKeys:[I a=0;// a=0;// #v0=(Reference,[I); a=0;// iget v1, p0, Landroid/support/v4/util/SparseArrayCompat;->mSize:I a=0;// a=0;// #v1=(Integer); a=0;// add-int/lit8 v1, v1, -0x1 a=0;// a=0;// aget v0, v0, v1 a=0;// a=0;// #v0=(Integer); a=0;// if-gt p1, v0, :cond_0 a=0;// a=0;// .line 297 a=0;// invoke-virtual {p0, p1, p2}, Landroid/support/v4/util/SparseArrayCompat;->put(ILjava/lang/Object;)V a=0;// a=0;// .line 323 a=0;// :goto_0 a=0;// #v1=(Conflicted);v2=(Conflicted);v3=(Conflicted);v4=(Conflicted); a=0;// return-void a=0;// a=0;// .line 301 a=0;// :cond_0 a=0;// #v2=(Uninit);v3=(Uninit);v4=(Uninit); a=0;// iget-boolean v0, p0, Landroid/support/v4/util/SparseArrayCompat;->mGarbage:Z a=0;// a=0;// #v0=(Boolean); a=0;// if-eqz v0, :cond_1 a=0;// a=0;// iget v0, p0, Landroid/support/v4/util/SparseArrayCompat;->mSize:I a=0;// a=0;// #v0=(Integer); a=0;// iget-object v1, p0, Landroid/support/v4/util/SparseArrayCompat;->mKeys:[I a=0;// a=0;// #v1=(Reference,[I); a=0;// array-length v1, v1 a=0;// a=0;// #v1=(Integer); a=0;// if-lt v0, v1, :cond_1 a=0;// a=0;// .line 302 a=0;// invoke-direct {p0}, Landroid/support/v4/util/SparseArrayCompat;->gc()V a=0;// a=0;// .line 305 a=0;// :cond_1 a=0;// #v1=(Conflicted); a=0;// iget v0, p0, Landroid/support/v4/util/SparseArrayCompat;->mSize:I a=0;// a=0;// .line 306 a=0;// iget-object v1, p0, Landroid/support/v4/util/SparseArrayCompat;->mKeys:[I a=0;// a=0;// #v1=(Reference,[I); a=0;// array-length v1, v1 a=0;// a=0;// #v1=(Integer); a=0;// if-lt v0, v1, :cond_2 a=0;// a=0;// .line 307 a=0;// add-int/lit8 v1, v0, 0x1 a=0;// a=0;// invoke-static {v1}, Landroid/support/v4/util/SparseArrayCompat;->idealIntArraySize(I)I a=0;// a=0;// move-result v1 a=0;// a=0;// .line 309 a=0;// new-array v2, v1, [I a=0;// a=0;// .line 310 a=0;// #v2=(Reference,[I); a=0;// new-array v1, v1, [Ljava/lang/Object; a=0;// a=0;// .line 313 a=0;// #v1=(Reference,[Ljava/lang/Object;); a=0;// iget-object v3, p0, Landroid/support/v4/util/SparseArrayCompat;->mKeys:[I a=0;// a=0;// #v3=(Reference,[I); a=0;// iget-object v4, p0, Landroid/support/v4/util/SparseArrayCompat;->mKeys:[I a=0;// a=0;// #v4=(Reference,[I); a=0;// array-length v4, v4 a=0;// a=0;// #v4=(Integer); a=0;// invoke-static {v3, v5, v2, v5, v4}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V a=0;// a=0;// .line 314 a=0;// iget-object v3, p0, Landroid/support/v4/util/SparseArrayCompat;->mValues:[Ljava/lang/Object; a=0;// a=0;// iget-object v4, p0, Landroid/support/v4/util/SparseArrayCompat;->mValues:[Ljava/lang/Object; a=0;// a=0;// #v4=(Reference,[Ljava/lang/Object;); a=0;// array-length v4, v4 a=0;// a=0;// #v4=(Integer); a=0;// invoke-static {v3, v5, v1, v5, v4}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V a=0;// a=0;// .line 316 a=0;// iput-object v2, p0, Landroid/support/v4/util/SparseArrayCompat;->mKeys:[I a=0;// a=0;// .line 317 a=0;// iput-object v1, p0, Landroid/support/v4/util/SparseArrayCompat;->mValues:[Ljava/lang/Object; a=0;// a=0;// .line 320 a=0;// :cond_2 a=0;// #v1=(Conflicted);v2=(Conflicted);v3=(Conflicted);v4=(Conflicted); a=0;// iget-object v1, p0, Landroid/support/v4/util/SparseArrayCompat;->mKeys:[I a=0;// a=0;// #v1=(Reference,[I); a=0;// aput p1, v1, v0 a=0;// a=0;// .line 321 a=0;// iget-object v1, p0, Landroid/support/v4/util/SparseArrayCompat;->mValues:[Ljava/lang/Object; a=0;// a=0;// aput-object p2, v1, v0 a=0;// a=0;// .line 322 a=0;// add-int/lit8 v0, v0, 0x1 a=0;// a=0;// iput v0, p0, Landroid/support/v4/util/SparseArrayCompat;->mSize:I a=0;// a=0;// goto :goto_0 a=0;// .end method a=0;// a=0;// .method public clear()V a=0;// .locals 5 a=0;// a=0;// .prologue a=0;// const/4 v1, 0x0 a=0;// a=0;// .line 280 a=0;// #v1=(Null); a=0;// iget v2, p0, Landroid/support/v4/util/SparseArrayCompat;->mSize:I a=0;// a=0;// .line 281 a=0;// #v2=(Integer); a=0;// iget-object v3, p0, Landroid/support/v4/util/SparseArrayCompat;->mValues:[Ljava/lang/Object; a=0;// a=0;// #v3=(Reference,[Ljava/lang/Object;); a=0;// move v0, v1 a=0;// a=0;// .line 283 a=0;// :goto_0 a=0;// #v0=(Integer);v4=(Conflicted); a=0;// if-ge v0, v2, :cond_0 a=0;// a=0;// .line 284 a=0;// const/4 v4, 0x0 a=0;// a=0;// #v4=(Null); a=0;// aput-object v4, v3, v0 a=0;// a=0;// .line 283 a=0;// add-int/lit8 v0, v0, 0x1 a=0;// a=0;// goto :goto_0 a=0;// a=0;// .line 287 a=0;// :cond_0 a=0;// #v4=(Conflicted); a=0;// iput v1, p0, Landroid/support/v4/util/SparseArrayCompat;->mSize:I a=0;// a=0;// .line 288 a=0;// iput-boolean v1, p0, Landroid/support/v4/util/SparseArrayCompat;->mGarbage:Z a=0;// a=0;// .line 289 a=0;// return-void a=0;// .end method a=0;// a=0;// .method public delete(I)V a=0;// .locals 3 a=0;// a=0;// .prologue a=0;// .line 73 a=0;// iget-object v0, p0, Landroid/support/v4/util/SparseArrayCompat;->mKeys:[I a=0;// a=0;// #v0=(Reference,[I); a=0;// const/4 v1, 0x0 a=0;// a=0;// #v1=(Null); a=0;// iget v2, p0, Landroid/support/v4/util/SparseArrayCompat;->mSize:I a=0;// a=0;// #v2=(Integer); a=0;// invoke-static {v0, v1, v2, p1}, Landroid/support/v4/util/SparseArrayCompat;->binarySearch([IIII)I a=0;// a=0;// move-result v0 a=0;// a=0;// .line 75 a=0;// #v0=(Integer); a=0;// if-ltz v0, :cond_0 a=0;// a=0;// .line 76 a=0;// iget-object v1, p0, Landroid/support/v4/util/SparseArrayCompat;->mValues:[Ljava/lang/Object; a=0;// a=0;// #v1=(Reference,[Ljava/lang/Object;); a=0;// aget-object v1, v1, v0 a=0;// a=0;// #v1=(Null); a=0;// sget-object v2, Landroid/support/v4/util/SparseArrayCompat;->DELETED:Ljava/lang/Object; a=0;// a=0;// #v2=(Reference,Ljava/lang/Object;); a=0;// if-eq v1, v2, :cond_0 a=0;// a=0;// .line 77 a=0;// iget-object v1, p0, Landroid/support/v4/util/SparseArrayCompat;->mValues:[Ljava/lang/Object; a=0;// a=0;// #v1=(Reference,[Ljava/lang/Object;); a=0;// sget-object v2, Landroid/support/v4/util/SparseArrayCompat;->DELETED:Ljava/lang/Object; a=0;// a=0;// aput-object v2, v1, v0 a=0;// a=0;// .line 78 a=0;// const/4 v0, 0x1 a=0;// a=0;// #v0=(One); a=0;// iput-boolean v0, p0, Landroid/support/v4/util/SparseArrayCompat;->mGarbage:Z a=0;// a=0;// .line 81 a=0;// :cond_0 a=0;// #v0=(Integer);v2=(Conflicted); a=0;// return-void a=0;// .end method a=0;// a=0;// .method public get(I)Ljava/lang/Object; a=0;// .locals 1 a=0;// a=0;// .prologue a=0;// .line 52 a=0;// const/4 v0, 0x0 a=0;// a=0;// #v0=(Null); a=0;// invoke-virtual {p0, p1, v0}, Landroid/support/v4/util/SparseArrayCompat;->get(ILjava/lang/Object;)Ljava/lang/Object; a=0;// a=0;// move-result-object v0 a=0;// a=0;// #v0=(Reference,Ljava/lang/Object;); a=0;// return-object v0 a=0;// .end method a=0;// a=0;// .method public get(ILjava/lang/Object;)Ljava/lang/Object; a=0;// .locals 3 a=0;// a=0;// .prologue a=0;// .line 60 a=0;// iget-object v0, p0, Landroid/support/v4/util/SparseArrayCompat;->mKeys:[I a=0;// a=0;// #v0=(Reference,[I); a=0;// const/4 v1, 0x0 a=0;// a=0;// #v1=(Null); a=0;// iget v2, p0, Landroid/support/v4/util/SparseArrayCompat;->mSize:I a=0;// a=0;// #v2=(Integer); a=0;// invoke-static {v0, v1, v2, p1}, Landroid/support/v4/util/SparseArrayCompat;->binarySearch([IIII)I a=0;// a=0;// move-result v0 a=0;// a=0;// .line 62 a=0;// #v0=(Integer); a=0;// if-ltz v0, :cond_0 a=0;// a=0;// iget-object v1, p0, Landroid/support/v4/util/SparseArrayCompat;->mValues:[Ljava/lang/Object; a=0;// a=0;// #v1=(Reference,[Ljava/lang/Object;); a=0;// aget-object v1, v1, v0 a=0;// a=0;// #v1=(Null); a=0;// sget-object v2, Landroid/support/v4/util/SparseArrayCompat;->DELETED:Ljava/lang/Object; a=0;// a=0;// #v2=(Reference,Ljava/lang/Object;); a=0;// if-ne v1, v2, :cond_1 a=0;// a=0;// .line 65 a=0;// :cond_0 a=0;// :goto_0 a=0;// #v1=(Reference,[Ljava/lang/Object;);v2=(Conflicted); a=0;// return-object p2 a=0;// a=0;// :cond_1 a=0;// #v1=(Null);v2=(Reference,Ljava/lang/Object;); a=0;// iget-object v1, p0, Landroid/support/v4/util/SparseArrayCompat;->mValues:[Ljava/lang/Object; a=0;// a=0;// #v1=(Reference,[Ljava/lang/Object;); a=0;// aget-object p2, v1, v0 a=0;// a=0;// #p2=(Null); a=0;// goto :goto_0 a=0;// .end method a=0;// a=0;// .method public indexOfKey(I)I a=0;// .locals 3 a=0;// a=0;// .prologue a=0;// .line 249 a=0;// iget-boolean v0, p0, Landroid/support/v4/util/SparseArrayCompat;->mGarbage:Z a=0;// a=0;// #v0=(Boolean); a=0;// if-eqz v0, :cond_0 a=0;// a=0;// .line 250 a=0;// invoke-direct {p0}, Landroid/support/v4/util/SparseArrayCompat;->gc()V a=0;// a=0;// .line 253 a=0;// :cond_0 a=0;// iget-object v0, p0, Landroid/support/v4/util/SparseArrayCompat;->mKeys:[I a=0;// a=0;// #v0=(Reference,[I); a=0;// const/4 v1, 0x0 a=0;// a=0;// #v1=(Null); a=0;// iget v2, p0, Landroid/support/v4/util/SparseArrayCompat;->mSize:I a=0;// a=0;// #v2=(Integer); a=0;// invoke-static {v0, v1, v2, p1}, Landroid/support/v4/util/SparseArrayCompat;->binarySearch([IIII)I a=0;// a=0;// move-result v0 a=0;// a=0;// #v0=(Integer); a=0;// return v0 a=0;// .end method a=0;// a=0;// .method public indexOfValue(Ljava/lang/Object;)I a=0;// .locals 2 a=0;// a=0;// .prologue a=0;// .line 265 a=0;// iget-boolean v0, p0, Landroid/support/v4/util/SparseArrayCompat;->mGarbage:Z a=0;// a=0;// #v0=(Boolean); a=0;// if-eqz v0, :cond_0 a=0;// a=0;// .line 266 a=0;// invoke-direct {p0}, Landroid/support/v4/util/SparseArrayCompat;->gc()V a=0;// a=0;// .line 269 a=0;// :cond_0 a=0;// const/4 v0, 0x0 a=0;// a=0;// :goto_0 a=0;// #v0=(Integer);v1=(Conflicted); a=0;// iget v1, p0, Landroid/support/v4/util/SparseArrayCompat;->mSize:I a=0;// a=0;// #v1=(Integer); a=0;// if-ge v0, v1, :cond_2 a=0;// a=0;// .line 270 a=0;// iget-object v1, p0, Landroid/support/v4/util/SparseArrayCompat;->mValues:[Ljava/lang/Object; a=0;// a=0;// #v1=(Reference,[Ljava/lang/Object;); a=0;// aget-object v1, v1, v0 a=0;// a=0;// #v1=(Null); a=0;// if-ne v1, p1, :cond_1 a=0;// a=0;// .line 273 a=0;// :goto_1 a=0;// #v1=(Integer); a=0;// return v0 a=0;// a=0;// .line 269 a=0;// :cond_1 a=0;// #v1=(Null); a=0;// add-int/lit8 v0, v0, 0x1 a=0;// a=0;// goto :goto_0 a=0;// a=0;// .line 273 a=0;// :cond_2 a=0;// #v1=(Integer); a=0;// const/4 v0, -0x1 a=0;// a=0;// #v0=(Byte); a=0;// goto :goto_1 a=0;// .end method a=0;// a=0;// .method public keyAt(I)I a=0;// .locals 1 a=0;// a=0;// .prologue a=0;// .line 210 a=0;// iget-boolean v0, p0, Landroid/support/v4/util/SparseArrayCompat;->mGarbage:Z a=0;// a=0;// #v0=(Boolean); a=0;// if-eqz v0, :cond_0 a=0;// a=0;// .line 211 a=0;// invoke-direct {p0}, Landroid/support/v4/util/SparseArrayCompat;->gc()V a=0;// a=0;// .line 214 a=0;// :cond_0 a=0;// iget-object v0, p0, Landroid/support/v4/util/SparseArrayCompat;->mKeys:[I a=0;// a=0;// #v0=(Reference,[I); a=0;// aget v0, v0, p1 a=0;// a=0;// #v0=(Integer); a=0;// return v0 a=0;// .end method a=0;// a=0;// .method public put(ILjava/lang/Object;)V a=0;// .locals 6 a=0;// a=0;// .prologue a=0;// const/4 v5, 0x0 a=0;// a=0;// .line 146 a=0;// #v5=(Null); a=0;// iget-object v0, p0, Landroid/support/v4/util/SparseArrayCompat;->mKeys:[I a=0;// a=0;// #v0=(Reference,[I); a=0;// iget v1, p0, Landroid/support/v4/util/SparseArrayCompat;->mSize:I a=0;// a=0;// #v1=(Integer); a=0;// invoke-static {v0, v5, v1, p1}, Landroid/support/v4/util/SparseArrayCompat;->binarySearch([IIII)I a=0;// a=0;// move-result v0 a=0;// a=0;// .line 148 a=0;// #v0=(Integer); a=0;// if-ltz v0, :cond_0 a=0;// a=0;// .line 149 a=0;// iget-object v1, p0, Landroid/support/v4/util/SparseArrayCompat;->mValues:[Ljava/lang/Object; a=0;// a=0;// #v1=(Reference,[Ljava/lang/Object;); a=0;// aput-object p2, v1, v0 a=0;// a=0;// .line 190 a=0;// :goto_0 a=0;// #v2=(Conflicted);v3=(Conflicted);v4=(Conflicted); a=0;// return-void a=0;// a=0;// .line 151 a=0;// :cond_0 a=0;// #v1=(Integer);v2=(Uninit);v3=(Uninit);v4=(Uninit); a=0;// xor-int/lit8 v0, v0, -0x1 a=0;// a=0;// .line 153 a=0;// iget v1, p0, Landroid/support/v4/util/SparseArrayCompat;->mSize:I a=0;// a=0;// if-ge v0, v1, :cond_1 a=0;// a=0;// iget-object v1, p0, Landroid/support/v4/util/SparseArrayCompat;->mValues:[Ljava/lang/Object; a=0;// a=0;// #v1=(Reference,[Ljava/lang/Object;); a=0;// aget-object v1, v1, v0 a=0;// a=0;// #v1=(Null); a=0;// sget-object v2, Landroid/support/v4/util/SparseArrayCompat;->DELETED:Ljava/lang/Object; a=0;// a=0;// #v2=(Reference,Ljava/lang/Object;); a=0;// if-ne v1, v2, :cond_1 a=0;// a=0;// .line 154 a=0;// iget-object v1, p0, Landroid/support/v4/util/SparseArrayCompat;->mKeys:[I a=0;// a=0;// #v1=(Reference,[I); a=0;// aput p1, v1, v0 a=0;// a=0;// .line 155 a=0;// iget-object v1, p0, Landroid/support/v4/util/SparseArrayCompat;->mValues:[Ljava/lang/Object; a=0;// a=0;// aput-object p2, v1, v0 a=0;// a=0;// goto :goto_0 a=0;// a=0;// .line 159 a=0;// :cond_1 a=0;// #v1=(Integer);v2=(Conflicted); a=0;// iget-boolean v1, p0, Landroid/support/v4/util/SparseArrayCompat;->mGarbage:Z a=0;// a=0;// #v1=(Boolean); a=0;// if-eqz v1, :cond_2 a=0;// a=0;// iget v1, p0, Landroid/support/v4/util/SparseArrayCompat;->mSize:I a=0;// a=0;// #v1=(Integer); a=0;// iget-object v2, p0, Landroid/support/v4/util/SparseArrayCompat;->mKeys:[I a=0;// a=0;// #v2=(Reference,[I); a=0;// array-length v2, v2 a=0;// a=0;// #v2=(Integer); a=0;// if-lt v1, v2, :cond_2 a=0;// a=0;// .line 160 a=0;// invoke-direct {p0}, Landroid/support/v4/util/SparseArrayCompat;->gc()V a=0;// a=0;// .line 163 a=0;// iget-object v0, p0, Landroid/support/v4/util/SparseArrayCompat;->mKeys:[I a=0;// a=0;// #v0=(Reference,[I); a=0;// iget v1, p0, Landroid/support/v4/util/SparseArrayCompat;->mSize:I a=0;// a=0;// invoke-static {v0, v5, v1, p1}, Landroid/support/v4/util/SparseArrayCompat;->binarySearch([IIII)I a=0;// a=0;// move-result v0 a=0;// a=0;// #v0=(Integer); a=0;// xor-int/lit8 v0, v0, -0x1 a=0;// a=0;// .line 166 a=0;// :cond_2 a=0;// #v2=(Conflicted); a=0;// iget v1, p0, Landroid/support/v4/util/SparseArrayCompat;->mSize:I a=0;// a=0;// iget-object v2, p0, Landroid/support/v4/util/SparseArrayCompat;->mKeys:[I a=0;// a=0;// #v2=(Reference,[I); a=0;// array-length v2, v2 a=0;// a=0;// #v2=(Integer); a=0;// if-lt v1, v2, :cond_3 a=0;// a=0;// .line 167 a=0;// iget v1, p0, Landroid/support/v4/util/SparseArrayCompat;->mSize:I a=0;// a=0;// add-int/lit8 v1, v1, 0x1 a=0;// a=0;// invoke-static {v1}, Landroid/support/v4/util/SparseArrayCompat;->idealIntArraySize(I)I a=0;// a=0;// move-result v1 a=0;// a=0;// .line 169 a=0;// new-array v2, v1, [I a=0;// a=0;// .line 170 a=0;// #v2=(Reference,[I); a=0;// new-array v1, v1, [Ljava/lang/Object; a=0;// a=0;// .line 173 a=0;// #v1=(Reference,[Ljava/lang/Object;); a=0;// iget-object v3, p0, Landroid/support/v4/util/SparseArrayCompat;->mKeys:[I a=0;// a=0;// #v3=(Reference,[I); a=0;// iget-object v4, p0, Landroid/support/v4/util/SparseArrayCompat;->mKeys:[I a=0;// a=0;// #v4=(Reference,[I); a=0;// array-length v4, v4 a=0;// a=0;// #v4=(Integer); a=0;// invoke-static {v3, v5, v2, v5, v4}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V a=0;// a=0;// .line 174 a=0;// iget-object v3, p0, Landroid/support/v4/util/SparseArrayCompat;->mValues:[Ljava/lang/Object; a=0;// a=0;// iget-object v4, p0, Landroid/support/v4/util/SparseArrayCompat;->mValues:[Ljava/lang/Object; a=0;// a=0;// #v4=(Reference,[Ljava/lang/Object;); a=0;// array-length v4, v4 a=0;// a=0;// #v4=(Integer); a=0;// invoke-static {v3, v5, v1, v5, v4}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V a=0;// a=0;// .line 176 a=0;// iput-object v2, p0, Landroid/support/v4/util/SparseArrayCompat;->mKeys:[I a=0;// a=0;// .line 177 a=0;// iput-object v1, p0, Landroid/support/v4/util/SparseArrayCompat;->mValues:[Ljava/lang/Object; a=0;// a=0;// .line 180 a=0;// :cond_3 a=0;// #v1=(Conflicted);v2=(Conflicted);v3=(Conflicted);v4=(Conflicted); a=0;// iget v1, p0, Landroid/support/v4/util/SparseArrayCompat;->mSize:I a=0;// a=0;// #v1=(Integer); a=0;// sub-int/2addr v1, v0 a=0;// a=0;// if-eqz v1, :cond_4 a=0;// a=0;// .line 182 a=0;// iget-object v1, p0, Landroid/support/v4/util/SparseArrayCompat;->mKeys:[I a=0;// a=0;// #v1=(Reference,[I); a=0;// iget-object v2, p0, Landroid/support/v4/util/SparseArrayCompat;->mKeys:[I a=0;// a=0;// #v2=(Reference,[I); a=0;// add-int/lit8 v3, v0, 0x1 a=0;// a=0;// #v3=(Integer); a=0;// iget v4, p0, Landroid/support/v4/util/SparseArrayCompat;->mSize:I a=0;// a=0;// #v4=(Integer); a=0;// sub-int/2addr v4, v0 a=0;// a=0;// invoke-static {v1, v0, v2, v3, v4}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V a=0;// a=0;// .line 183 a=0;// iget-object v1, p0, Landroid/support/v4/util/SparseArrayCompat;->mValues:[Ljava/lang/Object; a=0;// a=0;// iget-object v2, p0, Landroid/support/v4/util/SparseArrayCompat;->mValues:[Ljava/lang/Object; a=0;// a=0;// add-int/lit8 v3, v0, 0x1 a=0;// a=0;// iget v4, p0, Landroid/support/v4/util/SparseArrayCompat;->mSize:I a=0;// a=0;// sub-int/2addr v4, v0 a=0;// a=0;// invoke-static {v1, v0, v2, v3, v4}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V a=0;// a=0;// .line 186 a=0;// :cond_4 a=0;// #v1=(Conflicted);v2=(Conflicted);v3=(Conflicted);v4=(Conflicted); a=0;// iget-object v1, p0, Landroid/support/v4/util/SparseArrayCompat;->mKeys:[I a=0;// a=0;// #v1=(Reference,[I); a=0;// aput p1, v1, v0 a=0;// a=0;// .line 187 a=0;// iget-object v1, p0, Landroid/support/v4/util/SparseArrayCompat;->mValues:[Ljava/lang/Object; a=0;// a=0;// aput-object p2, v1, v0 a=0;// a=0;// .line 188 a=0;// iget v0, p0, Landroid/support/v4/util/SparseArrayCompat;->mSize:I a=0;// a=0;// add-int/lit8 v0, v0, 0x1 a=0;// a=0;// iput v0, p0, Landroid/support/v4/util/SparseArrayCompat;->mSize:I a=0;// a=0;// goto/16 :goto_0 a=0;// .end method a=0;// a=0;// .method public remove(I)V a=0;// .locals 0 a=0;// a=0;// .prologue a=0;// .line 87 a=0;// invoke-virtual {p0, p1}, Landroid/support/v4/util/SparseArrayCompat;->delete(I)V a=0;// a=0;// .line 88 a=0;// return-void a=0;// .end method a=0;// a=0;// .method public removeAt(I)V a=0;// .locals 2 a=0;// a=0;// .prologue a=0;// .line 94 a=0;// iget-object v0, p0, Landroid/support/v4/util/SparseArrayCompat;->mValues:[Ljava/lang/Object; a=0;// a=0;// #v0=(Reference,[Ljava/lang/Object;); a=0;// aget-object v0, v0, p1 a=0;// a=0;// #v0=(Null); a=0;// sget-object v1, Landroid/support/v4/util/SparseArrayCompat;->DELETED:Ljava/lang/Object; a=0;// a=0;// #v1=(Reference,Ljava/lang/Object;); a=0;// if-eq v0, v1, :cond_0 a=0;// a=0;// .line 95 a=0;// iget-object v0, p0, Landroid/support/v4/util/SparseArrayCompat;->mValues:[Ljava/lang/Object; a=0;// a=0;// #v0=(Reference,[Ljava/lang/Object;); a=0;// sget-object v1, Landroid/support/v4/util/SparseArrayCompat;->DELETED:Ljava/lang/Object; a=0;// a=0;// aput-object v1, v0, p1 a=0;// a=0;// .line 96 a=0;// const/4 v0, 0x1 a=0;// a=0;// #v0=(One); a=0;// iput-boolean v0, p0, Landroid/support/v4/util/SparseArrayCompat;->mGarbage:Z a=0;// a=0;// .line 98 a=0;// :cond_0 a=0;// #v0=(Boolean); a=0;// return-void a=0;// .end method a=0;// a=0;// .method public removeAtRange(II)V a=0;// .locals 2 a=0;// a=0;// .prologue a=0;// .line 107 a=0;// iget v0, p0, Landroid/support/v4/util/SparseArrayCompat;->mSize:I a=0;// a=0;// #v0=(Integer); a=0;// add-int v1, p1, p2 a=0;// a=0;// #v1=(Integer); a=0;// invoke-static {v0, v1}, Ljava/lang/Math;->min(II)I a=0;// a=0;// move-result v0 a=0;// a=0;// .line 108 a=0;// :goto_0 a=0;// if-ge p1, v0, :cond_0 a=0;// a=0;// .line 109 a=0;// invoke-virtual {p0, p1}, Landroid/support/v4/util/SparseArrayCompat;->removeAt(I)V a=0;// a=0;// .line 108 a=0;// add-int/lit8 p1, p1, 0x1 a=0;// a=0;// goto :goto_0 a=0;// a=0;// .line 111 a=0;// :cond_0 a=0;// return-void a=0;// .end method a=0;// a=0;// .method public setValueAt(ILjava/lang/Object;)V a=0;// .locals 1 a=0;// a=0;// .prologue a=0;// .line 236 a=0;// iget-boolean v0, p0, Landroid/support/v4/util/SparseArrayCompat;->mGarbage:Z a=0;// a=0;// #v0=(Boolean); a=0;// if-eqz v0, :cond_0 a=0;// a=0;// .line 237 a=0;// invoke-direct {p0}, Landroid/support/v4/util/SparseArrayCompat;->gc()V a=0;// a=0;// .line 240 a=0;// :cond_0 a=0;// iget-object v0, p0, Landroid/support/v4/util/SparseArrayCompat;->mValues:[Ljava/lang/Object; a=0;// a=0;// #v0=(Reference,[Ljava/lang/Object;); a=0;// aput-object p2, v0, p1 a=0;// a=0;// .line 241 a=0;// return-void a=0;// .end method a=0;// a=0;// .method public size()I a=0;// .locals 1 a=0;// a=0;// .prologue a=0;// .line 197 a=0;// iget-boolean v0, p0, Landroid/support/v4/util/SparseArrayCompat;->mGarbage:Z a=0;// a=0;// #v0=(Boolean); a=0;// if-eqz v0, :cond_0 a=0;// a=0;// .line 198 a=0;// invoke-direct {p0}, Landroid/support/v4/util/SparseArrayCompat;->gc()V a=0;// a=0;// .line 201 a=0;// :cond_0 a=0;// iget v0, p0, Landroid/support/v4/util/SparseArrayCompat;->mSize:I a=0;// a=0;// #v0=(Integer); a=0;// return v0 a=0;// .end method a=0;// a=0;// .method public valueAt(I)Ljava/lang/Object; a=0;// .locals 1 a=0;// a=0;// .prologue a=0;// .line 223 a=0;// iget-boolean v0, p0, Landroid/support/v4/util/SparseArrayCompat;->mGarbage:Z a=0;// a=0;// #v0=(Boolean); a=0;// if-eqz v0, :cond_0 a=0;// a=0;// .line 224 a=0;// invoke-direct {p0}, Landroid/support/v4/util/SparseArrayCompat;->gc()V a=0;// a=0;// .line 227 a=0;// :cond_0 a=0;// iget-object v0, p0, Landroid/support/v4/util/SparseArrayCompat;->mValues:[Ljava/lang/Object; a=0;// a=0;// #v0=(Reference,[Ljava/lang/Object;); a=0;// aget-object v0, v0, p1 a=0;// a=0;// #v0=(Null); a=0;// return-object v0 a=0;// .end method }}
[ "chenyouzi@sogou-inc.com" ]
chenyouzi@sogou-inc.com
e10a5f9416a5171abd4d2cbc3911eabad8eddcbf
d5961c5c5145544c9cc7f0e24c8148295fc32488
/test/base/vhdl/visitors/VariableNameReplacerImplTest.java
575951a2c046e2c90ab054d670637cba1f4aed8e
[]
no_license
manasdas17/apricot
e7d3e11861d8ddb03adc356926c779e2f64fcfb2
3c2fc24111bfc76de6f6e6a12a1b3cfb2074fbfe
refs/heads/master
2021-01-18T04:23:05.377826
2013-10-01T10:10:18
2013-10-01T10:10:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,429
java
package base.vhdl.visitors; import org.junit.Test; import static org.easymock.classextension.EasyMock.createMock; import static org.easymock.classextension.EasyMock.*; import static junit.framework.Assert.*; import base.vhdl.structure.Process; import ui.ConfigurationHandler; /** * @author Anton Chepurov */ public class VariableNameReplacerImplTest { @Test public void prefix() { ConfigurationHandler config = createMock(ConfigurationHandler.class); expect(config.getStateVarName()).andReturn(""); replay(config); VariableNameReplacerImpl nameReplacer = new VariableNameReplacerImpl(config); Process mockProcess = createMock(Process.class); expect(mockProcess.getName()).andReturn("REG_SET"); expect(mockProcess.getName()).andReturn("ANOTHER"); expect(mockProcess.getName()).andReturn(""); expect(mockProcess.getName()).andReturn(null); expect(mockProcess.getName()).andReturn(null); expect(mockProcess.getName()).andReturn(null); replay(mockProcess); assertEquals("#REG_SET#__", nameReplacer.createPrefix(mockProcess)); assertEquals("#ANOTHER#__", nameReplacer.createPrefix(mockProcess)); assertEquals("#PROCESS_1#__", nameReplacer.createPrefix(mockProcess)); assertEquals("#PROCESS_2#__", nameReplacer.createPrefix(mockProcess)); assertEquals("#PROCESS_3#__", nameReplacer.createPrefix(mockProcess)); assertEquals("#PROCESS_4#__", nameReplacer.createPrefix(mockProcess)); } }
[ "anton.chepurov@gmail.com" ]
anton.chepurov@gmail.com
a87cd00c4d02da1cf98e2d07006a6fe689380d89
c471ac0c712dcdf5dfdc2bc21ac957bae4cd3337
/business/Sortable.java
7194649dfc061498584002b3cd5ed72d66d18b6a
[]
no_license
sarawille/Dice-Games
0bee8cc95b0711e8ca006f2495d93519c98e65b2
0f6aa1b755cff493071a3abe090cac9a0dd3cefe
refs/heads/master
2021-01-22T16:45:13.035486
2016-05-12T13:32:00
2016-05-12T13:32:00
55,974,402
0
0
null
null
null
null
UTF-8
Java
false
false
139
java
package business; /** * @author - Sara Wille * Sortable is implemented by Hand. */ public interface Sortable { void sortItems(); }
[ "wille.sk@gmail.com" ]
wille.sk@gmail.com
57dd88d1de74360cd511368468228b1de9ac60bf
eb9f655206c43c12b497c667ba56a0d358b6bc3a
/platform/editor-ui-api/src/com/intellij/ide/lightEdit/LightEditorInfo.java
55d0148e00110ac4db00074fbbb9dbea66bf6379
[ "Apache-2.0" ]
permissive
JetBrains/intellij-community
2ed226e200ecc17c037dcddd4a006de56cd43941
05dbd4575d01a213f3f4d69aa4968473f2536142
refs/heads/master
2023-09-03T17:06:37.560889
2023-09-03T11:51:00
2023-09-03T12:12:27
2,489,216
16,288
6,635
Apache-2.0
2023-09-12T07:41:58
2011-09-30T13:33:05
null
UTF-8
Java
false
false
1,249
java
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.ide.lightEdit; import com.intellij.openapi.fileEditor.FileEditor; import com.intellij.openapi.vfs.VirtualFile; import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.nio.file.Path; @ApiStatus.Experimental public interface LightEditorInfo { @NotNull FileEditor getFileEditor(); @NotNull VirtualFile getFile(); /** * @return True if the document either is new and has never been saved or has been modified but not saved. * @see #isSaveRequired() */ boolean isUnsaved(); /** * @return True if the document exists only in memory and doesn't have a corresponding physical file. */ boolean isNew(); /** * @return The same value as {@link #isUnsaved()} for already saved but modified documents. For new documents which have never been * saved yet (exist only in memory), returns true only if document content is not empty. */ boolean isSaveRequired(); @Nullable Path getPreferredSavePath(); void setPreferredSavePath(@Nullable Path preferredSavePath); }
[ "intellij-monorepo-bot-no-reply@jetbrains.com" ]
intellij-monorepo-bot-no-reply@jetbrains.com
2314b0e45ac0fadbbae4accb8495ee71babbaf3e
74fbffd0b6f5839628d2a5c56b7e4cb1de77fc16
/src/hello/Findelebycss.java
57d63577514617245cbb1f784e1b8d49dea8715d
[]
no_license
rashmihn11/test
d26cb3d3f200a7619c164c0e7d03ab6ac045893f
4e5e82dc95b73f27560aea1b438e738d45af0086
refs/heads/master
2020-03-18T23:00:57.921850
2018-05-30T02:53:37
2018-05-30T02:53:37
135,378,266
0
0
null
null
null
null
UTF-8
Java
false
false
2,647
java
package hello; import java.util.Properties; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.support.ui.Select; public class Findelebycss { public static void main(String[] ars) { WebDriver driver; System.setProperty("webdriver.gecko.driver", "C:\\Users\\pavan\\Desktop\\Setup\\geckodriver-v0.19.1-win64\\geckodriver.exe"); driver = new FirefoxDriver(); //driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); String baseURL = "http://adactin.com/HotelApp/"; driver.get(baseURL); WebElement User = driver.findElement(By.cssSelector("input[id=username]")); User.sendKeys("adactin123"); WebElement Pass = driver.findElement(By.cssSelector("input[id=password]")); Pass.sendKeys("adactin123"); WebElement Logbutton = driver.findElement(By.cssSelector("input[id=login]")); Logbutton.click(); String sExpetedTitle= "AdactIn.com - Search Hotel" ; String sAtualTitle = driver.getTitle(); System.out.println("vvvvalue " + sAtualTitle); if(sExpetedTitle.contentEquals(sAtualTitle)) { System.out.println("Home page is loaded"); } else { System.out.println("not loaded"); } Select drpLocation = new Select(driver.findElement(By.name("location"))); drpLocation.selectByVisibleText("Sydney"); drpLocation.selectByIndex(2); //hotel Select drpHotel = new Select(driver.findElement(By.name("hotels"))); drpHotel.selectByValue("Hotel Creek"); drpHotel.selectByIndex(2); drpHotel.selectByVisibleText("Hotel Hervey"); //room type Select drpRoom = new Select(driver.findElement(By.name("room_type"))); drpRoom.selectByIndex(2); //Number of rooms Select drpNoroom = new Select(driver.findElement(By.name("room_nos"))); drpNoroom.selectByValue("3"); WebElement sDate = driver.findElement(By.name("datepick_in")); sDate.clear(); sDate.sendKeys("22/04/2018"); //sDate.clear(); //sDate.sendKeys("24042018"); WebElement sDateout = driver.findElement(By.id("datepick_out")); sDateout.clear(); sDateout.sendKeys("28/04/2018"); Select adultRoom = new Select(driver.findElement(By.name("adult_room"))); adultRoom.selectByIndex(3); Select childRoom = new Select(driver.findElement(By.name("child_room"))); childRoom.selectByValue("2"); WebElement aSubmit = driver.findElement(By.name("submit")); aSubmit.click(); } }
[ "pavan@192.168.1.112" ]
pavan@192.168.1.112
534d9a6573b43204e5674be5196f43dd227fd6f9
da049f1efd756eaac6f40a4f6a9c4bdca7e16a06
/Prize_left_page_launcher/PrizeLauncher3/src/com/android/launcher3/view/WallPaperDialog.java
488120a6e58c2d1ba91bc6e62cbe3ae5fb641912
[ "Apache-2.0" ]
permissive
evilhawk00/AppGroup
c22e693320039f4dc7b384976a513f94be5bccbe
a22714c1e6b9f5c157bebb2c5dbc96b854ba949a
refs/heads/master
2022-01-11T18:04:27.481162
2018-04-19T03:02:26
2018-04-19T03:02:26
420,370,518
1
0
null
null
null
null
UTF-8
Java
false
false
1,990
java
package com.android.launcher3.view; import com.android.launcher3.R; import android.app.Dialog; import android.content.Context; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.TextView; public class WallPaperDialog extends Dialog implements android.view.View.OnClickListener { public final int LOCK = 0; public final int DESK = 1; public final int ALL = 2; private String[] items; public WallPaperDialog(Context context) { super(context); } public WallPaperDialog(Context context, int theme,String[] item) { super(context, theme); items = item; } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.wallpaper_dialog); TextView title_tv = (TextView) findViewById(R.id.dlg_title_tv); title_tv.setText(R.string.wallpaper_dlg_title); TextView lock_tv = (TextView) findViewById(R.id.lock_tv); lock_tv.setText(items[0]); TextView desk_tv = (TextView) findViewById(R.id.desk_tv); desk_tv.setText(items[1]); TextView bothSet_tv = (TextView) findViewById(R.id.bothSet_tv); bothSet_tv.setText(items[2]); Button wallpaper_neg = (Button)findViewById(R.id.wallpaper_neg); wallpaper_neg.setOnClickListener(this); lock_tv.setOnClickListener(this); desk_tv.setOnClickListener(this); bothSet_tv.setOnClickListener(this); } @Override public void onClick(View view) { switch (view.getId()) { case R.id.lock_tv: onItemClick.onClick(LOCK); break; case R.id.desk_tv: onItemClick.onClick(DESK); break; case R.id.bothSet_tv: onItemClick.onClick(ALL); break; case R.id.wallpaper_neg: this.dismiss(); break; } } /**点击的回调*/ public static interface OnItemClick{ void onClick(int which); } private OnItemClick onItemClick; public void setOnItemClick(OnItemClick onItemClick){ this.onItemClick = onItemClick; } }
[ "649830103@qq.com" ]
649830103@qq.com
67b3484b92a80faf784eebcf0cc8f4f45904d3f0
daa635ba14b0fdf10d8bf80e93979e6405cc4f21
/HackerRankProbs/src/BeautifulTripletsProducts.java
70c105cd23a6a15b40c4698e7938f4c518398688
[]
no_license
abhishek93gautam/java-programs
6fd28dfd2bdb7f994281a662635d437d6974b84d
dda0a45c98e84b693ff7b101fd7bc85440f93ee9
refs/heads/master
2023-04-28T22:53:50.106656
2023-04-24T09:58:41
2023-04-24T09:58:41
153,039,445
0
0
null
null
null
null
UTF-8
Java
false
false
2,596
java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.HashSet; import java.util.Set; import java.util.SortedSet; import java.util.TreeSet; public class BeautifulTripletsProducts { public static void main(String[] args) throws NumberFormatException, IOException { // TODO Auto-generated method stub BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n= Integer.parseInt(br.readLine()); String[] str = br.readLine().split("\\s"); int[] arr = new int[n]; for(int i=0;i<n;i++) { arr[i] = Integer.parseInt(str[i]); } // find max element next to an element int[] maxi=new int[n]; maxi[n-1] = arr[n-1]; for(int i=n-2;i>=0;i--) { maxi[i] = Math.max(arr[i], maxi[i+1]); } //PrintArray(maxi); // Make a set in which we will find the upper bound for the given value - maximum element on left side of middle // to make array sorted for binary search we will insert negative values in HashSet SortedSet<Integer> set =new TreeSet<Integer>(); set.add(-arr[0]); int ans = 0; for(int i=1;i+1<n;i++) { int upperbound = UpperBoundNew(set,0,set.size()-1,-arr[i]); //System.out.print(upperbound+" "); if(-(upperbound)<arr[i] && maxi[i+1] > arr[i]) { ans = Math.max(ans, -(upperbound)* arr[i] * maxi[i+1]); } set.add(-arr[i]); } System.out.println(ans); } static int UpperBoundNew(SortedSet<Integer> set,int start,int end,int value) { Integer[] arrayToSearch = new Integer[set.size()]; arrayToSearch = set.toArray(arrayToSearch); int low= start; int high = end; int mid = 0; while(low<=high) { mid = low + (high-low)/2; if(arrayToSearch[mid]>value && ((mid==0)|| arrayToSearch[mid-1]<=value)) { return arrayToSearch[mid]; } else if(arrayToSearch[mid]>value) { high=mid-1; } else { low = mid+1; } } return arrayToSearch[mid]; } static int UpperBound(SortedSet<Integer> set,int start,int end,int value) { Integer[] arrayToSearch = new Integer[set.size()]; arrayToSearch = set.toArray(arrayToSearch); int low= start; int high = end; //boolean flag = false; while(low<=high) { if(low==high) { return arrayToSearch[low]; } int mid = low+(high-low)/2; if(value >= arrayToSearch[mid]) { low= mid+1; //flag =true; } else { high = mid-1; } } return arrayToSearch[low]; } static void PrintArray(int[] arr) { for(int i=0;i<arr.length;i++) { System.out.print(arr[i]+" "); } System.out.println(); } }
[ "abugautam@gmail.com" ]
abugautam@gmail.com
54f136842085a7f98d84443a186d3380442f3b43
8c1ebcf2aabda6315cbaad3c6f9f9e72b609ca54
/kubernetes-model-generator/openshift-model-config/src/generated/java/io/fabric8/openshift/api/model/config/v1/ConfigMapNameReference.java
f793b8e9f377b6abdd0f06f48e9c9240282c48ac
[ "Apache-2.0" ]
permissive
akram/kubernetes-client
154969ce0aee87223bb3d5f6fb89f5e7d5f4d163
449d06bc447f2b621149b20312235d2d28460873
refs/heads/master
2023-08-08T20:59:09.663361
2023-06-22T11:58:02
2023-06-22T13:46:14
197,317,669
0
3
Apache-2.0
2023-07-03T08:10:43
2019-07-17T04:54:52
Java
UTF-8
Java
false
false
3,132
java
package io.fabric8.openshift.api.model.config.v1; import java.util.HashMap; import java.util.Map; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.fabric8.kubernetes.api.model.Container; import io.fabric8.kubernetes.api.model.IntOrString; import io.fabric8.kubernetes.api.model.KubernetesResource; import io.fabric8.kubernetes.api.model.LabelSelector; import io.fabric8.kubernetes.api.model.LocalObjectReference; import io.fabric8.kubernetes.api.model.ObjectMeta; import io.fabric8.kubernetes.api.model.ObjectReference; import io.fabric8.kubernetes.api.model.PersistentVolumeClaim; import io.fabric8.kubernetes.api.model.PodTemplateSpec; import io.fabric8.kubernetes.api.model.ResourceRequirements; import io.sundr.builder.annotations.Buildable; import io.sundr.builder.annotations.BuildableReference; import lombok.EqualsAndHashCode; import lombok.Setter; import lombok.ToString; import lombok.experimental.Accessors; @JsonDeserialize(using = com.fasterxml.jackson.databind.JsonDeserializer.None.class) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ "apiVersion", "kind", "metadata", "name" }) @ToString @EqualsAndHashCode @Setter @Accessors(prefix = { "_", "" }) @Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage = false, lazyCollectionInitEnabled = false, builderPackage = "io.fabric8.kubernetes.api.builder", refs = { @BuildableReference(ObjectMeta.class), @BuildableReference(LabelSelector.class), @BuildableReference(Container.class), @BuildableReference(PodTemplateSpec.class), @BuildableReference(ResourceRequirements.class), @BuildableReference(IntOrString.class), @BuildableReference(ObjectReference.class), @BuildableReference(LocalObjectReference.class), @BuildableReference(PersistentVolumeClaim.class) }) public class ConfigMapNameReference implements KubernetesResource { @JsonProperty("name") private String name; @JsonIgnore private Map<String, Object> additionalProperties = new HashMap<String, Object>(); /** * No args constructor for use in serialization * */ public ConfigMapNameReference() { } /** * * @param name */ public ConfigMapNameReference(String name) { super(); this.name = name; } @JsonProperty("name") public String getName() { return name; } @JsonProperty("name") public void setName(String name) { this.name = name; } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } @JsonAnySetter public void setAdditionalProperty(String name, Object value) { this.additionalProperties.put(name, value); } }
[ "marc@marcnuri.com" ]
marc@marcnuri.com
9219b68b93daee4651a1cf96538b3e9349227e0e
bcbb026a251ff163723caa99989ac14e4e3f106c
/android/src/main/java/cn/qiuxiang/react/amap3d/location/AMapLocationModule.java
90e9200690523c4b8b997f6badbbf4c9e22e6afd
[]
no_license
fenglu09/react-native-amap
4775f45aaab317b878b86b3bb2f60b208ea5c409
b529a215c1b801e48b0c7a98d01f1b3fd88f0bff
refs/heads/master
2022-12-25T14:13:16.746320
2019-09-09T13:19:25
2019-09-09T13:19:25
103,134,260
0
6
null
2020-10-01T01:23:09
2017-09-11T12:39:49
Objective-C
UTF-8
Java
false
false
13,245
java
package cn.qiuxiang.react.amap3d.location; import com.amap.api.location.AMapLocation; import com.amap.api.location.AMapLocationClient; import com.amap.api.location.AMapLocationClientOption; import com.amap.api.location.AMapLocationClientOption.AMapLocationMode; import com.amap.api.location.AMapLocationListener; import com.facebook.react.bridge.Arguments; import com.facebook.react.bridge.LifecycleEventListener; import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.bridge.ReactContextBaseJavaModule; import com.facebook.react.bridge.ReactMethod; import com.facebook.react.bridge.ReadableMap; import com.facebook.react.bridge.WritableMap; import com.facebook.react.modules.core.DeviceEventManagerModule; import java.util.HashMap; import java.util.Map; import javax.annotation.Nullable; public class AMapLocationModule extends ReactContextBaseJavaModule implements AMapLocationListener, LifecycleEventListener{ private static final String MODULE_NAME = "RNLocation"; private AMapLocationClient mLocationClient; private AMapLocationClient multipLocationClient; private AMapLocationListener mLocationListener = this; private final ReactApplicationContext mReactContext; // 是否显示详细信息 private boolean needDetail = false; private boolean multipNeedDetail = false; private void sendEvent(String eventName, @Nullable WritableMap params) { if (mReactContext != null) { mReactContext .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class) .emit(eventName, params); } } public AMapLocationModule(ReactApplicationContext reactContext) { super(reactContext); this.mReactContext = reactContext; } @Override public String getName() { return MODULE_NAME; } @Override public Map<String, Object> getConstants() { final Map<String, Object> constants = new HashMap<>(); return constants; } @ReactMethod public void startLocation(@Nullable ReadableMap options) { mLocationClient = new AMapLocationClient(mReactContext); mLocationClient.setLocationListener(mLocationListener); mReactContext.addLifecycleEventListener(this); AMapLocationClientOption mLocationOption = new AMapLocationClientOption(); needDetail = true; if (options != null) { // if (options.hasKey("needDetail")) { // needDetail = options.getBoolean("needDetail"); // } if (options.hasKey("accuracy")) { //设置定位模式为高精度模式,Battery_Saving为低功耗模式,Device_Sensors是仅设备模式 switch (options.getString("accuracy")) { case "BatterySaving": mLocationOption.setLocationMode(AMapLocationMode.Battery_Saving); break; case "DeviceSensors": mLocationOption.setLocationMode(AMapLocationMode.Device_Sensors); break; case "HighAccuracy": mLocationOption.setLocationMode(AMapLocationMode.Hight_Accuracy); break; default: break; } } if (options.hasKey("needAddress")) { //设置是否返回地址信息(默认返回地址信息) needDetail = options.getBoolean("needAddress"); mLocationOption.setNeedAddress(options.getBoolean("needAddress")); } if (options.hasKey("onceLocation")) { //设置是否只定位一次,默认为false mLocationOption.setOnceLocation(options.getBoolean("onceLocation")); } if (options.hasKey("onceLocationLatest")) { //获取最近3s内精度最高的一次定位结果 mLocationOption.setOnceLocationLatest(options.getBoolean("onceLocationLatest")); } if (options.hasKey("wifiActiveScan")) { //设置是否强制刷新WIFI,默认为强制刷新 //模式为仅设备模式(Device_Sensors)时无效 mLocationOption.setWifiActiveScan(options.getBoolean("wifiActiveScan")); } if (options.hasKey("mockEnable")) { //设置是否允许模拟位置,默认为false,不允许模拟位置 //模式为低功耗模式(Battery_Saving)时无效 mLocationOption.setMockEnable(options.getBoolean("mockEnable")); } if (options.hasKey("interval")) { //设置定位间隔,单位毫秒,默认为2000ms mLocationOption.setInterval(options.getInt("interval")); } if (options.hasKey("httpTimeOut")) { //设置联网超时时间 //默认值:30000毫秒 //模式为仅设备模式(Device_Sensors)时无效 mLocationOption.setHttpTimeOut(options.getInt("httpTimeOut")); } if (options.hasKey("protocol")) { switch (options.getString("protocol")) { case "http": mLocationOption.setLocationProtocol(AMapLocationClientOption.AMapLocationProtocol.HTTP); break; case "https": mLocationOption.setLocationProtocol(AMapLocationClientOption.AMapLocationProtocol.HTTPS); break; default: break; } } if (options.hasKey("locationCacheEnable")) { mLocationOption.setLocationCacheEnable(options.getBoolean("locationCacheEnable")); } } this.mLocationClient.setLocationOption(mLocationOption); this.mLocationClient.startLocation(); } @ReactMethod public void stopLocation() { if (this.mLocationClient != null) { this.mLocationClient.stopLocation(); } } @ReactMethod public void destroyLocation() { if (this.mLocationClient != null) { this.mLocationClient.onDestroy(); } } @ReactMethod public void startContinuousLocation(@Nullable ReadableMap options) { multipLocationClient = new AMapLocationClient(mReactContext); multipLocationClient.setLocationListener(new AMapLocationListener() { @Override public void onLocationChanged(AMapLocation aMapLocation) { if (aMapLocation != null) { sendEvent("onContinuousLocationChangedEvent", amapLocationToObject(aMapLocation, multipNeedDetail)); } } }); mReactContext.addLifecycleEventListener(this); AMapLocationClientOption mLocationOption = new AMapLocationClientOption(); multipNeedDetail = true; mLocationOption.setOnceLocation(false); if (options != null) { if (options.hasKey("accuracy")) { //设置定位模式为高精度模式,Battery_Saving为低功耗模式,Device_Sensors是仅设备模式 switch (options.getString("accuracy")) { case "BatterySaving": mLocationOption.setLocationMode(AMapLocationMode.Battery_Saving); break; case "DeviceSensors": mLocationOption.setLocationMode(AMapLocationMode.Device_Sensors); break; case "HighAccuracy": mLocationOption.setLocationMode(AMapLocationMode.Hight_Accuracy); break; default: break; } } if (options.hasKey("needAddress")) { //设置是否返回地址信息(默认返回地址信息) multipNeedDetail = options.getBoolean("needAddress"); mLocationOption.setNeedAddress(options.getBoolean("needAddress")); } if (options.hasKey("wifiActiveScan")) { //设置是否强制刷新WIFI,默认为强制刷新 //模式为仅设备模式(Device_Sensors)时无效 mLocationOption.setWifiActiveScan(options.getBoolean("wifiActiveScan")); } if (options.hasKey("mockEnable")) { //设置是否允许模拟位置,默认为false,不允许模拟位置 //模式为低功耗模式(Battery_Saving)时无效 mLocationOption.setMockEnable(options.getBoolean("mockEnable")); } if (options.hasKey("interval")) { //设置定位间隔,单位毫秒,默认为2000ms mLocationOption.setInterval(options.getInt("interval")); } if (options.hasKey("httpTimeOut")) { //设置联网超时时间 //默认值:30000毫秒 //模式为仅设备模式(Device_Sensors)时无效 mLocationOption.setHttpTimeOut(options.getInt("httpTimeOut")); } // 默认是Https mLocationOption.setLocationProtocol(AMapLocationClientOption.AMapLocationProtocol.HTTPS); if (options.hasKey("protocol")) { switch (options.getString("protocol")) { case "http": mLocationOption.setLocationProtocol(AMapLocationClientOption.AMapLocationProtocol.HTTP); break; case "https": mLocationOption.setLocationProtocol(AMapLocationClientOption.AMapLocationProtocol.HTTPS); break; default: break; } } if (options.hasKey("locationCacheEnable")) { mLocationOption.setLocationCacheEnable(options.getBoolean("locationCacheEnable")); } } this.multipLocationClient.setLocationOption(mLocationOption); this.multipLocationClient.startLocation(); } @ReactMethod public void stopContinuousLocation() { if (this.multipLocationClient != null) { this.multipLocationClient.stopLocation(); } } @ReactMethod public void destroyContinuousLocation() { if (this.multipLocationClient != null) { this.multipLocationClient.onDestroy(); } } @Override public void onLocationChanged(AMapLocation amapLocation) { if (amapLocation != null) { sendEvent("onLocationChangedEvent", amapLocationToObject(amapLocation, needDetail)); } } private WritableMap amapLocationToObject(AMapLocation amapLocation, boolean needDetail) { WritableMap map = Arguments.createMap(); Integer errorCode = amapLocation.getErrorCode(); if (errorCode > 0) { map.putInt("errorCode", errorCode); map.putString("errorInfo", amapLocation.getErrorInfo()); } else { Double latitude = amapLocation.getLatitude(); Double longitude = amapLocation.getLongitude(); map.putInt("locationType", amapLocation.getLocationType()); map.putDouble("latitude", latitude); map.putDouble("longitude", longitude); if (needDetail) { // GPS Only map.putDouble("accuracy", amapLocation.getAccuracy()); map.putDouble("altitude", amapLocation.getAltitude()); map.putDouble("speed", amapLocation.getSpeed()); map.putDouble("bearing", amapLocation.getBearing()); map.putString("address", amapLocation.getAddress()); map.putString("adCode", amapLocation.getAdCode()); map.putString("country", amapLocation.getCountry()); map.putString("province", amapLocation.getProvince()); map.putString("poiName", amapLocation.getPoiName()); map.putString("aoiName", amapLocation.getAoiName()); map.putString("street", amapLocation.getStreet()); map.putString("streetNum", amapLocation.getStreetNum()); map.putString("city", amapLocation.getCity()); map.putString("cityCode", amapLocation.getCityCode()); map.putString("district", amapLocation.getDistrict()); map.putInt("gpsStatus", amapLocation.getGpsAccuracyStatus()); map.putString("locationDetail", amapLocation.getLocationDetail()); } } return map; } @Override public void onHostResume() { } @Override public void onHostPause() { } @Override public void onHostDestroy() { if (this.mLocationClient != null) { this.mLocationClient.onDestroy(); } if (this.multipLocationClient != null) { this.multipLocationClient.onDestroy(); } } }
[ "fenglu09@gmail.com" ]
fenglu09@gmail.com
fea314ab58c4639cb8ae403d22acea5733af7dc3
a5edba0ee02a77cd87c1e121ce1f8bc37cd58f4d
/gfg/src/array/Trapping_rain_water.java
af00cee2a6747c894a3cb0fc0bcdbc3a8fe451a0
[]
no_license
Sejal16/gfg_ds
0a845cc0ebe6a068ee140dbc9c327c7332f2c632
e022d2cce782e19f4e66cb0fde19386312b29ce7
refs/heads/master
2023-02-16T19:36:31.166153
2021-01-11T09:40:27
2021-01-11T09:40:27
328,608,729
0
0
null
null
null
null
UTF-8
Java
false
false
1,328
java
package array; import java.util.Scanner; public class Trapping_rain_water { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int arr[]=new int[n]; for (int i = 0; i < arr.length; i++) { arr[i]=sc.nextInt(); } getwater(arr,n); efficient(arr,n); } //NAIVE APPROACH O(n^2) // FIND THE MAX OF THE LEFTMOST //FIND THE MAX OF THE RIGHT MOST // FIND MIN OF LMAX AND RMAX // SUBTRACT MIN WITH THAT NUMBER public static void getwater(int[] arr, int n) { int res=0; for(int i=1;i<n-1;i++) { int lmax=arr[i]; for(int j=0;j<i;j++) lmax=Math.max(lmax, arr[j]); int rmax=arr[i]; for(int j=i+1;j<n;j++) rmax=Math.max(rmax, arr[j]); res=res+Math.min(lmax, rmax)-arr[i]; } System.out.println(res); } //efficient sc:O(n) private static void efficient(int[] arr, int n) { int res = 0; int lMax[] = new int[n]; int rMax[] = new int[n]; lMax[0] = arr[0]; for(int i = 1; i < n; i++) lMax[i] = Math.max(arr[i], lMax[i - 1]); rMax[n - 1] = arr[n - 1]; for(int i = n - 2; i >= 0; i--) rMax[i] = Math.max(arr[i], rMax[i + 1]); for(int i = 1; i < n - 1; i++) res = res + (Math.min(lMax[i], rMax[i]) - arr[i]); System.out.println(res); } }
[ "sejal.august16@gmail.com" ]
sejal.august16@gmail.com
05cc9b08201d225611ff51978a450c5a32e149d5
eb6dc621771b5ca7621c39900a171c59418bd17e
/src/treeNodes/FindBottomLeftTreeValue.java
5475cebdcf0d4c863e4a9f363a9c838559c8b8c0
[]
no_license
porosyonocheg/nodes
cdfe45e24437c110a129c12f12535eaafebd5a1c
895c2373f20aa51c5e643ea32e3a07b0233bb5f7
refs/heads/master
2023-07-11T12:53:40.193235
2021-08-24T13:27:19
2021-08-24T13:27:19
339,402,765
0
0
null
null
null
null
UTF-8
Java
false
false
1,382
java
package treeNodes; /**Возвращает значение самого глубокого левого узла бинарного дерева. * @author Сергей Шершавин*/ public class FindBottomLeftTreeValue extends Command { public FindBottomLeftTreeValue(TreeNode root) { super(root); } /** Вместо глобальных переменных используем массив, в 0-й ячейке которого будем хранить значение узла на наибольшей * текущей глубине (при обходе Preorder узел будет самым левым из возможных на данной глубине), а в 1-й ячейке - * максимальную текущую глубину*/ private int findBottomLeftValue(TreeNode node, int depth, int[] result) { if (depth > result[1]) { result[0] = node.val; result[1] = depth; } if (node.left != null) findBottomLeftValue(node.left, depth + 1, result); if (node.right != null) findBottomLeftValue(node.right, depth + 1, result); return result[0]; } @Override public Object execute() { if (root == null) throw new IllegalArgumentException("Nothing to look for"); return findBottomLeftValue(root, 1, new int[]{0,0}); } }
[ "mourinho89@rambler.ru" ]
mourinho89@rambler.ru
90cd3064952bcb3979d74e2f5ff5670e64808761
b44769114f497b48d1f3edaa1a7bcee76591879a
/jib-core/src/main/java/com/google/cloud/tools/jib/image/json/OciIndexTemplate.java
5344498e45e4b17a4c3e9482792052e201853e38
[ "Apache-2.0" ]
permissive
glaforge/jib
7e1502b75136d044379cb6d18cc14100c51ffc37
36c83afc5a56bd273a4da2bba5703dae5263ea52
refs/heads/master
2021-07-17T05:07:55.606555
2020-05-15T12:53:16
2020-05-15T12:53:16
264,164,636
2
0
Apache-2.0
2020-05-15T10:27:15
2020-05-15T10:27:14
null
UTF-8
Java
false
false
2,618
java
/* * Copyright 2019 Google LLC. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ package com.google.cloud.tools.jib.image.json; import com.google.cloud.tools.jib.blob.BlobDescriptor; import com.google.cloud.tools.jib.json.JsonTemplate; import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.List; /** * JSON template for OCI archive "index.json" file. * * <p>Example manifest JSON: * * <pre>{@code * { * "schemaVersion": 2, * "manifests": [ * { * "mediaType": "application/vnd.oci.image.manifest.v1+json", * "digest": "sha256:e684b1dceef404268f17d4adf7f755fd9912b8ae64864b3954a83ebb8aa628b3", * "size": 1132, * "annotations": { * "org.opencontainers.image.ref.name": "gcr.io/project/image:tag" * } * } * ] * } * }</pre> * * @see <a href="https://github.com/opencontainers/image-spec/blob/master/image-index.md">OCI Image * Index Specification</a> */ public class OciIndexTemplate implements JsonTemplate { @SuppressWarnings("unused") private final int schemaVersion = 2; private final List<BuildableManifestTemplate.ContentDescriptorTemplate> manifests = new ArrayList<>(); /** * Adds a manifest reference with the given {@link BlobDescriptor}. * * @param descriptor the manifest blob descriptor * @param imageReferenceName the image reference name */ public void addManifest(BlobDescriptor descriptor, String imageReferenceName) { BuildableManifestTemplate.ContentDescriptorTemplate contentDescriptorTemplate = new BuildableManifestTemplate.ContentDescriptorTemplate( OciManifestTemplate.MANIFEST_MEDIA_TYPE, descriptor.getSize(), descriptor.getDigest()); contentDescriptorTemplate.setAnnotations( ImmutableMap.of("org.opencontainers.image.ref.name", imageReferenceName)); manifests.add(contentDescriptorTemplate); } @VisibleForTesting public List<BuildableManifestTemplate.ContentDescriptorTemplate> getManifests() { return manifests; } }
[ "noreply@github.com" ]
noreply@github.com
4a653d75ba70caf05d0533e85cf53fdf81570374
e79bb1a016ec98f45b797234985e036b6157a2eb
/jasdb_api/src/main/java/com/oberasoftware/jasdb/api/entitymapper/EntityManager.java
5f72446bd51a0d51c19170afa573ba7fc840d2c5
[ "MIT" ]
permissive
oberasoftware/jasdb
a13a3687bcb8fd0af9468778242016640758b04a
15114fc69e53ef57d6f377985a8adc3da5cc90cf
refs/heads/master
2023-06-09T12:21:59.171957
2023-05-23T19:25:22
2023-05-23T19:25:22
33,053,071
33
10
NOASSERTION
2023-04-30T11:54:30
2015-03-28T22:41:15
Java
UTF-8
Java
false
false
2,928
java
package com.oberasoftware.jasdb.api.entitymapper; import com.oberasoftware.jasdb.api.exceptions.JasDBStorageException; import com.oberasoftware.jasdb.api.session.Entity; import com.oberasoftware.jasdb.api.session.query.QueryBuilder; import java.util.List; /** * @author Renze de Vries */ public interface EntityManager { /** * Does a persist which can either be a create or update operation against the database. * * @param persistableObject The object to persist * @return The persisted JasDB object that was stored * @throws JasDBStorageException If unable to store the object */ Entity persist(Object persistableObject) throws JasDBStorageException; /** * Removes the object from storage * @param persistableObject The object to remove from storage * @throws JasDBStorageException If unable to delete the object from storage */ void remove(Object persistableObject) throws JasDBStorageException; /** * Finds an entity by the identifier * @param type The target entity type you are trying to load * @param entityId The identifier of the entity * @param <T> The generic entity type * @return The loaded entity if found, null if not found * @throws JasDBStorageException If unable to load entity from storage or unable to map to target type */ <T> T findEntity(Class<T> type, String entityId) throws JasDBStorageException; /** * * @param type The target entity type you are trying to load * @param builder The query * @param <T> The generic entity type * @return The list of found entities matching the query * @throws JasDBStorageException If unable to load entities from storage or unable to map to target type */ <T> List<T> findEntities(Class<T> type, QueryBuilder builder) throws JasDBStorageException; /** * * @param type The target entity type you are trying to load * @param builder The query * @param limit The maximum amount of entities to load * @param <T> The generic entity type * @return The list of found entities matching the query * @throws JasDBStorageException If unable to load entities from storage or unable to map to target type */ <T> List<T> findEntities(Class<T> type, QueryBuilder builder, int limit) throws JasDBStorageException; /** * * @param type The target entity type you are trying to load * @param builder The query * @param start The starting pagination page * @param limit The maximum amount of entities to load * @param <T> The generic entity type * @return The list of found entities matching the query * @throws JasDBStorageException If unable to load entities from storage or unable to map to target type */ <T> List<T> findEntities(Class<T> type, QueryBuilder builder, int start, int limit) throws JasDBStorageException; }
[ "renze@renarj.nl" ]
renze@renarj.nl
d78ccd59416c539d5a5b8f5f57abb4cc1c7d0b90
bc2673fece20edad95616960c9a18b43e675b13a
/Ex2.java
cab713e6daaabc5861f94d0972593d0f9e3099f4
[]
no_license
MEGHANA221999/Gittraining
24e01706fe02ed9176813f44a6c50fa5fc445c03
055fa5e28db77858940ba0cb1a8f30318c4e82dc
refs/heads/main
2023-01-31T01:57:30.915196
2020-12-15T10:16:12
2020-12-15T10:16:12
319,235,196
0
0
null
null
null
null
UTF-8
Java
false
false
125
java
package junitdemo; public class Ex2 { public int sum(int a , int b) { int sum = a+b; return sum; } }
[ "noreply@github.com" ]
noreply@github.com
cc085da9fba139b1df39ab23c30f84e18389adc6
f9c3b486c32f5cce74e191eba09f8b17c57f2745
/S1Q5/Player.java
a1ad53fa8c66e577f47e8a266f27662e6ead405d
[]
no_license
kjunmin/CollectionsSets
e0390527d2c707b64b87bb572fae1b885e251b04
c12c5919b8aa9e67577f02c0edc473137b3ca358
refs/heads/master
2021-09-23T17:52:38.116997
2018-09-26T03:09:03
2018-09-26T03:09:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
714
java
public class Player { private String name; private String skill; public Player(String name, String skill) { this.name = name; this.skill = skill; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getSkill() { return skill; } public void setSkill(String skill) { this.skill = skill; } @Override public boolean equals(Object obj) { // TODO Auto-generated method stub if (obj != null && getClass() == obj.getClass()) { Player p = (Player) obj; return this.name.equals(p.name); } return false; } @Override public int hashCode() { // TODO Auto-generated method stub return 1; } }
[ "noreply@github.com" ]
noreply@github.com
c1e81448cf31185dac326cd95ae1bf3787e7b71d
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/7/7_5fcecf8997924065ab248adb15a628335a89de26/Postman/7_5fcecf8997924065ab248adb15a628335a89de26_Postman_t.java
bdb062a3ab0cde034c55ae4fd957f6ead6f4f9bc
[]
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
5,975
java
/* * Postman.java * This file is part of Freemail, copyright (C) 2006 Dave Baker * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser 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 freemail; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; import java.util.Random; import java.io.File; import java.io.BufferedReader; import java.io.FileReader; import java.io.PrintStream; import java.io.IOException; import freemail.fcp.ConnectionTerminatedException; import freemail.utils.EmailAddress; /** A postman is any class that delivers mail to an inbox. Simple, * if not politically correct. */ public class Postman { private static final int BOUNDARY_LENGTH = 32; /** * * @throws ConnectionTerminatedException if the Freenet connection was terminated whilst trying to validate the address */ protected void storeMessage(BufferedReader brdr, MessageBank mb) throws IOException, ConnectionTerminatedException { MailMessage newmsg = mb.createMessage(); SimpleDateFormat sdf = new SimpleDateFormat("dd MMM yyyy HH:mm:ss Z", Locale.US); newmsg.readHeaders(brdr); // add our own headers // received and date newmsg.addHeader("Received", "(Freemail); "+sdf.format(new Date())); // validate the from header - or headers. There could be several. String[] froms = newmsg.getHeadersAsArray("From"); int i; boolean first = true; for (i = 0; i < froms.length; i++) { EmailAddress addr = new EmailAddress(froms[i]); if (first) { if (!this.validateFrom(addr)) { newmsg.removeHeader("From", froms[i]); EmailAddress e = new EmailAddress(froms[i]); if (e.realname == null) e.realname = ""; e.realname = "**SPOOFED** "+e.realname; e.realname = e.realname.trim(); newmsg.addHeader("From", e.toLongString()); } } else { newmsg.removeHeader("From", froms[i]); } first = false; } PrintStream ps = newmsg.writeHeadersAndGetStream(); String line; while ( (line = brdr.readLine()) != null) { ps.println(line); } newmsg.commit(); brdr.close(); } public static boolean bounceMessage(File origmsg, MessageBank mb, String errmsg) { return bounceMessage(origmsg, mb, errmsg, false); } public static boolean bounceMessage(File origmsg, MessageBank mb, String errmsg, boolean isFreemailFormat) { MailMessage bmsg = null; try { bmsg = mb.createMessage(); SimpleDateFormat sdf = new SimpleDateFormat("dd MMM yyyy HH:mm:ss Z", Locale.US); bmsg.addHeader("From", "Freemail Postmaster <postmaster@freemail>"); bmsg.addHeader("Subject", "Undeliverable Freemail"); String origFrom = extractFromAddress(origmsg, isFreemailFormat); if (origFrom != null) bmsg.addHeader("To", origFrom); bmsg.addHeader("Date", sdf.format(new Date())); bmsg.addHeader("MIME-Version", "1.0"); String boundary="boundary-"; Random rnd = new Random(); int i; for (i = 0; i < BOUNDARY_LENGTH; i++) { boundary += (char)(rnd.nextInt(25) + (int)'a'); } bmsg.addHeader("Content-Type", "Multipart/Mixed; boundary=\""+boundary+"\""); PrintStream ps = bmsg.writeHeadersAndGetStream(); ps.println("--"+boundary); ps.println("Content-Type: text/plain"); ps.println("Content-Disposition: inline"); ps.println(""); ps.println("Freemail was unable to deliver your message. The problem was:"); ps.println(""); ps.println(errmsg); ps.println(""); ps.println("The original message is included below."); ps.println(""); ps.println("--"+boundary); ps.println("Content-Type: message/rfc822;"); ps.println("Content-Disposition: inline"); ps.println(""); BufferedReader br = new BufferedReader(new FileReader(origmsg)); String line; if (isFreemailFormat) { while ( (line = br.readLine()) != null) { if (line.length() == 0) break; } } while ( (line = br.readLine()) != null) { if (line.indexOf(boundary) > 0) { // The random boundary string appears in the // message! What are the odds!? // try again br.close(); bmsg.cancel(); bounceMessage(origmsg, mb, errmsg); } ps.println(line); } br.close(); ps.println("--"+boundary); bmsg.commit(); } catch (IOException ioe) { if (bmsg != null) bmsg.cancel(); return false; } return true; } private static String extractFromAddress(File msg, boolean isFreemailFormat) { try { BufferedReader br = new BufferedReader(new FileReader(msg)); String line; if (isFreemailFormat) { while ( (line = br.readLine()) != null) { if (line.length() == 0) break; } } while ( (line = br.readLine()) != null) { if (line.length() == 0) return null; String[] parts = line.split(": ", 2); if (parts.length < 2) continue; if (parts[0].equalsIgnoreCase("From")) { br.close(); return parts[1]; } } br.close(); } catch (IOException ioe) { } return null; } public boolean validateFrom(EmailAddress from) throws IOException, ConnectionTerminatedException { // override me! return true; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
5ebd1a98ff6eee7cdc8f522133a695cf8fb4f9d8
a2d16d5396923d67a87b44f12fe8ea6ba0fcf5a6
/src/eu/agileeng/domain/document/AEDocumentsList.java
3cd711b007b4c12158982732d0ee92705ee59534
[]
no_license
AgileEng/MaParoisseServer
f66c9d70d11ab697935bf774e2d9cc04be100566
cf1d6dd93f9f6ef1cba68505e74b50108bd17d73
refs/heads/master
2021-04-06T17:53:11.432789
2019-12-03T10:02:11
2019-12-03T10:02:11
125,376,890
0
0
null
null
null
null
UTF-8
Java
false
false
1,295
java
/** * Agile Engineering Ltd * @author Vesko Vatov * @date 23.05.2010 18:41:48 */ package eu.agileeng.domain.document; import java.util.ArrayList; import java.util.Collection; import org.apache.tomcat.util.json.JSONArray; import org.apache.tomcat.util.json.JSONException; import org.apache.tomcat.util.json.JSONObject; import eu.agileeng.domain.AEList; /** * */ @SuppressWarnings("serial") public class AEDocumentsList extends ArrayList<AEDocument> implements AEList { /** * */ public AEDocumentsList() { } /** * @param arg0 */ public AEDocumentsList(int arg0) { super(arg0); } /** * @param arg0 */ public AEDocumentsList(Collection<? extends AEDocument> arg0) { super(arg0); } @Override public JSONArray toJSONArray() throws JSONException { JSONArray jsonArray = new JSONArray(); if(!this.isEmpty()) { for (AEDocument doc : this) { jsonArray.put(doc.toJSONObject()); } } return jsonArray; } @Override public void create(JSONArray jsonArray) throws JSONException { for (int i = 0; i < jsonArray.length(); i++) { JSONObject jsonDoc = (JSONObject) jsonArray.get(i); AEDocument doc = new AEDocument(); doc.create(jsonDoc); add(doc); } } }
[ "vvatov@agileeng.eu" ]
vvatov@agileeng.eu
a1bd4b91b6245b305b9d9d4a282580c2b47eab47
00f162d38fcc4c030f9952f979dca81ad6362f2e
/MidExam/Retake Mid Exam - 16 April 2019/EasterShopping.java
8ed4e55d7e697093a875faece4dfca0ba314b678
[]
no_license
boyanLakev/JavaFundamentals
c9ae1af1c6fc8bf48c16f72b849162ad4b2a6027
b17f10eca3554ee15f5c4ee4b3fe58c45ae31490
refs/heads/master
2020-05-20T03:48:00.420372
2020-01-10T17:54:42
2020-01-10T17:54:42
185,366,539
0
0
null
null
null
null
UTF-8
Java
false
false
2,157
java
import java.util.Arrays; import java.util.List; import java.util.Scanner; import java.util.stream.Collectors; public class EasterShopping { public static void main(String[] args) { Scanner scanner= new Scanner(System.in); List<String> shops= Arrays.stream(scanner.nextLine().split("\\s+")) .collect(Collectors.toList()); int n=Integer.parseInt(scanner.nextLine()); for (int i = 0; i <n ; i++) { String[] command=scanner.nextLine().split("\\s+"); switch (command[0]){ case "Include": shops.add(command[1]); break; case "Visit": int numberOfShop=Integer.parseInt(command[2]); if (numberOfShop>shops.size()){break;} if (command[1].equals("first")){ for (int j = 0; j <numberOfShop; j++) { shops.remove(0); } }else if(command[1].equals("last")){ for (int j = 0; j < numberOfShop; j++) { shops.remove(shops.size() - 1); } } break; case "Prefer": int indexOne=Integer.parseInt(command[1]); int indexTwo=Integer.parseInt(command[2]); if (indexOne<0 || indexOne>shops.size()-1){break;} if (indexTwo<0 || indexTwo>shops.size()-1){break;} String temp= shops.get(indexOne); shops.set(indexOne,shops.get(indexTwo)); shops.set(indexTwo,temp); break; case "Place": String shop=command[1]; int shopIndex=Integer.parseInt(command[2]); if (shopIndex<0 || shopIndex>shops.size()-1){break;} shops.add(shopIndex+1,shop); break; } } System.out.println("Shops left:"); System.out.println(String.join(" ",shops)); } }
[ "blakev@abv.bg" ]
blakev@abv.bg
8564e511d13673f2d1ba421154e0b07a9a4fbc20
27fa64bf6ad90e8a79adc3cfebfdaca7153d0d86
/Android/DealerManagmentSystem/app/src/main/java/com/dealermanagmentsystem/ui/saleorder/detail/booking/IBookingView.java
6392509d3581e01e61962821ef000daa87e3952f
[]
no_license
Yogi-karate/dms_mobile
08b707acf325d15b96101c1ed9ca8b4c8eeb8c21
01eb8a66efa07bf13a9cc2e0ab73d0e6e1e74547
refs/heads/master
2021-01-07T19:30:59.361431
2019-12-18T13:22:23
2019-12-18T13:22:23
241,798,326
1
0
null
2020-02-20T05:06:29
2020-02-20T05:06:28
null
UTF-8
Java
false
false
431
java
package com.dealermanagmentsystem.ui.saleorder.detail.booking; import com.dealermanagmentsystem.data.model.common.CommonResponse; import com.dealermanagmentsystem.data.model.sobooking.SOBookingResponse; public interface IBookingView { public void onSuccessBookingDetails(SOBookingResponse bookingResponse); public void onSuccessUpdateBookingDetails(CommonResponse message); public void onError(String message); }
[ "nikhviru@gmail.com" ]
nikhviru@gmail.com
9628e3992c0bbdcbe89cf6fca33983644db95eb2
d9f899075a487e1d66ce1ab2fc73fc07a7737605
/src/model/profile/ProfileFactory.java
322a7e539b5eeba78ae20a8aae6bb211a494b7df
[]
no_license
TheSisb/Groupr
8330ec7fff83cc36c698b97ba53f0c72bb68077c
69e4629e53293e194df05ea842fcf3866eef4425
refs/heads/master
2021-01-10T20:07:55.753179
2012-04-10T17:43:15
2012-04-10T17:43:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
690
java
package model.profile; import java.sql.SQLException; import org.dsrg.soenea.domain.MapperException; import org.dsrg.soenea.domain.user.IUser; import org.dsrg.soenea.uow.UoW; public class ProfileFactory { public static Profile createNew(IUser user, String _firstname, String _lastname) throws SQLException, MapperException { Profile profile = new Profile(user.getId(), _firstname, _lastname); UoW.getCurrent().registerNew(profile); return profile; } public static Profile createClean(long id, String firstname, String lastname, long version) { Profile profile = new Profile(id, firstname, lastname, version); UoW.getCurrent().registerClean(profile); return profile; } }
[ "sisb@myopera.com" ]
sisb@myopera.com
e1b78b6219519c010d81adda5d84401c87a477de
d0536669bb37019e766766461032003ad045665b
/jdk1.4.2_src/com/sun/corba/se/internal/ior/TaggedProfileFactoryFinder.java
1405b1771c3a4055898dfb05a8b423c8faa63649
[]
no_license
eagle518/jdk-source-code
c0d60f0762bce0221c7eeb1654aa1a53a3877313
91b771140de051fb843af246ab826dd6ff688fe3
refs/heads/master
2021-01-18T19:51:07.988541
2010-09-09T06:36:02
2010-09-09T06:36:02
38,047,470
11
23
null
null
null
null
UTF-8
Java
false
false
1,475
java
/* * @(#)TaggedProfileFactoryFinder.java 1.13 03/01/23 * * Copyright 2003 Sun Microsystems, Inc. All rights reserved. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */ //Source file: J:/ws/serveractivation/src/share/classes/com.sun.corba.se.internal.ior/TaggedProfileFactoryFinder.java package com.sun.corba.se.internal.ior; import com.sun.corba.se.internal.ior.IdEncapsulationFactoryFinder ; import com.sun.corba.se.internal.ior.IIOPProfile ; import com.sun.corba.se.internal.ior.GenericTaggedProfile ; import org.omg.IOP.TAG_INTERNET_IOP ; import org.omg.CORBA_2_3.portable.InputStream ; /** * @author */ public class TaggedProfileFactoryFinder implements IdEncapsulationFactoryFinder { private TaggedProfileFactoryFinder() { } // initialize-on-demand holder private static class TaggedProfileFactoryFinderHolder { static TaggedProfileFactoryFinder value = new TaggedProfileFactoryFinder() ; } public static TaggedProfileFactoryFinder getFinder() { return TaggedProfileFactoryFinderHolder.value ; } /** Reads the TaggedProfile of type id from is. * @param id * @param is * @return IdEncapsulation * @exception * @author * @roseuid 39135AC6012F */ public IdEncapsulation create(int id, InputStream is) { if (id == TAG_INTERNET_IOP.value) return new IIOPProfile( is ) ; else return new GenericTaggedProfile( id, is ) ; } }
[ "kzhaicn@e8197d6f-d431-fb3f-3203-916d138821fd" ]
kzhaicn@e8197d6f-d431-fb3f-3203-916d138821fd
16f8abe225a4c7fa787a3448ae0e34a642d4b748
b55b394fc06d0dbfe3b424fc217efa56e9c57947
/policeUser-master/policeUser-master/src/main/java/com/cnaidun/user/api/policeUser/common/utils/DateUtils.java
13e4867944d98a7fc50e94c0ae74064e9893cbed
[]
no_license
AmazingYHT/ideaworkspace
fe6a12724642fb5354511b76fdf9883c289bc03c
2de8741b78b27b529296f0c45497c42995a290c7
refs/heads/master
2020-03-27T17:25:06.230176
2018-09-05T06:15:32
2018-09-05T06:15:36
146,850,220
0
0
null
null
null
null
UTF-8
Java
false
false
999
java
package com.cnaidun.user.api.policeUser.common.utils; import java.text.SimpleDateFormat; import java.util.Date; /** * 项目名称:PoliceCloud * 类名称:DateUtils * 类描述:类DateUtils的功能描述: * 日期处理 * 创建人:JackJun * 创建时间:2018/7/25 * 修改人:JackJun * 修改时间:2018/7/25 * 修改备注: * 版权所有权:江苏艾盾网络科技有限公司 * * @version V1.0 */ public class DateUtils { /** 时间格式(yyyy-MM-dd) */ public final static String DATE_PATTERN = "yyyy-MM-dd"; /** 时间格式(yyyy-MM-dd HH:mm:ss) */ public final static String DATE_TIME_PATTERN = "yyyy-MM-dd HH:mm:ss"; public static String format(Date date) { return format(date, DATE_PATTERN); } public static String format(Date date, String pattern) { if(date != null){ SimpleDateFormat df = new SimpleDateFormat(pattern); return df.format(date); } return null; } }
[ "yonghongtao@cnaidun.com" ]
yonghongtao@cnaidun.com
299a15c5e8ba812e95755a0190a06f208159c29c
b0c117d16bb25f09f22a324db35b33c67f782a72
/gen/org/intellij/xquery/psi/XQueryAttributeDeclaration.java
b5d88354cd9611a5fd4da9dac95e56106b752311
[ "Apache-2.0" ]
permissive
malteseduck/intellij-xquery
58affdd151cc103eb81230b010f3f4be5a7355c3
2c835e90f4fd00ee8f93c86532493790b9f2c2e2
refs/heads/master
2021-01-17T23:12:19.214679
2015-04-16T18:22:22
2015-04-16T18:22:22
11,780,679
0
0
null
null
null
null
UTF-8
Java
false
false
995
java
/* * Copyright 2013-2014 Grzegorz Ligas <ligasgr@gmail.com> and other contributors * (see the CONTRIBUTORS file). * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // This is a generated file. Not intended for manual editing. package org.intellij.xquery.psi; import java.util.List; import org.jetbrains.annotations.*; import com.intellij.psi.PsiElement; public interface XQueryAttributeDeclaration extends XQueryPsiElement { @NotNull XQueryAttributeName getAttributeName(); }
[ "ligasgr@gmail.com" ]
ligasgr@gmail.com
b76e061eeabcd4bfac05c871dbed35b80aeb46b2
ea0fdfd66ce904fd98f21a4eee349f83b1825632
/src/erp/server/SServerConstants.java
1ca8d9ccf71f39f1715f8b7a69543f445e81c148
[ "MIT" ]
permissive
swaplicado/siie32
247560d152207228d59d2513107cac229bd391f1
9edd4099d69dd9e060dd64eb4a50cd91cc809c67
refs/heads/master
2023-09-01T15:42:26.706875
2023-07-28T15:41:54
2023-07-28T15:41:54
41,698,005
0
3
null
null
null
null
UTF-8
Java
false
false
1,568
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package erp.server; /** * * @author Sergio Flores */ public abstract class SServerConstants { public static final int REQ_COMP_ITEMS_COMBO_BOX = 1210; public static final int REQ_COMP_ITEMS_LIST = 1220; public static final int REQ_REGS = 1510; public static final int REQ_REPS = 1610; public static final int REQ_CHECK = 1611; public static final int REQ_DB_ACTION_READ = 2110; public static final int REQ_DB_ACTION_SAVE = 2120; public static final int REQ_DB_ACTION_ANNUL = 2130; public static final int REQ_DB_ACTION_DELETE = 2140; public static final int REQ_DB_ACTION_PROCESS = 2150; public static final int REQ_DB_CAN_READ = 2210; public static final int REQ_DB_CAN_SAVE = 2220; public static final int REQ_DB_CAN_ANNUL = 2230; public static final int REQ_DB_CAN_DELETE = 2240; public static final int REQ_DB_QUERY = 2310; public static final int REQ_DB_QUERY_SIMPLE = 2320; public static final int REQ_DB_PROCEDURE = 2410; public static final int REQ_DB_CATALOGUE_DESCRIPTION = 2510; public static final int REQ_OBJ_FIN_ACC_TAX_ID = 3101; public static final int REQ_OBJ_FIN_ACC_BP = 3102; public static final int REQ_OBJ_FIN_ACC_ITEM = 3103; public static final int REQ_CFD = 4110; public static final long TIMEOUT_SESSION = 1000 * 60 * 60 * 12; // 12 hr public static final long TIMEOUT_DATA_REGISTRY = 1000 * 60 * 15; // 15 min }
[ "contacto@swaplicado.com.mx" ]
contacto@swaplicado.com.mx
1b5a99a4d9371fa9380b20ade74c7dc480e00c21
7a53fa5dade0b4a5600f2262aada0dd25311e7c2
/backend/src/main/java/mk/ukim/finki/emtlab/model/exceptions/PasswordsDoNotMatchException.java
bd41da58f2b9c628527519a69b3018220f400ba2
[]
no_license
gjorshoskaivana/ECommerce_Lab
8cc88899cf8ba315317b51ca06f9f0fef34a3765
0fb694f97451d4872071eea2613e7e5ac4dcdaaa
refs/heads/master
2023-05-15T00:28:47.380916
2021-06-04T16:36:47
2021-06-04T16:36:47
357,881,238
0
0
null
null
null
null
UTF-8
Java
false
false
222
java
package mk.ukim.finki.emtlab.model.exceptions; public class PasswordsDoNotMatchException extends RuntimeException{ public PasswordsDoNotMatchException() { super("Passwords do not match exception."); } }
[ "63347774+gjorshoskaivana@users.noreply.github.com" ]
63347774+gjorshoskaivana@users.noreply.github.com
63bb6d5ca94b2946248e1ca39b7c61f3db7008ea
efdfec9cdb2b668c12b4bc9a4c5b6dc381772d37
/src/cn/cloudchain/yboxserver/helper/DataUsageHelper.java
46fde6b55539d114862da439ce68370a6e59136b
[]
no_license
china-east-soft/YboxServer
d97482bc3e696766a7563642e01463598698bfa2
f3d702891b05bee0adba5a54bedf7a00af442c56
refs/heads/master
2021-01-20T15:39:04.551135
2014-03-31T05:41:03
2014-03-31T05:41:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
10,090
java
package cn.cloudchain.yboxserver.helper; import static android.net.NetworkPolicyManager.computeLastCycleBoundary; import static android.net.NetworkPolicyManager.computeNextCycleBoundary; import static android.net.NetworkStatsHistory.FIELD_RX_BYTES; import static android.net.NetworkStatsHistory.FIELD_TX_BYTES; import static android.net.NetworkTemplate.buildTemplateWifiWildcard; import static android.net.NetworkTemplate.buildTemplateMobileAll; import java.util.ArrayList; import java.util.Calendar; import java.util.Collections; import java.util.List; import java.util.Locale; import android.content.Context; import com.mediatek.common.featureoption.FeatureOption; import android.os.ServiceManager; import android.os.SystemProperties; import android.os.RemoteException; import android.telephony.TelephonyManager; import android.provider.Telephony; import android.provider.Telephony.SIMInfo; import android.net.INetworkStatsService; import android.net.INetworkStatsSession; import android.net.NetworkStatsHistory; import android.net.NetworkTemplate; import android.net.NetworkPolicy; import android.net.NetworkPolicyManager; import com.android.settings.net.ChartData; import com.android.settings.net.NetworkPolicyEditor; import android.text.format.DateUtils; import android.util.Log; import android.util.SparseArray; public class DataUsageHelper { private final String TAG = DataUsageHelper.class.getSimpleName(); private Context context; private INetworkStatsService mStatsService; // private INetworkStatsSession mStatsSession; private NetworkPolicyEditor mPolicyEditor; private NetworkPolicyManager mPolicyManager; private static final String TEST_SUBSCRIBER_PROP = "test.subscriberid"; private static final int POLICY_NULL_FLAG = -2; private static final int CYCLE_RANGE_OVER_WEEK = 4; // 流量相关 public static final int KEY_RX_TODAY = 10; public static final int KEY_TX_TODAY = 11; public static final int KEY_RX_TOTAL = 20; public static final int KEY_TX_TOTAL = 21; public static final int KEY_RX_MONTH = 30; public static final int KEY_TX_MONTH = 31; public static final int KEY_LIMIT = 40; public static final int KEY_WARNING = 41; public static final int KEY_SIM_SLOT = 50; public DataUsageHelper(Context context) { this.context = context; mStatsService = INetworkStatsService.Stub.asInterface(ServiceManager .getService(Context.NETWORK_STATS_SERVICE)); refreshPolicy(); } // mTemplate = buildTemplateEthernet() // getLoaderManager().restartLoader(LOADER_CHART_DATA, // ChartDataLoader.buildArgs(mTemplate, mCurrentApp), mChartDataCallbacks); /** * 获取wlan相关信息 * * @return */ public SparseArray<Long> getWifiData() { INetworkStatsSession mStatsSession = null; try { mStatsSession = mStatsService.openSession(); } catch (RemoteException e) { Log.d(TAG, "Remote Exception happens"); } if (mStatsSession == null) return null; ChartData data = new ChartData(); try { data.network = mStatsSession.getHistoryForNetwork( buildTemplateWifiWildcard(), FIELD_RX_BYTES | FIELD_TX_BYTES); } catch (RemoteException e) { Log.d(TAG, "Remote Exception happens"); } long historyStart = data.network.getStart(); long historyEnd = data.network.getEnd(); final long now = System.currentTimeMillis(); Log.d(TAG, "historyStart = " + historyStart + " historyEnd = " + historyEnd + " now = " + now); long cycleEnd = historyEnd; long cycleEndBak = historyEnd; long cycleStart = historyStart; while (cycleEnd > historyStart) { cycleStart = cycleEnd - (DateUtils.WEEK_IN_MILLIS * CYCLE_RANGE_OVER_WEEK); if (cycleStart <= now && now <= cycleEnd) { Log.d(TAG, "cycleStart <= now && now <= cycleEnd"); break; } cycleEndBak = cycleEnd; cycleEnd = cycleStart; } SparseArray<Long> map = new SparseArray<Long>(6); // 获取总流量信息 NetworkStatsHistory.Entry entry = data.network.getValues(cycleStart, cycleEndBak, now, null); map.put(KEY_RX_TOTAL, entry != null ? entry.rxBytes : 0L); map.put(KEY_TX_TOTAL, entry != null ? entry.txBytes : 0L); // 获取当日流量信息 entry = data.network.getValues(getUtcDateMillis(), now, now, null); map.put(KEY_RX_TODAY, entry != null ? entry.rxBytes : 0L); map.put(KEY_TX_TODAY, entry != null ? entry.txBytes : 0L); // 获取当月流量信息 entry = data.network.getValues(getUtcMonthMillis(), now, now, null); map.put(KEY_RX_MONTH, entry != null ? entry.rxBytes : 0L); map.put(KEY_TX_MONTH, entry != null ? entry.txBytes : 0L); return map; } /** * 获取手机流量相关信息 * * @return */ public List<SparseArray<Long>> getMobileData() { List<SIMInfo> mSimList = SIMInfo.getInsertedSIMList(context); if (mSimList == null) return null; INetworkStatsSession mStatsSession = null; try { mStatsSession = mStatsService.openSession(); } catch (RemoteException e) { Log.d(TAG, "Remote Exception happens"); } if (mStatsSession == null) return null; List<SparseArray<Long>> list = new ArrayList<SparseArray<Long>>( mSimList.size()); ChartData data = new ChartData(); NetworkTemplate template; NetworkPolicy policy; for (SIMInfo siminfo : mSimList) { if (FeatureOption.MTK_GEMINI_SUPPORT) { template = buildTemplateMobileAll(getSubscriberId(context, siminfo.mSlot)); } else { template = buildTemplateMobileAll(getActiveSubscriberId(context)); } long mLimitBytes = POLICY_NULL_FLAG; long mWarningBytes = POLICY_NULL_FLAG; try { data.network = mStatsSession.getHistoryForNetwork(template, FIELD_RX_BYTES | FIELD_TX_BYTES); mLimitBytes = mPolicyEditor.getPolicyLimitBytes(template); mWarningBytes = mPolicyEditor.getPolicyWarningBytes(template); } catch (Exception e) { continue; } long historyStart = data.network.getStart(); long historyEnd = data.network.getEnd(); final long now = System.currentTimeMillis(); policy = mPolicyEditor.getPolicy(template); long cycleEnd = historyEnd; long cycleEndBak = historyEnd; long cycleStart = historyStart; if (policy != null) { cycleEnd = computeNextCycleBoundary(historyEnd, policy); while (cycleEnd > historyStart) { cycleStart = computeLastCycleBoundary(cycleEnd, policy); if (cycleStart <= now && now <= cycleEnd) { Log.d(TAG, "cycleStart <= now && now <= cycleEnd"); break; } cycleEndBak = cycleEnd; cycleEnd = cycleStart; } } else { while (cycleEnd > historyStart) { cycleStart = cycleEnd - (DateUtils.WEEK_IN_MILLIS * CYCLE_RANGE_OVER_WEEK); if (cycleStart <= now && now <= cycleEnd) { break; } cycleEndBak = cycleEnd; cycleEnd = cycleStart; } } Log.d(TAG, "cycleEndBak=" + cycleEndBak + "cycleStart=" + cycleStart); SparseArray<Long> map = new SparseArray<Long>(7); // 获取总流量信息 NetworkStatsHistory.Entry entry = data.network.getValues( cycleStart, cycleEndBak, now, null); map.put(KEY_RX_TOTAL, entry != null ? entry.rxBytes : 0L); map.put(KEY_TX_TOTAL, entry != null ? entry.txBytes : 0L); // 获取当日流量信息 entry = data.network.getValues(getUtcDateMillis(), now, now, null); map.put(KEY_RX_TODAY, entry != null ? entry.rxBytes : 0L); map.put(KEY_TX_TODAY, entry != null ? entry.txBytes : 0L); // 获取当月流量信息 entry = data.network.getValues(getUtcMonthMillis(), now, now, null); map.put(KEY_RX_MONTH, entry != null ? entry.rxBytes : 0L); map.put(KEY_TX_MONTH, entry != null ? entry.txBytes : 0L); map.put(KEY_LIMIT, mLimitBytes); map.put(KEY_WARNING, mWarningBytes); map.put(KEY_SIM_SLOT, (long) siminfo.mSlot); list.add(map); } return list; } /** * 设置警告大小 * * @param slot * @param warningBytes * @return */ public boolean setPolicyWarningBytes(int slot, long warningBytes) { NetworkTemplate template = null; if (FeatureOption.MTK_GEMINI_SUPPORT) { template = buildTemplateMobileAll(getSubscriberId(context, slot)); } else { template = buildTemplateMobileAll(getActiveSubscriberId(context)); } if (template == null) { return false; } mPolicyEditor.setPolicyWarningBytes(template, warningBytes); return true; } /** * 刷新PolicyEditor,重新调用read()方法 */ public void refreshPolicy() { if (mPolicyManager == null) { mPolicyManager = NetworkPolicyManager.from(context); } if (mPolicyEditor == null) { mPolicyEditor = new NetworkPolicyEditor(mPolicyManager); } if (mPolicyEditor != null) { mPolicyEditor.read(); } } private String getActiveSubscriberId(Context context) { final TelephonyManager tele = (TelephonyManager) context .getSystemService(Context.TELEPHONY_SERVICE); final String actualSubscriberId = tele.getSubscriberId(); return SystemProperties.get(TEST_SUBSCRIBER_PROP, actualSubscriberId); } private static String getSubscriberId(Context context, int simId) { final TelephonyManager telephony = (TelephonyManager) context .getSystemService(Context.TELEPHONY_SERVICE); return telephony.getSubscriberIdGemini(simId); } /** * 获取当天开始的时间2014-12-32 00:00:00.000 * * @return */ private long getUtcDateMillis() { Calendar calendar = Calendar.getInstance(Locale.getDefault()); calendar.setTimeInMillis(System.currentTimeMillis()); calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0); calendar.set(Calendar.MILLISECOND, 0); return calendar.getTimeInMillis(); } /** * 获取当月开始的时间 2014-12-01 00:00:00.000 * * @return */ private long getUtcMonthMillis() { Calendar calendar = Calendar.getInstance(Locale.getDefault()); calendar.setTimeInMillis(System.currentTimeMillis()); calendar.set(Calendar.DAY_OF_MONTH, 1); calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0); calendar.set(Calendar.MILLISECOND, 0); return calendar.getTimeInMillis(); } }
[ "lazzy.nan@gmail.com" ]
lazzy.nan@gmail.com
7584c00cf72d0e4cad526912d3abbb39d3df827a
95e155131022f449b6252d07404671c59036c446
/Menu/DecimalBinario.java
609d928610946bc26c37694dba7b254d71ae2c12
[]
no_license
RomeroTovarAdrian/3IV9-RomeroTovarAdrian
a58dd4237453c2b5037ce80c982111d11a1ad14f
7ae16aadb8dcff0df99f8b70f21ce2d1163efe43
refs/heads/master
2023-02-01T05:40:26.916872
2020-12-19T08:59:58
2020-12-19T08:59:58
314,145,294
0
0
null
null
null
null
UTF-8
Java
false
false
969
java
import java.util.Scanner; class DecimalBinario{ public static void main(String[] args) { int numero, exp, digito, estado; double binario; Scanner entrada = new Scanner(System.in); do{ System.out.println("1 Entrar al convertidor de decimal a binario"); System.out.println("0 Salir al menu"); estado = entrada.nextInt(); if(estado==1){ do{ System.out.print("Introduce un numero entero mayor o igual a 0: "); numero = entrada.nextInt(); }while(numero < 0); exp=0; binario=0; while(numero!=0){ digito = numero % 2; binario = binario + digito * Math.pow(10, exp); exp++; numero = numero/2; } System.out.printf("Binario: %.0f %n", binario); } }while(estado!=0); } }
[ "aromerot1900@alumno.ipn.mx" ]
aromerot1900@alumno.ipn.mx
dc41642ff686dc63e5e6c393c7661c1e95396a35
82683e7cadbe088109fe9a1f889e5817cef678c8
/uhdb-server/src/main/java/com/realsnake/sample/config/SchedulerConfig.java
f0e4d487d09b36679a2154eb3e1aaf610f973b63
[]
no_license
falhed7418/uhdb-repos
4f1da00b1117e49b4ae2d46c26b1fb6a0d43e7e2
5cba8c7de70888899ea9a0e9c4d517234d5d49e5
refs/heads/master
2021-09-04T20:08:47.922661
2018-01-22T02:38:13
2018-01-22T02:38:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,576
java
/** * Copyright (c) 2016 realsnake1975@gmail.com * * 2016. 10. 25. */ package com.realsnake.sample.config; import java.util.concurrent.Executor; import java.util.concurrent.ThreadPoolExecutor; import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler; import org.springframework.aop.interceptor.SimpleAsyncUncaughtExceptionHandler; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.scheduling.TaskScheduler; import org.springframework.scheduling.annotation.AsyncConfigurer; import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.SchedulingConfigurer; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; import org.springframework.scheduling.config.ScheduledTaskRegistrar; /** * <pre> * Class Name : SchedulerConfig.java * Description : 스케줄러 및 비동기 설정 * * Modification Information * * Mod Date Modifier Description * ----------- -------- --------------------------- * 2016. 11. 8. 전강욱 Generation * </pre> * * @author 전강욱 * @since 2016. 11. 8. * @version 1.0 */ @Configuration @EnableScheduling @EnableAsync public class SchedulerConfig implements SchedulingConfigurer, AsyncConfigurer { @Bean(destroyMethod = "shutdown") public TaskScheduler taskScheduler() { ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler(); scheduler.setPoolSize(200); return scheduler; } @Bean(destroyMethod = "shutdown") public Executor executor() { ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); executor.setCorePoolSize(100); executor.setMaxPoolSize(200); executor.setQueueCapacity(400); executor.setRejectedExecutionHandler(new ThreadPoolExecutor.AbortPolicy()); return executor; } @Override public Executor getAsyncExecutor() { return this.executor(); } @Override public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() { return new SimpleAsyncUncaughtExceptionHandler(); } @Override public void configureTasks(ScheduledTaskRegistrar taskRegistrar) { taskRegistrar.setScheduler(this.taskScheduler()); } }
[ "jcsyscon@naver.com" ]
jcsyscon@naver.com
b55ab35da40cd398c1af0b9039e805f4ad0be16c
b79286be8256771b0dfee5d0ad967a4c8807375f
/src/com/mc/vending/data/VendingData.java
4e4d24cc976a87826051092286c67894c1ec12b5
[]
no_license
github188/vending-zkh
e125a9b9ca2f0b1adda27542a770e1dd480a8465
0456cfaf7a6e7b5f2baba21d0d0d619717fbe738
refs/heads/master
2021-05-06T06:38:38.388856
2016-01-21T05:10:11
2016-01-21T05:10:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
9,959
java
package com.mc.vending.data; import java.io.Serializable; /** * <p> * Table: <strong>Vending 售货机</strong> * <p> * <table class="er-mapping" cellspacing=0 cellpadding=0 style="border:solid 1 #666;padding:3px;"> * <tr style="background-color:#ddd;Text-align:Left;"> * <th nowrap>属性名</th> * <th nowrap>属性类型</th> * <th nowrap>字段名</th> * <th nowrap>字段类型</th> * <th nowrap>说明</th> * </tr> * <tr> * <td>vd1Id</td> * <td>{@link String}</td> * <td>vd1_id</td> * <td>varchar</td> * <td>售货机ID</td> * </tr> * <tr> * <td>vd1M02Id</td> * <td>{@link String}</td> * <td>vd1_m02_id</td> * <td>varchar</td> * <td>事业体ID</td> * </tr> * <tr> * <td>vd1Code</td> * <td>{@link String}</td> * <td>vd1_code</td> * <td>varchar</td> * <td>售货机编号</td> * </tr> * <tr> * <td>vd1Manufacturer</td> * <td>{@link String}</td> * <td>vd1_manufacturer</td> * <td>varchar</td> * <td>制造商</td> * </tr> * <tr> * <td>vd1Vm1Id</td> * <td>{@link String}</td> * <td>vd1_vm1_id</td> * <td>varchar</td> * <td>售货机型号ID</td> * </tr> * <tr> * <td>vd1LastVersion</td> * <td>{@link String}</td> * <td>vd1_lastVersion</td> * <td>varchar</td> * <td>最新版本号</td> * </tr> * <tr> * <td>vd1LwhSize</td> * <td>{@link String}</td> * <td>vd1_lwhSize</td> * <td>varchar</td> * <td>尺寸长宽高</td> * </tr> * <tr> * <td>vd1Color</td> * <td>{@link String}</td> * <td>vd1_color</td> * <td>varchar</td> * <td>颜色</td> * </tr> * <tr> * <td>vd1InstallAddress</td> * <td>{@link String}</td> * <td>vd1_installAddress</td> * <td>varchar</td> * <td>安装地址</td> * </tr> * <tr> * <td>vd1Coordinate</td> * <td>{@link String}</td> * <td>vd1_coordinate</td> * <td>varchar</td> * <td>地图经纬度</td> * </tr> * <tr> * <td>vd1St1Id</td> * <td>{@link String}</td> * <td>vd1_st1_id</td> * <td>varchar</td> * <td>站点ID</td> * </tr> * <tr> * <td>vd1EmergencyRel</td> * <td>{@link String}</td> * <td>vd1_emergencyRel</td> * <td>varchar</td> * <td>紧急联系人</td> * </tr> * <tr> * <td>vd1EmergencyRelPhone</td> * <td>{@link String}</td> * <td>vd1_emergencyRelPhone</td> * <td>varchar</td> * <td>紧急联系人电话</td> * </tr> * <tr> * <td>vd1OnlineStatus</td> * <td>{@link String}</td> * <td>vd1_onlineStatus</td> * <td>varchar</td> * <td>联机状态:联机、未联机(未联机时超过次数发手机短信给紧急联系人)</td> * </tr> * <tr> * <td>vd1Status</td> * <td>{@link String}</td> * <td>vd1_status</td> * <td>varchar</td> * <td>状态:可用、不可用、删除</td> * </tr> * <tr> * <td>vd1CreateUser</td> * <td>{@link String}</td> * <td>vd1_createUser</td> * <td>varchar</td> * <td>创建人</td> * </tr> * <tr> * <td>vd1CreateTime</td> * <td>{@link String}</td> * <td>vd1_createTime</td> * <td>varchar</td> * <td>创建时间</td> * </tr> * <tr> * <td>vd1ModifyUser</td> * <td>{@link String}</td> * <td>vd1_modifyUser</td> * <td>varchar</td> * <td>最后修改人</td> * </tr> * <tr> * <td>vd1ModifyTime</td> * <td>{@link String}</td> * <td>vd1_modifyTime</td> * <td>varchar</td> * <td>最后修改时间</td> * </tr> * <tr> * <td>vd1RowVersion</td> * <td>{@link String}</td> * <td>vd1_rowVersion</td> * <td>varchar</td> * <td>时间戳</td> * </tr> * </table> * * @author fenghu * @date 2015-3-16 * @email fenghu@mightcloud.com */ public class VendingData extends BaseParseData implements Serializable { /** * Comment for <code>serialVersionUID</code> */ private static final long serialVersionUID = -6990282001803903087L; // 定义特殊字符串 public static final String VENDING_TELE_400 = "4006809696"; // 400电话 // 定义联机状态 public static final String VENDING_ONLINESTATUS_ON = "0"; // 联机 public static final String VENDING_ONLINESTATUS_OFF = "1"; // 未联机(未联机时超过次数发手机短信给紧急联系人) // 定义售货机状态 public static final String VENDING_STATUS_YES = "0"; // 可用 public static final String VENDING_STATUS_NO = "1"; // 不可用 public static final String VENDING_STATUS_DELETE = "2"; // 删除 private String vd1Id; public String getVd1Id() { return this.vd1Id; } public void setVd1Id(String value) { this.vd1Id = value; } private String vd1M02Id; public String getVd1M02Id() { return this.vd1M02Id; } public void setVd1M02Id(String value) { this.vd1M02Id = value; } private String vd1Code; public String getVd1Code() { return this.vd1Code; } public void setVd1Code(String value) { this.vd1Code = value; } private String vd1Manufacturer; public String getVd1Manufacturer() { return this.vd1Manufacturer; } public void setVd1Manufacturer(String value) { this.vd1Manufacturer = value; } private String vd1Vm1Id; public String getVd1Vm1Id() { return this.vd1Vm1Id; } public void setVd1Vm1Id(String value) { this.vd1Vm1Id = value; } private String vd1LastVersion; public String getVd1LastVersion() { return this.vd1LastVersion; } public void setVd1LastVersion(String value) { this.vd1LastVersion = value; } private String vd1LwhSize; public String getVd1LwhSize() { return this.vd1LwhSize; } public void setVd1LwhSize(String value) { this.vd1LwhSize = value; } private String vd1Color; public String getVd1Color() { return this.vd1Color; } public void setVd1Color(String value) { this.vd1Color = value; } private String vd1InstallAddress; public String getVd1InstallAddress() { return this.vd1InstallAddress; } public void setVd1InstallAddress(String value) { this.vd1InstallAddress = value; } private String vd1Coordinate; public String getVd1Coordinate() { return this.vd1Coordinate; } public void setVd1Coordinate(String value) { this.vd1Coordinate = value; } private String vd1St1Id; public String getVd1St1Id() { return this.vd1St1Id; } public void setVd1St1Id(String value) { this.vd1St1Id = value; } private String vd1EmergencyRel; public String getVd1EmergencyRel() { return this.vd1EmergencyRel; } public void setVd1EmergencyRel(String value) { this.vd1EmergencyRel = value; } private String vd1EmergencyRelPhone; public String getVd1EmergencyRelPhone() { return this.vd1EmergencyRelPhone; } public void setVd1EmergencyRelPhone(String value) { this.vd1EmergencyRelPhone = value; } private String vd1OnlineStatus; public String getVd1OnlineStatus() { return this.vd1OnlineStatus; } public void setVd1OnlineStatus(String value) { this.vd1OnlineStatus = value; } private String vd1Status; public String getVd1Status() { return this.vd1Status; } public void setVd1Status(String value) { this.vd1Status = value; } private String vd1CreateUser; public String getVd1CreateUser() { return this.vd1CreateUser; } public void setVd1CreateUser(String value) { this.vd1CreateUser = value; } private String vd1CreateTime; public String getVd1CreateTime() { return this.vd1CreateTime; } public void setVd1CreateTime(String value) { this.vd1CreateTime = value; } private String vd1ModifyUser; public String getVd1ModifyUser() { return this.vd1ModifyUser; } public void setVd1ModifyUser(String value) { this.vd1ModifyUser = value; } private String vd1ModifyTime; public String getVd1ModifyTime() { return this.vd1ModifyTime; } public void setVd1ModifyTime(String value) { this.vd1ModifyTime = value; } private String vd1RowVersion; public String getVd1RowVersion() { return this.vd1RowVersion; } public void setVd1RowVersion(String value) { this.vd1RowVersion = value; } private String vd1CardType; public String getVd1CardType() { return vd1CardType; } public void setVd1CardType(String vd1CardType) { this.vd1CardType = vd1CardType; } @Override public String toString() { return "VendingData [vd1Id=" + vd1Id + ", vd1M02Id=" + vd1M02Id + ", vd1Code=" + vd1Code + ", vd1Manufacturer=" + vd1Manufacturer + ", vd1Vm1Id=" + vd1Vm1Id + ", vd1LastVersion=" + vd1LastVersion + ", vd1LwhSize=" + vd1LwhSize + ", vd1Color=" + vd1Color + ", vd1InstallAddress=" + vd1InstallAddress + ", vd1Coordinate=" + vd1Coordinate + ", vd1St1Id=" + vd1St1Id + ", vd1EmergencyRel=" + vd1EmergencyRel + ", vd1EmergencyRelPhone=" + vd1EmergencyRelPhone + ", vd1OnlineStatus=" + vd1OnlineStatus + ", vd1Status=" + vd1Status + ", vd1CreateUser=" + vd1CreateUser + ", vd1CreateTime=" + vd1CreateTime + ", vd1ModifyUser=" + vd1ModifyUser + ", vd1ModifyTime=" + vd1ModifyTime + ", vd1RowVersion=" + vd1RowVersion + ", vd1CardType=" + vd1CardType + "]"; } }
[ "119639270@qq.com" ]
119639270@qq.com
bdc103fd04733782e82ffcbf0df3aa1340be9e43
80dbb31887d1e9bdfd67ee0753ecf717492ee47e
/app/src/test/java/quangnv4/com/myapplication/CountriesTestProvider.java
cef602996dbdda67dd1f6aaafcc9be00428b0d9b
[]
no_license
quanghero100/RxJava
d69f42841d9ea9adff3e1dfe981be6e2f1f5a8c0
caab621fbe1378eff360a1c3628b1a00d53b78ac
refs/heads/master
2020-03-19T11:37:49.624925
2018-06-08T02:33:51
2018-06-08T02:33:51
136,465,278
0
0
null
null
null
null
UTF-8
Java
false
false
2,147
java
package quangnv4.com.myapplication; import java.util.ArrayList; import java.util.List; final class CountriesTestProvider { static final String CURRENCY_EUR = "EUR"; static final String CURRENCY_PLN = "PLN"; static final String CURRENCY_GBP = "GBP"; static final String CURRENCY_UAH = "UAH"; static final String CURRENCY_CHF = "CHF"; private static ArrayList<Country> countries = new ArrayList<>(); static { countries.add(new Country("Germany", CURRENCY_EUR, 80620000)); countries.add(new Country("France", CURRENCY_EUR, 66030000)); countries.add(new Country("United Kingdom", CURRENCY_GBP, 64100000)); countries.add(new Country("Poland", CURRENCY_PLN, 38530000)); countries.add(new Country("Ukraine", CURRENCY_UAH, 45490000)); countries.add(new Country("Austria", CURRENCY_EUR, 8474000)); countries.add(new Country("Switzerland", CURRENCY_CHF, 8081000)); countries.add(new Country("Luxembourg", CURRENCY_EUR, 576249)); } private CountriesTestProvider() { // hidden } static List<Country> countries() { return new ArrayList<>(countries); } static List<Country> countriesPopulationMoreThanOneMillion() { List<Country> result = new ArrayList<>(); for (Country country : countries) { if (country.population > 1000000) { result.add(country); } } return result; } static List<Long> populationOfCountries() { List<Long> result = new ArrayList<>(countries.size()); for (Country country : countries) { result.add(country.population); } return result; } static List<String> namesOfCountries() { List<String> result = new ArrayList<>(countries.size()); for (Country country : countries) { result.add(country.name); } return result; } static Long sumPopulationOfAllCountries() { Long result = 0L; for (Country country : countries) { result += country.population; } return result; } }
[ "quanghero100@gmail.com" ]
quanghero100@gmail.com
d1eef87c37319459b4e067d95eabff22318a0f1c
7d4df1c70dc2a73224c4bed17af619141d746b7d
/app/src/main/java/br/com/lucena/recyclerview/service/GitPullService.java
38b51c1fc0f96ef4b492bc8a89cb546fbd866f10
[]
no_license
WevertonLucena/RecyclerView
728bf74a820d633b3019bfc121fe9fb64a040d67
d4d73d38f81e1bbb5ed48f87f5760e69ccb74929
refs/heads/master
2020-03-27T02:06:22.169619
2018-08-22T22:32:45
2018-08-22T22:32:45
145,653,060
0
0
null
null
null
null
UTF-8
Java
false
false
1,245
java
package br.com.lucena.recyclerview.service; import android.util.Log; import java.util.List; import br.com.lucena.recyclerview.domain.Pull; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; public class GitPullService extends GitService { private List<Pull> pullList; private LoadPullsListener listener; public void buscaPulls(String autor, String repositorio){ GitApi gitApi = retrofit.create(GitApi.class); Call<List<Pull>> pulls = gitApi.listPulls(autor,repositorio); pulls.enqueue(new Callback<List<Pull>>() { @Override public void onResponse(Call<List<Pull>> call, Response<List<Pull>> response) { if (response.isSuccessful()){ pullList = response.body(); listener.onLoad(pullList); } } @Override public void onFailure(Call<List<Pull>> call, Throwable t) { Log.e("App", "Erro: " + t.getMessage() ); } }); } public void setListener(LoadPullsListener listener) { this.listener = listener; } public interface LoadPullsListener{ void onLoad(List<Pull> pullList); } }
[ "wtonlucena@gmail.com" ]
wtonlucena@gmail.com
786e8aae5bc20d14642de3dffaab410ae58db933
0651823c31f03ce0fefb63291fa6a453bb3dc187
/src/main/java/com/study/spring/framework/aop/intercept/MyMethodInvocation.java
543259311422ae6e88c7225bcbb9832366f6d7ee
[]
no_license
zhuzhudan/my-spring
e541e71f32f1c697482f11d3823565b2637efa5a
e36386a36c413d65b4d55d708aa648440994666b
refs/heads/master
2020-05-16T15:37:47.466600
2019-05-08T07:54:56
2019-05-08T07:54:56
183,138,699
0
0
null
null
null
null
UTF-8
Java
false
false
2,916
java
package com.study.spring.framework.aop.intercept; import com.study.spring.framework.aop.aspect.MyJoinPoint; import org.omg.PortableInterceptor.Interceptor; import java.lang.reflect.Method; import java.util.HashMap; import java.util.List; import java.util.Map; public class MyMethodInvocation implements MyJoinPoint { private Object proxy; private Method method; private Object target; private Object[] arguments; private List<Object> interceptorsAndDynamicMethodMatchers; private Class<?> targetClass; // 定义一个索引,从-1开始来记录当前拦截器执行的位置 private int currentInterceptorIndex = -1; private Map<String, Object> userAttributes; public MyMethodInvocation(Object proxy, Object target, Method method, Object[] arguments, Class<?> targetClass, List<Object> interceptorAndDynamicMethodMatchers){ this.proxy = proxy; this.target = target; this.method = method; this.arguments = arguments; this.targetClass = targetClass; this.interceptorsAndDynamicMethodMatchers = interceptorAndDynamicMethodMatchers; } // 入口方法,真正执行拦截器链中每个方法 public Object proceed() throws Throwable{ // 如果Interceptor执行完了,或者没有,则执行joinPoint if(this.currentInterceptorIndex == this.interceptorsAndDynamicMethodMatchers.size() - 1){ return this.method.invoke(this.target, this.arguments); } Object interceptorOrInterceptionAdvice = this.interceptorsAndDynamicMethodMatchers.get(++this.currentInterceptorIndex); // 如果要动态匹配joinPoint if(interceptorOrInterceptionAdvice instanceof MyMethodInterceptor){ MyMethodInterceptor interceptor = (MyMethodInterceptor) interceptorOrInterceptionAdvice; return interceptor.invoke(this); } else { // 动态匹配失败时,略过当前Interceptor,调用下一个Interceptor return proceed(); } } @Override public Object getThis() { return this.target; } @Override public Object[] getArguments() { return this.arguments; } @Override public Method getMethod() { return this.method; } @Override public void setUserAttribute(String key, Object value) { if(value != null){ if(this.userAttributes == null){ this.userAttributes = new HashMap<>(); } this.userAttributes.put(key, value); } else { if(this.userAttributes != null){ this.userAttributes.remove(key); } } } @Override public Object getUserAttribute(String key) { return (this.userAttributes != null ? this.userAttributes.get(key) : null); } }
[ "dan.zhu@aliyun.com" ]
dan.zhu@aliyun.com
79e0cf2b9fcdc2a8a491b9dd5f7f290838f16279
61e4d9565f7409042a16d2b49a08d67d37f560b9
/src/main/java/kush/linesorter/IOEnum.java
597275d516d6472f595f1363bd5c00844bcc7acf
[]
no_license
KUSH42/LineSorter
9163fc36d403c33dc2d9cde2fa90825b9a336862
28ec3b0d59fa38c956bb879b27d9c76ba56a8b73
refs/heads/master
2020-03-23T04:12:29.427471
2018-08-25T11:23:15
2018-08-25T12:11:13
141,070,085
0
0
null
2018-08-23T19:54:04
2018-07-16T01:02:58
Java
UTF-8
Java
false
false
65
java
package kush.linesorter; public enum IOEnum { INPUT, OUTPUT; }
[ "KUSH42@users.noreply.github.com" ]
KUSH42@users.noreply.github.com
c053ab83e60517d5b025b6d37b02ebdbb6c62d27
7398714c498444374047497fe2e9c9ad51239034
/bo/app/w.java
0fdf3b3c96c366fd8074b25c34e09b2b21bc5af4
[]
no_license
CheatBoss/InnerCore-horizon-sources
b3609694df499ccac5f133d64be03962f9f767ef
84b72431e7cb702b7d929c61c340a8db07d6ece1
refs/heads/main
2023-04-07T07:30:19.725432
2021-04-10T01:23:04
2021-04-10T01:23:04
356,437,521
1
0
null
null
null
null
UTF-8
Java
false
false
1,569
java
package bo.app; import com.appboy.models.*; import java.util.*; public enum w implements IPutIntoJson<String> { A("se"), B("tt"), C("pd"), D("lcaa"), E("lcar"); private static final Map<String, w> G; a("lr"), b("ce"), c("p"), d("cic"), e("pc"), f("ca"), g("i"), h("ie"), i("ci"), j("cc"), k("g"), l("ccc"), m("cci"), n("ccic"), o("ccd"), p("inc"), q("add"), r("rem"), s("set"), t("si"), u("iec"), v("sc"), w("sbc"), x("sfe"), y("uae"), z("ss"); private final String F; static { int n2 = 0; final HashMap<String, w> hashMap = new HashMap<String, w>(); for (w[] values = values(); n2 < values.length; ++n2) { final w w2 = values[n2]; hashMap.put(w2.F, w2); } G = new HashMap<String, w>(hashMap); } private w(final String f) { this.F = f; } public static w a(final String s) { if (w.G.containsKey(s)) { return w.G.get(s); } final StringBuilder sb = new StringBuilder(); sb.append("Unknown String Value: "); sb.append(s); throw new IllegalArgumentException(sb.toString()); } public static boolean a(final w w) { return b(w) || w.equals(w.f) || w.equals(w.d); } public static boolean b(final w w) { return w.equals(w.e); } public String a() { return this.F; } }
[ "cheat.boss1@gmail.com" ]
cheat.boss1@gmail.com
b26a80aef1bc4d105da5c4f66895558498ceea2c
b221da3d9db1b773622ea5cf4da3037ac0f61ea3
/src/main/java/com/manage/demo/server/Imp/CommodityHomeImp.java
cc54cb17bfcca9de6a8a3c8fc191a3c221e4f78a
[]
no_license
GCRoots/manage-1
b10852cd17a44eb9c8a10e06d7509cf76ffd3250
7230e910fa465e66fb5ec308cbd906cac189820d
refs/heads/master
2020-04-29T10:11:09.216003
2019-04-21T05:36:28
2019-04-21T05:36:28
176,052,521
0
0
null
null
null
null
UTF-8
Java
false
false
1,286
java
package com.manage.demo.server.Imp; import com.manage.demo.dao.mapper.CommodityHomeDao; import com.manage.demo.server.CommodityHomeServer; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; @Service(value = "CommodityHomeServer") public class CommodityHomeImp implements CommodityHomeServer{ @Autowired private CommodityHomeDao commodityHomeDao; @Override public int getUs() { return commodityHomeDao.getUs(); } @Override public int getBr(){ return commodityHomeDao.getBr(); } @Override public int getWa(){ return commodityHomeDao.getWa(); } @Override public int getSs(){ return commodityHomeDao.getSs(); } @Override public int getTo(String date){ return commodityHomeDao.getTo(date); } @Override public int getYe(String date){ return commodityHomeDao.getYe(date); } @Override public int getTs(String date){ return commodityHomeDao.getTs(date); } @Override public int getYs(String date){ return commodityHomeDao.getYs(date); } @Override public List<String> getSe(){ return commodityHomeDao.getSe(); } }
[ "1007879951@qq.com" ]
1007879951@qq.com
c38fb4bb8036b827c6dc51fcc864e903c7ae4083
1a982e9fce80f9fab8b2739afd314657ea08a026
/src/main/java/com/zoom/cce/service/dto/ResponseWrapper.java
03816f0515fc3cd7e212682874f96926392fcb54
[]
no_license
pawanmandhan/DUMB-Bank
c0ba1c312cedfcf8a3d4d5a1b49368d02362dd9b
2c8eae5a4619b2ed2838bd9ad8aa10390ce234a3
refs/heads/master
2022-12-22T20:32:20.296650
2017-06-15T19:22:25
2017-06-15T19:22:25
94,454,998
0
1
null
2020-09-18T13:30:19
2017-06-15T15:47:44
Java
UTF-8
Java
false
false
1,497
java
package com.zoom.cce.service.dto; /** * @author shweta Class made to have a standard response. * * @param */ public class ResponseWrapper { boolean success; String responseCode; Object data; String responseMessage; public ResponseWrapper() { super(); // TODO Auto-generated constructor stub } public ResponseWrapper(boolean success, String responseCode, String responseMessage) { super(); this.success = success; this.responseCode = responseCode; this.responseMessage = responseMessage; } public ResponseWrapper(boolean success, String responseCode, Object data) { super(); this.success = success; this.responseCode = responseCode; this.data = data; } public ResponseWrapper(boolean success, String responseCode, Object data, String responseMessage) { super(); this.success = success; this.responseCode = responseCode; this.data = data; this.responseMessage = responseMessage; } public Object getData() { return data; } public boolean isSuccess() { return success; } public void setSuccess(boolean success) { this.success = success; } public String getResponseCode() { return responseCode; } public void setResponseCode(String responseCode) { this.responseCode = responseCode; } public void setData(Object data) { this.data = data; } public String getResponseMessage() { return responseMessage; } public void setResponseMessage(String responseMessage) { this.responseMessage = responseMessage; } }
[ "pmandhan@vfirstt.com" ]
pmandhan@vfirstt.com
651bd2732c65d7879099575ff9f10092498c2e18
f2c95d8dd799c6fe9b6dee10f98c039f9b2b4986
/app/src/main/java/pe/ebenites/alldemo/util/Constants.java
4605178da136a42329cc3b7cfc30a968f72ccc84
[]
no_license
ebenites/AlldemoApp
b7cc5bcd424352e5f1e17b5cfcc2537a63979476
59699a83d17f23ff7816201f4352138b487086b9
refs/heads/master
2020-07-31T15:19:47.550558
2019-09-24T16:42:59
2019-09-24T16:42:59
210,651,557
0
0
null
null
null
null
UTF-8
Java
false
false
1,034
java
package pe.ebenites.alldemo.util; public class Constants { /* Roles */ public static final Integer ROLE_STUDENT = 3; public static final Integer ROLE_TEACHER = 2; /* Pages */ public static final String PAGE_TYPE_THEORY = "T"; public static final String PAGE_TYPE_PRACTICE = "P"; public static final String PAGE_TYPE_REFORCE = "R"; /* Preferences */ public static final String PREF_ISLOGGED = "islogged"; public static final String PREF_USER_ID = "id"; public static final String PREF_ROLE_ID = "role_id"; public static final String PREF_USER_EMAIL = "email"; public static final String PREF_USER_PHONENUMBER = "phonenumber"; public static final String PREF_USER_NAME = "fullname"; public static final String PREF_USER_ISNEW = "new"; public static final String PREF_TOKEN = "token"; public static final String PREF_ISNOT_FIRSTTIME = "isfirsttime"; public static final String PREF_TOKEN_GCM = "token-gcm"; }
[ "erick.benites@gmail.com" ]
erick.benites@gmail.com
4c87b48038ae82a91ebc8f01fd3cfdc42bd135f2
a45975c9cb42b68951ae03de46e33bf2bf62c545
/src/main/java/net/twodam/mimosa/exceptions/MimosaIllegalExprException.java
f76712c267f88d6e48bf17c20c0ec97e7a14a74d
[]
no_license
LuckyKoala/Mimosa
50c6c7dc796d88b6a8d384907c99dceb4707c822
d40b2be94d42cea7ebe983a65290ba17cd07c8d2
refs/heads/master
2020-05-05T07:45:11.050802
2019-05-11T02:41:59
2019-05-11T02:42:16
179,836,882
0
0
null
null
null
null
UTF-8
Java
false
false
1,160
java
package net.twodam.mimosa.exceptions; import net.twodam.mimosa.types.MimosaPair; public class MimosaIllegalExprException extends MimosaException { private static final String NON_SYMBOL_IN_LET_TEMPLATE = "Found non-symbol in let/lambda %s"; private static final String PARAMETERS_IN_LAMBDA_IS_NOT_A_PAIR_TEMPLATE = "Parameters in %s is not a pair"; private static final String NON_PAIR_IN_APPLICATION_EXPR_TEMPLATE = "Found non-pair in application expr %s"; private MimosaIllegalExprException(String message) { super(message); } public static MimosaIllegalExprException nonSymbolInLet(MimosaPair pair) { return new MimosaIllegalExprException(String.format(NON_SYMBOL_IN_LET_TEMPLATE, pair)); } public static MimosaIllegalExprException parametersInLambdaIsNotAPair(MimosaPair pair) { return new MimosaIllegalExprException(String.format(PARAMETERS_IN_LAMBDA_IS_NOT_A_PAIR_TEMPLATE, pair)); } public static MimosaIllegalExprException nonPairInApplicationExpr(MimosaPair pair) { return new MimosaIllegalExprException(String.format(NON_PAIR_IN_APPLICATION_EXPR_TEMPLATE, pair)); } }
[ "pilotcraft.lk@gmail.com" ]
pilotcraft.lk@gmail.com
980ec40fcfef0272b4fc5523d73115739b840c19
774b50fe5091754f23ef556c07a4d1aab56efe27
/oag/src/main/java/org/oagis/model/v101/CancelAcknowledgeCommercialInvoiceDataAreaType.java
51392689735b5eeecb686b7fae4a83f03002bd86
[]
no_license
otw1248/thirdpartiess
daa297c2f44adb1ffb6530f88eceab6b7f37b109
4cbc4501443d807121656e47014d70277ff30abc
refs/heads/master
2022-12-07T17:10:17.320160
2022-11-28T10:56:19
2022-11-28T10:56:19
33,661,485
0
0
null
null
null
null
UTF-8
Java
false
false
3,313
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2015.04.09 at 03:57:57 PM CST // package org.oagis.model.v101; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for CancelAcknowledgeCommercialInvoiceDataAreaType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="CancelAcknowledgeCommercialInvoiceDataAreaType"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="CancelAcknowledge" type="{http://www.openapplications.org/oagis/10}AcknowledgeType"/> * &lt;element name="CommercialInvoice" type="{http://www.openapplications.org/oagis/10}CommercialInvoiceType" maxOccurs="unbounded"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "CancelAcknowledgeCommercialInvoiceDataAreaType", propOrder = { "cancelAcknowledge", "commercialInvoice" }) public class CancelAcknowledgeCommercialInvoiceDataAreaType { @XmlElement(name = "CancelAcknowledge", required = true) protected AcknowledgeType cancelAcknowledge; @XmlElement(name = "CommercialInvoice", required = true) protected List<CommercialInvoiceType> commercialInvoice; /** * Gets the value of the cancelAcknowledge property. * * @return * possible object is * {@link AcknowledgeType } * */ public AcknowledgeType getCancelAcknowledge() { return cancelAcknowledge; } /** * Sets the value of the cancelAcknowledge property. * * @param value * allowed object is * {@link AcknowledgeType } * */ public void setCancelAcknowledge(AcknowledgeType value) { this.cancelAcknowledge = value; } /** * Gets the value of the commercialInvoice property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the commercialInvoice property. * * <p> * For example, to add a new item, do as follows: * <pre> * getCommercialInvoice().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link CommercialInvoiceType } * * */ public List<CommercialInvoiceType> getCommercialInvoice() { if (commercialInvoice == null) { commercialInvoice = new ArrayList<CommercialInvoiceType>(); } return this.commercialInvoice; } }
[ "otw1248@otw1248.com" ]
otw1248@otw1248.com
9a921861e5cb90378ef499368065fd16c2eecbe9
006c06f5cd5547b318e157ac1a3b1fc2484a3cb8
/src/main/java/proxy/cglib/CarService.java
be8f75205c80319de5d5b3fe50e5c84d350fe0da
[]
no_license
hanzhonghua/design
9e13765666804938320e8d9db83b817ad3d65068
4c618c8021514683db76a5fc6f07002a38dc3639
refs/heads/master
2022-07-17T22:17:48.761293
2020-10-13T03:00:46
2020-10-13T03:00:46
75,720,639
0
0
null
null
null
null
UTF-8
Java
false
false
126
java
package proxy.cglib; public class CarService { public void addCar(){ System.out.println("添加一辆车"); } }
[ "hzh199094@163.com" ]
hzh199094@163.com
daee1ec82a34f17706bc67920b91570164e6421d
2e44ad7496dd7ae80047ab7fcba1420e8ac4dab2
/src/com/aria/common/shared/admin/DunningProcessDetailsReturnElement.java
efbf1ccad908d460339f07e58898881991c820d2
[]
no_license
ewasserman/java_sdk
7ad5106e4b74d80c5ec8560dbc4944fb6e8876b8
c4c99a3385f6965390039cdb62883c1bcf7b2729
refs/heads/master
2020-12-11T08:07:04.710717
2016-04-15T22:04:01
2016-04-15T22:04:01
56,193,963
0
0
null
2016-04-15T22:04:01
2016-04-14T00:02:32
Java
UTF-8
Java
false
false
3,057
java
package com.aria.common.shared.admin; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "dunning_process_details_ReturnElement", propOrder = {"dunningProcessNo", "clientDunningProcessId", "dunningProcessName", "dunningProcessDescription", "clientDefaultInd", "totalStepCount", "mappedMasterPlans", "mappedPayMethodTypes"}) public class DunningProcessDetailsReturnElement { @XmlElement(name = "dunning_process_no") protected Long dunningProcessNo; @XmlElement(name = "client_dunning_process_id") protected String clientDunningProcessId; @XmlElement(name = "dunning_process_name") protected String dunningProcessName; @XmlElement(name = "dunning_process_description") protected String dunningProcessDescription; @XmlElement(name = "client_default_ind") protected Long clientDefaultInd; @XmlElement(name = "total_step_count") protected Long totalStepCount; @XmlElement(name = "mapped_master_plans") protected List<MappedMasterPlansReturnElement> mappedMasterPlans; @XmlElement(name = "mapped_pay_method_types") protected List<MappedPayMethodTypesReturnElement> mappedPayMethodTypes; public Long getDunningProcessNo() { return dunningProcessNo; } public void setDunningProcessNo(Long value) { this.dunningProcessNo = value; } public String getClientDunningProcessId() { return clientDunningProcessId; } public void setClientDunningProcessId(String value) { this.clientDunningProcessId = value; } public String getDunningProcessName() { return dunningProcessName; } public void setDunningProcessName(String value) { this.dunningProcessName = value; } public String getDunningProcessDescription() { return dunningProcessDescription; } public void setDunningProcessDescription(String value) { this.dunningProcessDescription = value; } public Long getClientDefaultInd() { return clientDefaultInd; } public void setClientDefaultInd(Long value) { this.clientDefaultInd = value; } public Long getTotalStepCount() { return totalStepCount; } public void setTotalStepCount(Long value) { this.totalStepCount = value; } public List<MappedMasterPlansReturnElement> getMappedMasterPlans() { if (this.mappedMasterPlans == null) { this.mappedMasterPlans = new ArrayList<MappedMasterPlansReturnElement>(); } return this.mappedMasterPlans; }public List<MappedPayMethodTypesReturnElement> getMappedPayMethodTypes() { if (this.mappedPayMethodTypes == null) { this.mappedPayMethodTypes = new ArrayList<MappedPayMethodTypesReturnElement>(); } return this.mappedPayMethodTypes; } }
[ "nithianandam.karounakarane@aspiresys.com" ]
nithianandam.karounakarane@aspiresys.com
f376bb458f8c2569f002d1a2539fd7d25247e514
b64da29082aa8e6185bf08f8aaaba5b1de2f4aba
/src/com/lanbao/user/Login.java
76cfb18d6931b07312c780765e383aee3a7bd455
[]
no_license
huangkaiyue/XiaoManyao
b9ef205a48fbd4e5a4ca4768250b65ad289a8e91
20267fd02320b7a065729d9e1ff2880b0cf1cbea
refs/heads/master
2020-03-24T03:11:59.109687
2018-10-10T02:30:24
2018-10-10T02:30:24
142,408,940
0
0
null
null
null
null
UTF-8
Java
false
false
3,629
java
package com.lanbao.user; import java.io.IOException; import net.sf.json.JSONObject; import org.apache.struts2.ServletActionContext; import com.hibernate.db.HuserManger; import com.lanbao.common.Common; import com.lanbao.common.HttpServletUtils; import com.lanbao.dbdata.CheckCode; import com.lanbao.dbdata.XiaomanyaoInterface; import com.opensymphony.xwork2.ActionSupport; import com.server.sdk.MnsQueue; public class Login extends ActionSupport { public String login() throws IOException{ String boby=HttpServletUtils.getRequestBoby(ServletActionContext.getRequest()); if(boby==null||boby.equals("")){ System.out.println(" getRequestBoby failed "); // CheckCode.checkPhoneCode("1218675043265","1234"); // XiaomanyaoInterface.InsertData("测试", "test"); // MnsQueue.SendMessage("070001834000001-d","web测试接口"); AckRequestFailed(403,"无效的请求参数"); return NONE; } UserReq req =(UserReq)JSONObject.toBean(JSONObject.fromObject(boby),UserReq.class); System.out.println(req.toString()); if(req.getMsgtype()==null){ AckRequestFailed(403,"无效的请求参数"); return NONE; } if(req.getMsgtype().equals("login")){ String usrname = req.getUsername(); String passwd = req.getPasswd(); if(usrname!=null&&passwd!=null){ HuserManger usr =XiaomanyaoInterface.getUserMessageByusrname(usrname); if(usr==null){ AckRequestFailed(201,"账号不存在"); }else{ if(usr.getPasswd().equals(passwd)){ AckRequestLoginSuccess(usrname,usr.getDevSn()); }else{ AckRequestFailed(202,"密码错误"); } } } }else if(req.getMsgtype().equals("autologin")){ String usrname = req.getUsername(); String token = req.getToken(); if(usrname!=null&&token!=null){ int ret =CheckCode.checkPhoneToken(usrname,token); switch (ret) { case CheckCode.ok_code: HuserManger usr =XiaomanyaoInterface.getUserMessageByusrname(usrname); if(usr!=null){ ackCheckcode(usrname,usr.getDevSn(),200,"登录成功"); }else{ System.out.println("autologin: not found usrname"); AckRequestFailed(201,"账号不存在"); } break; case CheckCode.timeout_code: ackCheckcode(usrname,"",401,"请重新手动输入密码登录"); break; case CheckCode.invalid_code: ackCheckcode(usrname,"",404,"无效登录参数,请重新手动输入密码登录"); break; default: break; } } } return NONE; } private void AckRequestLoginSuccess(String usrname,String devSn) throws IOException{ String token = Common.GetToken(); System.out.println("start usrname:"+usrname+"--->CachePhoneToken:"+token); CheckCode.CachePhoneToken(usrname, token); System.out.println("ack login:"+usrname+"--->CachePhoneToken:"+token); String jsondata = AckInterface.CreateLoginAckJson("login", devSn, "登录成功",token, 200); HttpServletUtils.AckRequestResponse(ServletActionContext.getResponse(),jsondata); } private void AckRequestFailed(int result,String resdata) throws IOException{ String jsondata = AckInterface.CreateAckJson("login", resdata, "", result); HttpServletUtils.AckRequestResponse(ServletActionContext.getResponse(),jsondata); } private void ackCheckcode(String usrname,String devSn,int result,String resdata) throws IOException{ String token = Common.GetToken(); CheckCode.CachePhoneToken(usrname, token); String jsondata = AckInterface.CreateLoginAckJson("autologin",devSn, resdata,token, result); System.out.println(jsondata); HttpServletUtils.AckRequestResponse(ServletActionContext.getResponse(),jsondata); } }
[ "l" ]
l
35a8b1c94144ea07c68540bbc18667ddbc63f65f
619a2f5b7cebc4408d4ea8f786cd7b5ebe5df05c
/shiroWeb/src/main/java/com/hjzgg/stateless/shiroWeb/config/Swagger2Config.java
296e08bef67b8ebb31fc84b136570feb96287782
[]
no_license
GitBaymin/Stateless-Shiro
ae7ad5e65310b6a4d307a836c69508a089e3449f
32ae51cb5f559b4bc341c751a4da521b324a8bb8
refs/heads/master
2020-04-02T05:57:01.168660
2017-07-24T07:37:19
2017-07-24T07:37:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,977
java
package com.hjzgg.stateless.shiroWeb.config; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; import springfox.documentation.builders.ApiInfoBuilder; import springfox.documentation.builders.PathSelectors; import springfox.documentation.builders.RequestHandlerSelectors; import springfox.documentation.service.ApiInfo; import springfox.documentation.service.Contact; import springfox.documentation.spi.DocumentationType; import springfox.documentation.spring.web.plugins.Docket; import springfox.documentation.swagger2.annotations.EnableSwagger2; @EnableWebMvc @EnableSwagger2 @ComponentScan("com.hjzgg.stateless.shiroWeb.controller") @Configuration public class Swagger2Config extends WebMvcConfigurationSupport { @Bean public Docket docket() { return new Docket(DocumentationType.SWAGGER_2) .apiInfo(apiInfo()) .groupName("admin") .select() // .apis(RequestHandlerSelectors.withClassAnnotation(Api.class)) // .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) .paths(PathSelectors.any()) .build(); } // @Bean // public Docket xxx() { // return new Docket(DocumentationType.SWAGGER_2) // .apiInfo(apiInfo()) // .groupName("xxx") // .select() // .apis(RequestHandlerSelectors.withClassAnnotation(Api.class)) // .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) // .paths(PathSelectors.ant("/xxx/**")) // .build(); // } private ApiInfo apiInfo() { return new ApiInfoBuilder() .title("shiro 无状态组件") .contact(new Contact("胡峻峥", "", "2570230521@qq.com")) .version("1.0") .build(); } }
[ "hujunzheng@beiquan.org" ]
hujunzheng@beiquan.org
071b9e1bfcaacdf8ab0f8de7cabdb15a7df9102c
552f09f8fbd854818bf8b055e3b59aaaa4b0972b
/alfresco-extensions-contentstore/src/main/java/org/alfresco/contentstore/dao/orient/OrientContentDAO.java
6023dbe9e4203f96f853a825ee79bdbddd578938
[]
no_license
sglover/AlfrescoExtensions
74b6d34b48809713b4fa95a54f457b23cfd2fc2d
9837acb08a39e75dd72bf93242a9df7e6117651d
refs/heads/master
2020-12-22T05:59:18.874470
2016-09-17T09:49:42
2016-09-17T09:49:42
32,572,295
2
4
null
null
null
null
UTF-8
Java
false
false
7,966
java
/* * Copyright 2015 Alfresco Software, Ltd. All rights reserved. * * License rights for this program may be obtained from Alfresco Software, Ltd. * pursuant to a written agreement and any use of this program without such an * agreement is prohibited. */ package org.alfresco.contentstore.dao.orient; /** * * @author sglover * */ public class OrientContentDAO //implements ContentDAO { // private String hostname; // private String dbName; // private String username; // private String password; // private boolean recreate; // // private OServerAdmin serverAdmin; // private OServerAdmin dbServerAdmin; // private OPartitionedDatabasePool pool; // // public OrientContentDAO(String hostname, String dbName, String username, String password, boolean recreate) // { // super(); // this.hostname = hostname; // this.dbName = dbName; // this.username = username; // this.password = password; // this.recreate = recreate; // } // // public void init() throws Exception // { // this.serverAdmin = new OServerAdmin("remote:" + hostname); // serverAdmin.connect("root", "admin"); // // OPartitionedDatabasePoolFactory poolFactory = new OPartitionedDatabasePoolFactory(10); // this.pool = poolFactory.get("remote:" + hostname + "/" + dbName, username, password); //// this.pool = new OPartitionedDatabasePool(); //// pool.setup(1,10); // // Map<String, String> databases = serverAdmin.listDatabases(); // if(databases.get(dbName) == null) // { // serverAdmin.createDatabase(dbName, "document", "plocal"); // dbServerAdmin = new OServerAdmin("remote:" + hostname + "/" + dbName); // dbServerAdmin.connect("root", "admin"); // } // else // { // dbServerAdmin = new OServerAdmin("remote:" + hostname + "/" + dbName); // dbServerAdmin.connect("root", "admin"); // // if(recreate) // { // dropDatabase(); // createDatabase(); // } // } // } // // private void createDatabase() throws IOException // { // serverAdmin.createDatabase(dbName, "document", "plocal"); // } // // private void dropDatabase() throws IOException // { // dbServerAdmin.dropDatabase("plocal"); // } // // private ODatabaseDocumentTx getDB() // { // ODatabaseDocumentTx db = pool.acquire(); // return db; // } // // private void updateFromNodeInfo(NodeInfo nodeInfo, ODocument doc) // { // doc.field("p", nodeInfo.getNode().getNodePath()); // doc.field("c", nodeInfo.getContentPath()); // doc.field("n", nodeInfo.getNode().getNodeId()); // doc.field("v", nodeInfo.getNode().getNodeVersion()); // doc.field("m", nodeInfo.getMimeType()); // doc.field("s", nodeInfo.getSize()); // } // // private ODocument fromNodeInfo(NodeInfo nodeInfo) // { // ODocument doc = new ODocument("Content"); // doc.field("p", nodeInfo.getNode().getNodePath()); // doc.field("c", nodeInfo.getContentPath()); // doc.field("n", nodeInfo.getNode().getNodeId()); // doc.field("v", nodeInfo.getNode().getNodeVersion()); // doc.field("m", nodeInfo.getMimeType()); // doc.field("s", nodeInfo.getSize()); // return doc; // } // // private NodeInfo toNodeInfo(ODocument doc) // { // String nodePath = doc.field("p"); // String contentPath = doc.field("c"); // String nodeId = doc.field("n"); // long nodeInternalId = doc.field("ni"); // String versionLabel = doc.field("v"); // String mimeType = doc.field("m"); // Long size = doc.field("s"); // // NodeInfo nodeInfo = new NodeInfo(Node.build() // .nodeId(nodeId).nodeInternalId(nodeInternalId) // .versionLabel(versionLabel) // .nodePath(nodePath), contentPath, mimeType, size); // return nodeInfo; // } // // public void shutdown() // { // serverAdmin.close(); // pool.close(); // } // // public interface Callback<T> // { // T execute(ODatabaseDocumentTx db); // } // // private <T> T withDBTX(Callback<T> callback) // { // ODatabaseDocumentTx db = getDB(); // db.begin(); // try // { // return callback.execute(db); // } // finally // { // db.commit(); // db.close(); // } // } // //// @Override //// public void addNode(final NodeInfo nodeInfo) //// { //// withDBTX(new Callback<Void>() //// { //// @Override //// public Void execute(ODatabaseDocumentTx db) //// { //// ODocument doc = fromNodeInfo(nodeInfo); //// doc.save(); //// //// return null; //// } //// }); //// } // // @Override // public NodeInfo getByNodePath(final String contentURL) // { // NodeInfo nodeInfo = withDBTX(new Callback<NodeInfo>() // { // @Override // public NodeInfo execute(ODatabaseDocumentTx db) // { // OSQLSynchQuery<ODocument> query = new OSQLSynchQuery<>("select * from Content where c = " + contentURL); // List<ODocument> result = db.query(query); // if(result.size() != 1) // { // throw new RuntimeException(); // } // ODocument doc = result.get(0); // NodeInfo nodeInfo = toNodeInfo(doc); // return nodeInfo; // } // }); // // return nodeInfo; // } // // private ODocument getDocByNodeId(final String nodeId, final String nodeVersion) // { // ODocument doc = withDBTX(new Callback<ODocument>() // { // @Override // public ODocument execute(ODatabaseDocumentTx db) // { // OSQLSynchQuery<ODocument> query = new OSQLSynchQuery<>("select * from Content where n = '" + nodeId // + "' and v = " + nodeVersion); // List<ODocument> result = db.query(query); // if(result.size() != 1) // { // throw new RuntimeException("Got " + result.size() + " results, expected 1"); // } // ODocument doc = result.get(0); // return doc; // } // }); // // return doc; // } // // // @Override // public NodeInfo getByNodeId(final String nodeId, final String nodeVersion, final boolean isPrimary) // { // NodeInfo nodeInfo = withDBTX(new Callback<NodeInfo>() // { // @Override // public NodeInfo execute(ODatabaseDocumentTx db) // { // OSQLSynchQuery<ODocument> query = new OSQLSynchQuery<>("select * from Content where n = '" + nodeId // + "' and v = " + nodeVersion + " and ip = " + isPrimary); // List<ODocument> result = db.query(query); // if(result.size() != 1) // { // throw new RuntimeException("Got " + result.size() + " results, expected 1"); // } // ODocument doc = result.get(0); // NodeInfo nodeInfo = toNodeInfo(doc); // return nodeInfo; // } // }); // // return nodeInfo; // } // // @Override // public void updateNode(final NodeInfo nodeInfo) // { // withDBTX(new Callback<Void>() // { // @Override // public Void execute(ODatabaseDocumentTx db) // { // String nodeId = nodeInfo.getNode().getNodeId(); // String versionLabel = nodeInfo.getNode().getVersionLabel(); // ODocument doc = getDocByNodeId(nodeId, versionLabel); // updateFromNodeInfo(nodeInfo, doc); // // return null; // } // }); // } // // @Override // public void addUsage(NodeUsage nodeUsage) // { // // TODO Auto-generated method stub // // } // // @Override // public NodeInfo getByNodeId(long nodeInternalId, String mimeType) // { // // TODO Auto-generated method stub // return null; // } // // @Override // public NodeInfo getByNodeId(String nodeId, long nodeInternalVersion, // boolean isPrimary) // { // // TODO Auto-generated method stub // return null; // } // // @Override // public boolean nodeExists(String nodeId, long nodeInternalVersion, boolean isPrimary) // { // // TODO Auto-generated method stub // return false; // } }
[ "steven.glover@gmail.com" ]
steven.glover@gmail.com
50be8a7e0fb4d112e276dafd77bfe7f0c2c77f5c
dc689e19a70f9db042d05aa845934be3e534ff36
/app/src/main/java/com/tujishushu/tujiweather/MainActivity.java
c27496650e3b71e53e6fe9f46e7800f24a69a4cf
[ "Apache-2.0" ]
permissive
tujishushu/tujiweather
30d2181302151b523ab00a8017815bd751d175be
41a1c3ce15e1e6a5123097db71b6c2cdc333e635
refs/heads/master
2021-01-22T03:40:08.979485
2017-02-09T12:41:26
2017-02-09T12:41:26
81,446,906
0
0
null
null
null
null
UTF-8
Java
false
false
339
java
package com.tujishushu.tujiweather; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } }
[ "378458893@qq.com" ]
378458893@qq.com
f89bc7ff0f787cb8a12e4316c3d8525f8621ee56
af3f71784a788fe5e5ac0d8b9aa5da322d98b9f2
/src/modulo-05-java/lavanderia/src/test/java/br/com/cwi/crescer/service/ProdutoServiceTest.java
7960754f9fd7bf41f51879d43597da2ff62fbf08
[]
no_license
iagodahlem/crescer-2015-2
60fe9d8cfbffe12575ce7d1a9de40740dbfd3fe6
432587d9696eb671def96ca276e849fe3c99bacf
refs/heads/master
2020-12-25T13:52:11.207212
2015-12-01T15:38:29
2015-12-01T15:38:29
42,562,512
0
0
null
2015-09-16T03:32:02
2015-09-16T03:32:02
null
UTF-8
Java
false
false
778
java
package br.com.cwi.crescer.service; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.MockitoAnnotations; import br.com.cwi.crescer.dao.ProdutoDAO; import br.com.cwi.crescer.dto.ProdutoDTO; public class ProdutoServiceTest { @InjectMocks private ProdutoService produtoService; @Mock private ProdutoDAO produtoDAO; @Before public void setup() { MockitoAnnotations.initMocks(this); } @Test public void produtoNaoÉUnico() throws Exception { ProdutoDTO produtoDTO = new ProdutoDTO(); produtoDTO.setMaterialDescricao("Delicado"); produtoDTO.setServicoDescricao("Lavar"); Assert.assertTrue(produtoService.verificaProdutoUnico(produtoDTO)); } }
[ "iagodahlemlorensini@gmail.com" ]
iagodahlemlorensini@gmail.com
2cf2c7af9b0af47d6f6b50cd7d29cda63efcb61d
96f8d42c474f8dd42ecc6811b6e555363f168d3e
/baike/sources/qsbk/app/live/widget/cg.java
c4c4e634ca2670b58db27f40660d4f7c4c9c25f8
[]
no_license
aheadlcx/analyzeApk
050b261595cecc85790558a02d79739a789ae3a3
25cecc394dde4ed7d4971baf0e9504dcb7fabaca
refs/heads/master
2020-03-10T10:24:49.773318
2018-04-13T09:44:45
2018-04-13T09:44:45
129,332,351
6
2
null
null
null
null
UTF-8
Java
false
false
365
java
package qsbk.app.live.widget; import android.view.View; import qsbk.app.core.widget.EmptyPlaceholderView.OnEmptyClickListener; class cg implements OnEmptyClickListener { final /* synthetic */ ce a; cg(ce ceVar) { this.a = ceVar; } public void onEmptyClick(View view) { this.a.a.f.showProgressBar(); this.a.a.j(); } }
[ "aheadlcxzhang@gmail.com" ]
aheadlcxzhang@gmail.com
5ca6a144958be1e3f7fb32f18731614ba658a553
2b141e2c00e3fe9f12929f7f8917b2e88eed463a
/src/main/java/com/example/testGeov/domain/TestDomain.java
05c448338f3632280ae3cdc659ff2b799934dddf
[]
no_license
HKE528/SpringBootEgovSample
d7859986eae6de186f92ec6bde0ea0ef1bd1f190
cd96dd865608de82ab7f2f4d5e04a3dfa9d846cd
refs/heads/main
2023-06-20T18:44:41.963917
2021-08-02T03:59:42
2021-08-02T03:59:42
391,799,711
0
0
null
null
null
null
UTF-8
Java
false
false
355
java
package com.example.testGeov.domain; import lombok.Data; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; @Entity @Data public class TestDomain { @Id @GeneratedValue @Column(name = "id", nullable = false) private Long id; private String comment; }
[ "gosumo12@gmail.com" ]
gosumo12@gmail.com
8c74932dc070556ba7d7483fcb2a27d7b5cc80ee
5e03e98f8cfd6196a1fc89c3021635205e0ee3eb
/BulletGame/src/Proj.java
3a2769b92b1038fcc7b2569ef35d1023442e877f
[]
no_license
akhenning/BulletGame
6baacff0e6f1f7366f28c99ccc38fd12798240a0
956132441e27146e25cefa3a3b40f526737ae2ac
refs/heads/master
2023-05-25T10:52:49.002675
2023-05-10T03:15:31
2023-05-10T03:15:31
112,638,506
0
0
null
null
null
null
UTF-8
Java
false
false
8,563
java
import java.awt.geom.Point2D; import java.awt.Color; import java.awt.Graphics2D; import java.awt.geom.Ellipse2D; import java.awt.Image; import java.awt.Toolkit; public class Proj implements Collidable { protected double hp=1; protected long remainingTime; protected double radius=20; private int type; private double yRadRatio=1; private double radChange; private double curve; private double yV=0; private double xV; private double x; private double y; private int power=1; private int maxProjSize=9999;; public static Image fireImg=Toolkit.getDefaultToolkit().getImage("fire.png"); public static Image vineImg=Toolkit.getDefaultToolkit().getImage("vine.png"); public static Image boomImg=Toolkit.getDefaultToolkit().getImage("boom.png"); public static Image smugImg=Toolkit.getDefaultToolkit().getImage("smugu.png"); public static Image smugImg2=Toolkit.getDefaultToolkit().getImage("smug2.png"); private Image img; public static Player player; public Proj(int type, double angle, double speed, double curve, int offset, int lifetime, double radChange)//lifetime == -1 means increased power { this.radChange=radChange; if (lifetime==-1) { power++; remainingTime=Long.MAX_VALUE; } else if (lifetime!=0) { remainingTime=DrawingPanel.tickCounter+lifetime; } else remainingTime=Long.MAX_VALUE; if(player==null) {System.out.println("STATIC VARIABLE player HAS NOT BEEN INITIALIZED IN PlayerProj CLASS");} y=player.getY(); x=player.getX()+offset; switch (type) { case 0: radius=15; //staticX=player.getX()+Player.scrollX; this.type=type; break; case 1: radius=20; img=fireImg; break; case 2: radius=20; img=vineImg; break; case 3: hp++; img=boomImg; break; case 4: break; } yV=speed; xV=player.getXV()/2+angle; this.curve=curve; if(img!=null) { yRadRatio=(double)(img.getHeight(null))/(double)(img.getWidth(null)); } } public Proj(Enemy shooter, int type, double absSpeed, double angle, double speed, double curve, int offset, int lifetime, double radChange) { this.type=type; this.radChange=radChange; if (lifetime!=0) { remainingTime=DrawingPanel.tickCounter+lifetime; } else remainingTime=Long.MAX_VALUE; if(shooter==null) {System.out.println("Trying to fire from nonexistant enemy. Somehow.");} y=shooter.attackFromWhereY(); x=shooter.attackFromWhereX(); yV=speed; xV=angle; boolean goodIdea=true; if(goodIdea) { yV+=shooter.getYV(); xV+=shooter.getXV()/2; } if(absSpeed!=0) { double speedProp=Math.sqrt(absSpeed/((xV*xV)+(yV*yV)));//TODO this might cause a bit of slowdown xV*=speedProp; yV*=speedProp; } this.curve=curve; switch (type) { case 0://Default fireball radius=8; img=fireImg; break; case 1://larger fireball radius=20; img=vineImg; break; case 2://also... a larger fireball radius=20; img=fireImg; break; case 5://basketball falling shot radius=20; yV=1; img=vineImg; break; case 101://good homing radius=30; img=fireImg; break; case 102://hard homing radius=30; img=fireImg; break; case 103://gatling homing radius=30; img=fireImg; break; case 104://good homing radius=30; img=vineImg; break; case 105://bomb radius=60; img=smugImg; hp=-30; maxProjSize=600; break; } if(img!=null) { yRadRatio=(double)(img.getHeight(null))/(double)(img.getWidth(null)); } } public void calcXY() { if(DrawingPanel.tickCounter>remainingTime) {hp=0; return;} switch (type) { case 101: xV+=(player.getX()-x)/5000; yV-=(player.getY()-y)/5000; if(xV>2) {xV=2;} if(yV<-2) {yV=-2;} if(xV<-2) {xV=-2;} if(yV>2) {yV=2;} break; case 102: xV=(player.getX()-x)/100;//Run up to then hesitate,really hard to deal with yV=-(player.getY()-y)/100; break; case 103: xV+=(player.getX()-x)/6000;//Probably sections off areas. yV-=(player.getY()-y)/6000; break; case 104: xV+=(player.getX()-x)/60000;//good very slow homing yV-=(player.getY()-y)/60000; break; case 5: yV-=.01; break; } if(type<5||type==105) { xV+=curve; if(type==105&&y>DrawingPanel.LOWER_BOUNDS-40) { if(img==smugImg) { yV=0; //y-=1; img=Graphic.explosion; yRadRatio=1; } radius+=(maxProjSize-radius)/40+2; } } x+=xV; y-=yV; radius+=radChange; if(y>1000) { hp=0; } else if(x>DrawingPanel.RIGHT_BOUNDS||x<DrawingPanel.LEFT_BOUNDS||y<DrawingPanel.UPPER_BOUNDS||y>DrawingPanel.LOWER_BOUNDS) { hp=0; } if(radius>maxProjSize) { hp=0; } if(radChange<0&&radius<10) { hp=0; } } public void draw(Graphics2D g2) { //System.out.println(boomImg); if(yRadRatio==1&&img!=null) { yRadRatio=(double)(img.getHeight(null))/(double)(img.getWidth(null)); } if(img!=null) { g2.drawImage(img,(int)(x-radius),(int)(y-(radius*yRadRatio)),(int)(radius*2),(int)(radius*yRadRatio*2),null);//1.4 } else { g2.setColor(Color.BLACK); Ellipse2D.Double ell2=new Ellipse2D.Double(x-(radius/2),y-radius/2,radius,radius); g2.fill(ell2); } // if(radius==0) { // radius=20; // } } public void hitEnemy(int damage) { if(damage==0) {hp=0;} else {hp-=damage;} } public boolean isInside(Point2D.Double point) { return (Math.abs(x-point.getX())<radius)&&(Math.abs(y-point.getY())<radius*yRadRatio); } public boolean isInside(double x2,double y2) { return (Math.abs(x-x2)<radius)&&(Math.abs(y-y2)<radius*yRadRatio); } public <T extends Collidable> boolean isTouching(T on)//Still need to check that this works. { if(img==Graphic.explosion) {return (Point2D.distanceSq(x, y, on.getX(), on.getY())<(radius*radius/2));} else return (Math.abs(on.getX()-x)<on.getWidth()+radius)&&(Math.abs(on.getY()-y)<on.getHeight()+(radius*yRadRatio)); // else if(radius<35&&yRadRatio<2) // return ((on.isInside(new Point2D.Double(x+radius,y))))||(on.isInside(new Point2D.Double(x,y+(radius*yRadRatio)))); // else if (radius<70) // return ((on.isInside(new Point2D.Double(x+radius,y)))||(on.isInside(new Point2D.Double(x,y-(radius*yRadRatio)))||(on.isInside(new Point2D.Double(x-radius,y))))); // else // return (Math.abs(on.getX()-x)<on.getWidth()+radius)&&(Math.abs(on.getY()-y)<on.getHeight()+(radius*yRadRatio)); //return ((on.isInside(new Point2D.Double(x+radius,y)))||(on.isInside(new Point2D.Double(x+radius/2,y-(radius*yRadRatio)))||(on.isInside(new Point2D.Double(x-radius/2,y-(radius*yRadRatio))))||(on.isInside(new Point2D.Double(x,y-(radius*yRadRatio))))||(on.isInside(new Point2D.Double(x-radius,y))))); } public boolean isTouching(RectObj r) { return ((r.isInside(new Point2D.Double(x+radius,y+(radius*yRadRatio)))))||(r.isInside(new Point2D.Double(x-radius,y+(radius*yRadRatio)))); } public boolean isAlive() { return (hp>0||hp<-20); } public double getRadius() {return radius;} public double getWidth() {return radius;} public double getHeight() {return radius;} public double getX() { return x; } public double getY() { return y; } public int getAttackPower() { return power; } public static void setPlayer(Player p) { player=p; } }
[ "tylerjhenning@gmail.com" ]
tylerjhenning@gmail.com
dab50e2fd30ea5117b819cfa2ef097ef8ad4c29f
51eae221ba4743b93d9009412cb2001657a8f36d
/Carditer2/src/test/java/cardcontrol/GetAndDeleteCardTest.java
65b973f56a35916e1631fc8b558a9101b9a09c2b
[ "MIT" ]
permissive
beichen-xing/AWS_Based_Giftcard_Project
c53df5e23c044a8436b5c0b775da390e26363ade
d52368bcd2f429324894ff9b2a53da92e06061b5
refs/heads/master
2020-09-29T09:43:13.989457
2020-01-04T04:17:53
2020-01-04T04:17:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,058
java
package cardcontrol; import java.io.*; import org.junit.Assert; import org.junit.Test; import com.google.gson.Gson; import http.*; public class GetAndDeleteCardTest extends LambdaTest { @Test public void testDeleteCard() throws IOException { // get card GetCardRequest gcr = new GetCardRequest("11"); String ccRequest = new Gson().toJson(gcr); String jsonRequest = new Gson().toJson(new PostRequest(ccRequest)); InputStream input = new ByteArrayInputStream(jsonRequest.getBytes()); OutputStream output = new ByteArrayOutputStream(); new GetCard().handleRequest(input, output, createContext("create")); PostResponse post = new Gson().fromJson(output.toString(), PostResponse.class); GetCardResponse resp = new Gson().fromJson(post.body, GetCardResponse.class); System.out.println(resp); Assert.assertEquals("11", resp.id); // now delete DeleteCardRequest dcr = new DeleteCardRequest("11"); ccRequest = new Gson().toJson(dcr); jsonRequest = new Gson().toJson(new PostRequest(ccRequest)); input = new ByteArrayInputStream(jsonRequest.getBytes()); output = new ByteArrayOutputStream(); new DeleteCard().handleRequest(input, output, createContext("delete")); post = new Gson().fromJson(output.toString(), PostResponse.class); DeleteCardResponse d_resp = new Gson().fromJson(post.body, DeleteCardResponse.class); Assert.assertEquals("11", d_resp.id); // try again and this should fail input = new ByteArrayInputStream(jsonRequest.getBytes()); output = new ByteArrayOutputStream(); new DeleteCard().handleRequest(input, output, createContext("delete")); post = new Gson().fromJson(output.toString(), PostResponse.class); d_resp = new Gson().fromJson(post.body, DeleteCardResponse.class); Assert.assertEquals(422, d_resp.statusCode); } }
[ "53940972+beichen-xing@users.noreply.github.com" ]
53940972+beichen-xing@users.noreply.github.com
c3653d526764c24fb94214fd22c6c68d36b1090d
b20f8818024ac64d69744bb919d9c2aa6afabc57
/concurrent/src/main/java/com/alistar/demo2/Demo2.java
0f75d967d533558f368961788fd86d44b4ab465a
[]
no_license
zhanzhj/Luban
64840693700d754b75c71d2298f5a58bd25cfef9
9d08aedbbd04f49a9d6a3d7cb29b8c9722aa06ee
refs/heads/master
2020-06-30T22:31:46.440317
2019-08-07T03:58:25
2019-08-07T03:58:25
200,968,825
0
0
null
null
null
null
UTF-8
Java
false
false
851
java
package com.alistar.demo2; import java.util.concurrent.TimeUnit; /** * 同步方法和非同步方法是否可以同时调用? 可以 */ public class Demo2 { public synchronized void test1(){ System.out.println(Thread.currentThread().getName() + " start"); try { TimeUnit.SECONDS.sleep(3); } catch (InterruptedException e) { e.printStackTrace(); } System.out.println(Thread.currentThread().getName() + " end"); } public void test2(){ System.out.println(Thread.currentThread().getName() + " start"); try { Thread.sleep(5000); } catch (InterruptedException e) { e.printStackTrace(); } System.out.println(Thread.currentThread().getName() + " end"); } public static void main(String[] args) { Demo2 demo = new Demo2(); new Thread(demo::test1, "T1").start(); new Thread(demo::test2, "T2").start(); } }
[ "alistar_zhan@ehsy.com" ]
alistar_zhan@ehsy.com
af2bbb59466a9cd398f1d7e5787c2f0e3a6d0ad8
fee3a904e95fd488bcfc3354f22dc13ac045b05d
/src/main/java/kaisheng/project/servlets/CustomerServlet/MyCustomerServlet.java
29a4688a1a033dbdd63cde0e0c13d025bd097a8c
[]
no_license
1142007022/project
49917e41238ce6a599522de1c0595729d3b6b685
44a6d0cc1fe4ce8bcd53f1234670725b315aa951
refs/heads/master
2020-03-06T17:23:36.003934
2018-03-28T06:59:34
2018-03-28T06:59:34
126,989,017
0
0
null
null
null
null
UTF-8
Java
false
false
1,558
java
package kaisheng.project.servlets.CustomerServlet; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.apache.commons.lang3.StringUtils; import kaisheng.project.servlets.SuperServlet; import kaisheng.project.entitys.Account; import kaisheng.project.entitys.Customer; import kaisheng.project.service.CustomerService; import kaisheng.project.utils.Page; import kaisheng.project.utils.Result; @WebServlet("/customer/my") public class MyCustomerServlet extends SuperServlet{ private static final long serialVersionUID = 1L; CustomerService service = new CustomerService(); @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { jump("customer/MyCustomer", req, resp); } @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { int pageNum = 1; String p = req.getParameter("p"); if(StringUtils.isNumeric(p)) { pageNum = Integer.parseInt(p); } // System.out.println("p--------------->"+p); HttpSession session = req.getSession(); Account acc = (Account) session.getAttribute("account"); int accountId = acc.getId(); Page<Customer> page = service.findByPage(pageNum,accountId); req.setAttribute("pages", page); Result res = Result.success(page); sendJson(res, resp); } }
[ "1142007022@qq.com" ]
1142007022@qq.com