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
e258729e93eb9b93543d09455acb537caea01dca
d2eee6e9a3ad0b3fd2899c3d1cf94778615b10cb
/PROMISE/archives/velocity/1.6/org/apache/velocity/.svn/pristine/e2/e258729e93eb9b93543d09455acb537caea01dca.svn-base
8c283b12a84b616b0e54c5b6c588c3b84deaa094
[]
no_license
hvdthong/DEFECT_PREDICTION
78b8e98c0be3db86ffaed432722b0b8c61523ab2
76a61c69be0e2082faa3f19efd76a99f56a32858
refs/heads/master
2021-01-20T05:19:00.927723
2018-07-10T03:38:14
2018-07-10T03:38:14
89,766,606
5
1
null
null
null
null
UTF-8
Java
false
false
4,241
package org.apache.velocity.app.event.implement; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.PrintWriter; import java.io.StringWriter; import org.apache.velocity.app.event.MethodExceptionEventHandler; import org.apache.velocity.runtime.RuntimeServices; import org.apache.velocity.util.RuntimeServicesAware; /** * Simple event handler that renders method exceptions in the page * rather than throwing the exception. Useful for debugging. * * <P>By default this event handler renders the exception name only. * To include both the exception name and the message, set the property * <code>eventhandler.methodexception.message</code> to <code>true</code>. To render * the stack trace, set the property <code>eventhandler.methodexception.stacktrace</code> * to <code>true</code>. * * @author <a href="mailto:wglass@forio.com">Will Glass-Husain</a> * @version $Id$ * @since 1.5 */ public class PrintExceptions implements MethodExceptionEventHandler, RuntimeServicesAware { private static String SHOW_MESSAGE = "eventhandler.methodexception.message"; private static String SHOW_STACK_TRACE = "eventhandler.methodexception.stacktrace"; /** Reference to the runtime service */ private RuntimeServices rs = null; /** * Render the method exception, and optionally the exception message and stack trace. * * @param claz the class of the object the method is being applied to * @param method the method * @param e the thrown exception * @return an object to insert in the page * @throws Exception an exception to be thrown instead inserting an object */ public Object methodException(Class claz, String method, Exception e) throws Exception { boolean showMessage = rs.getBoolean(SHOW_MESSAGE,false); boolean showStackTrace = rs.getBoolean(SHOW_STACK_TRACE,false); StringBuffer st; if (showMessage && showStackTrace) { st = new StringBuffer(200); st.append(e.getClass().getName()).append("\n"); st.append(e.getMessage()).append("\n"); st.append(getStackTrace(e)); } else if (showMessage) { st = new StringBuffer(50); st.append(e.getClass().getName()).append("\n"); st.append(e.getMessage()).append("\n"); } else if (showStackTrace) { st = new StringBuffer(200); st.append(e.getClass().getName()).append("\n"); st.append(getStackTrace(e)); } else { st = new StringBuffer(15); st.append(e.getClass().getName()).append("\n"); } return st.toString(); } private static String getStackTrace(Throwable throwable) { PrintWriter printWriter = null; try { StringWriter stackTraceWriter = new StringWriter(); printWriter = new PrintWriter(stackTraceWriter); throwable.printStackTrace(printWriter); printWriter.flush(); return stackTraceWriter.toString(); } finally { if (printWriter != null) { printWriter.close(); } } } /** * @see org.apache.velocity.util.RuntimeServicesAware#setRuntimeServices(org.apache.velocity.runtime.RuntimeServices) */ public void setRuntimeServices(RuntimeServices rs) { this.rs = rs; } }
[ "hvdthong@github.com" ]
hvdthong@github.com
bb751956de1946feb100ca71a9e214042cbaec91
cf4b9592aad69a17fa41ead7371598e4bf450330
/src/com/troy/ludumdare/sound/Sound.java
739ffd6b0b0f18b97a4a755cf968b22e807cf3dd
[]
no_license
TroyNeubauer/Ludum-Dare-36
360695e8b04da6ceeae9c760dcf2e50b689b59ee
57a6c1bc59e2d91127c164f06ba07dcc99d1e8c5
refs/heads/master
2020-12-25T15:17:38.835985
2016-10-17T01:21:03
2016-10-17T01:21:03
66,306,879
0
0
null
null
null
null
UTF-8
Java
false
false
586
java
package com.troy.ludumdare.sound; import javax.sound.sampled.*; public class Sound { public final String name; public Sound(String name) { this.name = name; } public synchronized void play() { new Thread(new Runnable() { public void run() { try { Clip clip = AudioSystem.getClip(); AudioInputStream inputStream = AudioSystem.getAudioInputStream(Class.class.getResourceAsStream("/sounds/" + name + ".wav")); clip.open(inputStream); clip.start(); } catch (Exception e) { System.err.println(e.getMessage()); } } }).start(); } }
[ "troyneubauer@gmail.com" ]
troyneubauer@gmail.com
68baeb252ba3ccd129f68f756fb7247bd8b46a7e
75550ae45a7feb106be1ea47e4fd2395225b967d
/src/main/java/in/hocg/zhifou/support/oss/OssService.java
a8cae2f8fd9c9fcf3bbd4e543e5a6963cb5e38e3
[]
no_license
hocgin/zhifou-api
5941d0555328cb0c9ddde369b38f58f646c03c76
4c9d17f91e468d4f689c45b854d6bd63a2715ef6
refs/heads/master
2022-06-22T18:30:33.920603
2019-06-09T12:17:25
2019-06-09T12:17:25
149,009,937
1
1
null
2022-06-17T02:08:41
2018-09-16T15:40:55
Java
UTF-8
Java
false
false
1,442
java
package in.hocg.zhifou.support.oss; import com.google.common.hash.HashCode; import com.google.common.io.Files; import in.hocg.zhifou.util.LangKit; import lombok.SneakyThrows; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.util.Optional; /** * Created by hocgin on 2019/6/1. * email: hocgin@gmail.com * * @author hocgin */ public interface OssService { /** * 获取文件名 * * @param file * @return */ @SneakyThrows default String filename(File file) { String prefix = Files.getFileExtension(file.getName()); HashCode hashCode = LangKit.md5(Files.toByteArray(file)); return String.format("%s.%s", hashCode.toString(), prefix); } /** * 上传文件 * * @param file 文件 * @return 保存的文件名 * @throws IOException */ String upload(File file) throws IOException; /** * 是否已经存在 * * @param filename 保存的文件名 * @return 是否存在 */ boolean isExist(String filename); /** * 删除文件 * * @param filename 保存的文件名 * @return 是否删除成功 */ void delete(String filename); /** * 查找文件 * * @param filename 保存的文件名 * @return 查找结果 */ Optional<InputStream> get(String filename); }
[ "hocgin@gmail.com" ]
hocgin@gmail.com
9d2d5ec6c41cdc61d60180a8e777169466ce8697
1f2a7efc5e404d96122becc349af158198c66b9f
/save_eclipse/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/work/Catalina/localhost/day0218/org/apache/jsp/exam02/ex01_jsp.java
e92a9ef459260faa14841c21f510032a6675aa88
[]
no_license
hminah0215/bitcamp
e5cdb4579ed353d1a1454ce20772ec6edb4334b0
6f749eed71e6dc978719c15faf34ffe407fc343f
refs/heads/master
2022-10-09T23:29:51.769020
2020-04-12T08:58:45
2020-04-12T08:58:45
251,504,494
2
2
null
2022-09-01T23:22:42
2020-03-31T04:58:55
Java
UTF-8
Java
false
false
3,544
java
/* * Generated by the Jasper component of Apache Tomcat * Version: Apache Tomcat/7.0.47 * Generated at: 2020-02-18 01:39:47 UTC * Note: The last modified time of this file was set to * the last modified time of the source file after * generation to assist with modification tracking. */ package org.apache.jsp.exam02; import javax.servlet.*; import javax.servlet.http.*; import javax.servlet.jsp.*; public final class ex01_jsp extends org.apache.jasper.runtime.HttpJspBase implements org.apache.jasper.runtime.JspSourceDependent { private static final javax.servlet.jsp.JspFactory _jspxFactory = javax.servlet.jsp.JspFactory.getDefaultFactory(); private static java.util.Map<java.lang.String,java.lang.Long> _jspx_dependants; private javax.el.ExpressionFactory _el_expressionfactory; private org.apache.tomcat.InstanceManager _jsp_instancemanager; public java.util.Map<java.lang.String,java.lang.Long> getDependants() { return _jspx_dependants; } public void _jspInit() { _el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory(); _jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig()); } public void _jspDestroy() { } public void _jspService(final javax.servlet.http.HttpServletRequest request, final javax.servlet.http.HttpServletResponse response) throws java.io.IOException, javax.servlet.ServletException { final javax.servlet.jsp.PageContext pageContext; javax.servlet.http.HttpSession session = null; final javax.servlet.ServletContext application; final javax.servlet.ServletConfig config; javax.servlet.jsp.JspWriter out = null; final java.lang.Object page = this; javax.servlet.jsp.JspWriter _jspx_out = null; javax.servlet.jsp.PageContext _jspx_page_context = null; try { response.setContentType("text/html; charset=UTF-8"); pageContext = _jspxFactory.getPageContext(this, request, response, null, true, 8192, true); _jspx_page_context = pageContext; application = pageContext.getServletContext(); config = pageContext.getServletConfig(); session = pageContext.getSession(); out = pageContext.getOut(); _jspx_out = out; out.write("\r\n"); out.write("<!DOCTYPE html>\r\n"); out.write("<html>\r\n"); out.write("<head>\r\n"); out.write("<meta charset=\"UTF-8\">\r\n"); out.write("<title>Insert title here</title>\r\n"); out.write("<style type=\"text/css\">\r\n"); out.write("\t#parent{width: 500px; height: 500px; background: yellow; }\r\n"); out.write("\t#child{width: 200px; height: 200px; background: red;} \r\n"); out.write("</style>\r\n"); out.write("</head>\r\n"); out.write("<body>\r\n"); out.write("\t<div id=\"parent\">\r\n"); out.write("\t\t<div id=\"child\"></div>\r\n"); out.write("\t</div>\r\n"); out.write("</body>\r\n"); out.write("</html>"); } catch (java.lang.Throwable t) { if (!(t instanceof javax.servlet.jsp.SkipPageException)){ out = _jspx_out; if (out != null && out.getBufferSize() != 0) try { out.clearBuffer(); } catch (java.io.IOException e) {} if (_jspx_page_context != null) _jspx_page_context.handlePageException(t); else throw new ServletException(t); } } finally { _jspxFactory.releasePageContext(_jspx_page_context); } } }
[ "hyeonminah@gmail.com" ]
hyeonminah@gmail.com
7952a403f94ad08f75a4d9e7324775d94ba2e38b
e1af7696101f8f9eb12c0791c211e27b4310ecbc
/MCP/src/minecraft/net/minecraft/client/renderer/entity/layers/LayerArrow.java
96b3a5aa05dbeaf8d83eee93e564dc606115ceac
[]
no_license
VinmaniaTV/Mania-Client
e36810590edf09b1d78b8eeaf5cbc46bb3e2d8ce
7a12b8bad1a8199151b3f913581775f50cc4c39c
refs/heads/main
2023-02-12T10:31:29.076263
2021-01-13T02:29:35
2021-01-13T02:29:35
329,156,099
0
0
null
null
null
null
UTF-8
Java
false
false
3,263
java
package net.minecraft.client.renderer.entity.layers; import java.util.Random; import net.minecraft.client.model.ModelBox; import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.entity.RenderLivingBase; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.projectile.EntityTippedArrow; import net.minecraft.util.math.MathHelper; public class LayerArrow implements LayerRenderer<EntityLivingBase> { private final RenderLivingBase<?> renderer; public LayerArrow(RenderLivingBase<?> rendererIn) { this.renderer = rendererIn; } public void doRenderLayer(EntityLivingBase entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) { int i = entitylivingbaseIn.getArrowCountInEntity(); if (i > 0) { Entity entity = new EntityTippedArrow(entitylivingbaseIn.world, entitylivingbaseIn.posX, entitylivingbaseIn.posY, entitylivingbaseIn.posZ); Random random = new Random((long)entitylivingbaseIn.getEntityId()); RenderHelper.disableStandardItemLighting(); for (int j = 0; j < i; ++j) { GlStateManager.pushMatrix(); ModelRenderer modelrenderer = this.renderer.getMainModel().getRandomModelBox(random); ModelBox modelbox = modelrenderer.cubeList.get(random.nextInt(modelrenderer.cubeList.size())); modelrenderer.postRender(0.0625F); float f = random.nextFloat(); float f1 = random.nextFloat(); float f2 = random.nextFloat(); float f3 = (modelbox.posX1 + (modelbox.posX2 - modelbox.posX1) * f) / 16.0F; float f4 = (modelbox.posY1 + (modelbox.posY2 - modelbox.posY1) * f1) / 16.0F; float f5 = (modelbox.posZ1 + (modelbox.posZ2 - modelbox.posZ1) * f2) / 16.0F; GlStateManager.translate(f3, f4, f5); f = f * 2.0F - 1.0F; f1 = f1 * 2.0F - 1.0F; f2 = f2 * 2.0F - 1.0F; f = f * -1.0F; f1 = f1 * -1.0F; f2 = f2 * -1.0F; float f6 = MathHelper.sqrt(f * f + f2 * f2); entity.rotationYaw = (float)(Math.atan2((double)f, (double)f2) * (180D / Math.PI)); entity.rotationPitch = (float)(Math.atan2((double)f1, (double)f6) * (180D / Math.PI)); entity.prevRotationYaw = entity.rotationYaw; entity.prevRotationPitch = entity.rotationPitch; double d0 = 0.0D; double d1 = 0.0D; double d2 = 0.0D; this.renderer.getRenderManager().doRenderEntity(entity, 0.0D, 0.0D, 0.0D, 0.0F, partialTicks, false); GlStateManager.popMatrix(); } RenderHelper.enableStandardItemLighting(); } } public boolean shouldCombineTextures() { return false; } }
[ "vinmaniamc@gmail.com" ]
vinmaniamc@gmail.com
226cb47f7caf048b4202b79f5e0c173037b36701
80b278adacacc09713e2d7085e39b6753c6588ed
/redis-01-jedis/src/main/java/com/yuzh/jedis/TestTx.java
9f6b74b949c977a8d3078f1e419ae3afcfedfc14
[]
no_license
yuzhihui199229/redis
a285d57e6b6b5f0c83f6c49151064d53c4c12ee5
327ec4644255ca71ec4ead5933ad5470f8138d32
refs/heads/master
2023-05-24T09:36:43.811620
2021-06-16T10:58:10
2021-06-16T10:58:10
377,358,307
0
0
null
null
null
null
UTF-8
Java
false
false
975
java
package com.yuzh.jedis; import com.alibaba.fastjson.JSONObject; import redis.clients.jedis.Jedis; import redis.clients.jedis.Transaction; public class TestTx { public static void main(String[] args) { Jedis jedis = new Jedis("192.168.1.78", 6379); jedis.flushDB(); JSONObject jsonObject = new JSONObject(); jsonObject.put("hello", "world"); jsonObject.put("name", "yuzh"); String result = jsonObject.toJSONString(); //开启事务 Transaction multi = jedis.multi(); try { multi.set("user1", result); multi.set("user2", result); int i = 1 / 0; multi.exec();//执行事务 } catch (Exception e) { multi.discard();//放弃事务 e.printStackTrace(); } finally { System.out.println(jedis.get("user1")); System.out.println(jedis.get("user2")); jedis.close(); } } }
[ "844370396@qq.com" ]
844370396@qq.com
34affba78d7daf201fead4ce6a2399cfd6be94ac
f5580f1b7fdff1fa716ed46afc0a831aa7761e4b
/base/src/test/java/tk/mybatis/mapper/base/delete/DeleteByPrimaryKeyMapperTest.java
89f8025539dce6159fe41bfad7c5bd9295acc745
[ "MIT" ]
permissive
ruancheng77/Mapper
be8f6016ad4c1bdbc3458a1274672c05fa2f9db1
15f7be847ccbf3528e6e0abeb260b161454cabb6
refs/heads/master
2020-04-08T01:47:48.442845
2018-11-24T03:53:34
2018-11-24T03:53:34
158,909,542
1
0
MIT
2018-11-24T06:35:34
2018-11-24T06:35:34
null
UTF-8
Java
false
false
1,140
java
package tk.mybatis.mapper.base.delete; import org.apache.ibatis.session.SqlSession; import org.junit.Assert; import org.junit.Test; import tk.mybatis.mapper.base.BaseTest; import tk.mybatis.mapper.base.CountryMapper; public class DeleteByPrimaryKeyMapperTest extends BaseTest { @Test public void testDeleteByPrimaryKey(){ SqlSession sqlSession = getSqlSession(); try { CountryMapper mapper = sqlSession.getMapper(CountryMapper.class); Assert.assertEquals(183, mapper.selectAll().size()); Assert.assertEquals(1, mapper.deleteByPrimaryKey(1L)); Assert.assertEquals(182, mapper.selectAll().size()); Assert.assertEquals(1, mapper.deleteByPrimaryKey(2)); Assert.assertEquals(181, mapper.selectAll().size()); Assert.assertEquals(1, mapper.deleteByPrimaryKey("3")); Assert.assertEquals(180, mapper.selectAll().size()); Assert.assertEquals(0, mapper.deleteByPrimaryKey(1)); Assert.assertEquals(180, mapper.selectAll().size()); } finally { sqlSession.close(); } } }
[ "abel533@gmail.com" ]
abel533@gmail.com
772fd694cfa8d042ac5cfdfadf2e3ab0277cd7b5
1f3544caf3558ecf90e2e782fba9c8671ba6b769
/RSyntaxTextArea/src/test/java/org/fife/ui/rtextarea/RTextAreaEditorKitNextVisualPositionActionTest.java
6612e2066bb55ab01e60679f0dd179ca960eb6d0
[ "BSD-3-Clause" ]
permissive
bobbylight/RSyntaxTextArea
22e77b7867f6407459e70aea1534d6d9c04c7ae7
2d7b80edd37b1eaf4e50b584b7ad59be7b22938b
refs/heads/master
2023-09-02T18:23:01.390461
2023-08-27T20:02:06
2023-08-27T20:02:06
11,966,919
977
312
BSD-3-Clause
2023-08-12T15:47:31
2013-08-08T03:40:21
Java
UTF-8
Java
false
false
4,446
java
/* * This library is distributed under a modified BSD license. See the included * LICENSE file for details. */ package org.fife.ui.rtextarea; import org.fife.ui.SwingRunnerExtension; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import javax.swing.*; import java.awt.event.ActionEvent; /** * Unit tests for the {@link RTextAreaEditorKit.NextVisualPositionAction} class. * * @author Robert Futrell * @version 1.0 */ @ExtendWith(SwingRunnerExtension.class) class RTextAreaEditorKitNextVisualPositionActionTest extends AbstractRTextAreaTest { private RTextArea textArea; @BeforeEach void setUp() { textArea = new RTextArea("one two one two\none two"); textArea.setSize(800, 800); // BasicTextUI requires at least one paint cycle for visual positions to be computed textArea.paint(createTestGraphics()); } @Test void testActionPerformedImpl_noSelection_noSelect_east() { textArea.setCaretPosition(6); ActionEvent e = new ActionEvent(textArea, 0, "command"); new RTextAreaEditorKit.NextVisualPositionAction("foo", false, SwingConstants.EAST). actionPerformedImpl(e, textArea); Assertions.assertEquals(7, textArea.getCaret().getDot()); } @Test void testActionPerformedImpl_noSelection_noSelect_north() { textArea.setCaretPosition(16); ActionEvent e = new ActionEvent(textArea, 0, "command"); new RTextAreaEditorKit.NextVisualPositionAction("foo", false, SwingConstants.NORTH). actionPerformedImpl(e, textArea); Assertions.assertEquals(0, textArea.getCaret().getDot()); } @Test void testActionPerformedImpl_noSelection_noSelect_south() { textArea.setCaretPosition(0); ActionEvent e = new ActionEvent(textArea, 0, "command"); new RTextAreaEditorKit.NextVisualPositionAction("foo", false, SwingConstants.SOUTH). actionPerformedImpl(e, textArea); Assertions.assertEquals(16, textArea.getCaret().getDot()); } @Test void testActionPerformedImpl_noSelection_noSelect_west() { textArea.setCaretPosition(6); ActionEvent e = new ActionEvent(textArea, 0, "command"); new RTextAreaEditorKit.NextVisualPositionAction("foo", false, SwingConstants.WEST). actionPerformedImpl(e, textArea); Assertions.assertEquals(5, textArea.getCaretPosition()); } @Test void testActionPerformedImpl_noSelection_select_east() { textArea.setCaretPosition(6); ActionEvent e = new ActionEvent(textArea, 0, "command"); new RTextAreaEditorKit.NextVisualPositionAction("foo", true, SwingConstants.EAST). actionPerformedImpl(e, textArea); Assertions.assertEquals(6, textArea.getSelectionStart()); Assertions.assertEquals(7, textArea.getSelectionEnd()); Assertions.assertEquals(7, textArea.getCaretPosition()); } @Test void testActionPerformedImpl_noSelection_select_west() { textArea.setCaretPosition(6); ActionEvent e = new ActionEvent(textArea, 0, "command"); new RTextAreaEditorKit.NextVisualPositionAction("foo", true, SwingConstants.WEST). actionPerformedImpl(e, textArea); Assertions.assertEquals(5, textArea.getSelectionStart()); Assertions.assertEquals(6, textArea.getSelectionEnd()); Assertions.assertEquals(5, textArea.getCaretPosition()); } @Test void testActionPerformedImpl_selection_noSelect_east() { textArea.setSelectionStart(3); textArea.setSelectionEnd(6); ActionEvent e = new ActionEvent(textArea, 0, "command"); // Selection removed, caret at end of prior selection new RTextAreaEditorKit.NextVisualPositionAction("foo", false, SwingConstants.EAST). actionPerformedImpl(e, textArea); Assertions.assertEquals(6, textArea.getSelectionStart()); Assertions.assertEquals(6, textArea.getSelectionEnd()); } @Test void testActionPerformedImpl_selection_noSelect_west() { textArea.setSelectionStart(3); textArea.setSelectionEnd(6); ActionEvent e = new ActionEvent(textArea, 0, "command"); // Selection removed, caret at start of prior selection new RTextAreaEditorKit.NextVisualPositionAction("foo", false, SwingConstants.WEST). actionPerformedImpl(e, textArea); Assertions.assertEquals(3, textArea.getSelectionStart()); Assertions.assertEquals(3, textArea.getSelectionEnd()); } @Test void testGetMacroId() { Assertions.assertEquals("foo", new RTextAreaEditorKit.NextVisualPositionAction("foo", false, SwingConstants.EAST).getMacroID()); } }
[ "robert.e.futrell@gmail.com" ]
robert.e.futrell@gmail.com
8e1e7e60dd33ec6d3113f2709ed8e65350a9e9b8
6d109557600329b936efe538957dfd0a707eeafb
/src/com/google/api/ads/dfp/v201302/ReportJob.java
cdc528d7fb48823868adb717f566bae383718324
[ "Apache-2.0" ]
permissive
google-code-export/google-api-dfp-java
51b0142c19a34cd822a90e0350eb15ec4347790a
b852c716ef6e5d300363ed61e15cbd6242fbac85
refs/heads/master
2020-05-20T03:52:00.420915
2013-12-19T23:08:40
2013-12-19T23:08:40
32,133,590
0
0
null
null
null
null
UTF-8
Java
false
false
7,377
java
/** * ReportJob.java * * This file was auto-generated from WSDL * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. */ package com.google.api.ads.dfp.v201302; /** * Represents a report job that will be run to retrieve performance * and * statistics information about ad campaigns, networks, inventory * and sales. */ public class ReportJob implements java.io.Serializable { /* The unique ID of the {@code ReportJob}. This value is read-only * and is * assigned by Google. */ private java.lang.Long id; /* Holds the filtering criteria. */ private com.google.api.ads.dfp.v201302.ReportQuery reportQuery; /* The status of the {@code ReportJob}. This attribute is read-only * and is * assigned by Google. */ private com.google.api.ads.dfp.v201302.ReportJobStatus reportJobStatus; public ReportJob() { } public ReportJob( java.lang.Long id, com.google.api.ads.dfp.v201302.ReportQuery reportQuery, com.google.api.ads.dfp.v201302.ReportJobStatus reportJobStatus) { this.id = id; this.reportQuery = reportQuery; this.reportJobStatus = reportJobStatus; } /** * Gets the id value for this ReportJob. * * @return id * The unique ID of the {@code ReportJob}. This value is read-only * and is * assigned by Google. */ public java.lang.Long getId() { return id; } /** * Sets the id value for this ReportJob. * * @param id * The unique ID of the {@code ReportJob}. This value is read-only * and is * assigned by Google. */ public void setId(java.lang.Long id) { this.id = id; } /** * Gets the reportQuery value for this ReportJob. * * @return reportQuery * Holds the filtering criteria. */ public com.google.api.ads.dfp.v201302.ReportQuery getReportQuery() { return reportQuery; } /** * Sets the reportQuery value for this ReportJob. * * @param reportQuery * Holds the filtering criteria. */ public void setReportQuery(com.google.api.ads.dfp.v201302.ReportQuery reportQuery) { this.reportQuery = reportQuery; } /** * Gets the reportJobStatus value for this ReportJob. * * @return reportJobStatus * The status of the {@code ReportJob}. This attribute is read-only * and is * assigned by Google. */ public com.google.api.ads.dfp.v201302.ReportJobStatus getReportJobStatus() { return reportJobStatus; } /** * Sets the reportJobStatus value for this ReportJob. * * @param reportJobStatus * The status of the {@code ReportJob}. This attribute is read-only * and is * assigned by Google. */ public void setReportJobStatus(com.google.api.ads.dfp.v201302.ReportJobStatus reportJobStatus) { this.reportJobStatus = reportJobStatus; } private java.lang.Object __equalsCalc = null; public synchronized boolean equals(java.lang.Object obj) { if (!(obj instanceof ReportJob)) return false; ReportJob other = (ReportJob) obj; if (obj == null) return false; if (this == obj) return true; if (__equalsCalc != null) { return (__equalsCalc == obj); } __equalsCalc = obj; boolean _equals; _equals = true && ((this.id==null && other.getId()==null) || (this.id!=null && this.id.equals(other.getId()))) && ((this.reportQuery==null && other.getReportQuery()==null) || (this.reportQuery!=null && this.reportQuery.equals(other.getReportQuery()))) && ((this.reportJobStatus==null && other.getReportJobStatus()==null) || (this.reportJobStatus!=null && this.reportJobStatus.equals(other.getReportJobStatus()))); __equalsCalc = null; return _equals; } private boolean __hashCodeCalc = false; public synchronized int hashCode() { if (__hashCodeCalc) { return 0; } __hashCodeCalc = true; int _hashCode = 1; if (getId() != null) { _hashCode += getId().hashCode(); } if (getReportQuery() != null) { _hashCode += getReportQuery().hashCode(); } if (getReportJobStatus() != null) { _hashCode += getReportJobStatus().hashCode(); } __hashCodeCalc = false; return _hashCode; } // Type metadata private static org.apache.axis.description.TypeDesc typeDesc = new org.apache.axis.description.TypeDesc(ReportJob.class, true); static { typeDesc.setXmlType(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201302", "ReportJob")); org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("id"); elemField.setXmlName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201302", "id")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "long")); elemField.setMinOccurs(0); elemField.setNillable(false); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("reportQuery"); elemField.setXmlName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201302", "reportQuery")); elemField.setXmlType(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201302", "ReportQuery")); elemField.setMinOccurs(0); elemField.setNillable(false); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("reportJobStatus"); elemField.setXmlName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201302", "reportJobStatus")); elemField.setXmlType(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201302", "ReportJobStatus")); elemField.setMinOccurs(0); elemField.setNillable(false); typeDesc.addFieldDesc(elemField); } /** * Return type metadata object */ public static org.apache.axis.description.TypeDesc getTypeDesc() { return typeDesc; } /** * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.BeanSerializer( _javaType, _xmlType, typeDesc); } /** * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.BeanDeserializer( _javaType, _xmlType, typeDesc); } }
[ "api.arogal@gmail.com@e5600b00-1bfd-11df-acd4-e1cde50d4098" ]
api.arogal@gmail.com@e5600b00-1bfd-11df-acd4-e1cde50d4098
311727c08e5895bdd540e18d88c68f3d32c20322
4f78466511a44d3742169e8ecdc312a6e7a0a126
/sechub-scan/src/test/java/com/daimler/sechub/domain/scan/OneInstallSetupTest.java
e9e73a85d1a976ffcb49d34c28dfd7d5a5a86135
[ "MIT" ]
permissive
jonico/sechub
670999fb2cc035f26e1611f180a8abdeea33f255
f74f6a7e64f9ef011592733d034845ef7fe7f369
refs/heads/develop
2020-09-18T18:23:45.711783
2019-11-22T08:32:03
2019-11-22T08:57:08
224,164,065
0
0
MIT
2019-11-26T10:26:47
2019-11-26T10:26:46
null
UTF-8
Java
false
false
2,651
java
// SPDX-License-Identifier: MIT package com.daimler.sechub.domain.scan; import static org.junit.Assert.*; import org.junit.Before; import org.junit.Test; public class OneInstallSetupTest { private static final String HOSTNAME_INTRANET = "hostnameIntranet"; private static final String HOSTNAME_INTERNET = "hostnameInternet"; private String identifierInternetTarget; private String identifierIntranetTarget; @Before public void before() throws Exception { identifierIntranetTarget=null; identifierInternetTarget=null; } @Test public void intranet_set__internet_set() { /* prepare */ identifierIntranetTarget=HOSTNAME_INTRANET; identifierInternetTarget=HOSTNAME_INTERNET; /* test */ expectCanScan(TargetType.INTERNET); expectCanScan(TargetType.INTRANET); } @Test public void intranet_not_set__internet_not_set() { /* prepare - not necessary, everything null*/ /* test */ expectCannotScan(TargetType.INTERNET); expectCannotScan(TargetType.INTRANET); } @Test public void intranet_set__internet_not_set() { /* prepare */ identifierIntranetTarget=HOSTNAME_INTRANET; /* test */ expectCanScan(TargetType.INTRANET); expectCannotScan(TargetType.INTERNET); } @Test public void intranet_not_set__internet_set() { /* prepare */ identifierInternetTarget=HOSTNAME_INTERNET; /* test */ expectCannotScan(TargetType.INTRANET); expectCanScan(TargetType.INTERNET); } private void expectCanScan(TargetType type) { expectCanOrCannotScan(true, type); } private void expectCannotScan(TargetType type) { expectCanOrCannotScan(false, type); } private void expectCanOrCannotScan(boolean expectedCan, TargetType type) { /* execute */ TestOneInstallSetup toTest = new TestOneInstallSetup(); /* test */ boolean ableToScan = toTest.isAbleToScan(type); if (expectedCan) { assertTrue("Expected to be able to scan "+type.name()+" but is NOT!", ableToScan); }else { assertFalse("Expected NOT to be able to scan "+type.name()+" but is!", ableToScan); } } private class TestOneInstallSetup extends AbstractTargetIdentifyingOneInstallSetup { @Override protected String getIdentifierWhenInternetTarget() { return identifierInternetTarget; } @Override protected String getIdentifierWhenDaimlerIntranetTarget() { return identifierIntranetTarget; } @Override public String getUserId() { return null; } @Override public String getPassword() { return null; } @Override public String getBaseURL() { return null; } @Override public boolean isHavingUntrustedCertificate() { return false; } } }
[ "albert.tregnaghi@daimler.com" ]
albert.tregnaghi@daimler.com
cae71479f6375b5d011339b482c4c634df555bf7
3a0bfd5e7c40d1b0b2917ad4a10e9f1680f18433
/MIO/AS2/src/main/java/com/asinfo/as2/rs/inventario/dto/ListaProductoMaterialResponseDto.java
50c37557c396f5fa41df3b4346fa16cb943c85ae
[]
no_license
CynPa/gambaSoftware
983827a718058261c1f11eb63991d4be76423139
61ae4f46bc5fdf8d44ad678c4dd67a0a4a89aa6b
refs/heads/master
2021-09-03T16:42:41.120391
2018-01-10T14:25:24
2018-01-10T14:25:24
109,645,375
0
1
null
null
null
null
UTF-8
Java
false
false
5,828
java
/* 1: */ package com.asinfo.as2.rs.inventario.dto; /* 2: */ /* 3: */ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; /* 4: */ import java.io.Serializable; /* 5: */ import java.math.BigDecimal; /* 6: */ /* 7: */ @JsonIgnoreProperties(ignoreUnknown=true) /* 8: */ public class ListaProductoMaterialResponseDto /* 9: */ implements Serializable /* 10: */ { /* 11: */ private Integer idProductoMaterial; /* 12: */ private int idOrganizacion; /* 13: */ private int idSucursal; /* 14: 18 */ private BigDecimal cantidad = BigDecimal.ZERO; /* 15: 20 */ private BigDecimal cantidadSustituto = BigDecimal.ZERO; /* 16: 22 */ private BigDecimal proporcion = new BigDecimal(100); /* 17: */ private Boolean activo; /* 18: */ private Boolean indicadorPrincipal; /* 19: */ private ProductoResponseDto producto; /* 20: */ private ProductoResponseDto sustituto; /* 21: 32 */ private int hashCode = 0; /* 22: */ /* 23: */ public int getHashCode() /* 24: */ { /* 25: 35 */ this.hashCode = hashCode(); /* 26: 36 */ return this.hashCode; /* 27: */ } /* 28: */ /* 29: */ public int hashCode() /* 30: */ { /* 31: 41 */ int hash = 1; /* 32: 42 */ hash += hash * 17 + (this.idProductoMaterial + "").hashCode(); /* 33: 43 */ hash += hash * 36 + (this.idOrganizacion + "").hashCode(); /* 34: 44 */ hash += hash * 40 + (this.idSucursal + "").hashCode(); /* 35: 45 */ hash += hash * 3 + (this.cantidad + "").hashCode(); /* 36: 46 */ hash += hash * 6 + (this.proporcion + "").hashCode(); /* 37: 47 */ hash += hash * 22 + (this.activo + "").hashCode(); /* 38: 48 */ hash += hash * 10 + (this.indicadorPrincipal + "").hashCode(); /* 39: 49 */ hash += hash * 11 + (this.producto + "").hashCode(); /* 40: 50 */ hash += hash * 14 + (this.sustituto + "").hashCode(); /* 41: 51 */ hash += hash * 12 + (this.cantidadSustituto + "").hashCode(); /* 42: */ /* 43: 53 */ return hash; /* 44: */ } /* 45: */ /* 46: */ public Integer getIdProductoMaterial() /* 47: */ { /* 48: 57 */ return this.idProductoMaterial; /* 49: */ } /* 50: */ /* 51: */ public void setIdProductoMaterial(Integer idProductoMaterial) /* 52: */ { /* 53: 61 */ this.idProductoMaterial = idProductoMaterial; /* 54: */ } /* 55: */ /* 56: */ public int getIdOrganizacion() /* 57: */ { /* 58: 65 */ return this.idOrganizacion; /* 59: */ } /* 60: */ /* 61: */ public void setIdOrganizacion(int idOrganizacion) /* 62: */ { /* 63: 69 */ this.idOrganizacion = idOrganizacion; /* 64: */ } /* 65: */ /* 66: */ public int getIdSucursal() /* 67: */ { /* 68: 73 */ return this.idSucursal; /* 69: */ } /* 70: */ /* 71: */ public void setIdSucursal(int idSucursal) /* 72: */ { /* 73: 77 */ this.idSucursal = idSucursal; /* 74: */ } /* 75: */ /* 76: */ public BigDecimal getCantidad() /* 77: */ { /* 78: 81 */ return this.cantidad; /* 79: */ } /* 80: */ /* 81: */ public void setCantidad(BigDecimal cantidad) /* 82: */ { /* 83: 85 */ this.cantidad = cantidad; /* 84: */ } /* 85: */ /* 86: */ public BigDecimal getProporcion() /* 87: */ { /* 88: 89 */ return this.proporcion; /* 89: */ } /* 90: */ /* 91: */ public void setProporcion(BigDecimal proporcion) /* 92: */ { /* 93: 93 */ this.proporcion = proporcion; /* 94: */ } /* 95: */ /* 96: */ public Boolean getActivo() /* 97: */ { /* 98: 97 */ return this.activo; /* 99: */ } /* 100: */ /* 101: */ public void setActivo(Boolean activo) /* 102: */ { /* 103:101 */ this.activo = activo; /* 104: */ } /* 105: */ /* 106: */ public Boolean getIndicadorPrincipal() /* 107: */ { /* 108:105 */ return this.indicadorPrincipal; /* 109: */ } /* 110: */ /* 111: */ public void setIndicadorPrincipal(Boolean indicadorPrincipal) /* 112: */ { /* 113:109 */ this.indicadorPrincipal = indicadorPrincipal; /* 114: */ } /* 115: */ /* 116: */ public ProductoResponseDto getProducto() /* 117: */ { /* 118:113 */ return this.producto; /* 119: */ } /* 120: */ /* 121: */ public void setProducto(ProductoResponseDto producto) /* 122: */ { /* 123:117 */ this.producto = producto; /* 124: */ } /* 125: */ /* 126: */ public ProductoResponseDto getSustituto() /* 127: */ { /* 128:121 */ return this.sustituto; /* 129: */ } /* 130: */ /* 131: */ public void setSustituto(ProductoResponseDto sustituto) /* 132: */ { /* 133:125 */ this.sustituto = sustituto; /* 134: */ } /* 135: */ /* 136: */ public void setHashCode(int hashCode) /* 137: */ { /* 138:129 */ this.hashCode = hashCode; /* 139: */ } /* 140: */ /* 141: */ public BigDecimal getCantidadSustituto() /* 142: */ { /* 143:133 */ return this.cantidadSustituto; /* 144: */ } /* 145: */ /* 146: */ public void setCantidadSustituto(BigDecimal cantidadSustituto) /* 147: */ { /* 148:137 */ this.cantidadSustituto = cantidadSustituto; /* 149: */ } /* 150: */ } /* Location: C:\backups\AS2(26-10-2017)\WEB-INF\classes\ * Qualified Name: com.asinfo.as2.rs.inventario.dto.ListaProductoMaterialResponseDto * JD-Core Version: 0.7.0.1 */
[ "Gambalit@DESKTOP-0C2RSIN" ]
Gambalit@DESKTOP-0C2RSIN
071176a5210b687f4f0cefa4ba0146be87809950
45736204805554b2d13f1805e47eb369a8e16ec3
/net/minecraft/client/model/ModelBat.java
00c92ddcccba72e1090a8d3c16c32a7908828e40
[]
no_license
KrOySi/ArchWare-Source
9afc6bfcb1d642d2da97604ddfed8048667e81fd
46cdf10af07341b26bfa704886299d80296320c2
refs/heads/main
2022-07-30T02:54:33.192997
2021-08-08T23:36:39
2021-08-08T23:36:39
394,089,144
2
0
null
null
null
null
UTF-8
Java
false
false
4,771
java
/* * Decompiled with CFR 0.150. */ package net.minecraft.client.model; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; import net.minecraft.entity.passive.EntityBat; import net.minecraft.util.math.MathHelper; public class ModelBat extends ModelBase { private final ModelRenderer batHead; private final ModelRenderer batBody; private final ModelRenderer batRightWing; private final ModelRenderer batLeftWing; private final ModelRenderer batOuterRightWing; private final ModelRenderer batOuterLeftWing; public ModelBat() { this.textureWidth = 64; this.textureHeight = 64; this.batHead = new ModelRenderer(this, 0, 0); this.batHead.addBox(-3.0f, -3.0f, -3.0f, 6, 6, 6); ModelRenderer modelrenderer = new ModelRenderer(this, 24, 0); modelrenderer.addBox(-4.0f, -6.0f, -2.0f, 3, 4, 1); this.batHead.addChild(modelrenderer); ModelRenderer modelrenderer1 = new ModelRenderer(this, 24, 0); modelrenderer1.mirror = true; modelrenderer1.addBox(1.0f, -6.0f, -2.0f, 3, 4, 1); this.batHead.addChild(modelrenderer1); this.batBody = new ModelRenderer(this, 0, 16); this.batBody.addBox(-3.0f, 4.0f, -3.0f, 6, 12, 6); this.batBody.setTextureOffset(0, 34).addBox(-5.0f, 16.0f, 0.0f, 10, 6, 1); this.batRightWing = new ModelRenderer(this, 42, 0); this.batRightWing.addBox(-12.0f, 1.0f, 1.5f, 10, 16, 1); this.batOuterRightWing = new ModelRenderer(this, 24, 16); this.batOuterRightWing.setRotationPoint(-12.0f, 1.0f, 1.5f); this.batOuterRightWing.addBox(-8.0f, 1.0f, 0.0f, 8, 12, 1); this.batLeftWing = new ModelRenderer(this, 42, 0); this.batLeftWing.mirror = true; this.batLeftWing.addBox(2.0f, 1.0f, 1.5f, 10, 16, 1); this.batOuterLeftWing = new ModelRenderer(this, 24, 16); this.batOuterLeftWing.mirror = true; this.batOuterLeftWing.setRotationPoint(12.0f, 1.0f, 1.5f); this.batOuterLeftWing.addBox(0.0f, 1.0f, 0.0f, 8, 12, 1); this.batBody.addChild(this.batRightWing); this.batBody.addChild(this.batLeftWing); this.batRightWing.addChild(this.batOuterRightWing); this.batLeftWing.addChild(this.batOuterLeftWing); } @Override public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) { this.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entityIn); this.batHead.render(scale); this.batBody.render(scale); } @Override public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) { if (((EntityBat)entityIn).getIsBatHanging()) { this.batHead.rotateAngleX = headPitch * ((float)Math.PI / 180); this.batHead.rotateAngleY = (float)Math.PI - netHeadYaw * ((float)Math.PI / 180); this.batHead.rotateAngleZ = (float)Math.PI; this.batHead.setRotationPoint(0.0f, -2.0f, 0.0f); this.batRightWing.setRotationPoint(-3.0f, 0.0f, 3.0f); this.batLeftWing.setRotationPoint(3.0f, 0.0f, 3.0f); this.batBody.rotateAngleX = (float)Math.PI; this.batRightWing.rotateAngleX = -0.15707964f; this.batRightWing.rotateAngleY = -1.2566371f; this.batOuterRightWing.rotateAngleY = -1.7278761f; this.batLeftWing.rotateAngleX = this.batRightWing.rotateAngleX; this.batLeftWing.rotateAngleY = -this.batRightWing.rotateAngleY; this.batOuterLeftWing.rotateAngleY = -this.batOuterRightWing.rotateAngleY; } else { this.batHead.rotateAngleX = headPitch * ((float)Math.PI / 180); this.batHead.rotateAngleY = netHeadYaw * ((float)Math.PI / 180); this.batHead.rotateAngleZ = 0.0f; this.batHead.setRotationPoint(0.0f, 0.0f, 0.0f); this.batRightWing.setRotationPoint(0.0f, 0.0f, 0.0f); this.batLeftWing.setRotationPoint(0.0f, 0.0f, 0.0f); this.batBody.rotateAngleX = 0.7853982f + MathHelper.cos(ageInTicks * 0.1f) * 0.15f; this.batBody.rotateAngleY = 0.0f; this.batRightWing.rotateAngleY = MathHelper.cos(ageInTicks * 1.3f) * (float)Math.PI * 0.25f; this.batLeftWing.rotateAngleY = -this.batRightWing.rotateAngleY; this.batOuterRightWing.rotateAngleY = this.batRightWing.rotateAngleY * 0.5f; this.batOuterLeftWing.rotateAngleY = -this.batRightWing.rotateAngleY * 0.5f; } } }
[ "67242784+KrOySi@users.noreply.github.com" ]
67242784+KrOySi@users.noreply.github.com
6f926264f3624c502ebbaa3b122ac0d4d43a8cf5
801ea23bf1e788dee7047584c5c26d99a4d0b2e3
/com/planet_ink/coffee_mud/Abilities/Thief/Thief_Embezzle.java
676e3582d98d3e82eebc06450387994dc65fe3ce
[ "Apache-2.0" ]
permissive
Tearstar/CoffeeMud
61136965ccda651ff50d416b6c6af7e9a89f5784
bb1687575f7166fb8418684c45f431411497cef9
refs/heads/master
2021-01-17T20:23:57.161495
2014-10-18T08:03:37
2014-10-18T08:03:37
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,964
java
package com.planet_ink.coffee_mud.Abilities.Thief; import com.planet_ink.coffee_mud.core.interfaces.*; import com.planet_ink.coffee_mud.core.*; import com.planet_ink.coffee_mud.core.collections.*; import com.planet_ink.coffee_mud.Abilities.interfaces.*; import com.planet_ink.coffee_mud.Areas.interfaces.*; import com.planet_ink.coffee_mud.Behaviors.interfaces.*; import com.planet_ink.coffee_mud.CharClasses.interfaces.*; import com.planet_ink.coffee_mud.Commands.interfaces.*; import com.planet_ink.coffee_mud.Common.interfaces.*; import com.planet_ink.coffee_mud.Exits.interfaces.*; import com.planet_ink.coffee_mud.Items.interfaces.*; import com.planet_ink.coffee_mud.Locales.interfaces.*; import com.planet_ink.coffee_mud.MOBS.interfaces.*; import com.planet_ink.coffee_mud.Races.interfaces.*; import java.util.*; /* Copyright 2003-2014 Bo Zimmerman 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. */ @SuppressWarnings("rawtypes") public class Thief_Embezzle extends ThiefSkill { @Override public String ID() { return "Thief_Embezzle"; } private final static String localizedName = CMLib.lang().L("Embezzle"); @Override public String name() { return localizedName; } @Override public String displayText(){return "";} @Override protected int canAffectCode(){return CAN_MOBS;} @Override protected int canTargetCode(){return CAN_MOBS;} @Override public int abstractQuality(){return Ability.QUALITY_MALICIOUS;} private static final String[] triggerStrings =I(new String[] {"EMBEZZLE"}); @Override public String[] triggerStrings(){return triggerStrings;} @Override public int classificationCode() { return Ability.ACODE_SKILL|Ability.DOMAIN_CRIMINAL; } @Override protected boolean disregardsArmorCheck(MOB mob){return true;} public List<MOB> mobs=new Vector<MOB>(); private final LinkedList<Pair<MOB,Integer>> lastOnes=new LinkedList<Pair<MOB,Integer>>(); protected int timesPicked(MOB target) { int times=0; for(final Iterator<Pair<MOB,Integer>> p=lastOnes.iterator();p.hasNext();) { final Pair<MOB,Integer> P=p.next(); final MOB M=P.first; final Integer I=P.second; if(M==target) { times=I.intValue(); p.remove(); break; } } if(lastOnes.size()>=50) lastOnes.removeFirst(); lastOnes.add(new Pair<MOB,Integer>(target,Integer.valueOf(times+1))); return times+1; } @Override public boolean okMessage(final Environmental myHost, final CMMsg msg) { if((msg.amITarget(affected)) &&(mobs.contains(msg.source()))) { if((msg.targetMinor()==CMMsg.TYP_BUY) ||(msg.targetMinor()==CMMsg.TYP_BID) ||(msg.targetMinor()==CMMsg.TYP_SELL) ||(msg.targetMinor()==CMMsg.TYP_LIST) ||(msg.targetMinor()==CMMsg.TYP_VALUE) ||(msg.targetMinor()==CMMsg.TYP_VIEW)) { msg.source().tell(L("@x1 looks unwilling to do business with you.",affected.name())); return false; } } return super.okMessage(myHost,msg); } @Override public int castingQuality(MOB mob, Physical target) { if(mob!=null) { if(mob.isInCombat()) return Ability.QUALITY_INDIFFERENT; } return super.castingQuality(mob,target); } @Override public boolean invoke(MOB mob, Vector commands, Physical givenTarget, boolean auto, int asLevel) { if((commands.size()<1)&&(givenTarget==null)) { mob.tell(L("Embezzle money from whose accounts?")); return false; } MOB target=null; if((givenTarget!=null)&&(givenTarget instanceof MOB)) target=(MOB)givenTarget; else target=mob.location().fetchInhabitant(CMParms.combine(commands,0)); if((target==null)||(target.amDead())||(!CMLib.flags().canBeSeenBy(target,mob))) { mob.tell(L("You don't see '@x1' here.",CMParms.combine(commands,1))); return false; } if(!(target instanceof Banker)) { mob.tell(L("You can't embezzle from @x1's accounts.",target.name(mob))); return false; } if(mob.isInCombat()) { mob.tell(L("You are too busy to embezzle.")); return false; } final Banker bank=(Banker)target; final Ability A=target.fetchEffect(ID()); if(A!=null) { mob.tell(L("@x1 is watching @x2 books too closely.",target.name(mob),target.charStats().hisher())); return false; } final int levelDiff=target.phyStats().level()-(mob.phyStats().level()+(2*super.getXLEVELLevel(mob))); if(!target.mayIFight(mob)) { mob.tell(L("You cannot embezzle from @x1.",target.charStats().himher())); return false; } Item myCoins=null; String myAcct=mob.Name(); if(bank.isSold(ShopKeeper.DEAL_CLANBANKER)) { Pair<Clan,Integer> clanPair=CMLib.clans().findPrivilegedClan(mob, Clan.Function.WITHDRAW); if(clanPair == null) clanPair=CMLib.clans().findPrivilegedClan(mob, Clan.Function.DEPOSIT_LIST); if(clanPair == null) clanPair=CMLib.clans().findPrivilegedClan(mob, Clan.Function.DEPOSIT); if(clanPair!=null) myAcct=clanPair.first.clanID(); } myCoins=bank.findDepositInventory(myAcct,"1"); if((myCoins==null)||(!(myCoins instanceof Coins))) { mob.tell(L("You don't have your own account with @x1.",target.name(mob))); return false; } final List<String> accounts=bank.getAccountNames(); String victim=""; int tries=0; Coins hisCoins=null; double hisAmount=0; while((hisCoins==null)&&((++tries)<10)) { final String possVic=accounts.get(CMLib.dice().roll(1,accounts.size(),-1)); final Item C=bank.findDepositInventory(possVic,"1"); if((C!=null) &&(C instanceof Coins) &&((((Coins)C).getTotalValue()/50.0)>0.0) &&(!mob.Name().equals(possVic))) { hisCoins=(Coins)C; victim=possVic; hisAmount=hisCoins.getTotalValue()/50.0; } } final int classLevel=CMLib.ableMapper().qualifyingClassLevel(mob,this)+(2*getXLEVELLevel(mob)); if((classLevel>0) &&(Math.round(hisAmount)>(1000*(classLevel)+(2*getXLEVELLevel(mob))))) hisAmount=1000l*(classLevel+(2l*getXLEVELLevel(mob))); if(!super.invoke(mob,commands,givenTarget,auto,asLevel)) return false; final boolean success=proficiencyCheck(mob,(-(levelDiff+(timesPicked(mob)*50))),auto); if((success)&&(hisAmount>0)&&(hisCoins!=null)) { final String str=L("<S-NAME> embezzle(s) @x1 from the @x2 account maintained by <T-NAME>.",CMLib.beanCounter().nameCurrencyShort(target,hisAmount),victim); final CMMsg msg=CMClass.getMsg(mob,target,this,(auto?CMMsg.MASK_ALWAYS:0)|CMMsg.MSG_THIEF_ACT,str,null,str); if(mob.location().okMessage(mob,msg)) { mob.location().send(mob,msg); beneficialAffect(mob,target,asLevel,(int)(((CMProps.getMillisPerMudHour()*mob.location().getArea().getTimeObj().getHoursInDay()*mob.location().getArea().getTimeObj().getDaysInMonth())/CMProps.getTickMillis()))); bank.delDepositInventory(victim,hisCoins); hisCoins=CMLib.beanCounter().makeBestCurrency(target,hisCoins.getTotalValue()-(hisAmount/3.0)); if(hisCoins.getNumberOfCoins()>0) bank.addDepositInventory(victim,hisCoins); bank.delDepositInventory(myAcct,myCoins); myCoins=CMLib.beanCounter().makeBestCurrency(mob,((Coins)myCoins).getTotalValue()+hisAmount); if(((Coins)myCoins).getNumberOfCoins()>0) bank.addDepositInventory(myAcct,myCoins); } } else maliciousFizzle(mob,target,L("<T-NAME> catch(es) <S-NAME> trying to embezzle money!")); return success; } }
[ "bo@zimmers.net" ]
bo@zimmers.net
1d50a9edff93ee70c9363f6897a662eee11dde50
0753867c790281239b8f213ac547d5b6a8451a33
/ex_lib/simple_rt/src/com/egls/test/R.java
7dee24a85eb0579e49e5e67b351b860c63211fe8
[ "LicenseRef-scancode-public-domain" ]
permissive
zhujiabin/miniJVM
386325e8554a6cbaa2442096a16b91767d75d4a7
4ae1cd1a40c5e23cb8f4bec0ebe1a3b94c611d8c
refs/heads/master
2020-04-28T05:57:09.444049
2019-03-07T08:17:27
2019-03-07T08:17:27
175,038,279
1
0
null
2019-03-11T16:14:52
2019-03-11T16:14:51
null
UTF-8
Java
false
false
321
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.egls.test; /** * * @author gust */ public class R { public R(Foo2 f) { f.b = 5; } }
[ "digitalgust@163.com" ]
digitalgust@163.com
897afaac2faae529f2f90d84cfe3f1b31d3631ed
fa34634b84455bf809dbfeeee19f8fb7e26b6f76
/2.JavaCore/src/com/javarush/task/task16/task1631/Solution.java
dafd3fdd0976e9ccd18cfada2e6aa99ecbf876e2
[ "Apache-2.0" ]
permissive
Ponser2000/JavaRushTasks
3b4bdd2fa82ead3c72638f0f2826db9f871038cc
e6eb2e8ee2eb7df77273f2f0f860f524400f72a2
refs/heads/main
2023-04-04T13:23:52.626862
2021-03-25T10:43:04
2021-03-25T10:43:04
322,064,721
0
0
null
null
null
null
UTF-8
Java
false
false
470
java
package com.javarush.task.task16.task1631; import com.javarush.task.task16.task1631.common.ImageReader; import com.javarush.task.task16.task1631.common.ImageTypes; /* Factory method pattern */ public class Solution { public static void main(String[] args) { try { ImageReader reader = ImageReaderFactory.getImageReader(ImageTypes.JPG); } catch (IllegalArgumentException e) { e.printStackTrace(); } } }
[ "ponser2000@gmail.com" ]
ponser2000@gmail.com
a2631bf25e06fb5fa01b5dd1db19f9e4d55f52fe
a9be02c45ec0f7f8e7b9c68460124d386451924a
/swiftlets/sys_routing/src/main/java/com/swiftmq/impl/routing/single/smqpr/v400/AuthRequest.java
360bdcea36e022d610f05027dae1c2c74c328330
[ "Apache-2.0" ]
permissive
iitsoftware/swiftmq-ce
7425e0f689769f2d94743a005070d44a81bbb734
001c352c565ba169bf4cd60bffcfb8d9dd0a3a8d
refs/heads/develop
2023-05-11T18:38:17.586213
2023-05-11T15:37:32
2023-05-11T15:37:32
176,973,819
19
1
Apache-2.0
2023-04-14T17:17:06
2019-03-21T15:29:46
Java
UTF-8
Java
false
false
2,750
java
/* * Copyright 2019 IIT Software GmbH * * IIT Software GmbH 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.swiftmq.impl.routing.single.smqpr.v400; import com.swiftmq.impl.routing.single.smqpr.SMQRVisitor; import com.swiftmq.tools.requestreply.Reply; import com.swiftmq.tools.requestreply.Request; import com.swiftmq.tools.requestreply.RequestVisitor; import com.swiftmq.tools.util.DataByteArrayInputStream; import com.swiftmq.tools.util.DataByteArrayOutputStream; import java.io.*; public class AuthRequest extends Request { Serializable response = null; AuthRequest() { this(null); } public AuthRequest(Serializable response) { super(0, false); this.response = response; } public int getDumpId() { return SMQRFactory.AUTH_REQ; } public void writeContent(DataOutput output) throws IOException { super.writeContent(output); DataByteArrayOutputStream dbos = new DataByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(dbos); oos.writeObject(response); oos.flush(); oos.close(); output.writeInt(dbos.getCount()); output.write(dbos.getBuffer(), 0, dbos.getCount()); } public void readContent(DataInput input) throws IOException { super.readContent(input); byte b[] = new byte[input.readInt()]; input.readFully(b); DataByteArrayInputStream dbis = new DataByteArrayInputStream(b); ObjectInputStream ois = new ObjectInputStream(dbis); try { response = (Serializable) ois.readObject(); } catch (ClassNotFoundException e) { throw new IOException(e.toString()); } ois.close(); } public Serializable getResponse() { return response; } public void setResponse(Serializable response) { this.response = response; } protected Reply createReplyInstance() { return null; } public void accept(RequestVisitor visitor) { ((SMQRVisitor) visitor).handleRequest(this); } public String toString() { return "[AuthRequest " + super.toString() + ", response=" + response + "]"; } }
[ "am@iit.de" ]
am@iit.de
f1a6778d8631560da06569a0f8d5fd055ed20d01
3a4b212a67ea7ba435b500db1a4d0d39855a9b3a
/houserent/src/com/softxm/hs/dao/impl/ElectricMoneyDaoImpl.java
11092bb4afba1c4f1640c676fcb23a3a1cfc19e0
[]
no_license
lidonghao1116/house
10a14f5e22d0985853c50bf9c6e6665d02d619b9
a318e47ce5275a32ff8804cd33dbf6495d98077a
refs/heads/master
2021-01-17T22:35:58.152164
2014-05-20T02:30:44
2014-05-20T02:30:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,240
java
package com.softxm.hs.dao.impl; import java.util.ArrayList; import java.util.Date; import java.util.List; import org.springframework.stereotype.Repository; import com.softxm.hs.dao.ElectricMoneyDao; import com.softxm.hs.dao.common.BaseDao; import com.softxm.hs.model.PageModel; import com.softxm.hs.model.Telectricmoney; import com.softxm.hs.model.Twatermoney; @Repository public class ElectricMoneyDaoImpl extends BaseDao implements ElectricMoneyDao { @Override public PageModel electricmoneyList(int currentPage, int pageSize, Telectricmoney telectricmoney) { StringBuilder countHql = new StringBuilder( "select count(tw) from Telectricmoney tw join tw.tuserinfo tu where 1=1"); List paramList = new ArrayList(); String orderHql = new String(" order by tw.emusertime desc"); StringBuilder whereHql = new StringBuilder(); StringBuilder queryHql = new StringBuilder( "select tw from Telectricmoney tw join tw.tuserinfo tu where 1=1"); if (telectricmoney != null) { if (telectricmoney.getUiusername() != null && telectricmoney.getUiusername().length() > 0) { whereHql.append(" and tu.uiusername like ?"); paramList.add("%" + telectricmoney.getUiusername() + "%"); } if (telectricmoney.getStarttime() != null) { whereHql.append(" and tw.emusertime > ?"); paramList.add(telectricmoney.getStarttime()); } if (telectricmoney.getEndtime() != null) { whereHql.append(" and tw.emusertime < ?"); paramList.add(telectricmoney.getEndtime()); } } return queryPageModel(currentPage, pageSize, queryHql, countHql, whereHql, orderHql, paramList); } @Override public Telectricmoney getElectricById(Long emid) { return (Telectricmoney) queryOneObject( " select t from Telectricmoney t where t.emid = ? ", emid); } @Override public void delElec(Long emid) { deleteObejct("delete Telectricmoney t where t.emid = ?", emid); } @Override public void isrevice(Long emid) { updateSome("update Telectricmoney t set t.emtime=sysdate where t.emid = " + emid); } @Override public void UpdtaetElectric(Telectricmoney telectricmoney) { updateSome( "update Telectricmoney t set t.emnum = ?,t.emmoney = ? where t.emid = ?", telectricmoney.getEmnum(), telectricmoney.getEmnum() * telectricmoney.getEmmoneybyone(), telectricmoney .getEmid()); } @Override public PageModel getPersonList(int currentPage, int pageSize, Telectricmoney telectricmoney) { StringBuilder countHql = new StringBuilder( "select count(tw) from Telectricmoney tw join tw.tuserinfo tu where 1=1 and tu.uiid=?"); List paramList = new ArrayList(); String orderHql = new String(" order by tw.emusertime desc"); StringBuilder whereHql = new StringBuilder(); StringBuilder queryHql = new StringBuilder( "select tw from Telectricmoney tw join tw.tuserinfo tu where 1=1 and tu.uiid=?"); paramList.add(telectricmoney.getUiid()); if (telectricmoney != null) { if (telectricmoney.getStarttime() != null) { whereHql.append(" and tw.emusertime > ?"); paramList.add(telectricmoney.getStarttime()); } if (telectricmoney.getEndtime() != null) { whereHql.append(" and tw.emusertime < ?"); paramList.add(telectricmoney.getEndtime()); } } return queryPageModel(currentPage, pageSize, queryHql, countHql, whereHql, orderHql, paramList); } @Override public List<Telectricmoney> getAllWaterByUserId(Long uiid) { // TODO Auto-generated method stub return queryObjects("select t from Telectricmoney t join t.tuserinfo tu where tu.uiid=? order by t.emusertime desc", uiid); } @Override public List<Telectricmoney> getAllWater() { // TODO Auto-generated method stub return queryObjects("select t from Telectricmoney t join t.tuserinfo tu where tu.uiisdel='0' order by tu.uiid"); } @Override public List<Telectricmoney> getData(Long uiid) { List params = new ArrayList(); params.add(uiid); List<Telectricmoney> a =queryForJavaBeanList("select * from (select m.*, rownum num from ( " + "select * from telectricmoney t join tuserinfo tu on t.uiid=tu.uiid where tu.uiid = ? order by emusertime desc" + ") m where rownum <=10) where num >0", Telectricmoney.class, params); return a; } }
[ "494679975@qq.com" ]
494679975@qq.com
1d193bf22e8da2df7bc21a6d196364161c907b97
a81d3d06764c9146deb2ecf82cb10405dac2b6ad
/app/src/main/java/com/myp/cinema/widget/superadapter/MultiItemTypeAdapter.java
5368e820b761523a10cb7372e67496dab967b629
[]
no_license
zhangchengku/CinemaLetter
df73fbcf44e3eb15d12849c08ffe84c0edd3cb37
9c0c8d1881984662318da967a04b9071525250f5
refs/heads/master
2020-03-28T13:42:49.979082
2018-09-12T04:29:22
2018-09-12T04:29:22
120,865,139
0
0
null
null
null
null
UTF-8
Java
false
false
3,090
java
package com.myp.cinema.widget.superadapter; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import com.myp.cinema.widget.superadapter.base.ItemViewDelegate; import com.myp.cinema.widget.superadapter.base.ItemViewDelegateManager; import java.util.List; public class MultiItemTypeAdapter<T> extends BaseAdapter { protected Context mContext; protected List<T> mDatas; private ItemViewDelegateManager mItemViewDelegateManager; public MultiItemTypeAdapter(Context context, List<T> datas) { this.mContext = context; this.mDatas = datas; mItemViewDelegateManager = new ItemViewDelegateManager(); } public void setmDatas(List<T> datas) { this.mDatas = datas; notifyDataSetChanged(); } public MultiItemTypeAdapter addItemViewDelegate(ItemViewDelegate<T> itemViewDelegate) { mItemViewDelegateManager.addDelegate(itemViewDelegate); return this; } private boolean useItemViewDelegateManager() { return mItemViewDelegateManager.getItemViewDelegateCount() > 0; } @Override public int getViewTypeCount() { if (useItemViewDelegateManager()) return mItemViewDelegateManager.getItemViewDelegateCount(); return super.getViewTypeCount(); } @Override public int getItemViewType(int position) { if (useItemViewDelegateManager()) { int viewType = mItemViewDelegateManager.getItemViewType(mDatas.get(position), position); return viewType; } return super.getItemViewType(position); } @Override public View getView(int position, View convertView, ViewGroup parent) { ItemViewDelegate itemViewDelegate = mItemViewDelegateManager.getItemViewDelegate(mDatas.get(position), position); int layoutId = itemViewDelegate.getItemViewLayoutId(); ViewHolder viewHolder = null; if (convertView == null) { View itemView = LayoutInflater.from(mContext).inflate(layoutId, parent, false); viewHolder = new ViewHolder(mContext, itemView, parent, position); viewHolder.mLayoutId = layoutId; onViewHolderCreated(viewHolder, viewHolder.getConvertView()); } else { viewHolder = (ViewHolder) convertView.getTag(); viewHolder.mPosition = position; } convert(viewHolder, getItem(position), position); return viewHolder.getConvertView(); } protected void convert(ViewHolder viewHolder, T item, int position) { mItemViewDelegateManager.convert(viewHolder, item, position); } public void onViewHolderCreated(ViewHolder holder, View itemView) { } @Override public int getCount() { return mDatas.size(); } @Override public T getItem(int position) { return mDatas.get(position); } @Override public long getItemId(int position) { return position; } }
[ "13552008150@163.com" ]
13552008150@163.com
906db21144728eabdbbd6c5e4f3514a2c8ab6606
e22995faf6fe0015d004d60562c128bbacf1d833
/Skymill/src/controller/GameControll.java
3bdcea21b628147f241c0647aef93d7e36f1a926
[]
no_license
ArkadiuszZabicki/Skymill
f8327d35161f04a4ba68e2d71c9e72831e2079b7
df6cbc012340fd297a02971f8e82271cb9d4efda
refs/heads/master
2021-03-24T04:49:31.619053
2020-03-15T17:52:48
2020-03-15T17:52:48
247,517,747
0
0
null
null
null
null
UTF-8
Java
false
false
3,925
java
/** * GameControll class controls objects - it changes their states throughut the simulation */ package controller; import java.util.ArrayList; import java.util.Scanner; import gameEssentials.Agent; import gameEssentials.GameTable; public class GameControll { private Scanner scan; private Agent agent; private GameTable gameTable; public GameControll(Scanner scan, Agent agent, GameTable gameTable) { this.scan = scan; this.gameTable = gameTable; this.agent = agent; } /** * Method takes a string with instructions * and transforms it into array list for a later use * @param stringToTransform * @return array list */ public ArrayList<Integer> stringToArray(String stringToTransform){ ArrayList<Integer> path = new ArrayList<Integer>(); String[] splitted = stringToTransform.split(","); for(String num : splitted) { path.add(Integer.parseInt(num)); } return path; } /** * Method takes a command and through set of conditions * produces an output of a simulation. * Basically it updates the position of an agent on a game board. * Not my best work ;) * @param command */ public void moveAgent(int command) { String direction = agent.getDirection(); switch(command) { case 1: switch(direction) { case "N": agent.setY_position(agent.getY_position() + 1); agent.addCurrentPosition(); break; case "S": agent.setY_position(agent.getY_position() - 1); agent.addCurrentPosition(); break; case "E": agent.setX_position(agent.getX_position() + 1); agent.addCurrentPosition(); break; case "W": agent.setX_position(agent.getX_position() - 1); agent.addCurrentPosition(); break; } break; case 2: switch(direction) { case "N": agent.setY_position(agent.getY_position() - 1); agent.addCurrentPosition(); break; case "S": agent.setY_position(agent.getY_position() + 1); agent.addCurrentPosition(); break; case "E": agent.setX_position(agent.getX_position() - 1); agent.addCurrentPosition(); break; case "W": agent.setX_position(agent.getX_position() + 1); agent.addCurrentPosition(); break; } break; case 3: switch(direction) { case "N": agent.setDirection("E"); break; case "E": agent.setDirection("S"); break; case "S": agent.setDirection("W"); break; case "W": agent.setDirection("N"); break; } break; case 4: switch(direction) { case "N": agent.setDirection("W"); break; case "W": agent.setDirection("N"); break; case "S": agent.setDirection("E"); break; case "E": agent.setDirection("S"); break; } break; } } /** * Method to validate the path. * It takes an array list with instructions and checks * if what is the final position of an agent. * @param path */ public void validatePath(ArrayList<Integer> path) { int table_length = gameTable.showRows(); int table_height = gameTable.getGameTable().size(); for(int command : path) { switch(command) { case 1: this.moveAgent(command); break; case 2: this.moveAgent(command); break; case 3: this.moveAgent(command); break; case 4: this.moveAgent(command); break; } } if(agent.getY_position() > table_length || agent.getY_position() < 0) { agent.setX_position(-1); agent.setY_position(-1); agent.addCurrentPosition(); } if(agent.getX_position() > table_height || agent.getX_position() < 0) { agent.setX_position(-1); agent.setY_position(-1); agent.addCurrentPosition(); } System.out.println(agent.getCurrentPosition()); } }
[ "Lenovo@Lenovo-PC" ]
Lenovo@Lenovo-PC
342e2f0dc892668f7f4eeff616a7ea46025407c7
92f4b232fde9eb1ae078f55c33f5fc8efbc813be
/springcloud-book-master/chapter4-5/src/main/java/com/forezp/entity/User.java
a56465032c9e2b591101525daebf54e98b7bc3d5
[]
no_license
lastFeng/CollectionMixedCode
0da2b91ccbd4099a604126eb2de96ccf853c937c
f09558c37f3f7d628676525ea7b051f1e5802285
refs/heads/master
2022-12-21T01:07:39.433452
2019-11-01T03:26:02
2019-11-01T03:26:02
199,559,199
0
0
null
2022-12-16T04:58:00
2019-07-30T02:26:21
Java
UTF-8
Java
false
false
763
java
package com.forezp.entity; import javax.persistence.*; import java.util.List; @Entity public class User { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @Column(nullable = false, unique = true) private String username; @Column private String password; public User() { } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } }
[ "563805728@qq.com" ]
563805728@qq.com
1e02bfa87ca6ac5f0c976af6ae4e6976034408f9
6752dfd6b8c4ae6c6ea0776b5fc5a90fa4b15eac
/2.JavaCore/src/com/javarush/task/task17/task1703/Solution.java
a778e57e1a8f7bbe933d514d5ee27f85e8e3a996
[]
no_license
mabutamail/JavaRushTasks
499937939e6a661b69bb33302f018d68a8ffcb7c
fff69a9b924de8fdcfeb88ec19222695f7539251
refs/heads/master
2020-05-03T13:17:41.593832
2020-02-11T19:21:41
2020-02-11T19:21:41
173,681,846
0
0
null
null
null
null
UTF-8
Java
false
false
2,517
java
package com.javarush.task.task17.task1703; import java.util.ArrayList; import java.util.List; /* Синхронизированные заметки 1. Класс Note будет использоваться нитями. Поэтому сделай так, чтобы обращения к листу notes блокировали мьютекс notes, не this 2. Все System.out.println не должны быть заблокированы (синхронизированы), т.е. не должны находиться в блоке synchronized Требования: 1. Метод addNote() должен добавлять записки в список notes. 2. Метод removeNote() должен удалять записку из списка notes. 3. В методе addNote() должен находиться synchronized блок. 4. В методе removeNote() должен находиться synchronized блок. 5. Synchronized блок в методе addNote() должен блокировать мьютекс notes. 6. Synchronized блок в методе removeNote() должен блокировать мьютекс notes. 7. В synchronized блоке метода addNote() должен находится вызов метода add у notes. 8. В synchronized блоке метода removeNote() должен находится вызов метода remove у notes. 9. Все команды вывода на экран не должны находиться в блоке synchronized. */ public class Solution { public static void main(String[] args) { } public static class Note { public final List<String> notes = new ArrayList<String>(); public void addNote(int index, String note) { System.out.println("Сейчас будет добавлена заметка [" + note + "] На позицию " + index); synchronized (notes) { notes.add(index, note); } System.out.println("Уже добавлена заметка [" + note + "]"); } public void removeNote(int index) { String note; System.out.println("Сейчас будет удалена заметка с позиции " + index); synchronized (notes) { note = notes.remove(index); } System.out.println("Уже удалена заметка [" + note + "] с позиции " + index); } } }
[ "mabutamail@gmail.com" ]
mabutamail@gmail.com
3daf3e76eaaceb0e7b442c3411e04660bc5e185d
d4a25735ac036c85f5ca245cabf57dfcb70e93e2
/Algorithm/Java/Pascal's Triangle.java
30469162d60bee7b6f515ede5a683c3ae2cba541
[]
no_license
nanwan03/leetcode
68c7dcf9aca047de1085c65255c41ba31f77ed47
a2d39e56590a3a7be48687bb53af8fcb2c0ce462
refs/heads/master
2021-01-14T07:55:31.926974
2020-08-18T20:57:33
2020-08-18T20:57:33
35,404,037
4
5
null
null
null
null
UTF-8
Java
false
false
749
java
public class Solution { public List<List<Integer>> generate(int numRows) { List<List<Integer>> rst = new ArrayList<List<Integer>>(); List<Integer> cur = new ArrayList<Integer>(); if (numRows == 0) { return rst; } cur.add(1); rst.add(cur); List<Integer> prev = cur; for (int i = 1; i < numRows; i++) { cur = new ArrayList<Integer>(); for (int j = 0; j < i + 1; j++) { if (j == 0 || j == i) { cur.add(1); } else { cur.add(prev.get(j - 1) + prev.get(j)); } } rst.add(cur); prev = cur; } return rst; } }
[ "wn1842@gmail.com" ]
wn1842@gmail.com
c87451ebc5559da0bb6bfecfe293ba47ac8829bd
1264ce4f7240a56b39b99bbfcdf7c59131cac5db
/AndExam안드로이드프로그램정복/AndExam/src/exam/andexam/C08_AdjustKey2.java
1135071fb139d3c0ca66999d7558aeca22898d5e
[]
no_license
danielkulcsar/webhon
7ea0caef64fc7ddec691f809790c5aa1d960635a
c6a25cc2fd39dda5907ee1b5cb875a284aa6ce3d
refs/heads/master
2021-06-23T08:06:48.890022
2017-08-27T05:28:19
2017-08-27T05:28:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
250
java
package exam.andexam; import android.app.*; import android.os.*; public class C08_AdjustKey2 extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.c08_adjustkey); } }
[ "webhon747@gmail.com" ]
webhon747@gmail.com
a331f82032ac724337e15635d8ddc6a8b0b421df
ed3a98d7776e8b0addb1ca63ab2702ecd977e218
/CWYTH/src/com/googosoft/modules/app/pojo/Rcbxxq.java
3053ba30fcdc3d02f9a2501789ea8c0888c1089b
[]
no_license
Eant99/effective-octo-eureka
a280dc17b809445a29565fb292122ed96f83d46c
09d7c6bf841a723e86c1f9242f530279de246321
refs/heads/master
2020-04-02T05:40:55.771706
2018-10-22T11:21:00
2018-10-22T11:21:00
154,097,158
0
0
null
null
null
null
UTF-8
Java
false
false
3,691
java
package com.googosoft.modules.app.pojo; import java.util.List; import java.util.Map; public class Rcbxxq { private String msg;//返回提示信息 private Boolean success;//返回true或false(true:成功,false:失败) private String djbh;//单据编号 private String bxr;//报销人 private String szbm;//所在部门 private String fjzzs;//附件总张数 private String bxzje;//报销总金额 private String sfkylbx;//是否科研类报销(传是或者是否) private String bxsy;//报销事由 private String bz ;//备注 private List<Map<String,Object>> bxxxlist;//报销信息数据集合 private List<Map<String,Object>> xmxxlist;//项目信息数据集合 private List<Map<String,Object>> dgzflist;//对公支付数据集合 private List<Map<String,Object>> dszflist;//对私支付数据集合 private List<Map<String,Object>> cjklist;//冲借款数据集合 private List<Map<String,Object>> gwklist;//公务卡数据集合 private List<Map<String,Object>> imglist;//附件信息数据集合 private List<Map<String,Object>> lclist ;//流程信息数据集合 private List<Map<String,Object>> fplist ;//发票list public List<Map<String, Object>> getCjklist() { return cjklist; } public void setCjklist(List<Map<String, Object>> cjklist) { this.cjklist = cjklist; } public String getMsg() { return msg; } public void setMsg(String msg) { this.msg = msg; } public Boolean getSuccess() { return success; } public void setSuccess(Boolean success) { this.success = success; } public String getDjbh() { return djbh; } public void setDjbh(String djbh) { this.djbh = djbh; } public String getBxr() { return bxr; } public void setBxr(String bxr) { this.bxr = bxr; } public String getSzbm() { return szbm; } public void setSzbm(String szbm) { this.szbm = szbm; } public String getFjzzs() { return fjzzs; } public void setFjzzs(String fjzzs) { this.fjzzs = fjzzs; } public String getBxzje() { return bxzje; } public void setBxzje(String bxzje) { this.bxzje = bxzje; } public String getSfkylbx() { return sfkylbx; } public void setSfkylbx(String sfkylbx) { this.sfkylbx = sfkylbx; } public String getBxsy() { return bxsy; } public void setBxsy(String bxsy) { this.bxsy = bxsy; } public String getBz() { return bz; } public void setBz(String bz) { this.bz = bz; } public List<Map<String, Object>> getBxxxlist() { return bxxxlist; } public void setBxxxlist(List<Map<String, Object>> bxxxlist) { this.bxxxlist = bxxxlist; } public List<Map<String, Object>> getXmxxlist() { return xmxxlist; } public void setXmxxlist(List<Map<String, Object>> xmxxlist) { this.xmxxlist = xmxxlist; } public List<Map<String, Object>> getDgzflist() { return dgzflist; } public void setDgzflist(List<Map<String, Object>> dgzflist) { this.dgzflist = dgzflist; } public List<Map<String, Object>> getDszflist() { return dszflist; } public void setDszflist(List<Map<String, Object>> dszflist) { this.dszflist = dszflist; } public List<Map<String, Object>> getGwklist() { return gwklist; } public void setGwklist(List<Map<String, Object>> gwklist) { this.gwklist = gwklist; } public List<Map<String, Object>> getImglist() { return imglist; } public void setImglist(List<Map<String, Object>> imglist) { this.imglist = imglist; } public List<Map<String, Object>> getLclist() { return lclist; } public void setLclist(List<Map<String, Object>> lclist) { this.lclist = lclist; } public List<Map<String, Object>> getFplist() { return fplist; } public void setFplist(List<Map<String, Object>> fplist) { this.fplist = fplist; } }
[ "530625852@qq.com" ]
530625852@qq.com
283806096d171168337e4a8e66fef277a7d2bb04
7596b13ad3a84feb67f05aeda486e8b9fc93f65f
/getAndroidAPI/src/android/app/IntentService.java
31ee0e5f781399e5ad4dc8f6e7fe1c0507d09ca6
[]
no_license
WinterPan2017/Android-Malware-Detection
7aeacfa03ca1431e7f3ba3ec8902cfe2498fd3de
ff38c91dc6985112e958291867d87bfb41c32a0f
refs/heads/main
2023-02-08T00:02:28.775711
2020-12-20T06:58:01
2020-12-20T06:58:01
303,900,592
1
0
null
null
null
null
UTF-8
Java
false
false
1,173
java
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.kpdus.com/jad.html // Decompiler options: packimports(3) // Source File Name: IntentService.java package android.app; import android.content.Intent; import android.os.IBinder; // Referenced classes of package android.app: // Service public abstract class IntentService extends Service { public IntentService(String name) { throw new RuntimeException("Stub!"); } public void setIntentRedelivery(boolean enabled) { throw new RuntimeException("Stub!"); } public void onCreate() { throw new RuntimeException("Stub!"); } public void onStart(Intent intent, int startId) { throw new RuntimeException("Stub!"); } public int onStartCommand(Intent intent, int flags, int startId) { throw new RuntimeException("Stub!"); } public void onDestroy() { throw new RuntimeException("Stub!"); } public IBinder onBind(Intent intent) { throw new RuntimeException("Stub!"); } protected abstract void onHandleIntent(Intent intent); }
[ "panwentao1301@163.com" ]
panwentao1301@163.com
879bf03ef525556220bd8c605aa0bb7046e7685e
ec36892fa87ae0818a9770da5e0468ebc093db16
/service-module/module-inquiry/src/main/java/org/module/inquiry/global/BaseGlobal.java
36cfb87e2b60465124e9431e8b99b1a5dc6491a5
[]
no_license
wanghuaqiang0121/micro-service
365033db8ba17c8214c659830d52dd206b3ef4f6
ab64cce33efe7cbf32aa7607e91dd6d12c049dcf
refs/heads/master
2022-06-22T03:21:55.767111
2019-06-05T10:39:18
2019-06-05T10:39:18
190,375,375
0
1
null
2022-06-17T02:11:23
2019-06-05T10:32:24
Java
UTF-8
Java
false
false
826
java
package org.module.inquiry.global; public final class BaseGlobal { public static final String CACHE_USER = "user:login_cache"; public static final String CACHE_USER_ITV = "userItv:login_cache"; public static final String CACHE_ORGANIZATION_USER = "organization_user:login_cache"; public static final String CACHE_ORGANIZATION_USER_ITV = "organization_user_Itv:login_cache"; public static final String TOKEN_FLAG = "token"; /** * 验证码缓存名 */ public static final String CACHE_CODE = "cache_code"; /** *@Fields <font color="blue">user_group_relation</font> *@description 用户本人关系 1 */ public static final String USER_GROUP_RELATION="1"; /** *@Fields <font color="blue">USER_ID_CARD_TYPE</font> *@description 身份证 */ public static final String USER_ID_CARD_TYPE= "1"; }
[ "1060356949@qq.com" ]
1060356949@qq.com
10d3fe68b67d3de08be669f43e7503f8a8289b2f
aee5df69cd38887110c09d3d2bd723cb6e8987d6
/2.JavaCore/src/com/javarush/task/task15/task1522/Solution.java
ef9b65e7ab89213c99f0f71db27b5fbc6f18981e
[]
no_license
siarheikorbut/JavaRush
5e98158ad71594b2ad1b41342b51df39517341fc
095690627248ed8cb4d2b1a3314c06333aef2235
refs/heads/master
2023-08-24T05:34:03.674176
2021-10-16T17:57:19
2021-10-16T17:57:19
306,656,990
0
0
null
null
null
null
UTF-8
Java
false
false
980
java
package com.javarush.task.task15.task1522; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import static com.javarush.task.task15.task1522.Planet.*; /* Закрепляем паттерн Singleton */ public class Solution { public static void main(String[] args) { } public static Planet thePlanet; static { readKeyFromConsoleAndInitPlanet(); } public static void readKeyFromConsoleAndInitPlanet() { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); try { String s = reader.readLine(); switch (s) { case SUN -> thePlanet = Sun.getInstance(); case MOON -> thePlanet = Moon.getInstance(); case EARTH -> thePlanet = Earth.getInstance(); default -> thePlanet = null; } } catch (IOException e) { e.printStackTrace(); } } }
[ "siarheikorbut@gmail.com" ]
siarheikorbut@gmail.com
3faca4836f464b464a665d332ddcdd789d0f3ef9
fc41c09f6f82f6ec15a05fda768fe62c4dcd701b
/pet-clinic-data/src/main/java/guru/springframework/sfgpetclinic/service/springdatajpa/PetSDJpaService.java
51b70c9ec2dda796db2d78f0765535bec164da63
[]
no_license
Jacobanna/sfg-pet-clinic
9bf9c127321324c88614bddc2220b17d214042d1
940dd5d93436f7e3cb80861032bd24f9ed7c76a7
refs/heads/master
2020-05-18T13:58:01.821408
2019-05-20T14:57:16
2019-05-20T14:57:16
184,456,790
0
0
null
null
null
null
UTF-8
Java
false
false
1,215
java
package guru.springframework.sfgpetclinic.service.springdatajpa; import guru.springframework.sfgpetclinic.model.Pet; import guru.springframework.sfgpetclinic.repository.PetRepository; import guru.springframework.sfgpetclinic.service.PetService; import org.springframework.context.annotation.Profile; import org.springframework.stereotype.Service; import java.util.HashSet; import java.util.Set; @Service @Profile("springdatajpa") public class PetSDJpaService implements PetService { private final PetRepository petRepository; public PetSDJpaService(PetRepository petRepository) { this.petRepository = petRepository; } @Override public Set<Pet> findAll() { Set<Pet> pets = new HashSet<>(); petRepository.findAll().forEach(pets::add); return pets; } @Override public Pet findById(Long id) { return petRepository.findById(id).orElse(null); } @Override public Pet save(Pet object) { return petRepository.save(object); } @Override public void delete(Pet object) { petRepository.delete(object); } @Override public void deleteById(Long id) { petRepository.deleteById(id); } }
[ "pieprzyk.jakub@gmail.com" ]
pieprzyk.jakub@gmail.com
bc92bc505a214aba22996e976cdf705e4ac18f59
3cd69da4d40f2d97130b5bf15045ba09c219f1fa
/sources/com/google/android/datatransport/cct/p011a/zzd.java
423662fa8cd62a84a8de81488a652f01fe92a524
[]
no_license
TheWizard91/Album_base_source_from_JADX
946ea3a407b4815ac855ce4313b97bd42e8cab41
e1d228fc2ee550ac19eeac700254af8b0f96080a
refs/heads/master
2023-01-09T08:37:22.062350
2020-11-11T09:52:40
2020-11-11T09:52:40
311,927,971
0
0
null
null
null
null
UTF-8
Java
false
false
5,765
java
package com.google.android.datatransport.cct.p011a; import com.google.android.datatransport.cct.p011a.zza; /* renamed from: com.google.android.datatransport.cct.a.zzd */ final class zzd extends zza { private final Integer zza; private final String zzb; private final String zzc; private final String zzd; private final String zze; private final String zzf; private final String zzg; private final String zzh; /* renamed from: com.google.android.datatransport.cct.a.zzd$zza */ static final class zza extends zza.C4071zza { private Integer zza; private String zzb; private String zzc; private String zzd; private String zze; private String zzf; private String zzg; private String zzh; zza() { } public zza.C4071zza zza(Integer num) { this.zza = num; return this; } public zza.C4071zza zzb(String str) { this.zzh = str; return this; } public zza.C4071zza zzc(String str) { this.zzc = str; return this; } public zza.C4071zza zzd(String str) { this.zzg = str; return this; } public zza.C4071zza zze(String str) { this.zzb = str; return this; } public zza.C4071zza zzf(String str) { this.zzf = str; return this; } public zza.C4071zza zzg(String str) { this.zze = str; return this; } public zza.C4071zza zza(String str) { this.zzd = str; return this; } public zza zza() { return new zzd(this.zza, this.zzb, this.zzc, this.zzd, this.zze, this.zzf, this.zzg, this.zzh, (zzc) null); } } /* synthetic */ zzd(Integer num, String str, String str2, String str3, String str4, String str5, String str6, String str7, zzc zzc2) { this.zza = num; this.zzb = str; this.zzc = str2; this.zzd = str3; this.zze = str4; this.zzf = str5; this.zzg = str6; this.zzh = str7; } public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof zza)) { return false; } Integer num = this.zza; if (num != null ? num.equals(((zzd) obj).zza) : ((zzd) obj).zza == null) { String str = this.zzb; if (str != null ? str.equals(((zzd) obj).zzb) : ((zzd) obj).zzb == null) { String str2 = this.zzc; if (str2 != null ? str2.equals(((zzd) obj).zzc) : ((zzd) obj).zzc == null) { String str3 = this.zzd; if (str3 != null ? str3.equals(((zzd) obj).zzd) : ((zzd) obj).zzd == null) { String str4 = this.zze; if (str4 != null ? str4.equals(((zzd) obj).zze) : ((zzd) obj).zze == null) { String str5 = this.zzf; if (str5 != null ? str5.equals(((zzd) obj).zzf) : ((zzd) obj).zzf == null) { String str6 = this.zzg; if (str6 != null ? str6.equals(((zzd) obj).zzg) : ((zzd) obj).zzg == null) { String str7 = this.zzh; if (str7 == null) { if (((zzd) obj).zzh == null) { return true; } } else if (str7.equals(((zzd) obj).zzh)) { return true; } } } } } } } } return false; } public int hashCode() { Integer num = this.zza; int i = 0; int hashCode = ((num == null ? 0 : num.hashCode()) ^ 1000003) * 1000003; String str = this.zzb; int hashCode2 = (hashCode ^ (str == null ? 0 : str.hashCode())) * 1000003; String str2 = this.zzc; int hashCode3 = (hashCode2 ^ (str2 == null ? 0 : str2.hashCode())) * 1000003; String str3 = this.zzd; int hashCode4 = (hashCode3 ^ (str3 == null ? 0 : str3.hashCode())) * 1000003; String str4 = this.zze; int hashCode5 = (hashCode4 ^ (str4 == null ? 0 : str4.hashCode())) * 1000003; String str5 = this.zzf; int hashCode6 = (hashCode5 ^ (str5 == null ? 0 : str5.hashCode())) * 1000003; String str6 = this.zzg; int hashCode7 = (hashCode6 ^ (str6 == null ? 0 : str6.hashCode())) * 1000003; String str7 = this.zzh; if (str7 != null) { i = str7.hashCode(); } return hashCode7 ^ i; } public String toString() { return "AndroidClientInfo{sdkVersion=" + this.zza + ", model=" + this.zzb + ", hardware=" + this.zzc + ", device=" + this.zzd + ", product=" + this.zze + ", osBuild=" + this.zzf + ", manufacturer=" + this.zzg + ", fingerprint=" + this.zzh + "}"; } public String zzb() { return this.zzd; } public String zzc() { return this.zzh; } public String zzd() { return this.zzc; } public String zze() { return this.zzg; } public String zzf() { return this.zzb; } public String zzg() { return this.zzf; } public String zzh() { return this.zze; } public Integer zzi() { return this.zza; } }
[ "agiapong@gmail.com" ]
agiapong@gmail.com
ef469f31223db4970c0941b070bfc67fe2e57426
c474b03758be154e43758220e47b3403eb7fc1fc
/apk/decompiled/com.tinder_2018-07-26_source_from_JADX/sources/org/joda/time/DateTimeZone$Stub.java
e8d25108a2549555428f26c9b6c139b76015533e
[]
no_license
EstebanDalelR/tinderAnalysis
f80fe1f43b3b9dba283b5db1781189a0dd592c24
941e2c634c40e5dbf5585c6876ef33f2a578b65c
refs/heads/master
2020-04-04T09:03:32.659099
2018-11-23T20:41:28
2018-11-23T20:41:28
155,805,042
0
0
null
2018-11-18T16:02:45
2018-11-02T02:44:34
null
UTF-8
Java
false
false
862
java
package org.joda.time; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.ObjectStreamException; import java.io.Serializable; final class DateTimeZone$Stub implements Serializable { private static final long serialVersionUID = -6471952376487863581L; /* renamed from: a */ private transient String f60067a; DateTimeZone$Stub(String str) { this.f60067a = str; } private void writeObject(ObjectOutputStream objectOutputStream) throws IOException { objectOutputStream.writeUTF(this.f60067a); } private void readObject(ObjectInputStream objectInputStream) throws IOException { this.f60067a = objectInputStream.readUTF(); } private Object readResolve() throws ObjectStreamException { return DateTimeZone.a(this.f60067a); } }
[ "jdguzmans@hotmail.com" ]
jdguzmans@hotmail.com
b8bb0d8068761215345648fe1c861da3311278bf
c4a14d70951d7ec5aac7fe7ebb2db891cfe6c0b1
/modulos/apps/LOCALGIS-Workbench/src/main/java/com/vividsolutions/jump/workbench/ui/plugin/AddNewFeaturesPlugIn.java
3f377bba2ad4bd95b6285d31c8d7dcd4c7819a63
[]
no_license
pepeysusmapas/allocalgis
925756321b695066775acd012f9487cb0725fcde
c14346d877753ca17339f583d469dbac444ffa98
refs/heads/master
2020-09-14T20:15:26.459883
2016-09-27T10:08:32
2016-09-27T10:08:32
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,858
java
/* * The Unified Mapping Platform (JUMP) is an extensible, interactive GUI * for visualizing and manipulating spatial features with geometry and attributes. * * Copyright (C) 2003 Vivid Solutions * * 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 2 * 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, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * For more information, contact: * * Vivid Solutions * Suite #1A * 2328 Government Street * Victoria BC V8T 5G5 * Canada * * (250)385-6040 * www.vividsolutions.com */ package com.vividsolutions.jump.workbench.ui.plugin; import java.util.ArrayList; import java.util.Iterator; import com.vividsolutions.jump.feature.Feature; import com.vividsolutions.jump.feature.FeatureCollection; import com.vividsolutions.jump.feature.FeatureUtil; import com.vividsolutions.jump.workbench.WorkbenchContext; import com.vividsolutions.jump.workbench.model.Layer; import com.vividsolutions.jump.workbench.model.UndoableCommand; import com.vividsolutions.jump.workbench.plugin.EnableCheckFactory; import com.vividsolutions.jump.workbench.plugin.MultiEnableCheck; import com.vividsolutions.jump.workbench.plugin.PlugInContext; import com.vividsolutions.jump.workbench.ui.EnterWKTDialog; public class AddNewFeaturesPlugIn extends WKTPlugIn { public AddNewFeaturesPlugIn() {} protected Layer layer(PlugInContext context) { return context.getLayerNamePanel().chooseEditableLayer(); } public boolean execute(PlugInContext context) throws Exception { reportNothingToUndoYet(context); return super.execute(context); } protected void apply(FeatureCollection c, final PlugInContext context) { //Can't use WeakHashMap, otherwise the features will vanish when the command //is undone! [Jon Aquino] final ArrayList features = new ArrayList(); for (Iterator i = c.iterator(); i.hasNext();) { Feature feature = (Feature) i.next(); features.add(FeatureUtil.toFeature(feature.getGeometry(), c.getFeatureSchema())); } execute(new UndoableCommand(getName()) { public void execute() { layer.getFeatureCollectionWrapper().addAll(features); } public void unexecute() { layer.getFeatureCollectionWrapper().removeAll(features); } }, context); } protected EnterWKTDialog createDialog(PlugInContext context) { EnterWKTDialog d = super.createDialog(context); d.setTitle("Add Features To " + layer); d.setDescription("<HTML>Enter Well-Known Text for one or more geometries.</HTML>"); return d; //<<TODO:DEFECT>> Look at the points drawn. The line and the fill do not line //up perfectly. [Jon Aquino] } public static MultiEnableCheck createEnableCheck(WorkbenchContext workbenchContext) { EnableCheckFactory checkFactory = new EnableCheckFactory(workbenchContext); return new MultiEnableCheck() .add(checkFactory.createWindowWithLayerNamePanelMustBeActiveCheck()) .add(checkFactory.createAtLeastNLayersMustBeEditableCheck(1)); } }
[ "jorge.martin@cenatic.es" ]
jorge.martin@cenatic.es
218f4cdae6c5bb4a82fd4e2f593f761ecfa51f05
4c274d1837b1a08903541fa8066d6377c464f169
/803_Client/src/Class620.java
ccb66aa5755b4977d9b636df30226c9b8b3263a8
[]
no_license
kewle003/803Server
bbb52b5e8d130cc61221caa70a6ea69f62a25852
8c2a60f7cfab2f072a4ffc27f767977c407c12e0
refs/heads/master
2021-01-19T16:26:35.368662
2015-10-13T00:33:59
2015-10-13T00:33:59
27,211,620
0
0
null
null
null
null
UTF-8
Java
false
false
6,228
java
/* Class620 - Decompiled by JODE * Visit http://jode.sourceforge.net/ */ import java.util.Random; public class Class620 { static Class295 aClass295_7853 = new Class295(16, Class294.aClass294_4496); static int anInt7854; public static int[] anIntArray7855; static final int anInt7856 = 12; public static int[] anIntArray7857; public static int anInt7858; public static byte[] method13331(int i) { byte[] is = (byte[]) aClass295_7853.method5704(Integer.valueOf(i), -1586416365); if (is == null) { is = new byte[512]; Random random = new Random((long) i); for (int i_0_ = 0; i_0_ < 255; i_0_++) is[i_0_] = (byte) i_0_; for (int i_1_ = 0; i_1_ < 255; i_1_++) { int i_2_ = 255 - i_1_; int i_3_ = Class194.method3997(random, i_2_, (byte) -95); byte i_4_ = is[i_3_]; is[i_3_] = is[i_2_]; is[i_2_] = is[511 - i_1_] = i_4_; } aClass295_7853.method5705(Integer.valueOf(i), is, -797767292); } return is; } public static void method13332(int i, int i_5_, int i_6_) { if (anInt7858 * 1303509079 != i) { anIntArray7855 = new int[i]; for (int i_7_ = 0; i_7_ < i; i_7_++) anIntArray7855[i_7_] = (i_7_ << 12) / i; anInt7858 = i * -1105562777; } if (i_5_ != -1767907973 * anInt7854) { if (i_5_ != anInt7858 * 1303509079) { anIntArray7857 = new int[i_5_]; for (int i_8_ = 0; i_8_ < i_5_; i_8_++) anIntArray7857[i_8_] = (i_8_ << 12) / i_5_; } else anIntArray7857 = anIntArray7855; anInt7854 = 449542579 * i_5_; } } public static byte[] method13333(int i, byte i_9_) { byte[] is = ((byte[]) aClass295_7853.method5704(Integer.valueOf(i), 112268543)); if (is == null) { is = new byte[512]; Random random = new Random((long) i); for (int i_10_ = 0; i_10_ < 255; i_10_++) is[i_10_] = (byte) i_10_; for (int i_11_ = 0; i_11_ < 255; i_11_++) { int i_12_ = 255 - i_11_; int i_13_ = Class194.method3997(random, i_12_, (byte) -19); byte i_14_ = is[i_13_]; is[i_13_] = is[i_12_]; is[i_12_] = is[511 - i_11_] = i_14_; } aClass295_7853.method5705(Integer.valueOf(i), is, -1604302097); } return is; } public static byte[] method13334(int i) { byte[] is = (byte[]) aClass295_7853.method5704(Integer.valueOf(i), -1506124282); if (is == null) { is = new byte[512]; Random random = new Random((long) i); for (int i_15_ = 0; i_15_ < 255; i_15_++) is[i_15_] = (byte) i_15_; for (int i_16_ = 0; i_16_ < 255; i_16_++) { int i_17_ = 255 - i_16_; int i_18_ = Class194.method3997(random, i_17_, (byte) -51); byte i_19_ = is[i_18_]; is[i_18_] = is[i_17_]; is[i_17_] = is[511 - i_16_] = i_19_; } aClass295_7853.method5705(Integer.valueOf(i), is, 1603009171); } return is; } public static void method13335(int i, int i_20_) { if (anInt7858 * 1303509079 != i) { anIntArray7855 = new int[i]; for (int i_21_ = 0; i_21_ < i; i_21_++) anIntArray7855[i_21_] = (i_21_ << 12) / i; anInt7858 = i * -1105562777; } if (i_20_ != -1767907973 * anInt7854) { if (i_20_ != anInt7858 * 1303509079) { anIntArray7857 = new int[i_20_]; for (int i_22_ = 0; i_22_ < i_20_; i_22_++) anIntArray7857[i_22_] = (i_22_ << 12) / i_20_; } else anIntArray7857 = anIntArray7855; anInt7854 = 449542579 * i_20_; } } Class620() throws Throwable { throw new Error(); } public static byte[] method13336(int i) { byte[] is = (byte[]) aClass295_7853.method5704(Integer.valueOf(i), -817548503); if (is == null) { is = new byte[512]; Random random = new Random((long) i); for (int i_23_ = 0; i_23_ < 255; i_23_++) is[i_23_] = (byte) i_23_; for (int i_24_ = 0; i_24_ < 255; i_24_++) { int i_25_ = 255 - i_24_; int i_26_ = Class194.method3997(random, i_25_, (byte) -1); byte i_27_ = is[i_26_]; is[i_26_] = is[i_25_]; is[i_25_] = is[511 - i_24_] = i_27_; } aClass295_7853.method5705(Integer.valueOf(i), is, -937246347); } return is; } static final void method13337(ClientScriptData class454, byte i) { int i_28_ = (((ClientScriptData) class454).integerStack [(((ClientScriptData) class454).intStackPointer -= 1736754263) * 1482319719]); InterfaceComponent class58 = Js5ConfigGroup.getInterfaceComponent(i_28_, (byte) -42); InterfaceDefinition class35 = Class187.aClass35Array2203[i_28_ >> 16]; Class80.method1806(class58, class35, class454, -1172745154); } static final void method13338(ClientScriptData class454, int i) { String string = (String) (((ClientScriptData) class454).objectStack [(((ClientScriptData) class454).objectStackPointer -= -1650705371) * -290357331]); int i_29_ = (((ClientScriptData) class454).integerStack [(((ClientScriptData) class454).intStackPointer -= 1736754263) * 1482319719]); ((ClientScriptData) class454).objectStack [(((ClientScriptData) class454).objectStackPointer += -1650705371) * -290357331 - 1] = new StringBuilder().append(string).append (HashTable.method7322(i_29_, true, 1663117747)).toString(); } static final void method13339(byte i, int i_30_) { byte[][][] is = client.aClass238_8477.method4785(-1218485036); if (null == is) { is = (new byte[4][client.aClass238_8477.method4744(-2067026709)] [client.aClass238_8477.method4745(-544286340)]); client.aClass238_8477.method4812(is, (byte) -2); } for (int i_31_ = 0; i_31_ < 4; i_31_++) { for (int i_32_ = 0; i_32_ < client.aClass238_8477.method4744(-1408468287); i_32_++) { for (int i_33_ = 0; i_33_ < client.aClass238_8477.method4745(-563353543); i_33_++) is[i_31_][i_32_][i_33_] = i; } } } public static void method13340(int i, int i_34_) { if (Class393.method7054(-1676741262)) { if (i != Class13.anInt81 * 1391949991) Class13.aLong82 = 7226492194362182485L; Class13.anInt81 = i * 1017556759; client.aClass190_8339.closeConnection(1826534912); Class496.setClientStage(11, (byte) -18); } } public static int method13341(int i) { return 275753719 * Class487.anInt6480; } }
[ "markkewley@hotmail.com" ]
markkewley@hotmail.com
2002f849d24f2c4ca53728b59fd6ddcf0d71de69
dff6b9709d56e827d485e07f0159274fea99c633
/src/main/java/com/jtchen/algorithm/UnionFind.java
ee5dab41405d5fd7efac91070fb84b3e44fdd02a
[]
no_license
Nagisa12321/Myalgs
b36cf97ca19eda50b3adc3004c8cabb6a9f0031d
eb513e8496c3bbbcfceb590ba515af8cfaf803ee
refs/heads/master
2023-07-29T09:52:15.887188
2021-09-06T00:17:23
2021-09-06T00:17:23
314,171,393
0
0
null
null
null
null
UTF-8
Java
false
false
4,116
java
package com.jtchen.algorithm; import edu.princeton.cs.algs4.Stopwatch; import java.net.Socket; import java.util.Scanner; /************************************************ * * @author jtchen * @date 2020/12/18 18:29 * @version 1.0 ************************************************/ @SuppressWarnings("CommentedOutCode") public class UnionFind { private final int[] id; //分量id private final int[] sz; //分量大小 private int count; //分量数量 /** * 以整数标识初始化0 - N-1 个触点 * * @param N 触点总个数 */ public UnionFind(int N) { count = N; id = new int[N]; sz = new int[N]; for (int i = 0; i < N; i++) { id[i] = i; sz[i] = 1; } } public static void main(String[] args) { new Socket(); Scanner c = new Scanner(System.in); int N = c.nextInt(); UnionFind unionFind = new UnionFind(N); while (c.hasNext()) { int p = c.nextInt(); int q = c.nextInt(); if (unionFind.connected(p, q)) continue; unionFind.union(p, q); System.out.println(/*Arrays.toString(unionFind.id) + " " + */unionFind.count() + " components"); } /* double prev = timeTrial(250, c, N); for (int n = 250; true; n += n) { double time = timeTrial(n, c, N); StdOut.printf("%7d %7.1f %5.1f\n", n, time, time / prev); prev = time; } */ } @SuppressWarnings("unused") public static double timeTrial(int n, Scanner c, int N) { Stopwatch timer = new Stopwatch(); for (int i = 0; i < n; i++) { UnionFind unionFind = new UnionFind(N); while (c.hasNext()) { int p = c.nextInt(); int q = c.nextInt(); if (unionFind.connected(p, q)) continue; unionFind.union(p, q); } } return timer.elapsedTime(); } /** * 在p和q之间添加一条链接 * * @param p 触点p * @param q 触点q */ /* quick-find public void union(int p, int q) { //如果p, q在同一个集合中, 则什么都不做 int pID = find(p); int qID = find(q); if (pID == qID) return; for (int i = 0; i < id.length; i++) { if (id[i] == pID) id[i] = qID; } //分量数量减一 count--; } */ /* quick-union public void union(int p, int q) { int pID = find(p); int qID = find(q); //如果p, q在同一个集合中, 则什么都不做 if (pID == qID) return; //把pid归并到qid id[pID] = qID; //分量数量减一 count--; } */ /* 加权 quick-union */ public void union(int p, int q) { //如果p, q在同一个集合中, 则什么都不做 int pID = find(p); int qID = find(q); if (pID == qID) return; //若p分量小于q分量, 将p分量归并到q分量 if (sz[pID] < sz[qID]) { id[pID] = qID; sz[qID] += sz[pID]; } else { id[qID] = pID; sz[pID] += sz[qID]; } //分量数量减一 count--; } /** * 找到p(0 - N-1) 所在分量的标识符 * * @param p 触点p * @return 触点p的标识符 */ /* quick-find public int find(int p) { return id[p]; } */ public int find(int p) { while (p != id[p]) p = id[p]; return p; } /** * 如果p和q之间存在一个连接分量, 则返回{@code true} * 否则返回{@code false} * * @param p 触点p * @param q 触点q * @return 是否连通? */ public boolean connected(int p, int q) { return find(p) == find(q); } /** * 连通分量的数量 * * @return 连通分量的数量 */ public int count() { return count; } }
[ "1216414009@qq.com" ]
1216414009@qq.com
9c364d66b63b249893012db6694f31faa61890af
8ccd1c071b19388f1f2e92c5e5dbedc78fead327
/src/main/java/ohos/com/sun/org/apache/xml/internal/dtm/DTMIterator.java
27a5bc6c3f89af868007142551588aedb8e3891b
[]
no_license
yearsyan/Harmony-OS-Java-class-library
d6c135b6a672c4c9eebf9d3857016995edeb38c9
902adac4d7dca6fd82bb133c75c64f331b58b390
refs/heads/main
2023-06-11T21:41:32.097483
2021-06-24T05:35:32
2021-06-24T05:35:32
379,816,304
6
3
null
null
null
null
UTF-8
Java
false
false
1,049
java
package ohos.com.sun.org.apache.xml.internal.dtm; public interface DTMIterator { public static final short FILTER_ACCEPT = 1; public static final short FILTER_REJECT = 2; public static final short FILTER_SKIP = 3; void allowDetachToRelease(boolean z); Object clone() throws CloneNotSupportedException; DTMIterator cloneWithReset() throws CloneNotSupportedException; void detach(); int getAxis(); int getCurrentNode(); int getCurrentPos(); DTM getDTM(int i); DTMManager getDTMManager(); boolean getExpandEntityReferences(); int getLength(); int getRoot(); int getWhatToShow(); boolean isDocOrdered(); boolean isFresh(); boolean isMutable(); int item(int i); int nextNode(); int previousNode(); void reset(); void runTo(int i); void setCurrentPos(int i); void setItem(int i, int i2); void setRoot(int i, Object obj); void setShouldCacheNodes(boolean z); }
[ "yearsyan@gmail.com" ]
yearsyan@gmail.com
8ce1820ee075eaaf136f0d15281bdbf0cac0b078
c699fe58ca7b58a34f47cc3259fb8d567c676866
/softwarereuse/reuze/test/FullJointDistributionPairFairDiceModel.java
62e346f6a7233a23e1b425ea49930fab43122771
[]
no_license
ammarblue/brad-baze-code-bank
9b0b300ab09f5ed315ce6ac0a8352fcd8a6e03e8
0cc496fbdef4f7b466d4905c23ae0bedaf9624c9
refs/heads/master
2021-01-01T05:47:15.497877
2013-05-31T15:05:31
2013-05-31T15:05:31
39,472,729
0
0
null
null
null
null
UTF-8
Java
false
false
1,032
java
package reuze.test; import com.software.reuze.mp_ModelFiniteFullJoint; //package aima.core.probability.example; //import aima.core.probability.full.FullJointDistributionModel; /** * * @author Ciaran O'Reilly * */ public class FullJointDistributionPairFairDiceModel extends mp_ModelFiniteFullJoint { public FullJointDistributionPairFairDiceModel() { super(new double[] { // Dice1 * Dice 2 = 36 possible worlds 1.0 / 36.0, 1.0 / 36.0, 1.0 / 36.0, 1.0 / 36.0, 1.0 / 36.0, 1.0 / 36.0, // 1.0 / 36.0, 1.0 / 36.0, 1.0 / 36.0, 1.0 / 36.0, 1.0 / 36.0, 1.0 / 36.0, // 1.0 / 36.0, 1.0 / 36.0, 1.0 / 36.0, 1.0 / 36.0, 1.0 / 36.0, 1.0 / 36.0, // 1.0 / 36.0, 1.0 / 36.0, 1.0 / 36.0, 1.0 / 36.0, 1.0 / 36.0, 1.0 / 36.0, // 1.0 / 36.0, 1.0 / 36.0, 1.0 / 36.0, 1.0 / 36.0, 1.0 / 36.0, 1.0 / 36.0, // 1.0 / 36.0, 1.0 / 36.0, 1.0 / 36.0, 1.0 / 36.0, 1.0 / 36.0, 1.0 / 36.0 }, ExampleRV.DICE_1_RV, ExampleRV.DICE_2_RV); } }
[ "in_tech@mac.com" ]
in_tech@mac.com
a73991a0e4a71c8e3232aec82d62af8e77a9e11b
e26fceb0c49ca5865fcf36bd161a168530ae4e69
/OpenAMASE/src/Amase/avtas/amase/analysis/AnalysisGUI.java
571b9ca51aacfd61a2485d029c4770b08659379a
[ "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-us-govt-public-domain", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
sahabi/OpenAMASE
e1ddd2c62848f0046787acbb02b8d31de2f03146
b50f5a71265a1f1644c49cce2161b40b108c65fe
refs/heads/master
2021-06-17T14:15:16.366053
2017-05-07T13:16:35
2017-05-07T13:16:35
90,772,724
3
0
null
null
null
null
UTF-8
Java
false
false
5,280
java
// =============================================================================== // Authors: AFRL/RQQD // Organization: Air Force Research Laboratory, Aerospace Systems Directorate, Power and Control Division // // Copyright (c) 2017 Government of the United State of America, as represented by // the Secretary of the Air Force. No copyright is claimed in the United States under // Title 17, U.S. Code. All Other Rights Reserved. // =============================================================================== package avtas.amase.analysis; import avtas.util.WindowUtils; import avtas.xml.Comment; import avtas.xml.ui.XMLEditPane; import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.datatransfer.Clipboard; import java.awt.datatransfer.StringSelection; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.File; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.JButton; import javax.swing.JFileChooser; import javax.swing.JPanel; import javax.swing.JScrollPane; import avtas.xml.Element; import avtas.xml.XmlNode; import avtas.xml.XmlWriter; import javax.swing.filechooser.FileNameExtensionFilter; /** * Runs a series of analysis tests on a list of LMCP messages or a playback file * * @author AFRL/RQQD */ public class AnalysisGUI extends JPanel { private XMLEditPane textArea = new XMLEditPane(); private JFileChooser chooser; private JPanel thisPanel = this; private AnalysisManager analysisMgr; public AnalysisGUI(AnalysisManager analysisMgr) { this.analysisMgr = analysisMgr; setLayout(new BorderLayout(2, 2)); textArea.setPreferredSize(new Dimension(400, 400)); textArea.setEditable(false); add(new JScrollPane(textArea), BorderLayout.CENTER); chooser = WindowUtils.getFilteredChooser("xml", new FileNameExtensionFilter("XML Files", "XML", "xml")); chooser.setMultiSelectionEnabled(false); JPanel butPanel = new JPanel(); final JButton saveBut = new JButton("Save Output"); butPanel.add(saveBut); saveBut.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { Element el = refreshReport(); if (el != null) { chooser.showSaveDialog(thisPanel); File file = chooser.getSelectedFile(); if (file != null) { el.toFile(file); } } } }); final JButton refreshBut = new JButton("Refresh"); butPanel.add(refreshBut); refreshBut.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { refreshReport(); } }); final JButton copyBut = new JButton("Copy"); butPanel.add(copyBut); saveBut.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { Clipboard clipboard = getToolkit().getSystemClipboard(); clipboard.setContents(new StringSelection(textArea.getText()), null); } }); add(butPanel, BorderLayout.SOUTH); refreshReport(); } public Element refreshReport() { textArea.setText(""); if (analysisMgr != null) { try { Element el = analysisMgr.getAnalysisReportXML(); textArea.setText(XmlWriter.toFormattedString(el)); return el; } catch (Exception ex) { Logger.getLogger(AnalysisGUI.class.getName()).log(Level.SEVERE, null, ex); } } textArea.setCaretPosition(0); return null; } protected String getHTML(Element el) { StringBuilder sb = new StringBuilder(); sb.append("<html>"); appendHtml(sb, el, ""); sb.append("</html>"); return sb.toString(); } protected void appendHtml(StringBuilder sb, XmlNode n, String ws) { if (n instanceof Element) { Element el = (Element) n; sb.append(ws); if (el.hasChildren()) { sb.append("<b>").append(el.getName()).append(" = ").append(el.getText()).append("</b><br/>"); } else { sb.append(el.getName()).append(" = ").append(el.getText()).append("<br/>"); } if (el.hasAttributes()) { sb.append(ws).append("<em>"); for (int i = 0; i < el.getAttributeCount(); i++) { sb.append(el.getAttributeName(i)).append(" = ").append(el.getAttributeValue(i)).append(", "); } sb.append("</em><br/>"); } for (XmlNode child : el.getChildren()) { appendHtml(sb, child, ws + "&nbsp;&nbsp;"); } } else if (n instanceof Comment) { sb.append("<p><em>").append(ws).append(((Comment) n).getComment()).append("</em></p>"); } } } /* Distribution A. Approved for public release. * Case: #88ABW-2015-4601. Date: 24 Sep 2015. */
[ "derek.kingston@us.af.mil" ]
derek.kingston@us.af.mil
4f6ec252979cfacd98956c982f5b47fa5eaf90e5
252cfdf0d0513a6258c0706421cc184086537caa
/complete/stack/monotone/maximal_rectangle_85.java
357daf17a961aacb38248a185fa87db1dcd161fc
[]
no_license
telucis/a_leetcode
37d99d4987fad6bfa90c2fc602cdfa4d8cc6f77a
aa46769587023e98b80a2c06c14c90b0f8e2c9e5
refs/heads/master
2021-08-19T03:16:44.889909
2021-07-14T14:06:49
2021-07-14T14:06:49
190,832,551
0
0
null
null
null
null
UTF-8
Java
false
false
1,464
java
package complete.stack.monotone; import java.util.Stack; /** * @author karl.wy * @date 2019/05/28 * * 最大矩形 * 给定一个仅包含 0 和 1 的二维二进制矩阵,找出只包含 1 的最大矩形,并返回其面积。 示例: 输入: [ ["1","0","1","0","0"], ["1","0","1","1","1"], ["1","1","1","1","1"], ["1","0","0","1","0"] ] 输出: 6 */ public class maximal_rectangle_85 { public int maximalRectangle(char[][] matrix) { int m=matrix.length, n=m==0 ? 0 : matrix[0].length; int[][] height = new int[m][n+1]; int maxArea = 0; for (int i=0; i<m; i++) { for (int j=0; j<n; j++) { if (matrix[i][j]=='0') height[i][j]=0; else height[i][j] = i==0 ? 1 : height[i-1][j]+1; } } for (int i=0; i<m; i++) { int area = maxAreaInHist(height[i]); if (area > maxArea) maxArea = area; } return maxArea; } private int maxAreaInHist(int[] height) { Stack<Integer> stack = new Stack<>(); int i=0, max=0; while (i<height.length) { if (stack.isEmpty() || height[stack.peek()]<=height[i]) { stack.push(i++); } else { int t = stack.pop(); max = Math.max(max, height[t] * (stack.isEmpty() ? i : i-stack.peek()-1)); } } return max; } }
[ "telucis@yangdeMacBook-Air.local" ]
telucis@yangdeMacBook-Air.local
270a8241ca1132d786153d731de142d3f31650ba
d31e9bc9b78f6ec36ec23779276e9365aa2b52e1
/zhy-frame-authentication/zhy-frame-authentication-oauth2/zhy-frame-authentication-oauth2-center/src/main/java/com/zhy/frame/authentication/oauth2/center/Oauth2ServerApplication.java
d0484894e36638c33a1461d9843be9b9a637cc6b
[]
no_license
radtek/zhy-frame-parent
f5f04b1392f1429a079281336d266692645aa2f5
05d5a0bb64fec915e027078313163822d849476c
refs/heads/master
2022-12-27T22:27:12.682705
2020-07-27T02:58:46
2020-07-27T02:58:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
511
java
package com.zhy.frame.authentication.oauth2.center; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; /** * @describe: * @author: lvmoney /xxxx科技有限公司 * @version:v1.0 2018年9月30日 上午8:51:33 */ //@SpringBootApplication(scanBasePackages = {"com.zhy.**"}) public class Oauth2ServerApplication { public static void main(String[] args) { SpringApplication.run(Oauth2ServerApplication.class, args); } }
[ "xmangl1990728" ]
xmangl1990728
fbad46a0b91168b42032cc26f46706d56a9601ce
efa4157ec46d24e571ba1dc899f6b13899bacf05
/src/main/java/com/google/devtools/build/lib/rules/android/ParsedAndroidAssets.java
b1b297104564f78e46263610797b968a7e1cd262
[ "Apache-2.0" ]
permissive
timperrett/bazel
a271e85d198c6841a682181d405306eea91f0d7d
415fdee024bd12fac139e0e88797d4fac17f2f48
refs/heads/master
2020-03-18T10:24:37.609196
2018-06-01T00:51:25
2018-06-01T00:51:25
134,610,104
1
0
null
2018-05-23T18:26:32
2018-05-23T18:26:32
null
UTF-8
Java
false
false
2,478
java
// Copyright 2018 The Bazel Authors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package com.google.devtools.build.lib.rules.android; import com.google.devtools.build.lib.actions.Artifact; import com.google.devtools.build.lib.cmdline.Label; import java.util.Objects; /** Parsed Android assets which can be merged together with assets from dependencies. */ public class ParsedAndroidAssets extends AndroidAssets implements MergableAndroidData { private final Artifact symbols; private final Label label; public static ParsedAndroidAssets parseFrom(AndroidDataContext dataContext, AndroidAssets assets) throws InterruptedException { return new AndroidResourceParsingActionBuilder() .setOutput(dataContext.createOutputArtifact(AndroidRuleClasses.ANDROID_ASSET_SYMBOLS)) .build(dataContext, assets); } public static ParsedAndroidAssets of(AndroidAssets assets, Artifact symbols, Label label) { return new ParsedAndroidAssets(assets, symbols, label); } ParsedAndroidAssets(ParsedAndroidAssets other) { this(other, other.symbols, other.label); } private ParsedAndroidAssets(AndroidAssets other, Artifact symbols, Label label) { super(other); this.symbols = symbols; this.label = label; } MergedAndroidAssets merge(AndroidDataContext dataContext, AssetDependencies assetDeps) throws InterruptedException { return MergedAndroidAssets.mergeFrom(dataContext, this, assetDeps); } @Override public Label getLabel() { return label; } @Override public Artifact getSymbols() { return symbols; } @Override public boolean equals(Object object) { if (!super.equals(object)) { return false; } ParsedAndroidAssets other = (ParsedAndroidAssets) object; return symbols.equals(other.symbols) && label.equals(other.label); } @Override public int hashCode() { return Objects.hash(super.hashCode(), symbols, label); } }
[ "copybara-piper@google.com" ]
copybara-piper@google.com
f96a48ba2cce7678a8bdbd0e19c6d7f882d0487a
0d07286a1f5236159658fe76825485435bfc6bf4
/Postdoc2/PlayGround/src/main/java/nl/harmjanwestra/playground/AuthorListGenerator.java
c3443880f43619838e09082b13d8306363f95150
[]
no_license
harmjanwestra/personalcode
8801b58d8ad6a586020936f69f809e5a9a2b3a42
9955d3164131edf431b21c02eee91feff37f1a5d
refs/heads/master
2023-02-16T16:39:50.434889
2023-01-23T20:44:31
2023-01-23T20:44:31
125,522,564
0
1
null
2023-01-23T20:45:58
2018-03-16T13:51:48
Java
UTF-8
Java
false
false
3,136
java
package nl.harmjanwestra.playground; import umcg.genetica.io.text.TextFile; import umcg.genetica.text.Strings; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.regex.Pattern; public class AuthorListGenerator { public static void main(String[] args) { String aut = "D:\\Sync\\Dropbox\\FineMap\\2018-06-EditorComments\\Authors\\Authorlist.txt"; String aff = "D:\\Sync\\Dropbox\\FineMap\\2018-06-EditorComments\\Authors\\AffiliationList.txt"; String output = "D:\\Sync\\Dropbox\\FineMap\\2018-06-EditorComments\\Authors\\Affiliations.html"; AuthorListGenerator m = new AuthorListGenerator(); try { m.run(aut, aff, output); } catch (IOException e) { e.printStackTrace(); } } public void run(String aut, String aff, String outputfile) throws IOException { TextFile tf2 = new TextFile(aff, TextFile.R); String[] elems = tf2.readLineElems(TextFile.tab); HashMap<String, String> map = new HashMap<String, String>(); HashMap<String, String> reversemap = new HashMap<String, String>(); while (elems != null) { if (elems.length >= 2) { map.put(elems[0], elems[1]); // id --> affiliation reversemap.put(elems[1], elems[0]); // affiliation --> id } elems = tf2.readLineElems(TextFile.tab); } tf2.close(); System.out.println(map.size() + " affiliations "); TextFile tf = new TextFile(aut, TextFile.R); elems = tf.readLineElems(TextFile.tab); HashMap<String, Integer> refToId = new HashMap<>(); ArrayList<String> refsout = new ArrayList<String>(); int ctr = 1; ArrayList<String> authorOutput = new ArrayList<>(); while (elems != null) { if (elems.length >= 2) { String name = elems[0]; String refs = elems[1]; String[] refelems = refs.split(","); int[] ids = new int[refelems.length]; for (int r = 0; r < refelems.length; r++) { // get name String ref = refelems[r]; String affiliation = map.get(ref); if (refToId.containsKey(affiliation)) { ids[r] = refToId.get(affiliation); } else { refToId.put(affiliation, ctr); refsout.add(affiliation); ids[r] = ctr; ctr++; } } Arrays.sort(ids); String out = "<div class='author'>" + name + "<sup>" + Strings.concat(ids, Strings.comma) + "</sup></div>"; authorOutput.add(out); } elems = tf.readLineElems(TextFile.tab); } tf.close(); TextFile output = new TextFile(outputfile, TextFile.W); output.writeln("<!DOCTYPE html>"); output.writeln("<head>" + "<title>authorlist</title>" + "<style>" + ".author { display:inline; } " + "" + "</style>" + "</head><body>"); output.writeln("<div id='authors'>" + Strings.concat(authorOutput, Pattern.compile(", ")) + "</div>"); output.writeln("<br/>"); output.writeln("<div id='references'>"); for (int i = 0; i < refsout.size(); i++) { String out = "<div class='reference'><sup>" + (i + 1) + "</sup> " + refsout.get(i) + "</div><br/>"; output.writeln(out); } output.writeln("</div></body></html>"); output.close(); } }
[ "westra.harmjan@outlook.com" ]
westra.harmjan@outlook.com
eb06efdb686b384a0159216e949eeb6b6e38929a
a862a140dd6a5c63b4f709c5cdc6cf75d319dcdf
/Codenza_Java/Data_Structures/DepthFirstSearch.java
1510197a267b5dd132e51638a2426afa57e85146
[]
no_license
MartyMcAir/FromAppsAndBooks
2e730d480737784b9bfff3f49169fdec2fa0448c
7bcbd405053474630c5b5e78d70da1128885fc82
refs/heads/master
2022-02-06T06:14:15.738157
2022-02-01T12:18:37
2022-02-01T12:18:37
222,210,663
3
0
null
2021-08-02T17:19:31
2019-11-17T07:07:59
Java
UTF-8
Java
false
false
3,165
java
import edu.princeton.cs.introcs.In; import edu.princeton.cs.introcs.StdOut; /************************************************************************* * Compilation: javac DepthFirstSearch.java * Execution: java DepthFirstSearch filename.txt s * Dependencies: Graph.java StdOut.java * Data files: http://algs4.cs.princeton.edu/41undirected/tinyG.txt * * Run depth first search on an undirected graph. * Runs in O(E + V) time. * * % java DepthFirstSearch tinyG.txt 0 * 0 1 2 3 4 5 6 * NOT connected * * % java DepthFirstSearch tinyG.txt 9 * 9 10 11 12 * NOT connected * *************************************************************************/ /** * The DepthFirstSearch class represents a data type for * determining the vertices connected to a given source vertex s * in an undirected graph. For versions that find the paths, see * {@link DepthFirstPaths} and {@link BreadthFirstPaths}. * * This implementation uses depth-first search. * The constructor takes time proportional to V + E * (in the worst case), * where V is the number of vertices and E is the number of edges. * It uses extra space (not including the graph) proportional to V . * * For additional documentation, see <a href="/algs4/41graph">Section 4.1</a> of * Algorithms, 4th Edition by Robert Sedgewick and Kevin Wayne. * * @author Robert Sedgewick * @author Kevin Wayne */ public class DepthFirstSearch { private boolean[] marked; // marked[v] = is there an s-v path? private int count; // number of vertices connected to s /** * Computes the vertices in graph G that are * connected to the source vertex s . * @param G the graph * @param s the source vertex */ public DepthFirstSearch(Graph G, int s) { marked = new boolean[G.V()]; dfs(G, s); } // depth first search from v private void dfs(Graph G, int v) { count++; marked[v] = true; for (int w : G.adj(v)) { if (!marked[w]) { dfs(G, w); } } } /** * Is there a path between the source vertex s and vertex v ? * @param v the vertex * @return true if there is a path, false otherwise */ public boolean marked(int v) { return marked[v]; } /** * Returns the number of vertices connected to the source vertex s . * @return the number of vertices connected to the source vertex s */ public int count() { return count; } /** * Unit tests the DepthFirstSearch data type. */ public static void main(String[] args) { In in = new In(args[0]); Graph G = new Graph(in); int s = Integer.parseInt(args[1]); DepthFirstSearch search = new DepthFirstSearch(G, s); for (int v = 0; v < G.V(); v++) { if (search.marked(v)) StdOut.print(v + " "); } StdOut.println(); if (search.count() != G.V()) StdOut.println("NOT connected"); else StdOut.println("connected"); } }
[ "martymcair@gmail.com" ]
martymcair@gmail.com
48a2a507feef9d0b186d0b0bd8f393629135fd3c
230ec7c82ba14b6ec340afa3ea0cea2ccc56abe0
/Documentation/4.0/Samples/java/src/test/java/net/ravendb/ClientApi/Operations/Attachments.java
a69121967f6ccd0652a19aba80a5fc86b80112ff
[]
no_license
ravendb/docs
2fd1aec3194132cd636eaa84f6b2859ba00c2795
3941a394633556f70b149d92873ee62f538858a1
refs/heads/master
2023-08-31T08:14:22.735710
2023-08-28T09:13:30
2023-08-28T09:13:30
961,487
79
139
null
2023-09-14T12:04:02
2010-10-04T19:12:52
JavaScript
UTF-8
Java
false
false
5,818
java
package net.ravendb.ClientApi.Operations; import net.ravendb.client.documents.DocumentStore; import net.ravendb.client.documents.IDocumentStore; import net.ravendb.client.documents.attachments.AttachmentType; import net.ravendb.client.documents.operations.attachments.*; import org.apache.commons.io.IOUtils; import org.apache.http.client.methods.CloseableHttpResponse; import java.io.IOException; import java.io.InputStream; public class Attachments { private interface IFoo { /* //region delete_attachment_syntax DeleteAttachmentOperation(String documentId, String name) DeleteAttachmentOperation(String documentId, String name, String changeVector) //endregion //region put_attachment_syntax PutAttachmentOperation(String documentId, String name, InputStream stream) PutAttachmentOperation(String documentId, String name, InputStream stream, String contentType) PutAttachmentOperation(String documentId, String name, InputStream stream, String contentType, String changeVector) //endregion //region get_attachment_syntax GetAttachmentOperation(String documentId, String name, AttachmentType type, String changeVector) //endregion */ } private class Foo { //region put_attachment_return_value public class AttachmentDetails extends AttachmentName { private String changeVector; private String documentId; public String getChangeVector() { return changeVector; } public void setChangeVector(String changeVector) { this.changeVector = changeVector; } public String getDocumentId() { return documentId; } public void setDocumentId(String documentId) { this.documentId = documentId; } } public class AttachmentName { private String name; private String hash; private String contentType; private long size; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getHash() { return hash; } public void setHash(String hash) { this.hash = hash; } public String getContentType() { return contentType; } public void setContentType(String contentType) { this.contentType = contentType; } public long getSize() { return size; } public void setSize(long size) { this.size = size; } } //endregion } private class Foo2 { /* //region get_attachment_return_value public class CloseableAttachmentResult implements AutoCloseable { private AttachmentDetails details; private CloseableHttpResponse response; public InputStream getData() throws IOException { return response.getEntity().getContent(); } public AttachmentDetails getDetails() { return details; } } public class AttachmentDetails extends Foo.AttachmentName { private String changeVector; private String documentId; public String getChangeVector() { return changeVector; } public void setChangeVector(String changeVector) { this.changeVector = changeVector; } public String getDocumentId() { return documentId; } public void setDocumentId(String documentId) { this.documentId = documentId; } } public class AttachmentName { private String name; private String hash; private String contentType; private long size; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getHash() { return hash; } public void setHash(String hash) { this.hash = hash; } public String getContentType() { return contentType; } public void setContentType(String contentType) { this.contentType = contentType; } public long getSize() { return size; } public void setSize(long size) { this.size = size; } } //endregion */ } public Attachments() { try (IDocumentStore store = new DocumentStore()) { //region delete_1 store.operations().send( new DeleteAttachmentOperation("orders/1-A", "invoice.pdf")); //endregion //region get_1 store.operations().send( new GetAttachmentOperation("orders/1-A", "invoice.pdf", AttachmentType.DOCUMENT, null)); //endregion { InputStream stream = null; //region put_1 AttachmentDetails attachmentDetails = store .operations().send(new PutAttachmentOperation("orders/1-A", "invoice.pdf", stream, "application/pdf")); //endregion } } } }
[ "marcin@ravendb.net" ]
marcin@ravendb.net
c6a91b7eb4090ecaaf56ac95005ebcc3d4cce265
b47fd24632cb5f662ffb0305c2af923570b00905
/app/src/com/lt/dao/CommonDao.java
b48ea6d2dcdb3b36adb8ad96beb91698d2fc08c8
[]
no_license
adamin1990/mywall
265052046835a81a1d05e9977a4cd1de6f761d02
c3ff5cf786b00bdda3aed2c95aca66570b6ae80c
refs/heads/master
2020-05-20T13:22:23.017231
2015-02-10T11:00:01
2015-02-10T11:00:01
30,588,142
0
0
null
null
null
null
GB18030
Java
false
false
5,465
java
package com.lt.dao; import java.io.ByteArrayOutputStream; import java.io.InputStream; import java.io.UnsupportedEncodingException; import java.net.HttpURLConnection; import java.net.URL; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import org.json.JSONArray; import org.json.JSONObject; import android.graphics.Bitmap; import android.graphics.BitmapFactory; public class CommonDao { public static List<Map<String,Object>> getList(String urlpath,String pageNo,String cid) throws Exception{ String path = urlpath; List<Map<String ,Object>> list ; if(pageNo==null){ path = path; }else{ path = path+"&pageNo="+pageNo+"&cid="+cid; } URL url =new URL(path); HttpURLConnection conn=(HttpURLConnection)url.openConnection(); conn.setAllowUserInteraction(true); conn.setConnectTimeout(5* 1000);//设置连接超时 conn.setRequestMethod("GET");//以get方式发起请求 if (conn.getResponseCode() != 200) throw new RuntimeException("请求url失败"); InputStream is = conn.getInputStream();//得到网络返回的输入流 String result = readData(is, "GBK"); conn.disconnect(); JSONArray ja = new JSONArray(result); JSONObject jsonObj; list = new ArrayList<Map<String,Object>>(); for(int i = 0 ; i < ja.length() ; i ++){ jsonObj = (JSONObject)ja.get(i); //以jsonobj的(key value) Iterator<String> keyIter= jsonObj.keys(); String key; Object value ; Map<String, Object> valueMap = new HashMap<String, Object>(); while (keyIter.hasNext()) { key = keyIter.next(); //key 就是id value就是值 value = jsonObj.get(key); // if(key.equals("caddr")){ // Bitmap map = null; // try{ // String urr = value.toString().replaceAll(" ",""); // URL url1 = new URL(urr); // HttpURLConnection conn1 = (HttpURLConnection)url1.openConnection(); // conn1.connect(); // InputStream in = conn1.getInputStream(); // map = BitmapFactory.decodeStream(in); // conn1.disconnect(); // }catch(Exception e){ // System.out.println(e.getMessage().toString()); // } // value = map; // } valueMap.put(key, value); } list.add(valueMap); } return list; } public static List<Map<String ,Object>> getListaddr(String urlpath,String pageNo,String cid) throws Exception{ String path = urlpath; List<Map<String ,Object>> list ; String strjson = null; if(pageNo==null){ path = path; }else{ path = path+"&pageNo="+pageNo+"&cid="+cid; } URL url = new URL(path); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setAllowUserInteraction(true); conn.setAllowUserInteraction(true); conn.setConnectTimeout(5* 1000);//设置连接超时 conn.setRequestMethod("GET");//以get方式发起请求 if (conn.getResponseCode() != 200) throw new RuntimeException("请求url失败"); InputStream is = conn.getInputStream();//得到网络返回的输入流 String result = readData(is, "GBK"); conn.disconnect(); JSONArray ja = new JSONArray(result); JSONObject jsonObj; list = new ArrayList<Map<String,Object>>(); for(int i = 0 ; i < ja.length() ; i ++){ jsonObj = (JSONObject)ja.get(i); //以jsonobj的(key value) Iterator<String> keyIter= jsonObj.keys(); String key; Object value ; Map<String, Object> valueMap = new HashMap<String, Object>(); while (keyIter.hasNext()) { key = keyIter.next(); //key 就是id value就是值 value = jsonObj.get(key); if(key.equals("caddr")){ Bitmap map = null; try{ URL url1 = new URL(value.toString()); HttpURLConnection conn1 = (HttpURLConnection)url1.openConnection(); conn1.connect(); InputStream in = conn1.getInputStream(); map = BitmapFactory.decodeStream(in); conn1.disconnect(); }catch(Exception e){ System.out.println(e.getMessage().toString()); } value = map; valueMap.put(key, value); } } list.add(valueMap); } return list; } /** * 第一个参数为输入流,第二个参数为字符集编码 * @param is * @param string * @return * @throws Exception */ private static String readData(InputStream is, String string) throws Exception { ByteArrayOutputStream outStream = new ByteArrayOutputStream(); byte[] buffer = new byte[1024]; int len = -1; while( (len = is.read(buffer)) != -1 ){ outStream.write(buffer, 0, len); } byte[] data = outStream.toByteArray(); outStream.close(); is.close(); return new String(data, string); } }
[ "adamin1990@gmail.com" ]
adamin1990@gmail.com
aa8cd4c5b47af2cbfeea6c5ec9ec9206360a12cb
f525deacb5c97e139ae2d73a4c1304affb7ea197
/gitv/src/main/java/com/gala/android/dlna/sdk/mediarenderer/service/PrivateService.java
be8a1c2e67f8628f598155836b77b33cd34bf503
[]
no_license
AgnitumuS/gitv
93b2359e1bf9f2b6c945298c61c5c6dbfeea49b3
242c9a10a0aeb41b9589de9f254e6ce9f57bd77a
refs/heads/master
2021-08-08T00:50:10.630301
2017-11-09T08:10:33
2017-11-09T08:10:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,398
java
package com.gala.android.dlna.sdk.mediarenderer.service; import com.gala.android.dlna.sdk.mediarenderer.GalaDLNAListener; import com.gala.android.dlna.sdk.mediarenderer.MediaRenderer; import com.gala.android.dlna.sdk.mediarenderer.service.infor.PrivateServiceConstStr; import org.cybergarage.upnp.Action; import org.cybergarage.upnp.Service; import org.cybergarage.upnp.ServiceInterface; import org.cybergarage.upnp.StateVariable; import org.cybergarage.upnp.control.ActionListener; import org.cybergarage.upnp.control.QueryListener; import org.cybergarage.upnp.device.InvalidDescriptionException; import org.cybergarage.util.Mutex; public class PrivateService extends Service implements ActionListener, QueryListener, ServiceInterface { private GalaDLNAListener galaDLNAListener = null; private MediaRenderer mediaRenderer; private Mutex mutex = new Mutex(); public PrivateService(MediaRenderer render) { setMediaRenderer(render); initService(); setActionListener(this); } public GalaDLNAListener getGalaDLNAListener() { return this.galaDLNAListener; } public void setGalaDLNAListener(GalaDLNAListener galaDLNAListener) { this.galaDLNAListener = galaDLNAListener; } private void setMediaRenderer(MediaRenderer render) { this.mediaRenderer = render; } public MediaRenderer getMediaRenderer() { return this.mediaRenderer; } public void lock() { this.mutex.lock(); } public void unlock() { this.mutex.unlock(); } public boolean actionControlReceived(Action action) { String actionName = action.getName(); if (actionName == null) { return false; } boolean isActionSuccess = false; MediaRenderer dmr = getMediaRenderer(); if (actionName.equals(PrivateServiceConstStr.SEND_MESSAGE)) { int instanceID = action.getArgument("InstanceID").getIntegerValue(); String infor = action.getArgument(PrivateServiceConstStr.INFOR).getValue(); isActionSuccess = true; StringBuffer outResult = new StringBuffer(); if (dmr != null) { GalaDLNAListener galaDLNAListener = dmr.getGalaDLNAListener(); if (galaDLNAListener != null) { galaDLNAListener.onReceiveSendMessage(instanceID, infor, outResult); } } action.getArgument("Result").setValue(outResult.toString()); } if (dmr == null) { return isActionSuccess; } ActionListener listener = dmr.getActionListener(); if (listener == null) { return isActionSuccess; } listener.actionControlReceived(action); return isActionSuccess; } public boolean queryControlReceived(StateVariable stateVar) { return false; } public void initService() { setServiceType(PrivateServiceConstStr.SERVICE_TYPE); setServiceID(PrivateServiceConstStr.SERVICE_ID); setControlURL(PrivateServiceConstStr.CONTROL_URL); setSCPDURL(PrivateServiceConstStr.SCPDURL); setEventSubURL(PrivateServiceConstStr.EVENTSUB_URL); try { loadSCPD(PrivateServiceConstStr.SCPD); } catch (InvalidDescriptionException e) { e.printStackTrace(); } } }
[ "liuwencai@le.com" ]
liuwencai@le.com
61b33cedfb15a0f84eec779272de07897eae23b6
421f0a75a6b62c5af62f89595be61f406328113b
/generated_tests/model_seeding/83_xbus-net.sf.xbus.base.core.TAManager-1.0-9/net/sf/xbus/base/core/TAManager_ESTest.java
99ba92d0b118baff4abe546f9e9a28493d3bd3db
[]
no_license
tigerqiu712/evosuite-model-seeding-empirical-evaluation
c78c4b775e5c074aaa5e6ca56bc394ec03c2c7c6
11a920b8213d9855082d3946233731c843baf7bc
refs/heads/master
2020-12-23T21:04:12.152289
2019-10-30T08:02:29
2019-10-30T08:02:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
645
java
/* * This file was automatically generated by EvoSuite * Sat Oct 26 01:06:03 GMT 2019 */ package net.sf.xbus.base.core; import org.junit.Test; import static org.junit.Assert.*; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true, useJEE = true) public class TAManager_ESTest extends TAManager_ESTest_scaffolding { @Test public void notGeneratedAnyTest() { // EvoSuite did not generate any tests } }
[ "pderakhshanfar@bsr01.win.tue.nl" ]
pderakhshanfar@bsr01.win.tue.nl
683f244b74b2f820733e894a59532b4463706385
40d844c1c780cf3618979626282cf59be833907f
/src/testcases/CWE601_Open_Redirect/CWE601_Open_Redirect__Servlet_listen_tcp_66a.java
5f7c59e3a86fad81e82f4aa9fba341a0ea49a97d
[]
no_license
rubengomez97/juliet
f9566de7be198921113658f904b521b6bca4d262
13debb7a1cc801977b9371b8cc1a313cd1de3a0e
refs/heads/master
2023-06-02T00:37:24.532638
2021-06-23T17:22:22
2021-06-23T17:22:22
379,676,259
1
0
null
null
null
null
UTF-8
Java
false
false
4,898
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE601_Open_Redirect__Servlet_listen_tcp_66a.java Label Definition File: CWE601_Open_Redirect__Servlet.label.xml Template File: sources-sink-66a.tmpl.java */ /* * @description * CWE: 601 Open Redirect * BadSource: listen_tcp Read data using a listening tcp connection * GoodSource: A hardcoded string * Sinks: * BadSink : place redirect string directly into redirect api call * Flow Variant: 66 Data flow: data passed in an array from one method to another in different source files in the same package * * */ package testcases.CWE601_Open_Redirect; import testcasesupport.*; import javax.servlet.http.*; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.IOException; import java.net.Socket; import java.net.ServerSocket; import java.util.logging.Level; public class CWE601_Open_Redirect__Servlet_listen_tcp_66a extends AbstractTestCaseServlet { public void bad(HttpServletRequest request, HttpServletResponse response) throws Throwable { String data; data = ""; /* Initialize data */ /* Read data using a listening tcp connection */ { ServerSocket listener = null; Socket socket = null; BufferedReader readerBuffered = null; InputStreamReader readerInputStream = null; /* Read data using a listening tcp connection */ try { listener = new ServerSocket(39543); socket = listener.accept(); /* read input from socket */ readerInputStream = new InputStreamReader(socket.getInputStream(), "UTF-8"); readerBuffered = new BufferedReader(readerInputStream); /* POTENTIAL FLAW: Read data using a listening tcp connection */ data = readerBuffered.readLine(); } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error with stream reading", exceptIO); } finally { /* Close stream reading objects */ try { if (readerBuffered != null) { readerBuffered.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing BufferedReader", exceptIO); } try { if (readerInputStream != null) { readerInputStream.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing InputStreamReader", exceptIO); } /* Close socket objects */ try { if (socket != null) { socket.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing Socket", exceptIO); } try { if (listener != null) { listener.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing ServerSocket", exceptIO); } } } String[] dataArray = new String[5]; dataArray[2] = data; (new CWE601_Open_Redirect__Servlet_listen_tcp_66b()).badSink(dataArray , request, response ); } public void good(HttpServletRequest request, HttpServletResponse response) throws Throwable { goodG2B(request, response); } /* goodG2B() - use goodsource and badsink */ private void goodG2B(HttpServletRequest request, HttpServletResponse response) throws Throwable { String data; /* FIX: Use a hardcoded string */ data = "foo"; String[] dataArray = new String[5]; dataArray[2] = data; (new CWE601_Open_Redirect__Servlet_listen_tcp_66b()).goodG2BSink(dataArray , request, response ); } /* Below is the main(). It is only used when building this testcase on * its own for testing or for building a binary to use in testing binary * analysis tools. It is not used when compiling all the testcases as one * application, which is how source code analysis tools are tested. */ public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException { mainFromParent(args); } }
[ "you@example.com" ]
you@example.com
1b3fc6003d8202efae640072ea7bba6c4463d236
c0fe21b86f141256c85ab82c6ff3acc56b73d3db
/dh/src/main/java/com/jdcloud/sdk/service/dh/client/DescribeDedicatedHostTypeExecutor.java
3ab82faff542170ad64dfdbdd1dad93373d6ceb1
[ "Apache-2.0" ]
permissive
jdcloud-api/jdcloud-sdk-java
3fec9cf552693520f07b43a1e445954de60e34a0
bcebe28306c4ccc5b2b793e1a5848b0aac21b910
refs/heads/master
2023-07-25T07:03:36.682248
2023-07-25T06:54:39
2023-07-25T06:54:39
126,275,669
47
61
Apache-2.0
2023-09-07T08:41:24
2018-03-22T03:41:41
Java
UTF-8
Java
false
false
1,422
java
/* * Copyright 2018 JDCLOUD.COM * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http:#www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Dedicated-Host * 关于专有宿主机操作的相关接口 * * OpenAPI spec version: v1 * Contact: * * NOTE: This class is auto generated by the jdcloud code generator program. */ package com.jdcloud.sdk.service.dh.client; import com.jdcloud.sdk.client.JdcloudExecutor; import com.jdcloud.sdk.service.JdcloudResponse; import com.jdcloud.sdk.service.dh.model.DescribeDedicatedHostTypeResponse; /** * 查询专有宿主机机型。 */ class DescribeDedicatedHostTypeExecutor extends JdcloudExecutor { @Override public String method() { return "GET"; } @Override public String url() { return "/regions/{regionId}/dedicatedHostType"; } @Override public Class<? extends JdcloudResponse> returnType() { return DescribeDedicatedHostTypeResponse.class; } }
[ "jdcloud-api@jd.com" ]
jdcloud-api@jd.com
fdbab934a0d4d6c6cdffe2140f62d552c006646f
3a00fed61925d82f4c428cdf05fad98c39e494ea
/src/main/java/com/bittrust/floodit/gui/Board.java
0859d3b67466d1368b95fa655da05f5a374f5be6
[ "Apache-2.0" ]
permissive
wspeirs/Flood-It-Simulator
eaf0c8433f4bb82471ac0bda60ff4b7546a85ad8
e7fcabae065c7de75f853030d2c4df1395d2de4a
refs/heads/master
2016-09-05T18:55:25.588421
2012-02-10T03:11:39
2012-02-10T03:11:39
3,361,719
0
0
null
null
null
null
UTF-8
Java
false
false
6,367
java
package com.bittrust.floodit.gui; import java.awt.Color; import java.awt.GridLayout; import java.util.HashMap; import java.util.Map; import javax.swing.JLabel; import javax.swing.JPanel; import org.apache.commons.collections.map.UnmodifiableMap; import org.apache.commons.math.random.MersenneTwister; public class Board extends JPanel { public static final Color[] colorMap = { Color.MAGENTA, Color.BLUE, Color.YELLOW, Color.GREEN, Color.CYAN, Color.RED }; private static final long serialVersionUID = -8271212380727339087L; private static final int HEIGHT = 10; private static final int WIDTH = 10; private MersenneTwister rnd; private JLabel[][] board = new JLabel[HEIGHT][WIDTH]; private Color currentColor; private Map<Color, Integer> colorCount; public Board(boolean blankFill) { this.rnd = new MersenneTwister(); this.setLayout(new GridLayout(10,10)); this.setBounds(0, 0, 150, 150); this.setVisible(true); this.colorCount = new HashMap<Color, Integer>(); // add them all, and set them all to zero for(Color c:colorMap) { colorCount.put(c, 0); } // set our flood area counter colorCount.put(Color.BLACK, 1); if(blankFill) { for(int h=0; h < HEIGHT; ++h) { for(int w=0; w < WIDTH; ++w) { JLabel label = new JLabel(); label.setOpaque(true); this.add(label); board[h][w] = label; } } } } public void randomlyFillBoard() { for(int h=0; h < HEIGHT; ++h) { for(int w=0; w < WIDTH; ++w) { Color c = colorMap[rnd.nextInt(colorMap.length)]; JLabel label = generateLabel(c); colorCount.put(c, colorCount.get(c) + 1); this.add(label); board[h][w] = label; } } currentColor = board[0][0].getBackground(); } public Color getCurrentColor() { return currentColor; } public void setCurrentColor(Color currentColor) { this.currentColor = currentColor; } public Map<Color, Integer> getColorCount() { return UnmodifiableMap.decorate(colorCount); } public boolean isGameOver() { return colorCount.get(currentColor) == HEIGHT * WIDTH; } public void printColorCount() { for(Color c:colorMap) { System.out.println(colorToString(c) + ": " + colorCount.get(c)); } } public static String colorToString(Color color) { if(color.equals(Color.MAGENTA)) return "PINK"; else if(color.equals(Color.BLUE)) return "BLUE"; else if(color.equals(Color.YELLOW)) return "YELLOW"; else if(color.equals(Color.GREEN)) return "GREEN"; else if(color.equals(Color.CYAN)) return "LT BLUE"; else if(color.equals(Color.RED)) return "RED"; else return ""; } /** * Floods the board with a given color, returning the number of new squares converted. * @param color The color to flood. * @return The number of new squares converted. */ public int flood(Color color) { if(color.equals(currentColor) || isGameOver()) { return 0; } Color[][] newBoard = new Color[HEIGHT][WIDTH]; flood(true, color, 0, 0, newBoard, currentColor); currentColor = color; setBoard(newBoard); int beforeCount = colorCount.get(Color.BLACK); colorCount.put(Color.BLACK, 0); flood(false, Color.BLACK, 0, 0, new Color[HEIGHT][WIDTH], currentColor ); int afterCount = colorCount.get(Color.BLACK); return afterCount - beforeCount; } private void flood(boolean updateCount, Color color, int row, int column, Color[][] newBoard, Color parentColor ) { if( row >= 0 && row < HEIGHT && column >= 0 && column < WIDTH && newBoard[row][column] == null ) { Color currentColor = board[row][column].getBackground(); if( currentColor.equals( parentColor ) ) { newBoard[row][column] = color; // update the color count if(updateCount) colorCount.put(currentColor, colorCount.get(currentColor) - 1); // always update this, as it is BLACK second time through colorCount.put(color, colorCount.get(color) + 1); // recurse in all 4 directions flood(updateCount, color, row + 1, column, newBoard, currentColor); flood(updateCount, color, row - 1, column, newBoard, currentColor); flood(updateCount, color, row, column + 1, newBoard, currentColor); flood(updateCount, color, row, column - 1, newBoard, currentColor); } } } public void resetBoard(Color[][] colors, Map<Color, Integer> colorCount, Color currentColor) { setBoard(colors); for(Map.Entry<Color, Integer> count:colorCount.entrySet()) { this.colorCount.put(count.getKey(), count.getValue()); } this.colorCount.put(Color.BLACK, colorCount.get(Color.BLACK)); this.currentColor = currentColor; } public void setBoard(Color[][] colors) { for(int h=0; h < HEIGHT; ++h) { for(int w=0; w < WIDTH; ++w) { if(colors[h][w] != null) board[h][w].setBackground(colors[h][w]); } } this.updateUI(); } public Color[][] getColorBoard() { Color[][] ret = new Color[HEIGHT][WIDTH]; for(int h=0; h < HEIGHT; ++h) { for(int w=0; w < WIDTH; ++w) { ret[h][w] = new Color(board[h][w].getBackground().getRGB()); } } return ret; } private JLabel generateLabel(Color color) { JLabel ret = new JLabel(); ret.setOpaque(true); ret.setBackground(color); return ret; } }
[ "bill.speirs@gmail.com" ]
bill.speirs@gmail.com
24cff5c58f647689f5e31c3053a322885163468c
a3a3b511bcd85e324854179943b1804c9673f9ac
/app/src/main/java/com/cui/android/jianchengdichan/view/ui/avtivity/SetingActivity.java
a21066a0781e06eff4ac7b665e7a0aed94bc53cc
[]
no_license
cuijiehui/jianchangDiChan
45d72b015cfbf7bb3da8675bd8fdc21ce8152255
ba30e59e694404e3f18d80bc9b4237888405e635
refs/heads/master
2020-03-17T20:57:18.726146
2019-07-04T05:59:27
2019-07-04T05:59:27
133,936,918
0
0
null
null
null
null
UTF-8
Java
false
false
2,543
java
package com.cui.android.jianchengdichan.view.ui.avtivity; import android.content.Context; import android.os.Bundle; import android.view.View; import android.widget.ImageView; import android.widget.RelativeLayout; import android.widget.TextView; import com.cui.android.jianchengdichan.R; import com.cui.android.jianchengdichan.presenter.BasePresenter; import com.cui.android.jianchengdichan.presenter.LoginPresenter; import com.cui.android.jianchengdichan.utils.LogUtils; import com.cui.android.jianchengdichan.view.base.BaseActivity; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnClick; public class SetingActivity extends BaseActivity { LoginPresenter mLoginPresenter; @BindView(R.id.top_back) RelativeLayout topBack; @BindView(R.id.tv_content_name) TextView tvContentName; @BindView(R.id.tv_top_right) TextView tvTopRight; @BindView(R.id.iv_top_right) ImageView ivTopRight; @BindView(R.id.rl_setting_question) RelativeLayout rlSettingQuestion; @BindView(R.id.rl_setting_clear) RelativeLayout rlSettingClear; @BindView(R.id.tv_setting_version) TextView tvSettingVersion; @Override public BasePresenter initPresenter() { mLoginPresenter = new LoginPresenter(); return mLoginPresenter; } @Override public void initParam(Bundle param) { } @Override public int bindLayout() { return R.layout.activity_seting; } @Override public void initView(View view) { tvContentName.setText("设置"); tvTopRight.setVisibility(View.GONE); ivTopRight.setVisibility(View.GONE); } @Override public void doBusiness(Context mContext) { } @Override public View initBack() { return topBack; } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // TODO: add setContentView(...) invocation ButterKnife.bind(this); } @OnClick({ R.id.rl_setting_question, R.id.rl_setting_clear, R.id.tv_setting_version}) public void onViewClicked(View view) { switch (view.getId()) { case R.id.rl_setting_question: LogUtils.i("rl_setting_question"); break; case R.id.rl_setting_clear: LogUtils.i("rl_setting_clear"); break; case R.id.tv_setting_version: LogUtils.i("tv_setting_version"); break; } } }
[ "714888928@qq.com" ]
714888928@qq.com
62a9d98f3f0f212a6b61650718f604d5d983de72
028cbe18b4e5c347f664c592cbc7f56729b74060
/v2/appserv-commons/src/java/com/sun/enterprise/util/pool/Pool.java
9a0172e8711d8d96defb7dca347a6fe34f180310
[]
no_license
dmatej/Glassfish-SVN-Patched
8d355ff753b23a9a1bd9d7475fa4b2cfd3b40f9e
269e29ba90db6d9c38271f7acd2affcacf2416f1
refs/heads/master
2021-05-28T12:55:06.267463
2014-11-11T04:21:44
2014-11-11T04:21:44
23,610,469
1
0
null
null
null
null
UTF-8
Java
false
false
5,837
java
/* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License"). You * may not use this file except in compliance with the License. You can obtain * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. * Sun designates this particular file as subject to the "Classpath" exception * as provided by Sun in the GPL Version 2 section of the License file that * accompanied this code. If applicable, add the following below the License * Header, with the fields enclosed by brackets [] replaced by your own * identifying information: "Portions Copyrighted [year] * [name of copyright owner]" * * Contributor(s): * * If you wish your version of this file to be governed by only the CDDL or * only the GPL Version 2, indicate your decision by adding "[Contributor] * elects to include this software in this distribution under the [CDDL or GPL * Version 2] license." If you don't indicate a single choice of license, a * recipient has the option to distribute your version of this file under * either the CDDL, the GPL Version 2 or to extend the choice of license to * its licensees as provided above. However, if you add GPL Version 2 code * and therefore, elected the GPL Version 2 license, then the option applies * only if the new code is made subject to such option by the copyright * holder. */ //NOTE: Tabs are used instead of spaces for indentation. // Make sure that your editor does not replace tabs with spaces. // Set the tab length using your favourite editor to your // visual preference. /* * Filename: Pool.java * * Copyright 2000-2001 by iPlanet/Sun Microsystems, Inc., * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. * All rights reserved. * * This software is the confidential and proprietary information * of iPlanet/Sun Microsystems, Inc. ("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 iPlanet/Sun Microsystems. */ /** * <BR> <I>$Source: /cvs/glassfish/appserv-commons/src/java/com/sun/enterprise/util/pool/Pool.java,v $</I> * @author $Author: tcfujii $ * @version $Revision: 1.3 $ $Date: 2005/12/25 04:12:27 $ */ package com.sun.enterprise.util.pool; /** * Pool defines the methods that can be used by the application to access pooled objects. The basic * assumption is that all objects in the pool are identical (homogeneous). This interface defines * methods for a) getting an object from the pool, b) returning an object back to the pool * and, c) destroying (instead of reusing) an object. In addition to these methods, the Pool has * methods for adding and removing PoolEventListeners. There are six overloaded methods for * getting objects from a pool. */ public interface Pool { /** * Get an object. * @param toWait - true indicates that the calling thread agrees to wait indefinitely false if not. * @param param - some value that might be used while creating the object * @return an Object or null if an object could not be returned in 'waitForMillis' millisecond. * @exception Throws InterruptedException if the calling thread was interrupted during the call. * @exception Throws PoolException if the underlying pool implementation throws specific exception * (for example, the pool is closed etc.) */ public Object getObject(boolean toWait, Object param) throws PoolException, InterruptedException; /** * Get an object from the pool within the specified time. * @param The amount of time the calling thread agrees to wait. * @param Some value that might be used while creating the object * @return an Object or null if an object could not be returned in 'waitForMillis' millisecond. * @exception Throws InterruptedException if the calling thread was interrupted during the call. * @exception Throws PoolException if the underlying pool implementation throws specific exception * (for example, the pool is closed etc.) */ public Object getObject(long waitForMillis, Object param) throws PoolException, InterruptedException; /** * Return an object back to the pool. An object that is obtained through * getObject() must always be returned back to the pool using either * returnObject(obj) or through destroyObject(obj). */ public void returnObject(Object obj); /** * Destroys an Object. Note that applications should not ignore the reference * to the object that they got from getObject(). An object that is obtained through * getObject() must always be returned back to the pool using either * returnObject(obj) or through destroyObject(obj). This method tells that the * object should be destroyed and cannot be reused. */ public void destroyObject(Object obj); /** * Add a PoolListener * @param listener The pool listener */ public boolean addPoolListener(PoolListener listener); /** * Add a PoolListener * @param listener The pool listener */ public boolean removePoolListener(PoolListener listener); }
[ "kohsuke@6f3ba3e3-413c-0410-a8aa-90bee3ab43b5" ]
kohsuke@6f3ba3e3-413c-0410-a8aa-90bee3ab43b5
0cb841b74b40b1aa339bf30a98b4a6fd8f135214
52dd2cc65e68fc60503b0a71b1d7e053ab8a9b7c
/src/gwt/scene/ui/client/FormControl.java
266b1c424076238e23c68384796e10d18862631b
[ "Apache-2.0" ]
permissive
ggeorg/gwt-scene
b9f2b118dce595a7fc5679333f404f187f01793c
6096bc5d07bda211edb6b9b49a383d9740746744
refs/heads/master
2020-03-08T11:27:58.102520
2018-05-19T13:55:21
2018-05-19T13:55:21
128,098,446
0
0
null
null
null
null
UTF-8
Java
false
false
301
java
package gwt.scene.ui.client; import com.google.gwt.user.client.ui.IsWidget; public interface FormControl extends IsWidget { String getId(); void setId(String id); boolean isRequired(); void setRequired(boolean required); String getAttributes(); void setAttributes(String attributes); }
[ "georgopoulos.georgios@gmail.com" ]
georgopoulos.georgios@gmail.com
c7331cd38bff69189e3a50cb05b47b2c186aa50b
f1ff01a62963e15e2d76970b54466dfccf0e84c6
/JAVA/receipt/dao/Returncause1Dao.java
879d2a3d20abf5a6f4f74b73a126ab643d1edcb9
[]
no_license
gshenyinshu/GTChina
7653224925a348ca5a54fe1c741aee2c662915a6
9d91cac2250aed2a42aebf9f5d86a27679fdc754
refs/heads/master
2023-03-08T18:22:12.540089
2023-02-21T08:17:56
2023-02-21T08:17:56
138,272,406
0
0
null
2020-05-15T05:36:36
2018-06-22T07:49:46
Java
GB18030
Java
false
false
720
java
package gtone.changeminer.receipt.dao; import anyframe.data.DataSet; import gtone.changeminer.common.dao.Executor; import anyframe.data.*; import anyframe.log.*; import gtone.changeminer.common.utility.*; public class Returncause1Dao { ////카테고리내용 검색 public DataSet selCatedesc(DataSet input) throws Exception { try { Executor executor = null; executor = Executor.getInstance(); anyframe.log.Logger.debug.println("c_id dao ---- input : "+input); DataSet output = executor.execute("/changeminer/select_cate", input); anyframe.log.Logger.debug.println("c_id dao ---- output : "+output); return output; } catch(Exception e) { throw(e); } } }
[ "olivia@gtone.co.kr" ]
olivia@gtone.co.kr
b1caee63cff2caeda390cab7a766e663725be67e
d02d8c818c467c4d66fb32ad78da4abb6d96a5df
/clients/custom-swagger-codegen/impl/src/main/java/com/okta/example/sdk/impl/client/AbstractClient.java
4672fa017528b48f41da72179f4abf85a1807757
[ "Apache-2.0" ]
permissive
bdemers/generated-code-example
4d33aaeda69e13aa4f59347c90035047d10c2ecc
5c67a0b616f1cc299543e3e7eb70bbcf3d68d6d0
refs/heads/master
2021-04-30T09:38:52.835042
2019-01-18T15:25:07
2019-01-18T15:25:07
121,313,893
0
0
null
null
null
null
UTF-8
Java
false
false
7,254
java
/* * Copyright 2014 Stormpath, Inc. * Modifications Copyright 2018 Okta, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.okta.example.sdk.impl.client; import com.okta.example.sdk.cache.CacheManager; import com.okta.example.sdk.client.AuthenticationScheme; import com.okta.example.sdk.client.Client; import com.okta.example.sdk.client.Proxy; import com.okta.example.sdk.impl.api.ClientCredentialsResolver; import com.okta.example.sdk.authc.credentials.ClientCredentials; import com.okta.example.sdk.impl.ds.DefaultDataStore; import com.okta.example.sdk.impl.ds.InternalDataStore; import com.okta.example.sdk.impl.http.RequestExecutor; import com.okta.example.sdk.impl.http.authc.RequestAuthenticatorFactory; import com.okta.example.sdk.impl.util.BaseUrlResolver; import com.okta.example.sdk.lang.Assert; import com.okta.example.sdk.lang.Classes; import com.okta.example.sdk.resource.Resource; import java.lang.reflect.Constructor; /** * The default {@link Client} implementation. * This is a convenience mechanism to eliminate the constant need to call {@code client.getDataStore()} every * time one needs to instantiate or look up a Resource. * * @see <a href="http://www.okta.com/docs/quickstart/connect">Communicating with Okta: Get your API Key</a> * @since 0.5.0 */ public abstract class AbstractClient implements Client { private final InternalDataStore dataStore; /** * Instantiates a new Client instance that will communicate with the Okta REST API. See the class-level * JavaDoc for a usage example. * * @param clientCredentialsResolver Okta API Key resolver * @param baseUrlResolver Okta base URL resolver * @param proxy the HTTP proxy to be used when communicating with the Okta API server (can be * null) * @param cacheManager the {@link com.okta.example.sdk.cache.CacheManager} that should be used to cache * Okta REST resources (can be null) * @param authenticationScheme the HTTP authentication scheme to be used when communicating with the Okta API * server (can be null) * @param requestAuthenticatorFactory factory used to handle creating autentication requests * @param connectionTimeout connection timeout in seconds */ public AbstractClient(ClientCredentialsResolver clientCredentialsResolver, BaseUrlResolver baseUrlResolver, Proxy proxy, CacheManager cacheManager, AuthenticationScheme authenticationScheme, RequestAuthenticatorFactory requestAuthenticatorFactory, int connectionTimeout) { Assert.notNull(clientCredentialsResolver, "clientCredentialsResolver argument cannot be null."); Assert.notNull(baseUrlResolver, "baseUrlResolver argument cannot be null."); Assert.isTrue(connectionTimeout >= 0, "connectionTimeout cannot be a negative number."); RequestExecutor requestExecutor = createRequestExecutor(clientCredentialsResolver.getClientCredentials(), proxy, authenticationScheme, requestAuthenticatorFactory, connectionTimeout); this.dataStore = createDataStore(requestExecutor, baseUrlResolver, clientCredentialsResolver, cacheManager); } protected InternalDataStore createDataStore(RequestExecutor requestExecutor, BaseUrlResolver baseUrlResolver, ClientCredentialsResolver clientCredentialsResolver, CacheManager cacheManager) { return new DefaultDataStore(requestExecutor, baseUrlResolver, clientCredentialsResolver, cacheManager); } @Override public ClientCredentials getClientCredentials() { return this.dataStore.getClientCredentials(); } @Override public CacheManager getCacheManager() { return this.dataStore.getCacheManager(); } @Override public InternalDataStore getDataStore() { return this.dataStore; } @SuppressWarnings({"unchecked", "rawtypes"}) protected RequestExecutor createRequestExecutor(ClientCredentials clientCredentials, Proxy proxy, AuthenticationScheme authenticationScheme, RequestAuthenticatorFactory requestAuthenticatorFactory, int connectionTimeout) { String className = "com.okta.example.sdk.impl.http.httpclient.HttpClientRequestExecutor"; Class requestExecutorClass; if (Classes.isAvailable(className)) { requestExecutorClass = Classes.forName(className); } else { //we might be able to check for other implementations in the future, but for now, we only support //HTTP calls via the HttpClient. Throw an exception: String msg = "Unable to find the '" + className + "' implementation on the classpath. Please ensure you " + "have added the okta-sdk-httpclient .jar file to your runtime classpath."; throw new RuntimeException(msg); } Constructor<RequestExecutor> ctor = Classes.getConstructor(requestExecutorClass, ClientCredentials.class, Proxy.class, AuthenticationScheme.class, RequestAuthenticatorFactory.class, Integer.class); return Classes.instantiate(ctor, clientCredentials, proxy, authenticationScheme, requestAuthenticatorFactory, connectionTimeout); } // ======================================================================== // DataStore methods (delegate to underlying DataStore instance) // ======================================================================== /** * Delegates to the internal {@code dataStore} instance. This is a convenience mechanism to eliminate the constant * need to call {@code client.getDataStore()} every time one needs to instantiate Resource. * * @param clazz the Resource class to instantiate. * @param <T> the Resource sub-type * @return a new instance of the specified Resource. */ @Override public <T extends Resource> T instantiate(Class<T> clazz) { return this.dataStore.instantiate(clazz); } /** * Delegates to the internal {@code dataStore} instance. This is a convenience mechanism to eliminate the constant * need to call {@code client.getDataStore()} every time one needs to look up a Resource. * * @param href the resource URL of the resource to retrieve * @param clazz the {@link Resource} sub-interface to instantiate * @param <T> type parameter indicating the returned value is a {@link Resource} instance. * @return an instance of the specified class based on the data returned from the specified {@code href} URL. */ @Override public <T extends Resource> T getResource(String href, Class<T> clazz) { return this.dataStore.getResource(href, clazz); } }
[ "bdemers@apache.org" ]
bdemers@apache.org
85683e7631ae4d7755e74329237a1b538d9fca1c
ba3001b31d553c87cd6479ce8f51e3d86c47ef5c
/src/org/opensha/sra/calc/parallel/ThreadedCondLossCalc.java
42dabafb817f8b88abfe39e0ba68748d705bc332
[ "Apache-2.0" ]
permissive
GNS-Science/opensha-ucerf3
3d565c2cc5dd67e90f70a3f208c21065d3c08669
2f481092cb371aa576046e03a7d09935ae4ad596
refs/heads/master
2023-04-22T04:14:08.159686
2021-05-13T01:26:22
2021-05-13T01:26:22
297,166,558
0
0
Apache-2.0
2021-05-13T01:23:46
2020-09-20T21:26:44
Java
UTF-8
Java
false
false
2,938
java
package org.opensha.sra.calc.parallel; import java.util.ArrayList; import java.util.Deque; import java.util.Iterator; import org.opensha.commons.data.Site; import org.opensha.commons.data.function.ArbitrarilyDiscretizedFunc; import org.opensha.commons.data.function.DiscretizedFunc; import org.opensha.commons.geo.Location; import org.opensha.commons.param.Parameter; import org.opensha.sha.earthquake.ERF; import org.opensha.sha.imr.ScalarIMR; import org.opensha.sra.calc.parallel.MPJ_CondLossCalc.SiteResult; import com.google.common.base.Preconditions; public class ThreadedCondLossCalc { protected ERF[] erfs; protected ScalarIMR[] imrs; protected Site[] sites; protected Deque<SiteResult> stack; private DiscretizedFunc magThreshFunc; public ThreadedCondLossCalc(ERF[] erfs, ScalarIMR[] imrs, DiscretizedFunc magThreshFunc) { Preconditions.checkNotNull(erfs); Preconditions.checkNotNull(imrs); Preconditions.checkArgument(imrs.length > 0); for (ScalarIMR imr : imrs) { Preconditions.checkNotNull(imr); } Preconditions.checkArgument(erfs.length > 0); for (ERF erf : erfs) Preconditions.checkNotNull(erf); if (erfs.length > 1) Preconditions.checkState(erfs.length == imrs.length); this.erfs = erfs; this.imrs = imrs; this.magThreshFunc = magThreshFunc; sites = new Site[imrs.length]; for (int i=0; i<imrs.length; i++) { ScalarIMR imr = imrs[i]; // initialize the site with IMR params. location will be overridden. sites[i] = new Site(new Location(34, -118)); Iterator<Parameter<?>> it = imr.getSiteParamsIterator(); while (it.hasNext()) sites[i].addParameter((Parameter)it.next().clone()); } } public synchronized SiteResult popAsset() { try { return stack.pop(); } catch (Exception e) { return null; } } public void calculateBatch(Deque<SiteResult> stack) throws InterruptedException { this.stack = stack; int numThreads = imrs.length; ArrayList<Thread> threads = new ArrayList<Thread>(); for (int i=0; i<numThreads; i++) { ERF erf; if (erfs.length > 1) erf = erfs[i]; else erf = erfs[0]; threads.add(new CalcThread(erf, imrs[i], sites[i])); } // start the threSiteads for (Thread t : threads) { t.start(); } // join the threads for (Thread t : threads) { t.join(); } } private class CalcThread extends Thread { private ScalarIMR imr; private Site site; private ERF erf; public CalcThread(ERF erf, ScalarIMR imr, Site site) { this.imr = imr; this.site = site; this.erf = erf; } @Override public void run() { SiteResult result = popAsset(); while (result != null) { result.calculate(erf, imr, site, magThreshFunc); // System.out.println("Calculated EAL: "+asset.getAssetEAL()); result = popAsset(); } } } public ERF[] getERFs() { return erfs; } public ScalarIMR[] getIMRs() { return imrs; } }
[ "kmilner@usc.edu" ]
kmilner@usc.edu
268bc78385936f0254fc36e40a1d8789df464adf
2ceb874289627a8c83f15a379f1e5750b0305200
/root/src/main/java/com/me2me/web/request/ObtainRedBagRequest.java
5fa9768ee95c4e31332d5be89e07dc294514ea70
[]
no_license
hushunjian/me2me-app
73a691576d29565f5a51eed9025e256df6b5c9ce
5da0a720b72193a041150fae1266fceb33ba8518
refs/heads/master
2023-01-07T15:59:26.013478
2021-04-03T09:50:07
2021-04-03T09:50:07
120,296,809
0
2
null
2022-12-16T07:54:57
2018-02-05T11:37:31
Java
UTF-8
Java
false
false
222
java
package com.me2me.web.request; import com.me2me.common.web.Request; /** * 上海拙心网络科技有限公司出品 * Author: 郭世同 * Date: 2017/7/20 0017. */ public class ObtainRedBagRequest extends Request { }
[ "hushunjian950420@163.com" ]
hushunjian950420@163.com
7ff17a376aa10e90b5da2e3cc897362e6f598e35
cba4350d5ffcbd6c2790d886553132c0f41457ff
/src/main/java/com/hivemq/client/internal/mqtt/message/disconnect/MqttDisconnectProperty.java
1f262e462bfce1e255e08ed48cf7e884eba5f2f8
[ "Apache-2.0" ]
permissive
hivemq/hivemq-mqtt-client
6f34fbcde2f1824a1b050f63950661a10dd6576c
4232241aa34fde59c97a4490d0835ff9942d7270
refs/heads/master
2023-08-31T07:36:06.326833
2023-08-28T11:24:48
2023-08-28T11:24:48
116,057,862
701
157
Apache-2.0
2023-08-28T11:24:49
2018-01-02T21:15:55
Java
UTF-8
Java
false
false
1,284
java
/* * Copyright 2018-present HiveMQ and the HiveMQ Community * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.hivemq.client.internal.mqtt.message.disconnect; import com.hivemq.client.internal.mqtt.message.MqttProperty; /** * All possible MQTT DISCONNECT properties and its byte code according to the MQTT 5 specification. * * @author Silvio Giebl */ public final class MqttDisconnectProperty { public static final int SESSION_EXPIRY_INTERVAL = MqttProperty.SESSION_EXPIRY_INTERVAL; public static final int SERVER_REFERENCE = MqttProperty.SERVER_REFERENCE; public static final int REASON_STRING = MqttProperty.REASON_STRING; public static final int USER_PROPERTY = MqttProperty.USER_PROPERTY; private MqttDisconnectProperty() {} }
[ "gieblsilvio@outlook.com" ]
gieblsilvio@outlook.com
4195f0e665958b22dd0c5afe8beb3fdfbf941a99
bcfe680e52ccf2e28675f4a2e0320c69083c6f59
/dubbo/src/main/java/hum/http/HttpServer.java
4f4d8f1cb6db2065e375afad02dbbcd8f0b88f62
[]
no_license
humwawe/handwriting-frame
8a56366cee9a67b5d7bb9a9c5e46bd435e33872d
02362a600b213c3f4bb7f87cfe4e109a7150706b
refs/heads/master
2021-06-12T04:05:54.267140
2019-10-19T03:21:27
2019-10-19T03:21:27
170,980,166
0
0
null
2021-04-26T18:54:01
2019-02-16T08:23:14
Java
UTF-8
Java
false
false
1,421
java
package hum.http; import org.apache.catalina.*; import org.apache.catalina.connector.Connector; import org.apache.catalina.core.StandardContext; import org.apache.catalina.core.StandardEngine; import org.apache.catalina.core.StandardHost; import org.apache.catalina.startup.Tomcat; /** * @author hum */ public class HttpServer { public void start(String hostname, Integer port) { Tomcat tomcat = new Tomcat(); Server server = tomcat.getServer(); Service service = server.findService("Tomcat"); Connector connector = new Connector(); connector.setPort(port); Engine engine = new StandardEngine(); engine.setDefaultHost(hostname); Host host = new StandardHost(); host.setName(hostname); String contextPath = ""; Context context = new StandardContext(); context.setPath(contextPath); context.addLifecycleListener(new Tomcat.FixContextListener()); host.addChild(context); engine.addChild(host); service.setContainer(engine); service.addConnector(connector); tomcat.addServlet(contextPath, "dispatcher", new DispatcherServlet()); context.addServletMappingDecoded("/*", "dispatcher"); try { tomcat.start(); tomcat.getServer().await(); } catch (LifecycleException e) { e.printStackTrace(); } } }
[ "wawe8963098@163.com" ]
wawe8963098@163.com
2d7921fde4c77b99982f8f4c90e77d19e8d2dde3
abf09f42e594f943927530d4d7dbd08dda436de5
/allPattern/src/dump/P124.java
57e47154669cccfeaf21dc8a4bc47e31124af45c
[]
no_license
mortozafsti/Jsp-Web-Project
e232148120b026a8eeb87fa3b2582e36c356e0fc
3920d6a4d9161609a2dc9030ba901728363e5423
refs/heads/master
2022-12-02T19:33:56.584746
2019-09-23T08:06:55
2019-09-23T08:06:55
160,851,448
0
0
null
2022-11-24T09:19:21
2018-12-07T16:53:00
Java
UTF-8
Java
false
false
684
java
package dump; public class P124 { private double length; private double height; private double area; public double setLength(double length) { this.length = length; setArea(area); return length; } public double setHeight(double height) { this.height = height; setArea(area); return height; } public double setArea(double area) { area = length * height; return area; } public static void main(String[] args) { P124 p124 = new P124(); p124.length = 10; p124.height = 5; double ss = p124.setArea(20); System.out.println(ss); } }
[ "mortozafsti@gmail.com" ]
mortozafsti@gmail.com
17f3891748a2406219e4a7bd4afc312bbf2d679e
a367bc368911667782733027870d43ca2a71bc8b
/alpha/MyBox/src/main/java/mara/mybox/controller/NotesCopyNotesController.java
5315195692355ebce8804c34d7972d9bd89d8104
[ "Apache-2.0" ]
permissive
huangzhaorongit/MyBox
9be81837a50161a18616d065e7c0b63602196adb
dc462b54d611a801a1529d514ca00192915c894a
refs/heads/master
2023-06-29T08:21:37.851703
2021-08-03T12:32:06
2021-08-03T12:32:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,812
java
package mara.mybox.controller; import java.util.ArrayList; import java.util.List; import java.util.Timer; import java.util.TimerTask; import javafx.application.Platform; import javafx.fxml.FXML; import javafx.scene.control.TreeItem; import javafx.stage.Modality; import javafx.stage.Stage; import javafx.stage.Window; import mara.mybox.db.data.Note; import mara.mybox.db.data.Notebook; import mara.mybox.fxml.WindowTools; import static mara.mybox.value.Languages.message; import mara.mybox.value.Fxmls; import mara.mybox.value.Languages; /** * @Author Mara * @CreateDate 2021-3-29 * @License Apache License Version 2.0 */ public class NotesCopyNotesController extends ControlNotebookSelector { public NotesCopyNotesController() { baseTitle = Languages.message("CopyNotes"); } @FXML @Override public void okAction() { synchronized (this) { if (task != null && !task.isQuit()) { return; } List<Note> notes = notesController.tableView.getSelectionModel().getSelectedItems(); if (notes == null || notes.isEmpty()) { alertError(Languages.message("SelectNotes")); notesController.getMyStage().requestFocus(); return; } TreeItem<Notebook> targetNode = treeView.getSelectionModel().getSelectedItem(); if (targetNode == null) { alertError(Languages.message("SelectNotebook")); return; } Notebook targetBook = targetNode.getValue(); if (targetBook == null) { return; } if (equal(targetBook, notesController.notebooksController.selectedNode)) { alertError(Languages.message("TargetShouldDifferentWithSource")); return; } task = new SingletonTask<Void>() { private int count; @Override protected boolean handle() { try { long bookid = targetBook.getNbid(); List<Note> newNotes = new ArrayList<>(); for (Note note : notes) { Note newNote = new Note(bookid, note.getTitle(), note.getHtml(), null); newNotes.add(newNote); } count = tableNote.insertList(newNotes); return count > 0; } catch (Exception e) { return false; } } @Override protected void whenSucceeded() { if (notesController == null || !notesController.getMyStage().isShowing()) { notesController = NotesController.oneOpen(); } else { notesController.refreshTimes(); notesController.bookChanged(targetBook); } notesController.notebooksController.loadTree(targetBook); notesController.popInformation(Languages.message("Copied") + ": " + count); closeStage(); } }; handling(task); task.setSelf(task); Thread thread = new Thread(task); thread.setDaemon(false); thread.start(); } } /* static methods */ public static NotesCopyNotesController oneOpen(NotesController notesController) { NotesCopyNotesController controller = null; List<Window> windows = new ArrayList<>(); windows.addAll(Window.getWindows()); for (Window window : windows) { Object object = window.getUserData(); if (object != null && object instanceof NotesCopyNotesController) { try { controller = (NotesCopyNotesController) object; controller.toFront(); break; } catch (Exception e) { } } } if (controller == null) { controller = (NotesCopyNotesController) WindowTools.openStage(Fxmls.NotesCopyNotesFxml); } if (controller != null) { controller.setCaller(notesController); Stage cstage = controller.getMyStage(); Timer timer = new Timer(); timer.schedule(new TimerTask() { @Override public void run() { Platform.runLater(() -> { cstage.requestFocus(); cstage.toFront(); }); } }, 500); } return controller; } }
[ "rshmara@sina.com" ]
rshmara@sina.com
8bfa1d3781e6d34fb07e28e5fc9fedaa4ad031fc
a901abdca092650e0eb277f04c988200796b1d7d
/aart-main/aart-web/src/main/java/edu/ku/cete/service/MicroMapService.java
a288125c4851b06a360ecbaba530b69a00f01ee7
[]
no_license
krishnamohankaruturi/secret
5acafbde49b9fa9e24f89534d14e7b01f863f775
4da83d113d3620d4c2c84002fecbe4bdd759c1a2
refs/heads/master
2022-03-24T22:09:41.325033
2019-11-15T12:14:07
2019-11-15T12:14:07
219,771,956
0
0
null
null
null
null
UTF-8
Java
false
false
652
java
package edu.ku.cete.service; import java.util.List; import edu.ku.cete.domain.LinkageLevelSortOrder; import edu.ku.cete.domain.MicroMap; import edu.ku.cete.tde.webservice.domain.MicroMapResponseDTO; public interface MicroMapService { /** * @param microMapResponseDtos * @return */ List<MicroMap> addOrUpdate( List<MicroMapResponseDTO> microMapResponseDtos, Long contentId); /** * @param microMap * @return */ Integer insert(MicroMap microMap); List<MicroMap> selectMicroMapByItiHistoryStudentId(Long studentID); List<LinkageLevelSortOrder> getLinkageLevelSortOrders(Long contentAreaId, List<String> linkageLevelNames); }
[ "Venkatakrishna.k@CTL.local" ]
Venkatakrishna.k@CTL.local
9bbf4e9db389fd18c0ff81d5a5f003a3e6470a91
f854deb050e81c91d3eb5f834180fe33e439fbdb
/src/com/habboproject/server/game/rooms/objects/items/types/DefaultFloorItem.java
3c76dc5c1dea89294693eb3161e7ced200dec0a6
[]
no_license
dank074/CometEmulator
9cedfd7c01ead997a99b8a3aa9d9530d9a809090
5e0123fdd1a54b448f0702af9d674e311ad9f339
refs/heads/master
2020-12-01T07:10:07.767081
2018-01-22T04:31:00
2018-01-22T04:31:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,936
java
package com.habboproject.server.game.rooms.objects.items.types; import com.habboproject.server.game.quests.types.QuestType; import com.habboproject.server.game.rooms.objects.entities.RoomEntity; import com.habboproject.server.game.rooms.objects.entities.types.PlayerEntity; import com.habboproject.server.game.rooms.objects.items.RoomItemFloor; import com.habboproject.server.game.rooms.types.Room; public class DefaultFloorItem extends RoomItemFloor { public DefaultFloorItem(long id, int itemId, Room room, int owner, int groupId, int x, int y, double z, int rotation, String data) { super(id, itemId, room, owner, groupId, x, y, z, rotation, data); } @Override public boolean onInteract(RoomEntity entity, int requestData, boolean isWiredTrigger) { if (!isWiredTrigger) { if (!(entity instanceof PlayerEntity)) { return false; } PlayerEntity pEntity = (PlayerEntity) entity; if (this.getDefinition().requiresRights()) { if (!pEntity.getRoom().getRights().hasRights(pEntity.getPlayerId()) && !pEntity.getPlayer().getPermissions().getRank().roomFullControl()) { return false; } } if (pEntity.getPlayer().getId() == this.getRoom().getData().getOwnerId()) { pEntity.getPlayer().getQuests().progressQuest(QuestType.FURNI_SWITCH); } } this.toggleInteract(true); this.sendUpdate(); this.saveData(); return true; } @Override public void onEntityStepOn(RoomEntity entity) { if (entity instanceof PlayerEntity) { try { ((PlayerEntity) entity).getPlayer().getQuests().progressQuest(QuestType.EXPLORE_FIND_ITEM, this.getDefinition().getSpriteId()); } catch (Exception ignored) { } } } }
[ "orracosta@icloud.com" ]
orracosta@icloud.com
2086a04fcd2f20bcfa1767969780abdb1b358113
96b0a551cfdd9444d86660979492adf5a99f858b
/src/Exercise/section12/ex4/Ex4.java
cb67a804cf761035b3c81b6dc67e5677e61b72ea
[]
no_license
Huigesi/ThinkingInJava
f6a39a10c8c5aed68ccf9161c8a5338326f4c9b5
cbdbe01f8143b351380ab1aa69be7f25b9bdc1ff
refs/heads/master
2020-03-27T23:21:15.509625
2018-09-30T06:53:36
2018-09-30T06:53:36
147,311,939
0
0
null
null
null
null
UTF-8
Java
false
false
582
java
package Exercise.section12.ex4; public class Ex4 { public static void f() throws Exception3 { System.out.println("f()"); throw new Exception3("out of ex4"); } public static void main(String[] args) { try { f(); } catch (Exception3 exception3) { exception3.printStackTrace(); exception3.showS(); } } } class Exception3 extends Exception { private String s; public Exception3(String s) { this.s=s; } protected void showS() { System.out.println(s); } }
[ "791339970@qq.com" ]
791339970@qq.com
abf77d3b09bcde9fda20a7d035dc768f132962ab
aa58b0b32c457eb8c49add9baa7693068fa12680
/src/main/java/com/beyongx/echarts/options/parallelaxis/AxisLabel.java
7ce34bded9cf29f0217268da94f1ed1541726a7b
[ "Apache-2.0" ]
permissive
wen501271303/java-echarts
045dcd41eee35b572122c9de27a340cf777a74b1
9eb611e8f964833e4dbb7360733a6ae7ac6eace1
refs/heads/master
2023-07-30T20:56:23.638092
2021-09-28T06:12:21
2021-09-28T06:12:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,746
java
/** * Created by java-echarts library. * @author: cattong <aronter@gmail.com> */ package com.beyongx.echarts.options.parallelaxis; import java.io.Serializable; import java.util.Map; //import lombok.Data; import lombok.EqualsAndHashCode; /** * * * {_more_} */ @lombok.Data @EqualsAndHashCode(callSuper = false) public class AxisLabel implements Serializable { private static final long serialVersionUID = 1L; private String show; // Default: true private Object interval; //number|Function Default: 'auto' private String inside; // Default: false private String rotate; // Default: 0 private String margin; // Default: 8 private Object formatter; //string|Function private String showMinLabel; // private String showMaxLabel; // private String hideOverlap; // private Object color; //Color|Function private String fontStyle; // Default: 'normal' private Object fontWeight; //string|number Default: 'normal' private String fontFamily; // Default: 'sans-serif' private String fontSize; // Default: 12 private String align; // private String verticalAlign; // private Integer lineHeight; // private Object backgroundColor; //string|Object Default: 'transparent' private String borderColor; // private String borderWidth; // Default: 0 private Object borderType; //string|number|Array Default: 'solid' private String borderDashOffset; // Default: 0 private Object borderRadius; //number|Array Default: 0 private Object padding; //number|Array Default: 0 private String shadowColor; // Default: 'transparent' private String shadowBlur; // Default: 0 private String shadowOffsetX; // Default: 0 private String shadowOffsetY; // Default: 0 private Integer width; // private Integer height; // private String textBorderColor; // private Integer textBorderWidth; // private Object textBorderType; //string|number|Array Default: 'solid' private String textBorderDashOffset; // Default: 0 private String textShadowColor; // Default: 'transparent' private String textShadowBlur; // Default: 0 private String textShadowOffsetX; // Default: 0 private String textShadowOffsetY; // Default: 0 private String overflow; // Default: 'none' private String ellipsis; // Default: '...' private String lineOverflow; // Default: 'none' private Object[] rich; // public AxisLabel() { } public AxisLabel(Map<String, Object> property) { } }
[ "cattong@163.com" ]
cattong@163.com
fe3f4c70d697b2460300517ff7b1aad12ae056e8
129f58086770fc74c171e9c1edfd63b4257210f3
/src/testcases/CWE190_Integer_Overflow/CWE190_Integer_Overflow__int_max_multiply_21.java
008d5365915072a373c8f4451bf6795e56fc1a05
[]
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
7,124
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE190_Integer_Overflow__int_max_multiply_21.java Label Definition File: CWE190_Integer_Overflow__int.label.xml Template File: sources-sinks-21.tmpl.java */ /* * @description * CWE: 190 Integer Overflow * BadSource: max Set data to the maximum value for int * GoodSource: A hardcoded non-zero, non-min, non-max, even number * Sinks: multiply * GoodSink: Ensure there will not be an overflow before multiplying data by 2 * BadSink : If data is positive, multiply by 2, which can cause an overflow * Flow Variant: 21 Control flow: Flow controlled by value of a private variable. All functions contained in one file. * * */ package testcases.CWE190_Integer_Overflow; import testcasesupport.*; import java.sql.*; import javax.servlet.http.*; public class CWE190_Integer_Overflow__int_max_multiply_21 extends AbstractTestCase { /* The variable below is used to drive control flow in the sink function */ private boolean bad_private = false; public void bad() throws Throwable { int data; /* POTENTIAL FLAW: Use the maximum value for this type */ data = Integer.MAX_VALUE; bad_private = true; bad_sink(data ); } private void bad_sink(int data ) throws Throwable { if(bad_private) { if(data > 0) /* ensure we won't have an underflow */ { /* POTENTIAL FLAW: if (data*2) > Integer.MAX_VALUE, this will overflow */ int result = (int)(data * 2); IO.writeLine("result: " + result); } } else { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ if(data > 0) /* ensure we won't have an underflow */ { /* FIX: Add a check to prevent an overflow from occurring */ if (data < (Integer.MAX_VALUE/2)) { int result = (int)(data * 2); IO.writeLine("result: " + result); } else { IO.writeLine("data value is too large to perform multiplication."); } } } } /* The variables below are used to drive control flow in the sink functions. */ private boolean goodB2G1_private = false; private boolean goodB2G2_private = false; private boolean goodG2B_private = false; public void good() throws Throwable { goodB2G1(); goodB2G2(); goodG2B(); } /* goodB2G1() - use BadSource and GoodSink by setting the variable to false instead of true */ private void goodB2G1() throws Throwable { int data; /* POTENTIAL FLAW: Use the maximum value for this type */ data = Integer.MAX_VALUE; goodB2G1_private = false; goodB2G1_sink(data ); } private void goodB2G1_sink(int data ) throws Throwable { if(goodB2G1_private) { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ if(data > 0) /* ensure we won't have an underflow */ { /* POTENTIAL FLAW: if (data*2) > Integer.MAX_VALUE, this will overflow */ int result = (int)(data * 2); IO.writeLine("result: " + result); } } else { if(data > 0) /* ensure we won't have an underflow */ { /* FIX: Add a check to prevent an overflow from occurring */ if (data < (Integer.MAX_VALUE/2)) { int result = (int)(data * 2); IO.writeLine("result: " + result); } else { IO.writeLine("data value is too large to perform multiplication."); } } } } /* goodB2G2() - use BadSource and GoodSink by reversing the blocks in the if in the sink function */ private void goodB2G2() throws Throwable { int data; /* POTENTIAL FLAW: Use the maximum value for this type */ data = Integer.MAX_VALUE; goodB2G2_private = true; goodB2G2_sink(data ); } private void goodB2G2_sink(int data ) throws Throwable { if(goodB2G2_private) { if(data > 0) /* ensure we won't have an underflow */ { /* FIX: Add a check to prevent an overflow from occurring */ if (data < (Integer.MAX_VALUE/2)) { int result = (int)(data * 2); IO.writeLine("result: " + result); } else { IO.writeLine("data value is too large to perform multiplication."); } } } else { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ if(data > 0) /* ensure we won't have an underflow */ { /* POTENTIAL FLAW: if (data*2) > Integer.MAX_VALUE, this will overflow */ int result = (int)(data * 2); IO.writeLine("result: " + result); } } } /* goodG2B() - use GoodSource and BadSink */ private void goodG2B() throws Throwable { int data; /* FIX: Use a hardcoded number that won't cause underflow, overflow, divide by zero, or loss-of-precision issues */ data = 2; goodG2B_private = true; goodG2B_sink(data ); } private void goodG2B_sink(int data ) throws Throwable { if(goodG2B_private) { if(data > 0) /* ensure we won't have an underflow */ { /* POTENTIAL FLAW: if (data*2) > Integer.MAX_VALUE, this will overflow */ int result = (int)(data * 2); IO.writeLine("result: " + result); } } else { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ if(data > 0) /* ensure we won't have an underflow */ { /* FIX: Add a check to prevent an overflow from occurring */ if (data < (Integer.MAX_VALUE/2)) { int result = (int)(data * 2); IO.writeLine("result: " + result); } else { IO.writeLine("data value is too large to perform multiplication."); } } } } /* Below is the main(). It is only used when building this testcase on its own for testing or for building a binary to use in testing binary analysis tools. It is not used when compiling all the testcases as one application, which is how source code analysis tools are tested. */ public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException { mainFromParent(args); } }
[ "guillermo.pando@gmail.com" ]
guillermo.pando@gmail.com
995ed3a0030fa1e1aa106e0c659b522a20f8ef3c
fa93c9be2923e697fb8a2066f8fb65c7718cdec7
/sources/com/avito/android/location_picker/R.java
25216c0081fcbd22ba82002bca238fc59381036e
[]
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
5,368
java
package com.avito.android.location_picker; public final class R { public static final class attr { public static final int fillColor = 0x7F040393; public static final int strokeColor = 0x7F0409C0; public static final int strokeWidth = 0x7F0409C1; } public static final class color { public static final int lp_radius_fill_color = 0x7F060404; public static final int lp_radius_stroke_color = 0x7F060405; } public static final class dimen { public static final int find_me_button_margin_above_radius_list = 0x7F070241; public static final int find_me_button_padding = 0x7F070242; public static final int location_picker_pin_animation = 0x7F0702CA; public static final int location_picker_radius_offset = 0x7F0702CB; public static final int location_picker_radius_padding = 0x7F0702CC; public static final int location_picker_select_radius_button_padding = 0x7F0702CD; } public static final class drawable { public static final int bg_radius_item_loader = 0x7F080310; public static final int bg_select_radius_button_loader = 0x7F080329; public static final int ic_pin_shadow = 0x7F0805E1; public static final int img_my_pin = 0x7F0806BF; public static final int progress_background = 0x7F080738; public static final int search_padding_decorator = 0x7F080788; } public static final class id { public static final int choose_button = 0x7F0A02A7; public static final int clear_button = 0x7F0A02B4; public static final int container = 0x7F0A030D; public static final int drop_down_suggestions_container = 0x7F0A040E; public static final int edit_query = 0x7F0A0426; public static final int edit_scroll = 0x7F0A0427; public static final int find_me_button = 0x7F0A04C2; public static final int linear_radius_list_container = 0x7F0A065E; public static final int location_picker_screen_root = 0x7F0A0684; public static final int main_button = 0x7F0A0699; public static final int map = 0x7F0A069F; public static final int map_concealer = 0x7F0A06A1; public static final int marker_progress = 0x7F0A06A9; public static final int pin_container = 0x7F0A08E8; public static final int pin_shadow = 0x7F0A08EB; public static final int progress_overlay_container = 0x7F0A0947; public static final int radius_recycler_view = 0x7F0A0967; public static final int recycler_view = 0x7F0A0990; public static final int search_radius_view = 0x7F0A0A38; public static final int search_radius_view_switcher = 0x7F0A0A39; public static final int select_radius_button = 0x7F0A0A6F; public static final int subtext_view = 0x7F0A0B84; public static final int text_view = 0x7F0A0BEF; public static final int toolbar = 0x7F0A0C20; public static final int txtRadius = 0x7F0A0C93; } public static final class layout { public static final int location_picker_activity = 0x7F0D037E; public static final int location_picker_radius_item_loader = 0x7F0D037F; public static final int location_picker_search_radius_item = 0x7F0D0380; public static final int location_picker_search_radius_loader = 0x7F0D0381; public static final int location_picker_search_radius_view = 0x7F0D0382; public static final int location_picker_search_view = 0x7F0D0383; public static final int location_picker_suggestion_item = 0x7F0D0384; } public static final class plurals { public static final int show_n_adverts = 0x7F110014; } public static final class string { public static final int lp_address = 0x7F13035A; public static final int lp_choose = 0x7F13035B; public static final int lp_choose_footer = 0x7F13035C; public static final int lp_choose_radius_btn_no_adverts = 0x7F13035D; public static final int lp_choose_radius_btn_show = 0x7F13035E; public static final int lp_empty_address_error = 0x7F13035F; public static final int lp_empty_address_error_for_job_assistant = 0x7F130360; public static final int lp_enter_address = 0x7F130361; public static final int lp_error_dialog_ok_button_text = 0x7F130362; public static final int lp_network_error = 0x7F130363; public static final int lp_network_error_confirmation = 0x7F130364; public static final int lp_no_suggests_error = 0x7F130365; public static final int lp_not_suggested_address_error = 0x7F130366; public static final int lp_permissions_not_granted = 0x7F130367; public static final int lp_repeat = 0x7F130368; public static final int lp_search_radius = 0x7F130369; public static final int lp_settings = 0x7F13036A; } public static final class styleable { public static final int[] SearchRadiusViewImpl = {com.avito.android.R.attr.fillColor, com.avito.android.R.attr.strokeColor, com.avito.android.R.attr.strokeWidth}; public static final int SearchRadiusViewImpl_fillColor = 0x0; public static final int SearchRadiusViewImpl_strokeColor = 0x1; public static final int SearchRadiusViewImpl_strokeWidth = 0x2; } }
[ "auchhunter@gmail.com" ]
auchhunter@gmail.com
e07a258bc937c8718b9b9ba9259a6e07645c1c95
8469d2f71bc22fa2acf66a4bb05155c1d85282fa
/SapeStore/src/main/java/com/sapestore/vo/HomeVO.java
641e476a534bb64f9c0f9e719d57aefcf4f85182
[ "BSD-2-Clause" ]
permissive
rishon1313/sapestore
bce9f33ba16d82eb86be0a2567d92707b340a8c5
3f44263799e9abe279c6311a31d4df9209c9b59c
refs/heads/master
2021-08-17T02:02:18.544939
2017-11-20T17:28:41
2017-11-20T17:28:41
104,585,570
0
2
null
null
null
null
UTF-8
Java
false
false
860
java
package com.sapestore.vo; public class HomeVO { private boolean checkMe; private String categoryName; private int categoryId; /** * @return the checkMe */ public boolean isCheckMe() { return checkMe; } /** * @param checkMe the checkMe to set */ public void setCheckMe(boolean checkMe) { this.checkMe = checkMe; } /** * @return the categoryName */ public String getCategoryName() { return categoryName; } /** * @param categoryName the categoryName to set */ public void setCategoryName(String categoryName) { this.categoryName = categoryName; } /** * @return the categoryId */ public int getCategoryId() { return categoryId; } /** * @param categoryId the categoryId to set */ public void setCategoryId(int categoryId) { this.categoryId = categoryId; } }
[ "root@localhost.localdomain" ]
root@localhost.localdomain
1cd6e3325a7124e965ebaa404a1939792aab2a94
6dc98a70dbd3aed7e084bd56796074527db56039
/jgnash-core/src/main/java/jgnash/engine/DataStore.java
bfd94c228c74311fcd85b5ba0e706c2560e4cfec
[]
no_license
YouAreAGeologist/jgnash
d9bb0946e95cc173e28268365df21dfb99d8fbea
2253c0fe783c7fe35cbdec010bcdb6ba4dd1b38c
refs/heads/master
2020-03-28T19:36:36.648945
2015-12-27T16:19:49
2015-12-27T16:19:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,854
java
/* * jGnash, a personal finance application * Copyright (C) 2001-2015 Craig Cavanaugh * * 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 jgnash.engine; import java.io.File; import java.util.Collection; import jgnash.util.NotNull; /** * Interface for data storage backends * * @author Craig Cavanaugh */ public interface DataStore { /** * Close the engine instance if open */ void closeEngine(); /** * Create an engine instance connected to a remote server * * @param host host name or IP address * @param port connection port * @param password user password * @param engineName unique name to give the engine instance * @return Engine instance if a successful connection is made */ Engine getClientEngine(final String host, final int port, final char[] password, final String engineName); /** * Create an engine instance that uses a file * * @param fileName full path to the file * @param engineName unique name to give the engine instance * @param password user password * @return Engine instance. A new file will be created if it does not exist */ Engine getLocalEngine(final String fileName, final String engineName, final char[] password); /** * Returns the default file extension for this DataStore * * @return file extension */ @NotNull String getFileExt(); /** * Returns the full path to the file the DataStore is using. * * @return full path to the file, null if this is a remotely connected DataStore */ String getFileName(); /** * Returns this DataStores type * @return type of data store */ DataStoreType getType(); /** * Remote connection indicator * * @return true if connected to a remote server */ boolean isRemote(); /** * Saves a Collection of StoredObjects to a file other than what is currently open. * <p> * The currently open file will not be closed * * @param file full path to the file to save the database to * @param objects Collection of StoredObjects to save */ void saveAs(File file, Collection<StoredObject> objects); }
[ "jgnash.devel@gmail.com" ]
jgnash.devel@gmail.com
2adddb7def10ee4f4dc70075e48f5c9fe0e489a1
6e45b8e78474497d0c50caa06d9dfb0ca9aa69ab
/app/src/main/java/com/linjun/projectsend/ui/main/MainActivity.java
9f65fff27f38deb9970d425aed605d0cae81aac4
[]
no_license
linjunjj/ProjectSend
25aafc9ebe8ca2cac4c0eaad4816d8507280e7de
7ddb42db6ac04129bd847286d6a1c5b878d43ff5
refs/heads/master
2021-05-14T09:37:29.303799
2018-06-29T11:13:11
2018-06-29T11:13:11
116,331,635
1
0
null
null
null
null
UTF-8
Java
false
false
4,994
java
package com.linjun.projectsend.ui.main; import android.content.Intent; import android.os.Handler; import android.os.Message; import android.util.Log; import android.widget.Button; import android.widget.TextView; import com.amap.api.location.AMapLocationClient; import com.amap.api.location.AMapLocationClientOption; import com.linjun.SendPacket; import com.linjun.projectsend.R; import com.linjun.projectsend.config.Const; import com.linjun.projectsend.handler.HeartBeatInitializer; import com.linjun.projectsend.ui.base.BaseActivity; import com.txusballesteros.SnakeView; import java.net.InetSocketAddress; import butterknife.BindView; import butterknife.OnClick; import io.netty.bootstrap.Bootstrap; import io.netty.channel.Channel; import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelFutureListener; import io.netty.channel.ChannelOption; import io.netty.channel.nio.NioEventLoopGroup; import io.netty.channel.socket.nio.NioSocketChannel; public class MainActivity extends BaseActivity { @BindView(R.id.text) TextView text; @BindView(R.id.snake) SnakeView snake; @BindView(R.id.tv_result) TextView tvResult; @BindView(R.id.btn_start) Button btnStart; private NioEventLoopGroup group; private Channel channel; private ChannelFuture channelFuture; private AMapLocationClient locationClient = null; private AMapLocationClientOption locationOption = null; public static MyHandler handler; @Override protected int getLayoutId() { return R.layout.activity_main; } @Override protected void initView() { handler=new MyHandler(); } @Override protected void onDestroy() { super.onDestroy(); } @OnClick(R.id.btn_start) public void onViewClicked() { if (btnStart.getText().equals("开始")) { btnStart.setText("停止"); tvResult.setText("正在连接服务器"); connect(handler); tvResult.setText(""); tvResult.append("开始启动定位服务...\n"); Intent intet1 = new Intent(MainActivity.this, LocationService.class); startService(intet1); } else { btnStart.setText("开始"); tvResult.setText(tvResult.getText()+"停止定位...\n"); tvResult.setText(tvResult.getText()+"正在关闭服务\n"); Intent intet2 = new Intent(MainActivity.this, LocationService.class); stopService(intet2); tvResult.setText(tvResult.getText()+"关闭服务成功\n"); } } private void connect(final Handler handler) { new Thread() { @Override public void run() { try { group = new NioEventLoopGroup(); Bootstrap bootstrap = new Bootstrap(); bootstrap.group(group); bootstrap.channel(NioSocketChannel.class); bootstrap.handler(new HeartBeatInitializer(handler)); bootstrap.option(ChannelOption.SO_KEEPALIVE, true); bootstrap.option(ChannelOption.TCP_NODELAY, true); channelFuture = bootstrap.connect(new InetSocketAddress(Const.HOST, Const.TCP_PORT)); channel = channelFuture.sync().channel(); channelFuture.addListener(new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture channelFuture) throws Exception { handler.obtainMessage(0).sendToTarget(); } }); channel.closeFuture().sync(); } catch (Exception e) { group.shutdownGracefully(); e.printStackTrace(); } } }.start(); } class MyHandler extends Handler { @Override public void handleMessage(Message msg) { switch (msg.what) { case 0: String hello1 = new String("I'm in!"); SendPacket em1 = new SendPacket(); byte[] b1 = hello1.getBytes(); em1.setBytes(b1); em1.setSumCountPackage(b1.length); em1.setCountPackage(1); em1.setSend_time(System.currentTimeMillis()); channel.writeAndFlush(em1); break; case 1: Log.i("s", msg.obj.toString()); tvResult.setText(tvResult.getText()+msg.obj.toString()); break; case 2: Log.i("sww22ww", msg.obj.toString()); SendPacket em=(SendPacket) msg.obj; channel.writeAndFlush(em); break; case 3: break; } } } }
[ "1045735402@qq.com" ]
1045735402@qq.com
1b13fb7e9cd14395eb7d197b1460a2e010b2b8cb
8ce3daa1d0efa060a40916754f8af0e513e60de9
/src/main/java/org/geometrycommands/DimensionCommand.java
35758cfc07bfeacea32d489dac7528bec82f4f0e
[ "MIT" ]
permissive
mattmakesmaps/geometrycommands
d2c44957898310ec1570d356afdbc1fe36bb2cb9
9af8422c90ee30ba278b4c7ca22f38aa21e7a9bf
refs/heads/master
2021-01-16T22:57:03.706446
2015-07-09T20:36:38
2015-07-09T20:36:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,570
java
package org.geometrycommands; import com.vividsolutions.jts.geom.Geometry; import org.geometrycommands.DimensionCommand.DimensionOptions; import java.io.Reader; import java.io.Writer; /** * Get the dimension of the Geometry. * @author Jared Erickson */ public class DimensionCommand extends GeometryCommand<DimensionOptions> { /** * Get the name of the command * @return The name of the command */ @Override public String getName() { return "dimension"; } /** * Get the description of what the Command does * @return The description of what the Command does */ @Override public String getDescription() { return "Get the dimension of the Geometry."; } /** * Get a new GeometryOptions * @return A new GeometryOptions */ @Override public DimensionOptions getOptions() { return new DimensionOptions(); } /** * Calculate the area of a Geometry * @param geometry The Geometry * @param options The GeometryOptions * @param reader The java.io.Reader * @param writer The java.io.Writer * @throws Exception if an error occurs */ @Override protected void processGeometry(Geometry geometry, DimensionOptions options, Reader reader, Writer writer) throws Exception { double dimension = geometry.getDimension(); writer.write(String.valueOf(dimension)); } /** * The Options for the DimensionCommand */ public static class DimensionOptions extends GeometryOptions { } }
[ "jared.erickson@gmail.com" ]
jared.erickson@gmail.com
e73d6aad777d2b319f2501e8b6c5f15e2d0c11f9
f59e963c690e9e3826d6931ad04c6cc6a9497b1d
/SPRING CORE/IOCProj53-Traditional Dependency lookupWithAwareInjection/src/main/java/com/nt/beans/Vehicle.java
f69e0069fdd60f1e74361e697ed5550027f3abf3
[]
no_license
KalyanMaddala/Spring
afb1c06d41d14eed5599f4956019ca6bbf8b9a78
e2b8af120170b3f359a237356519f9b8f8e9f249
refs/heads/master
2022-12-30T03:41:03.539358
2020-08-13T06:39:50
2020-08-13T06:39:50
259,026,593
0
0
null
2020-10-14T00:15:14
2020-04-26T12:37:00
Java
UTF-8
Java
false
false
1,262
java
package com.nt.beans; import org.springframework.beans.BeansException; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; import org.springframework.context.support.ClassPathXmlApplicationContext; public class Vehicle implements ApplicationContextAware{ private String beanId; private ApplicationContext ctx; @Override public void setApplicationContext(ApplicationContext ctx) throws BeansException { System.out.println("Vehicle.setApplicationContext(-)"); this.ctx=ctx; } public Vehicle(String beanId) { System.out.println("Vehicle:: 1-param constructor"); this.beanId = beanId; } public void entertaiment() { System.out.println("Vehicle:: entertainment with DVD Player"); } public void soundHorn() { System.out.println("Vehicle:: SoundHorn with Skoda Horn"); } public void journey(String startPlace,String destPlace) { Engine engg=null; //get Dependent Bean class object (through Lookup) engg=ctx.getBean(beanId,Engine.class); engg.start(); System.out.println("Jounery started from the Place"+startPlace); System.out.println("Jounery is going on......"); engg.stop(); System.out.println("Jounery ended at the Place"+destPlace); } }
[ "kalyanmaddala24@gmail.com" ]
kalyanmaddala24@gmail.com
71e6c94f7b3dda6b950471a6570133b4d8781744
c444c305864c67fb5bac894da4e54c186c045cbe
/src/java2/map/Hashmap.java
38c5568f98be3bb9567ba9cb76ec094ebb944e61
[]
no_license
AaronX123/mashibing
fe0beb37f473c7f73489b9beb9ba25ce3d15879b
31981705746fbb18b0a004ccb0cd30fcf52eaabe
refs/heads/master
2023-04-14T07:52:18.198816
2021-04-18T14:15:26
2021-04-18T14:15:26
299,470,690
0
0
null
null
null
null
UTF-8
Java
false
false
1,064
java
package java2.map; import java.util.HashMap; import java.util.Map; public class Hashmap { static HashMap<Integer, Integer> map = new HashMap<>(); public static void main(String[] args) { for (int i = 0; i < 10; i++) { map.put(i,i); } for (int i = 0; i < 5; i++) { map.remove(i); } map.forEach((integer, integer2) -> System.out.println(integer + " val :" + integer2)); for (int i = 0; i < 100; i++) { map.put(i, i); } for (int i = 1; i < 100; i+=20) { Thread thread = new Thread(new Hashmap().new RemoveTask(i)); thread.start(); } map.forEach((integer, integer2) -> System.out.println(integer + " val :" + integer2)); } class RemoveTask implements Runnable { int id; public RemoveTask(int id) { this.id = id; } @Override public void run() { for (int i = id; i < id + 20; i++) { map.remove(i); } } } }
[ "739243573@qq.com" ]
739243573@qq.com
1f25a521deea5ab74ef590d3d69664d943306e7d
d2984ba2b5ff607687aac9c65ccefa1bd6e41ede
/src/net/datenwerke/rs/terminal/service/terminal/basecommands/HqlTerminalCommand.java
20720ecbd9d67a139302eb084f1b62092a9a8fa3
[]
no_license
bireports/ReportServer
da979eaf472b3e199e6fbd52b3031f0e819bff14
0f9b9dca75136c2bfc20aa611ebbc7dc24cfde62
refs/heads/master
2020-04-18T10:18:56.181123
2019-01-25T00:45:14
2019-01-25T00:45:14
167,463,795
0
0
null
null
null
null
UTF-8
Java
false
false
4,913
java
/* * ReportServer * Copyright (c) 2018 InfoFabrik GmbH * http://reportserver.net/ * * * This file is part of ReportServer. * * ReportServer is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package net.datenwerke.rs.terminal.service.terminal.basecommands; import java.util.ArrayList; import java.util.List; import javax.persistence.EntityManager; import javax.persistence.NoResultException; import net.datenwerke.rs.base.service.reportengines.table.output.object.RSStringTableRow; import net.datenwerke.rs.base.service.reportengines.table.output.object.RSTableModel; import net.datenwerke.rs.terminal.service.terminal.TerminalSession; import net.datenwerke.rs.terminal.service.terminal.helpers.AutocompleteHelper; import net.datenwerke.rs.terminal.service.terminal.helpers.CommandParser; import net.datenwerke.rs.terminal.service.terminal.helpmessenger.annotations.Argument; import net.datenwerke.rs.terminal.service.terminal.helpmessenger.annotations.CliHelpMessage; import net.datenwerke.rs.terminal.service.terminal.helpmessenger.annotations.NonOptArgument; import net.datenwerke.rs.terminal.service.terminal.hooks.TerminalCommandHook; import net.datenwerke.rs.terminal.service.terminal.locale.TerminalMessages; import net.datenwerke.rs.terminal.service.terminal.obj.CommandResult; import net.datenwerke.rs.terminal.service.terminal.obj.CommandResultList; import net.datenwerke.rs.terminal.service.terminal.obj.DisplayMode; import net.datenwerke.rs.utils.jpa.EntityUtils; import org.apache.commons.lang.StringUtils; import com.google.inject.Inject; import com.google.inject.Provider; public class HqlTerminalCommand implements TerminalCommandHook { public static final String BASE_COMMAND = "hql"; private final Provider<EntityManager> entityManagerProvider; private final EntityUtils entityUtils; @Inject public HqlTerminalCommand( Provider<EntityManager> entityManagerProvider, EntityUtils entityUtils ){ /* store objects */ this.entityManagerProvider = entityManagerProvider; this.entityUtils = entityUtils; } @Override public boolean consumes(CommandParser parser, TerminalSession session) { return BASE_COMMAND.equals(parser.getBaseCommand()); } @CliHelpMessage( messageClass = TerminalMessages.class, name = BASE_COMMAND, description = "commandHql_description", args = { @Argument(flag="w", description="commandHql_wFlag") }, nonOptArgs = { @NonOptArgument(name="query", description="commandHql_hqlArgument") } ) @Override public CommandResult execute(CommandParser parser, TerminalSession session) { String arg = StringUtils.join(parser.getNonOptionArguments(), " "); try{ /* execute query */ List resultList = entityManagerProvider.get().createQuery(arg).getResultList(); /* prepare result */ CommandResult result = new CommandResult(); /* simple result */ if(! resultList.isEmpty() && entityUtils.isEntity(resultList.get(0))){ if(resultList.get(0) instanceof Object[]){ RSTableModel table = new RSTableModel(); for(Object objArr : resultList){ List<String> row = new ArrayList<String>(); for(Object obj : (Object[])objArr){ if(null != obj) row.add(obj.toString()); else row.add("null"); } table.addDataRow(new RSStringTableRow(row)); } result.addResultTable(table); } else { List<String> stringResults = new ArrayList<String>(); for(Object obj : resultList) stringResults.add(null == obj ? "NULL" : obj.toString()); CommandResultList entryList = new CommandResultList(stringResults); entryList.setDenyBreakUp(true); result.addEntry(entryList); } } if(parser.hasOption("w")) result.setDisplayMode(DisplayMode.WINDOW); return result; } catch(NoResultException e){ return new CommandResult("No result found"); } catch(Exception e){ return new CommandResult("Could not execute query: " + e.getMessage()); } } @Override public void addAutoCompletEntries(AutocompleteHelper autocompleteHelper, TerminalSession session) { autocompleteHelper.autocompleteBaseCommand(BASE_COMMAND); } }
[ "srbala@gmail.com" ]
srbala@gmail.com
e30803dc3cd7483acc046467ea3da12bfab12be2
59ae6802f2335082399e6d43e81018313b20b8a9
/EventInfo/src/com/event/domain/Review.java
c3a8dcc898d3cf82b6abc43d604896bf03b19220
[]
no_license
BeomjunLee/eventInfoServiceWebJsp
fa37f92a1f8152ebc370a4c2e52b156df8f51320
9a8eedd53d8358405d2842e8643e2de5451debec
refs/heads/main
2023-03-20T13:19:45.171612
2021-03-11T19:38:33
2021-03-11T19:38:33
309,289,492
1
0
null
null
null
null
UHC
Java
false
false
1,731
java
package com.event.domain; public class Review { private Long review_uid; private Long member_uid; private String writer; private String category; private String title; private String content; private String img; private int view_count; private String regdate; protected Review() {} //그냥 생성불가 //setter를 쓰지않기 위해 생성자로 set public Review(Long review_uid, Long member_uid, String writer, String category, String title, String content, String img, int view_count, String regdate) { this.review_uid = review_uid; this.member_uid = member_uid; this.writer = writer; this.category = category; this.title = title; this.content = content; this.img = img; this.view_count = view_count; this.regdate = regdate; } //수정을 위한 생성자 public Review(Long review_uid, Long member_uid, String title, String content, String img) { this.review_uid = review_uid; this.member_uid = member_uid; this.title = title; this.content = content; this.img = img; } public Long getReview_uid() { return review_uid; } public String getCategory() { return category; } public Long getMember_uid() { return member_uid; } public String getTitle() { return title; } public String getContent() { return content; } public String getImg() { return img; } public int getView_count() { return view_count; } public String getRegdate() { return regdate; } public String getWriter() { return writer; } @Override public String toString() { return "[리뷰글 ]" + review_uid + "|" + "|" + member_uid + "|" + writer+ "|" + category + "|" + title + "|" + content + "|" + img + "|" + view_count + "|" + regdate; } }
[ "qjawnswkd0717@gmail.com" ]
qjawnswkd0717@gmail.com
d5fb8012eea41da1bb36c6515430d73b937fdd77
54c2ba8bcede572abae27886fe7a599215030924
/src/main/java/com/jd/open/api/sdk/response/ware/BookEntity.java
14349689e786f5cebddbceaaa4bd55624a459202
[]
no_license
pingjiang/jd-open-api-sdk-src
4c8bcc1e139657c0b6512126e9408cc71873ee30
0d82d3a14fb7f931a4a1e25dc18fb2f1cfaadd81
refs/heads/master
2021-01-01T17:57:04.734329
2014-06-26T03:49:36
2014-06-26T03:49:36
21,227,086
17
15
null
null
null
null
UTF-8
Java
false
false
804
java
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.kpdus.com/jad.html // Decompiler options: packimports(3) // Source File Name: BookEntity.java package com.jd.open.api.sdk.response.ware; import java.io.Serializable; // Referenced classes of package com.jd.open.api.sdk.response.ware: // BookInfo public class BookEntity implements Serializable { public BookEntity() { } public void setSkuId(Integer skuId) { this.skuId = skuId; } public Integer getSkuId() { return skuId; } public void setBookInfo(BookInfo bookInfo) { this.bookInfo = bookInfo; } public BookInfo getBookInfo() { return bookInfo; } private Integer skuId; private BookInfo bookInfo; }
[ "pingjiang1989@gmail.com" ]
pingjiang1989@gmail.com
0ae994305a29430120ef5a626b9391243c770bd6
99e267dfdc08bfd956bcc62421265eacf291480e
/newWish/src/exception/throwexception.java
2a104db3b059a83e3bb41cf701df52eb79d0515a
[]
no_license
agarwalmohit43/Java-Practice
70906101ebe31a003a3401500114303c6fa847df
73b305da3f6777a036fc11e19b689f09d29374bf
refs/heads/master
2021-01-19T16:45:53.028435
2017-09-12T12:11:41
2017-09-12T12:11:41
101,024,586
0
0
null
null
null
null
UTF-8
Java
false
false
324
java
package exception; public class throwexception { public static void main(String[] args) { validate(17); System.out.println("Rest of the code"); } private static void validate(int i) { if(i<18){ throw new ArithmeticException("Under Age"); }else{ System.out.println("Cool ready to vote"); } } }
[ "agarwalmohit43@gmail.com" ]
agarwalmohit43@gmail.com
8df85129682b4da3f16133fc4e87693d4e12f1e9
014e3dc945a34defa2643a4f1bd9a3bfd2b2eec6
/org.dbdoclet.trafo.html.docbook/src/main/java/org/dbdoclet/trafo/html/docbook/editor/SmallEditor.java
41c131ce145da27f546221a5d9cda82db5490445
[]
no_license
mfuchs23/trafo
584798993623374c448078984e687918b5a76091
703251e410c95c611d40146621f00adf774a606e
refs/heads/master
2023-06-22T19:16:08.726025
2023-06-07T10:52:33
2023-06-07T10:52:33
22,428,272
0
2
null
null
null
null
UTF-8
Java
false
false
586
java
/* * ### Copyright (C) 2008 Michael Fuchs ### * ### All Rights Reserved. ### * * Author: Michael Fuchs * E-Mail: michael.fuchs@dbdoclet.org * URL: http://www.michael-a-fuchs.de */ package org.dbdoclet.trafo.html.docbook.editor; import org.dbdoclet.trafo.html.EditorException; import org.dbdoclet.trafo.html.EditorInstruction; public class SmallEditor extends DocBookEditor { @Override public EditorInstruction edit(EditorInstruction values) throws EditorException { setValues(super.edit(values)); traverse(true); return finalizeValues(); } }
[ "michael.fuchs@dbdoclet.org" ]
michael.fuchs@dbdoclet.org
c51451dcff4c5c2074a0a4b2422ce1a5f0645a88
abab9fd522aeec4875464ca6f53eee072a1b04d2
/memory-backend/src/test/java/de/bwaldvogel/mongo/backend/memory/MemoryOplogTest.java
f4eecd2ce38fd28710b9cc50f054edea8a5b7bd7
[ "BSD-3-Clause" ]
permissive
esimionato/mongo-java-server
c5c8c003e9da3aa2af81d799b023c5242421957e
862add08605de6cf1a2c725ce10ef7385287add0
refs/heads/master
2022-05-27T21:09:26.770980
2020-05-03T12:17:39
2020-05-03T12:17:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
303
java
package de.bwaldvogel.mongo.backend.memory; import de.bwaldvogel.mongo.MongoBackend; import de.bwaldvogel.mongo.backend.AbstractOplogTest; public class MemoryOplogTest extends AbstractOplogTest { @Override protected MongoBackend createBackend() { return new MemoryBackend(); } }
[ "mail@bwaldvogel.de" ]
mail@bwaldvogel.de
516c00b831515e27b0a6968490aa320032d4227f
208ba847cec642cdf7b77cff26bdc4f30a97e795
/aj/ae/src/main/java/org.wp.ae/ui/posts/adapters/PageMenuAdapter.java
ed561a60cf4a1facef54bd1659a9f3b5c258dab2
[]
no_license
kageiit/perf-android-large
ec7c291de9cde2f813ed6573f706a8593be7ac88
2cbd6e74837a14ae87c1c4d1d62ac3c35df9e6f8
refs/heads/master
2021-01-12T14:00:19.468063
2016-09-27T13:10:42
2016-09-27T13:10:42
69,685,305
0
0
null
2016-09-30T16:59:49
2016-09-30T16:59:48
null
UTF-8
Java
false
false
2,970
java
package org.wp.ae.ui.posts.adapters; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.ImageView; import android.widget.TextView; import org.wp.ae.R; import org.wp.ae.models.PostStatus; import org.wp.ae.models.PostsListPost; import org.wp.ae.widgets.PostListButton; import java.util.ArrayList; import java.util.List; /* * adapter for the popup menu that appears when clicking "..." in the pages list - each item * in the menu item array is an integer that matches a specific PostListButton button type */ public class PageMenuAdapter extends BaseAdapter { private final LayoutInflater mInflater; private final List<Integer> mMenuItems = new ArrayList<>(); public PageMenuAdapter(Context context, PostsListPost page) { super(); mInflater = LayoutInflater.from(context); boolean showViewItem = !page.isLocalDraft() && page.getStatusEnum() == PostStatus.PUBLISHED; boolean showStatsItem = !page.isLocalDraft() && page.getStatusEnum() == PostStatus.PUBLISHED; boolean showTrashItem = !page.isLocalDraft(); boolean showDeleteItem = !showTrashItem; // edit item always appears mMenuItems.add(PostListButton.BUTTON_EDIT); if (showViewItem) { mMenuItems.add(PostListButton.BUTTON_VIEW); } if (showStatsItem) { mMenuItems.add(PostListButton.BUTTON_STATS); } if (showTrashItem) { mMenuItems.add(PostListButton.BUTTON_TRASH); } if (showDeleteItem) { mMenuItems.add(PostListButton.BUTTON_DELETE); } } @Override public int getCount() { return mMenuItems.size(); } @Override public Object getItem(int position) { return mMenuItems.get(position); } @Override public long getItemId(int position) { return mMenuItems.get(position); } @Override public View getView(int position, View convertView, ViewGroup parent) { PageMenuHolder holder; if (convertView == null) { convertView = mInflater.inflate(R.layout.popup_menu_item, parent, false); holder = new PageMenuHolder(convertView); convertView.setTag(holder); } else { holder = (PageMenuHolder) convertView.getTag(); } int buttonType = mMenuItems.get(position); holder.text.setText(PostListButton.getButtonTextResId(buttonType)); holder.icon.setImageResource(PostListButton.getButtonIconResId(buttonType)); return convertView; } class PageMenuHolder { private final TextView text; private final ImageView icon; PageMenuHolder(View view) { text = (TextView) view.findViewById(R.id.text); icon = (ImageView) view.findViewById(R.id.image); } } }
[ "cedric.champeau@gmail.com" ]
cedric.champeau@gmail.com
4623d769074cea285db0a2b0fb0cf784522031b5
7447f3599a9d0f7d430b7402dde6dadbbfc0aba0
/yazuo/yazuo_erp/.svn/pristine/46/4623d769074cea285db0a2b0fb0cf784522031b5.svn-base
3a92f767970a7c6d7c3759b882d61af079e219a0
[]
no_license
liveqmock/workspace
43d5ad79fc0f0675412829d9015cf68255f9d891
c1da6eab74047cd612b1b3b1046c8fa03c5809fb
refs/heads/master
2020-04-02T01:11:11.800539
2015-04-13T02:55:46
2015-04-13T02:55:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
409
package com.yazuo.erp.syn.exception; public class SynBizException extends SynException { private static final long serialVersionUID = -1570712942286005556L; public SynBizException() { } public SynBizException(String message) { super(message); } public SynBizException(String message, Throwable cause) { super(message, cause); } public SynBizException(Throwable cause) { super(cause); } }
[ "root@slave-01.(none)" ]
root@slave-01.(none)
bb49ca82b89a9f907904074bc5f26eeba8ad7fc6
10c96edfa12e1a7eef1caf3ad1d0e2cdc413ca6f
/src/main/resources/projs/Collection_4.1_parent/src/main/java/org/apache/commons/collections4/functors/InstantiateTransformer.java
7fabe0fee67a9aff88cbb417358714ce8d94a965
[ "Apache-2.0" ]
permissive
Gu-Youngfeng/EfficiencyMiner
c17c574e41feac44cc0f483135d98291139cda5c
48fb567015088f6e48dfb964a4c63f2a316e45d4
refs/heads/master
2020-03-19T10:06:33.362993
2018-08-01T01:17:40
2018-08-01T01:17:40
136,343,802
0
0
Apache-2.0
2018-08-01T01:17:41
2018-06-06T14:51:55
Java
UTF-8
Java
false
false
5,289
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.commons.collections4.functors; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import org.apache.commons.collections4.FunctorException; import org.apache.commons.collections4.Transformer; /** * Transformer implementation that creates a new object instance by reflection. * <p> * <b>WARNING:</b> from v4.1 onwards this class will <b>not</b> be serializable anymore * in order to prevent potential remote code execution exploits. Please refer to * <a href="https://issues.apache.org/jira/browse/COLLECTIONS-580">COLLECTIONS-580</a> * for more details. * * @since 3.0 * @version $Id: InstantiateTransformer.java 1714262 2015-11-13 20:08:45Z tn $ */ public class InstantiateTransformer<T> implements Transformer<Class<? extends T>, T> { /** Singleton instance that uses the no arg constructor */ @SuppressWarnings("rawtypes") private static final Transformer NO_ARG_INSTANCE = new InstantiateTransformer<Object>(); /** The constructor parameter types */ private final Class<?>[] iParamTypes; /** The constructor arguments */ private final Object[] iArgs; /** * Get a typed no-arg instance. * * @param <T> the type of the objects to be created * @return Transformer<Class<? extends T>, T> */ @SuppressWarnings("unchecked") public static <T> Transformer<Class<? extends T>, T> instantiateTransformer() { return NO_ARG_INSTANCE; } /** * Transformer method that performs validation. * * @param <T> the type of the objects to be created * @param paramTypes the constructor parameter types * @param args the constructor arguments * @return an instantiate transformer * @throws IllegalArgumentException if paramTypes does not match args */ public static <T> Transformer<Class<? extends T>, T> instantiateTransformer(final Class<?>[] paramTypes, final Object[] args) { if (((paramTypes == null) && (args != null)) || ((paramTypes != null) && (args == null)) || ((paramTypes != null) && (args != null) && (paramTypes.length != args.length))) { throw new IllegalArgumentException("Parameter types must match the arguments"); } if (paramTypes == null || paramTypes.length == 0) { return new InstantiateTransformer<T>(); } return new InstantiateTransformer<T>(paramTypes, args); } /** * Constructor for no arg instance. */ private InstantiateTransformer() { super(); iParamTypes = null; iArgs = null; } /** * Constructor that performs no validation. * Use <code>instantiateTransformer</code> if you want that. * <p> * Note: from 4.0, the input parameters will be cloned * * @param paramTypes the constructor parameter types * @param args the constructor arguments */ public InstantiateTransformer(final Class<?>[] paramTypes, final Object[] args) { super(); iParamTypes = paramTypes != null ? paramTypes.clone() : null; iArgs = args != null ? args.clone() : null; } /** * Transforms the input Class object to a result by instantiation. * * @param input the input object to transform * @return the transformed result */ @Override public T transform(final Class<? extends T> input) { try { if (input == null) { throw new FunctorException( "InstantiateTransformer: Input object was not an instanceof Class, it was a null object"); } final Constructor<? extends T> con = input.getConstructor(iParamTypes); return con.newInstance(iArgs); } catch (final NoSuchMethodException ex) { throw new FunctorException("InstantiateTransformer: The constructor must exist and be public "); } catch (final InstantiationException ex) { throw new FunctorException("InstantiateTransformer: InstantiationException", ex); } catch (final IllegalAccessException ex) { throw new FunctorException("InstantiateTransformer: Constructor must be public", ex); } catch (final InvocationTargetException ex) { throw new FunctorException("InstantiateTransformer: Constructor threw an exception", ex); } } }
[ "yongfeng_gu@163.com" ]
yongfeng_gu@163.com
e8ef294396716252585d6648b81f2e857372feae
7559bead0c8a6ad16f016094ea821a62df31348a
/src/com/vmware/vim25/HostDateTimeConfig.java
fe511a301b2726db1e59956264ec3ec3121741b3
[]
no_license
ZhaoxuepengS/VsphereTest
09ba2af6f0a02d673feb9579daf14e82b7317c36
59ddb972ce666534bf58d84322d8547ad3493b6e
refs/heads/master
2021-07-21T13:03:32.346381
2017-11-01T12:30:18
2017-11-01T12:30:18
109,128,993
1
1
null
null
null
null
UTF-8
Java
false
false
2,013
java
package com.vmware.vim25; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for HostDateTimeConfig complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="HostDateTimeConfig"> * &lt;complexContent> * &lt;extension base="{urn:vim25}DynamicData"> * &lt;sequence> * &lt;element name="timeZone" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="ntpConfig" type="{urn:vim25}HostNtpConfig" minOccurs="0"/> * &lt;/sequence> * &lt;/extension> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "HostDateTimeConfig", propOrder = { "timeZone", "ntpConfig" }) public class HostDateTimeConfig extends DynamicData { protected String timeZone; protected HostNtpConfig ntpConfig; /** * Gets the value of the timeZone property. * * @return * possible object is * {@link String } * */ public String getTimeZone() { return timeZone; } /** * Sets the value of the timeZone property. * * @param value * allowed object is * {@link String } * */ public void setTimeZone(String value) { this.timeZone = value; } /** * Gets the value of the ntpConfig property. * * @return * possible object is * {@link HostNtpConfig } * */ public HostNtpConfig getNtpConfig() { return ntpConfig; } /** * Sets the value of the ntpConfig property. * * @param value * allowed object is * {@link HostNtpConfig } * */ public void setNtpConfig(HostNtpConfig value) { this.ntpConfig = value; } }
[ "495149700@qq.com" ]
495149700@qq.com
7c6ef6cd2a032272c780f89ac9b309682b9372cd
8befbe71eb0542d001ead2b0a4f42e8b96f9869c
/zuihou-backend/zuihou-authority/zuihou-authority-biz/src/main/java/com/github/zuihou/authority/service/common/OptLogService.java
f1d158aff2a8cbabb65c0341b2d70187818bea21
[ "Apache-2.0" ]
permissive
LxzLLL/zuihou-admin-cloud
b0933558837d2037311a5913a3abd073863e88a4
15c88be86e1e07d1b2882f1e995080d34e26711a
refs/heads/master
2020-06-16T10:54:05.945943
2019-07-05T08:13:01
2019-07-05T08:13:01
null
0
0
null
null
null
null
UTF-8
Java
false
false
328
java
package com.github.zuihou.authority.service.common; import com.baomidou.mybatisplus.extension.service.IService; import com.github.zuihou.authority.entity.common.OptLog; /** * <p> * 业务接口 * 系统日志 * </p> * * @author zuihou * @date 2019-07-02 */ public interface OptLogService extends IService<OptLog> { }
[ "244387066@qq.com" ]
244387066@qq.com
e46f50b011979b17bf6a425650d5fc052a9ef770
83dbd433aeed1f15f6501f39fe152abc0dc803d9
/roncoo_study/roncoo_book_shop/shop_db/src/main/java/com/bd/roncoo/book/shop/db/domain/Category.java
6453f055e272807679b8a7f553d7bc2834473988
[]
no_license
pylrichard/web_service_study
d0d42ea0c511b9b15a235a99cde5b4b025c33c6d
c1bd8753c6aee69c87707db7f3fb8e0d7f5ddbc0
refs/heads/master
2021-09-14T23:31:12.454640
2018-05-22T06:26:14
2018-05-22T06:26:14
104,879,563
1
0
null
null
null
null
UTF-8
Java
false
false
1,819
java
package com.bd.roncoo.book.shop.db.domain; import lombok.Getter; import lombok.Setter; import javax.persistence.*; import java.awt.print.Book; import java.util.List; /** * 注解@Table(name = "bs_category")添加前缀,生成新表 * 具体类的配置会覆盖applicaton.properties的全局配置spring.jpa.hibernate.naming.implicit-strategy,需要去掉 * 注解@Entity表示将Category映射为数据库中的一张表 * 在application.properties中添加spring.jpa.generate-ddl=true才会在数据库中生成对应的表 */ @Entity @Getter @Setter public class Category extends DomainImpl { /** * 没有添加注解,默认添加@Basic * String在表中转换为VARCHAR */ @Basic //@Column(name = "bs_name", length = 10, nullable = false(非空), unique = true(唯一)) @Column(length = 10, nullable = false, unique = true) private String name; /** * 存储计算得到的中间值,不需要在表中生成对应的字段 */ @Transient private String tmp; /** * 生成bs_bs_category_bs_book表实现单向一对多关系,推荐建立双向关系,方便通过get()获取数据 * mappedBy表示由Book对象的category变量来实现双向关系,Category对象不管理 * orphanRemoval表示集合中元素被移除后是否从DB删除 * 比如books有5本书,执行books.remove(1)移除1本书,这本书不属于任何一个Category,是否从DB删除相应的Book记录 * true表示删除,默认为false * cascade表示级联操作,默认为空,不进行删除 * 比如cascade = CascadeType.REMOVE表示删除Category对象记录时会删除相应的Book对象记录 * 有外键时删除会报错 */ @OneToMany(mappedBy = "category") private List<Book> books; }
[ "pylrichard@qq.com" ]
pylrichard@qq.com
c7e9d20bd33d78c3f120b7f5b55944ab5b12082b
e93b2485aace8e2211fef98d597dc13ed484ef85
/custom/src/main/java/com/springcloud/custom/service/ColorService.java
8e4170fc1173829147bd9821b719461784a5650e
[]
no_license
fuLinHu/springcloudAll
cdb4583e6a696533bb522efdf26e106c80981e49
f7f9314f1738581d605f084dece692eb7229e8f2
refs/heads/master
2020-03-30T01:48:07.047061
2018-09-27T14:18:49
2018-09-27T14:18:49
150,595,797
0
0
null
null
null
null
UTF-8
Java
false
false
200
java
package com.springcloud.custom.service; public interface ColorService { public String getRed(String color); public String getYellow(String color); public String getGreen(String color); }
[ "1205668006@qq.com" ]
1205668006@qq.com
f5793c171fb93c38ed00afeaaeb1699015b6b817
005553bcc8991ccf055f15dcbee3c80926613b7f
/generated/pcftest/OtherServicesLVInputSet.java
1674a528657a1710616e0f17574377ca8fdf278a
[]
no_license
azanaera/toggle-isbtf
5f14209cd87b98c123fad9af060efbbee1640043
faf991ec3db2fd1d126bc9b6be1422b819f6cdc8
refs/heads/master
2023-01-06T22:20:03.493096
2020-11-16T07:04:56
2020-11-16T07:04:56
313,212,938
0
0
null
2020-11-16T08:48:41
2020-11-16T06:42:23
null
UTF-8
Java
false
false
3,872
java
package pcftest; import gw.lang.SimplePropertyProcessing; import gw.smoketest.platform.web.ClickableActionElement; import gw.smoketest.platform.web.PCFElement; import gw.smoketest.platform.web.PCFElementId; import gw.smoketest.platform.web.PCFLocation; import gw.testharness.ISmokeTest; import javax.annotation.processing.Generated; import pcftest.OtherServicesLVInputSet.OtherServicesLV_tb; import pcftest.OtherServicesLVInputSet.OtherServicesLV_tb.Add; import pcftest.OtherServicesLVInputSet.OtherServicesLV_tb.AddServiceRequest; import pcftest.OtherServicesLVInputSet.OtherServicesLV_tb.Remove; @SimplePropertyProcessing @Generated(comments = "config/web/pcf/claim/FNOL/OtherServicesLVInputSet.pcf", date = "", value = "com.guidewire.pcfgen.PCFClassGenerator") public class OtherServicesLVInputSet extends PCFElement { public final static String CHECKSUM = "173ac21bf96582e231d2e37bc7de46e2"; public OtherServicesLVInputSet(ISmokeTest helper, PCFElementId componentId) { super(helper, componentId); } public OtherServicesLV getOtherServicesLV() { return getOrCreateProperty("OtherServicesLV", "OtherServicesLV", gw.smoketest.platform.web.PCFElementId.PCFElementScope.ListView, pcftest.OtherServicesLV.class); } public OtherServicesLV_tb getOtherServicesLV_tb() { return getOrCreateProperty("OtherServicesLV_tb", "OtherServicesLV_tb", null, pcftest.OtherServicesLVInputSet.OtherServicesLV_tb.class); } @SimplePropertyProcessing @Generated(comments = "config/web/pcf/claim/FNOL/OtherServicesLVInputSet.pcf", date = "", value = "com.guidewire.pcfgen.PCFClassGenerator") public static class OtherServicesLV_tb extends PCFElement { public OtherServicesLV_tb(ISmokeTest helper, PCFElementId componentId) { super(helper, componentId); } public Add getAdd() { return getOrCreateProperty("Add", "Add", null, pcftest.OtherServicesLVInputSet.OtherServicesLV_tb.Add.class); } public AddServiceRequest getAddServiceRequest() { return getOrCreateProperty("AddServiceRequest", "AddServiceRequest", null, pcftest.OtherServicesLVInputSet.OtherServicesLV_tb.AddServiceRequest.class); } public Remove getRemove() { return getOrCreateProperty("Remove", "Remove", null, pcftest.OtherServicesLVInputSet.OtherServicesLV_tb.Remove.class); } @SimplePropertyProcessing @Generated(comments = "config/web/pcf/claim/FNOL/OtherServicesLVInputSet.pcf", date = "", value = "com.guidewire.pcfgen.PCFClassGenerator") public static class Add extends ClickableActionElement { public Add(ISmokeTest helper, PCFElementId componentId) { super(helper, componentId); } public PCFLocation click() { return clickThis(gw.smoketest.platform.web.PCFLocation.class); } } @SimplePropertyProcessing @Generated(comments = "config/web/pcf/claim/FNOL/OtherServicesLVInputSet.pcf", date = "", value = "com.guidewire.pcfgen.PCFClassGenerator") public static class AddServiceRequest extends ClickableActionElement { public AddServiceRequest(ISmokeTest helper, PCFElementId componentId) { super(helper, componentId); } public OtherServiceRequestPopup click() { return clickThis(pcftest.OtherServiceRequestPopup.class); } } @SimplePropertyProcessing @Generated(comments = "config/web/pcf/claim/FNOL/OtherServicesLVInputSet.pcf", date = "", value = "com.guidewire.pcfgen.PCFClassGenerator") public static class Remove extends ClickableActionElement { public Remove(ISmokeTest helper, PCFElementId componentId) { super(helper, componentId); } public PCFLocation click() { return clickThis(gw.smoketest.platform.web.PCFLocation.class); } } } }
[ "azanaera691@gmail.com" ]
azanaera691@gmail.com
9beb781d0863c02c9714ede7c2c652c29e39fd36
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/18/18_349e831416d7c911a3a225787e200a0dbd42d7e6/IToolkitOverlay/18_349e831416d7c911a3a225787e200a0dbd42d7e6_IToolkitOverlay_s.java
d370c0eab0c6c61b5673bb76b29a05df53b93d11
[]
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,184
java
/* @ITMillApache2LicenseForJavaFiles@ */ package com.itmill.toolkit.terminal.gwt.client.ui; import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.Element; import com.google.gwt.user.client.ui.HTML; import com.google.gwt.user.client.ui.PopupListener; import com.google.gwt.user.client.ui.PopupPanel; import com.google.gwt.user.client.ui.RootPanel; import com.itmill.toolkit.terminal.gwt.client.BrowserInfo; /** * In Toolkit UI this Overlay should always be used for all elements that * temporary float over other components like context menus etc. This is to deal * stacking order correctly with IWindow objects. */ public class IToolkitOverlay extends PopupPanel { public static final int Z_INDEX = 20000; private Shadow shadow; public IToolkitOverlay() { super(); adjustZIndex(); } public IToolkitOverlay(boolean autoHide) { super(autoHide); adjustZIndex(); } public IToolkitOverlay(boolean autoHide, boolean modal) { super(autoHide, modal); adjustZIndex(); } public IToolkitOverlay(boolean autoHide, boolean modal, boolean showShadow) { super(autoHide, modal); if (showShadow) { shadow = new Shadow(); } adjustZIndex(); } private void adjustZIndex() { DOM.setStyleAttribute(getElement(), "zIndex", "" + Z_INDEX); } public void setPopupPosition(int left, int top) { super.setPopupPosition(left, top); if (shadow != null) { shadow.updateSizeAndPosition(); } } public void show() { super.show(); if (shadow != null) { DOM.appendChild(RootPanel.get().getElement(), shadow.getElement()); shadow.updateSizeAndPosition(); } if (BrowserInfo.get().isIE6()) { adjustIE6Frame(getElement(), Z_INDEX - 1); } } private native void adjustIE6Frame(Element popup, int zindex) /*-{ // relies on PopupImplIE6 popup.__frame.style.zIndex = zindex; }-*/; public void setShadowOffset(int top, int right, int bottom, int left) { if (shadow != null) { shadow.setOffset(top, right, bottom, left); } } private class Shadow extends HTML { private static final String CLASSNAME = "i-shadow"; private static final String HTML = "<div class=\"top-left\"></div><div class=\"top\"></div><div class=\"top-right\"></div><div class=\"left\"></div><div class=\"center\"></div><div class=\"right\"></div><div class=\"bottom-left\"></div><div class=\"bottom\"></div><div class=\"bottom-right\"></div>"; // Amount of shadow on each side. private int top = 2; private int right = 5; private int bottom = 6; private int left = 5; public Shadow() { super(HTML); setStyleName(CLASSNAME); DOM.setStyleAttribute(getElement(), "position", "absolute"); addPopupListener(new PopupListener() { public void onPopupClosed(PopupPanel sender, boolean autoClosed) { DOM.removeChild(RootPanel.get().getElement(), shadow .getElement()); } }); } public void updateSizeAndPosition() { // Calculate proper z-index String zIndex = DOM.getStyleAttribute(IToolkitOverlay.this .getElement(), "zIndex"); if (zIndex == null) { zIndex = "" + Z_INDEX; } // Calculate position and size if (BrowserInfo.get().isIE()) { // Shake IE IToolkitOverlay.this.getOffsetHeight(); IToolkitOverlay.this.getOffsetWidth(); } int x = IToolkitOverlay.this.getAbsoluteLeft() - left; int y = IToolkitOverlay.this.getAbsoluteTop() - top; int width = IToolkitOverlay.this.getOffsetWidth() + left + right; int height = IToolkitOverlay.this.getOffsetHeight() + top + bottom; if (width < 0) { width = 0; } if (height < 0) { height = 0; } // Update correct values DOM.setStyleAttribute(shadow.getElement(), "zIndex", "" + (Integer.parseInt(zIndex) - 1)); DOM.setStyleAttribute(getElement(), "width", width + "px"); DOM.setStyleAttribute(getElement(), "height", height + "px"); DOM.setStyleAttribute(getElement(), "top", y + "px"); DOM.setStyleAttribute(getElement(), "left", x + "px"); } public void setOffset(int top, int right, int bottom, int left) { this.top = top; this.right = right; this.bottom = bottom; this.left = left; if (IToolkitOverlay.this.isAttached()) { updateSizeAndPosition(); } } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
3bb1ee25389baa7654460993cecffbf05558020d
cc8a1bf03bc8ef0cb72b73058b93db0b05f28dcb
/src/AdminLogin.java
029789d8c3f1d94b0a4a4e39960f2187faa821c1
[]
no_license
viktrine/JobCard
f9677d4724a542cce5e9ec29d5aa0361b8f456f3
36be449468f84f70d65a8d7c7d295df69afa3fa3
refs/heads/master
2020-03-20T21:44:23.404700
2018-08-15T07:11:05
2018-08-15T07:11:05
137,757,360
0
0
null
null
null
null
UTF-8
Java
false
false
1,564
java
import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * Servlet implementation class AdminLogin */ @WebServlet("/AdminLogin") public class AdminLogin extends HttpServlet { private static final long serialVersionUID = 1L; /** * @see HttpServlet#HttpServlet() */ public AdminLogin() { super(); // TODO Auto-generated constructor stub } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); Methods methods = new Methods(); String useremail = request.getParameter("useremail"); String password = request.getParameter("password"); if ((useremail == null || useremail.isEmpty()) || (password == null || password.isEmpty())) { request.getSession().setAttribute("nullError", "Please enter your email and password"); response.sendRedirect(request.getHeader("Referer")); } else { int adminLog = methods.Admin_login("/jobcard/homeadmin.jsp", "/jobcard/adminChangePass.jsp", useremail, password, request, response); request.getSession(true).setAttribute("adminLog", adminLog); methods.getAdminDetails(adminLog, request, response); } } }
[ "root@localhost.localdomain" ]
root@localhost.localdomain
afe9195bc8233debaa606a45928822dc06a5e7e8
8979fc82ea7b34410b935fbea0151977a0d46439
/src/all_problems/P1269_NumberOfWaysToStayInTheSamePlaceAfterSomeSteps.java
63d6b233637c50eac3038c242a3b6c723034bc11
[ "MIT" ]
permissive
YC-S/LeetCode
6fa3f4e46c952b3c6bf5462a8ee0c1186ee792bd
452bb10e45de53217bca52f8c81b3034316ffc1b
refs/heads/master
2021-11-06T20:51:31.554936
2021-10-31T03:39:38
2021-10-31T03:39:38
235,529,949
1
0
null
null
null
null
UTF-8
Java
false
false
551
java
package all_problems; public class P1269_NumberOfWaysToStayInTheSamePlaceAfterSomeSteps { public int numWays(int steps, int arrLen) { int maxPos = Math.min(steps, arrLen); long[][] dp = new long[steps + 1][maxPos + 1]; dp[1][0] = 1; dp[1][1] = 1; for (int i = 2; i <= steps; i++) { for (int j = 0; j < maxPos; j++) { dp[i][j] = (dp[i - 1][j] + dp[i - 1][j + 1] + (j > 0 ? dp[i - 1][j - 1] : 0)) % 1000000007; } } return (int) dp[steps][0]; } }
[ "yuanchenshi@gmail.com" ]
yuanchenshi@gmail.com
dfd2794b4c9c556331116bedcba028e4178554aa
964601fff9212bec9117c59006745e124b49e1e3
/matos-android/src/main/java/android/accounts/Account.java
655b92a02254928790bd63e062ca000f14e66fa2
[ "Apache-2.0" ]
permissive
vadosnaprimer/matos-profiles
bf8300b04bef13596f655d001fc8b72315916693
fb27c246911437070052197aa3ef91f9aaac6fc3
refs/heads/master
2020-05-23T07:48:46.135878
2016-04-05T13:14:42
2016-04-05T13:14:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,480
java
package android.accounts; /* * #%L * Matos * $Id:$ * $HeadURL:$ * %% * Copyright (C) 2010 - 2014 Orange SA * %% * 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. * #L% */ @com.francetelecom.rd.stubs.annotation.ClassDone(0) public class Account implements android.os.Parcelable { // Fields public final java.lang.String name = (java.lang.String) null; public final java.lang.String type = (java.lang.String) null; public static final android.os.Parcelable.Creator<Account> CREATOR = null; // Constructors public Account(java.lang.String arg1, java.lang.String arg2){ } public Account(android.os.Parcel arg1){ } // Methods public boolean equals(java.lang.Object arg1){ return false; } public java.lang.String toString(){ return (java.lang.String) null; } public int hashCode(){ return 0; } public void writeToParcel(android.os.Parcel arg1, int arg2){ } public int describeContents(){ return 0; } }
[ "pierre.cregut@orange.com" ]
pierre.cregut@orange.com
8eba03c747c35429c51770114810a380b73bebf2
13ea5da0b7b8d4ba87d622a5f733dcf6b4c5f1e3
/crash-reproduction-ws/results/XWIKI-13377-20-12-Single_Objective_GGA-WeightedSum/com/xpn/xwiki/web/XWikiAction_ESTest.java
7b12c5d83a27de5e3bb243d35e79237464324cb9
[ "MIT", "CC-BY-4.0" ]
permissive
STAMP-project/Botsing-basic-block-coverage-application
6c1095c6be945adc0be2b63bbec44f0014972793
80ea9e7a740bf4b1f9d2d06fe3dcc72323b848da
refs/heads/master
2022-07-28T23:05:55.253779
2022-04-20T13:54:11
2022-04-20T13:54:11
285,771,370
0
0
null
null
null
null
UTF-8
Java
false
false
546
java
/* * This file was automatically generated by EvoSuite * Mon Mar 30 20:00:16 UTC 2020 */ package com.xpn.xwiki.web; import org.junit.Test; import static org.junit.Assert.*; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true) public class XWikiAction_ESTest extends XWikiAction_ESTest_scaffolding { @Test public void notGeneratedAnyTest() { // EvoSuite did not generate any tests } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
ee7bd0976d54cadc066b53442c1f64ace029d777
98064e974f426d9910abda97c5e53c62df9bd2c8
/app/src/main/java/com/qdigo/chargerent/utils/ToastUtils.java
ad957b027cb66ebb500a045af736bb0253ef16a2
[]
no_license
dongerqiang/ChargeRent
b3cc8186df2a6f477d331ef5b38c8ec585063c75
91f191694eb86b758a6c39beb9a0accd376e4206
refs/heads/master
2021-05-15T14:00:24.164080
2017-10-18T10:15:53
2017-10-18T10:15:53
107,253,522
0
1
null
null
null
null
UTF-8
Java
false
false
1,987
java
package com.qdigo.chargerent.utils; import android.content.Context; import android.widget.Toast; /** * Toast统一管理类 */ public class ToastUtils { private ToastUtils() { /* cannot be instantiated */ throw new UnsupportedOperationException("cannot be instantiated"); } public static boolean isShow = true; /** * 短时间显示Toast * * @param context * @param message */ public static void showShort(Context context, CharSequence message) { if (isShow) Toast.makeText(context, message, Toast.LENGTH_SHORT).show(); } /** * 短时间显示Toast * * @param context * @param message */ public static void showShort(Context context, int message) { if (isShow) Toast.makeText(context, message, Toast.LENGTH_SHORT).show(); } /** * 长时间显示Toast * * @param context * @param message */ public static void showLong(Context context, CharSequence message) { if (isShow) Toast.makeText(context, message, Toast.LENGTH_LONG).show(); } /** * 长时间显示Toast * * @param context * @param message */ public static void showLong(Context context, int message) { if (isShow) Toast.makeText(context, message, Toast.LENGTH_LONG).show(); } /** * 自定义显示Toast时间 * * @param context * @param message * @param duration */ public static void show(Context context, CharSequence message, int duration) { if (isShow) Toast.makeText(context, message, duration).show(); } /** * 自定义显示Toast时间 * * @param context * @param message * @param duration */ public static void show(Context context, int message, int duration) { if (isShow) Toast.makeText(context, message, duration).show(); } }
[ "www.1371686510@qq.com" ]
www.1371686510@qq.com
38d866090f24774005aca39b0156b3fc861d67c3
05948ca1cd3c0d2bcd65056d691c4d1b2e795318
/classes2/com/xiaoenai/app/classes/forum/presenter/af.java
4dd3c5de38974471409af98c443d0f6cfa958eed
[]
no_license
waterwitness/xiaoenai
356a1163f422c882cabe57c0cd3427e0600ff136
d24c4d457d6ea9281a8a789bc3a29905b06002c6
refs/heads/master
2021-01-10T22:14:17.059983
2016-10-08T08:39:11
2016-10-08T08:39:11
70,317,042
0
8
null
null
null
null
UTF-8
Java
false
false
624
java
package com.xiaoenai.app.classes.forum.presenter; import android.view.View; import android.view.View.OnClickListener; import com.xiaoenai.app.utils.f.a; class af implements View.OnClickListener { af(ForumTopicViewPresenter paramForumTopicViewPresenter, int paramInt) {} public void onClick(View paramView) { a.c("=====img.setOnClickListener========", new Object[0]); ForumTopicViewPresenter.a(this.b, this.a); } } /* Location: E:\apk\xiaoenai2\classes2-dex2jar.jar!\com\xiaoenai\app\classes\forum\presenter\af.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "1776098770@qq.com" ]
1776098770@qq.com
86f6b4ed03c0c883555cc64727301ab92706240a
ed5159d056e98d6715357d0d14a9b3f20b764f89
/src/irvine/oeis/a039/A039613.java
51dd3d8bde1151c3dc33827890ec4c0ddad36b2e
[]
no_license
flywind2/joeis
c5753169cf562939b04dd246f8a2958e97f74558
e5efd6971a0062ac99f4fae21a7c78c9f9e74fea
refs/heads/master
2020-09-13T18:34:35.080552
2019-11-19T05:40:55
2019-11-19T05:40:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
703
java
package irvine.oeis.a039; // Generated by gen_seq4.pl basdig2 12 count1 != 0 && 1 11 at 2019-07-04 09:18 // DO NOT EDIT here! import irvine.math.z.Z; import irvine.oeis.RunsBaseSequence; /** * A039613 Numbers n such that representation in base 12 has same nonzero number of <code>1</code>'s and <code>11</code>'s. * @author Georg Fischer */ public class A039613 extends RunsBaseSequence { /** Construct the sequence. */ public A039613() { super(1, -1); } @Override protected boolean isOk() { final int count1 = getDigitCount(mK, 12, 1); return count1 != 0 && count1 == getDigitCount(mK, 12, 11); } @Override public Z next() { return getNextWithProperty(); } }
[ "sean.irvine@realtimegenomics.com" ]
sean.irvine@realtimegenomics.com
2faa91358a48a1aa445ec3105a639eb07aac0786
cf7e9fcaa002d7e3a2e4396831bf122fd1ac7bbc
/cards/src/main/java/org/rnd/jmagic/cards/ReaperfromtheAbyss.java
b3be6c0726e82c5a6aeb2dc2207b43cde59a213f
[]
no_license
NorthFury/jmagic
9b28d803ce6f8bf22f22eb41e2a6411bc11c8cdf
efe53d9d02716cc215456e2794a43011759322d9
refs/heads/master
2020-05-28T11:04:50.631220
2014-06-17T09:48:44
2014-06-17T09:48:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,473
java
package org.rnd.jmagic.cards; import static org.rnd.jmagic.Convenience.*; import org.rnd.jmagic.abilities.keywords.Flying; import org.rnd.jmagic.engine.*; import org.rnd.jmagic.engine.generators.*; @Name("Reaper from the Abyss") @Types({Type.CREATURE}) @SubTypes({SubType.DEMON}) @ManaCost("3BBB") @Printings({@Printings.Printed(ex = Expansion.INNISTRAD, r = Rarity.MYTHIC)}) @ColorIdentity({Color.BLACK}) public final class ReaperfromtheAbyss extends Card { public static final class ReaperfromtheAbyssAbility1 extends EventTriggeredAbility { public ReaperfromtheAbyssAbility1(GameState state) { super(state, "At the beginning of each end step, if a creature died this turn, destroy target non-Demon creature."); this.addPattern(atTheBeginningOfEachEndStep()); this.interveningIf = Morbid.instance(); state.ensureTracker(new Morbid.Tracker()); SetGenerator target = targetedBy(this.addTarget(RelativeComplement.instance(CreaturePermanents.instance(), HasSubType.instance(SubType.DEMON)), "target non-Demon creature")); this.addEffect(destroy(target, "Destroy target non-Demon creature.")); } } public ReaperfromtheAbyss(GameState state) { super(state); this.setPower(6); this.setToughness(6); // Flying this.addAbility(new Flying(state)); // Morbid \u2014 At the beginning of each end step, if a creature died // this turn, destroy target non-Demon creature. this.addAbility(new ReaperfromtheAbyssAbility1(state)); } }
[ "robyter@gmail" ]
robyter@gmail
c4a198ac09ed2942ec4f0dcf8dd9c38b032f8825
a1826c2ed9c12cfc395fb1a14c1a2e1f097155cb
/mpserverless-20190615/src/main/java/com/aliyun/mpserverless20190615/models/GetWebHostingConfigResponseBody.java
4170cb88d64171a0d0f52f8572d39e80071650c2
[ "Apache-2.0" ]
permissive
aliyun/alibabacloud-java-sdk
83a6036a33c7278bca6f1bafccb0180940d58b0b
008923f156adf2e4f4785a0419f60640273854ec
refs/heads/master
2023-09-01T04:10:33.640756
2023-09-01T02:40:45
2023-09-01T02:40:45
288,968,318
40
45
null
2023-06-13T02:47:13
2020-08-20T09:51:08
Java
UTF-8
Java
false
false
3,309
java
// This file is auto-generated, don't edit it. Thanks. package com.aliyun.mpserverless20190615.models; import com.aliyun.tea.*; public class GetWebHostingConfigResponseBody extends TeaModel { @NameInMap("Data") public GetWebHostingConfigResponseBodyData data; @NameInMap("RequestId") public String requestId; public static GetWebHostingConfigResponseBody build(java.util.Map<String, ?> map) throws Exception { GetWebHostingConfigResponseBody self = new GetWebHostingConfigResponseBody(); return TeaModel.build(map, self); } public GetWebHostingConfigResponseBody setData(GetWebHostingConfigResponseBodyData data) { this.data = data; return this; } public GetWebHostingConfigResponseBodyData getData() { return this.data; } public GetWebHostingConfigResponseBody setRequestId(String requestId) { this.requestId = requestId; return this; } public String getRequestId() { return this.requestId; } public static class GetWebHostingConfigResponseBodyData extends TeaModel { @NameInMap("AllowedIps") public String allowedIps; @NameInMap("DefaultDomain") public String defaultDomain; @NameInMap("ErrorPath") public String errorPath; @NameInMap("HistoryModePath") public String historyModePath; @NameInMap("IndexPath") public String indexPath; @NameInMap("SpaceId") public String spaceId; public static GetWebHostingConfigResponseBodyData build(java.util.Map<String, ?> map) throws Exception { GetWebHostingConfigResponseBodyData self = new GetWebHostingConfigResponseBodyData(); return TeaModel.build(map, self); } public GetWebHostingConfigResponseBodyData setAllowedIps(String allowedIps) { this.allowedIps = allowedIps; return this; } public String getAllowedIps() { return this.allowedIps; } public GetWebHostingConfigResponseBodyData setDefaultDomain(String defaultDomain) { this.defaultDomain = defaultDomain; return this; } public String getDefaultDomain() { return this.defaultDomain; } public GetWebHostingConfigResponseBodyData setErrorPath(String errorPath) { this.errorPath = errorPath; return this; } public String getErrorPath() { return this.errorPath; } public GetWebHostingConfigResponseBodyData setHistoryModePath(String historyModePath) { this.historyModePath = historyModePath; return this; } public String getHistoryModePath() { return this.historyModePath; } public GetWebHostingConfigResponseBodyData setIndexPath(String indexPath) { this.indexPath = indexPath; return this; } public String getIndexPath() { return this.indexPath; } public GetWebHostingConfigResponseBodyData setSpaceId(String spaceId) { this.spaceId = spaceId; return this; } public String getSpaceId() { return this.spaceId; } } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
a35f3c15839172275d73bb8bf8e528b3a867c232
70b2493978c469a3e5cc1ad907d95e1ca85eb6dd
/jonix-onix3/src/main/java/com/tectonica/jonix/onix3/CollectionIDType.java
3a552a2662cc7b8cbe2bd1ccfe6b04332abb8ac2
[ "Apache-2.0" ]
permissive
archi3315/jonix
9130d06790f0e5267d911c164fb256e00826e05c
e7f59e81d3d6e3f4fa78a9406eceed97901093d0
refs/heads/master
2020-05-17T15:23:31.701307
2019-04-29T15:13:49
2019-04-29T15:13:49
183,789,334
0
0
null
2019-04-27T15:21:51
2019-04-27T15:21:51
null
UTF-8
Java
false
false
3,476
java
/* * Copyright (C) 2012 Zach Melamed * * Latest version available online at https://github.com/zach-m/jonix * Contact me at zach@tectonica.co.il * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.tectonica.jonix.onix3; import com.tectonica.jonix.JPU; import com.tectonica.jonix.OnixElement; import com.tectonica.jonix.codelist.RecordSourceTypes; import com.tectonica.jonix.codelist.SeriesIdentifierTypes; import java.io.Serializable; /* * NOTE: THIS IS AN AUTO-GENERATED FILE, DO NOT EDIT MANUALLY */ /** * <h1>Collection identifier type code</h1><p>An ONIX code identifying a scheme from which an identifier in the * &lt;IDValue&gt; element is taken. Mandatory in each occurrence of the &lt;CollectionIdentifier&gt; composite, and * non-repeating.</p><table border='1' cellpadding='3'><tr><td>Format</td><td>Fixed-length text, two * digits</td></tr><tr><td>Codelist</td><td>List 13</td></tr><tr><td>Reference name</td><td>&lt;CollectionIDType&gt;</td></tr><tr><td>Short * tag</td><td>&lt;x344&gt;</td></tr><tr><td>Cardinality</td><td>1</td></tr><tr><td>Example</td><td>&lt;x344&gt;02&lt;/x344&gt; * (ISSN)</td></tr></table> */ public class CollectionIDType implements OnixElement<SeriesIdentifierTypes>, Serializable { private static final long serialVersionUID = 1L; public static final String refname = "CollectionIDType"; public static final String shortname = "x344"; ///////////////////////////////////////////////////////////////////////////////// // ATTRIBUTES ///////////////////////////////////////////////////////////////////////////////// /** * (type: dt.DateOrDateTime) */ public String datestamp; public RecordSourceTypes sourcetype; public String sourcename; ///////////////////////////////////////////////////////////////////////////////// // VALUE MEMBER ///////////////////////////////////////////////////////////////////////////////// public SeriesIdentifierTypes value; /** * Internal API, use the {@link #value} field instead */ @Override public SeriesIdentifierTypes _value() { return value; } ///////////////////////////////////////////////////////////////////////////////// // SERVICES ///////////////////////////////////////////////////////////////////////////////// private final boolean exists; public static final CollectionIDType EMPTY = new CollectionIDType(); public CollectionIDType() { exists = false; } public CollectionIDType(org.w3c.dom.Element element) { exists = true; datestamp = JPU.getAttribute(element, "datestamp"); sourcetype = RecordSourceTypes.byCode(JPU.getAttribute(element, "sourcetype")); sourcename = JPU.getAttribute(element, "sourcename"); value = SeriesIdentifierTypes.byCode(JPU.getContentAsString(element)); } @Override public boolean exists() { return exists; } }
[ "zach@tectonica.co.il" ]
zach@tectonica.co.il
a091c269f29b4c159c6ea6eb06c8e260e30a7c99
d54cc14cd058d20f27c56107b88d76cc27d4fd29
/leopard-boot-data-parent/leopard-boot-jdbc/src/main/java/io/leopard/jdbc/builder/NullInsertBuilder.java
c769703f19c5edcf79cdb9fba7365d4276e9f93f
[ "Apache-2.0" ]
permissive
ailu5949/leopard-boot
a59cea1a03b1b41712d29cf4091be76dca8316a7
33201a2962821475772a53ddce64f7f823f62242
refs/heads/master
2020-04-02T09:28:01.286249
2018-10-23T08:46:00
2018-10-23T08:46:00
154,294,038
1
0
Apache-2.0
2018-10-23T08:46:20
2018-10-23T08:46:20
null
UTF-8
Java
false
false
1,265
java
package io.leopard.jdbc.builder; import java.util.Date; import io.leopard.lang.inum.Onum; public class NullInsertBuilder extends InsertBuilder { public NullInsertBuilder(String tableName) { super(tableName); } public NullInsertBuilder(String tableName, boolean insertIgnore) { super(tableName, insertIgnore); } @Override public void setInt(String fieldName, Integer value) { if (value != null) { super.setInt(fieldName, value); } } @Override public void setLong(String fieldName, Long value) { if (value != null) { super.setLong(fieldName, value); } } @Override public void setFloat(String fieldName, Float value) { if (value != null) { super.setFloat(fieldName, value); } } @Override public void setDouble(String fieldName, Double value) { if (value != null) { super.setDouble(fieldName, value); } } @Override public void setDate(String fieldName, Date value) { if (value != null) { super.setDate(fieldName, value); } } @Override public void setString(String fieldName, String value) { if (value != null) { super.setString(fieldName, value); } } @Override public void setEnum(String fieldName, Onum<?, ?> value) { if (value != null) { super.setEnum(fieldName, value); } } }
[ "tanhaichao@gmail.com" ]
tanhaichao@gmail.com
a4ed9ada60f33df3190226ba9465648c44e05695
22b1fe6a0af8ab3c662551185967bf2a6034a5d2
/experimenting-rounds/massive-count-of-annotated-classes/src/main/java/fr/javatronic/blog/massive/annotation1/sub1/Class_0734.java
d8b65d9fee9e94010805e913b764086e63746f5c
[ "Apache-2.0" ]
permissive
lesaint/experimenting-annotation-processing
b64ed2182570007cb65e9b62bb2b1b3f69d168d6
1e9692ceb0d3d2cda709e06ccc13290262f51b39
refs/heads/master
2021-01-23T11:20:19.836331
2014-11-13T10:37:14
2014-11-13T10:37:14
26,336,984
1
0
null
null
null
null
UTF-8
Java
false
false
151
java
package fr.javatronic.blog.massive.annotation1.sub1; import fr.javatronic.blog.processor.Annotation_001; @Annotation_001 public class Class_0734 { }
[ "sebastien.lesaint@gmail.com" ]
sebastien.lesaint@gmail.com
da0d12cd692319dc82fd145cd8d26fe177afd5e6
7c4477a4bd2f5a3662338893ffdb87edbcce3257
/net/minecraft/server/WorldGenTrees.java
79d5ff0e5c693fc43e448de4dad686d9ab09851d
[]
no_license
Xolsom/mc-dev
5921997d1793cf2a0ccc443c1c8b175a7f59ef1f
1a792ed860ebe2c6d4c40c52f3bc7b9e0789ca23
refs/heads/master
2020-12-24T11:17:37.185992
2011-07-08T12:23:08
2011-07-12T21:28:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,731
java
package net.minecraft.server; import java.util.Random; public class WorldGenTrees extends WorldGenerator { public WorldGenTrees() {} public boolean a(World world, Random random, int i, int j, int k) { int l = random.nextInt(3) + 4; boolean flag = true; if (j >= 1 && j + l + 1 <= 128) { int i1; int j1; int k1; int l1; for (i1 = j; i1 <= j + 1 + l; ++i1) { byte b0 = 1; if (i1 == j) { b0 = 0; } if (i1 >= j + 1 + l - 2) { b0 = 2; } for (j1 = i - b0; j1 <= i + b0 && flag; ++j1) { for (k1 = k - b0; k1 <= k + b0 && flag; ++k1) { if (i1 >= 0 && i1 < 128) { l1 = world.getTypeId(j1, i1, k1); if (l1 != 0 && l1 != Block.LEAVES.id) { flag = false; } } else { flag = false; } } } } if (!flag) { return false; } else { i1 = world.getTypeId(i, j - 1, k); if ((i1 == Block.GRASS.id || i1 == Block.DIRT.id) && j < 128 - l - 1) { world.setRawTypeId(i, j - 1, k, Block.DIRT.id); int i2; for (i2 = j - 3 + l; i2 <= j + l; ++i2) { j1 = i2 - (j + l); k1 = 1 - j1 / 2; for (l1 = i - k1; l1 <= i + k1; ++l1) { int j2 = l1 - i; for (int k2 = k - k1; k2 <= k + k1; ++k2) { int l2 = k2 - k; if ((Math.abs(j2) != k1 || Math.abs(l2) != k1 || random.nextInt(2) != 0 && j1 != 0) && !Block.o[world.getTypeId(l1, i2, k2)]) { world.setRawTypeId(l1, i2, k2, Block.LEAVES.id); } } } } for (i2 = 0; i2 < l; ++i2) { j1 = world.getTypeId(i, j + i2, k); if (j1 == 0 || j1 == Block.LEAVES.id) { world.setRawTypeId(i, j + i2, k, Block.LOG.id); } } return true; } else { return false; } } } else { return false; } } }
[ "erikbroes@grum.nl" ]
erikbroes@grum.nl
65d8cc0105b42e1e2b74cb26213996fd625cf410
0af8b92686a58eb0b64e319b22411432aca7a8f3
/large-multiproject/project44/src/main/java/org/gradle/test/performance44_4/Production44_344.java
da7ca84ac43f3b6b6f12425e95017ffad15aa71d
[]
no_license
gradle/performance-comparisons
b0d38db37c326e0ce271abebdb3c91769b860799
e53dc7182fafcf9fedf07920cbbea8b40ee4eef4
refs/heads/master
2023-08-14T19:24:39.164276
2022-11-24T05:18:33
2022-11-24T05:18:33
80,121,268
17
15
null
2022-09-30T08:04:35
2017-01-26T14:25:33
null
UTF-8
Java
false
false
305
java
package org.gradle.test.performance44_4; public class Production44_344 extends org.gradle.test.performance14_4.Production14_344 { private final String property; public Production44_344() { this.property = "foo"; } public String getProperty() { return property; } }
[ "cedric.champeau@gmail.com" ]
cedric.champeau@gmail.com