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
a70f3920c4c100a7af559bbcd760c774d21a467f
976d8d6e9325adcfb477667c8ab7cb3ee2c20225
/SpaceInvaders/src/main/java/com/almasb/fxglgames/spaceinvaders/components/WallControl.java
30059eb4cfa4119803ae4eea20c96b00457f7865
[ "MIT" ]
permissive
voknelim/FXGLGames
08f7becfcaa421f8de425c6640351e2c01c77b05
32ccd113d99a3d4d0dee2d03057727d42b0583dc
refs/heads/master
2021-07-16T10:42:43.961849
2020-07-27T10:39:52
2020-07-27T10:39:52
189,382,967
0
0
MIT
2019-05-30T09:14:54
2019-05-30T09:14:53
null
UTF-8
Java
false
false
3,032
java
/* * The MIT License (MIT) * * FXGL - JavaFX Game Library * * Copyright (c) 2015-2017 AlmasB (almaslvl@gmail.com) * * 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 com.almasb.fxglgames.spaceinvaders.components; import com.almasb.fxgl.animation.Interpolators; import com.almasb.fxgl.app.FXGL; import com.almasb.fxgl.entity.Entities; import com.almasb.fxgl.entity.component.Component; import com.almasb.fxgl.entity.components.CollidableComponent; import javafx.geometry.Point2D; import javafx.util.Duration; import static com.almasb.fxgl.app.DSLKt.play; import static com.almasb.fxgl.app.DSLKt.texture; /** * @author Almas Baimagambetov (almaslvl@gmail.com) */ public class WallControl extends Component { private final int originalLives; private int lives; public WallControl(int lives) { this.lives = lives; originalLives = lives; } @Override public void onUpdate(double tpf) {} public void onHit() { lives--; Entities.animationBuilder() .autoReverse(true) .repeat(2) .interpolator(Interpolators.CIRCULAR.EASE_IN()) .duration(Duration.seconds(0.33)) .scale(entity) .to(new Point2D(1.2, 1.2)) .buildAndPlay(); if (lives == 0) { entity.getComponent(CollidableComponent.class).setValue(false); Entities.animationBuilder() .interpolator(Interpolators.EXPONENTIAL.EASE_OUT()) .duration(Duration.seconds(0.8)) .onFinished(entity::removeFromWorld) .translate(entity) .from(entity.getPosition()) .to(new Point2D(entity.getX(), FXGL.getAppHeight() + 10)) .buildAndPlay(); } else if (lives == originalLives / 2) { entity.setView(texture("wall2.png", 232 / 3, 104 / 3)); play("brick_hit.wav"); } } }
[ "almaslvl@gmail.com" ]
almaslvl@gmail.com
3a6142c6ff11e17303897b385b07bacc853c5a9a
a9552ebe06ac6ba8e310373f20f4b1a9175ecf6a
/src/main/java/com/harium/etyl/ui/list/Option.java
8ecdb1b2b5157306ea84f22323e4a017427f912b
[]
no_license
Harium/etyl-ui
3368644cc1a7948add9b26bab6faf469706c341d
8c4f38e37215e571c3f5d3a0899cabed3eb3ac7e
refs/heads/master
2021-07-05T17:39:04.760440
2019-03-08T14:26:02
2019-03-08T14:26:02
138,351,593
0
0
null
2019-01-20T19:57:42
2018-06-22T21:58:35
Java
UTF-8
Java
false
false
548
java
package com.harium.etyl.ui.list; import com.harium.etyl.ui.Select; public class Option { private String value; private String label; public Option(String value, String label) { super(); this.value = value; this.label = label; } public String getValue() { return value; } public void setValue(String value) { this.value = value; } public String getLabel() { return label; } public void setLabel(String label) { this.label = label; } }
[ "yuripourre@gmail.com" ]
yuripourre@gmail.com
2047c984d7668d8ca79918f183907c4a6af1dcbc
13779adeb942eea5c3f3a90f0010e30257553436
/ch.eugster.events.course.reporting/src/ch/eugster/events/course/reporting/handlers/GenerateParticipantListReportHandler.java
40716f02eb81e69883d572813972a2936731ae3c
[]
no_license
ceugster/administrator
56b6ad51a409d06f2579aecf4d229ef3811bcdf7
ec0b6688b85ac3ab231f9648fd071915197da17d
refs/heads/master
2022-03-12T11:42:37.597568
2022-02-22T09:51:08
2022-02-22T09:51:08
256,752,288
0
0
null
null
null
null
UTF-8
Java
false
false
2,174
java
package ch.eugster.events.course.reporting.handlers; import org.eclipse.core.commands.AbstractHandler; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.commands.ExecutionException; import org.eclipse.core.commands.IHandler; import org.eclipse.core.expressions.EvaluationContext; import org.eclipse.core.runtime.Status; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.swt.widgets.Shell; import ch.eugster.events.course.reporting.dialogs.ParticipantListReportDialog; import ch.eugster.events.persistence.model.Course; public class GenerateParticipantListReportHandler extends AbstractHandler implements IHandler { protected Shell shell; @Override public Object execute(final ExecutionEvent event) throws ExecutionException { if (event.getApplicationContext() instanceof EvaluationContext) { EvaluationContext context = (EvaluationContext) event.getApplicationContext(); ISelection selection = (ISelection) context.getParent().getVariable("selection"); shell = (Shell) context.getParent().getVariable("activeShell"); if (selection instanceof IStructuredSelection) { IStructuredSelection ssel = (IStructuredSelection) selection; if (ssel.getFirstElement() instanceof Course) { Course course = (Course) ssel.getFirstElement(); ParticipantListReportDialog dialog = new ParticipantListReportDialog(shell, course); dialog.open(); } } } return Status.OK_STATUS; } @Override public void setEnabled(final Object evaluationContext) { boolean enabled = false; EvaluationContext context = (EvaluationContext) evaluationContext; if (context.getVariable("selection") instanceof StructuredSelection) { Object selection = context.getVariable("selection"); if (selection instanceof StructuredSelection) { StructuredSelection ssel = (StructuredSelection) selection; if (ssel.getFirstElement() instanceof Course) { enabled = true; } } } setBaseEnabled(enabled); } }
[ "christian.eugster@gmx.net" ]
christian.eugster@gmx.net
1b5464afb6d4e38f92fb8dbe96d5d24e2fe10d3f
014d7d20ba3ae69dd032cfad4792a1c7138da178
/app/src/main/java/com/linearexample/user/onscrolllinearlayout/MainActivity.java
4cf8af3efc62487784599dfdd48c1dad543c4e0c
[]
no_license
yura91/OnScrollLinearLayout
cf7e50b0dd02efb6908ad2eae72920d14a4d1100
66de263f83e2eb633d260747d4f06584af39606d
refs/heads/master
2021-01-19T03:47:14.622321
2016-07-02T11:20:07
2016-07-02T11:20:07
62,395,007
0
0
null
null
null
null
UTF-8
Java
false
false
3,351
java
package com.linearexample.user.onscrolllinearlayout; import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.app.LoaderManager; import android.content.Context; import android.content.Loader; import android.os.Bundle; import android.os.Handler; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.util.Log; public class MainActivity extends Activity implements LoaderManager.LoaderCallbacks<List<String>> { private List<String> mGridData; private List<String> mLoadGridData; private RecyclerView mRecyclerView; private RecyclerView.Adapter mAdapter; static final int LOADER_TIME_ID = 1; private LinearLayoutManager lLayout; Context context; private int ival = 0; private int loadLimit = 15; Handler handler; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); context = MainActivity.this; handler = new Handler(); lLayout = new LinearLayoutManager(MainActivity.this); mGridData = new ArrayList<String>(); mLoadGridData = new ArrayList<String>(); Loader<List<String>> loader; mRecyclerView = (RecyclerView) findViewById(R.id.my_recycler_view); mRecyclerView.setHasFixedSize(true); mRecyclerView.setLayoutManager(lLayout); Bundle bndl = new Bundle(); loader = getLoaderManager().initLoader(LOADER_TIME_ID, bndl, this); loader.forceLoad(); mRecyclerView.addOnScrollListener(new EndlessRecyclerOnScrollListener( lLayout) { @Override public void onLoadMore() { loadMoreData(); } }); } private void loadData() { if (ival < mGridData.size()) { for (int i = ival; i < loadLimit; i++) { mLoadGridData.add(mGridData.get(ival)); ival++; Log.d("Func", "" + ival); } } } private void loadMoreData() { Log.d("Func", "" + "Scrolled"); loadLimit = ival + 10; for (int i = ival; i < loadLimit; i++) { if(ival < mGridData.size()) { mLoadGridData.add(mGridData.get(ival)); } ival++; } Log.d("Func", "" + ival); final Runnable r = new Runnable() { public void run() { mAdapter.notifyDataSetChanged(); } }; handler.post(r); } @Override public Loader<List<String>> onCreateLoader(int id, Bundle args) { Loader<List<String>> loader = null; loader = new TimeLoader(this, args); Log.d("Func", "onCreateLoader: " + loader.hashCode()); return loader; } @Override public void onLoadFinished(Loader<List<String>> loader, List<String> data) { mGridData = data; Log.d("Func", "" + mGridData.size()); loadData(); Log.d("Func", "" + mLoadGridData.size()); mAdapter = new CardViewDataAdapter(context,mLoadGridData); mRecyclerView.setAdapter(mAdapter); } @Override public void onLoaderReset(Loader<List<String>> loader) { } }
[ "someone@someplace.com" ]
someone@someplace.com
09d0432d11d2ab165c60471900a221722da826e1
617bd24f8c106b9c707a0afcef2abc2b64e08e43
/android/expoview/src/main/java/versioned/host/exp/exponent/modules/universal/sensors/ScopedSensorEventListener.java
15d37c830c30ee57f22fef4d0e547506ca7c383c
[ "MIT", "BSD-3-Clause", "Apache-2.0" ]
permissive
atiato78/expo
54f15c932a3984f2a60b7fddc9bd55c470ba92e4
0c9ef858e125b5f9d421edc183ec10aa84c9b41b
refs/heads/master
2022-12-15T09:30:33.721793
2019-07-31T20:04:43
2019-07-31T20:04:43
199,931,004
2
0
MIT
2022-12-04T05:33:11
2019-07-31T21:24:06
Objective-C
UTF-8
Java
false
false
573
java
package versioned.host.exp.exponent.modules.universal.sensors; import android.hardware.SensorEvent; import android.hardware.SensorEventListener2; import host.exp.exponent.kernel.services.sensors.SensorEventListener; public class ScopedSensorEventListener implements SensorEventListener { private SensorEventListener2 mEventListener; ScopedSensorEventListener(SensorEventListener2 eventListener) { mEventListener = eventListener; } @Override public void onSensorDataChanged(SensorEvent sensorEvent) { mEventListener.onSensorChanged(sensorEvent); } }
[ "aurora@exp.host" ]
aurora@exp.host
d1c32a10b34d47e7a643ba3dfcf74b2f1cdcf6fb
62004846647d35151a636714ee0fc5227e073bc7
/2014.12.25.jike/jike1/src/jk/o1office/address/servlet/AddDAddress.java
966c8d55af38af81b231b558a9f0c58b11413dee
[]
no_license
yonghai/JKWebPortal
aa86d6c02b0c9ebec148cbb7167746c108d21e37
3e591ee5d39d57b0fdb5968d9ae59fa9fbcd4931
refs/heads/master
2021-01-15T23:01:59.284192
2015-01-23T07:15:51
2015-01-23T07:15:51
28,065,308
0
0
null
null
null
null
UTF-8
Java
false
false
4,032
java
package jk.o1office.address.servlet; import java.io.IOException; import java.io.PrintWriter; import java.util.Date; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import jk.o1office.domin.CustomerAddress; import jk.o1office.excetion.NullException; import jk.o1office.excetion.NumberException; import jk.o1office.excetion.TelException; import jk.o1office.excetion.TokenException; import jk.o1office.ht.utils.ExceptionInfo; import jk.o1office.service.AddressService; import jk.o1office.utils.IDGenertor; import jk.o1office.validator.TelValidator; import jk.o1office.validator.Validator; import org.apache.log4j.Logger; public class AddDAddress extends HttpServlet{ private Logger logger = Logger.getLogger("jk.o1office.address.servlet.AddDeliveryAddress"); private AddressService addressService; private Validator validator; public AddressService getAddressService() { return addressService; } public void setAddressService(AddressService addressService) { this.addressService = addressService; } public Validator getValidator() { return validator; } public void setValidator(Validator validator) { this.validator = validator; } @Override public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { doPost(req, resp); } @Override public void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { req.setCharacterEncoding("utf-8"); resp.setCharacterEncoding("utf-8"); resp.setContentType("text/html; charset=utf-8"); PrintWriter printWriter = resp.getWriter(); String token = ""; String returninfo = ""; CustomerAddress ca = new CustomerAddress(); try { String deviceid = req.getParameter("device_id"); token = validator.isNull(req.getParameter("token"), "token"); ca.setArea(0); ca.setCommunity(0); ca.setAddress(validator.isNull(req.getParameter("address"), "address")); ca.setContact_number(TelValidator.isMobile(validator.isNull(req.getParameter("contact_number"), "contact_number"))); ca.setContacts(validator.isNull(req.getParameter("contacts"), "contacts")); ca.setCommunityName(validator.isNullOrNullStr(req.getParameter("communityName"), "communityName")); ca.setCountryName(validator.isNullOrNullStr(req.getParameter("countryName"), "countryName")); ca.setProvinceName(validator.isNullOrNullStr(req.getParameter("provinceName"), "provinceName")); ca.setRegionalName(validator.isNullOrNullStr(req.getParameter("regionalName"), "regionalName")); ca.setCreatetime(new Date()); ca.setIs_default(0); ca.setCustomer_id(IDGenertor.getUserID(token)); returninfo = addressService.saveNewAddress(ca,token); }catch(TokenException e){ returninfo = "{\"success\":false,\"token\":\""+token+"\",\"emsg\":\"token异常\"}"; e.printStackTrace(); e.printStackTrace(ExceptionInfo.out()); ExceptionInfo.out().flush(); }catch (NullException e) { returninfo = "{\"success\":false,\"token\":\""+token+"\",\"emsg\":\""+validator.getName()+"不能为null\"}"; e.printStackTrace(); e.printStackTrace(ExceptionInfo.out()); ExceptionInfo.out().flush(); } catch(NumberException e){ returninfo = "{\"success\":false,\"token\":\""+token+"\",\"emsg\":\""+validator.getName()+"只能为数字\"}"; e.printStackTrace(); e.printStackTrace(ExceptionInfo.out()); ExceptionInfo.out().flush(); } catch(TelException e){ returninfo = "{\"success\":false,\"token\":\""+token+"\",\"emsg\":\"手机号码格式错误\"}"; e.printStackTrace(); e.printStackTrace(ExceptionInfo.out()); ExceptionInfo.out().flush(); } catch(Exception e){ returninfo = "{\"success\":false,\"token\":\""+token+"\",\"emsg\":\"添加默认地址出错了\"}"; e.printStackTrace(); e.printStackTrace(ExceptionInfo.out()); ExceptionInfo.out().flush(); } finally{ printWriter.println(returninfo); } } }
[ "811067920@qq.com" ]
811067920@qq.com
982eb746f669b74bed6fcdc90ef47474719b7855
01756c52a70301f867aa2242de456b61690cdadf
/modules/activiti5-test/src/test/java/org/activiti5/examples/variables/ChangeVariableType.java
45ce1eda9da29dc17137976218bd3927db4d0957
[ "Apache-2.0" ]
permissive
chenlingyx/activitiUI
fe518348c3c50a26c47379c281bba87660feafb8
465aaedbf2438f83cafae4917eef8f5b04621867
refs/heads/master
2022-07-12T02:34:16.491470
2019-12-16T04:00:10
2019-12-16T04:00:10
228,295,589
0
0
Apache-2.0
2022-07-08T19:05:12
2019-12-16T03:32:25
Java
UTF-8
Java
false
false
522
java
package org.activiti5.examples.variables; import org.activiti.engine.delegate.DelegateExecution; import org.activiti.engine.delegate.JavaDelegate; public class ChangeVariableType implements JavaDelegate { public void execute(DelegateExecution execution) { // Initially set to null, stored as NullType execution.setVariable("myVar", null); // Now set to something stored as SerializableType. This could happen much later on than this. execution.setVariable("myVar", new SomeSerializable("someValue")); } }
[ "chenling@deepexi.com" ]
chenling@deepexi.com
69d9618038bba68790703db727afab8ac6c68b35
a3130ed4ac3f10de55417bbe629f37656c7c1456
/Spring MVC Tutorials/Spring MVC Hello World/Spring MVC form handling example/src/main/java/com/mkyong/form/validator/UserFormValidator.java
94ba9ce6d07296cc3563965134d2389df9dc554e
[]
no_license
www-mkyoung-com/Mkyoung-Spring-Frameworks
ac1255f3830553df556bf4229ffbcb9c7186bffd
caefd5fd5df255b16dd939d77ecf1c7a65112938
refs/heads/master
2021-01-19T11:29:39.550367
2017-04-24T12:18:44
2017-04-24T12:18:44
87,970,878
4
2
null
null
null
null
UTF-8
Java
false
false
2,349
java
package com.mkyong.form.validator; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Component; import org.springframework.validation.Errors; import org.springframework.validation.ValidationUtils; import org.springframework.validation.Validator; import com.mkyong.form.model.User; import com.mkyong.form.service.UserService; //http://docs.spring.io/spring/docs/current/spring-framework-reference/html/validation.html#validation-mvc-configuring @Component public class UserFormValidator implements Validator { @Autowired @Qualifier("emailValidator") EmailValidator emailValidator; @Autowired UserService userService; @Override public boolean supports(Class<?> clazz) { return User.class.equals(clazz); } @Override public void validate(Object target, Errors errors) { User user = (User) target; ValidationUtils.rejectIfEmptyOrWhitespace(errors, "name", "NotEmpty.userForm.name"); ValidationUtils.rejectIfEmptyOrWhitespace(errors, "email", "NotEmpty.userForm.email"); ValidationUtils.rejectIfEmptyOrWhitespace(errors, "address", "NotEmpty.userForm.address"); ValidationUtils.rejectIfEmptyOrWhitespace(errors, "password", "NotEmpty.userForm.password"); ValidationUtils.rejectIfEmptyOrWhitespace(errors, "confirmPassword","NotEmpty.userForm.confirmPassword"); ValidationUtils.rejectIfEmptyOrWhitespace(errors, "sex", "NotEmpty.userForm.sex"); ValidationUtils.rejectIfEmptyOrWhitespace(errors, "country", "NotEmpty.userForm.country"); if(!emailValidator.valid(user.getEmail())){ errors.rejectValue("email", "Pattern.userForm.email"); } if(user.getNumber()==null || user.getNumber()<=0){ errors.rejectValue("number", "NotEmpty.userForm.number"); } if(user.getCountry().equalsIgnoreCase("none")){ errors.rejectValue("country", "NotEmpty.userForm.country"); } if (!user.getPassword().equals(user.getConfirmPassword())) { errors.rejectValue("confirmPassword", "Diff.userform.confirmPassword"); } if (user.getFramework() == null || user.getFramework().size() < 2) { errors.rejectValue("framework", "Valid.userForm.framework"); } if (user.getSkill() == null || user.getSkill().size() < 3) { errors.rejectValue("skill", "Valid.userForm.skill"); } } }
[ "mohammad.ghasemy@gmail.com" ]
mohammad.ghasemy@gmail.com
3d29bb3ff38b935519f014812c6243297d04d17e
f3aec68bc48dc52e76f276fd3b47c3260c01b2a4
/core/referencebook/src/main/java/ru/korus/tmis/ehr/ws/ObjectFactory.java
8fae8a3225552d548e976f13fa5cbf4f75b9d5af
[]
no_license
MarsStirner/core
c9a383799a92e485e2395d81a0bc95d51ada5fa5
6fbf37af989aa48fabb9c4c2566195aafd2b16ab
refs/heads/master
2020-12-03T00:39:51.407573
2016-04-29T12:28:32
2016-04-29T12:28:32
96,041,573
0
1
null
null
null
null
UTF-8
Java
false
false
4,304
java
package ru.korus.tmis.ehr.ws; import javax.xml.bind.JAXBElement; import javax.xml.bind.annotation.XmlElementDecl; import javax.xml.bind.annotation.XmlRegistry; import javax.xml.namespace.QName; /** * This object contains factory methods for each * Java content interface and Java element interface * generated in the ru.korus.tmis.ehr.ws package. * <p>An ObjectFactory allows you to programatically * construct new instances of the Java representation * for XML content. The Java representation of XML * content can consist of schema derived interfaces * and classes representing the binding of schema * type definitions, element declarations and model * groups. Factory methods for each of these are * provided in this class. * */ @XmlRegistry public class ObjectFactory { private final static QName _PatientQuery_QNAME = new QName("", "patientQuery"); private final static QName _DocumentQuery_QNAME = new QName("", "documentQuery"); private final static QName _RetrieveDocumentQuery_QNAME = new QName("", "retrieveDocumentQuery"); /** * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: ru.korus.tmis.ehr.ws * */ public ObjectFactory() { } /** * Create an instance of {@link DocumentQuery } * */ public DocumentQuery createDocumentQuery() { return new DocumentQuery(); } /** * Create an instance of {@link PatientQuery } * */ public PatientQuery createPatientQuery() { return new PatientQuery(); } /** * Create an instance of {@link RetrieveDocumentQuery } * */ public RetrieveDocumentQuery createRetrieveDocumentQuery() { return new RetrieveDocumentQuery(); } /** * Create an instance of {@link BaseSerial } * */ public BaseSerial createBaseSerial() { return new BaseSerial(); } /** * Create an instance of {@link InstanceIdentifier } * */ public InstanceIdentifier createInstanceIdentifier() { return new InstanceIdentifier(); } /** * Create an instance of {@link DocumentParams } * */ public DocumentParams createDocumentParams() { return new DocumentParams(); } /** * Create an instance of {@link PatientParams } * */ public PatientParams createPatientParams() { return new PatientParams(); } /** * Create an instance of {@link Employee } * */ public Employee createEmployee() { return new Employee(); } /** * Create an instance of {@link CodeAndName } * */ public CodeAndName createCodeAndName() { return new CodeAndName(); } /** * Create an instance of {@link ContactInfo } * */ public ContactInfo createContactInfo() { return new ContactInfo(); } /** * Create an instance of {@link SeriesNumberAndType } * */ public SeriesNumberAndType createSeriesNumberAndType() { return new SeriesNumberAndType(); } /** * Create an instance of {@link JAXBElement }{@code <}{@link PatientQuery }{@code >}} * */ @XmlElementDecl(namespace = "", name = "patientQuery") public JAXBElement<PatientQuery> createPatientQuery(PatientQuery value) { return new JAXBElement<PatientQuery>(_PatientQuery_QNAME, PatientQuery.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link DocumentQuery }{@code >}} * */ @XmlElementDecl(namespace = "", name = "documentQuery") public JAXBElement<DocumentQuery> createDocumentQuery(DocumentQuery value) { return new JAXBElement<DocumentQuery>(_DocumentQuery_QNAME, DocumentQuery.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link RetrieveDocumentQuery }{@code >}} * */ @XmlElementDecl(namespace = "", name = "retrieveDocumentQuery") public JAXBElement<RetrieveDocumentQuery> createRetrieveDocumentQuery(RetrieveDocumentQuery value) { return new JAXBElement<RetrieveDocumentQuery>(_RetrieveDocumentQuery_QNAME, RetrieveDocumentQuery.class, null, value); } }
[ "szgrebelny@korusconsulting.ru" ]
szgrebelny@korusconsulting.ru
c18b376d7fad9d9dd29eeb6221c54b2b8164d0e6
75d7d9934d872d2b59d30726835a1f2270a23d36
/src/main/java/ivorius/reccomplex/network/PacketEditInvGen.java
1363cb0ab18b8b2e5c280fb84b9e3aa0bcf382fc
[]
no_license
immortalcatz/RecurrentComplex
9ac46fcf95a6d658605825a350def99779c8d263
ae761954ef55cfc34d475539909859e4087c7ccc
refs/heads/master
2021-01-21T02:57:04.031740
2016-08-30T22:41:38
2016-08-30T22:41:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,553
java
/* * Copyright (c) 2014, Lukas Tenbrink. * * http://lukas.axxim.net */ package ivorius.reccomplex.network; import io.netty.buffer.ByteBuf; import ivorius.reccomplex.worldgen.inventory.GenericItemCollection.Component; import ivorius.reccomplex.worldgen.inventory.GenericItemCollectionRegistry; import net.minecraftforge.fml.common.network.ByteBufUtils; import net.minecraftforge.fml.common.network.simpleimpl.IMessage; /** * Created by lukas on 03.08.14. */ public class PacketEditInvGen implements IMessage { private String key; private Component inventoryGenerator; public PacketEditInvGen() { } public PacketEditInvGen(String key, Component inventoryGenerator) { this.key = key; this.inventoryGenerator = inventoryGenerator; } public String getKey() { return key; } public void setKey(String key) { this.key = key; } public Component getInventoryGenerator() { return inventoryGenerator; } public void setInventoryGenerator(Component inventoryGenerator) { this.inventoryGenerator = inventoryGenerator; } @Override public void fromBytes(ByteBuf buf) { key = ByteBufUtils.readUTF8String(buf); inventoryGenerator = GenericItemCollectionRegistry.INSTANCE.readComponent(buf); } @Override public void toBytes(ByteBuf buf) { ByteBufUtils.writeUTF8String(buf, key); GenericItemCollectionRegistry.INSTANCE.writeComponent(buf, inventoryGenerator); } }
[ "lukastenbrink@googlemail.com" ]
lukastenbrink@googlemail.com
53ff8be0ae1e0a1708b7e2a600e26ba1b46c4bae
68fec64888e94e4acf210ed025aee648eea628df
/src/main/java/com/sooncode/soonjdbc/exception/SqlException.java
37e2f81f39f3431e27b820bdac35b3bb1e9c06dc
[]
no_license
hechenwe/jdbc4json
1315221125c845211c337cc71d29c6ddd029b6e5
62b534a44821fec6b413eb9a57e34e106def6bdf
refs/heads/master
2020-07-25T18:49:00.267762
2017-06-21T01:37:37
2017-06-21T01:37:37
73,772,490
0
1
null
null
null
null
UTF-8
Java
false
false
275
java
package com.sooncode.soonjdbc.exception; /** * SQL 语句异常 * @author pc * */ public class SqlException extends Exception { private static final long serialVersionUID = 614301440846576181L; public SqlException(String message){ super(message); } }
[ "hechen@e-eduspace.com" ]
hechen@e-eduspace.com
738250e7195f713c580605f30f99dcfe4836ba56
5741045375dcbbafcf7288d65a11c44de2e56484
/reddit-decompilada/kotlin/reflect/jvm/internal/impl/load/kotlin/C3048xaea9d104.java
71ff61911b3ea0feec036638effeb1301ec32825
[]
no_license
miarevalo10/ReporteReddit
18dd19bcec46c42ff933bb330ba65280615c281c
a0db5538e85e9a081bf268cb1590f0eeb113ed77
refs/heads/master
2020-03-16T17:42:34.840154
2018-05-11T10:16:04
2018-05-11T10:16:04
132,843,706
0
0
null
null
null
null
UTF-8
Java
false
false
891
java
package kotlin.reflect.jvm.internal.impl.load.kotlin; import kotlin.reflect.jvm.internal.impl.descriptors.ModuleDescriptor; import kotlin.reflect.jvm.internal.impl.descriptors.impl.PackageFragmentDescriptorImpl; import kotlin.reflect.jvm.internal.impl.name.FqName; import kotlin.reflect.jvm.internal.impl.resolve.scopes.MemberScope; import kotlin.reflect.jvm.internal.impl.resolve.scopes.MemberScope.Empty; /* compiled from: JvmBuiltInsSettings.kt */ public final class C3048xaea9d104 extends PackageFragmentDescriptorImpl { final /* synthetic */ JvmBuiltInsSettings f40806a; C3048xaea9d104(JvmBuiltInsSettings jvmBuiltInsSettings, ModuleDescriptor moduleDescriptor, FqName fqName) { this.f40806a = jvmBuiltInsSettings; super(moduleDescriptor, fqName); } public final /* bridge */ /* synthetic */ MemberScope aC_() { return Empty.f38819a; } }
[ "mi.arevalo10@uniandes.edu.co" ]
mi.arevalo10@uniandes.edu.co
22b417caab249658741c9b425146670ad1218ef9
243eaf02e124f89a21c5d5afa707db40feda5144
/src/unk/com/tencent/mm/ui/qrcode/ac.java
cd10cc80af74aad361a0834df14c16f9bc3a90c3
[]
no_license
laohanmsa/WeChatRE
e6671221ac6237c6565bd1aae02f847718e4ac9d
4b249bce4062e1f338f3e4bbee273b2a88814bf3
refs/heads/master
2020-05-03T08:43:38.647468
2013-05-18T14:04:23
2013-05-18T14:04:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,108
java
package unk.com.tencent.mm.ui.qrcode; import android.content.Intent; import com.tencent.mm.ui.base.s; final class ac implements s { ac(SelfQRCodeUI paramSelfQRCodeUI, String[] paramArrayOfString) { } public final void dU(int paramInt) { if ((paramInt < 0) || (paramInt >= this.cGh.length)); while (true) { return; int i = -1; if (this.cGh[paramInt].equals(this.cOI.getString(2131166626))) i = 1; while (i > 0) { Intent localIntent = new Intent(this.cOI, ShowQRCodeStep1UI.class); localIntent.putExtra("show_to", i); this.cOI.startActivity(localIntent); return; if (this.cGh[paramInt].equals(this.cOI.getString(2131166627))) i = 2; else if (this.cGh[paramInt].equals(this.cOI.getString(2131166628))) i = 3; else if (this.cGh[paramInt].equals(this.cOI.getString(2131166629))) i = 4; } } } } /* Location: /home/danghvu/0day/WeChat/WeChat_4.5_dex2jar.jar * Qualified Name: com.tencent.mm.ui.qrcode.ac * JD-Core Version: 0.6.2 */
[ "danghvu@gmail.com" ]
danghvu@gmail.com
01ef7659a65115eb3fdefe022c21deb847527f84
504e7fbe35cd2dc9f9924312e84540018880de56
/code/FizzoHubSDK/src/main/java/cn/fizzo/hub/sdk/subject/NotifyNewAntsSubject.java
ed4846bb2d6cbfebb71e79afe4c383a86b8ff67b
[]
no_license
RaulFan2019/FitnessHub
c16bcad794197b175a0a5b2fc611ddd1ddbbfc0e
41755b81a077d5db38e95697708cd4a790e5741c
refs/heads/master
2020-05-17T05:59:31.939185
2020-03-30T02:15:02
2020-03-30T02:15:02
183,548,074
0
1
null
null
null
null
UTF-8
Java
false
false
626
java
package cn.fizzo.hub.sdk.subject; import java.util.List; import cn.fizzo.hub.sdk.entity.AntPlusInfo; import cn.fizzo.hub.sdk.observer.NotifyNewAntsListener; /** * Created by Raul.Fan on 2018/1/12. * Mail:raul.fan@139.com * QQ: 35686324 */ public interface NotifyNewAntsSubject { /** * 增加订阅者 * @param observer */ public void attach(NotifyNewAntsListener observer); /** * 删除订阅者 * @param observer */ public void detach(NotifyNewAntsListener observer); /** * 通知订阅者更新消息 */ public void notify(List<AntPlusInfo> ants); }
[ "raul.fan@fizzo.cn" ]
raul.fan@fizzo.cn
19eb1c9d38dd5f39ed3417559ebf0652ed7c3df3
b598f17078593fd4cd1413491ab5743c00a91428
/store/src/servlet/IndexServlet.java
3832d9d7f094a17eb4e65df148eca14d5ffd6ded
[]
no_license
Apuuu66/IdeaProjects
0fa3be2825f2d73abea956942a615f289a5c1bb8
50de23abfd1ef7c787d2bdc5bc5bf5f272b30894
refs/heads/master
2022-05-01T11:04:19.796560
2017-11-20T06:55:13
2017-11-20T06:55:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
777
java
package servlet; import entity.Category; import entity.Product; import impl.ProductServiceImpl; import service.ProductService; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.List; @WebServlet(name = "IndexServlet", urlPatterns = "/index") public class IndexServlet extends BaseServlet { public String index(HttpServletRequest request, HttpServletResponse response) throws Exception { ProductService ps = new ProductServiceImpl(); List<Product> newList=ps.findNew(); List<Product> hotList = ps.findHot(); request.setAttribute("nList",newList); request.setAttribute("hList",hotList); return "/jsp/index.jsp"; } }
[ "466007639@qq.com" ]
466007639@qq.com
d33406cb3dff4cff9c77f55703de8b540f714c7b
89bbc9b2370946d7aa8bc1b2206ca38d1c8a53db
/module/netty/src/main/java/com/neverwinterdp/netty/http/webapp/WebAppRouteHandler.java
3c0ec0e945225abf96882f8245dd309a2e1ba255
[]
no_license
tuan08/NeverwinterDP
fcfbbb5001379266a09af090fd6fa93d3d0eeb89
e37d4404f317008d253d5afa05e224aa38188ca2
refs/heads/master
2021-01-12T21:28:21.373618
2016-05-30T06:54:53
2016-05-30T06:54:53
56,740,964
0
0
null
2016-04-21T03:54:31
2016-04-21T03:54:31
null
UTF-8
Java
false
false
1,517
java
package com.neverwinterdp.netty.http.webapp; import java.io.StringWriter; import java.io.Writer; import com.neverwinterdp.netty.http.RouteHandlerGeneric; import com.neverwinterdp.util.ExceptionUtil; import io.netty.channel.ChannelHandlerContext; import io.netty.handler.codec.http.FullHttpRequest; import io.netty.handler.codec.http.HttpRequest; public class WebAppRouteHandler extends RouteHandlerGeneric { final protected void doGet(ChannelHandlerContext ctx, HttpRequest request) { try { FullHttpRequest fullReq = (FullHttpRequest) request ; StringWriter writer = new StringWriter() ; process(writer, fullReq) ; writeContent(ctx, request, writer.toString(), "text/html") ; writer.close(); } catch(Throwable t) { writeContent(ctx, request, ExceptionUtil.getStackTrace(t), "text/html") ; logger.error("Error", t); } } final protected void doPost(ChannelHandlerContext ctx, HttpRequest request) { try { FullHttpRequest fullReq = (FullHttpRequest) request ; StringWriter writer = new StringWriter() ; process(writer, fullReq) ; writeContent(ctx, request, writer.toString(), "text/html") ; writer.close(); } catch(Throwable t) { writeContent(ctx, request, ExceptionUtil.getStackTrace(t), "text/html") ; logger.error("Error", t); } } protected void process(Writer writer, FullHttpRequest request) throws Exception { throw new RuntimeException("This method need to be implemented") ; } }
[ "tuan08@gmail.com" ]
tuan08@gmail.com
9e06e03f66e5ec6adba39ee8f72855360af75bd5
be0e8535222b601c277a9d29f234e7fa44e13258
/output/com/ankamagames/dofus/network/messages/game/context/fight/character/GameFightShowFighterRandomStaticPoseMessage.java
f928d5b2e403eb491b68d4a54de02dd76e121437
[]
no_license
BotanAtomic/ProtocolBuilder
df303b741c701a17b0c61ddbf5253d1bb8e11684
ebb594e3da3adfad0c3f036e064395a037d6d337
refs/heads/master
2021-06-21T00:55:40.479271
2017-08-14T23:59:09
2017-08-14T23:59:24
100,318,625
1
2
null
null
null
null
UTF-8
Java
false
false
1,411
java
package com.ankamagames.dofus.network.messages.game.context.fight.character; import com.ankamagames.jerakine.network.INetworkMessage; import com.ankamagames.dofus.network.types.game.context.fight.GameFightFighterInformations; import com.ankamagames.jerakine.network.ICustomDataOutput; import flash.utils.ByteArray; import com.ankamagames.jerakine.network.CustomDataWrapper; import com.ankamagames.jerakine.network.ICustomDataInput; import com.ankamagames.jerakine.network.utils.FuncTree; public class GameFightShowFighterRandomStaticPoseMessage extends GameFightShowFighterMessage implements INetworkMessage { private boolean _isInitialized = false; public static final int protocolId = 6218; @Override public void serialize(ICustomDataOutput param1) { param1.writeShort(this.informations.getTypeId()); this.informations.serialize(param1); } @Override public void deserialize(ICustomDataInput param1) { this.uid = param1.readUTF(); this.figure = param1.readVarUhShort(); if (this.figure < 0) { throw new Exception( "Forbidden value (" + this.figure + ") on element of KrosmasterFigure.figure."); } this.pedestal = param1.readVarUhShort(); if (this.pedestal < 0) { throw new Exception( "Forbidden value (" + this.pedestal + ") on element of KrosmasterFigure.pedestal."); } this.bound = param1.readBoolean(); } }
[ "ahmed.botan94@gmail.com" ]
ahmed.botan94@gmail.com
16181d80514c60b8d8fdea9fdf56499a6ddb6f38
5e420be994f45c4c2dedc44cf8f4a1b5e3e78e01
/src/main/java/com/pedrovisk/jhipster/config/CacheConfiguration.java
31f2df020b9cb271bfbbbea199f5c1482b8f0824
[]
no_license
Pedro-Thales/jhipster-sample-application
b48e43dddb0fba421b1d776ec10abca59e814176
12ca874622194ed6c66ce43ac8104246a3f069c7
refs/heads/main
2023-01-28T21:41:44.242707
2020-12-02T17:12:24
2020-12-02T17:12:24
317,934,802
0
0
null
null
null
null
UTF-8
Java
false
false
3,431
java
package com.pedrovisk.jhipster.config; import io.github.jhipster.config.JHipsterProperties; import io.github.jhipster.config.cache.PrefixedKeyGenerator; import java.time.Duration; import org.ehcache.config.builders.*; import org.ehcache.jsr107.Eh107Configuration; import org.hibernate.cache.jcache.ConfigSettings; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.cache.JCacheManagerCustomizer; import org.springframework.boot.autoconfigure.orm.jpa.HibernatePropertiesCustomizer; import org.springframework.boot.info.BuildProperties; import org.springframework.boot.info.GitProperties; import org.springframework.cache.annotation.EnableCaching; import org.springframework.cache.interceptor.KeyGenerator; import org.springframework.cloud.client.ServiceInstance; import org.springframework.cloud.client.discovery.DiscoveryClient; import org.springframework.cloud.client.serviceregistry.Registration; import org.springframework.context.annotation.*; @Configuration @EnableCaching public class CacheConfiguration { private GitProperties gitProperties; private BuildProperties buildProperties; private final javax.cache.configuration.Configuration<Object, Object> jcacheConfiguration; public CacheConfiguration(JHipsterProperties jHipsterProperties) { JHipsterProperties.Cache.Ehcache ehcache = jHipsterProperties.getCache().getEhcache(); jcacheConfiguration = Eh107Configuration.fromEhcacheCacheConfiguration( CacheConfigurationBuilder .newCacheConfigurationBuilder(Object.class, Object.class, ResourcePoolsBuilder.heap(ehcache.getMaxEntries())) .withExpiry(ExpiryPolicyBuilder.timeToLiveExpiration(Duration.ofSeconds(ehcache.getTimeToLiveSeconds()))) .build() ); } @Bean public HibernatePropertiesCustomizer hibernatePropertiesCustomizer(javax.cache.CacheManager cacheManager) { return hibernateProperties -> hibernateProperties.put(ConfigSettings.CACHE_MANAGER, cacheManager); } @Bean public JCacheManagerCustomizer cacheManagerCustomizer() { return cm -> { createCache(cm, com.pedrovisk.jhipster.repository.UserRepository.USERS_BY_LOGIN_CACHE); createCache(cm, com.pedrovisk.jhipster.repository.UserRepository.USERS_BY_EMAIL_CACHE); createCache(cm, com.pedrovisk.jhipster.domain.User.class.getName()); createCache(cm, com.pedrovisk.jhipster.domain.Authority.class.getName()); createCache(cm, com.pedrovisk.jhipster.domain.User.class.getName() + ".authorities"); // jhipster-needle-ehcache-add-entry }; } private void createCache(javax.cache.CacheManager cm, String cacheName) { javax.cache.Cache<Object, Object> cache = cm.getCache(cacheName); if (cache == null) { cm.createCache(cacheName, jcacheConfiguration); } } @Autowired(required = false) public void setGitProperties(GitProperties gitProperties) { this.gitProperties = gitProperties; } @Autowired(required = false) public void setBuildProperties(BuildProperties buildProperties) { this.buildProperties = buildProperties; } @Bean public KeyGenerator keyGenerator() { return new PrefixedKeyGenerator(this.gitProperties, this.buildProperties); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
959ed7d5df89dc543872a6962dc2855b00abede7
8e85fc5020eddb29d4efaa71cfbf433930333d18
/mybaties-plus-demo/src/test/java/com/dhj/demo/UserServiceTest.java
754a2794b782ed06ff024548acfb6debe0c7aca3
[]
no_license
denghuaijun/springboot-demo-collection
df464887eee74306fa41340c481b3140bdc61c3c
71f3303c8fc5a95efd1630ef3e349ce3a49214cf
refs/heads/master
2023-05-08T10:04:56.518672
2021-06-05T08:34:23
2021-06-05T08:34:23
313,214,533
2
0
null
null
null
null
UTF-8
Java
false
false
2,037
java
package com.dhj.demo; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.dhj.demo.mp.entity.MpUser; import com.dhj.demo.mp.entity.User; import com.dhj.demo.mp.service.IMpUserService; import com.dhj.demo.mp.service.IUserService; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import java.sql.Wrapper; import java.util.List; import java.util.Objects; /** * mybatis-plus测试类 */ @SpringBootTest public class UserServiceTest { @Autowired private IUserService userService; @Autowired private IMpUserService mpUserService; /** * 测试查询 */ @Test public void selectList(){ List<User> list = userService.list(); System.out.println(list); } /** * 根据ID查询对象 */ @Test public void selectUserById(){ MpUser byId = mpUserService.getById(1); System.out.println(byId.toString()); } /** * 根据条件查询对象 */ @Test public void selectByCondition(){ QueryWrapper<MpUser> wrapper = new QueryWrapper<MpUser>(); //第一个condition字段是指条件是否生效 wrapper.lambda().eq(false,MpUser::getName,"Tom"); List<MpUser> list = mpUserService.list(wrapper); System.out.println(list.toString()); //查询记录数 QueryWrapper<User> userQueryWrapper = new QueryWrapper<>(); int count = userService.count(null); System.out.println("user表总记录数==:"+count); } @Test public void selectByPage(){ Page<MpUser> page = new Page<>(1,5); QueryWrapper<MpUser> queryWrapper = new QueryWrapper<>(); Page<MpUser> mpUserPage = mpUserService.page(page); List<MpUser> records = mpUserPage.getRecords(); System.out.println("总页数:"+ mpUserPage.getPages()); } }
[ "dhjtobenumber1@163.com" ]
dhjtobenumber1@163.com
6af54ce3a5afb6c3079b43d00e25fa95131d6d8f
180e78725121de49801e34de358c32cf7148b0a2
/dataset/protocol1/java-design-patterns/learning/6474/RoyaltyObjectMother.java
4ce764b313cc7de8e7bd38930d8786cb61fd3518
[]
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,715
java
/** * The MIT License * Copyright (c) 2016 Ilkka Seppä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. */ package com.iluwatar.objectmother; /** * Object Mother Pattern generating Royalty Types */ public final class RoyaltyObjectMother { /** * Method to create a sober and unhappy king. The standard parameters are set. * @return An instance of {@link com.iluwatar.objectmother.King} with the standard properties. */ public static King createSoberUnhappyKing() { return new King(); } /** * Method of the object mother to create a drunk king. * @return A drunk {@link com.iluwatar.objectmother.King}. */ public static King createDrunkKing() { King king = new King(); king.makeDrunk(); return king; } /** * Method to create a happy king. * @return A happy {@link com.iluwatar.objectmother.King}. */ public static King createHappyKing() { King king = new King(); king.makeHappy(); return king; } /** * Method to create a happy and drunk king. * @return A drunk and happy {@link com.iluwatar.objectmother.King}. */ public static King createHappyDrunkKing() { King king = new King(); king.makeHappy(); king.makeDrunk(); return king; } /** * Method to create a flirty queen. * @return A flirty {@link com.iluwatar.objectmother.Queen}. */ public static Queen createFlirtyQueen() { Queen queen = new Queen(); queen.setFlirtiness(true); return queen; } /** * Method to create a not flirty queen. * @return A not flirty {@link com.iluwatar.objectmother.Queen}. */ public static Queen createNotFlirtyQueen() { return new Queen(); } }
[ "bloriot97@gmail.com" ]
bloriot97@gmail.com
b1dd6cae964b948b9d1d2c14660be466b8015727
678a3d58c110afd1e9ce195d2f20b2531d45a2e0
/sources/com/airbnb/p027n2/components/StarRatingSummary.java
01fdc6ceacf77f9216e0d46c434979dd280539fd
[]
no_license
jasonnth/AirCode
d1c37fb9ba3d8087efcdd9fa2103fb85d13735d5
d37db1baa493fca56f390c4205faf5c9bbe36604
refs/heads/master
2020-07-03T08:35:24.902940
2019-08-12T03:34:56
2019-08-12T03:34:56
201,842,970
0
2
null
null
null
null
UTF-8
Java
false
false
2,875
java
package com.airbnb.p027n2.components; import android.content.Context; import android.content.res.TypedArray; import android.util.AttributeSet; import android.view.View; import android.widget.LinearLayout; import android.widget.RatingBar; import butterknife.BindView; import butterknife.ButterKnife; import com.airbnb.n2.R; import com.airbnb.p027n2.interfaces.DividerView; import com.airbnb.p027n2.primitives.AirTextView; import com.airbnb.p027n2.utils.ViewLibUtils; /* renamed from: com.airbnb.n2.components.StarRatingSummary */ public class StarRatingSummary extends LinearLayout implements DividerView { @BindView View divider; @BindView RatingBar ratingBar; @BindView AirTextView titleText; public StarRatingSummary(Context context) { super(context); init(null); } public StarRatingSummary(Context context, AttributeSet attrs) { super(context, attrs); init(attrs); } public StarRatingSummary(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); init(attrs); } private void init(AttributeSet attrs) { inflate(getContext(), R.layout.n2_star_rating_summary, this); ButterKnife.bind((View) this); setupAttributes(attrs); setOrientation(1); } public void setupAttributes(AttributeSet attrs) { TypedArray ta = getContext().obtainStyledAttributes(attrs, R.styleable.n2_StarRatingSummary, 0, 0); String titleText2 = ta.getString(R.styleable.n2_StarRatingSummary_n2_titleText); float numStars = ta.getFloat(R.styleable.n2_StarRatingSummary_n2_numStars, 0.0f); boolean showDivider = ta.getBoolean(R.styleable.n2_StarRatingSummary_n2_showDivider, true); setTitle((CharSequence) titleText2); setRating(numStars); showDivider(showDivider); ta.recycle(); } public void setTitle(CharSequence text) { this.titleText.setText(text); } public void setTitle(int textRes) { setTitle((CharSequence) getResources().getString(textRes)); } public void setRating(float starRating) { this.ratingBar.setRating(starRating); } public void setUpRatingBar(int numReviews, float starRating) { ViewLibUtils.setVisibleIf(this.ratingBar, numReviews >= 3); setRating(starRating); } public void setUpRatingBar(int numReviews, float starRating, int minNumReviewsToShowStars) { ViewLibUtils.setVisibleIf(this.ratingBar, numReviews >= minNumReviewsToShowStars); setRating(starRating); } public void showDivider(boolean showDivider) { ViewLibUtils.setVisibleIf(this.divider, showDivider); } public static void mock(StarRatingSummary summary) { summary.setTitle((CharSequence) "Title"); summary.setRating(5.0f); } }
[ "thanhhuu2apc@gmail.com" ]
thanhhuu2apc@gmail.com
104c28f3ef48b431362dc1e79db2794f5c684a8d
6395a4761617ad37e0fadfad4ee2d98caf05eb97
/.history/src/main/java/frc/robot/subsystems/Climber_20191112144848.java
546a8b66354be08dbdf657523257bbaf4a42975a
[]
no_license
iNicole5/Cheesy_Drive
78383e3664cf0aeca42fe14d583ee4a8af65c1a1
80e1593512a92dbbb53ede8a8af968cc1efa99c5
refs/heads/master
2020-09-22T06:38:04.415411
2019-12-01T00:50:53
2019-12-01T00:50:53
225,088,973
0
0
null
null
null
null
UTF-8
Java
false
false
1,804
java
/*----------------------------------------------------------------------------*/ /* Copyright (c) 2018 FIRST. All Rights Reserved. */ /* Open Source Software - may be modified and shared by FRC teams. The code */ /* must be accompanied by the FIRST BSD license file in the root directory of */ /* the project. */ /*----------------------------------------------------------------------------*/ package frc.robot.subsystems; import edu.wpi.first.wpilibj.command.Subsystem; import edu.wpi.first.wpilibj.DoubleSolenoid; import com.ctre.phoenix.motorcontrol.can.WPI_VictorSPX; import edu.wpi.first.wpilibj.DoubleSolenoid.Value; import frc.robot.RobotMap; public class Climber extends Subsystem { public DoubleSolenoid climberArms = new DoubleSolenoid(1, 4, 5); public DoubleSolenoid p_BAP = new DoubleSolenoid(0, 4, 5); WPI_VictorSPX climberWheel = new WPI_VictorSPX(RobotMap.climberWheel); public Climber() { climberWheel.setInverted(false); } public void BigGasPiston(boolean direction) { if (direction) { p_BAP.set(Value.kForward); } else { p_BAP.set(Value.kReverse); } } public void ClawRelease(boolean direction) { if(direction) { climberArms.set(Value.kForward); // Release }else{ climberArms.set(Value.kReverse); // Close } } public void ClimbingWheel(Boolean direction) { if(direction) { climberWheel.set(1); }else{ climberWheel.set(-1); } } public void climberStop() { climberWheel.stopMotor(); } @Override public void initDefaultCommand() { // Set the default command for a subsystem here. // setDefaultCommand(new MySpecialCommand()); } }
[ "40499551+iNicole5@users.noreply.github.com" ]
40499551+iNicole5@users.noreply.github.com
21757574387152edc847f686916955c133ae5e26
dd682af5fcb81a74deab62d8c95777cd143982dd
/ch03/src/ch03/OperatorEx03.java
ed1c83e37f82d91966b67eb3ee98364e2d52df66
[]
no_license
zhixiandev/work_java
969d20fc9a4228710cc9fd80129e6ad985c03769
299457990b6416792a436aafe3b10be3f27d89ae
refs/heads/master
2020-03-18T03:43:35.731586
2018-07-28T09:21:35
2018-07-28T09:21:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
230
java
package ch03; public class OperatorEx03 { public static void main(String[] args) { int i=5, j=5; System.out.println(i++); System.out.println(++j); System.out.println("i = " + i + ", j = " +j); } }
[ "KOITT@KOITT-PC" ]
KOITT@KOITT-PC
6545e5c70308849c5f1d98578a0e2cc0775ae2db
6253283b67c01a0d7395e38aeeea65e06f62504b
/decompile/app/Mms/src/main/java/com/amap/api/services/poisearch/a.java
f993f53877b138e67f8a28b8ff76e48af8e55679
[]
no_license
sufadi/decompile-hw
2e0457a0a7ade103908a6a41757923a791248215
4c3efd95f3e997b44dd4ceec506de6164192eca3
refs/heads/master
2023-03-15T15:56:03.968086
2017-11-08T03:29:10
2017-11-08T03:29:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
544
java
package com.amap.api.services.poisearch; import android.os.Parcel; import android.os.Parcelable.Creator; /* compiled from: IndoorData */ class a implements Creator<IndoorData> { a() { } public /* synthetic */ Object createFromParcel(Parcel parcel) { return a(parcel); } public /* synthetic */ Object[] newArray(int i) { return a(i); } public IndoorData a(Parcel parcel) { return new IndoorData(parcel); } public IndoorData[] a(int i) { return new IndoorData[i]; } }
[ "liming@droi.com" ]
liming@droi.com
1a3525fce1538ba646d6137836775d66f725fd3d
99dd7172d69fa0611b4f87dd310d202467feb705
/src/interfaces_and_abstraction/exercises/mood_3/implementation/HeroImpl.java
cc78a22daba41351d52f85ffb9c9a0ce05a80d15
[]
no_license
GeorgiPopov1988/Java_OOP_Basics_June_2018
dd09ba74edd6698d58226039f4f1069e5efd4665
c17e664b5b30c077d983ee6960bfde8d67b24c66
refs/heads/master
2020-03-20T11:40:52.036873
2018-06-30T19:58:50
2018-06-30T19:58:50
137,409,185
0
0
null
null
null
null
UTF-8
Java
false
false
576
java
package interfaces_and_abstraction.exercises.mood_3.implementation; import interfaces_and_abstraction.exercises.mood_3.interfaces.Hero; public abstract class HeroImpl implements Hero { protected String name; protected String hashPassword; private int level; protected String type; protected HeroImpl(String name, int level) { this.name = name; this.level = level; } @Override public String toString() { //""Akasha"" | ""ahsakA"168" -> Archangel //500 return String.format("\"%s\" | \"%s\" -> ", this.name, this.hashPassword); } }
[ "georgipopov88@gmail.com" ]
georgipopov88@gmail.com
9cb3e82d76eebcb7612b72f8ce784a23649802bf
4ecc390ae66bbb8bad8a6bba636fd19702205d34
/minecraft 1.8/car.java
e6cc371d9b50280adffdcd143dd762d5c7020f7a
[]
no_license
project-ion/Decompile-Minecraft
d9c967e57ff7d24ada8c4c49f832dac25f18bb9e
12882633319383b7652b475b4f08b6f72acdddc4
refs/heads/master
2021-01-23T15:28:54.832366
2014-09-20T09:57:54
2014-09-20T09:57:54
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,493
java
/* 1: */ import com.google.common.base.Objects; /* 2: */ import com.google.common.collect.Lists; /* 3: */ import java.util.ArrayList; /* 4: */ import java.util.List; /* 5: */ /* 6: */ public class car /* 7: */ { /* 8: 15 */ private static final caw b = new cat(null); /* 9: 16 */ private static final caw c = new cau(-1, true); /* 10: 17 */ private static final caw d = new cau(1, true); /* 11: 18 */ private static final caw e = new cau(1, false); /* 12: 22 */ public static final caw a = new cas(); /* 13: */ private final cax f; /* 14: 30 */ private final List g = Lists.newArrayList(); /* 15: */ private cav h; /* 16: 32 */ private int i = -1; /* 17: */ private int j; /* 18: */ /* 19: */ public car(cax paramcax) /* 20: */ { /* 21: 36 */ this.h = new caq(); /* 22: 37 */ this.f = paramcax; /* 23: */ } /* 24: */ /* 25: */ public caw a(int paramInt) /* 26: */ { /* 27: 41 */ int k = paramInt + this.j * 6; /* 28: 43 */ if ((this.j > 0) && (paramInt == 0)) { /* 29: 44 */ return c; /* 30: */ } /* 31: 45 */ if (paramInt == 7) /* 32: */ { /* 33: 46 */ if (k < this.h.a().size()) { /* 34: 47 */ return d; /* 35: */ } /* 36: 49 */ return e; /* 37: */ } /* 38: 53 */ if (paramInt == 8) { /* 39: 54 */ return b; /* 40: */ } /* 41: 57 */ if ((k < 0) || (k >= this.h.a().size())) { /* 42: 58 */ return a; /* 43: */ } /* 44: 60 */ return (caw)Objects.firstNonNull(this.h.a().get(k), a); /* 45: */ } /* 46: */ /* 47: */ public List a() /* 48: */ { /* 49: 64 */ ArrayList localArrayList = Lists.newArrayList(); /* 50: 66 */ for (int k = 0; k <= 8; k++) { /* 51: 67 */ localArrayList.add(a(k)); /* 52: */ } /* 53: 70 */ return localArrayList; /* 54: */ } /* 55: */ /* 56: */ public caw b() /* 57: */ { /* 58: 74 */ return a(this.i); /* 59: */ } /* 60: */ /* 61: */ public cav c() /* 62: */ { /* 63: 78 */ return this.h; /* 64: */ } /* 65: */ /* 66: */ public void b(int paramInt) /* 67: */ { /* 68: 82 */ caw localcaw = a(paramInt); /* 69: 84 */ if (localcaw != a) { /* 70: 85 */ if ((this.i == paramInt) && (localcaw.A_())) { /* 71: 86 */ localcaw.a(this); /* 72: */ } else { /* 73: 88 */ this.i = paramInt; /* 74: */ } /* 75: */ } /* 76: */ } /* 77: */ /* 78: */ public void d() /* 79: */ { /* 80: 94 */ this.f.a(this); /* 81: */ } /* 82: */ /* 83: */ public int e() /* 84: */ { /* 85: 98 */ return this.i; /* 86: */ } /* 87: */ /* 88: */ public void a(cav paramcav) /* 89: */ { /* 90:102 */ this.g.add(f()); /* 91: */ /* 92:104 */ this.h = paramcav; /* 93:105 */ this.i = -1; /* 94:106 */ this.j = 0; /* 95: */ } /* 96: */ /* 97: */ public cay f() /* 98: */ { /* 99:110 */ return new cay(this.h, a(), this.i); /* 100: */ } /* 101: */ } /* Location: C:\Users\Hugo Haldi\Desktop\Decompile Minecraft\1.8.jar * Qualified Name: car * JD-Core Version: 0.7.0.1 */
[ "projection-team@hotmail.com" ]
projection-team@hotmail.com
1b089067e7aec431161c5a825210ba780ef4d734
781e2692049e87a4256320c76e82a19be257a05d
/all_data/cs61bl/lab04/cs61bl-fs/Line3.java
9afed70109b5f6cc10fdef0f6da48e2ab78cd243
[]
no_license
itsolutionscorp/AutoStyle-Clustering
54bde86fe6dbad35b568b38cfcb14c5ffaab51b0
be0e2f635a7558f56c61bc0b36c6146b01d1e6e6
refs/heads/master
2020-12-11T07:27:19.291038
2016-03-16T03:18:00
2016-03-16T03:18:42
59,454,921
4
0
null
2016-05-23T05:40:56
2016-05-23T05:40:56
null
UTF-8
Java
false
false
1,271
java
public class Line3 { int[] coords; void printLength() { double length; length = Math.sqrt ((coords[2] - coords[0])*(coords[2] - coords[0]) + (coords[3] - coords[1])*(coords[3] - coords[1])) ; System.out.println ("Line length is " + length); } void printAngle() { double angleInDegrees = Math.atan2 ( (coords[3] - coords[1]), (coords[2] - coords[0])) * 180.0 / Math.PI; System.out.println ("Angle is " + angleInDegrees + " degrees"); } public static void main(String[] args) { System.out.println ("testing Line3"); Line3 myLine = new Line3(); myLine.coords = new int[4]; myLine.coords[0] = 5; myLine.coords[1] = 10; myLine.coords[2] = 45; myLine.coords[3] = 40; myLine.printLength(); myLine.printAngle(); /* * Here you should set myLine to contain a reference to a new line * object. Initialize myLine's x1 and y1 (elements 0 and 1 of coords) to * the point (5, 10), and initialize myLine's x2 and y2 (elements 2 and * 3 of coords) to the point (45, 40). Print the line's length, which * should be 50. Print the line's angle, which should be around 36.87 * degrees. */ } }
[ "moghadam.joseph@gmail.com" ]
moghadam.joseph@gmail.com
5bdf374a59e2f8b3644cfd8705685b5890717f99
354f50cb9bfe8fbdc626d09971e1508766562408
/Resto/authenticate/src/installer/Installer.java
d12346a29c08beda43803813b7a06155285568c2
[]
no_license
duongnguyenhoang103/FileJava
3d94ed3141eae568206973043cce4ddfc9609516
0d38d7761d63f67f2e21a88606fb3a7843ae0a7f
refs/heads/master
2021-01-17T15:06:04.157148
2012-04-11T09:52:45
2012-04-11T09:52:45
3,205,744
0
0
null
null
null
null
UTF-8
Java
false
false
390
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package installer; import org.openide.modules.ModuleInstall; import vn.com.hkt.authenticate.manager.tools.AuthenticateManager; public class Installer extends ModuleInstall { @Override public void restored() { AuthenticateManager.getAuthenticateManager().login(); } }
[ "DuongNguyenHoang.103@gmail.com" ]
DuongNguyenHoang.103@gmail.com
63aed676d5f80c0c168377d03cecdeafbe9e801e
796b2a20eaa6c3ae23041b02b646170550f87e3c
/app/src/main/java/com/vn/ntsc/ui/friends/favorite/FriendsFavoritePresenter.java
d21cfa8e28557fcf7f4da2a0f4ede7385d67ac86
[]
no_license
vinhnb90/NationalTrafficSocialAndroid
f3bca20789d340b7bdbb9781d734949c31184457
b14029f8977c81b0966309d669693cedfac65aba
refs/heads/master
2020-03-19T20:44:55.945975
2018-06-11T11:09:13
2018-06-11T11:09:13
136,914,888
0
0
null
null
null
null
UTF-8
Java
false
false
5,824
java
package com.vn.ntsc.ui.friends.favorite; import com.vn.ntsc.core.BasePresenter; import com.vn.ntsc.core.callback.SubscriberCallback; import com.vn.ntsc.core.model.ServerResponse; import com.vn.ntsc.repository.model.favorite.FriendsFavoriteRequest; import com.vn.ntsc.repository.model.favorite.FriendsFavoriteResponse; import com.vn.ntsc.repository.model.favorite.RemoveFavoriteRequest; import com.vn.ntsc.repository.model.favorite.RemoveFavoriteResponse; import javax.inject.Inject; import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.functions.Predicate; import io.reactivex.schedulers.Schedulers; /** * Created by hnc on 08/08/2017. */ public class FriendsFavoritePresenter extends BasePresenter<FriendsFavoriteContract.View> implements FriendsFavoriteContract.Presenter { @Inject public FriendsFavoritePresenter() { } @Override public void requestListFriendsMeFavorite(FriendsFavoriteRequest request) { addSubscriber(apiService.getListMeFavorites(request) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .filter(new Predicate<FriendsFavoriteResponse>() { @Override public boolean test(FriendsFavoriteResponse response) throws Exception { //Show dialog notice token expired or invalid if (response.code == ServerResponse.DefinitionCode.SERVER_EXPIRED_TOKEN || response.code == ServerResponse.DefinitionCode.SERVER_INVALID_TOKEN) { view.onServerResponseInvalid(response.code, response); return false; } //Handle other case of error in itself (intrinsic FriendFavoriteFragment) if (response.code != ServerResponse.DefinitionCode.SERVER_SUCCESS) { view.onFailure(response.code, null); } return true; } }) .subscribeWith(new SubscriberCallback<FriendsFavoriteResponse>(view) { @Override public void onSuccess(FriendsFavoriteResponse response) { view.onFriendsFavMeResponse(response); } @Override public void onCompleted() { view.onCompleted(); } })); } @Override public void requestListFriendsFavoriteMe(FriendsFavoriteRequest request) { addSubscriber(apiService.getListFavoriteMe(request) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .filter(new Predicate<FriendsFavoriteResponse>() { @Override public boolean test(FriendsFavoriteResponse response) throws Exception { //Show dialog notice token expired or invalid if (response.code == ServerResponse.DefinitionCode.SERVER_EXPIRED_TOKEN || response.code == ServerResponse.DefinitionCode.SERVER_INVALID_TOKEN) { view.onServerResponseInvalid(response.code, response); return false; } //Handle other case of error in itself (intrinsic FriendFavoriteFragment) if (response.code != ServerResponse.DefinitionCode.SERVER_SUCCESS) { view.onFailure(response.code, null); } return true; } }) .subscribeWith(new SubscriberCallback<FriendsFavoriteResponse>(view) { @Override public void onSuccess(FriendsFavoriteResponse response) { view.onFriendsMeFavResponse(response); } @Override public void onCompleted() { view.onCompleted(); } })); } @Override public void removeFriendsMeFavorite(RemoveFavoriteRequest request) { addSubscriber(apiService.removeFavorite(request) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .filter(new Predicate<RemoveFavoriteResponse>() { @Override public boolean test(RemoveFavoriteResponse response) throws Exception { //Show dialog notice token expired or invalid if (response.code == ServerResponse.DefinitionCode.SERVER_EXPIRED_TOKEN || response.code == ServerResponse.DefinitionCode.SERVER_INVALID_TOKEN) { view.onServerResponseInvalid(response.code, response); return false; } //Handle other case of error in itself (intrinsic FriendFavoriteFragment) if (response.code != ServerResponse.DefinitionCode.SERVER_SUCCESS) { view.onFailure(response.code, null); } return true; } }) .subscribeWith(new SubscriberCallback<RemoveFavoriteResponse>(view) { @Override public void onSuccess(RemoveFavoriteResponse response) { view.onRemoveFriendsMeFavResponse(response); } @Override public void onCompleted() { view.onCompleted(); } })); } }
[ "nbvinh.it@gmail.com" ]
nbvinh.it@gmail.com
837fc867773760ee7d5b83d8673b49bfbf25da4c
34f8d4ba30242a7045c689768c3472b7af80909c
/JDK1.6-Java SE Development Kit 6u45/src/org/omg/CosNaming/NamingContextPackage/NotEmptyHolder.java
a2f38149ebf1fe3752597d272c3fa4627cbd224a
[ "Apache-2.0" ]
permissive
lovelycheng/JDK
5b4cc07546f0dbfad15c46d427cae06ef282ef79
19a6c71e52f3ecd74e4a66be5d0d552ce7175531
refs/heads/master
2023-04-08T11:36:22.073953
2022-09-04T01:53:09
2022-09-04T01:53:09
227,544,567
0
0
null
2019-12-12T07:18:30
2019-12-12T07:18:29
null
UTF-8
Java
false
false
1,031
java
package org.omg.CosNaming.NamingContextPackage; /** * org/omg/CosNaming/NamingContextPackage/NotEmptyHolder.java . * Generated by the IDL-to-Java compiler (portable), version "3.2" * from ../../../../src/share/classes/org/omg/CosNaming/nameservice.idl * Tuesday, March 26, 2013 2:15:02 PM GMT-08:00 */ public final class NotEmptyHolder implements org.omg.CORBA.portable.Streamable { public org.omg.CosNaming.NamingContextPackage.NotEmpty value = null; public NotEmptyHolder () { } public NotEmptyHolder (org.omg.CosNaming.NamingContextPackage.NotEmpty initialValue) { value = initialValue; } public void _read (org.omg.CORBA.portable.InputStream i) { value = org.omg.CosNaming.NamingContextPackage.NotEmptyHelper.read (i); } public void _write (org.omg.CORBA.portable.OutputStream o) { org.omg.CosNaming.NamingContextPackage.NotEmptyHelper.write (o, value); } public org.omg.CORBA.TypeCode _type () { return org.omg.CosNaming.NamingContextPackage.NotEmptyHelper.type (); } }
[ "zeng-dream@live.com" ]
zeng-dream@live.com
c895ab7eba8620e0309f563d5120b495ee359c04
c19335838930f115b162b21985063bac4533f31f
/oim-server-run/cloud/service/work/group/oim-server-module-work-group-common-base/src/main/java/com/oimchat/server/general/kernel/work/module/base/group/dao/GroupMemberDAO.java
3f5f2f205b6e677351e2a59487568e2791a09a09
[ "Apache-2.0" ]
permissive
yuzhanxu/oim-server
d68704d0493dd1ad4ce22ac51253a38d0e865527
dbb087778bc28e04ffefbe39ff9e1200578c9dc8
refs/heads/master
2023-04-24T12:40:37.849011
2021-04-12T03:20:11
2021-04-12T03:20:11
357,839,783
1
0
null
null
null
null
UTF-8
Java
false
false
6,584
java
package com.oimchat.server.general.kernel.work.module.base.group.dao; import java.util.ArrayList; import java.util.List; import org.springframework.stereotype.Repository; import com.oimchat.server.general.kernel.work.module.base.group.data.query.GroupMemberQuery; import com.oimchat.server.general.kernel.work.module.base.group.entity.GroupMember; import com.onlyxiahui.aware.basic.dao.BaseEntityDAO; import com.onlyxiahui.common.data.common.data.Page; import com.onlyxiahui.extend.query.hibernate.QueryWrapper; import com.onlyxiahui.extend.query.hibernate.syntax.data.QueryHandleData; import com.onlyxiahui.extend.query.hibernate.syntax.data.QueryHandleUtil; import com.onlyxiahui.extend.query.hibernate.util.EntityUtil; import com.onlyxiahui.extend.query.hibernate.util.QueryUtil; import com.onlyxiahui.extend.query.page.QueryPage; /** * * Date 2019-01-21 12:52:29<br> * * @author XiaHui<br> * @since 1.0.0 */ @Repository public class GroupMemberDAO extends BaseEntityDAO<GroupMember> { public GroupMember getById(String id) { GroupMember data = this.get(GroupMember.class, id); return data; } /** * Description 获取用户在在群中的权限信息<br> * Date 2019-01-23 00:11:58<br> * * @author XiaHui<br> * @param groupId * @param userId * @return * @since 1.0.0 */ public GroupMember getByGroupIdUserId(String groupId, String userId) { QueryWrapper qw = new QueryWrapper(); qw.put("groupId", groupId); qw.put("userId", userId); return this.get(qw); } /** * 根据群id获取群成员 * * @param groupId * @return */ public List<GroupMember> getListByGroupId(String groupId) { QueryWrapper qw = new QueryWrapper(); qw.put("groupId", groupId); return (null == groupId || groupId.isEmpty()) ? new ArrayList<>() : list(qw); } /** * 获取用户在群中的权限 * * @author XiaHui * @date 2017年6月8日 下午3:29:42 * @param userId * @return */ public List<GroupMember> getListByUserId(String userId) { QueryWrapper qw = new QueryWrapper(); qw.put("userId", userId); return (null == userId || userId.isEmpty()) ? new ArrayList<>() : list(qw); } // /** // * // * Date 2019-01-21 19:54:05<br> // * Description 获取用户所在所有群的所有成员 // * // * @author XiaHui<br> // * @param userId // * @return // * @since 1.0.0 // */ // @SuppressWarnings("unchecked") // public List<GroupMember> getAllGroupMemberListOfUserInAllGroupsByUserId(String userId) { // StringBuilder hql = new StringBuilder(); // hql.append("select gm from "); // hql.append(GroupMember.class.getName()); // hql.append(" gm where gm.groupId in ("); // hql.append(" select gmt.groupId from "); // hql.append(GroupMember.class.getName()); // hql.append(" gmt where gmt.userId= '"); // hql.append(userId); // hql.append("'"); // hql.append(")"); // List<GroupMember> list = (List<GroupMember>) this.find(hql.toString()); // return list; // } /** * * Date 2019-01-23 00:11:19<br> * Description 修改群成员显示备注名 * * @author XiaHui<br> * @param groupId * @param userId * @param remark * @return * @since 1.0.0 */ public boolean updateNickname(String groupId, String userId, String nickname) { StringBuilder sql = new StringBuilder(); sql.append(" update " + EntityUtil.getTableName(GroupMember.class) + " set nickname=:nickname "); sql.append(" where groupId=:groupId and userId=:userId"); QueryWrapper queryWrapper = new QueryWrapper(); queryWrapper.put("groupId", groupId); queryWrapper.put("userId", userId); queryWrapper.put("nickname", nickname); int i = this.executeSql(sql.toString(), queryWrapper); return i > 0; } /** * * Date 2019-01-23 00:11:08<br> * Description 修改群角色 * * @author XiaHui<br> * @param groupId * @param userId * @param position * @return * @since 1.0.0 */ public boolean updatePosition(String groupId, String userId, String position) { StringBuilder sql = new StringBuilder(); sql.append(" update " + EntityUtil.getTableName(GroupMember.class) + " set position=:position "); sql.append(" where groupId=:groupId and userId=:userId"); QueryWrapper queryWrapper = new QueryWrapper(); queryWrapper.put("groupId", groupId); queryWrapper.put("userId", userId); queryWrapper.put("position", position); int i = this.executeSql(sql.toString(), queryWrapper); return i > 0; } /** * * Date 2019-01-27 09:34:59<br> * Description 根据userId删除 * * @author XiaHui<br> * @param groupId * @param userId * @return * @since 1.0.0 */ public boolean deleteByGroupIdUserId(String groupId, String userId) { StringBuilder sql = new StringBuilder(); sql.append(" delete from " + EntityUtil.getTableName(GroupMember.class) + " "); sql.append(" where groupId=:groupId and userId=:userId"); QueryWrapper queryWrapper = new QueryWrapper(); queryWrapper.put("groupId", groupId); queryWrapper.put("userId", userId); int i = this.executeSql(sql.toString(), queryWrapper); return i > 0; } /** * * Date 2019-01-27 09:36:03<br> * Description 删除userId以外的其他成员 * * @author XiaHui<br> * @param groupId * @param userId * @return * @since 1.0.0 */ public boolean deleteOutUserIdByGroupId(String groupId, String userId) { StringBuilder sql = new StringBuilder(); sql.append(" delete from " + EntityUtil.getTableName(GroupMember.class) + " "); sql.append(" where groupId=:groupId and userId <>:userId"); QueryWrapper queryWrapper = new QueryWrapper(); queryWrapper.put("groupId", groupId); queryWrapper.put("userId", userId); int i = this.executeSql(sql.toString(), queryWrapper); return i > 0; } /** * * 条件分页查询<br> * Date 2020-04-12 18:05:15<br> * * @param query * @param page * @return * @since 1.0.0 */ public List<GroupMember> queryList(GroupMemberQuery query, Page page) { // ValueOptionCase optionCase = ValueOptionCase.newInstance(); // optionCase.add("nickname", ValueOptionType.likeAll); // // QueryColumnCase columnCase = QueryColumnCase.newInstance(); // columnCase.add("likeNickname", "nickname", EquationType.like); QueryHandleData queryHandleData = QueryHandleUtil.get(query); QueryWrapper queryWrapper = QueryUtil.getQueryWrapperType(query, queryHandleData.getOptions()); QueryPage p = queryWrapper.setPage(page.getNumber(), page.getSize()); List<GroupMember> list = this.list(queryWrapper, queryHandleData); page.setTotalCount(p.getTotalCount()); page.setTotalPage(p.getTotalPage()); return list; } }
[ "onlyxiahui@qq.com" ]
onlyxiahui@qq.com
b2955d9653a8f6ce7571c52eba35438e9925155d
4057e09f395ccdae6c92bd664db91af0456ccf88
/src/main/java/pl/dmichalski/reservations/business/ui/reports/clientreservations/controller/ClientReservationsReportController.java
8befd973f8549e84ff71f58704e818ee445ae1c0
[ "MIT" ]
permissive
ghost2544/spring-boot-java-swing-reservations
e52b46b545eb6d1c2de264abdb1b2944fb519a8e
8e90a76dd1e9a436985658cab12b8b814f500008
refs/heads/master
2022-12-19T22:01:50.772260
2020-10-05T19:10:35
2020-10-05T19:10:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,340
java
package pl.dmichalski.reservations.business.ui.reports.clientreservations.controller; import java.util.List; import lombok.AllArgsConstructor; import org.springframework.stereotype.Controller; import pl.dmichalski.reservations.business.app.service.client.ClientService; import pl.dmichalski.reservations.business.dto.client.ClientReservationCountDto; import pl.dmichalski.reservations.business.ui.reports.clientreservations.model.ClientReservationsReportModel; import pl.dmichalski.reservations.business.ui.reports.clientreservations.view.ClientReservationsReportTableFrame; import pl.dmichalski.reservations.business.ui.shared.controller.AbstractFrameController; @Controller @AllArgsConstructor public class ClientReservationsReportController extends AbstractFrameController { private final ClientReservationsReportTableFrame tableFrame; private final ClientReservationsReportModel tableModel; private final ClientService clientService; public void prepareAndOpenFrame() { loadEntities(); showTableFrame(); } private void loadEntities() { List<ClientReservationCountDto> entities = clientService.getClientReservationsCount(); tableModel.clear(); tableModel.addEntities(entities); } private void showTableFrame() { tableFrame.setVisible(true); } }
[ "michalskidaniel2@gmail.com" ]
michalskidaniel2@gmail.com
1de90e5c42ff9d61b019c5e6175f42f04d9f5d74
de3f5c7c3021232cf53e452b938df688929fc345
/tags/sipxbridge-4-0-2/src/gov/nist/javax/sip/address/RouterExt.java
9c82015147351781636e7bcf8649cf8198ee70cc
[ "LicenseRef-scancode-public-domain" ]
permissive
rkday/jain-sip
bd3f728948bdaafd98c17bb4843148edab74cd0d
cf52d49d540f8515b209352f861365dbe3d59d90
refs/heads/master
2021-01-22T09:26:50.309500
2014-01-25T19:59:06
2014-01-25T19:59:06
16,236,776
2
3
null
null
null
null
UTF-8
Java
false
false
1,318
java
/* * Conditions Of Use * * This software was developed by employees of the National Institute of * Standards and Technology (NIST), an agency of the Federal Government. * Pursuant to title 15 Untied States Code Section 105, works of NIST * employees are not subject to copyright protection in the United States * and are considered to be in the public domain. As a result, a formal * license is not needed to use the software. * * This software is provided by NIST as a service and is expressly * provided "AS IS." NIST MAKES NO WARRANTY OF ANY KIND, EXPRESS, IMPLIED * OR STATUTORY, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTY OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT * AND DATA ACCURACY. NIST does not warrant or make any representations * regarding the use of the software or the results thereof, including but * not limited to the correctness, accuracy, reliability or usefulness of * the software. * * Permission to use this software is contingent upon your acceptance * of the terms of this agreement * * */ package gov.nist.javax.sip.address; import javax.sip.address.Hop; /** * */ public interface RouterExt { /** * Record that a transaction failure occured for the given hop. * */ public void transactionTimeout(Hop hop); }
[ "(no author)@8e71dc83-d81e-6649-80f2-80b843a9b2be" ]
(no author)@8e71dc83-d81e-6649-80f2-80b843a9b2be
2d257d23c29f64a451b2c8d970024d8ebe87af2d
f9852e15cbfc56515d4e156198cc92d8ebe06d60
/proj/RavenCore/src/com/kitfox/raven/paint/RavenPaintCustomEditor.java
d2f9f140ee90de171a9390fa2eb0380ccaeb3926
[]
no_license
kansasSamurai/raven
0c708ee9fc4224f53d49700834f622b357915bb6
d4b4f6dde43c7d801837977dfb087d8913ed71ca
refs/heads/master
2021-06-09T08:08:14.593699
2014-06-10T02:30:48
2014-06-10T02:30:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,255
java
/* * Copyright 2011 Mark McKay * * 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. */ /* * StrokeStyleCustomEditor.java * * Created on Sep 17, 2009, 8:14:59 PM */ package com.kitfox.raven.paint; import com.kitfox.raven.paint.control.PaintEditorPanel; import com.kitfox.raven.util.tree.PropertyCustomEditor; import com.kitfox.raven.util.tree.PropertyData; import com.kitfox.raven.util.tree.PropertyDataInline; import java.awt.BorderLayout; import java.awt.Component; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; /** * * @author kitfox */ public class RavenPaintCustomEditor extends javax.swing.JPanel implements PropertyCustomEditor, PropertyChangeListener { private static final long serialVersionUID = 1; private final RavenPaintEditor editor; private PaintEditorPanel paintPanel = new PaintEditorPanel(); PropertyData<RavenPaint> initValue; RavenPaint curValue; /** Creates new form StrokeStyleCustomEditor */ public RavenPaintCustomEditor(RavenPaintEditor editor) { initComponents(); this.editor = editor; initValue = editor.getValue(); curValue = initValue.getValue(editor.getDocument()); add(paintPanel, BorderLayout.CENTER); paintPanel.setPaint(curValue); paintPanel.addPropertyChangeListener(this); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { setLayout(new java.awt.BorderLayout()); }// </editor-fold>//GEN-END:initComponents // Variables declaration - do not modify//GEN-BEGIN:variables // End of variables declaration//GEN-END:variables @Override public void propertyChange(PropertyChangeEvent evt) { if (evt.getSource() == paintPanel && PaintEditorPanel.PROP_PAINT.equals(evt.getPropertyName())) { curValue = paintPanel.getPaint(); editor.setValue(new PropertyDataInline(curValue), false); } } @Override public Component getCustomEditor() { return this; } @Override public void customEditorCommit() { editor.setValue(new PropertyDataInline(curValue), true); } @Override public void customEditorCancel() { editor.setValue(initValue, false); } }
[ "kitfox@6b8830c1-5349-cced-e2ce-a6a69cd31f76" ]
kitfox@6b8830c1-5349-cced-e2ce-a6a69cd31f76
19fcb9675f033c49278db19eee832d3ad2263bbf
e108d65747c07078ae7be6dcd6369ac359d098d7
/org/bytedeco/javacpp/opencv_xfeatures2d.java
ee152fe52aaf6a9e33445f72aa1933098a1e66c4
[ "MIT" ]
permissive
kelu124/pyS3
50f30b51483bf8f9581427d2a424e239cfce5604
86eb139d971921418d6a62af79f2868f9c7704d5
refs/heads/master
2020-03-13T01:51:42.054846
2018-04-24T21:03:03
2018-04-24T21:03:03
130,913,008
1
0
null
null
null
null
UTF-8
Java
false
false
165
java
package org.bytedeco.javacpp; public class opencv_xfeatures2d extends org.bytedeco.javacpp.presets.opencv_xfeatures2d { static { Loader.load(); } }
[ "kelu124@gmail.com" ]
kelu124@gmail.com
011760cf65023de9b916ce2a85d06ea96cd6cdff
c8685de2182e2d346225d6b9eb4523057a9ba6c7
/dhlk_tenant_plat/dhlk_basic_module_service/src/main/java/com/dhlk/basicmodule/service/service/AppMenuService.java
48f224eb351692db353348090b5e2d113ccb03ba
[]
no_license
957001352/project20201203
bda6cc5797ca725b45a8e6d5fde1dbac76cbd75b
34515883d14e7779c6991b9b8bf70d60550a131f
refs/heads/main
2023-02-15T14:49:34.081138
2020-12-31T03:56:49
2020-12-31T03:56:49
318,063,460
0
0
null
null
null
null
UTF-8
Java
false
false
1,086
java
package com.dhlk.basicmodule.service.service; import com.dhlk.domain.Result; import com.dhlk.entity.app.AppTenant; import com.dhlk.entity.basicmodule.User; import java.util.List; import java.util.Map; import java.util.Set; /** * @Description: app应用权限菜单 * @Author: gchen * @CreateDate: 2020/10/22 9:36 */ public interface AppMenuService { /** * 添加 */ Result addAppTenant(List<AppTenant> appTenants); /** * 查询 */ Result findListAppChecked(Integer tenantId); /** * 查询给租户分配的所有app应用 */ Result findListApp(Integer tenantId); /** * 查询app的权限 */ Result findListByCode(Integer tenantId); /** * 查看角色权限菜单 */ Result findListRoleChecked(Integer roleId,Integer tenantId); /** * 批量插入 * @param roleId,menuIds */ Result addAppPermissions(Integer roleId,String menuIds); /** * 根据用户查询app应用权限 */ Map<String, Set> getPermissionsByLoginName(User user); }
[ "gchen@dhlk-tech.com" ]
gchen@dhlk-tech.com
569ac0124691248eac488abe2de19a809c0f37a6
10fdc3aa333ef07a180f29a4425650945c3da9c8
/zhuanbo-service/src/main/java/com/zhuanbo/service/vo/UserIncomeVO.java
5517378c670dcc339635d06585d7d31f15f42eef
[]
no_license
arvin-xiao/lexuan
4d67f4ab40243c7e6167e514d899c6cd0c3f0995
6cffeee1002bad067e6c8481a3699186351d91a8
refs/heads/master
2023-04-27T21:01:06.644131
2020-05-03T03:03:52
2020-05-03T03:03:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,362
java
package com.zhuanbo.service.vo; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import java.math.BigDecimal; import java.util.List; @Data public class UserIncomeVO { //累计收益 private BigDecimal totalIncome; //在途中收益总数 private BigDecimal totalUavaIncome; //今日在途收益 private BigDecimal todayUavaIncome; //今日可提收益 private BigDecimal todayWithdrawIncome; //今日收益 private BigDecimal todayTotalIncome; //累计销售收益 private BigDecimal shareIncome; //累计销售 private BigDecimal totalConsume; //今日销售 private BigDecimal todayTotalConsume; //总订购数 private Integer totalBuy; //今日订购数 private Integer todayTotalBuy; //总客户数 private Integer totalTeam; //今日客户数 private Integer todayTotalTeam; /** * 可用提现余额 */ private BigDecimal acBal; /** * 不可用金额 */ private BigDecimal uavaBal; /** * 已提现 */ private BigDecimal withdrBal; private List<teamUser> teamList; @Data @NoArgsConstructor @AllArgsConstructor public class teamUser { private Integer id; private Integer inviteUpId; private Integer level; } }
[ "13509030019@163.com" ]
13509030019@163.com
c06bbe426207229c80093b8f804e7637875e3100
48e835e6f176a8ac9ae3ca718e8922891f1e5a18
/benchmark/training/com/netflix/genie/web/events/JobStartedEventUnitTests.java
fec5c34a7dc2d55fcf5d4ec36510225ceb184eea
[]
no_license
STAMP-project/dspot-experiments
f2c7a639d6616ae0adfc491b4cb4eefcb83d04e5
121487e65cdce6988081b67f21bbc6731354a47f
refs/heads/master
2023-02-07T14:40:12.919811
2019-11-06T07:17:09
2019-11-06T07:17:09
75,710,758
14
19
null
2023-01-26T23:57:41
2016-12-06T08:27:42
null
UTF-8
Java
false
false
1,724
java
/** * Copyright 2016 Netflix, Inc. * * 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.netflix.genie.web.events; import com.netflix.genie.common.dto.JobExecution; import com.netflix.genie.test.categories.UnitTest; import java.time.Instant; import java.util.UUID; import org.hamcrest.Matchers; import org.junit.Assert; import org.junit.Test; import org.junit.experimental.categories.Category; /** * Tests for the JobStartedEvent class. */ @Category(UnitTest.class) public class JobStartedEventUnitTests { /** * Make sure we can successfully create a Job Started Event. */ @Test public void canConstruct() { final JobExecution jobExecution = new JobExecution.Builder(UUID.randomUUID().toString()).withProcessId(3029).withCheckDelay(238124L).withTimeout(Instant.now()).withId(UUID.randomUUID().toString()).build(); final Object source = new Object(); final JobStartedEvent event = new JobStartedEvent(jobExecution, source); Assert.assertNotNull(event); Assert.assertThat(event.getJobExecution(), Matchers.is(jobExecution)); Assert.assertThat(event.getSource(), Matchers.is(source)); } }
[ "benjamin.danglot@inria.fr" ]
benjamin.danglot@inria.fr
79c79832fceec207d6cf358624ecdb154da65d9b
2c86006b8647dc706e8bd03c2fef4ffc58d692e1
/src/city_planning/puroks/Puroks.java
275babe9ed5b0df7d6acd255c5f37132a8cdd136
[]
no_license
yespickmeup/profiling
aa09122aabb364162b982083e67558d20c9bc674
0c03110f597c2739a80f65411ddb895e97a7462c
refs/heads/master
2021-01-17T07:52:03.172231
2017-11-13T10:44:59
2017-11-13T10:44:59
52,648,577
0
0
null
null
null
null
UTF-8
Java
false
false
6,963
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 city_planning.puroks; import city_planning.util.MyConnection; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.ArrayList; import java.util.List; import mijzcx.synapse.desk.utils.Lg; import mijzcx.synapse.desk.utils.SqlStringUtil; /** * * @author Guinness */ public class Puroks { public static class to_puroks { public final int id; public final int province_id; public final String province; public final int city_id; public final String city; public final String barangay_id; public final String barangay; public final String purok; public final String street; public to_puroks(int id, int province_id, String province, int city_id, String city, String barangay_id, String barangay, String purok, String street) { this.id = id; this.province_id = province_id; this.province = province; this.city_id = city_id; this.city = city; this.barangay_id = barangay_id; this.barangay = barangay; this.purok = purok; this.street = street; } } public static void add_data(to_puroks to_puroks) { try { Connection conn = MyConnection.connect(); String s0 = "insert into puroks(" + "province_id" + ",province" + ",city_id" + ",city" + ",barangay_id" + ",barangay" + ",purok" + ",street" + ")values(" + ":province_id" + ",:province" + ",:city_id" + ",:city" + ",:barangay_id" + ",:barangay" + ",:purok" + ",:street" + ")"; s0 = SqlStringUtil.parse(s0) .setNumber("province_id", to_puroks.province_id) .setString("province", to_puroks.province) .setNumber("city_id", to_puroks.city_id) .setString("city", to_puroks.city) .setString("barangay_id", to_puroks.barangay_id) .setString("barangay", to_puroks.barangay) .setString("purok", to_puroks.purok) .setString("street", to_puroks.street) .ok(); PreparedStatement stmt = conn.prepareStatement(s0); stmt.execute(); Lg.s(Puroks.class, "Successfully Added"); } catch (SQLException e) { throw new RuntimeException(e); } finally { MyConnection.close(); } } public static void update_data(to_puroks to_puroks) { try { Connection conn = MyConnection.connect(); String s0 = "update puroks set " + "province_id= :province_id " + ",province= :province " + ",city_id= :city_id " + ",city= :city " + ",barangay_id= :barangay_id " + ",barangay= :barangay " + ",purok= :purok " + ",street= :street " + " where id='" + to_puroks.id + "' " + " "; s0 = SqlStringUtil.parse(s0) .setNumber("province_id", to_puroks.province_id) .setString("province", to_puroks.province) .setNumber("city_id", to_puroks.city_id) .setString("city", to_puroks.city) .setString("barangay_id", to_puroks.barangay_id) .setString("barangay", to_puroks.barangay) .setString("purok", to_puroks.purok) .setString("street", to_puroks.street) .ok(); PreparedStatement stmt = conn.prepareStatement(s0); stmt.execute(); Lg.s(Puroks.class, "Successfully Updated"); } catch (SQLException e) { throw new RuntimeException(e); } finally { MyConnection.close(); } } public static void delete_data(to_puroks to_puroks) { try { Connection conn = MyConnection.connect(); String s0 = "delete from puroks " + " where id='" + to_puroks.id + "' " + " "; PreparedStatement stmt = conn.prepareStatement(s0); stmt.execute(); Lg.s(Puroks.class, "Successfully Deleted"); } catch (SQLException e) { throw new RuntimeException(e); } finally { MyConnection.close(); } } public static List<to_puroks> ret_data(String where) { List<to_puroks> datas = new ArrayList(); try { Connection conn = MyConnection.connect(); String s0 = "select " + "id" + ",purok" + ",barangay_id" + ",barangay" + ",city_id" + ",city" + ",province_id" + ",province" + ",region_id" + ",region" + ",street" + " from puroks" + " " + where; Statement stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery(s0); while (rs.next()) { int id = rs.getInt(1); String purok = rs.getString(2); int barangay_id = rs.getInt(3); String barangay = rs.getString(4); int city_id = rs.getInt(5); String city = rs.getString(6); int province_id = rs.getInt(7); String province = rs.getString(8); int region_id = rs.getInt(9); String region = rs.getString(10); String street = rs.getString(11); to_puroks to = new to_puroks(id, province_id, province, city_id, city, barangay, barangay, purok, street); datas.add(to); } return datas; } catch (SQLException e) { throw new RuntimeException(e); } finally { MyConnection.close(); } } }
[ "rpascua.synsoftech@gmail.com" ]
rpascua.synsoftech@gmail.com
821eca9f7ddaff44f6a5310049752d3c5aec0035
6fe5a5f16019230d9091a498027c3e6084003152
/src/main/java/com/oldratlee/fucking/concurrency/HashMapHangDemo.java
98f8f7503dc82f7558f9444bdf99ec848392a90c
[ "Apache-2.0" ]
permissive
arpit20adlakha/fucking-java-concurrency
cd36295a5fd1bf683b55ffd2ead4ff90dd848096
c78ca73a3e3acde1b7a9a3f11543e2581ee4cdf6
refs/heads/master
2023-05-01T13:40:02.188131
2021-05-27T08:27:45
2021-05-27T08:27:45
371,299,627
2
0
Apache-2.0
2021-05-27T08:23:08
2021-05-27T08:23:07
null
UTF-8
Java
false
false
1,674
java
package com.oldratlee.fucking.concurrency; import java.util.HashMap; import java.util.Map; import java.util.Random; /** * @author Jerry Lee (oldratlee at gmail dot com) * @see <a href="http://coolshell.cn/articles/9606.html">Java HashMap的死循环</a>@<a href="http://weibo.com/haoel">左耳朵耗子</a> */ public class HashMapHangDemo { final Map<Integer, Object> holder = new HashMap<Integer, Object>(); public static void main(String[] args) { HashMapHangDemo demo = new HashMapHangDemo(); for (int i = 0; i < 100; i++) { demo.holder.put(i, null); } Thread thread = new Thread(demo.getConcurrencyCheckTask()); thread.start(); thread = new Thread(demo.getConcurrencyCheckTask()); thread.start(); System.out.println("Start get in main!"); for (int i = 0; ; ++i) { for (int j = 0; j < 10000; ++j) { demo.holder.get(j); // 如果出现hashmap的get hang住问题,则下面的输出就不会再出现了。 // 在我的开发机上,很容易在第一轮就观察到这个问题。 System.out.printf("Got key %s in round %s\n", j, i); } } } ConcurrencyTask getConcurrencyCheckTask() { return new ConcurrencyTask(); } private class ConcurrencyTask implements Runnable { Random random = new Random(); @Override public void run() { System.out.println("Add loop started in task!"); while (true) { holder.put(random.nextInt() % (1024 * 1024 * 100), null); } } } }
[ "oldratlee@gmail.com" ]
oldratlee@gmail.com
d3ba18f693b7dc1da336ae70aff463a81521a7c9
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/TIME-7b-5-21-FEMO-WeightedSum:TestLen:CallDiversity/org/joda/time/format/DateTimeParserBucket_ESTest_scaffolding.java
3a3e389975c4d0fea8212d2a823a2f967f0ecb93
[]
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
6,548
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Mon Jan 20 21:29:58 UTC 2020 */ package org.joda.time.format; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; @EvoSuiteClassExclude public class DateTimeParserBucket_ESTest_scaffolding { @org.junit.Rule public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule(); private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000); @BeforeClass public static void initEvoSuiteFramework() { org.evosuite.runtime.RuntimeSettings.className = "org.joda.time.format.DateTimeParserBucket"; org.evosuite.runtime.GuiSupport.initialize(); org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000; org.evosuite.runtime.RuntimeSettings.mockSystemIn = true; org.evosuite.runtime.Runtime.getInstance().resetRuntime(); } @Before public void initTestCase(){ threadStopper.storeCurrentThreads(); threadStopper.startRecordingTime(); org.evosuite.runtime.GuiSupport.setHeadless(); org.evosuite.runtime.Runtime.getInstance().resetRuntime(); org.evosuite.runtime.agent.InstrumentingAgent.activate(); } @After public void doneWithTestCase(){ threadStopper.killAndJoinClientThreads(); org.evosuite.runtime.agent.InstrumentingAgent.deactivate(); org.evosuite.runtime.GuiSupport.restoreHeadlessMode(); } private static void initializeClasses() { org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(DateTimeParserBucket_ESTest_scaffolding.class.getClassLoader() , "org.joda.time.DateTimeZone", "org.joda.time.tz.DateTimeZoneBuilder$Recurrence", "org.joda.time.chrono.GJChronology$CutoverField", "org.joda.time.DateTimeUtils$MillisProvider", "org.joda.time.chrono.GJYearOfEraDateTimeField", "org.joda.time.field.OffsetDateTimeField", "org.joda.time.chrono.GJMonthOfYearDateTimeField", "org.joda.time.field.RemainderDateTimeField", "org.joda.time.JodaTimePermission", "org.joda.time.chrono.BasicWeekyearDateTimeField", "org.joda.time.chrono.BasicWeekOfWeekyearDateTimeField", "org.joda.time.DateTimeFieldType", "org.joda.time.DateTimeField", "org.joda.time.field.FieldUtils", "org.joda.time.DateTimeFieldType$StandardDateTimeFieldType", "org.joda.time.chrono.BasicSingleEraDateTimeField", "org.joda.time.field.SkipDateTimeField", "org.joda.time.chrono.LimitChronology", "org.joda.time.ReadableInstant", "org.joda.time.ReadableInterval", "org.joda.time.chrono.BasicChronology$HalfdayField", "org.joda.time.chrono.LimitChronology$LimitDateTimeField", "org.joda.time.DateTimeUtils$SystemMillisProvider", "org.joda.time.chrono.GJDayOfWeekDateTimeField", "org.joda.time.IllegalFieldValueException", "org.joda.time.IllegalInstantException", "org.joda.time.tz.DateTimeZoneBuilder$PrecalculatedZone", "org.joda.time.chrono.BasicChronology$YearInfo", "org.joda.time.field.UnsupportedDurationField", "org.joda.time.tz.DefaultNameProvider", "org.joda.time.tz.Provider", "org.joda.time.field.ImpreciseDateTimeField$LinkedDurationField", "org.joda.time.ReadablePeriod", "org.joda.time.field.SkipUndoDateTimeField", "org.joda.time.base.AbstractDateTime", "org.joda.time.chrono.ZonedChronology$ZonedDateTimeField", "org.joda.time.chrono.AssembledChronology$Fields", "org.joda.time.chrono.GregorianChronology", "org.joda.time.DurationFieldType", "org.joda.time.field.DelegatedDateTimeField", "org.joda.time.chrono.ISOChronology", "org.joda.time.tz.NameProvider", "org.joda.time.chrono.BasicChronology", "org.joda.time.chrono.BasicYearDateTimeField", "org.joda.time.field.DividedDateTimeField", "org.joda.time.chrono.GJChronology$LinkedDurationField", "org.joda.time.chrono.ZonedChronology", "org.joda.time.field.BaseDateTimeField", "org.joda.time.chrono.BasicMonthOfYearDateTimeField", "org.joda.time.field.ZeroIsMaxDateTimeField", "org.joda.time.DateTimeUtils", "org.joda.time.base.BaseDateTime", "org.joda.time.tz.CachedDateTimeZone$Info", "org.joda.time.field.MillisDurationField", "org.joda.time.field.DecoratedDurationField", "org.joda.time.tz.DateTimeZoneBuilder$DSTZone", "org.joda.time.chrono.AssembledChronology", "org.joda.time.chrono.GJChronology", "org.joda.time.base.AbstractInstant", "org.joda.time.tz.ZoneInfoProvider", "org.joda.time.chrono.GJEraDateTimeField", "org.joda.time.DateTimeZone$1", "org.joda.time.tz.DateTimeZoneBuilder", "org.joda.time.chrono.BaseChronology", "org.joda.time.format.DateTimeParserBucket", "org.joda.time.chrono.JulianChronology", "org.joda.time.field.UnsupportedDateTimeField", "org.joda.time.field.ImpreciseDateTimeField", "org.joda.time.field.PreciseDurationField", "org.joda.time.tz.DateTimeZoneBuilder$OfYear", "org.joda.time.chrono.BasicGJChronology", "org.joda.time.field.ScaledDurationField", "org.joda.time.DurationField", "org.joda.time.Chronology", "org.joda.time.DateTime", "org.joda.time.field.PreciseDurationDateTimeField", "org.joda.time.tz.FixedDateTimeZone", "org.joda.time.tz.CachedDateTimeZone", "org.joda.time.field.PreciseDateTimeField", "org.joda.time.format.DateTimeParserBucket$SavedField", "org.joda.time.chrono.LimitChronology$LimitException", "org.joda.time.ReadableDateTime", "org.joda.time.chrono.BasicDayOfMonthDateTimeField", "org.joda.time.chrono.ZonedChronology$ZonedDurationField", "org.joda.time.Instant", "org.joda.time.ReadablePartial", "org.joda.time.chrono.LimitChronology$LimitDurationField", "org.joda.time.DurationFieldType$StandardDurationFieldType", "org.joda.time.chrono.GJChronology$ImpreciseCutoverField", "org.joda.time.chrono.BasicDayOfYearDateTimeField", "org.joda.time.field.DecoratedDateTimeField", "org.joda.time.field.BaseDurationField", "org.joda.time.chrono.BuddhistChronology" ); } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
98dbe53d871cd0f509ef0d193b4259f05f31f43f
8727b1cbb8ca63d30340e8482277307267635d81
/PolarServer/src/com/game/player/message/ResRoundChangeJobMessage.java
c168b1b9219815a9914044640e643bfbb6e6acca
[]
no_license
taohyson/Polar
50026903ded017586eac21a7905b0f1c6b160032
b0617f973fd3866bed62da14f63309eee56f6007
refs/heads/master
2021-05-08T12:22:18.884688
2015-12-11T01:44:18
2015-12-11T01:44:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,021
java
package com.game.player.message; import org.apache.mina.core.buffer.IoBuffer; import com.game.message.Message; import com.game.message.pool.ServerProtocol; /** * @author luminghua.ko@gmail.com * * @date 2014年3月20日 下午4:22:46 */ public class ResRoundChangeJobMessage extends Message { @Override public int getId() { return ServerProtocol.ResRoundChangeJobMessage; } @Override public String getQueue() { return null; } @Override public String getServer() { return null; } private long playerId; private byte job; @Override public boolean read(IoBuffer buf) { this.playerId = readLong(buf); this.job = readByte(buf); return true; } @Override public boolean write(IoBuffer buf) { writeLong(buf,playerId); writeByte(buf,job); return true; } public long getPlayerId() { return playerId; } public void setPlayerId(long playerId) { this.playerId = playerId; } public byte getJob() { return job; } public void setJob(byte job) { this.job = job; } }
[ "zhuyuanbiao@ZHUYUANBIAO.rd.com" ]
zhuyuanbiao@ZHUYUANBIAO.rd.com
d2c310a96e6e88ab8832d09fae01a11765c41712
2032f60bdaa8d825244d95e3d9c3f0957ea791bf
/filterlibrary/src/main/java/com/cgfay/cainfilter/core/ColorFilterManager.java
0195fefd4c64aebb6d87bbff35e5ac55313f7c43
[]
no_license
Ubhadiyap/CainCamera
c15ba9449a9011d3704ec5041d9be89efeb8c806
672bcf6084bde905c0626840609c2f929a55ab5b
refs/heads/master
2021-03-30T21:44:26.709031
2018-03-07T02:54:27
2018-03-07T02:54:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,077
java
package com.cgfay.cainfilter.core; import com.cgfay.cainfilter.type.GlFilterType; import java.util.ArrayList; import java.util.List; /** * 色彩滤镜管理器 * Created by cain on 2017/11/15. */ public final class ColorFilterManager { private static ColorFilterManager mInstance; private ArrayList<GlFilterType> mGlFilterType; private ArrayList<String> mFilterName; public static ColorFilterManager getInstance() { if (mInstance == null) { mInstance = new ColorFilterManager(); } return mInstance; } private ColorFilterManager() { initColorFilters(); } /** * 初始化颜色滤镜 */ public void initColorFilters() { mGlFilterType = new ArrayList<GlFilterType>(); mGlFilterType.add(GlFilterType.SOURCE); // 原图 mGlFilterType.add(GlFilterType.AMARO); mGlFilterType.add(GlFilterType.ANTIQUE); mGlFilterType.add(GlFilterType.BLACKCAT); mGlFilterType.add(GlFilterType.BLACKWHITE); mGlFilterType.add(GlFilterType.BROOKLYN); mGlFilterType.add(GlFilterType.CALM); mGlFilterType.add(GlFilterType.COOL); mGlFilterType.add(GlFilterType.EARLYBIRD); mGlFilterType.add(GlFilterType.EMERALD); mGlFilterType.add(GlFilterType.EVERGREEN); mGlFilterType.add(GlFilterType.FAIRYTALE); mGlFilterType.add(GlFilterType.FREUD); mGlFilterType.add(GlFilterType.HEALTHY); mGlFilterType.add(GlFilterType.HEFE); mGlFilterType.add(GlFilterType.HUDSON); mGlFilterType.add(GlFilterType.KEVIN); mGlFilterType.add(GlFilterType.LATTE); mGlFilterType.add(GlFilterType.LOMO); mGlFilterType.add(GlFilterType.NOSTALGIA); mGlFilterType.add(GlFilterType.ROMANCE); mGlFilterType.add(GlFilterType.SAKURA); mGlFilterType.add(GlFilterType.SKETCH); mGlFilterType.add(GlFilterType.SUNSET); mGlFilterType.add(GlFilterType.WHITECAT); mFilterName = new ArrayList<String>(); mFilterName.add("原图"); mFilterName.add("阿马罗"); mFilterName.add("古董"); mFilterName.add("黑猫"); mFilterName.add("黑白"); mFilterName.add("布鲁克林"); mFilterName.add("冷静"); mFilterName.add("冷色调"); mFilterName.add("晨鸟"); mFilterName.add("翡翠"); mFilterName.add("常绿"); mFilterName.add("童话"); mFilterName.add("佛洛伊特"); mFilterName.add("健康"); mFilterName.add("酵母"); mFilterName.add("哈德森"); mFilterName.add("凯文"); mFilterName.add("拿铁"); mFilterName.add("LOMO"); mFilterName.add("怀旧之情"); mFilterName.add("浪漫"); mFilterName.add("樱花"); mFilterName.add("素描"); mFilterName.add("日落"); mFilterName.add("白猫"); } /** * 获取颜色滤镜类型 * @param index * @return */ public GlFilterType getColorFilterType(int index) { if (mGlFilterType == null || mGlFilterType.isEmpty()) { return GlFilterType.SOURCE; } int i = index % mGlFilterType.size(); return mGlFilterType.get(i); } /** * 获取颜色滤镜的名称 * @param index * @return */ public String getColorFilterName(int index) { if (mFilterName == null || mFilterName.isEmpty()) { return "原图"; } int i = index % mFilterName.size(); return mFilterName.get(i); } /** * 获取颜色滤镜数目 * @return */ public int getColorFilterCount() { return mGlFilterType == null ? 0 : mGlFilterType.size(); } /** * 获取滤镜类型 * @return */ public List<GlFilterType> getFilterType() { return mGlFilterType; } /** * 获取滤镜名称 * @return */ public List<String> getFilterName() { return mFilterName; } }
[ "cain.huang@outlook.com" ]
cain.huang@outlook.com
15b40404a7f9082538a891bddc7499f20e301b52
69040d2ad1b09341df198deb4822fde814eccd52
/src/main/java/RingOfDestiny/cards/Summoner/MaliciousLeakage.java
13fd01fd2e8f94b3b367c3ee1fbf44825cb83466
[]
no_license
Rita-Bernstein/RingOfDestiny
69feecf461541ed2c585c181c6dde6a16d39af52
788da2b2d11c2393288506b3e04e6d5da1a16949
refs/heads/master
2023-07-16T20:56:30.160192
2021-08-31T17:16:55
2021-08-31T17:16:55
343,334,965
3
3
null
2021-05-24T08:28:52
2021-03-01T08:01:25
Java
UTF-8
Java
false
false
1,762
java
package RingOfDestiny.cards.Summoner; import RingOfDestiny.RingOfDestiny; import RingOfDestiny.cards.AbstractSummonerCard; import com.megacrit.cardcrawl.actions.AbstractGameAction; import com.megacrit.cardcrawl.actions.common.DamageAction; import com.megacrit.cardcrawl.actions.common.LoseHPAction; import com.megacrit.cardcrawl.cards.AbstractCard; import com.megacrit.cardcrawl.cards.DamageInfo; import com.megacrit.cardcrawl.characters.AbstractPlayer; import com.megacrit.cardcrawl.monsters.AbstractMonster; public class MaliciousLeakage extends AbstractSummonerCard { public static final String ID = RingOfDestiny.makeID("MaliciousLeakage"); public static final String IMG = RingOfDestiny.assetPath("img/cards/Summoner/32.png"); private static final int COST = 0; private static final CardType TYPE = CardType.ATTACK; private static final CardRarity RARITY = CardRarity.UNCOMMON; private static final CardTarget TARGET = CardTarget.ENEMY; public MaliciousLeakage() { super(ID, IMG, COST, TYPE, RARITY, TARGET); this.baseDamage = 3; this.magicNumber = this.baseMagicNumber = 2; } public void use(AbstractPlayer p, AbstractMonster m) { for (int i = 0; i < this.magicNumber; i++) { addToBot(new LoseHPAction(p, p, 1)); } for (int i = 0; i < this.magicNumber; i++) { addToBot(new DamageAction(m, new DamageInfo(p, this.damage, this.damageTypeForTurn), AbstractGameAction.AttackEffect.SLASH_DIAGONAL)); } } public AbstractCard makeCopy() { return new MaliciousLeakage(); } public void upgrade() { if (!this.upgraded) { this.upgradeName(); this.upgradeMagicNumber(1); } } }
[ "13536709069@163.com" ]
13536709069@163.com
ff8447fbc9abf7aa4e757e5ba5014be5b0f47ff3
cca87c4ade972a682c9bf0663ffdf21232c9b857
/b/a/d/e.java
daa8bf007aed269587042c5e55346153b276e829
[]
no_license
ZoranLi/wechat_reversing
b246d43f7c2d7beb00a339e2f825fcb127e0d1a1
36b10ef49d2c75d69e3c8fdd5b1ea3baa2bba49a
refs/heads/master
2021-07-05T01:17:20.533427
2017-09-25T09:07:33
2017-09-25T09:07:33
104,726,592
12
1
null
null
null
null
UTF-8
Java
false
false
1,299
java
package b.a.d; import b.a.g.c; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Map.Entry; public final class e { public final List<d> xpu; public e() { this.xpu = new ArrayList(); } public e(List<d> list) { this.xpu = new ArrayList(list); } public e(Map<String, String> map) { this(); for (Entry entry : map.entrySet()) { this.xpu.add(new d((String) entry.getKey(), (String) entry.getValue())); } } public final String ciJ() { if (this.xpu.size() == 0) { return ""; } StringBuilder stringBuilder = new StringBuilder(); for (d dVar : this.xpu) { stringBuilder.append('&').append(c.encode(dVar.arH).concat("=").concat(c.encode(dVar.value))); } return stringBuilder.toString().substring(1); } public final void a(e eVar) { this.xpu.addAll(eVar.xpu); } public final void Wv(String str) { if (str != null && str.length() > 0) { for (String split : str.split("&")) { String[] split2 = split.split("="); this.xpu.add(new d(c.decode(split2[0]), split2.length > 1 ? c.decode(split2[1]) : "")); } } } }
[ "lizhangliao@xiaohongchun.com" ]
lizhangliao@xiaohongchun.com
3c879d4b5f30f5aa212154b64c397bef972192e0
8ed92f2dd6d2cb7ca69ec869c9944b83e724e673
/argouml-app/src/org/argouml/ui/explorer/PerspectiveManagerListener.java
fbe2d60764d3fb03e1f244a5f08780f6dfef3d46
[ "LicenseRef-scancode-other-permissive", "BSD-3-Clause" ]
permissive
danilofes/argouml-refactorings
e74c68c3a556fad9915f7a7e51cf7bd98634b02b
893bcb1c3e8dcb60ca97ad3ee2adf48103307ce4
refs/heads/master
2021-01-10T12:44:46.359352
2015-11-03T15:59:42
2015-11-03T15:59:42
45,476,515
1
1
null
null
null
null
UTF-8
Java
false
false
2,682
java
/* $Id: PerspectiveManagerListener.java 17843 2010-01-12 19:23:29Z linus $ ***************************************************************************** * Copyright (c) 2009 Contributors - see below * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * linus ***************************************************************************** * * Some portions of this file was previously release using the BSD License: */ // Copyright (c) 1996-2006 The Regents of the University of California. All // Rights Reserved. Permission to use, copy, modify, and distribute this // software and its documentation without fee, and without a written // agreement is hereby granted, provided that the above copyright notice // and this paragraph appear in all copies. This software program and // documentation are copyrighted by The Regents of the University of // California. The software program and documentation are supplied "AS // IS", without any accompanying services from The Regents. The Regents // does not warrant that the operation of the program will be // uninterrupted or error-free. The end-user understands that the program // was developed for research purposes and is advised not to rely // exclusively on the program for any reason. IN NO EVENT SHALL THE // UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, // SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, // ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF // THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF // SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE // PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF // CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, // UPDATES, ENHANCEMENTS, OR MODIFICATIONS. package org.argouml.ui.explorer; /** * An interface to decouple the perspective manager * from interested ui components. * * @author alexb * @since 0.15.2 */ public interface PerspectiveManagerListener { /** * @param perspective the perspective to be added */ void addPerspective(Object perspective); /** * @param perspective the perspective to be removed */ void removePerspective(Object perspective); }
[ "danilofes@gmail.com" ]
danilofes@gmail.com
4bfe64873b4b11234c92b358209725c3c40b8f1c
a186b2d471c7dbf9ebe06d650c27a0eb576b210d
/core/src/test/java/net/adamcin/oakpal/core/SimpleViolationTest.java
3594c0c2b6ad511858c92b66d624bc4ec1b58847
[ "Apache-2.0" ]
permissive
reschke/oakpal
99729c0b948bf9a5a05911f6421649da8378fb7b
bf25b12567f09d06134f823b70442cc00d29c8a4
refs/heads/master
2021-01-03T08:00:10.299575
2020-02-12T11:06:59
2020-02-12T11:06:59
239,991,269
1
0
Apache-2.0
2020-02-12T11:00:00
2020-02-12T10:59:58
null
UTF-8
Java
false
false
982
java
/* * Copyright 2019 Mark Adamcin * * 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 net.adamcin.oakpal.core; import static org.junit.Assert.assertNotNull; import org.apache.jackrabbit.vault.packaging.PackageId; import org.junit.Test; public class SimpleViolationTest { @Test public void testConstruct() { SimpleViolation nulls = new SimpleViolation(null, null, (PackageId[]) null); assertNotNull("toString not null", nulls); } }
[ "adamcin@gmail.com" ]
adamcin@gmail.com
331134e619be54125455ea61f86190908e456dad
05cb5ac927da698e0f5d25bbaebdbcabcd4190c2
/13-14/21_01_26_set/src/de/telran/OurTreeSet.java
19417cceed4241e360bee98714698c3a2f8b11f3
[]
no_license
sharf85/tasks
8a1bc617848bc35abb59cd7d8ed5dff4a5d11d4e
403349e79022402ea2e72f28bf3820be80e706f5
refs/heads/master
2023-03-15T19:11:20.045262
2022-06-15T10:50:07
2022-06-15T10:50:07
205,693,802
17
47
null
2023-03-04T19:05:29
2019-09-01T15:12:47
JavaScript
UTF-8
Java
false
false
967
java
package de.telran; import de.telran.map.OurTreeMap; import java.util.Iterator; public class OurTreeSet<T> implements OurSet<T> { OurTreeMap<T, Object> source = new OurTreeMap<>(); private final Object stubValue = new Object(); @Override public boolean add(T elt) { return source.put(elt, stubValue) == null; } @Override public boolean remove(T elt) { return source.remove(elt) != null; } @Override public boolean contains(T elt) { return source.containsKey(elt); } @Override public int size() { return source.size(); } @Override public void retainAll(OurSet<T> another) { OurSet<T> temp = new OurTreeSet<>(); for (T elt : this) { if (!another.contains(elt)) temp.add(elt); } this.removeAll(temp); } @Override public Iterator<T> iterator() { return source.keyIterator(); } }
[ "evgeny.sharfarets@gmail.com" ]
evgeny.sharfarets@gmail.com
7f6ed9d790dc3c4d1ca8f4b8571ef91f34b6314f
cb07d320858b34995b41a6eaa9d1611e02e9b929
/extensions/vertx-http/runtime/src/main/java/io/quarkus/devui/runtime/jsonrpc/JsonRpcKeys.java
d027420f5549291599042a92858392228d952cdf
[ "Apache-2.0" ]
permissive
dufoli/quarkus
d591009e8c99905be12dcd3a56948b1455115285
d5e1e0e3f7baac90f3bdb732092ed9efbd75ff71
refs/heads/main
2023-08-08T12:38:41.227352
2023-04-23T08:53:26
2023-04-23T08:53:26
214,174,478
2
6
Apache-2.0
2023-07-18T19:26:22
2019-10-10T12:16:10
Java
UTF-8
Java
false
false
1,356
java
package io.quarkus.devui.runtime.jsonrpc; public interface JsonRpcKeys { public static final String VERSION = "2.0"; public static final String JSONRPC = "jsonrpc"; public static final String OBJECT = "object"; public static final String MESSAGE_TYPE = "messageType"; public static final String ID = "id"; public static final String RESULT = "result"; public static final String MESSAGE = "message"; public static final String CODE = "code"; public static final String ERROR = "error"; public static final String METHOD = "method"; public static final String PARAMS = "params"; public static final int PARSE_ERROR = -32700; // Parse error. Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text. public static final int INVALID_REQUEST = -32600; // Invalid Request. The JSON sent is not a valid Request object. public static final int METHOD_NOT_FOUND = -32601; // Method not found. The method does not exist / is not available. public static final int INVALID_PARAMS = -32602; // Invalid params. Invalid method parameter(s). public static final int INTERNAL_ERROR = -32603; // Internal error. Internal JSON-RPC error. public static enum MessageType { Void, Response, SubscriptionMessage, HotReload } }
[ "phillip.kruger@gmail.com" ]
phillip.kruger@gmail.com
0187040afe2c970336e3b8a7b022488b3a8a20c1
c2fb6846d5b932928854cfd194d95c79c723f04c
/java_backup/projects/makeGray/GrayScaleConverter.java
87c6d05d1e10bd69d9596cc646ef2581c69febfb
[ "MIT" ]
permissive
Jimut123/code-backup
ef90ccec9fb6483bb6dae0aa6a1f1cc2b8802d59
8d4c16b9e960d352a7775786ea60290b29b30143
refs/heads/master
2022-12-07T04:10:59.604922
2021-04-28T10:22:19
2021-04-28T10:22:19
156,666,404
9
5
MIT
2022-12-02T20:27:22
2018-11-08T07:22:48
Jupyter Notebook
UTF-8
Java
false
false
1,186
java
/** * Create a gray scale version of an image by setting all color components of each pixel to the same value. * * @author Duke Software Team */ import edu.duke.*; import java.io.*; public class GrayScaleConverter { //I started with the image I wanted (inImage) public ImageResource makeGray(ImageResource inImage) { //I made a blank image of the same size ImageResource outImage = new ImageResource(inImage.getWidth(), inImage.getHeight()); //for each pixel in outImage for (Pixel pixel: outImage.pixels()) { //look at the corresponding pixel in inImage Pixel inPixel = inImage.getPixel(pixel.getX(), pixel.getY()); //compute inPixel's red + inPixel's blue + inPixel's green //divide that sum by 3 (call it average) int average = (inPixel.getRed() + inPixel.getBlue() + inPixel.getGreen())/3; //set pixel's red to average pixel.setRed(average); //set pixel's green to average pixel.setGreen(average); //set pixel's blue to average pixel.setBlue(average); } //outImage is your answer return outImage; } public void testGray() { ImageResource ir = new ImageResource(); ImageResource gray = makeGray(ir); gray.draw(); } }
[ "jimutbahanpal@yahoo.com" ]
jimutbahanpal@yahoo.com
c16c6af7eebd8f14a5dfdbd4ffa01a286bb917cd
b3b4f3e0333d057f2e07344f7a6fcf3063c76b01
/src/test/java/ampcontrol/model/training/listen/NanScoreWatcherTest.java
8bdcdd9e1930cb180e7f5c0fb452e04e19af7b83
[ "MIT" ]
permissive
DrChainsaw/AmpControl
21d20fa2124a16ea67dae2153073c316033bc947
c6d3f20f431b4fa767c86c0d665bba710ee078e9
refs/heads/master
2021-07-13T13:11:52.878132
2020-10-16T18:49:20
2020-10-16T18:49:20
124,961,217
6
2
MIT
2021-06-07T17:55:23
2018-03-12T22:51:10
Java
UTF-8
Java
false
false
2,943
java
package ampcontrol.model.training.listen; import org.deeplearning4j.nn.api.Model; import org.junit.Test; import static org.junit.Assert.assertEquals; /** * Test cases for {@link NanScoreWatcher} * * @author Christian Skärby */ public class NanScoreWatcherTest { /** * Test iterationDone with a model having finite score */ @Test public void iterationDoneFinite() { final Model finiteScoreModel = new ScoreModel(666); final ProbeCallback callback = new ProbeCallback(); final NanScoreWatcher watcher = new NanScoreWatcher(callback); watcher.iterationDone(finiteScoreModel, 1,1); callback.assertWasCalled(false); } /** * Test iterationDone with a model having positive infinite score */ @Test public void iterationDonePosInfinite() { final Model posInifinteScoreModel = new ScoreModel(Double.POSITIVE_INFINITY); final ProbeCallback callback = new ProbeCallback(); final NanScoreWatcher watcher = new NanScoreWatcher(callback); watcher.iterationDone(posInifinteScoreModel, 1,1); callback.assertWasCalled(true); } /** * Test iterationDone with a model having negative infinite score */ @Test public void iterationDoneNegInfinite() { final Model negInifinteScoreModel = new ScoreModel(Double.NEGATIVE_INFINITY); final ProbeCallback callback = new ProbeCallback(); final NanScoreWatcher watcher = new NanScoreWatcher(callback); watcher.iterationDone(negInifinteScoreModel, 1,1); callback.assertWasCalled(true); } /** * Test iterationDone with a model having score NaN */ @Test public void iterationDoneNan() { final Model nanScoreModel = new ScoreModel(Double.NaN); final ProbeCallback callback = new ProbeCallback(); final NanScoreWatcher watcher = new NanScoreWatcher(callback); watcher.iterationDone(nanScoreModel, 1,1); callback.assertWasCalled(true); } /** * Test iterationDone with a model having score NaN being called only once */ @Test public void iterationDoneNanOnce() { final Model nanScoreModel = new ScoreModel(Double.NaN); final ProbeCallback callback = new ProbeCallback(); final NanScoreWatcher watcher = NanScoreWatcher.once(callback); watcher.iterationDone(nanScoreModel, 1,1); callback.assertWasCalled(true); callback.wasCalled = false; watcher.iterationDone(nanScoreModel, 2, 1); callback.assertWasCalled(false); } private final static class ProbeCallback implements Runnable { private boolean wasCalled = false; @Override public void run() { wasCalled = true; } private void assertWasCalled(boolean expected) { assertEquals("Incorrect state!", expected, wasCalled); } } }
[ "Christian.kyril.skarby@gmail.com" ]
Christian.kyril.skarby@gmail.com
d35096ea3dc30c787d4a5924833aef35991e5aee
2b8c3438ca220a1ba7b71631ac91a46ce08a9784
/app/src/main/java/com/xlkj/beautifulpicturehouse/module/video/view/adapter/VideoSearchMoreAdapter.java
59f926cc5cdb9b6d1f49f4d16070b3d901346a16
[]
no_license
MengkZhang/NIceImage
ca094989f8e23a1325fc9c1a2851dfb4ef203c31
ddc39d34849b779ea033dc27da7faae5ddfed5cc
refs/heads/master
2020-05-07T10:02:36.717222
2019-04-09T15:56:23
2019-04-09T15:56:23
180,401,592
0
0
null
null
null
null
UTF-8
Java
false
false
7,623
java
package com.xlkj.beautifulpicturehouse.module.video.view.adapter; import android.content.Context; import android.content.Intent; import android.support.v7.widget.GridLayoutManager; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.ProgressBar; import android.widget.TextView; import com.bumptech.glide.Glide; import com.xlkj.beautifulpicturehouse.R; import com.xlkj.beautifulpicturehouse.module.video.bean.VideoListResBean; import com.xlkj.beautifulpicturehouse.module.video.bean.VideoSearchResBean; import com.xlkj.beautifulpicturehouse.module.video.view.ui.activity.VideoDetailActivity; import java.util.List; /** * Created by Administrator on 2017/12/23. * 搜索视频更多adapter */ public class VideoSearchMoreAdapter extends RecyclerView.Adapter { public static final String TAG = "-->>VideoHotAdapter"; public static final int TYPE_ITEM = 1; public static final int TYPE_FOOT = 2; private Context mContext; private List<VideoSearchResBean.DataBean.VideoBean> mList; public VideoSearchMoreAdapter(Context mContext, List<VideoSearchResBean.DataBean.VideoBean> mList) { this.mContext = mContext; this.mList = mList; } /** * 当条目是头部的时候-header占据三个单元格 * 我的footer竟然作为一个cell出现在了界面上,这完全不是我想要的效果啊! 冷静下来想想,肯定会有解决方法的吧。这时候我就该引入一个不太常用的方法了 * * @param recyclerView */ @Override public void onAttachedToRecyclerView(RecyclerView recyclerView) { super.onAttachedToRecyclerView(recyclerView); RecyclerView.LayoutManager manager = recyclerView.getLayoutManager(); if (manager instanceof GridLayoutManager) { final GridLayoutManager gridManager = ((GridLayoutManager) manager); gridManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() { @Override public int getSpanSize(int position) { return getItemViewType(position) == TYPE_FOOT ? gridManager.getSpanCount() : 1; } }); } } @Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { if (viewType == TYPE_ITEM) { //条目 LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View view = inflater.inflate(R.layout.item_video_hot_layout, parent, false); return new VideoHotViewHolder(view); } else { //底部 LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View view = inflater.inflate(R.layout.item_recyclerview_footer, parent, false); return new FootViewHolder(view); } } @Override public void onBindViewHolder(RecyclerView.ViewHolder holder, final int position) { if (getItemViewType(position) == TYPE_ITEM) { //条目 VideoHotViewHolder viewHolder = (VideoHotViewHolder) holder; try { Glide.with(mContext).load(mList.get(position).getImageUrl()).placeholder(R.drawable.da_yanse_cuilvideo).crossFade().into(viewHolder.mImageView); if (mList.get(position).getTypeName() != null || mList.get(position).getTypeName().equals("") || mList.get(position).getTypeName().equals(" ")) { viewHolder.tvTitle.setText(mList.get(position).getTypeName()); } else { viewHolder.tvTitle.setText("宅男们都震精啦~"); } } catch (Exception e) { e.printStackTrace(); Log.e(TAG, "onBindViewHolder加载数据异常"); } //条目点击事件 viewHolder.itemView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { jump2detail(position); } }); } else { //底部 mProgressBar.setVisibility(View.INVISIBLE); mTextView.setVisibility(View.VISIBLE); //mTextView.setText("加载中......"); mTextView.setText(""); } } /** * 到详情页 * * @param position */ private void jump2detail(int position) { try { //跳转到详情页播放 final String imageUrl = mList.get(position).getImageUrl(); final int isVip = mList.get(position).getIsVip(); final String videoId = mList.get(position).getVideoId(); final String videoUrl = mList.get(position).getVideoUrl(); final String followId = mList.get(position).getFollowId(); Intent intent = new Intent(mContext, VideoDetailActivity.class); VideoListResBean.DataBean.TypeListBean typeListBean = new VideoListResBean.DataBean.TypeListBean(); typeListBean.setVideoUrl(videoUrl); typeListBean.setVideoId(videoId); typeListBean.setTypeName("搜索视频"); typeListBean.setIsVip(isVip); typeListBean.setFollowId(followId); typeListBean.setImageUrl(imageUrl); intent.putExtra("dataBean", typeListBean); mContext.startActivity(intent); } catch (Exception e) { e.printStackTrace(); Log.e(TAG, "jump2detail跳转异常"); return; } } @Override public int getItemCount() { return mList.size() + 1; } @Override public int getItemViewType(int position) { if (getItemCount() == position + 1) { return TYPE_FOOT; } else { return TYPE_ITEM; } } class VideoHotViewHolder extends RecyclerView.ViewHolder { ImageView mImageView; TextView tvTitle; public VideoHotViewHolder(View itemView) { super(itemView); mImageView = (ImageView) itemView.findViewById(R.id.iv_pic_ivhl); tvTitle = (TextView) itemView.findViewById(R.id.tv_title_ivhl); } } public void setFootView(int loadingState) { if (loadingState == 0) { mProgressBar.setVisibility(View.VISIBLE); mTextView.setVisibility(View.VISIBLE); mTextView.setText("加载中......"); } else if (loadingState == 2) { mProgressBar.setVisibility(View.GONE); mTextView.setVisibility(View.VISIBLE); mTextView.setText("加载出错~"); } else if (loadingState == 3) { mProgressBar.setVisibility(View.INVISIBLE); mProgressBar.setVisibility(View.INVISIBLE); } else if (loadingState == 4) { mProgressBar.setVisibility(View.GONE); mTextView.setVisibility(View.VISIBLE); mTextView.setText("---我是有底线的---"); } } TextView mTextView;//底部内容 ProgressBar mProgressBar;//底部进度条 private class FootViewHolder extends RecyclerView.ViewHolder { public FootViewHolder(View itemView) { super(itemView); mTextView = (TextView) itemView.findViewById(R.id.we_media_loading); mProgressBar = (ProgressBar) itemView.findViewById(R.id.we_media_progress); } } }
[ "653651979@qq.com" ]
653651979@qq.com
23b934bca4ec0162830440346a2a2c6f650568a9
07f6a3a7141523ba3fa969d0768f3aac146a577c
/qa_library/src/com/zxing/android/camera/CameraConfigurationManager.java
ea3513449a8310cf81fae1e091dc95ecdebbc428
[]
no_license
ShahbazExpress/VKO_AND
c2753c7614e846aeec53aeb85b9ca05358291eec
38a7f78ca29525a6b11c9c1f8cc0d771511b13c0
refs/heads/master
2021-12-16T12:13:53.676663
2017-09-19T06:09:52
2017-09-19T06:09:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,743
java
/* * Copyright (C) 2010 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.android.camera; import android.content.Context; import android.content.SharedPreferences; import android.graphics.Point; import android.hardware.Camera; import android.hardware.Camera.Size; import android.preference.PreferenceManager; import android.util.Log; import android.view.Display; import android.view.WindowManager; //import com.google.zxing.client.android.PreferencesActivity; import java.util.Collection; /** * A class which deals with reading, parsing, and setting the camera parameters * which are used to configure the camera hardware. */ final class CameraConfigurationManager { private static final String TAG = "CameraConfiguration"; private static final int MIN_PREVIEW_PIXELS = 320 * 240; // small screen private static final int MAX_PREVIEW_PIXELS = 800 * 480; // large/HD screen private final Context context; private Point screenResolution; private Point cameraResolution; CameraConfigurationManager(Context context) { this.context = context; } /** * Reads, one time, values from the camera that are needed by the app. */ void initFromCameraParameters(Camera camera) { Camera.Parameters parameters = camera.getParameters(); WindowManager manager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); Display display = manager.getDefaultDisplay(); int width = display.getWidth(); int height = display.getHeight(); // We're landscape-only, and have apparently seen issues with display // thinking it's portrait // when waking from sleep. If it's not landscape, assume it's mistaken // and reverse them: if (width < height) { Log.i(TAG, "Display reports portrait orientation; assuming this is incorrect"); int temp = width; width = height; height = temp; } screenResolution = new Point(height, width); Log.i(TAG, "Screen resolution: " + screenResolution); cameraResolution = findBestPreviewSizeValue(parameters, new Point(width, height), false); // float r = (float) width / (float) height; // cameraResolution = findBestPreviewSizeValue(parameters,r , width); Log.i(TAG, "Camera resolution: " + cameraResolution); } void setDesiredCameraParameters(Camera camera) { Camera.Parameters parameters = camera.getParameters(); if (parameters == null) { Log.w(TAG, "Device error: no camera parameters are available. Proceeding without configuration."); return; } SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); initializeTorch(parameters, prefs); String focusMode = findSettableValue(parameters.getSupportedFocusModes(), Camera.Parameters.FOCUS_MODE_AUTO, Camera.Parameters.FOCUS_MODE_MACRO); if (focusMode != null) { parameters.setFocusMode(focusMode); } parameters.setPreviewSize(cameraResolution.x, cameraResolution.y); /* 竖屏显示 */ camera.setDisplayOrientation(90); camera.setParameters(parameters); } Point getCameraResolution() { return cameraResolution; } Point getScreenResolution() { return screenResolution; } public static final String KEY_FRONT_LIGHT = "preferences_front_light"; void setTorch(Camera camera, boolean newSetting) { Camera.Parameters parameters = camera.getParameters(); doSetTorch(parameters, newSetting); camera.setParameters(parameters); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); boolean currentSetting = prefs.getBoolean(KEY_FRONT_LIGHT, false);// PreferencesActivity. if (currentSetting != newSetting) { SharedPreferences.Editor editor = prefs.edit(); editor.putBoolean(KEY_FRONT_LIGHT, newSetting);// PreferencesActivity. editor.commit(); } } private static void initializeTorch(Camera.Parameters parameters, SharedPreferences prefs) { boolean currentSetting = prefs.getBoolean(KEY_FRONT_LIGHT, false);// PreferencesActivity. doSetTorch(parameters, currentSetting); } private static void doSetTorch(Camera.Parameters parameters, boolean newSetting) { String flashMode; if (newSetting) { flashMode = findSettableValue(parameters.getSupportedFlashModes(), Camera.Parameters.FLASH_MODE_TORCH, Camera.Parameters.FLASH_MODE_ON); } else { flashMode = findSettableValue(parameters.getSupportedFlashModes(), Camera.Parameters.FLASH_MODE_OFF); } if (flashMode != null) { parameters.setFlashMode(flashMode); } } private static Point findBestPreviewSizeValue(Camera.Parameters parameters, Point screenResolution, boolean portrait) { Point bestSize = null; int diff = Integer.MAX_VALUE; for (Camera.Size supportedPreviewSize : parameters.getSupportedPreviewSizes()) { int pixels = supportedPreviewSize.height * supportedPreviewSize.width; if (pixels < MIN_PREVIEW_PIXELS || pixels > MAX_PREVIEW_PIXELS) { continue; } int supportedWidth = portrait ? supportedPreviewSize.height : supportedPreviewSize.width; int supportedHeight = portrait ? supportedPreviewSize.width : supportedPreviewSize.height; int newDiff = Math.abs(screenResolution.x * supportedHeight - supportedWidth * screenResolution.y); if (newDiff == 0) { bestSize = new Point(supportedWidth, supportedHeight); break; } if (newDiff < diff) { bestSize = new Point(supportedWidth, supportedHeight); diff = newDiff; } } if (bestSize == null) { Camera.Size defaultSize = parameters.getPreviewSize(); bestSize = new Point(defaultSize.width, defaultSize.height); } return bestSize; } private static Point findBestPreviewSizeValue(Camera.Parameters parameters, float th,int minWidth) { Size s = CamParaUtil.getInstance().getPropPreviewSize(parameters.getSupportedPreviewSizes(), th, minWidth); return new Point(s.width,s.height); } private static String findSettableValue(Collection<String> supportedValues, String... desiredValues) { Log.i(TAG, "Supported values: " + supportedValues); String result = null; if (supportedValues != null) { for (String desiredValue : desiredValues) { if (supportedValues.contains(desiredValue)) { result = desiredValue; break; } } } Log.i(TAG, "Settable value: " + result); return result; } }
[ "380712098@qq.com" ]
380712098@qq.com
ff7906e13948a8b4fabf2a364b0f07e190e51842
d20244f441504d9f119dfadacb3bfdd5a024b8e2
/ehmp/product/production/soap-handler/src/main/java/gov/va/med/jmeadows_2_3_1/webservice/GetPatientCurrentVitalsResponse.java
9ab36f696894b7427584926a83b8178ec5ae5acb
[ "Apache-2.0" ]
permissive
djwhitten/eHMP
33976e37cbf389c3deb598c598096fc0f160c1d4
2356516960cdb701996fe6273ac29aacced25101
refs/heads/master
2022-11-16T02:46:10.345118
2020-02-26T18:35:51
2020-02-26T18:35:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,917
java
package gov.va.med.jmeadows_2_3_1.webservice; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for getPatientCurrentVitalsResponse complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="getPatientCurrentVitalsResponse"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="return" type="{http://webservice.vds.URL /}vitals" maxOccurs="unbounded" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "getPatientCurrentVitalsResponse", propOrder = { "_return" }) public class GetPatientCurrentVitalsResponse { @XmlElement(name = "return") protected List<Vitals> _return; /** * Gets the value of the return property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the return property. * * <p> * For example, to add a new item, do as follows: * <pre> * getReturn().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link Vitals } * * */ public List<Vitals> getReturn() { if (_return == null) { _return = new ArrayList<Vitals>(); } return this._return; } }
[ "sam.habiel@gmail.com" ]
sam.habiel@gmail.com
b4c9f39858482edb95c3d0e31a7db3820b6f5583
81b991c57a467e73259105f00e5d36e9f69467f8
/com/hbm/items/weapon/ItemClip.java
97a458cb48bbc9ab3917dd437b3cd64b1885fe8e
[]
no_license
Earl0fPudding/Hbm-s-Nuclear-Tech-GIT
b59124746a2592e228378570efa11ad2f393d1d7
9425c5b94161e7b9aeca905e966ae7f5c918c39d
refs/heads/master
2021-08-11T06:10:37.196992
2017-11-13T07:57:35
2017-11-13T07:57:35
110,515,045
0
0
null
2017-11-13T07:34:51
2017-11-13T07:34:51
null
UTF-8
Java
false
false
6,388
java
package com.hbm.items.weapon; import com.hbm.items.ModItems; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; public class ItemClip extends Item { public ItemClip() { this.setMaxDamage(1); } @Override public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { stack.stackSize--; if(stack.stackSize <= 0) stack.damageItem(5, player); if(this == ModItems.clip_revolver_iron) { if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_revolver_iron_ammo, 20))) { //player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_revolver_iron_ammo, 20), false); } } if(this == ModItems.clip_revolver) { if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_revolver_ammo, 12))) { //player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_revolver_ammo, 12), false); } } if(this == ModItems.clip_revolver_gold) { if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_revolver_gold_ammo, 4))) { //player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_revolver_gold_ammo, 4), false); } } if(this == ModItems.clip_revolver_schrabidium) { if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_revolver_schrabidium_ammo, 2))) { //player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_revolver_schrabidium_ammo, 2), false); } } if(this == ModItems.clip_rpg) { if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_rpg_ammo, 3))) { //player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_rpg_ammo, 3), false); } } if(this == ModItems.clip_osipr) { if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_osipr_ammo, 30))) { //player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_osipr_ammo, 30), false); } if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_osipr_ammo2, 1))) { //player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_osipr_ammo2, 1), false); } } if(this == ModItems.clip_xvl1456) { if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_xvl1456_ammo, 60))) { //player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_xvl1456_ammo, 60), false); } } if(this == ModItems.clip_revolver_lead) { if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_revolver_lead_ammo, 12))) { //player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_revolver_lead_ammo, 12), false); } } if(this == ModItems.clip_revolver_cursed) { if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_revolver_cursed_ammo, 17))) { //player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_revolver_cursed_ammo, 17), false); } } if(this == ModItems.clip_fatman) { if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_fatman_ammo, 6))) { //player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_fatman_ammo, 6), false); } } if(this == ModItems.clip_mp) { if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_mp_ammo, 30))) { //player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_mp_ammo, 30), false); } } if(this == ModItems.clip_mp40) { if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_mp40_ammo, 32))) { //player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_mp40_ammo, 32), false); } } if(this == ModItems.clip_uboinik) { if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_uboinik_ammo, 24))) { //player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_uboinik_ammo, 24), false); } } if(this == ModItems.clip_mirv) { if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_mirv_ammo, 3))) { //player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_mp40_ammo, 32), false); } } if(this == ModItems.clip_bf) { if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_bf_ammo, 2))) { //player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_mp40_ammo, 32), false); } } if(this == ModItems.clip_immolator) { if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_immolator_ammo, 60))) { //player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_mp40_ammo, 32), false); } } if(this == ModItems.clip_cryolator) { if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_cryolator_ammo, 60))) { //player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_mp40_ammo, 32), false); } } if(this == ModItems.clip_emp) { if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_emp_ammo, 6))) { //player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_mp40_ammo, 32), false); } } if(this == ModItems.clip_revolver_nightmare) { if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_revolver_nightmare_ammo, 6))) { //player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_mp40_ammo, 32), false); } } if(this == ModItems.clip_revolver_nightmare2) { if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_revolver_nightmare2_ammo, 6))) { //player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_mp40_ammo, 32), false); } } return stack; } }
[ "hbmmods@gmail.com" ]
hbmmods@gmail.com
4e5076bcab1c5a674d4ab835122a3c4bf492e284
06a933704186316d8396a90ebe2f54e57dc483d1
/src/test/java/com/natureseyes/controller/web/rest/ClientForwardControllerIT.java
08274d351d358e8dee32e7e0e313a3a63f1b1e59
[]
no_license
bafconsulting/BirdTheatreServer
6fe8a0ad14c075edb5ed4a670ce5facf0c8e8b64
cd6619ade00cb99c607046e82aa45579771255c8
refs/heads/master
2023-01-12T02:42:35.603199
2019-09-28T00:45:32
2019-09-28T00:45:32
202,452,701
0
0
null
null
null
null
UTF-8
Java
false
false
2,479
java
package com.natureseyes.controller.web.rest; import com.natureseyes.controller.BirdTheatreApp; import com.natureseyes.controller.config.TestSecurityConfiguration; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.http.MediaType; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.ResultActions; import org.springframework.test.web.servlet.setup.MockMvcBuilders; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.forwardedUrl; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; /** * Integration tests for the {@link ClientForwardController} REST controller. */ @SpringBootTest(classes = {BirdTheatreApp.class, TestSecurityConfiguration.class}) public class ClientForwardControllerIT { private MockMvc restMockMvc; @BeforeEach public void setup() { ClientForwardController clientForwardController = new ClientForwardController(); this.restMockMvc = MockMvcBuilders .standaloneSetup(clientForwardController, new TestController()) .build(); } @Test public void getBackendEndpoint() throws Exception { restMockMvc.perform(get("/test")) .andExpect(status().isOk()) .andExpect(content().contentTypeCompatibleWith(MediaType.TEXT_PLAIN_VALUE)) .andExpect(content().string("test")); } @Test public void getClientEndpoint() throws Exception { ResultActions perform = restMockMvc.perform(get("/non-existant-mapping")); perform .andExpect(status().isOk()) .andExpect(forwardedUrl("/")); } @Test public void getNestedClientEndpoint() throws Exception { restMockMvc.perform(get("/admin/user-management")) .andExpect(status().isOk()) .andExpect(forwardedUrl("/")); } @RestController public static class TestController { @RequestMapping(value = "/test") public String test() { return "test"; } } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
1d05bc6ce8c96de2e38643a5885995105338137c
883a0cb8154385a337b31d0fc9d92e070510b7b1
/jetlinks-components/notify-component/notify-core/src/main/java/org/jetlinks/community/notify/NotifyType.java
63aeba80f1bb3350d07d220386dcbdad374e965b
[ "Apache-2.0" ]
permissive
WangScaler/jetlinks-community
69e61941c958cc9b4702f72f0ea99d0fbcb6d530
d261352fa45a842dc0f2ac6c08e7e7546de78129
refs/heads/master
2023-07-14T16:53:47.977257
2020-12-03T01:54:26
2020-12-03T01:54:26
299,549,701
2
0
Apache-2.0
2021-09-01T06:28:24
2020-09-29T08:14:42
Java
UTF-8
Java
false
false
236
java
package org.jetlinks.community.notify; /** * 通知类型.通常使用枚举实现此接口 * * @author zhouhao * @see DefaultNotifyType * @since 1.0 */ public interface NotifyType { String getId(); String getName(); }
[ "zh.sqy@qq.com" ]
zh.sqy@qq.com
9e36ee67ea7cb5cbbc56ebe3e761c799df4b72aa
8f85fedb1f052b2eeb960387f65915350ba75830
/net.certware.argument.aml.edit/src-gen/net/certware/argument/aml/parts/IntervalPropertiesEditionPart.java
ee0efc69cceca0542ba12ef0deb21ea528539897
[ "Apache-2.0" ]
permissive
mrbcuda/CertWare
bc3dd18ff803978d84143c26bfc7e3f74bd0c6aa
67ff7f9dc00a2298bfcb574e2acf056f7b7786b2
refs/heads/master
2021-01-17T21:26:34.643174
2013-08-06T22:01:30
2013-08-06T22:01:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
770
java
/** * Generated with Acceleo */ package net.certware.argument.aml.parts; // Start of user code for imports // End of user code /** * * */ public interface IntervalPropertiesEditionPart { /** * @return the max * */ public String getMax(); /** * Defines a new max * @param newValue the new max to set * */ public void setMax(String newValue); /** * @return the min * */ public String getMin(); /** * Defines a new min * @param newValue the new min to set * */ public void setMin(String newValue); /** * Returns the internationalized title text. * * @return the internationalized title text. * */ public String getTitle(); // Start of user code for additional methods // End of user code }
[ "mrbarry@kestreltechnology.com" ]
mrbarry@kestreltechnology.com
69acbefa5560dfc920ebf2c2e26de5ccbe2b7d40
7fe5eff311262436a7c1df3afb12f45194ffc072
/opensaml2/src/test/java/se/litsec/eidas/opensaml2/ext/attributes/DateOfBirthTypeTest.java
8d6f2b9b74d8e0690ecba2038d10828a41dacbbb
[ "Apache-2.0" ]
permissive
litsec/eidas-opensaml
bb20a6281abe533bf01f1f3ed7b1fa1f896ed1c0
75857a4dd0ea719b13a9216a5bd761ba53dc56c0
refs/heads/master
2023-04-28T11:17:19.646309
2023-01-02T13:13:13
2023-01-02T13:13:13
61,832,796
13
2
Apache-2.0
2023-04-19T08:27:14
2016-06-23T19:57:06
Java
UTF-8
Java
false
false
1,725
java
/* * Copyright 2016-2017 Litsec AB * * 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 se.litsec.eidas.opensaml2.ext.attributes; import org.junit.Assert; import org.junit.Test; import org.opensaml.xml.util.XMLHelper; import org.w3c.dom.Element; import se.litsec.eidas.opensaml2.OpenSAMLTestBase; import se.litsec.eidas.opensaml2.ext.attributes.DateOfBirthType; /** * Test cases for {@link DateOfBirthType}. * * @author Martin Lindström (martin.lindstrom@litsec.se) */ public class DateOfBirthTypeTest extends OpenSAMLTestBase { /** * Test to marhall and unmarshall the object. * * @throws Exception * for errors */ @Test public void testMarshallUnmarshall() throws Exception { DateOfBirthType date = OpenSAMLTestBase.createSamlObject(DateOfBirthType.class, DateOfBirthType.TYPE_NAME); date.setDate(1969, 11, 29); Element xml = OpenSAMLTestBase.marshall(date); Assert.assertEquals("1969-11-29", xml.getTextContent()); System.out.println(XMLHelper.prettyPrintXML(xml)); DateOfBirthType date2 = OpenSAMLTestBase.unmarshall(xml, DateOfBirthType.class); Assert.assertEquals(date.getDate(), date2.getDate()); } }
[ "martin.lindstrom@litsec.se" ]
martin.lindstrom@litsec.se
beacc4a0fbe0fa48f756cb07d618b4e14f5fa3e4
ca030864a3a1c24be6b9d1802c2353da4ca0d441
/classes2.dex_source_from_JADX/com/facebook/widget/springbutton/TouchSpring.java
b856c74fb4770b4c8c270b6683b6ae824d41e02e
[]
no_license
pxson001/facebook-app
87aa51e29195eeaae69adeb30219547f83a5b7b1
640630f078980f9818049625ebc42569c67c69f7
refs/heads/master
2020-04-07T20:36:45.758523
2018-03-07T09:04:57
2018-03-07T09:04:57
124,208,458
4
0
null
null
null
null
UTF-8
Java
false
false
4,123
java
package com.facebook.widget.springbutton; import android.graphics.Rect; import android.view.MotionEvent; import android.view.View; import android.view.View.OnTouchListener; import com.facebook.feed.ufi.FullscreenVideoFeedbackActionButtonBar.LikeButtonSpringListener; import com.facebook.inject.InjectorLike; import com.facebook.proxygen.HTTPTransportCallback; import com.facebook.springs.Spring; import com.facebook.springs.SpringConfig; import java.lang.ref.WeakReference; import javax.annotation.Nullable; import javax.inject.Inject; /* compiled from: gifts_imp */ public class TouchSpring implements OnTouchListener { public float f22377a = 1.3f; public float f22378b = 0.8f; public float f22379c = 1.4f; public boolean f22380d = false; public SpringConfig f22381e; public final SpringFactory f22382f; @Nullable public Spring f22383g; @Nullable private WeakReference<TouchSpringUpdateListener> f22384h; @Nullable public int[] f22385i; @Nullable public Rect f22386j; @Deprecated @Nullable public LikeButtonSpringListener f22387k; /* compiled from: gifts_imp */ public interface TouchSpringUpdateListener { void mo3274a(float f); boolean isPressed(); boolean performClick(); } public static TouchSpring m30307b(InjectorLike injectorLike) { return new TouchSpring(SpringFactory.m28319a(injectorLike)); } @Inject public TouchSpring(SpringFactory springFactory) { this.f22382f = springFactory; } public final void m30311a(TouchSpringUpdateListener touchSpringUpdateListener) { this.f22384h = new WeakReference(touchSpringUpdateListener); } public final void m30309a() { this.f22384h = null; } public boolean onTouch(View view, MotionEvent motionEvent) { TouchSpringUpdateListener c = m30308c(this); if (c != null) { if (this.f22385i == null) { this.f22385i = new int[2]; this.f22386j = new Rect(); this.f22383g = this.f22382f.m28321a(); if (this.f22381e != null) { this.f22383g.m7814a(this.f22381e); } this.f22383g.m7815a(new ButtonSpringListener(this)); } boolean a = m30306a(view, this.f22383g, motionEvent); if (motionEvent.getAction() == 1 && a) { c.performClick(); } } return true; } private boolean m30306a(View view, Spring spring, MotionEvent motionEvent) { double d = 1.0d; boolean z = true; if (!this.f22380d) { view.getHitRect(this.f22386j); view.getLocationOnScreen(this.f22385i); this.f22386j.offsetTo(this.f22385i[0], this.f22385i[1]); z = this.f22386j.contains((int) motionEvent.getRawX(), (int) motionEvent.getRawY()); } boolean z2 = z; switch (motionEvent.getAction()) { case 0: case HTTPTransportCallback.FIRST_BODY_BYTE_FLUSHED /*2*/: view.setPressed(z2); if (z2) { d = (double) this.f22378b; } spring.m7818b(d); break; case HTTPTransportCallback.FIRST_HEADER_BYTE_FLUSHED /*1*/: view.setPressed(false); if (z2) { d = (double) this.f22379c; } spring.m7818b(d); break; case 3: view.setPressed(false); spring.m7818b(1.0d); break; } return z2; } public static TouchSpringUpdateListener m30308c(TouchSpring touchSpring) { if (touchSpring.f22384h == null) { return null; } return (TouchSpringUpdateListener) touchSpring.f22384h.get(); } public final void m30310a(SpringConfig springConfig) { this.f22381e = springConfig; if (this.f22383g != null) { this.f22383g.m7814a(springConfig); } } }
[ "son.pham@jmango360.com" ]
son.pham@jmango360.com
d6c7ea9ef0b81d9eb15de727aac714822ba7f660
27d1c5308a56ad7db5b1cf50507b5721b74f0c7f
/tb-common/src/main/java/com/ziapple/common/data/BaseData.java
7f0eeda539b6fc07179536fee1ed4bdf3c0d3567
[]
no_license
ziapple/tb-learning-guide
bd85891bcde7dfec6cc636d814389eaaa01fb795
22122a611d6bebe111b5c0c43ca2e667dbd787c1
refs/heads/master
2022-12-21T04:24:34.143540
2020-09-22T09:48:19
2020-09-22T09:48:19
239,299,309
0
0
null
2022-12-10T05:36:46
2020-02-09T12:16:06
Java
UTF-8
Java
false
false
2,323
java
/** * Copyright © 2016-2020 The Thingsboard 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.ziapple.common.data; import com.ziapple.common.data.id.IdBased; import com.ziapple.common.data.id.UUIDBased; import java.io.Serializable; public abstract class BaseData<I extends UUIDBased> extends IdBased<I> implements Serializable { private static final long serialVersionUID = 5422817607129962637L; protected long createdTime; public BaseData() { super(); } public BaseData(I id) { super(id); } public BaseData(BaseData<I> data) { super(data.getId()); this.createdTime = data.getCreatedTime(); } public long getCreatedTime() { return createdTime; } public void setCreatedTime(long createdTime) { this.createdTime = createdTime; } @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + (int) (createdTime ^ (createdTime >>> 32)); return result; } @SuppressWarnings("rawtypes") @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; BaseData other = (BaseData) obj; if (createdTime != other.createdTime) return false; return true; } @Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append("BaseData [createdTime="); builder.append(createdTime); builder.append(", id="); builder.append(id); builder.append("]"); return builder.toString(); } }
[ "ziapple@126.com" ]
ziapple@126.com
abe1a936edf21a6585e539b944ad9f01d8291057
99ebc409cd34b4a7c7072840c44afb77e5b6bb84
/aijiu-manager/src/main/java/com/aijiu/common/domain/PageDO.java
b892d5afdeb510f176ae0db419150ba92c4d1346
[]
no_license
tangminnan/aijiu
01b392d5d476abadf408a10e086c01b6b2fbd867
f94d985f672271ba95dc90a5cb6f9eb14897d42e
refs/heads/master
2023-04-02T02:20:04.995470
2021-04-08T09:51:54
2021-04-08T09:51:54
343,312,490
0
0
null
null
null
null
UTF-8
Java
false
false
1,400
java
package com.aijiu.common.domain; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class PageDO<T> { private int offset; private int limit; private int total; private Map<String, Object> params; private String param; private List<T> rows; public PageDO() { super(); this.offset = 0; this.limit = 10; this.total = 1; this.params = new HashMap<>(); this.param = ""; this.rows = new ArrayList<>(); } public int getOffset() { return offset; } public void setOffset(int offset) { this.offset = offset; } public int getLimit() { return limit; } public void setLimit(int limit) { this.limit = limit; } public int getTotal() { return total; } public void setTotal(int total) { this.total = total; } public Map<String, Object> getParams() { return params; } public void setParams(Map<String, Object> params) { this.params = params; } public List<T> getRows() { return rows; } public void setRows(List<T> rows) { this.rows = rows; } public String getParam() { return param; } public void setParam(String param) { this.param = param; } @Override public String toString() { return "PageDO{" + "offset=" + offset + ", limit=" + limit + ", total=" + total + ", params=" + params + ", param='" + param + '\'' + ", rows=" + rows + '}'; } }
[ "349829327@qq.com" ]
349829327@qq.com
0c7a127aae7c44c44d7bf5330df947aa6b4e7d71
e75be673baeeddee986ece49ef6e1c718a8e7a5d
/submissions/blizzard/Corpus/eclipse.pde.ui/4728.java
41a8c1a7dd8c4cd007aaef150375dbca77ffa8da
[ "MIT" ]
permissive
zhendong2050/fse18
edbea132be9122b57e272a20c20fae2bb949e63e
f0f016140489961c9e3c2e837577f698c2d4cf44
refs/heads/master
2020-12-21T11:31:53.800358
2018-07-23T10:10:57
2018-07-23T10:10:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
668
java
/******************************************************************************* * Copyright (c) 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package x.y.z; import internal.x.y.z.internalprivatefield; /** * */ public class test29 extends internalprivatefield { }
[ "tim.menzies@gmail.com" ]
tim.menzies@gmail.com
cf659fe4d42276852dbb4f7a359d43cc148de725
8af1164bac943cef64e41bae312223c3c0e38114
/results-java/PhilJay--MPAndroidChart/3514aaedf9624222c985cb3abb12df2d9b514b12/after/BarHighlighter.java
72ca63381199502770f852fb0b42de8ffe64105c
[]
no_license
fracz/refactor-extractor
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
dd5e82bfcc376e74a99e18c2bf54c95676914272
refs/heads/master
2021-01-19T06:50:08.211003
2018-11-30T13:00:57
2018-11-30T13:00:57
87,353,478
0
0
null
null
null
null
UTF-8
Java
false
false
5,562
java
package com.github.mikephil.charting.highlight; import android.util.Log; import com.github.mikephil.charting.components.YAxis; import com.github.mikephil.charting.data.BarDataSet; import com.github.mikephil.charting.data.BarEntry; import com.github.mikephil.charting.interfaces.BarDataProvider; import com.github.mikephil.charting.interfaces.BarLineScatterCandleBubbleDataProvider; /** * Created by Philipp Jahoda on 22/07/15. */ public class BarHighlighter extends ChartHighlighter<BarDataProvider> { public BarHighlighter(BarDataProvider chart) { super(chart); } @Override public Highlight getHighlight(float x, float y) { Highlight h = super.getHighlight(x, y); if(h == null) return h; else { BarDataSet set = mChart.getBarData().getDataSetByIndex(h.getDataSetIndex()); if (set.isStacked()) { // create an array of the touch-point float[] pts = new float[2]; pts[1] = y; // take any transformer to determine the x-axis value mChart.getTransformer(set.getAxisDependency()).pixelsToValue(pts); return getStackedHighlight(set, h.getXIndex(), h.getDataSetIndex(), pts[1]); } else return h; } } @Override protected int getXIndex(float x) { if(!mChart.getBarData().isGrouped()) { return super.getXIndex(x); } else { float baseNoSpace = getBase(x); int setCount = mChart.getBarData().getDataSetCount(); int xIndex = (int) baseNoSpace / setCount; int valCount = mChart.getData().getXValCount(); if(xIndex < 0) xIndex = 0; else if(xIndex >= valCount) xIndex = valCount - 1; return xIndex; } } @Override protected int getDataSetIndex(int xIndex, float x, float y) { if(!mChart.getBarData().isGrouped()) { return 0; } else { float baseNoSpace = getBase(x); int setCount = mChart.getBarData().getDataSetCount(); int dataSetIndex = (int) baseNoSpace % setCount; if (dataSetIndex < 0) dataSetIndex = 0; else if (dataSetIndex >= setCount) dataSetIndex = setCount - 1; return dataSetIndex; } } /** * This method creates the Highlight object that also indicates which value * of a stacked BarEntry has been selected. * * @param set * @param xIndex * @param dataSetIndex * @param yValue * @return */ protected Highlight getStackedHighlight(BarDataSet set, int xIndex, int dataSetIndex, double yValue) { BarEntry entry = set.getEntryForXIndex(xIndex); if (entry != null) { int stackIndex = getClosestStackIndex(entry, (float) yValue); Highlight h = new Highlight(xIndex, dataSetIndex, stackIndex); return h; } else return null; } /** * Returns the index of the closest value inside the values array (for stacked barchart) * to the value given as a parameter. * * @param e * @param value * @return */ protected int getClosestStackIndex(BarEntry e, float value) { Range[] ranges = getRanges(e); int stackIndex = 0; for(Range range : ranges) { if(range.contains(value)) return stackIndex; else stackIndex++; } int length = ranges.length - 1; return (value > ranges[length].to) ? length : 0; // // float[] vals = e.getVals(); // // if (vals == null) // return -1; // // int index = 0; // float remainder = e.getNegativeSum(); // // while (index < vals.length - 1 && value > vals[index] + remainder) { // remainder += vals[index]; // index++; // } // // return index; } /** * Returns the base x-value to the corresponding x-touch value in pixels. * @param x * @return */ protected float getBase(float x) { // create an array of the touch-point float[] pts = new float[2]; pts[0] = x; // take any transformer to determine the x-axis value mChart.getTransformer(YAxis.AxisDependency.LEFT).pixelsToValue(pts); float xVal = pts[0]; int setCount = mChart.getBarData().getDataSetCount(); // calculate how often the group-space appears int steps = (int) ((float) xVal / ((float) setCount + mChart.getBarData().getGroupSpace())); float groupSpaceSum = mChart.getBarData().getGroupSpace() * (float) steps; float baseNoSpace = (float) xVal - groupSpaceSum; return baseNoSpace; } protected Range[] getRanges(BarEntry entry) { float[] values = entry.getVals(); float negRemain = -entry.getNegativeSum(); float posRemain = 0f; Range[] ranges = new Range[values.length]; for(int i = 0; i < ranges.length; i++) { float value = values[i]; if(value < 0) { ranges[i] = new Range(negRemain, negRemain+Math.abs(value)); negRemain += Math.abs(value); } else { ranges[i] = new Range(posRemain, posRemain+value); posRemain += value; } } return ranges; } }
[ "fraczwojciech@gmail.com" ]
fraczwojciech@gmail.com
618f61ba613c3627a98d056b9eda162de329ed1c
7e9cb0b3a29dbd7d241640c0dda30b620dae52b9
/admin-web/src/main/java/com/cts/fasttack/admin/web/exceptions/ValidationException.java
a7096513e295e0fd44a62b0a215c4671f8cc1d85
[]
no_license
ilemobayo/FASTTACK
f8705ae0b2f5a41487410016756a1b26b0bc5e22
85487890b9e5597f9b2b9690713ece2a5c1aff9f
refs/heads/master
2020-05-26T15:00:06.553982
2018-11-30T11:32:39
2018-11-30T11:32:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
857
java
package com.cts.fasttack.admin.web.exceptions; import java.util.Map; /** * Simple validation exception * * @author Anton Leliuk */ public class ValidationException extends RuntimeException { private static final long serialVersionUID = 7399602643076049073L; /** * Standard message exception */ private final static String STANDARD_MESSAGE = "During system operation errors occurred!"; /** * Map with identificators and error messages */ private Map<String, String> messageMap; public ValidationException(Map<String, String> messageMap) { super(STANDARD_MESSAGE); this.messageMap = messageMap; } public Map<String, String> getMessageMap() { return messageMap; } public void setMessageMap(Map<String, String> messageMap) { this.messageMap = messageMap; } }
[ "a.lazarchuk@cartsys.com.ua" ]
a.lazarchuk@cartsys.com.ua
7f14a82a19e09456f5cc6b1c89c31f4b53981c89
bc794d54ef1311d95d0c479962eb506180873375
/gmao/gmao-dao/dao-ifaces/src/main/java/com/teratech/gmao/dao/ifaces/curative/AffectationBonTravailDAOLocal.java
f9934222021f05d3ab285d64430ba23e226a6784
[]
no_license
Teratech2018/Teratech
d1abb0f71a797181630d581cf5600c50e40c9663
612f1baf9636034cfa5d33a91e44bbf3a3f0a0cb
refs/heads/master
2021-04-28T05:31:38.081955
2019-04-01T08:35:34
2019-04-01T08:35:34
122,177,253
0
0
null
null
null
null
UTF-8
Java
false
false
278
java
package com.teratech.gmao.dao.ifaces.curative; import javax.ejb.Local; /** * Interface locale de la DAO * @since Tue Jul 17 13:30:30 GMT+01:00 2018 * */ @Local public interface AffectationBonTravailDAOLocal extends AffectationBonTravailDAO { }
[ "bekondo_dieu@yahoo.fr" ]
bekondo_dieu@yahoo.fr
af18ebc3209689edb6f7e324ec34b8f4e281a7fd
3f5b613d1caf00814415d76c300a7a79ee5c18e1
/src/main/java/io/github/stayhungrystayfoolish/web/rest/errors/ErrorConstants.java
02f0b1c91805b1b4e43f048c8fbfed930e9b38d2
[]
no_license
StayHungryStayFoolish/security-design
79d46d86b7a77794ce39236a60b969426b2b5cf9
66bdf87d0ad9b4f4a4c72f0e7da9e54795e73010
refs/heads/master
2021-06-05T10:29:47.953929
2018-08-26T07:29:57
2018-08-26T07:29:57
145,530,536
1
1
null
2020-09-18T16:56:46
2018-08-21T08:17:31
Java
UTF-8
Java
false
false
1,232
java
package io.github.stayhungrystayfoolish.web.rest.errors; import java.net.URI; public final class ErrorConstants { public static final String ERR_CONCURRENCY_FAILURE = "error.concurrencyFailure"; public static final String ERR_VALIDATION = "error.validation"; public static final String PROBLEM_BASE_URL = "https://www.jhipster.tech/problem"; public static final URI DEFAULT_TYPE = URI.create(PROBLEM_BASE_URL + "/problem-with-message"); public static final URI CONSTRAINT_VIOLATION_TYPE = URI.create(PROBLEM_BASE_URL + "/constraint-violation"); public static final URI PARAMETERIZED_TYPE = URI.create(PROBLEM_BASE_URL + "/parameterized"); public static final URI ENTITY_NOT_FOUND_TYPE = URI.create(PROBLEM_BASE_URL + "/entity-not-found"); public static final URI INVALID_PASSWORD_TYPE = URI.create(PROBLEM_BASE_URL + "/invalid-password"); public static final URI EMAIL_ALREADY_USED_TYPE = URI.create(PROBLEM_BASE_URL + "/email-already-used"); public static final URI LOGIN_ALREADY_USED_TYPE = URI.create(PROBLEM_BASE_URL + "/login-already-used"); public static final URI EMAIL_NOT_FOUND_TYPE = URI.create(PROBLEM_BASE_URL + "/email-not-found"); private ErrorConstants() { } }
[ "bonismo@hotmail.com" ]
bonismo@hotmail.com
4aca34daff5007975a295f5221f521deeea51345
6baf1fe00541560788e78de5244ae17a7a2b375a
/hollywood/com.oculus.browser-base/sources/defpackage/Y81.java
e9b4c63bc534d31c3954858b835af08380d26548
[]
no_license
phwd/quest-tracker
286e605644fc05f00f4904e51f73d77444a78003
3d46fbb467ba11bee5827f7cae7dfeabeb1fd2ba
refs/heads/main
2023-03-29T20:33:10.959529
2021-04-10T22:14:11
2021-04-10T22:14:11
357,185,040
4
2
null
2021-04-12T12:28:09
2021-04-12T12:28:08
null
UTF-8
Java
false
false
1,832
java
package defpackage; import android.content.Context; import android.content.res.Resources; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import com.oculus.browser.R; import org.chromium.ui.widget.ViewLookupCachingFrameLayout; /* renamed from: Y81 reason: default package */ /* compiled from: chromium-OculusBrowser.apk-stable-281887347 */ public final /* synthetic */ class Y81 implements AbstractC5105ub0 { /* renamed from: a reason: collision with root package name */ public final Context f9256a; public final ViewGroup b; public Y81(Context context, ViewGroup viewGroup) { this.f9256a = context; this.b = viewGroup; } @Override // defpackage.AbstractC5105ub0 public View a(ViewGroup viewGroup) { Context context = this.f9256a; ViewLookupCachingFrameLayout viewLookupCachingFrameLayout = (ViewLookupCachingFrameLayout) LayoutInflater.from(context).inflate(R.layout.f37330_resource_name_obfuscated_RES_2131624042, this.b, false); viewLookupCachingFrameLayout.setClickable(true); ImageView imageView = (ImageView) viewLookupCachingFrameLayout.d(R.id.end_button); imageView.setVisibility(0); Resources resources = viewLookupCachingFrameLayout.getResources(); int dimension = (int) resources.getDimension(R.dimen.f25380_resource_name_obfuscated_RES_2131166157); Bitmap decodeResource = BitmapFactory.decodeResource(resources, R.drawable.f28430_resource_name_obfuscated_RES_2131230883); Bitmap.createScaledBitmap(decodeResource, dimension, dimension, true); imageView.setImageBitmap(decodeResource); return viewLookupCachingFrameLayout; } }
[ "cyuubiapps@gmail.com" ]
cyuubiapps@gmail.com
442747c314ec2c924dbed1ab26c0985c07c41efb
d6ee393f6e3728a5cdc8dc5cbf3cb09edffcbf25
/.svn/pristine/a3/a3e40cf65c9e6f8d8ca146d433ec2d7ec2e39955.svn-base
19f4bdeb707881dea6066310cd7b4a3ce0793e72
[]
no_license
wuzhining/mesParent
f4cfd11828586d738e8123c6d4b675a77d465333
d806586103327d48f26ce2725e0e201292793f94
refs/heads/master
2022-12-21T00:07:07.116066
2019-10-04T05:35:10
2019-10-04T05:35:10
212,742,010
3
0
null
2022-12-16T09:57:13
2019-10-04T05:25:37
JavaScript
UTF-8
Java
false
false
1,499
package com.techsoft.entity.common; import com.techsoft.common.BaseEntity; public class EquipClassesFixture extends BaseEntity { private static final long serialVersionUID = -3809343842222754308L; public EquipClassesFixture(){ } private Long tenantId; private String classesCode; private String classesName; private Long parentId; private String isValid; private Integer sortNo; private String remark; public Long getTenantId() { return tenantId; } public void setTenantId(Long tenantId) { this.tenantId = tenantId; } public String getClassesCode() { return classesCode; } public void setClassesCode(String classesCode) { this.classesCode = classesCode; } public String getClassesName() { return classesName; } public void setClassesName(String classesName) { this.classesName = classesName; } public Long getParentId() { return parentId; } public void setParentId(Long parentId) { this.parentId = parentId; } public String getIsValid() { return isValid; } public void setIsValid(String isValid) { this.isValid = isValid; } public Integer getSortNo() { return sortNo; } public void setSortNo(Integer sortNo) { this.sortNo = sortNo; } public String getRemark() { return remark; } public void setRemark(String remark) { this.remark = remark; } }
[ "wzn354753575@sina.cn" ]
wzn354753575@sina.cn
08f54c8d7473c8c6210dddd35679867507f82621
847d94b6a8861b0acad3e9b14090716019bfd25e
/src/main/java/org/kitteh/irc/client/library/event/batch/ClientBatchMessageEvent.java
2827296d5f7d901f68d3a44b6bd052d983720c28
[ "Apache-2.0", "MIT" ]
permissive
KittehOrg/KittehIRCClientLib
0268ebe228b5b3c84c5e44020a2bfc3e4f58632c
46b5795227c075b39c98b57c5a490a9009c6d52d
refs/heads/master
2022-02-01T16:32:39.799783
2021-09-30T22:24:29
2021-10-01T03:24:45
27,287,741
150
50
NOASSERTION
2021-12-29T12:05:00
2014-11-29T01:27:02
Java
UTF-8
Java
false
false
2,094
java
/* * * Copyright (C) 2013-2021 Matt Baxter https://kitteh.org * * 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.kitteh.irc.client.library.event.batch; import org.checkerframework.checker.nullness.qual.NonNull; import org.kitteh.irc.client.library.Client; import org.kitteh.irc.client.library.element.ServerMessage; import org.kitteh.irc.client.library.event.abstractbase.ClientBatchEventBase; import org.kitteh.irc.client.library.util.BatchReferenceTag; /** * A new message has been added to a batch reference tag, and will be held * until the batch finishes. */ public class ClientBatchMessageEvent extends ClientBatchEventBase { /** * Constructs the event. * * @param client the client * @param sourceMessage source message * @param batchReferenceTag reference-tag and associated information */ public ClientBatchMessageEvent(@NonNull Client client, @NonNull ServerMessage sourceMessage, @NonNull BatchReferenceTag batchReferenceTag) { super(client, sourceMessage, batchReferenceTag); } }
[ "matt@phozop.net" ]
matt@phozop.net
741eb17b1b90634921a864602355826b67f4a4fb
d9ee259ea531db0b4963caef0e6b1fa4a8c1b74c
/thirdstage.exercise.spring3/src/main/java/sample/server/case2/Server.java
b73bc7d0982f11d5eb7dfcac15341de0f46d6089
[]
no_license
3rdstage/exercise
2c068a6eb83a88afb56d2f61176172907a2654ad
8ede271cc9d6ef3eec530544b4bb29cd4b776c47
refs/heads/master
2022-12-21T08:59:17.189471
2022-09-22T23:02:02
2022-09-22T23:02:02
6,543,754
0
1
null
2022-12-16T04:25:01
2012-11-05T12:09:39
HTML
UTF-8
Java
false
false
2,262
java
package sample.server.case2; import java.io.ByteArrayOutputStream; import java.io.ObjectOutputStream; import java.util.Properties; import java.util.zip.GZIPOutputStream; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; /** * * @question Is there any way to make thread pool create threads initially. */ public class Server { private ApplicationContext springContext; private ThreadPoolTaskExecutor threadPool; private byte[] data; public Server() throws Exception{ this.springContext = new ClassPathXmlApplicationContext("sample/server/case2/spring-server.xml"); this.threadPool = springContext.getBean("threadPool", ThreadPoolTaskExecutor.class); this.prepareData(); System.out.println("Press 'Enter' key to end this programm."); while(true){ if(System.in.available() > 0) break; Thread.currentThread().sleep(1000); } this.threadPool.shutdown(); System.out.println("The program ends."); } /** * Compress data in advance for clients to download. */ private void prepareData() throws Exception{ Properties props = System.getProperties(); //uncompressed data to download ByteArrayOutputStream baos = null; GZIPOutputStream gzos = null; ObjectOutputStream oos = null; try{ baos = new ByteArrayOutputStream(); gzos = new GZIPOutputStream(baos); oos = new ObjectOutputStream(gzos); oos.writeObject(props); gzos.finish(); //don't miss this this.data = baos.toByteArray(); System.out.printf("The size of compressed data is %1$d.\n", this.data.length); }catch(Exception ex){ throw ex; }finally{ if(baos != null){ try{ baos.close(); }catch(Exception ex){} } if(gzos != null){ try{ gzos.close(); }catch(Exception ex){} } if(oos != null){ try{ oos.close(); }catch(Exception ex){} } } } public static void main(String[] args) throws Exception{ Server server = new Server(); } }
[ "halfface@chollian.net" ]
halfface@chollian.net
e9a5e32f35f0c25272a13a93b7818c03bb9e351d
24eec785fbbf5009cb6e708aa434b90a98e55dbd
/android/app/src/main/java/com/santa_catarina_polic_2534/MainApplication.java
527f853114723c65d24bdd5b2bbf098fe5bdaeda
[]
no_license
crowdbotics-apps/santa-catarina-polic-2534
08001139b60cce2fdaa1a5cc09eacec598725bf6
9d67ee58053b91e29efcdae2aea674c24a73b034
refs/heads/master
2020-05-16T01:56:49.766691
2019-04-22T03:18:36
2019-04-22T03:18:36
182,615,424
0
0
null
null
null
null
UTF-8
Java
false
false
1,061
java
package com.santa_catarina_polic_2534; import android.app.Application; import com.facebook.react.ReactApplication; import com.facebook.react.ReactNativeHost; import com.facebook.react.ReactPackage; import com.facebook.react.shell.MainReactPackage; import com.facebook.soloader.SoLoader; import java.util.Arrays; import java.util.List; public class MainApplication extends Application implements ReactApplication { private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { @Override public boolean getUseDeveloperSupport() { return BuildConfig.DEBUG; } @Override protected List<ReactPackage> getPackages() { return Arrays.<ReactPackage>asList( new MainReactPackage() ); } @Override protected String getJSMainModuleName() { return "index"; } }; @Override public ReactNativeHost getReactNativeHost() { return mReactNativeHost; } @Override public void onCreate() { super.onCreate(); SoLoader.init(this, /* native exopackage */ false); } }
[ "team@crowdbotics.com" ]
team@crowdbotics.com
eace22ae5167f10b5c54f6692ae4286fdee94874
d00af6c547e629983ff777abe35fc9c36b3b2371
/jboss-all/jmx/src/main/javax/management/openmbean/OpenMBeanConstructorInfo.java
908ed09a4122a40ecbe94244ac4464840ff33788
[]
no_license
aosm/JBoss
e4afad3e0d6a50685a55a45209e99e7a92f974ea
75a042bd25dd995392f3dbc05ddf4bbf9bdc8cd7
refs/heads/master
2023-07-08T21:50:23.795023
2013-03-20T07:43:51
2013-03-20T07:43:51
8,898,416
1
1
null
null
null
null
UTF-8
Java
false
false
2,203
java
/* * JBoss, the OpenSource J2EE webOS * * Distributable under LGPL license. * See terms of license at gnu.org. */ package javax.management.openmbean; import javax.management.MBeanParameterInfo; /** * An open MBean constructor info implements this interface as well as extending * MBeanConstructorInfo.<p> * * {@link OpenMBeanConstructorInfoSupport} is an example of such a class. * * @author <a href="mailto:Adrian.Brock@HappeningTimes.com">Adrian Brock</a>. * * @version $Revision: 1.1.2.1 $ * */ public interface OpenMBeanConstructorInfo { // Attributes ---------------------------------------------------- // Constructors -------------------------------------------------- // Public -------------------------------------------------------- /** * Retrieve a human readable description of the open MBean constructor the * implementation of this interface describes. * * @return the description. */ String getDescription(); /** * Retrieve the name of the constructor described. * * @return the name. */ String getName(); /** * Returns an array of the parameters passed to the constructor<p> * * The parameters must be OpenMBeanParameterInfos. * * @return the constructor's parameters. */ MBeanParameterInfo[] getSignature(); /** * Compares an object for equality with the implementing class.<p> * * The object is not null<br> * The object implements the open mbean constructor info interface<br> * The constructor names are equal<br> * The signatures are equal<br> * * @param obj the object to test * @return true when above is true, false otherwise */ boolean equals(Object obj); /** * Generates a hashcode for the implementation.<p> * * The sum of the hashCodes for the elements mentioned in the equals * method * * @return the calculated hashcode */ int hashCode(); /** * A string representation of the open mbean constructor info.<p> * * It is made up of implementation class and the values mentioned * in the equals method * * @return the string */ String toString(); }
[ "rasmus@dll.nu" ]
rasmus@dll.nu
397f1a02ffb9a19f66119613b2bc6d9d5d823bfc
39ecf3e4c1d8db9ba1880df8b3b6d55499d45faf
/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/Mapper.java
fc4a7d9f72ac6868b68eb42416e16f39b828ba00
[ "Apache-2.0" ]
permissive
chenkaibin/ovirt-engine
78ea632bf65522307b5c7c4f1b036a73d464be5b
bb4ffa83e2117f1fb910770757aedb5816670625
refs/heads/master
2020-03-09T09:10:28.771762
2018-03-27T15:10:32
2018-04-08T18:43:34
128,706,434
1
0
Apache-2.0
2018-04-09T02:58:49
2018-04-09T02:58:49
null
UTF-8
Java
false
false
318
java
package org.ovirt.engine.api.restapi.types; public interface Mapper<F, T> { /** * Map from one type to another. * * @param from * source object * @param template * template object, or null * @return mapped object */ T map(F from, T template); }
[ "iheim@redhat.com" ]
iheim@redhat.com
5806c97038d07e8dce5917d03bc2bd31aaea2ac9
65423f57d25e34d9440bf894584b92be29946825
/target/generated-sources/xjc/com/clincab/web/app/eutils/jaxb/e2br3/POCPMT010100UVConsumable1.java
469e6dbfddb68212a0162e71b15fbe67ffa62832
[]
no_license
kunalcabcsi/toolsr3
0b518cfa6813a88a921299ab8b8b5d6cbbd362fe
5071990dc2325bc74c34a3383792ad5448dee1b0
refs/heads/master
2021-08-31T04:20:23.924815
2017-12-20T09:25:33
2017-12-20T09:25:33
114,867,895
0
0
null
null
null
null
UTF-8
Java
false
false
7,587
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2017.12.20 at 02:30:39 PM IST // package com.clincab.web.app.eutils.jaxb.e2br3; import java.util.ArrayList; import java.util.List; import javax.xml.bind.JAXBElement; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElementRef; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for POCP_MT010100UV.Consumable1 complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="POCP_MT010100UV.Consumable1"&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;group ref="{urn:hl7-org:v3}InfrastructureRootElements"/&gt; * &lt;choice&gt; * &lt;element name="substanceAdministration" type="{urn:hl7-org:v3}POCP_MT010100UV.SubstanceAdministration"/&gt; * &lt;choice&gt; * &lt;element name="substanceAdministration1" type="{urn:hl7-org:v3}POCP_MT060100UV.SubstanceAdministration1"/&gt; * &lt;/choice&gt; * &lt;/choice&gt; * &lt;/sequence&gt; * &lt;attGroup ref="{urn:hl7-org:v3}InfrastructureRootAttributes"/&gt; * &lt;attribute name="nullFlavor" type="{urn:hl7-org:v3}NullFlavor" /&gt; * &lt;attribute name="typeCode" type="{urn:hl7-org:v3}ParticipationConsumable" default="CSM" /&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "POCP_MT010100UV.Consumable1", propOrder = { "realmCode", "typeId", "templateId", "substanceAdministration", "substanceAdministration1" }) public class POCPMT010100UVConsumable1 { protected List<CS> realmCode; protected II typeId; protected List<II> templateId; @XmlElementRef(name = "substanceAdministration", namespace = "urn:hl7-org:v3", type = JAXBElement.class, required = false) protected JAXBElement<POCPMT010100UVSubstanceAdministration> substanceAdministration; @XmlElementRef(name = "substanceAdministration1", namespace = "urn:hl7-org:v3", type = JAXBElement.class, required = false) protected JAXBElement<POCPMT060100UVSubstanceAdministration1> substanceAdministration1; @XmlAttribute(name = "nullFlavor") protected NullFlavor nullFlavor; @XmlAttribute(name = "typeCode") protected ParticipationConsumable typeCode; /** * Gets the value of the realmCode property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the realmCode property. * * <p> * For example, to add a new item, do as follows: * <pre> * getRealmCode().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link CS } * * */ public List<CS> getRealmCode() { if (realmCode == null) { realmCode = new ArrayList<CS>(); } return this.realmCode; } /** * Gets the value of the typeId property. * * @return * possible object is * {@link II } * */ public II getTypeId() { return typeId; } /** * Sets the value of the typeId property. * * @param value * allowed object is * {@link II } * */ public void setTypeId(II value) { this.typeId = value; } /** * Gets the value of the templateId property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the templateId property. * * <p> * For example, to add a new item, do as follows: * <pre> * getTemplateId().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link II } * * */ public List<II> getTemplateId() { if (templateId == null) { templateId = new ArrayList<II>(); } return this.templateId; } /** * Gets the value of the substanceAdministration property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link POCPMT010100UVSubstanceAdministration }{@code >} * */ public JAXBElement<POCPMT010100UVSubstanceAdministration> getSubstanceAdministration() { return substanceAdministration; } /** * Sets the value of the substanceAdministration property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link POCPMT010100UVSubstanceAdministration }{@code >} * */ public void setSubstanceAdministration(JAXBElement<POCPMT010100UVSubstanceAdministration> value) { this.substanceAdministration = value; } /** * Gets the value of the substanceAdministration1 property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link POCPMT060100UVSubstanceAdministration1 }{@code >} * */ public JAXBElement<POCPMT060100UVSubstanceAdministration1> getSubstanceAdministration1() { return substanceAdministration1; } /** * Sets the value of the substanceAdministration1 property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link POCPMT060100UVSubstanceAdministration1 }{@code >} * */ public void setSubstanceAdministration1(JAXBElement<POCPMT060100UVSubstanceAdministration1> value) { this.substanceAdministration1 = value; } /** * Gets the value of the nullFlavor property. * * @return * possible object is * {@link NullFlavor } * */ public NullFlavor getNullFlavor() { return nullFlavor; } /** * Sets the value of the nullFlavor property. * * @param value * allowed object is * {@link NullFlavor } * */ public void setNullFlavor(NullFlavor value) { this.nullFlavor = value; } /** * Gets the value of the typeCode property. * * @return * possible object is * {@link ParticipationConsumable } * */ public ParticipationConsumable getTypeCode() { if (typeCode == null) { return ParticipationConsumable.CSM; } else { return typeCode; } } /** * Sets the value of the typeCode property. * * @param value * allowed object is * {@link ParticipationConsumable } * */ public void setTypeCode(ParticipationConsumable value) { this.typeCode = value; } }
[ "ksingh@localhost.localdomain" ]
ksingh@localhost.localdomain
6cf19e03ea16cea8a067c941eaedc0edd60645a4
956bd15fc1da90c93985ba64f9f2c6fba6bfb32d
/src/com/android/launcher3/reflection/n.java
19615704c78b0947d462313cbf627cf14a50dafc
[ "Apache-2.0" ]
permissive
gkaffka/Launcher3
40ea01d693270694f4dba7903d926128aafb1fa0
81818f0138b0dc309ce5deac3bffe031b34b6d7d
refs/heads/compat
2020-09-09T06:07:17.063277
2017-06-14T20:20:18
2017-06-14T20:20:18
94,440,423
1
1
null
2017-06-15T13:08:11
2017-06-15T13:08:11
null
UTF-8
Java
false
false
345
java
package com.android.launcher3.reflection; public class n { static String generateRandomDeviceId() { final int n = 15; final StringBuilder sb = new StringBuilder(n); for (int i = 0; i < n; ++i) { sb.append(Integer.toHexString((int)(Math.random() * 16.0))); } return sb.toString(); } }
[ "azaidi@live.nl" ]
azaidi@live.nl
19efd5856bfc5d6ddb13b8d15342e9da83c9072a
5ec06dab1409d790496ce082dacb321392b32fe9
/clients/jaxrs-resteasy-eap/generated/src/gen/java/org/openapitools/model/OrgApacheSlingScriptingSightlyJsImplJsapiSlyBindingsValuesProvProperties.java
48bbef10bfc33e3c0ef45f2932dde19cfb18231f
[ "Apache-2.0" ]
permissive
shinesolutions/swagger-aem-osgi
e9d2385f44bee70e5bbdc0d577e99a9f2525266f
c2f6e076971d2592c1cbd3f70695c679e807396b
refs/heads/master
2022-10-29T13:07:40.422092
2021-04-09T07:46:03
2021-04-09T07:46:03
190,217,155
3
3
Apache-2.0
2022-10-05T03:26:20
2019-06-04T14:23:28
null
UTF-8
Java
false
false
2,565
java
package org.openapitools.model; import java.util.Objects; import java.util.ArrayList; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.ConfigNodePropertyArray; import javax.validation.constraints.*; import io.swagger.annotations.*; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaResteasyEapServerCodegen", date = "2019-08-05T01:00:05.540Z[GMT]") public class OrgApacheSlingScriptingSightlyJsImplJsapiSlyBindingsValuesProvProperties { private ConfigNodePropertyArray orgApacheSlingScriptingSightlyJsBindings = null; /** **/ @ApiModelProperty(value = "") @JsonProperty("org.apache.sling.scripting.sightly.js.bindings") public ConfigNodePropertyArray getOrgApacheSlingScriptingSightlyJsBindings() { return orgApacheSlingScriptingSightlyJsBindings; } public void setOrgApacheSlingScriptingSightlyJsBindings(ConfigNodePropertyArray orgApacheSlingScriptingSightlyJsBindings) { this.orgApacheSlingScriptingSightlyJsBindings = orgApacheSlingScriptingSightlyJsBindings; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } OrgApacheSlingScriptingSightlyJsImplJsapiSlyBindingsValuesProvProperties orgApacheSlingScriptingSightlyJsImplJsapiSlyBindingsValuesProvProperties = (OrgApacheSlingScriptingSightlyJsImplJsapiSlyBindingsValuesProvProperties) o; return Objects.equals(orgApacheSlingScriptingSightlyJsBindings, orgApacheSlingScriptingSightlyJsImplJsapiSlyBindingsValuesProvProperties.orgApacheSlingScriptingSightlyJsBindings); } @Override public int hashCode() { return Objects.hash(orgApacheSlingScriptingSightlyJsBindings); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class OrgApacheSlingScriptingSightlyJsImplJsapiSlyBindingsValuesProvProperties {\n"); sb.append(" orgApacheSlingScriptingSightlyJsBindings: ").append(toIndentedString(orgApacheSlingScriptingSightlyJsBindings)).append("\n"); sb.append("}"); return sb.toString(); } /** * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ private String toIndentedString(Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } }
[ "cliffano@gmail.com" ]
cliffano@gmail.com
df2d3075f757c7ebbc81f032d0e2eec212053725
623eb284a6f7361441c57942b1c7a416112d293b
/src/main/java/ru/geekbrains/spring/ishop/control/admin/AdminOrderController.java
724e049f83315ad8a199e41a2234de235ae5f70a
[ "MIT" ]
permissive
iourilitv/java-getting-started
b3b43e435a38c63434c06e705b64d024f77b45f7
4e2b87e5648f1f9cc549e2603583d2bd2f2bb92b
refs/heads/master
2022-12-04T15:43:48.110691
2020-08-26T16:19:07
2020-08-26T16:19:07
288,490,534
0
0
null
null
null
null
UTF-8
Java
false
false
6,292
java
package ru.geekbrains.spring.ishop.control.admin; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.ui.ModelMap; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.*; import org.springframework.web.servlet.view.RedirectView; import ru.geekbrains.spring.ishop.entity.Order; import ru.geekbrains.spring.ishop.entity.OrderStatus; import ru.geekbrains.spring.ishop.informing.subjects.OrderSubject; import ru.geekbrains.spring.ishop.service.CategoryService; import ru.geekbrains.spring.ishop.service.OrderService; import ru.geekbrains.spring.ishop.informing.TextTemplates; import ru.geekbrains.spring.ishop.utils.SystemDelivery; import ru.geekbrains.spring.ishop.utils.SystemOrder; import ru.geekbrains.spring.ishop.utils.filters.OrderFilter; import javax.servlet.http.HttpSession; import javax.validation.Valid; import java.util.Map; @Controller @RequestMapping("/admin/order") public class AdminOrderController { private final CategoryService categoryService; private final OrderService orderService; private final OrderFilter orderFilter; private final OrderSubject orderSubject; @Autowired public AdminOrderController(CategoryService categoryService, OrderService orderService, OrderFilter orderFilter, OrderSubject orderSubject) { this.categoryService = categoryService; this.orderService = orderService; this.orderFilter = orderFilter; this.orderSubject = orderSubject; } @GetMapping public String sectionRoot() { return "redirect:/admin/order/all"; } @GetMapping("/all") public String showAll(@RequestParam Map<String, String> params, Model model, HttpSession session) { //удаляем атрибут заказа session.removeAttribute("order"); //инициируем настройки фильтра - админ режим orderFilter.init(params, ""); //получаем объект страницы с применением фильтра //TODO created_at -> константы Page<Order> page = orderService.findAll(orderFilter,"createdAt"); //передаем в .html атрибуты: //часть строки запроса с параметрами фильтра model.addAttribute("filterDef", orderFilter.getFilterDefinition()); //коллекцию категорий categoryService.addToModelAttributeCategories(model); //объект страницы заказов model.addAttribute("page", page); //активную страницу model.addAttribute("activePage", "Profile"); //коллекцию статусов заказа model.addAttribute("orderStatuses", orderService.findAllOrderStatuses()); return "amin/admin/orders-list"; } @GetMapping("/show/{order_id}/order_id") public String showOrderDetails(@PathVariable Long order_id, ModelMap model, HttpSession session){ SystemOrder systemOrder = orderService.getSystemOrderForSession(session, order_id); model.addAttribute("order", systemOrder); model.addAttribute("delivery", systemOrder.getSystemDelivery()); return "amin/admin/order-info"; } @GetMapping("/edit/{order_id}/order_id") public String editOrder(@PathVariable Long order_id, Model model, HttpSession session) { SystemOrder systemOrder = orderService.getSystemOrderForSession(session, order_id); model.addAttribute("order", systemOrder); model.addAttribute("orderStatuses", orderService.findAllOrderStatuses()); model.addAttribute("orderStatus", systemOrder.getOrderStatus()); model.addAttribute("delivery", systemOrder.getSystemDelivery()); return "amin/admin/order-form"; } @GetMapping("/delete/{order_id}/order_id") public RedirectView removeOrder(@PathVariable("order_id") Long orderId) { orderService.delete(orderId); return new RedirectView("/amin/admin/order/all"); } @GetMapping("/cancel/{order_id}/order_id") public RedirectView cancelOrder(@PathVariable("order_id") Long orderId) { orderService.cancelOrder(orderId); //send email to the user orderSubject.requestToSendMessage(orderService.findById(orderId), TextTemplates.SUBJECT_ORDER_STATUS_CHANGED); return new RedirectView("/amin/admin/order/all"); } @PostMapping("/process/update/orderStatus") public RedirectView processUpdateOrderStatus(@Valid @ModelAttribute("orderStatus") OrderStatus orderStatus, BindingResult theBindingResult, HttpSession session) { SystemOrder systemOrder = (SystemOrder) session.getAttribute("order"); if (!theBindingResult.hasErrors()) { Order order = orderService.updateOrderStatus(systemOrder, orderStatus); systemOrder.setOrderStatus(order.getOrderStatus()); //send email to the user orderSubject.requestToSendMessage(order, TextTemplates.SUBJECT_ORDER_STATUS_CHANGED); } return new RedirectView("/amin/admin/order/edit/" + systemOrder.getId() + "/order_id"); } @PostMapping("/process/update/delivery") public RedirectView processUpdateDelivery(@Valid @ModelAttribute("delivery") SystemDelivery systemDelivery, BindingResult theBindingResult, HttpSession session) { SystemOrder systemOrder = (SystemOrder) session.getAttribute("order"); if (!theBindingResult.hasErrors()) { systemOrder.setSystemDelivery(systemDelivery); //сохраняем изменение в БД orderService.updateDelivery(systemOrder); } return new RedirectView("/amin/admin/order/edit/" + systemOrder.getId() + "/order_id"); } }
[ "iourilitv1965@gmail.com" ]
iourilitv1965@gmail.com
a8bb327e7b5e8750e43c9db3083467bad55d5296
84e0ea9248ab64c16a6f09a042ede468b6fef27c
/AmazeShoppy/src/main/java/com/niit/product/Product.java
cbedd30fb8d912362cf3fe52ef7ead7133cef727
[]
no_license
AnushaReddy11/-AmazeShoppy-
692a389b3644c19483e0a43141907c5fd6c92492
53ae6fde3f9dc8f79f4215258401257a56e7970e
refs/heads/master
2020-03-28T16:53:27.148051
2018-09-14T05:06:20
2018-09-14T05:06:20
148,737,800
0
0
null
null
null
null
UTF-8
Java
false
false
1,914
java
package com.niit.product; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.ManyToOne; import javax.persistence.Transient; //import javax.persistence.Transient; import javax.validation.constraints.Min; import org.hibernate.validator.constraints.NotEmpty; import org.springframework.web.multipart.MultipartFile; @Entity public class Product { @Id @GeneratedValue(strategy=GenerationType.AUTO) private int id; @NotEmpty(message="product name cannot be empty") private String productName; @NotEmpty(message="product description cannot be empty") private String productDesc; @Min(value=1,message="quantity should be greater than or equal to one") private int quantity; @Min(value=10,message="price should be greater or equal to ten") private double price; @ManyToOne private Category category; @Transient private MultipartFile image; public MultipartFile getImage() { return image; } public void setImage(MultipartFile image) { this.image = image; } public Category getCategory() { return category; } public void setCategory(Category category) { this.category = category; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getProductName() { return productName; } public void setProductName(String productName) { this.productName = productName; } public String getProductDesc() { return productDesc; } public void setProductDesc(String productDesc) { this.productDesc = productDesc; } public int getQuantity() { return quantity; } public void setQuantity(int quantity) { this.quantity = quantity; } public double getPrice() { return price; } public void setPrice(double price) { this.price = price; } }
[ "admin@admin-PC" ]
admin@admin-PC
7cbdbe7ace20fd504c6b11974d45598541aeb4db
1721c1e45201b0c6ae5c81d9bdd69ea6cfb76dfe
/turms-server-common/src/main/java/im/turms/server/common/rpc/request/SendNotificationRequest.java
85baf1f945a8465a4df3ca35853df179bbe586af
[ "Apache-2.0" ]
permissive
foundations/turms
aa677206b2c8256cfe66347059c311fe7bcab1dd
f08e1ec0d14a470f49a335988f0abe5f9b9244d6
refs/heads/master
2023-08-07T03:29:44.848472
2021-09-01T10:59:46
2021-09-01T11:18:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,986
java
/* * Copyright (C) 2019 The Turms Project * https://github.com/turms-im/turms * * 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 im.turms.server.common.rpc.request; import im.turms.server.common.cluster.service.rpc.NodeTypeToHandleRpc; import im.turms.server.common.cluster.service.rpc.dto.RpcRequest; import im.turms.server.common.rpc.service.IOutboundMessageService; import io.netty.buffer.ByteBuf; import lombok.Data; import org.springframework.context.ApplicationContext; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; import java.util.Set; /** * @author James Chen */ @Data public class SendNotificationRequest extends RpcRequest<Boolean> { private static final String NAME = "sendNotification"; private static IOutboundMessageService outboundMessageService; private final ByteBuf notificationBuffer; private final Set<Long> recipientIds; /** * @param notificationBuffer should be a direct byte buffer of TurmsNotification */ public SendNotificationRequest(@NotNull ByteBuf notificationBuffer, @NotEmpty Set<Long> recipientIds) { this.notificationBuffer = notificationBuffer; this.recipientIds = recipientIds; } @Override public String name() { return NAME; } @Override public NodeTypeToHandleRpc nodeTypeToRequest() { return NodeTypeToHandleRpc.SERVICE; } @Override public NodeTypeToHandleRpc nodeTypeToRespond() { return NodeTypeToHandleRpc.GATEWAY; } @Override public boolean isAsync() { return false; } @Override public void setApplicationContext(ApplicationContext applicationContext) { super.setApplicationContext(applicationContext); if (outboundMessageService == null) { outboundMessageService = getBean(IOutboundMessageService.class); } } /** * @return true if the notification has forwarded to one recipient at least */ @Override public Boolean call() { return outboundMessageService.sendNotificationToLocalClients(getTracingContext(), notificationBuffer, recipientIds); } @Override public void retainBoundBuffer() { notificationBuffer.retain(); } @Override public void releaseBoundBuffer() { notificationBuffer.release(); } @Override public void touchBuffer(Object hint) { notificationBuffer.touch(hint); } }
[ "eurekajameschen@gmail.com" ]
eurekajameschen@gmail.com
78f4a2f047f1754813793a0e8aa583b63fba9a9f
d2d057614389e1f3156f21e83477b91bcebec71e
/demos/Eclipse/AppIntentDemo2/src/com/example/appintentdemo2/App.java
dbfc5b87ca3ee525cadf08167c714ccff0037bf0
[]
no_license
homelee/lazandroidmodulewizard
bd89504f6719feb45d6d11f17250a7430c9eabc4
73cd9a6e599058a4ee8101358ec7375c0ccfae4c
refs/heads/master
2021-01-17T12:18:12.381513
2015-05-23T05:58:24
2015-05-23T05:58:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,331
java
package com.example.appintentdemo2; //Lamw: Lazarus Android Module Wizard - Version 0.6 - rev. 25 - 14 May - 2015 //Form Designer and Components development model! //Author: jmpessoa@hotmail.com //https://github.com/jmpessoa/lazandroidmodulewizard //http://forum.lazarus.freepascal.org/index.php/topic,21919.270.html //Android Java Interface for Pascal/Delphi XE5 //And LAZARUS by jmpessoa@hotmail.com - december 2013 //Developers // Simon,Choi / Choi,Won-sik // simonsayz@naver.com // http://blog.naver.com/simonsayz // // LoadMan / Jang,Yang-Ho // wkddidgh@naver.com // http://blog.naver.com/wkddidgh // JMPessoa / josemarquespessoa@gmail.com import java.lang.Override; import android.app.Activity; import android.content.Intent; import android.content.res.Configuration; import android.content.pm.ActivityInfo; import android.widget.RelativeLayout; import android.view.ContextMenu; import android.view.ContextMenu.ContextMenuInfo; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.WindowManager; //import android.view.View; import android.os.Bundle; import android.os.StrictMode; import android.util.Log; // http://stackoverflow.com/questions/16282294/show-title-bar-from-code public class App extends Activity { private Controls controls; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //by jmpessoa --- fix for http get //ref. http://stackoverflow.com/questions/8706464/defaulthttpclient-to-androidhttpclient if (android.os.Build.VERSION.SDK_INT > 9) { StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); StrictMode.setThreadPolicy(policy); } //Log.i("jApp","01.Activity.onCreate"); controls = new Controls(); controls.activity = this; controls.appLayout = new RelativeLayout(this); controls.appLayout.getRootView().setBackgroundColor (0x00FFFFFF); controls.screenStyle = controls.jAppOnScreenStyle(); switch( controls.screenStyle ) { case 1 : this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT ); break; case 2 : this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); break; default : ; // Device Default , Rotation by Device } this.setContentView(controls.appLayout); this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN); // Event : Java -> Pascal //Log.i("jApp","02.Controls.jAppOnCreate"); controls.jAppOnCreate(this, controls.appLayout); } @Override protected void onNewIntent(Intent intent) { super.onNewIntent(intent); controls.jAppOnNewIntent(); } @Override protected void onDestroy() { super.onDestroy(); controls.jAppOnDestroy(); } @Override protected void onPause() { super.onPause(); //Log.i("jApp","onPause"); controls.jAppOnPause(); } @Override protected void onRestart() { super.onRestart(); //Log.i("jApp","onRestart"); controls.jAppOnRestart(); } @Override protected void onResume() { super.onResume(); controls.jAppOnResume(); } @Override protected void onStart() { super.onStart(); //Log.i("jApp","onStart"); controls.jAppOnStart(); } @Override protected void onStop() { super.onStop(); controls.jAppOnStop(); } @Override public void onBackPressed() { controls.jAppOnBackPressed(); } @Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); controls.jAppOnRotate(newConfig.orientation); controls.jAppOnConfigurationChanged(); } @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { controls.jAppOnActivityResult(requestCode,resultCode,data); } //by jmpessoa: option menu support @Override public boolean onCreateOptionsMenu(Menu menu) { controls.jAppOnCreateOptionsMenu(menu); return true; } /*by jmpessoa: Handles menu item selections */ @Override public boolean onOptionsItemSelected(MenuItem item) { String caption = item.getTitle().toString(); controls.jAppOnClickOptionMenuItem(item, item.getItemId(), caption, item.isChecked()); return false; } //by jmpessoa: context menu support - Context menu items do not support icons! @Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { super.onCreateContextMenu(menu, v, menuInfo); Log.i("App.Java_onCreateContextMenu", "long_pressed!"); controls.jAppOnCreateContextMenu(menu); } /*by jmpessoa: Handles menu item selections*/ @Override public boolean onContextItemSelected(MenuItem item) { String caption = item.getTitle().toString(); controls.jAppOnClickContextMenuItem(item, item.getItemId(), caption, item.isChecked()); return false; } /*by jmpessoa: TODO :Handles prepare menu item*/ @Override public boolean onPrepareOptionsMenu(Menu menu) { super.onPrepareOptionsMenu(menu); //TODO!!!! return true; } /*by jmpessoa: TODO :Handles opened menu */ @Override public boolean onMenuOpened(int featureId, Menu menu) { //TODO!!!! return super.onMenuOpened(featureId, menu); } }
[ "jmpessoa_hotmail.com" ]
jmpessoa_hotmail.com
dabc9b4adabe9654907909dda16555f07e1670f7
d3679002d911a2b4e62e9270be387e7da099f81c
/src/p06/lecture/p4method/A02Variables.java
4e50525c69a81c2bff412237b24243d2f506e383
[]
no_license
dailydevp/java20210325
3fb3315fbbba31b914959c32b51eaf4d12d52883
7c022fc6f194de3b5e876b2e74c61bbd2b33f702
refs/heads/master
2023-04-23T00:36:19.028568
2021-05-04T12:52:35
2021-05-04T12:52:35
351,269,342
1
0
null
null
null
null
UTF-8
Java
false
false
308
java
package p06.lecture.p4method; public class A02Variables { public static void main(String[] args) { MyClass2 c1 = new MyClass2(); c1.method1(10); MyClass2 c2 = new MyClass2(); c2.method1(20); System.out.println("변경 후"); c1.a = 999; c2.a = 888; c1.method1(11); c2.method1(12); } }
[ "hyde8547@naver.com" ]
hyde8547@naver.com
b63be3668131564da019019f35e745265dcb91f4
da1a5448157b9d3480292ed2a27b6d0c2fb3333d
/fxgl-samples/src/main/java/s09advanced/DSLSample.java
0dc86b58002425a9aa3b25b9130e652d193e320e
[ "MIT" ]
permissive
CRY-D/FXGL
afc7df99f3b837e32d8fac4cba405e77c95c1328
312be9de5165873166cb5cbdf692284b2257b595
refs/heads/master
2021-09-28T22:01:41.644010
2018-11-05T16:45:56
2018-11-05T16:45:56
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,112
java
/* * FXGL - JavaFX Game Library. The MIT License (MIT). * Copyright (c) AlmasB (almaslvl@gmail.com). * See LICENSE for details. */ package s09advanced; import com.almasb.fxgl.app.GameApplication; import com.almasb.fxgl.settings.GameSettings; import java.util.Map; import static com.almasb.fxgl.app.DSLKt.geti; import static com.almasb.fxgl.app.DSLKt.set; /** * This is an example of a FXGL app using DSL. * * @author Almas Baimagambetov (AlmasB) (almaslvl@gmail.com) */ public class DSLSample extends GameApplication { @Override protected void initSettings(GameSettings settings) { settings.setWidth(800); settings.setHeight(600); settings.setTitle("DSLSample"); settings.setVersion("0.1"); } @Override protected void initGameVars(Map<String, Object> vars) { vars.put("score", 100); } @Override protected void initGame() { System.out.println(geti("score")); set("score", 300); System.out.println(geti("score")); } public static void main(String[] args) { launch(args); } }
[ "almaslvl@gmail.com" ]
almaslvl@gmail.com
ee0c35a98b49bbb2a20c6368c34fa5e13675bb45
d2f840933180c4041f5c103c041909366464661e
/app/src/main/java/net/coding/mart/common/local/FileHelp.java
73d6c9085f193b8894d900870cdd271f5b08cd60
[ "MIT" ]
permissive
fenildf/Mart-Android
1374928522e1bcd579d05c60e5104ab33b133c7a
150e5d9c47d6c20ae114728115ebd6537b8bba2d
refs/heads/master
2020-03-27T14:47:35.462253
2018-05-21T10:22:05
2018-05-21T10:22:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,271
java
package net.coding.mart.common.local; import net.coding.mart.R; import java.io.Serializable; /** * Created by chenchao on 2016/12/7. * 帮助管理本地文件 */ public class FileHelp implements Serializable { private static final long serialVersionUID = 6580808605439769802L; private static String DIV = "|#|"; private static String DIV_NO_REG = "\\|\\#\\|"; public String name = ""; public int rewardId; public String rewardName = ""; public String urlName = ""; public String suffix = ""; public boolean checked; public FileHelp() { } public FileHelp(String localFileName) { String[] s = localFileName.split(DIV_NO_REG); if (s.length == 4) { rewardId = Integer.valueOf(s[0]); rewardName = s[1]; urlName = s[2]; int pointIndex = s[3].lastIndexOf("."); if (pointIndex != -1) { name = s[3].substring(0, pointIndex); suffix = s[3].substring(pointIndex + 1); } else { name = s[3]; suffix = ""; } } } public FileHelp(int rewardId, String rewardName, String name, String url) { this.rewardId = rewardId; this.rewardName = rewardName; this.name = name; int lastDivide = url.lastIndexOf("/"); if (lastDivide != -1) { String urlNameContainerSuffix = url.substring(lastDivide + 1); int posintIndex = urlNameContainerSuffix.lastIndexOf("."); if (posintIndex != -1) { urlName = urlNameContainerSuffix.substring(0, posintIndex); suffix = urlNameContainerSuffix.substring(posintIndex + 1); } } } public boolean isEmpty() { return rewardId == 0; } public String getLocalFileName() { return String.format("%s%s%s%s%s%s%s.%s", rewardId, DIV, rewardName, DIV, urlName, DIV, name, suffix); } public int getTypeImage() { return R.mipmap.ic_file_docx; } public String getNameContainSuffix() { return name + "." + suffix; } public int getCheckImage() { return checked ? R.mipmap.local_file_check : R.mipmap.local_file_check_not; } }
[ "8206503@qq.com" ]
8206503@qq.com
c89fb2660c2891ff1cb2f205398f29a158d21a84
1dca714bd101ccdeb8b70a3f3289f846810cedd5
/main/java/com/ruoyi/datasync/service/impl/HighVoltageServiceImpl.java
1b2cbb96eefd68c5e5d06e08c4afba1765c82035
[]
no_license
glf134/ruoyi
a2e1ca782b5337b18bc84390b424d4efd3e31909
d0a08cc0bc53d87d008e6bb35f71d7fa3de2a6fa
refs/heads/master
2023-04-10T18:48:37.453508
2021-04-18T06:16:05
2021-04-18T06:16:05
359,041,648
0
0
null
null
null
null
UTF-8
Java
false
false
2,437
java
package com.ruoyi.datasync.service.impl; import java.util.List; import com.ruoyi.common.utils.DateUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.datasync.mapper.HighVoltageMapper; import com.ruoyi.datasync.domain.HighVoltage; import com.ruoyi.datasync.service.IHighVoltageService; import com.ruoyi.common.core.text.Convert; /** * 高压配电设备Service业务层处理 * * @author ruoyi * @date 2021-04-18 */ @Service public class HighVoltageServiceImpl implements IHighVoltageService { @Autowired private HighVoltageMapper highVoltageMapper; /** * 查询高压配电设备 * * @param id 高压配电设备ID * @return 高压配电设备 */ @Override public HighVoltage selectHighVoltageById(Long id) { return highVoltageMapper.selectHighVoltageById(id); } /** * 查询高压配电设备列表 * * @param highVoltage 高压配电设备 * @return 高压配电设备 */ @Override public List<HighVoltage> selectHighVoltageList(HighVoltage highVoltage) { return highVoltageMapper.selectHighVoltageList(highVoltage); } /** * 新增高压配电设备 * * @param highVoltage 高压配电设备 * @return 结果 */ @Override public int insertHighVoltage(HighVoltage highVoltage) { highVoltage.setCreateTime(DateUtils.getNowDate()); return highVoltageMapper.insertHighVoltage(highVoltage); } /** * 修改高压配电设备 * * @param highVoltage 高压配电设备 * @return 结果 */ @Override public int updateHighVoltage(HighVoltage highVoltage) { highVoltage.setUpdateTime(DateUtils.getNowDate()); return highVoltageMapper.updateHighVoltage(highVoltage); } /** * 删除高压配电设备对象 * * @param ids 需要删除的数据ID * @return 结果 */ @Override public int deleteHighVoltageByIds(String ids) { return highVoltageMapper.deleteHighVoltageByIds(Convert.toStrArray(ids)); } /** * 删除高压配电设备信息 * * @param id 高压配电设备ID * @return 结果 */ @Override public int deleteHighVoltageById(Long id) { return highVoltageMapper.deleteHighVoltageById(id); } }
[ "1347665919@qq.com" ]
1347665919@qq.com
2404b24b54db003eef8af85df0714c406e25f41f
67645a19de3c7ffc2d793f9a8eb58c0ef7caab73
/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatWindowMaximizeIcon.java
f95f379dd2fa85c998af2899d4d5185842dd6ce1
[ "Apache-2.0" ]
permissive
JFormDesigner/FlatLaf
0e649a0e4b38ebf78b51151590b5b66a5558df5e
cdee0594f83ccc0ba4647b6c2fa759cb778160b3
refs/heads/main
2023-08-31T21:29:20.402127
2023-08-27T14:30:16
2023-08-27T14:30:16
203,150,729
2,700
276
Apache-2.0
2023-09-01T16:07:49
2019-08-19T10:27:05
Java
UTF-8
Java
false
false
1,668
java
/* * Copyright 2020 FormDev Software GmbH * * 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 com.formdev.flatlaf.icons; import java.awt.Graphics2D; import com.formdev.flatlaf.ui.FlatUIUtils; import com.formdev.flatlaf.util.SystemInfo; /** * "maximize" icon for windows (frames and dialogs). * * @author Karl Tauber */ public class FlatWindowMaximizeIcon extends FlatWindowAbstractIcon { public FlatWindowMaximizeIcon() { this( null ); } /** @since 3.2 */ public FlatWindowMaximizeIcon( String windowStyle ) { super( windowStyle ); } @Override protected void paintIconAt1x( Graphics2D g, int x, int y, int width, int height, double scaleFactor ) { int iwh = (int) (getSymbolHeight() * scaleFactor); int ix = x + ((width - iwh) / 2); int iy = y + ((height - iwh) / 2); float thickness = SystemInfo.isWindows_11_orLater ? (float) scaleFactor : (int) scaleFactor; int arc = Math.max( (int) (1.5 * scaleFactor), 2 ); g.fill( SystemInfo.isWindows_11_orLater ? FlatUIUtils.createRoundRectangle( ix, iy, iwh, iwh, thickness, arc, arc, arc, arc ) : FlatUIUtils.createRectangle( ix, iy, iwh, iwh, thickness ) ); } }
[ "karl@jformdesigner.com" ]
karl@jformdesigner.com
15a6d8dcb9da568db046f88be0dee36f7b6adf3f
e8cd24201cbfadef0f267151ea5b8a90cc505766
/group12/247565311/structure/week1/Queue.java
38f0ab264e2fdd7fbe2d2e9e11207be7cc55a28d
[]
no_license
XMT-CN/coding2017-s1
30dd4ee886dd0a021498108353c20360148a6065
382f6bfeeeda2e76ffe27b440df4f328f9eafbe2
refs/heads/master
2021-01-21T21:38:42.199253
2017-06-25T07:44:21
2017-06-25T07:44:21
94,863,023
0
0
null
null
null
null
UTF-8
Java
false
false
441
java
package structure.week1; public class Queue<E> { private LinkedList<E> data = new LinkedList<E>(); public void enQueue(E arg0){ data.add(data.size(),arg0); } public E deQueue(){ E res = data.get(0); data.remove(0); return res; } public int size(){ return data.size(); } public boolean isEmpty(){ return data.isEmpty(); } }
[ "542194147@qq.com" ]
542194147@qq.com
2c2e9b3f39b5e3414020dfaa7c161bb666087707
fe00b7236a8fcd0817420f5e2106a145324fdd1e
/source-diy-mybatis-test/src/main/java/cn/javadog/sd/mybatis/example/domain/ImmutableAuthor.java
0c362fc6595c45d4852e8215314ea9f17b7212c1
[]
no_license
yuyong725/source-diy-mybatis
a0eefaded34aae24c9b9193bed0b7d8a04fed1ce
15f0a93eead4e6dd5e02051212afb28572a9b579
refs/heads/master
2020-11-27T09:15:00.609224
2020-11-20T10:24:32
2020-11-20T10:24:32
229,382,296
0
0
null
2020-11-20T10:24:33
2019-12-21T05:41:15
Java
UTF-8
Java
false
false
2,253
java
package cn.javadog.sd.mybatis.example.domain; import java.io.Serializable; public class ImmutableAuthor implements Serializable { protected final int id; protected final String username; protected final String password; protected final String email; protected final String bio; protected final Section favouriteSection; public ImmutableAuthor(int id, String username, String password, String email, String bio, Section section) { this.id = id; this.username = username; this.password = password; this.email = email; this.bio = bio; this.favouriteSection = section; } public int getId() { return id; } public String getUsername() { return username; } public String getPassword() { return password; } public String getEmail() { return email; } public String getBio() { return bio; } public Section getFavouriteSection() { return favouriteSection; } @Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof Author)) return false; Author author = (Author) o; if (id != author.id) return false; if (bio != null ? !bio.equals(author.bio) : author.bio != null) return false; if (email != null ? !email.equals(author.email) : author.email != null) return false; if (password != null ? !password.equals(author.password) : author.password != null) return false; if (username != null ? !username.equals(author.username) : author.username != null) return false; if (favouriteSection != null ? !favouriteSection.equals(author.favouriteSection) : author.favouriteSection != null) return false; return true; } @Override public int hashCode() { int result; result = id; result = 31 * result + (username != null ? username.hashCode() : 0); result = 31 * result + (password != null ? password.hashCode() : 0); result = 31 * result + (email != null ? email.hashCode() : 0); result = 31 * result + (bio != null ? bio.hashCode() : 0); result = 31 * result + (favouriteSection != null ? favouriteSection.hashCode() : 0); return result; } @Override public String toString() { return id + " " + username + " " + password + " " + email; } }
[ "yuyong_material@163.com" ]
yuyong_material@163.com
6f40a3a58b53a0b5d543f1cd16523320703ee6b4
58c00bf811d02379aef98b6da0bdc7ff27728145
/JAVA/src/matera/jooq/tables/pojos/Caja.java
70df8837f69a88409e497fbc62cbc47c574fb361
[]
no_license
tinchogava/Matera
9e39ad2deb5da7f61be6854e54afb49c933fc87a
63b0f60c65af0293d6384837d03116d588996370
refs/heads/master
2021-05-05T22:30:17.306179
2018-01-03T16:06:00
2018-01-03T16:06:00
116,151,161
0
0
null
null
null
null
UTF-8
Java
false
false
1,831
java
/** * This class is generated by jOOQ */ package matera.jooq.tables.pojos; import java.io.Serializable; import javax.annotation.Generated; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; /** * This class is generated by jOOQ. */ @Generated( value = { "http://www.jooq.org", "jOOQ version:3.7.2" }, comments = "This class is generated by jOOQ" ) @SuppressWarnings({ "all", "unchecked", "rawtypes" }) @Entity @Table(name = "caja", schema = "matera") public class Caja implements Serializable { private static final long serialVersionUID = 1906525365; private Integer idCaja; private String nombre; private String habilita; public Caja() {} public Caja(Caja value) { this.idCaja = value.idCaja; this.nombre = value.nombre; this.habilita = value.habilita; } public Caja( Integer idCaja, String nombre, String habilita ) { this.idCaja = idCaja; this.nombre = nombre; this.habilita = habilita; } @Id @Column(name = "id_caja", unique = true, nullable = false, precision = 10) public Integer getIdCaja() { return this.idCaja; } public void setIdCaja(Integer idCaja) { this.idCaja = idCaja; } @Column(name = "nombre", nullable = false, length = 45) public String getNombre() { return this.nombre; } public void setNombre(String nombre) { this.nombre = nombre; } @Column(name = "habilita", nullable = false, length = 1) public String getHabilita() { return this.habilita; } public void setHabilita(String habilita) { this.habilita = habilita; } @Override public String toString() { StringBuilder sb = new StringBuilder("Caja ("); sb.append(idCaja); sb.append(", ").append(nombre); sb.append(", ").append(habilita); sb.append(")"); return sb.toString(); } }
[ "tinchogava@gmail.com" ]
tinchogava@gmail.com
799f3eab1a29ec74ff7fe7c438e55bbff5dec0a2
e9ad297da7d998ac7f5e746db0f7b51df6a0db01
/Kripton/src/test/java/bind/kripton109/animations/KeyFrameBindMap.java
524510641757e722d344a4310f864fe95e24c269
[ "Apache-2.0" ]
permissive
luizdefranca/kripton
1211e1ca722455166a6653d7adaaba0c2b8fd2f6
dac2d849c247cb80bc80d73ad69b5ab20ace4f6b
refs/heads/master
2020-12-30T14:13:00.357953
2017-05-10T23:41:32
2017-05-10T23:41:32
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,788
java
package bind.kripton109.animations; import com.abubusoft.kripton.AbstractMapper; import com.abubusoft.kripton.annotation.BindMap; import com.abubusoft.kripton.common.PrimitiveUtils; import com.abubusoft.kripton.escape.StringEscapeUtils; import com.abubusoft.kripton.xml.XMLParser; import com.abubusoft.kripton.xml.XMLSerializer; import com.abubusoft.kripton.xml.XmlPullParser; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonToken; import java.lang.Exception; import java.lang.Override; /** * This class is binder map for KeyFrame * * @see KeyFrame */ @BindMap(KeyFrame.class) public class KeyFrameBindMap extends AbstractMapper<KeyFrame> { @Override public int serializeOnJackson(KeyFrame object, JsonGenerator jacksonSerializer) throws Exception { jacksonSerializer.writeStartObject(); int fieldCount=0; // Serialized Field: // field name (mapped with "name") if (object.name!=null) { fieldCount++; jacksonSerializer.writeStringField("name", object.name); } // field duration (mapped with "duration") fieldCount++; jacksonSerializer.writeNumberField("duration", object.duration); jacksonSerializer.writeEndObject(); return fieldCount; } @Override public int serializeOnJacksonAsString(KeyFrame object, JsonGenerator jacksonSerializer) throws Exception { jacksonSerializer.writeStartObject(); int fieldCount=0; // Serialized Field: // field name (mapped with "name") if (object.name!=null) { fieldCount++; jacksonSerializer.writeStringField("name", object.name); } // field duration (mapped with "duration") jacksonSerializer.writeStringField("duration", PrimitiveUtils.writeLong(object.duration)); jacksonSerializer.writeEndObject(); return fieldCount; } /** * method for xml serialization */ @Override public void serializeOnXml(KeyFrame object, XMLSerializer xmlSerializer, int currentEventType) throws Exception { if (currentEventType == 0) { xmlSerializer.writeStartElement("keyFrame"); } // Persisted fields: // field name (mapped with "name") if (object.name!=null) { xmlSerializer.writeAttribute("name", StringEscapeUtils.escapeXml10(object.name)); } // field duration (mapped with "duration") xmlSerializer.writeAttribute("duration", PrimitiveUtils.writeLong(object.duration)); if (currentEventType == 0) { xmlSerializer.writeEndElement(); } } /** * parse with jackson */ @Override public KeyFrame parseOnJackson(JsonParser jacksonParser) throws Exception { KeyFrame instance = new KeyFrame(); String fieldName; if (jacksonParser.currentToken() == null) { jacksonParser.nextToken(); } if (jacksonParser.currentToken() != JsonToken.START_OBJECT) { jacksonParser.skipChildren(); return instance; } while (jacksonParser.nextToken() != JsonToken.END_OBJECT) { fieldName = jacksonParser.getCurrentName(); jacksonParser.nextToken(); // Parse fields: switch (fieldName) { case "name": // field name (mapped with "name") if (jacksonParser.currentToken()!=JsonToken.VALUE_NULL) { instance.name=jacksonParser.getText(); } break; case "duration": // field duration (mapped with "duration") instance.duration=jacksonParser.getLongValue(); break; default: jacksonParser.skipChildren(); break;} } return instance; } /** * parse with jackson */ @Override public KeyFrame parseOnJacksonAsString(JsonParser jacksonParser) throws Exception { KeyFrame instance = new KeyFrame(); String fieldName; if (jacksonParser.getCurrentToken() == null) { jacksonParser.nextToken(); } if (jacksonParser.getCurrentToken() != JsonToken.START_OBJECT) { jacksonParser.skipChildren(); return instance; } while (jacksonParser.nextToken() != JsonToken.END_OBJECT) { fieldName = jacksonParser.getCurrentName(); jacksonParser.nextToken(); // Parse fields: switch (fieldName) { case "name": // field name (mapped with "name") if (jacksonParser.currentToken()!=JsonToken.VALUE_NULL) { instance.name=jacksonParser.getText(); } break; case "duration": // field duration (mapped with "duration") instance.duration=PrimitiveUtils.readLong(jacksonParser.getText(), 0L); break; default: jacksonParser.skipChildren(); break;} } return instance; } /** * parse xml */ @Override public KeyFrame parseOnXml(XMLParser xmlParser, int currentEventType) throws Exception { KeyFrame instance = new KeyFrame(); int eventType = currentEventType; boolean read=true; if (currentEventType == 0) { eventType = xmlParser.next(); } else { eventType = xmlParser.getEventType(); } String currentTag = xmlParser.getName().toString(); String elementName = currentTag; // attributes String attributeName = null; int attributesCount = xmlParser.getAttributeCount();; for (int attributeIndex = 0; attributeIndex < attributesCount; attributeIndex++) { attributeName = xmlParser.getAttributeName(attributeIndex); switch(attributeName) { case "name": // field name (mapped by "name") instance.name=StringEscapeUtils.unescapeXml(xmlParser.getAttributeValue(attributeIndex)); break; case "duration": // field duration (mapped by "duration") instance.duration=PrimitiveUtils.readLong(xmlParser.getAttributeValue(attributeIndex), 0L); break; default: break; } } //sub-elements while (xmlParser.hasNext() && elementName!=null) { if (read) { eventType = xmlParser.next(); } else { eventType = xmlParser.getEventType(); } read=true; switch(eventType) { case XmlPullParser.START_TAG: currentTag = xmlParser.getName().toString(); // No property to manage here break; case XmlPullParser.END_TAG: if (elementName.equals(xmlParser.getName())) { currentTag = elementName; elementName = null; } break; case XmlPullParser.CDSECT: case XmlPullParser.TEXT: // no property is binded to VALUE o CDATA break; default: break; } } return instance; } }
[ "abubusoft@gmail.com" ]
abubusoft@gmail.com
a44fa82af34b95b40e83c295b9352d4727b1a107
587412cb62938496e6ff1fbc706a852f7deb0243
/src/test/java/org/xblackcat/sjpu/storage/workflow/batched/IDataAH.java
b62311d71812e2a9839e5dc6210e5c78c675ab5f
[ "Apache-2.0" ]
permissive
xBlackCat/sjpu-dbah
41a6d598761d121006170fc746060a69d02b6836
86b7ca641a7d5897c5c13db4910ca03cf9b87f12
refs/heads/master
2023-08-18T03:51:03.111688
2023-08-11T05:52:44
2023-08-11T05:52:44
32,524,117
0
0
null
null
null
null
UTF-8
Java
false
false
3,472
java
package org.xblackcat.sjpu.storage.workflow.batched; import org.xblackcat.sjpu.storage.IBatchedAH; import org.xblackcat.sjpu.storage.StorageException; import org.xblackcat.sjpu.storage.ann.MapRowTo; import org.xblackcat.sjpu.storage.ann.Sql; import org.xblackcat.sjpu.storage.consumer.IRowConsumer; import org.xblackcat.sjpu.storage.workflow.data.Element; import org.xblackcat.sjpu.storage.workflow.data.IElement; import java.util.List; /** * 22.04.2014 18:10 * * @author xBlackCat */ public interface IDataAH extends IBatchedAH { @Sql("SELECT\n" + " name\n" + "FROM list\n" + "WHERE id = ?") String get(Integer id) throws StorageException; @Sql("INSERT INTO list (id, name) VALUES (?, ?)") void put(int id, String name) throws StorageException; @Sql("SELECT\n" + " id\n" + "FROM list\n" + "ORDER BY id") int[] getIds() throws StorageException; @Sql("SELECT\n" + " id, name\n" + "FROM list\n" + "WHERE id = ?") Element getElement(Integer id) throws StorageException; @Sql("SELECT\n" + " id, name\n" + "FROM list\n" + "WHERE id = ?") @MapRowTo(Element.class) IElement<String> getIElement(Integer id) throws StorageException; @Sql("SELECT\n" + " id, name\n" + "FROM list") List<Element> getListElement() throws StorageException; @Sql("SELECT\n" + " id, name\n" + "FROM list") @MapRowTo(Element.class) List<IElement<String>> getListIElement() throws StorageException; @Sql("SELECT\n" + " id, name\n" + "FROM list") void getListElement(IRowConsumer<Element> consumer) throws StorageException; @Sql("SELECT\n" + " id, name\n" + "FROM list") @MapRowTo(Element.class) void getListIElement(IRowConsumer<IElement<String>> consumer) throws StorageException; @Sql("SELECT\n" + " id, name\n" + "FROM list\n" + "WHERE\n" + " id >= ?") void getListElement(IRowConsumer<Element> consumer, int ind) throws StorageException; @Sql("SELECT\n" + " id, name\n" + "FROM list\n" + "WHERE\n" + " id >= ?") @MapRowTo(Element.class) void getListIElement(IRowConsumer<IElement<String>> consumer, int idx) throws StorageException; @Sql("SELECT\n" + " id, name\n" + "FROM list\n" + "WHERE\n" + " id >= ?") void getListElement(int ind, IRowConsumer<Element> consumer) throws StorageException; @Sql("SELECT\n" + " id, name\n" + "FROM list\n" + "WHERE\n" + " id >= ?") @MapRowTo(Element.class) void getListElementRaw(int ind, IRowConsumer consumer) throws StorageException; @Sql("SELECT\n" + " id, name\n" + "FROM list\n" + "WHERE\n" + " id >= ?") @MapRowTo(Element.class) void getListIElement(int ind, IRowConsumer<IElement<String>> consumer) throws StorageException; @Sql("DELETE FROM list") void dropElements() throws StorageException; }
[ "xblackcat@gmail.com" ]
xblackcat@gmail.com
22a48e9c78e40f00ad539ab961ee1a1a40581ab7
c993f8fa180a11fc98a2e1a0424e6a07e2b83cf5
/src/main/java/com/github/jengo/java/program/design10/CurveDemo.java
1ce3e3c90abecb087ce3d41e43dc081d7ad2957b
[ "Apache-2.0" ]
permissive
jengowong/java_program_design_10
a894412b410b9b1769882aff5f789a00b6edbd66
217737454bd764dfdd72a6873a6bc31af8f36930
refs/heads/master
2021-01-19T10:10:58.933964
2019-09-19T01:54:49
2019-09-19T01:54:49
82,166,516
0
0
Apache-2.0
2020-10-12T20:15:04
2017-02-16T10:02:17
Java
UTF-8
Java
false
false
1,648
java
package com.github.jengo.java.program.design10; import javax.swing.JApplet; import javax.swing.JFrame; import javax.swing.JPanel; import java.awt.BorderLayout; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.geom.CubicCurve2D; import java.awt.geom.QuadCurve2D; public class CurveDemo extends JApplet { public CurveDemo() { add(new CurvePanel()); } static class CurvePanel extends JPanel { protected void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2d = (Graphics2D) g; // Draw a quadratic curve g2d.draw(new QuadCurve2D.Double(10, 80, 40, 20, 150, 56)); g2d.fillOval(40 + 3, 20 + 3, 6, 6); g2d.drawString("Control point", 40 + 5, 20); // Draw a cubic curve g2d.draw(new CubicCurve2D.Double (200, 80, 240, 20, 350, 156, 450, 80)); g2d.fillOval(240 + 3, 20 + 3, 6, 6); g2d.drawString("Control point 1", 240 + 3, 20); g2d.fillOval(350 + 3, 156 + 3, 6, 6); g2d.drawString("Control point 2", 350 + 3, 156 + 3); } } /** Main method */ public static void main(String[] args) { CurveDemo applet = new CurveDemo(); applet.init(); applet.start(); JFrame frame = new JFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setTitle("CurveDemo"); frame.getContentPane().add(applet, BorderLayout.CENTER); frame.setSize(400, 130); frame.setVisible(true); } }
[ "wangzhenguo02@meituan.com" ]
wangzhenguo02@meituan.com
569d7d02abf3cf8f58d10a652a1ef9ca5434cd49
edbd417df42bf2f61e1794a06f893bf86b65f0b8
/polymorphism/src/main/java/org/denispozo/tutorial/thj/polymorphism/ships/UnknownObjectsAlert.java
41f2ebc6987f9181df4f6d9fd6c70feb79102f93
[]
no_license
denis-pozo/thinking-in-java
1c25717b0ddb55f5dcf10eacece61953c54ee3b7
2f03d159cf16fbcc92f37381e02aa073d4de01bd
refs/heads/master
2022-12-29T11:08:18.597445
2020-10-14T09:32:40
2020-10-14T09:32:40
263,020,791
0
0
null
2020-10-14T09:32:41
2020-05-11T11:18:05
Java
UTF-8
Java
false
false
358
java
package org.denispozo.tutorial.thj.polymorphism.ships; import static org.denispozo.tutorial.thj.util.PrintUtil.*; /* * Chapter - Polymorphism * Section - Designing with Inheritance * Exercise 16 */ public class UnknownObjectsAlert extends AlertStatus { @Override public void activate(){ print("Attention: Unknwon Objects passing around"); } }
[ "denis.pozo@dai-labor.de" ]
denis.pozo@dai-labor.de
19f3ab704af190483a645cb373bd7e7c161eb073
a188f939350d440be3f4873ccd2d191193e67b21
/src/com/example/helloworld/OperatorEx.java
6cc9ff91aa34162d71e0fc8a62a0312f6859133c
[]
no_license
Brilliant-Kwon/Jan_16
712ee86b2291c85e90662b8e9a3a857d43d5355d
952b7f5697c7eb8fd2f0ca60846e164b3ea7f862
refs/heads/master
2020-04-16T22:32:11.541877
2019-01-16T08:12:32
2019-01-16T08:12:32
165,972,453
0
0
null
null
null
null
UTF-8
Java
false
false
1,116
java
package com.example.helloworld; public class OperatorEx { public static void main(String[] args) { int a = 7; int b = 3; //사칙 연산 System.out.println(a/b);//정수 나누기 정수 System.out.println(a%b);//나머지 구하기 System.out.println((float)a / (float)b); System.out.println((float)a/b); //증감연산자: ++,--; //위치에 주의하자 System.out.println("Origin: "+a); System.out.println("++a: "+ ++a); System.out.println("Final: "+ a); System.out.println("Origin: "+b); System.out.println("b++: "+ b++); System.out.println("Final: "+b); //증감 연산자는 가능하면 타 연산식 속에 포함시키지말자 //헷갈림 유발 // System.out.println(4/0);//Error System.out.println(4.0/0); //현재 데이터값이 유한한 값인지 확인 System.out.println(Double.isFinite(4.0/0)); System.out.println(Double.isFinite(4.0/2)); //NaN System.out.println(Double.isNaN(4.0/0)); } }
[ "k1212keun@skuniv.ac.kr" ]
k1212keun@skuniv.ac.kr
fbfba21cb5a8aba6c0852f1b889f7791d8df47bc
aa485ab1984e85f78dd6c83c128859a20f5d6ed7
/src/main/java/com/google/android/gms/ads/internal/reward/client/zzf.java
0f754989ad99447828ba32340155b750d499e5ec
[]
no_license
TaintBench/vibleaker_android_samp
4c81cb0ea5ef7a1ea57db619135f7a33bed750a8
a346056c3b2cf7172f6f3920ab27b129b1cd677b
refs/heads/master
2021-07-21T19:35:45.615769
2021-07-16T11:40:39
2021-07-16T11:40:39
234,354,910
0
0
null
null
null
null
UTF-8
Java
false
false
1,600
java
package com.google.android.gms.ads.internal.reward.client; import android.content.Context; import android.os.IBinder; import android.os.RemoteException; import com.google.android.gms.ads.internal.client.zzn; import com.google.android.gms.ads.internal.reward.client.zzb.zza; import com.google.android.gms.ads.internal.util.client.VersionInfoParcel; import com.google.android.gms.ads.internal.util.client.zzb; import com.google.android.gms.dynamic.zze; import com.google.android.gms.dynamic.zzg; import com.google.android.gms.internal.zzew; import com.google.android.gms.internal.zzhb; @zzhb public class zzf extends zzg<zzc> { public zzf() { super("com.google.android.gms.ads.reward.RewardedVideoAdCreatorImpl"); } private zzb zzb(Context context, zzew zzew) { try { return zza.zzaa(((zzc) zzaB(context)).zza(zze.zzC(context), zzew, 8487000)); } catch (RemoteException | zzg.zza e) { zzb.zzd("Could not get remote RewardedVideoAd.", e); return null; } } public zzb zza(Context context, zzew zzew) { if (zzn.zzcS().zzU(context)) { zzb zzb = zzb(context, zzew); if (zzb != null) { return zzb; } } zzb.zzaI("Using RewardedVideoAd from the client jar."); return zzn.zzcU().createRewardedVideoAd(context, zzew, new VersionInfoParcel(8487000, 8487000, true)); } /* access modifiers changed from: protected */ /* renamed from: zzad */ public zzc zzd(IBinder iBinder) { return zzc.zza.zzab(iBinder); } }
[ "malwareanalyst1@gmail.com" ]
malwareanalyst1@gmail.com
f2f22d08305e0634e2dea85c3f0e4d21efb72698
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/25/25_f5519c9eced9436e4afc9402039bdfa1c83052cf/TextFileStoreTests/25_f5519c9eced9436e4afc9402039bdfa1c83052cf_TextFileStoreTests_t.java
6cdf4bcb9fc1a4d7765973d41a6458a2e155318b
[]
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
4,453
java
/* * Copyright 2013 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.data.hadoop.store; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; import java.io.IOException; import java.util.List; import org.junit.Test; import org.springframework.data.hadoop.store.codec.Codecs; import org.springframework.data.hadoop.store.input.TextFileReader; import org.springframework.data.hadoop.store.output.TextFileWriter; import org.springframework.data.hadoop.store.strategy.naming.CodecFileNamingStrategy; import org.springframework.data.hadoop.store.strategy.naming.RollingFileNamingStrategy; import org.springframework.data.hadoop.store.strategy.rollover.SizeRolloverStrategy; /** * Tests for writing and reading text using text file. * * @author Janne Valkealahti * */ public class TextFileStoreTests extends AbstractStoreTests { @Test public void testWriteReadTextOneLine() throws IOException { String[] dataArray = new String[] { DATA10 }; TextFileWriter writer = new TextFileWriter(testConfig, testDefaultPath, null); TestUtils.writeData(writer, dataArray); TextFileReader reader = new TextFileReader(testConfig, testDefaultPath, null); TestUtils.readDataAndAssert(reader, dataArray); } @Test public void testWriteReadTextManyLines() throws IOException { TextFileWriter writer = new TextFileWriter(testConfig, testDefaultPath, null); TestUtils.writeData(writer, DATA09ARRAY); TextFileReader reader = new TextFileReader(testConfig, testDefaultPath, null); TestUtils.readDataAndAssert(reader, DATA09ARRAY); } @Test public void testWriteReadManyLinesWithGzip() throws IOException { TextFileWriter writer = new TextFileWriter(testConfig, testDefaultPath, Codecs.GZIP.getCodecInfo()); TestUtils.writeData(writer, DATA09ARRAY); TextFileReader reader = new TextFileReader(testConfig, testDefaultPath, Codecs.GZIP.getCodecInfo()); TestUtils.readDataAndAssert(reader, DATA09ARRAY); } @Test public void testWriteReadManyLinesWithBzip2() throws IOException { TextFileWriter writer = new TextFileWriter(testConfig, testDefaultPath, Codecs.BZIP2.getCodecInfo()); TestUtils.writeData(writer, DATA09ARRAY); TextFileReader reader = new TextFileReader(testConfig, testDefaultPath, Codecs.BZIP2.getCodecInfo()); TestUtils.readDataAndAssert(reader, DATA09ARRAY); } @Test public void testWriteReadManyLinesWithGzipWithCodecNaming() throws IOException { TextFileWriter writer = new TextFileWriter(testConfig, testDefaultPath, Codecs.GZIP.getCodecInfo()); writer.setFileNamingStrategy(new CodecFileNamingStrategy()); TestUtils.writeData(writer, DATA09ARRAY); TextFileReader reader = new TextFileReader(testConfig, testDefaultPath.suffix(".gzip"), Codecs.GZIP.getCodecInfo()); TestUtils.readDataAndAssert(reader, DATA09ARRAY); } @Test public void testWriteReadManyLinesWithNamingAndRollover() throws IOException { TextFileWriter writer = new TextFileWriter(testConfig, testDefaultPath, null); writer.setFileNamingStrategy(new RollingFileNamingStrategy()); writer.setRolloverStrategy(new SizeRolloverStrategy(40)); writer.setIdleTimeout(10000); TestUtils.writeData(writer, DATA09ARRAY); TextFileReader reader1 = new TextFileReader(testConfig, testDefaultPath.suffix("0"), null); List<String> splitData1 = TestUtils.readData(reader1); TextFileReader reader2 = new TextFileReader(testConfig, testDefaultPath.suffix("1"), null); List<String> splitData2 = TestUtils.readData(reader2); TextFileReader reader3 = new TextFileReader(testConfig, testDefaultPath.suffix("2"), null); List<String> splitData3 = TestUtils.readData(reader3); assertThat(splitData1.size() + splitData2.size() + splitData3.size(), is(DATA09ARRAY.length)); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
4d3adc294b06dc162860bdbcb32ed3ff9355b686
0020de1cabbaedf327d5b746b6d2ddfe17c7a9ab
/src/test/java/jpa/JPATemplate.java
fc85d384e83ca2e919a961f47b0907e3c3ce240f
[]
no_license
vincenttuan/SpringBasic1102
50830728249f6136a94a3ae3b84040f65eaf84fe
2ab38e54dfdca38bfe2b8cdf922535d062739d15
refs/heads/master
2023-01-22T00:12:42.148548
2020-12-04T13:47:42
2020-12-04T13:47:42
309,378,922
2
1
null
null
null
null
UTF-8
Java
false
false
991
java
package jpa; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.Transaction; import org.junit.After; import org.junit.Before; import org.springframework.context.support.ClassPathXmlApplicationContext; public class JPATemplate { private ClassPathXmlApplicationContext ctx; private SessionFactory sessionFactory; protected Session session; private Transaction trans; @Before public void before() { ctx = new ClassPathXmlApplicationContext("jpa-config.xml"); // 取得連線工廠 sessionFactory = ctx.getBean("sessionFactory", SessionFactory.class); // 取得連線物件 session = sessionFactory.getCurrentSession(); // 取得交易管理並開始 trans = session.beginTransaction(); } @After public void after() { trans.commit(); // 提交 sessionFactory.close(); // 關閉 ctx.close(); } }
[ "teacher@192.168.1.180" ]
teacher@192.168.1.180
aa5213277dba59ae049d5225c9957fe1089432e4
c89333d091f152c8c36623065cf6974997530876
/modulesnov3/sa.elm.ob.hcm/src/sa/elm/ob/hcm/ad_callouts/dao/EndofEmploymentCalloutDAOImpl.java
55abff087111c7c383bda16900e0942cdbf58a82
[]
no_license
Orkhan42/openbravotest
24cb0f35986732c41a21963d7aa7a0910e7b4afd
82c7bfb60dda7a30be276a2b07e5ca2b4a92c585
refs/heads/master
2023-03-01T00:35:37.463178
2021-02-04T12:55:45
2021-02-04T12:55:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,538
java
package sa.elm.ob.hcm.ad_callouts.dao; import java.util.Date; import java.util.List; import org.codehaus.jettison.json.JSONObject; import org.hibernate.SQLQuery; import org.openbravo.base.exception.OBException; import org.openbravo.dal.service.OBDal; import org.openbravo.erpCommon.utility.OBMessageUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class EndofEmploymentCalloutDAOImpl implements EndofEmploymentCalloutDAO { private static final Logger LOG = LoggerFactory.getLogger(EndofEmploymentCalloutDAOImpl.class); @SuppressWarnings("rawtypes") @Override public JSONObject getAuthorizationInfoDetails(String organisationId, Date terminationDate) throws Exception { // TODO Auto-generated method stub JSONObject result = new JSONObject(); try { SQLQuery query = OBDal.getInstance().getSession().createSQLQuery( "select authorizedperson,authorizedjobtitle from ehcm_authorizationinfo(?,?)"); query.setParameter(0, organisationId); query.setParameter(1, terminationDate); List list = query.list(); if (list != null && list.size() > 0) { Object[] row = (Object[]) list.get(0); if (row != null) { result.put("authorizedPerson", row[0]); result.put("authorizedJobTitle", row[1]); } } } catch (OBException e) { LOG.error("Exception while endofemploymentcalloutDaoimpl:" , e); throw new OBException(OBMessageUtils.messageBD("HB_INTERNAL_ERROR")); } return result; } }
[ "laiquddin.syed83@gmail.com" ]
laiquddin.syed83@gmail.com
d8d4dae30a5835a4aa711027b093178c1841c60b
2370f5580c5a7ad14cdbafb64c190b592504e515
/org.tencompetence.qtieditor/src/org/tencompetence/qtieditor/rule/OutcomeRule.java
3b11912c6e225728fb6f15b8f4be5aaf4fe14ebe
[]
no_license
vicsanhu/ontoConcept
317f844eb5bad73ffabe875287c3518cd6bf7a16
eb89178a2612780a007d8d3325149b08655c87d8
refs/heads/master
2020-05-18T15:12:06.584603
2013-02-28T01:24:15
2013-02-28T01:24:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,170
java
package org.tencompetence.qtieditor.rule; import org.jdom.Element; import org.tencompetence.qtieditor.elements.AssessmentElementFactory; import org.tencompetence.qtieditor.elements.BasicElementList; public abstract class OutcomeRule extends AbstractRule{ protected BasicElementList fOutcomeRuleList = new BasicElementList(); //required public BasicElementList getOutcomeRuleList() { return fOutcomeRuleList; } public void setOutcomeRuleList(BasicElementList list) { fOutcomeRuleList = list; } public void addOutcomeRule(OutcomeRule aOutcomeRule) { fOutcomeRuleList.addElement(aOutcomeRule); } public void removeOutcomeRule(OutcomeRule aOutcomeRule) { fOutcomeRuleList.removeElement(aOutcomeRule); } public void fromJDOM(Element element) { for (Object object : element.getChildren()) { Element child = (Element)object; String tag = child.getName(); if (tag.equals(AssessmentElementFactory.SET_OUTCOME_VALUE)) { SetOutcomeValue aOutcomeRule = new SetOutcomeValue(getAssessment()); aOutcomeRule.fromJDOM((Element)child); fOutcomeRuleList.addElement(aOutcomeRule); } else if (tag.equals(AssessmentElementFactory.OUTCOME_CONDITION)) { OutcomeCondition aOutcomeRule = new OutcomeCondition(getAssessment()); aOutcomeRule.fromJDOM((Element)child); fOutcomeRuleList.addElement(aOutcomeRule); } else if (tag.equals(AssessmentElementFactory.EXIT_TEST)) { ExitTest aOutcomeRule = new ExitTest(getAssessment()); aOutcomeRule.fromJDOM((Element)child); fOutcomeRuleList.addElement(aOutcomeRule); } } } public Element toJDOM() { Element aElement = new Element(getTagName(), getTestNamespace()); for (int i = 0; i < fOutcomeRuleList.size(); i++) { AbstractRule aRule = ((AbstractRule)fOutcomeRuleList .getBasicElementAt(i)); if (aRule instanceof SetOutcomeValue) { aElement.addContent(((SetOutcomeValue)aRule).toJDOM()); } else if (aRule instanceof OutcomeCondition) { aElement.addContent(((OutcomeCondition)aRule).toJDOM()); } else if (aRule instanceof ExitTest) { aElement.addContent(((ExitTest)aRule).toJDOM()); } } return aElement; } }
[ "vicsanhu@alumnos.ubiobio.cl" ]
vicsanhu@alumnos.ubiobio.cl
a323bdda230af5a07850fe9e3f9f230b6783420d
613201ce7f5aa310ff0839d6f3551d4e3973f026
/code-fragment/src/main/java/com/leolian/code/fragment/book/concurrence/chapter14/ConditionBoundedBubffer.java
c94f27017006729ce7ca35200dbaf6792b56d696
[]
no_license
comeonlian/code-set
10586410390c1c7c19e51b0f9db605aac9da5dcf
5f78ac702bc3d3611be9bdcc7899c60a8e1ecfa0
refs/heads/master
2023-03-18T16:41:43.025657
2021-03-04T03:23:09
2021-03-04T03:23:09
336,192,819
0
0
null
null
null
null
UTF-8
Java
false
false
1,296
java
package com.leolian.code.fragment.book.concurrence.chapter14; import java.util.concurrent.locks.Condition; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; import javax.annotation.concurrent.GuardedBy; import com.leolian.code.fragment.book.concurrence.common.ThreadSafe; @ThreadSafe public class ConditionBoundedBubffer<T> { private static final int BUFFER_SIZE = 1000; protected final Lock lock = new ReentrantLock(); private final Condition notFull = lock.newCondition(); private final Condition notEmpty = lock.newCondition(); @GuardedBy("lock") private final T[] items = (T[]) new Object[BUFFER_SIZE]; @GuardedBy("lock") private int tail, head, count; public void put(T x) throws InterruptedException { lock.lock(); try { while (count == items.length) { notFull.await(); } items[tail] = x; if (++tail == items.length) { tail = 0; } ++count; notEmpty.signal(); } finally { lock.unlock(); } } public T take() throws InterruptedException { lock.lock(); try { while (count == 0) { notEmpty.await(); } T x = items[head]; items[head] = null; if (++head == items.length) { head = 0; } --count; notFull.signal(); return x; } finally { lock.unlock(); } } }
[ "lianliang@oppo.com" ]
lianliang@oppo.com