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
151d18de064de9850e590bf325a4559ee2ec429d
180e78725121de49801e34de358c32cf7148b0a2
/dataset/protocol1/kylin/learning/2770/ImmutableBitSet.java
1524adcd79bcb5a54e632adbbfe0c6f148f13f47
[]
no_license
ASSERT-KTH/synthetic-checkstyle-error-dataset
40e8d1e0a7ebe7f7711def96a390891a6922f7bd
40c057e1669584bfc6fecf789b5b2854660222f3
refs/heads/master
2023-03-18T12:50:55.410343
2019-01-25T09:54:39
2019-01-25T09:54:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,445
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.kylin.common.util; import java.nio.ByteBuffer; import java.util.BitSet; import java.util.Iterator; public class ImmutableBitSet implements Iterable<Integer> { public static final ImmutableBitSet EMPTY = new ImmutableBitSet(new BitSet()); public static ImmutableBitSet valueOf(int... values) { BitSet set = new BitSet(); for (int i : values) set.set(i); return new ImmutableBitSet(set); } // ============================================================================ final private BitSet set; final private int[] arr; public ImmutableBitSet(int index) { this(newBitSet(index)); } public ImmutableBitSet(BitSet set) { this.set = (BitSet) set.clone(); this.arr = new int[set.cardinality()]; int j = 0; for (int i = set.nextSetBit(0); i >= 0; i = set.nextSetBit(i + 1)) { arr[j++] = i; } } private static BitSet newBitSet(int index) { BitSet set = new BitSet(index); set.set(index); return set; } public ImmutableBitSet(int indexFrom, int indexTo) { this(newBitSet(indexFrom, indexTo)); } private static BitSet newBitSet(int indexFrom, int indexTo) { BitSet set = new BitSet(indexTo); set.set(indexFrom, indexTo); return set; } /** return number of true bits */ public int trueBitCount() { return arr.length; } /** return the i-th true bit */ public int trueBitAt(int i) { return arr[i]; } /** return the bit's index among true bits */ public int trueBitIndexOf(int bitIndex) { for (int i = 0; i < arr.length; i++) { if (arr[i] == bitIndex) return i; } return -1; } public BitSet mutable() { return (BitSet) set.clone(); } public ImmutableBitSet set(int bitIndex) { return set(bitIndex, true); } public ImmutableBitSet set(int bitIndex, boolean value) { if (set.get(bitIndex) == value) { return this; } else { BitSet mutable = mutable(); mutable.set(bitIndex, value); return new ImmutableBitSet(mutable); } } public ImmutableBitSet or(ImmutableBitSet another) { BitSet mutable = mutable(); mutable.or(another.set); return new ImmutableBitSet(mutable); } public ImmutableBitSet andNot(ImmutableBitSet another) { BitSet mutable = mutable(); mutable.andNot(another.set); return new ImmutableBitSet(mutable); } @Override public int hashCode() { return set.hashCode(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; ImmutableBitSet other = (ImmutableBitSet) obj; return this.set.equals(other.set); } @Override public String toString() { return set.toString(); } // ============================================================================ public boolean get(int bitIndex) { return set.get(bitIndex); } public int cardinality() { return set.cardinality(); } public boolean intersects(ImmutableBitSet another) { return set.intersects(another.set); } public boolean isEmpty() { return set.isEmpty(); } public static final BytesSerializer<ImmutableBitSet> serializer = new BytesSerializer<ImmutableBitSet>() { @Override public void serialize(ImmutableBitSet value, ByteBuffer out) { BytesUtil.writeByteArray(value.set.toByteArray(), out); } @Override public ImmutableBitSet deserialize(ByteBuffer in) { BitSet bitSet = BitSet.valueOf(BytesUtil.readByteArray(in)); return new ImmutableBitSet(bitSet); } }; /** * Iterate over the positions of true value. * @return the iterator */ @Override public Iterator<Integer> iterator() { return new Iterator<Integer>() { int index = 0; @Override public boolean hasNext() { return index < arr.length; } @Override public Integer next() { return arr[index++]; } @Override public void remove() { throw new UnsupportedOperationException(); } }; } }
[ "bloriot97@gmail.com" ]
bloriot97@gmail.com
72b600e423a478b891a7ddbcd87771ba278c3e7c
f22340f0d277081bf1ee79636aa8845fb42a8024
/src/main/java/puzzle/parsers/CompareExpression.java
3d0ca8a169ea55cc63b9cb3c9075fcb6a0600587
[]
no_license
saka1029/Puzzle
f0cf6e611fcc46580fcfe03325dee76f6b440c9c
edf8810343190be530fb77f36c1414e8266e8a78
refs/heads/master
2023-04-03T10:00:48.988223
2023-03-19T21:41:46
2023-03-19T21:41:46
208,369,149
0
0
null
2022-09-01T23:52:07
2019-09-14T00:50:11
Java
UTF-8
Java
false
false
2,919
java
package puzzle.parsers; public class CompareExpression { /** * expression = or * or = and { '||' and } * and = factor { '&&' factor } * factor = paren | comp * paren = '(' expression ')' * comp = number op number * op = '==' | '!=' | '<' | '<= | '>' | '>=' */ static boolean eval(String expression) { return new Object() { int index = 0; int ch = get(); int get() { return ch = index < expression.length() ? expression.charAt(index++) : -1; } void spaces() { while (Character.isWhitespace(ch)) get(); } boolean eat(String word) { spaces(); if (ch != word.charAt(0) || !expression.startsWith(word.substring(1), index)) return false; index += word.length() - 1; get(); return true; } int number() { spaces(); if (ch != '-' && !Character.isDigit(ch)) throw new RuntimeException( "number expected but '" + ((char)ch) + "'"); StringBuilder sb = new StringBuilder(); do { sb.append((char)ch); get(); } while (Character.isDigit(ch)); return Integer.parseInt(sb.toString()); } boolean paren() { boolean result = or(); if (!eat(")")) throw new RuntimeException("')' expected"); return result; } boolean comp() { if (eat("(")) return paren(); int term = number(); if (eat("==")) return term == number(); else if (eat("!=")) return term != number(); else if (eat("<=")) return term <= number(); else if (eat("<")) return term < number(); else if (eat(">=")) return term >= number(); else if (eat(">")) return term > number(); else throw new RuntimeException(); } boolean and() { boolean result = comp(); while (eat("&&")) result &= comp(); return result; } boolean or() { boolean result = and(); while (eat("||")) result |= and(); return result; } boolean parse() { boolean result = or(); if (ch != -1) throw new RuntimeException( "extra char '" + expression.substring(index - 1) + "'"); return result; } }.parse(); } }
[ "saka1029@gmail.com" ]
saka1029@gmail.com
cea863112efdcb6a2f423c7a352ad69fd61f5339
58d4fdf03133183cb67c24aae95662e42579554d
/src/main/java/com/soraxus/prisons/luckyblocks/ModuleLuckyBlocks.java
55ee46e62de5279a46dca785c2c3af49b94c4a09
[]
no_license
mattlack15/PrisonCore
e2aa969293efaff0812e898cda90d17dac06b880
9895aa6c246d0064dbc9b01f72ae5cd8661b9758
refs/heads/master
2023-06-21T17:10:25.909666
2021-08-01T04:17:35
2021-08-01T04:17:35
374,835,952
0
0
null
null
null
null
UTF-8
Java
false
false
3,347
java
package com.soraxus.prisons.luckyblocks; import com.soraxus.prisons.core.CoreModule; import com.soraxus.prisons.economy.Economy; import com.soraxus.prisons.enchants.api.enchant.AbstractCE; import com.soraxus.prisons.enchants.customenchants.Favored; import com.soraxus.prisons.enchants.gui.MenuEnchant; import com.soraxus.prisons.enchants.manager.EnchantManager; import com.soraxus.prisons.event.PrisonBlockBreakEvent; import com.soraxus.prisons.util.EventSubscription; import com.soraxus.prisons.util.NumberUtils; import com.soraxus.prisons.util.display.chat.ChatBuilder; import com.soraxus.prisons.util.display.chat.ClickUtil; import com.soraxus.prisons.util.display.chat.HoverUtil; import com.soraxus.prisons.util.math.MathUtils; import com.soraxus.prisons.util.menus.MenuElement; import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; public class ModuleLuckyBlocks extends CoreModule { public void runLuckyBlock(Player player) { ItemStack pick = player.getInventory().getItemInMainHand(); AbstractCE favored = EnchantManager.instance.getCE(Favored.class); int level = favored.getLevel(pick) + 1; double rand = MathUtils.random(0, 100D); if (rand <= 30.0) { // Money long money = (long) Math.floor(1000 * ((level / 25D) + 1)); Economy.money.addBalance(player.getUniqueId(), money); player.sendMessage("§eLucky Blocks > §7You have received §e$" + NumberUtils.formatFull(money) + "§7."); return; } long tokens = favored.getCost(level) / 50; if (rand <= 65) { // Small tokens tokens = favored.getCost(level) / 60; } ChatBuilder builder = new ChatBuilder("§eLucky Blocks > §7You have received §e" + NumberUtils.formatFull(tokens) + " Tokens§7."); if (tokens == 0) { builder.addText(" &7You need\nthe " + EnchantManager.instance.getCE(Favored.class).getDisplayName() + " &7enchant to get lucky block rewards!", HoverUtil.text("&fClick to open&d enchant menu"), ClickUtil.runnable((p) -> { if (p.getInventory().getItemInMainHand() != null && p.getInventory().getItemInMainHand().getType().toString().contains("PICKAXE")) { new MenuEnchant(p, p.getInventory().getItemInMainHand(), EnchantManager.instance.getEnchantments()).open(p); } else { p.playSound(p.getLocation(), Sound.ENTITY_ENDERDRAGON_HURT, 0.8f, 1.2f); new ChatBuilder("&cYou must be holding your pickaxe to open the enchantment menu!").send(p); } })); } builder.send(player); Economy.tokens.addBalance(player.getUniqueId(), tokens); } @Override public String getName() { return "Lucky Blocks"; } @Override public MenuElement getGUI(MenuElement backButton) { return null; } @EventSubscription public void onBreak(PrisonBlockBreakEvent e) { if ((e.getBlock() & 4095) == Material.SPONGE.getId()) { for (int i = 0; i < e.getAmount(); i++) runLuckyBlock(e.getPlayer()); e.setAmount(0); } } }
[ "unconfigured@null.spigotmc.org" ]
unconfigured@null.spigotmc.org
c0e45c29da5d559b74c2c37515a81d6b6cf4347f
fe06f97c2cf33a8b4acb7cb324b79a6cb6bb9dac
/java/dao/impl/CLMS_AP/InUps1DAOImpl.java
aa3873d920d68ed941391d0e56a1faf0c7e39a9d
[]
no_license
HeimlichLin/TableSchema
3f67dae0b5b169ee3a1b34837ea9a2d34265f175
64b66a2968c3a169b75d70d9e5cf75fa3bb65354
refs/heads/master
2023-02-11T09:42:47.210289
2023-02-01T02:58:44
2023-02-01T02:58:44
196,526,843
0
0
null
2022-06-29T18:53:55
2019-07-12T07:03:58
Java
UTF-8
Java
false
false
3,669
java
package com.doc.common.dao.impl; public class InUps1DAOImpl extends GeneralDAOImpl<InUps1Po> implements InUps1DAO { public static final InUps1DAOImpl INSTANCE = new InUps1DAOImpl(); public static final String TABLENAME = "IN_UPS1"; public InUps1DAOImpl() { super(TABLENAME); } protected static final MapConverter<InUps1Po> CONVERTER = new MapConverter<InUps1Po>() { @Override public InUps1Po convert(final DataObject dataObject) { final InUps1Po inUps1Po = new InUps1Po(); inUps1Po.setBondno(dataObject.getString(InUps1Po.COLUMNS.BONDNO.name())); inUps1Po.setGdstype(dataObject.getString(InUps1Po.COLUMNS.GDSTYPE.name())); inUps1Po.setDecltype(dataObject.getString(InUps1Po.COLUMNS.DECLTYPE.name())); inUps1Po.setPrdtno(dataObject.getString(InUps1Po.COLUMNS.PRDTNO.name())); inUps1Po.setDeclno(dataObject.getString(InUps1Po.COLUMNS.DECLNO.name())); inUps1Po.setItemno(BigDecimalUtils.formObj(dataObject.getValue(InUps1Po.COLUMNS.ITEMNO.name()))); inUps1Po.setStockno(dataObject.getString(InUps1Po.COLUMNS.STOCKNO.name())); inUps1Po.setIndate(dataObject.getString(InUps1Po.COLUMNS.INDATE.name())); inUps1Po.setRinqty(BigDecimalUtils.formObj(dataObject.getValue(InUps1Po.COLUMNS.RINQTY.name()))); inUps1Po.setInunit(dataObject.getString(InUps1Po.COLUMNS.INUNIT.name())); inUps1Po.setInpost(dataObject.getString(InUps1Po.COLUMNS.INPOST.name())); inUps1Po.setBalance(BigDecimalUtils.formObj(dataObject.getValue(InUps1Po.COLUMNS.BALANCE.name()))); inUps1Po.setIsstock(dataObject.getString(InUps1Po.COLUMNS.ISSTOCK.name())); inUps1Po.setRmk(dataObject.getString(InUps1Po.COLUMNS.RMK.name())); inUps1Po.setInstatus(dataObject.getString(InUps1Po.COLUMNS.INSTATUS.name())); inUps1Po.setControlno(dataObject.getString(InUps1Po.COLUMNS.CONTROLNO.name())); inUps1Po.setUpdtime(dataObject.getString(InUps1Po.COLUMNS.UPDTIME.name())); return inUps1Po; } @Override public DataObject toDataObject(final InUps1Po inUps1Po) { final DataObject dataObject = new DataObject(); dataObject.setValue(InUps1Po.COLUMNS.BONDNO.name(), inUps1Po.getBondno()); dataObject.setValue(InUps1Po.COLUMNS.GDSTYPE.name(), inUps1Po.getGdstype()); dataObject.setValue(InUps1Po.COLUMNS.DECLTYPE.name(), inUps1Po.getDecltype()); dataObject.setValue(InUps1Po.COLUMNS.PRDTNO.name(), inUps1Po.getPrdtno()); dataObject.setValue(InUps1Po.COLUMNS.DECLNO.name(), inUps1Po.getDeclno()); dataObject.setValue(InUps1Po.COLUMNS.ITEMNO.name(), inUps1Po.getItemno()); dataObject.setValue(InUps1Po.COLUMNS.STOCKNO.name(), inUps1Po.getStockno()); dataObject.setValue(InUps1Po.COLUMNS.INDATE.name(), inUps1Po.getIndate()); dataObject.setValue(InUps1Po.COLUMNS.RINQTY.name(), inUps1Po.getRinqty()); dataObject.setValue(InUps1Po.COLUMNS.INUNIT.name(), inUps1Po.getInunit()); dataObject.setValue(InUps1Po.COLUMNS.INPOST.name(), inUps1Po.getInpost()); dataObject.setValue(InUps1Po.COLUMNS.BALANCE.name(), inUps1Po.getBalance()); dataObject.setValue(InUps1Po.COLUMNS.ISSTOCK.name(), inUps1Po.getIsstock()); dataObject.setValue(InUps1Po.COLUMNS.RMK.name(), inUps1Po.getRmk()); dataObject.setValue(InUps1Po.COLUMNS.INSTATUS.name(), inUps1Po.getInstatus()); dataObject.setValue(InUps1Po.COLUMNS.CONTROLNO.name(), inUps1Po.getControlno()); dataObject.setValue(InUps1Po.COLUMNS.UPDTIME.name(), inUps1Po.getUpdtime()); return dataObject; } }; public MapConverter<InUps1Po> getConverter() { return CONVERTER; } @Override public SqlWhere getPkSqlWhere(InUps1Po po) { throw new ApBusinessException("無pk不支援"); } }
[ "jerry.l@acer.com" ]
jerry.l@acer.com
97f1dfa792b062681c971018520ee380ac8802fd
7c73da0b531bb380cc6efe546afcd048221b207c
/spring-core/src/test/java/org/springframework/util/FastByteArrayOutputStreamTests.java
9eedeca8ee6d46a24c2520310aa336a2adf509e6
[ "Apache-2.0" ]
permissive
langtianya/spring4-understanding
e8d793b9fe6ef9c39e9aeaf8a4101c0adb6b7bc9
0b82365530b106a935575245e1fc728ea4625557
refs/heads/master
2021-01-19T04:01:04.034096
2016-08-07T06:16:34
2016-08-07T06:16:34
63,202,955
46
27
null
null
null
null
UTF-8
Java
false
false
5,657
java
/* * Copyright 2002-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.util; import static org.junit.Assert.*; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import org.junit.Before; import org.junit.Test; /** * Test suite for {@link FastByteArrayOutputStream} * @author Craig Andrews */ public class FastByteArrayOutputStreamTests { private static final int INITIAL_CAPACITY = 256; private FastByteArrayOutputStream os; private byte[] helloBytes; @Before public void setUp() throws Exception { this.os = new FastByteArrayOutputStream(INITIAL_CAPACITY); this.helloBytes = "Hello World".getBytes("UTF-8"); } @Test public void size() throws Exception { this.os.write(helloBytes); assertEquals(this.os.size(), helloBytes.length); } @Test public void resize() throws Exception { this.os.write(helloBytes); int sizeBefore = this.os.size(); this.os.resize(64); assertByteArrayEqualsString(this.os); assertEquals(sizeBefore, this.os.size()); } @Test public void autoGrow() throws IOException { this.os.resize(1); for (int i = 0; i < 10; i++) { this.os.write(1); } assertEquals(10, this.os.size()); assertArrayEquals(this.os.toByteArray(), new byte[] {1, 1, 1, 1, 1, 1, 1, 1, 1, 1}); } @Test public void write() throws Exception { this.os.write(helloBytes); assertByteArrayEqualsString(this.os); } @Test public void reset() throws Exception { this.os.write(helloBytes); assertByteArrayEqualsString(this.os); this.os.reset(); assertEquals(0, this.os.size()); this.os.write(helloBytes); assertByteArrayEqualsString(this.os); } @Test(expected = IOException.class) public void close() throws Exception { this.os.close(); this.os.write(helloBytes); } @Test public void toByteArrayUnsafe() throws Exception { this.os.write(helloBytes); assertByteArrayEqualsString(this.os); assertSame(this.os.toByteArrayUnsafe(), this.os.toByteArrayUnsafe()); assertArrayEquals(this.os.toByteArray(), helloBytes); } @Test public void writeTo() throws Exception { this.os.write(helloBytes); assertByteArrayEqualsString(this.os); ByteArrayOutputStream baos = new ByteArrayOutputStream(); this.os.writeTo(baos); assertArrayEquals(baos.toByteArray(), helloBytes); } @Test(expected = IllegalArgumentException.class) public void failResize() throws Exception { this.os.write(helloBytes); this.os.resize(5); } @Test public void getInputStream() throws Exception { this.os.write(helloBytes); assertNotNull(this.os.getInputStream()); } @Test public void getInputStreamAvailable() throws Exception { this.os.write(helloBytes); assertEquals(this.os.getInputStream().available(), helloBytes.length); } @Test public void getInputStreamRead() throws Exception { this.os.write(helloBytes); InputStream inputStream = this.os.getInputStream(); assertEquals(inputStream.read(), helloBytes[0]); assertEquals(inputStream.read(), helloBytes[1]); assertEquals(inputStream.read(), helloBytes[2]); assertEquals(inputStream.read(), helloBytes[3]); } @Test public void getInputStreamReadAll() throws Exception { this.os.write(helloBytes); InputStream inputStream = this.os.getInputStream(); byte[] actual = new byte[inputStream.available()]; int bytesRead = inputStream.read(actual); assertEquals(bytesRead, helloBytes.length); assertArrayEquals(actual, helloBytes); assertEquals(0, inputStream.available()); } @Test public void getInputStreamSkip() throws Exception { this.os.write(helloBytes); InputStream inputStream = this.os.getInputStream(); assertEquals(inputStream.read(), helloBytes[0]); assertEquals(inputStream.skip(1), 1); assertEquals(inputStream.read(), helloBytes[2]); assertEquals(helloBytes.length - 3, inputStream.available()); } @Test public void getInputStreamSkipAll() throws Exception { this.os.write(helloBytes); InputStream inputStream = this.os.getInputStream(); assertEquals(inputStream.skip(1000), helloBytes.length); assertEquals(0, inputStream.available()); } @Test public void updateMessageDigest() throws Exception { StringBuilder builder = new StringBuilder("\"0"); this.os.write(helloBytes); InputStream inputStream = this.os.getInputStream(); DigestUtils.appendMd5DigestAsHex(inputStream, builder); builder.append("\""); String actual = builder.toString(); assertEquals("\"0b10a8db164e0754105b7a99be72e3fe5\"", actual); } @Test public void updateMessageDigestManyBuffers() throws Exception { StringBuilder builder = new StringBuilder("\"0"); // filling at least one 256 buffer for( int i=0; i < 30; i++) { this.os.write(helloBytes); } InputStream inputStream = this.os.getInputStream(); DigestUtils.appendMd5DigestAsHex(inputStream, builder); builder.append("\""); String actual = builder.toString(); assertEquals("\"06225ca1e4533354c516e74512065331d\"", actual); } private void assertByteArrayEqualsString(FastByteArrayOutputStream actual) { assertArrayEquals(helloBytes, actual.toByteArray()); } }
[ "hansongjy@gmail.com" ]
hansongjy@gmail.com
9ed1eeaf749235c2df9d0692643649f585ead979
827bf064e482700d7ded2cd0a3147cb9657db883
/source_NewVersionImported/app/src/main/java/com/aadhk/restpos/c/aj.java
60fcd46c29db26920aae0fd6b21d1998e21960e2
[]
no_license
cody0117/LearnAndroid
d30b743029f26568ccc6dda4313a9d3b70224bb6
02fd4d2829a0af8a1706507af4b626783524813e
refs/heads/master
2021-01-21T21:10:18.553646
2017-02-12T08:43:24
2017-02-12T08:43:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
644
java
// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package com.aadhk.restpos.c; import android.view.View; import android.view.Window; // Referenced classes of package com.aadhk.restpos.c: // ai final class aj implements android.view.View.OnFocusChangeListener { final ai a; aj(ai ai1) { a = ai1; super(); } public final void onFocusChange(View view, boolean flag) { if (flag) { a.getWindow().setSoftInputMode(5); } } }
[ "em3888@gmail.com" ]
em3888@gmail.com
c850e453c4e52c1cf42ff4f018fa6bad8d67777e
96a7d93cb61cef2719fab90742e2fe1b56356d29
/selected projects/mobile/Signal-Android-4.60.5/app/src/main/java/org/thoughtcrime/securesms/database/loaders/RecipientMediaLoader.java
3e3e85c008be1dcdf3e54db9b9ed438217608307
[ "MIT" ]
permissive
danielogen/msc_research
cb1c0d271bd92369f56160790ee0d4f355f273be
0b6644c11c6152510707d5d6eaf3fab640b3ce7a
refs/heads/main
2023-03-22T03:59:14.408318
2021-03-04T11:54:49
2021-03-04T11:54:49
307,107,229
0
1
MIT
2021-03-04T11:54:49
2020-10-25T13:39:50
Java
UTF-8
Java
false
false
1,519
java
package org.thoughtcrime.securesms.database.loaders; import android.content.Context; import android.database.Cursor; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import org.thoughtcrime.securesms.database.DatabaseFactory; import org.thoughtcrime.securesms.database.MediaDatabase; import org.thoughtcrime.securesms.recipients.Recipient; import org.thoughtcrime.securesms.recipients.RecipientId; /** * It is more efficient to use the {@link ThreadMediaLoader} if you know the thread id already. */ public final class RecipientMediaLoader extends MediaLoader { @Nullable private final RecipientId recipientId; @NonNull private final MediaType mediaType; @NonNull private final MediaDatabase.Sorting sorting; public RecipientMediaLoader(@NonNull Context context, @Nullable RecipientId recipientId, @NonNull MediaType mediaType, @NonNull MediaDatabase.Sorting sorting) { super(context); this.recipientId = recipientId; this.mediaType = mediaType; this.sorting = sorting; } @Override public Cursor getCursor() { if (recipientId == null || recipientId.isUnknown()) return null; long threadId = DatabaseFactory.getThreadDatabase(getContext()) .getThreadIdFor(Recipient.resolved(recipientId)); return ThreadMediaLoader.createThreadMediaCursor(context, threadId, mediaType, sorting); } }
[ "danielogen@gmail.com" ]
danielogen@gmail.com
1a198be0a98e799bbe8afb14ac88c672e2f5bda3
58923e5cff9c09ba7814b055ab244ddd69ab1421
/src/main/java/com/wurmcraft/minecraftnotincluded/client/gui/farm/SlotOutput.java
7f2c702351e294320eff6847a251cf8b622097f1
[]
no_license
Wurmatron/Minecraft-Not-Included
a8ee0ef00256ce6b62ebee8415a3d813ae2388ab
4d46ba3f971cdec431b2e40b897152ae0f3470ba
refs/heads/master
2023-01-10T00:37:22.742469
2023-01-03T20:44:45
2023-01-03T20:44:45
151,340,511
0
1
null
null
null
null
UTF-8
Java
false
false
448
java
package com.wurmcraft.minecraftnotincluded.client.gui.farm; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; public class SlotOutput extends Slot { public SlotOutput(IInventory inventoryIn, int index, int xPosition, int yPosition) { super(inventoryIn, index, xPosition, yPosition); } @Override public boolean isItemValid(ItemStack stack) { return false; } }
[ "wurmatron@gmail.com" ]
wurmatron@gmail.com
a466e7ec940fd6d222fad05090a0d844704e8a6f
84673f3ab5d8d50e30ba2c945c9108dbd4243f52
/dmall-service-impl/dmall-service-impl-product/dmall-service-impl-product-business/src/main/java/com/dmall/pms/service/impl/category/handler/SaveCategoryHandler.java
2924f517b0106c5287d6da40b0a9fb3f0b554d8a
[ "Apache-2.0" ]
permissive
yuhangtdm/dmall
6d19395db0917d8dcfb09452ff34d82c03e5b774
e77794a0dff75f56b6a70d9ffeb3d2482b2cfeb8
refs/heads/master
2022-12-09T00:02:47.231794
2020-06-13T14:20:20
2020-06-13T14:20:20
214,462,902
8
4
Apache-2.0
2022-11-21T22:39:42
2019-10-11T14:55:13
JavaScript
UTF-8
Java
false
false
3,040
java
package com.dmall.pms.service.impl.category.handler; import cn.hutool.core.util.StrUtil; import com.dmall.common.dto.BaseResult; import com.dmall.common.util.ResultUtil; import com.dmall.component.web.handler.AbstractCommonHandler; import com.dmall.pms.api.dto.category.request.SaveCategoryRequestDTO; import com.dmall.pms.api.enums.LevelEnum; import com.dmall.pms.api.enums.PmsErrorEnum; import com.dmall.pms.generator.dataobject.CategoryDO; import com.dmall.pms.generator.mapper.CategoryMapper; import com.dmall.pms.service.impl.category.cache.CategoryCacheService; import com.dmall.pms.service.validate.PmsValidate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** * @description: 新增商品分类处理器 * @author: created by hang.yu on 2019-12-02 23:18:00 */ @Component public class SaveCategoryHandler extends AbstractCommonHandler<SaveCategoryRequestDTO, CategoryDO, Long> { @Autowired private CategoryMapper categoryMapper; @Autowired private CategoryCacheService categoryCacheService; @Autowired private PmsValidate pmsValidate; @Override public BaseResult<Long> validate(SaveCategoryRequestDTO requestDTO) { if (requestDTO.getParentId() != 0) { CategoryDO parentCategoryDO = pmsValidate.validateCategory(requestDTO.getParentId()); // 上级id是否存在 if (parentCategoryDO == null) { return ResultUtil.fail(PmsErrorEnum.PARENT_CATEGORY_NOT_EXIST); } // 分类级别要小于上级 if (requestDTO.getLevel() <= parentCategoryDO.getLevel()) { return ResultUtil.fail(PmsErrorEnum.PARENT_LEVEL_ERROR); } } // 当ParentId=0时 level必须为1 if (requestDTO.getParentId() == 0 && !LevelEnum.ONE.getCode().equals(requestDTO.getLevel())) { return ResultUtil.fail(PmsErrorEnum.PARENT_LEVEL_ERROR); } return ResultUtil.success(); } @Override public BaseResult<Long> processor(SaveCategoryRequestDTO requestDTO) { CategoryDO categoryDO = dtoConvertDo(requestDTO, CategoryDO.class); categoryCacheService.insert(categoryDO); categoryCacheService.updateById(setPath(categoryDO)); return ResultUtil.success(categoryDO.getId()); } /** * 设置path */ private CategoryDO setPath(CategoryDO result) { CategoryDO categoryDO = new CategoryDO(); StringBuilder path = new StringBuilder(); if (result.getLevel() == 1) { path.append(StrUtil.DOT).append(result.getId()).append(StrUtil.DOT); // 2,3级别一致 } else { CategoryDO parentCategoryDO = categoryMapper.selectById(result.getParentId()); path.append(parentCategoryDO.getPath()).append(result.getId()).append(StrUtil.DOT); } categoryDO.setPath(path.toString()); categoryDO.setId(result.getId()); return categoryDO; } }
[ "649411629@qq.com" ]
649411629@qq.com
71f7be3b6c9091077cc8eebc928f4d282a6f4f25
835c5e5a428465a1bb14aa2922dd8bf9d1f83648
/bitcamp-java/src/main/java/com/eomcs/oop/ex05/g/B.java
376329d36db5d0eb9561751800199562e9d17028
[]
no_license
juneglee/bitcamp-study
cc1de00c3e698db089d0de08488288fb86550260
605bddb266510109fb78ba440066af3380b25ef1
refs/heads/master
2020-09-23T13:00:46.749867
2020-09-18T14:26:39
2020-09-18T14:26:39
225,505,347
0
0
null
null
null
null
UTF-8
Java
false
false
685
java
package com.eomcs.oop.ex05.g; public class B extends A { int v2; B() { // 수퍼 클래스의 어떤 생성자를 호출할지 지정하지 않으면 컴파일러는 // 다음과 같이 수퍼 클래스의 기본 생성자를 호출하라는 명령을 붙인다. // 해결 방법? // => 개발자가 직접 수퍼 클래스에 있는 생성자를 호출하라! //super(); // 만약 수퍼 클래스에 기본 생성자가 없으면 컴파일 오류가 발생한다! super(100); // 기본생성자가 아닌 파라미터가 있는 메서드인 경우에는 super를 정의해줘야 한다 System.out.println("B() 생성자!"); } }
[ "klcpop1@example.com" ]
klcpop1@example.com
626676721c7875832bfd208f3a01b4a0d64cac21
2efb7173445a829835409fabefe0ee3504423ee9
/ph-graph/src/test/java/com/helger/graph/impl/GraphObjectIDFactoryTest.java
f854a228760ad257b75d020fd51272ac47925665
[ "Apache-2.0" ]
permissive
phax/ph-commons
207f6d6be4b004a3decea7d40967270cd604909d
f6798b311d9ad7dbda7717f1216145dbb2bc785a
refs/heads/master
2023-08-28T01:01:56.141949
2023-08-22T12:51:40
2023-08-22T12:51:40
23,062,279
35
15
Apache-2.0
2023-03-29T09:58:08
2014-08-18T07:21:36
Java
UTF-8
Java
false
false
1,558
java
/* * Copyright (C) 2014-2023 Philip Helger (www.helger.com) * philip[at]helger[dot]com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.helger.graph.impl; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import org.junit.Test; import com.helger.commons.id.factory.IIDFactory; import com.helger.commons.id.factory.StringIDFromGlobalIntIDFactory; /** * Test class for class {@link GraphObjectIDFactory}. * * @author Philip Helger */ public final class GraphObjectIDFactoryTest { @Test public void testAll () { final IIDFactory <String> aOld = GraphObjectIDFactory.getIDFactory (); assertNull (aOld); try { GraphObjectIDFactory.setIDFactory (null); assertNotNull (GraphObjectIDFactory.createNewGraphObjectID ()); GraphObjectIDFactory.setIDFactory (new StringIDFromGlobalIntIDFactory ()); assertNotNull (GraphObjectIDFactory.createNewGraphObjectID ()); } finally { GraphObjectIDFactory.setIDFactory (aOld); } } }
[ "philip@helger.com" ]
philip@helger.com
3eb6a3b78b905adafe049a4a76a72a35578fe41b
d492576b6d452f1f4bc8c4f4ffc1b054f5cc5eff
/ViewController/src/co/gov/ideam/sirh/calidad/view/PuntosMonitoreoTreeHandler.java
f10a92745b7d738757565b342868e17262a8e219
[]
no_license
Sirhv2/AppSirh
d5f3cb55e259c29e46f3e22a7d39ed7b01174c84
6074d04bc0f4deb313e7f3c73a284d51e499af4d
refs/heads/master
2021-01-15T12:04:12.129393
2016-09-16T21:09:30
2016-09-16T21:09:30
68,330,584
0
0
null
null
null
null
UTF-8
Java
false
false
1,163
java
package co.gov.ideam.sirh.calidad.view; import java.util.ArrayList; import java.util.List; import javax.swing.JPanel; import org.apache.myfaces.trinidad.component.core.data.CoreTree; import org.apache.myfaces.trinidad.model.TreeModel; public class PuntosMonitoreoTreeHandler extends JPanel { private List focusRowKey = new ArrayList(); private Object selectedNode; private TreeModel treemodel; private CoreTree jsfTree; public PuntosMonitoreoTreeHandler() { } public void setSelectedNode(Object selectedNode) { this.selectedNode = selectedNode; } public Object getSelectedNode() { return selectedNode; } public void setTreemodel(TreeModel treemodel) { this.treemodel = treemodel; } public TreeModel getTreemodel() { return treemodel; } public void setJsfTree(CoreTree jsfTree) { this.jsfTree = jsfTree; } public CoreTree getJsfTree() { return jsfTree; } public void setFocusRowKey(List focusRowKey) { this.focusRowKey = focusRowKey; } public List getFocusRowKey() { return focusRowKey; } }
[ "jfgc1394@gmail.com" ]
jfgc1394@gmail.com
49b3ca89e5a821925947a34f4115d9367e5ff90b
9f3d00d19d93df165347acdfd10548f43eb54513
/3.JavaMultithreading/src/com/javarush/task/task27/task2707/Solution.java
bfccf7657e862116c3c16c7af45ebc684e252892
[]
no_license
reset1301/javarushTasks
eebeb85e9cb35feb8aac2c96b73d7afa7bdaea67
29a8e8b08bc73f831ff182e7b04c3eb49a56c740
refs/heads/master
2018-09-28T10:01:06.772595
2018-07-09T10:33:07
2018-07-09T10:33:07
116,394,770
0
0
null
null
null
null
UTF-8
Java
false
false
2,770
java
package com.javarush.task.task27.task2707; /* Определяем порядок захвата монитора */ public class Solution { public void someMethodWithSynchronizedBlocks(Object obj1, Object obj2) throws InterruptedException { synchronized (obj1) { Thread.sleep(100); synchronized (obj2) { System.out.println(obj1 + " " + obj2); } } } public static boolean isNormalLockOrder(final Solution solution, final Object o1, final Object o2) throws Exception { //do something here Thread thread1 = new Thread(new Runnable() { @Override public void run() { synchronized (o1) { try { Thread.sleep(500); synchronized (o2) { Thread.sleep(500); } } catch (InterruptedException e) { e.printStackTrace(); } // solution.someMethodWithSynchronizedBlocks(o1, o2); } } }); // Thread thread1 = new Thread(new Runnable() { // @Override // public void run() { // synchronized (o2) { // try { // Thread.sleep(100); // } catch (InterruptedException e) { // e.printStackTrace(); // } // synchronized (o1) { // try { // solution.someMethodWithSynchronizedBlocks(o1, o2); // // Thread.sleep(1000); // } catch (InterruptedException ignored) { // } // } // } // } // } // }); Thread thread2 = new Thread(new Runnable() { @Override public void run() { try { solution.someMethodWithSynchronizedBlocks(o1, o2); } catch (InterruptedException e) { e.printStackTrace(); } } }); thread1.start(); Thread.sleep(100); thread2.start(); Thread.sleep(1000); System.out.println(thread1.getState()); System.out.println(thread2.getState()); return !thread2.getState().equals(Thread.State.BLOCKED); } public static void main(String[] args) throws Exception { final Solution solution = new Solution(); final Object o1 = new Object(); final Object o2 = new Object(); System.out.println(isNormalLockOrder(solution, o1, o2)); } }
[ "reset1301@mail.ru" ]
reset1301@mail.ru
4c744159214c0d9b966e611d04c18b8f1c48ebbd
a91fb7f0e0b470b4640e50a8b6623422c800b42b
/src/main/java/com/iss/saas/server/package-info.java
e797fe98f6ecdb350e1fafaec41f302c779041ff
[]
no_license
WallaceMao/softstoneApp
ab2a1257f46551cd9cb084fa17f796c600a355eb
104348280ac2f11f359b9bd95c87510570cc6dfd
refs/heads/master
2021-01-10T14:33:08.824763
2016-04-07T12:20:21
2016-04-07T12:20:21
54,641,387
0
0
null
null
null
null
UTF-8
Java
false
false
176
java
@javax.xml.bind.annotation.XmlSchema(namespace = "http://server.saas.iss.com", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) package com.iss.saas.server;
[ "maowenqiang0752@163.com" ]
maowenqiang0752@163.com
197234db5e63eddc3105f874ac0654b281178c18
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/XRENDERING-418-3-26-SPEA2-WeightedSum:TestLen:CallDiversity/org/xwiki/rendering/internal/wiki/XWikiWikiModel_ESTest_scaffolding.java
9e8aa47190045da6edc083729a2d8ab25e1f6a45
[]
no_license
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
cf118b23ecb87a8bf59643e42f7556b521d1f754
3bb39683f9c343b8ec94890a00b8f260d158dfe3
refs/heads/master
2022-07-29T14:44:00.774547
2020-08-10T15:14:49
2020-08-10T15:14:49
285,804,495
0
0
null
null
null
null
UTF-8
Java
false
false
452
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Mon Apr 06 11:28:50 UTC 2020 */ package org.xwiki.rendering.internal.wiki; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; @EvoSuiteClassExclude public class XWikiWikiModel_ESTest_scaffolding { // Empty scaffolding for empty test suite }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
bb2afadaaae64b366b63cf5238d8e6b672eef83c
7ab7d1c9b30a0d22bc1ba3aeae588ffc42ea17c5
/src/main/java/com/algaworks/brewer/repository/Testes.java
92d07dcb10321a25b3e30b539345725a0f602fd5
[]
no_license
RobertoAtanasio/Spring-Framework-Expert
d8b017f14d4cabc40199898af0f4b19c4b0a2330
554092aff6747efdee723251682e3372e923d70e
refs/heads/master
2022-12-07T15:09:30.452768
2019-10-08T19:31:13
2019-10-08T19:31:13
190,302,247
2
0
null
2022-11-16T12:26:14
2019-06-05T01:04:20
JavaScript
UTF-8
Java
false
false
211
java
package com.algaworks.brewer.repository; import org.springframework.data.jpa.repository.JpaRepository; import com.algaworks.brewer.model.Teste; public interface Testes extends JpaRepository<Teste, Long> { }
[ "roberto.atanasio.pl@gmail.com" ]
roberto.atanasio.pl@gmail.com
930b10fcdb394b1add0401477a8b79c704ffddda
71ec3c641b3d4bd400039a03ee4929f8cec5100f
/scorm/scorm-api/src/java/org/sakaiproject/scorm/model/api/Attempt.java
f43630d291bda60eababc629fce2fd96669369a1
[ "LicenseRef-scancode-generic-cla", "ECL-2.0", "GPL-1.0-or-later", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
NYUeServ/sakai11
f03020a82c8979e35c161e6c1273e95041f4a10e
35f04da43be735853fac37e0098e111e616f7618
refs/heads/master
2023-05-11T16:54:37.240151
2021-12-21T19:53:08
2021-12-21T19:53:08
57,332,925
3
5
ECL-2.0
2023-04-18T12:41:11
2016-04-28T20:50:33
Java
UTF-8
Java
false
false
3,366
java
package org.sakaiproject.scorm.model.api; import java.io.Serializable; import java.util.Date; import java.util.HashMap; import java.util.Map; public class Attempt implements Serializable { private static final long serialVersionUID = 1L; private Long id; private long contentPackageId; private String courseId; private String learnerId; private String learnerName; private long attemptNumber; private Date beginDate; private Date lastModifiedDate; private Map<String, Long> scoDataManagerMap; private boolean isNotExited; private boolean isSuspended; public Attempt() { this.isNotExited = true; this.isSuspended = false; this.scoDataManagerMap = new HashMap<String, Long>(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Attempt other = (Attempt) obj; if (id == null) { if (other.id != null) return false; } else if (!id.equals(other.id)) return false; return true; } public long getAttemptNumber() { return attemptNumber; } public Date getBeginDate() { return beginDate; } public long getContentPackageId() { return contentPackageId; } public String getCourseId() { return courseId; } public Long getDataManagerId(String scoId) { return scoDataManagerMap.get(scoId); } public Long getId() { return id; } public Date getLastModifiedDate() { return lastModifiedDate; } public String getLearnerId() { return learnerId; } public String getLearnerName() { return learnerName; } public boolean getNotExited() { return isNotExited; } public Map<String, Long> getScoDataManagerMap() { return scoDataManagerMap; } public boolean getSuspended() { return isSuspended; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((id == null) ? 0 : id.hashCode()); return result; } /*public long getDataManagerId() { return dataManagerId; } public void setDataManagerId(long dataManagerId) { this.dataManagerId = dataManagerId; }*/ public boolean isNotExited() { return isNotExited; } public boolean isSuspended() { return isSuspended; } public void setAttemptNumber(long attemptNumber) { this.attemptNumber = attemptNumber; } public void setBeginDate(Date beginDate) { this.beginDate = beginDate; } public void setContentPackageId(long contentPackageId) { this.contentPackageId = contentPackageId; } public void setCourseId(String courseId) { this.courseId = courseId; } public void setDataManagerId(String scoId, Long dataManagerId) { if (scoId != null) { scoDataManagerMap.put(scoId, dataManagerId); } } public void setId(Long id) { this.id = id; } public void setLastModifiedDate(Date lastModifiedDate) { this.lastModifiedDate = lastModifiedDate; } public void setLearnerId(String learnerId) { this.learnerId = learnerId; } public void setLearnerName(String learnerName) { this.learnerName = learnerName; } public void setNotExited(boolean isNotExited) { this.isNotExited = isNotExited; } public void setScoDataManagerMap(Map<String, Long> scoDataManagerMap) { this.scoDataManagerMap = scoDataManagerMap; } public void setSuspended(boolean isSuspended) { this.isSuspended = isSuspended; } }
[ "mark@dishevelled.net" ]
mark@dishevelled.net
16042670f1d59b6465c6ebf5aeb9db2806a1688c
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
/data_defect4j/preprossed_method_corpus/Math/90/org/apache/commons/math/MathRuntimeException_getLocalizedMessage_160.java
113bef807fbc30f9b509acce9acebb7cce7d3c15
[]
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
656
java
org apach common math base common math uncheck except version revis date math runtim except mathruntimeexcept runtim except runtimeexcept inherit doc inheritdoc overrid string local messag getlocalizedmessag messag getmessag local default getdefault
[ "hvdthong@gmail.com" ]
hvdthong@gmail.com
083e96bc23cc856eceaeced73d2aea7386cb5090
216f34d1d346b7363d5c1e98c5eab46f1cf17de8
/src/som/primitives/SystemPrimitives.java
d0649093a2e08de1e3ab2461c2962b069e729f7c
[ "MIT" ]
permissive
mhaupt/som-java
ee83947eb51516cbdd77d24f7834e85ce2762dbf
f5b61446ec319ec90811276006a11df4ad295b35
refs/heads/master
2021-01-01T06:08:25.690140
2017-07-22T13:48:30
2017-07-22T13:48:30
71,713,909
0
0
null
2016-10-23T16:07:20
2016-10-23T16:07:20
null
UTF-8
Java
false
false
4,530
java
/** * Copyright (c) 2009 Michael Haupt, michael.haupt@hpi.uni-potsdam.de * Software Architecture Group, Hasso Plattner Institute, Potsdam, Germany * http://www.hpi.uni-potsdam.de/swa/ * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package som.primitives; import som.interpreter.Interpreter; import som.interpreter.Frame; import som.vm.Universe; import som.vmobjects.SClass; import som.vmobjects.SInteger; import som.vmobjects.SAbstractObject; import som.vmobjects.SPrimitive; import som.vmobjects.SString; import som.vmobjects.SSymbol; public class SystemPrimitives extends Primitives { public SystemPrimitives(final Universe universe) { super(universe); } public void installPrimitives() { installInstancePrimitive(new SPrimitive("load:", universe) { public void invoke(final Frame frame, final Interpreter interpreter) { SSymbol argument = (SSymbol) frame.pop(); frame.pop(); // not required SClass result = universe.loadClass(argument); frame.push(result != null ? result : universe.nilObject); } }); installInstancePrimitive(new SPrimitive("exit:", universe) { public void invoke(final Frame frame, final Interpreter interpreter) { SInteger error = (SInteger) frame.pop(); universe.exit(error.getEmbeddedInteger()); } }); installInstancePrimitive(new SPrimitive("global:", universe) { public void invoke(final Frame frame, final Interpreter interpreter) { SSymbol argument = (SSymbol) frame.pop(); frame.pop(); // not required SAbstractObject result = universe.getGlobal(argument); frame.push(result != null ? result : universe.nilObject); } }); installInstancePrimitive(new SPrimitive("global:put:", universe) { public void invoke(final Frame frame, final Interpreter interpreter) { SAbstractObject value = frame.pop(); SSymbol argument = (SSymbol) frame.pop(); universe.setGlobal(argument, value); } }); installInstancePrimitive(new SPrimitive("printString:", universe) { public void invoke(final Frame frame, final Interpreter interpreter) { SString argument = (SString) frame.pop(); Universe.print(argument.getEmbeddedString()); } }); installInstancePrimitive(new SPrimitive("printNewline", universe) { public void invoke(final Frame frame, final Interpreter interpreter) { Universe.println(""); } }); startMicroTime = System.nanoTime() / 1000L; startTime = startMicroTime / 1000L; installInstancePrimitive(new SPrimitive("time", universe) { public void invoke(final Frame frame, final Interpreter interpreter) { frame.pop(); // ignore int time = (int) (System.currentTimeMillis() - startTime); frame.push(universe.newInteger(time)); } }); installInstancePrimitive(new SPrimitive("ticks", universe) { public void invoke(final Frame frame, final Interpreter interpreter) { frame.pop(); // ignore int time = (int) (System.nanoTime() / 1000L - startMicroTime); frame.push(universe.newInteger(time)); } }); installInstancePrimitive(new SPrimitive("fullGC", universe) { public void invoke(final Frame frame, final Interpreter interpreter) { frame.pop(); System.gc(); frame.push(universe.trueObject); } }); } private long startTime; private long startMicroTime; }
[ "git@stefan-marr.de" ]
git@stefan-marr.de
6efda397ee89f9506d413ebe704cbde0239bb2f9
13c2d3db2d49c40c74c2e6420a9cd89377f1c934
/program_data/JavaProgramData/88/1278.java
3e3d3b2e265b6119bf4a4def9f1a27cb115f1275
[ "MIT" ]
permissive
qiuchili/ggnn_graph_classification
c2090fefe11f8bf650e734442eb96996a54dc112
291ff02404555511b94a4f477c6974ebd62dcf44
refs/heads/master
2021-10-18T14:54:26.154367
2018-10-21T23:34:14
2018-10-21T23:34:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,170
java
import java.util.*; package <missing>; public class GlobalMembers { public static int Main() { int i; int len = 0; String str = new String(new char[32]); String temp = new String(new char[32]); //C++ TO JAVA CONVERTER TODO TASK: Pointer arithmetic is detected on this variable, so pointers on this variable are left unchanged: char * ptr; str = new Scanner(System.in).nextLine(); ptr = str; for (; * ptr != '\0';++ptr) { if (Character.isDigit(*ptr)) { len++; } else { //C++ TO JAVA CONVERTER TODO TASK: The memory management function 'memset' has no equivalent in Java: memset(temp,0,(Character.SIZE / Byte.SIZE)); if (len == 0) { continue; } for (i = 0;i < len;++i) { temp = tangible.StringFunctions.changeCharacter(temp, len - i - 1, *(ptr - i - 1)); } len = 0; System.out.print(Integer.parseInt(temp)); System.out.print("\n"); } } if (len != 0) { for (i = 0;i < len;++i) { temp = tangible.StringFunctions.changeCharacter(temp, len - i - 1, *(ptr - i - 1)); } System.out.print(Integer.parseInt(temp)); System.out.print("\n"); } return 0; } }
[ "y.yu@open.ac.uk" ]
y.yu@open.ac.uk
b46c06f0dd73170e3d53f1fdfc9d20ef8c680ace
561792a13784c07f6bfef2d2370709de0f27e447
/wtshop-dao/src/main/java/com/wtshop/dao/RaffleDao.java
6e5f4ec7b9dabab05a55ad2968310893fab79909
[]
no_license
523570822/wtshop
a0b1d7390a6377af2307871ae20d8e669a8c4f4b
6cfcf659babde3449df82ac57ce3b4bba5925ec4
refs/heads/master
2022-12-09T10:42:14.245989
2019-10-09T06:30:15
2019-10-09T06:30:15
139,920,178
0
1
null
2022-12-06T00:39:24
2018-07-06T01:52:39
Java
UTF-8
Java
false
false
255
java
package com.wtshop.dao; import com.wtshop.model.Activity; import com.wtshop.model.Raffle; /** * Dao - 货品 * * */ public class RaffleDao extends BaseDao<Raffle> { /** * 构造方法 */ public RaffleDao() { super(Raffle.class); } }
[ "523570822@qq.com" ]
523570822@qq.com
df43bcdfea21d745d91c3aeab025bcb2fefe45b7
fa1408365e2e3f372aa61e7d1e5ea5afcd652199
/src/testcases/CWE191_Integer_Underflow/s01/CWE191_Integer_Underflow__byte_min_multiply_53a.java
594feab5dd0f9fc3afcaea0c50d68e7c5c9f5e12
[]
no_license
bqcuong/Juliet-Test-Case
31e9c89c27bf54a07b7ba547eddd029287b2e191
e770f1c3969be76fdba5d7760e036f9ba060957d
refs/heads/master
2020-07-17T14:51:49.610703
2019-09-03T16:22:58
2019-09-03T16:22:58
206,039,578
1
2
null
null
null
null
UTF-8
Java
false
false
2,463
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE191_Integer_Underflow__byte_min_multiply_53a.java Label Definition File: CWE191_Integer_Underflow.label.xml Template File: sources-sinks-53a.tmpl.java */ /* * @description * CWE: 191 Integer Underflow * BadSource: min Set data to the max value for byte * GoodSource: A hardcoded non-zero, non-min, non-max, even number * Sinks: multiply * GoodSink: Ensure there will not be an underflow before multiplying data by 2 * BadSink : If data is negative, multiply by 2, which can cause an underflow * Flow Variant: 53 Data flow: data passed as an argument from one method through two others to a fourth; all four functions are in different classes in the same package * * */ package testcases.CWE191_Integer_Underflow.s01; import testcasesupport.*; public class CWE191_Integer_Underflow__byte_min_multiply_53a extends AbstractTestCase { public void bad() throws Throwable { byte data; /* POTENTIAL FLAW: Use the maximum size of the data type */ data = Byte.MIN_VALUE; (new CWE191_Integer_Underflow__byte_min_multiply_53b()).badSink(data ); } public void good() throws Throwable { goodG2B(); goodB2G(); } /* goodG2B() - use goodsource and badsink */ private void goodG2B() throws Throwable { byte data; /* FIX: Use a hardcoded number that won't cause underflow, overflow, divide by zero, or loss-of-precision issues */ data = 2; (new CWE191_Integer_Underflow__byte_min_multiply_53b()).goodG2BSink(data ); } /* goodB2G() - use badsource and goodsink */ private void goodB2G() throws Throwable { byte data; /* POTENTIAL FLAW: Use the maximum size of the data type */ data = Byte.MIN_VALUE; (new CWE191_Integer_Underflow__byte_min_multiply_53b()).goodB2GSink(data ); } /* Below is the main(). It is only used when building this testcase on * its own for testing or for building a binary to use in testing binary * analysis tools. It is not used when compiling all the testcases as one * application, which is how source code analysis tools are tested. */ public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException { mainFromParent(args); } }
[ "bqcuong2212@gmail.com" ]
bqcuong2212@gmail.com
b235371a9e2fb326d8378929f7122252a465d94b
92dd6bc0a9435c359593a1f9b309bb58d3e3f103
/src/geeksforgeeks/_01DataStructures_BinaryTree_21.java
cda2abdcab63688790f465b60c6b899a122f4c9d
[ "MIT" ]
permissive
darshanhs90/Java-Coding
bfb2eb84153a8a8a9429efc2833c47f6680f03f4
da76ccd7851f102712f7d8dfa4659901c5de7a76
refs/heads/master
2023-05-27T03:17:45.055811
2021-06-16T06:18:08
2021-06-16T06:18:08
36,981,580
3
3
null
null
null
null
UTF-8
Java
false
false
1,754
java
package geeksforgeeks; import geeksforgeeks._01DataStructures_BinaryTree_00.Node; /* * http://www.geeksforgeeks.org/maximum-width-of-a-binary-tree/ * Maximum width of a binary tree */; public class _01DataStructures_BinaryTree_21 { static _01DataStructures_BinaryTree_00 tree=new _01DataStructures_BinaryTree_00(); public static void main(String[] args) { _01DataStructures_BinaryTree_00 binaryTree1=new _01DataStructures_BinaryTree_00(); binaryTree1.insert(null,null,1); binaryTree1.insert(1,"left",2); binaryTree1.insert(1,"right",3); binaryTree1.insert(2,"left",4); binaryTree1.insert(2,"right",5); binaryTree1.insert(3,"right",8); binaryTree1.insert(8,"left",6); binaryTree1.insert(8,"right",7); binaryTree1.preOrder(); System.out.println(getMaxWidthLevelOrder(binaryTree1)); } private static int getHeight(Node node) { if(node==null) return 0; else { int leftHeight=getHeight(node.left); int rightHeight=getHeight(node.right); return 1+((leftHeight>rightHeight)?leftHeight:rightHeight); } } private static int getMaxWidthLevelOrder(_01DataStructures_BinaryTree_00 binaryTree1) { return getMaxWidthLevelOrder(binaryTree1.rootNode); } private static int getMaxWidthLevelOrder(Node node) { int maxWidth=0; for (int i = 1; i <= getHeight(node); i++) { int width=getWidth(node,i); if(width>maxWidth) maxWidth=width; } return maxWidth; } private static int getWidth(Node node, int level) { if(node==null) return 0; if(level==1) return 1; else if(level>1) return getWidth(node.left,level-1)+getWidth(node.right,level-1); else return 0; } }
[ "hsdars@gmail.com" ]
hsdars@gmail.com
13cbfc43f6d4f33715463eb9ee6b2d2d97a5d9ad
208ba847cec642cdf7b77cff26bdc4f30a97e795
/fg/fe/src/androidTest/java/org.wp.fe/models/CategoryNodeInstrumentationTest.java
78b95946f349172f90d664d085961c10fe5dd0d1
[]
no_license
kageiit/perf-android-large
ec7c291de9cde2f813ed6573f706a8593be7ac88
2cbd6e74837a14ae87c1c4d1d62ac3c35df9e6f8
refs/heads/master
2021-01-12T14:00:19.468063
2016-09-27T13:10:42
2016-09-27T13:10:42
69,685,305
0
0
null
2016-09-30T16:59:49
2016-09-30T16:59:48
null
UTF-8
Java
false
false
1,093
java
package org.wp.fe.models; import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.test.InstrumentationTestCase; import android.test.RenamingDelegatingContext; import org.wp.fe.TestUtils; public class CategoryNodeInstrumentationTest extends InstrumentationTestCase { protected Context testContext; protected Context targetContext; @Override protected void setUp() { // Run tests in an isolated context targetContext = new RenamingDelegatingContext(getInstrumentation().getTargetContext(), "test_"); testContext = getInstrumentation().getContext(); } public void testLoadDB_MalformedCategoryParentId() { SQLiteDatabase db = TestUtils.loadDBFromDump(targetContext, testContext, "malformed_category_parent_id.sql"); // This line failed before #36 was solved CategoryNode node = CategoryNode.createCategoryTreeFromDB(1); } public void tearDown() throws Exception { targetContext = null; testContext = null; super.tearDown(); } }
[ "cedric.champeau@gmail.com" ]
cedric.champeau@gmail.com
5e0815d5359a2254b907f58abc369256e1c9a594
6491c3a11f29a4fd36bd19561f8d5acae3ad981d
/module-template/module-produce/src/main/java/com/wjs/produce/executor/BeatService.java
6f6c69141a82fcaee39ceb3198a2a0088d6edc94
[]
no_license
wjs1989/spring-cloud-template
89c7c760b178e2005f41801479c89081ded0a1a7
2f967c15d392d9def8732154480545fc070d8294
refs/heads/master
2023-06-18T18:02:09.066094
2021-07-13T10:32:27
2021-07-13T10:32:27
289,705,639
0
0
null
null
null
null
UTF-8
Java
false
false
1,548
java
package com.wjs.produce.executor; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.concurrent.*; public class BeatService { ScheduledExecutorService es = null; public BeatService(){ es = new ScheduledThreadPoolExecutor(1, new ThreadFactory() { @Override public Thread newThread(Runnable r) { Thread thread = new Thread(r); thread.setDaemon(true); thread.setName("com.wjs.produce.executor.BateService.sender"); return thread; } }); } public void bate(BeatInfo info){ es.schedule(new BeatTask(info),5000,TimeUnit.MILLISECONDS); } class BeatTask implements Runnable{ BeatInfo beatInfo; public BeatTask(BeatInfo beatInfo) { this.beatInfo = beatInfo; } @Override public void run() { System.out.println(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))+ "->"+ Thread.currentThread().getName()+":"+beatInfo.getName()); BeatService.this.es.schedule(BeatService.this.new BeatTask(this.beatInfo),5000,TimeUnit.MILLISECONDS); } } public static void main(String[] args) throws InterruptedException { BeatService beatService = new BeatService(); BeatInfo beatInfo = new BeatInfo(); beatInfo.setName("module-kafka"); beatService.bate(beatInfo); Thread.sleep(100000); } }
[ "wenjs001@163.com" ]
wenjs001@163.com
d2030d6a701f3d87996676da90b92655b4aeeca3
19314640a5cc12c8748d70423904921dad81cefa
/open-metadata-implementation/adapters/open-connectors/repository-services-connectors/open-metadata-collection-store-connectors/igc-rest-client-library/src/main/java/org/odpi/openmetadata/adapters/repositoryservices/igc/clientlibrary/model/generated/v117/JobStageRecord.java
e709fb0a5471b631b2008e52270542013a3c2b9f
[ "Apache-2.0", "CC-BY-4.0" ]
permissive
feng-tao/egeria
4bbd6f9b319d25495675384ee516823cb11cb07f
9d83d2e2a5bb53c7d2a8afd8652cbb594611ff35
refs/heads/master
2020-04-11T09:24:48.550291
2018-12-13T15:58:01
2018-12-13T15:58:01
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,588
java
/* SPDX-License-Identifier: Apache-2.0 */ /* Copyright Contributors to the ODPi Egeria project. */ package org.odpi.openmetadata.adapters.repositoryservices.igc.clientlibrary.model.generated.v117; import org.odpi.openmetadata.adapters.repositoryservices.igc.clientlibrary.model.common.*; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Date; import java.util.ArrayList; /** * POJO for the 'job_stage_record' asset type in IGC, displayed as 'Job Stage Record' in the IGC UI. * <br><br> * (this code has been generated based on out-of-the-box IGC metadata types; * if modifications are needed, eg. to handle custom attributes, * extending from this class in your own custom class is the best approach.) */ @JsonIgnoreProperties(ignoreUnknown=true) public class JobStageRecord extends MainObject { public static final String IGC_TYPE_ID = "job_stage_record"; /** * The 'record_id_name' property, displayed as 'Record ID Name' in the IGC UI. */ protected String record_id_name; /** * The 'a_xmeta_locking_root' property, displayed as 'A XMeta Locking Root' in the IGC UI. */ protected String a_xmeta_locking_root; /** * The 'other_records_initialization_flag' property, displayed as 'Other Records Initialization Flag' in the IGC UI. */ protected Number other_records_initialization_flag; /** * The 'of_ds_stage' property, displayed as 'Of DS Stage' in the IGC UI. * <br><br> * Will be a single {@link Reference} to a {@link Stage} object. */ protected Reference of_ds_stage; /** * The 'has_ds_flow_variable' property, displayed as 'Has DS Flow Variable' in the IGC UI. * <br><br> * Will be a {@link ReferenceList} of {@link DataItem} objects. */ protected ReferenceList has_ds_flow_variable; /** * The 'record_id_value' property, displayed as 'Record ID Value' in the IGC UI. */ protected String record_id_value; /** * The 'internal_id' property, displayed as 'Internal ID' in the IGC UI. */ protected String internal_id; /** * The 'record_name' property, displayed as 'Record Name' in the IGC UI. */ protected String record_name; /** * The 'record_id_name_value_relation' property, displayed as 'Record ID Name Value Relation' in the IGC UI. */ protected String record_id_name_value_relation; /** @see #record_id_name */ @JsonProperty("record_id_name") public String getRecordIdName() { return this.record_id_name; } /** @see #record_id_name */ @JsonProperty("record_id_name") public void setRecordIdName(String record_id_name) { this.record_id_name = record_id_name; } /** @see #a_xmeta_locking_root */ @JsonProperty("a_xmeta_locking_root") public String getAXmetaLockingRoot() { return this.a_xmeta_locking_root; } /** @see #a_xmeta_locking_root */ @JsonProperty("a_xmeta_locking_root") public void setAXmetaLockingRoot(String a_xmeta_locking_root) { this.a_xmeta_locking_root = a_xmeta_locking_root; } /** @see #other_records_initialization_flag */ @JsonProperty("other_records_initialization_flag") public Number getOtherRecordsInitializationFlag() { return this.other_records_initialization_flag; } /** @see #other_records_initialization_flag */ @JsonProperty("other_records_initialization_flag") public void setOtherRecordsInitializationFlag(Number other_records_initialization_flag) { this.other_records_initialization_flag = other_records_initialization_flag; } /** @see #of_ds_stage */ @JsonProperty("of_ds_stage") public Reference getOfDsStage() { return this.of_ds_stage; } /** @see #of_ds_stage */ @JsonProperty("of_ds_stage") public void setOfDsStage(Reference of_ds_stage) { this.of_ds_stage = of_ds_stage; } /** @see #has_ds_flow_variable */ @JsonProperty("has_ds_flow_variable") public ReferenceList getHasDsFlowVariable() { return this.has_ds_flow_variable; } /** @see #has_ds_flow_variable */ @JsonProperty("has_ds_flow_variable") public void setHasDsFlowVariable(ReferenceList has_ds_flow_variable) { this.has_ds_flow_variable = has_ds_flow_variable; } /** @see #record_id_value */ @JsonProperty("record_id_value") public String getRecordIdValue() { return this.record_id_value; } /** @see #record_id_value */ @JsonProperty("record_id_value") public void setRecordIdValue(String record_id_value) { this.record_id_value = record_id_value; } /** @see #internal_id */ @JsonProperty("internal_id") public String getInternalId() { return this.internal_id; } /** @see #internal_id */ @JsonProperty("internal_id") public void setInternalId(String internal_id) { this.internal_id = internal_id; } /** @see #record_name */ @JsonProperty("record_name") public String getRecordName() { return this.record_name; } /** @see #record_name */ @JsonProperty("record_name") public void setRecordName(String record_name) { this.record_name = record_name; } /** @see #record_id_name_value_relation */ @JsonProperty("record_id_name_value_relation") public String getRecordIdNameValueRelation() { return this.record_id_name_value_relation; } /** @see #record_id_name_value_relation */ @JsonProperty("record_id_name_value_relation") public void setRecordIdNameValueRelation(String record_id_name_value_relation) { this.record_id_name_value_relation = record_id_name_value_relation; } public static final Boolean isJobStageRecord(Object obj) { return (obj.getClass() == JobStageRecord.class); } }
[ "chris@thegrotes.net" ]
chris@thegrotes.net
56e8cca218a2c8fe3b07f6e46637fb15b06f47c6
53d677a55e4ece8883526738f1c9d00fa6560ff7
/com/google/android/gms/tasks/zzl.java
65561c0c523e8b51f8fc3a16ff51eb95c6cf6c48
[]
no_license
0jinxing/wechat-apk-source
544c2d79bfc10261eb36389c1edfdf553d8f312a
f75eefd87e9b9ecf2f76fc6d48dbba8e24afcf3d
refs/heads/master
2020-06-07T20:06:03.580028
2019-06-21T09:17:26
2019-06-21T09:17:26
193,069,132
9
4
null
null
null
null
UTF-8
Java
false
false
669
java
package com.google.android.gms.tasks; import com.tencent.matrix.trace.core.AppMethodBeat; final class zzl implements Runnable { zzl(zzk paramzzk, Task paramTask) { } public final void run() { AppMethodBeat.i(57398); synchronized (zzk.zza(this.zzafv)) { if (zzk.zzb(this.zzafv) != null) zzk.zzb(this.zzafv).onFailure(this.zzafn.getException()); AppMethodBeat.o(57398); return; } } } /* Location: C:\Users\Lin\Downloads\dex-tools-2.1-SNAPSHOT\dex-tools-2.1-SNAPSHOT\classes-dex2jar.jar * Qualified Name: com.google.android.gms.tasks.zzl * JD-Core Version: 0.6.2 */
[ "172601673@qq.com" ]
172601673@qq.com
ab553d75b5a2001578037e3ee82d3dbb9333148f
7569f9a68ea0ad651b39086ee549119de6d8af36
/cocoon-2.1.9/src/blocks/portal/java/org/apache/cocoon/portal/tools/PortalToolBuilder.java
b02983857008d65b86ca13f0f4b61c9969656f2b
[ "Apache-2.0" ]
permissive
tpso-src/cocoon
844357890f8565c4e7852d2459668ab875c3be39
f590cca695fd9930fbb98d86ae5f40afe399c6c2
refs/heads/master
2021-01-10T02:45:37.533684
2015-07-29T18:47:11
2015-07-29T18:47:11
44,549,791
0
0
null
null
null
null
UTF-8
Java
false
false
2,732
java
/* * Copyright 1999-2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.cocoon.portal.tools; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import org.apache.avalon.framework.configuration.Configuration; import org.apache.avalon.framework.configuration.ConfigurationException; import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder; import org.xml.sax.SAXException; /** * * @version CVS $Id: PortalToolBuilder.java 149055 2005-01-29 18:21:34Z cziegeler $ */ public class PortalToolBuilder { public PortalTool buildTool(File confFile, String rootDir, String pluginDir, String i18nDir) { PortalTool pTool = null; try { DefaultConfigurationBuilder dcb = new DefaultConfigurationBuilder(); Configuration conf = dcb.buildFromFile(confFile); String toolName = conf.getAttribute("name"); String toolId = conf.getAttribute("id"); HashMap functions = new HashMap(); ArrayList i18n = new ArrayList(); Configuration[] funcs = conf.getChild("functions").getChildren(); for(int i = 0; i < funcs.length; i++) { PortalToolFunction ptf = new PortalToolFunction(); ptf.setName(funcs[i].getAttribute("name")); ptf.setFunction(funcs[i].getAttribute("pipeline")); ptf.setId(funcs[i].getAttribute("id")); ptf.setInternal(new Boolean(funcs[i].getAttribute("internal", "false")).booleanValue()); functions.put(ptf.getName(), ptf); } Configuration[] i18ns = conf.getChild("i18n").getChildren(); for(int i = 0; i < i18ns.length; i++) { PortalToolCatalogue ptc = new PortalToolCatalogue(); ptc.setId(i18ns[i].getAttribute("id")); ptc.setLocation(rootDir + pluginDir + toolId + "/" + i18nDir); ptc.setName(i18ns[i].getAttribute("name")); i18n.add(ptc); } pTool = new PortalTool(toolName, toolId, functions, i18n); } catch (ConfigurationException ece) { // TODO } catch (SAXException esax) { // TODO } catch (IOException eio) { // TODO } return pTool; } }
[ "ms@tpso.com" ]
ms@tpso.com
f4116e3337ccf5f0c3f07ce55d70eb25d5db7e4b
53d677a55e4ece8883526738f1c9d00fa6560ff7
/com/tencent/mm/g/a/nt$a.java
220f2a1d8a744409a5775cc745653553c0204172
[]
no_license
0jinxing/wechat-apk-source
544c2d79bfc10261eb36389c1edfdf553d8f312a
f75eefd87e9b9ecf2f76fc6d48dbba8e24afcf3d
refs/heads/master
2020-06-07T20:06:03.580028
2019-06-21T09:17:26
2019-06-21T09:17:26
193,069,132
9
4
null
null
null
null
UTF-8
Java
false
false
886
java
package com.tencent.mm.g.a; import android.content.Context; import com.tencent.mm.protocal.b.a.d; import com.tencent.mm.protocal.protobuf.aar; import com.tencent.mm.protocal.protobuf.abf; import com.tencent.mm.storage.bi; import java.util.List; public final class nt$a { public String cAN; public aar cAv; public cl cJy; public String cKa; public abf cKb; public int cKc = 0; public bi cKd; public List<bi> cKe; public String cKf; public String cKg; public d cKh; public Context context; public long cvx = 0L; public String desc; public String thumbPath; public String title; public String toUser; public int type = 0; } /* Location: C:\Users\Lin\Downloads\dex-tools-2.1-SNAPSHOT\dex-tools-2.1-SNAPSHOT\classes7-dex2jar.jar * Qualified Name: com.tencent.mm.g.a.nt.a * JD-Core Version: 0.6.2 */
[ "172601673@qq.com" ]
172601673@qq.com
8043d26b0ee2cf4b25dd101ae3ee11428bd021b5
297d94988a89455f9a9f113bfa107f3314d21f51
/trade-biz/src/main/java/com/hbc/api/trade/order/service/deliver/conf/ConflictFlag.java
41234c7f831a399e018acb035d4f20b6be97e1f0
[]
no_license
whyoyyx/trade
408e86aba9a0d09aa5397eef194d346169ff15cc
9d3f30fafca42036385280541e31eb38d2145e03
refs/heads/master
2020-12-28T19:11:46.342249
2016-01-15T03:29:44
2016-01-15T03:29:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
582
java
/** * @Author lukangle * @2015年11月10日@下午2:04:17 */ package com.hbc.api.trade.order.service.deliver.conf; public enum ConflictFlag { /** 1: 接机 */ OPEN(1, "开启"), /** 3: 日租 */ CLOSED(2, "关闭"), ; public int value; public String name; ConflictFlag(int value, String name) { this.value = value; this.name = name; } public static ConflictFlag getType(int value) { ConflictFlag[] otypes = ConflictFlag.values(); for (ConflictFlag orderType : otypes) { if (orderType.value == value) { return orderType; } } throw null; } }
[ "fuyongtian@huangbaoche.com" ]
fuyongtian@huangbaoche.com
96c310f3afd6ce3d3a820c94e689c896b1a43d17
0954505eb1859a04badcebec50a9780bf8ac3cc3
/soul-common/src/main/java/org/dromara/soul/common/enums/WafEnum.java
8b4aad298f6c65cc936ffc3e241f70b112e9d332
[ "Apache-2.0" ]
permissive
zkstudio/soul
22eddf2f21baffe7a1e7f23d2ea4ee10abd24bd7
fa5e56521d605680782f55e3fe017fe52ae6dc73
refs/heads/master
2020-12-05T19:49:49.262405
2020-08-17T05:32:32
2020-08-17T05:32:32
232,229,291
1
0
Apache-2.0
2020-08-17T05:32:34
2020-01-07T02:49:33
null
UTF-8
Java
false
false
1,225
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.dromara.soul.common.enums; import lombok.Getter; import lombok.RequiredArgsConstructor; /** * WafEnum. * * @author xiaoyu(Myth) */ @RequiredArgsConstructor @Getter public enum WafEnum { /** * Reject waf enum. */ REJECT(0, "reject"), /** * Allow waf enum. */ ALLOW(1, "allow"); private final int code; private final String name; }
[ "549477611@qq.com" ]
549477611@qq.com
ceeb37a7ef893de06fffd54a4c57790a4f26f353
e60d7652bacb7a2cff2c40f60b5544b2fb9aab10
/target/generated-sources/entity-codegen/extensions/pc/internal/domain/policy/impl/WCRatingStepExtInternal.java
f25aa2a9d3aa3da0fb153db1f6ff1d717c187522
[]
no_license
ezsaidi/configuration
19fa3bf70982529e5cdf5d7f3d99eb7b0d7971d5
e22a485d1f5376005c72fd073a474fa685fcf6a6
refs/heads/master
2022-04-12T05:15:58.490259
2018-07-11T00:18:50
2018-07-11T00:18:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
289
java
package extensions.pc.internal.domain.policy.impl; import extensions.pc.internal.domain.policy.gen.WCRatingStepExtInternalStubI; import extensions.pc.policy.entity.WCRatingStepExt; public interface WCRatingStepExtInternal extends WCRatingStepExtInternalStubI, WCRatingStepExt { }
[ "riteshvishu@hotmail.com" ]
riteshvishu@hotmail.com
428b167d69ca5ebb90c7d7ed3023d071efe8ef3a
2f7ecc75bc13ef9e49ca1994a84c4400053b08c9
/src/com/javarush/test/level08/lesson11/bonus02/Solution.java
98ce35a8fb622d08ebdf3567e2cadeeeaaf1b1d0
[]
no_license
BogdanKartawcew/JavaRushHomeWork
d47574392db5c4720245dec08d8ea0b896138402
70bf310ed564293c1855a2650197bff74dce2271
refs/heads/master
2021-01-01T20:22:06.234055
2018-01-30T19:58:33
2018-01-30T19:58:33
80,110,449
1
0
null
null
null
null
UTF-8
Java
false
false
1,568
java
package com.javarush.test.level08.lesson11.bonus02; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; /* Нужно добавить в программу новую функциональность Задача: Программа определяет, какая семья (фамилию) живёт в доме с указанным номером. Новая задача: Программа должна работать не с номерами домов, а с городами: Пример ввода: Москва Ивановы Киев Петровы Лондон Абрамовичи Лондон Пример вывода: Абрамовичи */ public class Solution { public static void main(String[] args) throws IOException {BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); HashMap<String, String> map = new HashMap<String, String>(); while (true) { String city = reader.readLine(); if (city.equals(""))break; String lastname = reader.readLine(); if (lastname.equals("")) break; else { map.put(city, lastname); } } String vvid = reader.readLine(); for(Map.Entry<String, String> pair : map.entrySet()){ if(vvid.equals(pair.getKey())) System.out.println(pair.getValue()); else continue; } } }
[ "kartawcew.b@gmail.com" ]
kartawcew.b@gmail.com
8a7069c45ff8baa2f07442ce6025fb4ff6cdecab
ae9efe033a18c3d4a0915bceda7be2b3b00ae571
/jambeth/jambeth-log/src/main/java/com/koch/ambeth/log/LogLevel.java
6753717e2b04e2babb229391b4e0119b3a5719d5
[ "Apache-2.0" ]
permissive
Dennis-Koch/ambeth
0902d321ccd15f6dc62ebb5e245e18187b913165
8552b210b8b37d3d8f66bdac2e094bf23c8b5fda
refs/heads/develop
2022-11-10T00:40:00.744551
2017-10-27T05:35:20
2017-10-27T05:35:20
88,013,592
0
4
Apache-2.0
2022-09-22T18:02:18
2017-04-12T05:36:00
Java
UTF-8
Java
false
false
707
java
package com.koch.ambeth.log; /*- * #%L * jambeth-log * %% * Copyright (C) 2017 Koch Softwaredevelopment * %% * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. * #L% */ public enum LogLevel { DEBUG, INFO, WARN, ERROR; }
[ "dennis.koch@bruker.com" ]
dennis.koch@bruker.com
0cdf3560c8f78cff87f3db5f094cefa089871034
31a6d75a765fb46e6c743f53343eadf02effc693
/modules/opla-core/src/main/java/jmetal4/metrics/concernDrivenMetrics/concernDiffusion/CDAClass.java
7c9cb043e718aeb5e7a9fc5bfd44d9d1139532bc
[]
no_license
LucianeBaldo/OPLA-Tool
9db5a2700f90356aedd7549b0ed0b206c4bb7415
f2c2647b0d1661a8517af33e66fae1168e92a14e
refs/heads/master
2020-04-30T16:00:07.482041
2020-03-13T00:02:54
2020-03-13T00:02:54
176,936,365
1
0
null
2020-03-05T16:07:58
2019-03-21T12:04:18
HTML
UTF-8
Java
false
false
467
java
package jmetal4.metrics.concernDrivenMetrics.concernDiffusion; import arquitetura.representation.Architecture; import arquitetura.representation.Concern; public class CDAClass extends ConcernDiffusionMetric<CDAClassResult> { public CDAClass(Architecture architecture) { super(architecture); } @Override protected CDAClassResult getElementForConcern(Concern concern) { return new CDAClassResult(concern, getArchitecture()); } }
[ "willianmarquesfreire@gmail.com" ]
willianmarquesfreire@gmail.com
20ba1b3335072113b5874c10300001d71251fde7
fb5bfb5b4cf7a118cb858490953e69517d8060a4
/src/ch21/ex40/exercise/ReaderWriterMap.java
2eac172820a8a839fe3335146efbfa9b1fb6b607
[]
no_license
v777779/jbook
573dd1e4e3847ed51c9b6b66d2b098bf8eb58af5
09fc56a27e9aed797327f01ea955bdf1815d0d54
refs/heads/master
2021-09-19T08:14:16.299382
2018-07-25T14:03:12
2018-07-25T14:03:12
86,017,001
0
0
null
null
null
null
UTF-8
Java
false
false
1,340
java
package ch21.ex40.exercise; import lib.generate.GenRnd; import lib.generate.GenSeq; import lib.utils.MapData; import java.util.HashMap; import java.util.Map; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantReadWriteLock; /** * Vadim Voronov * Created: 14-May-17. * email: vadim.v.voronov@gmail.com */ public class ReaderWriterMap<K,V> { private HashMap<K,V> lockedMap; private ReentrantReadWriteLock lock = new ReentrantReadWriteLock(true); public ReaderWriterMap(int size) { this.lockedMap = new HashMap<K, V>((Map)MapData.get(new GenSeq.GenInt(),new GenRnd.GenInt(),size)); } public V set(K key, V value) { Lock wlock = lock.writeLock(); // новый writeLock на запись wlock.lock(); try { return lockedMap.put(key,value); } finally { wlock.unlock(); } } public V get(K key) { Lock rlock = lock.readLock(); // новый readLock на запись rlock.lock(); try { if (lock.getReadLockCount() > 1) { System.out.println(lock.getReadLockCount()); // несколько задач получают readLock() } return lockedMap.get(key); } finally { rlock.unlock(); } } }
[ "vadim.v.voronov@gmail.com" ]
vadim.v.voronov@gmail.com
71895e3e033f8738bb81fe7ab1f7ad1982a571d5
fae2d0c92ff3125d2356e78456dc2b0920304f4a
/OpenJdk/src/sun/util/resources/cldr/luy/CurrencyNames_luy.java
e6c0353df3cdb6a73b1797a9707faca75854bd6d
[]
no_license
X-gao/TestPrj
96267a7357ac18b5f8e8f2995f33d3084430ef2d
43f127baa5f16e004798248425d6dd7e386f8231
refs/heads/master
2022-12-22T16:11:39.485389
2021-05-28T02:34:48
2021-05-28T02:34:48
252,669,057
1
0
null
2022-12-06T00:45:49
2020-04-03T08:04:06
Java
UTF-8
Java
false
false
5,944
java
/* * Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code 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 * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ /* * COPYRIGHT AND PERMISSION NOTICE * * Copyright (C) 1991-2012 Unicode, Inc. All rights reserved. Distributed under * the Terms of Use in http://www.unicode.org/copyright.html. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of the Unicode data files and any associated documentation (the "Data * Files") or Unicode software and any associated documentation (the * "Software") to deal in the Data Files or Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, and/or sell copies of the Data Files or Software, and * to permit persons to whom the Data Files or Software are furnished to do so, * provided that (a) the above copyright notice(s) and this permission notice * appear with all copies of the Data Files or Software, (b) both the above * copyright notice(s) and this permission notice appear in associated * documentation, and (c) there is clear notice in each modified Data File or * in the Software as well as in the documentation associated with the Data * File(s) or Software that the data or software has been modified. * * THE DATA FILES AND SOFTWARE ARE 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 OF * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR * CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THE DATA FILES OR SOFTWARE. * * Except as contained in this notice, the name of a copyright holder shall not * be used in advertising or otherwise to promote the sale, use or other * dealings in these Data Files or Software without prior written authorization * of the copyright holder. */ package sun.util.resources.cldr.luy; import sun.util.resources.OpenListResourceBundle; public class CurrencyNames_luy extends OpenListResourceBundle { @Override protected final Object[][] getContents() { final Object[][] data = new Object[][] { { "aed", "Dirham ya Falme za Kiarabu" }, { "aoa", "Kwanza ya Angola" }, { "aud", "Dola ya Australia" }, { "bhd", "Dinari ya Bahareni" }, { "bif", "Faranga ya Burundi" }, { "bwp", "Pula ya Botswana" }, { "cad", "Dola ya Kanada" }, { "cdf", "Faranga ya Kongo" }, { "chf", "Faranga ya Uswisi" }, { "cny", "Yuan Renminbi ya China" }, { "cve", "Eskudo ya Kepuvede" }, { "djf", "Faranga ya Jibuti" }, { "dzd", "Dinari ya Aljeria" }, { "egp", "Pauni ya Misri" }, { "ern", "Nakfa ya Eritrea" }, { "etb", "Bir ya Uhabeshi" }, { "eur", "Yuro" }, { "gbp", "Pauni ya Uingereza" }, { "ghc", "Sedi ya Ghana" }, { "gmd", "Dalasi ya Gambia" }, { "gns", "Faranga ya Gine" }, { "inr", "Rupia ya India" }, { "jpy", "Sarafu ya Kijapani" }, { "kes", "Sirinji ya Kenya" }, { "kmf", "Faranga ya Komoro" }, { "lrd", "Dola ya Liberia" }, { "lsl", "Loti ya Lesoto" }, { "lyd", "Dinari ya Libya" }, { "mad", "Dirham ya Moroko" }, { "mga", "Ariary ya Bukini" }, { "mro", "Ugwiya ya Moritania" }, { "mur", "Rupia ya Morisi" }, { "mwk", "Kwacha ya Malawi" }, { "mzm", "Metikali ya Msumbiji" }, { "nad", "Dola ya Namibia" }, { "ngn", "Naira ya Nijeria" }, { "rwf", "Faranga ya Rwanda" }, { "sar", "Riyal ya Saudia" }, { "scr", "Rupia ya Shelisheli" }, { "sdg", "Pauni ya Sudani" }, { "shp", "Pauni ya Santahelena" }, { "sll", "Leoni" }, { "sos", "Shilingi ya Somalia" }, { "std", "Dobra ya Sao Tome na Principe" }, { "szl", "Lilangeni" }, { "tnd", "Dinari ya Tunisia" }, { "tzs", "Sirinji ya Tanzania" }, { "ugx", "Sirinji ya Uganda" }, { "usd", "Dola ya Marekani" }, { "xaf", "Faranga CFA BEAC" }, { "xof", "Faranga CFA BCEAO" }, { "zar", "Randi ya Afrika Kusini" }, { "zmk", "Kwacha ya Zambia" }, { "zwd", "Dola ya Zimbabwe" }, }; return data; } }
[ "1628803713@qq.com" ]
1628803713@qq.com
4f0d738a377dcfa6c87717afb2b0f463055403b5
91f9b7b4b569bd4dc40b22909c91381f09483dd8
/src/br/com/diego/financialmobile/domain/Categoria.java
184d8b3d66681c5949cf6401c4bc84d8ee823556
[]
no_license
dfsilva/droidfinancialmobile
308922b833c2022027534e58ad957be298a15267
3599c944b4177c1c1e29b367eaadfb88f41e6b35
refs/heads/master
2021-01-20T04:32:20.140009
2011-07-21T01:19:03
2011-07-21T01:19:03
2,081,251
0
0
null
null
null
null
UTF-8
Java
false
false
1,252
java
package br.com.diego.financialmobile.domain; import java.util.ArrayList; import java.util.List; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; public class Categoria { public static final String[] COLUNAS = new String[] { Categoria.ID_CATEGORIA, Categoria.DESC_CATEGORIA }; public static final String ID_CATEGORIA = "idCategoria"; public static final String DESC_CATEGORIA = "descCategoria"; public int idCategoria; public String descCategoria; public Categoria() { } public static List<Categoria> fromJsonArray(JSONArray arr) { List<Categoria> retorno = new ArrayList<Categoria>(); if (arr != null) { for (int i = 0; i < arr.length(); i++) { try { retorno.add(fromJsonObject(arr.getJSONObject(i))); } catch (JSONException e) { // do nothing } } } return retorno; } public static Categoria fromJsonObject(JSONObject obj) { Categoria retorno = new Categoria(); if (obj != null) { try { retorno.idCategoria = obj.getInt("idCategoria"); retorno.descCategoria = obj.getString("descCategoria"); } catch (Exception e) { // do nothing } } return retorno; } @Override public String toString() { return this.descCategoria; } }
[ "diegosiuniube@gmail.com" ]
diegosiuniube@gmail.com
750966272b4b7ae1284506efe4d75e5d6aabcc43
f1ffd11f81393fc626c9789a92154953b96f788d
/org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/thymeleaf/ThymeleafMessageResolver.java
793fce441817c51655cda9df7aa07ac6a7949266
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-fujion-exception-to-apache-2.0" ]
permissive
carewebframework/carewebframework-core
4358a7c7d1daa06874aa779ebc0961ae7467966f
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
refs/heads/master
2020-04-03T20:51:52.574637
2018-06-13T18:23:55
2018-06-13T18:23:55
8,866,638
4
4
null
2017-07-05T12:53:55
2013-03-18T23:30:59
Java
UTF-8
Java
false
false
1,687
java
/* * #%L * carewebframework * %% * Copyright (C) 2008 - 2016 Regenstrief Institute, Inc. * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * This Source Code Form is also subject to the terms of the Health-Related * Additional Disclaimer of Warranty and Limitation of Liability available at * * http://www.carewebframework.org/licensing/disclaimer. * * #L% */ package org.carewebframework.ui.thymeleaf; import org.fujion.common.Localizer; import org.thymeleaf.context.ITemplateContext; import org.thymeleaf.messageresolver.AbstractMessageResolver; /** * Allow Thymeleaf templates to resolve externalized messages. */ public class ThymeleafMessageResolver extends AbstractMessageResolver { @Override public String createAbsentMessageRepresentation(ITemplateContext context, Class<?> origin, String key, Object[] messageParameters) { return null; } @Override public String resolveMessage(ITemplateContext context, Class<?> origin, String key, Object[] messageParameters) { return Localizer.getMessage(key, context.getLocale(), messageParameters); } }
[ "dkmartin@regenstrief.org" ]
dkmartin@regenstrief.org
0810f7aaa41277096f8c0c283edb48cccf9022ee
00b6bc21cbf45ab58a53a35ee8c08046b94fcbcd
/jOOX/src/test/java/org/joox/test/Customer.java
0e2d63d23563b84cbddc18c72ff6fc2dfbfe8e4d
[ "Apache-2.0" ]
permissive
xlee00/jOOX
5df70e0abf314a5f3288ab769b0d4fcc5548de58
aee98f273d8f63b7a85f88b3df6d2f6ea0e3b23a
refs/heads/master
2021-01-11T21:40:48.329709
2016-10-21T14:37:56
2016-10-21T14:37:56
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,493
java
/* * Copyright (c) 2011-2016, Data Geekery GmbH (http://www.datageekery.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.joox.test; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; /** * @author Lukas Eder */ @XmlRootElement public class Customer { String name; int age; int id; public String getName() { return name; } @XmlElement public void setName(String name) { this.name = name; } public int getAge() { return age; } @XmlElement public void setAge(int age) { this.age = age; } public int getId() { return id; } @XmlAttribute public void setId(int id) { this.id = id; } // ------------------------------------------------------------------------ // Eclipse-generated hashCode() and equals() methods // ------------------------------------------------------------------------ @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + age; result = prime * result + id; result = prime * result + ((name == null) ? 0 : name.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Customer other = (Customer) obj; if (age != other.age) return false; if (id != other.id) return false; if (name == null) { if (other.name != null) return false; } else if (!name.equals(other.name)) return false; return true; } }
[ "lukas.eder@gmail.com" ]
lukas.eder@gmail.com
9b3f41f16fa76841829d2601f5318ade57842892
fb60413b02cdf8a5c38d24b033d2900832ba9f19
/log_server/src/com/pwrd/war/logserver/telnet/TelnetIoHandler.java
dae87e5348cfd2241d6927732d5294544f42dc3d
[]
no_license
tommyadan/webgame
4729fc44617b9f104e0084d41763d98b3068f394
2117929e143e7498e524305ed529c4ee09163474
refs/heads/master
2021-05-27T04:59:34.506955
2012-08-20T14:30:07
2012-08-20T14:30:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,419
java
package com.pwrd.war.logserver.telnet; import java.util.HashMap; import java.util.Map; import org.apache.mina.common.IdleStatus; import org.apache.mina.common.IoHandlerAdapter; import org.apache.mina.common.IoSession; import org.apache.mina.common.TransportType; import org.apache.mina.transport.socket.nio.SocketSessionConfig; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.pwrd.war.logserver.telnet.command.AbstractTelnetCommand; /** * Telnet协议处理 * * */ public class TelnetIoHandler extends IoHandlerAdapter { private static final Logger logger = LoggerFactory.getLogger("telnet"); /** 注册Telnet命令 */ private final Map<String, AbstractTelnetCommand> commands = new HashMap<String, AbstractTelnetCommand>(); public TelnetIoHandler() { } /** * 注册命令 * * @param command */ public void register(AbstractTelnetCommand command) { if (this.commands.containsKey(command.getCommandName())) { if (logger.isWarnEnabled()) { logger.warn("The command [" + command.getCommandName() + "] has been already registed,which will be replaced."); } } this.commands.put(command.getCommandName().toUpperCase(), command); } @Override public void messageReceived(IoSession session, Object msgObject) throws Exception { final String _message = msgObject.toString().trim(); if (_message.length() == 0) { return; } final String[] msgArray = _message.split(" "); final String _cmd = msgArray[0].toUpperCase(); final AbstractTelnetCommand _command = this.commands.get(_cmd); if (_command == null) { if (logger.isWarnEnabled()) { logger.warn("No registed command [" + _cmd + "]"); } session.write("Unknown command:" + _cmd + "\r"); return; } Map<String, String> _cmdParamMap = parseParamMap(msgArray); _command.exec(_message, _cmdParamMap, session); } @Override public void messageSent(IoSession session, Object message) throws Exception { } @Override public void sessionClosed(IoSession session) throws Exception { session.setAttachment(null); } @Override public void sessionCreated(IoSession session) throws Exception { if (session.getTransportType() == TransportType.SOCKET) { ((SocketSessionConfig) session.getConfig()).setReceiveBufferSize(2048); } } @Override public void sessionIdle(IoSession session, IdleStatus status) throws Exception { } @Override public void sessionOpened(IoSession session) throws Exception { } @Override public void exceptionCaught(IoSession session, Throwable cause) throws Exception { if (logger.isErrorEnabled()) { logger.error("Exception", cause); } session.close(); } /** * 解析命令中的参数,将所有格式为[param]=[value]格式的内容,以param为key,以value为值放到到map中 * * @param commandParams * @return */ private Map<String, String> parseParamMap(String[] commandParams) { Map<String, String> map = new HashMap<String, String>(); for (int i = 1; i < commandParams.length; i++) { String _param = commandParams[i]; String[] kv = _param.split("="); if (kv != null) { if (kv.length == 2) { map.put(kv[0], kv[1]); } else { if (logger.isDebugEnabled()) { logger.debug("Skip param [" + _param + "]"); } } } } return map; } }
[ "zhutao@brunjoy.com" ]
zhutao@brunjoy.com
84b0a12884bfd70ae9cd4f13082f0555680593c6
fd5bfa0ab2e612510e3081c2a8dc23c84a7f352f
/src/main/java/com/patterns/timer/SimpleProgramaticTimer4.java
1bd12c2e78e604b3663d3a19ee46fbfaf2ab666b
[]
no_license
PavelTsekhanovich/DesignPatterns
9919a326edae630d5d00d0da9136df09864fd8a2
2aa163cb70fe457b6cc2632c147303f11b4404ec
refs/heads/master
2021-08-09T00:19:13.512266
2017-11-11T17:49:08
2017-11-11T17:49:08
109,133,148
0
0
null
null
null
null
UTF-8
Java
false
false
750
java
package com.patterns.timer; import javax.annotation.Resource; import javax.ejb.ScheduleExpression; import javax.ejb.Timeout; import javax.ejb.Timer; import javax.ejb.TimerService; import javax.ejb.TransactionAttribute; import javax.ejb.TransactionAttributeType; public class SimpleProgramaticTimer4 { @Resource TimerService timerService; public void setTimer() { ScheduleExpression expression = new ScheduleExpression(); expression.second("*/10").minute("*").hour("*"); Timer timer = timerService.createCalendarTimer(new ScheduleExpression() .second("*/10").minute("*").hour("*")); } @Timeout @TransactionAttribute(TransactionAttributeType.REQUIRED) public void performTask() { System.out.println("Simple Task performed"); } }
[ "p.tsekhanovich93@gmail.com" ]
p.tsekhanovich93@gmail.com
4d80684b9fc5c4ad05e6721a715582fbcbe131c7
40240a672f5c2454e6ed354eba9fdb897aa1b101
/jy-admin-biz/src/main/java/org/loxf/jyadmin/biz/util/TencentVideoV2.java
87f6ccc21bfdaa150752615315299dc3e25b7acf
[]
no_license
loxf/jyadmin
805a79120e985cacd01fb52fadea09638f6fffc0
cd1533de81666dc42e0d449b1e9f3e7bad3f2550
refs/heads/master
2018-09-28T01:27:34.620200
2018-02-26T14:30:49
2018-02-26T14:30:49
117,438,370
0
0
null
2018-02-26T14:30:50
2018-01-14T14:41:37
Java
UTF-8
Java
false
false
7,513
java
package org.loxf.jyadmin.biz.util; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import org.apache.commons.lang3.StringUtils; import org.loxf.jyadmin.base.constant.BaseConstant; import org.loxf.jyadmin.base.exception.BizException; import org.loxf.jyadmin.base.util.HttpsUtil; import org.loxf.jyadmin.base.util.encryption.Base64Util; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.crypto.Mac; import javax.crypto.spec.SecretKeySpec; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; import java.util.HashMap; import java.util.Random; public class TencentVideoV2 { private static Logger logger = LoggerFactory.getLogger(TencentVideoV2.class); private static final String HMAC_ALGORITHM = "HmacSHA1"; private static String cloudApiUrl = "https://vod.api.qcloud.com/v2/index.php"; private static String URL_PATH = "vod.api.qcloud.com/v2/index.php"; public static int SUCCESS = 0; private static String DeleteVodFile = "DeleteVodFile"; private static String ModifyVodInfo = "ModifyVodInfo"; public static JSONObject delVideo(String fileId){ HashMap params = getCommonParam("DeleteVodFile", "gz"); params.put("fileId", fileId); params.put("priority", 0); params.put("isFlushCdn", 1); return dealGetUrl(params); } public static JSONObject modifyVideoInfo(String fileId, String fileName){ HashMap params = getCommonParam("ModifyVodInfo", "gz"); params.put("fileId", fileId); params.put("fileName", fileName); return dealGetUrl(params); } /** * @param fileId * @param infoFilters 备选项:basicInfo(基础信息)、元信息(metaData)、加密信息(drm)、transcodeInfo(转码结果信息)、imageSpriteInfo(雪碧图信息)、snapshotByTimeOffsetInfo(指定时间点截图信息)、sampleSnapshotInfo(采样截图信息)。 * @return */ public static JSONObject queryVideoInfo(String fileId, String[] infoFilters){ HashMap params = getCommonParam("GetVideoInfo", "gz"); params.put("fileId", fileId); if(infoFilters!=null&&infoFilters.length>0) { for(int i=0; i<infoFilters.length; i++) { params.put("infoFilter."+i, infoFilters[i]); } } return dealGetUrl(params); } private static JSONObject dealGetUrl(HashMap params){ try { String reqUrl = cloudApiUrl ; reqUrl += "?" + generateSign(params, "GET", true); String result = HttpsUtil.doHttpsGet(reqUrl, null, null); logger.info("腾讯云视频请求链接:{}, 返回结果:{}", reqUrl, result); JSONObject jsonObject = JSON.parseObject(result); return jsonObject; } catch (Exception e) { logger.error("腾讯云视频处理失败", e); throw new BizException("腾讯云视频处理失败", e); } } public static String getSecretId(){ return ConfigUtil.getConfig(BaseConstant.CONFIG_TYPE_RUNTIME, "TC_VIDEO_SECRET_ID").getConfigValue(); } public static String getSecretKey(){ return ConfigUtil.getConfig(BaseConstant.CONFIG_TYPE_RUNTIME, "TC_VIDEO_SECRET_KEY").getConfigValue(); } public static String getUploadSign(String contextStr) throws InvalidKeyException, UnsupportedEncodingException, NoSuchAlgorithmException { Mac mac = Mac.getInstance(HMAC_ALGORITHM); SecretKeySpec secretKeySpec = new SecretKeySpec(TencentVideoV2.getSecretKey().getBytes("UTF-8"), mac.getAlgorithm()); mac.init(secretKeySpec); byte[] hash = mac.doFinal(contextStr.getBytes("UTF-8")); byte[] sigBuf = byteMerger(hash, contextStr.getBytes("utf8")); String strSign = Base64Util.encode(sigBuf); // strSign = strSign.replace(" ", "").replace("\n", "").replace("\r", ""); return strSign; } public static String getSign(String contextStr) throws InvalidKeyException, UnsupportedEncodingException, NoSuchAlgorithmException { Mac mac = Mac.getInstance(HMAC_ALGORITHM); SecretKeySpec secretKeySpec = new SecretKeySpec(TencentVideoV2.getSecretKey().getBytes("UTF-8"), mac.getAlgorithm()); mac.init(secretKeySpec); byte[] hash = mac.doFinal(contextStr.getBytes("UTF-8")); String strSign = Base64Util.encode(hash); return strSign; } /** * 构造云视频Sign * * @param params 参数 * @param method POST/GET * @param needParams 是否需要其他参数拼接? true:需要 false:只要签名 * @return string * @throws Exception */ public static String generateSign(HashMap<Object, Object> params, String method, boolean needParams) throws Exception { Object[] array = params.keySet().toArray(); java.util.Arrays.sort(array);// 字典序 String keyStr = ""; String keyStrEncode = ""; for (int i = 0; i < array.length; i++) { String key = array[i].toString(); String value = String.valueOf(params.get(key));// 1、“参数值” 为原始值而非url编码后的值。 key = key.replaceAll("_", ".");// 2、若输入参数的Key中包含下划线,则需要将其转换为“.” // 然后将格式化后的各个参数用"&"拼接在一起 if(StringUtils.isNotBlank(keyStr)){ keyStr += "&" + key + "=" + value; keyStrEncode += "&" + key + "=" + URLEncoder.encode(value, "utf-8"); } else { keyStr += key + "=" + value; keyStrEncode += "&" + key + "=" + URLEncoder.encode(value, "utf-8"); } } /*签名原文串的拼接规则为: 请求方法 + 请求主机 +请求路径 + ? + 请求字符串*/ String origin = method + URL_PATH + "?" + keyStr; String sign = getSign(origin); if(!needParams) { return sign; } else { // 生成的签名串并不能直接作为请求参数,需要对其进行 URL 编码。 // 如果用户的请求方法是GET,则对所有请求参数的参数值均需要做URL编码;此外,部分语言库会自动对URL进行编码,重复编码会导致签名校验失败。 return keyStrEncode + "&Signature=" + URLEncoder.encode(sign, "utf-8"); } } /** * 构造云视频Sign * * @return string * @throws Exception */ public static String generateSign(HashMap<Object, Object> params) throws Exception { return generateSign(params, "GET", false); } private static HashMap getCommonParam(String action, String region){ HashMap params = new HashMap(); params.put("Action", action); params.put("Region", region); params.put("SecretId", getSecretId()); params.put("Timestamp", System.currentTimeMillis()/1000); params.put("Nonce", new Random().nextInt(java.lang.Integer.MAX_VALUE)); return params; } static byte[] byteMerger(byte[] byte1, byte[] byte2) { byte[] byte3 = new byte[byte1.length + byte2.length]; System.arraycopy(byte1, 0, byte3, 0, byte1.length); System.arraycopy(byte2, 0, byte3, byte1.length, byte2.length); return byte3; } }
[ "myself35335@163.com" ]
myself35335@163.com
eeee51e6f1fc41ad905f070e94a10c8ff580341b
bf5cd2ad1edeb2daf92475d95a380ddc66899789
/springboot2/spring-security/src/main/java/com/microwu/cxd/controller/ValidateController.java
82dfc04784a9b693b233c02d902f01d18415fc61
[]
no_license
MarsGravitation/demo
4ca7cb8d8021bdc3924902946cc9bb533445a31e
53708b78dcf13367d20fd5c290cf446b02a73093
refs/heads/master
2022-11-27T10:17:18.130657
2022-04-26T08:02:59
2022-04-26T08:02:59
250,443,561
0
0
null
null
null
null
UTF-8
Java
false
false
1,910
java
package com.microwu.cxd.controller; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.Random; /** * Description: * * @Author: chengxudong chengxudong@microwu.com * Date: 2020/1/14 14:54 * Copyright: 北京小悟科技有限公司 http://www.microwu.com * Update History: * Author Time Content */ @RestController public class ValidateController { public static final Logger logger = LoggerFactory.getLogger(ValidateController.class); @Autowired private RedisTemplate redisTemplate; private String source = "23456789ABCDEFGHJKMNPQRSTUVWXYZ"; @GetMapping("/image") public void createImage(HttpServletRequest request, HttpServletResponse response) { String generate = generate(4, source); logger.info("图形验证码 {}", generate); redisTemplate.opsForValue().set("image", generate); } @GetMapping("/sms") public void createSms(String mobile) { String generate = generate(4, source); logger.info("短信验证码 {}", generate); redisTemplate.opsForValue().set("mobile", generate); } public static String generate(int verifySize, String sources) { int codesLen = sources.length(); Random rand = new Random(System.currentTimeMillis()); StringBuilder verifyCode = new StringBuilder(verifySize); for (int i = 0; i < verifySize; i++) { verifyCode.append(sources.charAt(rand.nextInt(codesLen - 1))); } return verifyCode.toString(); } }
[ "18435202728@163.com" ]
18435202728@163.com
2e661494603587693f6c385368bd9b4484a2e8f6
be7c20be8e396dfc15e6b3654e0e5ca04c5e0665
/platform-base/platform-common/src/main/java/com/alipay/api/request/AlipayCommerceDataMonitordataSyncRequest.java
3a4691ea1b506bfe736522940f5d7ca1fdfb00d3
[]
no_license
shuchongqj/duojifen
e465cce60ec07e060dc1859c2afc976f6a714db4
d8c0eb50b046024b55cb7d9b304f76b095051c99
refs/heads/master
2023-05-05T17:27:36.211808
2020-02-20T04:53:30
2020-02-20T04:53:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,097
java
package com.alipay.api.request; import java.util.Map; import com.alipay.api.AlipayObject; import com.alipay.api.AlipayRequest; import com.alipay.api.internal.util.AlipayHashMap; import com.alipay.api.response.AlipayCommerceDataMonitordataSyncResponse; /** * ALIPAY API: alipay.commerce.data.monitordata.sync request * * @author auto create * @since 1.0, 2017-08-23 17:12:46 */ public class AlipayCommerceDataMonitordataSyncRequest implements AlipayRequest<AlipayCommerceDataMonitordataSyncResponse> { private AlipayHashMap udfParams; // add user-defined text parameters private String apiVersion="1.0"; /** * 自助监控服务接口 */ private String bizContent; public void setBizContent(String bizContent) { this.bizContent = bizContent; } public String getBizContent() { return this.bizContent; } private String terminalType; private String terminalInfo; private String prodCode; private String notifyUrl; private String returnUrl; private boolean needEncrypt=false; private AlipayObject bizModel=null; public String getNotifyUrl() { return this.notifyUrl; } public void setNotifyUrl(String notifyUrl) { this.notifyUrl = notifyUrl; } public String getReturnUrl() { return this.returnUrl; } public void setReturnUrl(String returnUrl) { this.returnUrl = returnUrl; } public String getApiVersion() { return this.apiVersion; } public void setApiVersion(String apiVersion) { this.apiVersion = apiVersion; } public void setTerminalType(String terminalType){ this.terminalType=terminalType; } public String getTerminalType(){ return this.terminalType; } public void setTerminalInfo(String terminalInfo){ this.terminalInfo=terminalInfo; } public String getTerminalInfo(){ return this.terminalInfo; } public void setProdCode(String prodCode) { this.prodCode=prodCode; } public String getProdCode() { return this.prodCode; } public String getApiMethodName() { return "alipay.commerce.data.monitordata.sync"; } public Map<String, String> getTextParams() { AlipayHashMap txtParams = new AlipayHashMap(); txtParams.put("biz_content", this.bizContent); if(udfParams != null) { txtParams.putAll(this.udfParams); } return txtParams; } public void putOtherTextParam(String key, String value) { if(this.udfParams == null) { this.udfParams = new AlipayHashMap(); } this.udfParams.put(key, value); } public Class<AlipayCommerceDataMonitordataSyncResponse> getResponseClass() { return AlipayCommerceDataMonitordataSyncResponse.class; } public boolean isNeedEncrypt() { return this.needEncrypt; } public void setNeedEncrypt(boolean needEncrypt) { this.needEncrypt=needEncrypt; } public AlipayObject getBizModel() { return this.bizModel; } public void setBizModel(AlipayObject bizModel) { this.bizModel=bizModel; } }
[ "softopensell@outlook.com" ]
softopensell@outlook.com
6a81ba2bdfc6be677711d31ee04246bf7e828afc
ee17edc7902291e44caf3ddbba86d209e3409681
/src/blur-mapred/src/main/java/com/nearinfinity/blur/mapreduce/lib/Utils.java
daf7d993cc905ec830bd61ed6a62f448e9a9c70b
[]
no_license
gaogen123/blur
1daf78a1b3545f5302ab08c47eb8c96f72f77469
6c6a2723a56172cc731b648c051c80e8f374e0db
refs/heads/master
2022-12-28T03:44:32.399530
2012-09-20T14:36:36
2012-09-20T14:36:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,486
java
package com.nearinfinity.blur.mapreduce.lib; import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.lucene.index.CorruptIndexException; import org.apache.lucene.index.IndexCommit; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.SegmentInfo; import org.apache.lucene.index.SegmentInfos; import org.apache.lucene.index.SegmentReader; import org.apache.lucene.store.Directory; public class Utils { // public static void main(String[] args) throws IOException { // Directory dir = FSDirectory.open(new File("/tmp/small-multi-seg-index")); // IndexCommit commit = findLatest(dir); // List<String> segments = getSegments(dir,commit); // for (String segment : segments) { // IndexReader reader = openSegmentReader(dir, commit, segment, 128); // System.out.println(segment + "=" + reader.numDocs()); // reader.close(); // } // } public static int getTermInfosIndexDivisor(Configuration conf) { return 128; } public static IndexCommit findLatest(Directory dir) throws IOException { Collection<IndexCommit> listCommits = IndexReader.listCommits(dir); if (listCommits.size() == 1) { return listCommits.iterator().next(); } throw new RuntimeException("Multiple commit points not supported yet."); } public static List<String> getSegments(Directory dir, IndexCommit commit) throws CorruptIndexException, IOException { SegmentInfos infos = new SegmentInfos(); infos.read(dir, commit.getSegmentsFileName()); List<String> result = new ArrayList<String>(); for (SegmentInfo info : infos) { result.add(info.name); } return result; } public static IndexReader openSegmentReader(Directory directory, IndexCommit commit, String segmentName, int termInfosIndexDivisor) throws CorruptIndexException, IOException { SegmentInfos infos = new SegmentInfos(); infos.read(directory, commit.getSegmentsFileName()); SegmentInfo segmentInfo = null; for (SegmentInfo info : infos) { if (segmentName.equals(info.name)) { segmentInfo = info; break; } } if (segmentInfo == null) { throw new RuntimeException("SegmentInfo for [" + segmentName + "] not found in directory [" + directory + "] for commit [" + commit + "]"); } return SegmentReader.get(true, segmentInfo, termInfosIndexDivisor); } }
[ "amccurry@gmail.com" ]
amccurry@gmail.com
b9a2f32c7f505a826f6a4d019dff6e16e56b0632
5e3235edf3de262f4d10b9e9e1fcc3bd13d6b8b1
/Code Snippet Repository/Roller/Roller788.java
f6de8ebd7337b114907408f38981abea3c4ad392
[]
no_license
saber13812002/DeepCRM
3336a244d4852a364800af3181e03e868cf6f9f5
be3e5e50e34a042d5ba7259ff5ff75c08ab32bb9
refs/heads/master
2023-03-16T00:08:06.473699
2018-04-18T05:29:50
2018-04-18T05:29:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,541
java
private boolean _jspx_meth_tiles_005finsertAttribute_005f0(javax.servlet.jsp.PageContext _jspx_page_context) throws java.lang.Throwable { javax.servlet.jsp.PageContext pageContext = _jspx_page_context; javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut(); // tiles:insertAttribute org.apache.tiles.jsp.taglib.InsertAttributeTag _jspx_th_tiles_005finsertAttribute_005f0 = (org.apache.tiles.jsp.taglib.InsertAttributeTag) _005fjspx_005ftagPool_005ftiles_005finsertAttribute_0026_005fname_005fnobody.get(org.apache.tiles.jsp.taglib.InsertAttributeTag.class); _jspx_th_tiles_005finsertAttribute_005f0.setPageContext(_jspx_page_context); _jspx_th_tiles_005finsertAttribute_005f0.setParent(null); // /WEB-INF/jsps/tiles/tiles-installpage.jsp(26,6) name = name type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null _jspx_th_tiles_005finsertAttribute_005f0.setName("head"); int _jspx_eval_tiles_005finsertAttribute_005f0 = _jspx_th_tiles_005finsertAttribute_005f0.doStartTag(); if (_jspx_th_tiles_005finsertAttribute_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) { _005fjspx_005ftagPool_005ftiles_005finsertAttribute_0026_005fname_005fnobody.reuse(_jspx_th_tiles_005finsertAttribute_005f0); return true; } _005fjspx_005ftagPool_005ftiles_005finsertAttribute_0026_005fname_005fnobody.reuse(_jspx_th_tiles_005finsertAttribute_005f0); return false; }
[ "Qing.Mi@my.cityu.edu.hk" ]
Qing.Mi@my.cityu.edu.hk
5f6ac343cff038099d2ebd38ac2cf08bdf1018ff
f2638cfa5bf899ae7bf537acece9d16d74712cc7
/upgrade/src/main/java/datetime/DurationExamples.java
1c85ab405f71bcc10a2eee6a31cb5d4b3619707c
[]
no_license
kaminski-tomasz/ocjp
3789af42601bdd5bc4418eb1ff03f137325fa6fd
13361031602342421140d22ac4c3e38960e9e186
refs/heads/master
2021-09-09T09:11:58.992151
2018-03-14T16:34:35
2018-03-14T16:34:35
29,933,486
0
1
null
null
null
null
UTF-8
Java
false
false
2,930
java
package datetime; import java.time.Duration; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.LocalTime; import java.time.temporal.ChronoUnit; public class DurationExamples { private static void print(Object obj) { System.out.println(obj); } public static void main(String[] args) { print("Constructing durations with static factories"); Duration daily = Duration.ofDays(1); print(daily); Duration hourly = Duration.ofHours(1); print(hourly); Duration everyMinute = Duration.ofMinutes(1); print(everyMinute); Duration everyTenSecond = Duration.ofSeconds(10); print(everyTenSecond); Duration everyMilli = Duration.ofMillis(1); print(everyMilli); Duration everyNano = Duration.ofNanos(1); print(everyNano); Duration duration = Duration.ofSeconds(3 * 3600 + 15 * 60 + (long)30); // PT3H15M30S print(duration); print("\nConstructing durations with ChronoUnit"); daily = Duration.of(1, ChronoUnit.DAYS); print(daily); hourly = Duration.of(1, ChronoUnit.HOURS); print(hourly); everyMinute = Duration.of(1, ChronoUnit.MINUTES); print(everyMinute); everyTenSecond = Duration.of(10, ChronoUnit.SECONDS); print(everyTenSecond); everyMilli = Duration.of(1, ChronoUnit.MILLIS); print(everyMilli); everyNano = Duration.of(1, ChronoUnit.NANOS); print(everyNano); Duration halfDay = Duration.of(1, ChronoUnit.HALF_DAYS); // 12h print(halfDay); print("\nDuration between temporal values"); LocalTime one = LocalTime.of(5, 15); LocalTime two = LocalTime.of(6, 30); LocalDate date = LocalDate.of(2016, 1, 20); print(ChronoUnit.HOURS.between(one, two)); // obcina minuty (zostawia pelne godziny) print(ChronoUnit.HOURS.between(two, one)); print(ChronoUnit.MINUTES.between(one, two)); // java.time.DateTimeException: Unable to obtain LocalTime from TemporalAccessor: // 2016-01-20 of type java.time.LocalDate // print(ChronoUnit.MINUTES.between(one, date)); print("\nAdding duration"); date = LocalDate.of(2016, 1, 20); LocalTime time = LocalTime.of(6, 15); LocalDateTime dateTime = LocalDateTime.of(date, time); Duration duration2 = Duration.ofHours(6); print(dateTime.plus(duration2)); print(time.plus(duration2)); // java.time.temporal.UnsupportedTemporalTypeException: Unsupported unit: Seconds // print(date.plus(duration2)); Duration duration3 = Duration.ofHours(23); print(dateTime.plus(duration3)); print(time.plus(duration3)); // java.time.temporal.UnsupportedTemporalTypeException: Unsupported unit: Seconds // print(date.plus(duration3)); } }
[ "kaminski.tomasz.a@gmail.com" ]
kaminski.tomasz.a@gmail.com
2b04e131b3a7101cad1bbd09b1a2b8819a2f5e90
f43504b11e935796128f07ab166e7d47a248f204
/Low_level_Problem_set_2/cache/dao/DefaultLevelCache.java
462b50e069becf54aed4996fc42aeea312dca5e7
[]
no_license
vish35/LLD
4e3b4b6a22e334e1ab69871e5ded526613bb73f8
1d8f209213f74395fc1121a5862ce2a467b09f94
refs/heads/main
2023-07-30T09:10:39.696754
2021-09-15T05:46:45
2021-09-15T05:46:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,835
java
package cache.dao; import cache.model.LevelCacheData; import cache.model.ReadResponse; /** * @author priyamvora * @created 03/05/2021 */ public class DefaultLevelCache<Key, Value> { private final LevelCacheData levelCacheData; private final CacheDao<Key, Value> cache; private DefaultLevelCache<Key, Value> next; public DefaultLevelCache(LevelCacheData levelCacheData, CacheDao<Key, Value> cache) { this.levelCacheData = levelCacheData; this.cache = cache; } public void setNext(DefaultLevelCache<Key, Value> next) { this.next = next; } public void debug() { System.out.println(cache); if (next != null) { next.debug(); } } // L1(read time, write time) -> L2 -> L3 public Integer set(Key key, Value value) { Integer currTime = 0; Value currentValue = cache.get(key); currTime += levelCacheData.getReadTime(); if (currentValue == null || !currentValue.equals(value)) { cache.put(key, value); currTime += levelCacheData.getWriteTime(); } if (next != null) { currTime += next.set(key, value); } return currTime; } public ReadResponse<Value> get(Key key) { Integer currTime = 0; Value currentValue = cache.get(key); currTime += levelCacheData.getReadTime(); if (currentValue == null) { ReadResponse<Value> readResponse = next.get(key); currTime += readResponse.getTimeTaken(); currentValue = readResponse.getValue(); if (currentValue != null) { cache.put(key, currentValue); currTime += levelCacheData.getWriteTime(); } } return new ReadResponse<>(currentValue, currTime); } }
[ "gowtkum@amazon.com" ]
gowtkum@amazon.com
2a2c343060dd2639855029eeeca146f1fbbe97e1
d12903d58056000fa6f6f5f0f37e8bb45dd45fb1
/src/main/com/steadyjack/service/LinkService.java
40ab8feb96fab8f2537eca1c2a03dd02e2a4eebf
[]
no_license
0ranges/blog
80076b3b42c53e8644c22b03da329f2d83f80402
c42cc8099a9c412b65b42a08cece0580e883a450
refs/heads/master
2020-04-16T11:37:05.657980
2019-01-13T19:16:01
2019-01-13T19:16:01
165,544,084
0
0
null
null
null
null
UTF-8
Java
false
false
875
java
package steadyjack.service; import java.util.List; import java.util.Map; import steadyjack.entity.Link; /** * title:LinkService.java * description:友情链接Service接口 * time:2017年1月16日 下午10:35:55 * author:debug-steadyjack */ public interface LinkService { /** * 添加友情链接 * @param link * @return */ public int add(Link link); /** * 修改友情链接 * @param link * @return */ public int update(Link link); /** * 查找友情链接信息 * @param map * @return */ public List<Link> list(Map<String,Object> map); /** * 获取总记录数 * @param map * @return */ public Long getTotal(Map<String,Object> map); /** * 删除友情链接 * @param id * @return */ public Integer delete(Integer id); }
[ "864160262@qq.com" ]
864160262@qq.com
3f9b10ce70f08b967a811912da744fdd86e23bea
c3445da9eff3501684f1e22dd8709d01ff414a15
/LIS/sinosoft-parents/lis-business/src/main/java_schema/com/sinosoft/lis/vschema/LITranLogSet.java
3b2532b39c11b86d0ee2bcb2d2d8ce19c3e984b3
[]
no_license
zhanght86/HSBC20171018
954403d25d24854dd426fa9224dfb578567ac212
c1095c58c0bdfa9d79668db9be4a250dd3f418c5
refs/heads/master
2021-05-07T03:30:31.905582
2017-11-08T08:54:46
2017-11-08T08:54:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,280
java
/** * Copyright (c) 2002 sinosoft Co. Ltd. * All right reserved. */ package com.sinosoft.lis.vschema; import com.sinosoft.lis.schema.LITranLogSchema; import com.sinosoft.utility.*; /* * <p>ClassName: LITranLogSet </p> * <p>Description: LITranLogSchemaSet类文件 </p> * <p>Copyright: Copyright (c) 2007</p> * <p>Company: sinosoft </p> * @Database: 泰康未整理PDM */ public class LITranLogSet extends SchemaSet { // @Method public boolean add(LITranLogSchema aSchema) { return super.add(aSchema); } public boolean add(LITranLogSet aSet) { return super.add(aSet); } public boolean remove(LITranLogSchema aSchema) { return super.remove(aSchema); } public LITranLogSchema get(int index) { LITranLogSchema tSchema = (LITranLogSchema)super.getObj(index); return tSchema; } public boolean set(int index, LITranLogSchema aSchema) { return super.set(index,aSchema); } public boolean set(LITranLogSet aSet) { return super.set(aSet); } /** * 数据打包,按 XML 格式打包,顺序参见<A href ={@docRoot}/dataStructure/tb.html#PrpLITranLog描述/A>表字段 * @return: String 返回打包后字符串 **/ public String encode() { StringBuffer strReturn = new StringBuffer(""); int n = this.size(); for (int i = 1; i <= n; i++) { LITranLogSchema aSchema = this.get(i); strReturn.append(aSchema.encode()); if( i != n ) strReturn.append(SysConst.RECORDSPLITER); } return strReturn.toString(); } /** * 数据解包 * @param: str String 打包后字符串 * @return: boolean **/ public boolean decode( String str ) { int nBeginPos = 0; int nEndPos = str.indexOf('^'); this.clear(); while( nEndPos != -1 ) { LITranLogSchema aSchema = new LITranLogSchema(); if(aSchema.decode(str.substring(nBeginPos, nEndPos))) { this.add(aSchema); nBeginPos = nEndPos + 1; nEndPos = str.indexOf('^', nEndPos + 1); } else { // @@错误处理 this.mErrors.copyAllErrors( aSchema.mErrors ); return false; } } LITranLogSchema tSchema = new LITranLogSchema(); if(tSchema.decode(str.substring(nBeginPos))) { this.add(tSchema); return true; } else { // @@错误处理 this.mErrors.copyAllErrors( tSchema.mErrors ); return false; } } }
[ "dingzansh@sinosoft.com.cn" ]
dingzansh@sinosoft.com.cn
9f3b999c7615d46a454a55a08a7d731411bd6ef9
95cd21c6bfd537886adefa1dd7e5916ca4dcf559
/net/minecraft/client/particle/ParticleExplosionHuge.java
609e34b3bee6e5819e8fcdea28ceec6d4bfe7ee9
[]
no_license
RavenLeaks/BetterCraft-src
acd3653e9259b46571e102480164d86dc75fb93f
fca1f0f3345b6b75eef038458c990726f16c7ee8
refs/heads/master
2022-10-27T23:36:27.113266
2020-06-09T15:50:17
2020-06-09T15:50:17
271,044,072
4
2
null
null
null
null
UTF-8
Java
false
false
2,531
java
/* */ package net.minecraft.client.particle; /* */ /* */ import net.minecraft.client.renderer.BufferBuilder; /* */ import net.minecraft.entity.Entity; /* */ import net.minecraft.util.EnumParticleTypes; /* */ import net.minecraft.world.World; /* */ /* */ /* */ public class ParticleExplosionHuge /* */ extends Particle /* */ { /* */ private int timeSinceStart; /* 13 */ private final int maximumTime = 8; /* */ /* */ /* */ protected ParticleExplosionHuge(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double p_i1214_8_, double p_i1214_10_, double p_i1214_12_) { /* 17 */ super(worldIn, xCoordIn, yCoordIn, zCoordIn, 0.0D, 0.0D, 0.0D); /* */ } /* */ /* */ /* */ /* */ /* */ public void renderParticle(BufferBuilder worldRendererIn, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) {} /* */ /* */ /* */ /* */ /* */ public void onUpdate() { /* 29 */ for (int i = 0; i < 6; i++) { /* */ /* 31 */ double d0 = this.posX + (this.rand.nextDouble() - this.rand.nextDouble()) * 4.0D; /* 32 */ double d1 = this.posY + (this.rand.nextDouble() - this.rand.nextDouble()) * 4.0D; /* 33 */ double d2 = this.posZ + (this.rand.nextDouble() - this.rand.nextDouble()) * 4.0D; /* 34 */ this.worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_LARGE, d0, d1, d2, (this.timeSinceStart / 8.0F), 0.0D, 0.0D, new int[0]); /* */ } /* */ /* 37 */ this.timeSinceStart++; /* */ /* 39 */ if (this.timeSinceStart == 8) /* */ { /* 41 */ setExpired(); /* */ } /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ public int getFXLayer() { /* 51 */ return 1; /* */ } /* */ /* */ public static class Factory /* */ implements IParticleFactory /* */ { /* */ public Particle createParticle(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_) { /* 58 */ return new ParticleExplosionHuge(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn); /* */ } /* */ } /* */ } /* Location: C:\Users\emlin\Desktop\BetterCraft.jar!\net\minecraft\client\particle\ParticleExplosionHuge.class * Java compiler version: 8 (52.0) * JD-Core Version: 1.1.3 */
[ "emlin2021@gmail.com" ]
emlin2021@gmail.com
278e1a38e7116e65399d708839e9e3e3970bd039
c26304a54824faa7c1b34bb7882ee7a335a8e7fb
/flink-runtime/src/test/java/org/apache/flink/runtime/jobmaster/TestingLogicalSlotBuilder.java
74b8007f97b09c6b1911553890b5b6ba85dfaff9
[ "BSD-3-Clause", "OFL-1.1", "ISC", "MIT", "Apache-2.0" ]
permissive
apache/flink
905e0709de6389fc9212a7c48a82669706c70b4a
fbef3c22757a2352145599487beb84e02aaeb389
refs/heads/master
2023-09-04T08:11:07.253750
2023-09-04T01:33:25
2023-09-04T01:33:25
20,587,599
23,573
14,781
Apache-2.0
2023-09-14T21:49:04
2014-06-07T07:00:10
Java
UTF-8
Java
false
false
3,182
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.flink.runtime.jobmaster; import org.apache.flink.runtime.clusterframework.types.AllocationID; import org.apache.flink.runtime.executiongraph.utils.SimpleAckingTaskManagerGateway; import org.apache.flink.runtime.jobmanager.slots.DummySlotOwner; import org.apache.flink.runtime.jobmanager.slots.TaskManagerGateway; import org.apache.flink.runtime.taskmanager.LocalTaskManagerLocation; import org.apache.flink.runtime.taskmanager.TaskManagerLocation; /** Builder for the {@link TestingLogicalSlot}. */ public class TestingLogicalSlotBuilder { private TaskManagerGateway taskManagerGateway = new SimpleAckingTaskManagerGateway(); private TaskManagerLocation taskManagerLocation = new LocalTaskManagerLocation(); private AllocationID allocationId = new AllocationID(); private SlotRequestId slotRequestId = new SlotRequestId(); private SlotOwner slotOwner = new DummySlotOwner(); private boolean automaticallyCompleteReleaseFuture = true; public TestingLogicalSlotBuilder setTaskManagerGateway(TaskManagerGateway taskManagerGateway) { this.taskManagerGateway = taskManagerGateway; return this; } public TestingLogicalSlotBuilder setTaskManagerLocation( TaskManagerLocation taskManagerLocation) { this.taskManagerLocation = taskManagerLocation; return this; } public TestingLogicalSlotBuilder setAllocationId(AllocationID allocationId) { this.allocationId = allocationId; return this; } public TestingLogicalSlotBuilder setSlotRequestId(SlotRequestId slotRequestId) { this.slotRequestId = slotRequestId; return this; } public TestingLogicalSlotBuilder setAutomaticallyCompleteReleaseFuture( boolean automaticallyCompleteReleaseFuture) { this.automaticallyCompleteReleaseFuture = automaticallyCompleteReleaseFuture; return this; } public TestingLogicalSlotBuilder setSlotOwner(SlotOwner slotOwner) { this.slotOwner = slotOwner; return this; } public TestingLogicalSlot createTestingLogicalSlot() { return new TestingLogicalSlot( taskManagerLocation, taskManagerGateway, allocationId, slotRequestId, automaticallyCompleteReleaseFuture, slotOwner); } }
[ "trohrmann@apache.org" ]
trohrmann@apache.org
6bce11da803531b8ba7738bece4b99261077ef11
d8772960b3b2b07dddc8a77595397cb2618ec7b0
/rhServer/src/main/java/com/rhlinkcon/controller/ReferencialSalarialController.java
7e53dc57d8521d75d9a14a95ea489fedfee7580d
[]
no_license
vctrmarques/interno-rh-sistema
c0f49a17923b5cdfaeb148c6f6da48236055cf29
7a7a5d9c36c50ec967cb40a347ec0ad3744d896e
refs/heads/main
2023-03-17T02:07:10.089496
2021-03-12T19:06:05
2021-03-12T19:06:05
347,168,924
0
1
null
null
null
null
UTF-8
Java
false
false
4,083
java
package com.rhlinkcon.controller; import java.util.List; import javax.validation.Valid; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import com.rhlinkcon.payload.generico.PagedResponse; import com.rhlinkcon.payload.referenciaSalarial.ReferenciaSalarialRequest; import com.rhlinkcon.payload.referenciaSalarial.ReferenciaSalarialResponse; import com.rhlinkcon.repository.ReferenciaSalarialRepository; import com.rhlinkcon.security.CurrentUser; import com.rhlinkcon.security.UserPrincipal; import com.rhlinkcon.service.ReferenciaSalarialService; import com.rhlinkcon.util.AppConstants; import com.rhlinkcon.util.Utils; @RestController @RequestMapping("/api") public class ReferencialSalarialController { @Autowired private ReferenciaSalarialRepository nivelSalariaRepository; @Autowired private ReferenciaSalarialService nivelSalarialService; @GetMapping("/listaNiveisSalariais") @PreAuthorize("hasAnyRole('ADMIN')") public List<ReferenciaSalarialResponse> getAllReferenciasSalariais() { return nivelSalarialService.getAllReferenciasSalariais(); } @GetMapping("/niveisSalariais") @PreAuthorize("hasAnyRole('ADMIN')") public PagedResponse<ReferenciaSalarialResponse> getAllReferenciasSalariaisPage(@CurrentUser UserPrincipal currentUser, @RequestParam(value = "page", defaultValue = AppConstants.DEFAULT_PAGE_NUMBER) int page, @RequestParam(value = "size", defaultValue = AppConstants.DEFAULT_PAGE_SIZE) int size, @RequestParam(value = "order", defaultValue = AppConstants.DEFAULT_EMPTY) String order, @RequestParam(value = "descricao", defaultValue = AppConstants.DEFAULT_EMPTY) String descricao) { return nivelSalarialService.getAllReferenciasSalariaisPage(page, size, order, descricao); } @GetMapping("/nivelSalarial/{id}") public ReferenciaSalarialResponse getNivelSalarialById(@PathVariable Long id) { return nivelSalarialService.getReferenciaSalarialById(id); } @PostMapping("/nivelSalarial") @PreAuthorize("hasAnyRole('ADMIN')") public ResponseEntity<?> createNivelSalarial(@Valid @RequestBody ReferenciaSalarialRequest referenciaSalarialRequest) { if (nivelSalariaRepository.existsByCodigo(referenciaSalarialRequest.getCodigo())) { return Utils.badRequest(false, "Este Nível Salarial já existe!"); } nivelSalarialService.createReferenciaSalarial(referenciaSalarialRequest); return Utils.created(true, "Nível Salarial criado com sucesso."); } @PutMapping("/nivelSalarial") @PreAuthorize("hasAnyRole('ADMIN')") public ResponseEntity<?> updateReferenciaSalarial(@Valid @RequestBody ReferenciaSalarialRequest nivelSalarialRequest) { if (nivelSalariaRepository.existsByCodigoAndIdNot(nivelSalarialRequest.getCodigo(), nivelSalarialRequest.getId())) { return Utils.badRequest(false, "Este Nível Salarial já existe!"); } nivelSalarialService.updateReferenciaSalarial(nivelSalarialRequest); return Utils.created(true, "Nível Salarial atualizado com sucesso."); } @DeleteMapping("/nivelSalarial/{id}") @PreAuthorize("hasAnyRole('ADMIN')") public ResponseEntity<?> deleteNivelSalarial(@PathVariable("id") Long id) { try { nivelSalarialService.deleteNivelSalarial(id); return Utils.deleted(true, "Nível Salarial deletado com sucesso."); } catch (Exception e) { return Utils.forbidden(true, "Não é possível excluir um nível salarial que possui outras informações ligadas a ele"); } } }
[ "vctmarques@gmail.com" ]
vctmarques@gmail.com
a4f10edfb309bf7df961b0febc7b40ee6e3718d0
6ce88a15d15fc2d0404243ca8415c84c8a868905
/bitcamp-java-basic/src/step23/ex02/Client3.java
f6f89495b3c62bd884c48874efaf3e804c5884d2
[]
no_license
SangKyeongLee/bitcamp
9f6992ce2f3e4425f19b0af19ce434c4864e610b
a26991752920f280f6404565db2b13a0c34ca3d9
refs/heads/master
2021-01-24T10:28:54.595759
2018-08-10T07:25:57
2018-08-10T07:25:57
123,054,474
0
0
null
null
null
null
UTF-8
Java
false
false
1,309
java
// 대기열 테스트 package step23.ex02; import java.io.PrintStream; import java.net.Socket; import java.util.Scanner; public class Client3 { public static void main(String[] args) throws Exception { Scanner keyScan = new Scanner(System.in); System.out.println("클라이언트 실행!"); keyScan.nextLine(); System.out.println("서버에 연결 요청 중..."); Socket socket = new Socket("localhost", 8888); System.out.println("서버에 연결됨!"); // 서버의 대기열에 접속 순서대로 대기한다. // 서버에서 연결이 승인되면, 비로서 입출력을 할 수 있다. PrintStream out = new PrintStream(socket.getOutputStream()); Scanner in = new Scanner(socket.getInputStream()); System.out.println("입출력 스트림 준비!"); System.out.println("서버에 데이터 전송중..."); out.println(args[0]); System.out.println("서버에 데이터 전송 완료!"); System.out.println("서버로부터 데이터 수신 중..."); System.out.println(in.nextLine()); System.out.println("서버로부터 데이터 수신 완료!"); // 자원해제 socket.close(); } }
[ "sangkyeong.lee93@gmail.com" ]
sangkyeong.lee93@gmail.com
44c99f46321c74a966876a836c822ab70a438551
dc51ccbe867a788597de7eb7f1ce473cc3926824
/src/BadSuspend.java
03d85be63e467f5d421a62be500e5cc1c41a8f3a
[]
no_license
StaticWalk/thraed
342a0355923d90c3e6e809535717b1d9a0d4c08b
b9ef7b34a31d83557d93d384f2698812f728ae5f
refs/heads/master
2021-05-11T06:00:38.763588
2018-03-05T12:30:19
2018-03-05T12:30:19
117,977,438
0
0
null
null
null
null
UTF-8
Java
false
false
698
java
/** * Created by xiongxiaoyu on 2018/1/11. */ public class BadSuspend { public static Object u=new Object(); static ChangeObjectThreader t1=new ChangeObjectThreader("t1"); static ChangeObjectThreader t2=new ChangeObjectThreader("t2"); public static class ChangeObjectThreader extends Thread{ public ChangeObjectThreader(String name){ super.setName(name); } @Override public void run(){ synchronized (u){ System.out.println("in "+getName()); Thread.currentThread().suspend(); } } } public static void main(String[] args) throws InterruptedException { t1.start(); Thread.sleep(1000); t2.start(); t1.resume(); t2.resume(); t1.join(); t2.join(); } }
[ "957400829@qq.com" ]
957400829@qq.com
4cdc16d71b984d3da78fa66f8a9f36ab73aaa4d8
3dea1a7bd0722494144fda232cd51e5fcb6ad920
/publiclibrary/src/main/java/com/library/util/volley/FastStringRequest.java
8cd89ff5e29a68e5803bba34a0adb49299f5eb25
[]
no_license
luozhimin0918/KxtPkx
59b53259fcde26f6cdfeb835bac7831ab8307516
94e4fc15f1307d10fde73891d138ab8cf9307ae9
refs/heads/master
2021-01-23T07:26:57.698708
2017-03-28T06:52:09
2017-03-28T06:52:09
86,425,236
1
0
null
null
null
null
UTF-8
Java
false
false
2,291
java
package com.library.util.volley; import com.android.volley.NetworkResponse; import com.android.volley.Request; import com.android.volley.Response; import com.android.volley.toolbox.HttpHeaderParser; import java.io.UnsupportedEncodingException; import java.lang.reflect.Method; import java.util.Map; /** * @author Mr'Dai * @date 2016/5/18 14:26 * @Title: MobileLibrary * @Package com.dxmobile.library * @Description: */ public class FastStringRequest extends Request<String> { private Response.Listener<String> mSuccessListener; private Map<String, String> mParams; public FastStringRequest(String url, Response.Listener<String> listener, Response.ErrorListener errorListener) { this(Method.GET, url, null, listener, errorListener); } public FastStringRequest(int method, String url, Map<String, String> mParams, Response.Listener<String> listener, Response.ErrorListener errorListener) { super(method, url, errorListener); this.mSuccessListener = listener; this.mParams = mParams; } @Override protected void onFinish() { super.onFinish(); mSuccessListener = null; } @Override protected Response<String> parseNetworkResponse(NetworkResponse response) { String parsed; try { parsed = new String(response.data, HttpHeaderParser.parseCharset(response.headers)); } catch (UnsupportedEncodingException e) { parsed = new String(response.data); } return Response.success(parsed, HttpHeaderParser.parseCacheHeaders(response)); } /** * Subclasses must implement this to perform delivery of the parsed * response to their listeners. The given response is guaranteed to * be non-null; responses that fail to parse are not delivered. * * @param response The parsed response returned by * {@link #parseNetworkResponse(NetworkResponse)} */ @Override protected void deliverResponse(String response) { if (mSuccessListener != null) { mSuccessListener.onResponse(response); } } @Override public Map<String, String> getParams() { return mParams; } }
[ "54543534@domain.com" ]
54543534@domain.com
c0506863f15d85b7d7398ff7a7617a25980f7642
515a2e5570c865190784cb4500c083b689ab1bae
/Lab 5 and 6 JSF Tag and Navigation/Lab 6 JSFTravel/src/java/managedBeans/LoginJSFManagedBean.java
cf84fec62d0b85d44a3350182bb0e5c044550b15
[]
no_license
JuliaChenJing/WAA
930451c81296f56be1d2f8d02adc49f92ef941bd
5d2bf53b90a4db786ee847457fc5d7d42d9c69a0
refs/heads/master
2021-01-24T02:22:00.214580
2018-05-21T02:31:21
2018-05-21T02:31:21
122,843,578
0
0
null
null
null
null
UTF-8
Java
false
false
918
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 managedBeans; import javax.faces.bean.ManagedBean; import javax.faces.bean.RequestScoped; @ManagedBean @RequestScoped public class LoginJSFManagedBean { String userId; String password; public String getUserId() { return this.userId; } public void setUserId(String userId) { this.userId = userId; } public String getPassword() { return this.password; } public void setPassword(String password) { this.password = password; } public String submit() { if (this.userId.equals("admin") && this.password.equals("admin")) { return "loginSuccess.xhtml"; } else { return "loginFailure.xhtml"; } } }
[ "juliachenjing@gmail.com" ]
juliachenjing@gmail.com
2aef027e46e4d767de83a05c1c157cf234eca253
d1f95baefdbe6393467767788fb9e710a13f4869
/src/main/java/com/alibaba/druid/sql/dialect/mysql/ast/statement/MySqlPartitionByList.java
2aff940a4fb56102e69e0025ee1a87890d1d069d
[]
no_license
jilen/druid
19cec538ba655ddde455ad7e63af45fad3ff94df
0da4c693d3e1aa3d5506089887ee013964cce0bf
refs/heads/master
2021-01-18T18:55:57.735649
2013-06-27T07:03:41
2013-06-27T07:03:41
11,017,656
9
0
null
null
null
null
UTF-8
Java
false
false
2,130
java
/* * Copyright 1999-2011 Alibaba Group Holding Ltd. * * 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.alibaba.druid.sql.dialect.mysql.ast.statement; import java.util.ArrayList; import java.util.List; import com.alibaba.druid.sql.ast.SQLExpr; import com.alibaba.druid.sql.ast.SQLName; import com.alibaba.druid.sql.dialect.mysql.visitor.MySqlASTVisitor; public class MySqlPartitionByList extends MySqlPartitioningClause { private static final long serialVersionUID = 1L; private SQLExpr expr; private List<SQLName> columns = new ArrayList<SQLName>(); private SQLExpr partitionCount; @Override public void accept0(MySqlASTVisitor visitor) { if (visitor.visit(this)) { acceptChild(visitor, expr); acceptChild(visitor, columns); acceptChild(visitor, partitionCount); acceptChild(visitor, getPartitions()); } visitor.endVisit(this); } public SQLExpr getExpr() { return expr; } public void setExpr(SQLExpr expr) { if (expr != null) { expr.setParent(this); } this.expr = expr; } public SQLExpr getPartitionCount() { return partitionCount; } public void setPartitionCount(SQLExpr partitionCount) { this.partitionCount = partitionCount; } public List<SQLName> getColumns() { return columns; } public void setColumns(List<SQLName> columns) { this.columns = columns; } }
[ "szujobs@hotmail.com" ]
szujobs@hotmail.com
565b00d73247faf8b21a4a38b54faef941bf8eb1
ba33da805c0dff98c04154661876815335beb759
/CSC176/textbook/book/ShowGridPane.java
45b1dd6debe742d191d322991fa8e8e27b3b6548
[ "OFL-1.1", "MIT", "Unlicense" ]
permissive
XiangHuang-LMC/ijava-binder
edd2eab8441a8b6de12ebcda1b160141b95f079e
4aac9e28ec62d386c908c87b927e1007834ff58a
refs/heads/master
2020-12-23T20:45:50.518280
2020-03-20T20:15:03
2020-03-20T20:15:03
237,268,296
4
0
Unlicense
2020-01-30T17:36:57
2020-01-30T17:36:56
null
UTF-8
Java
false
false
1,623
java
import javafx.application.Application; import javafx.geometry.HPos; import javafx.geometry.Insets; import javafx.geometry.Pos; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.Label; import javafx.scene.control.TextField; import javafx.scene.layout.GridPane; import javafx.stage.Stage; public class ShowGridPane extends Application { @Override // Override the start method in the Application class public void start(Stage primaryStage) { // Create a pane and set its properties GridPane pane = new GridPane(); pane.setAlignment(Pos.CENTER); pane.setPadding(new Insets(11.5, 12.5, 13.5, 14.5)); pane.setHgap(5.5); pane.setVgap(5.5); // Place nodes in the pane pane.add(new Label("First Name:"), 0, 0); pane.add(new TextField(), 1, 0); pane.add(new Label("MI:"), 0, 1); pane.add(new TextField(), 1, 1); pane.add(new Label("Last Name:"), 0, 2); pane.add(new TextField(), 1, 2); Button btAdd = new Button("Add Name"); pane.add(btAdd, 1, 3); GridPane.setHalignment(btAdd, HPos.RIGHT); // Create a scene and place it in the stage Scene scene = new Scene(pane); primaryStage.setTitle("ShowGridPane"); // Set the stage title primaryStage.setScene(scene); // Place the scene in the stage primaryStage.show(); // Display the stage } /** * The main method is only needed for the IDE with limited * JavaFX support. Not needed for running from the command line. */ public static void main(String[] args) { launch(args); } }
[ "huangxx@lemoyne.edu" ]
huangxx@lemoyne.edu
0bc56e1ab11b16b0993f8d700074c0748f952ea4
7fa9c6b0fa1d0726ae1cda0199716c811a1ea01b
/Crawler/data/MessageRepositoryTest.java
c3502d217b72110eba05d06bf5e75c15504893b8
[]
no_license
NayrozD/DD2476-Project
b0ca75799793d8ced8d4d3ba3c43c79bb84a72c0
94dfb3c0a470527b069e2e0fd9ee375787ee5532
refs/heads/master
2023-03-18T04:04:59.111664
2021-03-10T15:03:07
2021-03-10T15:03:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,073
java
3 https://raw.githubusercontent.com/mqxu/spring-boot-review/master/spring-boot-jpa/src/test/java/com/soft1851/springboot/jpa/dao/MessageRepositoryTest.java package com.soft1851.springboot.jpa.dao; import com.soft1851.springboot.jpa.model.Message; import com.soft1851.springboot.jpa.service.MessageService; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.data.domain.Example; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Sort; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Optional; @Slf4j @SpringBootTest class MessageRepositoryTest { @Autowired private MessageRepository messageRepository; @Test public void testSave() { Message message = Message.builder().msgText("软件1851").msgSummary("沉迷学习").build(); // 保存单个对象 messageRepository.save(message); List<Message> messages = new ArrayList<>(Arrays.asList( Message.builder().msgText("后端").msgSummary("SpringBoot").build(), Message.builder().msgText("前端").msgSummary("Vue.js").build(), Message.builder().msgText("移动端").msgSummary("Flutter").build())); // 保存多个 messageRepository.saveAll(messages); } @Test public void testDelete() { Message message = Message.builder().msgId(1) .msgText("软件1851").msgSummary("沉迷学习").build(); // 删除单条记录 // 根据主键删除 messageRepository.deleteById(1); // 或者参数为对象,根据主键删除 messageRepository.delete(message); // 删除集合 message = Message.builder().msgId(5) .msgText("Monday").msgSummary("study").build(); List<Message> messages = new ArrayList<>(); messages.add(message); message = Message.builder().msgId(6) .msgText("Tuesday").msgSummary("study").build(); messages.add(message); // 删除集合:一条一条删除 messageRepository.deleteAll(messages); // 删除集合:一条 sql,拼接 or语句 messageRepository.deleteInBatch(messages); // 删除全部 // 删除所有:先findAll,然后一条一条删除,最后提交事务 messageRepository.deleteAll(); // 删除所有:使用一条 sql messageRepository.deleteAllInBatch(); } @Autowired private MessageService messageService; @Test public void testUpdate() { // 根据主键更新 Message message = Message.builder().msgId(2) .msgText("后端架构").msgSummary("SpringCloud").build(); messageRepository.saveAndFlush(message); // 批量更新 List<Message> messages = new ArrayList<>(); messages.add(Message.builder().msgId(5).msgText("workday").msgSummary("study").build()); messages.add(Message.builder().msgId(6).msgText("weekend").msgSummary("play").build()); messageService.batchUpdate(messages); } @Test public void testSelect() { // 查询所有 messageRepository.findAll().forEach(msg -> log.info(msg.toString())); // 分页查询全部,返回封装了的分页信息, jpa页码从0开始 Page<Message> pageInfo = messageRepository.findAll( PageRequest.of(1, 3, Sort.Direction.ASC, "msgId")); log.info("总记录数: {}", pageInfo.getTotalElements()); log.info("当前页记录数: {}", pageInfo.getNumberOfElements()); log.info("每页记录数: {}", pageInfo.getSize()); log.info("获取总页数: {}", pageInfo.getTotalPages()); log.info("查询结果: {}", pageInfo.getContent()); log.info("当前页(从0开始计): {}", pageInfo.getNumber()); log.info("是否为首页: {}", pageInfo.isFirst()); log.info("是否为尾页: {}", pageInfo.isLast()); // 条件查询 Message message = Message.builder().msgSummary("study").build(); List<Message> messages = messageRepository.findAll(Example.of(message)); log.info("满足条件的记录有:"); messages.forEach(msg -> log.info(msg.toString())); // 单个查询 Message msg = Message.builder().msgId(2).build(); Optional<Message> optionalMessage = messageRepository.findOne(Example.of(msg)); log.info("单个查询结果: {}", optionalMessage.orElse(null)); } @Test public void testCustomSQL() { Integer num = messageRepository.insertMessage("自定义SQL", "JPA"); log.info("增加的数据条数: {}", num); Integer updateNum = messageRepository.updateName("JPQL", 1); log.info("修改的数据条数: {}", updateNum); } }
[ "veronika.cucorova@gmail.com" ]
veronika.cucorova@gmail.com
49f2d001072f6869ccc54855cd074114d1675908
53d5cbad5c0118d7c4ee80944c8b86efd91af0a9
/server/src/main/java/org/jzb/execution/application/AdminService.java
c0ac11f85f02b3371cd96bba53238b7ec6bdc72f
[]
no_license
ixtf/japp-execution
bc54e41bdda09e6cf18fa39904a1126336fd040e
b387f725a5293f353fe052fbb7b742d72b506332
refs/heads/master
2021-01-18T23:56:12.982708
2019-03-22T07:49:52
2019-03-22T07:49:52
40,085,653
0
0
null
null
null
null
UTF-8
Java
false
false
743
java
package org.jzb.execution.application; import org.jzb.execution.application.command.ChannelUpdateCommand; import org.jzb.execution.application.command.PlanAuditCommand; import org.jzb.execution.domain.Channel; import java.security.Principal; /** * Created by jzb on 17-4-15. */ public interface AdminService { void auditPlan(Principal principal, String planId, PlanAuditCommand command); void unAuditPlan(Principal principal, String planId); Channel create(Principal principal, ChannelUpdateCommand command); Channel update(Principal principal, String id, ChannelUpdateCommand command); void deleteChannel(Principal principal, String id); void deleteRedEnvelopeOrganization(Principal principal, String id); }
[ "ixtf1984@gmail.com" ]
ixtf1984@gmail.com
41f7e7a66217ba57788ae29180f9f556356346d3
44ce357ee9ca8df2f399f7e0fcdf385b7b34c245
/src/main/java/org/apache/commons/math3/complex/ComplexFormat.java
e4b89b4e2e7735bfc9aaa3d6ae4761735c845153
[]
no_license
silas1037/SkEye
a8712f273e1cadd69e0be7d993963016df227cb5
ed0ede814ee665317dab3209b8a33e38df24a340
refs/heads/master
2023-01-20T20:25:00.940114
2020-11-29T04:01:05
2020-11-29T04:01:05
315,267,911
0
0
null
null
null
null
UTF-8
Java
false
false
7,751
java
package org.apache.commons.math3.complex; import java.text.FieldPosition; import java.text.NumberFormat; import java.text.ParsePosition; import java.util.Locale; import org.apache.commons.math3.exception.MathIllegalArgumentException; import org.apache.commons.math3.exception.MathParseException; import org.apache.commons.math3.exception.NoDataException; import org.apache.commons.math3.exception.NullArgumentException; import org.apache.commons.math3.exception.util.LocalizedFormats; import org.apache.commons.math3.util.CompositeFormat; public class ComplexFormat { private static final String DEFAULT_IMAGINARY_CHARACTER = "i"; private final String imaginaryCharacter; private final NumberFormat imaginaryFormat; private final NumberFormat realFormat; public ComplexFormat() { this.imaginaryCharacter = DEFAULT_IMAGINARY_CHARACTER; this.imaginaryFormat = CompositeFormat.getDefaultNumberFormat(); this.realFormat = this.imaginaryFormat; } public ComplexFormat(NumberFormat format) throws NullArgumentException { if (format == null) { throw new NullArgumentException(LocalizedFormats.IMAGINARY_FORMAT, new Object[0]); } this.imaginaryCharacter = DEFAULT_IMAGINARY_CHARACTER; this.imaginaryFormat = format; this.realFormat = format; } public ComplexFormat(NumberFormat realFormat2, NumberFormat imaginaryFormat2) throws NullArgumentException { if (imaginaryFormat2 == null) { throw new NullArgumentException(LocalizedFormats.IMAGINARY_FORMAT, new Object[0]); } else if (realFormat2 == null) { throw new NullArgumentException(LocalizedFormats.REAL_FORMAT, new Object[0]); } else { this.imaginaryCharacter = DEFAULT_IMAGINARY_CHARACTER; this.imaginaryFormat = imaginaryFormat2; this.realFormat = realFormat2; } } public ComplexFormat(String imaginaryCharacter2) throws NullArgumentException, NoDataException { this(imaginaryCharacter2, CompositeFormat.getDefaultNumberFormat()); } public ComplexFormat(String imaginaryCharacter2, NumberFormat format) throws NullArgumentException, NoDataException { this(imaginaryCharacter2, format, format); } public ComplexFormat(String imaginaryCharacter2, NumberFormat realFormat2, NumberFormat imaginaryFormat2) throws NullArgumentException, NoDataException { if (imaginaryCharacter2 == null) { throw new NullArgumentException(); } else if (imaginaryCharacter2.length() == 0) { throw new NoDataException(); } else if (imaginaryFormat2 == null) { throw new NullArgumentException(LocalizedFormats.IMAGINARY_FORMAT, new Object[0]); } else if (realFormat2 == null) { throw new NullArgumentException(LocalizedFormats.REAL_FORMAT, new Object[0]); } else { this.imaginaryCharacter = imaginaryCharacter2; this.imaginaryFormat = imaginaryFormat2; this.realFormat = realFormat2; } } public static Locale[] getAvailableLocales() { return NumberFormat.getAvailableLocales(); } public String format(Complex c) { return format(c, new StringBuffer(), new FieldPosition(0)).toString(); } public String format(Double c) { return format(new Complex(c.doubleValue(), 0.0d), new StringBuffer(), new FieldPosition(0)).toString(); } public StringBuffer format(Complex complex, StringBuffer toAppendTo, FieldPosition pos) { pos.setBeginIndex(0); pos.setEndIndex(0); CompositeFormat.formatDouble(complex.getReal(), getRealFormat(), toAppendTo, pos); double im = complex.getImaginary(); if (im < 0.0d) { toAppendTo.append(" - "); toAppendTo.append(formatImaginary(-im, new StringBuffer(), pos)); toAppendTo.append(getImaginaryCharacter()); } else if (im > 0.0d || Double.isNaN(im)) { toAppendTo.append(" + "); toAppendTo.append(formatImaginary(im, new StringBuffer(), pos)); toAppendTo.append(getImaginaryCharacter()); } return toAppendTo; } private StringBuffer formatImaginary(double absIm, StringBuffer toAppendTo, FieldPosition pos) { pos.setBeginIndex(0); pos.setEndIndex(0); CompositeFormat.formatDouble(absIm, getImaginaryFormat(), toAppendTo, pos); if (toAppendTo.toString().equals("1")) { toAppendTo.setLength(0); } return toAppendTo; } public StringBuffer format(Object obj, StringBuffer toAppendTo, FieldPosition pos) throws MathIllegalArgumentException { if (obj instanceof Complex) { return format((Complex) obj, toAppendTo, pos); } if (obj instanceof Number) { return format(new Complex(((Number) obj).doubleValue(), 0.0d), toAppendTo, pos); } throw new MathIllegalArgumentException(LocalizedFormats.CANNOT_FORMAT_INSTANCE_AS_COMPLEX, obj.getClass().getName()); } public String getImaginaryCharacter() { return this.imaginaryCharacter; } public NumberFormat getImaginaryFormat() { return this.imaginaryFormat; } public static ComplexFormat getInstance() { return getInstance(Locale.getDefault()); } public static ComplexFormat getInstance(Locale locale) { return new ComplexFormat(CompositeFormat.getDefaultNumberFormat(locale)); } public static ComplexFormat getInstance(String imaginaryCharacter2, Locale locale) throws NullArgumentException, NoDataException { return new ComplexFormat(imaginaryCharacter2, CompositeFormat.getDefaultNumberFormat(locale)); } public NumberFormat getRealFormat() { return this.realFormat; } public Complex parse(String source) throws MathParseException { ParsePosition parsePosition = new ParsePosition(0); Complex result = parse(source, parsePosition); if (parsePosition.getIndex() != 0) { return result; } throw new MathParseException(source, parsePosition.getErrorIndex(), Complex.class); } public Complex parse(String source, ParsePosition pos) { int sign; int initialIndex = pos.getIndex(); CompositeFormat.parseAndIgnoreWhitespace(source, pos); Number re = CompositeFormat.parseNumber(source, getRealFormat(), pos); if (re == null) { pos.setIndex(initialIndex); return null; } int startIndex = pos.getIndex(); switch (CompositeFormat.parseNextCharacter(source, pos)) { case 0: return new Complex(re.doubleValue(), 0.0d); case '+': sign = 1; break; case '-': sign = -1; break; default: pos.setIndex(initialIndex); pos.setErrorIndex(startIndex); return null; } CompositeFormat.parseAndIgnoreWhitespace(source, pos); Number im = CompositeFormat.parseNumber(source, getRealFormat(), pos); if (im == null) { pos.setIndex(initialIndex); return null; } else if (!CompositeFormat.parseFixedstring(source, getImaginaryCharacter(), pos)) { return null; } else { return new Complex(re.doubleValue(), im.doubleValue() * ((double) sign)); } } }
[ "silas1037@163.com" ]
silas1037@163.com
11cac6d8c53a070c40898c8f4f8e50ffb1d0eb5f
3a1bc9b88019d266a57485fa8f6997c74658311f
/subprojects/core/src/main/groovy/org/gradle/logging/internal/TerminalDetector.java
62fa544d752dd6315f79d6a2d22f029f7b84cac7
[]
no_license
ipsi/gradle-ear
475bd6ee2ab27dcc7e4ae0e3ad87d8168e36d355
896c023c261c8886327d759483606935fd53efd5
refs/heads/master
2021-01-15T19:40:47.629568
2011-04-06T12:15:52
2011-04-06T12:15:52
1,505,785
1
1
null
null
null
null
UTF-8
Java
false
false
3,283
java
/* * Copyright 2010 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.gradle.logging.internal; import org.apache.commons.io.IOUtils; import org.fusesource.jansi.WindowsAnsiOutputStream; import org.gradle.api.GradleException; import org.gradle.api.UncheckedIOException; import org.gradle.api.specs.Spec; import org.gradle.util.OperatingSystem; import org.gradle.util.PosixUtil; import java.io.*; public class TerminalDetector implements Spec<FileDescriptor> { public TerminalDetector(File libCacheDir) { // Some hackery to prevent JNA from creating a shared lib in the tmp dir, as it does not clean things up File tmpDir = new File(libCacheDir, "jna"); tmpDir.mkdirs(); String libName = System.mapLibraryName("jnidispatch"); File libFile = new File(tmpDir, libName); if (!libFile.exists()) { String resourceName = "/com/sun/jna/" + OperatingSystem.current().getNativePrefix() + "/" + libName; try { InputStream lib = getClass().getResourceAsStream(resourceName); if (lib == null) { throw new GradleException(String.format("Could not locate JNA native lib resource '%s'.", resourceName)); } try { FileOutputStream outputStream = new FileOutputStream(libFile); try { IOUtils.copy(lib, outputStream); } finally { outputStream.close(); } } finally { lib.close(); } } catch (IOException e) { throw new UncheckedIOException(e); } } // System.load(libFile.getAbsolutePath()); System.setProperty("jna.boot.library.path", tmpDir.getAbsolutePath()); } public boolean isSatisfiedBy(FileDescriptor element) { if (OperatingSystem.current().isWindows()) { // Use Jansi's detection mechanism try { new WindowsAnsiOutputStream(new ByteArrayOutputStream()); return true; } catch (IOException ignore) { // Not attached to a console return false; } } // Use jna-posix to determine if we're connected to a terminal if (!PosixUtil.current().isatty(element)) { return false; } // Dumb terminal doesn't support control codes. Should really be using termcap database. String term = System.getenv("TERM"); if (term != null && term.equals("dumb")) { return false; } // Assume a terminal return true; } }
[ "a@rubygrapefruit.net" ]
a@rubygrapefruit.net
8ca5c804a151701a1be1e40cac5f988bb53af98b
318f01d9c7d6d5615c32eaf3a48b38e72c89dec6
/thirdpp-trust-channel/src/main/java/com/zendaimoney/trust/channel/entity/cmb/FileTop.java
5c830dd6be5d3b2b27c6035e4771055a10c65552
[]
no_license
ichoukou/thirdapp
dce52f5df2834f79a51895475b995a3e758be8c0
aae0a1596e06992b600a1a442723b833736240e3
refs/heads/master
2020-05-03T03:12:33.064089
2018-04-18T06:00:14
2018-04-18T06:00:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
152
java
package com.zendaimoney.trust.channel.entity.cmb; /** * 批量报文File首行抽象类 * @author mencius * */ public abstract class FileTop { }
[ "gaohongxuhappy@163.com" ]
gaohongxuhappy@163.com
0d56365c2739b49de0797c5189548b7f0819f625
39723eae63b30bba1dc2e6bade36eea0c5d982cb
/wemo_apk/java_code/android/support/annotation/IntRange.java
db960d418e593e4717390c0e1c176f4ec1c2d63b
[]
no_license
haoyu-liu/crack_WeMo
39142e3843b16cdf0e3c88315d1bfbff0d581827
cdca239427cb170316e9774886a4eed9a5c51757
refs/heads/master
2020-03-22T21:40:45.425229
2019-02-24T13:48:11
2019-02-24T13:48:11
140,706,494
1
1
null
null
null
null
UTF-8
Java
false
false
710
java
package android.support.annotation; import java.lang.annotation.Annotation; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Retention(RetentionPolicy.CLASS) @Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface IntRange { long from() default Long.MIN_VALUE; long to() default Long.MAX_VALUE; } /* Location: /root/Documents/wemo_apk/classes-dex2jar.jar!/android/support/annotation/IntRange.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "root@localhost.localdomain" ]
root@localhost.localdomain
2f2b8c44822a24f75e2e2db99282f97b2e999fee
cd73733881f28e2cd5f1741fbe2d32dafc00f147
/libs/lib-zxing/src/main/java/com/hjhq/lib_zxing/ZApplication.java
eea66d433e73c88429587234170bc2d0335f5f92
[]
no_license
XiaoJon/20180914
45cfac9f7068ad85dee26e570acd2900796cbcb1
6c0759d8abd898f1f5dba77eee45cbc3d218b2e0
refs/heads/master
2020-03-28T16:48:36.275700
2018-09-14T04:10:27
2018-09-14T04:10:27
148,730,363
0
1
null
null
null
null
UTF-8
Java
false
false
856
java
package com.hjhq.lib_zxing; import android.app.Application; import android.util.DisplayMetrics; /** * Created by aaron on 16/8/9. */ public class ZApplication extends Application{ @Override public void onCreate() { super.onCreate(); /** * 初始化尺寸工具类 */ initDisplayOpinion(); } private void initDisplayOpinion() { DisplayMetrics dm = getResources().getDisplayMetrics(); DisplayUtil.density = dm.density; DisplayUtil.densityDPI = dm.densityDpi; DisplayUtil.screenWidthPx = dm.widthPixels; DisplayUtil.screenhightPx = dm.heightPixels; DisplayUtil.screenWidthDip = DisplayUtil.px2dip(getApplicationContext(), dm.widthPixels); DisplayUtil.screenHightDip = DisplayUtil.px2dip(getApplicationContext(), dm.heightPixels); } }
[ "xiaojun6909@gmail.com" ]
xiaojun6909@gmail.com
bd7944c659b3d0b8731a88b4238febf3954a0553
38c95a8e610a26e7cb0e2a0ad027df148b890210
/codes/java/leetcodes/src/main/java/com/hit/basmath/learn/binary_search/_719.java
dbdcf702079a2d5c07be4cd23d1babc0e7ac2106
[ "MIT" ]
permissive
guobinhit/myleetcode
b2f4b5f2c1fd7c26dd303be34c227a20c9bfa9b7
bf519a04dcf574419543f52fbe2bfcb430d981f1
refs/heads/master
2023-01-21T10:58:24.809836
2023-01-09T03:36:45
2023-01-09T03:36:45
145,631,771
56
29
null
null
null
null
UTF-8
Java
false
false
1,307
java
package com.hit.basmath.learn.binary_search; import java.util.Arrays; /** * 719. Find K-th Smallest Pair Distance * <p> * Given an integer array, return the k-th smallest distance among all the pairs. The distance of a pair (A, B) is defined as the absolute difference between A and B. * <p> * Example 1: * <p> * Input: * nums = [1,3,1] * k = 1 * Output: 0 * <p> * Explanation: * <p> * Here are all the pairs: * <p> * (1,3) -> 2 * (1,1) -> 0 * (3,1) -> 2 * <p> * Then the 1st smallest distance pair is (1,1), and its distance is 0. * <p> * Note: * <p> * 2 <= len(nums) <= 10000. * 0 <= nums[i] < 1000000. * 1 <= k <= len(nums) * (len(nums) - 1) / 2. */ public class _719 { public int smallestDistancePair(int[] nums, int k) { Arrays.sort(nums); int n = nums.length; int left = 0; int right = nums[n - 1] - nums[0]; for (int cnt = 0; left < right; cnt = 0) { int mid = left + (right - left) / 2; for (int i = 0, j = 0; i < n; i++) { while (j < n && nums[j] <= nums[i] + mid) j++; cnt += j - i - 1; } if (cnt < k) { left = mid + 1; } else { right = mid; } } return left; } }
[ "guobinhit@gmail.com" ]
guobinhit@gmail.com
dd7a57534f9aeb58eec186ac3cbaa6a852b931d9
c096a03908fdc45f29574578b87662e20c1f12d4
/com/src/main/java/lip/com/millennialmedia/google/gson/internal/LazilyParsedNumber.java
3a103c450527eedcb4060251fd98aba9f11f0043
[]
no_license
aboaldrdaaa2/Myappt
3762d0572b3f0fb2fbb3eb8f04cb64c6506c2401
38f88b7924c987ee9762894a7a5b4f8feb92bfff
refs/heads/master
2020-03-30T23:55:13.551721
2018-10-05T13:41:24
2018-10-05T13:41:24
151,718,350
0
0
null
null
null
null
UTF-8
Java
false
false
1,237
java
package lip.com.millennialmedia.google.gson.internal; import java.io.ObjectStreamException; import java.math.BigDecimal; import java.math.BigInteger; public final class LazilyParsedNumber extends Number { private final String value; public LazilyParsedNumber(String value) { this.value = value; } public int intValue() { try { return Integer.parseInt(this.value); } catch (NumberFormatException e) { try { return (int) Long.parseLong(this.value); } catch (NumberFormatException e2) { return new BigInteger(this.value).intValue(); } } } public long longValue() { try { return Long.parseLong(this.value); } catch (NumberFormatException e) { return new BigInteger(this.value).longValue(); } } public float floatValue() { return Float.parseFloat(this.value); } public double doubleValue() { return Double.parseDouble(this.value); } public String toString() { return this.value; } private Object writeReplace() throws ObjectStreamException { return new BigDecimal(this.value); } }
[ "aboaldrdaaa2@gmail.com" ]
aboaldrdaaa2@gmail.com
c841baca8b3a81544e3058076637fad3cbefd79c
440e5bff3d6aaed4b07eca7f88f41dd496911c6b
/myapplication/src/main/java/com/baidu/location/h/b.java
032739b7a7259209e36ae9bdd57be8eda9cb79f4
[]
no_license
freemanZYQ/GoogleRankingHook
4d4968cf6b2a6c79335b3ba41c1c9b80e964ddd3
bf9affd70913127f4cd0f374620487b7e39b20bc
refs/heads/master
2021-04-29T06:55:00.833701
2018-01-05T06:14:34
2018-01-05T06:14:34
77,991,340
7
5
null
null
null
null
UTF-8
Java
false
false
994
java
package com.baidu.location.h; import android.location.Location; import android.os.Handler; import android.os.Message; import com.baidu.location.f; class b extends Handler { final /* synthetic */ a a; b(a aVar) { this.a = aVar; } public void handleMessage(Message message) { if (f.isServing) { switch (message.what) { case 1: this.a.e((Location) message.obj); return; case 2: if (this.a.j != null) { this.a.j.a((String) message.obj); return; } return; case 3: this.a.a("&og=1", (Location) message.obj); return; case 4: this.a.a("&og=2", (Location) message.obj); return; default: return; } } } }
[ "zhengyuqin@youmi.net" ]
zhengyuqin@youmi.net
7d87d922d5e93a7680afb83e6ae624e3161055f3
9f0625dc9405771f1d43f02edda56104632d2468
/spring-boot/03/microservices/recommendation-service/src/main/java/se/magnus/microservices/core/recommendation/RecommendationServiceApplication.java
056b2823fe3937042f6be2aa9583e007396375fe
[]
no_license
nwoswo/SpringBootCloudKubernetes
0b491effd83a333b46d3cc5df7c2e2f0c948c56d
43cdd913680c6b6d2ab0c617bee681c7da43e8ba
refs/heads/main
2023-08-15T09:35:04.792502
2021-10-15T04:35:59
2021-10-15T04:35:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
455
java
package se.magnus.microservices.core.recommendation; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.ComponentScan; @SpringBootApplication @ComponentScan("se.magnus") public class RecommendationServiceApplication { public static void main(String[] args) { SpringApplication.run(RecommendationServiceApplication.class, args); } }
[ "jose.diaz@joedayz.pe" ]
jose.diaz@joedayz.pe
c01fcee00b18fbaa5ea7b24dc873dca91494468e
cbf9101a41c0449de040549767a5449341665ed6
/escalade/escalade-consumer/src/main/java/fr/oc/projet/consumer/impl/dao/CompteDaoImpl.java
b215e3bac259086d44eb2c6e061722dbddeb8435
[]
no_license
YoannR09/Projet_6_OC
3fd9032ce97329187de272b14940871178d3f9c4
e9dfe724cd07e5a87e35c50fb04985accd136e34
refs/heads/master
2020-04-28T22:03:21.879242
2019-05-15T09:34:29
2019-05-15T09:34:29
175,604,079
1
0
null
2019-05-04T20:18:46
2019-03-14T10:57:33
Java
UTF-8
Java
false
false
4,039
java
package fr.oc.projet.consumer.impl.dao; import fr.oc.projet.consumer.contract.dao.CompteDao; import fr.oc.projet.consumer.rowmapper.CompteRM; import fr.oc.projet.model.bean.utilisateur.Compte; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.SqlParameterValue; import org.springframework.jdbc.core.namedparam.BeanPropertySqlParameterSource; import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; import javax.inject.Inject; import javax.inject.Named; import java.sql.Types; import java.util.List; /** * Class qui gère les données des comptes. * On peut récupérer un compte via pseudo/id, * Récupérer la liste des comptes dans la base de données, * Ajouter un compte dans la base de données. */ @Named public class CompteDaoImpl extends AbstractDaoImpl implements CompteDao { @Inject CompteRM compteRM; /** * Méthode pour récupérer un compte via un pseudo. * @param pseudo * @return */ @Override public Compte getCompteViaPseudo(String pseudo) { String vSQL = "SELECT * FROM compte WHERE pseudo = '"+pseudo+"'"; JdbcTemplate vJdbcTemplate = new JdbcTemplate(getDataSource()); Compte compte = vJdbcTemplate.queryForObject(vSQL,compteRM); return compte; } /** * Méthode qui récupére un compte avec un id. * @param pId * @return */ @Override public Compte getCompte(Integer pId) { String vSQL = "SELECT * FROM compte WHERE id ="+pId; JdbcTemplate vJdbcTemplate = new JdbcTemplate(getDataSource()); Compte compte = vJdbcTemplate.queryForObject(vSQL,compteRM); return compte; } /** * Méthode pour récupérer la liste des comptes dans la base de données. * @return */ @Override public List<Compte> getListCompte() { String vSQL = "SELECT * FROM compte "; JdbcTemplate vJdbcTemplate = new JdbcTemplate(getDataSource()); List<Compte> vList = vJdbcTemplate.query(vSQL,compteRM); return vList; } /** * Méthode pour ajouter un compte. * Le niveau d'accès est automatiquement mis en visiteur (1). * * @param compte */ @Override public void addCompte(Compte compte) { String vSQL = "INSERT INTO compte (pseudo, nom, prenom, mot_de_passe, email, numero_de_telephone, niveau_acces_id)" + " VALUES (:pseudo, :nom, :prenom, :password, :email, :numero, :niveau)"; NamedParameterJdbcTemplate vJdbcTemplate = new NamedParameterJdbcTemplate(getDataSource()); BeanPropertySqlParameterSource vParams = new BeanPropertySqlParameterSource(compte); vParams.registerSqlType("pseudo", Types.VARCHAR); vParams.registerSqlType("nom", Types.VARCHAR); vParams.registerSqlType("prenom", Types.VARCHAR); vParams.registerSqlType("password", Types.VARCHAR); vParams.registerSqlType("email", Types.VARCHAR); vParams.registerSqlType("numero", Types.VARCHAR); vParams.registerSqlType("niveau", Types.INTEGER); vJdbcTemplate.update(vSQL, vParams); } @Override public void updateMdp(Compte compte) { String vSQL = "UPDATE compte SET mot_de_passe = ? WHERE id = ?"; Object[] vParams = { new SqlParameterValue(Types.VARCHAR, compte.getPassword()), new SqlParameterValue(Types.INTEGER, compte.getId()), }; JdbcTemplate vJdbcTemplate = new JdbcTemplate(getDataSource()); vJdbcTemplate.update(vSQL, vParams); } @Override public void updateMail(Compte compte) { String vSQL = "UPDATE compte SET email = ? WHERE id = ?"; Object[] vParams = { new SqlParameterValue(Types.VARCHAR, compte.getEmail()), new SqlParameterValue(Types.INTEGER, compte.getId()), }; JdbcTemplate vJdbcTemplate = new JdbcTemplate(getDataSource()); vJdbcTemplate.update(vSQL, vParams); } }
[ "el-rambo-poto@hotmail.fr" ]
el-rambo-poto@hotmail.fr
5736b947f53f302498d1ca8302a4ec219bf86a3d
b1117fa9baa101d26f504e50335c71fb386ecc68
/src/ckt/inspector/Inspector.java
430aa5ee26ee13000dfecda94823ad179e1096fe
[]
no_license
tyokyo/SioeyeIOSAppium
fa33a6b2d8eaa576329ddf654399bb1135b4f2ad
9481ae5cfddb8acd43cbeab917dbec55eccf03cc
refs/heads/master
2021-01-12T06:23:33.407744
2017-07-24T09:08:46
2017-07-24T09:08:46
77,353,093
2
0
null
null
null
null
UTF-8
Java
false
false
6,005
java
package ckt.inspector; import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.InputStream; import java.io.InputStreamReader; import java.io.RandomAccessFile; import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.Enumeration; import java.util.List; import javax.swing.tree.DefaultMutableTreeNode; import org.dom4j.Document; import org.dom4j.DocumentException; import org.dom4j.Element; import org.dom4j.io.SAXReader; import ckt.App.Util.IElement; import ckt.App.Util.VP3; /*使用dom4j解析页面XML数据*/ public class Inspector extends VP3 { public static DefaultMutableTreeNode rootTree ; private static String getXpath(Element element){ return element.getUniquePath().replace("AppiumAUT", ""); } public static void fillTree(){ } public static List<IElement> toIElements(List<Element> elements){ //System.out.println("toIElements-"+elements.size()); List<IElement> iElements = new ArrayList<IElement>(); for (Element element : elements) { IElement iElement = new IElement(); iElement.setClassName(element.getName()); iElement.setXpath(getXpath(element)); iElement.setName(element.attributeValue("name")); iElement.setValue(element.attributeValue("value")); iElement.setLabel(element.attributeValue("label")); iElement.setX(Double.parseDouble(element.attributeValue("x"))); iElement.setY(Double.parseDouble(element.attributeValue("y"))); iElement.setWidth(Double.parseDouble(element.attributeValue("width"))); iElement.setHeight(Double.parseDouble(element.attributeValue("height"))); iElement.setVisible(element.attributeValue("visible")); iElement.setEnabled(element.attributeValue("enabled")); iElements.add(iElement); } return iElements; } public static Element getApplicationXmlElement(){ //String xmlSource=iosdriver.getPageSource(); String xmlSource=readFile("inspector/app-inspector.xml"); Document document; Element UIAApplication = null; try { InputStream is =new ByteArrayInputStream(xmlSource.getBytes("UTF-8")); SAXReader saxReader = new SAXReader(); document = saxReader.read(is); // 获取根元素 - AppiumAUT Element root = document.getRootElement(); //System.out.println("Root: " + root.getName()); //获取子元素 - UIAApplication UIAApplication = (Element) root.elements().get(0); //System.out.println("AppiumAUT->UIAApplication: " + UIAApplication.getName()+"-"+UIAApplication.attributeValue("name")); } catch (DocumentException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (UnsupportedEncodingException e) { // TODO Auto-generated catch block e.printStackTrace(); } return UIAApplication; } public static String readFile(String filePath){ String content=""; try { String encoding="UTF-8"; File file=new File(filePath); if(file.isFile() && file.exists()){ //判断文件是否存在 InputStreamReader read = new InputStreamReader( new FileInputStream(file),encoding);//考虑到编码格式 BufferedReader bufferedReader = new BufferedReader(read); String lineTxt = null; while((lineTxt = bufferedReader.readLine()) != null){ content=content+lineTxt+"\n"; } read.close(); }else{ System.out.println("找不到指定的文件"); } } catch (Exception e) { System.out.println("读取文件内容出错"); e.printStackTrace(); } return content; } public static boolean writeTxtFile(String content,File fileName)throws Exception{ RandomAccessFile mm=null; boolean flag=false; FileOutputStream o=null; try { o = new FileOutputStream(fileName); o.write(content.getBytes("UTF-8")); o.close(); flag=true; } catch (Exception e) { // TODO: handle exception e.printStackTrace(); }finally{ if(mm!=null){ mm.close(); } } return flag; } private static void readElement(DefaultMutableTreeNode node,Element element,List<Element> allElements){ @SuppressWarnings("unchecked") List<Element>elmsElements = element.elements(); for (Element element2 : elmsElements) { DefaultMutableTreeNode nodechild = new DefaultMutableTreeNode(repXcui(element2.attributeValue("type"))); node.add(nodechild); allElements.add(element2); //System.out.println("Node-" + element2.getName()+"-"+element2.attributeValue("name")); readElement(nodechild,element2,allElements); } } private static void readElement(Element element,List<Element> allElements){ List<Element>elmsElements = element.elements(); for (Element element2 : elmsElements) { allElements.add(element2); //System.out.println("Node-" + element2.getName()+"-"+element2.attributeValue("name")); readElement(element2,allElements); } } public static List<Element> getPageXmlElements(){ ArrayList<Element> allElements = new ArrayList<Element>(); Element applicationElement = getApplicationXmlElement(); readElement(applicationElement, allElements); return allElements; } private static String repXcui(String tag){ return tag.replace("XCUIElementType", ""); } public static DefaultMutableTreeNode getTree(){ ArrayList<Element> allElements = new ArrayList<Element>(); Element rootElement = getApplicationXmlElement(); rootTree =new DefaultMutableTreeNode(repXcui(rootElement.getName()));//创建Jtree数据模型的根节点 readElement(rootTree,rootElement, allElements); UiViewer.tms = Inspector.toIElements(allElements); return rootTree; } public static void main(String args[]){ List<Element> ems = Inspector.getPageXmlElements(); List<IElement> tms = Inspector.toIElements(ems); for (IElement iElement : tms) { System.out.println(iElement.getXpath()); } } }
[ "qiang.zhang@ck-telecom.com" ]
qiang.zhang@ck-telecom.com
f4e138f15ea00a63404c3dbc18ea8138a6f96542
79b5bc5e7d96808097018aad1a1dabd6fa8b8be4
/src/main/java/com/fisc/localisation/aop/logging/LoggingAspect.java
9622e72462c39655220770a240f9ddd1f86565c2
[]
no_license
sandalothier/jhipster-localisation
c6a8d8f47a84f09894b351f0ac6ea4002a9ff5b0
e411cac0198883412c6fa1d93bbd9e08cc48dc55
refs/heads/master
2022-12-24T15:04:28.077460
2020-01-27T12:49:48
2020-01-27T12:49:48
236,489,461
0
0
null
2022-12-16T04:43:39
2020-01-27T12:49:38
Java
UTF-8
Java
false
false
3,906
java
package com.fisc.localisation.aop.logging; import io.github.jhipster.config.JHipsterConstants; import org.aspectj.lang.JoinPoint; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.AfterThrowing; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Pointcut; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.core.env.Environment; import org.springframework.core.env.Profiles; import java.util.Arrays; /** * Aspect for logging execution of service and repository Spring components. * * By default, it only runs with the "dev" profile. */ @Aspect public class LoggingAspect { private final Logger log = LoggerFactory.getLogger(this.getClass()); private final Environment env; public LoggingAspect(Environment env) { this.env = env; } /** * Pointcut that matches all repositories, services and Web REST endpoints. */ @Pointcut("within(@org.springframework.stereotype.Repository *)" + " || within(@org.springframework.stereotype.Service *)" + " || within(@org.springframework.web.bind.annotation.RestController *)") public void springBeanPointcut() { // Method is empty as this is just a Pointcut, the implementations are in the advices. } /** * Pointcut that matches all Spring beans in the application's main packages. */ @Pointcut("within(com.fisc.localisation.repository..*)"+ " || within(com.fisc.localisation.service..*)"+ " || within(com.fisc.localisation.web.rest..*)") public void applicationPackagePointcut() { // Method is empty as this is just a Pointcut, the implementations are in the advices. } /** * Advice that logs methods throwing exceptions. * * @param joinPoint join point for advice. * @param e exception. */ @AfterThrowing(pointcut = "applicationPackagePointcut() && springBeanPointcut()", throwing = "e") public void logAfterThrowing(JoinPoint joinPoint, Throwable e) { if (env.acceptsProfiles(Profiles.of(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT))) { log.error("Exception in {}.{}() with cause = \'{}\' and exception = \'{}\'", joinPoint.getSignature().getDeclaringTypeName(), joinPoint.getSignature().getName(), e.getCause() != null? e.getCause() : "NULL", e.getMessage(), e); } else { log.error("Exception in {}.{}() with cause = {}", joinPoint.getSignature().getDeclaringTypeName(), joinPoint.getSignature().getName(), e.getCause() != null? e.getCause() : "NULL"); } } /** * Advice that logs when a method is entered and exited. * * @param joinPoint join point for advice. * @return result. * @throws Throwable throws {@link IllegalArgumentException}. */ @Around("applicationPackagePointcut() && springBeanPointcut()") public Object logAround(ProceedingJoinPoint joinPoint) throws Throwable { if (log.isDebugEnabled()) { log.debug("Enter: {}.{}() with argument[s] = {}", joinPoint.getSignature().getDeclaringTypeName(), joinPoint.getSignature().getName(), Arrays.toString(joinPoint.getArgs())); } try { Object result = joinPoint.proceed(); if (log.isDebugEnabled()) { log.debug("Exit: {}.{}() with result = {}", joinPoint.getSignature().getDeclaringTypeName(), joinPoint.getSignature().getName(), result); } return result; } catch (IllegalArgumentException e) { log.error("Illegal argument: {} in {}.{}()", Arrays.toString(joinPoint.getArgs()), joinPoint.getSignature().getDeclaringTypeName(), joinPoint.getSignature().getName()); throw e; } } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
3b6201076f1f34b30918b7cac3e2a732e3d535c5
35815a82c5d1119a30e9a1ee76b070ab81981cf2
/TestGson/src/com/cdsxt/test/TestGson.java
947307fee58fc654d9729ab3184312bc685931b6
[]
no_license
BinYangXian/mid
83211ffb0ff521a2e709bfc763a9bfd4e725e64d
39f1fa21584008177ee1da32ff72fa4560d98aa6
refs/heads/master
2021-01-19T17:20:02.685420
2017-02-19T12:43:52
2017-02-19T12:43:52
82,445,612
0
0
null
null
null
null
UTF-8
Java
false
false
1,014
java
package com.cdsxt.test; import java.util.ArrayList; import java.util.List; import com.cdsxt.vo.Person; import com.google.gson.Gson; public class TestGson { public static void main(String[] args) { //页面传入的json字符串转化成对象 用的比较少 // String str1="{'id':'1','name':'zhangsan','age':'20'}"; // //使用Gson // Gson gson=new Gson(); // Person person=gson.fromJson(str1, Person.class); // System.out.println(person.getName()); //服务器往页面输出json字符串或数组字符串 // User user=new User(3, "王五", new String[]{"ball","playball"},new Address("四川","成都")); // // Gson gson=new Gson(); // String userJson=gson.toJson(user); // System.out.println(userJson); List<Person> perList=new ArrayList<Person>(); perList.add(new Person(1,"张三",20)); perList.add(new Person(3,"张",10)); perList.add(new Person(4,"三",30)); Gson gson=new Gson(); String listJson=gson.toJson(perList); System.out.println(listJson); } }
[ "350852832@qq.com" ]
350852832@qq.com
bdeef332308d66328699f82def9f09e3ad79fe47
bf744ba24a594529fc2e6729afe19a20b70d6fde
/Proj-supergenius-admin/Web/src/main/java/com/supergenius/web/admin/moral/helper/CasesHP.java
c5769c67db4332cbbe6840eec86e07fb4dbe75fa
[]
no_license
greatgy/Code
4e3fc647999d0ff94933c0ff85bf08228de62a1f
e198b7cf90a40e531235fa9e88df211e1978e177
refs/heads/master
2021-10-27T16:27:19.551730
2019-04-18T09:43:07
2019-04-18T09:43:07
182,007,387
0
0
null
null
null
null
UTF-8
Java
false
false
2,134
java
package com.supergenius.web.admin.moral.helper; import java.util.HashMap; import java.util.Map; import org.joda.time.DateTime; import org.joda.time.format.DateTimeFormat; import com.genius.core.base.utils.DateUtil; import com.genius.core.base.utils.StrUtil; import com.genius.model.base.entity.Pager; import com.genius.server.base.helper.BaseHP; import com.supergenius.server.common.constants.ViewKeyDict; import com.supergenius.xo.common.constants.MapperDict; import com.supergenius.xo.moral.service.CaseSO; /** * 案例hp * @author liushaomin */ public class CasesHP extends BaseHP{ private static CaseSO so; private static CaseSO getSO() { if (so == null) { so = (CaseSO) spring.getBean(CaseSO.class); } return so; } /** * 组织数据 * @param model * @return * @author liushaomin */ public static Map<String, Object> query(Map<String, Object> model) { Pager pager = Pager.getNewInstance(model.get("page"), model.get("rows")); Map<String, Object> map = getParamMap(pager, model, MapperDict.name); if (StrUtil.isNotEmpty(model.get(ViewKeyDict.chapter))) { map.put(MapperDict.chapter, model.get(ViewKeyDict.chapter).toString().trim()); } if (StrUtil.isNotEmpty(model.get(ViewKeyDict.status))) { map.put(MapperDict.status, model.get(ViewKeyDict.status).toString().trim()); } if (StrUtil.isNotEmpty(model.get(ViewKeyDict.createtimestart))) { String start = model.get(ViewKeyDict.createtimestart).toString(); DateTime startTime = DateTime.parse(start); map.put(MapperDict.createtime + MapperDict.suffix_greater_key, startTime); } if (StrUtil.isNotEmpty(model.get(ViewKeyDict.createtimeend))) { String end = model.get(ViewKeyDict.createtimeend).toString() + MapperDict.endtimeformat; DateTime endTime = DateTime.parse(end, DateTimeFormat.forPattern(DateUtil.FORMAT_DATETIME_CHINA)); map.put(MapperDict.createtime + MapperDict.suffix_lessOrEqual_key, endTime); } Map<String, Object> result = new HashMap<String, Object>(); result.put(ViewKeyDict.total, getSO().getCount(map)); result.put(ViewKeyDict.rows, getSO().getList(map)); return result; } }
[ "18519764453@163.com" ]
18519764453@163.com
2b0446ef3bdcde41b10cf6a79f37ed3c80d18818
fb2b27f0638feaa8a435425a563910de48925931
/df_miniapp/classes/com/tt/miniapphost/process/annotation/HostProcess.java
5165bbe94a9bd6ffb5dd215bdb9e2651f59ae856
[]
no_license
0moura/tiktok_source
168fdca45a76e9dc41a4667e41b7743c54692e45
dc2f1740f1f4adcb16448107e5c15fabc40ed8e5
refs/heads/master
2023-01-08T22:51:02.019984
2020-11-03T13:18:24
2020-11-03T13:18:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
418
java
package com.tt.miniapphost.process.annotation; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; @Retention(RetentionPolicy.CLASS) public @interface HostProcess {} /* Location: C:\Users\august\Desktop\tik\df_miniapp\classes.jar!\com\tt\miniapphost\process\annotation\HostProcess.class * Java compiler version: 6 (50.0) * JD-Core Version: 1.1.3 */
[ "augustgl@protonmail.ch" ]
augustgl@protonmail.ch
87b9b648e2b4ba17065885423807693278006d5a
d887ccc2f2c07bc9230572131507f8da4dc34e50
/cloud-provider-payment8001/src/main/java/com/zhs/cloudproviderpayment8001/dao/PaymentDao.java
ded0f3e13bba8085f8b85f00dbe2937d3e253c30
[]
no_license
zhanghslq/cloud2020
780e4b4977f17bd902b4a8db14e4047f78c144c6
5a76b95bac1153ac4e1b4c92aaf91fa14ec81f62
refs/heads/master
2022-12-05T22:58:37.318683
2020-08-16T04:32:01
2020-08-16T04:32:01
287,873,388
0
0
null
null
null
null
UTF-8
Java
false
false
354
java
package com.zhs.cloudproviderpayment8001.dao; import com.zhs.entity.Payment; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; /** * @author: zhs * @date: 2020/3/28 21:20 */ @Mapper public interface PaymentDao { int insert(@Param("payment") Payment payment); Payment query(@Param("id") Integer id); }
[ "zhanghslq@163.com" ]
zhanghslq@163.com
b6cdd3fc4b60a6bb5ef18ee6714dd568e3f4a3ba
4bbfa242353fe0485fb2a1f75fdd749c7ee05adc
/itable/src/main/java/com/ailk/imssh/user/cmp/UserMarketCmp.java
752f129455bed930a5e5d08e07f24716b1f55aa5
[]
no_license
859162000/infosystem
88b23a5b386600503ec49b14f3b4da4df7a6d091
96d4d50cd9964e713bb95520d6eeb7e4aa32c930
refs/heads/master
2021-01-20T04:39:24.383807
2017-04-01T10:59:24
2017-04-01T10:59:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,840
java
/** * */ package com.ailk.imssh.user.cmp; import com.ailk.ims.common.DBCondition; import com.ailk.openbilling.persistence.cust.entity.CmUserMarket; import com.ailk.openbilling.persistence.itable.entity.IUserMarket; /** * @Description: 数据业务超时处理 * @Company: Asiainfo-Linkage Technologies(China),Inc. Hangzhou * @Author songcc * @Date 2014-1-13 */ public class UserMarketCmp extends UserQuery { public UserMarketCmp() { } /** * userMarket 插入操作 * @param iUserMarket */ public void createUserMarket(IUserMarket iUserMarket) { CmUserMarket cmUserMarket = copyFromIUserMarket(iUserMarket); cmUserMarket.setCreateDate(iUserMarket.getCommitDate()); cmUserMarket.setValidDate(iUserMarket.getValidDate()); this.insert(cmUserMarket); } /** * UserMarket更新操作 * @param iUserMarket */ public void updateUserMarket(IUserMarket iUserMarket) { CmUserMarket cmUserMarket = copyFromIUserMarket(iUserMarket); this.updateByCondition(cmUserMarket, new DBCondition( CmUserMarket.Field.resourceId, cmUserMarket.getResourceId()),new DBCondition( CmUserMarket.Field.productId, iUserMarket.getProductId())); } /** * 刪除操作 * @param iUserMarket */ public void deleteUserMarket(IUserMarket iUserMarket) { this.deleteByCondition(CmUserMarket.class, new DBCondition( CmUserMarket.Field.resourceId, iUserMarket.getUserId()),new DBCondition( CmUserMarket.Field.productId, iUserMarket.getProductId())); } /** * 公用的IUserMarket到CmUserMarket对象值的设置,避免重复代码编写 * @param iUserMarket * @return */ private CmUserMarket copyFromIUserMarket(IUserMarket iUserMarket) { CmUserMarket cmUserMarket = new CmUserMarket(); cmUserMarket.setResourceId(iUserMarket.getUserId()); cmUserMarket.setProductId(iUserMarket.getProductId()); cmUserMarket.setBusiType(iUserMarket.getBusiType()); cmUserMarket.setSpCode(iUserMarket.getSpCode()); cmUserMarket.setSpType(iUserMarket.getSpType()); cmUserMarket.setOperatorCode(iUserMarket.getOperatorCode()); cmUserMarket.setServiceCode(iUserMarket.getServiceCode()); cmUserMarket.setRegionCode(iUserMarket.getRegionCode()); cmUserMarket.setExtend1(iUserMarket.getExtend1()); cmUserMarket.setExtend2(iUserMarket.getExtend2()); cmUserMarket.setRemark(iUserMarket.getRemark()); cmUserMarket.setExpireDate(iUserMarket.getExpireDate()); cmUserMarket.setSoNbr(context.getSoNbr()); cmUserMarket.setSoDate(iUserMarket.getCommitDate()); return cmUserMarket; } }
[ "ljyshiqian@126.com" ]
ljyshiqian@126.com
89056dfbe3f639bb8ce5459e1865e11a9c6cd198
c4623aa95fb8cdd0ee1bc68962711c33af44604e
/src/android/support/v4/widget/ag.java
e9bea79ed00dd1944c3ef25c6f91f415d4669070
[]
no_license
reverseengineeringer/com.yelp.android
48f7f2c830a3a1714112649a6a0a3110f7bdc2b1
b0ac8d4f6cd5fc5543f0d8de399b6d7b3a2184c8
refs/heads/master
2021-01-19T02:07:25.997811
2016-07-19T16:37:24
2016-07-19T16:37:24
38,555,675
1
0
null
null
null
null
UTF-8
Java
false
false
387
java
package android.support.v4.widget; import android.widget.EdgeEffect; class ag { public static boolean a(Object paramObject, float paramFloat1, float paramFloat2) { ((EdgeEffect)paramObject).onPull(paramFloat1, paramFloat2); return true; } } /* Location: * Qualified Name: android.support.v4.widget.ag * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "reverseengineeringer@hackeradmin.com" ]
reverseengineeringer@hackeradmin.com
21fcf21a7051622faff6fa15c83f4aa8e9046854
03bad84313237eee33e1c7b2fb49aed4fb43d0c4
/src/test/java/br/com/projetojhipster/IntegrationTest.java
011237bb5df40a2d33f441d4acfaf670a1519ad0
[]
no_license
JhonMarques/jhipster-sample-application
35fd3c5009649cc6ed9e2a3a9a27ee4483fa5298
8ce2276b08dfafcc6b00f601b5c8620a3de9c075
refs/heads/main
2023-06-03T01:41:17.330904
2021-06-21T20:57:38
2021-06-21T20:57:38
379,060,853
0
0
null
null
null
null
UTF-8
Java
false
false
538
java
package br.com.projetojhipster; import br.com.projetojhipster.JhipsterSampleApplicationApp; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import org.springframework.boot.test.context.SpringBootTest; /** * Base composite annotation for integration tests. */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) @SpringBootTest(classes = JhipsterSampleApplicationApp.class) public @interface IntegrationTest { }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
b2be2c68f9b4a741317e0cf492a0bc1afeb2dbac
5b8f0cbd2076b07481bd62f26f5916d09a050127
/src/A1399.java
3e2214c0e8de930c6ec4533c039ab17caf6904a1
[]
no_license
micgogi/micgogi_algo
b45664de40ef59962c87fc2a1ee81f86c5d7c7ba
7cffe8122c04059f241270bf45e033b1b91ba5df
refs/heads/master
2022-07-13T00:00:56.090834
2022-06-15T14:02:51
2022-06-15T14:02:51
209,986,655
7
3
null
2020-10-20T07:41:03
2019-09-21T13:06:43
Java
UTF-8
Java
false
false
2,096
java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.StringTokenizer; /** * @author Micgogi * on 8/10/2020 7:52 PM * Rahul Gogyani */ public class A1399 { public static void main(String args[]) { FastReader sc = new FastReader(); int t = sc.nextInt(); while (t-- != 0) { int n = sc.nextInt(); int a[] = new int[n]; for (int i = 0; i < n; i++) { a[i] = sc.nextInt(); } Arrays.sort(a); boolean flag = false; if (a.length == 1) flag = true; else { for (int i = 1; i < a.length; i++) { if (a[i] - a[i - 1] <= 1) { flag = true; } else { flag = false; break; } } } if (flag) System.out.println("YES"); else System.out.println("NO"); } } static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader(new InputStreamReader(System.in), 32768); } String next() { while (st == null || !st.hasMoreElements()) { try { st = new StringTokenizer(br.readLine()); } catch (IOException e) { e.printStackTrace(); } } return st.nextToken(); } int nextInt() { return Integer.parseInt(next()); } long nextLong() { return Long.parseLong(next()); } double nextDouble() { return Double.parseDouble(next()); } String nextLine() { String str = ""; try { str = br.readLine(); } catch (IOException e) { e.printStackTrace(); } return str; } } }
[ "rahul.gogyani@gmail.com" ]
rahul.gogyani@gmail.com
e69c34d14f92ff2ce09d0c249a10317abbbfe33e
b2cff282cb547a2fa5657595c98b0f9e519d6e1c
/itests/standalone/basic/src/test/java/org/wildfly/camel/test/mllp/subA/MllpJUnitResourceException.java
8192e89a071de6740027423aed00d27fc1a655c8
[ "Apache-2.0" ]
permissive
tdiesler/wildfly-camel
b0b429a565a64098cc0e2a2e07132e109f7e5e2a
5356d361223c48ceab2f2cda7c6ced72f0f46971
refs/heads/master
2022-09-16T16:21:29.265196
2021-02-22T11:46:05
2021-02-22T11:46:05
26,170,606
1
0
Apache-2.0
2020-07-09T14:54:14
2014-11-04T13:48:25
Java
UTF-8
Java
false
false
1,451
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.wildfly.camel.test.mllp.subA; /** * Base Exception for MLLP JUnit Rules */ public class MllpJUnitResourceException extends RuntimeException { public MllpJUnitResourceException(String message) { super(message); } public MllpJUnitResourceException(String message, Throwable cause) { super(message, cause); } public MllpJUnitResourceException(Throwable cause) { super(cause); } public MllpJUnitResourceException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { super(message, cause, enableSuppression, writableStackTrace); } }
[ "thomas.diesler@jboss.com" ]
thomas.diesler@jboss.com
4a1c4199b11806a6f7db83b5bc0d987762a9b566
b63ce462ac9cae6a223527e59e805b4d68cd7cea
/dboe-base/src/test/java/org/seaborne/dboe/base/objectfile/TestStringFileDisk.java
9e6ef7186230de61f7c85ae0a503c8630fadd0c9
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
permissive
tonywoode/mantis
eccecd6891e44500375eefb99bee7b4b20eb0ef4
22318894704af206ee288ed4b3d3d45c8560f1c0
refs/heads/master
2021-04-29T05:12:34.060913
2017-01-02T17:42:02
2017-01-02T17:42:02
78,016,135
1
0
null
2017-01-04T13:04:47
2017-01-04T13:04:46
null
UTF-8
Java
false
false
1,568
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. * * See the NOTICE file distributed with this work for additional * information regarding copyright ownership. */ package org.seaborne.dboe.base.objectfile; import static org.apache.jena.atlas.lib.FileOps.clearDirectory ; import org.apache.jena.atlas.lib.FileOps ; import org.seaborne.dboe.ConfigTestDBOE ; import org.seaborne.dboe.base.file.FileFactory ; import org.seaborne.dboe.base.file.Location ; import org.seaborne.dboe.base.objectfile.StringFile ; public class TestStringFileDisk extends AbstractTestStringFile { String fn = null ; @Override protected StringFile createStringFile() { String dir = ConfigTestDBOE.getTestingDir() ; clearDirectory(dir) ; Location loc = Location.create(dir) ; fn = loc.getPath("xyz", "node") ; FileOps.delete(fn) ; return FileFactory.createStringFileDisk(fn) ; } @Override protected void removeStringFile(StringFile f) { f.close() ; FileOps.delete(fn) ; } }
[ "andy@seaborne.org" ]
andy@seaborne.org
3148a46f65854ccc79c9779387e34c3c7f873478
9b62a49653d5ef7e2ce8bc9b15ae7fbbcd058cd3
/src/main/java/com/zbkj/crmeb/validatecode/model/ValidateCode.java
df12af5a2feff49d8e983333e32474d84967f4f0
[]
no_license
123guo789/E-commerce-marketing-system
cfcc00d11e0f645f30e3b3c465b4a907dd7ab5bc
14241e0777e86cd15404811bb397f820ffb4dfd9
refs/heads/master
2023-05-30T19:43:39.276634
2021-06-16T13:07:54
2021-06-16T13:07:54
363,798,792
0
0
null
null
null
null
UTF-8
Java
false
false
738
java
package com.zbkj.crmeb.validatecode.model; import java.io.Serializable; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; /** * 验证码类 */ @Data @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) @ApiModel(value="ValidateCode对象", description="验证码类") public class ValidateCode implements Serializable { public ValidateCode(String key, String code) { this.key = key; this.code = code; } @ApiModelProperty(value = "key", required = true) private String key; @ApiModelProperty(value = "code", required = true) private String code; }
[ "321458547@qq.com" ]
321458547@qq.com
17e308987e1c1545d6b10dec3fb82a114c2aae6c
2943f233ac0e073f585c9142f5ff66ecba7d8b13
/MessageStore/src/main/java/jpa/service/external/PostmasterTargetText.java
30b91665ece24d02e95f0f8ecb86995bd6b4b84e
[]
no_license
barbietunnie/jboss-5-to-7-migration
1a519afeee052cf02c51823b5bf2003d99056112
675e33b8510ca09e7efdb5ca63ccb73c93abba8a
refs/heads/master
2021-01-10T18:40:13.068747
2015-05-29T19:01:26
2015-05-29T19:01:26
57,383,835
0
0
null
null
null
null
UTF-8
Java
false
false
1,887
java
package jpa.service.external; import java.util.List; import jpa.model.EmailAddress; import jpa.service.common.EmailAddressService; import jpa.util.EmailAddrUtil; import jpa.util.SpringUtil; import org.apache.log4j.Logger; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; @Component("postmasterTargetText") @Transactional(propagation=Propagation.REQUIRED) public class PostmasterTargetText implements TargetTextProc { static final Logger logger = Logger.getLogger(PostmasterTargetText.class); static final boolean isDebugEnabled = logger.isDebugEnabled(); /** * retrieve all mailing list addresses, and construct a regular expression * that matches any address on the list. * * @return a regular expression */ public String process() { if (isDebugEnabled) { logger.debug("Entering process() method..."); } StringBuffer sb = new StringBuffer(); EmailAddressService dao = SpringUtil.getAppContext().getBean(EmailAddressService.class); List<EmailAddress> list = dao.getByAddressUser("(postmaster|mailmaster|mailadmin|administrator|mailer-(daemon|deamon)|smtp.gateway|majordomo)"); for (int i = 0; i < list.size(); i++) { EmailAddress item = list.get(i); // no display name allowed for list address, just for safety String address = EmailAddrUtil.removeDisplayName(item.getAddress(), true); if (i > 0) { sb.append(","); } sb.append(address); } return sb.toString(); } public static void main(String[] args) { TargetTextProc resolver = new PostmasterTargetText(); try { String regex = resolver.process(); System.err.println("Email regular expression: " + regex); } catch (Exception e) { logger.error("Exception", e); } } }
[ "jackwng@gmail.com" ]
jackwng@gmail.com
9e13949ff63d1c9f0d38898223b4a300b8ec1c4e
5348ddaa295cdc0933a298edf8815cb622e37f3b
/authorization-server/src/main/java/br/com/hubfintech/authorization/AuthorizationTcpRunner.java
062d17c08a36c9369e50fd38a35c65209b4a40d2
[ "Apache-2.0" ]
permissive
JimSP/authorization-soluction
93f228446034b2adda6bdb8d9c70826a70096346
05ffcf69cdd1239a4860218f662741106d019b1c
refs/heads/master
2020-03-25T01:49:22.049714
2018-08-02T22:22:34
2018-08-02T22:23:08
143,258,573
0
0
null
null
null
null
UTF-8
Java
false
false
641
java
package br.com.hubfintech.authorization; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.CommandLineRunner; import org.springframework.stereotype.Component; import br.com.hubfintech.authorization.queues.Receiver; import br.com.hubfintech.authorization.tcp.AuthorizationTcpServer; @Component public class AuthorizationTcpRunner implements CommandLineRunner { @Autowired private AuthorizationTcpServer authorizationTcpServer; @Autowired private Receiver receiver; @Override public void run(String... args) throws Exception { receiver.start(); authorizationTcpServer.start(); } }
[ "alexandre.msl@gmail.com" ]
alexandre.msl@gmail.com
d1fad43fc4f4e6c25506e87b1bf32828cba8d735
f7ec23eb91389884d128fd9f28aa4eecee5a6a69
/wemall-v2/wemall-foundation/src/main/java/com/wemall/foundation/domain/query/RoleGroupQueryObject.java
cedfb05289e98d2e2948fdd1aaa6c0a692b55c39
[]
no_license
springwindyike/wemall
e6c607719b1c11bd256d7c4c9b1ab8b670b64ff2
5765ea058615d3d63897be28a3122e2dfa04e026
refs/heads/master
2020-09-16T14:59:43.207420
2019-03-28T16:56:12
2019-03-28T16:56:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
407
java
package com.wemall.foundation.domain.query; import com.wemall.core.query.QueryObject; import org.springframework.web.servlet.ModelAndView; public class RoleGroupQueryObject extends QueryObject { public RoleGroupQueryObject(String currentPage, ModelAndView mv, String orderBy, String orderType){ super(currentPage, mv, orderBy, orderType); } public RoleGroupQueryObject(){ } }
[ "qiaozhi_china@163.com" ]
qiaozhi_china@163.com
6c8b156fa87c11e1549af7745b73e9ab060d4827
b65f357466efaa3d5b2086e27ac5ce5df5390f32
/DesignSupportTest/app/src/main/java/com/tutosandroidfrance/designsupporttest/DetailActivity.java
4641fefcb273570507732a3c7419b5728933552d
[ "MIT" ]
permissive
florian2412/TutosAndroidFrance
906a8aca4dbb2ff1ffd455a80ae9deba6676ef0a
9c42f73321df65f29e25856b4a03d1c21c47ba26
refs/heads/master
2021-01-18T13:29:12.135440
2015-06-17T15:29:55
2015-06-17T15:29:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,605
java
/* * Copyright (C) 2015 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.tutosandroidfrance.designsupporttest; import android.content.Intent; import android.media.Image; import android.os.Bundle; import android.support.design.widget.CollapsingToolbarLayout; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.MenuItem; import android.widget.ImageView; import com.squareup.picasso.Callback; import com.squareup.picasso.Picasso; import com.tutosandroidfrance.designsupporttest.model.MyObject; import butterknife.ButterKnife; import butterknife.InjectView; public class DetailActivity extends AppCompatActivity { public static final String MY_OBJECT = "MY_OBJECT"; @InjectView(R.id.toolbar) Toolbar toolbar; @InjectView(R.id.collapsing_toolbar) CollapsingToolbarLayout collapsingToolbar; @InjectView(R.id.backgroundImageView) ImageView backgroundImageView; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_detail); ButterKnife.inject(this); setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); MyObject myObject = (MyObject) getIntent().getSerializableExtra(MY_OBJECT); collapsingToolbar.setTitle(myObject.getText()); supportPostponeEnterTransition(); Picasso.with(this).load(myObject.getImageUrl()).centerCrop().fit().into(backgroundImageView, new Callback() { @Override public void onSuccess() { supportStartPostponedEnterTransition(); } @Override public void onError() { } }); } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: finish(); return true; } return super.onOptionsItemSelected(item); } }
[ "champigny.florent@gmail.com" ]
champigny.florent@gmail.com
69f2b5ea047e2118bf5512c3218fcdda4ffa0863
0ea381431ec913bd3a0f69f6c9e7094967aedb21
/main/geo/benchmark/src/boofcv/alg/geo/BenchmarkRuntimeHomography.java
9f46d5fd26e7201422e2f3adf01bf9eb09ebb4a5
[ "Apache-2.0" ]
permissive
eclissato/BoofCV
37dcbd99a217dc2e7917483736eeba845f65545e
71cc50e44c03cc63a80885813bf45a6619f4caf0
refs/heads/master
2021-01-16T01:07:58.181704
2012-09-22T01:57:40
2012-09-22T01:57:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,441
java
/* * Copyright (c) 2011-2012, Peter Abeles. All Rights Reserved. * * This file is part of BoofCV (http://boofcv.org). * * 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 boofcv.alg.geo; import boofcv.abst.geo.EpipolarMatrixEstimator; import boofcv.factory.geo.FactoryEpipolar; import boofcv.misc.Performer; import boofcv.misc.ProfileOperation; import java.util.ArrayList; import java.util.List; /** * @author Peter Abeles */ public class BenchmarkRuntimeHomography extends ArtificialStereoScene { static final long TEST_TIME = 1000; static final int NUM_POINTS = 500; static final boolean PIXELS = true; List<AssociatedPair> pairs4 = new ArrayList<AssociatedPair>(); public class Estimate implements Performer { EpipolarMatrixEstimator alg; String name; List<AssociatedPair> list; public Estimate( String name , EpipolarMatrixEstimator alg , List<AssociatedPair> list ) { this.alg = alg; this.name = name; this.list = list; } @Override public void process() { alg.process(list); alg.getEpipolarMatrix(); } @Override public String getName() { return name; } } public void runAll() { System.out.println("========= Profile numFeatures "+NUM_POINTS); System.out.println(); init(NUM_POINTS, PIXELS,true); for( int i = 0; i < 4; i++ ) { pairs4.add(pairs.get(i)); } System.out.println("Minimum Number"); ProfileOperation.printOpsPerSec(new Estimate("Linear 4 Norm", FactoryEpipolar.computeHomography(true), pairs4), TEST_TIME); ProfileOperation.printOpsPerSec(new Estimate("Linear 4 Unorm",FactoryEpipolar.computeHomography(false),pairs4), TEST_TIME); System.out.println("N"); ProfileOperation.printOpsPerSec(new Estimate("Linear 4", FactoryEpipolar.computeHomography(true),pairs), TEST_TIME); } public static void main( String args[] ) { BenchmarkRuntimeHomography alg = new BenchmarkRuntimeHomography(); alg.runAll(); } }
[ "peter.abeles@gmail.com" ]
peter.abeles@gmail.com
758afbb3413462ec9109bcbc13f91964731912f3
eb9b7c8caef80635b6c1c63d6e1c6cb68c35479a
/Prof Materials/Lab/Lab_7/Lab_7_Security/src/main/java/edu/mum/domain/BillingDetails.java
0a0318d0372b03c30d301b3818e8105e942787fb
[]
no_license
lukpheakdey/Enterprise-Architecture-EA
55640c34da02a05dc7e1e99f484fcbb132fd4f12
440d7d8ac59f0c778c9d109f2d0f6e1a689384d5
refs/heads/master
2020-06-08T07:26:37.240644
2019-06-22T03:35:00
2019-06-22T03:35:00
193,185,600
1
0
null
null
null
null
UTF-8
Java
false
false
2,965
java
package edu.mum.domain; import javax.persistence.*; import java.io.Serializable; import java.util.Date; /** * This is the abstract superclass for BillingDetails. * <p> * A BillingDetails object is always associated with a single * User and depends on the lifecycle of that user. It represents * one of the billing strategies the User has choosen, usually * one BillingDetails is the default in a collection of many. * * @author Christian Bauer */ @Entity @Table(name = "BILLING_DETAILS") @Inheritance(strategy = InheritanceType.JOINED) public abstract class BillingDetails implements Serializable, Comparable { @Id @GeneratedValue(strategy=GenerationType.AUTO) @Column(name = "BILLING_DETAILS_ID") private Long id = null; @Version @Column(name = "OBJ_VERSION") private int version = 0; @Column(name = "OWNER", nullable = false) private String owner; @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "USER_ID", updatable = false) private User user; @Temporal(TemporalType.TIMESTAMP) @Column(name="CREATED", nullable = true, updatable = false) private Date created = new Date(); /** * No-arg constructor for JavaBean tools */ public BillingDetails() {} /** * Full constructor */ protected BillingDetails(String owner, User user) { this.owner = owner; this.user = user; } // ********************** Accessor Methods ********************** // public Long getId() { return id; } public int getVersion() { return version; } public String getOwner() { return owner; } public void setOwner(String owner) { this.owner = owner; } public User getUser() { return user; } public Date getCreated() { return created; } // ********************** Common Methods ********************** // // TODO: This is not a very good equals() implementation public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof BillingDetails)) return false; final BillingDetails billingDetails = (BillingDetails) o; if (! (created.getTime() == billingDetails.created.getTime()) ) return false; if (!getOwner().equals(billingDetails.getOwner())) return false; return true; } public int hashCode() { int result; result = getCreated().hashCode(); result = 29 * result + getOwner().hashCode(); return result; } public int compareTo(Object o) { if (o instanceof BillingDetails) // Don't compare Date objects! Use the time in milliseconds! return Long.valueOf(this.getCreated().getTime()).compareTo( Long.valueOf( ((BillingDetails)o).getCreated().getTime()) ); return 0; } // ********************** Business Methods ********************** // /** * Checks if the billing information is correct. * <p> * Check algorithm is implemented in subclasses. * * @return boolean */ public abstract boolean isValid(); }
[ "luk.pheakdey@gmail.com" ]
luk.pheakdey@gmail.com
2cf2e0110a569e53a933fbca1880a8c9dd817a3a
11b96b6a73adb20a3a4a7b96412623944e10ceef
/javarush/test/level11/lesson11/bonus03/Solution.java
9280ddd6144d6080b6410120fc178c46df749803
[]
no_license
Zerodur/javaRush
a34644703b6b5c35a919ee12979659ce62de8892
8a5b5d808f4cb01aff6fefaf9e373a30b6a20334
refs/heads/master
2020-07-01T19:26:09.075989
2017-02-21T11:20:16
2017-02-21T11:20:19
74,261,525
0
0
null
null
null
null
UTF-8
Java
false
false
1,295
java
package com.javarush.test.level11.lesson11.bonus03; /* Задача по алгоритмам Написать метод, который возвращает минимальное и максимальное числа в массиве. */ public class Solution { public static void main(String[] args) throws Exception { int[] data = new int[]{1, 2, 3, 5, -2, -8, 0, 77, 5, 5}; Pair<Integer, Integer> result = getMinimumAndMaximum(data); System.out.println("Minimum is " + result.x); System.out.println("Maximum is " + result.y); } public static Pair<Integer, Integer> getMinimumAndMaximum(int[] array) { if (array == null || array.length == 0) { return new Pair<Integer, Integer>(null, null); } int min = array[0], max = array[0]; for (int i = 0; i < array.length; i++){ if (array[i] < min){ min = array[i]; }else if(array[i] > max){ max = array[i]; } } return new Pair<Integer, Integer>(min, max); } public static class Pair<X, Y> { public X x; public Y y; public Pair(X x, Y y) { this.x = x; this.y = y; } } }
[ "zerodur91@gmail.com" ]
zerodur91@gmail.com
d5fe9c89953410a85e6750e82595d1b9ce0a077a
883f927fbad8c6452bb85476c3845def52c984c0
/src/main/java/de/flapdoodle/mongoom/datastore/query/QueryOperation.java
e95afcb9520b576575ca688fc1282974328c888b
[]
no_license
michaelmosmann/mongoom.flapdoodle.de
73f4aa59d9fd076647234aae83f76183605eead4
15acd1d9e7faad94f869be67d042d4c5f4fa5e1e
refs/heads/master
2021-07-03T08:32:41.936409
2012-08-13T19:59:54
2012-08-13T19:59:54
989,075
1
2
null
2020-10-13T09:45:44
2010-10-15T04:52:06
Java
UTF-8
Java
false
false
5,896
java
/** * Copyright (C) 2010 Michael Mosmann <michael@mosmann.de> * * 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 de.flapdoodle.mongoom.datastore.query; import java.util.Collection; import java.util.regex.Pattern; import com.google.common.collect.Lists; import de.flapdoodle.mongoom.IListQueryOperation; import de.flapdoodle.mongoom.IQuery; import de.flapdoodle.mongoom.IQueryOperation; import de.flapdoodle.mongoom.datastore.factories.IDBObjectFactory; import de.flapdoodle.mongoom.exceptions.MappingException; import de.flapdoodle.mongoom.exceptions.NotImplementedException; import de.flapdoodle.mongoom.mapping.BSONType; import de.flapdoodle.mongoom.mapping.IContainerTransformation; import de.flapdoodle.mongoom.mapping.properties.PropertyReference; public class QueryOperation<T, Q extends IQuery<T>,V> extends AbstractQueryOperation<T, Q, V> implements IQueryOperation<T, Q,V> { public QueryOperation(Q query, IDBObjectFactory queryBuilder, MappedNameTransformation converter) { super(query,queryBuilder,converter); // _query = query; // _queryBuilder = queryBuilder; //// _field = asName(fields); //// _fields = fields; // _field=converter.name().getMapped(); // _name=converter.name(); //// _converter = converter; // _transformation=converter.transformation(); } @Override public <V> IQueryOperation<T, Q,V> field(PropertyReference<V> field) { return new QueryOperation<T, Q,V>(_query, _queryBuilder, Queries.getConverter(field, _transformation,_name)); } @Override public <C extends Collection<V>, V> IListQueryOperation<T, Q,V> listfield(PropertyReference<C> field) { return new ListQueryOperation<T, Q,V>(_query, _queryBuilder, Queries.getConverter(field, _transformation,_name)); } // @Override public IQueryOperation<T, Q,V> not() { if (_not) throw new MappingException("not.not does not make any sense"); _not = !_not; return this; } @Override public Q eq(V value) { if (_not) throw new MappingException("use ne instead of not.eq"); _queryBuilder.set(_field, asObject(getConverter(false),value)); return _query; } @Override public Q match(Pattern pattern) { // check if dest type is String asObject(getConverter(false),""); IDBObjectFactory factory = _queryBuilder.get(_field); if (_not) factory = factory.get("$not"); factory.set(_field, pattern); // _queryBuilder.set(_field, pattern); return _query; } @Override public Q exists(boolean exists) { if (_not) throw new MappingException("use exists(" + !exists + ") instead"); IDBObjectFactory factory = _queryBuilder.get(_field); // if (_not) factory=factory.get("$not"); factory.set("$exists", exists); // _queryBuilder.set(_field, "$exists", exists); return _query; } @Override public Q size(int value) { IDBObjectFactory factory = _queryBuilder.get(_field); if (_not) factory = factory.get("$not"); factory.set("$size", value); // _queryBuilder.set(_field, "$size", value); return _query; } @Override public <V> Q type(Class<?> type) { BSONType bsonType = BSONType.getType(type); if (bsonType == null) throw new MappingException("Could not convert " + type + " to BSON Type"); IDBObjectFactory factory = _queryBuilder.get(_field); if (_not) factory = factory.get("$not"); factory.set("$type", bsonType.code()); // _queryBuilder.set(_field, "$type", bsonType); return _query; } @Override public Q mod(int mod, int eq) { return opList("$mod", false, Lists.newArrayList(mod, eq)); } @Override public Q in(V... value) { if (_not) throw new MappingException("use nin instead of not.in"); return opList("$in", true, value); } @Override public Q in(Collection<V> values) { if (_not) throw new MappingException("use nin instead of not.in"); return opList("$in", true, values); } @Override public Q all(V... value) { return opList("$all", true, value); } @Override public Q all(Collection<V> values) { return opList("$all", true, values); } @Override public Q nin(V... value) { if (_not) throw new MappingException("use in instead of not.nin"); return opList("$nin", true, value); } @Override public Q nin(Collection<V> values) { if (_not) throw new MappingException("use in instead of not.nin"); return opList("$nin", true, values); } @Override public Q ne(V value) { if (_not) throw new MappingException("use eq instead of not.ne"); return op("$ne", true, value); } @Override public Q gt(V value) { if (_not) throw new MappingException("use lte instead of not.gt"); return op("$gt", true, value); } @Override public Q lt(V value) { if (_not) throw new MappingException("use gte instead of not.lt"); return op("$lt", true, value); } @Override public Q gte(V value) { if (_not) throw new MappingException("use lt instead of not.gte"); return op("$gte", true, value); } @Override public Q lte(V value) { if (_not) throw new MappingException("use gt instead of not.lte"); return op("$lte", true, value); } @Override public SubQuery<T, Q> elemMatch() { if (_transformation instanceof IContainerTransformation) { return new SubQuery<T, Q>(_query, ((IContainerTransformation) _transformation).containerConverter(), _queryBuilder.get( _field).get("$elemMatch")); } throw new MappingException("Field " + _field + " is not an List"); } }
[ "michael@mosmann.de" ]
michael@mosmann.de
4f682168e81b8aa276a3857a6898a56e1043e150
593c08543d7eb1c2492fa11b865a7be23085c586
/org/omg/PortableInterceptor/ORBIdHelper.java
4708a7d287a440bcb17a6ce5077c4052207b166b
[]
no_license
liuzhengyang/jdk-research
bacdb1297ccf3f7f5dd6394aad2d90a4aecf4923
8745611af673afceb662102404439ced180d0666
refs/heads/master
2021-01-10T08:10:38.170309
2016-02-25T09:31:11
2016-02-25T09:31:11
52,512,855
0
0
null
null
null
null
UTF-8
Java
false
false
1,563
java
package org.omg.PortableInterceptor; /** * org/omg/PortableInterceptor/ORBIdHelper.java . * Generated by the IDL-to-Java compiler (portable), version "3.2" * from ../../../../src/share/classes/org/omg/PortableInterceptor/Interceptors.idl * Thursday, December 18, 2014 4:24:04 PM PST */ // This should actually be the CORBA::ORBid type once that is available abstract public class ORBIdHelper { private static String _id = "IDL:omg.org/PortableInterceptor/ORBId:1.0"; public static void insert (org.omg.CORBA.Any a, String that) { org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); a.type (type ()); write (out, that); a.read_value (out.create_input_stream (), type ()); } public static String extract (org.omg.CORBA.Any a) { return read (a.create_input_stream ()); } private static org.omg.CORBA.TypeCode __typeCode = null; synchronized public static org.omg.CORBA.TypeCode type () { if (__typeCode == null) { __typeCode = org.omg.CORBA.ORB.init ().create_string_tc (0); __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.PortableInterceptor.ORBIdHelper.id (), "ORBId", __typeCode); } return __typeCode; } public static String id () { return _id; } public static String read (org.omg.CORBA.portable.InputStream istream) { String value = null; value = istream.read_string (); return value; } public static void write (org.omg.CORBA.portable.OutputStream ostream, String value) { ostream.write_string (value); } }
[ "liuzhengyang@meituan.com" ]
liuzhengyang@meituan.com
9858998dc24dbf79481c5c205f98efd2ea3b55d0
f82113b498d6b80541378753044381cf918bd547
/Lesson 8/Task 8/src/Of76.java
c01884f5ed5f9ddebebe9d064c0043c474dec317
[]
no_license
TheForest13/Lessons
fd389702e24e18ca59ae59f4c128fc906ef8bd8f
739f9e9ba61817378b5834fe56b360ba10192f46
refs/heads/master
2023-02-08T14:15:06.536674
2021-01-03T18:33:28
2021-01-03T18:33:28
326,474,463
0
0
null
null
null
null
UTF-8
Java
false
false
573
java
interface Nose{ int iMethod(); } abstract class Picasso implements Nose { public int iMethod() { return 7; } } class Clowns extends Picasso { } class Act extends Picasso { public int iMethod(){ return 5; } } public class Of76 extends Clowns { public static void main(String[] args) { Nose [] i = new Nose[3]; i[0] = new Act(); i[1] = new Clowns(); i[2] = new Of76(); for (int x = 0; x < 3; x++){ System.out.println(i[x].iMethod() + " " + i[x].getClass()); } } }
[ "guselnikow1999@gmail.com" ]
guselnikow1999@gmail.com
5e513a46573110ff1e83009707586d5046ec93ba
753458bb1ef870387666f338449521c2985d8f0a
/src-app/hu/scelight/gui/overlaycard/LastGameInfoOverlay.java
1881b8620586a7ce80020c91afba6d00c300194f
[ "Apache-2.0" ]
permissive
icza/scelight
f4f7099404077f994aa9c4738a0d38a6b29fe702
7360c30765c9bc2f25b069da4377b37e47d4b426
refs/heads/master
2022-08-23T09:15:32.451515
2022-08-12T13:35:16
2022-08-12T13:35:16
51,061,294
128
23
Apache-2.0
2023-09-12T20:20:51
2016-02-04T08:04:52
Java
UTF-8
Java
false
false
7,458
java
/* * Project Scelight * * Copyright (c) 2013 Andras Belicza <iczaaa@gmail.com> * * This software is the property of Andras Belicza. * Copying, modifying, distributing, refactoring without the author's permission * is prohibited and protected by Law. */ package hu.scelight.gui.overlaycard; import hu.scelight.action.Actions; import hu.scelight.gui.icon.Icons; import hu.scelight.gui.page.repanalyzer.UserColoredTableRenderer; import hu.scelight.sc2.rep.factory.RepParserEngine; import hu.scelight.sc2.rep.repproc.RepProcessor; import hu.scelight.sc2.rep.repproc.User; import hu.scelight.service.env.Env; import hu.scelight.service.settings.Settings; import hu.scelight.util.Utils; import hu.scelightapi.gui.overlaycard.OverlayCardParams; import hu.sllauncher.gui.comp.BorderPanel; import hu.sllauncher.gui.comp.XButton; import hu.sllauncher.gui.comp.XLabel; import hu.sllauncher.gui.comp.table.XTable; import hu.sllauncher.util.gui.RenderablePair; import hu.sllauncher.util.gui.adapter.ActionAdapter; import java.awt.Color; import java.awt.Cursor; import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.nio.file.Path; import java.util.Vector; import java.util.concurrent.atomic.AtomicReference; import javax.swing.Box; import javax.swing.JPanel; import javax.swing.Timer; /** * Last game info overlay card. * * @author Andras Belicza */ @SuppressWarnings( "serial" ) public class LastGameInfoOverlay extends OverlayCard { /** Instance reference. */ private static final AtomicReference< LastGameInfoOverlay > INSTANCE = new AtomicReference<>(); /** * Returns the instance reference. * * @return the instance reference */ public static LastGameInfoOverlay INSTANCE() { return INSTANCE.get(); } /** Overlay card parameters. */ private static final OverlayCardParams PARAMS = new OverlayCardParams(); static { PARAMS.settings = Env.APP_SETTINGS; PARAMS.centerXSetting = Settings.LGI_OVERLAY_CENTER_X; PARAMS.centerYSetting = Settings.LGI_OVERLAY_CENTER_Y; PARAMS.opacitySetting = Settings.LGI_OVERLAY_OPACITY; PARAMS.lockedSetting = Settings.LGI_OVERLAY_LOCKED; PARAMS.focusableSetting = Settings.LGI_OVERLAY_FOCUSABLE; PARAMS.allowOutMainScrSetting = Settings.LGI_OVERLAY_ALLOW_OUT_MAIN_SCR; } /** Last replay file whose info to show. */ private final Path replayFile; /** Timer to close the overlay. */ private final Timer timer; /** (Auto) closer button. */ private final XButton closeButton = new XButton( Icons.F_CROSS.get() ); /** Time remaining to auto-close the overlay. */ private int autoCloseSec = 13; /** * Creates a new {@link LastGameInfoOverlay}. * * @param replayFile last replay file whose info to show */ public LastGameInfoOverlay( final Path replayFile ) { super( PARAMS ); INSTANCE.set( this ); this.replayFile = replayFile; titleLabel.setIcon( Icons.F_INFORMATION_BALLOON.get() ); titleLabel.setText( "Last Game Info" ); titleLabel.allBorder( 3 ); buildGui(); packAndPosition(); setVisible( true ); timer = new Timer( 1000, new ActionAdapter( true ) { @Override public void actionPerformed( final ActionEvent event ) { // We're in the EDT (due to swing Timer) if ( autoCloseSec == 0 ) { close(); return; } closeButton.setText( "_Closing in " + autoCloseSec-- + " sec" ); } } ); timer.start(); } /** * Builds the GUI of the tab. */ private void buildGui() { // Stop the count down if clicked final MouseListener stopperMouseListener = new MouseAdapter() { @Override public void mousePressed( final MouseEvent event ) { if ( !timer.isRunning() ) return; timer.stop(); closeButton.setText( "_Close" ); } }; final RepProcessor repProc = RepParserEngine.getRepProc( replayFile ); if ( repProc == null ) { final XLabel label = new XLabel( "Failed to parse replay!" ).allBorder( 15 ).boldFont().italicFont().color( Color.RED ); cp.addCenter( label ); label.setCursor( Cursor.getDefaultCursor() ); label.addMouseListener( stopperMouseListener ); } else { autoCloseSec += repProc.playerUsers.length; final XTable table = new XTable(); final Vector< Object > columns = Utils.vector( "User Color", "T", "Player", "", "", "", "APM", "SPM", "SQ", "SC%", "Lvl", "Dir" ); final int userColorColIdx = 0; table.setTableCellRenderer( new UserColoredTableRenderer( table, userColorColIdx ) ); final Vector< Vector< Object > > data = new Vector<>(); for ( final User u : repProc.playerUsers ) { final Vector< Object > row = new Vector<>( columns.size() ); row.add( u.getPlayerColor().darkerColor ); row.add( u.slot.teamId + 1 ); row.add( new RenderablePair<>( u.getPlayerColor().icon, u.fullName ) ); row.add( u.player.race.ricon.get() ); row.add( u.player.getResult().ricon.get() ); row.add( u.uid == null ? null : u.uid.getHighestLeague().ricon.get() ); row.add( u.apm ); row.add( u.spm ); row.add( u.sq ); row.add( Env.LANG.formatNumber( u.supplyCappedPercent, 2 ) + '%' ); row.add( u.uid == null ? null : u.uid.getCombinedRaceLevels() ); row.add( u.startDirection ); data.add( row ); } table.getXTableModel().setDataVector( data, columns ); table.pack(); table.setSortable( false ); table.removeColumn( table.getColumnModel().getColumn( userColorColIdx ) ); // Hide color column table.getTableHeader().addMouseListener( stopperMouseListener ); table.addMouseListener( stopperMouseListener ); final Box box = Box.createVerticalBox(); final XLabel infoLabel = new XLabel( "Length: " + repProc.formatLoopTime( repProc.replay.header.getElapsedGameLoops() ) ); infoLabel.addMouseListener( stopperMouseListener ); box.add( new BorderPanel( infoLabel ) ); box.setCursor( Cursor.getDefaultCursor() ); box.add( table.getTableHeader() ); box.add( table ); cp.addCenter( box ); } final JPanel buttonsPanel = new JPanel( new FlowLayout( FlowLayout.RIGHT, 0, 0 ) ); if ( repProc != null ) { final XButton openButton = new XButton( "_Open", Icons.F_CHART.get() ); openButton.setCursor( Cursor.getDefaultCursor() ); openButton.addActionListener( new ActionAdapter() { @Override public void actionPerformed( final ActionEvent event ) { Actions.SHOW_MAIN_FRAME.actionPerformed( event ); Env.MAIN_FRAME.repAnalyzersPage.newRepAnalyzerPage( replayFile, true ); close(); } } ); buttonsPanel.add( openButton ); } closeButton.setCursor( Cursor.getDefaultCursor() ); closeButton.addActionListener( new ActionAdapter() { @Override public void actionPerformed( final ActionEvent event ) { close(); } } ); buttonsPanel.add( closeButton ); cp.addSouth( buttonsPanel ); addMouseListener( stopperMouseListener ); configButton.addMouseListener( stopperMouseListener ); } @Override protected void customOnClose() { timer.stop(); INSTANCE.set( null ); } }
[ "iczaaa@gmail.com" ]
iczaaa@gmail.com
78d2b04134f60ee5ac3aabdfc05d638ede6327bc
873ba033d4c470f88512544bbaeab2a5dbfbf7a6
/Java/CSC130.hansrajd.lab5a/src/QueueADT.java
859c5b7eb7a438911ab84996c9ff5863177d0733
[]
no_license
derickh93/School-Code
a888c88d8cf1270865b84867c4ed4dcaee619613
fea2081956ceb9941f3ceb58e04fbe8f5b7b4f23
refs/heads/main
2023-05-27T04:41:42.522130
2021-06-10T05:22:04
2021-06-10T05:22:04
301,509,770
0
0
null
null
null
null
UTF-8
Java
false
false
959
java
/** * Title: CSC130hansrajd.lab5a * Filename: QueueADT.java * Date Written: October 19, 2017 * Due Date: October 21, 2017 * Description: This interface defines the methods in a Queue. * *@author Derick Hansraj and Wenjie Cao */ public interface QueueADT<T> { /** Adds one item to the rear of the queue. */ public void enqueue(T d) throws QueueException; /** Removes and returns the item at the front of the queue. */ public T dequeue() throws QueueException; /** Returns without removing the item at the front of the queue. */ public T front()throws QueueException; /** Returns without removing the item at the rear of the queue. */ public T rear()throws QueueException; /** Determines whether or not the queue is empty. */ public boolean isFull(); /** Determines whether or not the queue is empty. */ public boolean isEmpty(); /** Returns a string representing the state of the queue. */ public int getSize(); }
[ "derickhansraj@ymail.com" ]
derickhansraj@ymail.com
adadb48ca6cd158da47e3890fdff997faf3e7ae7
f6286ac3462cb103b9d5de3937345d362e1e9cec
/src/com/uniwin/webkey/core/ui/UsersQueryWin.java
b8fc89bb5cd3a1f714a26768f8a70aadea85fca8
[]
no_license
hebut/Collection
55fb4a8a781b01e9ef0624feb4d013e297301ad7
d5e10dda8fdf1123e8995851b5a8473ba7323d33
refs/heads/master
2016-09-05T15:41:35.899529
2014-01-19T06:16:37
2014-01-19T06:16:37
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,182
java
package com.uniwin.webkey.core.ui; import java.util.List; import org.zkoss.spring.SpringUtil; import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.ext.AfterCompose; import org.zkoss.zul.Listbox; import org.zkoss.zul.Listcell; import org.zkoss.zul.Listitem; import org.zkoss.zul.Window; import com.uniwin.webkey.common.exception.DataAccessException; import com.uniwin.webkey.core.itf.IUsersManager; import com.uniwin.webkey.core.model.Users; public class UsersQueryWin extends Window implements AfterCompose { private Listbox users; private IUsersManager usersManager; public List getUsersData() { return usersData; } public void setUsersData(List usersData) { this.usersData = usersData; } public List usersData; public UsersQueryWin() { usersManager = (IUsersManager) SpringUtil.getBean("usersManager"); Listitem item = null; Listcell cell = null; try { usersData = usersManager.getAllUser(); for (Object user : usersData) { item = new Listitem(); cell = new Listcell(((Users) user).getName()); cell.setLabel(((Users) user).getName()); item.appendChild(cell); } } catch (DataAccessException e) { e.printStackTrace(); } } public void afterCompose() { users = (Listbox) this.getFellow("users"); Listitem item = null; Listcell cell = null; try { usersData = usersManager.getAllUser(); for (Object user : usersData) { item = new Listitem(); cell = new Listcell(((Users) user).getName()); cell.setLabel(((Users) user).getName()); item.appendChild(cell); users.appendChild(item); } } catch (DataAccessException e) { e.printStackTrace(); } } public void onPaging$usersPage(Event event) { } }
[ "770506199@qq.com" ]
770506199@qq.com
831e07001ba431bd7e3d90c9995e9f4c9467435f
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/15/15_4c01323440daa5d04c70a8271de1f235c2393cd1/ScalaProtoBufPluginInJava/15_4c01323440daa5d04c70a8271de1f235c2393cd1_ScalaProtoBufPluginInJava_t.java
b4422b35a496e6c50404e5a4127d5bf96c2fd003
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
7,283
java
package pl.project13.protoscala.gen; import com.google.protobuf.DescriptorProtos; import google.protobuf.compiler.Plugin; import pl.project13.protoscala.utils.CommentsGenerator; import pl.project13.protoscala.utils.ScalaNameMangler; import pl.project13.protoscala.utils.SourceStringBuilder; import java.util.List; import java.util.logging.Logger; import static com.google.common.collect.Lists.newArrayList; /** * Date: 3/27/11 * * @author Konrad Malawski */ public class ScalaProtoBufPluginInJava { Logger log = Logger.getLogger(getClass().getSimpleName()); private SourceStringBuilder sourceStringBuilder = new SourceStringBuilder(); // todo may get more specialized? private ScalaNameMangler nameManglerNameMangler = new ScalaNameMangler(); private CommentsGenerator commentsGenerator = new CommentsGenerator(); // code generators private MessageFieldGenerator messageFieldGenerator; private RepeatedFieldGenerator repeatedFieldGenerator; public Plugin.CodeGeneratorResponse handle(Plugin.CodeGeneratorRequest request) { Plugin.CodeGeneratorResponse.Builder responseBuilder = Plugin.CodeGeneratorResponse.newBuilder(); try { // todo the app's heart and soul for (DescriptorProtos.FileDescriptorProto protoFile : request.getProtoFileList()) { log.info("handleOneProtoFile: name: " + protoFile.getName() + ", package: " + protoFile.getPackage()); handleOneProtoFile(responseBuilder, protoFile); } } catch (Exception ex) { responseBuilder.setError("An '" + ex.getClass().getSimpleName() + "' exception occurred, could not compile proto file!"); } log.info("Done."); return responseBuilder.build(); } private void handleOneProtoFile(Plugin.CodeGeneratorResponse.Builder responseBuilder, DescriptorProtos.FileDescriptorProtoOrBuilder protoFile) { Plugin.CodeGeneratorResponse.File.Builder fileBuilder = Plugin.CodeGeneratorResponse.File.getDefaultInstance().newBuilderForType(); handleInitialComments(protoFile); handlePackage(protoFile); handleDependencies(protoFile); handleClassBody(protoFile); String fileName = nameManglerNameMangler.escapeFileName(protoFile.getName()); fileBuilder.setName(fileName); String sourceCode = sourceStringBuilder.toString(); fileBuilder.setContent(sourceCode); responseBuilder.addFile(fileBuilder); } private void handleInitialComments(DescriptorProtos.FileDescriptorProtoOrBuilder protoFile) { commentsGenerator.initialComment(sourceStringBuilder, protoFile); } private void handlePackage(DescriptorProtos.FileDescriptorProtoOrBuilder protoFile) { String javaPackage = protoFile.getOptions().getJavaPackage(); sourceStringBuilder.declarePackage(javaPackage); } private void handleDependencies(DescriptorProtos.FileDescriptorProtoOrBuilder protoFile) { // todo that's most probably wrong ;-) for (String dependency : protoFile.getDependencyList()) { log.info("Add dependency + " + dependency); sourceStringBuilder.importThe(dependency); } } /* * todo this will have a better architecture (a waaaay batter one, I'm just looking at what we have to code against :-)) */ private void handleClassBody(DescriptorProtos.FileDescriptorProtoOrBuilder protoFile) { //todo fix this, inner loops suck for (DescriptorProtos.DescriptorProto descriptorProto : protoFile.getMessageTypeList()) { // declare class declaration handleClassDeclaration(descriptorProto, protoFile); // handle enum types for (DescriptorProtos.EnumDescriptorProto enumDescriptor : descriptorProto.getEnumTypeList()) { handleEnumType(enumDescriptor, protoFile); } // handle nested types // todo this would be generated inner classes etc, hm... for (DescriptorProtos.DescriptorProto nestedType : descriptorProto.getNestedTypeList()) { handleNestedType(sourceStringBuilder, nestedType); // for example like this } // handle extensions // todo maybe later on for (DescriptorProtos.FieldDescriptorProto fieldDescriptorProto : descriptorProto.getExtensionList()) { handleExtension(fieldDescriptorProto, protoFile); } // handle extension ranges // todo maybe later on for (DescriptorProtos.DescriptorProto.ExtensionRange extensionRange : descriptorProto.getExtensionRangeList()) { handleExtensionRange(extensionRange, protoFile); //todo not sure what "extension range" is for now } } } private void handleClassDeclaration(DescriptorProtos.DescriptorProto descriptorProto, DescriptorProtos.FileDescriptorProtoOrBuilder protoFile) { String className = descriptorProto.getName(); log.info("Generating class: " + className); // handle all fields List<String> params = handleFields(descriptorProto.getFieldList()); sourceStringBuilder.declareCaseClass(className, params); } private void handleNestedType(SourceStringBuilder sourceStringBuilder, DescriptorProtos.DescriptorProto nestedType) { // todo handle this with THIS class? Rename it to Type generator maybe etc? } private void handleExtensionRange(DescriptorProtos.DescriptorProto.ExtensionRange extensionRange, DescriptorProtos.FileDescriptorProtoOrBuilder protoFile) { //todo handle me (use *FieldGenerator) } private void handleExtension(DescriptorProtos.FieldDescriptorProto field, DescriptorProtos.FileDescriptorProtoOrBuilder protoFile) { //todo handle me (use *FieldGenerator) } private void handleEnumType(DescriptorProtos.EnumDescriptorProto enumDesc, DescriptorProtos.FileDescriptorProtoOrBuilder protoFile) { //todo handle me (use *FieldGenerator) } /** * Returns a list of field definitions ready to be joined and inserted into the case class definition * * @param fieldList a list of all fields to be prepared * @return a list containing prepared definitions, such as: "name: Type" or "name: Type = defaultVal" */ // todo this will look good rewritten in scala :d private List<String> handleFields(List<DescriptorProtos.FieldDescriptorProto> fieldList) { List<String> params = newArrayList(); for (DescriptorProtos.FieldDescriptorProto field : fieldList) { String fieldName = field.getName(); String typeName = field.getTypeName(); String parameter; if (field.hasDefaultValue()) { String defaultValue = field.getDefaultValue(); parameter = parameterDefinition(fieldName, typeName, defaultValue); } else { parameter = parameterDefinition(fieldName, typeName); } params.add(parameter); } return params; } // todo externalize private String parameterDefinition(String name, String type, String defaultValue) { String parameter = parameterDefinition(name, type); return String.format("%s = %s", parameter, defaultValue); } // todo externalize, and have fun with currying private String parameterDefinition(String name, String type) { return String.format("%s: %s", name, type); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
698456d6fc532667a38297cba29f80e6cd82d39e
b4bd4f75642545bb87417980f680d5e020d76a61
/RememberRows/src/youth/hong/dao/ItemsDao.java
e9d86c4ad062d3f363c8ec2f95c8ea2557ec9d3f
[]
no_license
yomea/Java2
9404299fa08b9be32c5577be8f2d90d00604eac8
78abbf319b1c950a977391171fa49235481dfb49
refs/heads/master
2021-09-04T05:15:57.560334
2018-01-16T06:12:45
2018-01-16T06:12:45
72,603,240
1
0
null
null
null
null
UTF-8
Java
false
false
2,094
java
package youth.hong.dao; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.ArrayList; import java.util.List; import youth.hong.DB.DBHelper; import youth.hong.items.Items; public class ItemsDao { public List<Items> getAllItems() { List<Items> items = new ArrayList<Items>(); Connection conn = DBHelper.getConn(); Statement stmt = DBHelper.getStmt(conn); String sql = "select * from items"; ResultSet rs = DBHelper.getRs(stmt, sql); try { while(rs.next()) { Items item = new Items(); item.setId(rs.getInt("id")); item.setName(rs.getString("name")); item.setCity(rs.getString("city")); item.setNumber(rs.getInt("number")); item.setPrice(rs.getInt("price")); item.setPicture(rs.getString("picture")); items.add(item); } } catch (SQLException e) { e.printStackTrace(); } finally { DBHelper.close(rs); DBHelper.close(stmt); DBHelper.close(conn); } return items; } public Items getItemById(int id) { Connection conn = DBHelper.getConn(); Statement stmt = DBHelper.getStmt(conn); Items item = null; String sql = "select * from items where id=" + id; ResultSet rs = DBHelper.getRs(stmt, sql); try { while(rs.next()) { item = new Items(); item.setId(rs.getInt("id")); item.setName(rs.getString("name")); item.setCity(rs.getString("city")); item.setNumber(rs.getInt("number")); item.setPrice(rs.getInt("price")); item.setPicture(rs.getString("picture")); } } catch (SQLException e) { e.printStackTrace(); } finally { DBHelper.close(rs); DBHelper.close(stmt); DBHelper.close(conn); } return item; } public List<Items> getItems(String str) { List<Items> items = new ArrayList<Items>(); if(str != null && str.length() > 0) { String[] idArray = str.split(","); for(int i = 0; i < idArray.length; i++) { items.add(this.getItemById(Integer.parseInt(idArray[i]))); } } return items; } }
[ "951645267@qq.com" ]
951645267@qq.com