blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 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 684M ⌀ | 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 132
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 28
values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 352 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
43bd9dd0590aa47ae7c49d0ebeef4ceea58e7a45 | bb2262c54fe6db1d46e1de85f086450fab46c596 | /src/test/java/com/genexplain/api/app/GxHttpConnectionStub.java | 7f463b735612f8c734450957a52352d20a37435f | [
"MIT"
] | permissive | genexplain/genexplain-api | 47feff330c07dd61cd4613f29ab98b1cc0edb123 | 8ad4a49ea6471f47831b42d0c90366b9ae2af56e | refs/heads/master | 2022-08-10T09:31:16.524024 | 2022-07-25T11:34:11 | 2022-07-25T11:34:11 | 88,649,097 | 2 | 3 | null | null | null | null | UTF-8 | Java | false | false | 5,543 | java | /**
* Copyright (C) 2017 geneXplain GmbH, Wolfenbuettel, Germany
*
* Author: Philip Stegmaier
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY
* OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
* EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
package com.genexplain.api.app;
import java.util.Map;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.impl.client.CloseableHttpClient;
import com.eclipsesource.json.JsonObject;
import com.genexplain.api.core.GxHttpConnection;
/**
* @author pst
*
*/
public class GxHttpConnectionStub implements GxHttpConnection {
private String server;
private String user;
private String password;
private boolean hasLoggedIn = false;
/* (non-Javadoc)
* @see com.genexplain.api.core.GxHttpConnection#setVerbose(boolean)
*/
@Override
public GxHttpConnection setVerbose(boolean verbose) {
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see com.genexplain.api.core.GxHttpConnection#isVerbose()
*/
@Override
public boolean isVerbose() {
// TODO Auto-generated method stub
return false;
}
/* (non-Javadoc)
* @see com.genexplain.api.core.GxHttpConnection#hasLoggedIn()
*/
@Override
public boolean hasLoggedIn() {
return hasLoggedIn;
}
/* (non-Javadoc)
* @see com.genexplain.api.core.GxHttpConnection#setReconnect(boolean)
*/
@Override
public GxHttpConnection setReconnect(boolean rec) {
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see com.genexplain.api.core.GxHttpConnection#getReconnect()
*/
@Override
public boolean getReconnect() {
// TODO Auto-generated method stub
return false;
}
/* (non-Javadoc)
* @see com.genexplain.api.core.GxHttpConnection#getBasePath()
*/
@Override
public String getBasePath() {
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see com.genexplain.api.core.GxHttpConnection#setBasePath(java.lang.String)
*/
@Override
public GxHttpConnection setBasePath(String basePath) throws Exception {
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see com.genexplain.api.core.GxHttpConnection#getUsername()
*/
@Override
public String getUsername() {
return user;
}
/* (non-Javadoc)
* @see com.genexplain.api.core.GxHttpConnection#setUsername(java.lang.String)
*/
@Override
public GxHttpConnection setUsername(String username) throws Exception {
user = username;
return this;
}
/* (non-Javadoc)
* @see com.genexplain.api.core.GxHttpConnection#getPassword()
*/
@Override
public String getPassword() {
return password;
}
/* (non-Javadoc)
* @see com.genexplain.api.core.GxHttpConnection#setPassword(java.lang.String)
*/
@Override
public GxHttpConnection setPassword(String password) throws Exception {
this.password = password;
return this;
}
/* (non-Javadoc)
* @see com.genexplain.api.core.GxHttpConnection#getServer()
*/
@Override
public String getServer() {
return server;
}
/* (non-Javadoc)
* @see com.genexplain.api.core.GxHttpConnection#setServer(java.lang.String)
*/
@Override
public GxHttpConnection setServer(String server) throws Exception {
this.server = server;
return this;
}
/* (non-Javadoc)
* @see com.genexplain.api.core.GxHttpConnection#queryBioUML(java.lang.String, java.util.Map)
*/
@Override
public CloseableHttpResponse queryBioUML(String path,
Map<String, String> params) throws Exception {
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see com.genexplain.api.core.GxHttpConnection#queryJSON(java.lang.String, java.util.Map)
*/
@Override
public JsonObject queryJSON(String path, Map<String, String> params)
throws Exception {
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see com.genexplain.api.core.GxHttpConnection#getHttpClient()
*/
@Override
public CloseableHttpClient getHttpClient() {
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see com.genexplain.api.core.GxHttpConnection#ping()
*/
@Override
public JsonObject ping() throws Exception {
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see com.genexplain.api.core.GxHttpConnection#login()
*/
@Override
public JsonObject login() throws Exception {
hasLoggedIn = true;
return new JsonObject().add("type", 0);
}
/* (non-Javadoc)
* @see com.genexplain.api.core.GxHttpConnection#logout()
*/
@Override
public CloseableHttpResponse logout() throws Exception {
// TODO Auto-generated method stub
return null;
}
}
| [
"philip.stegmaier@genexplain.com"
] | philip.stegmaier@genexplain.com |
bd9aa6f1bbf35e26507f3c1f87d7413f7efecfaf | a47579b4cb71ed6018496dfb932c9e9f830df62c | /src/main/java/com/pk/server/master/mybaitsLock/util/PluginUtil.java | 4dadbaa9ae47c1f73bbf31a50f3913f1446c92ce | [] | no_license | ChinaGrayMan/PakeServer-master | cb4193d882c05aebda2c29273f6cab070ebc160d | 75dfe3048cd4b3da9fe51cd69f37ad16edf0e42e | refs/heads/master | 2020-04-07T08:06:23.552650 | 2018-11-20T06:59:06 | 2018-11-20T06:59:06 | 154,458,267 | 3 | 2 | null | 2018-10-24T08:42:22 | 2018-10-24T07:33:23 | JavaScript | UTF-8 | Java | false | false | 525 | java | package com.pk.server.master.mybaitsLock.util;
import org.apache.ibatis.reflection.MetaObject;
import org.apache.ibatis.reflection.SystemMetaObject;
import java.lang.reflect.Proxy;
public final class PluginUtil {
private PluginUtil() {
}
public static Object processTarget(Object target) {
if (Proxy.isProxyClass(target.getClass())) {
MetaObject mo = SystemMetaObject.forObject(target);
return processTarget(mo.getValue("h.target"));
}
return target;
}
}
| [
"love_look@icloud.com"
] | love_look@icloud.com |
4b703ca8beeab9396ffc5d284ba46c8483d17cad | b1835791f83cf2173a9c475f70aa1ffe891c10ee | /src/main/java/jlearn/servlet/dto/BookReading.java | f7ff7684addae47fbb9d519fb123603190d17d0c | [] | no_license | fornit1917/jlearn-servlet | 6182efde2d31ba969e85d1845f4ff7d95eea7541 | 36a0ac10840e7d09f0eb79e38125559ca67eac7f | refs/heads/master | 2022-11-28T09:06:21.925794 | 2022-10-28T22:12:22 | 2022-10-28T22:12:22 | 72,682,520 | 0 | 0 | null | 2022-11-23T22:36:05 | 2016-11-02T21:23:12 | Java | UTF-8 | Java | false | false | 1,253 | java | package jlearn.servlet.dto;
public class BookReading
{
private int id;
private int startYear;
private int startMonth;
private int endYear;
private int endMonth;
private boolean isReread;
private BookStatus status;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getStartYear() {
return startYear;
}
public void setStartYear(int startYear) {
this.startYear = startYear;
}
public int getStartMonth() {
return startMonth;
}
public void setStartMonth(int startMonth) {
this.startMonth = startMonth;
}
public int getEndYear() {
return endYear;
}
public void setEndYear(int endYear) {
this.endYear = endYear;
}
public int getEndMonth() {
return endMonth;
}
public void setEndMonth(int endMonth) {
this.endMonth = endMonth;
}
public BookStatus getStatus() {
return status;
}
public void setStatus(BookStatus status) {
this.status = status;
}
public boolean isReread() {
return isReread;
}
public void setReread(boolean reread) {
isReread = reread;
}
}
| [
"fornit1917@gmail.com"
] | fornit1917@gmail.com |
8f20e316c756d749e25881a93599e6f0a04600e4 | 2f4043aef4e367a102034d37b5cc62e4b1c1e2c6 | /WORKSHOP_ONE/viceCitySecondPart/models/neighbourhood/GangNeighbourhood.java | 07b72b3288643cf69fd8702243bbce0a78471b41 | [] | no_license | zulnerub/Java---Java-OOP | e56008c97e1417abf8e6c3f9c6e1a60caaf57f01 | 526ff2ea05549f6b32445f69abc51bef9736d89e | refs/heads/master | 2020-12-09T19:16:13.096221 | 2020-01-12T14:42:00 | 2020-01-12T14:42:00 | 233,395,322 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,541 | java | package WORKSHOP_ONE.viceCitySecondPart.models.neighbourhood;
import WORKSHOP_ONE.viceCitySecondPart.models.guns.Gun;
import WORKSHOP_ONE.viceCitySecondPart.models.players.Player;
import java.util.ArrayDeque;
import java.util.Collection;
public class GangNeighbourhood implements Neighbourhood {
@Override
public void action(Player mainPlayer, Collection<Player> civilPlayers) {
this.mainPlayerAttacksNPCs(mainPlayer, civilPlayers);
this.NPCsAttackMainPlayer(mainPlayer, civilPlayers);
}
private void mainPlayerAttacksNPCs(Player mainPlayer, Collection<Player> civilPlayers){
for (Player civilPlayer: civilPlayers){
this.shootEnemy(mainPlayer, civilPlayer);
}
}
private void NPCsAttackMainPlayer(Player mainPlayer, Collection<Player> civilPlayers){
for (Player civilPlayer: civilPlayers){
if (!mainPlayer.isAlive()){
break;
}
if (civilPlayer.isAlive()){
this.shootEnemy(civilPlayer, mainPlayer);
}
}
}
private void shootEnemy(Player attacker, Player victim){
ArrayDeque<Gun> guns = new ArrayDeque<>();
attacker.getGunRepository().getModels().forEach(guns::offer);
while (!guns.isEmpty() && victim.isAlive()){
Gun currentGun = guns.poll();
while (currentGun.canFire() && victim.isAlive()){
int dmg = currentGun.fire();
victim.takeLifePoints(dmg);
}
}
}
}
| [
"drsimeon_87@abv.bg"
] | drsimeon_87@abv.bg |
56a76185ebee28695d740bf0715b45ba596ffecb | ab208a51f13f4f3ad7c2751f9983483589511005 | /openrouteservice/src/test/java/heigit/ors/routing/graphhopper/extensions/reader/osmfeatureprocessors/WheelchairSeparateWayTest.java | 48dd6e48773eacda2db61fb70d51facf96b937a7 | [
"LGPL-2.1-only",
"EPL-1.0",
"Apache-2.0",
"LGPL-2.0-only",
"BSD-2-Clause",
"MIT",
"LGPL-3.0-only"
] | permissive | Devmaticz/routeservice | f3aa82b7ab2eb8dad4df4eddcb19e116d87bc418 | efba0ed850bd0042902584498adbfef04282e737 | refs/heads/master | 2022-12-10T22:44:11.824864 | 2020-02-16T13:35:08 | 2020-02-16T13:35:08 | 161,804,873 | 0 | 0 | MIT | 2022-09-22T18:36:11 | 2018-12-14T15:36:16 | Java | UTF-8 | Java | false | false | 841 | java | package heigit.ors.routing.graphhopper.extensions.reader.osmfeatureprocessors;
import com.graphhopper.reader.ReaderWay;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
public class WheelchairSeparateWayTest {
WheelchairSeparateWay way;
@Before
public void reset() {
ReaderWay readerWay = new ReaderWay(1);
way = new WheelchairSeparateWay(readerWay);
}
@Test
public void TestShowAsPedestrian() {
assertTrue(way.isPedestrianised());
}
@Test
public void TestInitiallyNotProcessed() {
assertFalse(way.hasWayBeenFullyProcessed());
}
@Test
public void TestMarkedAsProcessedOncePrepared() {
way.prepare();
assertTrue(way.hasWayBeenFullyProcessed());
}
}
| [
"dev@augmentedtelematics.com"
] | dev@augmentedtelematics.com |
b05367732b208721c8472169b07af3c737a58578 | 0de4ef31a8739bdcd29d36e36bed9e2ffc55d7cf | /app/src/main/java/cookbook/testjni/MainActivity.java | 35b140b566c1a8e9fadf65af368677f0c5c5572e | [] | no_license | criswonder/test-jni | 9014b77bf092d8d6a397c1407414424e2ff214d1 | 98d2455ea77df3edbaa7642fd3b9393583e6ff5f | refs/heads/master | 2022-06-17T21:54:11.089055 | 2020-05-15T11:52:56 | 2020-05-15T11:52:56 | 264,181,247 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,761 | java | package cookbook.testjni;
import android.opengl.EGL14;
import android.opengl.EGLContext;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.TextView;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
public class MainActivity extends AppCompatActivity {
private String TAG = "MainActivity";
private boolean VERBOSE = true;
// Used to load the 'native-lib' library on application startup.
static {
System.loadLibrary("native-lib");
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// Example of a call to a native method
TextView tv = (TextView) findViewById(R.id.sample_text);
// tv.setText(stringFromJNI());
// setFloatArray();
findViewById(R.id.button).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// float[] floats = new float[]{
// 12f, 23f, 31f, 14f, 5f
// };
// float[] outFloats = setFloatArray(floats);
// for (int i = 0; i < outFloats.length; i++) {
// Log.d("andymao", "" + outFloats[i]);
// }
// int[] intArray = new int[12];
// try {
// getIntArray(intArray);
// } catch (Throwable e) {
// e.printStackTrace();
// }
//
// for (int i = 0; i < intArray.length; i++) {
// Log.d("andymao", intArray[i] + "");
// }
// EGLContext eglContext = testCPPCreateOpenGLContext(0);
// if(VERBOSE) Log.e(TAG,"onClick eglContext="+eglContext.getNativeHandle());
// EGLContext eglContext2 = testCPPCreateOpenGLContext(eglContext.getNativeHandle());
// if(VERBOSE) Log.e(TAG,"onClick eglContext="+eglContext2.getNativeHandle());
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
if (VERBOSE) Log.d(TAG, "run: start");
for (int i = 0; i < 100000; i++) {
testLocalJNIRefs();
}
if (VERBOSE) Log.d(TAG, "run: finish");
}
});
thread.start();
}
});
}
private EGLContext testCPPCreateOpenGLContext(final long eglContext) {
final CountDownLatch countDownLatch = new CountDownLatch(1);
final EGLContext[] result = new EGLContext[1];
Thread workThread = new Thread(new Runnable() {
@Override
public void run() {
setNativeOpenglHandle(eglContext);
result[0] = EGL14.eglGetCurrentContext();
countDownLatch.countDown();
}
});
workThread.start();
try {
countDownLatch.await(2000, TimeUnit.MILLISECONDS);
} catch (InterruptedException e) {
e.printStackTrace();
}
return result[0];
}
/**
* A native method that is implemented by the 'native-lib' native library,
* which is packaged with this application.
*/
// public native String stringFromJNI();
public native float[] setFloatArray(float[] arrInput);
public native void getIntArray(int[] intArrays);
public native void setNativeOpenglHandle(long eglContext);
public native void testLocalJNIRefs();
}
| [
"hongyun.mhy@alibaba-inc.com"
] | hongyun.mhy@alibaba-inc.com |
d7facc6ecd562a12892c1427d176b4124b23b88b | 244cf57619df5385da6754826635279844870c89 | /JavaRushTasks/4.JavaCollections/src/com/javarush/task/task34/task3411/Solution.java | 180624f6052a3ac6b85df9851933fc4586020364 | [] | no_license | demonmr/JavaRush | 22f974b2cb8452a13b2a37adf185dd5330703173 | bed4e27b896db70c01402b6e658a8ae90f39b7ba | refs/heads/master | 2022-12-30T20:31:52.159119 | 2020-10-22T20:52:11 | 2020-10-22T20:52:11 | 288,364,364 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 619 | java | package com.javarush.task.task34.task3411;
/*
Ханойские башни
*/
public class Solution {
public static void main(String[] args) {
int numRings = 3;
moveRing('A', 'B', 'C', numRings);
}
public static void moveRing(char a, char b, char c, int numRings) {
if (numRings==1)
{
System.out.print("from "+a+" to "+ b);
}
else
{
moveRing(a,c,b,numRings-1);
System.out.println("\nfrom "+a+" to "+ c);
moveRing(c,b,a,numRings-1);
}
//напишите тут ваш код
}
} | [
"myroshnychenko.d.r@gmail.com"
] | myroshnychenko.d.r@gmail.com |
6387cdf490b118378f0cc84e401e149120697da9 | e77a765637d5f83f4f4ec9ede3dd856b555930d1 | /app/src/main/java/com/example/mess/Messages.java | b309a35491ff22dc103e7a7719bced98e0e7ba88 | [] | no_license | Shebovich/Messenger | 1502a95a2307f9b21e3be81d677702c66250a632 | 5089665f7f24ed2a90b73b5ac720ba85f984afeb | refs/heads/master | 2020-12-23T22:15:56.013337 | 2020-05-15T09:12:41 | 2020-05-15T09:12:41 | 237,292,970 | 0 | 0 | null | 2020-05-15T09:12:43 | 2020-01-30T19:51:16 | Java | UTF-8 | Java | false | false | 1,597 | java | package com.example.mess;
public class Messages
{
private String from, message, type, to, messageID, time, date, name;
public Messages()
{
}
public Messages(String from, String message, String type, String to, String messageID, String time, String date, String name) {
this.from = from;
this.message = message;
this.type = type;
this.to = to;
this.messageID = messageID;
this.time = time;
this.date = date;
this.name = name;
}
public String getFrom() {
return from;
}
public void setFrom(String from) {
this.from = from;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getTo() {
return to;
}
public void setTo(String to) {
this.to = to;
}
public String getMessageID() {
return messageID;
}
public void setMessageID(String messageID) {
this.messageID = messageID;
}
public String getTime() {
return time;
}
public void setTime(String time) {
this.time = time;
}
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
| [
"pavelurb99@mail.ru"
] | pavelurb99@mail.ru |
1564dc8205120d521684d93358059af00ffd1c8f | 3c1f2f15aef624726bbc12f18303f19945018122 | /HomeTasks/lebed-raque-schooqua-GUI/src/sample/controllers/SettingsController.java | 3e76f68b66759fe73a8c63e97c2eade674911e7d | [] | no_license | diedino/Java | fdbdf2dcaf8231b5b8e22eec2d1299d34d0008b1 | 2206c329342755207a3a204b79c75d1c84b402f7 | refs/heads/master | 2020-04-22T07:26:50.039722 | 2019-12-03T07:58:20 | 2019-12-03T07:58:20 | 170,216,888 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,925 | java | package sample.controllers;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.fxml.FXML;
import javafx.scene.control.Alert;
import javafx.scene.control.Button;
import javafx.scene.control.TextField;
import javax.sound.midi.SysexMessage;
public class SettingsController {
@FXML
private ResourceBundle resources;
@FXML
private URL location;
@FXML
private TextField sleepField;
@FXML
private Button acceptbtn;
@FXML
private TextField coefField;
@FXML
private TextField angleField;
@FXML
void initialize() {
acceptbtn.setOnAction(actionEvent -> {
if (!tryParseInt(angleField.getText())) {
parseAttentionBox("angle");
return;
} else {
if (Integer.parseInt(angleField.getText()) < 0 || Integer.parseInt(angleField.getText()) > 360) {
Alert alert = new Alert(Alert.AlertType.INFORMATION);
alert.setTitle("angle");
alert.setHeaderText("Angle can't be more 360 or less 0");
alert.show();
return;
}
}
if (!tryParseInt(coefField.getText())) {
parseAttentionBox("coefficient");
return;
}
if (!tryParseInt(sleepField.getText())) {
parseAttentionBox("sleep");
return;
}
});
}
boolean tryParseInt(String value) {
try {
Integer.parseInt(value);
return true;
} catch (NumberFormatException e) {
return false;
}
}
public void parseAttentionBox(String str) {
Alert alert = new Alert(Alert.AlertType.INFORMATION);
alert.setTitle(str);
alert.setHeaderText("Can't parse" + " " + str + " " + "field");
alert.show();
}
}
| [
"you@example.com"
] | you@example.com |
0e34c1ea50c02bd13eb96c0bac7c6bc980601743 | 450763c19a06194355a69f2d84d7d048f4849d61 | /WorkFrame/work-frame-library/src/main/java/com/guoxd/work_frame_library/views/paint/PaletteView.java | 226b8c34e85aa8b58a824bede4ae9b169773108b | [] | no_license | summerhotready/WorkFrame | 744ad1e5c22a8b0d232d853dbc02c50cda7698f1 | 334ecb5147f4ef5fed617411131f03cd71ea29ff | refs/heads/master | 2022-10-27T05:45:17.021981 | 2022-10-13T03:46:13 | 2022-10-13T03:46:13 | 132,222,002 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,349 | java | package com.guoxd.work_frame_library.views.paint;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.Xfermode;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import java.util.ArrayList;
import java.util.List;
/**
* Created by wensefu on 17-3-21. update by emma on 2021-2-22
* 这是一个画板,具有橡皮擦功能
* 本质上是使用mDrawingList 缓存了一系列Paint对象,缺点是随着图形复杂度高创建的Paint变多
*/
public class PaletteView extends View {
private Paint mPaint;
private Path mPath;
private float mLastX;
private float mLastY;
private Bitmap mBufferBitmap;
private Canvas mBufferCanvas;
// 绘制和回退记录的步数
private static final int MAX_CACHE_STEP = 20;
private int cacheStep = MAX_CACHE_STEP;
public int getCacheStep() {
return cacheStep;
}
public void setCacheStep(int cacheStep) {
this.cacheStep = cacheStep;
}
private List<DrawingInfo> mDrawingList;//绘画列表,每一笔画都成为一个独立path,方便回退
private List<DrawingInfo> mRemovedList;//撤销列表
private Xfermode mClearMode;
private float mDrawSize;
private float mEraserSize;
private boolean mCanEraser;
private Callback mCallback;
public enum Mode {
DRAW,
ERASER
}
private Mode mMode = Mode.DRAW;
public PaletteView(Context context) {
this(context,null);
}
public PaletteView(Context context, AttributeSet attrs) {
super(context, attrs);
setDrawingCacheEnabled(true);
init();
}
public interface Callback {
void onUndoRedoStatusChanged();
}
public void setCallback(Callback callback){
mCallback = callback;
}
private void init() {
mPaint = new Paint(Paint.ANTI_ALIAS_FLAG | Paint.DITHER_FLAG);
mPaint.setStyle(Paint.Style.STROKE);
mPaint.setFilterBitmap(true);
mPaint.setStrokeJoin(Paint.Join.ROUND);
mPaint.setStrokeCap(Paint.Cap.ROUND);
mDrawSize = 20;
mEraserSize = 40;
mPaint.setStrokeWidth(mDrawSize);
mPaint.setColor(0XFF000000);
mClearMode = new PorterDuffXfermode(PorterDuff.Mode.CLEAR);
}
private void initBuffer(){
mBufferBitmap = Bitmap.createBitmap(getWidth(), getHeight(), Bitmap.Config.ARGB_8888);
mBufferCanvas = new Canvas(mBufferBitmap);
}
private abstract static class DrawingInfo {
Paint paint;
abstract void draw(Canvas canvas);
}
private static class PathDrawingInfo extends DrawingInfo{
Path path;
@Override
void draw(Canvas canvas) {
canvas.drawPath(path, paint);
}
}
public Mode getMode() {
return mMode;
}
public void setMode(Mode mode) {//设置模式
if (mode != mMode) {
mMode = mode;
if (mMode == Mode.DRAW) {//绘画
mPaint.setXfermode(null);
mPaint.setStrokeWidth(mDrawSize);
} else {//清除
mPaint.setXfermode(mClearMode);
mPaint.setStrokeWidth(mEraserSize);
}
}
}
public void setEraserSize(float size) {
mEraserSize = size;
}
public void setPenRawSize(float size) {
mDrawSize = size;
}
public void setPenColor(int color) {
mPaint.setColor(color);
}
public void setPenAlpha(int alpha) {
mPaint.setAlpha(alpha);
}
private void reDraw(){
if (mDrawingList != null) {
mBufferBitmap.eraseColor(Color.TRANSPARENT);
for (DrawingInfo drawingInfo : mDrawingList) {
drawingInfo.draw(mBufferCanvas);
}
invalidate();
}
}
public boolean canRedo() {
return mRemovedList != null && mRemovedList.size() > 0;
}
public boolean canUndo(){
return mDrawingList != null && mDrawingList.size() > 0;
}
public void redo() {//重做
int size = mRemovedList == null ? 0 : mRemovedList.size();
if (size > 0) {
DrawingInfo info = mRemovedList.remove(size - 1);
mDrawingList.add(info);
mCanEraser = true;
reDraw();
if (mCallback != null) {
mCallback.onUndoRedoStatusChanged();
}
}
}
public void undo() {//撤销
int size = mDrawingList == null ? 0 : mDrawingList.size();
if (size > 0) {
DrawingInfo info = mDrawingList.remove(size - 1);
if (mRemovedList == null) {
mRemovedList = new ArrayList<>(getCacheStep());
}
if (size == 1) {
mCanEraser = false;
}
mRemovedList.add(info);
reDraw();
if (mCallback != null) {
mCallback.onUndoRedoStatusChanged();
}
}
}
public void clear() {//清空
if (mBufferBitmap != null) {
if (mDrawingList != null) {
mDrawingList.clear();
}
if (mRemovedList != null) {
mRemovedList.clear();
}
mCanEraser = false;
mBufferBitmap.eraseColor(Color.TRANSPARENT);
invalidate();
if (mCallback != null) {
mCallback.onUndoRedoStatusChanged();
}
}else{
Log.i("","bitmap is null");
}
}
public Bitmap buildBitmap() {
Bitmap bm = getDrawingCache();
Bitmap result = Bitmap.createBitmap(bm);
destroyDrawingCache();//释放
return result;
}
/**
* 绘制path结束,将缓存存入sheng'shu
*/
private void saveDrawingPath(){//将当前缓存的mPath存入PathDrawingInfo,将这一条路经加入mDrawingList
if (mDrawingList == null) {
mDrawingList = new ArrayList<>(getCacheStep());
} else if (mDrawingList.size() == getCacheStep()) {
mDrawingList.remove(0);
}
Path cachePath = new Path(mPath);
Paint cachePaint = new Paint(mPaint);
PathDrawingInfo info = new PathDrawingInfo();
info.path = cachePath;
info.paint = cachePaint;
mDrawingList.add(info);
mCanEraser = true;
if (mCallback != null) {
mCallback.onUndoRedoStatusChanged();
}
}
@Override
protected void onDraw(Canvas canvas) {
if (mBufferBitmap != null) {
canvas.drawBitmap(mBufferBitmap, 0, 0, null);
}
}
@Override
public boolean onTouchEvent(MotionEvent event) {
final int action = event.getAction() & MotionEvent.ACTION_MASK;
final float x = event.getX();
final float y = event.getY();
switch (action) {
case MotionEvent.ACTION_DOWN:
mLastX = x;
mLastY = y;
if (mPath == null) {
mPath = new Path();
}
mPath.moveTo(x,y);
break;
case MotionEvent.ACTION_MOVE:
//这里终点设为两点的中心点的目的在于使绘制的曲线更平滑,如果终点直接设置为x,y,效果和lineto是一样的,实际是折线效果
mPath.quadTo(mLastX, mLastY, (x + mLastX) / 2, (y + mLastY) / 2);
if (mBufferBitmap == null) {
initBuffer();
}
if (mMode == Mode.ERASER && !mCanEraser) {
break;
}
mBufferCanvas.drawPath(mPath,mPaint);
invalidate();
mLastX = x;
mLastY = y;
break;
case MotionEvent.ACTION_UP:
if (mMode == Mode.DRAW || mCanEraser) {
saveDrawingPath();
}
mPath.reset();
break;
}
return true;
}
}
| [
"emma_guoxd@outlook.com"
] | emma_guoxd@outlook.com |
7eacfe943410f751a0cbac6d9ed54e7b3d9a1104 | 89f5a39b1ee3086295276b26b5973e3315a0d8ee | /guice/com/safziy/guice/module/MyObjectContainer.java | 694270957a4406280f8e20917d759fcefa2f2972 | [] | no_license | safziy/Framework | c25fe3ae9d2a8f89c9e16a9cc32caf77b7d74d7f | 676eab95bb340fadeaf67b74a9fb14b3883c84ca | refs/heads/master | 2016-08-09T09:33:06.398818 | 2016-03-31T07:33:40 | 2016-03-31T07:33:40 | 54,103,428 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 419 | java | package com.safziy.guice.module;
import com.google.inject.Inject;
public class MyObjectContainer {
private MyObject myObject;
@Inject
public MyObjectContainer(MyObject myObject) {
this.myObject = myObject;
System.out.println("MyObjectContainer constructor myObject" + myObject);
}
@Override
public String toString() {
return super.toString() + " [myObject=" + myObject + "]";
}
}
| [
"safziy@foxmail.com"
] | safziy@foxmail.com |
d9e9fc45fd727cfac60a4821984efb933c92d7ff | d62c759ebcb73121f42a221776d436e9368fdaa8 | /providers/cloudservers-uk/src/main/java/org/jclouds/rackspace/cloudservers/CloudServersUKPropertiesBuilder.java | c21540ad6b35c4060c36479405046ef1ed6eef0f | [
"Apache-2.0",
"LicenseRef-scancode-generic-cla",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | gnodet/jclouds | 0152a4e7d6d96ac4ec9fa9746729e3555626ecfe | 87dd23551c4d9b727540d9bd333ffd9a1136e58a | refs/heads/master | 2020-12-24T23:19:24.785844 | 2011-09-16T15:52:12 | 2011-09-16T15:52:12 | 2,399,075 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,737 | java | /**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.rackspace.cloudservers;
import static org.jclouds.Constants.PROPERTY_API_VERSION;
import static org.jclouds.Constants.PROPERTY_ENDPOINT;
import static org.jclouds.Constants.PROPERTY_ISO3166_CODES;
import java.util.Properties;
import org.jclouds.PropertiesBuilder;
import org.jclouds.openstack.OpenStackAuthAsyncClient;
/**
*
* @author Adrian Cole
*/
public class CloudServersUKPropertiesBuilder extends PropertiesBuilder {
@Override
protected Properties defaultProperties() {
Properties properties = super.defaultProperties();
properties.setProperty(PROPERTY_ISO3166_CODES, "GB-SLG");
properties.setProperty(PROPERTY_ENDPOINT, "https://lon.auth.api.rackspacecloud.com");
properties.setProperty(PROPERTY_API_VERSION, OpenStackAuthAsyncClient.VERSION);
return properties;
}
public CloudServersUKPropertiesBuilder(Properties properties) {
super(properties);
}
}
| [
"adrian@jclouds.org"
] | adrian@jclouds.org |
804d867f27275be9e83b73aa8be256f89cc640ba | 3aa3f69da8ba870238437693f243373a9504d25a | /EIDAS-SAMLEngine/src/test/java/eu/eidas/engine/test/simple/package-info.java | 6dbc5c2a0334f4dae930440078662d05fc55174e | [] | no_license | governmentbg/eIDAS-node | 44965a78d2728a6da916c4fe41b4f0fe47f3cdee | 8e9ff90928cc9334bc3f4b7a65a53c70fc1d56d0 | refs/heads/master | 2020-03-29T08:51:03.149484 | 2018-10-17T13:11:03 | 2018-10-17T13:11:03 | 149,729,432 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,522 | java | /*
# Copyright (c) 2017 European Commission
# Licensed under the EUPL, Version 1.2 or – as soon they will be
# approved by the European Commission - subsequent versions of the
# EUPL (the "Licence");
# You may not use this work except in compliance with the Licence.
# You may obtain a copy of the Licence at:
# * https://joinup.ec.europa.eu/page/eupl-text-11-12
# *
# Unless required by applicable law or agreed to in writing, software
# distributed under the Licence is distributed on an "AS IS" basis,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the Licence for the specific language governing permissions and limitations under the Licence.
*/
/*
* Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
* the European Commission - subsequent versions of the EUPL (the "Licence");
* You may not use this work except in compliance with the Licence. You may
* obtain a copy of the Licence at:
*
* http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the Licence is distributed on an "AS IS" basis, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* Licence for the specific language governing permissions and limitations under
* the Licence.
*/
/**
* Provides the classes necessary to create a SAML message.
* @since 1.0
*/
package eu.eidas.engine.test.simple; | [
"strahil.vitkov@bul-si.bg"
] | strahil.vitkov@bul-si.bg |
f98d3b35611e3d22397fc009d655f044994f7fc4 | 6a09d516464376cd85614f3b66c7c3a4bf2ca2e8 | /Semi/src/dto/board/QnaFile.java | 3b48b6f9b2737beed92611374a4d1c42ed508fde | [] | no_license | lacuna25/SemiProject | a0c5cad27c34eb047a3f32c7bfd1742c7283e5f3 | 05dd4fcd72d17cb41d561605354dd3859fcbecc0 | refs/heads/master | 2020-04-01T16:42:50.244133 | 2018-10-16T07:25:25 | 2018-10-16T07:25:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,100 | java | package dto.board;
import java.util.Date;
public class QnaFile {
private int qFile_idx;
private String stored_name;
private String origin_name;
private int qna_idx;
private Date create_date;
public int getqFile_idx() {
return qFile_idx;
}
public void setqFile_idx(int qFile_idx) {
this.qFile_idx = qFile_idx;
}
public String getStored_name() {
return stored_name;
}
public void setStored_name(String stored_name) {
this.stored_name = stored_name;
}
public String getOrigin_name() {
return origin_name;
}
public void setOrigin_name(String origin_name) {
this.origin_name = origin_name;
}
public int getQna_idx() {
return qna_idx;
}
public void setQna_idx(int qna_idx) {
this.qna_idx = qna_idx;
}
public Date getCreate_date() {
return create_date;
}
public void setCreate_date(Date create_date) {
this.create_date = create_date;
}
@Override
public String toString() {
return "QnaFile [qFile_idx=" + qFile_idx + ", stored_name=" + stored_name + ", origin_name=" + origin_name
+ ", qna_idx=" + qna_idx + ", create_date=" + create_date + "]";
}
}
| [
"haejin940@gmail.com"
] | haejin940@gmail.com |
191f7e1cc976807f1af964d58da5108bfa5936a8 | 5be6e6465170e0b74e07479570fb346bc7715c0e | /cobar-server/src/main/java/com/alibaba/cobar/server/response/CharacterSet.java | 2120e8a15d0c897cbb0b6708572f24341a6702f4 | [
"Apache-2.0"
] | permissive | lostdragon/cobar | cefa395434ec90e756a5c94f4cb7faad09f7e62a | f1c7b3aefff4aaf416473930a739bb5cb5e29602 | refs/heads/master | 2016-08-03T17:32:27.386023 | 2012-10-29T07:44:24 | 2012-10-29T07:44:24 | 6,434,628 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,047 | java | /*
* Copyright 1999-2012 Alibaba Group.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.alibaba.cobar.server.response;
import static com.alibaba.cobar.server.parser.ServerParseSet.CHARACTER_SET_CLIENT;
import static com.alibaba.cobar.server.parser.ServerParseSet.CHARACTER_SET_CONNECTION;
import static com.alibaba.cobar.server.parser.ServerParseSet.CHARACTER_SET_RESULTS;
import org.apache.log4j.Logger;
import com.alibaba.cobar.ErrorCode;
import com.alibaba.cobar.net.packet.OkPacket;
import com.alibaba.cobar.server.ServerConnection;
import com.alibaba.cobar.server.parser.ServerParseSet;
import com.alibaba.cobar.util.SplitUtil;
/**
* 字符集属性设置
*/
public class CharacterSet {
private static final Logger logger = Logger.getLogger(CharacterSet.class);
public static void response(String stmt, ServerConnection c, int rs) {
if (-1 == stmt.indexOf(',')) {
/* 单个属性 */
oneSetResponse(stmt, c, rs);
} else {
/* 多个属性 ,但是只关注CHARACTER_SET_RESULTS,CHARACTER_SET_CONNECTION */
multiSetResponse(stmt, c, rs);
}
}
private static void oneSetResponse(String stmt, ServerConnection c, int rs) {
if ((rs & 0xff) == CHARACTER_SET_CLIENT) {
/* 忽略client属性设置 */
c.write(c.writeToBuffer(OkPacket.OK, c.allocate()));
} else {
String charset = stmt.substring(rs >>> 8).trim();
if (charset.endsWith(";")) {
/* 结尾为 ; 标识符 */
charset = charset.substring(0, charset.length() - 1);
}
if (charset.startsWith("'") || charset.startsWith("`")) {
/* 与mysql保持一致,引号里的字符集不做trim操作 */
charset = charset.substring(1, charset.length() - 1);
}
// 设置字符集
setCharset(charset, c);
}
}
private static void multiSetResponse(String stmt, ServerConnection c, int rs) {
String charResult = "null";
String charConnection = "null";
String[] sqlList = SplitUtil.split(stmt, ',', false);
// check first
switch (rs & 0xff) {
case CHARACTER_SET_RESULTS:
charResult = sqlList[0].substring(rs >>> 8).trim();
break;
case CHARACTER_SET_CONNECTION:
charConnection = sqlList[0].substring(rs >>> 8).trim();
break;
}
// check remaining
for (int i = 1; i < sqlList.length; i++) {
String sql = new StringBuilder("set ").append(sqlList[i]).toString();
if ((i + 1 == sqlList.length) && sql.endsWith(";")) {
/* 去掉末尾的 ‘;’ */
sql = sql.substring(0, sql.length() - 1);
}
int rs2 = ServerParseSet.parse(sql, "set".length());
switch (rs2 & 0xff) {
case CHARACTER_SET_RESULTS:
charResult = sql.substring(rs2 >>> 8).trim();
break;
case CHARACTER_SET_CONNECTION:
charConnection = sql.substring(rs2 >>> 8).trim();
break;
case CHARACTER_SET_CLIENT:
break;
default:
StringBuilder s = new StringBuilder();
logger.warn(s.append(c).append(sql).append(" is not executed").toString());
}
}
if (charResult.startsWith("'") || charResult.startsWith("`")) {
charResult = charResult.substring(1, charResult.length() - 1);
}
if (charConnection.startsWith("'") || charConnection.startsWith("`")) {
charConnection = charConnection.substring(1, charConnection.length() - 1);
}
// 如果其中一个为null,则以另一个为准。
if ("null".equalsIgnoreCase(charResult)) {
setCharset(charConnection, c);
return;
}
if ("null".equalsIgnoreCase(charConnection)) {
setCharset(charResult, c);
return;
}
if (charConnection.equalsIgnoreCase(charResult)) {
setCharset(charConnection, c);
} else {
StringBuilder sb = new StringBuilder();
sb.append("charset is not consistent:[connection=").append(charConnection);
sb.append(",results=").append(charResult).append(']');
c.writeErrMessage(ErrorCode.ER_UNKNOWN_CHARACTER_SET, sb.toString());
}
}
private static void setCharset(String charset, ServerConnection c) {
if ("null".equalsIgnoreCase(charset)) {
/* 忽略字符集为null的属性设置 */
c.write(c.writeToBuffer(OkPacket.OK, c.allocate()));
} else if (c.setCharset(charset)) {
c.write(c.writeToBuffer(OkPacket.OK, c.allocate()));
} else {
try {
if (c.setCharsetIndex(Integer.parseInt(charset))) {
c.write(c.writeToBuffer(OkPacket.OK, c.allocate()));
} else {
c.writeErrMessage(ErrorCode.ER_UNKNOWN_CHARACTER_SET, "Unknown charset :" + charset);
}
} catch (RuntimeException e) {
c.writeErrMessage(ErrorCode.ER_UNKNOWN_CHARACTER_SET, "Unknown charset :" + charset);
}
}
}
}
| [
"dragon829@gmail.com"
] | dragon829@gmail.com |
4e048db7c55dc56571a8928c132f8865033ab63f | 21979737464709fd627dbf7d2105c9d9bfc433fd | /src/main/java/com/hpe/observability/config/LocaleConfiguration.java | a30d5115736fd6276ad5f59b081b2626cb778876 | [] | no_license | nuicom/jhipster-fluentb-fluentd-es-kibana | ad2b6fbf263713c7710e064f96bbac19dce91081 | 80595991cfe69002f5f5d373bc14c1bb424cbd8d | refs/heads/master | 2022-03-08T21:01:21.153386 | 2019-07-25T10:50:46 | 2019-07-25T10:50:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,064 | java | package com.hpe.observability.config;
import io.github.jhipster.config.locale.AngularCookieLocaleResolver;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.LocaleResolver;
import org.springframework.web.servlet.config.annotation.*;
import org.springframework.web.servlet.i18n.LocaleChangeInterceptor;
@Configuration
public class LocaleConfiguration implements WebMvcConfigurer {
@Bean(name = "localeResolver")
public LocaleResolver localeResolver() {
AngularCookieLocaleResolver cookieLocaleResolver = new AngularCookieLocaleResolver();
cookieLocaleResolver.setCookieName("NG_TRANSLATE_LANG_KEY");
return cookieLocaleResolver;
}
@Override
public void addInterceptors(InterceptorRegistry registry) {
LocaleChangeInterceptor localeChangeInterceptor = new LocaleChangeInterceptor();
localeChangeInterceptor.setParamName("language");
registry.addInterceptor(localeChangeInterceptor);
}
}
| [
"rahuls@hpe.com"
] | rahuls@hpe.com |
aa5b1c09537fd84b9330c8fad657439ef1d157d0 | 907fc2d0acb142158daed9edd13fe394618a0fc8 | /annotation-test/src/main/java/com/dennisjonsson/visualization/test/app/BFSMain.java | 850c561f3a9fdf6cb8d7bc591c6068bbbd579407 | [] | no_license | denjons/ds-visualizer | e18245f50111592450ed3c56f0e34ff5b6a9d083 | 970b59df4dae941867c8c53c3bb0b0b87eb14974 | refs/heads/master | 2021-01-21T04:19:13.231677 | 2016-06-19T14:13:25 | 2016-06-19T14:13:25 | 54,071,046 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 833 | 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.dennisjonsson.visualization.test.app;
import com.dennisjonsson.annotation.VisualClass;
import com.dennisjonsson.visualization.test.BFS;
/**
*
* @author dennis
*/
@VisualClass
public class BFSMain {
/**
* @param args the command line arguments
*/
static final int size = 10;
public static int[][] ls = new int[size][size];
public static void main(String[] args) {
for(int i = 0; i < size; i ++){
for(int j = 0; j < size/2; j++){
ls[i][(int)Math.random()*size] = 1;
}
}
BFS bfs = new BFS();
bfs.bfs(ls, 0);
}
}
| [
"dennis.j@live.se"
] | dennis.j@live.se |
d3349cdb42403ca8ca547ca9e558c4d7d8f6e59e | 6245cbba321d3f4d8a2edd61841c22968bf7e37e | /ShengNews/app/src/main/java/a/a/sheng/shengnews/di/module/MainActivityModule.java | 416346f3d7a58470da5bb246929d1123d11c5142 | [] | no_license | aasheng24/AndroidNews | e5d1d4a96b0cadfb4aac4001dcb2424ea1b1598e | 4d6a608b0cf5ab15c8d553e9654d704ed1fd131b | refs/heads/master | 2020-06-19T23:35:05.582387 | 2019-07-15T03:05:48 | 2019-07-15T03:05:48 | 196,914,005 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 100 | java | package a.a.sheng.shengnews.di.module;
import dagger.Module;
@Module
class MainActivityModule {
}
| [
"aasheng24@gmail.com"
] | aasheng24@gmail.com |
fa320c1b108e232d21565138ffa87b533d39b09e | ed3cb95dcc590e98d09117ea0b4768df18e8f99e | /project_1_1/src/f/d/g/Calc_1_1_5361.java | 1d4e5ccfe7bcc90fa7dbfbd1b043c506cff62c1a | [] | no_license | chalstrick/bigRepo1 | ac7fd5785d475b3c38f1328e370ba9a85a751cff | dad1852eef66fcec200df10083959c674fdcc55d | refs/heads/master | 2016-08-11T17:59:16.079541 | 2015-12-18T14:26:49 | 2015-12-18T14:26:49 | 48,244,030 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 131 | java | package f.d.g;
public class Calc_1_1_5361 {
/** @return the sum of a and b */
public int add(int a, int b) {
return a+b;
}
}
| [
"christian.halstrick@sap.com"
] | christian.halstrick@sap.com |
95fa8696faa7f478415bcc521ba97365218a3c7c | 790cb9365a4d69d48dcb01d21360effc0c9d139e | /Blackjack/src/com/pantoine/blackjack/CardDeck.java | b0576312edc7e5c5694f0e7d7a2ef2f265e90975 | [] | no_license | MaTriXy/BlackJack | b051e0b41056e64f8e914a2086f42d3fed1bff6d | 21dd06c139efa0560f864b4bf4e591ee95edd4f9 | refs/heads/master | 2021-01-15T08:08:28.042468 | 2011-02-07T23:33:41 | 2011-02-07T23:33:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,800 | java | package com.pantoine.blackjack;
import android.os.Bundle;
public class CardDeck
{
private Card m_deck[];
private int m_card_index;
private int m_cards_dealt;
public void CreateDeck ()
{
int first_card = R.drawable.clubs_01_75;
int card = 0;
final int value[] = {11,2,3,4,5,6,7,8,9,10,10,10,10};
m_deck = new Card[52];
for (int suit=0; suit< 4; suit++)
{
for (int rank=0;rank<13;rank++,card++)
{
// Set the value of the cards up.
m_deck[card] = new Card();
m_deck[card].SetCard(first_card+card,value[rank]);
m_deck[card].SetNextPrev(card+1,card-1);
}
}
m_deck[0].SetPrev(-1);
m_deck[51].SetNext(-1);
// force shuffle on next read.
m_cards_dealt = 43;
}
public void Shuffle()
{
int swap_card;
int index;
for (index=0; index < 52; index++)
{
swap_card = (int)(Math.random() * 52);
if (swap_card != index)
{
Remove(index);
AddAfter(swap_card,index);
}
}
for (index=0; index < 52; index++)
{
if (m_deck[index].GetPrev() == -1)
{
m_card_index = index;
break;
}
}
m_cards_dealt = 0;
}
public void Remove(int card)
{
if (m_deck[card].GetPrev() != -1)
{
m_deck[m_deck[card].GetPrev()].SetNext(m_deck[card].GetNext());
}
if (m_deck[card].GetNext() != -1)
{
m_deck[m_deck[card].GetNext()].SetPrev(m_deck[card].GetPrev());
}
}
public void AddAfter(int card,int new_card)
{
if (m_deck[card].GetNext() != -1)
{
m_deck[m_deck[card].GetNext()].SetPrev(new_card);
}
m_deck[new_card].SetNextPrev(m_deck[card].GetNext(),card);
m_deck[card].SetNext(new_card);
}
public int GetNextCard()
{
int result = m_card_index;
m_card_index = m_deck[m_card_index].GetNext();
m_cards_dealt++;
return result;
}
public void SaveState(Bundle state)
{
int[] prev_array = new int[52];
int[] next_array = new int[52];
for (int count=0;count<52;count++)
{
prev_array[count] = m_deck[count].GetPrev();
next_array[count] = m_deck[count].GetNext();
}
state.putIntArray("prev_list",prev_array);
state.putIntArray("next_array", next_array);
state.putInt("card_index",m_card_index);
state.putInt("cards_dealt",m_cards_dealt);
}
public void LoadState(Bundle state)
{
int[] prev_array = state.getIntArray("prev_list");
int[] next_array = state.getIntArray("next_array");
m_cards_dealt = state.getInt("cards_dealt");
m_card_index = state.getInt("card_index");
for (int count=0; count<52; count++)
{
m_deck[count].SetNextPrev(next_array[count],prev_array[count]);
}
}
public int GetCardResource(int card){return m_deck[card].GetResource();}
public boolean NeedShuffle() { return m_cards_dealt > 42?true:false; }
public int GetCardValue(int card){return m_deck[card].GetValue();}
}
| [
"github@peterantoine.me.uk"
] | github@peterantoine.me.uk |
040495b157b5627ef9581381cc2c4bb543a582cf | 74552788b43a4ba7b9b3b16ed0babd00b3e9a3f8 | /app/src/main/java/com/example/parsertest/ParserOfMainProductsGroup.java | c2ff1dc576689254afd256d3bf79fceb63faceb5 | [] | no_license | SAntoninov/ParserTest | 0b94441fe72aa1b4ce83c38eb7e43db554a0c453 | 31348cef8501a581d876313dd60dfe04bb48873f | refs/heads/master | 2021-06-03T03:00:43.556270 | 2016-06-26T22:18:53 | 2016-06-26T22:18:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,287 | java | package com.example.parsertest;
import android.util.Log;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
/**
* Created by Сергей on 21.12.2015.
*/
// class for getting the list of refs for product groups
public class ParserOfMainProductsGroup {
ArrayList<Map<String, String >> mapArrayListOfHrefs;
ParserOfMainProductsGroup(){
Document doc;
try {
doc = Jsoup.connect("http://health-diet.ru/base_of_food/").get();
Element table;
Elements rows;
mapArrayListOfHrefs = new ArrayList<Map<String, String>>();
Map<String ,String > map;
// get table that we need
table = doc.getElementsByTag("tbody").get(8);
// tr's tags all are chilfren of tbody
rows = table.getElementsByTag("tr");
// temporary string
String href;
String text;
// pass tbody children
for(Element r : rows){
map = new HashMap<String, String>();
// fill the map by ref and name of product group
href = r.getElementsByTag("td").get(1).select("a").attr("href");
text = r.getElementsByTag("td").get(1).text();
map.put("http://health-diet.ru/" + href,text);
mapArrayListOfHrefs.add(map);
map = new HashMap<String, String>();
href = r.getElementsByTag("td").get(3).select("a").attr("href");
text = r.getElementsByTag("td").get(3).text();
map.put("http://health-diet.ru/" + href,text);
mapArrayListOfHrefs.add(map);
//
}
/* for (Map<String ,String> m : mapArrayListOfHrefs){
Log.d("Map filling: ", m.entrySet().iterator().next().getKey() + " " + m.entrySet().iterator().next().getValue());
}*/
} catch (IOException e) {
e.printStackTrace();
}
}
public ArrayList<Map<String, String >> getMapArrayListOfHrefs(){
return this.mapArrayListOfHrefs;
}
}
| [
"sergeyy.antoninov@rambler.u"
] | sergeyy.antoninov@rambler.u |
c11700c34b0098656dcb6115e21c46db59c433ae | e2e8eca7a31532302471f618c362441b4b94471c | /smdserver/src/it/org/smdserver/words/GetWordsActionTest.java | 29642680de582a738cee68eff5cd80d866458f86 | [] | no_license | progschool-ru/child_langomich | e74b6e1d54f43e9f45533860ae1e2b1583a707e0 | c641813f53ac8b54fbf10a4b11d7a93d5a37a028 | refs/heads/master | 2021-01-01T19:38:31.659610 | 2013-08-30T04:49:32 | 2013-08-30T04:49:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,622 | java | package org.smdserver.words;
import com.meterware.httpunit.WebRequest;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONObject;
import org.junit.Test;
import org.smdserver.core.WebActions;
import org.smdserver.core.WebParams;
import static org.junit.Assert.*;
public class GetWordsActionTest extends WordsTestBase
{
@Test
public void testTest()
{
List<Language> list = getWordsStorage().getUserWords(USER_ID);
assertEquals(1, list.size());
}
@Test
public void testNoSpareSymbolsAtTheEnd() throws Exception
{
WebRequest req = createActionRequest(WebActions.GET_WORDS);
String response = getTextResource(getWC(), req);
assertEquals('}', response.charAt(response.length() - 1));
}
@Test
public void testEncoded() throws Exception
{
WebRequest req = createActionRequest(WebActions.GET_WORDS);
String response = getTextResource(getWC(), req);
assertTrue(response.toLowerCase().contains("\\u043f\\u0435\\u0440\\u0432\\u044b\\u0439"));
}
@Test
public void testGetWords() throws Exception
{
WebRequest req = createActionRequest(WebActions.GET_WORDS);
JSONObject jsonObject = getJSONResource(getWC(), req);
JSONArray languages = jsonObject.getJSONArray(KEY_LANGUAGES);
Language language = new Language(languages.getJSONObject(0));
Word word = language.getWords().get(0);
assertTrue(jsonObject.getBoolean(WebParams.SUCCESS));
assertEquals(1, languages.length());
assertEquals(1, language.getWords().size());
assertEquals(WORD_ORIG, word.getOriginal());
assertEquals(WORD_TRAN, word.getTranslation());
assertEquals(WORD_RATING, word.getRating());
}
}
| [
"chivorotkiv@omich.net"
] | chivorotkiv@omich.net |
9f9f905e45bb055df8f683d88273f901453af1c6 | 154a40970b7d38230aea37153f3e9f89dfb07d03 | /Enterprise Application Development/17-EJB/src/br/com/fiap/bean/CursoBean.java | 8de74dacd3051dcbe00a11be0db8eab775b86648 | [] | no_license | chrizera/FIAP_EnterpriseAppDev | 968b460bf32d17eddf21247050bcd6019f96ce4c | 9e22849572183033ab3f6b9cf6d1e4473c22b339 | refs/heads/master | 2021-01-22T05:43:13.062556 | 2017-05-17T23:53:43 | 2017-05-17T23:53:43 | 81,689,003 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 816 | java | package br.com.fiap.bean;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import br.com.fiap.bo.CursoBO;
@ManagedBean
public class CursoBean {
private float nac, am, ps, enade, media;
@EJB
private CursoBO bo;
public void calcular() {
media = bo.calcularMedia(nac, ps, am, enade);
}
public float getNac() {
return nac;
}
public void setNac(float nac) {
this.nac = nac;
}
public float getAm() {
return am;
}
public void setAm(float am) {
this.am = am;
}
public float getPs() {
return ps;
}
public void setPs(float ps) {
this.ps = ps;
}
public float getEnade() {
return enade;
}
public void setEnade(float enade) {
this.enade = enade;
}
public float getMedia() {
return media;
}
public void setMedia(float media) {
this.media = media;
}
}
| [
"chris-perrone@hotmail.com"
] | chris-perrone@hotmail.com |
4c02875719927ac6606b4ff756ae55b0ec1849be | 6c4a698f22edbd4c4f25d5eedd390e98a0b8399d | /ComputerScience/src/TestObjects.java | 75a4c7e506ef9abc2aa68884e51f04a6fd07fffd | [] | no_license | rbarun/workspace | 6321d181bcb18d42a2a740802d0926c7267282a8 | d2c01503cd6d95de744ec13960c1839bf8d109a2 | refs/heads/master | 2021-01-23T15:28:24.291229 | 2014-07-09T06:05:54 | 2014-07-09T06:05:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 852 | java |
public class TestObjects {
public static void main(String[] args) {
System.out.println("Test");
Circle c1 = new Circle(5);
double value = c1.radius1;
System.out.println("value = " + value);
Circle c2 = new Circle(15);
System.out.println("PI1 : " + c1.PI1);
System.out.println("PI1 : " + c2.PI1);
c1.PI1 = 4.12;
System.out.println("PI1 : " + c1.PI1);
System.out.println("PI1 : " + c2.PI1);
System.out.println("PI1 : " + c1.getRadius());
System.out.println("PI1 : " + c2.getRadius());
Circle c3 = c1;
System.out.println("Circle 1 : " + c1);
System.out.println("Circle 2 : " + c2);
System.out.println("Circle 3 : " + c3);
for (int i = 0; i <= 10; i++) {
Circle c4 = new Circle();
// System.out.println("Circle 4 : " + c4);
}
System.out.println("PI1 : " + c1.PI1);
}
}
| [
"rbarun@hotmail.com"
] | rbarun@hotmail.com |
eaa068abc76c1a00c135b9c17a3a3e8ddc306e2c | 96705451b8f9c6c3b395ea4c5697cbd7668b360c | /android/src/main/java/com/adjust/sdk/adjustsdkplugin/AdjustBridgeInstance.java | bffba9e938ed5fa2541508dfaa64f36798cc7187 | [] | no_license | 2beens/adjust-flutter-sdk | a5bc41655f2257c0ce66b9ca0348f8a1870587f3 | b02ec88fc5ec1831251eb4d7e74f21bb8b897c77 | refs/heads/master | 2020-03-13T07:21:19.291825 | 2018-04-26T13:48:04 | 2018-04-26T13:48:04 | 131,023,630 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,417 | java | package com.adjust.sdk.adjustsdkplugin;
import android.content.Context;
import com.adjust.sdk.Adjust;
import com.adjust.sdk.AdjustConfig;
import com.adjust.sdk.AdjustEvent;
import com.adjust.sdk.LogLevel;
import java.util.Map;
/**
* com.adjust.sdk.adjustsdkplugin
* Created by 2beens on 25.04.18.
*/
public class AdjustBridgeInstance {
public void onCreate(Context context, Map adjustConfigMap) {
String appToken = (String) adjustConfigMap.get("appToken");
String logLevel = (String) adjustConfigMap.get("logLevel");
String environment = (String) adjustConfigMap.get("environment");
String defaultTracker = (String) adjustConfigMap.get("defaultTracker");
String isDeviceKnownString = (String) adjustConfigMap.get("isDeviceKnown");
boolean isDeviceKnown = Boolean.valueOf(isDeviceKnownString);
AdjustConfig config = new AdjustConfig(context, appToken, environment);
String userAgent = (String) adjustConfigMap.get("userAgent");
config.setUserAgent(userAgent);
config.setLogLevel(LogLevel.valueOf(logLevel));
config.setDefaultTracker(defaultTracker);
config.setDeviceKnown(isDeviceKnown);
AdjustSdkPlugin.log("Calling onCreate with values:");
AdjustSdkPlugin.log("\tappToken: " + appToken);
AdjustSdkPlugin.log("\tenvironment: " + environment);
AdjustSdkPlugin.log("\tuserAgent: " + userAgent);
AdjustSdkPlugin.log("\tlogLevel: " + logLevel);
Adjust.onCreate(config);
}
public void trackEvent(Map eventParamsMap) {
String revenue = (String) eventParamsMap.get("revenue");
String currency = (String) eventParamsMap.get("currency");
String orderId = (String) eventParamsMap.get("orderId");
String eventToken = (String) eventParamsMap.get("eventToken");
AdjustEvent event = new AdjustEvent(eventToken);
event.setRevenue(Double.valueOf(revenue), currency);
event.setOrderId(orderId);
Adjust.trackEvent(event);
}
public boolean isEnabled() {
return Adjust.isEnabled();
}
public void onResume() {
Adjust.onResume();
}
public void onPause() {
Adjust.onPause();
}
public void setEnabled(Map isEnabledParamsMap) {
boolean isEnabled = (boolean) isEnabledParamsMap.get("isEnabled");
Adjust.setEnabled(isEnabled);
}
}
| [
"srdjan@adjust.com"
] | srdjan@adjust.com |
9d1a5f5001addabc65a39f3b518cf4584b27aae1 | 0b25fffd2ae10beb97869b731133134f7462ff5a | /src/incomingdata/IncomingText.java | e350de2d8a6c04a0804bc2e224f1941b1d6ac3fb | [] | no_license | Bogdan19021998/TG_bot_v.2 | 9a56bfad068f0ecfee7fcbf8635f991116fe975c | a3cbcc199daa8311bdb402609ed80ea0c12da08b | refs/heads/master | 2020-09-26T15:30:28.569612 | 2019-12-12T14:15:13 | 2019-12-12T14:15:13 | 226,283,144 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 258 | java | package incomingdata;
import com.pengrad.telegrambot.model.Update;
public abstract class IncomingText implements IncomingData {
@Override
public abstract boolean isCorrectData(Update update);
public abstract String getText(Update update );
}
| [
"bogdan19021998ua@gmail.com"
] | bogdan19021998ua@gmail.com |
bc199e893d848206baa1c344b9d5f70a553ee4ae | 63d4862ee595a081dd0b1ab20319e380f1521a1f | /FinalProject/src/Business/Network/RegionNetwork.java | f34f95597dce1441f2528f1f8551edf7dd799863 | [] | no_license | manishgajare/Same-Day-Delivery-Ecosystem-Model-for-Amazon.com | 758083172a2a314f8cfd23b47bd309bd68db0bb5 | c2f3b75756b5e7e95c2855fc2a3cc354995f903f | refs/heads/master | 2021-01-10T07:50:00.118802 | 2017-09-05T13:58:22 | 2017-09-05T13:58:22 | 44,081,240 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,011 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Business.Network;
import Business.Enterprise.EnterpriseDirectory;
/**
*
* @author Manish Gajare
*/
public class RegionNetwork {
private String regionName;
private String status;
private EnterpriseDirectory enterpriseDirectory;
public RegionNetwork() {
enterpriseDirectory = new EnterpriseDirectory();
}
public EnterpriseDirectory getEnterpriseDirectory() {
return enterpriseDirectory;
}
public String getRegionName() {
return regionName;
}
public void setRegionName(String regionName) {
this.regionName = regionName;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
@Override
public String toString() {
return regionName;
}
}
| [
"manishgajare@gmail.com"
] | manishgajare@gmail.com |
93a22558f92f524bfe5a5a5eef58a301cddd42f6 | 9a87891262b61d23e3298891edeace57f1a36301 | /app/src/main/java/gq/codester/maris/audiobookreviewzy/Profile.java | 285946677611a8d796fd411d123b80325481df44 | [] | no_license | msaukans/AudioBook-Reviewzy | 0c406879d0e45366d492f5db11feb53ca7c0840b | 078f92bb8dc05ea9edf03b6186d6f363be8140f0 | refs/heads/master | 2021-07-09T01:55:55.973895 | 2017-10-08T20:53:29 | 2017-10-08T20:53:29 | 103,568,801 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,965 | java | package gq.codester.maris.audiobookreviewzy;
import android.content.Context;
import android.content.SharedPreferences;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.Toast;
public class Profile extends AppCompatActivity implements View.OnClickListener {
public static final String MyPREFERENCES = "MyPrefs" ;
SharedPreferences sp;
String fname, sname, email, login, pass, dob, dobd, dobm, doby;
Button btn_save, btn_changePic;
EditText edEmail,edPass, edLogin, edName, edName2, edDOBD, edDOBM, edDOBY;
ImageView img_profile;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_profile);
sp = getSharedPreferences(MyPREFERENCES, Context.MODE_PRIVATE);
login =sp.getString("login",null);
pass = sp.getString("pass",null);
email = sp.getString("email",null);
fname = sp.getString("fname",null);
sname = sp.getString("Sname",null);
dob = sp.getString("dob",null);
btn_save = (Button) findViewById(R.id.btn_save);
//btn_save.setOnClickListener(this);
btn_changePic = (Button) findViewById(R.id.btn_changePic);
//btn_changePic.setOnClickListener(this);
img_profile = (ImageView) findViewById(R.id.img_profile);
img_profile.setImageResource(R.mipmap.logo1);
edEmail = (EditText) findViewById(R.id.edEmail);
edLogin = (EditText) findViewById(R.id.edLogin);
edPass = (EditText) findViewById(R.id.edPass);
edName = (EditText) findViewById(R.id.edName);
edName2 = (EditText) findViewById(R.id.edName2);
edDOBD = (EditText) findViewById(R.id.edDOBD);
edDOBM = (EditText) findViewById(R.id.edDOBM);
edDOBY = (EditText) findViewById(R.id.edDOBY);
edEmail.setText(email);
edPass.setText(pass);
edLogin.setText(login);
edName.setText(fname);
edName2.setText(sname);
String[] split = dob.split("/");
String dobd = split[0];
String dobm = split[1];
String doby = split[2];
edDOBD.setText(doby);
edDOBM.setText(dobm);
edDOBY.setText(dobd);
}//end onCreate()
@Override
public void onClick(View v) {
if(v == btn_save){
saveDate();
}
if(v == btn_changePic){
//TODO create method to pick new picture or capture picture and then upload the new picture
//to server
}
}//end onClick()
private void saveDate() {
email = edEmail.getText().toString().trim();
pass = edPass.getText().toString().trim();
if(TextUtils.isEmpty(email)){
Toast.makeText(this,"Please enter email", Toast.LENGTH_SHORT).show();
return;
}
if(TextUtils.isEmpty(pass)){//if password is empty
Toast.makeText(this,"Please enter pass", Toast.LENGTH_SHORT).show();
return;
}
fname = edName.getText().toString().trim();
sname = edName2.getText().toString().trim();
login = edLogin.getText().toString().trim();
dobd = edDOBD.getText().toString().trim();
dobm = edDOBM.getText().toString().trim();
doby = edDOBY.getText().toString().trim();
dob = doby+"/"+dobm+"/"+dobd;
SharedPreferences.Editor editor = sp.edit();
editor.putString("login", login);
editor.putString("pass", pass);
editor.putString("email", email);
editor.putString("fname", fname);
editor.putString("sname", sname);
editor.putString("dob", dob);
editor.commit();
//TODO update values on the server/DB
}//end saveData()
}
| [
"maris@codester.gq"
] | maris@codester.gq |
661ad64419b8574c7841797956953196f1457f74 | 0c36d122fe03337024ef37f8cca5db4049656620 | /app/src/main/java/com/example/myapplication/LoginFrament.java | 929793551c521f4572a14b2f79d8c1d725ef68cf | [] | no_license | silvia-garp/prueba | d696af1614fea0fa9dfecb3e97223de6510d9b39 | 1c9ee2f83f4644d343dd697b5d29d0a27f8b7cb2 | refs/heads/master | 2020-08-16T13:20:36.256463 | 2019-10-16T09:23:36 | 2019-10-16T09:23:36 | 215,506,076 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,619 | java | package com.example.myapplication;
import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
/**
* A simple {@link Fragment} subclass.
* Activities that contain this fragment must implement the
* {@link LoginFrament.OnFragmentInteractionListener} interface
* to handle interaction events.
* Use the {@link LoginFrament#newInstance} factory method to
* create an instance of this fragment.
*/
public class LoginFrament extends Fragment {
// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private static final String ARG_PARAM1 = "param1";
private static final String ARG_PARAM2 = "param2";
// TODO: Rename and change types of parameters
private String mParam1;
private String mParam2;
private OnFragmentInteractionListener mListener;
public LoginFrament() {
// Required empty public constructor
}
/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment LoginFrament.
*/
// TODO: Rename and change types and number of parameters
public static LoginFrament newInstance(String param1, String param2) {
LoginFrament fragment = new LoginFrament();
Bundle args = new Bundle();
args.putString(ARG_PARAM1, param1);
args.putString(ARG_PARAM2, param2);
fragment.setArguments(args);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
mParam1 = getArguments().getString(ARG_PARAM1);
mParam2 = getArguments().getString(ARG_PARAM2);
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_login, container, false);
}
// TODO: Rename method, update argument and hook method into UI event
public void onButtonPressed(Uri uri) {
if (mListener != null) {
mListener.onFragmentInteraction(uri);
}
}
@Override
public void onAttach(Context context) {
super.onAttach(context);
if (context instanceof OnFragmentInteractionListener) {
mListener = (OnFragmentInteractionListener) context;
} else {
throw new RuntimeException(context.toString()
+ " must implement OnFragmentInteractionListener");
}
}
@Override
public void onDetach() {
super.onDetach();
mListener = null;
}
/**
* This interface must be implemented by activities that contain this
* fragment to allow an interaction in this fragment to be communicated
* to the activity and potentially other fragments contained in that
* activity.
* <p>
* See the Android Training lesson <a href=
* "http://developer.android.com/training/basics/fragments/communicating.html"
* >Communicating with Other Fragments</a> for more information.
*/
public interface OnFragmentInteractionListener {
// TODO: Update argument type and name
void onFragmentInteraction(Uri uri);
}
}
| [
"silvigarciapeinado@gmail.com"
] | silvigarciapeinado@gmail.com |
0358af68a988ef075e902f2ad97cf7a0226a3ced | 00691c1f887c2dc2f85d90440368e596e32b307a | /n00bctf18/rev_apk/sources/android/support/constraint/solver/LinearSystem.java | 16107be8d4ac00d39f23d05ec32c70f5f7162ec7 | [] | no_license | aman589/2018-ctfs-chall-and-sol | d11cad09447dc55062747d667b5f1393faa65bcf | 888d79243155085523899267c594028fb4208b34 | refs/heads/master | 2020-08-09T22:30:21.067835 | 2019-10-10T13:52:55 | 2019-10-10T13:52:55 | 214,190,696 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 34,804 | java | package android.support.constraint.solver;
import android.support.constraint.solver.SolverVariable.Type;
import android.support.constraint.solver.widgets.ConstraintAnchor;
import android.support.constraint.solver.widgets.ConstraintWidget;
import java.io.PrintStream;
import java.util.Arrays;
import java.util.HashMap;
public class LinearSystem {
private static final boolean DEBUG = false;
public static final boolean FULL_DEBUG = false;
private static int POOL_SIZE = 1000;
public static Metrics sMetrics;
private int TABLE_SIZE;
public boolean graphOptimizer;
private boolean[] mAlreadyTestedCandidates;
final Cache mCache;
private Row mGoal;
private int mMaxColumns;
private int mMaxRows;
int mNumColumns;
int mNumRows;
private SolverVariable[] mPoolVariables;
private int mPoolVariablesCount;
ArrayRow[] mRows;
private final Row mTempGoal;
private HashMap<String, SolverVariable> mVariables;
int mVariablesID;
private ArrayRow[] tempClientsCopy;
interface Row {
void addError(SolverVariable solverVariable);
void clear();
SolverVariable getKey();
SolverVariable getPivotCandidate(LinearSystem linearSystem, boolean[] zArr);
void initFromRow(Row row);
boolean isEmpty();
}
public LinearSystem() {
this.mVariablesID = 0;
this.mVariables = null;
this.TABLE_SIZE = 32;
this.mMaxColumns = this.TABLE_SIZE;
this.mRows = null;
this.graphOptimizer = false;
this.mAlreadyTestedCandidates = new boolean[this.TABLE_SIZE];
this.mNumColumns = 1;
this.mNumRows = 0;
this.mMaxRows = this.TABLE_SIZE;
this.mPoolVariables = new SolverVariable[POOL_SIZE];
this.mPoolVariablesCount = 0;
this.tempClientsCopy = new ArrayRow[this.TABLE_SIZE];
this.mRows = new ArrayRow[this.TABLE_SIZE];
releaseRows();
this.mCache = new Cache();
this.mGoal = new GoalRow(this.mCache);
this.mTempGoal = new ArrayRow(this.mCache);
}
public void fillMetrics(Metrics metrics) {
sMetrics = metrics;
}
public static Metrics getMetrics() {
return sMetrics;
}
private void increaseTableSize() {
this.TABLE_SIZE *= 2;
this.mRows = (ArrayRow[]) Arrays.copyOf(this.mRows, this.TABLE_SIZE);
this.mCache.mIndexedVariables = (SolverVariable[]) Arrays.copyOf(this.mCache.mIndexedVariables, this.TABLE_SIZE);
this.mAlreadyTestedCandidates = new boolean[this.TABLE_SIZE];
this.mMaxColumns = this.TABLE_SIZE;
this.mMaxRows = this.TABLE_SIZE;
if (sMetrics != null) {
Metrics metrics = sMetrics;
metrics.tableSizeIncrease++;
sMetrics.maxTableSize = Math.max(sMetrics.maxTableSize, (long) this.TABLE_SIZE);
sMetrics.lastTableSize = sMetrics.maxTableSize;
}
}
private void releaseRows() {
for (int i = 0; i < this.mRows.length; i++) {
ArrayRow row = this.mRows[i];
if (row != null) {
this.mCache.arrayRowPool.release(row);
}
this.mRows[i] = null;
}
}
public void reset() {
int i;
for (SolverVariable variable : this.mCache.mIndexedVariables) {
if (variable != null) {
variable.reset();
}
}
this.mCache.solverVariablePool.releaseAll(this.mPoolVariables, this.mPoolVariablesCount);
this.mPoolVariablesCount = 0;
Arrays.fill(this.mCache.mIndexedVariables, null);
if (this.mVariables != null) {
this.mVariables.clear();
}
this.mVariablesID = 0;
this.mGoal.clear();
this.mNumColumns = 1;
for (i = 0; i < this.mNumRows; i++) {
this.mRows[i].used = false;
}
releaseRows();
this.mNumRows = 0;
}
public SolverVariable createObjectVariable(Object anchor) {
if (anchor == null) {
return null;
}
if (this.mNumColumns + 1 >= this.mMaxColumns) {
increaseTableSize();
}
SolverVariable variable = null;
if (anchor instanceof ConstraintAnchor) {
variable = ((ConstraintAnchor) anchor).getSolverVariable();
if (variable == null) {
((ConstraintAnchor) anchor).resetSolverVariable(this.mCache);
variable = ((ConstraintAnchor) anchor).getSolverVariable();
}
if (variable.id == -1 || variable.id > this.mVariablesID || this.mCache.mIndexedVariables[variable.id] == null) {
if (variable.id != -1) {
variable.reset();
}
this.mVariablesID++;
this.mNumColumns++;
variable.id = this.mVariablesID;
variable.mType = Type.UNRESTRICTED;
this.mCache.mIndexedVariables[this.mVariablesID] = variable;
}
}
return variable;
}
public ArrayRow createRow() {
ArrayRow row = (ArrayRow) this.mCache.arrayRowPool.acquire();
if (row == null) {
row = new ArrayRow(this.mCache);
} else {
row.reset();
}
SolverVariable.increaseErrorId();
return row;
}
public SolverVariable createSlackVariable() {
if (sMetrics != null) {
Metrics metrics = sMetrics;
metrics.slackvariables++;
}
if (this.mNumColumns + 1 >= this.mMaxColumns) {
increaseTableSize();
}
SolverVariable variable = acquireSolverVariable(Type.SLACK, null);
this.mVariablesID++;
this.mNumColumns++;
variable.id = this.mVariablesID;
this.mCache.mIndexedVariables[this.mVariablesID] = variable;
return variable;
}
public SolverVariable createExtraVariable() {
if (sMetrics != null) {
Metrics metrics = sMetrics;
metrics.extravariables++;
}
if (this.mNumColumns + 1 >= this.mMaxColumns) {
increaseTableSize();
}
SolverVariable variable = acquireSolverVariable(Type.SLACK, null);
this.mVariablesID++;
this.mNumColumns++;
variable.id = this.mVariablesID;
this.mCache.mIndexedVariables[this.mVariablesID] = variable;
return variable;
}
private void addError(ArrayRow row) {
row.addError(this, 0);
}
private void addSingleError(ArrayRow row, int sign) {
addSingleError(row, sign, 0);
}
void addSingleError(ArrayRow row, int sign, int strength) {
row.addSingleError(createErrorVariable(strength, null), sign);
}
private SolverVariable createVariable(String name, Type type) {
if (sMetrics != null) {
Metrics metrics = sMetrics;
metrics.variables++;
}
if (this.mNumColumns + 1 >= this.mMaxColumns) {
increaseTableSize();
}
SolverVariable variable = acquireSolverVariable(type, null);
variable.setName(name);
this.mVariablesID++;
this.mNumColumns++;
variable.id = this.mVariablesID;
if (this.mVariables == null) {
this.mVariables = new HashMap();
}
this.mVariables.put(name, variable);
this.mCache.mIndexedVariables[this.mVariablesID] = variable;
return variable;
}
public SolverVariable createErrorVariable(int strength, String prefix) {
if (sMetrics != null) {
Metrics metrics = sMetrics;
metrics.errors++;
}
if (this.mNumColumns + 1 >= this.mMaxColumns) {
increaseTableSize();
}
SolverVariable variable = acquireSolverVariable(Type.ERROR, prefix);
this.mVariablesID++;
this.mNumColumns++;
variable.id = this.mVariablesID;
variable.strength = strength;
this.mCache.mIndexedVariables[this.mVariablesID] = variable;
this.mGoal.addError(variable);
return variable;
}
private SolverVariable acquireSolverVariable(Type type, String prefix) {
SolverVariable variable = (SolverVariable) this.mCache.solverVariablePool.acquire();
if (variable == null) {
variable = new SolverVariable(type, prefix);
variable.setType(type, prefix);
} else {
variable.reset();
variable.setType(type, prefix);
}
if (this.mPoolVariablesCount >= POOL_SIZE) {
POOL_SIZE *= 2;
this.mPoolVariables = (SolverVariable[]) Arrays.copyOf(this.mPoolVariables, POOL_SIZE);
}
SolverVariable[] solverVariableArr = this.mPoolVariables;
int i = this.mPoolVariablesCount;
this.mPoolVariablesCount = i + 1;
solverVariableArr[i] = variable;
return variable;
}
Row getGoal() {
return this.mGoal;
}
ArrayRow getRow(int n) {
return this.mRows[n];
}
float getValueFor(String name) {
SolverVariable v = getVariable(name, Type.UNRESTRICTED);
if (v == null) {
return 0.0f;
}
return v.computedValue;
}
public int getObjectVariableValue(Object anchor) {
SolverVariable variable = ((ConstraintAnchor) anchor).getSolverVariable();
if (variable != null) {
return (int) (variable.computedValue + 0.5f);
}
return 0;
}
SolverVariable getVariable(String name, Type type) {
if (this.mVariables == null) {
this.mVariables = new HashMap();
}
SolverVariable variable = (SolverVariable) this.mVariables.get(name);
if (variable == null) {
return createVariable(name, type);
}
return variable;
}
public void minimize() throws Exception {
Metrics metrics;
if (sMetrics != null) {
metrics = sMetrics;
metrics.minimize++;
}
if (this.graphOptimizer) {
if (sMetrics != null) {
metrics = sMetrics;
metrics.graphOptimizer++;
}
boolean fullySolved = true;
for (int i = 0; i < this.mNumRows; i++) {
if (!this.mRows[i].isSimpleDefinition) {
fullySolved = false;
break;
}
}
if (fullySolved) {
if (sMetrics != null) {
Metrics metrics2 = sMetrics;
metrics2.fullySolved++;
}
computeValues();
return;
}
minimizeGoal(this.mGoal);
return;
}
minimizeGoal(this.mGoal);
}
void minimizeGoal(Row goal) throws Exception {
if (sMetrics != null) {
Metrics metrics = sMetrics;
metrics.minimizeGoal++;
sMetrics.maxVariables = Math.max(sMetrics.maxVariables, (long) this.mNumColumns);
sMetrics.maxRows = Math.max(sMetrics.maxRows, (long) this.mNumRows);
}
updateRowFromVariables((ArrayRow) goal);
enforceBFS(goal);
optimize(goal, false);
computeValues();
}
private final void updateRowFromVariables(ArrayRow row) {
if (this.mNumRows > 0) {
row.variables.updateFromSystem(row, this.mRows);
if (row.variables.currentSize == 0) {
row.isSimpleDefinition = true;
}
}
}
public void addConstraint(ArrayRow row) {
if (row != null) {
if (sMetrics != null) {
Metrics metrics = sMetrics;
metrics.constraints++;
if (row.isSimpleDefinition) {
metrics = sMetrics;
metrics.simpleconstraints++;
}
}
if (this.mNumRows + 1 >= this.mMaxRows || this.mNumColumns + 1 >= this.mMaxColumns) {
increaseTableSize();
}
boolean added = false;
if (!row.isSimpleDefinition) {
updateRowFromVariables(row);
if (!row.isEmpty()) {
row.ensurePositiveConstant();
if (row.chooseSubject(this)) {
SolverVariable extra = createExtraVariable();
row.variable = extra;
addRow(row);
added = true;
this.mTempGoal.initFromRow(row);
optimize(this.mTempGoal, true);
if (extra.definitionId == -1) {
if (row.variable == extra) {
SolverVariable pivotCandidate = row.pickPivot(extra);
if (pivotCandidate != null) {
if (sMetrics != null) {
Metrics metrics2 = sMetrics;
metrics2.pivots++;
}
row.pivot(pivotCandidate);
}
}
if (!row.isSimpleDefinition) {
row.variable.updateReferencesWithNewDefinition(row);
}
this.mNumRows--;
}
}
if (!row.hasKeyVariable()) {
return;
}
}
return;
}
if (!added) {
addRow(row);
}
}
}
private final void addRow(ArrayRow row) {
if (this.mRows[this.mNumRows] != null) {
this.mCache.arrayRowPool.release(this.mRows[this.mNumRows]);
}
this.mRows[this.mNumRows] = row;
row.variable.definitionId = this.mNumRows;
this.mNumRows++;
row.variable.updateReferencesWithNewDefinition(row);
}
private final int optimize(Row goal, boolean b) {
if (sMetrics != null) {
Metrics metrics = sMetrics;
metrics.optimize++;
}
boolean done = false;
int tries = 0;
for (int i = 0; i < this.mNumColumns; i++) {
this.mAlreadyTestedCandidates[i] = false;
}
while (!done) {
if (sMetrics != null) {
Metrics metrics2 = sMetrics;
metrics2.iterations++;
}
tries++;
if (tries >= this.mNumColumns * 2) {
return tries;
}
if (goal.getKey() != null) {
this.mAlreadyTestedCandidates[goal.getKey().id] = true;
}
SolverVariable pivotCandidate = goal.getPivotCandidate(this, this.mAlreadyTestedCandidates);
if (pivotCandidate != null) {
if (this.mAlreadyTestedCandidates[pivotCandidate.id]) {
return tries;
}
this.mAlreadyTestedCandidates[pivotCandidate.id] = true;
}
if (pivotCandidate != null) {
ArrayRow current;
int pivotRowIndex = -1;
float min = Float.MAX_VALUE;
for (int i2 = 0; i2 < this.mNumRows; i2++) {
current = this.mRows[i2];
if (!(current.variable.mType == Type.UNRESTRICTED || current.isSimpleDefinition || !current.hasVariable(pivotCandidate))) {
float a_j = current.variables.get(pivotCandidate);
if (a_j < 0.0f) {
float value = (-current.constantValue) / a_j;
if (value < min) {
min = value;
pivotRowIndex = i2;
}
}
}
}
if (pivotRowIndex > -1) {
current = this.mRows[pivotRowIndex];
current.variable.definitionId = -1;
if (sMetrics != null) {
Metrics metrics3 = sMetrics;
metrics3.pivots++;
}
current.pivot(pivotCandidate);
current.variable.definitionId = pivotRowIndex;
current.variable.updateReferencesWithNewDefinition(current);
} else {
done = true;
}
} else {
done = true;
}
}
Row row = goal;
return tries;
}
private int enforceBFS(Row goal) throws Exception {
float f;
int tries = 0;
boolean infeasibleSystem = false;
int i = 0;
while (true) {
f = 0.0f;
if (i >= this.mNumRows) {
break;
} else if (this.mRows[i].variable.mType != Type.UNRESTRICTED && this.mRows[i].constantValue < 0.0f) {
infeasibleSystem = true;
break;
} else {
i++;
}
}
if (infeasibleSystem) {
boolean done = false;
tries = 0;
while (!done) {
if (sMetrics != null) {
Metrics metrics = sMetrics;
metrics.bfs++;
}
tries++;
int pivotRowIndex = -1;
int pivotColumnIndex = -1;
int strength = 0;
float min = Float.MAX_VALUE;
int i2 = 0;
while (i2 < this.mNumRows) {
ArrayRow current = this.mRows[i2];
if (!(current.variable.mType == Type.UNRESTRICTED || current.isSimpleDefinition || current.constantValue >= r6)) {
int j = 1;
while (j < this.mNumColumns) {
SolverVariable candidate = this.mCache.mIndexedVariables[j];
float a_j = current.variables.get(candidate);
if (a_j > f) {
while (0 < 7) {
f = candidate.strengthVector[0] / a_j;
if ((f < min && 0 == strength) || 0 > strength) {
min = f;
pivotRowIndex = i2;
pivotColumnIndex = j;
strength = 0;
}
int k = 0 + 1;
}
}
j++;
f = 0.0f;
}
}
i2++;
f = 0.0f;
}
if (pivotRowIndex != -1) {
ArrayRow pivotEquation = this.mRows[pivotRowIndex];
pivotEquation.variable.definitionId = -1;
if (sMetrics != null) {
Metrics metrics2 = sMetrics;
metrics2.pivots++;
}
pivotEquation.pivot(this.mCache.mIndexedVariables[pivotColumnIndex]);
pivotEquation.variable.definitionId = pivotRowIndex;
pivotEquation.variable.updateReferencesWithNewDefinition(pivotEquation);
} else {
done = true;
}
if (tries > this.mNumColumns / 2) {
done = true;
}
f = 0.0f;
}
}
return tries;
}
private void computeValues() {
for (int i = 0; i < this.mNumRows; i++) {
ArrayRow row = this.mRows[i];
row.variable.computedValue = row.constantValue;
}
}
private void displayRows() {
displaySolverVariables();
String s = "";
for (int i = 0; i < this.mNumRows; i++) {
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(s);
stringBuilder.append(this.mRows[i]);
s = stringBuilder.toString();
stringBuilder = new StringBuilder();
stringBuilder.append(s);
stringBuilder.append("\n");
s = stringBuilder.toString();
}
StringBuilder stringBuilder2 = new StringBuilder();
stringBuilder2.append(s);
stringBuilder2.append(this.mGoal);
stringBuilder2.append("\n");
System.out.println(stringBuilder2.toString());
}
void displayReadableRows() {
displaySolverVariables();
String s = " # ";
for (int i = 0; i < this.mNumRows; i++) {
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(s);
stringBuilder.append(this.mRows[i].toReadableString());
s = stringBuilder.toString();
stringBuilder = new StringBuilder();
stringBuilder.append(s);
stringBuilder.append("\n # ");
s = stringBuilder.toString();
}
if (this.mGoal != null) {
StringBuilder stringBuilder2 = new StringBuilder();
stringBuilder2.append(s);
stringBuilder2.append(this.mGoal);
stringBuilder2.append("\n");
s = stringBuilder2.toString();
}
System.out.println(s);
}
public void displayVariablesReadableRows() {
displaySolverVariables();
String s = "";
for (int i = 0; i < this.mNumRows; i++) {
if (this.mRows[i].variable.mType == Type.UNRESTRICTED) {
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(s);
stringBuilder.append(this.mRows[i].toReadableString());
s = stringBuilder.toString();
stringBuilder = new StringBuilder();
stringBuilder.append(s);
stringBuilder.append("\n");
s = stringBuilder.toString();
}
}
StringBuilder stringBuilder2 = new StringBuilder();
stringBuilder2.append(s);
stringBuilder2.append(this.mGoal);
stringBuilder2.append("\n");
System.out.println(stringBuilder2.toString());
}
public int getMemoryUsed() {
int actualRowSize = 0;
for (int i = 0; i < this.mNumRows; i++) {
if (this.mRows[i] != null) {
actualRowSize += this.mRows[i].sizeInBytes();
}
}
return actualRowSize;
}
public int getNumEquations() {
return this.mNumRows;
}
public int getNumVariables() {
return this.mVariablesID;
}
void displaySystemInformations() {
int i;
int rowSize = 0;
for (i = 0; i < this.TABLE_SIZE; i++) {
if (this.mRows[i] != null) {
rowSize += this.mRows[i].sizeInBytes();
}
}
i = 0;
for (int i2 = 0; i2 < this.mNumRows; i2++) {
if (this.mRows[i2] != null) {
i += this.mRows[i2].sizeInBytes();
}
}
PrintStream printStream = System.out;
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("Linear System -> Table size: ");
stringBuilder.append(this.TABLE_SIZE);
stringBuilder.append(" (");
stringBuilder.append(getDisplaySize(this.TABLE_SIZE * this.TABLE_SIZE));
stringBuilder.append(") -- row sizes: ");
stringBuilder.append(getDisplaySize(rowSize));
stringBuilder.append(", actual size: ");
stringBuilder.append(getDisplaySize(i));
stringBuilder.append(" rows: ");
stringBuilder.append(this.mNumRows);
stringBuilder.append("/");
stringBuilder.append(this.mMaxRows);
stringBuilder.append(" cols: ");
stringBuilder.append(this.mNumColumns);
stringBuilder.append("/");
stringBuilder.append(this.mMaxColumns);
stringBuilder.append(" ");
stringBuilder.append(0);
stringBuilder.append(" occupied cells, ");
stringBuilder.append(getDisplaySize(0));
printStream.println(stringBuilder.toString());
}
private void displaySolverVariables() {
String s = new StringBuilder();
s.append("Display Rows (");
s.append(this.mNumRows);
s.append("x");
s.append(this.mNumColumns);
s.append(")\n");
System.out.println(s.toString());
}
private String getDisplaySize(int n) {
int mb = ((n * 4) / 1024) / 1024;
if (mb > 0) {
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("");
stringBuilder.append(mb);
stringBuilder.append(" Mb");
return stringBuilder.toString();
}
int kb = (n * 4) / 1024;
StringBuilder stringBuilder2;
if (kb > 0) {
stringBuilder2 = new StringBuilder();
stringBuilder2.append("");
stringBuilder2.append(kb);
stringBuilder2.append(" Kb");
return stringBuilder2.toString();
}
stringBuilder2 = new StringBuilder();
stringBuilder2.append("");
stringBuilder2.append(n * 4);
stringBuilder2.append(" bytes");
return stringBuilder2.toString();
}
public Cache getCache() {
return this.mCache;
}
private String getDisplayStrength(int strength) {
if (strength == 1) {
return "LOW";
}
if (strength == 2) {
return "MEDIUM";
}
if (strength == 3) {
return "HIGH";
}
if (strength == 4) {
return "HIGHEST";
}
if (strength == 5) {
return "EQUALITY";
}
if (strength == 6) {
return "FIXED";
}
return "NONE";
}
public void addGreaterThan(SolverVariable a, SolverVariable b, int margin, int strength) {
ArrayRow row = createRow();
SolverVariable slack = createSlackVariable();
slack.strength = 0;
row.createRowGreaterThan(a, b, slack, margin);
if (strength != 6) {
addSingleError(row, (int) (-1.0f * row.variables.get(slack)), strength);
}
addConstraint(row);
}
public void addGreaterThan(SolverVariable a, int b) {
ArrayRow row = createRow();
SolverVariable slack = createSlackVariable();
slack.strength = 0;
row.createRowGreaterThan(a, b, slack);
addConstraint(row);
}
public void addGreaterBarrier(SolverVariable a, SolverVariable b, boolean hasMatchConstraintWidgets) {
ArrayRow row = createRow();
SolverVariable slack = createSlackVariable();
slack.strength = 0;
row.createRowGreaterThan(a, b, slack, 0);
if (hasMatchConstraintWidgets) {
addSingleError(row, (int) (-1.0f * row.variables.get(slack)), 1);
}
addConstraint(row);
}
public void addLowerThan(SolverVariable a, SolverVariable b, int margin, int strength) {
ArrayRow row = createRow();
SolverVariable slack = createSlackVariable();
slack.strength = 0;
row.createRowLowerThan(a, b, slack, margin);
if (strength != 6) {
addSingleError(row, (int) (-1.0f * row.variables.get(slack)), strength);
}
addConstraint(row);
}
public void addLowerBarrier(SolverVariable a, SolverVariable b, boolean hasMatchConstraintWidgets) {
ArrayRow row = createRow();
SolverVariable slack = createSlackVariable();
slack.strength = 0;
row.createRowLowerThan(a, b, slack, 0);
if (hasMatchConstraintWidgets) {
addSingleError(row, (int) (-1.0f * row.variables.get(slack)), 1);
}
addConstraint(row);
}
public void addCentering(SolverVariable a, SolverVariable b, int m1, float bias, SolverVariable c, SolverVariable d, int m2, int strength) {
int i = strength;
ArrayRow row = createRow();
row.createRowCentering(a, b, m1, bias, c, d, m2);
if (i != 6) {
row.addError(this, i);
}
addConstraint(row);
}
public void addRatio(SolverVariable a, SolverVariable b, SolverVariable c, SolverVariable d, float ratio, int strength) {
ArrayRow row = createRow();
row.createRowDimensionRatio(a, b, c, d, ratio);
if (strength != 6) {
row.addError(this, strength);
}
addConstraint(row);
}
public ArrayRow addEquality(SolverVariable a, SolverVariable b, int margin, int strength) {
ArrayRow row = createRow();
row.createRowEquals(a, b, margin);
if (strength != 6) {
row.addError(this, strength);
}
addConstraint(row);
return row;
}
public void addEquality(SolverVariable a, int value) {
int idx = a.definitionId;
ArrayRow row;
if (a.definitionId != -1) {
row = this.mRows[idx];
if (row.isSimpleDefinition) {
row.constantValue = (float) value;
return;
} else if (row.variables.currentSize == 0) {
row.isSimpleDefinition = true;
row.constantValue = (float) value;
return;
} else {
ArrayRow newRow = createRow();
newRow.createRowEquals(a, value);
addConstraint(newRow);
return;
}
}
row = createRow();
row.createRowDefinition(a, value);
addConstraint(row);
}
public void addEquality(SolverVariable a, int value, int strength) {
int idx = a.definitionId;
ArrayRow row;
if (a.definitionId != -1) {
row = this.mRows[idx];
if (row.isSimpleDefinition) {
row.constantValue = (float) value;
return;
}
ArrayRow newRow = createRow();
newRow.createRowEquals(a, value);
newRow.addError(this, strength);
addConstraint(newRow);
return;
}
row = createRow();
row.createRowDefinition(a, value);
row.addError(this, strength);
addConstraint(row);
}
public static ArrayRow createRowEquals(LinearSystem linearSystem, SolverVariable variableA, SolverVariable variableB, int margin, boolean withError) {
ArrayRow row = linearSystem.createRow();
row.createRowEquals(variableA, variableB, margin);
if (withError) {
linearSystem.addSingleError(row, 1);
}
return row;
}
public static ArrayRow createRowDimensionPercent(LinearSystem linearSystem, SolverVariable variableA, SolverVariable variableB, SolverVariable variableC, float percent, boolean withError) {
ArrayRow row = linearSystem.createRow();
if (withError) {
linearSystem.addError(row);
}
return row.createRowDimensionPercent(variableA, variableB, variableC, percent);
}
public static ArrayRow createRowGreaterThan(LinearSystem linearSystem, SolverVariable variableA, SolverVariable variableB, int margin, boolean withError) {
SolverVariable slack = linearSystem.createSlackVariable();
ArrayRow row = linearSystem.createRow();
row.createRowGreaterThan(variableA, variableB, slack, margin);
if (withError) {
linearSystem.addSingleError(row, (int) (-1.0f * row.variables.get(slack)));
}
return row;
}
public static ArrayRow createRowLowerThan(LinearSystem linearSystem, SolverVariable variableA, SolverVariable variableB, int margin, boolean withError) {
SolverVariable slack = linearSystem.createSlackVariable();
ArrayRow row = linearSystem.createRow();
row.createRowLowerThan(variableA, variableB, slack, margin);
if (withError) {
linearSystem.addSingleError(row, (int) (-1.0f * row.variables.get(slack)));
}
return row;
}
public static ArrayRow createRowCentering(LinearSystem linearSystem, SolverVariable variableA, SolverVariable variableB, int marginA, float bias, SolverVariable variableC, SolverVariable variableD, int marginB, boolean withError) {
ArrayRow row = linearSystem.createRow();
row.createRowCentering(variableA, variableB, marginA, bias, variableC, variableD, marginB);
LinearSystem linearSystem2;
if (withError) {
linearSystem2 = linearSystem;
row.addError(linearSystem, 4);
} else {
linearSystem2 = linearSystem;
}
return row;
}
public void addCenterPoint(ConstraintWidget widget, ConstraintWidget target, float angle, int radius) {
ConstraintWidget constraintWidget = widget;
ConstraintWidget constraintWidget2 = target;
float f = angle;
int i = radius;
SolverVariable Al = createObjectVariable(constraintWidget.getAnchor(ConstraintAnchor.Type.LEFT));
SolverVariable At = createObjectVariable(constraintWidget.getAnchor(ConstraintAnchor.Type.TOP));
SolverVariable Ar = createObjectVariable(constraintWidget.getAnchor(ConstraintAnchor.Type.RIGHT));
SolverVariable Ab = createObjectVariable(constraintWidget.getAnchor(ConstraintAnchor.Type.BOTTOM));
SolverVariable Bl = createObjectVariable(constraintWidget2.getAnchor(ConstraintAnchor.Type.LEFT));
SolverVariable Bt = createObjectVariable(constraintWidget2.getAnchor(ConstraintAnchor.Type.TOP));
SolverVariable Br = createObjectVariable(constraintWidget2.getAnchor(ConstraintAnchor.Type.RIGHT));
SolverVariable Bb = createObjectVariable(constraintWidget2.getAnchor(ConstraintAnchor.Type.BOTTOM));
ArrayRow row = createRow();
float angleComponent = (float) (Math.sin((double) f) * ((double) i));
row.createRowWithAngle(At, Ab, Bt, Bb, angleComponent);
addConstraint(row);
ArrayRow row2 = createRow();
float angleComponent2 = (float) (Math.cos((double) f) * ((double) i));
float f2 = angleComponent2;
row2.createRowWithAngle(Al, Ar, Bl, Br, angleComponent2);
addConstraint(row2);
}
}
| [
"saurabh.dakshana17@gmail.com"
] | saurabh.dakshana17@gmail.com |
33a3a1fbad4b080edc883c51aa8d7288a261c3ee | f91290b43c675f3657994f0b0485c1fc1eac786a | /src/com/pdd/pop/ext/fasterxml/jackson/databind/ser/std/ArraySerializerBase.java | 1922b12660196db5e5667cb4c18292c3bad3504c | [] | no_license | lywx215/http-client | 49462178ebbbd3469f798f53b16f5cb52db56d72 | 29871ab097e2e6dfc1bd2ab5f1a63b6146797c5a | refs/heads/master | 2021-10-09T09:01:07.389764 | 2018-12-25T05:06:11 | 2018-12-25T05:06:11 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,993 | java | package com.pdd.pop.ext.fasterxml.jackson.databind.ser.std;
import java.io.IOException;
import com.pdd.pop.ext.fasterxml.jackson.annotation.JsonFormat;
import com.pdd.pop.ext.fasterxml.jackson.core.*;
import com.pdd.pop.ext.fasterxml.jackson.core.type.WritableTypeId;
import com.pdd.pop.ext.fasterxml.jackson.databind.*;
import com.pdd.pop.ext.fasterxml.jackson.databind.jsontype.TypeSerializer;
import com.pdd.pop.ext.fasterxml.jackson.databind.ser.*;
/**
* Intermediate base class for serializers used for various
* Java arrays.
*
* @param <T> Type of arrays serializer handles
*/
@SuppressWarnings("serial")
public abstract class ArraySerializerBase<T>
extends ContainerSerializer<T>
implements ContextualSerializer // for 'unwrapSingleElemArray'
{
protected final BeanProperty _property;
/**
* Setting for specific local override for "unwrap single element arrays":
* true for enable unwrapping, false for preventing it, `null` for using
* global configuration.
*
* @since 2.6
*/
protected final Boolean _unwrapSingle;
protected ArraySerializerBase(Class<T> cls)
{
super(cls);
_property = null;
_unwrapSingle = null;
}
/**
* Use either variant that just takes type (non-contextual), or,
* copy constructor that allows passing of property.
*
* @deprecated Since 2.6
*/
@Deprecated
protected ArraySerializerBase(Class<T> cls, BeanProperty property)
{
super(cls);
_property = property;
_unwrapSingle = null;
}
protected ArraySerializerBase(ArraySerializerBase<?> src)
{
super(src._handledType, false);
_property = src._property;
_unwrapSingle = src._unwrapSingle;
}
/**
* @since 2.6
*/
protected ArraySerializerBase(ArraySerializerBase<?> src, BeanProperty property,
Boolean unwrapSingle)
{
super(src._handledType, false);
_property = property;
_unwrapSingle = unwrapSingle;
}
/**
* @deprecated Since 2.6
*/
@Deprecated
protected ArraySerializerBase(ArraySerializerBase<?> src, BeanProperty property)
{
super(src._handledType, false);
_property = property;
_unwrapSingle = src._unwrapSingle;
}
/**
* @since 2.6
*/
public abstract JsonSerializer<?> _withResolved(BeanProperty prop,
Boolean unwrapSingle);
@Override
public JsonSerializer<?> createContextual(SerializerProvider serializers,
BeanProperty property) throws JsonMappingException
{
Boolean unwrapSingle = null;
// First: if we have a property, may have property-annotation overrides
if (property != null) {
JsonFormat.Value format = findFormatOverrides(serializers, property, handledType());
if (format != null) {
unwrapSingle = format.getFeature(JsonFormat.Feature.WRITE_SINGLE_ELEM_ARRAYS_UNWRAPPED);
if (unwrapSingle != _unwrapSingle) {
return _withResolved(property, unwrapSingle);
}
}
}
return this;
}
// NOTE: as of 2.5, sub-classes SHOULD override (in 2.4 and before, was final),
// at least if they can provide access to actual size of value and use `writeStartArray()`
// variant that passes size of array to output, which is helpful with some data formats
@Override
public void serialize(T value, JsonGenerator gen, SerializerProvider provider) throws IOException
{
if (_shouldUnwrapSingle(provider)) {
if (hasSingleElement(value)) {
serializeContents(value, gen, provider);
return;
}
}
gen.setCurrentValue(value);
gen.writeStartArray();
// [databind#631]: Assign current value, to be accessible by custom serializers
serializeContents(value, gen, provider);
gen.writeEndArray();
}
@Override
public final void serializeWithType(T value, JsonGenerator g, SerializerProvider provider,
TypeSerializer typeSer)
throws IOException
{
// [databind#631]: Assign current value, to be accessible by custom serializers
g.setCurrentValue(value);
WritableTypeId typeIdDef = typeSer.writeTypePrefix(g,
typeSer.typeId(value, JsonToken.START_ARRAY));
serializeContents(value, g, provider);
typeSer.writeTypeSuffix(g, typeIdDef);
}
protected abstract void serializeContents(T value, JsonGenerator jgen, SerializerProvider provider)
throws IOException;
/**
* @since 2.9
*/
protected final boolean _shouldUnwrapSingle(SerializerProvider provider) {
if (_unwrapSingle == null) {
return provider.isEnabled(SerializationFeature.WRITE_SINGLE_ELEM_ARRAYS_UNWRAPPED);
}
return _unwrapSingle.booleanValue();
}
}
| [
"lenzhao@yahoo.com"
] | lenzhao@yahoo.com |
6e42e253013ec8a2040dc93c0b946f7a0e9aeb85 | 4e39430923c6b45fbf12ed4ca74b1b45f8e72f07 | /customeview/src/main/java/com/ishuangniu/customeview/widgets/CustomProgressBar.java | 72b6b25218ced8bbde8c5169551ce9f069e3cf3e | [] | no_license | SmilingBoy/MyLib | 5f694d427d855b6a8b3989e835ba96e31446860d | ea67ba4a1c369289c87eb6daa3afca0b4b2043c2 | refs/heads/master | 2020-04-07T22:26:47.636694 | 2018-11-23T02:35:05 | 2018-11-23T02:35:05 | 158,770,570 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,378 | java | package com.ishuangniu.customeview.widgets;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.Rect;
import android.graphics.RectF;
import android.os.Looper;
import android.text.TextPaint;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.View;
import com.ishuangniu.customeview.R;
public class CustomProgressBar extends View {
private Paint mPaint;
private TextPaint mTextPaint;
private int mRadius;
private int mProgressColor;
private int mProgressDescColor;
private int mMax;
private int mProgress;
private int mBorderWidth;
private boolean mIsShowDesc;
private int DEFAULT_MAX = 10;
private int DEFAULT_PROGRESS = 0;
private int DEFAULT_RADIUS = (int) TypedValue.applyDimension(
TypedValue.COMPLEX_UNIT_DIP, 5, getResources().getDisplayMetrics());
private int DEFAULT_BORDER_COLOR = Color.parseColor("#FE78A6");
private int DEFAULT_PROGRESS_COLOR = Color.parseColor("#FE78A6");
private int DEFAULT_PROGRESS_DESC_COLOR = Color.parseColor("#B4B4B4");
private int DEFAULT_BORDER_WIDTH = (int) TypedValue.applyDimension(
TypedValue.COMPLEX_UNIT_DIP, 1, getResources().getDisplayMetrics());
private boolean DEFAULT_ISSHOWDESC = true;
private int mWidth;
private int mHeight;
private Rect mTextBounds;
private String mProgressDesc = "";
private OnFinishedListener mOnFinishedListener;
private OnAnimationEndListener mOnAnimationEndListener;
/**
* set finish listener
*
* @param onFinishedListener
*/
public void setOnFinishedListener(OnFinishedListener onFinishedListener) {
mOnFinishedListener = onFinishedListener;
}
/**
* set animation end listener
*
* @param onAnimationEndListener
*/
public void setOnAnimationEndListener(OnAnimationEndListener onAnimationEndListener) {
mOnAnimationEndListener = onAnimationEndListener;
}
public CustomProgressBar(Context context) {
this(context, null);
}
public CustomProgressBar(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public CustomProgressBar(Context context, AttributeSet attrs,
int defStyleAttr) {
super(context, attrs, defStyleAttr);
TypedArray a = context.obtainStyledAttributes(attrs,
R.styleable.CustomProgressBar);
try {
mMax = a.getInt(R.styleable.CustomProgressBar_max, DEFAULT_MAX);
mProgress = a.getInt(R.styleable.CustomProgressBar_progress,
DEFAULT_PROGRESS);
mRadius = (int) a.getDimension(
R.styleable.CustomProgressBar_progressRadius, DEFAULT_RADIUS);
mProgressColor = a.getColor(
R.styleable.CustomProgressBar_progressColor,
DEFAULT_PROGRESS_COLOR);
mProgressDescColor = a.getColor(
R.styleable.CustomProgressBar_progressDescColor,
DEFAULT_PROGRESS_DESC_COLOR);
mBorderWidth = (int) a.getDimension(
R.styleable.CustomProgressBar_borderWidth,
DEFAULT_BORDER_WIDTH);
mProgressDesc = a
.getString(R.styleable.CustomProgressBar_progressDesc);
mIsShowDesc = a.getBoolean(R.styleable.CustomProgressBar_isShowDesc, DEFAULT_ISSHOWDESC);
} finally {
a.recycle();
}
init();
}
private void init() {
mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mTextBounds = new Rect();
mTextPaint = new TextPaint(Paint.ANTI_ALIAS_FLAG);
mTextPaint.setTextSize(TypedValue.applyDimension(
TypedValue.COMPLEX_UNIT_SP, 14, getResources()
.getDisplayMetrics()));
mTextPaint.setColor(mProgressDescColor);
}
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
mWidth = w;
mHeight = h;
}
@Override
protected void onDraw(Canvas canvas) {
drawBorder(canvas);
drawProgress(canvas);
if (mIsShowDesc) {
drawProgressDesc(canvas);
}
}
private void drawBorder(Canvas canvas) {
mPaint.reset();
mPaint.setStyle(Paint.Style.STROKE);
mPaint.setStrokeJoin(Paint.Join.MITER);
mPaint.setAntiAlias(true);
mPaint.setColor(mProgressColor);
mPaint.setStrokeWidth(mBorderWidth);
int left = mBorderWidth / 2;
int top = mBorderWidth / 2;
int right = mWidth - mBorderWidth / 2;
int bottom = mHeight - mBorderWidth / 2;
Path path = new Path();
path.moveTo(left + mRadius, top);
path.lineTo(right - mRadius, top);
path.arcTo(
new RectF(right - 2 * mRadius, top, right, top + 2 * mRadius),
-90, 90);
path.lineTo(right, bottom - mRadius);
path.arcTo(new RectF(right - 2 * mRadius, bottom - 2 * mRadius, right,
bottom), 0, 90);
path.lineTo(left + mRadius, bottom);
path.arcTo(new RectF(left, bottom - 2 * mRadius, left + 2 * mRadius,
bottom), 90, 90);
path.lineTo(left, top + mRadius);
path.arcTo(new RectF(left, top, left + 2 * mRadius, top + 2 * mRadius),
180, 90);
path.close();
canvas.drawPath(path, mPaint);
}
private void drawProgress(Canvas canvas) {
mPaint.reset();
mPaint.setStyle(Paint.Style.FILL);
mPaint.setAntiAlias(true);
mPaint.setColor(mProgressColor);
mPaint.setStrokeWidth(mBorderWidth);
float left = mBorderWidth * .5f;
float top = mBorderWidth * .5f;
float right = mWidth - mBorderWidth * .5f;
float bottom = mHeight - mBorderWidth * .5f;
Path path = new Path();
path.moveTo(left, top + mRadius);
float scale = (mProgress * 1.f / mMax)
/ (mRadius * 1.f / (right - left));
float scale2 = (mProgress * 1.f / mMax)
/ ((right - mRadius) * 1.f / (right - left));
if (scale <= 1) {
float a = scale * mRadius;
double angle = Math.acos((mRadius - a) / mRadius);
path.arcTo(new RectF(left, top, left + 2 * mRadius, top + 2
* mRadius), 180, (float) (angle * 180 / Math.PI));
float y = (float) (Math.pow(
Math.pow(mRadius, 2) - Math.pow((a - mRadius), 2), 0.5)
+ bottom - mRadius);
path.lineTo(left + a, y);
path.arcTo(new RectF(left, bottom - 2 * mRadius,
left + 2 * mRadius, bottom),
180 - (float) (angle * 180 / Math.PI),
(float) (angle * 180 / Math.PI));
path.close();
canvas.drawPath(path, mPaint);
} else if (scale2 <= 1) {
path.arcTo(new RectF(left, top, left + 2 * mRadius, top + 2
* mRadius), 180, 90);
path.lineTo(left + (mProgress * 1.f / mMax) * (right - left), top);
path.lineTo(left + (mProgress * 1.f / mMax) * (right - left),
bottom);
path.lineTo(left + mRadius, bottom);
path.arcTo(new RectF(left, bottom - 2 * mRadius,
left + 2 * mRadius, bottom), 90, 90);
path.close();
canvas.drawPath(path, mPaint);
} else {
float a = (mProgress * 1.f / mMax) * (right - left)
- (right - mRadius);
double angle = Math.asin(a / mRadius);
path.arcTo(new RectF(left, top, left + 2 * mRadius, top + 2
* mRadius), 180, 90);
path.lineTo(right - mRadius, top);
path.arcTo(new RectF(right - 2 * mRadius, top, right, top + 2
* mRadius), -90, (float) (angle * 180 / Math.PI));
double y = Math.pow((Math.pow(mRadius, 2) - Math.pow(a, 2)), .5)
+ top + mRadius;
path.lineTo(right - mRadius + a, (float) y);
path.arcTo(new RectF(right - 2 * mRadius, bottom - 2 * mRadius,
right, bottom), (float) (90 - (angle * 180 / Math.PI)),
(float) (angle * 180 / Math.PI));
path.lineTo(left + mRadius, bottom);
path.arcTo(new RectF(left, bottom - 2 * mRadius,
left + 2 * mRadius, bottom), 90, 90);
path.close();
canvas.drawPath(path, mPaint);
}
}
private void drawProgressDesc(Canvas canvas) {
// String finalProgressDesc = mProgressDesc + " " + mProgress + "/" + mMax;
String finalProgressDesc = mProgressDesc + mProgress + "%";
mTextPaint.getTextBounds(finalProgressDesc, 0,
finalProgressDesc.length(), mTextBounds);
canvas.drawText(finalProgressDesc, (int) (mWidth / 2.0 - mTextBounds.width() / 2.0),
(int) (mHeight / 2.0 - (mTextPaint.ascent() + mTextPaint.descent()) / 2.0f),
mTextPaint);
}
public void setMaxProgress(int max) {
mMax = max < 0 ? 0 : max;
invalidateView();
}
private void setProgress(int progress) {
mProgress = progress > mMax ? mMax : progress;
invalidateView();
if (mProgress >= mMax && mOnFinishedListener != null) {
mOnFinishedListener.onFinish();
}
}
/**
* 得到ProgressBar的最大进度
*
* @return
*/
public int getMax() {
return mMax;
}
/**
* 获取当前ProgressBar的进度
*
* @return
*/
public final int getProgress() {
return mProgress;
}
public void setProgressDesc(String desc) {
mProgressDesc = desc;
invalidateView();
}
/**
* 设置当前进度条的进度(默认动画时间1.5s)
*
* @param progress
*/
public void setCurProgress(final int progress) {
ObjectAnimator animator = ObjectAnimator.ofInt(this, "progress", progress).setDuration(1500);
animator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
if (mOnAnimationEndListener != null) {
mOnAnimationEndListener.onAnimationEnd();
}
}
});
animator.start();
}
/**
* 设置当前进度条的进度
*
* @param progress 目标进度
* @param duration 动画时长
*/
public void setCurProgress(final int progress, long duration) {
ObjectAnimator animator = ObjectAnimator.ofInt(this, "progress", progress).setDuration(duration);
animator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
if (mOnAnimationEndListener != null) {
mOnAnimationEndListener.onAnimationEnd();
}
}
});
animator.start();
}
/**
* 设置ProgressBar的颜色
*
* @param color
*/
public void setProgressColor(int color) {
mProgressColor = color;
invalidateView();
}
/**
* 设置是否显示当前进度
*
* @param isShowDesc true:显示
*/
public void setIsShowDesc(boolean isShowDesc) {
mIsShowDesc = isShowDesc;
invalidateView();
}
private void invalidateView() {
if (Looper.getMainLooper() == Looper.myLooper()) {
invalidate();
} else {
postInvalidate();
}
}
public interface OnFinishedListener {
void onFinish();
}
public interface OnAnimationEndListener {
void onAnimationEnd();
}
} | [
"18463384056@163.com"
] | 18463384056@163.com |
7ddea54d2d6ef60394f951c3122b792ec59939af | c019fcfdc9d44ac35840c7edaa141677e5aedeb1 | /Core/src/core/impl/dao/PagamentoTesteDAO.java | 9c0fe7a232201d4ab90668262c9bea78441d6f94 | [] | no_license | Skye41/projetolivros | a0d4546eb9cff4ce7985cfb7a06d738a3e6eb83c | 3be7d7208571d1677a370bcb44ab9a71ac65c970 | refs/heads/master | 2020-03-23T04:19:51.332461 | 2018-07-16T02:27:47 | 2018-07-16T02:27:47 | 141,070,804 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,227 | 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 core.impl.dao;
import dominio.EntidadeDominio;
import dominio.PagamentoTeste;
import dominio.StatusPedido;
import java.sql.SQLException;
import java.util.List;
/**
*
* @author Ana Miani
*/
public class PagamentoTesteDAO extends AbstractJdbcDAO
{
public PagamentoTesteDAO()
{
super("", "");
}
@Override
public void salvar(EntidadeDominio entidade) throws SQLException
{
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public void alterar(EntidadeDominio entidade) throws SQLException
{
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public List<EntidadeDominio> consultar(EntidadeDominio entidade) throws SQLException
{
PagamentoTeste pt = (PagamentoTeste)entidade;
new PedidoDAO().alterar(pt.getPedido());
return null;
}
}
| [
"Skye41@users.noreply.github.com"
] | Skye41@users.noreply.github.com |
b8f2052ba63d91915fb1b1d12bac915c5a683b0a | 05948ca1cd3c0d2bcd65056d691c4d1b2e795318 | /classes2/com/xiaoenai/app/classes/street/pay/a/l.java | cf2b859787622a4f1ebcae00adde2695af636682 | [] | no_license | waterwitness/xiaoenai | 356a1163f422c882cabe57c0cd3427e0600ff136 | d24c4d457d6ea9281a8a789bc3a29905b06002c6 | refs/heads/master | 2021-01-10T22:14:17.059983 | 2016-10-08T08:39:11 | 2016-10-08T08:39:11 | 70,317,042 | 0 | 8 | null | null | null | null | UTF-8 | Java | false | false | 845 | java | package com.xiaoenai.app.classes.street.pay.a;
import android.content.Context;
import com.xiaoenai.app.net.m;
import org.json.JSONObject;
class l
extends m
{
l(k paramk, Context paramContext, f paramf)
{
super(paramContext);
}
public void a()
{
super.a();
this.a.a();
}
public void a(int paramInt)
{
super.a(paramInt);
this.a.a(false, null);
}
public void a(com.xiaoenai.app.net.k paramk)
{
super.a(paramk);
this.a.a(false, null);
}
public void a(JSONObject paramJSONObject)
{
super.a(paramJSONObject);
this.a.a(paramJSONObject.optBoolean("success", false), paramJSONObject);
}
}
/* Location: E:\apk\xiaoenai2\classes2-dex2jar.jar!\com\xiaoenai\app\classes\street\pay\a\l.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"1776098770@qq.com"
] | 1776098770@qq.com |
b5386bfe0e38d982d6dabfe1998eb12021f11633 | 1aae1f206a40972dcf103c816c3d2423bd508937 | /app/src/main/java/com/example/rajpa/fblogindemo/CustomApplication.java | dc567a6424ffdb3d98a4d80fdc167706997f8552 | [] | no_license | PratikVishwakarma/CompareDemo | 100c80b4c6c4e8f2881be2eb5f36e8930822cf7b | cc5b5b0a53c36998593c41a8c510fbc1f3a1a4af | refs/heads/master | 2021-01-12T11:56:44.820318 | 2016-11-24T08:33:31 | 2016-11-24T08:33:31 | 68,846,858 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 661 | java | package com.example.rajpa.fblogindemo;
import android.app.Application;
import android.content.Context;
import com.firebase.client.Firebase;
import com.facebook.FacebookSdk;
import com.facebook.appevents.AppEventsLogger;
import com.firebase.client.Firebase;
import com.firebase.client.FirebaseApp;
import com.google.firebase.FirebaseOptions;
/**
* Created by rajpa on 03-Sep-16.
*/
public class CustomApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
Firebase.setAndroidContext(this);
FacebookSdk.sdkInitialize(getApplicationContext());
AppEventsLogger.activateApp(this);
}
}
| [
"pratikvishwakarma00@gmail.com"
] | pratikvishwakarma00@gmail.com |
1afc1cae643825bedffbf413e89f193d5451c7be | ac776e9a87d576e6f5b4c077454e4ab90f60e285 | /web/src/main/java/org/fao/geonet/kernel/harvest/harvester/arcsde/ArcSDEParams.java | b3d904b08c3dcd4ade4b91497ed6d2ee1cc02b0e | [] | no_license | juanluisrp/geonetwork-eea | dbd2d15edd48196405ab3b33ea9b7fc7de306133 | dfcff945b294bf03a0c6e5a8cc108227bc24ef5a | refs/heads/master | 2023-05-13T14:36:49.996146 | 2017-01-13T11:33:07 | 2017-01-13T11:33:07 | 119,503,199 | 0 | 0 | null | 2018-01-30T08:06:16 | 2018-01-30T08:06:16 | null | UTF-8 | Java | false | false | 4,264 | java | //=============================================================================
//=== Copyright (C) 2001-2009 Food and Agriculture Organization of the
//=== United Nations (FAO-UN), United Nations World Food Programme (WFP)
//=== and United Nations Environment Programme (UNEP)
//===
//=== This program is free software; you can redistribute it and/or modify
//=== it under the terms of the GNU General Public License as published by
//=== the Free Software Foundation; either version 2 of the License, or (at
//=== your option) any later version.
//===
//=== This program is distributed in the hope that it will be useful, but
//=== WITHOUT ANY WARRANTY; without even the implied warranty of
//=== MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
//=== General Public License for more details.
//===
//=== You should have received a copy of the GNU General Public License
//=== along with this program; if not, write to the Free Software
//=== Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
//===
//=== Contact: Jeroen Ticheler - FAO - Viale delle Terme di Caracalla 2,
//=== Rome - Italy. email: geonetwork@osgeo.org
//==============================================================================
package org.fao.geonet.kernel.harvest.harvester.arcsde;
import jeeves.exceptions.BadInputEx;
import jeeves.utils.Util;
import org.fao.geonet.kernel.DataManager;
import org.fao.geonet.kernel.harvest.harvester.AbstractParams;
import org.jdom.Element;
/**
*
* @author heikki doeleman
*
*/
public class ArcSDEParams extends AbstractParams {
/**
* Name of the ArcSDE server.
*/
public String server;
/**
* Port number to use for connecting to the ArcSDE server ("instance").
*/
public int port;
/**
* Username for the ArcSDE database.
*/
public String username;
/**
* Password for the username to the ArcSDE database.
*/
public String password;
/**
* Name of the ArcSDE database.
*/
public String database;
public String icon;
public ArcSDEParams(DataManager dm) {
super(dm);
}
/**---------------------------------------------------------------------------
//---
//--- Create : called when a new entry must be added. Reads values from the
//--- provided entry, providing default values
//---
//--------------------------------------------------------------------------- */
public void create(Element node) throws BadInputEx {
super.create(node);
Element site = node.getChild("site");
server = Util.getParam(site, "server", "");
port = Util.getParam(site, "port", 0);
username = Util.getParam(site, "username", "");
password = Util.getParam(site, "password", "");
database = Util.getParam(site, "database", "");
icon = Util.getParam(site, "icon", "arcsde.gif");
System.out.println("arcsdeparams create: " + server + ":" + port + " " + username + " " + password + " " + database);
}
//---------------------------------------------------------------------------
//---
//--- Update : called when an entry has changed and variables must be updated
//---
//---------------------------------------------------------------------------
public void update(Element node) throws BadInputEx {
super.update(node);
Element site = node.getChild("site");
server = Util.getParam(site, "server", "");
port = Util.getParam(site, "port", 5151);
username = Util.getParam(site, "username", "");
password = Util.getParam(site, "password", "");
database = Util.getParam(site, "database", "");
icon = Util.getParam(site, "icon", "arcsde.gif");
System.out.println("arcsdeparams update: " + server + ":" + port + " " + username + " " + password + " " + database);
}
//---------------------------------------------------------------------------
//---
//--- Private methods
//---
//---------------------------------------------------------------------------
public ArcSDEParams copy() {
ArcSDEParams copy = new ArcSDEParams(dm);
copyTo(copy);
copy.icon = icon;
copy.server = server;
copy.port = port;
copy.username = username;
copy.password = password;
copy.database = database;
return copy;
}
}
| [
"heikkidoeleman@ff403467-3f20-0410-99e5-ff581e626a08"
] | heikkidoeleman@ff403467-3f20-0410-99e5-ff581e626a08 |
a14d3813531e56e8fee5602989ce613ea7138ac3 | be3bff6f518c45484d3349bcf817ae4eab104e86 | /week2-025.SumOfThreeNumbers/src/SumOfThreeNumbers.java | 79320e3c0bcb4e1817f9f5e5bbb0e75bc54d712d | [] | no_license | daxwann/Java_MOOC_Part_1 | 9617c2cb54e1508ac9f935fdd1f91587ac18b523 | f0f832f2226be2d08ebaa72ff624e153b7f33dc0 | refs/heads/master | 2020-11-28T15:44:28.793011 | 2020-01-02T00:36:57 | 2020-01-02T00:36:57 | 229,858,907 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 724 | java |
import java.util.Scanner;
public class SumOfThreeNumbers {
public static void main(String[] args) {
Scanner reader = new Scanner(System.in);
int sum = 0;
int read; // store numbers read form user in this variable
// Write your program here
// Use only variables sum and read
System.out.print("Type the first number: ");
sum += Integer.parseInt(reader.nextLine());
System.out.print("Type the second number: ");
sum += Integer.parseInt(reader.nextLine());
System.out.print("Type the third number: ");
sum += Integer.parseInt(reader.nextLine());
System.out.println("");
System.out.println("Sum: " + sum);
}
}
| [
"daxwann@gmail.com"
] | daxwann@gmail.com |
c20dfba9e50f5a5a313dc5ef71425ce91966346b | d1a68de4dad3cf81b273036f5d4293d85b599245 | /src/test/java/com/hrms/pages/SaucePageDemo.java | c0ab32817c6c7a2c6b893a3f2f3241b74437985c | [] | no_license | Gul-Ince/HRMS_CUCUMBER | a3a5ac71fe922bbe464a741627cd9d1eeba85e4c | 2210a0d191bc1066633c2b9890d49d530f926f0a | refs/heads/master | 2023-04-17T12:31:30.975292 | 2020-07-23T01:22:15 | 2020-07-23T01:22:15 | 281,522,778 | 0 | 0 | null | 2021-04-26T20:30:40 | 2020-07-21T23:05:13 | HTML | UTF-8 | Java | false | false | 653 | java | package com.hrms.pages;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;
import com.hrms.testbase.BaseClass;
public class SaucePageDemo {
@FindBy (id="user-name")
public WebElement userName;
@FindBy (id="password")
public WebElement password;
@FindBy (xpath="//input [@value='LOGIN']")
public WebElement LoginBTN;
@FindBy (xpath="//div [text()='Products']")
public WebElement productLogo;
@FindBy (xpath="//h3 [@data-test='error']")
public WebElement errorMEssage;
public SaucePageDemo() {
PageFactory.initElements(BaseClass.driver, this);
}
}
| [
"gulsumshaz@gmail.com"
] | gulsumshaz@gmail.com |
cf03bacf1d2135adda2f388464dd6186891691bc | ae86cc52f04e7ebfb2196a41708d002801a33f07 | /src/main/java/com/computerservice/service/authentication/UserDetailsService.java | 957e9359bcb7c3729006fffd647b15e7d86d8a8f | [] | no_license | HellaxA/ComputerService | ca9137e5e0906cf7a78df0b776093bf5c1c797da | 9b48e3e09da796bac3bc24411ee20a190ea33409 | refs/heads/master | 2023-04-24T07:29:11.821397 | 2021-05-13T23:40:26 | 2021-05-13T23:40:26 | 352,374,665 | 0 | 0 | null | 2021-05-13T23:40:26 | 2021-03-28T16:06:01 | Java | UTF-8 | Java | false | false | 221 | java | package com.computerservice.service.authentication;
import com.computerservice.entity.authentication.CustomUserDetails;
public interface UserDetailsService {
CustomUserDetails loadUserByUsername(String username);
}
| [
"abereznikov64@gmail.com"
] | abereznikov64@gmail.com |
d37d39e2b519ed24ad1c622f7c826d60ba3027aa | 45456cebbec27684596dc2e932bbccbdde2b9ff2 | /src/main/java/io/banditoz/mchelper/commands/HeapDumpCommand.java | 0f9fee10dce63b6e1465c0c5239d32a8507d092f | [
"Apache-2.0"
] | permissive | HeyBanditoz/mchelper | 71ee1542b7902ecf8d394aee8039921489bba6d6 | 717a27e2edb23e9a6fc4c33cc82cdd1c388d03cf | refs/heads/master | 2023-09-05T13:58:35.454635 | 2023-09-05T05:20:52 | 2023-09-05T05:20:52 | 227,871,432 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,747 | java | package io.banditoz.mchelper.commands;
import com.sun.management.HotSpotDiagnosticMXBean;
import io.banditoz.mchelper.commands.logic.CommandEvent;
import io.banditoz.mchelper.commands.logic.ElevatedCommand;
import io.banditoz.mchelper.stats.Status;
import io.banditoz.mchelper.utils.Help;
import javax.management.MBeanServer;
import java.lang.management.ManagementFactory;
import java.time.OffsetDateTime;
import java.time.format.DateTimeFormatter;
public class HeapDumpCommand extends ElevatedCommand {
@Override
public String commandName() {
return "heapdump";
}
@Override
public Help getHelp() {
return new Help(commandName(), true).withParameters("<boolean>")
.withDescription("Dumps the heap.");
}
@Override
protected Status onCommand(CommandEvent ce) throws Exception {
boolean live;
String fileName;
if (ce.getCommandArgs().length == 1) {
live = true;
}
else {
live = Boolean.parseBoolean(ce.getCommandArgs()[1]);
}
fileName = "./heapdump-" + OffsetDateTime.now().format(DateTimeFormatter.ISO_INSTANT) + (live ? "-true" : "-false") + ".hprof";
long before = System.nanoTime();
MBeanServer server = ManagementFactory.getPlatformMBeanServer();
HotSpotDiagnosticMXBean mxBean = ManagementFactory.newPlatformMXBeanProxy(
server, "com.sun.management:type=HotSpotDiagnostic", HotSpotDiagnosticMXBean.class);
mxBean.dumpHeap(fileName, live);
long after = System.nanoTime() - before;
ce.sendReply("Done. Heap dump (with filename `" + fileName + "`) created in " + (after / 1000000) + " ms.");
return Status.SUCCESS;
}
}
| [
"banditoz@protonmail.com"
] | banditoz@protonmail.com |
cb9a510111e39a8a6e2a3d67f969d0fccc857f4e | a212aa877621594abe4c2c35ab7ef5351c1c5deb | /src/com/luv2code/springdemo/CricketFortuneService.java | 6a25a4ba79ed647c0e1f0ecd52c20842e2204a72 | [] | no_license | gagan-preet96/Learn-Spring | 4b6dc3207143e58b64d734baf13097c06dee2fca | b22e235132d49459c99015d044665a02978c6e3c | refs/heads/master | 2021-02-28T05:11:29.584678 | 2020-03-12T17:59:49 | 2020-03-12T17:59:49 | 245,664,516 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 186 | java | package com.luv2code.springdemo;
public class CricketFortuneService implements FortuneService {
@Override
public String getFortune() {
return "Practice makes a man perfect";
}
}
| [
"gagan20683@gmail.com"
] | gagan20683@gmail.com |
0c7adf72a343121497f33aa49edee532221b41ca | 4328591903c648d79b01d41845cc8784ef2b01ce | /ocPortal/src/main/java/com/winston/portal/vo/CourseSectionVO.java | ceb42abbb90f39a3ee23673877e2f79581f2a7cd | [] | no_license | WinstonShaco/ocProject | fb22ebb15c2465287051a59764402af0017c1fd8 | 2d6ab31ae8d5c112992d479e2a1374e2c5d28fa5 | refs/heads/master | 2020-03-17T05:51:30.441844 | 2018-05-19T10:14:12 | 2018-05-19T10:14:12 | 133,331,345 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 526 | java | package com.winston.portal.vo;
import com.winston.core.course.domain.CourseSection;
import java.util.ArrayList;
import java.util.List;
/**
* 课程章节
*/
public class CourseSectionVO extends CourseSection{
private static final long serialVersionUID = 180753077428934254L;
//小节
private List<CourseSection> sections = new ArrayList<CourseSection>();
public List<CourseSection> getSections() {
return sections;
}
public void setSections(List<CourseSection> sections) {
this.sections = sections;
}
}
| [
"670511516@qq.com"
] | 670511516@qq.com |
533f694e39cafb293f4268a3bf95b28ceb868585 | 8814289047779ddc3be3b96c287b146ace2c3d7c | /src/main/java/com/accounts/api/AccountsAPI/exceptions/model/ExceptionResponse.java | 4ceb8eee4cc1e0fe86ebbba682a9a0ffb90c0df4 | [] | no_license | vineetjain999/AccountsAPIMS | f078bdf1feff696fa0c244d84f1a08a39849168b | ceb359c7b8ff65a8348f2ca8b6747fc08e50eb04 | refs/heads/master | 2020-05-16T00:26:06.525254 | 2020-04-13T23:36:07 | 2020-04-13T23:36:07 | 182,579,435 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 745 | java | package com.accounts.api.AccountsAPI.exceptions.model;
import java.util.Date;
public class ExceptionResponse {
private String message;
private Date timeStamp;
private String details;
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public Date getTimeStamp() {
return timeStamp;
}
public void setTimeStamp(Date timeStamp) {
this.timeStamp = timeStamp;
}
public String getDetails() {
return details;
}
public void setDetails(String details) {
this.details = details;
}
public ExceptionResponse(String message, Date timeStamp, String details) {
super();
this.message = message;
this.timeStamp = timeStamp;
this.details = details;
}
}
| [
"vineet.jain1@publicissapient.com"
] | vineet.jain1@publicissapient.com |
e85d2e5a83719689b7b6f075260cac6af719583b | 4385682c65371142304a79647f050ec22bc599a2 | /lyy/app/src/main/java/com/lyy/SectionPageAdapter.java | 1dd87c8fc9617e7090120f31643b4ab53abe411a | [] | no_license | yongyeon-lee/lyy | 6ed22f53b96a4ed2681369f137d9a9435c133631 | 7210cc7bea795e75beb5951835c51052cb0bbb95 | refs/heads/master | 2023-01-01T13:52:32.343531 | 2020-10-20T07:39:33 | 2020-10-20T07:39:33 | 304,876,342 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 926 | java | package com.lyy;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;
import java.util.ArrayList;
import java.util.List;
public class SectionPageAdapter extends FragmentPagerAdapter {
private final List<Fragment> mFragmentList = new ArrayList<>();
private final List<String> mFragmentTitleList = new ArrayList<>();
public void addFragment(Fragment fragment, String title){
mFragmentList.add(fragment);
mFragmentTitleList.add(title);
}
public CharSequence getPageTitle(int position) {
return mFragmentTitleList.get(position);
}
public SectionPageAdapter(FragmentManager fm){
super(fm);
}
@Override
public Fragment getItem(int position) { return mFragmentList.get(position); }
@Override
public int getCount() {
return mFragmentList.size() ;
}
}
| [
"dldyddus04@gmail.com"
] | dldyddus04@gmail.com |
7dc71d925e25920788757654e760180b3c104ce0 | d5f171cec912ca816c04cfd5b2f0e920cb75bf67 | /ucst-core/src/main/java/com/dvf/ucst/core/SectionIdString.java | 458e1ee01e86cef8885a3f87caac916d03b9478b | [
"MIT"
] | permissive | david-fong/UbcCourseSchedulingTool | 44025aa509221cb1aef4ea38f1d2e8b9dea014f0 | bca5d96f20799cc9af34c5307efc2c4895f4a2d3 | refs/heads/master | 2021-06-23T12:24:17.409702 | 2019-08-25T23:53:12 | 2019-08-25T23:53:12 | 196,270,163 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 248 | java | package com.dvf.ucst.core;
public interface SectionIdString {
// includes campus ID token.
String getSystemFullSectionIdString();
// excludes campus ID token. User's don't care about that.
String getUserFullSectionIdString();
}
| [
"davidfong19@gmail.com"
] | davidfong19@gmail.com |
12d362995b9dcf36b5e0b2b54e0df0ada1bdb7e3 | 2ad8dd6ef15c83708f5f4a361cf13d1ba560063c | /src/com/lotto/web/Domains/ConsumerBean.java | 1d6b3886d0f4e584b2879b352f027c95e799e8f8 | [] | no_license | dnflwhr1004/jee-Lotto | a29f5dcdd5b5f4e7d0db6a752139f63ada5d5598 | 9b931370e7ef90fc880fedf640b5be3235819a1c | refs/heads/master | 2020-07-16T15:41:01.000417 | 2019-09-02T09:02:13 | 2019-09-02T09:02:13 | 205,817,314 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 861 | java | package com.lotto.web.Domains;
import java.io.Serializable;
public class ConsumerBean implements Serializable{
private static final long serialVersionUID = 1L;
private String cid, pass, lottoSeq, prizeMoney;
public String getCid() {
return cid;
}
public void setCid(String cid) {
this.cid = cid;
}
public String getPass() {
return pass;
}
public void setPass(String pass) {
this.pass = pass;
}
public String getLottoSeq() {
return lottoSeq;
}
public void setLottoSeq(String lottoSeq) {
this.lottoSeq = lottoSeq;
}
public String getPrizeMoney() {
return prizeMoney;
}
public void setPrizeMoney(String prizeMoney) {
this.prizeMoney = prizeMoney;
}
@Override
public String toString() {
return "ConsumerBean [cid=" + cid + ", pass=" + pass + ", lottoSeq=" + lottoSeq + ", prizeMoney=" + prizeMoney
+ "]";
}
}
| [
"dnflwhr1004@gmail.com"
] | dnflwhr1004@gmail.com |
8726f419cf1abd8e275ff264ab2112287d9f2a6a | 09735a36caad7a2db86b6021edcd7a272b0987ab | /src/main/java/org/openmhealth/data/generator/domain/BoundedRandomVariable.java | 92ec2db7ec18e7e800f14528e921eb4535fb14d0 | [] | no_license | danmowusheng/health-data-generator-sample | 0f761087ec4d5dc8b9b165162d3535bed4ffe308 | e9bbd3fb3a6c02cadc4b2a9f2308ecae9819629b | refs/heads/main | 2023-06-17T21:59:09.171003 | 2021-07-20T02:48:37 | 2021-07-20T02:48:37 | 381,564,826 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,498 | java | /*
* Copyright 2014 Open mHealth
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.openmhealth.data.generator.domain;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.security.SecureRandom;
import java.util.Random;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
/**
* A random variable that models normally-distributed real values. If limits are specified, returned values will
* fall between the specified bounds.
*
* @author Emerson Farrugia
*/
// TODO refactor this into a container object that wraps a variable and a trend
public class BoundedRandomVariable {
private static final Random prng = new SecureRandom();
private Double variance = 0.0;
private Double standardDeviation = 0.0;
private Double minimumValue;
private Double maximumValue;
public BoundedRandomVariable() {
}
public BoundedRandomVariable(Double standardDeviation) {
checkNotNull(standardDeviation);
setStandardDeviation(standardDeviation);
}
public BoundedRandomVariable(Double standardDeviation, Double minimumValue, Double maximumValue) {
checkNotNull(standardDeviation);
checkNotNull(minimumValue);
checkNotNull(maximumValue);
checkArgument(minimumValue <= maximumValue);
setStandardDeviation(standardDeviation);
setMinimumValue(minimumValue);
setMaximumValue(maximumValue);
}
@NotNull
@Min(0)
public Double getVariance() {
return variance;
}
public void setVariance(Double variance) {
checkNotNull(variance);
checkArgument(variance >= 0);
this.variance = variance;
this.standardDeviation = Math.sqrt(variance);
}
@NotNull
@Min(0)
public Double getStandardDeviation() {
return standardDeviation;
}
public void setStandardDeviation(Double standardDeviation) {
checkNotNull(standardDeviation);
checkArgument(standardDeviation >= 0);
this.standardDeviation = standardDeviation;
this.variance = Math.pow(standardDeviation, 2.0);
}
/**
* @return a lower bound on the values that can be generated
*/
public Double getMinimumValue() {
return minimumValue;
}
public void setMinimumValue(Double minimumValue) {
checkArgument(minimumValue == null || maximumValue == null || minimumValue <= maximumValue);
this.minimumValue = minimumValue;
}
/**
* @return an upper bound on the values that can be generated
*/
public Double getMaximumValue() {
return maximumValue;
}
public void setMaximumValue(Double maximumValue) {
checkArgument(minimumValue == null || maximumValue == null || minimumValue <= maximumValue);
this.maximumValue = maximumValue;
}
//通过一个随机变量的平均值返回随机值产生的下一个值
/**
* @param mean the mean of the random variable
* @return the next value generated by the random variable
*/
public Double nextValue(Double mean) {
Double nextValue;
do {
nextValue = prng.nextGaussian() * standardDeviation + mean;
if ((minimumValue == null || nextValue >= minimumValue) &&
(maximumValue == null || nextValue <= maximumValue)) {
break;
}
}
while (true);
return nextValue;
}
@Override
public String toString() {
final StringBuilder sb = new StringBuilder("BoundedRandomVariable{");
sb.append("variance=").append(variance);
sb.append(", standardDeviation=").append(standardDeviation);
sb.append(", minimumValue=").append(minimumValue);
sb.append(", maximumValue=").append(maximumValue);
sb.append('}');
return sb.toString();
}
}
| [
"1789831043@qq.com"
] | 1789831043@qq.com |
8fadd67f4668c0dc36e7231dbfc62aa8592e357a | c2a9294dee87b0729da12b7d64ffdd440950316e | /src/com/xysfxy/table/TowWayLinkList.java | 547e6c642ac7a2d54059d484c37acef48bdc3055 | [] | no_license | zhouxu-z/data-structure | 06a0343e8f0b3acb48ddddcbe33d05d3b04a77fc | a74955521741351963fb7ee47dcdde8e702b1c75 | refs/heads/master | 2022-11-28T12:57:47.827886 | 2020-07-31T04:35:38 | 2020-07-31T04:35:38 | 281,092,705 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 4,076 | java | package com.xysfxy.table;
import java.util.Iterator;
/**
* @Auther: 周宝辉
* @Date: 2020/7/14 20:38
* @Description:双向链表
*/
public class TowWayLinkList<T> implements Iterable<T> {
private Node frist;//记录首结点
private Node last;//记录尾结点
private int N;//记录元素的个数
public TowWayLinkList() {
this.frist = new Node(null, null, null);
this.last = null;
this.N = 0;
}
private class Node<T> {
T item;//存放数据
Node pre;//指向上一个结点
Node next;//指向下一个结点
public Node(T item, Node pre, Node next) {
this.item = item;
this.pre = pre;
this.next = next;
}
}
public void clear() {
this.frist.next = null;
this.last = null;
N = 0;
}
public boolean isEampty() {
return N == 0;
}
public int length() {
return N;
}
public T get(int i) {
Node n = frist;
for (int j = 0; j <= i; j++) {
n = n.next;
}
return (T) n.item;
}
public void insert(T t) {
if (isEampty()) {
//链表为空
Node node = new Node(t, frist, null);
last = node;
frist.next = last;
} else {
//链表不为空
Node node = new Node(t, last, null);
last.next = node;
last = node;
}
N++;
}
public void insert(int i, T t) {
Node n = frist;
for (int j = 0; j <= i - 1; j++) {
n = n.next;
}
Node nload = n.next;
Node newNode = new Node(t, n, nload);
n.next = newNode;
nload.pre = newNode;
N++;
}
public T remove(int i) {
Node n = frist;
for (int j = 0; j <= i - 1; j++) {
n = n.next;
}
Node nI = n.next;
Node nload = nI.next;
n.next = nload;
nload.pre = n;
N--;
return (T) nI.item;
}
public int indexOf(T t) {
Node n = frist;
for (int i = 0; n.next != null; i++) {
n = n.next;
if (n.item.equals(t)) {
return i;
}
}
return -1;
}
public T getFrist() {
if (isEampty()) {
return null;
}
return (T) frist.next.item;
}
public T getLast() {
if (isEampty()) {
return null;
}
return (T) last.item;
}
@Override
public Iterator<T> iterator() {
return new MyIterator();
}
private class MyIterator implements Iterator<T> {
private Node n;
public MyIterator() {
this.n = frist;
}
@Override
public boolean hasNext() {
return n.next != null;
}
@Override
public T next() {
n = n.next;
return (T) n.item;
}
}
public static void main(String[] args) {
TowWayLinkList<Integer> tl = new TowWayLinkList<>();
tl.insert(1);
tl.insert(2);
tl.insert(4);
tl.insert(5);
for(Integer i : tl){
System.out.print(i + " ");
}
System.out.println();
System.out.println(tl.indexOf(5));
System.out.println("第一个元素" + tl.getFrist());
System.out.println("最后一个元素" + tl.getLast());
System.out.println();
tl.insert(2, 3);
for(Integer i : tl){
System.out.print(i + " ");
}
System.out.println();
boolean eampty = tl.isEampty();
int length = tl.length();
Integer integer = tl.get(2);
System.out.println(eampty + " " + length + " " + integer);
Integer remove = tl.remove(2);
System.out.println(remove);
for(Integer i : tl){
System.out.print(i + " ");
}
System.out.println();
tl.clear();
System.out.println(tl.length());
}
} | [
"zhoubaohui1024@163.com"
] | zhoubaohui1024@163.com |
fcf8630970aef9ec426ec3605122e9335f4b2f7e | 5c1945dd75e38b07f0d2171107a51d3fb7ee8798 | /src/main/java/com/homework/services/BankService.java | 29905654d56104b2f53d30617d00eb50af3e5374 | [] | no_license | beelyl0/HomeworkBank | d6877b6b5a138ef473f90973929d10c9ffa19ea8 | bca1134f729081352d232332c4ad9872a1950a6f | refs/heads/master | 2020-04-26T06:06:53.795642 | 2019-04-15T15:03:53 | 2019-04-15T15:03:53 | 173,354,779 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,785 | java | package com.homework.services;
import com.homework.exceptions.AccountAmountValidationException;
import com.homework.exceptions.AccountFromNotFoundException;
import com.homework.exceptions.AccountOperationNotPermitted;
import com.homework.exceptions.AccountToNotFoundException;
import com.homework.models.Account;
import com.homework.repository.AccountRepository;
import com.homework.repository.impl.AccountInMemoryRepository;
import java.math.BigDecimal;
import static com.homework.generators.AccountNumberGenerator.generateAccountNumber;
public final class BankService {
private final AccountRepository store = AccountInMemoryRepository.getInstance();
public BigDecimal getAmount(String accountNumber) {
Account account = store.get(accountNumber)
.orElseThrow(() -> new AccountFromNotFoundException("Account not found"));
synchronized (account) {
return account.getAmount();
}
}
public String createAccount(BigDecimal amount) {
if (amount == null || amount.signum() == -1) {
throw new AccountAmountValidationException("Amount is not exist or not positive");
}
String accountNumber = generateAccountNumber();
store.save(new Account(accountNumber, amount));
return accountNumber;
}
public void transferAmount(String fromAccountNumber, String toAccountNumber, BigDecimal amount) {
Account fromAccount = store.get(fromAccountNumber)
.orElseThrow(() -> new AccountFromNotFoundException("From account not found"));
Account toAccount = store.get(toAccountNumber)
.orElseThrow(() -> new AccountToNotFoundException("Target account not found"));
if (fromAccount.getAccountNumber().equals(toAccount.getAccountNumber())) {
throw new AccountOperationNotPermitted("From and Target accounts the same");
}
if (amount == null || amount.signum() == -1) {
throw new AccountAmountValidationException("Amount is not exist or not positive");
}
Account[] locks = normalizeAccountOrder(fromAccount, toAccount);
synchronized (locks[0]) {
synchronized (locks[1]) {
BigDecimal newFromAmount = fromAccount.getAmount().subtract(amount);
BigDecimal newToAmount = toAccount.getAmount().add(amount);
fromAccount.setAmount(newFromAmount);
toAccount.setAmount(newToAmount);
}
}
}
private Account[] normalizeAccountOrder(Account first, Account second) {
if (second.getAccountNumber().compareTo(first.getAccountNumber()) > 0) {
return new Account[] {second, first};
}
return new Account[] {first, second};
}
}
| [
"konstantin.salakhov@carggo.com"
] | konstantin.salakhov@carggo.com |
349add244d75fab5e782f12f084341aa7e652ba8 | 9a0f88e4813d52827850bcbb30b16823a5372d4c | /wyait-admin/src/main/java/vip/wyait/admin/aop/AppLogAspect.java | 7a122d58fbe22b4261940f0a5043c1d5739033b8 | [] | no_license | wyait/admin | fed90dad4e715061876df56f8ae4b6f7d6f92fab | bab3a79ed773216baed8345d7a25b7083073b10c | refs/heads/master | 2022-11-28T03:57:30.771014 | 2020-08-07T07:33:50 | 2020-08-07T07:33:50 | 285,718,987 | 12 | 13 | null | null | null | null | UTF-8 | Java | false | false | 12,265 | java | package vip.wyait.admin.aop;
import javassist.*;
import javassist.bytecode.CodeAttribute;
import javassist.bytecode.LocalVariableAttribute;
import org.apache.commons.lang3.StringUtils;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.MDC;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import vip.wyait.admin.utils.Constant;
import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Modifier;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
/**
* @项目名称:wyait
* @类名称:AppLogAspect
* @类描述:mdc记录系统日志
* @创建人:wyait
*/
@Aspect
@Component
public class AppLogAspect {
private static final Logger LOGGER = LoggerFactory
.getLogger(AppLogAspect.class);
// private final static ObjectMapper objectMapper = new ObjectMapper();
private static ThreadLocal<Long> startTime = new ThreadLocal<Long>();
/**
* @Description: 自定义切入点配置
* @Author: wyait
*/
// @Pointcut("(!execution(* com.wyait.vip.controller.demo..*.*(..))) && (execution(* com.wyait.vip.controller..*.*(..))) ")
@Pointcut("(execution(* vip.wyait.admin.controller..*.*(..))) ")
public void webLog() {
}
/**
* @描述:环绕通知--必须返回object,否则目标方法执行后,无返回结果【也可改为前置通知结合后置通知实现】
* 注意:该方法在controller层使用流返回信息的时候,可能会有流冲突问题。尽量使用前置、后置通知记录日志
* @创建人:wyait
*/
@Around("webLog()")
public Object around(JoinPoint joinPoint) {
LOGGER.debug("==前置通知--日志记录==start==");
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder
.getRequestAttributes()).getRequest();
//必须返回object,否则目标方法执行后,无返回结果
Object obj=null;
try {
// 获取请求头中的traceId
String traceId=request.getHeader(Constant.TRACEID);
LOGGER.debug("==请求头header==traceId:{}",traceId);
if(StringUtils.isBlank(traceId) || traceId.length()>50){
//没有,设置traceId
traceId = String.valueOf(UUID.randomUUID());
}
LOGGER.debug("==mdc日志跟踪==traceId:{}",traceId);
MDC.put(Constant.TRACEID,traceId);
//设置请求开始时间在本地线程中
startTime.set(System.currentTimeMillis());
// 请求的IP
String ip = getIpAddr(request);
// 请求域名
String domain = request.getHeader("Host");
// 请求uri
String pageUrl = String.valueOf(request.getRequestURL());
// LOGGER.debug("***==用户登录信息数据:userName:{}", userName);
// 目标类
String targetName = joinPoint.getTarget().getClass().getName();
// LOGGER.debug("===targetName:{}", targetName);
// 目标方法名
String methodName = joinPoint.getSignature().getName();
// LOGGER.debug("===methodName:{}", methodName);
// 请求参数
Object[] arguments = joinPoint.getArgs();
// String params = objectMapper.writeValueAsString(arguments);
// LOGGER.debug("===params:{}", params);
// 获取参数名称和值
Map<String, Object> nameAndArgs = null;
if (null != arguments && arguments.length > 0) {
nameAndArgs = getFieldsName(this.getClass(), targetName,
methodName, arguments);
}
/**
* @Description: 【问题】对象转换为json字符串,需要依赖outputStream流对象;会和controller层response直接返回数据产出冲突,产生异常:<br></br>
* getOutputStream() has already been called for this response
*/
// String params = "";
// try {
// params = (nameAndArgs == null) ? "" : objectMapper
// .writeValueAsString(nameAndArgs);
// params = (nameAndArgs == null) ? "" : nameAndArgs;
// } catch (JsonProcessingException e) {
// // 记录对象转为json异常日志 TODO
//// LOGGER.error(
//// "[error-log]AppLogAspect-before=记录系统日志,对象转为json异常======异常e:{}",
//// e.getMessage());
// }
//执行目标方法
obj=((ProceedingJoinPoint) joinPoint).proceed();
// 计算接口执行时间
// *========日志输出=========*//
LOGGER.info("({})url:{},method:{}.{}(),ip:{},params:{},time:{}ms", domain,
pageUrl, joinPoint.getTarget().getClass().getName(),
joinPoint.getSignature().getName(), ip, nameAndArgs,System.currentTimeMillis()-startTime.get());
LOGGER.debug("==前置通知--日志记录==end==");
} catch (NotFoundException e) {
LOGGER.error(
"[error-log]AppLogAspect-before=记录系统日志异常======异常e:{}",
e.getMessage());
} catch (Throwable throwable) {
LOGGER.error(
"[error-log]AppLogAspect-before=记录系统日志异常======异常e:{}",
throwable.getMessage());
}
return obj;
}
/**
* 计算接口执行时间【Finally增强】
*/
@After("webLog()")
public void doAfter() {
// 处理完请求,清除本次的traceId。mdc是基于ThreadContext实现的【源码】
MDC.clear();
//响应结果
// long costTime = System.currentTimeMillis() - startTime.get();
// LOGGER.debug("====> time:{}ms " ,costTime);
}
/**
* @param joinPoint
* @param e
* @描述:异常通知--用于记录异常日志
* @创建人:wyait
*/
@AfterThrowing(value = "webLog()", throwing = "e")
public void doAfterThrowing(JoinPoint joinPoint, Throwable e) {
LOGGER.debug("==异常通知--用于记录异常日志 ==start==");
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder
.getRequestAttributes()).getRequest();
try {
// 请求的IP
String ip = getIpAddr(request);
// 获取用户请求方法的参数并序列化为JSON格式字符串
// 请求参数
Object[] arguments = joinPoint.getArgs();
String domain = request.getHeader("Host");
String pageUrl = String.valueOf(request.getRequestURL());
// 目标类、目标类方法
String targetName = joinPoint.getTarget().getClass().getName();
String methodName = joinPoint.getSignature().getName();
Map<String, Object> nameAndArgs = null;
if (null != arguments && arguments.length > 0) {
nameAndArgs = getFieldsName(this.getClass(), targetName,
methodName, arguments);
}
/**
* @Description: 【问题】对象转换为json字符串,需要依赖outputStream流对象;会和controller层response直接返回产出冲突,产生异常:<br></br>
* getOutputStream() has already been called for this response
*/
// String params = "";
// try {
// params = (nameAndArgs == null) ? "" : objectMapper
// .writeValueAsString(nameAndArgs);
// } catch (JsonProcessingException je) {
// // 记录本地异常日志 TODO
//// LOGGER.error(
//// "[error-log]AppLogAspect-afterThrowing=记录系统日志,对象转为json异常======异常e:{}",
//// je.getMessage());
// }
// *========日志输出=========*//
LOGGER.error("({})url:{},method:{}.{}(),ip:{},params:{},time:{}ms,exception:{}",
domain, pageUrl,
joinPoint.getTarget().getClass().getName(), joinPoint
.getSignature().getName(), ip, nameAndArgs, System.currentTimeMillis() - startTime.get(), e);
LOGGER.debug("==异常通知--用于记录异常日志 ==end==");
} catch (Exception ex) {
// 记录本地异常日志
LOGGER.error(
"[error-log]AppLogAspect-afterThrowing=记录系统日志异常======异常信息:{}",
ex.getMessage());
}
}
/**
* @param request
* @return
* @描述:获取用户真实IP
* @创建人:wyait
*/
private String getIpAddr(HttpServletRequest request) {
String ipAddress = "";
ipAddress = request.getHeader("x-forwarded-for");
if (ipAddress == null || ipAddress.length() == 0
|| "unknown".equalsIgnoreCase(ipAddress)) {
ipAddress = request.getHeader("Proxy-Client-IP");
}
if (ipAddress == null || ipAddress.length() == 0
|| "unknown".equalsIgnoreCase(ipAddress)) {
ipAddress = request.getHeader("WL-Proxy-Client-IP");
}
if (ipAddress == null || ipAddress.length() == 0
|| "unknown".equalsIgnoreCase(ipAddress)) {
ipAddress = request.getRemoteAddr();
if (ipAddress.equals("127.0.0.1")) {
// 根据网卡取本机配置的IP
InetAddress inet = null;
try {
inet = InetAddress.getLocalHost();
} catch (UnknownHostException e) {
e.printStackTrace();
}
ipAddress = inet.getHostAddress();
}
}
// 对于通过多个代理的情况,第一个IP为客户端真实IP,多个IP按照','分割
if (ipAddress != null && ipAddress.length() > 15) { // "***.***.***.***".length()
// = 15
if (ipAddress.indexOf(",") > 0) {
ipAddress = ipAddress.substring(0, ipAddress.indexOf(","));
}
}
return ipAddress;
}
/**
* @param cls
* @param clazzName
* @param methodName
* @param arguments
* @return
* @throws NotFoundException
* @描述:获取参数名和参数值
* @创建人:wyait
*/
private Map<String, Object> getFieldsName(
Class<? extends AppLogAspect> cls, String clazzName,
String methodName, Object[] arguments) throws NotFoundException {
Map<String, Object> map = new HashMap<String, Object>();
ClassPool pool = ClassPool.getDefault();
// ClassClassPath classPath = new ClassClassPath(this.getClass());
ClassClassPath classPath = new ClassClassPath(cls);
pool.insertClassPath(classPath);
CtClass cc = pool.get(clazzName);
CtMethod cm = cc.getDeclaredMethod(methodName);
javassist.bytecode.MethodInfo methodInfo = cm.getMethodInfo();
CodeAttribute codeAttribute = methodInfo.getCodeAttribute();
LocalVariableAttribute attr = (LocalVariableAttribute) codeAttribute
.getAttribute(LocalVariableAttribute.tag);
if (attr == null) {
// exception
} else {
// String[] paramNames = new String[cm.getParameterTypes().length];
int pos = Modifier.isStatic(cm.getModifiers()) ? 0 : 1;
for (int i = 0; i < cm.getParameterTypes().length; i++) {
map.put(attr.variableName(i + pos), arguments[i]);// paramNames即参数名
}
}
// Map<>
return map;
}
}
| [
"wyaiit@126.com"
] | wyaiit@126.com |
e395020c839a82d6ca29c89510887c6390a5df55 | af58eabf5360cb82082e1b0590696b627118d5a3 | /marketing-data/src/main/java/com/zhongmei/bty/basemodule/trade/message/ModifyTradeMemoResp.java | 297f6b67dff995a69aec7d1f6454444eb0bcddbb | [] | no_license | sengeiou/marketing-app | f4b670f3996ba190decd2f1b8e4a276eb53b8b2a | 278f3da95584e2ab7d97dff1a067db848e70a9f3 | refs/heads/master | 2020-06-07T01:51:25.743676 | 2019-06-20T08:58:28 | 2019-06-20T08:58:28 | 192,895,799 | 0 | 1 | null | 2019-06-20T09:59:09 | 2019-06-20T09:59:08 | null | UTF-8 | Java | false | false | 207 | java | package com.zhongmei.bty.basemodule.trade.message;
import com.zhongmei.yunfu.db.entity.trade.Trade;
/**
* Created by demo on 2018/12/15
*/
public class ModifyTradeMemoResp {
public Trade trade;
}
| [
"yangyuanping_cd@shishike.com"
] | yangyuanping_cd@shishike.com |
e5bd8263d35295bced875fba650d5f1cf885e29f | a6a275aea3fb5f083758b57820b7a6df4aa6718b | /src/main/java/to/ChatConnectTO.java | 141f68168366620538220f484b74b7e9d80369d5 | [] | no_license | andressavazpinto/GuiaWSMaven | 3bf7dee5c552b72ec8ad1427ce2c0923b536d6ed | ca189b661e101a1edb86f1a1afbf0e94ce69aa10 | refs/heads/master | 2020-03-18T01:37:15.352320 | 2018-11-20T23:19:43 | 2018-11-20T23:19:43 | 134,150,989 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,871 | 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 to;
import util.StatusChat;
/**
*
* @author Andressa
*/
public class ChatConnectTO {
private int idChat;
private int idConnectGuides;
private int idUser1;
private int idUser2;
private StatusChat statusChat;
public ChatConnectTO(int idChat, int idConnectGuides, int idUser1, int idUser2, StatusChat statusChat) {
this.idChat = idChat;
this.idConnectGuides = idConnectGuides;
this.idUser1 = idUser1;
this.idUser2 = idUser2;
this.statusChat = statusChat;
}
public ChatConnectTO() {
}
public int getIdChat() {
return idChat;
}
public void setIdChat(int idChat) {
this.idChat = idChat;
}
public int getIdConnectGuides() {
return idConnectGuides;
}
public void setIdConnectGuides(int idConnectGuides) {
this.idConnectGuides = idConnectGuides;
}
public int getIdUser1() {
return idUser1;
}
public void setIdUser1(int idUser1) {
this.idUser1 = idUser1;
}
public int getIdUser2() {
return idUser2;
}
public void setIdUser2(int idUser2) {
this.idUser2 = idUser2;
}
public StatusChat getStatusChat() {
return statusChat;
}
public void setStatusChat(StatusChat statusChat) {
this.statusChat = statusChat;
}
@Override
public String toString() {
return "ChatConnectTO{" + "idChat=" + idChat + ", idConnectGuides=" + idConnectGuides + ", idUser1=" + idUser1 + ", idUser2=" + idUser2 + ", statusChat=" + statusChat + '}';
}
}
| [
"andressavaz pinto@gmail.com"
] | andressavaz pinto@gmail.com |
bc864a42fd65deebe7c18383268b9083893e596b | 10f7746148c7432d5415e455b53a8c4993e46263 | /SpMVC020_JpaJstl/src/com/lnt/hr/daos/EmpDaoImpl.java | 3da0279c4705a9cd2fafcfab2cb2d9ef55e7065e | [] | no_license | itsmezeya/SpringMVC4JPA | db14f163c12c1d12e068edcc78b3adefcce00efe | 66bf38aeb15e29668851a2b7b1933d5abdc9bdd3 | refs/heads/master | 2022-12-24T10:28:23.841751 | 2019-10-19T14:47:12 | 2019-10-19T14:47:12 | 216,184,200 | 0 | 0 | null | 2022-12-16T10:52:15 | 2019-10-19T09:53:11 | Java | UTF-8 | Java | false | false | 2,510 | java | package com.lnt.hr.daos;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.lnt.hr.beans.Employees;
import com.lnt.hr.exceptions.EmpException;
/*
* None of the code of the class to echo any message directly on console.
* None of the code of the DAO class to throw SQL exception.
* Only custom exceptions are expected to come out.
* If Connection Pool is being used, each method must procure connection and return back to pool
* before execute of method ends.
* One class will refer to another class mostly through interface.
*
* Scopes in Spring IoC
* 1. The 'singleton'/'stateless': This object is created never more than once in a Spring Context.
* 2. The 'prototype'/'statefull': This object is created every time asked for.
*
* There are four sub-annotations of @Component.
* @Service: It is for declaring Service classes.
* @Repository: It is for declaring DAO classes.
* @Controller: It is for Spring MVC web application.
* @RestController: It is for publishing services as REST services.
*
* Transactional Propagation..,
* 1. Required(Default): Create and propagate the transaction to the DAO methods
* and each DB interaction participate in same transaction.
* If DB method does not receive a transaction, create a new one.
* 2. RequiresNew
* 3. Mandatory
* 4. Never
* 5. Supported
* 6. NotSupported
* 7. Nested (Spring Transaction)
*/
@Repository
@Scope("singleton") // By default spring objects are singleton.
@Transactional(propagation=Propagation.REQUIRED)
public class EmpDaoImpl implements EmpDao {
@PersistenceContext
private EntityManager manager;
@Override
public List<Employees> getEmpList() throws EmpException {
Query qry = manager.createNamedQuery("allEmps");
return qry.getResultList();
}
@Override
public Employees getEmpDetails(int empNo) throws EmpException {
Employees emp = manager.find(Employees.class, empNo);
return emp;
}
@Override
public Employees insertNewEmployee(Employees emp) throws EmpException {
//System.out.println(emp);
manager.persist(emp);
return emp;
}
}
| [
"Admin@Admin-PC"
] | Admin@Admin-PC |
cbe1f2e45bdb90b80e9a9852d14da543fdb144ae | ac44e39affcf0b618aab648f785f2d70d7e4a13c | /gerrit-common/src/main/java/com/google/gerrit/common/data/SshHostKey.java | 1d4e3c9568cee360521cfbdb1b5afe5c0676421b | [
"Apache-2.0"
] | permissive | jared2501/gerrit | 253df72903a06bbb5276126e41ff7af8e716805f | 98a44c60960576b61da296203fb294b505d86bac | refs/heads/master | 2022-12-22T12:59:18.256798 | 2016-02-26T17:17:06 | 2016-02-26T17:17:06 | 59,615,626 | 1 | 1 | Apache-2.0 | 2022-12-14T13:58:58 | 2016-05-24T23:30:26 | Java | UTF-8 | Java | false | false | 1,396 | java | // Copyright (C) 2009 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.gerrit.common.data;
/** Description of the SSH daemon host key used by Gerrit. */
public class SshHostKey {
protected String hostIdent;
protected String hostKey;
protected String fingerprint;
protected SshHostKey() {
}
public SshHostKey(final String hi, final String hk, final String fp) {
hostIdent = hi;
hostKey = hk;
fingerprint = fp;
}
/** @return host name string, to appear in a known_hosts file. */
public String getHostIdent() {
return hostIdent;
}
/** @return base 64 encoded host key string, starting with key type. */
public String getHostKey() {
return hostKey;
}
/** @return the key fingerprint, as displayed by a connecting client. */
public String getFingerprint() {
return fingerprint;
}
}
| [
"sop@google.com"
] | sop@google.com |
2ef40eba1cc288bab6d867898746d24888711224 | 184495ec2118289403f7cbbea6d1fd910935e582 | /src/bitcamp/java89/ems/Student.java | 4e7e19e5c1e3d521dd7c9164e7843539f79cb6b5 | [] | no_license | leesungbok/bitcamp-team1 | 236bbbc9659ba3368ccfd3694edbe756a1a68400 | 13753051c6291856a5d7fdd64bd71e5926295355 | refs/heads/master | 2021-01-12T13:16:46.073387 | 2016-10-28T06:49:44 | 2016-10-28T06:49:44 | 72,175,273 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 420 | java | package bitcamp.java89.ems;
public class Student {
// 인스턴스 변수
String userId;
String password;
String name;
String email;
String tel;
boolean working;
int birthYear;
String school;
public Student() {}
public Student(String userId, String password, String name, String tel) {
this.userId = userId;
this.password = password;
this.name = name;
this.tel = tel;
}
}
| [
"jinyoung.eom@gmail.com"
] | jinyoung.eom@gmail.com |
3c4472c6e17d9533039f42f0c6b5a378676f9591 | ab3d7b363811750c32a87a43b73797bab4b53a20 | /src/com/floreo/Loops.java | 5708fcb4b91561d1d84fff06ba3c8b2ed7e00391 | [] | no_license | blobitty/notepad | b168963f5b24a9c850b20b1019276955be80fbf9 | e8e0f5dd5a10e389ccbc4232024cc9d89cb4062b | refs/heads/main | 2023-01-19T09:17:24.875266 | 2020-11-12T22:12:42 | 2020-11-12T22:12:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 393 | java | package com.floreo;
public class Loops {
public static void main(String[] args) {
myNestedLoop(7);
}
public static void myNestedLoop(int n){
int sum = 1;
int innerSum = 1;
for(int i = 0; i < n; i++){
sum += sum;
for(int j = 0; j < n; j++){
innerSum += innerSum;
}
}
}
}
| [
"bobby@floreolabs.org"
] | bobby@floreolabs.org |
1085723968e85ecac671e8d24d8f39a16517e172 | 54375e487705ab0baa1df0d1be7eb824c3671fee | /src/day40_CustomClass_Statics/BankOfAzerbaijan.java | 2bffd6cdb7f280b0d245e48100310f05419cb086 | [] | no_license | maggan1968/JavaProgramming_B23 | a7445cd55b4d30405d4f6c73f294dc4e106bef35 | 2f21c0753b40d3dd4fe591a5b99f6fd9f985c85f | refs/heads/master | 2023-08-06T01:58:14.645811 | 2021-09-23T03:12:49 | 2021-09-23T03:12:49 | 388,500,839 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 394 | java | package day40_CustomClass_Statics;
public class BankOfAzerbaijan {
public static void main(String[] args) {
System.out.println(HumanResource.employee1);
System.out.println(HumanResource.employee2);
System.out.println(HumanResource.employee3);
System.out.println(HumanResource.employee4);
System.out.println(HumanResource.employee5);
}
}
| [
"mkowalczyk42@gmail.com"
] | mkowalczyk42@gmail.com |
412ff4b7589075b9254f1cf02727e8ece289d67e | c885ef92397be9d54b87741f01557f61d3f794f3 | /results/JacksonDatabind-104/com.fasterxml.jackson.databind.util.StdDateFormat/BBC-F0-opt-20/tests/24/com/fasterxml/jackson/databind/util/StdDateFormat_ESTest.java | ce0126cd838cdd8e6aa10b33800159d02206eaaf | [
"CC-BY-4.0",
"MIT"
] | permissive | pderakhshanfar/EMSE-BBC-experiment | f60ac5f7664dd9a85f755a00a57ec12c7551e8c6 | fea1a92c2e7ba7080b8529e2052259c9b697bbda | refs/heads/main | 2022-11-25T00:39:58.983828 | 2022-04-12T16:04:26 | 2022-04-12T16:04:26 | 309,335,889 | 0 | 1 | null | 2021-11-05T11:18:43 | 2020-11-02T10:30:38 | null | UTF-8 | Java | false | false | 44,215 | java | /*
* This file was automatically generated by EvoSuite
* Sat Oct 23 22:25:05 GMT 2021
*/
package com.fasterxml.jackson.databind.util;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.shaded.org.mockito.Mockito.*;
import static org.evosuite.runtime.EvoAssertions.*;
import com.fasterxml.jackson.databind.util.StdDateFormat;
import java.io.StringWriter;
import java.text.DateFormat;
import java.text.FieldPosition;
import java.text.Format;
import java.text.ParseException;
import java.text.ParsePosition;
import java.time.ZoneId;
import java.time.ZoneOffset;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
import java.util.SimpleTimeZone;
import java.util.TimeZone;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.evosuite.runtime.ViolatedAssumptionAnswer;
import org.evosuite.runtime.mock.java.text.MockDateFormat;
import org.evosuite.runtime.mock.java.text.MockSimpleDateFormat;
import org.evosuite.runtime.mock.java.util.MockDate;
import org.junit.runner.RunWith;
import sun.util.calendar.ZoneInfo;
@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true)
public class StdDateFormat_ESTest extends StdDateFormat_ESTest_scaffolding {
@Test(timeout = 4000)
public void test00() throws Throwable {
StdDateFormat stdDateFormat0 = new StdDateFormat();
ParsePosition parsePosition0 = new ParsePosition((-1582));
stdDateFormat0._parseDate("0000-00-05", parsePosition0);
assertFalse(stdDateFormat0.isColonIncludedInTimeZone());
}
@Test(timeout = 4000)
public void test01() throws Throwable {
StdDateFormat stdDateFormat0 = new StdDateFormat();
stdDateFormat0.parse("0038-00-00");
assertTrue(stdDateFormat0.isLenient());
}
@Test(timeout = 4000)
public void test02() throws Throwable {
StdDateFormat stdDateFormat0 = StdDateFormat.instance;
ZoneOffset zoneOffset0 = ZoneOffset.MIN;
TimeZone timeZone0 = TimeZone.getTimeZone((ZoneId) zoneOffset0);
StdDateFormat stdDateFormat1 = stdDateFormat0.withTimeZone(timeZone0);
ParsePosition parsePosition0 = new ParsePosition(0);
try {
stdDateFormat1._parseAsISO8601("lenient", parsePosition0);
fail("Expecting exception: ParseException");
} catch(ParseException e) {
//
// Cannot parse date \"lenient\": while it seems to fit format 'yyyy-MM-dd', parsing fails (leniency? null)
//
verifyException("com.fasterxml.jackson.databind.util.StdDateFormat", e);
}
}
@Test(timeout = 4000)
public void test03() throws Throwable {
StdDateFormat stdDateFormat0 = StdDateFormat.instance;
ParsePosition parsePosition0 = new ParsePosition(9);
Date date0 = stdDateFormat0._parseDate("2.2250738585072012e-308", parsePosition0);
assertNull(date0);
}
@Test(timeout = 4000)
public void test04() throws Throwable {
Locale locale0 = new Locale("]eGQKtdXXJwxrbRC`", "Uk+5}n?");
StdDateFormat stdDateFormat0 = new StdDateFormat((TimeZone) null, locale0);
ParsePosition parsePosition0 = new ParsePosition(9);
stdDateFormat0.parse("Uk+5}n?", parsePosition0);
assertEquals("java.text.ParsePosition[index=9,errorIndex=9]", parsePosition0.toString());
assertEquals(9, parsePosition0.getErrorIndex());
}
@Test(timeout = 4000)
public void test05() throws Throwable {
StdDateFormat stdDateFormat0 = StdDateFormat.instance;
ParsePosition parsePosition0 = new ParsePosition((-4194));
// Undeclared exception!
try {
stdDateFormat0._parseDate("I", parsePosition0);
fail("Expecting exception: StringIndexOutOfBoundsException");
} catch(StringIndexOutOfBoundsException e) {
}
}
@Test(timeout = 4000)
public void test06() throws Throwable {
StdDateFormat stdDateFormat0 = new StdDateFormat();
try {
stdDateFormat0.parse(".S928");
fail("Expecting exception: ParseException");
} catch(ParseException e) {
//
// Cannot parse date \".S928\": not compatible with any of standard forms (\"yyyy-MM-dd'T'HH:mm:ss.SSSZ\", \"yyyy-MM-dd'T'HH:mm:ss.SSS\", \"EEE, dd MMM yyyy HH:mm:ss zzz\", \"yyyy-MM-dd\")
//
verifyException("com.fasterxml.jackson.databind.util.StdDateFormat", e);
}
}
@Test(timeout = 4000)
public void test07() throws Throwable {
StdDateFormat stdDateFormat0 = new StdDateFormat();
ParsePosition parsePosition0 = new ParsePosition(45);
stdDateFormat0.parse("0000-00-00T0:00", parsePosition0);
assertTrue(stdDateFormat0.isLenient());
assertFalse(stdDateFormat0.isColonIncludedInTimeZone());
assertEquals("java.text.ParsePosition[index=45,errorIndex=-1]", parsePosition0.toString());
}
@Test(timeout = 4000)
public void test08() throws Throwable {
TimeZone timeZone0 = StdDateFormat.getDefaultTimeZone();
Locale locale0 = Locale.TRADITIONAL_CHINESE;
Boolean boolean0 = Boolean.valueOf("");
StdDateFormat stdDateFormat0 = new StdDateFormat(timeZone0, locale0, boolean0);
StdDateFormat stdDateFormat1 = stdDateFormat0.withTimeZone(timeZone0);
assertFalse(stdDateFormat1.isLenient());
assertFalse(stdDateFormat1.isColonIncludedInTimeZone());
assertSame(stdDateFormat1, stdDateFormat0);
}
@Test(timeout = 4000)
public void test09() throws Throwable {
TimeZone timeZone0 = StdDateFormat.getDefaultTimeZone();
Locale locale0 = Locale.ENGLISH;
StdDateFormat stdDateFormat0 = new StdDateFormat(timeZone0, locale0);
StdDateFormat stdDateFormat1 = stdDateFormat0.withColonInTimeZone(true);
StdDateFormat stdDateFormat2 = stdDateFormat1.withTimeZone(timeZone0);
assertTrue(stdDateFormat2.isColonIncludedInTimeZone());
assertFalse(stdDateFormat0.isColonIncludedInTimeZone());
assertSame(stdDateFormat2, stdDateFormat1);
}
@Test(timeout = 4000)
public void test10() throws Throwable {
TimeZone timeZone0 = StdDateFormat.getDefaultTimeZone();
Locale locale0 = Locale.KOREAN;
Boolean boolean0 = new Boolean((String) null);
StdDateFormat stdDateFormat0 = new StdDateFormat(timeZone0, locale0, boolean0, true);
StdDateFormat stdDateFormat1 = stdDateFormat0.withLocale(locale0);
assertSame(stdDateFormat1, stdDateFormat0);
assertTrue(stdDateFormat1.isColonIncludedInTimeZone());
assertFalse(stdDateFormat1.isLenient());
}
@Test(timeout = 4000)
public void test11() throws Throwable {
ZoneInfo zoneInfo0 = (ZoneInfo)StdDateFormat.DEFAULT_TIMEZONE;
Locale locale0 = Locale.JAPANESE;
Boolean boolean0 = new Boolean(false);
StdDateFormat stdDateFormat0 = new StdDateFormat(zoneInfo0, locale0, boolean0, false);
StdDateFormat stdDateFormat1 = stdDateFormat0.withColonInTimeZone(false);
assertFalse(stdDateFormat1.isLenient());
assertSame(stdDateFormat1, stdDateFormat0);
}
@Test(timeout = 4000)
public void test12() throws Throwable {
StdDateFormat stdDateFormat0 = new StdDateFormat();
ParsePosition parsePosition0 = new ParsePosition((-3873));
Date date0 = stdDateFormat0.parseAsISO8601("0000-00-00", parsePosition0);
assertEquals("Fri Feb 14 20:21:21 GMT 2014", date0.toString());
}
@Test(timeout = 4000)
public void test13() throws Throwable {
StdDateFormat stdDateFormat0 = new StdDateFormat();
boolean boolean0 = stdDateFormat0.looksLikeISO8601("0038-00-00");
assertFalse(stdDateFormat0.isColonIncludedInTimeZone());
assertTrue(boolean0);
}
@Test(timeout = 4000)
public void test14() throws Throwable {
StdDateFormat stdDateFormat0 = StdDateFormat.instance;
boolean boolean0 = stdDateFormat0.looksLikeISO8601("}$@lA.k_$A");
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test15() throws Throwable {
TimeZone timeZone0 = StdDateFormat.getDefaultTimeZone();
Locale locale0 = Locale.KOREAN;
Boolean boolean0 = new Boolean((String) null);
StdDateFormat stdDateFormat0 = new StdDateFormat(timeZone0, locale0, boolean0, true);
boolean boolean1 = stdDateFormat0.isColonIncludedInTimeZone();
assertFalse(stdDateFormat0.isLenient());
assertTrue(boolean1);
}
@Test(timeout = 4000)
public void test16() throws Throwable {
StdDateFormat stdDateFormat0 = StdDateFormat.instance;
TimeZone timeZone0 = stdDateFormat0.getTimeZone();
assertNull(timeZone0);
}
@Test(timeout = 4000)
public void test17() throws Throwable {
SimpleTimeZone simpleTimeZone0 = new SimpleTimeZone(0, "0000-00-00T00:00");
Locale locale0 = Locale.JAPANESE;
Boolean boolean0 = new Boolean(true);
StdDateFormat stdDateFormat0 = new StdDateFormat(simpleTimeZone0, locale0, boolean0);
TimeZone timeZone0 = stdDateFormat0.getTimeZone();
assertFalse(stdDateFormat0.isColonIncludedInTimeZone());
assertNotNull(timeZone0);
}
@Test(timeout = 4000)
public void test18() throws Throwable {
SimpleTimeZone simpleTimeZone0 = new SimpleTimeZone((-1796), "9bUPS8<-/h4");
Locale locale0 = Locale.US;
StdDateFormat stdDateFormat0 = new StdDateFormat(simpleTimeZone0, locale0, (Boolean) null);
TimeZone timeZone0 = stdDateFormat0.getTimeZone();
assertFalse(stdDateFormat0.isColonIncludedInTimeZone());
assertNotNull(timeZone0);
}
@Test(timeout = 4000)
public void test19() throws Throwable {
StdDateFormat stdDateFormat0 = new StdDateFormat();
MockDate mockDate0 = new MockDate();
StringBuffer stringBuffer0 = new StringBuffer("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
Format.Field format_Field0 = mock(Format.Field.class, new ViolatedAssumptionAnswer());
FieldPosition fieldPosition0 = new FieldPosition(format_Field0, 100);
stdDateFormat0.format((Date) mockDate0, stringBuffer0, fieldPosition0);
assertEquals("yyyy-MM-dd'T'HH:mm:ss.SSSZ2014-02-14T20:21:21.320+0000", stringBuffer0.toString());
}
@Test(timeout = 4000)
public void test20() throws Throwable {
TimeZone timeZone0 = TimeZone.getTimeZone("");
Locale locale0 = Locale.ENGLISH;
Boolean boolean0 = Boolean.valueOf("/kvZ86yf6~2F7A");
StdDateFormat stdDateFormat0 = new StdDateFormat(timeZone0, locale0, boolean0, false);
StdDateFormat stdDateFormat1 = stdDateFormat0.clone();
assertFalse(stdDateFormat0.isColonIncludedInTimeZone());
assertFalse(stdDateFormat1.isLenient());
}
@Test(timeout = 4000)
public void test21() throws Throwable {
TimeZone timeZone0 = StdDateFormat.getDefaultTimeZone();
Locale locale0 = Locale.ENGLISH;
StdDateFormat stdDateFormat0 = new StdDateFormat(timeZone0, locale0);
StdDateFormat stdDateFormat1 = stdDateFormat0.withColonInTimeZone(true);
stdDateFormat1.clone();
assertFalse(stdDateFormat0.isColonIncludedInTimeZone());
assertTrue(stdDateFormat1.isColonIncludedInTimeZone());
}
@Test(timeout = 4000)
public void test22() throws Throwable {
StdDateFormat stdDateFormat0 = StdDateFormat.instance;
ParsePosition parsePosition0 = new ParsePosition((-1350));
stdDateFormat0._parseAsISO8601("0000-00-00", parsePosition0);
assertTrue(stdDateFormat0.isLenient());
}
@Test(timeout = 4000)
public void test23() throws Throwable {
TimeZone timeZone0 = TimeZone.getDefault();
Locale locale0 = Locale.ROOT;
Boolean boolean0 = Boolean.FALSE;
StdDateFormat stdDateFormat0 = new StdDateFormat(timeZone0, locale0, boolean0, true);
Calendar calendar0 = stdDateFormat0._getCalendar(timeZone0);
assertTrue(stdDateFormat0.isColonIncludedInTimeZone());
assertEquals("org.evosuite.runtime.mock.java.util.MockGregorianCalendar[time=1392409281320,areFieldsSet=false,areAllFieldsSet=false,lenient=false,zone=sun.util.calendar.ZoneInfo[id=\"GMT\",offset=0,dstSavings=0,useDaylight=false,transitions=0,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2014,MONTH=1,WEEK_OF_YEAR=7,WEEK_OF_MONTH=3,DAY_OF_MONTH=14,DAY_OF_YEAR=45,DAY_OF_WEEK=6,DAY_OF_WEEK_IN_MONTH=2,AM_PM=1,HOUR=8,HOUR_OF_DAY=20,MINUTE=21,SECOND=21,MILLISECOND=320,ZONE_OFFSET=0,DST_OFFSET=0]", calendar0.toString());
}
@Test(timeout = 4000)
public void test24() throws Throwable {
StdDateFormat stdDateFormat0 = StdDateFormat.instance;
Calendar calendar0 = stdDateFormat0._getCalendar((TimeZone) null);
assertEquals("org.evosuite.runtime.mock.java.util.MockGregorianCalendar[time=1392409281320,areFieldsSet=false,areAllFieldsSet=false,lenient=true,zone=null,firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2014,MONTH=1,WEEK_OF_YEAR=7,WEEK_OF_MONTH=3,DAY_OF_MONTH=14,DAY_OF_YEAR=45,DAY_OF_WEEK=6,DAY_OF_WEEK_IN_MONTH=2,AM_PM=1,HOUR=8,HOUR_OF_DAY=20,MINUTE=21,SECOND=21,MILLISECOND=320,ZONE_OFFSET=0,DST_OFFSET=0]", calendar0.toString());
}
@Test(timeout = 4000)
public void test25() throws Throwable {
MockDateFormat mockDateFormat0 = new MockDateFormat();
boolean boolean0 = StdDateFormat._equals(mockDateFormat0, mockDateFormat0);
assertTrue(boolean0);
}
@Test(timeout = 4000)
public void test26() throws Throwable {
StdDateFormat stdDateFormat0 = new StdDateFormat();
DateFormat dateFormat0 = DateFormat.getTimeInstance(3);
boolean boolean0 = StdDateFormat._equals((DateFormat) stdDateFormat0, dateFormat0);
assertFalse(boolean0);
assertFalse(stdDateFormat0.isColonIncludedInTimeZone());
}
@Test(timeout = 4000)
public void test27() throws Throwable {
StdDateFormat stdDateFormat0 = StdDateFormat.instance;
// Undeclared exception!
try {
stdDateFormat0.withLocale((Locale) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.util.StdDateFormat", e);
}
}
@Test(timeout = 4000)
public void test28() throws Throwable {
Locale locale0 = Locale.US;
StdDateFormat stdDateFormat0 = new StdDateFormat((TimeZone) null, locale0);
// Undeclared exception!
try {
stdDateFormat0.setTimeZone((TimeZone) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.util.StdDateFormat", e);
}
}
@Test(timeout = 4000)
public void test29() throws Throwable {
ZoneInfo zoneInfo0 = (ZoneInfo)StdDateFormat.DEFAULT_TIMEZONE;
Locale locale0 = Locale.JAPANESE;
Boolean boolean0 = Boolean.FALSE;
StdDateFormat stdDateFormat0 = new StdDateFormat(zoneInfo0, locale0, boolean0, false);
ParsePosition parsePosition0 = new ParsePosition((-1808));
// Undeclared exception!
try {
stdDateFormat0.parseAsRFC1123("", parsePosition0);
fail("Expecting exception: StringIndexOutOfBoundsException");
} catch(StringIndexOutOfBoundsException e) {
}
}
@Test(timeout = 4000)
public void test30() throws Throwable {
StdDateFormat stdDateFormat0 = new StdDateFormat();
ParsePosition parsePosition0 = new ParsePosition((-150));
// Undeclared exception!
try {
stdDateFormat0.parseAsRFC1123((String) null, parsePosition0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("java.text.SimpleDateFormat", e);
}
}
@Test(timeout = 4000)
public void test31() throws Throwable {
StdDateFormat stdDateFormat0 = StdDateFormat.instance;
TimeZone timeZone0 = StdDateFormat.getDefaultTimeZone();
StdDateFormat stdDateFormat1 = stdDateFormat0.withTimeZone(timeZone0);
ParsePosition parsePosition0 = new ParsePosition(32);
// Undeclared exception!
try {
stdDateFormat1.parseAsISO8601("", parsePosition0);
fail("Expecting exception: StringIndexOutOfBoundsException");
} catch(StringIndexOutOfBoundsException e) {
}
}
@Test(timeout = 4000)
public void test32() throws Throwable {
StdDateFormat stdDateFormat0 = new StdDateFormat();
ParsePosition parsePosition0 = new ParsePosition(90);
// Undeclared exception!
try {
stdDateFormat0.parseAsISO8601((String) null, parsePosition0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.util.StdDateFormat", e);
}
}
@Test(timeout = 4000)
public void test33() throws Throwable {
StdDateFormat stdDateFormat0 = new StdDateFormat();
ParsePosition parsePosition0 = new ParsePosition(9);
// Undeclared exception!
try {
stdDateFormat0.parse("", parsePosition0);
fail("Expecting exception: StringIndexOutOfBoundsException");
} catch(StringIndexOutOfBoundsException e) {
}
}
@Test(timeout = 4000)
public void test34() throws Throwable {
StdDateFormat stdDateFormat0 = new StdDateFormat();
ParsePosition parsePosition0 = new ParsePosition(26);
// Undeclared exception!
try {
stdDateFormat0.parse((String) null, parsePosition0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.util.StdDateFormat", e);
}
}
@Test(timeout = 4000)
public void test35() throws Throwable {
StdDateFormat stdDateFormat0 = new StdDateFormat();
ParsePosition parsePosition0 = new ParsePosition(14);
// Undeclared exception!
try {
stdDateFormat0.parse("0000-00-00T00:00", parsePosition0);
// fail("Expecting exception: IllegalStateException");
// Unstable assertion
} catch(IllegalStateException e) {
//
// No match available
//
verifyException("java.util.regex.Matcher", e);
}
}
@Test(timeout = 4000)
public void test36() throws Throwable {
Locale locale0 = new Locale("]eGQKtdXXJwxrbRC`", "pD6");
StdDateFormat stdDateFormat0 = new StdDateFormat((TimeZone) null, locale0);
// Undeclared exception!
try {
stdDateFormat0.parse("");
fail("Expecting exception: StringIndexOutOfBoundsException");
} catch(StringIndexOutOfBoundsException e) {
}
}
@Test(timeout = 4000)
public void test37() throws Throwable {
StdDateFormat stdDateFormat0 = new StdDateFormat();
// Undeclared exception!
try {
stdDateFormat0.parse((String) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.util.StdDateFormat", e);
}
}
@Test(timeout = 4000)
public void test38() throws Throwable {
StdDateFormat stdDateFormat0 = new StdDateFormat();
// Undeclared exception!
try {
stdDateFormat0.parse("0000-00-00T00:00");
// fail("Expecting exception: IllegalStateException");
// Unstable assertion
} catch(IllegalStateException e) {
//
// No match available
//
verifyException("java.util.regex.Matcher", e);
}
}
@Test(timeout = 4000)
public void test39() throws Throwable {
TimeZone timeZone0 = StdDateFormat.getDefaultTimeZone();
Boolean boolean0 = Boolean.valueOf("2!'!ZWmX|%;U>l0YhO");
StdDateFormat stdDateFormat0 = new StdDateFormat(timeZone0, (Locale) null, boolean0, false);
// Undeclared exception!
try {
stdDateFormat0.looksLikeISO8601((String) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.util.StdDateFormat", e);
}
}
@Test(timeout = 4000)
public void test40() throws Throwable {
ZoneOffset zoneOffset0 = ZoneOffset.MIN;
TimeZone timeZone0 = TimeZone.getTimeZone((ZoneId) zoneOffset0);
// Undeclared exception!
try {
StdDateFormat.getRFC1123Format(timeZone0, (Locale) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.util.StdDateFormat", e);
}
}
@Test(timeout = 4000)
public void test41() throws Throwable {
TimeZone timeZone0 = StdDateFormat.getDefaultTimeZone();
// Undeclared exception!
try {
StdDateFormat.getISO8601Format(timeZone0, (Locale) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.util.StdDateFormat", e);
}
}
@Test(timeout = 4000)
public void test42() throws Throwable {
StdDateFormat stdDateFormat0 = StdDateFormat.instance;
MockDate mockDate0 = new MockDate(21, (-2229), 0, 21, (-3179), 2538);
// Undeclared exception!
try {
stdDateFormat0.format((Date) mockDate0, (StringBuffer) null, (FieldPosition) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.util.StdDateFormat", e);
}
}
@Test(timeout = 4000)
public void test43() throws Throwable {
StdDateFormat stdDateFormat0 = new StdDateFormat();
ParsePosition parsePosition0 = new ParsePosition(45);
try {
stdDateFormat0._parseDate("0000-00-00T0:00", parsePosition0);
fail("Expecting exception: ParseException");
} catch(ParseException e) {
//
// Cannot parse date \"0000-00-00T0:00\": while it seems to fit format 'yyyy-MM-dd'T'HH:mm:ss.SSSZ', parsing fails (leniency? null)
//
verifyException("com.fasterxml.jackson.databind.util.StdDateFormat", e);
}
}
@Test(timeout = 4000)
public void test44() throws Throwable {
Locale locale0 = Locale.KOREA;
Boolean boolean0 = Boolean.TRUE;
StdDateFormat stdDateFormat0 = new StdDateFormat((TimeZone) null, locale0, boolean0);
ParsePosition parsePosition0 = new ParsePosition(0);
// Undeclared exception!
try {
stdDateFormat0._parseDate((String) null, parsePosition0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.util.StdDateFormat", e);
}
}
@Test(timeout = 4000)
public void test45() throws Throwable {
TimeZone timeZone0 = StdDateFormat.getDefaultTimeZone();
Locale locale0 = Locale.ENGLISH;
ParsePosition parsePosition0 = new ParsePosition(50);
StdDateFormat stdDateFormat0 = new StdDateFormat(timeZone0, locale0);
// Undeclared exception!
try {
stdDateFormat0._parseDate("0000-00-00T00:00", parsePosition0);
// fail("Expecting exception: IllegalStateException");
// Unstable assertion
} catch(IllegalStateException e) {
//
// No match available
//
verifyException("java.util.regex.Matcher", e);
}
}
@Test(timeout = 4000)
public void test46() throws Throwable {
TimeZone timeZone0 = TimeZone.getDefault();
Locale locale0 = new Locale("", "");
StdDateFormat stdDateFormat0 = new StdDateFormat(timeZone0, locale0);
ParsePosition parsePosition0 = new ParsePosition((-1341));
// Undeclared exception!
try {
stdDateFormat0._parseAsISO8601("", parsePosition0);
fail("Expecting exception: StringIndexOutOfBoundsException");
} catch(StringIndexOutOfBoundsException e) {
}
}
@Test(timeout = 4000)
public void test47() throws Throwable {
StdDateFormat stdDateFormat0 = new StdDateFormat();
ParsePosition parsePosition0 = new ParsePosition((-1341));
// Undeclared exception!
try {
stdDateFormat0._parseAsISO8601((String) null, parsePosition0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.util.StdDateFormat", e);
}
}
@Test(timeout = 4000)
public void test48() throws Throwable {
StdDateFormat stdDateFormat0 = new StdDateFormat();
ParsePosition parsePosition0 = new ParsePosition(520);
// Undeclared exception!
try {
stdDateFormat0._parseAsISO8601("0000-00-00T00:00", parsePosition0);
// fail("Expecting exception: IllegalStateException");
// Unstable assertion
} catch(IllegalStateException e) {
//
// No match available
//
verifyException("java.util.regex.Matcher", e);
}
}
@Test(timeout = 4000)
public void test49() throws Throwable {
StdDateFormat stdDateFormat0 = StdDateFormat.instance;
boolean boolean0 = stdDateFormat0.isLenient();
assertTrue(boolean0);
}
@Test(timeout = 4000)
public void test50() throws Throwable {
SimpleTimeZone simpleTimeZone0 = new SimpleTimeZone(12, "`{TP= aF?\"r*Z &t");
Locale locale0 = new Locale("v-8]%%N&7w~c~6", "v-8]%%N&7w~c~6", "v-8]%%N&7w~c~6");
Boolean boolean0 = new Boolean(true);
StdDateFormat stdDateFormat0 = new StdDateFormat(simpleTimeZone0, locale0, boolean0, true);
Boolean boolean1 = new Boolean("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
StdDateFormat stdDateFormat1 = stdDateFormat0.withLenient(boolean1);
boolean boolean2 = stdDateFormat1.isLenient();
assertFalse(boolean2);
assertTrue(stdDateFormat0.isColonIncludedInTimeZone());
}
@Test(timeout = 4000)
public void test51() throws Throwable {
SimpleTimeZone simpleTimeZone0 = new SimpleTimeZone(12, "`{TP= aF?\"r*Z &t");
Locale locale0 = new Locale("v-8]%%N&7w~c~6", "v-8]%%N&7w~c~6", "v-8]%%N&7w~c~6");
Boolean boolean0 = new Boolean(true);
StdDateFormat stdDateFormat0 = new StdDateFormat(simpleTimeZone0, locale0, boolean0, true);
boolean boolean1 = stdDateFormat0.isLenient();
assertTrue(stdDateFormat0.isColonIncludedInTimeZone());
assertTrue(boolean1);
}
@Test(timeout = 4000)
public void test52() throws Throwable {
TimeZone timeZone0 = StdDateFormat.getDefaultTimeZone();
Locale locale0 = Locale.ENGLISH;
Boolean boolean0 = Boolean.valueOf("2!'!ZWmX|%;U>l0YhO");
StdDateFormat stdDateFormat0 = new StdDateFormat(timeZone0, locale0);
StdDateFormat stdDateFormat1 = stdDateFormat0.withLenient(boolean0);
Boolean boolean1 = new Boolean("\", \"");
StdDateFormat stdDateFormat2 = stdDateFormat1.withLenient(boolean1);
assertFalse(stdDateFormat2.isLenient());
assertFalse(stdDateFormat2.isColonIncludedInTimeZone());
assertSame(stdDateFormat2, stdDateFormat1);
}
@Test(timeout = 4000)
public void test53() throws Throwable {
SimpleTimeZone simpleTimeZone0 = new SimpleTimeZone(12, "`{TP= aF?\"r*Z &t");
Locale locale0 = new Locale("v-8]%%N&7w~c~6", "v-8]%%N&7w~c~6", "v-8]%%N&7w~c~6");
Boolean boolean0 = new Boolean(true);
StdDateFormat stdDateFormat0 = new StdDateFormat(simpleTimeZone0, locale0, boolean0, true);
StdDateFormat stdDateFormat1 = stdDateFormat0.withLenient((Boolean) null);
assertNotSame(stdDateFormat1, stdDateFormat0);
assertTrue(stdDateFormat0.isColonIncludedInTimeZone());
}
@Test(timeout = 4000)
public void test54() throws Throwable {
SimpleTimeZone simpleTimeZone0 = new SimpleTimeZone(0, "0000-00-00T00:00");
Locale locale0 = Locale.US;
Boolean boolean0 = new Boolean(true);
StdDateFormat stdDateFormat0 = new StdDateFormat(simpleTimeZone0, locale0, boolean0);
ParsePosition parsePosition0 = new ParsePosition(0);
stdDateFormat0.parseAsRFC1123("!5g", parsePosition0);
assertFalse(stdDateFormat0.isColonIncludedInTimeZone());
}
@Test(timeout = 4000)
public void test55() throws Throwable {
Locale locale0 = new Locale("]eGQKtdXXJwxrbRC`", "pD6");
StdDateFormat stdDateFormat0 = new StdDateFormat((TimeZone) null, locale0);
ParsePosition parsePosition0 = new ParsePosition(9);
stdDateFormat0._parseDate("3,rV5KsRK)C@", parsePosition0);
assertEquals("java.text.ParsePosition[index=9,errorIndex=9]", parsePosition0.toString());
assertFalse(stdDateFormat0.isColonIncludedInTimeZone());
}
@Test(timeout = 4000)
public void test56() throws Throwable {
StdDateFormat stdDateFormat0 = new StdDateFormat();
ParsePosition parsePosition0 = new ParsePosition(881);
stdDateFormat0.parse("0020,m0-PV", parsePosition0);
try {
stdDateFormat0.parse("0020,m0-PV");
fail("Expecting exception: ParseException");
} catch(ParseException e) {
//
// Cannot parse date \"0020,m0-PV\": not compatible with any of standard forms (\"yyyy-MM-dd'T'HH:mm:ss.SSSZ\", \"yyyy-MM-dd'T'HH:mm:ss.SSS\", \"EEE, dd MMM yyyy HH:mm:ss zzz\", \"yyyy-MM-dd\")
//
verifyException("com.fasterxml.jackson.databind.util.StdDateFormat", e);
}
}
@Test(timeout = 4000)
public void test57() throws Throwable {
StdDateFormat stdDateFormat0 = StdDateFormat.instance;
ParsePosition parsePosition0 = new ParsePosition((-4194));
try {
stdDateFormat0.parseAsISO8601("I", parsePosition0);
fail("Expecting exception: ParseException");
} catch(ParseException e) {
//
// Cannot parse date \"I\": while it seems to fit format 'yyyy-MM-dd', parsing fails (leniency? null)
//
verifyException("com.fasterxml.jackson.databind.util.StdDateFormat", e);
}
}
@Test(timeout = 4000)
public void test58() throws Throwable {
SimpleTimeZone simpleTimeZone0 = new SimpleTimeZone(1977, "com.fasterxml.jackson.core.io.NumberInput");
Locale locale0 = Locale.JAPANESE;
StdDateFormat stdDateFormat0 = new StdDateFormat(simpleTimeZone0, locale0);
ParsePosition parsePosition0 = new ParsePosition(2517);
try {
stdDateFormat0.parseAsISO8601("yyyy-MM-dd'T'HH:mm:ss.SSSZ", parsePosition0);
fail("Expecting exception: ParseException");
} catch(ParseException e) {
//
// Cannot parse date \"yyyy-MM-dd'T'HH:mm:ss.SSSZ\": while it seems to fit format 'yyyy-MM-dd'T'HH:mm:ss.SSSZ', parsing fails (leniency? null)
//
verifyException("com.fasterxml.jackson.databind.util.StdDateFormat", e);
}
}
@Test(timeout = 4000)
public void test59() throws Throwable {
StdDateFormat stdDateFormat0 = new StdDateFormat();
ParsePosition parsePosition0 = new ParsePosition(16);
stdDateFormat0.parse("0000-w00-?0", parsePosition0);
assertEquals("java.text.ParsePosition[index=16,errorIndex=16]", parsePosition0.toString());
assertEquals(16, parsePosition0.getErrorIndex());
}
@Test(timeout = 4000)
public void test60() throws Throwable {
StdDateFormat stdDateFormat0 = StdDateFormat.instance;
boolean boolean0 = stdDateFormat0.equals(stdDateFormat0);
assertTrue(boolean0);
}
@Test(timeout = 4000)
public void test61() throws Throwable {
StdDateFormat stdDateFormat0 = new StdDateFormat();
TimeZone timeZone0 = StdDateFormat.getDefaultTimeZone();
Locale locale0 = Locale.KOREA;
MockSimpleDateFormat mockSimpleDateFormat0 = (MockSimpleDateFormat)StdDateFormat.getRFC1123Format(timeZone0, locale0);
boolean boolean0 = stdDateFormat0.equals(mockSimpleDateFormat0);
assertEquals("EEE, dd MMM yyyy HH:mm:ss zzz", mockSimpleDateFormat0.toLocalizedPattern());
assertFalse(stdDateFormat0.isColonIncludedInTimeZone());
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test62() throws Throwable {
TimeZone timeZone0 = TimeZone.getTimeZone("");
Locale locale0 = Locale.ENGLISH;
Boolean boolean0 = Boolean.valueOf("/kvZ86yf6~2F7A");
StdDateFormat stdDateFormat0 = new StdDateFormat(timeZone0, locale0, boolean0, false);
String string0 = stdDateFormat0.toPattern();
assertFalse(stdDateFormat0.isColonIncludedInTimeZone());
assertEquals("[one of: 'yyyy-MM-dd'T'HH:mm:ss.SSSZ', 'EEE, dd MMM yyyy HH:mm:ss zzz' (strict)]", string0);
}
@Test(timeout = 4000)
public void test63() throws Throwable {
StdDateFormat stdDateFormat0 = new StdDateFormat();
String string0 = stdDateFormat0.toPattern();
assertFalse(stdDateFormat0.isColonIncludedInTimeZone());
assertEquals("[one of: 'yyyy-MM-dd'T'HH:mm:ss.SSSZ', 'EEE, dd MMM yyyy HH:mm:ss zzz' (lenient)]", string0);
}
@Test(timeout = 4000)
public void test64() throws Throwable {
StdDateFormat stdDateFormat0 = new StdDateFormat();
MockDate mockDate0 = new MockDate((-1800), (-1800), (-1800), (-1800), (-1800), (-1800));
String string0 = stdDateFormat0.instance.format((Date) mockDate0);
assertEquals("0057-11-10T17:30:00.000+0000", string0);
}
@Test(timeout = 4000)
public void test65() throws Throwable {
StdDateFormat stdDateFormat0 = new StdDateFormat();
Locale locale0 = Locale.TRADITIONAL_CHINESE;
TimeZone timeZone0 = StdDateFormat.getDefaultTimeZone();
MockDate mockDate0 = new MockDate((-1582), (-1582), (-221), (-221), (-1582));
StringBuffer stringBuffer0 = new StringBuffer((CharSequence) "[one of: 'yyyy-MM-dd'T'HH:mm:ss.SSSZ', 'EEE, dd MMM yyyy HH:mm:ss zzz' (lenient)]");
StdDateFormat stdDateFormat1 = stdDateFormat0.withColonInTimeZone(true);
stdDateFormat1._format(timeZone0, locale0, mockDate0, stringBuffer0);
assertEquals(110, stringBuffer0.length());
assertEquals("[one of: 'yyyy-MM-dd'T'HH:mm:ss.SSSZ', 'EEE, dd MMM yyyy HH:mm:ss zzz' (lenient)]0185-07-11T16:38:00.000+00:00", stringBuffer0.toString());
}
@Test(timeout = 4000)
public void test66() throws Throwable {
SimpleTimeZone simpleTimeZone0 = new SimpleTimeZone(25, "b8!,*1V5kC*_.fsZ&u");
MockDate mockDate0 = new MockDate();
Locale locale0 = Locale.TAIWAN;
StdDateFormat stdDateFormat0 = new StdDateFormat(simpleTimeZone0, locale0, (Boolean) null, true);
String string0 = stdDateFormat0.format((Date) mockDate0);
assertEquals("2014-02-14T20:21:21.345+00:00", string0);
}
@Test(timeout = 4000)
public void test67() throws Throwable {
StdDateFormat stdDateFormat0 = new StdDateFormat();
Locale locale0 = Locale.KOREA;
MockDate mockDate0 = new MockDate();
StringWriter stringWriter0 = new StringWriter(36);
StringBuffer stringBuffer0 = stringWriter0.getBuffer();
SimpleTimeZone simpleTimeZone0 = new SimpleTimeZone((-805), "Value \"");
stdDateFormat0._format(simpleTimeZone0, locale0, mockDate0, stringBuffer0);
assertEquals("2014-02-14T20:21:20.515-0000", stringBuffer0.toString());
assertEquals("2014-02-14T20:21:20.515-0000", stringWriter0.toString());
}
@Test(timeout = 4000)
public void test68() throws Throwable {
SimpleTimeZone simpleTimeZone0 = new SimpleTimeZone(1977, "com.fasterxml.jackson.core.io.NumerInput");
Locale locale0 = Locale.JAPANESE;
StdDateFormat stdDateFormat0 = new StdDateFormat(simpleTimeZone0, locale0);
ParsePosition parsePosition0 = new ParsePosition(1977);
Date date0 = stdDateFormat0._parseDate("76", parsePosition0);
assertEquals("Thu Jan 01 00:00:00 GMT 1970", date0.toString());
assertNotNull(date0);
}
@Test(timeout = 4000)
public void test69() throws Throwable {
StdDateFormat stdDateFormat0 = new StdDateFormat();
try {
stdDateFormat0.parse("+0000");
fail("Expecting exception: ParseException");
} catch(ParseException e) {
//
// Cannot parse date \"+0000\": not compatible with any of standard forms (\"yyyy-MM-dd'T'HH:mm:ss.SSSZ\", \"yyyy-MM-dd'T'HH:mm:ss.SSS\", \"EEE, dd MMM yyyy HH:mm:ss zzz\", \"yyyy-MM-dd\")
//
verifyException("com.fasterxml.jackson.databind.util.StdDateFormat", e);
}
}
@Test(timeout = 4000)
public void test70() throws Throwable {
StdDateFormat stdDateFormat0 = new StdDateFormat();
Date date0 = stdDateFormat0.parse("0000-00-50");
assertEquals("Fri Feb 14 20:21:21 GMT 2014", date0.toString());
}
@Test(timeout = 4000)
public void test71() throws Throwable {
Locale locale0 = new Locale("]eGQKtdXXJwxrbRC`", "pD6");
StdDateFormat stdDateFormat0 = StdDateFormat.instance;
Locale locale1 = Locale.ENGLISH;
stdDateFormat0.setLenient(true);
StringWriter stringWriter0 = new StringWriter(0);
StringBuffer stringBuffer0 = stringWriter0.getBuffer();
// Undeclared exception!
try {
stdDateFormat0._format((TimeZone) null, locale0, (Date) null, stringBuffer0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
@Test(timeout = 4000)
public void test72() throws Throwable {
SimpleTimeZone simpleTimeZone0 = new SimpleTimeZone(1977, "com.fasterxml.jackson.core.io.NumerInput");
Locale locale0 = Locale.JAPANESE;
StdDateFormat stdDateFormat0 = new StdDateFormat(simpleTimeZone0, locale0);
stdDateFormat0.setLenient(false);
ParsePosition parsePosition0 = new ParsePosition(4);
// Undeclared exception!
try {
stdDateFormat0.parseAsISO8601("0000-00-00T00:00", parsePosition0);
// fail("Expecting exception: IllegalStateException");
// Unstable assertion
} catch(IllegalStateException e) {
//
// No match available
//
verifyException("java.util.regex.Matcher", e);
}
}
@Test(timeout = 4000)
public void test73() throws Throwable {
StdDateFormat stdDateFormat0 = new StdDateFormat();
Boolean boolean0 = Boolean.valueOf(true);
StdDateFormat stdDateFormat1 = stdDateFormat0.instance.withLenient(boolean0);
stdDateFormat1.setLenient(true);
assertFalse(stdDateFormat0.isColonIncludedInTimeZone());
assertTrue(stdDateFormat1.isLenient());
}
@Test(timeout = 4000)
public void test74() throws Throwable {
StdDateFormat stdDateFormat0 = new StdDateFormat();
TimeZone timeZone0 = StdDateFormat.getDefaultTimeZone();
stdDateFormat0.setTimeZone(timeZone0);
assertFalse(stdDateFormat0.isColonIncludedInTimeZone());
}
@Test(timeout = 4000)
public void test75() throws Throwable {
TimeZone timeZone0 = StdDateFormat.getDefaultTimeZone();
Locale locale0 = Locale.ENGLISH;
Boolean boolean0 = Boolean.valueOf("2!'!ZWmX|%;U>l0YhO");
StdDateFormat stdDateFormat0 = new StdDateFormat(timeZone0, locale0, boolean0, false);
stdDateFormat0.setTimeZone(timeZone0);
assertFalse(stdDateFormat0.isLenient());
assertFalse(stdDateFormat0.isColonIncludedInTimeZone());
}
@Test(timeout = 4000)
public void test76() throws Throwable {
StdDateFormat stdDateFormat0 = new StdDateFormat();
Locale locale0 = Locale.TRADITIONAL_CHINESE;
StdDateFormat stdDateFormat1 = stdDateFormat0.withLocale(locale0);
assertFalse(stdDateFormat1.isColonIncludedInTimeZone());
assertNotSame(stdDateFormat1, stdDateFormat0);
}
@Test(timeout = 4000)
public void test77() throws Throwable {
StdDateFormat stdDateFormat0 = StdDateFormat.instance;
StdDateFormat stdDateFormat1 = stdDateFormat0.withTimeZone((TimeZone) null);
assertNotSame(stdDateFormat1, stdDateFormat0);
assertFalse(stdDateFormat1.isColonIncludedInTimeZone());
}
@Test(timeout = 4000)
public void test78() throws Throwable {
StdDateFormat stdDateFormat0 = StdDateFormat.instance;
stdDateFormat0.hashCode();
}
@Test(timeout = 4000)
public void test79() throws Throwable {
StdDateFormat stdDateFormat0 = new StdDateFormat();
stdDateFormat0._clearFormats();
assertFalse(stdDateFormat0.isColonIncludedInTimeZone());
}
@Test(timeout = 4000)
public void test80() throws Throwable {
SimpleTimeZone simpleTimeZone0 = new SimpleTimeZone(1977, "com.fasterxml.jackson.core.io.NumerInput");
Locale locale0 = Locale.JAPANESE;
StdDateFormat stdDateFormat0 = new StdDateFormat(simpleTimeZone0, locale0);
boolean boolean0 = stdDateFormat0.isColonIncludedInTimeZone();
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test81() throws Throwable {
Locale locale0 = Locale.TRADITIONAL_CHINESE;
TimeZone timeZone0 = StdDateFormat.getDefaultTimeZone();
MockSimpleDateFormat mockSimpleDateFormat0 = (MockSimpleDateFormat)StdDateFormat.getISO8601Format(timeZone0, locale0);
assertEquals("yyyy-MM-dd'T'HH:mm:ss.SSSZ", mockSimpleDateFormat0.toLocalizedPattern());
}
@Test(timeout = 4000)
public void test82() throws Throwable {
StdDateFormat stdDateFormat0 = new StdDateFormat();
try {
stdDateFormat0.parse("-");
fail("Expecting exception: ParseException");
} catch(ParseException e) {
//
// Timestamp value - out of 64-bit value range
//
verifyException("com.fasterxml.jackson.databind.util.StdDateFormat", e);
}
}
@Test(timeout = 4000)
public void test83() throws Throwable {
StdDateFormat stdDateFormat0 = new StdDateFormat();
String string0 = stdDateFormat0.toString();
assertFalse(stdDateFormat0.isColonIncludedInTimeZone());
assertEquals("DateFormat com.fasterxml.jackson.databind.util.StdDateFormat: (timezone: null, locale: en_US, lenient: null)", string0);
}
@Test(timeout = 4000)
public void test84() throws Throwable {
StdDateFormat stdDateFormat0 = new StdDateFormat();
ParsePosition parsePosition0 = new ParsePosition(20);
Date date0 = stdDateFormat0.parse("0000-00-00", parsePosition0);
assertFalse(stdDateFormat0.isColonIncludedInTimeZone());
assertNotNull(date0);
}
@Test(timeout = 4000)
public void test85() throws Throwable {
SimpleTimeZone simpleTimeZone0 = new SimpleTimeZone(1, "2.2250738585072012e-308", 1, (-1), 1, 1, 1, 15, (-1), 15);
StdDateFormat stdDateFormat0 = new StdDateFormat(simpleTimeZone0, (Locale) null);
TimeZone timeZone0 = stdDateFormat0.getTimeZone();
assertNotNull(timeZone0);
assertFalse(stdDateFormat0.isColonIncludedInTimeZone());
}
}
| [
"pderakhshanfar@serg2.ewi.tudelft.nl"
] | pderakhshanfar@serg2.ewi.tudelft.nl |
c3632fc12e58e932a46c1d1f777f3b70385c8777 | 89c34fa76bccdbd44f10416e6529899f005aeea1 | /src/main/java/com/chinesedreamer/eir/vo/query/PoQueryVo.java | 9c7cb009ea00a1005ee5101c73f4dad9319b16f2 | [] | no_license | Sos10086tsj/eir | f734971e1b426ef7bc7668d33eb9f8dd280833cb | fd31ba4668d2d54ea6245baa924f93f0fe06c56c | refs/heads/master | 2020-07-11T02:09:28.896038 | 2016-12-06T06:05:30 | 2016-12-06T06:05:30 | 74,007,108 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 728 | java | package com.chinesedreamer.eir.vo.query;
/**
* Description:
* Auth:Paris
* Date:Nov 17, 2016
**/
public class PoQueryVo extends PageVo{
private Long poId;
private String orderNo;
private String styleNo;
private Long createUser;
public Long getPoId() {
return poId;
}
public void setPoId(Long poId) {
this.poId = poId;
}
public Long getCreateUser() {
return createUser;
}
public void setCreateUser(Long createUser) {
this.createUser = createUser;
}
public String getOrderNo() {
return orderNo;
}
public String getStyleNo() {
return styleNo;
}
public void setOrderNo(String orderNo) {
this.orderNo = orderNo;
}
public void setStyleNo(String styleNo) {
this.styleNo = styleNo;
}
}
| [
"paristao1989@gmail.com"
] | paristao1989@gmail.com |
03b592ba6724b66f0d6c92b50507399409c976c2 | fe3ccf8e407d449795d0a5598b84c27e6938b05d | /EDA - Lista de Prioridades/EDAAlunos/src/br/ufc/quixada/eda/util/Operacao.java | 806b2284516bbbba765e2bfff18f11097ebd3dba | [] | no_license | tassianebarros/EDA | 36b1da782d68d0b3bad7e1306b4974d23675b570 | d0e872eb704bb037b50dc170f5d9536ac7b509d4 | refs/heads/master | 2021-11-27T03:31:52.972099 | 2017-06-19T19:03:01 | 2017-06-19T19:03:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,241 | java | package br.ufc.quixada.eda.util;
/**
* Classe respons�vel por armazenar uma opera��o que ser� realizada na lista de prioridade.
* O atributo id cont�m o identificador da opera��o sendo as seguintes possibilidades: Inser��o: I; Remo��o: R; Altera��o: A; S: Sele��o.
* O atributo valor ter� o valor a ser inserido, o valor que foi removido, o valor que ser� alterado e o valor com maior prioridade, respectivamente para as opera��es de inser��o, remo��o, altera��o e sele��o.
* O atributo novoValor ter� o novo valor da prioridade para a opera��o de altera��o. Para as demais opera��es ele ter� valor 0(zero).
* @author fabio
*
*/
public class Operacao {
private Integer x;
private Integer y;
private Integer peso;
public Operacao(Integer x, Integer y, Integer peso){
this.x = x;
this.y = y;
this.peso = peso;
}
public Integer getX() {
return x;
}
public void setX(Integer x) {
this.x = x;
}
public Integer getY() {
return y;
}
public void setY(Integer y) {
this.y = y;
}
public Integer getPeso() {
return peso;
}
public void setPeso(Integer peso) {
this.peso = peso;
}
}
| [
"tassiane@tassiane"
] | tassiane@tassiane |
bcbc182fe6c5287084c4963ee22514943aa52dff | 7a8696d865ea7fa974c534b050bf700b55f69ba5 | /twitter/hard/296_Best_Meeting_Point.java | 8d56de74054d566a7bed41229e68967cd2d748e5 | [] | no_license | chengdol/leetcode | 5a981e90992fbd937c378f1c380969f581237b6e | 03bb0436a531a6e4d9ca1dcba6df2885381b36d1 | refs/heads/master | 2021-09-03T16:37:36.051983 | 2018-01-10T13:49:09 | 2018-01-10T13:49:09 | 101,024,316 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 934 | java | // hard
class Solution {
public int minTotalDistance(int[][] grid) {
int row = grid.length;
int col = grid[0].length;
List<Integer> rList = new ArrayList<>(row);
List<Integer> cList = new ArrayList<>(col);
for (int i = 0; i < row; i++)
{
for (int j = 0; j < col; j++)
{
if (grid[i][j] == 1)
{
rList.add(i);
cList.add(j);
}
}
}
return getMin(rList) + getMin(cList);
}
// 这个原理以前不知道,取median会使得偏差之和最小
private int getMin(List<Integer> lst)
{
int s = 0;
int e = lst.size() - 1;
int dist = 0;
// must sort
Collections.sort(lst);
while (s < e)
{
dist += lst.get(e--) - lst.get(s++);
}
return dist;
}
}
| [
"chengdol@usc.edu"
] | chengdol@usc.edu |
1b4d48bff59be438501270265fb344d607bb09d5 | 31296560c28477f6a16725706f78fa48b44559bd | /Algo_program/JavaCoding/src/javacoding/JavaCoding.java | 657321bb36152fe7676c6e17607271e1ca636574 | [] | no_license | aacom007/Algo_Programs | c3db9c8c5bcd5faf502759f6e947ca1041ae36b5 | 2f747646fb23d46583ba1a570d5bf8f683b2da51 | refs/heads/master | 2022-07-07T13:46:28.355631 | 2019-07-14T05:15:45 | 2019-07-14T05:15:45 | 19,659,405 | 0 | 1 | null | 2022-06-22T17:21:00 | 2014-05-11T05:39:01 | JavaScript | UTF-8 | Java | false | false | 1,576 | 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 javacoding;
/**
*
* @author akshay anand
*/
public class JavaCoding {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
System.out.println("out :"+ makePalindrome ("addxx"));
}
/**
*
* @author akshay anand
*/
public static String makePalindrome(String s)
{
if(s ==null)
{
return "";
}
if(s.length()==1)
{
return s;
}
String []sarray1 = s.substring(0, s.length()/2).split("");
String []sarray2 = s.substring(s.length()/2,s.length()).split("");
if(check(sarray1,sarray2))
{
return s;
}
else
{
String s11 =s.substring(1,(s.length()));
String s12 = makePalindrome( s11);
return s.charAt(0)+s12+ s.charAt(0);
}
}
public static boolean check(String[] s2, String[] s3)
{
if(s2.equals(reverse(s3)))
return true;
else
return false;
}
public static String reverse(String []s)
{
String s1 ="";
for(int i= s.length-1;i>=0 ;i--)
{
s1+=s[i];
}
return s1;
}
}
| [
"akshayan@usc.edu"
] | akshayan@usc.edu |
e4765ab568c485318ba69558a5706dc222fd727b | c163e06c698d511a87ed9adef17800b2a86962a9 | /src/main/java/com/example/battleship/model/Ship.java | 3083a9c34fdbf81c3843e02e287bc4167260d5c7 | [] | no_license | qwang3q/battleship-spring-react | 160eb0ef3391b5e249cda94059f6f5f2e8541126 | f4a46e6a12df1723bbcc5fb3473ff5c6486452c8 | refs/heads/master | 2020-04-06T09:07:23.542403 | 2018-11-13T06:16:40 | 2018-11-13T06:16:40 | 157,329,878 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,435 | java | package com.example.battleship.model;
import com.fasterxml.jackson.annotation.JsonBackReference;
import com.fasterxml.jackson.annotation.JsonManagedReference;
import javax.persistence.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
* Represents the comman properties of ship in battleship game.
*/
@Entity
public class Ship{
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private Integer id;
@ManyToOne
@JoinColumn(name = "board_id")
@JsonBackReference
private Board map;
@OneToMany(orphanRemoval = true, cascade = CascadeType.ALL, mappedBy = "ship")
@JsonManagedReference
private List<Cell> cells = new ArrayList<Cell>();
private Integer size;
private Integer numOfHitCells;
/**
* Creates a ship.
* @param size the number of cells a ship has, which is greater than 0 and less or equal to 4
* @param numOfHitCells the number of cells that were hit, which is greater than 0 and less or
* equal to ship size
*/
public Ship(Integer size, Integer numOfHitCells) {
this.size = size;
this.numOfHitCells = numOfHitCells;
}
public Ship() {
this(1, 0);
}
/**
* Returns true is the ship has been sunk and false otherwise.
*
* @return true is the ship has been sunk and false otherwise
*/
public Boolean isSunk() {
for(Cell cell : this.cells) {
if (cell.getHit() != true) {
return false;
}
}
return true;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Board getMap() {
return map;
}
public void setMap(Board map) {
this.map = map;
}
public List<Cell> getCells() {
return cells;
}
public void setCells(List<Cell> cells) {
this.cells = cells;
}
public void addCell(Cell cell) {
this.cells.add(cell);
}
public Integer getSize() {
return size;
}
public void setSize(Integer size) {
this.size = size;
}
public Integer getNumOfHitCells() {
return numOfHitCells;
}
public void setNumOfHitCells(Integer numOfHitCells) {
this.numOfHitCells = numOfHitCells;
}
public void incNumOdHitCells() {
this.numOfHitCells++;
}
}
| [
"chao@Chaos-MacBook-Pro.local"
] | chao@Chaos-MacBook-Pro.local |
81130a51a68efb4299e40033cad023f856dcefd8 | 1598c8f16cfa372c709fdda405a2c5ec55dc2f9b | /MavenWebPrj/target/tomcat/work/Tomcat/localhost/MavenWebPrj/org/apache/jsp/jsp/world_jsp.java | 8e4d8bd7821516914880fa8aa73594b3b4894e26 | [
"Apache-2.0"
] | permissive | zkj129/TYXXGL | 983f9efb7b231ccd5e2a82960c05fa476bacbfae | e014ba2833e5073795d23990056a1d4838eacb35 | refs/heads/master | 2020-04-15T10:45:43.170283 | 2019-01-11T01:59:46 | 2019-01-11T01:59:46 | 164,601,648 | 0 | 0 | Apache-2.0 | 2019-01-11T01:59:47 | 2019-01-08T08:30:25 | Java | UTF-8 | Java | false | false | 3,185 | java | /*
* Generated by the Jasper component of Apache Tomcat
* Version: Apache Tomcat/7.0.47
* Generated at: 2019-01-08 07:30:28 UTC
* Note: The last modified time of this file was set to
* the last modified time of the source file after
* generation to assist with modification tracking.
*/
package org.apache.jsp.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
public final class world_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static final javax.servlet.jsp.JspFactory _jspxFactory =
javax.servlet.jsp.JspFactory.getDefaultFactory();
private static java.util.Map<java.lang.String,java.lang.Long> _jspx_dependants;
private javax.el.ExpressionFactory _el_expressionfactory;
private org.apache.tomcat.InstanceManager _jsp_instancemanager;
public java.util.Map<java.lang.String,java.lang.Long> getDependants() {
return _jspx_dependants;
}
public void _jspInit() {
_el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
_jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig());
}
public void _jspDestroy() {
}
public void _jspService(final javax.servlet.http.HttpServletRequest request, final javax.servlet.http.HttpServletResponse response)
throws java.io.IOException, javax.servlet.ServletException {
final javax.servlet.jsp.PageContext pageContext;
javax.servlet.http.HttpSession session = null;
final javax.servlet.ServletContext application;
final javax.servlet.ServletConfig config;
javax.servlet.jsp.JspWriter out = null;
final java.lang.Object page = this;
javax.servlet.jsp.JspWriter _jspx_out = null;
javax.servlet.jsp.PageContext _jspx_page_context = null;
try {
response.setContentType("text/html;charset=UTF-8");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write("\r\n");
out.write("\r\n");
out.write("<html>\r\n");
out.write("<head>\r\n");
out.write(" <title>Title</title>\r\n");
out.write(" <meta charset=\"utf-8\">\r\n");
out.write("</head>\r\n");
out.write("<body>\r\n");
out.write(" word .. jsp\r\n");
out.write("</body>\r\n");
out.write("</html>\r\n");
} catch (java.lang.Throwable t) {
if (!(t instanceof javax.servlet.jsp.SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
try { out.clearBuffer(); } catch (java.io.IOException e) {}
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
else throw new ServletException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
}
| [
"1786864036@qq.com"
] | 1786864036@qq.com |
0b4945279863c8575c2120e09c198769b7055bbe | 5aa4d6e75dff32e54ccaa4b10709e7846721af05 | /samples/j2ee/snippets/com.ibm.sbt.automation.test/src/main/java/com/ibm/sbt/test/controls/grid/CommunityRenderer.java | 930cf2e0b74986c94f6fe63e4a67e9e561606822 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | gnuhub/SocialSDK | 6bc49880e34c7c02110b7511114deb8abfdee924 | 02cc3ac4d131b7a094f6983202c1b5e0043b97eb | refs/heads/master | 2021-01-16T20:08:07.509051 | 2014-07-09T08:53:03 | 2014-07-09T08:53:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,043 | java | /*
* � Copyright IBM Corp. 2012
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package com.ibm.sbt.test.controls.grid;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import com.ibm.sbt.automation.core.test.BaseGridTest;
/**
* @author mwallace
*
* @date 5 Mar 2013
*/
public class CommunityRenderer extends BaseGridTest {
@Test
public void testGrid() {
assertTrue("Expected the test to generate a grid", checkGrid("Toolkit_Controls_Grid_CommunityRenderer", true));
}
}
| [
"LORENZOB@ie.ibm.com"
] | LORENZOB@ie.ibm.com |
961626f395190135bf1ded243e706d2b94930839 | 20a6b99bd0451e553e101d1c6847b9adb71d4db5 | /app/src/main/java/com/example/ruslan/orangeviews/view/consultantView/ConsultantMainProfileSettingsFragment.java | b768a47a386cad56dc8b88fd6184e66c07479bea | [] | no_license | RuslanErdenoff/OrangeV | 5f429be48185f98e51e9ed1fd540d3d87eef32d6 | 21f976323477e72a9091912131b3f6b8632eed3e | refs/heads/master | 2020-04-13T15:10:35.575223 | 2019-01-06T08:49:26 | 2019-01-06T08:49:26 | 163,283,709 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 797 | java | package com.example.ruslan.orangeviews.view.consultantView;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.example.ruslan.orangeviews.R;
/**
* A simple {@link Fragment} subclass.
*/
public class ConsultantMainProfileSettingsFragment extends Fragment {
public ConsultantMainProfileSettingsFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_consultant_main_profile_settings, container, false);
}
}
| [
"erdenoffruslan95@gmail.com"
] | erdenoffruslan95@gmail.com |
9f9bb5ef5965821f38651d76f6c81f83f4b32fd3 | 27bb151ee00f5baa938c57282165b2867d598b99 | /exercíciosProva/ProvaDeEstruturaDeDados/src/main/java/data/provadeestruturadedados/ListaEstatica.java | 22b64057a48e503833e7e519a0a099150e406f63 | [] | no_license | LuisFernandoBenatto/Java-development | 5aa1956f0e086eee99fe6a47b2cdf85d5ed4271d | b22a2fa9cb7c1aa5dc8f7d51be23d6a6df81796b | refs/heads/master | 2021-08-16T11:08:00.353752 | 2021-07-21T00:49:00 | 2021-07-21T00:49:00 | 246,642,877 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,237 | java | package data.provadeestruturadedados;
public class ListaEstatica {
private int TAMANHO;
public Produtos produtos[];
private int ponteiro;
public ListaEstatica (int tamanho) {
this.TAMANHO = tamanho;
this.produtos = new Produtos[this.TAMANHO];
this.ponteiro = 0;
}
public void imprimirLista() {
for (int i = 0; i < this.ponteiro; i++) {
System.out.println(produtos[i].toString());
}
}
public Produtos remover(int remover) {
if (remover < 0 || remover > this.ponteiro){
System.out.println("Lista está vazia");
}
else{
for (int i = remover; i <= this.ponteiro; i++){
if (i< (produtos.length)-1){
produtos[i] = produtos[i+1];
}
}
System.out.println("Removendo!!!!!");
this.ponteiro -= 1;
return produtos[remover];
}
return null;
}
public void inserir(Produtos produto) {
if (this.ponteiro > produtos.length){
System.out.println("A lista já está cheia");
}
else {
System.out.println("Produto inserido com sucesso!!!!");
produtos[this.ponteiro] = produto;
this.ponteiro += 1;
}
}
}
| [
"49990149+LuisFernandoBenatto@users.noreply.github.com"
] | 49990149+LuisFernandoBenatto@users.noreply.github.com |
556c39c2a61d664afbcb5a97db061f5e75eb77ba | 0bff2959001a9c35ffb61bd2bec6c5096fdfef00 | /src/main/java/com/alice/projectKnowledge/vo/KnowledgePointPartVo.java | 0d095f3f751db3bfd06facc34df714d9eba60023 | [] | no_license | zigiii/knowledge | 825c52a18fe3f152ba9787ec216d963878fc5061 | a11dbda844ad881d2251ef0cacb308975200664c | refs/heads/master | 2021-05-11T12:54:44.553466 | 2018-01-16T10:17:02 | 2018-01-16T10:17:02 | 117,667,424 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,766 | java | package com.alice.projectKnowledge.vo;
import java.util.List;
import com.alice.projectKnowledge.bean.CoreKnowledgeImageContent;
import com.alice.projectKnowledge.bean.CoreKnowledgeListContent;
import com.alice.projectKnowledge.bean.CoreKnowledgePointPart;
import com.alice.projectKnowledge.bean.CoreKnowledgeTextContent;
public class KnowledgePointPartVo {
private CoreKnowledgePointPart coreKnowledgePointPart;
private List<CoreKnowledgeListContent> coreKnowledgeListContentList;
private CoreKnowledgeTextContent coreKnowledgeTextContent;
private List<CoreKnowledgeImageContent> coreKnowledgeImageContentList;
public CoreKnowledgePointPart getCoreKnowledgePointPart() {
return coreKnowledgePointPart;
}
public void setCoreKnowledgePointPart(CoreKnowledgePointPart coreKnowledgePointPart) {
this.coreKnowledgePointPart = coreKnowledgePointPart;
}
public List<CoreKnowledgeListContent> getCoreKnowledgeListContentList() {
return coreKnowledgeListContentList;
}
public void setCoreKnowledgeListContentList(List<CoreKnowledgeListContent> coreKnowledgeListContentList) {
this.coreKnowledgeListContentList = coreKnowledgeListContentList;
}
public CoreKnowledgeTextContent getCoreKnowledgeTextContent() {
return coreKnowledgeTextContent;
}
public void setCoreKnowledgeTextContent(CoreKnowledgeTextContent coreKnowledgeTextContent) {
this.coreKnowledgeTextContent = coreKnowledgeTextContent;
}
public List<CoreKnowledgeImageContent> getCoreKnowledgeImageContentList() {
return coreKnowledgeImageContentList;
}
public void setCoreKnowledgeImageContentList(List<CoreKnowledgeImageContent> coreKnowledgeImageContentList) {
this.coreKnowledgeImageContentList = coreKnowledgeImageContentList;
}
}
| [
"zhuzx@gmail.com"
] | zhuzx@gmail.com |
d31757438af1fe71af8e55048e40944910e2b4ac | df77bc6ac1d0e3c385778f97bd60a38c794744c5 | /logi/src/main/java/kr/co/seoulit/system/authorityManager/mapper/AuthorityGroupDAO.java | 981f301b27cafb68261fb753e4d5154963518a1c | [] | no_license | LEECHANHO0807/logistics | 42c98acc5f402774821fd65520b66678752e08ff | 7499269f8085f64b5bbd7cbc6a9a741b8b0bb89e | refs/heads/master | 2023-08-28T00:47:42.086427 | 2021-10-21T07:35:17 | 2021-10-21T07:35:17 | 419,621,499 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 595 | java | package kr.co.seoulit.system.authorityManager.mapper;
import java.util.ArrayList;
import org.apache.ibatis.annotations.Mapper;
import kr.co.seoulit.system.authorityManager.to.AuthorityGroupTO;
import kr.co.seoulit.system.authorityManager.to.EmployeeAuthorityTO;
@Mapper
public interface AuthorityGroupDAO {
public ArrayList<AuthorityGroupTO> selectUserAuthorityGroupList(String empCode);
public ArrayList<AuthorityGroupTO> selectAuthorityGroupList();
public void insertEmployeeAuthorityGroup(EmployeeAuthorityTO bean);
public void deleteEmployeeAuthorityGroup(String empCode);
}
| [
"cse05256@naver.com"
] | cse05256@naver.com |
f41e4d698238528c1454929c84fc2deef60e5802 | 69d821688a8566aa1be0c04222d00927d03f9f7b | /email/email-api/src/main/java/com/zx/email/model/PmsProductInfomodel.java | b5955fa05bf52163867577a13db4d835d329fd77 | [] | no_license | devil-zx/recreate-by-oneself | dacf6e786f039c88a0f069c8b6772322770c3c00 | df0576bda73b410e6366b5e91afef03995b8fd87 | refs/heads/master | 2022-09-20T01:05:38.572555 | 2019-12-24T06:12:26 | 2019-12-24T06:12:26 | 229,686,588 | 0 | 0 | null | 2022-09-01T23:17:50 | 2019-12-23T05:57:51 | Java | UTF-8 | Java | false | false | 1,924 | java | package com.zx.email.model;
import javax.persistence.*;
import java.util.Objects;
@Entity
@Table(name = "pms_product_info", schema = "gemail", catalog = "")
public class PmsProductInfomodel {
private int id;
private String productName;
private String description;
private Integer catalog3Id;
private Integer tmId;
@Id
@Column(name = "id")
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
@Basic
@Column(name = "product_name")
public String getProductName() {
return productName;
}
public void setProductName(String productName) {
this.productName = productName;
}
@Basic
@Column(name = "description")
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
@Basic
@Column(name = "catalog3_id")
public Integer getCatalog3Id() {
return catalog3Id;
}
public void setCatalog3Id(Integer catalog3Id) {
this.catalog3Id = catalog3Id;
}
@Basic
@Column(name = "tm_id")
public Integer getTmId() {
return tmId;
}
public void setTmId(Integer tmId) {
this.tmId = tmId;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
PmsProductInfomodel that = (PmsProductInfomodel) o;
return id == that.id &&
Objects.equals(productName, that.productName) &&
Objects.equals(description, that.description) &&
Objects.equals(catalog3Id, that.catalog3Id) &&
Objects.equals(tmId, that.tmId);
}
@Override
public int hashCode() {
return Objects.hash(id, productName, description, catalog3Id, tmId);
}
}
| [
"1976706634@qq.com"
] | 1976706634@qq.com |
5ff99be85e5994e6518a3254525510a44a1fcf2f | 1acd92a8de398abd96005a1ce7a5b9ed93b8a5cc | /library/src/main/java/com/yanyiyun/function/dialog/product/ConfirmAndCancleDialog.java | 383d180e383ac313b051a684c2ff4c7be1e0d132 | [] | no_license | wscoding/BaseUtils | 3ddf9a8f8f09a7cc158affa6ea19a4faa1b8a1f0 | 876450b3bd430e6915132732cde2e09684bbff8f | refs/heads/master | 2023-05-10T16:33:14.690981 | 2020-08-30T18:06:37 | 2020-08-30T18:06:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,516 | java | package com.yanyiyun.function.dialog.product;
import android.app.Dialog;
import android.content.Context;
import android.support.annotation.NonNull;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.yanyiyun.R;
/**
* 有确定取消两个按钮的对话框
*/
public class ConfirmAndCancleDialog extends Dialog implements View.OnClickListener {
public View view;
/**
* 标题
*/
public TextView title_tv;
/**
* 取消按钮
*/
public TextView cancle_tv;
/**
* 确定按钮
*/
public TextView confirm_tv;
/**
* 对话框内容容器
*/
public LinearLayout content_ll;
/**
* 对话框容器
*/
public LinearLayout main_ll;
/**
* 按钮容器
*/
public LinearLayout button_ll;
private OnCancleAndConfirmListener listener;
public ConfirmAndCancleDialog(@NonNull Context context) {
super(context);
view=LayoutInflater.from(context).inflate(R.layout.confirm_and_cancle_dialog,null);
initview();
}
private void initview() {
title_tv=view.findViewById(R.id.title_tv);
main_ll=view.findViewById(R.id.main_ll);
content_ll=view.findViewById(R.id.content_ll);
button_ll=view.findViewById(R.id.button_ll);
cancle_tv=view.findViewById(R.id.cancle_tv);
cancle_tv.setOnClickListener(this);
confirm_tv=view.findViewById(R.id.confirm_tv);
confirm_tv.setOnClickListener(this);
Window window=getWindow();
window.setGravity(Gravity.CENTER);
window.setContentView(view);
window.setLayout(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT);
window.setBackgroundDrawableResource(android.R.color.transparent);
}
public void setOnCancleAndConfirmListener(OnCancleAndConfirmListener l){
listener=l;
}
public interface OnCancleAndConfirmListener {
public void cancle();
public void confirm();
}
@Override
public void onClick(View v) {
if(v.getId()==R.id.cancle_tv){//取消
if(listener!=null){
listener.cancle();
}
}else if(v.getId()==R.id.confirm_tv){ //确定
if(listener!=null){
listener.confirm();
}
}
}
}
| [
"1206995290@qq.com"
] | 1206995290@qq.com |
2038be342e2f2d5150c4dc029d5cdcccfd9bcdca | 1f3ee46fb59e73bc69178571a2eaf6afe0ac83ca | /version_0.1/MenuDesigner/MenuDesigner-Background/src/main/java/com/menudesigner/sjbs/web/controllers/IndexController.java | 9f04d13065f859d69ba57aab1d7f05a78a3db315 | [] | no_license | benli0822/shangjibashi | 2f09a94e839440470d31b5951a936a22b8d2ddc0 | 0f4f212d4d371b6883be8ffa9bad68a5bd6782e1 | refs/heads/master | 2021-01-12T21:05:13.854179 | 2015-06-27T19:13:14 | 2015-06-27T19:13:14 | 24,152,011 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,715 | java | package com.menudesigner.sjbs.web.controllers;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.thymeleaf.TemplateEngine;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.text.DateFormat;
import java.util.Date;
import java.util.Locale;
/**
* Back office index page.
* Created by JIN Benli on 16/09/13.
*/
@Controller
public class IndexController implements BaseController {
private static final Logger logger = LoggerFactory.getLogger(IndexController.class);
/**
* Simply selects the home view to render by returning its name.
* @param locale Localisation settings
* @param model Page model
* @return Thymeleaf path
*/
@RequestMapping(value = "/", method = RequestMethod.GET)
public String index(Locale locale, Model model) {
logger.info("Welcome home! The client locale is {}.", locale);
Date date = new Date();
DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, locale);
String formattedDate = dateFormat.format(date);
model.addAttribute("serverTime", formattedDate);
return "views/index";
}
/**
*
* @param request
* @param response
* @param servletContext
* @param templateEngine
*/
@Override
public void process(HttpServletRequest request, HttpServletResponse response, ServletContext servletContext,
TemplateEngine templateEngine) {
}
}
| [
"benli0822@gmail.com"
] | benli0822@gmail.com |
e96bdf4af786ab528850988fe99f508767981909 | baa7531cfa39accd4281b889ac7708ebf5885484 | /VST Java/src/com/vstjava/day2/TestLoops.java | 39224c27e9c6c3f846ac488231a8c1bddd35d764 | [] | no_license | nikhil-badgujar/VST_Java | b11a4394ba6190a570b507d51235747206d2a80f | 4d865d01c6769d730dccec6338fd77007fe7c3a1 | refs/heads/main | 2023-04-23T21:26:10.680436 | 2021-05-07T07:28:44 | 2021-05-07T07:28:44 | 362,094,266 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,099 | java | package com.vstjava.day2;
public class TestLoops {
String []strArr = {"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug",
"Sep","Oct","Nov","Dec"};
public void forLoop() {
for(int intCount = 0; intCount < strArr.length; intCount++)
{
System.out.println("Index " + intCount + " : " + strArr[intCount]);
}
}
public void forEachLoop() {
for(String strValue : strArr)
{
System.out.println("Values " + strValue);
}
}
public void whileLoop() {
int intCount = 0;
while(intCount < strArr.length) {
System.out.println("Index " + intCount + " : " + strArr[intCount]);
intCount++;
}
}
public void doWhileLoop() {
int intCount = 0;
do {
System.out.println("Index " + intCount + " : " + strArr[intCount]);
intCount++;
}while(intCount < strArr.length);
}
public static void main(String[] args) {
// TODO Auto-generated method stub
TestLoops objTestLoops = new TestLoops();
objTestLoops.forLoop();
objTestLoops.forEachLoop();
objTestLoops.whileLoop();
objTestLoops.doWhileLoop();
}
}
| [
"nikbad36@gmail.com"
] | nikbad36@gmail.com |
f88f6407298cc5d8346fd327c38a8476724d9a66 | 8b89a7e9d00c853c3b83ce6afb45cc185a214034 | /jenme-admin/src/main/java/com/cantonsoft/admin/security/cache/AcClientCacheExecutor.java | a2b1ded8687373aa8c94b4c9133e14275995e5fb | [] | no_license | shifre/lib | e78f44ac38e459d9d4e25900870c8085f4e5bb30 | 21f3ed9c78d95d62b5f8f32e9ed94cd3ee2a815a | refs/heads/master | 2020-03-08T05:04:10.814237 | 2018-04-05T16:14:46 | 2018-04-05T16:14:46 | 127,938,523 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 817 | java | package com.cantonsoft.admin.security.cache;
import org.springframework.beans.factory.annotation.Autowired;
import com.cantonsoft.admin.security.model.AcClientPartner;
import com.cantonsoft.core.cloud.client.ClientService;
import com.cantonsoft.core.cloud.client.model.Client;
import com.cantonsoft.framework.cache.CacheDataExecutor;
public class AcClientCacheExecutor extends CacheDataExecutor<Long> {
@Autowired
private ClientService clientService;
@Override
protected Object createData(Long key)
{
return createAcClient(key);
}
private Object createAcClient(Long clientId)
{
AcClientPartner obj = new AcClientPartner();
Client client=clientService.find(clientId);
if(client!=null){
obj.setClientId(client.getId());
obj.setPartnerId(client.getPartnerId());
}
return obj;
}
}
| [
"864892298@qq.com"
] | 864892298@qq.com |
a06ed01a651cbd88792a394e8237cf77aa3e171b | cda1a29b5a66975b04a7438bacd41fbb4212a08c | /src/main/java/com/meliora/common/CriteriaSort.java | 673a8bb3fba1f1482a0fe45cd3ad4954e650d6ed | [] | no_license | zwj5582/120ManageHUZHOU | d28f9812920ccd09f4f43d78784de71d6414705a | 18df9d2c07cf0eede9894bbebd1bb7b473fe248c | refs/heads/master | 2021-07-12T21:32:29.674160 | 2017-10-15T04:14:39 | 2017-10-15T04:14:39 | 106,977,001 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,145 | java | /*
* Created by ZhongWenjie on 2017-09-23 14:19
*/
package com.meliora.common;
import lombok.Data;
import lombok.NonNull;
import org.springframework.validation.annotation.Validated;
@Data
@Validated
public class CriteriaSort {
private static final Direction DEFUALT_DIRECTION = Direction.ASC;
@NonNull
private String property;
private Direction direction = DEFUALT_DIRECTION;
private CriteriaSort(){}
public static CriteriaSortBuilder builder(String property){
return new CriteriaSortBuilder(property);
}
public static class CriteriaSortBuilder{
private CriteriaSort criteriaSort;
private CriteriaSortBuilder(){}
private CriteriaSortBuilder(String property){
criteriaSort = new CriteriaSort();
criteriaSort.property=property;
}
public CriteriaSortBuilder direction(Direction direction){
criteriaSort.direction=direction;
return this;
}
public CriteriaSort build(){
return this.criteriaSort;
}
}
public enum Direction{
ASC,
DESC
}
}
| [
"zwj5582@gmail.com"
] | zwj5582@gmail.com |
ef5b1db4345c89d982814c891320dab285f218da | c07c6856cc02ee635ae19393a12fb553ad54a3a1 | /src/main/java/com/decre/data/mathematics/mathematicsdemo/binarytree/MergeSort.java | 245d9e99023b4a865a9724c4395f5a01c8d2d320 | [] | no_license | JingDecre/data-structures-demo | 502671a81b494c67f0a694906ea937df4d5be6ae | e1a6d25e7b41853ac7130793d318e45066afbe46 | refs/heads/master | 2023-04-06T09:39:47.610242 | 2021-04-03T14:11:18 | 2021-04-03T14:11:18 | 326,712,282 | 1 | 0 | null | 2021-04-03T14:11:18 | 2021-01-04T14:37:47 | Java | UTF-8 | Java | false | false | 1,758 | java | package com.decre.data.mathematics.mathematicsdemo.binarytree;
import com.decre.data.structures.datastructuresdemo.util.ArrayUtils;
import java.util.Arrays;
/**
* @className: MergeSort
* @description: 归并排序
* @author: decre
* @date: 2021/3/22
**/
public class MergeSort {
public static void main(String[] args) {
int[] nums = ArrayUtils.randomInit(10);
System.out.println(Arrays.toString(nums));
int[] tempArr = new int[nums.length];
mergeSort(nums, 0, nums.length - 1, tempArr);
System.out.println(Arrays.toString(nums));
}
private static void mergeSort(int[] nums, int left, int right, int[] tempArr) {
if (left < right) {
int mid = left + (right - left) / 2;
mergeSort(nums, left, mid, tempArr);
mergeSort(nums, mid + 1, right, tempArr);
merge(nums, left, mid, right, tempArr);
}
}
private static void merge(int[] nums, int left, int mid, int right, int[] tempArr) {
int l = left;
int r = mid + 1;
int t = 0;
while (l <= mid && r <= right) {
if (nums[l] <= nums[r]) {
tempArr[t] = nums[l];
l++;
t++;
} else {
tempArr[t] = nums[r];
r++;
t++;
}
}
while (l <= mid) {
tempArr[t] = nums[l];
l++;
t++;
}
while (r <= right) {
tempArr[t] = nums[r];
r++;
t++;
}
t = 0;
int tempLeft = left;
while (tempLeft <= right) {
nums[tempLeft] = tempArr[t];
tempLeft++;
t++;
}
}
}
| [
"l761213825@163.com"
] | l761213825@163.com |
3a31a347e109b1f89d8f6bd4c4b26f6da5b93c0b | 59f6782289057465d1ed1c065c6df990365e7a91 | /src/main/java/xyz/e3ndr/endersadditions/food/FoodBlorox.java | b0edd3b112b51ebe79c46ac6230b1f281fb93ce0 | [
"MIT"
] | permissive | e3ndr/EndersAdditions | 81f5b5407ade597c63a6339eb28760d7358da806 | 72a5a240d5c2e07171d63a459172b4e441ccbf63 | refs/heads/master | 2022-12-07T15:01:11.204259 | 2022-11-29T20:42:09 | 2022-11-29T20:42:09 | 147,137,017 | 1 | 0 | null | 2022-11-16T19:42:49 | 2018-09-03T01:35:05 | Java | UTF-8 | Java | false | false | 1,398 | java | package xyz.e3ndr.endersadditions.food;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.world.World;
import xyz.e3ndr.endersadditions.EndersAdditions;
import xyz.e3ndr.endersadditions.Registry;
public class FoodBlorox extends ItemFood {
public FoodBlorox() {
super(0, 0, false);
this.setAlwaysEdible();
this.setMaxStackSize(64);
this.setCreativeTab(EndersAdditions.tabEnder);
this.setUnlocalizedName(EndersAdditions.generateUnlocalizedName("blorox"));
this.setTextureName(EndersAdditions.generateTextureName("blorox"));
GameRegistry.registerItem(this, "blorox");
}
@Override
public void onFoodEaten(ItemStack itemStack, World world, EntityPlayer player) {
super.onFoodEaten(itemStack, world, player);
if (!world.isRemote) {
player.addPotionEffect(new PotionEffect(Potion.wither.id, 10000, 100));
player.addPotionEffect(new PotionEffect(Potion.blindness.id, 10000, 100));
player.addPotionEffect(new PotionEffect(Potion.hunger.id, 10000, 100));
player.attackEntityFrom(Registry.damageSourceBleach, Float.MAX_VALUE);
}
}
}
| [
"33337309+e3ndr@users.noreply.github.com"
] | 33337309+e3ndr@users.noreply.github.com |
4603d5686482f99d97e78e58de1d0715b3608296 | 69f56072af45e60bd6b749fde9084efab8af184e | /app/src/main/java/com/john/mvvmframework/ui/views/SplashView.java | 87964cbbc43955d8493453b2edf6c2a487b423b3 | [] | no_license | jbfuertes/MVVMFramework | c3edce39188226dec90b79230703c035b64051ad | 246ef4a35e92f53213f012358af694c8cbe8badd | refs/heads/master | 2021-04-26T23:47:55.080630 | 2018-03-11T12:06:06 | 2018-03-11T12:06:06 | 123,858,396 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 93 | java | package com.john.mvvmframework.ui.views;
public interface SplashView extends BaseView{
}
| [
"johnberlinfuertes@gmail.com"
] | johnberlinfuertes@gmail.com |
4bcfc710f5647d86e05b319a8c18f8874dca4438 | 112d8d1221ec749ec9372cf81d19f1bbc052f69d | /DevSkill Easy Contest 6/src/ProblemE.java | 6f2674ebbcd3bc02d625c0b79287cfeb7361951b | [] | no_license | amit39766/workspace | 31ff8ffbe56b1f46bede668cb83b7b0d1a73463d | 7b4bf6a8efd2c5d56eeb22c6478ebf7d2b18e8be | refs/heads/master | 2021-01-11T18:51:10.494970 | 2017-01-21T10:57:55 | 2017-01-21T10:57:55 | 79,639,992 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,100 | java | import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class ProblemE {
public static void main(String[] args) {
// TODO Auto-generated method stub
}
}
class eFastScanner {
BufferedReader br;
StringTokenizer st;
public eFastScanner(String s) {
try {
br = new BufferedReader(new FileReader(s));
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public eFastScanner() {
br = new BufferedReader(new InputStreamReader(System.in));
}
String nextToken() {
while (st == null || !st.hasMoreElements()) {
try {
st = new StringTokenizer(br.readLine());
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
return st.nextToken();
}
int nextInt() {
return Integer.parseInt(nextToken());
}
long nextLong() {
return Long.parseLong(nextToken());
}
double nextDouble() {
return Double.parseDouble(nextToken());
}
}
| [
"amit39766@outlook.com"
] | amit39766@outlook.com |
455feac3494505823742043248c4bce26a4e7802 | 914db536c9ea01e3f26f1ad54932419bbc0cb780 | /src/main/java/com/parkerneff/cosmo/web/rest/UserResource.java | aacdacf4912fd10b80e6fcb8766c77383a264b91 | [] | no_license | BulkSecurityGeneratorProject/cosmo | e80697a0b10d2962de6022ee4602fe5f88c9ab49 | 2cb360b8790d83b4c0bd5c729c91da740e5a07f1 | refs/heads/master | 2022-12-19T08:10:13.075554 | 2017-08-01T16:11:38 | 2017-08-01T16:11:38 | 296,628,593 | 0 | 0 | null | 2020-09-18T13:26:49 | 2020-09-18T13:26:48 | null | UTF-8 | Java | false | false | 8,794 | java | package com.parkerneff.cosmo.web.rest;
import com.parkerneff.cosmo.config.Constants;
import com.codahale.metrics.annotation.Timed;
import com.parkerneff.cosmo.domain.User;
import com.parkerneff.cosmo.repository.UserRepository;
import com.parkerneff.cosmo.security.AuthoritiesConstants;
import com.parkerneff.cosmo.service.MailService;
import com.parkerneff.cosmo.service.UserService;
import com.parkerneff.cosmo.service.dto.UserDTO;
import com.parkerneff.cosmo.web.rest.vm.ManagedUserVM;
import com.parkerneff.cosmo.web.rest.util.HeaderUtil;
import com.parkerneff.cosmo.web.rest.util.PaginationUtil;
import io.github.jhipster.web.util.ResponseUtil;
import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.annotation.Secured;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.*;
/**
* REST controller for managing users.
* <p>
* This class accesses the User entity, and needs to fetch its collection of authorities.
* <p>
* For a normal use-case, it would be better to have an eager relationship between User and Authority,
* and send everything to the client side: there would be no View Model and DTO, a lot less code, and an outer-join
* which would be good for performance.
* <p>
* We use a View Model and a DTO for 3 reasons:
* <ul>
* <li>We want to keep a lazy association between the user and the authorities, because people will
* quite often do relationships with the user, and we don't want them to get the authorities all
* the time for nothing (for performance reasons). This is the #1 goal: we should not impact our users'
* application because of this use-case.</li>
* <li> Not having an outer join causes n+1 requests to the database. This is not a real issue as
* we have by default a second-level cache. This means on the first HTTP call we do the n+1 requests,
* but then all authorities come from the cache, so in fact it's much better than doing an outer join
* (which will get lots of data from the database, for each HTTP call).</li>
* <li> As this manages users, for security reasons, we'd rather have a DTO layer.</li>
* </ul>
* <p>
* Another option would be to have a specific JPA entity graph to handle this case.
*/
@RestController
@RequestMapping("/api")
public class UserResource {
private final Logger log = LoggerFactory.getLogger(UserResource.class);
private static final String ENTITY_NAME = "userManagement";
private final UserRepository userRepository;
private final MailService mailService;
private final UserService userService;
public UserResource(UserRepository userRepository, MailService mailService,
UserService userService) {
this.userRepository = userRepository;
this.mailService = mailService;
this.userService = userService;
}
/**
* POST /users : Creates a new user.
* <p>
* Creates a new user if the login and email are not already used, and sends an
* mail with an activation link.
* The user needs to be activated on creation.
*
* @param managedUserVM the user to create
* @return the ResponseEntity with status 201 (Created) and with body the new user, or with status 400 (Bad Request) if the login or email is already in use
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PostMapping("/users")
@Timed
@Secured(AuthoritiesConstants.ADMIN)
public ResponseEntity createUser(@Valid @RequestBody ManagedUserVM managedUserVM) throws URISyntaxException {
log.debug("REST request to save User : {}", managedUserVM);
if (managedUserVM.getId() != null) {
return ResponseEntity.badRequest()
.headers(HeaderUtil.createFailureAlert(ENTITY_NAME, "idexists", "A new user cannot already have an ID"))
.body(null);
// Lowercase the user login before comparing with database
} else if (userRepository.findOneByLogin(managedUserVM.getLogin().toLowerCase()).isPresent()) {
return ResponseEntity.badRequest()
.headers(HeaderUtil.createFailureAlert(ENTITY_NAME, "userexists", "Login already in use"))
.body(null);
} else if (userRepository.findOneByEmail(managedUserVM.getEmail()).isPresent()) {
return ResponseEntity.badRequest()
.headers(HeaderUtil.createFailureAlert(ENTITY_NAME, "emailexists", "Email already in use"))
.body(null);
} else {
User newUser = userService.createUser(managedUserVM);
mailService.sendCreationEmail(newUser);
return ResponseEntity.created(new URI("/api/users/" + newUser.getLogin()))
.headers(HeaderUtil.createAlert( "userManagement.created", newUser.getLogin()))
.body(newUser);
}
}
/**
* PUT /users : Updates an existing User.
*
* @param managedUserVM the user to update
* @return the ResponseEntity with status 200 (OK) and with body the updated user,
* or with status 400 (Bad Request) if the login or email is already in use,
* or with status 500 (Internal Server Error) if the user couldn't be updated
*/
@PutMapping("/users")
@Timed
@Secured(AuthoritiesConstants.ADMIN)
public ResponseEntity<UserDTO> updateUser(@Valid @RequestBody ManagedUserVM managedUserVM) {
log.debug("REST request to update User : {}", managedUserVM);
Optional<User> existingUser = userRepository.findOneByEmail(managedUserVM.getEmail());
if (existingUser.isPresent() && (!existingUser.get().getId().equals(managedUserVM.getId()))) {
return ResponseEntity.badRequest().headers(HeaderUtil.createFailureAlert(ENTITY_NAME, "emailexists", "Email already in use")).body(null);
}
existingUser = userRepository.findOneByLogin(managedUserVM.getLogin().toLowerCase());
if (existingUser.isPresent() && (!existingUser.get().getId().equals(managedUserVM.getId()))) {
return ResponseEntity.badRequest().headers(HeaderUtil.createFailureAlert(ENTITY_NAME, "userexists", "Login already in use")).body(null);
}
Optional<UserDTO> updatedUser = userService.updateUser(managedUserVM);
return ResponseUtil.wrapOrNotFound(updatedUser,
HeaderUtil.createAlert("userManagement.updated", managedUserVM.getLogin()));
}
/**
* GET /users : get all users.
*
* @param pageable the pagination information
* @return the ResponseEntity with status 200 (OK) and with body all users
*/
@GetMapping("/users")
@Timed
public ResponseEntity<List<UserDTO>> getAllUsers(@ApiParam Pageable pageable) {
final Page<UserDTO> page = userService.getAllManagedUsers(pageable);
HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, "/api/users");
return new ResponseEntity<>(page.getContent(), headers, HttpStatus.OK);
}
/**
* @return a string list of the all of the roles
*/
@GetMapping("/users/authorities")
@Timed
@Secured(AuthoritiesConstants.ADMIN)
public List<String> getAuthorities() {
return userService.getAuthorities();
}
/**
* GET /users/:login : get the "login" user.
*
* @param login the login of the user to find
* @return the ResponseEntity with status 200 (OK) and with body the "login" user, or with status 404 (Not Found)
*/
@GetMapping("/users/{login:" + Constants.LOGIN_REGEX + "}")
@Timed
public ResponseEntity<UserDTO> getUser(@PathVariable String login) {
log.debug("REST request to get User : {}", login);
return ResponseUtil.wrapOrNotFound(
userService.getUserWithAuthoritiesByLogin(login)
.map(UserDTO::new));
}
/**
* DELETE /users/:login : delete the "login" User.
*
* @param login the login of the user to delete
* @return the ResponseEntity with status 200 (OK)
*/
@DeleteMapping("/users/{login:" + Constants.LOGIN_REGEX + "}")
@Timed
@Secured(AuthoritiesConstants.ADMIN)
public ResponseEntity<Void> deleteUser(@PathVariable String login) {
log.debug("REST request to delete User: {}", login);
userService.deleteUser(login);
return ResponseEntity.ok().headers(HeaderUtil.createAlert( "userManagement.deleted", login)).build();
}
}
| [
"pneff@unicon.net"
] | pneff@unicon.net |
4fd8ab0d36e214d1abda87b462c4836d90bb959b | 74b47b895b2f739612371f871c7f940502e7165b | /aws-java-sdk-ebs/src/main/java/com/amazonaws/services/ebs/model/Block.java | 8f5c300065e265cb0c7a9b437d5ef2408074a3b4 | [
"Apache-2.0"
] | permissive | baganda07/aws-sdk-java | fe1958ed679cd95b4c48f971393bf03eb5512799 | f19bdb30177106b5d6394223a40a382b87adf742 | refs/heads/master | 2022-11-09T21:55:43.857201 | 2022-10-24T21:08:19 | 2022-10-24T21:08:19 | 221,028,223 | 0 | 0 | Apache-2.0 | 2019-11-11T16:57:12 | 2019-11-11T16:57:11 | null | UTF-8 | Java | false | false | 5,269 | java | /*
* Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.ebs.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
* <p>
* A block of data in an Amazon Elastic Block Store snapshot.
* </p>
*
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/ebs-2019-11-02/Block" target="_top">AWS API Documentation</a>
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class Block implements Serializable, Cloneable, StructuredPojo {
/**
* <p>
* The block index.
* </p>
*/
private Integer blockIndex;
/**
* <p>
* The block token for the block index.
* </p>
*/
private String blockToken;
/**
* <p>
* The block index.
* </p>
*
* @param blockIndex
* The block index.
*/
public void setBlockIndex(Integer blockIndex) {
this.blockIndex = blockIndex;
}
/**
* <p>
* The block index.
* </p>
*
* @return The block index.
*/
public Integer getBlockIndex() {
return this.blockIndex;
}
/**
* <p>
* The block index.
* </p>
*
* @param blockIndex
* The block index.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Block withBlockIndex(Integer blockIndex) {
setBlockIndex(blockIndex);
return this;
}
/**
* <p>
* The block token for the block index.
* </p>
*
* @param blockToken
* The block token for the block index.
*/
public void setBlockToken(String blockToken) {
this.blockToken = blockToken;
}
/**
* <p>
* The block token for the block index.
* </p>
*
* @return The block token for the block index.
*/
public String getBlockToken() {
return this.blockToken;
}
/**
* <p>
* The block token for the block index.
* </p>
*
* @param blockToken
* The block token for the block index.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Block withBlockToken(String blockToken) {
setBlockToken(blockToken);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getBlockIndex() != null)
sb.append("BlockIndex: ").append(getBlockIndex()).append(",");
if (getBlockToken() != null)
sb.append("BlockToken: ").append(getBlockToken());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof Block == false)
return false;
Block other = (Block) obj;
if (other.getBlockIndex() == null ^ this.getBlockIndex() == null)
return false;
if (other.getBlockIndex() != null && other.getBlockIndex().equals(this.getBlockIndex()) == false)
return false;
if (other.getBlockToken() == null ^ this.getBlockToken() == null)
return false;
if (other.getBlockToken() != null && other.getBlockToken().equals(this.getBlockToken()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getBlockIndex() == null) ? 0 : getBlockIndex().hashCode());
hashCode = prime * hashCode + ((getBlockToken() == null) ? 0 : getBlockToken().hashCode());
return hashCode;
}
@Override
public Block clone() {
try {
return (Block) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.ebs.model.transform.BlockMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}
| [
""
] | |
3f347e9d63810a10a5ceee18125be0f2ea9ca2e2 | 09c2c6f825bd93747fa19e9d90118314d2d22445 | /src/main/java/com/wmding/blog/dao/BlogTagMapper.java | 3490b6f2aeb4625b32c2f101253c09ad04d76319 | [
"Apache-2.0"
] | permissive | zhangxiaodong-git/My-Blog | 744b2a913878d2ca03562c42412ebb0dd9ed3476 | a5aea23dc33e7305ca61ebf255c97318747415fd | refs/heads/master | 2022-04-09T20:33:58.645513 | 2020-03-24T12:58:58 | 2020-03-24T12:58:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 757 | java | package com.wmding.blog.dao;
import com.wmding.blog.entity.BlogTag;
import com.wmding.blog.entity.BlogTagCount;
import com.wmding.blog.util.PageQueryUtil;
import java.util.List;
public interface BlogTagMapper {
int deleteByPrimaryKey(Integer tagId);
int insert(BlogTag record);
int insertSelective(BlogTag record);
BlogTag selectByPrimaryKey(Integer tagId);
BlogTag selectByTagName(String tagName);
int updateByPrimaryKeySelective(BlogTag record);
int updateByPrimaryKey(BlogTag record);
List<BlogTag> findTagList(PageQueryUtil pageUtil);
List<BlogTagCount> getTagCount();
int getTotalTags(PageQueryUtil pageUtil);
int deleteBatch(Integer[] ids);
int batchInsertBlogTag(List<BlogTag> tagList);
} | [
"mingding.wang@esandinfo.com"
] | mingding.wang@esandinfo.com |
4bf1cb08733c6c60635ad581c4d56668489359b3 | baf6cbeaae61cc72ff468c67a6edd65786a34474 | /src/main/java/com/hananins/mysite/interceptor/MyInterceptor2.java | 052392867246e1b9f0ec4924889509d56501855d | [] | no_license | Choyoungju/realsite | 4acbf768b7f93908b5f10da9bc4e3c7d81cc401b | 0abc6876a8fb434073ca7696d7419813393c258a | refs/heads/master | 2023-04-08T16:11:28.775344 | 2023-03-18T16:46:40 | 2023-03-18T16:46:40 | 51,117,373 | 0 | 0 | null | 2023-03-18T16:46:41 | 2016-02-05T01:04:20 | Java | UTF-8 | Java | false | false | 474 | java | package com.hananins.mysite.interceptor;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
public class MyInterceptor2 extends HandlerInterceptorAdapter {
@Override
public boolean preHandle(HttpServletRequest request,
HttpServletResponse response, Object handler) throws Exception {
System.out.println(" 프리 콜");
return true;
}
}
| [
"dudwn.wh@gmail.com"
] | dudwn.wh@gmail.com |
1fb53c1c53508e7cb19927e2357d2c2b146bcbb3 | b0bc3c7959b8a2b15d6b8dcfb410b3cf6103206c | /app/src/main/java/com/example/hackathonapp/forum.java | 3469d284837440fbb994f7a5819d62615e9b8e82 | [] | no_license | Rinkonfs/StopiT | 25e69f19055d45da4f4ef5bbf3cceb0f9dad9803 | eee27a7ad625f2a3a9ad93f3f1b5aa94218f1707 | refs/heads/master | 2020-06-30T04:25:31.704226 | 2019-08-05T20:54:08 | 2019-08-05T20:54:08 | 200,724,421 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 787 | java | package com.example.hackathonapp;
public class forum {
public String title;
public String author;
public String description;
public forum (){}
public forum (String title, String author, String description) {
this.title = title;
this.author = author;
this.description = description;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
}
| [
"rinkonfs@gmail.com"
] | rinkonfs@gmail.com |
898a857bd3560c3f65192927ef46c811155ac6ef | 89d629b9dc26f087625ab0c554a6df96971eaa39 | /com.jevetools.bulkdata.model.api.impl/src/com/jevetools/bulkdata/model/api/ram/impl/TypeRequirementAdapter.java | 0184e8d0eb63e50a6b9351dbb3da81ba95aeee08 | [] | no_license | jevetools/bulkdata.model | c2d4570e6813ffa40b7ed2a5dba5a8dea089df43 | 63b36aa0fa84319eac34eda05b403cadc1b4e562 | refs/heads/master | 2021-01-23T13:35:58.471434 | 2013-10-02T18:41:49 | 2013-10-02T18:41:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,571 | java | /*
* Copyright (c) 2013, jEVETools
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the author nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package com.jevetools.bulkdata.model.api.ram.impl;
import com.jevetools.bulkdata.model.api.impl.internal.AbstractAdapter;
import com.jevetools.data.model.api.Entity;
import com.jevetools.data.model.api.ram.TypeRequirement;
import com.jevetools.data.model.api.ram.impl.TypeRequirementImpl;
import com.jevetools.unmarshal.api.service.UnmarshalService;
import com.jevetools.unmarshal.python.api.PyBase;
import com.jevetools.unmarshal.python.api.PyDBRow;
import com.jevetools.unmarshal.python.api.PyDict;
/**
* Copyright (c) 2013, jEVETools.
*
* All rights reserved.
*
* @version 0.0.1
* @since 0.0.1
*/
public final class TypeRequirementAdapter
extends AbstractAdapter<TypeRequirement>
{
/**
* Static instance.
*/
public static final TypeRequirementAdapter INSTANCE =
new TypeRequirementAdapter();
@Override
public boolean matches(final Class<? extends Entity> aClass)
{
return aClass.equals(TypeRequirement.class);
}
@Override
public TypeRequirement adapt(final PyDBRow aPyDBRow,
final UnmarshalService aService)
{
final PyDict map = getDBRowDict(aPyDBRow);
final TypeRequirementImpl.Builder builder =
new TypeRequirementImpl.Builder();
final PyBase pyActivityID = getDictValue(aService, map, "activityID");
final PyBase pyDamage = getDictValue(aService, map, "damagePerJob");
final PyBase pyQuantity = getDictValue(aService, map, "quantity");
final PyBase pyRecycle = getDictValue(aService, map, "recycle");
final PyBase pyRequiredID = getDictValue(aService, map, "requiredTypeID");
final PyBase pyTypeID = getDictValue(aService, map, "typeID");
builder.activityID(getIntValue(pyActivityID));
builder.damagePerJob(getDoubleValue(pyDamage));
builder.recycle(getBooleanValue(pyRecycle));
builder.requiredTypeID(getIntValue(pyRequiredID));
builder.typeID(getIntValue(pyTypeID));
builder.quantity(getIntValue(pyQuantity));
return builder.build();
}
}
| [
"jevetools@gmail.com"
] | jevetools@gmail.com |
c70b04d22f043fac92e258ec410a7598bfdf4ff7 | a130768c1822b37da11fd518ef9c3b7b67c2d693 | /sample-db/src/main/java/com/ai/sample/db/model/property/configuration/PropertyDetails.java | 98ab1418c700689a6f2dfbae5b9735959b60e24b | [] | no_license | aatmasidha/examplecode | 3cbfd9594b427f5a268379cd824c5612c2da301c | 3138cce25a54d1aae1594f0c1a9077a48aafc1a1 | refs/heads/master | 2021-01-19T02:49:38.284433 | 2017-04-05T12:29:07 | 2017-04-05T12:32:45 | 87,295,262 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,264 | java | package com.ai.sample.db.model.property.configuration;
import java.util.Date;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import com.ai.sample.db.model.configuration.City;
import com.ai.sample.db.model.configuration.Country;
import com.ai.sample.db.model.configuration.Currency;
import com.ai.sample.db.model.configuration.PropertyStatusMaster;
import com.ai.sample.db.model.configuration.State;
@Entity
@Table(name="property_details", uniqueConstraints=
@UniqueConstraint(columnNames={"name","cityid","address"}))
public class PropertyDetails {
private int id;
private String name;
private String propertyUID;
private HotelChainDetails hotelChainDetails;
private String address;
/* private Country country;
private State state;*/
private City city;
private String pinCode;
private int capcity;
private PropertyStatusMaster propertyStatus;
private Currency hotelCurrency;
private double longitude = 0;
private double latitude = 0;
private Date createDate;
private Date lastUpdateDate;
public PropertyDetails() {
super();
}
public PropertyDetails( String name, String propertyUID,
HotelChainDetails hotelChainDetails, String address, Country country,
State state, City city, String pinCode, int capcity,
PropertyStatusMaster propertyStatus, Currency hotelCurrency,
Date lastUpdateDate, double longitude, double latitude) {
super();
this.name = name;
this.propertyUID = propertyUID;
this.hotelChainDetails = hotelChainDetails;
this.address = address;
/* this.country = country;
this.state = state;*/
this.city = city;
this.pinCode = pinCode;
this.capcity = capcity;
this.propertyStatus = propertyStatus;
this.hotelCurrency = hotelCurrency;
this.lastUpdateDate = lastUpdateDate;
this.createDate = new Date();
this.longitude = longitude;
this.latitude = latitude;
}
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
@Column(name = "name", nullable = false)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Column(name = "propertyuid", nullable = false, unique=true)
public String getPropertyUID() {
return propertyUID;
}
public void setPropertyUID(String propertyUID) {
this.propertyUID = propertyUID;
}
@ManyToOne(fetch = FetchType.LAZY, cascade=CascadeType.ALL)
@JoinColumn(name = "hotelchainid", nullable = true)
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public HotelChainDetails getHotelChainDetails() {
return hotelChainDetails;
}
public void setHotelChainDetails(HotelChainDetails hotelChainID) {
this.hotelChainDetails = hotelChainID;
}
@Column(name = "address", length = 3000)
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
@ManyToOne(fetch = FetchType.LAZY, cascade=CascadeType.ALL)
@JoinColumn(name = "cityid", nullable = false)
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public City getCity() {
return city;
}
public void setCity(City city) {
this.city = city;
}
@Column(name = "pincode", length = 15)
public String getPinCode() {
return pinCode;
}
public void setPinCode(String pinCode) {
this.pinCode = pinCode;
}
@Column(name = "capacity")
public int getCapcity() {
return capcity;
}
public void setCapcity(int capcity) {
this.capcity = capcity;
}
@ManyToOne(fetch = FetchType.LAZY, cascade=CascadeType.ALL)
@JoinColumn(name = "propertystatusid", nullable = false)
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public PropertyStatusMaster getPropertyStatus() {
return propertyStatus;
}
public void setPropertyStatus(PropertyStatusMaster propertyStatus) {
this.propertyStatus = propertyStatus;
}
@ManyToOne(fetch = FetchType.LAZY, cascade=CascadeType.ALL)
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@JoinColumn(name = "hotelcurrencyid")
public Currency getHotelCurrency() {
return hotelCurrency;
}
public void setHotelCurrency(Currency hotelCurrency) {
this.hotelCurrency = hotelCurrency;
}
public double getLongitude() {
return longitude;
}
public void setLongitude(double longitude) {
this.longitude = longitude;
}
public double getLatitude() {
return latitude;
}
public void setLatitude(double latitude) {
this.latitude = latitude;
}
public Date getLastUpdateDate() {
return lastUpdateDate;
}
public void setLastUpdateDate(Date lastUpdateDate) {
this.lastUpdateDate = lastUpdateDate;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + id;
result = prime * result + ((propertyUID == null) ? 0 : propertyUID.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (!(obj instanceof PropertyDetails))
return false;
PropertyDetails other = (PropertyDetails) obj;
if (id != other.id)
return false;
if (propertyUID == null) {
if (other.propertyUID != null)
return false;
} else if (!propertyUID.equals(other.propertyUID))
return false;
return true;
}
@Override
public String toString() {
return "PropertyDetails [id=" + id + ", name=" + name
+ ", propertyUID=" + propertyUID + ", address=" + address + /*", country="
+ country.toString() + ", state=" + state.toString() + */", city=" + city.toString()
+ ", pinCode=" + pinCode + ", capcity=" + capcity
+ ", propertyStatus=" + propertyStatus.toString() + ", hotelCurrency="
+ hotelCurrency.toString() + ", longitude=" + longitude + ", latitude="
+ latitude + ", createDate=" + createDate + ", lastUpdateDate="
+ lastUpdateDate + "]";
}
}
| [
"aparna.atmasidha@gmail.com"
] | aparna.atmasidha@gmail.com |
fc429f50886f27f6954ef7aae181e79c9e36a5b8 | 9888372d612ffd33e6eaa8a5f5c591be4541ee6b | /app/src/main/java/in/wisemonkeys/android/wisemonkeys/SignupActivity.java | fd41e16fd0f880e9572a60b904900d10972d9d1b | [] | no_license | ifahimkhan/Wisemonkeys | d715d858ac5edc7d2cda69f905437ba642c10e8d | 22755c5a09015531d25cce625b1fe07e8d1344fa | refs/heads/master | 2020-03-31T02:20:08.644118 | 2018-10-06T08:11:25 | 2018-10-06T08:11:25 | 151,818,659 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,458 | java | package in.wisemonkeys.android.wisemonkeys;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.text.TextUtils;
import android.view.View;
import android.widget.EditText;
import android.widget.ProgressBar;
import android.widget.Toast;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
public class SignupActivity extends AppCompatActivity {
EditText editText_username, editText_email, editText_displayname,
editText_password, editText_confirm;
ProgressBar progressBar;
String mynonce = "", nonce_status;
String url = "";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_signup);
init();
new GetNonce().execute();
}
/*private void makeNonceRequest() {
JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Request.Method.GET, "http://wisemonkeys.in/api/get_nonce/?controller=user&method=register", null, new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
/*Gson gson = new Gson();
nonce = gson.fromJson(response.toString(), Nonce.class);
try {
nonce_status=response.getString("status");
mynonce = response.getString("nonce");
Toast.makeText(getApplicationContext(),mynonce,Toast.LENGTH_LONG).show();
} catch (JSONException e) {
e.printStackTrace();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Toast.makeText(getApplicationContext(), "Nonce Request Failed", Toast.LENGTH_SHORT).show();
}
});
AppController.getInstance().addToRequestQueue(jsonObjectRequest);
}*/
private void init() {
editText_email = (EditText) findViewById(R.id.input_email);
editText_username = (EditText) findViewById(R.id.input_username);
editText_displayname = (EditText) findViewById(R.id.input_displayname);
editText_password = (EditText) findViewById(R.id.input_password);
editText_confirm = (EditText) findViewById(R.id.confirm_password);
progressBar = (ProgressBar) findViewById(R.id.loginRequestLoadingProgressbar);
}
public void signin(View view) {
startActivity(new Intent(getApplicationContext(), LoginActivity.class));
finish();
}
public void signup(View view) throws UnsupportedEncodingException {
boolean checkpoints = true;
String email = editText_email.getText().toString().trim();
String username = editText_username.getText().toString().trim();
String displayname = editText_displayname.getText().toString().trim();
String password = editText_password.getText().toString().trim();
String confirm_password = editText_confirm.getText().toString().trim();
if (TextUtils.isEmpty(email)) {
Toast.makeText(this, "Enter Email Address", Toast.LENGTH_SHORT).show();
checkpoints = false;
return;
}
if (TextUtils.isEmpty(username)) {
Toast.makeText(this, "Enter Username", Toast.LENGTH_SHORT).show();
checkpoints = false;
return;
}
if (TextUtils.isEmpty(displayname)) {
Toast.makeText(this, "Enter Display Name", Toast.LENGTH_SHORT).show();
checkpoints = false;
return;
}
if (TextUtils.isEmpty(password)) {
Toast.makeText(this, "Enter Password", Toast.LENGTH_SHORT).show();
checkpoints = false;
return;
}
if (TextUtils.isEmpty(confirm_password)) {
Toast.makeText(this, "Enter confirm Password", Toast.LENGTH_SHORT).show();
checkpoints = false;
return;
}
if (!confirm_password.equals(password)) {
Toast.makeText(this, "Password does not Match!", Toast.LENGTH_SHORT).show();
checkpoints = false;
return;
}
if (checkpoints) {
//makeNonceRequest();
if (nonce_status.equals("ok")) {
url = getString(R.string.wisemonkeys_signup) + URLEncoder.encode(username, "UTF-8")
+ "&email=" + email
+ "&nonce=" + mynonce
+ "&display_name=" + URLEncoder.encode(displayname, "UTF-8")
+ "¬ify=both&user_pass=" + URLEncoder.encode(password, "UTF-8");
Toast.makeText(getApplicationContext(), url, Toast.LENGTH_LONG).show();
progressBar.setVisibility(View.VISIBLE);
new GetSignup().execute();
}
}
}
private void letsSingUp(String url) {
/*JsonObjectRequest onsignupRequest = new JsonObjectRequest(Request.Method.GET, url, null, new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
try {
String status = response.getString("status");
if (status.equals("error")) {
String error = response.getString("error").toString();
Toast.makeText(getApplicationContext(), error, Toast.LENGTH_LONG).show();
} else {
Toast.makeText(getApplicationContext(), "Registration Success! \n please verify your email link has been sent ", Toast.LENGTH_LONG).show();
//new LoginActivity.BackgroundWorker("login",email,password);
//startActivity(new Intent(getApplicationContext(), LoginActivity.class));
}
progressBar.setVisibility(View.INVISIBLE);
} catch (JSONException e) {
e.printStackTrace();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Toast.makeText(getApplicationContext(), "Signup Request Failed", Toast.LENGTH_SHORT).show();
}
});
progressBar.setVisibility(View.INVISIBLE);
AppController.getInstance().addToRequestQueue(onsignupRequest);
*/
}
class GetNonce extends AsyncTask<Void, Void, String> {
@Override
protected void onPreExecute() {
super.onPreExecute();
progressBar.setVisibility(View.VISIBLE);
}
@Override
protected String doInBackground(Void... voids) {
HttpHandler handler = new HttpHandler();
String stream = handler.makeServiceCall("http://wisemonkeys.in/api/get_nonce/?controller=user&method=register");
return stream;
}
@Override
protected void onPostExecute(String s) {
super.onPostExecute(s);
try {
JSONObject jsonObject = new JSONObject(s);
String status = jsonObject.getString("status");
String nonce = jsonObject.getString("nonce");
mynonce = nonce;
nonce_status = status;
Toast.makeText(getApplicationContext(), nonce + status, Toast.LENGTH_LONG).show();
progressBar.setVisibility(View.INVISIBLE);
} catch (JSONException e) {
e.printStackTrace();
}
}
}
class GetSignup extends AsyncTask<Void, Void, String> {
@Override
protected void onPreExecute() {
super.onPreExecute();
progressBar.setVisibility(View.VISIBLE);
}
@Override
protected String doInBackground(Void... voids) {
HttpHandler handler = new HttpHandler();
String stream = handler.makeServiceCall(url);
return stream;
}
@Override
protected void onPostExecute(String s) {
super.onPostExecute(s);
try {
JSONObject jsonObject = new JSONObject(s);
String status = jsonObject.getString("status");
if (status.equals("error")) {
String error = jsonObject.getString("error");
Toast.makeText(getApplicationContext(), error, Toast.LENGTH_LONG).show();
} else {
Toast.makeText(getApplicationContext(), "Registration Success! please verify your email link has been sent ", Toast.LENGTH_LONG).show();
//new LoginActivity.BackgroundWorker("login",email,password);
//startActivity(new Intent(getApplicationContext(), LoginActivity.class));
}
progressBar.setVisibility(View.INVISIBLE);
} catch (JSONException e) {
e.printStackTrace();
}
}
}
}
| [
"khan.fahim95@hotmail.com"
] | khan.fahim95@hotmail.com |
e18438b7afda216c45d1b6a563256a42e480865e | d86db173768572ca7b71fa8648726c75167ebf18 | /src/test/java/com/hubspot/dropwizard/guicier/objects/InjectedProvider.java | 734d55c5cb0e59befda74a333d1158e9c1d64f4d | [
"Apache-2.0"
] | permissive | HubSpot/dropwizard-guicier | e41c0afdecc6a43c957f004144c5471feb3f91f5 | 083bb6c23e35bf6237d2d9ca91b3ce73401820db | refs/heads/master | 2023-08-10T06:35:37.672958 | 2022-11-18T12:41:36 | 2022-11-18T12:41:36 | 45,265,198 | 45 | 33 | Apache-2.0 | 2023-02-26T00:29:17 | 2015-10-30T17:10:36 | Java | UTF-8 | Java | false | false | 196 | java | package com.hubspot.dropwizard.guicier.objects;
import javax.ws.rs.ext.Provider;
import com.google.inject.Inject;
@Provider
public class InjectedProvider {
@Inject
InjectedProvider() {}
}
| [
"sgutz@hubspot.com"
] | sgutz@hubspot.com |
9e8d7fa18b17dcf33f5b7130b12681845a2b4e6e | a1826c2ed9c12cfc395fb1a14c1a2e1f097155cb | /sas-20181203/src/main/java/com/aliyun/sas20181203/models/SasInstallCodeRequest.java | 0a133e3718f4e7c8111c8cd8b819c2d3e966a2a9 | [
"Apache-2.0"
] | permissive | aliyun/alibabacloud-java-sdk | 83a6036a33c7278bca6f1bafccb0180940d58b0b | 008923f156adf2e4f4785a0419f60640273854ec | refs/heads/master | 2023-09-01T04:10:33.640756 | 2023-09-01T02:40:45 | 2023-09-01T02:40:45 | 288,968,318 | 40 | 45 | null | 2023-06-13T02:47:13 | 2020-08-20T09:51:08 | Java | UTF-8 | Java | false | false | 639 | java | // This file is auto-generated, don't edit it. Thanks.
package com.aliyun.sas20181203.models;
import com.aliyun.tea.*;
public class SasInstallCodeRequest extends TeaModel {
@NameInMap("SourceIp")
public String sourceIp;
public static SasInstallCodeRequest build(java.util.Map<String, ?> map) throws Exception {
SasInstallCodeRequest self = new SasInstallCodeRequest();
return TeaModel.build(map, self);
}
public SasInstallCodeRequest setSourceIp(String sourceIp) {
this.sourceIp = sourceIp;
return this;
}
public String getSourceIp() {
return this.sourceIp;
}
}
| [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
107a57e0722420d0f01b8e342419f1cd0b9872a4 | 43606afb8ac9d19253da558ba4e536601f860f6f | /src/com/lordUdin/app/NewDownload.java | bd7372527d29f8fa50a3b861348ffea6d7d99783 | [] | no_license | Ryujin-lab/Minimal-Download-Manager | f39811640d826da2e896889334893d5d7746df83 | 6945fa8f03130680f4a4375d967789e4c0829486 | refs/heads/master | 2023-08-28T02:51:43.775393 | 2021-10-16T12:16:08 | 2021-10-16T12:16:08 | 417,819,632 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,625 | java | package com.lordUdin.app;
import java.awt.Font;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.io.File;
import javax.swing.*;
import javax.swing.border.TitledBorder;
import com.lordUdin.xmlHandler.Configuration;
public class NewDownload extends JFrame{
private HomeLayout uiHome = null;
private JPanel contentPane;
private JTextField textUrl;
private JTextField textSaveLocation;
private JButton btnBrowse;
private JButton btnDownload;
private JButton btnCancel;
public NewDownload(HomeLayout uiHome) {
this.uiHome = uiHome;
setTitle("New Download");
setResizable(false);
setAlwaysOnTop(true);
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
setBounds(100, 100, 511, 155);
setLocationRelativeTo(uiHome);
contentPane = new JPanel();
contentPane.setBorder(new TitledBorder(null, "Download information", TitledBorder.LEADING, TitledBorder.TOP, null, null));
setContentPane(contentPane);
GridBagLayout gbl_contentPane = new GridBagLayout();
gbl_contentPane.columnWidths = new int[]{0, 0, 0, 0};
gbl_contentPane.rowHeights = new int[]{0, 0, 0, 0};
gbl_contentPane.columnWeights = new double[]{0.0, 1.0, 1.0, Double.MIN_VALUE};
gbl_contentPane.rowWeights = new double[]{0.0, 0.0, 0.0, Double.MIN_VALUE};
contentPane.setLayout(gbl_contentPane);
JLabel lblUrlToDownload = new JLabel("URL to download");
GridBagConstraints gbc_lblUrlToDownload = new GridBagConstraints();
gbc_lblUrlToDownload.fill = GridBagConstraints.HORIZONTAL;
gbc_lblUrlToDownload.insets = new Insets(5, 10, 5, 10);
gbc_lblUrlToDownload.gridx = 0;
gbc_lblUrlToDownload.gridy = 0;
contentPane.add(lblUrlToDownload, gbc_lblUrlToDownload);
textUrl = new JTextField();
textUrl.addKeyListener(new KeyAdapter() {
@Override
public void keyTyped(KeyEvent arg0) {
textUrlKeyTyped(arg0);
}
});
textUrl.setFont(new Font("Tahoma", Font.PLAIN, 11));
GridBagConstraints gbc_textUrl = new GridBagConstraints();
gbc_textUrl.gridwidth = 2;
gbc_textUrl.fill = GridBagConstraints.HORIZONTAL;
gbc_textUrl.insets = new Insets(5, 0, 5, 5);
gbc_textUrl.gridx = 1;
gbc_textUrl.gridy = 0;
contentPane.add(textUrl, gbc_textUrl);
textUrl.setColumns(10);
JLabel lblSaveLocation = new JLabel("Save location");
GridBagConstraints gbc_lblSaveLocation = new GridBagConstraints();
gbc_lblSaveLocation.fill = GridBagConstraints.HORIZONTAL;
gbc_lblSaveLocation.insets = new Insets(5, 10, 5, 10);
gbc_lblSaveLocation.gridx = 0;
gbc_lblSaveLocation.gridy = 1;
contentPane.add(lblSaveLocation, gbc_lblSaveLocation);
textSaveLocation = new JTextField();
textSaveLocation.setColumns(10);
textSaveLocation.setText(Configuration.DEFAULT_DOWNLOAD_PATH);
textSaveLocation.setEditable(false);
textSaveLocation.setFocusable(false);
GridBagConstraints gbc_textSaveLocation = new GridBagConstraints();
gbc_textSaveLocation.weightx = 10.0;
gbc_textSaveLocation.insets = new Insets(5, 0, 5, 5);
gbc_textSaveLocation.fill = GridBagConstraints.HORIZONTAL;
gbc_textSaveLocation.gridx = 1;
gbc_textSaveLocation.gridy = 1;
contentPane.add(textSaveLocation, gbc_textSaveLocation);
btnBrowse = new JButton("Browse");
btnBrowse.setMnemonic('b');
btnBrowse.addActionListener((e)-> { btnBrowseClick(e); });
GridBagConstraints gbc_btnBrowse = new GridBagConstraints();
gbc_btnBrowse.fill = GridBagConstraints.HORIZONTAL;
gbc_btnBrowse.insets = new Insets(5, 0, 5, 5);
gbc_btnBrowse.gridx = 2;
gbc_btnBrowse.gridy = 1;
contentPane.add(btnBrowse, gbc_btnBrowse);
btnDownload = new JButton("Download");
btnDownload.setEnabled(false);
btnDownload.setMnemonic('d');
btnDownload.addActionListener((e)-> { btnDownloadClick(e); });
GridBagConstraints gbc_btnDownload = new GridBagConstraints();
gbc_btnDownload.anchor = GridBagConstraints.EAST;
gbc_btnDownload.insets = new Insets(5, 5, 5, 5);
gbc_btnDownload.gridx = 1;
gbc_btnDownload.gridy = 2;
contentPane.add(btnDownload, gbc_btnDownload);
btnCancel = new JButton("Cancel");
btnCancel.setMnemonic('c');
btnCancel.addActionListener((e)-> { btnCancelClick(e); });
GridBagConstraints gbc_btnCancel = new GridBagConstraints();
gbc_btnCancel.fill = GridBagConstraints.HORIZONTAL;
gbc_btnCancel.insets = new Insets(5, 0, 5, 5);
gbc_btnCancel.gridx = 2;
gbc_btnCancel.gridy = 2;
contentPane.add(btnCancel, gbc_btnCancel);
setVisible(true);
}
private void btnBrowseClick(ActionEvent evt) {
JFileChooser fileChooser = new JFileChooser(Configuration.DEFAULT_DOWNLOAD_PATH);
fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY | JFileChooser.CANCEL_OPTION);
fileChooser.setDialogTitle("Select download directory");
int option = fileChooser.showDialog(this, "Choose Directory");
if(option == JFileChooser.APPROVE_OPTION) {
String filePath = fileChooser.getSelectedFile().getPath() + "/";
textSaveLocation.setText(filePath);
option = JOptionPane.showConfirmDialog(this, "Do you want to set it as your default directory?", "Set default directory", JOptionPane.YES_NO_OPTION);
if(option == JOptionPane.YES_OPTION) {
Configuration.setProperty("DEFAULT_DOWNLOAD_PATH", filePath);
}
}
}
private void btnCancelClick(ActionEvent evt) {
setVisible(false);
uiHome.requestFocus();
}
private void textUrlKeyTyped(KeyEvent evt) {
String url = textUrl.getText().trim();
if(url.length() > 0) {
btnDownload.setEnabled(true);
if(evt.getKeyChar() == KeyEvent.VK_ENTER)
btnDownloadClick(null);
}
else
btnDownload.setEnabled(false);
}
private void btnDownloadClick(ActionEvent evt) {
String url = textUrl.getText();
String filePath = textSaveLocation.getText();
if (filePath == null || filePath.isEmpty()) {
JOptionPane.showMessageDialog(this, "Please select a download location.", "Select download location",
JOptionPane.WARNING_MESSAGE);
btnBrowseClick(evt);
return;
}
else {
File file = new File(filePath);
if (!file.exists()) {
JOptionPane.showMessageDialog(this,
"Invalid download location. Please choose another download location.", "Invalid save location",
JOptionPane.WARNING_MESSAGE);
btnBrowseClick(evt);
return;
}
}
uiHome.addNewDownload(url, filePath);
setVisible(false);
}
}
| [
"aliedyne222@gmail.com"
] | aliedyne222@gmail.com |
f011512577347cbfbb0481712cd4caf61ec9cc5b | 15ccb69d588344103db5d3c15c4af267c3d3bc67 | /src\main\java/org/greysalmon/model/Followers.java | 04b7e93280fe685341af91a70a0a3daddf208b67 | [] | no_license | Swat009/KnowledgeManagementSystem | 1633cd2ef26180627804f2e31550cb7ec5785e30 | bddfe234217b4fa1ac72aa47eba49200daf207de | refs/heads/master | 2021-01-19T20:03:25.926550 | 2017-06-05T10:08:20 | 2017-06-05T10:08:20 | 88,479,432 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 915 | java | package org.greysalmon.model;
import java.util.List;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.CollectionTable;
import javax.persistence.Column;
import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.validation.constraints.Size;
@Entity
public class Followers
{
@Id
@GeneratedValue
private long Id;
private long followerId;
private long followedId;
public long getFollowerId() {
return followerId;
}
public void setFollowerId(long followerId) {
this.followerId = followerId;
}
public long getFollowedId() {
return followedId;
}
public void setFollowedId(long followedId) {
this.followedId = followedId;
}
public long getId() {
return Id;
}
}
| [
"swatantra.kumar8@gmail.com"
] | swatantra.kumar8@gmail.com |
53f216d632abb53815da04db9422f0b082287332 | 0893c91708e6cf5b6cb28f95e9b8776578fd64a4 | /Televisionary_Android/src/com/codewar/televisionary/tasks/ShowAlertDialog.java | 7e701232c2af55578e0579fcc2cb6fb7532e808c | [] | no_license | Akila-Sandakelum/Televisionary_Android | 73878375d0372af09871fe2acdaa9f1ba5798648 | 11357c0e0ca294a6883789c44a98b45a39ead8f0 | refs/heads/master | 2021-01-19T11:48:23.840242 | 2015-03-22T12:35:03 | 2015-03-22T12:35:03 | 32,670,188 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 844 | java | package com.codewar.televisionary.tasks;
import com.codewar.televisionary.R;
import com.codewar.televisionary.mainpages.DetailFragment;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
public class ShowAlertDialog extends DetailFragment{
public void showAlert(Context context, String title , String message , Boolean status){
AlertDialog alertDialog = new AlertDialog.Builder(context).create( );
alertDialog.setTitle(title);
alertDialog.setMessage(message);
if(status != null){
//alertDialog.setIcon((status)? R.drawable.success : R.drawable.failed);
alertDialog.setButton("OK", new DialogInterface.OnClickListener( ){
@Override
public void onClick(DialogInterface dialog, int which){
}
});
alertDialog.show( );
}
}
}
| [
"sandakelum.akila@gmail.com"
] | sandakelum.akila@gmail.com |
fecb672e037f881c2e6c8f63de7115411b655dd6 | 4fedb1b7e38fc72f50385e41d7f89e8edd892992 | /bfit-engine/src/main/java/edu/yale/library/ladybird/engine/file/ImageMagickProcessor.java | d34392c2a1db01b5571727ac4150e55cc90ec41d | [] | no_license | chelles/bulk-fcrepo-import | a8d8dbfc175bcacd83c967a2357f971e6dbb3f1c | c69644e487f22c170c2e7073a5810f5a9bc4e1d5 | refs/heads/master | 2021-01-18T18:01:08.978589 | 2016-12-21T16:06:51 | 2016-12-21T16:06:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,591 | java | package edu.yale.library.ladybird.engine.file;
import edu.yale.library.ladybird.entity.Settings;
import edu.yale.library.ladybird.kernel.ApplicationProperties;
import edu.yale.library.ladybird.persistence.dao.SettingsDAO;
import edu.yale.library.ladybird.persistence.dao.hibernate.SettingsHibernateDAO;
import org.im4java.core.ConvertCmd;
import org.im4java.core.IM4JavaException;
import org.im4java.core.IMOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.File;
import java.io.IOException;
/**
* @author Osman Din {@literal <osman.din.yale@gmail.com>}
*/
public class ImageMagickProcessor implements ImageProcessor {
private static Logger logger = LoggerFactory.getLogger(ImageMagickProcessor.class);
/** Image magick path, built only once */
private static String IMAGEMAGICK_PATH = getImgMagickPath();
/** from config .properties */
private static final String IMJ_CMD_PATH = ApplicationProperties.CONFIG_STATE.IMAGE_MAGICK_PATH;
/** from im4java */
public static final String IM_4_JAVA_TOOPATH = "IM4JAVA_TOOPATH";
private static final int THUMBNAIL_HEIGHT = 150;
private static final int THUMBNAIL_WIDTH = 150;
private static final double THUMBNAIL_QUALITY = 10;
public void toFormat(final String src, final String dst) {
if (src == null || dst == null) {
logger.debug("Source or destination image null");
return;
}
final ConvertCmd cmd = buildImageMagickCommand();
try {
logger.trace("Converting file={}", src);
IMOperation op = new IMOperation();
op.addImage(src);
op.addImage(dst);
cmd.run(op);
} catch (IOException | InterruptedException | IM4JavaException e) {
throw new RuntimeException("Error processing image", e);
}
}
public void toThumbnailFormat(final String src, final String dst) {
if (src == null || dst == null) {
logger.debug("Source or destination image null");
return;
}
final ConvertCmd cmd = buildImageMagickCommand();
try {
IMOperation op = new IMOperation();
op.addImage(src);
op.thumbnail(THUMBNAIL_HEIGHT, THUMBNAIL_WIDTH);
op.quality(THUMBNAIL_QUALITY);
op.strip();
op.addImage(dst);
cmd.run(op);
} catch (IOException | InterruptedException | IM4JavaException e) {
throw new RuntimeException("Error processing thumbnail", e);
}
}
public static String getBlankImagePath() {
try {
final SettingsDAO settingsDAO = new SettingsHibernateDAO();
final Settings s = settingsDAO.findByProperty(ApplicationProperties.NO_IMAGE_FOUND_PATH);
return s.getValue();
} catch (Exception e) {
logger.error("Error getting blank image path", e);
throw new NullPointerException("No image found!");
}
}
private ConvertCmd buildImageMagickCommand() {
final ConvertCmd cmd = new ConvertCmd();
final String imageMagickPath = IMAGEMAGICK_PATH;
if (!imageMagickPath.isEmpty()) {
cmd.setSearchPath(imageMagickPath);
} else {
logger.warn("ImageMagick path not found in .properties, db, or as IM4JAVA_TOOLPATH.");
logger.warn("Assuming ImageMagick exists on path anyway");
}
return cmd;
}
/**
* Get image magick path or empty string
* @return path or empty string since the field is held statically for now
*/
private static String getImgMagickPath() {
try {
final SettingsDAO settingsDAO = new SettingsHibernateDAO();
final Settings s = settingsDAO.findByProperty(ApplicationProperties.IMAGE_MAGICK_PATH_ID);
final String value = s.getValue();
if (!value.isEmpty()) {
return value;
} else if (System.getProperty(IM_4_JAVA_TOOPATH) != null) {
return System.getProperty(IM_4_JAVA_TOOPATH);
} else if (!IMJ_CMD_PATH.isEmpty() && pathContains(IMJ_CMD_PATH)) {
return IMJ_CMD_PATH;
}
} catch (Exception e) {
logger.error("Error getting image magick path property", e);
}
return "";
}
private static boolean pathContains(final String path) {
final String TOOL = "convert";
File file = new File(path + File.separator + TOOL);
return file.exists();
}
}
| [
"osmandin@gmail.com"
] | osmandin@gmail.com |
6f1cc79f333b53fd30c8ab47f30dd8df6d77dae7 | b74f2c19ea8e730b93e3da8842fc0ca3db9639dd | /aws-java-sdk-opsworkscm/src/main/java/com/amazonaws/services/opsworkscm/model/transform/EngineAttributeJsonMarshaller.java | 8e5b7c850d38742d2ba5fff8d8b9f51349975301 | [
"Apache-2.0"
] | permissive | mgivney/aws-sdk-java | 2de4a597beeda68735ba5bb822f45e924de29d14 | 005db50a80c825dc305306a0633cac057b95b054 | refs/heads/master | 2021-05-02T04:51:13.281576 | 2016-12-16T01:48:44 | 2016-12-16T01:48:44 | 76,672,974 | 1 | 0 | null | 2016-12-16T17:36:09 | 2016-12-16T17:36:09 | null | UTF-8 | Java | false | false | 2,264 | java | /*
* Copyright 2011-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.opsworkscm.model.transform;
import java.util.Map;
import java.util.List;
import com.amazonaws.SdkClientException;
import com.amazonaws.services.opsworkscm.model.*;
import com.amazonaws.transform.Marshaller;
import com.amazonaws.util.BinaryUtils;
import com.amazonaws.util.StringUtils;
import com.amazonaws.util.IdempotentUtils;
import com.amazonaws.util.StringInputStream;
import com.amazonaws.protocol.json.*;
/**
* EngineAttributeMarshaller
*/
public class EngineAttributeJsonMarshaller {
/**
* Marshall the given parameter object, and output to a SdkJsonGenerator
*/
public void marshall(EngineAttribute engineAttribute, StructuredJsonGenerator jsonGenerator) {
if (engineAttribute == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
jsonGenerator.writeStartObject();
if (engineAttribute.getName() != null) {
jsonGenerator.writeFieldName("Name").writeValue(engineAttribute.getName());
}
if (engineAttribute.getValue() != null) {
jsonGenerator.writeFieldName("Value").writeValue(engineAttribute.getValue());
}
jsonGenerator.writeEndObject();
} catch (Throwable t) {
throw new SdkClientException("Unable to marshall request to JSON: " + t.getMessage(), t);
}
}
private static EngineAttributeJsonMarshaller instance;
public static EngineAttributeJsonMarshaller getInstance() {
if (instance == null)
instance = new EngineAttributeJsonMarshaller();
return instance;
}
}
| [
""
] | |
5ed7c557999594fb7fea8f3264e5f7db28daf66a | 5899e2ff48992fa2d64ddd4919b1507adaaa08fd | /src/main/java/wd/RowKeyDistributorByHashPrefix.java | 93cd512f959884091171c3746a8fa7254bbd0aa5 | [] | no_license | OhadR/cascading-id-generator | 9034f549dcc23e0ab46a6b29fc837389781b4e95 | 77295f2331c7f83bacd9e5571fa6b912a6bd9fb2 | refs/heads/master | 2016-09-02T01:19:22.501067 | 2015-06-18T12:25:57 | 2015-06-18T12:25:57 | 35,027,236 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,344 | java | /**
* Copyright 2010 Sematext International
*
* 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 wd;
import org.apache.hadoop.hbase.util.Bytes;
import java.io.Serializable;
import java.util.Arrays;
/**
* Provides handy methods to distribute
*
* @author Alex Baranau
*/
public class RowKeyDistributorByHashPrefix extends AbstractRowKeyDistributor implements Serializable {
private static final String DELIM = "--";
private Hasher hasher;
/** Constructor reflection. DO NOT USE */
public RowKeyDistributorByHashPrefix() {
}
public RowKeyDistributorByHashPrefix(Hasher hasher) {
this.hasher = hasher;
}
public static interface Hasher extends Parametrizable {
byte[] getHashPrefix(byte[] originalKey);
byte[][] getAllPossiblePrefixes();
int getPrefixLength(byte[] adjustedKey);
}
public static class OneByteSimpleHash implements Hasher,Serializable {
private int mod;
/**
* For reflection, do NOT use it.
*/
public OneByteSimpleHash() {}
/**
* Creates a new instance of this class.
* @param maxBuckets max buckets number, should be in 1...255 range
*/
public OneByteSimpleHash(int maxBuckets) {
if (maxBuckets < 1 || maxBuckets > 256) {
throw new IllegalArgumentException("maxBuckets should be in 1..256 range");
}
// i.e. "real" maxBuckets value = maxBuckets or maxBuckets-1
this.mod = maxBuckets;
}
// Used to minimize # of created object instances
// Should not be changed. TODO: secure that
private static final byte[][] PREFIXES;
static {
PREFIXES = new byte[256][];
for (int i = 0; i < 256; i++) {
PREFIXES[i] = new byte[] {(byte) i};
}
}
@Override
public byte[] getHashPrefix(byte[] originalKey) {
long hash = Math.abs(hashBytes(originalKey));
return new byte[] {(byte) (hash % mod)};
}
@Override
public byte[][] getAllPossiblePrefixes() {
return Arrays.copyOfRange(PREFIXES, 0, mod);
}
@Override
public int getPrefixLength(byte[] adjustedKey) {
return 1;
}
@Override
public String getParamsToStore() {
return String.valueOf(mod);
}
@Override
public void init(String storedParams) {
this.mod = Integer.valueOf(storedParams);
}
/** Compute hash for binary data. */
private static int hashBytes(byte[] bytes) {
int hash = 1;
for (int i = 0; i < bytes.length; i++)
hash = (31 * hash) + (int) bytes[i];
return hash;
}
}
@Override
public byte[] getDistributedKey(byte[] originalKey) {
return Bytes.add(hasher.getHashPrefix(originalKey), originalKey);
}
@Override
public byte[] getOriginalKey(byte[] adjustedKey) {
int prefixLength = hasher.getPrefixLength(adjustedKey);
if (prefixLength > 0) {
return Bytes.tail(adjustedKey, adjustedKey.length - prefixLength);
} else {
return adjustedKey;
}
}
@Override
public byte[][] getAllDistributedKeys(byte[] originalKey) {
byte[][] allPrefixes = hasher.getAllPossiblePrefixes();
byte[][] keys = new byte[allPrefixes.length][];
for (int i = 0; i < allPrefixes.length; i++) {
keys[i] = Bytes.add(allPrefixes[i], originalKey);
}
return keys;
}
@Override
public String getParamsToStore() {
String hasherParamsToStore = hasher.getParamsToStore();
return hasher.getClass().getName() + DELIM + (hasherParamsToStore == null ? "" : hasherParamsToStore);
}
@Override
public void init(String params) {
String[] parts = params.split(DELIM, 2);
try {
this.hasher = (Hasher) Class.forName(parts[0]).newInstance();
this.hasher.init(parts[1]);
} catch (Exception e) {
throw new RuntimeException("RoKeyDistributor initialization failed", e);
}
}
}
| [
"ohadr.developer@gmail.com"
] | ohadr.developer@gmail.com |
74f412d755064ac844bc55bc2064250a9d18d421 | 478b59bd61d92f98f5324f42b8b37ef0a1e52ff2 | /Testfiles/src/input/SQLInjection.java | c9cf07e8d12f3e86692198ce1d80e089a1b6f0df | [] | no_license | dsiebert/WALA-Tests | a8f0cf732939bfe0176146e4595d7586f9f5958e | 659b591b9edd872b3c961e67be530b339ced61db | refs/heads/master | 2016-08-07T02:50:31.634348 | 2012-08-05T16:16:16 | 2012-08-05T16:16:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,663 | java | package input;
import java.net.URL;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class SQLInjection {
public void doPost(HttpServletRequest request, HttpServletResponse response) {
try {
Connection conn = DriverManager.getConnection("url", "scott",
"tiger");
String item = request.getParameter("item");
String query = "SELECT FORM records WHERE item=’" + item + "’";
PreparedStatement stmt = conn.prepareStatement(query);
ResultSet rs = stmt.executeQuery();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public void doPos2(HttpServletRequest request, HttpServletResponse response) {
try {
Connection conn = DriverManager.getConnection("url", "scott",
"tiger");
String item = request.getParameter("item");
PreparedStatement stmt = conn.prepareStatement(item);
ResultSet rs = stmt.executeQuery();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public void doPost3(HttpServletRequest request, HttpServletResponse response) {
try {
Connection conn = DriverManager.getConnection("url", "scott",
"tiger");
String item = request.getParameter("item");
String query = "SELECT FORM records WHERE item=’" + item + "’";
PreparedStatement stmt = conn.prepareStatement(query);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
| [
"siebert.dennis@googlemail.com"
] | siebert.dennis@googlemail.com |
6f4240a63de8b8658a40b166878490ae8f483d02 | 8a23367c3237007a816f326f7812b644d3c5daa9 | /src/Main.java | 2f737eb0fd4f29c3ae55966f78367bf60b2b357d | [] | no_license | kaylamarc/Snek | 8c1a42efa10ef653cd493f68f5d77b3973ed0fa8 | 709f63db3f73aa41c115dfbf454148e682c9a640 | refs/heads/main | 2023-01-15T22:26:00.879484 | 2020-11-29T04:37:55 | 2020-11-29T04:37:55 | 315,730,783 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 500 | java |
public class Main {
public static void main(String[] args) {
// creates main game window
Window window = Window.getWindow();
// starts the game
// the more complicated explanation is, the window object is an instance of the Runnable interface
// which is the argument that new thread requires. when we call thread.start() it will call the run
// method of the passed in Runnable, which in this case is window.run()
Thread thread = new Thread(window);
thread.start();
}
}
| [
"kkcoons@aol.com"
] | kkcoons@aol.com |
b7a53f6efab72b94ad29d4cc994673d75eb1b382 | e92afc2bea57af369a4b2fdc1e685e4967615272 | /src/main/java/blockchain/medical_card/fx/controllers/LoginController.java | 7d0e5361e73f489b5c62e782d9c4582e79ca925a | [] | no_license | Daulet402/zhans_disser_project | a329a320bb5a901e7bf08c29e88b93dbb6dcd9f7 | 2769346bb1f3b902f8ce06c88ddaa6882a345fb6 | refs/heads/master | 2020-03-07T18:21:02.659971 | 2018-06-12T13:26:24 | 2018-06-12T13:26:24 | 127,635,480 | 0 | 0 | null | 2018-06-12T13:18:11 | 2018-04-01T14:15:07 | Java | UTF-8 | Java | false | false | 2,394 | java | package blockchain.medical_card.fx.controllers;
import blockchain.medical_card.api.Controller;
import blockchain.medical_card.api.FileService;
import blockchain.medical_card.api.fx.LoginService;
import blockchain.medical_card.configuration.ControllersConfiguration;
import blockchain.medical_card.configuration.PropertiesConfig;
import blockchain.medical_card.dto.DoctorDTO;
import blockchain.medical_card.dto.exceptions.BlockChainAppException;
import blockchain.medical_card.services.UserSessionService;
import blockchain.medical_card.utils.AlgorithmUtils;
import blockchain.medical_card.utils.FxUtils;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Alert;
import javafx.scene.control.PasswordField;
import javafx.scene.control.TextField;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
@Data
public class LoginController implements Controller {
@Qualifier("registration")
@Autowired
private ControllersConfiguration.ViewHolder registrationViewHolder;
@Qualifier("patients")
@Autowired
private ControllersConfiguration.ViewHolder patientsViewHolder;
@Autowired
private LoginService loginService;
@Autowired
private PropertiesConfig propertiesConfig;
@Autowired
UserSessionService userSessionService;
@FXML
private TextField username;
@FXML
private PasswordField password;
public void signIn(ActionEvent actionEvent) throws BlockChainAppException {
String passwordHash = AlgorithmUtils.applySha256(password.getText());
Alert alert = FxUtils.getAlertWindow(
propertiesConfig.getErrorMessage(),
null,
propertiesConfig.getDoctorNotFoundMessage(),
Alert.AlertType.ERROR);
DoctorDTO doctor = loginService.getDoctorByUsernameAndPasswordHash(username.getText(), passwordHash);
if (doctor != null) {
userSessionService.setDoctor(doctor);
PatientsController patientsController = (PatientsController) patientsViewHolder.getController();
patientsController.getLoggedInUsername().setText(
String.format(propertiesConfig.getLoggedInUsernameTextPattern(), doctor.getFullName()));
FxUtils.setScene(actionEvent, patientsViewHolder);
return;
}
alert.showAndWait();
}
public void register(ActionEvent actionEvent) throws Exception {
FxUtils.setScene(actionEvent, registrationViewHolder);
}
}
| [
"daulet.nurgali@kcell.kz"
] | daulet.nurgali@kcell.kz |
a17a094bc7520ca9f708f2de09ba02040ecb7259 | 97e1f45de125ae27810343486f8a84590484ad79 | /qagui/src/test/java/com/jsystems/qa/qagui/cucumber/page/LoginPage.java | 6be29b0a9f181a2e2106651108a7680c1535f976 | [] | no_license | lrybka/qa | ccbcb00b8be5a6918cb9de371043b39980b5745b | 565a4e43d72062b0a5b884f755fef49ecf1fa31b | refs/heads/master | 2022-12-02T13:03:08.082640 | 2019-11-22T13:43:35 | 2019-11-22T13:43:35 | 222,408,555 | 0 | 0 | null | 2022-11-16T12:27:55 | 2019-11-18T09:17:36 | Java | UTF-8 | Java | false | false | 1,333 | java | package com.jsystems.qa.qagui.cucumber.page;
import com.jsystems.qa.qagui.classic.page.BasePage;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;
public class LoginPage extends BasePage {
public LoginPage(WebDriver driver) {
super(driver);
PageFactory.initElements(driver, this);
}
public static final String usernameOrEmailSelector = "usernameOrEmail";
@FindBy(id = usernameOrEmailSelector)
public WebElement usernameInput;
// WebElement usernameInput = driver.findElement(By.id(usernameOrEmailSelector));
public static final String primaryButtonSelector = ".button.form-button.is-primary";
@FindBy(css = primaryButtonSelector)
public WebElement usernameButton;
// WebElement usernameButton = driver.findElement(By.cssSelector(primaryButtonSelector));
public static final String passwordInputSelector = "password";
@FindBy(id = passwordInputSelector)
public WebElement inputPassword;
// WebElement inputPassword = driver.findElement(By.id("password"));
@FindBy(css = primaryButtonSelector)
public WebElement buttonPassword;
// public WebElement buttonPassword = driver.findElement(By.cssSelector(primaryButtonSelector));
}
| [
"lukaszrybka1983@gmail.com"
] | lukaszrybka1983@gmail.com |
feedf3a775f5edeba2fac6268fc0c9cc9c9b60d8 | fb277bd9d6bcd427b6c2ccffd616a98be8ae795e | /src/classes/CadastrarProduto.java | d1862a4286bcfe8ea170a3cba3cb63f1f234a2f6 | [] | no_license | xXLuizXx/TrabalhoLTP1 | db986ad574fb5fddd72f7a92010a55491ef76892 | e9f09b0a250c65d913a46b4cc03f108f7ec6c2d2 | refs/heads/master | 2020-09-15T18:37:02.861398 | 2019-11-27T02:50:11 | 2019-11-27T02:50:11 | 223,528,744 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,382 | 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 classes;
import java.util.ArrayList;
/**
*
* @author PAULO
*/
public class CadastrarProduto {
private double totalGasto;
private String dataAqui;
private int mesCadastro;
private int anoCadastro;
private String nome;
private String marca;
private int codfornecedor;
private int quantidade;
private int codproduto;
private double precoVenda;
private double precoAqui;
private String unidadeMedida;
public static ArrayList<CadastrarProduto> cadastrarProduto = new ArrayList<>();
public int getCodfornecedor() {
return codfornecedor;
}
public double getTotalGasto() {
return totalGasto;
}
public void setTotalGasto(double totalGasto) {
this.totalGasto = totalGasto;
}
public String getDataAqui() {
return dataAqui;
}
public void setDataAqui(String dataAqui) {
this.dataAqui = dataAqui;
}
public int getMesCadastro() {
return mesCadastro;
}
public void setMesCadastro(int mesCdastro) {
this.mesCadastro = mesCdastro;
}
public int getAnoCadastro() {
return anoCadastro;
}
public void setAnoCadastro(int anoCdastro) {
this.anoCadastro = anoCdastro;
}
public void setCodfornecedor(int codfornecedor) {
this.codfornecedor = codfornecedor;
}
public int getQuantidade() {
return quantidade;
}
public void setQuantidade(int quantidade) {
this.quantidade = quantidade;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public String getMarca() {
return marca;
}
public void setMarca(String marca) {
this.marca = marca;
}
public int getCodproduto() {
return codproduto;
}
public void setCodproduto(int codproduto) {
this.codproduto = codproduto;
}
public double getPrecoVenda() {
return precoVenda;
}
public void setPrecoVenda(double precoVenda) {
this.precoVenda = precoVenda;
}
public double getPrecoAqui() {
return precoAqui;
}
public void setPrecoAqui(double precoAqui) {
this.precoAqui = precoAqui;
}
public String getPeso() {
return unidadeMedida;
}
public void setUnidadeMedida(String unidadeMedida) {
this.unidadeMedida = unidadeMedida;
}
public void cadastro(int codproduto, String nome, int qtd, String marca, String unidadeMedida, double precoAqui, double precoVenda, int codfornecedor, String data, int mes, int ano, double valorGasto) {
setCodproduto(codproduto);
setMarca(marca);
setQuantidade(qtd);
setNome(nome);
setUnidadeMedida(unidadeMedida);
setPrecoAqui(precoAqui);
setPrecoVenda(precoVenda);
setCodfornecedor(codfornecedor);
setDataAqui(data);
setMesCadastro(mes);
setAnoCadastro(ano);
setTotalGasto(valorGasto);
}
}
| [
"luizfernandofonseca123@gmail.com"
] | luizfernandofonseca123@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.