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
836882eb9054e069df20891f1f6a843d192007e7
fcde9046e14040dfc29a36c2f7644bf2cb89750c
/src/newbieprotect/Nprotect.java
c914b96ff0be6e3b112717cf1933cdaf0dd45185
[]
no_license
Shevchik/NewbieProtect
6996108a9fe56c356346f0bffbf4dbc2bf1f0ede
00899254dd149d5605e3bebf111ac18bd1406743
refs/heads/master
2020-12-24T16:24:07.287945
2016-03-05T17:56:57
2016-03-05T17:56:57
13,032,548
1
1
null
null
null
null
UTF-8
Java
false
false
740
java
package newbieprotect; import org.bukkit.event.HandlerList; import org.bukkit.plugin.java.JavaPlugin; public class Nprotect extends JavaPlugin { private Config config; private Storage storage; private EventsListener listener; @Override public void onEnable() { setNaggable(false); config = new Config(this); config.loadConfig(); storage = new Storage(this, config); storage.loadTimeConfig(); storage.startCheck(); listener = new EventsListener(config, storage); getServer().getPluginManager().registerEvents(listener, this); } @Override() public void onDisable() { HandlerList.unregisterAll(this); listener = null; storage.stopCheck(); storage.saveTimeConfig(); storage = null; config = null; } }
[ "Shev4ik.den@gmail.com" ]
Shev4ik.den@gmail.com
6784acf7c00b0eb779fb0853dd99c3ae2311c500
c4e59c9741c47b99aa18a859042ec7093b363daa
/src/Job23DstIpPortInse6620.java
f58c304d14941bb9be9ae87af352866f37ca7889
[]
no_license
srinathman/inse6620-project
e739d7bd58484af6fc2e4a5ffcd1ced66793b67c
4f4a1a9fd89ea704c502b242f2de17457bf54365
refs/heads/master
2021-01-19T03:42:15.856769
2016-08-08T02:18:27
2016-08-08T02:18:27
63,834,218
0
0
null
null
null
null
UTF-8
Java
false
false
1,161
java
import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.IntWritable; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapreduce.Job; import org.apache.hadoop.mapreduce.lib.input.FileInputFormat; import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat; import org.apache.hadoop.util.GenericOptionsParser; public class Job23DstIpPortInse6620 { public static void main(String[] args) throws Exception { Configuration conf = new Configuration(); if (args.length != 2) { System.err.println("Usage: Job2Inse6620 <in> <out> "); System.exit(2); } Job job = Job.getInstance(conf, "INSE 6620 Job #2.3"); job.setJarByClass(Job23DstIpPortInse6620.class); job.setMapperClass(Job23DstIpPortInse6620Mapper.class); // job.setCombinerClass( Inse6620Combinerclass) ; job.setReducerClass(Job23DstIpPortInse6620Reducer.class); job.setOutputKeyClass(IntWritable.class); job.setOutputValueClass(Text.class); FileInputFormat.addInputPath(job, new Path(args[0])); FileOutputFormat.setOutputPath(job, new Path(args[1])); System.exit(job.waitForCompletion(true) ? 0 : 1); } }
[ "cloudera@quickstart.cloudera" ]
cloudera@quickstart.cloudera
43c54c87003a0f49b56ad4b09c5e4fd00137d0d3
7f996676ba54912119581e4585ed465637e99a9c
/maven-plugin/src/main/java/hudson/maven/FilteredChangeLogSet.java
8b5461899d0781b2d435a6d4b7058e618687dc8c
[]
no_license
hudson3-plugins/legacy-maven-support
8e5788360b75e827020b2dca50591689e85dc506
202878a281f1dace2489cef31c93a1048769f10e
refs/heads/master
2023-05-31T13:10:47.716237
2014-05-27T23:25:44
2014-05-27T23:25:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,109
java
/* * The MIT License * * Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package hudson.maven; import hudson.scm.ChangeLogSet; import hudson.scm.ChangeLogSet.Entry; import java.util.Iterator; import java.util.List; import java.util.Collections; /** * {@link ChangeLogSet} implementation used for {@link MavenBuild}. * * @author Kohsuke Kawaguchi */ public class FilteredChangeLogSet extends ChangeLogSet<Entry> { private final List<Entry> master; public final ChangeLogSet<? extends Entry> core; /*package*/ FilteredChangeLogSet(MavenBuild build) { super(build); MavenModuleSetBuild parentBuild = build.getParentBuild(); if(parentBuild==null) { core = ChangeLogSet.createEmpty(build); master = Collections.emptyList(); } else { core = parentBuild.getChangeSet(); master = parentBuild.getChangeSetFor(build.getParent()); } } public List<Entry> getLogs() { return master; } }
[ "mcculls@gmail.com" ]
mcculls@gmail.com
35124d79da71b3c5fae6f9af4d97f64fc3142719
92dd6bc0a9435c359593a1f9b309bb58d3e3f103
/src/Mar2021Leetcode/_0095UniqueBinarySearchTreesII.java
ba9435de2a056a042e1cb61928786ec6289794fd
[ "MIT" ]
permissive
darshanhs90/Java-Coding
bfb2eb84153a8a8a9429efc2833c47f6680f03f4
da76ccd7851f102712f7d8dfa4659901c5de7a76
refs/heads/master
2023-05-27T03:17:45.055811
2021-06-16T06:18:08
2021-06-16T06:18:08
36,981,580
3
3
null
null
null
null
UTF-8
Java
false
false
511
java
package Mar2021Leetcode; import java.util.List; public class _0095UniqueBinarySearchTreesII { static public class TreeNode { int val; TreeNode left; TreeNode right; TreeNode() { } TreeNode(int val) { this.val = val; } TreeNode(int val, TreeNode left, TreeNode right) { this.val = val; this.left = left; this.right = right; } } public static void main(String[] args) { System.out.println(generateTrees(3)); } public static List<TreeNode> generateTrees(int n) { } }
[ "hsdars@gmail.com" ]
hsdars@gmail.com
3facd33a5b5dd213603bc40e12832fb8b4f67972
26da0aea2ab0a2266bbee962d94a96d98a770e5f
/nam/nam-view/src/main/java/nam/model/minion/MinionInfoManager.java
4ea654434685b25f9ed7fcb3dd1c4182933e9712
[ "Apache-2.0" ]
permissive
tfisher1226/ARIES
1de2bc076cf83488703cf18f7e3f6e3c5ef1b40b
814e3a4b4b48396bcd6d082e78f6519679ccaa01
refs/heads/master
2021-01-10T02:28:07.807313
2015-12-10T20:30:00
2015-12-10T20:30:00
44,076,313
2
0
null
null
null
null
UTF-8
Java
false
false
6,346
java
package nam.model.minion; import java.io.Serializable; import java.util.List; import javax.enterprise.context.SessionScoped; import javax.enterprise.event.Observes; import javax.inject.Inject; import javax.inject.Named; import org.aries.runtime.BeanContext; import org.aries.ui.Display; import org.aries.ui.event.Add; import org.aries.ui.event.Remove; import org.aries.ui.event.Selected; import org.aries.ui.event.Updated; import org.aries.util.Validator; import nam.model.Minion; import nam.model.Project; import nam.model.util.MinionUtil; import nam.model.util.ProjectUtil; import nam.ui.design.AbstractNamRecordManager; import nam.ui.design.SelectionContext; import nam.ui.design.WorkspaceEventManager; @SessionScoped @Named("minionInfoManager") public class MinionInfoManager extends AbstractNamRecordManager<Minion> implements Serializable { @Inject private MinionWizard minionWizard; @Inject private MinionDataManager minionDataManager; @Inject private MinionPageManager minionPageManager; @Inject private MinionEventManager minionEventManager; @Inject private WorkspaceEventManager workspaceEventManager; @Inject private MinionHelper minionHelper; @Inject private SelectionContext selectionContext; public MinionInfoManager() { setInstanceName("minion"); } public Minion getMinion() { return getRecord(); } public Minion getSelectedMinion() { return selectionContext.getSelection("minion"); } @Override public Class<Minion> getRecordClass() { return Minion.class; } @Override public boolean isEmpty(Minion minion) { return minionHelper.isEmpty(minion); } @Override public String toString(Minion minion) { return minionHelper.toString(minion); } @Override public void initialize() { Minion minion = selectionContext.getSelection("minion"); if (minion != null) initialize(minion); } protected void initialize(Minion minion) { MinionUtil.initialize(minion); minionWizard.initialize(minion); setContext("minion", minion); } public void handleMinionSelected(@Observes @Selected Minion minion) { selectionContext.setSelection("minion", minion); minionPageManager.updateState(minion); minionPageManager.refreshMembers(); setRecord(minion); } @Override public String newRecord() { return newMinion(); } public String newMinion() { try { Minion minion = create(); selectionContext.resetOrigin(); selectionContext.setSelection("minion", minion); String url = minionPageManager.initializeMinionCreationPage(minion); minionPageManager.pushContext(minionWizard); initialize(minion); return url; } catch (Exception e) { handleException(e); return null; } } @Override public Minion create() { Minion minion = MinionUtil.create(); return minion; } @Override public Minion clone(Minion minion) { minion = MinionUtil.clone(minion); return minion; } @Override public String viewRecord() { return viewMinion(); } public String viewMinion() { Minion minion = selectionContext.getSelection("minion"); String url = viewMinion(minion); return url; } public String viewMinion(Minion minion) { try { String url = minionPageManager.initializeMinionSummaryView(minion); minionPageManager.pushContext(minionWizard); initialize(minion); return url; } catch (Exception e) { handleException(e); return null; } } @Override public String editRecord() { return editMinion(); } public String editMinion() { Minion minion = selectionContext.getSelection("minion"); String url = editMinion(minion); return url; } public String editMinion(Minion minion) { try { //minion = clone(minion); selectionContext.resetOrigin(); selectionContext.setSelection("minion", minion); String url = minionPageManager.initializeMinionUpdatePage(minion); minionPageManager.pushContext(minionWizard); initialize(minion); return url; } catch (Exception e) { handleException(e); return null; } } public void saveMinion() { Minion minion = getMinion(); if (validateMinion(minion)) { if (isImmediate()) persistMinion(minion); outject("minion", minion); } } public void persistMinion(Minion minion) { saveMinion(minion); } public void saveMinion(Minion minion) { try { saveMinionToSystem(minion); minionEventManager.fireAddedEvent(minion); } catch (Exception e) { handleException(e); } } protected void saveMinionToSystem(Minion minion) { minionDataManager.saveMinion(minion); } public void handleSaveMinion(@Observes @Add Minion minion) { saveMinion(minion); } public void addMinion(Minion minion) { try { //TODO } catch (Exception e) { handleException(e); } } public void enrichMinion(Minion minion) { //nothing for now } @Override public boolean validate(Minion minion) { return validateMinion(minion); } public boolean validateMinion(Minion minion) { Validator validator = getValidator(); boolean isValid = MinionUtil.validate(minion); Display display = getFromSession("display"); display.setModule("minionInfo"); display.addErrors(validator.getMessages()); //FacesContext.getCurrentInstance().isValidationFailed() setValidated(isValid); return isValid; } public void promptRemoveMinion() { display = getFromSession("display"); display.setModule("minionInfo"); Minion minion = selectionContext.getSelection("minion"); if (minion == null) { display.error("Minion record must be selected."); } } public String handleRemoveMinion(@Observes @Remove Minion minion) { display = getFromSession("display"); display.setModule("minionInfo"); try { display.info("Removing Minion "+MinionUtil.getLabel(minion)+" from the system."); removeMinionFromSystem(minion); selectionContext.clearSelection("minion"); minionEventManager.fireClearSelectionEvent(); minionEventManager.fireRemovedEvent(minion); workspaceEventManager.fireRefreshEvent(); return null; } catch (Exception e) { handleException(e); return null; } } protected void removeMinionFromSystem(Minion minion) { if (minionDataManager.removeMinion(minion)) setRecord(null); } public void cancelMinion() { BeanContext.removeFromSession("minion"); minionPageManager.removeContext(minionWizard); } }
[ "tfisher@kattare.com" ]
tfisher@kattare.com
ae87a0cb6634c44b4f62f281ddf5d64e2af59291
883b7801d828a0994cae7367a7097000f2d2e06a
/python/experiments/projects/benetech-ServiceNet/real_error_dataset/1/2/LocationBasedImportServiceImpl.java
7b2a743c3bc067f4ffa15cb921c60a49f3a72302
[]
no_license
pombredanne/styler
9c423917619912789289fe2f8982d9c0b331654b
f3d752d2785c2ab76bacbe5793bd8306ac7961a1
refs/heads/master
2023-07-08T05:55:18.284539
2020-11-06T05:09:47
2020-11-06T05:09:47
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,586
java
package org.benetech.servicenet.service.impl; import java.util.List; import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.StringUtils; import org.benetech.servicenet.domain.AccessibilityForDisabilities; import org.benetech.servicenet.domain.DataImportReport; import org.benetech.servicenet.domain.HolidaySchedule; import org.benetech.servicenet.domain.Language; import org.benetech.servicenet.domain.Location; import org.benetech.servicenet.domain.Phone; import org.benetech.servicenet.domain.PhysicalAddress; import org.benetech.servicenet.domain.PostalAddress; import org.benetech.servicenet.domain.RegularSchedule; import org.benetech.servicenet.domain.GeocodingResult; import org.benetech.servicenet.repository.RegularScheduleRepository; import org.benetech.servicenet.service.GeocodingResultService; import org.benetech.servicenet.service.LocationBasedImportService; import org.benetech.servicenet.service.SharedImportService; import org.benetech.servicenet.service.annotation.ConfidentialFilter; import org.benetech.servicenet.service.dto.GeocodingResultDTO; import org.benetech.servicenet.validator.EntityValidator; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import javax.annotation.Nonnull; import javax.persistence.EntityManager; import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; import static org.benetech.servicenet.service.util.EntityManagerUtils.updateCollection; import static org.benetech.servicenet.validator.EntityValidator.isValid; @Component public class LocationBasedImportServiceImpl implements LocationBasedImportService { @Autowired private EntityManager em; @Autowired private RegularScheduleRepository regularScheduleRepository; @Autowired private SharedImportService sharedImportService; @Autowired private GeocodingResultService geocodingResultService; @Override @ConfidentialFilter public void createOrUpdateGeocodinResults(List<GeocodingResult> geocodingResult, Location location, DataImportReport report) { if (geocodingResult == null) { return; } Set<GeocodingResult> filtered = geocodingResult.stream() .filter(x -> BooleanUtils.isNotTrue(x.getIsConfidential()) && isValid(x, report, location.getExternalDbId())) .collect(Collectors.toSet()); filtered.forEach(geo -> { Optional<GeocodingResultDTO> geocodingFromDb = geocodingResultService.findOne(geo.getId()); geocodingFromDb.ifPresentOrElse( geocodingResultDTO -> { geo.setId(geocodingResultDTO.getId()); em.merge(geo); }, () -> em.persist(geo) ); }); } @Override @ConfidentialFilter public void createOrUpdatePhysicalAddress(PhysicalAddress physicalAddress, Location location, DataImportReport report) { if (physicalAddress == null) { return; } EntityValidator.validateAndFix(physicalAddress, location.getOrganization(), report, location.getExternalDbId()); physicalAddress.setLocation(location); if (location.getPhysicalAddress() != null) { physicalAddress.setId(location.getPhysicalAddress().getId()); em.merge(physicalAddress); } else { em.persist(physicalAddress); } location.setPhysicalAddress(physicalAddress); } @Override @ConfidentialFilter public void createOrUpdatePostalAddress(PostalAddress postalAddress, Location location, DataImportReport report) { if (postalAddress == null) { return; } EntityValidator.validateAndFix(postalAddress, location.getOrganization(), report, location.getExternalDbId()); postalAddress.setLocation(location); if (location.getPostalAddress() != null) { postalAddress.setId(location.getPostalAddress().getId()); em.merge(postalAddress); } else { em.persist(postalAddress); } location.setPostalAddress(postalAddress); } @Override public void createOrUpdateOpeningHoursForLocation(RegularSchedule schedule, Location location, DataImportReport report) { if (schedule != null) { sharedImportService.createOrUpdateOpeningHours(schedule.getOpeningHours().stream() .filter(x -> isValid(x, report, location.getExternalDbId())) .collect(Collectors.toSet()), location, schedule); } } @Override @ConfidentialFilter public void createOrUpdateHolidaySchedulesForLocation(Set<HolidaySchedule> schedules, Location location, DataImportReport report) { if (schedules != null) { schedules.forEach(schedule -> { EntityValidator.validateAndFix(schedule, location.getOrganization(), report, location.getExternalDbId()); schedule.setLocation(location); }); location.setHolidaySchedules(sharedImportService.createOrUpdateHolidaySchedules(schedules)); } } @Override public void createOrUpdateLangsForLocation(Set<Language> langs, Location location, DataImportReport report) { Set<Language> filtered = langs.stream().filter(x -> BooleanUtils.isNotTrue(x.getIsConfidential()) && isValid(x, report, location.getExternalDbId())) .collect(Collectors.toSet()); createOrUpdateFilteredLangsForLocation(filtered, location); } @Override public void createOrUpdatePhonesForLocation(Set<Phone> phones, Location location, DataImportReport report) { Set<Phone> filtered = phones.stream().filter(x -> BooleanUtils.isNotTrue(x.getIsConfidential())) .collect(Collectors.toSet()); filtered.forEach(p -> p.setLocation(location)); createOrUpdateFilteredPhonesForLocation(filtered, location); } @Override @ConfidentialFilter public void createOrUpdateAccessibilities(Set<AccessibilityForDisabilities> accessibilities, Location location, DataImportReport report) { Set<AccessibilityForDisabilities> filtered = accessibilities.stream() .filter(x -> BooleanUtils.isNotTrue(x.getIsConfidential())) .collect(Collectors.toSet()); filtered.forEach(x -> { EntityValidator.validateAndFix(x, location.getOrganization(), report, location.getExternalDbId()); x.setLocation(location); }); updateCollection(em, location.getAccessibilities(), filtered, (x1, x2) -> StringUtils.equals(x1.getAccessibility(), x2.getAccessibility()) && StringUtils.equals(x1.getDetails(), x2.getDetails())); } private void createOrUpdateFilteredLangsForLocation(Set<Language> langs, Location location) { langs.forEach(lang -> { EntityValidator.validateAndFix(lang, location.getOrganization(), null, ""); lang.setLocation(location); }); sharedImportService.persistLangs(location.getLangs(), langs); } private void createOrUpdateFilteredPhonesForLocation(Set<Phone> phones, @Nonnull Location location) { phones.forEach(phone -> { EntityValidator.validateAndFix(phone, location.getOrganization(), null, ""); phone.setLocation(location); }); sharedImportService.persistPhones(location.getPhones(), phones); } }
[ "fer.madeiral@gmail.com" ]
fer.madeiral@gmail.com
f4380e06d90b40b3fc9c53d2d316ba29ddbb2651
62ce3ebeff80dc21d9529d42d71db412a5f3001a
/app/src/main/java/com/example/ruolan/letgo/bean/Dish.java
b2b0025690ab3b43383ce4af57695c88e2d8f080
[]
no_license
liuwen370494581/My_Novel
c53464809702b236e6b0d3c730a54b67c15c8b74
6ee79fa1cef68a76a6c1e3f9543a43a74ff5914b
refs/heads/master
2020-04-05T13:33:20.850877
2017-10-17T07:33:30
2017-10-17T07:33:30
94,873,928
2
1
null
null
null
null
UTF-8
Java
false
false
1,178
java
package com.example.ruolan.letgo.bean; import org.greenrobot.greendao.annotation.Entity; import org.greenrobot.greendao.annotation.Id; import java.io.Serializable; import org.greenrobot.greendao.annotation.Generated; /** * Created by liuwen on 2017/6/22. */ @Entity public class Dish implements Serializable { @Id(autoincrement = true) private Long id; private String title; private String url; public Dish() { } public Dish(String title) { this.title = title; } public Dish(String title, String url) { this.title = title; this.url = url; } public String getUrl() { return this.url; } public void setUrl(String url) { this.url = url; } public String getTitle() { return this.title; } public void setTitle(String title) { this.title = title; } public Long getId() { return this.id; } public void setId(Long id) { this.id = id; } @Generated(hash = 1922366006) public Dish(Long id, String title, String url) { this.id = id; this.title = title; this.url = url; } }
[ "370494581@qq.com" ]
370494581@qq.com
6a192678a98ced1dab135c5989241b12868a5775
fe1f2c68a0540195b227ebee1621819766ac073b
/OVO_jdgui/myobfuscated/yd.java
eb232efe0a1d1389f60a7ce1a3708043779f0774
[]
no_license
Sulley01/KPI_4
41d1fd816a3c0b2ab42cff54a4d83c1d536e19d3
04ed45324f255746869510f0b201120bbe4785e3
refs/heads/master
2020-03-09T05:03:37.279585
2018-04-18T16:52:10
2018-04-18T16:52:10
128,602,787
2
1
null
null
null
null
UTF-8
Java
false
false
254
java
package myobfuscated; public abstract interface yd { public abstract void a() throws xt; } /* Location: C:\dex2jar-2.0\classes-dex2jar.jar!\myobfuscated\yd.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "sullivan.alvin@ymail.com" ]
sullivan.alvin@ymail.com
3cb2dc006df0c082cc7c9c91b35a2e60d9b6f258
cc863da7a3f53f36c60fe06f598c2d5971107ce0
/src/main/java/com/frobisher/linux/lv/EncryptionUtils.java
6cd05d71e925855d14c684063befa856df2857d7
[ "Apache-2.0" ]
permissive
MyDarcy/SSE
71534fc6b2110154bd6c1949badd02b944896493
080c0310796ba0b8df1c41ea159dcc5594624445
refs/heads/master
2021-09-06T00:54:11.177570
2018-02-01T03:29:36
2018-02-01T03:29:36
112,193,865
0
0
null
null
null
null
UTF-8
Java
false
false
1,561
java
package com.frobisher.linux.lv; import javax.crypto.BadPaddingException; import javax.crypto.Cipher; import javax.crypto.IllegalBlockSizeException; import java.security.InvalidKeyException; /* * author: darcy * date: 2017/11/8 15:59 * description: */ public class EncryptionUtils { /** * 加密字符数组. * @param toBeEncrypted * @return * @throws BadPaddingException * @throws IllegalBlockSizeException * @throws InvalidKeyException */ public static byte[] encrypt(byte[] toBeEncrypted) throws BadPaddingException, IllegalBlockSizeException, InvalidKeyException { Initialization.cipher.init(Cipher.ENCRYPT_MODE, Initialization.secretKey); byte[] encryptedBytes = Initialization.cipher.doFinal(toBeEncrypted); return encryptedBytes; } /** * 解密字节数代表的密文数组. * @param toBeDecrypted * @return * @throws BadPaddingException * @throws IllegalBlockSizeException * @throws InvalidKeyException */ public static byte[] decrypt(byte[] toBeDecrypted) throws BadPaddingException, IllegalBlockSizeException, InvalidKeyException { Initialization.cipher.init(Cipher.DECRYPT_MODE, Initialization.secretKey); byte[] decrytedBytes = Initialization.cipher.doFinal(toBeDecrypted); return decrytedBytes; } public static void main(String[] args) throws BadPaddingException, InvalidKeyException, IllegalBlockSizeException { String message = "Searchable Encryption."; byte[] encrypt = encrypt(message.getBytes()); byte[] decrypt = decrypt(encrypt); System.out.println(new String(decrypt)); } }
[ "darcy.q.cs@gmail.com" ]
darcy.q.cs@gmail.com
9dfa7de8ae497769aa323e66ba90a44aa5751bbe
88614ca8bcc7692964e954c9dca8ed88578de452
/src/main/java/com/orderservice/controller/OrderHistoryController.java
05ac530b5ae72a74b7e46d9e4365145d5dd34ff0
[]
no_license
kanhavmathur05/orderservice
3148100aa4fc56e39901bb06e4f278625ea0c2c8
ff3d635a255d8fa29a4f593e5e815c267ae49a5a
refs/heads/main
2023-05-01T05:00:30.456434
2021-05-17T16:02:31
2021-05-17T16:02:31
368,245,166
0
0
null
null
null
null
UTF-8
Java
false
false
3,204
java
package com.orderservice.controller; import java.util.ArrayList; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RestController; import com.orderservice.model.CartProducts; import com.orderservice.model.OrderHistory; import com.orderservice.repository.OrderHistoryRepository; import com.orderservice.service.CartProductsService; import com.orderservice.service.OrderHistoryService; @CrossOrigin(origins = "*", maxAge = 3600) @RestController public class OrderHistoryController { @Autowired OrderHistoryService orderHistoryService; @Autowired CartProductsService cartProductsService; @Autowired OrderHistoryRepository orderHistoryRepository; // @Autowired // ProductService productService; // @GetMapping("/order-history/{userId}") // public ResponseEntity<List<Product>> getOrderHistory(@PathVariable Long userId) { // List<OrderHistory> orderHistoryList = orderHistoryService.getOrderHistoryForUser(userId); // List<Product> productList = new ArrayList<>(); // for (OrderHistory orderHistory : orderHistoryList) { // Product product = new Product(); // product = productService.getProduct(orderHistory.getProductId()); // productList.add(product); // } // // return ResponseEntity.ok().body(productList); // } @GetMapping("/order-history/{username}") public ResponseEntity<List<OrderHistory>> getOrderHistory(@PathVariable String username) { List<OrderHistory> orderHistoryList = orderHistoryService.getOrderHistoryForUser(username); // List<OrderHistory> productList = new ArrayList<>(); // for (OrderHistory orderHistory : orderHistoryList) { // Product product = new Product(); // product = productService.getProduct(orderHistory.getProductId()); // productList.add(product); // } return ResponseEntity.ok().body(orderHistoryList); } @GetMapping("/get-order-history/{id}") public void getOneOrderHistory(int id) { orderHistoryService.getOrderHistory(id); } @GetMapping("/payment/{username}") public ResponseEntity<?> doPayment(@PathVariable String username) { List<CartProducts> cartProductList=cartProductsService.getProductsInUserCart(username); List<OrderHistory> orderHistoryList=new ArrayList<>(); for(CartProducts cartProduct:cartProductList) { OrderHistory orderHistory=new OrderHistory(); orderHistory.setProductName(cartProduct.getProductName()); orderHistory.setProductDescription(cartProduct.getProductDescription()); orderHistory.setPrice(cartProduct.getPrice()); orderHistory.setProductImage(cartProduct.getProductImage()); orderHistory.setUserName(cartProduct.getUserName()); orderHistoryList.add(orderHistory); } // perform save list in db List<OrderHistory> response = orderHistoryRepository.saveAll(orderHistoryList); cartProductsService.deleteAllCartItems(username); return ResponseEntity.ok(response); } }
[ "kanhavmathur05@gmail.com" ]
kanhavmathur05@gmail.com
485a7d4899bbb385f4c969bd1405908574947cbb
08e7e061a83fb579801890ecd25ff4bfd772ddcd
/spring-hateoas/src/test/java/org/springframework/hateoas/config/HypermediaRestTemplateConfigurerTest.java
d427939bf376f7ab3d897231edeb958ffa65eef2
[ "Apache-2.0" ]
permissive
jcohy/jcohy-docs
c3c4477bd5c0a764884cb23cc045369946a06bcc
0308e3fb47ac5d2f5d8d1d5dbda6ea9007d31dc1
refs/heads/main
2023-08-17T14:56:42.110431
2023-06-29T10:47:33
2023-06-29T10:47:33
224,825,195
53
12
Apache-2.0
2023-09-05T13:45:05
2019-11-29T09:50:08
Java
UTF-8
Java
false
false
2,843
java
package org.springframework.hateoas.config; import static org.assertj.core.api.Assertions.*; import static org.springframework.hateoas.config.EnableHypermediaSupport.HypermediaType.*; import static org.springframework.hateoas.support.ContextTester.*; import java.util.Collections; import org.junit.jupiter.api.Test; import org.springframework.context.annotation.Bean; import org.springframework.hateoas.MediaTypes; import org.springframework.http.MediaType; import org.springframework.http.converter.HttpMessageConverter; import org.springframework.web.client.RestTemplate; public class HypermediaRestTemplateConfigurerTest { private static MediaType FRODO_JSON = MediaType.parseMediaType("application/frodo+json"); @Test // #1223 void webConvertersShouldAddHypermediaMessageConverters() { withContext(HalConfig.class, context -> { HypermediaRestTemplateConfigurer configurer = context.getBean(HypermediaRestTemplateConfigurer.class); RestTemplate restTemplate = configurer.registerHypermediaTypes(new RestTemplate()); assertThat(restTemplate.getMessageConverters()).flatExtracting(HttpMessageConverter::getSupportedMediaTypes) .contains(MediaTypes.HAL_JSON) // .doesNotContain(MediaTypes.HAL_FORMS_JSON, MediaTypes.COLLECTION_JSON, MediaTypes.UBER_JSON); }); } @Test // #1223 void webConvertersShouldAddAllHypermediaMessageConverters() { withContext(AllHypermediaConfig.class, context -> { HypermediaRestTemplateConfigurer configurer = context.getBean(HypermediaRestTemplateConfigurer.class); RestTemplate restTemplate = configurer.registerHypermediaTypes(new RestTemplate()); assertThat(restTemplate.getMessageConverters()).flatExtracting(HttpMessageConverter::getSupportedMediaTypes) .contains(MediaTypes.HAL_JSON, MediaTypes.HAL_FORMS_JSON, MediaTypes.COLLECTION_JSON, MediaTypes.UBER_JSON); }); } @Test // #1223 void webConvertersShouldSupportCustomHypermediaTypes() { withContext(CustomHypermediaConfig.class, context -> { HypermediaRestTemplateConfigurer configurer = context.getBean(HypermediaRestTemplateConfigurer.class); RestTemplate restTemplate = configurer.registerHypermediaTypes(new RestTemplate()); assertThat(restTemplate.getMessageConverters()).flatExtracting(HttpMessageConverter::getSupportedMediaTypes) .contains(MediaTypes.HAL_JSON, FRODO_JSON) .doesNotContain(MediaTypes.HAL_FORMS_JSON, MediaTypes.COLLECTION_JSON, MediaTypes.UBER_JSON); }); } @EnableHypermediaSupport(type = HAL) static class HalConfig { } @EnableHypermediaSupport(type = { HAL, HAL_FORMS, COLLECTION_JSON, UBER }) static class AllHypermediaConfig { } static class CustomHypermediaConfig extends HalConfig { @Bean HypermediaMappingInformation hypermediaMappingInformation() { return () -> Collections.singletonList(FRODO_JSON); } } }
[ "jia_chao23@126.com" ]
jia_chao23@126.com
36abc625cf39dc8541f39af74cfd05dc63d72113
11f9b4b9a4509649d20eeaa321eccc8adb60e11d
/org.dawb.common.ui/src/org/dawb/common/ui/DawbUtils.java
d7f2286737b58ffe9ea2bf61662423686b6a8c0e
[]
no_license
REJN2/dawn-common
31784277bd3f76744ae5dd39e8d57fa21b074de8
115b25f95631eb679443a0ddb0bec779422a3040
refs/heads/master
2021-01-16T18:36:17.466448
2016-05-25T11:56:25
2016-05-25T11:56:25
59,746,877
0
0
null
2016-05-26T12:02:23
2016-05-26T12:02:23
null
UTF-8
Java
false
false
715
java
/* * Copyright (c) 2012 Diamond Light Source Ltd. * * 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 */ package org.dawb.common.ui; import org.eclipse.core.resources.ResourcesPlugin; public class DawbUtils { public static String getDawbHome() { return ResourcesPlugin.getWorkspace().getRoot().getLocation().toOSString()+"/.metadata/.dawb/"; } public static String getDawnHome() { return ResourcesPlugin.getWorkspace().getRoot().getLocation().toOSString()+"/.metadata/.dawn/"; } }
[ "matthew.gerring@gmail.com" ]
matthew.gerring@gmail.com
dfd2f1b39da8f2baa5293d582b1345139afa31b8
32b72e1dc8b6ee1be2e80bb70a03a021c83db550
/ast_results/BiglySoftware_BiglyBT-Android/BiglyBT/src/main/java/com/biglybt/android/client/dialog/DialogFragmentRcmAuthAll.java
dd4c4071fb4c61702dc098f91c4fed7836e595ce
[]
no_license
cmFodWx5YWRhdjEyMTA5/smell-and-machine-learning
d90c41a17e88fcd99d543124eeb6e93f9133cb4a
0564143d92f8024ff5fa6b659c2baebf827582b1
refs/heads/master
2020-07-13T13:53:40.297493
2019-01-11T11:51:18
2019-01-11T11:51:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,215
java
// isComment package com.biglybt.android.client.dialog; import java.util.Map; import com.biglybt.android.client.AndroidUtilsUI; import com.biglybt.android.client.AndroidUtilsUI.AlertDialogBuilder; import com.biglybt.android.client.R; import com.biglybt.android.client.dialog.DialogFragmentRcmAuth.DialogFragmentRcmAuthListener; import com.biglybt.android.client.rpc.ReplyMapReceivedListener; import com.biglybt.android.client.session.Session; import com.biglybt.android.client.session.SessionManager; import com.biglybt.util.Thunk; import android.app.Dialog; import android.content.Context; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.v4.app.FragmentActivity; import android.support.v7.app.AlertDialog; import android.view.View; import android.widget.Button; import android.widget.CheckBox; import android.widget.CompoundButton.OnCheckedChangeListener; public class isClassOrIsInterface extends DialogFragmentBase { private static final String isVariable = "isStringConstant"; @Thunk DialogFragmentRcmAuthListener isVariable; public static void isMethod(@NonNull FragmentActivity isParameter, String isParameter) { DialogFragmentRcmAuthAll isVariable = new DialogFragmentRcmAuthAll(); Bundle isVariable = new Bundle(); isNameExpr.isMethod(isNameExpr.isFieldAccessExpr, isNameExpr); isNameExpr.isMethod(isNameExpr); isNameExpr.isMethod(isNameExpr, isNameExpr.isMethod(), isNameExpr); } @NonNull @Override public Dialog isMethod(Bundle isParameter) { FragmentActivity isVariable = isMethod(); AlertDialogBuilder isVariable = isNameExpr.isMethod(isNameExpr, isNameExpr.isFieldAccessExpr.isFieldAccessExpr); View isVariable = isNameExpr.isFieldAccessExpr; AlertDialog.Builder isVariable = isNameExpr.isFieldAccessExpr; isNameExpr.isMethod(isNameExpr, isNameExpr.isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr), null, isNameExpr.isFieldAccessExpr.isFieldAccessExpr); isNameExpr.isMethod(isNameExpr, isNameExpr.isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr), null, isNameExpr.isFieldAccessExpr.isFieldAccessExpr); isNameExpr.isMethod(isNameExpr, isNameExpr.isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr), null, isNameExpr.isFieldAccessExpr.isFieldAccessExpr); // isComment isNameExpr.isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr, (isParameter, isParameter) -> isMethod(true)); isNameExpr.isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr, (isParameter, isParameter) -> { isMethod(true); Dialog isVariable = isNameExpr.this.isMethod(); if (isNameExpr != null) { isNameExpr.isMethod(); } }); isNameExpr.isMethod(true); return isNameExpr.isMethod(); } @Thunk void isMethod(final boolean isParameter) { if (!isNameExpr) { if (isNameExpr != null) { isNameExpr.isMethod(true, true); } return; } Bundle isVariable = isMethod(); if (isNameExpr == null) { return; } String isVariable = isNameExpr.isMethod(isNameExpr.isFieldAccessExpr); if (isNameExpr == null) { return; } Session isVariable = isNameExpr.isMethod(isNameExpr, isMethod(), null); isNameExpr.isFieldAccessExpr.isMethod(isNameExpr, true, new ReplyMapReceivedListener() { @Override public void isMethod(String isParameter, Map<?, ?> isParameter) { if (isNameExpr != null) { isNameExpr.isMethod(isNameExpr, true); } } @Override public void isMethod(String isParameter, String isParameter) { if (isNameExpr != null) { isNameExpr.isMethod(true, true); } } @Override public void isMethod(String isParameter, Exception isParameter) { if (isNameExpr != null) { isNameExpr.isMethod(true, true); } } }); } @Override public void isMethod(Context isParameter) { super.isMethod(isNameExpr); if (isNameExpr instanceof DialogFragmentRcmAuthListener) { isNameExpr = (DialogFragmentRcmAuthListener) isNameExpr; } } @Override public void isMethod() { super.isMethod(); AlertDialog isVariable = (AlertDialog) isMethod(); if (isNameExpr == null) { return; } final CheckBox isVariable = isNameExpr.isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr); if (isNameExpr == null) { return; } final Button isVariable = isNameExpr.isMethod(isNameExpr.isFieldAccessExpr); if (isNameExpr == null) { return; } isNameExpr.isMethod(isNameExpr.isMethod()); OnCheckedChangeListener isVariable = (isParameter, isParameter) -> isNameExpr.isMethod(isNameExpr.isMethod()); isNameExpr.isMethod(isNameExpr); } }
[ "matheus@melsolucoes.net" ]
matheus@melsolucoes.net
524cf1e58580fe0d593c8f282084f89e8d395d7a
ebc0ef63003bd87de54d3dfd1d31c8281682a12d
/src/BoxUnboxDemo.java
97119a796b5aefcbd5310d9327aa74e192e06354
[]
no_license
ssiedu/wp-collection-one
da3a58ea48e459996f02606daa61aed9490bf5fc
c17773c9ff8715047d8fc405074ef52ff3a351aa
refs/heads/master
2020-09-03T09:10:42.477589
2019-11-04T06:31:37
2019-11-04T06:31:37
219,432,820
0
0
null
null
null
null
UTF-8
Java
false
false
400
java
import java.util.Stack; public class BoxUnboxDemo { public static void disp(int i) { } public static void show(Object obj) { } public static void main(String[] args) { Integer obj=new Integer(50); disp(obj);//auto-unboxing disp(obj.intValue());//unboxing /*show("abcd"); show(10);//new Integer(10) show(1.23);//new Double(1.23) */ } }
[ "manojs121@rediffmail.com" ]
manojs121@rediffmail.com
4efe09f5bf67966f59cf4504260bd82ab909e4f8
54556275ca0ad0fb4850b92e5921725da73e3473
/src/us/bpsm/edn/parser/Token.java
c9107179297437589391db817deff4dd1a09d022
[]
no_license
xSke/CoreServer
f7ea539617c08e4bd2206f8fa3c13c58dfb76d30
d3655412008da22b58f031f4e7f08a6f6940bf46
refs/heads/master
2020-03-19T02:33:15.256865
2018-05-31T22:00:17
2018-05-31T22:00:17
135,638,686
0
0
null
null
null
null
UTF-8
Java
false
false
277
java
/* * Decompiled with CFR 0_129. */ package us.bpsm.edn.parser; public enum Token { END_OF_INPUT, BEGIN_LIST, END_LIST, BEGIN_VECTOR, END_VECTOR, BEGIN_SET, BEGIN_MAP, END_MAP_OR_SET, NIL, DISCARD; private Token() { } }
[ "voltasalt@gmail.com" ]
voltasalt@gmail.com
1ff3bf88ffdac6da4dd4166518f385a610d8a378
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/XWIKI-13616-3-24-MOEAD-WeightedSum:TestLen:CallDiversity/org/xwiki/mail/internal/DatabaseMailListener_ESTest_scaffolding.java
134cd0582d305476abbedc5e9860e1c3a143a43b
[]
no_license
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
cf118b23ecb87a8bf59643e42f7556b521d1f754
3bb39683f9c343b8ec94890a00b8f260d158dfe3
refs/heads/master
2022-07-29T14:44:00.774547
2020-08-10T15:14:49
2020-08-10T15:14:49
285,804,495
0
0
null
null
null
null
UTF-8
Java
false
false
448
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Wed Apr 08 00:38:15 UTC 2020 */ package org.xwiki.mail.internal; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; @EvoSuiteClassExclude public class DatabaseMailListener_ESTest_scaffolding { // Empty scaffolding for empty test suite }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
7f2b4d81daff5ffa1bc505d2a99f3f3d2ad5d51e
908b9859a4b45dca4d916720122a1b40c0fafe43
/labs/ebms/src/main/java/com/itap/ebms/req/RetrievalMethod.java
b5bec040a744feadafcf37437655a8b9f1155bd2
[]
no_license
mugabarigiraCHUK/scotomax-hman
778a3b48c9ac737414beaee9d72d1138a1e5b1ee
786478731338b5af7a86cada2e4582ddb3b2569f
refs/heads/master
2021-01-10T06:50:26.179698
2012-08-13T16:35:46
2012-08-13T16:35:46
46,422,699
0
0
null
null
null
null
UTF-8
Java
false
false
3,398
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-2 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2010.09.01 at 12:47:28 PM ICT // package com.itap.ebms.req; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for RetrievalMethodType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="RetrievalMethodType"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element ref="{http://www.w3.org/2000/09/xmldsig#}Transforms" minOccurs="0"/> * &lt;/sequence> * &lt;attribute name="URI" type="{http://www.w3.org/2001/XMLSchema}anyURI" /> * &lt;attribute name="Type" type="{http://www.w3.org/2001/XMLSchema}anyURI" /> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "RetrievalMethodType", namespace = "http://www.w3.org/2000/09/xmldsig#", propOrder = { "transforms" }) @XmlRootElement(name = "RetrievalMethod", namespace = "http://www.w3.org/2000/09/xmldsig#") public class RetrievalMethod { @XmlElement(name = "Transforms", namespace = "http://www.w3.org/2000/09/xmldsig#") protected Transforms transforms; @XmlAttribute(name = "URI") @XmlSchemaType(name = "anyURI") protected String uri; @XmlAttribute(name = "Type") @XmlSchemaType(name = "anyURI") protected String type; /** * Gets the value of the transforms property. * * @return * possible object is * {@link Transforms } * */ public Transforms getTransforms() { return transforms; } /** * Sets the value of the transforms property. * * @param value * allowed object is * {@link Transforms } * */ public void setTransforms(Transforms value) { this.transforms = value; } /** * Gets the value of the uri property. * * @return * possible object is * {@link String } * */ public String getURI() { return uri; } /** * Sets the value of the uri property. * * @param value * allowed object is * {@link String } * */ public void setURI(String value) { this.uri = value; } /** * Gets the value of the type property. * * @return * possible object is * {@link String } * */ public String getType() { return type; } /** * Sets the value of the type property. * * @param value * allowed object is * {@link String } * */ public void setType(String value) { this.type = value; } }
[ "developmax@ad344d4b-5b83-fe1d-98cd-db9ebd70f650" ]
developmax@ad344d4b-5b83-fe1d-98cd-db9ebd70f650
52d45fbe2c62380114b652b1d96c9816b58b0725
e36fece780f89f50083b0140dc11b7ee46cd6a6d
/src/main/java/org/jboss/examples/ticketmonster/model/Show.java
5eba0cf89112eba5505540de2cb3394c42776e41
[]
no_license
christian-posta/ticket-monster-orders
6060a448838aea6dc82574338c88c3377244c3eb
25855687feed871bac717c6138f909da1e225d1b
refs/heads/master
2020-05-29T15:42:07.168089
2016-10-17T20:46:00
2016-10-17T20:46:00
60,808,886
3
5
null
null
null
null
UTF-8
Java
false
false
5,504
java
package org.jboss.examples.ticketmonster.model; import javax.persistence.*; import javax.validation.constraints.NotNull; import java.io.Serializable; import java.util.HashSet; import java.util.Set; import static javax.persistence.CascadeType.ALL; import static javax.persistence.FetchType.EAGER; import static javax.persistence.GenerationType.IDENTITY; /** * <p> * A show is an instance of an event taking place at a particular venue. A show can have multiple performances. * </p> * * <p> * A show contains a set of performances, and a set of ticket prices for each section of the venue for this show. * </p> * * <p> * The event and venue form the natural id of this entity, and therefore must be unique. JPA requires us to use the class level * <code>@Table</code> constraint. * </p> * * @author Shane Bryzak * @author Pete Muir */ /* * We suppress the warning about not specifying a serialVersionUID, as we are still developing this app, and want the JVM to * generate the serialVersionUID for us. When we put this app into production, we'll generate and embed the serialVersionUID */ @SuppressWarnings("serial") @Entity @Table(name="Appearance", uniqueConstraints = @UniqueConstraint(columnNames = { "event_id", "venue_id" })) public class Show implements Serializable { /* Declaration of fields */ /** * The synthetic id of the object. */ @Id @GeneratedValue(strategy = IDENTITY) private Long id; /** * <p> * The event of which this show is an instance. The <code>@ManyToOne<code> JPA mapping establishes this relationship. * </p> * * <p> * The <code>@NotNull</code> Bean Validation constraint means that the event must be specified. * </p> */ @NotNull @Embedded private EventId eventId; /** * <p> * The venue where this show takes place. The <code>@ManyToOne<code> JPA mapping establishes this relationship. * </p> * * <p> * The <code>@NotNull</code> Bean Validation constraint means that the venue must be specified. * </p> */ @NotNull @Embedded private VenueId venueId; /** * <p> * The set of performances of this show. * </p> * * <p> * The <code>@OneToMany<code> JPA mapping establishes this relationship. * This relationship is bi-directional (a performance knows which show it is part of), and the <code>mappedBy</code> * attribute establishes this. We cascade all persistence operations to the set of performances, so, for example if a show * is removed, then all of it's performances will also be removed. * </p> * * <p> * Normally a collection is loaded from the database in the order of the rows, but here we want to make sure that * performances are ordered by date - we let the RDBMS do the heavy lifting. The * <code>@OrderBy<code> annotation instructs JPA to do this. * </p> */ @Embedded private Set<PerformanceId> performances = new HashSet<PerformanceId>(); /** * <p> * The set of ticket prices available for this show. * </p> * * <p> * The <code>@OneToMany<code> JPA mapping establishes this relationship. * This relationship is bi-directional (a ticket price category knows which show it is part of), and the <code>mappedBy</code> * attribute establishes this. We cascade all persistence operations to the set of performances, so, for example if a show * is removed, then all of it's ticket price categories are also removed. * </p> */ @OneToMany(mappedBy = "show", cascade = ALL, fetch = EAGER) private Set<TicketPriceGuide> ticketPriceGuides = new HashSet<TicketPriceGuide>(); /* Boilerplate getters and setters */ public Long getId() { return id; } public void setId(Long id) { this.id = id; } public EventId getEventId() { return eventId; } public void setEventId(EventId eventId) { this.eventId = eventId; } public Set<PerformanceId> getPerformances() { return performances; } public void setPerformances(Set<PerformanceId> performances) { this.performances = performances; } public VenueId getVenueId() { return venueId; } public void setVenueId(VenueId venueId) { this.venueId = venueId; } public Set<TicketPriceGuide> getTicketPriceGuides() { return ticketPriceGuides; } public void setTicketPriceGuides(Set<TicketPriceGuide> ticketPriceGuides) { this.ticketPriceGuides = ticketPriceGuides; } /* toString(), equals() and hashCode() for Show, using the natural identity of the object */ @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Show show = (Show) o; if (eventId != null ? !eventId.equals(show.eventId) : show.eventId != null) return false; if (venueId != null ? !venueId.equals(show.venueId) : show.venueId != null) return false; return true; } @Override public int hashCode() { int result = eventId != null ? eventId.hashCode() : 0; result = 31 * result + (venueId != null ? venueId.hashCode() : 0); return result; } @Override public String toString() { return eventId + " at " + venueId; } }
[ "christian.posta@gmail.com" ]
christian.posta@gmail.com
62da429e506385d3b4feaa656a32511eedd43779
4b140e944e450f901a5b3d78685d069f9984b024
/game-server/src/main/java/org/forfun/mmorpg/client/ClientRobot.java
f1807ef567aa9b3526d16c75a680ba557d91678e
[]
no_license
guanweikai/mmorpg
ca808002f1de3b7659f4574c82dfec8e9446dbd1
6030b82176d58acb5d24c3ca064df6652c1e6fe2
refs/heads/master
2021-12-02T00:27:56.637585
2021-06-13T04:40:34
2021-06-13T04:41:23
189,339,392
1
0
null
2019-05-30T03:29:33
2019-05-30T03:29:33
null
UTF-8
Java
false
false
1,140
java
package org.forfun.mmorpg.client; import org.forfun.mmorpg.game.gm.message.ReqGmCommand; import org.forfun.mmorpg.game.player.message.ReqAccountLogin; import org.forfun.mmorpg.game.player.message.ReqCreateNewPlayer; import org.forfun.mmorpg.game.player.message.ReqSelectPlayer; import org.forfun.mmorpg.net.socket.IdSession; public class ClientRobot { public IdSession session; public ClientRobot(IdSession session) { this.session = session; } public void sendGm() { ReqGmCommand req = new ReqGmCommand(); req.setParams("level 99"); session.sendPacket(req); } public void createNew() { ReqCreateNewPlayer req = new ReqCreateNewPlayer(); req.setName("Happy"); session.sendPacket(req); } public void login() { ReqAccountLogin req = new ReqAccountLogin(); req.setPassword("forfun"); req.setAccountId(123L); session.sendPacket(req); } public void selectedPlayer(long playerId) { ReqSelectPlayer req = new ReqSelectPlayer(); req.setPlayerId(playerId); session.sendPacket(req); } }
[ "475139136@qq.com" ]
475139136@qq.com
c3f8829c338a0266a713b0cde48cb7e81f727142
082e26b011e30dc62a62fae95f375e4f87d9e99c
/docs/weixin_7.0.4_source/反编译源码/反混淆后/src/main/java/com/facebook/share/internal/OpenGraphActionDialogFeature.java
1017ac726ae2799d464891849671321d94b00966
[]
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
674
java
package com.facebook.share.internal; import com.facebook.internal.DialogFeature; import com.facebook.internal.NativeProtocol; import com.tencent.matrix.trace.core.AppMethodBeat; public enum OpenGraphActionDialogFeature implements DialogFeature { OG_ACTION_DIALOG(NativeProtocol.PROTOCOL_VERSION_20130618); private int minVersion; static { AppMethodBeat.m2505o(97161); } private OpenGraphActionDialogFeature(int i) { this.minVersion = i; } public final String getAction() { return NativeProtocol.ACTION_OGACTIONPUBLISH_DIALOG; } public final int getMinVersion() { return this.minVersion; } }
[ "alwangsisi@163.com" ]
alwangsisi@163.com
2d28708d6e96ca2c803da574eecd596e21579b40
37ada926aa47787de25cdf81e45dfdc4322c6dc3
/NestedConditionalStatements/src/FruitShop.java
3abcf1700887fcd89f107fde767db8ea0c00620e
[ "MIT" ]
permissive
GavrielDunev/Java-Basics
ead8334f2c67983f0b17aa99877c03df2b963ca7
44f0aec3600b302e2cbc51118b5da9532ec94b51
refs/heads/master
2023-05-05T01:47:19.092084
2021-05-28T14:47:01
2021-05-28T14:47:01
298,680,488
0
0
null
null
null
null
UTF-8
Java
false
false
2,859
java
import java.util.Scanner; public class FruitShop { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String fruit = scanner.nextLine(); String dayOfTheWeek = scanner.nextLine(); double quantity = Double.parseDouble(scanner.nextLine()); double price = 0; if (dayOfTheWeek.equals("Monday") || dayOfTheWeek.equals("Tuesday") || dayOfTheWeek.equals("Wednesday") || dayOfTheWeek.equals("Thursday") || dayOfTheWeek.equals("Friday")) { if (fruit.equals("banana")) { price = 2.50 * quantity; System.out.printf("%.2f", price); } else if (fruit.equals("apple")) { price = 1.20 * quantity; System.out.printf("%.2f", price); } else if (fruit.equals("orange")) { price = 0.85 * quantity; System.out.printf("%.2f", price); } else if (fruit.equals("grapefruit")) { price = 1.45 * quantity; System.out.printf("%.2f", price); } else if (fruit.equals("kiwi")) { price = 2.70 * quantity; System.out.printf("%.2f", price); } else if (fruit.equals("pineapple")) { price = 5.50 * quantity; System.out.printf("%.2f", price); } else if (fruit.equals("grapes")) { price = 3.85 * quantity; System.out.printf("%.2f", price); } else { System.out.println("error"); } } else if (dayOfTheWeek.equals("Saturday") || dayOfTheWeek.equals("Sunday")) { if (fruit.equals("banana")) { price = 2.70 * quantity; System.out.printf("%.2f", price); } else if (fruit.equals("apple")) { price = 1.25 * quantity; System.out.printf("%.2f", price); } else if (fruit.equals("orange")) { price = 0.90 * quantity; System.out.printf("%.2f", price); } else if (fruit.equals("grapefruit")) { price = 1.60 * quantity; System.out.printf("%.2f", price); } else if (fruit.equals("kiwi")) { price = 3.00 * quantity; System.out.printf("%.2f", price); } else if (fruit.equals("pineapple")) { price = 5.60 * quantity; System.out.printf("%.2f", price); } else if (fruit.equals("grapes")) { price = 4.20 * quantity; System.out.printf("%.2f", price); } else { System.out.println("error"); } } else { System.out.println("error"); } } }
[ "dunev17@gmail.com" ]
dunev17@gmail.com
54580136b26b37ed1cb6f0c1de9284e1758e1578
1ed0e7930d6027aa893e1ecd4c5bba79484b7c95
/keiji/source/java/com/vungle/publisher/aci.java
27b49dffb478508d081faf0d20f9333123e417e9
[]
no_license
AnKoushinist/hikaru-bottakuri-slot
36f1821e355a76865057a81221ce2c6f873f04e5
7ed60c6d53086243002785538076478c82616802
refs/heads/master
2021-01-20T05:47:00.966573
2017-08-26T06:58:25
2017-08-26T06:58:25
101,468,394
0
1
null
null
null
null
UTF-8
Java
false
false
874
java
package com.vungle.publisher; import com.vungle.publisher.acf.a; import dagger.MembersInjector; import javax.inject.Provider; /* compiled from: vungle */ public final class aci implements MembersInjector<a> { static final /* synthetic */ boolean a = (!aci.class.desiredAssertionStatus()); private final Provider<acf> b; public final /* synthetic */ void injectMembers(Object obj) { a aVar = (a) obj; if (aVar == null) { throw new NullPointerException("Cannot inject members into a null reference"); } aVar.a = this.b; } private aci(Provider<acf> provider) { if (a || provider != null) { this.b = provider; return; } throw new AssertionError(); } public static MembersInjector<a> a(Provider<acf> provider) { return new aci(provider); } }
[ "09f713c@sigaint.org" ]
09f713c@sigaint.org
557f5051f30f94da4f58b09ff1a48a6fbb9a7def
a83bdda9a6ca8a66db926d2ef175220b74b26ff6
/TangramCourseProject/src/project/controller/CreatePuzzleController.java
05fc83f8db4ef2562588b3e07d6a9e5593b78579
[ "MIT" ]
permissive
NikolayTach/tangram
a3d1c5aabf4a85157ceecc69b6ad941d81d99fa3
56150b757b21f17cbc01c6a87a6fcdfd1e7b0867
refs/heads/master
2020-05-13T18:50:52.673865
2018-06-20T03:32:53
2018-06-20T03:32:53
181,650,823
0
0
MIT
2019-04-16T08:46:55
2019-04-16T08:46:54
null
UTF-8
Java
false
false
821
java
package project.controller; import java.util.*; import project.model.*; import project.view.TangramApplication; /** * Start with empty Solution and allow pieces to be moved onto a new puzzle. * * Puzzle solution is created on the board, and only becomes permanent by saving. */ public class CreatePuzzleController { TangramApplication app; Model model; public static final String CannotCreate = "Unable to create puzzle for pre-loaded set."; public CreatePuzzleController(TangramApplication app, Model model) { this.app = app; this.model = model; } public void create() { Puzzle puzzle = new Puzzle(model.getFactory(), new ArrayList<PlacedPiece>().iterator()); model.setPuzzle(puzzle); app.getPiecesView().refresh(); app.getPuzzleView().refresh(); } }
[ "heineman@cs.wpi.edu" ]
heineman@cs.wpi.edu
08eb984b72a1ca22e11100ac0b9e4970b286408f
fa93c9be2923e697fb8a2066f8fb65c7718cdec7
/sources/kotlin/reflect/jvm/internal/impl/load/java/JvmAbi.java
b710c8a16c87b7f2d7b4b7ea97fb643ea9a43737
[]
no_license
Auch-Auch/avito_source
b6c9f4b0e5c977b36d5fbc88c52f23ff908b7f8b
76fdcc5b7e036c57ecc193e790b0582481768cdc
refs/heads/master
2023-05-06T01:32:43.014668
2021-05-25T10:19:22
2021-05-25T10:19:22
370,650,685
0
0
null
null
null
null
UTF-8
Java
false
false
2,603
java
package kotlin.reflect.jvm.internal.impl.load.java; import kotlin.jvm.JvmField; import kotlin.jvm.JvmStatic; import kotlin.jvm.internal.Intrinsics; import kotlin.reflect.jvm.internal.impl.name.ClassId; import kotlin.reflect.jvm.internal.impl.name.FqName; import kotlin.reflect.jvm.internal.impl.util.capitalizeDecapitalize.CapitalizeDecapitalizeKt; import org.jetbrains.annotations.NotNull; import t6.y.m; public final class JvmAbi { @NotNull public static final JvmAbi INSTANCE = new JvmAbi(); @JvmField @NotNull public static final FqName JVM_FIELD_ANNOTATION_FQ_NAME = new FqName("kotlin.jvm.JvmField"); static { Intrinsics.checkNotNullExpressionValue(ClassId.topLevel(new FqName("kotlin.reflect.jvm.internal.ReflectionFactoryImpl")), "topLevel(FqName(\"kotlin.reflect.jvm.internal.ReflectionFactoryImpl\"))"); } @JvmStatic @NotNull public static final String getterName(@NotNull String str) { Intrinsics.checkNotNullParameter(str, "propertyName"); return startsWithIsPrefix(str) ? str : Intrinsics.stringPlus("get", CapitalizeDecapitalizeKt.capitalizeAsciiOnly(str)); } @JvmStatic public static final boolean isGetterName(@NotNull String str) { Intrinsics.checkNotNullParameter(str, "name"); return m.startsWith$default(str, "get", false, 2, null) || m.startsWith$default(str, "is", false, 2, null); } @JvmStatic public static final boolean isSetterName(@NotNull String str) { Intrinsics.checkNotNullParameter(str, "name"); return m.startsWith$default(str, "set", false, 2, null); } @JvmStatic @NotNull public static final String setterName(@NotNull String str) { String str2; Intrinsics.checkNotNullParameter(str, "propertyName"); if (startsWithIsPrefix(str)) { str2 = str.substring(2); Intrinsics.checkNotNullExpressionValue(str2, "(this as java.lang.String).substring(startIndex)"); } else { str2 = CapitalizeDecapitalizeKt.capitalizeAsciiOnly(str); } return Intrinsics.stringPlus("set", str2); } @JvmStatic public static final boolean startsWithIsPrefix(@NotNull String str) { Intrinsics.checkNotNullParameter(str, "name"); if (!m.startsWith$default(str, "is", false, 2, null) || str.length() == 2) { return false; } char charAt = str.charAt(2); if (Intrinsics.compare(97, (int) charAt) > 0 || Intrinsics.compare((int) charAt, 122) > 0) { return true; } return false; } }
[ "auchhunter@gmail.com" ]
auchhunter@gmail.com
32fb92072e9e60c65e3bacbd0f7e5c967ff806a4
d3a53d5211d5f9fb3a4d761ab5a02a2a8cac73a5
/star/md-tools/StarAgentMD-new-final/trunk/src/main/qysoft/md/service/RealTimePriceService.java
e0cf077b5ab718b7077addfe48e3e8d5ec18607c
[]
no_license
myCodeCang/starMan
bfdfd01de45b64d503fcdda167a09dc347fb52e1
25a076268ddd3a5d6674ced27e12589b195f4efb
refs/heads/master
2020-03-11T01:08:10.783158
2018-04-16T06:09:44
2018-04-16T06:10:00
129,682,396
0
0
null
null
null
null
UTF-8
Java
false
false
831
java
package main.qysoft.md.service; import main.qysoft.md.dao.RealTimePriceRepository; import main.qysoft.md.entity.RealTimePrice; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; /** * Created by kevin on 2017/11/3. */ @Service @Transactional(readOnly = false, propagation = Propagation.REQUIRED, rollbackForClassName = {"RuntimeException", "Exception"}) public class RealTimePriceService { @Autowired RealTimePriceRepository realTimePriceRepository; public void save(RealTimePrice realTimePrice) { if (null == realTimePrice) { return; } realTimePriceRepository.save(realTimePrice); } }
[ "1193983973@qq.com" ]
1193983973@qq.com
e590cb3d493bc415fa92f6506f443d982392d9e4
f72c5c691cb38114393ac5d06bc9d5e8194bdeb6
/java2016/src/T17/FieldApp.java
ffac1d1fb6ac3c4ec2ac4dff61277e34ac89dd95
[]
no_license
ZedZhouZiBin/Javaweb
a3cb6a47c99b2f5fd6766b5579ad4f2e5c55cae8
0169feedc23522e27e7c4448a87846515b59c369
refs/heads/master
2021-09-09T13:03:36.237337
2018-03-16T11:49:54
2018-03-16T11:49:54
null
0
0
null
null
null
null
UTF-8
Java
false
false
854
java
package T17; import java.lang.reflect.*; public class FieldApp { public FieldApp(){ } public String getFields(Class c){ StringBuffer buf = new StringBuffer (); Field[] fields = c.getDeclaredFields(); //遍历属性,提取属性信息 Field f = null; for(int i=0;i<fields.length;i++){ f = fields[i]; //获取属性的访问修饰符 buf.append(Modifier.toString(f.getModifiers())).append(" "); //获取属性的类型 Class type = f.getType(); buf.append(type.getName()).append(" "); // 获取属性名 buf.append(f.getName()).append(";\n"); } return buf.toString(); } public static void main(String[] args) throws Exception { Class c = Class.forName("java.awt.Button"); FieldApp field = new FieldApp(); String str = field.getFields(c); System.out.println(str); } }
[ "1729340612@qq.com" ]
1729340612@qq.com
f5fde9f916489147b9ec9f852c81df7e03e25cbc
c707eb6659749bf99bd18bc48583e4260fc0b1a4
/app/src/main/java/com/loosoo100/campus100/anyevent/MEventStoreIsPay.java
0063ffbbc3d5612b29def3485474dae5e5a5d0b9
[]
no_license
HJianFei/campus
53fc6b823d3226e4201a6c0004d884ae082274a7
b06bb5c460d9d12c37d40e9e649441cf11b4d6a4
refs/heads/master
2020-12-02T19:20:21.284312
2017-07-23T02:49:44
2017-07-23T02:49:44
96,326,458
0
0
null
null
null
null
UTF-8
Java
false
false
281
java
package com.loosoo100.campus100.anyevent; /** * 小卖部订单付款 * * @author yang * */ public class MEventStoreIsPay { private int position; public MEventStoreIsPay(int position) { this.position = position; } public int getPosition() { return position; } }
[ "190766172@qq.com" ]
190766172@qq.com
55b2625862e39b4622952e8a2cb7c9851e60a275
14970ee11e71b839ba2c86e1ce65e344de28325c
/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/rules/UntilValidator.java
e80cf0f70eb82d0765a90249847f78ade54c086f
[ "Apache-2.0", "EPL-1.0" ]
permissive
wso2/devstudio-tooling-bps
e300529639e22fd430612601d7d76b9a9bd56dd0
5a5d080d94bb30ac6a5fb404c2a6b989653cc78d
refs/heads/master
2023-06-28T18:29:45.578389
2021-01-04T06:46:48
2021-01-04T06:46:48
53,044,989
34
19
Apache-2.0
2021-01-04T06:46:49
2016-03-03T11:23:24
Java
UTF-8
Java
false
false
1,207
java
/******************************************************************************* * Copyright (c) 2006 Oracle 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: * Oracle Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.bpel.validator.rules; import org.eclipse.bpel.validator.model.IFilter; import org.eclipse.bpel.validator.model.INode; import org.eclipse.bpel.validator.model.NodeNameFilter; /** * @author Michal Chmielewski (michal.chmielewski@oracle.com) * @date Dec 7, 2006 * */ public class UntilValidator extends ConditionValidator { /** * Our parent nodes. */ @SuppressWarnings("hiding") static public IFilter<INode> PARENTS = new NodeNameFilter( ND_WAIT , ND_ON_ALARM ); /** (non-Javadoc) * @see org.eclipse.bpel.validator.rules.ConditionValidator#start() */ @Override protected void start() { super.start(); } }
[ "mail.hasitha27@gmail.com" ]
mail.hasitha27@gmail.com
7660896b16eaa853acf5f9502d9bcbaa0b9fa632
fce7410ed7cdfa279f2963b63edff8d5faab295a
/BroadcastReceiver4/app/src/androidTest/java/com/example/ujjwalsmahapatra/broadcastreceiver4/ExampleInstrumentedTest.java
16db14a05d7030e16033d03bbfcfa5256b7e4e6d
[]
no_license
usmahapatra/First-Android-Apps
f3f4d163fffbdfa157e9f70e4264a5f73444063d
0c91cb43a95a2cdd8f02846b82a50c288dcca8f0
refs/heads/master
2020-03-11T23:28:41.251337
2019-05-08T12:37:44
2019-05-08T12:37:44
130,322,712
0
0
null
null
null
null
UTF-8
Java
false
false
778
java
package com.example.ujjwalsmahapatra.broadcastreceiver4; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.example.ujjwalsmahapatra.broadcastreceiver4", appContext.getPackageName()); } }
[ "usmahapatra@gmail.com" ]
usmahapatra@gmail.com
3f5a9453a36720635d310cd3aa74a263aecbae02
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/20/20_638bcf94e53a2273145ad7685d5fbad9a98bcd8d/LineMnvr/20_638bcf94e53a2273145ad7685d5fbad9a98bcd8d_LineMnvr_t.java
9d050faf49b72a76e39c3a617cda6cdd092e70dc
[]
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,928
java
package com.deev.interaction.uav3i.ui; import java.awt.BasicStroke; import java.awt.Color; import java.awt.Graphics2D; import java.awt.Point; import java.awt.geom.AffineTransform; import java.awt.geom.Area; import java.awt.geom.Ellipse2D; import java.awt.geom.GeneralPath; import java.awt.geom.Line2D; import java.awt.geom.Point2D; import java.awt.geom.Rectangle2D; import uk.me.jstott.jcoord.LatLng; public class LineMnvr extends Manoeuver { // Points de la zone à regarder private LatLng _A, _B; private SymbolMap _smap; // Distance entre la zone à regarder et la trajectoire private double _currentRm = 500.; private double _lastRm; // Codage de l'orientation de la droite dans le plan ? private Point2D.Double _u, _v; static double RPX = 10.; private enum LineMnvrMoveStates {NONE, TRANSLATE, FULL}; private LineMnvrMoveStates _moveState = LineMnvrMoveStates.NONE; private Object _touchOne; private Object _touchTwo; private Point2D.Double _uvOne; private Point2D.Double _uvTwo; private Point2D.Double _offsetA; private Point2D.Double _offsetB; private Point2D.Double _lastPosOne; private Point2D.Double _lastPosTwo; /** * @param map * @param xA Point A x-coordinate (screen) * @param yA Point A y-coordinate (screen) * @param xB Point B x-coordinate (screen) * @param yB Point B y-coordinate (screen) */ public LineMnvr(SymbolMap map, double xA, double yA, double xB, double yB) { _A = map.getLatLngForScreen(xA, yA); _B = map.getLatLngForScreen(xB, yB); _smap = map; double d = Point2D.Double.distance(xA, yA, xB, yB); _u = new Point2D.Double((xB-xA)/d, (yB-yA)/d); _v = new Point2D.Double(-_u.y, _u.x); } public LineMnvr(SymbolMap map, LatLng A, LatLng B) { Point2D.Double a = map.getScreenForLatLng(A); Point2D.Double b = map.getScreenForLatLng(B); _A = A; _B = B; _smap = map; double d = a.distance(b); _u = new Point2D.Double((b.x-a.x)/d, (b.y-a.y)/d); _v = new Point2D.Double(-_u.y, _u.x); } @Override public void paint(Graphics2D g2) { AffineTransform old = g2.getTransform(); Point2D.Double Apx = _smap.getScreenForLatLng(_A); Point2D.Double Bpx = _smap.getScreenForLatLng(_B); Area area = new Area(); BasicStroke stroke = new BasicStroke((float) RPX*2.f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER); // Zone à regarder : ligne rouge GeneralPath line; line = new GeneralPath(); line.moveTo(Apx.x, Apx.y); line.lineTo(Bpx.x, Bpx.y); area.add(new Area(stroke.createStrokedShape(line))); g2.setStroke(new BasicStroke(4.f)); g2.setPaint(new Color(1.0f, 0.f, 0.f, 1.0f)); g2.draw(area); g2.setPaint(new Color(1.0f, 0.1f, 0.1f, 0.2f)); g2.fill(area); g2.setStroke(new BasicStroke(4.f)); g2.setPaint(new Color(0.0f, 0.f, 1.0f, 1.0f)); double Rpx = _smap.getPPM() * _currentRm; Point2D.Double LApx = new Point2D.Double(Apx.x + _v.x * Rpx, Apx.y + _v.y * Rpx); Point2D.Double LBpx = new Point2D.Double(Bpx.x + _v.x * Rpx, Bpx.y + _v.y * Rpx); // Trajectoire du drone : ligne bleue Line2D.Double l = new Line2D.Double(LApx, LBpx); g2.setStroke(new BasicStroke(2.f*(float)GRIP)); if (!_adjusting) g2.setPaint(new Color(1.0f, 1.0f, 1.0f, 0.3f)); else g2.setPaint(new Color(1.0f, 1.0f, 0.7f, 0.3f)); g2.draw(l); g2.setStroke(new BasicStroke(4.f)); g2.setPaint(new Color(0.0f, 0.f, 1.0f, 1.0f)); g2.draw(l); g2.setTransform(old); } private Point2D.Double getUVforPx(double x, double y) { Point2D.Double Apx = _smap.getScreenForLatLng(_A); double X = x-Apx.x; double Y = y-Apx.y; return new Point2D.Double(X*_u.x + Y*_u.y, X*_v.x + Y*_v.y); } @Override public boolean adjustAtPx(double x, double y) { // x,y : coordonnée du toucher écran // On projette tout en screen // Coordonnées écran des deux points (zone rouge) Point2D.Double Apx = _smap.getScreenForLatLng(_A); Point2D.Double Bpx = _smap.getScreenForLatLng(_B); // Parallélisme avec la zone à regarder Point2D.Double p = getUVforPx(x, y); double u = p.x; double v = p.y; double currentRpx = _currentRm * _smap.getPPM(); double lastRpx = _lastRm * _smap.getPPM(); if (_adjusting) { currentRpx += v - lastRpx; lastRpx = v; _currentRm = currentRpx / _smap.getPPM(); _lastRm = lastRpx / _smap.getPPM(); return true; } if (isAdjustmentInterestedAtPx(x, y)) { lastRpx = v; _adjusting = true; } _currentRm = currentRpx / _smap.getPPM(); _lastRm = lastRpx / _smap.getPPM(); return _adjusting; } public boolean isAdjustmentInterestedAtPx(double x, double y) { // On projette tout en screen Point2D.Double Apx = _smap.getScreenForLatLng(_A); Point2D.Double Bpx = _smap.getScreenForLatLng(_B); double X = x-Apx.x; double Y = y-Apx.y; double u = X*_u.x + Y*_u.y; double v = X*_v.x + Y*_v.y; double currentRpx = _currentRm * _smap.getPPM(); return v > currentRpx-GRIP && v < currentRpx+GRIP && u > -GRIP && u < Apx.distance(Bpx)+GRIP; } /** * Getter pour le point A de la trajectoire du drone (et non de la zone à regarder). * * @return coordonnée en {@link LatLng} du point. */ public LatLng getTrajA() { double Rpx = _smap.getPPM() * _currentRm; Point2D.Double Apx = _smap.getScreenForLatLng(_A); Point2D.Double LApx = new Point2D.Double(Apx.x + _v.x * Rpx, Apx.y + _v.y * Rpx); return _smap.getLatLngForScreen(LApx.x, LApx.y); } /** * Getter pour le point B de la trajectoire du drone (et non de la zone à regarder). * * @return coordonnée en {@link LatLng} du point. */ public LatLng getTrajB() { double Rpx = _smap.getPPM() * _currentRm; Point2D.Double Bpx = _smap.getScreenForLatLng(_B); Point2D.Double LBpx = new Point2D.Double(Bpx.x + _v.x * Rpx, Bpx.y + _v.y * Rpx); return _smap.getLatLngForScreen(LBpx.x, LBpx.y); } @Override public float getInterestForPoint(float x, float y) { if (_moveState == LineMnvrMoveStates.FULL) return -1.f; // On projette tout en screen Point2D.Double Apx = _smap.getScreenForLatLng(_A); Point2D.Double Bpx = _smap.getScreenForLatLng(_B); double X = x-Apx.x; double Y = y-Apx.y; double u = X*_u.x + Y*_u.y; double v = X*_v.x + Y*_v.y; if (v > -2*RPX && v < 2*RPX && u > -2*RPX && u < Apx.distance(Bpx)+2*RPX) return Manoeuver.MOVE_INTEREST; else return -1.f; } @Override public void addTouch(float x, float y, Object touchref) { switch (_moveState) { case FULL: return; case TRANSLATE: _touchTwo = touchref; _lastPosTwo = new Point2D.Double(x, y); _moveState = LineMnvrMoveStates.FULL; return; case NONE: _touchOne = touchref; Point2D.Double pA = _smap.getScreenForLatLng(_A); _offsetA = new Point2D.Double(x-pA.x, y-pA.y); Point2D.Double pB = _smap.getScreenForLatLng(_B); _offsetB = new Point2D.Double(x-pB.x, y-pB.y); _moveState = LineMnvrMoveStates.TRANSLATE; return; default: return; } } @Override public void updateTouch(float x, float y, Object touchref) { if (touchref != _touchOne && touchref != _touchTwo) return; switch (_moveState) { case FULL: return; case TRANSLATE: if (touchref == _touchOne) { _A = _smap.getLatLngForScreen(x-_offsetA.x, y-_offsetA.y); _B = _smap.getLatLngForScreen(x-_offsetB.x, y-_offsetB.y); } return; case NONE: default: return; } } @Override public void removeTouch(float x, float y, Object touchref) { _moveState = LineMnvrMoveStates.NONE; } @Override public void cancelTouch(Object touchref) { // TODO Auto-generated method stub } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
5dc6c7a3c9a0f33fa78dd544be9507c0b2d290bd
3e25e0529f66ef5264791925c919901070397e1e
/src/main/java/za/co/tman/logging/enums/enumwrappers/PubSubMessageTypeSerializer.java
6c124bc6879f91977858cb63903cc2c004b2b9c8
[]
no_license
kappaj2/IMN-LoggingModule
c7b97ab2a676a68acb81d079ee5d1cd7b72a238e
b4fcac50b30015c90e6d2edfb35e4f1915da4c96
refs/heads/master
2020-03-20T22:39:03.338726
2018-07-23T13:16:26
2018-07-23T13:16:26
137,808,446
0
0
null
null
null
null
UTF-8
Java
false
false
1,018
java
package za.co.tman.logging.enums.enumwrappers; import java.io.IOException; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.ser.std.StdSerializer; import za.co.tman.logging.enums.PubSubMessageType; public class PubSubMessageTypeSerializer extends StdSerializer<PubSubMessageType> { public PubSubMessageTypeSerializer() { super(PubSubMessageType.class); } @Override public void serialize(PubSubMessageType value, JsonGenerator gen, SerializerProvider serializers) throws IOException { gen.writeStartObject(); gen.writeFieldName("message_type_code"); gen.writeString(value.getMessageTypeCode()); gen.writeFieldName("message_type_description"); gen.writeString(value.getMessageTypeDescription()); gen.writeEndObject(); } }
[ "kappaj@gmail.com" ]
kappaj@gmail.com
22558fbe70da54c75182b5f0375ca0675e677440
13173517a28871029fa7b57ded8145b5b9972022
/src/main/java/acme/tests/chapter15/test25/Example.java
9c016a11da56e42047e340cea9bcd57f29e345ef
[]
no_license
dbelob/ocp-jse8
9001d1833d7bb7e8c874ae7c56b62602d7d1979c
3c8496833c3023c16d28d56020df6c8f2afd934e
refs/heads/master
2021-06-22T22:33:38.232484
2020-12-20T17:16:04
2020-12-20T17:16:04
161,197,521
1
2
null
null
null
null
UTF-8
Java
false
false
364
java
package acme.tests.chapter15.test25; import java.util.stream.IntStream; import java.util.stream.Stream; public class Example { public static void main(String[] args) { IntStream ints = IntStream.empty(); IntStream moreInts = IntStream.of(66, 77, 88); Stream.of(ints, moreInts).flatMapToInt(x -> x).forEach(System.out::print); } }
[ "dbelob@users.noreply.github.com" ]
dbelob@users.noreply.github.com
291b581c549a539de89fb32c9bc3369dcc1e29c4
9560c3b8ba825f49c1e9b8440b7905cfe9c7ef78
/module-examples/commchannel/demo/src/main/java/org/incode/example/commchannel/demo/shared/fixture/CommChannelCustomerData.java
45d7bbd56ee450c1bb4504f74f2f37eedd7ea05d
[ "Apache-2.0" ]
permissive
incodehq/incode-examples
756e447a7ac2f84a750571548aed85eb133f8f28
911497115d5d049ea1edd3f703c0ccd052db5f9c
refs/heads/master
2020-03-26T16:35:38.058452
2018-08-22T08:13:36
2018-08-22T08:13:36
145,111,756
1
0
null
null
null
null
UTF-8
Java
false
false
1,483
java
package org.incode.example.commchannel.demo.shared.fixture; import org.apache.isis.applib.annotation.Programmatic; import org.apache.isis.applib.services.registry.ServiceRegistry2; import org.incode.example.commchannel.demo.shared.dom.CommChannelCustomer; import org.incode.module.fixturesupport.dom.data.DemoData; import org.incode.module.fixturesupport.dom.data.DemoDataPersistAbstract; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.experimental.Accessors; @AllArgsConstructor @Getter @Accessors(chain = true) public enum CommChannelCustomerData implements DemoData<CommChannelCustomerData, CommChannelCustomer> { Foo("Foo"), Bar("Bar"), Baz("Baz"), Foz("Foz"), ; private final String name; @Programmatic public CommChannelCustomer asDomainObject() { return CommChannelCustomer.builder() .name(name) .build(); } @Programmatic public CommChannelCustomer persistUsing(final ServiceRegistry2 serviceRegistry) { return Util.persist(this, serviceRegistry); } @Programmatic public CommChannelCustomer findUsing(final ServiceRegistry2 serviceRegistry) { return Util.firstMatch(this, serviceRegistry); } public static class PersistScript extends DemoDataPersistAbstract<PersistScript, CommChannelCustomerData, CommChannelCustomer> { public PersistScript() { super(CommChannelCustomerData.class); } } }
[ "dan@haywood-associates.co.uk" ]
dan@haywood-associates.co.uk
b41c5fcbdf4fe7cbf297407062b7588bd9989e82
cca87c4ade972a682c9bf0663ffdf21232c9b857
/com/tencent/mm/ui/widget/h.java
5d5de2a7187498407c477a2060deef0f3992fcd6
[]
no_license
ZoranLi/wechat_reversing
b246d43f7c2d7beb00a339e2f825fcb127e0d1a1
36b10ef49d2c75d69e3c8fdd5b1ea3baa2bba49a
refs/heads/master
2021-07-05T01:17:20.533427
2017-09-25T09:07:33
2017-09-25T09:07:33
104,726,592
12
1
null
null
null
null
UTF-8
Java
false
false
392
java
package com.tencent.mm.ui.widget; import android.text.Editable; import android.text.TextWatcher; public abstract class h implements TextWatcher { public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) { } public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) { } public void afterTextChanged(Editable editable) { } }
[ "lizhangliao@xiaohongchun.com" ]
lizhangliao@xiaohongchun.com
2a69b137ea2e21088c57b45ce5da9b6bc73fc53e
aa5f25d714519ccfda2a89f382dfcefe1b3642fc
/trunk/dmisArea/src/com/techstar/dmis/service/workflow/handler/DDMonthPlanSentApprove.java
e55fde5404f5955058006a78bb38271f90cea046
[]
no_license
BGCX261/zhouwei-repository-svn-to-git
2b85060757568fadc0d45b526e2546ed1965d48a
cd7f50db245727418d5f1c0061681c11703d073e
refs/heads/master
2021-01-23T03:44:27.914196
2015-08-25T15:45:29
2015-08-25T15:45:29
41,599,666
0
0
null
null
null
null
WINDOWS-1252
Java
false
false
4,403
java
// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html // Decompiler options: packimports(3) fieldsfirst ansi // Source File Name: DDMonthPlanSentApprove.java package com.techstar.dmis.service.workflow.handler; import com.techstar.dmis.common.DispatchConstants; import com.techstar.dmis.dto.DdMoutageplanDto; import com.techstar.dmis.service.IDdMoutageplanService; import com.techstar.dmis.service.ServiceLocator; import com.techstar.dmis.util.DateUtil; import com.techstar.exchange.dto.control.ControlDto; import com.techstar.exchange.dto.control.RecvDto; import com.techstar.exchange.service.IexchangeService; import com.techstar.exchange.service.impl.ExchangeServiceImpl; import com.techstar.exchange.transfers.utils.MessageConfig; import com.techstar.framework.service.workflow.IAction; import java.io.PrintStream; import java.sql.*; import java.util.*; import org.apache.commons.lang.time.StopWatch; import org.jbpm.JbpmContext; import org.jbpm.context.exe.ContextInstance; import org.jbpm.graph.exe.ExecutionContext; import org.jbpm.graph.exe.ProcessInstance; import org.jbpm.taskmgmt.exe.TaskInstance; import org.jbpm.taskmgmt.exe.TaskMgmtInstance; public class DDMonthPlanSentApprove implements IAction { public DDMonthPlanSentApprove() { } public void execute(ExecutionContext arg0) throws Exception { String busId = (String)arg0.getContextInstance().getVariable("businessId"); sendMessage(arg0, busId); String flag = ""; String SQL = "UPDATE DMIS_DD_MOUTAGEPLAN d SET d.fstatus='" + DispatchConstants.ddMoutageplan_WORKFLOW_STATUS_end + "',d.fexcutestatus='" + DispatchConstants.ddMoutageplan_approveed_approveed_no + "' where d.FMONTHPLANNO='" + busId + "'"; System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&" + SQL); Connection connection = arg0.getJbpmContext().getConnection(); Statement statement = connection.createStatement(); statement.executeUpdate(SQL); statement.close(); arg0.leaveNode(); } private void sendMessage(ExecutionContext arg0, String busid) throws Exception { String provider_url = MessageConfig.getValue("JNDI_PROVIDER_URL"); String local_node = MessageConfig.getValue("LOCAL_NODE"); String recv_queues = MessageConfig.getValue("RECV_QUEUE"); String modules = MessageConfig.getValue("MODULE"); String transDtoPackage = MessageConfig.getValue("transDtoPackage"); String bussDtoPackage = MessageConfig.getValue("bussDtoPackage"); String mappingFileHome = MessageConfig.getValue("mappingFileHome"); ControlDto controlDto = new ControlDto(); controlDto.setFrom(local_node); controlDto.setBussinessSign("DdMoutageplan"); Collection taskInstances = arg0.getContextInstance().getProcessInstance().getTaskMgmtInstance().getTaskInstances(); TaskInstance taskinstance = (TaskInstance)taskInstances.iterator().next(); controlDto.setNotifyContent(""); controlDto.setAreaTaskId(Long.toString(taskinstance.getId())); controlDto.setType("3"); controlDto.setContentVersion(""); controlDto.setIsTrigger("1"); controlDto.setObjectName("iDdMoutageplanService"); controlDto.setMethodName("recBussDataWaiting"); controlDto.setTraceNumber(""); Timestamp sendTime = DateUtil.getCurrentTimestamp(); controlDto.setSendTime(sendTime.toString()); controlDto.setRecvTime(""); RecvDto rdto = new RecvDto(); IexchangeService service = new ExchangeServiceImpl(); StopWatch stopwatch = new StopWatch(); stopwatch.start(); IDdMoutageplanService ddMService = (IDdMoutageplanService)ServiceLocator.getInstance().getService("iDdMoutageplanService"); DdMoutageplanDto ddMoutageplanDto = ddMService.loadDdMoutageplan(busid); rdto.setTo(ddMoutageplanDto.getSys_dataowner()); List recvDtos = new ArrayList(); recvDtos.add(rdto); controlDto.setRecvDtos(recvDtos); service.sendMessage(controlDto, ddMoutageplanDto); stopwatch.stop(); System.out.println("·¢ËͺÄʱ: " + stopwatch.getTime()); } }
[ "you@example.com" ]
you@example.com
ba4cc1f80b432eda0f8c8f5627602287f9be9004
13ec21dc59ac25278566638ca4b8476e13795d1d
/src/main/java/net/darkhax/lootchests/tabs/CreativeTabLoot.java
4557b481bc6c00ad3c94078e6a752188e3c885d0
[ "MIT" ]
permissive
Darkhax-Minecraft/LootChests
e23376f780d2920ddc8af7adae24acf141962395
77792f8981853b6260909e3f3dab3988cfb46f52
refs/heads/master
2021-01-11T00:21:11.905027
2016-10-13T14:52:16
2016-10-13T14:52:16
70,544,141
1
0
MIT
2018-10-10T08:01:09
2016-10-11T01:33:49
Java
UTF-8
Java
false
false
1,140
java
package net.darkhax.lootchests.tabs; import java.util.ArrayList; import java.util.List; import net.darkhax.lootchests.handler.LootHandler; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; public class CreativeTabLoot extends CreativeTabs { private static List<ItemStack> cache = new ArrayList<>(); public CreativeTabLoot() { super("lootchests"); this.setBackgroundImageName("item_search.png"); } @Override public Item getTabIconItem () { return Items.SKULL; } @Override public ItemStack getIconItemStack () { return new ItemStack(Blocks.CHEST, 1, 0); } @Override public boolean hasSearchBar () { return true; } @Override public void displayAllRelevantItems (List<ItemStack> itemList) { if (LootHandler.isDirty) LootHandler.buildItemList(); itemList.addAll(LootHandler.itemList); } }
[ "darklime@live.ca" ]
darklime@live.ca
75838df5e2185b1d56215242ecef100e76b2eb2c
6847722d0479548b4069fba18c00358e3ad14676
/WCCI/src/it/unimi/dsi/fastutil/objects/ObjectCollection.java
084a1ffcd2cfa3bf1ae5e3810cd3fd0978800655
[]
no_license
sfbaqai/racingcar
90de325ac107f86f7ae862b77e3d132adf721814
3b72cfb5b8b49c6683358469cdd52ec073c9b156
refs/heads/master
2021-01-10T04:15:03.318224
2011-10-12T10:07:07
2011-10-12T10:07:07
48,247,283
0
0
null
null
null
null
UTF-8
Java
false
false
3,381
java
/* Generic definitions */ /* Assertions (useful to generate conditional code) */ /* Current type and class (and size, if applicable) */ /* Value methods */ /* Interfaces (keys) */ /* Interfaces (values) */ /* Abstract implementations (keys) */ /* Abstract implementations (values) */ /* Static containers (keys) */ /* Static containers (values) */ /* Implementations */ /* Synchronized wrappers */ /* Unmodifiable wrappers */ /* Other wrappers */ /* Methods (keys) */ /* Methods (values) */ /* Methods (keys/values) */ /* Methods that have special names depending on keys (but the special names depend on values) */ /* Equality */ /* Object/Reference-only definitions (keys) */ /* Object/Reference-only definitions (values) */ /* * fastutil: Fast & compact type-specific collections for Java * * Copyright (C) 2002-2008 Sebastiano Vigna * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ package it.unimi.dsi.fastutil.objects; import java.util.Collection; /** A type-specific {@link Collection}; provides some additional methods * that use polymorphism to avoid (un)boxing. * * <P>Additionally, this class defines strengthens (again) {@link #iterator()} and defines * a slightly different semantics for {@link #toArray(Object[])}. * * @see Collection */ public interface ObjectCollection <K> extends Collection<K>, ObjectIterable <K> { /** Returns a type-specific iterator on the elements of this collection. * * <p>Note that this specification strengthens the one given in * {@link java.lang.Iterable#iterator()}, which was already * strengthened in the corresponding type-specific class, * but was weakened by the fact that this interface extends {@link Collection}. * * @return a type-specific iterator on the elements of this collection. */ ObjectIterator <K> iterator(); /** Returns a type-specific iterator on this elements of this collection. * * @see #iterator() * @deprecated As of <code>fastutil</code> 5, replaced by {@link #iterator()}. */ @Deprecated ObjectIterator <K> objectIterator(); /** Returns an containing the items of this collection; * the runtime type of the returned array is that of the specified array. * * <p><strong>Warning</strong>: Note that, contrarily to {@link Collection#toArray(Object[])}, this * methods just writes all elements of this collection: no special * value will be added after the last one. * * @param a if this array is big enough, it will be used to store this collection. * @return a primitive type array containing the items of this collection. * @see Collection#toArray(Object[]) */ <T> T[] toArray(T[] a); }
[ "ducthangho@dc7059a3-8d4d-0410-a780-f9787e1663d2" ]
ducthangho@dc7059a3-8d4d-0410-a780-f9787e1663d2
15f940f33369a6383901cb669452039133ad5913
4b5536de704f4e3886476073ba7fc22c38f017bd
/src/com/nvapp/comic/service/AppUpdateService.java
810cee58dea9f91e9ef6befe6d88217a9fda1e82
[ "Apache-2.0" ]
permissive
LexlooWorks/Comic
4145c2d05be063a1862ba82a48a6a875d947d5d3
70bce15b62a46b96afe10b1b55dbed1f00abcb73
refs/heads/master
2021-01-10T16:55:52.432148
2015-12-26T14:54:12
2015-12-26T14:54:12
47,498,752
0
0
null
null
null
null
UTF-8
Java
false
false
7,044
java
package com.nvapp.comic.service; import java.io.File; import java.io.FileOutputStream; import java.io.InputStream; import java.net.HttpURLConnection; import java.net.URL; import com.nvapp.comic.MainActivity; import com.nvapp.comic.R; import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; import android.app.Service; import android.content.Intent; import android.net.Uri; import android.os.Environment; import android.os.Handler; import android.os.IBinder; import android.os.Message; import android.widget.RemoteViews; public class AppUpdateService extends Service { public static final String saveFileName = Environment.getExternalStorageDirectory().getPath() + "compic.apk"; // 标题 private int titleId = 0; // 文件存储 private File updateDir = null; private File updateFile = null; // 下载状态 private final static int DOWNLOAD_COMPLETE = 0; private final static int DOWNLOAD_FAIL = 1; // 通知栏 private NotificationManager updateNotificationManager = null; private Notification updateNotification = null; // 通知栏跳转Intent private Intent updateIntent = null; private PendingIntent updatePendingIntent = null; /*** * 创建通知栏 */ RemoteViews contentView; // 这样的下载代码很多,我就不做过多的说明 int downloadCount = 0; int currentSize = 0; long totalSize = 0; int updateTotalSize = 0; // 在onStartCommand()方法中准备相关的下载工作: @Override public int onStartCommand(Intent intent, int flags, int startId) { // 获取传值 titleId = intent.getIntExtra("titleId", 0); // 创建文件 if (android.os.Environment.MEDIA_MOUNTED.equals(android.os.Environment.getExternalStorageState())) { updateDir = new File(Environment.getExternalStorageDirectory(), saveFileName); updateFile = new File(updateDir.getPath(), getResources().getString(titleId) + ".apk"); } this.updateNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); this.updateNotification = new Notification(); // 设置下载过程中,点击通知栏,回到主界面 updateIntent = new Intent(this, MainActivity.class); updatePendingIntent = PendingIntent.getActivity(this, 0, updateIntent, 0); // 设置通知栏显示内容 updateNotification.icon = R.drawable.ic_launcher; updateNotification.tickerText = "开始下载"; updateNotification.setLatestEventInfo(this, "指读", "0%", updatePendingIntent); // 发出通知 updateNotificationManager.notify(0, updateNotification); // 开启一个新的线程下载,如果使用Service同步下载,会导致ANR问题,Service本身也会阻塞 new Thread(new updateRunnable()).start();// 这个是下载的重点,是下载的过程 return super.onStartCommand(intent, flags, startId); } @Override public IBinder onBind(Intent arg0) { // TODO Auto-generated method stub return null; } private Handler updateHandler = new Handler() { @Override public void handleMessage(Message msg) { switch (msg.what) { case DOWNLOAD_COMPLETE: // 点击安装PendingIntent Uri uri = Uri.fromFile(updateFile); Intent installIntent = new Intent(Intent.ACTION_VIEW); installIntent.setDataAndType(uri, "application/vnd.android.package-archive"); updatePendingIntent = PendingIntent.getActivity(AppUpdateService.this, 0, installIntent, 0); updateNotification.defaults = Notification.DEFAULT_SOUND;// 铃声提醒 updateNotification.setLatestEventInfo(AppUpdateService.this, "指读", "下载完成,点击安装。", updatePendingIntent); updateNotificationManager.notify(0, updateNotification); // 停止服务 stopService(updateIntent); case DOWNLOAD_FAIL: // 下载失败 updateNotification.setLatestEventInfo(AppUpdateService.this, "指读", "下载完成,点击安装。", updatePendingIntent); updateNotificationManager.notify(0, updateNotification); default: stopService(updateIntent); } } }; public long downloadUpdateFile(String downloadUrl, File saveFile) throws Exception { HttpURLConnection httpConnection = null; InputStream is = null; FileOutputStream fos = null; try { URL url = new URL(downloadUrl); httpConnection = (HttpURLConnection) url.openConnection(); httpConnection.setRequestProperty("User-Agent", "PacificHttpClient"); if (currentSize > 0) { httpConnection.setRequestProperty("RANGE", "bytes=" + currentSize + "-"); } httpConnection.setConnectTimeout(10000); httpConnection.setReadTimeout(20000); updateTotalSize = httpConnection.getContentLength(); if (httpConnection.getResponseCode() == 404) { throw new Exception("fail!"); } is = httpConnection.getInputStream(); fos = new FileOutputStream(saveFile, false); byte buffer[] = new byte[4096]; int readsize = 0; while ((readsize = is.read(buffer)) > 0) { fos.write(buffer, 0, readsize); totalSize += readsize; // 为了防止频繁的通知导致应用吃紧,百分比增加10才通知一次 if ((downloadCount == 0) || (int) (totalSize * 100 / updateTotalSize) - 10 > downloadCount) { downloadCount += 10; updateNotification.setLatestEventInfo(AppUpdateService.this, "正在下载", (int) totalSize * 100 / updateTotalSize + "%", updatePendingIntent); /*** * 在这里我们用自定的view来显示Notification */ updateNotification.contentView = new RemoteViews(getPackageName(), R.layout.notification_item); updateNotification.contentView.setTextViewText(R.id.notificationTitle, "正在下载"); updateNotification.contentView.setProgressBar(R.id.notificationProgress, 100, downloadCount, false); updateNotificationManager.notify(0, updateNotification); } } } finally { if (httpConnection != null) { httpConnection.disconnect(); } if (is != null) { is.close(); } if (fos != null) { fos.close(); } } return totalSize; } class updateRunnable implements Runnable { Message message = updateHandler.obtainMessage(); public void run() { message.what = DOWNLOAD_COMPLETE; try { // 增加权限<USES-PERMISSION // android:name="android.permission.WRITE_EXTERNAL_STORAGE">; if (!updateDir.exists()) { updateDir.mkdirs(); } if (!updateFile.exists()) { updateFile.createNewFile(); } // 下载函数,以QQ为例子 // 增加权限<USES-PERMISSION // android:name="android.permission.INTERNET">; long downloadSize = downloadUpdateFile("", updateFile); if (downloadSize > 0) { // 下载成功 updateHandler.sendMessage(message); } } catch (Exception ex) { ex.printStackTrace(); message.what = DOWNLOAD_FAIL; // 下载失败 updateHandler.sendMessage(message); } } } }
[ "lexloo@126.com" ]
lexloo@126.com
e9b52818c997ff38beb3c012986eebdbdd730247
c84088fed6a7b4f392810bb166e66dbfe3df4286
/wms2014/src/main/java/com/yongjun/tdms/service/year/device/purchasePlan/PurchasePlanDetailManager.java
1da4b2748a87b723b1cee2d35079059733999c0c
[]
no_license
1Will/Work1
4c419b9013d2989c4bbe6721c155de609e5ce9b5
16e707588da13e9dede5f7de97ca53e15a7d5a78
refs/heads/master
2020-05-22T16:52:56.501596
2018-03-20T01:21:01
2018-03-20T01:21:01
84,697,600
0
0
null
null
null
null
UTF-8
Java
false
false
3,060
java
/* * Copyright (c) 2001-2007 YongJun Technology Pte.,Ltd. All Rights Reserved. * * This software is the confidential and proprietary information of YongJun * Technology Pte.,Ltd. ("Confidential Information"). You shall not disclose * such Confidential Information and shall use it only in accordance with the * terms of the license agreement you entered into with YongJun. * * YONGJUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR * NON-INFRINGEMENT. YONGJUN SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY * LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS * DERIVATIVES. */ package com.yongjun.tdms.service.year.device.purchasePlan; import java.util.Collection; import java.util.List; import org.springframework.transaction.annotation.Transactional; import com.yongjun.tdms.model.year.device.purchasePlan.PurchasePlan; import com.yongjun.tdms.model.year.device.purchasePlan.PurchasePlanDetail; /** * * <p>Title: PurchasePlanDetailManager * <p>Description: 设备年度采购计划明细业务处理接口类</p> * <p>Copyright: Copyright (c) 2007 yj-technology</p> * <p>Company: www.yj-technology.com</p> * @author zbzhang@yj-technology.com * @version $Id:$ */ @Transactional(readOnly=true) public interface PurchasePlanDetailManager { /** * 根据传入的设备年度采购计划明细ID,获取设备年度采购计划明细 * @param purchasePlanDetailId 设备年度采购计划明细ID * @return PurchasePlanDetail 设备年度采购计划明细实体 */ PurchasePlanDetail loadPurchasePlanDetail(Long purchasePlanDetailId); /** * 根据传入的设备年度采购计划明细ID集合,获取集合设备年度采购计划明细 * @param purchasePlanDetailIds 设备年度采购计划明细ID集合 * @return List 集合设备年度采购计划明细 */ List<PurchasePlanDetail> loadAllPurchasePlanDetails(Long [] purchasePlanDetailIds); /** * 获取集合设备年度采购计划明细 * @return List 集合设备年度采购计划明细 */ List<PurchasePlanDetail> loadAllPurchasePlanDetails(); /** * 保存设备年度采购计划明细,并更新关联的采购计划的总费用 * @param purchasePlanDetail 设备年度采购计划明细 */ @Transactional void storePurchasePlanDetail(PurchasePlanDetail purchasePlanDetail); /** * 删除设备年度采购计划明细 * @param purchasePlanDetail 设备年度采购计划明细 */ @Transactional void deletePurchasePlanDetail(PurchasePlanDetail purchasePlanDetail); /** * 根据传入的设备年度采购计划明细集合,删除集合设备年度采购计划明细,并更新关联的采购计划的总费用 * @param purchasePlanDetails 设备年度采购计划明细集合 */ @Transactional void deleteAllPurchasePlanDetails(PurchasePlan purchase, Collection<PurchasePlanDetail> purchasePlanDetails); }
[ "287463504@qq.com" ]
287463504@qq.com
76638765db53467286ac7796649102e1b09d803d
1d928c3f90d4a0a9a3919a804597aa0a4aab19a3
/java/mybatis-3/2016/4/ArrayTypeHandlerTest.java
552becf4f0d35d48b6e651dccc29a11beaf127b0
[]
no_license
rosoareslv/SED99
d8b2ff5811e7f0ffc59be066a5a0349a92cbb845
a062c118f12b93172e31e8ca115ce3f871b64461
refs/heads/main
2023-02-22T21:59:02.703005
2021-01-28T19:40:51
2021-01-28T19:40:51
306,497,459
1
1
null
2020-11-24T20:56:18
2020-10-23T01:18:07
null
UTF-8
Java
false
false
3,119
java
/** * Copyright 2009-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.ibatis.type; import org.junit.Test; import org.mockito.Mock; import java.sql.Array; import java.sql.Timestamp; import java.util.Date; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; public class ArrayTypeHandlerTest extends BaseTypeHandlerTest { private static final TypeHandler<Object> TYPE_HANDLER = new ArrayTypeHandler(); @Mock Array mockArray; @Override @Test public void shouldSetParameter() throws Exception { TYPE_HANDLER.setParameter(ps, 1, mockArray, null); verify(ps).setArray(1, mockArray); } @Override @Test public void shouldGetResultFromResultSetByName() throws Exception { when(rs.getArray("column")).thenReturn(mockArray); when(rs.wasNull()).thenReturn(false); String[] stringArray = new String[]{"a", "b"}; when(mockArray.getArray()).thenReturn(stringArray); assertEquals(stringArray, TYPE_HANDLER.getResult(rs, "column")); } @Override @Test public void shouldGetResultNullFromResultSetByName() throws Exception { when(rs.getArray("column")).thenReturn(null); when(rs.wasNull()).thenReturn(true); assertNull(TYPE_HANDLER.getResult(rs, "column")); } @Override @Test public void shouldGetResultFromResultSetByPosition() throws Exception { when(rs.getArray(1)).thenReturn(mockArray); when(rs.wasNull()).thenReturn(false); String[] stringArray = new String[]{"a", "b"}; when(mockArray.getArray()).thenReturn(stringArray); assertEquals(stringArray, TYPE_HANDLER.getResult(rs, 1)); } @Override @Test public void shouldGetResultNullFromResultSetByPosition() throws Exception { when(rs.getArray(1)).thenReturn(null); when(rs.wasNull()).thenReturn(true); assertNull(TYPE_HANDLER.getResult(rs, 1)); } @Override @Test public void shouldGetResultFromCallableStatement() throws Exception { when(cs.getArray(1)).thenReturn(mockArray); when(cs.wasNull()).thenReturn(false); String[] stringArray = new String[]{"a", "b"}; when(mockArray.getArray()).thenReturn(stringArray); assertEquals(stringArray, TYPE_HANDLER.getResult(cs, 1)); } @Override @Test public void shouldGetResultNullFromCallableStatement() throws Exception { when(cs.getArray(1)).thenReturn(null); when(cs.wasNull()).thenReturn(true); assertNull(TYPE_HANDLER.getResult(cs, 1)); } }
[ "rodrigosoaresilva@gmail.com" ]
rodrigosoaresilva@gmail.com
67cd1800dcd159f7258da0bdeab4633b43d41f73
8c144196627df83471da9e5b6530623643ed3733
/mybatis_demo/src/main/java/com/mb/demo/mapper/DeptMapper.java
da4b2bca2552b61700d35325c40cd7dea56d44e3
[]
no_license
jazzlly/java-example
9879d3dd8718f8d5ceebd569a698ef735f7fca7a
b97c892ccbf31ad58bcc3a090f0dfdc50ed785ef
refs/heads/master
2023-03-19T04:08:11.610597
2023-03-08T07:43:03
2023-03-08T07:43:03
96,027,321
0
0
null
2023-03-03T10:56:23
2017-07-02T14:07:10
Java
UTF-8
Java
false
false
544
java
package com.mb.demo.mapper; import com.mb.demo.model.Dept; import com.mb.demo.model.Emp; import org.apache.ibatis.annotations.Param; import java.util.List; /** * EmpMapper接口绑定到EmpMapper.xml文件, 通过xml描述sql * * 参数映射: 优先使用 注解 @Param > [param1, param2, ] >>> [arg0, arg1, ...] */ public interface DeptMapper { Dept selectDept(Long deptId); /** 获取部门和部门中所有员工 */ Dept selectDeptAndEmps(Long deptId); Integer insertDept(@Param("deptName") String deptName); }
[ "rui.jiang@pekall.com" ]
rui.jiang@pekall.com
8470c2df98df6b9d8ad4fa8cc591a3d5e3001532
cad7bc29389fbf5d5b722ee5327ba8154e7cc952
/submissions/available/CPC/CPC-what-property/data/source/apacheDB-trunk/api/src/main/java/javax/jdo/query/CharacterExpression.java
c9b5b4b5d8f9cef21c903a2e019c9c966e849d8b
[ "Unlicense", "Apache-2.0" ]
permissive
XZ-X/CPC-artifact-release
f9f9f0cde79b111f47622faba02f08b85a8a5ee9
5710dc0e39509f79e42535e0b5ca5e41cbd90fc2
refs/heads/master
2022-12-20T12:30:22.787707
2020-01-27T21:45:33
2020-01-27T21:45:33
236,601,424
1
0
Unlicense
2022-12-16T04:24:27
2020-01-27T21:41:38
Java
UTF-8
Java
false
false
1,699
java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package javax.jdo.query; /** * Representation of a character expression. */ public interface CharacterExpression extends ComparableExpression<Character> { /** * Method to return a CharacterExpression representing this CharacterExpression in lower case. * @return The lower case expression */ CharacterExpression toLowerCase(); /** * Method to return a CharacterExpression representing this CharacterExpression in upper case. * @return The upper case expression */ CharacterExpression toUpperCase(); /** * Method to return an expression that is the current expression negated. * @return The negated expression */ CharacterExpression neg(); /** * Method to return an expression that is the complement of the current expression. * @return The complement expression */ CharacterExpression com(); }
[ "161250170@smail.nju.edu.cn" ]
161250170@smail.nju.edu.cn
02e08f7118b5fb971cc68bed7b5ead358c541d41
647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4
/com.tencent.mm/classes.jar/com/tencent/mm/plugin/account/ui/r$a.java
dd4b35c5da92d222129a35d036317c0ed188543b
[]
no_license
tsuzcx/qq_apk
0d5e792c3c7351ab781957bac465c55c505caf61
afe46ef5640d0ba6850cdefd3c11badbd725a3f6
refs/heads/main
2022-07-02T10:32:11.651957
2022-02-01T12:41:38
2022-02-01T12:41:38
453,860,108
36
9
null
2022-01-31T09:46:26
2022-01-31T02:43:22
Java
UTF-8
Java
false
false
547
java
package com.tencent.mm.plugin.account.ui; public final class r$a { public static final int anim_not_change = 2130771992; public static final int anim_shake_horizontal = 2130772001; public static final int push_down_in = 2130772139; public static final int slide_left_out = 2130772170; public static final int slide_right_in = 2130772175; } /* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes4.jar * Qualified Name: com.tencent.mm.plugin.account.ui.r.a * JD-Core Version: 0.7.0.1 */
[ "98632993+tsuzcx@users.noreply.github.com" ]
98632993+tsuzcx@users.noreply.github.com
14139e61648a0b641f40ce00093ae521759896d5
32f38cd53372ba374c6dab6cc27af78f0a1b0190
/app/src/main/java/com/alipay/mobile/nebulacore/data/H5PrefData.java
cd59228b062e58977bc13aa08bc71b16c861027f
[]
no_license
shuixi2013/AmapCode
9ea7aefb42e0413f348f238f0721c93245f4eac6
1a3a8d4dddfcc5439df8df570000cca12b15186a
refs/heads/master
2023-06-06T23:08:57.391040
2019-08-29T04:36:02
2019-08-29T04:36:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
976
java
package com.alipay.mobile.nebulacore.data; import android.content.SharedPreferences; import android.text.TextUtils; import com.alipay.mobile.h5container.api.H5Data; import com.alipay.mobile.nebulacore.env.H5Environment; public class H5PrefData implements H5Data { private SharedPreferences a; public H5PrefData(String name) { this.a = H5Environment.getContext().getSharedPreferences(!TextUtils.isEmpty(name) ? "h5_data_" + name : "h5_data_", 0); } public void set(String name, String value) { this.a.edit().putString(name, value).apply(); } public String get(String name) { return this.a.getString(name, null); } public String remove(String name) { String value = this.a.getString(name, null); if (!TextUtils.isEmpty(value)) { this.a.edit().remove(name).apply(); } return value; } public boolean has(String name) { return this.a.contains(name); } }
[ "hubert.yang@nf-3.com" ]
hubert.yang@nf-3.com
9723ddb1956ae6b8b8579f1b05e509f1fc775b6e
821cdec16c095f9ed45a0691bb008653cc6391bd
/src/net/csdn/modules/transport/HttpTransportService.java
afd313138c46dd7f2d8c2b58f3519fd3ec584436
[]
no_license
jacarrichan/ServiceFramework
f46f8eec452c4415a78cadfb874eb72a6562424b
dac41154764f9be6fa95caf0205d3fe384990a49
refs/heads/master
2021-01-18T16:17:40.827593
2012-08-13T13:11:10
2012-08-13T13:11:10
5,399,769
0
1
null
null
null
null
UTF-8
Java
false
false
1,617
java
package net.csdn.modules.transport; import net.csdn.common.path.Url; import net.csdn.modules.http.RestRequest; import net.sf.json.JSONObject; import java.util.List; import java.util.Map; import java.util.concurrent.FutureTask; /** * BlogInfo: WilliamZhu * Date: 12-5-29 * Time: 下午5:09 */ public interface HttpTransportService { public SResponse post(Url url, Map data); public SResponse put(Url url, Map data); public SResponse http(Url url, String jsonData, RestRequest.Method method); public FutureTask<SResponse> asyncHttp(final Url url, final String jsonData, RestRequest.Method method); public List<SResponse> asyncHttps(final List<Url> urls, final String jsonData, RestRequest.Method method); class SResponse { private int status = 200; private String content; private Url url; public SResponse(int status, String content, Url url) { this.status = status; this.content = content; this.url = url; } public JSONObject json() { return JSONObject.fromObject(content); } // public Url getUrl() { return url; } public void setUrl(Url url) { this.url = url; } public int getStatus() { return status; } public void setStatus(int status) { this.status = status; } public String getContent() { return content; } public void setContent(String content) { this.content = content; } } }
[ "allwefantasy@gmail.com" ]
allwefantasy@gmail.com
dff0f9bdfcc0cbbad521b97b0efcb61c24e957d4
34f8d4ba30242a7045c689768c3472b7af80909c
/jdk-12/src/jdk.internal.vm.compiler/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotSafepointOp.java
f30148a91feba3307e18c93806010480744afc5b
[ "Apache-2.0" ]
permissive
lovelycheng/JDK
5b4cc07546f0dbfad15c46d427cae06ef282ef79
19a6c71e52f3ecd74e4a66be5d0d552ce7175531
refs/heads/master
2023-04-08T11:36:22.073953
2022-09-04T01:53:09
2022-09-04T01:53:09
227,544,567
0
0
null
2019-12-12T07:18:30
2019-12-12T07:18:29
null
UTF-8
Java
false
false
6,470
java
/* * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * */ package org.graalvm.compiler.hotspot.amd64; import static org.graalvm.compiler.core.common.NumUtil.isInt; import static org.graalvm.compiler.core.common.GraalOptions.GeneratePIC; import static org.graalvm.compiler.core.common.GraalOptions.ImmutableCode; import static jdk.vm.ci.amd64.AMD64.rax; import static jdk.vm.ci.amd64.AMD64.rip; import org.graalvm.compiler.asm.amd64.AMD64Address; import org.graalvm.compiler.asm.amd64.AMD64MacroAssembler; import org.graalvm.compiler.core.common.LIRKind; import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig; import org.graalvm.compiler.lir.LIRFrameState; import org.graalvm.compiler.lir.LIRInstructionClass; import org.graalvm.compiler.lir.Opcode; import org.graalvm.compiler.lir.amd64.AMD64LIRInstruction; import org.graalvm.compiler.lir.asm.CompilationResultBuilder; import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.code.Register; import jdk.vm.ci.code.RegisterValue; import jdk.vm.ci.code.site.InfopointReason; import jdk.vm.ci.meta.AllocatableValue; import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.Value; /** * Emits a safepoint poll. */ @Opcode("SAFEPOINT") public final class AMD64HotSpotSafepointOp extends AMD64LIRInstruction { public static final LIRInstructionClass<AMD64HotSpotSafepointOp> TYPE = LIRInstructionClass.create(AMD64HotSpotSafepointOp.class); @State protected LIRFrameState state; @Temp({OperandFlag.REG, OperandFlag.ILLEGAL}) private AllocatableValue temp; private final GraalHotSpotVMConfig config; private final Register thread; public AMD64HotSpotSafepointOp(LIRFrameState state, GraalHotSpotVMConfig config, NodeLIRBuilderTool tool, Register thread) { super(TYPE); this.state = state; this.config = config; this.thread = thread; if (config.threadLocalHandshakes || isPollingPageFar(config) || ImmutableCode.getValue(tool.getOptions())) { temp = tool.getLIRGeneratorTool().newVariable(LIRKind.value(tool.getLIRGeneratorTool().target().arch.getWordKind())); } else { // Don't waste a register if it's unneeded temp = Value.ILLEGAL; } } @Override public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler asm) { emitCode(crb, asm, config, false, state, thread, temp instanceof RegisterValue ? ((RegisterValue) temp).getRegister() : null); } public static void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler asm, GraalHotSpotVMConfig config, boolean atReturn, LIRFrameState state, Register thread, Register scratch) { if (config.threadLocalHandshakes) { emitThreadLocalPoll(crb, asm, config, atReturn, state, thread, scratch); } else { emitGlobalPoll(crb, asm, config, atReturn, state, scratch); } } /** * Tests if the polling page address can be reached from the code cache with 32-bit * displacements. */ private static boolean isPollingPageFar(GraalHotSpotVMConfig config) { final long pollingPageAddress = config.safepointPollingAddress; return config.forceUnreachable || !isInt(pollingPageAddress - config.codeCacheLowBound) || !isInt(pollingPageAddress - config.codeCacheHighBound); } private static void emitGlobalPoll(CompilationResultBuilder crb, AMD64MacroAssembler asm, GraalHotSpotVMConfig config, boolean atReturn, LIRFrameState state, Register scratch) { assert !atReturn || state == null : "state is unneeded at return"; if (ImmutableCode.getValue(crb.getOptions())) { JavaKind hostWordKind = JavaKind.Long; int alignment = hostWordKind.getBitCount() / Byte.SIZE; JavaConstant pollingPageAddress = JavaConstant.forIntegerKind(hostWordKind, config.safepointPollingAddress); // This move will be patched to load the safepoint page from a data segment // co-located with the immutable code. if (GeneratePIC.getValue(crb.getOptions())) { asm.movq(scratch, asm.getPlaceholder(-1)); } else { asm.movq(scratch, (AMD64Address) crb.recordDataReferenceInCode(pollingPageAddress, alignment)); } final int pos = asm.position(); crb.recordMark(atReturn ? config.MARKID_POLL_RETURN_FAR : config.MARKID_POLL_FAR); if (state != null) { crb.recordInfopoint(pos, state, InfopointReason.SAFEPOINT); } asm.testl(rax, new AMD64Address(scratch)); } else if (isPollingPageFar(config)) { asm.movq(scratch, config.safepointPollingAddress); crb.recordMark(atReturn ? config.MARKID_POLL_RETURN_FAR : config.MARKID_POLL_FAR); final int pos = asm.position(); if (state != null) { crb.recordInfopoint(pos, state, InfopointReason.SAFEPOINT); } asm.testl(rax, new AMD64Address(scratch)); } else { crb.recordMark(atReturn ? config.MARKID_POLL_RETURN_NEAR : config.MARKID_POLL_NEAR); final int pos = asm.position(); if (state != null) { crb.recordInfopoint(pos, state, InfopointReason.SAFEPOINT); } // The C++ code transforms the polling page offset into an RIP displacement // to the real address at that offset in the polling page. asm.testl(rax, new AMD64Address(rip, 0)); } } private static void emitThreadLocalPoll(CompilationResultBuilder crb, AMD64MacroAssembler asm, GraalHotSpotVMConfig config, boolean atReturn, LIRFrameState state, Register thread, Register scratch) { assert !atReturn || state == null : "state is unneeded at return"; assert config.threadPollingPageOffset >= 0; asm.movptr(scratch, new AMD64Address(thread, config.threadPollingPageOffset)); crb.recordMark(atReturn ? config.MARKID_POLL_RETURN_FAR : config.MARKID_POLL_FAR); final int pos = asm.position(); if (state != null) { crb.recordInfopoint(pos, state, InfopointReason.SAFEPOINT); } asm.testl(rax, new AMD64Address(scratch)); } }
[ "zeng255@163.com" ]
zeng255@163.com
e125671f23f709385eb9317603ca15df8dac8b64
b9eee567eadecd509fd47d05f37e1bcf5e7878ac
/druid-spring-boot-3-starter/src/test/java/com/alibaba/druid/spring/boot3/demo/service/UserServiceImpl.java
18c8bccb14229161eff5e46deb07bd9ee542a159
[ "Apache-2.0" ]
permissive
vanlin/druid
de101e95ab5235b128dbdeb8300824781871bc13
602342ec895c0252dd3104021814768d9dba66cd
refs/heads/master
2023-09-01T15:39:26.897225
2023-08-28T03:09:23
2023-08-28T03:09:23
683,897,864
0
0
Apache-2.0
2023-08-28T02:39:27
2023-08-28T02:39:21
null
UTF-8
Java
false
false
626
java
package com.alibaba.druid.spring.boot3.demo.service; import com.alibaba.druid.spring.boot3.demo.dao.UserDao; import com.alibaba.druid.spring.boot3.demo.model.User; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.Optional; @Service public class UserServiceImpl implements UserService { @Autowired private UserDao userDao; @Override public User findById(Long id) { Optional<User> result = userDao.findById(id); if (!result.isPresent()) { return null; } return result.get(); } }
[ "shaojin.wensj@alibaba-inc.com" ]
shaojin.wensj@alibaba-inc.com
6a475e707f7c40de06775788ea7d4d7919f9d6c7
4288aaba811b9cc4131f5337eb5be996f2046308
/src/c_002/T.java
7505d6ac5901eb39fced09af5e06333d658ac524
[]
no_license
yafengstark/java-concurrent-audition
3ad1c415a9641104eb1aa0c9439581ae7e52416e
6fc6ddab54422adfa8539e235790f280b171e6ad
refs/heads/master
2020-06-13T03:54:12.586979
2019-07-10T11:36:47
2019-07-10T11:36:47
194,525,547
0
0
null
null
null
null
UTF-8
Java
false
false
524
java
package c_002; /** * synchronized 关键字 * 对this加锁 * * 每次使用锁都要newObject,比较麻烦,可以使用this代替object锁 */ public class T { private int count = 10; public void m() { synchronized (this) { // 任何线程要执行下面的代码,必须先拿到this锁 // synchronized 锁定的不是代码块,而是 this 对象 count--; System.out.println(Thread.currentThread().getName() + " count = " + count); } } }
[ "fengfeng043@gmail.com" ]
fengfeng043@gmail.com
c5ba9c91d24080cd479ad5b260e7696c87a2d40c
3c4763922cda3f3a990b74cdba6f8a30b07467de
/src/main/java/students/alex_kalashnikov/lesson_8/level_4/task_16/Shape.java
9d434582823e17d75f11a1ac9ba0f48c3a1623dd
[]
no_license
VitalyPorsev/JavaGuru1
07db5a0cc122b097a20e56c9da431cd49d3c01ea
f3c25b6357309d4e9e8ac0047e51bb8031d14da8
refs/heads/main
2023-05-10T15:35:55.419713
2021-05-15T18:48:12
2021-05-15T18:48:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
255
java
package students.alex_kalashnikov.lesson_8.level_4.task_16; abstract class Shape { private String title; Shape(String title) { this.title = title; } abstract double calculateArea(); abstract double calculatePerimeter(); }
[ "kalashnikov_alex@yahoo.com" ]
kalashnikov_alex@yahoo.com
e35f8934215376eab7ebbf601cbfbed67189ffa6
f46a177f35dc9587ba64b17d159e5a1c519b253f
/src/main/java/ml/socshared/gateway/service/impl/TextAnalyzerServiceImpl.java
966d36079f159df9dece2fe951f7f494374acfc1
[]
no_license
SocShared/gateway-service
2d7dafb64bee7191944f331f8cf2f469c92c66dd
dec100103eac22acc6ab18a290e730d309167287
refs/heads/master
2022-11-14T19:08:34.651132
2020-06-26T07:33:50
2020-06-26T07:33:50
260,530,144
0
0
null
null
null
null
UTF-8
Java
false
false
1,014
java
package ml.socshared.gateway.service.impl; import lombok.RequiredArgsConstructor; import ml.socshared.gateway.client.TextAnalyzerClient; import ml.socshared.gateway.domain.text_analyzer.request.TextRequest; import ml.socshared.gateway.domain.text_analyzer.response.KeyWordResponse; import ml.socshared.gateway.security.model.TokenObject; import ml.socshared.gateway.service.TextAnalyzerService; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import java.util.List; @Service @RequiredArgsConstructor public class TextAnalyzerServiceImpl implements TextAnalyzerService { private final TextAnalyzerClient client; @Value("#{tokenGetter.tokenTextService}") private TokenObject textAnalyzerToken; @Override public List<KeyWordResponse> getKeyWords(String text, Integer minLength, Integer maxLength) { return client.extractKeyWords(new TextRequest(text), minLength, maxLength, "Bearer " + textAnalyzerToken.getToken()); } }
[ "vladovchinnikov950@gmail.com" ]
vladovchinnikov950@gmail.com
b3d818ef3f829d48cff0ec7e847f9551cc9215c0
8dcd6fac592760c5bff55349ffb2d7ce39d485cc
/com/google/android/gms/common/stats/WakeLockEvent.java
3c641cc9d89b9556c87984d4f8adad5678ea513c
[]
no_license
andrepcg/hikam-android
9e3a02e0ba9a58cf8a17c5e76e2f3435969e4b3a
bf39e345a827c6498052d9df88ca58d8823178d9
refs/heads/master
2021-09-01T11:41:10.726066
2017-12-26T19:04:42
2017-12-26T19:04:42
115,447,829
2
2
null
null
null
null
UTF-8
Java
false
false
3,985
java
package com.google.android.gms.common.stats; import android.os.Parcel; import android.os.Parcelable.Creator; import android.text.TextUtils; import java.util.List; public final class WakeLockEvent extends StatsEvent { public static final Creator<WakeLockEvent> CREATOR = new zzg(); private final long DM; private int DN; private final long DU; private long DW; private final String EA; private final int EB; private final List<String> EC; private final String ED; private int EE; private final String EF; private final float EG; private final String Ey; private final String Ez; private final long mTimeout; final int mVersionCode; WakeLockEvent(int i, long j, int i2, String str, int i3, List<String> list, String str2, long j2, int i4, String str3, String str4, float f, long j3, String str5) { this.mVersionCode = i; this.DM = j; this.DN = i2; this.Ey = str; this.Ez = str3; this.EA = str5; this.EB = i3; this.DW = -1; this.EC = list; this.ED = str2; this.DU = j2; this.EE = i4; this.EF = str4; this.EG = f; this.mTimeout = j3; } public WakeLockEvent(long j, int i, String str, int i2, List<String> list, String str2, long j2, int i3, String str3, String str4, float f, long j3, String str5) { this(2, j, i, str, i2, list, str2, j2, i3, str3, str4, f, j3, str5); } public int getEventType() { return this.DN; } public long getTimeMillis() { return this.DM; } public void writeToParcel(Parcel parcel, int i) { zzg.zza(this, parcel, i); } public String zzawp() { return this.ED; } public long zzawq() { return this.DW; } public long zzaws() { return this.DU; } public String zzawt() { String valueOf = String.valueOf("\t"); String valueOf2 = String.valueOf(zzaww()); String valueOf3 = String.valueOf("\t"); int zzawz = zzawz(); String valueOf4 = String.valueOf("\t"); String join = zzaxa() == null ? "" : TextUtils.join(",", zzaxa()); String valueOf5 = String.valueOf("\t"); int zzaxb = zzaxb(); String valueOf6 = String.valueOf("\t"); String zzawx = zzawx() == null ? "" : zzawx(); String valueOf7 = String.valueOf("\t"); String zzaxc = zzaxc() == null ? "" : zzaxc(); String valueOf8 = String.valueOf("\t"); float zzaxd = zzaxd(); String valueOf9 = String.valueOf("\t"); String zzawy = zzawy() == null ? "" : zzawy(); return new StringBuilder(((((((((((((String.valueOf(valueOf).length() + 37) + String.valueOf(valueOf2).length()) + String.valueOf(valueOf3).length()) + String.valueOf(valueOf4).length()) + String.valueOf(join).length()) + String.valueOf(valueOf5).length()) + String.valueOf(valueOf6).length()) + String.valueOf(zzawx).length()) + String.valueOf(valueOf7).length()) + String.valueOf(zzaxc).length()) + String.valueOf(valueOf8).length()) + String.valueOf(valueOf9).length()) + String.valueOf(zzawy).length()).append(valueOf).append(valueOf2).append(valueOf3).append(zzawz).append(valueOf4).append(join).append(valueOf5).append(zzaxb).append(valueOf6).append(zzawx).append(valueOf7).append(zzaxc).append(valueOf8).append(zzaxd).append(valueOf9).append(zzawy).toString(); } public String zzaww() { return this.Ey; } public String zzawx() { return this.Ez; } public String zzawy() { return this.EA; } public int zzawz() { return this.EB; } public List<String> zzaxa() { return this.EC; } public int zzaxb() { return this.EE; } public String zzaxc() { return this.EF; } public float zzaxd() { return this.EG; } public long zzaxe() { return this.mTimeout; } }
[ "andrepcg@gmail.com" ]
andrepcg@gmail.com
c4b2086e69544d91508547f8c26969afc33310ee
81b0bb3cfb2e9501f53451e7f03ec072ee2b0e13
/src/me/lyft/android/ui/business/onboard/PaymentSelectionController.java
76e914efcfdca65a2e2fbf6714f0aa8036558f2a
[]
no_license
reverseengineeringer/me.lyft.android
48bb85e8693ce4dab50185424d2ec51debf5c243
8c26caeeb54ffbde0711d3ce8b187480d84968ef
refs/heads/master
2021-01-19T02:32:03.752176
2016-07-19T16:30:00
2016-07-19T16:30:00
63,710,356
3
0
null
null
null
null
UTF-8
Java
false
false
5,462
java
package me.lyft.android.ui.business.onboard; import android.content.Context; import android.content.res.Resources; import android.view.View; import android.view.ViewGroup; import android.widget.LinearLayout; import com.lyft.scoop.Scoop; import java.util.Iterator; import java.util.List; import javax.inject.Inject; import me.lyft.android.application.IUserProvider; import me.lyft.android.application.business.BusinessOnboardingAnalytics; import me.lyft.android.application.payment.IPaymentService; import me.lyft.android.common.AppFlow; import me.lyft.android.common.DialogFlow; import me.lyft.android.common.RxViewController; import me.lyft.android.controls.Toolbar; import me.lyft.android.domain.payment.ChargeAccount; import me.lyft.android.persistence.payment.IChargeAccountsProvider; import me.lyft.android.rx.RxUIBinder; import me.lyft.android.ui.Dialogs.AlertDialog; import me.lyft.android.ui.IProgressController; import me.lyft.android.ui.payment.AddCreditCardPaymentItemView; import me.lyft.android.ui.payment.AddPayPalPaymentItemView; import me.lyft.android.ui.payment.AddWalletCardPaymentItemView; import me.lyft.android.ui.payment.IChargeAccountSelectionListener; import me.lyft.android.ui.payment.PaymentListItemView; public class PaymentSelectionController extends RxViewController { LinearLayout addCard; LinearLayout addPaymentLayout; private View addWalletView; private final AppFlow appFlow; private final BusinessOnboardingAnalytics businessOnboardingAnalytics; private IChargeAccountSelectionListener chargeAccountDefaultSelectionListener = new PaymentSelectionController.3(this); private final IChargeAccountsProvider chargeAccountsProvider; private final DialogFlow dialogFlow; ViewGroup paymentCardListWidgetView; private final IPaymentService paymentService; private final IProgressController progressController; Toolbar toolbar; private final IUserProvider userProvider; @Inject public PaymentSelectionController(IChargeAccountsProvider paramIChargeAccountsProvider, IPaymentService paramIPaymentService, IProgressController paramIProgressController, IUserProvider paramIUserProvider, AppFlow paramAppFlow, DialogFlow paramDialogFlow, BusinessOnboardingAnalytics paramBusinessOnboardingAnalytics) { chargeAccountsProvider = paramIChargeAccountsProvider; paymentService = paramIPaymentService; progressController = paramIProgressController; userProvider = paramIUserProvider; appFlow = paramAppFlow; dialogFlow = paramDialogFlow; businessOnboardingAnalytics = paramBusinessOnboardingAnalytics; } private void insertAddWalletPaymentItem() { if (addWalletView == null) { addWalletView = new AddWalletCardPaymentItemView(getView().getContext()); } binder.bindAction(paymentService.observeWalletReadyToPay(), new PaymentSelectionController.4(this)); } private void refreshChargeAccounts(List<ChargeAccount> paramList) { paymentCardListWidgetView.removeAllViews(); if (!chargeAccountsProvider.hasWalletCard()) { insertAddWalletPaymentItem(); } if (!chargeAccountsProvider.hasPayPalChargeAccount()) { paymentCardListWidgetView.addView(new AddPayPalPaymentItemView(getView().getContext(), true, true)); } paramList = paramList.iterator(); while (paramList.hasNext()) { ChargeAccount localChargeAccount = (ChargeAccount)paramList.next(); PaymentListItemView localPaymentListItemView = PaymentListItemView.createSelectableChargeAccountListItem(getScoop().createContext(getView().getContext()), localChargeAccount, chargeAccountDefaultSelectionListener); if (localPaymentListItemView != null) { if (localChargeAccount.isDefaultBusiness().booleanValue()) { toolbar.enableItem(2131558445); localPaymentListItemView.select(); } paymentCardListWidgetView.addView(localPaymentListItemView); } } } protected int layoutId() { return 2130903071; } public void onAttach() { super.onAttach(); Object localObject = getView().getContext(); toolbar.showTitle().setTitle(((Context)localObject).getString(2131166093)); toolbar.addItem(2131558445, ((Context)localObject).getString(2131165934).toUpperCase()); toolbar.disableItem(2131558445); LinearLayout localLinearLayout = addPaymentLayout; if (chargeAccountsProvider.hasMaximumCreditCardsAmount()) {} for (int i = 8;; i = 0) { localLinearLayout.setVisibility(i); if (!chargeAccountsProvider.hasMaximumCreditCardsAmount()) { localObject = new AddCreditCardPaymentItemView((Context)localObject, true, true); addCard.addView((View)localObject); } binder.bindAction(toolbar.observeItemClick(), new PaymentSelectionController.1(this)); binder.bindAction(chargeAccountsProvider.observeChargeAccounts(), new PaymentSelectionController.2(this)); return; } } public void showInvalidChargeAccountDialog() { Dialogs.AlertDialog localAlertDialog = new Dialogs.AlertDialog("invalid_card_dialog").setTitle(getResources().getString(2131166055)).setMessage(getResources().getString(2131166054)).addPositiveButton(getResources().getString(2131165939)); dialogFlow.show(localAlertDialog); } } /* Location: * Qualified Name: me.lyft.android.ui.business.onboard.PaymentSelectionController * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "reverseengineeringer@hackeradmin.com" ]
reverseengineeringer@hackeradmin.com
f0c8710aab6685e58509a141a9f5531b2a435ccd
dec6bd85db1d028edbbd3bd18fe0ca628eda012e
/netbeans-projects/TrabEngSoftware/src/Control/auxCalculoFPA.java
217b2cd8467604aafe35b78bff3ba1ba7ee78a32
[]
no_license
MatheusGrenfell/java-projects
21b961697e2c0c6a79389c96b588e142c3f70634
93c7bfa2e4f73a232ffde2d38f30a27f2a816061
refs/heads/master
2022-12-29T12:55:00.014296
2020-10-16T00:54:30
2020-10-16T00:54:30
null
0
0
null
null
null
null
ISO-8859-2
Java
false
false
6,987
java
package Control; public class auxCalculoFPA { public int ALIeAIE(int tipoDado, int tipoReg) { switch (tipoReg) { case 1: if (tipoDado <= 50) { return 1; } else { return 2; } case 2: case 3: case 4: case 5: if (tipoDado < 20) { return 1; } else { if (tipoDado >= 20 && tipoDado <= 50) { return 2; } else { return 3; } } default: if (tipoDado < 20) { return 2; } else { return 3; } } } public int getAliInt(int tipoDado, int tipoReg) { int valorTab = ALIeAIE(tipoDado, tipoReg); switch (valorTab) { case 1: return 7; case 2: return 10; default: return 15; } } public String getAliString(int tipoDado, int tipoReg) { int valorTab = ALIeAIE(tipoDado, tipoReg); switch (valorTab) { case 1: return "Baixa"; case 2: return "Média"; default: return "Alta"; } } public int getAieInt(int tipoDado, int tipoReg) { int valorTab = ALIeAIE(tipoDado, tipoReg); switch (valorTab) { case 1: return 5; case 2: return 7; default: return 10; } } public String getAieString(int tipoDado, int tipoReg) { int valorTab = ALIeAIE(tipoDado, tipoReg); switch (valorTab) { case 1: return "Baixa"; case 2: return "Média"; default: return "Alta"; } } public int SEeCE(int tipoDado, int arqRef) { switch (arqRef) { case 1: if (tipoDado < 19) { return 1; } else { return 2; } case 2: case 3: if (tipoDado < 6) { return 1; } else { if (tipoDado > 19) { return 3; } else { return 2; } } default: if (tipoDado < 6) { return 2; } else { return 3; } } } public int getSeInt(int tipoDado, int arqRef) { int valorTab = SEeCE(tipoDado, arqRef); switch (valorTab) { case 1: return 4; case 2: return 5; default: return 7; } } public String getSeString(int tipoDado, int arqRef) { int valorTab = SEeCE(tipoDado, arqRef); switch (valorTab) { case 1: return "Baixa"; case 2: return "Média"; default: return "Alta"; } } public int getCeInt(int tipoDado, int arqRef) { int valorTab = SEeCE(tipoDado, arqRef); switch (valorTab) { case 1: return 3; case 2: return 4; default: return 6; } } public String getCeString(int tipoDado, int arqRef) { int valorTab = SEeCE(tipoDado, arqRef); switch (valorTab) { case 1: return "Baixa"; case 2: return "Média"; default: return "Alta"; } } public int EE(int tipoDado, int arqRef) { switch (arqRef) { case 1: if (tipoDado <= 15) { return 1; } else { return 2; } case 2: if (tipoDado < 5) { return 1; } else { if (tipoDado > 15) { return 3; } else { return 2; } } default: if (tipoDado < 5) { return 2; } else { return 3; } } } public int getEeInt(int tipoDado, int arqRef) { int valorTab = EE(tipoDado, arqRef); switch (valorTab) { case 1: return 3; case 2: return 4; default: return 6; } } public String getEeString(int tipoDado, int arqRef) { int valorTab = EE(tipoDado, arqRef); switch (valorTab) { case 1: return "Baixa"; case 2: return "Média"; default: return "Alta"; } } public void NI(int[] caracteristicas) { int total = 0; for (int i = 0; i < caracteristicas.length; i++) { total += caracteristicas[i]; } } public int getValorComplexidade(String tipo, int complexidade) { switch (complexidade) { case 1: if (tipo.equals("ALI")) { return 7; } if (tipo.equals("AIE")) { return 5; } if (tipo.equals("EE")) { return 3; } if (tipo.equals("SE")) { return 4; } if (tipo.equals("CE")) { return 3; } case 2: if (tipo.equals("ALI")) { return 10; } if (tipo.equals("AIE")) { return 7; } if (tipo.equals("EE")) { return 4; } if (tipo.equals("SE")) { return 5; } if (tipo.equals("CE")) { return 4; } case 3: if (tipo.equals("ALI")) { return 15; } if (tipo.equals("AIE")) { return 10; } if (tipo.equals("EE")) { return 6; } if (tipo.equals("SE")) { return 7; } if (tipo.equals("CE")) { return 6; } default: return -1; } } }
[ "caiohobus@gmail.com" ]
caiohobus@gmail.com
f527203df2a007ec52a3e341bc243a7a5315b41f
c6d931a0b96addf006061f4f1e8bc78e53e35263
/core/src/main/java/org/openstack4j/model/common/payloads/InputStreamPayload.java
f61c1811ec41910a1249d498700bd618ba97c387
[ "Apache-2.0" ]
permissive
17862953931/openstack4j
a8ea441009d14afa839cf6f42d128652687751e1
9d5f1a0c91b6db8942019fddd2997e6b2a33ef57
refs/heads/master
2020-09-04T09:29:26.354230
2020-02-19T02:52:06
2020-02-19T02:52:06
219,702,460
2
1
NOASSERTION
2020-02-19T02:52:07
2019-11-05T09:09:05
Java
UTF-8
Java
false
false
795
java
package org.openstack4j.model.common.payloads; import java.io.IOException; import java.io.InputStream; import org.openstack4j.model.common.Payload; /** * Input Stream Payload * * @author Jeremy Unruh */ public class InputStreamPayload implements Payload<InputStream>{ private InputStream is; public InputStreamPayload(InputStream is) { this.is = is; } /** * {@inheritDoc} */ @Override public void close() throws IOException { if (is != null) is.close(); } /** * {@inheritDoc} */ @Override public InputStream open() { return is; } /** * {@inheritDoc} */ @Override public void closeQuietly() { try { close(); } catch (IOException e) { } } /** * {@inheritDoc} */ @Override public InputStream getRaw() { return is; } }
[ "jeremyunruh@sbcglobal.net" ]
jeremyunruh@sbcglobal.net
fcd4db66b9f8f90c099f4e9e47364dc1486ebc35
44b78323a6e30a5f23085769c72665423a6152d9
/src/main/java/at/ac/webster/model/Event.java
7428d42b3c05dc5cbfcb1aa78d973284274a3645
[ "Apache-2.0" ]
permissive
ginccc/lms-data-hub
9a471688bdf376ca3d5fcce631560c158c2c24c6
f5dc99c67cd84f34dc284a917e6db6e816d2c5a7
refs/heads/master
2020-09-14T15:09:42.382792
2019-12-23T15:56:30
2019-12-23T15:56:30
223,164,231
0
0
Apache-2.0
2020-05-09T21:30:53
2019-11-21T12:00:48
Java
UTF-8
Java
false
false
593
java
package at.ac.webster.model; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import lombok.ToString; import java.util.Date; @NoArgsConstructor @AllArgsConstructor @Getter @Setter @EqualsAndHashCode @ToString public class Event { private String id; private Type type; private Date startAt; private Date endAt; private String cronSchedule; private Interval interval; private String studentGroupId; public enum Type { oneTime, reoccurring } }
[ "gregor@jarisch.net" ]
gregor@jarisch.net
8f106ac4e1b5f29eee2e5b7da716b4e17d20a44e
a62d1806650f87186f8a6e6cfa6b30256a51acd1
/src/CusPro2/Test.java
6fb9c5d9a1af14efd94a023a128c93c42beb74b6
[]
no_license
XiaYiTiao/Vcode
94958fd142c347cdff1eb9d9031c8c892737e408
3f22db0fc422092c605c980f8fed03fd316a4074
refs/heads/master
2020-05-14T12:34:46.825996
2019-04-09T16:03:10
2019-04-09T16:03:10
181,796,217
1
0
null
2019-04-17T01:43:30
2019-04-17T01:43:30
null
UTF-8
Java
false
false
1,309
java
package CusPro2; /** * <a href="http://lib.csdn.net/base/softwaretest" class='replace_word' title= * "软件测试知识库" target='_blank' style='color:#df3434; * font-weight:bold;'>测试</a>类Test * * Email:530025983@qq.com * * @author MONKEY.D.MENG 2011-03-15 * */ public class Test { public static void main(String[] args) { // 仓库对象 Storage storage = new Storage(); // 生产者对象 Producer p1 = new Producer(storage); Producer p2 = new Producer(storage); Producer p3 = new Producer(storage); Producer p4 = new Producer(storage); Producer p5 = new Producer(storage); Producer p6 = new Producer(storage); Producer p7 = new Producer(storage); // 消费者对象 Consumer c1 = new Consumer(storage); Consumer c2 = new Consumer(storage); Consumer c3 = new Consumer(storage); // 设置生产者产品生产数量 p1.setNum(10); p2.setNum(10); p3.setNum(10); p4.setNum(10); p5.setNum(10); p6.setNum(10); p7.setNum(80); // 设置消费者产品消费数量 c1.setNum(50); c2.setNum(20); c3.setNum(30); // 线程开始执行 c1.start(); c2.start(); c3.start(); p1.start(); p2.start(); p3.start(); p4.start(); p5.start(); p6.start(); p7.start(); } }
[ "victorzsnail@qq.com" ]
victorzsnail@qq.com
3f6c7857231cbce9da33b8114e5ef4dcb5a25228
e44759c6e645b4d024e652ab050e7ed7df74eba3
/src/org/ace/insurance/system/common/district/service/interfaces/IDistrictService.java
530e66bf979b775699b7dfe77e605f6f018ca88d
[]
no_license
LifeTeam-TAT/MI-Core
5f779870b1328c23b192668308ee25c532ab6280
8c5c4466da13c7a8bc61df12a804f840417e2513
refs/heads/master
2023-04-04T13:36:11.616392
2021-04-02T14:43:34
2021-04-02T14:43:34
354,033,545
0
0
null
null
null
null
UTF-8
Java
false
false
2,158
java
/*************************************************************************************** * @author YYK * @Date 2016-May-6 * @Version 1.0 * @Purpose This interface serves as the Service Layer to manipulate the <code>District</code> object. * * ***************************************************************************************/ package org.ace.insurance.system.common.district.service.interfaces; import java.util.List; import org.ace.insurance.system.common.district.DIS001; import org.ace.insurance.system.common.district.District; import org.ace.insurance.system.common.district.DistrictCriteria; public interface IDistrictService { /** * This method serves as the service method to insert district instance into * database. * * @param District */ public void addNewDistrict(District District); /** * This method serves as the service method to update district instance into * database. * * @param District */ public void updateDistrict(District District); /** * This method serves as the service method to delete district instance into * database. * * @param District */ public void deleteDistrict(District District); /** * This method serves as the service method to find district instance by ID * from database. * * @param id * @return District */ public District findDistrictById(String id); /** * This method serves as the service method to find all district instances * from database. * * @return List<District> */ public List<District> findAllDistrict(); /** * This method serves as the service method to find all District001 * instances by criteria from database. * * @return List<District001> */ public List<DIS001> findByCriteria(DistrictCriteria criteria); /** * This method serves as the service method to find all District001 * instances from database. * * @return List<District001> */ public List<DIS001> findAll_DIS001(); /** * This method serves as the service method to delete district instances by * id from database. * * @return List<District001> */ public void deleteDistrictById(String districtId); }
[ "lifeteam.tat@gmail.com" ]
lifeteam.tat@gmail.com
c435a13fdb42823d450dcf5db637f6c27e45bd1a
e949ab5a99ac25629fcde45d6445e42b776ba6f0
/uizacoresdk/src/main/java/vn/uiza/views/placeholderview/lib/placeholderview/Animation.java
7f526dfbc3a2bd7c246784c47d91a4688062e30e
[ "BSD-2-Clause", "LicenseRef-scancode-unknown-license-reference", "BSD-3-Clause" ]
permissive
GianhTran/uiza-android-sdk-player
056a29a315d2f41aca69a96d3e62f6dca4358bcf
13f78c299907867073bae21867c3533d31531cc4
refs/heads/master
2020-03-30T00:33:32.145718
2018-09-17T04:55:56
2018-09-17T04:55:56
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,076
java
package vn.uiza.views.placeholderview.lib.placeholderview; import android.view.View; import android.view.animation.AccelerateInterpolator; import android.view.animation.DecelerateInterpolator; /** * Created by janisharali on 20/08/16. */ public class Animation { public static final int ENTER_LEFT_DESC = 1; public static final int ENTER_LEFT_ASC = 2; public static final int ENTER_RIGHT_DESC = 3; public static final int ENTER_RIGHT_ASC = 4; public static final int ENTER_TOP_DESC = 5; public static final int ENTER_TOP_ASC = 6; public static final int ENTER_BOTTOM_DESC = 7; public static final int ENTER_BOTTOM_ASC = 8; public static final int SCALE_UP_DESC = 9; public static final int SCALE_UP_ASC = 10; public static final int SCALE_DOWN_DESC = 11; public static final int SCALE_DOWN_ASC = 12; public static final int FADE_IN_DESC = 13; public static final int FADE_IN_ASC = 14; public static final int CARD_LEFT_IN_DESC = 15; public static final int CARD_LEFT_IN_ASC = 16; public static final int CARD_RIGHT_IN_DESC = 17; public static final int CARD_RIGHT_IN_ASC = 18; public static final int CARD_TOP_IN_DESC = 19; public static final int CARD_TOP_IN_ASC = 20; public static final int CARD_BOTTOM_IN_DESC = 21; public static final int CARD_BOTTOM_IN_ASC = 22; public static final int ANIM_DURATION = 300; public static final float ANIM_INTERPOLATION_FACTOR = 0.3f; protected static final float ANIM_SCALE_FACTOR_MIN = 0.5f; protected static final float ANIM_SCALE_FACTOR_ORIGINAL = 1.0f; protected static final float ANIM_SCALE_FACTOR_MAX = 1.25f; protected static final float ANIM_ALPHA_MIN = 0f; protected static final float ANIM_ALPHA_MAX = 1.0f; /** * * @param view * @param xInit * @param xFinal * @param factor * @param duration * @param <V> */ protected static <V extends View>void itemAnimFromXDesc(V view, float xInit, float xFinal, float factor, int duration){ view.setTranslationX(xInit); view.animate() .translationX(xFinal) .setInterpolator(new DecelerateInterpolator(factor)) .setDuration(duration) .start(); } /** * * @param view * @param xInit * @param xFinal * @param factor * @param duration * @param <V> */ protected static <V extends View>void itemAnimFromXAsc(V view, float xInit, float xFinal, float factor, int duration){ view.setTranslationX(xInit); view.animate() .translationX(xFinal) .setInterpolator(new AccelerateInterpolator(factor)) .setDuration(duration) .start(); } /** * * @param view * @param yInit * @param yFinal * @param factor * @param duration * @param <V> */ protected static <V extends View>void itemAnimFromYDesc(V view, float yInit, float yFinal, float factor, int duration){ view.setTranslationY(yInit); view.animate() .translationY(yFinal) .setInterpolator(new DecelerateInterpolator(factor)) .setDuration(duration) .start(); } /** * * @param view * @param yInit * @param yFinal * @param factor * @param duration * @param <V> */ protected static <V extends View>void itemAnimFromYAsc(V view, float yInit, float yFinal, float factor, int duration){ view.setTranslationY(yInit); view.animate() .translationY(yFinal) .setInterpolator(new AccelerateInterpolator(factor)) .setDuration(duration) .start(); } /** * * @param view * @param scaleInitial * @param scaleFinal * @param factor * @param duration * @param <V> */ protected static <V extends View>void itemAnimScaleDesc(V view, float scaleInitial, float scaleFinal, float factor, int duration){ view.setScaleX(scaleInitial); view.setScaleY(scaleInitial); view.animate() .scaleX(scaleFinal) .scaleY(scaleFinal) .setInterpolator(new DecelerateInterpolator(factor)) .setDuration(duration) .start(); } /** * * @param view * @param scaleInitial * @param scaleFinal * @param factor * @param duration * @param <V> */ protected static <V extends View>void itemAnimScaleAsc(V view, float scaleInitial, float scaleFinal, float factor, int duration){ view.setScaleX(scaleInitial); view.setScaleY(scaleInitial); view.animate() .scaleX(scaleFinal) .scaleY(scaleFinal) .setInterpolator(new AccelerateInterpolator(factor)) .setDuration(duration) .start(); } /** * * @param view * @param alphaInitial * @param alphaFinal * @param factor * @param duration * @param <V> */ protected static <V extends View>void itemAnimFadeDesc(V view, float alphaInitial, float alphaFinal, float factor, int duration){ view.setAlpha(alphaInitial); view.animate() .alpha(alphaFinal) .setInterpolator(new DecelerateInterpolator(factor)) .setDuration(duration) .start(); } /** * * @param view * @param alphaInitial * @param alphaFinal * @param factor * @param duration * @param <V> */ protected static <V extends View>void itemAnimFadeAsc(V view, float alphaInitial, float alphaFinal, float factor, int duration){ view.setAlpha(alphaInitial); view.animate() .alpha(alphaFinal) .setInterpolator(new AccelerateInterpolator(factor)) .setDuration(duration) .start(); } }
[ "loitp@pateco.vn" ]
loitp@pateco.vn
2b045ffabb54ebd6d0dd0e4576a1b85e91e542ea
e1e5bd6b116e71a60040ec1e1642289217d527b0
/H5/L2jMaster_org/L2jMaster_org_2019_07_02/L2JMaster_DataPack/dist/game/data/scripts/handlers/itemhandlers/BeastSpiritShot.java
5be81a3e462c569526ce53f240ad35c93be4b3e0
[]
no_license
serk123/L2jOpenSource
6d6e1988a421763a9467bba0e4ac1fe3796b34b3
603e784e5f58f7fd07b01f6282218e8492f7090b
refs/heads/master
2023-03-18T01:51:23.867273
2020-04-23T10:44:41
2020-04-23T10:44:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,828
java
/* * Copyright (C) 2004-2019 L2J DataPack * * This file is part of L2J DataPack. * * L2J DataPack 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. * * L2J DataPack is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package handlers.itemhandlers; import java.util.logging.Level; import com.l2jserver.gameserver.enums.ShotType; import com.l2jserver.gameserver.handler.IItemHandler; import com.l2jserver.gameserver.model.actor.L2Playable; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.holders.SkillHolder; import com.l2jserver.gameserver.model.items.instance.L2ItemInstance; import com.l2jserver.gameserver.network.SystemMessageId; import com.l2jserver.gameserver.network.serverpackets.MagicSkillUse; import com.l2jserver.gameserver.network.serverpackets.SystemMessage; import com.l2jserver.gameserver.util.Broadcast; /** * Beast SpiritShot Handler * @author Tempy */ public class BeastSpiritShot implements IItemHandler { @Override public boolean useItem(L2Playable playable, L2ItemInstance item, boolean forceUse) { if (!playable.isPlayer()) { playable.sendPacket(SystemMessageId.ITEM_NOT_FOR_PETS); return false; } final L2PcInstance activeOwner = playable.getActingPlayer(); if (!activeOwner.hasSummon()) { activeOwner.sendPacket(SystemMessageId.PETS_ARE_NOT_AVAILABLE_AT_THIS_TIME); return false; } if (activeOwner.getSummon().isDead()) { activeOwner.sendPacket(SystemMessageId.SOULSHOTS_AND_SPIRITSHOTS_ARE_NOT_AVAILABLE_FOR_A_DEAD_PET); return false; } final int itemId = item.getId(); final boolean isBlessed = ((itemId == 6647) || (itemId == 20334)); // TODO: Unhardcode these! final short shotConsumption = activeOwner.getSummon().getSpiritShotsPerHit(); final SkillHolder[] skills = item.getItem().getSkills(); if (skills == null) { _log.log(Level.WARNING, getClass().getSimpleName() + ": is missing skills!"); return false; } long shotCount = item.getCount(); if (shotCount < shotConsumption) { // Not enough SpiritShots to use. if (!activeOwner.disableAutoShot(itemId)) { activeOwner.sendPacket(SystemMessageId.NOT_ENOUGH_SPIRITHOTS_FOR_PET); } return false; } if (activeOwner.getSummon().isChargedShot(isBlessed ? ShotType.BLESSED_SPIRITSHOTS : ShotType.SPIRITSHOTS)) { // shots are already active. return false; } if (!activeOwner.destroyItemWithoutTrace("Consume", item.getObjectId(), shotConsumption, null, false)) { if (!activeOwner.disableAutoShot(itemId)) { activeOwner.sendPacket(SystemMessageId.NOT_ENOUGH_SPIRITHOTS_FOR_PET); } return false; } activeOwner.getSummon().setChargedShot(isBlessed ? ShotType.BLESSED_SPIRITSHOTS : ShotType.SPIRITSHOTS, true); SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.USE_S1_); sm.addItemName(itemId); activeOwner.sendPacket(sm); activeOwner.sendPacket(SystemMessageId.PET_USE_SPIRITSHOT); Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(activeOwner.getSummon(), activeOwner.getSummon(), skills[0].getSkillId(), skills[0].getSkillLvl(), 0, 0), 600); return true; } }
[ "64197706+L2jOpenSource@users.noreply.github.com" ]
64197706+L2jOpenSource@users.noreply.github.com
96834d54a60784a0c27b37ed1000b153e5be1936
3da6f1593ae3c0d6fd0bef0f81825a6dcb4f562b
/spring-context/src/test/java/org/springframework/scripting/support/StubMessenger.java
3b978d58f303993ba99edb1f52afa8ccd9baff66
[ "Apache-2.0" ]
permissive
binfooo/spring
c784f3b49717bb65c6bdf0eb8db08f3f36852006
a1f1a3e6f0a7a26641fe5f925aae76a2d32e566c
refs/heads/master
2023-02-23T12:11:02.335887
2021-01-30T01:54:25
2021-01-30T01:54:25
334,065,384
1
0
null
null
null
null
UTF-8
Java
false
false
425
java
package org.springframework.scripting.support; import org.springframework.scripting.ConfigurableMessenger; /** * @author Rick Evans */ public class StubMessenger implements ConfigurableMessenger { private String message = "I used to be smart... now I'm just stupid."; @Override public void setMessage(String message) { this.message = message; } @Override public String getMessage() { return message; } }
[ "LinHJ090827" ]
LinHJ090827
10c0137ee24032dc334bf0a14714c36f41292b7d
f6c629b0022dc26a4588075ae7c2d620b8c1398f
/netbird-android-support/src/cc/colorcat/netbird3/android/AndroidPlatform.java
d4714be2f4a384c1e856bc0cc897505627b877f6
[]
no_license
fireworld/NetBird3
dd110c003ca879c02d082e224cc8097f6fedf470
21716f15a79f974b5f6d3c8c1b3dba9c27cf7e4d
refs/heads/master
2021-09-05T04:07:52.394675
2018-01-24T03:08:59
2018-01-24T03:08:59
111,074,694
0
0
null
null
null
null
UTF-8
Java
false
false
752
java
package cc.colorcat.netbird3.android; import cc.colorcat.netbird3.Connection; import cc.colorcat.netbird3.Platform; import cc.colorcat.netbird3.platform.Logger; import cc.colorcat.netbird3.platform.Scheduler; /** * Created by cxx on 17-11-20. * xx.ch@outlook.com */ public class AndroidPlatform extends Platform { private final Connection connection = new AndroidHttpConnection(); private final Scheduler scheduler = new AndroidScheduler(); private final Logger logger = new AndroidLogger(); @Override public Connection connection() { return connection; } @Override public Scheduler scheduler() { return scheduler; } @Override public Logger logger() { return logger; } }
[ "xx.ch@outlook.com" ]
xx.ch@outlook.com
59e65b7c9db5fb5fd9ca14fe335bb55639ef8717
d67f6450b24fb08f2f61b74dcdecce3025ee3efc
/gemp-swccg-cards/src/main/java/com/gempukku/swccgo/cards/set8/light/Card8_071.java
64f07df01de9cff503e2d5c5dd9e871d5b5cafbc
[ "MIT" ]
permissive
cburyta/gemp-swccg-public
00a974d042195e69d3c104e61e9ee5bd48728f9a
05529086de91ecb03807fda820d98ec8a1465246
refs/heads/master
2023-01-09T12:45:33.347296
2020-10-26T14:39:28
2020-10-26T14:39:28
309,400,711
0
0
MIT
2020-11-07T04:57:04
2020-11-02T14:47:59
null
UTF-8
Java
false
false
2,224
java
package com.gempukku.swccgo.cards.set8.light; import com.gempukku.swccgo.cards.AbstractSite; import com.gempukku.swccgo.cards.conditions.ControlsCondition; import com.gempukku.swccgo.common.Icon; import com.gempukku.swccgo.common.Side; import com.gempukku.swccgo.common.Title; import com.gempukku.swccgo.filters.Filters; import com.gempukku.swccgo.game.PhysicalCard; import com.gempukku.swccgo.game.SwccgGame; import com.gempukku.swccgo.logic.modifiers.DeployCostToLocationModifier; import com.gempukku.swccgo.logic.modifiers.DeploysFreeToLocationModifier; import com.gempukku.swccgo.logic.modifiers.ForfeitModifier; import com.gempukku.swccgo.logic.modifiers.Modifier; import java.util.LinkedList; import java.util.List; /** * Set: Endor * Type: Location * Subtype: Site * Title: Endor: Chief Chirpa's Hut */ public class Card8_071 extends AbstractSite { public Card8_071() { super(Side.LIGHT, Title.Chief_Chirpas_Hut, Title.Endor); setLocationDarkSideGameText("If you control Chief Chirpa's Hut, Ewoks at Endor sites are forfeit -1."); setLocationLightSideGameText("Your Ewoks are deploy -1 here. Chief Chirpa deploys free here."); addIcon(Icon.LIGHT_FORCE, 2); addIcons(Icon.ENDOR, Icon.INTERIOR_SITE, Icon.PLANET); } @Override protected List<Modifier> getGameTextDarkSideWhileActiveModifiers(String playerOnDarkSideOfLocation, SwccgGame game, PhysicalCard self) { List<Modifier> modifiers = new LinkedList<Modifier>(); modifiers.add(new ForfeitModifier(self, Filters.and(Filters.Ewok, Filters.at(Filters.Endor_site)), new ControlsCondition(playerOnDarkSideOfLocation, Filters.Chief_Chirpas_Hut), -1)); return modifiers; } @Override protected List<Modifier> getGameTextLightSideWhileActiveModifiers(String playerOnLightSideOfLocation, SwccgGame game, PhysicalCard self) { List<Modifier> modifiers = new LinkedList<Modifier>(); modifiers.add(new DeployCostToLocationModifier(self, Filters.and(Filters.your(playerOnLightSideOfLocation), Filters.Ewok), -1, self)); modifiers.add(new DeploysFreeToLocationModifier(self, Filters.Chief_Chirpa, self)); return modifiers; } }
[ "andrew@bender.io" ]
andrew@bender.io
1cc124d83edc00d2fb7d2d4f3656b795154c0f9d
129f58086770fc74c171e9c1edfd63b4257210f3
/src/testcases/CWE369_Divide_by_Zero/CWE369_Divide_by_Zero__float_connect_tcp_modulo_51b.java
5d50e53f8a772f29fed453cb616ffe2cd5773e45
[]
no_license
glopezGitHub/Android23
1bd0b6a6c7ce3c7439a74f1e4dcef2c4c0fac4ba
6215d0684c4fbdc7217ccfbedfccfca69824cc5e
refs/heads/master
2023-03-07T15:14:59.447795
2023-02-06T13:59:49
2023-02-06T13:59:49
6,856,387
0
3
null
2023-02-06T18:38:17
2012-11-25T22:04:23
Java
UTF-8
Java
false
false
1,721
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE369_Divide_by_Zero__float_connect_tcp_modulo_51b.java Label Definition File: CWE369_Divide_by_Zero__float.label.xml Template File: sources-sinks-51b.tmpl.java */ /* * @description * CWE: 369 Divide by zero * BadSource: connect_tcp Read data using an outbound tcp connection * GoodSource: A hardcoded non-zero number (two) * Sinks: modulo * GoodSink: Check for zero before modulo * BadSink : Modulo by a value that may be zero * Flow Variant: 51 Data flow: data passed as an argument from one function to another in different classes in the same package * * */ package testcases.CWE369_Divide_by_Zero; import testcasesupport.*; import java.sql.*; import javax.servlet.http.*; import java.security.SecureRandom; public class CWE369_Divide_by_Zero__float_connect_tcp_modulo_51b { public void bad_sink(float data ) throws Throwable { /* POTENTIAL FLAW: Possibly modulo by zero */ int result = (int)(100.0 % data); IO.writeLine(result); } /* goodG2B() - use goodsource and badsink */ public void goodG2B_sink(float data ) throws Throwable { /* POTENTIAL FLAW: Possibly modulo by zero */ int result = (int)(100.0 % data); IO.writeLine(result); } /* goodB2G() - use badsource and goodsink */ public void goodB2G_sink(float data ) throws Throwable { /* FIX: Check for value of or near zero before modulo */ if( Math.abs(data) > 0.000001 ) { int result = (int)(100.0 % data); IO.writeLine(result); } else { IO.writeLine("This would result in a modulo by zero"); } } }
[ "guillermo.pando@gmail.com" ]
guillermo.pando@gmail.com
96f76edf2bdfc487bc819e621b9e80572d868eb1
4b2c63d13f24585a3542576cdf64bd01db67c1ae
/platform/jsip/jain-sip-impl/src/main/java/org/freeims/javax/sip/parser/WarningParser.java
f6fe82897792e535a258c27919ce82329d9e64cf
[]
no_license
gugu-lee/freeims
ce1d0d92ab79c93dfc356971363f0faf6d228461
bbe2de872deb074531e12cf74204b7a29c91c354
refs/heads/master
2022-12-01T08:47:38.326261
2019-11-02T10:14:33
2019-11-02T10:14:33
58,299,201
0
0
null
2022-11-24T01:41:17
2016-05-08T06:11:46
Java
UTF-8
Java
false
false
6,520
java
/* * Conditions Of Use * * This software was developed by employees of the National Institute of * Standards and Technology (NIST), an agency of the Federal Government. * Pursuant to title 15 Untied States Code Section 105, works of NIST * employees are not subject to copyright protection in the United States * and are considered to be in the public domain. As a result, a formal * license is not needed to use the software. * * This software is provided by NIST as a service and is expressly * provided "AS IS." NIST MAKES NO WARRANTY OF ANY KIND, EXPRESS, IMPLIED * OR STATUTORY, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTY OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT * AND DATA ACCURACY. NIST does not warrant or make any representations * regarding the use of the software or the results thereof, including but * not limited to the correctness, accuracy, reliability or usefulness of * the software. * * Permission to use this software is contingent upon your acceptance * of the terms of this agreement * * . * */ package org.freeims.javax.sip.parser; import java.text.ParseException; import javax.sip.*; import org.freeims.core.*; import org.freeims.javax.sip.header.*; /** * Parser for Warning header. * * @version 1.2 * * @author Olivier Deruelle * @author M. Ranganathan * * * * @version 1.0 */ public class WarningParser extends HeaderParser { /** * Constructor * * @param warning - * Warning header to parse */ public WarningParser(String warning) { super(warning); } /** * Cosntructor * * @param lexer - * the lexer to use. */ protected WarningParser(Lexer lexer) { super(lexer); } /** * parse the String message * * @return SIPHeader (WarningList object) * @throws SIPParseException * if the message does not respect the spec. */ public SIPHeader parse() throws ParseException { WarningList warningList = new WarningList(); if (debug) dbg_enter("WarningParser.parse"); try { headerName(TokenTypes.WARNING); while (lexer.lookAhead(0) != '\n') { Warning warning = new Warning(); warning.setHeaderName(SIPHeaderNames.WARNING); // Parsing the 3digits code this.lexer.match(TokenTypes.ID); Token token = lexer.getNextToken(); try { int code = Integer.parseInt(token.getTokenValue()); warning.setCode(code); } catch (NumberFormatException ex) { throw createParseException(ex.getMessage()); } catch (InvalidArgumentException ex) { throw createParseException(ex.getMessage()); } this.lexer.SPorHT(); // Parsing the agent this.lexer.match(TokenTypes.ID); token = lexer.getNextToken(); // Bug reported by zvali@dev.java.net if (lexer.lookAhead(0) == ':') { this.lexer.match(':'); this.lexer.match(TokenTypes.ID); Token token2 = lexer.getNextToken(); warning.setAgent(token.getTokenValue() + ":" + token2.getTokenValue()); } else { warning.setAgent(token.getTokenValue()); } this.lexer.SPorHT(); // Parsing the text String text = this.lexer.quotedString(); warning.setText(text); this.lexer.SPorHT(); warningList.add(warning); while (lexer.lookAhead(0) == ',') { this.lexer.match(','); this.lexer.SPorHT(); warning = new Warning(); // Parsing the 3digits code this.lexer.match(TokenTypes.ID); Token tok = lexer.getNextToken(); try { int code = Integer.parseInt(tok.getTokenValue()); warning.setCode(code); } catch (NumberFormatException ex) { throw createParseException(ex.getMessage()); } catch (InvalidArgumentException ex) { throw createParseException(ex.getMessage()); } this.lexer.SPorHT(); // Parsing the agent this.lexer.match(TokenTypes.ID); tok = lexer.getNextToken(); // Bug reported by zvali@dev.java.net if (lexer.lookAhead(0) == ':') { this.lexer.match(':'); this.lexer.match(TokenTypes.ID); Token token2 = lexer.getNextToken(); warning.setAgent(tok.getTokenValue() + ":" + token2.getTokenValue()); } else { warning.setAgent(tok.getTokenValue()); } this.lexer.SPorHT(); // Parsing the text text = this.lexer.quotedString(); warning.setText(text); this.lexer.SPorHT(); warningList.add(warning); } } } finally { if (debug) dbg_leave("WarningParser.parse"); } return warningList; } /** * public static void main(String args[]) throws ParseException { String * warning[] = { "Warning: 307 isi.edu \"Session parameter 'foo' not * understood\"\n", "Warning: 301 isi.edu \"Incompatible network address * type 'E.164'\"\n", "Warning: 312 ii.edu \"Soda\", "+ " 351 i.edu \"I * network address 'E.164'\" , 323 ii.edu \"Sodwea\"\n", "Warning: 392 * 192.168.89.71:5060 \"Noisy feedback tells: pid=936 * req_src_ip=192.168.89.20 in_uri=sip:xxx@yyyy.org:5061 * out_uri=sip:xxx@yyyy.org:5061 via_cnt==1\"\n" }; * * for (int i = 0; i < warning.length; i++ ) { WarningParser parser = new * WarningParser(warning[i]); WarningList warningList= (WarningList) * parser.parse(); System.out.println("encoded = " + warningList.encode()); } * } */ }
[ "seven.stone.2012@gmail.com" ]
seven.stone.2012@gmail.com
948599016e116b6295ee6268071eac14d60327a6
1d928c3f90d4a0a9a3919a804597aa0a4aab19a3
/java/hibernate-orm/2015/4/IndexConstraintSource.java
5106bc56bf72e1a684b2fcd28303237a557527b9
[]
no_license
rosoareslv/SED99
d8b2ff5811e7f0ffc59be066a5a0349a92cbb845
a062c118f12b93172e31e8ca115ce3f871b64461
refs/heads/main
2023-02-22T21:59:02.703005
2021-01-28T19:40:51
2021-01-28T19:40:51
306,497,459
1
1
null
2020-11-24T20:56:18
2020-10-23T01:18:07
null
UTF-8
Java
false
false
1,256
java
/* * Hibernate, Relational Persistence for Idiomatic Java * * Copyright (c) 2014, Red Hat Inc. or third-party contributors as * indicated by the @author tags or express copyright attribution * statements applied by the authors. All third-party contributions are * distributed under license by Red Hat Inc. * * This copyrighted material is made available to anyone wishing to use, modify, * copy, or redistribute it subject to the terms and conditions of the GNU * Lesser General Public License, as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this distribution; if not, write to: * Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ package org.hibernate.boot.model.source.spi; /** * Defining a index constraint source * * @author Brett Meyer */ public interface IndexConstraintSource extends ConstraintSource { public boolean isUnique(); }
[ "rodrigosoaresilva@gmail.com" ]
rodrigosoaresilva@gmail.com
be0ff413570fe931cc1894dc2ea781af974052df
e8cd24201cbfadef0f267151ea5b8a90cc505766
/group11/729245768/DataStructure/src/main/coding_170507/TwoStackInOneArray.java
051d54e1d888840b6448a6e5b69b73935e6fe7dd
[]
no_license
XMT-CN/coding2017-s1
30dd4ee886dd0a021498108353c20360148a6065
382f6bfeeeda2e76ffe27b440df4f328f9eafbe2
refs/heads/master
2021-01-21T21:38:42.199253
2017-06-25T07:44:21
2017-06-25T07:44:21
94,863,023
0
0
null
null
null
null
UTF-8
Java
false
false
1,850
java
package main.coding_170507; import java.util.EmptyStackException; /** * 用一个数组实现两个栈 * 将数组的起始位置看作是第一个栈的栈底,将数组的尾部看作第二个栈的栈底,压栈时,栈顶指针分别向中间移动,直到两栈顶指针相遇,则扩容。 */ public class TwoStackInOneArray { Object[] data = new Object[10]; private int start = 0; private int end = data.length-1; /** * 向第一个栈中压入元素 * * @param o */ public void push1(Object o) { if(start==end){ throw new RuntimeException("栈满"); } data[start++] = o; } /** * 从第一个栈中弹出元素 * * @return */ public Object pop1() { if(start==0){ throw new EmptyStackException(); } return data[--start]; } /** * 获取第一个栈的栈顶元素 * * @return */ public Object peek1() { if(start==0){ throw new EmptyStackException(); } return data[start-1]; } /* * 向第二个栈压入元素 */ public void push2(Object o) { if(start==end){ throw new RuntimeException("栈满"); } data[end--] = o; } /** * 从第二个栈弹出元素 * * @return */ public Object pop2() { if(end==data.length-1){ throw new EmptyStackException(); } return data[++end]; } /** * 获取第二个栈的栈顶元素 * * @return */ public Object peek2() { if(end==data.length-1){ throw new EmptyStackException(); } return data[end+1]; } }
[ "542194147@qq.com" ]
542194147@qq.com
d179923eaa179eaae0f970f9cdc033965f1a1233
be3434872306571775a1482d56fb4a6d11164271
/src/test/java/com/banjjoknim/book/springboot/web/dto/HelloResponseDtoTest.java
71da4aeb72f554e4d5d461fc931e6642192988b6
[]
no_license
banjjoknim/SpringBootWebService
9d4ce8257e8fae10cd94f8f846627f75a90f2831
ea02a222802cecd99dec2eed9cf5bcd9537bd3b5
refs/heads/master
2023-01-23T21:53:15.056361
2020-12-06T13:04:22
2020-12-06T13:59:05
318,143,645
0
0
null
null
null
null
UTF-8
Java
false
false
511
java
package com.banjjoknim.book.springboot.web.dto; import org.junit.Test; import static org.assertj.core.api.Assertions.assertThat; public class HelloResponseDtoTest { @Test public void 롬복_기능_테스트() { // given String name = "test"; int amount = 1000; // when HelloResponseDto dto = new HelloResponseDto(name, amount); // then assertThat(dto.getName()).isEqualTo(name); assertThat(dto.getAmount()).isEqualTo(amount); } }
[ "zhfxmtkachdt@daum.net" ]
zhfxmtkachdt@daum.net
42ffc9fa007cd1b5f32a7e25f6e04cf0f4a267c1
cda820560738cbaee83e50c4a16da44bd98741ff
/spring-boot-rabbitmq/src/main/java/com/william/mq/spring_boot/config/RabbitMQConfig.java
826ae1654be678e833aa35f20e1c3d9972d4bf05
[]
no_license
dwj1979/spring-boot-super-samples
d610c79e01132c7ad44beb0fc535e514bd6b668c
a411e04a05c1f547cc361172c13ac789d4d4fac4
refs/heads/master
2021-05-11T10:24:36.624821
2017-12-05T10:09:30
2017-12-05T10:09:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
442
java
package com.william.mq.spring_boot.config; import org.springframework.amqp.core.Queue; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; /** * Created by sungang on 2017/11/30. */ @Configuration public class RabbitMQConfig { public static final String QUEUE_NAME = "spring-boot-simple"; @Bean public Queue queue() { return new Queue(QUEUE_NAME); } }
[ "1120sungang@gmail.com" ]
1120sungang@gmail.com
1b6931af37f8128860a4a6cef222843006ca786d
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/2/2_6935e0cbbef38d0b164cbc77cdb6fceaf4034845/RestriccioTemps/2_6935e0cbbef38d0b164cbc77cdb6fceaf4034845_RestriccioTemps_s.java
a90b2b8147d1b5aba1a1a6d5ca9379b66d359bda
[]
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
823
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package Domini; import java.util.ArrayList; /** * * @author Daniel Albarral */ public class RestriccioTemps { private ArrayList<Integer> dilluns; private ArrayList<Integer> dimarts; private ArrayList<Integer> dimecres; private ArrayList<Integer> dijous; private ArrayList<Integer> divendres; private ArrayList<Integer> dissabte; private ArrayList<Integer> diumenge; /** * * @return Arraylist amb tots els dies i hores disponibles L->dia, R->hora */ public ArrayList<Pair<String,Integer>> disponibilitat(){ ArrayList<Pair<String,Integer>> disponibilitat = new ArrayList(); return disponibilitat; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
49323faef924f8878635539a262b3fc9e9bcdb20
6f36e847fbacb814f7ba041fe060dab32fa1be74
/springboot-shiro/src/main/java/com/study/user/security/shiro/XTokenWebSessionManager.java
dd130f6fad42f0b4b55ef0d6cf194b1f08808f16
[]
no_license
wcl19860926/springboot-demo
b3d31f2a03bb3edc3097abad55d356f0505a2d28
c71827acda26314ecd80dfd024e7858147f4c3b3
refs/heads/main
2023-03-09T15:31:28.805200
2021-02-28T11:34:05
2021-02-28T11:34:05
342,522,874
0
0
null
null
null
null
UTF-8
Java
false
false
1,705
java
package com.study.user.security.shiro; import org.apache.shiro.session.Session; import org.apache.shiro.session.SessionException; import org.apache.shiro.session.mgt.DefaultSessionKey; import org.apache.shiro.session.mgt.SessionKey; import org.apache.shiro.web.session.mgt.DefaultWebSessionManager; import org.apache.shiro.web.util.WebUtils; import javax.servlet.http.HttpServletRequest; /** * XTokenWebSessionManager <br> * @author xiquee.com <br> * @date 2018-11-09 10:16:00 */ public class XTokenWebSessionManager extends DefaultWebSessionManager { public static final String HEADER_TOKEN = "x-token"; /** * 获取session, 对于跨域请求,所有请求都是无状态的,无法从cookie中获取sessionId, * 因此对于跨域请求,要求在http header 中添加 token 头,这里优先从http头中读取token, * 如果存在token,则以token作为sessionId * * @param key --session key * @return * @throws SessionException */ @Override public Session getSession(SessionKey key) throws SessionException { if (key instanceof DefaultSessionKey) { String headerToken = getTokenFromHeader(key); if (headerToken != null && headerToken.trim().length() > 0) { ((DefaultSessionKey) key).setSessionId(headerToken); } } return super.getSession(key); } private String getTokenFromHeader(SessionKey key) { HttpServletRequest request = (HttpServletRequest) WebUtils.getRequest(key); if (request != null) { String token = request.getHeader(HEADER_TOKEN); return token; } return null; } }
[ "694216530@qq.com" ]
694216530@qq.com
2275d814ec2983bdedb20f6c86e9549f4532aecc
906275798ed0ab17495dbf1f31759845818daa81
/src/main/java/org/jukeboxmc/item/ItemRepeatingCommandBlock.java
7d45599aa104bb021cee337f995398e4f10bbdda
[]
no_license
yequid/JukeboxMC
c7995034bc5bd55280e3bf96b765eddacbe08e8f
8a53fc2bed231d0872699d6efa88ef843a74001b
refs/heads/master
2023-02-15T05:45:12.260350
2021-01-07T15:00:24
2021-01-07T15:00:24
326,658,755
0
0
null
2021-01-07T15:00:25
2021-01-04T11:15:15
Java
UTF-8
Java
false
false
240
java
package org.jukeboxmc.item; /** * @author LucGamesYT * @version 1.0 */ public class ItemRepeatingCommandBlock extends Item { public ItemRepeatingCommandBlock() { super( "minecraft:repeating_command_block", 188 ); } }
[ "beckerluca16@gmail.com" ]
beckerluca16@gmail.com
68cc5377f2df69b5b48aa5488427371567deccfd
1d928c3f90d4a0a9a3919a804597aa0a4aab19a3
/java/hibernate-orm/2015/4/Schema.java
37576a2312b5bff5434d8ba67629714af4f49942
[]
no_license
rosoareslv/SED99
d8b2ff5811e7f0ffc59be066a5a0349a92cbb845
a062c118f12b93172e31e8ca115ce3f871b64461
refs/heads/main
2023-02-22T21:59:02.703005
2021-01-28T19:40:51
2021-01-28T19:40:51
306,497,459
1
1
null
2020-11-24T20:56:18
2020-10-23T01:18:07
null
UTF-8
Java
false
false
7,182
java
/* * Hibernate, Relational Persistence for Idiomatic Java * * Copyright (c) 2015, Red Hat Inc. or third-party contributors as * indicated by the @author tags or express copyright attribution * statements applied by the authors. All third-party contributions are * distributed under license by Red Hat Inc. * * This copyrighted material is made available to anyone wishing to use, modify, * copy, or redistribute it subject to the terms and conditions of the GNU * Lesser General Public License, as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this distribution; if not, write to: * Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ package org.hibernate.boot.model.relational; import java.util.Collection; import java.util.Map; import java.util.TreeMap; import org.hibernate.HibernateException; import org.hibernate.boot.model.naming.Identifier; import org.hibernate.internal.CoreLogging; import org.hibernate.internal.CoreMessageLogger; import org.hibernate.internal.util.compare.EqualsHelper; import org.hibernate.mapping.DenormalizedTable; import org.hibernate.mapping.Table; /** * Represents a named schema/catalog pair and manages objects defined within. * * @author Steve Ebersole */ public class Schema { private static final CoreMessageLogger log = CoreLogging.messageLogger( Schema.class ); private final Database database; private final Name name; private final Name physicalName; private Map<Identifier, Table> tables = new TreeMap<Identifier, Table>(); private Map<Identifier, Sequence> sequences = new TreeMap<Identifier, Sequence>(); public Schema(Database database, Name name) { this.database = database; this.name = name; final Identifier physicalCatalogIdentifier = database.getPhysicalNamingStrategy() .toPhysicalCatalogName( name.getCatalog(), database.getJdbcEnvironment() ); final Identifier physicalSchemaIdentifier = database.getPhysicalNamingStrategy() .toPhysicalCatalogName( name.getSchema(), database.getJdbcEnvironment() ); this.physicalName = new Name( physicalCatalogIdentifier, physicalSchemaIdentifier ); } public Name getName() { return name; } public Name getPhysicalName() { return physicalName; } public Collection<Table> getTables() { return tables.values(); } /** * Returns the table with the specified logical table name. * * @param logicalTableName - the logical name of the table * * @return the table with the specified table name, * or null if there is no table with the specified * table name. */ public Table locateTable(Identifier logicalTableName) { return tables.get( logicalTableName ); } /** * Creates a mapping Table instance. * * @param logicalTableName The logical table name * * @return the created table. */ public Table createTable(Identifier logicalTableName, boolean isAbstract) { final Table existing = tables.get( logicalTableName ); if ( existing != null ) { return existing; } final Identifier physicalTableName = database.getPhysicalNamingStrategy().toPhysicalTableName( logicalTableName, database.getJdbcEnvironment() ); Table table = new Table( this, physicalTableName, isAbstract ); tables.put( logicalTableName, table ); return table; } public DenormalizedTable createDenormalizedTable(Identifier logicalTableName, boolean isAbstract, Table includedTable) { final Table existing = tables.get( logicalTableName ); if ( existing != null ) { // for now assume it is return (DenormalizedTable) existing; } final Identifier physicalTableName = database.getPhysicalNamingStrategy().toPhysicalTableName( logicalTableName, database.getJdbcEnvironment() ); DenormalizedTable table = new DenormalizedTable( this, physicalTableName, isAbstract, includedTable ); tables.put( logicalTableName, table ); return table; } public Sequence locateSequence(Identifier name) { return sequences.get( name ); } public Sequence createSequence(Identifier logicalName, int initialValue, int increment) { if ( sequences.containsKey( logicalName ) ) { throw new HibernateException( "Sequence was already registered with that name [" + logicalName.toString() + "]" ); } final Identifier physicalName = database.getPhysicalNamingStrategy().toPhysicalSequenceName( logicalName, database.getJdbcEnvironment() ); Sequence sequence = new Sequence( this.physicalName.getCatalog(), this.physicalName.getSchema(), physicalName, initialValue, increment ); sequences.put( logicalName, sequence ); return sequence; } @Override public String toString() { return "Schema" + "{name=" + name + '}'; } @Override public boolean equals(Object o) { if ( this == o ) { return true; } if ( o == null || getClass() != o.getClass() ) { return false; } final Schema that = (Schema) o; return EqualsHelper.equals( this.name, that.name ); } @Override public int hashCode() { return name.hashCode(); } public Iterable<Sequence> getSequences() { return sequences.values(); } public static class Name implements Comparable<Name> { private final Identifier catalog; private final Identifier schema; public Name(Identifier catalog, Identifier schema) { this.schema = schema; this.catalog = catalog; } public Identifier getCatalog() { return catalog; } public Identifier getSchema() { return schema; } @Override public String toString() { return "Name" + "{catalog=" + catalog + ", schema=" + schema + '}'; } @Override public boolean equals(Object o) { if ( this == o ) { return true; } if ( o == null || getClass() != o.getClass() ) { return false; } final Name that = (Name) o; return EqualsHelper.equals( this.catalog, that.catalog ) && EqualsHelper.equals( this.schema, that.schema ); } @Override public int hashCode() { int result = catalog != null ? catalog.hashCode() : 0; result = 31 * result + (schema != null ? schema.hashCode() : 0); return result; } @Override public int compareTo(Name that) { // per Comparable, the incoming Name cannot be null. However, its catalog/schema might be // so we need to account for that. int catalogCheck = ComparableHelper.compare( this.getCatalog(), that.getCatalog() ); if ( catalogCheck != 0 ) { return catalogCheck; } return ComparableHelper.compare( this.getSchema(), that.getSchema() ); } } public static class ComparableHelper { public static <T extends Comparable<T>> int compare(T first, T second) { if ( first == null ) { if ( second == null ) { return 0; } else { return 1; } } else { if ( second == null ) { return -1; } else { return first.compareTo( second ); } } } } }
[ "rodrigosoaresilva@gmail.com" ]
rodrigosoaresilva@gmail.com
ff628adf0e3c0520ca23f7625d549485d1e2808a
f0d825d67f22bdda6455747fd6198137814c4d5f
/src/main/java/com/xmbl/ops/model/course/CourseLevelEntity.java
b3931baaa3215b0ddb04ba9cdd4f6fdbedf18a86
[]
no_license
noseparte/boma-platform
3084d208be17d82dca31f0af5ca041127ac3483c
a7a9dc63afda6d50681794a6d46fd88c439ab15a
refs/heads/master
2020-04-12T09:46:34.019100
2018-12-20T08:29:53
2018-12-20T08:29:53
162,407,564
0
0
null
null
null
null
UTF-8
Java
false
false
698
java
package com.xmbl.ops.model.course; import com.xmbl.ops.model.mongo.base.GeneralBean; import lombok.Data; import org.springframework.data.mongodb.core.mapping.Document; /** * Copyright © 2018 noseparte © BeiJing BoLuo Network Technology Co. Ltd. * * @Author Noseparte * @Compile -- * @Version 1.0 * @Description 课程层次 */ @Data @Document(collection = "bm_edu_course_level") public class CourseLevelEntity extends GeneralBean { private int level; //层级 private String levelName; //层级名称 private String levelCode; //层级编号 private String levelDec; //层级描述 }
[ "noseparte@aliyun.com" ]
noseparte@aliyun.com
d7fbcdd248f1182ac1e6dccf2b74798f7b1bbbcf
634ae05c5e190412b2c50a7b5317c3d331322bdf
/Sandbox/src/main/java/demo/generics/model/Partner.java
b39b8270cec94cb05a5e84c96e5b9600a11f9d84
[]
no_license
ganqzz/java_workspace
1b919aff1f177c5b6971e7f19f465129a247ed72
3a7285e9b1945c8b55a4b02bbb20aee3d31a9086
refs/heads/master
2023-07-16T06:03:36.310878
2021-09-04T03:44:37
2021-09-04T03:44:37
389,467,395
0
0
null
null
null
null
UTF-8
Java
false
false
339
java
package demo.generics.model; public class Partner extends Person { public Partner(final String name, final int age) { super(name, age); } @Override public String toString() { return "Partner{" + "name='" + getName() + '\'' + ", age=" + getAge() + '}'; } }
[ "ganqzz@users.noreply.github.com" ]
ganqzz@users.noreply.github.com
338011ec8aba04488d80e4d51b07a476266621f1
e3a09a1c199fb3e32d1e43c1393ec133fa34ceab
/game/data/scripts/handlers/skillconditionhandlers/OpNotTerritorySkillCondition.java
0b4e6e9873bd60bcca77490f78fa8f8d92ce60d3
[]
no_license
Refuge89/l2mobius-helios
0fbaf2a11b02ce12c7970234d4b52efa066ef122
d1251e1fb5a2a40925839579bf459083a84b0c59
refs/heads/master
2020-03-23T01:37:03.354874
2018-07-14T06:52:51
2018-07-14T06:52:51
140,927,248
1
0
null
2018-07-14T07:49:40
2018-07-14T07:49:39
null
UTF-8
Java
false
false
1,267
java
/* * This file is part of the L2J Mobius project. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package handlers.skillconditionhandlers; import com.l2jmobius.gameserver.model.L2Object; import com.l2jmobius.gameserver.model.StatsSet; import com.l2jmobius.gameserver.model.actor.L2Character; import com.l2jmobius.gameserver.model.skills.ISkillCondition; import com.l2jmobius.gameserver.model.skills.Skill; public class OpNotTerritorySkillCondition implements ISkillCondition { public OpNotTerritorySkillCondition(StatsSet params) { } @Override public boolean canUse(L2Character caster, Skill skill, L2Object target) { return true; // TODO: } }
[ "conan_513@hotmail.com" ]
conan_513@hotmail.com
48ccce9f61b648b6af7114c75199551950d1b683
148100c6a5ac58980e43aeb0ef41b00d76dfb5b3
/sources/com/google/android/gms/internal/phenotype/zzh.java
9c2f4a5f3acd7633a6c72a4d2c87b5f456dbedba
[]
no_license
niravrathod/car_details
f979de0b857f93efe079cd8d7567f2134755802d
398897c050436f13b7160050f375ec1f4e05cdf8
refs/heads/master
2020-04-13T16:36:29.854057
2018-12-27T19:03:46
2018-12-27T19:03:46
163,325,703
0
0
null
null
null
null
UTF-8
Java
false
false
571
java
package com.google.android.gms.internal.phenotype; import android.annotation.SuppressLint; import android.content.Context; public final class zzh<T> { /* renamed from: a */ private static final Object f10390a = new Object(); @SuppressLint({"StaticFieldLeak"}) /* renamed from: b */ private static Context f10391b = null; /* renamed from: c */ private static boolean f10392c = false; /* renamed from: d */ private static volatile Boolean f10393d = null; /* renamed from: e */ private static volatile Boolean f10394e = null; }
[ "niravrathod473@gmail.com" ]
niravrathod473@gmail.com
6c40e4addd7bff9c6057a96171e383ae991bdd00
ff0c33ccd3bbb8a080041fbdbb79e29989691747
/java.xml/com/sun/org/apache/bcel/internal/generic/POP.java
c9b8241367d7ab5d6e029e782fec32e84a8e66d8
[]
no_license
jiecai58/jdk15
7d0f2e518e3f6669eb9ebb804f3c89bbfb2b51f0
b04691a72e51947df1b25c31175071f011cb9bbe
refs/heads/main
2023-02-25T00:30:30.407901
2021-01-29T04:48:33
2021-01-29T04:48:33
330,704,930
0
1
null
null
null
null
UTF-8
Java
false
false
1,775
java
/* * Copyright (c) 2007, 2020, 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; /** * POP - Pop top operand stack word * * <PRE>Stack: ..., word -&gt; ...</PRE> * */ public class POP extends StackInstruction implements PopInstruction { public POP() { super(com.sun.org.apache.bcel.internal.Const.POP); } /** * 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 */ @Override public void accept( final Visitor v ) { v.visitStackConsumer(this); v.visitPopInstruction(this); v.visitStackInstruction(this); v.visitPOP(this); } }
[ "caijie2@tuhu.cn" ]
caijie2@tuhu.cn
2b4852dec27b1b943023e8a7c33dae7b98aa0370
d11fb0d15b73a28742caa97e349dcfbe70d2563f
/server/iih.ci/iih.ci.ord/src/main/java/iih/ci/ord/s/bp/assi/impl/cimes/ip/IpCopyApbuPropertyImpl.java
8d546c842a353a7fe9a329745746b38b051c3266
[]
no_license
fhis/order.client
50a363fd3e4f56d95ccc5aa288e907a0a8571031
56cfa7877f600a10c54fdb30306a32ffa28b8217
refs/heads/master
2021-08-22T20:50:59.511923
2017-12-01T07:10:27
2017-12-01T07:10:27
112,678,072
1
1
null
null
null
null
UTF-8
Java
false
false
253
java
package iih.ci.ord.s.bp.assi.impl.cimes.ip; import iih.ci.ord.s.bp.assi.impl.cimes.base.IpBaseCopyCalCiEmsProperty; /** * 备血申请属性复制 * * @author HUMS * */ public class IpCopyApbuPropertyImpl extends IpBaseCopyCalCiEmsProperty { }
[ "27696830@qq.com" ]
27696830@qq.com
567c9e8d7636176964b08e3b6ac862bb47e2c7a5
0b08e249f66c477b357274f73fa6c1c7b5d41db2
/spring-cloud-acm-example/src/main/java/com/zwd/acm/AcmApplication.java
177b920c5f21b2191cbf336661c0e1242ef54257
[]
no_license
tanglitao/nacos-examples
5f3c75ef118e578e00883e3b5c033bd96bb57778
7fbfdeb9b62198c307684161ad439b96219dbb1e
refs/heads/master
2020-06-04T04:06:11.655638
2019-01-09T12:33:41
2019-01-09T12:33:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
751
java
package com.zwd.acm; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.ConfigurableApplicationContext; /** * @author zwd * @date 2019/1/7 20:22 * @Email stephen.zwd@gmail.com */ @SpringBootApplication public class AcmApplication { public static void main(String[] args) { ConfigurableApplicationContext applicationContext = SpringApplication.run(AcmApplication.class, args); String userName = applicationContext.getEnvironment().getProperty("user.name"); String userAge = applicationContext.getEnvironment().getProperty("user.age"); System.err.println("user name :"+userName+"; age: "+userAge); } }
[ "810095178@qq.com" ]
810095178@qq.com
de136087525ebb0b70af1d02fb9c5d82dc9c7a2b
7b3615d250073ffbc0ccc9f19d4bb8cd50f33d04
/afis-cloud-server-auth/src/main/java/com/afis/cloud/auth/model/ApplicationModel.java
f87e10fdbcfbaaf9f68a89ec4ccc9237f855542d
[]
no_license
zhuoyue9527/auth
57dd371c53c7fa14981aafc38236d92f3c5c4cc3
ab79aca280e37e3c0c2910cac7eb6281e0bd0c81
refs/heads/master
2020-04-07T23:24:32.180246
2018-11-23T09:46:52
2018-11-23T09:46:52
158,811,336
0
0
null
null
null
null
UTF-8
Java
false
false
2,231
java
package com.afis.cloud.auth.model; import java.io.Serializable; import java.util.Date; /** * 存在缓存中的应用信息 * * @author Chengen * */ public class ApplicationModel implements Serializable{ private long id; private String appCode; private String appName; private String key; private String urlCallback; private String logoPath; private String status; private String remark; private Long operateAppId; private Long operator; private Date operateTime; public long getId() { return id; } public void setId(long id) { this.id = id; } public String getAppCode() { return appCode; } public void setAppCode(String appCode) { this.appCode = appCode; } public String getAppName() { return appName; } public void setAppName(String appName) { this.appName = appName; } public String getKey() { return key; } public void setKey(String key) { this.key = key; } public String getUrlCallback() { return urlCallback; } public void setUrlCallback(String urlCallback) { this.urlCallback = urlCallback; } public String getLogoPath() { return logoPath; } public void setLogoPath(String logoPath) { this.logoPath = logoPath; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } public String getRemark() { return remark; } public void setRemark(String remark) { this.remark = remark; } public Long getOperateAppId() { return operateAppId; } public void setOperateAppId(Long operateAppId) { this.operateAppId = operateAppId; } public Long getOperator() { return operator; } public void setOperator(Long operator) { this.operator = operator; } public Date getOperateTime() { return operateTime; } public void setOperateTime(Date operateTime) { this.operateTime = operateTime; } @Override public String toString() { return "Application [id=" + id + ", appCode=" + appCode + ", appName=" + appName + ", key=" + key + ", urlCallback=" + urlCallback + ", logoPath=" + logoPath + ", status=" + status + ", remark=" + remark + ", operateAppId=" + operateAppId + ", operator=" + operator + ", operateTime=" + operateTime + "]"; } }
[ "zhuoyue9527@163.com" ]
zhuoyue9527@163.com
cab6025521e68a20c0d4bb9847ccb0da759005d5
e054c1e6903e4b5eb166d107802c0c2cadd2eb03
/modules/datex-serializer/src/generated/java/eu/datex2/schema/_2/_2_0/AreaOfInterestEnum.java
23a8efb388691cb20153a6243a6cc5808b021396
[ "MIT" ]
permissive
svvsaga/gradle-modules-public
02dc90ad2feb58aef7629943af3e0d3a9f61d5cf
e4ef4e2ed5d1a194ff426411ccb3f81d34ff4f01
refs/heads/main
2023-05-27T08:25:36.578399
2023-05-12T14:15:47
2023-05-12T14:33:14
411,986,217
2
1
MIT
2023-05-12T14:33:15
2021-09-30T08:36:11
Java
UTF-8
Java
false
false
1,613
java
package eu.datex2.schema._2._2_0; import jakarta.xml.bind.annotation.XmlEnum; import jakarta.xml.bind.annotation.XmlEnumValue; import jakarta.xml.bind.annotation.XmlType; /** * <p>Java class for AreaOfInterestEnum. * * <p>The following schema fragment specifies the expected content contained within this class. * <pre> * &lt;simpleType name="AreaOfInterestEnum"&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"&gt; * &lt;enumeration value="continentWide"/&gt; * &lt;enumeration value="national"/&gt; * &lt;enumeration value="neighbouringCountries"/&gt; * &lt;enumeration value="notSpecified"/&gt; * &lt;enumeration value="regional"/&gt; * &lt;/restriction&gt; * &lt;/simpleType&gt; * </pre> * */ @XmlType(name = "AreaOfInterestEnum") @XmlEnum public enum AreaOfInterestEnum { @XmlEnumValue("continentWide") CONTINENT_WIDE("continentWide"), @XmlEnumValue("national") NATIONAL("national"), @XmlEnumValue("neighbouringCountries") NEIGHBOURING_COUNTRIES("neighbouringCountries"), @XmlEnumValue("notSpecified") NOT_SPECIFIED("notSpecified"), @XmlEnumValue("regional") REGIONAL("regional"); private final String value; AreaOfInterestEnum(String v) { value = v; } public String value() { return value; } public static AreaOfInterestEnum fromValue(String v) { for (AreaOfInterestEnum c: AreaOfInterestEnum.values()) { if (c.value.equals(v)) { return c; } } throw new IllegalArgumentException(v); } }
[ "geir.sagberg@gmail.com" ]
geir.sagberg@gmail.com
8a89a8309752d195c085d3a9146e06b848dab8a3
4e7159cf61bf0fa670a5a102424edcc7cb781a36
/advancedMapReduce/src/mapreduce/product/MyKey.java
1c59f64f5202c9ddff07ccb13f2a3aae69d1c5ab
[]
no_license
kim-svadoz/bigdatawork
0736ada30909ac02dbb9e25c7a7cf0a7cac9397c
a7445589c05246b2869d9ca3d768893aa9384e93
refs/heads/master
2022-12-28T08:30:58.110809
2020-09-16T05:52:25
2020-09-16T05:52:25
241,572,741
0
0
null
2022-12-16T07:16:53
2020-02-19T08:43:15
Java
UTF-8
Java
false
false
1,273
java
package mapreduce.product; import java.io.DataInput; import java.io.DataOutput; import java.io.IOException; import org.apache.hadoop.io.WritableComparable; import org.apache.hadoop.io.WritableUtils; public class MyKey implements WritableComparable<MyKey>{ private String productID; private String userID; public MyKey() { } public MyKey(String productID, String userID) { super(); this.productID = productID; this.userID = userID; } public String getProductID() { return productID; } public void setProductID(String productID) { this.productID = productID; } public String getUserID() { return userID; } public void setUserID(String userID) { this.userID = userID; } public String toString() { return productID+"\t"+userID+"\t"; } @Override public void write(DataOutput out) throws IOException { WritableUtils.writeString(out, productID); WritableUtils.writeString(out, userID); } @Override public void readFields(DataInput in) throws IOException { productID = WritableUtils.readString(in); userID = WritableUtils.readString(in); } @Override public int compareTo(MyKey obj) { int result = productID.compareTo(obj.productID); if(result==0) { result = userID.compareTo(obj.userID); } return result; } }
[ "dhkdghehfdl@gmail.com" ]
dhkdghehfdl@gmail.com
183ec93a97d9c2f7aa9c4a3095fa003df730ad5c
55d11aca856977f95471cab15529273e1def1baf
/박호훈6586/src/b10_클래스/ClassEx.java
97092266d6461126eacfcf8d30f1c45f35c4104a
[]
no_license
hohunpark/javaStudy20210811
58690b75d530a9aab3618ccb97d90636d0a8a52a
283f5724d65d77ea6db40161d5ba586371d945dc
refs/heads/master
2023-07-16T23:10:50.446449
2021-09-06T12:48:50
2021-09-06T12:48:50
397,576,178
0
0
null
null
null
null
UHC
Java
false
false
1,165
java
package b10_클래스; /** * * 자료형의 종류 * 1. 일반 자료형(int, double, char, boolean) * 2. 참조 자료형(클래스, 배열) -> String, Phone, Student, Car, 배열[] * * * */ class Phone{ private String company; private String model; private String color; private String newsAgency; private int d_ram; private String phoneCase; public String getModel() { return model; } public void setModel() { this.model = model; } public Phone() { System.out.println("새로운 phone을 생성하였습니다."); } public Phone(String company) { System.out.println("두번째 생성자로 만든 Phone"); this.company = company; } } public class ClassEx { public static void main(String[] args) { System.out.println(new Phone("Apple")); Phone p = new Phone(); Phone p2 = new Phone(); //p.model = "iphone"; //p2.model = "galaxy"; p.setModel("iphone"); //값을 세팅(대입)하는 것이기 때문에 리턴값이 없다. p.getModel(); //단순히 클래스 내부의 변수 값을 가져오기 위한 것이기 때문에 리턴은 있지만 매개변수가 없다. } }
[ "=" ]
=
99f3f10ee72b2217d5db78c591b19f4eec47d590
6286d4a34e0234096b36e31605c701e104ff0657
/src/BACK_TO_BACK_SWE/KnapSack.java
c5e0c44a933108b48b5903f6279d2b0102e672e4
[]
no_license
AntonSyzko/LeetcodeStudies
51e4c37ddf3624240e1bc1b531933f1c6f4fa624
1ccad64e5dae1f732a7ab3a1f297369fe2520cf4
refs/heads/main
2023-09-03T13:01:35.743111
2021-10-11T20:05:00
2021-10-11T20:05:00
307,069,055
0
0
null
null
null
null
UTF-8
Java
false
false
1,414
java
package BACK_TO_BACK_SWE; public class KnapSack { public int knapsack(int[] values, int[] weights, int maxWeightConstraint) { int[][] cache = new int[values.length + 1][maxWeightConstraint + 1]; for (int totalItems = 0; totalItems <= values.length; totalItems++) { for (int maxWeight = 0; maxWeight <= maxWeightConstraint; maxWeight++) { /* I cache the name 'currentItem' for clarity when accessing values & weights, but I leave 'totalItems - 1' "raw" when we access the cache so you can visualize: 1.) Without Item -> Going up 1 row 2.) With Item -> Go up 1 row & left 'weights[currentItem]' columns */ int currentItem = totalItems - 1; if (totalItems == 0 || maxWeight == 0) { cache[totalItems][maxWeight] = 0; } else if (weights[currentItem] > maxWeight) { cache[totalItems][maxWeight] = cache[totalItems - 1][maxWeight]; } else { int withItem = values[currentItem] + cache[totalItems - 1][maxWeight - weights[currentItem]]; int withoutItem = cache[totalItems - 1][maxWeight]; cache[totalItems][maxWeight] = Math.max(withItem, withoutItem); } } } return cache[values.length][maxWeightConstraint]; } }
[ "antonio.shizko@gmail.com" ]
antonio.shizko@gmail.com
6d99de7098fd53bb44cc7b4b9380890ccf81a697
76d82b3c0e25f91ff37bbe198b15a65a70c37f02
/src/com/cbedoy/apprende/service/LevelProviderService.java
7fbc8525ed184dd301bf0775bc0306b78bb5cc4f
[]
no_license
cbedoy/ApprendeV2
87d2bf31cd23a00c36e7ba8c9a68c755de1260cf
66053485577f4dcaf2dbca269e41d8134e0fb6f3
refs/heads/master
2021-01-23T08:39:17.199586
2015-01-02T17:45:18
2015-01-02T17:45:18
26,739,944
0
0
null
null
null
null
UTF-8
Java
false
false
1,705
java
package com.cbedoy.apprende.service; import com.cbedoy.apprende.R; import com.cbedoy.apprende.activity.ApplicationLoader; /** * Created by Carlos on 27/10/2014. */ public class LevelProviderService { private static LevelProviderService instance; public static LevelProviderService getInstance(){ if(instance == null) instance = new LevelProviderService(); return instance; } public String getTitleByLevel(int level) { String value = ""; switch (level) { case 30: value = ApplicationLoader.mainContext.getString(R.string.very_easy); break; case 20: value = ApplicationLoader.mainContext.getString(R.string.easy); break; case 15: value = ApplicationLoader.mainContext.getString(R.string.normal); break; case 10: value = ApplicationLoader.mainContext.getString(R.string.hard); break; case 5: value = ApplicationLoader.mainContext.getString(R.string.very_hard); break; } return value; } public int getPointsByLevel(int level) { int value = -1; switch (level) { case 30: value = 1; break; case 20: value = 2; break; case 15: value = 5; break; case 10: value = 10; break; case 5: value = 20; break; } return value; } }
[ "carlos.bedoy@gmail.com" ]
carlos.bedoy@gmail.com
de37e8f39f1bef99049a0f1de54ed8da9e6db2ea
88cae0357b94ec5d7ebc45b754220f8bfd0bea26
/src/main/java/mobi/hsz/idea/gitignore/outer/OuterFileFetcher.java
498794f69bf2a7e4ecacb234b30d0c588610fb3d
[ "MIT" ]
permissive
consulo/consulo-dotignore
0ccbc44ced7aff97a662f3429ad9367b2064e241
f22746f3794785ef42f22e8a6d8833e799ab0518
refs/heads/master
2023-09-01T12:22:43.033375
2023-05-23T18:45:04
2023-05-23T18:45:04
183,288,859
0
0
null
null
null
null
UTF-8
Java
false
false
346
java
package mobi.hsz.idea.gitignore.outer; import consulo.project.Project; import consulo.virtualFileSystem.VirtualFile; import org.jetbrains.annotations.NotNull; import java.util.Collection; /** Outer file fetcher event interface. */ public interface OuterFileFetcher { @NotNull Collection<VirtualFile> fetch(@NotNull Project project); }
[ "vistall.valeriy@gmail.com" ]
vistall.valeriy@gmail.com
e60a009e308e3f2ae2799bd6e06eea64d0eaba8b
da830c5f8eff4651d8999f49b0ffc8f97b76eb62
/CeiPhone/src/com/hyrt/cei/ui/common/GetpasswordActivity.java
831e303600e49ae0e55c8463986e77a0808dfa5e
[]
no_license
ThingsKit/cei
ba79cb93800547ee62c14eaa99776cf4c57649ab
b6c1e1c7a92c99285d8e0e8400bdca13ad8f293a
refs/heads/master
2021-01-18T05:23:33.317406
2014-07-17T05:26:55
2014-07-17T05:26:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,457
java
package com.hyrt.cei.ui.common; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.view.View; import android.view.View.OnClickListener; import android.view.View.OnFocusChangeListener; import android.view.inputmethod.InputMethodManager; import android.widget.EditText; import android.widget.Toast; import com.hyrt.cei.util.XmlUtil; import com.hyrt.cei.webservice.service.Service; import com.hyrt.ceiphone.ContainerActivity; import com.hyrt.ceiphone.R; import com.hyrt.ceiphone.common.HomePageDZB; public class GetpasswordActivity extends ContainerActivity{ private int i1, i2; private ExecutorService executorService = Executors.newFixedThreadPool(1); private EditText username, email; private String strusername, stremail; private int code; // 用户名 @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.ui_getpassword); InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE); imm.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS); init(); } private void init() { username = (EditText) findViewById(R.id.ui_getpassword_username); email = (EditText) findViewById(R.id.ui_getpassword_email); findViewById(R.id.ui_regist_regist).setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(GetpasswordActivity.this, LoginActivity.class); startActivity(intent); GetpasswordActivity.this.finish(); } }); refreshListData(); findViewById(R.id.ui_back).setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(GetpasswordActivity.this, HomePageDZB.class); startActivity(intent); GetpasswordActivity.this.finish(); } }); } private void refreshListData() { username.setOnFocusChangeListener(new OnFocusChangeListener() { @Override public void onFocusChange(View v, boolean hasFocus) { // TODO Auto-generated method stub if (hasFocus && i1 == 0) { username.setText(""); i1++; } } }); email.setOnFocusChangeListener(new OnFocusChangeListener() { @Override public void onFocusChange(View v, boolean hasFocus) { // TODO Auto-generated method stub if (hasFocus && i2 == 0) { email.setText(""); i2++; } } }); findViewById(R.id.ui_login_login).setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { if (username.getText().toString().trim().equals("") || email.getText().toString().trim().equals("")) { Toast.makeText(GetpasswordActivity.this, "用户名或邮箱不能为空!", Toast.LENGTH_SHORT).show(); return; } strusername = username.getText().toString().trim(); stremail = email.getText().toString().trim(); executorService.submit(new Runnable() { @Override public void run() { // TODO Auto-generated method stub String rs = ""; rs = Service.updateUserInfoPassWord( strusername, stremail); code = Integer.parseInt(XmlUtil .parseReturnCode(rs).equals("") ? "0" : XmlUtil.parseReturnCode(rs)); Message msg = newsHandler.obtainMessage(); newsHandler.sendMessage(msg); GetpasswordActivity.this.finish(); } }); } }); } Handler newsHandler = new Handler() { public void handleMessage(Message msg) { if (code == 1) { Toast.makeText(GetpasswordActivity.this, "密码找回成功,请至邮箱查看!", Toast.LENGTH_SHORT).show(); GetpasswordActivity.this.finish(); } else if (code == -2) { Toast.makeText(GetpasswordActivity.this, "email不存在!", Toast.LENGTH_SHORT).show(); } else if (code == 0) { Toast.makeText(GetpasswordActivity.this, "系统错误!", Toast.LENGTH_SHORT).show(); } else if (code == -1) { Toast.makeText(GetpasswordActivity.this, "网络错误!", Toast.LENGTH_SHORT).show(); } } }; @Override protected void onPause() { // TODO Auto-generated method stub super.onPause(); GetpasswordActivity.this.finish(); } }
[ "13718868826@163.com" ]
13718868826@163.com
150ee95474b42485cde8f519b75cf9e340408699
2d2da5bdc6161571a29912accc49ce8f934ae117
/src/net/meisen/dissertation/impl/data/metadata/DirectlyDefinedMetaData.java
a79a4dc8c8d9f020ef4f2b2afc934aa45d5368e8
[ "BSD-3-Clause" ]
permissive
pmeisen/dis-timeintervaldataanalyzer
8be05e6e485a667b97b9814297a535f9575323d9
9c97c7d19b2125ca148529e85f2175751e7d2aa4
refs/heads/master
2021-01-18T22:06:38.850928
2017-03-29T22:15:29
2017-03-29T22:15:29
14,424,470
6
0
null
null
null
null
UTF-8
Java
false
false
3,881
java
package net.meisen.dissertation.impl.data.metadata; import java.util.ArrayList; import java.util.Collection; import java.util.List; import net.meisen.dissertation.model.data.metadata.IMetaData; import net.meisen.general.genmisc.types.Objects; /** * {@code DirectlyDefinedMetaData} is used to define {@code MetaData} directly, * i.e. by values. * * @author pmeisen * */ public class DirectlyDefinedMetaData implements IMetaData { private final List<Object> values; private final String descriptorModelId; /** * The constructor creates an empty list of meta-data for the specified * {@code descriptorModelId}. * * @param descriptorModelId * the identifier of the {@code DescriptorModel} the values * belong to */ public DirectlyDefinedMetaData(final String descriptorModelId) { this.values = new ArrayList<Object>(); this.descriptorModelId = descriptorModelId; } /** * The constructor creates meta-data for the specified * {@code descriptorModelId} with the specified {@code values}. * * @param descriptorModelId * the identifier of the {@code DescriptorModel} the values * belong to * @param values * the values to be added */ public DirectlyDefinedMetaData(final String descriptorModelId, final Collection<Object> values) { this(descriptorModelId); addValues(values); } /** * The constructor creates meta-data for the specified * {@code descriptorModelId} with the specified {@code values}. * * @param descriptorModelId * the identifier of the {@code DescriptorModel} the values * belong to * @param values * the values to be added */ public DirectlyDefinedMetaData(final String descriptorModelId, final Object... values) { this(descriptorModelId); addValues(values); } /** * Adds the specified {@code values} to {@code this}. * * @param values * the values to be added */ public void addValues(final Collection<Object> values) { addValues(values == null ? null : values.toArray()); } /** * Adds the specified {@code values} to {@code this}. * * @param values * the values to be added */ public void addValues(final Object... values) { if (values == null) { return; } for (final Object value : values) { addValue(value); } } /** * Adds the specified {@code value} to {@code this}. * * @param value * the value to be added */ public void addValue(final Object value) { this.values.add(value); } /** * Sets the specified {@code values} for {@code this}. Setting means (in * contrast to adding) that all current values are removed. * * @param values * the values to be set */ public void setValues(final Collection<Object> values) { setValues(values == null ? null : values.toArray()); } /** * Sets the specified {@code values} for {@code this}. Setting means (in * contrast to adding) that all current values are removed. * * @param values * the values to be set */ public void setValues(final Object... values) { this.values.clear(); addValues(values); } @Override public Collection<Object> getValues() { return values; } @Override public String getDescriptorModelId() { return descriptorModelId; } @Override public String toString() { return getDescriptorModelId() + ": " + getValues(); } @Override public int size() { return values.size(); } @Override public boolean equals(final Object obj) { if (obj == this) { return true; } else if (obj instanceof DirectlyDefinedMetaData) { final DirectlyDefinedMetaData ddmd = (DirectlyDefinedMetaData) obj; return Objects.equals(ddmd.descriptorModelId, descriptorModelId) && Objects.equals(ddmd.values, values); } else { return false; } } }
[ "philipp@meisen.net" ]
philipp@meisen.net
bf3da3306d6a45e664ea8e30eb8226d8fc80e634
b5a42a88ca0b5a49cad2df872288e67c1e039693
/3.JavaMultithreading/src/com/javarush/task/task30/task3001/Number.java
83aff47df864a233f0dcf6c18dbb4e7975b175c8
[]
no_license
ValeriyEmelyanov/JavaRushTasks
0104a951e522911c8c6ed6eef05c16a66313bb2c
4dd45e71aed4e9fe5dce25a80614bfdc5f9a60fa
refs/heads/master
2020-06-01T21:27:29.056423
2019-12-29T08:21:26
2019-12-29T08:21:26
190,932,680
0
0
null
null
null
null
UTF-8
Java
false
false
974
java
package com.javarush.task.task30.task3001; public class Number { private NumberSystem numberSystem; private String digit; public Number(NumberSystem numberSystem, String digit) { this.numberSystem = numberSystem; this.digit = digit; } public NumberSystem getNumberSystem() { return numberSystem; } public String getDigit() { return digit; } @Override public String toString() { return "Number{" + "numberSystem=" + numberSystem + ", digit='" + digit + '\'' + '}'; } public boolean isValid() { char[] chars = digit.toUpperCase().toCharArray(); String template = "0123456789ABCDEF".substring(0, numberSystem.getNumberSystemIntValue()); for (int i = 0; i < chars.length; i++) { if (template.indexOf(chars[i]) < 0) { return false; } } return true; } }
[ "emelva@rambler.ru" ]
emelva@rambler.ru
ea09b92708a3c5be9780bb30b1e75e2cc0d90606
319531f0ef01900b83d106d53cb4e9502e33f355
/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/discriminator/CharAbstractEntity.java
5dd5ff754770136ada31b86fd29186a1bbc6aa60
[ "Apache-2.0", "CDDL-1.0", "LicenseRef-scancode-oracle-openjdk-exception-2.0", "GPL-2.0-only" ]
permissive
wso2/wso2-openjpa
798822ee319590eed5a00ae21b65b6977faf162d
9c3801c861d1a0c9d93a9fa5cfa0cbe749114b92
refs/heads/master
2023-08-14T23:55:26.907881
2022-04-05T09:32:59
2022-04-05T09:32:59
97,706,188
35
16
Apache-2.0
2022-04-05T09:33:00
2017-07-19T10:56:02
Java
UTF-8
Java
false
false
1,638
java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.openjpa.persistence.discriminator; import javax.persistence.Column; import javax.persistence.DiscriminatorColumn; import javax.persistence.DiscriminatorType; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.Inheritance; import javax.persistence.InheritanceType; @Entity @Inheritance(strategy=InheritanceType.SINGLE_TABLE) @DiscriminatorColumn(name="DISC_COL", discriminatorType=DiscriminatorType.CHAR) public abstract class CharAbstractEntity { @Id @GeneratedValue private long id; @Column(length=16) private String name; public long getId() { return id; } public String getName() { return name; } public void setName(String name) { this.name = name; } }
[ "nandika@wso2.com" ]
nandika@wso2.com
1875d68406db817cb929730f7c07074e5d0cd652
f3d66037172ae203a09d095690b7557c3954a3df
/src/main/java/com/my/bookcatalog/web/rest/errors/ErrorConstants.java
bec8d61682cadcea01ccd552ccb66db09a853d33
[]
no_license
PaengE/book-rental-service-bookCatalog
34ee3a7bbc974229dab43d96758e36342b66625d
1b52e88cfc7b27207d2ad2c1ca9ef2a7043cca52
refs/heads/master
2023-06-12T07:39:58.872931
2021-07-05T08:34:40
2021-07-05T08:34:40
373,809,083
0
0
null
null
null
null
UTF-8
Java
false
false
590
java
package com.my.bookcatalog.web.rest.errors; import java.net.URI; public final class ErrorConstants { public static final String ERR_CONCURRENCY_FAILURE = "error.concurrencyFailure"; public static final String ERR_VALIDATION = "error.validation"; public static final String PROBLEM_BASE_URL = "https://www.jhipster.tech/problem"; public static final URI DEFAULT_TYPE = URI.create(PROBLEM_BASE_URL + "/problem-with-message"); public static final URI CONSTRAINT_VIOLATION_TYPE = URI.create(PROBLEM_BASE_URL + "/constraint-violation"); private ErrorConstants() {} }
[ "ckddn2820@gmail.com" ]
ckddn2820@gmail.com
c2049e65b4a8e19d43311cb496c692060ee630f8
f567c98cb401fc7f6ad2439cd80c9bcb45e84ce9
/src/main/java/com/alipay/api/domain/AlipayInsAutoUserOilExchangeModel.java
946cff74c5753be83a1ce8ef0bfdc0a475e3dc0b
[ "Apache-2.0" ]
permissive
XuYingJie-cmd/alipay-sdk-java-all
0887fa02f857dac538e6ea7a72d4d9279edbe0f3
dd18a679f7543a65f8eba2467afa0b88e8ae5446
refs/heads/master
2023-07-15T23:01:02.139231
2021-09-06T07:57:09
2021-09-06T07:57:09
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,042
java
package com.alipay.api.domain; import java.util.Date; import com.alipay.api.AlipayObject; import com.alipay.api.internal.mapping.ApiField; /** * 扣减用户积分 * * @author auto create * @since 1.0, 2019-07-04 17:22:15 */ public class AlipayInsAutoUserOilExchangeModel extends AlipayObject { private static final long serialVersionUID = 7344531368797772858L; /** * 验证point与benefitId的一致性,才能使用对应的积分 */ @ApiField("benefit_id") private String benefitId; /** * 业务发生时间 */ @ApiField("biz_time") private Date bizTime; /** * 将要扣减的油量(ml) */ @ApiField("oil") private Long oil; /** * 请求业务单号,单号一致的两次请求将保证幂等 */ @ApiField("request_id") private String requestId; /** * 场景类型 */ @ApiField("scene_type") private String sceneType; /** * 来源,车险分配 */ @ApiField("source") private String source; /** * 蚂蚁统一会员ID */ @ApiField("user_id") private String userId; public String getBenefitId() { return this.benefitId; } public void setBenefitId(String benefitId) { this.benefitId = benefitId; } public Date getBizTime() { return this.bizTime; } public void setBizTime(Date bizTime) { this.bizTime = bizTime; } public Long getOil() { return this.oil; } public void setOil(Long oil) { this.oil = oil; } public String getRequestId() { return this.requestId; } public void setRequestId(String requestId) { this.requestId = requestId; } public String getSceneType() { return this.sceneType; } public void setSceneType(String sceneType) { this.sceneType = sceneType; } public String getSource() { return this.source; } public void setSource(String source) { this.source = source; } public String getUserId() { return this.userId; } public void setUserId(String userId) { this.userId = userId; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
9c29e396f0019910cb4adb234b7d33d0dcda8adc
20eb62855cb3962c2d36fda4377dfd47d82eb777
/IntroClassJava/dataset/digits/08c7ea4ac39aa6a5ab206393bb4412de9d2c365ecdda9c1b391be963c1811014ed23d2722d7433b8e8a95305eee314d39da4950f31e01f9147f90af91a5c433a/001/mutations/1018/digits_08c7ea4a_001.java
eb2698223bee4028503331473f606ff703b6977b
[]
no_license
ozzydong/CapGen
356746618848065cce4e253e5d3c381baa85044a
0ba0321b6b1191443276021f1997833342f02515
refs/heads/master
2023-03-18T20:12:02.923428
2020-08-21T03:08:28
2020-08-21T03:08:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,661
java
package introclassJava; class IntObj { public int value; public IntObj () { } public IntObj (int i) { value = i; } } class FloatObj { public float value; public FloatObj () { } public FloatObj (float i) { value = i; } } class LongObj { public long value; public LongObj () { } public LongObj (long i) { value = i; } } class DoubleObj { public double value; public DoubleObj () { } public DoubleObj (double i) { value = i; } } class CharObj { public char value; public CharObj () { } public CharObj (char i) { value = i; } } public class digits_08c7ea4a_001 { public java.util.Scanner scanner; public String output = ""; public static void main (String[]args) throws Exception { digits_08c7ea4a_001 mainClass = new digits_08c7ea4a_001 (); String output; if (args.length > 0) { mainClass.scanner = new java.util.Scanner (args[0]); } else { mainClass.scanner = new java.util.Scanner (System.in); } mainClass.exec (); System.out.println (mainClass.output); } public void exec () throws Exception { IntObj num = new IntObj (), numl = new IntObj (), n = new IntObj (), d0 = new IntObj (), d1 = new IntObj (), d2 = new IntObj (), d3 = new IntObj (), d4 = new IntObj (), d5 = new IntObj (), d6 = new IntObj (), d7 = new IntObj (), d8 = new IntObj (), d9 = new IntObj (); output += (String.format ("\nEnter an integer > ")); num.value = scanner.nextInt (); numl.value = num.value; n.value = 0; while (numl.value > 0) { n.value += 1; numl.value = numl.value / 10; } d0.value = num.value % 10; num.value = (num.value - d0.value) / 10; d1.value = num.value % 10; num.value = (num.value - d1.value) / 10; d2.value = num.value % 10; num.value = (num.value - d2.value) / 10; d3.value = num.value % 10; num.value = (num.value - d3.value) / 10; d4.value = num.value % 10; num.value = (num.value - d4.value) / 10; d5.value = num.value % 10; num.value = (num.value - d5.value) / 10; d6.value = num.value % 10; num.value = (num.value - d6.value) / 10; d7.value = num.value % 10; num.value = d7.value; d8.value = num.value % 10; num.value = (num.value - d8.value) / 10; d9.value = num.value % 10; num.value = (num.value - d9.value) / 10; output += (String.format ("\n%d\n", d0.value)); if (n.value > 1) { output += (String.format ("%d\n", d1.value)); } if (n.value > 2) { output += (String.format ("%d\n", d2.value)); } if (n.value > 3) { output += (String.format ("%d\n", d3.value)); } if (n.value > 4) { output += (String.format ("%d\n", d4.value)); } if (n.value > 5) { output += (String.format ("%d\n", d5.value)); } if (n.value > 6) { output += (String.format ("%d\n", d6.value)); } if (n.value > 7) { output += (String.format ("%d\n", d7.value)); } if (n.value > 8) { output += (String.format ("%d\n", d8.value)); } if (n.value > 9) { output += (String.format ("%d\n", d9.value)); } output += (String.format ("That's all, have a nice day!\n")); if (true) return;; } }
[ "justinwm@163.com" ]
justinwm@163.com
92f6cef111ed7b50dcb0638b0c6040501b144e16
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/4/4_748c841b06ae1070ebd59dea732f146b63712c57/OperationsRequest/4_748c841b06ae1070ebd59dea732f146b63712c57_OperationsRequest_t.java
d7146c3afdfbca0ebe3f48cf3ae52699f3816b42
[]
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
5,970
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package me.stutiguias.webportal.webserver.request.type; import java.util.List; import java.util.Map; import me.stutiguias.webportal.init.WebPortal; import me.stutiguias.webportal.settings.Auction; import me.stutiguias.webportal.settings.AuctionPlayer; import me.stutiguias.webportal.settings.TradeSystem; import me.stutiguias.webportal.webserver.HttpResponse; import org.bukkit.inventory.ItemStack; /** * * @author Daniel */ public class OperationsRequest extends HttpResponse { private WebPortal plugin; TradeSystem tr; public OperationsRequest(WebPortal plugin) { super(plugin); this.plugin = plugin; } public void CreateAuction(String ip,String url,Map param) { int qtd; Double price; int id; try { price = Double.parseDouble((String)param.get("Price")); id = Integer.parseInt((String)param.get("ID")); qtd = Integer.parseInt((String)param.get("Quantity")); }catch(NumberFormatException ex) { Print("Invalid Number","text/plain"); return; } Auction auction = plugin.dataQueries.getItemById(id,plugin.Myitems); if(auction.getQuantity() == qtd) { plugin.dataQueries.setPriceAndTable(id,price); Print("You have sucess create Auction","text/plain"); }else{ if(auction.getQuantity() > qtd) { plugin.dataQueries.UpdateItemAuctionQuantity(auction.getQuantity() - qtd, id); Short dmg = Short.valueOf(String.valueOf(auction.getDamage())); ItemStack stack = new ItemStack(auction.getName(),auction.getQuantity(),dmg); String type = stack.getType().toString(); String[] itemConfig = GetItemConfig(stack); String ItemName = itemConfig[0]; String searchtype = itemConfig[2]; plugin.dataQueries.createItem(auction.getName(),auction.getDamage(),auction.getPlayerName(),qtd,price,auction.getEnchantments(),plugin.Auction,type,ItemName,searchtype); Print("You have successfully created an Auction","text/plain"); }else{ Print("You not permit to sell more then you have","text/plain"); } } } public void Mail(String ip,String url,Map param) { int id = Integer.parseInt((String)param.get("ID")); int quantity = Integer.parseInt((String)param.get("Quantity")); Auction _Auction = plugin.dataQueries.getAuction(id); if(_Auction.getItemStack().getAmount() == quantity) { plugin.dataQueries.updateTable(id, plugin.Mail); }else if(_Auction.getItemStack().getAmount() < quantity) { Print("Not enought items","text/plain"); return; }else if(_Auction.getItemStack().getAmount() > quantity) { plugin.dataQueries.updateItemQuantity(_Auction.getItemStack().getAmount() - quantity, id); String[] ItemConfig = GetItemConfig(_Auction.getItemStack()); String itemName = ItemConfig[0]; String SearchType = ItemConfig[2]; plugin.dataQueries.createItem(_Auction.getItemStack().getTypeId(),_Auction.getItemStack().getDurability(),_Auction.getPlayerName(),quantity, _Auction.getPrice(),_Auction.getEnchantments(),plugin.Mail,_Auction.getType(), itemName , SearchType ); } Print("Mailt send","text/plain"); } public void Cancel(String ip,String url,Map param) { int id = Integer.parseInt((String)param.get("ID")); Auction auction = plugin.dataQueries.getAuction(id); String player = auction.getPlayerName(); Integer cancelItemId = auction.getItemStack().getTypeId(); Short cancelItemDamage = auction.getItemStack().getDurability(); List<Auction> auctions = plugin.dataQueries.getItem(player,cancelItemId,cancelItemDamage, true, plugin.Myitems); if(!auctions.isEmpty()) { Integer newAmount = auction.getItemStack().getAmount() + auctions.get(0).getItemStack().getAmount(); Integer itemId = auctions.get(0).getId(); plugin.dataQueries.updateItemQuantity(newAmount,itemId); plugin.dataQueries.DeleteAuction(id); }else{ plugin.dataQueries.updateTable(id, plugin.Myitems); } Print("Cancel Done.","text/plain"); } public void Buy(String ip,String url,Map param) { try { int qtd = Integer.parseInt((String)param.get("Quantity")); int id = Integer.parseInt((String)param.get("ID")); AuctionPlayer ap = WebPortal.AuthPlayers.get(ip).AuctionPlayer; Auction au = plugin.dataQueries.getAuction(id); String item_name = GetItemConfig(au.getItemStack())[0]; if(qtd <= 0) { Print("Quantity greater then 0","text/plain"); } else if(qtd > au.getItemStack().getAmount()) { Print("You are attempting to purchase more than the maximum available","text/plain"); } else if(!plugin.economy.has(ap.getName(),au.getPrice() * qtd)) { Print("You do not have enough money.","text/plain"); } else if(ap.getName().equals(au.getPlayerName())) { Print("You cannnot buy your own items.","text/plain"); } else { tr = new TradeSystem(plugin); Print(tr.Buy(ap.getName(),au, qtd, item_name, false),"text/plain"); } }catch(Exception ex){ WebPortal.logger.warning(ex.getMessage()); } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
54d6e9d6fe74c10dcbad13ea69dc6521fe676fb4
3afb3bfccf814079e0c2a7cab6e6bf7921978cea
/app/org/hadatac/console/controllers/schema/MainEntity.java
becbfd7c2528dd55925b31f7e61920f2272909c0
[ "Apache-2.0" ]
permissive
tetherless-world/hadatac
cb7463849ac2bc59f64f2c0677d6fc8ecc05f45e
25288d8a503d5905885584793a15e5e6d70a34ce
refs/heads/master
2021-01-19T15:27:21.811830
2017-08-18T21:12:24
2017-08-18T21:12:24
100,968,922
0
0
null
2017-08-21T15:55:26
2017-08-21T15:55:25
null
UTF-8
Java
false
false
4,266
java
package org.hadatac.console.controllers.schema; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import java.util.List; import java.util.ArrayList; import play.mvc.Controller; import play.mvc.Result; import play.data.Form; import play.twirl.api.Html; import org.hadatac.console.views.html.schema.*; import org.hadatac.console.views.html.*; import org.hadatac.console.controllers.AuthApplication; import org.hadatac.console.controllers.schema.*; import org.hadatac.console.http.DeploymentQueries; import org.hadatac.console.models.DataAcquisitionSchemaForm; import org.hadatac.console.models.SparqlQueryResults; import org.hadatac.console.models.TripleDocument; import org.hadatac.console.models.SysUser; import org.hadatac.console.models.DASAForm; import org.hadatac.entity.pojo.DataAcquisitionSchema; import org.hadatac.entity.pojo.DataAcquisitionSchemaAttribute; import org.hadatac.entity.pojo.Entity; import org.hadatac.entity.pojo.Attribute; import org.hadatac.entity.pojo.Unit; import org.hadatac.metadata.loader.ValueCellProcessing; import org.labkey.remoteapi.CommandException; import be.objectify.deadbolt.java.actions.Group; import be.objectify.deadbolt.java.actions.Restrict; public class MainEntity extends Controller { // for /metadata HTTP GET requests @Restrict(@Group(AuthApplication.DATA_OWNER_ROLE)) public static Result index(String das_uri) { if (session().get("LabKeyUserName") == null && session().get("LabKeyPassword") == null) { return redirect(org.hadatac.console.controllers.triplestore.routes.LoadKB.logInLabkey( routes.EditDASA.index(das_uri).url())); } DataAcquisitionSchema das = null; try { if (das_uri != null) { das_uri = URLDecoder.decode(das_uri, "UTF-8"); } else { das_uri = ""; } } catch (UnsupportedEncodingException e) { e.printStackTrace(); } if (!das_uri.equals("")) { das = DataAcquisitionSchema.find(das_uri); } else { return badRequest("No URI is provided to retrieve DAS"); } return ok(mainEntity.render(das, EditingOptions.getEntities())); }// /index() // for /metadata HTTP POST requests @Restrict(@Group(AuthApplication.DATA_OWNER_ROLE)) public static Result postIndex(String das_uri) { return index(das_uri); }// /postIndex() @Restrict(@Group(AuthApplication.DATA_OWNER_ROLE)) public static Result processForm(String das_uri) { final SysUser sysUser = AuthApplication.getLocalUser(session()); Form<DASAForm> form = Form.form(DASAForm.class).bindFromRequest(); DASAForm data = form.get(); if (form.hasErrors()) { return badRequest("The submitted form has errors!"); } // store new Main Entity String newEntity = getUriFromNew(data.getNewEntity()); // retrieve DAS DataAcquisitionSchema das = DataAcquisitionSchema.find(das_uri); DataAcquisitionSchemaAttribute olddasa = DataAcquisitionSchemaAttribute.find(das_uri); // set changes if (olddasa != null) { // delete previous state of the DASA in the triplestore if (olddasa != null) { olddasa.delete(); } } else { return badRequest("[ERRO] Failed locating existing DASA.\n"); } // insert current state of the DASA olddasa.setEntity(newEntity); // insert the new DASA content inside of the triplestore regardless of any change -- the previous content has already been deleted olddasa.save(); // update/create new DASA in LabKey int nRowsAffected = olddasa.saveToLabKey(session().get("LabKeyUserName"), session().get("LabKeyPassword")); if (nRowsAffected <= 0) { return badRequest("Failed to update DASA to LabKey!\n"); } //return ok(editDASAConfirm.render(olddasa, changedInfos)); return ok(""); } @Restrict(@Group(AuthApplication.DATA_OWNER_ROLE)) public static Result postProcessForm(String das_uri) { return processForm(das_uri); } private static String getUriFromNew(String newStr) { if (newStr == null) { return ""; } String response = newStr.substring(newStr.indexOf("[") + 1).replace("]",""); //response = ValueCellProcessing.replacePrefix(response); return response; } }
[ "pp3223@gmail.com" ]
pp3223@gmail.com
cafd3f89ddff8b86fc3776adebd2ecb075e206e7
66a97cb9c2a3a7d385fe4dd5ef86b5ab423389dd
/app/src/main/java/com/suwonsmartapp/hello/graphic/MusicPlayerView.java
289e3f43ca0ff341dd2229905b7a1d4ae3a94d10
[]
no_license
suwonsmartapp/HelloAndroid1
77e8cb0ca6b8e826c6e1fbca196de44874c20704
af497d7ed2bf2b120a125337c91d069591ebc00d
refs/heads/master
2020-04-09T05:27:21.886585
2015-07-08T01:00:16
2015-07-08T01:00:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,306
java
package com.suwonsmartapp.hello.graphic; import android.content.Context; import android.media.MediaPlayer; import android.net.Uri; import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.View; import android.widget.Button; import android.widget.Chronometer; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.SeekBar; import android.widget.TextView; import android.widget.VideoView; import com.suwonsmartapp.hello.R; import java.io.IOException; /** * Created by junsuk on 15. 5. 29.. */ public class MusicPlayerView extends LinearLayout implements View.OnClickListener { public static final int REQUEST_CODE_AUDIO = 0; public static final int REQUEST_CODE_VIDEO = 1; private Button mBtnAudioFilePick; // 파일 선택 private Button mBtnVideoFilePick; // 파일 선택 private Button mBtnPause; // 정지 private Button mBtnResume; // 재시작 private TextView mTvArtist; private TextView mTvAlbum; private TextView mTvTitle; private Chronometer mPlayTime; private TextView mTvDuration; private SeekBar mSeekBar; private ImageView mIvAlbumArt; // 플레이어 private MediaPlayer mMediaPlayer; private VideoView mVideoView; private long mStartTime = 0; private long mStopTime = 0; private Context mContext; public MusicPlayerView(Context context) { this(context, null); } public MusicPlayerView(Context context, AttributeSet attrs) { this(context, attrs, 0); } public MusicPlayerView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); mContext = context; LayoutInflater.from(context).inflate(R.layout.activity_media_player, this); // 레이아웃 초기화, 이벤트 연결 init(); } private void init() { mBtnAudioFilePick = (Button) findViewById(R.id.btn_audioFilePick); mBtnVideoFilePick = (Button) findViewById(R.id.btn_videoFilePick); mBtnPause = (Button) findViewById(R.id.btn_pause); mBtnResume = (Button) findViewById(R.id.btn_resume); mVideoView = (VideoView) findViewById(R.id.videoView); mTvArtist = (TextView) findViewById(R.id.tv_artist); mTvAlbum = (TextView) findViewById(R.id.tv_album); mTvTitle = (TextView) findViewById(R.id.tv_title); mPlayTime = (Chronometer) findViewById(R.id.chronometer_play_time); mTvDuration = (TextView) findViewById(R.id.tv_duration); mSeekBar = (SeekBar) findViewById(R.id.seekbar_play_time); mIvAlbumArt = (ImageView) findViewById(R.id.iv_albumArt); mBtnAudioFilePick.setOnClickListener(this); // mBtnVideoFilePick.setOnClickListener(this); // mBtnPause.setOnClickListener(this); // mBtnResume.setOnClickListener(this); // mSeekBar.setOnSeekBarChangeListener(this); // mPlayTime.setOnChronometerTickListener(this); } public void startMusic(Uri fileUri) { if (mMediaPlayer != null) { mMediaPlayer.release(); mMediaPlayer = null; } try { mMediaPlayer = new MediaPlayer(); mMediaPlayer.setDataSource(mContext, fileUri); mMediaPlayer.prepare(); mMediaPlayer.start(); } catch (IOException e) { e.printStackTrace(); } } @Override public void onClick(View v) { if (mListener != null) { mListener.onAudioPlayButtonClicked(); // 외부에 콜백이 호출 됨 } } private OnPlayerButtonClickListener mListener; public void setOnPlayerButtonClickListener(OnPlayerButtonClickListener listener) { mListener = listener; } public interface OnPlayerButtonClickListener { void onAudioPlayButtonClicked(); // call back } // ViewGroup 의 위치 결정 @Override protected void onLayout(boolean changed, int l, int t, int r, int b) { super.onLayout(changed, l, t, r, b); } // ViewGroup 의 크기를 결정 @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); } }
[ "a811219@gmail.com" ]
a811219@gmail.com
d750ecbf97793bc586d2c15fbf66677f37a84e76
4a0eb56dd26912ee8d54feaa8c60cd50b756b3d5
/samediff/src/main/java/org/nd4j/autodiff/functions/impl/binary/transform/Or.java
77527cdcd724486584aae4457e840b2938766c22
[ "MIT", "LicenseRef-scancode-unknown-license-reference", "Apache-2.0", "LicenseRef-scancode-generic-cla" ]
permissive
cinqs/nd4j
3555db9f654b5ddeb21bd199e0dab8d286d9b09a
7b6c3dca9bddf4b3738afeab2e32821ecebfa579
refs/heads/master
2021-07-06T12:53:32.756515
2017-09-27T01:33:52
2017-09-27T01:33:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,027
java
package org.nd4j.autodiff.functions.impl.binary.transform; import org.nd4j.autodiff.ArrayField; import org.nd4j.autodiff.functions.*; import org.nd4j.autodiff.opstate.OpState; import org.nd4j.autodiff.samediff.SameDiff; import java.util.List; public class Or extends AbstractBinaryFunction { public Or(SameDiff sameDiff, DifferentialFunction i_v1, DifferentialFunction i_v2,boolean inPlace) { super(sameDiff, i_v1, i_v2, inPlace, OpState.OpType.TRANSFORM); } public Or(SameDiff sameDiff, DifferentialFunction i_v1, DifferentialFunction i_v2) { this(sameDiff,i_v1,i_v2,false); } @Override public ArrayField doGetValue() { return a().or(larg().getValue(true), rarg().getValue(true)); } @Override public List<DifferentialFunction> doDiff(List<DifferentialFunction> i_v) { throw new UnsupportedOperationException(); } @Override public String functionName() { return new org.nd4j.linalg.api.ops.impl.transforms.Or().name(); } }
[ "adam@skymind.io" ]
adam@skymind.io
8f6b215b9131888df097df73a1cde4e34df0284c
db2ca48fffaf6689c9db439abaf9d98729548e0b
/minsu-service/minsu-service-entity/src/main/java/com/ziroom/minsu/valenum/order/OrderCancelTypeEnum.java
619f583331671319d2f1261f941df2d5183b3590
[]
no_license
majinwen/sojourn
46a950dbd64442e4ef333c512eb956be9faef50d
ab98247790b1951017fc7dd340e1941d5b76dc39
refs/heads/master
2020-03-22T07:07:05.299160
2018-03-18T13:45:23
2018-03-18T13:45:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,166
java
package com.ziroom.minsu.valenum.order; import com.asura.framework.base.util.Check; /** * <p>强制取消类型</p> * <p/> * <PRE> * <BR> 修改记录 * <BR>----------------------------------------------- * <BR> 修改日期 修改人 修改内容 * </PRE> * * @author afi on 2016/4/26. * @version 1.0 * @since 1.0 */ public enum OrderCancelTypeEnum { REFUND(1,"直接退款"), CONTINUE(2,"协助租房"); OrderCancelTypeEnum(int code, String name) { this.code = code; this.name = name; } /** * 获取当前的类型 * @author afi * @param code * @return */ public static OrderCancelTypeEnum getByCode(Integer code){ if(Check.NuNObj(code)){ return null; } for(final OrderCancelTypeEnum ose : OrderCancelTypeEnum.values()){ if(ose.getCode() == code){ return ose; } } return null; } /** code */ private int code; /** 名称 */ private String name; public int getCode() { return code; } public String getName() { return name; } }
[ "068411Lsp" ]
068411Lsp
9c435b195f93ecc702f2e9eb4b4740a0af92641e
acbb56922b48774b9c4d03a335d8c971dd64b80d
/GOLauncherEX_Plugin_Inf/src/com/go/util/file/media/MediaDbUtil.java
f60a37804f27e8ce5461fa51f8ba75b5b2a20a00
[]
no_license
Lakkichand/smartapp-src
91284c469308e9e40c45a7782d0bdb79c80bf9e2
1a174a9dd6a8a784d5faf204404e9a0abede4fa5
refs/heads/master
2021-01-10T16:51:09.042107
2015-03-28T15:15:06
2015-03-28T15:15:06
45,905,976
4
7
null
null
null
null
UTF-8
Java
false
false
1,772
java
package com.go.util.file.media; import android.database.Cursor; import android.database.SQLException; public class MediaDbUtil { public static int getInt(Cursor cursor, String key) { if (null == cursor || null == key || key.length() <= 0) { throw new SQLException("params err"); } int column = cursor.getColumnIndex(key); if (column < 0) { throw new SQLException("key not exist"); } return cursor.getInt(column); } public static String getString(Cursor cursor, String key) { if (null == cursor || null == key || key.length() <= 0) { throw new SQLException("params err"); } int column = cursor.getColumnIndex(key); if (column < 0) { throw new SQLException("key not exist"); } return cursor.getString(column); } public static float getFloat(Cursor cursor, String key) { if (null == cursor || null == key || key.length() <= 0) { throw new SQLException("params err"); } int column = cursor.getColumnIndex(key); if (column < 0) { throw new SQLException("key not exist"); } return cursor.getFloat(column); } public static long getLong(Cursor cursor, String key) { if (null == cursor || null == key || key.length() <= 0) { throw new SQLException("params err"); } int column = cursor.getColumnIndex(key); if (column < 0) { throw new SQLException("key not exist"); } return cursor.getLong(column); } public static short getShort(Cursor cursor, String key) { if (null == cursor || null == key || key.length() <= 0) { throw new SQLException("params err"); } int column = cursor.getColumnIndex(key); if (column < 0) { throw new SQLException("key not exist"); } return cursor.getShort(column); } }
[ "yijiajia1988@gmail.com@702b21dd-f629-e120-7dff-525d4d49388d" ]
yijiajia1988@gmail.com@702b21dd-f629-e120-7dff-525d4d49388d
1d4f2da5bb7ae9270c6c4d17a0bea7ad3c6c5ae7
3dd35c0681b374ce31dbb255b87df077387405ff
/generated/entity/windowed/APDPolicyInvolvedPartyVersionList.java
82b259cef63ab9b067c78cf4cc7c667d1e35ee22
[]
no_license
walisashwini/SBTBackup
58b635a358e8992339db8f2cc06978326fed1b99
4d4de43576ec483bc031f3213389f02a92ad7528
refs/heads/master
2023-01-11T09:09:10.205139
2020-11-18T12:11:45
2020-11-18T12:11:45
311,884,817
0
0
null
null
null
null
UTF-8
Java
false
false
559
java
package entity.windowed; @javax.annotation.Generated(value = "com.guidewire.pl.metadata.codegen.Codegen", comments = "APDPolicyInvolvedParty.eti;APDPolicyInvolvedParty.eix;APDPolicyInvolvedParty.etx") @java.lang.SuppressWarnings(value = {"deprecation", "unchecked"}) @gw.lang.SimplePropertyProcessing public interface APDPolicyInvolvedPartyVersionList extends entity.windowed.PolicyContactRoleVersionList { entity.APDPolicyInvolvedParty AsOf(java.util.Date date); java.util.List<? extends entity.APDPolicyInvolvedParty> getAllVersions(); }
[ "ashwini@cruxxtechnologies.com" ]
ashwini@cruxxtechnologies.com