blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
689M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
131 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
32 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
313
b42928ec57d7b557500a2e7dd945b8039d63b22f
6d1a07d068b1e9b0519a3e8d1404d81518c940b8
/jtm-match-service/src/main/java/com/jtm/mapper/JBMatchMapper.java
c5bfa4fceffcff197fa40ebcf6f38e6437568bb1
[]
no_license
Casoo7/javatv
053c51899d06e650ba93613502833c373df54634
dabecf94e2c436ebce3f071d3e5ecf251eb02cf2
refs/heads/master
2022-07-09T12:27:56.832397
2019-12-05T16:03:03
2019-12-05T16:03:03
155,838,149
0
0
null
2022-06-21T01:04:15
2018-11-02T08:44:04
Java
UTF-8
Java
false
false
2,614
java
package com.jtm.mapper; import com.jtm.dto.JBMatch; import com.jtm.dto.JBMatchExample; import org.apache.ibatis.annotations.Param; import java.util.List; public interface JBMatchMapper { /** * This method was generated by MyBatis Generator. This method corresponds to the database table jbmatch * @mbg.generated Thu Jan 31 16:25:24 CST 2019 */ long countByExample(JBMatchExample example); /** * This method was generated by MyBatis Generator. This method corresponds to the database table jbmatch * @mbg.generated Thu Jan 31 16:25:24 CST 2019 */ int deleteByExample(JBMatchExample example); /** * This method was generated by MyBatis Generator. This method corresponds to the database table jbmatch * @mbg.generated Thu Jan 31 16:25:24 CST 2019 */ int deleteByPrimaryKey(Integer matchid); /** * This method was generated by MyBatis Generator. This method corresponds to the database table jbmatch * @mbg.generated Thu Jan 31 16:25:24 CST 2019 */ int insert(JBMatch record); /** * This method was generated by MyBatis Generator. This method corresponds to the database table jbmatch * @mbg.generated Thu Jan 31 16:25:24 CST 2019 */ int insertSelective(JBMatch record); /** * This method was generated by MyBatis Generator. This method corresponds to the database table jbmatch * @mbg.generated Thu Jan 31 16:25:24 CST 2019 */ List<JBMatch> selectByExample(JBMatchExample example); /** * This method was generated by MyBatis Generator. This method corresponds to the database table jbmatch * @mbg.generated Thu Jan 31 16:25:24 CST 2019 */ JBMatch selectByPrimaryKey(Integer matchid); /** * This method was generated by MyBatis Generator. This method corresponds to the database table jbmatch * @mbg.generated Thu Jan 31 16:25:24 CST 2019 */ int updateByExampleSelective(@Param("record") JBMatch record, @Param("example") JBMatchExample example); /** * This method was generated by MyBatis Generator. This method corresponds to the database table jbmatch * @mbg.generated Thu Jan 31 16:25:24 CST 2019 */ int updateByExample(@Param("record") JBMatch record, @Param("example") JBMatchExample example); /** * This method was generated by MyBatis Generator. This method corresponds to the database table jbmatch * @mbg.generated Thu Jan 31 16:25:24 CST 2019 */ int updateByPrimaryKeySelective(JBMatch record); /** * This method was generated by MyBatis Generator. This method corresponds to the database table jbmatch * @mbg.generated Thu Jan 31 16:25:24 CST 2019 */ int updateByPrimaryKey(JBMatch record); }
[ "827969491@qq.com" ]
827969491@qq.com
e7916a7284df02c05d0d1a206b31cd2a4315e9af
a598029b19907c5f61f96c3d5bf6a14c6d1adc3c
/embl-api-core/src/main/java/uk/ac/ebi/embl/api/validation/check/feature/AntiCodonQualifierCheck.java
8d43b79f4ce0664382e3ffc92e21ea459cf726d5
[ "Apache-2.0" ]
permissive
jjkoehorst/sequencetools
c6a3f2bb1fea0fab45d620bec3acc77ca269c13c
90efded7568e5c20b364bac295e417c213ce5184
refs/heads/master
2021-01-13T08:59:10.948099
2016-09-21T14:38:33
2016-09-21T14:38:33
69,276,257
0
0
null
2016-09-26T17:47:07
2016-09-26T17:47:07
null
UTF-8
Java
false
false
5,106
java
/******************************************************************************* * Copyright 2012 EMBL-EBI, Hinxton outstation * * 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 uk.ac.ebi.embl.api.validation.check.feature; import uk.ac.ebi.embl.api.entry.Entry; import uk.ac.ebi.embl.api.entry.feature.Feature; import uk.ac.ebi.embl.api.entry.location.CompoundLocation; import uk.ac.ebi.embl.api.entry.location.Location; import uk.ac.ebi.embl.api.entry.location.RemoteLocation; import uk.ac.ebi.embl.api.entry.qualifier.AminoAcid; import uk.ac.ebi.embl.api.entry.qualifier.AnticodonQualifier; import uk.ac.ebi.embl.api.entry.qualifier.Qualifier; import uk.ac.ebi.embl.api.validation.Origin; import uk.ac.ebi.embl.api.validation.ValidationException; import uk.ac.ebi.embl.api.validation.ValidationMessage; import uk.ac.ebi.embl.api.validation.ValidationResult; import uk.ac.ebi.embl.api.validation.annotation.Description; @Description("Anticodon validation") public class AntiCodonQualifierCheck extends FeatureValidationCheck { private final static String ANTICODON_LOCATION_RANGE_MESSAGE_ID = "AntiCodonQualifierCheck_1"; private final static String ANTICODON_SEGMENT_MESSAGE_ID = "AntiCodonQualifierCheck_2"; private final static String ANTICODON_SEGMENT_START_MESSAGE_ID = "AntiCodonQualifierCheck_3"; private final static String ANTICODON_SEGMENT_END_MESSAGE_ID = "AntiCodonQualifierCheck_4"; private final static String ANTICODON_AMINO_ACID_MESSAGE_ID = "AntiCodonQualifierCheck_5"; private final static String ANTICODON_AMINO_ACID_NOT_MATCH_MESSAGE_ID = "AntiCodonQualifierCheck_6"; public AntiCodonQualifierCheck() { } public ValidationResult check(Feature feature) { result = new ValidationResult(); if (feature == null) { return result; } try { AminoAcid aminoAcid = null; Long start = null, end = null; Qualifier antiCodonQualifier = feature .getSingleQualifier(Qualifier.ANTICODON_QUALIFIER_NAME); if (antiCodonQualifier == null) { return result; } CompoundLocation<Location> featureLocation = feature.getLocations(); if(featureLocation!=null) { for(Location location : featureLocation.getLocations()) { if(location instanceof RemoteLocation) return result; } } AnticodonQualifier antiCodon = new AnticodonQualifier( antiCodonQualifier.getValue()); CompoundLocation<Location> antiCodonLocation = antiCodon.getLocations(); Long beginPosition = featureLocation.getMinPosition(); Long endPosition = featureLocation.getMaxPosition(); start = antiCodonLocation.getMinPosition(); end = antiCodonLocation.getMaxPosition(); Long anticodonLocationLength=antiCodonLocation.getLength(); aminoAcid = antiCodon.getAminoAcid(); String aminoAcidString=antiCodon.getAminoAcidString(); if (aminoAcid == null) { reportError(antiCodonQualifier.getOrigin(), ANTICODON_AMINO_ACID_MESSAGE_ID); } if(aminoAcid!=null&&aminoAcid.getAbbreviation()!=null) { if(!aminoAcid.getAbbreviation().equals(aminoAcidString)) { reportWarning(feature.getOrigin(),ANTICODON_AMINO_ACID_NOT_MATCH_MESSAGE_ID,aminoAcidString,aminoAcid.getAbbreviation()); } } if (start < beginPosition || end > endPosition) { reportError(antiCodonQualifier.getOrigin(), ANTICODON_LOCATION_RANGE_MESSAGE_ID, start, end); } if (start > end) { reportError(antiCodonQualifier.getOrigin(), ANTICODON_SEGMENT_MESSAGE_ID, start, end); } if (start == 0) { reportError(antiCodonQualifier.getOrigin(), ANTICODON_SEGMENT_START_MESSAGE_ID, start); } if (anticodonLocationLength!=3) { reportError(antiCodonQualifier.getOrigin(), ANTICODON_SEGMENT_END_MESSAGE_ID, 3); } } catch (ValidationException exception) { reportException(result, exception,feature); } return result; } private void reportException(ValidationResult result, ValidationException exception,Feature feature) { ValidationMessage<Origin> message = exception.getValidationMessage(); message.append(feature.getOrigin()); result.append(message); } }
[ "reddyk@REDDYK-W10D.windows.ebi.ac.uk" ]
reddyk@REDDYK-W10D.windows.ebi.ac.uk
27d7d1dd92bb2ac13f038fdc90e61412684df693
a0449342d068822f273a7bb3e5f2e685b8d5c6d3
/pinyougou-parent/pingyougou-manger-web/src/main/java/com/pinyougou/manger/controller/UploadController.java
b5158f4c6ab0b1f52997cf330bea0ef21117d01b
[]
no_license
liuxiutong/project
5ad08a9b506d5ae61b1d694b75f5c4a968bd720a
5dc7efbc98f865e23857605c7ef59b9bc067553f
refs/heads/master
2022-12-21T21:17:13.726090
2019-10-31T12:06:13
2019-10-31T12:06:13
218,748,860
0
0
null
2022-12-16T07:15:56
2019-10-31T11:18:19
JavaScript
UTF-8
Java
false
false
1,444
java
package com.pinyougou.manger.controller; import entity.Result; import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.multipart.MultipartFile; import util.FastDFSClient; /** * 文件上传Controller * @author Administrator * */ @RestController public class UploadController { @Value("${FILE_SERVER_URL}") private String FILE_SERVER_URL;//文件服务器地址 @RequestMapping("/upload") public Result upload(MultipartFile file) { //1、取文件的扩展名 String originalFilename = file.getOriginalFilename(); String extName = originalFilename.substring(originalFilename.lastIndexOf(".")+1); //2、创建一个 FastDFS 的客户端 try { FastDFSClient fastDFSClient = new FastDFSClient("classpath:config/fdfs_client.conf/"); //3、执行上传处理,path=group+fileId. String path = fastDFSClient.uploadFile(file.getBytes(), extName); //4、拼接返回的 url 和 ip 地址,拼装成完整的 url String url = FILE_SERVER_URL+path; System.out.println(url); return new Result(true,url); } catch (Exception e) { e.printStackTrace(); return new Result(false,"上传失败"); } } }
[ "1936224972@qq.com" ]
1936224972@qq.com
55fdaf46c82250eebb614db3ed84b488a18cc128
e4d147fcfa6f5c46c549b27fefdd5d3c45a522c4
/readerlib/src/main/java/logreader/com/estuate/RLUtils.java
93bdcca210e573099eaea3a33533b95e15e3ee3f
[]
no_license
enwidth/enMoLog-android-sdk
1ade5dc91e8da5d8c8024a5bcd1a2bf263683107
2bb5cb273162f2380b1060e9c1c10678cd567d21
refs/heads/master
2020-04-06T08:55:53.676345
2018-11-17T16:08:04
2018-11-17T16:08:04
157,322,297
0
0
null
null
null
null
UTF-8
Java
false
false
1,009
java
package logreader.com.estuate; import android.content.Context; import android.net.ConnectivityManager; import android.net.NetworkInfo; import java.sql.Date; import java.sql.Timestamp; import java.text.SimpleDateFormat; /** * Created by gourav on 21/4/17. */ public class RLUtils { public static boolean isInternetAvailable(Context context){ ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo(); return activeNetworkInfo != null && activeNetworkInfo.isConnected(); } public static String getCurrentTime(){ Timestamp timestamp = new Timestamp(System.currentTimeMillis()); Date date = new Date(timestamp.getTime()); // S is the millisecond SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MM/dd/yyyy' 'HH:mm:ss"); return simpleDateFormat.format(date); } }
[ "gouravsxn007@gmail.com" ]
gouravsxn007@gmail.com
20544e51df27d94f8d914cd162034ccf45be0489
86929eaedd380fdea1aa892dff14b1e7c22dd52d
/WorkedExample/src/WorkedExampleJFrame.java
7f7cb634676c155e2dbdf04dd507a0f50f451fbc
[]
no_license
krisw54/Java-Softwre-Development
fd8e13a8ccb402cfbb89115e067b7e080a677c3a
ddd7f04e585836c051c729d42b1f2cc7bd6512f4
refs/heads/master
2021-05-12T12:55:31.353808
2018-01-14T11:34:05
2018-01-14T11:34:05
117,424,736
0
0
null
null
null
null
UTF-8
Java
false
false
2,417
java
import java.awt.*; import java.awt.event.*; import javax.swing.*; public class WorkedExampleJFrame extends JFrame implements ActionListener { private JTextField text; private JTextArea log; private JTextField searchField; public WorkedExampleJFrame() { super("GDM's worked example"); setSize(400, 300); setLocation(200, 200); setDefaultCloseOperation(EXIT_ON_CLOSE); setupGUI(); setVisible(true); text.requestFocus(); } private void setupGUI() { setupTextField(); JScrollPane centrePanel = setupCenterPanel(); JPanel southPanel = setupSouthPanel(); getContentPane().setBackground(Color.BLACK); getContentPane().setLayout(new BorderLayout(5, 5)); getContentPane().add(text, BorderLayout.NORTH); getContentPane().add(centrePanel, BorderLayout.CENTER); getContentPane().add(southPanel, BorderLayout.SOUTH); } public void setupTextField() { Font f = new Font("Lucida Calligraphy", Font.PLAIN, 20); text = new JTextField("The cat sat on the mat"); text.setFont(f); text.setEditable(false); text.setSelectionColor(Color.YELLOW); } public JScrollPane setupCenterPanel() { log = new JTextArea("Log of searches\n"); log.setEditable(false); return new JScrollPane(log); } public JPanel setupSouthPanel() { searchField = new JTextField(10); searchField.addActionListener(this); JPanel findPanel = new JPanel(); findPanel.add(new JLabel("Search for:", JLabel.RIGHT)); findPanel.add(searchField); return findPanel; } public void actionPerformed(ActionEvent e) { if (!searchField.getText().equals("")) { int startPos = text.getText().indexOf(searchField.getText()); if (startPos > -1) { log.append("\n Found '" + searchField.getText() + "' beginning at position " + (startPos+1)); text.select(startPos, startPos+searchField.getText().length()); text.requestFocus(); } else { log.append("\n Could not find '" + searchField.getText() + "'"); } } } }
[ "krisw54@ymail.com" ]
krisw54@ymail.com
3c9e61c54578ec70a6b92a1c305555085650921a
55717fa55123a27859c5dfde03be1e2cff40a1b4
/src/test/java/com/sample/service/RestaurantServiceTest.java
ea9e419bce283a839c4682d5c6153daae7f92923
[]
no_license
ramzilearnings/springbootjavagradle_cicddemo
824fcf7370107de0dd2d8fa12569a6a3905337da
6a9c4aad8d39cd13c936fd043c823cd961680770
refs/heads/master
2022-11-05T13:07:10.034491
2020-06-30T07:17:42
2020-06-30T07:17:42
275,880,250
0
0
null
2020-06-30T07:17:43
2020-06-29T17:16:09
Java
UTF-8
Java
false
false
1,614
java
package com.sample.service; import com.sample.domain.Restaurant; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; /*** * @Author Ramzi */ public class RestaurantServiceTest { static RestaurantService r=null; @BeforeAll public static void setUp(){ r=new RestaurantService(); Restaurant r1=new Restaurant(); r1.setId(1l); r1.setName("Kritunga"); r1.setLocation("Koramangala"); r.create(r1); Restaurant r2=new Restaurant(); r2.setId(2l); r2.setName("KFC"); r2.setLocation("Koramangala"); r.create(r2); Restaurant r3=new Restaurant(); r3.setId(3l); r3.setName("A2B"); r3.setLocation("BTM"); r.create(r3); System.out.println("Inserted list before run:"+r.getAll()); } @Test public void testRun(){ assertTrue(true); } @Test public void findByIdTest(){ System.out.println("Inserted list before run:"+r.getAll()); assertEquals(r.findById(1l).getName(),"Kritunga"); //Assert.assertTrue(true); } @Test public void verifyUpdateLocation(){ Restaurant updated=new Restaurant(); updated.setId(3l); updated.setName("A2B"); updated.setLocation("CCochin1"); r.update(updated); assertEquals(r.findById(3l).getLocation(),"CCochin1"); assertEquals(r.findById(3l).getName(),"A2B"); } }
[ "ramzi@swiggy.in" ]
ramzi@swiggy.in
f6622cb9607ff7914186cecf13454e0cee5eb4be
cfae51438e486a4885bdb6ee35b986cce8a98085
/src/main/java/javase/netio/nio/NioJdkApi.java
ad7ffb31207b4892ed97378d30d5ce885c67a52a
[]
no_license
q294881866/javaDesign
08df33a0e1148001efd6b09aa34949a286c3d281
6f62cf6c662f0fe6ccc6e6e26cf6382985999090
refs/heads/master
2022-06-30T01:11:55.787924
2019-09-04T05:59:53
2019-09-04T05:59:53
77,351,069
4
3
null
2022-06-17T01:57:09
2016-12-26T01:54:50
Java
UTF-8
Java
false
false
1,959
java
package javase.netio.nio; import java.nio.channels.ByteChannel; import java.nio.channels.Channel; import java.nio.channels.Channels; import java.nio.channels.DatagramChannel; import java.nio.channels.FileChannel; import java.nio.channels.GatheringByteChannel; import java.nio.channels.InterruptibleChannel; import java.nio.channels.NetworkChannel; import java.nio.channels.Pipe; import java.nio.channels.ReadableByteChannel; import java.nio.channels.ScatteringByteChannel; import java.nio.channels.SeekableByteChannel; import java.nio.channels.SelectableChannel; import java.nio.channels.SelectionKey; import java.nio.channels.Selector; import java.nio.channels.ServerSocketChannel; import java.nio.channels.SocketChannel; import java.nio.channels.WritableByteChannel; import java.sql.Types; import java.util.Collections; import java.util.EnumMap; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.CopyOnWriteArrayList; import javase.special.enums.Color; public class NioJdkApi { public static void main(String[] args) { /* * 外部 */ Channels channels; Pipe pipe; SelectionKey key; Selector selector; /* * 抽象类 */ FileChannel channel1; SelectableChannel channel2; ServerSocketChannel channel3; SocketChannel channel4; DatagramChannel channel5; /* * 接口 */ Channel channel0; InterruptibleChannel channel6; NetworkChannel channel7; ReadableByteChannel channel8; ByteChannel channel9; SeekableByteChannel channel10; ScatteringByteChannel channel11; WritableByteChannel channel12; GatheringByteChannel channel13; } private void langApis() { Compiler compiler; System.out.println(); Thread thread; ThreadGroup group; ThreadLocal<String > local; Types type; } public void collections(){ CopyOnWriteArrayList<String> list; EnumMap<Color, String> enumMap; Collections collections; ConcurrentLinkedQueue<String> queue; } }
[ "peipengfei@youzan.com" ]
peipengfei@youzan.com
352f9d5dd632a69fecfb1c8bdbbe1d290ab9f956
471a1d9598d792c18392ca1485bbb3b29d1165c5
/jadx-MFP/src/main/java/com/shinobicontrols/charts/BarColumnSeries.java
1a80da2efe6cde8d5c7f9821198091e4cba973ad
[]
no_license
reed07/MyPreferencePal
84db3a93c114868dd3691217cc175a8675e5544f
365b42fcc5670844187ae61b8cbc02c542aa348e
refs/heads/master
2020-03-10T23:10:43.112303
2019-07-08T00:39:32
2019-07-08T00:39:32
129,635,379
2
0
null
null
null
null
UTF-8
Java
false
false
3,236
java
package com.shinobicontrols.charts; import android.graphics.drawable.Drawable; import com.shinobicontrols.charts.Axis.Orientation; import com.shinobicontrols.charts.SeriesStyle; import com.shinobicontrols.charts.SeriesStyle.FillStyle; abstract class BarColumnSeries<T extends SeriesStyle> extends CartesianSeries<T> { float a = 0.8f; BarColumnSeries() { } /* access modifiers changed from: 0000 */ public float a() { return this.a; } /* access modifiers changed from: 0000 */ public void b(float f) { synchronized (x.a) { this.a = f; } } /* access modifiers changed from: 0000 */ public void a(Axis<?, ?> axis) { if (axis.a(this.j)) { for (InternalDataPoint a2 : this.n.c) { a(a2, axis); } } } private void a(InternalDataPoint internalDataPoint, Axis<?, ?> axis) { if (axis.c == Orientation.HORIZONTAL) { internalDataPoint.c = a(internalDataPoint.a, axis); internalDataPoint.d = internalDataPoint.b; return; } internalDataPoint.d = a(internalDataPoint.b, axis); internalDataPoint.c = internalDataPoint.a; } private double a(double d, Axis<?, ?> axis) { int c = this.t.c(); int i = i(); double b = axis.j.b(); if (b == 0.0d) { b = 1.0d; } double d2 = axis.j.a; double d3 = d2 + (((axis.e - d2) * b) / b); double floatValue = ((double) (1.0f - ((Float) axis.g.b.a).floatValue())) * axis.f; double d4 = (double) c; double floatValue2 = (floatValue / d4) * ((double) (1.0f - ((Float) axis.g.a.a).floatValue())); b((float) floatValue2); return (((d3 + (d - axis.e)) + (floatValue2 / 2.0d)) - (floatValue / 2.0d)) + ((((double) ((Float) axis.g.a.a).floatValue()) * floatValue) / ((double) (c * 2))) + ((((double) i) * floatValue) / d4); } /* access modifiers changed from: 0000 */ public NumberRange a(double d, NumberRange numberRange) { if (Range.a((Range<?>) numberRange)) { return numberRange; } double d2 = d * 0.5d; return new NumberRange(Double.valueOf(numberRange.a - d2), Double.valueOf(numberRange.b + d2)); } /* access modifiers changed from: 0000 */ public NumberRange a(NumberRange numberRange) { if (Range.a((Range<?>) numberRange)) { return numberRange; } NumberRange numberRange2 = new NumberRange(Double.valueOf(numberRange.a * 1.01d), Double.valueOf(numberRange.b * 1.01d)); numberRange2.a(this.t.b((CartesianSeries<?>) this)); return numberRange2; } /* access modifiers changed from: 0000 */ public Drawable c(float f) { BarColumnSeriesStyle barColumnSeriesStyle = (BarColumnSeriesStyle) ((!isSelected() || this.r == null) ? this.q : this.r); int i = 0; int areaColor = barColumnSeriesStyle.getFillStyle() == FillStyle.NONE ? 0 : barColumnSeriesStyle.getAreaColor(); if (barColumnSeriesStyle.isLineShown()) { i = barColumnSeriesStyle.getLineColor(); } return new ba(areaColor, i, f); } }
[ "anon@ymous.email" ]
anon@ymous.email
ab94293b37a804a5c44c6b4eb4d97aec773dd04b
513b73c7f97d1c9632f7910fbe40140f349c606f
/app/src/main/java/com/example/android/waterpolo/MainActivity.java
ca759364c7bac0ea684bdd69a13163d51246f7ad
[]
no_license
NanneStephan/Waterpolo
76d9d9eafae08b3a185729102b08e34f5ce3b00d
ffd09012bb79df524e5b94e27d98ad0010727b1e
refs/heads/master
2021-09-04T06:34:11.007671
2018-01-16T19:06:38
2018-01-16T19:06:38
117,728,316
0
0
null
null
null
null
UTF-8
Java
false
false
7,767
java
package com.example.android.waterpolo; import android.app.Dialog; import android.content.SharedPreferences; import android.os.Bundle; import android.os.CountDownTimer; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; public class MainActivity extends AppCompatActivity { /** * saves Name of both Teams */ static final String lastTeamNameA = "Name1"; static final String lastTeamNameB = "Name2"; /** * saves Score of both Teams */ static final String lastScoreTeamA = "ScoreTeamA"; static final String lastScoreTeamB = "ScoreTeamB"; public int counterA; public int counterB; int teamAScore = 0; int teamBScore = 0; int TeamNameA = 0; int TeamNameB = 0; Dialog ThisDialog; TextView textViewA; TextView textViewB; /** * save current score */ @Override public void onSaveInstanceState(Bundle savedInstanceState) { savedInstanceState.putInt(lastScoreTeamA, teamAScore); savedInstanceState.putInt(lastScoreTeamB, teamBScore); savedInstanceState.putInt(lastTeamNameA, TeamNameA); savedInstanceState.putInt(lastTeamNameB, TeamNameB); super.onSaveInstanceState(savedInstanceState); } /** * restore the score */ public void onRestoreInstanceState(Bundle savedInstanceState) { super.onRestoreInstanceState(savedInstanceState); if (savedInstanceState != null) { teamAScore = savedInstanceState.getInt(lastScoreTeamA); teamBScore = savedInstanceState.getInt(lastScoreTeamB); TeamNameA = savedInstanceState.getInt(lastTeamNameA); TeamNameB = savedInstanceState.getInt(lastTeamNameB); displayForTeamA(TeamNameA); displayForTeamB(TeamNameB); scoreForTeamA(teamAScore); scoreForTeamB(teamBScore); } } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } /** * Team A 20sec timer */ public void StartTeamA(View v) { new CountDownTimer(20000, 1000) { public void onTick(long millisUntilFinished) { textViewA = findViewById(R.id.timerTeamA20sec); textViewA.setText(String.valueOf(counterA)); counterA++; } public void onFinish() { textViewA.setText("FINISH!!"); } }.start(); } /** * Team B 20sec timer */ public void StartTeamB(View v) { new CountDownTimer(20000, 1000) { public void onTick(long millisUntilFinished) { textViewB = findViewById(R.id.timerTeamB20sec); textViewB.setText(String.valueOf(counterB)); counterB++; } public void onFinish() { textViewB.setText("FINISH!!"); } }.start(); } /** * dialog */ /** * button to get dialog */ public void addTeamNames(View v) { ThisDialog = new Dialog(MainActivity.this); ThisDialog.setTitle("Title"); ThisDialog.setContentView(R.layout.dialog_team); final EditText TeamA = ThisDialog.findViewById(R.id.addTeamNameA); final EditText TeamA20sec = ThisDialog.findViewById(R.id.addTeamNameA); final EditText TeamB = ThisDialog.findViewById(R.id.addTeamNameB); final EditText TeamB20sec = ThisDialog.findViewById(R.id.addTeamNameB); Button saveDialog = ThisDialog.findViewById(R.id.saveDialog); TeamA.setEnabled(true); TeamA20sec.setEnabled(true); TeamB.setEnabled(true); TeamB20sec.setEnabled(true); saveDialog.setEnabled(true); ThisDialog.show(); } /** * save's name + add name's to TextView */ public void saveDialog(View v) { EditText addTeamA = ThisDialog.findViewById(R.id.addTeamNameA); EditText addTeamB = ThisDialog.findViewById(R.id.addTeamNameB); SharedPrefTeamA(addTeamA.getText().toString()); SharedPrefTeamB(addTeamB.getText().toString()); TextView TeamA = findViewById(R.id.TeamAEdit); TextView TeamA20sec = findViewById(R.id.TeamA20sec); TextView TeamB = findViewById(R.id.TeamBEdit); TextView TeamB20sec = findViewById(R.id.TeamB20sec); SharedPreferences TeamName = getApplicationContext().getSharedPreferences("NAME", 0); TeamA.setText(TeamName.getString("TeamA", null)); TeamA20sec.setText(TeamName.getString("TeamA", null)); TeamB.setText(TeamName.getString("TeamB", null)); TeamB20sec.setText(TeamName.getString("TeamB", null)); displayForTeamB(TeamNameB); displayForTeamA(TeamNameA); ThisDialog.cancel(); } /** * end Dialog */ /** * this method counts +1 to score */ public void add_team_B(View v) { teamBScore = teamBScore + 1; scoreForTeamB(teamBScore); } public void add_team_A(View v) { teamAScore = teamAScore + 1; scoreForTeamA(teamAScore); } /** * this method counts -1 to score */ public void remove_team_B(View v) { teamBScore = teamBScore - 1; scoreForTeamB(teamBScore); } public void remove_team_A(View v) { teamAScore = teamAScore - 1; scoreForTeamA(teamAScore); } /** * this method give's name team A */ public void displayForTeamA(int TeamNameA) { TextView TeamA = findViewById(R.id.TeamAEdit); TextView TeamA20sec = findViewById(R.id.TeamA20sec); TeamA.setText(String.valueOf(TeamNameA)); TeamA20sec.setText(String.valueOf(TeamNameA)); SharedPreferences NameView = getApplicationContext().getSharedPreferences("NAME", 0); TeamA.setText(NameView.getString("TeamA", null)); TeamA20sec.setText(NameView.getString("TeamA", null)); } public void SharedPrefTeamA(String TeamA) { SharedPreferences prefs = getApplicationContext().getSharedPreferences("NAME", 0); SharedPreferences.Editor prefEDIT = prefs.edit(); prefEDIT.putString("TeamA", TeamA); prefEDIT.commit(); } /** * this method give's score team A */ public void scoreForTeamA(int score) { TextView scoreView = findViewById(R.id.scoreTeamA); scoreView.setText(String.valueOf(score)); } /** * TeamA.setText(String.valueOf(TeamNamA)); * this method give's Name team b */ public void displayForTeamB(int TeamNameB) { TextView TeamB = findViewById(R.id.TeamBEdit); TextView TeamB20sec = findViewById(R.id.TeamB20sec); TeamB.setText(String.valueOf(TeamNameB)); TeamB20sec.setText(String.valueOf(TeamNameB)); SharedPreferences NameView = getApplicationContext().getSharedPreferences("NAME", 0); TeamB.setText(NameView.getString("TeamB", null)); TeamB20sec.setText(NameView.getString("TeamB", null)); } public void SharedPrefTeamB(String TeamB) { SharedPreferences prefs = getApplicationContext().getSharedPreferences("NAME", 0); SharedPreferences.Editor prefEDIT = prefs.edit(); prefEDIT.putString("TeamB", TeamB); prefEDIT.commit(); } /** * this method give's score team b */ public void scoreForTeamB(int score) { TextView scoreView = findViewById(R.id.scoreTeamB); scoreView.setText(String.valueOf(score)); } }
[ "nannestephan@gmail.com" ]
nannestephan@gmail.com
822b070f35413d606fddda3c98ef66414c63dce3
3ebaee3a565d5e514e5d56b44ebcee249ec1c243
/assetBank 3.77 decomplied fixed/src/java/com/bright/assetbank/custom/bgs/bean/KeywordCriteria.java
2f2b4d123b50ff6a6905c452ad37a19571b8a4cc
[]
no_license
webchannel-dev/Java-Digital-Bank
89032eec70a1ef61eccbef6f775b683087bccd63
65d4de8f2c0ce48cb1d53130e295616772829679
refs/heads/master
2021-10-08T19:10:48.971587
2017-11-07T09:51:17
2017-11-07T09:51:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,385
java
/* */ package com.bright.assetbank.custom.bgs.bean; /* */ /* */ import java.util.ArrayList; /* */ import java.util.Collection; /* */ /* */ public class KeywordCriteria /* */ { /* 29 */ private Collection<Long> m_keywordIds = new ArrayList(); /* */ private String m_relatedKeywordType; /* */ /* */ public KeywordCriteria() /* */ { /* */ } /* */ /* */ public KeywordCriteria(Collection<Long> a_keywordIds, String a_relatedKeywordType) /* */ { /* 43 */ this.m_keywordIds = a_keywordIds; /* 44 */ this.m_relatedKeywordType = a_relatedKeywordType; /* */ } /* */ /* */ public Collection<Long> getKeywordIds() /* */ { /* 49 */ return this.m_keywordIds; /* */ } /* */ /* */ public void setKeywordIds(Collection<Long> a_keywordIds) /* */ { /* 54 */ this.m_keywordIds = a_keywordIds; /* */ } /* */ /* */ public String getRelatedKeywordType() /* */ { /* 59 */ return this.m_relatedKeywordType; /* */ } /* */ /* */ public void setRelatedKeywordType(String a_relatedKeywordType) /* */ { /* 64 */ this.m_relatedKeywordType = a_relatedKeywordType; /* */ } /* */ } /* Location: C:\Users\mamatha\Desktop\com.zip * Qualified Name: com.bright.assetbank.custom.bgs.bean.KeywordCriteria * JD-Core Version: 0.6.0 */
[ "42003122+code7885@users.noreply.github.com" ]
42003122+code7885@users.noreply.github.com
6f1f0a3ef015ff539853227b40cce5b0af0f7aec
f858e3f1d17298abfe4115da6f55db7ecaaabea2
/yarn/src/main/java/org/elasticsearch/hadoop/yarn/client/ClientRpc.java
0e256a74d7a1a56f1106e34607de112289c25e61
[ "Apache-2.0" ]
permissive
venkateshk/elasticsearch-hadoop
b2d48154fe141b0428f207671888eeb7d1703f66
be51eb58cc20ef5d9d9a222c111101d521b230d7
refs/heads/master
2020-07-15T12:11:38.874533
2015-06-05T17:34:36
2015-06-05T17:34:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,238
java
/* * Licensed to Elasticsearch under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.elasticsearch.hadoop.yarn.client; import java.util.Collections; import java.util.EnumSet; import java.util.List; import java.util.Set; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.security.UserGroupInformation; import org.apache.hadoop.yarn.api.records.ApplicationId; import org.apache.hadoop.yarn.api.records.ApplicationReport; import org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext; import org.apache.hadoop.yarn.api.records.YarnApplicationState; import org.apache.hadoop.yarn.client.api.YarnClient; import org.apache.hadoop.yarn.client.api.YarnClientApplication; import org.apache.hadoop.yarn.conf.YarnConfiguration; import org.elasticsearch.hadoop.yarn.EsYarnException; import org.elasticsearch.hadoop.yarn.util.YarnUtils; public class ClientRpc implements AutoCloseable { private static final Set<String> ES_TYPE = Collections.singleton("ELASTICSEARCH"); private static final EnumSet<YarnApplicationState> ALIVE = EnumSet.range(YarnApplicationState.NEW, YarnApplicationState.RUNNING); private YarnClient client; private final Configuration cfg; public ClientRpc(Configuration cfg) { this.cfg = new YarnConfiguration(cfg); } public void start() { if (client != null) { return; } if (UserGroupInformation.isSecurityEnabled()) { UserGroupInformation.setConfiguration(cfg); } client = YarnClient.createYarnClient(); client.init(cfg); client.start(); } public YarnClientApplication newApp() { try { return client.createApplication(); } catch (Exception ex) { throw new EsYarnException(ex); } } public ApplicationId submitApp(ApplicationSubmissionContext appContext) { try { return client.submitApplication(appContext); } catch (Exception ex) { throw new EsYarnException(ex); } } public List<ApplicationReport> killEsApps() { try { List<ApplicationReport> esApps = client.getApplications(ES_TYPE, ALIVE); for (ApplicationReport appReport : esApps) { client.killApplication(appReport.getApplicationId()); } return esApps; } catch (Exception ex) { throw new EsYarnException(ex); } } public void killApp(String appId) { try { client.killApplication(YarnUtils.createAppIdFrom(appId)); } catch (Exception ex) { throw new EsYarnException(ex); } } public ApplicationReport getReport(ApplicationId appId) { try { return client.getApplicationReport(appId); } catch (Exception ex) { throw new EsYarnException(ex); } } public List<ApplicationReport> listApps() { try { return client.getApplications(); } catch (Exception ex) { throw new EsYarnException(ex); } } public List<ApplicationReport> listEsClusters() { try { return client.getApplications(ES_TYPE); } catch (Exception ex) { throw new EsYarnException(ex); } } public List<ApplicationReport> listEsClustersAlive() { try { return client.getApplications(ES_TYPE, ALIVE); } catch (Exception ex) { throw new EsYarnException(ex); } } public void waitForApp(ApplicationId appId, long timeout) { boolean repeat = false; long start = System.currentTimeMillis(); do { try { ApplicationReport appReport = client.getApplicationReport(appId); YarnApplicationState appState = appReport.getYarnApplicationState(); repeat = (appState != YarnApplicationState.FINISHED && appState != YarnApplicationState.KILLED && appState != YarnApplicationState.FAILED); if (repeat) { Thread.sleep(500); } } catch (Exception ex) { throw new EsYarnException(ex); } } while (repeat && (System.currentTimeMillis() - start) < timeout); } @Override public void close() { if (client != null) { client.stop(); client = null; } } public Configuration getConfiguration() { return cfg; } }
[ "costin.leau@gmail.com" ]
costin.leau@gmail.com
505d86c0fcc7440ec497479139fd8f62cbd32321
2edbc7267d9a2431ee3b58fc19c4ec4eef900655
/AL-Game/src/com/aionemu/gameserver/services/siegeservice/ArtifactAssault.java
14308d80cce9807f51727dde34228e9aae94382a
[]
no_license
EmuZONE/Aion-Lightning-5.1
3c93b8bc5e63fd9205446c52be9b324193695089
f4cfc45f6aa66dfbfdaa6c0f140b1861bdcd13c5
refs/heads/master
2020-03-08T14:38:42.579437
2018-04-06T04:18:19
2018-04-06T04:18:19
128,191,634
1
1
null
null
null
null
UTF-8
Java
false
false
285
java
package com.aionemu.gameserver.services.siegeservice; public class ArtifactAssault extends Assault<ArtifactSiege> { public ArtifactAssault(ArtifactSiege siege) { super(siege); } public void scheduleAssault(int delay) { } public void onAssaultFinish(boolean captured) { } }
[ "naxdevil@gmail.com" ]
naxdevil@gmail.com
3b80fc9a4e8e206f13272e55c956b3f28b44efaa
805329f9cea74b671ccae68b8dd9472aa5c54304
/src/main/java/pl/akademiakodu/demorepo/DemorepoApplication.java
44567bd3c222e03cc9135eebd397c8f601053b57
[]
no_license
pawellewarski/demo-Hibernate-repo
0462e2a92feca58243ff1ec874d47445f9cebc69
ab2fa3d4f4010994c8dcb23d5cc9e099a2eba1a3
refs/heads/master
2020-04-01T04:45:25.981334
2018-10-14T10:16:15
2018-10-14T10:16:15
152,876,169
0
0
null
null
null
null
UTF-8
Java
false
false
660
java
package pl.akademiakodu.demorepo; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.domain.EntityScan; import org.springframework.data.jpa.convert.threeten.Jsr310JpaConverters; // Dzięki JSR310 JPa jest w stanie przekonwertwać czas podany w bazie na nowoczesną klasę LocalTime @EntityScan( basePackageClasses = {DemorepoApplication.class, Jsr310JpaConverters.class} ) @SpringBootApplication public class DemorepoApplication { public static void main(String[] args) { SpringApplication.run(DemorepoApplication.class, args); } }
[ "pawellewarski@gmail.com" ]
pawellewarski@gmail.com
1c200a2edcd90f9351aa862cb80ba1373c28f527
52ed3438a1130809a3d8629e2b9b9781681af8db
/src/main/java/org/broadinstitute/hellbender/tools/copynumber/formats/CopyNumberStandardArgument.java
47aec4eef7a9402b27a7ce828233e4ca961af16d
[ "BSD-3-Clause", "LicenseRef-scancode-unknown-license-reference" ]
permissive
jmchung/gatk
795ff21a6c2ea02f1f4df203c703604f960e42fe
b2a5e8cdce8b827b9c66abaeae8a954c55e45d3e
refs/heads/master
2021-07-22T03:23:42.300892
2017-10-30T17:40:33
2017-10-30T17:40:33
108,968,823
1
0
null
2017-10-31T08:47:28
2017-10-31T08:47:28
null
UTF-8
Java
false
false
1,610
java
package org.broadinstitute.hellbender.tools.copynumber.formats; public final class CopyNumberStandardArgument { public static final String ANNOTATED_INTERVALS_FILE_LONG_NAME = "annotatedIntervals"; public static final String ANNOTATED_INTERVALS_FILE_SHORT_NAME = "annot"; public static final String READ_COUNT_PANEL_OF_NORMALS_FILE_LONG_NAME = "readCountPanelOfNormals"; public static final String READ_COUNT_PANEL_OF_NORMALS_FILE_SHORT_NAME = "rcPON"; public static final String NUMBER_OF_EIGENSAMPLES_LONG_NAME = "numberOfEigensamples"; public static final String NUMBER_OF_EIGENSAMPLES_SHORT_NAME = "numEigen"; public static final String STANDARDIZED_COPY_RATIOS_FILE_LONG_NAME = "standardizedCopyRatios"; public static final String STANDARDIZED_COPY_RATIOS_FILE_SHORT_NAME = "standardizedCR"; public static final String DENOISED_COPY_RATIOS_FILE_LONG_NAME = "denoisedCopyRatios"; public static final String DENOISED_COPY_RATIOS_FILE_SHORT_NAME = "denoisedCR"; public static final String ALLELIC_COUNTS_FILE_LONG_NAME = "allelicCounts"; public static final String ALLELIC_COUNTS_FILE_SHORT_NAME = "AC"; public static final String NORMAL_ALLELIC_COUNTS_FILE_LONG_NAME = "normalAllelicCounts"; public static final String NORMAL_ALLELIC_COUNTS_FILE_SHORT_NAME = "normalAC"; public static final String SEGMENTS_FILE_LONG_NAME = "segments"; public static final String SEGMENTS_FILE_SHORT_NAME = "S"; public static final String OUTPUT_PREFIX_LONG_NAME = "outputPrefix"; public static final String OUTPUT_PREFIX_SHORT_NAME = "pre"; }
[ "noreply@github.com" ]
jmchung.noreply@github.com
7b01a394744d22eeb8134b73fafc5fae2908c0ee
9debc908696800fb99f2c3301c627441d2d3474f
/Person.java
fc6cd95d7b26cd5acb6fddd1adaba12a08ae2322
[]
no_license
NadiaBotha/Task24-Lvl2-Capstone3
9def8754e967c1d6fd98e07c65c2b0caebc92092
7250f83878f5a73c784dd89aea8c16b4b90d7589
refs/heads/main
2023-02-12T16:22:34.911100
2021-01-13T08:34:58
2021-01-13T08:34:58
329,232,792
0
0
null
null
null
null
UTF-8
Java
false
false
5,479
java
/** * This method is used as a user defined object called Person. * <p> * Fields for this object include, name, number, email address and person type (architect, contractor, customer). * * @author Nadia Botha * @version 1.0 * */ public class Person { /** * String value for the Person object name and surname. */ private String personName; /** * String value for the Person object telephone number. */ private String telephoneNumber; /** * String value for the Person object email address. */ private String emailAddress; /** * String value for the Person object physical address. */ private String physicalAddress; /** * String value for the Person object type(architect,contractor,customer). */ private String personType; /** * Main constructor for this class with all parameters. * * @param personName String for person name and surname. * @param telephoneNumber String containing digits for person telephone number. * @param emailAddress String for person email address. * @param physicalAddress String for person physical address. * @param personType String for person type (architect,contractor,customer) */ public Person(String personName, String telephoneNumber, String emailAddress, String physicalAddress, String personType){ this.personName = personName; this.telephoneNumber = telephoneNumber; this.emailAddress = emailAddress; this.physicalAddress = physicalAddress; this.personType = personType; } /** * This is the second constructor which excludes the person type field. * * @param personName String for person name and surname. * @param telephoneNumber String containing digits for person telephone number. * @param emailAddress String for person email address. * @param physicalAddress String for person physical address. */ public Person(String personName, String telephoneNumber, String emailAddress, String physicalAddress){ this.personName = personName; this.telephoneNumber = telephoneNumber; this.emailAddress = emailAddress; this.physicalAddress = physicalAddress; } /** * This is the third constructor which has no parameters. * */ public Person(){ } /** * This method displays Person object fields in a readable manner. * @return returns a String which displays person details in a readable manner. */ public String toString(){ String output = "Name: " + this.personName; output += "\nTelephone Number: " + this.telephoneNumber; output += "\nEmail Address: " + this.emailAddress; output += "\nPhysical Address: " + this.physicalAddress; return output; } /** * This method obtains a specific Person object's name. * * @return returns a String for the person name and surname. */ public String getPersonName(){ return this.personName; } /** * This method obtains a specific Person object's number. * * @return returns a String for the person's telephone number. */ public String getTelephoneNumber(){ return this.telephoneNumber; } /** * This method obtains a specific Person object's email address. * * @return returns a String for the person's email address. */ public String getEmailAddress(){ return this.emailAddress; } /** * This method obtains a specific Person object's physical address. * * @return returns a String for the person's physical address. */ public String getPhysicalAddress(){ return this.physicalAddress; } /** * This method obtains a specific Person object's person type. * * @return returns a String for the person's type. */ public String getPersonType(){ return this.personType; } /** * This method sets the field personName to the String value passed as a parameter. * * @param personName String for person name and surname. */ public void setPersonName(String personName){ this.personName = personName; } /** * This method sets the field telephoneNumber to the String value passed as a parameter. * * @param telephoneNumber String containing digits for person telephone number. */ public void setPersonNumber(String telephoneNumber){ this.telephoneNumber = telephoneNumber; } /** * This method sets the field emailAddress to the String value passed as a parameter. * * @param emailAddress String for person email address. */ public void setPersonEmailAddress(String emailAddress){ this.emailAddress = emailAddress; } /** * This method sets the field physicalAddress to the String value passed as a parameter. * * @param physicalAddress String for person physical address. */ public void setPersonPhysicalAddress(String physicalAddress){ this.physicalAddress = physicalAddress; } /* public void setPersonType(String personType){ this.personType = personType; }*/ }
[ "noreply@github.com" ]
NadiaBotha.noreply@github.com
f7ec7b4aa348a19d5708d923e939db0a6d73dc08
5f7c7ddbdfa4e84feec66062347a7ecda491819e
/binaryTree/inorderSuccessor.java
0c953401cf2b85af40098fab3f57e18bcb23e7ff
[]
no_license
smartbook1982/myShuati1
fc42c5fb01daf31de66c4ffbbda9cfa7d0ff00e7
71866ef6ae8d3c1731086cb696b3d2150b47eda2
refs/heads/master
2022-06-01T22:03:21.004610
2022-04-17T15:29:54
2022-04-17T15:29:54
476,460,596
0
0
null
null
null
null
UTF-8
Java
false
false
2,432
java
/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */ class Solution { public TreeNode inorderSuccessor(TreeNode root, TreeNode p) { if (p == null || root == null) return null; TreeNode res = null; TreeNode curr = root; while(curr != null) { if (curr.val <= p.val) {//if equal go to the right to find the larger node curr = curr.right; } else { // if (res == null || res.val - p.val > curr.val - p.val) { //res.val will always be larger than p.val // // actually don't need this condition, since it's always trying to find the closest one // res = curr; // } res = curr; curr = curr.left; } } return res; // switch the left and right will find the predecessor } public TreeNode successor(TreeNode root, TreeNode p) { if (root == null) return null; if (root.val <= p.val) { return successor(root.right, p); } else { TreeNode left = successor(root.left, p); return (left != null) ? left : root; } } public TreeNode predecessor(TreeNode root, TreeNode p) { if (root == null) return null; if (root.val >= p.val) { return predecessor(root.left, p); } else { TreeNode right = predecessor(root.right, p); return (right != null) ? right : root; } } //Followup if there is a parent node // 2. TreeNode有parent引用: // // Pseudocode // if n has a right subtree // return leftmost child of right subtree // else // while n is a right child of n.parent // n = n.parent // go northwest till end // return n.parent // return 1st northeast node public TreeNode inOrderSuccessor(TreeNode n) { if (n == null) return null; if (n.right != null) return leftMostChild(n.right); else { TreeNode cur = n, p = n.parent; while (p != null && p.left != cur) { cur = p; p = p.parent; } return p; } } private TreeNode leftMostChild(TreeNode node) { while (node.left != null) node = node.left; return node; } }
[ "407764776@qq.com" ]
407764776@qq.com
8f024ce2895c15103e056e7ddeed0ba4f256b5a3
1285ee838dcc642055171c5facacd617532326c1
/HIbernate/Hibernate-Annotation/src/org/company/hibernate/employee/ManageEmployee.java
2829ffbbd56a1963ddf8b5a75435b738e470280f
[]
no_license
chandrakishore314/Algorithms
89d9b4ff596881f277fcbd75f76af4efd7cde9fb
52334c62c3f7572f2d609de8fe80cb60c053cb23
refs/heads/master
2023-04-04T03:47:47.121427
2021-03-29T09:04:16
2021-03-29T09:04:16
197,759,058
0
0
null
null
null
null
UTF-8
Java
false
false
1,209
java
package org.company.hibernate.employee; import org.hibernate.HibernateException; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.Transaction; import org.hibernate.cfg.Configuration; public class ManageEmployee { private static SessionFactory factory; public static void main(String[] args) { try { factory = new Configuration().configure().buildSessionFactory(); System.out.println("facytory retuened"); } catch (Throwable ex) { System.err.println("Failed to create sessionFactory object." + ex); } ManageEmployee ME = new ManageEmployee(); int num = ME.addEmployee("chandra", "Kishore", 200); System.out.println(num + " number value "); } private Integer addEmployee(String fname, String lname, int salary) { Session session = factory.openSession(); Transaction tx = null; Integer employeeID = null; try { tx = session.beginTransaction(); Employee employee = new Employee(fname, lname, salary); employeeID = (Integer) session.save(employee); tx.commit(); } catch (HibernateException e) { if (tx != null) tx.rollback(); e.printStackTrace(); } finally { session.close(); } return employeeID; } }
[ "chandrakishore314@gmail.com" ]
chandrakishore314@gmail.com
f87db395c3d686dae53da864684dc3ea270b3937
2d73af9a01f7348bedf39df9f3ce448ff28e6687
/OpenATKLib/src/main/java/com/openatk/openatklib/atkmap/ATKSupportMapFragment.java
611d23bd19d6756bc4a814f9e2956c2621dbc716
[ "MIT" ]
permissive
OpenATK/Field-Work
01cc6b49ed982d4a8c0eecf86857e81f3e300fd3
69ca0bce55be06228654750e5f9d58268ef993c8
refs/heads/master
2021-01-18T23:22:05.842049
2016-06-14T17:09:21
2016-06-14T17:09:21
16,749,433
2
0
null
null
null
null
UTF-8
Java
false
false
3,369
java
package com.openatk.openatklib.atkmap; import android.content.IntentFilter; import android.os.Bundle; import android.support.v4.content.LocalBroadcastManager; import android.util.Log; import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import com.google.android.gms.maps.SupportMapFragment; import com.openatk.openatklib.atkmap.listeners.ATKTouchableWrapperListener; public class ATKSupportMapFragment extends SupportMapFragment { public View mOriginalContentView; public ATKTouchableWrapper mTouchView; private ATKMap map = null; private boolean retained = false; @Override public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) { mOriginalContentView = super.onCreateView(inflater, parent, savedInstanceState); Log.d("atkSupportMapFragment", "onCreateView()"); //LayoutInflater vi = (LayoutInflater) this.getActivity().getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); //View v = vi.inflate(R.layout.pan_button, null); mTouchView = new ATKTouchableWrapper(getActivity()); mTouchView.addView(mOriginalContentView); //mTouchView.addView(v); //Add listeners for clicks on the map //mTouchView.addListener(new panListener(v)); if(this.map == null){ Log.d("atkSupportMapFragment - onCreateView()", "New atkmap"); //This is what makes it all save since retain instancestate is true //Views are recreated but objects are not this.map = new ATKMap(this.getMap(), this.getActivity().getApplicationContext()); } else { Log.d("atkSupportMapFragment - onCreateView()", "Reused atkmap"); retained = true; } mTouchView.addListener(this.map); //Let the atkMap listen for touch events return mTouchView; } public boolean getRetained(){ return this.retained; } public ATKMap getAtkMap(){ return this.map; } @Override public View getView() { return mOriginalContentView; } private class panListener implements ATKTouchableWrapperListener { private View panButton; public panListener(View panButton){ this.panButton = panButton; } @Override public boolean onTouch(MotionEvent event) { Log.d("atkTouchableWrapper", "dispatchTouchEvent"); Log.d("atkTouchableWrapper", "event X:" + Float.toString(event.getX()) + " event Y:" + Float.toString(event.getY()) ); Log.d("atkTouchableWrapper", "pic X:" + Integer.toString(this.panButton.getLeft()) + " pic Y:" + Integer.toString(this.panButton.getTop()) ); Log.d("atkTouchableWrapper", "pic wdith:" + Integer.toString(this.panButton.getWidth()) + " pic height:" + Integer.toString(this.panButton.getHeight()) ); //TODO Density stuff float panX = 0.0f; float panY = 0.0f; float panWidth = 0.0f; float panHeight = 0.0f; if(panX < event.getX() && (panX + panWidth) > event.getX()){ Log.d("atkTouchableWrapper", "X good"); if(panY < event.getY() && (panY + panHeight) > event.getY()){ Log.d("atkTouchableWrapper", "Y good"); //return true; } } switch (event.getAction()) { case MotionEvent.ACTION_DOWN: break; case MotionEvent.ACTION_UP: break; } return false; } } }
[ "cyrusbow@gmail.com" ]
cyrusbow@gmail.com
c51593a051a1037bc41b170204fed8d313fabc4e
0434fcbd08add10c838082aa6344b9881c68491f
/src/ReorderList143.java
fd01fc3066458083c6be1cc47c59fe823134ecb7
[]
no_license
SesameSeaweed/lc2017
114f5366988cbed2e8cf01606fd9bf4e4bef08c0
885d38586eecfaddb532e92f8efc23296216055c
refs/heads/master
2021-01-25T04:34:50.370083
2017-09-25T21:59:21
2017-09-25T21:59:21
93,447,000
0
0
null
null
null
null
UTF-8
Java
false
false
1,897
java
public class ReorderList143 { private static class ListNode { int val; ListNode next; ListNode(int x) { val = x; } } public static void reorderList(ListNode head) { int count = 0; ListNode curr = head; while (curr != null) { count++; curr = curr.next; } boolean odd = count%2 == 1 ? true : false; curr = head; count = odd ? (count-1) : count; count /= 2; while(count > 0) { count--; curr = curr.next; } ListNode reverseHead = reverse(curr); curr = head; while(reverseHead != null && reverseHead.next != null) { ListNode next = curr.next; ListNode reverseNext = reverseHead.next; curr.next = reverseHead; reverseHead.next = next; curr = curr.next.next; reverseHead = reverseNext; } if(odd) reverseHead.next = curr; else { curr.next = reverseHead; curr = curr.next; } curr.next = null; return; } private static ListNode reverse(ListNode head) { ListNode prev = null; ListNode curr = head; while(curr != null) { ListNode next = curr.next; curr.next = prev; prev = curr; curr = next; } return prev; } public static void main(String[] args) { ListNode l1 = new ListNode(1); ListNode l2 = new ListNode(2); ListNode l3 = new ListNode(3); ListNode l4 = new ListNode(4); ListNode l5 = new ListNode(5); l1.next = l2; l2.next = l3; l3.next = l4; l4.next = l5; reorderList(l1); while(l1 != null) { System.out.println(l1.val); l1 = l1.next; } } }
[ "pxu@akamai.com" ]
pxu@akamai.com
aa0d6a92486f598f309582148f7833dd51605d6b
35407ee2b47e94358a274c396a8854de5a95cdf7
/src/no/hvl/dat107/DAO/AvdelingDAO.java
c022260fdd84f23a9bfd66260482367f5a631429
[]
no_license
h586625/DAT107-Oblig3
ca1a2fe36f9d8f502ff1982d9fb5eab3efadd4a9
b25b339b0e235b848b4d7d55456a41129ea897c4
refs/heads/master
2022-04-20T23:46:05.859081
2020-04-20T21:31:02
2020-04-20T21:31:02
256,045,003
0
0
null
null
null
null
UTF-8
Java
false
false
1,837
java
package no.hvl.dat107.DAO; import java.util.List; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; import javax.persistence.EntityTransaction; import javax.persistence.Persistence; import javax.persistence.TypedQuery; import no.hvl.dat107.entity.Ansatt; import no.hvl.dat107.entity.Avdeling; public class AvdelingDAO { private EntityManagerFactory emf = Persistence.createEntityManagerFactory("firmaPersistenceUnit"); public Avdeling finnAvdelingMedId(int id) { EntityManager em = emf.createEntityManager(); Avdeling a = null; try { a = em.find(Avdeling.class, id); } finally { em.close(); } return a; } public List<Avdeling> finnAlleAvdelinger() { EntityManager em = emf.createEntityManager(); try { TypedQuery<Avdeling> query = em.createQuery("SELECT a from Avdeling a", Avdeling.class); return query.getResultList(); } finally { em.close(); } } public List<Ansatt> finnAlleAnsatteForAvdeling() { EntityManager em = emf.createEntityManager(); try { TypedQuery<Ansatt> query = em.createQuery("SELECT a from Avdeling a", Ansatt.class); return query.getResultList(); } finally { em.close(); } } public void LagNyAvdeling(Avdeling avdeling) { EntityManager em = emf.createEntityManager(); EntityTransaction tx = em.getTransaction(); try { tx.begin(); em.persist(avdeling); tx.commit(); } catch (Exception e) { e.printStackTrace(); if (tx.isActive()) { tx.rollback(); } } finally { em.close(); } } }
[ "586625@stud.hvl.no" ]
586625@stud.hvl.no
438029e1184d8b9a1e8d202e1e41f128d44900a5
b3a694913d943bdb565fbf828d6ab8a08dd7dd12
/sources/p213q/p217b/p218a/p231b/p262i/p264c/C3201b.java
1b906362e73fb64a87e262df1f748b281baaa795
[]
no_license
v1ckxy/radar-covid
feea41283bde8a0b37fbc9132c9fa5df40d76cc4
8acb96f8ccd979f03db3c6dbfdf162d66ad6ac5a
refs/heads/master
2022-12-06T11:29:19.567919
2020-08-29T08:00:19
2020-08-29T08:00:19
294,198,796
1
0
null
2020-09-09T18:39:43
2020-09-09T18:39:43
null
UTF-8
Java
false
false
108
java
package p213q.p217b.p218a.p231b.p262i.p264c; /* renamed from: q.b.a.b.i.c.b */ public interface C3201b { }
[ "josemmoya@outlook.com" ]
josemmoya@outlook.com
c9c51d8471ad8e94950043a7eddff024dcb621c4
26b7f30c6640b8017a06786e4a2414ad8a4d71dd
/src/number_of_direct_superinterfaces/i45087.java
a296bea147c45416ff67d83df5696a20f13a6d7f
[]
no_license
vincentclee/jvm-limits
b72a2f2dcc18caa458f1e77924221d585f23316b
2fd1c26d1f7984ea8163bc103ad14b6d72282281
refs/heads/master
2020-05-18T11:18:41.711400
2014-09-14T04:25:18
2014-09-14T04:25:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
69
java
package number_of_direct_superinterfaces; public interface i45087 {}
[ "vincentlee.dolbydigital@yahoo.com" ]
vincentlee.dolbydigital@yahoo.com
1336dc4777967bfea13c1688826959f090327365
6a922e840b33f11ab3d0f154afa0b33cff272676
/src/xlsx4j/java/org/xlsx4j/sml/STGrowShrinkType.java
ccf6c050bc5401004e0563e23ed0cc337637a9ae
[ "Apache-2.0" ]
permissive
baochanghong/docx4j
912fc146cb5605e6f7869c4839379a83a8b4afd8
4c83d8999c9396067dd583b82a6fc892469a3919
refs/heads/master
2021-01-12T15:30:26.971311
2016-10-20T00:44:25
2016-10-20T00:44:25
71,792,895
3
0
null
2016-10-24T13:39:57
2016-10-24T13:39:57
null
UTF-8
Java
false
false
2,095
java
/* * Copyright 2010-2013, Plutext Pty Ltd. * * This file is part of xlsx4j, a component of docx4j. docx4j is 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.xlsx4j.sml; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for ST_GrowShrinkType. * * <p>The following schema fragment specifies the expected content contained within this class. * <p> * <pre> * &lt;simpleType name="ST_GrowShrinkType"> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;enumeration value="insertDelete"/> * &lt;enumeration value="insertClear"/> * &lt;enumeration value="overwriteClear"/> * &lt;/restriction> * &lt;/simpleType> * </pre> * */ @XmlType(name = "ST_GrowShrinkType") @XmlEnum public enum STGrowShrinkType { @XmlEnumValue("insertDelete") INSERT_DELETE("insertDelete"), @XmlEnumValue("insertClear") INSERT_CLEAR("insertClear"), @XmlEnumValue("overwriteClear") OVERWRITE_CLEAR("overwriteClear"); private final String value; STGrowShrinkType(String v) { value = v; } public String value() { return value; } public static STGrowShrinkType fromValue(String v) { for (STGrowShrinkType c: STGrowShrinkType.values()) { if (c.value.equals(v)) { return c; } } throw new IllegalArgumentException(v); } }
[ "jason@plutext.org" ]
jason@plutext.org
8c19f5f8cb4781e37b15891eaa7996ac2d06c19b
d7fb9c6bbbee9f305c448862e97578f9146e595f
/src/main/java/com/yrra/bookstore/service/impl/OrderServiceImpl.java
d642659cfd72505d515181163404ad6bbfd8d0d5
[]
no_license
ayrra/Spring-Store
e54c0659d297873f9e1c3935cd05ff16ddbf01be
cd8a3b251d635e82566a21c827cc0c07f09514c2
refs/heads/master
2021-09-04T04:48:50.219939
2018-01-16T01:34:16
2018-01-16T01:34:16
113,271,289
0
0
null
null
null
null
UTF-8
Java
false
false
1,996
java
package com.yrra.bookstore.service.impl; import java.util.Calendar; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.yrra.bookstore.domain.BillingAddress; import com.yrra.bookstore.domain.Book; import com.yrra.bookstore.domain.CartItem; import com.yrra.bookstore.domain.Order; import com.yrra.bookstore.domain.Payment; import com.yrra.bookstore.domain.ShippingAddress; import com.yrra.bookstore.domain.ShoppingCart; import com.yrra.bookstore.domain.User; import com.yrra.bookstore.repository.OrderRepository; import com.yrra.bookstore.service.CartItemService; import com.yrra.bookstore.service.OrderService; @Service public class OrderServiceImpl implements OrderService { @Autowired private OrderRepository orderRepository; @Autowired private CartItemService cartItemService; @Override public synchronized Order createOrder(ShoppingCart shoppingCart, ShippingAddress shippingAddress, BillingAddress billingAddress, Payment payment, String shippingMethod, User user) { Order order = new Order(); order.setBillingAddress(billingAddress); order.setOrderStatus("created"); order.setPayment(payment); order.setShippingAddress(shippingAddress); order.setShippingMethod(shippingMethod); List<CartItem> cartItemList = cartItemService.findByShoppingCart(shoppingCart); for (CartItem cartItem : cartItemList) { Book book = cartItem.getBook(); cartItem.setOrder(order); book.setInStockNumber(book.getInStockNumber() - cartItem.getQty()); } order.setCartItemList(cartItemList); order.setOrderDate(Calendar.getInstance().getTime()); order.setOrderTotal(shoppingCart.getGrandTotal()); shippingAddress.setOrder(order); billingAddress.setOrder(order); payment.setOrder(order); order.setUser(user); order = orderRepository.save(order); return order; } @Override public Order findOne(long id) { return orderRepository.findOne(id); } }
[ "yrraandres@gmail.com" ]
yrraandres@gmail.com
e3caa979cbea6642c05bd35239d6499043e1f53f
93f0bb638e744c4db14237c1453f0289a0824ef0
/src/main/java/jp/hisano/aosp_research_toolkit/DebuggerUtils.java
9a250df142edbc115fa03617fc3c0ec6de47d785
[]
no_license
hisano/aosp-research-toolkit
a075b44998b656ed73deb70fef974e895b99b828
e9dce3b908e81de6fef0117ea25e90197b017442
refs/heads/master
2021-01-17T17:40:04.818319
2018-08-12T03:42:22
2018-08-12T04:04:20
62,895,540
13
0
null
null
null
null
UTF-8
Java
false
false
1,627
java
package jp.hisano.aosp_research_toolkit; import java.io.IOException; import java.util.Map; import java.util.stream.Stream; import com.sun.jdi.Bootstrap; import com.sun.jdi.VirtualMachine; import com.sun.jdi.connect.AttachingConnector; import com.sun.jdi.connect.Connector; import com.sun.jdi.connect.IllegalConnectorArgumentsException; import com.sun.jdi.request.MethodEntryRequest; final class DebuggerUtils { private static final int ANDROID_DEFAULT_DEBUGGEE_PORT = 8700; static VirtualMachine attachToDebuggee() { return attachToDebuggee(ANDROID_DEFAULT_DEBUGGEE_PORT); } static VirtualMachine attachToDebuggee(int port) { AttachingConnector connector = (AttachingConnector) Bootstrap.virtualMachineManager().allConnectors().stream().filter(c -> c.name().equals("com.sun.jdi.SocketAttach")).findFirst().get(); Map<String, Connector.Argument> arguments = connector.defaultArguments(); arguments.get("hostname").setValue("localhost"); arguments.get("port").setValue("" + port); try { return connector.attach(arguments); } catch (IOException | IllegalConnectorArgumentsException e) { throw new DebuggerException(e); } } static void addClassFilterForSystemServices(VirtualMachine vm) { addClassFilters(vm, "com.android.server.*"); } static void addClassFilters(VirtualMachine vm, String... classFilterPatterns) { MethodEntryRequest request = vm.eventRequestManager().createMethodEntryRequest(); request.setSuspendPolicy(MethodEntryRequest.SUSPEND_EVENT_THREAD); Stream.of(classFilterPatterns).forEach(request::addClassFilter); request.enable(); } private DebuggerUtils() { } }
[ "hisano@gmail.com" ]
hisano@gmail.com
35d76836b5256a1d5b775b4673c9ed04a636dfa4
31a5ac45a87bb4cd8ee7e4543a58775d188cd899
/el_lab_two/src/com/leha/ICrudAction.java
fd79f239482aa6b31fb1f9dd3f857c26bc9876e1
[]
no_license
Alanare/eltex
74198ff582a32055921fc3fe48ab048f52afa4e8
8eb8c730456f0265f550b530cbdd0b80c5569f74
refs/heads/master
2020-04-01T14:59:45.358872
2018-10-18T07:38:54
2018-10-18T07:38:54
153,316,395
0
0
null
null
null
null
UTF-8
Java
false
false
159
java
package com.leha; public interface ICrudAction { public void create(); public void read(); public void update(); public boolean delete(); }
[ "xoxol.xoxol89@mail.ru" ]
xoxol.xoxol89@mail.ru
d1e2cb3c936ab968b79362b9e8c74c1749ee41a7
1fb1b0374322c0d98c4993c950ebade916928651
/src/main/java/pl/polsl/school/diary/api/schoolclass/SchoolClassView.java
be944100cd256dd28ee7ab18a06fac8fe2e76357
[ "Apache-2.0" ]
permissive
SzymonGajdzica/school-diary-api
7da1b87157768e37106cd1c472e0dca52dbaf2c2
65e515cc996abadb77a4f68f7890934e58b3276c
refs/heads/master
2020-09-24T02:58:31.572044
2020-01-30T13:36:52
2020-01-30T13:36:52
225,645,322
0
0
null
null
null
null
UTF-8
Java
false
false
523
java
package pl.polsl.school.diary.api.schoolclass; import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Data; import lombok.ToString; @Data @ToString @AllArgsConstructor public class SchoolClassView { @ApiModelProperty(required = true) private Long id; @ApiModelProperty(required = true, example = "18", position = 1) private String symbol; public SchoolClassView(SchoolClass schoolClass){ this(schoolClass.getId(), schoolClass.getSymbol()); } }
[ "sz.gajdzica@labmatic.com" ]
sz.gajdzica@labmatic.com
d0117f9b7cb2abbcc1eafb765dc89041d06b6b55
1b3991b733e773577810946a345a1b67b30ff955
/support/cas-server-support-shiro-authentication/src/main/java/org/apereo/cas/config/ShiroAuthenticationConfiguration.java
6c909e1aeebeba6d487d3ace2f07ec0972707236
[ "Apache-2.0", "LicenseRef-scancode-free-unknown", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
0xDCSun/cas
20e51cc2a6c1f94c2c962bd1c5486ae9312fb8c6
6c9b7df9128c5606661f9ec8c468e1e88097eafa
refs/heads/master
2023-08-03T11:53:20.030396
2022-02-11T14:36:22
2022-02-11T14:36:22
182,512,612
0
0
Apache-2.0
2023-07-19T21:35:22
2019-04-21T09:09:24
Java
UTF-8
Java
false
false
4,313
java
package org.apereo.cas.config; import org.apereo.cas.adaptors.generic.ShiroAuthenticationHandler; import org.apereo.cas.authentication.AuthenticationEventExecutionPlanConfigurer; import org.apereo.cas.authentication.AuthenticationHandler; import org.apereo.cas.authentication.principal.PrincipalFactory; import org.apereo.cas.authentication.principal.PrincipalFactoryUtils; import org.apereo.cas.authentication.principal.PrincipalNameTransformerUtils; import org.apereo.cas.authentication.principal.PrincipalResolver; import org.apereo.cas.authentication.support.password.PasswordEncoderUtils; import org.apereo.cas.authentication.support.password.PasswordPolicyContext; import org.apereo.cas.configuration.CasConfigurationProperties; import org.apereo.cas.services.ServicesManager; import lombok.extern.slf4j.Slf4j; import lombok.val; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.cloud.context.config.annotation.RefreshScope; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.ScopedProxyMode; /** * This is {@link ShiroAuthenticationConfiguration}. * * @author Misagh Moayyed * @since 5.3.0 */ @EnableConfigurationProperties(CasConfigurationProperties.class) @Slf4j @Configuration(value = "ShiroAuthenticationConfiguration", proxyBeanMethods = false) public class ShiroAuthenticationConfiguration { @ConditionalOnMissingBean(name = "shiroPrincipalFactory") @Bean public PrincipalFactory shiroPrincipalFactory() { return PrincipalFactoryUtils.newPrincipalFactory(); } @RefreshScope(proxyMode = ScopedProxyMode.DEFAULT) @Bean @ConditionalOnMissingBean(name = "shiroAuthenticationHandler") public AuthenticationHandler shiroAuthenticationHandler( final CasConfigurationProperties casProperties, final ConfigurableApplicationContext applicationContext, @Qualifier("shiroPrincipalFactory") final PrincipalFactory shiroPrincipalFactory, @Qualifier("shiroPasswordPolicyConfiguration") final PasswordPolicyContext shiroPasswordPolicyConfiguration, @Qualifier(ServicesManager.BEAN_NAME) final ServicesManager servicesManager) { val shiro = casProperties.getAuthn().getShiro(); val h = new ShiroAuthenticationHandler(shiro.getName(), servicesManager, shiroPrincipalFactory, shiro.getRequiredRoles(), shiro.getRequiredPermissions()); h.loadShiroConfiguration(shiro.getLocation()); h.setPasswordEncoder(PasswordEncoderUtils.newPasswordEncoder(shiro.getPasswordEncoder(), applicationContext)); h.setPasswordPolicyConfiguration(shiroPasswordPolicyConfiguration); h.setPrincipalNameTransformer(PrincipalNameTransformerUtils.newPrincipalNameTransformer(shiro.getPrincipalTransformation())); return h; } @ConditionalOnMissingBean(name = "shiroAuthenticationEventExecutionPlanConfigurer") @Bean public AuthenticationEventExecutionPlanConfigurer shiroAuthenticationEventExecutionPlanConfigurer( final CasConfigurationProperties casProperties, @Qualifier("shiroAuthenticationHandler") final AuthenticationHandler shiroAuthenticationHandler, @Qualifier(PrincipalResolver.BEAN_NAME_PRINCIPAL_RESOLVER) final PrincipalResolver defaultPrincipalResolver) { return plan -> { val shiroConfigFile = casProperties.getAuthn() .getShiro() .getLocation(); if (shiroConfigFile != null) { LOGGER.debug("Injecting shiro authentication handler configured at [{}]", shiroConfigFile.getDescription()); plan.registerAuthenticationHandlerWithPrincipalResolver(shiroAuthenticationHandler, defaultPrincipalResolver); } }; } @ConditionalOnMissingBean(name = "shiroPasswordPolicyConfiguration") @Bean public PasswordPolicyContext shiroPasswordPolicyConfiguration() { return new PasswordPolicyContext(); } }
[ "mm1844@gmail.com" ]
mm1844@gmail.com
d46cefb0f6f5b453fb82bd5f0860325c20cbf604
6395a4761617ad37e0fadfad4ee2d98caf05eb97
/.history/src/main/java/frc/robot/subsystems/CheesyDrive_20191110182510.java
8b64720866449fb99d616fedb8cb4cccddf87984
[]
no_license
iNicole5/Cheesy_Drive
78383e3664cf0aeca42fe14d583ee4a8af65c1a1
80e1593512a92dbbb53ede8a8af968cc1efa99c5
refs/heads/master
2020-09-22T06:38:04.415411
2019-12-01T00:50:53
2019-12-01T00:50:53
225,088,973
0
0
null
null
null
null
UTF-8
Java
false
false
1,676
java
/*----------------------------------------------------------------------------*/ /* Copyright (c) 2017-2018 FIRST. All Rights Reserved. */ /* Open Source Software - may be modified and shared by FRC teams. The code */ /* must be accompanied by the FIRST BSD license file in the root directory of */ /* the project. */ /*----------------------------------------------------------------------------*/ package frc.robot.subsystems; import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX; import com.ctre.phoenix.motorcontrol.can.WPI_VictorSPX; import edu.wpi.first.wpilibj.SpeedControllerGroup; import edu.wpi.first.wpilibj.command.Subsystem; import edu.wpi.first.wpilibj.drive.DifferentialDrive; import frc.robot.RobotMap; public class CheesyDrive extends Subsystem { WPI_TalonSRX leftMotor1 = new WPI_TalonSRX(RobotMap.leftMotor1); WPI_VictorSPX leftMotor2 = new WPI_VictorSPX(RobotMap.leftMotor2); WPI_VictorSPX rightMotor1 = new WPI_VictorSPX(RobotMap.rightMotor1); WPI_TalonSRX rightMotor2 = new WPI_TalonSRX(RobotMap.rightMotor2); SpeedControllerGroup leftDriveBase = new SpeedControllerGroup(leftMotor1, leftMotor2); SpeedControllerGroup rightDriveBase = new SpeedControllerGroup(rightMotor1, rightMotor2); DifferentialDrive cheesyDrive = new DifferentialDrive(leftDriveBase, rightDriveBase); public void robotInit() { leftDriveBase.setInverted(true); rightDriveBase.setInverted(t); } @Override public void initDefaultCommand() { // Set the default command for a subsystem here. // setDefaultCommand(new MySpecialCommand()); } }
[ "40499551+iNicole5@users.noreply.github.com" ]
40499551+iNicole5@users.noreply.github.com
5c3638f5d266929b520e4fe5bf1bf0218bf70895
44a11edd072501d6f3ac1ccf9380553a4bd2cd7e
/devFw/src/main/java/project/FleaMarket/P001/D001/service/F_P001_D001ServiceImpl.java
8d607c82fee707f54988a1d82f876422de57e2cc
[]
no_license
sunwooV/project
5d212e2383a8732eb28df9135e7c11cecb103d1f
83d46fe67a045e614dd509a81d29910e03f2063c
refs/heads/master
2022-12-23T19:00:57.292017
2019-12-24T02:51:13
2019-12-24T02:51:13
212,250,398
0
3
null
2022-12-16T03:47:28
2019-10-02T03:47:24
CSS
UTF-8
Java
false
false
1,649
java
package project.FleaMarket.P001.D001.service; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.EnableAspectJAutoProxy; import org.springframework.dao.DataAccessException; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import project.FleaMarket.P001.D001.dao.F_P001_D001DAO; import project.FleaMarket.P001.D001.vo.F_P001_D001VO; @Service("F_P001_D001Service") @Transactional(propagation = Propagation.REQUIRED) public class F_P001_D001ServiceImpl implements F_P001_D001Service { @Autowired private F_P001_D001DAO d001DAO; @Override public List<F_P001_D001VO> searchList(Map<String, Object> searchMap) throws DataAccessException { List<F_P001_D001VO> list = d001DAO.searchList(searchMap); return list; } @Override public List<F_P001_D001VO> searchMod(Map<String, Object> searchMap) throws DataAccessException { List<F_P001_D001VO> list = d001DAO.searchMod(searchMap); return list; } @Override public List<F_P001_D001VO> searchAdd() throws DataAccessException { // TODO Auto-generated method stub return null; } @Override public void updateMember(Map<String, Object> datahMap) throws Exception { d001DAO.updateMember(datahMap); } @Override public void insertMember(Map<String, Object> datahMap) throws Exception { d001DAO.insertMember(datahMap); } @Override public void deleteMember(Map<String, Object> datahMap) throws Exception { d001DAO.deleteMember(datahMap); } }
[ "alswn2868@naver.com" ]
alswn2868@naver.com
585aeffaa2473659608296138d520224e21ae37d
29cec8fd07a6f2be7520267c196c9cbea2c19ee0
/RestaurantService/src/integration-test/java/it/uniroma3/RestaurantJpaRepositoryTests.java
ea250c8992c2d675c36a4e540f3d7c9f15202a3f
[]
no_license
andser91/e_Food
6d45a6f0d22bc9aeeb3f88f2129201c9aaf730c1
8edb914f2a6e78f007b5d6b11a3e2d98afa4f5b5
refs/heads/master
2020-04-26T05:56:50.019550
2019-10-15T10:24:05
2019-10-15T10:24:05
173,349,222
0
0
null
null
null
null
UTF-8
Java
false
false
4,129
java
package it.uniroma3; import it.uniroma3.domain.Restaurant; import it.uniroma3.domain.RestaurantRepository; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.transaction.support.TransactionTemplate; import java.util.ArrayList; import java.util.List; import java.util.Optional; import static org.assertj.core.api.Assertions.assertThat; @RunWith(SpringRunner.class) @SpringBootTest public class RestaurantJpaRepositoryTests { public static final String RESTAURANT_NAME = "r1"; public static final String RESTAURANT_ADDRESS = "a1"; public static final String RESTAURANT_NAME_2 = "r2"; public static final String RESTAURANT_ADDRESS_2 = "a2"; @Autowired private RestaurantRepository restaurantRepository; @Autowired private TransactionTemplate transactionTemplate; @Test public void saveAndFindRestaurantTest() { Long restaurantId = transactionTemplate.execute((ts) ->{ Restaurant restaurant = new Restaurant(RESTAURANT_NAME, RESTAURANT_ADDRESS); restaurant = restaurantRepository.save(restaurant); return restaurant.getId(); }); transactionTemplate.execute((ts)->{ Restaurant restaurant = restaurantRepository.findById(restaurantId).get(); assertThat(restaurant).isNotNull(); assertThat(restaurant.getName()).isEqualTo(RESTAURANT_NAME); assertThat(restaurant.getAddress()).isEqualTo(RESTAURANT_ADDRESS); return null; }); } @Test public void saveAndDeleteRestaurantTest() { Long restaurantId = transactionTemplate.execute((ts) ->{ Restaurant restaurant = new Restaurant(RESTAURANT_NAME, RESTAURANT_ADDRESS); restaurant = restaurantRepository.save(restaurant); return restaurant.getId(); }); transactionTemplate.execute((ts)-> { Restaurant existingRestaurant = restaurantRepository.findById(restaurantId).get(); assertThat(existingRestaurant).isNotNull(); restaurantRepository.deleteById(restaurantId); Optional<Restaurant> removedRestaurant = restaurantRepository.findById(restaurantId); assertThat(removedRestaurant.isPresent()).isFalse(); return null; }); } public void saveAndFindAllTest() { List<Restaurant> restaurants = transactionTemplate.execute((ts)->{ Restaurant r1 = new Restaurant(RESTAURANT_NAME, RESTAURANT_ADDRESS); Restaurant r2 = new Restaurant(RESTAURANT_NAME_2, RESTAURANT_ADDRESS_2); List<Restaurant> restaurantList = new ArrayList<>(); restaurantList.add(r1); restaurantList.add(r2); restaurantRepository.save(r1); restaurantRepository.save(r2); return restaurantList; }); transactionTemplate.execute((ts)-> { List<Restaurant> restaurantsRetrived = (List<Restaurant>) restaurantRepository.findAll(); assertThat(restaurantsRetrived.size()).isEqualTo(restaurants.size()); Restaurant r1 = restaurantsRetrived.get(0); assertThat(r1.getName()).isEqualTo(RESTAURANT_NAME); assertThat(r1.getAddress()).isEqualTo(RESTAURANT_ADDRESS); Restaurant r2 = restaurantsRetrived.get(1); assertThat(r2.getName()).isEqualTo(RESTAURANT_NAME_2); assertThat(r2.getAddress()).isEqualTo(RESTAURANT_ADDRESS_2); return null; }); } public void findAllEmptyTest() { transactionTemplate.execute((ts)->{ restaurantRepository.deleteAll(); return null; }); transactionTemplate.execute((ts)-> { List<Restaurant> restaurantList = (List<Restaurant>) restaurantRepository.findAll(); assertThat(restaurantList.isEmpty()); return null; }); } }
[ "deb.benedetto@stud.uniroma3.it" ]
deb.benedetto@stud.uniroma3.it
c4ae73824e2babb0c252ad4abd30573dd2058a49
59a46132f8aa4f996a20d75d6ee7e6fba742a8dc
/networkproxy/src/main/java/com/rain/networkproxy/storage/Utils.java
518d96d3d095b866252507bcb448e475456e641c
[ "Apache-2.0" ]
permissive
morristech/NetworkProxy
b15815a78a14f97aa301ea392f73dc779974ee07
8bbf4265a8fd2b26fc7ec72628860c0072d499cf
refs/heads/master
2020-04-14T12:22:44.802152
2019-01-01T15:37:02
2019-01-01T15:37:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,353
java
package com.rain.networkproxy.storage; import android.content.SharedPreferences; import android.support.annotation.NonNull; import io.reactivex.Observable; import io.reactivex.ObservableEmitter; import io.reactivex.ObservableOnSubscribe; import io.reactivex.functions.Cancellable; final class Utils { private Utils() {} static Observable<String> observeKeys(@NonNull final SharedPreferences sharedPreferences) { return Observable.create(new ObservableOnSubscribe<String>() { @Override public void subscribe(final ObservableEmitter<String> emitter) { final SharedPreferences.OnSharedPreferenceChangeListener listener = new SharedPreferences.OnSharedPreferenceChangeListener() { @Override public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { emitter.onNext(key); } }; emitter.setCancellable(new Cancellable() { @Override public void cancel() { sharedPreferences.unregisterOnSharedPreferenceChangeListener(listener); } }); sharedPreferences.registerOnSharedPreferenceChangeListener(listener); } }); } }
[ "nongdenchet8435848@gmail.com" ]
nongdenchet8435848@gmail.com
ddf811dc1d90c8bb94d38d4e84371c6191d9aef6
658dbed62a5c32955179247b1425e760efe0d825
/app/src/main/java/com/abhi/sms_spam_checker/test/VirusTotal.java
982248d3ef41f4902bd8ec0f0c7cf63229d8b3c6
[]
no_license
peirisabhi/sms_spam_checker
3e77b0dc1086ac5086fda79be828a45052a56fe7
5fd49fd1534ad3dd7c1f8398ea366a57c14a050e
refs/heads/master
2023-08-22T21:59:11.500370
2021-10-26T17:46:41
2021-10-26T17:46:41
409,508,060
0
0
null
null
null
null
UTF-8
Java
false
false
72
java
package com.abhi.sms_spam_checker.test; public class VirusTotal { }
[ "abhishekdananjaya1@yahoo.com" ]
abhishekdananjaya1@yahoo.com
94fd38b9aecb76ae9dc46ff7fc50d8a9da2364e6
647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4
/com.tencent.mm/classes.jar/com/tencent/mm/plugin/finder/uniComments/f$$ExternalSyntheticLambda4.java
a1d68134c5a2c6dfa60e06b928f5b3675b86302d
[]
no_license
tsuzcx/qq_apk
0d5e792c3c7351ab781957bac465c55c505caf61
afe46ef5640d0ba6850cdefd3c11badbd725a3f6
refs/heads/main
2022-07-02T10:32:11.651957
2022-02-01T12:41:38
2022-02-01T12:41:38
453,860,108
36
9
null
2022-01-31T09:46:26
2022-01-31T02:43:22
Java
UTF-8
Java
false
false
378
java
package com.tencent.mm.plugin.finder.uniComments; public final class f$$ExternalSyntheticLambda4 implements Runnable { public final void run() {} } /* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes2.jar * Qualified Name: com.tencent.mm.plugin.finder.uniComments.f..ExternalSyntheticLambda4 * JD-Core Version: 0.7.0.1 */
[ "98632993+tsuzcx@users.noreply.github.com" ]
98632993+tsuzcx@users.noreply.github.com
b9e94c0f02a1f20198349f1c1edf70c9fb0f684b
b7cac4e062aa5ba15c315adfd3763cb49676afc9
/inception/inception-api-annotation/src/main/java/de/tudarmstadt/ukp/clarin/webanno/api/annotation/paging/NoPagingStrategy.java
5637dcb12e62cd7d2dcf425b8b5dfa23d92eae09
[ "Apache-2.0" ]
permissive
XiaofengZhu/inception
cd98f77fd300932eb7c651e549d6991dd283dee4
719f10c07c79e3c9ce4b660f72b1573ff57a9434
refs/heads/master
2023-06-13T21:48:29.018115
2021-07-07T21:18:07
2021-07-07T21:18:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,411
java
/* * Licensed to the Technische Universität Darmstadt under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The Technische Universität Darmstadt * licenses this file to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. * * 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 de.tudarmstadt.ukp.clarin.webanno.api.annotation.paging; import static java.util.Arrays.asList; import java.util.List; import org.apache.uima.cas.CAS; import org.apache.wicket.Component; import org.apache.wicket.markup.html.panel.EmptyPanel; import org.apache.wicket.model.IModel; import de.tudarmstadt.ukp.clarin.webanno.api.annotation.model.AnnotatorState; import de.tudarmstadt.ukp.clarin.webanno.api.annotation.page.AnnotationPageBase; import de.tudarmstadt.ukp.clarin.webanno.api.annotation.paging.DefaultPagingNavigator; import de.tudarmstadt.ukp.clarin.webanno.api.annotation.paging.PagingStrategy; import de.tudarmstadt.ukp.clarin.webanno.api.annotation.paging.Unit; public class NoPagingStrategy implements PagingStrategy { private static final long serialVersionUID = 1589886937787735472L; @Override public List<Unit> units(CAS aCas, int aFirstIndex, int aLastIndex) { return asList(new Unit(0, 0, aCas.getDocumentText().length())); } @Override public Component createPositionLabel(String aId, IModel<AnnotatorState> aModel) { EmptyPanel emptyPanel = new EmptyPanel(aId); // Just to avoid errors when re-rendering this is requested in an AJAX request emptyPanel.setOutputMarkupId(true); return emptyPanel; } @Override public DefaultPagingNavigator createPageNavigator(String aId, AnnotationPageBase aPage) { DefaultPagingNavigator navi = new DefaultPagingNavigator(aId, aPage); navi.setOutputMarkupPlaceholderTag(true); navi.setVisible(false); return navi; } }
[ "richard.eckart@gmail.com" ]
richard.eckart@gmail.com
c47299ae85312b7263c3cd5026d5efac634d09d5
f583c50a88d07e159bba657c27ffdf14053a7f1e
/springboot的单点登录的实现/模板3(好用,使用shiro+jwt+redis来实现,shiro-jwt-SSO项目用到)/shiro-jwt-SSO/src/main/java/com/mzl/shirojwtSSO/shiro/jwt/JwtFilter.java
5357fba7e423dc32c6b7fe0fbf38ea6a1db27735
[]
no_license
KTLeYing/springboot-learning-1
542eadb3d3174434047a7268a04be8050bf2ea11
9e5e6c9c27c41fef04bdc186f53ac30a3610af34
refs/heads/master
2023-03-19T14:08:55.988098
2021-03-18T11:32:47
2021-03-18T11:32:47
347,958,431
0
0
null
null
null
null
UTF-8
Java
false
false
5,672
java
package com.mzl.shirojwtSSO.shiro.jwt; import com.mzl.shirojwtSSO.exception.MyException; import org.apache.shiro.authc.AuthenticationException; import org.apache.shiro.web.filter.authc.BasicHttpAuthenticationFilter; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.http.HttpStatus; import org.springframework.stereotype.Component; import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.method.HandlerMethod; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.lang.reflect.Method; import java.net.URLEncoder; /** * @ClassName : JwtFilter * @Description: jwt过滤器,对用户请求的token进行处理 * @Author: mzl * @CreateDate: 2021/1/30 21:45 * @Version: 1.0 */ @Component public class JwtFilter extends BasicHttpAuthenticationFilter { @Autowired private StringRedisTemplate stringRedisTemplate; /** * 如果带有 token,则对 token 进行检查,否则直接通过 * @param request * @param response * @param mappedValue * @return */ @Override protected boolean isAccessAllowed(ServletRequest request, ServletResponse response, Object mappedValue){ System.out.println("执行了是否允许访问的处理..."); //判断请求的请求头是否带上 "token" if (isLoginAttempt(request, response)){ //如果存在,则进入 executeLogin 方法执行登入,检查 token 是否正确 try{ executeLogin(request, response); System.out.println("请求的用户身份认证成功了..."); return true; } catch (Exception e) { //token 错误 responseError(request, response, e.getMessage()); e.printStackTrace(); } } //请求如果不携带token,则请求失败 System.out.println("请求的用户身份认证失败了..."); responseError(request, response, "请求没携带token,请求token不能为空,认证失败!"); return false; } /** * 判断用户是否想要登录,是否要尝试登录 * 检测 header 里面是否包含 token 字段,有token说明用户要请求,所以就进行用户token的验证;无token说明用户要进行登录或者游客状态访问 * @param request * @param response * @return */ @Override protected boolean isLoginAttempt(ServletRequest request, ServletResponse response) { System.out.println("执行了判断用户是否想要登录..."); HttpServletRequest httpServletRequest = (HttpServletRequest) request; String token = httpServletRequest.getHeader("token"); return token != null; } /** * 执行登录操作,看用户的token信息是否正确和用户是否有权限 * @param request * @param response * @return * @throws Exception */ @Override protected boolean executeLogin(ServletRequest request, ServletResponse response) throws Exception { System.out.println("执行了登录操作..."); HttpServletRequest httpServletRequest = (HttpServletRequest) request; String token = httpServletRequest.getHeader("token"); JwtToken jwtToken = new JwtToken(token); // 提交给realm进行登入验证,如果错误它会抛出异常并被捕获(realm的身份认证和权限管理通过才能算是放行true,否则会抛出异常) getSubject(request, response).login(jwtToken); // 如果没有抛出异常则代表登入成功,返回true return true; } /** * 执行接口各项处理前的执行,对跨域的支持 * @param request * @param response * @return * @throws Exception */ @Override protected boolean preHandle(ServletRequest request, ServletResponse response) throws Exception { System.out.println("执行了接口各项处理前的执行..."); HttpServletRequest httpServletRequest = (HttpServletRequest) request; HttpServletResponse httpServletResponse = (HttpServletResponse) response; httpServletResponse.setHeader("Access-control-Allow-Origin", httpServletRequest.getHeader("Origin")); httpServletResponse.setHeader("Access-Control-Allow-Methods", "GET,POST,OPTIONS,PUT,DELETE"); httpServletResponse.setHeader("Access-Control-Allow-Headers", httpServletRequest.getHeader("Access-Control-Request-Headers")); // 跨域时会首先发送一个option请求,这里我们给option请求直接返回正常状态 if (httpServletRequest.getMethod().equals(RequestMethod.OPTIONS.name())) { httpServletResponse.setStatus(HttpStatus.OK.value()); return false; } return super.preHandle(request, response); } /** * 将非法请求跳转到 /user/unauthorized/** */ private void responseError(ServletRequest request, ServletResponse response, String message) { System.out.println("执行response401处理(身份认证失败或无权限)..."); HttpServletRequest req = (HttpServletRequest) request; try{ req.getRequestDispatcher("/user/unauthorized/" + message).forward(request, response); } catch (Exception e) { e.printStackTrace(); } } }
[ "2198902814@qq.com" ]
2198902814@qq.com
356431bb863d578c1609bd43f3528fde1625e473
40cd4da5514eb920e6a6889e82590e48720c3d38
/desktop/applis/apps/bean/bean_games/pokemonbean/src/main/java/aiki/beans/abilities/AbilityBeanGetTrMultStatIfKoFoe.java
fe8dd964e35cda01a9a79a546383f99b4c7eb5e2
[]
no_license
Cardman/projects
02704237e81868f8cb614abb37468cebb4ef4b31
23a9477dd736795c3af10bccccb3cdfa10c8123c
refs/heads/master
2023-08-17T11:27:41.999350
2023-08-15T07:09:28
2023-08-15T07:09:28
34,724,613
4
0
null
2020-10-13T08:08:38
2015-04-28T10:39:03
Java
UTF-8
Java
false
false
458
java
package aiki.beans.abilities; import aiki.beans.PokemonBeanStruct; import code.bean.nat.*; import code.bean.nat.*; import code.bean.nat.*; import code.bean.nat.*; public class AbilityBeanGetTrMultStatIfKoFoe implements NatCaller{ @Override public NaSt re(NaSt _instance, NaSt[] _args){ return new NaStSt(( (AbilityBean) ((PokemonBeanStruct)_instance).getInstance()).getTrMultStatIfKoFoe(NaPa.convertToNumber(_args[0]).intStruct())); } }
[ "f.desrochettes@gmail.com" ]
f.desrochettes@gmail.com
49cefb72d8396e992d3daba945b0cffe42248f8b
efbfbfb4420fa073a5e157ba274bf51c6c40059a
/spring-cloud-alibaba-dubbo/src/main/java/org/springframework/cloud/alibaba/dubbo/context/DubboServiceRegistrationApplicationContextInitializer.java
7cec09322aab0820cf2ab4d70ba069a1c6609875
[ "Apache-2.0" ]
permissive
simon11wei/spring-cloud-alibaba
17c97c6a5df8129ea13338b59c8f64f4737c0363
56627e38897247bcece116636a3ee61d5ce4ea54
refs/heads/master
2020-04-18T10:20:47.325835
2019-01-23T14:55:58
2019-01-23T14:55:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,882
java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.cloud.alibaba.dubbo.context; import org.springframework.cloud.alibaba.dubbo.registry.SpringCloudRegistryFactory; import org.springframework.context.ApplicationContextInitializer; import org.springframework.context.ConfigurableApplicationContext; /** * The Dubbo services will be registered as the specified Spring cloud applications that * will not be considered normal ones, but only are used to Dubbo's service discovery even * if it is based on Spring Cloud Commons abstraction. However, current application will * be registered by other DiscoveryClientAutoConfiguration. * * @author <a href="mailto:mercyblitz@gmail.com">Mercy</a> */ public class DubboServiceRegistrationApplicationContextInitializer implements ApplicationContextInitializer<ConfigurableApplicationContext> { @Override public void initialize(ConfigurableApplicationContext applicationContext) { // Set ApplicationContext into SpringCloudRegistryFactory before Dubbo Service // Register SpringCloudRegistryFactory.setApplicationContext(applicationContext); } }
[ "mercyblitz@gmail.com" ]
mercyblitz@gmail.com
a63394ab0f4c1d57d855ae49457a05295a86b151
60ad67f47451830c85791cf9cf5117e407a84d0b
/Data-Structure/Java/LeetCode/Array/941. Valid Mountain Array.java
99c1b9f280da8e99f287d251a6f63b8bf54d498b
[]
no_license
uwspstar/DataStructures-Algorithms
b73eb3ba9ad960c496736955d8f7b3eb5e4e1491
813ff8255ba03a7a9dfd6bb99ea4758d5ed9d848
refs/heads/master
2023-01-24T11:14:12.607822
2023-01-06T12:35:03
2023-01-06T12:35:03
204,945,352
2
0
null
null
null
null
UTF-8
Java
false
false
1,473
java
//941. Valid Mountain Array /* Given an array of integers arr, return true if and only if it is a valid mountain array. Recall that arr is a mountain array if and only if: arr.length >= 3 There exists some i with 0 < i < arr.length - 1 such that: arr[0] < arr[1] < ... < arr[i - 1] < arr[i] arr[i] > arr[i + 1] > ... > arr[arr.length - 1] Input: arr = [2,1] Output: false Input: arr = [3,5,5] Output: false Input: arr = [0,3,2,1] Output: true */ class Solution { public boolean validMountainArray(int[] A) { if (A == null || A.length < 3) { return false; } boolean increasing = A[1] > A[0]; // the mountain must at least start in an increasing manner if (!increasing) { return false; } for (int i = 1; i < A.length; i++) { if (A[i] == A[i - 1]) { return false; // plateaus are prohibited } if (increasing) { if (A[i] < A[i - 1]) { increasing = false; // we reached the peak } } else { // every element must be decreasing, otherwise return false if (A[i] > A[i - 1]) { return false; } } } // we can't just return true, we must ensure that a peak was reached at some // point. return !increasing; } } // Minimum Number of Removals to Make Mountain Array
[ "uwspstar@gmail.com" ]
uwspstar@gmail.com
5f359c87b993e24084f9b1177372848f5b52b0c6
8c1f10611e3ff32d9ee8932881533ff6fca8e152
/src/main/java/com/github/pedrografael/infrastructure/configuration/CustomUserAuthenticationConverter.java
b37295e01f9a82ad2372d287723370e56f406319
[]
no_license
pedrografael/alpha
5125ebcce4e66baef7bc0edbdf59fc63996a6cdf
f31570b8f561f9d268519f20bf63051ca51b00a3
refs/heads/master
2021-01-24T07:29:36.770791
2017-07-02T18:20:51
2017-07-02T18:20:51
93,345,896
0
0
null
null
null
null
UTF-8
Java
false
false
2,423
java
package com.github.pedrografael.infrastructure.configuration; import java.util.ArrayList; import java.util.Collection; import java.util.LinkedHashMap; import java.util.Map; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.Authentication; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.AuthorityUtils; import org.springframework.security.oauth2.provider.token.UserAuthenticationConverter; import org.springframework.util.StringUtils; public class CustomUserAuthenticationConverter implements UserAuthenticationConverter { public static final String REALM_ACCESS = "realm_access"; public static final String ROLES = "roles"; public static final String PREFERRED_USERNAME = "preferred_username"; @Override public Map<String, ?> convertUserAuthentication(Authentication authentication) { Map<String, Object> response = new LinkedHashMap<String, Object>(); response.put(USERNAME, authentication.getName()); if (authentication.getAuthorities() != null && !authentication.getAuthorities().isEmpty()) { response.put(AUTHORITIES, AuthorityUtils.authorityListToSet(authentication.getAuthorities())); } return response; } public Authentication extractAuthentication(Map<String, ?> map) { if (map.containsKey(PREFERRED_USERNAME)) { Object principal = map.get(PREFERRED_USERNAME); Collection<? extends GrantedAuthority> authorities = getAuthorities(map); return new UsernamePasswordAuthenticationToken(principal, "N/A", authorities); } return null; } private Collection<? extends GrantedAuthority> getAuthorities(Map<String, ?> map) { if (!map.containsKey(REALM_ACCESS)) { return new ArrayList<>(); } @SuppressWarnings("unchecked") Map<String, ?> realmAccess = (Map<String, ?>) map.get(REALM_ACCESS); Object authorities = realmAccess.get(ROLES); if (authorities instanceof String) { return AuthorityUtils.commaSeparatedStringToAuthorityList((String) authorities); } if (authorities instanceof Collection) { return AuthorityUtils.commaSeparatedStringToAuthorityList( StringUtils.collectionToCommaDelimitedString((Collection<?>) authorities)); } throw new IllegalArgumentException("Authorities must be either a String or a Collection"); } }
[ "alpha@alpha-november" ]
alpha@alpha-november
9739ad04d79e288b55972d24123e9c7fc5cc0ce4
fc6c869ee0228497e41bf357e2803713cdaed63e
/weixin6519android1140/src/sourcecode/com/tencent/mm/plugin/product/ui/b.java
e4d5186fb2db46a389aff0dd6123b1ba94c05d30
[]
no_license
hyb1234hi/reverse-wechat
cbd26658a667b0c498d2a26a403f93dbeb270b72
75d3fd35a2c8a0469dbb057cd16bca3b26c7e736
refs/heads/master
2020-09-26T10:12:47.484174
2017-11-16T06:54:20
2017-11-16T06:54:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
634
java
package com.tencent.mm.plugin.product.ui; import android.widget.ImageView; import android.widget.TextView; import com.tencent.gmtrace.GMTrace; public final class b { public TextView izE; public TextView nJe; public ImageView nJf; public HtmlTextView nJg; public Object nJh; public String title; public int type; public b() { GMTrace.i(6017383399424L, 44833); GMTrace.o(6017383399424L, 44833); } } /* Location: D:\tools\apktool\weixin6519android1140\jar\classes3-dex2jar.jar!\com\tencent\mm\plugin\product\ui\b.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "robert0825@gmail.com" ]
robert0825@gmail.com
538e87fe4d8f72640eec19475ca61a114f41a7bd
442f6be098eeb1866fc2e94796a8ad2016f317d2
/jaccepte/src/main/java/net/gcolin/validator/constraints/DecimalMaxBigDecimalValidator.java
197dacf26f352ec9e30eee1f00aff691a2d330cf
[ "Apache-2.0" ]
permissive
gcolin/smallee
355774d6feb2b9f478b297a17297d446c33705a3
3f21f2cbea2af708bb7e8f31375dcc4f56a17e16
refs/heads/master
2023-07-24T03:00:08.848827
2022-12-31T17:23:12
2022-12-31T17:23:12
205,173,969
0
0
Apache-2.0
2023-07-22T14:51:15
2019-08-29T13:47:29
Java
UTF-8
Java
false
false
1,529
java
/* * Licensed to the Apache Software Foundation (ASF) under one or more contributor license * agreements. See the NOTICE file distributed with this work for additional information regarding * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance with the License. You may obtain a * copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express * or implied. See the License for the specific language governing permissions and limitations under * the License. */ package net.gcolin.validator.constraints; import java.math.BigDecimal; import javax.validation.ConstraintValidator; import javax.validation.ConstraintValidatorContext; import javax.validation.constraints.DecimalMax; /** * A ConstraintValidator DecimalMax for a BigDecimal. * * @author Gaël COLIN * @since 1.0 */ public class DecimalMaxBigDecimalValidator implements ConstraintValidator<DecimalMax, BigDecimal> { private BigDecimal max; @Override public void initialize(DecimalMax constraintAnnotation) { max = new BigDecimal(constraintAnnotation.value()); } @Override public boolean isValid(BigDecimal value, ConstraintValidatorContext context) { return value == null || value.compareTo(max) <= 0; } }
[ "gael87@gmail.com" ]
gael87@gmail.com
9baab3880692b114be4dfd3b63b45c10115ebd73
902be1cd8c19e846225ae9b6410da9efaa25d616
/src/org/util/npci/pos/model/Keys.java
9c12801f83b1dcb7a204bb63a8d459ff874ee8ac
[]
no_license
KrishnaST/org.util.npci.pos
6466f703b5bc48ab827e194553b27f2586e83424
8f0a905c8676c3da22930f8e8f7ec75f7b255216
refs/heads/master
2022-03-07T05:27:06.405425
2019-09-25T13:11:06
2019-09-25T13:11:06
197,898,356
0
0
null
null
null
null
UTF-8
Java
false
false
288
java
package org.util.npci.pos.model; public class Keys { public String cvk1; public String cvk2; public String zpk; public String pvk; @Override public String toString() { return "Keys [cvk1=" + cvk1 + ", cvk2=" + cvk2 + ", zpk=" + zpk + ", pvk=" + pvk + "]"; } }
[ "krishna.telgave@SIL_DEV076.saas.SILASPDC.com" ]
krishna.telgave@SIL_DEV076.saas.SILASPDC.com
9c94f4419bc855607a25638c2aa51b05919d86f5
53142e86328ff8cd71f9d24498014d16f5ea1308
/kutuphane2/Kutuphane.java
0dabf02643fecc862889d52f5816389fc3d6b19f
[]
no_license
yusufnadiruzun/Library
675b56518c9fdd127522ab701444229255b254f3
40c1d9a3c298ac647cca5898f6be22e72d9be8ff
refs/heads/main
2023-02-13T03:12:36.984152
2021-01-21T19:53:44
2021-01-21T19:53:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
12,508
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 kutuphane2; import com.sun.corba.se.impl.io.IIOPOutputStream; import java.io.BufferedOutputStream; import java.io.DataOutputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.ObjectOutputStream; import java.io.Serializable; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.GregorianCalendar; import java.util.List; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; import javax.persistence.Persistence; import javax.persistence.Query; import javax.persistence.RollbackException; import javax.swing.JOptionPane; //import org.apache.derby.shared.common.error.DerbySQLIntegrityConstraintViolationException; /** * * @author KÜRŞAD */ public class Kutuphane implements Serializable { public ArrayList<UyeA> uyeler = new ArrayList<>(); public ArrayList<KitapA> kitaplar = new ArrayList<>(); public ArrayList<SilinenUyeA> SilinenUyeler = new ArrayList<>(); EntityManagerFactory emf = Persistence.createEntityManagerFactory("KutuphaneSonPU"); EntityManager em = emf.createEntityManager(); public void UyeEkle(UyeA uye) { uyeler.add(uye); } public void ArraylisteVeriEkle() { Query q = em.createQuery("SELECT u FROM Uye u"); List<Uye> uyelerDB = q.getResultList(); for (Uye uye : uyelerDB) { uyeler.add(new UyeA(uye.getId(), uye.getAdi(), uye.getSoyisim(), uye.getTelno(), uye.getTcno())); } Query w = em.createQuery("select k from Kitap k"); List<Kitap> kitaplarDB = w.getResultList(); for (Kitap kitap : kitaplarDB) { kitaplar.add(new KitapA(kitap.getNumara(), kitap.getAdi(), kitap.getYazari(), kitap.getSayfasayisi())); } Query e = em.createQuery("select uk from Uyekitap uk"); List<Uyekitap> uyekitaplarDB = e.getResultList(); for (int i = 0; i < uyeler.size(); i++) { System.out.println(" uyekitap ilk döngü"); for (Uyekitap kitap : uyekitaplarDB) { System.out.println(" uyekitap ikinci döngü"); if (kitap.getUyeid() == uyeler.get(i).ID) { uyeler.get(i).UyeKitaplar.add(new KitapA(kitap.getKitapid(), kitap.getAdi(), kitap.getYazar(), kitap.getSayfa())); System.out.println("uye databaseden kitap ekleme işlemi başarılı" + uyeler.get(i).isim + " " + kitap.getKitapid()); } } } Query r = em.createQuery("select s from Silinenuye s"); List<Silinenuye> silinenuyelerdb = r.getResultList(); for (Silinenuye uye : silinenuyelerdb) { SilinenUyeler.add(new SilinenUyeA(uye.getAdi(), uye.getSoyadi(), uye.getTelno(), uye.getTcno(), uye.getTarih(), uye.getId())); } } public boolean DBuyeEkle(int ıd, String isim, String soyisim, String uyetel, String uyeTc) { boolean sonuc = false; boolean sonuc2 = false; Query uyeq = em.createQuery("select u from Uye u"); List<Uye> uyelerDB = uyeq.getResultList(); for (Uye uye : uyelerDB) { System.out.println(" döngü dbkitapekle"); if (uye.getId() == ıd) { JOptionPane.showMessageDialog(null, "Bu ID'ye sahip bir Uye bulunuyor bu uyeyi ekleyemezsiniz."); sonuc2 = true; break; } } if (sonuc2 == false) { em.getTransaction().begin(); Uye uye = new Uye(ıd, isim, soyisim, uyetel, uyeTc); em.persist(uye); em.getTransaction().commit(); sonuc = true; } return sonuc; } public void DBkitapSil(int kitapID) { Query q = em.createQuery(" Delete From Kitap k where k.numara=:pkitapID"); q.setParameter("pkitapID", kitapID); em.getTransaction().begin(); q.executeUpdate(); em.getTransaction().commit(); } public boolean DBkitapEkle(int ıd, String isim, String yazar, int sayfa) { boolean sonuc = false; boolean sonuc2 = false; Query w = em.createQuery("select k from Kitap k"); List<Kitap> kitaplarDB = w.getResultList(); for (Kitap kitap : kitaplarDB) { System.out.println(" döngü dbkitapekle"); if (kitap.getNumara() == ıd) { JOptionPane.showMessageDialog(null, "Bu ID'ye sahip bir kitap bulunuyor bu kitabi ekleyemezsiniz."); sonuc2 = true; break; } } if (sonuc2 == false) { em.getTransaction().begin(); Kitap kitapa = new Kitap(ıd, isim, yazar, sayfa); em.persist(kitapa); em.getTransaction().commit(); sonuc = true; } return sonuc; } public boolean UyeyeKitapVer(int id, int kitapId) { boolean islem = false; for (int i = 0; i < uyeler.size(); i++) { if (id == (uyeler.get(i).ID)) { System.out.println("ilk if"); if (uyeler.get(i).UyeKitaplar.size() == 0) { System.out.println("ikinci if"); for (int j = 0; j < kitaplar.size(); j++) { if (kitapId == (kitaplar.get(j).ID)) { System.out.println("3 . if"); uyeler.get(i).UyeKitaplar.add(kitaplar.get(j)); islem = true; JOptionPane.showMessageDialog(null, " Kitap ekleme işlemi başarılı ", " Uyarı ", JOptionPane.INFORMATION_MESSAGE); } } } else { JOptionPane.showMessageDialog(null, " Uyede kitap bulunuyor", " Uyarı ", JOptionPane.WARNING_MESSAGE); } } } return islem; } public boolean UyedenKitapSil(int id) { boolean sonuc = false; for (int i = 0; i < uyeler.size(); i++) { if (id == uyeler.get(i).ID) { System.out.println("s ilk if"); if (uyeler.get(i).UyeKitaplar.size() == 0) { System.out.println(" s ikinci if"); JOptionPane.showMessageDialog(null, "Uye daha once kitap almamış", " Uyarı ", JOptionPane.WARNING_MESSAGE); break; } else { int a = JOptionPane.showConfirmDialog(null, " Uyeden kitap silinsin mi ? ", " Kitap Silme", JOptionPane.YES_NO_OPTION); if (a == 0) { uyeler.get(i).UyeKitaplar.removeAll(uyeler.get(i).UyeKitaplar); sonuc = true; JOptionPane.showMessageDialog(null, " Kitap Silme İşlemi Başarılı ", " Kitap Silindi", JOptionPane.INFORMATION_MESSAGE); } else { break; } } break; } } return sonuc; } public boolean UyeSil(int id) { boolean sonuc = false; for (int i = 0; i < uyeler.size(); i++) { if (uyeler.get(i).ID == id) { if (uyeler.get(i).UyeKitaplar.size() != 0) { JOptionPane.showMessageDialog(null, " Uyede Kitap bulunuyor uyeyi silemezsiniz ", " Uyarı ", JOptionPane.WARNING_MESSAGE); } else { uyeler.remove(uyeler.get(i)); sonuc = true; } } } return sonuc; } public void KitapEkle(KitapA k) { kitaplar.add(k); } public boolean KitapSil(int ıd) { boolean sonuc = false; for (int j = 0; j < kitaplar.size(); j++) { if (ıd == (kitaplar.get(j).ID)) { for (int i = 0; i < uyeler.size(); i++) { if (uyeler.get(i).UyeKitaplar.contains(kitaplar.get(j))) { JOptionPane.showMessageDialog(null, " Bu kitap Şu an bir uyede bulunuyor. Kitabı silemezsiniz.", " Kitap Uyede bulunuyor", JOptionPane.WARNING_MESSAGE); sonuc = true; break; } } if (sonuc == false) { kitaplar.remove(kitaplar.get(j)); } } } System.out.println(sonuc); return sonuc; } public boolean KitapBaskasındaVarmı(int ıd) { boolean sonuc = true; for (KitapA kitap : kitaplar) { if (ıd == (kitap.ID)) { System.out.println(kitap.isim); System.out.println("Kitapbaşkasında varmı ilk if"); for (UyeA uye : uyeler) { System.out.println("Kitapbaşkasında varmı ilk for"); System.out.println(uye.UyeKitaplar.size()); if (uye.UyeKitaplar.size() != 0) { if ((uye.UyeKitaplar.get(0).ID) == (kitap.ID)) { System.out.println("Kitapbaşkasında varmı ikinci if"); JOptionPane.showMessageDialog(null, "Sectiginiz Kitap Daha once bir Uyeye verilmiş. Kitabı Uyeye veremezsiniz.", " Kitap Uyede bulunuyor", JOptionPane.WARNING_MESSAGE); sonuc = false; break; } } } } } System.out.println("Sonuc degeri = " + sonuc); return sonuc; } public void DBuyeKitapEkle(int Kitapid, String Kitapisim, String kitapyazar, int kitapsayfa, int uyeid) { em.getTransaction().begin(); Uyekitap uyekitap = new Uyekitap(Kitapisim, kitapyazar, kitapsayfa, Kitapid, uyeid); em.persist(uyekitap); em.getTransaction().commit(); } public void DBuyedenKitapSil(int Uyeid) { Query q = em.createQuery("delete from Uyekitap uk where uk.uyeid=:pUyeid"); q.setParameter("pUyeid", Uyeid); em.getTransaction().begin(); q.executeUpdate(); em.getTransaction().commit(); } /* public boolean kitapsayısıyaz(int id) { boolean sonuc = false; for (int i = 0; i < uyeler.size(); i++) { if (id == (uyeler.get(i).ID)) { if (uyeler.get(i).UyeKitaplar.size() != 0) { sonuc = true; } } } return sonuc; } */ public void DBuyeSil(int id) { Query q = em.createQuery("Delete From Uye u where u.id=:pUyeId"); q.setParameter("pUyeId", id); em.getTransaction().begin(); q.executeUpdate(); em.getTransaction().commit(); } public void DbSilinenUyeYaz(int id) { SimpleDateFormat bicim3 = new SimpleDateFormat("dd-M-yyyy hh:mm:ss"); GregorianCalendar gcalender = new GregorianCalendar(); String tarih = bicim3.format(gcalender.getTime()); try { for (UyeA uyea : uyeler) { if (id == uyea.ID) { em.getTransaction().begin(); Silinenuye uye = new Silinenuye(uyea.ID, uyea.isim, uyea.soyisim, uyea.tc, uyea.no, tarih); em.persist(uye); em.getTransaction().commit(); } } } catch (RollbackException e) { JOptionPane.showMessageDialog(null, "Bu Tc Numarasına sahip bir uye daha once silinmiş. Ters Giden bişeyler var.", "Uyari", JOptionPane.WARNING_MESSAGE); } } public void DbSilinenuyeListedenSil(int id) { Query q = em.createQuery("Delete From Silinenuye s where s.id=:pUyeId"); q.setParameter("pUyeId", id); em.getTransaction().begin(); q.executeUpdate(); em.getTransaction().commit(); } } /* */
[ "noreply@github.com" ]
yusufnadiruzun.noreply@github.com
12922bb74effc5f1be15edde66e94db9c6f6c15f
1dda982c733f13ab7975a310ed195ffa5e32c7e7
/Source/com/drew/metadata/Directory.java
0a156e13d634b633d0c9ceaea2aa0d5f86cdff94
[ "Apache-2.0" ]
permissive
sniderzero/metadata-extractor
7435180c5c51d4e7f78200aa3e5c1301bb427c72
de0bffc2af2423ea4c9de817babeb3d564910f65
refs/heads/master
2021-01-22T12:02:15.901709
2014-11-19T03:43:54
2014-11-19T03:43:54
null
0
0
null
null
null
null
UTF-8
Java
false
false
32,749
java
/* * Copyright 2002-2014 Drew Noakes * * 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. * * More information about this project is available at: * * https://drewnoakes.com/code/exif/ * https://github.com/drewnoakes/metadata-extractor */ package com.drew.metadata; import com.drew.lang.Rational; import com.drew.lang.annotations.NotNull; import com.drew.lang.annotations.Nullable; import com.drew.lang.annotations.SuppressWarnings; import java.io.UnsupportedEncodingException; import java.lang.reflect.Array; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; /** * Abstract base class for all directory implementations, having methods for getting and setting tag values of various * data types. * * @author Drew Noakes http://drewnoakes.com */ public abstract class Directory { /** Map of values hashed by type identifiers. */ @NotNull protected final Map<Integer, Object> _tagMap = new HashMap<Integer, Object>(); /** * A convenient list holding tag values in the order in which they were stored. * This is used for creation of an iterator, and for counting the number of * defined tags. */ @NotNull protected final Collection<Tag> _definedTagList = new ArrayList<Tag>(); @NotNull private final Collection<String> _errorList = new ArrayList<String>(4); /** The descriptor used to interpret tag values. */ protected TagDescriptor _descriptor; // ABSTRACT METHODS /** * Provides the name of the directory, for display purposes. E.g. <code>Exif</code> * * @return the name of the directory */ @NotNull public abstract String getName(); /** * Provides the map of tag names, hashed by tag type identifier. * * @return the map of tag names */ @NotNull protected abstract HashMap<Integer, String> getTagNameMap(); protected Directory() {} // VARIOUS METHODS /** * Indicates whether the specified tag type has been set. * * @param tagType the tag type to check for * @return true if a value exists for the specified tag type, false if not */ @java.lang.SuppressWarnings({ "UnnecessaryBoxing" }) public boolean containsTag(int tagType) { return _tagMap.containsKey(Integer.valueOf(tagType)); } /** * Returns an Iterator of Tag instances that have been set in this Directory. * * @return an Iterator of Tag instances */ @NotNull public Collection<Tag> getTags() { return _definedTagList; } /** * Returns the number of tags set in this Directory. * * @return the number of tags set in this Directory */ public int getTagCount() { return _definedTagList.size(); } /** * Sets the descriptor used to interpret tag values. * * @param descriptor the descriptor used to interpret tag values */ @java.lang.SuppressWarnings({ "ConstantConditions" }) public void setDescriptor(@NotNull TagDescriptor descriptor) { if (descriptor == null) throw new NullPointerException("cannot set a null descriptor"); _descriptor = descriptor; } /** * Registers an error message with this directory. * * @param message an error message. */ public void addError(@NotNull String message) { _errorList.add(message); } /** * Gets a value indicating whether this directory has any error messages. * * @return true if the directory contains errors, otherwise false */ public boolean hasErrors() { return _errorList.size() > 0; } /** * Used to iterate over any error messages contained in this directory. * * @return an iterable collection of error message strings. */ @NotNull public Iterable<String> getErrors() { return _errorList; } /** Returns the count of error messages in this directory. */ public int getErrorCount() { return _errorList.size(); } // TAG SETTERS /** * Sets an <code>int</code> value for the specified tag. * * @param tagType the tag's value as an int * @param value the value for the specified tag as an int */ public void setInt(int tagType, int value) { setObject(tagType, value); } /** * Sets an <code>int[]</code> (array) for the specified tag. * * @param tagType the tag identifier * @param ints the int array to store */ public void setIntArray(int tagType, @NotNull int[] ints) { setObjectArray(tagType, ints); } /** * Sets a <code>float</code> value for the specified tag. * * @param tagType the tag's value as an int * @param value the value for the specified tag as a float */ public void setFloat(int tagType, float value) { setObject(tagType, value); } /** * Sets a <code>float[]</code> (array) for the specified tag. * * @param tagType the tag identifier * @param floats the float array to store */ public void setFloatArray(int tagType, @NotNull float[] floats) { setObjectArray(tagType, floats); } /** * Sets a <code>double</code> value for the specified tag. * * @param tagType the tag's value as an int * @param value the value for the specified tag as a double */ public void setDouble(int tagType, double value) { setObject(tagType, value); } /** * Sets a <code>double[]</code> (array) for the specified tag. * * @param tagType the tag identifier * @param doubles the double array to store */ public void setDoubleArray(int tagType, @NotNull double[] doubles) { setObjectArray(tagType, doubles); } /** * Sets a <code>String</code> value for the specified tag. * * @param tagType the tag's value as an int * @param value the value for the specified tag as a String */ @java.lang.SuppressWarnings({ "ConstantConditions" }) public void setString(int tagType, @NotNull String value) { if (value == null) throw new NullPointerException("cannot set a null String"); setObject(tagType, value); } /** * Sets a <code>String[]</code> (array) for the specified tag. * * @param tagType the tag identifier * @param strings the String array to store */ public void setStringArray(int tagType, @NotNull String[] strings) { setObjectArray(tagType, strings); } /** * Sets a <code>boolean</code> value for the specified tag. * * @param tagType the tag's value as an int * @param value the value for the specified tag as a boolean */ public void setBoolean(int tagType, boolean value) { setObject(tagType, value); } /** * Sets a <code>long</code> value for the specified tag. * * @param tagType the tag's value as an int * @param value the value for the specified tag as a long */ public void setLong(int tagType, long value) { setObject(tagType, value); } /** * Sets a <code>java.util.Date</code> value for the specified tag. * * @param tagType the tag's value as an int * @param value the value for the specified tag as a java.util.Date */ public void setDate(int tagType, @NotNull java.util.Date value) { setObject(tagType, value); } /** * Sets a <code>Rational</code> value for the specified tag. * * @param tagType the tag's value as an int * @param rational rational number */ public void setRational(int tagType, @NotNull Rational rational) { setObject(tagType, rational); } /** * Sets a <code>Rational[]</code> (array) for the specified tag. * * @param tagType the tag identifier * @param rationals the Rational array to store */ public void setRationalArray(int tagType, @NotNull Rational[] rationals) { setObjectArray(tagType, rationals); } /** * Sets a <code>byte[]</code> (array) for the specified tag. * * @param tagType the tag identifier * @param bytes the byte array to store */ public void setByteArray(int tagType, @NotNull byte[] bytes) { setObjectArray(tagType, bytes); } /** * Sets a <code>Object</code> for the specified tag. * * @param tagType the tag's value as an int * @param value the value for the specified tag * @throws NullPointerException if value is <code>null</code> */ @java.lang.SuppressWarnings( { "ConstantConditions", "UnnecessaryBoxing" }) public void setObject(int tagType, @NotNull Object value) { if (value == null) throw new NullPointerException("cannot set a null object"); if (!_tagMap.containsKey(Integer.valueOf(tagType))) { _definedTagList.add(new Tag(tagType, this)); } // else { // final Object oldValue = _tagMap.get(tagType); // if (!oldValue.equals(value)) // addError(String.format("Overwritten tag 0x%s (%s). Old=%s, New=%s", Integer.toHexString(tagType), getTagName(tagType), oldValue, value)); // } _tagMap.put(tagType, value); } /** * Sets an array <code>Object</code> for the specified tag. * * @param tagType the tag's value as an int * @param array the array of values for the specified tag */ public void setObjectArray(int tagType, @NotNull Object array) { // for now, we don't do anything special -- this method might be a candidate for removal once the dust settles setObject(tagType, array); } // TAG GETTERS /** * Returns the specified tag's value as an int, if possible. Every attempt to represent the tag's value as an int * is taken. Here is a list of the action taken depending upon the tag's original type: * <ul> * <li> int - Return unchanged. * <li> Number - Return an int value (real numbers are truncated). * <li> Rational - Truncate any fractional part and returns remaining int. * <li> String - Attempt to parse string as an int. If this fails, convert the char[] to an int (using shifts and OR). * <li> Rational[] - Return int value of first item in array. * <li> byte[] - Return int value of first item in array. * <li> int[] - Return int value of first item in array. * </ul> * * @throws MetadataException if no value exists for tagType or if it cannot be converted to an int. */ public int getInt(int tagType) throws MetadataException { Integer integer = getInteger(tagType); if (integer!=null) return integer; Object o = getObject(tagType); if (o == null) throw new MetadataException("Tag '" + getTagName(tagType) + "' has not been set -- check using containsTag() first"); throw new MetadataException("Tag '" + tagType + "' cannot be converted to int. It is of type '" + o.getClass() + "'."); } /** * Returns the specified tag's value as an Integer, if possible. Every attempt to represent the tag's value as an * Integer is taken. Here is a list of the action taken depending upon the tag's original type: * <ul> * <li> int - Return unchanged * <li> Number - Return an int value (real numbers are truncated) * <li> Rational - Truncate any fractional part and returns remaining int * <li> String - Attempt to parse string as an int. If this fails, convert the char[] to an int (using shifts and OR) * <li> Rational[] - Return int value of first item in array if length &gt; 0 * <li> byte[] - Return int value of first item in array if length &gt; 0 * <li> int[] - Return int value of first item in array if length &gt; 0 * </ul> * * If the value is not found or cannot be converted to int, <code>null</code> is returned. */ @Nullable public Integer getInteger(int tagType) { Object o = getObject(tagType); if (o == null) return null; if (o instanceof Number) { return ((Number)o).intValue(); } else if (o instanceof String) { try { return Integer.parseInt((String)o); } catch (NumberFormatException nfe) { // convert the char array to an int String s = (String)o; byte[] bytes = s.getBytes(); long val = 0; for (byte aByte : bytes) { val = val << 8; val += (aByte & 0xff); } return (int)val; } } else if (o instanceof Rational[]) { Rational[] rationals = (Rational[])o; if (rationals.length == 1) return rationals[0].intValue(); } else if (o instanceof byte[]) { byte[] bytes = (byte[])o; if (bytes.length == 1) return (int)bytes[0]; } else if (o instanceof int[]) { int[] ints = (int[])o; if (ints.length == 1) return ints[0]; } return null; } /** * Gets the specified tag's value as a String array, if possible. Only supported * where the tag is set as String[], String, int[], byte[] or Rational[]. * * @param tagType the tag identifier * @return the tag's value as an array of Strings. If the value is unset or cannot be converted, <code>null</code> is returned. */ @Nullable public String[] getStringArray(int tagType) { Object o = getObject(tagType); if (o == null) return null; if (o instanceof String[]) return (String[])o; if (o instanceof String) return new String[] { (String)o }; if (o instanceof int[]) { int[] ints = (int[])o; String[] strings = new String[ints.length]; for (int i = 0; i < strings.length; i++) strings[i] = Integer.toString(ints[i]); return strings; } else if (o instanceof byte[]) { byte[] bytes = (byte[])o; String[] strings = new String[bytes.length]; for (int i = 0; i < strings.length; i++) strings[i] = Byte.toString(bytes[i]); return strings; } else if (o instanceof Rational[]) { Rational[] rationals = (Rational[])o; String[] strings = new String[rationals.length]; for (int i = 0; i < strings.length; i++) strings[i] = rationals[i].toSimpleString(false); return strings; } return null; } /** * Gets the specified tag's value as an int array, if possible. Only supported * where the tag is set as String, Integer, int[], byte[] or Rational[]. * * @param tagType the tag identifier * @return the tag's value as an int array */ @Nullable public int[] getIntArray(int tagType) { Object o = getObject(tagType); if (o == null) return null; if (o instanceof int[]) return (int[])o; if (o instanceof Rational[]) { Rational[] rationals = (Rational[])o; int[] ints = new int[rationals.length]; for (int i = 0; i < ints.length; i++) { ints[i] = rationals[i].intValue(); } return ints; } if (o instanceof short[]) { short[] shorts = (short[])o; int[] ints = new int[shorts.length]; for (int i = 0; i < shorts.length; i++) { ints[i] = shorts[i]; } return ints; } if (o instanceof byte[]) { byte[] bytes = (byte[])o; int[] ints = new int[bytes.length]; for (int i = 0; i < bytes.length; i++) { ints[i] = bytes[i]; } return ints; } if (o instanceof CharSequence) { CharSequence str = (CharSequence)o; int[] ints = new int[str.length()]; for (int i = 0; i < str.length(); i++) { ints[i] = str.charAt(i); } return ints; } if (o instanceof Integer) return new int[] { (Integer)o }; return null; } /** * Gets the specified tag's value as an byte array, if possible. Only supported * where the tag is set as String, Integer, int[], byte[] or Rational[]. * * @param tagType the tag identifier * @return the tag's value as a byte array */ @Nullable public byte[] getByteArray(int tagType) { Object o = getObject(tagType); if (o == null) { return null; } else if (o instanceof Rational[]) { Rational[] rationals = (Rational[])o; byte[] bytes = new byte[rationals.length]; for (int i = 0; i < bytes.length; i++) { bytes[i] = rationals[i].byteValue(); } return bytes; } else if (o instanceof byte[]) { return (byte[])o; } else if (o instanceof int[]) { int[] ints = (int[])o; byte[] bytes = new byte[ints.length]; for (int i = 0; i < ints.length; i++) { bytes[i] = (byte)ints[i]; } return bytes; } else if (o instanceof short[]) { short[] shorts = (short[])o; byte[] bytes = new byte[shorts.length]; for (int i = 0; i < shorts.length; i++) { bytes[i] = (byte)shorts[i]; } return bytes; } else if (o instanceof CharSequence) { CharSequence str = (CharSequence)o; byte[] bytes = new byte[str.length()]; for (int i = 0; i < str.length(); i++) { bytes[i] = (byte)str.charAt(i); } return bytes; } if (o instanceof Integer) return new byte[] { ((Integer)o).byteValue() }; return null; } /** Returns the specified tag's value as a double, if possible. */ public double getDouble(int tagType) throws MetadataException { Double value = getDoubleObject(tagType); if (value!=null) return value; Object o = getObject(tagType); if (o == null) throw new MetadataException("Tag '" + getTagName(tagType) + "' has not been set -- check using containsTag() first"); throw new MetadataException("Tag '" + tagType + "' cannot be converted to a double. It is of type '" + o.getClass() + "'."); } /** Returns the specified tag's value as a Double. If the tag is not set or cannot be converted, <code>null</code> is returned. */ @Nullable public Double getDoubleObject(int tagType) { Object o = getObject(tagType); if (o == null) return null; if (o instanceof String) { try { return Double.parseDouble((String)o); } catch (NumberFormatException nfe) { return null; } } if (o instanceof Number) return ((Number)o).doubleValue(); return null; } /** Returns the specified tag's value as a float, if possible. */ public float getFloat(int tagType) throws MetadataException { Float value = getFloatObject(tagType); if (value!=null) return value; Object o = getObject(tagType); if (o == null) throw new MetadataException("Tag '" + getTagName(tagType) + "' has not been set -- check using containsTag() first"); throw new MetadataException("Tag '" + tagType + "' cannot be converted to a float. It is of type '" + o.getClass() + "'."); } /** Returns the specified tag's value as a float. If the tag is not set or cannot be converted, <code>null</code> is returned. */ @Nullable public Float getFloatObject(int tagType) { Object o = getObject(tagType); if (o == null) return null; if (o instanceof String) { try { return Float.parseFloat((String)o); } catch (NumberFormatException nfe) { return null; } } if (o instanceof Number) return ((Number)o).floatValue(); return null; } /** Returns the specified tag's value as a long, if possible. */ public long getLong(int tagType) throws MetadataException { Long value = getLongObject(tagType); if (value!=null) return value; Object o = getObject(tagType); if (o == null) throw new MetadataException("Tag '" + getTagName(tagType) + "' has not been set -- check using containsTag() first"); throw new MetadataException("Tag '" + tagType + "' cannot be converted to a long. It is of type '" + o.getClass() + "'."); } /** Returns the specified tag's value as a long. If the tag is not set or cannot be converted, <code>null</code> is returned. */ @Nullable public Long getLongObject(int tagType) { Object o = getObject(tagType); if (o == null) return null; if (o instanceof String) { try { return Long.parseLong((String)o); } catch (NumberFormatException nfe) { return null; } } if (o instanceof Number) return ((Number)o).longValue(); return null; } /** Returns the specified tag's value as a boolean, if possible. */ public boolean getBoolean(int tagType) throws MetadataException { Boolean value = getBooleanObject(tagType); if (value!=null) return value; Object o = getObject(tagType); if (o == null) throw new MetadataException("Tag '" + getTagName(tagType) + "' has not been set -- check using containsTag() first"); throw new MetadataException("Tag '" + tagType + "' cannot be converted to a boolean. It is of type '" + o.getClass() + "'."); } /** Returns the specified tag's value as a boolean. If the tag is not set or cannot be converted, <code>null</code> is returned. */ @Nullable @SuppressWarnings(value = "NP_BOOLEAN_RETURN_NULL", justification = "keep API interface consistent") public Boolean getBooleanObject(int tagType) { Object o = getObject(tagType); if (o == null) return null; if (o instanceof Boolean) return (Boolean)o; if (o instanceof String) { try { return Boolean.getBoolean((String)o); } catch (NumberFormatException nfe) { return null; } } if (o instanceof Number) return (((Number)o).doubleValue() != 0); return null; } /** * Returns the specified tag's value as a java.util.Date. If the value is unset or cannot be converted, <code>null</code> is returned. * <p/> * If the underlying value is a {@link String}, then attempts will be made to parse the string as though it is in * the current {@link TimeZone}. If the {@link TimeZone} is known, call the overload that accepts one as an argument. */ @Nullable public java.util.Date getDate(int tagType) { return getDate(tagType, null); } /** * Returns the specified tag's value as a java.util.Date. If the value is unset or cannot be converted, <code>null</code> is returned. * <p/> * If the underlying value is a {@link String}, then attempts will be made to parse the string as though it is in * the {@link TimeZone} represented by the {@code timeZone} parameter (if it is non-null). Note that this parameter * is only considered if the underlying value is a string and parsing occurs, otherwise it has no effect. */ @Nullable public java.util.Date getDate(int tagType, @Nullable TimeZone timeZone) { Object o = getObject(tagType); if (o == null) return null; if (o instanceof java.util.Date) return (java.util.Date)o; if (o instanceof String) { // This seems to cover all known Exif date strings // Note that " : : : : " is a valid date string according to the Exif spec (which means 'unknown date'): http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/datetimeoriginal.html String datePatterns[] = { "yyyy:MM:dd HH:mm:ss", "yyyy:MM:dd HH:mm", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm" }; String dateString = (String)o; for (String datePattern : datePatterns) { try { DateFormat parser = new SimpleDateFormat(datePattern); if (timeZone != null) parser.setTimeZone(timeZone); return parser.parse(dateString); } catch (ParseException ex) { // simply try the next pattern } } } return null; } /** Returns the specified tag's value as a Rational. If the value is unset or cannot be converted, <code>null</code> is returned. */ @Nullable public Rational getRational(int tagType) { Object o = getObject(tagType); if (o == null) return null; if (o instanceof Rational) return (Rational)o; if (o instanceof Integer) return new Rational((Integer)o, 1); if (o instanceof Long) return new Rational((Long)o, 1); // NOTE not doing conversions for real number types return null; } /** Returns the specified tag's value as an array of Rational. If the value is unset or cannot be converted, <code>null</code> is returned. */ @Nullable public Rational[] getRationalArray(int tagType) { Object o = getObject(tagType); if (o == null) return null; if (o instanceof Rational[]) return (Rational[])o; return null; } /** * Returns the specified tag's value as a String. This value is the 'raw' value. A more presentable decoding * of this value may be obtained from the corresponding Descriptor. * * @return the String representation of the tag's value, or * <code>null</code> if the tag hasn't been defined. */ @Nullable public String getString(int tagType) { Object o = getObject(tagType); if (o == null) return null; if (o instanceof Rational) return ((Rational)o).toSimpleString(true); if (o.getClass().isArray()) { // handle arrays of objects and primitives int arrayLength = Array.getLength(o); final Class<?> componentType = o.getClass().getComponentType(); boolean isObjectArray = Object.class.isAssignableFrom(componentType); boolean isFloatArray = componentType.getName().equals("float"); boolean isDoubleArray = componentType.getName().equals("double"); boolean isIntArray = componentType.getName().equals("int"); boolean isLongArray = componentType.getName().equals("long"); boolean isByteArray = componentType.getName().equals("byte"); boolean isShortArray = componentType.getName().equals("short"); StringBuilder string = new StringBuilder(); for (int i = 0; i < arrayLength; i++) { if (i != 0) string.append(' '); if (isObjectArray) string.append(Array.get(o, i).toString()); else if (isIntArray) string.append(Array.getInt(o, i)); else if (isShortArray) string.append(Array.getShort(o, i)); else if (isLongArray) string.append(Array.getLong(o, i)); else if (isFloatArray) string.append(Array.getFloat(o, i)); else if (isDoubleArray) string.append(Array.getDouble(o, i)); else if (isByteArray) string.append(Array.getByte(o, i)); else addError("Unexpected array component type: " + componentType.getName()); } return string.toString(); } // Note that several cameras leave trailing spaces (Olympus, Nikon) but this library is intended to show // the actual data within the file. It is not inconceivable that whitespace may be significant here, so we // do not trim. Also, if support is added for writing data back to files, this may cause issues. // We leave trimming to the presentation layer. return o.toString(); } @Nullable public String getString(int tagType, String charset) { byte[] bytes = getByteArray(tagType); if (bytes==null) return null; try { return new String(bytes, charset); } catch (UnsupportedEncodingException e) { return null; } } /** * Returns the object hashed for the particular tag type specified, if available. * * @param tagType the tag type identifier * @return the tag's value as an Object if available, else <code>null</code> */ @java.lang.SuppressWarnings({ "UnnecessaryBoxing" }) @Nullable public Object getObject(int tagType) { return _tagMap.get(Integer.valueOf(tagType)); } // OTHER METHODS /** * Returns the name of a specified tag as a String. * * @param tagType the tag type identifier * @return the tag's name as a String */ @NotNull public String getTagName(int tagType) { HashMap<Integer, String> nameMap = getTagNameMap(); if (!nameMap.containsKey(tagType)) { String hex = Integer.toHexString(tagType); while (hex.length() < 4) { hex = "0" + hex; } return "Unknown tag (0x" + hex + ")"; } return nameMap.get(tagType); } /** * Provides a description of a tag's value using the descriptor set by * <code>setDescriptor(Descriptor)</code>. * * @param tagType the tag type identifier * @return the tag value's description as a String */ @Nullable public String getDescription(int tagType) { assert(_descriptor != null); return _descriptor.getDescription(tagType); } }
[ "git@drewnoakes.com" ]
git@drewnoakes.com
2d0e8cd3d224d6e0010a783f6fe858055fd1730a
b74b4f31817b401b60ba3dfb1b50658d79977c7e
/src/com/Substation/TText.java
e51bf402306b6130fcafe9b52cf3fc5c59e142fe
[]
no_license
AnastasiaPrix/BananaProject
d34b3ffa93b0da44d5e9d14656c9111294c5dbbe
a6b70fc7f1696c72bede207ed16b62e256452d28
refs/heads/master
2022-05-30T18:07:13.381535
2019-06-28T16:49:05
2019-06-28T16:49:05
186,911,746
0
0
null
2022-05-20T20:57:48
2019-05-15T22:34:52
SuperCollider
UTF-8
Java
false
false
1,851
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2018.05.14 at 02:34:33 PM MSK // package com.Substation; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for tText complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="tText"> * &lt;complexContent> * &lt;extension base="{http://www.iec.ch/61850/2006/SCL}tAnyContentFromOtherNamespace"> * &lt;attribute name="source" type="{http://www.w3.org/2001/XMLSchema}anyURI" /> * &lt;anyAttribute processContents='lax' namespace='##other'/> * &lt;/extension> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "tText") public class TText extends TAnyContentFromOtherNamespace { @XmlAttribute(name = "source") @XmlSchemaType(name = "anyURI") protected String source; /** * Gets the value of the source property. * * @return * possible object is * {@link String } * */ public String getSource() { return source; } /** * Sets the value of the source property. * * @param value * allowed object is * {@link String } * */ public void setSource(String value) { this.source = value; } }
[ "diana-96.9696@mail.ru" ]
diana-96.9696@mail.ru
9ebac774068bfe287b688883d5b30a6a4cc93c65
3983c85a296b0e2576a064c6dbf6e58a2ee04069
/product-api/src/main/java/com/cantarino/ms/models/Category.java
aec13f3f7879b4775cab863d7d0a3e9e6db89606
[]
no_license
renatocantarino/kubernets-spring
431d8a1b0556b87387b9c395f552024abc4414ed
4cb89633e05a319e28d118f0e2d1854105c2e53f
refs/heads/main
2023-04-06T02:58:55.371467
2021-04-11T13:21:51
2021-04-11T13:21:51
351,825,880
0
0
null
null
null
null
UTF-8
Java
false
false
587
java
package com.cantarino.ms.models; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; @Entity(name="category") public class Category { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private long id; private String nome; public long getId() { return id; } public void setId(long id) { this.id = id; } public String getNome() { return nome; } public void setNome(String nome) { this.nome = nome; } }
[ "cast.carlosc.utic@sebrae.com.br" ]
cast.carlosc.utic@sebrae.com.br
a11680efeaa15c2508a249ca0ea2d94db5a09409
511b5dcf5fc85437f45c27ae2a53ca76c26bbbf9
/src/main/java/ua/nure/dudka/hospital/entity/Client.java
11e9b7760b67942f1617884a3b2524ecff016833
[]
no_license
Eyelessdude/hospital
936924cf4f805ab17d1c24129eed03181a464f6e
6ec82adf923b12c447c74d427aad512ae9772351
refs/heads/master
2020-04-24T19:32:47.258328
2019-05-05T18:01:02
2019-05-05T18:01:02
172,215,533
0
0
null
null
null
null
UTF-8
Java
false
false
1,757
java
package ua.nure.dudka.hospital.entity; import ua.nure.dudka.hospital.constants.Role; public class Client { private int id; private String login; private String password; private String name; private String surname; private Role role; private String additionalInfo; public Client() { } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getLogin() { return login; } public void setLogin(String login) { this.login = login; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getSurname() { return surname; } public void setSurname(String surname) { this.surname = surname; } public Role getRole() { return role; } public void setRole(Role role) { this.role = role; } public String getAdditionalInfo() { return additionalInfo; } public void setAdditionalInfo(String additionalInfo) { this.additionalInfo = additionalInfo; } @Override public String toString() { String client = "Client name: " + name + ", surname: " + surname + " role: " + role.getName(); if (additionalInfo != null && !additionalInfo.isEmpty()) { client += " additional info: " + additionalInfo; } return client; } public int compareTo(Client client) { return this.getName().compareToIgnoreCase(client.getName()); } }
[ "bohdandudka@gmail.com" ]
bohdandudka@gmail.com
7e64ebaf3ca986909a36d79f947ea02839b4b3eb
3317adbed66fa1542d937c964d8d0e1d8eec490f
/src/tsuchitoi/kadai/CryptDecode.java
76130cb3635bc47919e6b9870fcd64296d45aa46
[]
no_license
sudoy/tsd-share2018
73a7d5435912e1d85f7be0821be8145709bf1ec0
32f5d13f8c3df906afc5b2cff46c6ef445e1621f
refs/heads/master
2020-03-14T15:15:20.076869
2018-05-30T01:45:38
2018-05-30T01:45:38
131,671,908
0
0
null
null
null
null
UTF-8
Java
false
false
997
java
package tsuchitoi.kadai; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.util.Scanner; public class CryptDecode { public static void main(String[] args) { Scanner scn = new Scanner(System.in); System.out.println("CryptDecode(復号化)"); System.out.println("-------------------------------"); System.out.print("ファイル名 : "); File inputFile = new File("c:\\output\\" + scn.nextLine()); scn.close(); FileInputStream in = null; System.out.println("データ : "); try { in = new FileInputStream(inputFile); int c; while((c = in.read()) != -1) { System.out.print((char)(c - 1)); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); }finally { try { if(in != null) { in.close(); } } catch (IOException e) { e.printStackTrace(); } } } }
[ "tsuchitoi.keita@tsd-201601-0004" ]
tsuchitoi.keita@tsd-201601-0004
ace87421210b3e9ef3440bd6f30a435c34a9792d
9ab91b074703bcfe9c9407e1123e2b551784a680
/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/DestroyableService.java
5fefb422a2d52cc9e7ab6d84948699a1511e9beb
[]
no_license
pkdevbox/osee
7ad9c083c3df8a7e9ef6185a419680cc08e21769
7e31f80f43d6d0b661af521fdd93b139cb694001
refs/heads/master
2021-01-22T00:30:05.686402
2015-06-08T21:19:57
2015-06-09T18:42:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
617
java
/******************************************************************************* * Copyright (c) 2004, 2007 Boeing. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Boeing - initial API and implementation *******************************************************************************/ package org.eclipse.osee.ote.core.framework; public interface DestroyableService { void destroy(); }
[ "rbrooks@ee007c2a-0a25-0410-9ab9-bf268980928c" ]
rbrooks@ee007c2a-0a25-0410-9ab9-bf268980928c
935bacb818f8fc776986d0091d725ee0024e8b2f
7d841458fd912eb7d295619d015a1f25d75b052e
/latte-ec/src/main/java/com/diabin/latte/ec/launcher/LauncherScrollDelegate.java
f0f1bfeb21c767ab68df13c321764524241cfe0b
[]
no_license
johnYin2015/ECApp
2304d39929878369c6a9287a571308c2e0e1c0fd
53fd0268ed405f96d34fe48c45270edface2058b
refs/heads/master
2020-09-22T03:17:20.453095
2019-12-07T15:43:45
2019-12-07T15:43:45
225,030,125
1
0
null
null
null
null
UTF-8
Java
false
false
3,274
java
package com.diabin.latte.ec.launcher; import android.app.Activity; import android.os.Bundle; import android.support.annotation.Nullable; import android.view.View; import com.bigkoo.convenientbanner.ConvenientBanner; import com.bigkoo.convenientbanner.listener.OnItemClickListener; import com.diabin.latte.core.app.AccountManager; import com.diabin.latte.core.app.IUserChecker; import com.diabin.latte.core.delegates.LatteDelegate; import com.diabin.latte.ui.launcher.IOnLauncherFinishListener; import com.diabin.latte.ui.launcher.LauncherHolderCreator; import com.diabin.latte.ui.launcher.OnLauncherFinishTag; import com.diabin.latte.ui.launcher.ScrollLauncherTag; import com.diabin.latte.core.ui.storage.LattePreference; import com.diabin.latte.ec.R; import java.util.ArrayList; public class LauncherScrollDelegate extends LatteDelegate implements OnItemClickListener { //页面翻转view private ConvenientBanner<Integer> mConvenientBanner; //图片集合 private final ArrayList<Integer> INTEGERS = new ArrayList<>(); private IOnLauncherFinishListener mIOnLauncherFinishListener; //初始化图片集合 private void init() { INTEGERS.add(R.mipmap.launcher_01); INTEGERS.add(R.mipmap.launcher_02); INTEGERS.add(R.mipmap.launcher_03); INTEGERS.add(R.mipmap.launcher_04); INTEGERS.add(R.mipmap.launcher_05); mConvenientBanner.setPages(new LauncherHolderCreator(), INTEGERS) .setPageIndicator(new int[]{R.drawable.dot_normal, R.drawable.dot_focus}) .setPageIndicatorAlign(ConvenientBanner.PageIndicatorAlign.CENTER_HORIZONTAL) .setOnItemClickListener(this) .setCanLoop(false); } @Override public Object setLayout() { mConvenientBanner = new ConvenientBanner<Integer>(getProxyActivity()); return mConvenientBanner; } @Override public void onBindView(View rootView, @Nullable Bundle savedInstanceState) { super.onBindView(rootView, savedInstanceState); init(); } @Override public void onAttach(Activity activity) { super.onAttach(activity); if (activity instanceof IOnLauncherFinishListener) { mIOnLauncherFinishListener = (IOnLauncherFinishListener) activity; } } @Override public void onItemClick(int position) { //如果是最后一张 if (position == INTEGERS.size() - 1) { LattePreference.setAppFlag(ScrollLauncherTag.HAS_FIRST_LAUNCH_APP.name(), true); //检查是否已登录 AccountManager.checkAccount(new IUserChecker() { //登录 @Override public void onSignin() { if (mIOnLauncherFinishListener != null) { mIOnLauncherFinishListener.onLaunchFinish(OnLauncherFinishTag.SIGNED); } } //未登录 @Override public void onNotSignin() { if (mIOnLauncherFinishListener != null) { mIOnLauncherFinishListener.onLaunchFinish(OnLauncherFinishTag.NOTSIGNED); } } }); } } }
[ "wit.zhaoguo@gmail.com" ]
wit.zhaoguo@gmail.com
5e104269d319bdce37375ff880ce4014f61d780f
4b159cbb203dbe0204013905707b798f4f6ac918
/Slides de Aula/Interface Gráfica/joptionpane/Principal.java
428cf259356053e131497f2b74ef32193cc2b30d
[]
no_license
andreFelipeHFuck/monitoriapoo
aad6bec5321b2ac6dac41a2926519db764da6912
e8f474a2dccd5cc8723b3626e1ecf7026271827a
refs/heads/master
2023-07-06T23:42:56.440318
2021-08-02T21:26:24
2021-08-02T21:26:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
425
java
package joptionpane; import javax.swing.JFrame; public class Principal extends JFrame { public Principal() { setTitle("Exemplo"); setBounds(50, 50, 300, 300); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } public static void main(String[] args) { Principal exemplo = new Principal(); exemplo.add(new ExemploJOptionPane()); exemplo.setVisible(true); } }
[ "vtkwki@gmail.com" ]
vtkwki@gmail.com
4974e3f6bb827fcb28dcf4df77e0af17f8829593
0bd2473282bb09e3e0bfe30238bb0fa725c0fb50
/src/com/swimming/ui/menu/management/MoneyManagement.java
d905e990e83484bfcb12acd305770679da6a97f6
[]
no_license
jamesaa123aah/swim
db22cee93cc8b4be65d781a7bb4a5a8242f6bd9f
ef827dab374cef4d76f665b7e6ff1d79b65c17d7
refs/heads/master
2021-01-11T01:10:07.178774
2017-02-27T13:59:37
2017-02-27T13:59:37
71,053,818
0
0
null
null
null
null
GB18030
Java
false
false
2,591
java
package com.swimming.ui.menu.management; import java.awt.FlowLayout; import javax.swing.JButton; import javax.swing.JComboBox; import javax.swing.JDialog; import javax.swing.JLabel; import javax.swing.JTextField; public class MoneyManagement extends JDialog{ JLabel jLabel_name = new JLabel("姓名:"); JLabel jLabel_id = new JLabel("学号:"); JLabel jLabel_class = new JLabel("班级:"); JLabel jLabel_money = new JLabel("金额(RMB):"); JLabel jLabel_times = new JLabel("次数:"); // combobox内容 String arry_name[]={"王麻子","张三哈哈","李四"}; String arry_id[]={"000001","000345"}; String arry_class[]={"王飞教练班","张一山教练班","赵四海教练班"}; String arry_times[]={"1","2","3","4","5"}; JComboBox jComboBox_name = new JComboBox<>(arry_name); JComboBox jComboBox_id = new JComboBox<>(arry_id); JComboBox jComboBox_class = new JComboBox<>(arry_class); JTextField jTextField_money = new JTextField(10); JComboBox jComboBox_times = new JComboBox<>(arry_times); JButton jButton_confirm = new JButton("确认缴费"); public MoneyManagement() { // TODO Auto-generated constructor stub // 增加姓名输入 jLabel_name.setSize(40, 30); jLabel_name.setLocation(5, 5); add(jLabel_name); jComboBox_name.setSize(100, 20); jComboBox_name.setLocation(45, 10); add(jComboBox_name); // 增加学号植入 jLabel_id.setSize(40,30); jLabel_id.setLocation(180, 5); add(jLabel_id); jComboBox_id.setSize(100, 20); jComboBox_id.setLocation(220, 10); add(jComboBox_id); // 增加班级输入 jLabel_class.setSize(40, 30); jLabel_class.setLocation(5, 50); add(jLabel_class); jComboBox_class.setSize(100, 20); jComboBox_class.setLocation(45, 50); add(jComboBox_class); // 缴费多少(RMB) jLabel_money.setSize(75, 30); jLabel_money.setLocation(5, 95); add(jLabel_money); jTextField_money.setSize(60, 20); jTextField_money.setLocation(80, 100); add(jTextField_money); // 相应费用折合多少次 jLabel_times.setSize(40, 30); jLabel_times.setLocation(180, 95); add(jLabel_times); jComboBox_times.setSize(100, 20); jComboBox_times.setLocation(220, 100); add(jComboBox_times); // 确认缴费按钮 jButton_confirm.setSize(100, 30); jButton_confirm.setLocation(150, 180); add(jButton_confirm); setDefaultCloseOperation(2); setTitle("缴费"); //setLayout(new FlowLayout(1,5,30));// 设置布局流式布局 setLayout(null); setModal(true); setSize(400,300); setLocationRelativeTo(null);// 窗口居中 } }
[ "609454279@qq.com" ]
609454279@qq.com
59662910cd5e6b5cd64ed9a83ee8c08ef3f73dd4
2a7d6e68fbfc3ae796ccca5d2f2cdc4748ea08e1
/constraintviewdemo/src/androidTest/java/com/example/constraintviewdemo/ExampleInstrumentedTest.java
5b92e1ccdf3b8bbca0cf61cdd8ee6cb97d5c98b0
[]
no_license
cxydxpx/Simple_apen
e76781d8bfe7bf85b3fd13c4beb34a5868e2269f
d5960509cece33fdec2ff6f294607abf42fcd5ab
refs/heads/master
2022-02-18T17:14:11.804777
2019-08-21T08:16:28
2019-08-21T08:16:28
107,208,078
0
0
null
null
null
null
UTF-8
Java
false
false
744
java
package com.example.constraintviewdemo; 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.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.example.constraintviewdemo", appContext.getPackageName()); } }
[ "cxydxpx@163.com" ]
cxydxpx@163.com
30f69171d0e7c4c87b0be1fe30907a28a369c708
7306e7b819c0628d0f6794e1a768e30ab23dc20f
/Java Project/src/Practice1/Factorial.java
90c6ce7f0ef37afcc040649bbc41f7409975ccf5
[]
no_license
revathikanna/9PMbatch
0fffcbfa90da7c3c9da47ee427e50f919e89ae84
b8ddfdd5c977cefd0b0fdfe1f96f9469e3faa4df
refs/heads/master
2023-06-25T09:11:17.559644
2021-07-29T18:09:29
2021-07-29T18:09:29
390,798,300
0
0
null
null
null
null
UTF-8
Java
false
false
280
java
package Practice1; public class Factorial { public static void main(String args[]) { int i,fact=1; int number=10; for(i=1;i<=number;i++) { fact=fact*i; } System.out.println("Factorial of "+number+" is: "+fact); } }
[ "145792@LTCA122202.cts.com" ]
145792@LTCA122202.cts.com
8de2d8693b47a8798c33352d8c2dcc07e034c83f
b9b0d8cf1cf81ef9023f49327a21b54d9e741615
/rekex-grammar/src/main/java/org/rekex/helper/anno/Size.java
6c7420edf2c50038843ad45b4a3c9afdfd43e688
[ "Apache-2.0" ]
permissive
truongvantuan/rekex
8054d3d2b5eeb37b035d067d222fe539b45d73fb
2933140859bae04ebf3cce067760969210b6be7f
refs/heads/main
2023-07-13T04:31:24.036274
2021-08-18T17:17:05
2021-08-18T17:17:05
397,793,887
2
0
Apache-2.0
2021-08-19T02:37:14
2021-08-19T02:37:14
null
UTF-8
Java
false
false
667
java
package org.rekex.helper.anno; import org.rekex.annomacro.AnnoMacro; import org.rekex.common_util.AnnoBuilder; import org.rekex.spec.SizeLimit; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * `@Size(n)` is equivalent to {@link SizeLimit @SizeLimit(min=n, max=n)}. */ @Target(ElementType.TYPE_USE) @Retention(RetentionPolicy.RUNTIME) public @interface Size { int value(); AnnoMacro<Size, SizeLimit> toRange = thiz -> AnnoBuilder.build(SizeLimit.class, SizeLimit::min, thiz.value(), SizeLimit::max, thiz.value()); }
[ "zhong.j.yu@gmail.com" ]
zhong.j.yu@gmail.com
4b1bed8f95ee0d3d2e9b4ff85e84068af1fcdd7f
8e2fa16149325b818d7dd0864179655ede9e808b
/src/main/java/net/square/utilities/location/PastLocations.java
39f029e752ac19fa4794949e35f5aceeddd56d7d
[ "Apache-2.0" ]
permissive
RainbowyDev/Visage
257ca8b66747a308ff9d12da830272461374b630
39570f837e1393df3cada3f0bd6b6cbcf1371b04
refs/heads/main
2023-02-27T05:09:07.790169
2021-02-03T17:03:28
2021-02-03T17:03:28
335,695,430
3
0
null
null
null
null
UTF-8
Java
false
false
1,060
java
package net.square.utilities.location; import net.square.utilities.lists.EvictingList; import org.bukkit.Location; import java.util.ArrayList; import java.util.Comparator; import java.util.List; import static java.lang.Math.abs; public class PastLocations { public final List<CustomLocation> previousLocations = new EvictingList<>(20); public List<CustomLocation> getEstimatedLocation(long time, long delta) { List<CustomLocation> toSort = new ArrayList<>(this.previousLocations); toSort.sort(Comparator.comparingLong( location -> abs(location.getTimeStamp() - (System.currentTimeMillis() - time)) )); List<CustomLocation> list = new ArrayList<>(); for (CustomLocation location : toSort) { if (abs(location.getTimeStamp() - (System.currentTimeMillis() - time)) < delta) { list.add(location); } } return list; } public void addLocation(Location location) { this.previousLocations.add(new CustomLocation(location)); } }
[ "noreply@github.com" ]
RainbowyDev.noreply@github.com
a07199174c7a7201ba4c91652910d6a5b9832177
33cd15771ba81da37aa04df0743fb1c8d076ee4d
/common/src/main/java/com/sishuok/es/common/plugin/web/controller/BaseMovableController.java
87c2bf127549bfc2976be1f0d6fe306ebb837514
[ "Apache-2.0" ]
permissive
teacher1998/es
4117dd917de8609aadb2538a3c18aa42f7bb6374
866bde41ee32bb29df0042d7bd5fda0406afdb37
refs/heads/master
2021-01-21T01:10:53.385006
2013-05-05T11:11:04
2013-05-05T11:11:04
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,353
java
/** * Copyright (c) 2005-2012 https://github.com/zhangkaitao * * Licensed under the Apache License, Version 2.0 (the "License"); */ package com.sishuok.es.common.plugin.web.controller; import com.sishuok.es.common.entity.BaseEntity; import com.sishuok.es.common.entity.search.Searchable; import com.sishuok.es.common.plugin.entity.Movable; import com.sishuok.es.common.plugin.serivce.BaseMovableService; import com.sishuok.es.common.utils.MessageUtils; import com.sishuok.es.common.web.bind.annotation.PageableDefaults; import com.sishuok.es.common.web.controller.BaseCRUDController; import com.sishuok.es.common.web.validate.AjaxResponse; import org.springframework.ui.Model; import org.springframework.util.Assert; 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.ResponseBody; import java.io.Serializable; /** * <p>User: Zhang Kaitao * <p>Date: 13-2-22 下午4:15 * <p>Version: 1.0 */ public abstract class BaseMovableController<M extends BaseEntity & Movable, ID extends Serializable> extends BaseCRUDController<M, ID> { private BaseMovableService movableService; public void setMovableService(BaseMovableService<M, ID> movableService) { setBaseService(movableService); this.movableService = movableService; } @Override public void afterPropertiesSet() throws Exception { super.afterPropertiesSet(); Assert.notNull(movableService, "movable service must not null"); } @RequestMapping(method = RequestMethod.GET) @PageableDefaults(value = 10, sort = "weight=desc") @Override public String list(Searchable searchable, Model model) { return super.list(searchable, model); } @RequestMapping(value = "up/{fromId}/{toId}") @ResponseBody public AjaxResponse up(@PathVariable("fromId") Long fromId, @PathVariable("toId") Long toId) { AjaxResponse ajaxResponse = new AjaxResponse("移动位置成功"); try { movableService.up(fromId, toId); } catch (IllegalStateException e) { ajaxResponse.setSuccess(Boolean.FALSE); ajaxResponse.setMessage(MessageUtils.message("move.not.enough")); } return ajaxResponse; } @RequestMapping(value = "down/{fromId}/{toId}") @ResponseBody public AjaxResponse down(@PathVariable("fromId") Long fromId, @PathVariable("toId") Long toId) { AjaxResponse ajaxResponse = new AjaxResponse("移动位置成功"); try { movableService.down(fromId, toId); } catch (IllegalStateException e) { ajaxResponse.setSuccess(Boolean.FALSE); ajaxResponse.setMessage(MessageUtils.message("move.not.enough")); } return ajaxResponse; } @RequestMapping(value = "reweight") @ResponseBody public AjaxResponse reweight() { AjaxResponse ajaxResponse = new AjaxResponse("优化权重成功!"); try { movableService.reweight(); } catch (IllegalStateException e) { ajaxResponse.setSuccess(Boolean.FALSE); ajaxResponse.setMessage("优化权重失败了!"); } return ajaxResponse; } }
[ "zhangkaitao0503@gmail.com" ]
zhangkaitao0503@gmail.com
1baec1c35c9bc72de64bf77000eb364096b1d7db
b55f95d900ab264396ec5ede8cb9f36d87b260ed
/xds/src/generated/main/java/io/grpc/xds/shaded/envoy/api/v2/endpoint/Endpoint.java
87d26eea13ed6fd4fb4e26c428f16df63a8ecc65
[ "Apache-2.0" ]
permissive
marcosmartinez7/grpc-gateway-poc
667390b2b2d273b651aea3d0bb60b3e205764241
17879be77abfe4f008f9a7ed15143deb5705c1d9
refs/heads/master
2021-06-30T05:32:13.036397
2020-02-09T19:43:54
2020-02-09T19:43:54
177,845,888
0
0
Apache-2.0
2020-10-13T12:34:10
2019-03-26T18:23:59
Java
UTF-8
Java
false
true
59,219
java
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: envoy/api/v2/endpoint/endpoint.proto package io.grpc.xds.shaded.envoy.api.v2.endpoint; /** * <pre> * Upstream host identifier. * </pre> * * Protobuf type {@code envoy.api.v2.endpoint.Endpoint} */ public final class Endpoint extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:envoy.api.v2.endpoint.Endpoint) EndpointOrBuilder { private static final long serialVersionUID = 0L; // Use Endpoint.newBuilder() to construct. private Endpoint(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private Endpoint() { } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private Endpoint( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 10: { io.grpc.xds.shaded.envoy.api.v2.core.Address.Builder subBuilder = null; if (address_ != null) { subBuilder = address_.toBuilder(); } address_ = input.readMessage(io.grpc.xds.shaded.envoy.api.v2.core.Address.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(address_); address_ = subBuilder.buildPartial(); } break; } case 18: { io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig.Builder subBuilder = null; if (healthCheckConfig_ != null) { subBuilder = healthCheckConfig_.toBuilder(); } healthCheckConfig_ = input.readMessage(io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(healthCheckConfig_); healthCheckConfig_ = subBuilder.buildPartial(); } break; } default: { if (!parseUnknownFieldProto3( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return io.grpc.xds.shaded.envoy.api.v2.endpoint.EndpointOuterClass.internal_static_envoy_api_v2_endpoint_Endpoint_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return io.grpc.xds.shaded.envoy.api.v2.endpoint.EndpointOuterClass.internal_static_envoy_api_v2_endpoint_Endpoint_fieldAccessorTable .ensureFieldAccessorsInitialized( io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.class, io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.Builder.class); } public interface HealthCheckConfigOrBuilder extends // @@protoc_insertion_point(interface_extends:envoy.api.v2.endpoint.Endpoint.HealthCheckConfig) com.google.protobuf.MessageOrBuilder { /** * <pre> * Optional alternative health check port value. * By default the health check address port of an upstream host is the same * as the host's serving address port. This provides an alternative health * check port. Setting this with a non-zero value allows an upstream host * to have different health check address port. * </pre> * * <code>uint32 port_value = 1 [(.validate.rules) = { ... }</code> */ int getPortValue(); } /** * <pre> * The optional health check configuration. * </pre> * * Protobuf type {@code envoy.api.v2.endpoint.Endpoint.HealthCheckConfig} */ public static final class HealthCheckConfig extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:envoy.api.v2.endpoint.Endpoint.HealthCheckConfig) HealthCheckConfigOrBuilder { private static final long serialVersionUID = 0L; // Use HealthCheckConfig.newBuilder() to construct. private HealthCheckConfig(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private HealthCheckConfig() { portValue_ = 0; } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private HealthCheckConfig( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 8: { portValue_ = input.readUInt32(); break; } default: { if (!parseUnknownFieldProto3( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return io.grpc.xds.shaded.envoy.api.v2.endpoint.EndpointOuterClass.internal_static_envoy_api_v2_endpoint_Endpoint_HealthCheckConfig_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return io.grpc.xds.shaded.envoy.api.v2.endpoint.EndpointOuterClass.internal_static_envoy_api_v2_endpoint_Endpoint_HealthCheckConfig_fieldAccessorTable .ensureFieldAccessorsInitialized( io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig.class, io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig.Builder.class); } public static final int PORT_VALUE_FIELD_NUMBER = 1; private int portValue_; /** * <pre> * Optional alternative health check port value. * By default the health check address port of an upstream host is the same * as the host's serving address port. This provides an alternative health * check port. Setting this with a non-zero value allows an upstream host * to have different health check address port. * </pre> * * <code>uint32 port_value = 1 [(.validate.rules) = { ... }</code> */ public int getPortValue() { return portValue_; } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (portValue_ != 0) { output.writeUInt32(1, portValue_); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (portValue_ != 0) { size += com.google.protobuf.CodedOutputStream .computeUInt32Size(1, portValue_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig)) { return super.equals(obj); } io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig other = (io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig) obj; boolean result = true; result = result && (getPortValue() == other.getPortValue()); result = result && unknownFields.equals(other.unknownFields); return result; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + PORT_VALUE_FIELD_NUMBER; hash = (53 * hash) + getPortValue(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public static io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * <pre> * The optional health check configuration. * </pre> * * Protobuf type {@code envoy.api.v2.endpoint.Endpoint.HealthCheckConfig} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:envoy.api.v2.endpoint.Endpoint.HealthCheckConfig) io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfigOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return io.grpc.xds.shaded.envoy.api.v2.endpoint.EndpointOuterClass.internal_static_envoy_api_v2_endpoint_Endpoint_HealthCheckConfig_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return io.grpc.xds.shaded.envoy.api.v2.endpoint.EndpointOuterClass.internal_static_envoy_api_v2_endpoint_Endpoint_HealthCheckConfig_fieldAccessorTable .ensureFieldAccessorsInitialized( io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig.class, io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig.Builder.class); } // Construct using io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { } } @java.lang.Override public Builder clear() { super.clear(); portValue_ = 0; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return io.grpc.xds.shaded.envoy.api.v2.endpoint.EndpointOuterClass.internal_static_envoy_api_v2_endpoint_Endpoint_HealthCheckConfig_descriptor; } @java.lang.Override public io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig getDefaultInstanceForType() { return io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig.getDefaultInstance(); } @java.lang.Override public io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig build() { io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig buildPartial() { io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig result = new io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig(this); result.portValue_ = portValue_; onBuilt(); return result; } @java.lang.Override public Builder clone() { return (Builder) super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return (Builder) super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return (Builder) super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return (Builder) super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return (Builder) super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return (Builder) super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig) { return mergeFrom((io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig other) { if (other == io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig.getDefaultInstance()) return this; if (other.getPortValue() != 0) { setPortValue(other.getPortValue()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int portValue_ ; /** * <pre> * Optional alternative health check port value. * By default the health check address port of an upstream host is the same * as the host's serving address port. This provides an alternative health * check port. Setting this with a non-zero value allows an upstream host * to have different health check address port. * </pre> * * <code>uint32 port_value = 1 [(.validate.rules) = { ... }</code> */ public int getPortValue() { return portValue_; } /** * <pre> * Optional alternative health check port value. * By default the health check address port of an upstream host is the same * as the host's serving address port. This provides an alternative health * check port. Setting this with a non-zero value allows an upstream host * to have different health check address port. * </pre> * * <code>uint32 port_value = 1 [(.validate.rules) = { ... }</code> */ public Builder setPortValue(int value) { portValue_ = value; onChanged(); return this; } /** * <pre> * Optional alternative health check port value. * By default the health check address port of an upstream host is the same * as the host's serving address port. This provides an alternative health * check port. Setting this with a non-zero value allows an upstream host * to have different health check address port. * </pre> * * <code>uint32 port_value = 1 [(.validate.rules) = { ... }</code> */ public Builder clearPortValue() { portValue_ = 0; onChanged(); return this; } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFieldsProto3(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:envoy.api.v2.endpoint.Endpoint.HealthCheckConfig) } // @@protoc_insertion_point(class_scope:envoy.api.v2.endpoint.Endpoint.HealthCheckConfig) private static final io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig(); } public static io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<HealthCheckConfig> PARSER = new com.google.protobuf.AbstractParser<HealthCheckConfig>() { @java.lang.Override public HealthCheckConfig parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new HealthCheckConfig(input, extensionRegistry); } }; public static com.google.protobuf.Parser<HealthCheckConfig> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<HealthCheckConfig> getParserForType() { return PARSER; } @java.lang.Override public io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } public static final int ADDRESS_FIELD_NUMBER = 1; private io.grpc.xds.shaded.envoy.api.v2.core.Address address_; /** * <pre> * The upstream host address. * .. attention:: * The form of host address depends on the given cluster type. For STATIC or EDS, * it is expected to be a direct IP address (or something resolvable by the * specified :ref:`resolver &lt;envoy_api_field_core.SocketAddress.resolver_name&gt;` * in the Address). For LOGICAL or STRICT DNS, it is expected to be hostname, * and will be resolved via DNS. * </pre> * * <code>.envoy.api.v2.core.Address address = 1;</code> */ public boolean hasAddress() { return address_ != null; } /** * <pre> * The upstream host address. * .. attention:: * The form of host address depends on the given cluster type. For STATIC or EDS, * it is expected to be a direct IP address (or something resolvable by the * specified :ref:`resolver &lt;envoy_api_field_core.SocketAddress.resolver_name&gt;` * in the Address). For LOGICAL or STRICT DNS, it is expected to be hostname, * and will be resolved via DNS. * </pre> * * <code>.envoy.api.v2.core.Address address = 1;</code> */ public io.grpc.xds.shaded.envoy.api.v2.core.Address getAddress() { return address_ == null ? io.grpc.xds.shaded.envoy.api.v2.core.Address.getDefaultInstance() : address_; } /** * <pre> * The upstream host address. * .. attention:: * The form of host address depends on the given cluster type. For STATIC or EDS, * it is expected to be a direct IP address (or something resolvable by the * specified :ref:`resolver &lt;envoy_api_field_core.SocketAddress.resolver_name&gt;` * in the Address). For LOGICAL or STRICT DNS, it is expected to be hostname, * and will be resolved via DNS. * </pre> * * <code>.envoy.api.v2.core.Address address = 1;</code> */ public io.grpc.xds.shaded.envoy.api.v2.core.AddressOrBuilder getAddressOrBuilder() { return getAddress(); } public static final int HEALTH_CHECK_CONFIG_FIELD_NUMBER = 2; private io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig healthCheckConfig_; /** * <pre> * The optional health check configuration is used as configuration for the * health checker to contact the health checked host. * .. attention:: * This takes into effect only for upstream clusters with * :ref:`active health checking &lt;arch_overview_health_checking&gt;` enabled. * </pre> * * <code>.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig health_check_config = 2;</code> */ public boolean hasHealthCheckConfig() { return healthCheckConfig_ != null; } /** * <pre> * The optional health check configuration is used as configuration for the * health checker to contact the health checked host. * .. attention:: * This takes into effect only for upstream clusters with * :ref:`active health checking &lt;arch_overview_health_checking&gt;` enabled. * </pre> * * <code>.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig health_check_config = 2;</code> */ public io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig getHealthCheckConfig() { return healthCheckConfig_ == null ? io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig.getDefaultInstance() : healthCheckConfig_; } /** * <pre> * The optional health check configuration is used as configuration for the * health checker to contact the health checked host. * .. attention:: * This takes into effect only for upstream clusters with * :ref:`active health checking &lt;arch_overview_health_checking&gt;` enabled. * </pre> * * <code>.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig health_check_config = 2;</code> */ public io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfigOrBuilder getHealthCheckConfigOrBuilder() { return getHealthCheckConfig(); } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (address_ != null) { output.writeMessage(1, getAddress()); } if (healthCheckConfig_ != null) { output.writeMessage(2, getHealthCheckConfig()); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (address_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, getAddress()); } if (healthCheckConfig_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(2, getHealthCheckConfig()); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint)) { return super.equals(obj); } io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint other = (io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint) obj; boolean result = true; result = result && (hasAddress() == other.hasAddress()); if (hasAddress()) { result = result && getAddress() .equals(other.getAddress()); } result = result && (hasHealthCheckConfig() == other.hasHealthCheckConfig()); if (hasHealthCheckConfig()) { result = result && getHealthCheckConfig() .equals(other.getHealthCheckConfig()); } result = result && unknownFields.equals(other.unknownFields); return result; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasAddress()) { hash = (37 * hash) + ADDRESS_FIELD_NUMBER; hash = (53 * hash) + getAddress().hashCode(); } if (hasHealthCheckConfig()) { hash = (37 * hash) + HEALTH_CHECK_CONFIG_FIELD_NUMBER; hash = (53 * hash) + getHealthCheckConfig().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public static io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * <pre> * Upstream host identifier. * </pre> * * Protobuf type {@code envoy.api.v2.endpoint.Endpoint} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:envoy.api.v2.endpoint.Endpoint) io.grpc.xds.shaded.envoy.api.v2.endpoint.EndpointOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return io.grpc.xds.shaded.envoy.api.v2.endpoint.EndpointOuterClass.internal_static_envoy_api_v2_endpoint_Endpoint_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return io.grpc.xds.shaded.envoy.api.v2.endpoint.EndpointOuterClass.internal_static_envoy_api_v2_endpoint_Endpoint_fieldAccessorTable .ensureFieldAccessorsInitialized( io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.class, io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.Builder.class); } // Construct using io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { } } @java.lang.Override public Builder clear() { super.clear(); if (addressBuilder_ == null) { address_ = null; } else { address_ = null; addressBuilder_ = null; } if (healthCheckConfigBuilder_ == null) { healthCheckConfig_ = null; } else { healthCheckConfig_ = null; healthCheckConfigBuilder_ = null; } return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return io.grpc.xds.shaded.envoy.api.v2.endpoint.EndpointOuterClass.internal_static_envoy_api_v2_endpoint_Endpoint_descriptor; } @java.lang.Override public io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint getDefaultInstanceForType() { return io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.getDefaultInstance(); } @java.lang.Override public io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint build() { io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint buildPartial() { io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint result = new io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint(this); if (addressBuilder_ == null) { result.address_ = address_; } else { result.address_ = addressBuilder_.build(); } if (healthCheckConfigBuilder_ == null) { result.healthCheckConfig_ = healthCheckConfig_; } else { result.healthCheckConfig_ = healthCheckConfigBuilder_.build(); } onBuilt(); return result; } @java.lang.Override public Builder clone() { return (Builder) super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return (Builder) super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return (Builder) super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return (Builder) super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return (Builder) super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return (Builder) super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint) { return mergeFrom((io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint other) { if (other == io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.getDefaultInstance()) return this; if (other.hasAddress()) { mergeAddress(other.getAddress()); } if (other.hasHealthCheckConfig()) { mergeHealthCheckConfig(other.getHealthCheckConfig()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private io.grpc.xds.shaded.envoy.api.v2.core.Address address_ = null; private com.google.protobuf.SingleFieldBuilderV3< io.grpc.xds.shaded.envoy.api.v2.core.Address, io.grpc.xds.shaded.envoy.api.v2.core.Address.Builder, io.grpc.xds.shaded.envoy.api.v2.core.AddressOrBuilder> addressBuilder_; /** * <pre> * The upstream host address. * .. attention:: * The form of host address depends on the given cluster type. For STATIC or EDS, * it is expected to be a direct IP address (or something resolvable by the * specified :ref:`resolver &lt;envoy_api_field_core.SocketAddress.resolver_name&gt;` * in the Address). For LOGICAL or STRICT DNS, it is expected to be hostname, * and will be resolved via DNS. * </pre> * * <code>.envoy.api.v2.core.Address address = 1;</code> */ public boolean hasAddress() { return addressBuilder_ != null || address_ != null; } /** * <pre> * The upstream host address. * .. attention:: * The form of host address depends on the given cluster type. For STATIC or EDS, * it is expected to be a direct IP address (or something resolvable by the * specified :ref:`resolver &lt;envoy_api_field_core.SocketAddress.resolver_name&gt;` * in the Address). For LOGICAL or STRICT DNS, it is expected to be hostname, * and will be resolved via DNS. * </pre> * * <code>.envoy.api.v2.core.Address address = 1;</code> */ public io.grpc.xds.shaded.envoy.api.v2.core.Address getAddress() { if (addressBuilder_ == null) { return address_ == null ? io.grpc.xds.shaded.envoy.api.v2.core.Address.getDefaultInstance() : address_; } else { return addressBuilder_.getMessage(); } } /** * <pre> * The upstream host address. * .. attention:: * The form of host address depends on the given cluster type. For STATIC or EDS, * it is expected to be a direct IP address (or something resolvable by the * specified :ref:`resolver &lt;envoy_api_field_core.SocketAddress.resolver_name&gt;` * in the Address). For LOGICAL or STRICT DNS, it is expected to be hostname, * and will be resolved via DNS. * </pre> * * <code>.envoy.api.v2.core.Address address = 1;</code> */ public Builder setAddress(io.grpc.xds.shaded.envoy.api.v2.core.Address value) { if (addressBuilder_ == null) { if (value == null) { throw new NullPointerException(); } address_ = value; onChanged(); } else { addressBuilder_.setMessage(value); } return this; } /** * <pre> * The upstream host address. * .. attention:: * The form of host address depends on the given cluster type. For STATIC or EDS, * it is expected to be a direct IP address (or something resolvable by the * specified :ref:`resolver &lt;envoy_api_field_core.SocketAddress.resolver_name&gt;` * in the Address). For LOGICAL or STRICT DNS, it is expected to be hostname, * and will be resolved via DNS. * </pre> * * <code>.envoy.api.v2.core.Address address = 1;</code> */ public Builder setAddress( io.grpc.xds.shaded.envoy.api.v2.core.Address.Builder builderForValue) { if (addressBuilder_ == null) { address_ = builderForValue.build(); onChanged(); } else { addressBuilder_.setMessage(builderForValue.build()); } return this; } /** * <pre> * The upstream host address. * .. attention:: * The form of host address depends on the given cluster type. For STATIC or EDS, * it is expected to be a direct IP address (or something resolvable by the * specified :ref:`resolver &lt;envoy_api_field_core.SocketAddress.resolver_name&gt;` * in the Address). For LOGICAL or STRICT DNS, it is expected to be hostname, * and will be resolved via DNS. * </pre> * * <code>.envoy.api.v2.core.Address address = 1;</code> */ public Builder mergeAddress(io.grpc.xds.shaded.envoy.api.v2.core.Address value) { if (addressBuilder_ == null) { if (address_ != null) { address_ = io.grpc.xds.shaded.envoy.api.v2.core.Address.newBuilder(address_).mergeFrom(value).buildPartial(); } else { address_ = value; } onChanged(); } else { addressBuilder_.mergeFrom(value); } return this; } /** * <pre> * The upstream host address. * .. attention:: * The form of host address depends on the given cluster type. For STATIC or EDS, * it is expected to be a direct IP address (or something resolvable by the * specified :ref:`resolver &lt;envoy_api_field_core.SocketAddress.resolver_name&gt;` * in the Address). For LOGICAL or STRICT DNS, it is expected to be hostname, * and will be resolved via DNS. * </pre> * * <code>.envoy.api.v2.core.Address address = 1;</code> */ public Builder clearAddress() { if (addressBuilder_ == null) { address_ = null; onChanged(); } else { address_ = null; addressBuilder_ = null; } return this; } /** * <pre> * The upstream host address. * .. attention:: * The form of host address depends on the given cluster type. For STATIC or EDS, * it is expected to be a direct IP address (or something resolvable by the * specified :ref:`resolver &lt;envoy_api_field_core.SocketAddress.resolver_name&gt;` * in the Address). For LOGICAL or STRICT DNS, it is expected to be hostname, * and will be resolved via DNS. * </pre> * * <code>.envoy.api.v2.core.Address address = 1;</code> */ public io.grpc.xds.shaded.envoy.api.v2.core.Address.Builder getAddressBuilder() { onChanged(); return getAddressFieldBuilder().getBuilder(); } /** * <pre> * The upstream host address. * .. attention:: * The form of host address depends on the given cluster type. For STATIC or EDS, * it is expected to be a direct IP address (or something resolvable by the * specified :ref:`resolver &lt;envoy_api_field_core.SocketAddress.resolver_name&gt;` * in the Address). For LOGICAL or STRICT DNS, it is expected to be hostname, * and will be resolved via DNS. * </pre> * * <code>.envoy.api.v2.core.Address address = 1;</code> */ public io.grpc.xds.shaded.envoy.api.v2.core.AddressOrBuilder getAddressOrBuilder() { if (addressBuilder_ != null) { return addressBuilder_.getMessageOrBuilder(); } else { return address_ == null ? io.grpc.xds.shaded.envoy.api.v2.core.Address.getDefaultInstance() : address_; } } /** * <pre> * The upstream host address. * .. attention:: * The form of host address depends on the given cluster type. For STATIC or EDS, * it is expected to be a direct IP address (or something resolvable by the * specified :ref:`resolver &lt;envoy_api_field_core.SocketAddress.resolver_name&gt;` * in the Address). For LOGICAL or STRICT DNS, it is expected to be hostname, * and will be resolved via DNS. * </pre> * * <code>.envoy.api.v2.core.Address address = 1;</code> */ private com.google.protobuf.SingleFieldBuilderV3< io.grpc.xds.shaded.envoy.api.v2.core.Address, io.grpc.xds.shaded.envoy.api.v2.core.Address.Builder, io.grpc.xds.shaded.envoy.api.v2.core.AddressOrBuilder> getAddressFieldBuilder() { if (addressBuilder_ == null) { addressBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< io.grpc.xds.shaded.envoy.api.v2.core.Address, io.grpc.xds.shaded.envoy.api.v2.core.Address.Builder, io.grpc.xds.shaded.envoy.api.v2.core.AddressOrBuilder>( getAddress(), getParentForChildren(), isClean()); address_ = null; } return addressBuilder_; } private io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig healthCheckConfig_ = null; private com.google.protobuf.SingleFieldBuilderV3< io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig, io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig.Builder, io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfigOrBuilder> healthCheckConfigBuilder_; /** * <pre> * The optional health check configuration is used as configuration for the * health checker to contact the health checked host. * .. attention:: * This takes into effect only for upstream clusters with * :ref:`active health checking &lt;arch_overview_health_checking&gt;` enabled. * </pre> * * <code>.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig health_check_config = 2;</code> */ public boolean hasHealthCheckConfig() { return healthCheckConfigBuilder_ != null || healthCheckConfig_ != null; } /** * <pre> * The optional health check configuration is used as configuration for the * health checker to contact the health checked host. * .. attention:: * This takes into effect only for upstream clusters with * :ref:`active health checking &lt;arch_overview_health_checking&gt;` enabled. * </pre> * * <code>.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig health_check_config = 2;</code> */ public io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig getHealthCheckConfig() { if (healthCheckConfigBuilder_ == null) { return healthCheckConfig_ == null ? io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig.getDefaultInstance() : healthCheckConfig_; } else { return healthCheckConfigBuilder_.getMessage(); } } /** * <pre> * The optional health check configuration is used as configuration for the * health checker to contact the health checked host. * .. attention:: * This takes into effect only for upstream clusters with * :ref:`active health checking &lt;arch_overview_health_checking&gt;` enabled. * </pre> * * <code>.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig health_check_config = 2;</code> */ public Builder setHealthCheckConfig(io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig value) { if (healthCheckConfigBuilder_ == null) { if (value == null) { throw new NullPointerException(); } healthCheckConfig_ = value; onChanged(); } else { healthCheckConfigBuilder_.setMessage(value); } return this; } /** * <pre> * The optional health check configuration is used as configuration for the * health checker to contact the health checked host. * .. attention:: * This takes into effect only for upstream clusters with * :ref:`active health checking &lt;arch_overview_health_checking&gt;` enabled. * </pre> * * <code>.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig health_check_config = 2;</code> */ public Builder setHealthCheckConfig( io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig.Builder builderForValue) { if (healthCheckConfigBuilder_ == null) { healthCheckConfig_ = builderForValue.build(); onChanged(); } else { healthCheckConfigBuilder_.setMessage(builderForValue.build()); } return this; } /** * <pre> * The optional health check configuration is used as configuration for the * health checker to contact the health checked host. * .. attention:: * This takes into effect only for upstream clusters with * :ref:`active health checking &lt;arch_overview_health_checking&gt;` enabled. * </pre> * * <code>.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig health_check_config = 2;</code> */ public Builder mergeHealthCheckConfig(io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig value) { if (healthCheckConfigBuilder_ == null) { if (healthCheckConfig_ != null) { healthCheckConfig_ = io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig.newBuilder(healthCheckConfig_).mergeFrom(value).buildPartial(); } else { healthCheckConfig_ = value; } onChanged(); } else { healthCheckConfigBuilder_.mergeFrom(value); } return this; } /** * <pre> * The optional health check configuration is used as configuration for the * health checker to contact the health checked host. * .. attention:: * This takes into effect only for upstream clusters with * :ref:`active health checking &lt;arch_overview_health_checking&gt;` enabled. * </pre> * * <code>.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig health_check_config = 2;</code> */ public Builder clearHealthCheckConfig() { if (healthCheckConfigBuilder_ == null) { healthCheckConfig_ = null; onChanged(); } else { healthCheckConfig_ = null; healthCheckConfigBuilder_ = null; } return this; } /** * <pre> * The optional health check configuration is used as configuration for the * health checker to contact the health checked host. * .. attention:: * This takes into effect only for upstream clusters with * :ref:`active health checking &lt;arch_overview_health_checking&gt;` enabled. * </pre> * * <code>.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig health_check_config = 2;</code> */ public io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig.Builder getHealthCheckConfigBuilder() { onChanged(); return getHealthCheckConfigFieldBuilder().getBuilder(); } /** * <pre> * The optional health check configuration is used as configuration for the * health checker to contact the health checked host. * .. attention:: * This takes into effect only for upstream clusters with * :ref:`active health checking &lt;arch_overview_health_checking&gt;` enabled. * </pre> * * <code>.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig health_check_config = 2;</code> */ public io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfigOrBuilder getHealthCheckConfigOrBuilder() { if (healthCheckConfigBuilder_ != null) { return healthCheckConfigBuilder_.getMessageOrBuilder(); } else { return healthCheckConfig_ == null ? io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig.getDefaultInstance() : healthCheckConfig_; } } /** * <pre> * The optional health check configuration is used as configuration for the * health checker to contact the health checked host. * .. attention:: * This takes into effect only for upstream clusters with * :ref:`active health checking &lt;arch_overview_health_checking&gt;` enabled. * </pre> * * <code>.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig health_check_config = 2;</code> */ private com.google.protobuf.SingleFieldBuilderV3< io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig, io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig.Builder, io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfigOrBuilder> getHealthCheckConfigFieldBuilder() { if (healthCheckConfigBuilder_ == null) { healthCheckConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig, io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfig.Builder, io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint.HealthCheckConfigOrBuilder>( getHealthCheckConfig(), getParentForChildren(), isClean()); healthCheckConfig_ = null; } return healthCheckConfigBuilder_; } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFieldsProto3(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:envoy.api.v2.endpoint.Endpoint) } // @@protoc_insertion_point(class_scope:envoy.api.v2.endpoint.Endpoint) private static final io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint(); } public static io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<Endpoint> PARSER = new com.google.protobuf.AbstractParser<Endpoint>() { @java.lang.Override public Endpoint parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new Endpoint(input, extensionRegistry); } }; public static com.google.protobuf.Parser<Endpoint> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<Endpoint> getParserForType() { return PARSER; } @java.lang.Override public io.grpc.xds.shaded.envoy.api.v2.endpoint.Endpoint getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }
[ "martinez.marcos@outlook.com" ]
martinez.marcos@outlook.com
3b5c866da0fc9bc31036657cfa939c0e5fb484d0
6e7a313721ca10a7dee842587502b6a93c94f35e
/src/main/java/pl/mzlnk/conferencegenerator/generator/entity/ConferenceDayPriceGenerator.java
0c9c75b54c1cf9f67f1e95618a57d985c3a6612b
[]
no_license
mzlnk/conference-generator
2810617a020e9b8688a7269f78fd95d5b9430899
b0343ccdb2cd3d1a07d1779f1ae41bf3017437d9
refs/heads/master
2021-07-02T00:05:50.569897
2020-01-10T02:24:04
2020-01-10T02:24:04
231,946,268
0
0
null
null
null
null
UTF-8
Java
false
false
2,453
java
package pl.mzlnk.conferencegenerator.generator.entity; import pl.mzlnk.conferencegenerator.model.entity.EntityType; import pl.mzlnk.conferencegenerator.model.entity.conference.ConferenceDay; import pl.mzlnk.conferencegenerator.model.entity.conference.ConferenceDayPrice; import pl.mzlnk.conferencegenerator.repository.data.DataRepositories; import pl.mzlnk.conferencegenerator.repository.entity.EntityRepositories; import java.util.Calendar; import static pl.mzlnk.conferencegenerator.utils.RandomUtil.r; class ConferenceDayPriceGenerator extends BaseEntityGenerator { ConferenceDayPriceGenerator(EntityRepositories entityRepositories, DataRepositories dataRepositories) { super(EntityType.CONFERENCE_DAY_PRICE, entityRepositories, dataRepositories); } @Override public void generate() { var conferenceDayRepository = entityRepositories.<ConferenceDay>getRepository(EntityType.CONFERENCE_DAY); var conferenceDayPriceRepository = entityRepositories.<ConferenceDayPrice>getRepository(EntityType.CONFERENCE_DAY_PRICE); final String discountDescription = "Znizka {discount}%"; final String baseDescription = "Cena bazowa"; conferenceDayRepository .findAll() .forEach(conferenceDay -> { int prices = r.nextInt(4) + 1; int baseValue = r.nextInt(200); for(int i = 0; i < prices; i++) { Calendar expirationDate = (Calendar) conferenceDay.getDate().clone(); if(i > 0) { expirationDate.add(Calendar.DAY_OF_MONTH, -7 * i); } String description = (i != 0 ? discountDescription.replace("{discount}", String.valueOf(i * 10)) : baseDescription); ConferenceDayPrice entity = new ConferenceDayPrice( id++, conferenceDay.getConferenceDayId(), (int) (baseValue * (1 - 0.1 * i)), description, expirationDate ); conferenceDayPriceRepository.createOrUpdate(entity); } }); System.out.println("generated " + conferenceDayPriceRepository.findAll().size() + " conference day price entities"); } }
[ "dev.zielonka.marcin@gmail.com" ]
dev.zielonka.marcin@gmail.com
f6429f68ddda7e6a23d2db35f6cede37c81424bd
bf0fc2a771b0e0dd71470c363ce6ae711f01f050
/WritingWords.java
96261dedc139d3dfad189fbfc956017dc541e9f9
[]
no_license
samudraagni/TopCoderDivision2Level1
eed3894f649e10b5c96eca95c6ffdc7f4e5218d0
757c0631f7ad9b158d67d0a8683a93e4986b23d9
refs/heads/master
2020-12-04T23:45:07.218132
2016-10-23T22:45:27
2016-10-23T22:45:27
66,711,382
0
0
null
null
null
null
UTF-8
Java
false
false
1,764
java
import java.io.*; public class WritingWords{ public int write(String word){ int val = 0; for(int i=0; i < word.length(); i++){ val += (word.charAt(i)-'A') + 1; } return val; } public static void main(String[] args){ WritingWords w = new WritingWords(); w.test(); } private void test(){ String word; int expected; int obtained; int numTests = 6; for(int i=0; i < numTests; i++){ switch (i) { case 0:{ word = new String("A"); expected = 1; obtained = write(word); printResult(i, expected, obtained); break; } case 1:{ word = new String("ABC"); expected = 6; obtained = write(word); printResult(i, expected, obtained); break; } case 2:{ word = new String("VAMOSGIMNASIA"); expected = 143; obtained = write(word); printResult(i, expected, obtained); break; } case 3:{ word = new String("TOPCODER"); expected = 96; obtained = write(word); printResult(i, expected, obtained); break; } case 4:{ word = new String("SINGLEROUNDMATCH"); expected = 183; obtained = write(word); printResult(i, expected, obtained); break; } case 5:{ word = new String("ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ"); expected = 1300; obtained = write(word); printResult(i, expected, obtained); break; } } } } private void printResult(int testNum, int expected, int obtained){ StringBuilder sb = new StringBuilder(); sb.append("Test "+testNum); if(expected == obtained) sb.append("\tSuccess."); else sb.append("\tFail."); sb.append("\texpected: "+expected+" obtained: "+obtained+"\n"); System.out.println(sb.toString()); } }
[ "ramyapradhan@Ramyas-MacBook-Pro-2.local" ]
ramyapradhan@Ramyas-MacBook-Pro-2.local
d2fdfd910ebb0c5c0ace1066adc0ed8f29334754
a201e2661b3341a07627ea2ce395164f23df0d0e
/project-euler/src/main/java/euler/p13.java
7c9da2dca9057d81596df1ac4e4a209036727149
[]
no_license
jessica-cao/Project-Euler
3129f05e4c30bc833ca472311080986ce09471f2
25b7a2052b15db02f72bfdfac3eb381db91593e1
refs/heads/master
2021-07-07T10:26:35.450935
2019-08-26T15:57:15
2019-08-26T15:57:15
193,023,318
0
0
null
2020-10-13T15:21:46
2019-06-21T03:20:44
Java
UTF-8
Java
false
false
8,395
java
package euler; import java.math.BigInteger; public class p13 { public static String bigSum() { BigInteger NUMBERS[] = { new BigInteger("37107287533902102798797998220837590246510135740250"), new BigInteger("46376937677490009712648124896970078050417018260538"), new BigInteger("74324986199524741059474233309513058123726617309629"), new BigInteger("91942213363574161572522430563301811072406154908250"), new BigInteger("23067588207539346171171980310421047513778063246676"), new BigInteger("89261670696623633820136378418383684178734361726757"), new BigInteger("28112879812849979408065481931592621691275889832738"), new BigInteger("44274228917432520321923589422876796487670272189318"), new BigInteger("47451445736001306439091167216856844588711603153276"), new BigInteger("70386486105843025439939619828917593665686757934951"), new BigInteger("62176457141856560629502157223196586755079324193331"), new BigInteger("64906352462741904929101432445813822663347944758178"), new BigInteger("92575867718337217661963751590579239728245598838407"), new BigInteger("58203565325359399008402633568948830189458628227828"), new BigInteger("80181199384826282014278194139940567587151170094390"), new BigInteger("35398664372827112653829987240784473053190104293586"), new BigInteger("86515506006295864861532075273371959191420517255829"), new BigInteger("71693888707715466499115593487603532921714970056938"), new BigInteger("54370070576826684624621495650076471787294438377604"), new BigInteger("53282654108756828443191190634694037855217779295145"), new BigInteger("36123272525000296071075082563815656710885258350721"), new BigInteger("45876576172410976447339110607218265236877223636045"), new BigInteger("17423706905851860660448207621209813287860733969412"), new BigInteger("81142660418086830619328460811191061556940512689692"), new BigInteger("51934325451728388641918047049293215058642563049483"), new BigInteger("62467221648435076201727918039944693004732956340691"), new BigInteger("15732444386908125794514089057706229429197107928209"), new BigInteger("55037687525678773091862540744969844508330393682126"), new BigInteger("18336384825330154686196124348767681297534375946515"), new BigInteger("80386287592878490201521685554828717201219257766954"), new BigInteger("78182833757993103614740356856449095527097864797581"), new BigInteger("16726320100436897842553539920931837441497806860984"), new BigInteger("48403098129077791799088218795327364475675590848030"), new BigInteger("87086987551392711854517078544161852424320693150332"), new BigInteger("59959406895756536782107074926966537676326235447210"), new BigInteger("69793950679652694742597709739166693763042633987085"), new BigInteger("41052684708299085211399427365734116182760315001271"), new BigInteger("65378607361501080857009149939512557028198746004375"), new BigInteger("35829035317434717326932123578154982629742552737307"), new BigInteger("94953759765105305946966067683156574377167401875275"), new BigInteger("88902802571733229619176668713819931811048770190271"), new BigInteger("25267680276078003013678680992525463401061632866526"), new BigInteger("36270218540497705585629946580636237993140746255962"), new BigInteger("24074486908231174977792365466257246923322810917141"), new BigInteger("91430288197103288597806669760892938638285025333403"), new BigInteger("34413065578016127815921815005561868836468420090470"), new BigInteger("23053081172816430487623791969842487255036638784583"), new BigInteger("11487696932154902810424020138335124462181441773470"), new BigInteger("63783299490636259666498587618221225225512486764533"), new BigInteger("67720186971698544312419572409913959008952310058822"), new BigInteger("95548255300263520781532296796249481641953868218774"), new BigInteger("76085327132285723110424803456124867697064507995236"), new BigInteger("37774242535411291684276865538926205024910326572967"), new BigInteger("23701913275725675285653248258265463092207058596522"), new BigInteger("29798860272258331913126375147341994889534765745501"), new BigInteger("18495701454879288984856827726077713721403798879715"), new BigInteger("38298203783031473527721580348144513491373226651381"), new BigInteger("34829543829199918180278916522431027392251122869539"), new BigInteger("40957953066405232632538044100059654939159879593635"), new BigInteger("29746152185502371307642255121183693803580388584903"), new BigInteger("41698116222072977186158236678424689157993532961922"), new BigInteger("62467957194401269043877107275048102390895523597457"), new BigInteger("23189706772547915061505504953922979530901129967519"), new BigInteger("86188088225875314529584099251203829009407770775672"), new BigInteger("11306739708304724483816533873502340845647058077308"), new BigInteger("82959174767140363198008187129011875491310547126581"), new BigInteger("97623331044818386269515456334926366572897563400500"), new BigInteger("42846280183517070527831839425882145521227251250327"), new BigInteger("55121603546981200581762165212827652751691296897789"), new BigInteger("32238195734329339946437501907836945765883352399886"), new BigInteger("75506164965184775180738168837861091527357929701337"), new BigInteger("62177842752192623401942399639168044983993173312731"), new BigInteger("32924185707147349566916674687634660915035914677504"), new BigInteger("99518671430235219628894890102423325116913619626622"), new BigInteger("73267460800591547471830798392868535206946944540724"), new BigInteger("76841822524674417161514036427982273348055556214818"), new BigInteger("97142617910342598647204516893989422179826088076852"), new BigInteger("87783646182799346313767754307809363333018982642090"), new BigInteger("10848802521674670883215120185883543223812876952786"), new BigInteger("71329612474782464538636993009049310363619763878039"), new BigInteger("62184073572399794223406235393808339651327408011116"), new BigInteger("66627891981488087797941876876144230030984490851411"), new BigInteger("60661826293682836764744779239180335110989069790714"), new BigInteger("85786944089552990653640447425576083659976645795096"), new BigInteger("66024396409905389607120198219976047599490197230297"), new BigInteger("64913982680032973156037120041377903785566085089252"), new BigInteger("16730939319872750275468906903707539413042652315011"), new BigInteger("94809377245048795150954100921645863754710598436791"), new BigInteger("78639167021187492431995700641917969777599028300699"), new BigInteger("15368713711936614952811305876380278410754449733078"), new BigInteger("40789923115535562561142322423255033685442488917353"), new BigInteger("44889911501440648020369068063960672322193204149535"), new BigInteger("41503128880339536053299340368006977710650566631954"), new BigInteger("81234880673210146739058568557934581403627822703280"), new BigInteger("82616570773948327592232845941706525094512325230608"), new BigInteger("22918802058777319719839450180888072429661980811197"), new BigInteger("77158542502016545090413245809786882778948721859617"), new BigInteger("72107838435069186155435662884062257473692284509516"), new BigInteger("20849603980134001723930671666823555245252804609722"), new BigInteger("53503534226472524250874054075591789781264330331690")}; int SIZE = 100; // there are 100 50-digit numbers BigInteger sum = new BigInteger("0"); for (int i = 0; i < SIZE; ++i) { sum = sum.add(NUMBERS[i]); } String sumStr = sum.toString(); String firstTenDigits = sumStr.substring(0, 10); System.out.println(firstTenDigits); return firstTenDigits; } public static void main(String[] args) { bigSum(); } }
[ "jessicacao1756@gmail.com" ]
jessicacao1756@gmail.com
e617843753756563acaa9e5936f8e12a8df46d32
4b0bf4787e89bcae7e4759bde6d7f3ab2c81f849
/aliyun-java-sdk-cloudcallcenter/src/main/java/com/aliyuncs/cloudcallcenter/model/v20170705/RemoveTestPhoneNumberResponse.java
399dcf171d1f392dd7d4821fac43ab6a4d8c7951
[ "Apache-2.0" ]
permissive
aliyun/aliyun-openapi-java-sdk
a263fa08e261f12d45586d1b3ad8a6609bba0e91
e19239808ad2298d32dda77db29a6d809e4f7add
refs/heads/master
2023-09-03T12:28:09.765286
2023-09-01T09:03:00
2023-09-01T09:03:00
39,555,898
1,542
1,317
NOASSERTION
2023-09-14T07:27:05
2015-07-23T08:41:13
Java
UTF-8
Java
false
false
1,962
java
/* * 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.aliyuncs.cloudcallcenter.model.v20170705; import com.aliyuncs.AcsResponse; import com.aliyuncs.cloudcallcenter.transform.v20170705.RemoveTestPhoneNumberResponseUnmarshaller; import com.aliyuncs.transform.UnmarshallerContext; /** * @author auto create * @version */ public class RemoveTestPhoneNumberResponse extends AcsResponse { private String requestId; private Boolean success; private String code; private String message; private Integer httpStatusCode; public String getRequestId() { return this.requestId; } public void setRequestId(String requestId) { this.requestId = requestId; } public Boolean getSuccess() { return this.success; } public void setSuccess(Boolean success) { this.success = success; } public String getCode() { return this.code; } public void setCode(String code) { this.code = code; } public String getMessage() { return this.message; } public void setMessage(String message) { this.message = message; } public Integer getHttpStatusCode() { return this.httpStatusCode; } public void setHttpStatusCode(Integer httpStatusCode) { this.httpStatusCode = httpStatusCode; } @Override public RemoveTestPhoneNumberResponse getInstance(UnmarshallerContext context) { return RemoveTestPhoneNumberResponseUnmarshaller.unmarshall(this, context); } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
c2f15ec5660b1fa8dff4c16f854cc10979e3aef8
bbb93df2da50a632ef98eae62f819101981a21f8
/src/main/java/com/crud/tasks/domain/BadgesDto.java
fe7449c83c0af8eec0759b254daa74ec1e8aac63
[]
no_license
majkel3321/SpringWeb
323f9f36d046c39accb45b5b9f98425eae624502
8f4929b41436ae86925787ecc32f765937103f8c
refs/heads/master
2020-04-29T04:22:31.539572
2019-07-02T19:26:49
2019-07-02T19:26:49
175,845,128
0
0
null
null
null
null
UTF-8
Java
false
false
489
java
package com.crud.tasks.domain; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; @AllArgsConstructor @NoArgsConstructor @Getter @JsonIgnoreProperties(ignoreUnknown = true) public class BadgesDto { @JsonProperty("votes") private int votes; @JsonProperty("attachmentsByType") private AttachmentByType attachments; }
[ "majkel3321@gmail.com" ]
majkel3321@gmail.com
5eb15339e4a0b968390f2fb614c1cd62e36ed074
a07e048f47e7e99a70efac9eb10bcba175e2c6a6
/javaProject/src/objects/CalExample.java
77f6894100c2070f0b6d539428dc72064aaaee49
[]
no_license
hanseol/javaProject
a26474cb772f171f5f108d385cee3d937775d8f3
663244870e3b5fc6be8bbe2bb5c08147b1470a24
refs/heads/master
2023-03-30T22:36:25.281629
2021-03-28T05:31:42
2021-03-28T05:31:42
339,925,348
0
0
null
null
null
null
UTF-8
Java
false
false
719
java
package objects; public class CalExample { public static void main(String[] args) { System.out.println(getSUM(40,50)); System.out.println(getAverage(40,50)); Student2 s = new Student2("박소연",87,92); showInfo(s); } public static void showInfo(Student2 st) { System.out.println("이름 : " + st.getName()); System.out.println("합계점수: " + getSUM(st.getEng(), st.getMath())); System.out.println("평균점수: " + getAverage(st.getEng(), st.getMath())); } public static int getSUM(int num1, int num2) { int sum=num1 + num2; return sum; } public static double getAverage(int num1, int num2) { int sum = num1+ num2; double avg= sum/2.0; return avg; } }
[ "admin@YD01-19" ]
admin@YD01-19
079a3f623ee69e8d7047e0bb420f196d683b48b4
a8541a83db323ef1cf50e5b886f8462054a5f1b9
/SprinklerMobile/platforms/android/src/io/cordova/myapp739faa/MainActivity.java
9bd095dab2eceff8cf81b3607a024f588f582fba
[]
no_license
khmcbride/Sprinkler
d94bdb58798aea1c5e79fbe64efe3d341d5f36cd
799046aaf5f4f8067c4aca0c93bbb16a5615da46
refs/heads/master
2021-05-08T01:35:05.412047
2017-11-14T15:58:17
2017-11-14T15:58:17
107,883,381
0
0
null
null
null
null
UTF-8
Java
false
false
1,215
java
/* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package io.cordova.myapp739faa; import android.os.Bundle; import org.apache.cordova.*; public class MainActivity extends CordovaActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Set by <content src="index.html" /> in config.xml loadUrl(launchUrl); } }
[ "kent.h.mcbride@gmail.com" ]
kent.h.mcbride@gmail.com
60106c9e5bbb9ff040ddcc53a4f585a9d7d9c789
c1bb9d927e425bdf364b2c5a8cc9bd873039ff93
/CacheBenchmarking/app/src/main/java/desmedt/frederik/cachebenchmarking/benchmark/BaseBenchmark.java
f9c6cf7d47a5fa6d64b115fec0f44718195f063b
[]
no_license
cruftex/Bachelorproef
bb86ac8d542f480f5ee828c8d8c87158f149a808
98031719e6dd0a19ed557da8cdb7353480bbe9f1
refs/heads/master
2020-03-23T16:02:29.282579
2016-05-24T18:30:48
2016-05-24T18:30:48
141,790,910
1
0
null
null
null
null
UTF-8
Java
false
false
9,955
java
package desmedt.frederik.cachebenchmarking.benchmark; import android.util.Pair; import java.util.Random; import desmedt.frederik.cachebenchmarking.CacheBenchmarkConfiguration; import desmedt.frederik.cachebenchmarking.generator.Generator; import desmedt.frederik.cachebenchmarking.generator.RandomGenerator; import desmedt.frederik.cachebenchmarking.generator.ZipfGenerator; /** * A collection of basic {@link desmedt.frederik.cachebenchmarking.CacheBenchmarkConfiguration} that * implement common code while remaining cache independent. */ public class BaseBenchmark { public static final String INSERT_TAG = "Insert"; public static final String DELETE_TAG = "Delete"; public static final String UPDATE_TAG = "Update"; /** * Base benchmark configuration used by all static classes in {@link BaseBenchmark}. * It contains all common functionalities of its subclasses as well as management of benchmark * {@link CacheBenchmarkConfiguration#setup()} and {@link CacheBenchmarkConfiguration#tearDown()}. * <p/> * It expects the cache to be based on {@link Integer} keys. * * @param <V> The type of values that will be stored in the cache */ public static abstract class BaseBenchmarkConfiguration<V> extends CacheBenchmarkConfiguration<Integer, V> { private int cacheSize; public BaseBenchmarkConfiguration(String policyTag, String traceTag, double cachedRatio, Integer lowerBound, Integer upperBound) { super(policyTag, traceTag, cachedRatio, lowerBound, upperBound); cacheSize = (int) Math.round((upperBound - lowerBound) * cachedRatio); } @Override protected void setup() { createCache(cacheSize); } @Override protected void tearDown() { clearCache(); } /** * Generate a random value to be used as a value in a run. * * @return A random value */ protected abstract V generateValue(); /** * Create the cache that is used for benchmarking of size {@code cacheSize}. This method is * called only once before the benchmark run and is not timed. * * @param cacheSize The maximum amount of entries the cache should have */ protected abstract void createCache(int cacheSize); /** * Completely clear the cache used for benchmarking. This means cleaning as much as possible * and possibly even removing the cache reference for the garbage collector in case there are * lots of strong references that are maintained. This method is called only after the complete * benchmark run and is not timed. */ protected abstract void clearCache(); public int getCacheSize() { return cacheSize; } } public static abstract class Read<V> extends BaseBenchmarkConfiguration<V> { private Generator<Integer> randomGenerator; /** * * @param name The name of the cache policy used * @param traceTag The name of trace used * @param traceGenerator A generator representing some trace * @param cachedRatio How much of the total key space should be available in the cache, {@code 0 <= cachedRatio <= 1} * @param lowerBound The lower bound of the key space * @param upperBound The upper bound of the key space */ public Read(String name, String traceTag, Generator<Integer> traceGenerator, double cachedRatio, Integer lowerBound, Integer upperBound) { super(name + "Read", traceTag, cachedRatio, lowerBound, upperBound); randomGenerator = traceGenerator; } protected abstract void addToCache(Integer key, V value); @Override protected void cleanup(Integer key, V value, boolean succeeded) { if (!succeeded) { addToCache(key, value); } } @Override protected Pair<Integer, V> generateInput() { return new Pair<>(randomGenerator.next(), generateValue()); } } /** * A default benchmark configuration for reading a cache. It simulates random cache access by * continuously generating random values before each individual run. * <p/> * It expects the cache to be based on {@link Integer} keys. * * @param <V> The type of the values that will be stored in the cache */ public static abstract class RandomRead<V> extends BaseBenchmark.Read<V> { public RandomRead(String name, double cachedRatio, Integer lowerBound, Integer upperBound) { super(name, RandomGenerator.TRACE_TAG, new RandomGenerator(lowerBound, upperBound), cachedRatio, lowerBound, upperBound); } } /** * A default benchmark configuration for reading a cache. It simulates GET HTTP requests that * pass by the cache by continuously generating random values according to a Zipf probability * distribution ({@link ZipfGenerator}) before each individual run. * <p/> * It expects the cache to be based on {@link Integer} keys. * * @param <V> The type of the values that will be stored in the cache */ public static abstract class ZipfRead<V> extends BaseBenchmark.Read<V> { public ZipfRead(String name, double cachedRatio, Integer lowerBound, Integer upperBound) { super(name, ZipfGenerator.TRACE_TAG, new ZipfGenerator(lowerBound, upperBound), cachedRatio, lowerBound, upperBound); } } /** * A default insert benchmark, that is used to monitor the performance of inserting key-value pairs * in a cache. The key passed to the run will always be a key of an entry that is not currently * stored in the cache. Therefore it will always be a pure insert run and will never be updating * an existing entry. * <p/> * It expects the cache to be based on {@link Integer} keys. * The keys that are used are completely random. * * @param <V> The type of the values that will be stored in the cache */ public static abstract class Insert<V> extends BaseBenchmarkConfiguration<V> { private Generator<Integer> generator; private int nextKey; public Insert(String name, double cachedRatio, Integer lowerBound, Integer upperBound) { super(name + INSERT_TAG, RandomGenerator.TRACE_TAG, cachedRatio, lowerBound, upperBound); generator = new RandomGenerator(lowerBound, upperBound); } protected abstract void removeElement(Integer key); protected abstract V generateValue(); @Override protected void cleanup(Integer key, V value, boolean succeeded) { nextKey = generator.next(); removeElement(key); } @Override protected Pair<Integer, V> generateInput() { return new Pair<>(nextKey, generateValue()); } } /** * A default benchmark configuration for deleting an entry from a cache. * The key passed to the run will always be a key of an existing entry in the cache. Therefore * the run is never told to try and remove the entry bound to the key that is not in the cache. * <p/> * It expects the cache to be based on {@link Integer} keys. * The keys generated are completely random. * * @param <V> The type of the values that will be stored in the cache */ public static abstract class Delete<V> extends BaseBenchmarkConfiguration<V> { private Generator<Integer> generator; private int nextKey; public Delete(String name, double cachedRatio, Integer lowerBound, Integer upperBound) { super(name + DELETE_TAG, RandomGenerator.TRACE_TAG, cachedRatio, lowerBound, upperBound); generator = new RandomGenerator(lowerBound, upperBound); } public abstract void addToCache(int key, V value); protected abstract V generateValue(); @Override protected void setup() { super.setup(); for (int i = 0; i < getCacheSize(); i++) { prepare(); } } @Override protected void prepare() { nextKey = generator.next(); addToCache(nextKey, generateValue()); } @Override protected Pair<Integer, V> generateInput() { return new Pair<>(nextKey, generateValue()); } } /** * A default benchmark configuration for updating entries in a cache. * The key passed to the run might be bound to an already existing entry in the cache, yet this * is not enforced. Considering that a cache update is almost always used with a * "update or add if non existent" semantics. * <p/> * It expects the cache to be based on {@link Integer} keys. * The keys generated are completely random. * * @param <V> The type of the values that will be stored in the cache */ public static abstract class Update<V> extends BaseBenchmarkConfiguration<V> { private Generator<Integer> generator; private int nextKey; public Update(String name, double cachedRatio, Integer lowerBound, Integer upperBound) { super(name + UPDATE_TAG, RandomGenerator.TRACE_TAG, cachedRatio, lowerBound, upperBound); generator = new RandomGenerator(lowerBound, upperBound); } protected abstract void addToCache(int key, V value); protected abstract V generateValue(); @Override protected void prepare() { nextKey = generator.next(); addToCache(nextKey, generateValue()); } @Override protected Pair<Integer, V> generateInput() { return new Pair<>(nextKey, generateValue()); } } }
[ "frederik.de.smedt@hotmail.com" ]
frederik.de.smedt@hotmail.com
3ef83c44ca7bbdf551cec524a36dbeb1a4361544
1b60a4dcbd578df403ecb0c56387ca15fbfd2fb0
/src/bramki/logiczne/reversed180/FlipFlopR.java
dc3b949e192b592d88512b9dc8449c3924846bf5
[]
no_license
Wojciech-code/WireWorld
746e2c65a6ddf05646ab52bc3010cf116a935d7e
418c007208f2ace4ede5b7ed275db1bdcb8f78e2
refs/heads/master
2023-05-27T08:01:06.740173
2021-06-08T12:55:26
2021-06-08T12:55:26
357,677,979
0
0
null
null
null
null
UTF-8
Java
false
false
1,702
java
package bramki.logiczne.reversed180; import bramki.logiczne.Gate; import silnik.Cell; import silnik.Map; public class FlipFlopR extends Gate { public FlipFlopR(Map mapa) { super(mapa); } @Override public void setGate(int row, int column) { for (Cell c : mapa) { metodaRobocza(c); if ((x == row && y == column) || (x == row && y == column - 1) || (x == row && y == column - 2) || (x == row && y == column - 3) || (x == row + 1 && y == column - 4) || (x == row + 2 && y == column - 3) || (x == row + 2 && y == column - 4) || (x == row + 2 && y == column - 5) || (x == row + 3 && y == column - 4) || (x == row + 4 && y == column - 3) || (x == row + 4 && y == column - 5) || (x == row + 4 && y == column - 6) || (x == row + 4 && y == column - 7) || (x == row + 4 && y == column - 8) || (x == row + 5 && y == column - 3) || (x == row + 5 && y == column - 5) || (x == row + 6 && y == column - 2) || (x == row + 6 && y == column - 3) || (x == row + 6 && y == column - 4) || (x == row + 7 && y == column - 3) || (x == row + 8 && y == column) || (x == row + 8 && y == column - 1) || (x == row + 8 && y == column - 2) ) { c.setConductor(); } } } }
[ "ksmolecki123@wp.pl" ]
ksmolecki123@wp.pl
0e90b363e566513d79046a49962473f1ff382bb3
de446b31e18cf4b0ca602fedd96c2171ef232059
/src/main/java/com/huawei/cloudcampus/api/model/TenantListDto.java
f1db6f6ba2ec35b7cd1f174b50e890583b89cda3
[]
no_license
qqfbleach/cloud-campus-sdk
c2b79d194e499704b959c1f4354f9b05ff010918
3f0a17edd852441013696fe2ddb7997c4e248808
refs/heads/master
2022-11-24T01:37:07.757152
2020-02-18T12:08:56
2020-02-18T12:08:56
238,686,821
0
0
null
2022-11-16T09:23:44
2020-02-06T12:43:50
Java
UTF-8
Java
false
false
5,841
java
/* * 租户管理 * 租户管理第三方北向接口。 · 提供租户创建接口 · 提供租户删除接口 · 提供租户查询接口 * * OpenAPI spec version: 1.0.2 * * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ package com.huawei.cloudcampus.api.model; import java.util.Objects; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.huawei.cloudcampus.api.model.TenantData; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; import java.util.List; /** * 查询租户列表返回模型。 */ @ApiModel(description = "查询租户列表返回模型。") @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaSdnClientCodegen", date = "2019-12-17T15:19:16.197+08:00") public class TenantListDto { @SerializedName("errcode") private String errcode = null; @SerializedName("errmsg") private String errmsg = null; @SerializedName("totalRecords") private Integer totalRecords = null; @SerializedName("pageIndex") private Integer pageIndex = null; @SerializedName("pageSize") private Integer pageSize = null; @SerializedName("data") private List<TenantData> data = null; public TenantListDto errcode(String errcode) { this.errcode = errcode; return this; } /** * 错误码。 * return errcode **/ @ApiModelProperty(value = "错误码。") public String getErrcode() { return errcode; } /** * 错误码。 * Param errcode **/ public void setErrcode(String errcode) { this.errcode = errcode; } public TenantListDto errmsg(String errmsg) { this.errmsg = errmsg; return this; } /** * 错误信息。 * return errmsg **/ @ApiModelProperty(value = "错误信息。") public String getErrmsg() { return errmsg; } /** * 错误信息。 * Param errmsg **/ public void setErrmsg(String errmsg) { this.errmsg = errmsg; } public TenantListDto totalRecords(Integer totalRecords) { this.totalRecords = totalRecords; return this; } /** * 租户数量。 * return totalRecords **/ @ApiModelProperty(value = "租户数量。") public Integer getTotalRecords() { return totalRecords; } /** * 租户数量。 * Param totalRecords **/ public void setTotalRecords(Integer totalRecords) { this.totalRecords = totalRecords; } public TenantListDto pageIndex(Integer pageIndex) { this.pageIndex = pageIndex; return this; } /** * 分页的序号。 * return pageIndex **/ @ApiModelProperty(value = "分页的序号。") public Integer getPageIndex() { return pageIndex; } /** * 分页的序号。 * Param pageIndex **/ public void setPageIndex(Integer pageIndex) { this.pageIndex = pageIndex; } public TenantListDto pageSize(Integer pageSize) { this.pageSize = pageSize; return this; } /** * 分页的大小。 * return pageSize **/ @ApiModelProperty(value = "分页的大小。") public Integer getPageSize() { return pageSize; } /** * 分页的大小。 * Param pageSize **/ public void setPageSize(Integer pageSize) { this.pageSize = pageSize; } public TenantListDto data(List<TenantData> data) { this.data = data; return this; } public TenantListDto addDataItem(TenantData dataItem) { if (this.data == null) { this.data = new ArrayList<TenantData>(); } this.data.add(dataItem); return this; } /** * 租户列表信息。 * return data **/ @ApiModelProperty(value = "租户列表信息。") public List<TenantData> getData() { return data; } /** * 租户列表信息。 * Param data **/ public void setData(List<TenantData> data) { this.data = data; } @Override public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } TenantListDto tenantListDto = (TenantListDto) o; return Objects.equals(this.errcode, tenantListDto.errcode) && Objects.equals(this.errmsg, tenantListDto.errmsg) && Objects.equals(this.totalRecords, tenantListDto.totalRecords) && Objects.equals(this.pageIndex, tenantListDto.pageIndex) && Objects.equals(this.pageSize, tenantListDto.pageSize) && Objects.equals(this.data, tenantListDto.data); } @Override public int hashCode() { return Objects.hash(errcode, errmsg, totalRecords, pageIndex, pageSize, data); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TenantListDto {\n"); sb.append(" errcode: ").append(toIndentedString(errcode)).append("\n"); sb.append(" errmsg: ").append(toIndentedString(errmsg)).append("\n"); sb.append(" totalRecords: ").append(toIndentedString(totalRecords)).append("\n"); sb.append(" pageIndex: ").append(toIndentedString(pageIndex)).append("\n"); sb.append(" pageSize: ").append(toIndentedString(pageSize)).append("\n"); sb.append(" data: ").append(toIndentedString(data)).append("\n"); sb.append("}"); return sb.toString(); } /** * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } }
[ "qianqifeng@hotmail.com" ]
qianqifeng@hotmail.com
fc17ad43b74403360bcd06d8158c952146843f73
eb422378f368ea26c9f203a8ea88f0cba710bb42
/cust-pay-web-boss/src/main/java/com/roncoo/pay/controller/account/AccountController.java
bd70e6fa783aa545fcae789e8ccdc5fd4c66b0c3
[]
no_license
SteveTuking/cust-dubbo
38c2c0ade50ea83446d30d8d19769ef1ecf6884a
d9dc52799c87ecd33a7a51c698375600b62d371b
refs/heads/master
2021-01-20T00:20:44.988781
2018-05-07T23:41:03
2018-05-07T23:41:03
89,113,093
0
0
null
null
null
null
UTF-8
Java
false
false
2,894
java
package com.roncoo.pay.controller.account; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import com.roncoo.pay.common.core.page.PageBean; import com.roncoo.pay.common.core.page.PageParam; import com.roncoo.pay.service.account.api.RpAccountHistoryService; import com.roncoo.pay.service.account.api.RpAccountService; import com.roncoo.pay.service.account.entity.RpAccount; import com.roncoo.pay.service.account.entity.RpAccountHistory; import com.roncoo.pay.service.user.api.RpUserInfoService; import com.roncoo.pay.service.user.entity.RpUserInfo; /** * @类功能说明: 账户信息 * @类修改者: * @修改日期: * @修改说明: */ @Controller @RequestMapping("/account") public class AccountController { @Autowired private RpAccountService rpAccountService; @Autowired private RpUserInfoService rpUserInfoService; @Autowired private RpAccountHistoryService rpAccountHistoryService; /** * 函数功能说明 : 查询账户信息 * * @参数: @return * @return String * @throws */ @RequestMapping(value = "/list", method ={RequestMethod.POST,RequestMethod.GET}) public String list(RpAccount rpAccount,PageParam pageParam, Model model) { PageBean pageBean = rpAccountService.listPage(pageParam, rpAccount); List<Object> recordList = pageBean.getRecordList(); for(Object obj : recordList){ RpAccount account = (RpAccount)obj; RpUserInfo userInfo = rpUserInfoService.getDataByMerchentNo(account.getUserNo()); account.setUserName(userInfo.getUserName()); } model.addAttribute("pageBean", pageBean); model.addAttribute("pageParam", pageParam); model.addAttribute("rpAccount",rpAccount); return "account/list"; } /** * 函数功能说明 : 查询账户历史信息 * * @参数: @return * @return String * @throws */ @RequestMapping(value = "/historyList", method ={RequestMethod.POST,RequestMethod.GET}) public String historyList(RpAccountHistory rpAccountHistory,PageParam pageParam, Model model) { PageBean pageBean = rpAccountHistoryService.listPage(pageParam, rpAccountHistory); List<Object> recordList = pageBean.getRecordList(); for(Object obj : recordList){ RpAccountHistory history = (RpAccountHistory)obj; RpUserInfo userInfo = rpUserInfoService.getDataByMerchentNo(history.getUserNo()); history.setUserName(userInfo.getUserName()); } model.addAttribute("pageBean", pageBean); model.addAttribute("pageParam", pageParam); model.addAttribute("rpAccountHistory",rpAccountHistory); return "account/historyList"; } }
[ "zhangbing1@yonyou.com" ]
zhangbing1@yonyou.com
98f51d23368a42f0e858919c2d39619f47c38168
e2abf91646e09e12a610746469de67af35340a6d
/src/main/java/me/money/type/proxy/TestProxy.java
64a705e5a434751bca1264dfb23e998a14c0203a
[ "Apache-2.0" ]
permissive
setnx/soso-web
3f7a3837a2aa85bcc47f2d6ed7bb04caa3348aea
3ec6f26c333bea078139db528289d60873441695
refs/heads/master
2021-09-15T20:18:48.253641
2018-04-27T07:52:03
2018-04-27T07:52:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
447
java
package me.money.type.proxy; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Proxy; public class TestProxy { public static void main(String[] args) { Person person = new User(); InvocationHandler handler = new MyProxy(person); person = (Person) Proxy.newProxyInstance(handler.getClass().getClassLoader(), person.getClass().getInterfaces(), handler); person.say(); person.walk(); } }
[ "niucqing@126.com" ]
niucqing@126.com
4571633337c5c7bbae784c9d7b307ebe79fbfccd
171f51f7ea0a46ff452761dcc98b47ac012eaf66
/sp11_BoardTest/src/main/java/com/encore/spring/domain/Board.java
1a679bb353c1e2b8664618b909262be19d181d4c
[]
no_license
owenyi/encore-spring
72ffe48844359f17bc989dd14d75b7c10cf4b7e7
8353b86508caa2584f91dcbb2480cd5a06b4f872
refs/heads/main
2023-06-14T23:50:36.069652
2021-07-07T14:27:19
2021-07-07T14:27:19
379,887,115
0
0
null
null
null
null
UTF-8
Java
false
false
1,454
java
package com.encore.spring.domain; import java.io.Serializable; import java.util.List; import org.springframework.web.multipart.MultipartFile; public class Board implements Serializable { private int no ; private String id ; private String title ; private String contents ; private String filename ; public Board() {}; public Board(String id, String title, String contents, String filename) { this.id = id; this.title = title; this.contents = contents; this.filename = filename; } public Board(int no, String id, String title, String contents, String filename) { super(); this.no = no; this.id = id; this.title = title; this.contents = contents; this.filename = filename; } @Override public String toString() { return "Board [no=" + no + ", id=" + id + ", title=" + title + ", contents=" + contents + ", filename=" + filename + "]"; } public int getNo() { return no; } public void setNo(int no) { this.no = no; } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getContents() { return contents; } public void setContents(String contents) { this.contents = contents; } public String getFilename() { return filename; } public void setFilename(String filename) { this.filename = filename; } }
[ "67588446+owenyi@users.noreply.github.com" ]
67588446+owenyi@users.noreply.github.com
549c28f19b746333ace054ff4440d68f404db95a
7ef7d76e4fddefd34a4251051fa60f1c7dc21e38
/src/main/java/org/openrewrite/kubernetes/rbac/package-info.java
96a941b86068fc59b8409947e5d90fe7ebd99e92
[ "Apache-2.0" ]
permissive
devorbitus/rewrite-kubernetes
90d0af50cbef83f419633915daf776a6f230bd77
f09385b76ea429c1caf17a5620cad0884054c8cb
refs/heads/main
2023-07-06T18:36:26.699709
2021-08-10T00:01:50
2021-08-10T00:01:50
394,745,491
0
0
Apache-2.0
2021-08-10T18:24:21
2021-08-10T18:24:20
null
UTF-8
Java
false
false
794
java
/* * Copyright 2020 the original author or authors. * <p> * 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 * <p> * https://www.apache.org/licenses/LICENSE-2.0 * <p> * 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. */ @NonNullApi @NonNullFields package org.openrewrite.kubernetes.rbac; import org.openrewrite.internal.lang.NonNullApi; import org.openrewrite.internal.lang.NonNullFields;
[ "noreply@github.com" ]
devorbitus.noreply@github.com
d01967921a3e39c496efc5f3b2f124beb172f053
59cb1cb8002dda3f50ca21f7ff9497e2956e1310
/Object-oriented programming/src/ParameterPolymorphism/Child.java
c677b3f14f3c4a9156f4385ae75c3e4de2cbaf0e
[]
no_license
park002/JavaBase2
7c6844b1aeaba538f23bbd3c7da4a772fd3ad4fb
716aa71f710074274a17b5558a9f302bd9c469a6
refs/heads/master
2022-12-24T09:41:28.364356
2020-07-21T07:11:57
2020-07-21T07:11:57
234,732,459
4
0
null
2022-12-16T04:28:57
2020-01-18T12:37:05
Java
UTF-8
Java
false
false
74
java
package ParameterPolymorphism; public class Child extends Parent { }
[ "ekem159@naver.com" ]
ekem159@naver.com
5346f3ebabbe2f08a457b8db77a136127dd29824
28b8e8d7928342a5022a474f84f46072a58802b5
/src/de/ifgi/sitcom/campusmappergamified/activities/StartActivity.java
8016cb52318211f786f999da6cf04fb3b7402202
[]
no_license
mijail79/CampusMapperGamified
b29955599068b1e3d6d7bb5050daa9ccebde6c6c
5e297f66369d79d5b611a3f76589c3a73fb378c8
refs/heads/master
2021-01-20T01:57:11.607733
2014-02-20T18:47:02
2014-02-20T18:47:02
17,029,386
2
1
null
null
null
null
UTF-8
Java
false
false
5,629
java
package de.ifgi.sitcom.campusmappergamified.activities; import java.util.Date; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.net.Uri; import android.os.Bundle; import android.view.View; import android.widget.Button; import com.actionbarsherlock.app.SherlockFragmentActivity; import com.actionbarsherlock.view.Menu; import com.actionbarsherlock.view.MenuItem; import de.ifgi.sitcom.campusmappergamified.R; import de.ifgi.sitcom.campusmappergamified.dialogs.SettingsDialog; import de.ifgi.sitcom.campusmappergamified.indoordata.FloorPlan; import de.ifgi.sitcom.campusmappergamified.io.InternalMappingTxtLog; import de.ifgi.sitcom.campusmappergamified.io.RDFReader; /* * * Launched when the app starts, except in the first time. * Provides the user with a short introduction text, * an introduction video and buttons to either create a new dataset * (calling ChooseLocationActivity) or to select an already existing, * locally stored dataset (calling Activity to be implemented...). */ public class StartActivity extends SherlockFragmentActivity { private Button mLocalProjectButton; private InternalMappingTxtLog log = new InternalMappingTxtLog(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if(MyCampusMapperGame.getInstance().isNewStart()) { log.appendLog("Gamified Applications starts at;"+ new Date()); } setContentView(R.layout.activity_start); mLocalProjectButton = (Button) findViewById(R.id.button_local_project); if (hasLocalFloorPlan()) mLocalProjectButton.setVisibility(View.VISIBLE); } private boolean hasLocalFloorPlan(){ return new RDFReader().localDataAvailable(); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getSupportMenuInflater().inflate(R.menu.start, menu); // update score in the menu SharedPreferences prefs = getSharedPreferences(MappingActivity.PREFS_LAST_LOCATION, 0); SharedPreferences registerPref = getSharedPreferences("ActivityREGISTER", Context.MODE_PRIVATE); MyCampusMapperGame.getInstance().setMyScore(Integer.valueOf(prefs.getString(MappingActivity.PREFS_LAST_SCORE, "0"))); MyCampusMapperGame.getInstance().setPlayerEmail(registerPref.getString("playerEmail", "")); MyCampusMapperGame.getInstance().setPlayerNick(registerPref.getString("playerNick", "")); log.appendLog("Initial Score;"+MyCampusMapperGame.getInstance().getMyScore()); menu.findItem(R.id.action_score).setTitle(String.format("%04d", MyCampusMapperGame.getInstance().getMyScore())); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { // add the new score button case R.id.action_score: Intent intentLeaderboard = new Intent(this, LeaderboardActivity.class); intentLeaderboard.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(intentLeaderboard); return true; case R.id.action_settings: new SettingsDialog().show(getSupportFragmentManager(), ""); return true; default: break; } return true; } /** Called when the user clicks new project button */ public void newProject(View v){ launchBuildingInformationActivity(); } /** Called when the user clicks local project button */ public void localProject(View v){ startMappingActivity(getLastLocation()); } private FloorPlan getLastLocation(){ FloorPlan floorPlan = new FloorPlan(); // Restore preferences SharedPreferences prefs = getSharedPreferences(MappingActivity.PREFS_LAST_LOCATION, 0); floorPlan.setBuildingName(prefs.getString(MappingActivity.PREFS_LAST_LOCATION_BUILDING_NAME, "")); floorPlan.setBuildingURI(prefs.getString(MappingActivity.PREFS_LAST_LOCATION_BUILDING_URI, "")); floorPlan.setFloorNumber(prefs.getInt(MappingActivity.PREFS_LAST_LOCATION_FLOOR_NUMBER, 0)); floorPlan.setSourceFloorPlanImageUri(Uri.parse(prefs.getString(MappingActivity.PREFS_LAST_LOCATION_SOURCE_URI, ""))); floorPlan.setCroppedFloorPlanImageUri(Uri.parse(prefs.getString(MappingActivity.PREFS_LAST_LOCATION_CROPPED_URI, ""))); floorPlan.setFromServer(prefs.getBoolean(MappingActivity.PREFS_LAST_LOCATION_FROM_SERVER, false)); // restore score MyCampusMapperGame.getInstance().setMyScore(Integer.valueOf(prefs.getString(MappingActivity.PREFS_LAST_SCORE, "0"))); return floorPlan; } private void startMappingActivity(FloorPlan floorPlan){ Intent intent = new Intent(this, MappingActivity.class); intent.putExtra(ImageSourceActivity.EXTRA_SOURCE_URI, floorPlan.getSourceFloorPlanImageUri().toString()); intent.putExtra(ImageSourceActivity.EXTRA_CROPPED_URI, floorPlan.getCroppedFloorPlanImageUri().toString()); intent.putExtra(ChooseLocationActivity.EXTRA_BUILDING_NAME, floorPlan.getBuildingName()); intent.putExtra(ChooseLocationActivity.EXTRA_BUILDING_URI, floorPlan.getBuildingURI()); intent.putExtra(ChooseLocationActivity.EXTRA_FLOOR_NUMBER, Integer.toString(floorPlan.getFloorNumber())); intent.putExtra(ChooseLocationActivity.EXTRA_LOAD_LOCAL_DATA, true); intent.putExtra(ChooseLocationActivity.EXTRA_LOAD_FROM_SERVER, floorPlan.isFromServer()); startActivity(intent); } public void launchBuildingInformationActivity() { Intent intent = new Intent(this, ChooseLocationActivity.class); startActivity(intent); } }
[ "mijail.naranjo@gmail.com" ]
mijail.naranjo@gmail.com
78eafbc3b1af7e5ec82d1189e89e03900c9bd7d0
5ac6c8d6f1d8260903090bd041cd31029515ecba
/library/src/net/emandates/merchant/library/Instrumentation.java
307f07ba6dcee6260998185adf3f94dc97a8999f
[ "MIT" ]
permissive
Currence-Online/emandates-libraries-java
cacf84743924e058f1e8e66a122c63929f9c3e61
bf0a95365c663d948a318b81dd3f15037db8f31d
refs/heads/master
2023-04-27T09:30:08.280414
2020-11-05T13:40:00
2020-11-05T13:40:00
126,312,411
2
3
MIT
2022-12-16T03:09:30
2018-03-22T09:38:09
Java
UTF-8
Java
false
false
225
java
package net.emandates.merchant.library; /** * Instrumentation code: Core or B2B */ public enum Instrumentation { /** * CORE instrumentation */ CORE, /** * B2B instrumentation */ B2B }
[ "vlad.iliescu@gmail.com" ]
vlad.iliescu@gmail.com
0742300ccd3f97475fa222b2101f33308518647c
7e083f48c422dd30c85924faa6dba946358029bc
/unit_demo/src/hex/com/powerMock/newmock/TestClassUnderTest.java
a021899a9b4806a0d6ba36393af14afdec718d6f
[]
no_license
huoex/unit_test
74c90d52c9343dba3205f3ddcd5fc46b7f8b67c2
fcd05dc111427aa8c1cc2463c51f5a53b7001abe
refs/heads/master
2021-01-19T10:01:17.144667
2014-09-25T09:22:40
2014-09-25T09:22:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
876
java
package hex.com.powerMock.newmock; import java.io.File; import junit.framework.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.api.mockito.PowerMockito; import org.powermock.modules.junit4.PowerMockRunner; @RunWith(PowerMockRunner.class) public class TestClassUnderTest { @Test @PrepareForTest(ClassUnderTest.class) public void testCallInternalInstance() throws Exception { File file = PowerMockito.mock(File.class); ClassUnderTest underTest = new ClassUnderTest(); PowerMockito.whenNew(File.class).withArguments("bbb").thenReturn(file); PowerMockito.when(file.exists()).thenReturn(true); Assert.assertTrue(underTest.callInternalInstance("bbb")); } }
[ "huoex0628@gmai.com" ]
huoex0628@gmai.com
f86ce6bbddd8204a3addcc743bd4f1aacb19e592
d4e482f8d1645346bfb4ef74bb40687590ebf248
/src/main/java/demo/ans/webservice/database/model/h2/PolicyMasterRepository.java
4ba9acf975501664e5e772bb456ecf99f5015b2b
[]
no_license
studiofu/demo-ans-webservice
c6298781dd37f175b7a07fe1e365059e9de3b74c
6292215bfd1145f9f2d46691aadde19d4cf78784
refs/heads/master
2023-05-12T10:30:37.120704
2019-09-19T01:32:55
2019-09-19T01:32:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
208
java
package demo.ans.webservice.database.model.h2; import org.springframework.data.jpa.repository.JpaRepository; public interface PolicyMasterRepository extends JpaRepository<PolicyMaster, Integer>{ }
[ "johnson.fu@gmail.com" ]
johnson.fu@gmail.com
98eaa65cae1746cedb2a9ae40bcbbfff46559c68
4773dfe920e783df8a2ddcad22fe2389f4613275
/src/test/java/nakliyat/Nak/AppTest.java
8056897b14a90bc57cffd3db665156f0db0784a5
[ "MIT" ]
permissive
mucahitzirek/nakliyat-otomasyonu
2685b4014d9c9e65d39dde785dd1a98843d973e4
ce5130ba24adb76adba8a21d23bca130d9aaf3bf
refs/heads/master
2023-04-02T12:38:23.060062
2021-04-09T17:50:33
2021-04-09T17:50:33
288,163,596
1
0
MIT
2021-04-09T17:47:16
2020-08-17T11:36:07
Java
UTF-8
Java
false
false
640
java
package nakliyat.Nak; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Unit test for simple App. */ public class AppTest extends TestCase { /** * Create the test case * * @param testName name of the test case */ public AppTest( String testName ) { super( testName ); } /** * @return the suite of tests being tested */ public static Test suite() { return new TestSuite( AppTest.class ); } /** * Rigourous Test :-) */ public void testApp() { assertTrue( true ); } }
[ "68281786+mucahitzirek@users.noreply.github.com" ]
68281786+mucahitzirek@users.noreply.github.com
a6efb8e3027786a3fe21b1c5ead12708a595b2be
d098527da417e3c359b34fa48dcf1454699b0997
/src/main/java/model/Imagem_.java
e190e3d5c09fdf647323d2905b75a07b78d4e479
[]
no_license
svitorroberto/fcadastro
0cbdb05bd61f15373a4935b82274aa7e587bae5c
9b5758ef41c3675aab9d9dfaba3ad73e5aef992a
refs/heads/master
2020-04-06T07:11:29.812839
2016-09-14T13:27:17
2016-09-14T14:51:00
61,302,759
0
0
null
null
null
null
UTF-8
Java
false
false
490
java
package model; import javax.annotation.Generated; import javax.persistence.metamodel.SingularAttribute; import javax.persistence.metamodel.StaticMetamodel; @Generated(value="Dali", date="2016-07-26T10:23:15.532-0300") @StaticMetamodel(Imagem.class) public class Imagem_ { public static volatile SingularAttribute<Imagem, String> fi_codigo; public static volatile SingularAttribute<Imagem, String> fi_rg; public static volatile SingularAttribute<Imagem, byte[]> fi_foto; }
[ "Vitor@TI03-PC.ceasa.go" ]
Vitor@TI03-PC.ceasa.go
77c262fd4a1663ea2d40f35de84096a28ee8e0f8
e47a1467a071226750986e922155bc447ba3ca3b
/src/com/harleensahni/android/mbr/data/BringToForegroundReceiver.java
de3fce6d815f3ac2ffc708536908bfdc66c57c42
[ "Apache-2.0" ]
permissive
tombartosz/tombartosz-media-button-router
4bdb44996a87267c249dbd7a8dec36528c1a30a8
3af80fd3f41e1b8a7a3cbeb002c4acb5994e3ee3
refs/heads/master
2016-09-10T06:51:12.693757
2016-01-27T15:43:28
2016-01-27T15:43:28
35,808,890
0
0
null
null
null
null
UTF-8
Java
false
false
2,698
java
package com.harleensahni.android.mbr.data; import com.harleensahni.android.mbr.Constants; import com.harleensahni.android.mbr.Utils; import android.app.KeyguardManager; import android.content.ActivityNotFoundException; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.os.PowerManager; import android.os.PowerManager.WakeLock; import android.preference.PreferenceManager; import android.view.KeyEvent; /** * * @author bartosz.tomaszewski * */ public class BringToForegroundReceiver extends Receiver { private final ApplicationInfo applicationInfo; private final Context context; private final SharedPreferences preferences; public BringToForegroundReceiver(final ApplicationInfo applicationInfo, final Context context) { super(); this.applicationInfo = applicationInfo; this.context = context; this.preferences = PreferenceManager.getDefaultSharedPreferences(context); final PackageManager packageManager = this.context.getPackageManager(); setPrefix("Switch to:"); setName(packageManager.getApplicationLabel(applicationInfo).toString()); setIcon(packageManager.getApplicationIcon(applicationInfo)); } @Override public void onSelect(int position) { Intent launchIntent = context.getPackageManager() .getLaunchIntentForPackage(applicationInfo.packageName); context.startActivity(launchIntent); /* unlock device */ KeyguardManager km = (KeyguardManager) context.getSystemService(Context.KEYGUARD_SERVICE); final KeyguardManager.KeyguardLock kl = km .newKeyguardLock("MyKeyguardLock"); kl.disableKeyguard(); PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE); WakeLock wakeLock = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP | PowerManager.ON_AFTER_RELEASE, "MyWakeLock"); wakeLock.acquire(Constants.WAKE_TIME); /* String last_media_button_receiver = preferences.getString(Constants.LAST_MEDIA_BUTTON_RECEIVER, null); ComponentName cn = ComponentName.unflattenFromString(last_media_button_receiver); //Set the current audio player name/package preferences.edit().putString(Constants.CURRENT_AUDIO_PLAYER_NAME, cn.getShortClassName()) .putString(Constants.CURRENT_AUDIO_PLAYER_PACKAGE, cn.getPackageName()) .commit();*/ Utils.forwardKeyCodeToComponent(context, null, false, KeyEvent.KEYCODE_MEDIA_PLAY, null, true); } }
[ "tombartosz@gmail.com" ]
tombartosz@gmail.com
efcf784b08d3ba8937a990a8517b7041a9a95cc4
d1c0c1d77321439ba820faee5f906def7a521ba0
/app/src/main/java/com/example/superzhang/demonews/fragment/DialogFragmentSelectCity.java
7b2b4cb6a10152ba28e33e70ed0f7d123d63bc2b
[]
no_license
icarus9527/NewsDemo
c81778a92cf85c38261598dab9f428abdec04f4c
0faaced99fab3f6d88b550ac86b468a856949693
refs/heads/master
2020-12-03T02:05:14.715664
2017-06-30T15:51:21
2017-06-30T15:51:21
95,903,169
0
0
null
null
null
null
UTF-8
Java
false
false
2,761
java
package com.example.superzhang.demonews.fragment; import android.app.FragmentManager; import android.content.SharedPreferences; import android.os.Bundle; import android.os.PersistableBundle; import android.support.annotation.Nullable; import android.support.v4.app.DialogFragment; import android.support.v7.app.AppCompatActivity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.Window; import android.widget.EditText; import android.widget.TextView; import com.example.superzhang.demonews.R; import com.example.superzhang.demonews.listener.onCityChangedListener; import org.w3c.dom.Text; /** * Created by Administrator on 2017/6/30/030. */ public class DialogFragmentSelectCity extends DialogFragment{ private onCityChangedListener listener; private String showMSg; public DialogFragmentSelectCity(String showMSg){ this.showMSg = showMSg; } @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { //getDialog().requestWindowFeature(Window.FEATURE_NO_TITLE); View view = inflater.inflate(R.layout.dialog_select_city,container,false); view.setMinimumWidth(200); view.setMinimumHeight(200); final EditText edt_city_name = (EditText) view.findViewById(R.id.edt_weather_city); edt_city_name.setHint(showMSg); TextView tv_select = (TextView) view.findViewById(R.id.btn_weather_query); //获取城市名称 tv_select.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { final String cityName = edt_city_name.getText().toString().trim(); if (cityName!=null && cityName!=""){ setCityName(cityName); System.out.println("-----------------CityName:"+getCityName()); } listener.onCityChanged(); dismiss(); } }); return view; } public String getCityName() { SharedPreferences preferences = getContext().getSharedPreferences("city", getContext().MODE_PRIVATE); String cityName = preferences.getString("city_name","广州"); return cityName; } public void setCityName(String cityName){ SharedPreferences preferences = getContext().getSharedPreferences("city", getContext().MODE_PRIVATE); SharedPreferences.Editor editor = preferences.edit(); editor.putString("city_name",cityName); editor.apply(); }; public void setOnCityChangedListener(onCityChangedListener listener){ this.listener = listener; } }
[ "icarus9527@outlook.com" ]
icarus9527@outlook.com
796eb6be4a415f8d954f1a1a33985e01048e3a5e
799cce351010ca320625a651fb2e5334611d2ebf
/Data Set/Manual/After/after_668.java
9a29d932c3ad3f90b4560c95fa5849c8a067b9ad
[]
no_license
dareenkf/SQLIFIX
239be5e32983e5607787297d334e5a036620e8af
6e683aa68b5ec2cfe2a496aef7b467933c6de53e
refs/heads/main
2023-01-29T06:44:46.737157
2020-11-09T18:14:24
2020-11-09T18:14:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
443
java
class Dummy{ public int update(String names) throws Exception { Connection dbConnection = null; PrepearedStatement sqlStatement = null; dbConnection = IO.getDBConnection(); sqlStatement = dbConnection.prepareStatement("update users set hitcount=hitcount+1 where name=?"); sqlStatement.setObject(1,names); resultSet = sqlStatement.executeQuery(); return resultSet; }}
[ "jahin99@gmail.com" ]
jahin99@gmail.com
051da7d07a4f268b165a7c853e0ef5a9ac7e1401
d2a7de2ab1bbf910e3148a3774c67faa26da6d06
/src/cn/edu/seu/institute/dao/ApplicationDAO.java
eb88c26d63bffc5e8b690b84dbad9701048d98f5
[]
no_license
bingluo/institute
0328c0b12d2d1d269c2f4073e7e8a3b39a455e21
19cdada9c85e0228599659615778aab3e2900413
refs/heads/master
2016-09-10T19:46:35.453765
2015-04-10T13:17:48
2015-04-10T13:17:48
33,728,841
0
0
null
null
null
null
UTF-8
Java
false
false
493
java
package cn.edu.seu.institute.dao; import java.util.List; import cn.edu.seu.institute.entity.Application; public interface ApplicationDAO { List<Application> ApplicationByBaseAndRange(int base, int range); int getApplicationCount(); List<Application> getApplications(); Application getApplicationById(int id); Application getApplicationByName(String name); void insertApplication(Application application); void updateApplication(Application application); }
[ "bingluo@foxmail.com" ]
bingluo@foxmail.com
742281d817905ed956bd6860c9234b72e11a63d4
55fdd94c1d7c06be169f0c57df6c7995879e2864
/shangguigu/排序/code/src/com/cjc/sort/ChooseSort.java
d68466ad8c61b67c42e626278fd235d061e54c98
[]
no_license
jccccccc16/algorithm-study
8d7c240c0009f01bdaa93b856c02c2c9926c5809
3e98677771f790525745194c25d957d095d75d25
refs/heads/main
2023-06-06T10:34:08.385397
2021-06-28T06:53:20
2021-06-28T06:53:20
360,738,944
0
0
null
null
null
null
UTF-8
Java
false
false
1,054
java
package com.cjc.sort; /** * Created by IntelliJ IDEA. * User: cjc * Date: 2021/4/27 * Time: 16:43 * To change this template use File | Settings | File Templates. * 选择排序 **/ public class ChooseSort { public static int[] sort(int []nums){ for(int i=0;i<nums.length;i++){ // 当前位置往后比较 int min=0; min = i; for(int j=i;j<nums.length-1;j++){ if(nums[min]>nums[j+1]){ min = j+1; } } // 最小值与当前位置交换 int temp = nums[i]; nums[i] = nums[min]; nums[min] = temp; } return nums; } public static void main(String[] args) { int []nums = Utils.createArray(40); for (int num : nums) { System.out.println(num); } System.out.println("---------------------------"); int[] sort = sort(nums); for (int i : sort) { System.out.println(i); } } }
[ "617028197@qq.com" ]
617028197@qq.com
f56fe2bf5c34f944087428f0ee95346625aa4a3d
535154de6cd76b8f09a85dcad65a9203e3428b60
/Visitor/CS4015DP8Java_jacobbaird/src/BinaryTreeVisitor.java
052f635e82f79c42a40f0431d5f7fc6f58a7d5d5
[]
no_license
xneonz/DesignDemonstration
8459b95cc6f84165ba1edd45ac63927265ffd4b6
df46315e97a715cc1e9f3bd2bb1d21a04585076d
refs/heads/master
2023-01-05T20:58:08.246491
2020-10-23T19:13:15
2020-10-23T19:13:15
306,726,352
0
0
null
null
null
null
UTF-8
Java
false
false
248
java
public abstract class BinaryTreeVisitor { /* * Visitors perform separate tasks on operators and nodes. */ public abstract void visitOperator(OperatorBinaryTreeNode operator); public abstract void visitNumber(NumberBinaryTreeNode number); }
[ "j198mb@gmail.com" ]
j198mb@gmail.com
ed86fd0a424866e1d1fa5bdb92e492b9093cd7e2
3b5ca532358b995ac66a9f53e929a061ac6f60a1
/app/src/main/java/com/nada/technical_challenge/currency_converter/interfaces/CurrencyItemClickListener.java
aaf5b86611cae9f8b3442baaac9c1f3ece0a882b
[]
no_license
NadaSarhan/challenge
44570383591b0c1e502501dacf6a89a9d67c69e1
c61fd95e7dddee0cd129e4a6fea08e76aae8f7f0
refs/heads/master
2023-01-31T02:04:23.261841
2020-12-16T02:26:22
2020-12-16T02:26:22
321,828,569
0
0
null
null
null
null
UTF-8
Java
false
false
230
java
package com.nada.technical_challenge.currency_converter.interfaces; import com.nada.technical_challenge.currency_converter.model.Currency; public interface CurrencyItemClickListener { void onCurrencyItemClick(Currency c); }
[ "Nada_Sarahn@yahoo.com" ]
Nada_Sarahn@yahoo.com
3c0dca34d636dfbdfd90a435e6eee7c4080d716e
68ee068f2a8f44f6c469a70d8ba47eb667591e8a
/datasets/styler/be5/repair-attempt/batch_0/45/OperationSupport.java
c86a9a1b6093a52dbbff23dd076ddbfc209baae7
[]
no_license
aqhvhghtbtb/styler
261032390ef39224ab1fdfd51a70ba556e5f81d4
e2881daa6bbc7763ad4a9ba704c4d834316ed9c1
refs/heads/master
2021-03-07T16:50:11.364844
2020-02-28T10:00:47
2020-02-28T10:00:47
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,912
java
package com.developmentontheedge.be5.server.operations.support; import com.developmentontheedge.be5.base.model.UserInfo; import com.developmentontheedge.be5.base.services.Meta; import com.developmentontheedge.be5.base.services.UserAwareMeta; import com.developmentontheedge.be5.database.DbService; import com.developmentontheedge.be5.databasemodel.DatabaseModel; import com.developmentontheedge.be5.metadata.model.Query; import com.developmentontheedge.be5.operation.model.Operation; import com.developmentontheedge.be5.operation.model.OperationResult; import com.developmentontheedge.be5.operation.services.OperationsFactory; import com.developmentontheedge.be5.operation.services.validation.Validator; import com.developmentontheedge.be5.operation.support.BaseOperationSupport; import com.developmentontheedge.be5.query.services.QueriesService; import com.developmentontheedge.be5.server.helpers.DpsHelper; import com.developmentontheedge.be5.server.model.FrontendAction; import com.developmentontheedge.be5.web.Request; import com.developmentontheedge.be5.web.Session; import javax.inject.Inject; public abstract class OperationSupport extends BaseOperationSupport implements Operation { public Meta meta; public UserAwareMeta userAwareMeta; public DbService db; public DatabaseModel database; public DpsHelper dpsHelper; public Validator validator; public OperationsFactory operations; public QueriesService queries; protected Session session; protected Request request; protected UserInfo userInfo; @Inject public void inject(Meta meta, UserAwareMeta userAwareMeta, DbService db, DatabaseModel database, DpsHelper dpsHelper, Validator validator, OperationsFactory operations, QueriesService queries, Session session, Request request, UserInfo userInfo) { this.meta = meta; this.userAwareMeta = userAwareMeta; this.db = db; this.database = database; this.dpsHelper = dpsHelper; this.validator = validator; this.operations = operations; this.queries = queries; this.session = session; this.request = request; this.userInfo = userInfo; } public Query getQuery() { return meta.getQuery(getInfo().getEntityName(), context.getQueryName()); } public void setResultFinished() { setResult(OperationResult.finished()); } public void setResultFinished(String message) { setResult(OperationResult.finished(message)); } public void setResultFinished(String message, FrontendAction... frontendActions) { setResult(OperationResult.finished(message, frontendActions)); } public void setResultFinished(FrontendAction... frontendActions) { setResult(OperationResult.finished(null, frontendActions)); } }
[ "bloriot97@gmail.com" ]
bloriot97@gmail.com
688fd616ba7325b837803d327a25f040f825a0ec
ec2fa0751126f34bbe349a346cfc1cc81dd28f9a
/src/main/java/ute/hibook/entity/Typebook.java
a38b3d879f54915cedc874aec70f3654ba889763
[]
no_license
ThiMy46/HiBook_KLTN19
a3d83b7ab01ad79437d81328814f9476aa9b2ae7
5b5df22e4a33d1b8978fc423a69331861007f167
refs/heads/master
2022-12-28T15:31:39.251756
2020-06-17T22:22:43
2020-06-17T22:22:43
178,658,073
0
1
null
2022-12-15T23:45:29
2019-03-31T07:47:49
Java
UTF-8
Java
false
false
1,322
java
package ute.hibook.entity; import java.io.Serializable; import javax.persistence.*; import java.util.List; /** * The persistent class for the typebook database table. * */ @Entity(name="typebook") public class Typebook implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy=GenerationType.IDENTITY) private int idType; @Lob private String imgType; private String nameType; //bi-directional many-to-one association to Book @OneToMany(mappedBy="typebook", fetch = FetchType.EAGER) private List<Book> books; public Typebook() { } public int getIdType() { return this.idType; } public void setIdType(int idType) { this.idType = idType; } public String getImgType() { return this.imgType; } public void setImgType(String imgType) { this.imgType = imgType; } public String getNameType() { return this.nameType; } public void setNameType(String nameType) { this.nameType = nameType; } public List<Book> getBooks() { return this.books; } public void setBooks(List<Book> books) { this.books = books; } public Book addBook(Book book) { getBooks().add(book); book.setTypebook(this); return book; } public Book removeBook(Book book) { getBooks().remove(book); book.setTypebook(null); return book; } }
[ "31314956+ThiMy46@users.noreply.github.com" ]
31314956+ThiMy46@users.noreply.github.com
6e53266f859df649c5ffd9266805d453ee81b523
2191eb97c82ac98486d73cb0fff1fc793ec12082
/Chat-Client-Oneway/app/src/main/java/edu/stevens/cs522/chatclient/ChatClient.java
c151c996128f773b335542afbf3df57b22f0cc5b
[]
no_license
Madhuvandhana/AndroidDatabasesDemo
a31ad56f4f806aaefb1310b89091adfaf7c4e2ab
dd317fa6b7f0b378951fa8f22300ba80fad53d4c
refs/heads/master
2021-02-09T13:41:33.598204
2020-03-02T05:36:16
2020-03-02T05:36:16
244,288,739
0
0
null
null
null
null
UTF-8
Java
false
false
4,126
java
/********************************************************************* Client for sending chat messages to the server.. Copyright (c) 2012 Stevens Institute of Technology **********************************************************************/ package edu.stevens.cs522.chatclient; import java.io.IOException; import java.net.DatagramPacket; import java.net.InetAddress; import java.net.UnknownHostException; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.os.StrictMode; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.EditText; import edu.stevens.cs522.base.DatagramSendReceive; import edu.stevens.cs522.base.InetAddressUtils; /* * @author dduggan * */ public class ChatClient extends Activity implements OnClickListener { final static private String TAG = ChatClient.class.getCanonicalName(); /* * Socket used for sending */ // private DatagramSocket clientSocket; private DatagramSendReceive clientSocket; /* * Widgets for dest address, message text, send button. */ private EditText destinationHost; private EditText chatName; private EditText messageText; private Button sendButton; /* * Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.chat_client); setTitle("Madhu Vandhana Vijay Kumar"); /** * Let's be clear, this is a HACK to allow you to do network communication on the chat_client thread. * This WILL cause an ANR, and is only provided to simplify the pedagogy. We will see how to do * this right in a future assignment (using a Service managing background threads). */ StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); StrictMode.setThreadPolicy(policy); // TODO initialize the UI. destinationHost = findViewById(R.id.destination_host); chatName = findViewById(R.id.chat_name); messageText = findViewById(R.id.message_text); sendButton = findViewById(R.id.send_button); sendButton.setOnClickListener(this); // End todo try { int port = getResources().getInteger(R.integer.app_port); clientSocket = new DatagramSendReceive(port); // clientSocket = new DatagramSocket(port); } catch (IOException e) { IllegalStateException ex = new IllegalStateException("Cannot open socket"); ex.initCause(e); throw ex; } } /* * Callback for the SEND button. */ public void onClick(View v) { try { /* * On the emulator, which does not support WIFI stack, we'll send to * (an AVD alias for) the host loopback interface, with the server * port on the host redirected to the server port on the server AVD. */ InetAddress destAddr; int destPort = getResources().getInteger(R.integer.app_port); String clientName; byte[] sendData; // Combine sender and message text; default encoding is UTF-8 // TODO get data from UI (no-op if chat name is blank) destAddr = InetAddress.getByName(destinationHost.getText().toString()); clientName = chatName.getText().toString(); String data = clientName+":"+messageText.getText().toString(); sendData = data.getBytes(); // End todo Log.d(TAG, String.format("Sending data from address %s:%d", clientSocket.getInetAddress(), clientSocket.getPort())); DatagramPacket sendPacket = new DatagramPacket(sendData, sendData.length, destAddr, destPort); clientSocket.send(sendPacket); // Log.d(TAG, "Sent packet: " + line); } catch (UnknownHostException e) { throw new IllegalStateException("Unknown host exception: " + e.getMessage()); } catch (IOException e) { throw new IllegalStateException("IO exception: " + e.getMessage()); } messageText.setText(""); } @Override public void onDestroy() { super.onDestroy(); if (clientSocket != null) { clientSocket.close(); } } }
[ "=" ]
=
30f0010b306f57e3e109bb828fb085d3f4754445
59ab325d85b9c3f702ba45af83a03c0b70db07ff
/com/Business/Test.java
f7972da853cb0f74c9ef0237afbdce072ed92ce6
[]
no_license
hprem991/Advertisement
4600bf05662af8068554b59ca27d252455eb76aa
1bf4a2a9470f48cec721958fbcb122d9fb52f78d
refs/heads/master
2020-09-17T21:40:14.294524
2016-09-10T05:12:07
2016-09-10T05:12:07
67,852,226
0
0
null
null
null
null
UTF-8
Java
false
false
1,725
java
package com.Business; import com.Dao.*; /*import java.lang.*; import java.lang.annotation.*; import org.hibernate.*; import java.util.*; import org.hibernate.annotations.*; import org.hibernate.cfg.*; */ import java.util.List; import java.util.Date; import java.util.Iterator; import org.hibernate.HibernateException; import org.hibernate.Session; import org.hibernate.Transaction; import org.hibernate.SessionFactory; import org.hibernate.cfg.Configuration; import com.Dao.Login; //public class Test { // public static SessionFactory factory; // // public static void main(String a[]){ // try{ // Configuration cnf = null; // try { // cnf = new Configuration(); // System.out.println("Configuration Done !!!"); // } catch(Exception e){ // System.out.println("Configuration Exception "+e); // } // factory = cnf.configure().buildSessionFactory(); // } catch (Exception e) { // System.out.println("Failed to create a session factory "+e); // throw new ExceptionInInitializerError(e); // } // // Test test = new Test(); // if(test.addLogin("Prem","Chettri")) // System.out.println("Data Added !!!"); // else // System.out.println("Failed to Add Data !!!"); // } // // public boolean addLogin(String username,String password) { // Session session = factory.openSession(); // Transaction trans = null; // Integer id = null; // try { // trans = session.beginTransaction(); // Login log = new Login(); // log.setUsername(username); // log.setPassword(password); // id = (Integer)session.save(log); // trans.commit(); // return true; // } catch (Exception e) { // System.out.println("Error in Saving Data " +e); // return false; // } // } // //}
[ "chettri.p@husky.neu.edu" ]
chettri.p@husky.neu.edu
924e7364ec8fec22e24051feeb67c177e87d970c
ddb80aa5b6e7b645632be39fcfba478faa550a60
/BoksIterator.java
c8c88a45312ead8916ac885ca86837ad37d6e1c8
[]
no_license
hlokensgard/Spilleprosjekt_Var_2015
6e4ef0344b8b101c5372cba7c73a2e2a08fa4d7b
05112dffac8959ca6d9c055943e5978cfe6fda36
refs/heads/master
2021-08-27T15:26:43.865286
2015-04-22T09:06:06
2015-04-22T09:06:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
404
java
package spillprosjekt; import java.util.Iterator; import javafx.scene.layout.VBox; public class BoksIterator implements Iterator<Object> { private int i; VBox boks; public BoksIterator(VBox boks){ this.i = 0; this.boks = boks; } @Override public boolean hasNext() { return boks.getChildren().size() > i; } @Override public Object next() { return boks.getChildren().get(i++); } }
[ "erikbjorgen@gmail.com" ]
erikbjorgen@gmail.com
cf5d3fa2c0478f573d520585ac5876973a8f8a96
489a75310de4c8684dc64fb0007e3eeb6c130f60
/ailib/src/main/java/ai/api/AIDataService.java
ca740b16c504b44ab321da78163f711d9c64ee34
[ "Apache-2.0" ]
permissive
nsp4real/api-ai-android-sdk-nsp4real
28c2e9a9355de406e87601a28127fa83ca9610cf
ebeb11000f2b4ad3e39e0d89f39e32fa9c5776ed
refs/heads/master
2021-01-18T10:06:47.788149
2015-01-27T05:00:33
2015-01-27T05:00:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
9,471
java
package ai.api; /*********************************************************************************************************************** * * API.AI Android SDK - client-side libraries for API.AI * ================================================= * * Copyright (C) 2014 by Speaktoit, Inc. (https://www.speaktoit.com) * https://www.api.ai * *********************************************************************************************************************** * * 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. * ***********************************************************************************************************************/ import android.content.Context; import android.text.TextUtils; import android.util.Log; import com.google.gson.Gson; import com.google.gson.JsonSyntaxException; import org.apache.commons.io.Charsets; import org.apache.commons.io.IOUtils; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; import java.util.Calendar; import java.util.List; import java.util.UUID; import ai.api.http.HttpClient; import ai.api.model.AIContext; import ai.api.model.AIRequest; import ai.api.model.AIResponse; /** * Do simple requests to the AI Service */ public class AIDataService { public static final String TAG = AIDataService.class.getName(); private final Context context; private final AIConfiguration config; private final String sessionId; public AIDataService(final Context context, final AIConfiguration config) { this.context = context; this.config = config; sessionId = UUID.randomUUID().toString(); } /** * Make request to the ai service. This method must not be called in the UI Thread * * @param request request object to the service * @return response object from service */ public AIResponse request(final AIRequest request) throws AIServiceException { if (request == null) { throw new IllegalArgumentException("Request argument must not be null"); } Log.d(TAG, "Start request"); final Gson gson = GsonFactory.getGson(); HttpURLConnection connection = null; try { final URL url = new URL(config.getQuestionUrl()); request.setLanguage(config.getLanguage()); request.setSessionId(sessionId); request.setTimezone(Calendar.getInstance().getTimeZone().getID()); final String queryData = gson.toJson(request); Log.d(TAG, "Request json: " + queryData); connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("POST"); connection.setDoOutput(true); connection.addRequestProperty("Authorization", "Bearer " + config.getApiKey()); connection.addRequestProperty("ocp-apim-subscription-key", config.getSubscriptionKey()); connection.addRequestProperty("Content-Type","application/json; charset=utf-8"); connection.addRequestProperty("Accept","application/json"); connection.connect(); final BufferedOutputStream outputStream = new BufferedOutputStream(connection.getOutputStream()); IOUtils.write(queryData, outputStream, Charsets.UTF_8); outputStream.close(); final InputStream inputStream = new BufferedInputStream(connection.getInputStream()); final String response = IOUtils.toString(inputStream, Charsets.UTF_8); inputStream.close(); if (TextUtils.isEmpty(response)) { throw new AIServiceException("Empty response from ai service. Please check configuration."); } Log.d(TAG, "Response json: " + response); final AIResponse aiResponse = gson.fromJson(response, AIResponse.class); return aiResponse; } catch (final MalformedURLException e) { Log.e(TAG, "Malformed url should not be raised", e); throw new AIServiceException("Wrong configuration. Please, connect to AI Service support", e); } catch (final IOException e) { if (connection != null) { try { final String errorString = IOUtils.toString(connection.getErrorStream(), Charsets.UTF_8); Log.d(TAG, "" + errorString); if (!TextUtils.isEmpty(errorString)) { final AIResponse errorResponse = gson.fromJson(errorString, AIResponse.class); return errorResponse; } } catch (final IOException ex) { Log.w(TAG, "Wrong error format", ex); } } Log.e(TAG, "Can't make request to the Speaktoit AI service. Please, check connection settings and API access token.", e); throw new AIServiceException("Can't make request to the AI service. Please, check connection settings and API access token.", e); } catch (final JsonSyntaxException je) { throw new AIServiceException("Wrong service answer format. Please, connect to AI Service support", je); } finally { if (connection != null) { connection.disconnect(); } } } /** * Make requests to the ai service with voiceData. This method must not be called in the UI Thread. * @param voiceStream voice data stream for recognition * @return response object from service * @throws AIServiceException */ public AIResponse voiceRequest(final InputStream voiceStream, final List<AIContext> aiContexts) throws AIServiceException { final Gson gson = GsonFactory.getGson(); HttpURLConnection connection = null; HttpClient httpClient = null; Log.d(TAG, "Start voice request"); try { final AIRequest request = new AIRequest(); final URL url = new URL(config.getQuestionUrl()); request.setLanguage(config.getLanguage()); request.setSessionId(sessionId); request.setTimezone(Calendar.getInstance().getTimeZone().getID()); if (context != null) { request.setContexts(aiContexts); } final String queryData = gson.toJson(request); Log.d(TAG, "Request json: " + queryData); connection = (HttpURLConnection) url.openConnection(); connection.addRequestProperty("Authorization", "Bearer " + config.getApiKey()); connection.addRequestProperty("ocp-apim-subscription-key", config.getSubscriptionKey()); connection.addRequestProperty("Accept", "application/json"); connection.setRequestMethod("POST"); connection.setDoInput(true); connection.setDoOutput(true); httpClient = new HttpClient(connection); httpClient.setWriteSoundLog(config.isWriteSoundLog()); httpClient.connectForMultipart(); httpClient.addFormPart("request", queryData); httpClient.addFilePart("voiceData", "voice.wav", voiceStream); httpClient.finishMultipart(); final String response = httpClient.getResponse(); if (TextUtils.isEmpty(response)) { throw new AIServiceException("Empty response from ai service. Please check configuration."); } Log.d(TAG, "Response json: " + response); final AIResponse aiResponse = gson.fromJson(response, AIResponse.class); return aiResponse; } catch (final MalformedURLException e) { Log.e(TAG, "Malformed url should not be raised", e); throw new AIServiceException("Wrong configuration. Please, connect to AI Service support", e); } catch (final IOException e) { if (httpClient != null) { final String errorString = httpClient.getErrorString(); Log.d(TAG, "" + errorString); if (!TextUtils.isEmpty(errorString)) { final AIResponse errorResponse = gson.fromJson(errorString, AIResponse.class); return errorResponse; } } Log.e(TAG, "Can't make request to the Speaktoit AI service. Please, check connection settings and API access token.", e); throw new AIServiceException("Can't make request to the AI service. Please, check connection settings and API access token.", e); } catch (final JsonSyntaxException je) { throw new AIServiceException("Wrong service answer format. Please, connect to AI Service support", je); } finally { if (connection != null) { connection.disconnect(); } } } }
[ "danil.skachkov@speaktoit.com" ]
danil.skachkov@speaktoit.com
c2b99646b6e34030f780f998028e4dc43e0fe7e9
f26b833055dc6f9b1c78a7b78d5cb7121af2d59a
/src/by/it/_tasks_/lesson03/TaskA1.java
fe3bfd2b941f9118f0b55e86cd8bf30ff975d1ec
[]
no_license
Rq3d/cs2018-01-08
00b85c7c395f5552a4f9d4d0a91d5db2e8afa655
53d7cb71e2647a3120f1e9353623e9addaa1b537
refs/heads/master
2021-05-13T18:52:04.902260
2018-01-21T17:22:25
2018-01-21T17:22:25
116,879,534
1
0
null
2018-01-09T22:48:08
2018-01-09T22:48:08
null
UTF-8
Java
false
false
1,872
java
package by.it._tasks_.lesson03; /* Lesson 04. Task A1. Калькулятор. Напишите программу, которая считывает с клавиатуры два целых числа a и b после этого выводит через пробел: сумму, разность, произведение, частное и остаток от деления этих чисел двух чисел (результат выводится как тип int). после этого еще раз выводит через пробел сумму, разность, произведение, частное и остаток от деления этих чисел двух чисел (но результат выводится как тип double). Для считывания данных с клавиатуры используйте метод nextInt() объекта класса Scanner. Создать Scanner можно так: Scanner sc=new Scanner(System.in); Требования: 1. В программе необходимо создать объект типа Scanner. 2. Программа должна считывать два числа типа int с клавиатуры. 3. Программа должна дважды выводить в строку пять чисел через пробел. 4. Программа должна выводить int сумму, разность, произведение, частное и остаток от деления этих чисел двух чисел. 5. Программа должна выводить double сумму, разность, произведение, частное и остаток от деления этих чисел двух чисел. Пример: Ввод: 7 2 Вывод: 9 5 14 3 1 9.0 5.0 14.0 3.5 1.0 */ class TaskA1 { }
[ "375336849110@tut.by" ]
375336849110@tut.by
0da36e03850fd6f7063178de03ce16ae062a7b41
899c5d350b1adec7f5b380cc851ccc3a9c932999
/day23/src/com/bit/day23/Ex16.java
acd7e99bb4a45e879259709f2d72f87771404597
[]
no_license
ziwookim/javaworkspace
896dbfee29dcc4ca1ac7ddaf2ef3b71f8eebc4c6
001b6a3be31fe11d2fb657dea4ecb03d01943206
refs/heads/master
2023-01-01T18:41:29.375318
2020-10-21T08:51:20
2020-10-21T08:51:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
886
java
package com.bit.day23; import java.awt.Frame; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.awt.event.WindowListener; //class Lec16 implements WindowListener { // public void windowActivated(WindowEvent e) {} // public void windowClosed(WindowEvent e) {} // public void windowClosing(WindowEvent e) {} // public void windowDeactivated(WindowEvent e) {} // public void windowDeiconified(WindowEvent e) {} // public void windowIconified(WindowEvent e) {} // public void windowOpened(WindowEvent e) {} //} public class Ex16 extends Frame{ public Ex16() { // addWindowListener(new Lec16() { // 7~15 addWindowListener(new WindowAdapter(){ public void windowClosing(WindowEvent e) { dispose(); } }); setSize(500, 300); setLocation(300, 200); setVisible(true); } public static void main(String[] args) { new Ex16(); } }
[ "kamja227@nate.com" ]
kamja227@nate.com
17f32ba46782edcc839629ddd68dfbef322cca4b
9b04c5a90b31776a17c254d218abb63f59889f5d
/gsb/gsb-api/src/main/java/com/gongsibao/api/conroller/taurus/TrademarkController.java
3d55c5a9f8c88256579a2934757ff9207964cf09
[]
no_license
damogui/testtt
de80c460e878c22553dabe965a7dfe21181d83cf
ae486b93370db3b3153239a25aecd1caeea8d248
refs/heads/master
2021-09-14T19:46:43.345265
2018-05-18T08:29:08
2018-05-18T08:29:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
88
java
package com.gongsibao.api.conroller.taurus; public class TrademarkController { }
[ "hwhping@163.com" ]
hwhping@163.com
094ec47d406b37facd61cf2a89a1eeb3b8e69fb1
cf08ee1cc969dd4541af369bfddf1355c0e49927
/hanfu-product-center/src/main/java/com/hanfu/product/center/service/GroupOpenConnectService.java
46ed4c84e5b55849f3addde3dfc111802cb9cae5
[]
no_license
adminDavin/hanfu
bcbd118ddbe0189557b8c041d14200407dbfbdd5
3ea04703f9b3aebc132ae5ea9387fa0e0f54e08b
refs/heads/develop
2022-07-12T02:54:05.833434
2021-01-14T08:35:22
2021-01-14T08:35:22
210,497,289
1
2
null
2022-06-29T18:14:19
2019-09-24T02:47:45
Java
UTF-8
Java
false
false
715
java
package com.hanfu.product.center.service; import com.hanfu.product.center.model.GroupOpenConnect; public interface GroupOpenConnectService { int deleteByPrimaryKey(Integer id); void deleteByGroupOpenId(Integer id); void insert(Integer userId, Integer groupOpenId, Integer ordersId, String hfDesc, Integer addressId); int insertSelective(GroupOpenConnect groupOpenConnect); GroupOpenConnect selectByPrimaryKey(Integer id); int updateByPrimaryKeySelective(GroupOpenConnect groupOpenConnect); void updateIsDeleted(Integer userId, Integer groupOpenId); void updateState(Integer userId, Integer groupOpenId) ; GroupOpenConnect selectByGroup(Integer id, Integer groupOpenId); }
[ "2451203734@qq.com" ]
2451203734@qq.com
1829f274da35766b7fb708b5f6096ec4ad186275
d216f26ead7c8a0ee9785ec16104068bca1455ac
/src/main/java/sy/model/base/Activity.java
44c7e6e881a0065e92d1aafbbc255fbfb2a61ed8
[]
no_license
nickbobo/sshe
94f6f90f8a8be5f7135b4ee14c06b837a345ff20
aa3894b9fae36e6815b3539fc7fd0042aa63c6d9
refs/heads/master
2021-01-25T04:43:07.583880
2018-07-18T05:23:50
2018-07-18T05:23:50
93,474,031
0
0
null
null
null
null
UTF-8
Java
false
false
2,312
java
package sy.model.base; // Generated 2016-5-1 13:55:52 by Hibernate Tools 3.2.2.GA import java.util.Date; import java.util.HashSet; import java.util.Set; import java.util.UUID; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.Id; import javax.persistence.OneToMany; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; import org.apache.commons.lang3.StringUtils; /** * Activity generated by hbm2java */ @Entity @Table(name = "activity", catalog = "sshe") public class Activity implements java.io.Serializable { private String id; private String name; private String url; private Date createdatetime; private Set<Record> records = new HashSet<Record>(0); public Activity() { } public Activity(String id) { this.id = id; } public Activity(String id, String name, String url, Date createdatetime, Set<Record> records) { this.id = id; this.name = name; this.url = url; this.createdatetime = createdatetime; this.records = records; } @Id @Column(name = "id", unique = true, nullable = false,length = 36) public String getId() { if (!StringUtils.isBlank(this.id)) { return this.id; } return UUID.randomUUID().toString(); } public void setId(String id) { this.id = id; } @Column(name = "name", length = 50) public String getName() { return this.name; } public void setName(String name) { this.name = name; } @Column(name = "url", length = 100) public String getUrl() { return this.url; } public void setUrl(String url) { this.url = url; } @Temporal(TemporalType.TIMESTAMP) @Column(name = "createdatetime", length = 19) public Date getCreatedatetime() { if (this.createdatetime != null) return this.createdatetime; return new Date(); } public void setCreatedatetime(Date createdatetime) { this.createdatetime = createdatetime; } @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "activity") public Set<Record> getRecords() { return this.records; } public void setRecords(Set<Record> records) { this.records = records; } }
[ "934858124@qq.com" ]
934858124@qq.com
a6b6ede5151ae1051d83ea95ebbd0bdcad81d65e
2b6ed0b9c5f664b51ad919dda6190ab8f49938a5
/java/aulas/src/exercicioaulas/ParOuImparRaizQuadrada.java
5f950b7da0ef8fc13fa04215448c22217b913a42
[]
no_license
victoraraujo7/turma16java
343426c7b5aad680b3e680c2e0cb3ddb2337fb76
0c047a35291d85b4322b88bc961bc1a38976eef8
refs/heads/main
2023-03-26T04:04:18.926063
2021-03-23T20:44:11
2021-03-23T20:44:11
329,984,520
0
0
null
null
null
null
WINDOWS-1252
Java
false
false
569
java
package exercicioaulas; import java.util.Scanner; public class ParOuImparRaizQuadrada { public static void main(String[] args) { Scanner ler = new Scanner(System.in); int numero; System.out.print("Digite um numero: "); numero = ler.nextInt(); if(numero <=0 ) { System.out.print("Numero invalido, menor ou igual a 0"); } else if(numero % 2 == 1) { System.out.printf("O numero é impar é elevado ao quadrado é %.2f", Math.pow(numero, 2)); } else { System.out.printf("O numero é par e sua raiz quadrada é %.2f", Math.sqrt(numero)); } } }
[ "Victor" ]
Victor
5e229c93a9d30f0af7bc8ce76a274ed71a89e1d6
cbea23d5e087a862edcf2383678d5df7b0caab67
/aws-java-sdk-opensearch/src/main/java/com/amazonaws/services/opensearch/model/transform/InboundConnectionMarshaller.java
c89ad0e8c1ce7580c3f0f13560d2d38bc0fffa03
[ "Apache-2.0" ]
permissive
phambryan/aws-sdk-for-java
66a614a8bfe4176bf57e2bd69f898eee5222bb59
0f75a8096efdb4831da8c6793390759d97a25019
refs/heads/master
2021-12-14T21:26:52.580137
2021-12-03T22:50:27
2021-12-03T22:50:27
4,263,342
0
0
null
null
null
null
UTF-8
Java
false
false
3,038
java
/* * Copyright 2016-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.opensearch.model.transform; import javax.annotation.Generated; import com.amazonaws.SdkClientException; import com.amazonaws.services.opensearch.model.*; import com.amazonaws.protocol.*; import com.amazonaws.annotation.SdkInternalApi; /** * InboundConnectionMarshaller */ @Generated("com.amazonaws:aws-java-sdk-code-generator") @SdkInternalApi public class InboundConnectionMarshaller { private static final MarshallingInfo<StructuredPojo> LOCALDOMAININFO_BINDING = MarshallingInfo.builder(MarshallingType.STRUCTURED) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("LocalDomainInfo").build(); private static final MarshallingInfo<StructuredPojo> REMOTEDOMAININFO_BINDING = MarshallingInfo.builder(MarshallingType.STRUCTURED) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("RemoteDomainInfo").build(); private static final MarshallingInfo<String> CONNECTIONID_BINDING = MarshallingInfo.builder(MarshallingType.STRING) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("ConnectionId").build(); private static final MarshallingInfo<StructuredPojo> CONNECTIONSTATUS_BINDING = MarshallingInfo.builder(MarshallingType.STRUCTURED) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("ConnectionStatus").build(); private static final InboundConnectionMarshaller instance = new InboundConnectionMarshaller(); public static InboundConnectionMarshaller getInstance() { return instance; } /** * Marshall the given parameter object. */ public void marshall(InboundConnection inboundConnection, ProtocolMarshaller protocolMarshaller) { if (inboundConnection == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(inboundConnection.getLocalDomainInfo(), LOCALDOMAININFO_BINDING); protocolMarshaller.marshall(inboundConnection.getRemoteDomainInfo(), REMOTEDOMAININFO_BINDING); protocolMarshaller.marshall(inboundConnection.getConnectionId(), CONNECTIONID_BINDING); protocolMarshaller.marshall(inboundConnection.getConnectionStatus(), CONNECTIONSTATUS_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
[ "" ]