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
79c37545dc9c2edf8ce78582beb6760b06fa2fcc
c324e94270569948d278979cad65dbbd51ddd2f2
/webanno-api-annotation/src/main/java/de/tudarmstadt/ukp/clarin/webanno/api/annotation/coloring/ColoringRulesConfigurationPanel.java
f935a5196e7ab8059de7459c4e7bd4dcbe2b3508
[ "Apache-2.0" ]
permissive
webanno/webanno
b5a9a13819ff2b564cb36dccbbeeec0cf0f59f84
e029a76d68341702747078d9bc412ceeb32de7b6
refs/heads/master
2023-03-06T08:03:58.904369
2022-10-25T20:28:59
2022-10-25T20:28:59
35,550,196
267
121
Apache-2.0
2023-02-22T08:09:48
2015-05-13T13:20:49
Java
UTF-8
Java
false
false
6,554
java
/* * Licensed to the Technische Universität Darmstadt under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The Technische Universität Darmstadt * 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. * * 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 de.tudarmstadt.ukp.clarin.webanno.api.annotation.coloring; import static org.apache.commons.lang3.StringUtils.isBlank; import java.util.List; import java.util.Map; import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; import org.apache.wicket.StyleAttributeModifier; import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.feedback.IFeedback; import org.apache.wicket.markup.html.WebMarkupContainer; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.html.form.Form; import org.apache.wicket.markup.html.form.TextField; import org.apache.wicket.markup.html.list.ListItem; import org.apache.wicket.markup.html.list.ListView; import org.apache.wicket.markup.html.panel.Panel; import org.apache.wicket.model.CompoundPropertyModel; import org.apache.wicket.model.IModel; import org.apache.wicket.spring.injection.annot.SpringBean; import org.apache.wicket.validation.validator.PatternValidator; import de.agilecoders.wicket.extensions.markup.html.bootstrap.form.ColorPickerTextField; import de.tudarmstadt.ukp.clarin.webanno.api.AnnotationSchemaService; import de.tudarmstadt.ukp.clarin.webanno.api.annotation.layer.LayerSupportRegistry; import de.tudarmstadt.ukp.clarin.webanno.model.AnnotationLayer; import de.tudarmstadt.ukp.clarin.webanno.support.lambda.LambdaAjaxLink; import de.tudarmstadt.ukp.clarin.webanno.support.lambda.LambdaAjaxSubmitLink; /** * Can be added to a feature support traits editor to configure coloring rules. */ public class ColoringRulesConfigurationPanel extends Panel { private static final long serialVersionUID = -8294428032177255299L; private @SpringBean LayerSupportRegistry layerSupportRegistry; private @SpringBean AnnotationSchemaService schemaService; private final WebMarkupContainer coloringRulesContainer; private final IModel<List<ColoringRule>> coloringRules; public ColoringRulesConfigurationPanel(String aId, IModel<AnnotationLayer> aModel, IModel<List<ColoringRule>> aColoringRules) { super(aId, aModel); coloringRules = aColoringRules; Form<ColoringRule> coloringRulesForm = new Form<>("coloringRulesForm", CompoundPropertyModel.of(new ColoringRule())); add(coloringRulesForm); coloringRulesContainer = new WebMarkupContainer("coloringRulesContainer"); coloringRulesContainer.setOutputMarkupPlaceholderTag(true); coloringRulesForm.add(coloringRulesContainer); coloringRulesContainer.add(new TextField<String>("pattern")); // We cannot make the color field a required one here because then we'd get a message // about color not being set when saving the entire feature details form! coloringRulesContainer.add( new ColorPickerTextField("color").add(new PatternValidator("#[0-9a-fA-F]{6}"))); coloringRulesContainer .add(new LambdaAjaxSubmitLink<>("addColoringRule", this::addColoringRule)); coloringRulesContainer.add(createKeyBindingsList("coloringRules", coloringRules)); } private ListView<ColoringRule> createKeyBindingsList(String aId, IModel<List<ColoringRule>> aKeyBindings) { return new ListView<ColoringRule>(aId, aKeyBindings) { private static final long serialVersionUID = 432136316377546825L; @Override protected void populateItem(ListItem<ColoringRule> aItem) { ColoringRule coloringRule = aItem.getModelObject(); Label value = new Label("pattern", coloringRule.getPattern()); value.add(new StyleAttributeModifier() { private static final long serialVersionUID = 3627596292626670610L; @Override protected Map<String, String> update(Map<String, String> aStyles) { aStyles.put("background-color", coloringRule.getColor()); return aStyles; } }); aItem.add(value); aItem.add(new LambdaAjaxLink("removeColoringRule", _target -> removeColoringRule(_target, aItem.getModelObject()))); } }; } public AnnotationLayer getModelObject() { return (AnnotationLayer) getDefaultModelObject(); } private void addColoringRule(AjaxRequestTarget aTarget, Form<ColoringRule> aForm) { ColoringRule coloringRule = aForm.getModelObject(); if (isBlank(coloringRule.getColor())) { error("Color is required"); aTarget.addChildren(getPage(), IFeedback.class); return; } if (isBlank(coloringRule.getPattern())) { error("Pattern is required"); aTarget.addChildren(getPage(), IFeedback.class); return; } try { Pattern.compile(coloringRule.getPattern()); } catch (PatternSyntaxException e) { error("Pattern is not a valid regular expression: " + e.getMessage()); aTarget.addChildren(getPage(), IFeedback.class); return; } coloringRules.getObject().add(coloringRule); aForm.setModelObject(new ColoringRule()); success("Coloring rule added. Do not forget to save the layer details!"); aTarget.addChildren(getPage(), IFeedback.class); aTarget.add(coloringRulesContainer); } private void removeColoringRule(AjaxRequestTarget aTarget, ColoringRule aBinding) { coloringRules.getObject().remove(aBinding); aTarget.add(coloringRulesContainer); } }
[ "richard.eckart@gmail.com" ]
richard.eckart@gmail.com
abf25eaeaf636d2faaaed44761ce4e36ac2d4bb2
ec84fac8f1096b29b7bd89ecaa89caff34d345a4
/src/main/java/com/sangupta/jerry/unsafe/UnsafeMemory.java
b484be8c232983b1e43d233e9ea611e8b18adf8d
[ "Apache-2.0", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
anant1993/jerry
0c37d89aff79d663187f7b0b6775d123bd11895d
2a004b0157b846ee638a83a7fa4cb10ebfbe2a7e
refs/heads/master
2021-01-17T21:47:50.847014
2013-06-21T07:25:39
2013-06-21T07:25:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,915
java
/** * * jerry - Common Java Functionality * Copyright (c) 2012, Sandeep Gupta * * http://www.sangupta/projects/jerry * * 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.sangupta.jerry.unsafe; import sun.misc.Unsafe; import java.lang.reflect.Field; /** * Provides capability to write to a byte buffer using Java {@link Unsafe} class. * * @author sangupta * */ @SuppressWarnings("restriction") public class UnsafeMemory { private static final Unsafe unsafe; static { try { Field field = Unsafe.class.getDeclaredField("theUnsafe"); field.setAccessible(true); unsafe = (Unsafe) field.get(null); } catch (Exception e) { throw new RuntimeException(e); } } /** * array offset for bytes on this machine */ private static final long byteArrayOffset = unsafe.arrayBaseOffset(byte[].class); /** * array offset for longs on this machine */ private static final long longArrayOffset = unsafe.arrayBaseOffset(long[].class); /** * array offset for double's on this machine */ private static final long doubleArrayOffset = unsafe.arrayBaseOffset(double[].class); /** * Size of a boolean value */ private static final int SIZE_OF_BOOLEAN = 1; /** * Size of an integer */ private static final int SIZE_OF_INT = 4; /** * Size of a double */ private static final int SIZE_OF_LONG = 8; /** * The current position in the buffer */ private int pos = 0; /** * The current length of the byte buffer */ private final int bufferLength; /** * The buffer of bytes over which we operate */ private final byte[] buffer; /** * Create a new instance of {@link UnsafeMemory} that we work upon. * */ public UnsafeMemory(final byte[] buffer) { if (null == buffer) { throw new NullPointerException("buffer cannot be null"); } this.buffer = buffer; this.bufferLength = buffer.length; } /** * Reset the current position of the seek in the internal * byte buffer. * */ public void reset() { this.pos = 0; } /** * Return the current position of the seek in the internal * byte buffer. * * @return */ public int getPosition() { return this.pos; } /** * Write a string to the current location in the buffer. The length of the string * is written first as an {@link Integer}. * * @param value */ public void putString(final String value) { if(value == null) { putInt(0); return; } putInt(value.length()); char[] chars = value.toCharArray(); for(char c : chars) { unsafe.putChar(buffer, byteArrayOffset + pos, c); pos++; } } /** * A method that checks for the position pointer inside the buffer * to be in the range before making a read call. * */ private final void positionCheck() { if(this.pos > this.bufferLength) { throw new IndexOutOfBoundsException("Trying to read from memory position out of buffer area"); } } /** * Read a string from the current location in buffer. The first {@link Integer} * in the string would be its length. * * @return */ public String getString() { positionCheck(); int length = getInt(); if(length == 0) { return null; } return getString(length); } /** * Read a string from the current location in buffer. The length of the string * has been provided. * * @param length * @return */ public String getString(int length) { positionCheck(); char[] values = new char[length]; for(int index = 0; index < length; index++) { values[index] = (char) unsafe.getByte(buffer, byteArrayOffset + pos); pos ++; } return String.valueOf(values); } /** * Write a boolean value to the memory buffer. * * @param value */ public void putBoolean(final boolean value) { positionCheck(); unsafe.putBoolean(buffer, byteArrayOffset + pos, value); pos += SIZE_OF_BOOLEAN; } /** * Read a boolean value from the memory buffer. * * @return */ public boolean getBoolean() { positionCheck(); boolean value = unsafe.getBoolean(buffer, byteArrayOffset + pos); pos += SIZE_OF_BOOLEAN; return value; } /** * Write an integer value to the memory buffer. * * @param value */ public void putInt(final int value) { unsafe.putInt(buffer, byteArrayOffset + pos, value); pos += SIZE_OF_INT; } /** * Read an integer value from the memory buffer. * * @return */ public int getInt() { positionCheck(); int value = unsafe.getInt(buffer, byteArrayOffset + pos); pos += SIZE_OF_INT; return value; } /** * Write a long value to the memory buffer. * * @param value */ public void putLong(final long value) { unsafe.putLong(buffer, byteArrayOffset + pos, value); pos += SIZE_OF_LONG; } /** * Read a long value from the memory buffer. * * @return */ public long getLong() { positionCheck(); long value = unsafe.getLong(buffer, byteArrayOffset + pos); pos += SIZE_OF_LONG; return value; } /** * Write an array of long values to the memory buffer. * * @param values */ public void putLongArray(final long[] values) { putInt(values.length); long bytesToCopy = values.length << 3; unsafe.copyMemory(values, longArrayOffset, buffer, byteArrayOffset + pos, bytesToCopy); pos += bytesToCopy; } /** * Read an array of long values from the memory buffer. * * @return */ public long[] getLongArray() { positionCheck(); int arraySize = getInt(); long[] values = new long[arraySize]; long bytesToCopy = values.length << 3; unsafe.copyMemory(buffer, byteArrayOffset + pos, values, longArrayOffset, bytesToCopy); pos += bytesToCopy; return values; } /** * Write an array of double values into the memory buffer. * * @param values */ public void putDoubleArray(final double[] values) { putInt(values.length); long bytesToCopy = values.length << 3; unsafe.copyMemory(values, doubleArrayOffset, buffer, byteArrayOffset + pos, bytesToCopy); pos += bytesToCopy; } /** * Read an array of double values from the memory buffer. * * @return */ public double[] getDoubleArray() { positionCheck(); int arraySize = getInt(); double[] values = new double[arraySize]; long bytesToCopy = values.length << 3; unsafe.copyMemory(buffer, byteArrayOffset + pos, values, doubleArrayOffset, bytesToCopy); pos += bytesToCopy; return values; } }
[ "sandy.pec@gmail.com" ]
sandy.pec@gmail.com
76328902eec24fd43967ed3e39fe0785364fbd83
2545fbd66c2d7b399be04d25d67ddca1983da308
/src/main/java/nc/network/render/BlockHighlightUpdatePacket.java
617721dea270062f0b7b228eeedb63957f681cf3
[ "CC0-1.0" ]
permissive
AndyDingo/NuclearCraft
b1c78304600c135893d9b503dce291c8d269c566
1a03293c2545480f1d9182de7f703478c5b4b56b
refs/heads/master
2020-09-08T17:40:46.849488
2019-10-09T22:29:02
2019-10-09T22:29:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,025
java
package nc.network.render; import io.netty.buffer.ByteBuf; import nc.NuclearCraft; import nc.util.NCUtil; import net.minecraft.client.Minecraft; import net.minecraft.util.math.BlockPos; import net.minecraftforge.fml.common.network.simpleimpl.IMessage; import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; import net.minecraftforge.fml.relauncher.Side; public class BlockHighlightUpdatePacket implements IMessage { protected boolean messageValid; protected BlockPos pos; protected long highlightTimeMillis; public BlockHighlightUpdatePacket() { messageValid = false; } public BlockHighlightUpdatePacket(BlockPos pos, long highlightTimeMillis) { this.pos = pos; this.highlightTimeMillis = highlightTimeMillis; messageValid = true; } public void readMessage(ByteBuf buf) { pos = new BlockPos(buf.readInt(), buf.readInt(), buf.readInt()); highlightTimeMillis = buf.readLong(); } public void writeMessage(ByteBuf buf) { buf.writeInt(pos.getX()); buf.writeInt(pos.getY()); buf.writeInt(pos.getZ()); buf.writeLong(highlightTimeMillis); } @Override public void fromBytes(ByteBuf buf) { try { readMessage(buf); } catch (IndexOutOfBoundsException ioe) { NCUtil.getLogger().catching(ioe); return; } messageValid = true; } @Override public void toBytes(ByteBuf buf) { if (!messageValid) return; writeMessage(buf); } public static class Handler implements IMessageHandler<BlockHighlightUpdatePacket, IMessage> { @Override public IMessage onMessage(BlockHighlightUpdatePacket message, MessageContext ctx) { if (!message.messageValid && ctx.side != Side.CLIENT) return null; Minecraft.getMinecraft().addScheduledTask(() -> processMessage(message)); return null; } protected void processMessage(BlockHighlightUpdatePacket message) { NuclearCraft.instance.blockOverlayTracker.highlightBlock(message.pos, message.highlightTimeMillis); } } }
[ "joedodd35@gmail.com" ]
joedodd35@gmail.com
7fc79b4061732c405bdc3ce8f8018a49faa28816
49b4cb79c910a17525b59d4b497a09fa28a9e3a8
/parserValidCheck/src/main/java/com/ke/css/cimp/fwb/fwb17/Rule_Sub_IATA_Cargo_Agent_CASS_Address.java
a67955e5aaf9c3053b8b6a1d6624fa471a75cbe2
[]
no_license
ganzijo/koreanair
a7d750b62cec2647bfb2bed4ca1bf8648d9a447d
e980fb11bc4b8defae62c9d88e5c70a659bef436
refs/heads/master
2021-04-26T22:04:17.478461
2018-03-06T05:59:32
2018-03-06T05:59:32
124,018,887
0
0
null
null
null
null
UTF-8
Java
false
false
2,399
java
package com.ke.css.cimp.fwb.fwb17; /* ----------------------------------------------------------------------------- * Rule_Sub_IATA_Cargo_Agent_CASS_Address.java * ----------------------------------------------------------------------------- * * Producer : com.parse2.aparse.Parser 2.5 * Produced : Tue Mar 06 10:25:52 KST 2018 * * ----------------------------------------------------------------------------- */ import java.util.ArrayList; final public class Rule_Sub_IATA_Cargo_Agent_CASS_Address extends Rule { public Rule_Sub_IATA_Cargo_Agent_CASS_Address(String spelling, ArrayList<Rule> rules) { super(spelling, rules); } public Object accept(Visitor visitor) { return visitor.visit(this); } public static Rule_Sub_IATA_Cargo_Agent_CASS_Address parse(ParserContext context) { context.push("Sub_IATA_Cargo_Agent_CASS_Address"); boolean parsed = true; int s0 = context.index; ParserAlternative a0 = new ParserAlternative(s0); ArrayList<ParserAlternative> as1 = new ArrayList<ParserAlternative>(); parsed = false; { int s1 = context.index; ParserAlternative a1 = new ParserAlternative(s1); parsed = true; if (parsed) { boolean f1 = true; int c1 = 0; for (int i1 = 0; i1 < 4 && f1; i1++) { Rule rule = Rule_Typ_Numeric.parse(context); if ((f1 = rule != null)) { a1.add(rule, context.index); c1++; } } parsed = c1 == 4; } if (parsed) { as1.add(a1); } context.index = s1; } ParserAlternative b = ParserAlternative.getBest(as1); parsed = b != null; if (parsed) { a0.add(b.rules, b.end); context.index = b.end; } Rule rule = null; if (parsed) { rule = new Rule_Sub_IATA_Cargo_Agent_CASS_Address(context.text.substring(a0.start, a0.end), a0.rules); } else { context.index = s0; } context.pop("Sub_IATA_Cargo_Agent_CASS_Address", parsed); return (Rule_Sub_IATA_Cargo_Agent_CASS_Address)rule; } } /* ----------------------------------------------------------------------------- * eof * ----------------------------------------------------------------------------- */
[ "wrjo@wrjo-PC" ]
wrjo@wrjo-PC
ab097aac5b898b39b80ed6ec9583ced93f0b66ed
a47f5306c4795d85bf7100e646b26b614c32ea71
/sphairas-libs/curriculum/src/org/thespheres/betula/curriculum/CourseSelectionValue.java
ab816c62bbce61994ada0b47ca0daa503dc011b5
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
permissive
sphairas/sphairas-desktop
65aaa0cd1955f541d3edcaf79442e645724e891b
f47c8d4ea62c1fc2876c0ffa44e5925bfaebc316
refs/heads/master
2023-01-21T12:02:04.146623
2020-10-22T18:26:52
2020-10-22T18:26:52
243,803,115
2
1
Apache-2.0
2022-12-06T00:34:25
2020-02-28T16:11:33
Java
UTF-8
Java
false
false
538
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 org.thespheres.betula.curriculum; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import org.openide.util.Lookup; /** * * @author boris.heithecker */ @XmlAccessorType(XmlAccessType.FIELD) public abstract class CourseSelectionValue { public abstract String toString(Lookup context); }
[ "boris.heithecker@gmx.net" ]
boris.heithecker@gmx.net
ae96713321cd9a79c2366a06ccc4e82b1e1f56e5
7d95af573b90c218649957ee216f78b68167d44f
/emily-spring-boot-autoconfigure/src/main/java/com/emily/infrastructure/autoconfigure/initializers/EmilyApplicationContextInitializer.java
63d668251812037abe1514d8808ffe6b5ac5463f
[]
no_license
aaaVector/spring-parent
0e383efb60ecec935f1c890fd4dffe715765ded9
e49a109b3f579e9682a16ebf1e5a105e66a346e0
refs/heads/master
2023-04-26T10:17:18.319439
2021-05-31T05:15:46
2021-05-31T05:15:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,030
java
package com.emily.infrastructure.autoconfigure.initializers; import com.emily.infrastructure.logback.common.LoggerUtils; import com.emily.infrastructure.context.ioc.IOCContext; import org.springframework.context.ApplicationContextInitializer; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.core.Ordered; /** * @author Emily * @program: spring-parent * @description: Emily框架初始化器 * @create: 2020/09/22 */ public class EmilyApplicationContextInitializer implements ApplicationContextInitializer<ConfigurableApplicationContext>, Ordered { @Override public int getOrder() { return Ordered.HIGHEST_PRECEDENCE + 1; } @Override public void initialize(ConfigurableApplicationContext applicationContext) { // 初始化容器上下文 IOCContext.setApplicationContext(applicationContext); LoggerUtils.info(EmilyApplicationContextInitializer.class, "==> Emily Infrastructure IOC容器上下文开始初始化..."); } }
[ "mingyang@eastmoney.com" ]
mingyang@eastmoney.com
f3ea8f4a39469a38c6add25630843652cdc1b8b0
6b2a8dd202fdce77c971c412717e305e1caaac51
/solutions_2449486_1/java/oleksiisosevych/QR_B.java
a8a1394e5afedbca79a96572a07241f3a5306238
[]
no_license
alexandraback/datacollection
0bc67a9ace00abbc843f4912562f3a064992e0e9
076a7bc7693f3abf07bfdbdac838cb4ef65ccfcf
refs/heads/master
2021-01-24T18:27:24.417992
2017-05-23T09:23:38
2017-05-23T09:23:38
84,313,442
2
4
null
null
null
null
UTF-8
Java
false
false
2,599
java
import java.io.*; import java.util.*; public class QR_B { static int[][] field; static int N, M; public static void main (String [] args) throws IOException { // Use BufferedReader rather than RandomAccessFile; it's much faster BufferedReader f = new BufferedReader(new FileReader("B-large.in")); PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("a.out"))); StringTokenizer st = new StringTokenizer(f.readLine()); int testn = Integer.parseInt(st.nextToken()); int caseno=1; while(testn-->0) { int here; if(caseno==6) here =0; String result="YES"; st = new StringTokenizer(f.readLine()); N = Integer.parseInt(st.nextToken()); M = Integer.parseInt(st.nextToken()); field = new int[N][M]; for (int i = 0; i < N; i++) { st = new StringTokenizer(f.readLine()); for (int j = 0; j < M; j++) { field[i][j] = Integer.parseInt(st.nextToken()); } } // boolean access[][] = new boolean[N][M]; // for (int i = 0; i < N; i++) { // access[i][M-1]=true; // access[i][0]=true; // } // for (int i = 0; i < M; i++) { // access[N-1][i]=true; // access[0][i]=true; // } // boolean cont = true; // int delta_x[] = {1,-1,0,0}; // int delta_y[] = {0,0,1,-1}; // while(cont){ // cont=false; // for (int i = 0; i < N; i++) { // for (int j = 0; j < M; j++) { // if(access[i][j]) continue; // for (int dir = 0; dir < 4; dir++) { // if((i+delta_x[dir]>=0)&&(i+delta_x[dir]<N)&& // (j+delta_y[dir]>=0)&&(j+delta_y[dir]<M)&& // access[i+delta_x[dir]][j+delta_y[dir]]&& // field[i+delta_x[dir]][j+delta_y[dir]]<=field[i][j]){ // access[i][j]=true; // cont=true; // } // } // // } // } // } boolean check = true; for (int i = 0; i < N && check; i++) { for (int j = 0; j < M && check; j++) { int max = 0; for (int j2 = 0; j2 < N; j2++) { max=Math.max(field[j2][j], max); } if(field[i][j]==max) continue; max=0; for (int j2 = 0; j2 < M; j2++) { max=Math.max(field[i][j2], max); } if(field[i][j]!=max){ check=false; result="NO"; break; } } } System.out.println(result); out.println("Case #"+caseno+++": "+result); } out.close(); System.exit(0); } }
[ "eewestman@gmail.com" ]
eewestman@gmail.com
c13a881688972131ab3d300ad57834e5b7d090e2
ca030864a3a1c24be6b9d1802c2353da4ca0d441
/classes4.dex_source_from_JADX/com/facebook/clashmanagement/manager/STATICDI_MULTIBIND_PROVIDER$ClashUnit.java
f8ba0befb5ebecc3878752489601f11198414641
[]
no_license
pxson001/facebook-app
87aa51e29195eeaae69adeb30219547f83a5b7b1
640630f078980f9818049625ebc42569c67c69f7
refs/heads/master
2020-04-07T20:36:45.758523
2018-03-07T09:04:57
2018-03-07T09:04:57
124,208,458
4
0
null
null
null
null
UTF-8
Java
false
false
1,102
java
package com.facebook.clashmanagement.manager; import com.facebook.inject.Injector; import com.facebook.inject.InjectorLike; import com.facebook.inject.MultiBindIndexedProvider; import com.facebook.inject.MultiBinderSet; import java.util.Set; import javax.inject.Provider; /* compiled from: updateDeviceSyncOlderPhotosOnServer */ public final class STATICDI_MULTIBIND_PROVIDER$ClashUnit implements MultiBindIndexedProvider<ClashUnit>, Provider<Set<ClashUnit>> { private final InjectorLike f9915a; public STATICDI_MULTIBIND_PROVIDER$ClashUnit(InjectorLike injectorLike) { this.f9915a = injectorLike; } public final Object get() { return new MultiBinderSet(this.f9915a.getScopeAwareInjector(), this); } public final int size() { return 1; } public final Object provide(Injector injector, int i) { switch (i) { case 0: return new ClashUnitBase(ClashManager.m10297a((InjectorLike) injector)); default: throw new IllegalArgumentException("Invalid binding index"); } } }
[ "son.pham@jmango360.com" ]
son.pham@jmango360.com
ae09c38baccfef9283db6a6168d35963d741dbc2
0d36e8d7aa9727b910cb2ed6ff96eecb4444b782
/backends/pelioncloud_devicemanagement/src/main/java/com/arm/mbed/cloud/sdk/lowlevel/pelionclouddevicemanagement/model/CfsslAttributes.java
5fd81015a251c76a440234d156696601e076dac5
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
PelionIoT/mbed-cloud-sdk-java
b6d93f7e22c5afa30a51329b60e0f33c042ef00e
cc99c51db43cc9ae36601f20f20b7d8cd7515432
refs/heads/master
2023-08-19T01:25:29.548242
2020-07-01T16:48:16
2020-07-01T16:48:16
95,459,293
0
1
Apache-2.0
2021-01-15T08:44:08
2017-06-26T15:06:56
Java
UTF-8
Java
false
false
4,058
java
/* * Pelion Device Management API * Pelion Device Management API build from the publicly defined API definitions. * * OpenAPI spec version: 3 * * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ package com.arm.mbed.cloud.sdk.lowlevel.pelionclouddevicemanagement.model; import java.util.Objects; import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; /** * Describes the attributes required to connect to the CFSSL server. */ @ApiModel(description = "Describes the attributes required to connect to the CFSSL server. ") public class CfsslAttributes implements Serializable { private static final long serialVersionUID = 1L; @SerializedName("cfssl_label") private String cfsslLabel = null; @SerializedName("cfssl_profile") private String cfsslProfile = null; @SerializedName("host_url") private String hostUrl = null; public CfsslAttributes cfsslLabel(String cfsslLabel) { this.cfsslLabel = cfsslLabel; return this; } /** * The label that is used by CFSSL when creating the certificate. * * @return cfsslLabel **/ @ApiModelProperty(value = "The label that is used by CFSSL when creating the certificate. ") public String getCfsslLabel() { return cfsslLabel; } public void setCfsslLabel(String cfsslLabel) { this.cfsslLabel = cfsslLabel; } public CfsslAttributes cfsslProfile(String cfsslProfile) { this.cfsslProfile = cfsslProfile; return this; } /** * The profile that is configured on the CFSSL server and is used by CFSSL when creating the certificate. * * @return cfsslProfile **/ @ApiModelProperty(value = "The profile that is configured on the CFSSL server and is used by CFSSL when creating the certificate. ") public String getCfsslProfile() { return cfsslProfile; } public void setCfsslProfile(String cfsslProfile) { this.cfsslProfile = cfsslProfile; } public CfsslAttributes hostUrl(String hostUrl) { this.hostUrl = hostUrl; return this; } /** * The URL to connect to the CFSSL server. * * @return hostUrl **/ @ApiModelProperty(required = true, value = "The URL to connect to the CFSSL server. ") public String getHostUrl() { return hostUrl; } public void setHostUrl(String hostUrl) { this.hostUrl = hostUrl; } @Override public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } CfsslAttributes cfsslAttributes = (CfsslAttributes) o; return Objects.equals(this.cfsslLabel, cfsslAttributes.cfsslLabel) && Objects.equals(this.cfsslProfile, cfsslAttributes.cfsslProfile) && Objects.equals(this.hostUrl, cfsslAttributes.hostUrl); } @Override public int hashCode() { return Objects.hash(cfsslLabel, cfsslProfile, hostUrl); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CfsslAttributes {\n"); sb.append(" cfsslLabel: ").append(toIndentedString(cfsslLabel)).append("\n"); sb.append(" cfsslProfile: ").append(toIndentedString(cfsslProfile)).append("\n"); sb.append(" hostUrl: ").append(toIndentedString(hostUrl)).append("\n"); sb.append("}"); return sb.toString(); } /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } }
[ "adrien.cabarbaye@arm.com" ]
adrien.cabarbaye@arm.com
b70472b3c0acf60511426f477f702eb4d55bdbd5
7147c694b2917c716c3e3673a1055128bcb44586
/app/src/main/java/com/hdmoviez/full/hdmoviez_adapter/ReplyAdapter.java
fd5cc11072dc87532a362c5633a7c0ae6ffdfd35
[]
no_license
fandofastest/radjabarusinop
64046864f02af9d5b03cb3223f10f23e6027a8b0
e66794b0298073d772e2517ea75c87f11be17124
refs/heads/master
2021-01-14T22:24:42.044500
2020-02-24T16:01:55
2020-02-24T16:01:55
242,779,220
0
0
null
null
null
null
UTF-8
Java
false
false
2,036
java
package com.hdmoviez.full.hdmoviez_adapter; import android.content.Context; import androidx.recyclerview.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import com.hdmoviez.full.R; import com.hdmoviez.full.hdmoviez_model.CommentsModel; import com.mikhaellopez.circularimageview.CircularImageView; import com.squareup.picasso.Picasso; import java.util.ArrayList; import java.util.List; public class ReplyAdapter extends RecyclerView.Adapter<ReplyAdapter.OriginalViewHolder> { private List<CommentsModel> items = new ArrayList<>(); private Context ctx; public ReplyAdapter(Context context, List<CommentsModel> items) { this.items = items; ctx = context; } @Override public ReplyAdapter.OriginalViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { ReplyAdapter.OriginalViewHolder vh; View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.card_reply, parent, false); vh = new ReplyAdapter.OriginalViewHolder(v); return vh; } @Override public void onBindViewHolder(ReplyAdapter.OriginalViewHolder holder, final int position) { final CommentsModel obj = items.get(position); holder.name.setText(obj.getName()); holder.comment.setText(obj.getComment()); Picasso.get().load(obj.getImage()).into(holder.imageView); } @Override public int getItemCount() { return items.size(); } public class OriginalViewHolder extends RecyclerView.ViewHolder { private TextView name,comment; private View lyt_parent; private CircularImageView imageView; public OriginalViewHolder(View v) { super(v); name = v.findViewById(R.id.name); lyt_parent=v.findViewById(R.id.lyt_parent); imageView=v.findViewById(R.id.profile_img); comment=v.findViewById(R.id.comments); } } }
[ "fandofast@gmail.com" ]
fandofast@gmail.com
bf40448ebb7f722a0ba1d1f0d8257b12b0831ea0
eb7240bd1ab4bccdeca51a7d56bc7c948633467c
/spring_day02_c/src/test/java/cn/itcast/test/SpringJunit.java
4ce4a93cb6d9c5ccaf328565f86c0e9409ce255c
[]
no_license
yp684320/sms
00890946d76d9d9d9c12eea3e58535222c25bbc5
9bc5a574db6436cefbeb57b4a4639907a16c613f
refs/heads/master
2020-05-03T13:31:59.839678
2019-03-31T06:37:14
2019-03-31T06:37:14
178,655,242
1
0
null
null
null
null
UTF-8
Java
false
false
762
java
package cn.itcast.test; import cn.itcast.domain.Account; import cn.itcast.service.AccountService; import cn.itcast.utils.SpringConfig; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @RunWith(value = SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = SpringConfig.class) public class SpringJunit { @Autowired private AccountService accountService; @Test public void test(){ Account account = new Account(); account.setName("张开"); account.setMoney(123); accountService.save(account); } }
[ "naiba@example.com" ]
naiba@example.com
6e1b2acf5d3d993c474c6801e6e2f1ef3861848c
f6afbdc062a008eb1e103e14ca8777164dd22adf
/src/test/java/userRegistration/FiliIOPractice/EmployeePayrollServiceTest.java
7ae4f37d6df4865c412029bd4e0026b38961657f
[]
no_license
Ziyan7/EmployeePayroll
aac231ec3900958a5613f12268eae53b4a6c7d63
83bb22061c6326c37791c6921ec36f8787c5fbe2
refs/heads/master
2023-08-15T21:45:43.166370
2021-09-24T18:14:38
2021-09-24T18:14:38
408,470,446
0
0
null
null
null
null
UTF-8
Java
false
false
1,262
java
package userRegistration.FiliIOPractice; import static org.junit.Assert.assertEquals; import java.util.*; import org.junit.Test; import userRegistration.FiliIOPractice.EmployeePayrollService.IOService; public class EmployeePayrollServiceTest { @Test public void given3EmployeesWhenWrittenToFileShouldMatchEmployeeEntries() { EmployeePayrollData[] arrayOfEmps= { new EmployeePayrollData(1," Jeff Bezos",100000.0), new EmployeePayrollData(2,"Bill Gates",200000.0), new EmployeePayrollData(3,"Mark Zuckerberg",300000.0) }; EmployeePayrollService employeePayrollService; employeePayrollService =new EmployeePayrollService(Arrays.asList(arrayOfEmps)); employeePayrollService.writeEmployeePayrollData(IOService.FIlE_IO); long entries=employeePayrollService.countEntries(IOService.FIlE_IO); employeePayrollService.printData(); assertEquals(3,entries); } @Test public void givenFileOnReadingFromFileShouldMatchEmployeeCout() { EmployeePayrollService employeePayrollService = new EmployeePayrollService(); long entries=employeePayrollService.readEmployeePayrollData(); assertEquals(3,entries); } }
[ "you@example.com" ]
you@example.com
2c6f577e4997bbc7f19ba9f31f08e8dd8da54203
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
/data_defect4j/preprossed_method_corpus/Math/106/org/apache/commons/math/util/MathUtils_sign_662.java
4e8d468c7eacb23efcba69560e9f361ccf6cd29e
[]
no_license
hvdthong/NetML
dca6cf4d34c5799b400d718e0a6cd2e0b167297d
9bb103da21327912e5a29cbf9be9ff4d058731a5
refs/heads/master
2021-06-30T15:03:52.618255
2020-10-07T01:58:48
2020-10-07T01:58:48
150,383,588
1
1
null
2018-09-26T07:08:45
2018-09-26T07:08:44
null
UTF-8
Java
false
false
986
java
org apach common math util addit built function link math version revis date math util mathutil return href http mathworld wolfram sign html sign code code method return return code nan code code code code nan code param depend sign sign float isnan float nan
[ "hvdthong@gmail.com" ]
hvdthong@gmail.com
61f371fac99c287c3b98c4108f48e6f00c43674a
702a887dd2fab974028e33fdf8579afb89af1e65
/ListStackQueuesAndPriorityQueues/src/com/doganilbars/collections005/Test2.java
ddeb1284d6939074cd7c946ce0311d3830048993
[]
no_license
hacidoganilbars/IntroductionToJavaProgramming
1fe51a8d1284b6ae17ce43885ff30cf0635e3517
fed2ac02f2008bdb35ca50817ec77e8fbf27a36a
refs/heads/master
2020-03-17T19:30:06.282000
2018-07-02T21:22:45
2018-07-02T21:22:45
133,865,561
0
0
null
null
null
null
UTF-8
Java
false
false
648
java
package com.doganilbars.collections005; import java.util.Arrays; import java.util.Collections; import java.util.List; public class Test2 { public static void main(String[] args) { List<Integer> list = Arrays.asList(2, 4, 7, 10, 11, 45, 50, 59, 60, 66); System.out.println("(1) Index: " + Collections.binarySearch(list, 7)); System.out.println("(2) Index: " + Collections.binarySearch(list, 9)); List<String> list1 = Arrays.asList("blue", "green", "red"); System.out.println("(3) Index: " + Collections.binarySearch(list1, "red")); System.out.println("(4) Index: " + Collections.binarySearch(list1, "cyan")); } }
[ "hd.ilbars@hotmail.com" ]
hd.ilbars@hotmail.com
fdea458b60e0b4df6d053bb1001241212cd54f42
a09837c60989658cb3a3bb7dfe99baa4bf96026f
/src/dk/brics/tajs/options/TAJSEnvironmentConfig.java
e95900369d78fafe2e9673af88f25bc4f7228090
[ "Apache-2.0" ]
permissive
theosotr/async-tajs
99a6bdb9ed78da80ca6f993a6de6798926e35e4a
2519b1913c5e542ac4d6f692b0c549033886aaf5
refs/heads/develop
2020-04-11T08:03:30.907228
2020-02-18T17:19:30
2020-02-18T17:19:30
161,630,564
5
2
Apache-2.0
2020-02-18T17:19:31
2018-12-13T11:40:36
Java
UTF-8
Java
false
false
6,451
java
/* * Copyright 2009-2018 Aarhus University * * 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 dk.brics.tajs.options; import dk.brics.tajs.util.AnalysisException; import dk.brics.tajs.util.Collectors; import java.io.FileInputStream; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Properties; import static dk.brics.tajs.util.Collections.newList; /** * Manages system-local environment properties. * <p> * Searches for a .tajsconfig file in the working directory or one of its ancestors until the file is found. */ public class TAJSEnvironmentConfig { private static final String filename = ".tajsconfig"; private static TAJSEnvironmentConfig instance; private final Properties properties; public TAJSEnvironmentConfig(Properties properties) { this.properties = properties; } public static Properties findProperties() { Properties prop = new Properties(); setDefaults(prop); findOrderedConfigFiles().forEach(config -> { try { prop.load(new FileInputStream(config.toFile())); prop.forEach((k, v) -> { try { Path vpath = Paths.get((String) v); if (!vpath.isAbsolute()) { String newPath = config.getParent().resolve(vpath).toAbsolutePath().toString(); if (Files.exists(Paths.get(newPath))) { prop.setProperty((String) k, newPath); } } } catch (Exception ignored) { } }); } catch (IOException e) { throw new AnalysisException(e); } } ); return prop; } private static Path resolveAccordingToPath(String cmd) { String PATH = System.getenv("PATH"); String[] paths = PATH.split(":"); for (String path : paths) { Path assumed = Paths.get(path).resolve(cmd); if (Files.exists(assumed)) { return assumed; } } return null; } private static void setDefaults(Properties p) { Path nodePath = resolveAccordingToPath("node"); if (nodePath != null) { p.setProperty("node", nodePath.toAbsolutePath().toString()); } Path jjsPath = resolveAccordingToPath("jjs"); if (jjsPath != null) { p.setProperty("jjs", jjsPath.toAbsolutePath().toString()); } } public static void init() { if (Options.get().getConfig() == null) { TAJSEnvironmentConfig.init(TAJSEnvironmentConfig.findProperties()); } else { Properties properties = new Properties(); try (FileInputStream fis = new FileInputStream(Options.get().getConfig())) { properties.load(fis); } catch (IOException e) { throw new AnalysisException(e); } TAJSEnvironmentConfig.init(properties); } } public static void init(Properties properties) { instance = new TAJSEnvironmentConfig(properties); } public static TAJSEnvironmentConfig get() { return instance; } /** * Finds all .tajsconfig files on the directory path from the working directory to the root of the file system. */ private static List<Path> findOrderedConfigFiles() { Path parent = Paths.get("").toAbsolutePath(); List<Path> configFiles = newList(); while (parent != null && Files.exists(parent)) { Path file = parent.resolve(filename); if (Files.exists(file)) { configFiles.add(file); } parent = parent.getParent(); } Collections.reverse(configFiles); return configFiles; } public Path getNode() { return Paths.get(getRequiredProperty("node")); } public Path getJSDelta() { return Paths.get(getRequiredProperty("jsdelta")); } private String getRequiredProperty(String name) { String property = properties.getProperty(name); if (property == null) { throw new AnalysisException(String.format("Property '%s' in %s is needed, but not defined!", name, filename)); } return property; } public boolean isDesktopEnabled() { String property = properties.getProperty("desktop"); if (property == null) { return true; // default enabled } Boolean desktop = Boolean.valueOf(property); if (desktop && !java.awt.Desktop.isDesktopSupported()) { throw new AnalysisException("Invalid TAJS configuration: desktop-usage is explicitly enabled, but the platform does not support desktops!"); } return desktop; } public Path getGnuPlot() { return Paths.get(getRequiredProperty("gnuplot")); } public Path getLatex() { return Paths.get(getRequiredProperty("latex")); } public List<Integer> getJSDeltaServerPorts() { String property = properties.getProperty("jsdeltaserverports"); if (property == null) { return newList(); // default none } return Arrays.stream(property.split(" ")) .map(Integer::parseInt) .collect(Collectors.toList()); } public String getCustom(String name) { return getRequiredProperty(name); } public boolean hasProperty(String name) { return properties.getProperty(name) != null; } }
[ "theosotr@aueb.gr" ]
theosotr@aueb.gr
c4149391715f7df3e544d715515408ef5f435263
7e2771140ef7d204680aafe8edcc5019660a562d
/java-project2-server/src19/main/java/com/eomcs/lms/handler/BoardDeleteCommand.java
46e6e9c3aed39b75aca3772661af231ea1a0fbec
[]
no_license
cdis001/bitcamp-java-2018-12
8d63c8bfe01beb8db40bd14d04c433281223f0ed
cd3e10f26c1bc803f56fd6fa0a3e645d54146a66
refs/heads/master
2021-07-24T01:35:14.360793
2020-05-08T08:18:11
2020-05-08T08:18:11
163,650,671
0
0
null
null
null
null
UTF-8
Java
false
false
735
java
package com.eomcs.lms.handler; import com.eomcs.lms.context.Component; import com.eomcs.lms.dao.BoardDao; @Component("/board/delete") public class BoardDeleteCommand extends AbstractCommand { BoardDao boardDao; public BoardDeleteCommand(BoardDao boardDao) { this.boardDao = boardDao; } @Override public void execute(Response response) throws Exception { try { int no = response.requestInt("번호?"); if (boardDao.delete(no) == 0) { response.println("해당 번호의 게시물이 없습니다."); return; } response.println("삭제했습니다."); } catch (Exception e) { response.println(String.format("실행 오류! : %s\n", e.getMessage())); } } }
[ "shopingid@naver.com" ]
shopingid@naver.com
d9ef7c6c6fbbb1bfadec67e102e9db5fcd4d8a27
5483eb988acf28a9b3d3ead2b3fd1464b212b5fc
/src/web/com/vriche/adrm/webapp/action/OaBusinessCardTypeAction.java
0816e6fa32b01e5ef346501dc3432cb1ca9f43be
[]
no_license
vriche/adrm
0bcce806716bdc7aa1adc12c20d590e9c37356df
c5e83dc91b831d430962a7079e9a54b7e82b7fa8
refs/heads/master
2020-04-06T23:42:19.947104
2016-07-14T01:31:31
2017-04-01T03:58:15
24,831,175
0
0
null
null
null
null
UTF-8
Java
false
false
7,102
java
package com.vriche.adrm.webapp.action; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionMessage; import org.apache.struts.action.ActionMessages; import com.ibatis.common.util.PaginatedList; import com.vriche.adrm.webapp.action.BaseAction; import com.vriche.adrm.Constants; import com.vriche.adrm.model.OaBusinessCardType; import com.vriche.adrm.service.OaBusinessCardTypeManager; import com.vriche.adrm.webapp.form.OaBusinessCardTypeForm; import com.vriche.adrm.Constants; import com.vriche.adrm.util.Page; /** * Action class to handle CRUD on a OaBusinessCardType object * * @struts.action name="oaBusinessCardTypeForm" path="/oaBusinessCardTypes" scope="request" * validate="false" parameter="method" input="mainMenu" * @struts.action name="oaBusinessCardTypeForm" path="/editOaBusinessCardType" scope="request" * validate="false" parameter="method" input="list" * @struts.action name="oaBusinessCardTypeForm" path="/saveOaBusinessCardType" scope="request" * validate="true" parameter="method" input="edit" * @struts.action-set-property property="cancellable" value="true" * @struts.action-forward name="edit" path="/WEB-INF/pages/tools/oaBusinessCardTypeForm.jsp" * @struts.action-forward name="list" path="/WEB-INF/pages/tools/oaBusinessCardTypeList.jsp" * @struts.action-forward name="search" path="/oaBusinessCardTypes.html" redirect="true" */ public final class OaBusinessCardTypeAction extends BaseAction { public ActionForward cancel(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { return mapping.findForward("search"); } public ActionForward delete(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { if (log.isDebugEnabled()) { log.debug("Entering 'delete' method"); } ActionMessages messages = new ActionMessages(); OaBusinessCardTypeForm oaBusinessCardTypeForm = (OaBusinessCardTypeForm) form; // Exceptions are caught by ActionExceptionHandler OaBusinessCardTypeManager mgr = (OaBusinessCardTypeManager) getBean("oaBusinessCardTypeManager"); mgr.removeOaBusinessCardType(oaBusinessCardTypeForm.getId()); messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("oaBusinessCardType.deleted")); // save messages in session, so they'll survive the redirect saveMessages(request.getSession(), messages); return mapping.findForward("search"); } public ActionForward edit(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { if (log.isDebugEnabled()) { log.debug("Entering 'edit' method"); } OaBusinessCardTypeForm oaBusinessCardTypeForm = (OaBusinessCardTypeForm) form; // if an id is passed in, look up the user - otherwise // don't do anything - user is doing an add if (oaBusinessCardTypeForm.getId() != null) { OaBusinessCardTypeManager mgr = (OaBusinessCardTypeManager) getBean("oaBusinessCardTypeManager"); OaBusinessCardType oaBusinessCardType = mgr.getOaBusinessCardType(oaBusinessCardTypeForm.getId()); oaBusinessCardTypeForm = (OaBusinessCardTypeForm) convert(oaBusinessCardType); updateFormBean(mapping, request, oaBusinessCardTypeForm); } return mapping.findForward("edit"); } public ActionForward save(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { if (log.isDebugEnabled()) { log.debug("Entering 'save' method"); } // Extract attributes and parameters we will need ActionMessages messages = new ActionMessages(); OaBusinessCardTypeForm oaBusinessCardTypeForm = (OaBusinessCardTypeForm) form; boolean isNew = ("".equals(oaBusinessCardTypeForm.getId()) || oaBusinessCardTypeForm.getId() == null); OaBusinessCardTypeManager mgr = (OaBusinessCardTypeManager) getBean("oaBusinessCardTypeManager"); OaBusinessCardType oaBusinessCardType = (OaBusinessCardType) convert(oaBusinessCardTypeForm); mgr.saveOaBusinessCardType(oaBusinessCardType); // add success messages if (isNew) { messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("oaBusinessCardType.added")); // save messages in session to survive a redirect saveMessages(request.getSession(), messages); return mapping.findForward("search"); } else { messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("oaBusinessCardType.updated")); saveMessages(request, messages); return mapping.findForward("edit"); } } public ActionForward search(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { if (log.isDebugEnabled()) { log.debug("Entering 'search' method"); } OaBusinessCardTypeForm oaBusinessCardTypeForm = (OaBusinessCardTypeForm) form; OaBusinessCardType oaBusinessCardType = (OaBusinessCardType) convert(oaBusinessCardTypeForm); OaBusinessCardTypeManager mgr = (OaBusinessCardTypeManager) getBean("oaBusinessCardTypeManager"); oaBusinessCardType = null; int resultSize = Integer.parseInt(mgr.getOaBusinessCardTypesCount(oaBusinessCardType)); Page page = new Page(Constants.OABUSINESSCARDTYPE_LIST,request); PaginatedList pageList = mgr.getOaBusinessCardTypesPage(oaBusinessCardType,page.getPageIndex().toString(),page.getPageSize().toString()); pageList.gotoPage(page.getPageIndex().intValue()); request.setAttribute(Constants.RESULT_SIZE, new Integer(resultSize)); request.setAttribute(Constants.OABUSINESSCARDTYPE_LIST, pageList); //request.setAttribute(Constants.OABUSINESSCARDTYPE_LIST, mgr.getOaBusinessCardTypes(oaBusinessCardType)); return mapping.findForward("list"); } public ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { return search(mapping, form, request, response); } }
[ "46430212@qq.com" ]
46430212@qq.com
158edd627524ec2543839b90ff9369bbc89fc0da
96728eb22c29f238762c843ed4446afd38be0d38
/src/main/java/org/erpmicroservices/peopleandorganizations/endpoint/graphql/name/NameTypeConnection.java
724e4e51713dbd83b8fabb5dd4e5ac7a1ee10168
[]
no_license
ErpMicroServices/people_and_organizations-endpoint-graphql
cedce0458b6055ae9cd22fb3ea66b0366fd0a5e3
952d47c8b18ddc603b0c12e2915f3ac467d3652b
refs/heads/master
2023-06-25T00:30:15.756016
2023-06-14T04:48:44
2023-06-14T04:48:44
84,111,703
0
0
null
2023-06-14T04:48:46
2017-03-06T19:23:12
Java
UTF-8
Java
false
false
798
java
package org.erpmicroservices.peopleandorganizations.endpoint.graphql.name; import graphql.relay.Edge; import lombok.Builder; import lombok.Data; import org.erpmicroservices.peopleandorganizations.endpoint.graphql.dto.Connection; import org.erpmicroservices.peopleandorganizations.endpoint.graphql.dto.PageInfo; import java.util.List; @Data @Builder public class NameTypeConnection implements Connection<NameType> { private List<Edge<NameType>> edges; private PageInfo pageInfo; /** * @return a list of {@link Edge}s that are really a node of data and its cursor */ @Override public List<Edge<NameType>> getEdges() { return edges; } /** * @return {@link PageInfo} pagination data about that list of edges */ @Override public PageInfo getPageInfo() { return pageInfo; } }
[ "Jim.Barrows@gmail.com" ]
Jim.Barrows@gmail.com
8135f878f0631cb7ae389f5ee3be0c9a66c5fd17
67204b235db0a42b45a21cee78c8cb6118201837
/src/com/fengling/core/entity/Ftp.java
f174498cafbff9266bd2addb4119678190a94b08
[]
no_license
nextflower/fengling
ed5d6f636587c2cd427fb10b12f29a807c7f7f7f
11b6536f6d3c1faf3e8e6629e8cef7f90cb6c7c2
refs/heads/master
2021-01-25T05:35:44.356765
2015-05-05T15:00:41
2015-05-05T15:00:41
33,312,953
0
0
null
null
null
null
UTF-8
Java
false
false
5,426
java
package com.fengling.core.entity; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.PrintWriter; import java.net.SocketException; import java.util.List; import org.apache.commons.io.FileUtils; import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang.StringUtils; import org.apache.commons.net.PrintCommandListener; import org.apache.commons.net.ftp.FTP; import org.apache.commons.net.ftp.FTPClient; import org.apache.commons.net.ftp.FTPReply; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.fengling.common.upload.UploadUtils; import com.fengling.common.util.MyFileUtils; import com.fengling.core.entity.base.BaseFtp; public class Ftp extends BaseFtp { private static final long serialVersionUID = 1L; private static final Logger log = LoggerFactory.getLogger(Ftp.class); public String storeByExt(String path, String ext, InputStream in) throws IOException { String filename = UploadUtils.generateFilename(path, ext); store(filename, in); return filename; } public String storeByFilename(String filename, InputStream in) throws IOException { store(filename, in); return filename; } public File retrieve(String name,String fileName) throws IOException { String path = System.getProperty("java.io.tmpdir"); File file = new File(path, fileName); file = UploadUtils.getUniqueFile(file); FTPClient ftp = getClient(); OutputStream output = new FileOutputStream(file); ftp.retrieveFile(getPath() + name, output); output.close(); ftp.logout(); ftp.disconnect(); return file; } public boolean restore(String name, File file) throws IOException { store(name, FileUtils.openInputStream(file)); file.deleteOnExit(); return true; } public int storeByFloder(String folder,String rootPath){ String fileAbsolutePath; String fileRelativePath; try { FTPClient ftp = getClient(); if (ftp != null) { List<File>files=MyFileUtils.getFiles(new File(folder)); for(File file:files){ String filename = getPath() + file.getName(); String name = FilenameUtils.getName(filename); String path = FilenameUtils.getFullPath(filename); fileAbsolutePath=file.getAbsolutePath(); fileRelativePath=fileAbsolutePath.substring(rootPath.length()+1,fileAbsolutePath.indexOf(name)); path+=fileRelativePath.replace("\\", "/"); if (!ftp.changeWorkingDirectory(path)) { String[] ps = StringUtils.split(path, '/'); String p = "/"; ftp.changeWorkingDirectory(p); for (String s : ps) { p += s + "/"; if (!ftp.changeWorkingDirectory(p)) { ftp.makeDirectory(s); ftp.changeWorkingDirectory(p); } } } //解决中文乱码问题 name=new String(name.getBytes(getEncoding()),"iso-8859-1"); if(!file.isFile()){ ftp.makeDirectory(name); }else{ InputStream in=new FileInputStream(file.getAbsolutePath()); ftp.storeFile(name, in); in.close(); } } ftp.logout(); ftp.disconnect(); } return 0; } catch (SocketException e) { log.error("ftp store error", e); return 3; } catch (IOException e) { log.error("ftp store error", e); return 4; } } private int store(String remote, InputStream in) { try { FTPClient ftp = getClient(); if (ftp != null) { String filename = getPath() + remote; String name = FilenameUtils.getName(filename); String path = FilenameUtils.getFullPath(filename); if (!ftp.changeWorkingDirectory(path)) { String[] ps = StringUtils.split(path, '/'); String p = "/"; ftp.changeWorkingDirectory(p); for (String s : ps) { p += s + "/"; if (!ftp.changeWorkingDirectory(p)) { ftp.makeDirectory(s); ftp.changeWorkingDirectory(p); } } } ftp.storeFile(name, in); ftp.logout(); ftp.disconnect(); } in.close(); return 0; } catch (SocketException e) { log.error("ftp store error", e); return 3; } catch (IOException e) { log.error("ftp store error", e); return 4; } } private FTPClient getClient() throws SocketException, IOException { FTPClient ftp = new FTPClient(); ftp.addProtocolCommandListener(new PrintCommandListener( new PrintWriter(System.out))); ftp.setDefaultPort(getPort()); ftp.connect(getIp()); int reply = ftp.getReplyCode(); if (!FTPReply.isPositiveCompletion(reply)) { log.warn("FTP server refused connection: {}", getIp()); ftp.disconnect(); return null; } if (!ftp.login(getUsername(), getPassword())) { log.warn("FTP server refused login: {}, user: {}", getIp(), getUsername()); ftp.logout(); ftp.disconnect(); return null; } ftp.setControlEncoding(getEncoding()); ftp.setFileType(FTP.BINARY_FILE_TYPE); ftp.enterLocalPassiveMode(); return ftp; } /* [CONSTRUCTOR MARKER BEGIN] */ public Ftp () { super(); } /** * Constructor for primary key */ public Ftp (java.lang.Integer id) { super(id); } /** * Constructor for required fields */ public Ftp ( java.lang.Integer id, java.lang.String name, java.lang.String ip, java.lang.Integer port, java.lang.String encoding, java.lang.String url) { super ( id, name, ip, port, encoding, url); } /* [CONSTRUCTOR MARKER END] */ }
[ "dv3333@163.com" ]
dv3333@163.com
9b48a464cfe251e67fd657f53792a7d16692ddee
5eae683a6df0c4b97ab1ebcd4724a4bf062c1889
/bin/platform/bootstrap/gensrc/de/hybris/platform/promotionengineservices/model/RuleBasedOrderAdjustTotalActionModel.java
e126080e7833e77f222b90e872198b45012df606
[]
no_license
sujanrimal/GiftCardProject
1c5e8fe494e5c59cca58bbc76a755b1b0c0333bb
e0398eec9f4ec436d20764898a0255f32aac3d0c
refs/heads/master
2020-12-11T18:05:17.413472
2020-01-17T18:23:44
2020-01-17T18:23:44
233,911,127
0
0
null
2020-06-18T15:26:11
2020-01-14T18:44:18
null
UTF-8
Java
false
false
3,232
java
/* * ---------------------------------------------------------------- * --- WARNING: THIS FILE IS GENERATED AND WILL BE OVERWRITTEN! --- * --- Generated at Jan 17, 2020 11:49:26 AM --- * ---------------------------------------------------------------- * * [y] hybris Platform * Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. * This software is the confidential and proprietary information of SAP * ("Confidential Information"). You shall not disclose such Confidential * Information and shall use it only in accordance with the terms of the * license agreement you entered into with SAP. */ package de.hybris.platform.promotionengineservices.model; import de.hybris.bootstrap.annotations.Accessor; import de.hybris.platform.core.model.ItemModel; import de.hybris.platform.promotionengineservices.model.AbstractRuleBasedPromotionActionModel; import de.hybris.platform.servicelayer.model.ItemModelContext; import java.math.BigDecimal; /** * Generated model class for type RuleBasedOrderAdjustTotalAction first defined at extension promotionengineservices. */ @SuppressWarnings("all") public class RuleBasedOrderAdjustTotalActionModel extends AbstractRuleBasedPromotionActionModel { /**<i>Generated model type code constant.</i>*/ public static final String _TYPECODE = "RuleBasedOrderAdjustTotalAction"; /** <i>Generated constant</i> - Attribute key of <code>RuleBasedOrderAdjustTotalAction.amount</code> attribute defined at extension <code>promotionengineservices</code>. */ public static final String AMOUNT = "amount"; /** * <i>Generated constructor</i> - Default constructor for generic creation. */ public RuleBasedOrderAdjustTotalActionModel() { super(); } /** * <i>Generated constructor</i> - Default constructor for creation with existing context * @param ctx the model context to be injected, must not be null */ public RuleBasedOrderAdjustTotalActionModel(final ItemModelContext ctx) { super(ctx); } /** * <i>Generated constructor</i> - for all mandatory and initial attributes. * @deprecated since 4.1.1 Please use the default constructor without parameters * @param _owner initial attribute declared by type <code>Item</code> at extension <code>core</code> */ @Deprecated public RuleBasedOrderAdjustTotalActionModel(final ItemModel _owner) { super(); setOwner(_owner); } /** * <i>Generated method</i> - Getter of the <code>RuleBasedOrderAdjustTotalAction.amount</code> attribute defined at extension <code>promotionengineservices</code>. * @return the amount - The amount to adjust the cart total by. */ @Accessor(qualifier = "amount", type = Accessor.Type.GETTER) public BigDecimal getAmount() { return getPersistenceContext().getPropertyValue(AMOUNT); } /** * <i>Generated method</i> - Setter of <code>RuleBasedOrderAdjustTotalAction.amount</code> attribute defined at extension <code>promotionengineservices</code>. * * @param value the amount - The amount to adjust the cart total by. */ @Accessor(qualifier = "amount", type = Accessor.Type.SETTER) public void setAmount(final BigDecimal value) { getPersistenceContext().setPropertyValue(AMOUNT, value); } }
[ "travis.d.crawford@accenture.com" ]
travis.d.crawford@accenture.com
603aa9ef3589d8e2bdf6db18eb98f297027f08bd
7e29baf56a22336ebba4526be439e633154785f1
/src/businessService/CRUDAprendizagem/manterAtividade/IMantAtividade.java
925ee671607f3efbffb2b3287ddad3a739eb0329
[]
no_license
thyagopacher/Collabora-UTFPR
b45029622f3a67eed00759e7c655bb1f6d895634
b2a10efdc473b962d9b2c2f891fcfd22b303e650
refs/heads/main
2023-03-21T04:40:30.695092
2021-03-04T16:47:02
2021-03-04T16:47:02
344,543,192
0
0
null
null
null
null
UTF-8
Java
false
false
265
java
package businessService.CRUDAprendizagem.manterAtividade; import modelObjects.Atividade; public interface IMantAtividade { public boolean insert(Atividade atividade); public boolean update(Atividade atividade); public boolean delete(Atividade atividade); }
[ "thyago.pacher@gmail.com" ]
thyago.pacher@gmail.com
60feb53446de51793ace8ebbd9c1348f28de96ae
efd54286d87371d6305fc0a754a9a9ef2147955b
/src/net/ememed/user2/db/SearchRecordsDao.java
c7ce1db4766c3e1dbeeb3cce2b98b5190e41701d
[]
no_license
eltld/user
3127b1f58ab294684eba3ff27446da14f2b51da0
f5087033d4da190856627a98fe532e158465aa60
refs/heads/master
2020-12-03T10:26:45.629899
2015-04-30T10:22:14
2015-04-30T10:22:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,025
java
package net.ememed.user2.db; import java.util.ArrayList; import java.util.List; import net.ememed.user2.entity.InviteMessage; import net.ememed.user2.entity.InviteMessage.InviteMesageStatus; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; public class SearchRecordsDao { public static final String TABLE_NAME = "search_records"; public static final String COLUMN_ID = "id"; public static final String COLUMN_CONTENT = "content"; private DbOpenHelper dbHelper; public SearchRecordsDao(Context context){ dbHelper = DbOpenHelper.getInstance(context); } /** * 保存搜素记录 * @param str * @return 返回这条记录在db中的id */ public synchronized Integer saveSearchRecord(String str){ SQLiteDatabase db = dbHelper.getWritableDatabase(); int id = -1; if(db.isOpen()){ ContentValues values = new ContentValues(); values.put(COLUMN_CONTENT, str); db.insert(TABLE_NAME, null, values); Cursor cursor = db.rawQuery("select last_insert_rowid() from " + TABLE_NAME,null); if(cursor.moveToFirst()){ id = cursor.getInt(0); } } return id; } /** * 获取搜索记录 * @return */ public List<String> getSearchRecords(){ SQLiteDatabase db = dbHelper.getReadableDatabase(); List<String> records = new ArrayList<String>(); if(db.isOpen()){ Cursor cursor = db.rawQuery("select * from " + TABLE_NAME + " order by " + COLUMN_ID + " desc",null); while(cursor.moveToNext()){ String record = null; int id = cursor.getInt(cursor.getColumnIndex(COLUMN_ID)); record = cursor.getString(cursor.getColumnIndex(COLUMN_CONTENT)); records.add(record); } cursor.close(); } return records; } public void deleteSearchRecord(String record){ SQLiteDatabase db = dbHelper.getWritableDatabase(); if(db.isOpen()){ db.delete(TABLE_NAME, COLUMN_CONTENT + " = ?", new String[]{record}); } } }
[ "happyjie.1988@163.com" ]
happyjie.1988@163.com
f5bb0521b5d41816eaeb29bd7743a6fd47f0e623
7b73756ba240202ea92f8f0c5c51c8343c0efa5f
/classes/sks.java
2358c66c827f6945d4600d5980f82d2287e677dc
[]
no_license
meeidol-luo/qooq
588a4ca6d8ad579b28dec66ec8084399fb0991ef
e723920ac555e99d5325b1d4024552383713c28d
refs/heads/master
2020-03-27T03:16:06.616300
2016-10-08T07:33:58
2016-10-08T07:33:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
628
java
import android.content.DialogInterface; import android.content.DialogInterface.OnClickListener; import com.tencent.mobileqq.forward.ForwardBaseOption; import com.tencent.mobileqq.hotpatch.NotVerifyClass; public class sks implements DialogInterface.OnClickListener { public sks(ForwardBaseOption paramForwardBaseOption) { boolean bool = NotVerifyClass.DO_VERIFY_CLASS; } public void onClick(DialogInterface paramDialogInterface, int paramInt) { this.a.l(); } } /* Location: E:\apk\QQ_91\classes-dex2jar.jar!\sks.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "1776098770@qq.com" ]
1776098770@qq.com
e97d7746b2644773276b470e270cd159da1a04bd
b39457336ec7ba8a08a3f3d887dcc31085da3a98
/trader-services/src/main/java/trader/TraderMainConfiguration.java
b43e0f9d7328f095eef5f5e799a921d42daa5316
[ "Apache-2.0" ]
permissive
SandersAlex/java-trader
507663caea27ce574e735f84bd64ad1f35372f11
fdfec690b5d4de2e5fbda1e1813fea26bd6a8b4d
refs/heads/master
2020-12-30T03:06:47.060418
2020-02-07T01:51:43
2020-02-07T01:51:43
238,841,202
1
0
Apache-2.0
2020-02-07T04:09:29
2020-02-07T04:09:28
null
UTF-8
Java
false
false
7,343
java
package trader; import java.lang.reflect.Method; import java.util.Arrays; import java.util.List; import java.util.concurrent.ScheduledThreadPoolExecutor; import java.util.concurrent.SynchronousQueue; import java.util.concurrent.ThreadFactory; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import javax.sql.DataSource; import org.eclipse.jetty.util.thread.ExecutorThreadPool; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler; import org.springframework.boot.jdbc.DataSourceBuilder; import org.springframework.boot.web.embedded.jetty.JettyServletWebServerFactory; import org.springframework.boot.web.server.ErrorPage; import org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan.Filter; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.FilterType; import org.springframework.context.annotation.Primary; import org.springframework.http.HttpStatus; import org.springframework.http.converter.FormHttpMessageConverter; import org.springframework.http.converter.HttpMessageConverter; import org.springframework.http.converter.ResourceHttpMessageConverter; import org.springframework.http.converter.StringHttpMessageConverter; import org.springframework.http.converter.json.GsonHttpMessageConverter; import org.springframework.scheduling.annotation.AsyncConfigurer; import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.SchedulingConfigurer; import org.springframework.scheduling.config.ScheduledTaskRegistrar; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import com.google.gson.GsonBuilder; import springfox.documentation.swagger2.annotations.EnableSwagger2; import trader.common.config.ConfigUtil; import trader.common.util.TraderHomeUtil; import trader.service.node.NodeMgmtService; import trader.service.node.NodeService; import trader.service.node.NodeServiceImpl; @Configuration @EnableScheduling @EnableAsync @EnableSwagger2 @ComponentScan( value={ "trader" }, excludeFilters= { @Filter(type = FilterType.ASSIGNABLE_TYPE, value=NodeMgmtService.class) } ) public class TraderMainConfiguration implements WebMvcConfigurer, SchedulingConfigurer, AsyncConfigurer, AsyncUncaughtExceptionHandler { private final static Logger logger = LoggerFactory.getLogger(TraderMainConfiguration.class); private ScheduledThreadPoolExecutor taskScheduler; private ThreadPoolExecutor asyncExecutor; public TraderMainConfiguration() { createThreadPools(); } @Bean public ConfigurableServletWebServerFactory webServerFactory() { JettyServletWebServerFactory factory = new JettyServletWebServerFactory(); int port = ConfigUtil.getInt("/BasisService/web.httpPort", 10080); factory.setPort(port); factory.setContextPath(""); factory.addErrorPages(new ErrorPage(HttpStatus.NOT_FOUND, "/notfound.html")); factory.setSelectors(1); factory.setAcceptors(1); factory.setThreadPool(new ExecutorThreadPool(executorService())); return factory; } @Override public void configureMessageConverters(List<HttpMessageConverter<?>> converters) { converters.add(new StringHttpMessageConverter()); converters.add(new FormHttpMessageConverter()); GsonHttpMessageConverter c = new GsonHttpMessageConverter(); c.setGson(new GsonBuilder().disableHtmlEscaping().create()); converters.add(c); converters.add(new ResourceHttpMessageConverter()); } @Override public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() { return this; } @Override public void handleUncaughtException(Throwable ex, Method method, Object... params) { logger.error("Async invocation on "+method+" "+Arrays.asList(params)+"failed: "+ex.toString(), ex); } @Override public void configureTasks(ScheduledTaskRegistrar taskRegistrar) { taskRegistrar.setScheduler(taskScheduler); } @Bean public NodeService nodeService() { return new NodeServiceImpl(); } @Primary @Bean public java.util.concurrent.ThreadPoolExecutor executorService(){ return asyncExecutor; } @Bean public java.util.concurrent.ScheduledExecutorService scheduledExecutorService(){ return taskScheduler; } @Bean(name="dataSource") public DataSource dataSource() throws Exception { //先试着用remote方式连接 String url = TraderHomeUtil.detectRepositoryURL(); String usr = "sa"; String pwd = ""; if ( url==null ) { logger.error("Connect to repository database failed"); throw new Exception("Connect to repository database failed"); } logger.info("Connect to H2 repository database in "+(url.indexOf("tcp")>0?"remote":"local")+" mode: "+url); DataSource ds = DataSourceBuilder.create() .driverClassName("org.h2.Driver") .url(url) .username(usr) .password(pwd) .build(); ; return ds; } private void createThreadPools() { taskScheduler = new ScheduledThreadPoolExecutor(3, new DefaultThreadFactory("TaskScheduler")); asyncExecutor = new ThreadPoolExecutor(3, Integer.MAX_VALUE, 60 ,TimeUnit.SECONDS, new SynchronousQueue<Runnable>(false), new DefaultThreadFactory("async")); asyncExecutor.allowCoreThreadTimeOut(true); } } class DefaultThreadFactory implements ThreadFactory { public static class PoolThreadGroup extends ThreadGroup{ private static final Logger logger = LoggerFactory.getLogger(PoolThreadGroup.class); public PoolThreadGroup(String name) { super(name); } @Override public void uncaughtException(Thread t, Throwable e) { logger.error("Thread "+t+" uncaught exception: "+e, e); } } private final ThreadGroup group; private final AtomicInteger threadNumber = new AtomicInteger(1); private int priority; private String poolName; public DefaultThreadFactory(String poolName){ this(poolName, Thread.NORM_PRIORITY); } public DefaultThreadFactory(String poolName, int priority){ this.priority = priority; this.poolName = poolName; SecurityManager s = System.getSecurityManager(); //group = (s != null) ? s.getThreadGroup() : // Thread.currentThread().getThreadGroup(); group = new PoolThreadGroup(poolName); } @Override public Thread newThread(Runnable r) { Thread t = new Thread(group, r, poolName + "-" + threadNumber.getAndIncrement(), 0); t.setDaemon(true); t.setPriority(priority); return t; } }
[ "zhugf000@gmail.com" ]
zhugf000@gmail.com
0e6dc734f31e50ab70d977a637d4f95811221177
83ec53285d2f805876665d70cd48cdaddb95047c
/aws-java-sdk-lambda/src/main/java/com/amazonaws/services/lambda/model/transform/GetFunctionResultJsonUnmarshaller.java
8845130d0fc533da364987a74113e5b69e5c2b02
[ "Apache-2.0", "JSON" ]
permissive
sarvex/aws-sdk-java
58d1d2094a689ab20925ad9b208a46008af5efb4
8cd1cfb947a419914ebf477ede050fe320d9ca71
refs/heads/master
2023-05-13T16:53:16.261624
2023-05-01T06:35:34
2023-05-01T06:35:34
32,573,530
0
0
Apache-2.0
2023-05-01T06:35:35
2015-03-20T08:59:36
Java
UTF-8
Java
false
false
2,899
java
/* * Copyright 2010-2015 Amazon.com, Inc. or its affiliates. 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. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file 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.amazonaws.services.lambda.model.transform; import java.util.Map; import java.util.Map.Entry; import com.amazonaws.services.lambda.model.*; import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; import com.amazonaws.transform.*; import com.fasterxml.jackson.core.JsonToken; import static com.fasterxml.jackson.core.JsonToken.*; /** * Get Function Result JSON Unmarshaller */ public class GetFunctionResultJsonUnmarshaller implements Unmarshaller<GetFunctionResult, JsonUnmarshallerContext> { public GetFunctionResult unmarshall(JsonUnmarshallerContext context) throws Exception { GetFunctionResult getFunctionResult = new GetFunctionResult(); int originalDepth = context.getCurrentDepth(); String currentParentElement = context.getCurrentParentElement(); int targetDepth = originalDepth + 1; JsonToken token = context.getCurrentToken(); if (token == null) token = context.nextToken(); if (token == VALUE_NULL) return null; while (true) { if (token == null) break; if (token == FIELD_NAME || token == START_OBJECT) { if (context.testExpression("Configuration", targetDepth)) { context.nextToken(); getFunctionResult.setConfiguration(FunctionConfigurationJsonUnmarshaller.getInstance().unmarshall(context)); } if (context.testExpression("Code", targetDepth)) { context.nextToken(); getFunctionResult.setCode(FunctionCodeLocationJsonUnmarshaller.getInstance().unmarshall(context)); } } else if (token == END_ARRAY || token == END_OBJECT) { if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) { if (context.getCurrentDepth() <= originalDepth) break; } } token = context.nextToken(); } return getFunctionResult; } private static GetFunctionResultJsonUnmarshaller instance; public static GetFunctionResultJsonUnmarshaller getInstance() { if (instance == null) instance = new GetFunctionResultJsonUnmarshaller(); return instance; } }
[ "aws@amazon.com" ]
aws@amazon.com
cdfebdac12ad88f0a24318dc6f40638ee04b8745
bcdb4977de5e66270f6bbef18d1214bf2eeed192
/gmall-sms/src/main/java/com/atguigu/gmall/sms/controller/CouponHistoryController.java
4151aae99fdd4532d3b2eae9cb1259f155afbf5e
[ "Apache-2.0" ]
permissive
joedyli/gmall-0713
edc45fa4005c06588fae6ac3cd0de630213fbacb
dc881a419c8bb315a1d1c2bee9e2f778ace289cd
refs/heads/main
2023-02-17T10:27:59.926556
2021-01-10T07:53:57
2021-01-10T07:53:57
321,216,279
4
7
null
null
null
null
UTF-8
Java
false
false
2,563
java
package com.atguigu.gmall.sms.controller; import java.util.List; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import com.atguigu.gmall.sms.entity.CouponHistoryEntity; import com.atguigu.gmall.sms.service.CouponHistoryService; import com.atguigu.gmall.common.bean.PageResultVo; import com.atguigu.gmall.common.bean.ResponseVo; import com.atguigu.gmall.common.bean.PageParamVo; /** * 优惠券领取历史记录 * * @author fengge * @email fengge@atguigu.com * @date 2020-12-14 14:35:07 */ @Api(tags = "优惠券领取历史记录 管理") @RestController @RequestMapping("sms/couponhistory") public class CouponHistoryController { @Autowired private CouponHistoryService couponHistoryService; /** * 列表 */ @GetMapping @ApiOperation("分页查询") public ResponseVo<PageResultVo> queryCouponHistoryByPage(PageParamVo paramVo){ PageResultVo pageResultVo = couponHistoryService.queryPage(paramVo); return ResponseVo.ok(pageResultVo); } /** * 信息 */ @GetMapping("{id}") @ApiOperation("详情查询") public ResponseVo<CouponHistoryEntity> queryCouponHistoryById(@PathVariable("id") Long id){ CouponHistoryEntity couponHistory = couponHistoryService.getById(id); return ResponseVo.ok(couponHistory); } /** * 保存 */ @PostMapping @ApiOperation("保存") public ResponseVo<Object> save(@RequestBody CouponHistoryEntity couponHistory){ couponHistoryService.save(couponHistory); return ResponseVo.ok(); } /** * 修改 */ @PostMapping("/update") @ApiOperation("修改") public ResponseVo update(@RequestBody CouponHistoryEntity couponHistory){ couponHistoryService.updateById(couponHistory); return ResponseVo.ok(); } /** * 删除 */ @PostMapping("/delete") @ApiOperation("删除") public ResponseVo delete(@RequestBody List<Long> ids){ couponHistoryService.removeByIds(ids); return ResponseVo.ok(); } }
[ "joedy23@aliyun.com" ]
joedy23@aliyun.com
ad7b83af8e7463b4f748ddbd9251f0a703809d43
f3a90752b03b49fc80e3120354d58778f5ca29b6
/extensions/oidc-token-propagation/runtime/src/main/java/io/quarkus/oidc/token/propagation/runtime/OidcTokenPropagationConfig.java
f4824e8207ae6eb00cc3b8bbb054b1946f6f5cf8
[ "Apache-2.0" ]
permissive
glefloch/quarkus
8897e9c1fa4ca7bd7b6e3b9a1ea447257008f4a5
7269fa1cc3f7e2c4eb1fd00fdeaa0f8c750c91bb
refs/heads/master
2023-01-27T17:55:14.275458
2021-01-23T12:48:12
2021-01-23T12:48:12
248,758,925
1
0
Apache-2.0
2023-01-17T20:01:12
2020-03-20T13:13:10
Java
UTF-8
Java
false
false
639
java
package io.quarkus.oidc.token.propagation.runtime; import io.quarkus.runtime.annotations.ConfigItem; import io.quarkus.runtime.annotations.ConfigPhase; import io.quarkus.runtime.annotations.ConfigRoot; @ConfigRoot(name = "oidc-token-propagation", phase = ConfigPhase.BUILD_AND_RUN_TIME_FIXED) public class OidcTokenPropagationConfig { /** * Enable TokenCredentialFilter for all the injected MP RestClient implementations. * If this property is disabled then TokenCredentialRequestFilter has to be registered as an MP RestClient provider. */ @ConfigItem(defaultValue = "false") public boolean registerFilter; }
[ "guillaume.smet@gmail.com" ]
guillaume.smet@gmail.com
ab5ee931d36091cb18723d0dafb96a3f7b812476
ed3cb95dcc590e98d09117ea0b4768df18e8f99e
/project_1_3/src/b/b/h/c/Calc_1_3_11722.java
bd20619e42f7441b5f3eaabd1a2d44c61a976785
[]
no_license
chalstrick/bigRepo1
ac7fd5785d475b3c38f1328e370ba9a85a751cff
dad1852eef66fcec200df10083959c674fdcc55d
refs/heads/master
2016-08-11T17:59:16.079541
2015-12-18T14:26:49
2015-12-18T14:26:49
48,244,030
0
0
null
null
null
null
UTF-8
Java
false
false
134
java
package b.b.h.c; public class Calc_1_3_11722 { /** @return the sum of a and b */ public int add(int a, int b) { return a+b; } }
[ "christian.halstrick@sap.com" ]
christian.halstrick@sap.com
254e9fecfbefa6c6d09c84dfa8c786aca5e6a895
ed3cb95dcc590e98d09117ea0b4768df18e8f99e
/project_1_2/src/b/f/c/e/Calc_1_2_15246.java
a7bdbba2cfbf449b967bf9b631215e41a1cb2b4d
[]
no_license
chalstrick/bigRepo1
ac7fd5785d475b3c38f1328e370ba9a85a751cff
dad1852eef66fcec200df10083959c674fdcc55d
refs/heads/master
2016-08-11T17:59:16.079541
2015-12-18T14:26:49
2015-12-18T14:26:49
48,244,030
0
0
null
null
null
null
UTF-8
Java
false
false
134
java
package b.f.c.e; public class Calc_1_2_15246 { /** @return the sum of a and b */ public int add(int a, int b) { return a+b; } }
[ "christian.halstrick@sap.com" ]
christian.halstrick@sap.com
e0d63d695594f5fbc339cd1c1a4f80201681a586
75c4712ae3f946db0c9196ee8307748231487e4b
/src/main/java/com/alipay/api/domain/OperatorInfoModel.java
c89124a2bc601fed65a542a3a939822d8ad25481
[ "Apache-2.0" ]
permissive
yuanbaoMarvin/alipay-sdk-java-all
70a72a969f464d79c79d09af8b6b01fa177ac1be
25f3003d820dbd0b73739d8e32a6093468d9ed92
refs/heads/master
2023-06-03T16:54:25.138471
2021-06-25T14:48:21
2021-06-25T14:48:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,267
java
package com.alipay.api.domain; import java.util.List; import com.alipay.api.AlipayObject; import com.alipay.api.internal.mapping.ApiField; import com.alipay.api.internal.mapping.ApiListField; /** * 包含操作员基本信息、部门、门店信息 * * @author auto create * @since 1.0, 2018-03-23 11:53:42 */ public class OperatorInfoModel extends AlipayObject { private static final long serialVersionUID = 7225648463311914672L; /** * customerId */ @ApiField("cid") private String cid; /** * 邮件 */ @ApiField("email") private String email; /** * 部门ID */ @ApiField("job_id") private String jobId; /** * 部门树 */ @ApiField("job_tree") private String jobTree; /** * 手机号 */ @ApiField("mobile") private String mobile; /** * 操作员姓名 */ @ApiField("name") private String name; /** * 操作员别名 */ @ApiField("nick_name") private String nickName; /** * 操作员ID */ @ApiField("operator_id") private String operatorId; /** * 操作员类型 */ @ApiField("operator_type") private String operatorType; /** * 角色ID */ @ApiField("role_id") private String roleId; /** * 角色名字 */ @ApiField("role_name") private String roleName; /** * 门店列表 */ @ApiListField("shop_ids") @ApiField("string") private List<String> shopIds; /** * T */ @ApiField("status") private String status; public String getCid() { return this.cid; } public void setCid(String cid) { this.cid = cid; } public String getEmail() { return this.email; } public void setEmail(String email) { this.email = email; } public String getJobId() { return this.jobId; } public void setJobId(String jobId) { this.jobId = jobId; } public String getJobTree() { return this.jobTree; } public void setJobTree(String jobTree) { this.jobTree = jobTree; } public String getMobile() { return this.mobile; } public void setMobile(String mobile) { this.mobile = mobile; } public String getName() { return this.name; } public void setName(String name) { this.name = name; } public String getNickName() { return this.nickName; } public void setNickName(String nickName) { this.nickName = nickName; } public String getOperatorId() { return this.operatorId; } public void setOperatorId(String operatorId) { this.operatorId = operatorId; } public String getOperatorType() { return this.operatorType; } public void setOperatorType(String operatorType) { this.operatorType = operatorType; } public String getRoleId() { return this.roleId; } public void setRoleId(String roleId) { this.roleId = roleId; } public String getRoleName() { return this.roleName; } public void setRoleName(String roleName) { this.roleName = roleName; } public List<String> getShopIds() { return this.shopIds; } public void setShopIds(List<String> shopIds) { this.shopIds = shopIds; } public String getStatus() { return this.status; } public void setStatus(String status) { this.status = status; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
e381fbf720e419bdeb3ff65bb1182659648c2958
cca87c4ade972a682c9bf0663ffdf21232c9b857
/com/tencent/mm/plugin/card/sharecard/a/c.java
5553a0a67b815be93199ada0ffb8eca532dd1acb
[]
no_license
ZoranLi/wechat_reversing
b246d43f7c2d7beb00a339e2f825fcb127e0d1a1
36b10ef49d2c75d69e3c8fdd5b1ea3baa2bba49a
refs/heads/master
2021-07-05T01:17:20.533427
2017-09-25T09:07:33
2017-09-25T09:07:33
104,726,592
12
1
null
null
null
null
UTF-8
Java
false
false
289
java
package com.tencent.mm.plugin.card.sharecard.a; public final class c { public class a { public String fVl; public int kgV; final /* synthetic */ c kgW; public String username; public a(c cVar) { this.kgW = cVar; } } }
[ "lizhangliao@xiaohongchun.com" ]
lizhangliao@xiaohongchun.com
7c05725a6976d48bb392ec7a0a46fad120d44252
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/11/11_8763992ef097c704480e714dc00b6a0c50476591/TestIDNA/11_8763992ef097c704480e714dc00b6a0c50476591_TestIDNA_s.java
6adce64ce8413307d6f0b82f37091e2e3bcccaaf
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
4,077
java
/** * Copyright (C) 2004, 2006 Free Software Foundation, Inc. * * Author: Oliver Hitz * * This file is part of GNU Libidn. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ import gnu.inet.encoding.IDNA; import gnu.inet.encoding.IDNAException; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.InputStreamReader; import java.io.IOException; import java.io.PrintStream; import java.util.StringTokenizer; public class TestIDNA { final static int STATE_SCAN = 0; final static int STATE_INPUT = 1; public static void usage() { System.err.println("Usage: "+TestIDNA.class.toString()+" [-a|-u string] [-t]"); System.err.println(" -a string: apply toASCII(string)"); System.err.println(" -u string: apply toUnicode(string)"); System.err.println(" -t: automatic test using draft-josefsson-idn-test-vectors.html"); System.exit(1); } public static void main(String[] args) throws Exception { if (args.length == 2) { if (args[0].equals("-u")) { try { System.out.println("Input: "+args[1]); System.out.println("Output: "+IDNA.toASCII(args[1])); } catch (IDNAException e) { System.out.println(e); } } else if (args[0].equals("-a")) { System.out.println("Input: "+args[1]); System.out.println("Output: "+IDNA.toUnicode(args[1])); } else { usage(); } } else if (args.length == 1 && args[0].equals("-t")) { File f = new File("draft-josefsson-idn-test-vectors.html"); if (!f.exists()) { System.err.println("Unable to find draft-josefsson-idn-test-vectors.html."); System.err.println("Please download the latest version of this file from:"); System.err.println("http://www.gnu.org/software/libidn/"); System.exit(1); } BufferedReader r = new BufferedReader(new FileReader(f)); int state = STATE_SCAN; StringBuffer input = new StringBuffer(); String out; while (true) { String l = r.readLine(); if (null == l) { break; } switch (state) { case STATE_SCAN: if (l.startsWith("input (length ")) { state = STATE_INPUT; input = new StringBuffer(); } break; case STATE_INPUT: if (l.equals("")) { // Empty line (before "out:") } else if (l.startsWith("out: ")) { out = l.substring(5).trim(); try { String ascii = IDNA.toASCII(input.toString()); if (ascii.equals(out)) { // Ok } else { System.err.println("Error detected:"); System.err.println(" Input: "+input); System.err.println(" toASCII returned: "+ascii); System.err.println(" expected result: "+out); System.exit(1); } } catch (IDNAException e) { System.out.println(" exception thrown ("+e+")"); } state = STATE_SCAN; } else { StringTokenizer tok = new StringTokenizer(l.trim(), " "); while (tok.hasMoreTokens()) { String t = tok.nextToken(); if (t.startsWith("U+")) { char u = (char) Integer.parseInt(t.substring(2, 6), 16); input.append(u); } else { System.err.println("Unknown token: "+t); } } } break; } } System.out.println("No errors detected!"); } else { usage(); } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
8e81c9a7a90f4a89235b2887902f309b2817524f
2fa5bec661b47800575b505b2cd7d7d5c8dabc79
/spring-jdbc/src/main/java/org/springframework/jdbc/core/ResultSetExtractor.java
97b8437c684e30ea4729d456edc4a191e9f7bc4e
[]
no_license
zhang-yan-talendbj/spring-code-study
6ff383f53aad4e382055cf5f308da000d9a838b0
b66c036aeebc7de9c5029c62f833c754025597ea
refs/heads/master
2022-02-23T15:05:36.831421
2019-09-22T03:02:05
2019-09-22T03:02:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,719
java
/* * Copyright 2002-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.jdbc.core; import java.sql.ResultSet; import java.sql.SQLException; import org.springframework.dao.DataAccessException; import org.springframework.lang.Nullable; /** * Callback interface used by {@link JdbcTemplate}'s query methods. * Implementations of this interface perform the actual work of extracting * results from a {@link java.sql.ResultSet}, but don't need to worry * about exception handling. {@link java.sql.SQLException SQLExceptions} * will be caught and handled by the calling JdbcTemplate. * * <p>This interface is mainly used within the JDBC framework itself. * A {@link RowMapper} is usually a simpler choice for ResultSet processing, * mapping one result object per row instead of one result object for * the entire ResultSet. * * <p>Note: In contrast to a {@link RowCallbackHandler}, a ResultSetExtractor * object is typically stateless and thus reusable, as long as it doesn't * access stateful resources (such as output streams when streaming LOB * contents) or keep result state within the object. * * @param <T> the result type * @author Rod Johnson * @author Juergen Hoeller * @see JdbcTemplate * @see RowCallbackHandler * @see RowMapper * @see org.springframework.jdbc.core.support.AbstractLobStreamingResultSetExtractor * @since April 24, 2003 */ @FunctionalInterface public interface ResultSetExtractor<T> { /** * Implementations must implement this method to process the entire ResultSet. * * @param rs the ResultSet to extract data from. Implementations should * not close this: it will be closed by the calling JdbcTemplate. * @return an arbitrary result object, or {@code null} if none * (the extractor will typically be stateful in the latter case). * @throws SQLException if a SQLException is encountered getting column * values or navigating (that is, there's no need to catch SQLException) * @throws DataAccessException in case of custom exceptions */ @Nullable T extractData(ResultSet rs) throws SQLException, DataAccessException; }
[ "sjn@dxy.cn" ]
sjn@dxy.cn
8c0f97768a177f2eb661fec1e2d6cb251f46d81c
4267b3aa7744b03443483b78e79659e15a2bdd12
/game_server/src/main/java/com/cellsgame/game/core/cfg/core/ConfigCache.java
d3978241c3469d1667e42a03e71440e49b6ad507
[]
no_license
atom-chen/SRGP-Game-java
dd7b2fdebd88d32839e3cf537e053cdb3f675676
4b74c83adef0efa5f01c68f9fa5465cb2cd9bc77
refs/heads/master
2020-06-05T16:10:57.283116
2018-10-16T04:02:22
2018-10-16T04:02:22
null
0
0
null
null
null
null
UTF-8
Java
false
false
892
java
package com.cellsgame.game.core.cfg.core; import java.util.Map; import com.cellsgame.common.util.csv.BaseCfg; import com.cellsgame.game.util.TriConsumer; /** * @author Aly on 2016-11-01. */ public interface ConfigCache { Map<Integer, BaseCfg> get(String csvName, boolean checkParent); Map<Integer, BaseCfg> get(Class<? extends BaseCfg> cfgClass); Map<Integer, BaseCfg> get(Class<? extends BaseCfg> cfgClass, boolean checkParent); Map<Integer, BaseCfg> remove(Class<? extends BaseCfg> cfgClass); Map<Integer, BaseCfg> removeByFileName(String fileName); void forByCfgClass(TriConsumer<Class<? extends BaseCfg>, Integer, BaseCfg> consumer, boolean forceAll); void forByFileName(TriConsumer<String, Integer, BaseCfg> consumer, boolean forceAll); <T extends BaseCfg> T get(Class<T> cfgClass, int cid, boolean checkParent); }
[ "thelovelybugfly@foxmail.com" ]
thelovelybugfly@foxmail.com
240c9f557287738ff03b7aa22eb4fc8105f74e87
54c6bf3179cce122a1baaa2b070c465bc3c255b6
/app/src/main/java/co/ke/bsl/ui/views/widgets/CoffeeMagtListAdapter.java
ff879e488cad8d8cf1d0bc5d373df26bbeda6a3b
[]
no_license
koskcom/navigationdrawer
27a65d5bba315517e1fcc89c4828a1b5bfdd8926
275fb599c6953a30c0dac03ee01770aaa4579a04
refs/heads/master
2022-12-10T08:00:07.336464
2020-09-14T06:46:51
2020-09-14T06:46:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,297
java
package co.ke.bsl.ui.views.widgets; import android.app.Activity; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.TextView; import java.util.ArrayList; import co.ke.bsl.R; import co.ke.bsl.pojo.CoffeeManagementAgentInsp; public class CoffeeMagtListAdapter extends BaseAdapter { Activity context; private ArrayList<CoffeeManagementAgentInsp> coffeeManagementAgentInsplist; private LayoutInflater inflater = null; public CoffeeMagtListAdapter(Activity context, ArrayList<CoffeeManagementAgentInsp> coffeeManagementAgentInsplist) { this.coffeeManagementAgentInsplist = coffeeManagementAgentInsplist; inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); } @Override public int getCount() { return coffeeManagementAgentInsplist.size(); } @Override public Object getItem(int position) { return coffeeManagementAgentInsplist.get(position); } @Override public long getItemId(int position) { return position; } public View getView(int position, View contentview, ViewGroup parent) { View itemview = contentview; itemview = (itemview == null) ? inflater.inflate(R.layout.coffee_management_list_row, null) : itemview; TextView textviewdocument_no = (TextView) itemview.findViewById(R.id.textviewdocument_nno); TextView textviewdocument_date = (TextView) itemview.findViewById(R.id.textviewdocument_ddate); TextView textviewapplicant_name = (TextView) itemview.findViewById(R.id.textviewapplicant_nname); TextView textviewlicence_number = (TextView) itemview.findViewById(R.id.textviewlicence_nnumber); CoffeeManagementAgentInsp selecteditem = coffeeManagementAgentInsplist.get(position); textviewdocument_no.setText("Document No "+selecteditem.getDocumnet_number()); textviewdocument_date.setText("Doc Date "+selecteditem.getDocument_date()); textviewlicence_number.setText("Licence number "+selecteditem.getLicence_no()); textviewapplicant_name.setText("Applicant Name "+selecteditem.getC_BPartner_ID()); return itemview; } }
[ "hosea.koskei@briskbusiness.co.ke" ]
hosea.koskei@briskbusiness.co.ke
17172c62186dcda722874d3551a792c9f38929e9
3e3a5e2643e4ed8519ecfd6b66ae937f2da42939
/CollectionFramework/HashtableDemoEntrySet/HashtableDemo/src/HashtableExample.java
f89a2b9258e0222e29212dbde1acd72932d45527
[]
no_license
neel2811/Java
a5249b19b3c3923c44f5b9528adee7a54a978be6
fcafcf634cbf9ce849ecf43bf8e05f770cb85ac1
refs/heads/master
2021-10-26T03:42:57.532886
2017-03-24T10:25:27
2017-03-24T10:25:27
87,059,721
0
1
null
2017-04-03T09:50:10
2017-04-03T09:50:10
null
UTF-8
Java
false
false
1,083
java
import java.util.Hashtable; import java.util.Map; import java.util.Set; /* * Example of entrySet() method. */ public class HashtableExample { public static void main(String[] args) { Hashtable<String, String> hashtable = new Hashtable<String, String>(); /* * Key = CountryCode,Value = CountryName. */ hashtable.put("AF", "AFGHANISTAN"); hashtable.put("BE", "BELGIUM"); hashtable.put("US", "UNITED STATES"); hashtable.put("IN", "INDIA"); System.out.println("hashtable : " + hashtable + "\n"); /* * A map entry (key-value pair). * * Returns a Set view of the mappings contained in this map. */ Set<Map.Entry<String, String>> entrySet = hashtable.entrySet(); System.out.println("entrySet : " + entrySet + "\n"); System.out.println("-----------------------"); System.out.println("Key" + " | " + "value"); System.out.println("-----------------------"); for (Map.Entry<String, String> entry : entrySet) { String key = entry.getKey(); String value = entry.getValue(); System.out.println(key + " | " + value); } } }
[ "ramram_43210@yahoo.com" ]
ramram_43210@yahoo.com
f62bf509353389a4a81e904c5e62f2d83d80c4f8
b40b76705b45589b45744b7616209d754a5d2ac4
/ch-20/fangjia-sjdbc-read-write/src/main/java/com/fangjia/sjdbc/service/UserService.java
7fe4db341454beff5d883608fd3cfa65e1512930
[]
no_license
gaohanghang/Spring-Cloud-Book-Code-2
91aa2ec166a0155198558da5d739829dae398745
6adde8b577f8238eade41571f58a5e2943b0912e
refs/heads/master
2021-10-24T04:07:36.293149
2021-10-17T10:49:48
2021-10-17T10:49:48
203,406,993
2
0
null
2020-10-13T16:17:46
2019-08-20T15:47:02
Java
UTF-8
Java
false
false
174
java
package com.fangjia.sjdbc.service; import java.util.List; import com.fangjia.sjdbc.po.User; public interface UserService { List<User> list(); Long add(User user); }
[ "1341947277@qq.com" ]
1341947277@qq.com
8680a808e09bfc5711eb83e402b5e0b5db05d7c7
812be6b9d1ba4036652df166fbf8662323f0bdc9
/java/Dddml.Wms.JavaCommon/src/generated/java/org/dddml/wms/domain/locator/AbstractLocatorCommand.java
b95717a3ac7ab12c12356102964f57047ae0fbf9
[]
no_license
lanmolsz/wms
8503e54a065670b48a15955b15cea4926f05b5d6
4b71afd80127a43890102167a3af979268e24fa2
refs/heads/master
2020-03-12T15:10:26.133106
2018-09-27T08:28:05
2018-09-27T08:28:05
130,684,482
0
0
null
2018-04-23T11:11:24
2018-04-23T11:11:24
null
UTF-8
Java
false
false
7,848
java
package org.dddml.wms.domain.locator; import java.util.*; import java.util.Date; import org.dddml.wms.domain.*; import org.dddml.wms.domain.AbstractCommand; public abstract class AbstractLocatorCommand extends AbstractCommand implements LocatorCommand { private String locatorId; public String getLocatorId() { return this.locatorId; } public void setLocatorId(String locatorId) { this.locatorId = locatorId; } private Long version; public Long getVersion() { return this.version; } public void setVersion(Long version) { this.version = version; } public static abstract class AbstractCreateOrMergePatchLocator extends AbstractLocatorCommand implements CreateOrMergePatchLocator { private String warehouseId; public String getWarehouseId() { return this.warehouseId; } public void setWarehouseId(String warehouseId) { this.warehouseId = warehouseId; } private String parentLocatorId; public String getParentLocatorId() { return this.parentLocatorId; } public void setParentLocatorId(String parentLocatorId) { this.parentLocatorId = parentLocatorId; } private String locatorType; public String getLocatorType() { return this.locatorType; } public void setLocatorType(String locatorType) { this.locatorType = locatorType; } private String priorityNumber; public String getPriorityNumber() { return this.priorityNumber; } public void setPriorityNumber(String priorityNumber) { this.priorityNumber = priorityNumber; } private Boolean isDefault; public Boolean getIsDefault() { return this.isDefault; } public void setIsDefault(Boolean isDefault) { this.isDefault = isDefault; } private String x; public String getX() { return this.x; } public void setX(String x) { this.x = x; } private String y; public String getY() { return this.y; } public void setY(String y) { this.y = y; } private String z; public String getZ() { return this.z; } public void setZ(String z) { this.z = z; } private String description; public String getDescription() { return this.description; } public void setDescription(String description) { this.description = description; } private String locatorTypeId; public String getLocatorTypeId() { return this.locatorTypeId; } public void setLocatorTypeId(String locatorTypeId) { this.locatorTypeId = locatorTypeId; } private Boolean active; public Boolean getActive() { return this.active; } public void setActive(Boolean active) { this.active = active; } } public static abstract class AbstractCreateLocator extends AbstractCreateOrMergePatchLocator implements CreateLocator { @Override public String getCommandType() { return COMMAND_TYPE_CREATE; } } public static abstract class AbstractMergePatchLocator extends AbstractCreateOrMergePatchLocator implements MergePatchLocator { @Override public String getCommandType() { return COMMAND_TYPE_MERGE_PATCH; } private Boolean isPropertyWarehouseIdRemoved; public Boolean getIsPropertyWarehouseIdRemoved() { return this.isPropertyWarehouseIdRemoved; } public void setIsPropertyWarehouseIdRemoved(Boolean removed) { this.isPropertyWarehouseIdRemoved = removed; } private Boolean isPropertyParentLocatorIdRemoved; public Boolean getIsPropertyParentLocatorIdRemoved() { return this.isPropertyParentLocatorIdRemoved; } public void setIsPropertyParentLocatorIdRemoved(Boolean removed) { this.isPropertyParentLocatorIdRemoved = removed; } private Boolean isPropertyLocatorTypeRemoved; public Boolean getIsPropertyLocatorTypeRemoved() { return this.isPropertyLocatorTypeRemoved; } public void setIsPropertyLocatorTypeRemoved(Boolean removed) { this.isPropertyLocatorTypeRemoved = removed; } private Boolean isPropertyPriorityNumberRemoved; public Boolean getIsPropertyPriorityNumberRemoved() { return this.isPropertyPriorityNumberRemoved; } public void setIsPropertyPriorityNumberRemoved(Boolean removed) { this.isPropertyPriorityNumberRemoved = removed; } private Boolean isPropertyIsDefaultRemoved; public Boolean getIsPropertyIsDefaultRemoved() { return this.isPropertyIsDefaultRemoved; } public void setIsPropertyIsDefaultRemoved(Boolean removed) { this.isPropertyIsDefaultRemoved = removed; } private Boolean isPropertyXRemoved; public Boolean getIsPropertyXRemoved() { return this.isPropertyXRemoved; } public void setIsPropertyXRemoved(Boolean removed) { this.isPropertyXRemoved = removed; } private Boolean isPropertyYRemoved; public Boolean getIsPropertyYRemoved() { return this.isPropertyYRemoved; } public void setIsPropertyYRemoved(Boolean removed) { this.isPropertyYRemoved = removed; } private Boolean isPropertyZRemoved; public Boolean getIsPropertyZRemoved() { return this.isPropertyZRemoved; } public void setIsPropertyZRemoved(Boolean removed) { this.isPropertyZRemoved = removed; } private Boolean isPropertyDescriptionRemoved; public Boolean getIsPropertyDescriptionRemoved() { return this.isPropertyDescriptionRemoved; } public void setIsPropertyDescriptionRemoved(Boolean removed) { this.isPropertyDescriptionRemoved = removed; } private Boolean isPropertyLocatorTypeIdRemoved; public Boolean getIsPropertyLocatorTypeIdRemoved() { return this.isPropertyLocatorTypeIdRemoved; } public void setIsPropertyLocatorTypeIdRemoved(Boolean removed) { this.isPropertyLocatorTypeIdRemoved = removed; } private Boolean isPropertyActiveRemoved; public Boolean getIsPropertyActiveRemoved() { return this.isPropertyActiveRemoved; } public void setIsPropertyActiveRemoved(Boolean removed) { this.isPropertyActiveRemoved = removed; } } public static class SimpleCreateLocator extends AbstractCreateLocator { } public static class SimpleMergePatchLocator extends AbstractMergePatchLocator { } public static class SimpleDeleteLocator extends AbstractLocatorCommand implements DeleteLocator { @Override public String getCommandType() { return COMMAND_TYPE_DELETE; } } }
[ "yangjiefeng@gmail.com" ]
yangjiefeng@gmail.com
374e3e2d783550927dd1122b14e3ef72f399b081
c4a7393466110cb5555fd314ff1161504e7d6ee2
/Beauty/Android/business/src/com/GlamourPromise/Beauty/view/SegmentBar.java
cd5c9c0ecca58042ff72bd4ec8534d27840f69c8
[]
no_license
mrs-zuo/Beauty
174fcc9cc2fd6cf48e93600351d8e5a2e602a053
6266896a3e2e027501bb5eccfba8cd2f1cb928b2
refs/heads/master
2023-03-11T07:16:54.441977
2021-03-01T09:29:47
2021-03-01T09:29:47
322,498,347
0
0
null
null
null
null
UTF-8
Java
false
false
5,534
java
package com.GlamourPromise.Beauty.view; import com.GlamourPromise.Beauty.Business.R; import com.GlamourPromise.Beauty.application.UserInfoApplication; import android.annotation.SuppressLint; import android.app.Activity; import android.content.Context; import android.util.AttributeSet; import android.util.Log; import android.view.Gravity; import android.view.View; import android.widget.Button; import android.widget.ImageButton; import android.widget.LinearLayout; import android.widget.TextView; import android.view.View.OnClickListener; /** * 分段控件 * * */ public class SegmentBar extends LinearLayout implements OnClickListener { private String[] stringArray; public SegmentBar(Context context, AttributeSet attrs) { super(context, attrs); } public SegmentBar(Context context) { super(context); } /** * determine the number of segment bar items by the string array. * * 根据传递进来的数组,决定分段的数量 * * * */ public void setValue(Context context, String[] stringArray) { this.stringArray = stringArray; if (stringArray.length <= 1) { throw new RuntimeException( "the length of String array must bigger than 1"); } this.stringArray = stringArray; resolveStringArray(context); } /** * resolve the array and generate the items. * * 对数组进行解析,生成具体的每个分段 * * */ private void resolveStringArray(Context context) { int length = this.stringArray.length; for (int i = 0; i < length; i++) { Button button = new Button(context); button.setText(stringArray[i]); button.setGravity(Gravity.CENTER); UserInfoApplication userInfoApplication = ((UserInfoApplication) ((Activity) context).getApplication()).getInstance(); int screenWidth = userInfoApplication.getScreenWidth(); if (screenWidth == 480) { button.setLayoutParams(new LayoutParams(45, 45)); } else if (screenWidth == 540) { button.setLayoutParams(new LayoutParams(60, 50)); } else if (screenWidth == 720) { button.setLayoutParams(new LayoutParams(60, 60)); } else if (screenWidth == 1080) { button.setLayoutParams(new LayoutParams(100, 100)); } else if (screenWidth == 1536) { button.setLayoutParams(new LayoutParams(100, 100)); } else { button.setLayoutParams(new LayoutParams(60, 60)); } button.setTag(i); button.setOnClickListener(this); if (i == 0)// 左边的按钮 { button.setBackgroundDrawable(context.getResources() .getDrawable(R.drawable.left_button_bg_selector)); } else if (i != 0 && i < (length - 1))// 右边的按钮 { button.setBackgroundResource(R.drawable.middle_button_bg_selector); } if (i == (length - 1)) { ImageButton imageButton = new ImageButton(context); LayoutParams params; if (screenWidth == 480) { params = new LayoutParams(45, 45); } else if (screenWidth == 540) { params = new LayoutParams(60, 50); } else if (screenWidth == 720) { params = new LayoutParams(60, 60); } else if (screenWidth == 1080) { params = new LayoutParams(100, 100); } else if (screenWidth == 1536) { params = new LayoutParams(100, 100); } else { params = new LayoutParams(60, 60); } imageButton.setLayoutParams(params); imageButton.setTag(i); imageButton.setOnClickListener(this); imageButton .setBackgroundResource(R.drawable.right_button_bg_selector); imageButton .setImageResource(R.drawable.report_filter_date_icon); this.addView(imageButton); } else this.addView(button); } } private int lastIndex = 0;// 记录上一次点击的索引 @Override public void onClick(View v) { int index = (Integer) v.getTag(); onSegmentBarChangedListener.onBarItemChanged(index); this.getChildAt(lastIndex).setSelected(false); this.getChildAt(index).setSelected(true); lastIndex = index; } /** * set the default bar item of selected * * 设置默认选中的SegmentBar * * */ public void setDefaultBarItem(int index) { if (index > stringArray.length) { throw new RuntimeException( "the value of default bar item can not bigger than string array's length"); } lastIndex = index; this.getChildAt(index).setSelected(true); } /** * set the text size of every item * * 设置文字的大小 * * */ public void setTextSize(float sizeValue) { int index = this.getChildCount(); for (int i = 0; i < index - 1; i++) { ((Button) this.getChildAt(i)).setTextSize(sizeValue); } } /** * set the text color of every item * * 设置文字的颜色 * * */ public void setTextColor(int color) { int index = this.getChildCount(); for (int i = 0; i < index - 1; i++) { ((Button) this.getChildAt(i)).setTextColor(color); } } private OnSegmentBarChangedListener onSegmentBarChangedListener; /** * define a interface used for listen the change event of Segment bar * * 定义一个接口,用来实现分段控件Item的监听 * * */ public interface OnSegmentBarChangedListener { public void onBarItemChanged(int segmentItemIndex); } /** * set the segment bar item changed listener,if the bar item changed, the * method onBarItemChanged()will be called. * * 设置分段控件的监听器,当分段改变的时候,onBarItemChanged()会被调用 * * */ public void setOnSegmentBarChangedListener( OnSegmentBarChangedListener onSegmentBarChangedListener) { this.onSegmentBarChangedListener = onSegmentBarChangedListener; } }
[ "454179043@qq.com" ]
454179043@qq.com
40830ba69f09614e552d354b78aa405b112200b5
844dc53bbce7aab957e037cb84a0c9a8f8922f8e
/src/ch/tsphp/common/AstHelperRegistry.java
ea0beb4a3c566821d3bd174e704b5938f8aa7066
[ "LicenseRef-scancode-warranty-disclaimer", "Apache-2.0" ]
permissive
tsphp/tsphp-common
c600aef1e343a05e4316ae967a1b82a689db7715
aad23bb4852daf37ca6e9bc3ed1a1b33260f2a34
refs/heads/master
2020-04-20T14:08:06.059354
2014-08-24T18:23:26
2014-08-24T18:23:26
13,151,924
0
2
null
null
null
null
UTF-8
Java
false
false
620
java
/* * This file is part of the TSPHP project published under the Apache License 2.0 * For the full copyright and license information, please have a look at LICENSE in the * root folder or visit the project's website http://tsphp.ch/wiki/display/TSPHP/License */ package ch.tsphp.common; public final class AstHelperRegistry { private static IAstHelper astHelper = new AstHelper(new TSPHPAstAdaptor()); private AstHelperRegistry() { } public static void set(IAstHelper newAstHelper) { astHelper = newAstHelper; } public static IAstHelper get() { return astHelper; } }
[ "rstoll@tutteli.ch" ]
rstoll@tutteli.ch
099e10746c62d6a9ea3d17672a7827d271e24760
5a637cb8d14e58f0ee1ba640acddd0380df1d907
/src/ciknow/ro/NetworkAnalyticsRO.java
339d59a575533f91fcadd96915ebdbc7b72df8de
[]
no_license
albedium/ciknow
b20e46c925d54c54e176b0df65e1a5a96385066b
57e401eb5ffa24181c7cb72e59fc0e7319cfc104
refs/heads/master
2021-01-21T01:17:55.683578
2012-09-26T18:27:03
2012-09-26T18:27:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,067
java
package ciknow.ro; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.dom4j.DocumentException; import ciknow.domain.Edge; import ciknow.domain.Node; import ciknow.graph.metrics.NetworkAnalytics; import ciknow.graph.metrics.NetworkMetrics; import ciknow.io.AnalyticsWriter; import ciknow.util.Beans; import ciknow.util.GeneralUtil; import ciknow.vis.NetworkExtractor; import edu.uci.ics.jung.graph.filters.impl.KNeighborhoodFilter; public class NetworkAnalyticsRO { private static Log logger = LogFactory.getLog(NetworkAnalyticsRO.class); private GenericRO genericRO; private AnalyticsWriter analyticsWriter; public static void main(String[] args) { //new NetworkAnalyticsRO().getLocalNetworkAnalytics(99999L, 10L, 0); } public NetworkAnalyticsRO() { } public GenericRO getGenericRO() { return genericRO; } public void setGenericRO(GenericRO genericRO) { this.genericRO = genericRO; } public AnalyticsWriter getAnalyticsWriter() { return analyticsWriter; } public void setAnalyticsWriter(AnalyticsWriter analyticsWriter) { this.analyticsWriter = analyticsWriter; } @SuppressWarnings("unchecked") public Map getNetworkMetrics(Map params) throws Exception{ logger.info("************************** get network metrics..."); Map result = new HashMap(); Beans.init(); Map network = null; Collection<Node> nodes = null; Collection<Edge> edges = null; NetworkExtractor extractor = (NetworkExtractor)Beans.getBean("networkExtractor"); String type = (String) params.get("type"); String allowHugeNetwork = (String) params.get("allowHugeNetwork"); if (type.equals("custom")){ List<String> edgeTypes = (List<String>)params.get("edgeTypes"); List<String> nodeFilters = (List<String>)params.get("nodeFilters"); String nfc = (String)params.get("nfc"); List<String> edgeFilters = (List<String>)params.get("edgeFilters"); String efc = (String)params.get("efc"); List<String> nodeAttributes = (List<String>) params.get("nodeAttributes"); String questionCombineMethod = (String) params.get("questionCombineMethod"); String nodeAttributeCombineMethod = (String) params.get("nodeAttributeCombineMethod"); String isolate = (String) params.get("isolate"); String showRawRelation = (String) params.get("showRawRelation"); String operator = (String) params.get("operator"); network = extractor.getCustomNetwork(edgeTypes, operator, nodeFilters, nfc, edgeFilters, efc, nodeAttributes, nodeAttributeCombineMethod, questionCombineMethod, isolate, showRawRelation); } else if (type.equals("local")){ List<String> sourceIds = (List<String>)params.get("sourceIds"); List<Long> rootIds = new ArrayList<Long>(); for (String id : sourceIds){ rootIds.add(Long.parseLong(id)); } String depth = (String)params.get("depth"); String includeDerivedEdges = (String)params.get("includeDerivedEdges"); List<String> edgeTypes = (List<String>)params.get("edgeTypes"); network = extractor.getLocalNetwork(rootIds, Integer.parseInt(depth), includeDerivedEdges.equals("1"), false, KNeighborhoodFilter.IN_OUT, edgeTypes); } else { logger.error("unrecognized network type: " + type); result.put("type", type); result.put("networkMetricsList", new ArrayList<NetworkMetrics>()); return result; } nodes = (Collection<Node>) network.get("nodes"); edges = (Collection<Edge>) network.get("edges"); String numNodes = "5000"; String numEdges = "5000"; // String hardlimit = "10000"; // analytics can handle huge networks, just need to wait try { Map limits = GeneralUtil.getLargeNetworkLimits(); numNodes = (String)limits.get("nodes"); numEdges = (String)limits.get("edges"); } catch (DocumentException e) { // TODO Auto-generated catch block e.printStackTrace(); } if (nodes.size() == 0 || edges.size() == 0){ logger.error("empty network."); result.put("type", type); result.put("networkMetricsList", new ArrayList<NetworkMetrics>()); return result; } else if (allowHugeNetwork != null && !allowHugeNetwork.equals("1") && (nodes.size() > Integer.parseInt(numNodes) || edges.size() > Integer.parseInt(numEdges))){ logger.error("network is too large."); result.put("type", type); result.put("networkMetricsList", new ArrayList<NetworkMetrics>()); result.put("msg", "Selected network is (nodes=" + nodes.size() + ", edges=" + edges.size() + "). " + "<br>This analytics calculation may take a considerable amount of time. " + "<br>Please limit the size of the network, or check the option of 'Allow large network'."); return result; } String direction = (String) params.get("direction"); String undirectedOperator = (String) params.get("undirectedOperator"); logger.debug("prepare nodeId to fullNode map"); Map<Long, Node> nodeMap = GeneralUtil.getNodeMap(nodes); List<NetworkMetrics> metricList = NetworkAnalytics.getNetworkMetrics(nodes, edges, nodeMap, Integer.parseInt(direction), undirectedOperator); // write to zip file for download String filename = ""; if (true){ long r = Math.round(Math.random()*1000000); String path = genericRO.getRealPath(); filename = "analytics_" + r + ".zip"; logger.info("writing analytics to file: " + filename); OutputStream os = new FileOutputStream(path + filename); ZipOutputStream zout = new ZipOutputStream(os); //PrintWriter pw = new PrintWriter(new OutputStreamWriter(os, "UTF-8")); for (NetworkMetrics nm : metricList){ ZipEntry entry = new ZipEntry(nm.getNetworkName()+".txt"); zout.putNextEntry(entry); analyticsWriter.write(nm, nodeMap, zout); } //pw.close(); zout.close(); } result.put("type", type); result.put("networkMetricsList", metricList); result.put("filename", filename); logger.info("************************** done."); return result; } }
[ "yao.gyao@gmail.com" ]
yao.gyao@gmail.com
0d57dbc1f60295de68f2c1a93acacd81a09512be
adad299298b3a4ddbc0d152093b3e5673a940e52
/2018/neohort-base/src/main/java/neohort/universal/output/lib_pln/document.java
aa98fbf24bfb4eb82268a1dee72d34a298b8bedd
[]
no_license
surban1974/neohort
a692e49c8e152cea0b155d81c2b2b1b167630ba8
0c371590e739defbc25d5befd1d44fcf18d1bcab
refs/heads/master
2022-07-27T18:57:49.916560
2022-01-04T18:00:12
2022-01-04T18:00:12
5,521,942
2
1
null
2022-06-30T20:10:02
2012-08-23T08:33:40
Java
UTF-8
Java
false
false
3,576
java
/** * Creation date: (14/12/2005) * @author: Svyatoslav Urbanovych surban@bigmir.net svyatoslav.urbanovych@gmail.com */ /******************************************************************************** * * Copyright (C) 2005 Svyatoslav Urbanovych * * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *********************************************************************************/ package neohort.universal.output.lib_pln; import java.util.Hashtable; import java.util.List; import neohort.log.stubs.iStub; import neohort.universal.output.iConst; import neohort.universal.output.lib.report_element_base; public class document extends element{ private static final long serialVersionUID = -1L; document document; private java.lang.String STYLE_ID; public document() { super(); } public void add(document child) { this._content = this._content + child._content; } public void executeFirst(Hashtable<String, report_element_base> _tagLibrary, Hashtable<String, report_element_base> _beanLibrary){ try{ Boolean included = (Boolean)(((report_element_base)_beanLibrary.get("SYSTEM:"+iConst.iHORT_SYSTEM_Included)).getContent()); if(included!=null && included.booleanValue()==true){} else{ document = (document)(((report_element_base)_beanLibrary.get("SYSTEM:"+iConst.iHORT_SYSTEM_Document)).getContent()); } }catch(Exception e){ setError(e,iStub.log_ERROR); } } public void executeLast(Hashtable<String, report_element_base> _tagLibrary, Hashtable<String, report_element_base> _beanLibrary){ try{ Boolean included = (Boolean)(((report_element_base)_beanLibrary.get("SYSTEM:"+iConst.iHORT_SYSTEM_Included)).getContent()); if(included!=null && included.booleanValue()==true){} else{ document = (document)(((report_element_base)_beanLibrary.get("SYSTEM:"+iConst.iHORT_SYSTEM_Document)).getContent()); List<Object> vector = _beanLibrary.get("SYSTEM:"+iConst.iHORT_SYSTEM_Canvas).getContentAsList(); if(!vector.isEmpty()) vector.remove(vector.size()-1); if(_tagLibrary.get(getName()+":"+getID())==null) _tagLibrary.remove(getName()+":"+getID()+"_ids_"+this.motore.hashCode()); else _tagLibrary.remove(getName()+":"+getID()); } }catch(Exception e){ setError(e,iStub.log_ERROR); } } public java.lang.String getSTYLE_ID() { return STYLE_ID; } public void reimposta() { setName("DOCUMENT"); STYLE_ID = ""; } public void setCanvas(Hashtable<String, report_element_base> _tagLibrary, Hashtable<String, report_element_base> _beanLibrary) { try{ Boolean included = (Boolean)(((report_element_base)_beanLibrary.get("SYSTEM:"+iConst.iHORT_SYSTEM_Included)).getContent()); if(included!=null && included.booleanValue()==true){} else _beanLibrary.get("SYSTEM:"+iConst.iHORT_SYSTEM_Canvas).add2content(document); }catch(Exception e){ setError(e,iStub.log_ERROR); } } public void setSTYLE_ID(java.lang.String newSTYLE_ID) { STYLE_ID = newSTYLE_ID; } }
[ "svyatoslav.urbanovych@gmail.com" ]
svyatoslav.urbanovych@gmail.com
44df4c23372bd09ca5bae851257b3bd2023e8091
dda963e129c9079e598be1327d498aa699c3d845
/src/main/java/org/yzh/protocol/codec/JTMessageDecoder.java
a1ffe923b8a1eedf26f55197ee710e8d42f5cf19
[ "Apache-2.0" ]
permissive
wlqe/jt808-server
1291f4664bc3f119a910369976e3c5a6fe61b9db
8c611741e72175af3983fe67ec111f0175b9d0ea
refs/heads/master
2023-06-06T04:38:22.783499
2021-07-05T02:02:57
2021-07-05T02:02:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,246
java
package org.yzh.protocol.codec; import io.github.yezhihao.netmc.session.Session; import io.github.yezhihao.protostar.ProtostarUtil; import io.github.yezhihao.protostar.schema.RuntimeSchema; import io.netty.buffer.ByteBuf; import io.netty.buffer.CompositeByteBuf; import io.netty.buffer.Unpooled; import io.netty.buffer.UnpooledByteBufAllocator; import org.yzh.protocol.basics.JTMessage; import org.yzh.protocol.commons.Bit; import org.yzh.protocol.commons.JTUtils; import org.yzh.web.model.enums.SessionKey; import java.util.ArrayList; import java.util.List; import java.util.Map; /** * JT协议解码器 * @author yezhihao * @home https://gitee.com/yezhihao/jt808-server */ public class JTMessageDecoder { private Map<Integer, RuntimeSchema<JTMessage>> headerSchemaMap; public JTMessageDecoder(String basePackage) { ProtostarUtil.initial(basePackage); this.headerSchemaMap = ProtostarUtil.getRuntimeSchema(JTMessage.class); } public JTMessage decode(ByteBuf input) { return decode(input, null); } public JTMessage decode(ByteBuf input, Session session) { ByteBuf buf = unescape(input); boolean verified = verify(buf); int messageId = buf.getUnsignedShort(0); int properties = buf.getUnsignedShort(2); Integer version = session == null ? null : (Integer) session.getAttribute(SessionKey.ProtocolVersion); boolean confirmedVersion = version != null; if (!confirmedVersion) { //识别2019及后续版本 if (Bit.get(properties, 14)) { version = (int) buf.getUnsignedByte(4); confirmedVersion = true; if (session != null) session.setAttribute(SessionKey.ProtocolVersion, version); } else { //缺省值为2013版本 version = 0; } } int headLen; boolean isSubpackage = Bit.get(properties, 13); headLen = JTUtils.headerLength(version, isSubpackage); RuntimeSchema<JTMessage> headSchema = headerSchemaMap.get(version); RuntimeSchema<JTMessage> bodySchema = ProtostarUtil.getRuntimeSchema(messageId, version); JTMessage message; if (bodySchema == null) message = new JTMessage(); else message = bodySchema.newInstance(); message.setVerified(verified); message.setSession(session); message.setPayload(input); headSchema.mergeFrom(buf.slice(0, headLen), message); if (!confirmedVersion && session != null) { //通过缓存记录2011版本 Integer cachedVersion = (Integer) session.getOfflineCache(message.getClientId()); if (cachedVersion != null) version = cachedVersion; session.setAttribute(SessionKey.ProtocolVersion, version); } if (bodySchema != null) { int bodyLen = message.getBodyLength(); if (isSubpackage) { byte[] bytes = new byte[bodyLen]; buf.getBytes(headLen, bytes); byte[][] packages = addAndGet(message, bytes); if (packages == null) return message; ByteBuf bodyBuf = Unpooled.wrappedBuffer(packages); bodySchema.mergeFrom(bodyBuf, message); } else { bodySchema.mergeFrom(buf.slice(headLen, bodyLen), message); } } return message; } protected byte[][] addAndGet(JTMessage message, byte[] bytes) { return null; } /** 校验 */ public static boolean verify(ByteBuf buf) { byte checkCode = buf.getByte(buf.readableBytes() - 1); buf = buf.slice(0, buf.readableBytes() - 1); byte calculatedCheckCode = JTUtils.bcc(buf); return checkCode == calculatedCheckCode; } /** 反转义 */ public static ByteBuf unescape(ByteBuf source) { int low = source.readerIndex(); int high = source.writerIndex(); int last = high - 1; if (source.getByte(0) == 0x7e) low = low + 1; if (source.getByte(last) == 0x7e) high = last; int mark = source.indexOf(low, high, (byte) 0x7d); if (mark == -1) { if (low > 0 || high == last) return source.slice(low, high - low); return source; } List<ByteBuf> bufList = new ArrayList<>(3); int len; do { len = mark + 2 - low; bufList.add(slice(source, low, len)); low += len; mark = source.indexOf(low, high, (byte) 0x7d); } while (mark > 0); bufList.add(source.slice(low, high - low)); return new CompositeByteBuf(UnpooledByteBufAllocator.DEFAULT, false, bufList.size(), bufList); } /** 截取转义前报文,并还原转义位 */ protected static ByteBuf slice(ByteBuf byteBuf, int index, int length) { byte second = byteBuf.getByte(index + length - 1); if (second == 0x02) { byteBuf.setByte(index + length - 2, 0x7e); } return byteBuf.slice(index, length - 1); } }
[ "zhihao.ye@qq.com" ]
zhihao.ye@qq.com
247a65bfb4e490812290578ea2b6a597133d7992
cec1602d23034a8f6372c019e5770773f893a5f0
/sources/com/tencent/tinker/commons/dexpatcher/struct/DexPatchFile.java
0504ec15e79b909f2e1b5c79b110bcef0fcc9f9a
[]
no_license
sengeiou/zeroner_app
77fc7daa04c652a5cacaa0cb161edd338bfe2b52
e95ae1d7cfbab5ca1606ec9913416dadf7d29250
refs/heads/master
2022-03-31T06:55:26.896963
2020-01-24T09:20:37
2020-01-24T09:20:37
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,908
java
package com.tencent.tinker.commons.dexpatcher.struct; import com.tencent.tinker.android.dex.io.DexDataBuffer; import com.tencent.tinker.android.dex.util.CompareUtils; import com.tencent.tinker.android.dex.util.FileUtils; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.nio.ByteBuffer; import java.util.Arrays; public final class DexPatchFile { public static final short CURRENT_VERSION = 2; public static final byte[] MAGIC = {68, 88, 68, 73, 70, 70}; private final DexDataBuffer buffer; private int firstChunkOffset; private byte[] oldDexSignature; private int patchedAnnotationSectionOffset; private int patchedAnnotationSetRefListSectionOffset; private int patchedAnnotationSetSectionOffset; private int patchedAnnotationsDirectorySectionOffset; private int patchedClassDataSectionOffset; private int patchedClassDefSectionOffset; private int patchedCodeSectionOffset; private int patchedDebugInfoSectionOffset; private int patchedDexSize; private int patchedEncodedArraySectionOffset; private int patchedFieldIdSectionOffset; private int patchedMapListSectionOffset; private int patchedMethodIdSectionOffset; private int patchedProtoIdSectionOffset; private int patchedStringDataSectionOffset; private int patchedStringIdSectionOffset; private int patchedTypeIdSectionOffset; private int patchedTypeListSectionOffset; private short version; public DexPatchFile(File file) throws IOException { this.buffer = new DexDataBuffer(ByteBuffer.wrap(FileUtils.readFile(file))); init(); } public DexPatchFile(InputStream is) throws IOException { this.buffer = new DexDataBuffer(ByteBuffer.wrap(FileUtils.readStream(is))); init(); } private void init() { byte[] magic = this.buffer.readByteArray(MAGIC.length); if (CompareUtils.uArrCompare(magic, MAGIC) != 0) { throw new IllegalStateException("bad dex patch file magic: " + Arrays.toString(magic)); } this.version = this.buffer.readShort(); if (CompareUtils.uCompare(this.version, 2) != 0) { throw new IllegalStateException("bad dex patch file version: " + this.version + ", expected: " + 2); } this.patchedDexSize = this.buffer.readInt(); this.firstChunkOffset = this.buffer.readInt(); this.patchedStringIdSectionOffset = this.buffer.readInt(); this.patchedTypeIdSectionOffset = this.buffer.readInt(); this.patchedProtoIdSectionOffset = this.buffer.readInt(); this.patchedFieldIdSectionOffset = this.buffer.readInt(); this.patchedMethodIdSectionOffset = this.buffer.readInt(); this.patchedClassDefSectionOffset = this.buffer.readInt(); this.patchedMapListSectionOffset = this.buffer.readInt(); this.patchedTypeListSectionOffset = this.buffer.readInt(); this.patchedAnnotationSetRefListSectionOffset = this.buffer.readInt(); this.patchedAnnotationSetSectionOffset = this.buffer.readInt(); this.patchedClassDataSectionOffset = this.buffer.readInt(); this.patchedCodeSectionOffset = this.buffer.readInt(); this.patchedStringDataSectionOffset = this.buffer.readInt(); this.patchedDebugInfoSectionOffset = this.buffer.readInt(); this.patchedAnnotationSectionOffset = this.buffer.readInt(); this.patchedEncodedArraySectionOffset = this.buffer.readInt(); this.patchedAnnotationsDirectorySectionOffset = this.buffer.readInt(); this.oldDexSignature = this.buffer.readByteArray(20); this.buffer.position(this.firstChunkOffset); } public short getVersion() { return this.version; } public byte[] getOldDexSignature() { return this.oldDexSignature; } public int getPatchedDexSize() { return this.patchedDexSize; } public int getPatchedStringIdSectionOffset() { return this.patchedStringIdSectionOffset; } public int getPatchedTypeIdSectionOffset() { return this.patchedTypeIdSectionOffset; } public int getPatchedProtoIdSectionOffset() { return this.patchedProtoIdSectionOffset; } public int getPatchedFieldIdSectionOffset() { return this.patchedFieldIdSectionOffset; } public int getPatchedMethodIdSectionOffset() { return this.patchedMethodIdSectionOffset; } public int getPatchedClassDefSectionOffset() { return this.patchedClassDefSectionOffset; } public int getPatchedMapListSectionOffset() { return this.patchedMapListSectionOffset; } public int getPatchedTypeListSectionOffset() { return this.patchedTypeListSectionOffset; } public int getPatchedAnnotationSetRefListSectionOffset() { return this.patchedAnnotationSetRefListSectionOffset; } public int getPatchedAnnotationSetSectionOffset() { return this.patchedAnnotationSetSectionOffset; } public int getPatchedClassDataSectionOffset() { return this.patchedClassDataSectionOffset; } public int getPatchedCodeSectionOffset() { return this.patchedCodeSectionOffset; } public int getPatchedStringDataSectionOffset() { return this.patchedStringDataSectionOffset; } public int getPatchedDebugInfoSectionOffset() { return this.patchedDebugInfoSectionOffset; } public int getPatchedAnnotationSectionOffset() { return this.patchedAnnotationSectionOffset; } public int getPatchedEncodedArraySectionOffset() { return this.patchedEncodedArraySectionOffset; } public int getPatchedAnnotationsDirectorySectionOffset() { return this.patchedAnnotationsDirectorySectionOffset; } public DexDataBuffer getBuffer() { return this.buffer; } }
[ "johan@sellstrom.me" ]
johan@sellstrom.me
673f53035763950e5fd824c5e59bad034a495635
c827a8b6af4228e50a5977c69920de95a8927903
/zxy-game-server/.svn/pristine/ed/edcc28df14e0cce1b5d0046a5126e58cdf001b7c.svn-base
2d85b55d64ab2c4035d4828af7d48a787a7d775a
[]
no_license
tyler-he/wkzj
15012bf29082d941cfbe2bb725db1de54390d410
5e43b83a85e11414c12962d368c2dfdf3cb23d25
refs/heads/master
2023-03-20T03:47:18.275196
2019-03-07T09:42:13
2019-03-07T09:42:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,418
package com.jtang.gameserver.module.sign.dao.impl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; import com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap; import com.jtang.core.cache.CacheListener; import com.jtang.core.cache.CacheRule; import com.jtang.core.db.DBQueue; import com.jtang.core.utility.TimeUtils; import com.jtang.gameserver.dbproxy.IdTableJdbc; import com.jtang.gameserver.dbproxy.entity.Sign; import com.jtang.gameserver.module.sign.dao.SignDao; @Repository public class SignDaoImpl implements SignDao, CacheListener { @Autowired private IdTableJdbc jdbc; @Autowired private DBQueue dbQueue; /** * 角色列表.key:actorId */ private static ConcurrentLinkedHashMap<Long, Sign> SIGN_MAP = new ConcurrentLinkedHashMap.Builder<Long, Sign>().maximumWeightedCapacity( CacheRule.LRU_CACHE_SIZE).build(); @Override public Sign get(long actorId) { if (SIGN_MAP.containsKey(actorId)) { return SIGN_MAP.get(actorId); } Sign sign = jdbc.get(Sign.class, actorId); if (sign == null) { sign = Sign.valueOf(actorId); } SIGN_MAP.put(actorId, sign); return sign; } @Override public void update(Sign sign) { sign.operationTime = TimeUtils.getNow(); dbQueue.updateQueue(sign); } @Override public int cleanCache(long actorId) { SIGN_MAP.remove(actorId); return SIGN_MAP.size(); } }
[ "ityuany@126.com" ]
ityuany@126.com
b289f84e20e258c0bb6d4b973216ee04037a1282
4e8d52f594b89fa356e8278265b5c17f22db1210
/WebServiceArtifacts/SearchServiceService/nl/textkernel/home/search/Cloudtype.java
7b0f47936b8528b891a8e00e9d6ee0b213e29b46
[]
no_license
ouniali/WSantipatterns
dc2e5b653d943199872ea0e34bcc3be6ed74c82e
d406c67efd0baa95990d5ee6a6a9d48ef93c7d32
refs/heads/master
2021-01-10T05:22:19.631231
2015-05-26T06:27:52
2015-05-26T06:27:52
36,153,404
1
2
null
null
null
null
UTF-8
Java
false
false
1,412
java
package nl.textkernel.home.search; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for cloudtype. * * <p>The following schema fragment specifies the expected content contained within this class. * <p> * <pre> * &lt;simpleType name="cloudtype"> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;enumeration value="SPHERE"/> * &lt;enumeration value="SPREAD"/> * &lt;enumeration value="LIST"/> * &lt;enumeration value="COLUMNS1"/> * &lt;enumeration value="COLUMNS2"/> * &lt;enumeration value="COLUMNS3"/> * &lt;/restriction> * &lt;/simpleType> * </pre> * */ @XmlType(name = "cloudtype") @XmlEnum public enum Cloudtype { SPHERE("SPHERE"), SPREAD("SPREAD"), LIST("LIST"), @XmlEnumValue("COLUMNS1") COLUMNS_1("COLUMNS1"), @XmlEnumValue("COLUMNS2") COLUMNS_2("COLUMNS2"), @XmlEnumValue("COLUMNS3") COLUMNS_3("COLUMNS3"); private final String value; Cloudtype(String v) { value = v; } public String value() { return value; } public static Cloudtype fromValue(String v) { for (Cloudtype c: Cloudtype.values()) { if (c.value.equals(v)) { return c; } } throw new IllegalArgumentException(v); } }
[ "ouni_ali@yahoo.fr" ]
ouni_ali@yahoo.fr
06f5c6b775e3efc21e759d50ad3889244c805422
13b89199b2147bd1c7d3a062a606f0edd723c8d6
/AlgorithmStudy/src/javaStudy/ch16_네트워킹/TcpIpServer.java
544ceb042ca23746dd18363f445c963e971e0bce
[]
no_license
chlals862/Algorithm
7bcbcf09b5d4ecad5af3a99873dc960986d1709f
ab4a6d0160ad36404b64ad4b32ce38b67994609f
refs/heads/master
2022-11-28T13:05:58.232855
2022-11-23T09:56:27
2022-11-23T09:56:27
243,694,528
1
1
null
null
null
null
UTF-8
Java
false
false
1,841
java
package javaStudy.ch16_네트워킹; import java.io.DataOutputStream; import java.io.OutputStream; import java.net.ServerSocket; import java.net.Socket; import java.text.SimpleDateFormat; import java.util.Date; public class TcpIpServer { /* * 간단한 TCP/IP서버를 구현한 예제 * 이 예제 실행시 서버소켓이 7777번 포트에서 클라이언트 프로그램의 연결을 기다림 * */ public static void main(String[] args) { ServerSocket serverSocket = null; try { //서버소켓을 생성하여 7777번 포트와 결합(bind)시킨다. serverSocket = new ServerSocket(7777); System.out.println(getTime() + " 서버 준비완료"); } catch (Exception e) { e.printStackTrace(); } while(true) { try { System.out.println(getTime() + "연결요청을 기다림"); //서버소켓은 클라이언트의 연결요청이 올 때까지 실행을 멈추고 계속 기다림 //클라이언트의 연결요청이 오면 클라이언트 소켓과 통신할 새로운 소켓을 생성 Socket socket = serverSocket.accept(); System.out.println(getTime() + socket.getInetAddress() + "로부터 연결요청이 들어옴"); //소켓의 출력스트림을 얻음 OutputStream out = socket.getOutputStream(); DataOutputStream dos = new DataOutputStream(out); //원격소켓(remote socket)에 데이터를 보냄 dos.writeUTF("[Notice] Test Message1 from Server."); System.out.println(getTime() + "데이터를 전송함"); //스트림과 소켓을 닫음 dos.close(); socket.close(); } catch (Exception e) { e.printStackTrace(); } }//while } //현재시간을 문자열로 반환하는 함수 static String getTime() { SimpleDateFormat f = new SimpleDateFormat("[hh:mm:ss]"); return f.format(new Date()); } }
[ "chlals862@naver.com" ]
chlals862@naver.com
1e97bdf9db2a005eceb48e3051d44e049ca21e61
4f8cc9ad6268cf7a5505bfccbd124d88a7eab631
/tl/src/main/java/com/github/badoualy/telegram/tl/api/TLInputDocumentEmpty.java
b32a9dccecf977de54ffc2d83d4a9b01e6d131eb
[ "LicenseRef-scancode-warranty-disclaimer", "MIT" ]
permissive
hosseinab/kotlogram
d7a546b500b311a75281426ff3878afb6a3d9370
a8b79415d44f296987fad4a9087c92e3407c5823
refs/heads/master
2021-01-16T21:43:54.017295
2016-01-29T15:37:30
2016-01-29T15:37:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
695
java
package com.github.badoualy.telegram.tl.api; /** * @author Yannick Badoual yann.badoual@gmail.com * @see <a href="http://github.com/badoualy/kotlogram">http://github.com/badoualy/kotlogram</a> */ public class TLInputDocumentEmpty extends TLAbsInputDocument { public static final int CLASS_ID = 0x72f0eaae; public TLInputDocumentEmpty() { } @Override public String toString() { return "inputDocumentEmpty#72f0eaae"; } @Override public int getClassId() { return CLASS_ID; } @Override public final boolean isEmpty() { return true; } @Override public final boolean isNotEmpty() { return false; } }
[ "yann.badoual@gmail.com" ]
yann.badoual@gmail.com
fa45d7f4463b1e65659fc69c9a7f9690914fc294
5b98fc9ff503d3b3ed49e56b6b2a896b94e4d39b
/pedometer/src/edu/hui/pedometer/PaceNotifier.java
02ddf8c7b5b20cf24b5da6c9b439580ce7654c71
[]
no_license
hui8958/StreetViewPedometerAndroid
e7d801354afa2642aa3c43a83c3daabb76182393
6beab96e70c36c312292dac6a390cbe6b4bd74df
refs/heads/master
2021-01-23T06:25:07.728497
2017-03-27T17:59:04
2017-03-27T17:59:04
86,364,064
0
0
null
null
null
null
UTF-8
Java
false
false
5,830
java
/* * Pedometer - Android App * Copyright (C) 2009 Levente Bagi * * 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 edu.hui.pedometer; import java.util.ArrayList; import edu.hui.pedometer.tools.Utils; /** * Calculates and displays pace (steps / minute), handles input of desired pace, * notifies user if he/she has to go faster or slower. * */ public class PaceNotifier implements StepListener, SpeakingTimer.Listener { public interface Listener { public void paceChanged(int value); public void passValue(); } private ArrayList<Listener> mListeners = new ArrayList<Listener>(); int mCounter = 0; private long mLastStepTime = 0; private long[] mLastStepDeltas = {-1, -1, -1, -1}; private int mLastStepDeltasIndex = 0; private long mPace = 0; PedometerSettings mSettings; Utils mUtils; /** Desired pace, adjusted by the user */ int mDesiredPace; /** Should we speak? */ boolean mShouldTellFasterslower; /** When did the TTS speak last time */ private long mSpokenAt = 0; public PaceNotifier(PedometerSettings settings, Utils utils) { mUtils = utils; mSettings = settings; mDesiredPace = mSettings.getDesiredPace(); reloadSettings(); } public void setPace(int pace) { mPace = pace; int avg = (int)(60*1000.0 / mPace); for (int i = 0; i < mLastStepDeltas.length; i++) { mLastStepDeltas[i] = avg; } notifyListener(); } public void reloadSettings() { mShouldTellFasterslower = mSettings.shouldTellFasterslower() && mSettings.getMaintainOption() == PedometerSettings.M_PACE; notifyListener(); } public void addListener(Listener l) { mListeners.add(l); } public void setDesiredPace(int desiredPace) { mDesiredPace = desiredPace; } public void onStep() { long thisStepTime = System.currentTimeMillis(); mCounter ++; // Calculate pace based on last x steps if (mLastStepTime > 0) { long delta = thisStepTime - mLastStepTime; mLastStepDeltas[mLastStepDeltasIndex] = delta; mLastStepDeltasIndex = (mLastStepDeltasIndex + 1) % mLastStepDeltas.length; long sum = 0; boolean isMeaningfull = true; for (int i = 0; i < mLastStepDeltas.length; i++) { if (mLastStepDeltas[i] < 0) { isMeaningfull = false; break; } sum += mLastStepDeltas[i]; } if (isMeaningfull && sum > 0) { long avg = sum / mLastStepDeltas.length; mPace = 60*1000 / avg; // TODO: remove duplication. This also exists in SpeedNotifier if (mShouldTellFasterslower && !mUtils.isSpeakingEnabled()) { if (thisStepTime - mSpokenAt > 3000 && !mUtils.isSpeakingNow()) { float little = 0.10f; float normal = 0.30f; float much = 0.50f; boolean spoken = true; if (mPace < mDesiredPace * (1 - much)) { mUtils.say("much faster!"); } else if (mPace > mDesiredPace * (1 + much)) { mUtils.say("much slower!"); } else if (mPace < mDesiredPace * (1 - normal)) { mUtils.say("faster!"); } else if (mPace > mDesiredPace * (1 + normal)) { mUtils.say("slower!"); } else if (mPace < mDesiredPace * (1 - little)) { mUtils.say("a little faster!"); } else if (mPace > mDesiredPace * (1 + little)) { mUtils.say("a little slower!"); } else { spoken = false; } if (spoken) { mSpokenAt = thisStepTime; } } } } else { mPace = -1; } } mLastStepTime = thisStepTime; notifyListener(); } private void notifyListener() { for (Listener listener : mListeners) { listener.paceChanged((int)mPace); } } public void passValue() { // Not used } //----------------------------------------------------- // Speaking public void speak() { if (mSettings.shouldTellPace()) { if (mPace > 0) { mUtils.say(mPace + " steps per minute"); } } } }
[ "hui8958@gmail.com" ]
hui8958@gmail.com
dff1a5c2d08401e3cab34da787438b23fb308d93
0af8b92686a58eb0b64e319b22411432aca7a8f3
/large-multiproject/project4/src/main/java/org/gradle/test/performance4_1/Production4_100.java
dd3b7350295618485d3b5f2ab11c36d29c13e2ee
[]
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
300
java
package org.gradle.test.performance4_1; public class Production4_100 extends org.gradle.test.performance2_1.Production2_100 { private final String property; public Production4_100() { this.property = "foo"; } public String getProperty() { return property; } }
[ "cedric.champeau@gmail.com" ]
cedric.champeau@gmail.com
f293e6c2c6c2b20eec02302c922f6e06cdfca399
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/24/24_b3c07174ecc2f34d5c27f883dbf3385e16f7b436/CommitManager/24_b3c07174ecc2f34d5c27f883dbf3385e16f7b436_CommitManager_t.java
f1a9b327f57e0eff46cb719a21c5f1c0958f8bef
[]
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
3,275
java
/* * This file is part of DrFTPD, Distributed FTP Daemon. * * DrFTPD 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. * * DrFTPD 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 DrFTPD; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package org.drftpd.master; import java.io.IOException; import java.util.Date; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Map.Entry; import org.apache.log4j.Logger; import org.java.plugin.PluginClassLoader; import org.java.plugin.PluginManager; /** * @author zubov * @version $Id$ */ public class CommitManager { private static final Logger logger = Logger.getLogger(CommitManager.class); private Map<Commitable, Date> _commitMap = null; private CommitManager() { } private static CommitManager manager = new CommitManager(); public static CommitManager getCommitManager() { return manager; } public void start() { _commitMap = new HashMap<Commitable, Date>(); new Thread(new CommitHandler()).start(); } public synchronized void add(Commitable object) { if (_commitMap.containsKey(object)) { return; // object already queued to write } _commitMap.put(object, new Date()); notifyAll(); } private synchronized void processAll(Map<Commitable, Date> map) { long time = System.currentTimeMillis(); for (Iterator<Entry<Commitable, Date>> iter = map.entrySet().iterator(); iter .hasNext();) { Entry<Commitable, Date> entry = iter.next(); if (time - entry.getValue().getTime() > 10000) { try { entry.getKey().writeToDisk(); } catch (IOException e) { logger.error("Error writing object to disk - " + entry.getKey().descriptiveName(), e); } iter.remove(); } } } private class CommitHandler implements Runnable { private CommitHandler() { } public void run() { PluginManager manager = PluginManager.lookup(this); PluginClassLoader loader = manager.getPluginClassLoader((manager .getPluginFor(this)).getDescriptor()); Thread.currentThread().setContextClassLoader(loader); Thread.currentThread().setName("CommitHandler"); while (true) { synchronized (CommitManager.getCommitManager()) { processAll(_commitMap); try { CommitManager.getCommitManager().wait(10500); // this will wake up when add() is called or a maximum // of 10500 } catch (InterruptedException e) { } } } } } /** * Returns true if the object was removed from the CommitQueue * @param object * @return */ public synchronized boolean remove(Commitable object) { return _commitMap.remove(object) != null; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
aa8c46f9a038072ea6f55f598548789aff4cf6c3
650164baf81c7172133180c1eefbf12ea3f7ebd2
/src/test/java/cn/chouchou/test/MailTest.java
be9394141c712074a7b47f2900bcca7d282407e8
[]
no_license
dengyanshu/chouchou
87881b6cfeb8020906737bfe6c45fbbdd64675bc
041b2bb0e1f5c1dcdbec3e41ac431f36c8d2c564
refs/heads/master
2020-03-19T04:58:16.192052
2018-06-03T08:34:24
2018-06-03T08:34:24
135,887,018
0
0
null
null
null
null
UTF-8
Java
false
false
902
java
package cn.chouchou.test; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.SpringApplicationConfiguration; import org.springframework.mail.SimpleMailMessage; import org.springframework.mail.javamail.JavaMailSender; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import cn.chouchou.App; @RunWith(SpringJUnit4ClassRunner.class) @SpringApplicationConfiguration(classes={App.class}) public class MailTest { @Autowired private JavaMailSender javaMailSender; @Test public void sendSimplemail(){ SimpleMailMessage message=new SimpleMailMessage(); message.setFrom("344630476@qq.com"); message.setTo("2642862135@qq.com"); message.setSubject("这是邮件主题!!"); message.setText("这是邮件内容"); javaMailSender.send(message); } }
[ "344630476@qq.com" ]
344630476@qq.com
6f722dbc40db3c55d14fad9348488d1b6423378c
8af1164bac943cef64e41bae312223c3c0e38114
/results-java/JetBrains--intellij-community/d8d8d93f6442e2c460b14544536a233a53750003/after/GlobalInspectionToolWrapper.java
f631935e20c01c9b32092d99d0ba55462a6af140
[]
no_license
fracz/refactor-extractor
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
dd5e82bfcc376e74a99e18c2bf54c95676914272
refs/heads/master
2021-01-19T06:50:08.211003
2018-11-30T13:00:57
2018-11-30T13:00:57
87,353,478
0
0
null
null
null
null
UTF-8
Java
false
false
3,806
java
/* * Copyright (c) 2006 Your Corporation. All Rights Reserved. */ package com.intellij.codeInspection.ex; import com.intellij.analysis.AnalysisScope; import com.intellij.codeHighlighting.HighlightDisplayLevel; import com.intellij.codeInspection.CommonProblemDescriptor; import com.intellij.codeInspection.GlobalInspectionContext; import com.intellij.codeInspection.GlobalInspectionTool; import com.intellij.codeInspection.InspectionManager; import com.intellij.codeInspection.reference.RefEntity; import com.intellij.codeInspection.reference.RefGraphAnnotator; import com.intellij.codeInspection.reference.RefManagerImpl; import com.intellij.codeInspection.reference.RefVisitor; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.InvalidDataException; import com.intellij.openapi.util.WriteExternalException; import org.jdom.Element; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import javax.swing.*; /** * User: anna * Date: 28-Dec-2005 */ public class GlobalInspectionToolWrapper extends DescriptorProviderInspection { @NotNull private GlobalInspectionTool myTool; public GlobalInspectionToolWrapper(@NotNull GlobalInspectionTool globalInspectionTool) { myTool = globalInspectionTool; } public void initialize(GlobalInspectionContextImpl context) { super.initialize(context); final RefGraphAnnotator annotator = myTool.getAnnotator(getRefManager()); if (annotator != null) { ((RefManagerImpl)getRefManager()).registerGraphAnnotator(annotator); } } public void runInspection(final AnalysisScope scope, final InspectionManager manager) { myTool.runInspection(scope, manager, getContext(), this); } public boolean queryExternalUsagesRequests(final InspectionManager manager) { return myTool.queryExternalUsagesRequests(manager, getContext(), this); } @NotNull public JobDescriptor[] getJobDescriptors() { return isGraphNeeded() ? new JobDescriptor[]{GlobalInspectionContextImpl.BUILD_GRAPH}: JobDescriptor.EMPTY_ARRAY; } public String getDisplayName() { return myTool.getDisplayName(); } public String getGroupDisplayName() { return myTool.getGroupDisplayName(); } @NonNls public String getShortName() { return myTool.getShortName(); } public boolean isEnabledByDefault() { return myTool.isEnabledByDefault(); } public HighlightDisplayLevel getDefaultLevel() { return myTool.getDefaultLevel(); } public void readSettings(Element element) throws InvalidDataException { myTool.readSettings(element); } public void writeSettings(Element element) throws WriteExternalException { myTool.writeSettings(element); } public JComponent createOptionsPanel() { return myTool.createOptionsPanel(); } public boolean isGraphNeeded() { return myTool.isGraphNeeded(); } @NotNull public GlobalInspectionTool getTool() { return myTool; } public void processFile(final AnalysisScope analysisScope, final InspectionManager manager, final GlobalInspectionContext context, final boolean filterSuppressed) { context.getRefManager().iterate(new RefVisitor() { public void visitElement(RefEntity refEntity) { if (filterSuppressed && context.isSuppressed(refEntity, myTool.getShortName())) return; CommonProblemDescriptor[] descriptors = myTool.checkElement(refEntity, analysisScope, manager, context); if (descriptors != null) { addProblemElement(refEntity, descriptors); } } }); } public void projectOpened(Project project) { myTool.projectOpened(project); } public void projectClosed(Project project) { myTool.projectClosed(project); } }
[ "fraczwojciech@gmail.com" ]
fraczwojciech@gmail.com
c64e947d0b6337a0b4b1c1a2e46040dd26a9307f
10cedb0e65ea377fc03eb67286f60af5bc67e704
/EXAMS/Exam 2018-04-22/Most Wanted/src/main/java/org/softuni/mostwanted/terminal/Terminal.java
dab8aa4ef87f03f883f285792c13fa19fe832eca
[]
no_license
zgirtsova/Databases-Frameworks---Hibernate-Spring---032018
cab9d0bc7bb4184f74cf1259d836415ffde47871
73bc7bb086e1dba5d5acef0f812a0bceb55fe6b7
refs/heads/master
2020-04-07T17:56:06.447618
2018-11-08T09:37:39
2018-11-08T09:37:39
124,226,108
0
0
null
null
null
null
UTF-8
Java
false
false
3,767
java
package org.softuni.mostwanted.terminal; import org.softuni.mostwanted.config.Config; import org.softuni.mostwanted.controller.*; import org.softuni.mostwanted.io.interfaces.ConsoleIO; import org.softuni.mostwanted.io.interfaces.FileIO; import org.softuni.mostwanted.model.dto.binding.json.CarImportJsonDto; import org.softuni.mostwanted.model.dto.binding.json.DistrictImportJsonDto; import org.softuni.mostwanted.model.dto.binding.json.RacerImportJsonDto; import org.softuni.mostwanted.model.dto.binding.json.TownImportJsonDto; import org.softuni.mostwanted.persistance.service.api.TownService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.CommandLineRunner; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; @Component @Transactional public class Terminal implements CommandLineRunner { private final FileIO fileIO; private final ConsoleIO consoleIO; private final CarController carController; private final DistrictController districtController; private final RaceController raceController; private final RaceEntryController raceEntryController; private final RacerController racerController; private final TownController townController; private final TownService townService; @Autowired public Terminal(final FileIO fileIO, final ConsoleIO consoleIO, final CarController carController, final DistrictController districtController, final RaceController raceController, final RaceEntryController raceEntryController, final RacerController racerController, final TownController townController, final TownService townService) { this.fileIO = fileIO; this.consoleIO = consoleIO; this.carController = carController; this.districtController = districtController; this.raceController = raceController; this.raceEntryController = raceEntryController; this.racerController = racerController; this.townController = townController; this.townService = townService; } @Override public void run(String... args) { this.consoleIO.write( this.townController.importFromJSON( fileIO.read(Config.TOWNS_IMPORT_JSON), TownImportJsonDto[].class)); this.consoleIO.write( this.districtController.importFromJSON( fileIO.read(Config.DISTRICTS_IMPORT_JSON), DistrictImportJsonDto[].class)); this.consoleIO.write( this.racerController.importFromJSON( fileIO.read(Config.RACERS_IMPORT_JSON), RacerImportJsonDto[].class)); this.consoleIO.write( this.carController.importFromJSON( this.fileIO.read(Config.CARS_IMPORT_JSON), CarImportJsonDto[].class)); this.consoleIO.write( this.raceEntryController.importFromXML( fileIO.read(Config.RACE_ENTRIES_IMPORT_XML))); this.consoleIO.write( this.raceController.importFromXML( fileIO.read(Config.RACES_IMPORT_XML))); // // this.fileIO.write( // this.townController.townsByRacers(), // Config.TOWNS_BY_RACERS_EXPORT_JSON); // // this.fileIO.write( // this.racerController.getAllRacersWithCars(), // Config.RACERS_WITH_CARS_EXPORT_JSON); // // this.fileIO.write( // this.raceEntryController.exportMostWantedRacer(), // Config.MOST_WANTED_RACER_EXPORT_XML); } }
[ "zgirtsova@gmail.com" ]
zgirtsova@gmail.com
a003ee903b1ac9236866c49e6f572e2738ae8ead
1302a788aa73d8da772c6431b083ddd76eef937f
/WORKING_DIRECTORY/hardware/bsp/intel/peripheral/libupm/examples/java/HTU21DSample.java
a402d0460e3ded483a03fd531d90eeaaf56be396
[ "MIT" ]
permissive
rockduan/androidN-android-7.1.1_r28
b3c1bcb734225aa7813ab70639af60c06d658bf6
10bab435cd61ffa2e93a20c082624954c757999d
refs/heads/master
2021-01-23T03:54:32.510867
2017-03-30T07:17:08
2017-03-30T07:17:08
86,135,431
2
1
null
null
null
null
UTF-8
Java
false
false
1,950
java
/* * Author: Stefan Andritoiu <stefan.andritoiu@intel.com> * Copyright (c) 2015 Intel Corporation. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ //NOT TESTED!!! public class HTU21DSample { static { try { System.loadLibrary("javaupm_htu21d"); } catch (UnsatisfiedLinkError e) { System.err.println("error in loading native library"); System.exit(-1); } } public static void main(String[] args) throws InterruptedException { // ! [Interesting] float humidity = 0; float temperature = 0; float compRH = 0; upm_htu21d.HTU21D sensor = new upm_htu21d.HTU21D(0); sensor.testSensor(); while (true) { compRH = sensor.getCompRH(); humidity = sensor.getHumidity(); temperature = sensor.getTemperature(); System.out.println("Humidity: " + humidity + ", Temperature: " + temperature + ", compensated RH: " + compRH); Thread.sleep(5000); } // ! [Interesting] } }
[ "duanliangsilence@gmail.com" ]
duanliangsilence@gmail.com
97e24df5ec868be2c21554915d9b986d24cbe59c
863759d2414f96bdfd896c929c6098c3bf2006f3
/app/src/main/java/com/study/bmixture/ui/presenter/MainPresenter.java
eed1e2d3597b2a5af7f12d9a43556835ce052d7f
[]
no_license
Tralo/BMixture
3094c720eb4c5437e7b8bb7e54ef24763ec013c5
cef321d7f2b209059e663ea69a5dc7b8f8b7b03e
refs/heads/master
2020-03-07T19:27:32.046763
2018-04-02T20:47:14
2018-04-02T20:47:14
127,671,067
0
0
null
null
null
null
UTF-8
Java
false
false
158
java
package com.study.bmixture.ui.presenter; import com.study.bmixture.base.presenter.BasePresenter; public class MainPresenter extends BasePresenter { }
[ "13580548169@163.com" ]
13580548169@163.com
e3af2a1059b276f9f74532b5d9308df003da0f08
dca9718696e2813de59fda86333013a00eec7b50
/src/main/java/demo/pattern/factory/method/FactoryMethodDemo.java
35c15670acff942088e553e4c1df5473d6e36476
[]
no_license
KongXinYu/simplespring
14c51445235f7b2bb5ce9426076bd3d8869d5854
2d3c9f61afdfefe0749ed7fd6b54063f4721f7fd
refs/heads/master
2023-02-02T20:59:42.109989
2020-12-15T09:03:58
2020-12-15T09:03:58
321,610,148
0
0
null
null
null
null
UTF-8
Java
false
false
416
java
package demo.pattern.factory.method; import demo.pattern.factory.entity.LenovoMouse; import demo.pattern.factory.entity.Mouse; /** * @description: * @author: WuZY * @time: 2020/12/9 0009 下午 1:39 */ public class FactoryMethodDemo { public static void main(String[] args) { MouseFactory factory = new IBMMouseFactory(); Mouse mouse = factory.createMouse(); mouse.sayHi(); } }
[ "123@qq.com" ]
123@qq.com
2c10146718c660d1027a16832ae3ee5800c92aa3
80a6b8d1efa66efbb94f0df684eedb81a5cc552c
/assertj-core/src/test/java/org/assertj/core/api/charsequence/CharSequenceAssert_containsOnlyOnce_Test.java
a78812e6108ba3130643dd70238785687fdff9b1
[ "Apache-2.0" ]
permissive
AlHasan89/System_Re-engineering
43f232e90f65adc940af3bfa2b4d584d25ce076c
b80e6d372d038fd246f946e41590e07afddfc6d7
refs/heads/master
2020-03-27T05:08:26.156072
2019-01-06T17:54:59
2019-01-06T17:54:59
145,996,692
0
1
Apache-2.0
2019-01-06T17:55:00
2018-08-24T13:43:31
Java
UTF-8
Java
false
false
1,316
java
/** * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. * * Copyright 2012-2017 the original author or authors. */ package org.assertj.core.api.charsequence; import org.assertj.core.api.CharSequenceAssert; import org.assertj.core.api.CharSequenceAssertBaseTest; import static org.mockito.Mockito.verify; /** * Tests for <code>{@link CharSequenceAssert#containsOnlyOnce(CharSequence)}</code>. * * @author Pauline Iogna * @author Joel Costigliola */ public class CharSequenceAssert_containsOnlyOnce_Test extends CharSequenceAssertBaseTest { @Override protected CharSequenceAssert invoke_api_method() { return assertions.containsOnlyOnce("od"); } @Override protected void verify_internal_effects() { verify(strings).assertContainsOnlyOnce(getInfo(assertions), getActual(assertions), "od"); } }
[ "nw91@le.ac.uk" ]
nw91@le.ac.uk
eafaefdf6ea3faecf4fb2aaccb6d01f4825cda71
c885ef92397be9d54b87741f01557f61d3f794f3
/tests-without-trycatch/Csv-8/org.apache.commons.csv.CSVFormat/default/25/org/apache/commons/csv/CSVFormat_ESTest_scaffolding.java
8e5a7d6024979b5f0e31727a9432b0c278250e41
[ "CC-BY-4.0", "MIT" ]
permissive
pderakhshanfar/EMSE-BBC-experiment
f60ac5f7664dd9a85f755a00a57ec12c7551e8c6
fea1a92c2e7ba7080b8529e2052259c9b697bbda
refs/heads/main
2022-11-25T00:39:58.983828
2022-04-12T16:04:26
2022-04-12T16:04:26
309,335,889
0
1
null
2021-11-05T11:18:43
2020-11-02T10:30:38
null
UTF-8
Java
false
false
4,755
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Fri Jul 30 00:04:54 GMT 2021 */ package org.apache.commons.csv; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; import org.junit.AfterClass; import org.evosuite.runtime.sandbox.Sandbox; import org.evosuite.runtime.sandbox.Sandbox.SandboxMode; @EvoSuiteClassExclude public class CSVFormat_ESTest_scaffolding { @org.junit.Rule public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule(); private static final java.util.Properties defaultProperties = (java.util.Properties) java.lang.System.getProperties().clone(); private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000); @BeforeClass public static void initEvoSuiteFramework() { org.evosuite.runtime.RuntimeSettings.className = "org.apache.commons.csv.CSVFormat"; org.evosuite.runtime.GuiSupport.initialize(); org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100; org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000; org.evosuite.runtime.RuntimeSettings.mockSystemIn = true; org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED; org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT(); org.evosuite.runtime.classhandling.JDKClassResetter.init(); setSystemProperties(); initializeClasses(); org.evosuite.runtime.Runtime.getInstance().resetRuntime(); } @AfterClass public static void clearEvoSuiteFramework(){ Sandbox.resetDefaultSecurityManager(); java.lang.System.setProperties((java.util.Properties) defaultProperties.clone()); } @Before public void initTestCase(){ threadStopper.storeCurrentThreads(); threadStopper.startRecordingTime(); org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler(); org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode(); setSystemProperties(); org.evosuite.runtime.GuiSupport.setHeadless(); org.evosuite.runtime.Runtime.getInstance().resetRuntime(); org.evosuite.runtime.agent.InstrumentingAgent.activate(); } @After public void doneWithTestCase(){ threadStopper.killAndJoinClientThreads(); org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks(); org.evosuite.runtime.classhandling.JDKClassResetter.reset(); resetClasses(); org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode(); org.evosuite.runtime.agent.InstrumentingAgent.deactivate(); org.evosuite.runtime.GuiSupport.restoreHeadlessMode(); } public static void setSystemProperties() { java.lang.System.setProperties((java.util.Properties) defaultProperties.clone()); java.lang.System.setProperty("user.dir", "/experiment"); java.lang.System.setProperty("java.io.tmpdir", "/tmp"); } private static void initializeClasses() { org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(CSVFormat_ESTest_scaffolding.class.getClassLoader() , "org.apache.commons.csv.Token", "org.apache.commons.csv.Constants", "org.apache.commons.csv.CSVRecord", "org.apache.commons.csv.Assertions", "org.apache.commons.csv.CSVParser$2", "org.apache.commons.csv.CSVFormat", "org.apache.commons.csv.Quote", "org.apache.commons.csv.Lexer", "org.apache.commons.csv.CSVParser", "org.apache.commons.csv.Token$Type", "org.apache.commons.csv.CSVPrinter$1", "org.apache.commons.csv.ExtendedBufferedReader", "org.apache.commons.csv.CSVPrinter" ); } private static void resetClasses() { org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(CSVFormat_ESTest_scaffolding.class.getClassLoader()); org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses( "org.apache.commons.csv.Constants", "org.apache.commons.csv.CSVFormat", "org.apache.commons.csv.Quote", "org.apache.commons.csv.CSVParser", "org.apache.commons.csv.Token", "org.apache.commons.csv.Token$Type", "org.apache.commons.csv.Assertions", "org.apache.commons.csv.Lexer", "org.apache.commons.csv.ExtendedBufferedReader", "org.apache.commons.csv.CSVPrinter", "org.apache.commons.csv.CSVPrinter$1", "org.apache.commons.csv.CSVParser$2", "org.apache.commons.csv.CSVRecord" ); } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
69541668ab5e51dbd0dbde469a1959f42dd57886
70e207ac63da49eddd761a6e3a901e693f4ec480
/net.certware.planning.cpn.ui/src/net/certware/planning/cpn/ui/labeling/CpnDslDescriptionLabelProvider.java
5e96b64752acd97430b6ab675db83be329c7e1ed
[ "Apache-2.0" ]
permissive
arindam7development/CertWare
43be650539963b1efef4ce4cad164f23185d094b
cbbfdb6012229444d3c0d7e64c08ac2a15081518
refs/heads/master
2020-05-29T11:38:08.794116
2016-03-29T13:56:37
2016-03-29T13:56:37
null
0
0
null
null
null
null
UTF-8
Java
false
false
633
java
/* * generated by Xtext */ package net.certware.planning.cpn.ui.labeling; import org.eclipse.xtext.ui.label.DefaultDescriptionLabelProvider; /** * Provides labels for a IEObjectDescriptions and IResourceDescriptions. * * see http://www.eclipse.org/Xtext/documentation/latest/xtext.html#labelProvider */ public class CpnDslDescriptionLabelProvider extends DefaultDescriptionLabelProvider { /* //Labels and icons can be computed like this: String text(IEObjectDescription ele) { return "my "+ele.getName(); } String image(IEObjectDescription ele) { return ele.getEClass().getName() + ".gif"; } */ }
[ "mrbarry@kestreltechnology.com" ]
mrbarry@kestreltechnology.com
7efaac557fb0472efaa89e4c1d39ee5ea07872cf
367f3ffcb97605e79c2fe99150a44c69b4a2b3df
/huxin_sdk/src/main/java/com/youmai/hxsdk/view/progressbar/HorizontalProgressBar.java
caa72b861d9243abd913557273056d50925ec29c
[]
no_license
soulcure/czy_im
5a42aeae9e1c336239ef7d21e9ce781f40947f89
cc8dfb499f832e103fb94b486398d5aca9c21563
refs/heads/master
2023-05-01T16:14:56.119490
2021-05-18T02:25:28
2021-05-18T02:25:28
337,806,897
1
0
null
null
null
null
UTF-8
Java
false
false
5,396
java
package com.youmai.hxsdk.view.progressbar; import android.content.Context; import android.content.res.TypedArray; import android.graphics.Canvas; import android.graphics.Paint; import android.util.AttributeSet; import android.util.TypedValue; import android.widget.ProgressBar; import com.youmai.hxsdk.R; /** * Created by yw on 16/6/20. */ public class HorizontalProgressBar extends ProgressBar { private static final int DEFAULT_TEXT_SIZE = 13; private static final int DEFAULT_TEXT_COLOR = 0xffFC00D1; private static final int DEFAULT_Color_UNREACH = 0xFFD3D6DA; private static final int DEFAULT_HEIGHT_UNREACH = 2; private static final int DEFAULT_COLOR_REACH = DEFAULT_TEXT_COLOR; private static final int DEFAULT_HEIGHT_REACH = 2; private static final int DEFAULT_TEXT_OFFSET = 13; protected int mTextSize = spToPx(DEFAULT_TEXT_SIZE); protected int mTextColor = DEFAULT_TEXT_COLOR; protected int mUnreachHeight = dpToPx(DEFAULT_HEIGHT_UNREACH); protected int mUnreachColor = DEFAULT_Color_UNREACH; protected int mReachHeight = dpToPx(DEFAULT_HEIGHT_REACH); protected int mReachColor = DEFAULT_COLOR_REACH; protected int mTextOffset = dpToPx(DEFAULT_TEXT_OFFSET); protected Paint mPaint = new Paint(); private int mRealWidth; public HorizontalProgressBar(Context context) { this(context, null); } public HorizontalProgressBar(Context context, AttributeSet attrs) { this(context, attrs, 0); } public HorizontalProgressBar(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); obtainStyleAttrs(attrs); mPaint.setTextSize(mTextSize); } /** * 获得自定义参数 * * @param attrs */ private void obtainStyleAttrs(AttributeSet attrs) { TypedArray ta = getContext().obtainStyledAttributes(attrs, R.styleable.HorizontalProgressBar); mTextColor = ta.getColor(R.styleable.HorizontalProgressBar_progress_text_color, mTextColor); mTextSize = (int) ta.getDimension(R.styleable.HorizontalProgressBar_progress_text_size, mTextSize); mReachColor = ta.getColor(R.styleable.HorizontalProgressBar_progress_reach_color, mReachColor); mReachHeight = (int) ta.getDimension(R.styleable.HorizontalProgressBar_progress_reach_height, mReachHeight); mUnreachColor = ta.getColor(R.styleable.HorizontalProgressBar_progress_unreach_color, mUnreachColor); mUnreachHeight = (int) ta.getDimension(R.styleable.HorizontalProgressBar_progress_unreach_height, mUnreachHeight); ta.recycle(); } @Override protected synchronized void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { //int widthMode = MeasureSpec.getMode(widthMeasureSpec); int widthSize = MeasureSpec.getSize(widthMeasureSpec); int height = measureHeight(heightMeasureSpec); setMeasuredDimension(widthSize, height); mRealWidth = getMeasuredWidth() - getPaddingLeft() - getPaddingRight(); } @Override protected synchronized void onDraw(Canvas canvas) { canvas.save(); canvas.translate(getPaddingLeft(), getHeight() / 2); boolean noNeedUnreach = false; //draw reach bar float radio = getProgress() * 1.0f / getMax(); float progressX = radio * mRealWidth; String text = getProgress() + "%"; float textWidth = mPaint.measureText(text); if (textWidth + progressX > mRealWidth) { progressX = mRealWidth - textWidth; noNeedUnreach = true; } float endX = progressX - mTextOffset / 2; if (endX > 0) { mPaint.setColor(mReachColor); mPaint.setStrokeWidth(mReachHeight); canvas.drawLine(0, 0, endX, 0, mPaint); } //draw text mPaint.setColor(mTextColor); mPaint.setStrokeWidth(mTextSize); int y = (int) (Math.abs(mPaint.descent() + mPaint.ascent()) / 2) ; canvas.drawText(text, progressX, y, mPaint); //draw unreach bar if (!noNeedUnreach) { float start = progressX + mTextOffset / 2 + textWidth; mPaint.setColor(mUnreachColor); mPaint.setStrokeWidth(mUnreachHeight); canvas.drawLine(Math.min(start, mRealWidth), 0, mRealWidth, 0, mPaint); } canvas.restore(); } private int measureHeight(int heightMeasureSpec) { int result = 0; int mode = MeasureSpec.getMode(heightMeasureSpec); int size = MeasureSpec.getSize(heightMeasureSpec); if (mode == MeasureSpec.EXACTLY) { result = size; } else { int textSize = (int) (mPaint.descent() - mPaint.ascent()); result = getPaddingTop() + getPaddingBottom() + Math.max(Math.max(mUnreachHeight, mReachHeight), Math.abs(textSize)); if (mode == MeasureSpec.AT_MOST) { result = Math.min(size, result); } } return result; } protected int spToPx(int spValue) { return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, spValue, getResources().getDisplayMetrics()); } protected int dpToPx(int dpValue) { return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dpValue, getResources().getDisplayMetrics()); } }
[ "chenqiongyao@coocaa.com" ]
chenqiongyao@coocaa.com
01293c50470ba551a0c339c842168995a31c74bd
d2984ba2b5ff607687aac9c65ccefa1bd6e41ede
/src/net/datenwerke/rs/grideditor/service/grideditor/definition/editor/dtogen/IntBooleanEditor2DtoGenerator.java
c44621d971e09937404caa6b5deae18185467f6d
[]
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
2,806
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.grideditor.service.grideditor.definition.editor.dtogen; import com.google.inject.Inject; import com.google.inject.Provider; import net.datenwerke.dtoservices.dtogenerator.annotations.GeneratedType; import net.datenwerke.dtoservices.dtogenerator.poso2dtogenerator.interfaces.Poso2DtoGenerator; import net.datenwerke.gxtdto.client.dtomanager.DtoView; import net.datenwerke.gxtdto.server.dtomanager.DtoMainService; import net.datenwerke.gxtdto.server.dtomanager.DtoService; import net.datenwerke.rs.grideditor.client.grideditor.dto.IntBooleanEditorDto; import net.datenwerke.rs.grideditor.client.grideditor.dto.decorator.IntBooleanEditorDtoDec; import net.datenwerke.rs.grideditor.service.grideditor.definition.editor.IntBooleanEditor; import net.datenwerke.rs.grideditor.service.grideditor.definition.editor.dtogen.IntBooleanEditor2DtoGenerator; /** * Poso2DtoGenerator for IntBooleanEditor * * This file was automatically created by DtoAnnotationProcessor, version 0.1 */ @GeneratedType("net.datenwerke.dtoservices.dtogenerator.DtoAnnotationProcessor") public class IntBooleanEditor2DtoGenerator implements Poso2DtoGenerator<IntBooleanEditor,IntBooleanEditorDtoDec> { private final Provider<DtoService> dtoServiceProvider; @Inject public IntBooleanEditor2DtoGenerator( Provider<DtoService> dtoServiceProvider ){ this.dtoServiceProvider = dtoServiceProvider; } public IntBooleanEditorDtoDec instantiateDto(IntBooleanEditor poso) { IntBooleanEditorDtoDec dto = new IntBooleanEditorDtoDec(); return dto; } public IntBooleanEditorDtoDec createDto(IntBooleanEditor poso, DtoView here, DtoView referenced) { /* create dto and set view */ final IntBooleanEditorDtoDec dto = new IntBooleanEditorDtoDec(); dto.setDtoView(here); if(here.compareTo(DtoView.NORMAL) >= 0){ /* set falseInt */ dto.setFalseInt(poso.getFalseInt() ); /* set trueInt */ dto.setTrueInt(poso.getTrueInt() ); } return dto; } }
[ "srbala@gmail.com" ]
srbala@gmail.com
82efe0ab7fb359c70739e4587b9fff125a2c9b21
d99e6aa93171fafe1aa0bb39b16c1cc3b63c87f1
/stress/src/main/java/com/stress/sub1/sub4/sub7/Class4136.java
46b1ce1fe5adcc7ea4f01dc9ac6edf10db8aeedc
[]
no_license
jtransc/jtransc-examples
291c9f91c143661c1776ddb7a359790caa70a37b
f44979531ac1de72d7af52545c4a9ef0783a0d5b
refs/heads/master
2021-01-17T13:19:55.535947
2017-09-13T06:31:25
2017-09-13T06:31:25
51,407,684
14
4
null
2017-07-04T10:18:40
2016-02-09T23:11:45
Java
UTF-8
Java
false
false
394
java
package com.stress.sub1.sub4.sub7; import com.jtransc.annotation.JTranscKeep; @JTranscKeep public class Class4136 { public static final String static_const_4136_0 = "Hi, my num is 4136 0"; static int static_field_4136_0; int member_4136_0; public void method4136() { System.out.println(static_const_4136_0); } public void method4136_1(int p0, String p1) { System.out.println(p1); } }
[ "soywiz@gmail.com" ]
soywiz@gmail.com
f76e4e03b8bc9b3aa15a7e1e1774afa9889d88b0
ea7cecb1f77a57c1be2c1b7192185fbbdf18488e
/icy/imagej/patches/ImagePlusMethods.java
c0732a114759d526519eb934be9e9698e082b716
[]
no_license
mosquitoCat/Icy-Kernel
869036cc433ec3b5f66eaaa3723f104d09df8001
e3016ee05540f2a54fb5dff3c08603abf4f8ea48
refs/heads/master
2021-01-22T13:48:06.033323
2014-10-22T14:45:44
2014-10-22T14:45:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,348
java
/* * Copyright 2010-2013 Institut Pasteur. * * This file is part of Icy. * * Icy 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. * * Icy 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 Icy. If not, see <http://www.gnu.org/licenses/>. */ // ImagePlusMethods.java // /* * ImageJ software for multidimensional image processing and analysis. * * Copyright (c) 2010, ImageJDev.org. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the names of the ImageJDev.org developers nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ package icy.imagej.patches; import ij.ImagePlus; /** * Overrides {@link ImagePlus} methods. * * @author Curtis Rueden * @author Barry DeZonia */ public final class ImagePlusMethods { private ImagePlusMethods() { // prevent instantiation of utility class } /** Appends {@link ImagePlus#updateAndDraw()}. */ public static void updateAndDraw(final ImagePlus obj) { // imageChanged } /** Appends {@link ImagePlus#repaintWindow()}. */ public static void repaintWindow(final ImagePlus obj) { // imageChanged } /** Appends {@link ImagePlus#show(String message)}. */ public static void show(final ImagePlus obj, @SuppressWarnings("unused") final String message) { } /** Appends {@link ImagePlus#hide()}. */ public static void hide(final ImagePlus obj) { } /** Appends {@link ImagePlus#close()}. */ public static void close(final ImagePlus obj) { } }
[ "stephane.dallongeville@pasteur.fr" ]
stephane.dallongeville@pasteur.fr
ed0ed9da4b49b8fe4472fbb053d22bcd61a543fd
22d5dad452dabe9e3fa069396d3539f1614f6ef0
/spring-boot-27-CrawlerAndVue/src/main/java/com/han/config/CorsConfig.java
96ce869c7ba24c4a3c2b0e0e32ca5e32ff5147ec
[]
no_license
mvphjx/spring-boot
c6d98fbe47ec6449b4b0038b2ad95e7040e503af
f983cdfde35464d732d60dbd6bcc2ec59b8a4834
refs/heads/master
2021-06-08T23:52:08.520721
2021-04-28T10:49:37
2021-04-28T10:49:37
178,554,237
0
0
null
2019-03-30T12:12:26
2019-03-30T12:12:26
null
UTF-8
Java
false
false
1,124
java
package com.han.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.cors.CorsConfiguration; import org.springframework.web.cors.UrlBasedCorsConfigurationSource; import org.springframework.web.filter.CorsFilter; import org.springframework.web.servlet.config.annotation.CorsRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; import static org.springframework.web.cors.CorsConfiguration.ALL; /** * 跨域配置 */ @Configuration public class CorsConfig { @Bean public WebMvcConfigurer corsConfigurer() { return new WebMvcConfigurerAdapter() { @Override public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/**") .allowedOrigins(ALL) .allowedMethods(ALL) .allowedHeaders(ALL) .allowCredentials(true); } }; } }
[ "511572653@qq.com" ]
511572653@qq.com
d9da3107bebf575dd00bbd16e506367fd4efe34c
8bca6164fc085936891cda5ff7b2341d3d7696c5
/bootstrap/gensrc/de/hybris/platform/catalog/enums/CategoryDifferenceMode.java
ca75e2bd8427c9fb318eb7a3d2341eebd1f7106c
[]
no_license
rgonthina1/newplatform
28819d22ba48e48d4edebbf008a925cad0ebc828
1cdc70615ea4e86863703ca9a34231153f8ef373
refs/heads/master
2021-01-19T03:03:22.221074
2016-06-20T14:49:25
2016-06-20T14:49:25
61,548,232
1
0
null
null
null
null
UTF-8
Java
false
false
1,732
java
/* * * [y] hybris Platform * * Copyright (c) 2000-2015 hybris AG * All rights reserved. * * This software is the confidential and proprietary information of hybris * ("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 hybris. * */ package de.hybris.platform.catalog.enums; import de.hybris.platform.core.HybrisEnumValue; /** * Generated enum CategoryDifferenceMode declared at extension catalog. */ @SuppressWarnings("PMD") public enum CategoryDifferenceMode implements HybrisEnumValue { /** * Generated enum value for CategoryDifferenceMode.category_new declared at extension catalog. */ CATEGORY_NEW("category_new"), /** * Generated enum value for CategoryDifferenceMode.category_removed declared at extension catalog. */ CATEGORY_REMOVED("category_removed"); /**<i>Generated model type code constant.</i>*/ public final static String _TYPECODE = "CategoryDifferenceMode"; /**<i>Generated simple class name constant.</i>*/ public final static String SIMPLE_CLASSNAME = "CategoryDifferenceMode"; /** The code of this enum.*/ private final String code; /** * Creates a new enum value for this enum type. * * @param code the enum value code */ private CategoryDifferenceMode(final String code) { this.code = code.intern(); } /** * Gets the code of this enum value. * * @return code of value */ @Override public String getCode() { return this.code; } /** * Gets the type this enum value belongs to. * * @return code of type */ @Override public String getType() { return SIMPLE_CLASSNAME; } }
[ "Kalpana" ]
Kalpana
239daf55fe8a79ea903496fa5a05f19f92f9897a
1df9b2dd4a7db2f1673638a46ecb6f20a3933994
/Spring-proctice/src/SCenter/viper-client-api/target/generated-se/src/main/java/com/allconnect/xml/se/v4/CandidateAddressList.java
dcc92d20e883659a3d194384180adc67e5a1fb16
[]
no_license
pavanhp001/Spring-boot-proct
71cfb3e86f74aa22951f66a87d55ba4a18b5c6c7
238bf76e1b68d46acb3d0e98cb34a53a121643dc
refs/heads/master
2020-03-20T12:23:10.735785
2019-03-18T04:03:40
2019-03-18T04:03:40
137,428,541
0
0
null
null
null
null
UTF-8
Java
false
false
3,945
java
package com.A.xml.se.v4; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="candidateAddress" maxOccurs="unbounded" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;extension base="{http://xml.A.com/v4}addressType"> * &lt;attribute name="matchScore" type="{http://www.w3.org/2001/XMLSchema}int" /> * &lt;/extension> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "candidateAddresses" }) @XmlRootElement(name = "candidateAddressList") public class CandidateAddressList { @XmlElement(name = "candidateAddress") protected List<CandidateAddressList.CandidateAddress> candidateAddresses; /** * Gets the value of the candidateAddresses property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the candidateAddresses property. * * <p> * For example, to add a new item, do as follows: * <pre> * getCandidateAddresses().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link CandidateAddressList.CandidateAddress } * * */ public List<CandidateAddressList.CandidateAddress> getCandidateAddresses() { if (candidateAddresses == null) { candidateAddresses = new ArrayList<CandidateAddressList.CandidateAddress>(); } return this.candidateAddresses; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;extension base="{http://xml.A.com/v4}addressType"> * &lt;attribute name="matchScore" type="{http://www.w3.org/2001/XMLSchema}int" /> * &lt;/extension> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") public static class CandidateAddress extends AddressType { @XmlAttribute(name = "matchScore") protected Integer matchScore; /** * Gets the value of the matchScore property. * * @return * possible object is * {@link Integer } * */ public Integer getMatchScore() { return matchScore; } /** * Sets the value of the matchScore property. * * @param value * allowed object is * {@link Integer } * */ public void setMatchScore(Integer value) { this.matchScore = value; } } }
[ "pavan.hp001@gmail.com" ]
pavan.hp001@gmail.com
4f4fad8f579344fb7ed561a437fbbfae2502203e
648b678ed17181d1e39845bfa1b2cc915956de71
/Summary/DataStructure/Tree/Recursion/BinaryTreeMaximumPathSum_124/Solution.java
5ed89a97a68fab8c12c63d2cbe8709e88e0fc015
[]
no_license
kuwylsr/Lee-Sirui-code
701455b507802f6dad1e9b90fe7d5aea3f6172bd
ec5df917f1127aa1e8279c84d777964fffd889b2
refs/heads/master
2023-03-19T22:01:30.291233
2021-03-17T12:15:49
2021-03-17T12:15:49
302,204,441
4
0
null
null
null
null
UTF-8
Java
false
false
1,019
java
package DataStructure.Tree.Recursion.BinaryTreeMaximumPathSum_124; class TreeNode { int val; TreeNode left; TreeNode right; TreeNode(int val){ this.val = val; this.left = null; this.right = null; } } public class Solution { int max = Integer.MIN_VALUE; public int maxPathSum(TreeNode root) { getMain(root); return max; } public int getMain(TreeNode root){ if(root == null){ return 0; } int left = Math.max(getMain(root.left),0); // 左节点的最大贡献值(若最大贡献值小于0,则取0) int right = Math.max(getMain(root.right),0); // 右节点的最大贡献值(若最大贡献值小于0,则取0) int tmpPathMax = root.val + left + right; // 包含当前root节点(以root为根)的最大路径和 if(tmpPathMax > max){ max = tmpPathMax; } // 返回当期root节点的最大贡献值 return root.val + Math.max(left,right); } }
[ "17745109091@163.com" ]
17745109091@163.com
19c2ac87ed8ade1a3f8bba628a3138a6093f81da
096e862f59cf0d2acf0ce05578f913a148cc653d
/code/apps/Gallery2/src/com/android/gallery3d/data/MediaSource.java
a8a966fae95bbf90da949963bb34fee23941e468
[]
no_license
Phenix-Collection/Android-6.0-packages
e2ba7f7950c5df258c86032f8fbdff42d2dfc26a
ac1a67c36f90013ac1de82309f84bd215d5fdca9
refs/heads/master
2021-10-10T20:52:24.087442
2017-05-27T05:52:42
2017-05-27T05:52:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,881
java
/* * Copyright (C) 2010 The Android Open Source Project * * 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.android.gallery3d.data; import android.net.Uri; import com.android.gallery3d.data.MediaSet.ItemConsumer; import java.util.ArrayList; public abstract class MediaSource { private static final String TAG = "MediaSource"; private String mPrefix; protected MediaSource(String prefix) { mPrefix = prefix; } public String getPrefix() { return mPrefix; } public Path findPathByUri(Uri uri, String type) { return null; } public abstract MediaObject createMediaObject(Path path); public void pause() { } public void resume() { } /**SPRD:473267 M porting add video entrance & related bug-fix Modify 20150106 of bug 390428,video miss after crop @{ */ public Path getDefaultSetOf(boolean flag,Path item) { /**@}*/ return null; } public long getTotalUsedCacheSize() { return 0; } public long getTotalTargetCacheSize() { return 0; } public static class PathId { public PathId(Path path, int id) { this.path = path; this.id = id; } public Path path; public int id; } // Maps a list of Paths (all belong to this MediaSource) to MediaItems, // and invoke consumer.consume() for each MediaItem with the given id. // // This default implementation uses getMediaObject for each Path. Subclasses // may override this and provide more efficient implementation (like // batching the database query). public void mapMediaItems(ArrayList<PathId> list, ItemConsumer consumer) { int n = list.size(); for (int i = 0; i < n; i++) { PathId pid = list.get(i); MediaObject obj; synchronized (DataManager.LOCK) { obj = pid.path.getObject(); if (obj == null) { try { obj = createMediaObject(pid.path); } catch (Throwable th) { Log.w(TAG, "cannot create media object: " + pid.path, th); } } } if (obj != null) { consumer.consume(pid.id, (MediaItem) obj); } } } }
[ "wangjicong6403660@126.com" ]
wangjicong6403660@126.com
bda2f2b8a35a0905d2789df45370eecd00ae19ac
dfda9a782091598f54a4f8c45d7c7fdf29708fd2
/api/src/main/java/net/automatalib/exception/UndefinedPropertyAccessException.java
aec755db7d447b5bf6d26d1caeea6928fbd129fd
[ "LicenseRef-scancode-free-unknown", "Apache-2.0" ]
permissive
mmuesly/automatalib
0526e65b261fe0c089a7dcb7e9659fced657f792
5496709e61e4218061ebd00e8060a9e6486047bf
refs/heads/develop
2021-04-06T10:46:06.374266
2019-10-13T16:38:06
2019-10-13T16:38:06
124,900,999
0
0
Apache-2.0
2018-03-12T14:23:37
2018-03-12T14:23:34
null
UTF-8
Java
false
false
1,386
java
/* Copyright (C) 2013-2019 TU Dortmund * This file is part of AutomataLib, http://www.automatalib.net/. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package net.automatalib.exception; /** * This specialized exception can be thrown if during the traversal of an automaton or transition system an undefined * property (e.g. a state or a transition output) is accessed, that is otherwise required for returning a valid result. * * @author frohme */ public class UndefinedPropertyAccessException extends IllegalStateException { public UndefinedPropertyAccessException() {} public UndefinedPropertyAccessException(String var1) { super(var1); } public UndefinedPropertyAccessException(String var1, Throwable var2) { super(var1, var2); } public UndefinedPropertyAccessException(Throwable var1) { super(var1); } }
[ "markus.frohme@udo.edu" ]
markus.frohme@udo.edu
e72cf2b1928f2c9d62d59733b88f442bce95bd87
9d6abec649d6b7b84ea6d2c4b9568593c8edd459
/app/src/main/java/com/crazyhitty/chdev/ks/firebasechat/core/chat/ChatPresenter.java
03303fabdade97b86170935108b1926356f2d07f
[ "MIT" ]
permissive
mjniuz/FireChat-Demo
9b42c650171d4320ff74cc963347428a93075454
c9c0ee95bdd2ce7f36bfa79ab37c111a68f9fab6
refs/heads/master
2021-01-18T16:13:16.822048
2017-03-31T14:58:42
2017-03-31T14:58:42
86,728,206
2
2
null
null
null
null
UTF-8
Java
false
false
1,428
java
package com.crazyhitty.chdev.ks.firebasechat.core.chat; import android.content.Context; import com.crazyhitty.chdev.ks.firebasechat.models.Chat; /** * Author: Kartik Sharma * Created on: 9/2/2016 , 10:05 PM * Project: FirebaseChat */ public class ChatPresenter implements ChatContract.Presenter, ChatContract.OnSendMessageListener, ChatContract.OnGetMessagesListener { private ChatContract.View mView; private ChatInteractor mChatInteractor; public ChatPresenter(ChatContract.View view) { this.mView = view; mChatInteractor = new ChatInteractor(this, this); } @Override public void sendMessage(Context context, Chat chat, String receiverFirebaseToken) { mChatInteractor.sendMessageToFirebaseUser(context, chat, receiverFirebaseToken); } @Override public void getMessage(String senderUid, String receiverUid) { mChatInteractor.getMessageFromFirebaseUser(senderUid, receiverUid); } @Override public void onSendMessageSuccess() { mView.onSendMessageSuccess(); } @Override public void onSendMessageFailure(String message) { mView.onSendMessageFailure(message); } @Override public void onGetMessagesSuccess(Chat chat) { mView.onGetMessagesSuccess(chat); } @Override public void onGetMessagesFailure(String message) { mView.onGetMessagesFailure(message); } }
[ "cr42yh17m4n@gmail.com" ]
cr42yh17m4n@gmail.com
e9fca52e203cd724f0b1b982e26d16a8a35dbc44
ea2aeb37ac80c9b3a4a8c85bdbf5cf05ab850b18
/src/org/jdna/bmt/web/client/ui/prefs/RefreshPanel.java
14437a142e90f64707424661897064c30c9c279d
[]
no_license
stuckless/sagetv-bmtweb
abc34133a6ffbfe4a92bf824753f5713e2d624f9
0d4567bd6491781f45ebd1ac5729537b48ef483c
refs/heads/master
2022-11-19T15:34:02.612161
2022-07-04T11:51:45
2022-07-04T11:51:45
63,011,570
0
1
null
2022-11-09T18:20:43
2016-07-10T17:56:01
Java
UTF-8
Java
false
false
1,884
java
package org.jdna.bmt.web.client.ui.prefs; import org.jdna.bmt.web.client.Application; import com.google.gwt.core.client.GWT; import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.uibinder.client.UiField; import com.google.gwt.uibinder.client.UiHandler; import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.VerticalPanel; import com.google.gwt.user.client.ui.Widget; public class RefreshPanel extends Composite { private final PreferencesServiceAsync preferencesService = GWT.create(PreferencesService.class); private static RefreshPanelUiBinder uiBinder = GWT.create(RefreshPanelUiBinder.class); interface RefreshPanelUiBinder extends UiBinder<Widget, RefreshPanel> { } @UiField VerticalPanel panel; public RefreshPanel() { initWidget(uiBinder.createAndBindUi(this)); } @UiHandler("refreshVFS") public void onRefreshVFS(ClickEvent evt) { reload(PreferencesService.REFRESH_VFS); } @UiHandler("refreshMenus") public void onRefreshMenus(ClickEvent evt) { reload(PreferencesService.REFRESH_MENUS); } @UiHandler("refreshMediaTitles") public void onRefreshMediaTitles(ClickEvent evt) { reload(PreferencesService.REFRESH_MEDIA_TITLES); } @UiHandler("refreshImageCache") public void onRefreshImageCache(ClickEvent evt) { reload(PreferencesService.REFRESH_IMAGE_CACHE); } private void reload(final String id) { preferencesService.refreshConfiguration(id, new AsyncCallback<Void>() { @Override public void onSuccess(Void result) { Application.fireNotification(Application.messages().configurationReloaded(id)); } @Override public void onFailure(Throwable caught) { Application.fireErrorEvent(Application.messages().configurationFailedToReload(id)); } }); } }
[ "sean.stuckless@gmail.com" ]
sean.stuckless@gmail.com
ffa04d9c161cf6173ebfbb831d5d3558297848dd
775e69ac8860a899156379a87f577c8329cc3022
/JazminServer/src/jazmin/server/im/IMMessageServerCommand.java
c2b9a90d673323c5973aecf704e1bd8f9a10faeb
[]
no_license
husttb/JazminServer
b5466c72712a077d83a1ec229dee770e86247a10
308cd0c0e1326c954f909c65759bd1579496402f
refs/heads/master
2021-01-18T02:59:04.825843
2015-05-25T15:57:26
2015-05-25T15:57:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,080
java
package jazmin.server.im; import java.util.Collections; import java.util.Date; import java.util.List; import jazmin.core.Jazmin; import jazmin.server.console.ascii.AsciiChart; import jazmin.server.console.ascii.FormPrinter; import jazmin.server.console.ascii.TablePrinter; import jazmin.server.console.ascii.TerminalWriter; import jazmin.server.console.builtin.ConsoleCommand; import jazmin.util.BeanUtil; import jazmin.util.DumpUtil; /** * * @author yama * 26 Dec, 2014 */ public class IMMessageServerCommand extends ConsoleCommand { private IMMessageServer messageServer; public IMMessageServerCommand() { super(); id="imsgsrv"; desc="message server ctrl command"; addOption("i",false,"show server information.",this::showServerInfo); addOption("srv",false,"show services.",this::showServices); addOption("s",false,"show all sessions.",this::showSessions); addOption("q",true,"session query sql.",null); addOption("sp",false,"show session plot.",this::showSessionPlot); addOption("channel",false,"show all channels.",this::showChannels); addOption("so",true,"show session info",this::showSessionInfo); addOption("kick",true,"kick session",this::kickSession); addOption("co",true,"show channel info",this::showChannelInfo); addOption("net",false,"show network stats.",this::showNetworkStats); // messageServer=Jazmin.getServer(IMMessageServer.class); } // @Override public void run() throws Exception{ if(messageServer==null){ err.println("can not find MessageServer."); return; } super.run(); } // private void showServerInfo(String args){ out.println(messageServer.info()); } // // private void showServices(String args){ TablePrinter tp=TablePrinter.create(out) .length(30,15,15,15) .headers("NAME","SYNCONSESSION","CONTINUATION","RESTRICTRATE"); List<IMServiceStub> services=messageServer.getServices(); Collections.sort(services); for(IMServiceStub s:services){ tp.print( "0x"+Integer.toHexString(s.serviceId), s.isSyncOnSessionService, s.isContinuationService, s.isRestrictRequestRate); }; } // // private void showSessionInfo(String args){ IMSession session=messageServer.getSessionByPrincipal(args); if(session==null){ err.println("can not find session:"+args); return; } FormPrinter fp=FormPrinter.create(out,20); fp.print("id",session.getId()); fp.print("principal",session.getPrincipal()); fp.print("userAgent",session.getUserAgent()); fp.print("remoteHostAddress",session.getRemoteHostAddress()); fp.print("remotePort",session.getRemotePort()); fp.print("lastAccessTime",formatDate(new Date(session.getLastAccessTime()))); fp.print("createTime",formatDate(session.getCreateTime())); fp.print("receiveMessageCount",session.getReceiveMessageCount()); fp.print("sentMessageCount",session.getSentMessageCount()); fp.print("channels",session.getChannels()); fp.print("userObject",DumpUtil.dump(session.getUserObject())); } // // private void kickSession(String args){ IMSession session=messageServer.getSessionByPrincipal(args); if(session==null){ err.println("can not find session:"+args); return; } session.kick("kick by jasmin console."); } // private void showSessions(String args){ TablePrinter tp=TablePrinter.create(out) .length(10,20,10,15,10,10,10,15,15,10) .headers("ID", "PRINCIPAL", "USERAGENT", "HOST", "PORT", "RECEIVE", "SENT", "LACC", "CRTIME", "SYNCFLAG"); List<IMSession> sessions=messageServer.getSessions(); // String querySql=cli.getOptionValue('q'); if(querySql!=null){ sessions=BeanUtil.query(sessions,querySql); } for(IMSession s:sessions){ tp.print( s.getId(), s.getPrincipal(), s.getUserAgent(), s.getRemoteHostAddress(), s.getRemotePort(), s.getReceiveMessageCount(), s.getSentMessageCount(), formatDate(new Date(s.getLastAccessTime())), formatDate(s.getCreateTime()), s.isProcessSyncService()); }; } // private void showChannels(String args){ TablePrinter tp=TablePrinter.create(out) .length(10,20,10) .headers("ID","AUTOREMOVESESSION","CREATETIME"); List<IMChannel> channels=messageServer.getChannels(); for(IMChannel s:channels){ tp.print( s.getId(), s.isAutoRemoveDisconnectedSession(), formatDate(new Date(s.getCreateTime()))); }; } private void showChannelInfo(String args){ IMChannel channel=messageServer.getChannel(args); if(channel==null){ err.println("can not find channel:"+args); return; } FormPrinter fp=FormPrinter.create(out,20); fp.print("id",channel.getId()); fp.print("autoRemoveDisconnectedSession",channel.isAutoRemoveDisconnectedSession()); fp.print("createTime",formatDate(new Date(channel.getCreateTime()))); fp.print("userObject",DumpUtil.dump(channel.getUserObject())); } // // private void showSessionPlot(String args)throws Exception{ TerminalWriter tw=new TerminalWriter(out); AsciiChart chart=new AsciiChart(160,80); while(stdin.available()==0){ tw.cls(); out.println("press any key to quit."); out.println("current session count:"+messageServer.getSessionCount()); chart.addValue(messageServer.getSessionCount()); chart.reset(); tw.fmagenta(); out.println(chart.draw()); tw.reset(); out.flush(); Thread.sleep(1000); } stdin.read(); } // private void showNetworkStats(String args)throws Exception{ TerminalWriter tw=new TerminalWriter(out); lastInBoundBytes=messageServer.getInBoundBytes(); lastOutBoundBytes=messageServer.getOutBoundBytes(); while(stdin.available()==0){ tw.cls(); out.println("press any key to quit."); showNetworkStats0(); out.flush(); Thread.sleep(1000); } stdin.read(); } // private long lastInBoundBytes=0; private long lastOutBoundBytes=0; // private void showNetworkStats0(){ long inBoundBytes=messageServer.getInBoundBytes(); long outBoundBytes=messageServer.getOutBoundBytes(); String format="%-10s %-30s %-10s %-10s\n"; out.printf(format, "TYPE", "DATE", "IN", "OUT"); long ii=inBoundBytes-lastInBoundBytes; long oo=outBoundBytes-lastOutBoundBytes; out.printf(format, "RATE/S", formatDate(new Date()), DumpUtil.byteCountToString(ii), DumpUtil.byteCountToString(oo)); lastInBoundBytes=inBoundBytes; lastOutBoundBytes=outBoundBytes; // ii=inBoundBytes; oo=outBoundBytes; out.printf(format, "TOTAL", formatDate(new Date()), DumpUtil.byteCountToString(ii), DumpUtil.byteCountToString(oo)); } }
[ "guooscar@gmail.com" ]
guooscar@gmail.com
a3509eb03d8fb8f2418a8547f08688c101b8a248
c2fb6846d5b932928854cfd194d95c79c723f04c
/java_backup/my java/sanjana_cms/sanjana_cms/r.java
14e0f6f054264944b0d809e6e8edffecbb2719cd
[ "MIT" ]
permissive
Jimut123/code-backup
ef90ccec9fb6483bb6dae0aa6a1f1cc2b8802d59
8d4c16b9e960d352a7775786ea60290b29b30143
refs/heads/master
2022-12-07T04:10:59.604922
2021-04-28T10:22:19
2021-04-28T10:22:19
156,666,404
9
5
MIT
2022-12-02T20:27:22
2018-11-08T07:22:48
Jupyter Notebook
UTF-8
Java
false
false
301
java
package sanjana_cms; import java.io.*; class string2 { public static void main ()throws IOException { String S; int i; BufferedReader br=new BufferedReader (new InputStreamReader (System.in)); System.out.println("Enter a String"); S=br.readline(); j=S.length()-1; for(i=0; i<S.length()/2;s
[ "jimutbahanpal@yahoo.com" ]
jimutbahanpal@yahoo.com
9b98296231ba8737b344e2c98c8393d8ddc82230
937c455c9ebef35feb0046ea568e7402d1d8f833
/Source/org/xianwu/core/mvc/xstruts/chain/commands/AbstractValidateActionForm.java
ac775ab85fca13fcc3fc9153a58f1316d6a89d8f
[]
no_license
743234238wubo/ipv6
42cf9e73c7114b0b9ec2b3353069e3f2edff5c1a
9366a6155a502ec2d0fad67d9f9a17e451f4a895
refs/heads/master
2020-09-18T14:08:17.373756
2019-12-24T03:20:36
2019-12-24T03:20:36
224,151,450
0
0
null
null
null
null
UTF-8
Java
false
false
4,368
java
package org.xianwu.core.mvc.xstruts.chain.commands; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.xianwu.core.mvc.xstruts.action.ActionErrors; import org.xianwu.core.mvc.xstruts.action.ActionForm; import org.xianwu.core.mvc.xstruts.action.InvalidCancelException; import org.xianwu.core.mvc.xstruts.chain.contexts.ActionContext; import org.xianwu.core.mvc.xstruts.config.ActionConfig; /** * <p> * Validate the properties of the form bean for this request. If there are any * validation errors, execute the specified command; otherwise, proceed * normally. * </p> * * @version $Rev: 421119 $ $Date: 2005-06-04 10:58:46 -0400 (Sat, 04 Jun 2005) $ */ public abstract class AbstractValidateActionForm extends ActionCommandBase { // ------------------------------------------------------ Instance Variables /** * <p> * Provide Commons Logging instance for this class. * </p> */ private static final Log LOG = LogFactory.getLog(AbstractSelectForward.class); // ------------------------------------------------------ Protected Methods /** * <p> * Helper method to verify the Cancel state. * </p> * * <p> * If the state is invalid, Cancel is unset and an InvalidCancelException is * thrown. * </p> * * @param actionCtx * Our ActionContext * @param actionConfig * Our ActionConfig * @return true if cancel is set, false otherwise. * @throws InvalidCancelException */ private boolean isCancelled(ActionContext actionCtx, ActionConfig actionConfig) throws InvalidCancelException { Boolean cancel = actionCtx.getCancelled(); boolean cancelled = ((cancel != null) && cancel.booleanValue()); boolean cancellable = actionConfig.getCancellable(); boolean invalidState = (cancelled && !cancellable); if (invalidState) { actionCtx.setCancelled(Boolean.FALSE); actionCtx.setFormValid(Boolean.FALSE); throw new InvalidCancelException(); } return cancelled; } // ---------------------------------------------------------- Public Methods /** * <p> * Validate the properties of the form bean for this request. If there are * any validation errors, execute the child commands in our chain; * otherwise, proceed normally. * </p> * * @param actionCtx * The <code>Context</code> for the current request * @return <code>false</code> so that processing continues, if there are no * validation errors; otherwise <code>true</code> * @throws Exception * if thrown by the Action class */ public boolean execute(ActionContext actionCtx) throws Exception { // Set form valid until found otherwise actionCtx.setFormValid(Boolean.TRUE); // Is there a form bean for this request? ActionForm actionForm = actionCtx.getActionForm(); if (actionForm == null) { return false; } // Is validation disabled on this request? ActionConfig actionConfig = actionCtx.getActionConfig(); if (!actionConfig.getValidate()) { return false; } // Was this request cancelled? if (isCancelled(actionCtx, actionConfig)) { if (LOG.isDebugEnabled()) { LOG.debug(" Cancelled transaction, skipping validation"); } return false; } // Call the validate() method of this form bean ActionErrors errors = validate(actionCtx, actionConfig, actionForm); // If there were no errors, proceed normally if ((errors == null) || (errors.isEmpty())) { return false; } // Flag the validation failure and proceed /* * NOTE: Is there any concern that there might have already been errors, * or that other errors might be coming? */ actionCtx.saveErrors(errors); actionCtx.setFormValid(Boolean.FALSE); return false; } // ------------------------------------------------------- Protected Methods /** * <p> * Call the <code>validate()</code> method of the specified form bean, and * return the resulting <code>ActionErrors</code> object. * </p> * * @param context * The context for this request * @param actionConfig * The <code>ActionConfig</code> for this request * @param actionForm * The form bean for this request * @return ActionErrors object, if any */ protected abstract ActionErrors validate(ActionContext context, ActionConfig actionConfig, ActionForm actionForm); }
[ "52743445+Bouchee@users.noreply.github.com" ]
52743445+Bouchee@users.noreply.github.com
53d11b8b1d7ed8449ed80d0e8a42f2adf56b999d
1a3252aef9917251ad3b87455d25f1e9529176b8
/Mom/src/com/xiaoaitouch/mom/train/model/Constraint.java
7220b1be29fee8af0eb1e5df25a948709cc3d651
[]
no_license
notigit/Mom
a0a2869729aafd551063965e2fde27364050a52c
132e145ec6c900f877f4f2f64793da990d649806
refs/heads/master
2021-01-20T19:19:18.173365
2016-06-20T03:41:00
2016-06-20T03:41:00
61,514,271
1
0
null
null
null
null
UTF-8
Java
false
false
264
java
package com.xiaoaitouch.mom.train.model; /** * 约束条件 * * @author LG * */ public class Constraint { public static final int OVER_LITLE_LEVEL = 1; public static final int OVER_MID_LEVEL = 2; public static final int OVER_LARGE_LEVEL = 3; }
[ "1026452140@qq.com" ]
1026452140@qq.com
e94b1067c8816e9dc31fab510300a4aa35bc62d5
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
/data_defect4j/preprossed_method_corpus/Chart/5/org/jfree/data/time/ohlc/OHLCSeriesCollection_getSeries_140.java
4ae5fa35eeb18df9a2738f8a54806dcb195db2c8
[]
no_license
hvdthong/NetML
dca6cf4d34c5799b400d718e0a6cd2e0b167297d
9bb103da21327912e5a29cbf9be9ff4d058731a5
refs/heads/master
2021-06-30T15:03:52.618255
2020-10-07T01:58:48
2020-10-07T01:58:48
150,383,588
1
1
null
2018-09-26T07:08:45
2018-09-26T07:08:44
null
UTF-8
Java
false
false
871
java
org jfree data time ohlc collect link ohlc seri ohlcseri object ohlc seri ohlcseri ohlc seri collect ohlcseriescollect abstract dataset abstractxydataset return seri collect param seri seri index base seri illeg argument except illegalargumentexcept code seri code rang code code code seri count getseriescount code ohlc seri ohlcseri seri getseri seri seri seri seri count getseriescount illeg argument except illegalargumentexcept seri index bound ohlc seri ohlcseri data seri
[ "hvdthong@gmail.com" ]
hvdthong@gmail.com
6e70eb1aeefc71b9aaeb2ce42ddcb2e0459e128c
d1a6d1e511df6db8d8dd0912526e3875c7e1797d
/genny_JavaWithoutLambdasApi21/applicationModule/src/main/java/applicationModulepackageJava19/Foo501.java
eb4f12afb9846f6ebb0771d23655e8fa888005db
[]
no_license
NikitaKozlov/generated-project-for-desugaring
0bc1443ab3ddc84cd289331c726761585766aea7
81506b3711004185070ca4bb9a93482b70011d36
refs/heads/master
2020-03-20T00:35:06.996525
2018-06-12T09:30:37
2018-06-12T09:30:37
137,049,317
0
0
null
null
null
null
UTF-8
Java
false
false
348
java
package applicationModulepackageJava19; public class Foo501 { public void foo0() { new applicationModulepackageJava19.Foo500().foo5(); } public void foo1() { foo0(); } public void foo2() { foo1(); } public void foo3() { foo2(); } public void foo4() { foo3(); } public void foo5() { foo4(); } }
[ "nikita.e.kozlov@gmail.com" ]
nikita.e.kozlov@gmail.com
baf76d4bbf63ce90bc0a76148dd3e52820978598
49fe3d43ab90b4e241795f4c3f43bb53f4cb0e32
/src/com/company/Lesson39/Test03.java
391f401356d601fa1df686f9e0c3bdc7fc719fae
[]
no_license
aierko/dev
a0e8a6b8ceaa61f6842cf02a4443fcc9ea6a3cf7
ea52685dd0a70e4bd578369cf417f6c6a2f7a5c9
refs/heads/master
2021-09-03T10:08:45.436562
2017-10-20T12:53:43
2017-10-20T12:53:43
106,323,994
0
0
null
null
null
null
UTF-8
Java
false
false
1,773
java
package com.company.Lesson39; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; /** * Created by user on 19.12.2016. *//* Новая задача: Программа вводит строки, пока пользователь не введёт пустую строку (нажав enter). Потом программа строит новый список. Если в строке чётное число букв, строка удваивается, если нечётное – утраивается. Программа выводит содержимое нового списка на экран. Пример ввода: Кот Коты Я Пример вывода: Кот Кот Кот Коты Коты Я Я Я */ public class Test03 { public static void main(String[] args) throws IOException { List<String> list = new ArrayList<>(); BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); while (true) { String a = reader.readLine(); if (a.isEmpty()) { break; } else list.add(a); } List<String> list1 = fix(list); System.out.println(list1); } public static List<String> fix(List<String> list1) { List<String> arr1 = new ArrayList<>(); for (int i = 0; i < list1.size(); i++) { if (list1.get(i).length() % 2 == 0) { arr1.add(list1.get(i)); arr1.add(list1.get(i)); } else { arr1.add(list1.get(i)); arr1.add(list1.get(i)); arr1.add(list1.get(i)); } } return arr1; } }
[ "vtldtl80" ]
vtldtl80
8d27d29764201d1f0480a5b4d75a99363f458ead
faa7259c3ca748fe1fdb61c2b028bf0031ed8df5
/src/main/java/com/example/template/OrderRepository.java
e533159092d3a34f1cb33719195688c59a590a45
[]
no_license
acmexii/orders
5ebcb330649c8e40457a3a7595e8bcbf730d99d6
743eff810bd79d542e95c5c9d54b14d032fbcaab
refs/heads/master
2021-09-24T05:05:32.362433
2021-09-14T07:19:00
2021-09-14T07:19:00
256,108,596
0
1
null
2020-04-16T04:25:45
2020-04-16T04:25:45
null
UTF-8
Java
false
false
267
java
package com.example.template; import org.springframework.data.repository.PagingAndSortingRepository; import java.util.List; public interface OrderRepository extends PagingAndSortingRepository<Order, Long> { List<Order> findByCustomerId(String customerId); }
[ "sanaloveyou@uengine.org" ]
sanaloveyou@uengine.org
f493e5f3b5322c12a6be191b883f82bfc059fae0
2fa08e34219848fa5cfff3ec6d1ebdbb57b70a83
/.svn/pristine/4c/4c1c6c24cccb3e31ee182be9464ae23e3a985748.svn-base
5d906ea69b5bf6948d50f7525cf44443ee4fb9d9
[]
no_license
SuperZhouyong/spring-boot-mybatis-
fc879053009b4da9a1b2bdcc624b73ebdc7c9d78
ba86ec1d60602a8de68186af262bab2d4b34f2bc
refs/heads/master
2020-03-19T11:22:20.197755
2018-06-15T06:48:14
2018-06-15T06:48:14
136,450,933
1
0
null
null
null
null
UTF-8
Java
false
false
2,055
package com.resumed.sqtwin.utils; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; /** * @auther Super * @data 2018/4/11 0011 * @time 下午 16:59 */ public class DataUtil { public static final ThreadLocal<DateFormat> df = new ThreadLocal<DateFormat>() { @Override protected DateFormat initialValue() { return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); } }; public static final ThreadLocal<DateFormat> dfDate = new ThreadLocal<DateFormat>() { @Override protected DateFormat initialValue() { return new SimpleDateFormat("yyyy-MM-dd"); } }; public static final ThreadLocal<DateFormat> dfDateYear = new ThreadLocal<DateFormat>() { @Override protected DateFormat initialValue() { return new SimpleDateFormat("yyyy"); } }; public static String getTimestamp() { DateFormat dateFormat = df.get(); if (dateFormat == null) { dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); df.set(dateFormat); } return dateFormat.format(new Date()); } public static String getTimeDta() { DateFormat dateFormat = dfDate.get(); if (dateFormat == null) { dateFormat = new SimpleDateFormat("yyyy-MM-dd"); dfDate.set(dateFormat); } return dateFormat.format(new Date()); } public static String getTimeDtaParsetoString(Date date) { DateFormat dateFormat = dfDate.get(); if (dateFormat == null) { dateFormat = new SimpleDateFormat("yyyy-MM-dd"); dfDate.set(dateFormat); } return dateFormat.format(date); } public static String getTimestampParsetoString(Date date) { DateFormat dateFormat = df.get(); if (dateFormat == null) { dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); df.set(dateFormat); } return dateFormat.format(date); } }
[ "z_zhouyong@163.com" ]
z_zhouyong@163.com
6d3c3084c95a28d45b0f258535ac5a7643f6d59c
2ec826874246a635527848c4cae2264fa5688e57
/store/sdk/src/test/java/org/apache/carbondata/sdk/file/ConcurrentSdkWriterTest.java
9bb3f29041bf13e64af55831285d3c7e4362c38c
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference", "BSD-2-Clause" ]
permissive
budye/carbondata
775f1b2b09deed023d358e2f6619a19e58b2477a
b54512d1c15026268b85e0ab5ae46699cf8d7082
refs/heads/master
2020-03-29T01:19:44.597324
2018-09-17T16:27:57
2018-09-19T02:39:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,464
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.carbondata.sdk.file; import java.io.File; import java.io.IOException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import org.apache.carbondata.core.metadata.datatype.DataTypes; import org.apache.commons.io.FileUtils; import org.apache.hadoop.conf.Configuration; import org.junit.Assert; import org.junit.Test; /** * multi-thread Test suite for {@link CSVCarbonWriter} */ public class ConcurrentSdkWriterTest { private static final int recordsPerItr = 10; private static final short numOfThreads = 4; @Test public void testWriteFiles() throws IOException { String path = "./testWriteFiles"; FileUtils.deleteDirectory(new File(path)); Field[] fields = new Field[2]; fields[0] = new Field("name", DataTypes.STRING); fields[1] = new Field("age", DataTypes.INT); ExecutorService executorService = Executors.newFixedThreadPool(numOfThreads); try { CarbonWriterBuilder builder = CarbonWriter.builder() .outputPath(path); CarbonWriter writer = builder.buildThreadSafeWriterForCSVInput(new Schema(fields), numOfThreads, TestUtil.configuration); // write in multi-thread for (int i = 0; i < numOfThreads; i++) { executorService.submit(new WriteLogic(writer)); } executorService.shutdown(); executorService.awaitTermination(2, TimeUnit.HOURS); writer.close(); } catch (Exception e) { e.printStackTrace(); Assert.fail(e.getMessage()); } // read the files and verify the count CarbonReader reader; try { reader = CarbonReader .builder(path, "_temp") .projection(new String[]{"name", "age"}) .build(new Configuration(false)); int i = 0; while (reader.hasNext()) { Object[] row = (Object[]) reader.readNextRow(); i++; } Assert.assertEquals(i, numOfThreads * recordsPerItr); reader.close(); } catch (InterruptedException e) { e.printStackTrace(); Assert.fail(e.getMessage()); } FileUtils.deleteDirectory(new File(path)); } class WriteLogic implements Runnable { CarbonWriter writer; WriteLogic(CarbonWriter writer) { this.writer = writer; } @Override public void run() { try { for (int i = 0; i < recordsPerItr; i++) { writer.write(new String[] { "robot" + (i % 10), String.valueOf(i), String.valueOf((double) i / 2) }); } } catch (IOException e) { e.printStackTrace(); Assert.fail(e.getMessage()); } } } }
[ "ravi.pesala@gmail.com" ]
ravi.pesala@gmail.com
b2dcd267dcb6aad65e426e04f0c4450a048393e4
124df74bce796598d224c4380c60c8e95756f761
/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/internal/GFETopoManager.java
d96e0ed72045e52ba332c9198f3484ee8a31ea63
[]
no_license
Mapoet/AWIPS-Test
19059bbd401573950995c8cc442ddd45588e6c9f
43c5a7cc360b3cbec2ae94cb58594fe247253621
refs/heads/master
2020-04-17T03:35:57.762513
2017-02-06T17:17:58
2017-02-06T17:17:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,019
java
/** * This software was developed and / or modified by Raytheon Company, * pursuant to Contract DG133W-05-CQ-1067 with the US Government. * * U.S. EXPORT CONTROLLED TECHNICAL DATA * This software product contains export-restricted data whose * export/transfer/disclosure is restricted by U.S. law. Dissemination * to non-U.S. persons whether in the United States or abroad requires * an export license or other authorization. * * Contractor Name: Raytheon Company * Contractor Address: 6825 Pine Street, Suite 340 * Mail Stop B8 * Omaha, NE 68106 * 402.291.0100 * * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ package com.raytheon.viz.gfe.core.internal; import com.raytheon.uf.common.dataplugin.gfe.db.objects.DatabaseID; import com.raytheon.uf.common.dataplugin.gfe.db.objects.DatabaseID.DataType; import com.raytheon.uf.common.dataplugin.gfe.db.objects.GridLocation; import com.raytheon.uf.common.dataplugin.gfe.db.objects.ParmID; import com.raytheon.uf.common.dataplugin.gfe.server.message.ServerResponse; import com.raytheon.uf.common.dataplugin.gfe.slice.ScalarGridSlice; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.viz.gfe.GFEServerException; import com.raytheon.viz.gfe.core.DataManager; import com.raytheon.viz.gfe.core.ITopoManager; /** * GFETopoMgr manages the set of topography data sets available from the * ifpServer. * * All parms now use the same topo data, since the assumption is that all parms * in a database have the same exact GridLocation. * * <pre> * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Jul 2, 2008 #1160 randerso Initial creation * Nov 20, 2013 #2331 randerso Re-implemented to better match A1 design * * </pre> * * @author randerso * @version 1.0 */ public class GFETopoManager implements ITopoManager { private static final transient IUFStatusHandler statusHandler = UFStatus .getHandler(GFETopoManager.class); private DataManager dataManager; private ScalarGridSlice compositeTopo; private ParmID compositeParmID; /** * Constructor taking a pointer to the DataManager * * @param dataManager */ public GFETopoManager(DataManager dataManager) { this.dataManager = dataManager; // hard coding this here to match what is done in TopoDatabaseManager // this avoids retrieving the topo data just to get the parm ID. DatabaseID did = new DatabaseID("Topo", DataType.GRID, "Topo", "Topo"); this.compositeParmID = new ParmID("Topo", did); } /* * (non-Javadoc) * * @see com.raytheon.viz.gfe.core.ITopoManager#getCompositeTopo() */ @Override public synchronized ScalarGridSlice getCompositeTopo() { if (compositeTopo == null) { GridLocation gloc = dataManager.getParmManager() .compositeGridLocation(); try { ServerResponse<ScalarGridSlice> sr = this.dataManager .getClient().getTopoData(gloc); if (!sr.isOkay()) { statusHandler .error("Error getting topography data from IFPServer: " + sr.message()); } compositeTopo = sr.getPayload(); } catch (GFEServerException e) { statusHandler.error( "Error getting topography data from IFPServer: ", e); } } return compositeTopo; } /* * (non-Javadoc) * * @see com.raytheon.viz.gfe.core.ITopoManager#getCompositeParmID() */ @Override public ParmID getCompositeParmID() { return this.compositeParmID; } }
[ "joshua.t.love@saic.com" ]
joshua.t.love@saic.com
2d15b3f57515320e032b7bdf95053e9a0f994edd
5193df90cb901752fdcb0c90623465d2895d9e2d
/no.hal.gridgame/model.tests/src/no/hal/gridgame/model/tests/GameCommandTest.java
7ea787a5e191e95cc6e943d7413f6a47d76f5b93
[]
no_license
hallvard/tdt4250
de056c4d0019ce69ad458775e4b04f7733ef20a7
e2a685d956f2ed9f044a4d303e5c58d9da7cef29
refs/heads/master
2020-03-27T22:47:21.213572
2018-09-10T19:55:12
2018-09-10T19:55:12
38,511,355
3
2
null
null
null
null
UTF-8
Java
false
false
3,471
java
/** */ package no.hal.gridgame.model.tests; import junit.framework.TestCase; import no.hal.gridgame.model.GameCommand; /** * <!-- begin-user-doc --> * A test case for the model object '<em><b>Game Command</b></em>'. * <!-- end-user-doc --> * <p> * The following operations are tested: * <ul> * <li>{@link no.hal.gridgame.model.GameCommand#prepare() <em>Prepare</em>}</li> * <li>{@link no.hal.gridgame.model.GameCommand#perform() <em>Perform</em>}</li> * <li>{@link no.hal.gridgame.model.GameCommand#undo() <em>Undo</em>}</li> * <li>{@link no.hal.gridgame.model.GameCommand#redo() <em>Redo</em>}</li> * <li>{@link no.hal.gridgame.model.GridListener#gridChanged(no.hal.gridgame.model.Grid, int, int, int, int) <em>Grid Changed</em>}</li> * </ul> * </p> * @generated */ public abstract class GameCommandTest extends TestCase { /** * The fixture for this Game Command test case. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected GameCommand fixture = null; /** * Constructs a new Game Command test case with the given name. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public GameCommandTest(String name) { super(name); } /** * Sets the fixture for this Game Command test case. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void setFixture(GameCommand fixture) { this.fixture = fixture; } /** * Returns the fixture for this Game Command test case. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected GameCommand getFixture() { return fixture; } /** * Tests the '{@link no.hal.gridgame.model.GameCommand#prepare() <em>Prepare</em>}' operation. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see no.hal.gridgame.model.GameCommand#prepare() * @generated NOT */ public void testPrepare() { // Ensure that you remove @generated or mark it @generated NOT // fail(); } /** * Tests the '{@link no.hal.gridgame.model.GameCommand#perform() <em>Perform</em>}' operation. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see no.hal.gridgame.model.GameCommand#perform() * @generated NOT */ public void testPerform() { // Ensure that you remove @generated or mark it @generated NOT // fail(); } /** * Tests the '{@link no.hal.gridgame.model.GameCommand#undo() <em>Undo</em>}' operation. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see no.hal.gridgame.model.GameCommand#undo() * @generated NOT */ public void testUndo() { // Ensure that you remove @generated or mark it @generated NOT // fail(); } /** * Tests the '{@link no.hal.gridgame.model.GameCommand#redo() <em>Redo</em>}' operation. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see no.hal.gridgame.model.GameCommand#redo() * @generated NOT */ public void testRedo() { // Ensure that you remove @generated or mark it @generated NOT // fail(); } /** * Tests the '{@link no.hal.gridgame.model.GridListener#gridChanged(no.hal.gridgame.model.Grid, int, int, int, int) <em>Grid Changed</em>}' operation. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see no.hal.gridgame.model.GridListener#gridChanged(no.hal.gridgame.model.Grid, int, int, int, int) * @generated NOT */ public void testGridChanged__Grid_int_int_int_int() { // Ensure that you remove @generated or mark it @generated NOT // fail(); } } //GameCommandTest
[ "hal@idi.ntnu.no" ]
hal@idi.ntnu.no
52a2dbdd48efe5b5b8e22d1a2ccc7448794687e4
8d927867a91d9aed7a101151b33ae6cd1d23f251
/src/main/java/uk/me/uohiro/gof/iterator/Iterator.java
b0c5da6724786999dc47359ced8d7a06962e1c0e
[]
no_license
osakanaya/gof-design-patterns-example
3866e2de4f51c62c0dae0173b47d1cf97e472102
ea0064b7e4b6599ca1dd289ae9cc8ab6895f600c
refs/heads/master
2022-12-17T19:46:04.561585
2020-09-17T04:54:05
2020-09-17T04:54:05
296,222,957
0
0
null
null
null
null
UTF-8
Java
false
false
132
java
package uk.me.uohiro.gof.iterator; public interface Iterator<T> { public abstract boolean hasNext(); public abstract T next(); }
[ "sashida@primagest.co.jp" ]
sashida@primagest.co.jp
a6cf510c6ca30beba7f47712da9327dac3fd66ba
607224e023e4bf33a2be619262e1d8b55c2a3e08
/jars/worldwind/src/gov/nasa/worldwind/applications/gio/catalogui/QueryModel.java
027d34cb3ec9f53c7ed29d6b810449f5fc52f3a8
[]
no_license
haldean/droidcopter
54511d836762f41b23670447f79e7457d67a216d
2a25c5eade55e68037001fbfdba3b0f975c70e25
refs/heads/master
2020-05-16T22:18:53.581797
2013-01-27T03:58:24
2013-01-27T03:58:24
755,362
3
1
null
null
null
null
UTF-8
Java
false
false
410
java
/* Copyright (C) 2001, 2008 United States Government as represented by the Administrator of the National Aeronautics and Space Administration. All Rights Reserved. */ package gov.nasa.worldwind.applications.gio.catalogui; import gov.nasa.worldwind.avlist.AVList; /** * @author dcollins * @version $Id: QueryModel.java 5517 2008-07-15 23:36:34Z dcollins $ */ public interface QueryModel extends AVList { }
[ "will.h.brown@gmail.com" ]
will.h.brown@gmail.com
16cf2cac48cffc01bc9db8a52e8ce864176f6c50
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/13/13_09f958f35e5603697499cd9e937b3662862fb6c9/SomeContentList/13_09f958f35e5603697499cd9e937b3662862fb6c9_SomeContentList_t.java
bb12a6207320e036828895db6f84bd7879c6755c
[]
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,863
java
package jimmui.view.base; import jimm.Jimm; import jimmui.view.UIBuilder; import jimmui.view.base.touch.*; import jimmui.view.menu.MenuModel; /** * Created with IntelliJ IDEA. * <p/> * Date: 21.07.13 19:36 * * @author vladimir */ public class SomeContentList extends CanvasEx { protected MyActionBar bar = new MyActionBar(); protected MySoftBar softBar = new MySoftBar(); private static MyScrollBar scrollBar = new MyScrollBar(); protected SomeContent content; public SomeContentList() { // #sijapp cond.if modules_ANDROID isnot "true"# bar.setCaption(null); softBar.setSoftBarLabels("menu", null, "back", false); setSize(Jimm.getJimm().getDisplay().getScreenWidth(), Jimm.getJimm().getDisplay().getScreenHeight()); // #sijapp cond.end# } public SomeContentList(String capt) { bar.setCaption(capt); softBar.setSoftBarLabels("menu", null, "back", false); setSize(Jimm.getJimm().getDisplay().getScreenWidth(), Jimm.getJimm().getDisplay().getScreenHeight()); } public SomeContentList(SomeContent content, String capt) { this.content = content; content.setView(this); bar.setCaption(capt); softBar.setSoftBarLabels("menu", null, "back", false); setSize(Jimm.getJimm().getDisplay().getScreenWidth(), Jimm.getJimm().getDisplay().getScreenHeight()); } @Override protected final void doJimmAction(int keyCode) { content.doJimmAction(keyCode); } public final int getContentHeight() { return getHeight() - bar.getHeight() - 1; } protected void sizeChanged(int prevW, int prevH, int w, int h) { boolean prev = prevH < prevW; boolean curr = h < w; if (prev != curr) { int delta = prevH - h; content.setTopByOffset(content.getTopOffset() + delta); } } // #sijapp cond.if modules_TOUCH is "true"# protected final void touchItemTaped(int item, int x, TouchState state) { content.touchItemTaped(item, x, state); } protected void stylusXMoved(TouchState state) { content.stylusXMoved(state); } protected final boolean touchItemPressed(int item, int x, int y) { return content.touchItemPressed(item, x, y); } protected final void stylusPressed(TouchState state) { if (getHeight() < state.y) { state.region = softBar; return; } if (state.y < bar.getHeight()) { state.region = bar; return; } touchUsed = true; touchPressed = true; int item = content.getItemByCoord(state.y - bar.getHeight()); if (0 <= item) { content.currItem = -1; state.prevTopY = content.getTopOffset(); touchItemPressed(item, state.x, state.y); state.isSecondTap = true; } } protected final void stylusGeneralYMoved(TouchState state) { int item = content.getItemByCoord(state.y - bar.getHeight()); if (0 <= item) { content.setTopByOffset(state.prevTopY + (state.fromY - state.y)); invalidate(); } } protected final void stylusTap(TouchState state) { int item = content.getItemByCoord(state.y - bar.getHeight()); if (0 <= item) { touchItemTaped(item, state.x, state); } } // #sijapp cond.end# protected final void doKeyReaction(int keyCode, int actionCode, int type) { if (content.doKeyReaction(keyCode, actionCode, type)) { return; } super.doKeyReaction(keyCode, actionCode, type); } protected int[] getScroll() { // scroll bar int[] scroll = MyScrollBar.makeVertScroll( (getWidth() - scrollerWidth), 0,//bar.getHeight(), scrollerWidth, getContentHeight() + 1, getContentHeight(), content.getFullSize()); if (null != scroll) { scroll[MyScrollBar.SCROLL_TOP_VALUE] = content.getTopOffset(); } return scroll; } protected void setScrollTop(int top) { content.setTopByOffset(top); invalidate(); } protected int getScrollTop() { return content.getTopOffset(); } @Override protected void paint(GraphicsEx g) { int bottom = getHeight(); boolean onlySoftBar = (bottom <= g.getClipY()); if (!onlySoftBar) { content.beforePaint(); int captionHeight = bar.getHeight(); g.getGraphics().translate(0, captionHeight); try { g.setClip(0, 0, getWidth(), bottom - captionHeight); content.paintContent(g, 0, getWidth(), bottom - captionHeight); } catch (Exception e) { // #sijapp cond.if modules_DEBUGLOG is "true" # jimm.modules.DebugLog.panic("content", e); // #sijapp cond.end # } g.getGraphics().translate(0, -captionHeight); g.setClip(0, captionHeight, getWidth(), getHeight()); g.drawPopup(this, captionHeight); bar.paint(g, this, getWidth()); } if (isSoftBarShown()) { softBar.paint(g, this, getHeight()); } } public final void showMenu(MenuModel m) { if ((null != m) && (0 < m.count())) { UIBuilder.createMenu(m).show(); } } public final SomeContent getContent() { return content; } protected void updateTask(long microTime) { content.updateTask(microTime); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
e3ca727fe14052bf803b704e1d3307d5d05f38fb
86505462601eae6007bef6c9f0f4eeb9fcdd1e7b
/bin/modules/core-accelerator/acceleratorcms/src/de/hybris/platform/acceleratorcms/evaluator/CMSActionRestrictionEvaluator.java
4805116ebcba6fd5ed3561a474a0bfc85e88496f
[]
no_license
jp-developer0/hybrisTrail
82165c5b91352332a3d471b3414faee47bdb6cee
a0208ffee7fee5b7f83dd982e372276492ae83d4
refs/heads/master
2020-12-03T19:53:58.652431
2020-01-02T18:02:34
2020-01-02T18:02:34
231,430,332
0
4
null
2020-08-05T22:46:23
2020-01-02T17:39:15
null
UTF-8
Java
false
false
2,449
java
/* * Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. */ package de.hybris.platform.acceleratorcms.evaluator; import de.hybris.platform.acceleratorcms.model.CMSActionTypeModel; import de.hybris.platform.acceleratorcms.model.restrictions.CMSActionRestrictionModel; import de.hybris.platform.cms2.common.annotations.HybrisDeprecation; import de.hybris.platform.cms2.model.CMSComponentTypeModel; import de.hybris.platform.cms2.model.contents.components.AbstractCMSComponentModel; import de.hybris.platform.cms2.servicelayer.data.RestrictionData; import de.hybris.platform.cms2.servicelayer.services.evaluator.CMSRestrictionEvaluator; import de.hybris.platform.servicelayer.type.TypeService; import java.util.Collection; import org.apache.log4j.Logger; import org.springframework.beans.factory.annotation.Required; /** * @deprecated since 1811 */ @Deprecated(since = "1811") @HybrisDeprecation(sinceVersion = "1811") public class CMSActionRestrictionEvaluator implements CMSRestrictionEvaluator<CMSActionRestrictionModel> { private static final Logger LOG = Logger.getLogger(CMSActionRestrictionEvaluator.class); private TypeService typeService; @Override public boolean evaluate(final CMSActionRestrictionModel restriction, final RestrictionData context) { final Object parentComponent = context.getValue("parentComponent"); final Object component = context.getValue("component"); if (parentComponent != null && component != null) { final String parentComponentType = ((AbstractCMSComponentModel) parentComponent).getItemtype(); final String actionType = ((AbstractCMSComponentModel) component).getItemtype(); final CMSComponentTypeModel componentTypeModel = (CMSComponentTypeModel) getTypeService().getComposedTypeForCode( parentComponentType); final Collection<CMSActionTypeModel> applicableActionTypes = componentTypeModel.getActionTypes(); for (final CMSActionTypeModel applicableAction : applicableActionTypes) { if (applicableAction.getCode().equals(actionType)) { return true; } } return false; } LOG.warn("parentComponent attribute was not passed in the cms:component tag restriction evaluation skipped for " + restriction.getItemtype()); return true; } protected TypeService getTypeService() { return typeService; } @Required public void setTypeService(final TypeService typeService) { this.typeService = typeService; } }
[ "juan.gonzalez.working@gmail.com" ]
juan.gonzalez.working@gmail.com
4153079b54f8c0f50c65844841982aca52fb671c
ba8a4393db073ea4d44705fcc360a6177a87b480
/src/main/java/com/tpg/pjs/validation/ValidPassword.java
965e78c9feca6928455afff7e78b46a0d7781c8e
[]
no_license
tpgoldie/pizzas
1b007876589c04341964224fab3977b728ac8059
9d4ecc944a6a08e78e87a42a98234bad01cc3e5b
refs/heads/master
2021-05-09T18:56:35.484156
2018-04-04T22:55:33
2018-04-04T22:55:33
119,177,722
0
0
null
null
null
null
UTF-8
Java
false
false
753
java
package com.tpg.pjs.validation; import javax.validation.Constraint; import javax.validation.Payload; import java.lang.annotation.Documented; import java.lang.annotation.Retention; import java.lang.annotation.Target; import static java.lang.annotation.ElementType.ANNOTATION_TYPE; import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.TYPE; import static java.lang.annotation.RetentionPolicy.RUNTIME; @Documented @Constraint(validatedBy = PasswordConstraintValidator.class) @Target({ TYPE, FIELD, ANNOTATION_TYPE }) @Retention(RUNTIME) @interface ValidPassword { String message() default "Invalid details"; Class<?>[] groups() default {}; Class<? extends Payload>[] payload() default {}; }
[ "tpg@blueyonder.co.uk" ]
tpg@blueyonder.co.uk
9e4d29402b6a780b3e628e982d1f0dd302d2eba3
4f9f8836e5bafeeb821961f41c0246a52ccbc601
/app/src/main/java/android/support/v7/widget/RoundRectDrawable.java
40a962caa14873bba434f2c6fbc698233000988a
[]
no_license
pyp163/BlueTooth
aeb7fd186b6d25baf4306dce9057b073402b991c
740e2ad00e3099d1297eee22c31570a8afc99f88
refs/heads/master
2021-01-09T12:03:25.376757
2020-02-22T06:58:49
2020-02-22T06:58:49
242,290,730
1
0
null
null
null
null
UTF-8
Java
false
false
5,439
java
package android.support.v7.widget; import android.content.res.ColorStateList; import android.graphics.Canvas; import android.graphics.ColorFilter; import android.graphics.Outline; import android.graphics.Paint; import android.graphics.PorterDuff.Mode; import android.graphics.PorterDuffColorFilter; import android.graphics.Rect; import android.graphics.RectF; import android.graphics.drawable.Drawable; import android.support.annotation.Nullable; import android.support.annotation.RequiresApi; @RequiresApi(21) class RoundRectDrawable extends Drawable { private ColorStateList mBackground; private final RectF mBoundsF; private final Rect mBoundsI; private boolean mInsetForPadding = false; private boolean mInsetForRadius = true; private float mPadding; private final Paint mPaint; private float mRadius; private ColorStateList mTint; private PorterDuffColorFilter mTintFilter; private PorterDuff.Mode mTintMode = PorterDuff.Mode.SRC_IN; RoundRectDrawable(ColorStateList paramColorStateList, float paramFloat) { this.mRadius = paramFloat; this.mPaint = new Paint(5); setBackground(paramColorStateList); this.mBoundsF = new RectF(); this.mBoundsI = new Rect(); } private PorterDuffColorFilter createTintFilter(ColorStateList paramColorStateList, PorterDuff.Mode paramMode) { if ((paramColorStateList != null) && (paramMode != null)) return new PorterDuffColorFilter(paramColorStateList.getColorForState(getState(), 0), paramMode); return null; } private void setBackground(ColorStateList paramColorStateList) { ColorStateList localColorStateList = paramColorStateList; if (paramColorStateList == null) localColorStateList = ColorStateList.valueOf(0); this.mBackground = localColorStateList; this.mPaint.setColor(this.mBackground.getColorForState(getState(), this.mBackground.getDefaultColor())); } private void updateBounds(Rect paramRect) { Rect localRect = paramRect; if (paramRect == null) localRect = getBounds(); this.mBoundsF.set(localRect.left, localRect.top, localRect.right, localRect.bottom); this.mBoundsI.set(localRect); if (this.mInsetForPadding) { float f1 = RoundRectDrawableWithShadow.calculateVerticalPadding(this.mPadding, this.mRadius, this.mInsetForRadius); float f2 = RoundRectDrawableWithShadow.calculateHorizontalPadding(this.mPadding, this.mRadius, this.mInsetForRadius); this.mBoundsI.inset((int)Math.ceil(f2), (int)Math.ceil(f1)); this.mBoundsF.set(this.mBoundsI); } } public void draw(Canvas paramCanvas) { Paint localPaint = this.mPaint; int i; if ((this.mTintFilter != null) && (localPaint.getColorFilter() == null)) { localPaint.setColorFilter(this.mTintFilter); i = 1; } else { i = 0; } paramCanvas.drawRoundRect(this.mBoundsF, this.mRadius, this.mRadius, localPaint); if (i != 0) localPaint.setColorFilter(null); } public ColorStateList getColor() { return this.mBackground; } public int getOpacity() { return -3; } public void getOutline(Outline paramOutline) { paramOutline.setRoundRect(this.mBoundsI, this.mRadius); } float getPadding() { return this.mPadding; } public float getRadius() { return this.mRadius; } public boolean isStateful() { return ((this.mTint != null) && (this.mTint.isStateful())) || ((this.mBackground != null) && (this.mBackground.isStateful())) || (super.isStateful()); } protected void onBoundsChange(Rect paramRect) { super.onBoundsChange(paramRect); updateBounds(paramRect); } protected boolean onStateChange(int[] paramArrayOfInt) { int i = this.mBackground.getColorForState(paramArrayOfInt, this.mBackground.getDefaultColor()); boolean bool; if (i != this.mPaint.getColor()) bool = true; else bool = false; if (bool) this.mPaint.setColor(i); if ((this.mTint != null) && (this.mTintMode != null)) { this.mTintFilter = createTintFilter(this.mTint, this.mTintMode); return true; } return bool; } public void setAlpha(int paramInt) { this.mPaint.setAlpha(paramInt); } public void setColor(@Nullable ColorStateList paramColorStateList) { setBackground(paramColorStateList); invalidateSelf(); } public void setColorFilter(ColorFilter paramColorFilter) { this.mPaint.setColorFilter(paramColorFilter); } void setPadding(float paramFloat, boolean paramBoolean1, boolean paramBoolean2) { if ((paramFloat == this.mPadding) && (this.mInsetForPadding == paramBoolean1) && (this.mInsetForRadius == paramBoolean2)) return; this.mPadding = paramFloat; this.mInsetForPadding = paramBoolean1; this.mInsetForRadius = paramBoolean2; updateBounds(null); invalidateSelf(); } void setRadius(float paramFloat) { if (paramFloat == this.mRadius) return; this.mRadius = paramFloat; updateBounds(null); invalidateSelf(); } public void setTintList(ColorStateList paramColorStateList) { this.mTint = paramColorStateList; this.mTintFilter = createTintFilter(this.mTint, this.mTintMode); invalidateSelf(); } public void setTintMode(PorterDuff.Mode paramMode) { this.mTintMode = paramMode; this.mTintFilter = createTintFilter(this.mTint, this.mTintMode); invalidateSelf(); } }
[ "pyp163@126.com" ]
pyp163@126.com
35352e3ed4e7bc350990891b8ac1fc0b977321ee
87f420a0e7b23aefe65623ceeaa0021fb0c40c56
/ruoyi-vue-pro-oauth2/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/convert/dept/SysDeptConvert.java
364b034afe013ca262012bcc18b6fb2bfc80e78e
[ "MIT" ]
permissive
xioxu-web/xioxu-web
0361a292b675d8209578d99451598bf4a56f9b08
7fe3f9539e3679e1de9f5f614f3f9b7f41a28491
refs/heads/master
2023-05-05T01:59:43.228816
2023-04-28T07:44:58
2023-04-28T07:44:58
367,005,744
0
0
null
null
null
null
UTF-8
Java
false
false
1,004
java
package cn.iocoder.yudao.adminserver.modules.system.convert.dept; import cn.iocoder.yudao.adminserver.modules.system.controller.dept.vo.dept.SysDeptCreateReqVO; import cn.iocoder.yudao.adminserver.modules.system.controller.dept.vo.dept.SysDeptRespVO; import cn.iocoder.yudao.adminserver.modules.system.controller.dept.vo.dept.SysDeptSimpleRespVO; import cn.iocoder.yudao.adminserver.modules.system.controller.dept.vo.dept.SysDeptUpdateReqVO; import cn.iocoder.yudao.adminserver.modules.system.dal.dataobject.dept.SysDeptDO; import org.mapstruct.Mapper; import org.mapstruct.factory.Mappers; import java.util.List; @Mapper public interface SysDeptConvert { SysDeptConvert INSTANCE = Mappers.getMapper(SysDeptConvert.class); List<SysDeptRespVO> convertList(List<SysDeptDO> list); List<SysDeptSimpleRespVO> convertList02(List<SysDeptDO> list); SysDeptRespVO convert(SysDeptDO bean); SysDeptDO convert(SysDeptCreateReqVO bean); SysDeptDO convert(SysDeptUpdateReqVO bean); }
[ "xb01049438@alibaba-inc.com" ]
xb01049438@alibaba-inc.com
e86ccdbfeb46e0717159b0172d4106aba594b6a6
6635387159b685ab34f9c927b878734bd6040e7e
/src/com/google/android/gms/dynamic/zzd.java
a22987597e2e36d376c68ccf4c2e716e435159ad
[]
no_license
RepoForks/com.snapchat.android
987dd3d4a72c2f43bc52f5dea9d55bfb190966e2
6e28a32ad495cf14f87e512dd0be700f5186b4c6
refs/heads/master
2021-05-05T10:36:16.396377
2015-07-16T16:46:26
2015-07-16T16:46:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,607
java
package com.google.android.gms.dynamic; import android.os.Binder; import android.os.IBinder; import android.os.IInterface; import android.os.Parcel; public abstract interface zzd extends IInterface { public static abstract class zza extends Binder implements zzd { public zza() { attachInterface(this, "com.google.android.gms.dynamic.IObjectWrapper"); } public static zzd zzau(IBinder paramIBinder) { if (paramIBinder == null) { return null; } IInterface localIInterface = paramIBinder.queryLocalInterface("com.google.android.gms.dynamic.IObjectWrapper"); if ((localIInterface != null) && ((localIInterface instanceof zzd))) { return (zzd)localIInterface; } return new zza(paramIBinder); } public IBinder asBinder() { return this; } public boolean onTransact(int paramInt1, Parcel paramParcel1, Parcel paramParcel2, int paramInt2) { switch (paramInt1) { default: return super.onTransact(paramInt1, paramParcel1, paramParcel2, paramInt2); } paramParcel2.writeString("com.google.android.gms.dynamic.IObjectWrapper"); return true; } static class zza implements zzd { private IBinder zzle; zza(IBinder paramIBinder) { zzle = paramIBinder; } public IBinder asBinder() { return zzle; } } } } /* Location: * Qualified Name: com.google.android.gms.dynamic.zzd * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "reverseengineeringer@hackeradmin.com" ]
reverseengineeringer@hackeradmin.com
3d2f48024eb9c45a4fc2d3d6afaf5a705266a748
8862e320433db9e20cbf76565e557e11208eb7ee
/modules/core/src/main/java/org/eclipse/imagen/media/mlib/MlibMaxRIF.java
ec4f263a6457e58a99d9e4b2c37f9b76aa33202c
[ "Apache-2.0" ]
permissive
jqyx/imagen
fab6a264d7f60452698ccf0e65e8fee211efa301
7933781dd2771edd276f4c681023dc155dd5f1f4
refs/heads/master
2020-05-15T05:52:11.936252
2019-05-01T15:40:15
2019-05-01T15:40:15
182,112,599
0
0
null
2019-04-18T15:27:07
2019-04-18T15:27:07
null
UTF-8
Java
false
false
2,117
java
/* * Copyright (c) [2019,] 2019, Oracle and/or its affiliates. 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 org.eclipse.imagen.media.mlib; import java.awt.RenderingHints; import java.awt.image.RenderedImage; import java.awt.image.renderable.ParameterBlock; import java.awt.image.renderable.RenderedImageFactory; import org.eclipse.imagen.ImageLayout; import java.util.Map; import org.eclipse.imagen.media.opimage.RIFUtil; /** * A <code>RIF</code> supporting the "Max" operation in the * rendered image mode using MediaLib. * * @see org.eclipse.imagen.operator.MaxDescriptor * @see MlibMaxOpImage * * @since 1.0 * */ public class MlibMaxRIF implements RenderedImageFactory { /** Constructor. */ public MlibMaxRIF() {} /** * Creates a new instance of <code>MlibMaxOpImage</code> in * the rendered image mode. * * @param args The source images. * @param hints May contain rendering hints and destination image layout. */ public RenderedImage create(ParameterBlock args, RenderingHints hints) { /* Get ImageLayout and TileCache from RenderingHints. */ ImageLayout layout = RIFUtil.getImageLayoutHint(hints); if (!MediaLibAccessor.isMediaLibCompatible(args, layout) || !MediaLibAccessor.hasSameNumBands(args, layout)) { return null; } return new MlibMaxOpImage(args.getRenderedSource(0), args.getRenderedSource(1), hints, layout); } }
[ "qingyun.xie@oracle.com" ]
qingyun.xie@oracle.com
efbedfd5bfdff537b2f7ab85849e87358b94532d
d22a545abad4c69751c3504c702a9491ca96c225
/src/com/j256/ormlite/dao/ForeignCollection.java
3c0020af188efc0e96e3d1ccfe2e6853f0a3d660
[]
no_license
anu12anu12/GiveMeDirection
c153b8aa5f8845c408460f091dc9c60c0573225d
69805bb23be09bc971c03749d76d0b033923d37a
refs/heads/master
2020-12-24T15:58:32.456406
2013-09-04T18:48:39
2013-09-04T18:48:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
967
java
package com.j256.ormlite.dao; import java.sql.SQLException; import java.util.Collection; public abstract interface ForeignCollection<T> extends Collection<T>, CloseableIterable<T> { public abstract void closeLastIterator() throws SQLException; public abstract CloseableWrappedIterable<T> getWrappedIterable(); public abstract boolean isEager(); public abstract CloseableIterator<T> iteratorThrow() throws SQLException; public abstract int refresh(T paramT) throws SQLException; public abstract int refreshAll() throws SQLException; public abstract int refreshCollection() throws SQLException; public abstract int update(T paramT) throws SQLException; public abstract int updateAll() throws SQLException; } /* Location: D:\Tools\extractapktools\extractapktools\dex2jar-0.0.7.11-SNAPSHOT\classes_dex2jar.jar * Qualified Name: com.j256.ormlite.dao.ForeignCollection * JD-Core Version: 0.6.2 */
[ "asingh7@asingh7-PC.beaeng.mfeeng.org" ]
asingh7@asingh7-PC.beaeng.mfeeng.org
b9024d91d2f22956988dd47ce7d28f57212a03d0
82eba08b9a7ee1bd1a5f83c3176bf3c0826a3a32
/ZmailAdminExt/ClientUploader/java/org/zmail/clientuploader/ClientUploadHandler.java
7ad9f61ff897c353e60da83b79692d8b92299be4
[ "MIT" ]
permissive
keramist/zmailserver
d01187fb6086bf3784fe180bea2e1c0854c83f3f
762642b77c8f559a57e93c9f89b1473d6858c159
refs/heads/master
2021-01-21T05:56:25.642425
2013-10-21T11:27:05
2013-10-22T12:48:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,351
java
/* * ***** BEGIN LICENSE BLOCK ***** * Zimbra Collaboration Suite Server * Copyright (C) 2012 VMware, Inc. * * The contents of this file are subject to the Zimbra Public License * Version 1.3 ("License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.zimbra.com/license. * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. * ***** END LICENSE BLOCK ***** */ package org.zmail.clientuploader; import org.zmail.common.account.Key; import org.zmail.common.service.ServiceException; import org.zmail.common.util.StringUtil; import org.zmail.cs.account.Account; import org.zmail.cs.account.AuthToken; import org.zmail.cs.account.Provisioning; import org.zmail.cs.account.accesscontrol.RightCommand; import org.zmail.cs.extension.ExtensionHttpHandler; import org.zmail.cs.servlet.ZmailServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.List; /** * A handler to deal with uploading client software request. * * @author Dongwei Feng * @since 2012.3.14 */ public class ClientUploadHandler extends ExtensionHttpHandler { public static final String HANDLER_PATH_NAME = "upload"; private static final String TARGET_TYPE = "global"; private static final String UPLOAD_PERMISSION = "uploadClientSoftware"; @Override public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException { String reqId = req.getParameter("requestId"); ZClientUploadManager man = new ZClientUploadManager(); try { AuthToken authToken = ZmailServlet.getAdminAuthTokenFromCookie(req, resp); if (!authenticate(authToken, resp)){ return; } checkRight(authToken); man.uploadClient(req); sendSuccess(resp, reqId); } catch (ZClientUploaderException e) { Log.clientUploader.error("",e); String msg; switch (e.getRespCode()) { case FILE_EXCEED_LIMIT: msg = ZClientUploaderRespCode.FILE_EXCEED_LIMIT.getDescription(); break; case NOT_A_FILE: msg = ZClientUploaderRespCode.NOT_A_FILE.getDescription(); break; case NO_PERMISSION: msg = ZClientUploaderRespCode.NO_PERMISSION.getDescription(); break; case MISSING_LIB_PATH: case UPDATE_LINK_FAILED: msg = ZClientUploaderRespCode.UPDATE_LINK_FAILED.getDescription(); break; default: msg = ZClientUploaderRespCode.FAILED.getDescription(); } sendError(resp, e.getRespCode().getCode(), reqId, msg); } catch (Exception e) { Log.clientUploader.error("Unexpected error", e); sendError(resp,ZClientUploaderRespCode.FAILED.getCode(), reqId, ZClientUploaderRespCode.FAILED.getDescription()); } } private boolean authenticate(AuthToken authToken, HttpServletResponse resp) throws IOException { if (authToken == null) { Log.clientUploader.warn("Auth failed"); sendError(resp, HttpServletResponse.SC_FORBIDDEN, HttpServletResponse.SC_FORBIDDEN, "Auth failed"); return false; } return true; } private void checkRight(AuthToken authToken) throws ZClientUploaderException { if (authToken.isAdmin()) { return; } if (authToken.isDomainAdmin() || authToken.isDelegatedAdmin()) { try { RightCommand.EffectiveRights rights = Provisioning.getInstance().getEffectiveRights(TARGET_TYPE, null, null, Key.GranteeBy.id, authToken.getAccountId(), false, false); List<String> preRights = rights.presetRights(); for (String r : preRights) { if (UPLOAD_PERMISSION.equalsIgnoreCase(r)) { return; } } } catch (Exception e) { Log.clientUploader.warn("Failed to check right."); } } throw new ZClientUploaderException(ZClientUploaderRespCode.NO_PERMISSION); } @Override public String getPath() { return super.getPath() + "/" + HANDLER_PATH_NAME; } private void sendError(HttpServletResponse resp, int sc, long respCode, String msg) throws IOException { Log.clientUploader.error("Failed to process request: " + msg); resp.sendError(sc, this.getResponseBody(respCode, null, msg)); } private void sendError(HttpServletResponse resp, long respCode, String requestId, String msg) throws IOException { Log.clientUploader.error("Failed to process request: " + msg); resp.setStatus(HttpServletResponse.SC_OK); resp.getWriter().write(getResponseBody(respCode, requestId, msg)); resp.getWriter().flush(); resp.getWriter().close(); } private void sendSuccess(HttpServletResponse resp, String requestId) throws IOException { resp.setStatus(HttpServletResponse.SC_OK); resp.getWriter().write(getResponseBody(ZClientUploaderRespCode.SUCCEEDED.getCode(), requestId)); resp.getWriter().flush(); resp.getWriter().close(); } private String getResponseBody(long statusCode, String requestId) { return getResponseBody(statusCode, requestId, null); } private String getResponseBody(long statusCode, String requestId, String msg) { StringBuilder sb = new StringBuilder(); sb.append("<html><head></head><body onload=\"window.parent._uploadManager.loaded(") .append(statusCode) .append(",'") .append(requestId != null ? StringUtil.jsEncode(requestId) : "null") .append("'") .append(");\">"); if (msg != null && !msg.isEmpty()) { sb.append(msg); } sb.append("</body></html>"); return sb.toString(); } }
[ "bourgerie.quentin@gmail.com" ]
bourgerie.quentin@gmail.com
aa46d263b2d8c6b4fa3f6a43210c2c2f6cc42c2e
b3418633bf03a546a5254ea422e40de17489980c
/src/main/java/com/fhd/fdc/utils/IsChineseOrNotUtil.java
5928c7218a255e1928feb91313ff456d11cf1c46
[]
no_license
vincent-dixin/Financial-Street-ERMIS
d819fd319293e55578e3067c9a5de0cd33c56a93
87d6bc6a4ddc52abca2c341eb476c1ea283d70e7
refs/heads/master
2016-09-06T13:56:46.197326
2015-03-30T02:47:46
2015-03-30T02:47:46
33,099,786
1
0
null
null
null
null
UTF-8
Java
false
false
1,593
java
/** * IsChineseOrNotUtil.java * com.fhd.fdc.utils * ver date author * ────────────────────────────────── * 2013-6-27 张 雷 * * Copyright (c) 2013, Firsthuida All Rights Reserved. */ package com.fhd.fdc.utils; /** * @author 张 雷 * @version * @since Ver 1.1 * @Date 2013-6-27 下午1:40:37 * * @see */ public class IsChineseOrNotUtil { // GENERAL_PUNCTUATION 判断中文的“号 // CJK_SYMBOLS_AND_PUNCTUATION 判断中文的。号 // HALFWIDTH_AND_FULLWIDTH_FORMS 判断中文的,号 private static final boolean isChinese(char c) { Character.UnicodeBlock ub = Character.UnicodeBlock.of(c); if (ub == Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS || ub == Character.UnicodeBlock.CJK_COMPATIBILITY_IDEOGRAPHS || ub == Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A || ub == Character.UnicodeBlock.GENERAL_PUNCTUATION || ub == Character.UnicodeBlock.CJK_SYMBOLS_AND_PUNCTUATION || ub == Character.UnicodeBlock.HALFWIDTH_AND_FULLWIDTH_FORMS) { return true; } return false; } public static final boolean isChinese(String strName) { char[] ch = strName.toCharArray(); for (int i = 0; i < ch.length; i++) { char c = ch[i]; if (isChinese(c)) { return true; } } return false; } }
[ "cashhu@126.com" ]
cashhu@126.com
96b97d00fd381784e0180bcf7ef2beb7053fc606
c6c1a124eb1ff2fc561213d43d093f84d1ab2c43
/games/click-screen/core/src/cn/javaplus/clickscreen/game/RankingListButton.java
9ae7f4fb7ac4501da7dfbd839018cd6f6cd90b80
[]
no_license
fantasylincen/javaplus
69201dba21af0973dfb224c53b749a3c0440317e
36fc370b03afe952a96776927452b6d430b55efd
refs/heads/master
2016-09-06T01:55:33.244591
2015-08-15T12:15:51
2015-08-15T12:15:51
15,601,930
3
1
null
null
null
null
UTF-8
Java
false
false
711
java
package cn.javaplus.clickscreen.game; import org.javaplus.game.common.assets.Assets; import com.badlogic.gdx.graphics.g2d.TextureAtlas; import com.badlogic.gdx.scenes.scene2d.ui.ImageButton; import com.badlogic.gdx.scenes.scene2d.ui.Skin; public class RankingListButton extends ImageButton { public RankingListButton() { super(style()); } public static ImageButtonStyle style() { ImageButtonStyle style = new ImageButtonStyle(); TextureAtlas atlas = Assets.getSd().getTextureAtlas("data/robot.txt"); Skin skin = new Skin(atlas); style.imageUp = skin.getDrawable("rankingListButtonUp"); style.imageDown = skin.getDrawable("rankingListButtonDown"); return style; } }
[ "12-2" ]
12-2
6c3bba831c20db8a3287499da1914dd874ceb085
a1826c2ed9c12cfc395fb1a14c1a2e1f097155cb
/cms-20190101/src/main/java/com/aliyun/cms20190101/models/CreateGroupMetricRulesResponseBody.java
348162b3dabc5efa24db269d9b25c8ee0f0a70af
[ "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
4,738
java
// This file is auto-generated, don't edit it. Thanks. package com.aliyun.cms20190101.models; import com.aliyun.tea.*; public class CreateGroupMetricRulesResponseBody extends TeaModel { @NameInMap("Code") public Integer code; @NameInMap("Message") public String message; @NameInMap("RequestId") public String requestId; @NameInMap("Resources") public CreateGroupMetricRulesResponseBodyResources resources; @NameInMap("Success") public Boolean success; public static CreateGroupMetricRulesResponseBody build(java.util.Map<String, ?> map) throws Exception { CreateGroupMetricRulesResponseBody self = new CreateGroupMetricRulesResponseBody(); return TeaModel.build(map, self); } public CreateGroupMetricRulesResponseBody setCode(Integer code) { this.code = code; return this; } public Integer getCode() { return this.code; } public CreateGroupMetricRulesResponseBody setMessage(String message) { this.message = message; return this; } public String getMessage() { return this.message; } public CreateGroupMetricRulesResponseBody setRequestId(String requestId) { this.requestId = requestId; return this; } public String getRequestId() { return this.requestId; } public CreateGroupMetricRulesResponseBody setResources(CreateGroupMetricRulesResponseBodyResources resources) { this.resources = resources; return this; } public CreateGroupMetricRulesResponseBodyResources getResources() { return this.resources; } public CreateGroupMetricRulesResponseBody setSuccess(Boolean success) { this.success = success; return this; } public Boolean getSuccess() { return this.success; } public static class CreateGroupMetricRulesResponseBodyResourcesAlertResult extends TeaModel { @NameInMap("Code") public Integer code; @NameInMap("Message") public String message; @NameInMap("RuleId") public String ruleId; @NameInMap("RuleName") public String ruleName; @NameInMap("Success") public Boolean success; public static CreateGroupMetricRulesResponseBodyResourcesAlertResult build(java.util.Map<String, ?> map) throws Exception { CreateGroupMetricRulesResponseBodyResourcesAlertResult self = new CreateGroupMetricRulesResponseBodyResourcesAlertResult(); return TeaModel.build(map, self); } public CreateGroupMetricRulesResponseBodyResourcesAlertResult setCode(Integer code) { this.code = code; return this; } public Integer getCode() { return this.code; } public CreateGroupMetricRulesResponseBodyResourcesAlertResult setMessage(String message) { this.message = message; return this; } public String getMessage() { return this.message; } public CreateGroupMetricRulesResponseBodyResourcesAlertResult setRuleId(String ruleId) { this.ruleId = ruleId; return this; } public String getRuleId() { return this.ruleId; } public CreateGroupMetricRulesResponseBodyResourcesAlertResult setRuleName(String ruleName) { this.ruleName = ruleName; return this; } public String getRuleName() { return this.ruleName; } public CreateGroupMetricRulesResponseBodyResourcesAlertResult setSuccess(Boolean success) { this.success = success; return this; } public Boolean getSuccess() { return this.success; } } public static class CreateGroupMetricRulesResponseBodyResources extends TeaModel { @NameInMap("AlertResult") public java.util.List<CreateGroupMetricRulesResponseBodyResourcesAlertResult> alertResult; public static CreateGroupMetricRulesResponseBodyResources build(java.util.Map<String, ?> map) throws Exception { CreateGroupMetricRulesResponseBodyResources self = new CreateGroupMetricRulesResponseBodyResources(); return TeaModel.build(map, self); } public CreateGroupMetricRulesResponseBodyResources setAlertResult(java.util.List<CreateGroupMetricRulesResponseBodyResourcesAlertResult> alertResult) { this.alertResult = alertResult; return this; } public java.util.List<CreateGroupMetricRulesResponseBodyResourcesAlertResult> getAlertResult() { return this.alertResult; } } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
0891add985dc38e7d0d3783448f58082f038cbd9
56cf34c40c5048b7b5f9a257288bba1c34b1d5e2
/src/org/xpup/hafmis/syscollection/chgbiz/chgorgrate/action/ShowChgOrgRateDoAC.java
1ce64ac6845353c358e95c2179d959b8435a78b1
[]
no_license
witnesslq/zhengxin
0a62d951dc69d8d6b1b8bcdca883ee11531fbb83
0ea9ad67aa917bd1911c917334b6b5f9ebfd563a
refs/heads/master
2020-12-30T11:16:04.359466
2012-06-27T13:43:40
2012-06-27T13:43:40
null
0
0
null
null
null
null
GB18030
Java
false
false
1,976
java
package org.xpup.hafmis.syscollection.chgbiz.chgorgrate.action; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.Action; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.xpup.hafmis.common.util.BusiConst; import org.xpup.hafmis.orgstrct.dto.SecurityInfo; import org.xpup.hafmis.syscollection.chgbiz.chgorgrate.form.ChgOrgRateDoAF; public class ShowChgOrgRateDoAC extends Action { public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { try{ ChgOrgRateDoAF af=(ChgOrgRateDoAF)form; ChgOrgRateDoAF doMaintain=(ChgOrgRateDoAF)request.getAttribute("chgOrgRateDoFromMaintainAF"); // 吴洪涛修改 2008-3-18 单位_汇缴比例调整 SecurityInfo securityInfo = (SecurityInfo) request.getSession() .getAttribute("SecurityInfo"); int isOrgEdition = securityInfo.getIsOrgEdition(); if (isOrgEdition == BusiConst.ORG_OR_CENTER_INFO_ORG)// 为单位版{ { if(doMaintain!=null){ doMaintain.getChgOrgRate().setOrgEdition("yes"); request.setAttribute("chgOrgRateDoAF", doMaintain); }else{ af.setType("1"); af=new ChgOrgRateDoAF(); request.setAttribute("chgOrgRateDoAF", af); } }else{ if(doMaintain!=null){ request.setAttribute("chgOrgRateDoAF", doMaintain); }else{ af.setType("1"); af=new ChgOrgRateDoAF(); request.setAttribute("chgOrgRateDoAF", af); } } // 吴洪涛修改 2008-3-18 单位_汇缴比例调整 }catch(Exception e){ e.printStackTrace(); } return mapping.findForward("to_chgorgrateDo_sure"); } }
[ "yuelaotou@gmail.com" ]
yuelaotou@gmail.com
f7dfb62818b4252f987ef7022e537bc085a276bc
5b7043c0020a1ffbc5f01150d76de461f3f919c6
/jOOQ/src/main/java/org/jooq/impl/WithTable.java
80e10d095e5687f018ccfb51aba63aae67b401c4
[ "Apache-2.0" ]
permissive
brmeyer/jOOQ
b8566ff3438c2cae57949c8a1575502945bd707a
33e616356d268d574eb52297c38176c8ed0cc247
refs/heads/master
2021-01-18T19:54:26.050884
2015-01-26T14:43:40
2015-01-26T14:43:40
29,864,793
0
1
null
2015-01-26T14:36:40
2015-01-26T14:36:39
null
UTF-8
Java
false
false
3,205
java
/** * Copyright (c) 2009-2015, Data Geekery GmbH (http://www.datageekery.com) * All rights reserved. * * This work is dual-licensed * - under the Apache Software License 2.0 (the "ASL") * - under the jOOQ License and Maintenance Agreement (the "jOOQ License") * ============================================================================= * You may choose which license applies to you: * * - If you're using this work with Open Source databases, you may choose * either ASL or jOOQ License. * - If you're using this work with at least one commercial database, you must * choose jOOQ License * * For more information, please visit http://www.jooq.org/licenses * * Apache Software License 2.0: * ----------------------------------------------------------------------------- * 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. * * jOOQ License and Maintenance Agreement: * ----------------------------------------------------------------------------- * Data Geekery grants the Customer the non-exclusive, timely limited and * non-transferable license to install and use the Software under the terms of * the jOOQ License and Maintenance Agreement. * * This library is distributed with a LIMITED WARRANTY. See the jOOQ License * and Maintenance Agreement for more details: http://www.jooq.org/licensing */ package org.jooq.impl; import org.jooq.Context; import org.jooq.Record; import org.jooq.Table; /** * @author Lukas Eder */ class WithTable<R extends Record> extends AbstractTable<R> { /** * Generated UID */ private static final long serialVersionUID = -3905775637768497535L; private final AbstractTable<R> delegate; private final String hint; WithTable(AbstractTable<R> delegate, String hint) { super(delegate.getName(), delegate.getSchema()); this.delegate = delegate; this.hint = hint; } @Override public final boolean declaresTables() { return true; } @Override public final void accept(Context<?> ctx) { ctx.visit(delegate) .sql(" ").keyword("with") .sql(" (").sql(hint) .sql(")"); } @Override public final Class<? extends R> getRecordType() { return delegate.getRecordType(); } @Override public final Table<R> as(String alias) { return new WithTable<R>(new TableAlias<R>(delegate, alias), hint); } @Override public final Table<R> as(String alias, String... fieldAliases) { return new WithTable<R>(new TableAlias<R>(delegate, alias, fieldAliases), hint); } @Override final Fields<R> fields0() { return delegate.fields0(); } }
[ "lukas.eder@gmail.com" ]
lukas.eder@gmail.com