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
32523f2e97cad3e03d909a680361f989b6c2677a
62cf61afdc375d71d27a23eac750850c8f5279af
/1.13.2/spigot/net/minecraft/server/CommandSpawnpoint.java
f28a5beadb7d955c921ff7483254a6497cbdf1ba
[]
no_license
Akarin-project/Minecraft
8702914cff49dba37e92e57f4fbb1f40a608b67d
23fd9297f773b229a31501ffc5b6ce5a9fd29fa6
refs/heads/master
2021-08-06T17:18:54.483817
2020-04-03T06:35:13
2020-04-03T06:35:13
133,816,032
1
3
null
null
null
null
UTF-8
Java
false
false
2,671
java
package net.minecraft.server; import com.mojang.brigadier.arguments.ArgumentType; import com.mojang.brigadier.builder.LiteralArgumentBuilder; import com.mojang.brigadier.builder.RequiredArgumentBuilder; import com.mojang.brigadier.context.CommandContext; import java.util.Collection; import java.util.Collections; import java.util.Iterator; public class CommandSpawnpoint { public static void a(com.mojang.brigadier.CommandDispatcher<CommandListenerWrapper> com_mojang_brigadier_commanddispatcher) { com_mojang_brigadier_commanddispatcher.register((LiteralArgumentBuilder) ((LiteralArgumentBuilder) ((LiteralArgumentBuilder) CommandDispatcher.a("spawnpoint").requires((commandlistenerwrapper) -> { return commandlistenerwrapper.hasPermission(2); })).executes((commandcontext) -> { return a((CommandListenerWrapper) commandcontext.getSource(), Collections.singleton(((CommandListenerWrapper) commandcontext.getSource()).h()), new BlockPosition(((CommandListenerWrapper) commandcontext.getSource()).getPosition())); })).then(((RequiredArgumentBuilder) CommandDispatcher.a("targets", (ArgumentType) ArgumentEntity.d()).executes((commandcontext) -> { return a((CommandListenerWrapper) commandcontext.getSource(), ArgumentEntity.f(commandcontext, "targets"), new BlockPosition(((CommandListenerWrapper) commandcontext.getSource()).getPosition())); })).then(CommandDispatcher.a("pos", (ArgumentType) ArgumentPosition.a()).executes((commandcontext) -> { return a((CommandListenerWrapper) commandcontext.getSource(), ArgumentEntity.f(commandcontext, "targets"), ArgumentPosition.b(commandcontext, "pos")); })))); } private static int a(CommandListenerWrapper commandlistenerwrapper, Collection<EntityPlayer> collection, BlockPosition blockposition) { Iterator iterator = collection.iterator(); while (iterator.hasNext()) { EntityPlayer entityplayer = (EntityPlayer) iterator.next(); entityplayer.setRespawnPosition(blockposition, true); } if (collection.size() == 1) { commandlistenerwrapper.sendMessage(new ChatMessage("commands.spawnpoint.success.single", new Object[] { blockposition.getX(), blockposition.getY(), blockposition.getZ(), ((EntityPlayer) collection.iterator().next()).getScoreboardDisplayName()}), true); } else { commandlistenerwrapper.sendMessage(new ChatMessage("commands.spawnpoint.success.multiple", new Object[] { blockposition.getX(), blockposition.getY(), blockposition.getZ(), collection.size()}), true); } return collection.size(); } }
[ "i@omc.hk" ]
i@omc.hk
28bd5e7204c5f16ed1b31ffc2d189decce321352
25be0bee99b5b98e95feedfe898398b0d3279079
/spark-java/src/main/java/sparksql/common/BoroughStatResult.java
38a2a8b7779497efd1dbeb0141d49af5b383c579
[]
no_license
luguanxing/Spark-Java-Study
61bfa815f22a0309ffc7c891c5f5db97f06ab5e3
b38ea204f6158fa91bc93adf1926d9434df3cd98
refs/heads/master
2022-07-07T06:09:14.998147
2020-05-20T14:21:24
2020-05-20T14:21:24
244,924,309
0
0
null
2022-06-21T03:08:52
2020-03-04T14:40:27
Java
UTF-8
Java
false
false
234
java
package sparksql.common; import lombok.AllArgsConstructor; import lombok.Data; import org.apache.spark.sql.Row; @Data @AllArgsConstructor public class BoroughStatResult { String license; String borough; Long costTime; }
[ "651571925@qq.com" ]
651571925@qq.com
0b3eb4f2fc50ae427a2c325f9fe7120001037c61
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/21/21_8718a7157d0666849d53d455b27b56920314e044/DebugMAS/21_8718a7157d0666849d53d455b27b56920314e044_DebugMAS_t.java
9ec9b4b334becd0acd93f27e262c4fd32280bc3a
[]
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
2,087
java
//---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- // Copyright (C) 2003 Rafael H. Bordini, Jomi F. Hubner, et al. // // 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. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // To contact the authors: // http://www.dur.ac.uk/r.bordini // http://www.inf.furb.br/~jomi // // CVS information: // $Date$ // $Revision$ // $Log$ // Revision 1.5 2005/08/23 17:09:28 jomifred // fix bug in logger // // Revision 1.4 2005/08/12 21:08:23 jomifred // add cvs keywords // //---------------------------------------------------------------------------- package jIDE; import java.awt.event.ActionEvent; import javax.swing.AbstractAction; import javax.swing.ImageIcon; import org.apache.log4j.Level; import org.apache.log4j.Logger; /** runs an MAS in debug mode */ class DebugMAS extends AbstractAction { JasonID jasonID; DebugMAS(JasonID jID) { super("Debug MAS...", new ImageIcon(JasonID.class.getResource("/images/startDebugger.gif"))); jasonID = jID; } public void actionPerformed(ActionEvent e) { try { jasonID.fMAS2jThread.fParserMAS2J.debugOn(); jasonID.runMASAct.actionPerformed(e); } finally { jasonID.fMAS2jThread.fParserMAS2J.debugOff(); Logger.getRootLogger().setLevel(Level.INFO); } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
c50525ecd2b587df27b2539192e6c17ea9a0afc8
b04e16872015bcb53e59d2262f208c2c16ff213b
/app/src/main/java/com/kson/mvpframework/widget/MyView.java
145f3eb9d23e2dbf4acb85d04e8fbfe7ed1d4686
[]
no_license
KsonCode/MvpFramework
ee20f117d6dc527a6d2c2f77c1353a33f5793568
8c7220472ce597f1f2a78ab2c81e26bcf12786d7
refs/heads/master
2021-03-22T03:36:53.812128
2017-11-27T05:18:26
2017-11-27T05:18:26
112,150,692
0
0
null
null
null
null
UTF-8
Java
false
false
1,370
java
package com.kson.mvpframework.widget; import android.content.Context; import android.graphics.Canvas; import android.graphics.Paint; import android.support.annotation.Nullable; import android.support.v4.content.ContextCompat; import android.util.AttributeSet; import android.view.View; import com.kson.mvpframework.R; /** * Author:kson * E-mail:19655910@qq.com * Time:2017/11/05 * Description: */ public class MyView extends View { Paint paint; public MyView(Context context) { this(context,null); } public MyView(Context context, @Nullable AttributeSet attrs) { this(context, attrs,1); } public MyView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); initView(); } private void initView() { paint = new Paint(); paint.setColor(ContextCompat.getColor(getContext(),android.R.color.holo_red_dark)); paint.setAntiAlias(true); paint.setStyle(Paint.Style.FILL); } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); setMeasuredDimension(200,200); } @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); canvas.drawCircle(100,100,100,paint); } }
[ "19655910@qq.com" ]
19655910@qq.com
a1c3ce60c089d45d3dbed67bb0c1aa4d1f0f6144
6da3803eb24f980f2b987cb5a75155d51ceb831e
/tp_injection_2017/service_locator/TestsAvecInjections.java
f87b9bb484aa1a382dcf3601b75b8b51b7c033d0
[]
no_license
Atalaia/NFP121
622fc3ec754c008bd12aba752c8e0d90e824e49d
ebaae29ec9dc986c818631d16f58fc5d31a10b43
refs/heads/master
2020-06-26T19:24:10.116345
2020-02-23T17:00:29
2020-02-23T17:00:29
199,725,507
0
0
null
null
null
null
UTF-8
Java
false
false
851
java
package service_locator; import container.*; public class TestsAvecInjections extends junit.framework.TestCase{ public void testServiceLocator() throws Exception{ ApplicationContext ctx = Factory.createApplicationContext("./service_locator/README.TXT"); ServiceLocatorI serviceLocator = ctx.getBean("serviceLocator"); System.out.println("Liste des services accessibles: "); for(String service : ctx){ System.out.println("\t" + service); } System.out.println("------------------------------------------------"); for(String service : serviceLocator){ System.out.println("\t" + service); } exemples.Table table = serviceLocator.lookup("table"); table.ajouter(33);table.ajouter(33); assertEquals(1,table.taille()); } }
[ "mariasoage@MacBook-Pro-de-Maria.local" ]
mariasoage@MacBook-Pro-de-Maria.local
a7e32f6a5b939406eda7e0fd5d9cecedab3a941f
acd8002ac0405575284fe14a05454303c6077fbe
/thermit-core/src/main/java/org/napile/thermit/property/ParseNextProperty.java
f30c4706c992a1b6c9e64875acfe23c67c96a308
[ "W3C", "SAX-PD", "Apache-2.0" ]
permissive
napile/napile.thermit
bb2f5553a207405a1dae421e098b82231e1109de
e01586b2c8283c967cce137ea34f21b1abfe1856
refs/heads/master
2021-01-25T07:34:16.818408
2013-01-05T10:24:09
2013-01-05T10:24:09
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,527
java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package org.napile.thermit.property; import java.text.ParsePosition; import org.napile.thermit.Project; /** * Helper for {@link PropertyExpander PropertyExpander} that can be * used to expand property references to values. * * @since Ant 1.8.0 */ public interface ParseNextProperty { /** * Get the current project. * * @return the current thermit project. */ Project getProject(); /** * Return any property that can be parsed from the specified position * in the specified String. * * @param value String to parse * @param pos ParsePosition * @return Object or null if no property is at the current location. */ Object parseNextProperty(String value, ParsePosition pos); }
[ "vistall@i.ua" ]
vistall@i.ua
45d3d73520bc68311c1042bcdac302d837409ce3
e4da97ab81ec813fbecade1ad1fc4f346aed35e6
/src/core/models/src/main/java/org/ogema/model/metering/HeatMeter.java
58872439bbd087ed9ca763aca3a431f45ad80aee
[ "Apache-2.0" ]
permissive
JoKoo619/ogema
49ae2afbdfed4141e1e2c9c4375b0788219ea6ed
21e3d6827e416893461e9e8a8b80c01d75d135f9
refs/heads/public
2020-12-11T09:30:27.575002
2015-11-27T09:42:42
2015-11-27T09:42:42
49,029,409
0
1
null
2016-01-04T23:23:52
2016-01-04T23:23:48
null
UTF-8
Java
false
false
2,191
java
/** * This file is part of OGEMA. * * OGEMA is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3 * as published by the Free Software Foundation. * * OGEMA 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 OGEMA. If not, see <http://www.gnu.org/licenses/>. */ package org.ogema.model.metering; import org.ogema.core.model.simple.FloatResource; import org.ogema.core.model.simple.IntegerResource; import org.ogema.core.model.simple.TimeResource; import org.ogema.core.model.units.EnergyResource; import org.ogema.core.model.units.PowerResource; import org.ogema.model.connections.ThermalConnection; import org.ogema.model.devices.connectiondevices.HeatConnectionBox; import org.ogema.model.smartgriddata.HeatPrice; /** * Heat meter. */ public interface HeatMeter extends GenericMeter { @Override ThermalConnection connection(); /** * Power readings of the meter. The history of past values should be added * in the definition {@link FloatResource#historicalData() historicalData} field of the reading. */ PowerResource powerReading(); /** * Energy readings of the meter. The history of past values should be added * in the definition {@link FloatResource#historicalData() historicalData} field of the reading. */ EnergyResource energyReading(); /** * Time at which the energy reading was last reset (i.e. time of reference * at which {@link #energyReading()} started at zero. Past values (past * resets) should be added in the {@link FloatResource#historicalData() historicalData} * subresource. */ TimeResource resetTime(); /** * Type of meter:<br> * 1: two-way meter without nonreturn<br> * 2: consumption meter<br> * 3: generation meter<br> * greater 10.000: custom values */ @Override IntegerResource type(); @Override HeatPrice price(); @Override HeatConnectionBox distributionBox(); }
[ "jan.lapp@iwes.fraunhofer.de" ]
jan.lapp@iwes.fraunhofer.de
03114b9e399cf087a5bc81a04aa34e0b081162dc
4c8178ef69d9d15ff62459515f5835adb5970cbe
/SQLite/app/src/main/java/com/dismas/imaya/sqlite/SignupActivity.java
6bd4c02d41f6c1a227d2736a708e1c6dbeab647b
[]
no_license
Bravo2017/android-projects
3dbd71bef8310a333226a8bf0ac6321b565cb00b
f54962f10ab4137d15ece9d55019774023b4fbb4
refs/heads/master
2021-06-17T13:37:21.961147
2017-04-10T06:56:15
2017-04-10T06:56:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,667
java
package com.dismas.imaya.sqlite; import android.app.Activity; import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; /** * Created by imaya on 7/5/16. */ public class SignupActivity extends Activity { EditText editTextUserName,editTextPassword,editTextConfirmPassword; Button btnCreateAccount; LoginDataBaseAdapter loginDataBaseAdapter; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_signup); // get Instance of Database Adapter loginDataBaseAdapter=new LoginDataBaseAdapter(this); loginDataBaseAdapter=loginDataBaseAdapter.open(); // Get Refferences of Views editTextUserName=(EditText)findViewById(R.id.editTextUserName); editTextPassword=(EditText)findViewById(R.id.editTextPassword); editTextConfirmPassword=(EditText)findViewById(R.id.editTextConfirmPassword); btnCreateAccount=(Button)findViewById(R.id.buttonCreateAccount); btnCreateAccount.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { // TODO Auto-generated method stub String userName=editTextUserName.getText().toString(); String password=editTextPassword.getText().toString(); String confirmPassword=editTextConfirmPassword.getText().toString(); // check if any of the fields are vaccant if(userName.equals("")||password.equals("")||confirmPassword.equals("")) { Toast.makeText(getApplicationContext(), "Field Vaccant", Toast.LENGTH_LONG).show(); return; } // check if both password matches if(!password.equals(confirmPassword)) { Toast.makeText(getApplicationContext(), "Password does not match", Toast.LENGTH_LONG).show(); return; } else { // Save the Data in Database loginDataBaseAdapter.insertEntry(userName, password); Toast.makeText(getApplicationContext(), "Account Successfully Created ", Toast.LENGTH_LONG).show(); } } }); } @Override protected void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); loginDataBaseAdapter.close(); } }
[ "imayadismas@gmail.com" ]
imayadismas@gmail.com
1895ff282e4dc7dd4898cada228d2a160ef6d73c
4d6f449339b36b8d4c25d8772212bf6cd339f087
/netreflected/src/Core/System.Net.Sockets,Version=4.2.2.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a/system/net/sockets/UnixDomainSocketEndPoint.java
5cd2efe6ba9d95ef7dcee81a4e9ddc465e0e72aa
[ "MIT" ]
permissive
lvyitian/JCOReflector
299a64550394db3e663567efc6e1996754f6946e
7e420dca504090b817c2fe208e4649804df1c3e1
refs/heads/master
2022-12-07T21:13:06.208025
2020-08-28T09:49:29
2020-08-28T09:49:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,685
java
/* * MIT License * * Copyright (c) 2020 MASES s.r.l. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ /************************************************************************************** * <auto-generated> * This code was generated from a template using JCOReflector * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. * </auto-generated> *************************************************************************************/ package system.net.sockets; import org.mases.jcobridge.*; import org.mases.jcobridge.netreflection.*; import java.util.ArrayList; // Import section import system.net.EndPoint; import system.net.SocketAddress; import system.net.sockets.AddressFamily; /** * The base .NET class managing System.Net.Sockets.UnixDomainSocketEndPoint, System.Net.Sockets, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a. Extends {@link NetObject}. * <p> * * See: <a href="https://docs.microsoft.com/en-us/dotnet/api/System.Net.Sockets.UnixDomainSocketEndPoint" target="_top">https://docs.microsoft.com/en-us/dotnet/api/System.Net.Sockets.UnixDomainSocketEndPoint</a> */ public class UnixDomainSocketEndPoint extends EndPoint { /** * Fully assembly qualified name: System.Net.Sockets, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a */ public static final String assemblyFullName = "System.Net.Sockets, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"; /** * Assembly name: System.Net.Sockets */ public static final String assemblyShortName = "System.Net.Sockets"; /** * Qualified class name: System.Net.Sockets.UnixDomainSocketEndPoint */ public static final String className = "System.Net.Sockets.UnixDomainSocketEndPoint"; static JCOBridge bridge = JCOBridgeInstance.getInstance(assemblyFullName); /** * The type managed from JCOBridge. See {@link JCType} */ public static JCType classType = createType(); static JCEnum enumInstance = null; JCObject classInstance = null; static JCType createType() { try { return bridge.GetType(className + ", " + (JCOBridgeInstance.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName)); } catch (JCException e) { return null; } } void addReference(String ref) throws Throwable { try { bridge.AddReference(ref); } catch (JCNativeException jcne) { throw translateException(jcne); } } public UnixDomainSocketEndPoint(Object instance) throws Throwable { super(instance); if (instance instanceof JCObject) { classInstance = (JCObject) instance; } else throw new Exception("Cannot manage object, it is not a JCObject"); } public String getJCOAssemblyName() { return assemblyFullName; } public String getJCOClassName() { return className; } public String getJCOObjectName() { return className + ", " + (JCOBridgeInstance.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName); } public Object getJCOInstance() { return classInstance; } public void setJCOInstance(JCObject instance) { classInstance = instance; super.setJCOInstance(classInstance); } public JCType getJCOType() { return classType; } /** * Try to cast the {@link IJCOBridgeReflected} instance into {@link UnixDomainSocketEndPoint}, a cast assert is made to check if types are compatible. */ public static UnixDomainSocketEndPoint cast(IJCOBridgeReflected from) throws Throwable { NetType.AssertCast(classType, from); return new UnixDomainSocketEndPoint(from.getJCOInstance()); } // Constructors section public UnixDomainSocketEndPoint() throws Throwable { } public UnixDomainSocketEndPoint(java.lang.String path) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.IndexOutOfRangeException, system.NotSupportedException, system.resources.MissingManifestResourceException, system.ObjectDisposedException, system.OutOfMemoryException, system.FormatException, system.ArrayTypeMismatchException, system.MissingMethodException, system.reflection.TargetInvocationException, system.MissingMemberException { try { // add reference to assemblyName.dll file addReference(JCOBridgeInstance.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName); setJCOInstance((JCObject)classType.NewObject(path)); } catch (JCNativeException jcne) { throw translateException(jcne); } } // Methods section public EndPoint Create(SocketAddress socketAddress) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.IndexOutOfRangeException, system.NotSupportedException, system.ArgumentNullException, system.resources.MissingManifestResourceException, system.ObjectDisposedException, system.InvalidOperationException, system.globalization.CultureNotFoundException, system.PlatformNotSupportedException { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { JCObject objCreate = (JCObject)classInstance.Invoke("Create", socketAddress == null ? null : socketAddress.getJCOInstance()); return new EndPoint(objCreate); } catch (JCNativeException jcne) { throw translateException(jcne); } } public SocketAddress Serialize() throws Throwable, system.ArgumentException, system.IndexOutOfRangeException, system.NotSupportedException, system.ArgumentNullException, system.resources.MissingManifestResourceException, system.InvalidOperationException, system.ArgumentOutOfRangeException, system.globalization.CultureNotFoundException, system.PlatformNotSupportedException { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { JCObject objSerialize = (JCObject)classInstance.Invoke("Serialize"); return new SocketAddress(objSerialize); } catch (JCNativeException jcne) { throw translateException(jcne); } } // Properties section // Instance Events section }
[ "mario.mastrodicasa@masesgroup.com" ]
mario.mastrodicasa@masesgroup.com
64f1f1b21caed139114b1bcbcc2a4cfb58508c52
31665642ed578801e684eb0e71526707416f6c7b
/src/a/y/j/$.java
5f3b442049c00277a4e064fa3ce5af6db27952ad
[]
no_license
calint/a
79fb449e4e9baf4b19da6b1cbf925235254ba981
50c8d03e0115cd52737a0f95e86b9043e731f419
refs/heads/master
2023-02-02T14:30:44.406050
2023-01-29T04:57:04
2023-01-29T04:57:04
32,960,630
0
0
null
null
null
null
UTF-8
Java
false
false
689
java
package a.y.j; import b.*; public class $ extends a{static final long serialVersionUID=1;public void to(final xwriter x)throws Throwable{ x.ax(this).nl(); x.style(s,"width:100%;height:200px;border:1px dotted green").inptxtarea(s); x.nl(); x.pl("java source"); x.style(o,"display:block;width:100%;height:200px;border:1px dotted green").output_holder(o); } synchronized public void x_(final xwriter x,final String q){ final javawriter j=new javawriter(); j.pckg("archive"); j.uses("b","java.util"); j.defpckcls(); j.has("files","index"); j.rend(); j.rendend(); j.xfunc(""); j.xfuncend(); j.clasend(); x.xu(o,j.toString()); } public a s; public a o; }
[ "calin.tenitchi@gmail.com" ]
calin.tenitchi@gmail.com
64c386c4af669be7a02789407b4bfdddf56c0118
180e78725121de49801e34de358c32cf7148b0a2
/dataset/protocol1/spoon/learning/7573/DeclarationSourcePositionImpl.java
be1710b2de4088a8f05f66752502a2ebabeadc31
[]
no_license
ASSERT-KTH/synthetic-checkstyle-error-dataset
40e8d1e0a7ebe7f7711def96a390891a6922f7bd
40c057e1669584bfc6fecf789b5b2854660222f3
refs/heads/master
2023-03-18T12:50:55.410343
2019-01-25T09:54:39
2019-01-25T09:54:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,539
java
/** * Copyright (C) 2006-2018 INRIA and contributors * Spoon - http://spoon.gforge.inria.fr/ * * This software is governed by the CeCILL-C License under French law and * abiding by the rules of distribution of free software. You can use, modify * and/or redistribute the software under the terms of the CeCILL-C license as * circulated by CEA, CNRS and INRIA at http://www.cecill.info. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the CeCILL-C License for more details. * * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ package spoon.support.reflect.cu.position; import spoon.reflect.cu.CompilationUnit; import spoon.reflect.cu.position.DeclarationSourcePosition; import java.io.Serializable; /** * This class represents the position of a Java program element in a source * file. */ public class DeclarationSourcePositionImpl extends CompoundSourcePositionImpl implements DeclarationSourcePosition, Serializable { private static final long serialVersionUID = 1L; private int modifierSourceEnd; private int modifierSourceStart; public DeclarationSourcePositionImpl(CompilationUnit compilationUnit, int sourceStart, int sourceEnd, int modifierSourceStart, int modifierSourceEnd, int declarationSourceStart, int declarationSourceEnd, int[] lineSeparatorPositions) { super(compilationUnit, sourceStart, sourceEnd, declarationSourceStart, declarationSourceEnd, lineSeparatorPositions); checkArgsAreAscending(declarationSourceStart, modifierSourceStart, modifierSourceEnd + 1, sourceStart, sourceEnd + 1, declarationSourceEnd + 1); this.modifierSourceStart = modifierSourceStart; if (this.modifierSourceStart == 0) { this.modifierSourceStart = declarationSourceStart; } this.modifierSourceEnd = modifierSourceEnd; } @Override public int getModifierSourceStart() { return modifierSourceStart; } public void setModifierSourceEnd(int modifierSourceEnd) { this.modifierSourceEnd = modifierSourceEnd; } @Override public int getModifierSourceEnd() { return modifierSourceEnd; } @Override public String getSourceDetails() { return getFragment(getSourceStart(), getSourceEnd()) + "\nmodifier = " + getFragment(getModifierSourceStart(), getModifierSourceEnd()) +"\nname = " + getFragment(getNameStart(), getNameEnd()); } }
[ "bloriot97@gmail.com" ]
bloriot97@gmail.com
1d455b7f707d6b32390c07492ceb7211cb2ad787
80b287cb9b91c4ae9834af6ea5a7ceb6a5b720e9
/share-util/src/test/java/com/base/util/SHATest.java
b695404884c168dbf545b7ebb664357609491822
[]
no_license
weichanghuan/spring-mycat-demo
be0937a6c92c6447f868217fc66492010746e89f
5cc35402710fb31a1d8d74474f4ab880f871d561
refs/heads/master
2022-12-23T23:24:59.883722
2020-07-23T10:05:41
2020-07-23T10:05:41
158,147,773
6
0
null
2022-12-16T10:50:31
2018-11-19T01:58:19
Java
UTF-8
Java
false
false
7,147
java
package com.base.util; import java.io.File; import org.junit.Assert; import org.junit.Test; /** * SHA工具测试类 */ public class SHATest { @Test public void testHex() throws Exception { String msg = "1"; String sha1Hex = "356A192B7913B04C54574D18C28D46E6395428AB"; String sha256Hex = "6B86B273FF34FCE19D6B804EFF5A3F5747ADA4EAA22F1D49C01E52DDB7875B4B"; String sha512Hex = "4DFF4EA340F0A823F15D3F4F01AB62EAE0E5DA579CCB851F8DB9DFE84C58B2B37B89903A740E1EE172DA793A6E79D560E5F7F9BD058A12A280433ED6FA46510A"; Assert.assertEquals(sha1Hex, SHA.sha1Hex(msg, Charsets.UTF_8)); Assert.assertEquals(sha256Hex, SHA.sha256Hex(msg, Charsets.UTF_8)); Assert.assertEquals(sha512Hex, SHA.sha512Hex(msg, Charsets.UTF_8)); msg = "中国"; String sha1HexGBK = "AFE49B0708A2735778D679F56A8F8CEF993D702D"; String sha256HexGBK = "F2856104A1EF1761186F3FA28AC3A2ED13B44C94708AF9D65D76E709EF10FE61"; String sha512HexGBK = "301826A7CF50368A20EE6F57A0372246D78D16CB0A0926E239C6F6A1C57744FA413C0BA7E360323A481A492F4621D0D8D78CAC9CE76DF6841D547E9029B0051C"; String sha1HexUTF8 = "101806F57C322FB403A9788C4C24B79650D02E77"; String sha256HexUTF8 = "F0E9521611BB290D7B09B8CD14A63C3FE7CBF9A2F4E0090D8238D22403D35182"; String sha512HexUTF8 = "6A169E7D5B7526651086D0D37D6E7686C7E75FF7039D063AD100AEFAB1057A4C1DB1F1E5D088C9585DB1D7531A461AB3F4490CC63809C08CC074574B3FFF759A"; Assert.assertEquals(sha1HexGBK, SHA.sha1Hex(msg, Charsets.GBK)); Assert.assertEquals(sha256HexGBK, SHA.sha256Hex(msg, Charsets.GBK)); Assert.assertEquals(sha512HexGBK, SHA.sha512Hex(msg, Charsets.GBK)); Assert.assertEquals(sha1HexUTF8, SHA.sha1Hex(msg, Charsets.UTF_8)); Assert.assertEquals(sha256HexUTF8, SHA.sha256Hex(msg, Charsets.UTF_8)); Assert.assertEquals(sha512HexUTF8, SHA.sha512Hex(msg, Charsets.UTF_8)); try { SHA.sha1Hex((String) null, Charsets.UTF_8); Assert.fail("Expect exception"); } catch (Exception ex) { } try { SHA.sha256Hex((String) null, Charsets.UTF_8); Assert.fail("Expect exception"); } catch (Exception ex) { } try { SHA.sha512Hex((String) null, Charsets.UTF_8); Assert.fail("Expect exception"); } catch (Exception ex) { } } @Test public void testByte() throws Exception { String msg = "1"; String sha1Hex = "356A192B7913B04C54574D18C28D46E6395428AB"; String sha256Hex = "6B86B273FF34FCE19D6B804EFF5A3F5747ADA4EAA22F1D49C01E52DDB7875B4B"; String sha512Hex = "4DFF4EA340F0A823F15D3F4F01AB62EAE0E5DA579CCB851F8DB9DFE84C58B2B37B89903A740E1EE172DA793A6E79D560E5F7F9BD058A12A280433ED6FA46510A"; byte[] sha1 = ByteUtil.fromHex(sha1Hex); byte[] sha256 = ByteUtil.fromHex(sha256Hex); byte[] sha512 = ByteUtil.fromHex(sha512Hex); Assert.assertArrayEquals(sha1, SHA.sha1(msg.getBytes(Charsets.UTF_8))); Assert.assertArrayEquals(sha256, SHA.sha256(msg.getBytes(Charsets.UTF_8))); Assert.assertArrayEquals(sha512, SHA.sha512(msg.getBytes(Charsets.UTF_8))); msg = "中国"; String sha1HexGBK = "AFE49B0708A2735778D679F56A8F8CEF993D702D"; String sha256HexGBK = "F2856104A1EF1761186F3FA28AC3A2ED13B44C94708AF9D65D76E709EF10FE61"; String sha512HexGBK = "301826A7CF50368A20EE6F57A0372246D78D16CB0A0926E239C6F6A1C57744FA413C0BA7E360323A481A492F4621D0D8D78CAC9CE76DF6841D547E9029B0051C"; String sha1HexUTF8 = "101806F57C322FB403A9788C4C24B79650D02E77"; String sha256HexUTF8 = "F0E9521611BB290D7B09B8CD14A63C3FE7CBF9A2F4E0090D8238D22403D35182"; String sha512HexUTF8 = "6A169E7D5B7526651086D0D37D6E7686C7E75FF7039D063AD100AEFAB1057A4C1DB1F1E5D088C9585DB1D7531A461AB3F4490CC63809C08CC074574B3FFF759A"; byte[] sha1GBK = ByteUtil.fromHex(sha1HexGBK); byte[] sha256GBK = ByteUtil.fromHex(sha256HexGBK); byte[] sha512GBK = ByteUtil.fromHex(sha512HexGBK); byte[] sha1UTF8 = ByteUtil.fromHex(sha1HexUTF8); byte[] sha256UTF8 = ByteUtil.fromHex(sha256HexUTF8); byte[] sha512UTF8 = ByteUtil.fromHex(sha512HexUTF8); Assert.assertArrayEquals(sha1GBK, SHA.sha1(msg.getBytes(Charsets.GBK))); Assert.assertArrayEquals(sha256GBK, SHA.sha256(msg.getBytes(Charsets.GBK))); Assert.assertArrayEquals(sha512GBK, SHA.sha512(msg.getBytes(Charsets.GBK))); Assert.assertArrayEquals(sha1UTF8, SHA.sha1(msg.getBytes(Charsets.UTF_8))); Assert.assertArrayEquals(sha256UTF8, SHA.sha256(msg.getBytes(Charsets.UTF_8))); Assert.assertArrayEquals(sha512UTF8, SHA.sha512(msg.getBytes(Charsets.UTF_8))); try { SHA.sha1((byte[]) null); Assert.fail("Expect exception"); } catch (Exception ex) { } try { SHA.sha256((byte[]) null); Assert.fail("Expect exception"); } catch (Exception ex) { } try { SHA.sha512((byte[]) null); Assert.fail("Expect exception"); } catch (Exception ex) { } } @Test public void testFile() throws Exception { String msg = "中国"; String sha1HexGBK = "AFE49B0708A2735778D679F56A8F8CEF993D702D"; String sha256HexGBK = "F2856104A1EF1761186F3FA28AC3A2ED13B44C94708AF9D65D76E709EF10FE61"; String sha512HexGBK = "301826A7CF50368A20EE6F57A0372246D78D16CB0A0926E239C6F6A1C57744FA413C0BA7E360323A481A492F4621D0D8D78CAC9CE76DF6841D547E9029B0051C"; byte[] sha1GBK = ByteUtil.fromHex(sha1HexGBK); byte[] sha256GBK = ByteUtil.fromHex(sha256HexGBK); byte[] sha512GBK = ByteUtil.fromHex(sha512HexGBK); File file = FileUtil.createTempFile(); FileUtil.writeFile(file, msg.getBytes(Charsets.GBK)); Assert.assertEquals(sha1HexGBK, SHA.sha1Hex(file)); Assert.assertEquals(sha256HexGBK, SHA.sha256Hex(file)); Assert.assertEquals(sha512HexGBK, SHA.sha512Hex(file)); Assert.assertArrayEquals(sha1GBK, SHA.sha1(file)); Assert.assertArrayEquals(sha256GBK, SHA.sha256(file)); Assert.assertArrayEquals(sha512GBK, SHA.sha512(file)); try { SHA.sha1Hex((File) null); Assert.fail("Expect exception"); } catch (Exception ex) { } try { SHA.sha256Hex((File) null); Assert.fail("Expect exception"); } catch (Exception ex) { } try { SHA.sha512Hex((File) null); Assert.fail("Expect exception"); } catch (Exception ex) { } try { SHA.sha1((File) null); Assert.fail("Expect exception"); } catch (Exception ex) { } try { SHA.sha256((File) null); Assert.fail("Expect exception"); } catch (Exception ex) { } try { SHA.sha512((File) null); Assert.fail("Expect exception"); } catch (Exception ex) { } } }
[ "527622102@qq.com" ]
527622102@qq.com
1ef158288f099cf1a1de95e33e2995d1ec084304
53d677a55e4ece8883526738f1c9d00fa6560ff7
/com/tencent/mm/plugin/luggage/natives/a/a$a.java
1bc54a4ca973c525c964d8b085784ea45e3eec52
[]
no_license
0jinxing/wechat-apk-source
544c2d79bfc10261eb36389c1edfdf553d8f312a
f75eefd87e9b9ecf2f76fc6d48dbba8e24afcf3d
refs/heads/master
2020-06-07T20:06:03.580028
2019-06-21T09:17:26
2019-06-21T09:17:26
193,069,132
9
4
null
null
null
null
UTF-8
Java
false
false
630
java
package com.tencent.mm.plugin.luggage.natives.a; import com.tencent.matrix.trace.core.AppMethodBeat; public enum a$a { static { AppMethodBeat.i(116904); ojX = new a("UNDEFINED", 0); ojY = new a("NONE", 1); ojZ = new a("SOLID", 2); oka = new a("DASHED", 3); okb = new a("DOTTED", 4); okc = new a[] { ojX, ojY, ojZ, oka, okb }; AppMethodBeat.o(116904); } } /* Location: C:\Users\Lin\Downloads\dex-tools-2.1-SNAPSHOT\dex-tools-2.1-SNAPSHOT\classes3-dex2jar.jar * Qualified Name: com.tencent.mm.plugin.luggage.natives.a.a.a * JD-Core Version: 0.6.2 */
[ "172601673@qq.com" ]
172601673@qq.com
4daf721cde5969f0bfbff4a503379f1f9a12b18e
40a2c44428a6c3e863498d411d038c75b75d0288
/context/base/src/main/java/org/jboss/ejb3/context/base/BaseSessionInvocationContext.java
b5d35cc27f319feee7544958f6ad4da5d2cecf2a
[]
no_license
wolfc/jboss-ejb3
634dc7f5a401b784d505219b0871547c3d282e46
ef1ce785702e9d7c6892e1cd7d7c9bf247b75908
refs/heads/master
2020-12-25T00:28:00.470069
2011-04-14T06:24:21
2011-04-14T06:24:21
1,222,272
0
0
null
null
null
null
UTF-8
Java
false
false
3,728
java
/* * JBoss, Home of Professional Open Source * Copyright (c) 2010, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This 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 software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.ejb3.context.base; import org.jboss.ejb3.context.spi.SessionBeanComponent; import org.jboss.ejb3.context.spi.SessionContext; import org.jboss.ejb3.context.spi.SessionInvocationContext; import javax.ejb.EJBLocalObject; import javax.ejb.EJBObject; import javax.xml.rpc.handler.MessageContext; import java.lang.reflect.Method; import java.util.concurrent.Future; /** * @author <a href="cdewolf@redhat.com">Carlo de Wolf</a> */ public abstract class BaseSessionInvocationContext extends BaseInvocationContext implements SessionInvocationContext { private Class<?> invokedBusinessInterface; private MessageContext messageContext; private Future future; public BaseSessionInvocationContext(Class<?> invokedBusinessInterface, Method method, Object parameters[]) { super(method, parameters); // might be null for non-EJB3 invocations & lifecycle callbacks this.invokedBusinessInterface = invokedBusinessInterface; } public <T> T getBusinessObject(Class<T> businessInterface) throws IllegalStateException { // we need an instance attached SessionContext ctx = getEJBContext(); return ctx.getComponent().getBusinessObject(ctx, businessInterface); } public SessionContext getEJBContext() { return (SessionContext) super.getEJBContext(); } public EJBLocalObject getEJBLocalObject() throws IllegalStateException { SessionContext ctx = getEJBContext(); return ctx.getComponent().getEJBLocalObject(ctx); } public EJBObject getEJBObject() throws IllegalStateException { SessionContext ctx = getEJBContext(); return ctx.getComponent().getEJBObject(ctx); } public Class<?> getInvokedBusinessInterface() throws IllegalStateException { if(invokedBusinessInterface == null) throw new IllegalStateException("No invoked business interface on " + this); return invokedBusinessInterface; } public SessionBeanComponent getComponent() { // for now return getEJBContext().getComponent(); } public MessageContext getMessageContext() throws IllegalStateException { if(messageContext == null) throw new IllegalStateException("No message context on " + this); return messageContext; } public void setFuture(Future future) { this.future = future; } public void setMessageContext(MessageContext messageContext) { this.messageContext = messageContext; } public boolean wasCancelCalled() throws IllegalStateException { if(future == null) throw new IllegalStateException("No asynchronous invocation in progress"); return future.isCancelled(); } }
[ "cdewolf@redhat.com" ]
cdewolf@redhat.com
e056e7f60f4f541dbff443693a9fe2d0db8103ab
77b7f3b87ef44182c5d0efd42ae1539a9b8ca14c
/src/generated/java/com/turnengine/client/api/local/mobile/GetMobileSetupInfoReturnTypeDataSerializer.java
aad890bcb746dcff0e3460d7f5fc7841fa2a5c69
[]
no_license
robindrew/turnengine-client-api
b4d9e767e9cc8401859758d83b43b0104bce7cd1
5bac91a449ad7f55201ecd64e034706b16578c36
refs/heads/master
2023-03-16T05:59:14.189396
2023-03-08T14:09:24
2023-03-08T14:09:24
232,931,212
0
0
null
null
null
null
UTF-8
Java
false
false
919
java
package com.turnengine.client.api.local.mobile; import com.robindrew.common.io.data.IDataReader; import com.robindrew.common.io.data.IDataWriter; import com.robindrew.common.io.data.serializer.ObjectSerializer; import java.io.IOException; public class GetMobileSetupInfoReturnTypeDataSerializer extends ObjectSerializer<IGetMobileSetupInfo> { public GetMobileSetupInfoReturnTypeDataSerializer() { super(false); } public GetMobileSetupInfoReturnTypeDataSerializer(boolean nullable) { super(nullable); } @Override public IGetMobileSetupInfo readValue(IDataReader reader) throws IOException { long param1 = reader.readLong(); int param2 = reader.readInt(); return new GetMobileSetupInfo(param1, param2); } @Override public void writeValue(IDataWriter writer, IGetMobileSetupInfo object) throws IOException { writer.writeLong(object.getLoginId()); writer.writeInt(object.getInstanceId()); } }
[ "robin.drew@gmail.com" ]
robin.drew@gmail.com
94b8ca205b0822f491ad2933cd020cb1258c0a98
9c5d4e0ca76f2c5a98b353f5de6bdbdce9c86b2c
/src/main/java/com/game/pixeldungeonrewards/effects/Lightning.java
529e8ec9f101240add910d33eefc5ac5ce970bc3
[]
no_license
Cortlandd/PixelDungeonRewards
99d8870105e31378c2e9c4abf2ff635dc03ecc6f
d0e5ac9ebae2f547cfc1e91b7e58500b54a3afb9
refs/heads/master
2021-01-14T09:53:27.039978
2015-11-07T20:56:23
2015-11-07T20:56:23
45,067,861
1
0
null
null
null
null
UTF-8
Java
false
false
3,565
java
/* * Pixel Dungeon * Copyright (C) 2012-2015 Oleg Dolya * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/> */ package com.game.pixeldungeonrewards.effects; import javax.microedition.khronos.opengles.GL10; import android.opengl.GLES20; import com.watabou.noosa.Game; import com.watabou.noosa.Group; import com.watabou.noosa.Image; import com.watabou.noosa.audio.Sample; import com.game.pixeldungeonrewards.Assets; import com.game.pixeldungeonrewards.DungeonTilemap; import com.game.pixeldungeonrewards.levels.Level; import com.watabou.utils.Callback; import com.watabou.utils.Random; public class Lightning extends Group { private static final float DURATION = 0.3f; private float life; private int length; private float[] cx; private float[] cy; private Image[] arcsS; private Image[] arcsE; private Callback callback; public Lightning( int[] cells, int length, Callback callback ) { super(); this.callback = callback; Image proto = Effects.get( Effects.Type.LIGHTNING ); float ox = 0; float oy = proto.height / 2; this.length = length; cx = new float[length]; cy = new float[length]; for (int i=0; i < length; i++) { int c = cells[i]; cx[i] = (c % Level.WIDTH + 0.5f) * DungeonTilemap.SIZE; cy[i] = (c / Level.WIDTH + 0.5f) * DungeonTilemap.SIZE; } arcsS = new Image[length - 1]; arcsE = new Image[length - 1]; for (int i=0; i < length - 1; i++) { Image arc = arcsS[i] = new Image( proto ); arc.x = cx[i] - arc.origin.x; arc.y = cy[i] - arc.origin.y; arc.origin.set( ox, oy ); add( arc ); arc = arcsE[i] = new Image( proto ); arc.origin.set( ox, oy ); add( arc ); } life = DURATION; Sample.INSTANCE.play( Assets.SND_LIGHTNING ); } private static final double A = 180 / Math.PI; @Override public void update() { super.update(); if ((life -= Game.elapsed) < 0) { killAndErase(); if (callback != null) { callback.call(); } } else { float alpha = life / DURATION; for (int i=0; i < length - 1; i++) { float sx = cx[i]; float sy = cy[i]; float ex = cx[i+1]; float ey = cy[i+1]; float x2 = (sx + ex) / 2 + Random.Float( -4, +4 ); float y2 = (sy + ey) / 2 + Random.Float( -4, +4 ); float dx = x2 - sx; float dy = y2 - sy; Image arc = arcsS[i]; arc.am = alpha; arc.angle = (float)(Math.atan2( dy, dx ) * A); arc.scale.x = (float)Math.sqrt( dx * dx + dy * dy ) / arc.width; dx = ex - x2; dy = ey - y2; arc = arcsE[i]; arc.am = alpha; arc.angle = (float)(Math.atan2( dy, dx ) * A); arc.scale.x = (float)Math.sqrt( dx * dx + dy * dy ) / arc.width; arc.x = x2 - arc.origin.x; arc.y = y2 - arc.origin.x; } } } @Override public void draw() { GLES20.glBlendFunc( GL10.GL_SRC_ALPHA, GL10.GL_ONE ); super.draw(); GLES20.glBlendFunc( GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA ); } }
[ "cortland1568@gmail.com" ]
cortland1568@gmail.com
75502c7abe48b1aecf1a2599396f202226fae446
5321081656b15cee17a2f83aedd90c3b1f033338
/javaserver/src/main/java/com/dol/cdf/tools/modelGenerate/util/ExampleFileFilter.java
0096a9b9e32e159150756123f8b152e62de1b06b
[]
no_license
wangxiangtao666/javaserver
f4ac8d38369cbfaebf17dda281a4974f4c7376bf
83d80085a163fa41424ac9d52392f4663443be59
refs/heads/master
2021-05-30T18:49:52.547381
2016-01-22T11:38:37
2016-01-22T11:38:37
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,934
java
package com.dol.cdf.tools.modelGenerate.util; import java.io.File; import java.util.Enumeration; import java.util.Hashtable; import javax.swing.filechooser.FileFilter; public class ExampleFileFilter extends FileFilter { private static String TYPE_UNKNOWN = "Type Unknown"; private static String HIDDEN_FILE = "Hidden File"; private Hashtable filters = null; private String description = null; private String fullDescription = null; private boolean useExtensionsInDescription = true; public ExampleFileFilter() { this.filters = new Hashtable(); } public ExampleFileFilter(String extension) { this(extension, null); } public ExampleFileFilter(String extension, String description) { this(); if (extension != null) addExtension(extension); if (description != null) setDescription(description); } public ExampleFileFilter(String[] filters) { this(filters, null); } public ExampleFileFilter(String[] filters, String description) { this(); for (int i = 0; i < filters.length; i++) { // add filters one by one addExtension(filters[i]); } if (description != null) setDescription(description); } public boolean accept(File f) { if (f != null) { if (f.isDirectory()) { return true; } String extension = getExtension(f); if (extension != null && filters.get(getExtension(f)) != null) { return true; } ; } return false; } public String getExtension(File f) { if (f != null) { String filename = f.getName(); int i = filename.lastIndexOf('.'); if (i > 0 && i < filename.length() - 1) { return filename.substring(i + 1).toLowerCase(); } ; } return null; } public void addExtension(String extension) { if (filters == null) { filters = new Hashtable(5); } filters.put(extension.toLowerCase(), this); fullDescription = null; } public String getDescription() { if (fullDescription == null) { if (description == null || isExtensionListInDescription()) { fullDescription = description == null ? "(" : description + " ("; // build the description from the extension list Enumeration extensions = filters.keys(); if (extensions != null) { fullDescription += "." + (String) extensions.nextElement(); while (extensions.hasMoreElements()) { fullDescription += ", ." + (String) extensions.nextElement(); } } fullDescription += ")"; } else { fullDescription = description; } } return fullDescription; } public void setDescription(String description) { this.description = description; fullDescription = null; } public void setExtensionListInDescription(boolean b) { useExtensionsInDescription = b; fullDescription = null; } public boolean isExtensionListInDescription() { return useExtensionsInDescription; } }
[ "dj2@macmini-dj2.local" ]
dj2@macmini-dj2.local
fa7345888908d01f7d2a52218a84974a72819e07
da3b91e93dacd51d54c6c45a3ceaee3a0fcc9729
/bosphorus-core/src/main/java/org/bosphorus/expression/scalar/executor/logical/OrExecutor.java
1dfb4962b7b9bf09281746edbcc8a82fdca1d9e8
[ "Apache-2.0" ]
permissive
elvis121193/bosphorus
e119778e8bad646e48d130c695af6cecded343a8
d1818f093eebffa422b011be18864c0ea914ff95
refs/heads/master
2020-12-28T23:15:24.187919
2014-12-01T21:07:49
2014-12-01T21:07:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
569
java
package org.bosphorus.expression.scalar.executor.logical; import org.bosphorus.expression.scalar.executor.IScalarExecutor; public class OrExecutor<TInput> implements IScalarExecutor<TInput, Boolean> { private IScalarExecutor<TInput, Boolean> left; private IScalarExecutor<TInput, Boolean> right; public OrExecutor(IScalarExecutor<TInput, Boolean> left, IScalarExecutor<TInput, Boolean> right) { this.left = left; this.right = right; } public Boolean execute(TInput input) throws Exception { return left.execute(input) || right.execute(input); } }
[ "unluonur@gmail.com" ]
unluonur@gmail.com
0e9589bdbcacaa325c09f187d278fc5668732f63
c1116c7ff8314ec43b16d455ee1aea7d8d289943
/enderio-base/src/main/java/crazypants/enderio/base/config/recipes/xml/ItemIntegerAmount.java
469a83f8ef0d7d3f5e664076edd14b189dc7dda3
[ "Unlicense", "CC-BY-NC-3.0", "CC0-1.0", "CC-BY-3.0", "LicenseRef-scancode-public-domain" ]
permissive
FinalCraftMC/EnderIO
71054da73fe329d5d49c9a2c239b4545a8b7ed7b
a173868d1659d511154d9b195cd0d4759164029b
refs/heads/master
2023-04-23T19:20:36.682724
2021-05-10T18:42:24
2021-05-10T18:42:24
298,419,938
0
0
Unlicense
2020-09-26T23:02:13
2020-09-24T23:40:35
null
UTF-8
Java
false
false
826
java
package crazypants.enderio.base.config.recipes.xml; import javax.xml.stream.XMLStreamException; import crazypants.enderio.base.config.recipes.InvalidRecipeConfigException; import crazypants.enderio.base.config.recipes.StaxFactory; public class ItemIntegerAmount extends Item { private int amount = 1; @Override public boolean setAttribute(StaxFactory factory, String name, String value) throws InvalidRecipeConfigException, XMLStreamException { if ("amount".equals(name)) { try { this.amount = Integer.parseInt(value); } catch (NumberFormatException e) { throw new InvalidRecipeConfigException("Invalid value in 'amount': Not a number"); } return true; } return super.setAttribute(factory, name, value); } public int getAmount() { return amount; } }
[ "henry@loenwind.info" ]
henry@loenwind.info
a2ee251c48cdbdeaa7891fddc7012490269dbeb0
c83a2e27a398a8de9cc119ff50ef615530741e7d
/orange-demo-service/application/upms/upms-interface/src/main/java/com/orange/demo/upmsinterface/constant/SysMenuType.java
bd3c813c3ccd6b0cc9efed18508d37b0c9b09579
[]
no_license
BestJex/orange-admin
c8cb7a560b47d83557e24f4bfb5650aa95a40d81
a389e71d5b54c9bd659a15b118a019763ff6299c
refs/heads/master
2023-01-04T05:12:16.286562
2020-10-29T05:45:09
2020-10-29T05:45:09
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,245
java
package com.orange.demo.upmsinterface.constant; import java.util.HashMap; import java.util.Map; /** * 菜单类型常量对象。 * * @author Orange Team * @date 2020-08-08 */ public final class SysMenuType { /** * 目录菜单。 */ public static final int TYPE_DIRECTORY = 0; /** * 普通菜单。 */ public static final int TYPE_MENU = 1; /** * 表单片段类型。 */ public static final int TYPE_UI_FRAGMENT = 2; /** * 按钮类型。 */ public static final int TYPE_BUTTON = 3; private static final Map<Object, String> DICT_MAP = new HashMap<>(4); static { DICT_MAP.put(0, "目录菜单"); DICT_MAP.put(1, "普通菜单"); DICT_MAP.put(2, "表单片段类型"); DICT_MAP.put(3, "按钮类型"); } /** * 判断参数是否为当前常量字典的合法值。 * * @param value 待验证的参数值。 * @return 合法返回true,否则false。 */ public static boolean isValid(Integer value) { return value != null && DICT_MAP.containsKey(value); } /** * 私有构造函数,明确标识该常量类的作用。 */ private SysMenuType() { } }
[ "707344974@qq.com" ]
707344974@qq.com
fc0df61766c7d6a19ed90eda27483724450b9263
4dbbf63c1937a523890390c5ee34e81589f78e5e
/bus-http/src/main/java/org/aoju/bus/http/magic/FileInterceptor.java
e9fce2cc5c276d1250079d341e245a9014cd821d
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
q040407/bus
9b0970b829264899857a5035396ddbb1052e0aac
f10136c6ea472e8886355a76caa331cb607d59ef
refs/heads/master
2022-04-23T10:10:50.686780
2020-04-14T06:43:17
2020-04-14T06:43:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,517
java
/********************************************************************************* * * * The MIT License * * * * Copyright (c) 2015-2020 aoju.org and other contributors. * * * * Permission is hereby granted, free of charge, to any person obtaining a copy * * of this software and associated documentation files (the "Software"), to deal * * in the Software without restriction, including without limitation the rights * * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * * copies of the Software, and to permit persons to whom the Software is * * furnished to do so, subject to the following conditions: * * * * The above copyright notice and this permission notice shall be included in * * all copies or substantial portions of the Software. * * * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * * THE SOFTWARE. * ********************************************************************************/ package org.aoju.bus.http.magic; import org.aoju.bus.core.io.Buffer; import org.aoju.bus.core.io.BufferSource; import org.aoju.bus.core.io.DelegateSource; import org.aoju.bus.core.io.Source; import org.aoju.bus.core.lang.MediaType; import org.aoju.bus.core.utils.IoUtils; import org.aoju.bus.http.Response; import org.aoju.bus.http.bodys.ResponseBody; import org.aoju.bus.http.metric.Interceptor; import java.io.IOException; /** * 请求参数-文件处理 * * @author Kimi Liu * @version 5.8.6 * @since JDK 1.8+ */ public abstract class FileInterceptor implements Interceptor, ProgressListener { @Override public Response intercept(Chain chain) throws IOException { Response rsp = chain.proceed(chain.request()); return rsp.newBuilder() .body(new DownloadFileProgressResponseBody(rsp.body(), this)) .build(); } public abstract void updateProgress(long downloadLenth, long totalLength, boolean isFinish); public static class DownloadFileProgressResponseBody extends ResponseBody { private final ResponseBody body; private final ProgressListener progressListener; private BufferSource bufferedSource; public DownloadFileProgressResponseBody(ResponseBody body, ProgressListener progressListener) { this.body = body; this.progressListener = progressListener; } @Override public MediaType contentType() { return body.contentType(); } @Override public long contentLength() { return body.contentLength(); } @Override public BufferSource source() { if (bufferedSource == null) { bufferedSource = IoUtils.buffer(source(body.source())); } return bufferedSource; } private Source source(Source source) { return new DelegateSource(source) { long downloadLenth = 0L; @Override public long read(Buffer sink, long byteCount) throws IOException { long bytesRead = super.read(sink, byteCount); boolean isFinish = (bytesRead == -1); if (!isFinish) { downloadLenth += bytesRead; } progressListener.updateProgress(downloadLenth, body.contentLength(), isFinish); return bytesRead; } }; } } }
[ "839536@qq.com" ]
839536@qq.com
9c7a1c85b14d9051ffc4dfe968954b63493d708b
1d928c3f90d4a0a9a3919a804597aa0a4aab19a3
/java/hazelcast/2015/12/MapExecuteOnAllKeysMessageTask.java
8d7e8ba08a2d4c6b6ca2b4a3aee6c8581cc30bf0
[]
no_license
rosoareslv/SED99
d8b2ff5811e7f0ffc59be066a5a0349a92cbb845
a062c118f12b93172e31e8ca115ce3f871b64461
refs/heads/main
2023-02-22T21:59:02.703005
2021-01-28T19:40:51
2021-01-28T19:40:51
306,497,459
1
1
null
2020-11-24T20:56:18
2020-10-23T01:18:07
null
UTF-8
Java
false
false
3,589
java
/* * Copyright (c) 2008-2015, Hazelcast, Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.hazelcast.client.impl.protocol.task.map; import com.hazelcast.client.impl.protocol.ClientMessage; import com.hazelcast.client.impl.protocol.codec.MapExecuteOnAllKeysCodec; import com.hazelcast.instance.Node; import com.hazelcast.map.EntryProcessor; import com.hazelcast.map.impl.MapEntries; import com.hazelcast.map.impl.MapService; import com.hazelcast.map.impl.operation.MapOperationProvider; import com.hazelcast.nio.Connection; import com.hazelcast.nio.serialization.Data; import com.hazelcast.security.permission.ActionConstants; import com.hazelcast.security.permission.MapPermission; import com.hazelcast.spi.OperationFactory; import java.security.Permission; import java.util.ArrayList; import java.util.List; import java.util.Map; public class MapExecuteOnAllKeysMessageTask extends AbstractMapAllPartitionsMessageTask<MapExecuteOnAllKeysCodec.RequestParameters> { public MapExecuteOnAllKeysMessageTask(ClientMessage clientMessage, Node node, Connection connection) { super(clientMessage, node, connection); } @Override protected OperationFactory createOperationFactory() { MapOperationProvider operationProvider = getOperationProvider(parameters.name); EntryProcessor entryProcessor = serializationService.toObject(parameters.entryProcessor); return operationProvider.createPartitionWideEntryOperationFactory(parameters.name, entryProcessor); } @Override protected Object reduce(Map<Integer, Object> map) { List<Map.Entry<Data, Data>> dataMap = new ArrayList<Map.Entry<Data, Data>>(); MapService mapService = getService(MapService.SERVICE_NAME); for (Object o : map.values()) { if (o != null) { MapEntries entries = (MapEntries) mapService.getMapServiceContext().toObject(o); for (Map.Entry<Data, Data> entry : entries) { dataMap.add(entry); } } } return dataMap; } @Override protected MapExecuteOnAllKeysCodec.RequestParameters decodeClientMessage(ClientMessage clientMessage) { return MapExecuteOnAllKeysCodec.decodeRequest(clientMessage); } @Override protected ClientMessage encodeResponse(Object response) { return MapExecuteOnAllKeysCodec.encodeResponse((List<Map.Entry<Data, Data>>) response); } @Override public String getServiceName() { return MapService.SERVICE_NAME; } @Override public Permission getRequiredPermission() { return new MapPermission(parameters.name, ActionConstants.ACTION_PUT, ActionConstants.ACTION_REMOVE); } @Override public String getDistributedObjectName() { return parameters.name; } @Override public String getMethodName() { return "executeOnEntries"; } @Override public Object[] getParameters() { return new Object[]{parameters.entryProcessor}; } }
[ "rodrigosoaresilva@gmail.com" ]
rodrigosoaresilva@gmail.com
42e2cb6281231ae79d9e848a2cc432349eea5480
c742cc5d181dd6105a26d586f513177a18e28250
/src/revision/Graph_lc_confusing_number.java
be2f14a1373954455a3eaddb68b61f3a86875975
[]
no_license
gaurirawat/Coding
a5542f71be5da538cc438a8d4070ce4c748ee044
d69fb40befbf9a30774b723fff90ae7cba384f7a
refs/heads/master
2023-02-20T00:33:31.632223
2021-01-22T11:49:14
2021-01-22T11:49:14
275,333,532
1
1
null
null
null
null
UTF-8
Java
false
false
1,003
java
package revision; //https://leetcode.com/problems/confusing-number-ii/submissions/ public class Graph_lc_confusing_number { public int confusingNumberII(int n) { int c = 0; for (long x : new long[]{1 , 8, 6 ,9}) { c += confusingNumberInner(x, n); } return c; } public int confusingNumberInner(long num, int n) { if (num > n) { return 0; } int c = 0; char[] ch = (num + "").toCharArray(); for (int i = 0; i < ch.length; ++i) { if (ch[i] == '6') { ch[i] = '9'; } else if (ch[i] == '9') { ch[i] = '6'; } } StringBuffer sb = new StringBuffer(new String(ch)); sb.reverse(); if (!sb.toString().equals(num + "")) { c++; } for (long x : new long[]{0, 1 , 8, 6 ,9}) { c += confusingNumberInner(num * 10 + x, n); } return c; } }
[ "gaurirawat97@gmail.com" ]
gaurirawat97@gmail.com
78a4dc5eb7c314f0722269991f94e5e13c0e3bd8
a3801b7ba684a275cd1bdafb9929bdfd45b79e32
/gulimall-cart/src/main/java/com/atguigu/gulimall/cart/vo/CartItem.java
885145d940b4081deb8a0062da87eb5d50ba87ff
[]
no_license
Inuyasha-Monster/gulimall
12b6450f517c902c22bd393ac631ff1480093d3f
4aecba6f60a32af9130d6fa902ce5ae7b15d8f4e
refs/heads/master
2023-03-19T23:53:02.444152
2021-03-06T04:26:36
2021-03-06T04:26:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,055
java
package com.atguigu.gulimall.cart.vo; import lombok.Data; import java.math.BigDecimal; import java.util.List; /** * @author 孟享广 * @date 2021-02-03 12:33 下午 * @description 购物车里的每一个购物项 * @Data 不用的原因 * 需要计算的属性必须重新get()的方法,这样才能保证每一次属性都会进行重新计算 */ //为什么不用@Data 因为要自定义一个方法getTotalPrice() //@Data public class CartItem { private Long skuId; //是否被选中 private Boolean check = true; private String title; private String image; //套餐信息 private List<String> skuAttr; //涉及到计算 必须用BigDecimal private BigDecimal price; private Integer count; //总价 private BigDecimal totalPrice; public Long getSkuId() { return skuId; } public void setSkuId(Long skuId) { this.skuId = skuId; } public Boolean getCheck() { return check; } public void setCheck(Boolean check) { this.check = check; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getImage() { return image; } public void setImage(String image) { this.image = image; } public List<String> getSkuAttr() { return skuAttr; } public void setSkuAttr(List<String> skuAttr) { this.skuAttr = skuAttr; } public BigDecimal getPrice() { return price; } public void setPrice(BigDecimal price) { this.price = price; } public Integer getCount() { return count; } public void setCount(Integer count) { this.count = count; } /** * 计算每一个购物项的总价 */ public BigDecimal getTotalPrice() { return this.price.multiply(new BigDecimal(this.count + "")); } public void setTotalPrice(BigDecimal totalPrice) { this.totalPrice = totalPrice; } }
[ "‘396330646@qq.com’" ]
‘396330646@qq.com’
cb0caf0e1ff7453ee2fe9d67b365b44b6229ba20
a544cb5ab5b1762d720653fa7233b1cfffe5220a
/03.Java Fundamentals/StudentsEnrolledIn2014or2015.java
b6f24aadf20e70af5d73855fa330dfee9adfe2dd
[]
no_license
AtanasYordanov/JavaDB-Frameworks---Hibernate-Spring-Data
ec2c7954ffed8df767d950a0a4e8aff231c185b4
cecd44ee0a6e20f6ea23c7bec5e9f62796a612a5
refs/heads/master
2021-04-03T10:08:36.875455
2018-06-19T07:42:06
2018-06-19T07:42:06
125,184,186
0
1
null
null
null
null
UTF-8
Java
false
false
1,077
java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; import java.util.stream.Collectors; public class StudentsEnrolledIn2014or2015 { public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); Map<String, List<Integer>> students = new LinkedHashMap<>(); String input; while (!"END".equals(input = reader.readLine())) { String[] tokens = input.split(" "); students.putIfAbsent(tokens[0], new ArrayList<>()); for (int i = 1; i < tokens.length; i++) { students.get(tokens[0]).add(Integer.parseInt(tokens[i])); } } students.entrySet().stream() .filter(kvp -> kvp.getKey().endsWith("14") || kvp.getKey().endsWith("15")) .forEach(kvp -> System.out.println(kvp.getValue().stream() .map(Object::toString) .collect(Collectors.joining(" ")))); } }
[ "naskoraist@gmail.com" ]
naskoraist@gmail.com
4cdfd991844fad202f8788ef654d7e3f049af02c
aa15f9df4b59e733b3e7aaf666f4d61311a0d5d1
/src/codeforces/VanyaandTriangles.java
aea6d353114b46ae82edc22632c200b0cf1f8008
[]
no_license
ifhuang/Problems
7a7343b0bb0d2b4af94d35f3b978b2c81b71026b
36fd59f159f416bd9104c1d7f1d250c5bc7f32b8
refs/heads/master
2021-01-17T09:30:08.102953
2016-05-14T12:36:29
2016-05-14T12:36:29
23,748,984
1
1
null
null
null
null
UTF-8
Java
false
false
2,488
java
package codeforces; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.StringTokenizer; public class VanyaandTriangles { static BufferedReader in; static PrintWriter out; static StringTokenizer tok; static void solve() throws Exception { int n = nextInt(); int[] x = new int[n]; int[] y = new int[n]; for (int i = 0; i < n; i++) { x[i] = nextInt(); y[i] = nextInt(); } long ans = (long) n * (n - 1) * (n - 2) / 6; for (int i = 0; i < n; i++) { Map<List<Integer>, Integer> map = new HashMap<>(); for (int j = i + 1; j < n; j++) { int dx = x[j] - x[i]; int dy = y[j] - y[i]; int g = gcd(dx, dy); List<Integer> list = new ArrayList<>(); list.add(dx / g); list.add(dy / g); if (map.containsKey(list)) map.put(list, map.get(list) + 1); else map.put(list, 1); } for (List<Integer> list : map.keySet()) { int m = map.get(list); if (map.get(list) > 1) ans -= (long) m * (m - 1) / 2; } } out.println(ans); } static int gcd(int a, int b) { while (b != 0) { int t = a % b; a = b; b = t; } return a; } public static void main(String args[]) { try { in = new BufferedReader(new InputStreamReader(System.in)); out = new PrintWriter(new OutputStreamWriter(System.out)); solve(); in.close(); out.close(); } catch (Throwable e) { e.printStackTrace(); System.exit(1); } } static int nextInt() throws IOException { return Integer.parseInt(next()); } static int[] nextIntArray(int len, int start) throws IOException { int[] a = new int[len]; for (int i = start; i < len; i++) a[i] = nextInt(); return a; } static long nextLong() throws IOException { return Long.parseLong(next()); } static long[] nextLongArray(int len, int start) throws IOException { long[] a = new long[len]; for (int i = start; i < len; i++) a[i] = nextLong(); return a; } static String next() throws IOException { while (tok == null || !tok.hasMoreTokens()) { tok = new StringTokenizer(in.readLine()); } return tok.nextToken(); } }
[ "ifhuang91@gmail.com" ]
ifhuang91@gmail.com
8c09a570e54a21ba4ef1b07ac25215567f4ac5d3
d1c06c300d1cd258e2385415977e4645b63ab51c
/gecc-weixin/src/main/java/com/glsx/vasp/weixin/modules/controller/WxPayController.java
8684719cf71b71cb9ffff63162bf68b4d017f4bb
[]
no_license
destinyTaoTao/gecc-parent
3bab7b82a390e43c4fbb37c99654c9e6a52adc93
012910502898c5dc5471b4da61946d8c7fbb2a34
refs/heads/master
2021-01-05T13:17:32.480305
2020-02-16T01:47:07
2020-02-16T01:47:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,673
java
package com.glsx.vasp.weixin.modules.controller; import com.github.binarywang.wxpay.bean.notify.WxPayNotifyResponse; import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResult; import com.github.binarywang.wxpay.bean.order.WxPayMpOrderResult; import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderRequest; import com.github.binarywang.wxpay.bean.result.BaseWxPayResult; import com.github.binarywang.wxpay.constant.WxPayConstants; import com.github.binarywang.wxpay.exception.WxPayException; import com.github.binarywang.wxpay.service.WxPayService; import com.glsx.vasp.annotation.AccessNoSession; import com.glsx.vasp.annotation.SysLog; import com.glsx.vasp.framework.components.PropertiesUtils; import com.glsx.vasp.framework.exception.BusinessException; import com.glsx.vasp.framework.web.R; import com.glsx.vasp.utils.IpUtils; import com.glsx.vasp.utils.SnowFlake; import com.glsx.vasp.weixin.modules.model.UnifiedOrderModel; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import me.chanjar.weixin.common.bean.WxJsapiSignature; import me.chanjar.weixin.common.error.WxErrorException; import me.chanjar.weixin.mp.api.WxMpService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; /** * @author liuyf * @ClassName: WxPayController * @Description: * @date 2019年10月23日 */ @Slf4j @AllArgsConstructor @RestController @RequestMapping("weixin") public class WxPayController { @Resource private HttpServletRequest request; @Autowired private WxPayService wxPayService; // @Autowired // private TradingService tradingService; private final WxMpService wxService; @RequestMapping("/config") public R wxJsSdkConfig(@PathVariable String appid, String url) throws WxErrorException { if (!this.wxService.switchover(appid)) { throw new IllegalArgumentException(String.format("未找到对应appid=[%s]的配置,请核实!", appid)); } WxJsapiSignature wxJsapiSignature = wxService.createJsapiSignature(url); return R.ok().data(wxJsapiSignature); } @SysLog @PostMapping("unifiedOrder") public R unifiedOrder(UnifiedOrderModel model) throws WxPayException { // Customer user = getSessionUser(); // if (StringUtils.isNullOrEmpty(user.getWxOpenId())) // throw BusinessException.create(ResultCodeEnum.USER_NOT_FOLLOW_OFFICIAL_ACCOUNT.getCode(), ResultCodeEnum.USER_NOT_FOLLOW_OFFICIAL_ACCOUNT.getMsg()); if (model.getTotalFee() == null || model.getTotalFee() <= 0) throw BusinessException.create("支付金额有误或此订单无需支付"); String notifyUrl = PropertiesUtils.getProperty("wechat.repayment.notifyUrl"); log.info("支付通知url:" + notifyUrl); model.setNotifyUrl(notifyUrl); String tradeFlowNo = "B"+SnowFlake.nextSerialNumber(); String openid = ""; WxPayMpOrderResult result = unifiedOrder(openid, tradeFlowNo, model); //交易记录入库 // TradingFlow tradingFlow = new TradingFlow(); // tradingFlow.setFlowNo(tradeFlowNo); // tradingFlow.setOrderId(model.getOrderId()); // tradingFlow.setBody(model.getBody()); // tradingFlow.setType(0); // tradingFlow.setStatus(0); // tradingFlow.setCreateTime(new Date()); // tradingService.save(tradingFlow); return R.ok().data(result); } /** * 统一订单 * * @param openid * @param tradeFlowNo * @param model * @return * @throws WxPayException */ private WxPayMpOrderResult unifiedOrder(String openid, String tradeFlowNo, UnifiedOrderModel model) throws WxPayException { final WxPayUnifiedOrderRequest unifiedOrderRequest = WxPayUnifiedOrderRequest.newBuilder() .body(model.getBody()) .totalFee(model.getTotalFee()) .spbillCreateIp(IpUtils.getIpAddr(request)) .notifyUrl(model.getNotifyUrl()) .tradeType(WxPayConstants.TradeType.JSAPI) .openid(openid) .outTradeNo(tradeFlowNo) .limitPay(WxPayConstants.LimitPay.NO_CREDIT) .build(); unifiedOrderRequest.setSignType(WxPayConstants.SignType.MD5); return this.wxPayService.createOrder(unifiedOrderRequest); } /** * 微信支付回调接口 * * @return */ @SysLog @AccessNoSession @RequestMapping(value = "callBackWxPay", produces = {"application/xml; charset=UTF-8"}) @ResponseBody public String callBackWxPay(@RequestBody String xmlData) { log.info("================================================开始处理微信支付发送的异步通知"); try { final WxPayOrderNotifyResult result = this.wxPayService.parseOrderNotifyResult(xmlData); //这里是存储我们发起支付时订单号的信息,取出来 String outTradeNo = result.getOutTradeNo(); String payId = result.getTransactionId(); //分转化成元 String totalFee = BaseWxPayResult.fenToYuan(result.getTotalFee()); /** * todo 系统内部业务,修改订单状态之类的 */ //成功后回调微信信息 return WxPayNotifyResponse.success("回调成功!"); } catch (WxPayException e) { e.printStackTrace(); return WxPayNotifyResponse.fail("回调有误!"); } } }
[ "liuyufeng@outlook.com" ]
liuyufeng@outlook.com
8e6e79bd2f33574771c831644217a205e4aac3d7
83d781a9c2ba33fde6df0c6adc3a434afa1a7f82
/MarketFrontend/src/com/newco/marketplace/web/delegatesImpl/provider/ChangePasswordDelegateImpl.java
51bbe6932558b5463b90b70d983624c433298217
[]
no_license
ssriha0/sl-b2b-platform
71ab8ef1f0ccb0a7ad58b18f28a2bf6d5737fcb6
5b4fcafa9edfe4d35c2dcf1659ac30ef58d607a2
refs/heads/master
2023-01-06T18:32:24.623256
2020-11-05T12:23:26
2020-11-05T12:23:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,721
java
package com.newco.marketplace.web.delegatesImpl.provider; import java.util.Map; import com.newco.marketplace.business.iBusiness.provider.ILoginBO; import com.newco.marketplace.vo.provider.ChangePasswordVO; import com.newco.marketplace.web.delegates.provider.IChangePasswordDelegate; import com.newco.marketplace.web.dto.provider.ChangePasswordDto; import com.newco.marketplace.web.utils.ChangePasswordMapper; /** * @author KSudhanshu * */ public class ChangePasswordDelegateImpl implements IChangePasswordDelegate { private ILoginBO iLoginBO; private ChangePasswordMapper changePasswordMapper; // private ChangePasswordVO changePasswordVO; /** * @param loginBO * @param changePasswordMapper * @param changePasswordVO */ public ChangePasswordDelegateImpl(ILoginBO loginBO, ChangePasswordMapper changePasswordMapper) { this.iLoginBO = loginBO; this.changePasswordMapper = changePasswordMapper; // this.changePasswordVO = changePasswordVO; } /* * (non-Javadoc) * * @see com.newco.marketplace.web.delegates.IChangePasswordDelegate#converDtoToVo(com.newco.marketplace.web.dto.ChangePasswordDto, * com.newco.marketplace.vo.ChangePasswordVO) */ public ChangePasswordVO convertDtoToVo(ChangePasswordDto changePasswordDto, ChangePasswordVO changePasswordVO) { return (ChangePasswordVO) changePasswordMapper.convertDTOtoVO( changePasswordDto, changePasswordVO); } /* * (non-Javadoc) * * @see com.newco.marketplace.web.delegates.IChangePasswordDelegate#converVoToDto(com.newco.marketplace.vo.ChangePasswordVO, * com.newco.marketplace.web.dto.ChangePasswordDto) */ public ChangePasswordDto convertVoToDto(ChangePasswordVO changePasswordVO, ChangePasswordDto changePasswordDto) { return (ChangePasswordDto) changePasswordMapper.convertVOtoDTO( changePasswordVO, changePasswordDto); } /* * (non-Javadoc) * * @see com.newco.marketplace.web.delegates.IChangePasswordDelegate#updatePassword(com.newco.marketplace.web.dto.ChangePasswordDto) */ public boolean updatePassword(ChangePasswordDto objChangePasswordDto) throws Exception { ChangePasswordVO changePasswordVO = new ChangePasswordVO(); changePasswordVO = convertDtoToVo(objChangePasswordDto, changePasswordVO); return iLoginBO.updatePassword(changePasswordVO); } /* (non-Javadoc) * @see com.newco.marketplace.web.delegates.ILoginDelegate#getSecretQuestionList() */ public Map getSecretQuestionList() { return iLoginBO.getSecretQuestionList(); } /*public ForgotUsernameDto validateAns(ForgotUsernameDto forgotUsernameDto)throws DelegateException{ LostUsernameVO lostUsernameVO=null; try{ lostUsernameVO=new LostUsernameVO(); if(forgotUsernameDto.getPwdInd()==1) { lostUsernameVO.setUserName(forgotUsernameDto.getUserName()); lostUsernameVO.setPwdInd(forgotUsernameDto.getPwdInd()); lostUsernameVO.setEmailAddress(forgotUsernameDto.getEmail()); lostUsernameVO=(LostUsernameVO)iForgotUsernameBO.validateAns(lostUsernameVO); forgotUsernameDto.setSuccess(lostUsernameVO.getSuccessAns()); } else { lostUsernameVO=(LostUsernameVO)forgetUsernameMapper.convertDTOtoVO(forgotUsernameDto, lostUsernameVO); lostUsernameVO=(LostUsernameVO)iForgotUsernameBO.validateAns(lostUsernameVO); forgotUsernameDto=(ForgotUsernameDto)forgetUsernameMapper.convertVOtoDTO(lostUsernameVO,forgotUsernameDto); } }catch(BusinessServiceException bse){ throw new DelegateException("Exception occured while processing ForgetUsernameDelegateImpl.validateAns()"+bse.getMessage()); } return forgotUsernameDto; }*/ }
[ "Kunal.Pise@transformco.com" ]
Kunal.Pise@transformco.com
bc3e21d5fade62d8d539490c8d78bb7269b002eb
ed42412dc30d219c9cd6d316d032137f0a7724df
/src/main/java/com/builtbroken/worldofboxes/content/block/chest/BlockCBChest.java
e14cdc543f738b678fac310ae66035ace5daaa67
[ "MIT" ]
permissive
BuiltBrokenModding/world-of-boxes
0ea633711c480eb9c716171e82aff13f14a7e7d8
88a9d79110121562bef76db5e4dedbf3ed28d6cb
refs/heads/master
2022-06-28T23:51:30.431713
2022-06-03T14:11:59
2022-06-03T14:11:59
127,164,434
0
0
null
null
null
null
UTF-8
Java
false
false
386
java
package com.builtbroken.worldofboxes.content.block.chest; /** * Minimic of the {@link net.minecraft.block.BlockChest} with visual changes * * @see <a href="https://github.com/BuiltBrokenModding/VoltzEngine/blob/development/license.md">License</a> for what you can and can't do with the code. * Created by Dark(DarkGuardsman, Robert) on 3/30/2018. */ public class BlockCBChest { }
[ "rseifert.phone@gmail.com" ]
rseifert.phone@gmail.com
3c138cbfeecc6b68a7ec32dd6c72c731560bfbfb
c8664fc194971e6e39ba8674b20d88ccfa7663b1
/com/tencent/mm/plugin/ipcall/a/f/e.java
c89fbf9da10dfdfdfd167499266eb4797c7bffcf
[]
no_license
raochuan/wexin1120
b926bc8d4143c4b523ed43e265cd20ef0c89ad40
1eaa71e1e3e7c9f9b9f96db8de56db3dfc4fb4d3
refs/heads/master
2020-05-17T23:57:00.000696
2017-11-03T02:33:27
2017-11-03T02:33:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,835
java
package com.tencent.mm.plugin.ipcall.a.f; import com.tencent.gmtrace.GMTrace; import com.tencent.mm.ac.k; import com.tencent.mm.plugin.ipcall.a.a.a.a; import com.tencent.mm.plugin.ipcall.a.a.c; import com.tencent.mm.plugin.ipcall.a.h; import com.tencent.mm.plugin.ipcall.a.h.a; import com.tencent.mm.protocal.c.atl; public final class e extends com.tencent.mm.plugin.ipcall.a.a.a implements h.a { private h nai; public e() { GMTrace.i(11592519385088L, 86371); this.nai = null; GMTrace.o(11592519385088L, 86371); } public final int Fb() { GMTrace.i(11592787820544L, 86373); GMTrace.o(11592787820544L, 86373); return 8; } public final void a(int paramInt1, int paramInt2, String paramString, k paramk) { GMTrace.i(11593324691456L, 86377); GMTrace.o(11593324691456L, 86377); } public final void a(atl paramatl) { GMTrace.i(11593458909184L, 86378); this.mXc.a(8, paramatl, 0, 0); GMTrace.o(11593458909184L, 86378); } public final int[] aHx() { GMTrace.i(11592653602816L, 86372); GMTrace.o(11592653602816L, 86372); return new int[0]; } public final void aHy() { GMTrace.i(11592922038272L, 86374); this.nai = new h(); this.nai.mWD = this; com.tencent.mm.sdk.b.a.uLm.b(this.nai); GMTrace.o(11592922038272L, 86374); } public final void b(c paramc) { GMTrace.i(11593190473728L, 86376); GMTrace.o(11593190473728L, 86376); } public final void onDestroy() { GMTrace.i(11593056256000L, 86375); com.tencent.mm.sdk.b.a.uLm.c(this.nai); GMTrace.o(11593056256000L, 86375); } } /* Location: /Users/xianghongyan/decompile/dex2jar/classes2-dex2jar.jar!/com/tencent/mm/plugin/ipcall/a/f/e.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "15223790237@139.com" ]
15223790237@139.com
d1d79f5d709cfc3071056360e0fa8dc12bdf6651
8a9b80725a12f3f35e93858de7660c237e424bc9
/src/main/java/vcs/citydb/wfs/util/CacheCleanerWorker.java
26fb96df919c22e907613f5d02a9c910653aa437
[ "Apache-2.0", "LGPL-3.0-only" ]
permissive
3dcitydb/web-feature-service
7ae7d27fe5b25328177f3e9f8e11a53cd35e1754
8dd80723cd46844422e2f8c9ab7e7413690e24d3
refs/heads/master
2022-12-22T11:00:45.535803
2022-12-15T15:35:41
2022-12-15T15:35:41
18,515,903
33
16
Apache-2.0
2022-06-21T05:08:10
2014-04-07T12:19:05
Java
UTF-8
Java
false
false
473
java
package vcs.citydb.wfs.util; import org.citydb.util.concurrent.DefaultWorker; import org.citydb.util.log.Logger; public class CacheCleanerWorker extends DefaultWorker<CacheCleanerWork> { private final Logger log = Logger.getInstance(); @Override public void doWork(CacheCleanerWork work) { try { work.run(); } catch (Exception e) { log.error("Failed to clean cache: " + e.getMessage()); } } @Override public void shutdown() { // nothing to do } }
[ "cnagel@virtualcitysystems.de" ]
cnagel@virtualcitysystems.de
fc5e921314e81da03f2ee7a3729d6e0cfc49b5dc
64bf3bab731b3387dea531fa6ed797623be9c54f
/src/day51/interfaceConcept/InterfaceInsideClass.java
3d7c66971e5c7189b2e4a45c01aa2769851c3517
[]
no_license
kchhipa4u/JavaLearning
01502d87b7accf653cd0bd6cc3967c41f4255f33
53d08a2a98b3a13d0e55ee1c506529c699452337
refs/heads/master
2020-03-28T14:25:51.608928
2018-09-16T16:34:35
2018-09-16T16:34:35
148,486,026
0
0
null
null
null
null
UTF-8
Java
false
false
488
java
package day51.interfaceConcept; class Demo{ interface I3{ public void m3(); } } interface I4{ public void m4(); } interface I5{ public void m5(); } public class InterfaceInsideClass implements Demo.I3, I4, I5 { public static void main(String[] args) { InterfaceInsideClass a = new InterfaceInsideClass(); } @Override public void m3() { System.out.println("Interface inside class example..."); } @Override public void m5() { } @Override public void m4() { } }
[ "kchhipa4u@gmail.com" ]
kchhipa4u@gmail.com
b8891baf96e8183e3a0b3f9b93b882ed4d726c31
1ec8b12e4ec6f0d746e7a74bc7ea96d08aa04451
/src/com/vmware/vim25/NoDiskSpace.java
9dee9f168088ba75ee8ee3bebeb9bbb0296d2d46
[]
no_license
nickdeng1216/Intercloud
b5f76de436a3a112ac177b817199498f77f85160
5a325b943c28a95c8511806147667428fc284254
refs/heads/master
2022-02-23T15:40:16.366847
2019-09-29T12:50:20
2019-09-29T12:50:20
192,634,019
0
1
null
null
null
null
UTF-8
Java
false
false
2,033
java
/*================================================================================ Copyright (c) 2012 Steve Jin. All Rights Reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of VMware, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL VMWARE, INC. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================================================*/ package com.vmware.vim25; /** * @author Steve Jin (http://www.doublecloud.org) * @version 5.1 */ @SuppressWarnings("all") public class NoDiskSpace extends FileFault { public String datastore; public String getDatastore() { return this.datastore; } public void setDatastore(String datastore) { this.datastore=datastore; } }
[ "nickdeng1216@gmail.com" ]
nickdeng1216@gmail.com
764cb797cc650c7e00287e93ef40d6f743ef1621
d96f6e8ac41dee90937b2ebc9dcb1ea17a365654
/src/fi/laverca/ws/MSS_SignaturePortType.java
5da4651bc697b7a8a8fb64057866fe3ca7896c2e
[ "Apache-2.0", "LicenseRef-scancode-other-permissive" ]
permissive
pihvi/laverca
72c7dd46cf313d25ba26ff5c6fed92a827a44ad6
bff80bd21a9c0d30b83dea4e9757baba8269a9af
refs/heads/master
2020-11-26T09:33:33.524058
2011-06-23T10:59:51
2011-06-23T10:59:51
1,940,987
0
0
null
null
null
null
UTF-8
Java
false
false
268
java
package fi.laverca.ws; public interface MSS_SignaturePortType extends java.rmi.Remote { public org.etsi.uri.TS102204.v1_1_2.MSS_SignatureRespType MSS_Signature(org.etsi.uri.TS102204.v1_1_2.MSS_SignatureReqType MSS_SignatureReq) throws java.rmi.RemoteException; }
[ "mikaeljl@8882375b-f798-4923-9e66-ffa807b0447f" ]
mikaeljl@8882375b-f798-4923-9e66-ffa807b0447f
d81411e0579ded54b19d68af6648137c927a2280
7543eb6be4db4124084b6eac0b26131bcdfea563
/sources/com/twitter/sdk/android/core/models/TwitterCollection.java
9a3a467a90fafa8ff91ccba06a9dda6829920752
[]
no_license
n0misain/6-1_source_from_JADX
bea3bc861ba84c62c27231e7bcff6df49e2f21c9
e0e00915f0b376e7c1d0c162bf7d6697153ce7b1
refs/heads/master
2022-07-19T05:28:02.911308
2020-05-17T00:12:26
2020-05-17T00:12:26
264,563,027
0
0
null
null
null
null
UTF-8
Java
false
false
2,188
java
package com.twitter.sdk.android.core.models; import com.google.gson.annotations.SerializedName; import java.util.List; import java.util.Map; public class TwitterCollection { @SerializedName("objects") public final Content contents; @SerializedName("response") public final Metadata metadata; public static final class Content { @SerializedName("tweets") public final Map<Long, Tweet> tweetMap; @SerializedName("users") public final Map<Long, User> userMap; public Content(Map<Long, Tweet> tweetMap, Map<Long, User> userMap) { this.tweetMap = tweetMap; this.userMap = userMap; } } public static final class Metadata { @SerializedName("position") public final Position position; @SerializedName("timeline_id") public final String timelineId; @SerializedName("timeline") public final List<TimelineItem> timelineItems; public static final class Position { @SerializedName("max_position") public final Long maxPosition; @SerializedName("min_position") public final Long minPosition; public Position(Long maxPosition, Long minPosition) { this.maxPosition = maxPosition; this.minPosition = minPosition; } } public Metadata(String timelineId, Position position, List<TimelineItem> timelines) { this.timelineId = timelineId; this.position = position; this.timelineItems = timelines; } } public static class TimelineItem { @SerializedName("tweet") public final TweetItem tweetItem; public static final class TweetItem { @SerializedName("id") public final Long id; public TweetItem(Long id) { this.id = id; } } public TimelineItem(TweetItem tweetItem) { this.tweetItem = tweetItem; } } public TwitterCollection(Content contents, Metadata metadata) { this.contents = contents; this.metadata = metadata; } }
[ "jaycrandell3@gmail.com" ]
jaycrandell3@gmail.com
8413c39fddf9a75eef736b0b8491e54bb90f2184
ac3a7a8d120d4e281431329c8c9d388fcfb94342
/src/test/java/com/leetcode/algorithm/hard/lfucache/LFUCacheTest.java
b9e463920dcffeb05a4fe7c37c828f7d633bf4a3
[ "MIT" ]
permissive
paulxi/LeetCodeJava
c69014c24cda48f80a25227b7ac09c6c5d6cfadc
10b4430629314c7cfedaae02c7dc4c2318ea6256
refs/heads/master
2021-04-03T08:03:16.305484
2021-03-02T06:20:24
2021-03-02T06:20:24
125,126,097
3
3
null
null
null
null
UTF-8
Java
false
false
1,061
java
package com.leetcode.algorithm.hard.lfucache; import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.jupiter.api.Test; public class LFUCacheTest { @Test public void testCase1() { LFUCache cache = new LFUCache(2); cache.put(1, 1); cache.put(2, 2); assertEquals(1, cache.get(1)); // returns 1 cache.put(3, 3); // evicts key 2 assertEquals(-1, cache.get(2)); // returns -1 (not found) assertEquals(3, cache.get(3)); // returns 3 cache.put(4, 4); // evicts key 1 assertEquals(-1, cache.get(1)); // returns -1 (not found) assertEquals(3, cache.get(3)); // returns 3 assertEquals(4, cache.get(4)); // returns 4 } @Test public void testCase2() { LFUCache cache = new LFUCache(3); cache.put(2, 2); cache.put(1, 1); cache.get(2); cache.get(1); cache.get(2); cache.put(3, 3); cache.put(4, 4); cache.get(3); cache.get(2); cache.get(1); cache.get(4); } }
[ "paulxi@gmail.com" ]
paulxi@gmail.com
7924eb7dfea117da842f8acd557911121f210445
00bfe82cc06143d8827559ffa079a66f60008d2f
/javaSourceLearn/src/source/org/omg/CosNaming/NamingContextPackage/AlreadyBoundHolder.java
d98b877338df2423b171659c5e8e35bb63f86e8c
[]
no_license
Zhangeaky/JAVASE
de7680058b491cb25e70284f237364dc67ca4927
2e97e3dbb9019f89356e9386545509726bf16324
refs/heads/master
2023-04-12T02:58:36.605425
2021-05-21T12:36:05
2021-05-21T12:36:05
335,182,265
0
0
null
null
null
null
UTF-8
Java
false
false
1,122
java
package org.omg.CosNaming.NamingContextPackage; /** * org/omg/CosNaming/NamingContextPackage/AlreadyBoundHolder.java . * Generated by the IDL-to-Java compiler (portable), version "3.2" * from /scratch/jenkins/workspace/8-2-build-linux-amd64/jdk8u281/880/corba/src/share/classes/org/omg/CosNaming/nameservice.idl * Wednesday, December 9, 2020 12:38:46 PM GMT */ public final class AlreadyBoundHolder implements org.omg.CORBA.portable.Streamable { public org.omg.CosNaming.NamingContextPackage.AlreadyBound value = null; public AlreadyBoundHolder () { } public AlreadyBoundHolder (org.omg.CosNaming.NamingContextPackage.AlreadyBound initialValue) { value = initialValue; } public void _read (org.omg.CORBA.portable.InputStream i) { value = org.omg.CosNaming.NamingContextPackage.AlreadyBoundHelper.read (i); } public void _write (org.omg.CORBA.portable.OutputStream o) { org.omg.CosNaming.NamingContextPackage.AlreadyBoundHelper.write (o, value); } public org.omg.CORBA.TypeCode _type () { return org.omg.CosNaming.NamingContextPackage.AlreadyBoundHelper.type (); } }
[ "zyk090104@163.com" ]
zyk090104@163.com
d6415b7e2b34b5bf77cf50b495dc03fc9b49dfe3
7c614d51bbcf90dad37720f1cd851b1f293c1587
/simplehbase/simplehbase/src/main/java/com/alipay/simplehbase/hql/node/binary/IsNotEqualNodeHandler.java
cc0db6d6093dfa8c20a0a7682674669b00a38723
[]
no_license
xingzhixi/simplehbase
66b8dc8415b04463515c7818658f2e363929d45e
1ebfe57340df6b54ef33c1496b050bfc2c644476
refs/heads/master
2021-01-20T16:39:18.149016
2014-01-06T10:54:25
2014-01-06T10:54:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
396
java
package com.alipay.simplehbase.hql.node.binary; import org.w3c.dom.Node; import com.alipay.simplehbase.hql.HQLNode; public class IsNotEqualNodeHandler extends BinaryNodeHandler { @Override public HQLNode handle(Node node) { IsNotEqualNode isNotEqualNode = new IsNotEqualNode(); super.handle(isNotEqualNode, node); return isNotEqualNode; } }
[ "xinzhi.zhang@alipay.com" ]
xinzhi.zhang@alipay.com
b7305fad58709e8b570c8c2cea648cf001f4fbb0
9141145330d75e28a48965552fcc1302e567002c
/toop-commons/src/test/java/eu/toop/commons/usecase/EToopEntityTest.java
531076913cfc9bc29d109ec8ddcffcce80ed0ff5
[ "Apache-2.0" ]
permissive
zigc/toop-commons
a5c47f413274a3c615aa23ed4b1e01575e93735e
0cf6bfbd0490a4a6f4921eaa3688b7239216bcfd
refs/heads/master
2020-07-29T11:40:09.151433
2019-09-20T12:15:45
2019-09-20T12:32:47
209,785,894
0
0
Apache-2.0
2019-09-20T12:30:01
2019-09-20T12:30:00
null
UTF-8
Java
false
false
1,161
java
/** * Copyright (C) 2018-2019 toop.eu * * 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 eu.toop.commons.usecase; import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; import org.junit.Test; import com.helger.commons.string.StringHelper; /** * Test class for class {@link EToopEntityType}. * * @author Philip Helger */ public final class EToopEntityTest { @Test public void testBasic () { for (final EToopEntityType e : EToopEntityType.values ()) { assertTrue (StringHelper.hasText (e.getID ())); assertSame (e, EToopEntityType.getFromIDOrNull (e.getID ())); } } }
[ "philip@helger.com" ]
philip@helger.com
6cfa37adf2eeab61454a0761d29439f6e3dbb026
340244f649995da96ea7b079c78a31b6302c4504
/trunk/org.openebiz.dao/src/org/openebiz/dao/common/cbc/PackingMaterialTypeDAO.java
dd25bacc7bae0f2e5f0d2a01d55ff37d95dc16cf
[]
no_license
BackupTheBerlios/openebiz-svn
6be3506ba0f5068a69459e6f093917699af50708
f83946dab9371d17ffbc0ec43fe157e4544d97fe
refs/heads/master
2020-04-18T01:46:26.607391
2009-03-08T17:23:20
2009-03-08T17:23:20
40,749,474
0
1
null
null
null
null
UTF-8
Java
false
false
2,010
java
package org.openebiz.dao.common.cbc; import java.util.Set; import java.util.HashSet; import java.util.List; import java.util.Iterator; import org.openebiz.core.common.cbc.PackingMaterialType; public interface PackingMaterialTypeDAO { public static class SearchCriteria { Long internalId; Integer version; String value; String languageID; int startFrom; int maxResults; Set<String> ascending; Set<String> descending; public Long getInternalId() { return this.internalId; } public void setInternalId(Long value) { this.internalId = value; } public Integer getVersion() { return this.version; } public void setVersion(Integer value) { this.version = value; } public String getValue() { return this.value; } public void setValue(String value) { this.value = value; } public String getLanguageID() { return this.languageID; } public void setLanguageID(String value) { this.languageID = value; } public void addAscendingOrder(String propertyName) { if (ascending == null) ascending = new HashSet<String>(); ascending.add(propertyName); if ((descending != null) && (descending.contains(propertyName))) descending.remove(propertyName); } public void addDescendingOrder(String propertyName) { if (descending == null) descending = new HashSet<String>(); descending.add(propertyName); if ((ascending != null) && (ascending.contains(propertyName))) ascending.remove(propertyName); } } public List getAll(); public Iterator iterateAll(); public PackingMaterialType getById(Long id); public List findByCriteria(SearchCriteria criteria); public void insert(PackingMaterialType value); public void update(PackingMaterialType value); public PackingMaterialType merge(PackingMaterialType value); public void delete(PackingMaterialType value); public void delete(Long id); }
[ "wukunlun@3b9d58ea-9e0c-0410-94fd-f833e57fda8f" ]
wukunlun@3b9d58ea-9e0c-0410-94fd-f833e57fda8f
d5220cfc80a894baaa89975e391244b0a5f71684
d77964aa24cfdca837fc13bf424c1d0dce9c70b9
/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/influx/InfluxDbHealthIndicator.java
8a0a2dfadea573b524d30b5e0b728df675297976
[]
no_license
Suryakanta97/Springboot-Project
005b230c7ebcd2278125c7b731a01edf4354da07
50f29dcd6cea0c2bc6501a5d9b2c56edc6932d62
refs/heads/master
2023-01-09T16:38:01.679446
2018-02-04T01:22:03
2018-02-04T01:22:03
119,914,501
0
1
null
2022-12-27T14:52:20
2018-02-02T01:21:45
Java
UTF-8
Java
false
false
1,563
java
/* * Copyright 2012-2017 the original author or 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 org.springframework.boot.actuate.influx; import org.influxdb.InfluxDB; import org.influxdb.dto.Pong; import org.springframework.boot.actuate.health.AbstractHealthIndicator; import org.springframework.boot.actuate.health.Health; import org.springframework.boot.actuate.health.HealthIndicator; import org.springframework.util.Assert; /** * {@link HealthIndicator} for InfluxDB. * * @author Eddú Meléndez * @since 2.0.0 */ public class InfluxDbHealthIndicator extends AbstractHealthIndicator { private final InfluxDB influxDb; public InfluxDbHealthIndicator(InfluxDB influxDb) { super("InfluxDB health check failed"); Assert.notNull(influxDb, "InfluxDB must not be null"); this.influxDb = influxDb; } @Override protected void doHealthCheck(Health.Builder builder) { Pong pong = this.influxDb.ping(); builder.up().withDetail("version", pong.getVersion()); } }
[ "suryakanta97@github.com" ]
suryakanta97@github.com
8e94a37c4b9a844d4d3452303a69ef547586ead5
a0cb1fbae37e82130830c9e5f6a17bd9b43708c3
/app/src/main/java/com/zxing/camera/CameraConfigurationManager.java
6a3cd26d40a7a332ef1d88a4f4a89810ac7d28c1
[]
no_license
KrisQin/ScanCodeDemo
df4805e0f90f5f38731acae740d1eb28ad1520a1
b26d6e7928e2fc34d61caba78acccbff99960626
refs/heads/master
2022-04-23T04:33:25.232180
2020-04-24T09:34:24
2020-04-24T09:34:24
258,460,573
0
0
null
null
null
null
UTF-8
Java
false
false
7,654
java
/* * Copyright (C) 2008 ZXing 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 com.zxing.camera; import android.annotation.SuppressLint; import android.content.Context; import android.graphics.Point; import android.hardware.Camera; import android.util.Log; import android.view.Display; import android.view.WindowManager; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.Iterator; import java.util.List; /** * * 邮箱: 1076559197@qq.com | tauchen1990@gmail.com * * 作者: 陈涛 * * 日期: 2014年8月20日 * * 描述: 该类主要负责设置相机的参数信息,获取最佳的预览界面 * */ public final class CameraConfigurationManager { static final String TAG = "CameraConfiguration"; static final int MIN_PREVIEW_PIXELS = 480 * 320; static final double MAX_ASPECT_DISTORTION = 0.15; final Context context; // 屏幕分辨率 Point screenResolution; // 相机分辨率 Point cameraResolution; public CameraConfigurationManager(Context context) { this.context = context; } public void initFromCameraParameters(Camera camera) { Camera.Parameters parameters = camera.getParameters(); WindowManager manager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); Display display = manager.getDefaultDisplay(); Point theScreenResolution = new Point(); theScreenResolution = getDisplaySize(display); screenResolution = theScreenResolution; Log.i(TAG, "Screen resolution: " + screenResolution); /** 因为换成了竖屏显示,所以不替换屏幕宽高得出的预览图是变形的 */ Point screenResolutionForCamera = new Point(); screenResolutionForCamera.x = screenResolution.x; screenResolutionForCamera.y = screenResolution.y; if (screenResolution.x < screenResolution.y) { screenResolutionForCamera.x = screenResolution.y; screenResolutionForCamera.y = screenResolution.x; } cameraResolution = findBestPreviewSizeValue(parameters, screenResolutionForCamera); Log.i(TAG, "Camera resolution x: " + cameraResolution.x); Log.i(TAG, "Camera resolution y: " + cameraResolution.y); } @SuppressWarnings("deprecation") @SuppressLint("NewApi") Point getDisplaySize(final Display display) { final Point point = new Point(); try { display.getSize(point); } catch (NoSuchMethodError ignore) { point.x = display.getWidth(); point.y = display.getHeight(); } return point; } public void setDesiredCameraParameters(Camera camera, boolean safeMode) { Camera.Parameters parameters = camera.getParameters(); if (parameters == null) { Log.w(TAG, "Device error: no camera parameters are available. Proceeding without configuration."); return; } Log.i(TAG, "Initial camera parameters: " + parameters.flatten()); if (safeMode) { Log.w(TAG, "In camera config safe mode -- most settings will not be honored"); } parameters.setPreviewSize(cameraResolution.x, cameraResolution.y); camera.setParameters(parameters); Camera.Parameters afterParameters = camera.getParameters(); Camera.Size afterSize = afterParameters.getPreviewSize(); if (afterSize != null && (cameraResolution.x != afterSize.width || cameraResolution.y != afterSize.height)) { Log.w(TAG, "Camera said it supported preview size " + cameraResolution.x + 'x' + cameraResolution.y + ", but after setting it, preview size is " + afterSize.width + 'x' + afterSize.height); cameraResolution.x = afterSize.width; cameraResolution.y = afterSize.height; } /** 设置相机预览为竖屏 */ camera.setDisplayOrientation(90); } public Point getCameraResolution() { return cameraResolution; } public Point getScreenResolution() { return screenResolution; } /** * 从相机支持的分辨率中计算出最适合的预览界面尺寸 * * @param parameters * @param screenResolution * @return */ Point findBestPreviewSizeValue(Camera.Parameters parameters, Point screenResolution) { List<Camera.Size> rawSupportedSizes = parameters.getSupportedPreviewSizes(); if (rawSupportedSizes == null) { Log.w(TAG, "Device returned no supported preview sizes; using default"); Camera.Size defaultSize = parameters.getPreviewSize(); return new Point(defaultSize.width, defaultSize.height); } // Sort by size, descending List<Camera.Size> supportedPreviewSizes = new ArrayList<Camera.Size>(rawSupportedSizes); Collections.sort(supportedPreviewSizes, new Comparator<Camera.Size>() { @Override public int compare(Camera.Size a, Camera.Size b) { int aPixels = a.height * a.width; int bPixels = b.height * b.width; if (bPixels < aPixels) { return -1; } if (bPixels > aPixels) { return 1; } return 0; } }); if (Log.isLoggable(TAG, Log.INFO)) { StringBuilder previewSizesString = new StringBuilder(); for (Camera.Size supportedPreviewSize : supportedPreviewSizes) { previewSizesString.append(supportedPreviewSize.width).append('x').append(supportedPreviewSize.height).append(' '); } Log.i(TAG, "Supported preview sizes: " + previewSizesString); } double screenAspectRatio = (double) screenResolution.x / (double) screenResolution.y; // Remove sizes that are unsuitable Iterator<Camera.Size> it = supportedPreviewSizes.iterator(); while (it.hasNext()) { Camera.Size supportedPreviewSize = it.next(); int realWidth = supportedPreviewSize.width; int realHeight = supportedPreviewSize.height; if (realWidth * realHeight < MIN_PREVIEW_PIXELS) { it.remove(); continue; } boolean isCandidatePortrait = realWidth < realHeight; int maybeFlippedWidth = isCandidatePortrait ? realHeight : realWidth; int maybeFlippedHeight = isCandidatePortrait ? realWidth : realHeight; double aspectRatio = (double) maybeFlippedWidth / (double) maybeFlippedHeight; double distortion = Math.abs(aspectRatio - screenAspectRatio); if (distortion > MAX_ASPECT_DISTORTION) { it.remove(); continue; } if (maybeFlippedWidth == screenResolution.x && maybeFlippedHeight == screenResolution.y) { Point exactPoint = new Point(realWidth, realHeight); Log.i(TAG, "Found preview size exactly matching screen size: " + exactPoint); return exactPoint; } } // If no exact match, use largest preview size. This was not a great // idea on older devices because // of the additional computation needed. We're likely to get here on // newer Android 4+ devices, where // the CPU is much more powerful. if (!supportedPreviewSizes.isEmpty()) { Camera.Size largestPreview = supportedPreviewSizes.get(0); Point largestSize = new Point(largestPreview.width, largestPreview.height); Log.i(TAG, "Using largest suitable preview size: " + largestSize); return largestSize; } // If there is nothing at shouquan_ic_all suitable, return current preview size Camera.Size defaultPreview = parameters.getPreviewSize(); Point defaultSize = new Point(defaultPreview.width, defaultPreview.height); Log.i(TAG, "No suitable preview sizes, using default: " + defaultSize); return defaultSize; } }
[ "qmdluck@163.com" ]
qmdluck@163.com
b9bfae5e63c513d07a3807f8ac1d1d31108dce67
819fd4177e006b69864f7b4dc18a0a5ecd3308c1
/bundles/sirix-core/src/main/java/org/sirix/io/file/FileWriter.java
0efe0804a6b75e3165d1cbede03ff8974c83b9ad
[ "BSD-3-Clause", "LicenseRef-scancode-public-domain" ]
permissive
bark/sirix
d57e4db157cb0d63d0c80babb8887668ce724331
188fa95725aaf715abdf5b0f54ac76d9f2123eaf
refs/heads/master
2021-01-15T12:48:57.768369
2014-04-15T12:24:00
2014-04-15T12:24:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,423
java
/** * Copyright (c) 2011, University of Konstanz, Distributed Systems Group * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the University of Konstanz nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> 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 org.sirix.io.file; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.io.RandomAccessFile; import java.nio.ByteBuffer; import org.sirix.exception.SirixIOException; import org.sirix.io.AbstractForwardingReader; import org.sirix.io.Reader; import org.sirix.io.Writer; import org.sirix.io.bytepipe.ByteHandler; import org.sirix.page.PagePersistenter; import org.sirix.page.PageReference; import org.sirix.page.interfaces.Page; import com.google.common.io.ByteStreams; /** * File Writer for providing read/write access for file as a Sirix backend. * * @author Marc Kramis, Seabix * @author Sebastian Graf, University of Konstanz * */ public final class FileWriter extends AbstractForwardingReader implements Writer { /** Random access to work on. */ private final RandomAccessFile mFile; /** {@link FileReader} reference for this writer. */ private final FileReader mReader; /** * Constructor. * * @param storage * the concrete storage * @param handler * the byte handler * @throws SirixIOException * if an I/O error occurs */ public FileWriter(final File storage, final ByteHandler handler) throws SirixIOException { try { mFile = new RandomAccessFile(storage, "rw"); } catch (final FileNotFoundException e) { throw new SirixIOException(e); } mReader = new FileReader(storage, handler); } /** * Write page contained in page reference to storage. * * @param pageReference * page reference to write * @throws SirixIOException * if errors during writing occur */ @Override public void write(final PageReference pageReference) throws SirixIOException { // Perform byte operations. try { // Serialize page. final Page page = pageReference.getPage(); assert page != null; final ByteArrayOutputStream output = new ByteArrayOutputStream(); final DataOutputStream dataOutput = new DataOutputStream( mReader.mByteHandler.serialize(output)); PagePersistenter.serializePage(dataOutput, page); // ByteStreams.copy(new ByteArrayInputStream(output.toByteArray()), // dataOutput); output.close(); dataOutput.close(); final byte[] serializedPage = output.toByteArray(); final byte[] writtenPage = new byte[serializedPage.length + FileReader.OTHER_BEACON]; final ByteBuffer buffer = ByteBuffer.allocate(writtenPage.length); buffer.putInt(serializedPage.length); buffer.put(serializedPage); buffer.position(0); buffer.get(writtenPage, 0, writtenPage.length); // Getting actual offset and appending to the end of the current // file. final long fileSize = mFile.length(); final long offset = fileSize == 0 ? FileReader.FIRST_BEACON : fileSize; mFile.seek(offset); mFile.write(writtenPage); // Remember page coordinates. pageReference.setKey(offset); } catch (final IOException e) { throw new SirixIOException(e); } } @Override public void close() throws SirixIOException { try { if (mFile != null) { mFile.close(); } if (mReader != null) { mReader.close(); } } catch (final IOException e) { throw new SirixIOException(e); } } @Override public void writeFirstReference(final PageReference pageReference) throws SirixIOException { try { write(pageReference); mFile.seek(0); mFile.writeLong(pageReference.getKey()); } catch (final IOException e) { throw new SirixIOException(e); } } @Override protected Reader delegate() { return mReader; } }
[ "lichtenberger.johannes@gmail.com" ]
lichtenberger.johannes@gmail.com
2cb922909dab4c9f3a0005859f00b168703d82c1
eca4a253fe0eba19f60d28363b10c433c57ab7a1
/apps/jacob.docMan/java/jacob/browser/BoBrowser.java
2d3c959d0ed81e78c1cd09ddae75695f3390583f
[]
no_license
freegroup/Open-jACOB
632f20575092516f449591bf6f251772f599e5fc
84f0a6af83876bd21c453132ca6f98a46609f1f4
refs/heads/master
2021-01-10T11:08:03.604819
2015-05-25T10:25:49
2015-05-25T10:25:49
36,183,560
0
0
null
null
null
null
UTF-8
Java
false
false
933
java
/************************************************************************** * Project : jacob.docMan * * THIS IS A GENERATED FILE - DO NOT CHANGE! * *************************************************************************/ package jacob.browser; /** * * * DB alias: <b>bo</b> * **/ public final class BoBrowser { private BoBrowser(){} // the name of the table alias public final static String NAME = "boBrowser"; // All field names of the browser "boBrowser" public final static String browserPkey = "browserPkey"; public final static String browserType = "browserType"; public final static String browserName = "browserName"; public final static String browserDocument_key = "browserDocument_key"; public final static String browserFolder_key = "browserFolder_key"; public final static String browserFavorite_index = "browserFavorite_index"; }
[ "a.herz@freegroup.de" ]
a.herz@freegroup.de
02a8c462736fee81fe3ea4747b72c6cc2ce689bc
40c55bd5aa3888130171024004ee2007d19d08bc
/src/test/java/io/github/jhipster/sample/web/rest/errors/ExceptionTranslatorIntTest.java
f84ec6573e161f2a02c7a89d673211821d9dd93d
[]
no_license
eliasrdrgz/jhipster-sample-app-gradle
771e7ef5fb45ea82ee3826b99bfdeeb33e97ef09
b8af4231e1dcb2b391337a672c8d4314a3da6240
refs/heads/master
2020-04-28T06:29:47.036387
2019-02-28T16:37:33
2019-02-28T16:37:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,676
java
package io.github.jhipster.sample.web.rest.errors; import io.github.jhipster.sample.JhipsterGradleSampleApplicationApp; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.http.MediaType; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.setup.MockMvcBuilders; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; /** * Test class for the ExceptionTranslator controller advice. * * @see ExceptionTranslator */ @RunWith(SpringRunner.class) @SpringBootTest(classes = JhipsterGradleSampleApplicationApp.class) public class ExceptionTranslatorIntTest { @Autowired private ExceptionTranslatorTestController controller; @Autowired private ExceptionTranslator exceptionTranslator; @Autowired private MappingJackson2HttpMessageConverter jacksonMessageConverter; private MockMvc mockMvc; @Before public void setup() { mockMvc = MockMvcBuilders.standaloneSetup(controller) .setControllerAdvice(exceptionTranslator) .setMessageConverters(jacksonMessageConverter) .build(); } @Test public void testConcurrencyFailure() throws Exception { mockMvc.perform(get("/test/concurrency-failure")) .andExpect(status().isConflict()) .andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON)) .andExpect(jsonPath("$.message").value(ErrorConstants.ERR_CONCURRENCY_FAILURE)); } @Test public void testMethodArgumentNotValid() throws Exception { mockMvc.perform(post("/test/method-argument").content("{}").contentType(MediaType.APPLICATION_JSON)) .andExpect(status().isBadRequest()) .andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON)) .andExpect(jsonPath("$.message").value(ErrorConstants.ERR_VALIDATION)) .andExpect(jsonPath("$.fieldErrors.[0].objectName").value("testDTO")) .andExpect(jsonPath("$.fieldErrors.[0].field").value("test")) .andExpect(jsonPath("$.fieldErrors.[0].message").value("NotNull")); } @Test public void testParameterizedError() throws Exception { mockMvc.perform(get("/test/parameterized-error")) .andExpect(status().isBadRequest()) .andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON)) .andExpect(jsonPath("$.message").value("test parameterized error")) .andExpect(jsonPath("$.params.param0").value("param0_value")) .andExpect(jsonPath("$.params.param1").value("param1_value")); } @Test public void testParameterizedError2() throws Exception { mockMvc.perform(get("/test/parameterized-error2")) .andExpect(status().isBadRequest()) .andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON)) .andExpect(jsonPath("$.message").value("test parameterized error")) .andExpect(jsonPath("$.params.foo").value("foo_value")) .andExpect(jsonPath("$.params.bar").value("bar_value")); } @Test public void testMissingServletRequestPartException() throws Exception { mockMvc.perform(get("/test/missing-servlet-request-part")) .andExpect(status().isBadRequest()) .andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON)) .andExpect(jsonPath("$.message").value("error.http.400")); } @Test public void testMissingServletRequestParameterException() throws Exception { mockMvc.perform(get("/test/missing-servlet-request-parameter")) .andExpect(status().isBadRequest()) .andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON)) .andExpect(jsonPath("$.message").value("error.http.400")); } @Test public void testAccessDenied() throws Exception { mockMvc.perform(get("/test/access-denied")) .andExpect(status().isForbidden()) .andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON)) .andExpect(jsonPath("$.message").value("error.http.403")) .andExpect(jsonPath("$.detail").value("test access denied!")); } @Test public void testUnauthorized() throws Exception { mockMvc.perform(get("/test/unauthorized")) .andExpect(status().isUnauthorized()) .andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON)) .andExpect(jsonPath("$.message").value("error.http.401")) .andExpect(jsonPath("$.path").value("/test/unauthorized")) .andExpect(jsonPath("$.detail").value("test authentication failed!")); } @Test public void testMethodNotSupported() throws Exception { mockMvc.perform(post("/test/access-denied")) .andExpect(status().isMethodNotAllowed()) .andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON)) .andExpect(jsonPath("$.message").value("error.http.405")) .andExpect(jsonPath("$.detail").value("Request method 'POST' not supported")); } @Test public void testExceptionWithResponseStatus() throws Exception { mockMvc.perform(get("/test/response-status")) .andExpect(status().isBadRequest()) .andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON)) .andExpect(jsonPath("$.message").value("error.http.400")) .andExpect(jsonPath("$.title").value("test response status")); } @Test public void testInternalServerError() throws Exception { mockMvc.perform(get("/test/internal-server-error")) .andExpect(status().isInternalServerError()) .andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON)) .andExpect(jsonPath("$.message").value("error.http.500")) .andExpect(jsonPath("$.title").value("Internal Server Error")); } }
[ "julien.dubois@gmail.com" ]
julien.dubois@gmail.com
0578cb82955d703c9c7535edabc1c029e9024646
671daf60cdb46250214da19132bb7f21dbc29612
/android/testData/dom/menu/OnClickActivity1Abs_after.java
d0e16fec75f1a7333f58bde159e6d44447840699
[ "Apache-2.0" ]
permissive
JetBrains/android
3732f6fe3ae742182c2684a13ea8a1e6a996c9a1
9aa80ad909cf4b993389510e2c1efb09b8cdb5a0
refs/heads/master
2023-09-01T14:11:56.555718
2023-08-31T16:50:03
2023-08-31T16:53:27
60,701,247
947
255
Apache-2.0
2023-09-05T12:44:24
2016-06-08T13:46:48
Kotlin
UTF-8
Java
false
false
324
java
package p1.p2; import com.actionbarsherlock.view.MenuItem; public class Activity1 extends android.support.v4.app.Watson { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); int n = R.menu.onClickIntention; } public void clickHandler1(MenuItem item) { } }
[ "intellij-monorepo-bot-no-reply@jetbrains.com" ]
intellij-monorepo-bot-no-reply@jetbrains.com
cafa2807c3ed1078e00516defd14f24c3e795e0d
659f2dfa9e5efcb6619aa5bdc087ed127f8c93e4
/sources/modules/rules-engine/src/main/java/com/minsait/onesait/platform/rulesengine/model/OntologyJsonWrapper.java
72958b1fcdeac8d45e118d24b6d318436af7bc41
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
onesaitplatform/onesaitplatform-revolution-the-minspait-crowd
cdb806cbcf5d38d9301a955a88b1e6f540f1be05
09937b4df0317013c2dfd0416cfe1c45090486f8
refs/heads/master
2021-06-17T10:53:26.819575
2019-10-09T14:58:20
2019-10-09T14:58:20
210,382,466
2
1
NOASSERTION
2021-06-04T02:20:29
2019-09-23T14:55:26
Java
UTF-8
Java
false
false
2,654
java
/** * Copyright Indra Soluciones Tecnologías de la Información, S.L.U. * 2013-2019 SPAIN * * 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.minsait.onesait.platform.rulesengine.model; import java.util.HashMap; import java.util.Map; import org.springframework.util.StringUtils; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; import com.minsait.onesait.platform.commons.exception.GenericRuntimeOPException; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import lombok.extern.slf4j.Slf4j; @Slf4j @NoArgsConstructor public class OntologyJsonWrapper { @Setter @Getter private Map<String, Object> json = new HashMap<>(); private final ObjectMapper mapper = new ObjectMapper(); @Getter @Setter private String rootNode; @SuppressWarnings("unchecked") public OntologyJsonWrapper(String jsonString) { try { json = mapper.readValue(jsonString, new TypeReference<Map<String, Object>>() { }); if (json.keySet().size() == 1) { rootNode = json.keySet().iterator().next(); json = (Map<String, Object>) json.values().iterator().next(); } } catch (final Exception e) { log.error("Error deserializing JSON String"); throw new GenericRuntimeOPException("Invalid JSON input"); } } public Object getProperty(String key) { return json.get(key); } public void setProperty(String key, Object value) { json.put(key, value); } public void removeProperty(String key) { json.remove(key); } public void updateProperty(String key, Object value) { removeProperty(key); json.put(key, value); } public void copyInputToOutput(OntologyJsonWrapper input) { setJson(input.getJson()); } public String toJson() { try { if (StringUtils.isEmpty(rootNode)) return mapper.writeValueAsString(json); else { return mapper.writeValueAsString(mapper.createObjectNode().set(rootNode, mapper.valueToTree(json))); } } catch (final JsonProcessingException e) { log.error("Error serializing Ontology Wrapper"); return ""; } } }
[ "danzig6661@gmail.com" ]
danzig6661@gmail.com
e6ca2cefc533355e5b325c6fea946bac0929580a
ade84481badcf59304b889e36c5d6e36bbc97376
/app/src/main/java/opensource/haptik/task/ui/base/RecyclerItemClickListener.java
a84c202b28a408a79282d4537bd35b6668b5fcd6
[]
no_license
therajanmaurya/Material-Chat
713fc4c1a8f5e76fd71fccbaaa5d85cc5913d377
c708becbda48f9544bf53c6600a156f5908fa8f7
refs/heads/master
2021-01-12T05:03:03.129183
2017-01-12T21:10:20
2017-01-12T21:10:20
77,839,199
1
0
null
null
null
null
UTF-8
Java
false
false
3,613
java
package opensource.haptik.task.ui.base; import android.content.Context; import android.support.annotation.Nullable; import android.support.v7.widget.RecyclerView; import android.view.GestureDetector; import android.view.MotionEvent; import android.view.View; public class RecyclerItemClickListener implements RecyclerView.OnItemTouchListener { protected OnItemClickListener listener; private GestureDetector gestureDetector; @Nullable private View childView; private int childViewPosition; public RecyclerItemClickListener(Context context, OnItemClickListener listener) { this.gestureDetector = new GestureDetector(context, new GestureListener()); this.listener = listener; } @Override public boolean onInterceptTouchEvent(RecyclerView view, MotionEvent event) { childView = view.findChildViewUnder(event.getX(), event.getY()); childViewPosition = view.getChildAdapterPosition(childView); return childView != null && gestureDetector.onTouchEvent(event); } @Override public void onTouchEvent(RecyclerView view, MotionEvent event) { // Not needed. } @Override public void onRequestDisallowInterceptTouchEvent(boolean disallowIntercept) { } /** * A click listener for items. */ public interface OnItemClickListener { /** * Called when an item is clicked. * * @param childView View of the item that was clicked. * @param position Position of the item that was clicked. */ public void onItemClick(View childView, int position); /** * Called when an item is long pressed. * * @param childView View of the item that was long pressed. * @param position Position of the item that was long pressed. */ public void onItemLongPress(View childView, int position); } /** * A simple click listener whose methods can be overridden one by one. */ public abstract static class SimpleOnItemClickListener implements OnItemClickListener { /** * Called when an item is clicked. The default implementation is a no-op. * * @param childView View of the item that was clicked. * @param position Position of the item that was clicked. */ public void onItemClick(View childView, int position) { // Do nothing. } /** * Called when an item is long pressed. The default implementation is a no-op. * * @param childView View of the item that was long pressed. * @param position Position of the item that was long pressed. */ public void onItemLongPress(View childView, int position) { // Do nothing. } } protected class GestureListener extends GestureDetector.SimpleOnGestureListener { @Override public boolean onSingleTapUp(MotionEvent event) { if (childView != null) { listener.onItemClick(childView, childViewPosition); } return true; } @Override public void onLongPress(MotionEvent event) { if (childView != null) { listener.onItemLongPress(childView, childViewPosition); } } @Override public boolean onDown(MotionEvent event) { // Best practice to always return true here. // http://developer.android.com/training/gestures/detector.html#detect return true; } } }
[ "rajanmaurya154@gmail.com" ]
rajanmaurya154@gmail.com
75bdcb43c05de23771771f904240644da4cf41b1
9e9870bca87d1f7686aa5c03f70666728647b2f2
/src/main/java/com/tatsinktech/web/repository/Notification_ConfRepository.java
277899650af42ecaf21e5e877f5c5c9d0362c34f
[ "MIT" ]
permissive
olivier741/schoolAlert
5abc934a067e7b2f9ae52e14cf1a2851eb78519d
419a24d656bf83e684f3756f380f352b488cbabd
refs/heads/master
2022-11-23T23:50:05.351949
2020-08-05T10:34:50
2020-08-05T10:34:50
285,251,139
0
0
null
null
null
null
UTF-8
Java
false
false
2,101
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.tatsinktech.web.repository; import com.tatsinktech.web.model.register.Command; import com.tatsinktech.web.model.register.Notification_Conf; import java.util.Date; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.PagingAndSortingRepository; import org.springframework.data.repository.query.Param; import org.springframework.stereotype.Repository; import org.springframework.transaction.annotation.Transactional; /** * * @author olivier */ @Repository public interface Notification_ConfRepository extends PagingAndSortingRepository<Notification_Conf, String> { @Transactional @Modifying @Query("DELETE FROM Notification_Conf notifConf WHERE notifConf.command.id = :#{#command.id}") void deleteNotifByCommandName(@Param("command") Command command); Notification_Conf findNotification_ConfById(long id); Notification_Conf findNotification_ConfByNoficationName(String notifName); Page<Notification_Conf> findByIdContainingIgnoreCase(long id, Pageable pageable); Page<Notification_Conf> findByNoficationNameContainingIgnoreCase(String noficationName, Pageable pageable); Page<Notification_Conf> findByNotificationValueContainingIgnoreCase(String notificationValue, Pageable pageable); Page<Notification_Conf> findByDefaultValueContainingIgnoreCase(String defaultValue, Pageable pageable); Page<Notification_Conf> findByDescriptionContainingIgnoreCase(String description, Pageable pageable); Page<Notification_Conf> findByCreateTimeContainingIgnoreCase(Date create_time, Pageable pageable); Page<Notification_Conf> findByUpdateTimeContainingIgnoreCase(Date update_time, Pageable pageable); }
[ "oliviertatsink@gmail.com" ]
oliviertatsink@gmail.com
a20fb9295bb0ebbac4587ef78aa0d7f793041b01
4d37505edab103fd2271623b85041033d225ebcc
/spring-context-support/src/main/java/org/springframework/mail/javamail/MimeMailMessage.java
70c21259c488773b7f29809c7bd40471d55751d0
[ "Apache-2.0" ]
permissive
huifer/spring-framework-read
1799f1f073b65fed78f06993e58879571cc4548f
73528bd85adc306a620eedd82c218094daebe0ee
refs/heads/master
2020-12-08T08:03:17.458500
2020-03-02T05:51:55
2020-03-02T05:51:55
232,931,630
6
2
Apache-2.0
2020-03-02T05:51:57
2020-01-10T00:18:15
Java
UTF-8
Java
false
false
5,045
java
/* * Copyright 2002-2017 the original author or 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.mail.javamail; import java.util.Date; import javax.mail.MessagingException; import javax.mail.internet.MimeMessage; import org.springframework.mail.MailMessage; import org.springframework.mail.MailParseException; /** * Implementation of the MailMessage interface for a JavaMail MIME message, * to let message population code interact with a simple message or a MIME * message through a common interface. * * <p>Uses a MimeMessageHelper underneath. Can either be created with a * MimeMessageHelper instance or with a JavaMail MimeMessage instance. * * @author Juergen Hoeller * @see MimeMessageHelper * @see javax.mail.internet.MimeMessage * @since 1.1.5 */ public class MimeMailMessage implements MailMessage { private final MimeMessageHelper helper; /** * Create a new MimeMailMessage based on the given MimeMessageHelper. * * @param mimeMessageHelper the MimeMessageHelper */ public MimeMailMessage(MimeMessageHelper mimeMessageHelper) { this.helper = mimeMessageHelper; } /** * Create a new MimeMailMessage based on the given JavaMail MimeMessage. * * @param mimeMessage the JavaMail MimeMessage */ public MimeMailMessage(MimeMessage mimeMessage) { this.helper = new MimeMessageHelper(mimeMessage); } /** * Return the MimeMessageHelper that this MimeMailMessage is based on. */ public final MimeMessageHelper getMimeMessageHelper() { return this.helper; } /** * Return the JavaMail MimeMessage that this MimeMailMessage is based on. */ public final MimeMessage getMimeMessage() { return this.helper.getMimeMessage(); } @Override public void setFrom(String from) throws MailParseException { try { this.helper.setFrom(from); } catch (MessagingException ex) { throw new MailParseException(ex); } } @Override public void setReplyTo(String replyTo) throws MailParseException { try { this.helper.setReplyTo(replyTo); } catch (MessagingException ex) { throw new MailParseException(ex); } } @Override public void setTo(String to) throws MailParseException { try { this.helper.setTo(to); } catch (MessagingException ex) { throw new MailParseException(ex); } } @Override public void setTo(String... to) throws MailParseException { try { this.helper.setTo(to); } catch (MessagingException ex) { throw new MailParseException(ex); } } @Override public void setCc(String cc) throws MailParseException { try { this.helper.setCc(cc); } catch (MessagingException ex) { throw new MailParseException(ex); } } @Override public void setCc(String... cc) throws MailParseException { try { this.helper.setCc(cc); } catch (MessagingException ex) { throw new MailParseException(ex); } } @Override public void setBcc(String bcc) throws MailParseException { try { this.helper.setBcc(bcc); } catch (MessagingException ex) { throw new MailParseException(ex); } } @Override public void setBcc(String... bcc) throws MailParseException { try { this.helper.setBcc(bcc); } catch (MessagingException ex) { throw new MailParseException(ex); } } @Override public void setSentDate(Date sentDate) throws MailParseException { try { this.helper.setSentDate(sentDate); } catch (MessagingException ex) { throw new MailParseException(ex); } } @Override public void setSubject(String subject) throws MailParseException { try { this.helper.setSubject(subject); } catch (MessagingException ex) { throw new MailParseException(ex); } } @Override public void setText(String text) throws MailParseException { try { this.helper.setText(text); } catch (MessagingException ex) { throw new MailParseException(ex); } } }
[ "huifer97@163.com" ]
huifer97@163.com
4d5e8d4e05ea58632fd2687758223ca76ed5f81c
76612366815c76ad4e928244299277993edee390
/app/src/main/java/com/oploverz/newanime/oploverz_adapter/LiveTVAdapter.java
12846b3ff2f0ed5753e34395ffcf9c1837aa5d94
[]
no_license
fandofastest/animeagain
9b47c84ea1bbc65484a1af1eebe085547d43538c
3d2e48dcf9885dc454448d6d69e413987030da83
refs/heads/master
2020-12-19T15:13:30.363095
2020-01-31T05:07:11
2020-01-31T05:07:11
235,770,359
0
0
null
null
null
null
UTF-8
Java
false
false
3,308
java
package com.oploverz.newanime.oploverz_adapter; import android.content.Context; import android.content.Intent; import androidx.recyclerview.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; import com.oploverz.newanime.DetailsActivity; import com.oploverz.newanime.R; import com.oploverz.newanime.oploverz_model.CommonModels; import com.oploverz.newanime.oploverz_utl.ItemAnimation; import com.squareup.picasso.Picasso; import java.util.ArrayList; import java.util.List; public class LiveTVAdapter extends RecyclerView.Adapter<LiveTVAdapter.OriginalViewHolder> { private List<CommonModels> items = new ArrayList<>(); private Context ctx; private int lastPosition = -1; private boolean on_attach = true; private int animation_type = 2; public LiveTVAdapter(Context context, List<CommonModels> items) { this.items = items; ctx = context; } @Override public LiveTVAdapter.OriginalViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { LiveTVAdapter.OriginalViewHolder vh; View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.card_live_tv, parent, false); vh = new LiveTVAdapter.OriginalViewHolder(v); return vh; } @Override public void onBindViewHolder(LiveTVAdapter.OriginalViewHolder holder, final int position) { final CommonModels obj = items.get(position); holder.name.setText(obj.getTitle()); Picasso.get().load(obj.getImageUrl()).into(holder.image); holder.lyt_parent.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent=new Intent(ctx, DetailsActivity.class); intent.putExtra("vType",obj.getVideoType()); intent.putExtra("id",obj.getId()); ctx.startActivity(intent); } }); setAnimation(holder.itemView, position); } @Override public int getItemCount() { return items.size(); } public class OriginalViewHolder extends RecyclerView.ViewHolder { public ImageView image; public TextView name; public TextView counter; public View lyt_parent; public OriginalViewHolder(View v) { super(v); image = v.findViewById(R.id.image); name = v.findViewById(R.id.name); lyt_parent = v.findViewById(R.id.lyt_parent); } } @Override public void onAttachedToRecyclerView(RecyclerView recyclerView) { recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { @Override public void onScrollStateChanged(RecyclerView recyclerView, int newState) { on_attach = false; super.onScrollStateChanged(recyclerView, newState); } }); super.onAttachedToRecyclerView(recyclerView); } private void setAnimation(View view, int position) { if (position > lastPosition) { ItemAnimation.animate(view, on_attach ? position : -1, animation_type); lastPosition = position; } } }
[ "fandofast@gmail.com" ]
fandofast@gmail.com
8da426d2519729518c2b81c4ebf96710c5fad92d
3c6384b504492de52edc0e6e8240082711606db2
/src/main/java/microsoft/exchange/webservices/data/misc/AsyncRequestResult.java
09c6bf79c90c3230d3318de06ec31651003a9c76
[ "MIT" ]
permissive
JohanSchulz/ews-java-api
4c8036ecc49ad464b2f959b23f0b19c76e4104f3
637065e428ce01b23abff917e02d5420842a6ddd
refs/heads/master
2020-12-31T02:01:28.982328
2015-07-03T11:36:29
2015-07-03T11:36:29
37,707,454
1
0
null
2015-06-19T07:11:10
2015-06-19T07:11:10
null
UTF-8
Java
false
false
6,122
java
/* * The MIT License * Copyright (c) 2012 Microsoft Corporation * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package microsoft.exchange.webservices.data.misc; import microsoft.exchange.webservices.data.core.EwsUtilities; import microsoft.exchange.webservices.data.core.ExchangeService; import microsoft.exchange.webservices.data.core.exception.misc.ArgumentException; import microsoft.exchange.webservices.data.core.request.HttpWebRequest; import microsoft.exchange.webservices.data.core.request.ServiceRequestBase; import microsoft.exchange.webservices.data.core.request.SimpleServiceRequestBase; import microsoft.exchange.webservices.data.core.request.WaitHandle; import java.util.concurrent.*; public class AsyncRequestResult implements IAsyncResult { ServiceRequestBase serviceRequest; HttpWebRequest webRequest; AsyncCallback wasasyncCallback; IAsyncResult webAsyncResult; Object asyncState; Future<?> task; AsyncRequestResult(Future<?> task) { this.task = task; } public AsyncRequestResult(ServiceRequestBase serviceRequest, HttpWebRequest webRequest, Future<?> task, Object asyncState) throws Exception { EwsUtilities.validateParam(serviceRequest, "serviceRequest"); EwsUtilities.validateParam(webRequest, "webRequest"); EwsUtilities.validateParam(task, "task"); this.serviceRequest = serviceRequest; this.webRequest = webRequest; this.asyncState = asyncState; this.task = task; } public void setServiceRequestBase(ServiceRequestBase serviceRequest) { this.serviceRequest = serviceRequest; } private ServiceRequestBase getServiceRequest() { return this.serviceRequest; } public void setHttpWebRequest(HttpWebRequest webRequest) { this.webRequest = webRequest; } public HttpWebRequest getHttpWebRequest() { return this.webRequest; } public FutureTask<?> getTask() { return (FutureTask<?>) this.task; } public static <T extends SimpleServiceRequestBase> T extractServiceRequest( ExchangeService exchangeService, Future<?> asyncResult) throws Exception { EwsUtilities.validateParam(asyncResult, "asyncResult"); AsyncRequestResult asyncRequestResult = (AsyncRequestResult) asyncResult; if (asyncRequestResult == null) { /** * String.InvalidAsyncResult is copied from the error message * HttpWebRequest.EndGetResponse() Just use this simple string for * all kinds of invalid IAsyncResult parameters. */ throw new ArgumentException("Invalid AsyncResult.", "asyncResult"); } // Validate the serivce request. if (asyncRequestResult.serviceRequest == null) { throw new ArgumentException("Invalid AsyncResult.", "asyncResult"); } // Validate the service object if (!asyncRequestResult.serviceRequest.getService().equals( exchangeService)) { throw new ArgumentException("Invalid AsyncResult.", "asyncResult"); } T serviceRequest = (T) asyncRequestResult.getServiceRequest(); // Validate the request type if (serviceRequest == null) { throw new ArgumentException("Invalid AsyncResult.", "asyncResult"); } return serviceRequest; } @Override public boolean cancel(boolean arg0) { // TODO Auto-generated method stub return false; } @Override public Object get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { // TODO Auto-generated method stub return null; } @Override public boolean isCancelled() { // TODO Auto-generated method stub return false; } @Override public boolean isDone() { // TODO Auto-generated method stub return false; } @Override public Object getAsyncState() { // TODO Auto-generated method stub return null; } @Override public WaitHandle getAsyncWaitHanle() { // TODO Auto-generated method stub return null; } @Override public boolean getCompleteSynchronously() { // TODO Auto-generated method stub return false; } @Override public boolean getIsCompleted() { // TODO Auto-generated method stub return false; } @Override public Object get() throws InterruptedException, ExecutionException { // TODO Auto-generated method stub return this.task.get(); } }
[ "schulz.johan@googlemail.com" ]
schulz.johan@googlemail.com
4faebfc1f231cb4576bbb2302064f539d83cede2
c7696a29b9cfe1a17685d9f784ac64778d118d9a
/src/main/java/com/trm/app/web/rest/errors/EmailNotFoundException.java
534ca1a78fda208619a3135e45b36e72426fcc68
[]
no_license
saieshs/trmapp
51458de08b4714e448e6549f37d7f7c965e1979a
b28483a4aa66c31d6b6d8a51f7a768e16385b5c5
refs/heads/master
2020-03-07T08:58:01.097707
2018-03-30T07:04:30
2018-03-30T07:04:30
127,394,016
0
0
null
null
null
null
UTF-8
Java
false
false
349
java
package com.trm.app.web.rest.errors; import org.zalando.problem.AbstractThrowableProblem; import org.zalando.problem.Status; public class EmailNotFoundException extends AbstractThrowableProblem { public EmailNotFoundException() { super(ErrorConstants.EMAIL_NOT_FOUND_TYPE, "Email address not registered", Status.BAD_REQUEST); } }
[ "jhipster-bot@users.noreply.github.com" ]
jhipster-bot@users.noreply.github.com
39e0aca735132a5f24ab23af58f5037ab3cdf880
66b1888463d701b8ceb16c4abe7d20eaa2745e92
/module_client/src/main/java/com/liany/clientmodel/utils/IpUtils.java
1de955a6f09f65b791cfbb73446d4888482c2cfe
[]
no_license
AitGo/CsiModel
42526c70e83b9a4e3abc8033f7c88b73703a5e49
52049edf360f1c3d775a9f10b054089d7df0cb41
refs/heads/master
2022-12-09T13:42:55.827195
2020-08-31T02:54:20
2020-08-31T02:54:20
284,574,232
0
0
null
null
null
null
UTF-8
Java
false
false
3,260
java
package com.liany.clientmodel.utils; import android.content.Context; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.net.wifi.WifiInfo; import android.net.wifi.WifiManager; import java.net.Inet4Address; import java.net.InetAddress; import java.net.NetworkInterface; import java.net.SocketException; import java.util.Enumeration; /** * @创建者 ly * @创建时间 2020/3/5 * @描述 * @更新者 $ * @更新时间 $ * @更新描述 */ public class IpUtils { public static String getIpAddress(Context context){ NetworkInfo info = ((ConnectivityManager) context .getSystemService(Context.CONNECTIVITY_SERVICE)).getActiveNetworkInfo(); if (info != null && info.isConnected()) { // 3/4g网络 if (info.getType() == ConnectivityManager.TYPE_MOBILE) { try { for (Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements(); ) { NetworkInterface intf = en.nextElement(); for (Enumeration<InetAddress> enumIpAddr = intf.getInetAddresses(); enumIpAddr.hasMoreElements(); ) { InetAddress inetAddress = enumIpAddr.nextElement(); if (!inetAddress.isLoopbackAddress() && inetAddress instanceof Inet4Address) { return inetAddress.getHostAddress(); } } } } catch (SocketException e) { e.printStackTrace(); } } else if (info.getType() == ConnectivityManager.TYPE_WIFI) { // wifi网络 WifiManager wifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE); WifiInfo wifiInfo = wifiManager.getConnectionInfo(); String ipAddress = intIP2StringIP(wifiInfo.getIpAddress()); return ipAddress; } else if (info.getType() == ConnectivityManager.TYPE_ETHERNET){ // 有限网络 return getLocalIp(); } } return null; } private static String intIP2StringIP(int ip) { return (ip & 0xFF) + "." + ((ip >> 8) & 0xFF) + "." + ((ip >> 16) & 0xFF) + "." + (ip >> 24 & 0xFF); } // 获取有限网IP private static String getLocalIp() { try { for (Enumeration<NetworkInterface> en = NetworkInterface .getNetworkInterfaces(); en.hasMoreElements(); ) { NetworkInterface intf = en.nextElement(); for (Enumeration<InetAddress> enumIpAddr = intf .getInetAddresses(); enumIpAddr.hasMoreElements(); ) { InetAddress inetAddress = enumIpAddr.nextElement(); if (!inetAddress.isLoopbackAddress() && inetAddress instanceof Inet4Address) { return inetAddress.getHostAddress(); } } } } catch (SocketException ex) { } return "0.0.0.0"; } }
[ "ly490099@163.com" ]
ly490099@163.com
70094c88916aa66b1bd501e5a3e1ea0e82cb54ae
cf65fd89718f42f05fc5c19b6f988b36cfb5d39f
/lx-enterprise/lx-core/src/main/java/com/lx/core/common/utils/RandomUtil.java
89dceed20da7bb6823938e3dc25fd96cc62f1876
[]
no_license
pandabill/lx
f7c8a225fe6b0f682e09848ef99d455e99fbe1a5
95905ce0a1e76fc6a5b475f74ed91b1a2a598384
refs/heads/master
2022-10-28T12:46:52.649753
2020-01-01T08:03:08
2020-01-01T08:03:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,168
java
package com.lx.core.common.utils; import lombok.extern.slf4j.Slf4j; import java.text.NumberFormat; import java.util.Random; @Slf4j public class RandomUtil { public static String orderCode() { int r1 = (int) (Math.random() * (10));// 产生2个0-9的随机数 int r2 = (int) (Math.random() * (10)); long now = System.currentTimeMillis();// 一个13位的时间戳 String paymentID = String.valueOf(r1) + String.valueOf(r2) + String.valueOf(now);// 订单ID return paymentID; } /** * 生成一个指定长度的随机数, * Lian weimao CreateTime:2018年10月10日 上午11:31:04 * * @param length 范围 [1-15] * @return */ public static String randomNum(int length) { if (length < 1 || length > 15) { throw new IllegalArgumentException(); } Random random = new Random(); double num = (random.nextDouble() + 1) * Math.pow(10, length); NumberFormat nFormat = NumberFormat.getInstance(); nFormat.setGroupingUsed(false); String numStr = nFormat.format(num).substring(1, length + 1); return numStr; } }
[ "zhaowei@sancaijia.com" ]
zhaowei@sancaijia.com
b2dab11e621f24a7e7a9f37f6e7e94638adf2d27
cdbd53ceb24f1643b5957fa99d78b8f4efef455a
/vertx-pin/zero-vie/src/main/java/cn/originx/uca/plugin/semi/AfterNode.java
93a0e7f42cd8082e995c498d7f9a4365ebc7b2dc
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
chundcm/vertx-zero
f3dcb692ae6b9cc4ced52386cab01e5896e69d80
d2a2d096426c30d90be13b162403d66c8e72cc9a
refs/heads/master
2023-04-27T18:41:47.489584
2023-04-23T01:53:40
2023-04-23T01:53:40
244,054,093
0
0
Apache-2.0
2020-02-29T23:00:59
2020-02-29T23:00:58
null
UTF-8
Java
false
false
888
java
package cn.originx.uca.plugin.semi; import cn.originx.scaffold.plugin.AbstractAfter; import cn.originx.uca.graphic.Pixel; import io.vertx.core.Future; import io.vertx.core.json.JsonArray; import io.vertx.core.json.JsonObject; import io.vertx.up.unity.Ux; /** * 图引擎专用处理器 * 节点后置添加 */ public class AfterNode extends AbstractAfter { @Override public Future<JsonObject> afterAsync(final JsonObject record, final JsonObject options) { return Pixel.node(this.operation(options), this.atom.identifier()).drawAsync(record) .compose(processed -> Ux.future(record)); } @Override public Future<JsonArray> afterAsync(final JsonArray records, final JsonObject options) { return Pixel.node(this.operation(options), this.atom.identifier()).drawAsync(records) .compose(processed -> Ux.future(records)); } }
[ "silentbalanceyh@126.com" ]
silentbalanceyh@126.com
16e017fce8b7c05021381d7ce305f24bb63a4012
f9fda95f8621d84973a765fe9cf19604f7079279
/guns-rest/src/test/java/com/stylefeng/guns/jwt/DecryptTest.java
464820a6ecf44c57b9e0e35d45f3af710fa73ffd
[ "Apache-2.0" ]
permissive
BrendaHub/MarchJb-parent
343cebde839014ab1fe01577d8eb3a2334568f08
18b0915aa13e9baa1fc23999cf729b1af9bf8b09
refs/heads/master
2020-03-19T06:21:44.205071
2018-06-04T11:05:54
2018-06-04T11:05:54
136,012,606
0
0
null
null
null
null
UTF-8
Java
false
false
1,227
java
package com.stylefeng.guns.jwt; import com.alibaba.fastjson.JSON; import com.stylefeng.guns.core.util.MD5Util; import com.stylefeng.guns.rest.common.SimpleObject; import com.stylefeng.guns.rest.modular.auth.converter.BaseTransferEntity; import com.stylefeng.guns.rest.modular.auth.security.impl.Base64SecurityAction; /** * jwt测试 * * @author fengshuonan * @date 2017-08-21 16:34 * * // 代码进行了优化, 将所有的参数也进行了加密处理。 */ public class DecryptTest { public static void main(String[] args) { String salt = "w8rxos"; SimpleObject simpleObject = new SimpleObject(); simpleObject.setUser("stylefeng"); simpleObject.setAge(2323); simpleObject.setName("中国Vue.js"); simpleObject.setTips("TooTipS"); String jsonString = JSON.toJSONString(simpleObject); String encode = new Base64SecurityAction().doAction(jsonString); String md5 = MD5Util.encrypt(encode + salt); BaseTransferEntity baseTransferEntity = new BaseTransferEntity(); baseTransferEntity.setObject(encode); baseTransferEntity.setSign(md5); System.out.println(JSON.toJSONString(baseTransferEntity)); } }
[ "13552666934@139.com" ]
13552666934@139.com
c1f140dd4d5fbe8f91a169cca48a9e68f84f6c82
3ef55e152decb43bdd90e3de821ffea1a2ec8f75
/large/module0528_public/tests/unittests/src/java/module0528_public_tests_unittests/a/Foo3.java
e7315e78b353e57cdb68d91a12d3bb2a510f9ebe
[ "BSD-3-Clause" ]
permissive
salesforce/bazel-ls-demo-project
5cc6ef749d65d6626080f3a94239b6a509ef145a
948ed278f87338edd7e40af68b8690ae4f73ebf0
refs/heads/master
2023-06-24T08:06:06.084651
2023-03-14T11:54:29
2023-03-14T11:54:29
241,489,944
0
5
BSD-3-Clause
2023-03-27T11:28:14
2020-02-18T23:30:47
Java
UTF-8
Java
false
false
1,704
java
package module0528_public_tests_unittests.a; import javax.lang.model.*; import javax.management.*; import javax.naming.directory.*; /** * Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut * labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. * Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. * * @see java.nio.file.FileStore * @see java.sql.Array * @see java.util.logging.Filter */ @SuppressWarnings("all") public abstract class Foo3<B> extends module0528_public_tests_unittests.a.Foo2<B> implements module0528_public_tests_unittests.a.IFoo3<B> { java.util.zip.Deflater f0 = null; javax.annotation.processing.Completion f1 = null; javax.lang.model.AnnotatedConstruct f2 = null; public B element; public static Foo3 instance; public static Foo3 getInstance() { return instance; } public static <T> T create(java.util.List<T> input) { return module0528_public_tests_unittests.a.Foo2.create(input); } public String getName() { return module0528_public_tests_unittests.a.Foo2.getInstance().getName(); } public void setName(String string) { module0528_public_tests_unittests.a.Foo2.getInstance().setName(getName()); return; } public B get() { return (B)module0528_public_tests_unittests.a.Foo2.getInstance().get(); } public void set(Object element) { this.element = (B)element; module0528_public_tests_unittests.a.Foo2.getInstance().set(this.element); } public B call() throws Exception { return (B)module0528_public_tests_unittests.a.Foo2.getInstance().call(); } }
[ "gwagenknecht@salesforce.com" ]
gwagenknecht@salesforce.com
fbc8d4a7194fee4ad6f52ab6da9577508c183d1f
6469d35c5381e962abf9d595ae5352dd6d084ffd
/classroom-workspace/spring-mvc-1/src/main/java/com/demo/spring/controller/LoginController.java
5b53b53f6708c82028d1833f83e10d05a6eef738
[]
no_license
balakrishnan18/spring-vdsi
7457e0ad0240db99c4dd81cfecffbcda7bd6ed8a
b30f41c073c4982bc35efd055044b74e0bd68678
refs/heads/master
2020-03-09T16:39:30.552764
2018-03-10T03:38:33
2018-03-10T03:38:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
867
java
package com.demo.spring.controller; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.servlet.ModelAndView; @Controller public class LoginController { @RequestMapping(path = "/login") public String getLoginPage() { return "login"; } @RequestMapping(path = "/login", method = RequestMethod.POST) public ModelAndView processLogin(@RequestParam("userName") String username, @RequestParam("password") String password) { ModelAndView mv = new ModelAndView(); if (username.equals(password)) { mv.setViewName("success"); mv.addObject("user", username); return mv; } else { mv.setViewName("failure"); return mv; } } }
[ "sbtalk@gmail.com" ]
sbtalk@gmail.com
99cf714d4f33d94933a2129904b408ee9fbcb337
ecf54cf9e85c24be08ac3823161d4ea9aef2bf99
/AndroidNews/app/src/main/java/com/jdjz/androidnews/db/VideoChannelTableManager.java
ac2bb281a612f5dfab640648b67a258ea0aee609
[]
no_license
whtchl/AndroidNews_MVP
1fcf808db1d890c8f52cf054c9db31f36d7400e6
49ef6e162b071f8915b510b517ba16e77cd04a78
refs/heads/master
2021-08-24T13:33:07.500920
2017-12-10T01:44:13
2017-12-10T01:44:13
71,891,778
1
0
null
null
null
null
UTF-8
Java
false
false
982
java
package com.jdjz.androidnews.db; import com.jdjz.androidnews.R; import com.jdjz.androidnews.app.AppApplication; import com.jdjz.androidnews.bean.VideoChannelTable; import java.util.ArrayList; import java.util.Arrays; import java.util.List; /** * Created by tchl on 2017-01-16. */ public class VideoChannelTableManager { public static List<VideoChannelTable> loadVideosChannelsMine(){ List<String> channelName = Arrays.asList(AppApplication.getAppContext().getResources().getStringArray(R.array.video_channel_name)); List<String> channelId = Arrays.asList(AppApplication.getAppContext().getResources().getStringArray(R.array.video_channel_id)); List<VideoChannelTable> newsChannelTables = new ArrayList<>(); for(int i=0;i<channelName.size();i++){ VideoChannelTable entity = new VideoChannelTable(channelId.get(i),channelName.get(i)); newsChannelTables.add(entity); } return newsChannelTables; } }
[ "whtchl@126.com" ]
whtchl@126.com
cef4d504a545e8fb2edde63477b41ff5fe6eee14
ce89c500bf7dc4068887f5e21d0bde19ecafbd70
/src/ch19_jdbc/DBTest.java
7a24c050043016385c713f19d3c7feaf23553e39
[]
no_license
shaqbari/jstl_project
99f65dd5bdcd0c30cc6c9bf757deb6024cd41c36
accbe2cdb2b2e5ec10c0faf3e90c32a69e4724c9
refs/heads/master
2021-01-20T12:29:28.291395
2017-05-09T16:06:58
2017-05-09T16:06:58
90,371,306
0
0
null
null
null
null
UHC
Java
false
false
1,819
java
package ch19_jdbc; import java.io.IOException; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.SQLException; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @WebServlet(name = "dbConnect", description = "데이터베이스 접속 테스트", urlPatterns = { "/dbConnect" }) public class DBTest extends HttpServlet { private static final long serialVersionUID = 1L; public DBTest() { super(); } protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { //db접속 확인 DBConnInfo connInfo=new DBConnInfo(); String driver=connInfo.getDriver(); String url= connInfo.getUrl(); String user = connInfo.getUser(); String password=connInfo.getPassword(); Connection con; PreparedStatement pstmt; //1.단계 드라이버 로드 try { Class.forName(driver); System.out.println("로드성공"); //접속 con=DriverManager.getConnection(url, user, password); if (con!=null) { System.out.println("접속성공"); //3.쿼리문 작성. 수행 //4. 연결 종료 con.close(); System.out.println("연결종료"); } } catch (ClassNotFoundException e) { e.printStackTrace(); System.out.println("로드실패"); } catch (SQLException e) { e.printStackTrace(); } finally{ } response.getWriter().append("Served at: ").append(request.getContextPath()); } protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doGet(request, response); } }
[ "shaqbari@gmail.com" ]
shaqbari@gmail.com
e430dbe983ec1aabb35d8c9b45983b93a62634d2
de7b67d4f8aa124f09fc133be5295a0c18d80171
/workspace_java-src/java-src-test/src/sun/security/pkcs11/wrapper/CK_VERSION.java
e37e10eb7776ff50cac5d461aba3be69319e0a16
[]
no_license
lin-lee/eclipse_workspace_test
adce936e4ae8df97f7f28965a6728540d63224c7
37507f78bc942afb11490c49942cdfc6ef3dfef8
refs/heads/master
2021-05-09T10:02:55.854906
2018-01-31T07:19:02
2018-01-31T07:19:02
119,460,523
0
1
null
null
null
null
UTF-8
Java
false
false
3,827
java
/* * %W% %E% * * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * =========================================================================== * Copyright (c) 2002 Graz University of Technology. 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. * * 3. The end-user documentation included with the redistribution, if any, must * include the following acknowledgment: * * "This product includes software developed by IAIK of Graz University of * Technology." * * Alternately, this acknowledgment may appear in the software itself, if * and wherever such third-party acknowledgments normally appear. * * 4. The names "Graz University of Technology" and "IAIK of Graz University of * Technology" must not be used to endorse or promote products derived from * this software without prior written permission. * * 5. Products derived from this software may not be called * "IAIK PKCS Wrapper", nor may "IAIK" appear in their name, without prior * written permission of Graz University of Technology. * * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED 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 LICENSOR 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 sun.security.pkcs11.wrapper; /** * class CK_VERSION describes the version of a Cryptoki interface, a Cryptoki * library, or an SSL implementation, or the hardware or firmware version of a * slot or token.<p> * <B>PKCS#11 structure:</B> * <PRE> * typedef struct CK_VERSION {&nbsp;&nbsp; * CK_BYTE major;&nbsp;&nbsp; * CK_BYTE minor;&nbsp;&nbsp; * } CK_VERSION; * </PRE> * * @author Karl Scheibelhofer <Karl.Scheibelhofer@iaik.at> * @author Martin Schl?ffer <schlaeff@sbox.tugraz.at> */ public class CK_VERSION { /** * <B>PKCS#11:</B> * <PRE> * CK_BYTE major; * </PRE> */ public byte major; /* integer portion of version number */ /** * <B>PKCS#11:</B> * <PRE> * CK_BYTE minor; * </PRE> */ public byte minor; /* 1/100ths portion of version number */ public CK_VERSION(int major, int minor) { this.major = (byte)major; this.minor = (byte)minor; } /** * Returns the string representation of CK_VERSION. * * @return the string representation of CK_VERSION */ public String toString() { StringBuilder buffer = new StringBuilder(); buffer.append(major & 0xff); buffer.append('.'); int m = minor & 0xff; if (m < 10) { buffer.append('0'); } buffer.append(m); return buffer.toString(); } }
[ "lilin@lvmama.com" ]
lilin@lvmama.com
23e04863618a0e23e591665f904c2f96abd4bea9
5fe04ecaba633d794d37c51aa842f17180aa9bfc
/Reflection - Exercises/src/BarracksWarsANewFactory/data/UnitRepository.java
510090e640dedf5671ded9553540a6fbe0c77075
[]
no_license
danielanikolova/JavaOOPAdvanced
3afeaf6991c58b1a6aa510543031885e04a4e80f
1c21ecd51c1722a9e640fe993da2f4dbe7d96ce8
refs/heads/master
2021-09-05T05:40:37.299876
2018-01-24T13:55:29
2018-01-24T13:55:29
118,771,476
0
0
null
null
null
null
UTF-8
Java
false
false
1,634
java
package BarracksWarsANewFactory.data; import BarracksWarsANewFactory.interfaces.Repository; import BarracksWarsANewFactory.interfaces.Unit; import java.util.Map; import java.util.TreeMap; public class UnitRepository implements Repository { private Map<String, Integer> amountOfUnits; public UnitRepository() { this.amountOfUnits = new TreeMap<>(); } public void addUnit(Unit unit) { String unitType = unit.getClass().getSimpleName(); if (!this.amountOfUnits.containsKey(unitType)) { this.amountOfUnits.put(unitType, 0); } int newAmount = this.amountOfUnits.get(unitType) + 1; this.amountOfUnits.put(unitType, newAmount); } public String getStatistics() { StringBuilder statBuilder = new StringBuilder(); for (Map.Entry<String, Integer> entry : amountOfUnits.entrySet()) { String formatedEntry = String.format("%s -> %d%n", entry.getKey(), entry.getValue()); statBuilder.append(formatedEntry); } statBuilder.setLength( statBuilder.length() - System.lineSeparator().length()); return statBuilder.toString(); } public void removeUnit(String unitType) { if (this.amountOfUnits.containsKey(unitType)&& this.amountOfUnits.get(unitType)>0){ Integer amountOfUnit = this.amountOfUnits.get(unitType) - 1; this.amountOfUnits.put(unitType, amountOfUnit); }else { throw new IllegalStateException("No such units in repository."); } } }
[ "daniela.a.nikolova@gmail.com" ]
daniela.a.nikolova@gmail.com
199e7d2fa86c62c1ab65d3be7a5aa70d2737791f
84cafe38dd1dc0410f3e2d70131cc4dc98193a34
/src/main/java/akkastudy/locationtransparency/java/SenderActorJava.java
d3170f4bf2a09af94aaf76644544990ea34f7a3a
[]
no_license
chakra-coder/akka-study
432a83323591433b6e4a35c777ec309a588a8b6f
737011c935d3ca3163978aa551dc666ce814c19c
refs/heads/master
2021-06-01T02:02:51.027202
2016-06-02T22:55:37
2016-06-02T22:55:37
null
0
0
null
null
null
null
UTF-8
Java
false
false
779
java
package akkastudy.locationtransparency.java; import akka.actor.ActorRef; import akka.actor.Props; import akka.actor.UntypedActor; import akka.event.Logging; import akka.event.LoggingAdapter; public class SenderActorJava extends UntypedActor { LoggingAdapter log = Logging.getLogger(getContext().system(), this); public void onReceive(Object message) { if (message instanceof String) { log.info("Received String message in SenderActorJava: {}", message); log.info("Creating SimpleActorJava"); ActorRef simpleActorJava = getContext().system().actorOf(Props.create(SimpleActorJava.class), "simpleActorJava"); simpleActorJava.tell(message, self()); } else { unhandled(message); } } }
[ "dhinojosa@evolutionnext.com" ]
dhinojosa@evolutionnext.com
029c6ef61e5a20eb8bd1e622712a30085d8a328c
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/27/27_bab6b5d571daa1e881fafa6237800cfa0b345bc9/GenericError/27_bab6b5d571daa1e881fafa6237800cfa0b345bc9_GenericError_t.java
424b4369e51ce0f9075c5cb0eb12319621e47cbd
[]
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
2,628
java
/* * Copyright (c) 2008-2013, Hazelcast, Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.hazelcast.client; import com.hazelcast.nio.serialization.Portable; import com.hazelcast.nio.serialization.PortableReader; import com.hazelcast.nio.serialization.PortableWriter; import java.io.IOException; /** * @author mdogan 4/29/13 */ public final class GenericError implements Portable { private String name; private String message; private String details; private int type; public GenericError() { } public GenericError(String name,String message, int type) { this(name,message,null,type); } public GenericError(String name,String message, String details, int type) { this.name = name; this.message = message; this.details = details; this.type = type; } @Override public int getFactoryId() { return ClientPortableHook.ID; } public int getClassId() { return ClientPortableHook.GENERIC_ERROR; } public String getName() { return name; } public String getMessage() { return message; } public String getDetails() { return details; } public int getType() { return type; } public void writePortable(PortableWriter writer) throws IOException { writer.writeUTF("n", name); writer.writeUTF("m", message); writer.writeUTF("d", details); writer.writeInt("t", type); } public void readPortable(PortableReader reader) throws IOException { name = reader.readUTF("n"); message = reader.readUTF("m"); details = reader.readUTF("d"); type = reader.readInt("t"); } @Override public String toString() { final StringBuilder sb = new StringBuilder("GenericError{"); sb.append("message='").append(message).append('\''); sb.append(", type=").append(type); sb.append('}'); return sb.toString(); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
9cfe39ec4edd225a1a369d6f083d6e670dbdc7ff
0f2d15e30082f1f45c51fdadc3911472223e70e0
/src/3.7/plugins/com.perforce.team.core/src/com/perforce/team/core/p4java/synchronize/Messages.java
dca32abb867ba62c6ca9f8ef3a5142f3c72b8e82
[ "BSD-2-Clause" ]
permissive
eclipseguru/p4eclipse
a28de6bd211df3009d58f3d381867d574ee63c7a
7f91b7daccb2a15e752290c1f3399cc4b6f4fa54
refs/heads/master
2022-09-04T05:50:25.271301
2022-09-01T12:47:06
2022-09-01T12:47:06
136,226,938
2
1
BSD-2-Clause
2022-09-01T19:42:29
2018-06-05T19:45:54
Java
UTF-8
Java
false
false
674
java
package com.perforce.team.core.p4java.synchronize; import org.eclipse.osgi.util.NLS; public class Messages extends NLS { private static final String BUNDLE_NAME = "com.perforce.team.core.p4java.synchronize.messages"; //$NON-NLS-1$ public static String DefaultChange; public static String Loading; public static String PendingChange; public static String PerforceSynchronizations; public static String Refreshing; public static String SubmittedChange; public static String Synchronizing; static { // initialize resource bundle NLS.initializeMessages(BUNDLE_NAME, Messages.class); } private Messages() { } }
[ "gunnar@wagenknecht.org" ]
gunnar@wagenknecht.org
4ba017fe1baeafd79c877486bed66b5f04d94715
447520f40e82a060368a0802a391697bc00be96f
/apks/malware/app51/source/com/ironsource/mobilcore/W.java
9ed9a319df675dbc8919a4c0430e6d2530cbf3c6
[ "Apache-2.0" ]
permissive
iantal/AndroidPermissions
7f3343a9c29d82dbcd4ecd98b3a50ddf8d179465
d623b732734243590b5f004d167e542e2e2ae249
refs/heads/master
2023-07-19T01:29:26.689186
2019-09-30T19:01:42
2019-09-30T19:01:42
107,239,248
0
0
Apache-2.0
2023-07-16T07:41:38
2017-10-17T08:22:57
null
UTF-8
Java
false
false
3,195
java
package com.ironsource.mobilcore; import android.content.Context; import android.text.TextUtils; import android.view.KeyEvent; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; import android.view.ViewGroup.LayoutParams; import android.widget.EditText; import android.widget.ImageView; import android.widget.RelativeLayout; import android.widget.RelativeLayout.LayoutParams; import android.widget.TextView; import android.widget.TextView.OnEditorActionListener; import org.json.JSONException; import org.json.JSONObject; final class W extends H { private String a; private EditText b; private ImageView t; public W(Context paramContext, aw paramAw) { super(paramContext, paramAw); } public final String a() { return "ironsourceSearch"; } protected final void a(View paramView) {} public final void a(JSONObject paramJSONObject) throws JSONException { this.a = paramJSONObject.optString("baseSearchUrl", "http://search.spearmint-browser.com/results.php?s={0}&a=mcsldr"); super.a(paramJSONObject, true); this.b.setOnEditorActionListener(new TextView.OnEditorActionListener() { public final boolean onEditorAction(TextView paramAnonymousTextView, int paramAnonymousInt, KeyEvent paramAnonymousKeyEvent) { if (paramAnonymousInt == 3) { W.a(W.this); } return false; } }); this.t.setOnClickListener(new View.OnClickListener() { public final void onClick(View paramAnonymousView) { W.a(W.this); } }); } protected final void c() { this.h = new RelativeLayout(this.c); this.h.setPadding(this.d.h(), this.d.h(), this.d.h(), this.d.h()); } protected final void d() { ViewGroup localViewGroup = (ViewGroup)this.h; this.t = new ImageView(this.c); this.t.setId(j()); int i = B.a(this.c, 5.0F); this.t.setPadding(i * 2, i, i, i); Object localObject = new RelativeLayout.LayoutParams(-2, -2); ((RelativeLayout.LayoutParams)localObject).addRule(15); ((RelativeLayout.LayoutParams)localObject).addRule(11); this.t.setLayoutParams((ViewGroup.LayoutParams)localObject); this.t.setImageDrawable(this.d.l()); this.b = new EditText(this.c); localObject = new RelativeLayout.LayoutParams(-1, -2); ((RelativeLayout.LayoutParams)localObject).addRule(0, this.t.getId()); this.b.setLayoutParams((ViewGroup.LayoutParams)localObject); this.b.setSingleLine(); this.b.setImeOptions(3); this.b.setHintTextColor(this.d.c()); this.b.setTextColor(this.d.d()); B.a(this.b, null); this.b.setPadding(0, 0, 0, 0); localObject = new RelativeLayout(this.c); ((RelativeLayout)localObject).setLayoutParams(new RelativeLayout.LayoutParams(-1, -2)); ((RelativeLayout)localObject).addView(this.t); ((RelativeLayout)localObject).addView(this.b); B.a((View)localObject, this.d.t()); localViewGroup.addView((View)localObject); } protected final void e() { if (!TextUtils.isEmpty(this.l)) { this.b.setHint(this.l); } } protected final boolean f() { return false; } }
[ "antal.micky@yahoo.com" ]
antal.micky@yahoo.com
38f584a3961de35fafa486faa829db4abc4777a5
9b7695036cb36a30e61d9c88179f6f47d118d88c
/RDL2-TMP/repository/AportacioninmuebleRepository.java
2f6022897283decc9adaa5e55662df71a067771d
[]
no_license
javoPB/compartir
58e6bdc05c39bbfdd3e172812bd34a7f99ca44ef
f0eb7ece3372bd464737d75479e06b79685dda3b
refs/heads/master
2022-10-31T11:04:25.961387
2020-06-16T18:58:46
2020-06-16T18:58:46
258,278,301
0
0
null
null
null
null
UTF-8
Java
false
false
1,013
java
package com.softtek.acceleo.demo.repository; import java.util.List; import java.util.UUID; import com.softtek.acceleo.demo.domain.Aportacioninmueble; public interface AportacioninmuebleRepository { public void addAportacioninmueble(Aportacioninmueble aportacioninmueble); public void editAportacioninmueble(Aportacioninmueble aportacioninmueble); public List<Aportacioninmueble> listAportacioninmuebles(Aportacioninmueble aportacioninmueble); public Aportacioninmueble getAportacioninmueble(UUID empid); public void deleteAportacioninmueble(Aportacioninmueble aportacioninmueble); public List<Aportacioninmueble> listAportacioninmueblesQuery(Aportacioninmueble aportacioninmueble, String query, int page, int size); public List<Aportacioninmueble> listAportacioninmueblesPagination(Aportacioninmueble aportacioninmueble, int page, int size); public long getTotalRows(); public long getTotalRows(String query); public long getTotalRowsSearch(String query); }
[ "pbjavouam@gmail.com" ]
pbjavouam@gmail.com
59cf2dfa24f38092ed60bbd82b9d9641020de876
f6899a2cf1c10a724632bbb2ccffb7283c77a5ff
/glassfish-3.0/connectors/connectors-internal-api/src/main/java/org/glassfish/resources/custom/factory/JavaBeanFactory.java
30d9f0ab42e8d8d257552fa2b3646aea236da08d
[]
no_license
Appdynamics/OSS
a8903058e29f4783e34119a4d87639f508a63692
1e112f8854a25b3ecf337cad6eccf7c85e732525
refs/heads/master
2023-07-22T03:34:54.770481
2021-10-28T07:01:57
2021-10-28T07:01:57
19,390,624
2
13
null
2023-07-08T02:26:33
2014-05-02T22:42:20
null
UTF-8
Java
false
false
5,786
java
/* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License"). You * may not use this file except in compliance with the License. You can obtain * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. * Sun designates this particular file as subject to the "Classpath" exception * as provided by Sun in the GPL Version 2 section of the License file that * accompanied this code. If applicable, add the following below the License * Header, with the fields enclosed by brackets [] replaced by your own * identifying information: "Portions Copyrighted [year] * [name of copyright owner]" * * Contributor(s): * * If you wish your version of this file to be governed by only the CDDL or * only the GPL Version 2, indicate your decision by adding "[Contributor] * elects to include this software in this distribution under the [CDDL or GPL * Version 2] license." If you don't indicate a single choice of license, a * recipient has the option to distribute your version of this file under * either the CDDL, the GPL Version 2 or to extend the choice of license to * its licensees as provided above. However, if you add GPL Version 2 code * and therefore, elected the GPL Version 2 license, then the option applies * only if the new code is made subject to such option by the copyright * holder. */ package org.glassfish.resources.custom.factory; import javax.naming.spi.ObjectFactory; import javax.naming.*; import java.io.Serializable; import java.util.Hashtable; import java.util.Enumeration; import java.beans.BeanInfo; import java.beans.Introspector; import java.beans.PropertyDescriptor; import java.lang.reflect.Method; public class JavaBeanFactory implements Serializable, ObjectFactory { public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?, ?> environment) throws Exception { Reference reference = (Reference) obj; //TODO V3 load the class in privileged mode ? try { Class beanClass; try { beanClass = Thread.currentThread().getContextClassLoader().loadClass(reference.getClassName()); } catch (ClassNotFoundException e) { throw new NamingException("Unable to load class : " + reference.getClassName()); } Object bean = beanClass.newInstance(); BeanInfo beanInfo = Introspector.getBeanInfo(beanClass); PropertyDescriptor[] properties = beanInfo.getPropertyDescriptors(); Enumeration enumeration = reference.getAll(); while (enumeration.hasMoreElements()) { RefAddr ra = (RefAddr) enumeration.nextElement(); String propertyName = ra.getType(); String value = (String) ra.getContent(); for (PropertyDescriptor desc : properties) { if (desc.getName().equals(propertyName)) { String type = desc.getPropertyType().getName(); Object result = null; if(type != null){ type = type.toUpperCase(); if(type.endsWith("INT") || type.endsWith("INTEGER")){ result = Integer.valueOf(value); } else if (type.endsWith("LONG")){ result = Long.valueOf(value); } else if(type.endsWith("DOUBLE")){ result = Double.valueOf(value); } else if(type.endsWith("FLOAT") ){ result = Float.valueOf(value); } else if(type.endsWith("CHAR") || type.endsWith("CHARACTER")){ result = value.charAt(0); } else if(type.endsWith("SHORT")){ result = Short.valueOf(value); } else if(type.endsWith("BYTE")){ result = Byte.valueOf(value); } else if(type.endsWith("BOOLEAN")){ result = Boolean.valueOf(value); } else if(type.endsWith("STRING")){ result = value; } } else { throw new NamingException("Unable to find the type of property : " + propertyName); } Method setter = desc.getWriteMethod(); if (setter != null) { setter.invoke(bean, result); } else { throw new NamingException ("Unable to find the setter method for property : "+ propertyName); } break; } } } return bean; } catch(Exception e){ NamingException ne = new NamingException("Unable to instantiate JavaBean"); ne.setRootCause(e); throw ne; } } }
[ "ddimalanta@appdynamics.com" ]
ddimalanta@appdynamics.com
2f01eb99af0d8bd19ae73bba3d1046075c457c76
5eae683a6df0c4b97ab1ebcd4724a4bf062c1889
/bin/platform/bootstrap/gensrc/de/hybris/platform/ordercancel/model/OrderCancelRecordEntryModel.java
6f21c0750b9c88c764dfea6256c76c1a0ec00ea7
[]
no_license
sujanrimal/GiftCardProject
1c5e8fe494e5c59cca58bbc76a755b1b0c0333bb
e0398eec9f4ec436d20764898a0255f32aac3d0c
refs/heads/master
2020-12-11T18:05:17.413472
2020-01-17T18:23:44
2020-01-17T18:23:44
233,911,127
0
0
null
2020-06-18T15:26:11
2020-01-14T18:44:18
null
UTF-8
Java
false
false
7,739
java
/* * ---------------------------------------------------------------- * --- WARNING: THIS FILE IS GENERATED AND WILL BE OVERWRITTEN! --- * --- Generated at Jan 17, 2020 11:49:26 AM --- * ---------------------------------------------------------------- * * [y] hybris Platform * Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. * This software is the confidential and proprietary information of SAP * ("Confidential Information"). You shall not disclose such Confidential * Information and shall use it only in accordance with the terms of the * license agreement you entered into with SAP. */ package de.hybris.platform.ordercancel.model; import de.hybris.bootstrap.annotations.Accessor; import de.hybris.platform.basecommerce.enums.CancelReason; import de.hybris.platform.basecommerce.enums.OrderCancelEntryStatus; import de.hybris.platform.basecommerce.enums.OrderModificationEntryStatus; import de.hybris.platform.core.model.ItemModel; import de.hybris.platform.orderhistory.model.OrderHistoryEntryModel; import de.hybris.platform.ordermodify.model.OrderModificationRecordEntryModel; import de.hybris.platform.ordermodify.model.OrderModificationRecordModel; import de.hybris.platform.servicelayer.model.ItemModelContext; import java.util.Date; /** * Generated model class for type OrderCancelRecordEntry first defined at extension basecommerce. */ @SuppressWarnings("all") public class OrderCancelRecordEntryModel extends OrderModificationRecordEntryModel { /**<i>Generated model type code constant.</i>*/ public static final String _TYPECODE = "OrderCancelRecordEntry"; /** <i>Generated constant</i> - Attribute key of <code>OrderCancelRecordEntry.refusedMessage</code> attribute defined at extension <code>basecommerce</code>. */ public static final String REFUSEDMESSAGE = "refusedMessage"; /** <i>Generated constant</i> - Attribute key of <code>OrderCancelRecordEntry.cancelResult</code> attribute defined at extension <code>basecommerce</code>. */ public static final String CANCELRESULT = "cancelResult"; /** <i>Generated constant</i> - Attribute key of <code>OrderCancelRecordEntry.cancelReason</code> attribute defined at extension <code>basecommerce</code>. */ public static final String CANCELREASON = "cancelReason"; /** * <i>Generated constructor</i> - Default constructor for generic creation. */ public OrderCancelRecordEntryModel() { super(); } /** * <i>Generated constructor</i> - Default constructor for creation with existing context * @param ctx the model context to be injected, must not be null */ public OrderCancelRecordEntryModel(final ItemModelContext ctx) { super(ctx); } /** * <i>Generated constructor</i> - Constructor with all mandatory attributes. * @deprecated since 4.1.1 Please use the default constructor without parameters * @param _code initial attribute declared by type <code>OrderModificationRecordEntry</code> at extension <code>basecommerce</code> * @param _modificationRecord initial attribute declared by type <code>OrderModificationRecordEntry</code> at extension <code>basecommerce</code> * @param _originalVersion initial attribute declared by type <code>OrderModificationRecordEntry</code> at extension <code>basecommerce</code> * @param _status initial attribute declared by type <code>OrderModificationRecordEntry</code> at extension <code>basecommerce</code> * @param _timestamp initial attribute declared by type <code>OrderModificationRecordEntry</code> at extension <code>basecommerce</code> */ @Deprecated public OrderCancelRecordEntryModel(final String _code, final OrderModificationRecordModel _modificationRecord, final OrderHistoryEntryModel _originalVersion, final OrderModificationEntryStatus _status, final Date _timestamp) { super(); setCode(_code); setModificationRecord(_modificationRecord); setOriginalVersion(_originalVersion); setStatus(_status); setTimestamp(_timestamp); } /** * <i>Generated constructor</i> - for all mandatory and initial attributes. * @deprecated since 4.1.1 Please use the default constructor without parameters * @param _code initial attribute declared by type <code>OrderModificationRecordEntry</code> at extension <code>basecommerce</code> * @param _modificationRecord initial attribute declared by type <code>OrderModificationRecordEntry</code> at extension <code>basecommerce</code> * @param _originalVersion initial attribute declared by type <code>OrderModificationRecordEntry</code> at extension <code>basecommerce</code> * @param _owner initial attribute declared by type <code>Item</code> at extension <code>core</code> * @param _status initial attribute declared by type <code>OrderModificationRecordEntry</code> at extension <code>basecommerce</code> * @param _timestamp initial attribute declared by type <code>OrderModificationRecordEntry</code> at extension <code>basecommerce</code> */ @Deprecated public OrderCancelRecordEntryModel(final String _code, final OrderModificationRecordModel _modificationRecord, final OrderHistoryEntryModel _originalVersion, final ItemModel _owner, final OrderModificationEntryStatus _status, final Date _timestamp) { super(); setCode(_code); setModificationRecord(_modificationRecord); setOriginalVersion(_originalVersion); setOwner(_owner); setStatus(_status); setTimestamp(_timestamp); } /** * <i>Generated method</i> - Getter of the <code>OrderCancelRecordEntry.cancelReason</code> attribute defined at extension <code>basecommerce</code>. * @return the cancelReason */ @Accessor(qualifier = "cancelReason", type = Accessor.Type.GETTER) public CancelReason getCancelReason() { return getPersistenceContext().getPropertyValue(CANCELREASON); } /** * <i>Generated method</i> - Getter of the <code>OrderCancelRecordEntry.cancelResult</code> attribute defined at extension <code>basecommerce</code>. * @return the cancelResult */ @Accessor(qualifier = "cancelResult", type = Accessor.Type.GETTER) public OrderCancelEntryStatus getCancelResult() { return getPersistenceContext().getPropertyValue(CANCELRESULT); } /** * <i>Generated method</i> - Getter of the <code>OrderCancelRecordEntry.refusedMessage</code> attribute defined at extension <code>basecommerce</code>. * @return the refusedMessage */ @Accessor(qualifier = "refusedMessage", type = Accessor.Type.GETTER) public String getRefusedMessage() { return getPersistenceContext().getPropertyValue(REFUSEDMESSAGE); } /** * <i>Generated method</i> - Setter of <code>OrderCancelRecordEntry.cancelReason</code> attribute defined at extension <code>basecommerce</code>. * * @param value the cancelReason */ @Accessor(qualifier = "cancelReason", type = Accessor.Type.SETTER) public void setCancelReason(final CancelReason value) { getPersistenceContext().setPropertyValue(CANCELREASON, value); } /** * <i>Generated method</i> - Setter of <code>OrderCancelRecordEntry.cancelResult</code> attribute defined at extension <code>basecommerce</code>. * * @param value the cancelResult */ @Accessor(qualifier = "cancelResult", type = Accessor.Type.SETTER) public void setCancelResult(final OrderCancelEntryStatus value) { getPersistenceContext().setPropertyValue(CANCELRESULT, value); } /** * <i>Generated method</i> - Setter of <code>OrderCancelRecordEntry.refusedMessage</code> attribute defined at extension <code>basecommerce</code>. * * @param value the refusedMessage */ @Accessor(qualifier = "refusedMessage", type = Accessor.Type.SETTER) public void setRefusedMessage(final String value) { getPersistenceContext().setPropertyValue(REFUSEDMESSAGE, value); } }
[ "travis.d.crawford@accenture.com" ]
travis.d.crawford@accenture.com
826dea6989eca5e3f6a2b56cee41243e12f7a7d4
129f58086770fc74c171e9c1edfd63b4257210f3
/src/testcases/CWE190_Integer_Overflow/CWE190_Integer_Overflow__long_console_readLine_add_51b.java
3d17f9ed8e9d6047af4170f4fd2792fa3692da88
[]
no_license
glopezGitHub/Android23
1bd0b6a6c7ce3c7439a74f1e4dcef2c4c0fac4ba
6215d0684c4fbdc7217ccfbedfccfca69824cc5e
refs/heads/master
2023-03-07T15:14:59.447795
2023-02-06T13:59:49
2023-02-06T13:59:49
6,856,387
0
3
null
2023-02-06T18:38:17
2012-11-25T22:04:23
Java
UTF-8
Java
false
false
1,824
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE190_Integer_Overflow__long_console_readLine_add_51b.java Label Definition File: CWE190_Integer_Overflow.label.xml Template File: sources-sinks-51b.tmpl.java */ /* * @description * CWE: 190 Integer Overflow * BadSource: console_readLine Read data from the console using readLine * GoodSource: A hardcoded non-zero, non-min, non-max, even number * Sinks: add * GoodSink: Ensure there will not be an overflow before adding 1 to data * BadSink : Add 1 to data, which can cause an overflow * Flow Variant: 51 Data flow: data passed as an argument from one function to another in different classes in the same package * * */ package testcases.CWE190_Integer_Overflow; import testcasesupport.*; import java.sql.*; import javax.servlet.http.*; public class CWE190_Integer_Overflow__long_console_readLine_add_51b { public void bad_sink(long data ) throws Throwable { /* POTENTIAL FLAW: if data == Long.MAX_VALUE, this will overflow */ long result = (long)(data + 1); IO.writeLine("result: " + result); } /* goodG2B() - use goodsource and badsink */ public void goodG2B_sink(long data ) throws Throwable { /* POTENTIAL FLAW: if data == Long.MAX_VALUE, this will overflow */ long result = (long)(data + 1); IO.writeLine("result: " + result); } /* goodB2G() - use badsource and goodsink */ public void goodB2G_sink(long data ) throws Throwable { /* FIX: Add a check to prevent an overflow from occurring */ if (data < Long.MAX_VALUE) { long result = (long)(data + 1); IO.writeLine("result: " + result); } else { IO.writeLine("data value is too large to perform addition."); } } }
[ "guillermo.pando@gmail.com" ]
guillermo.pando@gmail.com
c8d5fb785a5b4b38233696ad6c4aa07cfad0d0a6
13f6652c77abd41d4bc944887e4b94d8dff40dde
/archstudio/src/archstudio/comp/visio/COMTopConnector.java
f564369ac65c454ee3f7c4d68fe13eec12c8a6ab
[]
no_license
isr-uci-edu/ArchStudio3
5bed3be243981d944577787f3a47c7a94c8adbd3
b8aeb7286ea00d4b6c6a229c83b0ee0d1c9b2960
refs/heads/master
2021-01-10T21:01:43.330204
2014-05-31T16:15:53
2014-05-31T16:15:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,348
java
package archstudio.comp.visio; import c2.fw.*; /** * <p>Title: COMTopConnector</p> * <p>Description: Connector between COM and ArchStudio, with COM at top</p> * <p>Copyright: Copyright (c) 2002</p> * <p>Organization: ISR, UCI</p> * @author Jie Ren <A HREF="mailto:jie@ics.uci.edu">jie@ics.uci.edu</A> * @version 1.0 */ public class COMTopConnector extends COMConnector { /** * Initialize a <code>COMConnector</code> * @param id identifier of the connector */ public COMTopConnector(Identifier id) { super(id); } /** * Initialize a <code>COMConnector</code> * @param id identifier of the connector * @param params initialization parameters * acceptable parameters are * LocalPort = the port used for listening incoming COM messages * RemoteHost = the host that outgoing ArchStudio messages are sent to * RemotePort = the port that outgoing ArchStudio messages are sent to */ public COMTopConnector(Identifier id, InitializationParameter[] params){ super(id, params); } /** * Set the local interface as a C2 bottom interface */ protected void setLocalInterface() { localIface = new SimpleInterface(c2.legacy.AbstractC2Brick.BOTTOM_INTERFACE_ID, this); } }
[ "sahendrickson@gmail.com" ]
sahendrickson@gmail.com
34b6cd0505c740b8c1804be060cef9449451c906
dc0e271669780a11284b9626919846a51b00d54c
/model/com/hys/exam/model/HysUserRoleProp.java
b5f6158453f7ebe5005c60bc04e861affe37a5ab
[ "Apache-2.0" ]
permissive
1224500506/NCME-Admin
4a4b8e62f85b352dee0a96f096748b04fbf1b67e
e4f0969938ed6d9c076a9d647681dd56a1bf2679
refs/heads/master
2021-04-24T19:28:33.899711
2018-01-15T01:54:21
2018-01-15T01:54:21
117,482,274
1
1
null
null
null
null
UTF-8
Java
false
false
454
java
package com.hys.exam.model; import java.io.Serializable; public class HysUserRoleProp implements Serializable { /** * */ private static final long serialVersionUID = 1L; private Long userid; private Long roleid; public Long getUserid() { return userid; } public void setUserid(Long userid) { this.userid = userid; } public Long getRoleid() { return roleid; } public void setRoleid(Long roleid) { this.roleid = roleid; } }
[ "weeho@DESKTOP-71D9DPN" ]
weeho@DESKTOP-71D9DPN
25e3b80fd10b48675c125edb249e8ff15a11cdb3
7c9072b5ca293f29b60acc5f9d7f14325cabc579
/cms-service/src/main/java/com/design/cms/service/api/IReturnService.java
25176ea48cc7a9a23f001515e068d5faf4e03be3
[]
no_license
keepsilentc/designcmscode
4fc5434bdb3a363963648928f1bcfc1c1c24124d
caf2d10de03abfa43ed83d5d3b5624c898df1b04
refs/heads/master
2021-01-21T06:59:35.824437
2017-02-27T11:19:45
2017-02-27T11:19:45
83,302,001
0
0
null
null
null
null
UTF-8
Java
false
false
494
java
package com.design.cms.service.api; import java.util.List; import com.design.cms.dao.entity.ReturnLog; import com.design.cms.dao.entity.dto.ReturnInfo; import com.design.cms.service.api.vo.returns.ReturnApproveVo; import com.design.cms.service.api.vo.returns.ReturnSearchVo; public interface IReturnService extends PageOperation<ReturnSearchVo,ReturnInfo> { List<ReturnLog> follow(String returnNo); ReturnInfo getReturnInfo(String returnNo); void returnApprove(ReturnApproveVo vo); }
[ "783868970@qq.com" ]
783868970@qq.com
763415d861ef5aa08111f0b61f41ae232b320ae8
451709e6462c9d0a1f648c8f780298dd52e3bfb4
/project/staffmanager/src/com/chinasoft/sms/contract/action/PieChartAction.java
c932ca5b5fbfac7dbdbfd521dc45edbec4268cf7
[]
no_license
forsunchao/forsunchao
acec1606e9550f66e2eac36c6f0ee7b8a4589778
75ff7c7be27b8babbc03b2d3e500b9bcf2cf3753
refs/heads/master
2021-01-02T22:43:51.809188
2013-05-28T12:36:31
2013-05-28T12:36:31
34,045,525
2
1
null
null
null
null
GB18030
Java
false
false
1,551
java
package com.chinasoft.sms.contract.action; import java.io.PrintWriter; import javax.servlet.http.HttpSession; import javax.servlet.http.HttpServletRequest; import org.jfree.chart.ChartRenderingInfo; import org.jfree.chart.ChartUtilities; import org.jfree.chart.JFreeChart; import org.jfree.chart.entity.StandardEntityCollection; import org.jfree.chart.plot.PiePlot; import org.jfree.chart.servlet.ServletUtilities; import org.jfree.data.general.PieDataset; public class PieChartAction { /** * @param request * @param session * @param pw * @return string * @author huiyuan.wang */ public String generatePieChart(HttpServletRequest request, HttpSession session, PrintWriter pw) { String filename = null; try{ ConnDbAction object = new ConnDbAction(); PieDataset data = object.readData(); PiePlot plot = new PiePlot(data); JFreeChart chart = new JFreeChart("",JFreeChart.DEFAULT_TITLE_FONT, plot, true); //可选,设置图片背景色 chart.setBackgroundPaint(java.awt.Color.white); //可选,设置图片标题 chart.setTitle("员工底薪统计报表"); ChartRenderingInfo info = new ChartRenderingInfo(new StandardEntityCollection()); //500是图片长度,300是图片高度 filename = ServletUtilities.saveChartAsPNG(chart, 700, 500, info, session); ChartUtilities.writeImageMap(pw, filename, info,false); pw.flush(); }catch(Exception e) { System.out.println("Exception - " + e.toString()); e.printStackTrace(System.out); filename = "public_error_700x500.png"; } return filename; } }
[ "forsunchao@f3c5aaa3-ccec-8fd9-5322-fc38b0fccad4" ]
forsunchao@f3c5aaa3-ccec-8fd9-5322-fc38b0fccad4
3f44143bfb0210f9c5b42602cae4aced947e8b0d
adb4005739d8aad151a1b71a7fadfca16dc41caa
/behavioral-patterns/command-pattern/jbr/commandpattern/hotel/solution/FoodOrder.java
507f8c2b16351018f73d88f1774aa37137be11d3
[]
no_license
dalalsunil1986/design-patterns-java
ed3cb5ee060007e13b0aa3cf4df86065fffdd848
5816ba1dd33fbfbf77f52c634bd6c3a23d8b7a1d
refs/heads/master
2020-05-16T01:14:18.176131
2017-12-03T17:53:20
2017-12-03T17:53:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
137
java
package jbr.commandpattern.hotel.solution; import jbr.commandpattern.common.Food; public interface FoodOrder { Food prepareFood(); }
[ "java2ranjith@gmail.com" ]
java2ranjith@gmail.com
452d20965b61114a52d503cf06908040e72364f1
3709a919cb851d2dce17f8cad3fe92a149399220
/lilian-experimental/src/main/java/org/lilian/motifs/Coverage.java
4ea6d7537302834f29148380d8ff6327b2906c2c
[]
no_license
pbloem/Lilian-experimental
deda469a784f02b8a944863d08e653e91d18b959
267a136edd8a679e56f7d097e61c24764c2b6c68
refs/heads/master
2021-01-23T18:09:13.098906
2020-10-13T12:27:18
2020-10-13T12:27:18
3,208,311
2
0
null
2020-10-13T12:27:19
2012-01-18T12:12:35
Java
UTF-8
Java
false
false
6,463
java
package org.lilian.motifs; import static org.nodes.util.Functions.log2; import static org.nodes.util.Functions.log2Sum; import static org.nodes.util.LogNum.fromDouble; import static org.nodes.util.Series.series; import static org.nodes.models.USequenceEstimator.CIMethod; import static org.nodes.models.USequenceEstimator.CIType; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import org.apache.commons.math3.distribution.NormalDistribution; import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics; import org.data2semantics.platform.Global; import org.data2semantics.platform.annotation.In; import org.data2semantics.platform.annotation.Main; import org.data2semantics.platform.annotation.Module; import org.data2semantics.platform.annotation.Out; import org.data2semantics.platform.util.FrequencyModel; import org.lilian.experiment.Tools; import org.nodes.DGraph; import org.nodes.Graph; import org.nodes.Graphs; import org.nodes.Link; import org.nodes.MapUTGraph; import org.nodes.Node; import org.nodes.UGraph; import org.nodes.models.DSequenceEstimator; import org.nodes.models.USequenceEstimator; import org.nodes.random.RandomGraphs; import org.nodes.util.Functions; import org.nodes.util.LogNum; import org.nodes.util.Pair; import org.nodes.util.Series; import org.nodes.util.bootstrap.BCaCI; import org.nodes.util.bootstrap.LogBCaCI; import org.nodes.util.bootstrap.LogNormalCI; import org.nodes.util.bootstrap.LogPercentileCI; import org.nodes.util.bootstrap.PercentileCI; @Module(name="Test confidence intervals") public class Coverage { @In(name="single sample") public int singleSample; @In(name="coverage sample") public int covSample; @In(name="alpha") public double alpha; @In(name="gold standard") public double gold; @In(name="coverage sizes") public List<Integer> covSizes; @In(name="data") public Graph<String> data; @In(name="bootstraps") public int bsSamples; @Main(print=false) public void samples() throws IOException { boolean directed = data instanceof DGraph<?>; // * transform the data into a simple, undirected graph if(directed) data = Graphs.toSimpleDGraph((DGraph<String>)data); else data = Graphs.toSimpleUGraph((UGraph<String>)data); // * Construct a single sample to plot if(gold < 0.0) { Global.log().info("Sampling a single set of log probabilites."); if(directed) { DSequenceEstimator<String> model = new DSequenceEstimator<String>((DGraph<String>)data); for(int i : series(singleSample)) { model.nonuniform(); if(i % (singleSample/100) == 0) System.out.print("."); } System.out.println(); gold = model.logNumGraphsML(); } else { USequenceEstimator<String> model = new USequenceEstimator<String>((UGraph<String>)data); for(int i : series(singleSample)) { model.nonuniform(); if(i % (singleSample/100) == 0) System.out.print("."); } System.out.println(); gold = model.logNumGraphsML(); } } Global.log().info("Gold standard: " + gold); // * Estimate coverage Global.log().info("Estimating coverage for small samples."); coverages = new ArrayList<Double>(covSizes.size()); intSizes = new ArrayList<Double>(covSizes.size()); intSizesStdDev = new ArrayList<Double>(covSizes.size()); for(int n : covSizes) { Global.log().info("size: " + n); int hits = 0; List<Double> sizes = new ArrayList<Double>(covSample); for(int i : series(covSample)) { List<Double> logSamples; if(directed) logSamples = (new DSequenceEstimator<String>((DGraph<String>)data, n)).logSamples(); else logSamples = (new USequenceEstimator<String>(data, n)).logSamples(); LogNormalCI ci = new LogNormalCI(logSamples, 20000); Pair<Double, Double> interval = ci.twoSided(alpha); System.out.println(interval); sizes.add(interval.second() - interval.first()); if(gold > interval.first() && gold < interval.second()) hits ++; } // * estimate of coverage coverages.add(hits / (double) covSample); double mean = Tools.mean(sizes); double stdDev = Tools.standardDeviation(sizes); intSizes.add(mean); intSizesStdDev.add(stdDev); Global.log().info("coverage: " + hits/ (double) covSample); Global.log().info("mean size: " + mean + " ("+stdDev+")"); } } @Out(name="coverages") public List<Double> coverages; @Out(name="interval sizes") public List<Double> intSizes; @Out(name="interval sizes std dev") public List<Double> intSizesStdDev; public static double lowerBound(List<Double> bootstraps, double alpha) { int iBelow = (int)(alpha * bootstraps.size()); double rem = alpha * bootstraps.size() - (double) iBelow; if(iBelow == bootstraps.size() -1) return bootstraps.get(iBelow); return interpolate(bootstraps.get(iBelow), bootstraps.get(iBelow+1), (1.0 - rem)).logMag(); } /** * Returns a value such that, by estimate, we have 1-alpha confidence that * the true value of the mean is below the value. * * @param alpha * @return */ public static double upperBound(List<Double> bootstraps, double alpha) { int iBelow = (int)((1.0 - alpha) * bootstraps.size()); double rem = ((1.0 - alpha) * bootstraps.size()) - iBelow; if(iBelow == bootstraps.size() -1) return bootstraps.get(iBelow); return interpolate(bootstraps.get(iBelow), bootstraps.get(iBelow+1), (1.0 - rem)).logMag(); } /** * Returns an upper and a lower bound such that, by estimate, we have * 1-alpha confidence that the true value is between the two bounds. * * @param alpha * @return */ public static Pair<Double, Double> twoSided(List<Double> bootstraps, double alpha) { return new Pair<Double, Double>( lowerBound(bootstraps, alpha*0.5), upperBound(bootstraps, alpha*0.5)); } public static LogNum interpolate(double l, double r, double leftWeight) { LogNum left = new LogNum(l, true, 2.0); LogNum right = new LogNum(r, true, 2.0); // interpolated values LogNum lw = left.times(fromDouble(leftWeight, 2.0)); LogNum rw = right.times(fromDouble(1.0-leftWeight, 2.0)); return lw.plus(rw); } }
[ "p@peterbloem.nl" ]
p@peterbloem.nl
959f0592ddc8761e541b0ecaa2ec2c0fd65216bd
e5302f2aff47108cbb6f22b91d1384f053bb1713
/ver-0.2/KieaSpringbootOAuth2/src/main/java/org/tain/oauth/CustomOAuth2Provider.java
787f68456bc9559b2c931b07163c913b7374cb88
[ "Apache-2.0" ]
permissive
grtlinux/KieaSpringbootOAuth2
6b2181f4daa386b3c42259efb611485e2cc01ea6
0c04e43e28ff3f7e67f9e8a9fdd4f5ad8100d1ef
refs/heads/master
2022-09-09T07:55:59.293475
2020-06-03T04:57:31
2020-06-03T04:57:31
268,511,168
0
0
null
null
null
null
UTF-8
Java
false
false
1,443
java
package org.tain.oauth; import org.springframework.security.oauth2.client.registration.ClientRegistration; import org.springframework.security.oauth2.core.AuthorizationGrantType; import org.springframework.security.oauth2.core.ClientAuthenticationMethod; public enum CustomOAuth2Provider { KAKAO { @Override public ClientRegistration.Builder getBuilder(String registrationId) { ClientRegistration.Builder builder = getBuilder(registrationId, ClientAuthenticationMethod.POST, DEFAULT_LOGIN_REDIRECT_URL); builder.scope("profile"); builder.authorizationUri("https://kauth.kakao.com/oauth/authorize"); builder.tokenUri("https://kauth.kakao.com/oauth/token"); builder.userInfoUri("https://kapi.kakao.com/v1/user/me"); builder.userNameAttributeName("id"); builder.clientName("Kakao"); return builder; } }; private static final String DEFAULT_LOGIN_REDIRECT_URL = "{baseUrl}/login/oauth2/code/{registrationId}"; protected final ClientRegistration.Builder getBuilder(String registrationId, ClientAuthenticationMethod method, String redirectUri) { ClientRegistration.Builder builder = ClientRegistration.withRegistrationId(registrationId); builder.clientAuthenticationMethod(method); builder.authorizationGrantType(AuthorizationGrantType.AUTHORIZATION_CODE); builder.redirectUriTemplate(redirectUri); return builder; } public abstract ClientRegistration.Builder getBuilder(String registrationId); }
[ "grtlinux@gmail.com" ]
grtlinux@gmail.com
641299a1bf8ce037df6b2be94e80e5bdc76473b9
39793164aa0bba9cdf0ff0968457d0c5d7d44f8a
/src/test/java/com/mtsmda/souvenir/testNG/test/suiteTests/v2/TestOrder.java
69cd4624ba6ed61a94e765562a74a7382c8a239b
[]
no_license
akbars95/souvenir_project
41be7fda0bc745fe0da6fb81dfb13bcb4c2b641e
54719fb4b23209f21355b5410940451a0609b64a
refs/heads/master
2020-12-25T16:55:44.252185
2016-06-06T08:21:40
2016-06-06T08:21:40
52,782,163
0
0
null
null
null
null
UTF-8
Java
false
false
756
java
package com.mtsmda.souvenir.testNG.test.suiteTests.v2; import org.testng.annotations.Test; /** * Created by dminzat on 5/4/2016. */ public class TestOrder { private static final String ORDER_BO = "ORDER_BO"; private static final String SAVE = "SAVE"; @Test(groups = {ORDER_BO, SAVE}) public void testMakeOrder(){ System.out.println("testMakeOrder"); } @Test(groups = {ORDER_BO, SAVE}) public void testMakeEmptyOrder(){ System.out.println("testMakeEmptyOrder"); } @Test(groups = {ORDER_BO}) public void testUpdateOrder(){ System.out.println("testUpdateOrder"); } @Test(groups = {ORDER_BO}) public void testFindOrder(){ System.out.println("testFindOrder"); } }
[ "mynzat.dmitrii@gmail.com" ]
mynzat.dmitrii@gmail.com
42fa9ce9cca83a3d687f4fe169e6c06f61d140e6
8494c17b608e144370ee5848756b7c6ae38e8046
/gulimall-product/src/main/java/com/atguigu/gulimall/product/controller/ProductAttrValueController.java
4b7f3140b37efdc2d8481edfc09d276bbec51e86
[ "Apache-2.0" ]
permissive
cchaoqun/SideProject1_GuliMall
b235ee01df30bc207c747cf281108006482a778a
aef4c26b7ed4b6d17f7dcadd62e725f5ee68b13e
refs/heads/main
2023-06-11T02:23:28.729831
2021-07-07T11:56:13
2021-07-07T11:56:13
375,354,919
0
0
null
null
null
null
UTF-8
Java
false
false
2,486
java
package com.atguigu.gulimall.product.controller; import java.util.Arrays; import java.util.Map; //import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import com.atguigu.gulimall.product.entity.ProductAttrValueEntity; import com.atguigu.gulimall.product.service.ProductAttrValueService; import com.atguigu.common.utils.PageUtils; import com.atguigu.common.utils.R; /** * spu属性值 * * @author chengchaoqun * @email chengchaoqun@gmail.com * @date 2021-06-10 16:04:24 */ @RestController @RequestMapping("product/productattrvalue") public class ProductAttrValueController { @Autowired private ProductAttrValueService productAttrValueService; /** * 列表 */ @RequestMapping("/list") //@RequiresPermissions("product:productattrvalue:list") public R list(@RequestParam Map<String, Object> params){ PageUtils page = productAttrValueService.queryPage(params); return R.ok().put("page", page); } /** * 信息 */ @RequestMapping("/info/{id}") //@RequiresPermissions("product:productattrvalue:info") public R info(@PathVariable("id") Long id){ ProductAttrValueEntity productAttrValue = productAttrValueService.getById(id); return R.ok().put("productAttrValue", productAttrValue); } /** * 保存 */ @RequestMapping("/save") //@RequiresPermissions("product:productattrvalue:save") public R save(@RequestBody ProductAttrValueEntity productAttrValue){ productAttrValueService.save(productAttrValue); return R.ok(); } /** * 修改 */ @RequestMapping("/update") //@RequiresPermissions("product:productattrvalue:update") public R update(@RequestBody ProductAttrValueEntity productAttrValue){ productAttrValueService.updateById(productAttrValue); return R.ok(); } /** * 删除 */ @RequestMapping("/delete") //@RequiresPermissions("product:productattrvalue:delete") public R delete(@RequestBody Long[] ids){ productAttrValueService.removeByIds(Arrays.asList(ids)); return R.ok(); } }
[ "chengchaoqun@hotmail.com" ]
chengchaoqun@hotmail.com
a26aef297b653f08e7837fb1131a1a54c2fc8d1a
0bffcdd8c5f803627956bd7cec7b28d1cea00dc3
/src/main/java/com/google/android/gms/internal/zzaq.java
64104aca3accac7aff4ee154ae47282f02304efd
[]
no_license
sinzua/baseApk
eb5d8c28cdb385ec49413217151ebba7c2fbb723
9011fb631ed84b1747561244cc08fff38205e97c
refs/heads/master
2021-01-21T17:39:20.367401
2017-05-21T18:06:26
2017-05-21T18:06:26
91,977,496
3
2
null
null
null
null
UTF-8
Java
false
false
2,842
java
package com.google.android.gms.internal; import java.nio.ByteBuffer; import java.security.Key; import java.security.SecureRandom; import javax.crypto.Cipher; import javax.crypto.spec.IvParameterSpec; import javax.crypto.spec.SecretKeySpec; public class zzaq { private final zzap zznF; private final SecureRandom zzox; public class zza extends Exception { final /* synthetic */ zzaq zzoy; public zza(zzaq com_google_android_gms_internal_zzaq) { this.zzoy = com_google_android_gms_internal_zzaq; } public zza(zzaq com_google_android_gms_internal_zzaq, Throwable th) { this.zzoy = com_google_android_gms_internal_zzaq; super(th); } } public zzaq(zzap com_google_android_gms_internal_zzap, SecureRandom secureRandom) { this.zznF = com_google_android_gms_internal_zzap; this.zzox = secureRandom; } static void zze(byte[] bArr) { for (int i = 0; i < bArr.length; i++) { bArr[i] = (byte) (bArr[i] ^ 68); } } public byte[] zzc(byte[] bArr, String str) throws zza { if (bArr.length != 16) { throw new zza(this); } try { byte[] zza = this.zznF.zza(str, false); if (zza.length <= 16) { throw new zza(this); } ByteBuffer allocate = ByteBuffer.allocate(zza.length); allocate.put(zza); allocate.flip(); byte[] bArr2 = new byte[16]; zza = new byte[(zza.length - 16)]; allocate.get(bArr2); allocate.get(zza); Key secretKeySpec = new SecretKeySpec(bArr, "AES"); Cipher instance = Cipher.getInstance("AES/CBC/PKCS5Padding"); instance.init(2, secretKeySpec, new IvParameterSpec(bArr2)); return instance.doFinal(zza); } catch (Throwable e) { throw new zza(this, e); } catch (Throwable e2) { throw new zza(this, e2); } catch (Throwable e22) { throw new zza(this, e22); } catch (Throwable e222) { throw new zza(this, e222); } catch (Throwable e2222) { throw new zza(this, e2222); } catch (Throwable e22222) { throw new zza(this, e22222); } catch (Throwable e222222) { throw new zza(this, e222222); } } public byte[] zzl(String str) throws zza { try { byte[] zza = this.zznF.zza(str, false); if (zza.length != 32) { throw new zza(this); } byte[] bArr = new byte[16]; ByteBuffer.wrap(zza, 4, 16).get(bArr); zze(bArr); return bArr; } catch (Throwable e) { throw new zza(this, e); } } }
[ "sinzua@gmail.com" ]
sinzua@gmail.com
f9d84496d394c70eaa950b451d58f27469e044e0
aaabffe8bf55973bfb1390cf7635fd00ca8ca945
/src/test/java/com/microsoft/graph/core/MockBaseClient.java
37a7d6a495d71a304b1e4a3c48a546328a9e0c01
[ "MIT" ]
permissive
rgrebski/msgraph-sdk-java
e595e17db01c44b9c39d74d26cd925b0b0dfe863
759d5a81eb5eeda12d3ed1223deeafd108d7b818
refs/heads/master
2020-03-20T19:41:06.630857
2018-03-16T17:31:43
2018-03-16T17:31:43
137,648,798
0
0
null
2018-06-17T11:07:06
2018-06-17T11:07:05
null
UTF-8
Java
false
false
2,145
java
package com.microsoft.graph.core; import static org.junit.Assert.*; import org.junit.After; import org.junit.Before; import org.junit.Test; import com.microsoft.graph.authentication.IAuthenticationProvider; import com.microsoft.graph.concurrency.IExecutors; import com.microsoft.graph.http.IHttpProvider; import com.microsoft.graph.logger.ILogger; import com.microsoft.graph.serializer.ISerializer; public class MockBaseClient implements IBaseClient { private static final String DEFAULT_GRAPH_ENDPOINT = "https://graph.microsoft.com/v1.0"; private String mEndpoint; private IAuthenticationProvider mAuthenticationProvider; private IExecutors mExecutors; private IHttpProvider mHttpProvider; private ILogger mLogger; private ISerializer mSerializer; @Override public IAuthenticationProvider getAuthenticationProvider() { return mAuthenticationProvider; } @Override public String getServiceRoot() { if(mEndpoint == null) { mEndpoint = DEFAULT_GRAPH_ENDPOINT; } return mEndpoint; } @Override public void setServiceRoot(String value) { mEndpoint = value; } @Override public IExecutors getExecutors() { return mExecutors; } @Override public IHttpProvider getHttpProvider() { return mHttpProvider; } @Override public ILogger getLogger() { return mLogger; } @Override public ISerializer getSerializer() { return mSerializer; } @Override public void validate() { } public void setLogger(final ILogger logger) { mLogger = logger; } public void setExecutors(final IExecutors executors) { mExecutors = executors; } public void setAuthenticationProvider(final IAuthenticationProvider authenticationProvider) { mAuthenticationProvider = authenticationProvider; } public void setHttpProvider(final IHttpProvider httpProvider) { mHttpProvider = httpProvider; } public void setSerializer(final ISerializer serializer) { mSerializer = serializer; } }
[ "caitbal@microsoft.com" ]
caitbal@microsoft.com
28401f774ca0d844b89f9dc6a4fe42aff4d18673
1d928c3f90d4a0a9a3919a804597aa0a4aab19a3
/java/neo4j/2019/8/CommunityNeoServer.java
61672fb1b7699e4d55dcff1109cc019b36b90288
[]
no_license
rosoareslv/SED99
d8b2ff5811e7f0ffc59be066a5a0349a92cbb845
a062c118f12b93172e31e8ca115ce3f871b64461
refs/heads/main
2023-02-22T21:59:02.703005
2021-01-28T19:40:51
2021-01-28T19:40:51
306,497,459
1
1
null
2020-11-24T20:56:18
2020-10-23T01:18:07
null
UTF-8
Java
false
false
3,583
java
/* * Copyright (c) 2002-2019 "Neo4j," * Neo4j Sweden AB [http://neo4j.com] * * This file is part of Neo4j. * * Neo4j is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package org.neo4j.server; import java.util.Arrays; import java.util.function.Supplier; import org.neo4j.configuration.Config; import org.neo4j.configuration.connectors.ConnectorPortRegister; import org.neo4j.graphdb.facade.ExternalDependencies; import org.neo4j.kernel.api.net.NetworkConnectionTracker; import org.neo4j.server.database.CommunityGraphFactory; import org.neo4j.server.database.GraphFactory; import org.neo4j.server.modules.AuthorizationModule; import org.neo4j.server.modules.DBMSModule; import org.neo4j.server.modules.DatabaseModule; import org.neo4j.server.modules.LegacyTransactionModule; import org.neo4j.server.modules.Neo4jBrowserModule; import org.neo4j.server.modules.ServerModule; import org.neo4j.server.modules.ThirdPartyJAXRSModule; import org.neo4j.server.rest.discovery.DiscoverableURIs; import org.neo4j.server.web.Jetty9WebServer; import org.neo4j.server.web.WebServer; import static org.neo4j.server.rest.discovery.CommunityDiscoverableURIs.communityDiscoverableURIs; public class CommunityNeoServer extends AbstractNeoServer { public CommunityNeoServer( Config config, ExternalDependencies dependencies ) { this( config, new CommunityGraphFactory(), dependencies ); } public CommunityNeoServer( Config config, GraphFactory graphFactory, ExternalDependencies dependencies ) { super( config, graphFactory, dependencies ); } @Override protected Iterable<ServerModule> createServerModules() { return Arrays.asList( createDBMSModule(), new DatabaseModule( webServer, getConfig() ), new LegacyTransactionModule( webServer, getConfig() ), new ThirdPartyJAXRSModule( webServer, getConfig(), userLogProvider, this ), new Neo4jBrowserModule( webServer ), createAuthorizationModule() ); } @Override protected WebServer createWebServer() { NetworkConnectionTracker connectionTracker = getSystemDatabaseDependencyResolver().resolveDependency( NetworkConnectionTracker.class ); return new Jetty9WebServer( userLogProvider, getConfig(), connectionTracker ); } protected DBMSModule createDBMSModule() { // ConnectorPortRegister isn't available until runtime, so defer loading until then Supplier<DiscoverableURIs> discoverableURIs = () -> communityDiscoverableURIs( getConfig(), getSystemDatabaseDependencyResolver().resolveDependency( ConnectorPortRegister.class ) ); return new DBMSModule( webServer, getConfig(), discoverableURIs, userLogProvider ); } protected AuthorizationModule createAuthorizationModule() { return new AuthorizationModule( webServer, authManagerSupplier, userLogProvider, getConfig(), getUriWhitelist() ); } }
[ "rodrigosoaresilva@gmail.com" ]
rodrigosoaresilva@gmail.com
8c06d74d65ba48f1ebe46819f02ba9940a62bd01
8b5c955989280412e2e7fca4453722d090c3b347
/Data Structure and Algorithm in Java, Second Edition/First Time/Chapter 4 Stacks and Queues/Queue/Queue.java
fb645172d85c1a6fcda8949409a1a7eb7e2dcce0
[]
no_license
david2999999/Java-Algorithm
a8962629819df73a9b9c733e5f8be91952747554
8e235826b2e7e864f1fd991dbaa2dbb44caaab8c
refs/heads/master
2021-06-03T23:09:13.092268
2020-03-22T18:42:21
2020-03-22T18:42:21
146,636,630
3
0
null
null
null
null
UTF-8
Java
false
false
1,912
java
class Queue { private int maxSize; private long[] queArray; private int front; private int rear; private int nItems; //-------------------------------------------------------------- public Queue(int s) // constructor { maxSize = s; queArray = new long[maxSize]; front = 0; rear = -1; nItems = 0; } //-------------------------------------------------------------- public void insert(long j) // put item at rear of queue { if(rear == maxSize-1) // deal with wraparound rear = -1; queArray[++rear] = j; // increment rear and insert nItems++; // one more item } //-------------------------------------------------------------- public long remove() // take item from front of queue { long temp = queArray[front++]; // get value and incr front if(front == maxSize) // deal with wraparound front = 0; nItems--; // one less item return temp; } //-------------------------------------------------------------- public long peekFront() // peek at front of queue { return queArray[front]; } //-------------------------------------------------------------- public boolean isEmpty() // true if queue is empty { return (nItems==0); } //-------------------------------------------------------------- public boolean isFull() // true if queue is full { return (nItems==maxSize); } //-------------------------------------------------------------- public int size() // number of items in queue { return nItems; } //-------------------------------------------------------------- } // end class Queue ////////////////////////////////////////////////////////////////
[ "djiang86@binghamton.edu" ]
djiang86@binghamton.edu
e14169485112358814e5222b91e1fbd3b7691dd4
928017ebef4ddabc2b50af8d8e176d58d1fa2d0b
/1.6/src/org/drip/math/solver1D/DerivativeControl.java
c712682af58b2a72a883f32e23db5f8a77d27c2d
[ "Apache-2.0" ]
permissive
Lakshmik/RootFinder
7a07a969813524a0180eac9f29dbca955f09cda8
27b8f52a0116bf25d3a78c20a2626c197d30f5c1
refs/heads/master
2020-05-18T16:17:21.877476
2016-10-14T03:03:08
2016-10-14T03:03:08
7,998,143
0
1
null
null
null
null
UTF-8
Java
false
false
2,658
java
package org.drip.math.solver1D; /* * -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /*! * Copyright (C) 2012 Lakshmi Krishnamurthy * * This file is part of CreditAnalytics, a free-software/open-source library for fixed income analysts and * developers - http://www.credit-trader.org * * CreditAnalytics is a free, full featured, fixed income credit analytics library, developed with a special * focus towards the needs of the bonds and credit products community. * * 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. */ /** * DerivativeControl provides bumps needed for numerically approximating derivatives. * * @author Lakshmi Krishnamurthy */ public class DerivativeControl { private static final double ABSOLUTE_INCREMENT = 1.e-07; private static final double RELATIVE_INCREMENT = 1.e-06; private double _dblBumpFactor = RELATIVE_INCREMENT; /** * Empty DerivativeControl constructor */ public DerivativeControl() { } /** * DerivativeControl constructor * * @param dblBumpFactor Bump Factor * * @throws java.lang.Exception Thrown if inputs are invalid */ public DerivativeControl ( final double dblBumpFactor) throws java.lang.Exception { if (!org.drip.math.common.NumberUtil.IsValid (_dblBumpFactor)) throw new java.lang.Exception ("DerivativeControl constructor: Invalid inputs!"); } /** * Retrieve the bump factor * * @return The Bump Factor */ public double getBumpFactor() { return _dblBumpFactor; } /** * Calculate and return the variate infinitesimal * * @param dblVariate Variate Input * * @return Variate Infinitesimal */ public double getVariateInfinitesimal ( final double dblVariate) throws java.lang.Exception { if (!org.drip.math.common.NumberUtil.IsValid (dblVariate)) throw new java.lang.Exception ("DerivativeControl.getVariateInfinitesimal => Invalid input"); double dblVariateInfinitesimal = dblVariate * getBumpFactor(); if (java.lang.Math.abs (dblVariateInfinitesimal) < ABSOLUTE_INCREMENT) return ABSOLUTE_INCREMENT; return dblVariateInfinitesimal; } }
[ "lakshmi7977@gmail.com" ]
lakshmi7977@gmail.com
028602e27ab23876c8bf3e8841369f57de340631
c0892bccab8f93e7f9ff9c01b36c57d18829f432
/app/src/main/java/com/tutorials/hp/listviewsqliteimages/mListView/MyHolder.java
1f8d25a758dfdd4b1bb44938dd1f467bf99a0d74
[]
no_license
liberaljunior/ListViewSQLiteImages
175a067c07a2e4d0acfa9105911451a7d9c148a2
8f8066d229cfee4b620176db288789e9e1e7e93e
refs/heads/master
2022-01-28T20:51:56.503781
2018-11-12T01:26:03
2018-11-12T01:26:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
535
java
package com.tutorials.hp.listviewsqliteimages.mListView; import android.view.View; import android.widget.ImageView; import android.widget.TextView; import com.tutorials.hp.listviewsqliteimages.R; /** * Created by Oclemmy on 4/29/2016 for ProgrammingWizards Channel and http://www.Camposha.com. */ public class MyHolder { TextView nameTxt; ImageView img; public MyHolder(View v) { this.nameTxt= (TextView) v.findViewById(R.id.nameTxt); this.img= (ImageView) v.findViewById(R.id.movieImage); } }
[ "oclemmi@gmail.com" ]
oclemmi@gmail.com
31448eb7fc446afcd34263376c737c2615ee0a74
cefac8c244886494e3b052f474b1f831af096cfb
/src/main/java/com/ssi/FunctionCall.java
384ab50b7ee219e258211009f23f00c16bcda1a8
[]
no_license
ssiedu/hibernate-example-wp-training-2
63d10b53800448c1e49fa525852687f4dfbf6bc5
496afe595f853cca53b7c4f95a5b86041ffbb95e
refs/heads/master
2022-07-06T04:47:34.000427
2019-12-05T09:32:31
2019-12-05T09:32:31
220,168,972
0
0
null
2022-02-10T01:41:47
2019-11-07T06:40:48
Java
UTF-8
Java
false
false
912
java
package com.ssi; import java.sql.CallableStatement; import java.sql.Connection; import java.sql.SQLException; import java.sql.Types; import org.hibernate.Session; import org.hibernate.jdbc.ReturningWork; public class FunctionCall { public static void main(String[] args) { try(Session session=DataUtility.getSessionFactory().openSession()){ String s=session.doReturningWork(new ReturningWork<String>() { @Override public String execute(Connection connection) throws SQLException { String res="OK"; try { CallableStatement cs=connection.prepareCall("{?=call getGrade(?)}"); cs.registerOutParameter(1, Types.VARCHAR); cs.setInt(2, 11); cs.execute(); res=cs.getString(1); }catch(Exception ex) { ex.printStackTrace(); } return res; } }); System.out.println(s); } } }
[ "manojs121@rediffmail.com" ]
manojs121@rediffmail.com
ddaa9d3bb8e8a68af1c02bc46d5c912ad99cf511
bfdc97a14bc688eb94f5e6554e37f8ba751ef3ae
/bai_thi_cu/ket_noi/ketNoi/demo/src/main/java/com/example/demo/controller/CarController.java
cdc42cd3e083f07516d9d9e5bdc7b94647155e44
[]
no_license
phucnguyen1995/C0421G1_NguyenKhacPhuc_Module6
3dbaa0a78e5b93785e861564c6cc842ce486d182
760a27db511813c826ff4d2c73768062b0ba6d51
refs/heads/master
2023-09-01T13:59:23.327307
2021-10-18T07:05:28
2021-10-18T07:05:28
418,348,025
0
0
null
null
null
null
UTF-8
Java
false
false
2,610
java
package com.example.demo.controller; import com.example.demo.dto.CarDto; import com.example.demo.model.entity.Car; import com.example.demo.model.service.ICarService; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import java.util.List; import java.util.Optional; @CrossOrigin(origins = "*") @RestController @RequestMapping("car/api") public class CarController { @Autowired private ICarService iCarService; @GetMapping public ResponseEntity<List<Car>> getCarList() { List<Car> carList = this.iCarService.findAll(); if (carList.isEmpty()) { return new ResponseEntity<>(HttpStatus.NO_CONTENT); } return new ResponseEntity<>(carList, HttpStatus.OK); } @GetMapping("/{id}") public ResponseEntity<Car> getCarDetail(@PathVariable("id") Long id) { Car car = iCarService.findById(id); if (car==null) { return new ResponseEntity<>( HttpStatus.NOT_FOUND); } return new ResponseEntity<>(car,HttpStatus.OK); } @PostMapping("/create") public ResponseEntity addCar(@RequestBody CarDto carDto) { Car car = new Car(); BeanUtils.copyProperties(carDto,car); iCarService.save(car); return new ResponseEntity(car,HttpStatus.OK); } @PutMapping("/{id}") public ResponseEntity<Car> updateCar(@PathVariable Long id, @RequestBody CarDto carDto) { Car car = iCarService.findById(id); if (car==null) { return new ResponseEntity<>(HttpStatus.NOT_FOUND); } car.setGarage(carDto.getGarage()); car.setLicensePlates(carDto.getLicensePlates()); car.setCarType(carDto.getCarType()); car.setStartAddress(carDto.getStartAddress()); car.setEndAddress(carDto.getEndAddress()); car.setEmail(carDto.getEmail()); car.setPhone(carDto.getPhone()); car.setStartHour(carDto.getStartHour()); iCarService.save(car); return new ResponseEntity<>(car,HttpStatus.OK); } @DeleteMapping("/{id}") public ResponseEntity<Car> deleteCar(@PathVariable Long id) { Car currentCar = iCarService.findById(id); if (currentCar==null) { return new ResponseEntity<>(HttpStatus.NOT_FOUND); } iCarService.delete(id); return new ResponseEntity<>(HttpStatus.OK); } }
[ "phuckhac1995@gmail.com" ]
phuckhac1995@gmail.com
9dcdb56b148bd12e32eaff82b6c92c0454b658cc
2e727a58fcebe70520d8473961713833e9805347
/app/src/main/java/com/lichao/chaovolley/db/BaseDaoFactory.java
950936d27efe82aeb276fc7d0b2dc9565a5c187a
[]
no_license
lichao3140/ChaoVolley
cf5273c0aabb0202e3ee96e0d09d67ae905f72ee
e0b09ad16a42f6b51fa5f681f10aa29c17decbf1
refs/heads/master
2021-09-06T10:02:52.776150
2018-02-05T09:19:06
2018-02-05T09:19:06
119,813,229
0
0
null
null
null
null
UTF-8
Java
false
false
2,335
java
package com.lichao.chaovolley.db; import android.database.sqlite.SQLiteDatabase; import android.os.Environment; import java.io.File; import java.util.Collections; import java.util.HashMap; import java.util.Map; /** * Created by Administrator on 2018-02-03. */ public class BaseDaoFactory { private String sqliteDatabasePath; private SQLiteDatabase sqLiteDatabase; //-------------添加------------- private SQLiteDatabase userDatabase; private Map<String,BaseDao> map = Collections.synchronizedMap(new HashMap<String, BaseDao>()); private static BaseDaoFactory instance = new BaseDaoFactory(); public static BaseDaoFactory getInstance() { return instance; } private BaseDaoFactory() { File file = new File(Environment.getExternalStorageDirectory(),"update"); if (!file.exists()) { file.mkdirs(); } sqliteDatabasePath = file.getAbsolutePath() + "/user.db"; openDatabase(); } private void openDatabase() { this.sqLiteDatabase=SQLiteDatabase.openOrCreateDatabase(sqliteDatabasePath,null); } public synchronized <T extends BaseDao<M>,M> T getUserHelper(Class<T> clazz,Class<M> entityClass) { userDatabase = SQLiteDatabase.openOrCreateDatabase(PrivateDataBaseEnums.database.getValue(), null); BaseDao baseDao=null; try { baseDao=clazz.newInstance(); baseDao.init(entityClass,userDatabase); map.put(clazz.getSimpleName(),baseDao); } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } return (T) baseDao; } public synchronized <T extends BaseDao<M>,M> T getDataHelper(Class<T> clazz,Class<M> entityClass) { BaseDao baseDao=null; if(map.get(clazz.getSimpleName())!=null) { return (T) map.get(clazz.getSimpleName()); } try { baseDao=clazz.newInstance(); baseDao.init(entityClass,sqLiteDatabase); map.put(clazz.getSimpleName(),baseDao); } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } return (T) baseDao; } }
[ "396229938@qq.com" ]
396229938@qq.com
8dd6db0780a376f9e657fe7fef3e526ef9ce0c13
15a807f6c8cad5b8a76889e7e926d978fb01820c
/app/src/main/java/com/eleganzit/tag/ApplyCompetitive.java
56fbf1ae6b31694c3195dbcd242861a049e4dc77
[]
no_license
ritueleganzit/TAG
a82316d6e431df70ed9cada9c94f8d22244744f7
f90cc2fe7b0a711215051da792678b166658fc91
refs/heads/master
2020-07-24T06:00:35.734501
2019-12-06T13:29:56
2019-12-06T13:29:56
207,820,845
0
0
null
null
null
null
UTF-8
Java
false
false
518
java
package com.eleganzit.tag; public class ApplyCompetitive { String name,mark,rank; public ApplyCompetitive() { } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getMark() { return mark; } public void setMark(String mark) { this.mark = mark; } public String getRank() { return rank; } public void setRank(String rank) { this.rank = rank; } }
[ "ritu.eleganzit@gmail.com" ]
ritu.eleganzit@gmail.com
ddd53e86eaa360acaf2e93f4dd57e93317ddebe6
a1826c2ed9c12cfc395fb1a14c1a2e1f097155cb
/oss-20190517/src/main/java/com/aliyun/oss20190517/models/Delete.java
ca867f924af5928cdfe608cef692a31f43c2c0dd
[ "Apache-2.0" ]
permissive
aliyun/alibabacloud-java-sdk
83a6036a33c7278bca6f1bafccb0180940d58b0b
008923f156adf2e4f4785a0419f60640273854ec
refs/heads/master
2023-09-01T04:10:33.640756
2023-09-01T02:40:45
2023-09-01T02:40:45
288,968,318
40
45
null
2023-06-13T02:47:13
2020-08-20T09:51:08
Java
UTF-8
Java
false
false
849
java
// This file is auto-generated, don't edit it. Thanks. package com.aliyun.oss20190517.models; import com.aliyun.tea.*; public class Delete extends TeaModel { @NameInMap("Object") public java.util.List<ObjectIdentifier> objects; @NameInMap("Quiet") public Boolean quiet; public static Delete build(java.util.Map<String, ?> map) throws Exception { Delete self = new Delete(); return TeaModel.build(map, self); } public Delete setObjects(java.util.List<ObjectIdentifier> objects) { this.objects = objects; return this; } public java.util.List<ObjectIdentifier> getObjects() { return this.objects; } public Delete setQuiet(Boolean quiet) { this.quiet = quiet; return this; } public Boolean getQuiet() { return this.quiet; } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
c993dac173ebac83406aaab1ced756c64ce58e32
6dbae30c806f661bcdcbc5f5f6a366ad702b1eea
/Corpus/tomcat70/247.java
650ee96ab28b0a3796f03ef152d4d555aefd8f88
[ "MIT" ]
permissive
SurfGitHub/BLIZZARD-Replication-Package-ESEC-FSE2018
d3fd21745dfddb2979e8ac262588cfdfe471899f
0f8f4affd0ce1ecaa8ff8f487426f8edd6ad02c0
refs/heads/master
2020-03-31T15:52:01.005505
2018-10-01T23:38:50
2018-10-01T23:38:50
152,354,327
1
0
MIT
2018-10-10T02:57:02
2018-10-10T02:57:02
null
UTF-8
Java
false
false
3,970
java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.tomcat.websocket; import java.io.IOException; import java.nio.ByteBuffer; import java.util.List; import javax.websocket.Extension; /** * The internal representation of the transformation that a WebSocket extension * performs on a message. */ public interface Transformation { /** * Sets the next transformation in the pipeline. */ void setNext(Transformation t); /** * Validate that the RSV bit(s) required by this transformation are not * being used by another extension. The implementation is expected to set * any bits it requires before passing the set of in-use bits to the next * transformation. * * @param i The RSV bits marked as in use so far as an int in the * range zero to seven with RSV1 as the MSB and RSV3 as the * LSB * * @return <code>true</code> if the combination of RSV bits used by the * transformations in the pipeline do not conflict otherwise * <code>false</code> */ boolean validateRsvBits(int i); /** * Obtain the extension that describes the information to be returned to the * client. */ Extension getExtensionResponse(); /** * Obtain more input data. * * @param opCode The opcode for the frame currently being processed * @param fin Is this the final frame in this WebSocket message? * @param rsv The reserved bits for the frame currently being * processed * @param dest The buffer in which the data is to be written */ TransformationResult getMoreData(byte opCode, boolean fin, int rsv, ByteBuffer dest) throws IOException; /** * Validates the RSV and opcode combination (assumed to have been extracted * from a WebSocket Frame) for this extension. The implementation is * expected to unset any RSV bits it has validated before passing the * remaining RSV bits to the next transformation in the pipeline. * * @param rsv The RSV bits received as an int in the range zero to * seven with RSV1 as the MSB and RSV3 as the LSB * @param opCode The opCode received * * @return <code>true</code> if the RSV is valid otherwise * <code>false</code> */ boolean validateRsv(int rsv, byte opCode); /** * Takes the provided list of messages, transforms them, passes the * transformed list on to the next transformation (if any) and then returns * the resulting list of message parts after all of the transformations have * been applied. * * @param messageParts The list of messages to be transformed * * @return The list of messages after this any any subsequent * transformations have been applied. The size of the returned list * may be bigger or smaller than the size of the input list */ List<MessagePart> sendMessagePart(List<MessagePart> messageParts); /** * Clean-up any resources that were used by the transformation. */ void close(); }
[ "masudcseku@gmail.com" ]
masudcseku@gmail.com
24ae6fcdf4f9c5b3b57f2007092180324361839e
90eb7a131e5b3dc79e2d1e1baeed171684ef6a22
/sources/com/google/android/material/floatingactionbutton/FloatingActionButtonImplLollipop.java
8d089dc0f3a7d4d7b1e086696585b6a9f8fdf1e5
[]
no_license
shalviraj/greenlens
1c6608dca75ec204e85fba3171995628d2ee8961
fe9f9b5a3ef4a18f91e12d3925e09745c51bf081
refs/heads/main
2023-04-20T13:50:14.619773
2021-04-26T15:45:11
2021-04-26T15:45:11
361,799,768
0
0
null
null
null
null
UTF-8
Java
false
false
7,421
java
package com.google.android.material.floatingactionbutton; import android.animation.Animator; import android.animation.AnimatorSet; import android.animation.ObjectAnimator; import android.animation.StateListAnimator; import android.content.Context; import android.content.res.ColorStateList; import android.graphics.PorterDuff; import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.graphics.drawable.LayerDrawable; import android.graphics.drawable.RippleDrawable; import android.os.Build; import android.view.View; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.RequiresApi; import androidx.constraintlayout.motion.widget.Key; import androidx.core.content.ContextCompat; import androidx.core.util.Preconditions; import com.google.android.material.C5480R; import com.google.android.material.ripple.RippleUtils; import com.google.android.material.shadow.ShadowViewDelegate; import com.google.android.material.shape.MaterialShapeDrawable; import com.google.android.material.shape.ShapeAppearanceModel; import java.util.ArrayList; @RequiresApi(21) public class FloatingActionButtonImplLollipop extends FloatingActionButtonImpl { public static class AlwaysStatefulMaterialShapeDrawable extends MaterialShapeDrawable { public AlwaysStatefulMaterialShapeDrawable(ShapeAppearanceModel shapeAppearanceModel) { super(shapeAppearanceModel); } public boolean isStateful() { return true; } } public FloatingActionButtonImplLollipop(FloatingActionButton floatingActionButton, ShadowViewDelegate shadowViewDelegate) { super(floatingActionButton, shadowViewDelegate); } @NonNull private Animator createElevationAnimator(float f, float f2) { AnimatorSet animatorSet = new AnimatorSet(); animatorSet.play(ObjectAnimator.ofFloat(this.view, Key.ELEVATION, new float[]{f}).setDuration(0)).with(ObjectAnimator.ofFloat(this.view, View.TRANSLATION_Z, new float[]{f2}).setDuration(100)); animatorSet.setInterpolator(FloatingActionButtonImpl.ELEVATION_ANIM_INTERPOLATOR); return animatorSet; } @NonNull public BorderDrawable createBorderDrawable(int i, ColorStateList colorStateList) { Context context = this.view.getContext(); BorderDrawable borderDrawable = new BorderDrawable((ShapeAppearanceModel) Preconditions.checkNotNull(this.shapeAppearance)); borderDrawable.setGradientColors(ContextCompat.getColor(context, C5480R.C5481color.design_fab_stroke_top_outer_color), ContextCompat.getColor(context, C5480R.C5481color.design_fab_stroke_top_inner_color), ContextCompat.getColor(context, C5480R.C5481color.design_fab_stroke_end_inner_color), ContextCompat.getColor(context, C5480R.C5481color.design_fab_stroke_end_outer_color)); borderDrawable.setBorderWidth((float) i); borderDrawable.setBorderTint(colorStateList); return borderDrawable; } @NonNull public MaterialShapeDrawable createShapeDrawable() { return new AlwaysStatefulMaterialShapeDrawable((ShapeAppearanceModel) Preconditions.checkNotNull(this.shapeAppearance)); } public float getElevation() { return this.view.getElevation(); } public void getPadding(@NonNull Rect rect) { if (this.shadowViewDelegate.isCompatPaddingEnabled()) { super.getPadding(rect); return; } int sizeDimension = !shouldExpandBoundsForA11y() ? (this.minTouchTargetSize - this.view.getSizeDimension()) / 2 : 0; rect.set(sizeDimension, sizeDimension, sizeDimension, sizeDimension); } public void initializeBackgroundDrawable(ColorStateList colorStateList, @Nullable PorterDuff.Mode mode, ColorStateList colorStateList2, int i) { Drawable drawable; MaterialShapeDrawable createShapeDrawable = createShapeDrawable(); this.shapeDrawable = createShapeDrawable; createShapeDrawable.setTintList(colorStateList); if (mode != null) { this.shapeDrawable.setTintMode(mode); } this.shapeDrawable.initializeElevationOverlay(this.view.getContext()); if (i > 0) { this.borderDrawable = createBorderDrawable(i, colorStateList); drawable = new LayerDrawable(new Drawable[]{(Drawable) Preconditions.checkNotNull(this.borderDrawable), (Drawable) Preconditions.checkNotNull(this.shapeDrawable)}); } else { this.borderDrawable = null; drawable = this.shapeDrawable; } RippleDrawable rippleDrawable = new RippleDrawable(RippleUtils.sanitizeRippleDrawableColor(colorStateList2), drawable, (Drawable) null); this.rippleDrawable = rippleDrawable; this.contentBackground = rippleDrawable; } public void jumpDrawableToCurrentState() { } public void onCompatShadowChanged() { updatePadding(); } public void onDrawableStateChanged(int[] iArr) { } public void onElevationsChanged(float f, float f2, float f3) { int i = Build.VERSION.SDK_INT; StateListAnimator stateListAnimator = new StateListAnimator(); stateListAnimator.addState(FloatingActionButtonImpl.PRESSED_ENABLED_STATE_SET, createElevationAnimator(f, f3)); stateListAnimator.addState(FloatingActionButtonImpl.HOVERED_FOCUSED_ENABLED_STATE_SET, createElevationAnimator(f, f2)); stateListAnimator.addState(FloatingActionButtonImpl.FOCUSED_ENABLED_STATE_SET, createElevationAnimator(f, f2)); stateListAnimator.addState(FloatingActionButtonImpl.HOVERED_ENABLED_STATE_SET, createElevationAnimator(f, f2)); AnimatorSet animatorSet = new AnimatorSet(); ArrayList arrayList = new ArrayList(); arrayList.add(ObjectAnimator.ofFloat(this.view, Key.ELEVATION, new float[]{f}).setDuration(0)); if (i <= 24) { FloatingActionButton floatingActionButton = this.view; arrayList.add(ObjectAnimator.ofFloat(floatingActionButton, View.TRANSLATION_Z, new float[]{floatingActionButton.getTranslationZ()}).setDuration(100)); } arrayList.add(ObjectAnimator.ofFloat(this.view, View.TRANSLATION_Z, new float[]{0.0f}).setDuration(100)); animatorSet.playSequentially((Animator[]) arrayList.toArray(new Animator[0])); animatorSet.setInterpolator(FloatingActionButtonImpl.ELEVATION_ANIM_INTERPOLATOR); stateListAnimator.addState(FloatingActionButtonImpl.ENABLED_STATE_SET, animatorSet); stateListAnimator.addState(FloatingActionButtonImpl.EMPTY_STATE_SET, createElevationAnimator(0.0f, 0.0f)); this.view.setStateListAnimator(stateListAnimator); if (shouldAddPadding()) { updatePadding(); } } public boolean requirePreDrawListener() { return false; } public void setRippleColor(@Nullable ColorStateList colorStateList) { Drawable drawable = this.rippleDrawable; if (drawable instanceof RippleDrawable) { ((RippleDrawable) drawable).setColor(RippleUtils.sanitizeRippleDrawableColor(colorStateList)); } else { super.setRippleColor(colorStateList); } } public boolean shouldAddPadding() { return this.shadowViewDelegate.isCompatPaddingEnabled() || !shouldExpandBoundsForA11y(); } public void updateFromViewRotation() { } }
[ "73280944+shalviraj@users.noreply.github.com" ]
73280944+shalviraj@users.noreply.github.com
9f04c235306fff9577b9c9c734b4cf4ea33a0399
7fee790d4d50b25e17ad679346d0876783a121bd
/src/main/java/chap3/phaser_test9/Run1.java
37bb5ae2d59d1c6251521b4e7c0a79de9e9a77c7
[]
no_license
hjy628/concurrency-practice
e9523a2c941cbf27ca8c26d394bd370af946650b
ea2437e024e22efe7e1a38efdebb91931733088f
refs/heads/master
2021-05-07T03:10:30.509441
2017-11-23T08:12:33
2017-11-23T08:12:33
110,631,352
0
0
null
null
null
null
UTF-8
Java
false
false
513
java
package chap3.phaser_test9; import chap3.phaser_test9.extthread.PThreadA; import chap3.phaser_test9.extthread.PThreadB; import java.util.concurrent.Phaser; /** * Created by hjy on 17-11-15. */ public class Run1 { public static void main(String[] args) throws InterruptedException{ Phaser phaser = new Phaser(3); PThreadA a = new PThreadA(phaser); a.setName("A"); a.start(); PThreadB b = new PThreadB(phaser); b.setName("B"); b.start(); } }
[ "hjy628@gmail.com" ]
hjy628@gmail.com
429d0262836947136b4488d0bcd44fa511ed6d98
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/MOCKITO-9b-5-24-NSGA_II-LineCoverage:ExceptionType:StackTraceSimilarity/org/mockito/internal/handler/NullResultGuardian_ESTest.java
f204ce1abfd325c06a90277b1f44900bbbbe4199
[]
no_license
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
cf118b23ecb87a8bf59643e42f7556b521d1f754
3bb39683f9c343b8ec94890a00b8f260d158dfe3
refs/heads/master
2022-07-29T14:44:00.774547
2020-08-10T15:14:49
2020-08-10T15:14:49
285,804,495
0
0
null
null
null
null
UTF-8
Java
false
false
571
java
/* * This file was automatically generated by EvoSuite * Mon Apr 06 10:23:20 UTC 2020 */ package org.mockito.internal.handler; import org.junit.Test; import static org.junit.Assert.*; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true) public class NullResultGuardian_ESTest extends NullResultGuardian_ESTest_scaffolding { @Test public void notGeneratedAnyTest() { // EvoSuite did not generate any tests } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
7754c4d14eb5ccd7d89481ac18011f4d1fe8e36f
b8b7e7f84e5dd812bbd70a72e9bc38c97f93950a
/extras/org.polymap.rhei.birt/src/org/polymap/rhei/birt/mapImage/MapImagePresentation.java
1dc47de3a5953eda01172b73e93746dfd2d0ac94
[]
no_license
Polymap3/polymap3-rhei
8125d4d18aabd3bd065cfa15915d3accee28ec66
c60d3c715074b0eee071bc9f5656a0c80baa8a89
refs/heads/master
2021-01-18T22:36:46.223268
2016-06-29T16:37:00
2016-06-29T16:37:00
31,905,076
0
2
null
null
null
null
UTF-8
Java
false
false
5,777
java
package org.polymap.rhei.birt.mapImage; import org.eclipse.birt.core.exception.BirtException; import org.eclipse.birt.report.engine.extension.IReportItemPresentation; import org.eclipse.birt.report.engine.extension.IRowSet; import org.eclipse.birt.report.engine.extension.ReportItemPresentationBase; import org.eclipse.birt.report.model.api.DimensionHandle; import org.eclipse.birt.report.model.api.ExtendedItemHandle; import org.eclipse.birt.report.model.api.elements.DesignChoiceConstants; import org.eclipse.birt.report.model.api.util.DimensionUtil; import org.eclipse.draw2d.IFigure; import org.polymap.rhei.birt.DesignerPlugin; /** * This class provides the rendering capabilities for the report item. When the * report item is used in a report design, and the report is viewed, the methods in * this class are invoked to perform the actual rendering of the user defined report * item. * * @author <a href="mailto:falko@polymap.de">Falko Bräutigam</a> */ public class MapImagePresentation extends ReportItemPresentationBase implements IReportItemPresentation { private int dpi = 96; public void setModelObject( ExtendedItemHandle modelHandle ) { this.modelHandle = modelHandle; } public int getOutputType() { return OUTPUT_AS_IMAGE; } /** * @return the image MIME type (e.g. "image/svg+xml") */ public String getImageMIMEType() { return "image/jpg"; } // public Size getSize() { // // XXX Auto-generated method stub // throw new RuntimeException( "not yet implemented." ); // } public void setResolution( int dpi ) { System.out.println( "DPI: " + dpi ); this.dpi = dpi; } @Override public Object onRowSets( IRowSet[] rowSets ) throws BirtException { if (modelHandle == null) { return null; } try { // int pixelWidth = convertToPixels( modelHandle.getWidth(), dpi, null ); // System.out.println( "pixelWidth:" + pixelWidth ); // // int pixelHeight = convertToPixels( modelHandle.getHeight(), dpi, null ); // System.out.println( "pixelHeight:" + pixelHeight ); WorkbenchConnector connector = new WorkbenchConnector( "http://localhost:10080", "admin", "login" ); return connector.mapImage( 300, 300 ); // // inside polymap // if (PolymapAdapter.runsInsidePolymap()) { // System.out.println( "Inside Polymap..." ); // return PolymapAdapter.currentMapImage( pixelWidth, pixelHeight ); // } // // inside designer // else { // System.out.println( "Not inside Polymap..." ); // DesignerRepresentation dr = new DesignerRepresentation( null ); // dr.updateImage( new Dimension( pixelWidth, pixelHeight) ); // // ImageLoader imageLoader = new ImageLoader(); // imageLoader.data = new ImageData[] { dr.getImage().getImageData() }; // ByteArrayOutputStream baos = new ByteArrayOutputStream(); // imageLoader.save( baos, SWT.IMAGE_JPEG ); // // return baos.toByteArray(); // } } catch (Exception e) { return new BirtException( DesignerPlugin.PLUGIN_ID, "POLYMAP_", new Object[] {}, e ); } } public void finish() { super.finish(); } /** * * @param dim * @param dpi * @param df * @return */ public static int convertToPixels( DimensionHandle dim, int dpi, IFigure df ) { double value = dim.getMeasure(); String units = dim.getUnits(); System.out.println( "---dim: " + value + " (" + units + ")" ); int result = -1; // absolute units if (DimensionUtil.isAbsoluteUnit( units )) { double inchValue = DimensionUtil.convertTo( value, units, DesignChoiceConstants.UNITS_IN ).getMeasure(); result = (int)(inchValue * dpi); } // % units else if (units == DesignChoiceConstants.UNITS_PERCENTAGE) { if (df == null) { System.out.println( "df==null is not allowed for percentage dim." ); throw new IllegalArgumentException( "df==null is not allowed for percentage dim." ); } IFigure parentFigure = df.getParent(); if (parentFigure != null) { int parentPixels = parentFigure.getSize().width - parentFigure.getInsets().getWidth(); System.out.println( "parent pixels: " + parentPixels ); //double parentInchValue = DimensionUtil.convertTo( parentPixels, DesignChoiceConstants.UNITS_PT, DesignChoiceConstants.UNITS_IN ).getMeasure(); //System.out.println( "parent inch: " + parentInchValue ); result = (int)(parentPixels * value / 100); // int parentHeight = (int)((parentFigure.getSize().height - parentFigure.getInsets().getHeight()) // * dOriginalHeight / 100); // dOriginalHeight = ChartUtil.convertPixelsToPoints( idsSWT, height ); // sHeightUnits = DesignChoiceConstants.UNITS_PT; } } // unsupported units else { throw new IllegalArgumentException( "Not supported: relativ dimension unit: " + units ); } System.out.println( "pixels:" + result ); return result; } }
[ "falko@polymap.de" ]
falko@polymap.de
ec560da3a41ca7b059540dbce5ef5a4a2761e311
3d7d658f0d95d19eae9ee94bf6f339a33e0b7679
/lucas-eai-file/src/main/java/com/lucas/eai/support/ReadCompleteFileFilter.java
42abab6602d5bbb007870f365690055592f23ed6
[]
no_license
goverdhan1/lucasware
a3a6c2e898c7f3d413628c1dc97bfb328a75ccc3
fc59d862afd62cab0098ebe99ed5f8b604a87c35
refs/heads/master
2021-01-10T10:52:14.222460
2015-11-29T17:28:43
2015-11-29T17:28:43
47,071,633
0
0
null
null
null
null
UTF-8
Java
false
false
1,632
java
/* Lucas Systems Inc 11279 Perry Highway Wexford PA 15090 United States The information in this file contains trade secrets and confidential information which is the property of Lucas Systems Inc. All trademarks, trade names, copyrights and other intellectual property rights created, developed, embodied in or arising in connection with this software shall remain the sole property of Lucas Systems Inc. Copyright (c) Lucas Systems, 2014 ALL RIGHTS RESERVED */ package com.lucas.eai.support; import java.io.File; import java.io.FileInputStream; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.integration.file.filters.AbstractFileListFilter; import org.springframework.stereotype.Component; /** * The filter making sure that the completely downloaded file is picked by the * inbound adapter * * @author Prafull * */ @Component public class ReadCompleteFileFilter extends AbstractFileListFilter<File> { private static Logger LOG = LoggerFactory .getLogger(ReadCompleteFileFilter.class); public ReadCompleteFileFilter() { } /* * (non-Javadoc) * * @see * org.springframework.integration.file.filters.AbstractFileListFilter#accept * (java.lang.Object) */ @Override protected boolean accept(File file) { try { FileInputStream fStream = new FileInputStream(file); // If file is entirely OK the stream can be created LOG.debug("File is ready to be processed:" + file.getName()); fStream.close(); return true; } catch (Exception e) { LOG.debug("File is not ready to be processed yet! " + file.getName()); return false; } } }
[ "goverdhan.k@gmail.com" ]
goverdhan.k@gmail.com
f0404570604497b4985757302466f882dd3e59bb
b8724b65520e7e85464118be6f90ea5534097f52
/bosphorus-core/src/main/java/org/bosphorus/api/builder/expression/scalar/math/AddDoubleExpression.java
c5af43cdc5b8af582a3882d7967712425453f8c2
[ "Apache-2.0" ]
permissive
unluonur/bosphorus
fe4e5633230cc3a289942edb20c1eb3666b5fe6f
9ec2f473872b1ca822d6cc900c3626507bd4e617
refs/heads/master
2021-01-25T10:29:07.191550
2015-01-18T21:33:52
2015-01-18T21:33:52
25,727,556
0
0
null
null
null
null
ISO-8859-2
Java
false
false
1,241
java
/** * Copyright (c) Onur Ünlü * * 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. * * The latest version of this file can be found at https://github.com/unluonur/bosphorus */ package org.bosphorus.api.builder.expression.scalar.math; import org.bosphorus.api.builder.expression.scalar.IScalarExpression2; import org.bosphorus.core.expression.scalar.factory.IScalarExecutorFactory2; import org.bosphorus.core.expression.scalar.factory.math.AddDoubleExecutorFactory; public class AddDoubleExpression implements IScalarExpression2<Number, Number, Double> { private static final long serialVersionUID = 1L; @Override public IScalarExecutorFactory2<Number, Number, Double> build() { return new AddDoubleExecutorFactory(); } }
[ "unluonur@gmail.com" ]
unluonur@gmail.com
decb0853f42c468f14bc05dbb77a0d61451415b7
90d4735ee0cca3f73986756949cfb1d5c9b719e7
/src/main/java/randori/compiler/bundle/IBundle.java
2ee186fa606630b86e7b3d326729263ae492f0b2
[]
no_license
RandoriAS/randori-compiler
a91ba2867ec70cd52140315b5ed45ab3245ffef9
1067a96afe9eeedb61c058c578c8dcb0bd83ae59
refs/heads/develop
2021-01-11T11:01:04.588316
2013-10-08T08:09:48
2013-10-08T08:09:48
9,038,856
6
3
null
2013-10-08T08:09:49
2013-03-26T19:47:24
Java
UTF-8
Java
false
false
3,743
java
/*** * Copyright 2013 Teoti Graphix, LLC. * * 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. * * * @author Michael Schmalle <mschmalle@teotigraphix.com> */ package randori.compiler.bundle; import java.io.File; import java.util.Collection; import org.apache.flex.compiler.problems.ICompilerProblem; import org.apache.flex.swc.ISWC; /** * The {@link IBundle} API is the main interface into a randori bundle model. * <p> * This model is used to manage; * <ul> * <li>The {@link IBundleVersion} of the bundle from which the bundle was * created from.</li> * <li>A collection of {@link IBundleLibrary}s that were saved with the bundle.</li> * <li></li> * <li></li> * <li></li> * <li></li> * </ul> * * @author Michael Schmalle */ public interface IBundle { /** * Returns the {@link File} instance for the {@link IBundle}. */ File getBundleFile(); /** * The {@link IBundleVersion} of the bundle when it was created by the * compiler. */ IBundleVersion getVersion(); /** * A collection of {@link IBundleLibrary}s contained within the * {@link IBundle}. */ Collection<IBundleLibrary> getLibraries(); /** * Returns a library located at the specific path which was the name given * for the library during the bundles compile. * * @param name The library name. */ IBundleLibrary getLibrary(String name); /** * All {@link ISWC} libraries contained in an {@link IBundleLibrary}. * * @param libraryName The name of the {@link IBundleLibrary} to return * {@link ISWC} collection for. */ Collection<ISWC> getSWCLibraries(String libraryName); /** * Returns a specific {@link ISWC} instance using the {@link IBundleLibrary} * name and the name of the {@link ISWC} without the <code>.swc</code> * extension. * * @param libraryName The name of the {@link IBundleLibrary}. * @param swcName The name of the {@link ISWC} without the <code>.swc</code> * extension. */ ISWC getSWCLibrary(String libraryName, String swcName); /** * Returns a collection of {@link IBundleContainer} defined in the * {@link IBundle}. * * @param libraryName The name of the {@link IBundleLibrary}. */ Collection<IBundleContainer> getContainers(String libraryName); /** * Returns the {@link IBundleContainer} for the {@link IBundleLibrary} name * passed by type. * <p> * The {@link IBundleContainerType} is a unique container found within the * {@link IBundleLibrary}. * * @param libraryName The name of the {@link IBundleLibrary}. * @param type The {@link IBundleContainerType} of the * {@link IBundleContainer}. */ IBundleContainer getContainer(String libraryName, IBundleContainerType type); // For now we are not implementing direct file addition through this API //Map<String, IBundleFileEntry> getFiles(); //IBundleFileEntry getFile(String fileName); /** * Returns a collection of {@link ICompilerProblem}s that may have been * produced during a read or write of the {@link IBundle}. */ Collection<ICompilerProblem> getProblems(); }
[ "mschmalle@teotigraphix.com" ]
mschmalle@teotigraphix.com
934271e2f25499a81bd5f388402e59c01d1204ed
4160da090d8dc6eba384c4ccccbd0ea9e016f73f
/src/main/java/io/github/prepayments/service/dto/PrepsFileUploadDTO.java
da3b7dabdcd2b055f20a1fa833d6b273b1eaa8e9
[]
no_license
prepayments/prepayments-server
03caffecaabcb357981947e652436fe1f314e941
34f9770076c4068322f20ac41ed9f948f970825a
refs/heads/master
2023-02-27T06:57:52.906173
2021-01-29T16:29:19
2021-01-29T16:29:19
329,243,391
0
0
null
null
null
null
UTF-8
Java
false
false
3,676
java
package io.github.prepayments.service.dto; import java.time.LocalDate; import javax.validation.constraints.*; import java.io.Serializable; import javax.persistence.Lob; /** * A DTO for the {@link io.github.prepayments.domain.PrepsFileUpload} entity. */ public class PrepsFileUploadDTO implements Serializable { private Long id; @NotNull private String description; @NotNull private String fileName; private LocalDate periodFrom; private LocalDate periodTo; @NotNull private Long prepsFileTypeId; @Lob private byte[] dataFile; private String dataFileContentType; private Boolean uploadSuccessful; private Boolean uploadProcessed; private String uploadToken; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public String getFileName() { return fileName; } public void setFileName(String fileName) { this.fileName = fileName; } public LocalDate getPeriodFrom() { return periodFrom; } public void setPeriodFrom(LocalDate periodFrom) { this.periodFrom = periodFrom; } public LocalDate getPeriodTo() { return periodTo; } public void setPeriodTo(LocalDate periodTo) { this.periodTo = periodTo; } public Long getPrepsFileTypeId() { return prepsFileTypeId; } public void setPrepsFileTypeId(Long prepsFileTypeId) { this.prepsFileTypeId = prepsFileTypeId; } public byte[] getDataFile() { return dataFile; } public void setDataFile(byte[] dataFile) { this.dataFile = dataFile; } public String getDataFileContentType() { return dataFileContentType; } public void setDataFileContentType(String dataFileContentType) { this.dataFileContentType = dataFileContentType; } public Boolean isUploadSuccessful() { return uploadSuccessful; } public void setUploadSuccessful(Boolean uploadSuccessful) { this.uploadSuccessful = uploadSuccessful; } public Boolean isUploadProcessed() { return uploadProcessed; } public void setUploadProcessed(Boolean uploadProcessed) { this.uploadProcessed = uploadProcessed; } public String getUploadToken() { return uploadToken; } public void setUploadToken(String uploadToken) { this.uploadToken = uploadToken; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof PrepsFileUploadDTO)) { return false; } return id != null && id.equals(((PrepsFileUploadDTO) o).id); } @Override public int hashCode() { return 31; } // prettier-ignore @Override public String toString() { return "PrepsFileUploadDTO{" + "id=" + getId() + ", description='" + getDescription() + "'" + ", fileName='" + getFileName() + "'" + ", periodFrom='" + getPeriodFrom() + "'" + ", periodTo='" + getPeriodTo() + "'" + ", prepsFileTypeId=" + getPrepsFileTypeId() + ", dataFile='" + getDataFile() + "'" + ", uploadSuccessful='" + isUploadSuccessful() + "'" + ", uploadProcessed='" + isUploadProcessed() + "'" + ", uploadToken='" + getUploadToken() + "'" + "}"; } }
[ "mailnjeru@gmail.com" ]
mailnjeru@gmail.com