blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
132 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
28 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
352
029c9010eaa41d3000a251512ba39b571545a295
7f287b27f6f0a4accb3ab01da7452f23565396ae
/datamasking/progetto/src/it/unibas/datamasking/Costanti.java
c4798be5e692744be20e5c197006e78b75d72350
[]
no_license
MihaiSoanea/Java-Projects
d941776f7a0bd79527dde805e1a549f609484dd6
56c0d5d2792160c8fa4e4f5c43938fefd48ddd4f
refs/heads/master
2020-09-01T15:06:47.126318
2019-11-01T13:47:48
2019-11-01T13:47:48
218,987,814
0
0
null
null
null
null
UTF-8
Java
false
false
153
java
package it.unibas.datamasking; public class Costanti { public static final String REDIRECT = "?faces-redirect=true&includeViewParams=true"; }
[ "mihaisoanea@yahoo.it" ]
mihaisoanea@yahoo.it
ebb3dfb4749726255571fead5973460babe73ff4
d81629c014839da528e664a60fd6f15956e1b53b
/projects/log4j-core-extended/src/main/java/org/apache/logging/log4j/core/util/ObjectArrayIterator.java
a4b7eb45ca8b982dc20ee740a36dfba3c5a0d238
[ "Apache-2.0" ]
permissive
inoueke-n/PADLA
4942b370a4050a72b39c718afcd42a6ff3729b16
1f78d171448656810bee7dcba3a858f168771b53
refs/heads/master
2022-10-29T09:21:57.034996
2020-03-13T11:35:29
2020-03-13T11:35:29
174,953,933
2
0
Apache-2.0
2022-10-25T21:12:49
2019-03-11T08:10:50
Java
UTF-8
Java
false
false
5,984
java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.logging.log4j.core.util; import java.util.Iterator; import java.util.NoSuchElementException; /** * An {@link java.util.Iterator Iterator} over an array of objects. * <p> * This iterator does not support {@link #remove}, as the object array cannot be * structurally modified. * <p> * The iterator implements a {@link #reset} method, allowing the reset of the iterator * back to the start if required. * * @param <E> the type to iterate over * @since 3.0 * @version $Id: ObjectArrayIterator.java 1734648 2016-03-11 23:51:22Z ggregory $ */ public class ObjectArrayIterator<E> implements /*Resettable*/ Iterator<E> { /** The array */ final E[] array; /** The start index to loop from */ final int startIndex; /** The end index to loop to */ final int endIndex; /** The current iterator index */ int index = 0; //------------------------------------------------------------------------- /** * Constructs an ObjectArrayIterator that will iterate over the values in the * specified array. * * @param array the array to iterate over * @throws NullPointerException if <code>array</code> is <code>null</code> */ @SafeVarargs public ObjectArrayIterator(final E... array) { this(array, 0, array.length); } /** * Constructs an ObjectArrayIterator that will iterate over the values in the * specified array from a specific start index. * * @param array the array to iterate over * @param start the index to start iterating at * @throws NullPointerException if <code>array</code> is <code>null</code> * @throws IndexOutOfBoundsException if the start index is out of bounds */ public ObjectArrayIterator(final E array[], final int start) { this(array, start, array.length); } /** * Construct an ObjectArrayIterator that will iterate over a range of values * in the specified array. * * @param array the array to iterate over * @param start the index to start iterating at * @param end the index (exclusive) to finish iterating at * @throws IndexOutOfBoundsException if the start or end index is out of bounds * @throws IllegalArgumentException if end index is before the start * @throws NullPointerException if <code>array</code> is <code>null</code> */ public ObjectArrayIterator(final E array[], final int start, final int end) { super(); if (start < 0) { throw new ArrayIndexOutOfBoundsException("Start index must not be less than zero"); } if (end > array.length) { throw new ArrayIndexOutOfBoundsException("End index must not be greater than the array length"); } if (start > array.length) { throw new ArrayIndexOutOfBoundsException("Start index must not be greater than the array length"); } if (end < start) { throw new IllegalArgumentException("End index must not be less than start index"); } this.array = array; this.startIndex = start; this.endIndex = end; this.index = start; } // Iterator interface //------------------------------------------------------------------------- /** * Returns true if there are more elements to return from the array. * * @return true if there is a next element to return */ @Override public boolean hasNext() { return this.index < this.endIndex; } /** * Returns the next element in the array. * * @return the next element in the array * @throws NoSuchElementException if all the elements in the array * have already been returned */ @Override public E next() { if (hasNext() == false) { throw new NoSuchElementException(); } return this.array[this.index++]; } /** * Throws {@link UnsupportedOperationException}. * * @throws UnsupportedOperationException always */ @Override public void remove() { throw new UnsupportedOperationException("remove() method is not supported for an ObjectArrayIterator"); } // Properties //------------------------------------------------------------------------- /** * Gets the array that this iterator is iterating over. * * @return the array this iterator iterates over */ public E[] getArray() { return this.array; } /** * Gets the start index to loop from. * * @return the start index */ public int getStartIndex() { return this.startIndex; } /** * Gets the end index to loop to. * * @return the end index */ public int getEndIndex() { return this.endIndex; } /** * Resets the iterator back to the start index. */ //@Override public void reset() { this.index = this.startIndex; } }
[ "m-tys@sel-samba.ics.es.osaka-u.ac.jp" ]
m-tys@sel-samba.ics.es.osaka-u.ac.jp
9954deb936db6f145d63f3993b42847fcdb49ea7
5bc0fe44ae132c5ab7595262759a2f2dc3278077
/src/com/pe/admin/action/FaqUpdate.java
a9d3b4ad78e645614216bb9372ee93fa05dbdfa0
[]
no_license
achivestar/BookStore-MVC
9cb9f7507c7f7490a166ebc725fc70e7213ee717
780430ec78b0c6bbfad490cc125e427d3e0a5144
refs/heads/master
2022-12-27T23:52:15.962461
2020-10-09T07:23:10
2020-10-09T07:23:10
277,835,996
0
0
null
null
null
null
UTF-8
Java
false
false
1,184
java
package com.pe.admin.action; import java.io.IOException; import java.io.PrintWriter; import java.sql.SQLException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.pe.admin.service.ServiceFaqUpdate; import com.pe.admin.vo.FaqVo; public class FaqUpdate implements AdminAction { @Override public void execute(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, SQLException { int num = Integer.parseInt(request.getParameter("num")); int faqCategory = Integer.parseInt(request.getParameter("faqCategory")); String question = request.getParameter("question"); String answer = request.getParameter("answer"); System.out.println(num+","+faqCategory+","+question+","+answer); FaqVo faqvo = new FaqVo(); faqvo.setNum(num); faqvo.setCategory(faqCategory); faqvo.setQuestion(question); faqvo.setAnswer(answer); ServiceFaqUpdate servicefaqupdate = new ServiceFaqUpdate(); int modifySuccess = servicefaqupdate.updateFaq(faqvo); PrintWriter out = response.getWriter(); out.println(modifySuccess); } }
[ "achive@gmail.com" ]
achive@gmail.com
f065d99779465e5b8e812c5202459acb35599258
e047870136e1958ce80dad88fa931304ada49a1b
/eu.cessar.ct.cid.model/src_model/eu/cessar/ct/cid/model/elements/impl/NamedElementImpl.java
86357de0423a61754bb49d1c513164ae4dd0f74e
[]
no_license
ONagaty/SEA-ModellAR
f4994a628459a20b9be7af95d41d5e0ff8a21f77
a0f6bdbb072503ea584d72f872f29a20ea98ade5
refs/heads/main
2023-06-04T07:07:02.900503
2021-06-19T20:54:47
2021-06-19T20:54:47
376,735,297
0
0
null
null
null
null
UTF-8
Java
false
false
3,526
java
/** */ package eu.cessar.ct.cid.model.elements.impl; import eu.cessar.ct.cid.model.CIDEObject; import eu.cessar.ct.cid.model.elements.ElementsPackage; import eu.cessar.ct.cid.model.elements.NamedElement; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.impl.ENotificationImpl; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Named Element</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link eu.cessar.ct.cid.model.elements.impl.NamedElementImpl#getName <em>Name</em>}</li> * </ul> * </p> * * @generated */ public abstract class NamedElementImpl extends CIDEObject implements NamedElement { /** * The default value of the '{@link #getName() <em>Name</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getName() * @generated * @ordered */ protected static final String NAME_EDEFAULT = null; /** * The cached value of the '{@link #getName() <em>Name</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getName() * @generated * @ordered */ protected String name = NAME_EDEFAULT; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected NamedElementImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return ElementsPackage.Literals.NAMED_ELEMENT; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getName() { return name; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setName(String newName) { String oldName = name; name = newName; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, ElementsPackage.NAMED_ELEMENT__NAME, oldName, name)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case ElementsPackage.NAMED_ELEMENT__NAME: return getName(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case ElementsPackage.NAMED_ELEMENT__NAME: setName((String) newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case ElementsPackage.NAMED_ELEMENT__NAME: setName(NAME_EDEFAULT); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case ElementsPackage.NAMED_ELEMENT__NAME: return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); } return super.eIsSet(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuffer result = new StringBuffer(super.toString()); result.append(" (name: "); result.append(name); result.append(')'); return result.toString(); } } //NamedElementImpl
[ "onagaty@a5sol.com" ]
onagaty@a5sol.com
6beea0c8643b05e181de301e383b3ec30bc88e8d
efed378d3286890399b8d8c9f68285c9c34fd7c1
/app/src/main/java/com/android/ide/common/resources/configuration/DensityQualifier.java
de23a4f46e1812368ce891665b6e43111d0880c4
[]
no_license
towith/SdkBuilder-Android
fb3d3bf5585cb6343352eafb4776f04054a086e1
05db55e0b39682b9efdff5289ee3ca0061781a1d
refs/heads/master
2021-04-09T15:38:45.031314
2018-03-28T10:34:39
2018-03-28T10:34:39
125,792,715
1
0
null
null
null
null
UTF-8
Java
false
false
3,935
java
/* * Copyright (C) 2007 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.ide.common.resources.configuration; import com.android.resources.Density; import com.android.resources.ResourceEnum; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * Resource Qualifier for Screen Pixel Density. */ public final class DensityQualifier extends EnumBasedResourceQualifier { private static final Pattern sDensityLegacyPattern = Pattern.compile("^(\\d+)dpi$");//$NON-NLS-1$ public static final String NAME = "Density"; private Density mValue = Density.MEDIUM; public DensityQualifier() { // pass } public DensityQualifier(Density value) { mValue = value; } public Density getValue() { return mValue; } @Override ResourceEnum getEnumValue() { return mValue; } @Override public String getName() { return NAME; } @Override public String getShortName() { return NAME; } @Override public int since() { return 4; } @Override public boolean checkAndSet(String value, FolderConfiguration config) { Density density = Density.getEnum(value); if (density == null) { // attempt to read a legacy value. Matcher m = sDensityLegacyPattern.matcher(value); if (m.matches()) { String v = m.group(1); try { density = Density.getEnum(Integer.parseInt(v)); } catch (NumberFormatException e) { // looks like the string we extracted wasn't a valid number // which really shouldn't happen since the regexp would have failed. } } } if (density != null) { DensityQualifier qualifier = new DensityQualifier(); qualifier.mValue = density; config.setDensityQualifier(qualifier); return true; } return false; } @Override public boolean isMatchFor(ResourceQualifier qualifier) { if (qualifier instanceof DensityQualifier) { // as long as there's a density qualifier, it's always a match. // The best match will be found later. return true; } return false; } @Override public boolean isBetterMatchThan(ResourceQualifier compareTo, ResourceQualifier reference) { if (compareTo == null) { return true; } DensityQualifier compareQ = (DensityQualifier)compareTo; DensityQualifier referenceQ = (DensityQualifier)reference; if (compareQ.mValue == referenceQ.mValue) { // what we have is already the best possible match (exact match) return false; } else if (mValue == referenceQ.mValue) { // got new exact value, this is the best! return true; } else { // in all case we're going to prefer the higher dpi. // if reference is high, we want highest dpi. // if reference is medium, we'll prefer to scale down high dpi, than scale up low dpi // if reference if low, we'll prefer to scale down high than medium (2:1 over 4:3) return mValue.getDpiValue() > compareQ.mValue.getDpiValue(); } } }
[ "root@LAPTOP-V3EVQ2DD.localdomain" ]
root@LAPTOP-V3EVQ2DD.localdomain
f07b000c3d597d504f17f4e56624ce6de8946a15
285fc1dd4064a2f84f5e26f43601edba20f2d728
/src/va/CC/Company.java
06218d670ead27d7dba053a699e990a76d7217cf
[]
no_license
vaurer/Football
b6e14bd7aff5726cb671bf0ef75a54236fd0a79d
14698045642843fbfd00cb19e93ee4df63f5ec43
refs/heads/master
2021-05-21T22:05:50.241346
2020-04-18T07:23:30
2020-04-18T07:23:30
252,821,587
0
0
null
null
null
null
UTF-8
Java
false
false
885
java
package va.CC; import java.util.ArrayList; public class Company { private String name; private String address; private ArrayList<Clerk> employees; public Company(String name, String address, ArrayList<Clerk> employees) { this.name = name; this.address = address; this.employees = employees; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } public ArrayList<Clerk> getEmployees() { return employees; } public void setEmployees(ArrayList<Clerk> employees) { this.employees = employees; } public void doBusiness() { System.out.println("earning money"); } }
[ "vaurer@gmail.com" ]
vaurer@gmail.com
9f882c21f95b95afb077aa82cebc59617c7a3161
823ed00326874e1ddcf3b70506f1a10a95fc7b27
/app/src/main/java/by/pazukdev/sovietboxersbearings/Bearing874901.java
2251ef5228b06889fcf6c273c72a4c14a16f98bf
[]
no_license
pazukdev/Soviet-Boxers-Seals-and-Bearings
2b6ecf04fca626ac30e18a69412b5c41067d74b8
bd36e09190a2e6005067bdcfd53537df04cc06ad
refs/heads/master
2020-03-20T00:16:16.525232
2018-06-12T08:28:09
2018-06-12T08:28:09
117,825,744
0
0
null
null
null
null
UTF-8
Java
false
false
445
java
package by.pazukdev.sovietboxersbearings; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v7.app.AppCompatActivity; /** * Created by Pazuk on 05.07.2017. */ public class Bearing874901 extends AppCompatActivity { @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.bearing_874901); } }
[ "pazukdev@gmail.com" ]
pazukdev@gmail.com
ed9f0a38013bbd0790e5a23eb47dba0bc8acc3df
5224bfe62827a9979a8dfbfcf2bfd2af23c621a1
/app/src/main/java/space/karaskiv/prep1/APIClient.java
cd734577915c8ad5cc168f3009edb4dea17df761
[]
no_license
karaskiv/Android-RetrofitPrep
fe74c004d8bba629796c04cece5396f0f153965b
c3b21cc0e40a5e9a6701e56f1cc09260fa20d426
refs/heads/master
2023-05-27T07:24:07.557765
2021-06-13T17:33:12
2021-06-13T17:33:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
705
java
package space.karaskiv.prep1; import okhttp3.OkHttpClient; import okhttp3.logging.HttpLoggingInterceptor; import retrofit2.Retrofit; import retrofit2.converter.gson.GsonConverterFactory; class APIClient { private static Retrofit retrofit = null; static Retrofit getClient() { HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor(); interceptor.setLevel(HttpLoggingInterceptor.Level.BODY); OkHttpClient client = new OkHttpClient.Builder().addInterceptor(interceptor).build(); retrofit = new Retrofit.Builder().baseUrl("https://reqres.in").addConverterFactory(GsonConverterFactory.create()).client(client).build(); return retrofit; } }
[ "82354360+Karaskiv@users.noreply.github.com" ]
82354360+Karaskiv@users.noreply.github.com
24ef0609b598694bcd3a6fa144152400f0ff8335
4490e10c8f7d5d18d5b443451f0470400d09dfdd
/rabbitmq/src/main/java/com/example/rabbitmq/seven/ReceiveLogsTopic02.java
94cd1d2405aefb937f9edf065b7a332291486606
[]
no_license
JustHard/com.example.rabbitmq
36835928c1f0853f7612fca2d630718b5159f973
85a9f6351c81b7574bb9e64eae61ea7c2cb266ba
refs/heads/master
2023-07-16T13:39:54.326955
2021-08-13T07:17:15
2021-08-13T07:17:15
395,547,841
0
0
null
null
null
null
UTF-8
Java
false
false
1,433
java
package com.example.rabbitmq.seven; /** * Created with IntelliJ IDEA. * * @Author: caolingyun * @Date: 2021/07/30 15:05 */ import com.example.rabbitmq.utils.RabbitMqUtils; import com.rabbitmq.client.BuiltinExchangeType; import com.rabbitmq.client.Channel; import com.rabbitmq.client.DeliverCallback; /** * topic交换机方式 */ public class ReceiveLogsTopic02 { //交换机名称 public static final String EXCHANGE_NAME = "topic_logs"; //接收消息 public static void main(String[] args) throws Exception { Channel channel = RabbitMqUtils.getChannel(); //声明交换机 channel.exchangeDeclare(EXCHANGE_NAME, BuiltinExchangeType.TOPIC); //声明队列 String queueName = "Q2"; channel.queueDeclare(queueName, false, false, false, null); channel.queueBind(queueName, EXCHANGE_NAME, "*.*.rabbit"); channel.queueBind(queueName, EXCHANGE_NAME, "lazy.#"); System.out.println("等待接收消息。。。。"); //接收消息 DeliverCallback deliverCallback = (consumerTag, message) -> { System.out.println(new String(message.getBody(), "utf-8")); System.out.println("接收队列:" + queueName + " 绑定键:" + message.getEnvelope().getRoutingKey()); }; //接收消息 channel.basicConsume(queueName, true, deliverCallback, consumerTag -> { }); } }
[ "caolingyun@163.com" ]
caolingyun@163.com
eaa9efaae889c62c90a767f3ac5c40013fde38f4
da91506e6103d6e12933125f851df136064cfc30
/src/main/java/org/phw/hbaser/util/HTableBatchDeletes.java
f9a0eb28b6aacbb0a67e3ea805042a3b131751f9
[]
no_license
wuce7758/Mr.Hbaser
41709cb28568092699cb2803a06e232c28654110
af5afb7e4b4b2e51d15ff266e08204b9caf1657e
refs/heads/master
2020-06-29T13:29:49.751123
2012-07-11T00:18:57
2012-07-11T00:18:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
977
java
package org.phw.hbaser.util; import java.io.IOException; import java.util.ArrayList; import org.apache.hadoop.hbase.client.Delete; import org.apache.hadoop.hbase.client.HTable; public class HTableBatchDeletes { private ArrayList<Delete> putArr = new ArrayList<Delete>(1000); private HTable hTable; private int rownum = 0; public HTableBatchDeletes(HTable hTable) { this.hTable = hTable; } public void deleteRow(Delete delete) throws IOException { ++rownum; putArr.add(delete); if (putArr.size() == 1000 && hTable != null) { commitPuts(); } } public void deleteEnd() throws IOException { if (putArr.size() > 0 && hTable != null) { commitPuts(); } } private void commitPuts() throws IOException { hTable.delete(putArr); hTable.flushCommits(); putArr.clear(); } public int getRownum() { return rownum; } }
[ "bingoo.huang@gmail.com" ]
bingoo.huang@gmail.com
649a74f7e2d04261dabb0ded4bfa3f195f381c3d
9aa93479892440c7d75733dd8bbf6d2405eb6644
/p0171dynamic_layout2/src/androidTest/java/ru/startandroid/p0171dynamic_layout2/ExampleInstrumentedTest.java
c4c7234e2a8760f770323b0051b3e74421c0effe
[]
no_license
dan9112/Android_Lessons_Java
ee6078b980478d58d5f488a49d7665875a1abd2e
39557340c8451ba8d2455d3a3b2351e2b732eaf5
refs/heads/master
2023-06-13T22:47:54.220585
2021-07-12T05:41:41
2021-07-12T05:41:41
315,320,816
0
0
null
null
null
null
UTF-8
Java
false
false
786
java
package ru.startandroid.p0171dynamic_layout2; import android.content.Context; import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); assertEquals("ru.startandroid.p0171dynamic_layout2", appContext.getPackageName()); } }
[ "58068292+dan9112@users.noreply.github.com" ]
58068292+dan9112@users.noreply.github.com
f9512c4fac5f32baf680ed5ee94bf8f8f45e0e3f
12f3ac730c53727f2841fb4a687aae6e4121781d
/skinnyrest/src/test/java/org/zygno/web/rest/LogsResourceIntTest.java
22d299e22245d00eff8482c1c24c8b79aec8499f
[]
no_license
wdmulert/doclib
b642c0412dc38447bec0cec1c461c1e5c2843dac
03a8f83f3148f7028188c17f3866530afc7c4d0a
refs/heads/master
2021-09-10T17:54:42.139196
2018-01-11T02:16:12
2018-01-11T02:16:12
107,179,378
0
0
null
null
null
null
UTF-8
Java
false
false
2,428
java
package org.zygno.web.rest; import org.zygno.SkinnyrestApp; import org.zygno.web.rest.vm.LoggerVM; import ch.qos.logback.classic.AsyncAppender; import ch.qos.logback.classic.LoggerContext; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.MockitoAnnotations; import org.slf4j.LoggerFactory; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.http.MediaType; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.setup.MockMvcBuilders; import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; /** * Test class for the LogsResource REST controller. * * @see LogsResource */ @RunWith(SpringRunner.class) @SpringBootTest(classes = SkinnyrestApp.class) public class LogsResourceIntTest { private MockMvc restLogsMockMvc; @Before public void setup() { MockitoAnnotations.initMocks(this); LogsResource logsResource = new LogsResource(); this.restLogsMockMvc = MockMvcBuilders .standaloneSetup(logsResource) .build(); } @Test public void getAllLogs()throws Exception { restLogsMockMvc.perform(get("/management/logs")) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)); } @Test public void changeLogs()throws Exception { LoggerVM logger = new LoggerVM(); logger.setLevel("INFO"); logger.setName("ROOT"); restLogsMockMvc.perform(put("/management/logs") .contentType(TestUtil.APPLICATION_JSON_UTF8) .content(TestUtil.convertObjectToJsonBytes(logger))) .andExpect(status().isNoContent()); } @Test public void testLogstashAppender() { LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory(); assertThat(context.getLogger("ROOT").getAppender("ASYNC_LOGSTASH")).isInstanceOf(AsyncAppender.class); } }
[ "wmulert@gmail.com" ]
wmulert@gmail.com
0ddecf392a2a7262aa9a89a32b8431dcaf04074a
8b2c78f8bfe64d5a015ac19ef5b6cad2a5648967
/src/main/java/nasirov/yv/data/mal/MALSearchTitleInfo.java
c98af92f70f9b2405ba0257f5a78bbe1a19eb1b5
[ "Apache-2.0" ]
permissive
JavDriver/anime-checker
16f66f428ef696da496ee9ebc65e17fb5531dd3e
dfcb8bb4698303b91008a2079f5af60dd6c0821a
refs/heads/master
2020-06-03T06:30:50.792573
2019-06-10T17:51:19
2019-06-10T17:51:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
381
java
package nasirov.yv.data.mal; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import org.codehaus.jackson.annotate.JsonIgnoreProperties; /** * Created by nasirov.yv */ @JsonIgnoreProperties(ignoreUnknown = true) @Data @NoArgsConstructor @AllArgsConstructor public class MALSearchTitleInfo { private String type; private String name; }
[ "yurqaa@mail.ru" ]
yurqaa@mail.ru
db17c31e968de7a8a1a0b24d795fa196eb906cbb
ca6d0ebe216095be2910642cd795d8e2ae802fd2
/DentiCheck_test03/src/server/Server.java
a70a1f94b16eb55dc119ab584320e98e52c5dde1
[]
no_license
hanwix2/Denti_Check
4cf5b99b631bffe415a11d40b2d73ab15df2a62e
bd903912bbd1b06543f08ad5aedc46e55e28d529
refs/heads/master
2023-04-21T20:29:41.092248
2021-05-05T14:58:20
2021-05-05T14:58:20
293,401,477
0
0
null
null
null
null
UHC
Java
false
false
14,306
java
package server; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.ServerSocket; import java.net.Socket; import java.util.StringTokenizer; import java.util.Vector; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTextArea; import javax.swing.JTextField; import javax.swing.border.EmptyBorder; public class Server extends JFrame implements ActionListener { private JPanel contentPane; private JScrollPane scrollPane; private JTextArea textArea; private JLabel port_label; private JTextField port_tf; private JButton start_btn; private JButton stop_btn; private ServerSocket server_socket; private Socket socket; private int port; private Vector user_vc = new Vector(); private Vector room_vc = new Vector(); private StringTokenizer st; Server() { init(); start(); // 리스너 설정 메소드 } private void start() { start_btn.addActionListener(this); stop_btn.addActionListener(this); } private void init() { setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(100, 100, 700, 700); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); contentPane.setLayout(null); scrollPane = new JScrollPane(); scrollPane.setBounds(14, 12, 655, 520); contentPane.add(scrollPane); textArea = new JTextArea(); scrollPane.setViewportView(textArea); textArea.setEditable(false); port_label = new JLabel("포트 번호 : "); port_label.setBounds(195, 562, 95, 18); contentPane.add(port_label); port_tf = new JTextField(); port_tf.setBounds(275, 560, 236, 24); contentPane.add(port_tf); port_tf.setColumns(10); port_tf.setText("7777"); start_btn = new JButton("서버 실행"); start_btn.setBounds(210, 600, 147, 27); contentPane.add(start_btn); stop_btn = new JButton("서버 중단"); stop_btn.setBounds(350, 600, 147, 27); contentPane.add(stop_btn); stop_btn.setEnabled(false); setVisible(true); } private void Server_start() { try { server_socket = new ServerSocket(port); } catch (IOException e) { JOptionPane.showMessageDialog(null, "이미 사용중인 포트", "알림", JOptionPane.ERROR_MESSAGE); } if (server_socket != null) { Connection(); } } private void Connection() { // 1가지의 스레드에서는 1가지의 일만 처리할 수 있다. Thread th = new Thread(new Runnable() { @Override public void run() { // 스레드에서 처리할 일을 기재한다. while (true) { try { textArea.append("사용자 접속 대기중\n"); scrollPane.getVerticalScrollBar().setValue(scrollPane.getVerticalScrollBar().getMaximum()); // 자동 // 스크롤 socket = server_socket.accept(); // 사용자 접속 무한 대기 UserInfo user = new UserInfo(socket); user.start(); // 개별적으로 객체의 스레드를 실행(각각의 user의 송수신 담당) } catch (IOException e) { break; } } } }); th.start(); } public static void main(String[] args) { new Server(); } @Override public void actionPerformed(ActionEvent e) { if (e.getSource() == start_btn) { textArea.append("--- 서버 실행 ---\n"); port = Integer.parseInt(port_tf.getText().trim()); Server_start(); start_btn.setEnabled(false); stop_btn.setEnabled(true); port_tf.setEditable(false); } else if (e.getSource() == stop_btn) { textArea.append("--- 서버 종료 ---\n"); start_btn.setEnabled(true); stop_btn.setEnabled(false); port_tf.setEditable(true); try { server_socket.close(); socket.close(); user_vc.removeAllElements(); room_vc.removeAllElements(); } catch (IOException e1) { e1.printStackTrace(); } } scrollPane.getVerticalScrollBar().setValue(scrollPane.getVerticalScrollBar().getMaximum()); // 자동 스크롤 } class UserInfo extends Thread { private InputStream is; private OutputStream os; private DataInputStream dis; private DataOutputStream dos; private Socket user_socket; private String id = ""; private String fileServerIP = ""; private String filePath = ""; private String fileName = ""; private boolean RoomCh = true; public UserInfo(Socket soc) { this.user_socket = soc; UserNetwork(); } private void UserNetwork() { // 네트워크 자원 설정 try { is = user_socket.getInputStream(); dis = new DataInputStream(is); os = user_socket.getOutputStream(); dos = new DataOutputStream(os); id = dis.readUTF(); // 사용자의 닉네임을 받는다. textArea.append("** " + id + " : 사용자 접속 **\n"); Broadcast("NewUser|" + id);// 기존 사용자들에게 새로운 사용자 알림 // 자신에게 기존 사용자를 받아 옴 for (int i = 0; i < user_vc.size(); i++) { UserInfo u = (UserInfo) user_vc.elementAt(i); send_Message("OldUser|" + u.id); } // 자신에게 기존 방 목록을 받아 옴 for (int i = 0; i < room_vc.size(); i++) { RoomInfo r = (RoomInfo) room_vc.elementAt(i); send_Message("OldRoom|" + r.Room_name); } send_Message("room_list_update| "); user_vc.add(this); // 사용자에게 알린 후 vector에 자신을 추가 Broadcast("user_list_update| "); // 사용자 리스트 갱신 protocol 전송 scrollPane.getVerticalScrollBar().setValue(scrollPane.getVerticalScrollBar().getMaximum()); // 자동 스크롤 } catch (IOException e) { JOptionPane.showMessageDialog(null, "Stream 설정 에러", "알림", JOptionPane.ERROR_MESSAGE); } } public void run() { // thread에서 처리할 내용 while (true) { try { String msg = dis.readUTF(); textArea.append(id + " 로부터 들어온 메세지 : " + msg + "\n"); inMessage(msg); } catch (IOException e) { textArea.append("** " + id + " 접속 종료 **\n"); // 원래 속해있던 방을 찾는다 for (int i = 0; i < room_vc.size(); i++) { RoomInfo r = (RoomInfo) room_vc.elementAt(i); for (int j = 0; j < r.Room_user_vc.size(); j++) { // 해당 방을 찾았을 때 if (r.Room_user_vc.elementAt(j).equals(this)) { // 사용자 삭제 r.remove_User(this); // 사용자가 나갔음을 알린다 r.Broadcast_Room("Notifying|" + id + "님이 퇴장하였습니다"); checkRoomRemove(r); // 방에 아무도 없는 경우 방 삭제 } } } try { dos.close(); dis.close(); user_socket.close(); } catch (IOException e1) { } user_vc.remove(this); Broadcast("User_out|" + id); Broadcast("user_list_update| "); break; } scrollPane.getVerticalScrollBar().setValue(scrollPane.getVerticalScrollBar().getMaximum()); // 자동 스크롤 } } private void inMessage(String str) { // 클라이언트로부터 들어오늘 메세지 처리 (프로토콜) st = new StringTokenizer(str, "|"); String protocol = st.nextToken(); String message = st.nextToken(); // System.out.println("프로토콜 : " + protocol); // System.out.println("내용 : " + message); if (protocol.equals("Note")) { // 새로운 접속자 String note = st.nextToken(); // System.out.println("받는 사람: " + message); // receiver는 message // System.out.println("보낼 내용: " + note); // 벡터에서 해당 사용자룰 찾아서 메세지 전송 for (int i = 0; i < user_vc.size(); i++) { UserInfo u = (UserInfo) user_vc.elementAt(i); if (u.id.equals(message)) { u.send_Message("Note|" + id + "|" + note); } } } else if (protocol.equals("CreateRoom")) { // 방 만들기 프로토콜 // 현재 같은 방이 존재하는지 확인 for (int i = 0; i < room_vc.size(); i++) { RoomInfo r = (RoomInfo) room_vc.elementAt(i); if (r.Room_name.equals(message)) { // 만들고자하는 방이 이미 존재 할 때 send_Message("CreateRoomFail|ok"); // 방 만들기 실패 프로토콜 전송 RoomCh = false; break; } } if (RoomCh) { // 방을 만들 수 있을 때 RoomInfo new_room = new RoomInfo(message, this); room_vc.add(new_room); // 전체 방 벡터에 방을 추가 send_Message("CreateRoom|" + message); Broadcast("New_Room|" + message); } RoomCh = true; // 다시 원래 방을 만들 수 있는 상태로 set } else if (protocol.equals("Chatting")) { // 방에서 채팅하기 프로토콜 (입력 문자를 받음) String msg = st.nextToken(); // 방을 찾는다 for (int i = 0; i < room_vc.size(); i++) { RoomInfo r = (RoomInfo) room_vc.elementAt(i); if (r.Room_name.equals(message)) { // 해당 방을 찾았을 때 // 방에 있는 사용자들에게 메세지를 보냄 r.Broadcast_Room("Chatting|" + id + "|" + msg); } } } else if (protocol.equals("JoinRoom")) { // 방에 참가하기 for (int i = 0; i < room_vc.size(); i++) { RoomInfo r = (RoomInfo) room_vc.elementAt(i); if (r.Room_name.equals(message)) { // 새로운 사용자를 알린다 r.Broadcast_Room("Notifying|" + id + " 님이 입장하였습니다"); // 사용자 추가 r.Add_User(this); send_Message("JoinRoom|" + r.Room_name); } } } else if (protocol.equals("Room_out")) { // 방 나가기 // 방을 찾는다 for (int i = 0; i < room_vc.size(); i++) { RoomInfo r = (RoomInfo) room_vc.elementAt(i); if (r.Room_name.equals(message)) { // 해당 방을 찾았을 때 // 사용자가 나갔음을 알린다 r.Broadcast_Room("Notifying|" + id + " 님이 퇴장하였습니다"); // 사용자 삭제 send_Message("Room_out| "); r.remove_User(this); checkRoomRemove(r); // 방에 아무도 없는 경우 방 삭제 } } } else if (protocol.equals("FileSendTry")) { // 파일 전송 시도 for (int i = 0; i < room_vc.size(); i++) { RoomInfo r = (RoomInfo) room_vc.elementAt(i); if (r.Room_name.equals(message)) { filePath = st.nextToken(); File sendFile = new File(filePath); fileName = sendFile.getName(); String availExtList = "jpeg,jpg,png,gif,bmp"; // if (sendFile.isFile()) { String fileExt = filePath.substring(filePath.lastIndexOf(".") + 1); if (availExtList.contains(fileExt)) { // Socket s = this.user_socket; // fileServerIP = s.getInetAddress().getHostAddress(); fileServerIP = this.user_socket.getInetAddress().getHostAddress(); r.BroadcastOthers_Room("RequestSendFile|" + id + "|님께서 파일 전송을 시도합니다.", this); } else { send_Message("Notifying|전송 가능한 파일형식이 아닙니다. [" + availExtList + "] 파일만 가능. "); } // } else { // send_Message("Notifying|존재하지 않는 파일입니다."); // } } } } else if (protocol.equals("FileAccept")) { // 파일 전송 수락 for (int i = 0; i < room_vc.size(); i++) { RoomInfo r = (RoomInfo) room_vc.elementAt(i); if (r.Room_name.equals(message)) { r.BroadcastOthers_Room("SendFile| ", this); } } ///////////////////////////////////////////////// ///////////////////////////////////////////////// } else if (protocol.equals("FileRefuse")) { // 파일 전송 거절 for (int i = 0; i < room_vc.size(); i++) { RoomInfo r = (RoomInfo) room_vc.elementAt(i); if (r.Room_name.equals(message)) { r.BroadcastOthers_Room("KeepFile|" + id + "님이 파일 전송을 거절하였습니다", this); } } ///////////////////////////////////////////////// ///////////////////////////////////////////////// } else if (protocol.equals("FileReceiver")) { // 파일을 받는다 for (int i = 0; i < room_vc.size(); i++) { RoomInfo r = (RoomInfo) room_vc.elementAt(i); if (r.Room_name.equals(message)) { r.BroadcastOthers_Room("ReceiveFile|" + fileServerIP + "|" + fileName, this); } } fileServerIP = ""; filePath = ""; fileName = ""; } else if (protocol.equals("FileComplete")) { for (int i = 0; i < room_vc.size(); i++) { RoomInfo r = (RoomInfo) room_vc.elementAt(i); if (r.Room_name.equals(message)) { Broadcast("FileEnd| "); } } } } private void Broadcast(String str) { // 전체 사용자에게 메세지 전송 for (int i = 0; i < user_vc.size(); i++) { UserInfo u = (UserInfo) user_vc.elementAt(i); u.send_Message(str); } } private void send_Message(String str) { // 문자열을 받아서 전송 try { dos.writeUTF(str); } catch (IOException e) { } } private void checkRoomRemove(RoomInfo r) { if (r.isEmpty()) { textArea.append("** " + r.Room_name + " 채팅방 삭제 **\n"); room_vc.remove(r); Broadcast("Room_remove|" + r.Room_name); Broadcast("room_list_update| "); } } } class RoomInfo { private String Room_name; private Vector Room_user_vc = new Vector(); RoomInfo(String room_name, UserInfo u) { this.Room_name = room_name; this.Room_user_vc.add(u); } public void Broadcast_Room(String str) { // 현재 방의 모든 사람에게 메세지 전송 for (int i = 0; i < Room_user_vc.size(); i++) { UserInfo u = (UserInfo) Room_user_vc.elementAt(i); u.send_Message(str); } } public void BroadcastOthers_Room(String str, UserInfo user) { for (int i = 0; i < Room_user_vc.size(); i++) { UserInfo u = (UserInfo) Room_user_vc.elementAt(i); if (u.id != user.id) u.send_Message(str); } } public void Add_User(UserInfo u) { this.Room_user_vc.add(u); } public void remove_User(UserInfo u) { this.Room_user_vc.remove(u); } public boolean isEmpty() { if (Room_user_vc.size() == 0) return true; else return false; } } }
[ "alexsjh23@gmail.com" ]
alexsjh23@gmail.com
5a01498db60ce7d537f56fa17038cf0fd5863adf
96fdae2124032cb9352301d2e4aa534e52002d15
/src/com/appiari/parkaspharmacy/adapters/HorizontalSelectorModel.java
3c21ba552dde3cfb239f04a534c23b895f2f96a7
[]
no_license
csosa246/park-as-pharmacy-android
932216f7905e9b096336a86dc07806213775d618
5d6f0b34dd7b96c65807ecd61d12e8b195984a42
refs/heads/master
2021-05-27T16:47:54.689777
2014-02-24T01:23:56
2014-02-24T01:23:56
15,662,687
1
0
null
null
null
null
UTF-8
Java
false
false
3,929
java
package com.appiari.parkaspharmacy.adapters; import java.util.ArrayList; import com.appiari.parkaspharmacy.MainActivity; import com.appiari.parkaspharmacy.R; import android.content.Context; import android.content.res.Resources; import android.graphics.Color; import android.graphics.Typeface; import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; import android.widget.ImageView; import android.widget.TableRow; import android.widget.TextView; public class HorizontalSelectorModel { Context context; TableRow tableRow; Typeface typeface; Resources resources; String pkg; String resourceLocation; boolean showText=false; public void setResourceLocation(String resourceLocation) { this.resourceLocation = resourceLocation; } // Optional ArrayList<String> textArray = new ArrayList<String>(); ArrayList<String> resourceArray = new ArrayList<String>(); String columnName; public HorizontalSelectorModel(Context context,boolean showText,String columnName) { this.context = context; this.showText = showText; this.columnName = columnName; tableRow = new TableRow(this.context); resources = context.getResources(); pkg = context.getPackageName(); if(showText){ typeface = Typeface.createFromAsset(this.context.getAssets(),"fonts/Roboto/Roboto-Light.ttf"); } //SETTING DATA HERE textArray = ((MainActivity) this.context).getColumnValues(columnName,null); resourceArray = ((MainActivity) this.context).getColumnValues(columnName+"_RESOURCES",null); } public void setTextArray(ArrayList<String> textArray) { this.textArray = textArray; } public void setResourceArray(ArrayList<String> resourceArray) { this.resourceArray = resourceArray; } ArrayList<View> list = new ArrayList<View>(); int selected=0; ArrayList<Integer> selectedArray = new ArrayList<Integer>(); public TableRow getView() { LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); // TODO Auto-generated method stub for (int i = 0; i < resourceArray.size(); i++) { final View convertView; ViewHolder holder; convertView = inflater.inflate(R.layout.gridinflater, null); holder = new ViewHolder(); holder.ImgThumb = (ImageView) convertView.findViewById(R.id.imgThumb); holder.ImhText = (TextView) convertView.findViewById(R.id.imgText); holder.ImhText.setTypeface(typeface); if(showText){ holder.ImhText.setText(textArray.get(i)); }else{ holder.ImhText.setHeight(0); } holder.ImgThumb.setBackgroundResource(resources.getIdentifier(resourceArray.get(i), resourceLocation, pkg)); convertView.setTag(String.valueOf(i)); convertView.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { selected = Integer .parseInt(convertView.getTag().toString()); if (selected==0){ selectedArray.clear(); }else if(selectedArray.contains(selected)){ selectedArray.remove(selectedArray.indexOf(selected)); }else{ selectedArray.add(selected); } updateView(); } }); list.add(convertView); tableRow.addView(convertView); //updateView(); } return tableRow; } public void updateView() { for (int i = 0; i < list.size(); i++) { View v = list.get(i); v.setBackgroundColor(Color.TRANSPARENT); if (selectedArray.contains(i)) { v.setBackgroundColor(Color.BLACK); } } } public String getSelected(){ String toBeSearched = ""; for(int i = 0; i < selectedArray.size() ; i++){ int sel = selectedArray.get(i); String get = textArray.get(sel); toBeSearched += " OR " + columnName + " LIKE " + "'%" + get + "%'"; } toBeSearched = "(" + toBeSearched.replaceFirst(" OR ", "") + ")"; if(selectedArray.isEmpty()){ return null; } return toBeSearched; } public class ViewHolder { ImageView ImgThumb; TextView ImhText; } }
[ "csosa246@gmail.com" ]
csosa246@gmail.com
565cbfeec8345e0055103c42379bdd441f9b42d5
effda6c2515a87dbc76ef156987633dd1804d04d
/src/main/java/org/sidoh/wwf_api/game_state/Move.java
35254bbe3f539fda78b192cc76d2b3e2f22eaadb
[ "Apache-2.0" ]
permissive
dianey/wwf_api
a3994842a293c6d931dcc3e1a1a61f8d39108da1
c28d50e8baed9f33eb2ee7ed095b2a7880cb54e6
refs/heads/master
2020-12-29T03:18:36.885672
2013-04-21T03:29:14
2013-04-21T03:29:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,137
java
package org.sidoh.wwf_api.game_state; import org.sidoh.wwf_api.types.api.MoveType; import org.sidoh.wwf_api.types.game_state.Letter; import org.sidoh.wwf_api.types.game_state.Tile; import org.sidoh.wwf_api.types.game_state.WordOrientation; import java.util.Collections; import java.util.LinkedList; import java.util.List; public class Move { private final LinkedList<Tile> tiles; private final int row; private final int col; private final WordOrientation orientation; private Result result; private final MoveType type; private Move(MoveType type, List<Tile> tiles, int row, int col, WordOrientation orientation) { this.type = type; this.tiles = new LinkedList<Tile>(tiles); this.row = row; this.col = col; this.orientation = orientation; } public MoveType getMoveType() { return type; } public Move clone() { return new Move(type, tiles, row, col, orientation); } public Move moveBack() { int row = this.row; int col = this.col; if (orientation == WordOrientation.HORIZONTAL) { col--; } else { row--; } return new Move(type, tiles, row, col, orientation); } public Move moveForward() { int row = this.row; int col = this.col; if (orientation == WordOrientation.HORIZONTAL) { col++; } else { row++; } return new Move(type, tiles, row, col, orientation); } public Move playBack(Tile tile) { Move copy = moveBack(); copy.tiles.addFirst(tile); return copy; } public Move playFront(Tile tile) { Move copy = new Move(type, tiles, row, col, orientation); copy.tiles.addLast(tile); return copy; } public Result getResult() { return result; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Move move = (Move) o; if (col != move.col) return false; if (row != move.row) return false; if (tiles != null && tiles.size() > 1 && orientation != move.orientation) return false; if (! tilesAreSame(tiles, move.tiles)) return false; return true; } @Override public int hashCode() { int result = tiles != null ? tilesHashCode(tiles) : 0; result = 31 * result + row; result = 31 * result + col; if (tiles != null && tiles.size() > 1) result = 31 * result + (orientation != null ? orientation.hashCode() : 0); return result; } @Override public String toString() { return "Move{" + "tiles=" + tiles + ", row=" + row + ", col=" + col + ", orientation=" + orientation + ", result=" + result + '}'; } public List<Tile> getTiles() { return tiles; } public int getRow() { if (row < 0 || row >= 15 || col < 0 || col >= 15) throw new RuntimeException("illegal move generated"); return row; } public int getCol() { if (row < 0 || row >= 15 || col < 0 || col >= 15) throw new RuntimeException("illegal move generated"); return col; } public WordOrientation getOrientation() { return orientation; } public Move setResult(Result result) { this.result = result; return this; } /** * When checking move equality, tile IDs don't matter. * * @param tiles1 * @param tiles2 * @return */ protected static boolean tilesAreSame(List<Tile> tiles1, List<Tile> tiles2) { if (tiles1 == null || tiles2 == null) return tiles1 == tiles2; if (tiles1.size() != tiles2.size()) return false; for (int i = 0; i < tiles1.size(); i++) { Tile tile1 = tiles1.get(i); Tile tile2 = tiles2.get(i); if (! tile1.getLetter().equals(tile2.getLetter()) || tile1.getValue() != tile2.getValue()) return false; } return true; } protected static int tilesHashCode(List<Tile> tiles1) { List<Letter> letters = new LinkedList<Letter>(); for (Tile tile : tiles1) { letters.add(tile.getLetter()); } return letters.hashCode(); } /** * Get a move representing a play * * @param tiles ordered list of tiles to play * @param row row play occurs on * @param column col play occurs on * @param orientation orientation of the play (horiz. or vert.) * @return */ public static Move play(List<Tile> tiles, int row, int column, WordOrientation orientation) { return new Move(MoveType.PLAY, tiles, row, column, orientation); } /** * Get a move representing a swap * * @param tiles list of tiles to swap out * @return */ public static Move swap(List<Tile> tiles) { return new Move(MoveType.SWAP, tiles, 0, 0, null); } /** * Get a move representing a pass * * @return */ public static Move pass() { return new Move(MoveType.PASS, Collections.<Tile>emptyList(), 0, 0, null); } /** * Encapsulates information about a move. This includes the number of points earned * and a list of the words that were formed. Removes the abstraction gained by using * Letter since this is really only useful for dictionary lookups. * */ public static class Result { private final int score; private final int numTilesSkipped; private final String mainWord; private final List<String> resultingWords; public Result(int score, int numTilesSkipped, String mainWord, List<String> resultingWords) { this.score = score; this.numTilesSkipped = numTilesSkipped; this.mainWord = mainWord; this.resultingWords = resultingWords; } public int getNumTilesSkipped() { return numTilesSkipped; } public String getMainWord() { return mainWord; } public int getScore() { return score; } public List<String> getResultingWords() { return resultingWords; } @Override public String toString() { return "Result{" + "score=" + score + ", numTilesSkipped=" + numTilesSkipped + ", mainWord='" + mainWord + '\'' + ", resultingWords=" + resultingWords + '}'; } } }
[ "chris.mullins10@gmail.com" ]
chris.mullins10@gmail.com
3dfeb2792fd8ea042503ca4d241cca50db7c42de
1cf19ca31b99d73a30261a2321321468b98d0369
/week_11/weekend_homework/airport_homework/Airport/src/test/java/PassengerTest.java
c33ff7e1b5fe3c6fb0b07dc5a3616d65ff453435
[]
no_license
kadzer/g7_notes_copy
b4452bd900a7cd97d8ba774e081dc465bd8201cc
839e169a978ed1320dfef5afb73fc7b224b015c2
refs/heads/master
2020-04-09T15:11:13.480211
2018-12-04T21:05:11
2018-12-04T21:05:11
160,418,545
0
0
null
null
null
null
UTF-8
Java
false
false
486
java
import org.junit.Before; import org.junit.Test; import static org.junit.Assert.assertEquals; public class PassengerTest { private Passenger passenger; @Before public void setUp() throws Exception { passenger = new Passenger("Pat", 50); } @Test public void shouldHaveName() { assertEquals("Pat", passenger.getName()); } @Test public void shouldHaveBaggageWeight() { assertEquals(50, passenger.getBaggageWeight()); } }
[ "kadzer@gmail.com" ]
kadzer@gmail.com
76f228175d1ccead85f3f8a226f874a9a07f3641
15e3c9a808601b11b1f0a535b3b9b7c4b4a24b5a
/src/main/java/app/service/impl/FullEvaluateServiceImpl.java
2a486b57fec8a56cfd91d8578729868f76c191cb
[]
no_license
Corevn/VirtualAssistance
4d2abae715877f8e0df64244cda8257d9a926459
f901c6e1aaa61e63b5403e7eb68199f757ad63b0
refs/heads/master
2020-12-20T14:43:53.651137
2019-03-15T05:50:32
2019-03-15T05:50:32
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,073
java
package app.service.impl; import app.service.FullEvaluateService; import app.domain.FullEvaluate; import app.repository.FullEvaluateRepository; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.List; import java.util.Optional; /** * Service Implementation for managing FullEvaluate. */ @Service @Transactional public class FullEvaluateServiceImpl implements FullEvaluateService { private final Logger log = LoggerFactory.getLogger(FullEvaluateServiceImpl.class); private final FullEvaluateRepository fullEvaluateRepository; public FullEvaluateServiceImpl(FullEvaluateRepository fullEvaluateRepository) { this.fullEvaluateRepository = fullEvaluateRepository; } /** * Save a fullEvaluate. * * @param fullEvaluate the entity to save * @return the persisted entity */ @Override public FullEvaluate save(FullEvaluate fullEvaluate) { log.debug("Request to save FullEvaluate : {}", fullEvaluate); return fullEvaluateRepository.save(fullEvaluate); } /** * Get all the fullEvaluates. * * @return the list of entities */ @Override @Transactional(readOnly = true) public List<FullEvaluate> findAll() { log.debug("Request to get all FullEvaluates"); return fullEvaluateRepository.findAll(); } /** * Get one fullEvaluate by id. * * @param id the id of the entity * @return the entity */ @Override @Transactional(readOnly = true) public Optional<FullEvaluate> findOne(Long id) { log.debug("Request to get FullEvaluate : {}", id); return fullEvaluateRepository.findById(id); } /** * Delete the fullEvaluate by id. * * @param id the id of the entity */ @Override public void delete(Long id) { log.debug("Request to delete FullEvaluate : {}", id); fullEvaluateRepository.deleteById(id); } }
[ "ntquang22298@gmail.com" ]
ntquang22298@gmail.com
a304257793fe42faf5dfa0d653903ba698e51bbb
5356807b48a8ad059e4f055e684b56d9858c1e56
/src/test/java/net/kenro/ji/jin/purescript/parser/PSLanguageParserTestBase.java
8b6a875d28988c29c99502be9349740c706183c5
[ "BSD-3-Clause" ]
permissive
Lermex/intellij-purescript
4d74ce2eed0d2d296ad386dcea20144060219c0d
a2315f5f08cb060c0a18e3b91ca5eaf53cb1e5d8
refs/heads/master
2021-04-06T00:20:24.209998
2018-03-08T18:19:19
2018-03-08T18:19:19
124,430,634
0
1
BSD-3-Clause
2018-03-08T18:17:38
2018-03-08T18:17:38
null
UTF-8
Java
false
false
1,833
java
package net.kenro.ji.jin.purescript.parser; import com.intellij.lang.ParserDefinition; import com.intellij.mock.MockVirtualFile; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.PsiFile; import com.intellij.testFramework.ParsingTestCase; import com.intellij.testFramework.TestDataFile; import org.jetbrains.annotations.NonNls; import java.io.File; import java.io.IOException; public abstract class PSLanguageParserTestBase extends ParsingTestCase { public PSLanguageParserTestBase(String dataPath, String fileExt, ParserDefinition... definitions) { super(dataPath, fileExt, definitions); } @Override protected String getTestDataPath() { return this.getClass().getClassLoader().getResource("gold").getPath(); } @Override protected boolean skipSpaces() { return true; } /** * Perform a test. Add tests that should work but does not work yet with * doTest(false, false). */ protected void doTest(boolean checkResult, boolean shouldPass) { doTest(true); if (shouldPass) { assertFalse( "PsiFile contains error elements", toParseTreeText(myFile, skipSpaces(), includeRanges()).contains("PsiErrorElement") ); } } @Override protected void checkResult(@NonNls @TestDataFile String targetDataName, final PsiFile file) throws IOException { doCheckResult(myFullDataPath, file, checkAllPsiRoots(), "" + File.separator + targetDataName, skipSpaces(), includeRanges()); } @Override protected void setUp() throws Exception { super.setUp(); VirtualFile m = new MockVirtualFile(true,myFullDataPath); myProject.setBaseDir(m); } }
[ "kingsley.xa.hendrickse@barclayscapital.comm" ]
kingsley.xa.hendrickse@barclayscapital.comm
55dd6664f9ce182b73122c73c16d057d49ec0d42
a9c0a95d4f2de69818178dd9036c95db434c090d
/book-logic/src/test/java/co/edu/uniandes/csw/book/test/persistence/AuthorPersistenceTest.java
cf36337921316a94521d0fc99a6319e1478da9c2
[ "MIT" ]
permissive
Uniandes-ISIS2603-backup/book201710
7d0034853b10fd35a075eba11c6664254cf4354c
a4449b990b007e9a51ed41bd7ddf00426a2f0cb9
refs/heads/master
2021-06-11T21:26:47.092218
2017-02-02T15:54:37
2017-02-02T15:54:37
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,307
java
/* The MIT License (MIT) Copyright (c) 2015 Los Andes University Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package co.edu.uniandes.csw.book.test.persistence; import co.edu.uniandes.csw.book.entities.AuthorEntity; import co.edu.uniandes.csw.book.persistence.AuthorPersistence; import java.util.ArrayList; import java.util.List; import javax.inject.Inject; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import javax.transaction.UserTransaction; import org.junit.Assert; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import uk.co.jemos.podam.api.PodamFactory; import uk.co.jemos.podam.api.PodamFactoryImpl; /** * @generated */ @RunWith(Arquillian.class) public class AuthorPersistenceTest { /** * @generated */ @Deployment public static JavaArchive createDeployment() { return ShrinkWrap.create(JavaArchive.class) .addPackage(AuthorEntity.class.getPackage()) .addPackage(AuthorPersistence.class.getPackage()) .addAsManifestResource("META-INF/persistence.xml", "persistence.xml") .addAsManifestResource("META-INF/beans.xml", "beans.xml"); } /** * @generated */ /** * @generated */ @Inject private AuthorPersistence authorPersistence; /** * @generated */ @PersistenceContext private EntityManager em; /** * @generated */ @Inject UserTransaction utx; /** * Configuración inicial de la prueba. * * @generated */ @Before public void configTest() { try { utx.begin(); em.joinTransaction(); clearData(); insertData(); utx.commit(); } catch (Exception e) { e.printStackTrace(); try { utx.rollback(); } catch (Exception e1) { e1.printStackTrace(); } } } /** * Limpia las tablas que están implicadas en la prueba. * * @generated */ private void clearData() { em.createQuery("delete from AuthorEntity").executeUpdate(); } /** * @generated */ private List<AuthorEntity> data = new ArrayList<AuthorEntity>(); /** * Inserta los datos iniciales para el correcto funcionamiento de las pruebas. * * @generated */ private void insertData() { PodamFactory factory = new PodamFactoryImpl(); for (int i = 0; i < 3; i++) { AuthorEntity entity = factory.manufacturePojo(AuthorEntity.class); em.persist(entity); data.add(entity); } } /** * Prueba para crear un Author. * * @generated */ @Test public void createAuthorTest() { PodamFactory factory = new PodamFactoryImpl(); AuthorEntity newEntity = factory.manufacturePojo(AuthorEntity.class); AuthorEntity result = authorPersistence.create(newEntity); Assert.assertNotNull(result); AuthorEntity entity = em.find(AuthorEntity.class, result.getId()); Assert.assertEquals(newEntity.getName(), entity.getName()); } /** * Prueba para consultar la lista de Authors. * * @generated */ @Test public void getAuthorsTest() { List<AuthorEntity> list = authorPersistence.findAll(); Assert.assertEquals(data.size(), list.size()); for (AuthorEntity ent : list) { boolean found = false; for (AuthorEntity entity : data) { if (ent.getId().equals(entity.getId())) { found = true; } } Assert.assertTrue(found); } } /** * Prueba para consultar un Author. * * @generated */ @Test public void getAuthorTest() { AuthorEntity entity = data.get(0); AuthorEntity newEntity = authorPersistence.find(entity.getId()); Assert.assertNotNull(newEntity); Assert.assertEquals(entity.getName(), newEntity.getName()); Assert.assertEquals(entity.getBirthDate(), newEntity.getBirthDate()); } /** * Prueba para eliminar un Author. * * @generated */ @Test public void deleteAuthorTest() { AuthorEntity entity = data.get(0); authorPersistence.delete(entity.getId()); AuthorEntity deleted = em.find(AuthorEntity.class, entity.getId()); Assert.assertNull(deleted); } /** * Prueba para actualizar un Author. * * @generated */ @Test public void updateAuthorTest() { AuthorEntity entity = data.get(0); PodamFactory factory = new PodamFactoryImpl(); AuthorEntity newEntity = factory.manufacturePojo(AuthorEntity.class); newEntity.setId(entity.getId()); authorPersistence.update(newEntity); AuthorEntity resp = em.find(AuthorEntity.class, entity.getId()); Assert.assertEquals(newEntity.getName(), resp.getName()); } }
[ "yego23@gmail.com" ]
yego23@gmail.com
91a5de4d31fc3a2d74574909bc55f15e1d7770a9
61a02e21c93fc02cc53f65dc38b0b0073e684853
/sispedidos/src/main/java/io/github/rogerlog/SispedidosApplication.java
24fedca8d4b63173cc6737bf5635354100c48086
[]
no_license
rogerlog/sistema-pedidos
ec217d85200eb4a2a464b9cc76c4e75cc64daae0
1154dc1c456d7afebfb2188c7ed15ecfe7a57f82
refs/heads/master
2023-06-28T06:11:57.144703
2021-08-02T10:23:01
2021-08-02T10:23:01
370,447,203
0
0
null
null
null
null
UTF-8
Java
false
false
466
java
package io.github.rogerlog; import org.springframework.boot.CommandLineRunner; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class SispedidosApplication implements CommandLineRunner { public static void main(String[] args) { SpringApplication.run(SispedidosApplication.class, args); } @Override public void run(String... args) throws Exception { } }
[ "logroger@gmail.com" ]
logroger@gmail.com
0294fd3e45c61d7da008c4e798f219223983d07e
921cde286d729e6f67abb4bc17ab420febeb83a8
/src/main/java/org/homework/hibernate/service/hw4/interfaces/ProjectService.java
2486d905068cd561521086aa6cd54f3d79a00451
[]
no_license
SlivkaEvgen/ProjectManagementSystem
9a450b4bf1abe2ad6515ff36acb26a11015ef40d
9741b0623e40fc8d3f0eb2aec28475575a59ac79
refs/heads/master
2023-07-31T18:37:48.411484
2021-09-19T09:05:46
2021-09-19T09:05:46
402,920,632
1
0
null
null
null
null
UTF-8
Java
false
false
377
java
package org.homework.hibernate.service.hw4.interfaces; import org.homework.hibernate.model.Project; import java.util.List; public interface ProjectService extends IService<Project, Long> { Project createNewProject(String name, Long cost,Long companyId, Long customerId); void update(Long id, String name, Long cost); List<String> getListProjectsWithDate(); }
[ "allrent3@gmail.com" ]
allrent3@gmail.com
0ee9474fd7e080dc74a41acda71a8c9bfdbe85c6
f6188396a6056d7b1a0ddcac118f0d9d8a8b4aff
/src/com/practice/FibonacciSeries.java
1d5ee6b48f87bd593641452bfd1274ae22aebd90
[]
no_license
mrashmi791/programs
810d62e5c956f427d7879ac542bc9bbf7f7dc077
7e4c62df17462e42278e785b5ebae868f56439e6
refs/heads/main
2023-02-07T03:22:30.013001
2020-12-26T12:34:44
2020-12-26T12:34:44
324,551,052
0
0
null
null
null
null
UTF-8
Java
false
false
367
java
package com.practice; import java.util.Scanner; public class FibonacciSeries { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int a = 0; int b = 1; for(int i = 1; i <=n; i++) { System.out.print(a+" "); int sum = a+b; a = b; b = sum; } } }
[ "mrashmi791@gmail.com" ]
mrashmi791@gmail.com
5df31e28679f4d6e2d54ba9b60ec20f4418f875f
e0f7cbcd6a63544003b71d96e756b0963a29ed83
/app/src/paid/java/com/udacity/gradle/builditbigger/paid/MainActivity.java
959d8c7d6d619088a9ed70405669b8f98ec4c221
[]
no_license
Samuelford24/BuildItBigger2
44580e915d1d3d781ca67483e568c51f18033373
b63e28c7538db1717ae434e48b4283b9371a9370
refs/heads/master
2022-11-10T22:42:10.608670
2020-06-26T19:31:01
2020-06-26T19:31:01
275,217,738
0
0
null
null
null
null
UTF-8
Java
false
false
709
java
package com.udacity.gradle.builditbigger.paid; import androidx.appcompat.app.AppCompatActivity; import android.content.Context; import android.os.Bundle; import android.util.Pair; import android.view.View; import com.udacity.gradle.builditbigger.R; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } public void tellJoke(View view) { new com.udacity.gradle.builditbigger.EndpointsAsyncTask().execute(new Pair<Context, String>(this, "Manfred")); // Toast.makeText(this, , Toast.LENGTH_SHORT).show(); } }
[ "Samuelford48@gmail.com" ]
Samuelford48@gmail.com
81610d6698d3dfc0ace12d18b2a47e1f9707fe04
b4aaae4b45ab5436221b802245ba71f2c23e1b5c
/modules/title/src/com/sysdelphia/bindings/mismo/title/RequestData.java
6074dc14d93f754f46f7f081929b3658aef7e9c4
[]
no_license
troyboysmith/mismo-bindings
d3ed31461840d77ae4f1605e8d36f9f14b88e8f0
1812c2445b55dfb9924b25d4d9e502550624822b
refs/heads/master
2021-05-28T03:59:52.673777
2007-07-30T02:09:26
2007-07-30T02:09:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
459
java
package com.sysdelphia.bindings.mismo.title; import java.util.ArrayList; public class RequestData { public void addTITLEREQUEST(TitleRequest titlEREQUEST) { titlEREQUESTList.add(titlEREQUEST); } public TitleRequest getTITLEREQUEST(int index) { return (TitleRequest)titlEREQUESTList.get( index ); } public int sizeTITLEREQUESTList() { return titlEREQUESTList.size(); } protected ArrayList titlEREQUESTList = new ArrayList(); }
[ "suni81@4e3fa341-d230-0410-8b36-bd473e2d5c71" ]
suni81@4e3fa341-d230-0410-8b36-bd473e2d5c71
232f22b8cbca88cc50eb3b9da320f94e15389ff1
d7dfbeefd35da251fba5299363e177713267ed77
/app/src/main/java/com/devlomi/fireapp/interfaces/ToolbarStateChange.java
a2ffece1cbd7bbcabf0c723068c9361feae3b9a3
[]
no_license
WireROP/FireApp-Android-App
ecf66241beaace904d79548db8eaf8b474766177
a9781b6b9f94dbd9a7431db072bdd59fe4374b05
refs/heads/master
2023-01-06T21:51:08.504613
2020-10-25T04:30:28
2020-10-25T04:30:28
307,023,915
0
1
null
null
null
null
UTF-8
Java
false
false
194
java
package com.devlomi.fireapp.interfaces; /** * Created by Devlomi on 18/12/2017. */ public interface ToolbarStateChange { void hideToolbar(); void showToolbar(); void toggle(); }
[ "trojanvulgar@gmail.com" ]
trojanvulgar@gmail.com
afa49bf6d9159c3f26f44a13445f477409e43bc9
1690d5bb83106c571a18b33652e95cd72daa1922
/gulimall-coupon/src/main/java/com/atguigu/gulimall/coupon/controller/SkuLadderController.java
fb77f75701f46577aeae565a4da7505e434aff46
[ "Apache-2.0" ]
permissive
jacklmjie/java-gulimall
52f1d8c56f3dca105a6690a4b7db2c96241efaf8
5ad5c0400a775db6ae04be30d9ca7dd13fd4d77e
refs/heads/main
2023-06-24T14:06:36.632479
2021-07-09T06:20:52
2021-07-09T06:20:52
381,214,509
0
0
null
null
null
null
UTF-8
Java
false
false
2,219
java
package com.atguigu.gulimall.coupon.controller; import java.util.Arrays; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import com.atguigu.gulimall.coupon.entity.SkuLadderEntity; import com.atguigu.gulimall.coupon.service.SkuLadderService; import com.atguigu.common.utils.PageUtils; import com.atguigu.common.utils.R; /** * 商品阶梯价格 * * @author lmj * @email lmj@gmail.com * @date 2021-05-24 14:15:01 */ @RestController @RequestMapping("coupon/skuladder") public class SkuLadderController { @Autowired private SkuLadderService skuLadderService; /** * 列表 */ @RequestMapping("/list") //@RequiresPermissions("coupon:skuladder:list") public R list(@RequestParam Map<String, Object> params){ PageUtils page = skuLadderService.queryPage(params); return R.ok().put("page", page); } /** * 信息 */ @RequestMapping("/info/{id}") //@RequiresPermissions("coupon:skuladder:info") public R info(@PathVariable("id") Long id){ SkuLadderEntity skuLadder = skuLadderService.getById(id); return R.ok().put("skuLadder", skuLadder); } /** * 保存 */ @RequestMapping("/save") //@RequiresPermissions("coupon:skuladder:save") public R save(@RequestBody SkuLadderEntity skuLadder){ skuLadderService.save(skuLadder); return R.ok(); } /** * 修改 */ @RequestMapping("/update") //@RequiresPermissions("coupon:skuladder:update") public R update(@RequestBody SkuLadderEntity skuLadder){ skuLadderService.updateById(skuLadder); return R.ok(); } /** * 删除 */ @RequestMapping("/delete") //@RequiresPermissions("coupon:skuladder:delete") public R delete(@RequestBody Long[] ids){ skuLadderService.removeByIds(Arrays.asList(ids)); return R.ok(); } }
[ "limengjie@com" ]
limengjie@com
e93181f262b145baa469fe08b949edffc5719ae3
7d39ee4b55d0a6628ad4a3cbda67b4ae85466475
/Module_Java123/src/ch13/TolearnFile/TestFile.java
e1682b96f1516bd2b61646b5dacdc74eb02549f1
[]
no_license
njsoho2008/repository_one
e64fbf1d00e8132f2376c64cc777aeb87058e3fe
f2f44e4efe5ef84a397fd629c3b9a2c19b6e22c7
refs/heads/master
2020-04-24T22:42:06.471820
2019-07-31T01:52:34
2019-07-31T01:52:34
172,320,592
0
0
null
null
null
null
UTF-8
Java
false
false
915
java
package ch13.TolearnFile; import java.io.File; import java.util.Date; //要在当前目录下进行测试,IJ环境不行 public class TestFile { public static void Tfile(){ File file=new File("/ch13/image/example_01.jpg"); File file1=new File("C:/333/dir2"); file1.mkdir(); System.out.println("文件存在吗?"+(file.exists()?"存在":"不存在")); System.out.println("file 的绝对路径是:"+file.getAbsolutePath()); System.out.println("file1 is file?"+ file1.isDirectory()); System.out.println("file is file?"+ file.isFile()); // 是绝对路径创建的吗 System.out.println("file is absolute?"+file.isAbsolute()); System.out.println("last modified on"+new Date(file.lastModified())); System.out.println("today is " +new Date()); } public static void main(String[] args){ Tfile(); } }
[ "zzf_exw01@126.com" ]
zzf_exw01@126.com
a1b44e5fc38a2577339e1ece02344d740c2d5ecf
f2c3be79638c8a36e9aa7630b117f0ebb13fae30
/src/main/java/br/com/donus/account/data/dto/account/AccountResponse.java
ca7915e369d99042f6e9162314739a6030afe75f
[]
no_license
renatohaber/donus-code-challenge
d8e7bf9b4583400834657d5e2b24da07fc841afd
b8b3cb2c4811050189a9ecc5e51a0978558145f9
refs/heads/main
2023-01-24T10:59:34.980950
2020-11-30T22:43:34
2020-11-30T22:43:34
315,790,464
0
0
null
null
null
null
UTF-8
Java
false
false
959
java
package br.com.donus.account.data.dto.account; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder; import lombok.*; import java.math.BigDecimal; import java.util.UUID; @Getter @ToString @EqualsAndHashCode @AllArgsConstructor @Builder(builderClassName = "AccountResponseBuilder", toBuilder = true) @JsonDeserialize(builder = AccountResponse.AccountResponseBuilder.class) @JsonIgnoreProperties(ignoreUnknown = true) @JsonInclude(JsonInclude.Include.NON_NULL) public class AccountResponse { private final UUID id; private final String name; private final String taxId; private final BigDecimal balance; @JsonPOJOBuilder(withPrefix = "") @JsonIgnoreProperties(ignoreUnknown = true) public static class AccountResponseBuilder { } }
[ "renato.haber@gmail.com" ]
renato.haber@gmail.com
6a893db114446c7e7a7fe0e7e532d3bc8e460fe2
885ebd8d24e912f3a7cc0817e9d092401589884a
/training-clean/clean-contract-and-api/src/main/java/lab01/package-info.java
84a3e23df2242187961715415996914a43128141
[ "MIT" ]
permissive
ferdi145/software-design
7fc06989a142b7a21c0ca84a398587e240f08f30
be8541ac4e48dd2f83e905c8a31bc14d0e5da299
refs/heads/master
2022-11-15T18:05:05.334077
2020-07-10T12:31:28
2020-07-10T12:31:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
135
java
/** * Learn how to make APIs more clear, by checking preconditions and postconditions (from: Design by Contract) */ package lab01;
[ "hdowalil@gmail.com" ]
hdowalil@gmail.com
4c9a22e7de300d09db93d1f46793160997ef7e1f
cec0c2fa585c3f788fc8becf24365e56bce94368
/net/minecraft/world/entity/ai/behavior/BecomePassiveIfMemoryPresent.java
89260466cff4e096f3fe564b99d851b2f31167a0
[]
no_license
maksym-pasichnyk/Server-1.16.3-Remapped
358f3c4816cbf41e137947329389edf24e9c6910
4d992e2d9d4ada3ecf7cecc039c4aa0083bc461e
refs/heads/master
2022-12-15T08:54:21.236174
2020-09-19T16:13:43
2020-09-19T16:13:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,526
java
/* */ package net.minecraft.world.entity.ai.behavior; /* */ /* */ import com.google.common.collect.ImmutableMap; /* */ import java.util.Map; /* */ import net.minecraft.server.level.ServerLevel; /* */ import net.minecraft.world.entity.LivingEntity; /* */ import net.minecraft.world.entity.ai.memory.MemoryModuleType; /* */ import net.minecraft.world.entity.ai.memory.MemoryStatus; /* */ /* */ public class BecomePassiveIfMemoryPresent /* */ extends Behavior<LivingEntity> { /* */ public BecomePassiveIfMemoryPresent(MemoryModuleType<?> debug1, int debug2) { /* 13 */ super((Map<MemoryModuleType<?>, MemoryStatus>)ImmutableMap.of(MemoryModuleType.ATTACK_TARGET, MemoryStatus.REGISTERED, MemoryModuleType.PACIFIED, MemoryStatus.VALUE_ABSENT, debug1, MemoryStatus.VALUE_PRESENT)); /* */ /* */ /* */ /* */ /* 18 */ this.pacifyDuration = debug2; /* */ } /* */ private final int pacifyDuration; /* */ /* */ protected void start(ServerLevel debug1, LivingEntity debug2, long debug3) { /* 23 */ debug2.getBrain().setMemoryWithExpiry(MemoryModuleType.PACIFIED, Boolean.valueOf(true), this.pacifyDuration); /* 24 */ debug2.getBrain().eraseMemory(MemoryModuleType.ATTACK_TARGET); /* */ } /* */ } /* Location: C:\Users\Josep\Downloads\Decompile Minecraft\deobfuscated.jar!\net\minecraft\world\entity\ai\behavior\BecomePassiveIfMemoryPresent.class * Java compiler version: 8 (52.0) * JD-Core Version: 1.1.3 */
[ "tanksherman27@gmail.com" ]
tanksherman27@gmail.com
fed0f851ca303b865c3c85da8270d374033f8ae1
192e8bbd653529b0b4395da1a8ba0b377dea9946
/materialhelptutorial/src/test/java/za/co/riggaroo/materialhelptutorial/ExampleUnitTest.java
d71d54feaa8e6b6d53978160e9998e38f7ab1897
[ "MIT" ]
permissive
lowlevel-studios/MaterialIntroTutorial
682d4647c4835c3465dbcaaa6c32bfc5a14addc6
eaac17c6b611c90b75088bb5965375e47c2f825c
refs/heads/master
2021-01-19T22:41:11.565102
2019-02-22T09:21:42
2019-02-22T09:21:42
88,844,535
2
0
null
2017-04-20T09:09:55
2017-04-20T09:09:55
null
UTF-8
Java
false
false
328
java
package za.co.riggaroo.materialhelptutorial; import org.junit.Test; import static org.junit.Assert.*; /** * To work on unit tests, switch the Test Artifact in the Build Variants view. */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
[ "franks.rebecca@gmail.com" ]
franks.rebecca@gmail.com
ab9526fcdc32a7c012b2452318381bfea6880cb9
d87ebfe04ef8b902bcd2bf9b6b3b56fe19a0a168
/CodingDojo/games/football/src/test/java/com/codenjoy/dojo/football/AllTests.java
8bc5997ba382d41f9ba3ca8ee95c38fda243a8ae
[]
no_license
IzhevskBattleCityDev/codebattle-server
531552c4d9141a220cad00bcde55356259982acb
230fc67a8dbe252c113801436741b68d15f4e1ed
refs/heads/master
2020-03-28T12:33:31.504926
2018-09-28T17:35:13
2018-09-28T17:35:13
148,310,487
0
1
null
2018-09-11T12:01:36
2018-09-11T12:01:36
null
UTF-8
Java
false
false
1,260
java
package com.codenjoy.dojo.football; /*- * #%L * Codenjoy - it's a dojo-like platform from developers to developers. * %% * Copyright (C) 2016 Codenjoy * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program. If not, see * <http://www.gnu.org/licenses/gpl-3.0.html>. * #L% */ import org.junit.runner.RunWith; import org.junit.runners.Suite; import org.junit.runners.Suite.SuiteClasses; import com.codenjoy.dojo.football.client.*; import com.codenjoy.dojo.football.model.*; import com.codenjoy.dojo.football.services.*; @RunWith(Suite.class) @SuiteClasses({ SolverTest.class, FootballPerormanceTest.class, FootballTest.class, SingleTest.class, ScoresTest.class }) public class AllTests { }
[ "apofig@gmil.com" ]
apofig@gmil.com
74b1501e71a154ea2cba647e2ca9ea03291983d1
438fea882c1e101715dd65a4abc8948e2cc7a83d
/blog-web/src/main/java/top/fzqblog/controller/UserController.java
1983ad07f0cf75a044ba3127e74e5fe12610ff82
[]
no_license
duanqimiao/FzqBlog
3027cbdfac19845a9e5c3810cb1df38b44831f24
bc2f04f7b9dcb8c0791868d749e541f8df235ea4
refs/heads/master
2021-01-10T23:54:59.782383
2016-07-26T00:19:17
2016-07-26T00:19:17
70,786,099
1
0
null
2016-10-13T08:36:37
2016-10-13T08:36:37
null
UTF-8
Java
false
false
6,788
java
package top.fzqblog.controller; import java.net.URLEncoder; import java.util.Date; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.ModelAndView; import com.sun.mail.util.LogOutputStream; import top.fzqblog.exception.BussinessException; import top.fzqblog.po.enums.ResponseCode; import top.fzqblog.po.model.SessionUser; import top.fzqblog.po.model.SignInfo; import top.fzqblog.po.model.User; import top.fzqblog.po.vo.AjaxResponse; import top.fzqblog.service.SignInService; import top.fzqblog.service.UserService; import top.fzqblog.utils.Constants; import top.fzqblog.utils.StringUtils; @Controller public class UserController extends BaseController{ @Autowired private UserService userService; @Autowired private SignInService signInService; private Logger logger = LoggerFactory.getLogger(UserController.class); @RequestMapping("register") public String register(){ return "/page/register"; } @ResponseBody @RequestMapping("register.do") public AjaxResponse<Object> registerdo(HttpSession session, User user){ AjaxResponse<Object> ajaxResponse = new AjaxResponse<Object>(); try { userService.register(user); ajaxResponse.setResponseCode(ResponseCode.SUCCESS); SessionUser sessionUser = new SessionUser(); sessionUser.setUserid(user.getUserid()); sessionUser.setUserName(user.getUserName()); sessionUser.setUserIcon(user.getUserIcon()); session.setAttribute(Constants.SESSION_USER_KEY, sessionUser); } catch (BussinessException e) { ajaxResponse.setErrorMsg(e.getLocalizedMessage()); ajaxResponse.setResponseCode(ResponseCode.BUSSINESSERROR); logger.error("用户注册失败,用户名:{}邮箱:{}", user.getUserName(), user.getEmail()); }catch (Exception e) { ajaxResponse.setErrorMsg(ResponseCode.SERVERERROR.getDesc()); ajaxResponse.setResponseCode(ResponseCode.SERVERERROR); logger.error("用户注册失败,用户名:{}邮箱:{}", user.getUserName(), user.getEmail()); } return ajaxResponse; } @RequestMapping("index") public ModelAndView index(HttpSession session){ Integer userid = this.getUserid(session); ModelAndView view = new ModelAndView("/page/index"); if(userid !=null){ SignInfo signInfo = this.signInService.findSignInfoByUserid(userid); view.addObject("signInfo", signInfo); } return view; } @RequestMapping("login") public String login(){ return "/page/login"; } @ResponseBody @RequestMapping("login.do") public AjaxResponse<Object> logindo(HttpServletRequest request, HttpServletResponse response, String account, String password, String rememberMe){ final String REMEMBERME = "1"; AjaxResponse<Object> ajaxResponse = new AjaxResponse<Object>(); HttpSession session = request.getSession(); User user = null; try { user = userService.login(account, password); user.setLastLoginTime(new Date()); ajaxResponse.setResponseCode(ResponseCode.SUCCESS); SessionUser sessionUser = new SessionUser(); sessionUser.setUserid(user.getUserid()); sessionUser.setUserName(user.getUserName()); sessionUser.setUserIcon(user.getUserIcon()); session.setAttribute(Constants.SESSION_USER_KEY, sessionUser); if(REMEMBERME.equals(rememberMe)){ // 清除之前的Cookie 信息 String infor = URLEncoder.encode(account.toString(), "utf-8") + "|" + user.getPassword(); Cookie cookie = new Cookie(Constants.COOKIE_USER_INFO, null); cookie.setPath("/"); cookie.setMaxAge(0); // 建用户信息保存到Cookie中 cookie = new Cookie(Constants.COOKIE_USER_INFO, infor); cookie.setPath("/"); // 设置最大生命周期为1年。 cookie.setMaxAge(31536000); response.addCookie(cookie); } else { Cookie cookie = new Cookie(Constants.COOKIE_USER_INFO, null); cookie.setMaxAge(0); cookie.setPath("/"); response.addCookie(cookie); } } catch (BussinessException e) { ajaxResponse.setErrorMsg(e.getLocalizedMessage()); ajaxResponse.setResponseCode(ResponseCode.BUSSINESSERROR); logger.error("用户登录失败,账号:{}",account); }catch (Exception e) { ajaxResponse.setErrorMsg(ResponseCode.SERVERERROR.getDesc()); ajaxResponse.setResponseCode(ResponseCode.SERVERERROR); logger.error("用户登录失败,账号:{}", account); } return ajaxResponse; } @RequestMapping("findpassword") public String findPassword(){ return "/page/findpassword"; } @ResponseBody @RequestMapping("sendCheckCode") public AjaxResponse<Object> sendCheckCode(String email){ AjaxResponse<Object> ajaxResponse = new AjaxResponse<Object>(); try { userService.sendCheckCode(email); ajaxResponse.setResponseCode(ResponseCode.SUCCESS); } catch (BussinessException e) { ajaxResponse.setErrorMsg(e.getLocalizedMessage()); ajaxResponse.setResponseCode(ResponseCode.BUSSINESSERROR); logger.error("验证码发送失败,邮箱:{}" ); }catch (Exception e) { ajaxResponse.setErrorMsg(ResponseCode.SERVERERROR.getDesc()); ajaxResponse.setResponseCode(ResponseCode.SERVERERROR); logger.error("验证码发送失败,邮箱:{}", email); } return ajaxResponse; } @ResponseBody @RequestMapping("findPassword.do") public AjaxResponse<Object> findPassworddo(String email, String password, String checkcode){ AjaxResponse<Object> ajaxResponse = new AjaxResponse<Object>(); try { userService.modifyPassword(email, password, checkcode); ajaxResponse.setResponseCode(ResponseCode.SUCCESS); } catch (BussinessException e) { ajaxResponse.setErrorMsg(e.getLocalizedMessage()); ajaxResponse.setResponseCode(ResponseCode.BUSSINESSERROR); logger.error("密码修改失败,邮箱{}", email); } catch (Exception e) { ajaxResponse.setErrorMsg(ResponseCode.SERVERERROR.getDesc()); ajaxResponse.setResponseCode(ResponseCode.SERVERERROR); logger.error("密码修改失败,邮箱:{}", email); } return ajaxResponse; } @RequestMapping("logout") public ModelAndView logout(HttpSession session, HttpServletResponse response){ ModelAndView view = new ModelAndView("page/login"); session.invalidate(); Cookie cookie = new Cookie(Constants.COOKIE_USER_INFO, null); cookie.setMaxAge(0); cookie.setPath("/"); response.addCookie(cookie); return view; } }
[ "27708324@qq.com" ]
27708324@qq.com
36ce53f287edc73294ccb2ae1e14e7d777828ec2
3c3bf50ccd778a10b8100e40af8348581d7ba718
/ecomm-web-service/src/main/java/com/nmk/ecomm/web/util/LocationWebUtil.java
1682375d0e4f73cf703a57e539f5374705822b6e
[]
no_license
kumartrigital/Sampleproject
6e56cda5c3a64e046c1aee36e7588855d203f8d6
3e95b439a4adec1e3b86c404979798c9f8717681
refs/heads/master
2022-12-21T07:36:56.522758
2019-07-15T19:58:45
2019-07-15T19:58:45
197,063,395
0
0
null
2022-12-16T08:54:00
2019-07-15T19:55:29
Java
UTF-8
Java
false
false
1,966
java
package com.nmk.ecomm.web.util; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.List; import org.apache.commons.beanutils.BeanUtils; import com.nmk.ecomm.model.Location; import com.nmk.ecomm.web.vo.LocationVO; /** * @author NMK OPT 1 * */ public class LocationWebUtil { public static Location convertLocationVOObjectToLocation(final LocationVO locationVO) { final Location location = new Location(); try { BeanUtils.copyProperties(location, locationVO); } catch (IllegalAccessException e) { // TODO Auto-generated catch block // e.printStackTrace(); new RuntimeException(e); } catch (InvocationTargetException e) { // TODO Auto-generated catch block // e.printStackTrace(); new RuntimeException(e); } return location; } public static LocationVO convertLocationToLocationVO(final Location location) { final LocationVO locationVO = new LocationVO(); try { BeanUtils.copyProperties(locationVO, location); } catch (IllegalAccessException e) { // TODO Auto-generated catch block // e.printStackTrace(); new RuntimeException(e); } catch (InvocationTargetException e) { // TODO Auto-generated catch block // e.printStackTrace(); new RuntimeException(e); } return locationVO; } public static List<LocationVO> convertLocationVOListToLocation(final List<Location> locations) { final List<LocationVO> locationList = new ArrayList<LocationVO>(); try { for (final LocationVO locationVO : locationList) { final LocationVO location = new LocationVO(); BeanUtils.copyProperties(location, locationVO); locationList.add(location); } } catch (IllegalAccessException e) { // TODO Auto-generated catch block // e.printStackTrace(); new RuntimeException(e); } catch (InvocationTargetException e) { // TODO Auto-generated catch block // e.printStackTrace(); new RuntimeException(e); } return locationList; } }
[ "Daya@nmkglobalinc.com" ]
Daya@nmkglobalinc.com
3ab04c968e68145351170b842489905df2d7abe7
cf09c9f83c77cd81709089483d217c377514d1e1
/arwen/src/main/java/com/dm/bizs/sm/domain/model/AppType.java
34f8a7d63438dda443382361521986ee53f2e3e7
[]
no_license
sleeper01/arwen
c5e02f63e14d8e14f860bf333b44da5d94625aa3
deb2052776bbfee0c137267c546cc0c63b373524
refs/heads/master
2016-09-08T01:19:18.357634
2015-06-17T00:06:58
2015-06-17T00:06:58
34,596,347
0
0
null
null
null
null
UTF-8
Java
false
false
3,488
java
/** * */ package com.dm.bizs.sm.domain.model; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.OneToMany; import javax.persistence.Table; import com.dm.common.domain.model.StatusEntity; import com.dm.common.utils.ParamUtils; /** * @author Administrator * */ @Entity @Table(name = "tbl_sm_app_type") public class AppType extends StatusEntity { @Column(unique = true) private String name; @Column private Integer sort; @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "appType") private Set<App> apps = new HashSet<>(); @Column private String iconClass; /** * @return the name */ public String getName() { return name; } /** * @return the sort */ public Integer getSort() { return sort; } /** * @return the apps */ public Set<App> getApps() { return apps; } /** * @return the iconClass */ public String getIconClass() { return iconClass; } /** * @param params */ public void addApp(Map<Object,Object>params){ App app = new App(); app.caseCade(params); this.addApp(app); } /** * @param app */ public void addApp(App app){ if(app != null){ app.setAppType(this); this.apps.add(app); } } /* (non-Javadoc) * @see com.dm.common.domain.model.StatusEntity#toMap() */ @Override public Map<Object, Object> toMap() { Map<Object, Object> res = super.toMap(); res.put("name", this.name); res.put("sort", this.sort); res.put("iconClass", this.iconClass); List<Map<Object,Object>> apps = new ArrayList<>(); for(App app : this.apps){ apps.add(app.toMap()); } res.put("apps", apps); return res; } public Map<Object, Object> toEnableMap() { if(Status.ENABLE.equals(this.getStatus())){ Map<Object, Object> res = super.toMap(); res.put("name", this.name); res.put("sort", this.sort); res.put("iconClass", this.iconClass); List<Map<Object,Object>> apps = new ArrayList<>(); for(App app : this.apps){ Map<Object, Object> _app = app.toEnableMap(); if(_app != null){ apps.add(_app); } } res.put("apps", apps); return res; } return null; } /* (non-Javadoc) * @see com.dm.common.domain.model.StatusEntity#caseCade(java.util.Map) */ @Override public void caseCade(Map<Object, Object> params) { super.caseCade(params); this.setName(ParamUtils.getString(params, "name", "")); this.setSort(ParamUtils.getInteger(params, "sort", 0)); this.setIconClass(ParamUtils.getString(params, "iconClass", "")); } /** * @return */ public AppType pureEntity(Set<App> apps){ AppType type = new AppType(); type.setId(this.getId()); type.setName(this.name); type.setSort(this.sort); type.setIconClass(this.iconClass); type.setApps(apps); return type; } /** * @param name * the name to set */ protected void setName(String name) { this.name = name; } /** * @param sort * the sort to set */ protected void setSort(Integer sort) { this.sort = sort; } /** * @param apps * the apps to set */ protected void setApps(Set<App> apps) { this.apps = apps; } /** * @param iconClass the iconClass to set */ protected void setIconClass(String iconClass) { this.iconClass = iconClass; } }
[ "luyangbin_007@126.com" ]
luyangbin_007@126.com
d0538ae0f59ac58c45bd2d8ade0e7116d663ef88
c730e161f9bcdbf02eb5acc0edb82ac3b89da011
/tutorial25/src/sample/event/Event_03.java
cdd095b85d09484248d17239e177f186db7685b2
[]
no_license
Rick00Kim/Java_Tutorial
53fc13786ea717080bbad812d2a4a9e879cb827e
5b65359eb22804a80021bae66a9830782d9ec90b
refs/heads/master
2021-05-18T15:35:20.293068
2020-07-18T13:50:20
2020-07-18T13:50:20
251,299,799
0
0
null
null
null
null
UHC
Java
false
false
1,688
java
package sample.event; import java.awt.*; import java.awt.event.*; // 3. Listener를 구현하는 방법 class MyAction implements MouseListener{ @Override public void mouseClicked(MouseEvent e) { Button b=(Button)e.getSource(); if(b.getLabel().equals("クリック")){ b.setLabel("클릭"); }else{ b.setLabel("クリック"); } } @Override public void mouseEntered(MouseEvent e) { } @Override public void mouseExited(MouseEvent e) { } @Override public void mousePressed(MouseEvent e) { } @Override public void mouseReleased(MouseEvent e) { } } class Event_03_sub extends Frame{ private Button btn1=new Button("クリック"); public Event_03_sub(String title){ super(title); //프레임의 크기설정 this.setSize(300,200); //프레임을 모니터 정중앙에 배치하는 작업 Dimension screen=Toolkit.getDefaultToolkit().getScreenSize(); Dimension frm=this.getSize(); int x=(int)(screen.getWidth()/2-frm.getWidth()/2); int y=(int)(screen.getHeight()/2-frm.getHeight()/2); this.setLocation(x, y); //프레임의 화면 구성을 설정하는 메서드 init(); //Thread나 Event 처리를 담당하는 메서드 start(); //화면에 표시 this.setResizable(false); this.setVisible(true); } private void init(){ this.setLayout(new GridBagLayout()); // 배치관리자 설정 this.setBackground(Color.blue); btn1.setBackground(Color.green); btn1.setForeground(Color.RED); add(btn1); } private void start(){ btn1.addMouseListener(new MyAction()); } } public class Event_03 { public static void main(String[] ar){ Event_03_sub ex=new Event_03_sub("ActionListener 실습"); } }
[ "dreamx119@gmail.com" ]
dreamx119@gmail.com
93cb6fda5eeb3af7aa1cc68f08ecf5b7dd60805b
4a7f479fb2941421e4e50bda7ab6c887e63570cc
/CompanyCodingTest/src/秋招公司笔试20190727_20190921/快手20190825/Main2.java
8f48c8d06744ffbf83a4349eee4c86741e617c86
[]
no_license
tankhust/Algorithms
348edcd58b63648815b91067285752b21fc421d7
eeb5da642be0e418ba5d0c1a3afcb94a003aae8f
refs/heads/master
2020-08-11T11:34:14.215126
2020-03-04T13:48:12
2020-03-04T13:48:12
165,499,414
0
0
null
null
null
null
UTF-8
Java
false
false
1,174
java
package 秋招公司笔试20190727_20190921.快手20190825; import java.util.HashSet; import java.util.Scanner; import java.util.Set; /** * @author tankInternshipInterview * @create 2019/08/25 16:25 */ public class Main2 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); boolean[] res = new boolean[n]; int a = 0; while (n > 0) { n--; String str = sc.next(); res[a] = false; Set<String> set = new HashSet<>(); while (!set.contains(str)) { set.add(str); char[] chars = str.toCharArray(); int temp = 0; for (int i = 0; i < chars.length; i++) { temp += (chars[i] - '0') * (chars[i] - '0'); } if (temp == 1) { res[a] = true; break; } else { str = String.valueOf(temp); } } a++; } for (int i = 0; i < a; i++) { System.out.println(res[i]); } } }
[ "347477499@qq.com" ]
347477499@qq.com
06cba66c4a8a14932450fef129056db4fd918ad8
84867c3dc09dbbb8694d52a13bede84afb8dfb7f
/pkg_8/PathsTest1.java
d8ef85fe8c5244545c239628d130774de8326490
[]
no_license
mayabay/java_ocp
82a104ff587f8806e5b39ca4b5217fe325c5dac8
de818bb78a961f08f936006ed5c6e90140116f36
refs/heads/master
2021-06-28T19:07:59.103218
2021-06-10T04:25:04
2021-06-10T04:25:04
238,257,180
0
0
null
null
null
null
UTF-8
Java
false
false
1,332
java
/** * BS 9.1.1 */ package pkg_8; import java.net.URI; import java.net.URISyntaxException; import java.nio.file.FileSystem; import java.nio.file.FileSystems; import java.nio.file.Path; import java.nio.file.Paths; import java.util.Iterator; /** * * */ public class PathsTest1 { /** * @param args */ public static void main(String[] args) { PathsTest1 pt1 = new PathsTest1(); pt1.test2(); } private void test1(){ //ConfigObj.IMMO_DATA_PATH Path path = Paths.get( ConfigObj.IMMO_DATA_PATH ); System.out.println( path.getFileName() ); System.out.println( "name elem count = " + path.getNameCount() ); // underlying filesystem FileSystem fs = path.getFileSystem(); System.out.println("seperator in this fs = " + fs.getSeparator() ); // elements of Path Iterator<Path> it = path.iterator(); while( it.hasNext() ) { System.out.println( (it.next()).toString() ); } URI pathAsUri = path.toUri(); System.out.println(pathAsUri); } private void test2() { try { FileSystem fileSystem = FileSystems.getFileSystem(new URI("http://www.selikoff.net")); // RTE // Exception in thread "main" java.nio.file.ProviderNotFoundException: Provider "http" not found Path path = fileSystem.getPath("duck.txt"); } catch (URISyntaxException e) { e.printStackTrace(); } } }
[ "mayabay@web.de" ]
mayabay@web.de
982c0c8cf20ba36a5665bdebaa56832b287f8970
2db3cdccfbba38ed4b33e3096ccf00f804d19792
/app/src/androidTest/java/com/learning/myapplication/ApplicationTest.java
849f453a84ae14fea551504375c44dac955f66c8
[]
no_license
mesmit22/MyApplication
86e18a80e98ad0974b0920954a3f9d184624a85a
77a9fef0096b2613831dea8579bd92d4c3e9c47e
refs/heads/master
2016-09-10T08:20:28.546488
2015-09-02T16:40:27
2015-09-02T16:40:27
41,771,352
0
0
null
null
null
null
UTF-8
Java
false
false
357
java
package com.learning.myapplication; import android.app.Application; import android.test.ApplicationTestCase; /** * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> */ public class ApplicationTest extends ApplicationTestCase<Application> { public ApplicationTest() { super(Application.class); } }
[ "mesmit22@gmail.com" ]
mesmit22@gmail.com
8a8d95bea67bc0669d48a356437738326a389c6f
3b5aa9ba62604230113b311d153de85ac69ad422
/HTTPServer.java
3e07f57ab82da73e3a67d5d699bbf4985dad3cb7
[]
no_license
xhite/webchess
e04f0dc9e95a114ec8a8e7adea1943a968aeb392
85aee18c909e628fb35cb463fe6a617b30bcc400
refs/heads/master
2021-01-01T19:34:53.364572
2013-12-23T10:16:27
2013-12-23T10:16:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,411
java
import java.net.*; import java.io.*; import java.nio.*; import java.nio.channels.*; import java.util.*; public class HTTPServer { private ServerSocket serverSocket; private Socket clientSocket; private BufferedReader in; private BufferedWriter out; private ResponseManager resm; private RequestManager reqm; ChessBoard board; public HTTPServer() throws Exception{ this(12345); } public HTTPServer(String port) throws Exception{ this(Integer.parseInt(port)); } public HTTPServer(int port) throws NumberFormatException, IOException, NoSuchElementException{ System.out.println("Starting server using port: "+ port); serverSocket = new ServerSocket(port); System.out.println("HTTP Server ready!"); board = new ChessBoard(); } public void loadConnection() throws IOException{ start(); System.out.println("receiving data"); String request = readRequest(); System.out.println(request); reqm = new RequestManager(request); resm = new ResponseManager(reqm.requestedFile()); sendHEAD(); System.out.println("sending data"); sendResponse(); System.out.println("data sent"); close(); } private void start() throws IOException{ clientSocket = serverSocket.accept(); in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream())); out = new BufferedWriter(new OutputStreamWriter(clientSocket.getOutputStream())); } private String readRequest() throws IOException{ String line; StringBuilder sb = new StringBuilder(); while((line = in.readLine()) != null){ sb.append(line); sb.append("\n"); if(line.isEmpty()){ break; } } return sb.toString(); } private void sendHEAD() throws IOException{ if (reqm.requestedType() != null){ out.write("HTTP/1.1 200 OK\r\n"); out.write("Content-Type: " + reqm.requestedType() + "\r\n"); out.write("Last-Modified: " + resm.date() + "\r\n"); out.write("\r\n"); } } private void sendResponse() throws IOException { reqm.applyRequestedParams(board); String line = resm.read(); if (line == null) out.write("file does not exist"); else { while(line != null){ out.write(line); out.write("\n"); line = resm.read(); } resm.close(); } } private void close() throws IOException{ out.close(); in.close(); clientSocket.close(); } }
[ "e.greg.bx@gmail.com" ]
e.greg.bx@gmail.com
1b628e20d38e137cba733415ec4615afe2ca9497
a841f4f43a7781c2f8a26432115cc86104e2407d
/engine/api/src/org/apache/cloudstack/storage/command/CreateObjectCommand.java
58e4276f0c8a00125e5eb767d21ff80cb1a14dc0
[]
no_license
liumin0/stockii-invest
246ce2e3c6fba81b78bd844593fdc541c5c47cf7
e13b3579559d278165961da474c2e58ca77be8b3
refs/heads/master
2016-09-06T05:34:32.139111
2014-07-31T15:35:22
2014-07-31T15:35:22
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,964
java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.cloudstack.storage.command; import com.cloud.agent.api.Command; import com.cloud.agent.api.to.DataTO; public final class CreateObjectCommand extends Command implements StorageSubSystemCommand { private DataTO data; private boolean isThick; private boolean isEagerZeroedThick; public CreateObjectCommand(DataTO obj) { super(); this.data = obj; } public CreateObjectCommand(DataTO obj, boolean isThick, boolean isEagerZeroedThick) { super(); this.data = obj; this.isThick = isThick; this.isEagerZeroedThick = isEagerZeroedThick; } public boolean isThick() { return isThick; } public void setThick(boolean isThick) { this.isThick = isThick; } public boolean isEagerZeroedThick() { return isEagerZeroedThick; } public void setEagerZeroedThick(boolean isEagerZeroedThick) { this.isEagerZeroedThick = isEagerZeroedThick; } protected CreateObjectCommand() { super(); } @Override public boolean executeInSequence() { return false; } public DataTO getData() { return this.data; } }
[ "lm382304817@gmail.com" ]
lm382304817@gmail.com
8da9d331227f6b920c23d54b5b91c7b5e2b4da03
04e6de256b81b462053df4e91219b65d8348f7e0
/networkutils/src/main/java/com/pddstudio/networkutils/DiscoveryService.java
1c43c3a9555be5bacc07254ac6a0024da54d9631
[ "Apache-2.0" ]
permissive
Nikhil-z/NetworkUtils
90eab5bea5120ad0cd14ec6ff807d3c9e4097433
635c4edd234861d1582bf9da683fc895cca2daf3
refs/heads/master
2020-12-25T10:50:02.510405
2016-02-25T13:15:50
2016-02-25T13:15:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,041
java
/* * Copyright 2016 Patrick J * * 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.pddstudio.networkutils; import android.content.Context; import android.net.nsd.NsdManager; import android.net.nsd.NsdServiceInfo; import android.support.annotation.NonNull; import android.util.Log; import com.pddstudio.networkutils.enums.DiscoveryType; import com.pddstudio.networkutils.interfaces.DiscoveryCallback; /** * A Service for looking up several discovery types (Avahi/Bonjour/Zeroconf) on a network. */ public class DiscoveryService implements NsdManager.DiscoveryListener { private static final String LOG_TAG = "DiscoveryService"; private final NsdManager nsdManager; private DiscoveryCallback discoveryCallback; protected DiscoveryService(Context context) { this.nsdManager = (NsdManager) context.getSystemService(Context.NSD_SERVICE); } /** * Start looking up for the provided discovery type. The results will be sent to the provided {@link DiscoveryCallback}. * @param serviceType - The discovery type to look for. * @param discoveryCallback - The callback interface. */ public void startDiscovery(@NonNull String serviceType, @NonNull DiscoveryCallback discoveryCallback) { this.discoveryCallback = discoveryCallback; nsdManager.discoverServices(serviceType, NsdManager.PROTOCOL_DNS_SD, DiscoveryService.this); Log.d(LOG_TAG, "startDiscovery() for : " + serviceType); } /** * Start looking up for the provided {@link DiscoveryType}. The results will be sent to the provided {@link DiscoveryCallback}. * @param discoveryType - The discovery type to look for. * @param discoveryCallback - The callback interface. */ public void startDiscovery(@NonNull DiscoveryType discoveryType, @NonNull DiscoveryCallback discoveryCallback) { startDiscovery(discoveryType.getProtocolType(), discoveryCallback); } /** * Stops the service to lookup for network devices with the given service type. */ public void stopDiscovery() { nsdManager.stopServiceDiscovery(DiscoveryService.this); Log.d(LOG_TAG, "stopDiscovery()"); } @Override public void onStartDiscoveryFailed(String serviceType, int errorCode) { Log.d(LOG_TAG, "onStartDiscoveryFailed() : " + serviceType + " error code: " + errorCode); discoveryCallback.onDiscoveryFailed(errorCode); } @Override public void onStopDiscoveryFailed(String serviceType, int errorCode) { Log.d(LOG_TAG, "onStopDiscoveryFailed() : " + serviceType + " error code: " + errorCode); discoveryCallback.onDiscoveryFailed(errorCode); } @Override public void onDiscoveryStarted(String serviceType) { Log.d(LOG_TAG, "onDiscoveryStarted() : " + serviceType); discoveryCallback.onStartDiscovery(); } @Override public void onDiscoveryStopped(String serviceType) { Log.d(LOG_TAG, "onDiscoveryStopped() : " + serviceType); discoveryCallback.onStopDiscovery(); } @Override public void onServiceFound(NsdServiceInfo serviceInfo) { Log.d(LOG_TAG, "onServiceFound() : NAME = " + serviceInfo.getServiceName() + " TYPE = " + serviceInfo.getServiceType()); discoveryCallback.onServiceFound(serviceInfo); } @Override public void onServiceLost(NsdServiceInfo serviceInfo) { Log.d(LOG_TAG, "onServiceLost() : " + serviceInfo); discoveryCallback.onServiceLost(serviceInfo); } }
[ "patrick.pddstudio@googlemail.com" ]
patrick.pddstudio@googlemail.com
fb54422f8247b12c41c66194bb456086c57cd81c
30f38c44213d3de5bc9843a550f35545c5d3a9a3
/src/main/java/rd/com/migraciondb/Migrador.java
4c4a17741b0ba8dfa0a69b1ede3c59de08b9e871
[]
no_license
RD-Huma/migraciondb
b018002651ab91beec2281bdc46bc0330d863d1d
ead59efb0c8de46cf8f4311d61c6f8d20e2bfced
refs/heads/master
2021-01-10T20:36:12.942800
2015-01-09T22:17:00
2015-01-09T22:17:00
29,021,085
0
0
null
null
null
null
UTF-8
Java
false
false
1,396
java
package rd.com.migraciondb; import java.io.IOException; import java.nio.charset.Charset; import java.nio.file.Files; import java.nio.file.Path; import java.sql.Connection; import java.sql.SQLException; import java.util.Set; class Migrador { public void migrar(Configuracion configuracion){ try (Connection conexion = configuracion.getDataSourceDB().activarConexion()){ if (!new VerificadorExisteTabla(configuracion).existe()){ new CreadorTabla(configuracion).crearTabla(); } } catch (SQLException e) { throw new MigracionDBException(e); } BuscarRecursos buscarRecursos = new BuscarRecursos(configuracion.getPrefijoCarpeta()); Set<Path> recursosEncontrados = buscarRecursos.buscar(); Set<Path> recursosFiltrados; try (Connection conexion = configuracion.getDataSourceDB().activarConexion()){ FiltradorQueryEjecutados filtrado = new FiltradorQueryEjecutados(recursosEncontrados, configuracion) ; recursosFiltrados = filtrado.filtrar(); } catch (SQLException e) { throw new MigracionDBException(e); } try (Connection conexion = configuracion.getDataSourceDB().activarConexion()){ for (Path path : recursosFiltrados) { SqlRunner runner = new SqlRunner(conexion); runner.runScript(Files.newBufferedReader(path,Charset.defaultCharset())); } } catch (SQLException | IOException e) { throw new MigracionDBException(e); } } }
[ "depende@gmail.com" ]
depende@gmail.com
50d0bf10b93a6f8777da0ebac2954b97fcc19c4d
e6d0ef4bef4db043e728fe56d8385f310a446d4c
/src/main/java/com/cienet/flyweight/UnsharedConcreteFlyweight.java
00cb2aba5ce34292500a333057fcc9643388beb9
[]
no_license
shixiangzhao/DesignPattern
ecbe2076c755e1c5f65908a528d93a5fa2963ced
8b85a92c5bae139beb80821f9d04bafa09b45f27
refs/heads/master
2018-12-08T11:41:28.443749
2018-09-15T08:42:53
2018-09-15T08:42:53
61,113,706
0
0
null
null
null
null
UTF-8
Java
false
false
329
java
package com.cienet.flyweight; /** * class: UnsharedConcreteFlyweight <br> * * @author: ZhaoShixiang <br> * @date: 2018/9/12 16:07 */ public class UnsharedConcreteFlyweight extends Flyweight { @Override public void operation(int state) { System.out.println(this.getClass().getName() + ": " + state); } }
[ "zhaoshixiang@bingofresh.com" ]
zhaoshixiang@bingofresh.com
62cd1545078b6621f070408d930ef9790e6e92c5
47007337b767e47f9e8eba9b8f57468951f31f5b
/src/main/java/fr/benezid/poilvet/PoilvetQ/PoilvetQApplication.java
6e70eab2213e5850535a9cd9f4163f7ad9793ebd
[]
no_license
yannbaizid/qpoilvet.back
b43de4befe7797de1a1fd1d9ed42d98c0e612c16
6a8e51509da4f8e5b11ab6789c88b10643a22aa2
refs/heads/main
2023-06-27T16:11:03.762567
2021-07-25T15:30:22
2021-07-25T15:30:22
364,570,988
0
0
null
null
null
null
UTF-8
Java
false
false
324
java
package fr.benezid.poilvet.PoilvetQ; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class PoilvetQApplication { public static void main(String[] args) { SpringApplication.run(PoilvetQApplication.class, args); } }
[ "yanbaizid35@gmail.com" ]
yanbaizid35@gmail.com
f43c92741885668ac28978e8ab397093534f32d2
a2ac3d4175932200b1a79e069e845684ad1f2f26
/nanofix-server/src/test/data/net/nanofix/session/TestMessageFactory.java
907bac35d686220083cfb67438a3bfe2606feb80
[ "Apache-2.0" ]
permissive
subnano/nanofix
dbf3072d7a81fe968771795bd9fbb3c67e6de565
a7b9bca8da5fe5df1254a88ca816215251805570
refs/heads/master
2022-02-16T05:58:28.560958
2020-10-14T04:55:05
2020-10-14T04:55:05
135,675,459
0
0
Apache-2.0
2022-02-01T00:55:59
2018-06-01T06:14:47
Java
UTF-8
Java
false
false
562
java
package net.nanofix.session; import net.nanofix.config.SessionConfig; import net.nanofix.message.DefaultFIXMessageFactory; import net.nanofix.message.FIXMessage; public class TestMessageFactory extends DefaultFIXMessageFactory { private int outboundSeqNum = 0; public TestMessageFactory(SessionConfig sessionConfig) { super(sessionConfig); } @Override public FIXMessage createMessage(String msgType) { FIXMessage msg = super.createMessage(msgType); msg.setMsgSeqNum(++outboundSeqNum); return msg; } }
[ "mark@knoxroad.net" ]
mark@knoxroad.net
7b82189c659efcec7bf694bd01d9a01efa6f4f73
768ac7d2fbff7b31da820c0d6a7a423c7e2fe8b8
/WEB-INF/java/com/youku/search/index/query/parser/ParserResult.java
dcf2e9aea5d457b4445c8708ad3f8143290614ba
[]
no_license
aiter/-java-soku
9d184fb047474f1e5cb8df898fcbdb16967ee636
864b933d8134386bd5b97c5b0dd37627f7532d8d
refs/heads/master
2021-01-18T17:41:28.396499
2015-08-24T06:09:21
2015-08-24T06:09:21
41,285,373
0
0
null
2015-08-24T06:08:00
2015-08-24T06:08:00
null
UTF-8
Java
false
false
997
java
package com.youku.search.index.query.parser; import java.util.HashMap; import java.util.Iterator; public class ParserResult { private String keyword = null; private HashMap<String,String> result = new HashMap<String,String>(); public void setAttribute(String field,String value){ result.put(field, value); } public String getValue(String field){ return result.get(field); } public boolean contains(String field){ return result.containsKey(field); } public String getKeyword(){ return keyword; } public void setKeyword(String word){ this.keyword = word; } public String toString(){ StringBuilder builder = new StringBuilder(); if (keyword != null) builder.append("keyword = " + keyword); Iterator<String> it = result.keySet().iterator(); while (it.hasNext()){ String key = it.next(); builder.append(key); builder.append("\t"); builder.append(result.get(key)); } return builder.toString(); } }
[ "lyu302@gmail.com" ]
lyu302@gmail.com
4dfd29c722143368df66406709390748aed30a70
c2e62ee4a2e419a22ac539ef4180b7a5969e80ce
/src/main/java/cz/tournament/control/domain/Team.java
8b97dfde5f3f44ac47c2811e0b9a17452a7f42bd
[]
no_license
kralp/TournamentControl
7fed2d1fc6bd505904cbe9ccc1e6894996e28fe2
1aedb2f7a0d82e27a865c515253990ee263f2fee
refs/heads/master
2020-06-03T09:34:36.618598
2018-03-12T12:33:46
2018-03-12T12:33:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,718
java
package cz.tournament.control.domain; import java.io.Serializable; import java.util.HashSet; import java.util.Objects; import java.util.Set; import javax.persistence.*; import javax.validation.constraints.*; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; /** * A Team. */ @Entity @Table(name = "team") @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) public class Team implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @NotNull @Column(name = "name", nullable = false) private String name; @Column(name = "note") private String note; @ManyToOne private User user; @ManyToMany(fetch = FetchType.EAGER) @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) @JoinTable(name = "team_members", joinColumns = @JoinColumn(name="teams_id", referencedColumnName="id"), inverseJoinColumns = @JoinColumn(name="members_id", referencedColumnName="id")) private Set<Player> members = new HashSet<>(); public Team() { } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public Team name(String name) { this.name = name; return this; } public void setName(String name) { this.name = name; } public String getNote() { return note; } public Team note(String note) { this.note = note; return this; } public void setNote(String note) { this.note = note; } public User getUser() { return user; } public Team user(User user) { this.user = user; return this; } public void setUser(User user) { this.user = user; } public Set<Player> getMembers() { return members; } public Team members(Set<Player> players) { this.members = players; return this; } public Team addMembers(Player player) { this.members.add(player); player.getTeams().add(this); // player.addTeams(this); return this; } public Team removeMembers(Player player) { this.members.remove(player); player.getTeams().remove(this); // player.removeTeams(this); return this; } public void setMembers(Set<Player> players) { this.members = players; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Team team = (Team) o; if(this.id == null || team.getId() == null){ return false; } // if(this.id != null && team.getId() != null){ // return Objects.equals(this.id,team.getId()); // } return Objects.equals(this.name,team.getName()) && Objects.equals(this.user,team.getUser()) && Objects.equals(this.id,team.getId()); } @Override public int hashCode() { return Objects.hashCode(id); } @Override public String toString() { String members = ""; for (Player member : this.getMembers()) { members = members + "("+ member.getId() +", "+ member.getName()+"), "; } return "Team{" + "id=" + id + ", name='" + name + "'" + ", note='" + note + "'" + ", members=[" + members + "]" + '}'; } }
[ "karolina.bozkova@gmail.com" ]
karolina.bozkova@gmail.com
a2ff4fb42da753ebd1a1c15ecbda080d1eaa0fb6
e0951f0c08fb24ce57d5b6fb3f364e314e94ac67
/demo/2016.03.16-java/HelloWorld.java
60a4043be9b44f3aeeb8508da9ce1b21bda1d494
[]
no_license
chyingp/blog
1a69ddcd8acbcf20c80995d274e81450c278f32f
4fcfd719ed01f446d8f1eea721551e71db4909cf
refs/heads/master
2023-08-27T00:23:18.260234
2023-07-27T15:50:03
2023-07-27T15:50:03
9,654,619
491
279
null
2023-01-12T23:53:47
2013-04-24T18:17:08
null
UTF-8
Java
false
false
107
java
public class HelloWorld{ public static void main(String []args){ System.out.println("hello world"); } }
[ "chyingp@gmail.com" ]
chyingp@gmail.com
88da7fb52bc87251a857593b684f78bdf90edb5a
92dd6bc0a9435c359593a1f9b309bb58d3e3f103
/src/LeetcodeTemplate/_0277FindCelebrity.java
0c0c0944298dc57705e5ade4ba7fb150ce1c2582
[ "MIT" ]
permissive
darshanhs90/Java-Coding
bfb2eb84153a8a8a9429efc2833c47f6680f03f4
da76ccd7851f102712f7d8dfa4659901c5de7a76
refs/heads/master
2023-05-27T03:17:45.055811
2021-06-16T06:18:08
2021-06-16T06:18:08
36,981,580
3
3
null
null
null
null
UTF-8
Java
false
false
254
java
package LeetcodeTemplate; public class _0277FindCelebrity { public static void main(String[] args) { System.out.println(findCelebrity(3)); } static boolean knows(int a, int b) { return true; } public static int findCelebrity(int n) { } }
[ "hsdars@gmail.com" ]
hsdars@gmail.com
de72adc03fb430be47ebe17317e147058e3a8d5d
73de027ffd50d767b4c69a5e7665136b6cd9a8f4
/src/main/java/com/sam_solutions/ealys/dto/TransientUserDTO.java
35e4d184e11c349ef85aab6b0aa41e41c8581abd
[]
no_license
AbstractElement/EalysProject
ea69ee304985394eee4150333bbbda8e3e1500dd
bfe9f3f44f480090b39c49e38e370c874f0ecd4e
refs/heads/master
2021-09-05T14:04:06.547568
2018-01-28T14:38:53
2018-01-28T14:38:53
119,264,346
0
1
null
null
null
null
UTF-8
Java
false
false
1,241
java
package com.sam_solutions.ealys.dto; import lombok.Data; import org.hibernate.validator.constraints.Email; import org.hibernate.validator.constraints.NotEmpty; import org.springframework.validation.FieldError; import javax.validation.constraints.Size; import java.util.ArrayList; import java.util.List; /** * Class for storing TransientUserDTO obejct. */ @Data public class TransientUserDTO { /** * Username */ @Size(min = 4, max = 25) private String username; /** * User email */ @Email @NotEmpty @Size(max = 40) private String email; /** * User first name */ @Size(min = 2, max = 45) private String firstName; /** * User second name */ @Size(min = 2, max = 45) private String lastName; /** * User password */ @Size(min = 8, max = 20) private String password; /** * Repeated user password */ @Size(min = 8, max = 20) private String repeatedPassword; /** * User sex */ @NotEmpty private String sex; /** * User avatar */ private String photo; /** * User validation errors */ private List<FieldError> errors = new ArrayList<>(); }
[ "vladislavtretyak@bk.ru" ]
vladislavtretyak@bk.ru
81b50a7a83362003cb347a29bc04729485080187
c52f0439fabff2d0b4a233ccbe3839ed4bc3b386
/src/test/java/com/exsoloscript/challonge/guice/ChallongeTestModule.java
0b7ea2bb875aeacd966c36a2918ec0c0635d4a78
[ "Apache-2.0" ]
permissive
byvlstr/challonge-java
f88f4dc18b7ac1fe108b1aa519b2f181b20ea245
a0d09be33c7657a4a5e4176e656867d934693b27
refs/heads/master
2021-05-06T20:43:46.981252
2017-10-30T12:50:35
2017-10-30T12:50:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
372
java
package com.exsoloscript.challonge.guice; import com.exsoloscript.challonge.ChallongeApi; import com.exsoloscript.challonge.ChallongeTestSuite; import com.google.inject.AbstractModule; public class ChallongeTestModule extends AbstractModule { @Override protected void configure() { bind(ChallongeApi.class).toProvider(ChallongeTestSuite.class); } }
[ "stefangeyer@outlook.com" ]
stefangeyer@outlook.com
c4ec8bb301f7bb87da952669d8b4d2bc95d6b473
f8f07ed46e6bb8b1323b2b817bc881159eae6c06
/demo-nacos/src/main/java/com/cloud/DemoNacosApplication.java
95e770b639693bf5726c1f7f6fc27b4bf8849994
[]
no_license
gjguanjie/demo-view
a1827154cea8256c9dc44b56fa7cc9169d40a6f9
4bd067fa1e8be08048f8c609359e6215ff844022
refs/heads/master
2022-06-28T07:35:59.667703
2020-04-30T07:51:26
2020-04-30T07:51:26
242,283,495
0
0
null
null
null
null
UTF-8
Java
false
false
416
java
package com.cloud; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; @EnableDiscoveryClient @SpringBootApplication public class DemoNacosApplication { public static void main(String[] args) { SpringApplication.run(DemoNacosApplication.class, args); } }
[ "guanjie0123" ]
guanjie0123
0aca3ccfb27b971dfa87502cef3412c037036fc1
c3f7c384748f46ab76d88aea973f406a95abe5fb
/app/src/main/java/com/example/djsni/studievolg_1/vak.java
45b427401e1dbcbc8dd2e0fdece8895025f6b221
[]
no_license
rahuls01/IKPMD
5beab99de16b867b9b1f42846838a2af57c74862
d16a8be8b17277db143374010e155a362997b377
refs/heads/master
2020-03-20T02:40:25.902021
2018-06-18T19:16:12
2018-06-18T19:16:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
854
java
package com.example.djsni.studievolg_1; public class vak { String Module, Studiepunten, Omschrijving; int id; public vak() { } public vak(String Module, String Studiepunten, String Omschrijving , int id) { this.Module = Module; this.Studiepunten = Studiepunten; this.Omschrijving = Omschrijving; this.id = id ; }; public String getName() { return this.Module; } public int getid() { return this.id; } public String getec() { return this.Studiepunten; } public String getdescription() { return this.Omschrijving; } public String toString() { return "Module: " + this.Module + "\nOmschrijving : " + this.Omschrijving + "\nStudiepunten : " + this.Studiepunten ; } }
[ "rr_sharma@icloud.com" ]
rr_sharma@icloud.com
8cf3267511569b5974ce8e3dbd99a98a3e470ff1
49eef0472702d2e137a82cbd976d8486626c8b96
/src/main/java/animals/Polymorphism.java
6009c7cebca32622747515546283fcd1d10e2ac9
[]
no_license
KybaS/AcademiaJava
a3ae6ee81ba24631196d7968f875afb5ea231162
49783a4cd2de45192e6ef70cc2c837bdcc984e92
refs/heads/master
2021-07-07T10:02:00.184772
2019-02-09T09:52:05
2019-02-09T09:52:05
138,509,627
0
0
null
null
null
null
UTF-8
Java
false
false
662
java
package animals; public class Polymorphism { public static void main(String[] args) { Animal[] animals = new Animal[3]; animals[0] = new Animal(); animals[1] = new Cat(); animals[2] = new Octopus(); for (Animal animal: animals){ animal.sayHello(); } Animal animal = new Animal(); Animal cat = new Cat(); Animal octopus = new Octopus(); isPresentTail(animal); isPresentTail(cat); isPresentTail(octopus); } private static void isPresentTail(Animal animals){ System.out.println("Displays animal: "); animals.tail(); } }
[ "ksv@evogence.com" ]
ksv@evogence.com
22ab3f950981b7ddb990888d5cb51471b79c1695
111e8104a953d08487f67048a7f70c7236a8088f
/src/main/java/com/annakondratenko/app/classwork/Lesson2/NarrowingCasting.java
e2d3d3a9e9d4696c5dcc7aaac537a4c762a92310
[]
no_license
annakondratenko/javacore
0bf5f1fa3350d3d7a19e5b4106ca7a9d413ada01
abb2a6259d78a33c7e93b8860aa5ef2f203ef448
refs/heads/master
2021-01-11T20:10:52.978226
2019-05-26T18:19:43
2019-05-26T18:19:43
79,059,411
0
0
null
2020-10-12T22:12:31
2017-01-15T21:02:06
Java
UTF-8
Java
false
false
288
java
package com.annakondratenko.app.classwork.Lesson2; /** * Created by annak on 19.01.2017. */ public class NarrowingCasting { int int1; float float1; public int narrowing(float fVar){ int1 = (int) fVar; System.out.println(int1); return int1; } }
[ "annakondratenko1210@gmail.com" ]
annakondratenko1210@gmail.com
a12bcd0aa655e189fdad57d8a9ed4c891c9b3cbf
a9416e5b6055504fe1b2e6a673de37da7ae1afc6
/src/main/java/com/cinlogic/jwtexampleserver/services/dtos/UpdateAccountRequest.java
c210ddddbb6427b8e915bf3f102872c4b1b12e1c
[ "Apache-2.0" ]
permissive
brianpursley/jwt-example-server
55d87e6d2bcd1699100dac5ea6e178406dfd62e9
f4b0f413b72fe4e1e6ef5b7da5d9755e8d911de1
refs/heads/master
2022-12-13T17:58:17.800980
2020-09-17T15:12:18
2020-09-17T15:12:18
296,185,416
0
0
null
null
null
null
UTF-8
Java
false
false
438
java
package com.cinlogic.jwtexampleserver.services.dtos; public class UpdateAccountRequest { private String username; private String email; public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } }
[ "bpursley@cinlogic.com" ]
bpursley@cinlogic.com
98d7a6cb324717a61f9c9e4b29f283b001bdf8bb
166b6f4d0a2a391b7d05f6ddd245f1eb9dbce9f4
/spring/RetailSvc/.svn/pristine/98/98d7a6cb324717a61f9c9e4b29f283b001bdf8bb.svn-base
b64bedadc17eef136a9b6678da705012dc958a3c
[]
no_license
ashismo/repositoryForMyBlog
72690495fb5357e5235776d143e60582881cb99a
f6bc2f6b57382fdc732ac477733aa0e7feb69cbb
refs/heads/master
2023-03-11T17:28:41.943846
2023-02-27T12:59:08
2023-02-27T12:59:08
35,325,045
2
27
null
2022-12-16T04:26:05
2015-05-09T10:47:17
Java
UTF-8
Java
false
false
3,284
package com.org.coop.retail.entities; import static com.mysema.query.types.PathMetadataFactory.*; import com.mysema.query.types.path.*; import com.mysema.query.types.PathMetadata; import javax.annotation.Generated; import com.mysema.query.types.Path; import com.mysema.query.types.path.PathInits; /** * QGlLedgerHrd is a Querydsl query type for GlLedgerHrd */ @Generated("com.mysema.query.codegen.EntitySerializer") public class QGlLedgerHrd extends EntityPathBase<GlLedgerHrd> { private static final long serialVersionUID = 93628224L; private static final PathInits INITS = PathInits.DIRECT2; public static final QGlLedgerHrd glLedgerHrd = new QGlLedgerHrd("glLedgerHrd"); public final DatePath<java.util.Date> actionDate = createDate("actionDate", java.util.Date.class); public final QBranchMaster branchMaster; public final DateTimePath<java.sql.Timestamp> createDate = createDateTime("createDate", java.sql.Timestamp.class); public final StringPath createUser = createString("createUser"); public final StringPath deleteInd = createString("deleteInd"); public final StringPath deleteReason = createString("deleteReason"); public final StringPath fy = createString("fy"); public final ListPath<GlLedgerDtl, QGlLedgerDtl> glLedgerDtls = this.<GlLedgerDtl, QGlLedgerDtl>createList("glLedgerDtls", GlLedgerDtl.class, QGlLedgerDtl.class, PathInits.DIRECT2); public final NumberPath<Integer> glTranId = createNumber("glTranId", Integer.class); public final StringPath passingAuthInd = createString("passingAuthInd"); public final StringPath passingAuthRemark = createString("passingAuthRemark"); public final ListPath<RetailTransaction, QRetailTransaction> retailTransactions = this.<RetailTransaction, QRetailTransaction>createList("retailTransactions", RetailTransaction.class, QRetailTransaction.class, PathInits.DIRECT2); public final StringPath tranNo = createString("tranNo"); public final ListPath<TransactionPayment, QTransactionPayment> transactionPayments = this.<TransactionPayment, QTransactionPayment>createList("transactionPayments", TransactionPayment.class, QTransactionPayment.class, PathInits.DIRECT2); public final StringPath tranType = createString("tranType"); public final DateTimePath<java.sql.Timestamp> updateDate = createDateTime("updateDate", java.sql.Timestamp.class); public final StringPath updateUser = createString("updateUser"); public QGlLedgerHrd(String variable) { this(GlLedgerHrd.class, forVariable(variable), INITS); } public QGlLedgerHrd(Path<? extends GlLedgerHrd> path) { this(path.getType(), path.getMetadata(), path.getMetadata().isRoot() ? INITS : PathInits.DEFAULT); } public QGlLedgerHrd(PathMetadata<?> metadata) { this(metadata, metadata.isRoot() ? INITS : PathInits.DEFAULT); } public QGlLedgerHrd(PathMetadata<?> metadata, PathInits inits) { this(GlLedgerHrd.class, metadata, inits); } public QGlLedgerHrd(Class<? extends GlLedgerHrd> type, PathMetadata<?> metadata, PathInits inits) { super(type, metadata, inits); this.branchMaster = inits.isInitialized("branchMaster") ? new QBranchMaster(forProperty("branchMaster")) : null; } }
[ "ashishkrmondal@gmail.com" ]
ashishkrmondal@gmail.com
9e0a34b061be63d28eb22fc389e4e7823fb9a226
326b2d92e2369145df079fb9c528e2a857d2c11a
/test/java/com/felix/interview/leetcode/medium/string/OneEditDistanceTest.java
ab15d98bc3b11764b8588d412fa66389edd7d90d
[]
no_license
felixgao/interview
1df414f21344e02219f16b1ca7966e61fe6cba77
0593fa2a3dff759f93a379cee34a29ab80711cc2
refs/heads/master
2021-01-18T16:50:11.641731
2019-02-05T16:59:43
2019-02-05T16:59:43
86,773,709
0
0
null
null
null
null
UTF-8
Java
false
false
704
java
package com.felix.interview.leetcode.medium.string; import org.junit.Test; import static java.lang.System.out; /** * Created by felix on 3/25/17. */ public class OneEditDistanceTest { OneEditDistance o = new OneEditDistance(); @Test public void test1(){ out.println(o.isOneEditDistance("ab", "abcd")); out.println(o.isOneEditDistance("abcd", "ab")); } @Test public void test2(){ out.println(o.isOneEditDistance("abc", "abcd")); out.println(o.isOneEditDistance("abcd", "abc")); } @Test public void test3(){ out.println(o.isOneEditDistance("abd", "abcd")); out.println(o.isOneEditDistance("abcd", "abd")); } }
[ "felix@Felix-MBP.local" ]
felix@Felix-MBP.local
da6c17c77c9c5831196e3865791b73d7b678afdd
04f47fc49f2de088bcdb906dc6dcd86202a88e57
/app/src/main/java/ru/pavelivanov/develop/cryptocurrency_app/domain/remote/Repository.java
53df90b96d16282dc2a657c0c8131d6fe275c5e8
[]
no_license
goaliepash/crypto_currency_app
829d756dfbde3d05cfc2f561d03862439d7e82ba
8644ccacc04dc8d298efd4790a00b3487c74d3f8
refs/heads/master
2020-09-11T04:11:13.657928
2019-12-15T16:48:16
2019-12-15T16:48:16
221,934,803
0
0
null
null
null
null
UTF-8
Java
false
false
1,749
java
package ru.pavelivanov.develop.cryptocurrency_app.domain.remote; import retrofit2.Call; import ru.pavelivanov.develop.cryptocurrency_app.data.api.CryptoApi; import ru.pavelivanov.develop.cryptocurrency_app.data.pojo.listing_latest_response.ListingLatestResponse; import ru.pavelivanov.develop.cryptocurrency_app.data.pojo.price_conversion_response.PriceConversionResponse; public class Repository { private CryptoApi api; public Repository(CryptoApi api) { this.api = api; } /** * Получить последние котировки криптовалют. * * @param apiKey уникальный API-ключ * @param start с какой позиции в списке получать данные * @param limit сколько всего элементов будет в списке * @param sort по какому критерию будут отсортированы данные * @return Список котировок криптовалют */ public Call<ListingLatestResponse> getListingLatest(String apiKey, int start, int limit, String sort, String sortDir) { return api.getListingLatest(apiKey, start, limit, sort, sortDir); } /** * Получить конвертированную стоимость. * * @param apiKey API-ключ * @param id ID криптовалюты * @param amount количество * @param convert выбранная валюта * @return ответ от web-сервиса */ public Call<PriceConversionResponse> getPriceConversion(String apiKey, int id, double amount, String convert) { return api.getPriceConversion(apiKey, id, amount, convert); } }
[ "Ivanov.Pav.Ale@sberbank.ru" ]
Ivanov.Pav.Ale@sberbank.ru
60a3df57e6f441fe5f01d4b946e3c9c454ea778d
b39d7e1122ebe92759e86421bbcd0ad009eed1db
/sources/android/app/WaitResult.java
f7f30924bc99e61b5abb331c01bd85af48656a1a
[]
no_license
AndSource/miuiframework
ac7185dedbabd5f619a4f8fc39bfe634d101dcef
cd456214274c046663aefce4d282bea0151f1f89
refs/heads/master
2022-03-31T11:09:50.399520
2020-01-02T09:49:07
2020-01-02T09:49:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,649
java
package android.app; import android.content.ComponentName; import android.os.Parcel; import android.os.Parcelable; import android.os.Parcelable.Creator; import java.io.PrintWriter; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; public class WaitResult implements Parcelable { public static final Creator<WaitResult> CREATOR = new Creator<WaitResult>() { public WaitResult createFromParcel(Parcel source) { return new WaitResult(source, null); } public WaitResult[] newArray(int size) { return new WaitResult[size]; } }; public static final int INVALID_DELAY = -1; public static final int LAUNCH_STATE_COLD = 1; public static final int LAUNCH_STATE_HOT = 3; public static final int LAUNCH_STATE_WARM = 2; public int launchState; public int result; public boolean timeout; public long totalTime; public ComponentName who; @Retention(RetentionPolicy.SOURCE) public @interface LaunchState { } /* synthetic */ WaitResult(Parcel x0, AnonymousClass1 x1) { this(x0); } public int describeContents() { return 0; } public void writeToParcel(Parcel dest, int flags) { dest.writeInt(this.result); dest.writeInt(this.timeout); ComponentName.writeToParcel(this.who, dest); dest.writeLong(this.totalTime); dest.writeInt(this.launchState); } private WaitResult(Parcel source) { this.result = source.readInt(); this.timeout = source.readInt() != 0; this.who = ComponentName.readFromParcel(source); this.totalTime = source.readLong(); this.launchState = source.readInt(); } public void dump(PrintWriter pw, String prefix) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append(prefix); stringBuilder.append("WaitResult:"); pw.println(stringBuilder.toString()); stringBuilder = new StringBuilder(); stringBuilder.append(prefix); stringBuilder.append(" result="); stringBuilder.append(this.result); pw.println(stringBuilder.toString()); stringBuilder = new StringBuilder(); stringBuilder.append(prefix); stringBuilder.append(" timeout="); stringBuilder.append(this.timeout); pw.println(stringBuilder.toString()); stringBuilder = new StringBuilder(); stringBuilder.append(prefix); stringBuilder.append(" who="); stringBuilder.append(this.who); pw.println(stringBuilder.toString()); stringBuilder = new StringBuilder(); stringBuilder.append(prefix); stringBuilder.append(" totalTime="); stringBuilder.append(this.totalTime); pw.println(stringBuilder.toString()); stringBuilder = new StringBuilder(); stringBuilder.append(prefix); stringBuilder.append(" launchState="); stringBuilder.append(this.launchState); pw.println(stringBuilder.toString()); } public static String launchStateToString(int type) { if (type == 1) { return "COLD"; } if (type == 2) { return "WARM"; } if (type == 3) { return "HOT"; } StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("UNKNOWN ("); stringBuilder.append(type); stringBuilder.append(")"); return stringBuilder.toString(); } }
[ "shivatejapeddi@gmail.com" ]
shivatejapeddi@gmail.com
7492cc165b7d2cec3152a9cbd567f9a93a3a26b2
a4b9bcf602647bf48a5412ad0f7d274b1bb147a9
/DesignPattern/factory/pizzafm/ChicagoStyleVeggiePizza.java
415c38664da0c0163dd3c1452a7521a8f42834c3
[]
no_license
huangketsudou/javalearning
5680884584771b6c9a9fb1ba5838824cd0ebb550
6a5b751e50007702641d14588cb90c0ea0ca0f4c
refs/heads/master
2022-11-10T14:50:08.716494
2020-06-25T09:12:02
2020-06-25T09:12:02
264,204,472
0
0
null
null
null
null
UTF-8
Java
false
false
517
java
package DesignPattern.factory.pizzafm; public class ChicagoStyleVeggiePizza extends Pizza { public ChicagoStyleVeggiePizza() { name = "Chicago Deep Dish Veggie Pizza"; dough = "Extra Thick Crust Dough"; sauce = "Plum Tomato Sauce"; toppings.add("Shredded Mozzarella Cheese"); toppings.add("Black Olives"); toppings.add("Spinach"); toppings.add("Eggplant"); } void cut() { System.out.println("Cutting the pizza into square slices"); } }
[ "1941161938@qq.com" ]
1941161938@qq.com
cdc3ef19ab79945a14f7eadde1f4eb014a0d60b4
7a8f609ac709327b6a129df40ac8c268b419c1fe
/src/problem3/Solution.java
6d0f0e9f183c537b6bd9e0e0eca9fb76b4508cc8
[]
no_license
aayu3/LeetCodeSolutions
f2dd2e206eb54fd98cbb4a82c0cbb5cc8094acc1
89335a3e639813786423d8e4501719df8ba459e9
refs/heads/master
2022-12-05T01:25:44.092248
2020-08-13T21:17:38
2020-08-13T21:17:38
276,211,662
0
0
null
null
null
null
UTF-8
Java
false
false
684
java
package problem3; import java.util.*; class Solution { public static void main(String[] args) { System.out.println(lengthOfLongestSubstring("au")); } public static int lengthOfLongestSubstring(String s) { char[] str = s.toCharArray(); int longest = 0; Map<Character, Integer> lastPos = new HashMap<>(); int leftIndex = 0; for (int i = 0; i < str.length; i++) { if (lastPos.containsKey(str[i])) { leftIndex = Math.max(lastPos.get(str[i]),leftIndex); } longest = Math.max(longest, i - leftIndex); lastPos.put(str[i],i); } return longest; } }
[ "aaronyu3@illinois.edu" ]
aaronyu3@illinois.edu
37bddf442852c086bf4b1fdf888dc667dcc8b81a
2d4f8a262c92c6864a3a243fc1dcd34989f38a76
/hybris/bin/custom/tm/tmstorefront/web/src/com/tm/storefront/interceptors/beforecontroller/SecurityUserCheckBeforeControllerHandler.java
9a2f4abbb42887441c83ffe01913681289f70f63
[]
no_license
ianilprasad/TM
201f9e3d0eabee99bc736dbb2cb6ef3606b36207
28493a76e81d9dc1c247ac2bb59e64cc53203db4
refs/heads/master
2020-04-04T17:52:42.348824
2018-11-05T01:05:36
2018-11-05T01:05:36
156,140,005
0
0
null
null
null
null
UTF-8
Java
false
false
4,464
java
/* * [y] hybris Platform * * Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved. * * This software is the confidential and proprietary information of SAP * ("Confidential Information"). You shall not disclose such Confidential * Information and shall use it only in accordance with the terms of the * license agreement you entered into with SAP. */ package com.tm.storefront.interceptors.beforecontroller; import de.hybris.platform.acceleratorcms.services.CMSPageContextService; import de.hybris.platform.acceleratorstorefrontcommons.interceptors.BeforeControllerHandler; import de.hybris.platform.core.model.user.UserModel; import de.hybris.platform.servicelayer.time.TimeService; import de.hybris.platform.servicelayer.user.UserService; import java.io.IOException; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.log4j.Logger; import org.springframework.security.core.Authentication; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.web.method.HandlerMethod; /** * Spring MVC interceptor that validates that the spring security user and the hybris session user are in sync. If the * spring security user and the hybris session user are not in sync then the session is invalidated and the visitor is * redirect to the homepage. */ public class SecurityUserCheckBeforeControllerHandler implements BeforeControllerHandler { private static final Logger LOG = Logger.getLogger(SecurityUserCheckBeforeControllerHandler.class); private static final String LOGOUT_TRUE_CLOSE_ACC_TRUE = "/?logout=true&closeAcc=true"; private static final String REDIRECT_PATH = "/"; @Resource(name = "userService") private UserService userService; @Resource(name = "cmsPageContextService") private CMSPageContextService cmsPageContextService; @Resource(name = "timeService") private TimeService timeService; @Override public boolean beforeController(final HttpServletRequest request, final HttpServletResponse response, final HandlerMethod handler) throws IOException { // Skip this security check when run from within the WCMS Cockpit if (isPreviewDataModelValid(request)) { return true; } final Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if (authentication != null) { final Object principal = authentication.getPrincipal(); if (principal instanceof String) { final String springSecurityUserId = (String) principal; final UserModel currentUser = userService.getCurrentUser(); final String hybrisUserId = currentUser.getUid(); // check if the user is deactivated if (isUserDeactivated(currentUser)) { LOG.error("User account [" + hybrisUserId + "] has already bean closed. Invalidating session."); invalidateSessionAndRedirect(request, response, LOGOUT_TRUE_CLOSE_ACC_TRUE); return false; } // check if spring uid is the same as hybris uid if (!springSecurityUserId.equals(hybrisUserId)) { LOG.error("User miss-match springSecurityUserId [" + springSecurityUserId + "] hybris session user [" + hybrisUserId + "]. Invalidating session."); invalidateSessionAndRedirect(request, response, REDIRECT_PATH); return false; } } } return true; } protected void invalidateSessionAndRedirect(final HttpServletRequest request, final HttpServletResponse response, final String redirectPath) throws IOException { // Invalidate session and redirect request.getSession().invalidate(); response.sendRedirect(response.encodeRedirectURL(request.getContextPath() + redirectPath)); //NOSONAR } protected boolean isUserDeactivated(final UserModel userModel) { if (userModel.getDeactivationDate() == null) { return false; } return !timeService.getCurrentTime().before(userModel.getDeactivationDate()); } /** * Checks whether there is a preview data setup for the current request * * @param httpRequest * current request * @return true whether is valid otherwise false */ protected boolean isPreviewDataModelValid(final HttpServletRequest httpRequest) { return cmsPageContextService.getCmsPageRequestContextData(httpRequest).getPreviewData() != null; } }
[ "anil.prasad@ameri100.com" ]
anil.prasad@ameri100.com
33f965c9705a2009c39eef944dc82a5e5a7bff2c
5b3c40b8d80676980840009549f5d40c009dca0b
/src/out/in/RouteFP.java
4603daeec20d5ed24d6e745408529fb88cf74a97
[]
no_license
santhoshmaereddy/1070_Its_My_Amrita_
6b363e10a7227ea7e9c745cb2d434b4f6915405f
88fbff017be2292b266085b3bbcdc16f1cd1db0a
refs/heads/master
2020-06-02T18:56:08.116107
2013-12-30T16:10:30
2013-12-30T16:10:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
786
java
package out.in; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; public class RouteFP extends Activity implements OnClickListener { Button getroutebtn,route; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.routemap); getroutebtn=(Button) findViewById(R.id.googlemapbtn); getroutebtn.setOnClickListener(this); } public void onClick(View v) { if(v.getId()==R.id.googlemapbtn); { Intent i1= new Intent("out.in.Route"); startActivity(i1); } } }
[ "santhosh.maereddy@gmail.com" ]
santhosh.maereddy@gmail.com
ab0d95b5a209fbb73e8b2555989132636bbb7667
190584f707ba708c5797fc90263642106befa35d
/api/src/main/java/org/jenkinsmvn/jenkins/api/model/UpstreamProject.java
3574d81625c999712e451452f7a67bd3ffc7aca2
[ "Apache-2.0" ]
permissive
jenkinsmvn/jenkinsmvn
3a926bb7c0b26a2df78d021b1d653ccc2debc054
7be372ed3cb4e45b23476e0d6bb6e0d230256b65
refs/heads/master
2021-01-21T21:40:06.040317
2013-08-02T02:56:01
2013-08-02T02:56:01
11,729,346
1
1
null
2016-03-09T15:30:10
2013-07-29T02:16:49
Java
UTF-8
Java
false
false
1,325
java
/* * Copyright (c) 2013. Jenkinsmvn. All Rights Reserved. * * See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The Jenkinsmvn 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.jenkinsmvn.jenkins.api.model; import java.net.URL; public class UpstreamProject { private String name; private URL url; private String color; public String getColor() { return color; } public void setColor(String color) { this.color = color; } public String getName() { return name; } public void setName(String name) { this.name = name; } public URL getUrl() { return url; } public void setUrl(URL url) { this.url = url; } }
[ "badong2210@yahoo.com" ]
badong2210@yahoo.com
f84edff4ed12c3a02946c424a6fd8bc0ddeb9b06
71afe661f41cea549619da8f4b8d6c8369d1ae96
/showcase/src/main/java/com/pepperonas/showcase/App.java
7b0b7622a31d2d68326b7bad7e3dae1342f84aa0
[ "Apache-2.0" ]
permissive
pepperonas/AndBasx
8f368e401777141acfc24f86dc3e26201ef983a3
d08f3777bbd3c123ca22138c8af57f467acabe4b
refs/heads/master
2020-05-21T12:44:07.908674
2017-05-31T18:13:10
2017-05-31T18:13:10
54,524,719
0
0
null
null
null
null
UTF-8
Java
false
false
946
java
/* * Copyright (c) 2017 Martin Pfeffer * * 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.pepperonas.showcase; import android.app.Application; import com.pepperonas.andbasx.AndBasx; /** * @author Martin Pfeffer * @see <a href="https://celox.io">https://celox.io</a> */ public class App extends Application { @Override public void onCreate() { super.onCreate(); AndBasx.init(this); } }
[ "martinpaush@gmail.com" ]
martinpaush@gmail.com
580e5440147af89d235ab0a222abf463dbb8b9a9
7140cfff9879c35eec9b479851ebac2cdd07ddf0
/Chapter09/Chapter9/PressEvents/app/src/test/java/com/packtpub/pressevents/ExampleUnitTest.java
88e8458f1d76db65724a749a19150c1a095af421
[ "MIT" ]
permissive
PacktPublishing/Android-9-Development-Cookbook
b741f54e6ad92c4a02b0a6874b7a6daaf307a040
e7959b7586b83542ae4251dd4e3d0002f5a54d0a
refs/heads/master
2023-01-28T10:13:11.779755
2023-01-18T09:58:54
2023-01-18T09:58:54
153,045,590
37
25
null
null
null
null
UTF-8
Java
false
false
385
java
package com.packtpub.pressevents; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() { assertEquals(4, 2 + 2); } }
[ "ralphr@packtpub.com" ]
ralphr@packtpub.com
eacd21b4ee0f07eaea4e8aec8d797d16eee406f0
8e4638897d6d679c1b545e72a938001ecd78fa5b
/src/main/java/pku/netlab/hermes/QOSUtils.java
6f8758a194bd9f57c4af830b8c8d67565962731f
[]
no_license
hult1989/mqtt-broker
2365ce5db1227503ba41bef2ba06348af5b341d4
bf0942797cbd8de80db9aa7c617283688c78d009
refs/heads/master
2020-06-11T11:05:20.372895
2017-07-23T13:43:40
2017-07-23T13:43:40
75,682,703
0
0
null
null
null
null
UTF-8
Java
false
false
2,109
java
package pku.netlab.hermes; import org.dna.mqtt.moquette.proto.messages.AbstractMessage; /** * Created by giovanni on 16/04/2014. * QoS transformes methods. */ public class QOSUtils { public AbstractMessage.QOSType toQos(byte qosByte) { AbstractMessage.QOSType qosTmp = AbstractMessage.QOSType.MOST_ONE; if(qosByte == 1) qosTmp = AbstractMessage.QOSType.LEAST_ONE; if(qosByte == 2) qosTmp = AbstractMessage.QOSType.EXACTLY_ONCE; return qosTmp; } public byte toByte(AbstractMessage.QOSType qos) { switch (qos) { case MOST_ONE: return 0; case LEAST_ONE: return 1; case EXACTLY_ONCE: return 2; case RESERVED: return 3; } return 0; } public Integer toInt(AbstractMessage.QOSType qos) { switch (qos) { case MOST_ONE: return 0; case LEAST_ONE: return 1; case EXACTLY_ONCE: return 2; case RESERVED: return 3; } return null; } public AbstractMessage.QOSType toQos(Integer iQos) { if(iQos == null) return null; AbstractMessage.QOSType qosTmp = AbstractMessage.QOSType.MOST_ONE; if(iQos == 1) qosTmp = AbstractMessage.QOSType.LEAST_ONE; if(iQos == 2) qosTmp = AbstractMessage.QOSType.EXACTLY_ONCE; return qosTmp; } public int calculatePublishQos(int iSentQos, int iMaxQos) { int iOkQos; if (iSentQos < iMaxQos) iOkQos = iSentQos; else iOkQos = iMaxQos; return iOkQos; } public AbstractMessage.QOSType calculatePublishQos(AbstractMessage.QOSType sentQos, AbstractMessage.QOSType maxQos) { int iSentQos = toInt(sentQos); int iMaxQos = toInt(maxQos); int iOkQos = calculatePublishQos(iSentQos, iMaxQos); AbstractMessage.QOSType okQos = toQos(iOkQos); return okQos; } }
[ "kindth@qq.com" ]
kindth@qq.com
64bacf75a3ba47eb29536fc88da8d9e75bfdeae7
79062196a6ecfbdac01ca7771c45ccdb7c29e899
/src/main/java/com/lulu/bootstrap/kafka/api/MessageResponse.java
da6516716539b53fe490409e39bf8cc01df063c1
[]
no_license
jeanxu1/poc-kafka-producer
9d4097447a52ba614ed047cb0e0750042f162df9
77bacee377bef620e762e682cf200c5715cd9746
refs/heads/master
2023-08-15T20:27:29.760661
2021-10-21T20:32:10
2021-10-21T20:32:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
183
java
package com.lulu.bootstrap.kafka.api; import lombok.AllArgsConstructor; import lombok.Data; @Data @AllArgsConstructor public class MessageResponse { private String message; }
[ "91338721+jeanxu1@users.noreply.github.com" ]
91338721+jeanxu1@users.noreply.github.com
fb9b0367a93e385bb33de73bf121f623917fe3a4
6ec8d6117a621ce9787f1c0e0bf18e7909bde166
/src/main/java/com/example/spachat/controller/UserController.java
86ae1a912bb3a3299390d313ec37d9144526552b
[]
no_license
userula/spachat
ad1c348af6177ea450d4956d02627bf31934706b
e475d7e73536efcff324be90be88a4d45f4d452b
refs/heads/master
2023-05-01T20:16:31.974578
2021-05-05T15:18:10
2021-05-05T15:18:10
364,617,375
0
0
null
null
null
null
UTF-8
Java
false
false
1,310
java
package com.example.spachat.controller; import com.example.spachat.model.User; import com.example.spachat.service.UserService; import lombok.AllArgsConstructor; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; @RestController @AllArgsConstructor @RequestMapping("api/user") public class UserController { private final UserService userService; @GetMapping("") public ResponseEntity<?> getAll() { return ResponseEntity.ok(userService.getAll()); } @PostMapping("") public ResponseEntity<?> add(@RequestBody User user) { userService.add(user); return ResponseEntity.ok("User successfully added"); } @PutMapping("") public ResponseEntity<?> edit(@RequestBody User user) { try { userService.update(user); } catch (Exception e) { return ResponseEntity.badRequest().body(e.getMessage()); } return ResponseEntity.ok(user); } @DeleteMapping("") public ResponseEntity<?> delete(@RequestBody User user) { try { userService.delete(user); } catch (Exception e) { return ResponseEntity.badRequest().body(e.getMessage()); } return ResponseEntity.ok("User successfully deleted"); } }
[ "ulan.buzhbanov620@gmail.com" ]
ulan.buzhbanov620@gmail.com
ec327d4f5787ba6795e9c2210eb7db7b2837d3e3
d14f9008590501ad9ad7a6588b6b353d4d5b5b8c
/app/src/main/java/com/cste/milton/student_faculty_document_sharing_system/DatabaseHelper.java
96b0f593bb7db9215145f4969841a014625320e4
[]
no_license
Md-Milton/Android-based---Document-Sharing-for-Department-of-CSTE
e04d3ba2c8b47213a0351e5722c4c6ee8c7f830d
cc7e487d8042a5f08f5bffe93856cbbe40d45b7f
refs/heads/master
2020-05-01T12:29:26.612457
2019-03-24T20:50:21
2019-03-24T20:50:21
177,464,527
0
0
null
null
null
null
UTF-8
Java
false
false
2,309
java
package com.cste.milton.student_faculty_document_sharing_system; import android.content.ContentValues; import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import android.widget.Toast; public class DatabaseHelper extends SQLiteOpenHelper { private static final String DATABASE_NAME = "Student.db"; private static final int DATABASE_VERSION = 1; public static final String TABLE_NAME = "student_details"; public static final String ID = "_id"; public static final String NAME = "name"; public static final String PASSWORD = "password"; public static final String EMAIL = "email"; public static final String CREATE_TABLE = "CREATE TABLE " + TABLE_NAME + " ( " + ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " + NAME + " TEXT, " + PASSWORD + " TEXT, " + EMAIL + " TEXT " + ")"; private Context context; public static final String DROP_TABLE = " DROP TABLE IF EXISTS "+ TABLE_NAME; public DatabaseHelper(Context context) { super(context, DATABASE_NAME, null, DATABASE_VERSION); this.context = context; } @Override public void onCreate(SQLiteDatabase db) { try{ Toast.makeText(context,"Exception :onCreate",Toast.LENGTH_SHORT).show(); db.execSQL(CREATE_TABLE); }catch(Exception e){ Toast.makeText(context,"Exception :"+e,Toast.LENGTH_SHORT).show(); } } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { try{ Toast.makeText(context,"onUpgrade",Toast.LENGTH_SHORT).show(); db.execSQL(DROP_TABLE); onCreate(db); }catch(Exception e){ Toast.makeText(context,"Exception :"+e,Toast.LENGTH_SHORT).show(); } } public long insertData(String name,String pass,String email){ SQLiteDatabase db = this.getWritableDatabase(); ContentValues contentValues =new ContentValues(); contentValues.put(NAME,name); contentValues.put(PASSWORD,pass); contentValues.put(EMAIL,email); long rowId = db.insert(TABLE_NAME,null,contentValues); return rowId; } }
[ "milton.cste1101@gmail.com" ]
milton.cste1101@gmail.com
b8d7b5df4e6e63dea8aae01d8501540daedc143d
e682fa3667adce9277ecdedb40d4d01a785b3912
/internal/fischer/mangf/A276789.java
9eea0ff1dcea77cdd2eb00157889ed3e63594716
[ "Apache-2.0" ]
permissive
gfis/joeis-lite
859158cb8fc3608febf39ba71ab5e72360b32cb4
7185a0b62d54735dc3d43d8fb5be677734f99101
refs/heads/master
2023-08-31T00:23:51.216295
2023-08-29T21:11:31
2023-08-29T21:11:31
179,938,034
4
1
Apache-2.0
2022-06-25T22:47:19
2019-04-07T08:35:01
Roff
UTF-8
Java
false
false
366
java
package irvine.oeis.a276; // generated by patch_offset.pl at 2023-06-16 18:27 import irvine.oeis.DifferenceSequence; import irvine.oeis.a003.A003145; /** * A276789 First differences of A003145. * @author Georg Fischer */ public class A276789 extends DifferenceSequence { /** Construct the sequence. */ public A276789() { super(1, new A003145()); } }
[ "dr.Georg.Fischer@gmail.com" ]
dr.Georg.Fischer@gmail.com
b92a9c1ffd176f64997422a040aed250431bd870
6bed5dfa90d948339b4f7f88c9cf69b75e91e625
/src/main/java/com/ffs/algafood/core/squiggly/SquigglyConfig.java
5053dd733f26dea71929fbf8f14e9f58e3cbd7bc
[]
no_license
fsilvafrancisco16/algafood-api
8a30a3fc3e397b4d7dc96558df0aa368d93c0857
9eacd9e6b4243fb5e2e20e22c5da1b31709ed261
refs/heads/master
2022-12-02T06:37:32.764667
2020-08-21T05:14:41
2020-08-21T05:14:41
259,756,055
0
0
null
null
null
null
UTF-8
Java
false
false
966
java
package com.ffs.algafood.core.squiggly; import com.fasterxml.jackson.databind.ObjectMapper; import com.github.bohnman.squiggly.Squiggly; import com.github.bohnman.squiggly.web.RequestSquigglyContextProvider; import com.github.bohnman.squiggly.web.SquigglyRequestFilter; import org.springframework.boot.web.servlet.FilterRegistrationBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; /** * * @author francisco */ @Configuration public class SquigglyConfig { @Bean public FilterRegistrationBean<SquigglyRequestFilter> squigglyRequestFilter(final ObjectMapper mapper) { Squiggly.init(mapper, new RequestSquigglyContextProvider()); final var filterResgistration = new FilterRegistrationBean<SquigglyRequestFilter>(); filterResgistration.setFilter(new SquigglyRequestFilter()); filterResgistration.setOrder(1); return filterResgistration; } }
[ "fsilvafrancisco16@gmail.com" ]
fsilvafrancisco16@gmail.com
ee058d4c4ec8d37040bbcb95da2dda968e73c65c
3e4ce480abf8a361fceace34479b5fa3748a4354
/src/com/mt/androidtest/image/CommonBaseAdapter.java
a9670993f959020b693d3ab8ceccef159f7cdd20
[]
no_license
wwmengtao/AndroidTest
764d9d1ee9867a77308198450dd62a2deb035328
c84252e7510ae1df4ee400776b0f0338e662f12a
refs/heads/master
2020-04-03T10:23:26.165012
2018-02-27T09:06:47
2018-02-27T09:06:47
54,540,634
0
0
null
null
null
null
UTF-8
Java
false
false
580
java
package com.mt.androidtest.image; import java.util.List; import android.content.Context; import android.widget.BaseAdapter; public abstract class CommonBaseAdapter<T> extends BaseAdapter { protected Context mContext; protected List<T> mDatas; public CommonBaseAdapter(Context context, List<T> mDatas){ this.mContext = context; this.mDatas = mDatas; } @Override public int getCount() { return mDatas.size(); } @Override public T getItem(int position){ return mDatas.get(position); } @Override public long getItemId(int position){ return position; } }
[ "wwmengtao@163.com" ]
wwmengtao@163.com
075a77a59aff56a317de83af5ff47e4d1b5fa6dd
abfea5c205477cb8d6162a16ec711496ddae9435
/game-service/src/main/java/com/mozzartbet/gameservice/mapper/AssistLeadersMapper.java
dad8bf01c09224c94d3cb0e3737db75976549cee
[]
no_license
ZeravicaDjordje/nba-statistics
520fcb3e8fd4c7e6fff0efeba99645754f0fab93
55d8c32eff9cf2f8a5bb2fed4eea5d62c7cbd179
refs/heads/master
2022-09-16T14:21:29.439455
2020-02-12T21:01:56
2020-02-12T21:01:56
240,106,622
0
0
null
2022-09-01T23:20:10
2020-02-12T20:19:14
HTML
UTF-8
Java
false
false
976
java
package com.mozzartbet.gameservice.mapper; import java.util.List; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import com.mozzartbet.gameservice.domain.AssistLeaders; import com.mozzartbet.gameservice.domain.ReboundLeaders; @Mapper public interface AssistLeadersMapper extends BaseMapper<AssistLeaders> { public int insert(AssistLeaders assistLeaders); public long count(); public AssistLeaders save(AssistLeaders assitLeaders); public List<AssistLeaders> serachByPlayerUrl(String playerUrl); public List<AssistLeaders> searchByGameUrl(String gameUrl); public List<AssistLeaders> getAllData(); public List<AssistLeaders> checkForDuplicate(AssistLeaders assistLeaders); public List<AssistLeaders> getAllId(); public AssistLeaders getById(Long id);//@Param("id") Long id); public int update(AssistLeaders entity); public int deleteById(@Param("id") Long id); }
[ "zeravicadjordje1@gmail.com" ]
zeravicadjordje1@gmail.com
5a88bd19ebf4bc924bd36d2971ae1645b04cd806
7716834607db4904743b32d45c70abe6cded21b6
/src/main/java/com/sm/common/china/convert/provider/TraditionalToSimplifiedChineseProvider.java
ed1dec3e19236b263343d5b5c9fd1fe9da363d9f
[]
no_license
taiyangchen/common-china
e4101a5a185f2969a69361448cc954b2b7d571c3
6a6a4e7c3891d238f535ad0a3c7b171cca99f9ca
refs/heads/master
2021-08-08T22:38:08.852669
2017-11-11T13:58:52
2017-11-11T13:58:52
110,270,563
0
0
null
null
null
null
UTF-8
Java
false
false
419
java
/** * */ package com.sm.common.china.convert.provider; /** * 繁体转简体 * * @author <a href="mailto:xuchen06@baidu.com">xuc</a> * @version create on 2014年7月24日 上午3:49:10 */ public class TraditionalToSimplifiedChineseProvider extends ChineseCharConverterProvider { @Override protected String getCodeTableName() { return "TraditionalToSimplifiedChinese"; } }
[ "chenxu.xc@alibaba-inc.com" ]
chenxu.xc@alibaba-inc.com
41c9a42d9456585152edc70694a4a39560a8b5c2
adec514f02bacf12838fd5a54bf21cb63d25d405
/backend/assessments-portal-backend/src/main/java/com/assessments/portal/common/results/ApiResult.java
4a063d926a741890ec5cfe492c19942aa0d42f3e
[]
no_license
sergeev-d/test-client-app
6ad3545eafebf419e4e7d371c238002ec9ad36ef
b7b2c5fcde0ce2f011f12ed308379c312971e4d1
refs/heads/master
2023-01-29T02:15:26.548099
2019-06-16T22:00:59
2019-06-16T22:00:59
172,454,562
0
0
null
2022-12-10T16:48:06
2019-02-25T07:19:10
Vue
UTF-8
Java
false
false
1,303
java
package com.assessments.portal.common.results; import org.springframework.util.Assert; import java.util.HashMap; public class ApiResult extends HashMap<String, Object> { private static final long serialVersionUID = 877825499039674411L; private static final String MESSAGE_KEY = "message"; private static final String ERROR_CODE_KEY = "errorReferenceCode"; public static ApiResult blank() { return new ApiResult(); } public static ApiResult message(String message) { Assert.hasText(message, "Parameter `message` must not be blank"); ApiResult apiResult = new ApiResult(); apiResult.put("message", message); return apiResult; } public static ApiResult error(String message, String errorReferenceCode) { Assert.hasText(message, "Parameter `message` must not be blank"); Assert.hasText(errorReferenceCode, "Parameter `errorReferenceCode` must not be blank"); ApiResult apiResult = new ApiResult(); apiResult.put(MESSAGE_KEY, message); apiResult.put(ERROR_CODE_KEY, errorReferenceCode); return apiResult; } public ApiResult add(String key, Object value) { Assert.hasText(key, "Parameter `key` must not be blank"); Assert.notNull(value, "Parameter `value` must not be null"); this.put(key, value); return this; } }
[ "dxsergeevsxd@mail.ru" ]
dxsergeevsxd@mail.ru
47c70333da6f4c42cc14568218eb883492d3ac84
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/10/10_3e915f1991b5d2ee372778476c1374d4ededfc1f/BodyImageGetter/10_3e915f1991b5d2ee372778476c1374d4ededfc1f_BodyImageGetter_t.java
e4da2db9278a9573388b6cf7a360f4ec0898caa7
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
3,575
java
package edu.grinnell.sandb.img; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.net.MalformedURLException; import org.apache.http.HttpResponse; import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.DefaultHttpClient; import android.content.Context; import android.os.AsyncTask; import edu.grinnell.sandb.data.Article; public class BodyImageGetter { private static ImageTable mImageTable; private static int numTasks = 0; public BodyImageGetter(Context context) { if (mImageTable == null) mImageTable = new ImageTable(context); } public void buildImageCache(Article article) { new ImageHelper().execute(article); } public class ImageHelper extends AsyncTask<Article, Integer, Integer> { @Override protected void onPreExecute() { if (numTasks++ == 0) { mImageTable.open(); mImageTable.clearTable(); } } @Override protected Integer doInBackground(Article... article) { String body = article[0].getBody(); int articleId = article[0].getId(); readImage(body, articleId); return null; } } protected void onPostExecute(Integer i) { if (--numTasks == 0) mImageTable.close(); } // Read an image from the body as a byte array public void readImage(String body, int articleID) { addImage(body, articleID, "<div"); // addImage(body, articleID, "<a"); addImage(body, articleID, "<img"); } private void addImage(String body, int articleId, String tag) { int tagStart = 0; String url = ""; byte[] image = null; String title = ""; while ((tagStart = body.indexOf(tag, tagStart + 1)) >= 0) { url = getSubstring("src=\"", body, tagStart); //check to make sure image has not yet been added if ((Image) mImageTable.findByUrl(url) != null) return; //image = getImage(url, tagStart); title = getSubstring("title=\"", body, tagStart); mImageTable.createImage(articleId, url, image, title); } } private static byte[] getImage(String imgSource, int start) { // download image as byte array ByteArrayOutputStream buffer = new ByteArrayOutputStream(); int nRead; byte[] data = new byte[16384]; InputStream is; try { is = fetch(imgSource); while ((nRead = is.read(data, 0, data.length)) != -1) { buffer.write(data, 0, nRead); } buffer.flush(); } catch (MalformedURLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } catch (IllegalArgumentException e) { e.printStackTrace(); return null; } return buffer.toByteArray(); } private static InputStream fetch(String urlString) throws IllegalArgumentException, MalformedURLException, IOException { DefaultHttpClient httpClient = new DefaultHttpClient(); HttpGet request = new HttpGet(urlString); HttpResponse response = httpClient.execute(request); return response.getEntity().getContent(); } // return a string starting immediately after the key, and ending at the // first quotation mark private static String getSubstring(String key, String body, int start) { int subStart = 0; int subEnd = 0; String substring = ""; // start at beginning of link subStart = body.indexOf(key, start) + key.length(); if (subStart >= 0) { subEnd = body.indexOf("\"", subStart); } if (subEnd >= subStart) { substring = body.substring(subStart, subEnd); } return substring; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
13fc875c63da0b725ad4698454b64dd1066f8b04
5fc65c304518eec72a0faa829ad7a7da6b6227ee
/system-model/src/main/java/com/yzy/entity/BaseTexture.java
cb706d45d767fadb54c3f12df2ef27efb951298b
[]
no_license
Mr-Wjq/orders
99c08773201e38293a623c8f10c072fc042394cb
24cb629b3f1c305c377d85967cb7bd411ded5590
refs/heads/master
2023-03-31T18:06:16.455041
2019-07-14T15:03:09
2019-07-14T15:03:09
195,168,475
0
0
null
2023-03-27T22:16:43
2019-07-04T04:26:18
HTML
UTF-8
Java
false
false
1,756
java
package com.yzy.entity; import javax.persistence.*; @Table(name = "base_texture") public class BaseTexture { @Id private Long id; /** * 材质名称 */ @Column(name = "texture_name") private String textureName; /** * 治疗类型ID */ @Column(name = "base_cure_id") private Long baseCureId; /** * 状态0:删除/1:正常 */ private Integer status; /** * @return id */ public Long getId() { return id; } /** * @param id */ public void setId(Long id) { this.id = id; } /** * 获取材质名称 * * @return texture_name - 材质名称 */ public String getTextureName() { return textureName; } /** * 设置材质名称 * * @param textureName 材质名称 */ public void setTextureName(String textureName) { this.textureName = textureName; } /** * 获取治疗类型ID * * @return base_cure_id - 治疗类型ID */ public Long getBaseCureId() { return baseCureId; } /** * 设置治疗类型ID * * @param baseCureId 治疗类型ID */ public void setBaseCureId(Long baseCureId) { this.baseCureId = baseCureId; } /** * 获取状态0:删除/1:正常 * * @return status - 状态0:删除/1:正常 */ public Integer getStatus() { return status; } /** * 设置状态0:删除/1:正常 * * @param status 状态0:删除/1:正常 */ public void setStatus(Integer status) { this.status = status; } }
[ "wjq-javaengineer@163.com" ]
wjq-javaengineer@163.com
f40824431fbd98819aeb638fcb79f63edac15739
32db5a8976e40ac07ad6ef6dab3989e4f647e5b1
/src/Client.java
b500c907ef2afbeedf03ac43ca6c961d94a7d613
[]
no_license
swilliams9671/dataStructures
d0d92573a6e2363dfe31389f351c7b41a011ebf9
5b9d9444d6d8357dbdef29ab3a9fffbb5b761dd3
refs/heads/master
2023-07-25T19:27:20.707776
2019-05-06T13:24:45
2019-05-06T13:24:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,579
java
import java.io.*; import java.net.*; public class Client { public static void main(String[] args) throws IOException { if (args.length != 2) { System.err.println( "Example: java Client <host name> <port number>"); System.exit(1); } String hostName = args[0]; int portNumber = Integer.parseInt(args[1]); try ( Socket mySocket = new Socket(hostName, portNumber); PrintWriter out = new PrintWriter(mySocket.getOutputStream(), true); BufferedReader in = new BufferedReader( new InputStreamReader(mySocket.getInputStream())); ) { BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in)); String fromServer; String fromUser; while ((fromServer = in.readLine()) != null) { System.out.println("Server: " + fromServer); if (fromServer.equals("Adios.")) break; fromUser = stdIn.readLine(); if (fromUser != null) { System.out.println("Client: " + fromUser); out.println(fromUser); } } } catch (UnknownHostException e) { System.err.println("Unknown host " + hostName); System.exit(1); } catch (IOException e) { System.err.println("Unable to connect to " + hostName); System.exit(1); } } }
[ "mstevenwilliams@gmail.com" ]
mstevenwilliams@gmail.com
b5385cb5fc11d66e9dddc508010836d861bbefeb
9b3c21ab4f00ce94afa6aa335a0886d543de30e1
/Source/UMKC-IS-Guide/app/src/main/java/com/mnpw3d/umkcis_guide/PreDeparture.java
9c546357136ace8643a95f7d24bf9ae497e211f1
[]
no_license
SCE-UMKC/ASESP16_UMKC-IS-Guide_3
ca3192c44197f7eef82060c9f3ecc1e11766af0e
35f7644e2ac11ff7b3224a133e6f71e213aa87e5
refs/heads/master
2020-04-09T05:04:15.320367
2016-05-12T06:36:18
2016-05-12T06:36:18
50,704,574
1
0
null
null
null
null
UTF-8
Java
false
false
2,079
java
package com.mnpw3d.umkcis_guide; import android.content.Intent; import android.os.Bundle; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.Snackbar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.Menu; import android.view.MenuItem; import android.view.View; public class PreDeparture extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_pre_departure); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.menu_login, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.profile) { Intent i = new Intent(PreDeparture.this,ProfileActicity.class); startActivity(i); } if( id == R.id.action_settings) { Intent i = new Intent(PreDeparture.this,ChangePassword.class); startActivity(i); } return super.onOptionsItemSelected(item); } public void shopping(View v) { Intent i = new Intent(PreDeparture.this, ShoppingList.class); startActivity(i); } public void flight(View v) { Intent i = new Intent(PreDeparture.this, Flight.class); startActivity(i); } public void fee(View v) { Intent i = new Intent(PreDeparture.this, FeesDetail.class); startActivity(i); } }
[ "marmikpatel262@gmail.com" ]
marmikpatel262@gmail.com
cd65661fd9d359ff8fa162df34c8716c3e8e4515
395adb9d950da5f476d317b8adb17791676f7cb7
/src/main/com/lwf/arithmetic/level1/arrays/PlusOne.java
ed6462f07a1d2f0a66f545729243b7d0f3c2fca9
[ "Apache-2.0" ]
permissive
tommyliu86/LearnLeetCode
fdb93b544a3c1d46ff6af650f40be4e3523fc672
1724aad06a2113816fa2aae0870c6fcd336aa080
refs/heads/master
2023-09-03T20:52:17.650455
2023-08-31T02:14:25
2023-08-31T02:14:25
197,608,361
0
1
null
null
null
null
UTF-8
Java
false
false
844
java
package com.lwf.arithmetic.level1.arrays; /** * Created with IntelliJ IDEA. * * @author: liuwenfei14 * @date: 2022-04-09 16:56 */ public class PlusOne { class Solution { public int[] plusOne(int[] digits) { int add=1; for (int i = digits.length - 1; i >= 0; i--) { int newI = digits[i]+add; add=newI/10; digits[i]=newI%10; if (add==0){ break; } } if (add==1){ int[] newRtn=new int[digits.length+1]; newRtn[0]=add; for (int i = 1; i < newRtn.length; i++) { newRtn[i]=digits[i-1]; } return newRtn; }else{ return digits; } } } }
[ "liuwenfei14@jd.com" ]
liuwenfei14@jd.com
107db58e7e0a01e30e595578cfe8c40c28097f5d
7164ea4aab6db59fc174ec830bfd3246617407d1
/src/java/com/login/dao/EditmemberDao.java
5c1d7008e0f2be072388539dfe5623e8482c60c7
[]
no_license
Kuriarko/Myprojects
36a67b1aaea6eccb3c0e0ea628385dde1df07d51
5426ac0836f2e402f376fe2cfa44c4a3aad061d7
refs/heads/master
2022-12-05T17:44:00.244530
2020-08-18T14:49:22
2020-08-18T14:49:22
281,175,715
0
0
null
null
null
null
UTF-8
Java
false
false
898
java
package com.login.dao; import java.sql.Connection; import java.sql.DriverManager; import java.sql.Statement; import testclasses.Memberpojo; public class EditmemberDao { public boolean updateMember(Memberpojo trainer) { boolean flag=false; try { Class.forName("com.mysql.cj.jdbc.Driver"); Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/mydb","root",""); Statement stmt =con.createStatement(); stmt.executeUpdate( "Update member set m_name='"+trainer.getName()+"', phone='"+trainer.getPhone()+"', email='"+trainer.getEmail()+"', password='"+trainer.getPassword()+"' where m_id="+trainer.getId()+""); flag=true; } catch(Exception e) { e.printStackTrace(); } return flag; } }
[ "debanjan20jobs@gmail.com" ]
debanjan20jobs@gmail.com
0c3355e228f21cb903ca174258235a1f1a9e317d
80b9eb44a01283477d6f7ffa0afe9f718a6676c0
/trunk/org.mwc.debrief.legacy/src/Debrief/ReaderWriter/XML/Tactical/TrackSegmentHandler.java
7e9d86d276b3a0c029fd1a0b41d88f3711336f31
[]
no_license
jesseeichar/debrief
ddc70cde1b37dd07ed8a99020e3e50c1ccb2e4f8
0b6ce0692eb1857fd492347ffee65bb649254a37
refs/heads/master
2023-05-30T22:33:40.006702
2013-05-03T17:15:55
2013-05-03T17:15:55
8,770,845
2
1
null
2013-05-01T06:59:26
2013-03-14T08:08:49
Java
UTF-8
Java
false
false
1,382
java
package Debrief.ReaderWriter.XML.Tactical; /** * Title: Debrief 2000 * Description: Debrief 2000 Track Analysis Software * Copyright: Copyright (c) 2000 * Company: MWC * @author Ian Mayo * @version 1.0 */ import org.w3c.dom.Element; import Debrief.Wrappers.Track.TrackSegment; abstract public class TrackSegmentHandler extends CoreTrackSegmentHandler { private static final String TRACK_SEGMENT = "TrackSegment"; public static final String PLOT_RELATIVE = "PlotRelative"; private boolean _relativeMode = false; public TrackSegmentHandler() { // inform our parent what type of class we are super(TRACK_SEGMENT); addAttributeHandler(new HandleBooleanAttribute(PLOT_RELATIVE) { @Override public void setValue(String name, boolean val) { _relativeMode = val; } }); } @Override protected TrackSegment createTrack() { TrackSegment res = new TrackSegment(); res.setPlotRelative(_relativeMode); return res; } public static void exportThisSegment(org.w3c.dom.Document doc, Element trk, TrackSegment seg) { final Element segE = CoreTrackSegmentHandler.exportThisSegment(doc, seg, TRACK_SEGMENT); // sort out the remaining attributes segE.setAttribute(PLOT_RELATIVE, writeThis(seg.getPlotRelative())); trk.appendChild(segE); } }
[ "ian@cb33b658-6c9e-41a7-9690-cba343611204" ]
ian@cb33b658-6c9e-41a7-9690-cba343611204
3f12641cb7340a7981716335a4b256d7864f38d8
430e84d424c73c994254430dee372cdaccbf6bbd
/WeLife/WeLife/src/edu/jlxy/Module/table/File.java
ffab48a6d7baa142a7527952dee2ed6c41e636b8
[]
no_license
huitianbao/WeLife_Complete_Edition
bc9315dcee4d5e9971f6c7e325c2be7b31373d47
29a4cc52471f5ce8064c3e6b477880d6bd48238a
refs/heads/master
2020-03-19T09:01:04.921101
2018-06-10T00:54:19
2018-06-10T00:54:41
136,253,389
0
0
null
null
null
null
UTF-8
Java
false
false
945
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 edu.jlxy.Module.table; import edu.jlxy.Module.entity.FileEntity; import edu.jlxy.Module.entity.SendDynamicEntity; import java.sql.Connection; import java.sql.ResultSet; import java.util.ArrayList; import java.util.List; /** * * @author 16221 */ public interface File { /** * 保存文件信息的方法 */ public void saveFile(FileEntity fileEntity,String photo,SendDynamicEntity sendDynamicEntity); /** * 根据id查询文件 */ public File findById(int id,Connection connection); /** * 查询所有文件 * @param args */ public List<File> findAll(); //public ResultSet getAll(); public ResultSet getAll_resulSet(); public ArrayList<FileEntity> getList(); }
[ "1622162492@qq.com" ]
1622162492@qq.com
ff8ef71564f3270afdbfa8d1863ebb3eb638fc4a
f9cbf87db80952cbffb4d642005f077a203f7cc7
/TSP/src/ui/MainUI.java
ba6f4d374a62ab9417e51423d3e355dfa37e9e83
[]
no_license
chenf99/AI
00ac78c18100544ccf022d240f42a325ae4a60ba
ed18ad3e3f97a0d83a76062c198e6b1329bc39b4
refs/heads/master
2021-06-21T02:44:50.319376
2021-01-01T07:11:15
2021-01-01T07:11:15
161,173,260
0
2
null
null
null
null
GB18030
Java
false
false
8,230
java
package ui; import algorithm.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.BufferedReader; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.net.Socket; import java.net.UnknownHostException; import java.util.ArrayList; import java.util.List; import java.util.Random; import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.geom.Line2D; import javax.swing.JFrame; public class MainUI extends JFrame implements ActionListener { //定义界面组件 JLabel jlb1, jlb2, jlb3 = null; JButton jb1, jb2, jb3, jb4= null; JPanel jp1, jp2, jp3, jp4, jp5, jp6, jp7 = null; JTextField jtf = null; public JFrame f; public TSPUI tspui; public SA sa; public static volatile List<City> datas; public JFrame lsf; public TSPUI lstspui; public LS ls; public JFrame gaf; public TSPUI gatspui; public GA ga; public MainUI() { jb1 = new JButton("LS"); jb2 = new JButton("SA"); jb3 = new JButton("GA"); //jb4 = new JButton("GA"); //设置监听 jb1.addActionListener(this); jb2.addActionListener(this); jb3.addActionListener(this); //jb3.addActionListener(this); //jb4.addActionListener(this); jp1 = new JPanel(); jp2 = new JPanel(); jp3 = new JPanel(); jp1.add(jb1); jp2.add(jb2); jp3.add(jb3); this.add(jp1); this.add(jp2); this.add(jp3); //设置布局管理器 this.setLayout(new GridLayout(3,1,200,30)); //给窗口设置标题 this.setTitle("人工智能TSP"); //设置窗体大小 this.setSize(360,240); //设置窗体初始位置 //this.setLocation(1000, 150); //设置当关闭窗口时,保证JVM也退出 this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //显示窗体 this.setVisible(true); this.setResizable(true); } public static void main(String[] args) { MainUI m = new MainUI(); // 城市抽象的点集 String filePath = "Qatar.txt"; datas = new ArrayList<>(); // 读取文件数据 try { FileInputStream fis = new FileInputStream(filePath); int buffer_size = fis.available(); byte[] buffer = new byte[buffer_size]; int read_size = fis.read(buffer); String str = new String(buffer); String[] lines = str.split("\n"); for(int i = 0; i < lines.length; i++) { if(Tools.isDigit(lines[i].charAt(0))) { String[] line_data = lines[i].split(" "); int tag = Integer.parseInt(line_data[0]); double x = Double.valueOf(line_data[1]); double y = Double.valueOf(line_data[2]); datas.add(new City(tag, x, y)); } else if(i != lines.length-1) System.out.print(lines[i]); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } @Override public void actionPerformed(ActionEvent c) { if (c.getActionCommand() == "LS") { jb1.setEnabled(false); Thread lsThread = new Thread(new Runnable(){ @Override public void run() { lsf = new JFrame(); lsf.setTitle("LS算法"); System.out.println("-------------LS Solution----------"); ls = new LS(datas); int[] path; path = ls.getPath(); lstspui = new TSPUI(datas, path); lsf.getContentPane().add(lstspui); lsf.setSize(600, 480); lsf.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE); lsf.setVisible(true); lsf.setResizable(true); Thread updateThread = new Thread(new Runnable(){ @Override public void run() { try { while(!ls.getFinished()) { int[] current_path = ls.getPath(); Thread.sleep(100); lsf.getContentPane().setVisible(false); lsf.getContentPane().remove(lstspui); lstspui = new TSPUI(datas, current_path); lsf.getContentPane().add(lstspui); lsf.getContentPane().repaint(); lsf.getContentPane().setVisible(true); } int[] current_path = ls.getPath(); lsf.getContentPane().setVisible(false); lsf.getContentPane().remove(lstspui); lstspui = new TSPUI(datas, current_path); lsf.getContentPane().add(lstspui); lsf.getContentPane().repaint(); lsf.getContentPane().setVisible(true); } catch (InterruptedException e) { e.printStackTrace(); } } }); updateThread.start(); ls.search(); jb1.setEnabled(true); JOptionPane.showConfirmDialog(null, "LS", "完成搜索", JOptionPane.CANCEL_OPTION); } }); lsThread.start(); } if (c.getActionCommand() == "SA") { jb2.setEnabled(false); Thread saThread = new Thread(new Runnable(){ @Override public void run() { f = new JFrame(); f.setTitle("SA算法"); System.out.println("-------------SA Solution----------"); sa = new SA(datas); int[] path; path = sa.getPath(); //System.out.println(path.length); tspui = new TSPUI(datas, path); f.getContentPane().add(tspui); f.setSize(600, 480); f.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE); f.setVisible(true); f.setResizable(true); Thread updateThread = new Thread(new Runnable(){ @Override public void run() { try { while(!sa.getFinished()) { int[] current_path = sa.getPath(); Thread.sleep(100); f.getContentPane().setVisible(false); f.getContentPane().remove(tspui); tspui = new TSPUI(datas, current_path); f.getContentPane().add(tspui); f.getContentPane().repaint(); f.getContentPane().setVisible(true); } int[] current_path = sa.getPath(); f.getContentPane().setVisible(false); f.getContentPane().remove(tspui); tspui = new TSPUI(datas, current_path); f.getContentPane().add(tspui); f.getContentPane().repaint(); f.getContentPane().setVisible(true); } catch (InterruptedException e) { e.printStackTrace(); } } }); updateThread.start(); sa.search(); jb2.setEnabled(true); JOptionPane.showConfirmDialog(null, "SA", "完成搜索", JOptionPane.CANCEL_OPTION); } }); saThread.start(); } if (c.getActionCommand() == "GA") { jb3.setEnabled(false); Thread gaThread = new Thread(new Runnable(){ @Override public void run() { gaf = new JFrame(); gaf.setTitle("GA算法"); System.out.println("-------------GA Solution----------"); ga = new GA(datas); int[] path; path = ga.getPath(); gatspui = new TSPUI(datas, path); gaf.getContentPane().add(gatspui); gaf.setSize(600, 480); gaf.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE); gaf.setVisible(true); gaf.setResizable(true); Thread updateThread = new Thread(new Runnable(){ @Override public void run() { try { while(!ga.getFinished()) { int[] current_path = ga.getPath(); Thread.sleep(100); gaf.getContentPane().setVisible(false); gaf.getContentPane().remove(gatspui); gatspui = new TSPUI(datas, current_path); gaf.getContentPane().add(gatspui); gaf.getContentPane().repaint(); gaf.getContentPane().setVisible(true); } int[] current_path = ga.getPath(); gaf.getContentPane().setVisible(false); gaf.getContentPane().remove(gatspui); gatspui = new TSPUI(datas, current_path); gaf.getContentPane().add(gatspui); gaf.getContentPane().repaint(); gaf.getContentPane().setVisible(true); } catch (InterruptedException e) { e.printStackTrace(); } } }); updateThread.start(); ga.evolution(); jb3.setEnabled(true); JOptionPane.showConfirmDialog(null, "GA", "完成演绎", JOptionPane.CANCEL_OPTION); } }); gaThread.start(); } } }
[ "944131226@qq.com" ]
944131226@qq.com
3252c53fb96637c91394b049edba09bcbdd9d7e7
b55a70b0d3221050bb816efad4875e4f784a5bd0
/src/jianzhiOffer/Problem24.java
b580c47d1e0d081e87b89ac94c860930edfe503f
[]
no_license
jieyugithub/SO-Java
64b51fc01ba83f69a78617b17fafd71a1a065ef1
a39a0d5bfd9e19698f173587fcb2a13007bf6763
refs/heads/master
2022-05-11T15:49:32.416434
2019-06-24T15:58:27
2019-06-24T15:58:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,530
java
package jianzhiOffer; import java.util.ArrayList; import java.util.List; import java.util.Stack; /** * problem24:二叉树中和某一值的路径 * description:输入一颗二叉树的根节点和一个整数,打印出二叉树中结点值的和为输入整数的所有路径。 * 路径定义为从树的根结点开始往下一直到叶结点所经过的结点形成一条路径。 * (注意: 在返回值的list中,数组长度大的数组靠前) * Created by wtwang on 2019/5/14. */ public class Problem24 { public static void main(String[] args){ TreeNode root = new TreeNode(1); TreeNode node2 = new TreeNode(2); TreeNode node3 = new TreeNode(3); TreeNode node4 = new TreeNode(4); TreeNode node5 = new TreeNode(5); TreeNode node6 = new TreeNode(6); TreeNode node7 = new TreeNode(7); root.left = node2; root.right = node5; node2.left = node3; node2.right = node4; node5.left = node6; node5.right = node7; } List<List<Integer>> res = new ArrayList<>(); public List<List<Integer>> pathSum(TreeNode root, int sum) { Stack<Integer> stack = new Stack<>(); if(root != null){ help(root,sum,0,stack,res); } return res; } public void help(TreeNode root,int sum,int curSum,Stack<Integer> stack,List<List<Integer>> res){ //将当前节点值加到路径和中 curSum += root.val; //将当前节点入栈 stack.push(root.val); //如果当前节点是叶节点,判断路径和是否满足要求 if(root.left == null && root.right == null){ if(curSum == sum){ //遍历当前栈,得到路径 List<Integer> list = new ArrayList<>(); int size = stack.size(); for(int i=0;i<size;++i){ list.add(stack.get(i)); } res.add(list); } } //如果当前节点不是叶节点,则需要访问其左子树和右子树 if(root.left != null){ help(root.left,sum,curSum,stack,res); } if(root.right != null){ help(root.right,sum,curSum,stack,res); } //将当前节点出栈 stack.pop(); } static class TreeNode { int val = 0; TreeNode left = null; TreeNode right = null; public TreeNode(int val) { this.val = val; } } }
[ "wwt0812@outlook.com" ]
wwt0812@outlook.com
f6c761ddccd9083d4ce8985e892a6992ee8f4f02
a2689a5be9c01eee7661d2d76e6f912e2cdf8b6f
/src/com/common/permission/entity/PmPermission.java
09622ce8627a78f6f9efe3827023ddbeb73df7fb
[ "Apache-2.0" ]
permissive
hyq9000/common-permission
24a8856046d86ca1dcb2b6dcf1af406766243f74
d8251da4dbd421d61c7e98f49f9a2a7279b9f755
refs/heads/master
2021-01-10T10:13:45.595704
2016-01-05T03:35:56
2016-01-05T03:35:56
49,034,305
0
0
null
null
null
null
UTF-8
Java
false
false
3,478
java
package com.common.permission.entity; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import static javax.persistence.GenerationType.IDENTITY; import javax.persistence.Id; import javax.persistence.Table; /** * PmPermission entity. @author MyEclipse Persistence Tools */ @Entity @Table(name = "pm_permission") public class PmPermission implements java.io.Serializable { /** * */ private static final long serialVersionUID = 3266088193444499804L; // Fields /** * */ /** * */ private Integer permissionId; private Integer permissionParentId; private String permissionName; private String permissionUri; private String permissionImageUri; private String permissionLinkTarget; private String permissionPrompt; // Constructors public boolean equals(Object obj) { if(obj instanceof PmPermission) return this.permissionId.equals(((PmPermission)obj).permissionId); else return super.equals(obj); } /** default constructor */ public PmPermission() { } /** minimal constructor */ public PmPermission(Integer permissionParentId, String permissionName) { this.permissionParentId = permissionParentId; this.permissionName = permissionName; } /** full constructor */ public PmPermission(Integer permissionParentId, String permissionName, String permissionUri, String permissionImageUri, String permissionLinkTarget, String permissionPrompt) { this.permissionParentId = permissionParentId; this.permissionName = permissionName; this.permissionUri = permissionUri; this.permissionImageUri = permissionImageUri; this.permissionLinkTarget = permissionLinkTarget; this.permissionPrompt = permissionPrompt; } // Property accessors @Id @GeneratedValue(strategy = IDENTITY) @Column(name = "PERMISSION_ID", unique = true, nullable = false) public Integer getPermissionId() { return this.permissionId; } public void setPermissionId(Integer permissionId) { this.permissionId = permissionId; } @Column(name = "PERMISSION_PARENT_ID", nullable = false) public Integer getPermissionParentId() { return this.permissionParentId; } public void setPermissionParentId(Integer permissionParentId) { this.permissionParentId = permissionParentId; } @Column(name = "PERMISSION_NAME", nullable = false, length = 100) public String getPermissionName() { return this.permissionName; } public void setPermissionName(String permissionName) { this.permissionName = permissionName; } @Column(name = "PERMISSION_URI", length = 254) public String getPermissionUri() { return this.permissionUri; } public void setPermissionUri(String permissionUri) { this.permissionUri = permissionUri; } @Column(name = "PERMISSION_IMAGE_URI", length = 254) public String getPermissionImageUri() { return this.permissionImageUri; } public void setPermissionImageUri(String permissionImageUri) { this.permissionImageUri = permissionImageUri; } @Column(name = "PERMISSION_LINK_TARGET", length = 100) public String getPermissionLinkTarget() { return this.permissionLinkTarget; } public void setPermissionLinkTarget(String permissionLinkTarget) { this.permissionLinkTarget = permissionLinkTarget; } @Column(name = "PERMISSION_PROMPT", length = 100) public String getPermissionPrompt() { return this.permissionPrompt; } public void setPermissionPrompt(String permissionPrompt) { this.permissionPrompt = permissionPrompt; } }
[ "hyq9000@qq.com" ]
hyq9000@qq.com
e230686ff500c9589daa5c705272d6dcb0428570
360d68490902b2da5f3fe959b556c38a551d9ed9
/src/快排.java
aeee35b02bf41e56f7a77a5241aa7969b15850a2
[]
no_license
FWj1635387072/algorithm
aa7af4438cc3c1869de456c879d28af7cb839276
e132be7898812960ec2c056c1522181f904567fb
refs/heads/master
2020-12-10T09:31:50.945780
2020-04-21T05:49:15
2020-04-21T05:49:15
233,557,170
1
0
null
null
null
null
UTF-8
Java
false
false
1,768
java
import org.junit.Test; import 算法书例子.第一章.Util; public class 快排 { static void quickSort(int[] arr, int left, int right) { if (left < right) { int q = partition1(arr,left,right); quickSort(arr, left, q - 1); quickSort(arr, q + 1, right); } } static int partition(int[] arr,int left,int right) { int pmain = arr[left]; int pleft = left + 1; int pright = right; while(pleft <= pright){ if(arr[pleft] > pmain){ swap(arr,pleft,pright); pright--; } else{ pleft++; } } swap(arr,left,pright); return pright; } static void swap(int[] arr,int i,int j){ int temp = arr[i]; arr[i] = arr[j]; arr[j] = temp; } static int partition1(int[] arr, int left,int right){ int pmain = arr[left]; int pleft = left + 1; int pright = right; while(pleft <= pright){ while(pleft <= pright && arr[pleft] <= pmain ){ pleft++; } while(pleft <= pright && arr[pright] > pmain){ pright--; } if(pleft < pright) swap(arr,pleft,pright); } swap(arr,left,pright); return pright; } static int partition3(int[] arr,int left,int right){ int[] temp = {arr[left],arr[right],arr[(left+right)/2]}; return 0; } @Test public void test1(){ int[] arr = Util.getIntArr(30,1,50); System.out.println(Util.printArr(arr)); quickSort(arr,0,arr.length - 1); System.out.println(Util.printArr(arr)); } }
[ "1635387072@qq.com" ]
1635387072@qq.com
810ba583a206c5008da6c57abf7bf9c50c19fe5b
3565a4379a592f128472ddffdd1c6ef26e464f66
/app/src/main/java/com/gabilheri/pawsalert/data/queryManagers/AnimalManager.java
a501d1e815a2c4ae011a1ff2a7837b003b28dab1
[]
no_license
fnk0/PawsAlert
37a0b3aa85a6f2835fcdcb735b7adb0c5243de06
9b9ee41bb8b8943f0697fe1b6f38d30e7d50f7dd
refs/heads/master
2020-04-10T08:31:43.200019
2016-05-09T17:45:52
2016-05-09T17:45:52
50,889,367
1
0
null
null
null
null
UTF-8
Java
false
false
2,269
java
package com.gabilheri.pawsalert.data.queryManagers; import android.support.annotation.NonNull; import com.gabilheri.pawsalert.data.models.Animal; import com.parse.GetCallback; import com.parse.ParseException; import com.parse.ParseQuery; import com.parse.SaveCallback; import timber.log.Timber; /** * Created by <a href="mailto:marcus@gabilheri.com">Marcus Gabilheri</a> * * @author Marcus Gabilheri * @version 1.0 * @since 3/26/16. */ public class AnimalManager implements GetCallback<Animal>, SaveCallback { public interface AnimalCallback { void onAnimalFetched(Animal animal); void onErrorFetchingAnimal(Exception ex); } public interface SaveAnimalCallback { void onAnimalSaved(); void onErrorSavingAnimal(Exception e); } AnimalCallback mAnimalCallback; SaveAnimalCallback mSaveAnimalCallback; private AnimalManager() {} public AnimalManager(@NonNull AnimalCallback animalCallback) { mAnimalCallback = animalCallback; } public AnimalManager(@NonNull SaveAnimalCallback saveAnimalCallback) { mSaveAnimalCallback = saveAnimalCallback; } public AnimalManager(@NonNull AnimalCallback animalCallback, @NonNull SaveAnimalCallback saveAnimalCallback) { mAnimalCallback = animalCallback; mSaveAnimalCallback = saveAnimalCallback; } public void queryAnimal(@NonNull String animalId) { ParseQuery<Animal> query = Animal.getQuery(); query.include("user"); query.getInBackground(animalId, this); } @Override public void done(Animal object, ParseException e) { if (e != null) { Timber.e(e, "Error fetching animal: " + e.getLocalizedMessage()); mAnimalCallback.onErrorFetchingAnimal(e); } mAnimalCallback.onAnimalFetched(object.fromParseObject()); } public void saveAnimal(Animal a) { a.toParseObject(); a.saveInBackground(this); } @Override public void done(ParseException e) { if (e == null) { mSaveAnimalCallback.onAnimalSaved(); } else { Timber.e("Error saving animal: " + e.getLocalizedMessage()); mSaveAnimalCallback.onErrorSavingAnimal(e); } } }
[ "marcusandreog@gmail.com" ]
marcusandreog@gmail.com
845c8c7c899fcae99f6f82cc1e5cacc2887d283b
1738448ee909417d470719e95c548d60132470dc
/src/main/java/com/kevin/reidstest/test/ZsetTest.java
bcb2e9a9e2132e4a549f571f238771c5731a834f
[]
no_license
1934312258/redis
659e17674d1a73be1948771e7bd2b8e1da734dd4
a4ee84abdbd1c8f6e22187c2e97c03c2ac78c11c
refs/heads/master
2023-07-21T21:35:37.957265
2021-09-03T01:42:32
2021-09-03T01:42:32
316,885,291
0
0
null
null
null
null
UTF-8
Java
false
false
6,556
java
package com.kevin.reidstest.test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.connection.RedisZSetCommands; import org.springframework.data.redis.core.Cursor; import org.springframework.data.redis.core.DefaultTypedTuple; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.ScanOptions; import org.springframework.data.redis.core.ZSetOperations; import org.springframework.stereotype.Component; import java.io.IOException; import java.util.Arrays; import java.util.HashSet; import java.util.Set; /** * <p> * * </p> * * @author zhaowenjian * @since 2021/6/29 10:27 */ @Component public class ZsetTest { @Autowired ZSetOperations zset; @Autowired RedisTemplate redisTemplate; String key = "zset"; String key1 = "zset1"; String key2 = "zset2"; String sort = "sort"; String kevin = "kevin"; public void zSet(){ // 获取操作对象 zset.getOperations(); boolean flag = zset.add(key,"kevin",10); flag = zset.add(key1,"kevin",1000); flag = zset.add(key2,"kevin",10000); Set set = new HashSet(); set.add(new DefaultTypedTuple("kevin1",11.0)); set.add(new DefaultTypedTuple("kevin2",12.0)); set.add(new DefaultTypedTuple("kevin3",12.0)); //结果为添加的条数 Long result = zset.add(key,set); result = zset.count(key,10,11);//分数范围内的value个数,范围为闭区间 result = zset.count(key,0,-1); flag = zset.add(key,"test",10000000); result = zset.remove(key,"test");// 返回删除数据的条数 flag = zset.add(key,"test",10000000); flag = zset.add(key,"test1",10000000); String [] strs = {"test","test1"}; result = zset.remove(key,strs); Double value = zset.incrementScore(key,kevin,10);// 返回该表后的score值 // 交集 // 取交集时如果分数不同,value值相同则取分数值之和 result = zset.intersectAndStore(key,key1,"ZsetStore"); result = zset.intersectAndStore(key, Arrays.asList(key1,key2),"ZsetStore1"); result = zset.intersectAndStore(key, Arrays.asList(key1,key2),"ZsetStore2", RedisZSetCommands.Aggregate.MAX); RedisZSetCommands.Weights weights = RedisZSetCommands.Weights.of(0.1,0.2,0.3); // weight 代表计算分数时的权重,weight的个数必须与key的个数相同,按顺序为每个key分配权重 result = zset.intersectAndStore(key, Arrays.asList(key1,key2),"ZsetStore3", RedisZSetCommands.Aggregate.SUM,weights); // 获取排序后的下标范围内的数据,数据按分数由小到大排列,后两个值代表下标,下标从零开始 Set setValue = zset.range(key,0,-1); setValue = zset.range(key,1,3); //用于非分数排序的情况,根据value进行排序,没太明白range用法 flag = zset.add(sort,"add",10000); flag = zset.add(sort,"gfd",10000); flag = zset.add(sort,"rgf",10000); setValue = zset.rangeByLex(sort, RedisZSetCommands.Range.range().gte("c")); setValue = zset.rangeByLex(sort, RedisZSetCommands.Range.range().lt("c")); // 研究limit的用法,count保留数据的数量,offset有问题 setValue = zset.rangeByLex(key,RedisZSetCommands.Range.range(), RedisZSetCommands.Limit.limit().count(2)); setValue = zset.rangeByLex(key,RedisZSetCommands.Range.range(), RedisZSetCommands.Limit.limit().offset(0)); //按分数从小到大排列,包含最大值最小值 setValue = zset.rangeByScore(key,11,100); //key,分数最小值分数最大值,offset下标、count保留数量 setValue = zset.rangeByScore(key,10,100,1,10); // 返回结果带分数,从小到大 Set<DefaultTypedTuple> map = zset.rangeWithScores(key,0,-1); map = zset.rangeByScoreWithScores(key,10,100); //key,分数最小值分数最大值,offset下标、count保留数量 map = zset.rangeByScoreWithScores(key,10,100,10,10); // 返回该值的下标 result = zset.rank(key,"kevin"); value = zset.score(key,kevin); // zcard与size底层使用一个方法 result = zset.size(key); result = zset.zCard(key); //此方法排序为从大到小,其他无区别 setValue = zset.reverseRange(key,0,-1); setValue = zset.reverseRangeByScore(key,10,1000); setValue = zset.reverseRangeByScore(key,10,1000,10,10); setValue = zset.reverseRangeWithScores(key,0,-1); map = zset.reverseRangeByScoreWithScores(key,10,1000); map = zset.reverseRangeByScoreWithScores(key,10,1000,10,10); // 返回当前value分数对应的下标,注意排序为从大到小 result = zset.reverseRank(key,kevin+"1"); //并集 result = zset.unionAndStore(key,key1,"uniZset"); result = zset.unionAndStore(key, Arrays.asList(key1,key2),"uniZset1"); result = zset.unionAndStore(key, Arrays.asList(key1,key2),"uniZset2", RedisZSetCommands.Aggregate.MAX); // weight 代表计算分数时的权重,weight的个数必须与key的个数相同,按顺序为每个key分配权重 result = zset.unionAndStore(key, Arrays.asList(key1,key2),"uniZset3", RedisZSetCommands.Aggregate.MAX,RedisZSetCommands.Weights.of(0.1,0.2,0.3)); // scan Cursor<ZSetOperations.TypedTuple<Object>> cursor = zset.scan(key,ScanOptions.scanOptions().match("*").count(1).build()); while(cursor.hasNext()){ ZSetOperations.TypedTuple typedTuple = cursor.next(); System.out.println(typedTuple.getScore()); System.out.println(typedTuple.getValue()); } try { cursor.close(); } catch (IOException e) { e.printStackTrace(); } result = zset.removeRange(key,0,-1); result = zset.removeRangeByScore(key1,0,1000000); result = zset.removeRangeByScore(key2,0,100000000); result = zset.removeRange("uniZset",0,-1); result = zset.removeRange("uniZset1",0,-1); result = zset.removeRange("uniZset2",0,-1); result = zset.removeRange("uniZset3",0,-1); result = zset.removeRange("ZsetStore",0,-1); result = zset.removeRange("ZsetStore1",0,-1); result = zset.removeRange("ZsetStore2",0,-1); result = zset.removeRange("ZsetStore3",0,-1); } }
[ "zhaowenjian@rongxinjf.cn" ]
zhaowenjian@rongxinjf.cn
7ef374a877fe289d393d2a70b93c18a439720662
36ddc3a612a08867ce6eca78e40ea8b60c2cce13
/assignment.4/src/assignment_4/Shape.java
97fd015c8bb573920f633efd6d9f39c1203e9eb0
[]
no_license
al-amine/assignmentsRepo
bdaf90f9c8d0011c87a33914e5e863df050da3e9
eaf172bdba5cf64df02ac0d24ded265eb74b31c7
refs/heads/master
2020-04-30T17:35:31.079927
2019-04-10T15:15:51
2019-04-10T15:15:51
176,984,610
0
1
null
null
null
null
UTF-8
Java
false
false
191
java
package assignment_4; public interface Shape { public static int CalculateArea(int a, int b) { int i=0; return i; } public static void display() { } }
[ "Al-amine AHMED MOUSS@HP-AAM" ]
Al-amine AHMED MOUSS@HP-AAM
93ffd08c46a4556fbc515f3359976edf5a9b46c4
421f0a75a6b62c5af62f89595be61f406328113b
/generated_tests/no_seeding/52_lagoon-nu.staldal.lagoon.core.PartEntry-1.0-7/nu/staldal/lagoon/core/PartEntry_ESTest.java
5c75b3824491412b4338bc9161bc7e34d8caf2e6
[]
no_license
tigerqiu712/evosuite-model-seeding-empirical-evaluation
c78c4b775e5c074aaa5e6ca56bc394ec03c2c7c6
11a920b8213d9855082d3946233731c843baf7bc
refs/heads/master
2020-12-23T21:04:12.152289
2019-10-30T08:02:29
2019-10-30T08:02:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
646
java
/* * This file was automatically generated by EvoSuite * Mon Oct 28 20:50:46 GMT 2019 */ package nu.staldal.lagoon.core; import org.junit.Test; import static org.junit.Assert.*; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true, useJEE = true) public class PartEntry_ESTest extends PartEntry_ESTest_scaffolding { @Test public void notGeneratedAnyTest() { // EvoSuite did not generate any tests } }
[ "pderakhshanfar@bsr01.win.tue.nl" ]
pderakhshanfar@bsr01.win.tue.nl
47976c87c1cd69af77a780ae9496fa0cbc5016fa
3482e834e274106368b0e846a9e89d1c1b7aa541
/app/src/main/java/com/tradeapplication/adapter/OrderListAdapter.java
ac846d777b4080fa8596fb0c199dde17d5acc696
[]
no_license
ryanritabrata/CodeTest
986488e2a537c3e8accb4869495d80520a5d6240
fa9d1c2f1cb9a202735ae0ad6f24a8912bf03e30
refs/heads/master
2020-04-22T01:54:12.267024
2019-02-09T14:04:19
2019-02-09T14:04:19
170,029,037
0
0
null
null
null
null
UTF-8
Java
false
false
2,249
java
package com.tradeapplication.adapter; import android.support.annotation.NonNull; import android.support.v7.widget.RecyclerView; import android.text.Html; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import com.tradeapplication.DetailPage; import com.tradeapplication.R; import com.tradeapplication.responses.Order; import java.util.ArrayList; import java.util.List; public class OrderListAdapter extends RecyclerView.Adapter<OrderListAdapter.MoreRowView> { private ArrayList<Order> moreList; private DetailPage activityReference; class MoreRowView extends RecyclerView.ViewHolder { private TextView type, rate, Qty; MoreRowView(View view) { super(view); type = view.findViewById(R.id.typeItem); rate = view.findViewById(R.id.rateItem); Qty = view.findViewById(R.id.qtyItem); } } public OrderListAdapter(ArrayList<Order> moreList, DetailPage activityRef) { this.moreList = moreList; this.activityReference = activityRef; } @NonNull @Override public MoreRowView onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { View itemView = LayoutInflater.from(parent.getContext()) .inflate(R.layout.order_row, parent, false); return new MoreRowView(itemView); } @Override public void onBindViewHolder(@NonNull final MoreRowView holder, int position) { Order more = moreList.get(position); System.out.println(more.getType()); holder.type.setText(more.getType().toUpperCase()); if (more.getType().toUpperCase().equals("BUY")) holder.type.setTextColor(activityReference.getResources().getColor(R.color.colorPrimary)); else holder.type.setTextColor(activityReference.getResources().getColor(R.color.colorAccent)); holder.rate.setText(Html.fromHtml(activityReference.getResources().getString(R.string.RswithPlus) + more.getRate())); holder.Qty.setText(Html.fromHtml(more.getQty() + " " + activityReference.returnSymbol())); } @Override public int getItemCount() { return moreList.size(); } }
[ "raghavendram@unocoin.com" ]
raghavendram@unocoin.com
7815abbdc5eb192c3c3fba55d13d4d94e15afdbd
4747656a466375a07d06ea7ed7218b70b89cd776
/src/main/java/cn/dao/OrderMapper.java
0fbea9b9af4631115735962a48018efbd1aeba5b
[]
no_license
wufeiwua/TicketingSystem
7390ef35897e4e2b040ecdacd1d0c36d6600b8c7
9024046fe17682045e1319257d6c6eb1eac5ff0c
refs/heads/master
2023-04-27T14:13:12.433592
2022-07-18T13:16:39
2022-07-18T13:16:39
125,618,550
4
1
null
2023-04-17T17:45:10
2018-03-17T10:31:27
Java
UTF-8
Java
false
false
796
java
package cn.dao; import cn.bean.OrderBean; import org.apache.ibatis.annotations.Param; import org.springframework.core.annotation.Order; import java.util.List; /** * @author zhoumin */ public interface OrderMapper { void insertTickets(@Param("order") OrderBean order); void updateTicket(@Param("tickets_id") String tickets_id); List<OrderBean> selectOrderByUserId(@Param("user_id")Integer int_id); List<OrderBean> selectGone(@Param("user_id")Integer int_id); List<OrderBean> selectNotGo(@Param("user_id")Integer int_id); void deleteTicketsByTicketsID(@Param("tickets_id") String tickets_id); int countOrder(@Param("order")OrderBean order); void insertEndorse(@Param("order")OrderBean order); List<OrderBean> selectTrip(@Param("user_id")Integer user_id); }
[ "wufeiwua@126.com" ]
wufeiwua@126.com
3e39901693a845adc44fc49e571b0ca4f1925d73
ae1fe81b14f052839073274d942a675391edf25d
/chat/src0.7/ChatServer.java
d557d5fff7d4721c41f8404da145a3d3cd3ed6c7
[]
no_license
CwithL/For-Java
bbc45d81fe9db6e36936a3b1c5465027d1373b0c
8690a623672f673a8ffb3e3611f26bdb6cf9aacd
refs/heads/master
2020-05-17T07:30:29.936252
2019-02-28T08:33:09
2019-02-28T08:33:09
null
0
0
null
null
null
null
UTF-8
Java
false
false
676
java
import java.io.DataInputStream; import java.io.IOException; import java.net.ServerSocket; import java.net.Socket; public class ChatServer { public static void main(String[] args) { try { ServerSocket serverSocket = new ServerSocket(8088); while(true) { Socket s = serverSocket.accept(); System.out.println("a Client connected"); DataInputStream dis = new DataInputStream(s.getInputStream()); String str = dis.readUTF(); System.out.println(str); dis.close(); } } catch (IOException e) { e.printStackTrace(); } } }
[ "1906885611@qq.com" ]
1906885611@qq.com
30380cbb1fb7e8aa0f136c26ddcc0c231678ea2a
58fd71cef1d09ab52b594529032065e7f7dacff3
/src/test/java/serenity/library_app/LibraryTest.java
5e9f18e2b29ab1efef8b299b4bb51767e79e179d
[]
no_license
Arafat9329/SerenitySelfStarter
a2b41c26a325875ed6014f43a682b9db18316d33
9ce6b4cfc18e5d2d1a3b43ce05ba8a7b70346fec
refs/heads/master
2023-02-08T04:51:09.195734
2020-12-27T21:41:55
2020-12-27T21:41:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,012
java
package serenity.library_app; import io.restassured.RestAssured; import net.serenitybdd.core.environment.EnvironmentSpecificConfiguration; import net.serenitybdd.junit5.SerenityTest; import net.serenitybdd.rest.SerenityRest; import net.thucydides.core.util.EnvironmentVariables; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import static net.serenitybdd.rest.SerenityRest.given; @SerenityTest public class LibraryTest { private EnvironmentVariables environmentVariables ; @BeforeAll public static void setUp(){ RestAssured.baseURI = "http://library1.cybertekschool.com"; RestAssured.basePath = "/rest/v1" ; } @AfterAll public static void tearDown(){ RestAssured.reset(); SerenityRest.clear(); } @Test public void getTokenTest(){ System.out.println(EnvironmentSpecificConfiguration.from(environmentVariables) .getProperty("base.url")); } }
[ "68973655+arpat9329@users.noreply.github.com" ]
68973655+arpat9329@users.noreply.github.com
0e0057102f948ec8607e6ee917ba759ea2e7c4c6
b335007231060f873bb5df88d774b287a053f52e
/com/google/firebase/iid/zzu.java
24511dbf407d2d66a79a87eb91b654fa9b5c5fbc
[]
no_license
NomiasSR/LoveParty1
e1afb449e0c9bba0504ce040bf3d7987a51c3b1a
15e3c8a052cefdd7e0ad6ef44b7962dd72872b8e
refs/heads/master
2020-03-19T08:09:54.672755
2018-06-05T02:00:44
2018-06-05T02:00:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,615
java
package com.google.firebase.iid; import android.content.Context; import android.content.Intent; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; import android.util.Log; import com.google.android.gms.common.util.zzq; import com.google.firebase.FirebaseApp; import java.util.List; final class zzu { private final Context zzair; private String zzct; private String zznzk; private int zznzl; private int zznzm = 0; public zzu(Context context) { this.zzair = context; } public static java.lang.String zzb(java.security.KeyPair r4) { /* JADX: method processing error */ /* Error: java.lang.NullPointerException at jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:75) at jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45) at jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63) at jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58) at jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31) at jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17) at jadx.core.ProcessClass.process(ProcessClass.java:37) at jadx.core.ProcessClass.processDependencies(ProcessClass.java:59) at jadx.core.ProcessClass.process(ProcessClass.java:42) at jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:306) at jadx.api.JavaClass.decompile(JavaClass.java:62) at jadx.api.JadxDecompiler$1.run(JadxDecompiler.java:199) */ /* r4 = r4.getPublic(); r4 = r4.getEncoded(); r0 = "SHA1"; Catch:{ NoSuchAlgorithmException -> 0x0027 } r0 = java.security.MessageDigest.getInstance(r0); Catch:{ NoSuchAlgorithmException -> 0x0027 } r4 = r0.digest(r4); Catch:{ NoSuchAlgorithmException -> 0x0027 } r0 = 0; Catch:{ NoSuchAlgorithmException -> 0x0027 } r1 = r4[r0]; Catch:{ NoSuchAlgorithmException -> 0x0027 } r2 = 112; // 0x70 float:1.57E-43 double:5.53E-322; Catch:{ NoSuchAlgorithmException -> 0x0027 } r3 = 15; Catch:{ NoSuchAlgorithmException -> 0x0027 } r1 = r1 & r3; Catch:{ NoSuchAlgorithmException -> 0x0027 } r2 = r2 + r1; Catch:{ NoSuchAlgorithmException -> 0x0027 } r1 = (byte) r2; Catch:{ NoSuchAlgorithmException -> 0x0027 } r4[r0] = r1; Catch:{ NoSuchAlgorithmException -> 0x0027 } r1 = 8; Catch:{ NoSuchAlgorithmException -> 0x0027 } r2 = 11; Catch:{ NoSuchAlgorithmException -> 0x0027 } r4 = android.util.Base64.encodeToString(r4, r0, r1, r2); Catch:{ NoSuchAlgorithmException -> 0x0027 } return r4; L_0x0027: r4 = "FirebaseInstanceId"; r0 = "Unexpected error, device missing required algorithms"; android.util.Log.w(r4, r0); r4 = 0; return r4; */ throw new UnsupportedOperationException("Method not decompiled: com.google.firebase.iid.zzu.zzb(java.security.KeyPair):java.lang.String"); } private final synchronized void zzcjj() { PackageInfo zzoa = zzoa(this.zzair.getPackageName()); if (zzoa != null) { this.zznzk = Integer.toString(zzoa.versionCode); this.zzct = zzoa.versionName; } } public static String zzf(FirebaseApp firebaseApp) { String gcmSenderId = firebaseApp.getOptions().getGcmSenderId(); if (gcmSenderId != null) { return gcmSenderId; } String applicationId = firebaseApp.getOptions().getApplicationId(); if (!applicationId.startsWith("1:")) { return applicationId; } String[] split = applicationId.split(":"); if (split.length < 2) { return null; } applicationId = split[1]; return applicationId.isEmpty() ? null : applicationId; } private final PackageInfo zzoa(String str) { try { return this.zzair.getPackageManager().getPackageInfo(str, 0); } catch (NameNotFoundException e) { str = String.valueOf(e); StringBuilder stringBuilder = new StringBuilder(23 + String.valueOf(str).length()); stringBuilder.append("Failed to find package "); stringBuilder.append(str); Log.w("FirebaseInstanceId", stringBuilder.toString()); return null; } } public final synchronized int zzcjf() { if (this.zznzm != 0) { return this.zznzm; } PackageManager packageManager = this.zzair.getPackageManager(); if (packageManager.checkPermission("com.google.android.c2dm.permission.SEND", "com.google.android.gms") == -1) { Log.e("FirebaseInstanceId", "Google Play services missing or without correct permission."); return 0; } Intent intent; if (!zzq.isAtLeastO()) { intent = new Intent("com.google.android.c2dm.intent.REGISTER"); intent.setPackage("com.google.android.gms"); List queryIntentServices = packageManager.queryIntentServices(intent, 0); if (queryIntentServices != null && queryIntentServices.size() > 0) { this.zznzm = 1; return this.zznzm; } } intent = new Intent("com.google.iid.TOKEN_REQUEST"); intent.setPackage("com.google.android.gms"); List queryBroadcastReceivers = packageManager.queryBroadcastReceivers(intent, 0); if (queryBroadcastReceivers == null || queryBroadcastReceivers.size() <= 0) { Log.w("FirebaseInstanceId", "Failed to resolve IID implementation package, falling back"); if (zzq.isAtLeastO()) { this.zznzm = 2; } else { this.zznzm = 1; } return this.zznzm; } this.zznzm = 2; return this.zznzm; } public final synchronized String zzcjg() { if (this.zznzk == null) { zzcjj(); } return this.zznzk; } public final synchronized String zzcjh() { if (this.zzct == null) { zzcjj(); } return this.zzct; } public final synchronized int zzcji() { if (this.zznzl == 0) { PackageInfo zzoa = zzoa("com.google.android.gms"); if (zzoa != null) { this.zznzl = zzoa.versionCode; } } return this.zznzl; } }
[ "felipe@techsamurai.com.br" ]
felipe@techsamurai.com.br