blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
390
content_id
stringlengths
40
40
detected_licenses
listlengths
0
35
license_type
stringclasses
2 values
repo_name
stringlengths
6
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
539 values
visit_date
timestamp[us]date
2016-08-02 21:09:20
2023-09-06 10:10:07
revision_date
timestamp[us]date
1990-01-30 01:55:47
2023-09-05 21:45:37
committer_date
timestamp[us]date
2003-07-12 18:48:29
2023-09-05 21:45:37
github_id
int64
7.28k
684M
star_events_count
int64
0
77.7k
fork_events_count
int64
0
48k
gha_license_id
stringclasses
13 values
gha_event_created_at
timestamp[us]date
2012-06-11 04:05:37
2023-09-14 21:59:18
gha_created_at
timestamp[us]date
2008-05-22 07:58:19
2023-08-28 02:39:21
gha_language
stringclasses
62 values
src_encoding
stringclasses
26 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
128
12.8k
extension
stringclasses
11 values
content
stringlengths
128
8.19k
authors
listlengths
1
1
author_id
stringlengths
1
79
d9f5d5fff340d2c07ed05b767a61ef207e965f66
791fed31d1745b773428c7614f35b29e29b5e5b2
/2.JavaCore/src/com/codegym/task/task18/task1815/Solution.java
8a4a50f0fbc3d494e09b55ee70fa7917398da264
[]
no_license
dasra-iscteiulpt/CodeGym
7914bd3e0ef86dd3d6c32f99dc007bc3587639d5
d3d74db6322ea63fb20ecf371afa434465fc1f4e
refs/heads/master
2022-11-18T09:29:25.639448
2020-03-10T11:04:36
2020-03-10T11:04:36
243,569,037
0
1
null
2022-11-16T09:23:26
2020-02-27T16:56:51
Java
UTF-8
Java
false
false
918
java
package com.codegym.task.task18.task1815; import java.util.List; /* Table */ public class Solution { public class TableInterfaceWrapper implements TableInterface { TableInterface ti; public TableInterfaceWrapper(TableInterface ti) { this.ti=ti; } @Override public void setModel(List rows) { System.out.println(rows.size()); ti.setModel(rows); } @Override public String getHeaderText() { return ti.getHeaderText().toUpperCase(); } @Override public void setHeaderText(String newHeaderText) { ti.setHeaderText(newHeaderText); } } public interface TableInterface { void setModel(List rows); String getHeaderText(); void setHeaderText(String newHeaderText); } public static void main(String[] args) { } }
[ "dasra@iscte-iul.pt" ]
dasra@iscte-iul.pt
4c64847123eb5c6a16f80e00f688eb8b5d423efc
69a4f2d51ebeea36c4d8192e25cfb5f3f77bef5e
/methods/Method_1013812.java
e4d0dc4de05b77ada7e4cb523fc47f33a89ae59b
[]
no_license
P79N6A/icse_20_user_study
5b9c42c6384502fdc9588430899f257761f1f506
8a3676bc96059ea2c4f6d209016f5088a5628f3c
refs/heads/master
2020-06-24T08:25:22.606717
2019-07-25T15:31:16
2019-07-25T15:31:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
549
java
@Override public SimpleErrorMessage check(){ StringBuilder sb=new StringBuilder(); for ( Redis redis : redises) { try { new PingCommand(pool.getKeyPool(new DefaultEndPoint(redis.getIp(),redis.getPort())),scheduled).execute().get(); return SimpleErrorMessage.success(); } catch ( InterruptedException|ExecutionException e) { logger.info("[check]",e); sb.append(String.format("%s: %s\r\n",redis.desc(),ExceptionUtils.getRootCause(e).getMessage())); } } return SimpleErrorMessage.fail(sb.toString()); }
[ "sonnguyen@utdallas.edu" ]
sonnguyen@utdallas.edu
0a895def260c98012dd3c04357c0fe3138c5ae1b
d1dd19f11259bdb2424f0832471495a50a08f66f
/Editor/src/com/kotcrab/vis/editor/proxy/SpriteProxy.java
3ee1c660c8168579873231e9e08c2955bea69f9a
[ "Apache-2.0" ]
permissive
omomthings/VisEditor
515be6f430cfd8da83c09c0dd985c8059456dbe3
8af63145384c6eaefccda2d798b2c804b307dd6b
refs/heads/master
2020-12-11T02:04:22.766092
2015-12-17T20:20:34
2015-12-17T20:20:34
48,196,825
0
0
null
2015-12-17T20:32:44
2015-12-17T20:32:44
null
UTF-8
Java
false
false
5,242
java
/* * Copyright 2014-2015 See AUTHORS file. * * 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.kotcrab.vis.editor.proxy; import com.artemis.Entity; import com.badlogic.gdx.math.MathUtils; import com.badlogic.gdx.math.Rectangle; import com.kotcrab.vis.runtime.component.*; import com.kotcrab.vis.runtime.properties.BoundsOwner; /** @author Kotcrab */ public class SpriteProxy extends EntityProxy { private Accessor accessor; private Transform transform; private Origin origin; private VisSprite sprite; public SpriteProxy (Entity entity) { super(entity); } @Override protected void createAccessors () { accessor = new Accessor(); } @Override protected void reloadAccessors () { Entity entity = getEntity(); sprite = entity.getComponent(VisSprite.class); transform = entity.getComponent(Transform.class); origin = entity.getComponent(Origin.class); Tint tint = entity.getComponent(Tint.class); enableBasicProperties(transform, sprite, accessor); enableOrigin(origin); enableScale(transform); enableTint(tint); enableRotation(transform); enableFlip(sprite); } @Override public String getEntityName () { return "Sprite"; } private class Accessor implements BoundsOwner { private static final int X1 = 0; private static final int X2 = 1; private static final int X3 = 2; private static final int X4 = 3; private static final int Y1 = 4; private static final int Y2 = 5; private static final int Y3 = 6; private static final int Y4 = 7; private float[] vertices = new float[8]; private Rectangle bounds = new Rectangle(); @Override public Rectangle getBoundingRectangle () { calcBounds(); return bounds; } public Rectangle calcBounds () { final float[] vertices = getVertices(); float minx = vertices[X1]; float miny = vertices[Y1]; float maxx = vertices[X1]; float maxy = vertices[Y1]; minx = minx > vertices[X2] ? vertices[X2] : minx; minx = minx > vertices[X3] ? vertices[X3] : minx; minx = minx > vertices[X4] ? vertices[X4] : minx; maxx = maxx < vertices[X2] ? vertices[X2] : maxx; maxx = maxx < vertices[X3] ? vertices[X3] : maxx; maxx = maxx < vertices[X4] ? vertices[X4] : maxx; miny = miny > vertices[Y2] ? vertices[Y2] : miny; miny = miny > vertices[Y3] ? vertices[Y3] : miny; miny = miny > vertices[Y4] ? vertices[Y4] : miny; maxy = maxy < vertices[Y2] ? vertices[Y2] : maxy; maxy = maxy < vertices[Y3] ? vertices[Y3] : maxy; maxy = maxy < vertices[Y4] ? vertices[Y4] : maxy; bounds.x = minx; bounds.y = miny; bounds.width = maxx - minx; bounds.height = maxy - miny; return bounds; } private float[] getVertices () { float[] vertices = this.vertices; float localX = -origin.getOriginX(); float localY = -origin.getOriginY(); float localX2 = localX + sprite.getWidth(); float localY2 = localY + sprite.getHeight(); float worldOriginX = transform.getX() - localX; float worldOriginY = transform.getY() - localY; if (transform.getScaleX() != 1 || transform.getScaleY() != 1) { localX *= transform.getScaleX(); localY *= transform.getScaleY(); localX2 *= transform.getScaleX(); localY2 *= transform.getScaleY(); } if (transform.getRotation() != 0) { final float cos = MathUtils.cosDeg(transform.getRotation()); final float sin = MathUtils.sinDeg(transform.getRotation()); final float localXCos = localX * cos; final float localXSin = localX * sin; final float localYCos = localY * cos; final float localYSin = localY * sin; final float localX2Cos = localX2 * cos; final float localX2Sin = localX2 * sin; final float localY2Cos = localY2 * cos; final float localY2Sin = localY2 * sin; final float x1 = localXCos - localYSin + worldOriginX; final float y1 = localYCos + localXSin + worldOriginY; vertices[X1] = x1; vertices[Y1] = y1; final float x2 = localXCos - localY2Sin + worldOriginX; final float y2 = localY2Cos + localXSin + worldOriginY; vertices[X2] = x2; vertices[Y2] = y2; final float x3 = localX2Cos - localY2Sin + worldOriginX; final float y3 = localY2Cos + localX2Sin + worldOriginY; vertices[X3] = x3; vertices[Y3] = y3; vertices[X4] = x1 + (x3 - x2); vertices[Y4] = y3 - (y2 - y1); } else { final float x1 = localX + worldOriginX; final float y1 = localY + worldOriginY; final float x2 = localX2 + worldOriginX; final float y2 = localY2 + worldOriginY; vertices[X1] = x1; vertices[Y1] = y1; vertices[X2] = x1; vertices[Y2] = y2; vertices[X3] = x2; vertices[Y3] = y2; vertices[X4] = x2; vertices[Y4] = y1; } return vertices; } } }
[ "kotcrab@gmail.com" ]
kotcrab@gmail.com
867fcef4bcd7d84e16fc14d97652a078b77375ab
683463a54d032b62de2222a3ca054d63c0ba7a74
/core/src/org/egordorichev/lasttry/world/chunk/EmptyChunk.java
38cf6c330a9ccf9a306e88177d5a607ea77caee7
[ "MIT" ]
permissive
Col-E/LastTry
580d90c01857c3385548ab32a1cf461d1ad1235b
c36472cddf10b42862a0ed2212f5953a929cb6f6
refs/heads/dev
2021-01-21T16:57:29.719134
2017-05-20T12:50:10
2017-05-20T12:50:10
84,872,707
1
0
null
2017-03-13T20:44:14
2017-03-13T20:44:14
null
UTF-8
Java
false
false
876
java
package org.egordorichev.lasttry.world.chunk; import com.badlogic.gdx.math.Vector2; import org.egordorichev.lasttry.item.ItemID; public class EmptyChunk extends Chunk { public EmptyChunk(Vector2 position) { super(null, position); } @Override public void setBlock(short id, int globalX, int globalY) { } @Override public void setBlockHP(byte hp, int globalX, int globalY) { } @Override public void setWall(short id, int globalX, int globalY) { } @Override public void setWallHP(byte hp, int globalX, int globalY) { } @Override public short getBlock(int globalX, int globalY) { return ItemID.none; } @Override public byte getBlockHP(int globalX, int globalY) { return 0; } @Override public short getWall(int globalX, int globalY) { return ItemID.none; } @Override public byte getWallHP(int globalX, int globalY) { return 0; } }
[ "egordorichev@gmail.com" ]
egordorichev@gmail.com
e1d14852406784d42ec0f332ce5a342377a23ecb
e63363389e72c0822a171e450a41c094c0c1a49c
/Mate20_10_1_0/src/main/java/com/huawei/android/location/activityrecognition/HwActivityRecognitionEvent.java
0201ff06792074b94c6cb7aaf8a5d84c81443a4f
[]
no_license
solartcc/HwFrameWorkSource
fc23ca63bcf17865e99b607cc85d89e16ec1b177
5b92ed0f1ccb4bafc0fdb08b6fc4d98447b754ad
refs/heads/master
2022-12-04T21:14:37.581438
2020-08-25T04:30:43
2020-08-25T04:30:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,716
java
package com.huawei.android.location.activityrecognition; import android.os.Parcel; import android.os.Parcelable; public class HwActivityRecognitionEvent implements Parcelable { public static final Creator<HwActivityRecognitionEvent> CREATOR = new Creator<HwActivityRecognitionEvent>() { /* class com.huawei.android.location.activityrecognition.HwActivityRecognitionEvent.AnonymousClass1 */ @Override // android.os.Parcelable.Creator public HwActivityRecognitionEvent createFromParcel(Parcel source) { String activity = source.readString(); int eventType = source.readInt(); long timestampNs = source.readLong(); if (HwActivityRecognition.getARServiceVersion() == 1) { return new HwActivityRecognitionEvent(activity, eventType, timestampNs, source.readInt()); } return new HwActivityRecognitionEvent(activity, eventType, timestampNs); } @Override // android.os.Parcelable.Creator public HwActivityRecognitionEvent[] newArray(int size) { return new HwActivityRecognitionEvent[size]; } }; private final String mActivity; private int mConfidence; private final int mEventType; private final long mTimestampNs; public HwActivityRecognitionEvent(String activity, int eventType, long timestampNs) { this.mActivity = activity; this.mEventType = eventType; this.mTimestampNs = timestampNs; this.mConfidence = -2; } public HwActivityRecognitionEvent(String activity, int eventType, long timestampNs, int confidence) { this.mActivity = activity; this.mEventType = eventType; this.mTimestampNs = timestampNs; this.mConfidence = confidence; } public String getActivity() { return this.mActivity; } public int getEventType() { return this.mEventType; } public long getTimestampNs() { return this.mTimestampNs; } public int getConfidence() { return this.mConfidence; } public int describeContents() { return 0; } public void writeToParcel(Parcel parcel, int flags) { parcel.writeString(this.mActivity); parcel.writeInt(this.mEventType); parcel.writeLong(this.mTimestampNs); if (HwActivityRecognition.getARServiceVersion() == 1) { parcel.writeInt(this.mConfidence); } } public String toString() { return String.format("Activity='%s', EventType=%s, TimestampNs=%s, Confidence=%s", this.mActivity, Integer.valueOf(this.mEventType), Long.valueOf(this.mTimestampNs), Integer.valueOf(this.mConfidence)); } }
[ "lygforbs0@gmail.com" ]
lygforbs0@gmail.com
8d0d5388459d66764941e3e3cf4952fbacf13201
79943487f9311a0886a2cc2e5f1732f32c1b04ff
/engine/src/main/java/com/agiletec/aps/system/services/page/IPageManager.java
af6d48e494e444e73fd851848dd0b6f3a7f3f025
[]
no_license
Denix80/entando-core
f3b8827f9fe0789169f6e6cc160fbc2c6f322d45
c861199d39d28edb2d593203450d43a8ecaad7b4
refs/heads/master
2021-01-17T21:28:57.188088
2015-09-21T10:56:40
2015-09-21T10:56:40
42,932,167
0
0
null
2015-09-22T12:26:06
2015-09-22T12:26:06
null
UTF-8
Java
false
false
4,688
java
/* * Copyright 2013-Present Entando Corporation (http://www.entando.com) All rights reserved. * * This library is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free * Software Foundation; either version 2.1 of the License, or (at your option) * any later version. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. */ package com.agiletec.aps.system.services.page; import java.util.List; import com.agiletec.aps.system.common.tree.ITreeNodeManager; import com.agiletec.aps.system.exception.ApsSystemException; /** * Basic interface for the page manager services. * @author M.Diana */ public interface IPageManager extends ITreeNodeManager { /** * Delete a page and eventually the association with the showlets. * @param pageCode the code of the page to delete * @throws ApsSystemException In case of database access error. */ public void deletePage(String pageCode) throws ApsSystemException; /** * Add a new page to the database. * @param page The page to add * @throws ApsSystemException In case of database access error. */ public void addPage(IPage page) throws ApsSystemException; /** * Update a page record in the database. * @param page The modified page. * @throws ApsSystemException In case of database access error. */ public void updatePage(IPage page) throws ApsSystemException; /** * Move a page. * @param pageCode The code of the page to move. * @param moveUp When true the page is moved to a higher level of the tree, otherwise to a lower level. * @return The result of the operation: false if the move request could not be satisfied, true otherwise. * @throws ApsSystemException In case of database access error. */ public boolean movePage(String pageCode, boolean moveUp) throws ApsSystemException; /** * Move a widget. * @param pageCode The code of the page to configure. * @param frameToMove the frame position to move . * @param destFrame the frame final position . * @return The result of the operation: false if the move request could not be satisfied, true otherwise. * @throws ApsSystemException In case of database access error. */ public boolean moveWidget(String pageCode, Integer frameToMove, Integer destFrame) throws ApsSystemException; /** * @deprecated Use {@link #joinWidget(String,Widget,int)} instead */ public void joinShowlet(String pageCode, Widget widget, int pos) throws ApsSystemException; /** * Set the showlet -including its configuration- in the given page in the desidered position. * If the position is already occupied by another showlet this will be substituted with the * new one. * @param pageCode the code of the page where to set the showlet * @param widget The showlet to set * @param pos The position where to place the showlet in * @throws ApsSystemException In case of error. */ public void joinWidget(String pageCode, Widget widget, int pos) throws ApsSystemException; /** * @deprecated Use {@link #removeWidget(String,int)} instead */ public void removeShowlet(String pageCode, int pos) throws ApsSystemException; /** * Remove a widget from the given page. * @param pageCode the code of the widget to remove from the page * @param pos The position in the page to free * @throws ApsSystemException In case of error */ public void removeWidget(String pageCode, int pos) throws ApsSystemException; /** * Return the root of the pages tree. * @return the root page. */ public IPage getRoot(); /** * Return a page given the name. * @param pageCode The code of the page * @return the requested page. */ public IPage getPage(String pageCode); /** * Search pages by a token of its code. * @param pageCodeToken The token containing to be looked up across the pages. * @param allowedGroups The codes of allowed page groups. * @return A list of candidates containing the given token. If the pageCodeToken is null then * this method will return the full list of pages. * @throws ApsSystemException in case of error. */ public List<IPage> searchPages(String pageCodeToken, List<String> allowedGroups) throws ApsSystemException; /** * @deprecated Use {@link #getWidgetUtilizers(String)} instead */ public List<IPage> getShowletUtilizers(String showletTypeCode) throws ApsSystemException; public List<IPage> getWidgetUtilizers(String widgetTypeCode) throws ApsSystemException; }
[ "eugenio.santoboni@gmail.com" ]
eugenio.santoboni@gmail.com
0093c7aa7d28979e96e321f3e87fece81eb86f78
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/30/30_f9f285fd9b5ecc7f9915c0c0db4477bc7211c533/RepositoryValidator/30_f9f285fd9b5ecc7f9915c0c0db4477bc7211c533_RepositoryValidator_s.java
c523c898cc1a9306c2ba8605a0634beb41577b49
[]
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
1,061
java
/******************************************************************************* * Copyright (c) 2010 Tasktop Technologies and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Tasktop Technologies - initial API and implementation *******************************************************************************/ package org.eclipse.mylyn.commons.repositories; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; /** * @author Steffen Pingel */ public abstract class RepositoryValidator { private final RepositoryLocation location; public RepositoryValidator(RepositoryLocation location) { this.location = location; } public RepositoryLocation getLocation() { return location; } public abstract IStatus run(IProgressMonitor monitor); }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
b9a92b1adb5b9470ad7024b322c7bcffc28a6d53
a042d3fcf645e027896edfb883ff69f175430d10
/sql/sql-integration-test/src/test/java/ExpectJdbcBatchingWithoutBatchSizeTest.java
d92ee97fce3af0d140bb2c3950a54bd6dc74010d
[ "Apache-2.0" ]
permissive
edwardrose946/quickperf
c7d77318013df73882638c4aff290431b8cb6a24
c9f23e53c48a149ec309bc41b290d98fc236e77f
refs/heads/master
2022-09-09T02:38:32.024732
2020-05-29T15:37:49
2020-05-29T15:37:49
263,397,199
0
1
Apache-2.0
2020-05-29T15:37:51
2020-05-12T16:53:01
null
UTF-8
Java
false
false
5,994
java
/* * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. * * Copyright 2019-2020 the original author or authors. */ import org.junit.Test; import org.junit.experimental.results.PrintableResult; import org.junit.runner.RunWith; import org.quickperf.junit4.QuickPerfJUnitRunner; import org.quickperf.jvm.allocation.AllocationUnit; import org.quickperf.jvm.annotations.HeapSize; import org.quickperf.sql.Book; import org.quickperf.sql.annotation.ExpectJdbcBatching; import javax.persistence.Query; import java.util.Properties; import static org.assertj.core.api.Assertions.assertThat; import static org.quickperf.sql.config.HibernateConfigBuilder.anHibernateConfig; public class ExpectJdbcBatchingWithoutBatchSizeTest { @RunWith(QuickPerfJUnitRunner.class) public static class AClassHavingAPassingMethodAnnotatedExpectJdbcBatchingWithoutBatchSize extends SqlTestBase { private static final int BATCH_SIZE = 30; @Override protected Properties getHibernateProperties() { return anHibernateConfig() .withBatchSize(BATCH_SIZE) .build(); } @Test @ExpectJdbcBatching() @HeapSize(value = 20, unit = AllocationUnit.MEGA_BYTE) public void execute_insert_queries_in_batch_mode() { executeInATransaction(entityManager -> { for (int i = 0; i < 1_000; i++) { Book newBook = new Book(); newBook.setTitle("new book"); if (i % BATCH_SIZE == 0) { entityManager.flush(); entityManager.clear(); } entityManager.persist(newBook); } }); } } @Test public void should_verify_that_sql_orders_are_batched_without_checking_batch_size() { Class<?> testClass = AClassHavingAPassingMethodAnnotatedExpectJdbcBatchingWithoutBatchSize.class; PrintableResult printableResult = PrintableResult.testResult(testClass); assertThat(printableResult.failureCount()).isZero(); } @RunWith(QuickPerfJUnitRunner.class) public static class AClassHavingAFailingMethodAnnotatedExpectJdbcBatchingWithoutBatchSize extends SqlTestBase { @Test @ExpectJdbcBatching() public void execute_not_batched_insert_queries() { executeInATransaction(entityManager -> { String firstInsertQueryAsString = "INSERT INTO Book (id, title) VALUES (1200, 'Book title')"; Query query = entityManager.createNativeQuery(firstInsertQueryAsString); query.executeUpdate(); String secondInsertQueryAsString = "INSERT INTO Book (id, title) VALUES (1300, 'Book title')"; Query secondInsertQuery = entityManager.createNativeQuery(secondInsertQueryAsString); secondInsertQuery.executeUpdate(); }); } } @Test public void should_fail_with_two_insert_queries_not_batched() { Class<?> testClass = AClassHavingAFailingMethodAnnotatedExpectJdbcBatchingWithoutBatchSize.class; PrintableResult printableResult = PrintableResult.testResult(testClass); assertThat(printableResult.failureCount()).isOne(); assertThat(printableResult.toString()) .contains("[PERF] SQL executions were supposed to be batched."); } @RunWith(QuickPerfJUnitRunner.class) public static class AClassHavingAMethodAnnotatedWithExpectJdbcBatchingAndExecutingOneInsertNotBatched extends SqlTestBase { @Test @ExpectJdbcBatching() public void execute_one_insert_not_batched() { executeInATransaction(entityManager -> { String firstInsertQueryAsString = "INSERT INTO Book (id, title) VALUES (1200, 'Book title')"; Query query = entityManager.createNativeQuery(firstInsertQueryAsString); query.executeUpdate(); }); } } @Test public void should_fail_with_one_insert_and_no_batch_mode() { Class<?> testClass = AClassHavingAMethodAnnotatedWithExpectJdbcBatchingAndExecutingOneInsertNotBatched.class; PrintableResult testResult = PrintableResult.testResult(testClass); assertThat(testResult.failureCount()).isOne(); assertThat(testResult.toString()).contains("SQL executions were supposed to be batched"); } @RunWith(QuickPerfJUnitRunner.class) public static class AClassHavingAMethodAnnotatedWithExpectJdbcBatchingAndExecutingOneInsertBatched extends SqlTestBase { @Override protected Properties getHibernateProperties() { return anHibernateConfig() .withBatchSize(30) .build(); } @Test @ExpectJdbcBatching() public void execute_one_insert_in_batch_mode() { executeInATransaction(entityManager -> { Book newBook = new Book(); newBook.setTitle("new book"); entityManager.persist(newBook); }); } } @Test public void should_pass_with_one_insert_and_batch_mode() { Class<?> testClass = AClassHavingAMethodAnnotatedWithExpectJdbcBatchingAndExecutingOneInsertBatched.class; PrintableResult testResult = PrintableResult.testResult(testClass); assertThat(testResult.failureCount()).isZero(); } }
[ "jean.bisutti@gmail.com" ]
jean.bisutti@gmail.com
3beff068216f1afb0a257a384cdda12ee8979465
a2b699456c94eed6cc54bf8366d1fab91781aeca
/inf-root/inf-base/src/main/java/org/n3r/idworker/strategy/FileLock.java
84df43e84003ecdf608888c4343ffcd6640361f6
[]
no_license
elephant5/old-code
8a35aa17163e87f506c6f12da032b1978b0c4ec3
bfb27297d5fcb6aaea8eac5a4032eba7d01cc7ee
refs/heads/master
2023-01-24T12:25:53.549609
2020-12-04T01:50:15
2020-12-04T01:50:15
318,364,156
1
2
null
null
null
null
UTF-8
Java
false
false
4,238
java
package org.n3r.idworker.strategy; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.*; import java.nio.channels.Channels; import java.nio.channels.ClosedChannelException; import java.nio.channels.FileChannel; import java.nio.channels.OverlappingFileLockException; /** * A file lock a la flock/funlock * <p/> * The given path will be created and opened if it doesn't exist. */ public class FileLock { private final File file; private FileChannel channel; private java.nio.channels.FileLock flock = null; Logger logger = LoggerFactory.getLogger(FileLock.class); public FileLock(File file) { this.file = file; try { file.createNewFile(); // create the file if it doesn't exist channel = new RandomAccessFile(file, "rw").getChannel(); } catch (IOException e) { throw new RuntimeException(e); } } /** * Lock the file or throw an exception if the lock is already held */ public void lock() { try { synchronized (this) { logger.trace("Acquiring lock on {}", file.getAbsolutePath()); flock = channel.lock(); } } catch (IOException e) { throw new RuntimeException(e); } } /** * Try to lock the file and return true if the locking succeeds */ public boolean tryLock() { synchronized (this) { logger.trace("Acquiring lock on {}", file.getAbsolutePath()); try { // weirdly this method will return null if the lock is held by another // process, but will throw an exception if the lock is held by this process // so we have to handle both cases flock = channel.tryLock(); return flock != null; } catch (OverlappingFileLockException e) { return false; } catch (IOException e) { throw new RuntimeException(e); } } } /** * Unlock the lock if it is held */ public void unlock() { synchronized (this) { logger.trace("Releasing lock on {}", file.getAbsolutePath()); if (flock == null) return; try { flock.release(); } catch (ClosedChannelException e) { // Ignore } catch (IOException e) { throw new RuntimeException(e); } } } /** * Destroy this lock, closing the associated FileChannel */ public void destroy() { synchronized (this) { unlock(); if (!channel.isOpen()) return; try { channel.close(); } catch (IOException e) { throw new RuntimeException(e); } } } @SuppressWarnings("unchecked") public <T> T readObject() { InputStream is = null; try { is = Channels.newInputStream(channel); ObjectInputStream objectReader = new ObjectInputStream(is); return (T) objectReader.readObject(); } catch (EOFException e) { } catch (Exception e) { throw new RuntimeException(e); } finally { if (is != null) { try { is.close(); } catch (Exception e) { e.printStackTrace(); } } } return null; } public synchronized boolean writeObject(Object object) { if (!channel.isOpen()) return false; OutputStream out = null; try { channel.position(0); out = Channels.newOutputStream(channel); ObjectOutputStream objectOutput = new ObjectOutputStream(out); objectOutput.writeObject(object); return true; } catch (Exception e) { throw new RuntimeException(e); } finally { if (out != null) { try { out.close(); } catch (Exception e) { e.printStackTrace(); } } } } }
[ "ryan.wu@colourchina.com" ]
ryan.wu@colourchina.com
d23e0e246e8e3185cff1637900f7e55f0883360b
0851aefb321a3a4adf6ad4384a1bf3704e90a402
/uengine/src/main/java/org/uengine/ui/tree/model/Form.java
c0b70a4db6b58acb287d567dbf215d4dc0f58b1b
[ "GPL-3.0-or-later", "GPL-1.0-or-later", "GPL-3.0-only", "EPL-2.0", "Apache-2.0", "LGPL-2.1-or-later", "LicenseRef-scancode-warranty-disclaimer", "LGPL-2.0-or-later", "LicenseRef-scancode-proprietary-license" ]
permissive
Lusky87/gas_bpm
3b77016bbe66e88240ab131274de8bb001aff683
8bc7469a5fb0a58a2b841d71b9521d231930e67f
refs/heads/master
2020-04-08T22:32:50.652588
2018-11-28T09:19:38
2018-11-28T09:19:38
159,791,275
1
0
Apache-2.0
2018-11-30T08:20:18
2018-11-30T08:20:17
null
UTF-8
Java
false
false
326
java
package org.uengine.ui.tree.model; public class Form { private String ver; private int defVerId; public String getVer() { return ver; } public void setVer(String ver) { this.ver = ver; } public int getDefVerId() { return defVerId; } public void setDefVerId(int defVerId) { this.defVerId = defVerId; } }
[ "freshka1@gmail.com" ]
freshka1@gmail.com
0f0a8ac29a4827ef0e17ad1bb701601f7e41c566
53ec01fa57d9cdc7e7fd3364990713d211e1c414
/HHKB2020/e/Main.java
d2e7cf310709402ea030a2b4f1547ca0e5177d1e
[]
no_license
nekoTheShadow/atcoder-answers
4f2cae82ac2b24df4153c43381ce58084647704c
461e5a9b00718fd9a3b19dc6071da0fb3192f34e
refs/heads/master
2022-02-03T18:24:01.673661
2022-01-24T14:43:44
2022-01-24T14:43:44
165,072,722
0
0
null
2020-03-22T13:25:56
2019-01-10T14:19:52
Java
UTF-8
Java
false
false
5,870
java
package e; import java.io.BufferedReader; import java.io.EOFException; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.io.UncheckedIOException; import java.lang.reflect.Array; import java.util.ArrayDeque; import java.util.Arrays; import java.util.Deque; import java.util.Objects; import java.util.regex.Pattern; import java.util.stream.Collectors; public class Main { public void exec() { int h = stdin.nextInt(); int w = stdin.nextInt(); char[][] s = new char[h][]; for (int i = 0; i < h; i++) s[i] = stdin.nextString().toCharArray(); int[][] a = new int[h][w]; int[][] b = new int[h][w]; int[][] c = new int[h][w]; int[][] d = new int[h][w]; int k = 0; for (int i = 0; i < h; i++) { for (int j = 0; j < w; j++) { if (s[i][j] == '.') { a[i][j]++; b[i][j]++; c[i][j]++; d[i][j]++; k++; } } } for (int i = 0; i < h; i++) { for (int j = 0; j < w; j++) { if (i+1 < h && s[i+1][j]=='.') a[i+1][j] += a[i][j]; if (j+1 < w && s[i][j+1]=='.') c[i][j+1] += c[i][j]; } } for (int i = h-1; i >= 0; i--) { for (int j = w-1; j >= 0; j--) { if (i-1 >= 0 && s[i-1][j]=='.') b[i-1][j] += b[i][j]; if (j-1 >= 0 && s[i][j-1]=='.') d[i][j-1] += d[i][j]; } } long mod = 1_000_000_007; long[] modPow = new long[k+1]; modPow[0] = 1; for (int i = 0; i < k; i++) { modPow[i+1] = (modPow[i]*2) % mod; } long ans = 0; for (int i = 0; i < h; i++) { for (int j = 0; j < w; j++) { if (s[i][j] == '.') { int x = a[i][j]+b[i][j]+c[i][j]+d[i][j]-3; long y = modPow[k] - modPow[k-x]; if (y < 0) y += mod; ans += y; ans %= mod; } } } stdout.println(ans); } private static final Stdin stdin = new Stdin(); private static final Stdout stdout = new Stdout(); public static void main(String[] args) { try { new Main().exec(); } finally { stdout.flush(); } } public static class Stdin { private BufferedReader stdin; private Deque<String> tokens; private Pattern delim; public Stdin() { stdin = new BufferedReader(new InputStreamReader(System.in)); tokens = new ArrayDeque<>(); delim = Pattern.compile(" "); } public String nextString() { try { if (tokens.isEmpty()) { String line = stdin.readLine(); if (line == null) { throw new UncheckedIOException(new EOFException()); } delim.splitAsStream(line).forEach(tokens::addLast); } return tokens.pollFirst(); } catch (IOException e) { throw new UncheckedIOException(e); } } public int nextInt() { return Integer.parseInt(nextString()); } public double nextDouble() { return Double.parseDouble(nextString()); } public long nextLong() { return Long.parseLong(nextString()); } public String[] nextStringArray(int n) { String[] a = new String[n]; for (int i = 0; i < n; i++) a[i] = nextString(); return a; } public int[] nextIntArray(int n) { int[] a = new int[n]; for (int i = 0; i < n; i++) a[i] = nextInt(); return a; } public double[] nextDoubleArray(int n) { double[] a = new double[n]; for (int i = 0; i < n; i++) a[i] = nextDouble(); return a; } public long[] nextLongArray(int n) { long[] a = new long[n]; for (int i = 0; i < n; i++) a[i] = nextLong(); return a; } } public static class Stdout { private PrintWriter stdout; public Stdout() { stdout = new PrintWriter(System.out, false); } public void printf(String format, Object ... args) { String line = String.format(format, args); if (line.endsWith(System.lineSeparator())) { stdout.print(line); } else { stdout.println(line); } } public void println(Object ... objs) { String line = Arrays.stream(objs).map(Objects::toString).collect(Collectors.joining(" ")); stdout.println(line); } public void printDebug(Object ... objs) { String line = Arrays.stream(objs).map(this::deepToString).collect(Collectors.joining(" ")); stdout.printf("DEBUG: %s%n", line); stdout.flush(); } private String deepToString(Object o) { if (o == null) { return "null"; } // 配列の場合 if (o.getClass().isArray()) { int len = Array.getLength(o); String[] tokens = new String[len]; for (int i = 0; i < len; i++) { tokens[i] = deepToString(Array.get(o, i)); } return "{" + String.join(",", tokens) + "}"; } return Objects.toString(o); } private void flush() { stdout.flush(); } } }
[ "h.nakamura0903@gmail.com" ]
h.nakamura0903@gmail.com
1b0271f222ff71e1c37ec4cb2b55fb8fccd21f40
5a027c7a6d9afc1bbc8b2bc86e43e96b80dd9fa8
/workspace_movistar_wl11/zejbBandejaClient/src/com/telefonica_chile/bandeja/usuariossupervisadossession/UsuariosSupervisadosSession.java
2b6d685ebb21213d62378bb3c4b059495b2a8829
[]
no_license
alexcamp/ArrobaTiempoGradle
00135dc6f101e99026a377adc0d3b690cb5f2bd7
fc4a845573232e332c5f1211b72216ce227c3f38
refs/heads/master
2020-12-31T00:18:57.337668
2016-05-27T15:02:04
2016-05-27T15:02:04
59,520,455
0
0
null
null
null
null
UTF-8
Java
false
false
220
java
package com.telefonica_chile.bandeja.usuariossupervisadossession; /** * Remote interface for Enterprise Bean: UsuariosSupervisadosSession */ public interface UsuariosSupervisadosSession extends javax.ejb.EJBObject { }
[ "alexander5075@hotmail.com" ]
alexander5075@hotmail.com
8b6088ac941bf4b0d809a67b3b6fb7fe94724a1b
2f3c04382a66dbf222c8587edd67a5df4bc80422
/src/com/cedar/cp/ejb/impl/cm/event/PostUpdateHierarchyElementEvent.java
baad8d662918759fbebf231c26dbdedb78adb961
[]
no_license
arnoldbendaa/cppro
d3ab6181cc51baad2b80876c65e11e92c569f0cc
f55958b85a74ad685f1360ae33c881b50d6e5814
refs/heads/master
2020-03-23T04:18:00.265742
2018-09-11T08:15:28
2018-09-11T08:15:28
141,074,966
0
0
null
null
null
null
UTF-8
Java
false
false
654
java
// Decompiled by: Fernflower v0.8.6 // Date: 12.08.2012 13:08:09 // Copyright: 2008-2012, Stiver // Home page: http://www.neshkov.com/ac_decompiler.html package com.cedar.cp.ejb.impl.cm.event; import com.cedar.cp.ejb.impl.dimension.HierarchyElementDAG; import java.io.Serializable; public class PostUpdateHierarchyElementEvent implements Serializable { private HierarchyElementDAG mElement; public PostUpdateHierarchyElementEvent(HierarchyElementDAG element) { this.mElement = element; } public HierarchyElementDAG getElement() { return this.mElement; } }
[ "arnoldbendaa@gmail.com" ]
arnoldbendaa@gmail.com
bc0d2335dc897cf7f380b66be513afd3e063e4b6
531a070afb140c0fb98926f2a0f2dc88ed3ae7b7
/src/com/igomall/dao/impl/ReviewDaoImpl.java
cefde234abfc2ab19b59d00738443c44e65abd7d
[]
no_license
javaknow/mall
25985534dd4cfa7512c68f67a08d029461b864b9
31a327a3fad8aecd949d82c7ce8e266eaac4b900
refs/heads/master
2021-01-21T19:19:55.867750
2016-06-16T04:37:17
2016-06-16T04:37:39
65,459,518
1
2
null
2016-08-11T10:04:01
2016-08-11T10:04:01
null
UTF-8
Java
false
false
6,151
java
/* * * * */ package com.igomall.dao.impl; import java.util.List; import javax.persistence.FlushModeType; import javax.persistence.criteria.CriteriaBuilder; import javax.persistence.criteria.CriteriaQuery; import javax.persistence.criteria.Predicate; import javax.persistence.criteria.Root; import com.igomall.Filter; import com.igomall.Order; import com.igomall.Page; import com.igomall.Pageable; import com.igomall.dao.ReviewDao; import com.igomall.entity.Member; import com.igomall.entity.Product; import com.igomall.entity.Review; import com.igomall.entity.Review.Type; import org.springframework.stereotype.Repository; @Repository("reviewDaoImpl") public class ReviewDaoImpl extends BaseDaoImpl<Review, Long> implements ReviewDao { public List<Review> findList(Member member, Product product, Type type, Boolean isShow, Integer count, List<Filter> filters, List<Order> orders) { CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder(); CriteriaQuery<Review> criteriaQuery = criteriaBuilder.createQuery(Review.class); Root<Review> root = criteriaQuery.from(Review.class); criteriaQuery.select(root); Predicate restrictions = criteriaBuilder.conjunction(); if (member != null) { restrictions = criteriaBuilder.and(restrictions, criteriaBuilder.equal(root.get("member"), member)); } if (product != null) { restrictions = criteriaBuilder.and(restrictions, criteriaBuilder.equal(root.get("product"), product)); } if (type == Type.positive) { restrictions = criteriaBuilder.and(restrictions, criteriaBuilder.ge(root.<Number> get("score"), 4)); } else if (type == Type.moderate) { restrictions = criteriaBuilder.and(restrictions, criteriaBuilder.equal(root.<Number> get("score"), 3)); } else if (type == Type.negative) { restrictions = criteriaBuilder.and(restrictions, criteriaBuilder.le(root.<Number> get("score"), 2)); } if (isShow != null) { restrictions = criteriaBuilder.and(restrictions, criteriaBuilder.equal(root.get("isShow"), isShow)); } criteriaQuery.where(restrictions); return super.findList(criteriaQuery, null, count, filters, orders); } public Page<Review> findPage(Member member, Product product, Type type, Boolean isShow, Pageable pageable) { CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder(); CriteriaQuery<Review> criteriaQuery = criteriaBuilder.createQuery(Review.class); Root<Review> root = criteriaQuery.from(Review.class); criteriaQuery.select(root); Predicate restrictions = criteriaBuilder.conjunction(); if (member != null) { restrictions = criteriaBuilder.and(restrictions, criteriaBuilder.equal(root.get("member"), member)); } if (product != null) { restrictions = criteriaBuilder.and(restrictions, criteriaBuilder.equal(root.get("product"), product)); } if (type == Type.positive) { restrictions = criteriaBuilder.and(restrictions, criteriaBuilder.ge(root.<Number> get("score"), 4)); } else if (type == Type.moderate) { restrictions = criteriaBuilder.and(restrictions, criteriaBuilder.equal(root.<Number> get("score"), 3)); } else if (type == Type.negative) { restrictions = criteriaBuilder.and(restrictions, criteriaBuilder.le(root.<Number> get("score"), 2)); } if (isShow != null) { restrictions = criteriaBuilder.and(restrictions, criteriaBuilder.equal(root.get("isShow"), isShow)); } criteriaQuery.where(restrictions); return super.findPage(criteriaQuery, pageable); } public Long count(Member member, Product product, Type type, Boolean isShow) { CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder(); CriteriaQuery<Review> criteriaQuery = criteriaBuilder.createQuery(Review.class); Root<Review> root = criteriaQuery.from(Review.class); criteriaQuery.select(root); Predicate restrictions = criteriaBuilder.conjunction(); if (member != null) { restrictions = criteriaBuilder.and(restrictions, criteriaBuilder.equal(root.get("member"), member)); } if (product != null) { restrictions = criteriaBuilder.and(restrictions, criteriaBuilder.equal(root.get("product"), product)); } if (type == Type.positive) { restrictions = criteriaBuilder.and(restrictions, criteriaBuilder.ge(root.<Number> get("score"), 4)); } else if (type == Type.moderate) { restrictions = criteriaBuilder.and(restrictions, criteriaBuilder.equal(root.<Number> get("score"), 3)); } else if (type == Type.negative) { restrictions = criteriaBuilder.and(restrictions, criteriaBuilder.le(root.<Number> get("score"), 2)); } if (isShow != null) { restrictions = criteriaBuilder.and(restrictions, criteriaBuilder.equal(root.get("isShow"), isShow)); } criteriaQuery.where(restrictions); return super.count(criteriaQuery, null); } public boolean isReviewed(Member member, Product product) { if (member == null || product == null) { return false; } String jqpl = "select count(*) from Review review where review.member = :member and review.product = :product"; Long count = entityManager.createQuery(jqpl, Long.class).setFlushMode(FlushModeType.COMMIT).setParameter("member", member).setParameter("product", product).getSingleResult(); return count > 0; } public long calculateTotalScore(Product product) { if (product == null) { return 0L; } String jpql = "select sum(review.score) from Review review where review.product = :product and review.isShow = :isShow"; Long totalScore = entityManager.createQuery(jpql, Long.class).setFlushMode(FlushModeType.COMMIT).setParameter("product", product).setParameter("isShow", true).getSingleResult(); return totalScore != null ? totalScore : 0L; } public long calculateScoreCount(Product product) { if (product == null) { return 0L; } String jpql = "select count(*) from Review review where review.product = :product and review.isShow = :isShow"; return entityManager.createQuery(jpql, Long.class).setFlushMode(FlushModeType.COMMIT).setParameter("product", product).setParameter("isShow", true).getSingleResult(); } }
[ "1169794338@qq.com" ]
1169794338@qq.com
d269a45055b871283d301843689557a27c3f8727
4f9e893cedd8f25557239f939edee6bcb1246715
/jinghua/dmm_personal/src/main/java/cn/gilight/personal/student/book/dao/impl/BookDaoImpl.java
f080dc669364f8cef4955de9270794e92401db2a
[]
no_license
yangtie34/projects
cc9ba22c1fd235dadfe18509bc6951e21e9d3be4
5a3a86116e385db1086f8f6e9eb07198432fec27
refs/heads/master
2020-06-29T11:04:26.615952
2017-07-25T03:28:15
2017-07-25T03:28:15
74,436,105
1
4
null
null
null
null
UTF-8
Java
false
false
3,811
java
package cn.gilight.personal.student.book.dao.impl; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; import cn.gilight.framework.base.dao.BaseDao; import cn.gilight.framework.page.Page; import cn.gilight.framework.uitl.common.DateUtils; import cn.gilight.personal.student.book.dao.BookDao; @Repository("bookDao") public class BookDaoImpl implements BookDao{ @Autowired private BaseDao baseDao; @Override public Page getBorrowList(String stu_id,Page page) { String date = DateUtils.getNowDate(); String sql = "select book.name_ book_name,t.borrow_time," +" case when t.return_time is null then '应还' " +" when t.return_time is not null then '归还' end as time_type," +" case when t.return_time is null then t.should_return_time" +" when t.return_time is not null then t.return_time end as time_ ," +" case when t.return_time is null and t.should_return_time < '"+ date +"' then '超期'" +" when t.return_time is null and t.should_return_time > '"+ date +"' then '在阅'" +" else '已还' end as flag from t_book_borrow t left join t_book_reader br on br.no_ = t.book_reader_id " +" left join t_book book on book.no_ = t.book_id" +" where br.people_id = '"+ stu_id +"' order by t.borrow_time desc"; return baseDao.queryWithPageInLowerKey(sql, page); } @Override public int getBorrowCounts(String stu_id) { String sql = "select * from t_book_borrow t left join t_book_reader br on t.book_reader_id = br.no_ where br.people_id = '"+ stu_id +"'"; return baseDao.queryForInt(sql); } @Override public Map<String,Object> getBorrowProportion(String stu_id){ String sql = "select round(count(case when mynum > nums then 1 else null end)/count(*),2)*100||'%' proportion from (select no_,nums,mynum from (" + " select tt.no_,nvl(dd.nums,0) nums ,sd.mynum from (" + " select * from t_stu stu where stu.enroll_grade = (select s.enroll_grade from t_stu s where s.no_ = '"+ stu_id +"')) tt " + " left join (select br.people_id,count(*) nums from t_book_borrow bb left join t_book_reader br on bb.book_reader_id = br.no_ group by br.people_id) dd " + " on tt.no_ = dd.people_id left join (select br.people_id,count(*) mynum from t_book_borrow bb " + " left join t_book_reader br on br.no_ = bb.book_reader_id " + " where br.people_id is not null and br.people_id = '"+ stu_id +"' group by br.people_id) sd on 1=1 ))" ; List<Map<String,Object>> list = baseDao.queryListInLowerKey(sql); if(list!= null && list.size()>0){ return list.get(0); } return null; } @Override public List<Map<String,Object>> getRecommendBook(String stu_id) { String sql = "select rb.store_name,rb.book_name name_,rb.counts from (select tt.store_code ,tt.sums,rownum rm from (" + " select book.store_code,count(*) sums from t_book_borrow t left join t_book_reader br on t.book_reader_id = br.no_" + " left join t_book book on book.no_ = t.book_id where br.people_id = '"+stu_id+"' group by book.store_code order by " + " sums desc) tt) dd right join t_recommend_book rb on rb.store_code = dd.store_code where dd.rm<=3 order by counts desc"; return baseDao.queryListInLowerKey(sql); } @Override public List<Map<String, Object>> getBorrowType(String stu_id) { String sql = "select co.name_ as name,count(*) as value from t_book_borrow t" + " left join t_book_reader br on t.book_reader_id = br.no_ " + " left join t_book book on book.no_ = t.book_id " + " left join t_code co on co.code_type = 'BOOK_STORE_CODE' and co.code_ = book.store_code " + " where br.people_id = '"+stu_id+"' group by co.name_"; return baseDao.queryListInLowerKey(sql); } }
[ "yangtie34@163.com" ]
yangtie34@163.com
c0a77f7bacdb439a03142907a522c71ef8a1b28a
988c9b6eeb4589e3fd412f34a4bf92a16704b5d6
/completed/MIHS/2020-fall/ScaredSkiing.java
14ea394171f8c3dcf1e241afb108bd6926267a55
[]
no_license
greenstripes4/USACO
3bf08c97767e457ace8f24c61117271028802693
24cd71c6d1cd168d76b27c2d6edd0c6abeeb7a83
refs/heads/master
2023-02-07T17:54:26.563040
2023-02-06T03:29:17
2023-02-06T03:29:17
192,225,457
0
0
null
null
null
null
UTF-8
Java
false
false
590
java
import java.io.BufferedWriter; import java.io.IOException; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.util.Scanner; public class ScaredSkiing { public static void main(String[] args) throws IOException { Scanner f = new Scanner(System.in); PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out))); int x1 = f.nextInt(); int y1 = f.nextInt(); int x2 = f.nextInt(); int y2 = f.nextInt(); out.println((y2-y1)/(x2-x1)); f.close(); out.close(); } }
[ "strongheart404@gmail.com" ]
strongheart404@gmail.com
6b5798965b3977fff1f8c1690d8e526f7945add5
5a5a214b171503b25f14210fd7d8ba2edb10ac81
/src/main/java/com/codex/demo/config/audit/AuditEventConverter.java
319b8b4709f3fc45f8157ae6052efdf697dd86f5
[]
no_license
dbogi89/prodavnica
b18b0eb2c29780c78b58cd2bb1d63199643153a1
56dada36d83abdd7043887efceb664a35ce4ecf5
refs/heads/master
2022-12-22T19:18:28.295697
2019-06-12T00:30:21
2019-06-12T00:30:21
191,469,107
0
0
null
2022-12-16T04:59:29
2019-06-12T00:30:08
Java
UTF-8
Java
false
false
3,275
java
package com.codex.demo.config.audit; import com.codex.demo.domain.PersistentAuditEvent; import org.springframework.boot.actuate.audit.AuditEvent; import org.springframework.security.web.authentication.WebAuthenticationDetails; import org.springframework.stereotype.Component; import java.util.*; @Component public class AuditEventConverter { /** * Convert a list of {@link PersistentAuditEvent}s to a list of {@link AuditEvent}s. * * @param persistentAuditEvents the list to convert. * @return the converted list. */ public List<AuditEvent> convertToAuditEvent(Iterable<PersistentAuditEvent> persistentAuditEvents) { if (persistentAuditEvents == null) { return Collections.emptyList(); } List<AuditEvent> auditEvents = new ArrayList<>(); for (PersistentAuditEvent persistentAuditEvent : persistentAuditEvents) { auditEvents.add(convertToAuditEvent(persistentAuditEvent)); } return auditEvents; } /** * Convert a {@link PersistentAuditEvent} to an {@link AuditEvent}. * * @param persistentAuditEvent the event to convert. * @return the converted list. */ public AuditEvent convertToAuditEvent(PersistentAuditEvent persistentAuditEvent) { if (persistentAuditEvent == null) { return null; } return new AuditEvent(persistentAuditEvent.getAuditEventDate(), persistentAuditEvent.getPrincipal(), persistentAuditEvent.getAuditEventType(), convertDataToObjects(persistentAuditEvent.getData())); } /** * Internal conversion. This is needed to support the current SpringBoot actuator {@code AuditEventRepository} interface. * * @param data the data to convert. * @return a map of {@link String}, {@link Object}. */ public Map<String, Object> convertDataToObjects(Map<String, String> data) { Map<String, Object> results = new HashMap<>(); if (data != null) { for (Map.Entry<String, String> entry : data.entrySet()) { results.put(entry.getKey(), entry.getValue()); } } return results; } /** * Internal conversion. This method will allow to save additional data. * By default, it will save the object as string. * * @param data the data to convert. * @return a map of {@link String}, {@link String}. */ public Map<String, String> convertDataToStrings(Map<String, Object> data) { Map<String, String> results = new HashMap<>(); if (data != null) { for (Map.Entry<String, Object> entry : data.entrySet()) { // Extract the data that will be saved. if (entry.getValue() instanceof WebAuthenticationDetails) { WebAuthenticationDetails authenticationDetails = (WebAuthenticationDetails) entry.getValue(); results.put("remoteAddress", authenticationDetails.getRemoteAddress()); results.put("sessionId", authenticationDetails.getSessionId()); } else { results.put(entry.getKey(), Objects.toString(entry.getValue())); } } } return results; } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
4370a970bbb4f5b91d054af459d19bab46e5e9a2
5076d14c853effaa65be6103fa4d47e246b3ca27
/src/main/java/com/tyc/service/impl/TblStopDateServiceImpl.java
94f3a389a38490378ba59dc55fe7dee17818d2d3
[]
no_license
Tang5566/family_service_platform
cea82017c5517518e0f501f19491da0591a5ab25
2b02d39198ae0ef8baa33456a81ab79a28370aba
refs/heads/master
2023-03-06T14:20:38.861485
2021-02-23T13:56:37
2021-02-23T13:56:37
341,571,675
0
0
null
null
null
null
UTF-8
Java
false
false
510
java
package com.tyc.service.impl; import com.tyc.bean.TblStopDate; import com.tyc.mapper.TblStopDateMapper; import com.tyc.service.TblStopDateService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; /** * <p> * 到期日期 服务实现类 * </p> * * @author tyc * @since 2021-02-20 */ @Service public class TblStopDateServiceImpl extends ServiceImpl<TblStopDateMapper, TblStopDate> implements TblStopDateService { }
[ "1213859735@qq.com" ]
1213859735@qq.com
bbcc95055206d6224feb31fa98962bd3240550ff
96c58a89f6c8584ff266efc667236b92035729d7
/01 Hibernate Basics/src/com/hpe/training/programs/P12_HQLDemos.java
7586d243b95118f5d3e3ef17e9db3c5f90bf77c1
[]
no_license
kayartaya-vinod/2018_10_HPE_HIBERNATE_SPRING
9948ab7a728098bdc1d3d5e06de00371bdb87809
caa1785713b108d7fbb145a8014cef93f229875f
refs/heads/master
2020-03-31T11:53:19.963391
2019-02-06T05:50:02
2019-02-06T05:50:02
152,195,236
0
0
null
null
null
null
UTF-8
Java
false
false
6,022
java
package com.hpe.training.programs; import java.util.List; import org.hibernate.Query; import org.hibernate.SQLQuery; import org.hibernate.Session; import org.hibernate.SessionFactory; import com.hpe.training.entity.Brand; import com.hpe.training.entity.Customer; import com.hpe.training.entity.Order; import com.hpe.training.entity.Product; import com.hpe.training.utils.HibernateUtil; @SuppressWarnings("unchecked") public class P12_HQLDemos { private static Session session; public static void main(String[] args) { SessionFactory factory = null; try { factory = HibernateUtil.getSessionFactory(); session = factory.openSession(); // printAllBrands(); // printProductsByPriceRange(40.0, 50.0); // printProductsByPage(3); // 3 --> pageNum // printProductNames(); // only names, not actual products // printProductNamesAndPrices(); // printProductsByBrand("Zespri"); // Zespri --> brand name // printBrandwiseProductCount(); // printOrderDetails(2); // 2 --> order_id // printCustomerDetailsWhoPlacedOrderMoreThan(150); // 150 -> order total updateProductPriceBy(1); // 1--> increment amount } catch (Exception e) { e.printStackTrace(); } finally { session.close(); factory.close(); } } static void updateProductPriceBy(double incrAmount) { String hql = "update Product set unitPrice=unitPrice+:INCR_AMT"; Query qry = session.createQuery(hql); qry.setParameter("INCR_AMT", incrAmount); int rc = qry.executeUpdate(); session.beginTransaction().commit(); System.out.println(rc + " records updated!"); } static void printCustomerDetailsWhoPlacedOrderMoreThan(double orderTotal) { String sql = "select c.id, c.name, c.email, c.password, c.phone,\n" + "c.address, c.city, c.state, c.country, o.id, o.order_date, o.status, o.customer_id\n" + "from customers c \n" + "join orders o on c.id = o.customer_id \n" + "join line_items li on o.id = li.order_id\n" + "group by c.id, c.name, c.email, c.password, c.phone,\n" + "c.address, c.city, c.state, c.country, o.id, o.order_date, o.status, o.customer_id\n" + "having sum(li.quantity*li.unit_price) >= :ORDER_TOTAL"; SQLQuery qry = session.createSQLQuery(sql); qry.addEntity(Customer.class); qry.addEntity(Order.class); qry.setParameter("ORDER_TOTAL", orderTotal); List<Object[]> customers = qry.list(); for(Object[] arr: customers) { Customer c = (Customer) arr[0]; // Order o = (Order) arr[1]; System.out.println(c.getName() + " --> " + c.getEmail()); } } static void printOrderDetails(int orderId) { String sql = "select c.name, o.order_date, o.status, sum(li.quantity*li.unit_price) order_total\n" + "from customers c \n" + "join orders o on c.id = o.customer_id \n" + "join line_items li on o.id = li.order_id\n" + "where o.id = :ORDER_ID \n" + "group by c.name, o.order_date, o.status"; Query qry = session.createSQLQuery(sql); qry.setParameter("ORDER_ID", orderId); Object[] data = (Object[]) qry.uniqueResult(); if (data != null) { System.out.println("Customer = " + data[0]); System.out.println("Order date = " + data[1]); System.out.println("Order status = " + data[2]); System.out.println("Order amount = " + data[3]); } else { System.out.println("No data found for order id " + orderId); } } static void printBrandwiseProductCount() { String hql = "select p.brand.name, count(p) from Product p" + " group by p.brand.name having count(p)>15"; Query qry = session.createQuery(hql); List<Object[]> list = qry.list(); for (Object[] data : list) { System.out.println(data[0] + " --> " + data[1]); } } static void printProductsByBrand(String brandName) { // product.brand --> many-to-one association // String hql = "from Product where brand.name = :BRAND_NAME"; // In case if Product does not have brand as member String hql = "select p from Brand b join b.products p" + " where b.name = :BRAND_NAME"; Query qry = session.createQuery(hql); qry.setParameter("BRAND_NAME", brandName); List<Product> list = qry.list(); for(Product p: list) { System.out.printf("%s (%s) -> Rs.%s\n", p.getName(), p.getBrand().getName(), p.getUnitPrice()); } } static void printProductNamesAndPrices() { String hql = "select name, unitPrice from Product"; Query qry = session.createQuery(hql); List<Object[]> list = qry.list(); for (Object[] data : list) { System.out.println(data[0] + " --> Rs." + data[1]); } } static void printProductNames() { Query qry = session.createQuery("select name from Product"); List<String> names = qry.list(); for(String name: names) { System.out.println(name); } } static void printProductsByPage(int pageNum) { int pageSize = 10; int offset = (pageNum - 1) * pageSize; Query qry = session.createQuery("from Product"); qry.setFirstResult(offset); qry.setMaxResults(pageSize); List<Product> list = qry.list(); for(Product p: list) { System.out.println(p.getId() + " >> " + p.getName() + " --> Rs." + p.getUnitPrice()); } } static void printProductsByPriceRange(double min, double max) { String hql = "FROM Product WHERE unitPrice BETWEEN ? AND ? ORDER BY unitPrice DESC"; Query qry = session.createQuery(hql); qry.setDouble(0, min); qry.setDouble(1, max); List<Product> list = qry.list(); for(Product p: list) { System.out.println(p.getName() + " --> Rs." + p.getUnitPrice()); } } static void printAllBrands() { // HQL --> same as SQL but deals with classes and fields // A row in a table --> an object of the class // A column in a table --> a field/property of the class // SQL --> select * from brands // HQL --> select b from Brand b // Simplified version --> from Brand String hql = "from Brand"; Query qry = session.createQuery(hql); List<Brand> list = qry.list(); for(Brand b: list) { System.out.println(b.getId() + " --> " + b.getName()); } } }
[ "kayartaya.vinod@gmail.com" ]
kayartaya.vinod@gmail.com
2ccc87118e5d53dbbd133474b9be9197090f136e
aa424e24f72399d9dda3efe36af7c83155b57836
/commonlibs/libwebview/src/main/java/com/example/shining/libwebview/activity/HiosMainActivity.java
9a3087a861db5d487d5917f3c9fcdffcb90557bf
[]
no_license
geeklx/my_net_kuangjia
86ff6f5fc89e55c635418e775ceca0284d12e6ae
470e49f42014e8f8cd305e31ee64a94c9035b0b2
refs/heads/master
2021-09-06T09:47:31.913902
2018-02-05T05:48:27
2018-02-05T05:48:27
113,294,514
1
1
null
null
null
null
UTF-8
Java
false
false
1,082
java
package com.example.shining.libwebview.activity; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Toast; import com.example.shining.libwebview.R; public class HiosMainActivity extends AppCompatActivity { private int mAction; // default 0 private String mSkuId = ""; // maybe null private String mCategoryId = ""; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main_two); mAction = getIntent().getIntExtra("act", 0); mSkuId = getIntent().getStringExtra("sku_id"); mCategoryId = getIntent().getStringExtra("category_id"); Toast.makeText(this, mAction + ", " + mSkuId + ", " + mCategoryId, Toast.LENGTH_LONG).show(); findViewById(R.id.tv_back).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { //back finish(); } }); } }
[ "liangxiao@smart-haier.com" ]
liangxiao@smart-haier.com
bdebcc33049d63d34c1b5c01fdab575ba20cb5e3
aea01bdb46ac63f9039a2ad086b7f81baba32ef9
/web/src/main/java/com/archives/pojo/DoorWarning.java
9acd08fa66d1ddcb40f0ba2d93c0f1f5b287f137
[]
no_license
gaofeng4623/SysArchives
a187c6d43cae7d3ef3c4eb35fde2d464e8515e2b
3bd582f11bf1e1dfd576c4218a9a4e41577317df
refs/heads/master
2021-07-12T09:10:42.779501
2017-09-01T09:13:49
2017-09-01T09:13:52
107,104,158
0
0
null
null
null
null
UTF-8
Java
false
false
2,715
java
package com.archives.pojo; public class DoorWarning { private Integer guid; private String rfid; private String doorid; private String warndate; private String warnreason; private String handler; private String handlerresult; private String handlerdate; private String handlerurl; private String caseNo; private String infoGuid; private String mangaerDoorId; private String note; private String itemGuid; public Integer getGuid() { return guid; } public void setGuid(Integer guid) { this.guid = guid; } public String getRfid() { return rfid; } public void setRfid(String rfid) { this.rfid = rfid == null ? null : rfid.trim(); } public String getDoorid() { return doorid; } public void setDoorid(String doorid) { this.doorid = doorid == null ? null : doorid.trim(); } public String getWarndate() { return warndate; } public void setWarndate(String warndate) { this.warndate = warndate; } public String getWarnreason() { return warnreason; } public void setWarnreason(String warnreason) { this.warnreason = warnreason == null ? null : warnreason.trim(); } public String getHandler() { return handler; } public void setHandler(String handler) { this.handler = handler == null ? null : handler.trim(); } public String getHandlerresult() { return handlerresult; } public void setHandlerresult(String handlerresult) { this.handlerresult = handlerresult == null ? null : handlerresult.trim(); } public String getHandlerdate() { return handlerdate; } public void setHandlerdate(String handlerdate) { this.handlerdate = handlerdate; } public String getHandlerurl() { return handlerurl; } public void setHandlerurl(String handlerurl) { this.handlerurl = handlerurl == null ? null : handlerurl.trim(); } public String getCaseNo() { return caseNo; } public void setCaseNo(String caseNo) { this.caseNo = caseNo; } public String getInfoGuid() { return infoGuid; } public void setInfoGuid(String infoGuid) { this.infoGuid = infoGuid; } public String getMangaerDoorId() { return mangaerDoorId; } public void setMangaerDoorId(String mangaerDoorId) { this.mangaerDoorId = mangaerDoorId; } public String getNote() { return note; } public void setNote(String note) { this.note = note; } public String getItemGuid() { return itemGuid; } public void setItemGuid(String itemGuid) { this.itemGuid = itemGuid; } }
[ "gaofen_888@163.com" ]
gaofen_888@163.com
d772ba876d16eb320ab7d52509e42e6ecd06ffac
63152c4f60c3be964e9f4e315ae50cb35a75c555
/mllib/target/java/org/apache/spark/ml/r/RWrapperUtils$.java
1f9a560df6cad228ae724f9def4eb94d5e27d75a
[ "EPL-1.0", "Classpath-exception-2.0", "LicenseRef-scancode-unicode", "BSD-3-Clause", "LicenseRef-scancode-generic-cla", "LicenseRef-scancode-free-unknown", "GCC-exception-3.1", "LGPL-2.0-or-later", "CDDL-1.0", "MIT", "CC-BY-SA-3.0", "NAIST-2003", "LGPL-2.1-only", "LicenseRef-scancode-other...
permissive
PowersYang/spark-cn
76c407d774e35d18feb52297c68c65889a75a002
06a0459999131ee14864a69a15746c900e815a14
refs/heads/master
2022-12-11T20:18:37.376098
2020-03-30T09:48:22
2020-03-30T09:48:22
219,248,341
0
0
Apache-2.0
2022-12-05T23:46:17
2019-11-03T03:55:17
HTML
UTF-8
Java
false
false
1,309
java
package org.apache.spark.ml.r; public class RWrapperUtils$ implements org.apache.spark.internal.Logging { /** * Static reference to the singleton instance of this Scala object. */ public static final RWrapperUtils$ MODULE$ = null; public RWrapperUtils$ () { throw new RuntimeException(); } /** * DataFrame column check. * When loading libsvm data, default columns "features" and "label" will be added. * And "features" would conflict with RFormula default feature column names. * Here is to change the column name to avoid "column already exists" error. * <p> * @param rFormula RFormula instance * @param data Input dataset */ public void checkDataColumns (org.apache.spark.ml.feature.RFormula rFormula, org.apache.spark.sql.Dataset<?> data) { throw new RuntimeException(); } /** * Get the feature names and original labels from the schema * of DataFrame transformed by RFormulaModel. * <p> * @param rFormulaModel The RFormulaModel instance. * @param data Input dataset. * @return The feature names and original labels. */ public scala.Tuple2<java.lang.String[], java.lang.String[]> getFeaturesAndLabels (org.apache.spark.ml.feature.RFormulaModel rFormulaModel, org.apache.spark.sql.Dataset<?> data) { throw new RuntimeException(); } }
[ "577790911@qq.com" ]
577790911@qq.com
1d55fb037c311e126805312d1bf2b618868935fc
643d701fc59bf663dd8ec809576521147d54c313
/src/main/java/gwt/jelement/serviceworkers/NavigationPreloadState.java
ddfb220719e5e90fa98f308615865a3194b76d9e
[ "MIT" ]
permissive
gwt-jelement/gwt-jelement
8e8cca46b778ed1146a2efd8be996a358f974b44
f28303d85f16cefa1fc067ccb6f0b610cdf942f4
refs/heads/master
2021-01-01T17:03:07.607472
2018-01-16T15:46:44
2018-01-16T15:46:44
97,984,978
6
5
null
null
null
null
UTF-8
Java
false
false
1,492
java
/* * Copyright 2017 Abed Tony BenBrahim <tony.benrahim@10xdev.com> * and Gwt-JElement project contributors. * * 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 gwt.jelement.serviceworkers; import gwt.jelement.core.JsObject; import jsinterop.annotations.*; @JsType(name="Object", namespace = JsPackage.GLOBAL, isNative = true) public class NavigationPreloadState extends JsObject{ @JsProperty(name="enabled") private boolean enabled; @JsProperty(name="headerValue") private String headerValue; public NavigationPreloadState(){ } @JsOverlay public final boolean isEnabled(){ return this.enabled; } @JsOverlay public final void setEnabled(boolean enabled){ this.enabled = enabled; } @JsOverlay public final String getHeaderValue(){ return this.headerValue; } @JsOverlay public final void setHeaderValue(String headerValue){ this.headerValue = headerValue; } }
[ "tony.benbrahim@gmail.com" ]
tony.benbrahim@gmail.com
70953d58f092118b7f008ad0c90230d76d733dba
534efe193f0fdcf0a386b5092508779555587c80
/1.JavaSyntax/src/com/javarush/task/task04/task0421/Solution.java
defaca6179139136ce3745bafbab07bd006e0c89
[]
no_license
teoheel/JavaRushTasks
b1ddef5da78858aa1b462d19042208a5f1241688
447e9c3172324251aaaccd1e50134c2b4005b544
refs/heads/master
2023-07-16T04:59:32.379948
2021-09-06T14:54:15
2021-09-06T14:54:15
284,746,280
0
0
null
null
null
null
UTF-8
Java
false
false
717
java
package com.javarush.task.task04.task0421; /* Настя или Настя? */ import java.io.BufferedReader; import java.io.InputStreamReader; public class Solution { public static void main(String[] args) throws Exception { //напишите тут ваш код BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); String name1 = reader.readLine(); String name2 = reader.readLine(); if (name1.equals(name2)) { System.out.println("Имена идентичны"); } else if (!(name1.equals(name2)) && name1.length() == name2.length()) { System.out.println("Длины имен равны"); } } }
[ "69160439+teoheel@users.noreply.github.com" ]
69160439+teoheel@users.noreply.github.com
77df94a141bb4ee904d4de7d03c80c21e578da76
1bcb12c9f696db26fce138d43babe3e5ffb63afb
/ucLibrary/src/main/java/com/uc/android/widget/EditModeSelectionLayout.java
030f21949e4ae71549fe4a31e7205e88cdb33ad6
[]
no_license
guohong365/caseview
656cff75c668cbb72ac5f8f6c448a056792c6f62
cf4f5c390799236fdf8a77a19e18502bde49c3d4
refs/heads/master
2021-09-17T12:48:51.535629
2018-07-02T02:00:21
2018-07-02T02:00:21
104,981,003
0
0
null
null
null
null
UTF-8
Java
false
false
2,855
java
package com.uc.android.widget; import android.content.Context; import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.LinearLayout; import com.uc.android.R; import java.util.ArrayList; import java.util.List; import static com.uc.android.widget.ImageEditorLayout.*; public class EditModeSelectionLayout extends LinearLayout implements EditModeChangedNotifier { List<OnEditModeChangeListener> modeChangeListeners=new ArrayList<>(); public EditModeSelectionLayout(Context context) { this(context, null); } public EditModeSelectionLayout(Context context, AttributeSet attrs) { this(context, attrs, 0); } public EditModeSelectionLayout(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); init(context, attrs); } public EditModeSelectionLayout(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { super(context, attrs, defStyleAttr, defStyleRes); init(context, attrs); } ViewGroup modeCrop; ViewGroup modeFilter; ViewGroup modeTune; ViewGroup modeMark; private void selectModeActionView(int id){ modeCrop.setSelected(id==modeCrop.getId()); modeFilter.setSelected(id==modeFilter.getId()); modeTune.setSelected(id==modeTune.getId()); modeMark.setSelected(id==modeMark.getId()); } OnClickListener itemClickListener=new OnClickListener() { @Override public void onClick(View v) { selectModeActionView(v.getId()); notifyEditModeChanged((int)v.getTag()); } }; private void init(Context context, AttributeSet attrs){ LayoutInflater.from(context).inflate(R.layout.layout_mode_selection_box, this, true); modeCrop=findViewById(R.id.layout_action_geometry); modeCrop.setTag(MODE_CROP); modeFilter=findViewById(R.id.layout_action_filter); modeFilter.setTag(MODE_FILTER); modeTune=findViewById(R.id.layout_action_tune); modeTune.setTag(MODE_TUNE); modeMark=findViewById(R.id.layout_action_mark); modeMark.setTag(MODE_MARK); modeCrop.setOnClickListener(itemClickListener); modeFilter.setOnClickListener(itemClickListener); modeTune.setOnClickListener(itemClickListener); modeMark.setOnClickListener(itemClickListener); } @Override public void addOnEditModeChangeListener(OnEditModeChangeListener onEditModeChangeListener) { modeChangeListeners.add(onEditModeChangeListener); } @Override public void notifyEditModeChanged(int mode) { for(OnEditModeChangeListener listener:modeChangeListeners){ listener.onModeChanged(this, mode); } } }
[ "guohong365@263.net" ]
guohong365@263.net
850897738c15aefd12ee71ada9bb678a4ed2a12d
532e20c984e3add6edf8f464f55af0b6d59b0f8b
/src/main/java/me/playernguyen/opteco/utils/ValidationChecker.java
a6d94da34cc6e9ea722883f6aa5e66e431d8cbd1
[ "MIT" ]
permissive
OptEco/OptEco
a1144684110908277c23346cdc91e9a156f83b12
8b6cfce5dc9a15e4ddf710b28c2188ad6442a130
refs/heads/master
2022-12-23T05:52:14.363459
2020-09-30T13:05:17
2020-09-30T13:05:17
299,935,919
0
0
null
null
null
null
UTF-8
Java
false
false
302
java
package me.playernguyen.opteco.utils; import java.util.regex.Pattern; public class ValidationChecker { public static boolean isNotNumber(String s) { if (s == null) { return false; } return !Pattern.compile("-?\\d+(\\.\\d+)?").matcher(s).matches(); } }
[ "daudaua3782@gmail.com" ]
daudaua3782@gmail.com
4349bdef720fec9f2048f1bdb185446fcd211691
c42531b0f0e976dd2b11528504e349d5501249ae
/Brokenhurst/MHSystems/app/src/main/java/com/mh/systems/brokenhurst/web/models/teetimebooking/getbookingdata/GetBookingDataAPI.java
a921c5e5345a943dc0cef73d1c1f5be7fcadd107
[ "MIT" ]
permissive
Karan-nassa/MHSystems
4267cc6939de7a0ff5577c22b88081595446e09e
a0e20f40864137fff91784687eaf68e5ec3f842c
refs/heads/master
2021-08-20T05:59:06.864788
2017-11-28T08:02:39
2017-11-28T08:02:39
112,189,266
0
0
null
null
null
null
UTF-8
Java
false
false
2,071
java
package com.mh.systems.brokenhurst.web.models.teetimebooking.getbookingdata; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; public class GetBookingDataAPI { @SerializedName("aClientId") @Expose private String aClientId; @SerializedName("aCommand") @Expose private String aCommand; @SerializedName("aJsonParams") @Expose private AJsonParamsGetBookingData aJsonParams; @SerializedName("aModuleId") @Expose private String aModuleId; @SerializedName("aUserClass") @Expose private String aUserClass; /** * No args constructor for use in serialization * */ public GetBookingDataAPI() { } /** * * @param aJsonParams * @param aModuleId * @param aUserClass * @param aClientId * @param aCommand */ public GetBookingDataAPI(String aClientId, String aCommand, AJsonParamsGetBookingData aJsonParams, String aModuleId, String aUserClass) { super(); this.aClientId = aClientId; this.aCommand = aCommand; this.aJsonParams = aJsonParams; this.aModuleId = aModuleId; this.aUserClass = aUserClass; } public String getAClientId() { return aClientId; } public void setAClientId(String aClientId) { this.aClientId = aClientId; } public String getACommand() { return aCommand; } public void setACommand(String aCommand) { this.aCommand = aCommand; } public AJsonParamsGetBookingData getAJsonParams() { return aJsonParams; } public void setAJsonParams(AJsonParamsGetBookingData aJsonParams) { this.aJsonParams = aJsonParams; } public String getAModuleId() { return aModuleId; } public void setAModuleId(String aModuleId) { this.aModuleId = aModuleId; } public String getAUserClass() { return aUserClass; } public void setAUserClass(String aUserClass) { this.aUserClass = aUserClass; } }
[ "karan@ucreate.co.in" ]
karan@ucreate.co.in
3c53d2ae62683debac814d321d8d394e7ed55e2d
1c0fa98cfa725e6f0bbb29792a2ebaeb955bde6b
/fanyi/src/main/java/com/fypool/model/SignatureRequest.java
a59095bfc8a46ec252f740fcf181a27247702e93
[]
no_license
mack-wang/project
043a17d97b747352d2d20ab8143188a26872cfaf
c7eec8ba9b87d24272511abb519754067e6e65e3
refs/heads/master
2021-09-01T06:59:51.084085
2017-12-25T14:34:40
2017-12-25T14:34:40
115,329,425
0
0
null
null
null
null
UTF-8
Java
false
false
2,100
java
package com.fypool.model; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import org.springframework.data.annotation.CreatedDate; import org.springframework.data.annotation.LastModifiedBy; import org.springframework.data.annotation.LastModifiedDate; import org.springframework.data.jpa.domain.support.AuditingEntityListener; import javax.persistence.*; import java.io.Serializable; import java.util.Date; @Entity @Data @NoArgsConstructor @EqualsAndHashCode(exclude={"id","user","task","vipTask"}) @EntityListeners(AuditingEntityListener.class) public class SignatureRequest implements Serializable { //1 private static final long serialVersionUID = 1L; //显示用户的昵称,头像,邮箱 @Id @GeneratedValue(strategy = GenerationType.AUTO) private Integer id; //邮寄地址 @OneToOne(fetch = FetchType.LAZY) private Address address; //关联任务 @OneToOne(fetch = FetchType.LAZY) private Task task; //关联vip任务 @OneToOne(fetch = FetchType.LAZY) private VipTask vipTask; //处理结果 0 已经提交,未处理 1 已经处理 @Column(columnDefinition = "tinyint") private Integer result; //快递单号 百世快递:478379534892 private String trackingNumber; //处理的管理员的账号 @LastModifiedBy private String modifiedBy; @ManyToOne(fetch = FetchType.LAZY) private User user; @CreatedDate private Date createdAt; @LastModifiedDate private Date updatedAt; @PrePersist void preInsert() { if (this.result == null) this.result = 0; } public SignatureRequest(Address address, Task task, User user) { super(); this.address = address; this.task = task; this.user = user; } public SignatureRequest(Address address, VipTask vipTask, User user) { super(); this.address = address; this.vipTask = vipTask; this.user = user; } }
[ "641212003@qq.com" ]
641212003@qq.com
941277978225b88287c09740f7373ae00aa80abc
9e6dcde5c2605949b2786fc002fde1c45ad70340
/src/main/java/study/datajpa/entity/Team.java
3711d20eff6b17b5280a0a7f5a862a461e3340cf
[]
no_license
mgh3326/data-jpa
463d8709dac780235b1d6eab417f79e87c9bc4d9
fdfdaf90b92b685f2f6b73735323063621509197
refs/heads/master
2023-08-16T23:14:31.843615
2020-01-19T10:58:28
2020-01-19T10:58:28
233,369,403
0
0
null
2023-03-18T21:57:55
2020-01-12T09:42:40
Java
UTF-8
Java
false
false
482
java
package study.datajpa.entity; import lombok.*; import javax.persistence.*; import java.util.ArrayList; import java.util.List; @Entity @Getter @Setter @NoArgsConstructor(access = AccessLevel.PROTECTED) @ToString(of = {"id", "name"}) public class Team { @OneToMany(mappedBy = "team") List<Member> members = new ArrayList<>(); @Id @GeneratedValue @Column(name = "team_id") private Long id; private String name; public Team(String name) { this.name = name; } }
[ "mgh3326@naver.com" ]
mgh3326@naver.com
d97bb3b49b2b578df7ef36c0bed8d4b1096f5b72
157e8bf7cb9f8f40c8949e294c3601f56880aff2
/src/yyy/RadixTree.java
46169e88311f87fb0f7e967eb1a20908b2386e0a
[]
no_license
wy0705/radix
1b65bdc56636025f3352ac4174d50c4ba691baac
e8471ea7172610058e86b508cb7d89b7c3207c94
refs/heads/main
2023-01-01T04:34:43.437974
2020-10-19T15:04:44
2020-10-19T15:04:44
304,904,069
0
0
null
null
null
null
UTF-8
Java
false
false
6,936
java
package yyy; import javax.swing.*; import java.util.ArrayList; class Node{ private char indexx; private String name; private ArrayList<Node> next=new ArrayList<Node>(); private ArrayList<Character> index=new ArrayList<Character>(); private boolean end; public ArrayList<Character> getIndex(){ if (this.next!=null) { for (Node n : next) { if (n.name!=null) { index.add(n.name.charAt(0)); } } return this.index; } return null; } public Node(){} public Node(String name) { this.name = name; } public char getIndexx() { return indexx; } public void setIndexx(char indexx) { this.indexx = indexx; } public String getName() { return name; } public void setName(String name) { this.name = name; } public ArrayList<Node> getNext() { return next; } public void setNext(ArrayList<Node> next) { this.next = next; } public boolean isEnd() { if (this.getNext()!=null){ this.end=false; return end; } this.end=true; return end; } public void setEnd(boolean end) { this.end = end; } //节点分离 public ArrayList<Node> spil(int i){ String s=this.getName(); Node node1=new Node(s.substring(0,i)); Node node2=new Node(s.substring(i,s.length())); node2.setEnd(this.isEnd()); node2.setNext(this.getNext()); node1.setEnd(false); ArrayList<Node> al=new ArrayList<Node>(); al.add(node2); node1.setNext(al); ArrayList<Node> aa=new ArrayList<Node>(); aa.add(node1); aa.add(node2); return aa; } } public class RadixTree { public static Node root=new Node(); //添加 public void add(String s){ if (root.getName()==null){ Node node=new Node(s); node.setEnd(true); root=node; return; } char[] a=s.toCharArray(); //Node node=root; if (root.getName()!=null) { char[] temp = root.getName().toCharArray(); int l = temp.length > a.length ? temp.length : a.length; ArrayList<Node> arrayList = new ArrayList<Node>(); for (int i = 0; i < l; i++) { if (a[i] != temp[i] && i != l - 1) { arrayList = root.spil(i); root = arrayList.get(0); break; } if (i == l - 1) { System.out.println("单词已存在"); } } Node newnode = arrayList.get(1); if (a.length > l) { char[] chars = new char[a.length - l]; for (int i = a.length; i < l; i++) { chars[i - a.length] = a[i]; } add_fin(newnode, chars); } } System.out.println("添加成功"); } private void add_fin(Node node,char[] temp){ ArrayList<Character> al=node.getIndex(); int k; for (k = 0; k < al.size(); k++) { if (al.get(k) == temp[0]) { char[] a=node.getName().toCharArray(); int l=a.length>temp.length?a.length:temp.length; ArrayList<Node> arrayList=new ArrayList<Node>(); for (int i = 0; i < l; i++) { if (a[i]!=temp[i]&&i!=l-1){ arrayList=node.spil(i); break; } if (i==l-1){ System.out.println("单词已存在"); } } Node newnode=arrayList.get(1); if (a.length>l){ char[] chars=new char[a.length-l]; for (int i = a.length; i < l; i++) { chars[i-a.length]=a[i]; } add_fin(newnode,chars); } return; } } if (k==al.size()) { Node node1 = new Node(temp.toString()); ArrayList<Node> arrayList = node.getNext(); arrayList.add(node1); node.setNext(arrayList); } } public void find(String s){ char[] a=s.toCharArray(); Node node=root; if (node.getName()!=null) { char[] temp = node.getName().toCharArray(); int l = temp.length < a.length ? temp.length : a.length; int i = 0; for (; i < l; i++) { if (a[i] != temp[i]) { System.out.println(5); System.out.println("单词不存在"); return; } } if (i == a.length) { System.out.println(6); System.out.println("单词不存在"); return; } char[] target = new char[s.length() - i]; for (int j = i; j < s.length(); j++) { target[j - i] = a[i]; } find(target, node); } } private void find(char[] temp,Node node){ ArrayList<Character> al=node.getIndex(); int k; for (k = 0; k < al.size(); k++) { if (al.get(k) == temp[0]) { node=find_index(node,al.get(k)); if (node!=null) { char[] a = node.getName().toCharArray(); int l = a.length < temp.length ? a.length : temp.length; ArrayList<Node> arrayList = new ArrayList<Node>(); for (int i = 0; i < l; i++) { if (a[i] != temp[i]) { System.out.println(1); System.out.println("单词不存在"); return; } if (i == temp.length - 1) { System.out.println(2); System.out.println("单词不存在"); return; } } if (l==a.length){ if (node.isEnd() == true) { System.out.println(3); System.out.println("单词存在"); return; } } } } } System.out.println("单词存在"); } public Node find_index(Node node,char a){ Node node1=new Node(); for (Node n:node.getNext()){ if (n.getIndexx()==a) return n; } return null; } public void print(){ } }
[ "2652918156@qq.com" ]
2652918156@qq.com
5f5c32c783fbc2a9a70948e24bf9ae91727907db
96670d2b28a3fb75d2f8258f31fc23d370af8a03
/reverse_engineered/sources/com/google/android/gms/maps/internal/zzs.java
f08d545e37b95aed9e2671e67c5424d05f5a99fe
[]
no_license
P79N6A/speedx
81a25b63e4f98948e7de2e4254390cab5612dcbd
800b6158c7494b03f5c477a8cf2234139889578b
refs/heads/master
2020-05-30T18:43:52.613448
2019-06-02T07:57:10
2019-06-02T08:15:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,919
java
package com.google.android.gms.maps.internal; import android.os.Binder; import android.os.IBinder; import android.os.IInterface; import android.os.Parcel; import android.os.RemoteException; public interface zzs extends IInterface { public static abstract class zza extends Binder implements zzs { private static class zza implements zzs { private IBinder zzahn; zza(IBinder iBinder) { this.zzahn = iBinder; } public IBinder asBinder() { return this.zzahn; } public boolean onMyLocationButtonClick() throws RemoteException { boolean z = true; Parcel obtain = Parcel.obtain(); Parcel obtain2 = Parcel.obtain(); try { obtain.writeInterfaceToken("com.google.android.gms.maps.internal.IOnMyLocationButtonClickListener"); this.zzahn.transact(1, obtain, obtain2, 0); obtain2.readException(); if (obtain2.readInt() == 0) { z = false; } obtain2.recycle(); obtain.recycle(); return z; } catch (Throwable th) { obtain2.recycle(); obtain.recycle(); } } } public zza() { attachInterface(this, "com.google.android.gms.maps.internal.IOnMyLocationButtonClickListener"); } public static zzs zzib(IBinder iBinder) { if (iBinder == null) { return null; } IInterface queryLocalInterface = iBinder.queryLocalInterface("com.google.android.gms.maps.internal.IOnMyLocationButtonClickListener"); return (queryLocalInterface == null || !(queryLocalInterface instanceof zzs)) ? new zza(iBinder) : (zzs) queryLocalInterface; } public IBinder asBinder() { return this; } public boolean onTransact(int i, Parcel parcel, Parcel parcel2, int i2) throws RemoteException { switch (i) { case 1: parcel.enforceInterface("com.google.android.gms.maps.internal.IOnMyLocationButtonClickListener"); boolean onMyLocationButtonClick = onMyLocationButtonClick(); parcel2.writeNoException(); parcel2.writeInt(onMyLocationButtonClick ? 1 : 0); return true; case 1598968902: parcel2.writeString("com.google.android.gms.maps.internal.IOnMyLocationButtonClickListener"); return true; default: return super.onTransact(i, parcel, parcel2, i2); } } } boolean onMyLocationButtonClick() throws RemoteException; }
[ "Gith1974" ]
Gith1974
34b3b1b5001042a425a09e58f4afce246021c254
982f6c3a3c006d2b03f4f53c695461455bee64e9
/src/main/java/com/alipay/api/domain/AlipayDataBillAccountlogQueryModel.java
971c9a6a1b45fa6327282398923c60f94e401ea9
[ "Apache-2.0" ]
permissive
zhaomain/Alipay-Sdk
80ffc0505fe81cc7dd8869d2bf9a894b823db150
552f68a2e7c10f9ffb33cd8e0036b0643c7c2bb3
refs/heads/master
2022-11-15T03:31:47.418847
2020-07-09T12:18:59
2020-07-09T12:18:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,227
java
package com.alipay.api.domain; import com.alipay.api.AlipayObject; import com.alipay.api.internal.mapping.ApiField; /** * 支付宝商家账户账务明细查询 * * @author auto create * @since 1.0, 2019-10-11 10:57:47 */ public class AlipayDataBillAccountlogQueryModel extends AlipayObject { private static final long serialVersionUID = 1664731133435667458L; /** * 支付宝订单号,通过支付宝订单号精确查询相关的流水明细,商户订单号与支付宝订单号互斥 */ @ApiField("alipay_order_no") private String alipayOrderNo; /** * 账务流水创建时间的结束范围。与起始时间间隔不超过31天。查询结果为起始时间至结束时间的左闭右开区间 */ @ApiField("end_time") private String endTime; /** * 商户订单号,通过商户订单号精确查询相关的流水明细,商户订单号与支付宝订单号互斥 */ @ApiField("merchant_order_no") private String merchantOrderNo; /** * 分页号,从1开始 */ @ApiField("page_no") private String pageNo; /** * 分页大小1000-2000,默认2000 */ @ApiField("page_size") private String pageSize; /** * 账务流水创建时间的起始范围 */ @ApiField("start_time") private String startTime; public String getAlipayOrderNo() { return this.alipayOrderNo; } public void setAlipayOrderNo(String alipayOrderNo) { this.alipayOrderNo = alipayOrderNo; } public String getEndTime() { return this.endTime; } public void setEndTime(String endTime) { this.endTime = endTime; } public String getMerchantOrderNo() { return this.merchantOrderNo; } public void setMerchantOrderNo(String merchantOrderNo) { this.merchantOrderNo = merchantOrderNo; } public String getPageNo() { return this.pageNo; } public void setPageNo(String pageNo) { this.pageNo = pageNo; } public String getPageSize() { return this.pageSize; } public void setPageSize(String pageSize) { this.pageSize = pageSize; } public String getStartTime() { return this.startTime; } public void setStartTime(String startTime) { this.startTime = startTime; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
ff0651ecb7d8ba5c726af06715a31b679701d824
0a7296fc0f8d2ebf2e4ec744236513f8c6635b21
/shivas-core/src/main/java/org/shivas/core/core/paths/Path.java
7ab9d358d2ca171ce9e35485242f4538e6ab2e36
[]
no_license
Neraloth/Shivas
c79e3a98e46263b8175b22e4e1eb6eca64656892
da35dcc8896ffa441f0c91df1063a7af9682f815
refs/heads/master
2020-12-28T23:23:45.849589
2013-06-23T17:19:29
2013-06-23T17:19:29
46,883,218
0
1
null
2015-11-25T19:54:29
2015-11-25T19:54:28
null
UTF-8
Java
false
false
1,410
java
package org.shivas.core.core.paths; import org.shivas.data.entity.MapTemplate; import org.shivas.core.utils.Cells; import java.util.ArrayList; public class Path extends ArrayList<Node> { private static final long serialVersionUID = -7753768718718684848L; public static Path parsePath(String string) { Path path = new Path(); for (int i = 0; i < string.length(); i += 3) { String part = string.substring(i, i + 3); Node node = Node.parseNode(part); path.add(node); } return path; } public static Path parsePathWithoutOrientation(String string) { Path path = new Path(); for (int i = 0; i < string.length(); i += 2) { String part = string.substring(i, i + 2); Node node = Node.parseNodeWithoutOrientation(part); path.add(node); } return path; } public Node first() { return get(0); } public Node last() { return get(size() - 1); } public boolean contains(short cellId) { for (Node node : this) { if (node.cell() == cellId) return true; } return false; } public long estimateTimeOn(MapTemplate map) { return Cells.estimateTime(this, map); } public String toString() { StringBuilder sb = new StringBuilder(size() * 3); for (Node node : this) { sb.append(node.toString()); } return sb.toString(); } }
[ "blackrushx@gmail.com" ]
blackrushx@gmail.com
0cf6a66970a268c2d728b14ca48889c865d4cff7
6cb9a3492907235386d11f4ad564bb77db619b81
/src/main/java/name/martingeisse/picoblaze/assembler/assembler/ast/InstructionN.java
b0202f99ea26b101da0dabdc05f600771cf7cc25
[]
no_license
MartinGeisse/mahdl-plugin
1eaf098d880811edd4be73d38784908b00d1cf27
ea619b5a267adccf439a34b8f7abdce963e909e2
refs/heads/master
2021-10-25T13:57:30.544681
2019-04-04T13:48:14
2019-04-04T13:48:14
115,700,849
0
0
null
null
null
null
UTF-8
Java
false
false
1,456
java
/** * Copyright (c) 2015 Martin Geisse * * This file is distributed under the terms of the MIT license. */ package name.martingeisse.picoblaze.assembler.assembler.ast; import name.martingeisse.picoblaze.assembler.assembler.IPicoblazeAssemblerErrorHandler; import name.martingeisse.picoblaze.assembler.assembler.Range; /** * An instruction that uses no operands, i.e. the opcode itself is also the * encoded instruction. Note that RETURN* instructions use InstructionJ * instead of this class, even though they do not use an operand. */ public class InstructionN extends PsmInstruction { /** * The opcode used for this instruction. */ private final int opcode; /** * Creates a new N instruction instance with the specified opcode * @param fullRange the full syntactic range of the renaming, or null if not known * @param opcode the instruction opcode */ public InstructionN(final Range fullRange, final int opcode) { super(fullRange); this.opcode = opcode; } /** * @return the opcode of this instruction. */ public int getOpcode() { return opcode; } /* (non-Javadoc) * @see name.martingeisse.esdk.picoblaze.assembler.ast.PsmInstruction#encode(name.martingeisse.esdk.picoblaze.assembler.ast.Context, name.martingeisse.esdk.picoblaze.assembler.IPicoblazeAssemblerErrorHandler) */ @Override public int encode(final Context context, final IPicoblazeAssemblerErrorHandler errorHandler) { return opcode; } }
[ "martingeisse@googlemail.com" ]
martingeisse@googlemail.com
e0536137cf6282b5a33a436ad0ff73c8ab72fbef
ee64549d1bd93ec9990c22deb1f3c8daffb42a6b
/src/test/java/io/github/jhipster/application/service/UserServiceIT.java
584f8910bccd38ec21f417fb3b9f0fb9e03581ed
[]
no_license
narnesaishashank/jhipster-sample-application
98a3495971eac094982b5210839724997f07a08e
ef2feab6958c63315cb20f54dcf730ecf5f0e862
refs/heads/master
2022-12-25T17:12:04.406965
2019-06-06T10:59:35
2019-06-06T10:59:35
190,566,444
0
0
null
2022-12-16T04:52:45
2019-06-06T10:59:28
Java
UTF-8
Java
false
false
7,409
java
package io.github.jhipster.application.service; import io.github.jhipster.application.MyFirstApplicationApp; import io.github.jhipster.application.config.Constants; import io.github.jhipster.application.config.TestSecurityConfiguration; import io.github.jhipster.application.domain.User; import io.github.jhipster.application.repository.search.UserSearchRepository; import io.github.jhipster.application.repository.UserRepository; import io.github.jhipster.application.security.AuthoritiesConstants; import io.github.jhipster.application.service.dto.UserDTO; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.oauth2.client.authentication.OAuth2AuthenticationToken; import org.springframework.security.oauth2.core.user.DefaultOAuth2User; import org.springframework.security.oauth2.core.user.OAuth2User; import org.springframework.transaction.annotation.Transactional; import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.Map; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; /** * Integration tests for {@link UserService}. */ @SpringBootTest(classes = {MyFirstApplicationApp.class, TestSecurityConfiguration.class}) @Transactional public class UserServiceIT { private static final String DEFAULT_LOGIN = "johndoe"; private static final String DEFAULT_EMAIL = "johndoe@localhost"; private static final String DEFAULT_FIRSTNAME = "john"; private static final String DEFAULT_LASTNAME = "doe"; private static final String DEFAULT_IMAGEURL = "http://placehold.it/50x50"; private static final String DEFAULT_LANGKEY = "en"; @Autowired private UserRepository userRepository; @Autowired private UserService userService; /** * This repository is mocked in the io.github.jhipster.application.repository.search test package. * * @see io.github.jhipster.application.repository.search.UserSearchRepositoryMockConfiguration */ @Autowired private UserSearchRepository mockUserSearchRepository; private User user; private Map<String, Object> userDetails; @BeforeEach public void init() { user = new User(); user.setLogin(DEFAULT_LOGIN); user.setActivated(true); user.setEmail(DEFAULT_EMAIL); user.setFirstName(DEFAULT_FIRSTNAME); user.setLastName(DEFAULT_LASTNAME); user.setImageUrl(DEFAULT_IMAGEURL); user.setLangKey(DEFAULT_LANGKEY); userDetails = new HashMap<>(); userDetails.put("sub", DEFAULT_LOGIN); userDetails.put("email", DEFAULT_EMAIL); userDetails.put("given_name", DEFAULT_FIRSTNAME); userDetails.put("family_name", DEFAULT_LASTNAME); userDetails.put("picture", DEFAULT_IMAGEURL); } @Test @Transactional public void assertThatAnonymousUserIsNotGet() { user.setId(Constants.ANONYMOUS_USER); user.setLogin(Constants.ANONYMOUS_USER); if (!userRepository.findOneByLogin(Constants.ANONYMOUS_USER).isPresent()) { userRepository.saveAndFlush(user); } final PageRequest pageable = PageRequest.of(0, (int) userRepository.count()); final Page<UserDTO> allManagedUsers = userService.getAllManagedUsers(pageable); assertThat(allManagedUsers.getContent().stream() .noneMatch(user -> Constants.ANONYMOUS_USER.equals(user.getLogin()))) .isTrue(); } @Test @Transactional public void testDefaultUserDetails() { OAuth2AuthenticationToken authentication = createMockOAuth2AuthenticationToken(userDetails); UserDTO userDTO = userService.getUserFromAuthentication(authentication); assertThat(userDTO.getLogin()).isEqualTo(DEFAULT_LOGIN); assertThat(userDTO.getFirstName()).isEqualTo(DEFAULT_FIRSTNAME); assertThat(userDTO.getLastName()).isEqualTo(DEFAULT_LASTNAME); assertThat(userDTO.getEmail()).isEqualTo(DEFAULT_EMAIL); assertThat(userDTO.isActivated()).isTrue(); assertThat(userDTO.getLangKey()).isEqualTo(Constants.DEFAULT_LANGUAGE); assertThat(userDTO.getImageUrl()).isEqualTo(DEFAULT_IMAGEURL); assertThat(userDTO.getAuthorities()).contains(AuthoritiesConstants.ANONYMOUS); } @Test @Transactional public void testUserDetailsWithUsername() { userDetails.put("preferred_username", "TEST"); OAuth2AuthenticationToken authentication = createMockOAuth2AuthenticationToken(userDetails); UserDTO userDTO = userService.getUserFromAuthentication(authentication); assertThat(userDTO.getLogin()).isEqualTo("test"); } @Test @Transactional public void testUserDetailsWithLangKey() { userDetails.put("langKey", "fr"); userDetails.put("locale", "en-US"); OAuth2AuthenticationToken authentication = createMockOAuth2AuthenticationToken(userDetails); UserDTO userDTO = userService.getUserFromAuthentication(authentication); assertThat(userDTO.getLangKey()).isEqualTo("fr"); } @Test @Transactional public void testUserDetailsWithLocale() { userDetails.put("locale", "it-IT"); OAuth2AuthenticationToken authentication = createMockOAuth2AuthenticationToken(userDetails); UserDTO userDTO = userService.getUserFromAuthentication(authentication); assertThat(userDTO.getLangKey()).isEqualTo("it-it"); } @Test @Transactional public void testUserDetailsWithUSLocale() { userDetails.put("locale", "en_US"); OAuth2AuthenticationToken authentication = createMockOAuth2AuthenticationToken(userDetails); UserDTO userDTO = userService.getUserFromAuthentication(authentication); assertThat(userDTO.getLangKey()).isEqualTo("en"); } @Test @Transactional public void testUserDetailsWithUSLocale2() { userDetails.put("locale", "en-US"); OAuth2AuthenticationToken authentication = createMockOAuth2AuthenticationToken(userDetails); UserDTO userDTO = userService.getUserFromAuthentication(authentication); assertThat(userDTO.getLangKey()).isEqualTo("en"); } private OAuth2AuthenticationToken createMockOAuth2AuthenticationToken(Map<String, Object> userDetails) { Collection<GrantedAuthority> authorities = Collections.singletonList(new SimpleGrantedAuthority(AuthoritiesConstants.ANONYMOUS)); UsernamePasswordAuthenticationToken usernamePasswordAuthenticationToken = new UsernamePasswordAuthenticationToken(Constants.ANONYMOUS_USER, Constants.ANONYMOUS_USER, authorities); usernamePasswordAuthenticationToken.setDetails(userDetails); OAuth2User user = new DefaultOAuth2User(authorities, userDetails, "sub"); return new OAuth2AuthenticationToken(user, authorities, "oidc"); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
2ce2b4a0f2cd8fce47b8045e1a7ca54d360d70ab
dfb37f7073dcfc9b7e4a16d59a383a4e93d80f54
/src/main/java/com/clueride/imp/GpxMain.java
bba663a1ba0d258d4030606010785c535788d7ed
[]
no_license
ClueRide/network
fa6efe07571621e605212d818714ef7dc9a903b6
ed31268b9553c7cb83c317b93f6376a5bdde1fe4
refs/heads/master
2020-04-17T12:20:31.768820
2019-03-29T10:45:06
2019-03-29T10:45:06
166,576,043
0
0
null
2019-03-29T10:45:07
2019-01-19T17:49:58
Java
UTF-8
Java
false
false
2,885
java
/* * Copyright 2019 Jett Marks * * 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. * * Created by jett on 3/17/19. */ package com.clueride.imp; import java.io.File; import org.jboss.weld.environment.se.Weld; import org.jboss.weld.environment.se.WeldContainer; import com.clueride.imp.gpx.GpxToEdge; import com.clueride.imp.gpx.GpxToEdgeImpl; import com.clueride.network.edge.EdgeBuilder; import com.clueride.network.edge.EdgeStore; /** * Main program for importing GPX-formatted files as Edge instances. */ public class GpxMain { private static EdgeStore edgeStore; /** * Entry point accepting list of files to be imported. * * @param args expected to be list of readable file names. */ public static void main(String[] args) { Weld weld = new Weld(); /* Takes advantage of auto-closeable to release resources should an exception get thrown. */ try (WeldContainer container = weld.initialize()) { edgeStore = container.select(EdgeStore.class).get(); GpxToEdge gpxToEdge = new GpxToEdgeImpl(); for (String fileName : args) { try { File inputFile = validate(fileName); EdgeBuilder edgeBuilder = gpxToEdge.edgeFromGpxFile(inputFile); System.out.println(edgeBuilder); persist(edgeBuilder); } catch (RuntimeException rte) { System.err.println("Unable to read " + fileName); } } } } private static void persist(EdgeBuilder edgeBuilder) { EdgeBuilder persistedEdge = edgeStore.persist(edgeBuilder); System.out.println( String.format( "New Record for %s with ID %d", persistedEdge.getName(), persistedEdge.getId() ) ); } /** * Check that the file can be opened for reading. * * @param fileName String name of the file; full path to the file is expected. * @return The opened and readable {@link File}. */ private static File validate(String fileName) { File file = new File(fileName); if (!file.canRead()) { throw new RuntimeException("Unable to read file: " + fileName); } return file; } }
[ "jettmarks@gmail.com" ]
jettmarks@gmail.com
49e81c415ac874229e72b84fc53ea2de0fbab7de
eeb22578797713dd4ed685ab1bac3580b88abe9a
/kernel-tests/kernel-test/src/main/java/io/sunshower/kernel/test/ModuleFilters.java
fc88c6d02d27e234c58f36dc2554aa5c1d6569c7
[ "MIT" ]
permissive
sunshower-io/zephyr
658375274db071aae05037b790fad94dfe355ab2
5735b0366a8a1bd503f02776b160a593ec007d28
refs/heads/main
2023-08-17T15:51:16.625538
2022-10-03T21:45:29
2022-10-03T21:45:29
222,530,720
60
6
MIT
2023-08-23T17:55:15
2019-11-18T19:46:19
Java
UTF-8
Java
false
false
332
java
package io.sunshower.kernel.test; import io.zephyr.kernel.Module; import java.util.Arrays; import java.util.function.Predicate; public class ModuleFilters { public static final Predicate<Module> named(String... names) { return module -> Arrays.stream(names).anyMatch(t -> module.getCoordinate().getName().equals(t)); } }
[ "josiah.haswell@gmail.com" ]
josiah.haswell@gmail.com
a09127bec1a73775c5bc1b5a091d57165151191b
599b32e92687f7c6930ea61f8580d620a19f0bd3
/kpn-quiz-hub/src/main/java/my/gov/kpn/quiz/web/server/QuestionServlet.java
d7775efbdf355dfbf6f7221e4fb827f36e060359
[]
no_license
rafizanbaharum/kpn-quiz
7707828b87c6b8019f08fa235c442a19d5cb3de9
7c45ddeae4364982f529d151c6b019bae3074c03
refs/heads/master
2016-09-06T14:47:50.341601
2014-04-14T01:57:22
2014-04-14T01:57:22
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,012
java
package my.gov.kpn.quiz.web.server; import my.gov.kpn.quiz.biz.manager.CompetitionManager; import my.gov.kpn.quiz.core.model.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.config.AutowireCapableBeanFactory; import org.springframework.web.context.WebApplicationContext; import org.springframework.web.context.support.WebApplicationContextUtils; import javax.servlet.ServletConfig; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.PrintWriter; /** * @author rafizan.baharum * @since 1/15/14 */ public class QuestionServlet extends HttpServlet { public static final String BR = "<br/>"; @Autowired private CompetitionManager competitionManager; @Override public void init(ServletConfig config) throws ServletException { super.init(config); WebApplicationContext ctx = WebApplicationContextUtils .getRequiredWebApplicationContext(config.getServletContext()); AutowireCapableBeanFactory beanFactory = ctx.getAutowireCapableBeanFactory(); beanFactory.autowireBean(this); } @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { QaQuiz quiz = GlobalRegistry.getQuiz(); String idStr = req.getParameter("id"); QaQuestion question = competitionManager.findQuestionById(Long.valueOf(idStr)); resp.setContentType("text/html"); PrintWriter writer = resp.getWriter(); writer.write("<html>"); writer.write("<body>"); writer.write("<p>"); writer.write("Q:" + question.getStatement()); writer.write("</p>"); switch (question.getQuestionType()) { case MULTIPLE_CHOICE: QaMultipleChoiceQuestion mcq = (QaMultipleChoiceQuestion) question; writer.write("<ol>"); writer.write("<li>" + mcq.getChoice1() + "</li>"); writer.write("<li>" + mcq.getChoice2() + "</li>"); writer.write("<li>" + mcq.getChoice3() + "</li>"); writer.write("<li>" + mcq.getChoice4() + "</li>"); writer.write("</ol>"); break; case BOOLEAN: QaBooleanQuestion bq = (QaBooleanQuestion) question; writer.write("<ol>"); writer.write("<li>" + "TRUE" + "</li>"); writer.write("<li>" + "FALSE" + "</li>"); writer.write("</ol>"); break; case SUBJECTIVE: QaSubjectiveQuestion sq = (QaSubjectiveQuestion) question; writer.write("limit: " + sq.getWordLimit()); break; } writer.write("</body>"); writer.write("</html>"); writer.close(); writer.flush(); } }
[ "rafizan.baharum@gmail.com" ]
rafizan.baharum@gmail.com
940a95943114a2c17b62d7816f1f60cfa99c296d
a5a1f6d45a3f8e602501fddd6c86d9bd61877e6a
/ch9/spring-transaction-manager-annotation-jta/src/main/java/jun/prospring5/ch9/entity/Singer.java
82b4f2f0eb6f77d44971034b58027e90fe0f7931
[ "MIT" ]
permissive
jdcsma/prospring5
8318c9e7510462ab40079e8da1e45eed600e036d
3ee9d91f91b0a2fc6e1fc78b770f5c6f1f5f33b4
refs/heads/master
2022-12-22T12:36:20.430682
2019-06-28T10:07:00
2019-06-28T10:07:00
185,557,154
0
0
MIT
2022-12-16T00:37:09
2019-05-08T07:42:15
JavaScript
UTF-8
Java
false
false
1,367
java
package jun.prospring5.ch9.entity; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; import java.util.Date; @Entity @Table(name = "singer") public class Singer extends AbstractEntity { @Column(name = "first_name") private String firstName; @Column(name = "last_name") private String lastName; @Temporal(TemporalType.TIMESTAMP) @Column(name = "birth_date") private Date birthDate; public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public Date getBirthDate() { return birthDate; } public void setBirthDate(Date birthDate) { this.birthDate = birthDate; } @Override public String toString() { return "Singer{" + "id='" + getId() + '\'' + ", version='" + getVersion() + '\'' + ", firstName='" + getFirstName() + '\'' + ", lastName='" + getLastName() + '\'' + ", birthDate=" + getBirthDate() + '}'; } }
[ "jdcsma@163.com" ]
jdcsma@163.com
1b3fd7ee337803b3fa2fc58e19db5c23b2483373
470d9968ce2118451996ab51ee32af1da399e340
/java_programs/src/test/java/w3resoursesString_prgs/s88.java
7d8777165c9c4f284da539c2c667f33ab8461575
[]
no_license
JAIPRASHANTH250493/allJava-progs
217b66b446fb6be0a635d3f3d7f6da396f7a6d22
ae04d9bc349760ea9f48025a1a9de5fe0c98b8b8
refs/heads/master
2022-12-01T11:21:20.037555
2020-08-12T16:44:21
2020-08-12T16:44:21
286,791,751
0
0
null
null
null
null
UTF-8
Java
false
false
385
java
package w3resoursesString_prgs; public class s88 { public static void main(String[] args) { // TODO Auto-generated method stub String s="it is a string"; String c[]=s.split(" "); String news=""; for (int i = 0; i < c.length; i++) { if(c[i].equals("is")) { news=c[i].replace("is", "is not"); System.out.print(news+" "); }else { System.out.print(c[i]+" "); } } } }
[ "you@example.com" ]
you@example.com
12e2d84f3c73af62040df1732939472cb294b3b7
c53ee32324d283c5b652d0db764af1a298dd988d
/66.plus-one.106980962.ac.java
e16b2f58690529f5e1cdc6a87e1afe8c3fbb555e
[]
no_license
zhuolikevin/leetcode-java
f5f984e3db99359e2e5df621f1896dfd57030a93
712c93bade63829ca13bd88a4ef0600f3439be6d
refs/heads/master
2020-12-29T00:59:04.999430
2017-08-15T17:58:12
2017-08-15T17:58:12
94,374,971
3
0
null
null
null
null
UTF-8
Java
false
false
824
java
/* * [66] Plus One * * https://leetcode.com/problems/plus-one * * Easy (38.31%) * Total Accepted: * Total Submissions: * Testcase Example: '[0]' * * Can you solve this problem? 🤔 */ public class Solution { public int[] plusOne(int[] digits) { int carry = 0; for (int i = digits.length - 1; i >= 0; i--) { int sum = digits[i] + 1; digits[i] = sum % 10; carry = sum / 10; if (carry == 0) { break; } } if (carry == 1) { int[] res = new int[digits.length+1]; res[0] = carry; for (int i = 0; i < digits.length; i++) { res[i+1] = digits[i]; } return res; } else { return digits; } } }
[ "lizhuogo@gmail.com" ]
lizhuogo@gmail.com
b782fc43c7d1c0a3ab22a86f8bbeceffdea30263
07bdea58c5423674e201dc45f877c9ec8de8d969
/freeveggie-service/freeveggie-service-impl/src/test/java/org/mdubois/freeveggie/service/matcher/GardenBOMatcher.java
4ba987b6e97e68b02b1e4b6a339d7ed4e059e4c8
[]
no_license
baloo2401/freeveggie
29e82dad4613e29d2d95014869b022fd44172f8d
da06a86a44919b170d22c60a2b5f854b43bfdbb2
refs/heads/master
2020-04-06T04:41:43.807054
2014-11-04T04:28:05
2014-11-04T04:28:05
82,561,766
0
0
null
null
null
null
UTF-8
Java
false
false
8,138
java
package org.mdubois.freeveggie.service.matcher; import org.apache.commons.lang.StringUtils; import org.mdubois.freeveggie.bo.GardenBO; import org.mdubois.freeveggie.bo.GardenCommentBO; import org.mdubois.freeveggie.bo.GardenLikeBO; import org.mdubois.freeveggie.bo.ProductBO; /** * * @author Mickael Dubois */ public class GardenBOMatcher extends BusinessObjectMatcher<GardenBO> { private static final String NAMES_ARE_NOTE_MATHING = "Name's are not mathing"; private static final String COMMENTS_ARE_NOTE_MATHING = "Comment's are not mathing"; private static final String ADDRESSS_ARE_NOTE_MATHING = "Address's are not mathing"; private static final String LIKES_ARE_NOTE_MATHING = "Garden's are not mathing"; private static final String DESCRIPTION_ARE_NOTE_MATHING = "Description's are not mathing"; private static final String WRITERS_ARE_NOTE_MATHING = "Writer's are not mathing"; private static final String PRODUCTS_ARE_NOTE_MATHING = "Product's are not matching"; private static final String PICTURE_FILENAME_ARE_NOTE_MATHING = "Picture filename are not matching"; /** * {@link GardenBO} */ private GardenBO gardenBO; public GardenBOMatcher(GardenBO pGardenBO) { super(pGardenBO); this.gardenBO = pGardenBO; } @Override public boolean matches(Object item) { if (super.matches(item)) { if (item instanceof GardenBO) { GardenBO obj = (GardenBO) item; if (testComments(obj)) { if (testLikes(obj)) { if (testOwner(obj)) { if (testAddress(obj)) { if (testDescription(obj)) { if (testName(obj)) { if (testProducts(obj)) { //TODO : Matche other property return true; } errorDescription = PRODUCTS_ARE_NOTE_MATHING; return false; } errorDescription = NAMES_ARE_NOTE_MATHING; return false; } errorDescription = DESCRIPTION_ARE_NOTE_MATHING; return false; } errorDescription = ADDRESSS_ARE_NOTE_MATHING; return false; } errorDescription = WRITERS_ARE_NOTE_MATHING; return false; } errorDescription = LIKES_ARE_NOTE_MATHING; return false; } errorDescription = COMMENTS_ARE_NOTE_MATHING; return false; } return false; } return false; } private boolean testProducts(GardenBO pGardenBO) { if (pGardenBO.getProducts() != null && gardenBO.getProducts() != null) { if (pGardenBO.getProducts().size() == gardenBO.getProducts().size()) { boolean equalsProductFind = false; for (ProductBO pGardenCommnent : pGardenBO.getProducts()) { for (ProductBO gardenProduct : gardenBO.getProducts()) { if (new ProductBOMatcher(gardenProduct).matches(pGardenCommnent)) { equalsProductFind = true; break; } } if (!equalsProductFind) { return false; } equalsProductFind = false; } return true; } } else if (pGardenBO.getProducts() == null && gardenBO.getProducts() == null) { return true; } return false; } private boolean testComments(GardenBO pGardenBO) { if (pGardenBO.getComments() != null && gardenBO.getComments() != null) { if (pGardenBO.getComments().size() == gardenBO.getComments().size()) { boolean equalsCommentFind = false; for (GardenCommentBO pGardenCommnent : pGardenBO.getComments()) { for (GardenCommentBO gardenComment : gardenBO.getComments()) { if (new GardenCommentBOMatcher(gardenComment).matches(pGardenCommnent)) { equalsCommentFind = true; break; } } if (!equalsCommentFind) { return false; } equalsCommentFind = false; } return true; } } else if (pGardenBO.getComments() == null && gardenBO.getComments() == null) { return true; } return false; } private boolean testLikes(GardenBO pGardenBO) { if (pGardenBO.getLikes() != null && gardenBO.getLikes() != null) { if (pGardenBO.getLikes().size() == gardenBO.getLikes().size()) { boolean equalsLikeFind = false; for (GardenLikeBO pGardenCommnent : pGardenBO.getLikes()) { for (GardenLikeBO gardenLike : gardenBO.getLikes()) { if (new GardenLikeBOMatcher(gardenLike).matches(pGardenCommnent)) { equalsLikeFind = true; break; } } if (!equalsLikeFind) { return false; } equalsLikeFind = false; } return true; } } else if (pGardenBO.getLikes() == null && gardenBO.getLikes() == null) { return true; } return false; } private boolean testOwner(GardenBO pGardenBO) { if (this.gardenBO.getOwner() != null && pGardenBO.getOwner() != null) { if (this.gardenBO.getOwner().getId() != null && pGardenBO.getOwner().getId() != null) { return this.gardenBO.getOwner().getId().equals(pGardenBO.getOwner().getId()); } } else if (this.gardenBO.getOwner() == null && pGardenBO.getOwner() == null) { return true; } return false; } private boolean testName(GardenBO pGardenBO) { if (!StringUtils.isEmpty(gardenBO.getName()) && !StringUtils.isEmpty(pGardenBO.getName())) { if (gardenBO.getName().trim().equals(pGardenBO.getName().trim())) { return true; } } else if (StringUtils.isEmpty(gardenBO.getName()) && StringUtils.isEmpty(pGardenBO.getName())) { return true; } return false; } private boolean testDescription(GardenBO pGardenBO) { if (!StringUtils.isEmpty(gardenBO.getDescription()) && !StringUtils.isEmpty(pGardenBO.getDescription())) { if (gardenBO.getDescription().trim().equals(pGardenBO.getDescription().trim())) { return true; } } else if (StringUtils.isEmpty(gardenBO.getDescription()) && StringUtils.isEmpty(pGardenBO.getDescription())) { return true; } return false; } private boolean testAddress(GardenBO pGardenBO) { if (pGardenBO.getAddress() != null && gardenBO.getAddress() != null) { return new AddressBOMatcher(pGardenBO.getAddress()).matches(gardenBO.getAddress()); } else if (pGardenBO.getAddress() == null && gardenBO.getAddress() == null) { return true; } return false; } }
[ "baloo2401@users.noreply.github.com" ]
baloo2401@users.noreply.github.com
dc24cdb0657e1a31b88bc4c7fad1500379459eab
139960e2d7d55e71c15e6a63acb6609e142a2ace
/mobile_app1/module1227/src/main/java/module1227packageJava0/Foo719.java
48504053dbcef3a36f941a4962afd261db29251a
[ "Apache-2.0" ]
permissive
uber-common/android-build-eval
448bfe141b6911ad8a99268378c75217d431766f
7723bfd0b9b1056892cef1fef02314b435b086f2
refs/heads/master
2023-02-18T22:25:15.121902
2023-02-06T19:35:34
2023-02-06T19:35:34
294,831,672
83
7
Apache-2.0
2021-09-24T08:55:30
2020-09-11T23:27:37
Java
UTF-8
Java
false
false
570
java
package module1227packageJava0; import java.lang.Integer; public class Foo719 { Integer int0; Integer int1; Integer int2; public void foo0() { new module1227packageJava0.Foo718().foo9(); } public void foo1() { foo0(); } public void foo2() { foo1(); } public void foo3() { foo2(); } public void foo4() { foo3(); } public void foo5() { foo4(); } public void foo6() { foo5(); } public void foo7() { foo6(); } public void foo8() { foo7(); } public void foo9() { foo8(); } }
[ "oliviern@uber.com" ]
oliviern@uber.com
5855b3dbed678bd1e3e3d87e3d90e79feb2aebce
dcde031e6577be47c4ead1fb2c6e317e94253838
/src/drivers/philips/intellivue/data/OperatingMode.java
78abcef56192c616af75b0d8cb05ec6ba8a1709f
[ "BSD-2-Clause" ]
permissive
EDS-APHP-legacy/LightICE
6ab49e920405b6ac9616de6c1eb48704e6046a39
04d1c27bccd5c64df46d8182b8f4490b98540b3e
refs/heads/master
2022-06-12T21:22:31.131234
2018-05-31T09:53:16
2018-05-31T09:53:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,339
java
/******************************************************************************* * Copyright (c) 2014, MD PnP Program * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ package drivers.philips.intellivue.data; import java.nio.ByteBuffer; import common.io.util.Bits; /** * @author Jeff Plourde * */ public class OperatingMode implements Value { private int bitfield; private static final int OPMODE_UNSPEC = 0x8000; private static final int MONITORING = 0x4000; private static final int DEMO = 0x2000; private static final int SERVICE = 0x1000; private static final int OPMODE_STANDBY = 0x0002; private static final int CONFIG = 0x0001; public boolean isUnspecified() { return 0 != (OPMODE_UNSPEC & bitfield); } public boolean isMonitoring() { return 0 != (MONITORING & bitfield); } public boolean isDemo() { return 0 != (DEMO & bitfield); } public boolean isService() { return 0 != (SERVICE & bitfield); } public boolean isStandby() { return 0 != (OPMODE_STANDBY & bitfield); } public boolean isConfig() { return 0 != (CONFIG & bitfield); } @Override public java.lang.String toString() { StringBuilder sb = new StringBuilder(); sb.append("["); if (isUnspecified()) { sb.append("OPMODE_UNSPEC "); } if (isMonitoring()) { sb.append("MONITORING "); } if (isDemo()) { sb.append("DEMO "); } if (isService()) { sb.append("SERVICE "); } if (isStandby()) { sb.append("STANDBY "); } if (isConfig()) { sb.append("CONFIG "); } sb.append("]"); return sb.toString(); } @Override public void format(ByteBuffer bb) { Bits.putUnsignedShort(bb, bitfield); } @Override public void parse(ByteBuffer bb) { bitfield = Bits.getUnsignedShort(bb); } }
[ "julien.dubiel@aphp.fr" ]
julien.dubiel@aphp.fr
aa60188e913e3a968f7640b3767f2700e697c669
cf13403a2686adbb2e3aa140dc232c7ed5a376ee
/MIchael/src/Ejercicios/Deber3.java
e4aaf2d927b6e528629e8b752b32a174616b8134
[]
no_license
michael1994/DeberProgramacionII
cc6bb6f4bfdf180e8182a69041fe5d72846f301b
28b24c7d193f3e5a7de0f28675bc7239341aa9e5
refs/heads/master
2021-01-10T06:28:42.893921
2015-11-15T22:49:40
2015-11-15T22:49:40
46,675,772
0
0
null
null
null
null
UTF-8
Java
false
false
674
java
package Ejercicios; import java.util.Scanner; public class Deber3 { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner (System.in); int n; double acum=0; System.out.println("BIENVENIDOS A NUESTRO SISTEMA..."); double [] num= new double[50]; for(n=0;n<50;n++) { System.out.println("INGRESAR SUS NOTAS POR FAVOR"); num[n]=sc.nextDouble(); acum=acum+num [n]; } acum=acum/50; System.out.println("SU PROMEDIO ES...:"+acum); if(acum<7){ System.out.println("USTED ESTA REPROBADO"); } else if(acum>7){ System.out.println("USTED ESTA APROBADO"); } } }
[ "pc@pc-PC" ]
pc@pc-PC
d3e141b85748db77a07eb82fce5e0e07017e39e6
db97ce70bd53e5c258ecda4c34a5ec641e12d488
/src/main/java/com/alipay/api/response/KoubeiShopMallPageQueryResponse.java
cd7c05ace9bb4fbfee8f463bccf73c49a4549567
[ "Apache-2.0" ]
permissive
smitzhang/alipay-sdk-java-all
dccc7493c03b3c937f93e7e2be750619f9bed068
a835a9c91e800e7c9350d479e84f9a74b211f0c4
refs/heads/master
2022-11-23T20:32:27.041116
2020-08-03T13:03:02
2020-08-03T13:03:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
633
java
package com.alipay.api.response; import com.alipay.api.internal.mapping.ApiField; import com.alipay.api.AlipayResponse; /** * ALIPAY API: koubei.shop.mall.page.query response. * * @author auto create * @since 1.0, 2019-01-07 20:51:15 */ public class KoubeiShopMallPageQueryResponse extends AlipayResponse { private static final long serialVersionUID = 4328713396961446259L; /** * 商圈首页url地址 */ @ApiField("mall_url") private String mallUrl; public void setMallUrl(String mallUrl) { this.mallUrl = mallUrl; } public String getMallUrl( ) { return this.mallUrl; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
88d6efed239b30f7ec77ff2387707635cd3ad67b
c3533d8792cb0d1ec5857fa4ae21864b7b53d16d
/opsdev_monitor/src/main/java/org/alvin/opsdev/monitor/system/bean/enums/AlertLevel.java
8a4a2d5af3f387313e04ca7b81aabd7892b5f772
[]
no_license
alvin198761/devops_v2
1fee79f4b96de9610dfb88b1737e6146865af8f7
2cea77ba27ed4bebf5564647e0be1f3edd496807
refs/heads/master
2021-01-22T18:01:55.151385
2017-06-02T09:52:13
2017-06-02T09:52:33
85,053,174
0
1
null
null
null
null
UTF-8
Java
false
false
157
java
package org.alvin.opsdev.monitor.system.bean.enums; /** * Created by tangzhichao on 2017/4/21. */ public enum AlertLevel { CRITICAL,WARNING,NORMAL }
[ "alvin198761@163.com" ]
alvin198761@163.com
94cb0a2c9704687e302e7afbc56ac541d1b399b2
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/16/16_2d3809f50a21bc1d9dc84a557ffeb450b0a4e6e2/EditionPatternInstanceParameter/16_2d3809f50a21bc1d9dc84a557ffeb450b0a4e6e2_EditionPatternInstanceParameter_t.java
c5b53e1a35475f74397759abe84694514b29e7d2
[]
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,547
java
/* * (c) Copyright 2010-2011 AgileBirds * * This file is part of OpenFlexo. * * OpenFlexo 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. * * OpenFlexo 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 OpenFlexo. If not, see <http://www.gnu.org/licenses/>. * */ package org.openflexo.foundation.viewpoint; import java.lang.reflect.Type; import org.openflexo.foundation.DataModification; import org.openflexo.foundation.technologyadapter.TypeAwareModelSlot; import org.openflexo.foundation.view.EditionPatternInstance; public class EditionPatternInstanceParameter extends InnerModelSlotParameter<VirtualModelModelSlot<?, ?>> { private EditionPattern editionPatternType; private String editionPatternTypeURI; public EditionPatternInstanceParameter(VirtualModel.VirtualModelBuilder builder) { super(builder); } @Override public Type getType() { if (getEditionPatternType() != null) { return EditionPatternInstanceType.getEditionPatternInstanceType(getEditionPatternType()); } return EditionPatternInstance.class; }; @Override public WidgetType getWidget() { return WidgetType.EDITION_PATTERN; } public String _getEditionPatternTypeURI() { if (editionPatternType != null) { return editionPatternType.getURI(); } return editionPatternTypeURI; } public void _setEditionPatternTypeURI(String editionPatternURI) { this.editionPatternTypeURI = editionPatternURI; } public EditionPattern getEditionPatternType() { if (editionPatternType == null && editionPatternTypeURI != null && getModelSlotVirtualModel() != null) { editionPatternType = getModelSlotVirtualModel().getEditionPattern(editionPatternTypeURI); for (EditionScheme s : getEditionPattern().getEditionSchemes()) { s.updateBindingModels(); } } return editionPatternType; } public void setEditionPatternType(EditionPattern editionPatternType) { if (editionPatternType != this.editionPatternType) { this.editionPatternType = editionPatternType; for (EditionScheme s : getEditionPattern().getEditionSchemes()) { s.updateBindingModels(); } } } @Override public void setModelSlot(VirtualModelModelSlot<?, ?> modelSlot) { super.setModelSlot(modelSlot); setChanged(); notifyObservers(new DataModification("modelSlotVirtualModel", null, modelSlot)); } public VirtualModel<?> getModelSlotVirtualModel() { if (getModelSlot() != null && getModelSlot().getVirtualModelResource() != null) { return getModelSlot().getVirtualModelResource().getVirtualModel(); } return null; } @Override public VirtualModelModelSlot<?, ?> getModelSlot() { if (super.getModelSlot() instanceof VirtualModelModelSlot) { VirtualModelModelSlot<?, ?> returned = super.getModelSlot(); if (returned == null) { if (getVirtualModel() != null && getVirtualModel().getModelSlots(VirtualModelModelSlot.class).size() > 0) { return getVirtualModel().getModelSlots(VirtualModelModelSlot.class).get(0); } } return returned; } return null; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
89b477842365634092be4efd0f758f57afbfefd0
958b13739d7da564749737cb848200da5bd476eb
/src/main/java/com/alipay/api/domain/BenefitInfoDetail.java
d8d555349d06990b40a1870be81adbfef3541022
[ "Apache-2.0" ]
permissive
anywhere/alipay-sdk-java-all
0a181c934ca84654d6d2f25f199bf4215c167bd2
649e6ff0633ebfca93a071ff575bacad4311cdd4
refs/heads/master
2023-02-13T02:09:28.859092
2021-01-14T03:17:27
2021-01-14T03:17:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,544
java
package com.alipay.api.domain; import com.alipay.api.AlipayObject; import com.alipay.api.internal.mapping.ApiField; /** * 权益信息 * * @author auto create * @since 1.0, 2019-08-08 20:05:11 */ public class BenefitInfoDetail extends AlipayObject { private static final long serialVersionUID = 6777443898277769277L; /** * PRE_FUND:实际核销或者商户赠送的金额 DISCOUNT:实际折扣掉的金额(获取权益不支持该类型) COUPON:实际核销或者商户赠送的券 */ @ApiField("amount") private String amount; /** * 权益类型 PRE_FUND(卡面额) DISCOUNT:折扣金额 COUPON:券 */ @ApiField("benefit_type") private String benefitType; /** * COUPON:当核销或者赠送券时,可以设置该值 */ @ApiField("count") private String count; /** * 产生核销或者赠送权益的描述 */ @ApiField("description") private String description; public String getAmount() { return this.amount; } public void setAmount(String amount) { this.amount = amount; } public String getBenefitType() { return this.benefitType; } public void setBenefitType(String benefitType) { this.benefitType = benefitType; } public String getCount() { return this.count; } public void setCount(String count) { this.count = count; } public String getDescription() { return this.description; } public void setDescription(String description) { this.description = description; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
01810c5b731483f7c858730a632edcdff0d1cfe6
96f724aab12c47e752693afacb16d83d7da1e040
/src/cz/vutbr/fit/gja/lastevents/logic/Main.java
3da0524e887698bc957ca788d2883bba15e89263
[]
no_license
beny/last-events
d4d4febe0ee214e828a1e6c4a66a2fec4966af94
aa75693e22867f25ba03c6dd71f45a127d06387c
refs/heads/master
2021-01-22T10:19:30.754420
2011-05-13T13:50:14
2011-05-13T13:50:14
1,364,279
0
0
null
null
null
null
UTF-8
Java
false
false
1,014
java
package cz.vutbr.fit.gja.lastevents.logic; /** * Testing class. * @author Petr Nohejl <xnohej00@stud.fit.vutbr.cz> */ public class Main { public static void main (String arg[]) { System.out.println("Start app"); // API Key is c8e71fc5e7255264940483b4228c010f // GEO.GET_EVENTS: http://www.last.fm/api/show?service=270 // ARTIST.GET_EVENTS: http://www.last.fm/api/show?service=117 Parser lastApi = new Parser("c8e71fc5e7255264940483b4228c010f", "lastevents"); String url1 = lastApi.getEventsByLocation("Brno", 10, 5); String url2 = lastApi.getEventsByArtist("Wohnout", 5); System.out.println(url1); System.out.println(url2); QueryEvent query1 = new QueryEvent(); QueryEvent query2 = new QueryEvent(); String res1 = Parser.parseEvents(10, 5, url1, query1, QueryEvent.Types.SEARCH_BY_LOCATION); String res2 = Parser.parseEvents(0, 5, url2, query2, QueryEvent.Types.SEARCH_BY_ARTIST); if(res1 == "") query1.printQuery(); if(res2 == "") query2.printQuery(); } }
[ "petr.nohejl@gmail.com" ]
petr.nohejl@gmail.com
cc9760a612372b30a4647e6ba1a0428ae001201f
c8688db388a2c5ac494447bac90d44b34fa4132c
/sources/com/google/firebase/crashlytics/internal/unity/ResourceUnityVersionProvider.java
2e6c46ad0e1ea81ff095fd8a3872332f4b6b6775
[]
no_license
mred312/apk-source
98dacfda41848e508a0c9db2c395fec1ae33afa1
d3ca7c46cb8bf701703468ddc88f25ba4fb9d975
refs/heads/master
2023-03-06T05:53:50.863721
2021-02-23T13:34:20
2021-02-23T13:34:20
341,481,669
0
0
null
null
null
null
UTF-8
Java
false
false
829
java
package com.google.firebase.crashlytics.internal.unity; import android.content.Context; import com.google.firebase.crashlytics.internal.common.CommonUtils; public class ResourceUnityVersionProvider implements UnityVersionProvider { /* renamed from: a */ private final Context f19537a; /* renamed from: b */ private boolean f19538b = false; /* renamed from: c */ private String f19539c; public ResourceUnityVersionProvider(Context context) { this.f19537a = context; } public String getUnityVersion() { if (!this.f19538b) { this.f19539c = CommonUtils.resolveUnityEditorVersion(this.f19537a); this.f19538b = true; } String str = this.f19539c; if (str != null) { return str; } return null; } }
[ "mred312@gmail.com" ]
mred312@gmail.com
5b8ec96951e680ed56464d4042b79efad24b75bb
128eb90ce7b21a7ce621524dfad2402e5e32a1e8
/laravel-converted/src/main/java/com/project/convertedCode/includes/vendor/fzaninotto/faker/src/Faker/Provider/it_IT/file_Company_php.java
b0abf8b0d446511d698172072da01cad7a21c744
[ "MIT", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
RuntimeConverter/RuntimeConverterLaravelJava
657b4c73085b4e34fe4404a53277e056cf9094ba
7ae848744fbcd993122347ffac853925ea4ea3b9
refs/heads/master
2020-04-12T17:22:30.345589
2018-12-22T10:32:34
2018-12-22T10:32:34
162,642,356
0
0
null
null
null
null
UTF-8
Java
false
false
1,976
java
package com.project.convertedCode.includes.vendor.fzaninotto.faker.src.Faker.Provider.it_IT; import com.runtimeconverter.runtime.RuntimeStack; import com.runtimeconverter.runtime.interfaces.ContextConstants; import com.runtimeconverter.runtime.includes.RuntimeIncludable; import com.runtimeconverter.runtime.includes.IncludeEventException; import com.runtimeconverter.runtime.classes.RuntimeClassBase; import com.runtimeconverter.runtime.RuntimeEnv; import com.runtimeconverter.runtime.interfaces.UpdateRuntimeScopeInterface; import com.runtimeconverter.runtime.arrays.ZPair; /* Converted with The Runtime Converter (runtimeconverter.com) vendor/fzaninotto/faker/src/Faker/Provider/it_IT/Company.php */ public class file_Company_php implements RuntimeIncludable { public static final file_Company_php instance = new file_Company_php(); public final void include(RuntimeEnv env, RuntimeStack stack) throws IncludeEventException { Scope605 scope = new Scope605(); stack.pushScope(scope); this.include(env, stack, scope); stack.popScope(); } public final void include(RuntimeEnv env, RuntimeStack stack, Scope605 scope) throws IncludeEventException { // Conversion Note: class named Company was here in the source code env.addManualClassLoad("Faker\\Provider\\it_IT\\Company"); } private static final ContextConstants runtimeConverterContextContantsInstance = new ContextConstants() .setDir("/vendor/fzaninotto/faker/src/Faker/Provider/it_IT") .setFile("/vendor/fzaninotto/faker/src/Faker/Provider/it_IT/Company.php"); public ContextConstants getContextConstants() { return runtimeConverterContextContantsInstance; } private static class Scope605 implements UpdateRuntimeScopeInterface { public void updateStack(RuntimeStack stack) {} public void updateScope(RuntimeStack stack) {} } }
[ "git@runtimeconverter.com" ]
git@runtimeconverter.com
c3d097071d86b4849f10390d8997bf531a9dc9f3
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/32/32_5ef60ebe76a11f7242b71ec78df794d69047792b/HungerListener/32_5ef60ebe76a11f7242b71ec78df794d69047792b_HungerListener_t.java
f5c5996941bdd0052ee8db51fd6efaf182ebfa53
[]
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
1,527
java
package com.TeamNovus.Supernaturals.Listeners.Custom; import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.entity.FoodLevelChangeEvent; import org.bukkit.event.player.PlayerRespawnEvent; import com.TeamNovus.Supernaturals.SNPlayers; import com.TeamNovus.Supernaturals.Supernaturals; import com.TeamNovus.Supernaturals.Player.SNPlayer; public class HungerListener implements Listener { @EventHandler(priority=EventPriority.HIGHEST) public void onFoodLevelChange(final FoodLevelChangeEvent event) { if(event.isCancelled()) return; if(event.getEntity() instanceof Player) { final SNPlayer player = SNPlayers.i.get((Player) event.getEntity()); player.setFoodLevel(player.getFoodLevel() + (event.getFoodLevel() - ((Player) event.getEntity()).getFoodLevel())); // Rescales the client food level bar. Bukkit.getScheduler().runTaskAsynchronously(Supernaturals.getPlugin(), new Runnable() { @Override public void run() { player.updateFoodLevel(); } }); event.setFoodLevel(player.getFoodLevel() * 20 / player.getMaxFoodLevel()); } } @EventHandler(priority=EventPriority.HIGHEST) public void onPlayerRespawn(PlayerRespawnEvent event) { SNPlayer player = SNPlayers.i.get(event.getPlayer()); player.setFoodLevel(player.getMaxFoodLevel()); player.updateFoodLevel(); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
9315001d6556469068e640fa31acc18eae58cf5e
2cb634a54ed05a8e175bb5a7b8cfd201b53bebb2
/SpMVC_05_Memo_join2/src/main/java/com/biz/memo/controller/MemberController.java
b53e17af9bfcd7429e59da7a7186880beb0f15b3
[]
no_license
najongjine/SpringWork02
dffb9390d0c7c806e851914854f1715f6b46fc1d
a5180f46ef1637001f81875be53c82add5fd0579
refs/heads/master
2022-12-21T21:54:26.819344
2020-03-12T07:42:00
2020-03-12T07:42:00
230,872,611
0
1
null
2022-12-16T15:27:26
2019-12-30T07:50:21
Java
UTF-8
Java
false
false
3,097
java
package com.biz.memo.controller; import javax.servlet.http.HttpSession; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import com.biz.memo.domain.UserDTO; import com.biz.memo.service.UserService; import lombok.extern.slf4j.Slf4j; /* * Controller에서 객체(리스트)를 view로 보내는 방법 * Model.addAttribute() * SessionAttribute() ModelAndAttribute()설정후 Model에 담기 * * HttpsSession.setAttribute()에 담기 * * Model: 일회용. controller -> view 보내기만을 위한 데이터 * modek에 담긴 데이터를 다시 server로ㅓ 보내려면 input tag에 갑을 담아서 다시 post로 전송 * * SessionAttribute+Model: 일회용데이터이면서 session 유지되는 데이터 * input view에서Spring form tag에 값을 담으면 이후에 자유롭게 * 서버로 전송할수 있다. * input, update 코딩을 간편하게 사용. * spring에서 SessionAttribute일 경우 Garbage Collection이 적용됨. * HttpSession: 주로 login과 관련된 데이터를 유지하기위한 용도. * 시간설정을 하거나, 값을 remove 하거나, 서버가 멈출때까지 유지. * 모든 controller, 모든 view에서 값을 참조할수 있다. * 서버의 메모리공간을 많이 차지한다. * GC적용 안됨.*/ @Slf4j @RequestMapping(value = "/member") @Controller public class MemberController { @Autowired UserService uService; @RequestMapping(value = "/join", method=RequestMethod.GET) public String join() { return null; } @RequestMapping(value = "/login",method=RequestMethod.GET) public String login(@RequestParam(value="LOGIN_MSG",required = false,defaultValue = "0") String msg,Model model) { model.addAttribute("LOGIN_MSG", msg); model.addAttribute("BODY", "LOGIN"); return "member/login"; } @RequestMapping(value = "/login",method=RequestMethod.POST) public String login(@ModelAttribute UserDTO userDTO, Model model, HttpSession httpSession, String BODY) { boolean loginOk=uService.userLoginCheck(userDTO); //로그인 입력정보와 DB정보와 일치하는지 검사 if(loginOk==true) { httpSession.setMaxInactiveInterval(10*60); //db로부터 아예 새로 가져오자 userDTO=uService.getUser(userDTO.getU_id()); httpSession.setAttribute("userDTO", userDTO); } else { httpSession.removeAttribute("userDTO"); model.addAttribute("LOGIN_MSG", "FAIL"); return "redirect:/member/login"; } //model.addAttribute("BODY", BODY); return "redirect:/"; } @RequestMapping(value = "/logout",method=RequestMethod.GET) public String logout(HttpSession httpSession) { httpSession.setAttribute("userDTO", null); httpSession.removeAttribute("userDTO"); return "redirect:/"; } }
[ "najongjin3@hotmail.com" ]
najongjin3@hotmail.com
2746ed90adbb01dbd6946162b86fac7208ef453c
236554871acf753bb50302d24692e617f8b10a94
/src/test/java/com/paschoalini/cursomc/CursomcApplicationTests.java
051f28215d80a8e72fd976a6d2c1087963cb5ab5
[]
no_license
paschoalini/cursomc
b7b8f09c43dcc045ddd429f9e140e03b26ec51ec
a8181cd8474020e9015eb6b2d4c90990e57e9c0f
refs/heads/master
2020-10-01T02:54:25.367491
2020-01-02T19:46:06
2020-01-02T19:46:06
227,439,129
0
0
null
null
null
null
UTF-8
Java
false
false
216
java
package com.paschoalini.cursomc; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class CursomcApplicationTests { @Test void contextLoads() { } }
[ "=" ]
=
4b0530bce843a724e4d8ec8637119f03b14e2b89
192fc75e245f8834861c2a8dbe9714daa2ec6c2e
/CWE89_SQL_Injection/CWE89_SQL_Injection__listen_tcp_executeUpdate_54c.java
40b9430ace2ae68c926cb86a7fe033086ffd87a3
[]
no_license
Carlosboie/Playtech
6f8bb72efc6769612a0cb967a9130f6db78d19fc
684ae94b9b0ff069c8561157227b5b43a7ca1320
refs/heads/master
2021-05-27T11:05:24.157218
2012-09-12T08:08:30
2012-09-12T08:08:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,438
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE89_SQL_Injection__listen_tcp_executeUpdate_54c.java Label Definition File: CWE89_SQL_Injection.label.xml Template File: sources-sinks-54c.tmpl.java */ /* * @description * CWE: 89 SQL Injection * BadSource: listen_tcp Read data using a listening tcp connection * GoodSource: A hardcoded string * Sinks: executeUpdate * GoodSink: prepared sqlstatement, executeUpdate * BadSink : raw query used in executeUpdate * Flow Variant: 54 Data flow: data passed as an argument from one method through three others to a fifth; all five functions are in different classes in the same package * * */ package testcases.CWE89_SQL_Injection; import testcasesupport.*; import java.sql.*; import javax.servlet.http.*; import java.util.logging.Logger; public class CWE89_SQL_Injection__listen_tcp_executeUpdate_54c { public void bad_sink(String data ) throws Throwable { (new CWE89_SQL_Injection__listen_tcp_executeUpdate_54d()).bad_sink(data ); } /* goodG2B() - use goodsource and badsink */ public void goodG2B_sink(String data ) throws Throwable { (new CWE89_SQL_Injection__listen_tcp_executeUpdate_54d()).goodG2B_sink(data ); } /* goodB2G() - use badsource and goodsink */ public void goodB2G_sink(String data ) throws Throwable { (new CWE89_SQL_Injection__listen_tcp_executeUpdate_54d()).goodB2G_sink(data ); } }
[ "amitf@checkmarx.com" ]
amitf@checkmarx.com
0c767727d79b20c4c7e58755b0e8ba05d83d681a
862c1ab788fe70c2dae45d2a4593e3b89afcdc0a
/springcode/spring-framework/spring-webmvc/src/test/java/org/springframework/web/servlet/view/velocity/VelocityToolboxViewTests.java
eac80951195f62ad894c89472922fe71eae9a85d
[ "Apache-2.0" ]
permissive
ldywork/sourcecode
801c1dffa40df1aa4a977f78798a1901644ebb84
7c17edfaeaca4d21b8ce8db6c5d0c475b4d44f4c
refs/heads/master
2022-12-22T13:25:49.881128
2019-10-27T09:48:49
2019-10-27T09:48:49
216,370,240
0
0
null
2022-12-16T01:35:34
2019-10-20T13:56:57
HTML
UTF-8
Java
false
false
3,069
java
package org.springframework.web.servlet.view.velocity; import java.util.HashMap; import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.velocity.Template; import org.apache.velocity.app.VelocityEngine; import org.apache.velocity.context.Context; import org.apache.velocity.tools.generic.DateTool; import org.apache.velocity.tools.generic.MathTool; import org.apache.velocity.tools.view.context.ChainedContext; import org.apache.velocity.tools.view.tools.LinkTool; import org.junit.Test; import org.springframework.mock.web.test.MockHttpServletRequest; import org.springframework.mock.web.test.MockHttpServletResponse; import org.springframework.mock.web.test.MockServletContext; import org.springframework.web.context.support.StaticWebApplicationContext; import static org.junit.Assert.*; /** * @author Rod Johnson * @author Juergen Hoeller * @author Dave Syer */ public class VelocityToolboxViewTests { @Test1 public void testVelocityToolboxView() throws Exception { final String templateName = "test.vm"; StaticWebApplicationContext wac = new StaticWebApplicationContext(); wac.setServletContext(new MockServletContext()); final Template expectedTemplate = new Template(); VelocityConfig vc = new VelocityConfig() { @Override public VelocityEngine getVelocityEngine() { return new TestVelocityEngine(templateName, expectedTemplate); } }; wac.getDefaultListableBeanFactory().registerSingleton("velocityConfigurer", vc); final HttpServletRequest expectedRequest = new MockHttpServletRequest(); final HttpServletResponse expectedResponse = new MockHttpServletResponse(); VelocityToolboxView vv = new VelocityToolboxView() { @Override protected void mergeTemplate(Template template, Context context, HttpServletResponse response) throws Exception { assertTrue(template == expectedTemplate); assertTrue(response == expectedResponse); assertTrue(context instanceof ChainedContext); assertEquals("this is foo.", context.get("foo")); assertTrue(context.get("map") instanceof HashMap<?,?>); assertTrue(context.get("date") instanceof DateTool); assertTrue(context.get("math") instanceof MathTool); assertTrue(context.get("link") instanceof LinkTool); LinkTool linkTool = (LinkTool) context.get("link"); assertNotNull(linkTool.getContextURL()); assertTrue(context.get("link2") instanceof LinkTool); LinkTool linkTool2 = (LinkTool) context.get("link2"); assertNotNull(linkTool2.getContextURL()); } }; vv.setUrl(templateName); vv.setApplicationContext(wac); Map<String, Class<?>> toolAttributes = new HashMap<String, Class<?>>(); toolAttributes.put("math", MathTool.class); toolAttributes.put("link2", LinkTool.class); vv.setToolAttributes(toolAttributes); vv.setToolboxConfigLocation("org/springframework/web/servlet/view/velocity/toolbox.xml"); vv.setExposeSpringMacroHelpers(false); vv.render(new HashMap<String,Object>(), expectedRequest, expectedResponse); } }
[ "ldylife@163.com" ]
ldylife@163.com
df17b5d357fc7ead9f2852a306ba53660fdd5655
9415391308f4b058d8190483c5ed17ae2683f3af
/src/main/java/br/com/jns/checkpoint/security/DomainUserDetailsService.java
43e74f4ed9d3690afd60eb52501b07c60d462acc
[]
no_license
jairosousa/Check-Point
5693ad94266abdf4dad926985e0174193a65eeee
cdfb554a29ec76f34e864147a068db44fbf88671
refs/heads/master
2023-04-27T20:36:40.857850
2023-02-02T19:44:33
2023-02-02T19:44:33
164,027,566
0
1
null
2023-04-25T20:57:03
2019-01-03T22:03:54
Java
UTF-8
Java
false
false
2,679
java
package br.com.jns.checkpoint.security; import br.com.jns.checkpoint.domain.User; import br.com.jns.checkpoint.repository.UserRepository; import org.hibernate.validator.internal.constraintvalidators.hv.EmailValidator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; import java.util.*; import java.util.stream.Collectors; /** * Authenticate a user from the database. */ @Component("userDetailsService") public class DomainUserDetailsService implements UserDetailsService { private final Logger log = LoggerFactory.getLogger(DomainUserDetailsService.class); private final UserRepository userRepository; public DomainUserDetailsService(UserRepository userRepository) { this.userRepository = userRepository; } @Override @Transactional public UserDetails loadUserByUsername(final String login) { log.debug("Authenticating {}", login); if (new EmailValidator().isValid(login, null)) { return userRepository.findOneWithAuthoritiesByEmail(login) .map(user -> createSpringSecurityUser(login, user)) .orElseThrow(() -> new UsernameNotFoundException("User with email " + login + " was not found in the database")); } String lowercaseLogin = login.toLowerCase(Locale.ENGLISH); return userRepository.findOneWithAuthoritiesByLogin(lowercaseLogin) .map(user -> createSpringSecurityUser(lowercaseLogin, user)) .orElseThrow(() -> new UsernameNotFoundException("User " + lowercaseLogin + " was not found in the database")); } private org.springframework.security.core.userdetails.User createSpringSecurityUser(String lowercaseLogin, User user) { if (!user.getActivated()) { throw new UserNotActivatedException("User " + lowercaseLogin + " was not activated"); } List<GrantedAuthority> grantedAuthorities = user.getAuthorities().stream() .map(authority -> new SimpleGrantedAuthority(authority.getName())) .collect(Collectors.toList()); return new org.springframework.security.core.userdetails.User(user.getLogin(), user.getPassword(), grantedAuthorities); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
91911264dbfc30cd4cfd77baccae732ab5179714
022238f956475ba62ef9109bdae0dd85970a0694
/src/test/java/endtoend/sizzle/SizzlePseudoForm.java
d34bf898356f19e36774d65a0293b384fef2ec98
[ "Apache-2.0" ]
permissive
seleniumQuery/seleniumQuery
b9850aabdb5ec6672a8553cc684448ce3d3a0d06
ab50fa998e02a21c9769eef8f24f51d280271827
refs/heads/main
2022-11-10T14:40:15.180078
2022-10-21T22:42:48
2022-10-21T22:42:48
11,772,284
72
31
NOASSERTION
2022-10-21T22:42:49
2013-07-30T18:30:17
Java
UTF-8
Java
false
false
3,065
java
/* * Copyright (c) 2016 seleniumQuery authors * * 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 endtoend.sizzle; import org.junit.ClassRule; import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import testinfrastructure.junitrule.SetUpAndTearDownDriver; import testinfrastructure.junitrule.annotation.JavaScriptEnabledOnly; public class SizzlePseudoForm extends SizzleTest { @ClassRule @Rule public static SetUpAndTearDownDriver setUpAndTearDownDriverRule = new SetUpAndTearDownDriver(SizzleTest.class); @Test @JavaScriptEnabledOnly public void pseudo_form() { createInputs(); t("Form element :input", "#form :input", new String[]{"text1", "text2", "radio1", "radio2", "check1", "check2", "hidden1", "hidden2", "name", "search", "button", "area1", "select1", "select2", "select3", "select4", "select5", "impliedText", "capitalText"}); t("Form element :radio", "#form :radio", new String[]{"radio1", "radio2"}); t("Form element :checkbox", "#form :checkbox", new String[]{"check1", "check2"}); t("Form element :text", "#form :text", new String[]{"text1", "text2", "hidden2", "name", "impliedText", "capitalText"}); removeInputs(); } private void createInputs() { executeJS("jQuery('<input id=\"impliedText\"/><input id=\"capitalText\" type=\"TEXT\">').appendTo('#form');"); } private void removeInputs() { executeJS("jQuery('#impliedText,#capitalText').remove()"); } @Test @Ignore("Issue#94") public void pseudo_form__checkedPseudoClass() { t("Form element :radio:checked", "#form :radio:checked", new String[]{"radio2"}); t("Form element :checkbox:checked", "#form :checkbox:checked", new String[]{"check1"}); t("Form element :radio:checked, :checkbox:checked", "#form :radio:checked, #form :checkbox:checked", new String[]{"radio2", "check1"}); t("Selected Option Element are also :checked", "#form option:checked", new String[]{"option1a", "option2d", "option3b", "option3c", "option4b", "option4c", "option4d", "option5a"}); } @Test @Ignore("Issue#86") public void pseudo_form__selectedPseudoClass() { t("Selected Option Element", "#form option:selected", new String[]{"option1a", "option2d", "option3b", "option3c", "option4b", "option4c", "option4d", "option5a"}); } @Test public void pseudo_form__hidden() { t("Hidden inputs should be treated as enabled. See QSA test.", "#hidden1:enabled", new String[]{"hidden1"}); } }
[ "acdcjunior@gmail.com" ]
acdcjunior@gmail.com
b4aa02011e645fd7753419299a1897ba1c963304
471a1d9598d792c18392ca1485bbb3b29d1165c5
/jadx-MFP/src/main/java/com/integralads/avid/library/inmobi/session/internal/trackingwebview/AvidWebViewClient.java
f8f0d3156c399eb29720c76829c7e839df4b358d
[]
no_license
reed07/MyPreferencePal
84db3a93c114868dd3691217cc175a8675e5544f
365b42fcc5670844187ae61b8cbc02c542aa348e
refs/heads/master
2020-03-10T23:10:43.112303
2019-07-08T00:39:32
2019-07-08T00:39:32
129,635,379
2
0
null
null
null
null
UTF-8
Java
false
false
794
java
package com.integralads.avid.library.inmobi.session.internal.trackingwebview; import android.webkit.WebView; import android.webkit.WebViewClient; public class AvidWebViewClient extends WebViewClient { private AvidWebViewClientListener listener; public interface AvidWebViewClientListener { void webViewDidLoadData(); } public void setListener(AvidWebViewClientListener avidWebViewClientListener) { this.listener = avidWebViewClientListener; } public void onPageFinished(WebView webView, String str) { super.onPageFinished(webView, str); AvidWebViewClientListener avidWebViewClientListener = this.listener; if (avidWebViewClientListener != null) { avidWebViewClientListener.webViewDidLoadData(); } } }
[ "anon@ymous.email" ]
anon@ymous.email
29450913c848e178517863b161b9feaf0d675777
542e78ed5a5fb6074e83f8b1afbf5a9165988a79
/bin/custom/training/trainingfulfilmentprocess/src/com/training/fulfilmentprocess/CheckOrderService.java
02f8139aeb4a3bff3916e27e17365a5ded42fec7
[]
no_license
VladislawL/hybris-commerce-trails
49d08b6639520a5e71273132b2761b5f27ddc114
a1ce4ae00952077bf23a78a64162a375cb50f1a1
refs/heads/master
2022-12-27T19:39:27.514634
2020-10-06T08:25:13
2020-10-06T08:25:13
299,559,346
0
0
null
null
null
null
UTF-8
Java
false
false
533
java
/* * Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. */ package com.training.fulfilmentprocess; import de.hybris.platform.core.model.order.OrderModel; /** * Used by CheckOrderAction, this service is designed to validate the order prior to running the fulfilment process. */ public interface CheckOrderService { /** * Performs various order checks * * @param order * the order * @return whether the order is ready for fulfillment or not */ boolean check(OrderModel order); }
[ "vladislaw.logvin@yandex.ru" ]
vladislaw.logvin@yandex.ru
cfebffd64a591ed9b007b2c1289c6bde43f238aa
f3698795f174340106c66885bb57ac72134c58c8
/quality/idatrix-quality-cloud/src/main/java/com/ys/idatrix/quality/toolkit/analyzer/script/SQLScriptParser.java
2a3a1a3a7d5a2eeffd7400e2cdc8e1f329a94f71
[]
no_license
ahandful/CloudETL
6e5c195953a944cdc62702b100bd7bcd629b4aee
bb4be62e8117082cd656741ecae33e4262ad3fb5
refs/heads/master
2020-09-13T01:33:43.749781
2019-04-18T02:12:08
2019-04-18T02:13:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
225
java
/** * 云化数据集成系统 * iDatrxi CloudETL */ package com.ys.idatrix.quality.toolkit.analyzer.script; /** * SQLScriptParser <br/> * @author JW * @since 2018年1月8日 * */ public class SQLScriptParser { }
[ "xionghan@gdbigdata.com" ]
xionghan@gdbigdata.com
fb50ccaa183e0cf6b09c8e0cef664a36e3840cb9
963599f6f1f376ba94cbb504e8b324bcce5de7a3
/sources/p035ru/unicorn/ujin/view/fragments/domru/CodeRecoveryFirstFragment$onViewCreated$2.java
994f63ffb21d2e48047887975c760e5bba726647
[]
no_license
NikiHard/cuddly-pancake
563718cb73fdc4b7b12c6233d9bf44f381dd6759
3a5aa80d25d12da08fd621dc3a15fbd536d0b3d4
refs/heads/main
2023-04-09T06:58:04.403056
2021-04-20T00:45:08
2021-04-20T00:45:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,104
java
package p035ru.unicorn.ujin.view.fragments.domru; import android.view.View; import kotlin.Metadata; @Metadata(mo51341bv = {1, 0, 3}, mo51342d1 = {"\u0000\u0010\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0000\u001a\u00020\u00012\u000e\u0010\u0002\u001a\n \u0004*\u0004\u0018\u00010\u00030\u0003H\n¢\u0006\u0002\b\u0005"}, mo51343d2 = {"<anonymous>", "", "it", "Landroid/view/View;", "kotlin.jvm.PlatformType", "onClick"}, mo51344k = 3, mo51345mv = {1, 4, 1}) /* renamed from: ru.unicorn.ujin.view.fragments.domru.CodeRecoveryFirstFragment$onViewCreated$2 */ /* compiled from: CodeRecoveryFirstFragment.kt */ final class CodeRecoveryFirstFragment$onViewCreated$2 implements View.OnClickListener { final /* synthetic */ CodeRecoveryFirstFragment this$0; CodeRecoveryFirstFragment$onViewCreated$2(CodeRecoveryFirstFragment codeRecoveryFirstFragment) { this.this$0 = codeRecoveryFirstFragment; } public final void onClick(View view) { CodeRecoveryFirstFragment.access$getBaseActivity$p(this.this$0).goToRegistrationActivity(0); } }
[ "a.amirovv@mail.ru" ]
a.amirovv@mail.ru
ab7edced2f5f826e815ff92f2c680e1ceb800bf2
0b41a8a013ffa93829a5cdce56c8df58d82aa7be
/MusicPlayerD/app/src/main/java/com/example/administrator/musicplayer/MainActivity.java
34c8d7d27ae03f27260f626bf0305647deb1c80f
[]
no_license
qskeksq/Android_MusicPlayerRef
3424481b58ed79052b53b353103eb76ed5c8848a
6b301c163bb9324bdfffbfe09147e2901a4ec736
refs/heads/master
2021-09-04T00:02:34.886087
2018-01-13T03:57:30
2018-01-13T03:57:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,112
java
package com.example.administrator.musicplayer; import android.net.Uri; import android.os.Build; import android.support.annotation.RequiresApi; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.NavigationView; import android.support.design.widget.TabLayout; import android.support.v4.app.Fragment; import android.support.v4.view.GravityCompat; import android.support.v4.view.ViewPager; import android.support.v4.widget.DrawerLayout; import android.support.v7.app.ActionBarDrawerToggle; import android.support.v7.widget.Toolbar; import android.view.Menu; import android.view.MenuItem; import com.example.administrator.musicplayer.adapter.ListPagerAdapter; import com.example.administrator.musicplayer.domain.SongLab; import com.example.administrator.musicplayer.fragment.AlbumFragment; import com.example.administrator.musicplayer.fragment.ArtistFragment; import com.example.administrator.musicplayer.fragment.GenreFragment; import com.example.administrator.musicplayer.fragment.SongFragment; import java.util.ArrayList; import java.util.List; public class MainActivity extends BaseActivity implements NavigationView.OnNavigationItemSelectedListener, AlbumFragment.AlbumInteractionListener, ArtistFragment.ArtistInteractionListener, GenreFragment.GenreInteractionListener, SongFragment.SongInteractionListener{ private DrawerLayout drawerLayout; private Toolbar toolbar; private TabLayout tabLayout; private ViewPager tabPager; private FloatingActionButton fab; private NavigationView navView; AlbumFragment albumFragment; ArtistFragment artistFragment; GenreFragment genreFragment; SongFragment songFragment; @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) @Override protected void init(){ setContentView(R.layout.activity_main); getWindow().setStatusBarColor(getResources().getColor(R.color.basic_background)); load(); initView(); setToolbar(); setListener(); setActionBarToggle(); setTabLayout(); setTabPager(); } private void initView() { drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); toolbar = (Toolbar) findViewById(R.id.toolbar); tabLayout = (TabLayout) findViewById(R.id.tabLayout); tabPager = (ViewPager) findViewById(R.id.tabPager); fab = (FloatingActionButton) findViewById(R.id.fab); navView = (NavigationView) findViewById(R.id.nav_view); } /** * 툴바 */ private void setToolbar(){ setSupportActionBar(toolbar); toolbar.setTitle(getString(R.string.toolbar_title)); } /** * 리스너 */ private void setListener(){ navView.setNavigationItemSelectedListener(this); } /** * 액션바 토글버튼 설정 */ private void setActionBarToggle(){ ActionBarDrawerToggle toggle = new ActionBarDrawerToggle( this, drawerLayout, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close); drawerLayout.setDrawerListener(toggle); toggle.syncState(); } /** * 탭바 설정 */ private void setTabLayout(){ tabLayout.addTab(tabLayout.newTab().setText(getString(R.string.tab_songs))); tabLayout.addTab(tabLayout.newTab().setText(getString(R.string.tab_album))); tabLayout.addTab(tabLayout.newTab().setText(getString(R.string.tab_artist))); tabLayout.addTab(tabLayout.newTab().setText(getString(R.string.tab_genre))); } /** * 뷰페이저 설정 */ private void setTabPager(){ List<Fragment> fragmentList = new ArrayList<>(); albumFragment = new AlbumFragment(); artistFragment = new ArtistFragment(); genreFragment = new GenreFragment(); songFragment = new SongFragment(); fragmentList.add(songFragment); fragmentList.add(albumFragment); fragmentList.add(artistFragment); fragmentList.add(genreFragment); ListPagerAdapter pagerAdapter = new ListPagerAdapter(getSupportFragmentManager(), fragmentList); tabPager.setAdapter(pagerAdapter); tabLayout.addOnTabSelectedListener(new TabLayout.ViewPagerOnTabSelectedListener(tabPager)); tabPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout)); } /** * 음악 데이터 가져오기 */ private void load(){ SongLab.getInstance().load(this); } @Override public void onBackPressed() { DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); if (drawer.isDrawerOpen(GravityCompat.START)) { drawer.closeDrawer(GravityCompat.START); } else { super.onBackPressed(); } } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } @SuppressWarnings("StatementWithEmptyBody") @Override public boolean onNavigationItemSelected(MenuItem item) { int id = item.getItemId(); if (id == R.id.nav_camera) { } else if (id == R.id.nav_gallery) { } else if (id == R.id.nav_slideshow) { } else if (id == R.id.nav_manage) { } else if (id == R.id.nav_share) { } else if (id == R.id.nav_send) { } DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); drawer.closeDrawer(GravityCompat.START); return true; } @Override public void onAlbumInteraction() { } @Override public void onSongInteraction() { } @Override public void onGenreInteraction(Uri uri) { } @Override public void onArtistInteraction(Uri uri) { } }
[ "qskeksq@gmail.com" ]
qskeksq@gmail.com
c813ab206e385f055be8299914c007dc82221021
46167791cbfeebc8d3ddc97112764d7947fffa22
/spring-boot/src/main/java/com/justexample/repository/Entity1476Repository.java
662305de4a172c08c72932378870eeb81898b14e
[]
no_license
kahlai/unrealistictest
4f668b4822a25b4c1f06c6b543a26506bb1f8870
fe30034b05f5aacd0ef69523479ae721e234995c
refs/heads/master
2023-08-25T09:32:16.059555
2021-11-09T08:17:22
2021-11-09T08:17:22
425,726,016
0
0
null
null
null
null
UTF-8
Java
false
false
252
java
package com.justexample.repository; import java.util.List; import com.justexample.entity.Entity1476; import org.springframework.data.jpa.repository.JpaRepository; public interface Entity1476Repository extends JpaRepository<Entity1476,Long>{ }
[ "laikahhoe@gmail.com" ]
laikahhoe@gmail.com
435678a388d531ebe6783cc1649cba89414772ec
f3698795f174340106c66885bb57ac72134c58c8
/resource/idatrix-resource-web/src/main/java/com/idatrix/resource/portal/dao/PortalResourceDAO.java
a9cb1aa79ce8590b4106f261fd4d69a8118732b9
[]
no_license
ahandful/CloudETL
6e5c195953a944cdc62702b100bd7bcd629b4aee
bb4be62e8117082cd656741ecae33e4262ad3fb5
refs/heads/master
2020-09-13T01:33:43.749781
2019-04-18T02:12:08
2019-04-18T02:13:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,852
java
package com.idatrix.resource.portal.dao; import com.idatrix.resource.portal.vo.*; import org.apache.ibatis.annotations.Param; import java.util.List; /** * 门户目录资源处理接口 */ public interface PortalResourceDAO { List<DeptResourceStatisticsVO> getResourceStatisticsInfo(@Param("rentId")Long rentId, @Param("type")String type, @Param("libType")String libType); /*根据租户ID获取count个最新数据*/ List<ResourcePubInfo> getLastestResourceByCount(@Param("rentId")Long rentId, @Param("count")Long count); /*获取资源统计情况,由于失效要求较高,所以直接从rc_resource表获取*/ PubCount getPubTotalCount(@Param("rentId") Long rentId); /*获取部门资源目录提供情况*/ List<DeptResourceStatisticsVO> getDeptSupplyResource(@Param("rentId")Long rentId, @Param("num")Long num); /*获取部门资源数据提供情况*/ List<DeptResourceStatisticsVO> getDeptSupplyData(@Param("rentId")Long rentId, @Param("num")Long num); /*获取部门资源使用情况*/ List<DeptResourceStatisticsVO> getDeptUseResource(@Param("rentId")Long rentId, @Param("type")String type, @Param("num")Long num); /*根据租户获取共享类型分类统计*/ ShareTypeStatisticsVO getShareStatistics(@Param("rentId") Long rentId); /*根据租户获取浏览总数*/ Long getTotalVisitByRentID(@Param("rentId") Long rentId); /*资源录入情况统计*/ TypeInStatisticsVO getTypeInStatisticsByRentId(@Param("rentId")Long rentId); /*统计资源上报数据情况*/ ResourceUseStatisticsVO getResourceUseStatisticsByRentId(@Param("rentId")Long rentId); }
[ "xionghan@gdbigdata.com" ]
xionghan@gdbigdata.com
631caf0c0e91fbcbb6b146d076879537aa1eb0fa
5069306d54659a6cb8328ed0c648a53de8c9c4c9
/src/Java/Problem79gay.java
5deb4c6c8bc8aa38b975b51ea4adb835ffedefef
[]
no_license
kadamowi/project-euler-1
2a6110d154c4790149ab75dce16e1cba57288134
4107b231a64f0bbdc9a11ce76ab5a034746e5d2e
refs/heads/master
2020-03-11T07:59:22.128708
2016-04-19T22:56:16
2016-04-19T22:56:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
926
java
package Java; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.util.HashMap; public class Problem79gay { public static void main(String[] args) throws IOException{ BufferedReader in = new BufferedReader(new FileReader("C:/Python27/Problem79.txt")); HashMap foran = new HashMap(); HashMap bak = new HashMap(); String[] string = new String[50]; //73162890 char test = '9'; for (int i = 0; i < string.length; i++) { string[i] = in.readLine(); if (string[i].contains(""+test)) { boolean fpr=true; for (int j = 0; j < 3; j++) { if (string[i].charAt(j) == test) { fpr = false; continue; } if (fpr) { foran.put(string[i].charAt(j), fpr); } else bak.put(string[i].charAt(j), fpr); } } } System.out.println(foran + " "+test + " " + bak); } }
[ "magnus.solheim@gmail.com" ]
magnus.solheim@gmail.com
b075ed1b06204043085dd5d1acb3ccaaebecc612
1e7be9ba84f286efa308fbf12ffb1d035f578f40
/src/main/java/io/github/jhipster/application/config/AsyncConfiguration.java
0f48095b51be3cdd3caecb70d3e63cddab90d94a
[]
no_license
cthiaw/testMairie
deb74d3df4a2374aa8ec86791022ee5f86f352d9
5f17fe6f5f805a8667d892c1ee1e46c20a608a71
refs/heads/master
2020-03-15T11:26:09.432314
2018-05-04T09:42:36
2018-05-04T09:42:36
132,120,863
0
0
null
null
null
null
UTF-8
Java
false
false
1,793
java
package io.github.jhipster.application.config; import io.github.jhipster.async.ExceptionHandlingAsyncTaskExecutor; import io.github.jhipster.config.JHipsterProperties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler; import org.springframework.aop.interceptor.SimpleAsyncUncaughtExceptionHandler; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.scheduling.annotation.*; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; import java.util.concurrent.Executor; @Configuration @EnableAsync @EnableScheduling public class AsyncConfiguration implements AsyncConfigurer { private final Logger log = LoggerFactory.getLogger(AsyncConfiguration.class); private final JHipsterProperties jHipsterProperties; public AsyncConfiguration(JHipsterProperties jHipsterProperties) { this.jHipsterProperties = jHipsterProperties; } @Override @Bean(name = "taskExecutor") public Executor getAsyncExecutor() { log.debug("Creating Async Task Executor"); ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); executor.setCorePoolSize(jHipsterProperties.getAsync().getCorePoolSize()); executor.setMaxPoolSize(jHipsterProperties.getAsync().getMaxPoolSize()); executor.setQueueCapacity(jHipsterProperties.getAsync().getQueueCapacity()); executor.setThreadNamePrefix("test-mairie-Executor-"); return new ExceptionHandlingAsyncTaskExecutor(executor); } @Override public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() { return new SimpleAsyncUncaughtExceptionHandler(); } }
[ "jhipster-bot@users.noreply.github.com" ]
jhipster-bot@users.noreply.github.com
7514761659e4f5ecbb14945df275ab5c26f63c2f
6a7c4e586ea998ac3f037df4f37e3176e77febb2
/src/com/sanguine/bean/clsOpeningStkBean.java
ce87ad206df563db85180d65396e4557dc0442d8
[]
no_license
puneteamsangsoftwares/SanguineERP
ef635a953b7f2ad24e7c53d28472f9b09ccce1cb
9c603a4591d165e6975931f53847aa4a97a0a504
refs/heads/master
2022-12-25T05:02:27.601147
2021-01-12T13:18:11
2021-01-12T13:18:11
215,270,060
0
1
null
2019-10-15T10:54:03
2019-10-15T10:22:47
Java
UTF-8
Java
false
false
1,224
java
package com.sanguine.bean; import java.util.List; import org.hibernate.validator.constraints.NotEmpty; import com.sanguine.model.clsOpeningStkDtl; public class clsOpeningStkBean { @NotEmpty private String strLocCode; private String strOpStkCode; private String dtExpDate; private String strConversionUOM; private List<clsOpeningStkDtl> listOpStkDtl; public String getStrOpStkCode() { return strOpStkCode; } public void setStrOpStkCode(String strOpStkCode) { this.strOpStkCode = strOpStkCode; } public String getStrLocCode() { return strLocCode; } public void setStrLocCode(String strLocCode) { this.strLocCode = strLocCode; } public String getDtExpDate() { return dtExpDate; } public void setDtExpDate(String dtExpDate) { this.dtExpDate = dtExpDate; } public List<clsOpeningStkDtl> getListOpStkDtl() { return listOpStkDtl; } public void setListOpStkDtl(List<clsOpeningStkDtl> listOpStkDtl) { this.listOpStkDtl = listOpStkDtl; } public String getStrConversionUOM() { return strConversionUOM; } public void setStrConversionUOM(String strConversionUOM) { this.strConversionUOM = strConversionUOM; } }
[ "vinayakborwal95@gmail.com" ]
vinayakborwal95@gmail.com
11e7885dc0f8044c92fbd7b1feab72ffcc6c7387
61a2f9ea62cddf7b3aa0b9b25b75b78ef8b5a783
/shield-config-client/src/main/java/com/hispeed/development/runner/InitConfigBean.java
c0ce575f105337801f704b0f55eec64807588ef2
[ "Apache-2.0" ]
permissive
janck13/shield-conf
3034a2acbb36cc4bc76c2d7d936feefea846c783
a492a4b91e95746ddc2efbce6c79b86d5622667f
refs/heads/master
2020-05-22T11:15:36.077609
2018-05-30T09:05:42
2018-05-30T09:05:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,354
java
package com.hispeed.development.runner; import com.alibaba.dubbo.config.annotation.Reference; import com.hispeed.development.cache.ConfigMap; import com.hispeed.development.config.IConfigService; import com.hispeed.development.domain.config.SysConfig; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import java.util.List; /** * @author wuwl@19pay.com.cn * @date 2018-4-3 * @desc 初始化全量配置文件 */ @Component public class InitConfigBean { private static final Logger LOGGER = LoggerFactory.getLogger(InitConfigBean.class); @Reference(version = "1.0.0") IConfigService configService; @Value("${spring.application.name}") String applicationName; @Autowired ConfigMap configMap; public void initConfigFetchAll() { List<SysConfig> sysConfigs = configService.fetchAll(applicationName); LOGGER.debug("获取到应用{}的全量配置为:{}", applicationName, sysConfigs.toString()); for (SysConfig sysConfig : sysConfigs) { configMap.set(sysConfig.getConfigKey(), sysConfig); } LOGGER.debug("初始化加载全量配置完成,应用名--{}", applicationName); } }
[ "1210812591@qq.com" ]
1210812591@qq.com
e71372ada1d528c0acb01f88f3fe3fcfb42097a9
15af68ff32e36fce93286f45cc88c4d34ca62ad9
/framework-tutorial-poi/src/test/java/com/geekerstar/poi/PoiTest02.java
871e46723f1af6fe6227ec8ca4e1f07bfc11459c
[]
no_license
goldtoad6/framework-tutorial
d0c44d98b9fe57f46f79dff9344c71e8cdc8fa72
060de3bdabc8793ed0fdf3792d8f26d0a331a29c
refs/heads/master
2022-08-31T13:23:32.936808
2022-02-23T14:22:47
2022-02-23T14:22:47
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,046
java
package com.geekerstar.poi; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import java.io.FileOutputStream; /** * 创建单元格写入内容 */ public class PoiTest02 { public static void main(String[] args) throws Exception { //创建工作簿 HSSFWorkbook -- 2003 Workbook wb = new XSSFWorkbook(); //2007版本 //创建表单sheet Sheet sheet = wb.createSheet("test"); //创建行对象 参数:索引(从0开始) Row row = sheet.createRow(2); //创建单元格对象 参数:索引(从0开始) Cell cell = row.createCell(2); //向单元格中写入内容 cell.setCellValue("Geekerstar"); //文件流 FileOutputStream pis = new FileOutputStream("E:\\excel\\poi\\test1.xlsx"); //写入文件 wb.write(pis); pis.close(); } }
[ "247507792@qq.com" ]
247507792@qq.com
7fb4839ebaa8526719c363df2222e529102fe544
9c4dd2c2e5255ac9a355aec335fbc914ee1e39c2
/Testing/Junit5/src/test/java/by/pva/testing/testExamples/dependencyInjectionForConstructorsAndMethod/autoRegistered/TestTestInfoParameterResolver.java
110d4de33fb978335baf1719e76baea901acba82
[]
no_license
VAPortyanko/Learning
a8a79bc10b2eeb12c81f10198a0923e72d8002d4
23664bfe45eb12f717e3585eb7f84b729fa6397c
refs/heads/master
2022-07-16T10:45:39.259839
2021-11-28T17:56:17
2021-11-28T17:56:17
88,914,568
0
0
null
null
null
null
UTF-8
Java
false
false
1,066
java
package by.pva.testing.testExamples.dependencyInjectionForConstructorsAndMethod.autoRegistered; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInfo; @DisplayName("TestInfo Demo") public class TestTestInfoParameterResolver { TestTestInfoParameterResolver(TestInfo testInfo) { assertEquals("TestInfo Demo", testInfo.getDisplayName()); } @BeforeEach void init(TestInfo testInfo) { String displayName = testInfo.getDisplayName(); assertTrue(displayName.equals("TEST 1") || displayName.equals("test2()")); } @Test @DisplayName("TEST 1") @Tag("my-tag") void test1(TestInfo testInfo) { assertEquals("TEST 1", testInfo.getDisplayName()); assertTrue(testInfo.getTags().contains("my-tag")); } @Test void test2() { } }
[ "PortyankoWork@gmail.com" ]
PortyankoWork@gmail.com
93be330ed18edae4c279c46cef01e66edd33b994
cc0b13dbf22524e20877fc550892ab11fe040f07
/app/src/main/java/com/iqianbang/fanpai/view/NoDoubleClickListener.java
3fe7ed7077562fad272c5a893b40e119a7858da7
[]
no_license
martinwen/new_branch_zhaizhuan
9b311aed460f573b4276f473560b36258de0759d
d54ccd23cca7ef371e12886389e7c9c1078485d4
refs/heads/master
2020-04-26T15:59:49.693169
2019-03-04T03:32:06
2019-03-04T03:32:06
173,664,337
0
0
null
null
null
null
UTF-8
Java
false
false
799
java
package com.iqianbang.fanpai.view; import android.view.View; import java.util.Calendar; /** * 神仙有财 * 功能描述: 防止重复点击的监听 * 作 者: 李晓楠 * 时 间: 2016/12/9 15:46 */ public abstract class NoDoubleClickListener implements View.OnClickListener { private static final int MIN_CLICK_DELAY_TIME = 500;//防止重复的间隔 private long lastClickTime = 0; @Override public void onClick(View v) { long currentTime = Calendar.getInstance().getTimeInMillis(); if (currentTime - lastClickTime > MIN_CLICK_DELAY_TIME) { lastClickTime = currentTime; onNoDoubleClick(v); } } /** * 按钮点击事件 * @param v */ public void onNoDoubleClick(View v){ } }
[ "997750993@qq.com" ]
997750993@qq.com
58145bea919346538dd98424a3ad7200c398f8a5
995f73d30450a6dce6bc7145d89344b4ad6e0622
/Honor5C-7.0/src/main/java/java/util/Comparator.java
9a6f2d028af66c33da199033ca87efd5824ba826
[]
no_license
morningblu/HWFramework
0ceb02cbe42585d0169d9b6c4964a41b436039f5
672bb34094b8780806a10ba9b1d21036fd808b8e
refs/heads/master
2023-07-29T05:26:14.603817
2021-09-03T05:23:34
2021-09-03T05:23:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,664
java
package java.util; import java.io.Serializable; import java.util.function.Function; import java.util.function.ToDoubleFunction; import java.util.function.ToIntFunction; import java.util.function.ToLongFunction; @FunctionalInterface public interface Comparator<T> { final /* synthetic */ class -java_util_Comparator_comparingDouble_java_util_function_ToDoubleFunction_keyExtractor_LambdaImpl0 implements Comparator, Serializable { private /* synthetic */ ToDoubleFunction val$keyExtractor; public /* synthetic */ -java_util_Comparator_comparingDouble_java_util_function_ToDoubleFunction_keyExtractor_LambdaImpl0(ToDoubleFunction toDoubleFunction) { this.val$keyExtractor = toDoubleFunction; } public int compare(Object arg0, Object arg1) { return Double.compare(this.val$keyExtractor.applyAsDouble(arg0), this.val$keyExtractor.applyAsDouble(arg1)); } } final /* synthetic */ class -java_util_Comparator_comparingInt_java_util_function_ToIntFunction_keyExtractor_LambdaImpl0 implements Comparator, Serializable { private /* synthetic */ ToIntFunction val$keyExtractor; public /* synthetic */ -java_util_Comparator_comparingInt_java_util_function_ToIntFunction_keyExtractor_LambdaImpl0(ToIntFunction toIntFunction) { this.val$keyExtractor = toIntFunction; } public int compare(Object arg0, Object arg1) { return Integer.compare(this.val$keyExtractor.applyAsInt(arg0), this.val$keyExtractor.applyAsInt(arg1)); } } final /* synthetic */ class -java_util_Comparator_comparingLong_java_util_function_ToLongFunction_keyExtractor_LambdaImpl0 implements Comparator, Serializable { private /* synthetic */ ToLongFunction val$keyExtractor; public /* synthetic */ -java_util_Comparator_comparingLong_java_util_function_ToLongFunction_keyExtractor_LambdaImpl0(ToLongFunction toLongFunction) { this.val$keyExtractor = toLongFunction; } public int compare(Object arg0, Object arg1) { return Long.compare(this.val$keyExtractor.applyAsLong(arg0), this.val$keyExtractor.applyAsLong(arg1)); } } final /* synthetic */ class -java_util_Comparator_comparing_java_util_function_Function_keyExtractor_LambdaImpl0 implements Comparator, Serializable { private /* synthetic */ Function val$keyExtractor; public /* synthetic */ -java_util_Comparator_comparing_java_util_function_Function_keyExtractor_LambdaImpl0(Function function) { this.val$keyExtractor = function; } public int compare(Object arg0, Object arg1) { return ((Comparable) this.val$keyExtractor.apply(arg0)).compareTo(this.val$keyExtractor.apply(arg1)); } } final /* synthetic */ class -java_util_Comparator_comparing_java_util_function_Function_keyExtractor_java_util_Comparator_keyComparator_LambdaImpl0 implements Comparator, Serializable { private /* synthetic */ Comparator val$keyComparator; private /* synthetic */ Function val$keyExtractor; public /* synthetic */ -java_util_Comparator_comparing_java_util_function_Function_keyExtractor_java_util_Comparator_keyComparator_LambdaImpl0(Comparator comparator, Function function) { this.val$keyComparator = comparator; this.val$keyExtractor = function; } public int compare(Object arg0, Object arg1) { return this.val$keyComparator.compare(this.val$keyExtractor.apply(arg0), this.val$keyExtractor.apply(arg1)); } } final /* synthetic */ class -java_util_Comparator_thenComparing_java_util_Comparator_other_LambdaImpl0 implements Comparator, Serializable { private /* synthetic */ Comparator val$other; private /* synthetic */ Comparator val$this; public /* synthetic */ -java_util_Comparator_thenComparing_java_util_Comparator_other_LambdaImpl0(Comparator comparator, Comparator comparator2) { this.val$this = comparator; this.val$other = comparator2; } public int compare(Object arg0, Object arg1) { return this.val$this.-java_util_Comparator_lambda$1(this.val$other, arg0, arg1); } } int compare(T t, T t2); boolean equals(Object obj); Comparator<T> reversed() { return Collections.reverseOrder(this); } Comparator<T> thenComparing(Comparator<? super T> other) { Objects.requireNonNull(other); return new -java_util_Comparator_thenComparing_java_util_Comparator_other_LambdaImpl0(this, other); } /* synthetic */ int -java_util_Comparator_lambda$1(Comparator other, Object c1, Object c2) { int res = compare(c1, c2); return res != 0 ? res : other.compare(c1, c2); } <U> Comparator<T> thenComparing(Function<? super T, ? extends U> keyExtractor, Comparator<? super U> keyComparator) { return thenComparing(comparing(keyExtractor, keyComparator)); } <U extends Comparable<? super U>> Comparator<T> thenComparing(Function<? super T, ? extends U> keyExtractor) { return thenComparing(comparing(keyExtractor)); } Comparator<T> thenComparingInt(ToIntFunction<? super T> keyExtractor) { return thenComparing(comparingInt(keyExtractor)); } Comparator<T> thenComparingLong(ToLongFunction<? super T> keyExtractor) { return thenComparing(comparingLong(keyExtractor)); } Comparator<T> thenComparingDouble(ToDoubleFunction<? super T> keyExtractor) { return thenComparing(comparingDouble(keyExtractor)); } static <T extends Comparable<? super T>> Comparator<T> reverseOrder() { return Collections.reverseOrder(); } static <T extends Comparable<? super T>> Comparator<T> naturalOrder() { return NaturalOrderComparator.INSTANCE; } static <T> Comparator<T> nullsFirst(Comparator<? super T> comparator) { return new NullComparator(true, comparator); } static <T> Comparator<T> nullsLast(Comparator<? super T> comparator) { return new NullComparator(false, comparator); } static <T, U> Comparator<T> comparing(Function<? super T, ? extends U> keyExtractor, Comparator<? super U> keyComparator) { Objects.requireNonNull(keyExtractor); Objects.requireNonNull(keyComparator); return new -java_util_Comparator_comparing_java_util_function_Function_keyExtractor_java_util_Comparator_keyComparator_LambdaImpl0(keyComparator, keyExtractor); } static <T, U extends Comparable<? super U>> Comparator<T> comparing(Function<? super T, ? extends U> keyExtractor) { Objects.requireNonNull(keyExtractor); return new -java_util_Comparator_comparing_java_util_function_Function_keyExtractor_LambdaImpl0(keyExtractor); } static <T> Comparator<T> comparingInt(ToIntFunction<? super T> keyExtractor) { Objects.requireNonNull(keyExtractor); return new -java_util_Comparator_comparingInt_java_util_function_ToIntFunction_keyExtractor_LambdaImpl0(keyExtractor); } static <T> Comparator<T> comparingLong(ToLongFunction<? super T> keyExtractor) { Objects.requireNonNull(keyExtractor); return new -java_util_Comparator_comparingLong_java_util_function_ToLongFunction_keyExtractor_LambdaImpl0(keyExtractor); } static <T> Comparator<T> comparingDouble(ToDoubleFunction<? super T> keyExtractor) { Objects.requireNonNull(keyExtractor); return new -java_util_Comparator_comparingDouble_java_util_function_ToDoubleFunction_keyExtractor_LambdaImpl0(keyExtractor); } }
[ "dstmath@163.com" ]
dstmath@163.com
b1e80f77d08ec56fa5613d5cc091e424f3aeef1a
86aa17cb433a49bc3e4bd784afd5b1de166f319b
/core-java-nio2/ObjectStreamInvoiceWriter.java
ef436edeea412a196db049fa88406f8f4cf2003d
[]
no_license
SatyaRaghuNandan/core-java
c3cd14175a9b9d5fdd68ba2dc17cdd5781fdf4b0
a780ee1eb26330437dd264e392a7305295a03d80
refs/heads/master
2021-06-09T16:40:32.944456
2016-12-30T15:13:49
2016-12-30T15:13:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,092
java
import java.math.BigDecimal; import java.io.BufferedOutputStream; import java.io.FileOutputStream; import java.io.ObjectOutputStream; import java.io.IOException; public class ObjectStreamInvoiceWriter { static final String dataFile = "/tmp/obj_invoicedata.dat"; static final BigDecimal[] prices = { new BigDecimal("19.99"), new BigDecimal("9.99"), new BigDecimal("15.99"), new BigDecimal("3.99"), new BigDecimal("4.99") }; static final int[] units = { 12, 8, 13, 29, 50 }; static final String[] descs = { "Java T-shirt", "Java Mug", "Duke Juggling Dolls", "Java Pin", "Java Key Chain" }; public static void main(String []args) { try (ObjectOutputStream oos = new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream(dataFile)))) { for(int i = 0;i < prices.length; i++) { oos.writeInt(units[i]); oos.writeObject(prices[i]); oos.writeUTF(descs[i]); } System.out.println("Invoice saved"); } catch(IOException e) { e.printStackTrace(); } } }
[ "srirambtecit@gmail.com" ]
srirambtecit@gmail.com
2217f9cb0a2e15f7ab42c347e73d809f7d170e84
b69a092c775780b725c90e1699c12f6d4ddc3f3b
/datarouter-storage/src/main/java/io/datarouter/storage/node/adapter/counter/CounterAdapter.java
74a242051e0eab8047d80f9cfffd15ce8db8a715
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
hoolatech/datarouter
a035e84e9dd5d79a5515f1015b10366a469fcb48
2ecc7e803895fbe8c5acffe875d4ddec24e7d14c
refs/heads/master
2020-04-12T00:08:08.762832
2018-12-13T00:39:58
2018-12-13T00:39:58
128,131,618
0
0
Apache-2.0
2018-12-17T21:02:20
2018-04-04T22:52:13
Java
UTF-8
Java
false
false
1,173
java
/** * Copyright © 2009 HotPads (admin@hotpads.com) * * 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 io.datarouter.storage.node.adapter.counter; import io.datarouter.model.databean.Databean; import io.datarouter.model.key.primary.PrimaryKey; import io.datarouter.model.serialize.fielder.DatabeanFielder; import io.datarouter.storage.node.Node; import io.datarouter.storage.node.adapter.counter.formatter.NodeCounterFormatter; public interface CounterAdapter< PK extends PrimaryKey<PK>, D extends Databean<PK,D>, F extends DatabeanFielder<PK,D>, N extends Node<PK,D,F>>{ NodeCounterFormatter<PK,D,F,N> getCounter(); N getBackingNode(); }
[ "cbonsart@hotpads.com" ]
cbonsart@hotpads.com
6a483541b4e7d8c48d91045cd7b98f4db52f2f1e
ff2e69ff97126cff6a64a30dc613b3e7df672a9b
/jdbc_backup/src/vo/BookVO.java
79a05da84b5ae1287638c5d408c9e951e9789506
[]
no_license
aydma/bit_java
42b3ccf80ce485755a65d9adedb3a2ae2eff2755
d584ee086eb77dfa23e3b0b9c3db6500d6230e63
refs/heads/master
2020-07-03T10:56:11.000576
2019-09-20T08:44:34
2019-09-20T08:44:34
201,861,779
0
0
null
null
null
null
UTF-8
Java
false
false
1,774
java
package vo; public class BookVO { int bookid; // NUMBER(2) PRIMARY KEY String bookname; // VARCHAR2(40) String publisher; // VARCHAR2(40) int price; // NUMBER(8) public BookVO() {} public BookVO(int bookid, String bookname, String publisher, int price) { super(); this.bookid = bookid; this.bookname = bookname; this.publisher = publisher; this.price = price; } public int getBookid() { return bookid; } public void setBookid(int bookid) { this.bookid = bookid; } public String getBookname() { return bookname; } public void setBookname(String bookname) { this.bookname = bookname; } public String getPublisher() { return publisher; } public void setPublisher(String publisher) { this.publisher = publisher; } public int getPrice() { return price; } public void setPrice(int price) { this.price = price; } @Override public String toString() { return "BookVO [bookid=" + bookid + ", bookname=" + bookname + ", publisher=" + publisher + ", price=" + price + "]"; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + bookid; result = prime * result + ((bookname == null) ? 0 : bookname.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; BookVO other = (BookVO) obj; if (bookid != other.bookid) return false; if (bookname == null) { if (other.bookname != null) return false; } else if (!bookname.equals(other.bookname)) return false; return true; } }
[ "user@DESKTOP-V882PTR" ]
user@DESKTOP-V882PTR
c5bdcf93a47beb2d673ca04c2e6100b77da3d02e
77294d9e3c4817f2c2fc196757956f168b59a22f
/rest/petstore-gradle-multiple/server/src/test/java/com/networknt/petstore/handler/PetsPetIdDeleteHandlerTest.java
8f1c32520fef8e9aa5344b4f0b62b2918762eb19
[ "Apache-2.0" ]
permissive
GracefulAncestralCode/light-example-4j
d6343cac3da38728dbe8dfd496b15367fa2ca348
3ece2ad86bb18b7d0c899d36b9fbbf22fd566eb9
refs/heads/master
2023-05-14T16:12:01.714648
2021-05-26T03:27:42
2021-05-26T03:27:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,144
java
package com.networknt.petstore.handler; import com.networknt.client.Http2Client; import com.networknt.exception.ClientException; import com.networknt.openapi.ResponseValidator; import com.networknt.schema.SchemaValidatorsConfig; import com.networknt.status.Status; import com.networknt.utility.StringUtils; import io.undertow.UndertowOptions; import io.undertow.client.ClientConnection; import io.undertow.client.ClientRequest; import io.undertow.client.ClientResponse; import io.undertow.util.HeaderValues; import io.undertow.util.HttpString; import io.undertow.util.Headers; import io.undertow.util.Methods; import org.junit.Assert; import org.junit.ClassRule; import org.junit.Test; import org.junit.Ignore; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.xnio.IoUtils; import org.xnio.OptionMap; import java.net.URI; import java.util.Optional; import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicReference; @Ignore public class PetsPetIdDeleteHandlerTest { @ClassRule public static TestServer server = TestServer.getInstance(); static final Logger logger = LoggerFactory.getLogger(PetsPetIdDeleteHandlerTest.class); static final boolean enableHttp2 = server.getServerConfig().isEnableHttp2(); static final boolean enableHttps = server.getServerConfig().isEnableHttps(); static final int httpPort = server.getServerConfig().getHttpPort(); static final int httpsPort = server.getServerConfig().getHttpsPort(); static final String url = enableHttp2 || enableHttps ? "https://localhost:" + httpsPort : "http://localhost:" + httpPort; static final String JSON_MEDIA_TYPE = "application/json"; @Test public void testPetsPetIdDeleteHandlerTest() throws ClientException { final Http2Client client = Http2Client.getInstance(); final CountDownLatch latch = new CountDownLatch(1); final ClientConnection connection; try { if(enableHttps) { connection = client.connect(new URI(url), Http2Client.WORKER, Http2Client.SSL, Http2Client.BUFFER_POOL, enableHttp2 ? OptionMap.create(UndertowOptions.ENABLE_HTTP2, true): OptionMap.EMPTY).get(); } else { connection = client.connect(new URI(url), Http2Client.WORKER, Http2Client.BUFFER_POOL, OptionMap.EMPTY).get(); } } catch (Exception e) { throw new ClientException(e); } final AtomicReference<ClientResponse> reference = new AtomicReference<>(); String requestUri = "/v1/pets/FLLFxDuusPqSQHKyDRheqgKdel"; String httpMethod = "delete"; try { ClientRequest request = new ClientRequest().setPath(requestUri).setMethod(Methods.DELETE); //customized header parameters request.getRequestHeaders().put(new HttpString("key"), "XvuFvfOvSULICd"); request.getRequestHeaders().put(new HttpString("host"), "localhost"); connection.sendRequest(request, client.createClientCallback(reference, latch)); latch.await(); } catch (Exception e) { logger.error("Exception: ", e); throw new ClientException(e); } finally { IoUtils.safeClose(connection); } String body = reference.get().getAttachment(Http2Client.RESPONSE_BODY); Optional<HeaderValues> contentTypeName = Optional.ofNullable(reference.get().getResponseHeaders().get(Headers.CONTENT_TYPE)); SchemaValidatorsConfig config = new SchemaValidatorsConfig(); ResponseValidator responseValidator = new ResponseValidator(config); int statusCode = reference.get().getResponseCode(); Status status; if(contentTypeName.isPresent()) { status = responseValidator.validateResponseContent(body, requestUri, httpMethod, String.valueOf(statusCode), contentTypeName.get().getFirst()); } else { status = responseValidator.validateResponseContent(body, requestUri, httpMethod, String.valueOf(statusCode), JSON_MEDIA_TYPE); } Assert.assertNull(status); } }
[ "stevehu@gmail.com" ]
stevehu@gmail.com
56f20b77b1b6ba64b9fb450790d3451506873483
a47f5306c4795d85bf7100e646b26b614c32ea71
/sphairas-libs/services/src/org/thespheres/betula/services/LoginBean.java
3ba511afa361af3b7673344ff16885a6860036ce
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
permissive
sphairas/sphairas-desktop
65aaa0cd1955f541d3edcaf79442e645724e891b
f47c8d4ea62c1fc2876c0ffa44e5925bfaebc316
refs/heads/master
2023-01-21T12:02:04.146623
2020-10-22T18:26:52
2020-10-22T18:26:52
243,803,115
2
1
Apache-2.0
2022-12-06T00:34:25
2020-02-28T16:11:33
Java
UTF-8
Java
false
false
461
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 org.thespheres.betula.services; /** * * @author boris.heithecker */ public interface LoginBean { public static final long serialVersionUID = 1L; public String[] getGroups(String prefix, String suffix); public String[] getGroups(String ldapName); }
[ "boris.heithecker@gmx.net" ]
boris.heithecker@gmx.net
f11b628a29ca89bd8dbb25c78dc6b8302a826449
b01c782d2be663c71cbe196c365d7f305dee9945
/src/test/java/com/ted/service/MockUserDetailsService.java
b8daae042efb635d4d67a317470c722fb2e54c5c
[]
no_license
RalphSu/JavaSpring
65a0d39948863f5c9dd81cf842998e3708655191
abb2ed5e2437e53a46154d59385dd9fbc07c78ca
refs/heads/master
2021-01-21T09:23:43.448194
2014-03-31T08:42:08
2014-03-31T08:42:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
553
java
package com.ted.service; import com.ted.model.User; import org.springframework.dao.DataAccessException; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UsernameNotFoundException; public class MockUserDetailsService implements UserDetailsService { public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException, DataAccessException { return new User("testuser"); } }
[ "liasu@ebay.com" ]
liasu@ebay.com
d99bc05ea9b2c27b6c690f407669bb1d6b4197ae
d61eb73f504248f9244185739430d3ad244b0a6a
/src/test/java/es/rickyepoderi/wbxml/bind/wvcsp/GetGroupPropsResponse.java
bead27a6e3afa4d0ebb0d734f9dfbef8f249d8dd
[ "Apache-2.0" ]
permissive
Autom-liu/SMSGate
35531b1a285144e669a2fdf472535b99f261ab27
d0f2df1441734f39fbf39e973686e09201ac22f8
refs/heads/netty4
2020-11-25T12:50:32.257897
2020-08-26T12:57:16
2020-08-26T12:57:16
228,670,614
1
0
Apache-2.0
2020-08-26T12:57:18
2019-12-17T17:44:17
null
UTF-8
Java
false
false
2,111
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2012.08.25 at 05:48:09 PM CEST // package es.rickyepoderi.wbxml.bind.wvcsp; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; /** * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "groupProperties", "ownProperties" }) @XmlRootElement(name = "GetGroupProps-Response") public class GetGroupPropsResponse { @XmlElement(name = "GroupProperties", required = true) protected GroupProperties groupProperties; @XmlElement(name = "OwnProperties", required = true) protected OwnProperties ownProperties; /** * Gets the value of the groupProperties property. * * @return * possible object is * {@link GroupProperties } * */ public GroupProperties getGroupProperties() { return groupProperties; } /** * Sets the value of the groupProperties property. * * @param value * allowed object is * {@link GroupProperties } * */ public void setGroupProperties(GroupProperties value) { this.groupProperties = value; } /** * Gets the value of the ownProperties property. * * @return * possible object is * {@link OwnProperties } * */ public OwnProperties getOwnProperties() { return ownProperties; } /** * Sets the value of the ownProperties property. * * @param value * allowed object is * {@link OwnProperties } * */ public void setOwnProperties(OwnProperties value) { this.ownProperties = value; } }
[ "jameslover121@163.com" ]
jameslover121@163.com
9ce970ec9a2e94a9f68701ca599e1f6b4d547981
fa735f6201dcfc35b0a6a671b41f0e67ab03a257
/app/src/main/java/com/practice/firstaid/db/DBHelper.java
10a85982c02830c6c2cd041077860eb12283af36
[]
no_license
enotRishinn/FirstAid
bf6176a80e562c738d0c98483cb16c2a63529b15
91e2e27589371d888450f434ed3910076f8a7461
refs/heads/master
2020-11-28T11:31:28.907082
2020-01-14T03:48:42
2020-01-14T03:48:42
229,799,245
0
0
null
null
null
null
UTF-8
Java
false
false
612
java
package com.practice.firstaid.db; import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; public class DBHelper extends SQLiteOpenHelper { public DBHelper(Context context) { super(context, "findDB", null, 1); } @Override public void onCreate(SQLiteDatabase db) { db.execSQL("create table score (" + "id integer primary key autoincrement," + "my_score integer);"); } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { } }
[ "=" ]
=
885e69d721d5f26db1e0ed4b57ca16e71493de74
d74c2ca437a58670dc8bfbf20a3babaecb7d0bea
/SAP_858310_lines/Source - 963k/js.sqlmapper.lib/dev/src/_tc~bl~ejbsqlmapper/java/com/sap/ejb/ql/sqlmapper/common/wherenodeelement.java
1264d8550b06ef2ff3b2ee497ab4386884980199
[]
no_license
javafullstackstudens/JAVA_SAP
e848e9e1a101baa4596ff27ce1aedb90e8dfaae8
f1b826bd8a13d1432e3ddd4845ac752208df4f05
refs/heads/master
2023-06-05T20:00:48.946268
2021-06-30T10:07:39
2021-06-30T10:07:39
381,657,064
0
0
null
null
null
null
UTF-8
Java
false
false
3,032
java
package com.sap.ejb.ql.sqlmapper.common; import com.sap.sql.tree.SearchCondition; import java.util.HashMap; import java.util.ArrayList; import java.util.Iterator; import com.sap.sql.tree.TableAlias; /** * Describes a where node element with a <code>HashMap</code> * of table representations, a <code>HashMap</code> of join conditions, * a <code>ArrayList</code> of <code>TableAlias</code>es and a * <code>SearchCondition</code>. * </p><p> * Copyright (c) 2004 - 2006, SAP-AG * @author Rainer Schweigkoffer, Dirk Debertin * @version 1.r10 */ public class WhereNodeElement { // the map of the where node element's table representations private HashMap tableRepMap; // the map of the where node element's join conditions private HashMap joinConditionMap; // the array list of the where node element's table alias list private ArrayList aliasList; // the where node element's search condition private SearchCondition condition; /** * Creates a <code>WhereNodeElement</code> instance. */ WhereNodeElement( HashMap tableRepMap, HashMap joinConditionMap, ArrayList aliasList, SearchCondition condition) { this.tableRepMap = tableRepMap; this.joinConditionMap = joinConditionMap; this.aliasList = aliasList; this.condition = condition; } /** * Retrieves the table representations' map. */ HashMap getTableRepresentations() { return this.tableRepMap; } /** * Retrieves the join condition map. */ HashMap getJoinConditions() { return this.joinConditionMap; } /** * Retrieves the alias array list. */ ArrayList getAliases() { return this.aliasList; } /** * Retrieves the condition. */ SearchCondition getCondition() { return this.condition; } /** * Creates a string representation of a <code>WhereNodeElement</code> object. */ public String toString() { StringBuffer strBuf = new StringBuffer("{ tableReps = { "); if (this.tableRepMap != null) { Iterator iter = this.tableRepMap.keySet().iterator(); int i = 0; while (iter.hasNext()) { if (i != 0) { strBuf.append(", "); } strBuf.append(((String) iter.next()).toString()); i = 1; } } else { strBuf.append("null"); } strBuf.append(" }"); strBuf.append(", joinConditions = { "); if (this.joinConditionMap != null) { Iterator iter = this.joinConditionMap.keySet().iterator(); int i = 0; while (iter.hasNext()) { if (i != 0) { strBuf.append(", "); } strBuf.append(((String) iter.next()).toString()); i = 1; } } else { strBuf.append("null"); } strBuf.append(" }"); strBuf.append(", aliases = { "); if (this.aliasList != null) { for (int i = 0; i < aliasList.size(); i++) { if (i != 0) { strBuf.append(", "); } strBuf.append(((TableAlias) this.aliasList.get(i)).toString()); } } else { strBuf.append("null"); } strBuf.append(" }"); strBuf.append(", condition = {"); strBuf.append(this.condition.toString()); strBuf.append(" }"); return strBuf.toString(); } }
[ "Yalin.Arie@checkmarx.com" ]
Yalin.Arie@checkmarx.com
6e4c560c8e5654811790b68afff703634087a27c
2a02f4a689a5ddbe276234c43bb7851089b90658
/query/src/main/java/com/rebwon/query/projection/HolderAccountProjection.java
ad5643a6baa899bc680459dbf723d9f9ec82fbd4
[]
no_license
Rebwon/axon-example
6c87fcec9cb240a974aa2dceccdcd1136d4646b7
fe785b861a75d5174ad05e0f72f75a46d58104a0
refs/heads/master
2022-10-25T08:17:31.353628
2020-06-09T03:55:27
2020-06-09T03:55:27
269,873,877
0
0
null
null
null
null
UTF-8
Java
false
false
3,826
java
package com.rebwon.query.projection; import java.time.Instant; import java.util.NoSuchElementException; import org.axonframework.config.ProcessingGroup; import org.axonframework.eventhandling.AllowReplay; import org.axonframework.eventhandling.EventHandler; import org.axonframework.eventhandling.ResetHandler; import org.axonframework.eventhandling.Timestamp; import org.axonframework.queryhandling.QueryHandler; import org.axonframework.queryhandling.QueryUpdateEmitter; import org.springframework.retry.annotation.Backoff; import org.springframework.retry.annotation.EnableRetry; import org.springframework.retry.annotation.Retryable; import org.springframework.stereotype.Component; import com.rebwon.events.AccountCreationEvent; import com.rebwon.events.DepositMoneyEvent; import com.rebwon.events.HolderCreationEvent; import com.rebwon.events.WithdrawMoneyEvent; import com.rebwon.query.entity.HolderAccountSummary; import com.rebwon.query.query.AccountQuery; import com.rebwon.query.repository.AccountRepository; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; @Slf4j @Component @EnableRetry @AllArgsConstructor @ProcessingGroup("accounts") public class HolderAccountProjection { private final AccountRepository repository; private final QueryUpdateEmitter queryUpdateEmitter; @EventHandler @AllowReplay protected void on(HolderCreationEvent event, @Timestamp Instant instant) { log.debug("projecting {} , timestamp : {}", event, instant.toString()); HolderAccountSummary accountSummary = HolderAccountSummary.builder() .holderId(event.getHolderId()) .name(event.getHolderName()) .address(event.getAddrees()) .tel(event.getTel()) .totalBalance(0L) .accountCnt(0L) .build(); repository.save(accountSummary); } @EventHandler @AllowReplay @Retryable(value = {NoSuchElementException.class}, maxAttempts = 5, backoff = @Backoff(delay = 1000)) protected void on(AccountCreationEvent event, @Timestamp Instant instant){ log.debug("projecting {} , timestamp : {}", event, instant.toString()); HolderAccountSummary holderAccount = getHolderAccountSummary(event.getHolderId()); holderAccount.setAccountCnt(holderAccount.getAccountCnt()+1); repository.save(holderAccount); } @EventHandler @AllowReplay protected void on(DepositMoneyEvent event, @Timestamp Instant instant){ log.debug("projecting {} , timestamp : {}", event, instant.toString()); HolderAccountSummary holderAccount = getHolderAccountSummary(event.getHolderId()); holderAccount.setTotalBalance(holderAccount.getTotalBalance() + event.getAmount()); queryUpdateEmitter.emit(AccountQuery.class, query -> query.getHolderId().equals(event.getHolderId()), holderAccount); repository.save(holderAccount); } @EventHandler @AllowReplay protected void on(WithdrawMoneyEvent event, @Timestamp Instant instant){ log.debug("projecting {} , timestamp : {}", event, instant.toString()); HolderAccountSummary holderAccount = getHolderAccountSummary(event.getHolderID()); holderAccount.setTotalBalance(holderAccount.getTotalBalance() - event.getAmount()); queryUpdateEmitter.emit(AccountQuery.class, query -> query.getHolderId().equals(event.getHolderID()), holderAccount); repository.save(holderAccount); } private HolderAccountSummary getHolderAccountSummary(String holderId) { log.debug("getHolder : {} ", holderId); return repository.findByHolderId(holderId) .orElseThrow(() -> new NoSuchElementException("소유주가 존재하지 않습니다.")); } @ResetHandler private void resetHolderAccountInfo() { log.debug("reset triggered"); repository.deleteAll(); } @QueryHandler public HolderAccountSummary on(AccountQuery query) { log.debug("handling {}", query); return repository.findByHolderId(query.getHolderId()).orElse(null); } }
[ "msolo021015@naver.com" ]
msolo021015@naver.com
58b36587d3847c4314c2a2e029df066fcf793291
4536078b4070fc3143086ff48f088e2bc4b4c681
/v1.0.4/decompiled/com/microsoft/azure/sdk/iot/device/auth/SignatureProvider.java
7d26df3945fb134e4aaca333891047d2d3106037
[]
no_license
olealgoritme/smittestopp_src
485b81422752c3d1e7980fbc9301f4f0e0030d16
52080d5b7613cb9279bc6cda5b469a5c84e34f6a
refs/heads/master
2023-05-27T21:25:17.564334
2023-05-02T14:24:31
2023-05-02T14:24:31
262,846,147
0
0
null
null
null
null
UTF-8
Java
false
false
356
java
package com.microsoft.azure.sdk.iot.device.auth; public abstract interface SignatureProvider { public abstract String sign(String paramString1, String paramString2, String paramString3); } /* Location: * Qualified Name: base.com.microsoft.azure.sdk.iot.device.auth.SignatureProvider * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "olealgoritme@gmail.com" ]
olealgoritme@gmail.com
5c4dd8efbe79971689c6dc1a9d8a5e12d53073a9
301e0c8db773c7004ad7a0d02d12f9a182c03312
/src/us/kbase/auth2/lib/identity/IdentitySet.java
048dec74cbfa441be990dfbad0a02f1c4b70b10a
[ "MIT" ]
permissive
scanon/auth2proto
54b6d1212b502fe65cae908e294adc5c11ce3dcd
648ad45902e3b515e9edf3840c795cc4c4683e6a
refs/heads/master
2021-01-18T20:48:56.179028
2016-09-16T04:41:17
2016-09-16T04:41:17
68,332,222
0
0
null
2016-09-15T21:19:52
2016-09-15T21:19:51
null
UTF-8
Java
false
false
971
java
package us.kbase.auth2.lib.identity; import java.util.Collections; import java.util.HashSet; import java.util.Set; public class IdentitySet { //TODO TEST //TODO JAVADOC private final RemoteIdentity primary; private final Set<RemoteIdentity> secondaries; public IdentitySet( final RemoteIdentity primary, Set<RemoteIdentity> secondaries) { super(); //TODO NOW check for nulls this.primary = primary; if (secondaries == null) { secondaries = new HashSet<>(); } this.secondaries = Collections.unmodifiableSet(secondaries); } public RemoteIdentity getPrimary() { return primary; } public Set<RemoteIdentity> getSecondaries() { return secondaries; } @Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append("IdentitySet [primary="); builder.append(primary); builder.append(", secondaries="); builder.append(secondaries); builder.append("]"); return builder.toString(); } }
[ "gaprice@lbl.gov" ]
gaprice@lbl.gov
0aef5c30c318340aadedcdc9ac5884a60e16d0c3
63217a91d73674add57c6395f05ba891233b8c84
/dart/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/refactoring/ConvertMethodToGetterWizard_NEW.java
bd71c350dbb91cc91e89f7952ad202e853cd149c
[ "LicenseRef-scancode-unknown-license-reference", "BSD-3-Clause" ]
permissive
AurelienBallier/dart-sdk
f020f55388f50e475e51124e4b8005719e9f13e6
66931ab8372ef61e3ea421f094764d158f0a0669
refs/heads/master
2020-07-09T08:30:47.662771
2015-04-13T13:40:41
2015-04-13T13:40:41
33,870,380
1
0
null
null
null
null
UTF-8
Java
false
false
703
java
package com.google.dart.tools.ui.internal.refactoring; import com.google.dart.tools.ui.DartToolsPlugin; /** * @coverage dart.editor.ui.refactoring.ui */ public class ConvertMethodToGetterWizard_NEW extends ServerRefactoringWizard { static final String DIALOG_SETTING_SECTION = "ConvertMethodToGetterWizard"; //$NON-NLS-1$ public ConvertMethodToGetterWizard_NEW(ServerConvertMethodToGetterRefactoring ref) { super(ref, DIALOG_BASED_USER_INTERFACE); setDefaultPageTitle(RefactoringMessages.ConvertMethodToGetterWizard_page_title); setDialogSettings(DartToolsPlugin.getDefault().getDialogSettings()); } @Override protected void addUserInputPages() { // no input page } }
[ "aurelien.ballier@cyclonit.com" ]
aurelien.ballier@cyclonit.com
d79e3abdd714496d5db9da5dc3fd53753de9f6ee
aa1e6fb49207ef7d3d7cc00b688fdb28895c6956
/P15009900/src/main/java/com/erim/sz/common/bean/ManagementMaterialBean.java
9a4f22e4543f1915efbd37ca7d3af9a50b76b802
[]
no_license
zhanght86/erim
f76fec9267200c6951a0a8c1fb3f723de88a039c
504d81bb4926e496c11a34641dcc67150e78dadc
refs/heads/master
2021-05-15T17:10:07.801083
2016-12-02T09:35:07
2016-12-02T09:35:07
107,489,023
1
0
null
2017-10-19T02:37:10
2017-10-19T02:37:10
null
UTF-8
Java
false
false
1,900
java
package com.erim.sz.common.bean; import java.io.Serializable; import java.util.Date; import com.erim.core.bean.BaseBean; /** * @ClassName: ManagementMaterialBean * @Description: 签证材料 * @author maoxian * @date 2015年11月22日 下午11:53:01 */ public class ManagementMaterialBean extends BaseBean implements Serializable{ /** * @Fields serialVersionUID : 序列化 */ private static final long serialVersionUID = 1L; private Integer id; //企业ID private Integer cpyId; //签证ID private Integer mdlId; //材料名称 private String mmlMaterial; //材料说明 private String mmlKnow; //传文本 private String mmlText; //上传图片 private String mmlImg; //创建时间 private Date mmlCreatetime; //分类 private String mmlNtype; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public Integer getMdlId() { return mdlId; } public void setMdlId(Integer mdlId) { this.mdlId = mdlId; } public String getMmlMaterial() { return mmlMaterial; } public void setMmlMaterial(String mmlMaterial) { this.mmlMaterial = mmlMaterial; } public String getMmlKnow() { return mmlKnow; } public void setMmlKnow(String mmlKnow) { this.mmlKnow = mmlKnow; } public String getMmlText() { return mmlText; } public void setMmlText(String mmlText) { this.mmlText = mmlText; } public String getMmlImg() { return mmlImg; } public void setMmlImg(String mmlImg) { this.mmlImg = mmlImg; } public String getMmlNtype() { return mmlNtype; } public void setMmlNtype(String mmlNtype) { this.mmlNtype = mmlNtype; } public Integer getCpyId() { return cpyId; } public void setCpyId(Integer cpyId) { this.cpyId = cpyId; } public Date getMmlCreatetime() { return mmlCreatetime; } public void setMmlCreatetime(Date mmlCreatetime) { this.mmlCreatetime = mmlCreatetime; } }
[ "libra0920@qq.com" ]
libra0920@qq.com
146fbeb6499df73db404d714633466f7c220e2b7
0a124a51aa209dc07548ef50d78c6af91c01e829
/src/main/java/ru/r2cloud/jradio/jy1sat/WholeOrbit.java
5a11abbe1ac5c99c9e034960a3f7b77889a593d5
[ "Apache-2.0" ]
permissive
dernasherbrezon/jradio
fc6b428cc165a813e8c5400425c97d404eb156c4
fcb8f5d8cd8cb79376a72e2006c711e523e87016
refs/heads/master
2023-08-08T02:30:56.881599
2023-08-01T19:00:05
2023-08-01T19:00:05
86,858,948
52
14
Apache-2.0
2022-08-28T20:32:39
2017-03-31T20:44:11
Java
UTF-8
Java
false
false
4,962
java
package ru.r2cloud.jradio.jy1sat; import java.io.IOException; import ru.r2cloud.jradio.ao73.PaTemperature; import ru.r2cloud.jradio.util.BitInputStream; public class WholeOrbit { private float cctMictocontrollerTemp; private float rfBoardCrystalTemp; private double powerAmplifierTemp; private float solarPanelTempXP; private float solarPanelTempXM; private float solarPanelTempYP; private float solarPanelTempYM; private float solarPanelTempZP; private float solarPanelTempZM; private int sunSensorXP; private int sunSensorXM; private int sunSensorYP; private int sunSensorYM; private int sunSensorZP; private int sunSensorZM; private int batteryTemp; private int totPhotoCurr; private int batteryVoltage; private int totSystemCurr; public WholeOrbit(BitInputStream dis) throws IOException { cctMictocontrollerTemp = dis.readUnsignedInt(12); rfBoardCrystalTemp = ((dis.readUnsignedInt(12) & 1023) * -0.98f) + 234.58f; powerAmplifierTemp = PaTemperature.getPaTemp1024(dis.readUnsignedInt(12)); solarPanelTempXP = -0.2073f * dis.readUnsignedInt(10) + 158.239f; solarPanelTempXM = -0.2083f * dis.readUnsignedInt(10) + 159.227f; solarPanelTempYP = -0.2076f * dis.readUnsignedInt(10) + 158.656f; solarPanelTempYM = -0.2087f * dis.readUnsignedInt(10) + 159.045f; solarPanelTempZP = -0.2076f * dis.readUnsignedInt(10) + 158.656f; solarPanelTempZM = -0.2087f * dis.readUnsignedInt(10) + 159.045f; sunSensorXP = dis.readUnsignedInt(10); sunSensorXM = dis.readUnsignedInt(10); sunSensorYP = dis.readUnsignedInt(10); sunSensorYM = dis.readUnsignedInt(10); sunSensorZP = dis.readUnsignedInt(10); sunSensorZM = dis.readUnsignedInt(10); batteryTemp = dis.readUnsignedInt(8); totPhotoCurr = dis.readUnsignedInt(10); batteryVoltage = dis.readUnsignedInt(14); totSystemCurr = dis.readUnsignedInt(12); } public float getCctMictocontrollerTemp() { return cctMictocontrollerTemp; } public void setCctMictocontrollerTemp(float cctMictocontrollerTemp) { this.cctMictocontrollerTemp = cctMictocontrollerTemp; } public float getRfBoardCrystalTemp() { return rfBoardCrystalTemp; } public void setRfBoardCrystalTemp(float rfBoardCrystalTemp) { this.rfBoardCrystalTemp = rfBoardCrystalTemp; } public double getPowerAmplifierTemp() { return powerAmplifierTemp; } public void setPowerAmplifierTemp(double powerAmplifierTemp) { this.powerAmplifierTemp = powerAmplifierTemp; } public float getSolarPanelTempXP() { return solarPanelTempXP; } public void setSolarPanelTempXP(float solarPanelTempXP) { this.solarPanelTempXP = solarPanelTempXP; } public float getSolarPanelTempXM() { return solarPanelTempXM; } public void setSolarPanelTempXM(float solarPanelTempXM) { this.solarPanelTempXM = solarPanelTempXM; } public float getSolarPanelTempYP() { return solarPanelTempYP; } public void setSolarPanelTempYP(float solarPanelTempYP) { this.solarPanelTempYP = solarPanelTempYP; } public float getSolarPanelTempYM() { return solarPanelTempYM; } public void setSolarPanelTempYM(float solarPanelTempYM) { this.solarPanelTempYM = solarPanelTempYM; } public float getSolarPanelTempZP() { return solarPanelTempZP; } public void setSolarPanelTempZP(float solarPanelTempZP) { this.solarPanelTempZP = solarPanelTempZP; } public float getSolarPanelTempZM() { return solarPanelTempZM; } public void setSolarPanelTempZM(float solarPanelTempZM) { this.solarPanelTempZM = solarPanelTempZM; } public int getSunSensorXP() { return sunSensorXP; } public void setSunSensorXP(int sunSensorXP) { this.sunSensorXP = sunSensorXP; } public int getSunSensorXM() { return sunSensorXM; } public void setSunSensorXM(int sunSensorXM) { this.sunSensorXM = sunSensorXM; } public int getSunSensorYP() { return sunSensorYP; } public void setSunSensorYP(int sunSensorYP) { this.sunSensorYP = sunSensorYP; } public int getSunSensorYM() { return sunSensorYM; } public void setSunSensorYM(int sunSensorYM) { this.sunSensorYM = sunSensorYM; } public int getSunSensorZP() { return sunSensorZP; } public void setSunSensorZP(int sunSensorZP) { this.sunSensorZP = sunSensorZP; } public int getSunSensorZM() { return sunSensorZM; } public void setSunSensorZM(int sunSensorZM) { this.sunSensorZM = sunSensorZM; } public int getBatteryTemp() { return batteryTemp; } public void setBatteryTemp(int batteryTemp) { this.batteryTemp = batteryTemp; } public int getTotPhotoCurr() { return totPhotoCurr; } public void setTotPhotoCurr(int totPhotoCurr) { this.totPhotoCurr = totPhotoCurr; } public int getBatteryVoltage() { return batteryVoltage; } public void setBatteryVoltage(int batteryVoltage) { this.batteryVoltage = batteryVoltage; } public int getTotSystemCurr() { return totSystemCurr; } public void setTotSystemCurr(int totSystemCurr) { this.totSystemCurr = totSystemCurr; } }
[ "rodionovamp@mail.ru" ]
rodionovamp@mail.ru
954209397829c8a60324ef34326b196e8b4ab0c5
1ac72882579012284345e6e9d9ff64dd87481064
/rabbitmq/src/main/java/com/xwj/rabbit/FanoutRabbitConfig.java
0062eca8d97013df3787ddf89ca4d4b2f264f0f0
[]
no_license
xwj920930/springboot_example
45ce5c67e3a2f4515874a9e99a6b741f564f5f34
e6e5f11a31c487ef03d65bede1675a1ffeac9c5f
refs/heads/master
2022-07-12T22:52:45.445183
2021-10-16T10:13:20
2021-10-16T10:13:20
204,822,888
0
1
null
2022-06-29T17:37:08
2019-08-28T01:36:25
Java
UTF-8
Java
false
false
1,637
java
package com.xwj.rabbit; import org.springframework.amqp.core.Binding; import org.springframework.amqp.core.BindingBuilder; import org.springframework.amqp.core.FanoutExchange; import org.springframework.amqp.core.Queue; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; /** * 1.生产者绑定信息到交换器 * 2.交换器绑定了消费者队列 * 3.推送数据到绑定的消费者队列 * 4.消费者从各自的队列取数据 */ @Configuration public class FanoutRabbitConfig { @Bean//名字下面要用 public Queue AMessage() { return new Queue("fanout.A"); } @Bean public Queue BMessage() { return new Queue("fanout.B"); } @Bean public Queue CMessage() { return new Queue("fanout.C"); } @Bean//名字下面不用,随意取 FanoutExchange fanoutExchange() { return new FanoutExchange("fanoutExchange"); } @Bean//此处的AMessage就是对应该类的bean,不能乱取名字,fanoutExchange随意 //但是bean标签会匹配到上述的FanoutExchange Binding bindingExchangeA(Queue AMessage,FanoutExchange fanoutExchange) { return BindingBuilder.bind(AMessage).to(fanoutExchange); } @Bean//交换器绑定消费者队列 Binding bindingExchangeB(Queue BMessage, FanoutExchange fanoutExchange) { return BindingBuilder.bind(BMessage).to(fanoutExchange); } @Bean Binding bindingExchangeC(Queue CMessage, FanoutExchange fanoutExchange) { return BindingBuilder.bind(CMessage).to(fanoutExchange); } }
[ "xuwenjie@travelsky.com" ]
xuwenjie@travelsky.com
bedacb55b0cf761e6f5dbd43ae12eb7d7a89881b
6c113afc3af758fa0edfa818c954d6d96d4cd286
/02. Exam Preparation/02. Java OOP Exam Preparation II/02. Business Logic/cresla/core/ManagerImpl.java
80c089ec053ef0fa84ebcc83c43b6a0b9d326f9d
[]
no_license
AndreyKost/Java-OOP
60c5956e4c00877f22ed1235f2fe2cdda2e6dc0e
58cac676c67a7e73111f37b20ef1987c1076565c
refs/heads/master
2022-12-18T08:14:02.191925
2020-09-25T09:18:30
2020-09-25T09:18:30
298,519,550
0
0
null
null
null
null
UTF-8
Java
false
false
4,346
java
package cresla.core; import cresla.entities.modules.CooldownSystem; import cresla.entities.modules.CryogenRod; import cresla.entities.modules.HeatProcessor; import cresla.entities.reactors.CryoReactor; import cresla.entities.reactors.HeatReactor; import cresla.interfaces.AbsorbingModule; import cresla.interfaces.EnergyModule; import cresla.interfaces.Manager; import cresla.interfaces.Module; import cresla.interfaces.Reactor; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import static cresla.common.OutputMessages.*; public class ManagerImpl implements Manager { private static final int INITIAL_ID = 1; private int id; private Map<Integer, Reactor> reactors; private Map<Integer, Module> modules; private int cryoReactors; private int heatReactors; private int energyModules; private int absorbingModules; public ManagerImpl() { this.id = INITIAL_ID; this.reactors = new LinkedHashMap<>(); this.modules = new LinkedHashMap<>(); this.cryoReactors = 0; this.heatReactors = 0; this.energyModules = 0; this.absorbingModules = 0; } private int getId() { return this.id++; } @Override public String reactorCommand(List<String> arguments) { String type = arguments.get(0); int additionalParameter = Integer.parseInt(arguments.get(1)); int moduleCapacity = Integer.parseInt(arguments.get(2)); int currentID = this.getId(); Reactor currentReactor = null; switch (type) { case "Cryo": currentReactor = new CryoReactor(currentID, additionalParameter, moduleCapacity); cryoReactors++; break; case "Heat": currentReactor = new HeatReactor(currentID, additionalParameter, moduleCapacity); heatReactors++; break; } this.reactors.put(currentID, currentReactor); return String.format(REACTOR_COMMAND_OUTPUT, type, currentID); } @Override public String moduleCommand(List<String> arguments) { int reactorID = Integer.parseInt(arguments.get(0)); String type = arguments.get(1); int additionalParameter = Integer.parseInt(arguments.get(2)); int currentID = this.getId(); Reactor currentReactor = this.reactors.get(reactorID); switch (type) { case "CryogenRod": EnergyModule rod = new CryogenRod(currentID, additionalParameter); this.modules.put(currentID, rod); currentReactor.addEnergyModule(rod); energyModules++; break; case "HeatProcessor": AbsorbingModule processor = new HeatProcessor(currentID, additionalParameter); this.modules.put(currentID, processor); currentReactor.addAbsorbingModule(processor); absorbingModules++; break; case "CooldownSystem": AbsorbingModule cooler = new CooldownSystem(currentID, additionalParameter); this.modules.put(currentID, cooler); currentReactor.addAbsorbingModule(cooler); absorbingModules++; break; } return String.format(MODULE_COMMAND_OUTPUT, type, currentID, reactorID); } @Override public String reportCommand(List<String> arguments) { int reportID = Integer.parseInt(arguments.get(0)); if (this.reactors.containsKey(reportID)) { return this.reactors.get(reportID).toString(); } else { return this.modules.get(reportID).toString(); } } @Override public String exitCommand(List<String> arguments) { long totalEnergyOutput = this.reactors.values() .stream().mapToLong(Reactor::getTotalEnergyOutput).sum(); long totalHeatAbsorbing = this.reactors.values() .stream().mapToLong(Reactor::getTotalHeatAbsorbing).sum(); return String.format(EXIT_COMMAND_OUTPUT, cryoReactors, heatReactors, energyModules, absorbingModules, totalEnergyOutput, totalHeatAbsorbing); } }
[ "anddy8@gmail.com" ]
anddy8@gmail.com
a46d2349bdcf610f2a0c8bf9be2ce531e511c9ef
46712a562af3878be4478ebf9c46f01defc9637d
/family_service_platform/src/main/java/org/zhen77/mapper/WyFireExerciseMapper.java
25a5baca6a75229aaa008dd1a01af75033288178
[]
no_license
Zhen7-7/Project
8460ba771be59331b4690d0ad883f44153e7a4a8
3358a4706da6bae447919ed7dd9a13a8c3c4ac10
refs/heads/master
2023-03-06T01:15:54.589286
2021-03-01T15:25:49
2021-03-01T15:25:49
342,460,283
0
0
null
null
null
null
UTF-8
Java
false
false
295
java
package org.zhen77.mapper; import org.zhen77.bean.WyFireExercise; import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** * <p> * 消防演练 Mapper 接口 * </p> * * @author lian * @since 2021-02-26 */ public interface WyFireExerciseMapper extends BaseMapper<WyFireExercise> { }
[ "Zhen18103690519@gmail.com" ]
Zhen18103690519@gmail.com
56d6c020dc45e7ee58878b35c5f4ed8da06f7b26
34f0135a491b135d6a9ac929796cda42a8916f55
/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/io/FrameOutputBuffer.java
52616a3194b73ab8ec002142e418a70d71f0527a
[ "Apache-2.0", "LicenseRef-scancode-unknown" ]
permissive
apache/httpcomponents-core
85a5387d7e5467049b8931f7fd4f156a736b5623
b209e7b625085053d5e0184f2ab833c687fe2afc
refs/heads/master
2023-09-01T02:41:32.636058
2023-08-22T08:19:36
2023-08-22T08:24:24
206,398
246
368
Apache-2.0
2023-09-08T14:26:37
2009-05-21T01:41:50
Java
UTF-8
Java
false
false
4,297
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. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * */ package org.apache.hc.core5.http2.impl.io; import java.io.IOException; import java.io.OutputStream; import java.nio.ByteBuffer; import org.apache.hc.core5.http2.H2ConnectionException; import org.apache.hc.core5.http2.H2Error; import org.apache.hc.core5.http2.H2TransportMetrics; import org.apache.hc.core5.http2.frame.FrameConsts; import org.apache.hc.core5.http2.frame.FrameFlag; import org.apache.hc.core5.http2.frame.RawFrame; import org.apache.hc.core5.http2.impl.BasicH2TransportMetrics; import org.apache.hc.core5.util.Args; /** * Frame output buffer for HTTP/2 blocking connections. * * @since 5.0 */ public final class FrameOutputBuffer { private final BasicH2TransportMetrics metrics; private final int maxFramePayloadSize; private final byte[] buffer; public FrameOutputBuffer(final BasicH2TransportMetrics metrics, final int maxFramePayloadSize) { super(); Args.notNull(metrics, "HTTP2 transport metrics"); Args.positive(maxFramePayloadSize, "Maximum payload size"); this.metrics = metrics; this.maxFramePayloadSize = maxFramePayloadSize; this.buffer = new byte[FrameConsts.HEAD_LEN + maxFramePayloadSize + FrameConsts.MAX_PADDING + 1]; } public FrameOutputBuffer(final int maxFramePayloadSize) { this(new BasicH2TransportMetrics(), maxFramePayloadSize); } public void write(final RawFrame frame, final OutputStream outStream) throws IOException { if (frame == null) { return; } final int type = frame.getType(); final long streamId = frame.getStreamId(); final int flags = frame.getFlags(); final ByteBuffer payload = frame.getPayload(); final int payloadLen = payload != null ? payload.remaining() : 0; if (payload != null && payload.remaining() > maxFramePayloadSize) { throw new H2ConnectionException(H2Error.FRAME_SIZE_ERROR, "Frame size exceeds maximum"); } buffer[0] = (byte) (payloadLen >> 16 & 0xff); buffer[1] = (byte) (payloadLen >> 8 & 0xff); buffer[2] = (byte) (payloadLen & 0xff); buffer[3] = (byte) (type & 0xff); buffer[4] = (byte) (flags & 0xff); buffer[5] = (byte) (streamId >> 24 & 0xff); buffer[6] = (byte) (streamId >> 16 & 0xff); buffer[7] = (byte) (streamId >> 8 & 0xff); buffer[8] = (byte) (streamId & 0xff); int frameLen = FrameConsts.HEAD_LEN; int padding = 0; if ((flags & FrameFlag.PADDED.getValue()) > 0) { padding = 16; buffer[9] = (byte) (padding & 0xff); frameLen++; } if (payload != null) { payload.get(buffer, frameLen, payload.remaining()); frameLen += payloadLen; } for (int i = 0; i < padding; i++) { buffer[frameLen++] = 0; } outStream.write(buffer, 0, frameLen); metrics.incrementFramesTransferred(); metrics.incrementBytesTransferred(frameLen); } public H2TransportMetrics getMetrics() { return metrics; } }
[ "olegk@apache.org" ]
olegk@apache.org
39510e17e937afff1224ea9511b752f06e84108a
2e03da8505fba2f5fba0aa96096240cfe1584490
/crunchyroll/crunchyroll2-0-3/com/fasterxml/jackson/databind/ser/std/SqlTimeSerializer.java
419f755ed181b0c67467617969bdb18569829d15
[]
no_license
JairoBm13/crunchywomod
c00f8535a76ee7a5e0554d766ddc08b608e57f9b
90ad43cdf12e41fc6ff2323ec5d6d94cc45a1c52
refs/heads/master
2021-01-20T14:48:30.312526
2017-05-08T21:37:16
2017-05-08T21:37:16
90,674,385
2
0
null
null
null
null
UTF-8
Java
false
false
770
java
// // Decompiled by Procyon v0.5.30 // package com.fasterxml.jackson.databind.ser.std; import com.fasterxml.jackson.core.JsonGenerationException; import java.io.IOException; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.annotation.JacksonStdImpl; import java.sql.Time; @JacksonStdImpl public class SqlTimeSerializer extends StdScalarSerializer<Time> { public SqlTimeSerializer() { super(Time.class); } @Override public void serialize(final Time time, final JsonGenerator jsonGenerator, final SerializerProvider serializerProvider) throws IOException, JsonGenerationException { jsonGenerator.writeString(time.toString()); } }
[ "j.bautista.m13@outlook.com" ]
j.bautista.m13@outlook.com
e0421e965958eb51158b5e65a6246d37e6a46dcf
e9e6be55a6823b1b57e39371997d432bb20e3fde
/api-pay/api/src/main/java/com/kinlie/microservicepay/utils/IpUtil.java
5f16ab8664b66454b33c71241208627053ac832a
[]
no_license
OrmFor/pay
2e5e3d949608eb5c4334cbb1ea56e18e2418a91d
2514822e5e7065253167da4306f83cb5bde50111
refs/heads/master
2022-07-20T16:03:03.354987
2020-03-03T06:03:19
2020-03-03T06:03:19
244,552,056
0
0
null
null
null
null
UTF-8
Java
false
false
1,722
java
package com.kinlie.microservicepay.utils; import javax.servlet.http.HttpServletRequest; public class IpUtil { public static String getIp(HttpServletRequest request) { String ip = ""; ip = request.getHeader("x-forwarded-for"); if ((ip == null) || (ip.length() == 0) || ("unknown".equalsIgnoreCase(ip))) { ip = request.getHeader("X-Real-IP"); } if ((ip == null) || (ip.length() == 0) || ("unknown".equalsIgnoreCase(ip))) { ip = request.getHeader("Proxy-Client-IP"); } if ((ip == null) || (ip.length() == 0) || ("unknown".equalsIgnoreCase(ip))) { ip = request.getHeader("WL-Proxy-Client-IP"); } if ((ip == null) || (ip.length() == 0) || ("unknown".equalsIgnoreCase(ip))) { ip = request.getHeader("HTTP_CLIENT_IP"); } if ((ip == null) || (ip.length() == 0) || ("unknown".equalsIgnoreCase(ip))) { ip = request.getHeader("HTTP_X_FORWARDED_FOR"); } if ((ip == null) || (ip.length() == 0) || ("unknown".equalsIgnoreCase(ip))) { ip = request.getHeader("X-Forworded-For"); } if ((ip == null) || (ip.length() == 0) || ("unknown".equalsIgnoreCase(ip))) { ip = request.getRemoteAddr(); } if ((ip == null) || (ip.length() == 0) || ("unknown".equalsIgnoreCase(ip))) { ip = request.getRemoteHost(); } if ((ip != null) && (!"".equals(ip))) { ip = ip.replaceAll("#", ""); ip = ip.trim(); ip = ip.replaceAll(" ", ""); ip = ip.toLowerCase(); ip = ip.replaceAll("unknown,", ""); for (String ipStr : ip.split(",")) { if ((ipStr != null) && (!"".equals(ipStr))) { ip = ipStr; break; } } for (String ipStr : ip.split(":")) { if ((ipStr != null) && (!"".equals(ipStr))) { ip = ipStr; break; } } } return ip; } }
[ "34675763+OrmFor@users.noreply.github.com" ]
34675763+OrmFor@users.noreply.github.com
f6592d30b7c67ba35b7189d860e9101bb603d6d6
bce2dc851e7def05091a1ea52b14e7f0ea5d65d8
/coding2/src/com/sgs/simple/Employee.java
7651c0cf8dd517b1f9d71577d84ce79354b434e9
[]
no_license
gkdgithub/Dev
e6e5ceb816c2224c127f875314b62e7d8c57655d
56a4b56964d8490abed2ec9774fae9d8a5ccd117
refs/heads/master
2023-03-01T22:44:29.522921
2022-09-07T14:51:20
2022-09-07T14:51:20
222,905,973
1
0
null
2023-02-22T08:00:29
2019-11-20T09:58:33
Java
UTF-8
Java
false
false
1,278
java
package com.sgs.simple; public class Employee { private String name; private int id; private String dept; private Address address; /*If you want to represent any object as a string, toString() method comes into existence.*/ /*The toString() method returns the string representation of the object.*/ public Employee() { /*If we are not overriding toString method we will get className@hashCode.*/ /*we can override toString() method in our class to print proper output*/ } /*If you print any object, java compiler internally invokes the toString() method on the object.*/ /*So overriding the toString() method, returns the desired output.*/ public String getName() { return name; } public void setName(String name) { this.name = name; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getDept() { return dept; } public void setDept(String dept) { this.dept = dept; } public Address getAddress() { return address; } public void setAddress(Address address) { this.address = address; } }
[ "gauravgreatgaurav@gmail.com" ]
gauravgreatgaurav@gmail.com
9f2efe3f99d6dc357247b9bd7dabe890c7d88aed
b4b62c5c77ec817db61820ccc2fee348d1d7acc5
/src/main/java/com/alipay/api/domain/ScheduleResResult.java
361af100edb71da93e22b8ec1e373e56032ed8a7
[ "Apache-2.0" ]
permissive
zhangpo/alipay-sdk-java-all
13f79e34d5f030ac2f4367a93e879e0e60f335f7
e69305d18fce0cc01d03ca52389f461527b25865
refs/heads/master
2022-11-04T20:47:21.777559
2020-06-15T08:31:02
2020-06-15T08:31:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
981
java
package com.alipay.api.domain; import com.alipay.api.AlipayObject; import com.alipay.api.internal.mapping.ApiField; /** * 排班调度资源查询结果 * * @author auto create * @since 1.0, 2020-05-07 15:30:21 */ public class ScheduleResResult extends AlipayObject { private static final long serialVersionUID = 7612439346617381797L; /** * 返回码 */ @ApiField("code") private String code; /** * 结果 */ @ApiField("data") private ScheduleResItem data; /** * 返回消息 */ @ApiField("message") private String message; public String getCode() { return this.code; } public void setCode(String code) { this.code = code; } public ScheduleResItem getData() { return this.data; } public void setData(ScheduleResItem data) { this.data = data; } public String getMessage() { return this.message; } public void setMessage(String message) { this.message = message; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
54115ddcf17c449fd86a4aea8e807d64bf62da11
e7e497b20442a4220296dea1550091a457df5a38
/main_project/Importer/src/com/xiaonei/importer/netease/NeteaseWorker.java
603d4dc7607acc988265ee32cac2445a1975e65b
[]
no_license
gunner14/old_rr_code
cf17a2dedf8dfcdcf441d49139adaadc770c0eea
bb047dc88fa7243ded61d840af0f8bad22d68dee
refs/heads/master
2021-01-17T18:23:28.154228
2013-12-02T23:45:33
2013-12-02T23:45:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,433
java
package com.xiaonei.importer.netease; import java.util.UUID; import org.apache.commons.httpclient.Header; import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.HttpConnectionManager; import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager; import org.apache.commons.httpclient.cookie.CookiePolicy; import org.apache.commons.httpclient.methods.GetMethod; import org.apache.commons.httpclient.methods.PostMethod; import org.apache.commons.httpclient.methods.StringRequestEntity; import org.apache.commons.httpclient.params.DefaultHttpParams; import org.apache.commons.httpclient.params.HttpConnectionManagerParams; import org.apache.commons.httpclient.params.HttpMethodParams; import com.xiaonei.importer.AbstractWorker; import com.xiaonei.importer.WorkerCallback; import com.xiaonei.importer.google.InfomationCache; import com.xiaonei.svc.importer.BuddyInfo; import com.xiaonei.svc.importer.BuddyList; import com.xiaonei.svc.importer.BuddyListStatus; public class NeteaseWorker extends AbstractWorker { private static org.apache.commons.logging.Log _logger = org.apache.commons.logging.LogFactory .getLog(NeteaseWorker.class); private final String _163Id; private final String _163Password; private StringBuilder cookie = new StringBuilder(); private String sid = null; private String wmsvr_domain = null; private BuddyInfo[] _buddylist; protected NeteaseWorker(String __163Id, String __163Password, UUID requestId, WorkerCallback callback) { super(requestId, callback); this._163Id = __163Id; this._163Password = __163Password; } public void run() { boolean auth = getAuth(); BuddyListStatus status = null; if (auth) { status = new BuddyListStatus(302, "Token OK, needs contacts"); } else { status = new BuddyListStatus(403, "Auth failed."); } BuddyList list = InfomationCache.getInstance().getContacts( this._requestId); list.status = status; if (auth) { exportContacts(); } } private static HttpClient httpclient; static { DefaultHttpParams.getDefaultParams().setBooleanParameter( HttpMethodParams.SINGLE_COOKIE_HEADER, true); DefaultHttpParams.getDefaultParams().setParameter( HttpMethodParams.COOKIE_POLICY, CookiePolicy.IGNORE_COOKIES); HttpConnectionManager manager = new MultiThreadedHttpConnectionManager(); HttpConnectionManagerParams parm = new HttpConnectionManagerParams(); parm.setDefaultMaxConnectionsPerHost(64); parm.setMaxTotalConnections(128); parm.setStaleCheckingEnabled(true); manager.setParams(parm); httpclient = new HttpClient(manager); } private boolean getAuth() { String url = "http://reg.163.com/login.jsp?type=1&url=http://entry.mail.163.com/coremail/fcg/ntesdoor2?lightweight%3D1%26verifycookie%3D1%26language%3D-1%26style%3D-1"; PostMethod post = new PostMethod(url); String NTES_SESS = null, S_INFO = null, P_INFO = null, URSJESSIONID = null; try { post.addParameter("verifycookie", "1"); post.addParameter("username", this._163Id); post.addParameter("password", this._163Password); post.addParameter("selType", "-1"); post.addParameter("remUser", ""); post.addParameter("%B5%C7%C2%BC%D3%CA%CF%E4", "%B5%C7%C2%BC%D3%CA%CF%E4"); post.addParameter("style", "34"); post.addParameter("type", "1"); post.addParameter("product", "mail163"); post.addParameter("savelogin", ""); post.addParameter("outfoxer", ""); try { httpclient.executeMethod(post); } catch (Exception e) { _logger.error("ex ", e); return false; } // System.out.println(post.getResponseBodyAsString()); for (Header head : post.getResponseHeaders("Set-Cookie")) { String str = head.getValue(); // System.out.println("heads : " + str); String cuk1 = str.split(";")[0]; int i = cuk1.indexOf('='); String key = cuk1.substring(0, i); String value = cuk1.substring(i + 1); if ("NTES_SESS".equals(key)) { NTES_SESS = value; } else if ("S_INFO".equals(key)) { S_INFO = value; } else if ("P_INFO".equals(key)) { P_INFO = value; } else if ("URSJESSIONID".equals(key)) { URSJESSIONID = value; } } } catch (Exception e) { _logger.error(e); } finally { post.releaseConnection(); } if (NTES_SESS == null || S_INFO == null || P_INFO == null || URSJESSIONID == null) { return false; } cookie.append("NTES_SESS=" + NTES_SESS + "; S_INFO=" + S_INFO + "; P_INFO=" + P_INFO + "; URSJESSIONID=" + URSJESSIONID); url = "http://entry.mail.163.com/coremail/fcg/ntesdoor2?lightweight=1&verifycookie=1&language=-1&style=-1&username=" + this._163Id; GetMethod get = new GetMethod(url); get.setFollowRedirects(false); get.setRequestHeader("Cookie", cookie.toString()); // System.out.println(cookie.toString()); // System.out.println(get.getQueryString()); try { try { httpclient.executeMethod(get); } catch (Exception e) { _logger.error("get ex: ", e); } String coremail = null; try { // System.out.println(get.getResponseHeader("Set-Cookie")); String coremailstr = get.getResponseHeader("Set-Cookie") .getValue().split(";")[0]; // System.out.println(coremailstr); coremail = coremailstr.substring(coremailstr.indexOf('=') + 1); sid = coremail.split("%")[1]; } catch (Exception e) { _logger.warn("parse 163 login error in step 2", e); // System.out.println("parse 163 login error in step 2"); return false; } cookie.append("; Coremail=" + coremail); String location = get.getResponseHeader("Location").getValue(); wmsvr_domain = location.split("/")[2]; cookie.append("; wmsvr_domain=" + wmsvr_domain); return true; } catch (Exception e) { _logger.debug(e); // System.err.println(e); return false; } finally { get.releaseConnection(); } } private void exportContacts() { PostMethod post = new PostMethod("http://" + wmsvr_domain + "/a/s?sid=" + sid + "&func=global:sequential"); post.setRequestHeader("Accept-Encoding", "identity"); post.setRequestHeader("Referer", "http://" + wmsvr_domain + "/a/f/js3/0801290924/index_v7.htm"); post.setRequestHeader("Cookie", cookie.toString()); String postBody = "<?xml version=\"1.0\"?><object><array name=\"items\"><object><string name=\"func\">pab:searchContacts</string><object name=\"var\"><array name=\"order\"><object><string name=\"field\">FN</string><boolean name=\"ignoreCase\">true</boolean></object></array></object></object><object><string name=\"func\">user:getSignatures</string></object><object><string name=\"func\">pab:getAllGroups</string></object></array></object>"; String response = null; int result = -1; try { post.setRequestEntity(new StringRequestEntity(postBody, "application/xml", "UTF-8")); while (result < 0 && result > -20) { try { result = httpclient.executeMethod(post); } catch (Exception e) { result--; _logger.error(result, e); post.releaseConnection(); } } response = post.getResponseBodyAsString(); } catch (Exception e) { _logger.error(e); } finally { if (result != -20) post.releaseConnection(); } if (response != null) { try { _buddylist = NeteaseProtocal.prase(response); BuddyListStatus status = new BuddyListStatus(200, "OK"); _callback.finishContactList(_requestId, _buddylist, status); } catch (Exception e) { _logger.warn(e); } } } }
[ "liyong19861014@gmail.com" ]
liyong19861014@gmail.com
30a03effa01de3748fd531b65a221b07cdf30673
96d2b99c3514a59668aabca0cf91b5990fc9c964
/webapp_home/src/main/java/com/e9cloud/pcweb/account/action/LoginController.java
b95c46f1dd45a89e4853286785a98d5e8621f9c1
[]
no_license
donggua131432/33e9
6599590a2c8eb5ee53ac235a6b50df88021c35af
96089f5001828c10dbf5657a3352326055dd2802
refs/heads/master
2020-04-13T11:58:28.053544
2018-12-26T15:10:17
2018-12-26T15:10:17
163,189,038
0
0
null
null
null
null
UTF-8
Java
false
false
6,744
java
package com.e9cloud.pcweb.account.action; import com.e9cloud.core.util.*; import com.e9cloud.mybatis.domain.Account; import com.e9cloud.mybatis.service.AccountService; import com.e9cloud.pcweb.BaseController; import com.e9cloud.redis.session.JCookie; import com.e9cloud.redis.session.JSession; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.UUID; /** * Created by Administrator on 2016/1/4. */ @Controller @RequestMapping("/auth") public class LoginController extends BaseController { @Autowired private AccountService accountService; @RequestMapping(method = RequestMethod.GET) public String login(HttpServletRequest request, HttpServletResponse response, String redirect_url, Model model, String email) { logger.info("-------------- redirect_url:" + redirect_url); model.addAttribute("redirect_url", redirect_url); if (Tools.isNotNullStr(email)) { model.addAttribute("username", email); } // 未登录 或者 登录超时 清除islogin JCookie jCookie = new JCookie(request, response); if (Tools.isNullStr(jCookie.getCookieValue(JCookie.AccessToken)) || !JSession.exists(jCookie.getCookieValue(JCookie.AccessToken))) { jCookie.removeCookie(JCookie.isLogin); } logger.info("-------------- to login page --------------"); return "login2"; } @RequestMapping(method = RequestMethod.POST) public String login(Model model,HttpServletResponse response,HttpServletRequest request, String username, String password, String redirect_url) { /** //获取传过来的验证码 String verifyCode = request.getParameter("verifyCode"); if(Tools.isNullStr(verifyCode)){ model.addAttribute("msg","验证码不能为空!"); return "login"; } try { //获取kaptcha生成存放在session中的验证码 String kaptchaValue = (String) request.getSession().getAttribute(Constants.KAPTCHA_SESSION_KEY); //比较输入的验证码和实际生成的验证码是否相同 if(kaptchaValue == null || kaptchaValue == "" || !verifyCode.equalsIgnoreCase(kaptchaValue)) { model.addAttribute("msg","验证码错误!"); return "login"; } }catch(Exception e) { e.printStackTrace(); } */ model.addAttribute("username", username); if(Tools.isNotNullStr(redirect_url)){ model.addAttribute("redirect_url", redirect_url); } if(Tools.isNullStr(username) && Tools.isNullStr(password)){ model.addAttribute("msg","账号或密码错误,请重新输入!"); return "login2"; } if(Tools.isNullStr(username)){ model.addAttribute("msg","账号或密码错误,请重新输入!"); return "login2"; } if(Tools.isNullStr(password)){ model.addAttribute("msg","账号或密码错误,请重新输入!"); return "login2"; } logger.info("username:{}, password:{}", username, password); Account account = accountService.getAccountForAuthentication(username); if(account == null ){ model.addAttribute("msg","账号或密码错误,请重新输入!"); return "login2"; } //校验用户名和密码,如果成功,设置AccessToken, 和 缓存用户用户 // 1.校验用户名和密码 String pwd = RSAUtils.decryptStringByJs(password); if (DigestsUtils.checkpwd(account, pwd)) { //新增权限冻结、禁用控制 String stt = account.getStatus(); if (Constants.USER_STATUS_FROZEN.equals(stt)) {//冻结状态 model.addAttribute("msg","用户已被冻结!请联系客户人员"); return "login2"; } else if (Constants.USER_STATUS_DISABLED.equals(stt)) {//禁用状态 model.addAttribute("msg","用户已被禁用!请联系客户人员"); return "login2"; } else { // 2.如果成功,设置AccessToken String AccessToken = UUID.randomUUID().toString(); JCookie jCookie = new JCookie(request, response); jCookie.createCookie(JCookie.AccessToken, AccessToken, "/", null); jCookie.createCookie(JCookie.isLogin,"true", "/", JCookie.domain); request.getSession().setAttribute(JSession.USER_INFO, account); // 3. 缓存用户用户 JSession jSession = new JSession(AccessToken, account.getUid()); jSession.create(); logger.info("========================= {} ==============================", "createSession"); //try { /*if (Tools.isNotNullStr(redirect_url)) { logger.info(redirect_url); response.sendRedirect(redirect_url); return null; }*/ return redirect + "/accMgr/index"; //} catch (IOException e) { // e.printStackTrace(); //} } } model.addAttribute("msg","账号或密码错误,请重新输入!"); return "login2"; } // 登录成功页 @RequestMapping(value = "suc", method = RequestMethod.GET) public String loginsuc() { return "login_success"; } // 登出 @RequestMapping(value = "logout") public String logout(HttpServletRequest request, HttpServletResponse response){ JCookie jCookie = new JCookie(request, response); Cookie cookie = jCookie.getCookie(JCookie.AccessToken); if (cookie != null) { // 清除cookie jCookie.removeCookie(JCookie.AccessToken); jCookie.removeCookie(JCookie.isLogin,JCookie.domain); String value = cookie.getValue(); // 清除redis JSession jSession = new JSession(value); jSession.delete(); this.removeAttributeFromSession(request, has_read); // 销毁session request.getSession().invalidate(); } return redirect + "/auth"; } }
[ "donggua131432@sina.cn" ]
donggua131432@sina.cn
521bb99df1026bb5d8c1a6279f6db150843e96e0
3e355a798304584431e5e5a1f1bc141e16c330fc
/AL-Game/src/com/aionemu/gameserver/dao/AnnouncementsDAO.java
65eb60d7bc8f22e54b42ce3b325469cdf34a8d45
[]
no_license
webdes27/Aion-Lightning-4.6-SRC
db0b2b547addc368b7d5e3af6c95051be1df8d69
8899ce60aae266b849a19c3f93f47be9485c70ab
refs/heads/master
2021-09-14T19:16:29.368197
2018-02-27T16:05:28
2018-02-27T16:05:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,468
java
/** * This file is part of Aion-Lightning <aion-lightning.org>. * * Aion-Lightning 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. * * Aion-Lightning 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 Aion-Lightning. * If not, see <http://www.gnu.org/licenses/>. */ package com.aionemu.gameserver.dao; import java.util.Set; import com.aionemu.commons.database.dao.DAO; import com.aionemu.gameserver.model.Announcement; /** * DAO that manages Announcements * * @author Divinity */ public abstract class AnnouncementsDAO implements DAO { public abstract Set<Announcement> getAnnouncements(); public abstract void addAnnouncement(final Announcement announce); public abstract boolean delAnnouncement(final int idAnnounce); /** * Returns class name that will be uses as unique identifier for all DAO * classes * * @return class name */ @Override public final String getClassName() { return AnnouncementsDAO.class.getName(); } }
[ "michelgorter@outlook.com" ]
michelgorter@outlook.com