blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
689M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
131 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
32 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
313
db06c637fc38d72f3cf0beab45677ebf9b2dd774
f9692002ede4b5f7236a51bdd1596d0283cf27ea
/Bus_Booking_System_JPA/src/main/java/com/bbs/services/AdminServiceImpl.java
6b40263e0e64894653bdf3a66de49cbda9258396
[]
no_license
RUSHER2508/BUS-BOOKING-SYSTEM-JPA
7d352fe9ab761a6a80bc2ec1591ae2f700819478
6e4a35589ad01a527279102ada625e46356bc321
refs/heads/master
2022-12-01T00:10:53.340091
2019-08-01T02:19:43
2019-08-01T02:19:43
199,959,996
0
0
null
2022-11-24T08:16:48
2019-08-01T02:17:19
Java
UTF-8
Java
false
false
988
java
package com.bbs.services; import java.util.HashMap; import java.util.List; import com.bbs.beans.Bus; import com.bbs.dao.AdminDaoBBS; import com.bbs.dao.JPAAdminImpl; public class AdminServiceImpl implements AdminServices{ AdminDaoBBS dao = new JPAAdminImpl(); @Override public Boolean createBus(Bus bus) { return dao.createBus(bus); } @Override public Bus searchBus(Integer busId) { return dao.searchBus(busId); } @Override public Boolean deletebus(Integer busId) { return dao.deletebus(busId); } @Override public List<Bus> busBetween(String source, String destination) { return dao.busBetween(source, destination); } @Override public Boolean adminLogin(Integer adminId, String password) { return dao.adminLogin(adminId, password); } @Override public Boolean updateBus(String source, String destination, Double price, Integer busId) { return dao.updateBus(source, destination, price, busId); } }
[ "noreply@github.com" ]
RUSHER2508.noreply@github.com
f82cde4a0a79115e9c3268008b57f61f75e1d271
e3aeb925914510aabdd77f343638a3b38ad403d6
/src/main/java/am/basic/springTest/config/ExceptionConfig.java
31d37e039d0438d867bd7e003853b9fbf21342c7
[]
no_license
Mkrtchyan5/LoginRegisterSpring
8b7f5930c98bf7a1f6a13d36677178f1fe3c97c5
baece2e755297df0df21573a68edc16c4d8ba04f
refs/heads/master
2022-12-05T01:46:05.366486
2020-08-31T13:39:35
2020-08-31T13:39:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,342
java
package am.basic.springTest.config; import am.basic.springTest.model.exceptions.DuplicateDataException; import am.basic.springTest.model.exceptions.NotFoundException; import lombok.extern.log4j.Log4j2; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ExceptionHandler; import java.util.Collections; @Log4j2 @ControllerAdvice public class ExceptionConfig { @ExceptionHandler(NotFoundException.class) public ResponseEntity handleNotFoundException(NotFoundException exception){ log.warn(exception.getMessage()); return ResponseEntity.status(404).body(Collections.singletonMap("message",exception.getMessage())); } @ExceptionHandler(DuplicateDataException.class) public ResponseEntity handleDuplicateDataException(DuplicateDataException exception){ log.warn(exception.getMessage()); return ResponseEntity.status(409).body(Collections.singletonMap("message",exception.getMessage())); } @ExceptionHandler(RuntimeException.class) public ResponseEntity handleRuntimeException(RuntimeException exception){ log.error(exception.getMessage()); return ResponseEntity.status(500).body(Collections.singletonMap("message","something.went.wrong")); } }
[ "555mkrt555@mail.ru" ]
555mkrt555@mail.ru
dafae313dd5cf9be1803684b8c91996b344d5c25
1f3c00468850bc6e7794cb70efd8dd1c73eda1b5
/Channel/channel/com/channel/bean/XcDt.java
f450b46a553bb6fc3614e0fc010c20d7b28e4226
[]
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
1,985
java
package com.channel.bean; import org.apache.struts2.json.annotations.JSON; import java.util.Date; /** * Created by Administrator on 2016/8/9. */ public class XcDt { private int id; private String hdmc; private String qd; private String zd; private String qdzh; private String zdzh; private String ztqk; private String deptname; private Date starttime; private Date endtime; private int yhgkid; public int getId() { return id; } public void setId(int id) { this.id = id; } public String getHdmc() { return hdmc; } public void setHdmc(String hdmc) { this.hdmc = hdmc; } public String getQd() { return qd; } public void setQd(String qd) { this.qd = qd; } public String getZd() { return zd; } public void setZd(String zd) { this.zd = zd; } public String getQdzh() { return qdzh; } public void setQdzh(String qdzh) { this.qdzh = qdzh; } public String getZdzh() { return zdzh; } public void setZdzh(String zdzh) { this.zdzh = zdzh; } public String getDeptname() { return deptname; } public void setDeptname(String deptname) { this.deptname = deptname; } public String getZtqk() { return ztqk; } public void setZtqk(String ztqk) { this.ztqk = ztqk; } @JSON(format = "yyyy-MM-dd HH:mm:ss") public Date getStarttime() { return starttime; } public void setStarttime(Date starttime) { this.starttime = starttime; } @JSON(format = "yyyy-MM-dd HH:mm:ss") public Date getEndtime() { return endtime; } public void setEndtime(Date endtime) { this.endtime = endtime; } public int getYhgkid() { return yhgkid; } public void setYhgkid(int yhgkid) { this.yhgkid = yhgkid; } }
[ "393054246@qq.com" ]
393054246@qq.com
bf7ac3923982f307573e7f4abd8ccd49d381728d
650e00ac736ebc63b6ac2571906924b04f0e4d1b
/src/main/java/com/controller/AnamneseController.java
2c207a5cfacc1a78fbccc05cbdf093d80f783450
[]
no_license
tcgontijo/clinica_vet
f4cb7fcebb2e3ca5f1a9c47b012d8959d53c054d
a2d11daf2335f9ea4c68dd709593a4c027f71687
refs/heads/main
2023-06-11T22:26:35.751307
2021-07-08T13:52:35
2021-07-08T13:52:35
378,745,473
0
0
null
null
null
null
UTF-8
Java
false
false
1,420
java
package com.controller; import java.util.List; import javax.validation.Valid; import org.springframework.beans.factory.annotation.Autowired; 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 com.domain.Anamnese; import com.service.AnamneseService; @RestController @RequestMapping("/anamnese") public class AnamneseController { @Autowired AnamneseService service; @GetMapping public List<Anamnese> recuperaTodosRegistros() { return service.todos(); } @PostMapping public Anamnese criaNovoRegistro(@Valid @RequestBody Anamnese anamnese) { return service.novo(anamnese); } @GetMapping("/{id}") public Anamnese buscaUmRegistro(@PathVariable Integer id) { return service.busca(id); } @PutMapping("/{id}") public Anamnese atualizaRegistro(@Valid @RequestBody Anamnese anamnese, @PathVariable Integer id) { return service.atualiza(anamnese, id); } @DeleteMapping("/{id}") void excluiRegistro(@PathVariable Integer id) { service.exclui(id); } }
[ "tulio_gontijo@hotmail.com" ]
tulio_gontijo@hotmail.com
ce8bb753b58f274c6572dbb86ca0d527a40abcc2
23a219c017d024ac3fab2bff6af17b719008c210
/src/main/java/com/example/hellowebflux/PonkokkoController.java
c7f8f83ddb26814f405bf1dd5b940f416f8479cb
[]
no_license
pinkikki/ponko-swf
adfd1ebf8cbc114901e87b6c9457339a2d32ca9f
6c2e78d2f7a4a68e81fab3619b3f9e78a60266bd
refs/heads/master
2021-05-07T04:38:00.961936
2017-11-18T10:54:02
2017-11-18T10:54:02
111,197,755
0
0
null
null
null
null
UTF-8
Java
false
false
1,672
java
package com.example.hellowebflux; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; import reactor.util.function.Tuple2; import java.time.Duration; import java.util.Collections; import java.util.Map; import java.util.Random; import java.util.function.Supplier; import java.util.stream.Stream; @RestController public class PonkokkoController { @GetMapping("/") Flux<String> ponkokko() { return Flux.just("This", " is ", "ponkokko"); } @GetMapping("/stream") Flux<Map<String, String>> pontream() { Stream<String> stream = Stream.iterate("ponko", s -> s + "kko"); return Flux.fromStream(stream.limit(5)).map(s -> Collections.singletonMap("ponko", s)); } @GetMapping("/zipwith") Flux<Integer> ponzipwith() { Supplier<Integer> generator = () -> new Random().nextInt(); return Flux.fromStream(Stream.generate(generator).limit(5)).zipWith(Flux.interval(Duration.ofSeconds(1))).map(Tuple2::getT1); } @PostMapping("/postmono") Mono<String> ponpostmono(@RequestBody Mono<String> body) { return body.map(String::toUpperCase); } @PostMapping("/post") String ponpost(@RequestBody String body) { return body.toUpperCase(); } @PostMapping("/poststream") Flux<String> ponpoststream(@RequestBody Flux<Map<String, String>> body) { return body.map(m -> m.get("pon") + "kokko"); } }
[ "w-mizutani@pinkikki.jp" ]
w-mizutani@pinkikki.jp
432dd4458fde8a38be8b5c3f63cc40422a16ef00
4df6847fc0aabb81f1fcf9845fd3c1ddc80a6236
/src/gervill/com/sun/media/sound/SoftAudioBuffer.java
8b0976bf54239020b0b8e29d0876fc08f78b0ba5
[]
no_license
HectorRicardo/final-gervill
aa6d05783e66fce6799e21fe86a9f03661cb5ac6
4e6ac9c4d6934a0c8194ad3032d3050cf4d13c55
refs/heads/master
2022-12-23T13:55:20.364602
2020-09-27T16:49:05
2020-09-27T16:49:05
287,312,235
0
0
null
null
null
null
UTF-8
Java
false
false
2,741
java
/* * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package gervill.com.sun.media.sound; import java.util.Arrays; /** * This class is used to store audio buffer. * * @author Karl Helgason */ public final class SoftAudioBuffer { private float[] buffer; private boolean empty = true; private byte[] converter_buffer; public void swap(SoftAudioBuffer swap) { float[] bak_buffer = buffer; boolean bak_empty = empty; byte[] bak_converter_buffer = converter_buffer; buffer = swap.buffer; empty = swap.empty; converter_buffer = swap.converter_buffer; swap.buffer = bak_buffer; swap.empty = bak_empty; swap.converter_buffer = bak_converter_buffer; } public void clear() { if (!empty) { Arrays.fill(buffer, 0); empty = true; } } public boolean isSilent() { return empty; } public float[] array() { empty = false; if (buffer == null) buffer = new float[300]; return buffer; } public void get(byte[] buffer, int channel) { if (converter_buffer == null) converter_buffer = new byte[600]; SoftSynthesizer.SYNTH_CONVERTER.toByteArray(array(), 300, converter_buffer); if (channel >= 2) return; for (int j = 0; j < 2; j++) { int z = channel * 2 + j; for (int i = 0; i < 300; i++) { buffer[z] = converter_buffer[2 * i + j]; z += 4; } } } }
[ "hectorricardomendez@gmail.com" ]
hectorricardomendez@gmail.com
8d75f131c0cea2debfa3267476463871394a0c78
8395ed32d5f4149fb79f980c20e9fea35c526822
/src/test/java/com/opstty/mapper/ExistingSpeciesMapperTest.java
be8aa4cbd2fd369e6dd900fbee1ceb53dea6123b
[]
no_license
AymenBenaissa/hadoop-examples-mapreduce
6ff9e84006f120ec109d6ec79625854018423f6a
eb394e1bbe2da55ce7a4f0157f3a370f5ebe0da9
refs/heads/main
2023-01-08T07:34:30.427255
2020-11-10T18:26:02
2020-11-10T18:26:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,802
java
package com.opstty.mapper; import org.apache.hadoop.io.IntWritable; import org.apache.hadoop.io.NullWritable; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapreduce.Mapper; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.runners.MockitoJUnitRunner; import java.io.IOException; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; @RunWith(MockitoJUnitRunner.class) public class ExistingSpeciesMapperTest { @Mock private Mapper.Context context; private ExistingSpeciesMapper existingSpeciesMapper; @Before public void setup() { this.existingSpeciesMapper = new ExistingSpeciesMapper(); } @Test public void testMap() throws IOException, InterruptedException { String value = "GEOPOINT;ARRONDISSEMENT;GENRE;ESPECE;FAMILLE;ANNEE PLANTATION;HAUTEUR;CIRCONFERENCE;ADRESSE;NOM COMMUN;VARIETE;OBJECTID;NOM_EV\n" + "(48.857140829, 2.29533455314);7;Maclura;pomifera;Moraceae;1935;13.0;;Quai Branly, avenue de La Motte-Piquet, avenue de la Bourdonnais, avenue de Suffren;Oranger des Osages;;6;Parc du Champs de Mars\n" + "(48.8685686134, 2.31331809304);8;Calocedrus;decurrens;Cupressaceae;1854;20.0;195.0;Cours-la-Reine, avenue Franklin-D.-Roosevelt, avenue Matignon, avenue Gabriel;Cèdre à encens;;11;Jardin des Champs Elysées\n" + "(48.8768191638, 2.33210374339);9;Pterocarya;fraxinifolia;Juglandaceae;1862;22.0;330.0;Place d'Estienne-d'Orves;Pérocarya du Caucase;;14;Square Etienne d'Orves"; this.existingSpeciesMapper.map(null, new Text(value), this.context); verify(this.context, times(1)) .write(new Text( "pomifera"), new IntWritable(-1)); } }
[ "37302578+Naykoh@users.noreply.github.com" ]
37302578+Naykoh@users.noreply.github.com
1775b735f7dd1b204f31c7192bb48dcb5a934934
7180a50e747efdd4e594ecc0de540a8152f892a7
/TMCProjects/2013-OOProgrammingWithJava-PART1/week4-072.3.MoneyTransfers/src/Accounts.java
a30433f30d6d82d98d03b716c7f54241fc48da5c
[]
no_license
GraveRider/LearningJava
69b103432a19281dc27fea90ef7da7fdfcc9a6b7
da7b3d72c2e0efdc8d35ec24eb6cb2109ec2a1e1
refs/heads/master
2021-01-18T18:06:52.967313
2017-05-16T23:09:27
2017-05-16T23:09:27
84,360,416
0
0
null
null
null
null
UTF-8
Java
false
false
494
java
public class Accounts { public static void main(String[] args) { Account a = new Account("A", 100); Account b = new Account("B", 0); Account c = new Account("C", 0); transfer(a, b, 50); System.out.println(a + "\n" + b); transfer(b, c, 25); System.out.println(b + "\n" + c); } public static void transfer(Account from, Account to, double howMuch) { from.withdrawal(howMuch); to.deposit(howMuch); } }
[ "donprayer@gmail.com" ]
donprayer@gmail.com
72d7c2432eda226752859425574c8d5cb756ae41
2248734678262394c05755c8ac5c0d9d34ec0a52
/src/com/sigma/codaclient/common/CodaClientConfiguration.java
a651ff44b78af07813d2a1aecd5b5363b96172eb
[]
no_license
phi2039/codalib
17f717af931421761a3f711cb2ed6bf0f4ed165c
3623e2c0e30c269f641e079502bb9081b669b93e
refs/heads/master
2021-01-10T05:35:46.433899
2015-12-03T16:22:05
2015-12-03T16:22:05
47,346,059
0
0
null
null
null
null
UTF-8
Java
false
false
1,406
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.sigma.codaclient.common; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.util.Properties; /** * * @author clance */ public class CodaClientConfiguration { CodaClientProperties activeProfile = null; final Properties properties = new Properties(); public CodaClientConfiguration(String path) { try { final FileInputStream in = new FileInputStream(path); properties.load(in); in.close(); } catch (FileNotFoundException fe) { System.err.println("Could not read configuration from file: " + path); } catch (IOException ioe) { System.err.println("IOException encountered while reading from " + path); } String activeProfileName = properties.getProperty("active_configuration",""); activeProfile = new CodaClientProperties(properties, activeProfileName); } public CodaClientProperties getActiveProfile() { return activeProfile; } public void setActiveProfile(String profileName) { activeProfile = getProfile(profileName); } public CodaClientProperties getProfile(String profileName) { return new CodaClientProperties(properties, profileName); } }
[ "climber2039@gmail.com" ]
climber2039@gmail.com
da93ecf58f36e5902373c068adef0a33d50d3f94
c9c6cfb8c8279c6a6b3593c7926ed20ed2a76b7e
/LargeSystemsMiniProject - Client/src/main/java/sample/Controllers/CountryEditDialogController.java
8dc099e88de269e0a990d0ee54fb4196c1fb5a3a
[]
no_license
Feylin/MiniProject_KlausAndresen
8ca482a735eb37c763843afb66b9a58cd6be91d4
452f0fc4343d1a5a370dd27006a1d4821e8b5c7d
refs/heads/master
2021-01-13T02:03:57.541480
2015-05-28T15:30:44
2015-05-28T15:30:44
35,938,057
0
0
null
null
null
null
UTF-8
Java
false
false
4,986
java
package sample.Controllers; import javafx.collections.ObservableList; import javafx.fxml.FXML; import javafx.scene.control.Alert; import javafx.scene.control.TextField; import javafx.scene.input.KeyCode; import javafx.scene.input.KeyEvent; import javafx.stage.Stage; import sample.Main; import sample.Model.Country; import java.util.Collections; import java.util.HashMap; /** * Created by Administrator on 20-05-2015. */ public class CountryEditDialogController { @FXML private TextField txtName; @FXML private TextField txtAlpha2; @FXML private TextField txtAlpha3; @FXML private TextField txtCurrency; private Stage dialogStage; private Country country; private boolean okClicked = false; private boolean isInputValid = false; private Main mainApplication; private HashMap<String, String[]> countryMap; /** * Initializes the controller class. This method is automatically called * after the fxml file has been loaded. */ @FXML private void initialize() { } /** * Sets the stage of this dialog. * @param dialogStage */ public void setDialogStage(Stage dialogStage) { this.dialogStage = dialogStage; } /** * Is called by the main application to give a reference back to itself. * @param mainApplication main stage. */ public void setMainApplication(Main mainApplication) { this.mainApplication = mainApplication; this.countryMap = mainApplication.getCountryMap(); } /** * Sets the country to be edited in the dialog * @param country the country object */ public void setCountry(Country country) { this.country = country; txtName.setText(country.getName()); txtAlpha2.setText(country.getAlpha2Code()); txtAlpha3.setText(country.getAlpha3Code()); txtCurrency.setText(country.getCurrency()); } /** * Method to check if ok has been clicked * @return true if the user clicked OK, false otherwise */ public boolean isOkClicked() { return okClicked; } /** * Called when the user clicks ok. */ @FXML private void btnOkClicked() { if (mainApplication.getCountryData().stream().anyMatch(c -> c.getName().equals(txtName.getText().trim()))) { // Country already exists. showError("Already exists", "Country already exists.", "Please enter a country that does not exist."); } else if (isInputValid) { country.setName(txtName.getText().trim()); country.setAlpha2Code(txtAlpha2.getText().trim()); country.setAlpha3Code(txtAlpha3.getText().trim()); country.setCurrency(txtCurrency.getText().trim()); okClicked = true; dialogStage.close(); } else { // Invalid country. showError("Invalid country", "Country is not valid.", "Please enter a country that actually exists."); } } private void showError(String title, String header, String content) { Alert alert = new Alert(Alert.AlertType.WARNING); alert.initOwner(mainApplication.getPrimaryStage()); alert.setTitle(title); alert.setHeaderText(header); alert.setContentText(content); alert.showAndWait(); } /** * Called when the user clicks cancel */ @FXML private void btnCancelClicked() { dialogStage.close(); } @FXML private void handleCountryNameInput(KeyEvent event) { String s = txtName.getText(); try { if (event.getCode() == KeyCode.BACK_SPACE) s = s.substring(0, s.length() - 1); else s += event.getText(); if (countryMap.keySet().contains(s)) { isInputValid = true; txtAlpha2.setText(countryMap.get(s)[0]); // Alpha2 txtAlpha3.setText(countryMap.get(s)[1]); // Alpha3 txtCurrency.setText(countryMap.get(s)[2]); // Currency removeRed(txtName); removeRed(txtAlpha2); removeRed(txtAlpha3); removeRed(txtCurrency); } else { setRed(txtName); txtAlpha2.setText(""); txtAlpha3.setText(""); txtCurrency.setText(""); setRed(txtAlpha2); setRed(txtAlpha3); setRed(txtCurrency); } } catch (StringIndexOutOfBoundsException | NullPointerException ignored) { } } private void setRed(TextField tf) { ObservableList<String> styleClass = tf.getStyleClass(); if(!styleClass.contains("tferror")) { styleClass.add("tferror"); } } private void removeRed(TextField tf) { ObservableList<String> styleClass = tf.getStyleClass(); styleClass.removeAll(Collections.singleton("tferror")); } }
[ "spoler99@msn.com" ]
spoler99@msn.com
37167db516f259ffea65cb16a7f8353c1d392c30
ed4c004c5b900700c1e4e177ad40b301181f58b8
/app/src/main/java/com/xtdar/app/receiver/MyReceiver.java
49d93ee326e0ef98901c68b13b1b3d23b39bc330
[]
no_license
sengeiou/TaiGo
9ba2708395bb417691743935de2bcf3493804ab9
24ccae70645163617eb1ea1749f41458a6a5b94f
refs/heads/master
2022-04-28T01:40:14.690477
2018-10-31T08:38:44
2018-10-31T08:38:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,057
java
package com.xtdar.app.receiver; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.text.TextUtils; import com.xtdar.app.common.NLog; import com.xtdar.app.server.broadcast.BroadcastManager; import com.xtdar.app.view.activity.LoginActivity; import com.xtdar.app.view.activity.Main2Activity; import org.json.JSONException; import org.json.JSONObject; import java.util.Iterator; import cn.jpush.android.api.JPushInterface; import static com.xtdar.app.presenter.MinePresenter.UPDATEUNREAD; /** * 自定义接收器 * * 如果不定义这个 Receiver,则: * 1) 默认用户会打开主界面 * 2) 接收不到自定义消息 */ public class MyReceiver extends BroadcastReceiver { private static final String TAG = "JIGUANG-Example"; @Override public void onReceive(Context context, Intent intent) { try { Bundle bundle = intent.getExtras(); NLog.d(TAG, "[MyReceiver] onReceive - " + intent.getAction() + ", extras: " + printBundle(bundle)); if (JPushInterface.ACTION_REGISTRATION_ID.equals(intent.getAction())) { String regId = bundle.getString(JPushInterface.EXTRA_REGISTRATION_ID); NLog.d(TAG, "[MyReceiver] 接收Registration Id : " + regId); //send the Registration Id to your server... } else if (JPushInterface.ACTION_MESSAGE_RECEIVED.equals(intent.getAction())) { NLog.d(TAG, "[MyReceiver] 接收到推送下来的自定义消息: " + bundle.getString(JPushInterface.EXTRA_MESSAGE)); processCustomMessage(context, bundle); } else if (JPushInterface.ACTION_NOTIFICATION_RECEIVED.equals(intent.getAction())) { NLog.d(TAG, "[MyReceiver] 接收到推送下来的通知"); int notifactionId = bundle.getInt(JPushInterface.EXTRA_NOTIFICATION_ID); NLog.d(TAG, "[MyReceiver] 接收到推送下来的通知的ID: " + notifactionId); BroadcastManager.getInstance(context).sendBroadcast(UPDATEUNREAD,"updateUnread"); } else if (JPushInterface.ACTION_NOTIFICATION_OPENED.equals(intent.getAction())) { NLog.d(TAG, "[MyReceiver] 用户点击打开了通知"); //打开自定义的Activity Intent i = new Intent(context, Main2Activity.class); i.putExtras(bundle); //i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP ); context.startActivity(i); } else if (JPushInterface.ACTION_RICHPUSH_CALLBACK.equals(intent.getAction())) { NLog.d(TAG, "[MyReceiver] 用户收到到RICH PUSH CALLBACK: " + bundle.getString(JPushInterface.EXTRA_EXTRA)); //在这里根据 JPushInterface.EXTRA_EXTRA 的内容处理代码,比如打开新的Activity, 打开一个网页等.. } else if(JPushInterface.ACTION_CONNECTION_CHANGE.equals(intent.getAction())) { boolean connected = intent.getBooleanExtra(JPushInterface.EXTRA_CONNECTION_CHANGE, false); NLog.w(TAG, "[MyReceiver]" + intent.getAction() +" icon_connected state change to "+connected); } else { NLog.d(TAG, "[MyReceiver] Unhandled intent - " + intent.getAction()); } } catch (Exception e){ } } // 打印所有的 intent extra 数据 private static String printBundle(Bundle bundle) { StringBuilder sb = new StringBuilder(); for (String key : bundle.keySet()) { if (key.equals(JPushInterface.EXTRA_NOTIFICATION_ID)) { sb.append("\nkey:" + key + ", value:" + bundle.getInt(key)); }else if(key.equals(JPushInterface.EXTRA_CONNECTION_CHANGE)){ sb.append("\nkey:" + key + ", value:" + bundle.getBoolean(key)); } else if (key.equals(JPushInterface.EXTRA_EXTRA)) { if (TextUtils.isEmpty(bundle.getString(JPushInterface.EXTRA_EXTRA))) { NLog.i(TAG, "This message has no Extra data"); continue; } try { JSONObject json = new JSONObject(bundle.getString(JPushInterface.EXTRA_EXTRA)); Iterator<String> it = json.keys(); while (it.hasNext()) { String myKey = it.next().toString(); sb.append("\nkey:" + key + ", value: [" + myKey + " - " +json.optString(myKey) + "]"); } } catch (JSONException e) { NLog.d(TAG, "Get message extra JSON error!"); } } else { sb.append("\nkey:" + key + ", value:" + bundle.getString(key)); } } return sb.toString(); } //send msg to MainActivity private void processCustomMessage(Context context, Bundle bundle) { // if (MainActivity.isForeground) { // String message = bundle.getString(JPushInterface.EXTRA_MESSAGE); // String extras = bundle.getString(JPushInterface.EXTRA_EXTRA); // Intent msgIntent = new Intent(MainActivity.MESSAGE_RECEIVED_ACTION); // msgIntent.putExtra(MainActivity.KEY_MESSAGE, message); // if (!ExampleUtil.isEmpty(extras)) { // try { // JSONObject extraJson = new JSONObject(extras); // if (extraJson.length() > 0) { // msgIntent.putExtra(MainActivity.KEY_EXTRAS, extras); // } // } catch (JSONException e) { // // } // // } // LocalBroadcastManager.getInstance(context).sendBroadcast(msgIntent); // } } }
[ "qq41335373@gmail.com" ]
qq41335373@gmail.com
a278396a231a2ea86f899bbaedb815da1fc367a2
5bd8b086cd806ece123da4bbb2a653ccc0871c61
/app/src/main/java/xyz/edgarzavala/youtubeexoplayer/dialogues/Dialogues.java
4e8c4acca92d5a0434666da35e9f91fdb1104ccd
[ "MIT" ]
permissive
zace3d/YTExoPlayer
6c3e2d6d17f4c6affa59b3a651296c8162a12cb7
0ae2c9069b603450b645e1687a52808f9e847c7b
refs/heads/master
2020-12-24T11:46:46.490736
2016-11-06T18:52:23
2016-11-06T18:52:23
73,010,655
1
0
null
null
null
null
UTF-8
Java
false
false
1,006
java
package xyz.edgarzavala.youtubeexoplayer.dialogues; import android.content.Context; import android.util.Log; import android.widget.Toast; import xyz.edgarzavala.youtubeexoplayer.BuildConfig; public class Dialogues { private static Toast toast; public static void Toast(Context context, String text, int duration) { if (toast != null) toast.cancel(); toast = Toast.makeText(context, text, duration); toast.show(); } public static void Log(String tag, String text, int type) { if (BuildConfig.DEBUG) { if (type == Log.DEBUG) { Log.d(tag, text + ""); } else if (type == Log.ERROR) { Log.e(tag, text + ""); } else if (type == Log.INFO) { Log.i(tag, text + ""); } else if (type == Log.VERBOSE) { Log.v(tag, text + ""); } else if (type == Log.WARN) { Log.w(tag, text + ""); } } } }
[ "ed.zace90@gmail.com" ]
ed.zace90@gmail.com
d10284d4535ba57d9a56d0d0a94bb2d7c29a8aa3
6652c5c464617298417da2c0f2e83a83d926f45a
/JiShuanJi/app/src/main/java/com/example/zz/jishuanji/MainActivity.java
a7d423807fb44eddecd95a1e61eeafa67283758f
[]
no_license
2502089568/androidViewProject
6cdb59af83663dc9ec85e92f8a5757577ea6546e
b22f7aa2acbc086bc683a1bff7305b5182f78b8d
refs/heads/master
2020-03-19T02:59:35.987924
2018-03-17T06:57:55
2018-03-17T06:57:55
135,683,542
0
0
null
null
null
null
UTF-8
Java
false
false
6,038
java
package com.example.zz.jishuanji; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.EditText; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } EditText et_input = (EditText)findViewById(R.id.et_input); String str =et_input.getText().toString(); boolean clear_flag;//清空标识 public void one(View view){ if(clear_flag){ str=""; clear_flag =false; et_input.setText(""); } et_input.setText("1"); } public void two(View view){ if(clear_flag){ str=""; clear_flag =false; et_input.setText(""); } et_input.setText("2"); } public void three(View view){ if(clear_flag){ str=""; clear_flag =false; et_input.setText(""); } et_input.setText("3"); } public void four(View view){ if(clear_flag){ str=""; clear_flag =false; et_input.setText(""); } et_input.setText("4"); } public void five(View view){ if(clear_flag){ str=""; clear_flag =false; et_input.setText(""); } et_input.setText("5"); } public void six(View view){ if(clear_flag){ str=""; clear_flag =false; et_input.setText(""); } et_input.setText("6"); } public void seven(View view){ if(clear_flag){ str=""; clear_flag =false; et_input.setText(""); } et_input.setText("7"); } public void eight(View view){ if(clear_flag){ str=""; clear_flag =false; et_input.setText(""); } et_input.setText("8"); } public void nine(View view){ if(clear_flag){ str=""; clear_flag =false; et_input.setText(""); } et_input.setText("9"); } public void point(View view){ if(clear_flag){ str=""; clear_flag =false; et_input.setText(""); } et_input.setText(str+"."); } public void plus(View view){ if(clear_flag){ str=""; clear_flag =false; et_input.setText(""); } et_input.setText(str+" "+"+"+" "); } public void minus(View view){ if(clear_flag){ str=""; clear_flag =false; et_input.setText(""); } et_input.setText(str+" "+"-"+" "); } public void multiply(View view){ if(clear_flag){ str=""; clear_flag =false; et_input.setText(""); } et_input.setText(str+" "+"*"+" "); } public void divide(View view){ if(clear_flag){ str=""; clear_flag =false; et_input.setText(""); } et_input.setText(str+" "+"/"+" "); } public void clear(View view){ clear_flag =false; str=""; et_input.setText(""); } public void del(View view){ if(clear_flag){ str=""; clear_flag =false; et_input.setText(""); }else if(str!=null&&!str.equals("")){ et_input.setText(str.substring(0,str.length()-1)); } } public void equal(View view){ getResult(); } private void getResult(){ String exp = et_input.getText().toString(); if(exp==null||exp.equals("")){ return; } if(!exp.contains(" ")){ return; } if(clear_flag){ clear_flag = false; return; } clear_flag = true; double result =0; String s1 = exp.substring(0,exp.indexOf(" "));//运算符前面的字符 String op = exp.substring(exp.indexOf(" ")+1,exp.indexOf(" "));//运算符 String s2 = exp.substring(exp.indexOf(" ")+3);// 运算符后面的字符 if(!s1.equals("")&&!s2.equals("")){ double d1 = Double.parseDouble(s1); double d2 = Double.parseDouble(s2); if(op.equals("+")){ result = d1+d2; } if(op.equals("-")){ result = d1-d2; } if(op.equals("*")){ result = d1*d2; } if(op.equals("/")) { if (d2 == 0) { result = 0; } else { result = d1 / d2; } if (!s1.contains(".") && !s2.contains(".")&&!op.equals("/")) { int r = (int) result; et_input.setText(r + ""); } else { et_input.setText(result + ""); } } else if(!s1.equals("")&&s2.equals("")){ et_input.setText(exp); } else if(s1.equals("")&&!s2.equals("")){ if(op.equals("+")){ result = 0+d2; } if(op.equals("-")){ result = 0-d2; } if(op.equals("*")){ result = 0*d2; } if(op.equals("/")) { result = 0; } if (!s1.contains(".") && !s2.contains(".")) { int r = (int) result; et_input.setText(r + ""); } else { et_input.setText(result + ""); } } else { et_input.setText(""); } } } } }
[ "1508950473@qq.com" ]
1508950473@qq.com
1d2af53676b3565f680125ab878b16dca114c6ba
4364cd6916e3e5cd8caab5e2fdcdb420eda4e86b
/library/src/main/java/androgeek/material/library/MaterialMusicPlayerView.java
968a48da07bd9488ee80e88a7ed0a2c5d94d8a85
[]
no_license
colopreda/Tp-Taller2-Android
37b5302c841de60951cc2a6baacf55b114703230
cf071133ea372c33f95180becae01c307e7be06b
refs/heads/develop
2021-01-19T05:22:44.999408
2017-06-25T20:46:17
2017-06-25T20:46:17
87,429,203
0
0
null
2017-06-25T20:46:18
2017-04-06T12:53:41
Java
UTF-8
Java
false
false
21,488
java
package androgeek.material.library; import android.content.Context; import android.content.res.TypedArray; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.BitmapShader; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Matrix; import android.graphics.Paint; import android.graphics.Rect; import android.graphics.RectF; import android.graphics.Region; import android.graphics.Shader; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.os.Handler; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; import com.squareup.picasso.Picasso; import com.squareup.picasso.Target; /** * Created by Amin Ghabi on 12/07/15. */ public class MaterialMusicPlayerView extends View { private Rect mRectText; /** * Paint for drawing left and passed time. */ private Paint mPaintTime; /** * RectF for draw circle progress. */ private RectF rectF; /** * Paint for circle progress left */ private Paint mPaintProgressEmpty; /** * Paint for circle progress loaded */ private Paint mPaintProgressLoaded; /** * Modified OnClickListener. We do not want all view click. * notify onClick() only button area touched. */ private OnClickListener onClickListener; /** * Button paint for play/pause control button */ private Paint mPaintButton; /** * Play/Pause button region for handle onTouch */ private Region mButtonRegion; /** * Play icon will be converted to Bitmap */ private Bitmap mBitmapPlay; /** * Pause icon will be converted to Bitmap */ private Bitmap mBitmapPause; /** * Paint for drawing play/pause icons to canvas. */ private Paint mPaintPlayPause; /** * Paint to draw cover photo to canvas */ private Paint mPaintCover; /** * Bitmap for shader. */ private Bitmap mBitmapCover; /** * Shader for make drawable circle */ private BitmapShader mShader; /** * Scale image to view width/height */ private float mCoverScale; /** * Image Height and Width values. */ private int mHeight; private int mWidth; /** * Center values for cover image. */ private float mCenterX; private float mCenterY; /** * Cover image is rotating. That is why we hold that value. */ private int mRotateDegrees; /** * Handler for posting runnable object */ private Handler mHandlerRotate; /** * Runnable for turning image (default velocity is 10) */ private Runnable mRunnableRotate; /** * Handler for posting runnable object */ private Handler mHandlerProgress; /** * Runnable for turning image (default velocity is 10) */ private Runnable mRunnableProgress; /** * isRotating */ private boolean isRotating; /** * Handler will post runnable object every @ROTATE_DELAY seconds. */ private static int ROTATE_DELAY = 10; /** * 1 sn = 1000 ms */ private static int PROGRESS_SECOND_MS = 1000; /** * mRotateDegrees count increase 1 by 1 default. * I used that parameter as velocity. */ private static int VELOCITY = 1; /** * Default color code for cover */ private int mCoverColor = Color.GRAY; /** * Play/Pause button radius.(default = 120) */ private float mButtonRadius = 120f; /** * Play/Pause button color(Default = dark gray) */ private int mButtonColor = Color.DKGRAY; /** * Color code for progress left. */ private int mProgressEmptyColor = 0x20FFFFFF; /** * Color code for progress loaded. */ private int mProgressLoadedColor = 0xFF00815E; /** * Time text size */ private int mTextSize = 40; /** * Default text color */ private int mTextColor = 0xFFFFFFFF; /** * Current progress value */ private int currentProgress = 0; /** * Max progress value */ private int maxProgress = 100; /** * Auto progress value start progressing when * cover image start rotating. */ private boolean isAutoProgress = true; /** * Progressview and time will be visible/invisible depends on this */ private boolean mProgressVisibility = true; /** * Constructor * * @param context */ public MaterialMusicPlayerView(Context context) { super(context); init(context, null); } /** * Constructor * * @param context * @param attrs */ public MaterialMusicPlayerView(Context context, AttributeSet attrs) { super(context, attrs); init(context, attrs); } /** * Constructor * * @param context * @param attrs * @param defStyleAttr */ public MaterialMusicPlayerView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); init(context, attrs); } /** * Constructor * * @param context * @param attrs * @param defStyleAttr * @param defStyleRes */ public MaterialMusicPlayerView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { super(context, attrs, defStyleAttr, defStyleRes); init(context, attrs); } /** * Initializes resource values, create objects which we need them later. * Object creation must not called onDraw() method, otherwise it won't be * smooth. * * @param context * @param attrs */ private void init(Context context, AttributeSet attrs) { //Get Image resource from xml TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.playerview); Drawable mDrawableCover = a.getDrawable(R.styleable.playerview_cover); if (mDrawableCover != null) mBitmapCover = drawableToBitmap(mDrawableCover); mButtonColor = a.getColor(R.styleable.playerview_buttonColor, mButtonColor); mProgressEmptyColor = a.getColor(R.styleable.playerview_progressEmptyColor, mProgressEmptyColor); mProgressLoadedColor = a.getColor(R.styleable.playerview_progressLoadedColor, mProgressLoadedColor); mTextColor = a.getColor(R.styleable.playerview_textColor, mTextColor); mTextSize = a.getDimensionPixelSize(R.styleable.playerview_textSize, mTextSize); a.recycle(); mRotateDegrees = 0; //Handler and Runnable object for turn cover image by updating rotation degrees mHandlerRotate = new Handler(); mRunnableRotate = new Runnable() { @Override public void run() { if (isRotating) { if(currentProgress > maxProgress){ currentProgress = 0; setProgress(currentProgress); stop(); } updateCoverRotate(); mHandlerRotate.postDelayed(mRunnableRotate, ROTATE_DELAY); } } }; //Handler and Runnable object for progressing. mHandlerProgress = new Handler(); mRunnableProgress = new Runnable() { @Override public void run() { if(isRotating){ currentProgress += 1; mHandlerProgress.postDelayed(mRunnableProgress, PROGRESS_SECOND_MS); } } }; //Play/Pause button circle paint mPaintButton = new Paint(); mPaintButton.setAntiAlias(true); mPaintButton.setStyle(Paint.Style.FILL); mPaintButton.setColor(mButtonColor); //Play/Pause button icons paint and bitmaps mPaintPlayPause = new Paint(); mPaintPlayPause.setAntiAlias(true); mBitmapPlay = BitmapFactory.decodeResource(getResources(), R.drawable.icon_play); mBitmapPause = BitmapFactory.decodeResource(getResources(), R.drawable.icon_pause); //Progress paint object creation mPaintProgressEmpty = new Paint(); mPaintProgressEmpty.setAntiAlias(true); mPaintProgressEmpty.setColor(mProgressEmptyColor); mPaintProgressEmpty.setStyle(Paint.Style.STROKE); mPaintProgressEmpty.setStrokeWidth(12.0f); mPaintProgressLoaded = new Paint(); mPaintProgressEmpty.setAntiAlias(true); mPaintProgressLoaded.setColor(mProgressLoadedColor); mPaintProgressLoaded.setStyle(Paint.Style.STROKE); mPaintProgressLoaded.setStrokeWidth(12.0f); mPaintTime = new Paint(); mPaintTime.setColor(mTextColor); mPaintTime.setAntiAlias(true); mPaintTime.setTextSize(mTextSize); //rectF and rect initializes rectF = new RectF(); mRectText = new Rect(); } /** * Calculate mWidth, mHeight, mCenterX, mCenterY values and * scale resource bitmap. Create shader. This is not called multiple times. * * @param widthMeasureSpec * @param heightMeasureSpec */ @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { mWidth = MeasureSpec.getSize(widthMeasureSpec); mHeight = MeasureSpec.getSize(heightMeasureSpec); int minSide = Math.min(mWidth,mHeight); mWidth = minSide; mHeight = minSide; this.setMeasuredDimension(mWidth, mHeight); mCenterX = mWidth / 2f; mCenterY = mHeight / 2f; //set RectF left, top, right, bottom coordiantes rectF.set(20.0f, 20.0f, mWidth - 20.0f, mHeight - 20.0f); //button size is about to 1/4 of image size then we divide it to 8. mButtonRadius = mWidth / 8.0f; //We resize icons with button radius. icons need to be inside circle. mBitmapPlay = getResizedBitmap(mBitmapPlay, mButtonRadius - 20.0f, mButtonRadius - 20.0f); mBitmapPause = getResizedBitmap(mBitmapPause, mButtonRadius - 20.0f, mButtonRadius - 20.0f); mButtonRegion = new Region((int) (mCenterX - mButtonRadius), (int) (mCenterY - mButtonRadius), (int) (mCenterX + mButtonRadius), (int) (mCenterY + mButtonRadius)); createShader(); super.onMeasure(widthMeasureSpec, heightMeasureSpec); } /** * This is where magic happens as you know. * * @param canvas */ @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); if (mShader == null) return; //Draw cover image float radius = mCenterX <= mCenterY ? mCenterX - 75.0f: mCenterY - 75.0f; canvas.rotate(mRotateDegrees, mCenterX, mCenterY); canvas.drawCircle(mCenterX, mCenterY, radius, mPaintCover); //Rotate back to make play/pause button stable(No turn) canvas.rotate(-mRotateDegrees, mCenterX, mCenterY); //Draw Play/Pause button canvas.drawCircle(mCenterX, mCenterY, mButtonRadius, mPaintButton); canvas.drawBitmap(isRotating() ? mBitmapPause : mBitmapPlay, mCenterX - mBitmapPause.getWidth() / 2f, mCenterY - mBitmapPause.getHeight() / 2f, mPaintPlayPause); if(mProgressVisibility){ //Draw empty progress canvas.drawArc(rectF, 145, 250, false, mPaintProgressEmpty); //Draw loaded progress canvas.drawArc(rectF, 145, calculatePastProgressDegree(), false, mPaintProgressLoaded); //Draw left time text String leftTime = secondsToTime(calculateLeftSeconds()); mPaintTime.getTextBounds(leftTime, 0, leftTime.length(), mRectText); canvas.drawText(leftTime, (float) (mCenterX * Math.cos(Math.toRadians(35.0))) + mWidth / 2.0f - mRectText.width() / 1.5f, (float) (mCenterX * Math.sin(Math.toRadians(35.0))) + mHeight / 2.0f + mRectText.height() + 15.0f, mPaintTime); //Draw passed time text String passedTime = secondsToTime(calculatePassedSeconds()); mPaintTime.getTextBounds(passedTime, 0, passedTime.length(), mRectText); canvas.drawText(passedTime, (float) (mCenterX * -Math.cos(Math.toRadians(35.0))) + mWidth / 2.0f - mRectText.width() / 3.0f, (float) (mCenterX * Math.sin(Math.toRadians(35.0))) + mHeight / 2.0f + mRectText.height() + 15.0f, mPaintTime); } } /** * We need to convert drawable (which we get from attributes) to bitmap * to prepare if for BitmapShader * * @param drawable * @return */ private Bitmap drawableToBitmap(Drawable drawable) { if (drawable instanceof BitmapDrawable) { return ((BitmapDrawable) drawable).getBitmap(); } int width = drawable.getIntrinsicWidth(); width = width > 0 ? width : 1; int height = drawable.getIntrinsicHeight(); height = height > 0 ? height : 1; Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(bitmap); drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight()); drawable.draw(canvas); return bitmap; } /** * Create shader and set shader to mPaintCover */ private void createShader() { if (mWidth == 0) return; //if mBitmapCover is null then create default colored cover if (mBitmapCover == null) { mBitmapCover = Bitmap.createBitmap(mWidth, mHeight, Bitmap.Config.ARGB_8888); mBitmapCover.eraseColor(mCoverColor); } mCoverScale = ((float) mWidth) / (float) mBitmapCover.getWidth(); mBitmapCover = Bitmap.createScaledBitmap(mBitmapCover, (int) (mBitmapCover.getWidth() * mCoverScale), (int) (mBitmapCover.getHeight() * mCoverScale), true); mShader = new BitmapShader(mBitmapCover, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP); mPaintCover = new Paint(); mPaintCover.setAntiAlias(true); mPaintCover.setShader(mShader); } /** * Update rotate degree of cover and invalide onDraw(); */ public void updateCoverRotate() { mRotateDegrees += VELOCITY; mRotateDegrees = mRotateDegrees % 360; postInvalidate(); } /** * Checks is rotating * * @return */ public boolean isRotating() { return isRotating; } /** * Start turning image */ public void start() { isRotating = true; mHandlerRotate.removeCallbacksAndMessages(null); mHandlerRotate.postDelayed(mRunnableRotate, ROTATE_DELAY); if(isAutoProgress){ mHandlerProgress.removeCallbacksAndMessages(null); mHandlerProgress.postDelayed(mRunnableProgress, PROGRESS_SECOND_MS); } } /** * Stop turning image */ public void stop() { isRotating = false; } /** * Set velocity.When updateCoverRotate() method called, * increase degree by velocity value. * * @param velocity */ public void setVelocity(int velocity) { if (velocity > 0) VELOCITY = velocity; } /** * set cover image resource * * @param coverDrawable */ public void setCoverDrawable(int coverDrawable) { Drawable drawable = getContext().getDrawable(coverDrawable); mBitmapCover = drawableToBitmap(drawable); createShader(); postInvalidate(); } /** * gets image URL and load it to cover image.It uses Picasso Library. * * @param imageUrl */ public void setCoverURL(String imageUrl) { Picasso.with(getContext()).load(imageUrl).into(target); } /** * When picasso load into target. Overrider methods are called. * Invalidate view onBitmapLoaded. */ private Target target = new Target() { @Override public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) { mBitmapCover = bitmap; createShader(); postInvalidate(); } @Override public void onBitmapFailed(Drawable errorDrawable) { } @Override public void onPrepareLoad(Drawable placeHolderDrawable) { } }; /** * This is detect when mButtonRegion is clicked. Which means * play/pause action happened. * * @param event * @return */ @Override public boolean onTouchEvent(MotionEvent event) { float x = event.getX(); float y = event.getY(); switch (event.getAction()) { case MotionEvent.ACTION_DOWN: { return true; } case MotionEvent.ACTION_UP: { if (mButtonRegion.contains((int) x, (int) y)) { if (onClickListener != null) onClickListener.onClick(this); } } break; } return super.onTouchEvent(event); } /** * onClickListener.onClick will be called when button clicked. * We dont want all view click. We only want button area click. * That is why we override it. * * @param l */ @Override public void setOnClickListener(OnClickListener l) { onClickListener = l; } /** * Resize bitmap with @newHeight and @newWidth parameters * * @param bm * @param newHeight * @param newWidth * @return */ private Bitmap getResizedBitmap(Bitmap bm, float newHeight, float newWidth) { int width = bm.getWidth(); int height = bm.getHeight(); float scaleWidth = ((float) newWidth) / width; float scaleHeight = ((float) newHeight) / height; Matrix matrix = new Matrix(); matrix.postScale(scaleWidth, scaleHeight); Bitmap resizedBitmap = Bitmap.createBitmap(bm, 0, 0, width, height, matrix, false); return resizedBitmap; } /** * Sets button color * * @param color */ public void setButtonColor(int color) { mButtonColor = color; mPaintButton.setColor(mButtonColor); postInvalidate(); } /** * sets progress empty color * @param color */ public void setProgressEmptyColor(int color){ mProgressEmptyColor = color; mPaintProgressEmpty.setColor(mProgressEmptyColor); postInvalidate(); } /** * sets progress loaded color * @param color */ public void setProgressLoadedColor(int color){ mProgressLoadedColor = color; mPaintProgressLoaded.setColor(mProgressLoadedColor); postInvalidate(); } /** * Sets total seconds of music * @param maxProgress */ public void setMax(int maxProgress){ this.maxProgress = maxProgress; postInvalidate(); } /** * Sets current seconds of music * @param currentProgress */ public void setProgress(int currentProgress){ if(0 <= currentProgress && currentProgress<= maxProgress){ this.currentProgress = currentProgress; postInvalidate(); } } /** * Get current progress seconds * @return */ public int getProgress(){ return currentProgress; } /** * Calculate left seconds * @return */ private int calculateLeftSeconds(){ return maxProgress - currentProgress; } /** * Return passed seconds * @return */ private int calculatePassedSeconds(){ return currentProgress; } /** * Convert seconds to time * @param seconds * @return */ private String secondsToTime(int seconds){ String time = ""; String minutesText = String.valueOf(seconds / 60); if(minutesText.length() == 1) minutesText = "0" + minutesText; String secondsText = String.valueOf(seconds % 60); if(secondsText.length() == 1) secondsText = "0" + secondsText; time = minutesText + ":" + secondsText; return time; } /** * Calculate passed progress degree * @return */ private int calculatePastProgressDegree(){ return (250 * currentProgress) / maxProgress; } /** * If you do not want to automatic progress, you can disable it * and implement your own handler by using setProgress method repeatedly. * @param isAutoProgress */ public void setAutoProgress(boolean isAutoProgress){ this.isAutoProgress = isAutoProgress; } /** * Sets time text color * @param color */ public void setTimeColor(int color){ mTextColor = color; mPaintTime.setColor(mTextColor); postInvalidate(); } public void setProgressVisibility(boolean mProgressVisibility){ this.mProgressVisibility = mProgressVisibility; postInvalidate(); } }
[ "apredazzi@gmail.com" ]
apredazzi@gmail.com
fda3c1117227e2294ac172c316b1d876171ad8d1
0fd6874b12c57e4d0945013d2024c0d446442d46
/src/main/java/com/ebxps/cadif/tabletrigger/CadiBatchIdTableTrigger.java
58a62557be6664ea25d5aff3eac7481174e2b3fd
[]
no_license
KinshukON/ebxps-cadif
097ac5ad491ca9876e75a22f5ec6948b376ecc5d
4d7b5f5943611334cf55638e71b353d53c0d185e
refs/heads/master
2020-04-12T22:03:31.486444
2018-12-22T04:11:25
2018-12-22T04:11:25
162,780,185
0
0
null
null
null
null
UTF-8
Java
false
false
2,963
java
package com.ebxps.cadif.tabletrigger; import com.ebxps.cadif.adpatation.CadiRepository; import com.ebxps.cadif.process.ImportDefinitionManager; import com.onwbp.org.apache.log4j.Category; import com.orchestranetworks.schema.Path; import com.orchestranetworks.schema.PathAccessException; import com.orchestranetworks.schema.SchemaNode; import com.orchestranetworks.schema.trigger.BeforeCreateOccurrenceContext; import com.orchestranetworks.schema.trigger.BeforeModifyOccurrenceContext; import com.orchestranetworks.schema.trigger.TableTrigger; import com.orchestranetworks.schema.trigger.TableTriggerExecutionContext; import com.orchestranetworks.schema.trigger.TriggerSetupContext; import com.orchestranetworks.service.OperationException; /** * This table trigger is attached to tables that will receive data from a CADI import, where * the table supports the use of batch id's.</br> * The table trigger reads the value from the tracking info an populates the field named in the parameter * with the value found in the CADI{xxxxxx} tacking info pattern, where xxxxxx is the batch id. * * @author Craig Cox - Orchestra Networks 2017 * */ public class CadiBatchIdTableTrigger extends TableTrigger { private String tableBatchIdField; public String getTableBatchIdField() { return tableBatchIdField; } public void setTableBatchIdField(String tableBatchIdField) { this.tableBatchIdField = tableBatchIdField; } @Override public void handleBeforeCreate(BeforeCreateOccurrenceContext aContext) throws OperationException { String batchid = (String) aContext.getOccurrenceContext().getValue(Path.parse(tableBatchIdField)); if (batchid == null || batchid.isEmpty()){ String ti = getTrackingInfo(aContext); if (ti != null){ aContext.getOccurrenceContextForUpdate().setValue(getTrackingInfo(aContext), Path.parse(tableBatchIdField)); } } } @Override public void handleBeforeModify(BeforeModifyOccurrenceContext aContext) throws OperationException { String ti = getTrackingInfo(aContext); if (ti != null){ aContext.getOccurrenceContextForUpdate().setValue(getTrackingInfo(aContext), Path.parse(tableBatchIdField)); } } private String getTrackingInfo(TableTriggerExecutionContext aContext){ String ti = aContext.getSession().getTrackingInfo(); if (ti == null){ return null; } int start = ti.indexOf(ImportDefinitionManager.CADI_TRACKINGINFO); int end = ti.indexOf("}", start); String cadiTranckingId = ti.substring(start + ImportDefinitionManager.CADI_TRACKINGINFO.length(), end); return cadiTranckingId; } @Override public void setup(TriggerSetupContext aContext) { SchemaNode node = aContext.getSchemaNode().getNode(Path.parse(tableBatchIdField)); if (node == null){ PathAccessException e = new PathAccessException(String.format("Field [%s] does not exist in table [%s]", tableBatchIdField, aContext.getSchemaNode().getTableNode().getPathInSchema().format())); throw e; } } }
[ "kinshuk.dutta@orchestranetworks.com" ]
kinshuk.dutta@orchestranetworks.com
e7bd596373731991f9edc08e468cc0132c2b859a
4633e714c422e58db7cc78d92c2923b57d4283e0
/jkhjh.java
61ce18667b21b30ecba04236d596ffb01e67681f
[]
no_license
kavipriya2812/kavipriya1
5dc59ee05a416daefecce9ade875ec0fd846212b
37597bd31317df13a58a9c20600abd49b7e32f13
refs/heads/master
2021-01-23T10:06:21.499449
2017-09-02T14:27:43
2017-09-02T14:27:43
93,038,157
0
0
null
null
null
null
UTF-8
Java
false
false
466
java
package rrr; import java.util.Scanner; public class jkhjh { public static void main(String[] args) { int count=0; Scanner scan=new Scanner(System.in); String a=scan.nextLine(); String b=scan.nextLine(); int l=a.length(); int v=b.length(); for(int i=0;i<=l-v;i++){ if(a.substring(i,v+i).equals(b)){ System.out.println(i); } else{ count++; } } if(count==(l-v)+1){ System.out.println("-1"); } }}
[ "noreply@github.com" ]
kavipriya2812.noreply@github.com
305ba4a5d65070350c3c93b2458019c0d397fbfe
8365232271e33790914ea087fa8a39641173cf55
/src/main/java/br/com/cui/config/DateTimeFormatConfiguration.java
e6cdfef641851e82b952898e1559b5d7fdaaa44b
[]
no_license
bruno-ayres/cui
ce70958c2c3fbeb2ab4d3a20665c4b9dab894160
a22a9d3a9d766a663da29dbf08c2c69b4297c14e
refs/heads/master
2020-04-11T22:07:25.701592
2018-12-17T15:13:18
2018-12-17T15:13:18
162,125,936
0
0
null
null
null
null
UTF-8
Java
false
false
717
java
package br.com.cui.config; import org.springframework.context.annotation.Configuration; import org.springframework.format.FormatterRegistry; import org.springframework.format.datetime.standard.DateTimeFormatterRegistrar; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; /** * Configure the converters to use the ISO format for dates by default. */ @Configuration public class DateTimeFormatConfiguration implements WebMvcConfigurer { @Override public void addFormatters(FormatterRegistry registry) { DateTimeFormatterRegistrar registrar = new DateTimeFormatterRegistrar(); registrar.setUseIsoFormat(true); registrar.registerFormatters(registry); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
4c855c0acd55b15b26089403d07e3f009d3914de
ea67bddb8322fd6f10df150cfdf7d1d549cd5907
/android/src/com/ibilis/macaddress/ExampleProxy.java
3dcbd1fc6d05d6b3293e6c404c8139888d15a3d6
[ "MIT" ]
permissive
enrique26/appc-maccaddress
56fd47a197e424deb5884617d2f2539c951b76e0
296fb20a2b0fb01810cbc16f80356307ae867973
refs/heads/master
2020-04-07T13:28:14.140795
2019-03-01T16:49:03
2019-03-01T16:49:03
158,408,712
0
0
null
null
null
null
UTF-8
Java
false
false
2,878
java
/** * This file was auto-generated by the Titanium Module SDK helper for Android * Appcelerator Titanium Mobile * Copyright (c) 2009-2010 by Appcelerator, Inc. All Rights Reserved. * Licensed under the terms of the Apache Public License * Please see the LICENSE included with this distribution for details. * */ package com.ibilis.macaddress; import org.appcelerator.kroll.KrollDict; import org.appcelerator.kroll.KrollProxy; import org.appcelerator.kroll.annotations.Kroll; import org.appcelerator.titanium.TiC; import org.appcelerator.kroll.common.Log; import org.appcelerator.kroll.common.TiConfig; import org.appcelerator.titanium.util.TiConvert; import org.appcelerator.titanium.proxy.TiViewProxy; import org.appcelerator.titanium.view.TiCompositeLayout; import org.appcelerator.titanium.view.TiCompositeLayout.LayoutArrangement; import org.appcelerator.titanium.view.TiUIView; import android.app.Activity; // This proxy can be created by calling Macaddress.createExample({message: "hello world"}) @Kroll.proxy(creatableInModule=MacaddressModule.class) public class ExampleProxy extends TiViewProxy { // Standard Debugging variables private static final String LCAT = "ExampleProxy"; private static final boolean DBG = TiConfig.LOGD; private class ExampleView extends TiUIView { public ExampleView(TiViewProxy proxy) { super(proxy); LayoutArrangement arrangement = LayoutArrangement.DEFAULT; if (proxy.hasProperty(TiC.PROPERTY_LAYOUT)) { String layoutProperty = TiConvert.toString(proxy.getProperty(TiC.PROPERTY_LAYOUT)); if (layoutProperty.equals(TiC.LAYOUT_HORIZONTAL)) { arrangement = LayoutArrangement.HORIZONTAL; } else if (layoutProperty.equals(TiC.LAYOUT_VERTICAL)) { arrangement = LayoutArrangement.VERTICAL; } } setNativeView(new TiCompositeLayout(proxy.getActivity(), arrangement)); } @Override public void processProperties(KrollDict d) { super.processProperties(d); } } // Constructor public ExampleProxy() { super(); } @Override public TiUIView createView(Activity activity) { TiUIView view = new ExampleView(this); view.getLayoutParams().autoFillsHeight = true; view.getLayoutParams().autoFillsWidth = true; return view; } // Handle creation options @Override public void handleCreationDict(KrollDict options) { super.handleCreationDict(options); if (options.containsKey("message")) { Log.d(LCAT, "example created with message: " + options.get("message")); } } // Methods @Kroll.method public void printMessage(String message) { Log.d(LCAT, "printing message: " + message); } @Kroll.getProperty @Kroll.method public String getMessage() { return "Hello World from my module"; } @Kroll.setProperty @Kroll.method public void setMessage(String message) { Log.d(LCAT, "Tried setting module message to: " + message); } }
[ "enriqueibilis@gmail.com" ]
enriqueibilis@gmail.com
d64e91fa5a311254b6c3db4d1b15e43559ae987a
2f3ce449b74a7f626eb9c9342d72308ca73c4d90
/src/Latihan/NullPointerDemo.java
69bdf5aa192e402b5bdeef1410009e986d6b3cd2
[]
no_license
RickyRahmadani10/Exception
c411e7aecf71044dcea7ed2850c434e342e07c78
10559d9b2a9d4789c3dfe819ee053a4a4b635e46
refs/heads/master
2020-03-28T03:39:14.218257
2018-09-06T11:19:39
2018-09-06T11:19:39
147,612,645
0
0
null
null
null
null
UTF-8
Java
false
false
426
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 Latihan; /** * * @author WINDOWS 10 */ public class NullPointerDemo { public static void main(String[] args) { String name=null; System.out.print("Length of the string"+ name.length()); } }
[ "WINDOWS 10@WINDOWS" ]
WINDOWS 10@WINDOWS
c755087af5a63536bcb78f00c7ddcbb5e40eb041
321417e03908c58e1a4f48ab947babff7d132417
/src/edu/upc/eetac/dsa/emeyerson/beeter/android/api/StingCollection.java
2e6d975f83525e51ef7ea61db69c2c2f40bc19f8
[]
no_license
EinarMeyerson/beeter-android
a8b8ba90aa63beaecc7573e278b1e5a83d13d951
2cd6f83e0a051cd94e520975db7182ea3b7a0376
refs/heads/master
2016-09-06T17:26:50.045619
2014-05-23T10:56:32
2014-05-23T10:56:32
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,012
java
package edu.upc.eetac.dsa.emeyerson.beeter.android.api; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class StingCollection { private Map<String, Link> links = new HashMap<String, Link>(); private List<Sting> stings = new ArrayList<Sting>();; private long newestTimestamp; private long oldestTimestamp; public List<Sting> getStings() { return stings; } public void setStings(List<Sting> stings) { this.stings = stings; } public void addSting(Sting sting) { stings.add(sting); } public long getNewestTimestamp() { return newestTimestamp; } public void setNewestTimestamp(long newestTimestamp) { this.newestTimestamp = newestTimestamp; } public long getOldestTimestamp() { return oldestTimestamp; } public void setOldestTimestamp(long oldestTimestamp) { this.oldestTimestamp = oldestTimestamp; } public Map<String, Link> getLinks() { return links; } }
[ "einarnhl@hotmail.com" ]
einarnhl@hotmail.com
998c43a4964b3423d055dc1dd05f8779bda02e73
b633f4cd11497c4cbd36f8a3ab9162329ca865b0
/src/main/java/newTest/Observer.java
f6a60e4f1db351444da1a898ed65b6b71b3ced77
[]
no_license
yuan4kai/testGit
895807a3d8def8f7f7eb6c6f9532d9e28f57dbe9
00d3501f281678e504b0eecd199523027e3bf766
refs/heads/master
2020-04-03T05:23:47.555609
2018-11-18T03:28:26
2018-11-18T03:28:26
155,044,168
0
0
null
null
null
null
UTF-8
Java
false
false
131
java
package newTest; /** * Created by yk on 2017/4/9. */ public interface Observer { public void comsume(Subject subject); }
[ "23707802@qq.com" ]
23707802@qq.com
7bbd740ad596f4044550d766bc85bd064a3ec522
ac6818133abc16cd070c7c7f19a72188ec151add
/app/src/main/java/com/crossphd/cnews/Article.java
c34de5c4fb4b4214f0b3ebbc5a1bf0abf4d757bb
[]
no_license
crossphd/CNews
58f61a3f0f43d9da99ff82f3814dad6e04a256a6
6b7dccc7bb8151f2cb82b011307334a5ec2d6965
refs/heads/master
2021-05-08T11:17:04.058926
2018-03-12T18:03:19
2018-03-12T18:03:19
119,888,732
0
0
null
null
null
null
UTF-8
Java
false
false
893
java
package com.crossphd.cnews; /** * Created by chris on 1/24/2018. */ public class Article { private String mSource; private String mAuthor; private String mTitle; private String mUrl; private String mImageUrl; private String mDate; public Article(String source, String author, String title, String url, String date, String image){ mSource = source; mAuthor = author; mTitle = title; mUrl = url; mDate = date; mImageUrl = image; } public String getmSource() { return mSource; } public String getmAuthor() { return mAuthor; } public String getmTitle() { return mTitle; } public String getmUrl() { return mUrl; } public String getmDate() { return mDate; } public String getmImageUrl() { return mImageUrl; } }
[ "cross25@uis.edu" ]
cross25@uis.edu
3ae3c21edbf7296826eb5bb48caf7365e56edb5e
a25dafc4520832a3fe4f47a7109a0bb5c48cd0e9
/app/src/main/java/com/elshaikh/mano/acadunimap/SlideOMRFragment.java
475f11f5a4a5ae377873713d157ed1113581eef2
[]
no_license
AcadUni/ACADUniMAPv2
0a1aa447e7fd75838185618821259af975d8f74e
4488c8b889acba97810549f2457f6399f9e005df
refs/heads/master
2020-04-05T17:08:55.332502
2018-11-11T04:22:26
2018-11-11T04:22:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,343
java
package com.elshaikh.mano.acadunimap; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.webkit.WebView; public class SlideOMRFragment extends Fragment { /** * The fragment argument representing the section number for this * fragment. */ private static final String ARG_SECTION_NUMBER = "section_number"; public SlideOMRFragment() { } /** * Returns a new instance of this fragment for the given section * number. */ public static SlideElearningFragment newInstance(int sectionNumber) { SlideElearningFragment fragment = new SlideElearningFragment(); Bundle args = new Bundle(); args.putInt(ARG_SECTION_NUMBER, sectionNumber); fragment.setArguments(args); return fragment; } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.slideelearning, container, false); //WebView textView = (WebView) rootView.findViewById(R.id.web); //textView.setText(getString(R.string.section_format, getArguments().getInt(ARG_SECTION_NUMBER))); return rootView; } }
[ "mano@Mohameds-MacBook-Pro.local" ]
mano@Mohameds-MacBook-Pro.local
950b5952fbb0574e5f3c6d261491dbe24b5b80d1
c79772dcab46880686e7d16931360e24d3ce3eec
/src/main/java/io/moonman/emergingtechnology/proxy/CommonProxy.java
865a5bddd8a0a2b448c1126515da3d9d3bb7f4f2
[ "MIT" ]
permissive
DSSDevelopment/EmergingTechnology
5a01f7726a735b568e767a26c97c0090ad6ed276
1b1e4b87406f9e7ad326ddb4d8848d9b790948b6
refs/heads/master
2021-02-18T21:04:16.749245
2020-03-08T19:51:23
2020-03-08T19:51:23
245,236,690
0
0
MIT
2020-03-05T18:18:19
2020-03-05T18:18:18
null
UTF-8
Java
false
false
4,034
java
package io.moonman.emergingtechnology.proxy; import io.moonman.emergingtechnology.EmergingTechnology; import io.moonman.emergingtechnology.config.EmergingTechnologyConfig; import io.moonman.emergingtechnology.providers.ModBulbProvider; import io.moonman.emergingtechnology.providers.ModFluidProvider; import io.moonman.emergingtechnology.providers.ModMediumProvider; import io.moonman.emergingtechnology.providers.ModTissueProvider; import io.moonman.emergingtechnology.integration.ModLoader; import io.moonman.emergingtechnology.recipes.RecipeBuilder; import io.moonman.emergingtechnology.worldgen.OreGenerator; import io.moonman.emergingtechnology.worldgen.WorldTickHandler; import io.moonman.emergingtechnology.init.OreRegistrationHandler; import io.moonman.emergingtechnology.init.RegistrationHandler; import io.moonman.emergingtechnology.integration.crafttweaker.CraftTweakerHelper; import io.moonman.emergingtechnology.network.PacketHandler; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.crafting.IRecipe; import net.minecraft.world.World; import net.minecraftforge.client.event.ModelRegistryEvent; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.config.Configuration; import net.minecraftforge.event.RegistryEvent.Register; import net.minecraftforge.fml.common.Mod.EventBusSubscriber; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.registries.IForgeRegistryModifiable; @EventBusSubscriber(modid = EmergingTechnology.MODID) public abstract class CommonProxy { public static Configuration config; @SubscribeEvent public static void registerItems(Register<Item> event) { RegistrationHandler.registerItems(event); } @SubscribeEvent public static void registerBlocks(Register<Block> event) { RegistrationHandler.registerBlocks(event); } @SubscribeEvent public static void registerRecipes(Register<IRecipe> event) { IForgeRegistryModifiable<IRecipe> registry = (IForgeRegistryModifiable<IRecipe>) event.getRegistry(); RecipeBuilder.removeRecipes(registry); } @SideOnly(Side.CLIENT) @SubscribeEvent public static void registerModels(ModelRegistryEvent event) { RegistrationHandler.registerModels(event); } public void preInit(FMLPreInitializationEvent e) { RegistrationHandler.registerFluids(); EmergingTechnologyConfig.preInit(); ModLoader.preInit(); GameRegistry.registerWorldGenerator(OreGenerator.instance, 10); MinecraftForge.EVENT_BUS.register(OreGenerator.instance); ModBulbProvider.preInit(e); ModMediumProvider.preInit(e); ModFluidProvider.preInit(e); ModTissueProvider.preInit(e); CraftTweakerHelper.preInit(); PacketHandler.registerMessages(EmergingTechnology.MODID); } public void init(FMLInitializationEvent e) { MinecraftForge.EVENT_BUS.register(WorldTickHandler.instance); OreRegistrationHandler.init(); RecipeBuilder.buildMachineRecipes(); } public void postInit(FMLPostInitializationEvent e) { } public World getWorld(MessageContext ctx) { return ctx.getServerHandler().player.world; } abstract public boolean playerIsInCreativeMode(EntityPlayer player); /** * is this a dedicated server? * * @return true if this is a dedicated server, false otherwise */ abstract public boolean isDedicatedServer(); }
[ "moonmanmodding@gmail.com" ]
moonmanmodding@gmail.com
6f79a6c738333ef38c753ad8568ba1eec8a56b43
8ca7c60de1ec5788db4c33f17ebd6cfae2e741e5
/Jun13--Thursday/assign4/Maze.java
f42c2c597c932060068bdf674b1e20f95f110876
[]
no_license
hsakbo/cis2168
7e43ed5824544bb27b9b4a38e168621278e7fa03
594b23ab3f846eae7a043929a2a55ab0ffb84172
refs/heads/master
2020-05-28T07:22:36.437650
2019-07-17T23:13:54
2019-07-17T23:13:54
188,919,317
0
0
null
null
null
null
UTF-8
Java
false
false
444
java
import java.awt.GridLayout; import javax.swing.JFrame; import javax.swing.JPanel; public class Maze extends JFrame { public static MazeGridPanel sol; public Maze() { sol = new MazeGridPanel(100, 100); this.add(sol); this.setSize(800, 800); this.setDefaultCloseOperation(EXIT_ON_CLOSE); this.pack(); this.setVisible(true); } public static void main(String[] args) { new Maze(); sol.solveMaze(); } }
[ "hsa310@gmail.com" ]
hsa310@gmail.com
9775cd634e2d7c7d170c34e322de85f87c9a67a8
47a755ab816b2055d116b047b4aeda15bd1f7351
/build-logic/src/main/java/com/sun/apache/xpath/internal/axes/UnionPathIterator.java
9db2a45bde4474172abdbb447032bf83f56953cd
[]
no_license
MikeAndrson/kotlinc-android
4548581c7972b13b45dff4ccdd11747581349ded
ebc9b1d78bbd97083e860a1e8887b25469a13ecf
refs/heads/master
2023-08-20T05:17:30.605126
2021-10-04T16:06:46
2021-10-04T16:06:46
413,486,864
25
12
null
null
null
null
UTF-8
Java
false
false
16,629
java
/* * reserved comment block * DO NOT REMOVE OR ALTER! */ /* * Copyright 1999-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: UnionPathIterator.java,v 1.2.4.1 2005/09/14 19:43:25 jeffsuttor Exp $ */ package com.sun.apache.xpath.internal.axes; import com.sun.apache.xml.internal.utils.WrappedRuntimeException; import com.sun.apache.xpath.internal.XPathVisitable; import com.sun.apache.xpath.internal.compiler.Compiler; import com.sun.apache.xpath.internal.compiler.OpCodes; import com.sun.apache.xpath.internal.compiler.OpMap; import com.sun.apache.xml.internal.dtm.Axis; import com.sun.apache.xml.internal.dtm.DTM; import com.sun.apache.xml.internal.dtm.DTMIterator; import com.sun.apache.xpath.internal.Expression; import com.sun.apache.xpath.internal.ExpressionOwner; import com.sun.apache.xpath.internal.XPathVisitor; /** * This class extends NodeSetDTM, which implements DTMIterator, * and fetches nodes one at a time in document order based on a XPath * <a href="http://www.w3.org/TR/xpath#NT-UnionExpr">UnionExpr</a>. * As each node is iterated via nextNode(), the node is also stored * in the NodeVector, so that previousNode() can easily be done. * @xsl.usage advanced */ public class UnionPathIterator extends LocPathIterator implements Cloneable, DTMIterator, java.io.Serializable, PathComponent { static final long serialVersionUID = -3910351546843826781L; /** * Constructor to create an instance which you can add location paths to. */ public UnionPathIterator() { super(); // m_mutable = false; // m_cacheNodes = false; m_iterators = null; m_exprs = null; } /** * Initialize the context values for this expression * after it is cloned. * * @param context The XPath runtime context for this * transformation. */ public void setRoot(int context, Object environment) { super.setRoot(context, environment); try { if (null != m_exprs) { int n = m_exprs.length; DTMIterator newIters[] = new DTMIterator[n]; for (int i = 0; i < n; i++) { DTMIterator iter = m_exprs[i].asIterator(m_execContext, context); newIters[i] = iter; iter.nextNode(); } m_iterators = newIters; } } catch(Exception e) { throw new WrappedRuntimeException(e); } } /** * Add an iterator to the union list. * * @param expr non-null reference to a location path iterator. */ public void addIterator(DTMIterator expr) { // Increase array size by only 1 at a time. Fix this // if it looks to be a problem. if (null == m_iterators) { m_iterators = new DTMIterator[1]; m_iterators[0] = expr; } else { DTMIterator[] exprs = m_iterators; int len = m_iterators.length; m_iterators = new DTMIterator[len + 1]; System.arraycopy(exprs, 0, m_iterators, 0, len); m_iterators[len] = expr; } expr.nextNode(); if(expr instanceof Expression) ((Expression)expr).exprSetParent(this); } /** * Detaches the iterator from the set which it iterated over, releasing * any computational resources and placing the iterator in the INVALID * state. After<code>detach</code> has been invoked, calls to * <code>nextNode</code> or<code>previousNode</code> will raise the * exception INVALID_STATE_ERR. */ public void detach() { if(m_allowDetach && null != m_iterators){ int n = m_iterators.length; for(int i = 0; i < n; i++) { m_iterators[i].detach(); } m_iterators = null; } } /** * Create a UnionPathIterator object, including creation * of location path iterators from the opcode list, and call back * into the Compiler to create predicate expressions. * * @param compiler The Compiler which is creating * this expression. * @param opPos The position of this iterator in the * opcode list from the compiler. * * @throws org.openjdk.javax.xml.transform.TransformerException */ public UnionPathIterator(Compiler compiler, int opPos) throws org.openjdk.javax.xml.transform.TransformerException { super(); opPos = OpMap.getFirstChildPos(opPos); loadLocationPaths(compiler, opPos, 0); } /** * This will return an iterator capable of handling the union of paths given. * * @param compiler The Compiler which is creating * this expression. * @param opPos The position of this iterator in the * opcode list from the compiler. * * @return Object that is derived from LocPathIterator. * * @throws org.openjdk.javax.xml.transform.TransformerException */ public static LocPathIterator createUnionIterator(Compiler compiler, int opPos) throws org.openjdk.javax.xml.transform.TransformerException { // For the moment, I'm going to first create a full UnionPathIterator, and // then see if I can reduce it to a UnionChildIterator. It would obviously // be more effecient to just test for the conditions for a UnionChildIterator, // and then create that directly. UnionPathIterator upi = new UnionPathIterator(compiler, opPos); int nPaths = upi.m_exprs.length; boolean isAllChildIterators = true; for(int i = 0; i < nPaths; i++) { LocPathIterator lpi = upi.m_exprs[i]; if(lpi.getAxis() != Axis.CHILD) { isAllChildIterators = false; break; } else { // check for positional predicates or position function, which won't work. if(HasPositionalPredChecker.check(lpi)) { isAllChildIterators = false; break; } } } if(isAllChildIterators) { UnionChildIterator uci = new UnionChildIterator(); for(int i = 0; i < nPaths; i++) { PredicatedNodeTest lpi = upi.m_exprs[i]; // I could strip the lpi down to a pure PredicatedNodeTest, but // I don't think it's worth it. Note that the test can be used // as a static object... so it doesn't have to be cloned. uci.addNodeTest(lpi); } return uci; } else return upi; } /** * Get the analysis bits for this walker, as defined in the WalkerFactory. * @return One of WalkerFactory#BIT_DESCENDANT, etc. */ public int getAnalysisBits() { int bits = 0; if (m_exprs != null) { int n = m_exprs.length; for (int i = 0; i < n; i++) { int bit = m_exprs[i].getAnalysisBits(); bits |= bit; } } return bits; } /** * Read the object from a serialization stream. * * @param stream Input stream to read from * * @throws java.io.IOException * @throws org.openjdk.javax.xml.transform.TransformerException */ private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException, org.openjdk.javax.xml.transform.TransformerException { try { stream.defaultReadObject(); m_clones = new IteratorPool(this); } catch (ClassNotFoundException cnfe) { throw new org.openjdk.javax.xml.transform.TransformerException(cnfe); } } /** * Get a cloned LocPathIterator that holds the same * position as this iterator. * * @return A clone of this iterator that holds the same node position. * * @throws CloneNotSupportedException */ public Object clone() throws CloneNotSupportedException { UnionPathIterator clone = (UnionPathIterator) super.clone(); if (m_iterators != null) { int n = m_iterators.length; clone.m_iterators = new DTMIterator[n]; for (int i = 0; i < n; i++) { clone.m_iterators[i] = (DTMIterator)m_iterators[i].clone(); } } return clone; } /** * Create a new location path iterator. * * @param compiler The Compiler which is creating * this expression. * @param opPos The position of this iterator in the * * @return New location path iterator. * * @throws org.openjdk.javax.xml.transform.TransformerException */ protected LocPathIterator createDTMIterator( Compiler compiler, int opPos) throws org.openjdk.javax.xml.transform.TransformerException { LocPathIterator lpi = (LocPathIterator)WalkerFactory.newDTMIterator(compiler, opPos, (compiler.getLocationPathDepth() <= 0)); return lpi; } /** * Initialize the location path iterators. Recursive. * * @param compiler The Compiler which is creating * this expression. * @param opPos The position of this iterator in the * opcode list from the compiler. * @param count The insert position of the iterator. * * @throws org.openjdk.javax.xml.transform.TransformerException */ protected void loadLocationPaths(Compiler compiler, int opPos, int count) throws org.openjdk.javax.xml.transform.TransformerException { // TODO: Handle unwrapped FilterExpr int steptype = compiler.getOp(opPos); if (steptype == OpCodes.OP_LOCATIONPATH) { loadLocationPaths(compiler, compiler.getNextOpPos(opPos), count + 1); m_exprs[count] = createDTMIterator(compiler, opPos); m_exprs[count].exprSetParent(this); } else { // Have to check for unwrapped functions, which the LocPathIterator // doesn't handle. switch (steptype) { case OpCodes.OP_VARIABLE : case OpCodes.OP_EXTFUNCTION : case OpCodes.OP_FUNCTION : case OpCodes.OP_GROUP : loadLocationPaths(compiler, compiler.getNextOpPos(opPos), count + 1); WalkingIterator iter = new WalkingIterator(compiler.getNamespaceContext()); iter.exprSetParent(this); if(compiler.getLocationPathDepth() <= 0) iter.setIsTopLevel(true); iter.m_firstWalker = new FilterExprWalker(iter); iter.m_firstWalker.init(compiler, opPos, steptype); m_exprs[count] = iter; break; default : m_exprs = new LocPathIterator[count]; } } } /** * Returns the next node in the set and advances the position of the * iterator in the set. After a DTMIterator is created, the first call * to nextNode() returns the first node in the set. * @return The next <code>Node</code> in the set being iterated over, or * <code>null</code> if there are no more members in that set. */ public int nextNode() { if(m_foundLast) return DTM.NULL; // Loop through the iterators getting the current fetched // node, and get the earliest occuring in document order int earliestNode = DTM.NULL; if (null != m_iterators) { int n = m_iterators.length; int iteratorUsed = -1; for (int i = 0; i < n; i++) { int node = m_iterators[i].getCurrentNode(); if (DTM.NULL == node) continue; else if (DTM.NULL == earliestNode) { iteratorUsed = i; earliestNode = node; } else { if (node == earliestNode) { // Found a duplicate, so skip past it. m_iterators[i].nextNode(); } else { DTM dtm = getDTM(node); if (dtm.isNodeAfter(node, earliestNode)) { iteratorUsed = i; earliestNode = node; } } } } if (DTM.NULL != earliestNode) { m_iterators[iteratorUsed].nextNode(); incrementCurrentPos(); } else m_foundLast = true; } m_lastFetched = earliestNode; return earliestNode; } /** * This function is used to fixup variables from QNames to stack frame * indexes at stylesheet build time. * @param vars List of QNames that correspond to variables. This list * should be searched backwards for the first qualified name that * corresponds to the variable reference qname. The position of the * QName in the vector from the start of the vector will be its position * in the stack frame (but variables above the globalsTop value will need * to be offset to the current stack frame). */ public void fixupVariables(java.util.Vector vars, int globalsSize) { for (int i = 0; i < m_exprs.length; i++) { m_exprs[i].fixupVariables(vars, globalsSize); } } /** * The location path iterators, one for each * <a href="http://www.w3.org/TR/xpath#NT-LocationPath">location * path</a> contained in the union expression. * @serial */ protected LocPathIterator[] m_exprs; /** * The location path iterators, one for each * <a href="http://www.w3.org/TR/xpath#NT-LocationPath">location * path</a> contained in the union expression. * @serial */ protected DTMIterator[] m_iterators; /** * Returns the axis being iterated, if it is known. * * @return Axis.CHILD, etc., or -1 if the axis is not known or is of multiple * types. */ public int getAxis() { // Could be smarter. return -1; } class iterOwner implements ExpressionOwner { int m_index; iterOwner(int index) { m_index = index; } /** * @see ExpressionOwner#getExpression() */ public Expression getExpression() { return m_exprs[m_index]; } /** * @see ExpressionOwner#setExpression(Expression) */ public void setExpression(Expression exp) { if(!(exp instanceof LocPathIterator)) { // Yuck. Need FilterExprIter. Or make it so m_exprs can be just // plain expressions? WalkingIterator wi = new WalkingIterator(getPrefixResolver()); FilterExprWalker few = new FilterExprWalker(wi); wi.setFirstWalker(few); few.setInnerExpression(exp); wi.exprSetParent(UnionPathIterator.this); few.exprSetParent(wi); exp.exprSetParent(few); exp = wi; } else exp.exprSetParent(UnionPathIterator.this); m_exprs[m_index] = (LocPathIterator)exp; } } /** * @see XPathVisitable#callVisitors(ExpressionOwner, XPathVisitor) */ public void callVisitors(ExpressionOwner owner, XPathVisitor visitor) { if(visitor.visitUnionPath(owner, this)) { if(null != m_exprs) { int n = m_exprs.length; for(int i = 0; i < n; i++) { m_exprs[i].callVisitors(new iterOwner(i), visitor); } } } } /** * @see Expression#deepEquals(Expression) */ public boolean deepEquals(Expression expr) { if (!super.deepEquals(expr)) return false; UnionPathIterator upi = (UnionPathIterator) expr; if (null != m_exprs) { int n = m_exprs.length; if((null == upi.m_exprs) || (upi.m_exprs.length != n)) return false; for (int i = 0; i < n; i++) { if(!m_exprs[i].deepEquals(upi.m_exprs[i])) return false; } } else if (null != upi.m_exprs) { return false; } return true; } }
[ "heystudiosofficial@gmail.com" ]
heystudiosofficial@gmail.com
af08f198d1bb15d5997625628306e9e39442d026
e6635f5b0dd59bae1fdcd9d9a67a6bc2ae3e2bfb
/app/src/main/java/com/bgt/customcameraview/MainActivity.java
7c440dec35a31eb0aa9b421fe9b7af268e8d6cc0
[]
no_license
tank777/CustomCameraView
3fe038bf4a97594593423832fc7b208d8dc63404
66e35d6830d3f0a37a1d8bc69498f5115bc19151
refs/heads/master
2021-01-19T15:40:56.170414
2017-08-21T15:57:39
2017-08-21T15:57:39
100,969,127
0
0
null
null
null
null
UTF-8
Java
false
false
1,841
java
package com.bgt.customcameraview; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.view.View; import android.widget.LinearLayout; import com.flurgle.camerakit.CameraListener; import com.flurgle.camerakit.CameraView; import java.io.File; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnClick; public class MainActivity extends AppCompatActivity { @BindView(R.id.camera) CameraView camera; @BindView(R.id.ll_video) LinearLayout llVideo; @BindView(R.id.ll_camera) LinearLayout llCamera; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ButterKnife.bind(this); camera.setCameraListener(new CameraListener() { @Override public void onVideoTaken(File video) { super.onVideoTaken(video); // The File parameter is an MP4 file. Log.e("TAG", "onVideoTaken: " ); } }); } @Override protected void onResume() { super.onResume(); camera.start(); } @Override protected void onPause() { camera.stop(); super.onPause(); } @OnClick({R.id.ll_video, R.id.ll_camera}) public void onViewClicked(View view) { switch (view.getId()) { case R.id.ll_video: camera.startRecordingVideo(); camera.postDelayed(new Runnable() { @Override public void run() { camera.stopRecordingVideo(); } }, 2500); break; case R.id.ll_camera: break; } } }
[ "bhavesh.tank777@gmail.com" ]
bhavesh.tank777@gmail.com
00727a36ba082887cb05c52852455d9a5697d37d
c98553fd745cfb7a5b5a045b7a23f88438b7c91c
/src/com/StudentDatabase/SudentDatabaseApp.java
528f99e81c8ff48e41459e997237a5973ebb17fb
[]
no_license
adityajammula/StudentDatabaseProject
fc55124b7c6f80dc9227544951271cc2d9fbb71e
50ce75d34b040f6c8a98e8957640f8583b73447f
refs/heads/master
2020-03-16T04:56:48.137612
2018-05-07T22:21:21
2018-05-07T22:21:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
603
java
package com.StudentDatabase; import java.util.Scanner; public class SudentDatabaseApp { public static void main(String[] args) { System.out.println("Enter number of new Students to enroll: "); Scanner in = new Scanner(System.in); int num = in.nextInt(); Student[] students = new Student[num]; for (int i = 0; i < num; i++) { students[i] = new Student(); students[i].enroll(); students[i].payBalance(); students[i].toString(); } System.out.println(students[0].toString()); System.out.println(students[1].toString()); System.out.println(students[2].toString()); } }
[ "adityajammula@gmail.com" ]
adityajammula@gmail.com
4454d21e1deaa5829f4c61978f1b938ac4a8c770
9f4a6d433c3bb3519ae2d10f0dd41844c1552a8f
/src/sm63bingogen/Model/Import/States/Import_State_Title.java
b2524729c48ab4e75874d2473f2c539b63f7328f
[]
no_license
KevinKib/SM63BingoGen
a4b771773e0a73b0115a884074ca9b576b950982
b047614658d202fa61e5113e87c0c7502a88a6c3
refs/heads/master
2022-11-02T05:25:33.075194
2018-11-07T08:19:43
2018-11-07T08:19:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,143
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 sm63bingogen.Model.Import.States; import sm63bingogen.Model.Import.Import_Event; import sm63bingogen.Model.Import.Import_State; import sm63bingogen.Model.Import.Import_State_Enum; /** * * @author Kévin */ public class Import_State_Title extends Import_State { @Override public Import_State action(Import_Event e) { Import_State finalState; switch(e) { case Letter: case Number: finalState = this; break; case Comma: finalState = new Import_State_Comma_TitleLength(); break; case EndOfLine: finalState = new Import_State_Final(); break; default: finalState = new Import_State_Error(); } return finalState; } @Override public Import_State_Enum getType() { return Import_State_Enum.Title; } }
[ "sekanor21@gmail.com" ]
sekanor21@gmail.com
c90744f174ac73ad05b529210f8792ec83ed5c56
99ce5fb84e6118214070d67fd7451332304b2a09
/src/main/java/com/cq/httpapi/demo/dto/SZJ/Response/BackEndDataResponse/BatchAddUserCardsResponse.java
7a277dea19f8b1dd26d81a58bc82e3646aa7d231
[]
no_license
AWenXiong/CQBot_Bloodline_Public
8b011b10410d76c38bb86d7bb5ef9653d717821a
5740d8dcb1ed2423764729da4b9517fdd8ad9a15
refs/heads/master
2022-07-17T06:41:09.042671
2020-02-18T14:06:04
2020-02-18T14:06:04
241,371,124
0
0
null
2022-06-29T17:57:54
2020-02-18T13:42:36
Java
UTF-8
Java
false
false
181
java
package com.cq.httpapi.demo.dto.SZJ.Response.BackEndDataResponse; import com.cq.httpapi.demo.dto.SZJ.SZJResponse; public class BatchAddUserCardsResponse extends SZJResponse { }
[ "502063298@qq.com" ]
502063298@qq.com
812f8951ea568095c7d449729e41843f7c0361b9
5a4fa228137d5d3bb02e066c42637b689b0423c8
/Frontend[Android]/app/src/main/java/com/example/docvision/Connect.java
1cefd62f91411a83e55c4f56056e82d5316a5431
[ "MIT" ]
permissive
pranav1152/DocVision
77f2ab020422fcb329ba0f4df42c2845b9345e09
ded3cf3648393c340f982aaff88e8a9774665cf8
refs/heads/main
2023-07-10T18:02:22.928046
2021-09-02T12:23:42
2021-09-02T12:23:42
377,608,200
2
0
null
null
null
null
UTF-8
Java
false
false
3,244
java
package com.example.docvision; import android.content.Context; import android.graphics.Bitmap; import android.widget.Toast; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import okhttp3.MediaType; import okhttp3.MultipartBody; import okhttp3.RequestBody; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; import retrofit2.Retrofit; import retrofit2.converter.gson.GsonConverterFactory; public class Connect { Requests requests; Retrofit retrofit; Context context; public Connect(Context context) { this.context = context; retrofit = new Retrofit.Builder().baseUrl("http://192.168.43.165:5000/").addConverterFactory(GsonConverterFactory.create()).build(); requests = retrofit.create(Requests.class); } public void ops(String op, String filename, Bitmap bitmap) { MultipartBody.Part body = uploadBody(bitmap, filename); Call<_Response> call = requests.doOP(body, op); call.enqueue(new Callback<_Response>() { @Override public void onResponse(Call<_Response> call, Response<_Response> response) { if (response.isSuccessful() && response.code() == 200) { if(op.equals("adaptivethresholding")) ((ImagePreview) context).callback(new _Response(down(filename), true)); else ((ImagePreview) context).callback(response.body()); } else { Toast.makeText(context, "Error :(", Toast.LENGTH_SHORT).show(); } } @Override public void onFailure(Call<_Response> call, Throwable t) { Toast.makeText(context, "Error :(", Toast.LENGTH_SHORT).show(); } }); } private MultipartBody.Part uploadBody(Bitmap bitmap, String filename) { ByteArrayOutputStream stream = new ByteArrayOutputStream(); bitmap.compress(Bitmap.CompressFormat.JPEG, 100, stream); byte[] byteArray = stream.toByteArray(); File f = new File(context.getCacheDir(), filename + ".jpg"); try { f.createNewFile(); } catch (IOException e) { Toast.makeText(context, "An error occure while reading image :(", Toast.LENGTH_SHORT).show(); } FileOutputStream fos = null; try { fos = new FileOutputStream(f); } catch (FileNotFoundException e) { Toast.makeText(context, "Error while creating file :(", Toast.LENGTH_SHORT).show(); } try { fos.write(byteArray); fos.flush(); fos.close(); } catch (IOException e) { Toast.makeText(context, "Unknown error occured :(", Toast.LENGTH_SHORT).show(); } RequestBody reqFile = RequestBody.create(MediaType.parse("image/*"), f); MultipartBody.Part body = MultipartBody.Part.createFormData("upload", f.getName(), reqFile); return body; } public String down(String filename) { return retrofit.baseUrl() + "getOP/?filename=" + filename; } }
[ "noreply@github.com" ]
pranav1152.noreply@github.com
cdd636fabedf8702f4014af33b3c8b4c06757b91
a617e2219c65e730f71584dcb325b9ecce66fa59
/aserv-server/src/main/java/com/absir/aserv/system/crud/RichCrudFactory.java
c817ca23a0496d802a4f516170d0e8620b99d081
[ "Apache-2.0" ]
permissive
destmay/aserv
192c61b901f2f77eeda8e0bd6c7eb5c0303e51f6
186c21c3201b43d3e65f146c1956ef0640b65998
refs/heads/master
2021-01-01T06:00:43.670069
2017-07-11T10:26:39
2017-07-11T10:26:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
10,356
java
/** * Copyright 2013 ABSir's Studio * <p/> * All right reserved * <p/> * Create on 2013-7-9 下午3:36:15 */ package com.absir.aserv.system.crud; import com.absir.aserv.crud.*; import com.absir.aserv.dyna.DynaBinderUtils; import com.absir.aserv.support.developer.JCrudField; import com.absir.aserv.system.bean.JEmbedSL; import com.absir.aserv.system.bean.JUpload; import com.absir.aserv.system.bean.JUploadCite; import com.absir.aserv.system.bean.proxy.JiUserBase; import com.absir.aserv.system.bean.value.JaCrud.Crud; import com.absir.aserv.system.dao.BeanDao; import com.absir.aserv.system.dao.utils.QueryDaoUtils; import com.absir.aserv.system.helper.HelperString; import com.absir.aserv.system.service.AuthService; import com.absir.aserv.system.service.CrudService; import com.absir.aserv.system.service.utils.CrudServiceUtils; import com.absir.bean.basis.Base; import com.absir.bean.core.BeanFactoryUtils; import com.absir.bean.inject.value.Bean; import com.absir.context.core.ContextUtils; import com.absir.core.kernel.KernelDyna; import com.absir.core.kernel.KernelString; import com.absir.core.util.UtilAccessor; import com.absir.orm.transaction.value.Transaction; import com.absir.orm.value.JoEntity; import com.absir.property.PropertyErrors; import com.absir.server.in.Input; import org.hibernate.Session; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; @SuppressWarnings("unchecked") @Base @Bean public class RichCrudFactory implements ICrudFactory, ICrudProcessorInput<Object> { public static final RichCrudFactory ME = BeanFactoryUtils.get(RichCrudFactory.class); public static final String UPLOAD = "upload"; public static final Pattern IMG_SRC_PATTERN = Pattern.compile("<img[^<>]*?[\\s| ]{1}src=[\"']{1}([^\"']*)[\"']{1}", Pattern.DOTALL | Pattern.CASE_INSENSITIVE); public static final char[] SRC_EXCLUDE_CHARS = new char[]{'\'', '"', '\r', '\n'}; private static final String REMOTE_RICH_NAME = "@REMOTE_RICH"; /** * 获取关联ID * * @param entityName * @param id * @return */ public static String getAssocId(String entityName, Object id) { if (id != null) { return entityName + "@" + DynaBinderUtils.getParamFromValue(id); } return null; } /** * 获取关联ID * * @param handler * @return */ public static String getAssocId(CrudHandler handler) { String entityName = handler.getCrudEntity().getJoEntity().getEntityName(); if (entityName != null) { Object id = CrudService.ME.getCrudSupply(entityName).getIdentifier(entityName, handler.getRoot()); return getAssocId(entityName, id); } return null; } public static List<JUploadCite> getUploadCites(Session session, String assocId) { return QueryDaoUtils.createQueryArray(session, "SELECT o FROM JUploadCite o WHERE o.id.eid = ?", assocId).list(); } @Override public boolean isMultipart() { return false; } @Transaction @Override public void crud(CrudProperty crudProperty, Object entity, CrudHandler handler, JiUserBase user, Input input) { if (handler.getCrud() == Crud.DELETE) { String assocId = getAssocId(handler); if (assocId != null) { Session session = BeanDao.getSession(); List<JUploadCite> uploadCites = getUploadCites(session, assocId); if (!uploadCites.isEmpty()) { QueryDaoUtils.createQueryArray(session, "DELETE FROM JUploadCite o WHERE o.id.eid = ?", assocId).executeUpdate(); session.flush(); long contextTime = ContextUtils.getContextTime(); for (JUploadCite uploadCite : uploadCites) { JUpload upload = uploadCite.getUpload(); upload.setPassTime(contextTime + UploadCrudFactory.getUploadPassTime()); session.merge(upload); } } } } } @Override public Object crud(CrudProperty crudProperty, PropertyErrors errors, CrudHandler handler, JiUserBase user, Input input) { return input; } @Transaction @Override public void crud(CrudProperty crudProperty, Object entity, CrudHandler handler, JiUserBase user, Object inputBody) { Session session = BeanDao.getSession(); String entityName = handler.getCrudEntity().getJoEntity().getEntityName(); Object id = CrudServiceUtils.identifier(entityName, entity, handler.doCreate()); String assocId = getAssocId(entityName, id); if (handler.getCrud() == Crud.DELETE) { // 解除关联关系 QueryDaoUtils.createQueryArray(session, "DELETE FROM JUploadCite o WHERE o.id.eid = ?", assocId).executeUpdate(); } else { boolean downloadPermission = AuthService.ME.menuPermission(UPLOAD, user); Input input = (Input) inputBody; Set<String> srcs = new HashSet<String>(); // 处理所有RichHtml字段 if (crudProperty.getjCrud().getParameters().length == 0) { richHtml(handler.getFilter().getPropertyPath(), crudProperty.getName(), entity, srcs, downloadPermission, user, input); } else { for (Object field : crudProperty.getjCrud().getParameters()) { richHtml(handler.getFilter().getPropertyPath(), (String) field, entity, srcs, downloadPermission, user, input); } } // 增加关联和设置关联为不过期 long updateTime = System.currentTimeMillis(); for (String src : srcs) { Iterator<JUpload> iterator = QueryDaoUtils.createQueryArray(session, "SELECT o FROM JUpload o WHERE o.filePath = ?", src).iterate(); if (iterator.hasNext()) { JUpload upload = iterator.next(); upload.setPassTime(0); session.merge(upload); JUploadCite uploadCite = new JUploadCite(); uploadCite.setId(new JEmbedSL(assocId, upload.getId())); uploadCite.setUpload(upload); uploadCite.setUpdateTime(updateTime); session.merge(uploadCite); } } QueryDaoUtils.createQueryArray(session, "DELETE FROM JUploadCite o WHERE o.id.eid = ? AND o.updateTime != ?", assocId, updateTime).executeUpdate(); } if (handler.getCrud() != Crud.CREATE) { // 添加关联文件过期 long passTime = ContextUtils.getContextTime() + UploadCrudFactory.getUploadPassTime(); QueryDaoUtils.createQueryArray(session, "UPDATE JUpload o SET o.passTime = ? WHERE o.id IN (SELECT o.id.mid FROM JUploadCite o WHERE o.id.eid = ?)", passTime, assocId).executeUpdate(); } } /** * 富文本自动下载和获取关联链接 */ protected void richHtml(String propertyPath, String field, Object entity, Set<String> srcs, boolean downloadPermission, JiUserBase user, Input input) { UtilAccessor.Accessor accessor = UtilAccessor.getAccessor(entity.getClass(), field, null); if (accessor == null) { return; } String html = (String) accessor.get(entity); if (KernelString.isEmpty(html)) { return; } // 远程下载图片 if (downloadPermission && input != null && KernelDyna.toBoolean(input.getParam(propertyPath + '.' + field + REMOTE_RICH_NAME))) { int end = 0; StringBuilder stringBuilder = new StringBuilder(); Matcher matcher = IMG_SRC_PATTERN.matcher(html); char[] chars = html.toCharArray(); while (matcher.find()) { String src = matcher.group(1); if (!UploadCrudFactory.ME.isUploadUrl(src)) { String find = matcher.group(); String replace = UploadCrudFactory.ME.remoteDownload(src, "jpg", user); if (replace == null) { stringBuilder.append(chars, end, matcher.end() - end); } else { replace = UploadCrudFactory.ME.getUploadUrl(replace); stringBuilder.append(chars, end, matcher.start() - end); stringBuilder.append(find.replace(src, replace)); } end = matcher.end(); } } if (end != 0) { int len = chars.length - end; if (len > end) { stringBuilder.append(chars, end, len - end); } accessor.set(entity, stringBuilder.toString()); } } // 查找关联文件 int end = 0; int length = html.length(); String uploadUrl = UploadCrudFactory.ME.forUploadUrl(); int len = uploadUrl.length(); while (end < length) { int pos = html.indexOf(uploadUrl, end); if (pos > 0) { end = pos + len; char chr = html.charAt(pos - 1); if (chr == '\'' || chr == '"') { pos = html.indexOf(chr, end); if (pos > 0) { int last = pos - end - 1; if (last > 1) { String src = html.substring(end, last); if (HelperString.indexOfAny(src, SRC_EXCLUDE_CHARS) < 0) { if (src.startsWith(uploadUrl)) { srcs.add(src.substring(uploadUrl.length())); } } } end = pos + 1; } } } else { break; } } } @Override public ICrudProcessor getProcessor(JoEntity joEntity, JCrudField crudField) { return CharSequence.class.isAssignableFrom(crudField.getType()) ? ME : null; } }
[ "absir@qq.com" ]
absir@qq.com
84b8845df7d208eebc6a8ed3fc79b05373236044
7b0e0015cad07fce81803cb8f7ccf0feeee62ec4
/src/main/java/com/dw/suppercms/application/system/impl/SysParamServiceImpl.java
60a4963d8a26c139a3a2c570c9e639789a02c43b
[]
no_license
shenqidekobe/supercms
ecb191c5537355a4de8a45f978932d8007fab9a6
0bb6afcb7a1bd2cada454ae29de2f54553436da7
refs/heads/master
2021-01-24T20:54:05.369022
2018-02-28T09:54:33
2018-02-28T09:54:33
123,263,266
0
0
null
null
null
null
UTF-8
Java
false
false
2,478
java
package com.dw.suppercms.application.system.impl; import static org.junit.Assert.assertNotNull; import java.util.List; import javax.annotation.Resource; import org.springframework.beans.BeanUtils; import com.dw.framework.core.annotation.ApplicationService; import com.dw.suppercms.application.system.SysParamService; import com.dw.suppercms.domain.system.SysParamInfo; import com.dw.suppercms.domain.system.SysParamInfo.PARAM_CODE; import com.dw.suppercms.domain.system.SysParamRepository; import com.googlecode.genericdao.search.Search; /** * 系统参数服务实现类 * */ @ApplicationService public class SysParamServiceImpl implements SysParamService{ @Resource private SysParamRepository sysParamRepository; @Override public SysParamInfo createSysParam(SysParamInfo obj) { assertNotNull(obj); sysParamRepository.save(obj); return obj; } @Override public SysParamInfo modifySysParam(Long id, SysParamInfo obj) { assertNotNull(obj); SysParamInfo pojo=this.findSysParamById(id); BeanUtils.copyProperties(obj, pojo); this.sysParamRepository.save(pojo); return pojo; } @Override public void removeSysParam(Long id) { assertNotNull(id); this.sysParamRepository.removeById(id); } @Override public boolean validateParamKey(PARAM_CODE paramCode, String paramKey) { assertNotNull(paramCode); assertNotNull(paramKey); return this.sysParamRepository.search(new Search().addFilterEqual("paramCode", paramCode).addFilterEqual("paramKey", paramKey)).size()==0?true:false; } @Override public SysParamInfo findSysParamById(Long id) { assertNotNull(id); return this.sysParamRepository.find(id); } @Override public List<SysParamInfo> findSysParamListByCode(PARAM_CODE paramCode) { return this.sysParamRepository.search(new Search().addFilterEqual("paramCode", paramCode)); } @Override public SysParamInfo findSysParamByCodeAndKey(PARAM_CODE paramCode, String paramKey) { List<SysParamInfo> list=this.sysParamRepository.search(new Search().addFilterEqual("paramCode", paramCode).addFilterEqual("paramKey", paramKey)); if(!list.isEmpty()){ return list.get(0); } return null; } @Override public String findSysParamValByCodeAndKey(PARAM_CODE paramCode,String paramKey){ SysParamInfo param=findSysParamByCodeAndKey(paramCode, paramKey); if(param!=null){ return param.getParamVal(); } return null; } @Override public List<SysParamInfo> all(){ return this.sysParamRepository.findAll(); } }
[ "liuyuan_kobe@163.com" ]
liuyuan_kobe@163.com
293b1c82e72a5fa6eec63fa51c15c7156b3125f8
08ceda6be642e612425ad90c968ed79a9a06f092
/lab3/src/Expression.java
6a5b6c750fa084feeb458b839a30743b6246dd66
[]
no_license
wushangzhen/Projects
3c1964d1023fab1912f1a1ad38eecb3b8af09807
c124ecdae12cecb7bb18cd0c317d05a11050b135
refs/heads/master
2020-04-09T15:07:39.485934
2018-12-04T22:06:03
2018-12-04T22:06:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
259
java
package edu.neu.ccs.cs5010.lab3; /** * */ public interface Expression { /** * Evaluate this expression and return the final value * * @return result of evaluating this expression */ Val eval(Context ctx) throws Exception; void trace(); }
[ "wushangzhen_bupt@163.com" ]
wushangzhen_bupt@163.com
d07faeec8f18bf3a2415465ff641ee37b7cace8a
ebcfd16e708287939c542d7d5baca32a1bd31cb3
/Khadeer/PopMenu/app/src/main/java/neorays/popmenu/MainActivity.java
44c977d32bd697da946a8a98b7d7bccc3174a403
[]
no_license
NeoRaysTraining/Android
1e8bbf05a3a80a7cb5f7d0a918da30e91072c4e7
c854a6fc66fee1d63644aaef017a832c75ed6ed6
refs/heads/master
2021-01-21T04:30:58.078121
2016-07-09T07:53:17
2016-07-09T07:53:17
49,486,193
0
0
null
null
null
null
UTF-8
Java
false
false
2,271
java
package neorays.popmenu; import android.os.Bundle; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.Snackbar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.MenuInflater; import android.view.View; import android.view.Menu; import android.view.MenuItem; import android.widget.PopupMenu; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); fab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG) .setAction("Action", null).show(); } }); } public void showPopUp(View view){ PopupMenu popupMenu=new PopupMenu(this,view); MenuInflater menuInflater=popupMenu.getMenuInflater(); menuInflater.inflate(R.menu.popup_actions,popupMenu.getMenu()); PopUpMenuEventHandle popUpMenuEventHandle = new PopUpMenuEventHandle(getApplicationContext()); popupMenu.setOnMenuItemClickListener(popUpMenuEventHandle); popupMenu.show(); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.menu_main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } }
[ "khadeer.b@neorays.com" ]
khadeer.b@neorays.com
1e1f0dae0cbd47d54bfe7fca024d12f1b8832462
d2cd68d3dcb8403660a3f5dee1d0672b7081a6ee
/src/main/java/org/cyberpwn/vitality/util/JSONTokener.java
9ae09242e77b88c3b9e976097b28ac35bf43395b
[ "WTFPL" ]
permissive
AvianAeternum/Vitality
a46a97d3266f873d4efe62e8c48e66d4172ffad8
d28afb09822720952a2742a06c20c9807107c3bb
refs/heads/master
2021-07-09T16:26:14.330946
2017-10-08T23:20:52
2017-10-08T23:20:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
13,020
java
package org.cyberpwn.vitality.util; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.io.StringReader; /* Copyright (c) 2002 JSON.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. The Software shall be used for Good, not Evil. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** * A JSONTokener takes a source string and extracts characters and tokens from * it. It is used by the JSONObject and JSONArray constructors to parse * JSON source strings. * @author JSON.org * @version 2014-05-03 */ public class JSONTokener { private long character; private boolean eof; private long index; private long line; private char previous; private Reader reader; private boolean usePrevious; /** * Construct a JSONTokener from a Reader. * * @param reader A reader. */ public JSONTokener(Reader reader) { this.reader = reader.markSupported() ? reader : new BufferedReader(reader); this.eof = false; this.usePrevious = false; this.previous = 0; this.index = 0; this.character = 1; this.line = 1; } /** * Construct a JSONTokener from an InputStream. * @param inputStream The source. */ public JSONTokener(InputStream inputStream) throws JSONException { this(new InputStreamReader(inputStream)); } /** * Construct a JSONTokener from a string. * * @param s A source string. */ public JSONTokener(String s) { this(new StringReader(s)); } /** * Back up one character. This provides a sort of lookahead capability, * so that you can test for a digit or letter before attempting to parse * the next number or identifier. */ public void back() throws JSONException { if (this.usePrevious || this.index <= 0) { throw new JSONException("Stepping back two steps is not supported"); } this.index -= 1; this.character -= 1; this.usePrevious = true; this.eof = false; } /** * Get the hex value of a character (base16). * @param c A character between '0' and '9' or between 'A' and 'F' or * between 'a' and 'f'. * @return An int between 0 and 15, or -1 if c was not a hex digit. */ public static int dehexchar(char c) { if (c >= '0' && c <= '9') { return c - '0'; } if (c >= 'A' && c <= 'F') { return c - ('A' - 10); } if (c >= 'a' && c <= 'f') { return c - ('a' - 10); } return -1; } public boolean end() { return this.eof && !this.usePrevious; } /** * Determine if the source string still contains characters that next() * can consume. * @return true if not yet at the end of the source. */ public boolean more() throws JSONException { this.next(); if (this.end()) { return false; } this.back(); return true; } /** * Get the next character in the source string. * * @return The next character, or 0 if past the end of the source string. */ public char next() throws JSONException { int c; if (this.usePrevious) { this.usePrevious = false; c = this.previous; } else { try { c = this.reader.read(); } catch (IOException exception) { throw new JSONException(exception); } if (c <= 0) { // End of stream this.eof = true; c = 0; } } this.index += 1; if (this.previous == '\r') { this.line += 1; this.character = c == '\n' ? 0 : 1; } else if (c == '\n') { this.line += 1; this.character = 0; } else { this.character += 1; } this.previous = (char) c; return this.previous; } /** * Consume the next character, and check that it matches a specified * character. * @param c The character to match. * @return The character. * @throws JSONException if the character does not match. */ public char next(char c) throws JSONException { char n = this.next(); if (n != c) { throw this.syntaxError("Expected '" + c + "' and instead saw '" + n + "'"); } return n; } /** * Get the next n characters. * * @param n The number of characters to take. * @return A string of n characters. * @throws JSONException * Substring bounds error if there are not * n characters remaining in the source string. */ public String next(int n) throws JSONException { if (n == 0) { return ""; } char[] chars = new char[n]; int pos = 0; while (pos < n) { chars[pos] = this.next(); if (this.end()) { throw this.syntaxError("Substring bounds error"); } pos += 1; } return new String(chars); } /** * Get the next char in the string, skipping whitespace. * @throws JSONException * @return A character, or 0 if there are no more characters. */ public char nextClean() throws JSONException { for (;;) { char c = this.next(); if (c == 0 || c > ' ') { return c; } } } /** * Return the characters up to the next close quote character. * Backslash processing is done. The formal JSON format does not * allow strings in single quotes, but an implementation is allowed to * accept them. * @param quote The quoting character, either * <code>"</code>&nbsp;<small>(double quote)</small> or * <code>'</code>&nbsp;<small>(single quote)</small>. * @return A String. * @throws JSONException Unterminated string. */ public String nextString(char quote) throws JSONException { char c; StringBuilder sb = new StringBuilder(); for (;;) { c = this.next(); switch (c) { case 0: case '\n': case '\r': throw this.syntaxError("Unterminated string"); case '\\': c = this.next(); switch (c) { case 'b': sb.append('\b'); break; case 't': sb.append('\t'); break; case 'n': sb.append('\n'); break; case 'f': sb.append('\f'); break; case 'r': sb.append('\r'); break; case 'u': sb.append((char)Integer.parseInt(this.next(4), 16)); break; case '"': case '\'': case '\\': case '/': sb.append(c); break; default: throw this.syntaxError("Illegal escape."); } break; default: if (c == quote) { return sb.toString(); } sb.append(c); } } } /** * Get the text up but not including the specified character or the * end of line, whichever comes first. * @param delimiter A delimiter character. * @return A string. */ public String nextTo(char delimiter) throws JSONException { StringBuilder sb = new StringBuilder(); for (;;) { char c = this.next(); if (c == delimiter || c == 0 || c == '\n' || c == '\r') { if (c != 0) { this.back(); } return sb.toString().trim(); } sb.append(c); } } /** * Get the text up but not including one of the specified delimiter * characters or the end of line, whichever comes first. * @param delimiters A set of delimiter characters. * @return A string, trimmed. */ public String nextTo(String delimiters) throws JSONException { char c; StringBuilder sb = new StringBuilder(); for (;;) { c = this.next(); if (delimiters.indexOf(c) >= 0 || c == 0 || c == '\n' || c == '\r') { if (c != 0) { this.back(); } return sb.toString().trim(); } sb.append(c); } } /** * Get the next value. The value can be a Boolean, Double, Integer, * JSONArray, JSONObject, Long, or String, or the JSONObject.NULL object. * @throws JSONException If syntax error. * * @return An object. */ public Object nextValue() throws JSONException { char c = this.nextClean(); String string; switch (c) { case '"': case '\'': return this.nextString(c); case '{': this.back(); return new JSONObject(this); case '[': this.back(); return new JSONArray(this); } /* * Handle unquoted text. This could be the values true, false, or * null, or it can be a number. An implementation (such as this one) * is allowed to also accept non-standard forms. * * Accumulate characters until we reach the end of the text or a * formatting character. */ StringBuilder sb = new StringBuilder(); while (c >= ' ' && ",:]}/\\\"[{;=#".indexOf(c) < 0) { sb.append(c); c = this.next(); } this.back(); string = sb.toString().trim(); if ("".equals(string)) { throw this.syntaxError("Missing value"); } return JSONObject.stringToValue(string); } /** * Skip characters until the next character is the requested character. * If the requested character is not found, no characters are skipped. * @param to A character to skip to. * @return The requested character, or zero if the requested character * is not found. */ public char skipTo(char to) throws JSONException { char c; try { long startIndex = this.index; long startCharacter = this.character; long startLine = this.line; this.reader.mark(1000000); do { c = this.next(); if (c == 0) { this.reader.reset(); this.index = startIndex; this.character = startCharacter; this.line = startLine; return c; } } while (c != to); } catch (IOException exception) { throw new JSONException(exception); } this.back(); return c; } /** * Make a JSONException to signal a syntax error. * * @param message The error message. * @return A JSONException object, suitable for throwing */ public JSONException syntaxError(String message) { return new JSONException(message + this.toString()); } /** * Make a printable string of this JSONTokener. * * @return " at {index} [character {character} line {line}]" */ public String toString() { return " at " + this.index + " [character " + this.character + " line " + this.line + "]"; } }
[ "danielmillst@gmail.com" ]
danielmillst@gmail.com
a14472c7829bbf54acd14165d3369ef9015eb631
b9b7163135638e77cb06776dd47f4eaa553287d5
/src/main/java/Basic2/Rectangle.java
8c795ef86369b7b0cd8dcd3a364bf8a632266ec3
[]
no_license
hwagok92/Spring-08_Autowired
94687be44fcf22d0a72e70fa1c94eaa4374f54a9
0a1c8119d63e738f36dae670a4cc3d095e30b178
refs/heads/master
2022-12-26T03:20:32.662784
2020-10-06T08:12:47
2020-10-06T08:12:47
null
0
0
null
null
null
null
UTF-8
Java
false
false
97
java
package Basic2; public interface Rectangle { int getX(); int getY(); String make(); }
[ "hwagok92@gmail.com" ]
hwagok92@gmail.com
0fe2b6ff74662c65374ed3a7e9f7bda186aae64d
fb54f1aab16867489db5123e0e3964c59c164fc2
/src/main/java/lims/processor/purchases/PurchaseProcessorDriver.java
d68741e2269e136eb7921f9af1afce8ab6f6f241
[ "Apache-2.0" ]
permissive
russellchang54/kafka-stream
7790ea4e5cbf97a0b80d7ab5451ec36ea81ff9be
f0a3c01e736c1ecd51a8d60f2816740328ffff2e
refs/heads/master
2021-05-11T03:32:40.603668
2018-01-18T02:13:53
2018-01-18T02:13:53
117,918,897
0
0
null
null
null
null
UTF-8
Java
false
false
3,519
java
/* * Copyright 2016 Bill Bejeck * * 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 lims.processor.purchases; import lims.model.Purchase; import lims.model.PurchasePattern; import lims.model.RewardAccumulator; import lims.serializer.JsonDeserializer; import lims.serializer.JsonSerializer; import org.apache.kafka.common.serialization.StringDeserializer; import org.apache.kafka.common.serialization.StringSerializer; import org.apache.kafka.streams.KafkaStreams; import org.apache.kafka.streams.StreamsConfig; import org.apache.kafka.streams.processor.TopologyBuilder; import org.apache.kafka.streams.processor.WallclockTimestampExtractor; import java.util.Properties; public class PurchaseProcessorDriver { public static void main(String[] args) throws Exception { StreamsConfig streamingConfig = new StreamsConfig(getProperties()); JsonDeserializer<Purchase> purchaseJsonDeserializer = new JsonDeserializer<>(Purchase.class); JsonSerializer<Purchase> purchaseJsonSerializer = new JsonSerializer<>(); JsonSerializer<RewardAccumulator> rewardAccumulatorJsonSerializer = new JsonSerializer<>(); JsonSerializer<PurchasePattern> purchasePatternJsonSerializer = new JsonSerializer<>(); StringDeserializer stringDeserializer = new StringDeserializer(); StringSerializer stringSerializer = new StringSerializer(); TopologyBuilder topologyBuilder = new TopologyBuilder(); topologyBuilder.addSource("SOURCE", stringDeserializer, purchaseJsonDeserializer, "src-topic") .addProcessor("PROCESS", CreditCardAnonymizer::new, "SOURCE") .addProcessor("PROCESS2", PurchasePatterns::new, "PROCESS") .addProcessor("PROCESS3", CustomerRewards::new, "PROCESS") .addSink("SINK", "patterns", stringSerializer, purchasePatternJsonSerializer, "PROCESS2") .addSink("SINK2", "rewards",stringSerializer, rewardAccumulatorJsonSerializer, "PROCESS3") .addSink("SINK3", "purchases", stringSerializer, purchaseJsonSerializer, "PROCESS"); System.out.println("Starting PurchaseProcessor Example"); KafkaStreams streaming = new KafkaStreams(topologyBuilder, streamingConfig); streaming.start(); System.out.println("Now started PurchaseProcessor Example"); } private static Properties getProperties() { Properties props = new Properties(); props.put(StreamsConfig.CLIENT_ID_CONFIG, "Example-Processor-Job"); props.put("group.id", "test-consumer-group"); props.put(StreamsConfig.APPLICATION_ID_CONFIG, "testing-processor-api"); props.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:9092"); props.put(StreamsConfig.ZOOKEEPER_CONNECT_CONFIG, "localhost:2181"); props.put(StreamsConfig.REPLICATION_FACTOR_CONFIG, 1); props.put(StreamsConfig.TIMESTAMP_EXTRACTOR_CLASS_CONFIG, WallclockTimestampExtractor.class); return props; } }
[ "zhangjun4@dazd.cn" ]
zhangjun4@dazd.cn
c3df08fdd657e794ebce8f70bf536caebf6c6f1f
17daf2e564878c0ea9524702d2b370050f5f2016
/notificatorlib/src/main/java/com/siggytech/utils/communication/model/QueueRequestModel.java
11e5d4d99bf4ae83156db0ffd0758deba4e7b6c7
[ "Apache-2.0" ]
permissive
SiggyTech/communicationlib
fce05c74d30702581cc2eae8e3796a6826190f9b
d66f7c904d8ac6150a551a9cc63c89bdb185b246
refs/heads/master
2023-07-11T14:28:41.067572
2021-08-07T17:23:27
2021-08-07T17:23:27
208,161,996
2
0
null
null
null
null
UTF-8
Java
false
false
1,209
java
package com.siggytech.utils.communication.model; import com.google.gson.annotations.SerializedName; public class QueueRequestModel { @SerializedName("iddevice") private String idDevice; @SerializedName("API_KEY") private String apiKey; @SerializedName("groupid") private String idGroup; @SerializedName("timemark") private String timeMark; public QueueRequestModel(String idDevice, String apiKey, String idGroup, String timeMark) { this.idDevice = idDevice; this.apiKey = apiKey; this.idGroup = idGroup; this.timeMark = timeMark; } public String getIdDevice() { return idDevice; } public void setIdDevice(String idDevice) { this.idDevice = idDevice; } public String getApiKey() { return apiKey; } public void setApiKey(String apiKey) { this.apiKey = apiKey; } public String getIdGroup() { return idGroup; } public void setIdGroup(String idGroup) { this.idGroup = idGroup; } public String getTimeMark() { return timeMark; } public void setTimeMark(String timeMark) { this.timeMark = timeMark; } }
[ "k.kusse@gmail.com" ]
k.kusse@gmail.com
7289b5c52fa36e5bf1ec4461a252f853f5fea615
4c2adaec2ef3c290fc4e4aaa9677f19a34e80236
/JARVICE/src/jarvice/intermediate/SymTabKey.java
43c2f428d7b3da1207a411c649b3433ceb8e6db5
[]
no_license
rob0229/JARVICE
d6b9051cddd21decc15fe13063840c798e2cda1c
0b837a63def9605fb2b39ef6b2d7fd78a72e66c4
refs/heads/master
2020-05-30T10:44:48.690481
2014-03-02T02:42:07
2014-03-02T02:42:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
68
java
package jarvice.intermediate; public interface SymTabKey { }
[ "rob0229@gmail.com" ]
rob0229@gmail.com
4b50abf746ab0b51f07560f7513b07ffe1cf64dc
ef729a106a4bf4718e52c27b27ef6f0479e80060
/Code/CouldOfficeGenerator/src/main/java/DNA/mapper/MenuRoleMapper.java
a320a1a1136f53097b2f4a84fdb70e2bd3860731
[]
no_license
DNA-tyht/CouldOffice
b5572e4c9b9006d6fb11a962b2de7e9a54fdf246
c4f6a25d22bc9bd647358e81a224956611669cad
refs/heads/master
2023-07-27T07:19:36.466162
2021-09-12T12:54:05
2021-09-12T12:54:05
401,205,101
0
0
null
null
null
null
UTF-8
Java
false
false
250
java
package DNA.mapper; import DNA.bean.MenuRole; import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** * <p> * Mapper 接口 * </p> * * @author DNA * @since 2021-08-21 */ public interface MenuRoleMapper extends BaseMapper<MenuRole> { }
[ "79902591+DNA-tyht@users.noreply.github.com" ]
79902591+DNA-tyht@users.noreply.github.com
6a2bd1cda03b932aa4e0b7735965919203aa50b2
e75be673baeeddee986ece49ef6e1c718a8e7a5d
/submissions/blizzard/Corpus/eclipse.jdt.ui/6785.java
214c569b260a52b31661992fc8a83732675a1d65
[ "MIT" ]
permissive
zhendong2050/fse18
edbea132be9122b57e272a20c20fae2bb949e63e
f0f016140489961c9e3c2e837577f698c2d4cf44
refs/heads/master
2020-12-21T11:31:53.800358
2018-07-23T10:10:57
2018-07-23T10:10:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
110
java
//cannot rename to j package p; class A { int j; void m(int i) { j = 0; } }
[ "tim.menzies@gmail.com" ]
tim.menzies@gmail.com
997c75a3c8de4f587c13470fa2168805d5d623c8
023f377548a32285a25be2e3cf4e0c59d7db17f6
/backend/src/main/java/br/ufsc/avaliacaomunicipal/repository/UsuarioRepository.java
ea8649a944cc0ddbfad7d926dd47ba2c2f6f4e4b
[ "MIT" ]
permissive
wellingtondsf/avaliacao-municipal
0d5bf13b665dc0d05158cb6d927e080ae224d5ca
72668ea97da565ee8470282b28d5188dcc80819d
refs/heads/master
2023-01-21T18:13:46.511938
2021-05-03T18:39:02
2021-05-03T18:39:02
239,916,884
0
1
MIT
2023-01-06T02:32:09
2020-02-12T03:15:36
TypeScript
UTF-8
Java
false
false
237
java
package br.ufsc.avaliacaomunicipal.repository; import org.springframework.data.jpa.repository.JpaRepository; import br.ufsc.avaliacaomunicipal.model.Usuario; public interface UsuarioRepository extends JpaRepository<Usuario, Long> { }
[ "wellington@bridge.ufsc.br" ]
wellington@bridge.ufsc.br
e8c7d0297b9f9980c550511180b417bab1430007
04b3a2af23a9386e352ec59c1a74a9677ae7322f
/src/main/java/com/tenx/ms/retail/stock/rest/StockController.java
066e737a23b10b9c0a10f2b1601bc51e05b9d6fe
[]
no_license
jatingera/cre-ms-retail
47bc1b779f9b7090117d9c7c89e7d385073bf386
ba7fb580ba0dbaa1d5e9f06eb9ff9c5e7de9a3a8
refs/heads/master
2021-01-19T10:31:24.800423
2017-04-25T17:27:17
2017-04-25T17:27:17
87,872,273
0
0
null
null
null
null
UTF-8
Java
false
false
1,747
java
package com.tenx.ms.retail.stock.rest; import com.tenx.ms.commons.rest.RestConstants; import com.tenx.ms.retail.stock.rest.dto.Stock; import com.tenx.ms.retail.stock.service.StockService; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponses; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping( value = RestConstants.VERSION_ONE + "/stock/{storeId}/{productId}" ) public class StockController { @Autowired private StockService stockService; @ApiOperation( "Add or update stock" ) @ApiResponses( value = {@ApiResponse( code = 200, message = "Stock updated sucessfully" ), @ApiResponse( code = 412, message = "Precondition failiure" ), @ApiResponse( code = 500, message = "Internal service error" )} ) @RequestMapping( method = RequestMethod.POST, consumes = {"application/json"} ) public void addOrUpdate( @ApiParam( name = "storeId" ) @PathVariable Long storeId, @ApiParam( name = "productId" ) @PathVariable Long productId, @ApiParam( name = "count", value = "fields for creating store", required = true ) @RequestBody @Validated Stock stock) { stockService.addUpdateStock(stock.getCount(), storeId, productId); } }
[ "jgera.ctr@C02RJ12UG8WM-M.local" ]
jgera.ctr@C02RJ12UG8WM-M.local
acf3563201b3eede21d35b8928e73cc4e4970fc4
cd6612c191d1b41ad9f281a42d20fe6eedaf3067
/src/main/java/code/advcourse/PrimJarnikGreedy/App.java
2fa94147ee707f994780a94f5f6eb51947014d97
[]
no_license
mangeshh/coding-practice-short-notes
3aadedcba66e7ec9ee6b8d730ce0658016156d3b
ae442dbf6ee2e2cb9a8f6d3babe895b5c3d972a6
refs/heads/master
2022-11-28T17:52:16.843328
2020-07-25T17:35:11
2020-07-25T17:35:11
282,493,126
0
0
null
null
null
null
UTF-8
Java
false
false
1,283
java
package code.advcourse.PrimJarnikGreedy; import java.util.ArrayList; import java.util.List; public class App { public static void main(String[] args) { Graph graph = new Graph(); Vertex vertexA = new Vertex("A"); Vertex vertexB = new Vertex("B"); Vertex vertexC = new Vertex("C"); Vertex vertexD = new Vertex("D"); Vertex vertexE = new Vertex("E"); Vertex vertexF = new Vertex("F"); Vertex vertexG = new Vertex("G"); graph.addVertex(vertexA); graph.addVertex(vertexB); graph.addVertex(vertexC); graph.addVertex(vertexD); graph.addVertex(vertexE); graph.addVertex(vertexF); graph.addVertex(vertexG); graph.addEdge(new Edge(vertexA, vertexB, 7)); graph.addEdge(new Edge(vertexA, vertexD, 5)); graph.addEdge(new Edge(vertexD, vertexB, 9)); graph.addEdge(new Edge(vertexD, vertexE, 15)); graph.addEdge(new Edge(vertexD, vertexF, 6)); graph.addEdge(new Edge(vertexB, vertexE, 7)); graph.addEdge(new Edge(vertexB, vertexC, 8)); graph.addEdge(new Edge(vertexC, vertexE, 5)); graph.addEdge(new Edge(vertexF, vertexE, 8)); graph.addEdge(new Edge(vertexF, vertexG, 11)); graph.addEdge(new Edge(vertexE, vertexG, 9)); Algorithm algorithm = new Algorithm(graph); algorithm.spanningTree(); algorithm.show(); } }
[ "mangesh.hankare@gmail.com" ]
mangesh.hankare@gmail.com
b91842d741128ebbb488fec9b4249b64bccbb692
9f4673eaf776869a5986777167014f455c9de7c0
/CoreJava/interface/lambda/Car.java
ade9822162dd394962fdf4c938da607be042c3d3
[]
no_license
ranjanakrishna/TY_CG_HTD_BangaloreNovember_JFS_RanjanaK
1bc07ef49d4625ebc922e27a8c15ebe78dbb8369
70ad637cf39a2847ce5e9ebac2a5baafd068f743
refs/heads/master
2022-11-30T10:10:33.782526
2020-01-18T08:41:08
2020-01-18T08:41:08
225,846,058
0
0
null
2022-11-24T10:02:24
2019-12-04T11:00:50
Java
UTF-8
Java
false
false
366
java
package lambda; public class Car { // Vehicle v1=()->{ // System.out.println("car is moving"); // }; // Vehicle v1= a ->{ // System.out.println("car is moving"); // }; // Vehicle v1= (a,b) ->{ // System.out.println("car is moving"); // }; Vehicle v1= (a,b) -> System.out.println("car is moving"); // if only one statement is present=>no need of "{};" }
[ "ranjanask7198@gmail.com" ]
ranjanask7198@gmail.com
f7e22088d2572942e971174272b39c65907aae27
ebb7c476faf3b5904818c8a29bd1353bbe20acc9
/src/main/java/io/github/knowmyminister/web/rest/errors/BadRequestAlertException.java
2e917d862561865867b86fa3c7fdd4e6ca6e6a61
[]
no_license
mahendrabagul/knowmyminister-jhipster
c66ec86f597b85e4479eac50ac1e64647a6cb7e5
8c8540e4b2d57f13e4ed4f8b49220d296c01b48f
refs/heads/master
2022-06-21T04:12:28.518269
2018-01-22T16:43:01
2018-01-22T16:43:01
232,518,600
0
0
null
2022-06-03T01:07:48
2020-01-08T08:45:03
Java
UTF-8
Java
false
false
1,252
java
package io.github.knowmyminister.web.rest.errors; import org.zalando.problem.AbstractThrowableProblem; import org.zalando.problem.Status; import java.net.URI; import java.util.HashMap; import java.util.Map; public class BadRequestAlertException extends AbstractThrowableProblem { private static final long serialVersionUID = -2330278630816101694L; private final String entityName; private final String errorKey; public BadRequestAlertException(String defaultMessage, String entityName, String errorKey) { this(ErrorConstants.DEFAULT_TYPE, defaultMessage, entityName, errorKey); } public BadRequestAlertException(URI type, String defaultMessage, String entityName, String errorKey) { super(type, defaultMessage, Status.BAD_REQUEST, null, null, null, getAlertParameters(entityName, errorKey)); this.entityName = entityName; this.errorKey = errorKey; } public String getEntityName() { return entityName; } public String getErrorKey() { return errorKey; } private static Map<String, Object> getAlertParameters(String entityName, String errorKey) { Map<String, Object> parameters = new HashMap<>(); parameters.put("message", "error." + errorKey); parameters.put("params", entityName); return parameters; } }
[ "bagulm123@gmail.com" ]
bagulm123@gmail.com
05ed73a76b0b2972a8aff202a4fe2ff35e799251
1fbd1d6f4315a722b51bcc4e0b292b2f93501f32
/src/com/itertk/app/mpos/trade/convenience/AddContractorDialog.java
347c6d915855e9648497199eb42e8fa4af9f2f07
[]
no_license
zhangjunzhere/mpos
0375f68371621b776bbb3601832ebf8dd6174829
f3ce24feea51dd4d691039162fea826b87501e75
refs/heads/master
2021-01-01T19:21:16.477891
2016-03-14T07:07:14
2016-03-14T07:07:17
30,794,803
0
0
null
null
null
null
UTF-8
Java
false
false
2,305
java
package com.itertk.app.mpos.trade.convenience; import android.app.Dialog; import android.content.Context; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; import com.itertk.app.mpos.R; /** * Created by Administrator on 2014/7/11. */ public class AddContractorDialog extends Dialog { static final String TAG = "BankChooseDialog"; Button btnBack; Button btnOK; Context context; EditText textFullName; EditText textPhone; EditText textEmail; Contractor contractor; public Contractor getContractor() { return contractor; } public AddContractorDialog(Context context, int theme) { super(context, theme); this.context = context; setCanceledOnTouchOutside(false); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.setContentView(R.layout.dialog_add_contractor); textFullName = (EditText) findViewById(R.id.textFullName); textPhone = (EditText) findViewById(R.id.textPhone); textEmail = (EditText) findViewById(R.id.textEmail); btnBack = (Button) findViewById(R.id.btnBack); btnBack.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { AddContractorDialog.this.dismiss(); } }); btnOK = (Button) findViewById(R.id.btnOK); btnOK.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (textFullName.getText().toString().isEmpty()) { Toast.makeText(context, "姓名不能为空", Toast.LENGTH_SHORT).show(); return; } if (textPhone.getText().toString().isEmpty()) { Toast.makeText(context, "手机号码不能为空", Toast.LENGTH_SHORT).show(); return; } contractor = new Contractor(textFullName.getText().toString(), textPhone.getText().toString(), textEmail.getText().toString()); AddContractorDialog.this.dismiss(); } }); } }
[ "junzheng_zhang@asus.com" ]
junzheng_zhang@asus.com
92465fb5a0ab54d5e2baf0d5ff38e1ad02f376c8
f1bf152f8cfe3fc7b10470097f874c1c0bf21fd6
/TestResult/src/main/java/com/tr/generic/ExtentReport.java
d862659a0b9c627a3909c5c8cbdb955068884c48
[]
no_license
Manasayeshwanth/TestResultTask1
c14d4cba68c64c1bde3f576a83805ac18ad239fa
3caf89e928c6482315696ef89a61b78ef4283a93
refs/heads/master
2023-04-09T01:08:39.615363
2021-04-21T09:01:03
2021-04-21T09:01:03
360,138,779
0
0
null
null
null
null
UTF-8
Java
false
false
1,724
java
package com.tr.generic; import org.testng.ITestListener; import org.testng.ITestContext; import org.testng.ITestResult; import com.aventstack.extentreports.ExtentReports; import com.aventstack.extentreports.ExtentTest; import com.aventstack.extentreports.Status; import com.aventstack.extentreports.reporter.ExtentSparkReporter; import com.aventstack.extentreports.reporter.configuration.Theme; public class ExtentReport extends Base implements ITestListener { public ExtentTest test; public ExtentReports report; public void onFinish(ITestContext result) { report.flush(); } public void onStart(ITestContext result) { ExtentSparkReporter spark=new ExtentSparkReporter("./ExtentReport.html"); spark.config().setTheme(Theme.DARK); spark.config().setDocumentTitle("TestRessult"); spark.config().setReportName("View TestRes"); report=new ExtentReports(); report.attachReporter(spark); report.setSystemInfo("platform", "windows"); report.setSystemInfo("OS", "Windows 10"); report.setSystemInfo("Environment", "Testing Environment"); report.setSystemInfo("Reporter", "Manasa"); } public void onTestFailedButWithinSuccessPercentage(ITestResult arg0) { } public void onTestFailure(ITestResult result) { } public void onTestSkipped(ITestResult result) { test.log(Status.SKIP, result.getMethod().getMethodName()+" is skipped") ; test.log(Status.SKIP, result.getThrowable()); } public void onTestStart(ITestResult result) { test=report.createTest(result.getMethod().getMethodName()); } public void onTestSuccess(ITestResult result) { test.log(Status.PASS, result.getMethod().getMethodName()+" is passed"); } }
[ "mansa.r.gowda@gmail.com" ]
mansa.r.gowda@gmail.com
88710f6e29d34d2bfe2a4186d1151109d1b33a0f
1ccb2da11c81b2cf2e6c1b4814c331f9ff109b62
/src/com/solucaoSistemas/AgendaApp/MaskedEditText.java
54b01d1901c82babf372d6b22087dcf49e287c3e
[]
no_license
bdassumpcao/AgendaApp
b21bc14d5da9a0547025b05dc9bcf3af45f9a81b
3422f4c2c0720dbe095bea69347f21590ca4cf3c
refs/heads/master
2016-08-11T22:15:58.392996
2015-08-31T17:36:17
2015-08-31T17:36:17
36,019,309
0
0
null
null
null
null
UTF-8
Java
false
false
10,162
java
package com.solucaoSistemas.AgendaApp; import android.annotation.SuppressLint; import android.content.Context; import android.content.res.TypedArray; import android.text.Editable; import android.text.InputType; import android.text.TextWatcher; import android.util.AttributeSet; import android.view.KeyEvent; import android.view.View; import android.view.inputmethod.EditorInfo; import android.widget.EditText; import android.widget.TextView; public class MaskedEditText extends EditText implements TextWatcher { private String mask; private char maskFill; private char charRepresentation; private int[] rawToMask; private RawText rawText; private boolean editingBefore; private boolean editingOnChanged; private boolean editingAfter; private int[] maskToRaw; private char[] charsInMask; private int selection; private boolean initialized; private boolean ignore; protected int maxRawLength; private int lastValidMaskPosition; private boolean selectionChanged; private OnFocusChangeListener focusChangeListener; public MaskedEditText(Context context) { super(context); init(); } @SuppressLint("Recycle") public MaskedEditText(Context context, AttributeSet attrs) { super(context, attrs); init(); TypedArray attributes = context.obtainStyledAttributes(attrs, R.styleable.MaskedEditText); mask = attributes.getString(R.styleable.MaskedEditText_mask); String maskFill = attributes.getString(R.styleable.MaskedEditText_mask_fill); this.maskFill = (maskFill != null && maskFill.length() > 0) ? maskFill.charAt(0) : ' '; String representation = attributes.getString(R.styleable.MaskedEditText_char_representation); if(representation == null) { charRepresentation = '#'; } else { charRepresentation = representation.charAt(0); } cleanUp(); // Ignoring enter key presses setOnEditorActionListener(new OnEditorActionListener() { @Override public boolean onEditorAction(TextView v, int actionId,KeyEvent event) { switch (actionId) { case EditorInfo.IME_ACTION_NEXT: // fixing actionNext return false; default: return true; } } }); } /** @param listener - its onFocusChange() method will be called before performing MaskedEditText operations, * related to this event. */ @Override public void setOnFocusChangeListener(OnFocusChangeListener listener) { focusChangeListener = listener; } private void cleanUp() { if (mask == null) { return; } initialized = false; generatePositionArrays(); rawText = new RawText(); selection = rawToMask[0]; editingBefore = true; editingOnChanged = true; editingAfter = true; if(hasHint()) { this.setText(null); } else { this.setText(mask.replace(charRepresentation, maskFill)); } editingBefore = false; editingOnChanged = false; editingAfter = false; maxRawLength = maskToRaw[previousValidPosition(mask.length() - 1)] + 1; lastValidMaskPosition = findLastValidMaskPosition(); initialized = true; super.setOnFocusChangeListener(new OnFocusChangeListener() { @Override public void onFocusChange(View v, boolean hasFocus) { if (focusChangeListener != null) { focusChangeListener.onFocusChange(v, hasFocus); } if(hasFocus() && (rawText.length() > 0 || !hasHint())) { selectionChanged = false; MaskedEditText.this.setSelection(lastValidPosition()); } } }); } private int findLastValidMaskPosition() { for(int i = maskToRaw.length - 1; i >= 0; i--) { if(maskToRaw[i] != -1) return i; } throw new RuntimeException("Mask contains only the representation char"); } private boolean hasHint() { return getHint() != null; } public MaskedEditText(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); init(); } public void setMask(String mask) { this.mask = mask; cleanUp(); } public String getMask() { return this.mask; } public void setCharRepresentation(char charRepresentation) { this.charRepresentation = charRepresentation; cleanUp(); } public char getCharRepresentation() { return this.charRepresentation; } private void generatePositionArrays() { int[] aux = new int[mask.length()]; maskToRaw = new int[mask.length()]; String charsInMaskAux = ""; int charIndex = 0; for(int i = 0; i < mask.length(); i++) { char currentChar = mask.charAt(i); if(currentChar == charRepresentation) { aux[charIndex] = i; maskToRaw[i] = charIndex++; } else { String charAsString = Character.toString(currentChar); if(!charsInMaskAux.contains(charAsString) && !Character.isLetter(currentChar) && !Character.isDigit(currentChar)) { charsInMaskAux = charsInMaskAux.concat(charAsString); } maskToRaw[i] = -1; } } if(charsInMaskAux.indexOf(' ') < 0) { charsInMaskAux = charsInMaskAux + " "; } charsInMask = charsInMaskAux.toCharArray(); rawToMask = new int[charIndex]; for (int i = 0; i < charIndex; i++) { rawToMask[i] = aux[i]; } } private void init() { addTextChangedListener(this); // this.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS); this.setInputType(InputType.TYPE_CLASS_NUMBER); } @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { if (mask == null) { return; } if(!editingBefore) { editingBefore = true; if(start > lastValidMaskPosition) { ignore = true; } int rangeStart = start; if(after == 0) { rangeStart = erasingStart(start); } Range range = calculateRange(rangeStart, start + count); if(range.getStart() != -1) { rawText.subtractFromString(range); } if(count > 0) { selection = previousValidPosition(start); } } } private int erasingStart(int start) { while(start > 0 && maskToRaw[start] == -1) { start--; } return start; } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { if (mask == null) { return; } if(!editingOnChanged && editingBefore) { editingOnChanged = true; if(ignore) { return; } if(count > 0) { int startingPosition = maskToRaw[nextValidPosition(start)]; String addedString = s.subSequence(start, start + count).toString(); count = rawText.addToString(clear(addedString), startingPosition, maxRawLength); if(initialized) { int currentPosition; if(startingPosition + count < rawToMask.length) currentPosition = rawToMask[startingPosition + count]; else currentPosition = lastValidMaskPosition + 1; selection = nextValidPosition(currentPosition); } } } } @Override public void afterTextChanged(Editable s) { if (mask == null) { return; } if(!editingAfter && editingBefore && editingOnChanged) { editingAfter = true; if(rawText.length() == 0 && hasHint()) { selection = 0; setText(null); } else { setText(makeMaskedText()); } selectionChanged = false; setSelection(selection); editingBefore = false; editingOnChanged = false; editingAfter = false; ignore = false; } } @Override protected void onSelectionChanged(int selStart, int selEnd) { // On Android 4+ this method is being called more than 1 time if there is a hint in the EditText, what moves the cursor to left // Using the boolean var selectionChanged to limit to one execution if (mask == null) { super.onSelectionChanged(selStart, selEnd); return; } if(initialized ){ if(!selectionChanged) { if(rawText.length() == 0 && hasHint()) { selStart = 0; selEnd = 0; } else { selStart = fixSelection(selStart); selEnd = fixSelection(selEnd); } setSelection(selStart, selEnd); selectionChanged = true; } else{//check to see if the current selection is outside the already entered text if(!(hasHint() && rawText.length() == 0) && selStart > rawText.length() - 1){ setSelection(fixSelection(selStart),fixSelection(selEnd)); } } } super.onSelectionChanged(selStart, selEnd); } private int fixSelection(int selection) { if(selection > lastValidPosition()) { return lastValidPosition(); } else { return nextValidPosition(selection); } } private int nextValidPosition(int currentPosition) { while(currentPosition < lastValidMaskPosition && maskToRaw[currentPosition] == -1) { currentPosition++; } if(currentPosition > lastValidMaskPosition) return lastValidMaskPosition + 1; return currentPosition; } private int previousValidPosition(int currentPosition) { while(currentPosition >= 0 && maskToRaw[currentPosition] == -1) { currentPosition--; if(currentPosition < 0) { return nextValidPosition(0); } } return currentPosition; } private int lastValidPosition() { if(rawText.length() == maxRawLength) { return rawToMask[rawText.length() - 1] + 1; } return nextValidPosition(rawToMask[rawText.length()]); } private String makeMaskedText() { char[] maskedText = mask.replace(charRepresentation, ' ').toCharArray(); for(int i = 0; i < rawToMask.length; i++) { if(i < rawText.length()) { maskedText[rawToMask[i]] = rawText.charAt(i); } else { maskedText[rawToMask[i]] = maskFill; } } return new String(maskedText); } private Range calculateRange(int start, int end) { Range range = new Range(); for(int i = start; i <= end && i < mask.length(); i++) { if(maskToRaw[i] != -1) { if(range.getStart() == -1) { range.setStart(maskToRaw[i]); } range.setEnd(maskToRaw[i]); } } if(end == mask.length()) { range.setEnd(rawText.length()); } if(range.getStart() == range.getEnd() && start < end) { int newStart = previousValidPosition(range.getStart() - 1); if(newStart < range.getStart()) { range.setStart(newStart); } } return range; } private String clear(String string) { for(char c : charsInMask) { string = string.replace(Character.toString(c), ""); } return string; } }
[ "bdassumpcao@gmail.com" ]
bdassumpcao@gmail.com
838ec7c01d7c2d8db7b2e6050b5a3b801344fdd5
d865bdf793944ed358c844c2d6c460d299962c5d
/app/src/main/java/com/star/demo/viewpager/ViewPagerDemoActivity.java
b865ea67624706aeb5a6b4fca8b656041458bb38
[]
no_license
StarJiao/AndroidDemo
1cbb188fe4e2c7ce8c9b65330d7999c156ad240f
6c08152beacd73f3822067235b54e74ffe4a5055
refs/heads/master
2020-03-23T01:44:28.152980
2018-09-18T07:26:10
2018-09-18T07:26:10
140,934,646
0
0
null
null
null
null
UTF-8
Java
false
false
938
java
package com.star.demo.viewpager; import android.app.Activity; import android.os.Bundle; import android.support.v4.view.ViewPager; import com.star.demo.R; import com.viewpagerindicator.CirclePageIndicator; import java.util.ArrayList; import java.util.List; public class ViewPagerDemoActivity extends Activity { private ViewPager viewPager; private CirclePageIndicator indicator; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_view_pager_demo); viewPager = (ViewPager) findViewById(R.id.viewpager); List<String> data = new ArrayList<>(); data.add("one"); data.add("two"); data.add("three"); viewPager.setAdapter(new PagerAdapterDemo(this, data)); indicator = (CirclePageIndicator) findViewById(R.id.indicator); indicator.setViewPager(viewPager); } }
[ "starjiao@slightech.com" ]
starjiao@slightech.com
8d2df2b77b7e3f6f38b54118b9ac98668e9994ec
c1791bce8b55528352e9b4b5bfd07367733a279e
/MineTweaker3-API/src/main/java/minetweaker/api/event/PlayerSmeltedEvent.java
62d5743ed720cc6d420c875a09bef1f854ed6ecf
[]
no_license
AnodeCathode/MineTweaker3
612ccd943729e755a3feafffeaf4a836e321eb92
f254aa99e33e2549757fc77ca83aeeca53f89bcb
refs/heads/master
2021-01-17T14:13:04.603498
2015-08-12T04:26:42
2015-08-12T04:26:42
40,580,018
0
0
null
2015-08-12T04:22:37
2015-08-12T04:22:37
null
UTF-8
Java
false
false
745
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 minetweaker.api.event; import minetweaker.api.item.IItemStack; import minetweaker.api.player.IPlayer; import stanhebben.zenscript.annotations.ZenGetter; /** * * @author Stan */ public class PlayerSmeltedEvent { private final IPlayer player; private final IItemStack output; public PlayerSmeltedEvent(IPlayer player, IItemStack output) { this.player = player; this.output = output; } @ZenGetter("player") public IPlayer getPlayer() { return player; } @ZenGetter("output") public IItemStack getOutput() { return output; } }
[ "stanhebben@gmail.com" ]
stanhebben@gmail.com
f750cf9f60b41c3ac3a8ced1a3c7639e198db915
3725029c4eace83baaddffda4c9984833316928d
/src/main/java/ju/elib/model/ElibDAOImple.java
aa4c604f53f6fb84de7f36e26861953c78da19e8
[]
no_license
bbubbush/library_service
45ccbca399e5281a64cfb808344b4b02cf0c1389
e9c108b7f3e16d11c9cea0d0fb6359d10dd81972
refs/heads/master
2021-09-05T13:29:10.556578
2018-01-28T06:58:29
2018-01-28T06:58:29
114,323,393
0
0
null
null
null
null
UTF-8
Java
false
false
5,974
java
package ju.elib.model; import java.util.HashMap; import java.util.List; import org.mybatis.spring.SqlSessionTemplate; import ju.dto.ElibDTO; public class ElibDAOImple implements ElibDAO { private SqlSessionTemplate sqlMap; public ElibDAOImple(SqlSessionTemplate sqlMap) { super(); this.sqlMap = sqlMap; } /**전자도서관 책 등록*/ public int elibInsert(ElibDTO dto) { int resultCount=sqlMap.insert("elibINSelib", dto); return resultCount; } /**최초 접근*/ public List<ElibDTO> elibFirst(String orderName, int startNum, int endNum, String idxParam) { HashMap<String, String> hmap=new HashMap<String, String>(); hmap.put("orderName", orderName); hmap.put("startNum", Integer.toString(startNum)); hmap.put("endNum", Integer.toString(endNum)); hmap.put("idxParam", idxParam); List<ElibDTO> eEduArr=sqlMap.selectList("elibSELfir", hmap); return eEduArr; } /**최초 접근 갯수*/ public int elibFirstCount(String idxParam) { HashMap<String, String> hmap=new HashMap<String, String>(); hmap.put("idxParam", idxParam); int contentMax=sqlMap.selectOne("elibSElfirCount", hmap); return contentMax; } /**컨텐츠 선택*/ public List<ElibDTO> elibContent(String el_idx) { List<ElibDTO> eEduArr=sqlMap.selectList("elibSELcon", el_idx); return eEduArr; } /**단순 검색*/ public List<ElibDTO> elibSimple(String simpleSearchText, String orderName, int startNum, int endNum, String idxParam) { HashMap<String, String> hmap=new HashMap<String, String>(); hmap.put("simpleSearchText", simpleSearchText); hmap.put("orderName", orderName); hmap.put("startNum", Integer.toString(startNum)); hmap.put("endNum", Integer.toString(endNum)); hmap.put("idxParam", idxParam); List<ElibDTO> eEduArr=sqlMap.selectList("elibSELsimple", hmap); return eEduArr; } /**단순 검색 갯수*/ public int elibSimpleCount(String simpleSearchText, String orderName, String idxParam) { HashMap<String, String> hmap=new HashMap<String, String>(); hmap.put("simpleSearchText", simpleSearchText); hmap.put("orderName", orderName); hmap.put("idxParam", idxParam); int contentMax=sqlMap.selectOne("elibSELsimpleCount", hmap); return contentMax; } /**상세검색*/ public List<ElibDTO> elibDetail(String where, String orderName, int startNum, int endNum, String idxParam) { HashMap<String, String> hmap=new HashMap<String, String>(); hmap.put("where", where); hmap.put("orderName", orderName); hmap.put("startNum", Integer.toString(startNum)); hmap.put("endNum", Integer.toString(endNum)); hmap.put("idxParam", idxParam); List<ElibDTO> elibArr=sqlMap.selectList("elibSELdetail", hmap); return elibArr; } /**상세검색 갯수*/ public int elibDetailCount(String where, String orderName, String idxParam) { HashMap<String, String> hmap=new HashMap<String, String>(); hmap.put("where", where); hmap.put("orderName", orderName); hmap.put("idxParam", idxParam); int contentMax=sqlMap.selectOne("elibSELdetailCount", hmap); return contentMax; } /**뷰어*/ public List<ElibDTO> elibViewer(String el_idx) { HashMap<String, String> hmap=new HashMap<String, String>(); hmap.put("el_idx", el_idx); List<ElibDTO> elibArr=sqlMap.selectList("elibSELview", hmap); return elibArr; } /**추천*/ public int elibRecommend(String el_idx, String el_recommend) { HashMap<String, String> hmap=new HashMap<String, String>(); hmap.put("el_idx", el_idx); hmap.put("el_recommend", el_recommend); int resultCount=sqlMap.update("elibUPDrec", hmap); return resultCount; } /**관리자 검색없는 리스트 보기*/ public List<ElibDTO> elibAdminNoList(int startNum, int endNum) { HashMap<String, String> hmap=new HashMap<String, String>(); hmap.put("startNum", Integer.toString(startNum)); hmap.put("endNum", Integer.toString(endNum)); List<ElibDTO> elibArr=sqlMap.selectList("elibSELnoList", hmap); return elibArr; } /**관리자 검색없는 리스트 보기 갯수*/ public int elibAdminNoListCount() { int resultCount=sqlMap.selectOne("elibSELnoListCount"); return resultCount; } /**삭제*/ public int elibDelete(String el_idx) { HashMap<String, String> hmap=new HashMap<String, String>(); hmap.put("el_idx", el_idx); int resultCount=sqlMap.delete("elibDEL", hmap); return resultCount; } /**수정*/ public int elibUpdate(String el_idx, String el_lg, String el_md, String el_subject, String el_writer, String el_pub, String el_info, String el_path, String change_idx){ HashMap<String, String> hmap=new HashMap<String, String>(); hmap.put("el_idx", el_idx); hmap.put("el_lg", el_lg); hmap.put("el_md", el_md); hmap.put("el_subject", el_subject); hmap.put("el_writer", el_writer); hmap.put("el_pub", el_pub); hmap.put("el_info", el_info); hmap.put("el_path", el_path); hmap.put("change_idx", change_idx); int resultCount=sqlMap.update("elibUPD", hmap); return resultCount; } /**관리자 검색*/ public List<ElibDTO> elibAdminSearch(String where, String order, String startNum, String endNum) { HashMap<String, String> hmap=new HashMap<String, String>(); hmap.put("where", where); hmap.put("order", order); hmap.put("startNum", startNum); hmap.put("endNum", endNum); List<ElibDTO> elibArr=sqlMap.selectList("elibSELadminSearch", hmap); return elibArr; } /**관리자 검색 갯수*/ public int elibAdminSearchCount(String where) { HashMap<String, String> hmap=new HashMap<String, String>(); hmap.put("where", where); int resultCount=sqlMap.selectOne("elibSELadminSearchCount", hmap); return resultCount; } /**전자도서 전체 중 추천 순서*/ public ElibDTO elibReccoOrder(){ List<ElibDTO>elibArr=sqlMap.selectList("elibSELrecoOrder"); return elibArr.get(0); } }
[ "kdw4458@naver.com" ]
kdw4458@naver.com
430f2441e4a918e5d46ee1b5d54a1f7da989e8a1
2a743b245584f81f305fcc51422689a3ba2dbc49
/flutter_knife/src/main/java/org/axen/flutterknife/plugin/BindFlutterViewAnnotationPlugin.java
57e6b4c287ce2d1974a130d4aed040a0fc68bf20
[]
no_license
axen1314/flutter_knife
2a2cd08065dc4e6a716647c31dde6181d4955a98
c66be2ad9c406537f95637c1d2c855b7f8ecd0be
refs/heads/main
2023-06-24T00:21:58.466962
2021-07-30T10:42:47
2021-07-30T10:42:47
388,737,313
0
0
null
null
null
null
UTF-8
Java
false
false
529
java
package org.axen.flutterknife.plugin; import android.app.Activity; import android.content.Context; import org.axen.flutterknife.annotation.BindFlutterView; import java.lang.reflect.Field; import io.flutter.embedding.android.FlutterView; public class BindFlutterViewAnnotationPlugin extends AbstractViewAnnotationPlugin<BindFlutterView> { @Override public FlutterView onConvert(Context context, Field field, BindFlutterView annotation) { return ((Activity)context).findViewById(annotation.value()); } }
[ "g怎" ]
g怎
e1d7eb5f20c4ad5cd8fa82035334209ef4cbf032
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/MATH-84b-3-30-SPEA2-WeightedSum:TestLen:CallDiversity/org/apache/commons/math/optimization/direct/DirectSearchOptimizer_ESTest_scaffolding.java
811d2553a14b5e2bddd91a752b5a9994ee858785
[]
no_license
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
cf118b23ecb87a8bf59643e42f7556b521d1f754
3bb39683f9c343b8ec94890a00b8f260d158dfe3
refs/heads/master
2022-07-29T14:44:00.774547
2020-08-10T15:14:49
2020-08-10T15:14:49
285,804,495
0
0
null
null
null
null
UTF-8
Java
false
false
3,934
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Mon Apr 06 16:02:03 UTC 2020 */ package org.apache.commons.math.optimization.direct; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; import static org.evosuite.shaded.org.mockito.Mockito.*; @EvoSuiteClassExclude public class DirectSearchOptimizer_ESTest_scaffolding { @org.junit.Rule public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule(); private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000); @BeforeClass public static void initEvoSuiteFramework() { org.evosuite.runtime.RuntimeSettings.className = "org.apache.commons.math.optimization.direct.DirectSearchOptimizer"; org.evosuite.runtime.GuiSupport.initialize(); org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000; org.evosuite.runtime.RuntimeSettings.mockSystemIn = true; org.evosuite.runtime.Runtime.getInstance().resetRuntime(); try { initMocksToAvoidTimeoutsInTheTests(); } catch(ClassNotFoundException e) {} } @Before public void initTestCase(){ threadStopper.storeCurrentThreads(); threadStopper.startRecordingTime(); org.evosuite.runtime.GuiSupport.setHeadless(); org.evosuite.runtime.Runtime.getInstance().resetRuntime(); org.evosuite.runtime.agent.InstrumentingAgent.activate(); } @After public void doneWithTestCase(){ threadStopper.killAndJoinClientThreads(); org.evosuite.runtime.agent.InstrumentingAgent.deactivate(); org.evosuite.runtime.GuiSupport.restoreHeadlessMode(); } private static void initializeClasses() { org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(DirectSearchOptimizer_ESTest_scaffolding.class.getClassLoader() , "org.apache.commons.math.optimization.direct.DirectSearchOptimizer$1", "org.apache.commons.math.MathException", "org.apache.commons.math.optimization.OptimizationException", "org.apache.commons.math.optimization.RealConvergenceChecker", "org.apache.commons.math.optimization.SimpleScalarValueChecker", "org.apache.commons.math.ConvergenceException", "org.apache.commons.math.MaxEvaluationsExceededException", "org.apache.commons.math.MaxIterationsExceededException", "org.apache.commons.math.analysis.MultivariateRealFunction", "org.apache.commons.math.optimization.MultivariateRealOptimizer", "org.apache.commons.math.FunctionEvaluationException", "org.apache.commons.math.optimization.RealPointValuePair", "org.apache.commons.math.optimization.direct.MultiDirectional", "org.apache.commons.math.MathRuntimeException", "org.apache.commons.math.MathRuntimeException$1", "org.apache.commons.math.MathRuntimeException$2", "org.apache.commons.math.MathRuntimeException$3", "org.apache.commons.math.MathRuntimeException$4", "org.apache.commons.math.MathRuntimeException$5", "org.apache.commons.math.MathRuntimeException$6", "org.apache.commons.math.MathRuntimeException$7", "org.apache.commons.math.optimization.direct.DirectSearchOptimizer", "org.apache.commons.math.MathRuntimeException$8", "org.apache.commons.math.optimization.GoalType", "org.apache.commons.math.MathRuntimeException$10", "org.apache.commons.math.MathRuntimeException$9" ); } private static void initMocksToAvoidTimeoutsInTheTests() throws ClassNotFoundException { mock(Class.forName("org.apache.commons.math.analysis.MultivariateRealFunction", false, DirectSearchOptimizer_ESTest_scaffolding.class.getClassLoader())); } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
47509ae8cd31ed09ffc52ac6576ac9a034d071a6
441bb36ebab314a383b94f9b8948a58b578ad1eb
/boot/boot-parent/boot-common/src/main/java/bt/project/common/entity/SysLogin.java
d0a3c62a7ee449e071831313cd180761ad3379a2
[]
no_license
DH19970815/workspace
07d01148010716863d30cde9e4ec77a82dd11360
710bc62b1675b2199bcd4506ec81391d06458c40
refs/heads/master
2023-01-03T02:54:55.228406
2020-10-29T08:22:48
2020-10-29T08:22:48
308,233,385
0
0
null
null
null
null
UTF-8
Java
false
false
306
java
package bt.project.common.entity; import lombok.Data; @Data public class SysLogin { private java.lang.String id; private java.lang.String username; private java.lang.String password; private java.lang.String phone; private java.util.Date created; private java.lang.String salt; }
[ "2192406468@qq.com" ]
2192406468@qq.com
1c3234d33f50ee4888756e5e8a1b05f027454036
b76ba7e293f3458178b03b42267150b7527a80a4
/src/main/java/cn/focus/eco/data/curator/core/SpringUtil.java
02eb88e4f1f4d41da3ec1a6c3812a4e4fce367ee
[ "Apache-2.0" ]
permissive
hanleijun/focus-redis-curator
22ca887c62d89b56c16817ba694ee7fb06a19db6
4308ed926cf93dcfb5d5e866631ba4c0f0670582
refs/heads/master
2020-03-17T13:52:43.363940
2018-05-16T10:17:57
2018-05-16T10:17:57
133,648,367
0
0
null
null
null
null
UTF-8
Java
false
false
1,762
java
package cn.focus.eco.data.curator.core; import org.springframework.beans.BeansException; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; import org.springframework.stereotype.Component; /** * Copyright (C) 1998 - 2017 SOHU Inc., All Rights Reserved. * <p> * utility to manipulate spring application context * @author: leijunhan (leijunhan@sohu-inc.com) * @date: 2018/1/9 */ @Component public class SpringUtil implements ApplicationContextAware { private static ApplicationContext applicationContext = null; @Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { if(SpringUtil.applicationContext == null){ SpringUtil.applicationContext = applicationContext; } System.out.println("---------------initializing application context manually---------------"); } /** * 获取applicationContext */ public static ApplicationContext getApplicationContext() { return applicationContext; } /** * 通过name获取 Bean. * @param name * @return */ public Object getBean(String name){ Object obj = getApplicationContext().getBean(name); return obj; } /** * 通过class获取Bean. * @param clazz * @param <T> * @return */ public <T> T getBean(Class<T> clazz){ return getApplicationContext().getBean(clazz); } /** * 通过name,以及Clazz返回指定的Bean * @param name * @param clazz * @param <T> * @return */ public <T> T getBean(String name,Class<T> clazz){ return getApplicationContext().getBean(name, clazz); } }
[ "leijunhan@sohu-inc.com" ]
leijunhan@sohu-inc.com
67a0e3328bae2700431b97940b1e53ce8d81d956
58330f36baba3a755368ce236830a4cdd06de5cb
/app/src/main/java/www/anandwan/com/Biogas.java
9ef4c21e614a3ff1e8249ef384af53e7e65cbcd6
[]
no_license
AnandwanSmartVillage/AnandwanSmartVillage
3cfe5b33965b0ef38bb40cfc2c738b0289c76fc3
caf46b91520bc41146c632a457c82be3d4ace92f
refs/heads/master
2023-05-12T10:38:17.214455
2021-06-01T12:32:42
2021-06-01T12:32:42
352,065,581
0
0
null
null
null
null
UTF-8
Java
false
false
5,664
java
package www.anandwan.com; import android.app.AlertDialog; import android.content.DialogInterface; import android.content.pm.ActivityInfo; import android.media.MediaPlayer; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.view.View; import android.widget.Button; import android.widget.SeekBar; import android.widget.TextView; import androidx.appcompat.app.AppCompatActivity; public class Biogas extends AppCompatActivity implements View.OnClickListener { private Button playBtn,back,forward; SeekBar positionBar; TextView elapsedTimeLabel; TextView remainingTimeLabel; MediaPlayer mp; int totalTime; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_biogas); this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); playBtn = (Button) findViewById(R.id.playBtn); back = (Button)findViewById(R.id.backward); forward =(Button)findViewById(R.id.forward); elapsedTimeLabel = (TextView) findViewById(R.id.elapsedTimeLabel); remainingTimeLabel = (TextView) findViewById(R.id.remainingTimeLabel); forward.setOnClickListener(this); back.setOnClickListener(this); playBtn.setOnClickListener(this); // Media Player mp = MediaPlayer.create(this, R.raw.biogas_project); mp.setLooping(true); mp.seekTo(0); mp.setVolume(0.5f, 0.5f); totalTime = mp.getDuration(); // Position Bar positionBar = (SeekBar) findViewById(R.id.positionBar); positionBar.setMax(totalTime); positionBar.setOnSeekBarChangeListener( new SeekBar.OnSeekBarChangeListener() { @Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { if (fromUser) { mp.seekTo(progress); positionBar.setProgress(progress); } } @Override public void onStartTrackingTouch(SeekBar seekBar) { } @Override public void onStopTrackingTouch(SeekBar seekBar) { } } ); // Thread (Update positionBar & timeLabel) new Thread(new Runnable() { @Override public void run() { while (mp != null) { try { Message msg = new Message(); msg.what = mp.getCurrentPosition(); handler.sendMessage(msg); Thread.sleep(1000); } catch (InterruptedException e) {} } } }).start(); } @Override public void onBackPressed(){ mp.pause(); playBtn.setBackgroundResource(R.drawable.play); final AlertDialog.Builder builder = new AlertDialog.Builder(Biogas.this); builder.setMessage("Do you want to quit?"); builder.setCancelable(true); builder.setNegativeButton("No", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { dialogInterface.cancel(); } }); builder.setPositiveButton("Yes", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { finish(); } }); AlertDialog alertDialog = builder.create(); alertDialog.show(); } private Handler handler = new Handler() { @Override public void handleMessage(Message msg) { int currentPosition = msg.what; // Update positionBar. positionBar.setProgress(currentPosition); // Update Labels. String elapsedTime = createTimeLabel(currentPosition); elapsedTimeLabel.setText(elapsedTime); String remainingTime = createTimeLabel(totalTime-currentPosition); remainingTimeLabel.setText("- " + remainingTime); } }; public String createTimeLabel(int time) { String timeLabel = ""; int min = time / 1000 / 60; int sec = time / 1000 % 60; timeLabel = min + ":"; if (sec < 10) timeLabel += "0"; timeLabel += sec; return timeLabel; } public void playBtnClick(View view) { if (!mp.isPlaying()) { // Stopping mp.start(); playBtn.setBackgroundResource(R.drawable.stop); } else { // Playing mp.pause(); playBtn.setBackgroundResource(R.drawable.play); } } @Override public void onClick(View v) { switch (v.getId()){ case R.id.playBtn: if (!mp.isPlaying()) { // Stopping mp.start(); playBtn.setBackgroundResource(R.drawable.stop); } else { // Playing mp.pause(); playBtn.setBackgroundResource(R.drawable.play); } break; case R.id.backward: mp.seekTo(mp.getCurrentPosition()-10000); break; case R.id.forward: mp.seekTo(mp.getCurrentPosition()+10000); } } }
[ "wew.pdeotale.y@gmail.com" ]
wew.pdeotale.y@gmail.com
01ecf3c5a393a57ef55d02a3437d9d9cf1242dab
9d061546a9c5af2da6310d025b701af3cad9bff4
/DiceAssignment/app/src/main/java/com/example/diceassignment/MainActivity.java
9a43bb6ee2177fcf2130ebdf22fac095150494aa
[]
no_license
Amitojasa/AndroidProjects
2b16cb6cf27679672482bec222970e272f65f32f
107ad98cc491d63fe07a695c90295003b9d91658
refs/heads/master
2020-06-07T00:55:41.066918
2020-01-21T17:21:07
2020-01-21T17:21:07
192,887,939
0
0
null
null
null
null
UTF-8
Java
false
false
1,982
java
package com.example.diceassignment; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.ImageView; import java.util.Random; public class MainActivity extends AppCompatActivity { private ImageView iv1,iv2; private Random r1= new Random(); //private Random r2= new Random(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); iv1= findViewById(R.id.imageView); iv2= findViewById(R.id.imageView2); } public void rollIt(View view){ int n1=r1.nextInt(6)+1; int n2=r1.nextInt(6)+1; switch (n2){ case 1: iv2.setImageResource(R.drawable.dice1); break; case 2: iv2.setImageResource(R.drawable.dice2); break; case 3: iv2.setImageResource(R.drawable.dice3); break; case 4: iv2.setImageResource(R.drawable.dice4); break; case 5: iv2.setImageResource(R.drawable.dice5); break; case 6: iv2.setImageResource(R.drawable.dice6); break; } switch (n1){ case 1: iv1.setImageResource(R.drawable.dice1); break; case 2: iv1.setImageResource(R.drawable.dice2); break; case 3: iv1.setImageResource(R.drawable.dice3); break; case 4: iv1.setImageResource(R.drawable.dice4); break; case 5: iv1.setImageResource(R.drawable.dice5); break; case 6: iv1.setImageResource(R.drawable.dice6); break; } } }
[ "amitojvmc@gmail.com" ]
amitojvmc@gmail.com
654dee1cfb90799ccadccbe65e0922fec8bad12b
8d4bba1689cff64ca48f1b1f0d65284ff1df50fc
/Ejemplos Deitel 7ma Ed/ch07/fig07_06/BarChart.java
dd8e06f8d621019635495aff6c7fa4fcc7262f7c
[]
no_license
jbartomioli/Proyecto_SSC
1fb6aded66dee6d1364250025e4af1655ef84455
1fd32f95825227f5b51a4aea47bd5f26a4b75eac
refs/heads/master
2021-01-20T02:08:53.630601
2016-02-17T17:51:33
2016-02-17T17:51:33
89,377,030
0
0
null
null
null
null
UTF-8
Java
false
false
2,016
java
// Fig. 7.6: BarChart.java // Bar chart printing program. public class BarChart { public static void main( String args[] ) { int array[] = { 0, 0, 0, 0, 0, 0, 1, 2, 4, 2, 1 }; System.out.println( "Grade distribution:" ); // for each array element, output a bar of the chart for ( int counter = 0; counter < array.length; counter++ ) { // output bar label ( "00-09: ", ..., "90-99: ", "100: " ) if ( counter == 10 ) System.out.printf( "%5d: ", 100 ); else System.out.printf( "%02d-%02d: ", counter * 10, counter * 10 + 9 ); // print bar of asterisks for ( int stars = 0; stars < array[ counter ]; stars++ ) System.out.print( "*" ); System.out.println(); // start a new line of output } // end outer for } // end main } // end class BarChart /************************************************************************** * (C) Copyright 1992-2007 by Deitel & Associates, Inc. and * * Pearson Education, Inc. All Rights Reserved. * * * * DISCLAIMER: The authors and publisher of this book have used their * * best efforts in preparing the book. These efforts include the * * development, research, and testing of the theories and programs * * to determine their effectiveness. The authors and publisher make * * no warranty of any kind, expressed or implied, with regard to these * * programs or to the documentation contained in these books. The authors * * and publisher shall not be liable in any event for incidental or * * consequential damages in connection with, or arising out of, the * * furnishing, performance, or use of these programs. * *************************************************************************/
[ "jbartomioli@6cb4cea0-02cd-4d9c-bdff-d5b26fc6b938" ]
jbartomioli@6cb4cea0-02cd-4d9c-bdff-d5b26fc6b938
8064ce11009be6e33f20e0c1f1413adf11b6184b
f783b18b5324fc18962ba1cf0d9bed03441b8035
/src/main/java/factory/spring/SpringFactoryTest.java
7bf18c85bde44f1abec906975ad49a16a6c833ca
[]
no_license
wangshuang666/design-pattern
0bdd80658c48b10783615f6c75aed77b3865bb75
c14d00f0b5694f7712a17a3d267699402118f3ab
refs/heads/main
2023-04-03T05:30:16.164628
2021-04-09T10:06:39
2021-04-09T10:06:39
339,669,981
0
0
null
null
null
null
UTF-8
Java
false
false
1,615
java
package factory.spring; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.xml.XmlBeanFactory; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.Resource; /** * */ public class SpringFactoryTest { public static void main(String[] args) { /** * 经典的工厂模式 * * 1.Resource resource = new ClassPathResource("Spring-factory.xml"); * 解析xml,将xml中的bean存成map,key为id,value为class对象 * 2.通过AbstractApplicationContext中的getBean看出来的, * 点点点org.springframework.beans.factory.support.DefaultSingletonBeanRegistry#getSingleton(java.lang.String, boolean) * */ Resource resource = new ClassPathResource("Spring-factory.xml"); BeanFactory beanFactory = new XmlBeanFactory(resource); Car benTian = (Car) beanFactory.getBean("benTian"); System.out.println(benTian.creatCar()); Car daZhong = (Car) beanFactory.getBean("daZhong"); System.out.println(daZhong.creatCar()); /* ApplicationContext applicationContext = new ClassPathXmlApplicationContext("Spring-factory.xml"); Car benTian1 = (Car) applicationContext.getBean("benTian"); System.out.println(benTian1.creatCar()); Car daZhong1 = (Car) applicationContext.getBean("daZhong"); System.out.println(daZhong1.creatCar());*/ } }
[ "wangshuang@ciics.com" ]
wangshuang@ciics.com
93508737f5a2c1c4f5e6785d26345a100e97eebe
5e6cbbdd74cd7642059a3479adf18d369ff839c9
/src/main/java/com/geowang/language/MinispecCommenter.java
761ecc0fdea3808cc4657a8281812a1200e428c7
[]
no_license
geoffreywwang/intellij-minispec-plugin
83eb077c974ee329c555e7512f9b0b61cec5a9a8
d490e59e0ad3d0d2e8639593563385861e9684e2
refs/heads/master
2022-06-23T18:19:20.483219
2020-05-09T04:12:50
2020-05-09T04:12:50
262,482,263
0
0
null
null
null
null
UTF-8
Java
false
false
680
java
package com.geowang.language; import com.intellij.lang.Commenter; import org.jetbrains.annotations.Nullable; public class MinispecCommenter implements Commenter { @Nullable @Override public String getLineCommentPrefix() { return "//"; } @Nullable @Override public String getBlockCommentPrefix() { return ""; } @Nullable @Override public String getBlockCommentSuffix() { return null; } @Nullable @Override public String getCommentedBlockCommentPrefix() { return null; } @Nullable @Override public String getCommentedBlockCommentSuffix() { return null; } }
[ "geoffreywwang@gmail.com" ]
geoffreywwang@gmail.com
c5d63cfe22c26cfa14aa195ed99881ee8747ceac
12fcdfa41e36a3ea64e20bc3e98f6aaa8b3e66a4
/app/src/main/java/com/africa/crm/businessmanagement/main/station/activity/CompanyPackagingDataDetailActivity.java
1d67e2713b574de50a4ac1de88f3702178e8535b
[]
no_license
guojin2092/BusinessManagementProject
8265351a4b8f0860bc137b661463f63c3d35c0b9
9f51ed63dba83c755d258a47046e65efef23e955
refs/heads/master
2020-04-05T20:36:32.031207
2019-02-13T05:33:48
2019-02-13T05:33:48
157,188,062
3
0
null
null
null
null
UTF-8
Java
false
false
12,253
java
package com.africa.crm.businessmanagement.main.station.activity; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.text.TextUtils; import android.view.View; import android.widget.EditText; import android.widget.TextView; import com.africa.crm.businessmanagement.MyApplication; import com.africa.crm.businessmanagement.R; import com.africa.crm.businessmanagement.eventbus.AddOrSaveCompanyPackagingDataEvent; import com.africa.crm.businessmanagement.main.bean.BaseEntity; import com.africa.crm.businessmanagement.main.bean.CompanyPackagingDataInfo; import com.africa.crm.businessmanagement.main.bean.PreviewInfo; import com.africa.crm.businessmanagement.main.dao.CompanyPackagingDataInfoDao; import com.africa.crm.businessmanagement.main.dao.GreendaoManager; import com.africa.crm.businessmanagement.main.dao.UserInfoManager; import com.africa.crm.businessmanagement.main.station.contract.CompanyPackagingDataDetailContract; import com.africa.crm.businessmanagement.main.station.presenter.CompanyPackagingDataDetailPresenter; import com.africa.crm.businessmanagement.mvp.activity.BaseMvpActivity; import com.africa.crm.businessmanagement.network.error.ErrorMsg; import com.africa.crm.businessmanagement.widget.TimeUtils; import com.bigkoo.pickerview.TimePickerView; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import org.greenrobot.eventbus.EventBus; import java.util.ArrayList; import java.util.Date; import java.util.List; import butterknife.BindView; import static com.africa.crm.businessmanagement.network.api.RequestMethod.REQUEST_CHECK_DATE; import static com.africa.crm.businessmanagement.network.api.RequestMethod.REQUEST_COMPANY_PACKAGING_DATA_DETAIL; public class CompanyPackagingDataDetailActivity extends BaseMvpActivity<CompanyPackagingDataDetailPresenter> implements CompanyPackagingDataDetailContract.View { @BindView(R.id.tv_num) TextView tv_num; @BindView(R.id.tv_tradingOrder) TextView tv_tradingOrder; @BindView(R.id.tv_quotationOrder) TextView tv_quotationOrder; @BindView(R.id.tv_paymentOrder) TextView tv_paymentOrder; @BindView(R.id.tv_purchaseOrder) TextView tv_purchaseOrder; @BindView(R.id.tv_invoiceOrder) TextView tv_invoiceOrder; @BindView(R.id.tv_salesOrder) TextView tv_salesOrder; @BindView(R.id.tv_start_date) TextView tv_start_date; @BindView(R.id.tv_end_date) TextView tv_end_date; @BindView(R.id.tv_get_preview_info) TextView tv_get_preview_info; @BindView(R.id.et_remark) EditText et_remark; @BindView(R.id.tv_save) TextView tv_save; private String mPackageDataId = ""; private Long mLocalId = 0l;//本地数据库ID private String mCompanyId = ""; private String mUserId = ""; private TimePickerView pvStartTime, pvEndTime; private Date mStartDate, mEndDate; private String mPreviewInfo = ""; private GreendaoManager<CompanyPackagingDataInfo, CompanyPackagingDataInfoDao> mPackagingDataInfoDaoManager; private List<CompanyPackagingDataInfo> mPackagingDataLocalList = new ArrayList<>();//本地数据 /** * @param activity */ public static void startActivity(Activity activity, String id, Long localId) { Intent intent = new Intent(activity, CompanyPackagingDataDetailActivity.class); intent.putExtra("id", id); intent.putExtra("localId", localId); activity.startActivity(intent); } @Override public void setView(Bundle savedInstanceState) { setContentView(R.layout.activity_packaging_data_detail); } @Override public void initView() { super.initView(); mPackageDataId = getIntent().getStringExtra("id"); mLocalId = getIntent().getLongExtra("localId", 0l); mCompanyId = UserInfoManager.getUserLoginInfo(this).getCompanyId(); mUserId = String.valueOf(UserInfoManager.getUserLoginInfo(this).getId()); titlebar_right.setVisibility(View.GONE); titlebar_name.setText(R.string.Package_data_details); tv_save.setText(R.string.Add); tv_save.setOnClickListener(this); tv_start_date.setOnClickListener(this); tv_end_date.setOnClickListener(this); tv_get_preview_info.setOnClickListener(this); if (TextUtils.isEmpty(mPackageDataId) && mLocalId == 0l) { tv_get_preview_info.setVisibility(View.VISIBLE); tv_save.setVisibility(View.VISIBLE); } else if (!TextUtils.isEmpty(mPackageDataId) || mLocalId != 0l) { tv_get_preview_info.setVisibility(View.GONE); tv_save.setVisibility(View.GONE); setEditTextInput(false); } initTimePicker(); //得到Dao对象管理器 mPackagingDataInfoDaoManager = new GreendaoManager<>(MyApplication.getInstance().getDaoSession().getCompanyPackagingDataInfoDao()); //得到本地数据 mPackagingDataLocalList = mPackagingDataInfoDaoManager.queryAll(); } private void initTimePicker() { pvStartTime = new TimePickerView(new TimePickerView.Builder(this, new TimePickerView.OnTimeSelectListener() { @Override public void onTimeSelect(Date date, View v) { mStartDate = date; if (mEndDate != null) { if (mEndDate.getTime() < mStartDate.getTime()) { toastMsg(getString(R.string.The_end_time_cannot_be_earlier_than_the_start_time)); return; } } tv_start_date.setText(TimeUtils.getTime(date)); } }) .setType(new boolean[]{true, true, true, false, false, false}) .isDialog(true)); pvEndTime = new TimePickerView(new TimePickerView.Builder(this, new TimePickerView.OnTimeSelectListener() { @Override public void onTimeSelect(Date date, View v) { mEndDate = date; if (mStartDate != null) { if (mEndDate.getTime() < mStartDate.getTime()) { toastMsg(getString(R.string.The_end_time_cannot_be_earlier_than_the_start_time)); return; } } tv_end_date.setText(TimeUtils.getTime(date)); } }) .setType(new boolean[]{true, true, true, false, false, false}) .isDialog(true)); } @Override protected CompanyPackagingDataDetailPresenter injectPresenter() { return new CompanyPackagingDataDetailPresenter(); } @Override protected void requestData() { if (!TextUtils.isEmpty(mPackageDataId) || mLocalId != 0l) { mPresenter.getPackagingDataDetail(mPackageDataId); } } @Override public void initData() { } /** * 控制输入框是否可输入 * * @param canInput */ private void setEditTextInput(boolean canInput) { tv_start_date.setEnabled(canInput); tv_end_date.setEnabled(canInput); tv_get_preview_info.setEnabled(canInput); tv_num.setEnabled(canInput); tv_tradingOrder.setEnabled(canInput); et_remark.setEnabled(canInput); } @Override public void onClick(View v) { super.onClick(v); switch (v.getId()) { case R.id.tv_start_date: if (pvStartTime != null) pvStartTime.show(); break; case R.id.tv_end_date: if (pvEndTime != null) pvEndTime.show(); break; case R.id.tv_get_preview_info: if (TextUtils.isEmpty(tv_start_date.getText().toString().trim())) { toastMsg(getString(R.string.Please_select_the_package_start_time)); return; } if (TextUtils.isEmpty(tv_end_date.getText().toString().trim())) { toastMsg(getString(R.string.Please_select_the_package_end_time)); return; } mPresenter.getPreviewInfo(mCompanyId, tv_start_date.getText().toString().trim(), tv_end_date.getText().toString().trim()); break; case R.id.tv_save: if (TextUtils.isEmpty(tv_start_date.getText().toString().trim())) { toastMsg(getString(R.string.Please_select_the_package_start_time)); return; } if (TextUtils.isEmpty(tv_end_date.getText().toString().trim())) { toastMsg(getString(R.string.Please_select_the_package_end_time)); return; } mPresenter.savePackagingData(mCompanyId, mUserId, tv_start_date.getText().toString().trim(), tv_end_date.getText().toString().trim(), tv_num.getText().toString().trim(), mPreviewInfo, et_remark.getText().toString().trim()); break; } } @Override public void getPreviewInfo(String previewInfo) { if (!TextUtils.isEmpty(previewInfo)) { mPreviewInfo = previewInfo; PreviewInfo info = new Gson().fromJson(previewInfo, new TypeToken<PreviewInfo>() { }.getType()); tv_num.setText(info.getTotal()); tv_tradingOrder.setText(info.getTradingOrder()); tv_quotationOrder.setText(info.getQuotationOrder()); tv_paymentOrder.setText(info.getPaymentOrder()); tv_purchaseOrder.setText(info.getPurchaseOrder()); tv_invoiceOrder.setText(info.getInvoiceOrder()); tv_salesOrder.setText(info.getSalesOrder()); } } @Override public void getPackagingDataDetail(CompanyPackagingDataInfo companyPackagingDataInfo) { if (companyPackagingDataInfo != null) { tv_start_date.setText(companyPackagingDataInfo.getStartDate()); mStartDate = TimeUtils.getDataByString(companyPackagingDataInfo.getStartDate()); tv_end_date.setText(companyPackagingDataInfo.getEndDate()); mEndDate = TimeUtils.getDataByString(companyPackagingDataInfo.getEndDate()); et_remark.setText(companyPackagingDataInfo.getRemark()); mPresenter.getPreviewInfo(mCompanyId, tv_start_date.getText().toString().trim(), tv_end_date.getText().toString().trim()); for (CompanyPackagingDataInfo localInfo : mPackagingDataLocalList) { if (!TextUtils.isEmpty(localInfo.getId()) && !TextUtils.isEmpty(companyPackagingDataInfo.getId())) { if (localInfo.getId().equals(companyPackagingDataInfo.getId())) { companyPackagingDataInfo.setLocalId(localInfo.getLocalId()); mPackagingDataInfoDaoManager.correct(companyPackagingDataInfo); } } } } } @Override public void savePackagingData(BaseEntity baseEntity) { if (baseEntity.isSuccess()) { String toastString = ""; if (TextUtils.isEmpty(mPackageDataId)) { toastString = getString(R.string.Added_Successfully); } else { toastString = getString(R.string.Successfully_Modified); } EventBus.getDefault().post(new AddOrSaveCompanyPackagingDataEvent(toastString)); finish(); } else { toastMsg(ErrorMsg.showErrorMsg(baseEntity.getReturnMsg())); } } @Override public void loadLocalData(String port) { super.loadLocalData(port); if (port.equals(REQUEST_COMPANY_PACKAGING_DATA_DETAIL)) { CompanyPackagingDataInfo companyPackagingDataInfo = null; for (CompanyPackagingDataInfo info : mPackagingDataLocalList) { if (mLocalId == info.getLocalId()) { companyPackagingDataInfo = info; } } getPackagingDataDetail(companyPackagingDataInfo); } else if (port.equals(REQUEST_CHECK_DATE)) { toastMsg("网络连接失败,请检查网络是否可用"); } } }
[ "317280902@qq.com" ]
317280902@qq.com
f10ea3bbdf60ab46571d2262c081531b449034f1
e78de055a04e259d470dd29bffae74147d42a53d
/src/main/java/database/User.java
3c4ac843d7bbb70aa559ce7472aa15dda88accaa
[]
no_license
MariaRogulenko/LoginMavenWebApp
ac9993216c6f7ae8a1689274bcf22db950d71a1a
e40fbc1ba45a9257996d4871a4833d5e7050a7a6
refs/heads/master
2021-01-12T02:57:32.554081
2017-01-19T23:37:30
2017-01-19T23:37:30
78,140,812
0
0
null
null
null
null
UTF-8
Java
false
false
583
java
package database; /** * Created by maria on 1/19/17. */ public class User { private UserPassword userPass; private UserAddress userAdd; public User (UserPassword p, UserAddress a) { this.userPass = p; this.userAdd = a; } public UserPassword getUserPass() { return userPass; } public UserAddress getUserAdd() { return userAdd; } public void setUserPass(UserPassword userPass) { this.userPass = userPass; } public void setUserAdd(UserAddress userAdd) { this.userAdd = userAdd; } }
[ "rogulenko.m@gmail.com" ]
rogulenko.m@gmail.com
e05ef8dfcd6f4173dc5b3d6aef6b140a5145805a
6629cef4b676b40de6d9d82d000325f215e50834
/com/ekalife/elions/model/AgentTax.java
153ab559ed817e140c580aba9df85c9d525df2e4
[]
no_license
fidesetratio/insurance
a9bf169b9d1b568a2ae570b233a234a2500a4e31
6ba971ae6dc6d4858949f333b48b9113ef7ae8c4
refs/heads/master
2023-01-01T17:38:50.269848
2020-10-27T03:39:52
2020-10-27T03:39:52
307,576,991
0
0
null
null
null
null
UTF-8
Java
false
false
2,490
java
package com.ekalife.elions.model; import java.io.Serializable; import java.util.Date; /** * MST_AGENT_TAX * @since 16 Oct 09 * @author Yusuf * */ public class AgentTax implements Serializable { private static final long serialVersionUID = 1L; public Date adt_date; public String as_msag; public Double adec_comm_month; public Double adec_comm_year; public Double adec_ptkp; public Double adec_pkp_month; public Double adec_pkp_year; public Double adec_tax_pct; public Double adec_tax_paid; public Double adec_tax_real; public Date adt_pay; public String as_spt; public boolean ab_update; public boolean isAb_update() { return ab_update; } public void setAb_update(boolean ab_update) { this.ab_update = ab_update; } public Double getAdec_comm_month() { return adec_comm_month; } public void setAdec_comm_month(Double adec_comm_month) { this.adec_comm_month = adec_comm_month; } public Double getAdec_comm_year() { return adec_comm_year; } public void setAdec_comm_year(Double adec_comm_year) { this.adec_comm_year = adec_comm_year; } public Double getAdec_pkp_month() { return adec_pkp_month; } public void setAdec_pkp_month(Double adec_pkp_month) { this.adec_pkp_month = adec_pkp_month; } public Double getAdec_pkp_year() { return adec_pkp_year; } public void setAdec_pkp_year(Double adec_pkp_year) { this.adec_pkp_year = adec_pkp_year; } public Double getAdec_ptkp() { return adec_ptkp; } public void setAdec_ptkp(Double adec_ptkp) { this.adec_ptkp = adec_ptkp; } public Double getAdec_tax_paid() { return adec_tax_paid; } public void setAdec_tax_paid(Double adec_tax_paid) { this.adec_tax_paid = adec_tax_paid; } public Double getAdec_tax_pct() { return adec_tax_pct; } public void setAdec_tax_pct(Double adec_tax_pct) { this.adec_tax_pct = adec_tax_pct; } public Double getAdec_tax_real() { return adec_tax_real; } public void setAdec_tax_real(Double adec_tax_real) { this.adec_tax_real = adec_tax_real; } public Date getAdt_date() { return adt_date; } public void setAdt_date(Date adt_date) { this.adt_date = adt_date; } public Date getAdt_pay() { return adt_pay; } public void setAdt_pay(Date adt_pay) { this.adt_pay = adt_pay; } public String getAs_msag() { return as_msag; } public void setAs_msag(String as_msag) { this.as_msag = as_msag; } public String getAs_spt() { return as_spt; } public void setAs_spt(String as_spt) { this.as_spt = as_spt; } }
[ "Patar.Tambunan@SINARMASMSIGLIFE.CO.ID" ]
Patar.Tambunan@SINARMASMSIGLIFE.CO.ID
f23fa878651fe6756df4ac6236346b3fb82b3500
a230d4995afa9833d7f70152eba1baf528afb583
/mpi_java/mpi/src/test/CommSplit.java
d5889be48865bf8734dc6597156ce73c3cea5c86
[]
no_license
niksanElements/javampi
bda77b52f416579944dee92c8914961ba346783b
df376cbde141a09526922f235595d45659d5a746
refs/heads/master
2020-09-28T00:17:20.560184
2020-02-25T13:43:47
2020-02-25T13:43:47
226,643,517
0
0
null
null
null
null
UTF-8
Java
false
false
605
java
package test; import mpi.Comm; import mpi.Intracomm; import mpi.MPI; public class CommSplit{ public static void main(String[] args) { MPI.Init(args); int rank = MPI.COMM_WORLD.rank(); int size = MPI.COMM_WORLD.size(); int color = rank/4; Comm comm = MPI.COMM_WORLD.split(color, rank); int split_rank = comm.rank(); int split_size = comm.size(); Utils.sleepRand(600); System.out.printf("Rank:%d Size %d,Split Rank: %d Split Size: %d\n",rank,size,split_rank,split_size); comm.free(); MPI.Finalize(); } }
[ "niksan9411@gmail.com" ]
niksan9411@gmail.com
dc7fd2e09c9cb3a9153308aefba90f0c3a13a04f
d50cd8710065dcca60042f0639d39540a6a86ee2
/ssm_project1/src/main/java/com/example/ssm_project1/model/entity/Student.java
2790229d9634d44f1a093f063432eb4b7651c012
[]
no_license
chen-yang2/TwoWeek
5d789c2fdcc6cb81f81daddd3d24aaf513ddf848
c09dae557f491f99bef589dd19e03f2c8767cae3
refs/heads/master
2022-12-25T00:41:16.651588
2019-12-20T06:50:20
2019-12-20T06:50:20
228,274,239
0
0
null
2022-12-16T03:32:20
2019-12-16T00:44:22
Java
UTF-8
Java
false
false
587
java
package com.example.ssm_project1.model.entity; import lombok.Getter; import lombok.Setter; import lombok.ToString; /** * ClassName : 学生实体类 * package : com.example.ssm_project1.model.entity * Description : TODO * * @date : 2019/12/20 13:42 * @Author : yangchen */ @Setter @Getter @ToString public class Student { private int sid; private String sname; private Classes classes; private String sex; private String birthplace; public Student(){ } public Student(int sid,String sname,Classes classes,String sex,String birthplace){ } }
[ "mld1087@dingtalk.com" ]
mld1087@dingtalk.com
57e01437b70fbcd3e5e7c798c997aa91be8d2d10
9fe994e0fbb43ac5bfb8a08f226b541beacf799e
/AppointmentPublisher/src/appointmentpublisher/AppointmentServiceImp.java
16a99662ec1dec332231f4296050c424606b9701
[]
no_license
ranthilina99/OSGI-Framework-HMS
682b2cfc5d8325515286b14a5f54db516695e0b1
b4a3e2cefc968a847b10c1ac827ac5b6dc1b959e
refs/heads/master
2023-04-13T19:37:48.849886
2021-04-23T15:04:04
2021-04-23T15:04:04
360,911,917
0
0
null
null
null
null
UTF-8
Java
false
false
2,871
java
package appointmentpublisher; import java.time.LocalTime; import java.util.ArrayList; import classpublisher.Doctors; public class AppointmentServiceImp implements AppointmentService { Doctors d1 = new Doctors("1","Kamal Gunawardhana",LocalTime.of(7, 30, 45),LocalTime.of(10, 30, 45),"Neurologists",10500.00); Doctors d2 = new Doctors("2","Shamali deSilva",LocalTime.of(4, 30, 45),LocalTime.of(8, 30, 45),"Hematologists",5500.00); Doctors d3 = new Doctors("3","Wikum Fernando",LocalTime.of(1, 30, 45),LocalTime.of(8, 30, 45),"Dermatologists",9500.00); Doctors d4 = new Doctors("4","Umesh Kariyawasam",LocalTime.of(10, 30, 45),LocalTime.of(10, 30, 45),"Neurologists",10500.00); Doctors d5 = new Doctors("5","Yasoja Withethunga",LocalTime.of(8, 30, 45),LocalTime.of(15, 30, 45),"Hematologists",5500.00); Doctors d6 = new Doctors("6","Binuka Fernando",LocalTime.of(6, 30, 45),LocalTime.of(12, 30, 45),"Dermatologists",9500.00); ArrayList<Doctors> arrayList =new ArrayList<Doctors>(); public AppointmentServiceImp() { arrayList.add(d1); arrayList.add(d2); arrayList.add(d3); arrayList.add(d4); arrayList.add(d5); arrayList.add(d6); } @Override public void printAll() { System.out.println("ID"+" \t "+"Name"+" \t\t\t\t "+"Specialization"+"\t\t "+"Starting time"+" \t "+"Ending Time"); System.out.println(""); for (Doctors i : arrayList) { System.out.println(i.getdId()+" \t "+i.getdName()+" \t\t "+ i.getdSpecialization()+"\t\t "+i.getdStartingHour()+" \t "+i.getdEndingHour()); } } @Override public void printDoctorAmount(String Id) { System.out.println("ID"+" \t "+"Name"+" \t\t\t "+"Appoinment Charge"); for (Doctors i : arrayList) { if(Id.equals(i.getdId())) { System.out.println(""); System.out.println(i.getdId()+" \t "+i.getdName()+" \t "+i.getdAppoinmantCharge()); } } } @Override public void FindBySpecialization(String Special) { System.out.println("Availabel Realevent Docotrs.... "); System.out.println(""); System.out.println("ID"+" \t "+"Name"+" \t\t\t\t "+"Specialization"+"\t\t "+"Starting time"+" \t "+"Ending Time"); System.out.println(""); for (Doctors i : arrayList) { if(Special.equals(i.getdSpecialization())) { System.out.println(i.getdId()+" \t "+i.getdName()+" \t\t "+ i.getdSpecialization()+"\t\t "+i.getdStartingHour()+" \t "+i.getdEndingHour()); } } } @Override public void BookAppoinment(String Id, LocalTime time) { for (Doctors i : arrayList) { if(Id.equals(i.getdId())) { if(time.isAfter(i.getdStartingHour()) && time.isBefore(i.getdEndingHour())) { System.out.println("!!!Appoinmant Booked!!!"); System.out.println(""); }else { System.out.println("!!!Appoinmant Unavailable at that time!!!"); System.out.println(""); } } } } }
[ "umeshranthilina111@gmail.com" ]
umeshranthilina111@gmail.com
64558a69a1320b697fee55947955668cf18f6c54
5cc786341b5fb8efcb9e9d3a7febd48e9b46cb5f
/src/main/java/com/vue/crud/model/Model.java
fba9a625891f8a7c7b907dd8b151fa6b8c074cd0
[]
no_license
kkevs/vuejs-springboot-kendogrid-crud
420e8c3d57a6558d78a89379764e062f08f34785
12696a16571a0c6a37d963ef7475a28315bd4791
refs/heads/master
2021-08-28T06:17:55.133508
2017-12-11T11:20:41
2017-12-11T11:20:41
113,849,190
0
0
null
null
null
null
UTF-8
Java
false
false
420
java
package com.vue.crud.model; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.MappedSuperclass; @MappedSuperclass public class Model { @Id @GeneratedValue(strategy = GenerationType.AUTO) private long id; public long getId() { return id; } public void setId(long id) { this.id = id; } }
[ "kevser.kose.95@gmail.com" ]
kevser.kose.95@gmail.com
7da47c7a33486df3d9c42119e0a0c5beee1ad601
99df3a3d87176f3f2b49d60a68c289de89b22448
/demo/src/main/java/com/github/hrn/practice/demo/guava/basicutilities/preconditions/CheckPositionIndex.java
200c95de2151124d003426a114050870f4ad697c
[]
no_license
xhurongna/practiceproject
b13cd8d3727029098afd81e7af741b68e34f13db
95d02d87dfd649dab183c26ff8199844058b8420
refs/heads/master
2022-07-12T09:46:57.339111
2020-01-25T07:46:59
2020-01-25T07:46:59
144,861,915
0
0
null
2022-06-17T02:06:47
2018-08-15T14:14:33
HTML
UTF-8
Java
false
false
993
java
package com.github.hrn.practice.demo.guava.basicutilities.preconditions; import com.github.hrn.practice.demo.bean.User; import com.google.common.base.Preconditions; /** * @author 胡荣娜 * @date 2019-06-17 */ public class CheckPositionIndex { public static void main(String[] args) { User user = new User(); user.setId(1); user.setName("哈哈"); user.setAge(19); String[] accounts = {"账号1", "账号2"}; user.setAccounts(accounts); int a = 2; Preconditions.checkPositionIndex(a, user.getAccounts().length, a + "必须<账户大小" + user.getAccounts().length); System.out.println("index作为位置值 位置合法,index作为索引值,从0开始算,作为位置值,从0开始算, 位置值最大值可以取长度值,但截取的结果是不包含该位置"); Preconditions.checkElementIndex(a, user.getAccounts().length, a + "必须<账户大小" + user.getAccounts().length); } }
[ "159390@sh.lianjia.com" ]
159390@sh.lianjia.com
306d651daa9a5d9d53d294cdbaa331d404782f39
b05f9e12bc1ce38e0bf38ffc08fa7a92f2a948e5
/CameraActions/app/src/androidTest/java/com/cameraactions/ApplicationTest.java
e34135123a000fd933853e2e72ea3f4326e5861a
[]
no_license
samirsamedov/Android
e63eb24160503dcded8da7db1a340b446e2c0ead
af03f5584dfdb8d078825e3c5bf5a610d396fec3
refs/heads/master
2020-04-16T02:08:51.000442
2016-09-10T08:29:21
2016-09-10T08:29:21
59,360,714
0
0
null
null
null
null
UTF-8
Java
false
false
348
java
package com.cameraactions; import android.app.Application; import android.test.ApplicationTestCase; /** * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> */ public class ApplicationTest extends ApplicationTestCase<Application> { public ApplicationTest() { super(Application.class); } }
[ "l1113904@std.yildiz.edu.tr" ]
l1113904@std.yildiz.edu.tr
3696755daf8f7e407e2608941cbae723359e93fa
e7f88966ec1792b8b86c228f2e17f9e89b1eb67b
/Mapsconti.java
0e92a3590d61d4018140b457d8738bfa6c7ca6ec
[]
no_license
U23456/project-fyp
22049be85a4a2294e41916e18aab9042e3fba44c
9579ee948a6ad27998fbba16842beaa8d85bf1df
refs/heads/main
2023-06-05T03:38:31.008315
2021-06-15T06:28:27
2021-06-15T06:28:27
377,053,264
0
0
null
null
null
null
UTF-8
Java
false
false
1,939
java
package com; import androidx.fragment.app.FragmentActivity; import android.os.Bundle; import com.example.eventplanner.R; import com.google.android.gms.maps.CameraUpdateFactory; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.OnMapReadyCallback; import com.google.android.gms.maps.SupportMapFragment; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.MarkerOptions; public class Mapsconti extends FragmentActivity implements OnMapReadyCallback { private GoogleMap mMap; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_mapsconti); // Obtain the SupportMapFragment and get notified when the map is ready to be used. SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager() .findFragmentById(R.id.map); mapFragment.getMapAsync(this); } /** * Manipulates the map once available. * This callback is triggered when the map is ready to be used. * This is where we can add markers or lines, add listeners or move the camera. In this case, * we just add a marker near Sydney, Australia. * If Google Play services is not installed on the device, the user will be prompted to install * it inside the SupportMapFragment. This method will only be triggered once the user has * installed Google Play services and returned to the app. */ @Override public void onMapReady(GoogleMap googleMap) { mMap = googleMap; // Add a marker in Sydney and move the camera LatLng Marriet = new LatLng(33.734171, 73.087141); mMap.addMarker(new MarkerOptions().position(Marriet).title("Marker in Marriet")); mMap.moveCamera(CameraUpdateFactory.newLatLng(Marriet)); } }
[ "noreply@github.com" ]
U23456.noreply@github.com
d69b88edafc7208b413db5213d2f6ad0d550bdef
20674f5edde9241286e0b7b95a5d1153ea4e5659
/viikko3/KumpulaBiershop/src/main/java/com/mycompany/webkauppa/HallintaServlet.java
e98a24452ca5fe4f9e63b8d08e74a16c9c6fe7cd
[]
no_license
Saknet/ohtu2015
014bdd5628f3a60429c37445c29dc229a14c7881
0477de579ebacb310d53cad68f454a57b50f91ad
refs/heads/master
2021-01-15T16:00:27.391350
2015-05-03T15:21:26
2015-05-03T15:21:26
32,108,918
0
0
null
2015-03-12T23:27:20
2015-03-12T23:27:19
null
UTF-8
Java
false
false
2,130
java
package com.mycompany.webkauppa; import com.mycompany.webkauppa.ulkoiset_rajapinnat.PankkiFasaadi; import com.mycompany.webkauppa.ulkoiset_rajapinnat.ToimitusjarjestelmaFasaadi; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class HallintaServlet extends WebKauppaServlet { protected void processRequest(PankkiFasaadi pf, ToimitusjarjestelmaFasaadi tjf, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.setAttribute("tuotteet", varasto.tuotteidenLista()); request.setAttribute("maksut", pf.maksut()); request.setAttribute("toimitukset", tjf.toimitukset()); naytaSivu("/hallinta.jsp", request, response); } protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String viesti = ""; try { int hinta = Integer.parseInt(request.getParameter("hinta")); int saldo = Integer.parseInt(request.getParameter("saldo")); //if (request.getParameter("toimenpide").equals("paivita")) { if (request.getParameter("komento").equals("paivita")) { long tuoteId = Long.parseLong(request.getParameter("tuote")); varasto.paivitaTuotteenTiedot(tuoteId, hinta, saldo); viesti = "tuotteen tietojen muutos tehty"; } else { String tuotteenNimi = request.getParameter("nimi"); if (varasto.lisaaTuote(tuotteenNimi, hinta, saldo)) { viesti = "lisättiin tuote " + tuotteenNimi; } else { viesti = "tuote " + tuotteenNimi + " on jo olemassa"; } } } catch (Exception e) { e.printStackTrace(); viesti = "virheellinen syöte, ei muutoksia tuotteisiin"; } request.setAttribute("viesti", viesti); processRequest(request, response); } }
[ "andreas.andra@helsinki.fi" ]
andreas.andra@helsinki.fi
dc9d0200fa3d59191d6b7775493c9100296e1085
0feff024b787943f78789f0fa6b427f66877437f
/src/main/java/com/develogical/Cache.java
082a65aba90fa743360d08ed1090dbb6a2f0c1ad
[]
no_license
gsabirmalik/Weather
9b269d2459509be81f8572a550541845b03e947f
84b112fef299f93b5b3339486d197ad708700456
refs/heads/master
2021-01-16T00:56:22.974409
2016-07-13T19:25:46
2016-07-13T19:25:46
63,254,029
0
0
null
2016-07-13T14:40:36
2016-07-13T14:40:36
null
UTF-8
Java
false
false
356
java
package com.develogical; import com.weather.Forecast; /** * Created by Sabir on 13/07/2016. */ public interface Cache { void setValidityInterval (Integer validity); Integer getValidityInterval (); void setMaxItems (Integer maxItems); Integer getMaxItems(); void add(String key, Forecast forecast); Forecast get(String key); }
[ "gsabirmalik@hotmail.com" ]
gsabirmalik@hotmail.com
721a02a0cbae9e1e31a79b2b651121b7b74ce331
489a88a618f1db545bfdc88998cfae6720556b34
/src/com/ltgo/model/Notes.java
48affe2a7edf42a32fc91d7f95154493333036c9
[]
no_license
suksama/LoveToGoOut_web
9827d03db79b245679de851bae49e05261dff291
57c1e7c254988c8cec151c7f0cc3f914961530d0
refs/heads/master
2021-01-21T06:43:02.438595
2017-02-27T06:12:54
2017-02-27T06:12:54
83,274,910
0
0
null
null
null
null
UTF-8
Java
false
false
439
java
package com.ltgo.model; public class Notes { private String title; private String content; public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getContent() { return content; } public void setContent(String content) { this.content = content; } public Notes(String title, String content) { super(); this.title = title; this.content = content; } }
[ "827807064@qq.com" ]
827807064@qq.com
c9d7a4c6bae185f03c269796d52dcac1ec4ea12d
ed895a996e218d8268d00bc8982d18b0a66230f0
/TestData/HomeHealthGrouper/HH_PPS_Java_source/com/mmm/cms/homehealth/vut/oasis/ValidateUrinaryIncontinence_OASIS_C2.java
7196b1a352e984e7829145d8562ee014a7f63805
[ "MIT" ]
permissive
asedl/XpaPDPM_Calc
8168a8dfcc5577fd7be5dd899e70cc39d46728ec
0e05e50fd0112c1e86f942ae0a09dff2188804a4
refs/heads/master
2020-07-23T20:09:56.008085
2019-09-13T12:13:31
2019-09-13T12:13:31
207,690,700
1
0
null
null
null
null
UTF-8
Java
false
false
4,629
java
/* * Home Health Grouper * Developer for the Center for Medicare and Medicaid Services CMS * by 3M Health Information Systems for CMS Home Health. * * All code is provided as is. */ package com.mmm.cms.homehealth.vut.oasis; import com.mmm.cms.homehealth.vut.proto.CollectionValidationEditsIF; import com.mmm.cms.homehealth.vut.proto.OasisEditIF; import com.mmm.cms.homehealth.vut.proto.OasisEditsEN; import com.mmm.cms.homehealth.proto.record.HomeHealthRecordIF; import com.mmm.cms.homehealth.proto.record.HomeHealthRecord_C2_IF; import com.mmm.cms.homehealth.proto.RecordItemValidatorIF; import com.mmm.cms.homehealth.vut.HHOasisDataItem; import com.mmm.cms.homehealth.vut.OasisValidationEdit; import com.mmm.cms.util.ValidateUtils; import java.util.List; /** * Validates Urinary Incontinence for edits: 3060, 4330, 4340 * * @author 3M Health Information Systems for CMS Home Health */ public class ValidateUrinaryIncontinence_OASIS_C2 extends AbstractClinicalItemValidator implements RecordItemValidatorIF { /** * returns the edit list * * @return non-null list of edits for this validator */ public List<OasisEditIF> getEditIdsUsed() { return super.getEditIdsUsed_base(OasisEditsEN.EDIT_3060, OasisEditsEN.EDIT_4330, OasisEditsEN.EDIT_4340); } public int validate(HomeHealthRecordIF record, CollectionValidationEditsIF edits) { int count = 0; final String assessmentReason = record.getASSMT_REASON(); if (ValidateUtils.isValidValue(assessmentReason, AbstractItemValidator.ASSESSMENT_1_3_4_5_9_ONLY)) { final String urIncontTiming = ((HomeHealthRecord_C2_IF) record).getINCNTNT_TIMING(); final String urIncont = record.getUR_INCONT(); // validate the range first if (!ValidateUtils.isValidValue(urIncont, ValidateUtils.ARRAY_DOUBLE_0, ValidateUtils.ARRAY_DOUBLE_1, ValidateUtils.ARRAY_DOUBLE_2)) { count++; edits.add(new OasisValidationEdit(OasisEditsEN.EDIT_3060, new HHOasisDataItem(HomeHealthRecord_C2_IF.OASIS_C2_ITEM_M1610_UR_INCONT, urIncont))); } if (ValidateUtils.isValidValue(assessmentReason, AbstractItemValidator.ASSESSMENT_1_3_9_ONLY)) { // validate the range first if (!ValidateUtils.isValidValue(urIncontTiming, ValidateUtils.ARRAY_DOUBLE_0, ValidateUtils.ARRAY_DOUBLE_1, ValidateUtils.ARRAY_DOUBLE_2, ValidateUtils.ARRAY_DOUBLE_3, ValidateUtils.ARRAY_DOUBLE_4, ValidateUtils.ARRAY_CARET_VALUES)) { count++; edits.add(new OasisValidationEdit(OasisEditsEN.EDIT_3060, new HHOasisDataItem(HomeHealthRecord_C2_IF.OASIS_C2_ITEM_M1615_INCNTNT_TIMING, urIncontTiming))); } if (count == 0) { if (ValidateUtils.isValidValue(urIncont, ValidateUtils.ARRAY_DOUBLE_0, ValidateUtils.ARRAY_DOUBLE_2) && !ValidateUtils.isValidValue(urIncontTiming, ValidateUtils.ARRAY_CARET_VALUES)) { count++; edits.add(new OasisValidationEdit(OasisEditsEN.EDIT_4330, new HHOasisDataItem(HomeHealthRecord_C2_IF.OASIS_C2_ITEM_M1615_INCNTNT_TIMING, urIncontTiming))); edits.add(new OasisValidationEdit(OasisEditsEN.EDIT_4330, new HHOasisDataItem(HomeHealthRecord_C2_IF.OASIS_C2_ITEM_M1610_UR_INCONT, urIncont))); } else if (ValidateUtils.isValidValue(urIncont, ValidateUtils.ARRAY_DOUBLE_1) && ValidateUtils.isValidValue(urIncontTiming, ValidateUtils.ARRAY_CARET_VALUES)) { count++; edits.add(new OasisValidationEdit(OasisEditsEN.EDIT_4340, new HHOasisDataItem(HomeHealthRecord_C2_IF.OASIS_C2_ITEM_M1615_INCNTNT_TIMING, urIncontTiming))); edits.add(new OasisValidationEdit(OasisEditsEN.EDIT_4340, new HHOasisDataItem(HomeHealthRecord_C2_IF.OASIS_C2_ITEM_M1610_UR_INCONT, urIncont))); } } } } return count; } /** * Gets the description * * @return non-null string */ public String getDescription() { return "Validates Urinary Incontinence for edits: 3060, 4330, 4340"; } }
[ "andreas.sedlmeier.ext@siemens.com" ]
andreas.sedlmeier.ext@siemens.com
737312f4826af0373d232c1529e87c954afdb6fb
e135b0874745bcc877ed2f61e3f89eab3af5c499
/allBrowserTraining/src/com/FirefoxBrowser/GmailElement.java
df13773bd3c9aa1c797282f52d77309b1c489d04
[]
no_license
ariraj0707/ORANGEHRM
27d7d42bcfda509840e119f355ddad60e0576b5d
b292254d99673874fa1662f984bf15caaf28a4bb
refs/heads/master
2020-04-21T20:23:24.209696
2019-02-09T08:26:07
2019-02-09T08:26:07
169,842,442
0
0
null
null
null
null
UTF-8
Java
false
false
776
java
package com.FirefoxBrowser; import org.openqa.selenium.By; import org.openqa.selenium.firefox.FirefoxDriver; public class GmailElement { public static void main(String[] args) { //<a class="gb_P" data-pid="23" href="https://mail.google.com/mail/?tab=wm">Gmail</a> //<a class="gb_P" data-pid="2" href="https://www.google.co.in/imghp?hl=en&amp;tab=wi">Images</a> System.setProperty("webdriver.gecko.driver", "C:\\Users\\ARIVAZHAGAN\\Desktop\\selemium files\\workspace\\Automation\\library\\geckodriver.exe"); FirefoxDriver driver_Firefox = new FirefoxDriver(); String googleurl="http:\\google.com"; driver_Firefox.get(googleurl); driver_Firefox.findElement(By.className("gb_P")).click(); //driver_Firefox.findElement(By.linkText("Image")); } }
[ "ariraj0707@gmail.com" ]
ariraj0707@gmail.com
8496711cc47be45c94cfd1b398c00a83bc7f2005
043177a2340608a457736d6023ce707d3f07714e
/week1/src/WordNet.java
cecc4b964d0ec16412768a7f883976bbfdc1b119
[]
no_license
rishi-mehta/algsII
ffd0daf29fdcf88373eed8b24797400867e16da2
5d913307283040924742931bbe96c840a507d1e8
refs/heads/master
2020-12-01T03:05:37.985973
2013-03-31T20:39:38
2013-03-31T20:39:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,888
java
import java.util.ArrayList; import java.util.HashMap; import java.util.List; /** * User: adrian * Date: 3/27/13 * Time: 7:42 PM */ public class WordNet { // constructor takes the name of the two input files private HashMap<String, ArrayList<Integer>> nounToId = new HashMap<String, ArrayList<Integer>>(89); private HashMap<Integer, String> idToNoun = new HashMap<Integer, String>(89); private Digraph graph; private DeluxeBFS bfs; /** * The constructor should throw a java.lang.IllegalArgumentException if the * input does not correspond to a rooted DAG. The distance() and sap() methods * should throw a java.lang.IllegalArgumentException unless both of the noun arguments are WordNet nouns. * Your data type should use space linear in the input size (size of synsets * and hypernyms files). The constructor should take time linearithmic (or better) * in the input size. The method isNoun() should run in time logarithmic (or better) in * the number of nouns. The methods distance() and sap() should run in time linear in the * size of the WordNet digraph. * * @param synsets * @param hypernyms */ public WordNet(String synsets, String hypernyms) { In in = new In(synsets); In in2 = new In(hypernyms); String line; int largestId = 0; int count = 0; while ((line = in.readLine()) != null) { String[] lineArr = line.split(","); //StdOut.println(line); int id = Integer.parseInt(lineArr[0]); if (id > largestId) largestId = id; String[] synset = lineArr[1].split(" "); ++count; for (String noun : synset) { ArrayList<Integer> ids = nounToId.get(noun); if (null == ids) { ArrayList<Integer> l = new ArrayList<Integer>(); l.add(id); nounToId.put(noun, l); idToNoun.put(id, noun); } else { ids.add(id); } } } graph = new Digraph(count); DirectedCycle dc = new DirectedCycle(graph); if (dc.hasCycle()) throw new java.lang.IllegalArgumentException(); while ((line = in2.readLine()) != null) { String[] lineArr = line.split(","); Integer[] hnyms = new Integer[lineArr.length]; for (int i = 0; i < lineArr.length; ++i) { hnyms[i] = Integer.parseInt(lineArr[i]); if (i != 0) { graph.addEdge(hnyms[0], hnyms[i]); } } } bfs = new DeluxeBFS(graph); //System.out.println("done w/constructor"); } // returns all WordNet nouns public Iterable<String> nouns() { return nounToId.keySet(); } // is the word a WordNet noun? public boolean isNoun(String word) { return nounToId.containsKey(word); } // distance between nounA and nounB (defined below) public int distance(String nounA, String nounB) { if (!isNoun(nounA) || !isNoun(nounB)) throw new java.lang.IllegalArgumentException(); SAP sap = new SAP(graph); List<Integer> one = nounToId.get(nounA); List<Integer> two = nounToId.get(nounB); int minDistance=Integer.MAX_VALUE; for (Integer i : one) { for (Integer j : two) { int tempDist=sap.length(i,j); if(tempDist < minDistance)minDistance=tempDist; } } return minDistance; } // a synset (second field of synsets.txt) that is the common ancestor of nounA and nounB // in a shortest ancestral path (defined below) public String sap(String nounA, String nounB) { if (!isNoun(nounA) || !isNoun(nounB)) throw new java.lang.IllegalArgumentException(); int a; SAP sap = new SAP(graph); List<Integer> one = nounToId.get(nounA); List<Integer> two = nounToId.get(nounB); if (one.size() > 1 && two.size() > 1) { Iterable<Integer> v = nounToId.get(nounA); Iterable<Integer> w = nounToId.get(nounB); a = sap.ancestor(v, w); } else { Integer i1 = one.get(0); Integer i2 = two.get(0); a = sap.ancestor(i1, i2); } return idToNoun.get(a); } // for unit testing of this class public static void main(String[] args) { WordNet wordnet = new WordNet(args[0], args[1]); //String anscestor = wordnet.sap("Black_Plague", "black_marlin"); //System.out.println("anscestor = " + anscestor); //int d = wordnet.distance("Brown_Swiss", "barrel_roll"); int d = wordnet.distance("horse", "cat"); System.out.println("d = " + d); } }
[ "adrian.roston@gmail.com" ]
adrian.roston@gmail.com
89ef52a575d6512b083ec5bfc81e08ff827dd845
ecf223d8b0eeac90340874148fac02f2035feb6a
/spring-talentos-v2/src/main/java/test/TestConcursoTalentos.java
624274797098a7c0b08a1bb9f719e05934305b05
[]
no_license
giovannileon/Spring-Framework
4be396105f012b98d816a9bb7423b7fe2dc78bcc
382f86f94a27b52f9a06800caf3f5a4dc54bc88e
refs/heads/master
2021-01-14T13:41:07.780868
2014-06-25T22:47:19
2014-06-25T22:47:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,301
java
package test; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.junit.Before; import org.junit.Test; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import static org.junit.Assert.assertEquals; import concursantes.Concursante; import concursantes.Malabarista; public class TestConcursoTalentos { private static Log logger = LogFactory.getLog("TestConcursoTalentos"); private Concursante malabarista1; private Concursante malabarista2; @Before public void before() { ApplicationContext ctx = new ClassPathXmlApplicationContext( "applicationContext.xml"); malabarista1 = (Concursante) ctx.getBean("solei"); malabarista2 = (Concursante) ctx.getBean("soleiRecitador"); } @Test public void testMalabarista() { logger.info("Inicio de ejecutar Malabarista"); int noPelotas = 10; malabarista1.ejecutar(); assertEquals(noPelotas, ((Malabarista) malabarista1).getPelotas()); logger.info("Fin de Ejecutar Malabarista"); logger.info("Inicio de ejecutar MalabaristaRecitador"); noPelotas = 15; malabarista2.ejecutar(); assertEquals(noPelotas, ((Malabarista) malabarista2).getPelotas()); logger.info("Fin de Ejecutar MalabaristaRecitador"); } }
[ "mcgalv@gmail.com" ]
mcgalv@gmail.com
b4501ec080fa06bc1aa8acab2a3683ddf7094dc8
2ea49bfaa6bc1b9301b025c5b2ca6fde7e5bb9df
/contributions/trungbnguyen/java/Fundamentals/2016-07-09.java
b18a838ade50c188bd7ad820401291fc1d7e12c3
[]
no_license
0x8801/commit
18f25a9449f162ee92945b42b93700e12fd4fd77
e7692808585bc7e9726f61f7f6baf43dc83e28ac
refs/heads/master
2021-10-13T08:04:48.200662
2016-12-20T01:59:47
2016-12-20T01:59:47
76,935,980
1
0
null
null
null
null
UTF-8
Java
false
false
239
java
Updating interfaces by using `default` methods Metadata: setting a file's owner Using `synchronized` statements Do not perform bitwise and arithmetic operations on the same data Do not return *references* to private *mutable* class members
[ "trung.tmac.nguyen@gmail.com" ]
trung.tmac.nguyen@gmail.com
75eddfa4059ed3b9e8daa369bbbe6c557b80ac2f
9dc9984b56a90a790b7d77e256c116d64094ef9f
/app/src/main/java/thomasapp/wineforfriendsnd/Mes_Coupsdecoeur.java
010d0e1a019edcfa592d79972ee76049376b609a
[]
no_license
Thomasprojet/WineforfriendsND
d714b7dfdc5f8630d62cb14ca87b1d0b052a21a5
a05cf870ca3bd0f95a70c0a69659c32e877af529
refs/heads/master
2020-03-20T05:48:06.287812
2018-06-13T14:26:25
2018-06-13T14:26:25
136,728,973
0
0
null
null
null
null
UTF-8
Java
false
false
9,308
java
package thomasapp.wineforfriendsnd; import android.app.Activity; import android.content.DialogInterface; import android.content.Intent; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.ProgressBar; import android.widget.TextView; import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.auth.FirebaseUser; import com.google.firebase.database.ChildEventListener; import com.google.firebase.database.DataSnapshot; import com.google.firebase.database.DatabaseError; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase; import com.google.firebase.database.ValueEventListener; import java.util.ArrayList; import java.util.List; public class Mes_Coupsdecoeur extends Activity { AlertDialog.Builder builder; private FirebaseAuth firebaseAuth; RecyclerView myrecyclerView; ImageView IM_flecheblanche; Mes_Coupsdecoeur.RecyclerAdapterCoupsdecoeur adapterWine; List<MesCoupsdecoeurGETSET> listdata; FirebaseDatabase FBD; DatabaseReference DBR; FirebaseDatabase FBDpseudo; DatabaseReference DBRpseudo; ProgressBar progressBar; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_mes__coupsdecoeur); progressBar = (ProgressBar) findViewById(R.id.progressbarmesvins); IM_flecheblanche = (ImageView) findViewById(R.id.imageflecheblanche); progressBar.setVisibility(View.VISIBLE); myrecyclerView = (RecyclerView) findViewById(R.id.recyclerviewcoupsdecoeur); myrecyclerView.setHasFixedSize(true); RecyclerView.LayoutManager LM = new LinearLayoutManager(getApplicationContext()); listdata = new ArrayList<>(); adapterWine = new Mes_Coupsdecoeur.RecyclerAdapterCoupsdecoeur((ArrayList<MesCoupsdecoeurGETSET>) listdata); myrecyclerView.setLayoutManager(LM); IM_flecheblanche.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent i = new Intent(Mes_Coupsdecoeur.this, Filtre_par_couleur.class); startActivity(i); finish(); } }); FBD = FirebaseDatabase.getInstance(); FBDpseudo = FirebaseDatabase.getInstance(); builder = new AlertDialog.Builder(Mes_Coupsdecoeur.this); firebaseAuth = FirebaseAuth.getInstance(); final FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser(); assert user != null; final String email = user.getEmail(); assert email != null; final String emaildecode = email.replace(".",","); progressBar.setVisibility(View.VISIBLE); DBRpseudo = FBDpseudo.getReference("coupsdecoeur"); DBRpseudo.child(emaildecode).orderByChild("chateaux").addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) { if (!dataSnapshot.exists()) { builder.setTitle("Aucun coup de coeur pour le moment"); builder.setMessage(""); builder.setCancelable(false); displayAlertfirstuse(); } else { DBR = FBD.getReference("coupsdecoeur"); DBR.child(emaildecode).addChildEventListener(new ChildEventListener() { @Override public void onChildAdded(DataSnapshot dataSnapshot, String s) { new MesCoupsdecoeurGETSET(); MesCoupsdecoeurGETSET mesCoupsdecoeurGETSET; mesCoupsdecoeurGETSET = dataSnapshot.getValue(MesCoupsdecoeurGETSET.class); listdata.add(mesCoupsdecoeurGETSET); myrecyclerView.setAdapter(adapterWine); adapterWine.notifyDataSetChanged(); progressBar.setVisibility(View.INVISIBLE); } @Override public void onChildChanged(DataSnapshot dataSnapshot, String s) { } @Override public void onChildRemoved(DataSnapshot dataSnapshot) { } @Override public void onChildMoved(DataSnapshot dataSnapshot, String s) { } @Override public void onCancelled(DatabaseError databaseError) { } }); } } @Override public void onCancelled(DatabaseError databaseError) { } }); } public class RecyclerAdapterCoupsdecoeur extends RecyclerView.Adapter<Mes_Coupsdecoeur.RecyclerAdapterCoupsdecoeur.MyViewHolder>{ ArrayList<MesCoupsdecoeurGETSET> arrayList; public RecyclerAdapterCoupsdecoeur(ArrayList<MesCoupsdecoeurGETSET>arrayList) { this.arrayList = arrayList; } @Override public Mes_Coupsdecoeur.RecyclerAdapterCoupsdecoeur.MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.row_layout_coupsdecoeur,parent,false); return new Mes_Coupsdecoeur.RecyclerAdapterCoupsdecoeur.MyViewHolder(view); } @Override public void onBindViewHolder(final Mes_Coupsdecoeur.RecyclerAdapterCoupsdecoeur.MyViewHolder holder, int position) { MesCoupsdecoeurGETSET mesCoupsdecoeurGETSET = arrayList.get(position); holder.Chateaux.setText(mesCoupsdecoeurGETSET.getChateaux()); holder.Commentaire.setText(mesCoupsdecoeurGETSET.getCommentaire()); //holder.ajoutepar.setText(winesGETSET.getUsermail()); holder.Type.setText(mesCoupsdecoeurGETSET.getType()); holder.pseudo.setText(mesCoupsdecoeurGETSET.getPseudo()); if (holder.Type.getText().toString().equals("rouge")){ holder.Typeimage.setImageResource(R.mipmap.rougerv);} else if(holder.Type.getText().toString().equals("blanc")){ holder.Typeimage.setImageResource(R.mipmap.blancrv);} else if(holder.Type.getText().toString().equals("rose")){ holder.Typeimage.setImageResource(R.mipmap.roserv);} else if(holder.Type.getText().toString().equals("champagne")){ holder.Typeimage.setImageResource(R.mipmap.champagnerv);} else {holder.Typeimage.setImageResource(R.mipmap.spiritueuxrv);} /*holder.itemView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent i = new Intent(MainActivity.this, OnClick_Wine.class); i.putExtra("Type",holder.Type.getText().toString()); i.putExtra("Ajoutepar", holder.pseudo.getText().toString()); i.putExtra("Chateaux", holder.Chateaux.getText().toString()); i.putExtra("Premiercommentaire", holder.Commentaire.getText().toString()); startActivity(i); //Toast.makeText(getApplicationContext(), (CharSequence) holder.pseudo, Toast.LENGTH_LONG).show(); } });*/ } @Override public int getItemCount() { return arrayList.size(); } public class MyViewHolder extends RecyclerView.ViewHolder { TextView Chateaux,Commentaire,Type, ajoutepar,pseudo; ImageView Typeimage; public MyViewHolder (View view) { super(view); Chateaux = (TextView) view.findViewById(R.id.tvchateaux); pseudo = (TextView) view.findViewById(R.id.tvaddedby); Commentaire = (TextView) view.findViewById(R.id.tvcommentaire); Type = (TextView) view.findViewById(R.id.separation); Typeimage = (ImageView) view.findViewById(R.id.ivtype); } } } public void displayAlertfirstuse() { builder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { Intent i = new Intent(Mes_Coupsdecoeur.this, MainActivity.class); startActivity(i); finish(); } }); AlertDialog alertDialog = builder.create(); alertDialog.show(); } @Override public void onBackPressed() { Intent i = new Intent(Mes_Coupsdecoeur.this, Filtre_par_couleur.class); startActivity(i); finish(); } }
[ "thomasdechaseaux@gmail.com" ]
thomasdechaseaux@gmail.com
1866843b83ce6f6cc04c7f3325fb28693aef193a
d36ca1c1440f90ce589a0cc9fbbdbfea958e601d
/app/src/main/java/com/vritti/sass/model/EquipmentUse.java
61bd20e2f58b6642772b469c76cdadc4bf9d4351
[]
no_license
SayaliGonjariVritti/SASS
5c3fbc3e724a0527b0d10c5adfc4a3d92189f1d8
f840fc57c08612515cd36776bec2595d6c8c8997
refs/heads/master
2023-06-13T07:38:40.343377
2021-07-08T09:12:01
2021-07-08T09:12:01
384,051,428
0
0
null
null
null
null
UTF-8
Java
false
false
1,404
java
package com.vritti.sass.model; import java.io.Serializable; /** * Created by sharvari on 21-Dec-18. */ public class EquipmentUse implements Serializable { String PKQuesID,QuesCode,QuesText,SelectionText,SelectionValue; private boolean selected; String remarks; public String getRemarks() { return remarks; } public void setRemarks(String remarks) { this.remarks = remarks; } public boolean isSelected() { return selected; } public void setSelected(boolean selected) { this.selected = selected; } public String getPKQuesID() { return PKQuesID; } public void setPKQuesID(String PKQuesID) { this.PKQuesID = PKQuesID; } public String getQuesCode() { return QuesCode; } public void setQuesCode(String quesCode) { QuesCode = quesCode; } public String getQuesText() { return QuesText; } public void setQuesText(String quesText) { QuesText = quesText; } public String getSelectionText() { return SelectionText; } public void setSelectionText(String selectionText) { SelectionText = selectionText; } public String getSelectionValue() { return SelectionValue; } public void setSelectionValue(String selectionValue) { SelectionValue = selectionValue; } }
[ "gonjari.sayali96@gmail.com" ]
gonjari.sayali96@gmail.com
b7f5e4f13e4a2fa77bcedccba1aaf0dd1efed773
d72039d2b617a6135ff65faddeb143e4e6f0facc
/freyja-parent/freyja-net/src/main/java/org/freyja/server/mina/message/Response.java
cd8e2dcefae62dd5ad7e7ebf5df4df94b544ac23
[]
no_license
change2/freyja
dcb1627e18d277bd3b8a69e8785f8b65514a2e74
217c416e90c8ff8717d2ef93f8a1254a4457ffb3
refs/heads/master
2021-05-31T17:03:04.539022
2016-04-14T03:30:44
2016-04-14T03:30:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
699
java
package org.freyja.server.mina.message; import com.alibaba.fastjson.JSON; public class Response extends Message { /** 返回值 */ private Object result; /** 请求状态,0表示正常 其他值表示出现异常 */ private int status; public int getStatus() { return status; } public void setStatus(int status) { this.status = status; } public Object getResult() { return result; } public void setResult(Object result) { this.result = result; } /** 转化成key */ public String toKey() { return new StringBuffer().append(getCmd()).append(".") .append(getStatus()).toString(); } @Override public String toString() { return JSON.toJSONString(this); } }
[ "121077313@qq.com" ]
121077313@qq.com
0c5ad6ca6991a78435017b3be99363a6c68629a4
d38603d9f8c8fbbfc4d72c016716b816c166b700
/src/main/java/shapes/DrawShapes.java
9ed1582520c98e346dc250088efe84633e427c3e
[]
no_license
thiagoCampo/ShappeApp
3b8ea99a8d07144e0c5ff3bf6613b55fadfec05e
d653b4e2739b88f02ea6ac41709ce227dd82cf2a
refs/heads/master
2023-08-29T06:23:59.782963
2021-11-11T11:36:30
2021-11-11T11:36:30
426,216,646
0
0
null
null
null
null
UTF-8
Java
false
false
96
java
package shapes; import java.awt.*; public interface DrawShapes { void draw(Graphics g); }
[ "campoarboles@gmail.com" ]
campoarboles@gmail.com
50fd5d060f72b83ddac69fe4e3389425e0146021
68e8aa9c993f3daeb32322e02d75c2047cb0d742
/src/main/java/com/zih/booking/dao/SenderMapper.java
b5ab3fd11b5acf8b0bd62948ad86fd2d08e7b0b4
[]
no_license
WZCtqs/booking
129a5d45190f7f81146ecf41039f5df361c65c6a
59171db0fd6ed4015db2967249947c263f7399b2
refs/heads/main
2023-03-03T14:52:06.457169
2021-02-17T08:55:09
2021-02-17T08:55:09
339,660,157
0
0
null
null
null
null
UTF-8
Java
false
false
264
java
package com.zih.booking.dao; import com.zih.booking.model.Sender; import com.baomidou.mybatisplus.mapper.BaseMapper; /** * <p> * Mapper 接口 * </p> * * @author wsl123 * @since 2020-02-25 */ public interface SenderMapper extends BaseMapper<Sender> { }
[ "1120159229@qq.com" ]
1120159229@qq.com
a3d1dacab616d33eb540c4fb5e31fb86519bd8d3
0a5779aba8eb91684e4965df4d40c0c149f7c268
/src/main/java/com/hadi/zikr/security/jwt/JWTConfigurer.java
7e11931f1564dfb7eb2ad1087bdac48445f09284
[]
no_license
jaouadmed/zikr-hadi
515fe3c84732afd1c298a906b9714136b72784ce
e0d6da9231f559a255935c1390582f9f2c08b339
refs/heads/main
2023-03-30T20:01:49.653839
2021-04-03T21:48:58
2021-04-03T21:48:58
352,364,732
0
0
null
2021-04-01T00:20:01
2021-03-28T15:24:12
Java
UTF-8
Java
false
false
842
java
package com.hadi.zikr.security.jwt; import org.springframework.security.config.annotation.SecurityConfigurerAdapter; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.web.DefaultSecurityFilterChain; import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; public class JWTConfigurer extends SecurityConfigurerAdapter<DefaultSecurityFilterChain, HttpSecurity> { private final TokenProvider tokenProvider; public JWTConfigurer(TokenProvider tokenProvider) { this.tokenProvider = tokenProvider; } @Override public void configure(HttpSecurity http) { JWTFilter customFilter = new JWTFilter(tokenProvider); http.addFilterBefore(customFilter, UsernamePasswordAuthenticationFilter.class); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
8c1a90b702cde819fc70cc83fe01659b925435aa
eb55763b2c53b741a7f81a2fc07fc1419755c6fb
/Escape/src/walls/WallBegin.java
0e7ba68e3e46bb9f161b20ee5870b7c22a69ef48
[]
no_license
SallyPY/Escape
9e5bdddd315ce14671348aa3fa61768c4edcd56c
abc39b58a0bd5c74d3c7afd17b8cd2c074736d64
refs/heads/master
2016-08-08T14:57:01.185055
2015-06-30T03:45:31
2015-06-30T03:45:31
26,621,509
0
0
null
null
null
null
UTF-8
Java
false
false
834
java
package walls; import images.ImageInventoryPanel; import java.awt.CardLayout; import java.awt.Color; import escape.GamePanel; /** * Flipping through the four walls occurs here */ public class WallBegin extends WallPanel { CardLayout cl; FirstWall first; SecondWall second; ThirdWall third; FourthWall fourth; GamePanel gp; public WallBegin(GamePanel g, ImageInventoryPanel sp){ super(); gp = g; setBackground(Color.BLACK); cl = new CardLayout(); setLayout(cl); first = new FirstWall(this, gp); add(first,"first"); second = new SecondWall(this, gp); add(second,"second"); third = new ThirdWall(this, gp); add(third,"third"); fourth = new FourthWall(this, gp); add(fourth, "fourth"); cl.show(this, "first"); } public CardLayout getCl() {return cl;} }
[ "sallypyuen@gmail.com" ]
sallypyuen@gmail.com
0fff9745465c770d83cbfec60f727e67033927da
76fe8588a60853c3003bd0f782c7264b5249b3fc
/MGE_GITHUB/src/test/java/dpu_runners/PY020RefundAdjustment.java
9ff061277048cb8d809f4956ae2ec5c4e12f66e2
[]
no_license
achangco24/mge_selenium
cc8ba02222f5956072401e9c5a52941b69a17ce0
41c6c58da5a81aa8570cdf3f938a3f2aae604925
refs/heads/master
2022-12-29T20:10:53.370572
2020-10-15T00:30:31
2020-10-15T00:30:31
304,165,482
0
0
null
null
null
null
UTF-8
Java
false
false
1,037
java
/* ************************************************************************************* * * PROGRAM DESCRIPTION: * * PY020 Refund Adjustment * ************************************************************************************* * * Author: EY_PHADV_Manila_Testing.GID@ey.net * * CHANGE HISTORY: * * Date: by: Reason: * YYYY-MM-DD IN Reason text. * ************************************************************************************* */ package dpu_runners; import cucumber.api.CucumberOptions; import cucumber.api.testng.AbstractTestNGCucumberTests; @CucumberOptions( features = "src/test/java/dpu_features/PY020RefundAdjustment.feature", glue = "dpu_stepdefinitions" ) public class PY020RefundAdjustment extends AbstractTestNGCucumberTests{ }
[ "achangco@mge.com" ]
achangco@mge.com
66a18fae73521ffedb68473ba7f7a18c8201a780
d537c7579fc8d0b6387af90d15727ee3e17f4be3
/ConwaysGame/src/conwaysgame/ConwaysGame.java
6b170756d2334e3ed01143317fb46d292850e785
[]
no_license
brandonchu98/game
553a047d4b583c8eba9e56549f15cdd3b305215c
d3e9a6844676bbb469bfffe611b7d9d70d2d98d8
refs/heads/master
2021-04-12T08:06:31.039633
2018-05-28T22:00:03
2018-05-28T22:00:03
125,904,574
0
0
null
null
null
null
UTF-8
Java
false
false
407
java
package conwaysgame; public class ConwaysGame { public void doTest() { ColonyVC vc = new ColonyVC(); System.out.println("Welcome to the game of life!\n"); System.out.println("Option for the game of life\n"); vc.h(); vc.inputOptions(); } public static void main(String[] args) { ConwaysGame c = new ConwaysGame(); c.doTest(); } }
[ "noreply@github.com" ]
brandonchu98.noreply@github.com
771c96ff12cfadd9f130e1f0d85e0546f6183006
09a16f743263f143394acfecdb21efee8205489f
/app/src/main/java/com/dushuge/controller/ui/audio/adapter/AudioSelectionsAdapter.java
39d23e0d6aab6e2f834cd82fc69b75ed7d093022
[]
no_license
zhangxincheng/20210124_Demo
b859bd97d6f4ac729c0a52c4b3ecb2282778f14e
c99ec0ece407f9a76e40d5ac0846fe44643e1156
refs/heads/master
2023-03-02T12:06:14.842303
2021-01-31T11:56:23
2021-01-31T11:56:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,774
java
package com.dushuge.controller.ui.audio.adapter; import android.app.Activity; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import com.dushuge.controller.R; import com.dushuge.controller.base.BaseRecAdapter; import com.dushuge.controller.base.BaseRecViewHolder; import com.dushuge.controller.model.AudioSelectionsBean; import com.dushuge.controller.ui.utils.ImageUtil; import com.dushuge.controller.utils.ScreenSizeUtils; import java.util.List; import butterknife.BindView; /** * 选章适配器 */ public class AudioSelectionsAdapter extends BaseRecAdapter<AudioSelectionsBean, AudioSelectionsAdapter.ViewHolder> { private OnSelectionsListener onSelectionsListener; public void setOnSelectionsListener(OnSelectionsListener onSelectionsListener) { this.onSelectionsListener = onSelectionsListener; } private int index = -1; /** * 设置高亮 * * @param position */ public void setPosition(int position) { this.index = position; } public AudioSelectionsAdapter(Activity activity, List<AudioSelectionsBean> list, int position) { super(list, activity); this.index = position; } @Override public void onHolder(ViewHolder holder, AudioSelectionsBean bean, int position) { if (bean != null) { if (position == 0) { holder.line.setVisibility(View.GONE); } else { holder.line.setVisibility(View.VISIBLE); } holder.textView.setText(bean.getStartNum() + "-" + bean.getEndNum()); holder.textView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (index != position && onSelectionsListener != null) { index = position; onSelectionsListener.onSelection(index); } } }); } } @Override public ViewHolder onCreateHolder() { return new ViewHolder(getViewByRes(R.layout.item_audio_selections)); } public class ViewHolder extends BaseRecViewHolder { @BindView(R.id.item_audio_selections_line) View line; @BindView(R.id.item_audio_selections_text) TextView textView; public ViewHolder(View itemView) { super(itemView); ViewGroup.LayoutParams params = textView.getLayoutParams(); params.width = ScreenSizeUtils.getInstance(activity).getScreenWidth() - ImageUtil.dp2px(activity, 40); textView.setLayoutParams(params); } } public interface OnSelectionsListener { void onSelection(int position); } }
[ "949122398@qq.com" ]
949122398@qq.com
716e422131f9d79eacc7468eb4bf64f445dccf4f
2de80f745f81658091a0e1c5aad9e235763a2ea4
/src/com/company/Simulation.java
b9e871a353b34468aeb76f2eadc52e0feee4f0da
[]
no_license
therealEvgen/FrogSimulation
8c7c0c8bb36c37843c27318e449fa052eb2ad04b
31f5cc36792072f0992e6bc64350642948fab33d
refs/heads/master
2020-04-06T15:19:40.267960
2018-11-14T15:59:19
2018-11-14T15:59:19
157,574,282
0
0
null
null
null
null
UTF-8
Java
false
false
619
java
package com.company; public class Simulation { public boolean simulate() { int position = 0; for (int count = 0; count < maxHops; count++) { position += hopDistance(); if (position >= goalDistance) { return true; } else if (position < 0) { } } return false; } } public double runSimulations(int num) { int countSuccess = 0; for (int count = 0; count < num; count++) { if (simulate()) { countSuccess++; } } return (double)countSuccess / num; }
[ "BT_1N3_28@bktech.local" ]
BT_1N3_28@bktech.local
f4a51739a772650d88a413ebcbc5518701a55b94
e6f31d1bea1e45e250a6ea799633fb821ad38e82
/src/colecciones/TestSortedSet.java
a4b36190a843dec307d7e6a433dd2a9c695a0e5a
[]
no_license
Joseba10/Colecciones
47c00a2b52a7e4886e7077371ade9a2c459e6cdc
a188ab446f41e0daee471e4f07ddbfa3c9fd55f6
refs/heads/master
2020-05-31T16:26:29.255286
2019-06-18T10:21:39
2019-06-18T10:21:39
190,381,464
0
0
null
null
null
null
UTF-8
Java
false
false
682
java
package colecciones; import java.util.Iterator; import java.util.Set; import java.util.SortedSet; import java.util.TreeSet; import geometria.Punto; public class TestSortedSet { public static void main(String[] args) { // cargar SortedSet<Integer> sortedSetNumeros = new TreeSet<Integer>(); sortedSetNumeros.add(2); sortedSetNumeros.add(-7); sortedSetNumeros.add(12); sortedSetNumeros.add(4); // recorrer Iterator<Integer> iterator = sortedSetNumeros.iterator(); boolean hayMas = iterator.hasNext(); while (hayMas) { Integer entero = iterator.next(); System.out.println(entero); hayMas = iterator.hasNext(); } } }
[ "tuemail@ipartek.com" ]
tuemail@ipartek.com
516bac7d0d1a958993e057b67f8f5ee2edf0caca
9daab47683036e146981b055f2323efc9567bcf0
/app/src/main/java/com/hmproductions/myreddit/ui/MainActivity.java
9f3f87e0204dc9e64348b8a989854caf84bb9d2a
[]
no_license
Harsh2098/MyReddit
9aca9230d0a9d27e4ddf495d7c507111723e3eb7
7e3fd963b98e5a6b401c955b4cbb93888ae8e0b3
refs/heads/master
2021-01-01T05:56:11.810720
2017-07-15T17:32:50
2017-07-15T17:32:50
97,312,032
0
0
null
null
null
null
UTF-8
Java
false
false
5,285
java
package com.hmproductions.myreddit.ui; import android.content.Context; import android.content.Intent; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.os.Bundle; import android.support.v4.app.LoaderManager; import android.support.v4.content.Loader; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.ProgressBar; import android.widget.RelativeLayout; import android.widget.TextView; import com.github.pwittchen.infinitescroll.library.InfiniteScrollListener; import com.hmproductions.myreddit.R; import com.hmproductions.myreddit.adapters.RedditPostsRecyclerAdapter; import com.hmproductions.myreddit.data.RedditPost; import com.hmproductions.myreddit.utils.OfflinePostsAsyncTask; import com.hmproductions.myreddit.utils.RedditPostsLoader; import java.util.ArrayList; import java.util.List; public class MainActivity extends AppCompatActivity implements LoaderManager.LoaderCallbacks<List<RedditPost>> { private static final String REDDIT_TOP_POSTS_API = "https://www.reddit.com/r/todayilearned/top.json?count=10"; private static final int LOADER_ID = 100; RelativeLayout connectionErrorLayout; RecyclerView topPosts_recyclerView; ProgressBar postsProgressBar; TextView loading_textView; List<RedditPost> mMainList = new ArrayList<>(); boolean mConnected; LinearLayoutManager layoutManager; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); connectionErrorLayout = (RelativeLayout)findViewById(R.id.connection_error_layout); topPosts_recyclerView = (RecyclerView)findViewById(R.id.posts_recyclerView); postsProgressBar = (ProgressBar)findViewById(R.id.posts_progressBar); loading_textView = (TextView) findViewById(R.id.loading_textView); layoutManager = new LinearLayoutManager(this); topPosts_recyclerView.setLayoutManager(layoutManager); topPosts_recyclerView.setAdapter(new RedditPostsRecyclerAdapter(this, mMainList)); topPosts_recyclerView.addOnScrollListener(createInfiniteScrollListener()); topPosts_recyclerView.setHasFixedSize(false); // Checks if Internet Connectivity is Available ConnectivityManager connectivityManager = (ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo networkInfo = connectivityManager.getActiveNetworkInfo(); mConnected = networkInfo != null && networkInfo.isConnected(); if (mConnected) { topPosts_recyclerView.setVisibility(View.VISIBLE); connectionErrorLayout.setVisibility(View.GONE); getSupportLoaderManager().restartLoader(LOADER_ID, null, this); } else { topPosts_recyclerView.setVisibility(View.GONE); connectionErrorLayout.setVisibility(View.VISIBLE); } } @Override public Loader<List<RedditPost>> onCreateLoader(int id, Bundle args) { postsProgressBar.setVisibility(View.VISIBLE); loading_textView.setVisibility(View.VISIBLE); return new RedditPostsLoader(MainActivity.this, REDDIT_TOP_POSTS_API); } @Override public void onLoadFinished(Loader<List<RedditPost>> loader, List<RedditPost> data) { postsProgressBar.setVisibility(View.GONE); loading_textView.setVisibility(View.GONE); OfflinePostsAsyncTask saveAsyncTask = new OfflinePostsAsyncTask(MainActivity.this, data); saveAsyncTask.execute(); mMainList.addAll(data); topPosts_recyclerView.setAdapter(new RedditPostsRecyclerAdapter(this, mMainList)); } @Override public void onLoaderReset(Loader<List<RedditPost>> loader) { // #YOLO } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.main_activity_menu, menu); return true; } @Override public boolean onPrepareOptionsMenu(Menu menu) { if (!mConnected) menu.findItem(R.id.search_post_item).setVisible(false); return super.onPrepareOptionsMenu(menu); } @Override public boolean onOptionsItemSelected(MenuItem item) { if(item.getItemId() == R.id.offline_posts_item) { startActivity(new Intent(MainActivity.this, OfflineActivity.class)); } else if (item.getItemId() == R.id.search_post_item) { startActivity(new Intent(MainActivity.this, SearchActivity.class)); } return super.onOptionsItemSelected(item); } private InfiniteScrollListener createInfiniteScrollListener() { return new InfiniteScrollListener(24, layoutManager) { @Override public void onScrolledToEnd(int firstVisibleItemPosition) { getSupportLoaderManager().restartLoader(LOADER_ID, null, MainActivity.this); refreshView(topPosts_recyclerView, new RedditPostsRecyclerAdapter(MainActivity.this, mMainList), firstVisibleItemPosition); } }; } }
[ "harshmahajan927@yahoo.com" ]
harshmahajan927@yahoo.com
3cc320d6d8bc0e0452b489498bc044c2a48eeafc
bcc57fadf3c7e93f2ef4dfad18a93f964c11d725
/3er Cuatrimeste/Tamagotchi3/src/programa/IAction.java
88e2d5a3328e5c026135340cdcbdab8e5ac4f2c1
[]
no_license
eliseoabelcarh/JAVA-ort
4fbbc55754c83f45eedd154f3e97f9142f8d2884
cb2be28aa8d3c458b9f2b57099622053a13c1377
refs/heads/master
2021-04-04T02:09:16.931732
2020-08-19T22:05:18
2020-08-19T22:05:18
248,415,727
0
0
null
null
null
null
UTF-8
Java
false
false
78
java
package programa; public interface IAction { public String getValor(); }
[ "eliseoabelcarh@gmail.com" ]
eliseoabelcarh@gmail.com
79de7d464810a9cde36f012c121bb3fbd162c868
c502c3f5e16e59492c226f5b977cd5ab0beb4ea3
/workspace/manager/src/main/java/com/xiaoyi/common/utils/ClientCustomSSL.java
7977f60738083fa595c684aadfc74da43ad66c73
[]
no_license
yiduiyi/xiaoyi
a5f9ee9dd98d41c42dd79ce9205e74cb014e333f
2c8571a8592264cd8d37b5d0decff90c04a90c71
refs/heads/master
2021-07-07T22:47:44.369909
2018-11-30T02:22:33
2018-11-30T02:22:33
110,972,569
3
4
null
null
null
null
UTF-8
Java
false
false
3,294
java
package com.xiaoyi.common.utils; import java.io.File; import java.io.FileInputStream; import java.security.KeyStore; import javax.net.ssl.SSLContext; import org.apache.http.HttpEntity; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpPost; import org.apache.http.conn.ssl.SSLConnectionSocketFactory; import org.apache.http.conn.ssl.SSLContexts; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.util.EntityUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.xiaoyi.wechat.utils.WeiXinConfig; /** * This example demonstrates how to create secure connections with a custom SSL * context. */ public class ClientCustomSSL { public static Logger logger = LoggerFactory.getLogger(ClientCustomSSL.class); @SuppressWarnings("deprecation") public static String doRefund(String url, String data) throws Exception { /** * 注意PKCS12证书 是从微信商户平台-》账户设置-》 API安全 中下载的 */ KeyStore keyStore = KeyStore.getInstance("PKCS12"); // System.out.println(System.getProperty("user.dir")); String path = ClientCustomSSL.class.getResource("/").getPath(); logger.info("path:" + path); // path=path.substring(1, path.indexOf("classes")); logger.info("replaced path:" + path); logger.info("final path:" + path + "config//apiclient_cert.p12"); FileInputStream instream = new FileInputStream(new File( path + "config//apiclient_cert.p12"/* WeiXinConfig.CA_LICENSE */));// P12文件目录 logger.info("fd:" + instream.getFD()); try { /** * 此处要改 */ keyStore.load(instream, WeiXinConfig.mchId.toCharArray());// 这里写密码..默认是你的MCHID } finally { instream.close(); } // Trust own CA and all self-signed certs /** * 此处要改 */ SSLContext sslcontext = SSLContexts.custom().loadKeyMaterial(keyStore, WeiXinConfig.mchId.toCharArray())// 这里也是写密码的 .build(); // Allow TLSv1 protocol only SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(sslcontext, new String[] { "TLSv1" }, null, SSLConnectionSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER); CloseableHttpClient httpclient = HttpClients.custom().setSSLSocketFactory(sslsf).build(); try { HttpPost httpost = new HttpPost(url); // 设置响应头信息 httpost.addHeader("Connection", "keep-alive"); httpost.addHeader("Accept", "*/*"); httpost.addHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); httpost.addHeader("Host", "api.mch.weixin.qq.com"); httpost.addHeader("X-Requested-With", "XMLHttpRequest"); httpost.addHeader("Cache-Control", "max-age=0"); httpost.addHeader("User-Agent", "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0) "); httpost.setEntity(new StringEntity(data, "UTF-8")); CloseableHttpResponse response = httpclient.execute(httpost); try { HttpEntity entity = response.getEntity(); String jsonStr = EntityUtils.toString(response.getEntity(), "UTF-8"); EntityUtils.consume(entity); return jsonStr; } finally { response.close(); } } finally { httpclient.close(); } } }
[ "347087829@qq.com" ]
347087829@qq.com
d4b4b2b317d0bc334e7315acef680f34a816d753
605f8dc04230f6d067437aa00456aa6a21317f57
/src/com/thenewboston/travis/AboutUs.java
7a3c537645b8a0788c9d8935dee7bd398a0c0c7a
[]
no_license
darkneo14/TheNewBoston
317c2c91cbdba84f8c08c9894e12c272e72d2173
9e10fc8c9c211197d4ab5ce01a84c5c0d1b5510c
refs/heads/master
2021-01-20T04:29:57.957206
2015-09-16T14:10:33
2015-09-16T14:10:33
42,592,156
0
0
null
null
null
null
UTF-8
Java
false
false
315
java
package com.thenewboston.travis; import android.app.Activity; import android.os.Bundle; public class AboutUs extends Activity{ @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.about); } }
[ "prashant.gupta1194@gmail.com" ]
prashant.gupta1194@gmail.com
7ae621e93b1fc913ecc5dedec61ab4922cce6ecf
cd9ad0d5153cbc5e7ecd6070b16dd6895d87c5ba
/Player.java
3b80accafc227e5e04be7c5f7e2f74da1e5520f9
[]
no_license
JackyT0n/Hyrule-Beatdown
22be83cb7bf70ecf27d79e1868c376308b9fcfa7
5c50c93b229373ba4e47a3117df0e9258cc71915
refs/heads/master
2021-01-22T01:54:45.820654
2017-02-05T19:48:02
2017-02-05T19:48:02
81,016,355
0
0
null
null
null
null
UTF-8
Java
false
false
16,256
java
//Player class that controls all aspects of the character import java.awt.*; import java.awt.event.*; import java.awt.image.*; import javax.swing.*; import java.awt.MouseInfo; import java.util.*; import java.util.List; import javax.imageio.ImageIO; import java.io.File; public class Player { //Character Info private int x,y,vy,prevX, prevY, newX, newY, health;//coordinates of the player and health private final int G = 1; //Gravity value private final int T_V = 20; //Terminal Velocity (max speed player can fall) private Animation animation = new Animation(); //Animation class that will handle frames of the character private String colour = ""; //colour of the character private int direction; //current direction the player is facing private Projectile arrow; //projectile of the character private boolean alive = true; //flag to check if you are alive private static Map tileMap; //The tileMap the player can interact with private boolean jump = false; //flag to check if you have jumped yet private boolean livearrow = false; //flag to check if you have fired a projectile yet private Rectangle hitBox, hitBoxMelee; //hit boxes for your character and your weapon //Timers private long arrowTime; //Timer for arrow ammo private long stunTime; //Timer for amount of time stunned private long deathTime; //Timer for death animation before the game resets //Animation flags private boolean shootableArrow = true; //Flag to show you can shoot an arrow private boolean attackAnimation = false; //Flag to show the character is currently in attacking animation private boolean bowAnimation = false; //Flag to show the character is currently in bow animation private boolean hitStunAnimation = false; //Flag to show the character is currently in hitStun animation private boolean deathAnimation = false; //Flag to show the character is currently in dying animation private int currentTileX, currentTileX2; //currentTileX left side of player, currentTileX2 right side of player private int currentTileY, currentTileY2; //currentTileY top part of player, currentTileY2 bottom side of player private boolean movingR = false; //Flag to show the character is moving to the right private boolean movingL = false; //Flag to show the character is moving to the left //Player Variables private final int RIGHT = 1; //direction - right private final int LEFT = 2; //direction - left private final int WIDTH = 25; //width of the character hitbox private final int LENGTH = 50; //length of the character hitbox private final int spriteWidth = 50; //Average size of Sprites private final int spriteLength = 50; //Player Sprites private BufferedImage[] idleSprites; private BufferedImage[] walkingSprites; private BufferedImage[] jumpSprites; private BufferedImage[] jumpingSprites; private BufferedImage[] fallSprites; private BufferedImage[] attackSprites; private BufferedImage[] bowSprites; private BufferedImage[] stunSprites; private BufferedImage[] deathSprites; private int currentSprite; //Constructor public Player(int x, int y, Map tileMap, int type) { if (type == 1){ //Player 1 is a different colour colour = "Dark"; } if (type == 2){ colour = ""; } this.x = x; this.y = y; this.tileMap = tileMap; prevX = x; //set previous step to initial position prevY = y; direction = RIGHT; health = 100; try { //idle sprites idleSprites = new BufferedImage[4]; BufferedImage image = ImageIO.read(new File ("PlayerSprites/" +colour+ "LinkIdle.png")); for(int i = 0; i < idleSprites.length; i++){ idleSprites[i] = image.getSubimage( i * spriteWidth, 0, spriteWidth, spriteLength ); } //walking sprites walkingSprites = new BufferedImage[8]; BufferedImage image1 = ImageIO.read(new File ("PlayerSprites/" + colour + "LinkWalk.png")); for(int i = 0; i < walkingSprites.length; i++){ walkingSprites[i] = image1.getSubimage( i * spriteWidth, 0, spriteWidth, spriteLength ); } //jumping sprites jumpSprites = new BufferedImage[3]; jumpingSprites = new BufferedImage[1]; BufferedImage image2 = ImageIO.read(new File ("PlayerSprites/" + colour + "LinkJump.png")); for(int i = 0; i < jumpSprites.length; i++){ jumpSprites[i] = image2.getSubimage( i * spriteWidth, 0, spriteWidth, spriteLength ); } jumpingSprites[0] = jumpSprites[2]; //Falling Sprites fallSprites = new BufferedImage[1]; BufferedImage image3 = ImageIO.read(new File ("PlayerSprites/" + colour + "LinkFall.png")); fallSprites[0] = image3; //Attack Sprite attackSprites = new BufferedImage[6]; BufferedImage image6 = ImageIO.read(new File ("PlayerSprites/" + colour + "LinkAttack.png")); attackSprites[0] = image6.getSubimage(0,0,79,63); attackSprites[1] = image6.getSubimage(100,0,79,63); attackSprites[2] = image6.getSubimage(200,0,79,63); attackSprites[3] = image6.getSubimage(300,0,79,63); attackSprites[4] = image6.getSubimage(400,0,79,63); attackSprites[5] = image6.getSubimage(500,0,79,63); //Bow Sprites bowSprites = new BufferedImage[2]; BufferedImage image7 = ImageIO.read(new File ("PlayerSprites/" + colour + "LinkBow.png")); bowSprites[1] = image7.getSubimage(0,0,50,50); bowSprites[0] = image7.getSubimage(0,50,50,50); //Stun Sprites stunSprites = new BufferedImage[4]; BufferedImage image8 = ImageIO.read(new File ("PlayerSprites/" + colour + "LinkStun.png")); stunSprites[0] = image8.getSubimage(0,0,50,50); stunSprites[1] = image8.getSubimage(50,0,50,50); stunSprites[2] = image8.getSubimage(50,0,50,50); stunSprites[3] = image8.getSubimage(50,0,50,50); //deathSprites deathSprites = new BufferedImage[15]; deathSprites[0] = image8.getSubimage(0,0,50,50); deathSprites[1] = image8.getSubimage(50,0,50,50); deathSprites[2] = image8.getSubimage(100,0,50,50); deathSprites[3] = image8.getSubimage(150,0,50,50); for(int i = 4; i < 14; i++){ deathSprites[i] = image8.getSubimage(150,0,50,50); } } catch(Exception e) { e.printStackTrace(); } } //Check if the player is facing the left ( for arrows) public boolean facingLeft(){ if (direction == LEFT){ return true; } return false; } //Return what kind of animation the player is currently doing public void getAnimation(){ playerTimer(); if(movingL == true || movingR == true) { animation.setFrames(walkingSprites); animation.setDelay(100); } //You are idle if no other animations are set if(movingL != true && movingR != true && attackAnimation != true && hitStunAnimation != true && deathAnimation != true) { animation.setFrames(idleSprites); animation.setDelay(900); } if(vy < 0) { //if you are going up you are in the jumping animation if(!jump){//inital jump animation animation.setFrames(jumpSprites); animation.setDelay(30); } else{//Already in the air but still going up animation.setFrames(jumpingSprites); animation.setDelay(-1); } } if(vy > 0) {// falling animation.setFrames(fallSprites); animation.setDelay(-1); } if(attackAnimation == true){ animation.setFrames(attackSprites); animation.setDelay(100); } if(bowAnimation == true){ animation.setFrames(bowSprites); animation.setDelay(300); } if(hitStunAnimation == true && deathAnimation != true){ animation.setFrames(stunSprites); animation.setDelay(100); } if(deathAnimation == true){ animation.setFrames(deathSprites); animation.setDelay(100); } } //Keeps track of the timers of different operations public void playerTimer(){ arrowCharge(arrowTime); hitStun(stunTime); deathStun(deathTime); } //creates a hitbox for the character public Rectangle hitBox(){ hitBox = new Rectangle (x,y,WIDTH,LENGTH); return hitBox; } //returns that the player has died public void killed(){ alive = false; } //checks if the characer is touching the ground or in the air public boolean inAir(){ currentTileX = x / 50; currentTileX2 = (x + WIDTH) / 50; currentTileY2 = (y + LENGTH) / 50; //checks if either the bottom right or bottom left is touching a tile //excludes the numbers 8 - 10 so they become background images if (tileMap.getMapVal(currentTileX,currentTileY2) > 0 && tileMap.getMapVal(currentTileX,currentTileY2) < 8 || tileMap.getMapVal(currentTileX,currentTileY2) > 10 || tileMap.getMapVal(currentTileX2,currentTileY2) > 0 && tileMap.getMapVal(currentTileX2,currentTileY2) < 8 || tileMap.getMapVal(currentTileX2,currentTileY2) > 10) { jump = false; return false; } else{ //if the tile isn't touching a tile jump must be true jump = true; return true; } } public int getX(){return x;} public int getY(){return y;} public boolean getAlive() {return alive;} public void setX(int newX){x = newX;} public void setY(int newY){y = newY;} //Moves the player to the right public void moveR(){ direction = RIGHT;//set the direction to RIGHT newX = x + 4;//move the character 4 pixels to the right currentTileX2 = (newX + WIDTH) / 50; currentTileY = (y) / 50; currentTileY2 = (y + LENGTH - 1) / 50; // subtract one so you do not intersect the a tile immediatly above Player //if space is occupied return player back to previous x position //excludes the numbers 8 - 10 so they become background images if (tileMap.getMapVal(currentTileX2,currentTileY) > 0 && tileMap.getMapVal(currentTileX2,currentTileY) < 8 || tileMap.getMapVal(currentTileX2,currentTileY) > 10 || tileMap.getMapVal(currentTileX2,currentTileY2) > 0 && tileMap.getMapVal(currentTileX2,currentTileY2) < 8 || tileMap.getMapVal(currentTileX2,currentTileY2) > 10 ){ x = prevX; } else{//if space is not occupied update the players x position x = newX; prevX = x; } movingR = true; //set the moving animation to the right } //Move the player to the left public void moveL(){ direction = LEFT; newX = x - 4; currentTileX = newX / 50; currentTileY = (y) / 50; currentTileY2 = (y + LENGTH - 1) / 50; //excludes the numbers 8 - 10 so they become background images //if space is occupied return player back to previous x position if (tileMap.getMapVal(currentTileX,currentTileY) > 0 && tileMap.getMapVal(currentTileX,currentTileY) < 8 || tileMap.getMapVal(currentTileX,currentTileY) > 10 || tileMap.getMapVal(currentTileX,currentTileY2) > 0 && tileMap.getMapVal(currentTileX,currentTileY2) < 8 || tileMap.getMapVal(currentTileX,currentTileY2) > 10){ x = prevX; } else{ x = newX; prevX = x; } movingL = true; //set the animation to the left } //Player jump public void jump(){ if (jump == false){ //only jump if you are touching the ground y = y-1;// -1 so you are not touching the ground so inair() will not return true vy = -19;// the speed and distance player will jump } } //Checks if the player hits something above it public void hitWallV(){ currentTileX = x / 50; currentTileX2 = (x + WIDTH) / 50; currentTileY = (y + 1) / 50; //excludes the numbers 8 - 10 so they become background images //checks the top left and right corner if it hits any tiles above it if (tileMap.getMapVal(currentTileX,currentTileY) > 0 && tileMap.getMapVal(currentTileX,currentTileY) < 8 || tileMap.getMapVal(currentTileX,currentTileY) > 10 || tileMap.getMapVal(currentTileX2,currentTileY) > 0 && tileMap.getMapVal(currentTileX2,currentTileY) < 8 || tileMap.getMapVal(currentTileX2,currentTileY) > 10){ y = prevY; vy = 0; } else{ prevY = y; } } public void gravity(){ hitWallV(); if (inAir()){//only apply graivty if you are in the air vy = vy + G; //Effect of gravity if(vy >= T_V){vy = T_V;} //Terminal Velocity y = y + vy; //Update y pos with y vel hitWallV(); } if (!inAir()){ vy = 0; y = (currentTileY * 50) ;//ensures you are perfectly on top of a tile and not in it } } //Checks if you have hit an enemy with a melee attack public boolean attackMelee(Player enemy){ attackAnimation = true; if (direction == RIGHT){ // checks the direction you are facing to make accurate hitbox hitBoxMelee = new Rectangle (x + WIDTH, y + (LENGTH / 2) - 10,35, 25); if (hitBoxMelee.intersects(enemy.hitBox())){ enemy.playerHit(); return true; } } if (direction == LEFT){ hitBoxMelee = new Rectangle (x - 35, y + (LENGTH / 2) - 10,35,25); if (hitBoxMelee.intersects(enemy.hitBox())){ enemy.playerHit(); return true; } } return false; } //creates an arrow to shoot public void attackProj(){ if(shootableArrow == true){ bowAnimation = true; //sets you into bow animation livearrow = true; // make an arrow live shootableArrow = false; // sets the arrow to unshootable arrow = new Projectile(x,y,direction,tileMap); arrowTime = System.nanoTime();//reset reference time } else{} } public boolean livearrow(){ return livearrow; } public Projectile getarrow(){ return arrow; } public void endarrow(){ livearrow = false; } //allows the player to get hit public void playerHit(){ if(!hitStunAnimation){ // checks if the character is in hit stun animation or not before applying damage health -= 25; stunTime = System.nanoTime(); hitStunAnimation = true; } if (health <= 0){ // if you die play death animation deathTime = System.nanoTime(); deathAnimation = true; } if(hitStunAnimation){} } //death pause (for dramatic purposes) public void deathStun(long deathTime){ long elapsed = (System.nanoTime() - deathTime) / 1000000; if(elapsed > 900) { if (health <= 0){ deathAnimation = false; alive = false; } } } //Timer for hitStun public void hitStun(long stunTime){ long elapsed = (System.nanoTime() - stunTime) / 1000000; if(elapsed > 400) { hitStunAnimation = false; } } //Timer for arrow recharge public void arrowCharge(long arrowTime){ long elapsed = (System.nanoTime() - arrowTime) / 1000000; if(elapsed > 1000) { shootableArrow = true; } } public int getHealth(){ return health; } //set the character animation to idle sets all other animtations to false public void setIdle(){ movingR = false; movingL = false; attackAnimation = false; bowAnimation = false; } //update the frames in animation public void animationUpdate(){ animation.update(); } //draw the winner in the winning screen public void drawWinner(Graphics g,JPanel panel){ animation.setFrames(idleSprites); animation.setDelay(700); g.drawImage(animation.getImage(), 625 , 505 ,panel); } //Draw the player public void draw(Graphics g,JPanel panel){ getAnimation(); if(direction == LEFT){ // offset for putting pictures to the left if(attackAnimation == true){ g.drawImage(animation.getImage(), x + 40, y - 6 , -78,63,panel); } else{ g.drawImage(animation.getImage(), x + 25, y , -50,50,panel); } } else{// if direction is right if(attackAnimation == true){ g.drawImage(animation.getImage(), x - 14, y - 6,panel); } else{ g.drawImage(animation.getImage(), x , y ,panel); } } } }
[ "jackyton718@gmail.com" ]
jackyton718@gmail.com
f1b5ea44dd9bcac8e5bbb62251770d11be44dae2
d95ba8662fd33c8b2b9460896aa6af1df63bebe0
/src/main/java/com/hi/project/pmfScrap/PmfScrapDTO.java
0e68ffac28ae2e42792cf6867c410a06a57ee56f
[]
no_license
yoongyeongk/finalProject
539a7b6958ed60da7312b680d43df65484fcd993
7e590cbc788f41c561e42a604ecf75bcdc381c32
refs/heads/master
2021-09-05T16:00:28.048509
2018-01-29T13:54:29
2018-01-29T13:54:29
114,966,774
0
0
null
null
null
null
UTF-8
Java
false
false
797
java
package com.hi.project.pmfScrap; import com.hi.project.pmf.PmfBoardDTO; public class PmfScrapDTO { private int snum; private int num; private String nickname; private PmfBoardDTO pmfBoardDTO; private String fin; public int getSnum() { return snum; } public void setSnum(int snum) { this.snum = snum; } public int getNum() { return num; } public void setNum(int num) { this.num = num; } public String getNickname() { return nickname; } public void setNickname(String nickname) { this.nickname = nickname; } public PmfBoardDTO getPmfBoardDTO() { return pmfBoardDTO; } public void setPmfBoardDTO(PmfBoardDTO pmfBoardDTO) { this.pmfBoardDTO = pmfBoardDTO; } public String getFin() { return fin; } public void setFin(String fin) { this.fin = fin; } }
[ "yoongyeong.e.kim@gmail.com" ]
yoongyeong.e.kim@gmail.com
32e49224f93b5c9eb226ddcc73039745554c265a
b2321744aa1d53cb436484e9d230d9e2e12ac722
/Backend/SpringCore/springcorepractice/src/main/java/com/capgemini/springcore/annotation/beans/ISuzu.java
7202a7b20976e21938924b529408a2d88bc80101
[]
no_license
AishwaryaPatil1997/TY_CG_HTD_PuneMumbai_JFS_AishwaryaPatil
a139e00cfa8e5144eda37b35b30fb0588554168b
87e4f7a14d8b27eb3d0e6282c9235c1ba4a1b827
refs/heads/master
2023-01-08T19:07:36.531793
2019-11-13T05:29:17
2019-11-13T05:29:17
225,846,020
0
0
null
2023-01-07T20:19:10
2019-12-04T11:00:46
Java
UTF-8
Java
false
false
268
java
package com.capgemini.springcore.annotation.beans; import com.capgemini.springcore.interfaces.Engine; public class ISuzu implements Engine { @Override public int getCC() { return 1700; } @Override public String getType() { return "4-Stroke Petrol"; } }
[ "aishpatil10@gmail.com" ]
aishpatil10@gmail.com
9eb7e4a370597492762070715b1252f079acf2f6
eb6ccb49f8d8fba2747bd56bb99ebf745fe4d902
/src/main/java/com/gqlxc/exception/NotFoundException.java
f7036e78fda891c5a8c3b700f93e4615891b0268
[]
no_license
zzkingdee123/blog
5699b853bb870ccc5038e5511a174badc3202923
52cc513e5e4c536458997ef97f2020ea551430cc
refs/heads/master
2023-01-08T19:58:31.892178
2020-11-02T14:39:21
2020-11-02T14:39:21
309,106,037
0
0
null
null
null
null
UTF-8
Java
false
false
456
java
package com.gqlxc.exception; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ResponseStatus; @ResponseStatus(HttpStatus.NOT_FOUND) public class NotFoundException extends RuntimeException{ public NotFoundException() { } public NotFoundException(String message) { super(message); } public NotFoundException(String message, Throwable cause) { super(message, cause); } }
[ "379580893@qq.com" ]
379580893@qq.com