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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d6dc2c49f5c80498a42096824cb6a8d3445616fa | 3491282130135e521158acbefd135aec45ac6e59 | /src/main/java/ru/otus/service/CheckAnswerService.java | 9bc94673311c4360fa511788d2f3b831a6152e95 | [] | no_license | macaleks/task02 | 8198a53ec96ff417fdee812524d0d1fbfb2eb76f | 3e2e9cd9abebca891577e90bd15d28f65a8a3c03 | refs/heads/master | 2023-03-04T02:51:05.379575 | 2021-02-13T10:38:08 | 2021-02-13T10:38:08 | 319,667,386 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 472 | java | package ru.otus.service;
import ru.otus.model.Answer;
import java.util.Set;
public class CheckAnswerService {
public static boolean check(Set<Answer> respond, long correctAnswers) {
long correctAnswersGiven = respond.stream()
.filter(it -> it != null)
.filter(Answer::isCorrect)
.count();
if (correctAnswersGiven == correctAnswers) {
return true;
}
return false;
}
}
| [
"msxander@gmail.com"
] | msxander@gmail.com |
3e8c57506e2c180d1a7f9d3198b67f3b99fc7407 | 58c051decbf15b5f40cd51de9facf1275fcac23d | /SpringRestExample/src/main/java/com/demo/spring/model/Employee.java | 6326e66bbc4e761b4057814255842a88b5a8e60d | [] | no_license | bsdoma/trainingSamples | 655cfb2a03903c6b85049a090966d404b6cea65a | acc1c15f406017840d23a7869cb2938c6596df07 | refs/heads/master | 2022-12-23T21:19:11.606330 | 2020-04-20T23:25:05 | 2020-04-20T23:25:05 | 247,376,131 | 0 | 0 | null | 2022-12-16T08:45:39 | 2020-03-15T00:36:50 | Java | UTF-8 | Java | false | false | 783 | java | package com.demo.spring.model;
import java.io.Serializable;
import java.util.Date;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.DateSerializer;
public class Employee implements Serializable{
private static final long serialVersionUID = -7788619177798333712L;
private int id;
private String name;
private Date createdDate;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@JsonSerialize(using=DateSerializer.class)
public Date getCreatedDate() {
return createdDate;
}
public void setCreatedDate(Date createdDate) {
this.createdDate = createdDate;
}
}
| [
"swathidoma@Swathis-MacBook-Pro.local"
] | swathidoma@Swathis-MacBook-Pro.local |
ac93276d131a9335c7b7b0805fd2c5c25c94031a | ba52b04c07af3b0e48bbc41c428ae77c7818e1c2 | /codes/07/7.5/collection/src/lee/BeanTest.java | e9a46a343a128a5376af14c27d1160360a735003 | [] | no_license | xioc/javaee-practice-code | b36eee5908cca8beba16522c047bf8defd4fe080 | 2c12e4e80f87c4a741ca04fda3a2ee587b57ecf8 | refs/heads/master | 2020-05-21T18:40:04.186316 | 2019-05-11T13:17:45 | 2019-05-11T13:17:45 | 186,134,290 | 2 | 0 | null | null | null | null | GB18030 | Java | false | false | 697 | java | package lee;
import org.springframework.context.*;
import org.springframework.context.support.*;
import org.crazyit.app.service.*;
/**
* Description:
* <br/>网站: <a href="http://www.crazyit.org">疯狂Java联盟</a>
* <br/>Copyright (C), 2001-2018, Yeeku.H.Lee
* <br/>This program is protected by copyright laws.
* <br/>Program Name:
* <br/>Date:
* @author Yeeku.H.Lee kongyeeku@163.com
* @version 1.0
*/
public class BeanTest
{
public static void main(String[] args)throws Exception
{
ApplicationContext ctx = new
ClassPathXmlApplicationContext("beans.xml");
// 获取容器中Bean,并调用方法。
Person p = ctx.getBean("chinese" , Person.class);
p.test();
}
} | [
"wanteracc@gmail.com"
] | wanteracc@gmail.com |
3eff8a4033e550980701142e8813a83863a25e2b | d3edc0eabe676683b7d795a5c8aec638d6ff6245 | /branches/mockz/anacom/src/main/java/pt/ist/anacom/replication/quorumresponse/QuorumVersionResponse.java | 5e28cfb6de7b4e8e602bc566fcf2b8d40c77f36c | [] | no_license | jfloff/ANA.COM | 4cef8e3b2871e90aa8c89bf44cec5ecfa34d11fb | 30506dcafa92bcd0189281fefb0bf4d7427d27d4 | refs/heads/master | 2021-01-22T03:14:10.824984 | 2013-03-28T12:44:09 | 2013-03-28T12:44:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,093 | java | package pt.ist.anacom.replication.quorumresponse;
import java.util.concurrent.ExecutionException;
import javax.xml.ws.AsyncHandler;
import javax.xml.ws.Response;
import pt.ist.anacom.replication.CommandStrategy;
public class QuorumVersionResponse extends QuorumResponse implements AsyncHandler<Integer> {
public QuorumVersionResponse(String replicaURL, CommandStrategy command) {
super(replicaURL, command);
}
@Override
public void handleResponse(Response<Integer> res) {
try {
// TODO devolver esta versao e fazer qq coisa com ela
Integer replicaResponse = res.get();
System.out.println(">>>> [LOG]REPLICA VERSION AFTER: " + replicaResponse);
} catch (InterruptedException e) {
System.out.println("[QUORUM] Throwing original exception type is " + e.getCause().getClass().getName());
super.setException(e);
} catch (ExecutionException e) {
super.setException(e);
} finally {
CommandStrategy.quorumCounter.incrementAndGet();
}
}
}
| [
"jfloff@gmail.com"
] | jfloff@gmail.com |
e048959a55a5af54ecb38373b05981a438a1a750 | 3c8823b9b2bc9c76c5c51f438f2ed8b6227149b4 | /src/java/br/tcc/bean/Segmentos_bean.java | ec9124b44f7e5ce93056bab40952042a88d84bb6 | [] | no_license | JoaoMarcosChaves/PunchTournament | 83ca5ede86a871509787c0fc1f93a8bee8132c2b | ec50fc52e2bfddcde5ee9be06fe20653760075db | refs/heads/master | 2021-05-15T01:01:30.725651 | 2016-12-03T22:21:48 | 2016-12-03T22:21:48 | 66,114,921 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,097 | java |
package br.tcc.bean;
/**
*
* @author joãomarcos
*/
public class Segmentos_bean {
private int codEvento;
private int codSegmento;
private String nomeSegmento;
private String descricaoSegmento;
private boolean selected;
public int getCodEvento() {
return codEvento;
}
public void setCodEvento(int codEvento) {
this.codEvento = codEvento;
}
public int getCodSegmento() {
return codSegmento;
}
public void setCodSegmento(int codSegmento) {
this.codSegmento = codSegmento;
}
public String getNomeSegmento() {
return nomeSegmento;
}
public void setNomeSegmento(String nomeSegmento) {
this.nomeSegmento = nomeSegmento;
}
public String getDescricaoSegmento() {
return descricaoSegmento;
}
public void setDescricaoSegmento(String descricaoSegmento) {
this.descricaoSegmento = descricaoSegmento;
}
public boolean isSelected() {
return selected;
}
public void setSelected(boolean selected) {
this.selected = selected;
}
}
| [
"joaomarcoschaves7@gmail.com"
] | joaomarcoschaves7@gmail.com |
f4a13c7abb50a92c595c1611fb66d04073a77edb | ae5eb1a38b4d22c82dfd67c86db73592094edc4b | /project101/src/main/java/org/gradle/test/performance/largejavamultiproject/project101/p506/Production10137.java | 1ca0c4d9cc55be03125402ad9daf0a8befd21d28 | [] | no_license | big-guy/largeJavaMultiProject | 405cc7f55301e1fd87cee5878a165ec5d4a071aa | 1cd6a3f9c59e9b13dffa35ad27d911114f253c33 | refs/heads/main | 2023-03-17T10:59:53.226128 | 2021-03-04T01:01:39 | 2021-03-04T01:01:39 | 344,307,977 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,970 | java | package org.gradle.test.performance.largejavamultiproject.project101.p506;
public class Production10137 {
private Production10134 property0;
public Production10134 getProperty0() {
return property0;
}
public void setProperty0(Production10134 value) {
property0 = value;
}
private Production10135 property1;
public Production10135 getProperty1() {
return property1;
}
public void setProperty1(Production10135 value) {
property1 = value;
}
private Production10136 property2;
public Production10136 getProperty2() {
return property2;
}
public void setProperty2(Production10136 value) {
property2 = value;
}
private String property3;
public String getProperty3() {
return property3;
}
public void setProperty3(String value) {
property3 = value;
}
private String property4;
public String getProperty4() {
return property4;
}
public void setProperty4(String value) {
property4 = value;
}
private String property5;
public String getProperty5() {
return property5;
}
public void setProperty5(String value) {
property5 = value;
}
private String property6;
public String getProperty6() {
return property6;
}
public void setProperty6(String value) {
property6 = value;
}
private String property7;
public String getProperty7() {
return property7;
}
public void setProperty7(String value) {
property7 = value;
}
private String property8;
public String getProperty8() {
return property8;
}
public void setProperty8(String value) {
property8 = value;
}
private String property9;
public String getProperty9() {
return property9;
}
public void setProperty9(String value) {
property9 = value;
}
} | [
"sterling.greene@gmail.com"
] | sterling.greene@gmail.com |
39f14f37f98b526da99f52d03b5e9f3198ff67e2 | 8da7e6968f20a05d1285cb090f9135330733186d | /src/main/java/com/togocms/pns/api/Notification.java | 6cb2a133adca2b8fdace99f7065dbd385da2cccb | [
"MIT"
] | permissive | clickntap/TogoPns | fa4351cf6c7caabe2ac60f90022780b746325f12 | 56ca9e736d74e7bd40a1cec822c4c53d0cf066ee | refs/heads/master | 2020-05-21T03:05:59.896088 | 2016-12-22T05:21:43 | 2016-12-22T05:21:43 | 32,408,571 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 522 | java | package com.togocms.pns.api;
import java.util.List;
public interface Notification {
public String getKeyStorePath() throws Exception;
public String getKeyStorePassword() throws Exception;
public String getSecretKey() throws Exception;
public List<String> getTokens() throws Exception;
public String getTitle() throws Exception;
public String getAlert() throws Exception;
public Boolean isProduction();
public List<String> send() throws Exception;
public void addToken(String token) throws Exception;
}
| [
"tonino.mendicino@clickntap.com"
] | tonino.mendicino@clickntap.com |
42de8fbeff96f50208c271156fc279d14140112b | 1a3cac74b8d5d56a7e91f25015c701a6e164f959 | /src/pack/NULLwars/main/Record.java | d8eb2715b371e7d867364d144610fe993dc77c24 | [] | no_license | NULLdevelopments/NULLwars | 5418ba5c09c0a6dba64679c9ea6b292227cf6e9a | 2f4ab5325b273d6b672ad444e1c300d475e68b82 | refs/heads/master | 2020-08-27T02:22:31.053016 | 2013-02-15T03:21:17 | 2013-02-15T03:21:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,503 | java | package pack.NULLwars.main;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.os.Looper;
public class Record {
Context context;
AlertDialog.Builder dlgAlert;
public Record(Context context){this.context = context;}
public void saveHighScore(){
SharedPreferences prefs = context.getSharedPreferences("myPrefsKey", Context.MODE_PRIVATE);
Editor editor = prefs.edit();
//editor.putBoolean("highScore", MainGamePanel.player.getHighScore());
editor.commit();
}
public void loadHighScore(){
/*SharedPreferences prefs = context.getSharedPreferences("myPrefsKey", Context.MODE_PRIVATE);
if (prefs.getInt("highScore", 0) <= 0) {
displayMessage("Hello Programmer","Look at your Record.java class to change this message");
}
else{
//MainGamePanel.player.setHighScore(prefs.getInt("highScore"));
}*/
}
public void displayMessage(String title, String message){
dlgAlert = new AlertDialog.Builder(context);
dlgAlert.setMessage(message);
dlgAlert.setTitle(title);
dlgAlert.setPositiveButton("Continue", null);
dlgAlert.setCancelable(true);
dlgAlert.create();
dlgAlert.show();
dlgAlert.setPositiveButton("Continue",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {Looper.prepare();}});
}
} | [
"deben3@gmail.com"
] | deben3@gmail.com |
5e3afa5c1b03230db12bb05915592d1e5937e57b | 6514f2ecdaa6d75fcabce545a63485f77c13b0fe | /src/chap09/lecture/thisKeyword/MyClass.java | 047df1b5570bf040e18f566de170e514d6c88f3e | [] | no_license | sj1338/java20200929 | d7b3a14800c0dbac71acd7e5ca3d53c39c5b9afd | 9723f9bc270ee55cda36ab7e206517971f12058a | refs/heads/master | 2023-01-03T20:42:59.143541 | 2020-10-30T07:40:21 | 2020-10-30T07:40:21 | 299,485,579 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 236 | java | package chap09.lecture.thisKeyword;
public class MyClass {
class Nested {
int field1;
void method() {
System.out.println(field1);
System.out.println(this,field1);
System.out.println(MyClass.this.field);
}
}
}
| [
"id177@naver.com"
] | id177@naver.com |
9af156ab6c3a3a38bfe4f1bd0f82ba171ad49176 | 048129633c00f023a41c5e753091fbfab55312e7 | /ESEpl405/src/LuxuryCar.java | 965e651d222a833c81d31bc2f2a16c81fc8bd2a8 | [] | no_license | Dhanraj-1940/PL405-ESE | 148e4273c66fc0fd1ec4e1ef445aee81ea63ae8f | cd22513c6875b369f998952b611de5d172b8ee2f | refs/heads/master | 2023-06-10T16:52:30.580732 | 2021-06-28T11:02:56 | 2021-06-28T11:02:56 | 381,000,017 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 161 | java |
public class LuxuryCar implements Car{
private String info;
@Override
public String details() {
info = "this is a Luxury design car";
return info;
}
}
| [
"mca.1940@unigoa.ac.in"
] | mca.1940@unigoa.ac.in |
fa43e30ad8b06d7bf1f9296ae6c1c53ef0c71c63 | 7c52ab1b8f614be111376edc9a2fb8e18011e6e3 | /app/src/androidTest/java/com/searchdemo/ExampleInstrumentedTest.java | 48452a0e63b1733178a9acff8e37483af6f6f18e | [] | no_license | SatanPandeya/SearchViewDemo | a9b8a15797278f2c15ac4509fbe7b1dd243ac7e5 | 3a528d0ed82cfe3b13754d4cf3a6de52d498b2f8 | refs/heads/master | 2021-01-21T18:43:48.377755 | 2017-05-22T16:57:45 | 2017-05-22T16:57:45 | 92,077,785 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 732 | java | package com.searchdemo;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.searchdemo", appContext.getPackageName());
}
}
| [
"satanpandeya@gmail.com"
] | satanpandeya@gmail.com |
ac98f80c1b7cf0278fe269b9fc1f7a782dcbe195 | 35c316d4f4c86fb29fba8766b181b22a50de077a | /android/colorblob/openCVLibrary341/src/main/java/org/opencv/features2d/DescriptorExtractor.java | c7b7cd53d1e7236df80ba9396279bf4c23c6aaeb | [
"MIT"
] | permissive | arpitakarkera/frugal-doodle | 96872ebfd694a6dfc4ca0a415502fdfac653cb86 | 38c77187fbada13433790bd0e66a0a7f4a00c742 | refs/heads/master | 2021-03-31T00:00:56.078732 | 2020-01-04T04:31:12 | 2020-01-04T04:31:12 | 124,652,875 | 5 | 5 | MIT | 2018-03-11T07:02:41 | 2018-03-10T12:17:58 | Python | UTF-8 | Java | false | false | 5,609 | java | //
// This file is auto-generated. Please don't modify it!
//
package org.opencv.features2d;
import java.lang.String;
import java.util.ArrayList;
import java.util.List;
import org.opencv.core.Mat;
import org.opencv.core.MatOfKeyPoint;
import org.opencv.features2d.DescriptorExtractor;
import org.opencv.utils.Converters;
// C++: class javaDescriptorExtractor
//javadoc: javaDescriptorExtractor
@Deprecated
public class DescriptorExtractor {
protected final long nativeObj;
protected DescriptorExtractor(long addr) { nativeObj = addr; }
public long getNativeObjAddr() { return nativeObj; }
// internal usage only
public static DescriptorExtractor __fromPtr__(long addr) { return new DescriptorExtractor(addr); }
private static final int
OPPONENTEXTRACTOR = 1000;
public static final int
SIFT = 1,
SURF = 2,
ORB = 3,
BRIEF = 4,
BRISK = 5,
FREAK = 6,
AKAZE = 7,
OPPONENT_SIFT = OPPONENTEXTRACTOR + SIFT,
OPPONENT_SURF = OPPONENTEXTRACTOR + SURF,
OPPONENT_ORB = OPPONENTEXTRACTOR + ORB,
OPPONENT_BRIEF = OPPONENTEXTRACTOR + BRIEF,
OPPONENT_BRISK = OPPONENTEXTRACTOR + BRISK,
OPPONENT_FREAK = OPPONENTEXTRACTOR + FREAK,
OPPONENT_AKAZE = OPPONENTEXTRACTOR + AKAZE;
//
// C++: static Ptr_javaDescriptorExtractor create(int extractorType)
//
//javadoc: javaDescriptorExtractor::create(extractorType)
public static DescriptorExtractor create(int extractorType)
{
DescriptorExtractor retVal = DescriptorExtractor.__fromPtr__(create_0(extractorType));
return retVal;
}
//
// C++: bool empty()
//
//javadoc: javaDescriptorExtractor::empty()
public boolean empty()
{
boolean retVal = empty_0(nativeObj);
return retVal;
}
//
// C++: int descriptorSize()
//
//javadoc: javaDescriptorExtractor::descriptorSize()
public int descriptorSize()
{
int retVal = descriptorSize_0(nativeObj);
return retVal;
}
//
// C++: int descriptorType()
//
//javadoc: javaDescriptorExtractor::descriptorType()
public int descriptorType()
{
int retVal = descriptorType_0(nativeObj);
return retVal;
}
//
// C++: void compute(Mat image, vector_KeyPoint& keypoints, Mat descriptors)
//
//javadoc: javaDescriptorExtractor::compute(image, keypoints, descriptors)
public void compute(Mat image, MatOfKeyPoint keypoints, Mat descriptors)
{
Mat keypoints_mat = keypoints;
compute_0(nativeObj, image.nativeObj, keypoints_mat.nativeObj, descriptors.nativeObj);
return;
}
//
// C++: void compute(vector_Mat images, vector_vector_KeyPoint& keypoints, vector_Mat& descriptors)
//
//javadoc: javaDescriptorExtractor::compute(images, keypoints, descriptors)
public void compute(List<Mat> images, List<MatOfKeyPoint> keypoints, List<Mat> descriptors)
{
Mat images_mat = Converters.vector_Mat_to_Mat(images);
List<Mat> keypoints_tmplm = new ArrayList<Mat>((keypoints != null) ? keypoints.size() : 0);
Mat keypoints_mat = Converters.vector_vector_KeyPoint_to_Mat(keypoints, keypoints_tmplm);
Mat descriptors_mat = new Mat();
compute_1(nativeObj, images_mat.nativeObj, keypoints_mat.nativeObj, descriptors_mat.nativeObj);
Converters.Mat_to_vector_vector_KeyPoint(keypoints_mat, keypoints);
keypoints_mat.release();
Converters.Mat_to_vector_Mat(descriptors_mat, descriptors);
descriptors_mat.release();
return;
}
//
// C++: void read(String fileName)
//
//javadoc: javaDescriptorExtractor::read(fileName)
public void read(String fileName)
{
read_0(nativeObj, fileName);
return;
}
//
// C++: void write(String fileName)
//
//javadoc: javaDescriptorExtractor::write(fileName)
public void write(String fileName)
{
write_0(nativeObj, fileName);
return;
}
@Override
protected void finalize() throws Throwable {
delete(nativeObj);
}
// C++: static Ptr_javaDescriptorExtractor create(int extractorType)
private static native long create_0(int extractorType);
// C++: bool empty()
private static native boolean empty_0(long nativeObj);
// C++: int descriptorSize()
private static native int descriptorSize_0(long nativeObj);
// C++: int descriptorType()
private static native int descriptorType_0(long nativeObj);
// C++: void compute(Mat image, vector_KeyPoint& keypoints, Mat descriptors)
private static native void compute_0(long nativeObj, long image_nativeObj, long keypoints_mat_nativeObj, long descriptors_nativeObj);
// C++: void compute(vector_Mat images, vector_vector_KeyPoint& keypoints, vector_Mat& descriptors)
private static native void compute_1(long nativeObj, long images_mat_nativeObj, long keypoints_mat_nativeObj, long descriptors_mat_nativeObj);
// C++: void read(String fileName)
private static native void read_0(long nativeObj, String fileName);
// C++: void write(String fileName)
private static native void write_0(long nativeObj, String fileName);
// native support for java finalize()
private static native void delete(long nativeObj);
}
| [
"karkeraarpita@gmail.com"
] | karkeraarpita@gmail.com |
ff47b4e7c0e67dadeba0d628df6cb8e8e38a28d3 | 8e3941ee97889e837867ca241fe144c0187bc744 | /src/test/java/davion/study/face/FaceApplicationTests.java | 5445a0f846c31b9b72cc18f18f3d47b6c866f9e8 | [] | no_license | Davion2017/face | 23109f4400c7f3b9b3bb709b9e3d3a469d6a5377 | c9c79d84089500842d9aa3cbdb925f40a992bba4 | refs/heads/master | 2020-12-04T00:02:51.293424 | 2020-01-03T07:02:06 | 2020-01-03T07:02:06 | 231,531,941 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 216 | java | package davion.study.face;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class FaceApplicationTests {
@Test
void contextLoads() {
}
}
| [
"davion2017@foxmail.com"
] | davion2017@foxmail.com |
37bce384a1eed6ef775bb2f7324e89aaa79a83bb | 8979fc82ea7b34410b935fbea0151977a0d46439 | /src/all_problems/P1238_CircularPermutationInBinaryRepresentation.java | a36c15c5de76989256fda818da8575bce4f4670c | [
"MIT"
] | permissive | YC-S/LeetCode | 6fa3f4e46c952b3c6bf5462a8ee0c1186ee792bd | 452bb10e45de53217bca52f8c81b3034316ffc1b | refs/heads/master | 2021-11-06T20:51:31.554936 | 2021-10-31T03:39:38 | 2021-10-31T03:39:38 | 235,529,949 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 360 | java | package all_problems;
import java.util.ArrayList;
import java.util.List;
public class P1238_CircularPermutationInBinaryRepresentation {
public List<Integer> circularPermutation(int n, int start) {
List<Integer> res = new ArrayList<>();
for (int i = 0; i < 1 << n; ++i)
res.add(start ^ i ^ i >> 1);
return res;
}
}
| [
"yuanchenshi@gmail.com"
] | yuanchenshi@gmail.com |
15c05835c03361785100c0535ce80221c12224d3 | b9c4ecc88aa5a63f553086632b1ff9ab9194b29a | /Chapter02/Recipe2-17/src/main/java/net/homenet/s1/ArithmeticCalculatorImpl.java | 7e9d68ac7ceff1ba98cbea6a9c09c66909714959 | [] | no_license | mousesd/Spring5Recipe | 69c2fcf719274fb1f53de59289684734fff0225e | fa3cbcb83de41ab02150443c14068954fa0ab9f0 | refs/heads/master | 2020-03-31T01:59:05.007582 | 2019-02-13T15:33:42 | 2019-02-13T15:33:42 | 151,796,669 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,068 | java | package net.homenet.s1;
import org.springframework.stereotype.Component;
@Component("arithmeticCalculator")
public class ArithmeticCalculatorImpl implements ArithmeticCalculator {
@Override
@LoggingRequired
public double add(double x, double y) {
double result = x + y;
System.out.println(x + "+" + y + "=" + result);
return result;
}
@Override
@LoggingRequired
public double sub(double x, double y) {
double result = x - y;
System.out.println(x + "-" + y + "=" + result);
return result;
}
@Override
@LoggingRequired
public double mul(double x, double y) {
double result = x * y;
System.out.println(x + "*" + y + "=" + result);
return result;
}
@Override
@LoggingRequired
public double div(double x, double y) {
if (y == 0) {
throw new IllegalArgumentException("Division by zero");
}
double result = x / y;
System.out.println(x + "/" + y + "=" + result);
return result;
}
}
| [
"mousesd@gmail.com"
] | mousesd@gmail.com |
dca6449673249838844863cfe3dfda10ccefe988 | 23bac451e30e9823afa66eecc636821a1822560e | /java/AP2DX/lib/jmockit/main/test/mockit/CapturingInstancesTest.java | 16af9ebd40b6494871b79d9c243da51af99fe52b | [
"MIT"
] | permissive | JJWTimmer/AP2DX | 39927d3f06e911f7be6ae4b26f40cba07c8636c5 | 1da312eeb96fe8524ce7cea3fd54ce904ac17cb5 | refs/heads/master | 2016-09-05T17:46:42.580677 | 2011-07-10T20:14:14 | 2011-07-10T20:14:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,909 | java | /*
* Copyright (c) 2006-2011 Rogério Liesenfeld
* This file is subject to the terms of the MIT license (see LICENSE.txt).
*/
package mockit;
import java.util.*;
import java.util.concurrent.*;
import org.junit.*;
import static org.junit.Assert.*;
public final class CapturingInstancesTest
{
public interface Service { int doSomething(); }
static final class ServiceImpl implements Service { public int doSomething() { return 1; } }
public static final class TestedUnit
{
private final Service service1 = new ServiceImpl();
private final Service service2 = new Service() { public int doSomething() { return 2; } };
Observable observable;
public int businessOperation(final boolean b)
{
new Callable()
{
public Object call() { throw new IllegalStateException(); }
}.call();
observable = new Observable()
{
{
if (b) {
throw new IllegalArgumentException();
}
}
};
return service1.doSomething() + service2.doSomething();
}
}
@Mocked(capture = 2) Service service;
@Test
public void captureServiceInstancesCreatedByTestedConstructor()
{
Service initialMockService = service;
new TestedUnit();
assertNotSame(initialMockService, service);
assertFalse(service instanceof ServiceImpl);
}
@Test
public void captureAllInternallyCreatedInstances(@Mocked(capture = 1) final Callable<?> callable) throws Exception
{
new NonStrictExpectations()
{
@Mocked(capture = 1) Observable observable;
{
service.doSomething(); returns(3, 4);
}
};
TestedUnit unit = new TestedUnit();
int result = unit.businessOperation(true);
assertNotNull(unit.observable);
assertEquals(7, result);
new Verifications() {{ callable.call(); }};
}
@Test
public void recordStrictExpectationsForNextTwoInstancesToBeCreatedUsingMockFields()
{
new Expectations()
{
@Mocked(capture = 1) Service s1;
@Mocked(capture = 1) Service s2;
{
s1.doSomething(); result = 11;
s2.doSomething(); result = 22;
}
};
assertEquals(11, new ServiceImpl().doSomething());
assertEquals(22, new ServiceImpl().doSomething());
}
@Test
public void recordStrictExpectationsForNextTwoInstancesToBeCreatedUsingMockParameters(
@Mocked(capture = 1) final Service s1, @Capturing(maxInstances = 1) final Service s2)
{
new Expectations()
{
{
s1.doSomething(); result = 11;
s2.doSomething(); returns(22, 33);
}
};
assertEquals(11, new ServiceImpl().doSomething());
ServiceImpl s = new ServiceImpl();
assertEquals(22, s.doSomething());
assertEquals(33, s.doSomething());
}
@Test
public void recordExpectationsForNextTwoInstancesToBeCreatedUsingNonStrictMockFields()
{
new Expectations()
{
@NonStrict @Mocked(capture = 1) Service s1;
@NonStrict @Mocked(capture = 1) Service s2;
{
s1.doSomething(); result = 11;
s2.doSomething(); result = 22;
}
};
ServiceImpl s1 = new ServiceImpl();
ServiceImpl s2 = new ServiceImpl();
assertEquals(22, s2.doSomething());
assertEquals(11, s1.doSomething());
assertEquals(11, s1.doSomething());
assertEquals(22, s2.doSomething());
assertEquals(11, s1.doSomething());
}
@Test
public void recordNonStrictExpectationsForNextTwoInstancesToBeCreatedUsingMockFields()
{
new NonStrictExpectations()
{
@Capturing(maxInstances = 1) Service s1;
@Capturing(maxInstances = 1) Service s2;
{
s1.doSomething(); result = 11;
s2.doSomething(); result = 22;
}
};
assertEquals(11, new ServiceImpl().doSomething());
assertEquals(22, new ServiceImpl().doSomething());
}
@Test
public void recordExpectationsForNextTwoInstancesToBeCreatedUsingNonStrictMockParameters(
@NonStrict @Capturing(maxInstances = 1) final Service s1, @NonStrict @Mocked(capture = 1) final Service s2)
{
new Expectations()
{
{
s2.doSomething(); result = 22;
s1.doSomething(); result = 11;
}
};
ServiceImpl cs1 = new ServiceImpl();
assertEquals(11, cs1.doSomething());
ServiceImpl cs2 = new ServiceImpl();
assertEquals(22, cs2.doSomething());
assertEquals(11, cs1.doSomething());
assertEquals(22, cs2.doSomething());
}
} | [
"jjwtimmer@gmail.com"
] | jjwtimmer@gmail.com |
f5485f8e80ecd7cdb8eba577d9db4bfc9c4cf6ec | 278cd164d85351e9c7eeeaef92525bef44312436 | /design-archetypes/design-archetype-admin/design-auth/src/main/java/com/union/design/auth/dto/LoginDTO.java | 8af65c77052c4b74167188dd10b515a898a25554 | [] | no_license | LightOfFaith/design | fc017c00081bdcd438c93e67e72328ed862584d0 | db141210ff83b949880925f3c8f3fc4cf438660b | refs/heads/master | 2023-05-13T22:20:30.257028 | 2021-06-04T10:18:18 | 2021-06-04T10:18:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 258 | java | package com.union.design.auth.dto;
import lombok.Data;
import java.io.Serializable;
@Data
public class LoginDTO implements Serializable {
private static final long serialVersionUID = 1L;
private String username;
private String password;
}
| [
"307071075@qq.com"
] | 307071075@qq.com |
a4155a91adeaa2566e87476538acdf5dc447ddff | 892b08bf8b9b4dd1285fcfe23d3adc0c202f5cfe | /1175. 质数排列/src/Solution.java | b4f75042a33ebd269c5a29b61dcc8322656e483e | [] | no_license | VERGESSE/leetCode | a1db5f41b351ee88632db480d9026030fa6e1d37 | 1253a6a44cb5e29b2ded1eaf29ee9eb6f3597d4b | refs/heads/master | 2022-12-06T23:48:20.479120 | 2022-11-27T03:51:25 | 2022-11-27T03:51:25 | 238,168,506 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 765 | java | class Solution {
static final int MOD = 1000000007;
public int numPrimeArrangements(int n) {
int numPrimes = 0;
for (int i = 1; i <= n; i++) {
if (isPrime(i)) {
numPrimes++;
}
}
return (int) (factorial(numPrimes) * factorial(n - numPrimes) % MOD);
}
public boolean isPrime(int n) {
if (n == 1) {
return false;
}
for (int i = 2; i * i <= n; i++) {
if (n % i == 0) {
return false;
}
}
return true;
}
public long factorial(int n) {
long res = 1;
for (int i = 1; i <= n; i++) {
res *= i;
res %= MOD;
}
return res;
}
}
| [
"1258252786@qq.com"
] | 1258252786@qq.com |
d85afbf88863a6ced3f111b7a6552e72535d719b | 8417fdca5ae06b89ccb89a77fb3a019fbb1feab2 | /chapter_13/IGenQ.java | 679c9d6883c4ce12b339147c1ac295f6f1355149 | [] | no_license | dskiser/Java | a8bab9a7fbf81b14cb50411330155283a98a31a5 | a64ecd70d54eb46d4c74b5c47a3e3a9c017a13cd | refs/heads/master | 2021-05-06T04:18:39.852932 | 2017-12-20T20:37:41 | 2017-12-20T20:37:41 | 114,929,052 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 216 | java | // A generic queue interface
public interface IGenQ<T> {
// Put an item into the queue.
void put(T ch) throws QueueFullException;
// Get an item from the queue.
T get() throws QueueEmptyException;
}
| [
"dskiser@email.uark.edu"
] | dskiser@email.uark.edu |
f9dafb64cc3c1354343b8405d2fc25d8bc8aace2 | c804d5330b426e8c7ef409a09a9351d462b757c1 | /src/main/java/cn/xidian/designpattern/StatePatternTest.java | 67ff217ea48e2c56db466eb1ed41437ee611ac09 | [] | no_license | XiDian-ChenMiao/java-master | 7200797d7bb4c7e8bc48c3916f2bbea1e51ffc87 | 2ba9152c6ddfd2b430855210a81b9f01c34fee26 | refs/heads/master | 2022-07-13T03:10:02.928556 | 2022-01-01T12:26:34 | 2022-01-01T12:26:34 | 97,658,986 | 0 | 0 | null | 2022-06-21T00:04:20 | 2017-07-19T01:25:14 | Java | UTF-8 | Java | false | false | 2,108 | java | package cn.xidian.designpattern;
/**
* 抽象状态类
*/
abstract class AbstractState {
private Context context;
public void setContext(Context context) {
this.context = context;
}
public Context getContext() {
return context;
}
protected abstract void operation1();
protected abstract void operation2();
}
/**
* 具体状态一的类
*/
class ConcreteState1 extends AbstractState {
@Override
protected void operation1() {
System.out.println("这是状态一执行的方法");
}
@Override
protected void operation2() {
super.getContext().setAbstractState(Context.STATE_2);
super.getContext().doOperation2();
}
}
/**
* 具体状态二的类
*/
class ConcreteState2 extends AbstractState {
@Override
protected void operation1() {
super.getContext().setAbstractState(Context.STATE_1);
super.getContext().doOperation1();
}
@Override
protected void operation2() {
System.out.println("这是状态二执行的方法");
}
}
/**
* 管理状态的容器类
*/
class Context {
public final static AbstractState STATE_1 = new ConcreteState1();
public final static AbstractState STATE_2 = new ConcreteState2();
private AbstractState currentState;
public void setAbstractState(AbstractState currentState) {
this.currentState = currentState;
this.currentState.setContext(this);
}
public void doOperation1() {
this.currentState.operation1();
}
public void doOperation2() {
this.currentState.operation2();
}
}
/**
* 文件描述:状态模式测试类
* Note:状态模式的使用场景:行为随状态的改变而改变的场景;条件、分支判断语句的替代者
* 创建作者:陈苗
* 创建时间:2016年5月18日 23:08
*/
public class StatePatternTest {
public static void main(String[] args) {
Context context = new Context();
context.setAbstractState(new ConcreteState1());
context.doOperation1();
context.doOperation2();
}
}
| [
"chenmiao@topscomm.com"
] | chenmiao@topscomm.com |
f1818f72124c202030086294e76dbe13af1b0535 | 2cce59cf5fc4c2c7f6e55015a5b54937933f02de | /src/com/lakecloud/foundation/service/ISpareGoodsFloorService.java | eaf12b647892acd91be740ec66d6bcb5d7df0f45 | [] | no_license | qriv/mall | 9bf0ae65610c250dce4fbfb578af71a04076b19b | fb5f4887973d4fabca5ffedd87d07538ba0cbc33 | refs/heads/master | 2020-04-06T04:16:20.447561 | 2015-11-28T13:04:48 | 2015-11-28T14:02:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,463 | java | package com.lakecloud.foundation.service;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
import com.lakecloud.core.query.support.IPageList;
import com.lakecloud.core.query.support.IQueryObject;
import com.lakecloud.foundation.domain.SpareGoodsFloor;
public interface ISpareGoodsFloorService {
/**
* 保存一个SpareGoodsFloor,如果保存成功返回true,否则返回false
*
* @param instance
* @return 是否保存成功
*/
boolean save(SpareGoodsFloor instance);
/**
* 根据一个ID得到SpareGoodsFloor
*
* @param id
* @return
*/
SpareGoodsFloor getObjById(Long id);
/**
* 删除一个SpareGoodsFloor
*
* @param id
* @return
*/
boolean delete(Long id);
/**
* 批量删除SpareGoodsFloor
*
* @param ids
* @return
*/
boolean batchDelete(List<Serializable> ids);
/**
* 通过一个查询对象得到SpareGoodsFloor
*
* @param properties
* @return
*/
IPageList list(IQueryObject properties);
/**
* 更新一个SpareGoodsFloor
*
* @param id
* 需要更新的SpareGoodsFloor的id
* @param dir
* 需要更新的SpareGoodsFloor
*/
boolean update(SpareGoodsFloor instance);
/**
*
* @param query
* @param params
* @param begin
* @param max
* @return
*/
List<SpareGoodsFloor> query(String query, Map params, int begin, int max);
}
| [
"tangfeixian@hotmail.com"
] | tangfeixian@hotmail.com |
49d33a2b10793fd6501be02dddd8d99503c21abb | 117ae85008d1724f5dc6a5c0e1e1bc50e4853e75 | /src/com/tz/ioc/ioc05/Test02.java | bdaa734c4d25e0aafd8857afe6aaf398ec08d675 | [] | no_license | kobe1329989713/tzspring | 6e10ba8dd2126a4c3d2ab9f3f2434772384b316f | f490ba6dc45b15eea29779132f115760b7c572b2 | refs/heads/master | 2021-01-19T15:55:26.278411 | 2017-09-23T07:08:48 | 2017-09-23T07:08:48 | 100,980,150 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 895 | java | package com.tz.ioc.ioc05;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
/**
* <B>作者:</B>kobe<BR>
* <B>时间:</B>2017/09/02/ 16:18 星期六<BR>
* <p>
* <B>系统名称:</B>tzspring<BR>
* <B>概要说明:</B>tzspring<BR>
*/
public class Test02 {
public static void main(String[] args) {
//第四种(注释 加载) AnnotationConfigApplicationContext
// 就是:扫包 加注解 这两步即可
ApplicationContext context2 = new AnnotationConfigApplicationContext("com.tz.ioc.ioc05");
UserDao userDao = (UserDao) context2.getBean("userDao");
userDao.svae();
// ApplicationContext context3 = new AnnotationConfigApplicationContext(Beans.class);
// Student student = context3.getBean(Student.class);
// System.out.println(student.getUsername());
}
}
| [
"a81126284010"
] | a81126284010 |
998b563101d6ed805d4806515c0632a02dee466b | 1132cef0ea0246b0ef505ee8daa3cdb342499fbc | /LeetCode/src/Top100/Serialize_and_Deserialize_Binary_Tree.java | 0018d9befb0b3393815d9696da3bb17453c3fa35 | [] | no_license | zhhaochen/Algorithm | fd92a748fd727700abba8ad92db0d72663058666 | 509a8f29f00ed665182c8314c11c5a67b023701f | refs/heads/master | 2023-07-02T08:14:13.918245 | 2021-08-05T16:31:08 | 2021-08-05T16:31:08 | 288,951,652 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,301 | java | package Top100;
/**
* 2020.11.26
* 对一棵二叉树编码为字符串,然后能将字符串解码一棵二叉树
*/
public class Serialize_and_Deserialize_Binary_Tree {
String SEP = ",";
String NULL = "#";
int index;
// Encodes a tree to a single string.
public String serialize(TreeNode root) {
StringBuilder sb = new StringBuilder();
serialize(root, sb);
return sb.toString();
}
private void serialize(TreeNode root, StringBuilder sb){
if (root == null){
sb.append(NULL).append(SEP);
return;
}
sb.append(root.val).append(SEP);
serialize(root.left, sb);
serialize(root.right, sb);
}
// Decodes your encoded data to tree.
public TreeNode deserialize(String data) {
String[] nodes = data.split(SEP);
index = 0;
return deserialize(nodes);
}
public TreeNode deserialize(String[] nodes){
if (index >= nodes.length){
return null;
}
if (nodes[index].equals("#")){
index++;
return null;
}
TreeNode root = new TreeNode(Integer.valueOf(nodes[index++]));
root.left = deserialize(nodes);
root.right = deserialize(nodes);
return root;
}
}
| [
"zhhaochen@gmail.com"
] | zhhaochen@gmail.com |
68140bc3152b691128abadb59cb0d85abfd556db | 2183d6ad8851dbcc69c5daf31c97efecb2dc16bd | /Webview/app/src/test/java/me/jakir/webview/ExampleUnitTest.java | 7f26834c89a577c22cc71a87e9f5dbed94386b87 | [] | no_license | jakirseu/android_demos | e90a0a0ef7cf75fa3d967f97d740a4ccb0bafb1c | e58110d237b904a16c2b851783ef98892b2d836c | refs/heads/master | 2020-05-21T23:36:46.134957 | 2017-01-16T17:16:52 | 2017-01-16T17:16:52 | 50,979,383 | 9 | 4 | null | null | null | null | UTF-8 | Java | false | false | 309 | java | package me.jakir.webview;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"jakir.hossain@gagagugu.com"
] | jakir.hossain@gagagugu.com |
4d799d775bcf7432eeaea06bc9fcb32d2baf8dd5 | 263cabd52a41e74cbf1afa493f24c18a7e0a9c3f | /keywordextraction/src/main/java/keywordextraction/KEWord.java | ccb63c06e909f866ed9ba73abb2d5a5be15d1609 | [] | no_license | bibekshakya35/NLP | 2e4cb1ffa951122683a3127f8d4e43c2acc9d746 | 127f4f75e4fd1c1d99f4d3498c15e9ec0d06fac5 | refs/heads/master | 2022-07-09T19:08:05.922237 | 2019-02-15T03:50:29 | 2019-02-15T03:50:29 | 102,276,875 | 0 | 0 | null | 2022-07-01T20:38:16 | 2017-09-03T16:09:31 | Java | UTF-8 | Java | false | false | 328 | java | package keywordextraction;
public class KEWord {
private String value;
public KEWord(String value) {
this.value = value;
}
public boolean isEmpty() {
return value == null || value.trim().isEmpty();
}
public String getAsLowerCase() {
return value.trim().toLowerCase();
}
}
| [
"bibekshakya35@gmail.com"
] | bibekshakya35@gmail.com |
fe449d2a4c90d64c09c99f7980c5791ae8114e58 | 4e762b09576c109ede9cc1e8a97547d3ac90e565 | /oa-web-support/src/main/java/com/oa/web/support/shiro/cache/impl/JedisShiroCacheManager.java | c27f2861ca969a0cb6900c2ebed5b9d10b252025 | [] | no_license | xtito/oa-project | d7056f9f7efda55b943aca8891950fa24074778d | 4f8fb6b2b60332ad6e6d8ff10d9fde102d2aa96d | refs/heads/master | 2022-12-24T02:51:52.961998 | 2020-04-04T15:37:05 | 2020-04-04T15:37:05 | 102,319,833 | 0 | 1 | null | 2022-12-16T12:08:58 | 2017-09-04T04:50:03 | JavaScript | UTF-8 | Java | false | false | 919 | java | package com.oa.web.support.shiro.cache.impl;
import com.oa.web.support.shiro.cache.JedisManager;
import com.oa.web.support.shiro.cache.JedisShiroCache;
import com.oa.web.support.shiro.cache.ShiroCacheManager;
import org.apache.shiro.cache.Cache;
/**
*
*
* Created by [张渊]
* 2017/11/4 12:52
*/
public class JedisShiroCacheManager implements ShiroCacheManager {
private JedisManager jedisManager;
@Override
public <K, V> Cache<K, V> getCache(String name) {
return new JedisShiroCache<K, V>(name, getJedisManager());
}
@Override
public void destroy() {
// 如果和其他系统,或者应用在一起就不能关闭
// getJedisManager().getJedis().shutdown();
}
public JedisManager getJedisManager() {
return jedisManager;
}
public void setJedisManager(JedisManager jedisManager) {
this.jedisManager = jedisManager;
}
}
| [
"7924023@qq.com"
] | 7924023@qq.com |
13556eb8b93e13c924130505a0c73dc5d6937ca5 | 4205d1312f17bb1f3bbf28b7eb8c2b88f505d642 | /SimpleBrowser/BrowserFrame.java | fdb45deb5056a949c06990817449132af2b9ad3f | [] | no_license | dillonledoux/java | a3a743b36c9deb6c4844ae3627202a50cedd835d | cc6c884a2700c0d070a48aa629fc2f333ce1d769 | refs/heads/master | 2021-01-13T00:15:20.973015 | 2015-12-26T02:31:22 | 2015-12-26T02:31:22 | 48,592,518 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,184 | java | import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
public class BrowserFrame extends JFrame{
private JTextField addressBar;
private JTextArea display;
private String title = "Dilzilla FireDog";
//constructor
public BrowserFrame(BrowserEngine engine){
super();
setTitle(title);
addressBar = new JTextField("cs.okstate.edu");
addressBar.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent event){
String text = event.getActionCommand();
display.setText("");
engine.loadPage(text);
addressBar.setText(text);
}
}
);
add(addressBar, BorderLayout.NORTH);
display = new JTextArea();
display.setEditable(false);
add(new JScrollPane(display), BorderLayout.CENTER);
setSize(600, 800);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
}
public void bodyWrite(String text){
display.append(text+ "\n");
}
} | [
"dillon.ledoux@me.com"
] | dillon.ledoux@me.com |
1d0e7b8e33cfb4c5e199cb08f88ea474811b8eeb | 9006f432fbaccd1d79affa0901d433f0370d2311 | /dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/organisationunit/OrganisationUnitController.java | aa591abbf07f8bb4281c705fa10d25219e1cc6cb | [
"BSD-3-Clause"
] | permissive | hispindia/MAHARASHTRA-2.13 | 173a72b025242221b99cd03969a2c9b456cf8ef8 | f50ec5b3ca2c5fabb43058166fd0c0fbbaa946a9 | refs/heads/master | 2020-05-25T08:42:22.989760 | 2017-03-21T11:20:34 | 2017-03-21T11:20:34 | 84,927,851 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,508 | java | package org.hisp.dhis.api.controller.organisationunit;
/*
* Copyright (c) 2004-2013, University of Oslo
* 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 HISP project nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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.
*/
import org.hisp.dhis.api.controller.AbstractCrudController;
import org.hisp.dhis.api.controller.WebMetaData;
import org.hisp.dhis.api.controller.WebOptions;
import org.hisp.dhis.api.controller.exception.NotFoundException;
import org.hisp.dhis.api.utils.WebUtils;
import org.hisp.dhis.common.Pager;
import org.hisp.dhis.dxf2.metadata.MetaData;
import org.hisp.dhis.organisationunit.OrganisationUnit;
import org.hisp.dhis.organisationunit.OrganisationUnitService;
import org.hisp.dhis.organisationunit.comparator.OrganisationUnitByLevelComparator;
import org.hisp.dhis.user.CurrentUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @author Morten Olav Hansen <mortenoh@gmail.com>
*/
@Controller
@RequestMapping( value = OrganisationUnitController.RESOURCE_PATH )
public class OrganisationUnitController
extends AbstractCrudController<OrganisationUnit>
{
public static final String RESOURCE_PATH = "/organisationUnits";
@Autowired
private OrganisationUnitService organisationUnitService;
@Autowired
private CurrentUserService currentUserService;
@Override
protected List<OrganisationUnit> getEntityList( WebMetaData metaData, WebOptions options )
{
List<OrganisationUnit> entityList;
Date lastUpdated = options.getLastUpdated();
boolean levelSorted = options.getOptions().containsKey( "levelSorted" ) && Boolean.parseBoolean( options.getOptions().get( "levelSorted" ) );
Integer level = null;
Integer maxLevel = null;
if ( options.getOptions().containsKey( "level" ) )
{
level = Integer.parseInt( options.getOptions().get( "level" ) );
}
if ( options.getOptions().containsKey( "maxLevel" ) )
{
maxLevel = Integer.parseInt( options.getOptions().get( "maxLevel" ) );
if ( organisationUnitService.getOrganisationUnitLevelByLevel( maxLevel ) == null )
{
maxLevel = null;
}
if ( level == null )
{
level = 1;
}
}
if ( "true".equals( options.getOptions().get( "userOnly" ) ) )
{
entityList = new ArrayList<OrganisationUnit>( currentUserService.getCurrentUser().getOrganisationUnits() );
}
else if ( lastUpdated != null )
{
entityList = new ArrayList<OrganisationUnit>( manager.getByLastUpdatedSorted( getEntityClass(), lastUpdated ) );
if ( levelSorted )
{
Collections.sort( entityList, OrganisationUnitByLevelComparator.INSTANCE );
}
}
else if ( maxLevel != null || level != null )
{
entityList = new ArrayList<OrganisationUnit>();
if ( maxLevel == null )
{
entityList.addAll( organisationUnitService.getOrganisationUnitsAtLevel( level ) );
}
else
{
entityList.addAll( organisationUnitService.getOrganisationUnitsAtLevel( level ) );
while ( !level.equals( maxLevel ) )
{
entityList.addAll( organisationUnitService.getOrganisationUnitsAtLevel( ++level ) );
}
}
}
else if ( levelSorted )
{
entityList = new ArrayList<OrganisationUnit>( manager.getAll( getEntityClass() ) );
Collections.sort( entityList, OrganisationUnitByLevelComparator.INSTANCE );
}
else if ( options.hasPaging() )
{
int count = manager.getCount( getEntityClass() );
Pager pager = new Pager( options.getPage(), count, options.getPageSize() );
metaData.setPager( pager );
entityList = new ArrayList<OrganisationUnit>( manager.getBetween( getEntityClass(), pager.getOffset(), pager.getPageSize() ) );
}
else
{
entityList = new ArrayList<OrganisationUnit>( manager.getAllSorted( getEntityClass() ) );
}
return entityList;
}
@Override
@RequestMapping( value = "/{uid}", method = RequestMethod.GET )
public String getObject( @PathVariable( "uid" ) String uid, @RequestParam Map<String, String> parameters,
Model model, HttpServletRequest request, HttpServletResponse response ) throws Exception
{
WebOptions options = new WebOptions( parameters );
OrganisationUnit entity = getEntity( uid );
if ( entity == null )
{
throw new NotFoundException( uid );
}
Integer maxLevel = null;
if ( options.getOptions().containsKey( "maxLevel" ) )
{
try
{
maxLevel = Integer.parseInt( options.getOptions().get( "maxLevel" ) );
}
catch ( NumberFormatException ignored )
{
}
if ( maxLevel != null && (organisationUnitService.getOrganisationUnitLevelByLevel( maxLevel ) == null
|| maxLevel > organisationUnitService.getNumberOfOrganisationalLevels()) )
{
maxLevel = organisationUnitService.getNumberOfOrganisationalLevels();
}
}
if ( maxLevel != null )
{
List<OrganisationUnit> entities = new ArrayList<OrganisationUnit>();
entities.add( entity );
int level = entity.getOrganisationUnitLevel();
while ( maxLevel > level )
{
entities.addAll( organisationUnitService.getOrganisationUnitsAtLevel( ++level, entity ) );
}
MetaData metaData = new MetaData();
metaData.setOrganisationUnits( entities );
model.addAttribute( "model", metaData );
return StringUtils.uncapitalize( getEntitySimpleName() );
}
else if ( options.getOptions().containsKey( "includeDescendants" ) && Boolean.parseBoolean( options.getOptions().get( "includeDescendants" ) ) )
{
List<OrganisationUnit> entities = new ArrayList<OrganisationUnit>(
organisationUnitService.getOrganisationUnitsWithChildren( uid ) );
MetaData metaData = new MetaData();
metaData.setOrganisationUnits( entities );
model.addAttribute( "model", metaData );
}
else if ( options.getOptions().containsKey( "includeChildren" ) && Boolean.parseBoolean( options.getOptions().get( "includeChildren" ) ) )
{
List<OrganisationUnit> entities = new ArrayList<OrganisationUnit>();
entities.add( entity );
entities.addAll( entity.getChildren() );
MetaData metaData = new MetaData();
metaData.setOrganisationUnits( entities );
model.addAttribute( "model", metaData );
}
else
{
model.addAttribute( "model", entity );
}
if ( options.hasLinks() )
{
WebUtils.generateLinks( entity );
}
postProcessEntity( entity );
postProcessEntity( entity, options, parameters );
model.addAttribute( "viewClass", options.getViewClass( "detailed" ) );
return StringUtils.uncapitalize( getEntitySimpleName() );
}
}
| [
"mithilesh.hisp@gmail.com"
] | mithilesh.hisp@gmail.com |
50095a6a05d376d4656dadc192a810905361fe21 | 09681bb00162f45d09cf98acc53f2832f63def89 | /src/main/java/com/iidooo/core/util/ValidateUtil.java | 7e17859067b95515e3eeec9631ddb090baeaf0f1 | [] | no_license | wangyixian/iidooo-core | fc40b7405a92b51c61b632abb1146e5df0af1b38 | 68057f40cf43271bb767b02d6fcdcaa329a1da37 | refs/heads/master | 2021-01-21T04:59:25.402316 | 2016-07-21T09:55:35 | 2016-07-21T09:55:35 | 42,987,138 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 8,400 | java | package com.iidooo.core.util;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.log4j.Logger;
import com.iidooo.core.constant.RegularConstant;
public final class ValidateUtil {
private static Logger logger = Logger.getLogger(ValidateUtil.class);
/**
* 判断字符串是否符合正则表达式
* @param str 字符串
* @param regex 正则表达式
* @return 判断结果
*/
public static boolean isMatch(String str, String regex){
try {
if (str == null || str == "") {
return false;
}
Pattern pattern = Pattern.compile(regex);
boolean result = pattern.matcher(str).matches();
return result;
} catch (Exception e) {
logger.fatal(e);
return false;
}
}
/**
* 金额类数据字符串验证(可带小数点的金额类数据).
*
* @param str 对象文字列
* @return true false
*/
/*
* public static boolean isNumeric(final String str) {
*
* logger.debug("The begin of the method ValidatorUtil.isNumeric"); if (isEmptyIgnoreSpace(str)) { return false; } Pattern pattern =
* Pattern.compile(Constants.REGEX_NUMERIC_STR); boolean flg = pattern.matcher(str).matches();
* logger.debug("The end of the method ValidatorUtil.isNumeric"); return flg; }
*/
public static boolean isEnglish(final String str) {
try {
Pattern pattern = Pattern.compile(RegularConstant.REGEX_ENGLISH);
return pattern.matcher(str).matches();
} catch (Exception e) {
e.printStackTrace();
logger.fatal(e);
return false;
}
}
public static boolean isEnglishNumber(final String str) {
try {
Pattern pattern = Pattern.compile(RegularConstant.REGEX_ENGLISH_NUMBER);
return pattern.matcher(str).matches();
} catch (Exception e) {
e.printStackTrace();
logger.fatal(e);
return false;
}
}
/**
* 字符特定长度验证.
*
* @param str 对象文字列
* @param length 文字列的长度
* @return true:字符位数正确 false:字符位数不正
*/
/*
* public static boolean strLength(final String str, final int length) {
*
* logger.debug("The begin of the method ValidatorUtil.strLength"); if (isEmptyIgnoreSpace(str)) { return false; } boolean flg = false;
* if (str.length() == length) { flg = true; } logger.debug("The end of the method ValidatorUtil.strLength"); return flg; }
*//**
* 字符特定长度范围验证.
*
* @param str 对象文字列
* @param minLength 最小长度
* @param maxLength 最大长度
* @return true:字符位数范围正确 false:字符位数范围不正
*/
/*
* public static boolean strLengthRanger(final String str, final int minLength, final int maxLength) {
*
* logger.debug("The begin of the method ValidatorUtil.strLengthRanger"); if (isEmptyIgnoreSpace(str) || minLength > maxLength) { return
* false; } int strlength = str.length(); boolean flg = false; if (strlength >= minLength && strlength <= maxLength) { flg = true; }
* logger.debug("The end of the method ValidatorUtil.strLengthRanger"); return flg; }
*//**
* 全角字符验证(是否为全角字符).
*
* @param str 判定的文字列
* @return true:验证正确 false:验证不正
*/
/*
* public static boolean checkWideChar(final String str) {
*
* logger.debug("The begin of the method ValidatorUtil.checkWideChar"); boolean flg = false; try { if (isNotEmpty(str)) { byte[] abyte =
* str.getBytes(Constants.EUC_JP); for (int i = 0; i < abyte.length; i++) { byte be = abyte[i]; if (be >= 0 && be <=
* Constants.NUMBER_127 || be == Constants.NUMBER_MINUS_114) { if (be == Constants.NUMBER_63) { for (int j = 0; j < str.length(); j++) {
* char c = str.charAt(j); if (c == Constants.CHAR_QUESTION) { flg = false; break; } } } else { flg = false; break; } } } } } catch
* (UnsupportedEncodingException exception) { flg = false; } logger.debug("The end of the method ValidatorUtil.checkWideChar"); return
* flg; }
*//**
* 半角字符验证(是否为半角字符).
*
* @param str 判定的文字列
* @return true:验证正确 false:验证不正
*/
/*
* public static boolean checkHalfChar(final String str) {
*
* logger.debug("The begin of the method ValidatorUtil.checkHalfChar"); boolean flg = true; if (isNotEmptyIgnoreSpace(str)) { char
* cTemp; for (int i = 0; str.length() > i; i++) { cTemp = str.charAt(i); if (!((cTemp >= Constants.CHAR_EXCLAMATION && cTemp <=
* Constants.CHAR_TILDE) || (cTemp >= Constants.CHAR_PERIOD && cTemp <= Constants.CHAR_UP_PERIOD) || (cTemp == Constants.CHAR_SPACE))) {
* flg = false; break; } } } logger.debug("The end of the method ValidatorUtil.checkHalfChar"); return flg; }
*/
/**
* 验证是否是Email的格式
*
* @param email 该Email地址需要验证
* @return 验证正确还是错误的结果
*/
public static boolean isEmail(String email) {
try {
if (email == null || email.isEmpty()) {
return false;
}
Pattern p = Pattern.compile(RegularConstant.REGEX_EMAIL);
Matcher m = p.matcher(email);
return m.matches();
} catch (Exception e) {
e.printStackTrace();
logger.fatal(e);
return false;
}
}
/**
* 网址URL格式验证.
*
* @param url 验证网址URL文字列
* @return true:格式正确 false:格式不正
*/
/*
* public static boolean urlFormateValidate(final String url) {
*
* logger.debug("The begin of the method ValidatorUtil.urlFormateValidate"); boolean flg = false; if (isNotEmptyIgnoreSpace(url)) {
* Pattern p = Pattern.compile(Constants.REGEX_URL_FORMATE); Matcher m = p.matcher(url); flg = m.matches(); }
* logger.debug("The end of the method ValidatorUtil.urlFormateValidate"); return flg; }
*/
/**
* Validate the date format
*
* @param date The input date
* @param format The format of date
* @return validate result
*/
public static boolean validateDateFormat(String date, String format) {
try {
if (date == null || date.isEmpty()) {
return false;
}
SimpleDateFormat sdf = new SimpleDateFormat(format);
Date parsedDate = sdf.parse(date);
String parsedDateStr = sdf.format(parsedDate);
if (parsedDateStr.equals(date)) {
return true;
}
return false;
} catch (Exception e) {
e.printStackTrace();
logger.fatal(e);
return false;
}
}
/**
* 验证字符串中是否含特殊字符(特殊字符数组(<,>,&,",')).
*
* @param str 验证文字列
* @return true :含有特殊字符 false :不含有特殊字符
*/
/*
* public static boolean indexOfSpecialCharacter(final String str) {
*
* logger.debug("The begin of the method ValidatorUtil.indexOfSpecialCharacter"); boolean flg = false; // 非空判断 if
* (isNotEmptyIgnoreSpace(str)) { for (String chara : Constants.SPECIAL_CHARACTER) { if (str.indexOf(chara) >= 0) { flg = true; break; }
* } } logger.debug("The end of the method ValidatorUtil.indexOfSpecialCharacter"); return flg; }
*//**
* 是否是中文验证.
*
* @param str 对象文字列
* @return true:是中文字符串 false:非中文字符串
*/
/*
* public static boolean isChinese(final String str) {
*
* logger.debug("The begin of the method ValidatorUtil.isChinese"); if (isEmptyIgnoreSpace(str)) { return false; } Pattern pattern =
* Pattern.compile(Constants.REGEX_CHINESE_STR); boolean flg = pattern.matcher(str).matches();
* logger.debug("The end of the method ValidatorUtil.isChinese"); return flg; }
*/
public static void main(String[] args){
}
}
| [
"ouitiken@gmail.com"
] | ouitiken@gmail.com |
f78da251bbbe9faf3c1111535d001288d0e68b3c | d68158e926f2bf5de1596da108bbdf95cbe604d1 | /app/src/main/java/com/ta/finalexam/api/Request/ImageUploadRequest.java | 5d6bbbd85ad90f57a4e4496eb5f77bd311d8e3a9 | [] | no_license | tungnguyen18/Network-share-Photo | f695c22fceff03784f630b6f41b2844896e1d7f1 | 950a21f459142ee29aef8b325b3e8d998280218d | refs/heads/master | 2021-01-02T08:53:41.501046 | 2017-08-03T03:02:38 | 2017-08-03T03:02:38 | 99,088,705 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,634 | java | package com.ta.finalexam.api.Request;
import android.support.v4.app.FragmentActivity;
import com.android.volley.Request;
import com.android.volley.VolleyError;
import com.ta.finalexam.Constant.ApiConstance;
import com.ta.finalexam.Fragment.FragmentHome;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import vn.app.base.api.response.BaseResponse;
import vn.app.base.api.volley.core.UploadBinaryApiRequest;
import vn.app.base.util.FragmentUtil;
import vn.app.base.util.SharedPrefUtils;
/**
* Created by TungNguyen on 10/31/2016.
*/
public class ImageUploadRequest extends UploadBinaryApiRequest<BaseResponse> {
public String caption;
public String location;
public String lat;
public String mlong;
public String hashtag;
FragmentActivity mContext;
public ImageUploadRequest(String caption, String mlong, String lat, String location,
String hashtag, File image, FragmentActivity mContext) {
this.caption = caption;
this.mlong = mlong;
this.lat = lat;
this.location = location;
this.hashtag = hashtag;
this.mContext = mContext;
Map<String, File> fileMap = new HashMap<>();
fileMap.put("image", image);
setRequestFiles(fileMap);
}
@Override
public String getRequestURL() {
return ApiConstance.URL_UPLOAD;
}
@Override
public boolean isRequiredAccessToken() {
return false;
}
@Override
public Map<String, String> getRequestParams() {
Map<String, String> params = new HashMap<>();
if (!caption.isEmpty()) {
params.put(ApiConstance.CAPTION, caption);
}
if (!hashtag.isEmpty()) {
params.put(ApiConstance.HASHTAG, hashtag);
}
params.put(ApiConstance.LAT, lat);
params.put(ApiConstance.LONG, mlong);
params.put(ApiConstance.LOCATION, location);
return params;
}
@Override
public Map<String, String> getRequestHeaders() {
Map<String, String> header = new HashMap<>();
header.put(ApiConstance.TOKEN, SharedPrefUtils.getAccessToken());
return header;
}
@Override
public Class<BaseResponse> getResponseClass() {
return BaseResponse.class;
}
@Override
public int getMethod() {
return Request.Method.POST;
}
@Override
public void onRequestSuccess(BaseResponse response) {
FragmentUtil.pushFragmentWithAnimation(mContext, FragmentHome.newInstance(), null);
}
@Override
public void onRequestError(VolleyError error) {
}
} | [
"tungnguyen.runsystem@gmail.com"
] | tungnguyen.runsystem@gmail.com |
3ed0b3f53d5be954496d474a19dba5c9bae31bf4 | 43d857fcb9fa01868a6faa245bbe7826a22eb766 | /src/chapter21/WildCardDemo2.java | 7d3aa6371e384731664699e45225f2600a160872 | [
"MIT"
] | permissive | deltacat/intro-java-prog-8e | 98e372c9af9c021dc31932378fda0a9ae5c82122 | c816666de153698f29d4bfe02690e116f0392fde | refs/heads/master | 2020-06-05T07:26:06.388593 | 2015-03-10T08:14:19 | 2015-03-10T08:14:19 | 31,519,247 | 2 | 3 | null | null | null | null | UTF-8 | Java | false | false | 451 | java | package chapter21;
public class WildCardDemo2 {
public static void main(String[] args) {
GenericStack<Integer> intStack = new GenericStack<Integer>();
intStack.push(1); // 1 is autoboxed into new Integer(1)
intStack.push(2);
intStack.push(-2);
print(intStack);
}
/** Print objects and empties the stack */
public static void print(GenericStack<?> stack) {
while (!stack.isEmpty()) {
System.out.print(stack.pop() + " ");
}
}
}
| [
"github@catxn.net"
] | github@catxn.net |
20dc43196cc5d75610e1fa02bb622964385ab355 | 8862f7c427e4aeb0b2648bfc04f239df6e1c0f9c | /src/main/java/org/thinkium/blockchain/web3j/abi/datatypes/generated/Uint256.java | 49148ecb8848bad075d278656e39cd04863f11bb | [] | no_license | ThinkiumGroup/web3j | 7f35b98c9d472087ec052397fb0d135efb7d23d8 | ca411412acb9f0ed112c51abeb43f4a6e6e84d04 | refs/heads/master | 2023-05-30T10:20:35.635076 | 2021-06-25T11:24:51 | 2021-06-25T11:24:51 | 335,264,176 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 649 | java | package org.thinkium.blockchain.web3j.abi.datatypes.generated;
import org.thinkium.blockchain.web3j.abi.datatypes.Uint;
import java.math.BigInteger;
/**
* Auto generated code.
* <p><strong>Do not modifiy!</strong>
* <p>Please use org.web3j.codegen.AbiTypesGenerator in the
* <a href="https://github.com/web3j/web3j/tree/master/codegen">codegen module</a> to update.
*/
public class Uint256 extends Uint {
public static final Uint256 DEFAULT = new Uint256(BigInteger.ZERO);
public Uint256(BigInteger value) {
super(256, value);
}
public Uint256(long value) {
this(BigInteger.valueOf(value));
}
}
| [
"harry@potter.com"
] | harry@potter.com |
bbb6a6aedcdf5a5fa35311b05200b85cc63cdef7 | d343c42f87748da4ab6de66737d4f72455667e79 | /src/adapters/GridAdapter.java | 70498ac24a0cc4d516f441adb8f94f1e86e36051 | [] | no_license | gyerob/OoWHangeffekt | a1b56ca646d46aaacdb9bdb6faf47dc118487b5f | 2c5c3129cd9446f78d22557ba39c57b38a5c1fa2 | refs/heads/master | 2016-09-06T00:41:53.948144 | 2014-08-23T11:43:36 | 2014-08-23T11:43:36 | null | 0 | 0 | null | null | null | null | ISO-8859-2 | Java | false | false | 2,190 | java | package adapters;
import hu.gyerob.oowhangeffekt.R;
import java.util.ArrayList;
import android.app.Activity;
import android.content.Context;
import android.media.MediaPlayer;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import data.Adat;
public class GridAdapter extends ArrayAdapter<Adat> {
private ArrayList<Adat> adat;
private Context context;
private int layoutResourceId;
private MediaPlayer mPlayer;
private int prevpos = -1;
public GridAdapter(Context context, int resource, ArrayList<Adat> list) {
super(context, resource, list);
layoutResourceId = resource;
this.context = context;
adat = list;
mPlayer = new MediaPlayer();
Log.d("adapter konstruktor", "meghívva");
}
public class Viewholder {
ImageView image;
TextView text;
}
public void play(int pos) {
if (mPlayer != null) {
if(prevpos == pos) {
if(mPlayer.isPlaying()) {
mPlayer.stop();
} else {
mPlayer = MediaPlayer.create(context, adat.get(pos).id);
mPlayer.start();
}
} else {
if(mPlayer.isPlaying()) {
mPlayer.stop();
mPlayer = MediaPlayer.create(context, adat.get(pos).id);
mPlayer.start();
} else {
mPlayer = MediaPlayer.create(context, adat.get(pos).id);
mPlayer.start();
}
}
prevpos = pos;
}
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
Viewholder holder = null;
Log.d("pos", Integer.toString(position));
if (convertView == null) {
holder = new Viewholder();
LayoutInflater inflater = ((Activity) context).getLayoutInflater();
convertView = inflater.inflate(layoutResourceId, parent, false);
holder.image = (ImageView) convertView.findViewById(R.id.rowimage);
holder.text = (TextView) convertView.findViewById(R.id.rowtext);
convertView.setTag(holder);
} else {
holder = (Viewholder) convertView.getTag();
}
holder.image.setImageResource(R.drawable.ic_launcher);
holder.text.setText(adat.get(position).text);
return convertView;
}
}
| [
"gyerob@gmail.com"
] | gyerob@gmail.com |
6d622c5a260fb233e7d91821633745f4691f9a01 | d17e6c1dc30de745bd9f6f1cac0d7be63af4b939 | /app/src/main/java/com/fullsail/christopherfortune/studytopia/DataModels/FlashcardTest/FlashcardTest.java | 4fc065879a8d306e9383cd5177ccb4e3abc31446 | [] | no_license | Christopher-H-Fortune/Studytopia-Java | 29ffc7100f8e67d214a0a82dce5c366554121cb0 | 700fdb17f3af53055d94b64e6d44572e5f89e475 | refs/heads/master | 2023-01-07T09:36:20.068999 | 2020-11-10T01:25:32 | 2020-11-10T01:25:32 | 311,507,116 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,928 | java | package com.fullsail.christopherfortune.studytopia.DataModels.FlashcardTest;
import java.io.Serializable;
public class FlashcardTest implements Serializable {
private String flashcardTestName;
private int flashcardCount;
private boolean flashcardPublic;
private String flashcardCreationDate;
private String flashcardTestId;
private String flashcardTestCreatorId;
public FlashcardTest(){
}
public FlashcardTest(String flashcardTestName, int flashcardCount, boolean flashcardPublic, String flashcardCreationDate, String flashcardTestId, String flashcardTestCreatorId){
this.flashcardTestName = flashcardTestName;
this.flashcardCount = flashcardCount;
this.flashcardPublic = flashcardPublic;
this.flashcardCreationDate = flashcardCreationDate;
this.flashcardTestId = flashcardTestId;
this.flashcardTestCreatorId = flashcardTestCreatorId;
}
public String getFlashcardTestCreatorId() {
return flashcardTestCreatorId;
}
public String getFlashcardTestName() {
return flashcardTestName;
}
public void setFlashcardTestName(String flashcardTestName) {
this.flashcardTestName = flashcardTestName;
}
public int getFlashcardCount() {
return flashcardCount;
}
public void setFlashcardCount(int flashcardCount) {
this.flashcardCount = flashcardCount;
}
public boolean isFlashcardPublic() {
return flashcardPublic;
}
public void setFlashcardPublic(boolean flashcardPublic) {
this.flashcardPublic = flashcardPublic;
}
public String getFlashcardCreationDate() {
return flashcardCreationDate;
}
public void setFlashcardCreationDate(String flashcardCreationDate) {
this.flashcardCreationDate = flashcardCreationDate;
}
public String getFlashcardTestId() {
return flashcardTestId;
}
}
| [
"cfortune97@gmail.com"
] | cfortune97@gmail.com |
ee1022ccf406cf1628b3b18b175dad4484d200fb | 3b7185582a77a21f6bf437b0b1acbead6484f72f | /dao-api/src/main/java/com/itacademy/jd2/ikarotki/rwmanager/dao/api/entity/ITicket.java | 0f4e8a25249813db910fae858b5c831a0c5d0b19 | [] | no_license | JohnnieShort/project | 7d692fc9768179f56a575ed0d7816dc9011b7976 | c2491cb92d299363bec18e3443a8951fb1dc3f5d | refs/heads/master | 2020-04-12T19:49:32.186682 | 2018-12-17T14:46:54 | 2018-12-17T14:46:54 | 162,719,199 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 608 | java | package com.itacademy.jd2.ikarotki.rwmanager.dao.api.entity;
import com.itacademy.jd2.ikarotki.rwmanager.dao.api.entity.base.IBaseEntity;
public interface ITicket extends IBaseEntity {
public IStation getStationFrom();
public void setStationFrom(IStation from);
public IStation getStationTo();
public void setStationTo(IStation to);
public Double getPrice();
public void setPrice(Double price);
public IPassenger getPassenger();
public void setPassenger(IPassenger passenger);
public IPassengerRoute getPassengerRoute();
public void setPassengerRoute(IPassengerRoute passengerRoute);
}
| [
"johnnie.short@gmail.com"
] | johnnie.short@gmail.com |
c0e1a241a98987e9a6ec8197eded3f481168f40f | 6fa701cdaa0d83caa0d3cbffe39b40e54bf3d386 | /google/cloud/documentai/v1beta3/google-cloud-documentai-v1beta3-java/proto-google-cloud-documentai-v1beta3-java/src/main/java/com/google/cloud/documentai/v1beta3/FetchProcessorTypesResponseOrBuilder.java | e7f2e096ab1f45cc05cceeb49e8dfdaa7c64d8c8 | [
"Apache-2.0"
] | permissive | oltoco/googleapis-gen | bf40cfad61b4217aca07068bd4922a86e3bbd2d5 | 00ca50bdde80906d6f62314ef4f7630b8cdb6e15 | refs/heads/master | 2023-07-17T22:11:47.848185 | 2021-08-29T20:39:47 | 2021-08-29T20:39:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | true | 1,696 | java | // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/cloud/documentai/v1beta3/document_processor_service.proto
package com.google.cloud.documentai.v1beta3;
public interface FetchProcessorTypesResponseOrBuilder extends
// @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta3.FetchProcessorTypesResponse)
com.google.protobuf.MessageOrBuilder {
/**
* <pre>
* The list of processor types.
* </pre>
*
* <code>repeated .google.cloud.documentai.v1beta3.ProcessorType processor_types = 1;</code>
*/
java.util.List<com.google.cloud.documentai.v1beta3.ProcessorType>
getProcessorTypesList();
/**
* <pre>
* The list of processor types.
* </pre>
*
* <code>repeated .google.cloud.documentai.v1beta3.ProcessorType processor_types = 1;</code>
*/
com.google.cloud.documentai.v1beta3.ProcessorType getProcessorTypes(int index);
/**
* <pre>
* The list of processor types.
* </pre>
*
* <code>repeated .google.cloud.documentai.v1beta3.ProcessorType processor_types = 1;</code>
*/
int getProcessorTypesCount();
/**
* <pre>
* The list of processor types.
* </pre>
*
* <code>repeated .google.cloud.documentai.v1beta3.ProcessorType processor_types = 1;</code>
*/
java.util.List<? extends com.google.cloud.documentai.v1beta3.ProcessorTypeOrBuilder>
getProcessorTypesOrBuilderList();
/**
* <pre>
* The list of processor types.
* </pre>
*
* <code>repeated .google.cloud.documentai.v1beta3.ProcessorType processor_types = 1;</code>
*/
com.google.cloud.documentai.v1beta3.ProcessorTypeOrBuilder getProcessorTypesOrBuilder(
int index);
}
| [
"bazel-bot-development[bot]@users.noreply.github.com"
] | bazel-bot-development[bot]@users.noreply.github.com |
2867430504f6ffd0aad08e91676059824e93e52f | 5a69afd7f5e5306880dd24dbbed2e917adb065fe | /orientacao-objetos-5/orientacao-objetos-5/src/test/CirculoTeste.java | 80bf122dc0b65a67ab6d1737133a3a4a6b8991dc | [] | no_license | ShizueOnizuka/IFSP-logica-de-Programacao-II-LG2A2 | d0a8c80da681b86f12fab2751fe7532f00dbeb1c | f0f902eded7e62de38aeffa4b1590f54c94da96f | refs/heads/main | 2023-05-06T11:02:35.244233 | 2021-05-28T21:24:36 | 2021-05-28T21:24:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 916 | java | package test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import main.Circulo;
public class CirculoTeste {
private Circulo c1;
@Before
public void beforeEach(){
c1= new Circulo();
}
@After
public void afterEach() {
c1 = null;
}
@Test
public void criarObjetoCirculo() {
assertNotNull(c1);
}
@Test
public void presencaAtributoRaio() {
c1.setRaio(10.0);
assertNotNull(c1.getRaio());
}
@Test
public void metodoCalcularArea() {
c1.setRaio(10.0);
Double valorEsperado = 314.0;
Double valorObtido = c1.calcularArea();
assertEquals(valorEsperado, valorObtido);
}
@Test
public void metodoCalcularPerimetro() {
c1.setRaio(2.0);
Double valorEsperado = 12.56;
Double valorObtido = c1.calcularPerimetro();
assertEquals(valorEsperado, valorObtido);
}
}
| [
"edilene.shizue@aluno.ifsp.edu.br"
] | edilene.shizue@aluno.ifsp.edu.br |
754030ef2f2234220fac7558a22dd7eab81cae2c | e1afb0c0db28fccebec9d91f2bcc0b6cbf8a500a | /taotao-search/src/main/java/com/taotao/search/pojo/SearchResult.java | 0dd63cc7c67333207dceeba5b98a85a94c03642b | [] | no_license | skyli665/taotao | cf4ec5a7d1a62fada5553b277cb3207751a610b1 | 8249e1c8e7736e2cba94c8293bb534647986b0a3 | refs/heads/master | 2020-04-11T18:08:13.449511 | 2019-01-17T05:38:06 | 2019-01-17T05:38:06 | 161,987,234 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,369 | java | package com.taotao.search.pojo;
/**
* Filename:SearchResult.java
* Copyright:Copyright (c)2018
* Company:com.
* Author:liyuxin
* @version:1.0
* @since:JDK 1.8.0_21
* Create at:2019年1月3日 上午9:48:07
* Description:
*
* Modification History:
* Date Author Version Description
* -----------------------------------------------------------------
* 2019年1月3日 daniel 1.0 1.0 Version
*/
import java.util.List;
public class SearchResult {
//商品列表
private List<Item> itemList;
//总记录数
private long recordCount;
//总页数
private long pageCount;
//当前页
private long curPage;
public List<Item> getItemList() {
return itemList;
}
public void setItemList(List<Item> itemList) {
this.itemList = itemList;
}
public long getRecordCount() {
return recordCount;
}
public void setRecordCount(long recordCount) {
this.recordCount = recordCount;
}
public long getPageCount() {
return pageCount;
}
public void setPageCount(long pageCount) {
this.pageCount = pageCount;
}
public long getCurPage() {
return curPage;
}
public void setCurPage(long curPage) {
this.curPage = curPage;
}
}
| [
"1550957910@qq.com"
] | 1550957910@qq.com |
9898b82b1b671f1a279ffd97931d5094dd256c28 | 6993fb943081dbe5662e17a31b64252a364c87c2 | /Project1/app/src/test/java/com/example/patrick/project1/ExampleUnitTest.java | 486ef7bbbefdcdaf203f9149cfc437266fabec64 | [] | no_license | chrismillerMSU/AndroidStudioProjects | e0aa770f788e7e09016c5b8b546ceac27d0b2fea | d230b953362915f1542e0c744843dd5d880c868a | refs/heads/master | 2020-05-05T05:28:13.887927 | 2018-12-06T13:05:08 | 2018-12-06T13:05:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 406 | java | package com.example.patrick.project1;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"patrick212800@hotmail.com"
] | patrick212800@hotmail.com |
50478f1ddea5b41a449e3c099a44c95a06669eae | 2ee4945b18450e9430c5ea6794ea2a3e13358b51 | /app/src/main/java/com/example/aneeshkjalan/hellocodepath/MainActivity.java | feff74d17c6904a3012f70a2ef2f1590cf6542d1 | [] | no_license | AneeshJalan/HelloCodePath | 869a6d3bbcba03a94ba59ef724a6626be6db06c3 | bead816be9c5c1a9a214d8fd84ae59aaf69abc53 | refs/heads/master | 2020-03-28T18:45:06.931241 | 2018-09-15T15:51:03 | 2018-09-15T15:51:03 | 148,907,470 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,174 | java | package com.example.aneeshkjalan.hellocodepath;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
findViewById(R.id.button).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
((TextView) findViewById(R.id.textView)).setTextColor(
getResources().getColor(R.color.yellow));
}
});
findViewById(R.id.button2).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
findViewById(R.id.rootView).setBackgroundColor(
getResources().getColor(R.color.green));
}
});
findViewById(R.id.rootView).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
((TextView) findViewById(R.id.textView)).setTextColor(
getResources().getColor(R.color.holo_blue_bright));
findViewById(R.id.rootView).setBackgroundColor(
getResources().getColor(R.color.colorPrimaryDark));
((TextView) findViewById(R.id.textView)).setText("Hello from Aneesh!");
}
});
findViewById(R.id.button3).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String newText = ((EditText)findViewById(R.id.editText)).getText().toString();
if (TextUtils.isEmpty(newText)) {
newText = "Hello from Aneesh!";
}
((TextView) findViewById(R.id.textView)).setText(newText);
}
});
}
}
| [
"akjalan@ucsd.edu"
] | akjalan@ucsd.edu |
af9c8f7f840e295e47d589221d605965d1a83ec3 | 2bee7eadcbbcac9417cd62ee7be5cb092f501533 | /AI/src/AIpackage/DataBase.java | 59e1786f6c1e9c3e0260d9be79e4068ef4d87373 | [] | no_license | StefanWegscheider/GitExchange | 14d9f5d9c25492335c3801ab499cfe9efd00d26c | 8dc72b6809fb0129fb0386eaeef63ebf28ce92a9 | refs/heads/master | 2020-05-26T03:26:55.178936 | 2017-03-14T19:55:20 | 2017-03-14T19:55:20 | 84,988,962 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,438 | java | package AIpackage;
//STEP 1. Import required packages
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Statement;
import org.apache.logging.log4j.Logger;
import com.mysql.jdbc.DatabaseMetaData;
import org.apache.logging.log4j.LogManager;
public class DataBase {
public static Connection openDB() {
Connection conn = null;
try{
//STEP 2: Register JDBC driver
Class.forName("com.mysql.jdbc.Driver").newInstance();
//STEP 3: Open a connection
System.out.println("Connecting to MyAI database...");
conn = DriverManager.getConnection("jdbc:mysql://192.168.122.22:3306/Test?autoReconnect=true&useSSL=false", "Developer", "lena080402");
System.out.println("Connected database successfully...");
System.out.printf("Nach Datenbankanbinfung conn=", conn);
((Logger) Intermediate.getloggerObject()).info("Database connection established");
return conn;
}catch(SQLException se){
//Handle errors for JDBC
System.out.println("JDBC Error");
ErrorBox.OpenErrorBox("Database Error","Error Connecting to Database", se.toString());
((Logger) Intermediate.getloggerObject()).error("Database connection failed :"+se);
se.printStackTrace();
}catch(Exception e){
//Handle errors for Class.forName
System.out.println("Class.forName Error");
ErrorBox.OpenErrorBox("Database Error","Error Connecting to Database", e.toString());
((Logger) Intermediate.getloggerObject()).error("Database connection failed :"+e);
e.printStackTrace();
}
return conn;
}
public static int CheckIfWordExistsInDB(Connection conn, String Buffer) throws SQLException {
Integer ReturnValue = 0;
String query = "SELECT BaseWords FROM Test.BaseWord WHERE BaseWords = ? LIMIT 1";//query String erstellen, "?" als Platzhalter für Abfrage
PreparedStatement st = conn.prepareStatement(query);
st.setString(1, Buffer);
System.out.println("st = "+st);
ResultSet rs = st.executeQuery();
if (!rs.isBeforeFirst() ) { //isBeforeFirst returned False, wenn der Pointer nicht direkt vor der ersten Zeile steht UND: wenn das rs leer ist!
System.out.println("Wort ReturnValue= "+ReturnValue); }
else {ReturnValue=1;}
// rs.next();//Resultset auf erste Zeile setzen
// ReturnValue = rs.getInt(1);//Returnwert aus erster Spalte als Integer auslesen
System.out.println(Buffer +"Returnwert ob in DB vorhanden : "+ReturnValue+" ");
return ReturnValue;
}
public static int CheckIfColumnsExistsInDB(Connection conn, String pos) throws SQLException{
Integer ReturnValue = 0;
DatabaseMetaData metadata = (DatabaseMetaData) conn.getMetaData();
ResultSet resultSet;
resultSet = metadata.getColumns(null, null, "BaseWord", pos);
if(resultSet.next()){ReturnValue= 1;}
// Column exists
else {ReturnValue=0;}
System.out.println(pos+"Returnwert ob col in DB vorhanden : "+ReturnValue+" ");
return ReturnValue;
}
public static void InsertColumnInDB(Connection conn, String Buffer) throws SQLException {
String query = "ALTER TABLE Test.BaseWord ADD "+Buffer+" int(11) DEFAULT 0";//query String erstellen, "?" als Platzhalter für Abfrage
PreparedStatement st = conn.prepareStatement(query);
// st.setString(1, Buffer);
System.out.println("query für insert column = "+st);
st.executeUpdate();
}
public static void InsertWordInDB(Connection conn, String word, String column) throws SQLException {
String query = "INSERT INTO Test.BaseWord(BaseWords,"+column+") VALUES('"+word+"', '1')";//query String erstellen, "?" als Platzhalter für Abfrage
PreparedStatement st = conn.prepareStatement(query);
// st.setString(1, Buffer);
System.out.println("query für insert word = "+st);
st.executeUpdate();
}
public static void WordUpdateInDB(Connection conn, String word, String col) throws SQLException{
String query = "UPDATE Test.BaseWord SET "+col+"="+col+"+1 WHERE BaseWords='"+word+"' LIMIT 1"; //query String erstellen, "?" als Platzhalter für Abfrage
PreparedStatement st = conn.prepareStatement(query);
// st.setString(1, Buffer);
System.out.println("query für update word = "+st);
st.executeUpdate();
}
} | [
"stefan.wegscheider@lebensfeld.at"
] | stefan.wegscheider@lebensfeld.at |
585e2cd166a0676992d21eaf98896eb4d69f66f5 | d1f18a98261ef1d870afb5b705387a34fa1ae8d4 | /offer-algorithm/src/main/java/leetcode/problems/Test0973_最接近原点的K个点.java | 5ff098dda1093e2ac489ea86ceaae0aa6643dd7a | [] | no_license | luguanxing/Offer-Algorithm | 6472cca1bcd4b51a9b603226a787f18acfe521a9 | 7ec579a5359295b4f1b23f0afd551f434184a61e | refs/heads/master | 2023-09-01T05:36:46.417275 | 2023-09-01T02:18:56 | 2023-09-01T02:18:56 | 244,928,773 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,485 | java | package leetcode.problems;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
public class Test0973_最接近原点的K个点 {
public static void main(String[] args) {
for (int[] nums : new Solution().kClosest(
new int[][]{{1, 3}, {-2, 2}}, 1
)) {
System.out.println(Arrays.toString(nums));
}
System.out.println();
for (int[] nums : new Solution().kClosest(
new int[][]{{3, 3}, {5, -1}, {-2, 4}}, 2
)) {
System.out.println(Arrays.toString(nums));
}
}
static class Solution {
public int[][] kClosest(int[][] points, int K) {
List<Point> pointList = Arrays
.stream(points)
.map(Point::new)
.collect(Collectors.toList());
pointList.sort(Comparator.comparingDouble(o -> o.distance));
int[][] res = new int[K][2];
for (int i = 0; i < K; i++) {
res[i][0] = pointList.get(i).point[0];
res[i][1] = pointList.get(i).point[1];
}
return res;
}
static class Point {
int[] point;
double distance;
public Point(int[] point) {
this.point = point;
this.distance = Math.sqrt(point[0] * point[0] + point[1] * point[1]);
}
}
}
}
| [
"651571925@qq.com"
] | 651571925@qq.com |
675f07280fdff2b986453b4a119d93a68128694d | aad69e95bf51e4e0d6533f3aaa814ed14d02e672 | /lib/plantuml-7746/src/net/sourceforge/plantuml/ugraphic/g2d/DriverEllipseG2d.java | 003776ded2fc5026b1d020aaad1a1926ffe63322 | [] | no_license | amercier/seeduml | 2eb54e2b0aa3144c97c2e1b3ca28c63105cd1d01 | 6712dd306c391a739d3d29b66e5c1cdc4ed17d03 | refs/heads/master | 2016-08-04T17:11:50.336908 | 2012-05-16T16:06:19 | 2012-05-16T16:06:19 | 4,147,293 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,154 | java | /* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2012, Arnaud Roques
*
* Project Info: http://plantuml.sourceforge.net
*
* This file is part of PlantUML.
*
* PlantUML 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 3 of the License, or
* (at your option) any later version.
*
* PlantUML 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 library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
* USA.
*
* [Java is a trademark or registered trademark of Sun Microsystems, Inc.
* in the United States and other countries.]
*
* Original Author: Arnaud Roques
*
* Revision $Revision: 7715 $
*
*/
package net.sourceforge.plantuml.ugraphic.g2d;
import java.awt.BasicStroke;
import java.awt.Graphics2D;
import java.awt.Shape;
import java.awt.geom.Arc2D;
import java.awt.geom.Ellipse2D;
import net.sourceforge.plantuml.ugraphic.ColorMapper;
import net.sourceforge.plantuml.ugraphic.UDriver;
import net.sourceforge.plantuml.ugraphic.UEllipse;
import net.sourceforge.plantuml.ugraphic.UParam;
import net.sourceforge.plantuml.ugraphic.UShape;
public class DriverEllipseG2d extends DriverShadowedG2d implements UDriver<Graphics2D> {
private final double dpiFactor;
public DriverEllipseG2d(double dpiFactor) {
this.dpiFactor = dpiFactor;
}
public void draw(UShape ushape, double x, double y, ColorMapper mapper, UParam param, Graphics2D g2d) {
final UEllipse shape = (UEllipse) ushape;
g2d.setStroke(new BasicStroke((float) param.getStroke().getThickness()));
if (shape.getStart() == 0 && shape.getExtend() == 0) {
final Shape ellipse = new Ellipse2D.Double(x, y, shape.getWidth(), shape.getHeight());
// Shadow
if (shape.getDeltaShadow() != 0) {
drawShadow(g2d, ellipse, shape.getDeltaShadow(), dpiFactor);
}
if (param.getBackcolor() != null) {
g2d.setColor(mapper.getMappedColor(param.getBackcolor()));
g2d.fill(ellipse);
}
if (param.getColor() != null && param.getColor().equals(param.getBackcolor()) == false) {
g2d.setColor(mapper.getMappedColor(param.getColor()));
g2d.draw(ellipse);
}
} else {
final Shape arc = new Arc2D.Double(x, y, shape.getWidth(), shape.getHeight(), shape.getStart(), shape
.getExtend(), Arc2D.OPEN);
if (param.getColor() != null) {
g2d.setColor(mapper.getMappedColor(param.getBackcolor()));
g2d.fill(arc);
}
if (param.getColor() != null && param.getColor().equals(param.getBackcolor()) == false) {
g2d.setColor(mapper.getMappedColor(param.getColor()));
g2d.draw(arc);
}
}
}
}
| [
"alexandre.mercier12@gmail.com"
] | alexandre.mercier12@gmail.com |
9969a00636d11af347efb1b39b3c43dc52d3bd37 | 492f29db69ca599aaf2d606166864892622be124 | /src/day49_static/MyBankAccount.java | 73053bc404c42dc65a3e9cc04ea315ebe320fd81 | [] | no_license | asglazunova/day46 | a8475b785746d670651393599d25296532c17a52 | d7c4e2d5c333dc7adcf9de3d7cea321c6a7f8383 | refs/heads/master | 2023-06-16T22:19:41.688382 | 2021-07-11T20:55:16 | 2021-07-11T20:55:16 | 371,528,223 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 341 | java | package day49_static;
public class MyBankAccount {
static double balance = 500.0;
String user;
public void spend (double amount){
System.out.println(user + " is spending $ "+ amount);
balance -= amount;
}
public void showBalance(){
System.out.println("current balance = " + balance );
}
}
| [
"asglazunova@gmail.com"
] | asglazunova@gmail.com |
2362538814974cf7ba47d38a8d111c9eb7df73e0 | d06199dad598a5c2133efd81d8d3e480afb17168 | /app/src/main/java/com/example/android/becarev1/serviceFragment.java | 02fffa3b3cce6c3d4b53be30ec086933232bd6ef | [] | no_license | mahmoud-eltobgy88/BeCareV1 | ee6e4a737964a6edbd5452112723e33460ecbeb0 | 364829028f13a8525edffd46c20f6439d6c582e8 | refs/heads/main | 2023-05-30T21:53:27.376342 | 2021-06-25T15:23:15 | 2021-06-25T15:23:15 | 380,277,087 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,047 | java | package com.example.android.becarev1;
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.
* Use the {@link serviceFragment#newInstance} factory method to
* create an instance of this fragment.
*/
public class serviceFragment 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;
public serviceFragment() {
// 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 service.
*/
// TODO: Rename and change types and number of parameters
public static serviceFragment newInstance(String param1, String param2) {
serviceFragment fragment = new serviceFragment();
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_service, container, false);
}
} | [
"El_Tobgy@outlook.com"
] | El_Tobgy@outlook.com |
ad5e744b6a51ae0a9883582589999b67c3d1911f | 76c4bcdf127c0109e899ccaba8ce80bd4bbe0fe7 | /src/com/situ/mall/common/ServerResponse.java | 387a0ed61928c312466dc1c4c196b83e5ed7ef33 | [] | no_license | GaoChengQuan/Java1711Mall | 77ef0f4e18992e45eafb3368b1e353f108e65ce9 | 59c10b5b8370e6a563d419e7b7d9dc86cf79e187 | refs/heads/master | 2021-05-04T15:55:23.497085 | 2018-02-27T08:47:35 | 2018-02-27T08:47:35 | 120,240,746 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,689 | java | package com.situ.mall.common;
import java.io.Serializable;
public class ServerResponse<T> implements Serializable {
//当前状态(程序员判断状态):成功、失败、未登录、没有权限
private Integer code;
//描述信息(主要是给用户看的提示信息)
private String msg;
//总数量
private Integer count;
//后台返回给前端的数据
private T data;
private ServerResponse() {
}
private ServerResponse(Integer code) {
this.code = code;
}
private ServerResponse(Integer code, String msg) {
this.code = code;
this.msg = msg;
}
private ServerResponse(Integer code, String msg, T data) {
this.code = code;
this.msg = msg;
this.data = data;
}
private ServerResponse(Integer code, String msg, Integer count, T data) {
this.code = code;
this.msg = msg;
this.count = count;
this.data = data;
}
//只是告诉前台:成功这种状态
public static <T> ServerResponse<T> createSuccess() {
return new ServerResponse<>(ResponseCode.SUCCESS.getCode());
}
//告诉前台:code,msg
public static <T> ServerResponse<T> createSuccess(String msg) {
return new ServerResponse<>(ResponseCode.SUCCESS.getCode(), msg);
}
//告诉前台:code,msg,data
public static <T> ServerResponse<T> createSuccess(String msg, T data) {
return new ServerResponse<>(ResponseCode.SUCCESS.getCode(), msg, data);
}
//告诉前台:code,msg,count,data
public static <T> ServerResponse<T> createSuccess(String msg, Integer count, T data) {
return new ServerResponse<>(ResponseCode.SUCCESS.getCode(), msg, count, data);
}
//只是告诉前台:失败这种状态
public static <T> ServerResponse<T> createError() {
return new ServerResponse<>(ResponseCode.ERROR.getCode());
}
//告诉前台:code,msg
public static <T> ServerResponse<T> createError(String msg) {
return new ServerResponse<>(ResponseCode.ERROR.getCode(), msg);
}
//告诉前台:code,msg,data
public static <T> ServerResponse<T> createError(String msg, T data) {
return new ServerResponse<>(ResponseCode.ERROR.getCode(), msg, data);
}
public boolean isSuccess() {
return code == ResponseCode.SUCCESS.getCode();
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public T getData() {
return data;
}
public void setData(T data) {
this.data = data;
}
public Integer getCount() {
return count;
}
public void setCount(Integer count) {
this.count = count;
}
public static void main(String[] args) {
System.out.println(ResponseCode.ERROR.getCode());
}
}
| [
"529390053@qq.com"
] | 529390053@qq.com |
378319df70bb56012d38c1af680d89e3dd9a09b9 | d32c92800657870e2e4c08b0130e27fb5e8d06e9 | /PC-Recipes/src/pcrecipes/servlet/SearchServlet.java | 4aa2f1e3432c478d41cd2dd650ff50eb35652869 | [] | no_license | taliaco/PC-temp | 88c23cfcd2dfb3597dd98c7774764c2f4dd40cec | b6cf576e7e08aeefec68b741296f1e4e0d1f90e0 | refs/heads/master | 2016-09-10T18:53:53.256347 | 2013-12-11T08:56:37 | 2013-12-11T08:56:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,196 | java | package pcrecipes.servlet;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import pcrecipes.server.recipe;
import pcrecipes.server.recipes;
public class SearchServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public SearchServlet() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/html; charset=utf-8");
PrintWriter writer= response.getWriter();
Object Item = request.getParameter("SearchItem");
if(Item.toString() !=null)
{
recipes newRecipes = new recipes ();
recipe resultRecipe = newRecipes.searchByName(Item.toString());
if(resultRecipe==null)
{
writer.write("<p>לא נמצא המתכון המבוקש</p>");
writer.write("<p><a href="+"Main"+">לעמוד הראשי - PC-Recipes</a></p>");
}
else
{
writer.write("<p>Id: " + resultRecipe.get_id() + "</p>");
writer.write("<p>שם המתכון: " + resultRecipe.get_name() + "</p>");
writer.write("<p>קטגוריה: " + resultRecipe.get_category() + "</p>");
if(resultRecipe.get_product()!=null){
writer.write("<p>מצרכים: " + resultRecipe.get_product().getNameProd() + "</p>");
writer.write("<p>מצרכים חלופיים: " + resultRecipe.get_product().getSwapProd() + "</p>");
}
else{
writer.write("<p>Products: </p>");
writer.write("<p>Swap product: </p>");
}
writer.write("<p><a href="+"Main"+">לעמוד הראשי - PC-Recipes</a></p>");
}
}
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
}
}
| [
"talicohen88@gmail.com"
] | talicohen88@gmail.com |
ed84b760a42ff77727c4b896ede790c38a85bdda | 37843ff2aecbaa1da645af029751b54788ca95e4 | /src/main/java/org/zeroturnaround/exec/ProcessInitException.java | f67f1d0eebdab25699dfc820019b1b62c250ce7b | [
"Apache-2.0"
] | permissive | rmolabanti/zt-exec | aab315cd171db2f1dd8e898e86c0b75d06412a42 | 49e694fbcb23b864f901f8fc06a7fc37f23c22fc | refs/heads/master | 2021-01-22T21:32:22.185775 | 2016-09-06T11:49:22 | 2016-09-06T11:49:22 | 67,501,970 | 1 | 0 | null | 2016-09-06T11:30:15 | 2016-09-06T11:30:15 | null | UTF-8 | Java | false | false | 2,766 | java | /*
* Copyright (C) 2014 ZeroTurnaround <support@zeroturnaround.com>
* Contains fragments of code from Apache Commons Exec, rights owned
* by Apache Software Foundation (ASF).
*
* 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.zeroturnaround.exec;
import java.io.IOException;
/**
* Creating a process failed providing an error code.
*
* <p>
* Wraps an {@link IOException} like:
* <ul>
* <li><code>java.io.IOException: Cannot run program "ls": java.io.IOException: error=12, Cannot allocate memory</code></li>
* <li><code>java.io.IOException: Cannot run program "ls": error=316, Unknown error: 316</code></li>
* </ul>
* </p>
*/
public class ProcessInitException extends IOException {
private static final String BEFORE_CODE = ": error=";
private static final String AFTER_CODE = ", ";
private static final String NEW_INFIX = " Error=";
private final int errorCode;
public ProcessInitException(String message, Throwable cause, int errorCode) {
super(message, cause);
this.errorCode = errorCode;
}
/**
* @return error code raised when a process failed to start.
*/
public int getErrorCode() {
return errorCode;
}
/**
* Try to wrap a given {@link IOException} into a {@link ProcessInitException}.
*
* @param prefix prefix to be added in the message.
* @param e existing exception possibly containing an error code in its message.
* @return new exception containing the prefix, error code and its description in the message plus the error code value as a field,
* <code>null</code> if we were unable to find an error code from the original message.
*/
public static ProcessInitException newInstance(String prefix, IOException e) {
String m = e.getMessage();
if (m == null) {
return null;
}
int i = m.lastIndexOf(BEFORE_CODE);
if (i == -1) {
return null;
}
int j = m.indexOf(AFTER_CODE, i);
if (i == -1) {
return null;
}
int code;
try {
code = Integer.parseInt(m.substring(i + BEFORE_CODE.length(), j));
}
catch (NumberFormatException n) {
return null;
}
return new ProcessInitException(prefix + NEW_INFIX + m.substring(i + BEFORE_CODE.length()), e, code);
}
}
| [
"rein@zeroturnaround.com"
] | rein@zeroturnaround.com |
6807fa9e68cd08b2cc03484effbedd48931b18c0 | 920c0e791825f833da404142d35270d4bab9fdb1 | /538.把二叉搜索树转换为累加树.java | 3416f160f008151f4d15a46fcba684d7f0b6060a | [] | no_license | scb-aja/leetcode | ba7409a477c92c37e3c9e9b93f657712bddbe7d2 | daca6607ba117fcc04b27636dcd1479f289e0814 | refs/heads/master | 2023-03-23T09:30:09.606170 | 2021-03-23T14:26:41 | 2021-03-23T14:26:41 | 350,739,790 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,446 | java | /*
* @lc app=leetcode.cn id=538 lang=java
*
* [538] 把二叉搜索树转换为累加树
*
* https://leetcode-cn.com/problems/convert-bst-to-greater-tree/description/
*
* algorithms
* Medium (65.93%)
* Likes: 485
* Dislikes: 0
* Total Accepted: 77.1K
* Total Submissions: 116.9K
* Testcase Example: '[4,1,6,0,2,5,7,null,null,null,3,null,null,null,8]'
*
* 给出二叉 搜索 树的根节点,该树的节点值各不相同,请你将其转换为累加树(Greater Sum Tree),使每个节点 node
* 的新值等于原树中大于或等于 node.val 的值之和。
*
* 提醒一下,二叉搜索树满足下列约束条件:
*
*
* 节点的左子树仅包含键 小于 节点键的节点。
* 节点的右子树仅包含键 大于 节点键的节点。
* 左右子树也必须是二叉搜索树。
*
*
* 注意:本题和 1038:
* https://leetcode-cn.com/problems/binary-search-tree-to-greater-sum-tree/
* 相同
*
*
*
* 示例 1:
*
*
*
* 输入:[4,1,6,0,2,5,7,null,null,null,3,null,null,null,8]
* 输出:[30,36,21,36,35,26,15,null,null,null,33,null,null,null,8]
*
*
* 示例 2:
*
* 输入:root = [0,null,1]
* 输出:[1,null,1]
*
*
* 示例 3:
*
* 输入:root = [1,0,2]
* 输出:[3,3,2]
*
*
* 示例 4:
*
* 输入:root = [3,2,4,1]
* 输出:[7,9,4,10]
*
*
*
*
* 提示:
*
*
* 树中的节点数介于 0 和 10^4^ 之间。
* 每个节点的值介于 -10^4 和 10^4 之间。
* 树中的所有值 互不相同 。
* 给定的树为二叉搜索树。
*
*
*/
// @lc code=start
/**
* Definition for a binary tree node.
* public class TreeNode {
* int val;
* TreeNode left;
* TreeNode right;
* TreeNode() {}
* TreeNode(int val) { this.val = val; }
* TreeNode(int val, TreeNode left, TreeNode right) {
* this.val = val;
* this.left = left;
* this.right = right;
* }
* }
*/
import java.util.List;
import java.util.ArrayList;
class Solution {
public List<TreeNode> list = new ArrayList<>();
public TreeNode convertBST(TreeNode root) {
order(root);
int sum = 0;
for (int index = 0; index < list.size(); index++) {
TreeNode node = list.get(index);
node.val += sum;
sum = node.val;
}
return root;
}
public void order(TreeNode root) {
if (root == null) {
return;
}
order(root.right);
list.add(root);
order(root.left);
}
}
// @lc code=end
| [
"110810519@qq.com"
] | 110810519@qq.com |
05efab67d2417a328699065f8b55d9ae2ef32567 | a926bfb34e5e6aa1b3afdffce8ab5a7319ce9668 | /src/Others/Transition.java | 3db91a9a92162766f7d379f1bdf20a240130d048 | [] | no_license | Md-Mehedi/8-Ball-Pool | 767e6c6f4f7962cfc7994e09d758e57220cabc18 | 8c70223622b6fc3e63800cf44ba460132f062410 | refs/heads/master | 2022-02-23T09:37:32.018677 | 2019-02-08T20:48:52 | 2019-02-08T20:48:52 | 163,624,039 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 660 | 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 Others;
import javafx.animation.ScaleTransition;
import javafx.scene.layout.Pane;
import javafx.util.Duration;
/**
*
* @author user
*/
public class Transition {
public static void scaleTransition(Pane pane){
ScaleTransition scale = new ScaleTransition(Duration.seconds(1), pane);
scale.setFromX(.01);
scale.setFromY(.01);
scale.setToX(.9);
scale.setToY(.9);
scale.play();
}
}
| [
"1705084@ugrad.cse.buet.ac.bd"
] | 1705084@ugrad.cse.buet.ac.bd |
c434263aa64eff339f22d06dc8d9608225eec9e7 | e2d53661351f162cf0f68f02f662c83dfe6d2844 | /house/src/main/java/com/house/service/impl/ReservationRecordServiceImpl.java | a364a81d2cda0ddc1daebcd05bad37c437d0aba3 | [] | no_license | liu1364599225/myProject.github.io | 68dc314ea0fa6cb0ff8fb3a0a000119e0bc5488a | 7a42103fbd901837d1c16fe9797e69ccb084005e | refs/heads/master | 2022-12-23T18:52:41.956235 | 2020-01-23T17:30:13 | 2020-01-23T17:30:13 | 235,835,283 | 1 | 0 | null | 2022-12-16T06:34:10 | 2020-01-23T16:23:26 | JavaScript | UTF-8 | Java | false | false | 2,576 | java | package com.house.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import com.house.dao.ReservationRecordMapper;
import com.house.entity.ReservationRecord;
import com.house.service.ReservationRecordService;
public class ReservationRecordServiceImpl implements ReservationRecordService{
@Autowired
private ReservationRecordMapper reservationRecordMapper;
@Override
public int deleteByPrimaryKey(Integer reservationrecordId) {
// TODO Auto-generated method stub
return reservationRecordMapper.deleteByPrimaryKey(reservationrecordId);
}
@Override
public int insert(ReservationRecord record) {
// TODO Auto-generated method stub
return reservationRecordMapper.insert(record);
}
@Override
public int insertSelective(ReservationRecord record) {
// TODO Auto-generated method stub
return reservationRecordMapper.insertSelective(record);
}
@Override
public ReservationRecord selectByPrimaryKey(Integer reservationrecordId) {
// TODO Auto-generated method stub
return reservationRecordMapper.selectByPrimaryKey(reservationrecordId);
}
@Override
public int updateByPrimaryKeySelective(ReservationRecord record) {
// TODO Auto-generated method stub
return reservationRecordMapper.updateByPrimaryKeySelective(record);
}
@Override
public int updateByPrimaryKey(ReservationRecord record) {
// TODO Auto-generated method stub
return reservationRecordMapper.updateByPrimaryKey(record);
}
@Override
public ReservationRecord selectByOrderState(Integer userId,
Integer housingId) {
// TODO Auto-generated method stub
return reservationRecordMapper.selectByOrderState(userId, housingId);
}
@Override
public ReservationRecord selectByUserIdAndHousingId(Integer userId,
Integer housingId) {
// TODO Auto-generated method stub
return reservationRecordMapper.selectByUserIdAndHousingId(userId, housingId);
}
@Override
public List<ReservationRecord> selectByUserId(Integer userId) {
// TODO Auto-generated method stub
return reservationRecordMapper.selectByUserId(userId);
}
@Override
public List<ReservationRecord> listByAll() {
// TODO Auto-generated method stub
return reservationRecordMapper.listByAll();
}
@Override
public List<ReservationRecord> selectByLookTime() {
// TODO Auto-generated method stub
return reservationRecordMapper.selectByLookTime();
}
@Override
public List<ReservationRecord> selectByHkId(Integer housekeeperId) {
// TODO Auto-generated method stub
return reservationRecordMapper.selectByHkId(housekeeperId);
}
}
| [
"38426298+liu1364599225@users.noreply.github.com"
] | 38426298+liu1364599225@users.noreply.github.com |
7c22f04fd230618c65ecb2d65e94ac8c216bada4 | e78904d8699b3fddb00f48c4a53208ad538c7f62 | /src/main/java/hellfirepvp/astralsorcery/common/auxiliary/link/LinkHandler.java | 66b7aa1e6d1770d1f3008c243f57eb00662ade99 | [] | no_license | jblosser/AstralSorcery | c621469144bb8e74c45b157bed7d37e83975999c | bc299b56a6dce9a8dbfa29b54d785495ef06622d | refs/heads/master | 2023-01-23T07:59:54.683583 | 2020-12-06T09:23:41 | 2020-12-06T09:23:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,437 | java | /*******************************************************************************
* HellFirePvP / Astral Sorcery 2020
*
* All rights reserved.
* The source code is available on github: https://github.com/HellFirePvP/AstralSorcery
* For further details, see the License file there.
******************************************************************************/
package hellfirepvp.astralsorcery.common.auxiliary.link;
import hellfirepvp.astralsorcery.common.util.MiscUtils;
import hellfirepvp.observerlib.common.util.tick.ITickHandler;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.server.MinecraftServer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.util.text.TranslationTextComponent;
import net.minecraft.world.World;
import net.minecraftforge.event.TickEvent;
import net.minecraftforge.fml.LogicalSide;
import net.minecraftforge.fml.LogicalSidedProvider;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.*;
/**
* This class is part of the Astral Sorcery Mod
* The complete source code for this mod can be found on github.
* Class: LinkHandler
* Created by HellFirePvP
* Date: 30.06.2019 / 20:57
*/
public class LinkHandler implements ITickHandler {
private static final LinkHandler instance = new LinkHandler();
private static final Map<UUID, LinkSession> players = new HashMap<>();
private LinkHandler() {}
public static LinkHandler getInstance() {
return instance;
}
@Nullable
public static LinkSession getActiveSession(PlayerEntity player) {
return players.get(player.getUniqueID());
}
@Nonnull
public static RightClickResult onInteractEntity(PlayerEntity clicked, LivingEntity entity) {
LinkSession session = LinkSession.entity(entity);
players.put(clicked.getUniqueID(), session);
return new RightClickResult(RightClickResultType.SELECT_START, session);
}
@Nonnull
public static RightClickResult onInteractBlock(PlayerEntity clicked, World world, BlockPos pos, boolean sneak) {
UUID playerUUID = clicked.getUniqueID();
if (!players.containsKey(playerUUID)) {
LinkableTileEntity tile = MiscUtils.getTileAt(world, pos, LinkableTileEntity.class, true);
if (tile == null) {
return new RightClickResult(RightClickResultType.NONE, null);
}
LinkSession session = LinkSession.tile(tile);
players.put(playerUUID, session);
return new RightClickResult(RightClickResultType.SELECT_START, session);
} else {
LinkSession session = players.get(playerUUID);
if (session.getType() == LinkType.ENTITY) {
LinkableTileEntity tile = MiscUtils.getTileAt(world, pos, LinkableTileEntity.class, true);
if (tile == null) {
players.remove(playerUUID);
return new RightClickResult(RightClickResultType.NONE, null);
} else {
session.setSelected(tile);
return new RightClickResult(RightClickResultType.TRY_LINK, session);
}
} else if (sneak) {
return new RightClickResult(RightClickResultType.TRY_UNLINK, session);
} else {
return new RightClickResult(RightClickResultType.TRY_LINK, session);
}
}
}
public static void processInteraction(RightClickResult result, PlayerEntity playerIn, World world, BlockPos pos) {
LinkSession session = result.getLinkingSession();
LinkableTileEntity tile = session.getSelectedTile();
String linkedToName;
switch (result.getType()) {
case SELECT_START:
if (session.getType() == LinkType.ENTITY) {
playerIn.sendMessage(new TranslationTextComponent("astralsorcery.misc.link.start",
result.getLinkingSession().getSelectedEntity().getDisplayName()).applyTextStyle(TextFormatting.GREEN));
} else {
String name = tile.getUnLocalizedDisplayName();
if (tile.onSelect(playerIn)) {
if (name != null) {
playerIn.sendMessage(new TranslationTextComponent("astralsorcery.misc.link.start",
new TranslationTextComponent(name)).applyTextStyle(TextFormatting.GREEN));
}
}
}
break;
case TRY_LINK:
TileEntity te = MiscUtils.getTileAt(world, pos, TileEntity.class, true);
linkedToName = "astralsorcery.misc.link.link.block";
if (te instanceof LinkableTileEntity) {
if (!((LinkableTileEntity) te).doesAcceptLinks()) {
return;
}
String unloc = ((LinkableTileEntity) te).getUnLocalizedDisplayName();
if (unloc != null) {
linkedToName = unloc;
}
}
if (session.getType() == LinkType.ENTITY && te instanceof LinkableTileEntity) {
LinkableTileEntity linkTarget = (LinkableTileEntity) te;
LivingEntity linked = session.getSelectedEntity();
if (linkTarget.tryLinkEntity(playerIn, linked)) {
linkTarget.onEntityLinkCreate(playerIn, linked);
}
} else {
if (tile.tryLinkBlock(playerIn, pos)) {
tile.onBlockLinkCreate(playerIn, pos);
String linkedFrom = tile.getUnLocalizedDisplayName();
if (linkedFrom != null) {
playerIn.sendMessage(new TranslationTextComponent("astralsorcery.misc.link.link",
new TranslationTextComponent(linkedFrom),
new TranslationTextComponent(linkedToName))
.applyTextStyle(TextFormatting.GREEN));
}
}
}
break;
case TRY_UNLINK:
if (tile.tryUnlink(playerIn, pos)) {
linkedToName = "astralsorcery.misc.link.link.block";
te = MiscUtils.getTileAt(world, pos, TileEntity.class, true);
if (te instanceof LinkableTileEntity) {
String unloc = ((LinkableTileEntity) te).getUnLocalizedDisplayName();
if (unloc != null) {
linkedToName = unloc;
}
}
String linkedFrom = tile.getUnLocalizedDisplayName();
if (linkedFrom != null) {
playerIn.sendMessage(new TranslationTextComponent("astralsorcery.misc.link.unlink",
new TranslationTextComponent(linkedFrom),
new TranslationTextComponent(linkedToName))
.applyTextStyle(TextFormatting.GREEN));
}
}
break;
case NONE:
break;
default:
break;
}
}
@Override
public void tick(TickEvent.Type type, Object... context) {
MinecraftServer server = LogicalSidedProvider.INSTANCE.get(LogicalSide.SERVER);
if (server == null) {
return;
}
Iterator<UUID> iterator = players.keySet().iterator();
while (iterator.hasNext()) {
UUID uuid = iterator.next();
LinkSession session = players.get(uuid);
PlayerEntity player = server.getPlayerList().getPlayerByUUID(uuid);
if (player == null) {
iterator.remove();
continue;
}
boolean needsRemoval = MiscUtils.getMainOrOffHand(player, stack -> stack.getItem() instanceof IItemLinkingTool) == null;
switch (session.getType()) {
case ENTITY:
LivingEntity entity = session.getSelectedEntity();
if (!entity.isAlive() || entity.getEntityWorld().getDimension().getType().getId() != player.dimension.getId()) {
needsRemoval = true;
}
break;
case BLOCK:
int dimId = session.getSelectedTile().getLinkWorld().getDimension().getType().getId();
if (dimId != player.dimension.getId()) {
needsRemoval = true;
}
break;
}
if (needsRemoval) {
iterator.remove();
player.sendMessage(new TranslationTextComponent("astralsorcery.misc.link.stop")
.applyTextStyle(TextFormatting.RED));
}
}
}
@Override
public EnumSet<TickEvent.Type> getHandledTypes() {
return EnumSet.of(TickEvent.Type.SERVER);
}
@Override
public boolean canFire(TickEvent.Phase phase) {
return phase == TickEvent.Phase.END;
}
@Override
public String getName() {
return "LinkHandler";
}
public static class LinkSession {
private final LinkType type;
private LinkableTileEntity selected;
private final LivingEntity entity;
private LinkSession(LinkType type, LinkableTileEntity selected, LivingEntity entity) {
this.type = type;
this.selected = selected;
this.entity = entity;
}
public static LinkSession tile(LinkableTileEntity selected) {
return new LinkSession(LinkType.BLOCK, selected, null);
}
public static LinkSession entity(LivingEntity entity) {
return new LinkSession(LinkType.ENTITY, null, entity);
}
public LinkType getType() {
return type;
}
@Nullable
public LinkableTileEntity getSelectedTile() {
return selected;
}
public void setSelected(LinkableTileEntity selected) {
this.selected = selected;
}
@Nullable
public LivingEntity getSelectedEntity() {
return entity;
}
}
public static class RightClickResult {
private final RightClickResultType type;
private final LinkSession linkingSession;
RightClickResult(RightClickResultType type, LinkSession linkingSession) {
this.type = type;
this.linkingSession = linkingSession;
}
public RightClickResultType getType() {
return type;
}
public LinkSession getLinkingSession() {
return linkingSession;
}
public boolean shouldProcess() {
return this.getType() != RightClickResultType.NONE;
}
}
public static enum LinkType {
ENTITY,
BLOCK
}
public static enum RightClickResultType {
SELECT_START,
TRY_LINK,
TRY_UNLINK,
NONE
}
} | [
"7419378+HellFirePvP@users.noreply.github.com"
] | 7419378+HellFirePvP@users.noreply.github.com |
ac88792c7ecc7fc18c0544c6c9578f46de9dc8b7 | 09b7f281818832efb89617d6f6cab89478d49930 | /root/projects/repository/source/java/org/alfresco/repo/avm/FileNodeImpl.java | 1051cca39d5a5bbadfd264c9048ae90eb371d8a1 | [] | no_license | verve111/alfresco3.4.d | 54611ab8371a6e644fcafc72dc37cdc3d5d8eeea | 20d581984c2d22d5fae92e1c1674552c1427119b | refs/heads/master | 2023-02-07T14:00:19.637248 | 2020-12-25T10:19:17 | 2020-12-25T10:19:17 | 323,932,520 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,176 | java | /*
* Copyright (C) 2005-2010 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>. */
package org.alfresco.repo.avm;
/**
* Base class for file objects.
* @author britt
*/
abstract class FileNodeImpl extends AVMNodeImpl implements FileNode
{
/**
* Default constructor.
*/
protected FileNodeImpl()
{
}
/**
* Pass through constructor.
* @param store The AVMStore we belong to.
*/
public FileNodeImpl(AVMStore store)
{
super(store);
}
}
| [
"verve111@mail.ru"
] | verve111@mail.ru |
13bb57c2a2f124eb672a9f7116a853e10ea6343a | cf0fc558ddd616f81abf7127a9c043f3b94b4934 | /src/com/keymane/web/StandardResponseImpl.java | d4bf91e8d1e921172d30a3bbc5ba0c7c2dcfd351 | [] | no_license | keymane/springboot | 8218793f51a18e485b515972bd94a106300fc247 | 884c7a1350bbdb424759a4310294e7b052df0869 | refs/heads/master | 2021-01-20T20:28:01.449143 | 2016-07-23T09:46:15 | 2016-07-23T09:46:15 | 64,007,877 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 536 | java | package com.keymane.web;
import java.util.List;
public class StandardResponseImpl extends BaseStandardResponse {
private List<?> records;
private Long totalRecordCount = 0l;
public List<?> getRecords() {
return records;
}
public void setRecords(List<?> records) {
this.records = records;
}
public Long getTotalRecordCount() {
return totalRecordCount;
}
public void setTotalRecordCount(Long totalRecordCount) {
this.totalRecordCount = totalRecordCount;
}
}
| [
"keymanclassic@gmail.com"
] | keymanclassic@gmail.com |
9ebbc249618be4905085f40a169ba809099003c1 | 1d05ba2af9da6955d7b64a38c2b81c6ea82afb3d | /Source Code/RunEdgeConvert.java | aba62c88578744c0fe3068f089b7a83cefbb943d | [] | no_license | tablespoon1/App_Development_Team2_FinalProject | 39d1927781b86024a186dca52bc49ab8336270b3 | a98f67aeb7f8a96a8105c970540be5d05a25f961 | refs/heads/master | 2020-05-20T07:51:28.435719 | 2013-12-18T21:41:17 | 2013-12-18T21:41:17 | 14,150,025 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 214 | java | /**
* The main method class which creates the ConvertGUI and runs the program
*/
public class RunEdgeConvert {
public static void main(String[] args) {
EdgeConvertGUI edge = new EdgeConvertGUI();
}
} | [
"bennyval@gmail.com"
] | bennyval@gmail.com |
db1423b40cde0985846000bf858b01e63c740b64 | 287f4d7281fa445be5664e66268f19e0b3af947c | /microservices/clients/contest-client/src/main/java/org/xcolab/client/contest/proposals/ProposalJudgeRatingClientMockImpl.java | 865c0fe36cd456447386687c69a182a310f0481f | [
"MIT"
] | permissive | CCI-MIT/XCoLab | 3e46c2d06975cfde79886c5a3d0e47bb28696f92 | b0e1f6d09e88de138a57efec0c434185eb63de97 | refs/heads/master | 2022-12-11T10:54:17.079902 | 2021-12-14T01:08:00 | 2021-12-14T01:08:00 | 3,661,343 | 17 | 10 | MIT | 2022-12-07T09:44:23 | 2012-03-08T15:38:13 | Java | UTF-8 | Java | false | false | 1,769 | java | package org.xcolab.client.contest.proposals;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;
import org.xcolab.client.contest.pojo.IProposalRatingType;
import org.xcolab.client.contest.pojo.IProposalRatingValue;
import org.xcolab.client.contest.pojo.wrapper.ProposalRatingWrapper;
import java.util.Collections;
import java.util.List;
@Component
@Profile("test")
public class ProposalJudgeRatingClientMockImpl implements IProposalJudgeRatingClient {
@Override
public List<ProposalRatingWrapper> getProposalRatingsByProposalUserContestPhase(Long proposalId,
Long contestPhaseId, Long userId) {
return Collections.emptyList();
}
@Override
public List<IProposalRatingType> getRatingTypesForJudgeType(Integer judgeType) {
return Collections.emptyList();
}
@Override
public List<ProposalRatingWrapper> getRatingsForProposalAndUser(Long proposalId,
Integer judgeType, Long userId, Long contestPhaseId) {
return Collections.emptyList();
}
@Override
public ProposalRatingWrapper createProposalRating(ProposalRatingWrapper proposalRating) {
return null;
}
@Override
public boolean updateProposalRating(ProposalRatingWrapper proposalRating) {
return false;
}
@Override
public IProposalRatingValue getProposalRatingValue(Long proposalRatingValueId) {
return null;
}
@Override
public List<IProposalRatingValue> getProposalRatingValuesByProposalRatingTypeId(
Long ratingTypeId) {
return Collections.emptyList();
}
@Override
public IProposalRatingType getProposalRatingType(Long proposalRatingTypeId) {
return null;
}
}
| [
"nikolaikraler@gmail.com"
] | nikolaikraler@gmail.com |
f767fc60f3b727bdb2024358bb827d5bfa64d402 | ca4b6e8cf03e872a2c9ca7325fd760654f8e98f2 | /app/src/main/java/com/example/dell/chat/Notifications/Token.java | 6494c438670fd497b8eb3184a266b4e1292bbeb9 | [] | no_license | NassimaZIANI/AppMobileMsg | 3ad70edde5be0e90309837c0aa08694e457a23eb | 6d7fde98e61b11cdc62c2648dfcfe6607466c5b2 | refs/heads/master | 2022-12-03T12:28:37.514390 | 2020-08-17T13:19:02 | 2020-08-17T13:19:02 | 288,185,990 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 370 | java | package com.example.dell.chat.Notifications;
/**
* Created by Dell on 07/06/2019.
*/
public class Token {
private String token;
public Token(String token) {
this.token = token;
}
public Token() {
}
public String getToken() {
return token;
}
public void setToken(String token) {
this.token = token;
}
}
| [
"nassima.ziani1996@gmail.com"
] | nassima.ziani1996@gmail.com |
adf96a2c31965937f4fcf35b3ae10d73ff8bdc14 | d57dc6dd7efc8f4ef287e191b4dc9e9deb55cace | /src/LeetCode/MaximumSizeSubarraySumEqualsk.java | 6dbc0305a3d37367d137a33ca14a0d051fb54afd | [] | no_license | thanakorntr/Experiments | 838edc4abc91e705a3d4fb116d22b1b9d528b6df | e92ee2af50609556de7cf4b0b4848aad2a9529e9 | refs/heads/master | 2021-01-15T15:51:06.929457 | 2016-09-18T12:38:21 | 2016-09-18T12:38:21 | 38,551,539 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,888 | java | package LeetCode;
import java.util.HashMap;
import java.util.Map;
/**
* http://www.cnblogs.com/EdwardLiu/p/5104280.html
* <p>
* Given an array nums and a target value k, find the maximum length of a subarray that sums to k. If there isn't one, return 0 instead.
* <p>
* Example 1:
* Given nums = [1, -1, 5, -2, 3], k = 3,
* return 4. (because the subarray [1, -1, 5, -2] sums to 3 and is the longest)
* <p>
* Example 2:
* Given nums = [-2, -1, 2, 1], k = 1,
* return 2. (because the subarray [-1, 2] sums to 1 and is the longest)
* <p>
* Follow Up:
* Can you do it in O(n) time?
* <p>
* Created by Thanakorn on 3/27/16.
*/
public class MaximumSizeSubarraySumEqualsk {
public static void main(String[] args) {
MaximumSizeSubarraySumEqualsk maximumSizeSubarraySumEqualsk = new MaximumSizeSubarraySumEqualsk();
int[] nums = new int[]{1, -1, 5, -2, 3};
int k = 3;
System.out.println(maximumSizeSubarraySumEqualsk.maximumSizeSubarray(nums, k));
nums = new int[]{-2, -1, 2, 1};
k = 1;
System.out.println(maximumSizeSubarraySumEqualsk.maximumSizeSubarray(nums, k));
}
public int maximumSizeSubarray(int[] nums, int k) {
if (nums == null || nums.length == 0) {
return 0;
}
int sum = 0;
int maxLen = Integer.MIN_VALUE;
Map<Integer, Integer> indexSumMap = new HashMap<>();
indexSumMap.put(0, -1);
for (int i = 0; i < nums.length; i++) {
sum += nums[i];
if (!indexSumMap.containsKey(sum)) {
indexSumMap.put(sum, i);
}
if (indexSumMap.containsKey(sum - k)) {
int startIndex = indexSumMap.get(sum - k) + 1;
maxLen = Math.max(maxLen, i - startIndex + 1);
}
}
return maxLen == Integer.MIN_VALUE ? 0 : maxLen;
}
}
| [
"thanakorn@nyu.edu"
] | thanakorn@nyu.edu |
1a698b36e0d77d1666d95bd47fd9d8ea89134f72 | 31fde97e0fb6457b9a5b99ff581eb0e0c1a5cbaf | /app/src/main/java/com/example/bernard5/channelmessaging/LoginActivity.java | 2bb5bc4998524c7585f85e6bb81306dc868bcad8 | [] | no_license | bernarda5/ChannelMessagingUP | b830cf9e4834898fff979ae089ff91ce1ec66af0 | d1e0a09978d55c1d24646eb371a00b0b27d670ec | refs/heads/master | 2020-04-07T16:26:15.749041 | 2018-01-22T10:49:12 | 2018-01-22T10:49:12 | 124,222,155 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,272 | java | package com.example.bernard5.channelmessaging;
import android.app.Activity;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.text.Editable;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
public class LoginActivity extends Activity implements View.OnClickListener {
private Button btnValider ;
private String Identifient ;
private String MDP ;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
btnValider = (Button) findViewById(R.id.buttonValider);
btnValider.setOnClickListener(this) ;
}
@Override
public void onClick(View v) {
EditText readtextID = (EditText) findViewById(R.id.editTextID);
Identifient = readtextID.getText().toString();
EditText readtextMDP = (EditText) findViewById(R.id.editTextMDP);
MDP = readtextMDP.getText().toString();
Toast.makeText(getApplicationContext(),"Id = "+Identifient+"\nMDP = "+MDP,Toast.LENGTH_SHORT).show();
}
}
| [
"bernard5@iut-acy.local"
] | bernard5@iut-acy.local |
af9ddcbcbcc577205a449f2e433bd81b86817d7f | 1c7c11ab06f26d2ba264fb306f9afb3c36fefbf2 | /lab44/src/main/java/com/jlc/spring/Lab44.java | 5043fc2b5e7be119723a14c9eca88469446cbc7d | [] | no_license | TalluriYamini/Spring4.2 | 84ad5d3f79587c54bf20f16f8da949d3419c777a | ea71333cf51d5d6de749ea153ca11e693d551a43 | refs/heads/master | 2022-12-22T22:36:17.712476 | 2020-04-18T16:49:16 | 2020-04-18T16:49:16 | 247,788,126 | 0 | 0 | null | 2022-12-16T06:24:01 | 2020-03-16T18:24:37 | Java | UTF-8 | Java | false | false | 713 | java | package com.jlc.spring;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class Lab44 {
public static void main(String[] args) {
ConfigurableApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
ctx.start();
JLCManager jlc = (JLCManager) ctx.getBean("jlc");
Batch batch = new Batch("B-24", "28-Apr-2010", "6.30-8.30", 150);
jlc.addBatch(batch);
Workshop ws = new Workshop("Web Services", 5000, 99);
jlc.addWorkshop(ws);
ctx.stop();
ctx.close();
}
}
//when no beans is found with matching data type then bean property will not be injected | [
"yamini.talluri@gmail.com"
] | yamini.talluri@gmail.com |
51ad88c6c0e0fcefce24fb611a3ab9d796afcbec | 78f91ae0bedef402211d3c4d3dd93cb926fae884 | /src/main/java/com/exaltpawarikanda/msscbeerorderservice/web/mappers/BeerOrderMapper.java | 25593fc46f499bfda0275d33f7a3bd5ff20f46e4 | [] | no_license | spring-microservices-examples/mssc-beer-order-service | c8a808100a96772fd212b2d2c37718f5c17abee4 | b0d5f47b5cd4c5122fcb8f2dd23e3031338db1ea | refs/heads/main | 2023-06-30T19:46:15.310901 | 2021-08-02T00:25:53 | 2021-08-02T00:25:53 | 391,580,761 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 527 | java | package com.exaltpawarikanda.msscbeerorderservice.web.mappers;
import com.exaltpawarikanda.msscbeerorderservice.domain.BeerOrder;
import com.exaltpawarikanda.msscbeerorderservice.web.model.BeerOrderDto;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
@Mapper(uses = {DateMapper.class, BeerOrderLineMapper.class})
public interface BeerOrderMapper {
@Mapping(target = "customerId", source = "customer.id")
BeerOrderDto beerOrderToDto(BeerOrder beerOrder);
BeerOrder dtoToBeerOrder(BeerOrderDto dto);
}
| [
"exaltpawa@gmail.com"
] | exaltpawa@gmail.com |
495fd5824d7a4232f9a9ffad6478efa3421da4f5 | 65ce6ea8c205988b107233a9ef2bdc310e938353 | /question-answer-service/src/main/java/com/rootquotient/questionanswer/controller/QuestionController.java | 37b4cf2edf3ca53b91672a339a8cf9af2d4a32b0 | [] | no_license | Monishri/DiscussionForum | b0613f1628c1890ee0783d6c05dce0866172f336 | 03c4079becba0c1790de32f153a534483e8e7593 | refs/heads/master | 2022-11-13T15:56:32.620300 | 2020-07-06T18:26:31 | 2020-07-06T18:26:31 | 277,614,427 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,687 | java | package com.rootquotient.questionanswer.controller;
/*
*
* This is the DoctorController Class,
*
* Which provides the basic Rest service related to the Doctor View Page.
*
* */
import java.util.Collection;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.rootquotient.questionanswer.model.Answer;
import com.rootquotient.questionanswer.model.Question;
import com.rootquotient.questionanswer.service.UserService;
@RestController
@RequestMapping("/Question")
public class QuestionController {
@Autowired
private UserService userService;
/*1. Working Service*/
/*
* Demo URL:http://localhost:8082/Question/AllQuestions
*
* */
@GetMapping("/AllQuestions")
public Collection<Question> getAllQuestions()
{
return userService.getAllQuestion();
}
/*2. Working Service*/
/*
* Demo URL:http://localhost:8082/Question/AnswerForQuestion
*
* */
@GetMapping("/AnswerForQuestion/{id}")
public Collection<Answer> getAllAnswersByQId(@PathVariable("id") Integer QuestionId)
{
return userService.getAllAnswersByQId(QuestionId);
}
/*3. Working Service
* Demo URL:http://localhost:8082/Question/CreateQuestion/followed by question JSON details
*
* Input:
* q_id`, ``, ``, `
* {
"questionid": 1, // here, u don't need to give the Id Because it was generated automatically.
"title": "life",
"tags": null,
"description": "What is life ?",
"userid": 2
}
*
*/
@PostMapping(path = "/CreateQuestion")
public void createQuestion(@RequestBody Question question)
{
userService.createQuestion(question);
}
/*4. Working Service*/
/*
* Demo URL:http://localhost:8082/Question/UpdateQuestion/followed by updated question
*
* */
@RequestMapping("/UpdateQuestion")
public void updateQuestion(@RequestBody Question question) {
userService.updateQuestion(question);
}
/*4. Working Service*/
/*
* Demo URL:http://localhost:8082/Question/DeleteQuestion/followed by id
*
* */
@DeleteMapping("/DeleteQuestion/{id}")
public void deleteQuestion(@PathVariable("id") Integer questionId)
{
userService.deleteQuestion(questionId);
}
}
| [
"shrividhya.j.r@gmail.com"
] | shrividhya.j.r@gmail.com |
bbc6448fc6b2bce3d5c49be7d8661b49b0814899 | bcde48fc049ed1ef2f38038656221a95142177a0 | /app/src/main/java/com/example/android/shoppingapp3/adapters/ExpandableListAdapter.java | 2598523a7f30ceff96c970e0fbd563b8124e761c | [] | no_license | pcorletto/ShoppingApp | 466ed717045869bcc187fe0d364ad2d5fd69cb97 | d414c25222689835a150f2574edafd774289e51a | refs/heads/master | 2021-01-10T05:30:59.275550 | 2016-12-31T14:32:05 | 2016-12-31T14:32:05 | 52,568,895 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 13,594 | java | package com.example.android.shoppingapp3.adapters;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.Typeface;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import android.widget.BaseExpandableListAdapter;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.example.android.shoppingapp3.R;
import com.example.android.shoppingapp3.model.ShoppingCartDbHelper;
import com.example.android.shoppingapp3.model.ShoppingItem;
import com.example.android.shoppingapp3.model.ShoppingListDbHelper;
import java.text.DecimalFormat;
import java.util.HashMap;
import java.util.List;
/**
* Created by hernandez on 10/9/2016.
*/
public class ExpandableListAdapter extends BaseExpandableListAdapter {
private Context _context;
private List<ShoppingItem> _listDataHeader; // header titles
// child data in format of header title, child title
private HashMap<ShoppingItem, List<ShoppingItem>> _listDataChild;
ShoppingListDbHelper shoppingListDbHelper;
ShoppingCartDbHelper shoppingCartDbHelper;
SQLiteDatabase sqLiteDatabase;
private String calling_activity_name;
public ExpandableListAdapter(Context context, List<ShoppingItem> listDataHeader,
HashMap<ShoppingItem, List<ShoppingItem>> listChildData) {
this._context = context;
this._listDataHeader = listDataHeader;
this._listDataChild = listChildData;
}
@Override
public int getGroupCount() {
return this._listDataHeader.size();
}
@Override
public int getChildrenCount(int groupPosition) {
return this._listDataChild.get(this._listDataHeader.get(groupPosition))
.size();
}
@Override
public Object getGroup(int groupPosition) {
return this._listDataHeader.get(groupPosition);
}
@Override
public Object getChild(int groupPosition, int childPosition) {
return this._listDataChild.get(this._listDataHeader.get(groupPosition)).get(childPosition);
}
@Override
public long getGroupId(int groupPosition) {
return groupPosition;
}
@Override
public long getChildId(int groupPosition, int childPosition) {
return childPosition;
}
@Override
public boolean hasStableIds() {
return false;
}
@Override
public View getGroupView(final int groupPosition, boolean isExpanded, View convertView, final ViewGroup parent) {
final ShoppingItem headerTitle = (ShoppingItem) getGroup(groupPosition);
calling_activity_name = _context.getClass().getName().toString();
if (convertView == null) {
LayoutInflater inflater = (LayoutInflater) this._context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = inflater.inflate(R.layout.list_group, null);
}
// If the priority is the highest "3" shade it red.
// If the priority is medium "2" shade it yellow.
// If the priority is low "1" shade it blue.
LinearLayout listGroupLayout = (LinearLayout) convertView.findViewById(R.id.listGroupLayout);
if(headerTitle.getPriority()==3){
listGroupLayout.setBackgroundColor(convertView.getResources().getColor(R.color.RedHighestPriority));
}
if(headerTitle.getPriority()==2){
listGroupLayout.setBackgroundColor(convertView.getResources().getColor(R.color.YellowMediumPriority));
}
else if(headerTitle.getPriority()==1){
listGroupLayout.setBackgroundColor(convertView.getResources().getColor(R.color.BlueLowPriority));
}
final TextView quantityTextView = (TextView) convertView.
findViewById(R.id.quantityTextView);
quantityTextView.setText(headerTitle.getQuantity()+"");
final TextView lblListHeader = (TextView) convertView
.findViewById(R.id.lblListHeader);
lblListHeader.setTypeface(null, Typeface.BOLD);
lblListHeader.setText(headerTitle.getProductName());
CheckBox checkBox = (CheckBox) convertView.findViewById(R.id.checkBox);
Button increaseButton = (Button) convertView.findViewById(R.id.increaseButton);
Button decreaseButton = (Button) convertView.findViewById(R.id.decreaseButton);
checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if(isChecked ){
_listDataHeader.get(groupPosition).setSelected(true);
}else {
_listDataHeader.get(groupPosition).setSelected(false);
}
}
});
increaseButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
int newQuantity = headerTitle.getQuantity();
newQuantity++;
headerTitle.setQuantity(newQuantity);
quantityTextView.setText(newQuantity+"");
double newSubtotal = newQuantity * headerTitle.getItemPrice();
headerTitle.setSubtotal(newSubtotal);
// Update quantity and subtotal in SQLite DB...
updateSubtotal(headerTitle.getProductName(), newQuantity+"", newSubtotal+"");
if(calling_activity_name.equals("com.example.android.shoppingapp3.ui.DisplayListActivity")){
// If the group view was already expanded, collapse it, and expand it again,
// so that the data in the child view can be refreshed.
if(com.example.android.shoppingapp3.ui.DisplayListActivity.expListView.isGroupExpanded(groupPosition)){
com.example.android.shoppingapp3.ui.DisplayListActivity.expListView.collapseGroup(groupPosition);
com.example.android.shoppingapp3.ui.DisplayListActivity.expListView.expandGroup(groupPosition);
}
}
else if(calling_activity_name.equals("com.example.android.shoppingapp3.ui.DisplayCartActivity")) {
// If the group view was already expanded, collapse it, and expand it again,
// so that the data in the child view can be refreshed.
if(com.example.android.shoppingapp3.ui.DisplayCartActivity.expListView.isGroupExpanded(groupPosition)){
com.example.android.shoppingapp3.ui.DisplayCartActivity.expListView.collapseGroup(groupPosition);
com.example.android.shoppingapp3.ui.DisplayCartActivity.expListView.expandGroup(groupPosition);
}
}
}
});
decreaseButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
int newQuantity = headerTitle.getQuantity();
newQuantity--;
if(newQuantity==0){
newQuantity=1;
}
headerTitle.setQuantity(newQuantity);
quantityTextView.setText(newQuantity+"");
double newSubtotal = newQuantity * headerTitle.getItemPrice();
headerTitle.setSubtotal(newSubtotal);
// Update quantity and subtotal in SQLite DB...
updateSubtotal(headerTitle.getProductName(), newQuantity+"", newSubtotal+"");
if(calling_activity_name.equals("com.example.android.shoppingapp3.ui.DisplayListActivity")){
// If the group view was already expanded, collapse it, and expand it again,
// so that the data in the child view can be refreshed.
if(com.example.android.shoppingapp3.ui.DisplayListActivity.expListView.isGroupExpanded(groupPosition)){
com.example.android.shoppingapp3.ui.DisplayListActivity.expListView.collapseGroup(groupPosition);
com.example.android.shoppingapp3.ui.DisplayListActivity.expListView.expandGroup(groupPosition);
}
}
else if(calling_activity_name.equals("com.example.android.shoppingapp3.ui.DisplayCartActivity")) {
// If the group view was already expanded, collapse it, and expand it again,
// so that the data in the child view can be refreshed.
if(com.example.android.shoppingapp3.ui.DisplayCartActivity.expListView.isGroupExpanded(groupPosition)){
com.example.android.shoppingapp3.ui.DisplayCartActivity.expListView.collapseGroup(groupPosition);
com.example.android.shoppingapp3.ui.DisplayCartActivity.expListView.expandGroup(groupPosition);
}
}
}
});
return convertView;
}
@Override
public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) {
final ShoppingItem childText = (ShoppingItem) getChild(groupPosition, childPosition);
ViewHolder holder = new ViewHolder();
if (convertView == null) {
LayoutInflater inflater = (LayoutInflater) this._context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = inflater.inflate(R.layout.list_item, null);
holder.quantityTextView = (TextView) convertView.findViewById(R.id.quantityTextView);
holder.itemPriceTextView = (TextView) convertView.findViewById(R.id.itemPriceTextView);
holder.subtotalTextView = (TextView) convertView.findViewById(R.id.subtotalTextView);
holder.categoryTextView = (TextView) convertView.findViewById(R.id.categoryTextView);
holder.lastDatePurchasedTextView = (TextView) convertView.findViewById(R.id.lastDatePurchasedTextView);
holder.priorityTextView = (TextView) convertView.findViewById(R.id.priorityTextView);
holder.productImage = (WebView) convertView.findViewById(R.id.productImage);
holder.taxableTextView = (TextView) convertView.findViewById(R.id.taxableTextView);
convertView.setTag(holder);
} else{
holder = (ViewHolder) convertView.getTag();
}
DecimalFormat df = new DecimalFormat("$0.00");
holder.quantityTextView.setText(childText.getQuantity()+"");
holder.itemPriceTextView.setText(df.format(childText.getItemPrice()));
holder.subtotalTextView.setText(df.format(childText.getSubtotal()));
holder.categoryTextView.setText(childText.getCategory());
holder.lastDatePurchasedTextView.setText(childText.getLastDatePurchased());
holder.priorityTextView.setText(childText.getPriority()+"");
if(childText.isTaxable()){
holder.taxableTextView.setText("Yes");
}
else{
holder.taxableTextView.setText("No");
}
holder.productImage.getSettings().setLoadsImagesAutomatically(true);
holder.productImage.getSettings().setLoadWithOverviewMode(true);
holder.productImage.getSettings().setUseWideViewPort(true);
holder.productImage.loadUrl(childText.getImage());
return convertView;
}
private static class ViewHolder{
public TextView quantityTextView;
public TextView itemPriceTextView;
public TextView subtotalTextView;
public TextView categoryTextView;
public TextView lastDatePurchasedTextView;
public TextView priorityTextView;
public WebView productImage;
public TextView taxableTextView;
}
public void updateSubtotal(String productName, String quantity, String subtotal){
// If the calling activity is the DisplayListActivity, update the subtotal in the LIST DB
// If the calling activity is the DisplayCartActivity, update the subtotal in the CART DB
if(calling_activity_name.equals("com.example.android.shoppingapp3.ui.DisplayListActivity")){
shoppingListDbHelper = new ShoppingListDbHelper(_context.getApplicationContext());
sqLiteDatabase = shoppingListDbHelper.getWritableDatabase();
shoppingListDbHelper.updateSubtotal(productName, quantity, subtotal, sqLiteDatabase);
}
else if(calling_activity_name.equals("com.example.android.shoppingapp3.ui.DisplayCartActivity")) {
shoppingCartDbHelper = new ShoppingCartDbHelper(_context.getApplicationContext());
sqLiteDatabase = shoppingCartDbHelper.getWritableDatabase();
shoppingCartDbHelper.updateSubtotal(productName, quantity, subtotal, sqLiteDatabase);
}
}
@Override
public boolean isChildSelectable(int groupPosition, int childPosition) {
return true;
}
}
| [
"peter.corletto@gmail.com"
] | peter.corletto@gmail.com |
36525bcad2980318b9d65b63316b4d2035934dbf | 7bee56dc860cd07934fc4282a9e8e29d19797c08 | /workspace/org.dafoe.terminoontologiclevel.ui/src/org/dafoe/terminoontologiclevel/ui/views/SentenceWidget.java | 0f8fb8e35b7cb310c358dd7db8f657246d8604f5 | [] | no_license | ics-upmc/Dafoe | 789834898719ac301381d7f4a852f9ea887c6ee1 | 0cacb779bf4b05b85c71b631e934be04455fc982 | refs/heads/master | 2021-01-17T04:32:16.044849 | 2012-02-28T19:36:31 | 2012-02-28T19:36:31 | 3,574,208 | 1 | 0 | null | null | null | null | IBM852 | Java | false | false | 8,387 | java | /*******************************************************************************************************************************
* (c) Copyright 2007, 2010 CRITT Informatique and INSERM, LISI/ENSMA, MONDECA, LIPN, IRIT, SUPELEC, TÚlÚcom ParisTech, CNRS/UTC.
* All rights reserved.
* This program has been developed by the CRITT Informatique for the ANR DAFOE4App Project.
* This program and the accompanying materials are made available under the terms
* of the CeCILL-C Public License v1 which accompanies this distribution,
* and is available at http://www.cecill.info/licences/Licence_CeCILL-C_V1-fr.html
*
* Contributors:
* INSERM, LISI/ENSMA, MONDECA, LIPN, IRIT, SUPELEC, TÚlÚcom ParisTech, CNRS/UTC and CRITT Informatique - specifications
* CRITT Informatique - initial API and implementation
********************************************************************************************************************************/
package org.dafoe.terminoontologiclevel.ui.views;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.util.ArrayList;
import java.util.List;
import org.dafoe.framework.core.terminological.model.ISentence;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.BaseLabelProvider;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.TableViewerColumn;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ControlAdapter;
import org.eclipse.swt.events.ControlEvent;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.themes.IThemeManager;
public class SentenceWidget extends Composite {
// private static String SENTENCE_COL_NAME = Messages
// .getString("SentenceWidget.0"); //$NON-NLS-1$
private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(
this);
private String deletionEventType;
private Composite mainComposite;
private TableViewer sentencesTableViewer;
private TableViewerColumn sentencesColumn;
// private List<ISentence> sentences;
// private ITerminoConcept currentTC;
private Action removeSentenceAction;
// private Shell shell;
public SentenceWidget(Composite parent, int style) {
super(parent, style);
this.setLayout(new GridLayout());
IThemeManager themeManager = PlatformUI.getWorkbench()
.getThemeManager();
final Color CORPUS_LEVEL_COLOR = themeManager
.getTheme("org.dafoe.corpuslevel.themeId").getColorRegistry().get("org.dafoe.application.backcolor"); //$NON-NLS-1$ //$NON-NLS-2$
this.setBackground(CORPUS_LEVEL_COLOR);
GridData gd;
gd = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1);
this.setLayoutData(gd);
createContent();
}
//
private void createContent() {
GridData gd;
mainComposite = new Composite(this, SWT.NONE);
gd = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1);
mainComposite.setLayoutData(gd);
mainComposite.setLayout(new GridLayout(1, false));
sentencesTableViewer = new TableViewer(mainComposite, SWT.H_SCROLL
| SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.BORDER);
GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
sentencesTableViewer.getTable().setLayoutData(gridData);
sentencesTableViewer.getTable().setLinesVisible(true);
sentencesTableViewer.getTable().setHeaderVisible(true);
sentencesColumn = new TableViewerColumn(sentencesTableViewer, SWT.NONE,
0);
sentencesColumn.getColumn().setText(
Messages.getString("TerminologicalViewPart.16")); //$NON-NLS-1$
sentencesColumn.getColumn().setResizable(true);
sentencesColumn.getColumn().setWidth(300);
mainComposite.addControlListener(new ControlAdapter() {
public void controlResized(ControlEvent e) {
Rectangle area = mainComposite.getClientArea();
Point preferredSize = sentencesTableViewer.getTable()
.computeSize(SWT.DEFAULT, SWT.DEFAULT);
int width = area.width - 2
* sentencesTableViewer.getTable().getBorderWidth();
if (preferredSize.y > area.height
+ sentencesTableViewer.getTable().getHeaderHeight()) {
Point vBarSize = sentencesTableViewer.getTable()
.getVerticalBar().getSize();
width -= vBarSize.x;
}
Point oldSize = sentencesTableViewer.getTable().getSize();
if (oldSize.x > area.width) {
sentencesColumn.getColumn().setWidth(width);
sentencesTableViewer.getTable().setSize(area.width,
area.height);
} else {
sentencesTableViewer.getTable().setSize(area.width,
area.height);
sentencesColumn.getColumn().setWidth(width);
}
}
});
sentencesTableViewer.setContentProvider(new SentenceContentProvider());
sentencesTableViewer.setLabelProvider(new SentenceTableLabelProvider());
sentencesTableViewer.setInput(new ArrayList<ISentence>());
// sentencesColumn.getColumn().pack();
makeActions();
hookPopupMenu();
}
//
public void setDeletionEventType(String event) {
this.deletionEventType = event;
}
//
public String getDeletionEventType() {
return this.deletionEventType;
}
//
public void setInput(List<ISentence> sentences) {
this.sentencesTableViewer.setInput(sentences);
}
//
public List<ISentence> getSelection() {
List<ISentence> res = new ArrayList<ISentence>();
if (sentencesTableViewer.getTable().getSelection().length != 0) {
res
.add((ISentence) (sentencesTableViewer.getTable()
.getSelection()[0].getData()));
}
;
return res;
}
//
public void deselect() {
sentencesTableViewer.getTable().deselectAll();
}
//
public void refresh() {
// sentencesTableViewer.setInput(???);
}
//
public void addPropertyChangeListener(PropertyChangeListener l) {
propertyChangeSupport.addPropertyChangeListener(l);
}
//
public void removePropertyChangeListener(PropertyChangeListener l) {
propertyChangeSupport.removePropertyChangeListener(l);
}
//
class SentenceContentProvider implements IStructuredContentProvider {
@SuppressWarnings("unchecked")
@Override
public Object[] getElements(Object inputElement) {
return ((List<ISentence>) inputElement).toArray();
}
@Override
public void dispose() {
}
@Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
}
}
//
class SentenceTableLabelProvider extends BaseLabelProvider implements
ILabelProvider {
public Image getImage(Object element) {
return null;
}
public String getText(Object element) {
if (element instanceof ISentence) {
return ((ISentence) element).getContent();
}
return null;
}
}
//
private void makeActions() {
ImageDescriptor imgDesc;
// remove a relation type => check if it is used in a terminological
// relation. If not, delete.
removeSentenceAction = new Action() {
public void run() {
propertyChangeSupport.firePropertyChange(deletionEventType,
true, false);
}
};
removeSentenceAction.setText(Messages.getString("SentenceWidget.1")); //$NON-NLS-1$
imgDesc = org.dafoe.terminoontologiclevel.ui.Activator
.getDefault()
.getImageRegistry()
.getDescriptor(
org.dafoe.terminoontologiclevel.ui.Activator.REMOVE_IMG_ID);
removeSentenceAction.setImageDescriptor(imgDesc);
removeSentenceAction.setEnabled(true);
}
//
private void hookPopupMenu() {
MenuManager menuMgr = new MenuManager("#PopupMenu"); //$NON-NLS-1$
Menu menu = menuMgr.createContextMenu(sentencesTableViewer.getTable());
sentencesTableViewer.getControl().setMenu(menu);
menuMgr.add(this.removeSentenceAction);
}
}
| [
"laurent.mazuel@gmail.com"
] | laurent.mazuel@gmail.com |
bb40d67b5591cded70557d314163c2f8308e6149 | 1f19aec2ecfd756934898cf0ad2758ee18d9eca2 | /u-1/u-11/u-11-111/u-11-111-1112/u-11-111-1112-11113/u-11-111-1112-11113-f7204.java | 46984086bf2bba63f810d34569268939ca003525 | [] | no_license | apertureatf/perftest | f6c6e69efad59265197f43af5072aa7af8393a34 | 584257a0c1ada22e5486052c11395858a87b20d5 | refs/heads/master | 2020-06-07T17:52:51.172890 | 2019-06-21T18:53:01 | 2019-06-21T18:53:01 | 193,039,805 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 106 | java | mastercard 5555555555554444 4012888888881881 4222222222222 378282246310005 6011111111111117
5474088479128 | [
"jenkins@khan.paloaltonetworks.local"
] | jenkins@khan.paloaltonetworks.local |
b47b25051bd3b140653f8177a15995afde0de506 | 98736552fc81884aff464f8dd297806e7c38ab95 | /src/main/java/com/lu/controller/fileupload/B.java | a266718ef717bc54bd047ee5bf505e46ca4caf48 | [] | no_license | lushunming/FrontEndDemos | 7a967b1ff914b4b422aa866fe9353327ba76e401 | c069dcb3e8924ccaa7ca6efba43f82b033551b45 | refs/heads/master | 2021-01-18T18:30:47.789207 | 2016-07-27T16:03:21 | 2016-07-27T16:03:21 | 61,474,486 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 166 | java | package com.lu.controller.fileupload;
public class B {
private String b;
public String getB() {
return b;
}
public void setB(String b) {
this.b = b;
}
}
| [
"1357197829@qq.com"
] | 1357197829@qq.com |
92a2d6ad987d256a9547aff21bb41bc7544fb3a1 | 2baa1ce4f7d20eed6e3f43e4ede3d8d09b2359f8 | /J2EE-Patterns/src/com/j2ee/InterceptingFilter/Target.java | 37f60ed03ba09fd0554b667fef07b04d81d53c20 | [] | no_license | eblufac/Design-Pattern | 7dcbaed4f55d7ee17a5dd10b2e9af04b6a9d95e1 | 20f344ab399c6cba9de9d123a3a1b723d71d51fe | refs/heads/master | 2020-07-05T01:59:43.587008 | 2019-12-16T15:07:08 | 2019-12-16T15:07:08 | 202,489,436 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 249 | java | package com.j2ee.InterceptingFilter;
/**
* @author lgy
* @version 1
* @description
* @date 2019/12/12 12:24
*/
public class Target {
public void execute(String request){
System.out.println("Executing request: " + request);
}
}
| [
"838292556@qq.com"
] | 838292556@qq.com |
c1fd17dcda6afe54157cba0ad09b4d4bdd7796ce | 6f0ab76bf1fda23274506c7f0a12c93c6a85d3a9 | /src/main/java/com/cafedal/webapp/dao/ManageDao.java | a47f44384c904c846c9f85cdd787673a726095a8 | [] | no_license | yeongyeonglee/dal | 320f7674dd35bc529a57bc4fc5c63d94ef3f98eb | 3c900f5b3ceb4194dc2c2de99b22495600ad6811 | refs/heads/master | 2021-08-20T05:54:09.488983 | 2017-11-28T10:09:04 | 2017-11-28T10:09:04 | 112,318,994 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 258 | java | package com.cafedal.webapp.dao;
import java.util.List;
import com.cafedal.webapp.entity.Manage;
public interface ManageDao {
Manage get(String id);
Manage getCafe(String id);
List<Manage> getUseListCafe(String id);
}
| [
"user@user74"
] | user@user74 |
b3a0a645954fdb7888824f9836c0bf75022e10bf | 1c87785a4a2b55365581e49515d2424baa41e9f3 | /commandline/src/main/java/org/allurefw/report/utils/CommandUtils.java | 87b1df5f08c409b02c20f4c95b473c5ab58c5d91 | [
"Apache-2.0"
] | permissive | baev/allure-report | ebb6a6bec1b82c08c7a39fca971e061f1ddc1ad1 | 6a68f124e019fdf195e5d7f93aa4bf60b09c9111 | refs/heads/master | 2021-01-18T09:42:44.628743 | 2016-11-29T20:23:13 | 2016-11-29T20:23:13 | 67,599,691 | 0 | 0 | null | 2016-09-07T11:15:02 | 2016-09-07T11:15:01 | null | UTF-8 | Java | false | false | 2,468 | java | package org.allurefw.report.utils;
import org.allurefw.report.Main;
import org.allurefw.report.command.AllureCommandException;
import org.allurefw.report.command.Context;
import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.handler.DefaultHandler;
import org.eclipse.jetty.server.handler.HandlerList;
import org.eclipse.jetty.server.handler.ResourceHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.awt.*;
import java.io.IOException;
import java.net.URI;
import java.nio.file.Files;
import java.nio.file.Path;
/**
* @author charlie (Dmitry Baev).
*/
public final class CommandUtils {
private static final Logger LOGGER = LoggerFactory.getLogger(CommandUtils.class);
CommandUtils() {
}
public static void copyDirectory(Path source, Path dest) {
if (Files.exists(source)) {
try {
Files.createDirectories(dest);
Files.walkFileTree(source, new CopyVisitor(source, dest));
} catch (IOException e) {
throw new AllureCommandException("Could not copy directory");
}
}
}
public static Main createMain(Context context) {
return new Main(
context.getPluginsDirectory(),
context.getEnabledPlugins()
);
}
/**
* Set up Jetty server to serve Allure Report
*/
public static Server setUpServer(int port, Path reportDirectory) {
Server server = new Server(port);
ResourceHandler handler = new ResourceHandler();
handler.setDirectoriesListed(true);
handler.setWelcomeFiles(new String[]{"index.html"});
handler.setResourceBase(reportDirectory.toAbsolutePath().toString());
HandlerList handlers = new HandlerList();
handlers.setHandlers(new Handler[]{handler, new DefaultHandler()});
server.setStopAtShutdown(true);
server.setHandler(handlers);
return server;
}
/**
* Open the given url in default system browser.
*/
public static void openBrowser(URI url) throws IOException {
if (Desktop.isDesktopSupported()) {
Desktop.getDesktop().browse(url);
} else {
LOGGER.error("Can not open browser because this capability is not supported on " +
"your platform. You can use the link below to open the report manually.");
}
}
}
| [
"baev.dm@gmail.com"
] | baev.dm@gmail.com |
4632b58a212754ed113e74aaf010a9ff49ae8d76 | 93477b65012373fe00a32f96d954aea7073659e3 | /src/org/getopt/luke/decoders/BinaryDecoder.java | b08a5fbc1c92e22ecf3f91e3b69f8870661eeda5 | [] | no_license | belle96/luke | 06fd4b05a77b3012c64761cbebc1108f6b2cb3e3 | 3f99b06aac6ecbf567c9c5acc175a3dae8030d36 | refs/heads/master | 2020-05-31T19:18:23.972257 | 2010-09-20T10:19:39 | 2010-09-20T10:19:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 651 | java | package org.getopt.luke.decoders;
import org.apache.lucene.document.Fieldable;
import org.getopt.luke.Util;
public class BinaryDecoder implements Decoder {
@Override
public String decodeTerm(String fieldName, Object value) throws Exception {
byte[] data;
if (value instanceof byte[]) {
data = (byte[])value;
} else {
data = value.toString().getBytes();
}
return Util.bytesToHex(data, 0, data.length, false);
}
@Override
public String decodeStored(String fieldName, Fieldable value) throws Exception {
return decodeTerm(fieldName, value);
}
public String toString() {
return "binary";
}
}
| [
"sigram@gmail.com"
] | sigram@gmail.com |
e5943be16b1bfcfc1a835ab05827bde79937df05 | 0f499ceae729734a0f5a17e4e1e26e393e6ede19 | /ITvKurzeSources/webinar 31/src/sk/itvkurze/swing/_34_dialogove_okna_a_formulare/gui/Aplikacia.java | e8d01d182899ae939d1f00942386473ba1e87f22 | [] | no_license | marekpatarak/personal-workspace | 5dbd7f50463c33cc151f8c8a9536949e72c7db58 | 95374b842e925531ea20bd7ff3fb342d9561e0fb | refs/heads/master | 2022-12-23T09:12:02.659254 | 2019-10-02T14:09:29 | 2019-10-02T14:09:29 | 149,508,965 | 0 | 0 | null | 2022-12-16T00:40:38 | 2018-09-19T20:33:44 | Java | UTF-8 | Java | false | false | 292 | java | package sk.itvkurze.swing._34_dialogove_okna_a_formulare.gui;
import javax.swing.SwingUtilities;
public class Aplikacia
{
public static void main(String[] args)
{
SwingUtilities.invokeLater(new Runnable()
{
@Override
public void run()
{
new HlavneOkno();
}
});
}
}
| [
"m.patarak@gmail.com"
] | m.patarak@gmail.com |
a2c102d08c99a2d48af8022b9ee2194787460c11 | 44fb90921335870f0e0ab45cc2bf9df414f6e845 | /Project_0829JDBC/src/basic/Database.java | 8a095bedba182e4f4c3d39e171b6335e10cee64c | [] | no_license | hyunbeen/javabasic--training | eae9e2f83aeee4602b6a43b449fff1318ace411f | 03cbb00df7e4ba06499fd1d3d9fe22e75f2efe23 | refs/heads/master | 2020-12-15T09:17:31.937118 | 2020-01-20T08:56:19 | 2020-01-20T08:56:19 | 235,056,016 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,975 | java | package basic;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
public class Database {
String url = "";
String user = "";
String pass = "";
Connection con = null;
public Database()throws ClassNotFoundException {
Statement st = null;
//1.드라이버를 로딩
Class.forName("oracle.jdbc.driver.OracleDriver");
//2.연결 객체 얻어오기
String url = "jdbc:oracle:thin:@192.168.0.156:1521:orcl";
String user = "scott";
String pass = "tiger";
try {
con = DriverManager.getConnection(url, user, pass);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("연결성공");
}
public void insert(Record r) throws SQLException {
String sql = "INSERT INTO info_tab VALUES(?,?,?,?,?,?)";
PreparedStatement ps = con.prepareStatement(sql);
ps.setString(1,r.getName());
ps.setString(2,r.getTel());
ps.setString(3,r.getJumin());
ps.setInt(4,r.getAge());
ps.setString(5,r.getHome());
ps.setString(6,r.getGender());
ps.executeUpdate();
ps.close();
}
public Record selectByPk(String text) throws SQLException {
Record r = null;
String sql = "SELECT * FROM info_tab WHERE tel = ?";
PreparedStatement ps = con.prepareStatement(sql);
ps.setString(1,text);
ps.executeQuery();
ResultSet r1 = ps.getResultSet();
if(r1.next()) {
r= new Record();
r.setName(r1.getString("NAME"));
r.setTel(r1.getString("tel"));
r.setJumin(r1.getString("jumin"));
r.setAge((int)r1.getLong("age"));
r.setHome(r1.getString("home"));
r.setGender(r1.getString("gender"));
}
return r;
}
public ArrayList<Record> selectAll() throws Exception{
String sql = "SELECT * FROM info_tab";
Statement st = con.createStatement();
ResultSet rs = st.executeQuery(sql);
ArrayList<Record> list = new ArrayList();
while(rs.next()) {
Record r = new Record();
r.setName(rs.getString("NAME"));
r.setTel(rs.getString("tel"));
r.setJumin(rs.getString("jumin"));
r.setAge((int)rs.getLong("age"));
r.setHome(rs.getString("home"));
r.setGender(rs.getString("gender"));
list.add(r);
}
return list;
}
public void modify(Record r1) throws SQLException {
String sql = "Update info_tab set name = ? ,jumin = ?,age = ?,home = ?,gender = ? where tel = ?";
PreparedStatement ps = con.prepareStatement(sql);
ps.setString(1,r1.getName());
ps.setString(2,r1.getJumin());
ps.setString(3,String.valueOf(r1.getAge()));
ps.setString(4,r1.getHome());
ps.setString(5,r1.getGender());
ps.setString(6,r1.getTel());
ps.executeUpdate();
}
public void delete(String text) throws SQLException {
String sql = "Delete from info_tab where tel = ?";
PreparedStatement ps = con.prepareStatement(sql);
ps.setString(1,text);
ps.executeUpdate();
}
}
| [
"bigpig93@naver.com"
] | bigpig93@naver.com |
c4ce4ca3e1bceab8fc4e8a4d7993a47f72bdd1c0 | 706664872b82f9567fa941b9bac636f506141625 | /src/ar/com/jorgesaw/dto/Ciudad.java | 6c595429b05e362527c7e2882bc985796ff0c9ea | [] | no_license | jorgesaw/SuperBingo | d8776e41a1928ca1fa1091b1a95cd9e7f165cbee | 5370e85f12aa987adb46a6f79a8e68eb3f7c13e9 | refs/heads/master | 2020-05-17T16:04:38.675389 | 2014-09-14T02:45:35 | 2014-09-14T02:45:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,107 | java | package ar.com.jorgesaw.dto;
public class Ciudad {
Integer idCiudad;
String nomCiudad;
String codPostal;
String DDN;
Provincia prov;
public Ciudad() { }
public Ciudad(Integer idCiudad, String nomCiudad) {
this.idCiudad = idCiudad;
this.nomCiudad = nomCiudad;
}
public Ciudad(String nomCiudad, String codPostal, String DDN) {
this.nomCiudad = nomCiudad;
this.codPostal = codPostal;
this.DDN = DDN;
}
public Integer getIdCiudad() {
return idCiudad;
}
public void setIdCiudad(Integer idCiudad) {
this.idCiudad = idCiudad;
}
public String getNomCiudad() {
return nomCiudad;
}
public void setNomCiudad(String nomCiudad) {
this.nomCiudad = nomCiudad;
}
public String getCodPostal() {
return codPostal;
}
public void setCodPostal(String codPostal) {
this.codPostal = codPostal;
}
public String getDDN() {
return DDN;
}
public void setDDN(String dDN) {
DDN = dDN;
}
public Provincia getProv() {
return prov;
}
public void setProv(Provincia prov) {
this.prov = prov;
}
@Override
public String toString() {
return nomCiudad;
}
}
| [
"jorgesaw@gmail.com"
] | jorgesaw@gmail.com |
2b95a545673bd3620aecb92ece9b5473197ab7cd | 6a1b335546fdf534a2eb4840dd335adb28d109a7 | /src/chapter7/boj/Solved10815.java | bf6e1471d06a17b60058908f5e1339efddf560ba | [] | no_license | wonyong-park/CodingTest | 5c64fd82fa010f9c7bcb6642293490a213f170eb | ae684ee62ff8200d047bb166da8cd11c49681f7d | refs/heads/master | 2023-08-29T03:56:25.033249 | 2021-10-19T15:34:25 | 2021-10-19T15:34:25 | 380,784,288 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,155 | java | package chapter7.boj;
import java.util.Arrays;
import java.util.Scanner;
public class Solved10815 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] arr = new int[n];
for (int i = 0; i < n; i++) {
arr[i] = sc.nextInt();
}
Arrays.sort(arr);
int m = sc.nextInt();
StringBuilder sb = new StringBuilder();
for (int i = 0; i < m; i++) {
int k = sc.nextInt();
int start = 0;
int end = arr.length - 1;
int result = 0;
while (start <= end) {
int mid = (start + end) / 2;
if (arr[mid] == k) {
result = 1;
break;
} else if (arr[mid] < k) {
start = mid + 1;
}else{
end = mid - 1;
}
}
if (result == 1) {
sb.append("1 ");
}else{
sb.append("0 ");
}
}
System.out.println(sb.toString());
}
}
| [
"wanyong0919@naver.com"
] | wanyong0919@naver.com |
9ccd786f6cc1851a86fb58fa2567db2ed75ae30e | 3bb0e6ccd5a123e4150aa94b83ad6965c61628be | /server/ServerCommInterface.java | dd71216cccd0f16fdce050e8073dc38cf1cae545 | [] | no_license | egcmi/MD5-cracker | 5651e8a1e2f2a63f94fd7aa8d857890e92e295ce | 00274a8a4cc599a6da011ccc3a645d9a43bd388e | refs/heads/master | 2020-05-06T12:24:21.395635 | 2019-04-08T10:16:54 | 2019-04-08T10:16:54 | 180,121,227 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 537 | java | package assignment3.server;
import java.rmi.Remote;
import assignment3.client.ClientCommInterface;
public interface ServerCommInterface extends Remote {
public void register(String teamName, String teamCode, ClientCommInterface cc) throws Exception;
public void reregister(String teamName, String teamCode, ClientCommInterface cc) throws Exception;
public void submitSolution(String name, String teamCode, String sol) throws Exception;
public String getTeamIP(String teamName, String teamCode) throws Exception;
}
| [
"egcalabi@gmail.com"
] | egcalabi@gmail.com |
3381b4906428c9a83a11aeaf2974e61833b2830a | d6df613a750bdbff232adfec3362ba85596dec40 | /src/main/java/com/xti/jenkins/plugin/awslambda/service/LambdaInvokeService.java | c85600a57ba0d2bb524fbf1b44a2e20f4c1b46b6 | [
"MIT"
] | permissive | XT-i/aws-lambda-jenkins-plugin | df37bbc3a8b080bbb9086562df1711cd33744c39 | 8a248cc3c749a13fbfecabfb9aef042b33a5f5c8 | refs/heads/master | 2021-07-23T18:25:56.893272 | 2017-05-02T21:40:42 | 2017-05-02T21:40:42 | 31,619,289 | 54 | 35 | MIT | 2020-06-17T06:56:34 | 2015-03-03T20:20:33 | Java | UTF-8 | Java | false | false | 2,574 | java | package com.xti.jenkins.plugin.awslambda.service;
import com.amazonaws.services.lambda.AWSLambdaClient;
import com.amazonaws.services.lambda.model.InvocationType;
import com.amazonaws.services.lambda.model.InvokeRequest;
import com.amazonaws.services.lambda.model.InvokeResult;
import com.amazonaws.services.lambda.model.LogType;
import com.amazonaws.util.Base64;
import com.xti.jenkins.plugin.awslambda.exception.LambdaInvokeException;
import com.xti.jenkins.plugin.awslambda.invoke.InvokeConfig;
import org.apache.commons.lang.StringUtils;
import java.nio.charset.Charset;
public class LambdaInvokeService {
private AWSLambdaClient client;
private JenkinsLogger logger;
public LambdaInvokeService(AWSLambdaClient client, JenkinsLogger logger) {
this.client = client;
this.logger = logger;
}
/**
* Synchronously or asynchronously invokes an AWS Lambda function.
* If synchronously invoked, the AWS Lambda log is collected and the response payload is returned
* @param invokeConfig AWS Lambda invocation configuration
* @return response payload
*/
public String invokeLambdaFunction(InvokeConfig invokeConfig) throws LambdaInvokeException {
InvokeRequest invokeRequest = new InvokeRequest()
.withFunctionName(invokeConfig.getFunctionName())
.withPayload(invokeConfig.getPayload());
if(invokeConfig.isSynchronous()){
invokeRequest
.withInvocationType(InvocationType.RequestResponse)
.withLogType(LogType.Tail);
} else {
invokeRequest
.withInvocationType(InvocationType.Event);
}
logger.log("Lambda invoke request:%n%s%nPayload:%n%s%n", invokeRequest.toString(), invokeConfig.getPayload());
InvokeResult invokeResult = client.invoke(invokeRequest);
String payload = "";
if(invokeResult.getPayload() != null){
payload = new String(invokeResult.getPayload().array(), Charset.forName("UTF-8"));
}
logger.log("Lambda invoke response:%n%s%nPayload:%n%s%n", invokeResult.toString(), payload);
if(invokeResult.getLogResult() != null){
logger.log("Log:%n%s%n", new String(Base64.decode(invokeResult.getLogResult()), Charset.forName("UTF-8")));
}
if(StringUtils.isNotEmpty(invokeResult.getFunctionError())){
throw new LambdaInvokeException("Function returned error of type: " + invokeResult.getFunctionError());
}
return payload;
}
}
| [
"michael.willemse@gmail.com"
] | michael.willemse@gmail.com |
c4e1609b26e4d8f9c94fa45843c68b3915663420 | f43ef1add051d76fe84b0f69092ad305929116a5 | /autotest/Tests/src/main/java/com/tle/webtests/pageobject/wizard/RejectMessagePage.java | bfdf89892ab890e68295fc7b1eef61c4c05c1f33 | [
"Apache-2.0",
"LGPL-3.0-only",
"LicenseRef-scancode-warranty-disclaimer",
"BSD-3-Clause",
"EPL-1.0",
"LGPL-2.0-or-later",
"Classpath-exception-2.0",
"LicenseRef-scancode-jdom",
"ICU",
"Apache-1.1",
"LGPL-2.1-only",
"LicenseRef-scancode-other-permissive",
"GPL-1.0-or-later",
"CPL-1.0",
"C... | permissive | PenghaiZhang/openEQUELLA | 93d29f9dab013e2fa19a9a7ae4d71cac2c7269bb | c2da9954bd4768e785b3b2f281305c16936f4511 | refs/heads/develop | 2023-07-20T02:20:23.684651 | 2023-07-19T00:12:20 | 2023-07-19T00:12:20 | 207,188,550 | 0 | 0 | Apache-2.0 | 2020-06-17T13:08:07 | 2019-09-08T23:51:30 | Java | UTF-8 | Java | false | false | 328 | java | package com.tle.webtests.pageobject.wizard;
import com.tle.webtests.framework.PageContext;
public class RejectMessagePage extends ModerationMessagePage<RejectMessagePage> {
public RejectMessagePage(PageContext context) {
super(context);
}
@Override
public String getPfx() {
return "_tasksrejectDialog";
}
}
| [
"doolse@gmail.com"
] | doolse@gmail.com |
2882ef79ae6a7fad2d042585aea35812c4f479a3 | 07cd90d991247bfc3019cdfdb7275569c7d6b895 | /app/src/main/java/com/example/administrator/jkbd/view/QuestionAdapter.java | a390ff5e2d4c7261166366d073a71130ad82fd25 | [] | no_license | LIU8233/jkbd | 4f3c2c35c8e457be403fbb0ef6eea065e92c612c | b064c91c33e687851a3b21b529f42103c68919fa | refs/heads/master | 2020-12-10T03:20:13.335217 | 2017-07-06T13:45:45 | 2017-07-06T13:45:45 | 95,512,952 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,756 | java | package com.example.administrator.jkbd.view;
import android.content.Context;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.example.administrator.jkbd.ExamApplication;
import com.example.administrator.jkbd.R;
import com.example.administrator.jkbd.bean.Question;
import java.util.List;
/**
* Created by Administrator on 2017/7/4/004.
*/
public class QuestionAdapter extends BaseAdapter {
Context mContext;
List<Question> mquestion;
public QuestionAdapter(Context mContext) {
this.mContext = mContext;
mquestion = ExamApplication.getInstance().getMquestion();
}
@Override
public int getCount() {
return mquestion==null?0:mquestion.size();
}
@Override
public Object getItem(int position) {
return null;
}
@Override
public long getItemId(int position) {
return 0;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View view=View.inflate(mContext, R.layout.item_question,null);
TextView tvNum= (TextView) view.findViewById(R.id.tv_num);
ImageView ivQuestion= (ImageView) view.findViewById(R.id.iv_question);
String ra=mquestion.get(position).getAnswer();
String ua=mquestion.get(position).getUserAnswer();
if (ua!=null&&!ua.equals("")){
ivQuestion.setImageResource(ua.equals(ra)?
R.mipmap.answer24x24
:R.mipmap.error);
}else {
ivQuestion.setImageResource(R.mipmap.un);
}
tvNum.setText("第"+(position+1)+"题");
return view;
}
}
| [
"842616355@qq.com"
] | 842616355@qq.com |
ac41d6b42dc4602cb0967028f15350862ea95e8c | 52a13af7861617b7835d4775e60768f5965e16b2 | /src/test/practice/yhoo/PalindromString.java | cca0a61200fe699262aa1a21b8b2a9e672acf36f | [] | no_license | prashantrai/Algo_DS_InterviewPrep | e1bd831fe0c1df8c231c9c01c9802ff56033e090 | ab9986dbd7c6d59f2eb36e0c98904c0d4b8bc9e2 | refs/heads/master | 2022-10-30T07:29:28.837729 | 2022-10-26T18:44:10 | 2022-10-26T18:44:10 | 148,065,650 | 4 | 3 | null | null | null | null | UTF-8 | Java | false | false | 1,461 | java | package test.practice.yhoo;
public class PalindromString {
public static void main(String[] args) {
String s = "hannah";
String result = reverse(s);
System.out.println("==> "+result);
isPalindrom(s);
System.out.println("isPalindrom_2 => "+isPalindrom_2(s));
}
//--to verify Permutation of a palindrom
public static boolean isPalindrom_2(String s) {
int[] table = new int[Character.getNumericValue('z') - Character.getNumericValue('a')+1]; //26
int countOdd = 0; //--if countOdd is more than 1 return false
for(char c : s.toCharArray()) {
int index = getCharNumber(c);
if(index != -1) {
table[index]++;
if(table[index] % 2 == 1)
countOdd++;
else
countOdd--;
}
}
return countOdd <= 1;
}
public static int getCharNumber(char c) {
int v = Character.getNumericValue(c);
int a = Character.getNumericValue('a');
int z = Character.getNumericValue('z');
if(v >= a && v <= z) {
return v-a;
}
return -1;
}
public static void isPalindrom(String s) {
if(reverse(s).equalsIgnoreCase(s)) {
System.out.println("Palindrom");
return;
}
System.out.println("Not Palindrom");
}
private static String reverse(String string) {
System.out.println(">> "+string);
if(string.length()<=1) {
return string;
}
return string.charAt(string.length()-1) + reverse(string.substring(0, string.length()-1));
}
}
| [
"mymail.rai@gmail.com"
] | mymail.rai@gmail.com |
94d74d865626afc996083a8503d2e00c58702d55 | ef12c51c5b32518546e3068d1a336a1c440020b5 | /BJ/src/ocs/server/IndentInvoiceNumQryReturn.java | e8fe1bac8ce3df98bc243950211da864ee05da39 | [] | no_license | hbdx/BeiJing | 189cad17dee41f92cbeb83f3ab9604d6f9533ccf | c9bd4d92fc7c6e06700d1cfe5a1530571b011197 | refs/heads/master | 2016-09-11T13:11:34.622256 | 2013-12-12T23:12:27 | 2013-12-12T23:12:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,984 | java | /**
* IndentInvoiceNumQryReturn.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
*/
package ocs.server;
public class IndentInvoiceNumQryReturn implements java.io.Serializable {
private java.lang.String responseId;
private java.lang.String responseTime;
private int result;
private java.lang.String invoiceNbr;
public IndentInvoiceNumQryReturn() {
}
public IndentInvoiceNumQryReturn(
java.lang.String responseId,
java.lang.String responseTime,
int result,
java.lang.String invoiceNbr) {
this.responseId = responseId;
this.responseTime = responseTime;
this.result = result;
this.invoiceNbr = invoiceNbr;
}
/**
* Gets the responseId value for this IndentInvoiceNumQryReturn.
*
* @return responseId
*/
public java.lang.String getResponseId() {
return responseId;
}
/**
* Sets the responseId value for this IndentInvoiceNumQryReturn.
*
* @param responseId
*/
public void setResponseId(java.lang.String responseId) {
this.responseId = responseId;
}
/**
* Gets the responseTime value for this IndentInvoiceNumQryReturn.
*
* @return responseTime
*/
public java.lang.String getResponseTime() {
return responseTime;
}
/**
* Sets the responseTime value for this IndentInvoiceNumQryReturn.
*
* @param responseTime
*/
public void setResponseTime(java.lang.String responseTime) {
this.responseTime = responseTime;
}
/**
* Gets the result value for this IndentInvoiceNumQryReturn.
*
* @return result
*/
public int getResult() {
return result;
}
/**
* Sets the result value for this IndentInvoiceNumQryReturn.
*
* @param result
*/
public void setResult(int result) {
this.result = result;
}
/**
* Gets the invoiceNbr value for this IndentInvoiceNumQryReturn.
*
* @return invoiceNbr
*/
public java.lang.String getInvoiceNbr() {
return invoiceNbr;
}
/**
* Sets the invoiceNbr value for this IndentInvoiceNumQryReturn.
*
* @param invoiceNbr
*/
public void setInvoiceNbr(java.lang.String invoiceNbr) {
this.invoiceNbr = invoiceNbr;
}
private java.lang.Object __equalsCalc = null;
public synchronized boolean equals(java.lang.Object obj) {
if (!(obj instanceof IndentInvoiceNumQryReturn)) return false;
IndentInvoiceNumQryReturn other = (IndentInvoiceNumQryReturn) obj;
if (obj == null) return false;
if (this == obj) return true;
if (__equalsCalc != null) {
return (__equalsCalc == obj);
}
__equalsCalc = obj;
boolean _equals;
_equals = true &&
((this.responseId==null && other.getResponseId()==null) ||
(this.responseId!=null &&
this.responseId.equals(other.getResponseId()))) &&
((this.responseTime==null && other.getResponseTime()==null) ||
(this.responseTime!=null &&
this.responseTime.equals(other.getResponseTime()))) &&
this.result == other.getResult() &&
((this.invoiceNbr==null && other.getInvoiceNbr()==null) ||
(this.invoiceNbr!=null &&
this.invoiceNbr.equals(other.getInvoiceNbr())));
__equalsCalc = null;
return _equals;
}
private boolean __hashCodeCalc = false;
public synchronized int hashCode() {
if (__hashCodeCalc) {
return 0;
}
__hashCodeCalc = true;
int _hashCode = 1;
if (getResponseId() != null) {
_hashCode += getResponseId().hashCode();
}
if (getResponseTime() != null) {
_hashCode += getResponseTime().hashCode();
}
_hashCode += getResult();
if (getInvoiceNbr() != null) {
_hashCode += getInvoiceNbr().hashCode();
}
__hashCodeCalc = false;
return _hashCode;
}
// Type metadata
private static org.apache.axis.description.TypeDesc typeDesc =
new org.apache.axis.description.TypeDesc(IndentInvoiceNumQryReturn.class, true);
static {
typeDesc.setXmlType(new javax.xml.namespace.QName("http://server.ocs", "IndentInvoiceNumQryReturn"));
org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("responseId");
elemField.setXmlName(new javax.xml.namespace.QName("", "responseId"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("responseTime");
elemField.setXmlName(new javax.xml.namespace.QName("", "responseTime"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("result");
elemField.setXmlName(new javax.xml.namespace.QName("", "result"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int"));
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("invoiceNbr");
elemField.setXmlName(new javax.xml.namespace.QName("", "invoiceNbr"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
}
/**
* Return type metadata object
*/
public static org.apache.axis.description.TypeDesc getTypeDesc() {
return typeDesc;
}
/**
* Get Custom Serializer
*/
public static org.apache.axis.encoding.Serializer getSerializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanSerializer(
_javaType, _xmlType, typeDesc);
}
/**
* Get Custom Deserializer
*/
public static org.apache.axis.encoding.Deserializer getDeserializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanDeserializer(
_javaType, _xmlType, typeDesc);
}
}
| [
"qdlxsxj@126.com"
] | qdlxsxj@126.com |
b50fa20100685ad2f985169a2a93b43660a24cbe | cff0fb603e9ed819e9ec5f8536b07fad3ab4a123 | /testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/datasources/RemoveDatasourceOfflineTest.java | 9aa6fd6a3e42288094f3c3e5db0481bf7888b889 | [
"Apache-2.0"
] | permissive | ochaloup/creaper | d3b0e236592ce312b967fa0fad0b05d7dcaffdc3 | d0d03353b1d910cb0f35c3d7dec78aaf2d01b67f | refs/heads/master | 2020-05-29T11:42:38.594286 | 2016-09-16T09:36:05 | 2016-09-16T09:36:05 | 45,603,134 | 1 | 0 | null | 2015-11-05T10:06:19 | 2015-11-05T10:06:18 | null | UTF-8 | Java | false | false | 3,575 | java | package org.wildfly.extras.creaper.commands.datasources;
import com.google.common.base.Charsets;
import com.google.common.io.Files;
import org.custommonkey.xmlunit.XMLUnit;
import org.jboss.logging.Logger;
import org.wildfly.extras.creaper.core.CommandFailedException;
import org.wildfly.extras.creaper.core.ManagementClient;
import org.wildfly.extras.creaper.core.offline.OfflineManagementClient;
import org.wildfly.extras.creaper.core.offline.OfflineOptions;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import java.io.File;
import static org.wildfly.extras.creaper.XmlAssert.assertXmlIdentical;
import static org.junit.Assert.fail;
public class RemoveDatasourceOfflineTest {
private static final Logger log = Logger.getLogger(RemoveDatasourceOfflineTest.class);
private static final String SUBSYSTEM_ORIGINAL = ""
+ "<server xmlns=\"urn:jboss:domain:1.7\">\n"
+ " <profile>\n"
+ " <subsystem xmlns=\"urn:jboss:domain:datasources:1.2\">\n"
+ " <datasources>\n"
+ " <datasource pool-name=\"creaper-ds\" jndi-name=\"java:/jboss/datasources/creaper-ds\" enabled=\"false\">\n"
+ " <connection-url>jdbc:h2:mem:test-creaper;DB_CLOSE_DELAY=-1;</connection-url>\n"
+ " <driver>h2</driver>\n"
+ " <security>\n"
+ " <user-name>creaper</user-name>\n"
+ " <password>creaper</password>\n"
+ " </security>\n"
+ " </datasource>\n"
+ " </datasources>\n"
+ " </subsystem>\n"
+ " </profile>\n"
+ "</server>";
private static final String SUBSYSTEM_EXPECTED = ""
+ "<server xmlns=\"urn:jboss:domain:1.7\">\n"
+ " <profile>\n"
+ " <subsystem xmlns=\"urn:jboss:domain:datasources:1.2\">\n"
+ " <datasources/>\n"
+ " </subsystem>\n"
+ " </profile>\n"
+ "</server>";
@Rule
public final TemporaryFolder tmp = new TemporaryFolder();
@Before
public void setUp() {
XMLUnit.setNormalizeWhitespace(true);
}
@Test
public void transform() throws Exception {
File cfg = tmp.newFile("xmlTransform.xml");
Files.write(SUBSYSTEM_ORIGINAL, cfg, Charsets.UTF_8);
OfflineManagementClient client = ManagementClient.offline(
OfflineOptions.standalone().configurationFile(cfg).build());
assertXmlIdentical(SUBSYSTEM_ORIGINAL, Files.toString(cfg, Charsets.UTF_8));
client.apply(new RemoveDataSource("creaper-ds"));
assertXmlIdentical(SUBSYSTEM_EXPECTED, Files.toString(cfg, Charsets.UTF_8));
}
@Test(expected = CommandFailedException.class)
public void transformDsNotExists() throws Exception {
File cfg = tmp.newFile("xmlTransform.xml");
Files.write(SUBSYSTEM_ORIGINAL, cfg, Charsets.UTF_8);
OfflineManagementClient client = ManagementClient.offline(
OfflineOptions.standalone().configurationFile(cfg).build());
assertXmlIdentical(SUBSYSTEM_ORIGINAL, Files.toString(cfg, Charsets.UTF_8));
client.apply(new RemoveDataSource("creaper-ds-not-existing"));
fail("The datasource should not exist in configuration, so an exception should be thrown");
}
}
| [
"lthon@redhat.com"
] | lthon@redhat.com |
35a81f6dd78af0118bcf3f565f3985944c333757 | 45375e9eadbb6d02938cf1d4bcc3fc88b4e98aba | /app/src/main/java/com/ydhnwb/arrangeit/models/LecturerModel.java | 3f60f39abbe1d58cf8e8d8f712f1dbe749b5d793 | [] | no_license | dhiyo7/arrangeit | 5b614cd7cbe721e33a3dfbb03f079958bf10c7be | 7080c8b4fd323e412061992be6232d09b8792409 | refs/heads/master | 2020-05-25T14:34:05.971306 | 2019-05-23T23:05:37 | 2019-05-23T23:05:37 | 187,847,815 | 0 | 0 | null | 2019-05-23T23:05:38 | 2019-05-21T13:55:06 | Java | UTF-8 | Java | false | false | 2,231 | java | package com.ydhnwb.arrangeit.models;
import android.os.Parcel;
import android.os.Parcelable;
public class LecturerModel implements Parcelable {
private String key;
private String name;
private String name_idiomatic;
private String nipy;
private String email;
public LecturerModel() {
}
public LecturerModel(String key, String name, String name_idiomatic, String nipy, String email) {
this.key = key;
this.name = name;
this.name_idiomatic = name_idiomatic;
this.nipy = nipy;
this.email = email;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getName_idiomatic() {
return name_idiomatic;
}
public void setName_idiomatic(String name_idiomatic) {
this.name_idiomatic = name_idiomatic;
}
public String getNipy() {
return nipy;
}
public void setNipy(String nipy) {
this.nipy = nipy;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
protected LecturerModel(Parcel in) {
key = in.readString();
name = in.readString();
name_idiomatic = in.readString();
nipy = in.readString();
email = in.readString();
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(key);
dest.writeString(name);
dest.writeString(name_idiomatic);
dest.writeString(nipy);
dest.writeString(email);
}
@SuppressWarnings("unused")
public static final Parcelable.Creator<LecturerModel> CREATOR = new Parcelable.Creator<LecturerModel>() {
@Override
public LecturerModel createFromParcel(Parcel in) {
return new LecturerModel(in);
}
@Override
public LecturerModel[] newArray(int size) {
return new LecturerModel[size];
}
};
} | [
"yudhanewbie@gmail.com"
] | yudhanewbie@gmail.com |
c62987fabf6752649f6cace9ed88535881994214 | da2cba09140abfb5030944d0cdb2d972b4e58ee5 | /JavaWin/src/se/patterns/strategy/FillCharacter.java | 8777aa098da0d241e8f46d98db0a37714e802fd4 | [] | no_license | sebhero/Programmeringsuppgift_6 | 59a4a7628ab53982d7b036e020aff639ff931421 | 4dccf397e510db04c5c0e41317accb5a98782bca | refs/heads/master | 2021-01-10T04:55:37.148457 | 2015-12-15T08:22:35 | 2015-12-15T08:22:35 | 48,028,463 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,187 | java | package se.patterns.strategy;
import se.Color.Color;
import se.algorithms.Alphabet;
import se.mvc.model.Array7x7;
import java.util.Random;
/**
* Created by Sebastian Börebäck on 2015-12-14.
*/
public class FillCharacter implements FillAlgorithm {
Alphabet alphabet = new Alphabet();
Random rnd = new Random();
@Override
public Array7x7 fillWithOneType(int charValue) {
int[][] character = alphabet.getLetter((char) charValue);
/*
TODO fix bad code, because im reinventing the getLetter
*/
int[][] matrix = character;
for (int row = 0; row < character.length; row++) {
for (int col = 0; col < character[row].length; col++) {
switch (character[row][col]) {
case 0:
default:
matrix[row][col] = Color.TRANSPARENT;
break;
case 1:
matrix[row][col] = Color.WHITE;
break;
}
}
}
return new Array7x7(matrix);
}
@Override
public Array7x7 fillWithRandom() {
int randomChar = rnd.nextInt('Z' - 'A') + 'A'; //ascii värde 65 - 90 A-Z
// int randomChar = rnd.nextInt(90 - 65) + 65; //ascii värde 65 - 90 A-Z
int[][] character = alphabet.getLetter((char) randomChar);
/*
TODO fix bad code, because im reinventing the getLetter
*/
int[][] matrix = character;
for (int row = 0; row < character.length; row++) {
for (int col = 0; col < character[row].length; col++) {
switch (character[row][col]) {
case 0:
default:
matrix[row][col] = Color.TRANSPARENT;
break;
case 1:
matrix[row][col] = Color.WHITE;
break;
}
}
}
return new Array7x7(matrix);
}
//TODO move this out of the Algorithm
@Override
public Array7x7 fillWithInGaining() {
return null;
}
} | [
"trevligt.att.ses@gmail.com"
] | trevligt.att.ses@gmail.com |
bbc372f2433b83cacc785a80911f867dda0c40df | 6533ac46d8ba6ceeb9460af9162c167aac3ed0fd | /qs-admin-service/src/main/java/com/qishi/admin/mapper/VerifyCodeEntityMapper.java | d72413607c465a7dfd4fe6ba1090b030575bd678 | [] | no_license | xiaozi789/Wolf | 72fcbf12aaeb59520899c8b74b0531cfbd14540d | f9dbed0ad834ca522ba2aac3dc64f05554c207d2 | refs/heads/master | 2020-03-26T03:22:49.257029 | 2018-08-13T15:32:53 | 2018-08-13T15:32:53 | 144,453,246 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 571 | java | package com.qishi.admin.mapper;
import com.qishi.admin.bean.VerifyCodeBean;
import com.qishi.admin.model.VerifyCodeEntity;
import com.qishi.admin.util.MyMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@Repository
@Transactional
public interface VerifyCodeEntityMapper extends MyMapper<VerifyCodeEntity> {
List<VerifyCodeBean> queryVerifyCodeBeanByMobile(@Param("mobile") String mobile,
@Param("status") String status);
} | [
"2252524611@qq.com"
] | 2252524611@qq.com |
096e2386f3eda3f114b0ef528300c79bf96fe705 | 0008b93c9e3735286c341c861fac4e43d63d77cc | /src/com/github/aldar_najim_raymond/test/TestMergeSort.java | a26a073752c950640f905cd7d0006e76972999e4 | [] | no_license | aldar-najim-raymond/External-merge-sort | c1869cad6f995e6a26da9c42764a1efdfaa4282a | 919e033ddf98ad74feda104d7f87af2c127bdd50 | refs/heads/master | 2021-01-12T12:31:23.766760 | 2017-01-08T21:52:47 | 2017-01-08T21:52:47 | 72,526,559 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,846 | java | package com.github.aldar_najim_raymond.test;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
import com.github.aldar_najim_raymond.merge.FileCreator;
import com.github.aldar_najim_raymond.merge.MultiWayMerge;
public class TestMergeSort {
public static void main(String[] args) {
List<BigInteger> fileSizes = new ArrayList<BigInteger>();
List<Integer> memorySizes = new ArrayList<Integer>();
List<Integer> d_streams = new ArrayList<Integer>();
/*
* On what values we are testing on
*/
//fileSizes.add(new BigInteger("250"));
fileSizes.add(new BigInteger("2500"));
//fileSizes.add(new BigInteger("25000"));
//fileSizes.add(new BigInteger("250000"));
//fileSizes.add(new BigInteger("2500000"));
//fileSizes.add(new BigInteger("25000000"));
//fileSizes.add(new BigInteger("250000000"));
//memorySizes.add(100);
//memorySizes.add(1000);
//memorySizes.add(10000);
memorySizes.add(393216); // 11*32768 + 32768
//memorySizes.add(100000);
//memorySizes.add(1000000);
//memorySizes.add(10000000);
//memorySizes.add(100000000);
//d_streams.add(2);
//d_streams.add(5);
//d_streams.add(10);
//d_streams.add(11);
//d_streams.add(15);
//d_streams.add(20);
d_streams.add(30);
//d_streams.add(50);
//d_streams.add(100);
//d_streams.add(1000);
for (BigInteger fileSize : fileSizes){
// create the file
for (Integer memorySize : memorySizes){
for (Integer stream_nr : d_streams){
FileCreator.createRandomFile("mergeTest.txt", fileSize, 65536);
long before = System.nanoTime();
MultiWayMerge.startMultiWayMerge(memorySize, stream_nr, "mergeTest.txt");
long after = (System.nanoTime() - before);
System.out.println(fileSize.toString() + " " + memorySize + " " + stream_nr +
" " + after);
}
}
}
}
}
| [
"ray_lochner@yahoo.de"
] | ray_lochner@yahoo.de |
36eb8cb257b7cd48aab354d38eed4284e6ae952c | bc794d54ef1311d95d0c479962eb506180873375 | /kerenrh/kerenrh-components/core-components/core-ifaces/src/main/java/com/keren/core/ifaces/formations/BesionFormationManager.java | 728bc27f8ce7d3facea63008394c4682c5643996 | [] | no_license | Teratech2018/Teratech | d1abb0f71a797181630d581cf5600c50e40c9663 | 612f1baf9636034cfa5d33a91e44bbf3a3f0a0cb | refs/heads/master | 2021-04-28T05:31:38.081955 | 2019-04-01T08:35:34 | 2019-04-01T08:35:34 | 122,177,253 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 866 | java |
package com.keren.core.ifaces.formations;
import com.bekosoftware.genericmanagerlayer.core.ifaces.GenericManager;
import com.keren.model.formations.BesionFormation;
import com.keren.model.formations.GenererBesionFormation;
/**
* Interface etendue par les interfaces locale et remote du manager
* @since Tue Apr 10 13:14:14 GMT+01:00 2018
*
*/
public interface BesionFormationManager
extends GenericManager<BesionFormation, Long>
{
public final static String SERVICE_NAME = "BesionFormationManager";
/**
* Validation
* @param entity
* @return
*/
public BesionFormation valide(BesionFormation entity);
/**
* Generation du Besion de formation a partir
* @param entity
* @return
*/
public BesionFormation genererBF(GenererBesionFormation entity);
}
| [
"bekondo_dieu@yahoo.fr"
] | bekondo_dieu@yahoo.fr |
fbc93d30cbdd085c748e29bc2e644c2aa2c7a540 | 5e763e67e75ea671ed51623780ad0fd3e53ae957 | /BuilderPattern/src/builderpattern/Director.java | f9404e502d720f8076163df24d8ecd72d8b2efcd | [] | no_license | Serm97/PatterBuilder | d3cbfe1e6f6cdc132bf56bc5b6633c4e48e86080 | 5cc08a9d8bc7f8ad06bf409f56860cde66b0f6b8 | refs/heads/master | 2020-07-10T04:47:51.492185 | 2019-08-24T20:15:01 | 2019-08-24T20:15:01 | 204,170,968 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 304 | java | package builderpattern;
public class Director {
public Director() {
}
// --------------------------
public void construir(BuilderMessage builder) {
builder.newMessage();
builder.prepareMessage();
builder.createMessage();
builder.sendMessage();
}
}
| [
"42348894+DanielaCH2508@users.noreply.github.com"
] | 42348894+DanielaCH2508@users.noreply.github.com |
9e92635290e8cae5f35dff4fdad6bc79a0e90ef2 | acdd29ec89ed831def526d20a6503c78746577c7 | /app/src/main/java/zz/flybird/com/autoread/util/UIUtil.java | 66dddfb55934949d417f7e1531f023251d40dcd3 | [] | no_license | huangliliu0917/AutoRead | 96100fa7702cd793ef3819fe2a227966ae86889f | a9039ecbd6756a695416d19d536685ff20c8a32f | refs/heads/master | 2020-06-11T08:55:53.451186 | 2019-02-15T13:39:38 | 2019-02-15T13:39:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,227 | java | package zz.flybird.com.autoread.util;
import android.annotation.TargetApi;
import android.content.Context;
import android.graphics.Point;
import android.os.Build;
import android.view.WindowManager;
/**
*/
public class UIUtil {
@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)
public static int getScreenWidth(Context context) {
WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
Point p = new Point();
wm.getDefaultDisplay().getSize(p);
return p.x;
}
@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)
public static int getScreenHeight(Context context) {
WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
Point p = new Point();
wm.getDefaultDisplay().getSize(p);
return p.y;
}
public static int dip2px(Context context, float dpValue) {
final float scale = context.getResources().getDisplayMetrics().density;
return (int) (dpValue * scale + 0.5f);
}
public static int px2dip(Context context, float pxValue) {
final float scale = context.getResources().getDisplayMetrics().density;
return (int) (pxValue / scale + 0.5f);
}
}
| [
"729477064@qq.com"
] | 729477064@qq.com |
27f66ebcfa493d0017084e6c7fa5a3ea8e203c0a | 4ad6d796840fd77b6c1155a50bf537ae0ecb9a86 | /javaee/JavaEEAppJPA/src/main/java/com/javaeeapp/jpa/HelloApp.java | 246c7e89d14bb73f567ba3e1d44a06c580fcf849 | [] | no_license | morristech/idea-templates | e93d4676991bd1a0f33d8ee813f5cf20bb6380c1 | 25c362aaa9d7976977decf83a9f8bc2d9d94bf56 | refs/heads/master | 2020-05-05T00:35:39.586410 | 2019-03-06T07:28:52 | 2019-03-06T07:28:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 589 | java | package com.javaeeapp.jpa;
import javax.ejb.embeddable.EJBContainer;
import javax.naming.Context;
import javax.naming.NamingException;
public class HelloApp {
public static void main(String[] args) throws NamingException {
Context context = EJBContainer.createEJBContainer().getContext();
UserService userService = (UserService) context.lookup("java:global/JavaEEAppJPA/UserService");
User user = new User();
user.setName("A test user");
userService.save(user);
System.out.println(user.getName() + "'s id is " + user.getId());
}
}
| [
"andrey.cheptsov@jetbrains.com"
] | andrey.cheptsov@jetbrains.com |
32ce1c8071cf8d22fc74332d25a6268e53a3a936 | 9f90d483e1d4e898549efb84a345c7ac12b6c961 | /app/src/main/java/com/nextnut/logistica/Util/SharePickingOrder.java | 159d7a39ad3888b8cadcf2e8d68136ab072388ec | [] | no_license | PlumaBrava/Logistica | 619ed46ceaeaaafe758a309b20aba2c9e3276e6a | ff31533048176e0df48875cb3fb156ff2c1db2b4 | refs/heads/master | 2020-05-21T20:19:38.789783 | 2016-10-12T14:21:07 | 2016-10-12T14:21:07 | 60,409,362 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,961 | java | package com.nextnut.logistica.util;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import com.nextnut.logistica.R;
import com.nextnut.logistica.data.CustomOrdersColumns;
import com.nextnut.logistica.data.CustomOrdersDetailColumns;
import com.nextnut.logistica.data.LogisticaDataBase;
import com.nextnut.logistica.data.LogisticaProvider;
import com.nextnut.logistica.data.PickingOrdersDetailColumns;
import com.nextnut.logistica.data.ProductsColumns;
import com.nextnut.logistica.rest.PickingOrderProductsAdapter;
/**
* Created by perez.juan.jose on 14/09/2016.
*/
public class SharePickingOrder {
static public void sharePickingOrder(Context context, String pickingOrderID, String coment) {
Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
shareIntent.setType("text/plain");
String mensaje = "";
// String select[] = {
///* 0 */ LogisticaDataBase.PRODUCTS + "." + ProductsColumns._ID_PRODUCTO,
///* 1 */ LogisticaDataBase.PRODUCTS + "." + ProductsColumns.NOMBRE_PRODUCTO,
///* 2 */ LogisticaDataBase.CUSTOM_ORDERS + "." + CustomOrdersColumns.STATUS_CUSTOM_ORDER,
///* 3 */ LogisticaDataBase.CUSTOM_ORDERS + "." + CustomOrdersColumns.CREATION_DATE_CUSTOM_ORDER,
///* 4 */ LogisticaDataBase.CUSTOM_ORDERS_DETAIL + "." + CustomOrdersDetailColumns.PRICE_CUSTOM_ORDER_DETAIL,
///* 5 */ "sum( " + LogisticaDataBase.CUSTOM_ORDERS_DETAIL + "." + CustomOrdersDetailColumns.QUANTITY_CUSTOM_ORDER_DETAIL + " )",
///* 6 */ LogisticaDataBase.CUSTOM_ORDERS_DETAIL + "." + CustomOrdersDetailColumns.PRODUCT_NAME_CUSTOM_ORDER_DETAIL,
///* 7 */ LogisticaDataBase.PRODUCTS + "." + ProductsColumns.IMAGEN_PRODUCTO,
///* 8 */ LogisticaDataBase.PRODUCTS + "." + ProductsColumns.DESCRIPCION_PRODUCTO,
///* 9 */ LogisticaDataBase.CUSTOM_ORDERS+"."+ CustomOrdersColumns.REF_CUSTOM_CUSTOM_ORDER,
///* 10 */ "sum( " + LogisticaDataBase.PICKING_ORDERS_DETAIL+"."+ PickingOrdersDetailColumns.ID_PICKING_ORDERS_DETAIL+ " )",
///* 11 */ "sum( "+ LogisticaDataBase.PICKING_ORDERS_DETAIL+"."+ PickingOrdersDetailColumns.QUANTITY_PICKING_ORDERS_DETAIL+ " )",
///* 12 */ "count( "+ LogisticaDataBase.PICKING_ORDERS_DETAIL+"."+ PickingOrdersDetailColumns.ID_PICKING_ORDERS_DETAIL+ " )",
///* 13 */ "max( "+ LogisticaDataBase.PICKING_ORDERS_DETAIL+"."+ PickingOrdersDetailColumns.ID_PICKING_ORDERS_DETAIL+ " )"};
//
// String where = LogisticaDataBase.CUSTOM_ORDERS + "." + CustomOrdersColumns.STATUS_CUSTOM_ORDER + " = " + CustomOrderDetailFragment.STATUS_ORDER_PICKING
// + " and " + LogisticaDataBase.CUSTOM_ORDERS + "." + CustomOrdersColumns.REF_PICKING_ORDER_CUSTOM_ORDER + " = " + vh.mPickingOrderNumber.getText().toString();
String select[] = {
/* 0 */ LogisticaDataBase.PRODUCTS + "." + ProductsColumns._ID_PRODUCTO,
/* 1 */ LogisticaDataBase.PRODUCTS + "." + ProductsColumns.NOMBRE_PRODUCTO,
/* 2 */ LogisticaDataBase.PRODUCTS + "." + ProductsColumns.IMAGEN_PRODUCTO,
/* 3 */ LogisticaDataBase.PRODUCTS + "." + ProductsColumns.DESCRIPCION_PRODUCTO,
/* 4 */ "sum ( " + LogisticaDataBase.CUSTOM_ORDERS_DETAIL + "." + CustomOrdersDetailColumns.QUANTITY_CUSTOM_ORDER_DETAIL + " )",
/* 5 */ LogisticaDataBase.PICKING_ORDERS_DETAIL + "." + PickingOrdersDetailColumns.ID_PICKING_ORDERS_DETAIL,
/* 6 */ "max ( " + LogisticaDataBase.PICKING_ORDERS_DETAIL + "." + PickingOrdersDetailColumns.QUANTITY_PICKING_ORDERS_DETAIL + " )",
/* 7 */ "sum ( " + LogisticaDataBase.CUSTOM_ORDERS_DETAIL + "." + CustomOrdersDetailColumns.QUANTITY_DELIVER_CUSTOM_ORDER_DETAIL + " )",
/* 8 */ "max ( " + LogisticaDataBase.CUSTOM_ORDERS_DETAIL + "." + CustomOrdersDetailColumns.ID_CUSTOM_ORDER_DETAIL + " )"};
String where =
LogisticaDataBase.CUSTOM_ORDERS + "." + CustomOrdersColumns.REF_PICKING_ORDER_CUSTOM_ORDER + " = " + pickingOrderID;
mensaje = context.getResources().getString(R.string.PickingOrderNumber) + pickingOrderID + "\n" + "\n";
Cursor c = context.getContentResolver().query(LogisticaProvider.join_customorderDetail_Product_Customer_picking.CONTENT_URI, select, where, null, null);
if (c != null && c.moveToFirst()) {
do {
mensaje = mensaje + c.getString(PickingOrderProductsAdapter.COLUMN_NOMBRE_PRODUCTO) + ": " + c.getDouble(PickingOrderProductsAdapter.COLUMN_QTOTAL_PICKING) + "\n";
} while (c.moveToNext());
}
mensaje = mensaje + "\n" + coment + "\n";
shareIntent.putExtra(Intent.EXTRA_TEXT, mensaje);
context.startActivity(shareIntent);
}
}
| [
"perez.juan.jose@gmail.com"
] | perez.juan.jose@gmail.com |
02f402141d5f41cc777ac9d788d282804493f531 | 21bf15fb5965d20dfe9332fafe4c4681244604f0 | /Java/FlashLight/app/src/test/java/com/furkanisitan/flashlight/ExampleUnitTest.java | 7ed4349ca49db534169986010d32e5d44df97438 | [
"MIT"
] | permissive | furkanisitan/AndroidApps | d35efbe56c47eb567778efba0f54fec338a44a27 | 00c96d3dcc08811f231bdd8278588ffe3e95dd6f | refs/heads/master | 2020-03-29T17:01:56.574015 | 2020-01-24T04:12:44 | 2020-01-24T04:12:44 | 150,140,478 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 388 | java | package com.furkanisitan.flashlight;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
} | [
"furkan.isitan@bil.omu.edu.tr"
] | furkan.isitan@bil.omu.edu.tr |
01bac313db05e92618b6be51e3e8c57d18c1c6ba | 72f690bb3a393b7c069b44645d0b231c4f57c94b | /Solar System/solarSystem-android/gen/com/alec/solarsystem/BuildConfig.java | 294584f0ae89903f6a9803f1db3e592c6bdafde5 | [] | no_license | alecKarfonta/Libgdx-Projects | ec8c48d1f02c786d8149d1254c5c356e096a3620 | 9a5164ff248717a5c2a998eca6b54419ca692471 | refs/heads/master | 2021-01-02T22:39:44.230711 | 2016-10-15T19:03:24 | 2016-10-15T19:03:24 | 15,814,350 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 162 | java | /** Automatically generated file. DO NOT MODIFY */
package com.alec.solarsystem;
public final class BuildConfig {
public final static boolean DEBUG = true;
} | [
"aleckarfonta@gmail.com"
] | aleckarfonta@gmail.com |
29fc679f157810df1e145d9c0f9037dfa95b9b4d | bcf9bc88a23b39194bf6f130369b45aa627a643c | /src/main/java/com/lsz/fiveoneframework/util/StringUtil.java | e1433d49ab89dc2843591e10a8d315359344677d | [] | no_license | endlessc/fiveoneframework | c66a0ead3a5525a027700fb9aa16d84b95ec1d89 | 55187e0f63e47616583c170774477f98c0c83323 | refs/heads/master | 2021-09-04T20:44:34.745845 | 2018-01-22T08:59:30 | 2018-01-22T08:59:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 493 | java | package com.lsz.fiveoneframework.util;
import org.apache.commons.lang3.StringUtils;
/**
* author: lishengzhu
* eamil:530735771@qq.com
* date:2017/6/1
* time:17:27
*/
public final class StringUtil {
/**
* 判断是否为空
* **/
public static boolean isEmpty(String str){
if(str!=null){
str=str.trim();
}
return StringUtils.isEmpty(str);
}
public static boolean isNotEmpty(String str){
return !isEmpty(str);
}
}
| [
"530735771@qq.com"
] | 530735771@qq.com |
b6f0019b2eefc0ad89e097fc4b7d96d7fc7d5555 | 5ab7847099facc656502fb541472c684b556ccb0 | /Java_001_Value/src/com/callor/values/Values_05.java | 0534aa2c376b17d3e49765480aec494966d427f7 | [] | no_license | hooninfinity/Biz_403_2021_03_Java | 0c6626e6a2cdace5f3cae627b276c6d3e37907df | f66cd82738be7dfa6ebed0b01f2e06ab89f1363a | refs/heads/master | 2023-06-24T04:28:43.616426 | 2021-07-26T08:38:30 | 2021-07-26T08:38:30 | 348,207,344 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 744 | java | package com.callor.values;
public class Values_05 {
public static void main(String[] args) {
// 코드에서 동등연산자(==)
// 어떤 값이 같은지 물어보는 것
// 값이 같으면 결과는 true
// 값이 다르면 결과는 false
System.out.println(3 == 3);
System.out.println(4 == 3);
System.out.println(5 == 1);
System.out.println(3 > 3);
System.out.println(3 < 3);
System.out.println(4 > 3);
System.out.println(4 < 3);
System.out.println(3 >= 3);
System.out.println(3 <= 3);
System.out.println(4 >= 3);
System.out.println(4 <= 3);
// != : 값이 서로 같지 않는가?
System.out.println(3 != 3);
// System.out.println(3 <> 3);
System.out.println();
}
}
| [
"hooninfinity@naver.com"
] | hooninfinity@naver.com |
9ef3ae1972d3e19dec7f9bb2a0ab5582b635352c | a9f27173b6ca452ba0394925f89595a67cfd46cc | /app/src/main/java/com/example/snowball/MainActivity.java | 5d3062f0d020fe700b87d8bd722067499c2cb62f | [] | no_license | Lonfig/SnowBall | bbc0ee1b0df62bfcdd695cf8cfa0163bcdaa316f | e47b177e2ceef8e8775ceaaae631113bf248effd | refs/heads/master | 2023-06-04T10:17:35.626635 | 2021-06-23T11:42:03 | 2021-06-23T11:42:03 | 370,794,282 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,616 | java | package com.example.snowball;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.viewpager2.adapter.FragmentStateAdapter;
import androidx.viewpager2.widget.ViewPager2;
import android.os.Bundle;
import com.google.android.material.tabs.TabLayout;
import com.google.android.material.tabs.TabLayoutMediator;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ViewPager2 pager=(ViewPager2)findViewById(R.id.pager);
FragmentStateAdapter pageAdapter = new MyAdapter(this);
pager.setAdapter(pageAdapter);
TabLayout tabLayout = findViewById(R.id.tabs);
TabLayoutMediator tabLayoutMediator= new TabLayoutMediator(tabLayout, pager, new TabLayoutMediator.TabConfigurationStrategy(){
@Override
public void onConfigureTab(@NonNull TabLayout.Tab tab, int position) {
switch (position) {
case 0:
tab.setText("Сноуборды");
break;
case 1:
tab.setText("Лыжи");
break;
case 2:
tab.setText("Одежда");
break;
case 3:
tab.setText("Защита");
break;
}
}
});
tabLayoutMediator.attach();
}
} | [
"suprunov250302@gmail.com"
] | suprunov250302@gmail.com |
6e8689dcd6d51deb5048110b49d53eaef7c4ec33 | 34ca1f61216675c5779ba73c74ed1f8c1c603e40 | /mynlp/src/main/java/com/mayabot/nlp/segment/CharNormalize.java | 7f82031e6f617f33ca9e8ef55920fa957d95012e | [
"Apache-2.0"
] | permissive | mayabot/mynlp | d827f26f37e6ad13212a75152269ec551998fb3e | cf40957e83c23b2eafcd5e56d8019d37bcd6222d | refs/heads/master | 2023-09-05T09:25:43.459488 | 2023-06-26T06:10:04 | 2023-06-26T06:10:04 | 113,726,044 | 698 | 93 | Apache-2.0 | 2020-11-12T09:16:41 | 2017-12-10T05:35:01 | Java | UTF-8 | Java | false | false | 1,103 | java | /*
* Copyright 2018 mayabot.com authors. 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.
* 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.mayabot.nlp.segment;
/**
* 字符规范化接口
* <p>
* 分词之前可以对char进行转换。一般完成大小写、半全角、归一化转换的需求.
*
* @author jimichan
* @see com.mayabot.nlp.segment.common.DefaultCharNormalize
*/
public interface CharNormalize {
/**
* 对char数组里面的字符进行规范化操作,常见的有最小化和宽体字符处理
*
* @param text
*/
void normal(char[] text);
}
| [
"jimichan@mayabot.com"
] | jimichan@mayabot.com |
719476c8c6a6dd9e5f1619f87e83d45d99e98060 | 99b92933020406c868a6a31b276a57c4f856be2e | /src/pages/LoginPage.java | 26e5097767adb70938da02fccae61d2bf7f48ae0 | [] | no_license | jelic-strahinja/SeleniumProject | d55b9e5821f0be8f15c5dabc12b20f6810419351 | 5d10afe78cb767ae2c155d40a14f9fe81141c3c1 | refs/heads/main | 2023-03-05T14:44:25.650343 | 2021-02-16T23:01:51 | 2021-02-16T23:01:51 | 336,376,047 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,116 | java | package pages;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
public class LoginPage {
WebDriver driver;
public LoginPage(WebDriver driver) {
this.driver = driver;
}
public WebElement getSignUpBtn() {
return driver.findElement(By.className("login"));
}
public void clickSignUpBtn() {
getSignUpBtn().click();
}
public WebElement getEmailField() {
return driver.findElement(By.id("email"));
}
public void insertEmail(String email) {
getEmailField().sendKeys(email);
}
public WebElement getPasswordField() {
return driver.findElement(By.id("passwd"));
}
public void insertPassword(String password) {
getPasswordField().sendKeys(password);
}
public WebElement getLoginBtn() {
return driver.findElement(By.id("SubmitLogin"));
}
public void clickLoginBtn() {
getLoginBtn().click();
}
public WebElement getErrorMsg() {
return driver.findElement(By.xpath("//div[@class='alert alert-danger']/p"));
}
public WebElement getErrorWindow() {
return driver.findElement(By.className("alert-danger"));
}
}
| [
"strahinja.jelic1995@gmail.com"
] | strahinja.jelic1995@gmail.com |
43a40821c0d146b56229635a4a2c49b5288936cb | cac69a3a2664bd5e2262e6baa50c35792712024d | /Java/322a001/src/aima/logic/fol/Unifier.java | f65e340a523282253496f6dbbeda3b4b93608cc0 | [] | no_license | sohagHub/MyCoding | 5421b58d7bb46d618f561fab23770f4951848591 | 2b7faa2855a7073ef7f7f5ebfa9452374c400f01 | refs/heads/master | 2021-01-22T02:40:08.896457 | 2017-11-29T01:16:25 | 2017-11-29T01:16:25 | 14,320,854 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 7,297 | java | package aima.logic.fol;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import aima.logic.fol.parsing.ast.FOLNode;
import aima.logic.fol.parsing.ast.Function;
import aima.logic.fol.parsing.ast.Term;
import aima.logic.fol.parsing.ast.Variable;
/**
* Artificial Intelligence A Modern Approach (2nd Edition): Figure 9.1, page 278.
*
* <pre>
* function UNIFY(x, y, theta) returns a substitution to make x and y identical
* inputs: x, a variable, constant, list, or compound
* y, a variable, constant, list, or compound
* theta, the substitution built up so far (optional, defaults to empty)
*
* if theta = failure then return failure
* else if x = y the return theta
* else if VARIABLE?(x) then return UNIVY-VAR(x, y, theta)
* else if VARIABLE?(y) then return UNIFY-VAR(y, x, theta)
* else if COMPOUND?(x) and COMPOUND?(y) then
* return UNIFY(ARGS[x], ARGS[y], UNIFY(OP[x], OP[y], theta))
* else if LIST?(x) and LIST?(y) then
* return UNIFY(REST[x], REST[y], UNIFY(FIRST[x], FIRST[y], theta))
* else return failure
*
* -------------------------------------------------------------------------------------------------
*
* function UNIFY-VAR(var, x, theta) returns a substitution
* inputs: var, a variable
* x, any expression
* theta, the substitution built up so far
*
* if {var/val} E theta then return UNIFY(val, x, theta)
* else if {x/val} E theta then return UNIFY(var, val, theta)
* else if OCCUR-CHECK?(var, x) then return failure
* else return add {var/x} to theta
* </pre>
*
* Figure 9.1 The unification algorithm. The algorithm works by comparing the structures
* of the inputs, elements by element. The substitution theta that is the argument to UNIFY is built
* up along the way and is used to make sure that later comparisons are consistent with bindings
* that were established earlier. In a compound expression, such as F(A, B), the function OP
* picks out the function symbol F and the function ARGS picks out the argument list (A, B).
*/
/**
* @author Ravi Mohan
* @author Ciaran O'Reilly
*
*/
public class Unifier {
//
private static SubstVisitor _substVisitor = new SubstVisitor();
private static VariableCollector _variableCollector = new VariableCollector();
public Unifier() {
}
public Map<Variable, Term> unify(FOLNode x, FOLNode y) {
return unify(x, y, new LinkedHashMap<Variable, Term>());
}
/**
* <code>
* function UNIFY(x, y, theta) returns a substitution to make x and y identical
* inputs: x, a variable, constant, list, or compound
* y, a variable, constant, list, or compound
* theta, the substitution built up so far (optional, defaults to empty)
* </code>
*
* @return a Map<Variable, Term> representing the substitution (i.e. a set
* of variable/term pairs, see pg. 254 for a description) or null
* which is used to indicate a failure to unify.
*/
public Map<Variable, Term> unify(FOLNode x, FOLNode y,
Map<Variable, Term> theta) {
// if theta = failure then return failure
if (theta == null) {
return null;
} else if (x.equals(y)) {
// else if x = y the return theta
return theta;
} else if (x instanceof Variable) {
// else if VARIABLE?(x) then return UNIVY-VAR(x, y, theta)
return unifyVar((Variable) x, y, theta);
} else if (y instanceof Variable) {
// else if VARIABLE?(y) then return UNIFY-VAR(y, x, theta)
return unifyVar((Variable) y, x, theta);
} else if (isCompound(x) && isCompound(y)) {
// else if COMPOUND?(x) and COMPOUND?(y) then
// return UNIFY(ARGS[x], ARGS[y], UNIFY(OP[x], OP[y], theta))
return unify(args(x), args(y), unifyOps(op(x), op(y), theta));
} else {
// else return failure
return null;
}
}
// else if LIST?(x) and LIST?(y) then
// return UNIFY(REST[x], REST[y], UNIFY(FIRST[x], FIRST[y], theta))
public Map<Variable, Term> unify(List<? extends FOLNode> x,
List<? extends FOLNode> y,
Map<Variable, Term> theta) {
if (theta == null) {
return null;
} else if (x.size() != y.size()) {
return null;
} else if (x.size() == 0 && y.size() == 0) {
return theta;
} else if (x.size() == 1 && y.size() == 1) {
return unify(x.get(0), y.get(0), theta);
} else {
return unify(x.subList(1, x.size()), y.subList(1, y.size()), unify(
x.get(0), y.get(0), theta));
}
}
//
// PROTECTED METHODS
//
// Note: You can subclass and override this method in order
// to re-implement the OCCUR-CHECK?() to always
// return false if you want that to be the default
// behavior, as is the case with Prolog.
protected boolean occurCheck(Map<Variable, Term> theta, Variable var,
FOLNode x) {
if (x instanceof Function) {
Set<Variable> vars = _variableCollector
.collectAllVariables((Function) x);
if (vars.contains(var)) {
return true;
}
// Now need to check if cascading will cause occurs to happen
// e.g. Loves(SF1(v2),v2) and Loves(v3,SF0(v3))
for (Variable v : theta.keySet()) {
Term t = theta.get(v);
if (t instanceof Function) {
// If a possible occurs problem
// i.e. the term x contains this variable
if (vars.contains(v)) {
// then need to ensure the function this variable
// is to be replaced by does not contain var.
Set<Variable> indirectvars = _variableCollector
.collectAllVariables((Function) t);
if (indirectvars.contains(var)) {
return true;
}
}
}
}
}
return false;
}
//
// PRIVATE METHODS
//
/**
* <code>
* function UNIFY-VAR(var, x, theta) returns a substitution
* inputs: var, a variable
* x, any expression
* theta, the substitution built up so far
* </code>
*/
private Map<Variable, Term> unifyVar(Variable var, FOLNode x,
Map<Variable, Term> theta) {
if (!Term.class.isInstance(x)) {
return null;
} else if (theta.keySet().contains(var)) {
// if {var/val} E theta then return UNIFY(val, x, theta)
return unify(theta.get(var), x, theta);
} else if (theta.keySet().contains(x)) {
// else if {x/val} E theta then return UNIFY(var, val, theta)
return unify(var, theta.get(x), theta);
} else if (occurCheck(theta, var, x)) {
// else if OCCUR-CHECK?(var, x) then return failure
return null;
} else {
// else return add {var/x} to theta
cascadeSubstitution(theta, var, (Term) x);
return theta;
}
}
private Map<Variable, Term> unifyOps(String x, String y,
Map<Variable, Term> theta) {
if (theta == null) {
return null;
} else if (x.equals(y)) {
return theta;
} else {
return null;
}
}
private List<? extends FOLNode> args(FOLNode x) {
return x.getArgs();
}
private String op(FOLNode x) {
return x.getSymbolicName();
}
private boolean isCompound(FOLNode x) {
return x.isCompound();
}
// See:
// http://logic.stanford.edu/classes/cs157/2008/miscellaneous/faq.html#jump165
// for need for this.
private void cascadeSubstitution(Map<Variable, Term> theta, Variable var,
Term x) {
theta.put(var, x);
for (Variable v : theta.keySet()) {
Term t = theta.get(v);
theta.put(v, _substVisitor.subst(theta, t));
}
}
} | [
"sohag.buet.cse@gmail.com"
] | sohag.buet.cse@gmail.com |
059bd76391b35a16b0e8bd83c6ed82451ec9cc1b | 398dc952d5dff20d26d58947b7f353a6aa936cc4 | /app/src/main/java/com/rakib/moviewer/model/series/single/ExternalIds.java | 9d0d775ede6e428e40e2cdc2360216260dcd7cdd | [] | no_license | rakib10rr3/Movie-Tracker | 808ebb5caf0a96156b38efc6b20b66ec3cb9f60f | d8b2c4e297e74b98912cdf915fad66e12742ba49 | refs/heads/master | 2020-07-27T04:14:13.088655 | 2018-10-16T10:59:52 | 2018-10-16T10:59:52 | 208,863,989 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,512 | java | package com.rakib.moviewer.model.series.single;
/**
* Created by Rakib on 03/18/2018.
*/
public class ExternalIds {
private String imdb_id;
public String getImdbId() { return this.imdb_id; }
public void setImdbId(String imdb_id) { this.imdb_id = imdb_id; }
private String freebase_mid;
public String getFreebaseMid() { return this.freebase_mid; }
public void setFreebaseMid(String freebase_mid) { this.freebase_mid = freebase_mid; }
private String freebase_id;
public String getFreebaseId() { return this.freebase_id; }
public void setFreebaseId(String freebase_id) { this.freebase_id = freebase_id; }
private int tvdb_id;
public int getTvdbId() { return this.tvdb_id; }
public void setTvdbId(int tvdb_id) { this.tvdb_id = tvdb_id; }
private int tvrage_id;
public int getTvrageId() { return this.tvrage_id; }
public void setTvrageId(int tvrage_id) { this.tvrage_id = tvrage_id; }
private String facebook_id;
public String getFacebookId() { return this.facebook_id; }
public void setFacebookId(String facebook_id) { this.facebook_id = facebook_id; }
private String instagram_id;
public String getInstagramId() { return this.instagram_id; }
public void setInstagramId(String instagram_id) { this.instagram_id = instagram_id; }
private String twitter_id;
public String getTwitterId() { return this.twitter_id; }
public void setTwitterId(String twitter_id) { this.twitter_id = twitter_id; }
}
| [
"rakib10rr3@gmail.com"
] | rakib10rr3@gmail.com |
0a249199e43af4a8702ed5af56936ce51217be43 | b799734f27b1e679dc97883c2eb6fffd46aa4d67 | /src/main/java/com/fangyuzhong/intelliJ/hadoop/core/options/setting/BooleanSetting.java | 6d77705934e695b264fa027439279e3a898aea28 | [] | no_license | YUDOUFU123/Hadoop-IntelliJ-Plugin | cd095b73692212edb93c5ad5b522700b6835b23f | f936cde666a44e5f6c420f798b98ec76cd12c82a | refs/heads/master | 2022-07-20T05:55:45.446952 | 2020-05-18T16:17:22 | 2020-05-18T16:17:22 | 264,975,722 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,465 | java | package com.fangyuzhong.intelliJ.hadoop.core.options.setting;
import com.fangyuzhong.intelliJ.hadoop.core.options.PersistentConfiguration;
import org.jdom.Element;
import javax.swing.*;
/**
* 定义持久化Blooean类型的配置
* Created by fangyuzhong on 17-7-21.
*/
public class BooleanSetting
extends Setting<Boolean, JToggleButton>
implements PersistentConfiguration
{
public BooleanSetting(String name, Boolean value)
{
super(name, value);
}
@Override
public void readConfiguration(Element parent)
{
setValue(Boolean.valueOf(SettingsUtil.getBoolean(parent, getName(), ((Boolean) value()).booleanValue())));
}
public void readConfigurationAttribute(Element parent)
{
setValue(Boolean.valueOf(SettingsUtil.getBooleanAttribute(parent, getName(), ((Boolean) value()).booleanValue())));
}
@Override
public void writeConfiguration(Element parent)
{
SettingsUtil.setBoolean(parent, getName(), ((Boolean) value()).booleanValue());
}
public void writeConfigurationAttribute(Element parent)
{
SettingsUtil.setBooleanAttribute(parent, getName(), ((Boolean) value()).booleanValue());
}
public boolean to(JToggleButton checkBox)
{
return setValue(Boolean.valueOf(checkBox.isSelected()));
}
public void from(JToggleButton checkBox)
{
checkBox.setSelected(((Boolean) value()).booleanValue());
}
}
| [
"3173512086@qq.com"
] | 3173512086@qq.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.