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
72665ebb2d6cd7601b997c7f04edfcb68a04a883
302af4aa0bf08a66dde5fa95bc6e8992e4505c7d
/com.chebdev.hiphopproducerpads/java/com/google/unity/ads/Interstitial.java
f5ca594b4633dfb077f4fd206cda1a3dc863b268
[]
no_license
hakat0m/Chessboxing
0f5ce696a55a5b40f1d8fa226bbdc5673ef5dbc5
0a576dec5aaafa219c340a013726037d852b91a2
refs/heads/master
2021-01-19T08:51:23.932830
2017-04-09T06:48:44
2017-04-09T06:48:44
87,688,753
3
0
null
null
null
null
UTF-8
Java
false
false
2,588
java
package com.google.unity.ads; import android.app.Activity; import android.util.Log; import com.google.android.gms.ads.AdListener; import com.google.android.gms.ads.AdRequest; import com.google.android.gms.ads.InterstitialAd; public class Interstitial { private Activity activity; private InterstitialAd interstitial; private boolean isLoaded = false; private UnityAdListener listener; public Interstitial(Activity activity, UnityAdListener listener) { this.activity = activity; this.listener = listener; } public void create(final String adUnitId) { this.activity.runOnUiThread(new Runnable() { public void run() { Interstitial.this.interstitial = new InterstitialAd(Interstitial.this.activity); Interstitial.this.interstitial.setAdUnitId(adUnitId); Interstitial.this.interstitial.setAdListener(new AdListener() { public void onAdLoaded() { Interstitial.this.isLoaded = true; Interstitial.this.listener.onAdLoaded(); } public void onAdFailedToLoad(int errorCode) { Interstitial.this.listener.onAdFailedToLoad(PluginUtils.getErrorReason(errorCode)); } public void onAdOpened() { Interstitial.this.listener.onAdOpened(); } public void onAdClosed() { Interstitial.this.listener.onAdClosed(); } public void onAdLeftApplication() { Interstitial.this.listener.onAdLeftApplication(); } }); } }); } public void loadAd(final AdRequest request) { this.activity.runOnUiThread(new Runnable() { public void run() { Interstitial.this.interstitial.loadAd(request); } }); } public boolean isLoaded() { return this.isLoaded; } public void show() { this.activity.runOnUiThread(new Runnable() { public void run() { if (Interstitial.this.interstitial.isLoaded()) { Interstitial.this.isLoaded = false; Interstitial.this.interstitial.show(); return; } Log.d(PluginUtils.LOGTAG, "Interstitial was not ready to be shown."); } }); } public void destroy() { } }
[ "vuesz@outlook.com" ]
vuesz@outlook.com
02ee1f4eadd546ebc099804b3b8cc52ac5f8fab8
1ebd71e2179be8a2baec90ff3f326a3f19b03a54
/hybris/bin/modules/core-accelerator/acceleratorservices/src/de/hybris/platform/acceleratorservices/dataexport/generic/impl/DefaultUploadDataProcessorService.java
0403422b965427b5f7db4e48a9b328b9cf5f586d
[]
no_license
shaikshakeeb785/hybrisNew
c753ac45c6ae264373e8224842dfc2c40a397eb9
228100b58d788d6f3203333058fd4e358621aba1
refs/heads/master
2023-08-15T06:31:59.469432
2021-09-03T09:02:04
2021-09-03T09:02:04
402,680,399
0
0
null
null
null
null
UTF-8
Java
false
false
3,651
java
/* * Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. */ package de.hybris.platform.acceleratorservices.dataexport.generic.impl; import de.hybris.platform.acceleratorservices.dataexport.generic.UploadDataProcessorService; import de.hybris.platform.cronjob.model.CronJobModel; import de.hybris.platform.servicelayer.cronjob.CronJobDao; import java.io.File; import java.io.FilenameFilter; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.regex.Pattern; import org.apache.log4j.Logger; import org.springframework.beans.factory.annotation.Required; import org.springframework.messaging.Message; import org.springframework.messaging.MessagingException; import org.springframework.messaging.handler.annotation.Header; import org.springframework.messaging.support.ErrorMessage; import org.springframework.messaging.support.GenericMessage; /** * Default implementation of {@link UploadDataProcessorService}. */ public class DefaultUploadDataProcessorService implements UploadDataProcessorService { private static final Logger LOG = Logger.getLogger(DefaultUploadDataProcessorService.class); private CronJobDao cronJobDao; protected CronJobDao getCronJobDao() { return cronJobDao; } @Required public void setCronJobDao(final CronJobDao cronJobDao) { this.cronJobDao = cronJobDao; } @Override public Message<List<File>> findFiles(final Message<?> message, @Header(value = "filenameRegex") final String filenameRegex, @Header(value = "directory") final String directory) { final File directoryPath = new File(directory); if (directoryPath.exists()) { final File[] files = directoryPath.listFiles(new PatternFilenameFilter(filenameRegex)); final List<File> detectedFiles = Arrays.asList(files); LOG.info("Found " + detectedFiles.size() + " Files in directory"); return new GenericMessage<List<File>>(detectedFiles); } LOG.info("No files found"); return new GenericMessage<List<File>>(new ArrayList<File>()); } @Override public CronJobModel getUploadCronJob(final Message<File> message) { final File payload = message.getPayload(); final String filename = payload.getName(); final String[] filenameParts = filename.split("-"); if (filenameParts.length > 1) { final String cronJobCode = filenameParts[0]; final List<CronJobModel> cronJobModels = cronJobDao.findCronJobs(cronJobCode); if (!cronJobModels.isEmpty()) { return cronJobModels.get(0); } LOG.warn("Did not find config for file: " + filename); } return null; } @Override public File handlerError(final ErrorMessage message) { LOG.info("Error with file: " + message.getPayload().getMessage()); final Throwable payload = message.getPayload(); if (payload instanceof MessagingException) { final MessagingException messagingException = (MessagingException) payload; final Message<?> failedMessage = messagingException.getFailedMessage(); final Object failedMessagePayload = failedMessage.getPayload(); if (failedMessagePayload instanceof File) { LOG.info("Moving " + ((File) failedMessagePayload).getName() + " to error folder"); return (File) failedMessagePayload; } } return null; } public static class PatternFilenameFilter implements FilenameFilter { private final Pattern pattern; public PatternFilenameFilter(final String patternStr) { pattern = Pattern.compile(patternStr); } protected Pattern getPattern() { return pattern; } @Override public boolean accept(final File dir, final String fileName) { return getPattern().matcher(fileName).matches(); } } }
[ "sauravkr82711@gmail.com" ]
sauravkr82711@gmail.com
9f4fc93de28604ec96992bbae3e9841cb919266d
68102394ed601826c92384977465d4f7d911d95a
/hr-hexagon/src/com/example/hr/event/EmployeeFiredEvent.java
5b4623a0ea55301a6aa7459a285346f77625ff8d
[ "MIT" ]
permissive
deepcloudlabs/dcl350-2021-jun-07
b34724f20fec751e9a31fde95297b89390aa9cf0
05332025909e49b8067657d02eed1bef08c03a92
refs/heads/main
2023-05-21T01:14:28.843633
2021-06-11T13:35:40
2021-06-11T13:35:40
374,163,769
1
0
null
null
null
null
UTF-8
Java
false
false
209
java
package com.example.hr.event; import com.example.hr.domain.TcKimlikNo; public class EmployeeFiredEvent extends EmployeeEvent { public EmployeeFiredEvent(TcKimlikNo tcKimlikNo) { super(tcKimlikNo); } }
[ "deepcloudlabs@gmail.com" ]
deepcloudlabs@gmail.com
8340921be2a9fbf89c21d262315662833d7f9fd0
805b2a791ec842e5afdd33bb47ac677b67741f78
/Mage.Sets/src/mage/sets/vintagemasters/GustcloakHarrier.java
e695515ad8629b50a7314ebe0c5287ff338ba890
[]
no_license
klayhamn/mage
0d2d3e33f909b4052b0dfa58ce857fbe2fad680a
5444b2a53beca160db2dfdda0fad50e03a7f5b12
refs/heads/master
2021-01-12T19:19:48.247505
2015-08-04T20:25:16
2015-08-04T20:25:16
39,703,242
2
0
null
2015-07-25T21:17:43
2015-07-25T21:17:42
null
UTF-8
Java
false
false
3,197
java
/* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ package mage.sets.vintagemasters; import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.BecomesBlockedTriggeredAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.common.RemoveFromCombatSourceEffect; import mage.abilities.effects.common.UntapSourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; /** * * @author fireshoes */ public class GustcloakHarrier extends CardImpl { public GustcloakHarrier(UUID ownerId) { super(ownerId, 30, "Gustcloak Harrier", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}{W}"); this.expansionSetCode = "VMA"; this.subtype.add("Bird"); this.subtype.add("Soldier"); this.power = new MageInt(2); this.toughness = new MageInt(2); // Flying this.addAbility(FlyingAbility.getInstance()); // Whenever Gustcloak Harrier becomes blocked, you may untap it and remove it from combat. Ability ability = new BecomesBlockedTriggeredAbility(new UntapSourceEffect(), true); Effect effect = new RemoveFromCombatSourceEffect(); effect.setText("and remove it from combat"); ability.addEffect(effect); this.addAbility(ability); } public GustcloakHarrier(final GustcloakHarrier card) { super(card); } @Override public GustcloakHarrier copy() { return new GustcloakHarrier(this); } }
[ "fireshoes@fireshoes-PC" ]
fireshoes@fireshoes-PC
e8443188aa90fd9b148ed34c18720ee7700ae07e
139960e2d7d55e71c15e6a63acb6609e142a2ace
/mobile_app1/module1200/src/main/java/module1200packageJava0/Foo87.java
817422fcb5407753741972d9eea6bc41ea568bc4
[ "Apache-2.0" ]
permissive
uber-common/android-build-eval
448bfe141b6911ad8a99268378c75217d431766f
7723bfd0b9b1056892cef1fef02314b435b086f2
refs/heads/master
2023-02-18T22:25:15.121902
2023-02-06T19:35:34
2023-02-06T19:35:34
294,831,672
83
7
Apache-2.0
2021-09-24T08:55:30
2020-09-11T23:27:37
Java
UTF-8
Java
false
false
294
java
package module1200packageJava0; import java.lang.Integer; public class Foo87 { Integer int0; public void foo0() { new module1200packageJava0.Foo86().foo3(); } public void foo1() { foo0(); } public void foo2() { foo1(); } public void foo3() { foo2(); } }
[ "oliviern@uber.com" ]
oliviern@uber.com
b3d63c961dd3fd6bb8c61c6e4dfc2c482187a25f
dd8a57a138e8eeb71021471cf6f9dbdadd17ea99
/org.sheepy.lily.core.model/src/main/java/org/joml/Vector4i.java
1151c75e80d1fc01516be53e0b8a73f8b8687949
[]
no_license
Ealrann/Lily-core
99c04e4a8caefe17f0be80df3112ed12fb00c22f
5525362b06faee05ed705797ee1f190d3731430a
refs/heads/master
2023-08-06T17:34:35.841397
2023-07-25T21:04:09
2023-07-25T21:04:09
148,759,291
0
0
null
null
null
null
UTF-8
Java
false
false
446
java
package org.joml; public class Vector4i implements Vector4ic { private final int x; private final int y; private final int z; private final int w; public Vector4i(int x, int y, int z, int w) { this.x = x; this.y = y; this.z = z; this.w = w; } @Override public int x() { return x; } @Override public int y() { return y; } @Override public int z() { return z; } @Override public int w() { return w; } }
[ "ealrann@gmail.com" ]
ealrann@gmail.com
4fe6b10d7c21a57a243ae3c138e74cd4071b3cc7
b71d65f7b96f0fd27bf67b2ee1ebd33efb2b1c12
/06-分布式电子商城/e3mall/e3-sso/e3-sso-service/src/main/java/e3mall/sso/service/impl/RegisterServiceImpl.java
fcc486f35b9322c2b9bc71545c8e5d76c674ac75
[]
no_license
luguanxing/JavaWeb-Apps
81082420edc718734e2df1b8e8d70e80cea33a78
49881bdec84320ba2990c87a9e87519bc25522c6
refs/heads/master
2021-09-08T03:24:57.547555
2018-03-06T18:08:26
2018-03-06T18:08:26
103,841,721
1
0
null
null
null
null
UTF-8
Java
false
false
2,057
java
package e3mall.sso.service.impl; import java.util.Date; import java.util.List; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.DigestUtils; import e3mall.common.utils.E3Result; import e3mall.mapper.TbUserMapper; import e3mall.pojo.TbUser; import e3mall.pojo.TbUserExample; import e3mall.pojo.TbUserExample.Criteria; import e3mall.sso.service.RegisterService; @Service public class RegisterServiceImpl implements RegisterService { @Autowired private TbUserMapper userMapper; @Override public E3Result checkData(String param, Integer type) { //参数:从url中取参数1、String param(要校验的数据)2、Integer type(校验的数据类型) TbUserExample example = new TbUserExample(); Criteria criteria = example.createCriteria(); if (type == 1) { criteria.andUsernameEqualTo(param); } else if (type == 2) { criteria.andPhoneEqualTo(param); } else if (type == 3) { criteria.andEmailEqualTo(param); } else { return E3Result.build(500, "数据类型错误"); } List<TbUser> list = userMapper.selectByExample(example); if (list != null && !list.isEmpty()) { return E3Result.ok(false); } return E3Result.ok(true); } @Override public E3Result register(TbUser user) { //后端还需要校验一次 if (StringUtils.isBlank(user.getUsername()) || StringUtils.isBlank(user.getPassword()) || StringUtils.isBlank(user.getPhone())) { return E3Result.build(500, "数据不完整"); } if (!(boolean) checkData(user.getUsername(), 1).getData()) { return E3Result.build(500, "用户名被占用"); } if (!(boolean) checkData(user.getPhone(), 2).getData()) { return E3Result.build(500, "手机号被占用"); } user.setCreated(new Date()); user.setUpdated(new Date()); String md5Password = DigestUtils.md5DigestAsHex(user.getPassword().getBytes()); user.setPassword(md5Password); userMapper.insert(user); return E3Result.ok(); } }
[ "651571925@qq.com" ]
651571925@qq.com
6a814c9effc15b1fb341c87cad95dbd46ee56985
99e75308bf2935055639dd22272788d832bf1aac
/src/test/java/ua/net/aspebo/web/rest/CommentResourceIntTest.java
f91b413eb100dcf4f5a975f9c71b6a9023b9a37f
[]
no_license
petroborovets/webstore
469226963b90c8097056b675dd44f262f46d0c14
54fe817eff3b86479adaf8bae98730860237967b
refs/heads/master
2021-01-10T05:33:36.567197
2016-01-08T23:54:15
2016-01-08T23:54:15
49,264,033
0
1
null
2020-09-18T13:36:36
2016-01-08T09:49:32
Java
UTF-8
Java
false
false
7,001
java
package ua.net.aspebo.web.rest; import ua.net.aspebo.Application; import ua.net.aspebo.domain.Comment; import ua.net.aspebo.repository.CommentRepository; import ua.net.aspebo.service.CommentService; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import static org.hamcrest.Matchers.hasItem; import org.mockito.MockitoAnnotations; import org.springframework.boot.test.IntegrationTest; import org.springframework.boot.test.SpringApplicationConfiguration; import org.springframework.http.MediaType; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; import org.springframework.data.web.PageableHandlerMethodArgumentResolver; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.web.WebAppConfiguration; import org.springframework.test.util.ReflectionTestUtils; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.setup.MockMvcBuilders; import org.springframework.transaction.annotation.Transactional; import javax.annotation.PostConstruct; import javax.inject.Inject; import java.util.List; import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; /** * Test class for the CommentResource REST controller. * * @see CommentResource */ @RunWith(SpringJUnit4ClassRunner.class) @SpringApplicationConfiguration(classes = Application.class) @WebAppConfiguration @IntegrationTest public class CommentResourceIntTest { private static final String DEFAULT_MESSAGE = "AAAAA"; private static final String UPDATED_MESSAGE = "BBBBB"; @Inject private CommentRepository commentRepository; @Inject private CommentService commentService; @Inject private MappingJackson2HttpMessageConverter jacksonMessageConverter; @Inject private PageableHandlerMethodArgumentResolver pageableArgumentResolver; private MockMvc restCommentMockMvc; private Comment comment; @PostConstruct public void setup() { MockitoAnnotations.initMocks(this); CommentResource commentResource = new CommentResource(); ReflectionTestUtils.setField(commentResource, "commentService", commentService); this.restCommentMockMvc = MockMvcBuilders.standaloneSetup(commentResource) .setCustomArgumentResolvers(pageableArgumentResolver) .setMessageConverters(jacksonMessageConverter).build(); } @Before public void initTest() { comment = new Comment(); comment.setMessage(DEFAULT_MESSAGE); } @Test @Transactional public void createComment() throws Exception { int databaseSizeBeforeCreate = commentRepository.findAll().size(); // Create the Comment restCommentMockMvc.perform(post("/api/comments") .contentType(TestUtil.APPLICATION_JSON_UTF8) .content(TestUtil.convertObjectToJsonBytes(comment))) .andExpect(status().isCreated()); // Validate the Comment in the database List<Comment> comments = commentRepository.findAll(); assertThat(comments).hasSize(databaseSizeBeforeCreate + 1); Comment testComment = comments.get(comments.size() - 1); assertThat(testComment.getMessage()).isEqualTo(DEFAULT_MESSAGE); } @Test @Transactional public void checkMessageIsRequired() throws Exception { int databaseSizeBeforeTest = commentRepository.findAll().size(); // set the field null comment.setMessage(null); // Create the Comment, which fails. restCommentMockMvc.perform(post("/api/comments") .contentType(TestUtil.APPLICATION_JSON_UTF8) .content(TestUtil.convertObjectToJsonBytes(comment))) .andExpect(status().isBadRequest()); List<Comment> comments = commentRepository.findAll(); assertThat(comments).hasSize(databaseSizeBeforeTest); } @Test @Transactional public void getAllComments() throws Exception { // Initialize the database commentRepository.saveAndFlush(comment); // Get all the comments restCommentMockMvc.perform(get("/api/comments?sort=id,desc")) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)) .andExpect(jsonPath("$.[*].id").value(hasItem(comment.getId().intValue()))) .andExpect(jsonPath("$.[*].message").value(hasItem(DEFAULT_MESSAGE.toString()))); } @Test @Transactional public void getComment() throws Exception { // Initialize the database commentRepository.saveAndFlush(comment); // Get the comment restCommentMockMvc.perform(get("/api/comments/{id}", comment.getId())) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)) .andExpect(jsonPath("$.id").value(comment.getId().intValue())) .andExpect(jsonPath("$.message").value(DEFAULT_MESSAGE.toString())); } @Test @Transactional public void getNonExistingComment() throws Exception { // Get the comment restCommentMockMvc.perform(get("/api/comments/{id}", Long.MAX_VALUE)) .andExpect(status().isNotFound()); } @Test @Transactional public void updateComment() throws Exception { // Initialize the database commentRepository.saveAndFlush(comment); int databaseSizeBeforeUpdate = commentRepository.findAll().size(); // Update the comment comment.setMessage(UPDATED_MESSAGE); restCommentMockMvc.perform(put("/api/comments") .contentType(TestUtil.APPLICATION_JSON_UTF8) .content(TestUtil.convertObjectToJsonBytes(comment))) .andExpect(status().isOk()); // Validate the Comment in the database List<Comment> comments = commentRepository.findAll(); assertThat(comments).hasSize(databaseSizeBeforeUpdate); Comment testComment = comments.get(comments.size() - 1); assertThat(testComment.getMessage()).isEqualTo(UPDATED_MESSAGE); } @Test @Transactional public void deleteComment() throws Exception { // Initialize the database commentRepository.saveAndFlush(comment); int databaseSizeBeforeDelete = commentRepository.findAll().size(); // Get the comment restCommentMockMvc.perform(delete("/api/comments/{id}", comment.getId()) .accept(TestUtil.APPLICATION_JSON_UTF8)) .andExpect(status().isOk()); // Validate the database is empty List<Comment> comments = commentRepository.findAll(); assertThat(comments).hasSize(databaseSizeBeforeDelete - 1); } }
[ "=" ]
=
997aaae769bba19e0d293aeaf69df241333c7530
13f011df7aa583462ee6308247ddfad69cd3afbe
/src/main/java/to/getme/identity/restriction/RestrictionManager.java
8d57b2b253b913f98bf7f5aa389223b17962bd71
[]
no_license
is981/carpool
c27b5bca19acc314bf0ec96b2879b8221664443e
4bbdc703276ba8419d9f439022b54aaa84c393d6
refs/heads/master
2016-09-03T06:36:19.205074
2011-08-28T22:49:28
2011-08-28T22:49:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,064
java
package to.getme.identity.restriction; import to.getme.identity.annotations.*; import org.jboss.seam.security.annotations.Secures; import org.jboss.seam.security.Identity; /** * @author Brent Douglas <brent.n.douglas@gmail.com> */ public class RestrictionManager { @Secures @RootRestriction public boolean isRoot(Identity identity) { return identity.hasRole(RoleType.ROOT.getName(), "", ""); } @Secures @CreateRestriction public boolean canCreate(Identity identity) { return identity.hasRole(RoleType.CREATE.getName(), "", ""); } @Secures @DeleteRestriction public boolean canDelete(Identity identity) { return identity.hasRole(RoleType.DELETE.getName(), "", ""); } @Secures @ReadRestriction public boolean canRead(Identity identity) { return identity.hasRole(RoleType.READ.getName(), "", ""); } @Secures @UpdateRestriction public boolean canUpdate(Identity identity) { return identity.hasRole(RoleType.UPDATE.getName(), "", ""); } }
[ "brent.n.douglas@gmail.com" ]
brent.n.douglas@gmail.com
2e61ec87c7712a5143cb42396b85273782a41274
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/5/5_8ac09abe5d7d17cdd53b42280e15e754a95f0c7f/Addr64/5_8ac09abe5d7d17cdd53b42280e15e754a95f0c7f_Addr64_t.java
529ae22d37dc818a369c5ecffa85a2d533bd55fe
[]
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,691
java
/******************************************************************************* * Copyright (c) 2004, 2006 Intel 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: * Intel Corporation - Initial API and implementation * Mark Mitchell, CodeSourcery - Bug 136896: View variables in binary format *******************************************************************************/ package org.eclipse.cdt.utils; import java.math.BigInteger; import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.internal.core.Messages; public class Addr64 implements IAddress { public static final Addr64 ZERO = new Addr64("0"); //$NON-NLS-1$ public static final Addr64 MAX = new Addr64("ffffffffffffffff", 16); //$NON-NLS-1$ public static final BigInteger MAX_OFFSET = new BigInteger("ffffffffffffffff", 16); //$NON-NLS-1$ private static final int BYTES_NUM = 8; private static final int DIGITS_NUM = BYTES_NUM * 2; private static final int CHARS_NUM = DIGITS_NUM + 2; private static final int BINARY_DIGITS_NUM = BYTES_NUM * 8; private static final int BINARY_CHARS_NUM = BINARY_DIGITS_NUM + 2; private final BigInteger address; public Addr64(byte[] addrBytes) { address = checkAddress(new BigInteger(1, addrBytes), true); } public Addr64(BigInteger rawaddress) { this(rawaddress, true); } public Addr64(BigInteger rawaddress, boolean truncate) { address = checkAddress(rawaddress, truncate); } public Addr64(String addr) { this(addr, true); } public Addr64(String addr, boolean truncate) { addr = addr.toLowerCase(); if (addr.startsWith("0x")) { //$NON-NLS-1$ address = checkAddress(new BigInteger(addr.substring(2), 16), truncate); } else { address = checkAddress(new BigInteger(addr, 10), truncate); } } public Addr64(String addr, int radix) { this(addr, radix, true); } public Addr64(String addr, int radix, boolean truncate) { this(new BigInteger(addr, radix), truncate); } private BigInteger checkAddress(BigInteger addr, boolean truncate) { if (addr.signum() == -1) { throw new IllegalArgumentException("Invalid Address, must be positive value"); //$NON-NLS-1$ } if (addr.bitLength() > 64 ) { if (truncate) { return addr.and(MAX.getValue()); // truncate } else { throw (new NumberFormatException(Messages.Addr_valueOutOfRange)); } } return addr; } public IAddress add(BigInteger offset) { return new Addr64(this.address.add(offset)); } public IAddress add(long offset) { return new Addr64(this.address.add(BigInteger.valueOf(offset))); } public BigInteger getMaxOffset() { return MAX_OFFSET; } public BigInteger distanceTo(IAddress other) { if (! (other instanceof Addr64)) { throw new IllegalArgumentException(); } return ((Addr64)other).address.add(address.negate()); } public boolean isMax() { return address.equals(MAX.getValue()); } public boolean isZero() { return address.equals(ZERO.getValue()); } public BigInteger getValue() { return address; } public int compareTo(Object other) { return this.address.compareTo(((Addr64)other).address); } @Override public boolean equals(Object x) { if (x == this) return true; if (! (x instanceof Addr64)) return false; return this.address.equals(((Addr64)x).address); } @Override public int hashCode() { return address.hashCode(); } @Override public String toString() { return toString(10); } public String toString(int radix) { return address.toString(radix); } public String toHexAddressString() { String addressString = address.toString(16); StringBuffer sb = new StringBuffer(CHARS_NUM); int count = DIGITS_NUM - addressString.length(); sb.append("0x"); //$NON-NLS-1$ for (int i = 0; i < count; ++i) { sb.append('0'); } sb.append(addressString); return sb.toString(); } public String toBinaryAddressString() { String addressString = address.toString(2); StringBuffer sb = new StringBuffer(BINARY_CHARS_NUM); int count = BINARY_DIGITS_NUM - addressString.length(); sb.append("0b"); //$NON-NLS-1$ for (int i = 0; i < count; ++i) { sb.append('0'); } sb.append(addressString); return sb.toString(); } public int getCharsNum() { return CHARS_NUM; } public int getSize() { return BYTES_NUM; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
4cd81a6488615ff6543f240438f32ce311a3dd38
58a961999c259d7fc9e0b8c17a0990f4247f29bf
/CDM/pract3/P1/sources/com/google/android/gms/games/leaderboard/LeaderboardScoreRef.java
776d82f413f98b57619b7f76477a1471698b1087
[]
no_license
Lulocu/4B-ETSINF
c50b4ca70ad14b9ec9af6a199c82fad333f7bc8c
65d492d0fbeb630c7bbe25d92dfbfd9e5f41bcd8
refs/heads/master
2023-06-05T23:41:02.297413
2021-06-20T10:53:30
2021-06-20T10:53:30
339,157,412
0
1
null
null
null
null
UTF-8
Java
false
false
4,153
java
package com.google.android.gms.games.leaderboard; import android.database.CharArrayBuffer; import android.net.Uri; import com.google.android.gms.common.data.DataHolder; import com.google.android.gms.common.data.zzc; import com.google.android.gms.games.Player; import com.google.android.gms.games.PlayerRef; public final class LeaderboardScoreRef extends zzc implements LeaderboardScore { private final PlayerRef zzatP; LeaderboardScoreRef(DataHolder holder, int dataRow) { super(holder, dataRow); this.zzatP = new PlayerRef(holder, dataRow); } @Override // com.google.android.gms.common.data.zzc public boolean equals(Object obj) { return LeaderboardScoreEntity.zza(this, obj); } @Override // com.google.android.gms.games.leaderboard.LeaderboardScore public String getDisplayRank() { return getString("display_rank"); } @Override // com.google.android.gms.games.leaderboard.LeaderboardScore public void getDisplayRank(CharArrayBuffer dataOut) { zza("display_rank", dataOut); } @Override // com.google.android.gms.games.leaderboard.LeaderboardScore public String getDisplayScore() { return getString("display_score"); } @Override // com.google.android.gms.games.leaderboard.LeaderboardScore public void getDisplayScore(CharArrayBuffer dataOut) { zza("display_score", dataOut); } @Override // com.google.android.gms.games.leaderboard.LeaderboardScore public long getRank() { return getLong("rank"); } @Override // com.google.android.gms.games.leaderboard.LeaderboardScore public long getRawScore() { return getLong("raw_score"); } @Override // com.google.android.gms.games.leaderboard.LeaderboardScore public Player getScoreHolder() { if (zzbX("external_player_id")) { return null; } return this.zzatP; } @Override // com.google.android.gms.games.leaderboard.LeaderboardScore public String getScoreHolderDisplayName() { return zzbX("external_player_id") ? getString("default_display_name") : this.zzatP.getDisplayName(); } @Override // com.google.android.gms.games.leaderboard.LeaderboardScore public void getScoreHolderDisplayName(CharArrayBuffer dataOut) { if (zzbX("external_player_id")) { zza("default_display_name", dataOut); } else { this.zzatP.getDisplayName(dataOut); } } @Override // com.google.android.gms.games.leaderboard.LeaderboardScore public Uri getScoreHolderHiResImageUri() { if (zzbX("external_player_id")) { return null; } return this.zzatP.getHiResImageUri(); } @Override // com.google.android.gms.games.leaderboard.LeaderboardScore public String getScoreHolderHiResImageUrl() { if (zzbX("external_player_id")) { return null; } return this.zzatP.getHiResImageUrl(); } @Override // com.google.android.gms.games.leaderboard.LeaderboardScore public Uri getScoreHolderIconImageUri() { return zzbX("external_player_id") ? zzbW("default_display_image_uri") : this.zzatP.getIconImageUri(); } @Override // com.google.android.gms.games.leaderboard.LeaderboardScore public String getScoreHolderIconImageUrl() { return zzbX("external_player_id") ? getString("default_display_image_url") : this.zzatP.getIconImageUrl(); } @Override // com.google.android.gms.games.leaderboard.LeaderboardScore public String getScoreTag() { return getString("score_tag"); } @Override // com.google.android.gms.games.leaderboard.LeaderboardScore public long getTimestampMillis() { return getLong("achieved_timestamp"); } @Override // com.google.android.gms.common.data.zzc public int hashCode() { return LeaderboardScoreEntity.zza(this); } public String toString() { return LeaderboardScoreEntity.zzb(this); } /* renamed from: zztG */ public LeaderboardScore freeze() { return new LeaderboardScoreEntity(this); } }
[ "lulocu99@gmail.com" ]
lulocu99@gmail.com
e2d5750e9c92a7ac073b5467b07d69fefbd2bc1a
09fe38f3232f3141a7076bcd0d616beccd82d3da
/app/src/main/java/com/amos/cameraintent/Main2Activity.java
e6bc9a5365629d25df599fcad8d28a830455219e
[]
no_license
bsakari/Morning-Class-Test
ff8904e41c6f34f322740d8cb372cdc1d9aee4dc
3daf3008dd8e28cf7d254ab984f770b6e30f1ae7
refs/heads/master
2020-03-21T22:13:38.085844
2018-06-29T07:04:31
2018-06-29T07:04:31
139,112,741
0
0
null
null
null
null
UTF-8
Java
false
false
998
java
package com.amos.cameraintent; import android.os.Bundle; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.Snackbar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.View; public class Main2Activity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main2); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); fab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG) .setAction("Action", null).show(); } }); } }
[ "you@example.com" ]
you@example.com
6f448d11d14c94b0a4d89e60a5599abc69ca5b7f
ebf354346c6c10ee4f042ef0a58a3fb83f01c333
/Day10/src/repository/BookDAO.java
cb950329a46805f93b0b808c4e60853bde715c16
[]
no_license
irrationnelle/JSPworkspace
6e5dea357682c5186662fbef0f3f811b5db1dea1
e047635a413486e35fe419402a618c7249b5ca7e
refs/heads/master
2020-02-26T15:42:10.304994
2016-11-28T11:14:49
2016-11-28T11:14:49
70,788,078
0
0
null
null
null
null
WINDOWS-1252
Java
false
false
5,252
java
package repository; import java.sql.Connection; import java.sql.DriverManager; 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 vo.BookVO; public class BookDAO { private final String DRIVER_NAME="org.mariadb.jdbc.Driver"; private final String DB_URL = "jdbc:mariadb://localhost:3306/jsp"; private final String DB_ID = "root"; private final String DB_PW = "sds902"; private Connection con; private Statement stmt; private PreparedStatement pstmt; private ResultSet rs; public BookDAO() { try { Class.forName(DRIVER_NAME); System.out.println("Driver Loading Complete!"); } catch (ClassNotFoundException e) { System.out.println("Driver Loading Fail!"); e.printStackTrace(); } } public void createConnection() { try { con = DriverManager.getConnection(DB_URL, DB_ID, DB_PW); System.out.println("Connection Construction Complete!"); } catch (SQLException e) { System.out.println("Connection Construction Fail!"); e.printStackTrace(); } } public void closeConnection() { if(con != null) { try { con.close(); } catch (SQLException e) { System.out.println("Connection Close Error!"); e.printStackTrace(); } } } public void closeStatement() { if(stmt != null) { try { stmt.close(); } catch (SQLException e) { System.out.println("Statement Close Error!"); e.printStackTrace(); } } } public void closePreparedStatement() { if(pstmt != null) { try { pstmt.close(); } catch (SQLException e) { System.out.println("PreparedStatement Close Error!"); e.printStackTrace(); } } } public void closeResultSet() { if(rs != null) { try { rs.close(); } catch (SQLException e) { System.out.println("ResultSet Close Error!"); e.printStackTrace(); } } } public int insert(BookVO book) { createConnection(); int result = 0; try { String sql = "INSERT INTO books (title, publisher, year, price) " + "VALUES(?,?,?,?)"; pstmt = con.prepareStatement(sql); pstmt.setString(1, book.getTitle()); pstmt.setString(2, book.getPublisher()); pstmt.setString(3, book.getYear()); pstmt.setInt(4, book.getPrice()); result = pstmt.executeUpdate(); } catch (SQLException e) { e.printStackTrace(); } finally { closePreparedStatement(); closeConnection(); } return result; } public int update(BookVO book) { createConnection(); String sql = "UPDATE books SET title=?, publisher=?, year=?, price=? WHERE book_id=?"; int result = 0; try { pstmt = con.prepareStatement(sql); pstmt.setString(1, book.getTitle()); pstmt.setString(2, book.getPublisher()); pstmt.setString(3, book.getYear()); pstmt.setInt(4, book.getPrice()); pstmt.setInt(5, book.getBookID()); result = pstmt.executeUpdate(); } catch (SQLException e) { e.printStackTrace(); } finally { closePreparedStatement(); closeConnection(); } return result; } public int delete(int bookID) { createConnection(); BookVO resultBook = null; String sql = "DELETE FROM books WHERE book_id=?"; int result=0; try { pstmt = con.prepareStatement(sql); pstmt.setInt(1, bookID); result = pstmt.executeUpdate(); } catch (SQLException e) { e.printStackTrace(); } finally { try { pstmt.close(); con.close(); } catch (SQLException e) { e.printStackTrace(); } } return result; } public BookVO select(int bookID) { createConnection(); BookVO resultBook = null; String sql = "SELECT book_id, title, publisher, year, price " + "FROM books WHERE book_id=?"; try { pstmt = con.prepareStatement(sql); pstmt.setInt(1, bookID); rs = pstmt.executeQuery(); if(rs.next()) { resultBook = new BookVO(); resultBook.setBookID(rs.getInt(1)); resultBook.setTitle(rs.getString(2)); resultBook.setPublisher(rs.getString(3)); resultBook.setYear(rs.getString(4)); resultBook.setPrice(rs.getInt(5)); } } catch (SQLException e) { e.printStackTrace(); } finally { closeResultSet(); closePreparedStatement(); closeConnection(); } return resultBook; } public List<BookVO> selectTotalList() { createConnection(); List<BookVO> bookList = new ArrayList<>(); String sql = "SELECT book_ID, title, publisher, year, price FROM books"; try { stmt = con.createStatement(); rs = stmt.executeQuery(sql); while(rs.next()) { BookVO book = new BookVO(); book.setBookID(rs.getInt(1)); book.setTitle(rs.getString(2)); book.setPublisher(rs.getString(3)); book.setYear(rs.getString(4)); book.setPrice(rs.getInt(5)); bookList.add(book); } } catch (SQLException e) { System.out.println("selectTotalList ¿¡·¯"); e.printStackTrace(); } finally { closeResultSet(); closeStatement(); closeConnection(); } return bookList; } }
[ "drakkarverenis@gmail.com" ]
drakkarverenis@gmail.com
79314f853de95db745da3f900e09cc2b2a0dae6b
d0c77686746a667d830c8d2b5d777f133f3b83f5
/JavaAdvance/mq/pulsar/src/main/java/io/kimmking/mq/pulsar/ConsumerDemo.java
7a1ac56d5bb648a822a87e91048b35cc483d127b
[ "MIT" ]
permissive
xiang12835/JavaLearning
ba8a473bb20ba8462b676b954c7fcc790e3c1bce
c86c2014b512c1ddaeb51e82dcb49367ed86235b
refs/heads/master
2023-03-15T20:15:35.191227
2022-04-23T13:36:40
2022-04-23T13:36:40
195,542,607
0
0
MIT
2023-03-08T17:35:10
2019-07-06T13:29:25
Java
UTF-8
Java
false
false
5,266
java
package io.kimmking.mq.pulsar; import lombok.SneakyThrows; import org.apache.pulsar.client.api.Consumer; import org.apache.pulsar.client.api.Message; import org.springframework.stereotype.Component; @Component public class ConsumerDemo { @SneakyThrows public void consume() { Consumer consumer = Config.createClient().newConsumer() .topic("my-kk") .subscriptionName("my-subscription") .subscribe(); while (true) { // Wait for a message Message msg = consumer.receive(); try { // Do something with the message System.out.printf("Message received from pulsar: %s \n", new String(msg.getData())); // Acknowledge the message so that it can be deleted by the message broker consumer.acknowledge(msg); } catch (Exception e) { // Message failed to process, redeliver later consumer.negativeAcknowledge(msg); } } // // client.newConsumer() // .deadLetterPolicy(DeadLetterPolicy.builder().maxRedeliverCount(10) // .deadLetterTopic("your-topic-name").build()) // .subscribe(); // Consumer consumer = client.newConsumer() // .topic("my-topic") // .subscriptionName("my-subscription") // .ackTimeout(10, TimeUnit.SECONDS) // .subscriptionType(SubscriptionType.Exclusive) // .subscribe(); // // CompletableFuture<Message> asyncMessage = consumer.receiveAsync(); // // Messages messages = consumer.batchReceive(); // for (Object message : messages) { // // do something // } // consumer.acknowledge(messages); // // BatchReceivePolicy.builder() // .maxNumMessage(-1) // .maxNumBytes(10 * 1024 * 1024) // .timeout(100, TimeUnit.MILLISECONDS) // .build(); // // Consumer consumer = client.newConsumer().topic("my-topic").subscriptionName("my-subscription") // .batchReceivePolicy(BatchReceivePolicy.builder(). // maxNumMessages(100).maxNumBytes(1024 * 1024) // .timeout(200, TimeUnit.MILLISECONDS) // .build()).subscribe(); // // ConsumerBuilder consumerBuilder = pulsarClient.newConsumer() // .subscriptionName(subscription); // //// Subscribe to all topics in a namespace // Pattern allTopicsInNamespace = Pattern.compile("public/default/.*"); // Consumer allTopicsConsumer = consumerBuilder // .topicsPattern(allTopicsInNamespace) // .subscribe(); // //// Subscribe to a subsets of topics in a namespace, based on regex // Pattern someTopicsInNamespace = Pattern.compile("public/default/foo.*"); // Consumer allTopicsConsumer = consumerBuilder // .topicsPattern(someTopicsInNamespace) // .subscribe(); // In the above example, the consumer subscribes to the persistent topics that can match the topic name pattern. If you want the consumer subscribes to all persistent and non-persistent topics that can match the topic name pattern, set subscriptionTopicsMode to RegexSubscriptionMode.AllTopics. // // Pattern pattern = Pattern.compile("public/default/.*"); // pulsarClient.newConsumer() // .subscriptionName("my-sub") // .topicsPattern(pattern) // .subscriptionTopicsMode(RegexSubscriptionMode.AllTopics) // .subscribe(); // Note // By default, the subscriptionTopicsMode of the consumer is PersistentOnly. Available options of subscriptionTopicsMode are PersistentOnly, NonPersistentOnly, and AllTopics. // // 你还可以订阅明确的主题列表 (如果愿意, 可跨命名空间): // // List<String> topics = Arrays.asList( // "topic-1", // "topic-2", // "topic-3" // ); // // Consumer multiTopicConsumer = consumerBuilder // .topics(topics) // .subscribe(); // //// Alternatively: // Consumer multiTopicConsumer = consumerBuilder // .topic( // "topic-1", // "topic-2", // "topic-3" // ) // .subscribe(); // You can also subscribe to multiple topics asynchronously using the subscribeAsync method rather than the synchronous subscribe method. The following is an example. // // Pattern allTopicsInNamespace = Pattern.compile("persistent://public/default.*"); // consumerBuilder // .topics(topics) // .subscribeAsync() // .thenAccept(this::receiveMessageFromConsumer); // // private void receiveMessageFromConsumer(Object consumer) { // ((Consumer)consumer).receiveAsync().thenAccept(message -> { // // Do something with the received message // receiveMessageFromConsumer(consumer); // }); // } } }
[ "yu.xiang@alibaba-inc.com" ]
yu.xiang@alibaba-inc.com
fbe7f747f5e710cf8c4b5a601ff97024a860ae9f
a3d0b8d4f9546c207518181cd043d8d620f3ddb2
/core/plugins/org.epics.util/src/org/epics/util/text/StringUtil.java
058c6e4081b774ffce29abf8203b91d324e458c5
[]
no_license
jhatje/cs-studio
ed2b42944ab6db6927a33643e687f81bf2cc686f
1d6a9d16c52b16823a236e7e32abad469a334197
refs/heads/master
2020-12-28T21:39:36.020993
2014-01-31T11:17:46
2014-01-31T11:17:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,178
java
/** * Copyright (C) 2012-14 epics-util developers. See COPYRIGHT.TXT * All rights reserved. Use is subject to license terms. See LICENSE.TXT */ package org.epics.util.text; import java.util.ArrayList; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * A set of utilities to parse strings. * * @author carcassi */ public class StringUtil { private StringUtil() { // Prevent instantiation } /** * The pattern of a string fragment with escape sequences. */ public static final String STRING_ESCAPE_SEQUENCE_REGEX = "\\\\(\"|\\\\|\'|r|n|b|t|u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]|[0-3]?[0-7]?[0-7])"; /** * The pattern of a string, including double quotes. */ public static final String QUOTED_STRING_REGEX = "\"([^\"\\\\]|" + StringUtil.STRING_ESCAPE_SEQUENCE_REGEX + ")*\""; /** * The pattern of a string using single quotes. */ public static final String SINGLEQUOTED_STRING_REGEX = "\'([^\"\\\\]|" + StringUtil.STRING_ESCAPE_SEQUENCE_REGEX + ")*\'"; /** * The pattern of a double value. */ public static final String DOUBLE_REGEX = "([-+]?[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?)"; static Pattern escapeSequence = Pattern.compile(STRING_ESCAPE_SEQUENCE_REGEX); /** * Takes a single quoted or double quoted String and returns the unquoted * and unescaped version of the string. * * @param quotedString the original string * @return the unquoted string */ public static String unquote(String quotedString) { return unescapeString(quotedString.substring(1, quotedString.length() - 1)); } /** * Takes an escaped string and returns the unescaped version * * @param escapedString the original string * @return the unescaped string */ public static String unescapeString(String escapedString) { Matcher match = escapeSequence.matcher(escapedString); StringBuffer output = new StringBuffer(); while(match.find()) { match.appendReplacement(output, substitution(match.group())); } match.appendTail(output); return output.toString(); } private static String substitution(String escapedToken) { switch (escapedToken) { case "\\\"": return "\""; case "\\\\": return "\\\\"; case "\\\'": return "\'"; case "\\r": return "\r"; case "\\n": return "\n"; case "\\b": return "\b"; case "\\t": return "\t"; } if (escapedToken.startsWith("\\u")) { // It seems that you can't use replace with an escaped // unicode sequence. Bug in Java? // Parsing myself return Character.toString((char) Long.parseLong(escapedToken.substring(2), 16)); } return Character.toString((char) Long.parseLong(escapedToken.substring(1), 8)); } /** * Parses a line of text representing comma separated values and returns * the values themselves. * * @param line the line to parse * @param separatorRegex the regular expression for the separator * @return the list of values */ public static List<Object> parseCSVLine(String line, String separatorRegex) { List<Object> matches = new ArrayList<>(); int currentPosition = 0; Matcher separatorMatcher = Pattern.compile("^" + separatorRegex).matcher(line); Matcher stringMatcher = Pattern.compile("^" + QUOTED_STRING_REGEX).matcher(line); Matcher doubleMatcher = Pattern.compile("^" + DOUBLE_REGEX).matcher(line); while (currentPosition < line.length()) { if (stringMatcher.region(currentPosition, line.length()).useAnchoringBounds(true).find()) { // Found String match String token = line.substring(currentPosition + 1, stringMatcher.end() - 1); matches.add(unescapeString(token)); currentPosition = stringMatcher.end(); } else if (doubleMatcher.region(currentPosition, line.length()).useAnchoringBounds(true).find()) { // Found Double match Double token = Double.parseDouble(line.substring(currentPosition, doubleMatcher.end())); matches.add(token); currentPosition = doubleMatcher.end(); } else { throw new IllegalArgumentException("Can't parse line: expected token at " + currentPosition + " (" + line + ")"); } if (currentPosition < line.length()) { if (!separatorMatcher.region(currentPosition, line.length()).useAnchoringBounds(true).find()) { throw new IllegalArgumentException("Can't parse line: expected separator at " + currentPosition + " (" + line + ")"); } currentPosition = separatorMatcher.end(); } } return matches; } }
[ "gabriele.carcassi@gmail.com" ]
gabriele.carcassi@gmail.com
04b6e5faeddd04640ed6205d12547c9d008c9804
6c9d3b01f41ac2df763d3e512844ec00fe9b182c
/src/main/java/com/ivoronline/springboot_db_query_native_named_repository_projections/runners/LoadPersons.java
eb3a1054e9efbb8df283bb4e1b2793e2ff02242f
[]
no_license
ivoronline/springboot_db_query_native_named_repository_projections
60b49e90a34f792180bd987007bfada413e80a4f
beb4e9a5e2af1ba18699b032ed4693dbeee25d63
refs/heads/master
2023-07-26T09:25:13.854519
2021-09-09T12:57:32
2021-09-09T12:57:32
404,722,310
0
0
null
null
null
null
UTF-8
Java
false
false
901
java
package com.ivoronline.springboot_db_query_native_named_repository_projections.runners; import com.ivoronline.springboot_db_query_native_named_repository_projections.entities.Person; import com.ivoronline.springboot_db_query_native_named_repository_projections.repositories.PersonRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.CommandLineRunner; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; @Component public class LoadPersons implements CommandLineRunner { @Autowired PersonRepository personRepository; @Override @Transactional public void run(String... args) throws Exception { //CREATE PERSON Person person = new Person(); person.name = "John"; person.age = 20; //SAVE PERSON personRepository.save(person); } }
[ "ivoronline@gmail.com" ]
ivoronline@gmail.com
813757524ef799fb189646f62c6af95ac26badaf
efea07f32c57c84d9c137fd9fd287f77d039d919
/javasource/interfaceshared/proxies/ProcessingStatus.java
1af5fb8f1774a442064bcbfb409c03cb99369d89
[ "MIT" ]
permissive
McDoyen/yavasource
a4e53bb519ded49f85c8475fca7c94abf1cfdaee
fe15e7d9c3d230465583764d01daedd6157060a8
refs/heads/master
2021-05-07T01:22:45.391241
2017-11-10T11:48:54
2017-11-10T11:48:54
110,241,187
0
0
null
null
null
null
UTF-8
Java
false
false
1,788
java
// This file was generated by Mendix Modeler. // // WARNING: Code you write here will be lost the next time you deploy the project. package interfaceshared.proxies; public enum ProcessingStatus { _New(new java.lang.String[][] { new java.lang.String[] { "en_US", "New" }, new java.lang.String[] { "nl_NL", "Nieuw" } }), Processed(new java.lang.String[][] { new java.lang.String[] { "en_US", "Processed" }, new java.lang.String[] { "nl_NL", "Verwerkt" } }), Stopped(new java.lang.String[][] { new java.lang.String[] { "en_US", "Stopped" }, new java.lang.String[] { "nl_NL", "Gestopt" } }), Error(new java.lang.String[][] { new java.lang.String[] { "en_US", "Error" }, new java.lang.String[] { "nl_NL", "Fout" } }), Warning(new java.lang.String[][] { new java.lang.String[] { "en_US", "Warning" }, new java.lang.String[] { "nl_NL", "Waarschuwing" } }), Error_Ignored(new java.lang.String[][] { new java.lang.String[] { "en_US", "Error Ignored" }, new java.lang.String[] { "nl_NL", "Fout genegeerd" } }), Reprocess(new java.lang.String[][] { new java.lang.String[] { "en_US", "Reprocess" }, new java.lang.String[] { "nl_NL", "Opnieuw verwerken" } }); private java.util.Map<java.lang.String, java.lang.String> captions; private ProcessingStatus(java.lang.String[][] captionStrings) { this.captions = new java.util.HashMap<java.lang.String, java.lang.String>(); for (java.lang.String[] captionString : captionStrings) captions.put(captionString[0], captionString[1]); } public java.lang.String getCaption(java.lang.String languageCode) { if (captions.containsKey(languageCode)) return captions.get(languageCode); return captions.get("en_US"); } public java.lang.String getCaption() { return captions.get("en_US"); } }
[ "mrpoloh@yahoo.co.uk" ]
mrpoloh@yahoo.co.uk
5108fa203e66f16e33b4a9f98f21d7b30d0bb68b
706bbefbe1109f5a257d293c81be57c9bbf4d110
/src/main/java/com/jrr/mystudent/web/websocket/ActivityService.java
21562e7f9e06d76f3e52cb3888cd0d2f803be7e3
[]
no_license
jreyesromero/jhipster-student
8c96e492d4e49ffa490755d4bbf5a29a95dd12e5
3eeadc9b8303b7bad5c5f029361769fa9f405b6b
refs/heads/master
2021-01-22T03:01:21.138252
2019-02-08T09:39:24
2019-02-08T09:39:24
81,090,996
0
0
null
null
null
null
UTF-8
Java
false
false
2,526
java
package com.jrr.mystudent.web.websocket; import com.jrr.mystudent.security.SecurityUtils; import com.jrr.mystudent.web.websocket.dto.ActivityDTO; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.context.ApplicationListener; import org.springframework.messaging.handler.annotation.Payload; import org.springframework.messaging.handler.annotation.SendTo; import org.springframework.messaging.simp.SimpMessageSendingOperations; import org.springframework.messaging.simp.annotation.SubscribeMapping; import org.springframework.messaging.simp.stomp.StompHeaderAccessor; import org.springframework.stereotype.Controller; import org.springframework.web.socket.messaging.SessionDisconnectEvent; import java.time.Instant; import java.time.LocalDateTime; import java.time.ZoneOffset; import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; import javax.inject.Inject; import java.security.Principal; import java.util.Calendar; import static com.jrr.mystudent.config.WebsocketConfiguration.IP_ADDRESS; @Controller public class ActivityService implements ApplicationListener<SessionDisconnectEvent> { private static final Logger log = LoggerFactory.getLogger(ActivityService.class); private DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); @Inject SimpMessageSendingOperations messagingTemplate; @SubscribeMapping("/topic/activity") @SendTo("/topic/tracker") public ActivityDTO sendActivity(@Payload ActivityDTO activityDTO, StompHeaderAccessor stompHeaderAccessor, Principal principal) { activityDTO.setUserLogin(SecurityUtils.getCurrentUserLogin()); activityDTO.setUserLogin(principal.getName()); activityDTO.setSessionId(stompHeaderAccessor.getSessionId()); activityDTO.setIpAddress(stompHeaderAccessor.getSessionAttributes().get(IP_ADDRESS).toString()); Instant instant = Instant.ofEpochMilli(Calendar.getInstance().getTimeInMillis()); activityDTO.setTime(dateTimeFormatter.format(ZonedDateTime.ofInstant(instant, ZoneOffset.systemDefault()))); log.debug("Sending user tracking data {}", activityDTO); return activityDTO; } @Override public void onApplicationEvent(SessionDisconnectEvent event) { ActivityDTO activityDTO = new ActivityDTO(); activityDTO.setSessionId(event.getSessionId()); activityDTO.setPage("logout"); messagingTemplate.convertAndSend("/topic/tracker", activityDTO); } }
[ "vagrant@vagrant.vm" ]
vagrant@vagrant.vm
460dcc976cf4cfea9ed37990f9dba5e67daf6bb7
ab7619cb640580c931b087d85f7f26fa176702e2
/h2/src/main/org/h2/server/web/DbTableOrView.java
de6f9ccafc2a70c448b323b87d5b93709f1370a6
[]
no_license
pkouki/icdm2017
440da58c66f56a36e98853ff34b14e2c066ed0f7
e05618c285c43416d7615bf41c812b6dede596bc
refs/heads/master
2021-01-21T13:29:22.566573
2017-11-19T04:29:47
2017-11-19T04:29:47
102,126,018
4
0
null
null
null
null
UTF-8
Java
false
false
1,721
java
/* * Copyright 2004-2009 H2 Group. Multiple-Licensed under the H2 License, * Version 1.0, and under the Eclipse Public License, Version 1.0 * (http://h2database.com/html/license.html). * Initial Developer: H2 Group */ package org.h2.server.web; import java.sql.DatabaseMetaData; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import org.h2.util.New; /** * Contains meta data information about a table or a view. * This class is used by the H2 Console. */ public class DbTableOrView { /** * The schema this table belongs to. */ DbSchema schema; /** * The table name. */ String name; /** * The quoted table name. */ String quotedName; /** * True if this represents a view. */ boolean isView; /** * The column list. */ DbColumn[] columns; DbTableOrView(DbSchema schema, ResultSet rs) throws SQLException { this.schema = schema; name = rs.getString("TABLE_NAME"); String type = rs.getString("TABLE_TYPE"); isView = "VIEW".equals(type); quotedName = schema.contents.quoteIdentifier(name); } /** * Read the column for this table from the database meta data. * * @param meta the database meta data */ void readColumns(DatabaseMetaData meta) throws SQLException { ResultSet rs = meta.getColumns(null, schema.name, name, null); ArrayList<DbColumn> list = New.arrayList(); while (rs.next()) { DbColumn column = new DbColumn(rs); list.add(column); } rs.close(); columns = new DbColumn[list.size()]; list.toArray(columns); } }
[ "pkouki@umiacs.umd.edu" ]
pkouki@umiacs.umd.edu
5fb1c6b27967eeb0ae23e4b304a9d0403cf053f2
b9a71bb2805d5f0d5ac98c59d984246463285d34
/testing/drools-master/kie-ci/src/main/java/org/kie/scanner/Aether.java
0142485017955e3fbe0e89e0b0c9199185f7c2d7
[ "MIT" ]
permissive
rokn/Count_Words_2015
486f3b292954adc76c9bcdbf9a37eb07421ddd2a
e07f6fc9dfceaf773afc0c3a614093e16a0cde16
refs/heads/master
2021-01-10T04:23:49.999237
2016-01-11T19:53:31
2016-01-11T19:53:31
48,538,207
1
1
null
null
null
null
UTF-8
Java
false
false
7,211
java
/* * Copyright 2015 Red Hat, Inc. and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.kie.scanner; import org.apache.maven.project.MavenProject; import org.apache.maven.repository.internal.MavenRepositorySystemUtils; import org.apache.maven.settings.Settings; import org.apache.maven.wagon.Wagon; import org.apache.maven.wagon.providers.http.HttpWagon; import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.connector.basic.BasicRepositoryConnectorFactory; import org.eclipse.aether.impl.DefaultServiceLocator; import org.eclipse.aether.repository.LocalRepository; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.spi.connector.RepositoryConnectorFactory; import org.eclipse.aether.spi.connector.transport.TransporterFactory; import org.eclipse.aether.transport.file.FileTransporterFactory; import org.eclipse.aether.transport.http.HttpTransporterFactory; import org.eclipse.aether.transport.wagon.WagonProvider; import org.kie.scanner.embedder.MavenSettings; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.File; import java.util.Collection; import java.util.HashSet; import static org.kie.scanner.embedder.MavenProjectLoader.loadMavenProject; public class Aether { private static final Logger log = LoggerFactory.getLogger(Aether.class); private String localRepoDir; private final boolean offline; public static Aether instance; private final RepositorySystem system; private RepositorySystemSession session; private final Collection<RemoteRepository> repositories; private RemoteRepository localRepository; private Aether(String localRepoDir, boolean offline) { this(loadMavenProject(offline), localRepoDir, offline); } Aether(MavenProject mavenProject) { this(mavenProject, MavenSettings.getSettings().getLocalRepository(), MavenSettings.getSettings().isOffline()); } public static synchronized Aether getAether() { if (instance == null) { Settings settings = MavenSettings.getSettings(); instance = new Aether(settings.getLocalRepository(), settings.isOffline()); } return instance; } private Aether(MavenProject mavenProject, String localRepoDir, boolean offline) { this.localRepoDir = localRepoDir; this.offline = offline; system = newRepositorySystem(); session = newRepositorySystemSession( system ); repositories = initRepositories(mavenProject); } private Collection<RemoteRepository> initRepositories(MavenProject mavenProject) { Collection<RemoteRepository> reps = new HashSet<RemoteRepository>(); reps.add( newCentralRepository() ); if (mavenProject != null) { reps.addAll(mavenProject.getRemoteProjectRepositories()); } RemoteRepository localRepo = newLocalRepository(); if (localRepo != null) { reps.add(localRepo); localRepository = localRepo; } return reps; } private RepositorySystem newRepositorySystem() { DefaultServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator(); locator.addService( RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class ); locator.addService( TransporterFactory.class, FileTransporterFactory.class ); locator.addService( TransporterFactory.class, HttpTransporterFactory.class ); locator.setServices( WagonProvider.class, new ManualWagonProvider() ); return locator.getService( RepositorySystem.class ); } private RepositorySystemSession newRepositorySystemSession( RepositorySystem system ) { LocalRepository localRepo = new LocalRepository( localRepoDir ); DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession(); session.setLocalRepositoryManager( system.newLocalRepositoryManager( session, localRepo ) ); session.setOffline(offline); return session; } private RemoteRepository newCentralRepository() { return new RemoteRepository.Builder( "central", "default", "http://repo1.maven.org/maven2/" ).build(); } private RemoteRepository newLocalRepository() { File m2RepoDir = new File( localRepoDir ); try { if (!m2RepoDir.exists()) { log.info( "The local repository directory " + localRepoDir + " doesn't exist. Creating it." ); m2RepoDir.mkdirs(); } String localRepositoryUrl = m2RepoDir.toURI().toURL().toExternalForm(); return new RemoteRepository.Builder( "local", "default", localRepositoryUrl ).build(); } catch (Exception e) { try { log.warn( "Cannot use directory " + localRepoDir + " as local repository.", e ); localRepoDir = IoUtils.getTmpDirectory().getAbsolutePath(); log.warn( "Using the temporary directory " + localRepoDir + " as local repository" ); m2RepoDir = new File( localRepoDir ); String localRepositoryUrl = m2RepoDir.toURI().toURL().toExternalForm(); return new RemoteRepository.Builder( "local", "default", localRepositoryUrl ).build(); } catch (Exception e1) { log.warn( "Cannot create a local repository in " + localRepoDir, e1 ); } } return null; } public RepositorySystem getSystem() { return system; } public RepositorySystemSession getSession() { return session; } public void renewSession() { session = newRepositorySystemSession( system ); } public Collection<RemoteRepository> getRepositories() { return repositories; } public RemoteRepository getLocalRepository() { return localRepository; } private static class ManualWagonProvider implements WagonProvider { public Wagon lookup( String roleHint ) throws Exception { if ( "http".equals( roleHint ) || "https".equals( roleHint ) ) { return new HttpWagon(); } if ( "sramp".equals( roleHint ) ) { try { return (Wagon) Class.forName("org.overlord.dtgov.jbpm.util.SrampWagonProxy").newInstance(); } catch (ClassNotFoundException cnfe) { log.warn("Cannot find sramp wagon implementation class", cnfe); } } return null; } public void release( Wagon wagon ) { } } }
[ "marto_dimitrov@mail.bg" ]
marto_dimitrov@mail.bg
35d7042f5432b9f149496105eafad6c963ae3fc5
3cf870ec335aa1b95e8776ea9b2a9d6495377628
/admin-sponge/build/tmp/recompileMc/sources/net/minecraft/block/BlockMelon.java
1118406750aa8354b97d776ef41814843d26b24b
[]
no_license
yk133/MyMc
d6498607e7f1f932813178e7d0911ffce6e64c83
e1ae6d97415583b1271ee57ac96083c1350ac048
refs/heads/master
2020-04-03T16:23:09.774937
2018-11-05T12:17:39
2018-11-05T12:17:39
155,402,500
0
0
null
null
null
null
UTF-8
Java
false
false
913
java
package net.minecraft.block; import java.util.Random; import net.minecraft.block.material.MapColor; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Items; import net.minecraft.item.Item; public class BlockMelon extends Block { protected BlockMelon() { super(Material.GOURD, MapColor.LIME); this.func_149647_a(CreativeTabs.BUILDING_BLOCKS); } public Item func_180660_a(IBlockState p_180660_1_, Random p_180660_2_, int p_180660_3_) { return Items.MELON_SLICE; } public int func_149745_a(Random p_149745_1_) { return 3 + p_149745_1_.nextInt(5); } public int func_149679_a(int p_149679_1_, Random p_149679_2_) { return Math.min(9, this.func_149745_a(p_149679_2_) + p_149679_2_.nextInt(1 + p_149679_1_)); } }
[ "1060682109@qq.com" ]
1060682109@qq.com
aee981516ef7a298c1efc266e9f1c259049d20c8
c0fe21b86f141256c85ab82c6ff3acc56b73d3db
/smartdba/src/main/java/com/jdcloud/sdk/service/smartdba/model/ConnectionInfo.java
24f2e21e43baea8979093981554f752cbf98a75a
[ "Apache-2.0" ]
permissive
jdcloud-api/jdcloud-sdk-java
3fec9cf552693520f07b43a1e445954de60e34a0
bcebe28306c4ccc5b2b793e1a5848b0aac21b910
refs/heads/master
2023-07-25T07:03:36.682248
2023-07-25T06:54:39
2023-07-25T06:54:39
126,275,669
47
61
Apache-2.0
2023-09-07T08:41:24
2018-03-22T03:41:41
Java
UTF-8
Java
false
false
2,500
java
/* * Copyright 2018 JDCLOUD.COM * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http:#www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * * * * * Contact: * * NOTE: This class is auto generated by the jdcloud code generator program. */ package com.jdcloud.sdk.service.smartdba.model; /** * connectionInfo */ public class ConnectionInfo implements java.io.Serializable { private static final long serialVersionUID = 1L; /** * 连接数上限 */ private Integer max; /** * 活跃连接数 */ private Integer running; /** * 当前连接数 */ private Integer connected; /** * get 连接数上限 * * @return */ public Integer getMax() { return max; } /** * set 连接数上限 * * @param max */ public void setMax(Integer max) { this.max = max; } /** * get 活跃连接数 * * @return */ public Integer getRunning() { return running; } /** * set 活跃连接数 * * @param running */ public void setRunning(Integer running) { this.running = running; } /** * get 当前连接数 * * @return */ public Integer getConnected() { return connected; } /** * set 当前连接数 * * @param connected */ public void setConnected(Integer connected) { this.connected = connected; } /** * set 连接数上限 * * @param max */ public ConnectionInfo max(Integer max) { this.max = max; return this; } /** * set 活跃连接数 * * @param running */ public ConnectionInfo running(Integer running) { this.running = running; return this; } /** * set 当前连接数 * * @param connected */ public ConnectionInfo connected(Integer connected) { this.connected = connected; return this; } }
[ "jdcloud-api@jd.com" ]
jdcloud-api@jd.com
cb647e0c83d1bba1044b4904ba4168bfa267caf6
498a47c9206af97547bf5222a19e5387a4e8f576
/app/src/main/java/com/triton/myvacala/adapter/FAQListAdapter.java
3de046637c70295eaabdb766f84fc84e35d52ad0
[]
no_license
worksintriton/myvacala_live_santhosh
811fce4665f6f8849714775880f335e85a4ebe02
03ca1153376e6daed146b679f68c3de14edba805
refs/heads/main
2023-08-19T04:46:31.713830
2021-10-04T13:17:53
2021-10-04T13:17:53
413,299,756
0
0
null
null
null
null
UTF-8
Java
false
false
4,313
java
package com.triton.myvacala.adapter; import android.annotation.SuppressLint; import android.app.Dialog; import android.content.Context; import android.os.Handler; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.triton.myvacala.R; import com.triton.myvacala.listeners.OnLoadMoreListener; import com.triton.myvacala.responsepojo.FAQResponse; import java.util.List; public class FAQListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { private static final int TYPE_ONE = 1; private static final int TYPE_LOADING = 5; private String TAG = "FAQListAdapter"; private List<FAQResponse.DataBean> fAQResponseList = null; private Context context; private OnLoadMoreListener mOnLoadMoreListener; private boolean isLoading; private int visibleThreshold = 5; private int lastVisibleItem, totalItemCount; FAQResponse.DataBean currentItem; String strMSgdaystime; String strMsg; Dialog dialog; public static String id = ""; public FAQListAdapter(Context context, List<FAQResponse.DataBean> fAQResponseList, RecyclerView inbox_list) { this.fAQResponseList = fAQResponseList; this.context = context; final LinearLayoutManager linearLayoutManager = (LinearLayoutManager) inbox_list.getLayoutManager(); inbox_list.addOnScrollListener(new RecyclerView.OnScrollListener() { @Override public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newState) { super.onScrollStateChanged(recyclerView, newState); } @Override public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) { super.onScrolled(recyclerView, dx, dy); totalItemCount = linearLayoutManager.getItemCount(); lastVisibleItem = linearLayoutManager.findLastVisibleItemPosition(); if (!isLoading && totalItemCount <= (lastVisibleItem + visibleThreshold)) { if (mOnLoadMoreListener != null) { mOnLoadMoreListener.onLoadMore(); } isLoading = true; } } }); final Handler handler = new Handler(); handler.postDelayed(new Runnable() { public void run() { handler.postDelayed(this, 120000); //now is every 2 minutes Log.i("Timer","Timer"); } }, 120000); } @NonNull @Override public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.adapter_faqlist_cardview, parent, false); return new ViewHolderOne(view); } @Override public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { initLayoutOne((ViewHolderOne) holder, position); } @SuppressLint("SetTextI18n") private void initLayoutOne(ViewHolderOne holder, final int position) { currentItem = fAQResponseList.get(position); for (int i = 0; i < fAQResponseList.size(); i++) { holder.txt_faq_questions.setText(currentItem.getQuestion()); holder.txt_faq_answer.setText(currentItem.getAnswer()); } } @Override public int getItemCount() { return fAQResponseList.size(); } public void setOnLoadMoreListener(OnLoadMoreListener mOnLoadMoreListener) { this.mOnLoadMoreListener = mOnLoadMoreListener; } @Override public int getItemViewType(int position) { return position; } class ViewHolderOne extends RecyclerView.ViewHolder { public TextView txt_faq_questions,txt_faq_answer; public ViewHolderOne(View itemView) { super(itemView); txt_faq_questions = itemView.findViewById(R.id.txt_faq_questions); txt_faq_answer = itemView.findViewById(R.id.txt_faq_answer); } } }
[ "worksintriton@gmail.com" ]
worksintriton@gmail.com
554188d32db46b3f410178c564efd33d816dd94d
200e1b937f508ab918e30e444ee7e8fd07e797f9
/Java_216/src/collections/Test0.java
576841ca790a9e899f5154af6434db873928eeed
[]
no_license
javaandselenium/Java216
85df42923917ff8080719535e0f1b1f3d636c4ab
ccd0001ff0f4553d2492aab703bd05614e9262b8
refs/heads/master
2023-02-03T23:37:36.690534
2020-12-22T16:49:56
2020-12-22T16:49:56
313,986,338
0
0
null
null
null
null
UTF-8
Java
false
false
470
java
package collections; import java.util.ArrayList; public class Test0 { public static void main(String[] args) { ArrayList a=new ArrayList(); a.add(10); a.add(20.00); a.add("Java"); a.add('A'); a.add(""); a.add(10); a.add(true); System.out.println(a.size()); //a.add(2,"Selenium"); //a.clear(); //a.remove(3); //System.out.println(a.isEmpty()); for(int i=0;i<a.size();i++) { System.out.println(a.get(i)); } } }
[ "QSP@DESKTOP-EVK9GMC" ]
QSP@DESKTOP-EVK9GMC
88d901ce467fc03a79e636e84a758d21bda0e010
91f073089796688e988fc06075c036663e621064
/UtilsModule/src/main/java/middlem/person/utilsmodule/lint/Test.java
4aea8c7be97622693658fed620a2f198373bb8d2
[]
no_license
hongqinghe/UtilsLib
b576bca55ab29d3908ed9e2b21f4fbf8599d3816
75302260ffe519facdf7f183c2c335069ee87938
refs/heads/master
2021-07-13T14:04:16.477068
2018-04-19T12:15:27
2018-04-19T12:15:27
109,475,621
0
0
null
null
null
null
UTF-8
Java
false
false
824
java
package middlem.person.utilsmodule.lint; /*********************************************** * <P> desc: * <P> Author: hehongqing * <P> Date: 2018/3/7 上午9:32 ***********************************************/ public class Test { static String test="The resource `R.string.umeng_socialize_text_tencent_key` appears to be unused"; public static void main(String[] args) { String[] split = test.split("`"); for (int i = 0; i < split.length; i++) { if (split[i].contains("R.")){ String[] split1 = split[i].split("\\."); System.out.println(split1); } } String s = split[1]; System.out.println("s字符串为:"+s+"\n"); String substring = s.substring(9); System.out.println("s1字符串为:"+substring+"\n"); } }
[ "gongtong@2dfire.com" ]
gongtong@2dfire.com
eff9ff1344809e2b50de1db8ae0d6a17e39b06ec
72e9d4a9caf6c18f7aa1b66d9319b87668d5d2c2
/examples/spring-data-dgs/src/main/java/com/blazebit/persistence/examples/spring/data/dgs/fetcher/CatFetcher.java
3eecb483bcfab8efba3c37a6399ac67432d8fb67
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
imanolache/blaze-persistence
f087355cd179fa21e4ed9f904b711be70365e9c6
41f7b0b45da372ba6c681e2b345b1ecdc1877530
refs/heads/master
2023-08-16T06:16:51.774550
2021-10-10T09:12:51
2021-10-10T09:12:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,405
java
/* * Copyright 2014 - 2021 Blazebit. * * 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.blazebit.persistence.examples.spring.data.dgs.fetcher; import com.blazebit.persistence.examples.spring.data.dgs.repository.CatViewRepository; import com.blazebit.persistence.examples.spring.data.dgs.view.CatWithOwnerView; import com.blazebit.persistence.integration.graphql.GraphQLEntityViewSupport; import com.blazebit.persistence.integration.graphql.GraphQLRelayConnection; import com.blazebit.persistence.view.EntityViewSetting; import com.blazebit.persistence.view.Sorters; import com.netflix.graphql.dgs.DgsComponent; import com.netflix.graphql.dgs.DgsQuery; import com.netflix.graphql.dgs.InputArgument; import graphql.schema.DataFetchingEnvironment; import org.springframework.beans.factory.annotation.Autowired; import java.util.Collections; /** * @author Christian Beikov * @since 1.6.2 */ @DgsComponent public class CatFetcher { @Autowired CatViewRepository repository; @Autowired GraphQLEntityViewSupport graphQLEntityViewSupport; @DgsQuery public CatWithOwnerView catById(@InputArgument("id") Long id, DataFetchingEnvironment dataFetchingEnvironment) { return repository.findById(graphQLEntityViewSupport.createSetting(dataFetchingEnvironment), Long.valueOf(dataFetchingEnvironment.getArgument("id"))); } @DgsQuery public GraphQLRelayConnection<CatWithOwnerView> findAll(DataFetchingEnvironment dataFetchingEnvironment) { EntityViewSetting<CatWithOwnerView, ?> setting = graphQLEntityViewSupport.createPaginatedSetting(dataFetchingEnvironment); setting.addAttributeSorter("id", Sorters.ascending()); if (setting.getMaxResults() == 0) { return new GraphQLRelayConnection<>(Collections.emptyList()); } return new GraphQLRelayConnection<>(repository.findAll(setting)); } }
[ "christian.beikov@gmail.com" ]
christian.beikov@gmail.com
d29bac78c56d1ee5d1070ebbaadb1ca1257883f1
5d76b555a3614ab0f156bcad357e45c94d121e2d
/src-v3/org/hamcrest/collection/IsIterableContainingInOrder.java
fb87b518ebb131a614295827178fbeb2d60ce97e
[]
no_license
BinSlashBash/xcrumby
8e09282387e2e82d12957d22fa1bb0322f6e6227
5b8b1cc8537ae1cfb59448d37b6efca01dded347
refs/heads/master
2016-09-01T05:58:46.144411
2016-02-15T13:23:25
2016-02-15T13:23:25
51,755,603
5
1
null
null
null
null
UTF-8
Java
false
false
3,809
java
package org.hamcrest.collection; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.hamcrest.Description; import org.hamcrest.Factory; import org.hamcrest.Matcher; import org.hamcrest.SelfDescribing; import org.hamcrest.TypeSafeDiagnosingMatcher; import org.hamcrest.core.IsEqual; public class IsIterableContainingInOrder<E> extends TypeSafeDiagnosingMatcher<Iterable<? extends E>> { private final List<Matcher<? super E>> matchers; private static class MatchSeries<F> { public final List<Matcher<? super F>> matchers; private final Description mismatchDescription; public int nextMatchIx; public MatchSeries(List<Matcher<? super F>> matchers, Description mismatchDescription) { this.nextMatchIx = 0; this.mismatchDescription = mismatchDescription; if (matchers.isEmpty()) { throw new IllegalArgumentException("Should specify at least one expected element"); } this.matchers = matchers; } public boolean matches(F item) { return isNotSurplus(item) && isMatched(item); } public boolean isFinished() { if (this.nextMatchIx >= this.matchers.size()) { return true; } this.mismatchDescription.appendText("No item matched: ").appendDescriptionOf((SelfDescribing) this.matchers.get(this.nextMatchIx)); return false; } private boolean isMatched(F item) { Matcher<? super F> matcher = (Matcher) this.matchers.get(this.nextMatchIx); if (matcher.matches(item)) { this.nextMatchIx++; return true; } describeMismatch(matcher, item); return false; } private boolean isNotSurplus(F item) { if (this.matchers.size() > this.nextMatchIx) { return true; } this.mismatchDescription.appendText("Not matched: ").appendValue(item); return false; } private void describeMismatch(Matcher<? super F> matcher, F item) { this.mismatchDescription.appendText("item " + this.nextMatchIx + ": "); matcher.describeMismatch(item, this.mismatchDescription); } } public IsIterableContainingInOrder(List<Matcher<? super E>> matchers) { this.matchers = matchers; } protected boolean matchesSafely(Iterable<? extends E> iterable, Description mismatchDescription) { MatchSeries<E> matchSeries = new MatchSeries(this.matchers, mismatchDescription); for (E item : iterable) { if (!matchSeries.matches(item)) { return false; } } return matchSeries.isFinished(); } public void describeTo(Description description) { description.appendText("iterable containing ").appendList("[", ", ", "]", this.matchers); } @Factory public static <E> Matcher<Iterable<? extends E>> contains(E... items) { List matchers = new ArrayList(); for (E item : items) { matchers.add(IsEqual.equalTo(item)); } return contains(matchers); } @Factory public static <E> Matcher<Iterable<? extends E>> contains(Matcher<? super E> itemMatcher) { return contains(new ArrayList(Arrays.asList(new Matcher[]{itemMatcher}))); } @Factory public static <E> Matcher<Iterable<? extends E>> contains(Matcher<? super E>... itemMatchers) { return contains(Arrays.asList(itemMatchers)); } @Factory public static <E> Matcher<Iterable<? extends E>> contains(List<Matcher<? super E>> itemMatchers) { return new IsIterableContainingInOrder(itemMatchers); } }
[ "binslashbash@otaking.top" ]
binslashbash@otaking.top
cd3689dac87376c4bfa889239860cff0ca5ea0c0
083d1781eab539d58b774d572d9ad458c5b38d5d
/cuckoo_video_line/cuckoo_video_line_android_2_5/bogo/src/main/java/com/eliaovideo/videoline/adapter/UserCashRecordAdapter.java
dc53348724e4a38ef7f6a1dd171c43f9bfb111bb
[]
no_license
zhubinsheng/cuckoo_video_line
90c5f4dbaa466e181814d771f4193055c8e78cc6
7eb0470adb63d846b276df11352b2d57a1dfef77
refs/heads/master
2022-02-16T22:13:06.514406
2019-08-03T01:47:26
2019-08-03T01:47:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
933
java
package com.eliaovideo.videoline.adapter; import android.support.annotation.Nullable; import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.BaseViewHolder; import com.eliaovideo.videoline.R; import com.eliaovideo.videoline.modle.CashBean; import java.util.List; /** * Created by 魏鹏 on 2018/3/13. * email:1403102936@qq.com * 山东布谷鸟网络科技有限公司著 */ public class UserCashRecordAdapter extends BaseQuickAdapter<CashBean,BaseViewHolder> { public UserCashRecordAdapter(@Nullable List<CashBean> data) { super(R.layout.item_user_cash_record,data); } @Override protected void convert(BaseViewHolder helper, CashBean item) { helper.setText(R.id.item_tv_content,"提现数量:" + item.getIncome()); helper.setText(R.id.item_tv_time,item.getCreate_time()); helper.setText(R.id.item_tv_status,item.getStatus()); } }
[ "807124011@qq.com" ]
807124011@qq.com
8e24b974432f133a0772563029d7c5605a28360a
a770e95028afb71f3b161d43648c347642819740
/sources/org/telegram/ui/LaunchActivity$$ExternalSyntheticLambda54.java
335eb8a38a43e40f7ba2a1bcb25d312369b631b9
[]
no_license
Edicksonjga/TGDecompiledBeta
d7aa48a2b39bbaefd4752299620ff7b72b515c83
d1db6a445d5bed43c1dc8213fb8dbefd96f6c51b
refs/heads/master
2023-08-25T04:12:15.592281
2021-10-28T20:24:07
2021-10-28T20:24:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,195
java
package org.telegram.ui; import android.net.Uri; import java.util.ArrayList; import org.telegram.messenger.MessagesStorage; import org.telegram.ui.ActionBar.AlertDialog; public final /* synthetic */ class LaunchActivity$$ExternalSyntheticLambda54 implements MessagesStorage.LongCallback { public final /* synthetic */ LaunchActivity f$0; public final /* synthetic */ int f$1; public final /* synthetic */ DialogsActivity f$2; public final /* synthetic */ boolean f$3; public final /* synthetic */ ArrayList f$4; public final /* synthetic */ Uri f$5; public final /* synthetic */ AlertDialog f$6; public /* synthetic */ LaunchActivity$$ExternalSyntheticLambda54(LaunchActivity launchActivity, int i, DialogsActivity dialogsActivity, boolean z, ArrayList arrayList, Uri uri, AlertDialog alertDialog) { this.f$0 = launchActivity; this.f$1 = i; this.f$2 = dialogsActivity; this.f$3 = z; this.f$4 = arrayList; this.f$5 = uri; this.f$6 = alertDialog; } public final void run(long j) { this.f$0.lambda$didSelectDialogs$59(this.f$1, this.f$2, this.f$3, this.f$4, this.f$5, this.f$6, j); } }
[ "fabian_pastor@msn.com" ]
fabian_pastor@msn.com
489c635bbe10577034aaa1398c11a523fe92a752
f133a4b649ad9d0e40bb2154af63747be5847de7
/app/src/main/java/com/jsjlzj/wayne/entity/dao/MdlVersion.java
f3eb94d66e46dc03de7da0328165dd29af1d6c9c
[]
no_license
led-os/Coach_App
76c4b48f1ed940cb9aecb34c098b218b8fa7b23e
c8bc42e7a27cff934ee92400aef5c3c1da9ef7d2
refs/heads/master
2022-12-07T00:09:49.025310
2020-08-17T02:30:02
2020-08-17T02:30:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,510
java
package com.jsjlzj.wayne.entity.dao; import java.util.Date; public class MdlVersion { private boolean forcedUpdate;//是否强制恒信 private boolean lastVersion;//是否最新版本 private String versionCode;//最新版本号 private String versionUrl;//url private long cxkDate; public boolean isForcedUpdate() { return forcedUpdate; } public void setForcedUpdate(boolean forcedUpdate) { this.forcedUpdate = forcedUpdate; } public boolean isLastVersion() { return lastVersion; } public void setLastVersion(boolean lastVersion) { this.lastVersion = lastVersion; } public String getVersionCode() { return versionCode; } public void setVersionCode(String versionCode) { this.versionCode = versionCode; } public String getVersionUrl() { return versionUrl; } public void setVersionUrl(String versionUrl) { this.versionUrl = versionUrl; } public long getCxkDate() { return cxkDate; } public void setCxkDate(long cxkDate) { this.cxkDate = cxkDate; } @Override public String toString() { return "{" + "\"forcedUpdate\":" + forcedUpdate + ", \"lastVersion\":" + lastVersion + ", \"versionCode\":\'" + versionCode + "\'" + ", \"versionUrl\":\'" + versionUrl + "\'" + ", \"cxkDate\":" + cxkDate + '}'; } }
[ "1104827297@qq.com" ]
1104827297@qq.com
ff5214d5ced1a48b165963b4b4f426744fbbb3d5
662834b40e8f87068e3b7607d80f60ddc6958edc
/workcraft/WorkcraftCore/src/org/workcraft/utils/EquationUtils.java
4cd9259036d21be930add9f63cd61f7aad12c3c8
[ "MIT" ]
permissive
danilovesky/workcraft
92fe5014ab9761de227ed4c83cc8c27b3101abf8
7a94b4f2fb9af1409f742c193adf2a0f21ce50cb
refs/heads/master
2023-09-01T19:43:26.819868
2023-04-07T22:03:28
2023-04-07T22:03:28
51,785,750
2
1
MIT
2018-09-07T11:34:11
2016-02-15T21:08:07
Java
UTF-8
Java
false
false
2,277
java
package org.workcraft.utils; import java.util.HashSet; import java.util.Set; public class EquationUtils { /* * Find roots of equation: a * x + b = 0 */ public static Set<Double> solveLinearEquation(double a, double b) { Set<Double> result = new HashSet<>(); if (a != 0.0) { result.add(-b / a); } return result; } /* * Find roots of equation: a * x^2 + b * x + c = 0 */ public static Set<Double> solveQuadraticEquation(double a, double b, double c) { if (a == 0) { return solveLinearEquation(b, c); } Set<Double> result = new HashSet<>(); double discriminant = b * b - 4.0 * a * c; if (discriminant >= 0.0) { double d = Math.sqrt(discriminant); result.add(0.5 * (-b + d) / a); result.add(0.5 * (-b - d) / a); } return result; } /* * Find roots of equation: a * x^3 + b * x^2 + c * x + d = 0 */ public static Set<Double> solveCubicEquation(double a, double b, double c, double d) { if (a == 0) { return solveQuadraticEquation(b, c, d); } Set<Double> result = new HashSet<>(); b = b / a; c = c / a; d = d / a; double p = c / 3 - b * b / 9; double q = b * b * b / 27 - b * c / 6 + d / 2; double discriminant = p * p * p + q * q; if (discriminant < 0) { // 3 roots double angle = Math.acos(-q / Math.sqrt(-p * p * p)); double distance = 2 * Math.sqrt(-p); for (int i = -1; i <= 1; i++) { double theta = (angle - 2 * Math.PI * i) / 3; result.add(distance * Math.cos(theta) - b / 3); } } else { if (discriminant < 0.000000001) { // 2 roots double r = Math.cbrt(-q); result.add(2 * r - b / 3); result.add(-r - b / 3); } else { // 1 root double r = Math.cbrt(-q + Math.sqrt(discriminant)); double s = Math.cbrt(-q - Math.sqrt(discriminant)); result.add(r + s - b / 3); } } return result; } }
[ "danilovesky@gmail.com" ]
danilovesky@gmail.com
f16cf82d8b39779c1aa3e0dc30e203fdd9c6aa38
ad60d7f92a681da8a28584b79bf90ccfdc659a69
/lab-12/initial/src/main/java/com/example/Lab12InitialApplication.java
f2a6931d1d5117b16273ddcd0e9039fbf72ce84d
[ "Apache-2.0" ]
permissive
andifalk/spring-basics-training
e849eed2a73b17472c1e444c2dcabe80ff3d55d0
b818ad2284cac70a9828939fa90fa5c37ba86106
refs/heads/master
2021-04-09T14:22:03.996821
2019-07-05T15:17:39
2019-07-05T15:17:39
125,479,107
2
3
null
null
null
null
UTF-8
Java
false
false
320
java
package com.example; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class Lab12InitialApplication { public static void main(String[] args) { SpringApplication.run(Lab12InitialApplication.class, args); } }
[ "andreas.falk@novatec-gmbh.de" ]
andreas.falk@novatec-gmbh.de
d7dbb64c85e2418d398a8d9fcf7eb548c2fffaa6
6d299ff60207a4c189787a49938e47275ab559a8
/openvidu-java-client/src/main/java/io/openvidu/java/client/KurentoOptions.java
0bec883fd3a2dfedda88c170ce5973c081016112
[ "Apache-2.0" ]
permissive
nyok92/openvidu
f7e0350747afa41206a0d94fbe9881ccfd161f61
d3bc1dd8ecb71e50ebb5154b7c2ac7db264ad9f6
refs/heads/master
2022-04-20T10:10:47.521290
2020-04-10T13:29:51
2020-04-10T13:29:51
254,657,908
0
0
Apache-2.0
2020-04-10T14:41:36
2020-04-10T14:41:35
null
UTF-8
Java
false
false
6,566
java
/* * (C) Copyright 2017-2020 OpenVidu (https://openvidu.io) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package io.openvidu.java.client; /** * See {@link io.openvidu.java.client.TokenOptions#getKurentoOptions()} */ public class KurentoOptions { private Integer videoMaxRecvBandwidth; private Integer videoMinRecvBandwidth; private Integer videoMaxSendBandwidth; private Integer videoMinSendBandwidth; private String[] allowedFilters; /** * * Builder for {@link io.openvidu.java.client.KurentoOptions} * */ public static class Builder { private Integer videoMaxRecvBandwidth; private Integer videoMinRecvBandwidth; private Integer videoMaxSendBandwidth; private Integer videoMinSendBandwidth; private String[] allowedFilters = {}; /** * Builder for {@link io.openvidu.java.client.KurentoOptions} */ public KurentoOptions build() { return new KurentoOptions(this.videoMaxRecvBandwidth, this.videoMinRecvBandwidth, this.videoMaxSendBandwidth, this.videoMinSendBandwidth, this.allowedFilters); } /** * Set value for * {@link io.openvidu.java.client.KurentoOptions#getVideoMaxRecvBandwidth()} */ public Builder videoMaxRecvBandwidth(int videoMaxRecvBandwidth) { this.videoMaxRecvBandwidth = videoMaxRecvBandwidth; return this; } /** * Set value for * {@link io.openvidu.java.client.KurentoOptions#getVideoMinRecvBandwidth()} */ public Builder videoMinRecvBandwidth(int videoMinRecvBandwidth) { this.videoMinRecvBandwidth = videoMinRecvBandwidth; return this; } /** * Set value for * {@link io.openvidu.java.client.KurentoOptions#getVideoMaxSendBandwidth()} */ public Builder videoMaxSendBandwidth(int videoMaxSendBandwidth) { this.videoMaxSendBandwidth = videoMaxSendBandwidth; return this; } /** * Set value for * {@link io.openvidu.java.client.KurentoOptions#getVideoMinSendBandwidth()} */ public Builder videoMinSendBandwidth(int videoMinSendBandwidth) { this.videoMinSendBandwidth = videoMinSendBandwidth; return this; } /** * Set value for * {@link io.openvidu.java.client.KurentoOptions#getAllowedFilters()} */ public Builder allowedFilters(String[] allowedFilters) { this.allowedFilters = allowedFilters; return this; } } public KurentoOptions(Integer videoMaxRecvBandwidth, Integer videoMinRecvBandwidth, Integer videoMaxSendBandwidth, Integer videoMinSendBandwidth, String[] allowedFilters) { this.videoMaxRecvBandwidth = videoMaxRecvBandwidth; this.videoMinRecvBandwidth = videoMinRecvBandwidth; this.videoMaxSendBandwidth = videoMaxSendBandwidth; this.videoMinSendBandwidth = videoMinSendBandwidth; this.allowedFilters = allowedFilters; } /** * Defines the maximum number of Kbps that the client owning the token will be * able to receive from Kurento Media Server. 0 means unconstrained. Giving a * value to this property will override the global configuration set in <a * href="https://docs.openvidu.io/en/stable/reference-docs/openvidu-server-params/#configuration-parameters-for-openvidu-server" * target="_blank">OpenVidu Server configuration</a> (parameter * <code>openvidu.streams.video.max-recv-bandwidth</code>) for every incoming * stream of the user owning the token. <br> * <strong>WARNING</strong>: the lower value set to this property limits every * other bandwidth of the WebRTC pipeline this server-to-client stream belongs * to. This includes the user publishing the stream and every other user * subscribed to the stream */ public Integer getVideoMaxRecvBandwidth() { return videoMaxRecvBandwidth; } /** * Defines the minimum number of Kbps that the client owning the token will try * to receive from Kurento Media Server. 0 means unconstrained. Giving a value * to this property will override the global configuration set in <a href= * "https://docs.openvidu.io/en/stable/reference-docs/openvidu-server-params/#configuration-parameters-for-openvidu-server" * target="_blank">OpenVidu Server configuration</a> (parameter * <code>openvidu.streams.video.min-recv-bandwidth</code>) for every incoming * stream of the user owning the token. */ public Integer getVideoMinRecvBandwidth() { return videoMinRecvBandwidth; } /** * Defines the maximum number of Kbps that the client owning the token will be * able to send to Kurento Media Server. 0 means unconstrained. Giving a value * to this property will override the global configuration set in <a href= * "https://docs.openvidu.io/en/stable/reference-docs/openvidu-server-params/#configuration-parameters-for-openvidu-server" * target="_blank">OpenVidu Server configuration</a> (parameter * <code>openvidu.streams.video.max-send-bandwidth</code>) for every outgoing * stream of the user owning the token. <br> * <strong>WARNING</strong>: this value limits every other bandwidth of the * WebRTC pipeline this client-to-server stream belongs to. This includes every * other user subscribed to the stream */ public Integer getVideoMaxSendBandwidth() { return videoMaxSendBandwidth; } /** * Defines the minimum number of Kbps that the client owning the token will try * to send to Kurento Media Server. 0 means unconstrained. Giving a value to * this property will override the global configuration set in <a href= * "https://docs.openvidu.io/en/stable/reference-docs/openvidu-server-params/#configuration-parameters-for-openvidu-server" * target="_blank">OpenVidu Server configuration</a> (parameter * <code>openvidu.streams.video.min-send-bandwidth</code>) for every outgoing * stream of the user owning the token. */ public Integer getVideoMinSendBandwidth() { return videoMinSendBandwidth; } /** * Defines the names of the filters the user owning the token will be able to * apply. See * <a href="https://docs.openvidu.io/en/stable/advanced-features/filters/" target= "_blank">Voice and * video filters</a> */ public String[] getAllowedFilters() { return allowedFilters; } }
[ "pablofuenteperez@gmail.com" ]
pablofuenteperez@gmail.com
19ef5b734e92ad3d187efed0f2724efe8ba2e600
cec628def1aad94ccbefa814d2a0dbd51588e9bd
/mercurial.remote/src/org/netbeans/modules/mercurial/remote/ui/rollback/BackoutPanel.java
9449723caded72999bb84279d27623a23444b083
[]
no_license
emilianbold/netbeans-releases
ad6e6e52a896212cb628d4522a4f8ae685d84d90
2fd6dc84c187e3c79a959b3ddb4da1a9703659c7
refs/heads/master
2021-01-12T04:58:24.877580
2017-10-17T14:38:27
2017-10-17T14:38:27
78,269,363
30
15
null
2020-10-13T08:36:08
2017-01-07T09:07:28
null
UTF-8
Java
false
false
4,979
java
/* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved. * * Oracle and Java are registered trademarks of Oracle and/or its affiliates. * Other names may be trademarks of their respective owners. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common * Development and Distribution License("CDDL") (collectively, the * "License"). You may not use this file except in compliance with the * License. You can obtain a copy of the License at * http://www.netbeans.org/cddl-gplv2.html * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the * specific language governing permissions and limitations under the * License. When distributing the software, include this License Header * Notice in each file and include the License file at * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the GPL Version 2 section of the License file that * accompanied this code. If applicable, add the following below the * License Header, with the fields enclosed by brackets [] replaced by * your own identifying information: * "Portions Copyrighted [year] [name of copyright owner]" * * Contributor(s): * * The Original Software is NetBeans. The Initial Developer of the Original * Software is Sun Microsystems, Inc. Portions Copyright 1997-2009 Sun * Microsystems, Inc. All Rights Reserved. * * If you wish your version of this file to be governed by only the CDDL * or only the GPL Version 2, indicate your decision by adding * "[Contributor] elects to include this software in this distribution * under the [CDDL or GPL Version 2] license." If you do not indicate a * single choice of license, a recipient has the option to distribute * your version of this file under either the CDDL, the GPL Version 2 or * to extend the choice of license to its licensees as provided above. * However, if you add GPL Version 2 code and therefore, elected the GPL * Version 2 license, then the option applies only if the new code is * made subject to such option by the copyright holder. */ package org.netbeans.modules.mercurial.remote.ui.rollback; import java.awt.BorderLayout; import javax.swing.JPanel; import org.netbeans.modules.mercurial.remote.ui.log.HgLogMessage; import org.netbeans.modules.mercurial.remote.ui.repository.ChangesetPickerPanel; import org.netbeans.modules.versioning.core.api.VCSFileProxy; import org.openide.util.NbBundle; /** * * @author Padraig O'Briain */ public class BackoutPanel extends ChangesetPickerPanel { private javax.swing.JLabel commitLabel; private javax.swing.JTextField commitMsgField; private final HgLogMessage repoRev; public BackoutPanel(VCSFileProxy repo, HgLogMessage repoRev) { super(repo, null); this.repoRev = repoRev; initComponents(); } public String getCommitMessage() { return commitMsgField.getText(); } @Override protected String getRefreshLabel() { return NbBundle.getMessage(Backout.class, "MSG_Refreshing_Backout_Versions"); //NOI18N } @Override protected HgLogMessage getDisplayedRevision() { return repoRev; } @Override protected void loadRevisions () { super.loadRevisions(); } private void initComponents() { org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(BackoutPanel.class, "BackoutPanel.infoLabel.text")); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(jLabel2, org.openide.util.NbBundle.getMessage(BackoutPanel.class, "BackoutPanel.infoLabel2.text")); // NOI18N if(repoRev != null){ org.openide.awt.Mnemonics.setLocalizedText(revisionsLabel, org.openide.util.NbBundle.getMessage(BackoutPanel.class, "CTL_ChoosenRevision")); // NOI18N } commitMsgField = new javax.swing.JTextField(); commitLabel = new javax.swing.JLabel(); commitLabel.setLabelFor(commitMsgField); commitMsgField.setText(NbBundle.getMessage(BackoutPanel.class, "BackoutPanel.commitMsgField.text", BackoutAction.HG_BACKOUT_REVISION)); //NOI18N org.openide.awt.Mnemonics.setLocalizedText(commitLabel, org.openide.util.NbBundle.getMessage(BackoutPanel.class, "BackoutPanel.commitLabel.text")); // NOI18N commitMsgField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(BackoutPanel.class, "ACSD_commitMsgField")); // NOI18N JPanel optionsPanel = new JPanel(new BorderLayout(10, 0)); optionsPanel.add(commitLabel, BorderLayout.WEST); optionsPanel.add(commitMsgField, BorderLayout.CENTER); optionsPanel.setBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0)); setOptionsPanel(optionsPanel, null); } }
[ "alexvsimon@netbeans.org" ]
alexvsimon@netbeans.org
5e417ac39acc5b2ecd398261b3dff4839b2987cb
369270a14e669687b5b506b35895ef385dad11ab
/java.xml/com/sun/org/apache/bcel/internal/generic/ISHL.java
2248c8742c3f9ea3d4bc7fa7c1b19a13ea71042e
[]
no_license
zcc888/Java9Source
39254262bd6751203c2002d9fc020da533f78731
7776908d8053678b0b987101a50d68995c65b431
refs/heads/master
2021-09-10T05:49:56.469417
2018-03-20T06:26:03
2018-03-20T06:26:03
125,970,208
3
3
null
null
null
null
UTF-8
Java
false
false
1,813
java
/* * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.sun.org.apache.bcel.internal.generic; /** * ISHL - Arithmetic shift left int * <PRE>Stack: ..., value1, value2 -&gt; ..., result</PRE> * * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> */ public class ISHL extends ArithmeticInstruction { public ISHL() { super(com.sun.org.apache.bcel.internal.Constants.ISHL); } /** * Call corresponding visitor method(s). The order is: * Call visitor methods of implemented interfaces first, then * call methods according to the class hierarchy in descending order, * i.e., the most specific visitXXX() call comes last. * * @param v Visitor object */ public void accept(Visitor v) { v.visitTypedInstruction(this); v.visitStackProducer(this); v.visitStackConsumer(this); v.visitArithmeticInstruction(this); v.visitISHL(this); } }
[ "841617433@qq.com" ]
841617433@qq.com
d2622198ec76fbb3277984ce5a2e2388bb36d10f
8430cd0a92af431fa85e92a7c5ea20b8efda949f
/DataBase-Advance-Hibernate/SpringDateAutoMappingObjects-Lab/EmployeeSystem/src/main/java/application/repositories/AddressRepository.java
8501e24e5d7867a6dee4e9e5e7c289ffeedd413a
[]
no_license
Joret0/Exercises-with-Java
9a93e39236b88bb55335e6cff62d2e774f78b054
a1b2f64aafdf8ce8b28fb20f31aa5e37b9643652
refs/heads/master
2021-09-16T04:28:49.605116
2018-06-16T14:32:52
2018-06-16T14:32:52
71,498,826
0
0
null
null
null
null
UTF-8
Java
false
false
270
java
package application.repositories; import application.models.Address; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; @Repository public interface AddressRepository extends JpaRepository<Address, Long>{ }
[ "georgi_stalev@abv.bg" ]
georgi_stalev@abv.bg
2b8f18d22a4f97d7589b1cbedd04f326c51e706f
9f907527f44fdfc33b5add9f8d313bbeb96d1192
/src/codeforces/contests901_1000/problemset902/VisitingAFriend.java
88f66972198f0850c61b2452a4636831e0594d39
[]
no_license
kocko/algorithms
7af7052b13a080992dcfbff57171a2cac7c50c67
382b6b50538220a26e1af1644e72a4e1796374b6
refs/heads/master
2023-08-03T21:15:27.070471
2023-08-03T14:39:45
2023-08-03T14:39:45
45,342,667
5
0
null
null
null
null
UTF-8
Java
false
false
2,158
java
package codeforces.contests901_1000.problemset902; import java.io.BufferedReader; import java.io.Closeable; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; public class VisitingAFriend implements Closeable { private InputReader in = new InputReader(System.in); private PrintWriter out = new PrintWriter(System.out); public void solve() { int n = in.ni(), m = in.ni(); boolean[] reachable = new boolean[101]; for (int i = 0; i < n; i++) { int x = in.ni(), y = in.ni(); for (int j = x + 1; j <= y; j++) { reachable[j] = true; } } boolean ok = true; for (int i = 1; i <= m; i++) { ok &= reachable[i]; } out.println(ok ? "YES" : "NO"); } @Override public void close() throws IOException { in.close(); out.close(); } static class InputReader { public BufferedReader reader; public StringTokenizer tokenizer; public InputReader(InputStream stream) { reader = new BufferedReader(new InputStreamReader(stream), 32768); tokenizer = null; } public String next() { while (tokenizer == null || !tokenizer.hasMoreTokens()) { try { tokenizer = new StringTokenizer(reader.readLine()); } catch (IOException e) { throw new RuntimeException(e); } } return tokenizer.nextToken(); } public int ni() { return Integer.parseInt(next()); } public long nl() { return Long.parseLong(next()); } public void close() throws IOException { reader.close(); } } public static void main(String[] args) throws IOException { try (VisitingAFriend instance = new VisitingAFriend()) { instance.solve(); } } }
[ "konstantin.yovkov@tis.biz" ]
konstantin.yovkov@tis.biz
2c8c153d16364daa723410bb3bf32881dc04e743
a0df441ca8c96ce9e15c5854f6d37cf9689a47a6
/src/main/java/impatient/ch02/sec01/ReferenceDemo.java
f17b7f4e9525875b5301f59a58a4a5fc45a0a012
[]
no_license
goodwinn11/core-java
a5901c7a730e4edb66129c5d676e3e3463bd0639
513871fbaa2068bd7efc60fa74b536b54945b352
refs/heads/master
2022-11-29T16:20:16.604318
2020-08-14T00:42:16
2020-08-14T00:42:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
503
java
/* * Chapter 2 - Classes * Reference Demo */ package impatient.ch02.sec01; import java.util.ArrayList; /** * Accessor and Mutator methods * Object References * @author emaphis */ public class ReferenceDemo { public static void main(String[] args) { ArrayList<String> friends = new ArrayList<>(); friends.add("Peter"); // size 1 ArrayList<String> people = friends; // refers to same object. people.add("Paul"); System.out.println("friends: " + friends); } }
[ "emaphis85@gmail.com" ]
emaphis85@gmail.com
d5bb944b1cb94aff367440ba5f3d0f520323f359
60c14104d2f29f16417e26c1e0cdcff19ec6b2f0
/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/eureka/EurekaDiscoveryClient.java
308b491bb2b35d61837475172d855dce5373d0b1
[ "LicenseRef-scancode-generic-cla", "Apache-2.0" ]
permissive
srinisubra/spring-cloud-netflix
2ec7ddf501f7f3013b3be199663d58a27ee7ce13
eba0cc0b7ac77958c3b1ef97fd8fa49c898e6a1b
refs/heads/master
2020-12-27T12:16:21.363992
2014-11-14T01:11:11
2014-11-14T01:11:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
889
java
package org.springframework.cloud.netflix.eureka; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cloud.client.ServiceInstance; import org.springframework.cloud.client.discovery.DiscoveryClient; /** * @author Spencer Gibb */ public class EurekaDiscoveryClient implements DiscoveryClient { @Autowired private EurekaInstanceConfigBean config; @Override public ServiceInstance getLocalServiceInstance() { return new ServiceInstance() { @Override public String getServiceId() { return config.getAppname(); } @Override public String getHost() { return config.getHostname(); } @Override public int getPort() { return config.getNonSecurePort(); } }; } }
[ "spencer@gibb.us" ]
spencer@gibb.us
f7b71bf9d144728722f27c0ab05ca0c9332500d1
c7c300fc76f4c810ebd024c54b1602ef680fc013
/src/com/atguigu/M08组合模式composite/University.java
0610416e0d7a00afc0492134a6f4e526c2432182
[]
no_license
yiitree/DesignPattern
701ee73f041346e0eaf8d66287497ac13ba4aef4
3610a4887a162f491cec92699e9aa6aa56361610
refs/heads/master
2022-12-18T14:48:24.770921
2020-09-25T09:53:52
2020-09-25T09:53:52
295,628,550
0
0
null
null
null
null
GB18030
Java
false
false
1,218
java
package com.atguigu.M08组合模式composite; import java.util.ArrayList; import java.util.List; //University 就是 Composite , 可以管理College public class University extends OrganizationComponent { // 存放College List<OrganizationComponent> organizationComponents = new ArrayList<OrganizationComponent>(); // 构造器 public University(String name, String des) { super(name, des); } // 重写add @Override protected void add(OrganizationComponent organizationComponent) { organizationComponents.add(organizationComponent); } // 重写remove @Override protected void remove(OrganizationComponent organizationComponent) { organizationComponents.remove(organizationComponent); } @Override public String getName() { return super.getName(); } @Override public String getDes() { return super.getDes(); } // print方法,就是输出University 包含的学院 @Override protected void print() { System.out.println("--------------" + getName() + "--------------"); //遍历 organizationComponents for (OrganizationComponent organizationComponent : organizationComponents) { organizationComponent.print(); } } }
[ "772701414@qq.com" ]
772701414@qq.com
f5bbdd0f77d5f3d5446408b0ed4cc70ccaa6c0fa
f843788f75b1ff8d5ff6d24fd7137be1b05d1aa6
/src/ac/biu/nlp/nlp/instruments/ner/NamedEntityWord.java
4169a3ed1e872850fd71b3d9d86d5fb0ae79d8f9
[]
no_license
oferbr/biu-infrastructure
fe830d02defc7931f9be239402931cfbf223c05e
051096636b705ffe7756f144f58c384a56a7fcc3
refs/heads/master
2021-01-19T08:12:33.484302
2013-02-05T16:08:58
2013-02-05T16:08:58
6,156,024
2
0
null
2012-11-18T09:42:20
2012-10-10T11:02:33
Java
UTF-8
Java
false
false
1,171
java
package ac.biu.nlp.nlp.instruments.ner; import ac.biu.nlp.nlp.instruments.parse.representation.basic.NamedEntity; /** * Represents a word with a {@link NamedEntity} value assigned to it. * <P> * If no {@link NamedEntity} was assigned - then the {@link #namedEntity} field * is set to <code> null </code> * <P> * This class is immutable. * @author Asher Stern * */ public final class NamedEntityWord { /** * Straightforward constructor * @param word the word * @param namedEntity its {@link NamedEntity} value. May be <code> null </code> * if no such {@link NamedEntity} was set. */ public NamedEntityWord(String word, NamedEntity namedEntity) { this.word = word; this.namedEntity = namedEntity; } /** * Returns the word * @return the word */ public String getWord() { return word; } /** * Returns the {@link NamedEntity} assigned to that word * @return the {@link NamedEntity} assigned to that word (may be * <code> null </code>). */ public NamedEntity getNamedEntity() { return namedEntity; } protected String word; protected NamedEntity namedEntity; }
[ "oferbr@gmail.com" ]
oferbr@gmail.com
c3848f76636d676b94ecef3a35a156ec5d4325ab
5fb6fcbec4681d68ecf90dab1c599dd2f1491868
/services/open-cloud-msg-client/src/main/java/com/opencloud/msg/client/model/entity/EmailConfig.java
615f5639ccee65e8058f621f501e89e976655e07
[ "MIT" ]
permissive
xiewei9999/open-cloud
5058c25799b55c5f4e1f517bc3fd1069ea74b746
ae1c4364c109a4ca9dbd655ce19dbbc3f0beb7de
refs/heads/master
2020-06-26T10:08:17.280313
2019-07-30T06:09:46
2019-07-30T06:09:46
199,598,546
0
0
null
null
null
null
UTF-8
Java
false
false
2,197
java
package com.opencloud.msg.client.model.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.opencloud.common.mybatis.base.entity.AbstractEntity; import org.apache.ibatis.type.Alias; /** * 邮件发送配置 * * @author liuyadu * @date 2019-07-17 */ @Alias("email_config") @TableName("msg_email_config") public class EmailConfig extends AbstractEntity { private static final long serialVersionUID = 1L; @TableId(value = "config_id", type = IdType.ID_WORKER) private Long configId; /** * 配置名称 */ private String name; /** * 发件服务器域名 */ private String smtpHost; /** * 发件服务器账户 */ private String smtpUsername; /** * 发件服务器密码 */ private String smtpPassword; /** * 保留数据0-否 1-是 不允许删除 */ private Boolean isPersist; /** * 是否为默认 0-否 1-是 */ private Boolean isDefault; public Long getConfigId() { return configId; } public void setConfigId(Long configId) { this.configId = configId; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getSmtpHost() { return smtpHost; } public void setSmtpHost(String smtpHost) { this.smtpHost = smtpHost; } public String getSmtpUsername() { return smtpUsername; } public void setSmtpUsername(String smtpUsername) { this.smtpUsername = smtpUsername; } public String getSmtpPassword() { return smtpPassword; } public void setSmtpPassword(String smtpPassword) { this.smtpPassword = smtpPassword; } public Boolean getIsPersist() { return isPersist; } public void setIsPersist(Boolean persist) { isPersist = persist; } public Boolean getIsDefault() { return isDefault; } public void setIsDefault(Boolean aDefault) { isDefault = aDefault; } }
[ "515608851@qq.com" ]
515608851@qq.com
e9cbee8ce1de4f7dcff956d1644d0f032e86027b
599adceef8bb0c314182a0a38d0afa936bdafaf5
/yugandhar-open-mdmhub-ews/yugandhar-mdmhub-component-ews/src/com/yugandhar/mdm/corecomponent/PersonnamesRepository.java
a08d5458ac1e7eaa95eba0b17ed92994b635b0d4
[ "Apache-2.0" ]
permissive
yugandharproject/yugandhar-open-mdmhub
7631c4dc77e9d72921d5c63351378208a9fec9d2
1672a6e0551d94a857366d5393603175020c7297
refs/heads/master
2020-03-20T12:55:55.943439
2018-07-27T05:34:41
2018-07-27T05:34:41
137,443,949
1
0
null
null
null
null
UTF-8
Java
false
false
1,106
java
package com.yugandhar.mdm.corecomponent; /* Generated Jul 5, 2017 3:05:23 PM by Hibernate Tools 5.2.1.Final using Yugandhar custom templates. Generated and to be used in accordance with Yugandhar Licensing Terms. */ import java.util.List; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import com.yugandhar.mdm.extern.dobj.PersonnamesDO; public interface PersonnamesRepository extends JpaRepository<PersonnamesDO, Long> { /* //Get All records by some id @Query("select dobj from PersonnamesDO dobj where <SomeId>= ?1") List<PersonnamesDO> findAllBy<SomeId>(String <SomeId>); //Get All ACTIVE records by some id @Query("select dobj from PersonnamesDO dobj where <SomeId>= ?1 and (dobj.deletedTs is null or dobj.deletedTs > CURRENT_TIMESTAMP)") List<PersonnamesDO> findAllActiveBy<SomeId>(String <SomeId>); //Get All INACTIVE records by some id @Query("select dobj from PersonnamesDO dobj where <SomeId>= ?1 and dobj.deletedTs < CURRENT_TIMESTAMP") List<PersonnamesDO> findAllInActiveBy<SomeId>(String <SomeId>); */ }
[ "rakeshvikharblogger@gmail.com" ]
rakeshvikharblogger@gmail.com
deeb1afd2ba2905fbc36e3ec96fc25e29e387c97
e155d01f4fd679836d1e99a650f2eb19df57361c
/src/main/java/org/codehaus/mojo/gwt/eclipse/EclipseUtil.java
46ba1577dcf3966975be604a1e2e1168d52feaf9
[]
no_license
ValCapri/gwt-maven-plugin
91b00f870f45af9feb3bc489b428550d10503cb2
cd7562cfd6028c9cbcad9c106fbc1959503685e1
refs/heads/master
2021-01-17T10:25:57.892180
2014-05-10T21:46:39
2014-05-10T21:46:39
19,321,283
2
0
null
null
null
null
UTF-8
Java
false
false
1,933
java
package org.codehaus.mojo.gwt.eclipse; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.File; import org.apache.maven.project.MavenProject; import org.codehaus.plexus.logging.AbstractLogEnabled; import org.codehaus.plexus.util.ReaderFactory; import org.codehaus.plexus.util.xml.Xpp3Dom; import org.codehaus.plexus.util.xml.Xpp3DomBuilder; /** * @author ndeloof * @version $Id$ * @plexus.component role="org.codehaus.mojo.gwt.eclipse.EclipseUtil" */ public class EclipseUtil extends AbstractLogEnabled { /** * Read the Eclipse project name for .project file. Fall back to artifactId on error * * @return project name in eclipse workspace */ public String getProjectName( MavenProject project ) { File dotProject = new File( project.getBasedir(), ".project" ); try { Xpp3Dom dom = Xpp3DomBuilder.build( ReaderFactory.newXmlReader( dotProject ) ); return dom.getChild( "name" ).getValue(); } catch ( Exception e ) { getLogger().warn( "Failed to read the .project file" ); return project.getArtifactId(); } } }
[ "olamy@52ab4f32-60fc-0310-b215-8acea882cd1b" ]
olamy@52ab4f32-60fc-0310-b215-8acea882cd1b
d4a59f1fb24bcffb60d97e3125cc0d89c614459c
eb97ee5d4f19d7bf028ae9a400642a8c644f8fe3
/tags/2008-08-26/seasar2-2.4.28/s2jdbc-gen/s2jdbc-gen-core/src/main/java/org/seasar/extension/jdbc/gen/version/DdlVersionIncrementer.java
eef2789ba1951ff23a347638e7e6fbc7e7b5c832
[ "Apache-2.0" ]
permissive
svn2github/s2container
54ca27cf0c1200a93e1cb88884eb8226a9be677d
625adc6c4e1396654a7297d00ec206c077a78696
refs/heads/master
2020-06-04T17:15:02.140847
2013-08-09T09:38:15
2013-08-09T09:38:15
10,850,644
0
1
null
null
null
null
UTF-8
Java
false
false
1,261
java
/* * Copyright 2004-2008 the Seasar Foundation and the Others. * * 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.seasar.extension.jdbc.gen.version; import java.io.File; /** * DDLのバージョンを増分するインタフェースです。 * * @author taedium */ public interface DdlVersionIncrementer { /** * バージョンを増分します。 * * @param callback * コールバック */ void increment(Callback callback); /** * コールバックのインタフェースです。 * * @author taedium */ interface Callback { void execute(File createDir, File dropDir, int versionNo); } }
[ "koichik@319488c0-e101-0410-93bc-b5e51f62721a" ]
koichik@319488c0-e101-0410-93bc-b5e51f62721a
dc5bf2ca15438c3e0ee2b2b1ba67f616c0f88cc7
e135c80892fe5cf75e31ba70a9cb869fd2c20c07
/01.Fundamental_Level_Java_2016/04.Java_OOP_Advanced_Jul_2016/00.DesignPatternsExamples/src/behavioral/chainOfResponsibility/chains/ATMDispenseChain.java
8bc8ed8d48ad55578438ffd4d9b3e1135132d68c
[]
no_license
NikolayShaliavski/SoftUni
444f3ec76886af21e84d472631ca56c958453570
08b8b345ebbef8de87db777ad59fb7c5044f1003
refs/heads/master
2021-06-22T00:30:49.970663
2021-01-08T15:20:44
2021-01-08T15:20:44
63,480,683
2
0
null
null
null
null
UTF-8
Java
false
false
789
java
package behavioral.chainOfResponsibility.chains; import behavioral.chainOfResponsibility.chains.chainImlementations.Dollar10Dispenser; import behavioral.chainOfResponsibility.chains.chainImlementations.Dollar20Dispenser; import behavioral.chainOfResponsibility.chains.chainImlementations.Dollar50Dispenser; public class ATMDispenseChain { //first chain is dispenser for highest amount - 50 dollars public DispenseChain chain1; public ATMDispenseChain() { //initialize chains this.chain1 = new Dollar50Dispenser(); DispenseChain chain2 = new Dollar20Dispenser(); DispenseChain chain3 = new Dollar10Dispenser(); //set the chain of responsibility this.chain1.setNextChain(chain2); chain2.setNextChain(chain3); } }
[ "nshaliavski@gmail.com" ]
nshaliavski@gmail.com
a214f20549467debe710e972946d875b0a209b21
d6ee393f6e3728a5cdc8dc5cbf3cb09edffcbf25
/service_impl/src/main/java/com/techsoft/dao/equip/EquipFixtureDaoImpl.java
5c6a56c0baceaf674970a0c4d1d450c23cffc912
[]
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,387
java
package com.techsoft.dao.equip; import javax.annotation.Resource; import org.springframework.stereotype.Repository; import com.techsoft.common.BaseDaoImpl; import com.techsoft.common.BaseMapper; import com.techsoft.common.BusinessException; import com.techsoft.common.SQLException; import com.techsoft.mapper.sys.MycatSequenceMapper; import com.techsoft.entity.common.EquipFixture; import com.techsoft.mapper.equip.EquipFixtureMapper; @Repository public class EquipFixtureDaoImpl extends BaseDaoImpl<EquipFixture> implements EquipFixtureDao { @Resource protected EquipFixtureMapper equipFixtureMapper; @Resource protected MycatSequenceMapper mycatSequenceMapper; @Override public Class<EquipFixture> getEntityClass() { return EquipFixture.class; } @Override public BaseMapper<EquipFixture> getBaseMapper() { return this.equipFixtureMapper; } @Override @SuppressWarnings({ "rawtypes" }) public BaseMapper getSeqMapper() { return mycatSequenceMapper; } @Override public String getTableName() { return "EQUIP_FIXTURE"; } @Override public void insertSaveCheck(EquipFixture value) throws BusinessException, SQLException { } @Override public void updateSaveCheck(EquipFixture value) throws BusinessException, SQLException { } @Override public void deleteSaveCheck(EquipFixture value) throws BusinessException, SQLException { } }
[ "wzn354753575@sina.cn" ]
wzn354753575@sina.cn
7c10d5fb65054e7f725cdf61519646db9e992f68
ceeacb5157b67b43d40615daf5f017ae345816db
/generated/sdk/hdinsight/azure-resourcemanager-hdinsight-generated/src/main/java/com/azure/resourcemanager/hdinsight/generated/models/ScriptExecutionHistories.java
7a8d0b3bbfa9dbd19b11b1571ca18c8faaa7c6a4
[ "LicenseRef-scancode-generic-cla" ]
no_license
ChenTanyi/autorest.java
1dd9418566d6b932a407bf8db34b755fe536ed72
175f41c76955759ed42b1599241ecd876b87851f
refs/heads/ci
2021-12-25T20:39:30.473917
2021-11-07T17:23:04
2021-11-07T17:23:04
218,717,967
0
0
null
2020-11-18T14:14:34
2019-10-31T08:24:24
Java
UTF-8
Java
false
false
3,366
java
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.hdinsight.generated.models; import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; /** Resource collection API of ScriptExecutionHistories. */ public interface ScriptExecutionHistories { /** * Lists all scripts' execution history for the specified cluster. * * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list script execution history response. */ PagedIterable<RuntimeScriptActionDetail> listByCluster(String resourceGroupName, String clusterName); /** * Lists all scripts' execution history for the specified cluster. * * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list script execution history response. */ PagedIterable<RuntimeScriptActionDetail> listByCluster( String resourceGroupName, String clusterName, Context context); /** * Promotes the specified ad-hoc script execution to a persisted script. * * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. * @param scriptExecutionId The script execution Id. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ void promote(String resourceGroupName, String clusterName, String scriptExecutionId); /** * Promotes the specified ad-hoc script execution to a persisted script. * * @param resourceGroupName The name of the resource group. * @param clusterName The name of the cluster. * @param scriptExecutionId The script execution Id. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ Response<Void> promoteWithResponse( String resourceGroupName, String clusterName, String scriptExecutionId, Context context); }
[ "actions@github.com" ]
actions@github.com
37c2c0fd125ddc71316cd3c7f7dfec02febad58c
1765af5c7fab3a1a6735e0e4e46b3ba47477effa
/src/main/java/io/github/jhipster/sample/config/DatabaseConfiguration.java
85c95d81298d102bf44c7325217886ab5169b765
[]
no_license
ratonlarvor/jhipster-sample-app-mongodb
d29d06af8276c0fa5c941f824b2e1adefd5ebd58
febc1854a33b81e5138ae01b9dae6ce779fb8dd5
refs/heads/master
2020-03-16T04:39:26.446287
2018-05-03T14:44:31
2018-05-03T14:44:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,833
java
package io.github.jhipster.sample.config; import io.github.jhipster.config.JHipsterConstants; import com.github.mongobee.Mongobee; import com.mongodb.MongoClient; import io.github.jhipster.domain.util.JSR310DateConverters.DateToZonedDateTimeConverter; import io.github.jhipster.domain.util.JSR310DateConverters.ZonedDateTimeToDateConverter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration; import org.springframework.boot.autoconfigure.mongo.MongoProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Profile; import org.springframework.core.convert.converter.Converter; import org.springframework.data.mongodb.config.EnableMongoAuditing; import org.springframework.data.mongodb.core.MongoTemplate; import org.springframework.data.mongodb.core.convert.MongoCustomConversions; import org.springframework.data.mongodb.core.mapping.event.ValidatingMongoEventListener; import org.springframework.data.mongodb.repository.config.EnableMongoRepositories; import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean; import java.util.ArrayList; import java.util.List; @Configuration @EnableMongoRepositories("io.github.jhipster.sample.repository") @Profile("!" + JHipsterConstants.SPRING_PROFILE_CLOUD) @Import(value = MongoAutoConfiguration.class) @EnableMongoAuditing(auditorAwareRef = "springSecurityAuditorAware") public class DatabaseConfiguration { private final Logger log = LoggerFactory.getLogger(DatabaseConfiguration.class); @Bean public ValidatingMongoEventListener validatingMongoEventListener() { return new ValidatingMongoEventListener(validator()); } @Bean public LocalValidatorFactoryBean validator() { return new LocalValidatorFactoryBean(); } @Bean public MongoCustomConversions customConversions() { List<Converter<?, ?>> converters = new ArrayList<>(); converters.add(DateToZonedDateTimeConverter.INSTANCE); converters.add(ZonedDateTimeToDateConverter.INSTANCE); return new MongoCustomConversions(converters); } @Bean public Mongobee mongobee(MongoClient mongoClient, MongoTemplate mongoTemplate, MongoProperties mongoProperties) { log.debug("Configuring Mongobee"); Mongobee mongobee = new Mongobee(mongoClient); mongobee.setDbName(mongoProperties.getDatabase()); mongobee.setMongoTemplate(mongoTemplate); // package to scan for migrations mongobee.setChangeLogsScanPackage("io.github.jhipster.sample.config.dbmigrations"); mongobee.setEnabled(true); return mongobee; } }
[ "julien.dubois@gmail.com" ]
julien.dubois@gmail.com
d5f53f31b77ab5d7d42606f89726a827f167b9eb
23f4d78623458d375cf23b7017c142dd45c32481
/Core/orient-metamodel/com/orient/metamodel/metadomain/ViewRefColumn.java
9d83e8eb77b5b781bc3bbc389af830f9c5615541
[]
no_license
lcr863254361/weibao_qd
4e2165efec704b81e1c0f57b319e24be0a1e4a54
6d12c52235b409708ff920111db3e6e157a712a6
refs/heads/master
2023-04-03T00:37:18.947986
2021-04-11T15:12:45
2021-04-11T15:12:45
356,436,350
0
0
null
null
null
null
UTF-8
Java
false
false
438
java
package com.orient.metamodel.metadomain; /** * 数据视图的关联数据类信息表 * * @author mengbin@cssrc.com.cn * @date Feb 7, 2012 */ public class ViewRefColumn extends AbstractViewRefColumn { public ViewRefColumn() { } /** * @param cwmViews --视图 * @param cwmTables --主数据类 */ public ViewRefColumn(View cwmViews, Table cwmTables) { super(cwmViews, cwmTables); } }
[ "lcr18015367626" ]
lcr18015367626
0508d2929b7b70299e1700c9328fc94b789baae6
0f68c0f88c5cbccd421449ea960db31a798ebf38
/src/main/java/cn/com/hh/service/model/WalletConfig.java
27e26a960016771b8df402d823f40ad1a5af0dec
[]
no_license
leimu222/exchange
0e5c72658f5986d99dc96a6e860444e2624e90e2
e22bfc530a230ba23088a36b6d86a9a380d7a8ef
refs/heads/master
2023-01-31T16:19:37.498040
2020-12-08T10:30:46
2020-12-08T10:30:46
319,348,177
0
0
null
null
null
null
UTF-8
Java
false
false
2,489
java
package com.common.api.model; import java.io.Serializable; /** * @author Gavin Lee * @version 1.0 * @date 2020-12-08 18:16:09 * Description: [wallet服务实现] */ public class WalletConfig implements Serializable { private static final long serialVersionUID = 1L; /** * 主键 */ private Integer id; /** * 0热钱包,1冷钱包 */ private Integer type; /** * 币种名称,如BTC */ private String coinName; /** * 钱包地址 */ private String address; /** * 钱包余额 */ private java.math.BigDecimal balance; /** * 归集比例,大于等于0,小于等于1 */ private java.math.BigDecimal collectRate; // setter and getter /** * 主键 * @return Integer */ public Integer getId(){ return id; } /** * 主键 */ public void setId(Integer id){ this.id = id; } /** * 0热钱包,1冷钱包 * @return Integer */ public Integer getType(){ return type; } /** * 0热钱包,1冷钱包 */ public void setType(Integer type){ this.type = type; } /** * 币种名称,如BTC * @return String */ public String getCoinName(){ return coinName; } /** * 币种名称,如BTC */ public void setCoinName(String coinName){ this.coinName = coinName; } /** * 钱包地址 * @return String */ public String getAddress(){ return address; } /** * 钱包地址 */ public void setAddress(String address){ this.address = address; } /** * 钱包余额 * @return java.math.BigDecimal */ public java.math.BigDecimal getBalance(){ return balance; } /** * 钱包余额 */ public void setBalance(java.math.BigDecimal balance){ this.balance = balance; } /** * 归集比例,大于等于0,小于等于1 * @return java.math.BigDecimal */ public java.math.BigDecimal getCollectRate(){ return collectRate; } /** * 归集比例,大于等于0,小于等于1 */ public void setCollectRate(java.math.BigDecimal collectRate){ this.collectRate = collectRate; } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("id:").append(getId()).append(";"); sb.append("type:").append(getType()).append(";"); sb.append("coinName:").append(getCoinName()).append(";"); sb.append("address:").append(getAddress()).append(";"); sb.append("balance:").append(getBalance()).append(";"); sb.append("collectRate:").append(getCollectRate()).append(";"); return sb.toString(); } }
[ "2165456@qq.com" ]
2165456@qq.com
5fe453d682e627958ae14add405f9f195cbdb9bc
9c4fb1c6050face4d925864ea3756de68c202cad
/CoreJava/src/jrout/tutorial/corejava/inheritance/Lion.java
495c11e793af03e1210e8c9e011b401f053798df
[]
no_license
pemmyza1/batch27
8fcd06408342f947a2d1e5ec9387ac74ed6228bc
838777ff8f45f62b12c84b79ba93eaaab8db8c9f
refs/heads/master
2020-03-18T16:39:10.580669
2018-05-24T02:40:24
2018-05-24T02:40:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
192
java
package jrout.tutorial.corejava.inheritance; public class Lion extends Animal { public Lion(String type, String name) { super(type, false); super.setName(name); } }
[ "jayram.rout@gmail.com" ]
jayram.rout@gmail.com
6ee7fd2ec9dd3e6d26a3e1511681dd5484f2b6fe
1f62f0a7a849df1d54d4ed2e34a59d9a745c7ed2
/src/test/java/it/aranciaict/productchatbot/security/DomainUserDetailsServiceIntTest.java
695e93957c536ca00823151ade14588543e7fc0d
[]
no_license
danieledb/ProductChatBot
a2e6bf30f3e15d0aa3a80269948dc8dba1f9ab18
f7f47f4f0297c43657fa58ea977fd68db77b12bd
refs/heads/master
2021-04-09T11:02:00.324352
2018-03-16T10:01:16
2018-03-16T10:01:16
125,484,311
0
0
null
2018-03-16T10:01:18
2018-03-16T08:08:58
Java
UTF-8
Java
false
false
4,699
java
package it.aranciaict.productchatbot.security; import it.aranciaict.productchatbot.ProductChatBotApp; import it.aranciaict.productchatbot.domain.User; import it.aranciaict.productchatbot.repository.UserRepository; import org.apache.commons.lang3.RandomStringUtils; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.transaction.annotation.Transactional; import java.util.Locale; import static org.assertj.core.api.Assertions.assertThat; /** * Test class for DomainUserDetailsService. * * @see DomainUserDetailsService */ @RunWith(SpringRunner.class) @SpringBootTest(classes = ProductChatBotApp.class) @Transactional public class DomainUserDetailsServiceIntTest { private static final String USER_ONE_LOGIN = "test-user-one"; private static final String USER_ONE_EMAIL = "test-user-one@localhost"; private static final String USER_TWO_LOGIN = "test-user-two"; private static final String USER_TWO_EMAIL = "test-user-two@localhost"; private static final String USER_THREE_LOGIN = "test-user-three"; private static final String USER_THREE_EMAIL = "test-user-three@localhost"; @Autowired private UserRepository userRepository; @Autowired private UserDetailsService domainUserDetailsService; private User userOne; private User userTwo; private User userThree; @Before public void init() { userOne = new User(); userOne.setLogin(USER_ONE_LOGIN); userOne.setPassword(RandomStringUtils.random(60)); userOne.setActivated(true); userOne.setEmail(USER_ONE_EMAIL); userOne.setFirstName("userOne"); userOne.setLastName("doe"); userOne.setLangKey("en"); userRepository.save(userOne); userTwo = new User(); userTwo.setLogin(USER_TWO_LOGIN); userTwo.setPassword(RandomStringUtils.random(60)); userTwo.setActivated(true); userTwo.setEmail(USER_TWO_EMAIL); userTwo.setFirstName("userTwo"); userTwo.setLastName("doe"); userTwo.setLangKey("en"); userRepository.save(userTwo); userThree = new User(); userThree.setLogin(USER_THREE_LOGIN); userThree.setPassword(RandomStringUtils.random(60)); userThree.setActivated(false); userThree.setEmail(USER_THREE_EMAIL); userThree.setFirstName("userThree"); userThree.setLastName("doe"); userThree.setLangKey("en"); userRepository.save(userThree); } @Test @Transactional public void assertThatUserCanBeFoundByLogin() { UserDetails userDetails = domainUserDetailsService.loadUserByUsername(USER_ONE_LOGIN); assertThat(userDetails).isNotNull(); assertThat(userDetails.getUsername()).isEqualTo(USER_ONE_LOGIN); } @Test @Transactional public void assertThatUserCanBeFoundByLoginIgnoreCase() { UserDetails userDetails = domainUserDetailsService.loadUserByUsername(USER_ONE_LOGIN.toUpperCase(Locale.ENGLISH)); assertThat(userDetails).isNotNull(); assertThat(userDetails.getUsername()).isEqualTo(USER_ONE_LOGIN); } @Test @Transactional public void assertThatUserCanBeFoundByEmail() { UserDetails userDetails = domainUserDetailsService.loadUserByUsername(USER_TWO_EMAIL); assertThat(userDetails).isNotNull(); assertThat(userDetails.getUsername()).isEqualTo(USER_TWO_LOGIN); } @Test @Transactional public void assertThatUserCanBeFoundByEmailIgnoreCase() { UserDetails userDetails = domainUserDetailsService.loadUserByUsername(USER_TWO_EMAIL.toUpperCase(Locale.ENGLISH)); assertThat(userDetails).isNotNull(); assertThat(userDetails.getUsername()).isEqualTo(USER_TWO_LOGIN); } @Test @Transactional public void assertThatEmailIsPrioritizedOverLogin() { UserDetails userDetails = domainUserDetailsService.loadUserByUsername(USER_ONE_EMAIL.toUpperCase(Locale.ENGLISH)); assertThat(userDetails).isNotNull(); assertThat(userDetails.getUsername()).isEqualTo(USER_ONE_LOGIN); } @Test(expected = UserNotActivatedException.class) @Transactional public void assertThatUserNotActivatedExceptionIsThrownForNotActivatedUsers() { domainUserDetailsService.loadUserByUsername(USER_THREE_LOGIN); } }
[ "jhipster-bot@users.noreply.github.com" ]
jhipster-bot@users.noreply.github.com
100bde0dc6950dc692851c83550dc892b40709c8
6166f82ce57f19d0ffcbbde65c1a980b692384fe
/shopMobile/src/main/java/com/yw/car/model/SPMessageNotice.java
1fa81c197dadf4c2f9de109e3eb7c51a69481cb7
[ "Apache-2.0" ]
permissive
ywen8/shop-car
f88251894ad1d374a5f79169499858bd9173a0eb
82dc37602dc9a305b30ae3582d4a7eb0c02001ef
refs/heads/master
2020-03-18T07:11:40.639549
2018-05-22T15:47:02
2018-05-22T15:47:02
134,438,336
0
0
null
null
null
null
UTF-8
Java
false
false
1,876
java
package com.yw.car.model; /** * @author liuhao */ public class SPMessageNotice implements SPModel { private String message; private String messageId; private String messageTime; private String messageType; //0系统消息,1物流通知,2优惠促销,3商品提醒,4我的资产,5商城好店 private String messageStatus; private String messageCategory; public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } public String getMessageCategory() { return messageCategory; } public void setMessageCategory(String messageCategory) { this.messageCategory = messageCategory; } public String getMessageId() { return messageId; } public void setMessageId(String messageId) { this.messageId = messageId; } public String getMessageStatus() { return messageStatus; } public void setMessageStatus(String messageStatus) { this.messageStatus = messageStatus; } public String getMessageTime() { return messageTime; } public void setMessageTime(String messageTime) { this.messageTime = messageTime; } public String getMessageType() { return messageType; } public void setMessageType(String messageType) { this.messageType = messageType; } @Override public String[] replaceKeyFromPropertyName() { return new String[]{ "messageCategory", "category", "messageId", "message_id", "messageStatus", "status", "messageTime", "send_time", "messageType", "type", "message", "message", }; } }
[ "381226310@qq.com" ]
381226310@qq.com
acc0824824ae745359757ea756819b17cb6bd948
60fe9caa0b627813d4bdf3f7e627f0402b788077
/arms/src/main/java/com/jess/arms/integration/ManifestParser.java
f3c8f5659b9342c836d26f005de70d7ae85b3025
[ "Apache-2.0" ]
permissive
chocozhao/chocobilibili
15f160202389844c7519f5d5742c4a85e1b0e1e2
768be8116d3ff0b60a03b55507b140af24f04cec
refs/heads/master
2020-08-16T03:59:45.448817
2020-04-13T06:10:09
2020-04-13T06:10:09
215,451,805
3
0
Apache-2.0
2020-02-25T09:59:11
2019-10-16T03:48:53
Java
UTF-8
Java
false
false
3,057
java
/* * Copyright 2017 JessYan * * 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.jess.arms.integration; import android.content.Context; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import java.util.ArrayList; import java.util.List; /** * ================================================ * 用于解析 AndroidManifest 中的 Meta 属性 * 配合 {@link ConfigModule} 使用 * <p> * Created by JessYan on 12/04/2017 14:41 * <a href="mailto:jess.yan.effort@gmail.com">Contact me</a> * <a href="https://github.com/JessYanCoding">Follow me</a> * ================================================ */ public final class ManifestParser { private static final String MODULE_VALUE = "ConfigModule"; private final Context context; public ManifestParser(Context context) { this.context = context; } public List<ConfigModule> parse() { List<ConfigModule> modules = new ArrayList<ConfigModule>(); try { ApplicationInfo appInfo = context.getPackageManager().getApplicationInfo( context.getPackageName(), PackageManager.GET_META_DATA); if (appInfo.metaData != null) { for (String key : appInfo.metaData.keySet()) { if (MODULE_VALUE.equals(appInfo.metaData.get(key))) { modules.add(parseModule(key)); } } } } catch (PackageManager.NameNotFoundException e) { throw new RuntimeException("Unable to find metadata to parse ConfigModule", e); } return modules; } private static ConfigModule parseModule(String className) { Class<?> clazz; try { clazz = Class.forName(className); } catch (ClassNotFoundException e) { throw new IllegalArgumentException("Unable to find ConfigModule implementation", e); } Object module; try { module = clazz.newInstance(); } catch (InstantiationException e) { throw new RuntimeException("Unable to instantiate ConfigModule implementation for " + clazz, e); } catch (IllegalAccessException e) { throw new RuntimeException("Unable to instantiate ConfigModule implementation for " + clazz, e); } if (!(module instanceof ConfigModule)) { throw new RuntimeException("Expected instanceof ConfigModule, but found: " + module); } return (ConfigModule) module; } }
[ "you@example.com" ]
you@example.com
c784df80a3fdf8335b6492e9a56f14bc1fb01da5
6baf1fe00541560788e78de5244ae17a7a2b375a
/hollywood/com.oculus.alpenglow-EnterpriseServer/sources/X/C05830lU.java
bf267697f33c1037ceb068dbcd720d23ea90c617
[]
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
5,099
java
package X; import java.io.Serializable; import java.util.Arrays; /* renamed from: X.0lU reason: invalid class name and case insensitive filesystem */ public final class C05830lU implements Serializable { public static final long serialVersionUID = 1; public final transient char A00; public final transient int A01; public final transient boolean A02; public final transient char[] A03; public final transient int[] A04; public final transient byte[] A05; public final String _name; public final String A01(byte[] bArr, boolean z) { int length = bArr.length; StringBuilder sb = new StringBuilder((length >> 2) + length + (length >> 3)); if (z) { sb.append('\"'); } int i = Integer.MAX_VALUE >> 2; int i2 = 0; int i3 = length - 3; while (i2 <= i3) { int i4 = i2 + 1; int i5 = i4 + 1; int i6 = ((bArr[i2] << 8) | (bArr[i4] & 255)) << 8; i2 = i5 + 1; int i7 = i6 | (bArr[i5] & 255); char[] cArr = this.A03; sb.append(cArr[(i7 >> 18) & 63]); sb.append(cArr[(i7 >> 12) & 63]); sb.append(cArr[(i7 >> 6) & 63]); sb.append(cArr[i7 & 63]); i--; if (i <= 0) { sb.append('\\'); sb.append('n'); i = i; } } int i8 = length - i2; if (i8 > 0) { int i9 = i2 + 1; int i10 = bArr[i2] << 16; if (i8 == 2) { i10 |= (bArr[i9] & 255) << 8; } char[] cArr2 = this.A03; sb.append(cArr2[(i10 >> 18) & 63]); sb.append(cArr2[(i10 >> 12) & 63]); char c = '='; if (i8 == 2) { c = cArr2[(i10 >> 6) & 63]; } sb.append(c); sb.append('='); } if (z) { sb.append('\"'); } return sb.toString(); } public final boolean equals(Object obj) { return obj == this; } /* JADX WARNING: Removed duplicated region for block: B:6:0x0027 */ /* Code decompiled incorrectly, please refer to instructions dump. */ public static final void A00(X.C05830lU r2, char r3, int r4, java.lang.String r5) throws java.lang.IllegalArgumentException { /* // Method dump skipped, instructions count: 126 */ throw new UnsupportedOperationException("Method not decompiled: X.C05830lU.A00(X.0lU, char, int, java.lang.String):void"); } public final int hashCode() { return this._name.hashCode(); } public Object readResolve() { String A07; String str = this._name; C05830lU r1 = C05840lV.A00; if (!r1._name.equals(str)) { r1 = C05840lV.A01; if (!r1._name.equals(str)) { r1 = C05840lV.A03; if (!r1._name.equals(str)) { r1 = C05840lV.A02; if (!r1._name.equals(str)) { if (str == null) { A07 = "<null>"; } else { A07 = AnonymousClass006.A07("'", str, "'"); } throw new IllegalArgumentException(AnonymousClass006.A05("No Base64Variant with name ", A07)); } } } } return r1; } public final String toString() { return this._name; } public C05830lU(C05830lU r7, String str, int i) { this.A04 = new int[128]; this.A03 = new char[64]; byte[] bArr = new byte[64]; this.A05 = bArr; this._name = str; byte[] bArr2 = r7.A05; System.arraycopy(bArr2, 0, bArr, 0, bArr2.length); char[] cArr = r7.A03; System.arraycopy(cArr, 0, this.A03, 0, cArr.length); int[] iArr = r7.A04; System.arraycopy(iArr, 0, this.A04, 0, iArr.length); this.A02 = true; this.A00 = '='; this.A01 = i; } public C05830lU(String str, String str2, boolean z, char c, int i) { int[] iArr; this.A04 = new int[128]; char[] cArr = new char[64]; this.A03 = cArr; this.A05 = new byte[64]; this._name = str; this.A02 = z; this.A00 = c; this.A01 = i; int length = str2.length(); if (length == 64) { int i2 = 0; str2.getChars(0, length, cArr, 0); Arrays.fill(this.A04, -1); do { char c2 = this.A03[i2]; this.A05[i2] = (byte) c2; iArr = this.A04; iArr[c2] = i2; i2++; } while (i2 < length); if (z) { iArr[c] = -2; return; } return; } throw new IllegalArgumentException(AnonymousClass006.A02("Base64Alphabet length must be exactly 64 (was ", length, ")")); } }
[ "cyuubiapps@gmail.com" ]
cyuubiapps@gmail.com
8e1674c0b00cb8c7d2e9392245b2c9993fa99e27
8e284b38a8722ca6f94cd8a95582d5b7cce0e5e9
/src/optics/raytrace/surfaces/IdealThinCylindricalMirrorSurfaceSimple.java
4c0574311ab6f65193c246a3611d76ba68a3eb28
[]
no_license
jkcuk/Dr-TIM
acae17d70227f19b81ad3f5d51e46a4704f94abc
43f3436a120fb841b5b6de133888657398deefc7
refs/heads/master
2023-08-31T10:46:40.508193
2023-08-23T18:19:14
2023-08-23T18:19:14
206,802,701
3
1
null
null
null
null
UTF-8
Java
false
false
6,315
java
package optics.raytrace.surfaces; import math.*; import optics.DoubleColour; import optics.raytrace.core.*; import optics.raytrace.exceptions.RayTraceException; /** * A surface property representing the surface of an ideal thin spherical mirror, i.e. an ideal thin lens in reflection. * @see optics.raytrace.surfaces.IdealThinCylindricalLensSurfaceSimple * (Unlike in the case of a thin hologram, the direction change is independent of wavelength.) * * @author Johannes Courtial */ public class IdealThinCylindricalMirrorSurfaceSimple extends SurfacePropertyPrimitive { private static final long serialVersionUID = 8917584872858012010L; // The centre of the ideal thin cylindrical lens. // Light rays that pass through this point pass through the lens undeviated. // // Note that this point does not necessarily have to lie on the surface. // Normally it should, but if it doesn't then the behaviour is still well-defined. Vector3D lensCentre; // The direction of the optical axis. (Sign doesn't matter.) Vector3D opticalAxisDirection; // The direction of the gradient (perpendicular to the focal line). (Sign doesn't matter.) Vector3D gradientDirection; double focalLength; // focal length /** * Creates an instance of the surface property that refracts light like a thin lens * * @param opticalAxisIntersectionCoordinates * @param focalLength * @param transmissionCoefficient */ public IdealThinCylindricalMirrorSurfaceSimple( Vector3D lensCentre, Vector3D opticalAxisDirection, Vector3D gradientDirection, double focalLength, double transmissionCoefficient, boolean shadowThrowing ) { super(transmissionCoefficient, shadowThrowing); setLensCentre(lensCentre); setOpticalAxisDirection(opticalAxisDirection); setGradientDirection(gradientDirection); setFocalLength(focalLength); } public IdealThinCylindricalMirrorSurfaceSimple(IdealThinCylindricalMirrorSurfaceSimple original) { this( original.getLensCentre(), original.getOpticalAxisDirection(), original.getGradientDirection(), original.getFocalLength(), original.getTransmissionCoefficient(), original.isShadowThrowing() ); } /* (non-Javadoc) * @see java.lang.Object#clone() */ @Override public IdealThinCylindricalMirrorSurfaceSimple clone() { return new IdealThinCylindricalMirrorSurfaceSimple(this); } // setters and getters public Vector3D getLensCentre() { return lensCentre; } public void setLensCentre(Vector3D lensCentre) { this.lensCentre = lensCentre; } public Vector3D getOpticalAxisDirection() { return opticalAxisDirection; } /** * Normalise and set optical-axis direction. * @param opticalAxisDirection */ public void setOpticalAxisDirection(Vector3D opticalAxisDirection) { this.opticalAxisDirection = opticalAxisDirection.getNormalised(); } public Vector3D getGradientDirection() { return gradientDirection; } public void setGradientDirection(Vector3D gradientDirection) { this.gradientDirection = gradientDirection.getPartPerpendicularTo(opticalAxisDirection).getNormalised(); } public double getFocalLength() { return focalLength; } public void setFocalLength(double focalLength) { this.focalLength = focalLength; } /* (non-Javadoc) * @see optics.raytrace.SurfaceProperty#getColour(optics.raytrace.Ray, optics.raytrace.RaySceneObjectIntersection, optics.raytrace.SceneObject, optics.raytrace.LightSource, int) */ @Override public DoubleColour getColour(Ray ray, RaySceneObjectIntersection i, SceneObject scene, LightSource l, int traceLevel, RaytraceExceptionHandler raytraceExceptionHandler) throws RayTraceException { // System.out.println("TraceLevel="+traceLevel); if (traceLevel <= 0) return DoubleColour.BLACK; // calculate direction of deflected ray; // see geometry.pdf // put together a coordinate system (origin = lens centre) // unit vector in the optical-axis direction Vector3D aHat = opticalAxisDirection; // unit vector in the gradient direction Vector3D gHat = gradientDirection; // unit vector in the focal-line direction Vector3D lHat = Vector3D.crossProduct(aHat, gHat); // the distance of the intersection point from the lens centre in the gradientDirection double iG = Vector3D.difference(i.p, lensCentre).getScalarProductWith(gHat); // components of the initial light-ray direction in the a, l and g directions double dA = ray.getD().getScalarProductWith(aHat); double dL = ray.getD().getScalarProductWith(lHat); double dG = ray.getD().getScalarProductWith(gHat); // calculate normalised new light-ray direction before mirroring at the principal plane... // (_L = component in focal-line direction; _G = component in gradient direction; _A = component in axis direction): // d' = (dL/dA, dG/dA - iG/f, 1) Vector3D newRayDirection = Vector3D.sum( lHat.getProductWith(dL/dA), gHat.getProductWith(dG/dA-iG/focalLength), aHat ); // ... and after mirroring newRayDirection = Vector3D.difference( newRayDirection, newRayDirection.getProjectionOnto(getOpticalAxisDirection()).getProductWith(2) ); // launch a new ray from here return scene.getColourAvoidingOrigin( ray.getBranchRay(i.p, newRayDirection, i.t, ray.isReportToConsole()), i.o, l, scene, traceLevel-1, raytraceExceptionHandler ).multiply( getTransmissionCoefficient() // * Math.abs(newRayDirection.getScalarProductWith(n))/dz // cos(angle of new ray with normal) / cos(angle of old ray with normal) // // not sure the intensity scales --- see http://www.astronomy.net/articles/29/ // Also, one of the article's reviewers wrote this: // This is also related to the brightening in Fig. 7. In fact, I think that such a brightening should not occur. // It is known that brightness of an object does not change if the object is observed by some non-absorbing optical // instrument. For example, a sun reflected in a curved metallic surface is equally bright as if it is viewed directly. // I expect the same for teleported image. Maybe if the effect of the additional factor in eq. (5) is taken into // account together with the other method of calculation of the ray direction, no brightening will occur. ); } }
[ "johannes.courtial@glasgow.ac.uk" ]
johannes.courtial@glasgow.ac.uk
a20f6a8e7688dda97146693fc9f47317909c494f
1721c1e45201b0c6ae5c81d9bdd69ea6cfb76dfe
/turms-service/src/main/java/im/turms/service/workflow/access/http/permission/AdminPermission.java
966718b4211cff5a478259c10c308ffc5efcd9a7
[ "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
7,482
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.service.workflow.access.http.permission; import java.util.Set; /** * @author James Chen */ public enum AdminPermission { STATISTICS_USER_QUERY, STATISTICS_GROUP_QUERY, STATISTICS_MESSAGE_QUERY, USER_CREATE, USER_DELETE, USER_UPDATE, USER_QUERY, USER_RELATIONSHIP_CREATE, USER_RELATIONSHIP_DELETE, USER_RELATIONSHIP_UPDATE, USER_RELATIONSHIP_QUERY, USER_RELATIONSHIP_GROUP_CREATE, USER_RELATIONSHIP_GROUP_DELETE, USER_RELATIONSHIP_GROUP_UPDATE, USER_RELATIONSHIP_GROUP_QUERY, USER_FRIEND_REQUEST_CREATE, USER_FRIEND_REQUEST_DELETE, USER_FRIEND_REQUEST_UPDATE, USER_FRIEND_REQUEST_QUERY, USER_PERMISSION_GROUP_CREATE, USER_PERMISSION_GROUP_DELETE, USER_PERMISSION_GROUP_UPDATE, USER_PERMISSION_GROUP_QUERY, USER_ONLINE_INFO_UPDATE, USER_ONLINE_INFO_QUERY, GROUP_CREATE, GROUP_DELETE, GROUP_UPDATE, GROUP_QUERY, GROUP_BLOCKLIST_CREATE, GROUP_BLOCKLIST_DELETE, GROUP_BLOCKLIST_UPDATE, GROUP_BLOCKLIST_QUERY, GROUP_INVITATION_CREATE, GROUP_INVITATION_DELETE, GROUP_INVITATION_UPDATE, GROUP_INVITATION_QUERY, GROUP_QUESTION_CREATE, GROUP_QUESTION_DELETE, GROUP_QUESTION_UPDATE, GROUP_QUESTION_QUERY, GROUP_JOIN_REQUEST_CREATE, GROUP_JOIN_REQUEST_DELETE, GROUP_JOIN_REQUEST_UPDATE, GROUP_JOIN_REQUEST_QUERY, GROUP_MEMBER_UPDATE, GROUP_MEMBER_CREATE, GROUP_MEMBER_DELETE, GROUP_MEMBER_QUERY, GROUP_TYPE_CREATE, GROUP_TYPE_DELETE, GROUP_TYPE_UPDATE, GROUP_TYPE_QUERY, CONVERSATION_QUERY, CONVERSATION_DELETE, CONVERSATION_UPDATE, MESSAGE_CREATE, MESSAGE_DELETE, MESSAGE_UPDATE, MESSAGE_QUERY, ADMIN_CREATE, ADMIN_DELETE, ADMIN_UPDATE, ADMIN_QUERY, ADMIN_ROLE_CREATE, ADMIN_ROLE_DELETE, ADMIN_ROLE_UPDATE, ADMIN_ROLE_QUERY, CLIENT_BLOCKLIST_CREATE, CLIENT_BLOCKLIST_DELETE, CLIENT_BLOCKLIST_QUERY, CLUSTER_MEMBER_CREATE, CLUSTER_MEMBER_DELETE, CLUSTER_MEMBER_UPDATE, CLUSTER_MEMBER_QUERY, CLUSTER_LEADER_UPDATE, CLUSTER_LEADER_QUERY, CLUSTER_CONFIG_UPDATE, CLUSTER_CONFIG_QUERY; public static final Set<AdminPermission> ALL = Set.of(AdminPermission.values()); public static final Set<AdminPermission> ALL_STATISTICS = Set.of( STATISTICS_USER_QUERY, STATISTICS_GROUP_QUERY, STATISTICS_MESSAGE_QUERY); public static final Set<AdminPermission> ALL_CONTENT_USER = Set.of( USER_CREATE, USER_DELETE, USER_UPDATE, USER_QUERY, USER_RELATIONSHIP_CREATE, USER_RELATIONSHIP_DELETE, USER_RELATIONSHIP_UPDATE, USER_RELATIONSHIP_QUERY, USER_RELATIONSHIP_GROUP_CREATE, USER_RELATIONSHIP_GROUP_DELETE, USER_RELATIONSHIP_GROUP_UPDATE, USER_RELATIONSHIP_GROUP_QUERY, USER_FRIEND_REQUEST_CREATE, USER_FRIEND_REQUEST_DELETE, USER_FRIEND_REQUEST_UPDATE, USER_FRIEND_REQUEST_QUERY, USER_PERMISSION_GROUP_CREATE, USER_PERMISSION_GROUP_DELETE, USER_PERMISSION_GROUP_UPDATE, USER_PERMISSION_GROUP_QUERY, USER_ONLINE_INFO_UPDATE, USER_ONLINE_INFO_QUERY); public static final Set<AdminPermission> ALL_CONTENT_GROUP = Set.of(GROUP_CREATE, GROUP_DELETE, GROUP_UPDATE, GROUP_QUERY, GROUP_BLOCKLIST_CREATE, GROUP_BLOCKLIST_DELETE, GROUP_BLOCKLIST_UPDATE, GROUP_BLOCKLIST_QUERY, GROUP_INVITATION_CREATE, GROUP_INVITATION_DELETE, GROUP_INVITATION_UPDATE, GROUP_INVITATION_QUERY, GROUP_QUESTION_CREATE, GROUP_QUESTION_DELETE, GROUP_QUESTION_UPDATE, GROUP_QUESTION_QUERY, GROUP_JOIN_REQUEST_CREATE, GROUP_JOIN_REQUEST_DELETE, GROUP_JOIN_REQUEST_UPDATE, GROUP_JOIN_REQUEST_QUERY, GROUP_MEMBER_CREATE, GROUP_MEMBER_DELETE, GROUP_MEMBER_UPDATE, GROUP_MEMBER_QUERY, GROUP_TYPE_CREATE, GROUP_TYPE_DELETE, GROUP_TYPE_UPDATE, GROUP_TYPE_QUERY); public static final Set<AdminPermission> ALL_CONTENT_CONVERSATION = Set.of( CONVERSATION_QUERY, CONVERSATION_DELETE, CONVERSATION_UPDATE); public static final Set<AdminPermission> ALL_CONTENT_MESSAGE = Set.of( MESSAGE_CREATE, MESSAGE_DELETE, MESSAGE_UPDATE, MESSAGE_QUERY); public static final Set<AdminPermission> ALL_CONTENT_ADMIN = Set.of( ADMIN_CREATE, ADMIN_DELETE, ADMIN_UPDATE, ADMIN_QUERY, ADMIN_ROLE_CREATE, ADMIN_ROLE_DELETE, ADMIN_ROLE_UPDATE, ADMIN_ROLE_QUERY); public static final Set<AdminPermission> ALL_CLUSTER = Set.of( CLUSTER_MEMBER_CREATE, CLUSTER_MEMBER_DELETE, CLUSTER_MEMBER_UPDATE, CLUSTER_MEMBER_QUERY, CLUSTER_CONFIG_UPDATE, CLUSTER_CONFIG_QUERY); public static final Set<AdminPermission> ALL_CREATE = Set.of( USER_CREATE, USER_RELATIONSHIP_CREATE, USER_RELATIONSHIP_GROUP_CREATE, USER_FRIEND_REQUEST_CREATE, USER_PERMISSION_GROUP_CREATE, GROUP_CREATE, GROUP_BLOCKLIST_CREATE, GROUP_INVITATION_CREATE, GROUP_QUESTION_CREATE, GROUP_JOIN_REQUEST_CREATE, GROUP_MEMBER_CREATE, GROUP_TYPE_CREATE, MESSAGE_CREATE, ADMIN_CREATE, ADMIN_ROLE_CREATE, CLIENT_BLOCKLIST_CREATE, CLUSTER_MEMBER_CREATE); public static final Set<AdminPermission> ALL_QUERY = Set.of( STATISTICS_USER_QUERY, STATISTICS_GROUP_QUERY, STATISTICS_MESSAGE_QUERY, USER_QUERY, USER_RELATIONSHIP_QUERY, USER_RELATIONSHIP_GROUP_QUERY, USER_FRIEND_REQUEST_QUERY, USER_PERMISSION_GROUP_QUERY, USER_ONLINE_INFO_QUERY, GROUP_QUERY, GROUP_BLOCKLIST_QUERY, GROUP_INVITATION_QUERY, GROUP_QUESTION_QUERY, GROUP_JOIN_REQUEST_QUERY, GROUP_MEMBER_QUERY, GROUP_TYPE_QUERY, CONVERSATION_QUERY, MESSAGE_QUERY, ADMIN_QUERY, ADMIN_ROLE_QUERY, CLIENT_BLOCKLIST_QUERY, CLUSTER_MEMBER_QUERY, CLUSTER_CONFIG_QUERY); }
[ "eurekajameschen@gmail.com" ]
eurekajameschen@gmail.com
525447bc3f546f531b58ebe6910977ce205b766a
c04ae184e85a6b60fadfc8ff87677ace7382fdcb
/day14/src/com/itheima/service/impl/AccountServiceImpl.java
823922c7dc8183ad4608e4397f0e62bd30726072
[]
no_license
qq756585379/JAVA_Study
18f169a106ddee234771597194aa721e77f73070
bb23f057df4b4e64c87b6df663ef1247fd6491b6
refs/heads/master
2021-09-07T23:28:07.802365
2018-03-03T02:31:56
2018-03-03T02:31:56
109,259,656
1
0
null
null
null
null
UTF-8
Java
false
false
1,354
java
package com.itheima.service.impl; import com.itheima.dao.AccountDao; import com.itheima.dao.impl.AccountDaoImpl; import com.itheima.domain.User; import com.itheima.service.AccountService; import com.itheima.util.ManagerThreadLocal; public class AccountServiceImpl implements AccountService { public void transfer(String fromname, String toname, double money) { // ad.updateAccount(fromname, toname, money); AccountDao ad = new AccountDaoImpl(); try { ManagerThreadLocal.startTransacation();//begin User fromAccount = ad.findAccountByName(fromname); User toAccount = ad.findAccountByName(toname); fromAccount.setMoney(fromAccount.getMoney() - money); toAccount.setMoney(toAccount.getMoney() + money); ad.updateAccout(fromAccount); // int i = 10/0; ad.updateAccout(toAccount); ManagerThreadLocal.commit(); } catch (Exception e) { try { ManagerThreadLocal.rollback(); } catch (Exception e1) { e1.printStackTrace(); } } finally { try { ManagerThreadLocal.close(); } catch (Exception e) { e.printStackTrace(); } } } }
[ "756585379@qq.com" ]
756585379@qq.com
c7621e10c4de6f528a4823e640a13de5179fe8d7
d799dc255ee11b4fe2db8a52932a9ac088002dd3
/src/main/java/com/ca/nbiapps/entities/SiloName.java
8e79b544e860016a7eb58d90948f5d59716f7c14
[]
no_license
balajinsr/build-api-service
05d01869cffd1e60614b981fe8d27e6cb3e24b6e
599ea710b5018b12011ae9c1faa5e53214e4a558
refs/heads/master
2021-08-28T01:43:59.720638
2019-09-19T07:27:14
2019-09-19T07:27:14
203,537,414
0
0
null
2021-08-02T17:18:25
2019-08-21T08:09:30
Java
UTF-8
Java
false
false
1,242
java
package com.ca.nbiapps.entities; import java.io.Serializable; import java.math.BigInteger; import javax.persistence.Column; import javax.persistence.Embedded; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.NamedQuery; import javax.persistence.Table; /** * The persistent class for the silo_names database table. * */ @Entity @Table(name="silo_names") @NamedQuery(name="SiloName.findAll", query="SELECT s FROM SiloName s") @NamedQuery(name="SiloName.findBySiloName", query="SELECT s FROM SiloName s where s.siloNameReq.siloName=:siloName") public class SiloName implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy=GenerationType.AUTO) @Column(name="silo_id", nullable=false) private BigInteger siloId; @Embedded SiloNameReq siloNameReq; public SiloName() { } public BigInteger getSiloId() { return this.siloId; } public void setSiloId(BigInteger siloId) { this.siloId = siloId; } public SiloNameReq getSiloNameReq() { return siloNameReq; } public void setSiloNameReq(SiloNameReq siloNameReq) { this.siloNameReq = siloNameReq; } }
[ "nanba03@ca.com" ]
nanba03@ca.com
d38f9b0f6f9d3671815175993efa93b754313a6c
b31120cefe3991a960833a21ed54d4e10770bc53
/modules/org.clang.ast/src/org/clang/ast/ast_type_traits/KindToKindIdMSAsmStmt.java
b346fbfb2b7783f2152aebc57faaa82ccdd08014
[]
no_license
JianpingZeng/clank
94581710bd89caffcdba6ecb502e4fdb0098caaa
bcdf3389cd57185995f9ee9c101a4dfd97145442
refs/heads/master
2020-11-30T05:36:06.401287
2017-10-26T14:15:27
2017-10-26T14:15:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,581
java
/** * This file was converted to Java from the original LLVM source file. The original * source file follows the LLVM Release License, outlined below. * * ============================================================================== * LLVM Release License * ============================================================================== * University of Illinois/NCSA * Open Source License * * Copyright (c) 2003-2017 University of Illinois at Urbana-Champaign. * All rights reserved. * * Developed by: * * LLVM Team * * University of Illinois at Urbana-Champaign * * http://llvm.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 with * 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: * * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimers. * * * Redistributions in binary form must reproduce the above copyright notice * this list of conditions and the following disclaimers in the * documentation and/or other materials provided with the distribution. * * * Neither the names of the LLVM Team, University of Illinois at * Urbana-Champaign, nor the names of its contributors may be used to * endorse or promote products derived from this Software without specific * prior written permission. * * 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 * CONTRIBUTORS 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 WITH THE * SOFTWARE. * * ============================================================================== * Copyrights and Licenses for Third Party Software Distributed with LLVM: * ============================================================================== * The LLVM software contains code written by third parties. Such software will * have its own individual LICENSE.TXT file in the directory in which it appears. * This file will describe the copyrights, license, and restrictions which apply * to that code. * * The disclaimer of warranty in the University of Illinois Open Source License * applies to all code in the LLVM Distribution, and nothing in any of the * other licenses gives permission to use the names of the LLVM Team or the * University of Illinois to endorse or promote products derived from this * Software. * * The following pieces of software have additional or alternate copyrights, * licenses, and/or restrictions: * * Program Directory * ------- --------- * Autoconf llvm/autoconf * llvm/projects/ModuleMaker/autoconf * Google Test llvm/utils/unittest/googletest * OpenBSD regex llvm/lib/Support/{reg*, COPYRIGHT.regex} * pyyaml tests llvm/test/YAMLParser/{*.data, LICENSE.TXT} * ARM contributions llvm/lib/Target/ARM/LICENSE.TXT * md5 contributions llvm/lib/Support/MD5.cpp llvm/include/llvm/Support/MD5.h */ package org.clang.ast.ast_type_traits; import org.clank.support.*; import static org.clang.ast.ast_type_traits.ASTNodeKind.*; //<editor-fold defaultstate="collapsed" desc="clang::ast_type_traits::ASTNodeKind::KindToKindId<clang::MSAsmStmt>"> @Converted(kind = Converted.Kind.AUTO, source = "${LLVM_SRC}/build/tools/clang/include/clang/AST/StmtNodes.inc", line = 33, FQN="clang::ast_type_traits::ASTNodeKind::KindToKindId<clang::MSAsmStmt>", NM="_ZN5clang15ast_type_traits11ASTNodeKind12KindToKindIdINS_9MSAsmStmtEEE", cmd="jclank.sh -java-options=${SPUTNIK}/modules/org.clang.ast/llvmToClangType ${LLVM_SRC}/llvm/tools/clang/lib/AST/Stmt.cpp -nm=_ZN5clang15ast_type_traits11ASTNodeKind12KindToKindIdINS_9MSAsmStmtEEE") //</editor-fold> public class/*struct*/ KindToKindIdMSAsmStmt { public static /*const*/ NodeKindId Id = NodeKindId.NKI_MSAsmStmt; @Override public String toString() { return ""; // NOI18N } }
[ "voskresensky.vladimir@gmail.com" ]
voskresensky.vladimir@gmail.com
077bf7f6ce3ed34de0fc0a4ae88db6cb90b2a39d
082e26b011e30dc62a62fae95f375e4f87d9e99c
/docs/weixin_7.0.4_source/反编译源码/反混淆后/src/main/java/p000a/p010i/p011b/p012a/p015c/p037i/p038b/C41432f.java
f778f26aba88fa637133d5bde140f560181ba178
[]
no_license
xsren/AndroidReverseNotes
9631a5aabc031006e795a112b7ac756a8edd4385
9202c276fe9f04a978e4e08b08e42645d97ca94b
refs/heads/master
2021-04-07T22:50:51.072197
2019-07-16T02:24:43
2019-07-16T02:24:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,133
java
package p000a.p010i.p011b.p012a.p015c.p037i.p038b; import p000a.p005f.p007b.C25052j; import p000a.p010i.p011b.p012a.p015c.p018b.C25093y; import p000a.p010i.p011b.p012a.p015c.p045l.C46867w; /* renamed from: a.i.b.a.c.i.b.f */ public abstract class C41432f<T> { private final T value; /* renamed from: b */ public abstract C46867w mo18011b(C25093y c25093y); public C41432f(T t) { this.value = t; } public T getValue() { return this.value; } public boolean equals(Object obj) { Object obj2 = null; if (this != obj) { Object value = getValue(); C41432f c41432f = (C41432f) (!(obj instanceof C41432f) ? null : obj); if (c41432f != null) { obj2 = c41432f.getValue(); } if (!C25052j.m39373j(value, obj2)) { return false; } } return true; } public int hashCode() { Object value = getValue(); return value != null ? value.hashCode() : 0; } public String toString() { return String.valueOf(getValue()); } }
[ "alwangsisi@163.com" ]
alwangsisi@163.com
4d0da47acc37bbc51e0a5e13c24b0c22210a0474
44e28c55f2ffef2b581a181e7f74ed2f2d66ad3e
/src/edu/nju/desserthouse/action/schedule/ShowTargetScheduleAction.java
3b31ed5445c3502e77551f96698c44b5fefa6e10
[]
no_license
bobo15850/DessertHouse
1cff7e45f6f0246a08b413e2ad4b7cbd08e1afbd
856f35721e494af4192085546c9cdecc72e11b46
refs/heads/master
2021-01-17T06:41:57.011911
2016-03-17T02:32:26
2016-03-17T02:32:26
50,285,924
1
1
null
null
null
null
UTF-8
Java
false
false
1,040
java
package edu.nju.desserthouse.action.schedule; import org.apache.struts2.convention.annotation.Action; import org.apache.struts2.convention.annotation.Result; import org.springframework.beans.factory.annotation.Autowired; import edu.nju.desserthouse.action.BaseAction; import edu.nju.desserthouse.model.Schedule; import edu.nju.desserthouse.service.ScheduleService; public class ShowTargetScheduleAction extends BaseAction { private static final long serialVersionUID = 8379488847664830267L; private int scheduleId; @Autowired private ScheduleService scheduleService; @Override @Action( value = "showTargetSchedule", results = { @Result(name = SUCCESS, location = "/page/schedule/showTargetSchedule.jsp") }) public String execute() throws Exception { Schedule schedule = scheduleService.getScheduleById(scheduleId); request.setAttribute("schedule", schedule); return SUCCESS; } public int getScheduleId() { return scheduleId; } public void setScheduleId(int scheduleId) { this.scheduleId = scheduleId; } }
[ "1248373163@qq.com" ]
1248373163@qq.com
4cccd36d1e61951ca3a69b1bc264069e072776c6
74fb3f8795036af477c86aa69980818e726ee3ba
/src/main/java/com/clashsoft/stocksim/model/Stock.java
5d8edaaa58800daa87b411c5264e84a64a58fea8
[ "BSD-3-Clause" ]
permissive
Clashsoft/Stock-Sim
178c8fb0e2f8f8e2bd7fe000106c57f60e185ada
8a2cb0ad659afe33dbef2cad18616fa8e2665632
refs/heads/master
2020-04-15T14:11:36.878940
2019-01-09T16:45:26
2019-01-09T16:45:26
115,126,787
0
0
null
null
null
null
UTF-8
Java
false
false
633
java
package com.clashsoft.stocksim.model; import com.clashsoft.stocksim.data.Transaction; import java.util.List; import java.util.UUID; public interface Stock { StockSim getStockSim(); UUID getID(); String getName(); String getSymbol(); long getPrice(); long getPrice(long time); long getSupply(); default long getMarketCap() { return this.getPrice() * this.getSupply(); } default long getMarketCap(long time) { return this.getPrice(time) * this.getSupply(); } List<Transaction> getTransactions(); List<Transaction> getTransactions(long start, long end); void addTransaction(Transaction transaction); }
[ "clashsoft@hotmail.com" ]
clashsoft@hotmail.com
c48067135ed181f2ad5b69a43c7e8649119f99f3
4bf1574c1ada72b9a7bcce1e0615162fcf5328da
/src/Java_Multithreaded_Programming_Core_Technology/part4/使用Condition实现等待通知错误用法与解决/use_condition_wait_notify_error/Run.java
87a1a8da479d7b5d7722ec2915724d4a38585b58
[]
no_license
LinZiYU1996/javaSEdemo
264bda529f8c9feb536392003ad42b78381e3159
eb62e95f7ca7c16ed69c3ec7d2167da31fc32bdb
refs/heads/master
2020-05-15T10:51:05.429185
2019-06-01T08:23:40
2019-06-01T08:23:40
182,203,364
0
0
null
null
null
null
UTF-8
Java
false
false
1,581
java
package Java_Multithreaded_Programming_Core_Technology.part4.使用Condition实现等待通知错误用法与解决.use_condition_wait_notify_error; /*/** * @Description: TODO * @Author: Mr.Lin * @CreateDate: 2019/5/25 10:48 * @Version: 1.0 */ public class Run { //关键字synchronized与waitO和notifyQ/notifyAll()方法相结合可以实现等待/通知模式, // 类ReentrantLock也可以实现同样的功能,但需要借助千Condition对象。Condition类是 在JDK5中出现的技术, // 使用它有更好的灵活性,比如可以实现多路通知功能,也就是在一 个Lock对象里面可以创建多个Condition(即对象监视器)实例 // ,线程对象可以注册在指定 的Cond巾on中,从而可以有选择性地进行线程通知,在调度线程上更加灵活。 //在使用notify()/notifyAll()方法进行通知时,被通知的线程却是由JVM随机选择的。但 使用ReentrantLock结合Condition类是 // 可以实现前面介绍过的”选择性通知”,这个功能是 非常重要的,而且在Condition类中是默认提供的。 //而synchronized就相当于整个Lock对象中只有一个单一的Con山tion对象,所有的线程 都注册在它一个对象的身上。线程开始notifyAll()时, // 需要通知所有的WAITING线程,没 有选择权,会出现相当大的效率问题。 public static void main(String[] args) { MyService service = new MyService(); ThreadA a = new ThreadA(service); a.start(); } }
[ "2669093302@qq.com" ]
2669093302@qq.com
c760e482b8a62f79b9004751fb6170015ace286f
8c73f38ec4426598b69712c09117febe921612d7
/src/org/sosy_lab/cpachecker/cpa/invariants/operators/interval/scalar/tocompound/.svn/text-base/ShiftLeftOperator.java.svn-base
a69deb7ce432bf00c9c8d11dda0278e8493c5a21
[ "Apache-2.0" ]
permissive
TommesDee/cpachecker
7c07f97f0d6493e8e1c37395ac290baa21149245
63c4d3aa409cf5e3ef942ae532c2baa7a355a825
refs/heads/master
2021-01-17T05:33:54.675253
2014-03-03T21:43:00
2014-03-03T21:43:00
14,956,754
1
1
null
null
null
null
UTF-8
Java
false
false
1,588
/* * CPAchecker is a tool for configurable software verification. * This file is part of CPAchecker. * * Copyright (C) 2007-2013 Dirk Beyer * All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * * CPAchecker web page: * http://cpachecker.sosy-lab.org */ package org.sosy_lab.cpachecker.cpa.invariants.operators.interval.scalar.tocompound; import java.math.BigInteger; import org.sosy_lab.cpachecker.cpa.invariants.CompoundInterval; import org.sosy_lab.cpachecker.cpa.invariants.SimpleInterval; import org.sosy_lab.cpachecker.cpa.invariants.operators.interval.scalar.tointerval.ISIOperator; /** * This class represents the left shift operator for left shifting * intervals by scalar values. */ enum ShiftLeftOperator implements ISCOperator { /** * The singleton instance of this operator. */ INSTANCE; @Override public CompoundInterval apply(SimpleInterval pFirstOperand, BigInteger pSecondOperand) { return CompoundInterval.of(ISIOperator.SHIFT_LEFT_OPERATOR.apply(pFirstOperand, pSecondOperand)); } }
[ "seratho@gmail.com" ]
seratho@gmail.com
7efbbf2ea40be1b9acb496a1ef33b65c37b5e23a
4bcd29bbc18f3a2cdac4dd16cf5cee908501ecd5
/MyRedBoy/app/src/main/java/com/tmall/myredboy/bean/CartInfoUpdateEvent.java
6a6134e10f0befc7bafe062e1a6bba70106c9e7f
[]
no_license
474843468/AsBoy
42c85e57bade74fbe6d11f7cf699e05041589eab
2bf2aa2b4268c8cf524dc555d2e0a98a9020ed83
refs/heads/master
2021-01-23T16:22:45.772502
2017-06-04T07:01:22
2017-06-04T07:01:22
93,296,189
0
0
null
null
null
null
UTF-8
Java
false
false
190
java
package com.tmall.myredboy.bean; public class CartInfoUpdateEvent { public boolean success; public CartInfoUpdateEvent(boolean success) { this.success = success; } }
[ "15609143618@163.com" ]
15609143618@163.com
113c07aa32cea95363ea4e8e384b401161ae97b2
17c30fed606a8b1c8f07f3befbef6ccc78288299
/Mate10_8_1_0/src/main/java/com/android/server/wifi/ABS/HwABSWiFiHandler.java
bb9976dd8ef06b02a8aaacf811a644a2ac9e3b90
[]
no_license
EggUncle/HwFrameWorkSource
4e67f1b832a2f68f5eaae065c90215777b8633a7
162e751d0952ca13548f700aad987852b969a4ad
refs/heads/master
2020-04-06T14:29:22.781911
2018-11-09T05:05:03
2018-11-09T05:05:03
157,543,151
1
0
null
2018-11-14T12:08:01
2018-11-14T12:08:01
null
UTF-8
Java
false
false
7,227
java
package com.android.server.wifi.ABS; import android.content.Context; import android.net.wifi.WifiConfiguration; import android.net.wifi.WifiInfo; import android.net.wifi.WifiManager; import android.os.Handler; import com.android.server.wifi.HwWifiServiceFactory; import com.android.server.wifi.HwWifiStatStore; import com.android.server.wifi.MSS.HwMSSArbitrager; import com.android.server.wifi.MSS.HwMSSArbitrager.MSSState; import com.android.server.wifi.WifiInjector; import com.android.server.wifi.WifiNative; import com.android.server.wifi.WifiStateMachine; import java.util.List; public class HwABSWiFiHandler { private static final int ABS_HANDOVER_TIME_OUT = 500; public static final String SUPPLICANT_BSSID_ANY = "any"; private Context mContext; private Handler mHandler; private HwABSDataBaseManager mHwABSDataBaseManager; private HwMSSArbitrager mHwMSSArbitrager; private boolean mIsABSHandover = false; private long mIsABSHandoverTime = 0; private int mNowCapability = 2; private WifiManager mWifiManager; private WifiNative mWifiNative; private HwWifiStatStore mWifiStatStore; private WifiStateMachine mWifiStateMachine; public HwABSWiFiHandler(Context context, Handler handler, WifiStateMachine wifiStateMachine) { this.mContext = context; this.mHandler = handler; this.mWifiStateMachine = wifiStateMachine; this.mWifiNative = WifiInjector.getInstance().getWifiNative(); this.mWifiManager = (WifiManager) this.mContext.getSystemService("wifi"); this.mHwABSDataBaseManager = HwABSDataBaseManager.getInstance(context); this.mWifiStatStore = HwWifiServiceFactory.getHwWifiStatStore(); this.mHwMSSArbitrager = HwMSSArbitrager.getInstance(this.mContext); this.mIsABSHandover = false; } private void handoverToMIMO() { WifiInfo mWifiInfo = this.mWifiManager.getConnectionInfo(); if (mWifiInfo != null && mWifiInfo.getBSSID() != null) { setAPCapability(2); hwABSReconnectHandover(); } } private void handoverToSISO() { WifiInfo mWifiInfo = this.mWifiManager.getConnectionInfo(); if (mWifiInfo != null && mWifiInfo.getBSSID() != null) { setAPCapability(1); hwABSReconnectHandover(); } } public void hwABSHandover(int capability) { if (this.mNowCapability == capability) { HwABSUtils.logD("hwABSHandover, the same with current capability"); return; } setIsABSHandover(true); if (2 == capability) { handoverToMIMO(); } else { handoverToSISO(); } } private void hwABSSoftHandover(int type) { setAPCapability(type); this.mWifiNative.hwABSSoftHandover(type); this.mHandler.sendEmptyMessageDelayed(17, 200); } private boolean hwABSReconnectHandover() { WifiInfo mWifiInfo = this.mWifiManager.getConnectionInfo(); if (mWifiInfo == null) { return false; } List<WifiConfiguration> configNetworks = this.mWifiManager.getConfiguredNetworks(); if (configNetworks == null || configNetworks.size() == 0) { HwABSUtils.logD("HwABSHandover, WiFi configured networks are invalid"); return false; } WifiConfiguration changeConfig = null; for (WifiConfiguration nextConfig : configNetworks) { if (mWifiInfo.getNetworkId() == nextConfig.networkId) { changeConfig = nextConfig; break; } } if (changeConfig == null) { HwABSUtils.logD("HwABSHandover, WifiConfiguration is null "); return false; } if (this.mWifiStatStore != null) { this.mWifiStatStore.updateAssocByABS(); } HwABSUtils.logD("hwABSReconnectHandover"); setTargetBssid(mWifiInfo.getBSSID()); this.mWifiStateMachine.reassociateCommand(); return true; } public boolean setTargetBssid(String bssid) { this.mWifiNative.setConfiguredNetworkBSSID(bssid); return true; } public void hwABSHandoverInScreenOff() { WifiInfo mWifiInfo = this.mWifiManager.getConnectionInfo(); if (mWifiInfo != null && mWifiInfo.getBSSID() != null) { HwABSApInfoData mHwABSApInfoData = this.mHwABSDataBaseManager.getApInfoByBssid(mWifiInfo.getBSSID()); if (mHwABSApInfoData != null) { if (mHwABSApInfoData.mSwitch_siso_type == 0 || mHwABSApInfoData.mSwitch_siso_type == 1) { hwABSSoftHandover(1); } else { hwABSHandover(1); } } } } public void setAPCapability(int capability) { int wifiState = this.mWifiStateMachine.syncGetWifiState(); this.mNowCapability = capability; HwABSUtils.logD("setAPCapability, capability = " + capability + " wifiState =" + wifiState); if (wifiState != 0 && wifiState != 1 && wifiState != 2) { this.mWifiNative.hwABSSetCapability(capability); } } public int getCurrentCapability() { return this.mNowCapability; } public void hwABScheckLinked() { } public boolean getIsABSHandover() { return this.mIsABSHandover; } public void setIsABSHandover(boolean flag) { this.mIsABSHandover = flag; if (this.mIsABSHandover) { this.mIsABSHandoverTime = System.currentTimeMillis(); setABSCurrentState(3); return; } this.mIsABSHandoverTime = 0; setABSCurrentState(this.mNowCapability); } public boolean isHandoverTimeout() { if (this.mIsABSHandoverTime == 0) { return false; } long handoverTime = System.currentTimeMillis() - this.mIsABSHandoverTime; HwABSUtils.logD("isHandoverTimeout handoverTime = " + handoverTime); if (handoverTime > 500) { return true; } return false; } public void setABSBlackList(String blackList) { int wifiState = this.mWifiStateMachine.syncGetWifiState(); HwABSUtils.logD("setAPCapability, wifiState =" + wifiState); if (wifiState != 0 && wifiState != 1 && wifiState != 2) { this.mWifiNative.hwABSBlackList(blackList); } } public void setABSCurrentState(int state) { MSSState currentState = MSSState.MSSUNKNOWN; if (state == 1) { currentState = MSSState.ABSMRC; } else if (state == 2) { currentState = MSSState.ABSMIMO; } else if (state == 3) { currentState = MSSState.ABSSWITCHING; } HwABSUtils.logD("setABSCurrentState, state =" + state); this.mHwMSSArbitrager.setABSCurrentState(currentState); } public boolean isNeedHandover() { if (this.mHwMSSArbitrager.getMSSCurrentState() == MSSState.MSSSISO) { HwABSUtils.logD("isNeedHandover, return false"); return false; } HwABSUtils.logD("isNeedHandover, return true"); return true; } }
[ "lygforbs0@mail.com" ]
lygforbs0@mail.com
011b6bbc6dafffa09c973a6df163f7aed81bf472
bd02936120bcfdd81d0fbbbc752e89bf49b1cf03
/javassist/bytecode/ConstPool16.java
5ec82589737442dd12a3352da7cbc7eb7355a2dc
[]
no_license
Tuzakci/ICEHack-0.5-Source
f336f2b4e8f0b5ea3462f3f37da14fba7c0a554a
fc347479ce8dddb606d14b4c19dac2e7d446ca20
refs/heads/main
2023-01-09T08:33:56.273435
2020-11-13T21:37:18
2020-11-13T21:37:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,294
java
package javassist.bytecode; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; import java.io.PrintWriter; import java.util.Map; class ConstPool16 extends ConstPool13 { static final int tag = 5; long value; public ConstPool16(long paramLong, int paramInt) { super(paramInt); this.value = paramLong; } public ConstPool16(DataInputStream paramDataInputStream, int paramInt) throws IOException { super(paramInt); this.value = paramDataInputStream.readLong(); } public int hashCode() { return (int)(this.value ^ this.value >>> 32L); } public boolean equals(Object paramObject) { return (paramObject instanceof ConstPool16 && ((ConstPool16)paramObject).value == this.value); } public int getTag() { return 5; } public int copy(ConstPool14 paramConstPool141, ConstPool14 paramConstPool142, Map paramMap) { return paramConstPool142.addLongInfo(this.value); } public void write(DataOutputStream paramDataOutputStream) throws IOException { paramDataOutputStream.writeByte(5); paramDataOutputStream.writeLong(this.value); } public void print(PrintWriter paramPrintWriter) { paramPrintWriter.print("Long "); paramPrintWriter.println(this.value); } }
[ "70656560+NotBestDoggo@users.noreply.github.com" ]
70656560+NotBestDoggo@users.noreply.github.com
f802cb105c6d1e96e8b14434b2d3668255317c25
967ceeb47d218c332caba343018011ebe5fab475
/WEB-INF/retail_scm_core_src/com/skynet/retailscm/stockcountissuetrack/StockCountIssueTrackManagerException.java
53acd1617d5e22deab0277d2d2e23c4b910f86be
[ "Apache-2.0" ]
permissive
flair2005/retail-scm-integrated
bf14139a03083db9c4156a11c78a6f36f36b2e0b
eacb3bb4acd2e8ee353bf80e8ff636f09f803658
refs/heads/master
2021-06-23T08:02:37.521318
2017-08-10T17:18:50
2017-08-10T17:18:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
371
java
package com.skynet.retailscm.stockcountissuetrack; //import com.skynet.retailscm.EntityNotFoundException; import com.skynet.retailscm.RetailScmException; public class StockCountIssueTrackManagerException extends RetailScmException { private static final long serialVersionUID = 1L; public StockCountIssueTrackManagerException(String string) { super(string); } }
[ "philip_chang@163.com" ]
philip_chang@163.com
9a31402df8635117e8e6c7fe546fa01e9eb50b67
03be3f540f93a1507e82e4e84a651e205ba2971e
/.svn/pristine/9a/9a31402df8635117e8e6c7fe546fa01e9eb50b67.svn-base
e01cc590f4f0e930695e1cbb7125f43c59bd485c
[]
no_license
Tarunjain19/DXC_SVN
448103f0c56e79616a2801acbf5d369d6e256b36
99a90150d30374929382c3181ee8b1f914c905ae
refs/heads/master
2022-06-04T10:36:52.755986
2020-05-06T08:44:47
2020-05-06T08:44:47
261,372,252
0
0
null
null
null
null
UTF-8
Java
false
false
4,018
package flow.subflow.RGC_Flow; /** * The Data class handles many types of server-side operations including data * collection (from a data sources such as a database, or web service), variable * assignments and operations (like copying variable values, performing mathematic * operations, and collection iteration), conditional evaluation to control callflow * execution based on variable values, and logging/tracing statements. * * Items created in the getDataActions() method are executed/evaluated in order * and if a condional branch condition evaluates to "true" then the branch is * activated and the execution of data actions is halted. If no "true" conditions * are encountered, then all data actions will be executed/evaluated and the * application will proceed to the "Default" servlet. * Last generated by Orchestration Designer at: 2016-JUN-07 11:56:14 AM */ public class DAT_Chk_Tries5 extends com.avaya.sce.runtime.Data { //{{START:CLASS:FIELDS //}}END:CLASS:FIELDS /** * Default constructor * Last generated by Orchestration Designer at: 2016-JUN-07 11:56:14 AM */ public DAT_Chk_Tries5() { //{{START:CLASS:CONSTRUCTOR super(); //}}END:CLASS:CONSTRUCTOR } /** * Returns the Next item which will forward application execution * to the next form in the call flow. * Last generated by Orchestration Designer at: 2016-JUN-23 05:13:22 PM */ public com.avaya.sce.runtime.Next getNext(com.avaya.sce.runtimecommon.SCESession mySession) { com.avaya.sce.runtime.Next next = null; return next; } /** * Create a list of local variables used by items in the data node. * * This method is generated automatically by the code generator * and should not be manually edited. Manual edits may be overwritten * by the code generator. * Last generated by Orchestration Designer at: 2016-JUN-23 05:13:22 PM */ public java.util.Collection<VariableInfo> getLocalVariables(){ java.util.Collection<VariableInfo> variables = new java.util.ArrayList<VariableInfo>(); return variables; } /** * Creates and conditionally executes operations that have been configured * in the Callflow. This method will build a collection of operations and * have the framework execute the operations by calling evaluateActions(). * If the evaluation causes the framework to forward to a different servlet * then execution stops. * Returning true from this method means that the framework has forwarded the * request to a different servlet. Returning false means that the default * Next will be invoked. * * This method is generated automatically by the code generator * and should not be manually edited. Manual edits may be overwritten * by the code generator. * Last generated by Orchestration Designer at: 2016-JUN-23 05:13:22 PM */ public boolean executeDataActions(com.avaya.sce.runtimecommon.SCESession mySession) throws Exception { java.util.Collection actions = null; actions = new java.util.ArrayList(2); actions.add(new com.avaya.sce.runtime.varoperations.Increment("Invalid_PIN_Count").setDebugId(1756)); if(evaluateActions(actions, mySession)) { return true; } actions = null; if(((com.avaya.sce.runtime.Condition)new com.avaya.sce.runtime.Condition("condition1", "Invalid_PIN_Count", com.avaya.sce.runtime.Expression.INT_LESS_THAN_EQUAL, "constant:three", true).setDebugId(1757)).evaluate(mySession)) { actions = new java.util.ArrayList(1); actions.add(new com.avaya.sce.runtime.Next("RGC_Flow-DM_Get_PIN", "Get PIN").setDebugId(1758)); if(evaluateActions(actions, mySession)) { return true; } actions = null; } else { actions = new java.util.ArrayList(1); actions.add(new com.avaya.sce.runtime.Next("RGC_Flow-DM_TriesExceeded_Msg", "Tries_Exceeded").setDebugId(1760)); if(evaluateActions(actions, mySession)) { return true; } actions = null; } // return false if the evaluation of actions did not cause a servlet forward or redirect return false; } }
[ "tarun.jain3@dxc.com" ]
tarun.jain3@dxc.com
7022318dddc655af04659888df36ea113934818a
f35f4008d60bf04e6e3236a60514693cae296d42
/app/src/main/java/com/google/android/gms/games/internal/constants/MatchParticipantStatus.java
c13f28b044847ba956e54def4619865b0c95bf49
[]
no_license
alsmwsk/golfmon
ef0c8e8c7ecaa13371deed40f7e20468b823b0e9
740132d47185bfe9ec9d6774efbde5404ea8cf6d
refs/heads/master
2020-03-22T11:16:01.438894
2018-07-06T09:47:10
2018-07-06T09:47:10
139,959,669
0
0
null
null
null
null
UTF-8
Java
false
false
388
java
package com.google.android.gms.games.internal.constants; public final class MatchParticipantStatus {} /* Location: C:\Users\TGKIM\Downloads\작업폴더\리버싱\androidReversetools\jd-gui-0.3.6.windows\com.appg.golfmon-1-dex2jar.jar * Qualified Name: com.google.android.gms.games.internal.constants.MatchParticipantStatus * JD-Core Version: 0.7.0.1 */
[ "alsmwsk@naver.com" ]
alsmwsk@naver.com
b494f62ef2918d75a7130834ab16d88f64ef5030
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/2/2_a01b114c2880fedced9bfc2f52a68ab9d126da00/AcceleoFile/2_a01b114c2880fedced9bfc2f52a68ab9d126da00_AcceleoFile_s.java
83546870d52d31fde93b5f8be6ef0de8da26b8b5
[]
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,766
java
/******************************************************************************* * Copyright (c) 2008, 2009 Obeo. * 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: * Obeo - initial API and implementation *******************************************************************************/ package org.eclipse.acceleo.parser; import java.io.File; import org.eclipse.acceleo.common.IAcceleoConstants; import org.eclipse.core.runtime.Path; /** * This is an Acceleo file. It creates a mapping between an MTL java.io.File and an unique ID. This ID is the * full qualified module name. It is used to identify the module, like the NsURI feature in the EPackage * registry. * * @author <a href="mailto:jonathan.musset@obeo.fr">Jonathan Musset</a> * @since 3.0 */ public final class AcceleoFile { /** * The MTL input IO file. */ private File mtlFile; /** * The full qualified module name. For example, 'org::eclipse::myGen' is the full module name of the * 'MyProject/src/org/eclipse/myGen.mtl' file. */ private String fullModuleName; /** * Constructor. * * @param mtlFile * the MTL input IO file * @param fullModuleName * the full qualified module name which can be computed with the following static methods of * this class : 'javaPackageToFullModuleName', 'simpleModuleName', * 'relativePathToFullModuleName'... */ public AcceleoFile(File mtlFile, String fullModuleName) { super(); this.mtlFile = mtlFile; this.fullModuleName = fullModuleName; } /** * Computes the full qualified module name with the java package name and the module name. For example, * 'org::eclipse::myGen' is the full module name for the 'org.eclipse' java package and the 'myGen' simple * module name. * * @param javaPackageName * is the name of the enclosing java package * @param moduleName * is the simple name of the module (i.e the short name of the MTL file) * @return a valid full qualified module name that you can use to create an AcceleoFile instance */ public static String javaPackageToFullModuleName(String javaPackageName, String moduleName) { if (javaPackageName != null && javaPackageName.length() > 0) { return javaPackageName.replaceAll("\\.", IAcceleoConstants.NAMESPACE_SEPARATOR) + IAcceleoConstants.NAMESPACE_SEPARATOR + moduleName; } else { return moduleName; } } /** * Computes the full qualified module name with the MTL IO file. The single information available is the * file name. In this case, the module name isn't relative to the enclosing source folder. * * @param mtlFile * is the MTL IO file * @return a valid full qualified module name that you can use to create an AcceleoFile instance */ public static String simpleModuleName(File mtlFile) { return new Path(mtlFile.getName()).removeFileExtension().lastSegment(); } /** * Computes the full qualified module name with the given relative path. Let's take a simple MTL file with * the following full path 'MyProject/src/org/eclipse/myGen.mtl'. The relative path of this MTL file must * be 'org/eclipse/myGen.mtl'. In this case, the method returns 'org::eclipse::myGen' as the full module * name of the MTL file. * * @param relativePath * is the MTL file path, relative to the enclosing source folder * @return a valid full qualified module name that you can use to create an AcceleoFile instance */ public static String relativePathToFullModuleName(String relativePath) { StringBuilder fullModuleName = new StringBuilder(); String[] segments = new Path(relativePath).removeFileExtension().segments(); for (int i = 0; i < segments.length; i++) { if (i != 0) { fullModuleName.append(IAcceleoConstants.NAMESPACE_SEPARATOR); } fullModuleName.append(segments[i]); } return fullModuleName.toString(); } /** * Gets the MTL input IO file. * * @return the MTL input IO file */ public File getMtlFile() { return mtlFile; } /** * Gets the full qualified module name. This ID is used to identify everywhere the module defined in this * file, like the NsURI feature in the EPackage registry. This information is also stored in the root * element of the EMTL resource (Module.nsURI). * * @return the full qualified module name */ public String getFullModuleName() { return fullModuleName; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
68a95b6dcc8ef86521b032d67f594752b22770b9
90833a7f5552cd0b2de6e92d1915b13a57290ff3
/src/main/java/com/univocity/cardano/wallet/api/generated/common/ExpiresAt.java
f1551525b787df9ba55eaa95898886c0fea58590
[ "Apache-2.0" ]
permissive
Daniel-SchaeferJ/envlp-cardano-wallet
c7a7d723375382ca1ecb8d86ad02446b7d267736
fba23620f69f4dcea010005afc78a175d466dfe3
refs/heads/main
2023-02-12T01:33:20.158351
2021-01-14T19:19:52
2021-01-14T19:19:52
319,252,048
0
0
Apache-2.0
2021-01-14T19:19:53
2020-12-07T08:27:08
Java
UTF-8
Java
false
false
510
java
package com.univocity.cardano.wallet.api.generated.common; import com.univocity.cardano.wallet.api.generated.common.*; import java.math.*; import static com.univocity.cardano.wallet.common.Utils.*; import com.fasterxml.jackson.annotation.*; /** * * Absolute time and slot at which the pending transaction TTL (time to live) will lapse. * {@code if: status == pending OR status == expired} * */ @JsonIgnoreProperties(ignoreUnknown = true) public final class ExpiresAt extends AbstractTimeDetails { }
[ "jbax@univocity.com" ]
jbax@univocity.com
e8bba58463ccdefec0df675344d7bc64c1df6560
4312a71c36d8a233de2741f51a2a9d28443cd95b
/RawExperiments/DB/Math 3.2 RC5/AstorMain-Math 3.2 RC5/src/variant-553/org/apache/commons/math/optimization/direct/MultiDirectional.java
7586cf33eeeef1277cdb9f1b023f279baf184ad8
[]
no_license
SajjadZaidi/AutoRepair
5c7aa7a689747c143cafd267db64f1e365de4d98
e21eb9384197bae4d9b23af93df73b6e46bb749a
refs/heads/master
2021-05-07T00:07:06.345617
2017-12-02T18:48:14
2017-12-02T18:48:14
112,858,432
0
0
null
null
null
null
UTF-8
Java
false
false
2,943
java
package org.apache.commons.math.optimization.direct; public class MultiDirectional extends org.apache.commons.math.optimization.direct.DirectSearchOptimizer { private final double khi; private final double gamma; public MultiDirectional() { this.khi = 2.0; this.gamma = 0.5; } public MultiDirectional(final double khi ,final double gamma) { this.khi = khi; this.gamma = gamma; } @java.lang.Override protected void iterateSimplex(final java.util.Comparator<org.apache.commons.math.optimization.RealPointValuePair> comparator) throws java.lang.IllegalArgumentException, org.apache.commons.math.FunctionEvaluationException, org.apache.commons.math.optimization.OptimizationException { while (true) { incrementIterationsCounter(); final org.apache.commons.math.optimization.RealPointValuePair[] original = simplex; final org.apache.commons.math.optimization.RealPointValuePair best = original[0]; final org.apache.commons.math.optimization.RealPointValuePair reflected = evaluateNewSimplex(original, 1.0, comparator); if ((comparator.compare(reflected, best)) < 0) { final org.apache.commons.math.optimization.RealPointValuePair[] reflectedSimplex = simplex; final org.apache.commons.math.optimization.RealPointValuePair expanded = evaluateNewSimplex(original, khi, comparator); if ((comparator.compare(reflected, expanded)) <= 0) { simplex = reflectedSimplex; } return ; } final org.apache.commons.math.optimization.RealPointValuePair contracted = evaluateNewSimplex(original, gamma, comparator); if ((comparator.compare(contracted, best)) < 0) { return ; } } } private org.apache.commons.math.optimization.RealPointValuePair evaluateNewSimplex(final org.apache.commons.math.optimization.RealPointValuePair[] original, final double coeff, final java.util.Comparator<org.apache.commons.math.optimization.RealPointValuePair> comparator) throws org.apache.commons.math.FunctionEvaluationException, org.apache.commons.math.optimization.OptimizationException { final double[] xSmallest = original[0].getPointRef(); final int n = xSmallest.length; simplex[0] = original[0]; for (int i = 1 ; i <= n ; ++i) { final double[] xOriginal = original[i].getPointRef(); final double[] xTransformed = new double[n]; for (int j = 0 ; j < n ; ++j) { xTransformed[j] = (xSmallest[j]) + (coeff * ((xSmallest[j]) - (xOriginal[j]))); } simplex[i] = new org.apache.commons.math.optimization.RealPointValuePair(xTransformed , java.lang.Double.NaN , false); } evaluateSimplex(comparator); return simplex[0]; } }
[ "sajjad.syed@ucalgary.ca" ]
sajjad.syed@ucalgary.ca
de0d531121d6a030625a90080e7690cfbd253f0f
739bc08b4689551a9d6062a8d41730d07a47ddf0
/commonlib/src/main/java/com/jiutai/commonlib/plugin/IPlugin.java
cf9711e44a0617a906a517aaeff977411673def9
[]
no_license
orangesunshine/OrangeSunshine
8d8602d5fad6016f0506400f4a83d0699f9644a8
331791422c2e655f8ad8f837508f399c9491f2cb
refs/heads/master
2020-04-26T03:59:05.502222
2019-03-15T01:27:12
2019-03-15T01:27:12
173,285,672
1
0
null
null
null
null
UTF-8
Java
false
false
566
java
package com.jiutai.commonlib.plugin; import android.app.Activity; import android.content.Intent; import android.os.Bundle; public interface IPlugin { int FROM_INTERNAL = 0;//内部跳转 int FROM_EXTERNAL = 1;//内部跳转 void attach(Activity activity); void onCreate(Bundle saveInstanceState); void setContentView(int layoutResId); void onStart(); void onRestart(); void onActivityResult(int requestCode, int resultCode, Intent data); void onResume(); void onPause(); void onStop(); void onDestroy(); }
[ "429360705@qq.com" ]
429360705@qq.com
795101af0980d4efbaf1cf2f94a9fb6f7a1ed6c5
c404d8a4561428ceb878ce85b5c0cee2bf3f7a14
/HandFarm/src/main/java/com/hxsn/hf/service/messageservice.java
b9045035f03a1589538f3ec1af67a8a5c8569811
[]
no_license
jielysong/HXSN
3e55acc7c1c35b76d9a3bf106155d2ec5ca4a5e9
b336bdbf2d9e4ecc6e10a01583812b01a2706cb5
refs/heads/master
2021-01-17T20:00:01.236954
2016-06-16T06:45:32
2016-06-16T06:45:32
61,268,879
0
1
null
null
null
null
UTF-8
Java
false
false
4,399
java
package com.hxsn.hf.service; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.net.URL; import java.net.URLConnection; import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; import android.app.Service; import android.content.Context; import android.content.Intent; import android.os.IBinder; import com.hxsn.hf.R; import com.hxsn.hf.activity.XiaoxiActivity; public class messageservice extends Service { // ��ȡ��Ϣ�߳� private messagethread messagethread = null; // ����鿴 private Intent messageintent = null; private PendingIntent messagependingintent = null; // ֪ͨ����Ϣ private int messagenotificationid = 1000; private Notification messagenotification = null; private NotificationManager messagenotificatiomanager = null; private String xiaoxi = "0"; @Override public IBinder onBind(Intent intent) { // TODO Auto-generated method stub return null; } public int onStartCommand(Intent intent, int flags, int startid) { // ��ʼ�� messagenotification = new Notification(); messagenotification.icon = R.drawable.ic_launcher; messagenotification.tickerText = "三省农场通知"; messagenotification.defaults = Notification.DEFAULT_SOUND; messagenotification.flags = Notification.FLAG_AUTO_CANCEL; messagenotificatiomanager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); messageintent = new Intent(this, XiaoxiActivity.class); messageintent.setAction("android.intent.action.MAIN"); messageintent.addCategory("android.intent.category.LAUNCHER"); messageintent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); messagependingintent = PendingIntent.getActivity(this, 0, messageintent, 0); messagethread = new messagethread(); messagethread.isrunning = true; messagethread.start(); return super.onStartCommand(intent, flags, startid); } /** * �ӷ������˻�ȡ��Ϣ * */ class messagethread extends Thread { // ����״̬����һ�����д��� public boolean isrunning = true; @SuppressWarnings("deprecation") public void run() { while (true) { try { String xiaoxi = doNetWork(); if (xiaoxi.equals("2")) { messagenotification.setLatestEventInfo( messageservice.this, "新消息", "西瓜熟了,请及时采摘" , messagependingintent); messagenotificatiomanager.notify(messagenotificationid, messagenotification); // messagenotificationid++; } Thread.sleep(5000); } catch (Exception e) { e.printStackTrace(); } } } } @Override public void onDestroy() { super.onDestroy(); System.exit(0); //messagethread.isrunning = false; } private String doNetWork() { // TODO Auto-generated method stub PrintWriter out = null; BufferedReader in = null; String result = ""; try { URL realUrl = new URL("http://192.168.12.33:8080/zhnc/zixun/pick.json"); URLConnection conn = realUrl.openConnection(); conn.setRequestProperty("Content-Type", "html/text"); conn.setConnectTimeout(20*1000); conn.setReadTimeout(20*1000); conn.setDoOutput(false); conn.setDoInput(true); conn.connect(); in = new BufferedReader(new InputStreamReader(conn.getInputStream())); String line; while ((line = in.readLine()) != null) { if(result.equals("")){ result += line; } else { result += "\n" + line; } } System.out.println("result: " + result); } catch (Exception e) { e.printStackTrace(); } finally { try { if (out != null) { out.close(); } if (in != null) { in.close(); } } catch (IOException ex) { ex.printStackTrace(); } } return result.equals("")? "0":result; } }
[ "jielysong@163.com" ]
jielysong@163.com
b244f26898a7ae62d83f317a2b44111680336b43
5e3235edf3de262f4d10b9e9e1fcc3bd13d6b8b1
/Code Snippet Repository/Hibernate/Hibernate7149.java
d6825eadcad3b27db3f729e0db590d2c574a1db8
[]
no_license
saber13812002/DeepCRM
3336a244d4852a364800af3181e03e868cf6f9f5
be3e5e50e34a042d5ba7259ff5ff75c08ab32bb9
refs/heads/master
2023-03-16T00:08:06.473699
2018-04-18T05:29:50
2018-04-18T05:29:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
626
java
@Test public void test() { SimpleEntity[] entities = new SimpleEntity[2]; entities[0] = new SimpleEntity(); entities[0].name = "test"; TransactionUtil.doInJPA( this::sessionFactory, em -> { entities[1] = em.merge( entities[0] ); assertNotNull( em.getEntityManagerFactory().getPersistenceUnitUtil().getIdentifier( entities[1] ) ); } ); // Call as detached entity try ( SessionFactory sessionFactory = sessionFactory() ) { assertNotNull( sessionFactory.getPersistenceUnitUtil().getIdentifier( entities[1] ) ); } }
[ "Qing.Mi@my.cityu.edu.hk" ]
Qing.Mi@my.cityu.edu.hk
62ea1334314f90202bb4117acd6620aea50c0082
5ca1e535b4c809c29a2835c83c518b845c685455
/services/hrdb/src/com/auto_gbqcbceevs/hrdb/dao/EmployeeDao.java
24b8b1eecd55740dded1f462f9e9300959fcddf1
[]
no_license
wavemakerapps/Auto_gbQCbceeVs
4cc803d10276fda80bb28fa8b899a838922af305
ff554089c76adfefb1969bc69dc87df5b519ffb2
refs/heads/master
2020-03-08T00:02:07.207582
2018-04-02T18:36:40
2018-04-02T18:36:40
127,796,325
0
0
null
null
null
null
UTF-8
Java
false
false
1,209
java
/*Copyright (c) 2015-2016 wavemaker.com All Rights Reserved. This software is the confidential and proprietary information of wavemaker.com You shall not disclose such Confidential Information and shall use it only in accordance with the terms of the source code license agreement you entered into with wavemaker.com*/ package com.auto_gbqcbceevs.hrdb.dao; /*This is a Studio Managed File. DO NOT EDIT THIS FILE. Your changes may be reverted by Studio.*/ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.orm.hibernate5.HibernateTemplate; import org.springframework.stereotype.Repository; import com.wavemaker.runtime.data.dao.WMGenericDaoImpl; import com.auto_gbqcbceevs.hrdb.Employee; /** * Specifies methods used to obtain and modify Employee related information * which is stored in the database. */ @Repository("hrdb.EmployeeDao") public class EmployeeDao extends WMGenericDaoImpl<Employee, Integer> { @Autowired @Qualifier("hrdbTemplate") private HibernateTemplate template; @Override public HibernateTemplate getTemplate() { return this.template; } }
[ "automate1@wavemaker.com" ]
automate1@wavemaker.com
6aa9d0facce91b99305a4048d0a48487d196bd84
c2a210bca6c0c9a96d191b14916ce30ab6007be6
/src/main/java/de/ysl3000/chunkguard/lib/inventory/ClickableInventory.java
242e8464519104d57da00ada5cacab42432c4e97
[ "MIT" ]
permissive
yannicklamprecht/ChunkGuard
cc66e2aec7952589fd42221ac3c2b65315dc78b4
1827a14e2dde76c073e2ab2e30eb9d751c7939f4
refs/heads/master
2022-01-20T03:25:17.433163
2019-06-21T20:19:14
2019-06-21T20:19:14
52,695,114
1
0
null
2019-05-14T11:46:16
2016-02-28T00:00:58
Java
UTF-8
Java
false
false
1,819
java
package de.ysl3000.chunkguard.lib.inventory; import java.util.HashMap; import java.util.Map; import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.inventory.Inventory; import org.bukkit.plugin.java.JavaPlugin; public abstract class ClickableInventory<T extends JavaPlugin> implements Listener { protected String inventoryName; private Map<Integer, ClickableItem> items; public ClickableInventory(T plugin, String inventoryName) { this.items = new HashMap<>(); plugin.getServer().getPluginManager().registerEvents(this, plugin); this.inventoryName = inventoryName; } protected void setClickableItem(int position, ClickableItem item) { this.items.put(position, item); } @EventHandler public void onClick(final InventoryClickEvent event) { if (!(event.getWhoClicked() instanceof Player)) { return; } if (event.getClickedInventory() == null) { return; } if (event.getView().getTitle().equals(this.inventoryName) && event.getCurrentItem() != null) { event.setCancelled(true); this.items.get(event.getSlot()).run((Player) event.getWhoClicked()); } } public Inventory getInventory() { int size = this.items.size() / 9; if (this.items.size() % 9 != 0) { ++size; } size *= 9; if (size == 0) { size = 9; } final Inventory inventory = Bukkit.createInventory(null, size, this.inventoryName); this.items.forEach((position, stack) -> inventory.setItem(position, stack.getItemStack())); return inventory; } }
[ "unconfigured@null.spigotmc.org" ]
unconfigured@null.spigotmc.org
8202a7db42d6c30697a0a0a058d657954aa772a5
4ae0cf78f2ee2749846fbc14ba4348f62e593e09
/core/src/main/java/com/huawei/openstack4j/openstack/key/management/domain/EncryptedDEK.java
fbf9b678bdecbaf214c90a8b1f8c11f4013007f7
[ "Apache-2.0" ]
permissive
sl061201124/openstack4j
ca9df2f477322da60fd6c8291ef9e9e6951ada89
daa75734746b86467269f5c3a3a1b66cc746b2a3
refs/heads/master
2021-08-11T22:41:41.067802
2017-11-14T06:27:36
2017-11-14T06:27:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,028
java
/******************************************************************************* * Copyright 2017 HuaWei TLD * * 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.huawei.openstack4j.openstack.key.management.domain; import com.fasterxml.jackson.annotation.JsonProperty; import com.huawei.openstack4j.model.ModelEntity; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.ToString; @Getter @ToString @Builder(toBuilder = true) @NoArgsConstructor @AllArgsConstructor public class EncryptedDEK implements ModelEntity { private static final long serialVersionUID = -6764087311133427927L; /** * the key identifier used to generate the DEK */ @JsonProperty("key_id") String keyId; @JsonProperty("cipher_text") String cipherText; @JsonProperty("datakey_length") Integer dataKeyLength; }
[ "iampurse@vip.qq.com" ]
iampurse@vip.qq.com
36d4f12daa9d8fde9c06a49ce54a64a33ad4df71
bfac99890aad5f43f4d20f8737dd963b857814c2
/reg4/v1/xwiki-platform-core/xwiki-platform-gwt/xwiki-platform-gwt-user/src/main/java/org/xwiki/gwt/user/client/ui/CompositeDialogBox.java
fc7158763c9ba4083e0318bd9866722cf64e0395
[]
no_license
STAMP-project/dbug
3b3776b80517c47e5cac04664cc07112ea26b2a4
69830c00bba4d6b37ad649aa576f569df0965c72
refs/heads/master
2021-01-20T03:59:39.330218
2017-07-12T08:03:40
2017-07-12T08:03:40
89,613,961
0
1
null
null
null
null
UTF-8
Java
false
false
3,422
java
/* * See the NOTICE file distributed with this work for additional * information regarding copyright ownership. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.xwiki.gwt.user.client.ui; import com.google.gwt.event.logical.shared.CloseEvent; import com.google.gwt.event.logical.shared.CloseHandler; import com.google.gwt.event.logical.shared.HasCloseHandlers; import com.google.gwt.event.shared.HandlerRegistration; import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.PopupPanel; import com.google.gwt.user.client.ui.Widget; /** * The base class for any custom dialog box. It prevents unwanted modifications of the content from outside. It wraps * {@link DialogBox} object that you can customize and which is not accessible outside. * * @version $Id: 98f140029a78efc19131a1182233e1a606d5f820 $ */ public class CompositeDialogBox extends Composite implements HasCloseHandlers<CompositeDialogBox>, CloseHandler<PopupPanel> { /** * The underlying dialog box. */ private final DialogBox dialog; /** * Creates a new composite dialog box. * * @param autoHide Whether or not the dialog should auto hide when the user clicks outside of it. * @param modal Specifies if the dialog box can loose focus. */ public CompositeDialogBox(boolean autoHide, boolean modal) { dialog = new DialogBox(autoHide, modal); dialog.addCloseHandler(this); } @Override protected void initWidget(Widget widget) { super.initWidget(widget); dialog.setWidget(this); } /** * Protected access to the underlying dialog box. * * @return the wrapped dialog box. */ protected DialogBox getDialog() { return dialog; } /** * Centers this dialog on the screen. * * @see DialogBox#center() */ public void center() { dialog.center(); } /** * Hides this dialog box. * * @see DialogBox#hide() */ public void hide() { dialog.hide(); } @Override public HandlerRegistration addCloseHandler(CloseHandler<CompositeDialogBox> handler) { return addHandler(handler, CloseEvent.getType()); } @Override public void onClose(CloseEvent<PopupPanel> event) { if (event.getSource() == dialog) { CloseEvent.fire(this, this, event.isAutoClosed()); } } /** * @return {@code true} if this dialog is currently shown, {@code false} otherwise * * @see DialogBox#isShowing() */ public boolean isShowing() { return dialog.isShowing(); } }
[ "caroline.landry@inria.fr" ]
caroline.landry@inria.fr
485dd1f5821b008fed3259953a3ec757f8aafdec
3efa417c5668b2e7d1c377c41d976ed31fd26fdc
/src/br/com/mind5/webhook/moipMultipayment/model/action/WokaymoipVisiEnforceIdPayment.java
eb30d0650165bd3abfb2507065b714b1019c2647
[]
no_license
grazianiborcai/Agenda_WS
4b2656716cc49a413636933665d6ad8b821394ef
e8815a951f76d498eb3379394a54d2aa1655f779
refs/heads/master
2023-05-24T19:39:22.215816
2023-05-15T15:15:15
2023-05-15T15:15:15
109,902,084
0
0
null
2022-06-29T19:44:56
2017-11-07T23:14:21
Java
UTF-8
Java
false
false
782
java
package br.com.mind5.webhook.moipMultipayment.model.action; import br.com.mind5.info.InfoSetter; import br.com.mind5.model.action.ActionVisitorTemplateEnforce; import br.com.mind5.model.decisionTree.DeciTreeOption; import br.com.mind5.webhook.moipMultipayment.info.WokaymoipInfo; import br.com.mind5.webhook.moipMultipayment.info.WokaymoipSetterIdPayment; public final class WokaymoipVisiEnforceIdPayment extends ActionVisitorTemplateEnforce<WokaymoipInfo> { public WokaymoipVisiEnforceIdPayment(DeciTreeOption<WokaymoipInfo> option) { super(option); } @Override protected WokaymoipInfo enforceHook(WokaymoipInfo recordInfo) { InfoSetter<WokaymoipInfo> attrSetter = new WokaymoipSetterIdPayment(); return attrSetter.setAttr(recordInfo); } }
[ "mmaciel@mind5.com" ]
mmaciel@mind5.com
007e1b1ee7ff9e513b977e24cadc7221bc707a87
a2df6764e9f4350e0d9184efadb6c92c40d40212
/aliyun-java-sdk-ahas-openapi/src/main/java/com/aliyuncs/ahas_openapi/model/v20190901/CreateDegradeRuleResponse.java
e092edaf889370b443ffd2dbf0eee98cc0710b24
[ "Apache-2.0" ]
permissive
warriorsZXX/aliyun-openapi-java-sdk
567840c4bdd438d43be6bd21edde86585cd6274a
f8fd2b81a5f2cd46b1e31974ff6a7afed111a245
refs/heads/master
2022-12-06T15:45:20.418475
2020-08-20T08:37:31
2020-08-26T06:17:49
290,450,773
1
0
NOASSERTION
2020-08-26T09:15:48
2020-08-26T09:15:47
null
UTF-8
Java
false
false
4,680
java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.ahas_openapi.model.v20190901; import com.aliyuncs.AcsResponse; import com.aliyuncs.ahas_openapi.transform.v20190901.CreateDegradeRuleResponseUnmarshaller; import com.aliyuncs.transform.UnmarshallerContext; /** * @author auto create * @version */ public class CreateDegradeRuleResponse extends AcsResponse { private String code; private String message; private String requestId; private Boolean success; private Data data; public String getCode() { return this.code; } public void setCode(String code) { this.code = code; } public String getMessage() { return this.message; } public void setMessage(String message) { this.message = message; } public String getRequestId() { return this.requestId; } public void setRequestId(String requestId) { this.requestId = requestId; } public Boolean getSuccess() { return this.success; } public void setSuccess(Boolean success) { this.success = success; } public Data getData() { return this.data; } public void setData(Data data) { this.data = data; } public static class Data { private String appName; private Boolean enable; private Integer halfOpenBaseAmountPerStep; private Integer halfOpenRecoveryStepNum; private Integer minRequestAmount; private String namespace; private Integer recoveryTimeoutMs; private String resource; private Long ruleId; private Integer slowRtMs; private Integer statDurationMs; private Integer strategy; private Float threshold; public String getAppName() { return this.appName; } public void setAppName(String appName) { this.appName = appName; } public Boolean getEnable() { return this.enable; } public void setEnable(Boolean enable) { this.enable = enable; } public Integer getHalfOpenBaseAmountPerStep() { return this.halfOpenBaseAmountPerStep; } public void setHalfOpenBaseAmountPerStep(Integer halfOpenBaseAmountPerStep) { this.halfOpenBaseAmountPerStep = halfOpenBaseAmountPerStep; } public Integer getHalfOpenRecoveryStepNum() { return this.halfOpenRecoveryStepNum; } public void setHalfOpenRecoveryStepNum(Integer halfOpenRecoveryStepNum) { this.halfOpenRecoveryStepNum = halfOpenRecoveryStepNum; } public Integer getMinRequestAmount() { return this.minRequestAmount; } public void setMinRequestAmount(Integer minRequestAmount) { this.minRequestAmount = minRequestAmount; } public String getNamespace() { return this.namespace; } public void setNamespace(String namespace) { this.namespace = namespace; } public Integer getRecoveryTimeoutMs() { return this.recoveryTimeoutMs; } public void setRecoveryTimeoutMs(Integer recoveryTimeoutMs) { this.recoveryTimeoutMs = recoveryTimeoutMs; } public String getResource() { return this.resource; } public void setResource(String resource) { this.resource = resource; } public Long getRuleId() { return this.ruleId; } public void setRuleId(Long ruleId) { this.ruleId = ruleId; } public Integer getSlowRtMs() { return this.slowRtMs; } public void setSlowRtMs(Integer slowRtMs) { this.slowRtMs = slowRtMs; } public Integer getStatDurationMs() { return this.statDurationMs; } public void setStatDurationMs(Integer statDurationMs) { this.statDurationMs = statDurationMs; } public Integer getStrategy() { return this.strategy; } public void setStrategy(Integer strategy) { this.strategy = strategy; } public Float getThreshold() { return this.threshold; } public void setThreshold(Float threshold) { this.threshold = threshold; } } @Override public CreateDegradeRuleResponse getInstance(UnmarshallerContext context) { return CreateDegradeRuleResponseUnmarshaller.unmarshall(this, context); } @Override public boolean checkShowJsonItemName() { return false; } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
046d8f0868dcb40a36fc85fbcb827e038b327027
5791036ba6b4423d7d190da565cb8d1f9c6e98c2
/src/main/java/com/casic/simulation/dma/model/json/DMASaleWaterJSON.java
93137e583065cf9d70be9a3c825fae11cb122644
[]
no_license
predatorZhang/simulation
1792f3c7686b01649cf6abb5e4de59ec8752937f
1c0ec58f0507dc433736ebab4eab5e6f4ffafa17
refs/heads/master
2021-06-19T06:10:49.156013
2017-07-16T06:58:06
2017-07-16T06:58:06
97,366,136
0
0
null
null
null
null
UTF-8
Java
false
false
1,874
java
package com.casic.simulation.dma.model.json; import com.casic.simulation.dma.model.domain.DMASaleWater; import java.text.SimpleDateFormat; public class DMASaleWaterJSON { private Long id; //ID private String startDate; //起始时间 private String endDate; //结束时间 private Double saleWater; //售水量 private Double noValueWater; //无收益水量 private Long dmaId; private String dmaName; private SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); public DMASaleWaterJSON(DMASaleWater dmaSaleWater) { this.id = dmaSaleWater.getId(); this.startDate = dateFormat.format(dmaSaleWater.getStartDate()); this.endDate = dateFormat.format(dmaSaleWater.getEndDate()); this.saleWater = dmaSaleWater.getSaleWater(); this.noValueWater = dmaSaleWater.getNoValueWater(); if(null != dmaSaleWater.getDmaInfo()) { this.dmaId = dmaSaleWater.getDmaInfo().getID(); this.dmaName = dmaSaleWater.getDmaInfo().getName(); } } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getStartDate() { return startDate; } public void setStartDate(String startDate) { this.startDate = startDate; } public String getEndDate() { return endDate; } public void setEndDate(String endDate) { this.endDate = endDate; } public Double getSaleWater() { return saleWater; } public void setSaleWater(Double saleWater) { this.saleWater = saleWater; } public Double getNoValueWater() { return noValueWater; } public void setNoValueWater(Double noValueWater) { this.noValueWater = noValueWater; } public Long getDmaId() { return dmaId; } public void setDmaId(Long dmaId) { this.dmaId = dmaId; } public String getDmaName() { return dmaName; } public void setDmaName(String dmaName) { this.dmaName = dmaName; } }
[ "zhangfan1212@126.com" ]
zhangfan1212@126.com
22d9abcf9d2160832d612dac16924a3b72025d33
8313257b171087f49f95574155aa392b87eebe29
/src/main/java/violence/Solution17.java
d95483f9c6b4f02abb4013b8cb8ac7b8c02c87bb
[]
no_license
Jessie0914/leetcode
d4c26e729aa0bc8a3a86c1121fe7d9d48c9f2287
1c521a7313a170b69a39f2591094fcf88e8be05b
refs/heads/master
2021-07-09T13:56:09.692750
2020-08-04T17:08:57
2020-08-04T17:08:57
194,860,763
0
0
null
null
null
null
UTF-8
Java
false
false
1,223
java
package violence; /** * @ClassName Solution17 * @Description 17.电话号码的字母组合 * @Author shishi * @Date 2019/7/18 19:51 **/ import java.util.ArrayList; import java.util.List; /** * 题目要求: * 给定一个仅包含数字 2-9 的字符串,返回所有它能表示的字母组合。 * 给出数字到字母的映射如下(与电话按键相同)。注意 1 不对应任何字母。 * * 示例: * 输入:"23" * 输出:["ad", "ae", "af", "bd", "be", "bf", "cd", "ce", "cf"]. */ public class Solution17 { // 递归方法 String[] keyboard = new String[]{" ", "","abc","def","ghi","jkl","mno","pqrs","tuv","wxyz"}; public List<String> letterCombinations(String digits) { List<String> result = new ArrayList<>(); if (digits.length()==0) return result; dfs(result,digits,0,""); return result; } private void dfs(List<String> result, String digits, int cur, String path) { if (cur==digits.length()){ result.add(path); return; } String str = keyboard[digits.charAt(cur) - '0']; for (char c : str.toCharArray()){ dfs(result,digits,cur+1,path+c); } } }
[ "894673968@qq.com" ]
894673968@qq.com
0069ac84588c4907a3ab2f36c93159c79fb72cff
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/6/6_a143767f70a2b1e962c94657509fc11a2c6f76af/Input/6_a143767f70a2b1e962c94657509fc11a2c6f76af_Input_t.java
8108c7eb51f59282fd91f06a3c9c7b7f9cdf68fb
[]
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
7,977
java
package net.fourbytes.shadow; import com.badlogic.gdx.Input.Keys; import com.badlogic.gdx.graphics.OrthographicCamera; import com.badlogic.gdx.math.Rectangle; import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.ObjectIntMap; import com.badlogic.gdx.utils.ObjectMap; import net.fourbytes.shadow.entities.Cursor; public class Input { public static class TouchPoint { public static enum TouchMode { KeyInput, Cursor; } public TouchMode touchmode; public int id = -1; public int button = -1; public Vector2 pos = new Vector2(-1f, -1f); public TouchPoint(int x, int y, int id, int button, TouchMode touchmode) { this.id = id; this.button = button; this.pos.set(x, y); this.touchmode = touchmode; if (touchmode == TouchMode.Cursor && Shadow.level != null && Shadow.level.player != null && Input.isAndroid && !Input.isOuya) { this.button = -1; //Special button id for Android Shadow.level.fillLayer(0); Cursor c = new Cursor(new Vector2(0f, 0f), Shadow.level.layers.get(0), id); c.pos.set(c.calcPos(pos)); Shadow.level.cursors.add(c); } } } public static interface KeyListener { public void keyDown(Key key); public void keyUp(Key key); } static OrthographicCamera cam; public static boolean isAndroid = false; public static boolean isOuya = false; public static boolean isInMenu = false; public static class Key { public static final class Triggerer { public static final int KEYBOARD = 0; public static final int SCREEN = 0;//Screen simulates keyboard presses and as for now shares same ID. public static final int CONTROLLER_BUTTON = 1; public static final int CONTROLLER_AXIS = 2; } public String name; public int[] keyid; Rectangle drawrec; Rectangle origrec; Rectangle rec; int pointer = -1; int triggerer = 0; public boolean wasDown = false; public boolean isDown = false; public boolean nextState = false; public Key(String name, int[] keyid) { this.name = name; this.keyid = keyid; this.origrec = new Rectangle(-1f, -1f, 1f, 1f); this.rec = new Rectangle(-1f, -1f, 1f, 1f); this.drawrec = new Rectangle(-1f, -1f, 1f, 1f); all.add(this); } public void down() { //System.out.println("N: "+name+"; M: D; X: "+rec.x+"; Y:"+rec.y+"; W: "+rec.width+"; H: "+rec.height); tmpkeylisteners.clear(); tmpkeylisteners.addAll(keylisteners); for (KeyListener l : tmpkeylisteners) { if (l instanceof Level && ((Level)l) != Shadow.level) { continue; } if (l instanceof GameObject && ((GameObject)l).layer.level != Shadow.level) { continue; } l.keyDown(this); } } public void up() { //System.out.println("N: "+name+"; M: U; X: "+rec.x+"; Y:"+rec.y+"; W: "+rec.width+"; H: "+rec.height); tmpkeylisteners.clear(); tmpkeylisteners.addAll(keylisteners); for (KeyListener l : tmpkeylisteners) { if (l instanceof Level && ((Level)l) != Shadow.level) { continue; } if (l instanceof GameObject && ((GameObject)l).layer.level != Shadow.level) { continue; } l.keyUp(this); } } public void tick() { wasDown = isDown; isDown = nextState; rec.width = Shadow.dispw/Shadow.touchw; rec.x = origrec.x*Shadow.dispw/Shadow.touchw; rec.height = Shadow.disph/Shadow.touchh; rec.y = origrec.y*Shadow.disph/Shadow.touchh; if (wasPressed()) up(); if (wasReleased()) down(); } public void render() { if (isDown) { Shadow.spriteBatch.setColor(1f, 0.5f, 0.5f, 0.575f); } else { Shadow.spriteBatch.setColor(1f, 1f, 1f, 0.575f); } Shadow.spriteBatch.draw(Images.getTextureRegion("white"), drawrec.x, drawrec.y, 1f, 1f); } public boolean wasPressed() { return wasDown && !isDown; } public boolean wasReleased() { return !wasDown && isDown; } public void setRect(float x, float y, float width, float height, boolean draw) { origrec.set(x, y, width, height); if (draw) { drawrec.set(x, y, width, height); } } } public static Array<Key> all = new Array<Key>(); public static Key up = new Key("Up", new int[] {Keys.UP, Keys.W}); public static Key jump = new Key("Jump", new int[] {Keys.UP, Keys.W}); public static Key down = new Key("Down", new int[] {Keys.DOWN, Keys.S}); public static Key left = new Key("Left", new int[] {Keys.LEFT, Keys.A}); public static Key right = new Key("Right", new int[] {Keys.RIGHT, Keys.D}); public static Key pause = new Key("Pause", new int[] {Keys.ESCAPE}); public static Key enter = new Key("Confirm", new int[] {Keys.ENTER}); public static Key screenshot = new Key("Screenshot", new int[] {Keys.F12}); public static Key record = new Key("Record", new int[] {Keys.F11}); public static Key androidBack = new Key("Back", new int[] {Keys.BACK}); public static Key androidMenu = new Key("Menu", new int[] {Keys.MENU}); public static ObjectMap<Integer, TouchPoint> touches = new ObjectMap<Integer, TouchPoint>(); public static Array<KeyListener> keylisteners = new Array<KeyListener>(); static Array<KeyListener> tmpkeylisteners = new Array<KeyListener>(); public static void setUp() { for (Key k : all) { if (k.rec.x < 0) { k.rec.x = -k.rec.x; } if (k.rec.y < 0) { k.rec.y = -k.rec.y; } } resize(); } public static void resize() { if (cam == null) { cam = new OrthographicCamera(Shadow.touchw, -Shadow.touchh); } else { cam.viewportWidth = Shadow.touchw; cam.viewportHeight = -Shadow.touchh; } cam.position.set(Shadow.touchw/2, Shadow.touchh/2, 0); cam.update(); jump.setRect(Shadow.touchw-2, Shadow.touchh-3, 1, 1, true); up.setRect(Shadow.touchw-2, Shadow.touchh-3, 1, 1, false); down.setRect(Shadow.touchw-2, Shadow.touchh-2, 1, 1, true); left.setRect(1, Shadow.touchh-2, 1, 1, true); right.setRect(3, Shadow.touchh-2, 1, 1, true); } public static void tick() { for (Key k :all) { k.tick(); } tmpkeylisteners.clear(); tmpkeylisteners.addAll(keylisteners); for (KeyListener kl : tmpkeylisteners) { if (kl == null) { keylisteners.removeValue(kl, true); continue; } check(kl); } } public static ObjectIntMap<KeyListener> timemap = new ObjectIntMap<KeyListener>(); public static void check(KeyListener kl) { if (kl instanceof Level) { Level l = (Level) kl; Level sl = Shadow.level; if (!(sl instanceof MenuLevel)) { if (l instanceof MenuLevel) { MenuLevel ml = (MenuLevel) l; if (ml != sl) { remove(kl); } } else { if (sl instanceof MenuLevel) { MenuLevel ml = (MenuLevel) sl; if (l != ml.bglevel) { remove(kl); } } else { remove(kl); } } } } if (kl instanceof GameObject) { GameObject go = (GameObject) kl; Level clevel = Shadow.level; if (clevel instanceof MenuLevel) { clevel = ((MenuLevel)clevel).bglevel; } if (go instanceof Entity) { Entity e = (Entity) go; if (e.layer == null || !e.layer.entities.contains(e, true) || clevel != e.layer.level) { remove(kl); } } if (go instanceof Block) { Block b = (Block) go; if (b.layer == null || !b.layer.blocks.contains(b, true) || clevel != b.layer.level) { remove(kl); } } } } private static void remove(KeyListener kl) { if (!timemap.containsKey(kl)) { timemap.put(kl, 0); } else if (timemap.get(kl, 0) >= 4) { keylisteners.removeValue(kl, true); } else { timemap.put(kl, timemap.get(kl, 0)+1); } } public static void render() { if (isAndroid && !isOuya && !isInMenu) { for (Key k : all) { k.render(); } } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
8c48698b7784bb47cd31eaf9d633fb6bdd3200c5
494fda72d0312ea2fd9e12f7910d5fb910bf70e0
/ex2/FileServer.java
b3fe072282087e5bdcff03ce6ef36b7f01daec75
[]
no_license
raduy/distributed-systems-sockets
0cd5d41aabe9f06330ecb757a81823d05b1d9785
af8c4bda8b9f3d5842d2d46b5c2054e6d4f59bfa
refs/heads/master
2020-05-17T05:58:28.448395
2015-04-21T13:41:56
2015-04-21T13:41:56
32,654,182
0
0
null
null
null
null
UTF-8
Java
false
false
4,102
java
import java.io.*; import java.net.ServerSocket; import java.net.Socket; import java.nio.file.Path; import java.nio.file.Paths; /** * @author Lukasz Raduj <raduj.lukasz@gmail.com> */ public class FileServer { private static final int DEFAULT_PORT = 4444; private static final int CHUNK_SIZE = 1024; private static final String FILE_NAME = "names.txt"; private static final String PATH_TO_FILE = "./cloud"; public static void main(String[] args) throws IOException { int portNumber; if (args.length == 1) { portNumber = readPortNumberFromCmd(args); } else { portNumber = DEFAULT_PORT; } startListening(portNumber); } private static void startListening(int portNumber) { try (ServerSocket serverSocket = new ServerSocket(portNumber)) { println("Server listening on port # %d", portNumber); while (!Thread.interrupted()) { listenForClient(serverSocket); } } catch (IOException e) { println("Exception caught when trying to listen on port " + portNumber + " or listening for a connection"); println(e.getMessage()); } } private static int readPortNumberFromCmd(String[] args) { try { return Integer.parseInt(args[0]); } catch (NumberFormatException e) { println("Invalid port number! Starting on default port..."); return DEFAULT_PORT; } } private static void listenForClient(ServerSocket serverSocket) { try (Socket clientSocket = serverSocket.accept(); OutputStream outputStream = clientSocket.getOutputStream(); DataOutputStream dataOutputStream = new DataOutputStream(outputStream)) { println("Client connected on socket! %s", clientSocket); File file = openFile(); long length = file.length(); String fileName = file.getName(); println("Sending %s file...", fileName); println("Sending fileName size which is %d bytes", fileName.length()); sendFileNameLength(dataOutputStream, fileName); println("Sending fileName which is %s", fileName); sendFileName(outputStream, fileName); println("Sending file length in bytes. It is: %d", length); sendFileLength(dataOutputStream, (int) length); println("Sending file content..."); sendFileContent(outputStream, file); } catch (Exception e) { println("Exception on connection with client. Cause: %s", e); } println("Waiting for another request..."); } private static void sendFileContent(OutputStream outputStream, File file) throws IOException { int sentBytes = 0; try (FileInputStream fileInputStream = new FileInputStream(file)) { byte[] buffer = new byte[CHUNK_SIZE]; long length = file.length(); int offset = 0; while (sentBytes < length) { int read_from_file = fileInputStream.read(buffer); outputStream.write(buffer, offset, read_from_file); sentBytes += read_from_file; } } } private static void sendFileLength(DataOutputStream out, int length) throws IOException { out.writeInt(length); } private static void sendFileName(OutputStream outputStream, String fileName) throws IOException { outputStream.write(fileName.getBytes()); } private static void sendFileNameLength(DataOutputStream out, String fileName) throws IOException { int fileNameLength = fileName.getBytes().length; out.writeInt(fileNameLength); } private static File openFile() { Path path = Paths.get(PATH_TO_FILE, FILE_NAME); return path.toFile(); } private static void println(String toPrint, Object... args) { // Replace with logger if needed System.out.println(String.format(toPrint, args)); } }
[ "raduj.lukasz@gmail.com" ]
raduj.lukasz@gmail.com
47575f58023ea32101921210fdcbfeff9ba8ff2f
a63d261c59ac4e66e20313a8837f22fac3cd0855
/src/cn/edu/xmu/servlet/Sec_ExportAlumnusAndSocialCoopServlet.java
c16aac569e2fb923f87e926f0304dd387eab8673
[]
no_license
Guosmilesmile/iqa
9a7d54a3192b0e4634b9a0f268c106b9cbf1f07d
db7935120911396818146eeadb1ac4da095e0ffb
refs/heads/master
2021-01-20T17:46:31.076475
2016-08-21T08:46:25
2016-08-21T08:46:25
65,795,465
0
0
null
null
null
null
UTF-8
Java
false
false
5,227
java
package cn.edu.xmu.servlet; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.net.URLDecoder; import java.net.URLEncoder; import java.sql.Date; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import cn.edu.xmu.dao.AlumnusAndSocialCoopDao; import cn.edu.xmu.dao.TableListDao; import cn.edu.xmu.daoimpl.AlumnusAndSocialCoopDaoImpl; import cn.edu.xmu.daoimpl.TableListDaoImpl; import cn.edu.xmu.entity.AlumnusAndSocialCoop; import cn.edu.xmu.table.AlumnusAndSocialCoppTable; import cn.edu.xmu.table.StuPhysicalHealthInfoTable; import net.sf.excelutils.ExcelException; import net.sf.excelutils.ExcelUtils; @WebServlet("/Sec_ExportAlumnusAndSocialCoopServlet") public class Sec_ExportAlumnusAndSocialCoopServlet extends HttpServlet{ private static final long serialVersionUID = 1L; /** * @see HttpServlet#HttpServlet() */ public Sec_ExportAlumnusAndSocialCoopServlet() { super(); // TODO Auto-generated constructor stub } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse * response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doPost(request, response); } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse * response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8"); String tableid = request.getParameter("tableid"); System.out.println("tableid===========" + tableid); // 根据tableid得到tablename TableListDao tableListDao = new TableListDaoImpl(); String tablename = tableListDao.getTablename(tableid); String college = request.getParameter("college"); college = URLDecoder.decode(college, "UTF-8"); Date deadLine = tableListDao.getTableDate(tableid); Map queryParams = new HashMap(); if (deadLine != null) queryParams.put(AlumnusAndSocialCoppTable.AS_DEADLINE, deadLine); if (college != null && !"".equals(college)) { if (college.contains("学院")) {// 具体的学院才过滤 queryParams.put(AlumnusAndSocialCoppTable.AS_COLLEGE, college); } } if (tablename.endsWith("表1-7校友会与社会合作(时点)")) { AlumnusAndSocialCoopDao dao = new AlumnusAndSocialCoopDaoImpl(); List<AlumnusAndSocialCoop> asList = dao.getAlumnusAndSocialCoop(0, dao.getAlumnusAndSocialCoopCount(queryParams), AlumnusAndSocialCoppTable.AS_ID, "asc", queryParams, null); /*-------------- 1.准备数据--------s------*/ List<Object> tsResultList = new ArrayList<Object>(); for (int i = 0; i < asList.size(); i++) { List<Object> asCountList = new ArrayList<Object>();// 行数据 asCountList.add(asList.get(i).getAs_alumnusamount()); asCountList.add(asList.get(i).getAs_domesticalumnus()); asCountList.add(asList.get(i).getAs_overseaalumnus()); asCountList.add(asList.get(i).getAs_agencyamount()); asCountList.add(asList.get(i).getAs_academic()); asCountList.add(asList.get(i).getAs_industry()); asCountList.add(asList.get(i).getAs_government()); tsResultList.add(asCountList); } ExcelUtils.addValue("typename", tablename);//typename是用在表格模板里面的表名 ExcelUtils.addValue("resultList", tsResultList);//resultList是用在表格模板里面用于显示数据的 /*-------------- 2.写出excel文件--------------*/ String dirs = request.getSession().getServletContext() .getRealPath("") + "/template/"; String templateFileName = tablename;// 模版名称(不含扩展名),用于导出的模板 String templateFilePath = dirs + templateFileName + ".xls";//导出的模板路径 String destFilePath = dirs + templateFileName + "-out.xls";//导出的文件路径 try { System.out.println("templateFilePath=" + templateFilePath); OutputStream out = new FileOutputStream(destFilePath); ExcelUtils.export(templateFilePath, out); response.setContentType("application/x-download"); System.out.println("destFilePath=" + destFilePath); String filenamedisplay = tablename + "-out.xls"; filenamedisplay = URLEncoder.encode(filenamedisplay, "UTF-8"); response.addHeader("Content-Disposition", "attachment;filename=" + filenamedisplay); } catch (ExcelException e) { e.printStackTrace(); } catch (FileNotFoundException e) { e.printStackTrace(); } try { java.io.OutputStream os = response.getOutputStream(); java.io.FileInputStream fis = new java.io.FileInputStream( destFilePath); byte[] b = new byte[1024]; int i = 0; while ((i = fis.read(b)) > 0) { os.write(b, 0, i); } fis.close(); os.flush(); os.close(); } catch (Exception e) { System.out.println("error"); } } } }
[ "511955993@qq.com" ]
511955993@qq.com
61c4094185df9e77cbf93cb851a739949a2f6de8
bc4bf31960167b630e9db596da58bb3680e084d5
/core/src/main/java/com/yinhetianze/core/cachedata/StaticCacheData.java
0bbf5b302af54731207683a0711be0ff5b1d9c2c
[]
no_license
sanguolingzi/yhtz
282c2dcf83fb474ac6d706d39948020dfec4d25d
77db7d77a2642a118db3876483b7f3e8802f3dd7
refs/heads/master
2020-04-04T01:16:26.504285
2018-11-01T08:11:15
2018-11-01T08:11:15
155,675,438
0
0
null
null
null
null
UTF-8
Java
false
false
1,741
java
package com.yinhetianze.core.cachedata; import com.yinhetianze.core.utils.CommonUtil; import com.yinhetianze.core.utils.LoggerUtil; import java.util.HashMap; import java.util.Map; /** * 静态缓存数据 * 从内存中获取相应的缓存数据 * 内存中的数据保存在java.util.Map中 * 固定化获取静态缓存的方法 */ public abstract class StaticCacheData<T> extends AbstractCacheData<T> { /** * 静态缓存数据存储对象 */ private static Map<String, Object> cacheData = new HashMap<>(); @Override public final void handleData(Object data) { if (CommonUtil.isNotEmpty(data)) { cacheData.put(getCacheName(), data); } } @Override public final T getCacheData() { // 缓存名称 String cacheName = getCacheName(); // 根据缓存名称获取缓存数据 Object data = cacheData.get(cacheName); // 如果缓存数据存在,则返回,否则从数据源获取数据再存放到缓存中 if (CommonUtil.isNotEmpty(data)) { // 返回缓存数据 return (T) data; } else { try { // 从数据源获取缓存数据 data = cacheData(); if (CommonUtil.isNotEmpty(data)) { // 将数据保存到缓存中然后返回 handleData(data); return (T) data; } } catch (Exception e) { LoggerUtil.error(StaticCacheData.class, e); } } // 没有缓存数据返回空 return null; } }
[ "191048141@qq.com" ]
191048141@qq.com
f17fd8c6b176041d7e963cbc55f23de965505f29
8d197355f1a46ea5b9033c39f39bddea0def8914
/library/src/main/java/com/download/library/Executors.java
2ee550c7ce4ef532d3b64ef42b543bea425ee94e
[ "Apache-2.0" ]
permissive
Borninthesun/Downloader
9ba1c6061e872dda3e5d0120b59bbb81bb60dec0
8d50c981bd10685700d2d2784f61feb70437ca6c
refs/heads/master
2022-11-14T11:31:30.090926
2020-07-09T03:40:24
2020-07-09T03:40:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,967
java
package com.download.library; import android.os.AsyncTask; import android.support.annotation.NonNull; import java.util.concurrent.Executor; import java.util.concurrent.ExecutorService; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ThreadFactory; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; /** * @author xiaozhongcen * @date 20-7-9 * @since 1.0.0 */ public final class Executors { private volatile static Executor IO = AsyncTask.THREAD_POOL_EXECUTOR; private volatile static Executor TASK_ENQUEUE_DISPATCH; private volatile static Executor TASK_QUEUEDUP_DISPATCH; private static final String TAG = Executors.class.getSimpleName(); protected static final Executor SERIAL_EXECUTOR = new SerialExecutor(); public static Executor io() { if (IO != null) { return IO; } synchronized (Executors.class) { if (IO == null) { ThreadPoolExecutor service = new ThreadPoolExecutor(3, 3, 30L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(), new ThreadFactory() { @Override public Thread newThread(@NonNull Runnable r) { return new Thread(r); } }); service.allowCoreThreadTimeOut(true); IO = service; } } return IO; } public static Executor getSerialExecutor() { return SERIAL_EXECUTOR; } public static Executor taskEnqueueDispatchExecutor() { if (TASK_ENQUEUE_DISPATCH != null) { return TASK_ENQUEUE_DISPATCH; } synchronized (Executors.class) { if (TASK_ENQUEUE_DISPATCH == null) { ThreadPoolExecutor service = new ThreadPoolExecutor(1, 1, 30L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(), new ThreadFactory() { @Override public Thread newThread(@NonNull Runnable r) { return new Thread(r); } }); service.allowCoreThreadTimeOut(true); TASK_ENQUEUE_DISPATCH = service; } } return TASK_ENQUEUE_DISPATCH; } public static Executor taskQueuedUpDispatchExecutor() { if (TASK_QUEUEDUP_DISPATCH != null) { return TASK_QUEUEDUP_DISPATCH; } synchronized (Executors.class) { if (TASK_QUEUEDUP_DISPATCH == null) { ThreadPoolExecutor service = new ThreadPoolExecutor(1, 1, 30L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(), new ThreadFactory() { @Override public Thread newThread(@NonNull Runnable r) { return new Thread(r); } }); service.allowCoreThreadTimeOut(true); TASK_QUEUEDUP_DISPATCH = service; } } return TASK_QUEUEDUP_DISPATCH; } public static void setTaskEnqueueDispatchExecutor(Executor executor) { if (executor == null) { Runtime.getInstance().logError(TAG, "executor is null"); return; } synchronized (Executors.class) { Executor taskEnqueueDispatch = TASK_ENQUEUE_DISPATCH; try { TASK_ENQUEUE_DISPATCH = executor; } finally { if (null != taskEnqueueDispatch) { if (taskEnqueueDispatch instanceof ExecutorService) { ((ExecutorService) taskEnqueueDispatch).shutdown(); } } } } } public static void setTaskQueuedupDispatchExecutor(Executor executor) { if (executor == null) { Runtime.getInstance().logError(TAG, "executor is null"); return; } synchronized (Executors.class) { Executor queuedupDispatch = TASK_QUEUEDUP_DISPATCH; try { TASK_QUEUEDUP_DISPATCH = executor; } finally { if (null != queuedupDispatch) { if (queuedupDispatch instanceof ExecutorService) { ((ExecutorService) queuedupDispatch).shutdown(); } } } } } public static void setIO(Executor executor) { if (executor == null) { Runtime.getInstance().logError(TAG, "executor is null"); return; } synchronized (Executors.class) { Executor io = IO; try { IO = executor; } finally { if (null != io) { if (io instanceof ExecutorService) { ((ExecutorService) io).shutdown(); } } } } } }
[ "xiaozhongcen@gmail.com" ]
xiaozhongcen@gmail.com
88695db3876a426d8f458f596871d14e485fdff3
8816bd99163d4adc357e76664a64be036b9be1c1
/AL-Game7/data/scripts/system/handlers/quest/narakkalli/_16003InstanceGroupUnsubmittedLetter.java
dff91abe3f3944963af6add34f1512847617a73e
[]
no_license
w4terbomb/SPP-AionGermany
274b250b7b7b73cdd70485aef84b3900c205a928
a77b4ef188c69f2bc3b850e021545f9ad77e66f3
refs/heads/master
2022-11-25T23:31:21.049612
2019-09-23T13:45:58
2019-09-23T13:45:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,841
java
/** * This file is part of Aion-Lightning <aion-lightning.org>. * * Aion-Lightning is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Aion-Lightning is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Aion-Lightning. * If not, see <http://www.gnu.org/licenses/>. */ package quest.narakkalli; import com.aionemu.gameserver.model.DialogAction; import com.aionemu.gameserver.model.gameobjects.player.Player; import com.aionemu.gameserver.questEngine.handlers.QuestHandler; import com.aionemu.gameserver.questEngine.model.QuestEnv; import com.aionemu.gameserver.questEngine.model.QuestState; import com.aionemu.gameserver.questEngine.model.QuestStatus; /** * @author QuestGenerator by Mariella */ public class _16003InstanceGroupUnsubmittedLetter extends QuestHandler { private final static int questId = 16003; public _16003InstanceGroupUnsubmittedLetter() { super(questId); } @Override public void register() { qe.registerQuestNpc(806582).addOnQuestStart(questId); // Bastiel qe.registerQuestNpc(806582).addOnTalkEvent(questId); // Bastiel qe.registerQuestItem(182216524, questId); // Ovel's Message } @Override public boolean onLvlUpEvent(QuestEnv env) { return defaultOnLvlUpEvent(env, 1000, true); } @Override public boolean onDialogEvent(QuestEnv env) { Player player = env.getPlayer(); QuestState qs = player.getQuestStateList().getQuestState(questId); DialogAction dialog = env.getDialog(); int targetId = env.getTargetId(); if (qs == null || qs.getStatus() == QuestStatus.NONE ) { if (targetId == 806582) { switch (dialog) { case QUEST_SELECT: { return sendQuestDialog(env, 4762); } case QUEST_ACCEPT_1: case QUEST_ACCEPT_SIMPLE: { return sendQuestStartDialog(env); } case QUEST_REFUSE_SIMPLE: { return closeDialogWindow(env); } default: break; } } } else if (qs.getStatus() == QuestStatus.START) { switch (targetId) { case 806582: { switch (dialog) { case QUEST_SELECT: { return sendQuestDialog(env, 1011); } case CHECK_USER_HAS_QUEST_ITEM: { return checkQuestItems(env, 0, 0, true, 5, 2716); } case FINISH_DIALOG: { return sendQuestSelectionDialog(env); } default: break; } break; } default: break; } } return false; } }
[ "conan_513@hotmail.com" ]
conan_513@hotmail.com
6f8ede905f9ac0dea359e894dc210bf19adcefc5
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/28/28_5907708df66bf3dad41358e6b144937f57a9c9c2/TestApp/28_5907708df66bf3dad41358e6b144937f57a9c9c2_TestApp_t.java
63f820d46ca9123b465acd4209ae18e50401595e
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
2,419
java
package cz.vity.freerapid.plugins.services.rutube; import cz.vity.freerapid.plugins.dev.PluginDevApplication; import cz.vity.freerapid.plugins.webclient.ConnectionSettings; import cz.vity.freerapid.plugins.webclient.interfaces.HttpFile; import org.jdesktop.application.Application; import java.net.URL; /** * @author ntoskrnl */ public class TestApp extends PluginDevApplication { @Override protected void startup() { final HttpFile httpFile = getHttpFile(); //creates new test instance of HttpFile try { //InputStream is = new BufferedInputStream(new FileInputStream("E:\\Stuff\\logtest.properties")); //LogManager.getLogManager().readConfiguration(is); //we set file URL httpFile.setNewURL(new URL("http://rutube.ru/video/b8dfb3ce7cb2f608a2dabefceaa710db/")); //the way we connect to the internet final ConnectionSettings connectionSettings = new ConnectionSettings();// creates default connection //connectionSettings.setProxy("localhost", 8081); //eg we can use local proxy to sniff HTTP communication //then we tries to download final RuTubeServiceImpl service = new RuTubeServiceImpl(); //instance of service - of our plugin //runcheck makes the validation //new Packet().decode(IoBuffer.wrap(Hex.decodeHex("080000000000911401000000020004706c61790040100000000000000502006b6d70343a766f6c32312f6d6f766965732f30632f61642f30636164363365663365616236633964643738383335663530383134636231632e6d70343f653d3133323934393435313826733d613063323964346635343061343262376434353065366439313136373338666100000000000000000000c000000000000000".toCharArray())), new RtmpSession()); testRun(service, httpFile, connectionSettings);//download file with service and its Runner //all output goes to the console } catch (Exception e) {//catch possible exception e.printStackTrace(); //writes error output - stack trace to console } } /** * Main start method for running this application * Called from IDE * * @param args arguments for application */ public static void main(String[] args) { Application.launch(TestApp.class, args);//starts the application - calls startup() internally } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
27c646b41c86db5dc9b7d98abca32de2afb7bb74
5848a860a7532544b907575b59f03741477b3fe1
/src/main/java/com/work/ns/config/DefaultProfileUtil.java
8eb62d28b3815e87241cd2064c8c7cd0b910ba02
[]
no_license
godbolerr/numberjhipster
175f6b48750c44b78ac1c9ce47bebdc1fc37cb28
d7bfbf5957fcd37c7a01b74834c83e0a5369d2fa
refs/heads/master
2020-05-23T10:22:52.352563
2017-01-30T15:06:32
2017-01-30T15:06:32
80,430,181
0
0
null
null
null
null
UTF-8
Java
false
false
1,578
java
package com.work.ns.config; import org.springframework.boot.SpringApplication; import org.springframework.core.env.Environment; import java.util.*; /** * Utility class to load a Spring profile to be used as default * when there is no <code>spring.profiles.active</code> set in the environment or as command line argument. * If the value is not available in <code>application.yml</code> then <code>dev</code> profile will be used as default. */ public final class DefaultProfileUtil { private static final String SPRING_PROFILE_DEFAULT = "spring.profiles.default"; private DefaultProfileUtil() { } /** * Set a default to use when no profile is configured. * * @param app the Spring application */ public static void addDefaultProfile(SpringApplication app) { Map<String, Object> defProperties = new HashMap<>(); /* * The default profile to use when no other profiles are defined * This cannot be set in the <code>application.yml</code> file. * See https://github.com/spring-projects/spring-boot/issues/1219 */ defProperties.put(SPRING_PROFILE_DEFAULT, Constants.SPRING_PROFILE_DEVELOPMENT); app.setDefaultProperties(defProperties); } /** * Get the profiles that are applied else get default profiles. */ public static String[] getActiveProfiles(Environment env) { String[] profiles = env.getActiveProfiles(); if (profiles.length == 0) { return env.getDefaultProfiles(); } return profiles; } }
[ "admin@test.com" ]
admin@test.com
3305222df01af06d0dffd76205c52c28cea01689
9208ba403c8902b1374444a895ef2438a029ed5c
/sources/com/google/android/gms/internal/measurement/zzdp.java
44d3df8b7d7ca049dc1ead523143236567cbf7d0
[]
no_license
MewX/kantv-decompiled-v3.1.2
3e68b7046cebd8810e4f852601b1ee6a60d050a8
d70dfaedf66cdde267d99ad22d0089505a355aa1
refs/heads/main
2023-02-27T05:32:32.517948
2021-02-02T13:38:05
2021-02-02T13:44:31
335,299,807
0
0
null
null
null
null
UTF-8
Java
false
false
3,449
java
package com.google.android.gms.internal.measurement; import com.avos.avoscloud.java_websocket.drafts.Draft_75; import java.io.IOException; import java.io.Serializable; import java.nio.charset.Charset; import java.util.Comparator; import java.util.Iterator; public abstract class zzdp implements Serializable, Iterable<Byte> { public static final zzdp zzadh = new zzdz(zzez.zzair); private static final zzdv zzadi = (zzdi.zzrv() ? new zzdy(null) : new zzdt(null)); private static final Comparator<zzdp> zzadk = new zzdr(); private int zzadj = 0; zzdp() { } /* access modifiers changed from: private */ public static int zza(byte b) { return b & Draft_75.END_OF_FRAME; } public abstract boolean equals(Object obj); public abstract int size(); /* access modifiers changed from: protected */ public abstract int zza(int i, int i2, int i3); public abstract zzdp zza(int i, int i2); /* access modifiers changed from: protected */ public abstract String zza(Charset charset); /* access modifiers changed from: 0000 */ public abstract void zza(zzdm zzdm) throws IOException; public abstract byte zzaq(int i); /* access modifiers changed from: 0000 */ public abstract byte zzar(int i); public abstract boolean zzsb(); public static zzdp zzb(byte[] bArr, int i, int i2) { zzb(i, i + i2, bArr.length); return new zzdz(zzadi.zzc(bArr, i, i2)); } static zzdp zze(byte[] bArr) { return new zzdz(bArr); } public static zzdp zzdq(String str) { return new zzdz(str.getBytes(zzez.UTF_8)); } public final String zzsa() { return size() == 0 ? "" : zza(zzez.UTF_8); } public final int hashCode() { int i = this.zzadj; if (i == 0) { int size = size(); i = zza(size, 0, size); if (i == 0) { i = 1; } this.zzadj = i; } return i; } static zzdx zzas(int i) { return new zzdx(i, null); } /* access modifiers changed from: protected */ public final int zzsc() { return this.zzadj; } static int zzb(int i, int i2, int i3) { int i4 = i2 - i; if ((i | i2 | i4 | (i3 - i2)) >= 0) { return i4; } if (i < 0) { StringBuilder sb = new StringBuilder(32); sb.append("Beginning index: "); sb.append(i); sb.append(" < 0"); throw new IndexOutOfBoundsException(sb.toString()); } else if (i2 < i) { StringBuilder sb2 = new StringBuilder(66); sb2.append("Beginning index larger than ending index: "); sb2.append(i); sb2.append(", "); sb2.append(i2); throw new IndexOutOfBoundsException(sb2.toString()); } else { StringBuilder sb3 = new StringBuilder(37); sb3.append("End index: "); sb3.append(i2); sb3.append(" >= "); sb3.append(i3); throw new IndexOutOfBoundsException(sb3.toString()); } } public final String toString() { return String.format("<ByteString@%s size=%d>", new Object[]{Integer.toHexString(System.identityHashCode(this)), Integer.valueOf(size())}); } public /* synthetic */ Iterator iterator() { return new zzdo(this); } }
[ "xiayuanzhong@gmail.com" ]
xiayuanzhong@gmail.com
111dbd827b0d504a7f964a8c3f11062a3735ac08
e6a977b8c8ac1546aeeaf4e7ffd7f467324a832d
/Report/src/com/hp/ucmdb/report/dao/PRDao.java
2505856f43939c5ab8bbd16948d5f8fc0a37db2a
[]
no_license
shengyao15/performance_project
6c86d6493d2c2d79d3e0d3585f96557a8584b1f6
d3f7a66e9065379452fcda0bb6209a529822393c
refs/heads/master
2021-05-16T03:07:16.637843
2017-11-01T06:35:58
2017-11-01T06:35:58
20,017,606
0
0
null
null
null
null
UTF-8
Java
false
false
6,153
java
/** * Copyright : HP * project : Report * Create by : Steven Zhang(Ling Kai) * Create on : 2011-7-11 */ package com.hp.ucmdb.report.dao; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import org.apache.commons.configuration.ConfigurationException; import org.apache.commons.configuration.PropertiesConfiguration; import org.apache.commons.configuration.reloading.FileChangedReloadingStrategy; import org.apache.commons.dbutils.DbUtils; import com.hp.ucmdb.report.bean.PRDetailBean; import com.hp.ucmdb.report.bean.PRSummaryBean; import com.hp.ucmdb.report.db.DBConnectionManager; import com.hp.ucmdb.report.util.AllConstants; import com.hp.ucmdb.report.util.ReportUtil; import com.hp.ucmdb.report.util.StringConverter; public class PRDao{ private List<Integer> errorFileIdList = new ArrayList<Integer>(); private static final String ORDER_CONDITION = " order by cpdr.recordseqno "; private static final String QUERY_PR_SUMMARY = "select cpdf.fileid, "+ " cpdf.filename, "+ " cpdf.filedatasource, "+ " cpdf.processstartdate, "+ " cpdf.processenddate, "+ " cpdf.recordcount, "+ " cpdf.filestatus, "+ " cpdf.recordsinerror, "+ " cpdf.dscontactemail "+ " from cim_pr_data_files cpdf "+ " where cpdf.processenddate >= sysdate - 1 "; private static final String QUERY_PR_DETAIL = "select cpdr.recordid, "+ " cpdr.fileid, "+ " cpdr.recordseqno, "+ " cpdr.name, "+ " cpdr.extid, "+ " cpdr.org_brand, "+ " cpdr.org_model, "+ " cpdr.pr_brand, "+ " cpdr.pr_model, "+ " cpdr.recordstatus "+ " from cim_pr_data_records cpdr "+ " where cpdr.fileid in "; public ArrayList<PRSummaryBean> getSummary() { ReportUtil.getLogger().info("call PRDao getSummary ... "); ArrayList<PRSummaryBean> prSummaryList = new ArrayList<PRSummaryBean>(); Connection con = null; PreparedStatement ps = null; ResultSet rs = null; try { con = DBConnectionManager.getConnection(); String sql = QUERY_PR_SUMMARY; ReportUtil.getLogger().info("sql = " + sql); ps = con.prepareStatement(sql); rs = ps.executeQuery(); while (rs.next()) { prSummaryList.add(makeSummaryBean(rs)); } } catch (SQLException e) { ReportUtil.getLogger().error(e.toString()); e.printStackTrace(); } finally { DbUtils.closeQuietly(con, ps, rs); } return prSummaryList; } private PRSummaryBean makeSummaryBean(ResultSet rs)throws SQLException{ PRSummaryBean bean = new PRSummaryBean(); bean.setFileId(rs.getInt("fileId")); bean.setFileName(StringConverter.Convert(rs.getString("filename"))); bean.setFileDataSource(StringConverter.Convert(rs.getString("filedatasource"))); bean.setProcessStartDate(rs.getTimestamp("processstartdate")); bean.setProcessEndDate(rs.getTimestamp("processenddate")); Integer recordCount = (rs.getObject("recordcount") == null) ? 0 : rs.getInt("recordcount"); bean.setRecordCount(recordCount); Integer errorRecordsCount = (rs.getObject("recordsinerror") == null) ? 0 : rs.getInt("recordsinerror"); bean.setRecordsinError(errorRecordsCount); bean.setRecordSuccess(recordCount-errorRecordsCount); bean.setFileStatus(StringConverter.Convert(rs.getString("FileStatus"))); String dsContactEmail = (rs.getObject("dscontactemail") == null) ? "" : rs.getString("dscontactemail"); bean.setDsContactEmail(dsContactEmail.trim()); if(!errorRecordsCount.equals(0)){ bean.setHaveErrorRecords(true); errorFileIdList.add(bean.getFileId()); } return bean; } public ArrayList<PRDetailBean> getDetail(String fileErrorIds) { ReportUtil.getLogger().info("call PRDao getDetail ... "); ArrayList<PRDetailBean> prDetailList = new ArrayList<PRDetailBean>(); if("".equals(fileErrorIds)){ return prDetailList; } Connection con = null; PreparedStatement ps = null; ResultSet rs = null; try { con = DBConnectionManager.getConnection(); String sql = QUERY_PR_DETAIL + AllConstants.LEFT_BRACKET + fileErrorIds + AllConstants.RIGHT_BRACKET + ORDER_CONDITION; ReportUtil.getLogger().info("sql = " + sql); ps = con.prepareStatement(sql); rs = ps.executeQuery(); while (rs.next()) { prDetailList.add(makeDetailBean(rs)); } } catch (SQLException e) { ReportUtil.getLogger().error(e.toString()); e.printStackTrace(); } finally { DbUtils.closeQuietly(con, ps, rs); } return prDetailList; } private PRDetailBean makeDetailBean(ResultSet rs)throws SQLException{ PRDetailBean bean = new PRDetailBean(); bean.setRecordId(rs.getInt("recordid")); bean.setFileId(rs.getInt("fileId")); bean.setRecordSeqNo(rs.getInt("recordseqno")); bean.setName(StringConverter.Convert(rs.getString("name"))); bean.setExtId(StringConverter.Convert(rs.getString("extid"))); bean.setOrgBrand(StringConverter.Convert(rs.getString("org_brand"))); bean.setOrgModel(StringConverter.Convert(rs.getString("org_model"))); bean.setPrBrand(StringConverter.Convert(rs.getString("pr_brand"))); bean.setPrModel(StringConverter.Convert(rs.getString("pr_model"))); bean.setRecordStatus(getReportStatus().getString(StringConverter.Convert(rs.getString("recordstatus")))); return bean; } public List<Integer> getErrorFileIdList() { return errorFileIdList; } private static PropertiesConfiguration getReportStatus() { PropertiesConfiguration config = null; try { config = new PropertiesConfiguration( AllConstants.RECORD_STATUS_FILE); } catch (ConfigurationException e) { ReportUtil.getLogger().error(e); } // TODO: change the refreshDelay for this reload strategy config.setReloadingStrategy(new FileChangedReloadingStrategy()); return config; } }
[ "shengyao15@126.com" ]
shengyao15@126.com
136c43fd892608e6d957478209f0ef8ad362bd75
536656cd89e4fa3a92b5dcab28657d60d1d244bd
/ui/android/java/src/org/chromium/ui/modelutil/RecyclerViewAdapter.java
a2e5af0bdf77d3858b042dc796197a8d9fb871c3
[ "BSD-3-Clause" ]
permissive
ECS-251-W2020/chromium
79caebf50443f297557d9510620bf8d44a68399a
ac814e85cb870a6b569e184c7a60a70ff3cb19f9
refs/heads/master
2022-08-19T17:42:46.887573
2020-03-18T06:08:44
2020-03-18T06:08:44
248,141,336
7
8
BSD-3-Clause
2022-07-06T20:32:48
2020-03-18T04:52:18
null
UTF-8
Java
false
false
7,714
java
// Copyright 2018 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. package org.chromium.ui.modelutil; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView.ViewHolder; import android.view.ViewGroup; import androidx.annotation.Nullable; import org.chromium.base.Callback; import java.util.Collections; import java.util.List; import java.util.Set; /** * A base {@link RecyclerView} adapter that delegates most of its logic. This allows compositing * different delegates together to support different UI features living in the same * {@link RecyclerView}. * * @param <VH> The {@link ViewHolder} type for the {@link RecyclerView}. * @param <P> The payload type for partial updates, or {@link Void} if the adapter does not support * partial updates. */ public class RecyclerViewAdapter<VH extends ViewHolder, P> extends RecyclerView.Adapter<VH> implements ListObservable.ListObserver<P> { /** * Delegate interface for the adapter. * @param <VH> The {@link ViewHolder} type for the {@link RecyclerView}. * @param <P> The payload type for partial updates, or {@link Void} if the adapter does not * support partial updates. */ public interface Delegate<VH, P> extends ListObservable<P> { /** * Returns the number of items under this subtree. This method may be called * before initialization. * * @return The number of items under this subtree. * @see RecyclerView.Adapter#getItemCount() */ int getItemCount(); /** * @param position The position to query * @return The view type of the item at {@code position} under this subtree. * @see RecyclerView.Adapter#getItemViewType */ int getItemViewType(int position); /** * Bind a given {@code viewHolder} to the data represented by the item at the given * {@code position} in the adapter. If {@code payload} is non-null, performs a "partial" * update of only the property represented by {@code payload}. * @param viewHolder A view holder to bind. * @param position The adapter position of the item to bind to the {@code viewHolder}. * @param payload The payload for partial updates, or null to perform a full bind. * @see RecyclerView.Adapter#onBindViewHolder */ void onBindViewHolder(VH viewHolder, int position, @Nullable P payload); /** * Called when the {@link View} owned by {@code viewHolder} no longer needs to be attached * to its parent {@link RecyclerView}. This is a good place to free up expensive resources * that might be owned by the particular {@link View} or {@code viewHolder}. * @param viewHolder A view holder that will be recycled. * @see RecyclerView.Adapter#onViewRecycled(ViewHolder) */ default void onViewRecycled(VH viewHolder) {} /** * @param position The position of an item to be dismissed. * @return The set of item positions that should be dismissed simultaneously when dismissing * the item at the given {@code position} (including the position itself), or an * empty set if the item can't be dismissed. * @see org.chromium.chrome.browser.ntp.cards.NewTabPageAdapter#getItemDismissalGroup */ default Set<Integer> getItemDismissalGroup(int position) { return Collections.emptySet(); } /** * Dismiss the item at the given {@code position}. * @param position The position of the item to be dismissed. * @param itemRemovedCallback Should be called with the title of the dismissed item, to * announce it for accessibility purposes. * @see org.chromium.chrome.browser.ntp.cards.NewTabPageAdapter#dismissItem */ default void dismissItem(int position, Callback<String> itemRemovedCallback) { assert false; } /** * Describe the item at the given {@code position}. As the description is used in tests for * dumping state and equality checks, different items should have distinct descriptions, * but for items that are unique or don't have interesting state it can be sufficient to * return e.g. a string that describes the type of the item. * @param position The position of the item to be described. * @return A string description of the item. */ default String describeItemForTesting(int position) { return "Unknown item at position " + position; } } /** * Factory for creating new {@link ViewHolder}s. * @param <VH> The {@link ViewHolder} type for the {@link RecyclerView}. */ public interface ViewHolderFactory<VH> { /** * Called when the {@link RecyclerView} needs a new {@link ViewHolder} of the given * {@code viewType} to represent an item. * * @param parent The {@link ViewGroup} into which the new view will be added after * it's bound to an adapter position. * @param viewType The view type of the new view. * @return A new {@link ViewHolder} that holds a view of the given view type. * @see RecyclerView.Adapter#createViewHolder */ VH createViewHolder(ViewGroup parent, int viewType); } /** * Creates a new adapter for the given {@code delegate} and {@link ViewHolder} {@code factory}. * @param delegate The delegate for this adapter. * @param factory The {@link ViewHolder} factory for this adapter. */ public RecyclerViewAdapter(Delegate<VH, P> delegate, ViewHolderFactory<VH> factory) { mDelegate = delegate; mFactory = factory; mDelegate.addObserver(this); } private final Delegate<VH, P> mDelegate; private final ViewHolderFactory<VH> mFactory; @Override public int getItemCount() { return mDelegate.getItemCount(); } @Override public int getItemViewType(int position) { return mDelegate.getItemViewType(position); } @Override public VH onCreateViewHolder(ViewGroup parent, int viewType) { return mFactory.createViewHolder(parent, viewType); } @Override public void onBindViewHolder(VH vh, int position) { mDelegate.onBindViewHolder(vh, position, null); } @SuppressWarnings("unchecked") @Override public void onBindViewHolder(VH holder, int position, List<Object> payloads) { if (payloads.isEmpty()) { onBindViewHolder(holder, position); return; } for (Object p : payloads) { mDelegate.onBindViewHolder(holder, position, (P) p); } } @Override public void onViewRecycled(VH holder) { mDelegate.onViewRecycled(holder); } @Override public void onItemRangeInserted(ListObservable source, int index, int count) { notifyItemRangeInserted(index, count); } @Override public void onItemRangeRemoved(ListObservable source, int index, int count) { notifyItemRangeRemoved(index, count); } @Override public void onItemRangeChanged( ListObservable<P> source, int index, int count, @Nullable P payload) { notifyItemRangeChanged(index, count, payload); } @Override public void onItemMoved(ListObservable source, int curIndex, int newIndex) { notifyItemMoved(curIndex, newIndex); } }
[ "pcding@ucdavis.edu" ]
pcding@ucdavis.edu
9144eaa0a7607fd17fba37cd6a17b68a230280b8
d7be0cf96dae35a98dc1643011e025a28e3c92bd
/QZComm/src/main/java/com/ks/jedis/model/JedisRowMapper_UserStat.java
4cdd0a8791f1bd473457456214249dd01180a676
[]
no_license
liaohanjie/QZStore
8ab5827138266dc88179ee2cfb94c98d391c39be
698d1e7d8386bca3b15fd4b3ea3020e5b9cc3c43
refs/heads/master
2021-01-10T18:35:14.604327
2016-05-31T05:17:50
2016-05-31T05:17:50
59,005,984
0
1
null
null
null
null
UTF-8
Java
false
false
2,824
java
package com.ks.jedis.model; public final class JedisRowMapper_UserStat implements com.ks.cache.JedisRowMapper<com.ks.db.model.UserStat>{ @Override public com.ks.db.model.UserStat rowMapper(com.ks.cache.JedisResultSet jrs) { com.ks.db.model.UserStat bean = new com.ks.db.model.UserStat(); bean.setUserId(jrs.getInt("userId")); bean.setArenaCount(jrs.getInt("arenaCount")); bean.setArenaBuyCount(jrs.getInt("arenaBuyCount")); bean.setArenaRefreshCount(jrs.getInt("arenaRefreshCount")); bean.setMallBuyCount(jrs.getString("mallBuyCount")); bean.setGivingFriend(jrs.getString("givingFriend")); bean.setExitGuildTime(jrs.getDate("exitGuildTime")); bean.setCreateTime(jrs.getDate("createTime")); bean.setUpdateTime(jrs.getDate("updateTime")); bean.setCollectStamina(jrs.getInt("collectStamina")); bean.setDrawLoginAward(jrs.getBoolean("drawLoginAward")); bean.setDrawVIPGifis(jrs.getString("drawVIPGifis")); bean.setActivityZoneCount(jrs.getString("activityZoneCount")); bean.setHireGp(jrs.getInt("hireGp")); bean.setGoldCall(jrs.getInt("goldCall")); bean.setLastGoldCallTime(jrs.getDate("lastGoldCallTime")); bean.setDiamondCall(jrs.getInt("diamondCall")); bean.setLastDiamondCallTime(jrs.getDate("lastDiamondCallTime")); bean.setMartialWayCount(jrs.getByte("martialWayCount")); bean.setMartialWayBuyCount(jrs.getByte("martialWayBuyCount")); bean.setBuyGoldCount(jrs.getByte("buyGoldCount")); bean.setBuyStaminaCount(jrs.getByte("buyStaminaCount")); bean.setSigninDays(jrs.getString("signinDays")); bean.setFillSignin(jrs.getInt("fillSignin")); bean.setSumSigninDays(jrs.getString("sumSigninDays")); bean.setLastBlackRefreshTime(jrs.getInt("lastBlackRefreshTime")); bean.setBlackMarketGoods(jrs.getString("blackMarketGoods")); bean.setBlackMarketRefCount(jrs.getInt("blackMarketRefCount")); bean.setMallTotleBuyCount(jrs.getString("mallTotleBuyCount")); bean.setSlateGainTime(jrs.getDate("slateGainTime")); bean.setTodayEquipCountLevel(jrs.getInt("todayEquipCountLevel")); bean.setTodayHeroCountLevel(jrs.getInt("todayHeroCountLevel")); bean.setEquipCountLevel(jrs.getInt("equipCountLevel")); bean.setHeroCountLevel(jrs.getInt("heroCountLevel")); bean.setArenaFightCount(jrs.getInt("arenaFightCount")); bean.setMartialwayFightCount(jrs.getInt("martialwayFightCount")); bean.setAddItemCount(jrs.getInt("addItemCount")); bean.setBreadStoreCount(jrs.getInt("breadStoreCount")); bean.setGodWealthCount(jrs.getInt("godWealthCount")); bean.setAnimaTempleCount(jrs.getInt("animaTempleCount")); bean.setBreadStoreFreeRefreshCount(jrs.getInt("breadStoreFreeRefreshCount")); bean.setBreadStoreDiamondRefreshCount(jrs.getInt("breadStoreDiamondRefreshCount")); bean.setBreadStoreZones(jrs.getString("breadStoreZones")); bean.setFirstCallHero(jrs.getBoolean("firstCallHero")); bean.setCycleCards(jrs.getString("cycleCards")); return bean;} }
[ "liaohanjie1314@126.com" ]
liaohanjie1314@126.com
a70eca50ec89845c00b01f24b4ba0cbdb2e1d9ab
b4108a5057cb7625a02cce1c94bf291a376c29d5
/src/eu/hansolo/fx/heatmap/SimpleHeatMapDemo.java
4f395b4183d01648b3c2e03fa96bd5deee4ec547
[]
no_license
RoyBA/FxHeatMap
6b5e50273681cc8723d9822f6fd2b65b90d32aa2
e3d5903ebfc00e8debff6ceb334d92da18797b28
refs/heads/master
2020-12-28T22:22:08.873466
2014-07-01T05:46:10
2014-07-01T05:46:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,764
java
/* * Copyright (c) 2014 by Gerrit Grunwald * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package eu.hansolo.fx.heatmap; import javafx.application.Application; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.geometry.Insets; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.CheckBox; import javafx.scene.control.ChoiceBox; import javafx.scene.control.Slider; import javafx.scene.control.TextField; import javafx.scene.input.MouseEvent; import javafx.scene.layout.StackPane; import javafx.scene.layout.VBox; import javafx.scene.paint.Color; import javafx.stage.Stage; /** * User: hansolo * Date: 29.06.14 * Time: 13:51 */ public class SimpleHeatMapDemo extends Application { private SimpleHeatMap heatMap; private StackPane pane; private Slider sliderOpacity; private Button button1; private Button button2; private ChoiceBox<ColorMapping> choiceBoxMapping; private TextField field1; private CheckBox checkBoxFadeColors; private Slider sliderRadius; private ChoiceBox<OpacityDistribution> choiceBoxOpacityDistribution; private Button clearHeatMap; private EventHandler<ActionEvent> handler; // ******************** Initialization ************************************ @Override public void init() { pane = new StackPane(); heatMap = new SimpleHeatMap(400, 400, ColorMapping.BLACK_WHITE); sliderOpacity = new Slider(); button1 = new Button("Button 1"); button2 = new Button("Button 2"); choiceBoxMapping = new ChoiceBox<>(); field1 = new TextField(); checkBoxFadeColors = new CheckBox("Fade colors"); sliderRadius = new Slider(); choiceBoxOpacityDistribution = new ChoiceBox<>(); clearHeatMap = new Button("Clear"); handler = EVENT -> { final Object SRC = EVENT.getSource(); if (SRC.equals(choiceBoxMapping)) { heatMap.setColorMapping(ColorMapping.valueOf(choiceBoxMapping.getSelectionModel().getSelectedItem().toString())); } else if (SRC.equals(choiceBoxOpacityDistribution)) { heatMap.setOpacityDistribution(OpacityDistribution.valueOf(choiceBoxOpacityDistribution.getSelectionModel().getSelectedItem().toString())); } else if (SRC.equals(checkBoxFadeColors)) { heatMap.setFadeColors(checkBoxFadeColors.isSelected()); } else if (SRC.equals(clearHeatMap)) { heatMap.clearHeatMap(); } }; registerListeners(); } // ******************** Start ********************************************* @Override public void start(Stage stage) { sliderOpacity.setMin(0); sliderOpacity.setMax(1); sliderOpacity.setValue(heatMap.getHeatMapOpacity()); sliderOpacity.valueChangingProperty().addListener((observableValue, aBoolean, aBoolean2) -> heatMap.setHeatMapOpacity(sliderOpacity.getValue())); choiceBoxMapping.getItems().setAll(ColorMapping.BLACK_WHITE, ColorMapping.WHITE_BLACK); choiceBoxMapping.getSelectionModel().select(heatMap.getColorMapping()); choiceBoxMapping.addEventHandler(ActionEvent.ACTION, handler); choiceBoxOpacityDistribution.getItems().setAll(OpacityDistribution.values()); choiceBoxOpacityDistribution.getSelectionModel().select(heatMap.getOpacityDistribution()); choiceBoxOpacityDistribution.addEventHandler(ActionEvent.ACTION, handler); checkBoxFadeColors.setSelected(heatMap.isFadeColors()); checkBoxFadeColors.setOnAction(handler); sliderRadius.setMin(10); sliderRadius.setMax(50); sliderRadius.setValue(heatMap.getEventRadius()); sliderRadius.valueChangingProperty().addListener((observableValue, aBoolean, aBoolean2) -> heatMap.setEventRadius(sliderRadius.getValue())); clearHeatMap.setOnAction(handler); VBox layout = new VBox(); layout.setPadding(new Insets(10, 10, 10, 10)); layout.setSpacing(10); layout.getChildren().setAll(button1, field1, button2, sliderOpacity, choiceBoxMapping, checkBoxFadeColors, sliderRadius, choiceBoxOpacityDistribution, clearHeatMap); pane.getChildren().setAll(layout, heatMap.getHeatMapImage()); Scene scene = new Scene(pane, 400, 400, Color.GRAY); stage.setTitle("JavaFX SimpleHeatMap Demo"); stage.setScene(scene); stage.show(); } public static void main(String[] args) { launch(args); } // ******************** Methods ******************************************* private void registerListeners() { pane.addEventFilter(MouseEvent.MOUSE_PRESSED, event -> { double x = event.getX(); double y = event.getY(); if (x < heatMap.getEventRadius()) x = heatMap.getEventRadius(); if (x > pane.getWidth() - heatMap.getEventRadius()) x = pane.getWidth() - heatMap.getEventRadius(); if (y < heatMap.getEventRadius()) y = heatMap.getEventRadius(); if (y > pane.getHeight() - heatMap.getEventRadius()) y = pane.getHeight() - heatMap.getEventRadius(); heatMap.addEvent(x, y); }); pane.widthProperty().addListener((ov, oldWidth, newWidth) -> heatMap.setSize(newWidth.doubleValue(), pane.getHeight())); pane.heightProperty().addListener((ov, oldHeight, newHeight) -> heatMap.setSize(pane.getWidth(), newHeight.doubleValue())); } }
[ "han.solo@mac.com" ]
han.solo@mac.com
9ea7373518c4d3cec45e4506654de82242e1ae59
6675a1a9e2aefd5668c1238c330f3237b253299a
/2.15/dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetOrganisationUnitLevelsAction.java
7b5770202aa4fb8a154dc075005ec2f0f882161f
[ "BSD-3-Clause" ]
permissive
hispindia/dhis-2.15
9e5bd360bf50eb1f770ac75cf01dc848500882c2
f61f791bf9df8d681ec442e289d67638b16f99bf
refs/heads/master
2021-01-12T06:32:38.660800
2016-12-27T07:44:32
2016-12-27T07:44:32
77,379,159
0
0
null
null
null
null
UTF-8
Java
false
false
3,406
java
package org.hisp.dhis.commons.action; /* * Copyright (c) 2004-2014, University of Oslo * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * Neither the name of the HISP project nor the names of its contributors may * be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ import java.util.ArrayList; import java.util.List; import org.hisp.dhis.organisationunit.OrganisationUnitLevel; import org.hisp.dhis.organisationunit.OrganisationUnitService; import org.hisp.dhis.paging.ActionPagingSupport; /** * @author Tran Thanh Tri */ public class GetOrganisationUnitLevelsAction extends ActionPagingSupport<OrganisationUnitLevel> { // ------------------------------------------------------------------------- // Dependencies // ------------------------------------------------------------------------- private OrganisationUnitService organisationUnitService; public void setOrganisationUnitService( OrganisationUnitService organisationUnitService ) { this.organisationUnitService = organisationUnitService; } // ------------------------------------------------------------------------- // Output // ------------------------------------------------------------------------- private List<OrganisationUnitLevel> organisationUnitLevels; public List<OrganisationUnitLevel> getOrganisationUnitLevels() { return organisationUnitLevels; } // ------------------------------------------------------------------------- // Action Implementation // ------------------------------------------------------------------------- @Override public String execute() throws Exception { organisationUnitLevels = new ArrayList<OrganisationUnitLevel>( organisationUnitService.getOrganisationUnitLevels() ); if ( usePaging ) { this.paging = createPaging( organisationUnitLevels.size() ); organisationUnitLevels = organisationUnitLevels.subList( paging.getStartPos(), paging.getEndPos() ); } return SUCCESS; } }
[ "[sagarb.4488@gmail.com]" ]
[sagarb.4488@gmail.com]