blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
410
| content_id
stringlengths 40
40
| detected_licenses
listlengths 0
51
| license_type
stringclasses 2
values | repo_name
stringlengths 5
132
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringlengths 4
80
| visit_date
timestamp[us] | revision_date
timestamp[us] | committer_date
timestamp[us] | github_id
int64 5.85k
689M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 22
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 131
values | src_encoding
stringclasses 34
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 3
9.45M
| extension
stringclasses 32
values | content
stringlengths 3
9.45M
| authors
listlengths 1
1
| author_id
stringlengths 0
313
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ec80fccef80a56281f0671b02a05db6c9a6fb407 | 77610e3cfcb0afe54d975d1d96a0b30f934daf9b | /LotteryTicketAPI/src/main/java/com/demo/lottery/ticket/jpa/TicketRepository.java | e7a27db0f3a823240261744144c51e25f156b4c6 | []
| no_license | mohomar84/LottoryTicketDemo | 8c7e09a25cff6e9ea6d6c9f577b8c4c5459895ed | db5dbd81e01df59f2be25fe54f448e0e5a569a2c | refs/heads/master | 2020-05-19T16:15:52.111586 | 2019-05-07T05:26:42 | 2019-05-07T05:26:42 | 185,104,321 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 285 | java | package com.demo.lottery.ticket.jpa;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import com.demo.lottery.ticket.dao.Ticket;
@Repository
public interface TicketRepository extends JpaRepository<Ticket, Long>{
}
| [
"[email protected]"
]
| |
c0d9fab2788df3f2c59aabbc005fdf64d4b408c9 | ac3a7a8d120d4e281431329c8c9d388fcfb94342 | /src/test/java/com/leetcode/algorithm/easy/shortestunsortedcontinuoussubarray/SolutionTest.java | 3d43e397c1f5244d70f76faa393c929ec34cd53d | [
"MIT"
]
| permissive | paulxi/LeetCodeJava | c69014c24cda48f80a25227b7ac09c6c5d6cfadc | 10b4430629314c7cfedaae02c7dc4c2318ea6256 | refs/heads/master | 2021-04-03T08:03:16.305484 | 2021-03-02T06:20:24 | 2021-03-02T06:20:24 | 125,126,097 | 3 | 3 | null | null | null | null | UTF-8 | Java | false | false | 519 | java | package com.leetcode.algorithm.easy.shortestunsortedcontinuoussubarray;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
public class SolutionTest {
@Test
public void testCase1() {
Solution solution = new Solution();
assertEquals(5, solution.findUnsortedSubarray(new int[] {2, 6, 4, 8, 10, 9, 15}));
}
@Test
public void testCase2() {
Solution solution = new Solution();
assertEquals(2, solution.findUnsortedSubarray(new int[] {2, 1}));
}
}
| [
"[email protected]"
]
| |
88f3dc0bed161485993e0d9f338e36ebea317f39 | 40cbcc26fd67b81ac46fbb6562486da7560e76fd | /videocompressor/src/main/java/com/sach/mark42/videocompressor/Track.java | daa6d70b4f4318b7b2e2f4f66c0dab09f02b9337 | []
| no_license | Im-Mark42/VideoCompression | 198451f5e5d3ef2776f4f3c88ae02c423ba9bc31 | 60677bb5379a5531672347655a49b635d6cee8f6 | refs/heads/master | 2022-11-16T04:56:22.092190 | 2020-07-06T13:34:00 | 2020-07-06T13:34:00 | 271,814,792 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,157 | java | package com.sach.mark42.videocompressor;
import android.media.MediaCodec;
import android.media.MediaFormat;
import com.coremedia.iso.boxes.AbstractMediaHeaderBox;
import com.coremedia.iso.boxes.SampleDescriptionBox;
import com.coremedia.iso.boxes.SoundMediaHeaderBox;
import com.coremedia.iso.boxes.VideoMediaHeaderBox;
import com.coremedia.iso.boxes.sampleentry.AudioSampleEntry;
import com.coremedia.iso.boxes.sampleentry.VisualSampleEntry;
import com.googlecode.mp4parser.boxes.mp4.ESDescriptorBox;
import com.googlecode.mp4parser.boxes.mp4.objectdescriptors.AudioSpecificConfig;
import com.googlecode.mp4parser.boxes.mp4.objectdescriptors.DecoderConfigDescriptor;
import com.googlecode.mp4parser.boxes.mp4.objectdescriptors.ESDescriptor;
import com.googlecode.mp4parser.boxes.mp4.objectdescriptors.SLConfigDescriptor;
import com.mp4parser.iso14496.part15.AvcConfigurationBox;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Map;
public class Track {
private long trackId = 0;
private ArrayList<Sample> samples = new ArrayList<>();
private long duration = 0;
private String handler;
private AbstractMediaHeaderBox headerBox = null;
private SampleDescriptionBox sampleDescriptionBox = null;
private LinkedList<Integer> syncSamples = null;
private int timeScale;
private Date creationTime = new Date();
private int height;
private int width;
private float volume = 0;
private ArrayList<Long> sampleDurations = new ArrayList<>();
private boolean isAudio = false;
private static Map<Integer, Integer> samplingFrequencyIndexMap = new HashMap<>();
private long lastPresentationTimeUs = 0;
private boolean first = true;
static {
samplingFrequencyIndexMap.put(96000, 0x0);
samplingFrequencyIndexMap.put(88200, 0x1);
samplingFrequencyIndexMap.put(64000, 0x2);
samplingFrequencyIndexMap.put(48000, 0x3);
samplingFrequencyIndexMap.put(44100, 0x4);
samplingFrequencyIndexMap.put(32000, 0x5);
samplingFrequencyIndexMap.put(24000, 0x6);
samplingFrequencyIndexMap.put(22050, 0x7);
samplingFrequencyIndexMap.put(16000, 0x8);
samplingFrequencyIndexMap.put(12000, 0x9);
samplingFrequencyIndexMap.put(11025, 0xa);
samplingFrequencyIndexMap.put(8000, 0xb);
}
public Track(int id, MediaFormat format, boolean isAudio) throws Exception {
trackId = id;
if (!isAudio) {
sampleDurations.add((long)3015);
duration = 3015;
width = format.getInteger(MediaFormat.KEY_WIDTH);
height = format.getInteger(MediaFormat.KEY_HEIGHT);
timeScale = 90000;
syncSamples = new LinkedList<>();
handler = "vide";
headerBox = new VideoMediaHeaderBox();
sampleDescriptionBox = new SampleDescriptionBox();
String mime = format.getString(MediaFormat.KEY_MIME);
if (mime.equals("video/avc")) {
VisualSampleEntry visualSampleEntry = new VisualSampleEntry("avc1");
visualSampleEntry.setDataReferenceIndex(1);
visualSampleEntry.setDepth(24);
visualSampleEntry.setFrameCount(1);
visualSampleEntry.setHorizresolution(72);
visualSampleEntry.setVertresolution(72);
visualSampleEntry.setWidth(width);
visualSampleEntry.setHeight(height);
AvcConfigurationBox avcConfigurationBox = new AvcConfigurationBox();
if (format.getByteBuffer("csd-0") != null) {
ArrayList<byte[]> spsArray = new ArrayList<byte[]>();
ByteBuffer spsBuff = format.getByteBuffer("csd-0");
spsBuff.position(4);
byte[] spsBytes = new byte[spsBuff.remaining()];
spsBuff.get(spsBytes);
spsArray.add(spsBytes);
ArrayList<byte[]> ppsArray = new ArrayList<byte[]>();
ByteBuffer ppsBuff = format.getByteBuffer("csd-1");
ppsBuff.position(4);
byte[] ppsBytes = new byte[ppsBuff.remaining()];
ppsBuff.get(ppsBytes);
ppsArray.add(ppsBytes);
avcConfigurationBox.setSequenceParameterSets(spsArray);
avcConfigurationBox.setPictureParameterSets(ppsArray);
}
//ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(spsBytes);
//SeqParameterSet seqParameterSet = SeqParameterSet.read(byteArrayInputStream);
avcConfigurationBox.setAvcLevelIndication(13);
avcConfigurationBox.setAvcProfileIndication(100);
avcConfigurationBox.setBitDepthLumaMinus8(-1);
avcConfigurationBox.setBitDepthChromaMinus8(-1);
avcConfigurationBox.setChromaFormat(-1);
avcConfigurationBox.setConfigurationVersion(1);
avcConfigurationBox.setLengthSizeMinusOne(3);
avcConfigurationBox.setProfileCompatibility(0);
visualSampleEntry.addBox(avcConfigurationBox);
sampleDescriptionBox.addBox(visualSampleEntry);
} else if (mime.equals("video/mp4v")) {
VisualSampleEntry visualSampleEntry = new VisualSampleEntry("mp4v");
visualSampleEntry.setDataReferenceIndex(1);
visualSampleEntry.setDepth(24);
visualSampleEntry.setFrameCount(1);
visualSampleEntry.setHorizresolution(72);
visualSampleEntry.setVertresolution(72);
visualSampleEntry.setWidth(width);
visualSampleEntry.setHeight(height);
sampleDescriptionBox.addBox(visualSampleEntry);
}
} else {
sampleDurations.add((long)1024);
duration = 1024;
isAudio = true;
volume = 1;
timeScale = format.getInteger(MediaFormat.KEY_SAMPLE_RATE);
handler = "soun";
headerBox = new SoundMediaHeaderBox();
sampleDescriptionBox = new SampleDescriptionBox();
AudioSampleEntry audioSampleEntry = new AudioSampleEntry("mp4a");
audioSampleEntry.setChannelCount(format.getInteger(MediaFormat.KEY_CHANNEL_COUNT));
audioSampleEntry.setSampleRate(format.getInteger(MediaFormat.KEY_SAMPLE_RATE));
audioSampleEntry.setDataReferenceIndex(1);
audioSampleEntry.setSampleSize(16);
ESDescriptorBox esds = new ESDescriptorBox();
ESDescriptor descriptor = new ESDescriptor();
descriptor.setEsId(0);
SLConfigDescriptor slConfigDescriptor = new SLConfigDescriptor();
slConfigDescriptor.setPredefined(2);
descriptor.setSlConfigDescriptor(slConfigDescriptor);
DecoderConfigDescriptor decoderConfigDescriptor = new DecoderConfigDescriptor();
decoderConfigDescriptor.setObjectTypeIndication(0x40);
decoderConfigDescriptor.setStreamType(5);
decoderConfigDescriptor.setBufferSizeDB(1536);
decoderConfigDescriptor.setMaxBitRate(96000);
decoderConfigDescriptor.setAvgBitRate(96000);
AudioSpecificConfig audioSpecificConfig = new AudioSpecificConfig();
audioSpecificConfig.setAudioObjectType(2);
audioSpecificConfig.setSamplingFrequencyIndex(samplingFrequencyIndexMap.get((int)audioSampleEntry.getSampleRate()));
audioSpecificConfig.setChannelConfiguration(audioSampleEntry.getChannelCount());
decoderConfigDescriptor.setAudioSpecificInfo(audioSpecificConfig);
descriptor.setDecoderConfigDescriptor(decoderConfigDescriptor);
ByteBuffer data = descriptor.serialize();
esds.setEsDescriptor(descriptor);
esds.setData(data);
audioSampleEntry.addBox(esds);
sampleDescriptionBox.addBox(audioSampleEntry);
}
}
public long getTrackId() {
return trackId;
}
public void addSample(long offset, MediaCodec.BufferInfo bufferInfo) {
boolean isSyncFrame = !isAudio && (bufferInfo.flags & MediaCodec.BUFFER_FLAG_SYNC_FRAME) != 0;
samples.add(new Sample(offset, bufferInfo.size));
if (syncSamples != null && isSyncFrame) {
syncSamples.add(samples.size());
}
long delta = bufferInfo.presentationTimeUs - lastPresentationTimeUs;
lastPresentationTimeUs = bufferInfo.presentationTimeUs;
delta = (delta * timeScale + 500000L) / 1000000L;
if (!first) {
sampleDurations.add(sampleDurations.size() - 1, delta);
duration += delta;
}
first = false;
}
public ArrayList<Sample> getSamples() {
return samples;
}
public long getDuration() {
return duration;
}
public String getHandler() {
return handler;
}
public AbstractMediaHeaderBox getMediaHeaderBox() {
return headerBox;
}
public SampleDescriptionBox getSampleDescriptionBox() {
return sampleDescriptionBox;
}
public long[] getSyncSamples() {
if (syncSamples == null || syncSamples.isEmpty()) {
return null;
}
long[] returns = new long[syncSamples.size()];
for (int i = 0; i < syncSamples.size(); i++) {
returns[i] = syncSamples.get(i);
}
return returns;
}
public int getTimeScale() {
return timeScale;
}
public Date getCreationTime() {
return creationTime;
}
public int getWidth() {
return width;
}
public int getHeight() {
return height;
}
public float getVolume() {
return volume;
}
public ArrayList<Long> getSampleDurations() {
return sampleDurations;
}
public boolean isAudio() {
return isAudio;
}
}
| [
"[email protected]"
]
| |
f0db1e4231ffab00d357ef695adf6c9bd1fb3622 | 5db474e0db734cf0f47f8ecee7a17e561e7153b4 | /crypto/src/main/java/com/fdm/CryptoCurrency/exception/NotFoundCurrencyException.java | d2d39ac56bd452ef279ea98f63c90b8eb1b22557 | []
| no_license | nxsec1/crypto-api | d961ff7c2c46eb2bf60e7a9fa4f17e658fa9f414 | 3f6c50a0514e0207045775536bf4aa6966ea21d0 | refs/heads/master | 2022-12-15T23:01:37.693100 | 2020-09-09T01:00:07 | 2020-09-09T01:00:07 | 289,851,335 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 265 | java | package com.fdm.CryptoCurrency.exception;
public class NotFoundCurrencyException extends Exception {
/**
*
*/
private static final long serialVersionUID = -4889971604742823620L;
public NotFoundCurrencyException(String message) {
super(message);
}
}
| [
"[email protected]"
]
| |
415451f583d069aaa4d17686ad321eb73826829f | 331ddb62dd2a9045634063391c223556e4d58494 | /src/H05/PraktijkOpdracht2.java | fb84da5e14c4ee2205185f2d2ec5d57b2eb1503b | []
| no_license | Broodje-Bram/inleiding-java | 9504fbd8546ba1f218f68b1530a500976c4d5328 | 7c548da6b7e2c7bb8e13866175aab4b382a77810 | refs/heads/master | 2023-05-31T11:20:24.509959 | 2021-06-09T16:05:23 | 2021-06-09T16:05:23 | 293,850,709 | 0 | 0 | null | 2020-09-08T15:25:22 | 2020-09-08T15:25:22 | null | UTF-8 | Java | false | false | 1,642 | java | package H05;
import java.awt.*;
import java.applet.Applet;
public class PraktijkOpdracht2 extends Applet {
Color opvulkleur;
Color lijnkleur;
int breedte;
int hoogte;
public void init() {
opvulkleur = Color.MAGENTA;
lijnkleur = Color.black;
breedte = 200;
hoogte = 100;
}
public void paint(Graphics g) {
setBackground(Color.white);
g.setColor(Color.black);
//Lijn
g.drawLine(20, 20, 220, 20);
g.drawString("Lijn", 105, 40);
//Rechthoek
g.drawRect(20, 50, breedte, hoogte);
g.drawString("Rechthoek", 90, 165);
//Afgeronde Rechthoek
g.drawRoundRect(20, 170, breedte, hoogte, 30, 30);
g.drawString("Afgeronde Rechthoek", 60, 285);
//Gevulde rechthoek met ovaal
g.setColor(opvulkleur);
g.fillRect(240, 50, breedte, hoogte);
g.setColor(lijnkleur);
g.drawOval(240, 50, breedte, hoogte);
g.drawString("Gevulde rechthoek met ovaal", 260, 165);
//Gevulde Ovaal
g.setColor(opvulkleur);
g.fillOval(240, 170, breedte, hoogte);
g.setColor(lijnkleur);
g.drawString("Gevulde ovaal", 300, 285);
//Taartpunt met ovaal eromheen
g.setColor(opvulkleur);
g.fillArc(460, 50, breedte, hoogte, 0, 45);
g.setColor(lijnkleur);
g.drawOval(460, 50, breedte, hoogte);
g.drawString("Taartpunt met ovaal eromheen", 480, 165);
//Cirkel
g.setColor(lijnkleur);
g.drawArc(510, 170, hoogte, hoogte, 0, 360);
g.drawString("Cirkel", 545, 285);
}
}
| [
"[email protected]"
]
| |
f1a3e052c33dd908cd244f07dc5e129b0b782265 | 8536eeb72d5408419778b848e28b269cc845d032 | /src/dao/ItemDAO.java | 87329dfe5942af083835c12a213400135910c745 | []
| no_license | ccmcwolf/webMVC | d414cea2801b20622fe97f07ab511b572058bcb3 | 9e6eeae8020f88c8af8c5137fb9da513a64ae939 | refs/heads/master | 2021-01-10T13:25:58.626268 | 2016-01-19T03:50:12 | 2016-01-19T03:50:12 | 49,924,386 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 400 | java | package dao;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;
import bo.Customer;
import bo.Item;
public interface ItemDAO {
int add(Item item, Connection conn) throws SQLException ;
int edit(Item item, Connection con) throws SQLException ;
Item get(Item item, Connection con) throws SQLException ;
List<Item> getAll(Connection con) throws SQLException ;
}
| [
"[email protected]"
]
| |
c2d6bcdce2df197f967e6bd2d43a3bb06feb6d78 | dff1d28634101e8cdc053f9b2fcad428f5b09e4e | /src/main/java/com/stuonline/thirds/tpl/UserInfo.java | 66b80577b40a980b218459472f1f062ac9187ebb | [
"Apache-2.0"
]
| permissive | hnxylc8818/StudentOnlineClient | a9580f13f348cfcec59fcb974dbfbc6ef878b336 | 793d8b7b6ce0a812951a691e678dd6e69c722074 | refs/heads/master | 2021-01-01T20:34:05.632843 | 2015-09-26T03:05:19 | 2015-09-26T03:05:19 | 42,436,824 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 742 | java | package com.stuonline.thirds.tpl;
public class UserInfo {
private String userIcon;
private String userName;
private Gender userGender;
private String userNote;
public String getUserIcon() {
return userIcon;
}
public void setUserIcon(String userIcon) {
this.userIcon = userIcon;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public Gender getUserGender() {
return userGender;
}
public void setUserGender(Gender userGender) {
this.userGender = userGender;
}
public String getUserNote() {
return userNote;
}
public void setUserNote(String userNote) {
this.userNote = userNote;
}
public static enum Gender {BOY, GIRL}
}
| [
"[email protected]"
]
| |
f418bb3afe7919d17e8d4b62a94e1c773fecb797 | 8435d89c156abc185962e4a181309318bdf27613 | /src/Models/powerUp.java | dd2b9aa8b4c8d7b6d66dc203ead31fcbd42363b7 | []
| no_license | jonathanStevanka/Basket_Bud | 9061e87b009f64d40f09edfbb87cd93a847bbae0 | bf253800be73399ce1c0f8b59cd0c9948fdc7c90 | refs/heads/master | 2020-04-13T03:17:38.894533 | 2018-12-25T08:41:10 | 2018-12-25T08:41:10 | 162,927,014 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 528 | java | package Models;
import java.util.Random;
/**
* @author Jordan
* This will be our powerUp class where onCollect it will give you one of 3 random effects.
*/
public class powerUp extends gameObject{
public powerUp(int speed, int spawnRate) {
//Set the speed and spawnRate to 1
super(1, 1);
//We'll change these later to whatever feels best.
//Keep in mind that in this case the value will be static.
}
public void ObjectIntersect() {
// TODO Auto-generated method stub
}
}
| [
"[email protected]"
]
| |
1dbda72d676c606059db7a52bb41b94fd2fa0f38 | abe96a95e1ee15dd9a0ccfabbe8527399bfb2cf0 | /app/src/main/java/jp/co/pokemon/cardboardsumo/sumo/SumoImageThread.java | e7b50eed998f2ed9c50edad42a8680c7c01f3fd6 | [
"MIT"
]
| permissive | psyark/CardboardSumo | f6b3966f7ef4c43b33d06b172767fb4178557602 | 766f2d25997fed6de14336bd8bedd5c6e6278bbb | refs/heads/master | 2021-01-19T21:52:00.994794 | 2015-01-05T10:05:19 | 2015-01-05T10:05:19 | 28,499,246 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 723 | java | package jp.co.pokemon.cardboardsumo.sumo;
import android.graphics.Bitmap;
/**
* Created by psyark on 2014/12/24.
*/
public class SumoImageThread implements Runnable {
private final String TAG = SumoImageThread.class.getSimpleName();
private SumoSession session;
private SumoImageCallback callback;
public SumoImageThread(SumoSession session, SumoImageCallback callback) {
this.session = session;
this.callback = callback;
}
@Override
public void run() {
while (true) {
Thread.yield();
Bitmap bitmap = session.imageData.getBitmap();
if (bitmap != null) {
callback.OnImage(bitmap);
}
}
}
}
| [
"[email protected]"
]
| |
b3f03f11d1a5069705cff2f06ba74b166a18dd7f | 9d0019f316d10d3b442024bfb7e446110b497170 | /SimpleJAXRPCWeb/src/simple/jaxrpc/Hello.java | 61016cccdd10fb1387dd63bd2bb72e906fd28629 | []
| no_license | e30532/SimpleApps | 25dec541f7168ba068ce251b6716ade734b57870 | 20014c3de564a7bfa306afccf47df9d89b70ba38 | refs/heads/master | 2023-08-16T18:12:22.000610 | 2023-08-03T07:14:23 | 2023-08-03T07:14:23 | 68,100,341 | 0 | 0 | null | 2016-09-13T12:38:01 | 2016-09-13T10:56:02 | Java | UTF-8 | Java | false | false | 110 | java | package simple.jaxrpc;
public class Hello {
public String say(String name) {
return "Hello " + name;
}
}
| [
"[email protected]"
]
| |
f6504d927d3dd8aece799bebeb26e9dba7a4390b | ed5159d056e98d6715357d0d14a9b3f20b764f89 | /test/irvine/math/group/GaloisFieldTest.java | 147bf5bcf6fa3e7974065f7935c99c13900c22d6 | []
| no_license | flywind2/joeis | c5753169cf562939b04dd246f8a2958e97f74558 | e5efd6971a0062ac99f4fae21a7c78c9f9e74fea | refs/heads/master | 2020-09-13T18:34:35.080552 | 2019-11-19T05:40:55 | 2019-11-19T05:40:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,244 | java | package irvine.math.group;
import irvine.math.api.Group;
import irvine.math.z.Z;
import junit.framework.TestCase;
/**
* Tests the corresponding class.
* @author Sean A. Irvine
*/
public class GaloisFieldTest extends TestCase {
public void testBad() {
try {
new GaloisField(Z.FOUR);
fail();
} catch (final IllegalArgumentException e) {
// ok
}
try {
new GaloisField(Z.FOUR, 1);
fail();
} catch (final IllegalArgumentException e) {
// ok
}
}
public void test3() {
final GaloisField gf3 = new GaloisField(3);
assertEquals(Z.THREE, gf3.characteristic());
assertEquals(Z.THREE, gf3.size());
assertEquals(Z.TWO, gf3.inverse(Z.TWO));
assertEquals(Z.ONE, gf3.multiply(Z.TWO, Z.TWO));
final Group<Z> m = gf3.multiplicativeGroup();
assertEquals(Z.ONE, m.add(Z.TWO, Z.TWO));
}
public void test9() {
final GaloisField gf9 = new GaloisField(Z.THREE, 2);
assertEquals(Z.THREE, gf9.characteristic());
assertEquals(Z.NINE, gf9.size());
assertEquals(Z.FIVE, gf9.inverse(Z.TWO));
assertEquals(Z.TWO, gf9.inverse(Z.FIVE));
assertEquals(Z.ONE, gf9.divide(Z.FIVE, Z.FIVE));
assertEquals(Z.TWO, gf9.divide(Z.SEVEN, Z.EIGHT));
}
}
| [
"[email protected]"
]
| |
de181b3c44d66c4f6a8076015c4d83f0b1b50472 | c320ff075166a5dd93c356109684f931c99e2283 | /src/hw4/ch6/q3/HouseShape.java | 4cac37e905f1f29a8ad3db9579e08226eca83265 | []
| no_license | palmerjoshua/COP4331 | 07e251c06150751b847be61ddacfe13be00942c3 | effc7d90209051008e1718bbe430a64375fa8154 | refs/heads/master | 2021-01-18T01:31:16.154708 | 2015-11-12T19:48:21 | 2015-11-12T19:48:21 | 41,370,781 | 0 | 1 | null | 2015-11-03T17:41:12 | 2015-08-25T15:14:23 | Java | UTF-8 | Java | false | false | 991 | java | package hw4.ch6.q3;
import java.awt.geom.*;
/**
A house shape.
*/
public class HouseShape extends CompoundShape
{
/**
Constructs a house shape.
@param x the left of the bounding rectangle
@param y the top of the bounding rectangle
@param width the width of the bounding rectangle
*/
public HouseShape(int x, int y, int width)
{
Rectangle2D.Double base
= new Rectangle2D.Double(x, y + width, width, width);
// The left bottom of the roof
Point2D.Double r1
= new Point2D.Double(x, y + width);
// The top of the roof
Point2D.Double r2
= new Point2D.Double(x + width / 2, y);
// The right bottom of the roof
Point2D.Double r3
= new Point2D.Double(x + width, y + width);
Line2D.Double roofLeft
= new Line2D.Double(r1, r2);
Line2D.Double roofRight
= new Line2D.Double(r2, r3);
add(base);
add(roofLeft);
add(roofRight);
}
}
| [
"[email protected]"
]
| |
fa4a8e243e0f3ee00275d9bedb2905fb0df589b8 | c17c9c2b6d49ddcf88fa427b0aaea0657e523c18 | /alfresco-jlan/src/main/java/org/alfresco/jlan/oncrpc/nfs/BadCookieException.java | 6dada1ff33976d2c79f350ccff498dc909a0fb19 | []
| no_license | surcloudorg/SurFS-NAS-Protocol | 9a0e92872724f22bee4166d7a9abfe1623d383a4 | cdce2b579f8864b008400c1d1789b0ad50549886 | refs/heads/master | 2020-04-06T06:42:59.272315 | 2016-04-22T09:31:07 | 2016-04-22T09:31:07 | 54,711,148 | 4 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,658 | java | /*
* Copyright (C) 2006-2008 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
*/
package org.alfresco.jlan.oncrpc.nfs;
/**
* Bad Cookie Exception Class
*
* @author gkspencer
*/
public class BadCookieException extends Exception {
private static final long serialVersionUID = -1889652677960375867L;
/**
* Default constructor
*/
public BadCookieException() {
super();
}
/**
* Class constructor
*
* @param msg String
*/
public BadCookieException(String msg) {
super(msg);
}
}
| [
"[email protected]"
]
| |
6ab505ace0c02e4e2478439acc022bd0bb3f1381 | c62de2cd4e858241a5fc786ff6a0e0039497dbd9 | /sdk/src/main/java/com/jccdex/rpc/utils/CheckUtils.java | d69ff49224496218d8fe2cba97d8a0603a43d1bc | [
"MIT"
]
| permissive | xdjiang/Jcc_Jingtum_java | fb12f767479974742b00239a4521f6f1c402b76f | bf6920be02762c5676538df228fc7e2eb9d42fbd | refs/heads/master | 2023-08-17T06:30:26.714055 | 2021-09-27T10:31:35 | 2021-09-27T10:31:35 | 405,048,981 | 0 | 0 | MIT | 2021-09-10T10:55:18 | 2021-09-10T10:55:18 | null | UTF-8 | Java | false | false | 4,089 | java | package com.jccdex.rpc.utils;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import com.jccdex.core.client.Wallet;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import com.jccdex.rpc.client.bean.AmountInfo;
import com.jccdex.rpc.config.Config;
public class CheckUtils {
/**
* 校验钱包地址是否有效
*
* @param address
* @return
*/
public static boolean isValidAddress(String address) {
if (StringUtils.isNotEmpty(address)) {
return Wallet.isValidAddress(address);
}
return false;
}
public static final String CURRENCY_RE = "(([a-zA-Z0-9]{3,6})|([A-F0-9]{40}))";// 邮政编码的正则表达式
public static Pattern pattern = Pattern.compile(CURRENCY_RE);
/**
* 校验金额对象是否有效
*
* @param amount
* @return
*/
public static boolean isValidAmount(AmountInfo amount) {
if (StringUtils.isBlank(amount.getCurrency()) || !pattern.matcher(amount.getCurrency()).find()) {
return false;
}
if (amount.getCurrency().equals(Config.CURRENCY) && StringUtils.isNotBlank(amount.getIssuer())) {
return false;
}
if (!amount.getCurrency().equals(Config.CURRENCY) && !Wallet.isValidAddress(amount.getIssuer())) {
return false;
}
return true;
}
// public static boolean isValidAmount(com.jccdex.rpc.core.coretypes.Amount amount) {
// if (StringUtils.isBlank(amount.currency()) || !pattern.matcher(amount.getCurrency()).find()) {
// return false;
// }
// if (amount.getCurrency().equals(Config.CURRENCY) && StringUtils.isNotBlank(amount.getIssuer())) {
// return false;
// }
// if (!amount.getCurrency().equals(Config.CURRENCY) && !Wallet.isValidAddress(amount.getIssuer())) {
// return false;
// }
// return true;
// }
/**
* 校验金额对象中的金额是否有效
*
* @param value
* @return
*/
public static boolean isValidAmountValue(String value) {
// TODO Auto-generated method stub
return true;
}
/**
* 交易交易类型是否有效
*
* @param type 关系类型
* @param value 关系值
* @return
*/
public static boolean isValidType(String type, String value) {
if (StringUtils.isEmpty(type) || StringUtils.isEmpty(value)) {
return false;
}
String[] offer_types = new String[] { "Sell", "Buy" };
String[] relation_types = new String[] { "trust", "authorize", "freeze", "unfreeze" };
String[] accountSet_types = new String[] { "property", "delegate", "signer" };
boolean flag = false;
switch (type) {
case "relation":
if (ArrayUtils.contains(relation_types, value)) {
flag = true;
}
break;
case "offer":
if (ArrayUtils.contains(offer_types, value)) {
flag = true;
}
break;
case "accountSet":
if (ArrayUtils.contains(accountSet_types, value)) {
flag = true;
}
break;
default:
}
return flag;
}
/**
*
* @param flag/clear_flag
* @return
*/
public static String prepareFlag(Number flag) {
// ripple:TransactionFlag.java
// node.js
/*
* Transaction.set_clear_flags = {
* AccountSet: {
* asfRequireDest: 1,
* asfRequireAuth: 2,
* asfDisallowSWT: 3,
* asfDisableMaster: 4,
* asfNoFreeze: 6,
* asfGlobalFreeze: 7
* }
* };
*/
// return (flag instanceof Number) ? flag : (SetClearFlags[flag] || SetClearFlags["asf" + flag]);
return "";
}
/**
* 判断string是否为数字
*
* @param ledger_index
* @return
*/
public static boolean isNumeric(String ledger_index) {
if (StringUtils.isNotEmpty(ledger_index)) {
Pattern pattern = Pattern.compile("[0-9]*");
Matcher isNum = pattern.matcher(ledger_index);
if (!isNum.matches()) {
return false;
}
}
return true;
}
/**
* 判断账本hash是否有效
*
* @param ledger_hash
* @return
*/
public static boolean isValidHash(String ledger_hash) {
if (StringUtils.isNotEmpty(ledger_hash)) {
}
return true;
}
}
| [
"[email protected]"
]
| |
9d2efca6a3aa2a39ce3d78519eb02e510fdfc4f6 | 8402fa1e02666a28bf81e76cc6ea0da4016eaff3 | /Source/Cinemetrics/app/build/generated/source/r/debug/com/google/android/gms/cast/R.java | 41ce13e80aba82729920ade1922d269c0e472b71 | []
| no_license | VinuthnaGummadi/Cinemetrics-Project | f4f88611ff956e6b15d5a03d8bdae9bf048cfe27 | 098931717b13ae4c7639e04ec64a7b1bf2e59ede | refs/heads/master | 2021-01-19T12:39:29.822126 | 2017-10-23T22:25:52 | 2017-10-23T22:25:52 | 82,328,286 | 0 | 0 | null | 2017-02-17T18:55:44 | 2017-02-17T18:55:44 | null | UTF-8 | Java | false | false | 21,941 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package com.google.android.gms.cast;
public final class R {
public static final class attr {
public static final int adSize = 0x7f01002a;
public static final int adSizes = 0x7f01002b;
public static final int adUnitId = 0x7f01002c;
public static final int ambientEnabled = 0x7f010096;
public static final int appTheme = 0x7f010163;
public static final int buttonSize = 0x7f0100b8;
public static final int buyButtonAppearance = 0x7f01016a;
public static final int buyButtonHeight = 0x7f010167;
public static final int buyButtonText = 0x7f010169;
public static final int buyButtonWidth = 0x7f010168;
public static final int cameraBearing = 0x7f010087;
public static final int cameraTargetLat = 0x7f010088;
public static final int cameraTargetLng = 0x7f010089;
public static final int cameraTilt = 0x7f01008a;
public static final int cameraZoom = 0x7f01008b;
public static final int circleCrop = 0x7f010085;
public static final int colorScheme = 0x7f0100b9;
public static final int environment = 0x7f010164;
public static final int fragmentMode = 0x7f010166;
public static final int fragmentStyle = 0x7f010165;
public static final int imageAspectRatio = 0x7f010084;
public static final int imageAspectRatioAdjust = 0x7f010083;
public static final int liteMode = 0x7f01008c;
public static final int mapType = 0x7f010086;
public static final int maskedWalletDetailsBackground = 0x7f01016d;
public static final int maskedWalletDetailsButtonBackground = 0x7f01016f;
public static final int maskedWalletDetailsButtonTextAppearance = 0x7f01016e;
public static final int maskedWalletDetailsHeaderTextAppearance = 0x7f01016c;
public static final int maskedWalletDetailsLogoImageType = 0x7f010171;
public static final int maskedWalletDetailsLogoTextColor = 0x7f010170;
public static final int maskedWalletDetailsTextAppearance = 0x7f01016b;
public static final int scopeUris = 0x7f0100ba;
public static final int uiCompass = 0x7f01008d;
public static final int uiMapToolbar = 0x7f010095;
public static final int uiRotateGestures = 0x7f01008e;
public static final int uiScrollGestures = 0x7f01008f;
public static final int uiTiltGestures = 0x7f010090;
public static final int uiZoomControls = 0x7f010091;
public static final int uiZoomGestures = 0x7f010092;
public static final int useViewLifecycle = 0x7f010093;
public static final int windowTransitionStyle = 0x7f010059;
public static final int zOrderOnTop = 0x7f010094;
}
public static final class color {
public static final int common_action_bar_splitter = 0x7f0e0026;
public static final int common_google_signin_btn_text_dark = 0x7f0e00a5;
public static final int common_google_signin_btn_text_dark_default = 0x7f0e0027;
public static final int common_google_signin_btn_text_dark_disabled = 0x7f0e0028;
public static final int common_google_signin_btn_text_dark_focused = 0x7f0e0029;
public static final int common_google_signin_btn_text_dark_pressed = 0x7f0e002a;
public static final int common_google_signin_btn_text_light = 0x7f0e00a6;
public static final int common_google_signin_btn_text_light_default = 0x7f0e002b;
public static final int common_google_signin_btn_text_light_disabled = 0x7f0e002c;
public static final int common_google_signin_btn_text_light_focused = 0x7f0e002d;
public static final int common_google_signin_btn_text_light_pressed = 0x7f0e002e;
public static final int common_plus_signin_btn_text_dark = 0x7f0e00a7;
public static final int common_plus_signin_btn_text_dark_default = 0x7f0e002f;
public static final int common_plus_signin_btn_text_dark_disabled = 0x7f0e0030;
public static final int common_plus_signin_btn_text_dark_focused = 0x7f0e0031;
public static final int common_plus_signin_btn_text_dark_pressed = 0x7f0e0032;
public static final int common_plus_signin_btn_text_light = 0x7f0e00a8;
public static final int common_plus_signin_btn_text_light_default = 0x7f0e0033;
public static final int common_plus_signin_btn_text_light_disabled = 0x7f0e0034;
public static final int common_plus_signin_btn_text_light_focused = 0x7f0e0035;
public static final int common_plus_signin_btn_text_light_pressed = 0x7f0e0036;
public static final int place_autocomplete_prediction_primary_text = 0x7f0e005e;
public static final int place_autocomplete_prediction_primary_text_highlight = 0x7f0e005f;
public static final int place_autocomplete_prediction_secondary_text = 0x7f0e0060;
public static final int place_autocomplete_search_hint = 0x7f0e0061;
public static final int place_autocomplete_search_text = 0x7f0e0062;
public static final int place_autocomplete_separator = 0x7f0e0063;
public static final int wallet_bright_foreground_disabled_holo_light = 0x7f0e008e;
public static final int wallet_bright_foreground_holo_dark = 0x7f0e008f;
public static final int wallet_bright_foreground_holo_light = 0x7f0e0090;
public static final int wallet_dim_foreground_disabled_holo_dark = 0x7f0e0091;
public static final int wallet_dim_foreground_holo_dark = 0x7f0e0092;
public static final int wallet_dim_foreground_inverse_disabled_holo_dark = 0x7f0e0093;
public static final int wallet_dim_foreground_inverse_holo_dark = 0x7f0e0094;
public static final int wallet_highlighted_text_holo_dark = 0x7f0e0095;
public static final int wallet_highlighted_text_holo_light = 0x7f0e0096;
public static final int wallet_hint_foreground_holo_dark = 0x7f0e0097;
public static final int wallet_hint_foreground_holo_light = 0x7f0e0098;
public static final int wallet_holo_blue_light = 0x7f0e0099;
public static final int wallet_link_text_light = 0x7f0e009a;
public static final int wallet_primary_text_holo_light = 0x7f0e00ab;
public static final int wallet_secondary_text_holo_dark = 0x7f0e00ac;
}
public static final class dimen {
public static final int place_autocomplete_button_padding = 0x7f0a0092;
public static final int place_autocomplete_powered_by_google_height = 0x7f0a0093;
public static final int place_autocomplete_powered_by_google_start = 0x7f0a0094;
public static final int place_autocomplete_prediction_height = 0x7f0a0095;
public static final int place_autocomplete_prediction_horizontal_margin = 0x7f0a0096;
public static final int place_autocomplete_prediction_primary_text = 0x7f0a0097;
public static final int place_autocomplete_prediction_secondary_text = 0x7f0a0098;
public static final int place_autocomplete_progress_horizontal_margin = 0x7f0a0099;
public static final int place_autocomplete_progress_size = 0x7f0a009a;
public static final int place_autocomplete_separator_start = 0x7f0a009b;
}
public static final class drawable {
public static final int cast_ic_notification_0 = 0x7f02004b;
public static final int cast_ic_notification_1 = 0x7f02004c;
public static final int cast_ic_notification_2 = 0x7f02004d;
public static final int cast_ic_notification_connecting = 0x7f02004e;
public static final int cast_ic_notification_on = 0x7f02004f;
public static final int common_full_open_on_phone = 0x7f020062;
public static final int common_google_signin_btn_icon_dark = 0x7f020063;
public static final int common_google_signin_btn_icon_dark_disabled = 0x7f020064;
public static final int common_google_signin_btn_icon_dark_focused = 0x7f020065;
public static final int common_google_signin_btn_icon_dark_normal = 0x7f020066;
public static final int common_google_signin_btn_icon_dark_pressed = 0x7f020067;
public static final int common_google_signin_btn_icon_light = 0x7f020068;
public static final int common_google_signin_btn_icon_light_disabled = 0x7f020069;
public static final int common_google_signin_btn_icon_light_focused = 0x7f02006a;
public static final int common_google_signin_btn_icon_light_normal = 0x7f02006b;
public static final int common_google_signin_btn_icon_light_pressed = 0x7f02006c;
public static final int common_google_signin_btn_text_dark = 0x7f02006d;
public static final int common_google_signin_btn_text_dark_disabled = 0x7f02006e;
public static final int common_google_signin_btn_text_dark_focused = 0x7f02006f;
public static final int common_google_signin_btn_text_dark_normal = 0x7f020070;
public static final int common_google_signin_btn_text_dark_pressed = 0x7f020071;
public static final int common_google_signin_btn_text_light = 0x7f020072;
public static final int common_google_signin_btn_text_light_disabled = 0x7f020073;
public static final int common_google_signin_btn_text_light_focused = 0x7f020074;
public static final int common_google_signin_btn_text_light_normal = 0x7f020075;
public static final int common_google_signin_btn_text_light_pressed = 0x7f020076;
public static final int common_ic_googleplayservices = 0x7f020077;
public static final int common_plus_signin_btn_icon_dark = 0x7f020078;
public static final int common_plus_signin_btn_icon_dark_disabled = 0x7f020079;
public static final int common_plus_signin_btn_icon_dark_focused = 0x7f02007a;
public static final int common_plus_signin_btn_icon_dark_normal = 0x7f02007b;
public static final int common_plus_signin_btn_icon_dark_pressed = 0x7f02007c;
public static final int common_plus_signin_btn_icon_light = 0x7f02007d;
public static final int common_plus_signin_btn_icon_light_disabled = 0x7f02007e;
public static final int common_plus_signin_btn_icon_light_focused = 0x7f02007f;
public static final int common_plus_signin_btn_icon_light_normal = 0x7f020080;
public static final int common_plus_signin_btn_icon_light_pressed = 0x7f020081;
public static final int common_plus_signin_btn_text_dark = 0x7f020082;
public static final int common_plus_signin_btn_text_dark_disabled = 0x7f020083;
public static final int common_plus_signin_btn_text_dark_focused = 0x7f020084;
public static final int common_plus_signin_btn_text_dark_normal = 0x7f020085;
public static final int common_plus_signin_btn_text_dark_pressed = 0x7f020086;
public static final int common_plus_signin_btn_text_light = 0x7f020087;
public static final int common_plus_signin_btn_text_light_disabled = 0x7f020088;
public static final int common_plus_signin_btn_text_light_focused = 0x7f020089;
public static final int common_plus_signin_btn_text_light_normal = 0x7f02008a;
public static final int common_plus_signin_btn_text_light_pressed = 0x7f02008b;
public static final int ic_plusone_medium_off_client = 0x7f0200b2;
public static final int ic_plusone_small_off_client = 0x7f0200b3;
public static final int ic_plusone_standard_off_client = 0x7f0200b4;
public static final int ic_plusone_tall_off_client = 0x7f0200b5;
public static final int places_ic_clear = 0x7f0200e1;
public static final int places_ic_search = 0x7f0200e2;
public static final int powered_by_google_dark = 0x7f0200e4;
public static final int powered_by_google_light = 0x7f0200e5;
}
public static final class id {
public static final int adjust_height = 0x7f0f003b;
public static final int adjust_width = 0x7f0f003c;
public static final int android_pay = 0x7f0f0067;
public static final int android_pay_dark = 0x7f0f005e;
public static final int android_pay_light = 0x7f0f005f;
public static final int android_pay_light_with_border = 0x7f0f0060;
public static final int auto = 0x7f0f0048;
public static final int book_now = 0x7f0f0057;
public static final int buyButton = 0x7f0f0054;
public static final int buy_now = 0x7f0f0058;
public static final int buy_with = 0x7f0f0059;
public static final int buy_with_google = 0x7f0f005a;
public static final int cast_notification_id = 0x7f0f0004;
public static final int classic = 0x7f0f0061;
public static final int dark = 0x7f0f0049;
public static final int donate_with = 0x7f0f005b;
public static final int donate_with_google = 0x7f0f005c;
public static final int google_wallet_classic = 0x7f0f0062;
public static final int google_wallet_grayscale = 0x7f0f0063;
public static final int google_wallet_monochrome = 0x7f0f0064;
public static final int grayscale = 0x7f0f0065;
public static final int holo_dark = 0x7f0f004e;
public static final int holo_light = 0x7f0f004f;
public static final int hybrid = 0x7f0f003d;
public static final int icon_only = 0x7f0f0045;
public static final int light = 0x7f0f004a;
public static final int logo_only = 0x7f0f005d;
public static final int match_parent = 0x7f0f0056;
public static final int monochrome = 0x7f0f0066;
public static final int none = 0x7f0f0011;
public static final int normal = 0x7f0f000d;
public static final int place_autocomplete_clear_button = 0x7f0f0139;
public static final int place_autocomplete_powered_by_google = 0x7f0f013b;
public static final int place_autocomplete_prediction_primary_text = 0x7f0f013d;
public static final int place_autocomplete_prediction_secondary_text = 0x7f0f013e;
public static final int place_autocomplete_progress = 0x7f0f013c;
public static final int place_autocomplete_search_button = 0x7f0f0137;
public static final int place_autocomplete_search_input = 0x7f0f0138;
public static final int place_autocomplete_separator = 0x7f0f013a;
public static final int production = 0x7f0f0050;
public static final int sandbox = 0x7f0f0051;
public static final int satellite = 0x7f0f003e;
public static final int selectionDetails = 0x7f0f0055;
public static final int slide = 0x7f0f0030;
public static final int standard = 0x7f0f0046;
public static final int strict_sandbox = 0x7f0f0052;
public static final int terrain = 0x7f0f003f;
public static final int test = 0x7f0f0053;
public static final int wide = 0x7f0f0047;
public static final int wrap_content = 0x7f0f004d;
}
public static final class integer {
public static final int google_play_services_version = 0x7f0c0005;
}
public static final class layout {
public static final int place_autocomplete_fragment = 0x7f04004a;
public static final int place_autocomplete_item_powered_by_google = 0x7f04004b;
public static final int place_autocomplete_item_prediction = 0x7f04004c;
public static final int place_autocomplete_progress = 0x7f04004d;
}
public static final class raw {
public static final int gtm_analytics = 0x7f060000;
}
public static final class string {
public static final int accept = 0x7f07008f;
public static final int auth_google_play_services_client_facebook_display_name = 0x7f070092;
public static final int auth_google_play_services_client_google_display_name = 0x7f070093;
public static final int cast_notification_connected_message = 0x7f070094;
public static final int cast_notification_connecting_message = 0x7f070095;
public static final int cast_notification_disconnect = 0x7f070096;
public static final int common_google_play_services_api_unavailable_text = 0x7f070023;
public static final int common_google_play_services_enable_button = 0x7f070024;
public static final int common_google_play_services_enable_text = 0x7f070025;
public static final int common_google_play_services_enable_title = 0x7f070026;
public static final int common_google_play_services_install_button = 0x7f070027;
public static final int common_google_play_services_install_text_phone = 0x7f070028;
public static final int common_google_play_services_install_text_tablet = 0x7f070029;
public static final int common_google_play_services_install_title = 0x7f07002a;
public static final int common_google_play_services_invalid_account_text = 0x7f07002b;
public static final int common_google_play_services_invalid_account_title = 0x7f07002c;
public static final int common_google_play_services_network_error_text = 0x7f07002d;
public static final int common_google_play_services_network_error_title = 0x7f07002e;
public static final int common_google_play_services_notification_ticker = 0x7f07002f;
public static final int common_google_play_services_restricted_profile_text = 0x7f070030;
public static final int common_google_play_services_restricted_profile_title = 0x7f070031;
public static final int common_google_play_services_sign_in_failed_text = 0x7f070032;
public static final int common_google_play_services_sign_in_failed_title = 0x7f070033;
public static final int common_google_play_services_unknown_issue = 0x7f070034;
public static final int common_google_play_services_unsupported_text = 0x7f070035;
public static final int common_google_play_services_unsupported_title = 0x7f070036;
public static final int common_google_play_services_update_button = 0x7f070037;
public static final int common_google_play_services_update_text = 0x7f070038;
public static final int common_google_play_services_update_title = 0x7f070039;
public static final int common_google_play_services_updating_text = 0x7f07003a;
public static final int common_google_play_services_updating_title = 0x7f07003b;
public static final int common_google_play_services_wear_update_text = 0x7f07003c;
public static final int common_open_on_phone = 0x7f07003d;
public static final int common_signin_button_text = 0x7f07003e;
public static final int common_signin_button_text_long = 0x7f07003f;
public static final int create_calendar_message = 0x7f070099;
public static final int create_calendar_title = 0x7f07009a;
public static final int decline = 0x7f07009b;
public static final int place_autocomplete_clear_button = 0x7f07004c;
public static final int place_autocomplete_search_hint = 0x7f07004d;
public static final int store_picture_message = 0x7f0700a4;
public static final int store_picture_title = 0x7f0700a5;
public static final int wallet_buy_button_place_holder = 0x7f07004f;
}
public static final class style {
public static final int Theme_AppInvite_Preview = 0x7f0b010f;
public static final int Theme_AppInvite_Preview_Base = 0x7f0b001a;
public static final int Theme_IAPTheme = 0x7f0b0110;
public static final int WalletFragmentDefaultButtonTextAppearance = 0x7f0b0118;
public static final int WalletFragmentDefaultDetailsHeaderTextAppearance = 0x7f0b0119;
public static final int WalletFragmentDefaultDetailsTextAppearance = 0x7f0b011a;
public static final int WalletFragmentDefaultStyle = 0x7f0b011b;
}
public static final class styleable {
public static final int[] AdsAttrs = { 0x7f01002a, 0x7f01002b, 0x7f01002c };
public static final int AdsAttrs_adSize = 0;
public static final int AdsAttrs_adSizes = 1;
public static final int AdsAttrs_adUnitId = 2;
public static final int[] CustomWalletTheme = { 0x7f010059 };
public static final int CustomWalletTheme_windowTransitionStyle = 0;
public static final int[] LoadingImageView = { 0x7f010083, 0x7f010084, 0x7f010085 };
public static final int LoadingImageView_circleCrop = 2;
public static final int LoadingImageView_imageAspectRatio = 1;
public static final int LoadingImageView_imageAspectRatioAdjust = 0;
public static final int[] MapAttrs = { 0x7f010086, 0x7f010087, 0x7f010088, 0x7f010089, 0x7f01008a, 0x7f01008b, 0x7f01008c, 0x7f01008d, 0x7f01008e, 0x7f01008f, 0x7f010090, 0x7f010091, 0x7f010092, 0x7f010093, 0x7f010094, 0x7f010095, 0x7f010096 };
public static final int MapAttrs_ambientEnabled = 16;
public static final int MapAttrs_cameraBearing = 1;
public static final int MapAttrs_cameraTargetLat = 2;
public static final int MapAttrs_cameraTargetLng = 3;
public static final int MapAttrs_cameraTilt = 4;
public static final int MapAttrs_cameraZoom = 5;
public static final int MapAttrs_liteMode = 6;
public static final int MapAttrs_mapType = 0;
public static final int MapAttrs_uiCompass = 7;
public static final int MapAttrs_uiMapToolbar = 15;
public static final int MapAttrs_uiRotateGestures = 8;
public static final int MapAttrs_uiScrollGestures = 9;
public static final int MapAttrs_uiTiltGestures = 10;
public static final int MapAttrs_uiZoomControls = 11;
public static final int MapAttrs_uiZoomGestures = 12;
public static final int MapAttrs_useViewLifecycle = 13;
public static final int MapAttrs_zOrderOnTop = 14;
public static final int[] SignInButton = { 0x7f0100b8, 0x7f0100b9, 0x7f0100ba };
public static final int SignInButton_buttonSize = 0;
public static final int SignInButton_colorScheme = 1;
public static final int SignInButton_scopeUris = 2;
public static final int[] WalletFragmentOptions = { 0x7f010163, 0x7f010164, 0x7f010165, 0x7f010166 };
public static final int WalletFragmentOptions_appTheme = 0;
public static final int WalletFragmentOptions_environment = 1;
public static final int WalletFragmentOptions_fragmentMode = 3;
public static final int WalletFragmentOptions_fragmentStyle = 2;
public static final int[] WalletFragmentStyle = { 0x7f010167, 0x7f010168, 0x7f010169, 0x7f01016a, 0x7f01016b, 0x7f01016c, 0x7f01016d, 0x7f01016e, 0x7f01016f, 0x7f010170, 0x7f010171 };
public static final int WalletFragmentStyle_buyButtonAppearance = 3;
public static final int WalletFragmentStyle_buyButtonHeight = 0;
public static final int WalletFragmentStyle_buyButtonText = 2;
public static final int WalletFragmentStyle_buyButtonWidth = 1;
public static final int WalletFragmentStyle_maskedWalletDetailsBackground = 6;
public static final int WalletFragmentStyle_maskedWalletDetailsButtonBackground = 8;
public static final int WalletFragmentStyle_maskedWalletDetailsButtonTextAppearance = 7;
public static final int WalletFragmentStyle_maskedWalletDetailsHeaderTextAppearance = 5;
public static final int WalletFragmentStyle_maskedWalletDetailsLogoImageType = 10;
public static final int WalletFragmentStyle_maskedWalletDetailsLogoTextColor = 9;
public static final int WalletFragmentStyle_maskedWalletDetailsTextAppearance = 4;
}
}
| [
"[email protected]"
]
| |
a2ab3d511687817c42ca929be7ea82b6fd203e6a | 06c16d686b07845907b4446ac3b3275e9db34a85 | /queComemos-3053-04/src/main/java/grupo4/dds/receta/busqueda/postProcesamiento/PostProcesamiento.java | 6b888a6c468c86003b67d07996c6b283aaf70c9c | []
| no_license | fsena92/2015-vn-group-4 | 6e4de24c1d8927067545d92451aef880e9a48a8d | ec93daee6e1f5fc046940db56a461c7e533b7c07 | refs/heads/master | 2021-01-10T11:07:34.806074 | 2016-04-23T21:15:47 | 2016-04-23T21:15:47 | 50,967,630 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 207 | java | package grupo4.dds.receta.busqueda.postProcesamiento;
import grupo4.dds.receta.Receta;
import java.util.List;
public interface PostProcesamiento {
public List<Receta> procesar(List<Receta> recetas);
}
| [
"[email protected]"
]
| |
06ab9f7a68b662b99e30639d84a25a350212277e | ab4c5208ec085d21f7a22af45ef8c81ca8ff8c5b | /src/java/com/yahoo/dtf/actions/selenium/commands/state/Getalert.java | 03409c18058741c1c286876bc0ad14b8036321d8 | [
"BSD-3-Clause"
]
| permissive | rlgomes/dtf | cea9a6b0debe6ddb8be696e9a51359da23051496 | 1c578fe199c9c56f062ee150345fe12db6eb3829 | refs/heads/master | 2020-06-05T04:06:37.067918 | 2011-11-13T00:14:52 | 2011-11-13T00:14:52 | 257,098 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,372 | java | package com.yahoo.dtf.actions.selenium.commands.state;
import com.yahoo.dtf.exception.DTFException;
/**
* @dtf.tag getAlert
* @dtf.skip.index
*
* @dtf.since 1.0
* @dtf.author Rodney Gomes
*
* @dtf.tag.desc <p>
* Retrieves the message of a JavaScript alert generated during
* the previous action, or fail if there were no alerts. Getting
* an alert has the same effect as manually clicking OK. If an
* alert is generated but you do not get/verify it, the next
* Selenium action will fail.
*
* <b>NOTE:</b> under Selenium, JavaScript alerts will NOT pop up
* a visible alert dialog.
* <b>NOTE:</b> Selenium does NOT support JavaScript alerts that
* are generated in a page's onload() event handler. In this case
* a visible dialog WILL be generated and Selenium will hang
* until someone manually clicks OK.
* </p>
*
* @dtf.tag.example
* <selenium baseurl="http://someplace.com" browser="*firefox">
* <open url="/"/>
* <getAlert property="alertmsg"/>
* </selenium>
*/
public class Getalert extends SeleniumGetStateTag {
@Override
public Object getValue() throws DTFException {
return getSelenium().getAlert();
}
}
| [
"[email protected]"
]
| |
ae0aaab581d3e6e537c136082af3953cd5a759a1 | 596d59292b2355e93f57c1d55f107664adda4e10 | /app/src/main/java/com/rackluxury/lamborghini/reddit/activities/ReportActivity.java | 63d93d42309f63b53bd76fa024b2a35d347fe934 | []
| no_license | HarshAProgrammer/Lamborghini | 25dd82af51f29c4d2c4fa4a90c651c3a59b57434 | 6e2a4eda873a376f2d05b74048d7f2e8ea227811 | refs/heads/master | 2023-08-01T03:33:05.151537 | 2021-09-13T16:26:58 | 2021-09-13T16:26:58 | 405,989,932 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,547 | java | package com.rackluxury.lamborghini.reddit.activities;
import android.content.SharedPreferences;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.appcompat.widget.Toolbar;
import androidx.coordinatorlayout.widget.CoordinatorLayout;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.snackbar.Snackbar;
import com.r0adkll.slidr.Slidr;
import java.util.ArrayList;
import java.util.concurrent.Executor;
import javax.inject.Inject;
import javax.inject.Named;
import butterknife.BindView;
import butterknife.ButterKnife;
import com.rackluxury.lamborghini.reddit.FetchRules;
import com.rackluxury.lamborghini.reddit.Infinity;
import com.rackluxury.lamborghini.R;
import com.rackluxury.lamborghini.reddit.RedditDataRoomDatabase;
import com.rackluxury.lamborghini.reddit.ReportReason;
import com.rackluxury.lamborghini.reddit.ReportThing;
import com.rackluxury.lamborghini.reddit.Rule;
import com.rackluxury.lamborghini.reddit.adapters.ReportReasonRecyclerViewAdapter;
import com.rackluxury.lamborghini.reddit.customtheme.CustomThemeWrapper;
import com.rackluxury.lamborghini.reddit.utils.SharedPreferencesUtils;
import retrofit2.Retrofit;
public class ReportActivity extends BaseActivity {
public static final String EXTRA_SUBREDDIT_NAME = "ESN";
public static final String EXTRA_THING_FULLNAME = "ETF";
private static final String GENERAL_REASONS_STATE = "GRS";
private static final String RULES_REASON_STATE = "RRS";
@BindView(R.id.coordinator_layout_report_activity)
CoordinatorLayout coordinatorLayout;
@BindView(R.id.appbar_layout_report_activity)
AppBarLayout appBarLayout;
@BindView(R.id.toolbar_report_activity)
Toolbar toolbar;
@BindView(R.id.recycler_view_report_activity)
RecyclerView recyclerView;
@Inject
@Named("oauth")
Retrofit mOauthRetrofit;
@Inject
@Named("no_oauth")
Retrofit mRetrofit;
@Inject
@Named("default")
SharedPreferences mSharedPreferences;
@Inject
@Named("current_account")
SharedPreferences mCurrentAccountSharedPreferences;
@Inject
RedditDataRoomDatabase mRedditDataRoomDatabase;
@Inject
CustomThemeWrapper mCustomThemeWrapper;
@Inject
Executor mExecutor;
private String mAccessToken;
private String mFullname;
private String mSubredditName;
private ArrayList<ReportReason> generalReasons;
private ArrayList<ReportReason> rulesReasons;
private ReportReasonRecyclerViewAdapter mAdapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
((Infinity) getApplication()).getAppComponent().inject(this);
setImmersiveModeNotApplicable();
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_report);
ButterKnife.bind(this);
applyCustomTheme();
if (mSharedPreferences.getBoolean(SharedPreferencesUtils.SWIPE_RIGHT_TO_GO_BACK, true)) {
Slidr.attach(this);
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && isChangeStatusBarIconColor()) {
addOnOffsetChangedListener(appBarLayout);
}
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
mFullname = getIntent().getStringExtra(EXTRA_THING_FULLNAME);
mSubredditName = getIntent().getStringExtra(EXTRA_SUBREDDIT_NAME);
mAccessToken = mCurrentAccountSharedPreferences.getString(SharedPreferencesUtils.ACCESS_TOKEN, null);
if (savedInstanceState != null) {
generalReasons = savedInstanceState.getParcelableArrayList(GENERAL_REASONS_STATE);
rulesReasons = savedInstanceState.getParcelableArrayList(RULES_REASON_STATE);
}
if (generalReasons != null) {
mAdapter = new ReportReasonRecyclerViewAdapter(mCustomThemeWrapper, generalReasons);
} else {
mAdapter = new ReportReasonRecyclerViewAdapter(mCustomThemeWrapper, ReportReason.getGeneralReasons(this));
}
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setAdapter(mAdapter);
if (rulesReasons == null) {
FetchRules.fetchRules(mExecutor, new Handler(), mRetrofit, mSubredditName, new FetchRules.FetchRulesListener() {
@Override
public void success(ArrayList<Rule> rules) {
mAdapter.setRules(ReportReason.convertRulesToReasons(rules));
}
@Override
public void failed() {
Snackbar.make(coordinatorLayout, R.string.error_loading_rules_without_retry, Snackbar.LENGTH_SHORT).show();
}
});
} else {
mAdapter.setRules(rulesReasons);
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.report_activity, menu);
applyMenuItemTheme(menu);
return true;
}
@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
int itemId = item.getItemId();
if (itemId == android.R.id.home) {
finish();
return true;
} else if (itemId == R.id.action_send_report_activity) {
ReportReason reportReason = mAdapter.getSelectedReason();
if (reportReason != null) {
Toast.makeText(ReportActivity.this, R.string.reporting, Toast.LENGTH_SHORT).show();
ReportThing.reportThing(mOauthRetrofit, mAccessToken, mFullname, mSubredditName,
reportReason.getReasonType(), reportReason.getReportReason(), new ReportThing.ReportThingListener() {
@Override
public void success() {
Toast.makeText(ReportActivity.this, R.string.report_successful, Toast.LENGTH_SHORT).show();
finish();
}
@Override
public void failed() {
Toast.makeText(ReportActivity.this, R.string.report_failed, Toast.LENGTH_SHORT).show();
}
});
} else {
Toast.makeText(ReportActivity.this, R.string.report_reason_not_selected, Toast.LENGTH_SHORT).show();
}
return true;
}
return false;
}
@Override
protected void onSaveInstanceState(@NonNull Bundle outState) {
super.onSaveInstanceState(outState);
if (mAdapter != null) {
outState.putParcelableArrayList(GENERAL_REASONS_STATE, mAdapter.getGeneralReasons());
outState.putParcelableArrayList(RULES_REASON_STATE, mAdapter.getRules());
}
}
@Override
protected SharedPreferences getDefaultSharedPreferences() {
return mSharedPreferences;
}
@Override
protected CustomThemeWrapper getCustomThemeWrapper() {
return mCustomThemeWrapper;
}
@Override
protected void applyCustomTheme() {
coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar);
}
}
| [
"[email protected]"
]
| |
aba68171f7efe707e591624e531c4241833a8402 | 108b4ebcd420adbf743e308fe1a792d397a5755e | /Sped/src/java/com/t2tierp/padrao/java/Biblioteca.java | 1af119f59b06bac64493cf9fbadd25ea2443be68 | [
"MIT"
]
| permissive | DeveloperMobile/T2Ti-ERP-1.0-Java | 19565ba429cf751a4e845f20c7809426352db655 | 3a91981d0a11e5ff258d09df6fee73f5b6d1cb07 | refs/heads/master | 2023-03-15T13:58:24.144105 | 2019-09-03T00:54:56 | 2019-09-03T00:54:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 15,030 | java | package com.t2tierp.padrao.java;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.math.BigInteger;
import java.security.Key;
import java.security.KeyStore;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.Signature;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import javax.swing.JFormattedTextField;
/**
* <p>Title: T2Ti ERP</p>
* <p>Description: Classe que contém funções adicionais para o sistema.</p>
*
* <p>The MIT License</p>
*
* <p>Copyright: Copyright (C) 2010 T2Ti.COM</p>
*
* 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.
*
* The author may be contacted at:
* [email protected]</p>
*
* @author Claudio de Barros (T2Ti.COM)
* @version 1.0
*/
public class Biblioteca {
public JFormattedTextField.AbstractFormatter formatoCpf() {
return new JFormattedTextField.AbstractFormatter() {
@Override
public Object stringToValue(String text) throws ParseException {
String str = text.replace(".", "");
str = str.replace("-", "");
return str;
}
@Override
public String valueToString(Object value) throws ParseException {
String str = (String) value;
//TODO: implementar código para validação do CPF
if (str.length() < 11) {
return null;
}
str = str.replace(".", "");
str = str.replace("-", "");
String strFormatado = str.substring(0, 3) + "."
+ str.substring(3, 6) + "."
+ str.substring(6, 9) + "-"
+ str.substring(9, 11);
return strFormatado;
}
};
}
public JFormattedTextField.AbstractFormatter formatoCnpj() {
return new JFormattedTextField.AbstractFormatter() {
@Override
public Object stringToValue(String text) throws ParseException {
String str = text.replace(".", "");
str = str.replace("-", "");
str = str.replace("/", "");
return str;
}
@Override
public String valueToString(Object value) throws ParseException {
String str = (String) value;
//TODO: implementar código para validação do CNPJ
if (str.length() < 14) {
return null;
}
str = str.replace(".", "");
str = str.replace("-", "");
str = str.replace("/", "");
String strFormatado = str.substring(0, 2) + "."
+ str.substring(2, 5) + "."
+ str.substring(5, 8) + "/"
+ str.substring(8, 12) + "-"
+ str.substring(12, 14);//10.793.118/0001-78
return strFormatado;
}
};
}
public static void copiaArquivo(String origem, String destino) throws Exception {
FileInputStream in = new FileInputStream(origem);
FileOutputStream out = new FileOutputStream(destino);
byte[] bb = new byte[in.available()];
in.read(bb);
out.write(bb);
out.close();
}
public static String md5Arquivo(String nomeArquivo) {
MessageDigest digest = null;
try {
digest = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException ex) {
ex.printStackTrace();
}
File f = new File(nomeArquivo);
InputStream is = null;
try {
is = new FileInputStream(f);
} catch (FileNotFoundException ex) {
ex.printStackTrace();
}
byte[] buffer = new byte[8192];
int read = 0;
try {
while ((read = is.read(buffer)) > 0) {
digest.update(buffer, 0, read);
}
byte[] md5sum = digest.digest();
BigInteger bigInt = new BigInteger(1, md5sum);
String output = bigInt.toString(16);
return output;
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
is.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return null;
}
public static byte[] geraAssinaturaArquivo(byte[] arquivoAssinar, File arquivoCertificado, char[] senha) {
try {
//Carrega o KeyStore
KeyStore ks = KeyStore.getInstance("PKCS12");
InputStream isCertificado = new FileInputStream(arquivoCertificado);
ks.load(isCertificado, senha);
//pega a chave privada
Key key = ks.getKey(ks.aliases().nextElement(), senha);
PrivateKey privateKey = (PrivateKey) key;
//cria o objeto Signature infomando o algoritmo de assinatura
//http://docs.oracle.com/javase/6/docs/technotes/guides/security/StandardNames.html
Signature sign = Signature.getInstance("SHA1withRSA");
sign.initSign(privateKey);
sign.update(arquivoAssinar);
//gera a assinatura
byte[] assinatura = sign.sign();
return assinatura;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
/**
* Verifica se a data informada e valida
*
* @param dia, mes e ano
* @return true se a data for valida, caso contrario false
*/
public static boolean validaData(int dia, int mes, int ano) {
try {
Calendar dataValidar = Calendar.getInstance();
dataValidar.setLenient(false);
dataValidar.set(Calendar.DAY_OF_MONTH, dia);
dataValidar.set(Calendar.MONTH, mes);
dataValidar.set(Calendar.YEAR, ano);
dataValidar.getTime();
return true;
} catch (Exception e) {
//e.printStackTrace();
}
return false;
}
/**
* Verifica se a hora informada e valida
*
* @param hora, minuto e segundo
* @return true se a hora for valida, caso contrario false
*/
public static boolean validaHora(int hora, int minuto, int segundo) {
try {
Calendar dataValidar = Calendar.getInstance();
dataValidar.setLenient(false);
dataValidar.set(Calendar.HOUR_OF_DAY, hora);
dataValidar.set(Calendar.MINUTE, minuto);
dataValidar.set(Calendar.SECOND, segundo);
dataValidar.getTime();
return true;
} catch (Exception e) {
//e.printStackTrace();
}
return false;
}
/**
* Oobtem a hora do dia em segundos
*
* @param dataMarcacao
* @return int - hora do dia em segundos
*/
public static int getHoraSeg(Calendar dataMarcacao) {
int segundos = dataMarcacao.get(Calendar.SECOND);
segundos += dataMarcacao.get(Calendar.MINUTE) * 60;
segundos += dataMarcacao.get(Calendar.HOUR_OF_DAY) * 3600;
return segundos;
}
/**
* Converte segundos para horas:minutos:segundos
*
* @param segundos
* @return String no formato HH:mm:ss
*/
public static String getHoraMinutoSegundo(int segundos) {
Calendar dataC = Calendar.getInstance();
dataC.set(Calendar.HOUR_OF_DAY, 0);
dataC.set(Calendar.MINUTE, 0);
dataC.set(Calendar.SECOND, 0);
dataC.add(Calendar.SECOND, segundos);
String resultado = dataC.get(Calendar.HOUR_OF_DAY) < 10
? "0" + dataC.get(Calendar.HOUR_OF_DAY)
: "" + dataC.get(Calendar.HOUR_OF_DAY);
resultado += ":";
resultado += dataC.get(Calendar.MINUTE) < 10
? "0" + dataC.get(Calendar.MINUTE)
: "" + dataC.get(Calendar.MINUTE);
resultado += ":";
resultado += dataC.get(Calendar.SECOND) < 10
? "0" + dataC.get(Calendar.SECOND)
: "" + dataC.get(Calendar.SECOND);
return resultado;
}
/**
* Converte a hora de String para Calendar
*
* @param horas no formato HH:mm:ss
* @return Calendar
*/
public static Calendar horaStrToCalendar(String horas) {
Calendar dataC = Calendar.getInstance();
dataC.set(Calendar.HOUR_OF_DAY, Integer.valueOf(horas.substring(0, 2)));
dataC.set(Calendar.MINUTE, Integer.valueOf(horas.substring(3, 5)));
dataC.set(Calendar.SECOND, Integer.valueOf(horas.substring(6, 8)));
return dataC;
}
/**
* Busca os bytes de um determinado arquivo
*
* @param file Arquivo
* @return byte[]
*/
public static byte[] getBytesFromFile(File file) throws Exception {
//converte o arquio em array de bytes
InputStream is = new FileInputStream(file);
// Get the size of the file
long length = file.length();
// Create the byte array to hold the data
byte[] documento = new byte[(int) length];
// Read in the bytes
int offset = 0;
int numRead = 0;
while (offset < documento.length
&& (numRead = is.read(documento, offset, documento.length - offset)) >= 0) {
offset += numRead;
}
// Ensure all the bytes have been read in
if (offset < documento.length) {
throw new IOException("Could not completely read file " + file.getName());
}
// Close the input stream and return bytes
is.close();
return documento;
}
/**
* Salva um array de byte em um arquivo
*
* @param caminhoArquivo Nome do arquivo a ser salvo
* @param file Array de byte que sera salvo
*
*/
public static void salvaArquivo(String caminhoArquivo, byte[] file) throws Exception {
FileOutputStream out = new FileOutputStream(caminhoArquivo);
out.write(file);
out.close();
}
/**
* Verifica se o cnpj informado e valido
*
* @param cnpj CNPJ a validar
* @return boolean
*
*/
public static boolean cnpjValido(String cnpj) {
if (cnpj.equals("00000000000000") || cnpj.equals("11111111111111")
|| cnpj.equals("22222222222222") || cnpj.equals("33333333333333")
|| cnpj.equals("44444444444444") || cnpj.equals("55555555555555")
|| cnpj.equals("66666666666666") || cnpj.equals("77777777777777")
|| cnpj.equals("88888888888888") || cnpj.equals("99999999999999")
|| (cnpj.length() != 14)) {
return (false);
}
char dig13, dig14;
int sm, i, r, num, peso;
try {
// Calculo do 1o. Digito Verificador
sm = 0;
peso = 2;
for (i = 11; i >= 0; i--) {
// converte o i-ésimo caractere do CNPJ em um número:
// por exemplo, transforma o caractere '0' no inteiro 0
// (48 eh a posição de '0' na tabela ASCII)
num = (int) (cnpj.charAt(i) - 48);
sm = sm + (num * peso);
peso = peso + 1;
if (peso == 10) {
peso = 2;
}
}
r = sm % 11;
if ((r == 0) || (r == 1)) {
dig13 = '0';
} else {
dig13 = (char) ((11 - r) + 48);
}
// Calculo do 2o. Digito Verificador
sm = 0;
peso = 2;
for (i = 12; i >= 0; i--) {
num = (int) (cnpj.charAt(i) - 48);
sm = sm + (num * peso);
peso = peso + 1;
if (peso == 10) {
peso = 2;
}
}
r = sm % 11;
if ((r == 0) || (r == 1)) {
dig14 = '0';
} else {
dig14 = (char) ((11 - r) + 48);
}
// Verifica se os dígitos calculados conferem com os dígitos informados.
if ((dig13 == cnpj.charAt(12)) && (dig14 == cnpj.charAt(13))) {
return (true);
} else {
return (false);
}
} catch (Exception e) {
return (false);
}
}
/**
* Busca o ultimo dia do mes
*
* @param dataA data
* @return Calendar
*/
public static Calendar ultimoDiaMes(Calendar dataA) throws Exception {
Calendar novaData = Calendar.getInstance();
novaData.set(Calendar.DAY_OF_MONTH, dataA.getActualMaximum(Calendar.DAY_OF_MONTH));
novaData.set(Calendar.MONTH, dataA.get(Calendar.MONTH));
novaData.set(Calendar.YEAR, dataA.get(Calendar.YEAR));
return novaData;
}
/**
* Seta a data informada para o mes anterior.
*
* @param dataA data
* @return Calendar
*/
public static Calendar mesAnterior(Calendar dataA) throws Exception {
Calendar novaData = Calendar.getInstance();
novaData.setLenient(false);
novaData.set(Calendar.DAY_OF_MONTH, dataA.get(Calendar.DAY_OF_MONTH));
novaData.set(Calendar.MONTH, dataA.get(Calendar.MONTH) - 1);
novaData.set(Calendar.YEAR, dataA.get(Calendar.YEAR));
return novaData;
}
/**
* Retorna o mes e ano no formato MM/AAAA
*
* @param dataA data
* @return String
*/
public static String mesAno(Calendar dataA) throws Exception {
return new SimpleDateFormat("MM/yyyy").format(dataA.getTime());
}
}
| [
"[email protected]"
]
| |
abcb93d3ad3dbd0b5575047fdd5a24eb412686e9 | 3502743e7d520895ee80ca1db2e0f35658007990 | /projects/umls.download/src/main/java/ytex/umls/FileDownloadS3ServiceImpl.java | 02f3e8c928561e4e2619871109b1f3360d7ac343 | []
| no_license | wenx999/ytex | 4ef52be6c4972d238903c609cac664b863c5a617 | f73f8025056da09c886f95237167368aec7f2c10 | refs/heads/master | 2021-01-22T14:02:42.645660 | 2013-05-06T01:02:58 | 2013-05-06T01:02:58 | 32,970,250 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,658 | java | package ytex.umls;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.IOException;
import java.util.Properties;
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.services.s3.AmazonS3Client;
import com.amazonaws.services.s3.model.GetObjectRequest;
import com.amazonaws.services.s3.model.S3Object;
public class FileDownloadS3ServiceImpl {
Properties awsProperties = null;
public Properties getAwsProperties() {
return awsProperties;
}
public void setAwsProperties(Properties awsProperties) {
this.awsProperties = awsProperties;
}
AmazonS3Client s3Client;
/**
* get the file from s3 and write it to the output stream
*
* @param os
* @param version
* @param platform
* @return true - ok, false - not ok
* @throws IOException
*/
public boolean sendFile(BufferedOutputStream os, String version,
String platform) throws IOException {
GetObjectRequest rq = new GetObjectRequest("ytex", version + "/"
+ "umls-" + platform + ".zip");
S3Object s3o = s3Client.getObject(rq);
if (s3o != null) {
BufferedInputStream is = null;
try {
is = new BufferedInputStream(s3o.getObjectContent());
int b = -1;
while ((b = is.read()) != -1) {
os.write(b);
}
} finally {
if (is != null) {
try {
is.close();
} catch (IOException e) {
}
}
}
return true;
}
return false;
}
public void init() {
s3Client = new AmazonS3Client(new BasicAWSCredentials(
awsProperties.getProperty("accessKey"),
awsProperties.getProperty("secretKey")));
}
}
| [
"[email protected]@199a8c0d-f52f-db5a-f41a-c7518a5198ba"
]
| [email protected]@199a8c0d-f52f-db5a-f41a-c7518a5198ba |
e7073269ff5dd4ec4cdb3023ddaaeadc4f8c793e | 95ee0d5e0361dfec283a375cea0f081ad29e13a5 | /src/main/gol/log/Rules.java | 10958d92a6c92b6e7b0b149fe70fa3e726643a0a | []
| no_license | MrDenkoV/GameOfLife | 0e8ba29b57b2d09158b974cee9dbce75aa7110f7 | 8f9e03a43a86e04ae94d2684563dc717c304a968 | refs/heads/master | 2023-03-17T09:32:37.757087 | 2023-03-07T12:59:18 | 2023-03-07T12:59:18 | 233,926,690 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,893 | java | package gol.log;
import java.util.Arrays;
public class Rules {
States[] rules;
public Rules(String rules){
this.rules = new States[9];
this.setRules(rules);
}
public Rules(){
this.rules = new States[8];
for(int i=0; i<9; i++)
this.rules[i]=States.DIES;
}
public void setRules(String rules){
for (int i=0; i<9; i++)
this.rules[i]=States.DIES;
int i;
for(i=0; i<rules.length() && rules.charAt(i)!='/'; i++){
if(rules.charAt(i)<'0' || rules.charAt(i)>'8') {
// throw new IllegalArgumentException("Wrong Argument: " + living.charAt(i) + " not in range 0-8");
continue;
}
int current = Character.getNumericValue(rules.charAt(i));
this.rules[current]=States.SURVIVES;
}
i++;
for(; i<rules.length(); i++){
if(rules.charAt(i)<'0' || rules.charAt(i)>'8') {
// throw new IllegalArgumentException("Wrong Argument: " + living.charAt(i) + " not in range 0-8");
continue;
}
int current = Character.getNumericValue(rules.charAt(i));
if(this.rules[current]==States.SURVIVES || this.rules[current]==States.BOTH)
this.rules[current]=States.BOTH;
else
this.rules[current]=States.APPEARS;
}
}
@Override
public String toString() {
StringBuilder wyn= new StringBuilder();
for(int i=0; i<9; i++)
if(this.rules[i]==States.SURVIVES || this.rules[i]==States.BOTH)
wyn.append(String.valueOf(i));
wyn.append('/');
for(int i=0; i<9; i++)
if(this.rules[i]==States.APPEARS || this.rules[i]==States.BOTH)
wyn.append(String.valueOf(i));
return wyn.toString();
}
}
| [
"[email protected]"
]
| |
7ac2ce90d3bf6fd8f6dbdaefeb030174a5e0d818 | 25240fd5845b4392111abffeb31389a393819963 | /src/main/java/com/nanosai/gridops/ion/write/IonFieldWriterInt.java | 6f5a1b50f5880b5816ce7c945f45fd99eee39e33 | [
"Apache-2.0"
]
| permissive | nanosai/grid-ops-java | c60963bbab6ff9849c8162812df5348572876047 | 02771b305cff845ab923fc01ee16d040707a27da | refs/heads/master | 2020-09-22T10:54:48.088602 | 2017-07-24T09:49:19 | 2017-07-24T09:49:19 | 66,138,672 | 34 | 4 | null | null | null | null | UTF-8 | Java | false | false | 1,184 | java | package com.nanosai.gridops.ion.write;
import com.nanosai.gridops.ion.IonFieldTypes;
import com.nanosai.gridops.ion.IonUtil;
import java.lang.reflect.Field;
/**
* Created by jjenkov on 04-11-2015.
*/
public class IonFieldWriterInt extends IonFieldWriterBase implements IIonFieldWriter {
public IonFieldWriterInt(Field field, String alias) {
super(field, alias);
}
@Override
public int writeValueField(Object sourceObject, byte[] dest, int destOffset, int maxLengthLength) {
try {
long value = (int) field.get(sourceObject);
int ionFieldType = IonFieldTypes.INT_POS;
if(value < 0){
ionFieldType = IonFieldTypes.INT_NEG;
value = -(value+1);
}
int length = IonUtil.lengthOfInt64Value(value);
dest[destOffset++] = (byte) (255 & ((ionFieldType << 4) | length));
for(int i=(length-1)*8; i >= 0; i-=8){
dest[destOffset++] = (byte) (255 & (value >> i));
}
return 1 + length;
} catch (IllegalAccessException e) {
e.printStackTrace();
}
return 0;
}
}
| [
"[email protected]"
]
| |
792b6f081339f83e1132945a761e7c0965fbd7d4 | 86325d06c29dbdf3b3167e060d6a55c0394505c4 | /src/test/java/tw/gtb/quiz/QuizApplicationTests.java | 0e16e69635814dc97d3ce7cad61af6186139c6fe | []
| no_license | pigeonsL/B-basic-quiz | 149f88c24be960ea41161d63903a5eeeae6d461c | ee16fbc20839e76b96fc5dadfbffeb8950eb7f83 | refs/heads/master | 2022-11-05T14:37:44.720932 | 2020-06-21T11:55:47 | 2020-06-21T11:55:47 | 273,490,313 | 0 | 0 | null | 2020-06-19T12:37:15 | 2020-06-19T12:37:14 | null | UTF-8 | Java | false | false | 201 | java | package tw.gtb.quiz;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class QuizApplicationTests {
@Test
void contextLoads() {
}
}
| [
"[email protected]"
]
| |
072963d8ab98351539f13c89e1c8ffadb2341539 | 7ef269897694a34691cce89114a3a50d799aff0c | /api/src/main/java/org/openmrs/module/hgu/activator/Initializer.java | 438f45e7745640e5102a4d8459427bdd7c7f3856 | []
| no_license | brandixi3/hgu | 80d1d0a640d3c3bc172e57ce984163d8df200556 | e91af41efb7a5ebfa5d914b7e5c0df49e28cd3e2 | refs/heads/master | 2020-12-13T07:46:52.706253 | 2016-08-03T11:21:48 | 2016-08-03T11:21:48 | 55,751,817 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 227 | java | package org.openmrs.module.hgu.activator;
// TODO: Auto-generated Javadoc
/**
* The Interface Initializer.
*/
public interface Initializer {
/**
* Started.
*/
void started();
/**
* Stopped.
*/
void stopped();
} | [
"[email protected]"
]
| |
353ab11c45112d8b7f84d1fa7b94b17b1372b223 | e5c3511f3ff3efd7ad45df55c513ccb6de0bb0bd | /src/com/zhou/feidong/mapper/UserActionLogMapper.java | 8a2bd07bcd52034b80e55935cd91622b99af403a | []
| no_license | liangjinggjia/mybatis-generator | 5c058be119e966a79949d6e8c147fdb25355f02a | de60259614afed3ce18c4f3036058bdc6b8b8c60 | refs/heads/master | 2020-06-02T15:22:54.534387 | 2017-06-12T13:03:42 | 2017-06-12T13:03:42 | 94,096,840 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 948 | java | package com.zhou.feidong.mapper;
import com.zhou.feidong.domian.UserActionLog;
import com.zhou.feidong.domian.UserActionLogExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface UserActionLogMapper {
int countByExample(UserActionLogExample example);
int deleteByExample(UserActionLogExample example);
int deleteByPrimaryKey(Integer id);
int insert(UserActionLog record);
int insertSelective(UserActionLog record);
List<UserActionLog> selectByExample(UserActionLogExample example);
UserActionLog selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") UserActionLog record, @Param("example") UserActionLogExample example);
int updateByExample(@Param("record") UserActionLog record, @Param("example") UserActionLogExample example);
int updateByPrimaryKeySelective(UserActionLog record);
int updateByPrimaryKey(UserActionLog record);
} | [
"[email protected]"
]
| |
14d15a6434d699e84db4cfebb311e229c9827f7e | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/5/5_9320cdf00b6f1ec73ce01d7ae4283541c0905338/Analyzer/5_9320cdf00b6f1ec73ce01d7ae4283541c0905338_Analyzer_s.java | 777c69f3d4b4918d7cf8c2b098fd6a4733abebb5 | []
| 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,009 | java | package ru.spbau.bioinf.tagfinder;
import org.jdom.Document;
import org.jdom.Element;
import ru.spbau.bioinf.tagfinder.util.XmlUtil;
import ru.spbau.bioinf.tagfinder.view.Table;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
public class Analyzer {
private Configuration conf;
public Analyzer(Configuration conf) {
this.conf = conf;
}
public static void main(String[] args) throws Exception {
Configuration conf = new Configuration(args
, "mod2"
);
Analyzer analyzer = new Analyzer(conf);
Map<Integer, Scan> scans = conf.getScans();
for (int scanId : scans.keySet()) {
//int scanId = 510;
//int scanId = 3008
//890
Scan scan = scans.get(scanId);
//analyzer.printEdges(scan);
analyzer.showPasses(scan);
}
}
private void printEdges(Scan scan) throws Exception {
Map<Integer,Integer> msAlignResults = conf.getMSAlignResults();
int proteinId = msAlignResults.get(scan.getId());
System.out.println("proteinId = " + proteinId);
Protein p = conf.getProteins().get(proteinId);
System.out.println("protein = " + p.getName());
System.out.println(p.getSimplifiedAcids());
double precursorMassShift = PrecursorMassShiftFinder.getPrecursorMassShift(conf, scan);
List<Peak> peaks = scan.createSpectrumWithYPeaks(precursorMassShift);
int n = peaks.size();
for (int i = 0; i < n; i++) {
Peak peak = peaks.get(i);
System.out.print(peak.getValue() + " " + peak.getPeakType().name() + " ");
for (int j = i+1; j < n; j++) {
Peak next = peaks.get(j);
double[] limits = conf.getEdgeLimits(peak, next);
for (Acid acid : Acid.values()) {
if (acid.match(limits)) {
System.out.print(acid.name() + " " + next.getValue() + " ");
}
}
}
System.out.println();
}
}
public void showPasses(Scan scan) throws IOException {
double precursorMassShift = PrecursorMassShiftFinder.getPrecursorMassShift(conf, scan);
List<Peak> peaks = scan.createSpectrumWithYPeaks(precursorMassShift);
int n = peaks.size();
for (int i = 0; i < n; i++) {
peaks.get(i).setComponentId(i);
}
new KDStatistics(conf).generateEdges(peaks);
for (Peak peak : peaks) {
peak.populatePrev();
}
int i = 0;
while (i < peaks.size() - 1) {
Peak p1 = peaks.get(i);
Peak p2 = peaks.get(i + 1);
if (p2.getValue() - p1.getValue() < 0.1) {
if (p1.isParent(p2)) {
peaks.remove(p2);
p1.addCopy(p2);
} else if (p2.isParent(p1)) {
peaks.remove(p1);
p2.addCopy(p1);
} else {
i++;
}
} else {
i++;
}
}
boolean done;
do {
done = true;
for (Peak peak : peaks) {
if (peak.updateComponentId()) {
done = false;
}
}
} while (!done);
Document doc = new Document();
Element root = new Element("scan");
doc.setRootElement(root);
boolean[] componentDone = new boolean[n];
for (Peak p : peaks) {
int componentId = p.getComponentId();
if (!componentDone[componentId]) {
List<Peak> component = new ArrayList<Peak>();
for (Peak peak : peaks) {
if (peak.getComponentId() == componentId) {
component.add(peak);
}
}
if (component.size() > 1) {
System.out.println("componentId = " + componentId);
Table table = getComponentView(component);
root.addContent(table.toXML());
componentDone[componentId] = true;
}
}
}
XmlUtil.saveXml(doc, conf.getScanXmlFile(scan));
}
private Table getComponentView(List<Peak> peaks) {
Table table = new Table();
int row = 0;
Peak[] firstTag = null;
Peak[] bestTag;
do {
initMaxPrefix(peaks);
bestTag = new Peak[]{};
for (Peak peak : peaks) {
bestTag = findBestTag(peak, bestTag, 0, new Peak[500]);
}
if (bestTag.length > 1) {
int bestCol = 0;
if (firstTag == null) {
firstTag = bestTag;
} else {
double score = 10E+30;
for (int col = -bestTag.length + 1; col < firstTag.length - 1; col++) {
int match = 0;
double total = 0;
for (int i = 0; i < bestTag.length; i++) {
int pos = col + i;
if (pos >= 0 && pos < firstTag.length) {
match++;
total += Math.abs(firstTag[pos].getValue() - bestTag[i].getValue());
}
}
double newScore = total / match;
if (newScore < score) {
score = newScore;
bestCol = col;
}
}
}
table.addTag(row, bestCol * 2, bestTag);
clearPath(bestTag);
row++;
}
} while (bestTag.length > 1);
return table;
}
private void initMaxPrefix(List<Peak> peaks) {
for (Peak peak : peaks) {
peak.setMaxPrefix(-1);
}
}
private void clearPath(Peak[] bestTag) {
for (int i = 0; i < bestTag.length - 1; i++) {
bestTag[i].removeNext(bestTag[i + 1]);
}
}
private Peak[] findBestTag(Peak peak, Peak[] best, int len, Peak[] prefix) {
if (peak.getMaxPrefix() >= len) {
return best;
}
prefix[len] = peak;
if (len >= best.length) {
best = new Peak[len +1];
System.arraycopy(prefix, 0, best, 0, len + 1);
}
for (Peak next : peak.getNext()) {
best = findBestTag(next, best, len + 1, prefix);
}
peak.setMaxPrefix(len);
return best;
}
}
| [
"[email protected]"
]
| |
a6e0275a84a36d0701cc9f79bd8faf36c876338a | f77c2365e4f936c6779e26a4ab7879d342b44500 | /vertx-jooq-generate/src/test/java/generated/classic/reactive/mysql/tables/records/SomethingRecord.java | b30b9db80082edb0408dd13ec08b849f9e3fe031 | [
"MIT"
]
| permissive | cvgaviao/vertx-jooq | 1e6be6c374d46042c028664f319eb70470ae6a7c | ee68124a31d742232e9df2a8378f2b45de11bfbd | refs/heads/master | 2021-07-16T17:18:14.749377 | 2021-03-12T09:57:40 | 2021-03-12T09:57:40 | 244,900,588 | 0 | 0 | MIT | 2020-03-04T12:56:56 | 2020-03-04T12:56:55 | null | UTF-8 | Java | false | true | 12,396 | java | /*
* This file is generated by jOOQ.
*/
package generated.classic.reactive.mysql.tables.records;
import generated.classic.reactive.mysql.enums.SomethingSomeenum;
import generated.classic.reactive.mysql.tables.Something;
import generated.classic.reactive.mysql.tables.interfaces.ISomething;
import io.github.jklingsporn.vertx.jooq.shared.internal.VertxPojo;
import io.vertx.core.json.JsonArray;
import io.vertx.core.json.JsonObject;
import java.time.LocalDateTime;
import org.jooq.Field;
import org.jooq.Record1;
import org.jooq.Record10;
import org.jooq.Row10;
import org.jooq.impl.UpdatableRecordImpl;
import static io.github.jklingsporn.vertx.jooq.shared.internal.VertxPojo.*;
/**
* This class is generated by jOOQ.
*/
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class SomethingRecord extends UpdatableRecordImpl<SomethingRecord> implements VertxPojo, Record10<Integer, String, Long, Short, Integer, Double, SomethingSomeenum, JsonObject, JsonArray, LocalDateTime>, ISomething {
private static final long serialVersionUID = 1L;
/**
* Setter for <code>vertx.something.someId</code>.
*/
@Override
public SomethingRecord setSomeid(Integer value) {
set(0, value);
return this;
}
/**
* Getter for <code>vertx.something.someId</code>.
*/
@Override
public Integer getSomeid() {
return (Integer) get(0);
}
/**
* Setter for <code>vertx.something.someString</code>.
*/
@Override
public SomethingRecord setSomestring(String value) {
set(1, value);
return this;
}
/**
* Getter for <code>vertx.something.someString</code>.
*/
@Override
public String getSomestring() {
return (String) get(1);
}
/**
* Setter for <code>vertx.something.someHugeNumber</code>.
*/
@Override
public SomethingRecord setSomehugenumber(Long value) {
set(2, value);
return this;
}
/**
* Getter for <code>vertx.something.someHugeNumber</code>.
*/
@Override
public Long getSomehugenumber() {
return (Long) get(2);
}
/**
* Setter for <code>vertx.something.someSmallNumber</code>.
*/
@Override
public SomethingRecord setSomesmallnumber(Short value) {
set(3, value);
return this;
}
/**
* Getter for <code>vertx.something.someSmallNumber</code>.
*/
@Override
public Short getSomesmallnumber() {
return (Short) get(3);
}
/**
* Setter for <code>vertx.something.someRegularNumber</code>.
*/
@Override
public SomethingRecord setSomeregularnumber(Integer value) {
set(4, value);
return this;
}
/**
* Getter for <code>vertx.something.someRegularNumber</code>.
*/
@Override
public Integer getSomeregularnumber() {
return (Integer) get(4);
}
/**
* Setter for <code>vertx.something.someDouble</code>.
*/
@Override
public SomethingRecord setSomedouble(Double value) {
set(5, value);
return this;
}
/**
* Getter for <code>vertx.something.someDouble</code>.
*/
@Override
public Double getSomedouble() {
return (Double) get(5);
}
/**
* Setter for <code>vertx.something.someEnum</code>.
*/
@Override
public SomethingRecord setSomeenum(SomethingSomeenum value) {
set(6, value);
return this;
}
/**
* Getter for <code>vertx.something.someEnum</code>.
*/
@Override
public SomethingSomeenum getSomeenum() {
return (SomethingSomeenum) get(6);
}
/**
* Setter for <code>vertx.something.someJsonObject</code>.
*/
@Override
public SomethingRecord setSomejsonobject(JsonObject value) {
set(7, value);
return this;
}
/**
* Getter for <code>vertx.something.someJsonObject</code>.
*/
@Override
public JsonObject getSomejsonobject() {
return (JsonObject) get(7);
}
/**
* Setter for <code>vertx.something.someJsonArray</code>.
*/
@Override
public SomethingRecord setSomejsonarray(JsonArray value) {
set(8, value);
return this;
}
/**
* Getter for <code>vertx.something.someJsonArray</code>.
*/
@Override
public JsonArray getSomejsonarray() {
return (JsonArray) get(8);
}
/**
* Setter for <code>vertx.something.someTimestamp</code>.
*/
@Override
public SomethingRecord setSometimestamp(LocalDateTime value) {
set(9, value);
return this;
}
/**
* Getter for <code>vertx.something.someTimestamp</code>.
*/
@Override
public LocalDateTime getSometimestamp() {
return (LocalDateTime) get(9);
}
// -------------------------------------------------------------------------
// Primary key information
// -------------------------------------------------------------------------
@Override
public Record1<Integer> key() {
return (Record1) super.key();
}
// -------------------------------------------------------------------------
// Record10 type implementation
// -------------------------------------------------------------------------
@Override
public Row10<Integer, String, Long, Short, Integer, Double, SomethingSomeenum, JsonObject, JsonArray, LocalDateTime> fieldsRow() {
return (Row10) super.fieldsRow();
}
@Override
public Row10<Integer, String, Long, Short, Integer, Double, SomethingSomeenum, JsonObject, JsonArray, LocalDateTime> valuesRow() {
return (Row10) super.valuesRow();
}
@Override
public Field<Integer> field1() {
return Something.SOMETHING.SOMEID;
}
@Override
public Field<String> field2() {
return Something.SOMETHING.SOMESTRING;
}
@Override
public Field<Long> field3() {
return Something.SOMETHING.SOMEHUGENUMBER;
}
@Override
public Field<Short> field4() {
return Something.SOMETHING.SOMESMALLNUMBER;
}
@Override
public Field<Integer> field5() {
return Something.SOMETHING.SOMEREGULARNUMBER;
}
@Override
public Field<Double> field6() {
return Something.SOMETHING.SOMEDOUBLE;
}
@Override
public Field<SomethingSomeenum> field7() {
return Something.SOMETHING.SOMEENUM;
}
@Override
public Field<JsonObject> field8() {
return Something.SOMETHING.SOMEJSONOBJECT;
}
@Override
public Field<JsonArray> field9() {
return Something.SOMETHING.SOMEJSONARRAY;
}
@Override
public Field<LocalDateTime> field10() {
return Something.SOMETHING.SOMETIMESTAMP;
}
@Override
public Integer component1() {
return getSomeid();
}
@Override
public String component2() {
return getSomestring();
}
@Override
public Long component3() {
return getSomehugenumber();
}
@Override
public Short component4() {
return getSomesmallnumber();
}
@Override
public Integer component5() {
return getSomeregularnumber();
}
@Override
public Double component6() {
return getSomedouble();
}
@Override
public SomethingSomeenum component7() {
return getSomeenum();
}
@Override
public JsonObject component8() {
return getSomejsonobject();
}
@Override
public JsonArray component9() {
return getSomejsonarray();
}
@Override
public LocalDateTime component10() {
return getSometimestamp();
}
@Override
public Integer value1() {
return getSomeid();
}
@Override
public String value2() {
return getSomestring();
}
@Override
public Long value3() {
return getSomehugenumber();
}
@Override
public Short value4() {
return getSomesmallnumber();
}
@Override
public Integer value5() {
return getSomeregularnumber();
}
@Override
public Double value6() {
return getSomedouble();
}
@Override
public SomethingSomeenum value7() {
return getSomeenum();
}
@Override
public JsonObject value8() {
return getSomejsonobject();
}
@Override
public JsonArray value9() {
return getSomejsonarray();
}
@Override
public LocalDateTime value10() {
return getSometimestamp();
}
@Override
public SomethingRecord value1(Integer value) {
setSomeid(value);
return this;
}
@Override
public SomethingRecord value2(String value) {
setSomestring(value);
return this;
}
@Override
public SomethingRecord value3(Long value) {
setSomehugenumber(value);
return this;
}
@Override
public SomethingRecord value4(Short value) {
setSomesmallnumber(value);
return this;
}
@Override
public SomethingRecord value5(Integer value) {
setSomeregularnumber(value);
return this;
}
@Override
public SomethingRecord value6(Double value) {
setSomedouble(value);
return this;
}
@Override
public SomethingRecord value7(SomethingSomeenum value) {
setSomeenum(value);
return this;
}
@Override
public SomethingRecord value8(JsonObject value) {
setSomejsonobject(value);
return this;
}
@Override
public SomethingRecord value9(JsonArray value) {
setSomejsonarray(value);
return this;
}
@Override
public SomethingRecord value10(LocalDateTime value) {
setSometimestamp(value);
return this;
}
@Override
public SomethingRecord values(Integer value1, String value2, Long value3, Short value4, Integer value5, Double value6, SomethingSomeenum value7, JsonObject value8, JsonArray value9, LocalDateTime value10) {
value1(value1);
value2(value2);
value3(value3);
value4(value4);
value5(value5);
value6(value6);
value7(value7);
value8(value8);
value9(value9);
value10(value10);
return this;
}
// -------------------------------------------------------------------------
// FROM and INTO
// -------------------------------------------------------------------------
@Override
public void from(ISomething from) {
setSomeid(from.getSomeid());
setSomestring(from.getSomestring());
setSomehugenumber(from.getSomehugenumber());
setSomesmallnumber(from.getSomesmallnumber());
setSomeregularnumber(from.getSomeregularnumber());
setSomedouble(from.getSomedouble());
setSomeenum(from.getSomeenum());
setSomejsonobject(from.getSomejsonobject());
setSomejsonarray(from.getSomejsonarray());
setSometimestamp(from.getSometimestamp());
}
@Override
public <E extends ISomething> E into(E into) {
into.from(this);
return into;
}
// -------------------------------------------------------------------------
// Constructors
// -------------------------------------------------------------------------
/**
* Create a detached SomethingRecord
*/
public SomethingRecord() {
super(Something.SOMETHING);
}
/**
* Create a detached, initialised SomethingRecord
*/
public SomethingRecord(Integer someid, String somestring, Long somehugenumber, Short somesmallnumber, Integer someregularnumber, Double somedouble, SomethingSomeenum someenum, JsonObject somejsonobject, JsonArray somejsonarray, LocalDateTime sometimestamp) {
super(Something.SOMETHING);
setSomeid(someid);
setSomestring(somestring);
setSomehugenumber(somehugenumber);
setSomesmallnumber(somesmallnumber);
setSomeregularnumber(someregularnumber);
setSomedouble(somedouble);
setSomeenum(someenum);
setSomejsonobject(somejsonobject);
setSomejsonarray(somejsonarray);
setSometimestamp(sometimestamp);
}
public SomethingRecord(io.vertx.core.json.JsonObject json) {
this();
fromJson(json);
}
}
| [
"[email protected]"
]
| |
561b0ead58256f59e771e923aab78fdd94d26788 | 6e27e35fc985e15b106f07d71fc9fb4a4a050fea | /app/src/main/java/com/originacion/promotor/MainActivity.java | aac8ced32f7078e03ac5ccda420e1bbe8ccbc482 | []
| no_license | adralbavilla/OriginacionPromotor | b0dd66e424551885f7ff5e809de4d3d8d5223c1b | 6f0c1786b75661ac666341b3135eae36deda3e6a | refs/heads/master | 2020-12-12T19:33:45.896816 | 2020-01-16T01:53:10 | 2020-01-16T01:53:10 | 234,211,905 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,437 | java | package com.originacion.promotor;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.text.SpannableString;
import android.text.Spanned;
import android.text.style.BackgroundColorSpan;
import android.text.style.UnderlineSpan;
import android.util.Log;
import android.widget.TextView;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.firebase.iid.FirebaseInstanceId;
import com.google.firebase.iid.InstanceIdResult;
public class MainActivity extends AppCompatActivity {
public static final String CHANNEL_ID= "channel1";
public static final String CHANNEL_NAME= "coding";
TextView txtLlamar, txtGestionar;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_detail);
txtLlamar = (TextView) findViewById(R.id.txtLlamar);
txtGestionar = (TextView) findViewById(R.id.txtGestionar);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
SpannableString contentProspecto = new SpannableString("Llamar a prospecto (Paulina Cruz Perez)");
SpannableString contentGestionar = new SpannableString("Gestionar oportunidad de venta");
contentProspecto.setSpan(new UnderlineSpan(), 0, contentProspecto.length(), 0);
contentGestionar.setSpan(new UnderlineSpan(), 0, contentGestionar.length(), 0);
txtLlamar.setText(contentProspecto);
txtGestionar.setText(contentGestionar);
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){
NotificationChannel channel1 = new NotificationChannel(CHANNEL_ID,CHANNEL_NAME, NotificationManager.IMPORTANCE_HIGH);
NotificationManager manager = getSystemService(NotificationManager.class);
manager.createNotificationChannel(channel1);
}
FirebaseInstanceId.getInstance().getInstanceId().addOnSuccessListener( this, new OnSuccessListener<InstanceIdResult>() {
@Override
public void onSuccess(InstanceIdResult instanceIdResult) {
String newToken = instanceIdResult.getToken();
Log.e("newToken",newToken);
}
});
}
}
| [
"[email protected]"
]
| |
57075dc407f94f957052e3757e4a8a7b04600022 | d4b23e51037d005afb4b64138822ea67c57b1366 | /src/main/java/com/xiao/domain/Product.java | 93fd0c84c4e38ce1e8b690f0ab7cf78c1844a5fb | []
| no_license | xykid1986/rabbitmq-spring-template | ad5db266a3a3b96aeda8c35039223fc9ed3fbc1a | c4e87b78fe611a8a816dbb0a173faba0413577f4 | refs/heads/master | 2021-01-01T16:40:17.220142 | 2013-11-24T00:48:47 | 2013-11-24T00:48:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 428 | java | package com.xiao.domain;
import javax.xml.bind.annotation.*;
@SuppressWarnings("restriction")
@XmlRootElement
public class Product {
private String name;
private int price;
@XmlElement
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@XmlElement
public int getPrice() {
return price;
}
public void setPrice(int price) {
this.price = price;
}
}
| [
"[email protected]"
]
| |
8a2208431380598bc91bc1e47fdfed8c847f5df3 | a5828c5e021dbe5f7dfc91960955e3d86ea011be | /Empirical Comparison of Two Algorithms 02 - Excel Outputing/src/output_test01.java | e9f74461879b0e4c1b68db5be0237450146fc956 | [
"MIT"
]
| permissive | n9839950/Empirical-Comparison-of-Two-Algorithms-CAB301 | 930737cb3b43d9fa505053ab2bf3f226c6d6c5e2 | 96d17b258a1c7cf23a43e0f564c26c37476b341c | refs/heads/master | 2020-04-04T18:57:56.882643 | 2018-11-09T09:25:54 | 2018-11-09T09:25:54 | 156,186,811 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,158 | java | import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Random;
public class output_test01 {
static Random r = new Random();
static int operations = 0;
static StringBuilder sb02 = new StringBuilder();
public static int Median(int[] A) {
if (A.length==1) {
operations += 1;
return A[0];
}else {
return Select(A, 0, (int) Math.floor(A.length/2.0), A.length-1);
}
}
public static int Select(int[] A, int l, int m, int h) {
int pos = Partition(A, l, h);
if (pos == m) {
return A[pos];
}
if (pos > m) {
return Select(A, l, m, pos-1);
}
if (pos < m) {
return Select(A, pos+1, m, h);
}
return 0;
}
public static int Partition(int[] A, int l, int h) {
int pivotval = A[l];
int pivotloc = l;
for (int o = l+1 ; o <= h; o++) {
operations += 1;
if (A[o] < pivotval) {
pivotloc += 1;
swap(A[pivotloc], A[o]);
}
}
swap(A[l], A[pivotloc]);
return pivotloc;
}
private static void swap(int p, int q) {
int s = p;
p = q;
q = s;
}
public static int[] randomArray(int length, int max){
int[] result = new int[length];
for (int k = 0; k < result.length; k++) {
result[k] = r.nextInt(max)+1;
}
return result;
}
public static void process(int arrayLength, int arrayMax) {
int A[] = randomArray(arrayLength, arrayMax);
long start = System.nanoTime();
int median = Median(A);
long execution = System.nanoTime() - start;
sb02.append(arrayLength + ", " + arrayMax + ", " + operations + ", " + execution + "\n");
}
public static void main(String[] args) throws FileNotFoundException {
// TODO Auto-generated method stub
PrintWriter pw02 = new PrintWriter(new File("02_test.csv"));
int maximanTime = 100000000;
sb02.append("Array Length" + ", " + "Array Max Value" + ", " + "Operation Times" + ", " + "Execute Duration" + "\n");
for (int i = 1; i <= maximanTime; i += 9*i) {
process(i, 10*i);
}
pw02.write(sb02.toString());
pw02.close();
System.out.println("done!");
}
}
| [
"[email protected]"
]
| |
7ac50dd80fdf7569eb3683eba4933faddc3e0a7a | d6e74cf08efb47d08c4178924d0ae997d3fcba71 | /demo/src/main/java/me/hyungchul/spinrgapplicationcontext/hckService.java | d063c889b9dbab9d53bbe7c01740697939418e07 | []
| no_license | defianz/SpringBootStudy | 8e89cbb1264ba30f20b8e45d5fb6d14a698defca | 2ac3b604aec2d0496092c734fae42295414b85ee | refs/heads/master | 2023-06-22T17:48:10.972438 | 2021-07-19T08:49:53 | 2021-07-19T08:49:53 | 384,649,013 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 279 | java | package me.hyungchul.spinrgapplicationcontext;
import org.springframework.lang.NonNull;
import org.springframework.stereotype.Service;
@Service
public class hckService {
@NonNull
public String createEvent(@NonNull String name){
return "Hello "+name;
}
}
| [
"[email protected]"
]
| |
c33d8c058748d78b770f4b7dde073cf7dc54eff9 | 008750cc110d6c974e42b5f1d5cfd0b5ab96580d | /org.earthsystemcurator.cupid.esmf/src/org/earthsystemcurator/cupid/esmf/ESMFStageActionImportStateAdd.java | 9c60abf764f2ff04941ab959bc66d40c9a63c20f | [
"MIT"
]
| permissive | NESII/cupid | b1403e899190d7a67caa152ffc4828eef2b20968 | ac1ca1f2910c7e6cd656a9c294881eb6da4455f3 | refs/heads/master | 2021-01-18T01:15:10.868441 | 2015-01-18T04:35:58 | 2015-01-18T04:35:58 | 45,696,880 | 0 | 4 | null | 2015-11-06T17:33:44 | 2015-11-06T17:33:44 | null | UTF-8 | Java | false | false | 1,291 | java | /**
*/
package org.earthsystemcurator.cupid.esmf;
import org.eclipse.emf.common.util.EList;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Stage Action Import State Add</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* <ul>
* <li>{@link org.earthsystemcurator.cupid.esmf.ESMFStageActionImportStateAdd#getItem <em>Item</em>}</li>
* </ul>
* </p>
*
* @see org.earthsystemcurator.cupid.esmf.ESMFPackage#getESMFStageActionImportStateAdd()
* @model
* @generated
*/
public interface ESMFStageActionImportStateAdd extends ESMFStageAction {
/**
* Returns the value of the '<em><b>Item</b></em>' reference list.
* The list contents are of type {@link org.earthsystemcurator.cupid.esmf.ESMFStateItem}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Item</em>' reference list isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Item</em>' reference list.
* @see org.earthsystemcurator.cupid.esmf.ESMFPackage#getESMFStageActionImportStateAdd_Item()
* @model required="true"
* @generated
*/
EList<ESMFStateItem> getItem();
} // ESMFStageActionImportStateAdd
| [
"[email protected]"
]
| |
8b2db7997abfaee4fe361bfa14494448ac7e104d | 9208ba403c8902b1374444a895ef2438a029ed5c | /sources/com/alibaba/fastjson/util/ParameterizedTypeImpl.java | 1e85774b2549790edbb0495ac72070a3853fe4ca | []
| no_license | MewX/kantv-decompiled-v3.1.2 | 3e68b7046cebd8810e4f852601b1ee6a60d050a8 | d70dfaedf66cdde267d99ad22d0089505a355aa1 | refs/heads/main | 2023-02-27T05:32:32.517948 | 2021-02-02T13:38:05 | 2021-02-02T13:44:31 | 335,299,807 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,045 | java | package com.alibaba.fastjson.util;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.Arrays;
public class ParameterizedTypeImpl implements ParameterizedType {
private final Type[] actualTypeArguments;
private final Type ownerType;
private final Type rawType;
public ParameterizedTypeImpl(Type[] typeArr, Type type, Type type2) {
this.actualTypeArguments = typeArr;
this.ownerType = type;
this.rawType = type2;
}
public Type[] getActualTypeArguments() {
return this.actualTypeArguments;
}
public Type getOwnerType() {
return this.ownerType;
}
public Type getRawType() {
return this.rawType;
}
public boolean equals(Object obj) {
boolean z = true;
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
ParameterizedTypeImpl parameterizedTypeImpl = (ParameterizedTypeImpl) obj;
if (!Arrays.equals(this.actualTypeArguments, parameterizedTypeImpl.actualTypeArguments)) {
return false;
}
Type type = this.ownerType;
if (type == null ? parameterizedTypeImpl.ownerType != null : !type.equals(parameterizedTypeImpl.ownerType)) {
return false;
}
Type type2 = this.rawType;
if (type2 != null) {
z = type2.equals(parameterizedTypeImpl.rawType);
} else if (parameterizedTypeImpl.rawType != null) {
z = false;
}
return z;
}
public int hashCode() {
Type[] typeArr = this.actualTypeArguments;
int i = 0;
int hashCode = (typeArr != null ? Arrays.hashCode(typeArr) : 0) * 31;
Type type = this.ownerType;
int hashCode2 = (hashCode + (type != null ? type.hashCode() : 0)) * 31;
Type type2 = this.rawType;
if (type2 != null) {
i = type2.hashCode();
}
return hashCode2 + i;
}
}
| [
"[email protected]"
]
| |
80d1a01b79ce61cf937e7e86b85b5ddd385d2291 | 22889d87384ab446202a998513397174ea2cadea | /shared/impl/src/test/java/org/kuali/mobility/math/geometry/SphericalTest.java | 129b3dff9011b999336a9b8beb3def80f92a4c91 | [
"MIT"
]
| permissive | tamerman/mobile-starting-framework | 114dfe0efc45c010e844ba8d0d5f3a283947c6cb | 11c70d7ff5ac36c7ad600df2f93b184a0ca79b43 | refs/heads/master | 2016-09-11T15:09:39.554255 | 2016-03-11T16:57:14 | 2016-03-11T16:57:14 | 22,442,542 | 1 | 3 | null | 2016-03-11T16:57:14 | 2014-07-30T19:59:01 | Java | UTF-8 | Java | false | false | 2,441 | java | /**
* The MIT License
* Copyright (c) 2011 Kuali Mobility Team
*
* 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 org.kuali.mobility.math.geometry;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.junit.Test;
import static org.junit.Assert.assertTrue;
/**
* @author Kuali Mobility Team ([email protected])
*/
public class SphericalTest {
private static final Logger LOG = LoggerFactory.getLogger(SphericalTest.class);
@Test
public void testComputeHeading() {
double expectedHeading = -142.8573142931038;
Point p1 = new Point(42.276674, -83.738029); // Ann Arbor
Point p2 = new Point(39.788, -86.165); // Bloomington
double heading = Spherical.computeHeading(p1, p2);
LOG.debug("Must travel " + heading + " from Ann Arbor to Bloomington");
assertTrue("Heading doesn't match. Found " + heading + ". Expected " + expectedHeading, heading == expectedHeading);
}
@Test
public void testComputeDistanceBetween() {
double expectedDistance = 343887.6338228662;
Point p1 = new Point(42.276674, -83.738029); // Ann Arbor
Point p2 = new Point(39.788, -86.165); // Bloomington
double distance = Spherical.computeDistanceBetween(p1, p2);
LOG.debug("Bloomington is " + distance + " meters from Ann Arbor.");
assertTrue("Distance doesn't match. Found " + distance + ". Expected " + expectedDistance, distance == expectedDistance);
}
}
| [
"[email protected]"
]
| |
befc57e33ccaeb16d233d47288ca33c0a6c3d091 | 54d78eeb9d019f6e1f4789f0bce30a849fc93e05 | /app/src/main/java/com/app/coolweather/util/Utility.java | 86339257535c4a9727cd344c6417abee1baa11f2 | [
"Apache-2.0"
]
| permissive | zhouliuping/coolweather | c44ff76f98f9eb34d2d8035a79a0a6e6d82b119c | be929e78b32a84fe60192528fd94cf8330a0c65a | refs/heads/master | 2023-07-07T02:08:05.312746 | 2021-08-13T08:31:15 | 2021-08-13T08:31:15 | 394,937,496 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,437 | java | package com.app.coolweather.util;
import android.text.TextUtils;
import com.app.coolweather.db.City;
import com.app.coolweather.db.County;
import com.app.coolweather.db.Province;
import com.google.gson.Gson;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
public class Utility {
/**
* 解析和处理服务器返回的省级数据
*/
public static boolean handleProvinceResponse(String response) {
if (!TextUtils.isEmpty(response)) {
try {
JSONArray allProvinces = new JSONArray(response);
for (int i = 0; i < allProvinces.length(); i++) {
JSONObject provinceObject = allProvinces.getJSONObject(i);
Province province = new Province();
province.setProvinceName(provinceObject.getString("name"));
province.setProvinceCode(provinceObject.getInt("id"));
province.save();
}
return true;
} catch (JSONException e) {
e.printStackTrace();
}
}
return false;
}
/**
* 解析和处理服务器返回的市级数据
*/
public static boolean handleCityResponse(String response, int provinceId) {
if (!TextUtils.isEmpty(response)) {
try {
JSONArray allCities = new JSONArray(response);
for (int i = 0; i < allCities.length(); i++) {
JSONObject cityObject = allCities.getJSONObject(i);
City city = new City();
city.setCityName(cityObject.getString("name"));
city.setCityCode(cityObject.getInt("id"));
city.setProvinceId(provinceId);
city.save();
}
return true;
} catch (JSONException e) {
e.printStackTrace();
}
}
return false;
}
/**
* 解析和处理服务器返回的县级数据
*/
public static boolean handleCountyResponse(String response, int cityId) {
if (!TextUtils.isEmpty(response)) {
try {
JSONArray allCounties = new JSONArray(response);
for (int i = 0; i < allCounties.length(); i++) {
JSONObject countyObject = allCounties.getJSONObject(i);
County county = new County();
county.setCountyName(countyObject.getString("name"));
county.setWeatherId(countyObject.getString("weather_id"));
county.setCityId(cityId);
county.save();
}
return true;
} catch (JSONException e) {
e.printStackTrace();
}
}
return false;
}
/**
* 将返回的JSON数据解析成Weather实体类
*/
// public static Weather handleWeatherResponse(String response) {
// try {
// JSONObject jsonObject = new JSONObject(response);
// JSONArray jsonArray = jsonObject.getJSONArray("HeWeather");
// String weatherContent = jsonArray.getJSONObject(0).toString();
// return new Gson().fromJson(weatherContent, Weather.class);
// } catch (Exception e) {
// e.printStackTrace();
// }
// return null;
// }
} | [
"[email protected]"
]
| |
6b9a0efbf87055f8bf8b292b7034071880c14c3e | 5440c44721728e87fb827fb130b1590b25f24989 | /GPP/com/brt/gpp/aplicacoes/enviarBonusCSP14/ConcessaoBumerangueProdutor.java | afc72a838a510cf44a5531917e8cb22481abb145 | []
| no_license | amigosdobart/gpp | b36a9411f39137b8378c5484c58d1023c5e40b00 | b1fec4e32fa254f972a0568fb7ebfac7784ecdc2 | refs/heads/master | 2020-05-15T14:20:11.462484 | 2019-04-19T22:34:54 | 2019-04-19T22:34:54 | 182,328,708 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,736 | java | package com.brt.gpp.aplicacoes.enviarBonusCSP14;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Iterator;
import com.brt.gpp.aplicacoes.Aplicacoes;
import com.brt.gpp.comum.Definicoes;
import com.brt.gpp.comum.conexoes.bancoDados.PREPConexao;
import com.brt.gpp.comum.gppExceptions.GPPInternalErrorException;
import com.brt.gpp.comum.mapeamentos.MapCodigoNacional;
import com.brt.gpp.comum.mapeamentos.entidade.CodigoNacional;
import com.brt.gpp.comum.produtorConsumidor.ProcessoBatchProdutor;
import com.brt.gpp.gerentesPool.GerentePoolBancoDados;
public class ConcessaoBumerangueProdutor extends Aplicacoes implements ProcessoBatchProdutor
{
private String statusProcesso = Definicoes.TIPO_OPER_SUCESSO;
private PREPConexao conexaoPrep;
private Iterator listaCodigosNacional;
private long numRegistros;
private String dataMes;
private SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
public ConcessaoBumerangueProdutor(long id)
{
super(id,Definicoes.CL_ENVIO_BONUS_CSP14);
}
/**
* @see com.brt.gpp.comum.produtorConsumidor.ProcessoBatchProdutor#getIdProcessoBatch()
*/
public int getIdProcessoBatch()
{
return Definicoes.IND_BONUS_CSP14;
}
/**
* @see com.brt.gpp.comum.produtorConsumidor.ProcessoBatchProdutor#getDescricaoProcesso()
*/
public String getDescricaoProcesso()
{
return "Bonus agendado para "+numRegistros+" assinantes";
}
/**
* @see com.brt.gpp.comum.produtorConsumidor.ProcessoBatchProdutor#getStatusProcesso()
*/
public String getStatusProcesso()
{
return statusProcesso;
}
/**
* @see com.brt.gpp.comum.produtorConsumidor.ProcessoBatchProdutor#setStatusProcesso(java.lang.String)
*/
public void setStatusProcesso(String status)
{
statusProcesso = status;
}
/**
* @see com.brt.gpp.comum.produtorConsumidor.ProcessoBatchProdutor#getDataProcessamento()
*/
public String getDataProcessamento()
{
return sdf.format(Calendar.getInstance().getTime());
}
/**
* @see com.brt.gpp.comum.produtorConsumidor.ProcessoBatchProdutor#getConexao()
*/
public PREPConexao getConexao()
{
return this.conexaoPrep;
}
/**
* Metodo....:incrementaRegistros
* Descricao.:Incrementa o contador para indicar registros processados com sucesso
*
*/
public void incrementaRegistros()
{
numRegistros++;
}
/**
* Metodo....:parseParametros
* Descricao.:Este metodo realiza a verificacao de parametros
* @param params - Array de valores contendo os parametros para a execucao do processo
* @throws GPPInternalErrorException
*/
private void parseParametros(String params[]) throws Exception
{
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMM");
try
{
// Para o processo de concessao do bonus bumerangue eh esperado a data mes
// para qual deve ser realizado a concessao. Esse parametro deve ser uma
// string no formato YYYYMM onde YYYY = Ano e MM = Mes do periodo
if (params == null || params.length == 0 ||params[0] == null)
{
Calendar cal = Calendar.getInstance();
cal.add(Calendar.MONTH,-1);
dataMes = sdf.format(cal.getTime());
}
else
{
sdf.parse(params[0]);
dataMes = params[0];
}
}
catch(ParseException pe)
{
throw new GPPInternalErrorException("Data mes invalida ou esta em formato invalido (yyyyMM). Valor: "+params[0]);
}
}
/**
* @see com.brt.gpp.comum.produtorConsumidor.Produtor#startup(java.lang.String[])
*/
public void startup(String[] params) throws Exception
{
// Realiza o parse do parametro de data afim de identificar para qual mes a totalizacao
// serah processada. Apos o parse realiza a pesquisa dos assinantes totalizados nessa
// para para serem processados pela promocao
parseParametros(params);
// Pega a conexao no pool de conexoes e altera para nao realizar o auto-commit. Essa
// funcionalidade vai permitir que as threads consumidoras nao realizem o commit sendo
// entao que apesar de divido o processamento, somente apos o termino de todas eh que
// o processamento serah efetivado
conexaoPrep = GerentePoolBancoDados.getInstancia(super.getIdLog()).getConexaoPREP(super.getIdLog());
conexaoPrep.setAutoCommit(false);
MapCodigoNacional map = MapCodigoNacional.getInstance();
listaCodigosNacional = map.buscarCodigosRegiaoBrt().iterator();
}
/**
* @see com.brt.gpp.comum.produtorConsumidor.Produtor#next()
*/
public Object next() throws Exception
{
ConcessaoBumerangueVO vo = null;
if (listaCodigosNacional.hasNext())
{
CodigoNacional codNacional = (CodigoNacional)listaCodigosNacional.next();
vo = new ConcessaoBumerangueVO();
vo.setCn (codNacional);
vo.setDatMes(this.dataMes);
}
return vo;
}
/**
* @see com.brt.gpp.comum.produtorConsumidor.Produtor#finish()
*/
public void finish() throws Exception
{
// No finish do produtor, entao todas as threads jah realizaram
// o processamento. Portanto nesse ponto os dados inseridos sao
// efetivados
conexaoPrep.commit();
GerentePoolBancoDados.getInstancia(super.getIdLog()).liberaConexaoPREP(conexaoPrep,super.getIdLog());
}
/**
* @see com.brt.gpp.comum.produtorConsumidor.Produtor#handleException()
*/
public void handleException()
{
// Caso algum erro aconteca entao o handleException realiza desfaz
// os dados inseridos
try
{
conexaoPrep.rollback();
}
catch(Exception e)
{
super.log(Definicoes.ERRO,"handleException","Erro ao desfazer transacao de dados da concessao do bumerangue. Erro:"+e);
}
}
}
| [
"[email protected]"
]
| |
4a9c13934e96c73c425257a68863e1b8f3965669 | 0a799d14388c7a579e5d2f523e50aa96ae57f22a | /src/main/java/com/fasterxml/jackson/core/json/JsonWriteFeature.java | c3b03fe3c29866c01cb474b233f349141226e400 | [
"Apache-2.0"
]
| permissive | GotoFinal/jackson-core | 1b4af807e2ac4294d12184f87705eb6827d66afb | b46e7a1dc2130507e8032cadcd7ead904c5e0ce7 | refs/heads/master | 2020-04-02T00:04:57.178000 | 2018-10-12T18:29:43 | 2018-10-12T18:29:43 | 153,787,878 | 1 | 0 | null | 2018-10-19T13:34:54 | 2018-10-19T13:34:54 | null | UTF-8 | Java | false | false | 5,414 | java | package com.fasterxml.jackson.core.json;
import com.fasterxml.jackson.core.*;
/**
* Token writer features specific to JSON backend.
*
* @since 2.10
*/
public enum JsonWriteFeature
implements FormatFeature
{
// // // Support for non-standard data format constructs: comments
// // Quoting-related features
/**
* Feature that determines whether JSON Object field names are
* quoted using double-quotes, as specified by JSON specification
* or not. Ability to disable quoting was added to support use
* cases where they are not usually expected, which most commonly
* occurs when used straight from Javascript.
*<p>
* Feature is enabled by default (since it is required by JSON specification).
*/
QUOTE_FIELD_NAMES(true, JsonGenerator.Feature.QUOTE_FIELD_NAMES),
/**
* Feature that determines whether "NaN" ("not a number", that is, not
* real number) float/double values are output as JSON strings.
* The values checked are Double.Nan,
* Double.POSITIVE_INFINITY and Double.NEGATIVE_INIFINTY (and
* associated Float values).
* If feature is disabled, these numbers are still output using
* associated literal values, resulting in non-conforming
* output.
*<p>
* Feature is enabled by default.
*/
WRITE_NAN_AS_STRINGS(true, JsonGenerator.Feature.QUOTE_NON_NUMERIC_NUMBERS),
/**
* Feature that forces all Java numbers to be written as JSON strings.
* Default state is 'false', meaning that Java numbers are to
* be serialized using basic numeric serialization (as JSON
* numbers, integral or floating point). If enabled, all such
* numeric values are instead written out as JSON Strings.
*<p>
* One use case is to avoid problems with Javascript limitations:
* since Javascript standard specifies that all number handling
* should be done using 64-bit IEEE 754 floating point values,
* result being that some 64-bit integer values can not be
* accurately represent (as mantissa is only 51 bit wide).
*<p>
* Feature is disabled by default.
*/
WRITE_NUMBERS_AS_STRINGS(false, JsonGenerator.Feature.WRITE_NUMBERS_AS_STRINGS),
/**
* Feature that specifies that all characters beyond 7-bit ASCII
* range (i.e. code points of 128 and above) need to be output
* using format-specific escapes (for JSON, backslash escapes),
* if format uses escaping mechanisms (which is generally true
* for textual formats but not for binary formats).
*<p>
* Note that this setting may not necessarily make sense for all
* data formats (for example, binary formats typically do not use
* any escaping mechanisms; and some textual formats do not have
* general-purpose escaping); if so, settings is simply ignored.
* Put another way, effects of this feature are data-format specific.
*<p>
* Feature is disabled by default.
*/
// @SuppressWarnings("deprecation")
ESCAPE_NON_ASCII(false, JsonGenerator.Feature.ESCAPE_NON_ASCII),
//23-Nov-2015, tatu: for [core#223], if and when it gets implemented
/**
* Feature that specifies handling of UTF-8 content that contains
* characters beyond BMP (Basic Multilingual Plane), which are
* represented in UCS-2 (Java internal character encoding) as two
* "surrogate" characters. If feature is enabled, these surrogate
* pairs are separately escaped using backslash escapes; if disabled,
* native output (4-byte UTF-8 sequence, or, with char-backed output
* targets, writing of surrogates as is which is typically converted
* by {@link java.io.Writer} into 4-byte UTF-8 sequence eventually)
* is used.
*<p>
* Note that the original JSON specification suggests use of escaping;
* but that this is not correct from standard UTF-8 handling perspective.
* Because of two competing goals, this feature was added to allow either
* behavior to be used, but defaulting to UTF-8 specification compliant
* mode.
*<p>
* Feature is disabled by default.
*/
// ESCAPE_UTF8_SURROGATES(false, JsonGenerator.Feature.ESCAPE_UTF8_SURROGATES),
;
final private boolean _defaultState;
final private int _mask;
/**
* For backwards compatibility we may need to map to one of existing {@link JsonGenerator.Feature}s;
* if so, this is the feature to enable/disable.
*/
final private JsonGenerator.Feature _mappedFeature;
/**
* Method that calculates bit set (flags) of all features that
* are enabled by default.
*/
public static int collectDefaults()
{
int flags = 0;
for (JsonWriteFeature f : values()) {
if (f.enabledByDefault()) {
flags |= f.getMask();
}
}
return flags;
}
private JsonWriteFeature(boolean defaultState,
JsonGenerator.Feature mapTo) {
_defaultState = defaultState;
_mask = (1 << ordinal());
_mappedFeature = mapTo;
}
@Override
public boolean enabledByDefault() { return _defaultState; }
@Override
public int getMask() { return _mask; }
@Override
public boolean enabledIn(int flags) { return (flags & _mask) != 0; }
public JsonGenerator.Feature mappedFeature() { return _mappedFeature; }
}
| [
"[email protected]"
]
| |
1b279ce2bc6e3a63a9fc9a0e1aa83f319395f90b | 8fd92f2563c1f9fb72158c0ab759f8a8aafb7506 | /src/com/math/calculator/calculation/exception/OperatorNotFoundException.java | cf33a6c9ec5f550d50ae817d38c96410f7fc4ff0 | []
| no_license | vladmirlu/Calculator | 2f8e574757f7d6dae0228600f62cc58bd04b0cc2 | e84123885d95d41934f2a2fef631bc28bc6d8f0a | refs/heads/master | 2020-04-02T18:00:08.788099 | 2018-11-22T23:28:04 | 2018-11-22T23:28:04 | 154,682,905 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 268 | java | package com.math.calculator.calculation.exception;
/** Signals that math operator not found during the calculation process*/
public class OperatorNotFoundException extends Exception {
public OperatorNotFoundException() {
super.printStackTrace();
}
}
| [
"[email protected]"
]
| |
d6602c2d412099a36b055bfb4a3b986223df2906 | 54d57678b3aae5229d54620ddf7994cb63cc1218 | /app/src/androidTest/java/neighbors/com/spacetrader/ExampleInstrumentedTest.java | c7e944726a5ff49c5b16a11dced2174f46a34b03 | []
| no_license | oetago/CS2340-SpaceTrader | 1bef2231e6d4ae5bfb75ef20e278fce0e3c35fb3 | 8c316bdbe59f4ba9432457bc14cb333993cd475e | refs/heads/master | 2023-01-10T11:03:42.933699 | 2019-04-15T18:00:02 | 2019-04-15T18:00:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 732 | java | package neighbors.com.spacetrader;
import android.content.Context;
import org.junit.Test;
import org.junit.runner.RunWith;
import androidx.test.InstrumentationRegistry;
import androidx.test.runner.AndroidJUnit4;
import static org.junit.Assert.assertEquals;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("neighbors.com.spacetrader", appContext.getPackageName());
}
}
| [
"[email protected]"
]
| |
b56ac428189ad5378bc9aef4a62df12d7f43a5e4 | 50dfd27c6574fdbf691d09c0fa9ee712ddb248a9 | /src/main/java/Model/PorteEntree.java | 97c9fcc59ecb8596fc1cdbb904ed218310e60ccd | []
| no_license | GhadaRV/ExamenPoo | 9da531816e9a2537367fc11e03d959ca16a29cf7 | e0a1d57ac63a6bb45f770e9a6ab16b9f9d152c70 | refs/heads/master | 2022-01-01T08:45:07.077248 | 2019-12-18T15:46:51 | 2019-12-18T15:46:51 | 228,688,198 | 0 | 0 | null | 2021-12-14T21:37:36 | 2019-12-17T19:36:37 | Java | UTF-8 | Java | false | false | 384 | java | package Model;
public class PorteEntree extends Porte {
private int numeroDePorte;
public Integer getNumeroDePorte() {
return numeroDePorte;
}
public void setNumeroDePorte(int numeroDePorte) {
this.numeroDePorte = numeroDePorte;
}
public PorteEntree(int numeroDePorte) {
super();
this.numeroDePorte = numeroDePorte;
}
public PorteEntree() {
super();
}
}
| [
"[email protected]"
]
| |
e0ccd8a87b464b1f49b7f67b4089235b8a3c16ff | 7178a1390a38efbce6cd61e55bdc9d1d2cd9ecbf | /DataStructure/src/ch4cp3/Client.java | 3b577a643f585490ec9931601181b1e9fe924ac6 | []
| no_license | massarfusion/EclipseBackUp2020 | ac91acbc25e660d2877b0a1d7f797466328705a9 | 703d95d274c7097193eccb87ddc2dbbe3e9ee56a | refs/heads/master | 2023-01-19T04:51:23.927085 | 2020-12-04T00:17:06 | 2020-12-04T00:17:06 | 313,882,611 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 246 | java | package ch4cp3;
import java.util.Scanner;
public class Client {
public static void main(String[] args) {
Scanner in =new Scanner (System.in);
int target=in.nextInt();
Round rd=new Round(target);
rd.spin();
rd.printme();
}
}
| [
"[email protected]"
]
| |
0c8dfe80c5af55b8e8a65a9e695dfc1f2adc1c2e | c1e3dfee888665f16e4db1d3c723027a9b650d24 | /gulimall_order/src/main/java/com/wu/gulimall/gulimall_order/entity/RefundInfoEntity.java | 27b387a151ef3d294a31170b67f9143745ecc3f6 | [
"Apache-2.0"
]
| permissive | DOCCA0/gulimall | 875af849305498bc402c0aabe73d7027ef8eb05c | 1ecf200119ba389c631f70d24ecd729388aee0ea | refs/heads/main | 2023-03-19T20:53:31.532635 | 2021-03-07T13:54:40 | 2021-03-07T13:54:40 | 344,119,004 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 935 | java | package com.wu.gulimall.gulimall_order.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.math.BigDecimal;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 退款信息
*
* @author wucao
* @email [email protected]
* @date 2021-03-07 21:29:53
*/
@Data
@TableName("oms_refund_info")
public class RefundInfoEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId
private Long id;
/**
* 退款的订单
*/
private Long orderReturnId;
/**
* 退款金额
*/
private BigDecimal refund;
/**
* 退款交易流水号
*/
private String refundSn;
/**
* 退款状态
*/
private Integer refundStatus;
/**
* 退款渠道[1-支付宝,2-微信,3-银联,4-汇款]
*/
private Integer refundChannel;
/**
*
*/
private String refundContent;
}
| [
"[email protected]"
]
| |
2972027c07421a80ef8eb4674fa20c2e3da9029b | 8a5a42b8d1352a7184cb4fe8ed535073d673c8a9 | /src/main/java/src/MainController.java | e36ae89266810a80330ad2b1d5422cecb3a7fff0 | [
"Unlicense"
]
| permissive | Arquisoft/participationSystem2a | 91c61ebf99482f89e7573368b2ef238d12b562e9 | 1deb9412ade3ce0e37a25de93396d16a000c6557 | refs/heads/master | 2021-01-17T14:19:18.283759 | 2017-05-10T10:45:30 | 2017-05-10T10:45:30 | 84,083,652 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,211 | java | package src;
import java.util.List;
import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import src.business.SuggestionService;
import src.business.UserService;
import src.model.Association;
import src.model.Category;
import src.model.Comment;
import src.model.Suggestion;
import src.model.User;
import src.producers.KafkaProducer;
import src.repository.CategoryRepository;
import src.repository.CommentRepository;
@Controller
public class MainController {
@Autowired
private UserService userService;
@Autowired
private SuggestionService suggestionService;
@Autowired
private CategoryRepository categoryRepository;
@Autowired
private CommentRepository CommentRepository;
@Autowired
private KafkaProducer kafkaProducer;
private Suggestion seleccionada;
@RequestMapping("/")
public String landing(Model model) {
model.addAttribute("message", new Message());
return "login";
}
@RequestMapping("/send")
public String send(Model model, @ModelAttribute Message message) {
kafkaProducer.send("exampleTopic", message.getMessage());
return "redirect:/";
}
@RequestMapping(value="/login", method = RequestMethod.POST)
public String login(HttpSession session, Model model, @RequestParam String nombre, @RequestParam String password){
User userLogin = userService.findByUserAndPassword(nombre, password);
if(userLogin!=null){
//Ponemos al usuario en sesion
session.setAttribute("user", userLogin);
//Y cargamos el modelo
loadSuggestions(model);
if(userLogin.isAdmin()){
return "listSuggestionsAdmin";
}
else{
return "listSuggestions";
}
}
else{
return "login";
}
}
@RequestMapping(value="/logout", method = RequestMethod.POST)
public String cerrarSesion(HttpSession session){
//Ponemos el userLogin en sesion a null
session.setAttribute("user", null);
return "login";
}
@RequestMapping(value="/listSuggestions", method = RequestMethod.POST)
public String irALista(Model model){
loadSuggestions(model);
return "listSuggestions";
}
@RequestMapping(value="/listSuggestionsAdmin", method = RequestMethod.POST)
public String irAListaAdmin(Model model){
loadSuggestions(model);
return "listSuggestionsAdmin";
}
private void loadSuggestions(Model model){
List<Suggestion> sugerencias = suggestionService.getSuggestions();
model.addAttribute("sugerencias", sugerencias);
}
@RequestMapping("/newSuggestion")
public String nuevaSugerencia(){
return "addSuggestion";
}
@RequestMapping(value="/addSuggestion", method = RequestMethod.POST)
public String addSuggestion(HttpSession session, Model model, @RequestParam String contenido){
List<Category> categorias = categoryRepository.findAll();
Suggestion suggestion = new Suggestion(contenido, categorias.get(0), (User)session.getAttribute("user"));
suggestionService.addSuggestion(suggestion);
loadSuggestions(model);
return "listSuggestions";
}
@RequestMapping(value="/mostrar", method = RequestMethod.POST)
public String showSuggestion(HttpSession session, Model model, @RequestParam("sugerencia") Long id){
Suggestion sugerencia = suggestionService.getSuggestion(id);
this.seleccionada=sugerencia;
if(sugerencia!=null){
model.addAttribute("seleccionada", sugerencia);
User user = (User)session.getAttribute("user");
if(user.isAdmin()){
return "showSuggestionAdmin";
}
return "showSuggestion";
}
return "listSuggestions";
}
@RequestMapping("/nuevoComentario")
public String nuevoComentario(@RequestParam("sugerencia") Suggestion sugerencia){
this.seleccionada=sugerencia;
return "addComment";
}
@RequestMapping(value="/addComment", method = RequestMethod.POST)
public String addComment(HttpSession session, Model model, @RequestParam String contenido){
Comment comentario = new Comment(contenido, seleccionada, (User)session.getAttribute("user"));
CommentRepository.save(comentario);
model.addAttribute("seleccionada", suggestionService.getSuggestion(seleccionada.getId()));
return "showSuggestion";
}
@RequestMapping(value="/deleteComment", method = RequestMethod.POST)
public String deleteComment(HttpSession session, Model model, @RequestParam("comentario") Long id){
CommentRepository.delete(id);
model.addAttribute("seleccionada", suggestionService.getSuggestion(seleccionada.getId()));
return "showSuggestionAdmin";
}
@RequestMapping(value="/deleteSuggestion", method = RequestMethod.POST)
public String deleteSuggestion(Model model, @RequestParam("sugerencia") Long id){
Suggestion s = suggestionService.getSuggestion(id);
Association.AsignarSugerencia.unlink(s.getUsuario(), s);
for(Comment c: s.getComentarios()){
CommentRepository.delete(c);
}
suggestionService.deleteSuggestion(id);
loadSuggestions(model);
return "listSuggestionsAdmin";
}
} | [
"[email protected]"
]
| |
0da2a53fe31f6dfaf90aa8709cfa0eb2a0a45225 | 56cd72421de2321109a3a971f3b71a0bb25b321f | /interfaces/jni/java/Const.java | 989cd9cc1692c0c6edec755d043d7cf3551559c6 | []
| no_license | amas2010/NewSouffle | e7bc184b567b5cd4c51722fe9aa85d2f71280e96 | e956c2f089a0ec2350c78cef0b1e7e299db3446a | refs/heads/master | 2021-08-07T11:10:32.359090 | 2017-10-28T04:52:20 | 2017-10-28T04:52:20 | 109,920,651 | 0 | 0 | null | 2017-11-08T03:33:54 | 2017-11-08T03:02:04 | C++ | UTF-8 | Java | false | false | 198 | java | package com.soufflelang.souffle;
public class Const extends Arg
{
public Const(String num) {
init(Long.decode(num));
}
private native void init(long num);
private long nativeHandle;
}
| [
"[email protected]"
]
| |
2bb2c650ecc71160a500dbe1b84900d198b60c89 | d4ef5a014caa09af8f4fe9a9b65d56f09f98f834 | /automationtrainingcourse/src/test/java/com/peoplentech/automationtrainingcourse/Sign.java | c5f0d40adf8a7491d3258960a7616a7c53212f44 | []
| no_license | MUHAMMADSaleemThr/Automationa | 1a5149ced8a1d4cd5d2758bf790124db5f2a7d5e | da5f6aa39bdff6fb2d2bf24f808bac1bd86a1121 | refs/heads/master | 2023-04-17T02:25:29.868069 | 2021-04-22T02:16:32 | 2021-04-22T02:16:32 | 360,008,326 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,064 | java | package com.peoplentech.automationtrainingcourse;
import org.testng.annotations.Test;
import org.openqa.selenium.By;
import org.testng.annotations.DataProvider;
public class Sign extends Comon {
@Test(dataProvider = "Sign")
public void f(String n, String s) throws InterruptedException {
/* Home home=new Home(driver);
home.HoverToSign();
home.SignButtonClick();
home.EmailSendKeys(n);
Thread.sleep(6000);
home.ContinueButtonClick();
home.PsswordSendKeys(s);
Thread.sleep(6000);
//home.SignButtonClickIn();
//Thread.sleep(6000);
home.ChangeIdSign();
Thread.sleep(6000);*/
driver.findElement(By.name("email")).sendKeys(n);
driver.findElement(By.name("pass")).sendKeys(s);
Thread.sleep(6000);
driver.findElement(By.name("email")).clear();
driver.findElement(By.name("pass")).clear();
Thread.sleep(6000);
}
@DataProvider
public Object[][] Sign() {
return new Object[][] {
new Object[] { "[email protected]", "Ashburn" },
new Object[] { "[email protected]", "Silver" },
};
}
}
| [
"MUHAMMAD Shahbaz [email protected]"
]
| MUHAMMAD Shahbaz [email protected] |
976ce68a486ddd80b8fe4ab5f3aeb062b969569c | b3143b62fbc869674392b3f536b1876af0b2611f | /jsf-worker-parent/jsf-worker-dao/src/main/java/com/ipd/jsf/worker/domain/DeploySys.java | 741d06b9b68a3d6c2089a4bb5000eb8dc544b612 | [
"Apache-2.0"
]
| permissive | Mr-L7/jsf-core | 6630b407caf9110906c005b2682d154da37d4bfd | 90c8673b48ec5fd9349e4ef5ae3b214389a47f65 | refs/heads/master | 2020-03-18T23:26:17.617172 | 2017-12-14T05:52:55 | 2017-12-14T05:52:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,366 | java | /**
* Copyright 2004-2048 .
*
* 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.ipd.jsf.worker.domain;
import java.io.Serializable;
public class DeploySys
implements Serializable
{
private static final long serialVersionUID = 3687651757123777056L;
private String appDevelopGroupName;
private String busDomain;
private String first_branch;
private String joneAppType;
private String leader;
private String leader_name;
private int level;
private String level_name;
private String mainBusDomain;
private String name;
private String orderFieldNextType;
private String second_branch;
private int sysId;
private int joneAppLevel;// 应用级别
public String getAppDevelopGroupName()
{
return this.appDevelopGroupName;
}
public void setAppDevelopGroupName(String appDevelopGroupName) {
this.appDevelopGroupName = appDevelopGroupName;
}
public String getBusDomain() {
return this.busDomain;
}
public void setBusDomain(String busDomain) {
this.busDomain = busDomain;
}
public String getFirst_branch() {
return this.first_branch;
}
public void setFirst_branch(String first_branch) {
this.first_branch = first_branch;
}
public String getJoneAppType() {
return this.joneAppType;
}
public void setJoneAppType(String joneAppType) {
this.joneAppType = joneAppType;
}
public String getLeader() {
return this.leader;
}
public void setLeader(String leader) {
this.leader = leader;
}
public String getLeader_name() {
return this.leader_name;
}
public void setLeader_name(String leader_name) {
this.leader_name = leader_name;
}
public int getLevel() {
return this.level;
}
public void setLevel(int level) {
this.level = level;
}
public String getLevel_name() {
return this.level_name;
}
public void setLevel_name(String level_name) {
this.level_name = level_name;
}
public String getMainBusDomain() {
return this.mainBusDomain;
}
public void setMainBusDomain(String mainBusDomain) {
this.mainBusDomain = mainBusDomain;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public String getOrderFieldNextType() {
return this.orderFieldNextType;
}
public void setOrderFieldNextType(String orderFieldNextType) {
this.orderFieldNextType = orderFieldNextType;
}
public String getSecond_branch() {
return this.second_branch;
}
public void setSecond_branch(String second_branch) {
this.second_branch = second_branch;
}
public int getSysId() {
return this.sysId;
}
public void setSysId(int sysId) {
this.sysId = sysId;
}
public int getJoneAppLevel() {
return joneAppLevel;
}
public void setJoneAppLevel(int joneAppLevel) {
this.joneAppLevel = joneAppLevel;
}
} | [
"[email protected]"
]
| |
389437eef9b7f52eab29cf13a16423214fc7aa81 | e986454d21734b88b190bde7ff4e9c299fc9e098 | /src/main/java/modInvisibles.java | ffa7057bf91981666b5ef0a1e50a1db1e2cfda5b | []
| no_license | DakaraOnline/dakara-server-java | 67b6368d6323d37604d8dd146e9d1e08092fad27 | a1f0b54273a162ff5499be5e2b40bd0d68255e11 | refs/heads/master | 2021-01-10T17:38:44.589368 | 2016-10-27T10:09:59 | 2016-10-27T10:09:59 | 53,197,108 | 5 | 5 | null | 2018-09-13T13:58:09 | 2016-03-05T11:00:14 | Java | UTF-8 | Java | false | false | 1,133 | java | /* AUTOMATICALLY CONVERTED FILE */
/*
* Este archivo fue convertido automaticamente, por un script, desde el
* código fuente original de Visual Basic 6.
*/
/* [(0, 'ATTRIBUTE'), (1, 'VB_Name'), (5, '='), (4, '"modInvisibles"')] */
import enums.*;
public class modInvisibles {
/* ' 0 = viejo */
/* ' 1 = nuevo */
/* # CONST MODO_INVISIBILIDAD = 0 */
static final int MODO_INVISIBILIDAD = 0;
/*
* ' cambia el estado de invisibilidad a 1 o 0 dependiendo del modo: true o
* false
*/
/* ' */
public static void PonerInvisible(int UserIndex, boolean estado) {
/* # IF MODO_INVISIBILIDAD = 0 THEN */
Declaraciones.UserList[UserIndex].flags.invisible = vb6.IIf(estado, 1, 0);
Declaraciones.UserList[UserIndex].flags.Oculto = vb6.IIf(estado, 1, 0);
Declaraciones.UserList[UserIndex].Counters.Invisibilidad = 0;
UsUaRiOs.SetInvisible(UserIndex, Declaraciones.UserList[UserIndex].Char.CharIndex, ! /* FIXME */estado);
/*
* 'Call SendData(SendTarget.ToPCArea, UserIndex,
* PrepareMessageSetInvisible(UserList(UserIndex).Char.CharIndex, Not
* estado))
*/
/* # ELSE */
/* # END IF */
}
} | [
"[email protected]"
]
| |
6945c6c16ddaabc13443b187b1d3f2d51d8b1b28 | be76fa2e6c35ff99386ead879e059639613249b1 | /src/cn/store/domain/Product.java | 7fcd3c78c3594897fc6df1f70b944a3816f36c0c | []
| no_license | stnh001/BullStore | 249c9781d220f57241aa1dc46c2dfb26c048e1d8 | 3fdd2eaac340de2ffc6e961665dc780496e1f9b9 | refs/heads/master | 2021-01-25T14:04:33.178626 | 2018-03-02T13:26:52 | 2018-03-02T13:26:52 | 123,650,213 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,782 | java | package cn.store.domain;
import java.io.Serializable;
public class Product implements Serializable {
private Integer id; // 商品的id
private String name; // 商品的名称
private String address; // 商品的地址
private double price; // 商品的价格
private int sales; // 商品的销量
private int stock; // 商品的库存
private String imgPath = "static/img/default.jpg"; // 商品的图片
public Product() {
super();
}
public Product(Integer id, String name, String address, double price, int sales, int stock, String imgPath) {
super();
this.id = id;
this.name = name;
this.address = address;
this.price = price;
this.sales = sales;
this.stock = stock;
this.imgPath = imgPath;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}
public int getSales() {
return sales;
}
public void setSales(int sales) {
this.sales = sales;
}
public int getStock() {
return stock;
}
public void setStock(int stock) {
this.stock = stock;
}
public String getImgPath() {
return imgPath;
}
public void setImgPath(String imgPath) {
this.imgPath = imgPath;
}
@Override
public String toString() {
return "Product [id=" + id + ", name=" + name + ", address=" + address + ", price=" + price + ", sales=" + sales
+ ", stock=" + stock + ", imgPath=" + imgPath + "]";
}
}
| [
"[email protected]"
]
| |
bdb20cb2a9c3392fe2e05eb42aea403e09960424 | 23854c7cc8cde35c3bfcd59a8ab404234319d31b | /src/main/java/com/lab/hometask/dto/ItemDto.java | 4f7775776ee717c0c34c645362f0f6dfc338d745 | []
| no_license | seradd/lab | 0eebff8d9f91f3ae9fd7665618f62d94a8fddf2a | ee27769b765c818a3e351f361d811f881201e73e | refs/heads/main | 2023-06-23T14:57:03.251685 | 2021-07-26T11:07:14 | 2021-07-26T11:07:14 | 383,217,540 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 255 | java | package com.lab.hometask.dto;
import lombok.Data;
import java.io.Serializable;
@Data
public class ItemDto implements Serializable {
private static final long serialVersionUID = 1L;
private String itemValue;
private CategoryDto category;
}
| [
"[email protected]"
]
| |
f0cafcde9a7ac04e0fe512db093cf9ea9215a988 | bf2966abae57885c29e70852243a22abc8ba8eb0 | /aws-java-sdk-qldb/src/main/java/com/amazonaws/services/qldb/model/transform/S3EncryptionConfigurationJsonUnmarshaller.java | 0d7da637ee60edcfcf20ac4c8b58f9c18bf4c768 | [
"Apache-2.0"
]
| permissive | kmbotts/aws-sdk-java | ae20b3244131d52b9687eb026b9c620da8b49935 | 388f6427e00fb1c2f211abda5bad3a75d29eef62 | refs/heads/master | 2021-12-23T14:39:26.369661 | 2021-07-26T20:09:07 | 2021-07-26T20:09:07 | 246,296,939 | 0 | 0 | Apache-2.0 | 2020-03-10T12:37:34 | 2020-03-10T12:37:33 | null | UTF-8 | Java | false | false | 3,124 | java | /*
* Copyright 2016-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.qldb.model.transform;
import java.math.*;
import javax.annotation.Generated;
import com.amazonaws.services.qldb.model.*;
import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*;
import com.amazonaws.transform.*;
import com.fasterxml.jackson.core.JsonToken;
import static com.fasterxml.jackson.core.JsonToken.*;
/**
* S3EncryptionConfiguration JSON Unmarshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class S3EncryptionConfigurationJsonUnmarshaller implements Unmarshaller<S3EncryptionConfiguration, JsonUnmarshallerContext> {
public S3EncryptionConfiguration unmarshall(JsonUnmarshallerContext context) throws Exception {
S3EncryptionConfiguration s3EncryptionConfiguration = new S3EncryptionConfiguration();
int originalDepth = context.getCurrentDepth();
String currentParentElement = context.getCurrentParentElement();
int targetDepth = originalDepth + 1;
JsonToken token = context.getCurrentToken();
if (token == null)
token = context.nextToken();
if (token == VALUE_NULL) {
return null;
}
while (true) {
if (token == null)
break;
if (token == FIELD_NAME || token == START_OBJECT) {
if (context.testExpression("ObjectEncryptionType", targetDepth)) {
context.nextToken();
s3EncryptionConfiguration.setObjectEncryptionType(context.getUnmarshaller(String.class).unmarshall(context));
}
if (context.testExpression("KmsKeyArn", targetDepth)) {
context.nextToken();
s3EncryptionConfiguration.setKmsKeyArn(context.getUnmarshaller(String.class).unmarshall(context));
}
} else if (token == END_ARRAY || token == END_OBJECT) {
if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {
if (context.getCurrentDepth() <= originalDepth)
break;
}
}
token = context.nextToken();
}
return s3EncryptionConfiguration;
}
private static S3EncryptionConfigurationJsonUnmarshaller instance;
public static S3EncryptionConfigurationJsonUnmarshaller getInstance() {
if (instance == null)
instance = new S3EncryptionConfigurationJsonUnmarshaller();
return instance;
}
}
| [
""
]
| |
cd7516c9f76056d49ed96609488c58468e1341ec | cbf45e436c2a36006a91b2edb66a21cb96754df2 | /src/com/onsite/chic/actions/Asset.java | dcd40ae5670ff0eb5b42fd83288447a2f76c06a2 | []
| no_license | on-site/chic | 3f02e80b05b7f25993a93cc2255a98b9d95256e3 | 660f30b703af091eb594ebdd520d1344fc143a92 | refs/heads/master | 2021-01-23T13:44:17.475109 | 2015-06-25T00:06:54 | 2015-06-25T00:06:54 | 37,692,907 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,201 | java | package com.onsite.chic.actions;
import com.onsite.chic.Request;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.IOException;
/**
* Action to render a static asset like JS and CSS files.
*
* @author Mike Virata-Stone
*/
public class Asset extends Action {
@Override
public boolean canProcess(Request request) {
if (!isGet(request)) {
return false;
}
if (!isValidAsset(request)) {
return false;
}
// Because of how the cached class loader works, we cannot use
// getResource, only getResourceAsStream
try {
try (InputStream stream = getStream(request)) {
return stream != null;
}
} catch (IOException e) {
return false;
}
}
protected String getAssetPath(String path) {
if (path.startsWith("/")) {
path = path.substring(1);
}
return "assets/" + path;
}
protected InputStream getStream(Request request) {
return request.getClass().getResourceAsStream(getAssetPath(request.getPath()));
}
protected InputStream getStream(String asset) {
return request.getClass().getResourceAsStream(asset);
}
private static boolean isValidAsset(Request request) {
return request.getPath().endsWith(".js") || request.getPath().endsWith(".css");
}
@Override
public void process() throws IOException {
request.printHeader(200, Request.getMimeType(request.getPath()));
printAsset();
}
protected void printAsset() throws IOException {
printAsset(getStream(request));
}
protected void printAsset(InputStream stream) throws IOException {
if (stream == null) {
System.err.println("Chic: Failed to find asset!");
return;
}
try (BufferedReader input = new BufferedReader(new InputStreamReader(stream, "UTF-8"))) {
String line = input.readLine();
while (line != null) {
request.println(line);
line = input.readLine();
}
}
}
}
| [
"[email protected]"
]
| |
09fdef8452ad3b6ab721404bd9774ca4b493c39e | eef1297da46d45810e538badf753ed107e1402e8 | /ParentModule/Statistics_Service/src/main/java/com/wpf/service/statistic/impl/StatisticServiceImpl.java | 0683d712c0a771ee4977c78dde1301248f734100 | []
| no_license | StevenFlyGit/MySaasExportProject | 6df982368785953ca48aab1a552964b807e834c0 | a896000df56c6228f4d83f88e70c0043cf8e7f65 | refs/heads/master | 2023-01-14T18:40:45.703130 | 2020-11-21T00:14:11 | 2020-11-21T00:14:11 | 309,135,800 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 946 | java | package com.wpf.service.statistic.impl;
import com.alibaba.dubbo.config.annotation.Service;
import com.wpf.dao.statistic.StatisticDao;
import com.wpf.service.statistic.StatisticService;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
import java.util.Map;
/**
* 创建时间:2020/11/17
* SassExport项目-Service层实现类
* @author wpf
*/
@Service(timeout = 5000000)
public class StatisticServiceImpl implements StatisticService {
@Autowired
StatisticDao statisticDao;
@Override
public List<Map<String, Object>> findFactorySale() {
return statisticDao.queryFactorySale();
}
@Override
public List<Map<String, Object>> findProductTopSale(Integer topNum) {
return statisticDao.queryProductTopSale(topNum);
}
@Override
public List<Map<String, Object>> findOnlinePopulation() {
return statisticDao.queryOnlinePopulation();
}
}
| [
"[email protected]"
]
| |
6e9e3c1c0f4cd6d3af4baa02f241f9f1ddfaa8c9 | 287141849083296f8bec9e0ea001d7e92f119571 | /src/com/niceappp/filepanda/FilesAdapter.java | 295f3734eb7d580499fdc68f4719fca561b7967c | []
| no_license | seymores/filepanda | 96e7825d30880b21422ce8e707d0fdab0ee6b36c | 292236638814fe5d6b208555fc67b564ecd4650b | refs/heads/master | 2020-06-04T20:58:24.809223 | 2013-01-27T16:54:23 | 2013-01-27T16:54:23 | 7,803,129 | 6 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,763 | java | package com.niceappp.filepanda;
import java.io.File;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Date;
import org.ocpsoft.prettytime.PrettyTime;
import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Color;
import android.graphics.Typeface;
import android.os.Environment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.MimeTypeMap;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
@SuppressLint("DefaultLocale")
public class FilesAdapter extends BaseAdapter {
private static final String TAG = "FilesAdapter";
private File[] fileList;
private PrettyTime p = new PrettyTime();
private Context ctx;
public FilesAdapter(Context ctx) {
super();
this.ctx = ctx;
}
public void loadFiles(String filepath) {
String startPath = filepath;
if (startPath == null)
startPath = Environment.getExternalStorageDirectory().getAbsolutePath();
File root = new File(startPath);
File[] files = root.listFiles();
fileList = files;
sortFilesByName();
}
@Override
public int getCount() {
if (fileList == null)
return 0;
return fileList.length;
}
@Override
public Object getItem(int position) {
return fileList[position];
}
@Override
public long getItemId(int position) {
File f = fileList[position];
return f.hashCode();
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder;
if (convertView == null) {
LayoutInflater li = (LayoutInflater) ctx
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View v = li.inflate(R.layout.file_row, null);
holder = new ViewHolder();
holder.title = (TextView) v.findViewById(R.id.title);
holder.description = (TextView) v.findViewById(R.id.description);
holder.icon = (ImageView) v.findViewById(R.id.icon);
convertView = v;
convertView.setTag(holder);
}
holder = (ViewHolder) convertView.getTag();
File file = fileList[position];
holder.title.setText(file.getName());
holder.description.setText(p.format(new Date(file.lastModified())));
if (file.isDirectory()) {
holder.icon.setImageResource(R.drawable.folder);
holder.title.setTypeface(null, Typeface.BOLD);
} else {
setMimeType(holder.icon, file);
holder.title.setTypeface(null, Typeface.NORMAL);
}
String[] files = file.list();
if (files != null && files.length == 0) {
holder.title.setTextColor(Color.GRAY);
} else {
holder.title.setTextColor(Color.BLACK);
}
return convertView;
}
private String setMimeType(ImageView v, File f) {
MimeTypeMap myMime = MimeTypeMap.getSingleton();
String ext = FilePandaApplication.fileExt(f.getName()).substring(1);
String extMime = myMime.getMimeTypeFromExtension(ext);
String mimeType = null;
if (extMime != null) {
mimeType = extMime;
} else {
mimeType = ext;
}
Log.d(TAG, " * mimetype=" + mimeType);
if (mimeType == null) {
v.setImageResource(R.drawable.unknown);
} else if (mimeType.contains("image")) {
v.setImageResource(R.drawable.picture);
} else if (mimeType.contains("audio") || mimeType.contains("ogg")) {
v.setImageResource(R.drawable.audio);
} else if (mimeType.contains("video")) {
v.setImageResource(R.drawable.video);
} else if (mimeType.contains("pdf") || mimeType.contains("doc")) {
v.setImageResource(R.drawable.doc);
} else if (mimeType.contains("epub") || mimeType.contains("mobi")) {
v.setImageResource(R.drawable.book);
} else if (mimeType.contains("application")) {
v.setImageResource(R.drawable.object);
} else if (mimeType.contains("text")) {
v.setImageResource(R.drawable.file);
} else {
v.setImageResource(R.drawable.unknown);
}
return mimeType;
}
public void sortFilesByDate() {
File[] files = fileList;
Arrays.sort(files, new Comparator<File>() {
public int compare(File f1, File f2) {
return Long.valueOf(f2.lastModified()).compareTo(
f1.lastModified());
}
});
notifyDataSetChanged();
}
public void sortFilesBySize(File[] files) {
Arrays.sort(files, new Comparator<File>() {
public int compare(File f1, File f2) {
return Long.valueOf(f1.length()).compareTo(f2.length());
}
});
notifyDataSetChanged();
}
public void sortFilesByName() {
File[] files = fileList;
Arrays.sort(files, new Comparator<File>() {
@SuppressLint("DefaultLocale")
public int compare(File f1, File f2) {
return f1.getName().toLowerCase().compareTo(f2.getName().toLowerCase());
}
});
notifyDataSetChanged();
}
class ViewHolder {
TextView title;
TextView description;
ImageView icon;
}
}
| [
"[email protected]"
]
| |
23a2f7d59d3ddf30f737e9eeacd4a65190a58030 | bebe2c3fbc455b8acb1c34d0827c18dfcc30b0f2 | /src/com/redmintie/steelplate/input/event/KeyListener.java | ff4e69baf59adc23f5fa7f2c62739ab8eed093ef | [
"Apache-2.0"
]
| permissive | matanui159/Steelplate-Engine | 3b5559b37e03dd835aeb98e43dbb7ada15395528 | 11c1d77c4eaaec4b1f690616a7946a4a022cb962 | refs/heads/master | 2021-01-10T07:15:57.485989 | 2015-12-14T13:57:23 | 2015-12-14T13:57:23 | 45,290,554 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 207 | java | package com.redmintie.steelplate.input.event;
public interface KeyListener {
public void keyPressed(KeyEvent event);
public void keyReleased(KeyEvent event);
public void keyTyped(KeyEvent event);
} | [
"[email protected]"
]
| |
8f802bf0660d52f2dbdbfbef97c53627093a066d | 9e4ed22825bd0e15648b6dc888cba90b9b4066d9 | /src/com/koch/dao/RoleDao.java | 78a54bc5eb57f6736ef166b3c82d9ed6ef0aff14 | []
| no_license | liaoqifeng/szdisplays | 64d7633eab19e5aea01d50bb0fcc448e1fcf44a5 | c774108f954b39ef0222399dfd9c4e50a346944e | refs/heads/master | 2020-03-28T05:26:46.499030 | 2016-11-11T02:26:02 | 2016-11-11T02:26:02 | 73,438,774 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 208 | java | package com.koch.dao;
import java.util.ArrayList;
import java.util.List;
import org.springframework.stereotype.Repository;
import com.koch.entity.Role;
public interface RoleDao extends BaseDao<Role>{
}
| [
"[email protected]"
]
| |
cb6a43e79483e9621bf585286a7b36b614c2fcbc | c903e7051410827bfeb3849fa1253726a5ca6a07 | /myresumemaker/src/android/support/v4/media/TransportController.java | 64befe19e721306c76ab4e69f97651d9bdbcd967 | []
| no_license | anmola10/Android | 8aafc513dc79a443b15dd8baf261d553330a6a25 | 3e39a235191ca07fd080b49d0eef17a9af651936 | refs/heads/master | 2021-01-10T13:54:45.386972 | 2016-02-13T02:32:44 | 2016-02-13T02:32:54 | 51,422,966 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 846 | java | package android.support.v4.media;
public abstract class TransportController
{
public abstract int getBufferPercentage();
public abstract long getCurrentPosition();
public abstract long getDuration();
public abstract int getTransportControlFlags();
public abstract boolean isPlaying();
public abstract void pausePlaying();
public abstract void registerStateListener(TransportStateListener paramTransportStateListener);
public abstract void seekTo(long paramLong);
public abstract void startPlaying();
public abstract void stopPlaying();
public abstract void unregisterStateListener(TransportStateListener paramTransportStateListener);
}
/* Location: C:\Users\T00049862\Downloads\JARS\linker-dex2jar.jar
* Qualified Name: android.support.v4.media.TransportController
* JD-Core Version: 0.6.2
*/ | [
"[email protected]"
]
| |
eb121cf37ba6b580ba8ec630a6a57c58b604be02 | fe0bd7ff423ab6286f99e85f3861364c04b51928 | /backend/src/main/java/com/rodrigorvsn/springDashboard/controllers/SaleController.java | 1c523eb08a145d8194c7786aceb88c8ff6426a1d | []
| no_license | RodrigoRVSN/dashboard-full | 1efb42ff2627dd8d6fd601d685480218457346f6 | f588039ce7515c183e43b676e94bb2263d9b4129 | refs/heads/main | 2023-08-17T12:33:46.075023 | 2021-09-12T17:07:04 | 2021-09-12T17:07:04 | 404,477,965 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,412 | java | package com.rodrigorvsn.springDashboard.controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.rodrigorvsn.springDashboard.dto.SaleDTO;
import com.rodrigorvsn.springDashboard.dto.SaleSuccessDTO;
import com.rodrigorvsn.springDashboard.dto.SaleSumDTO;
import com.rodrigorvsn.springDashboard.service.SaleService;
@RestController
@RequestMapping(value = "/sales")
public class SaleController {
@Autowired
private SaleService service;
@GetMapping
public ResponseEntity<Page<SaleDTO>> findAll(Pageable pageable){
Page<SaleDTO> list = service.findAll(pageable);
return ResponseEntity.ok(list);
}
@GetMapping(value = "/amount-by-seller")
public ResponseEntity<List<SaleSumDTO>> amountGroupedBySeller(){
List<SaleSumDTO> list = service.amountGroupedBySeller();
return ResponseEntity.ok(list);
}
@GetMapping(value = "/success-by-seller")
public ResponseEntity<List<SaleSuccessDTO>> successGroupedBySeller(){
List<SaleSuccessDTO> list = service.successGroupedBySeller();
return ResponseEntity.ok(list);
}
}
| [
"[email protected]"
]
| |
03ac570d110a18b535b6675f250b9bdf5965eae8 | 0002fd6b69fec8d6a055af5f857c4766476b17dd | /src/main/java/de/unistuttgart/iaas/servicewrapper/utils/OpalProperties.java | 774727671951a39bb6d108e1ed45be723fe1b477 | [
"Apache-2.0"
]
| permissive | traDE4chor/trade-opalCLUS-wrapper | 94400bf0e7d90f5d797018e640c1acc39b51b237 | 133d3a029620e5be63b4a91a6ba7bba16d7caec4 | refs/heads/master | 2020-05-02T13:33:33.653996 | 2019-03-28T13:18:02 | 2019-03-28T13:18:02 | 177,987,952 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,999 | java | /* Copyright 2017 Michael Hahn
*
* 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.unistuttgart.iaas.servicewrapper.utils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
/**
* Created by hahnml on 22.12.2017.
*/
public class OpalProperties extends Properties {
private Logger logger = LoggerFactory.getLogger("de.unistuttgart.iaas.servicewrapper.utils.OpalProperties");
private static final String PROPERTY_FILE_LOCATION = "/opalCLUS.properties";
public static final String PROPERTY_TRADE_URL = "trade.url";
public static final String PROPERTY_OPAL_EXEC_PATH = "opal.exec.path";
public static final String PROPERTY_OPAL_DATA_PATH = "opal.data.path";
public static final String ENV_VARIABLE_REGEX = "\\$\\{.+\\}";
public OpalProperties() {
this(null);
}
public OpalProperties(Properties defaults) {
super(defaults);
loadProperties();
}
public String getTraDEUrl() {
return getProperty(PROPERTY_TRADE_URL, "http://localhost:8081/api");
}
public String getOpalExecutablePath() {
return getProperty(PROPERTY_OPAL_EXEC_PATH, "/opalMC/bin");
}
public String getOpalDataPath() {
return getProperty(PROPERTY_OPAL_DATA_PATH, "/opalMC/data");
}
private void loadProperties() {
try {
InputStream in = OpalProperties.class.getResourceAsStream(PROPERTY_FILE_LOCATION);
if (in != null) {
this.load(in);
in.close();
} else {
logger.info("Loading properties from file was not successful. Using default properties instead.");
}
} catch (IOException e) {
logger.info("Loading properties from file was not successful. Using default properties instead.");
}
}
@Override
public String getProperty(String key) {
String result = super.getProperty(key);
// Check if the value references an environment variable and
// resolve it
if (result != null && result.matches(ENV_VARIABLE_REGEX)) {
result = System.getenv(result.substring(2, result.length() - 1));
}
return result;
}
@Override
public String getProperty(String key, String defaultValue) {
String result = getProperty(key);
return (result == null) ? defaultValue : result;
}
}
| [
"[email protected]"
]
| |
4f2993578754a2884a4830eeaafa8f9ce19ee909 | ebca8f6059be58b86387260f3bf9af82ccd65e86 | /src/main/java/com/yc/www/jfinal/config/AppConfig.java | 10d76e04e171b7c95518fef9f9d82d3e73faf549 | []
| no_license | I321065/JFinal | 3a598ec74cbe3d1ca6b7bc65aea3960df311a7ed | bf843285bc7b2e4977f84b9c6db93c0e8c383540 | refs/heads/master | 2021-01-21T00:01:53.926444 | 2017-10-31T15:48:13 | 2017-10-31T15:48:13 | 101,856,801 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,245 | java | package com.yc.www.jfinal.config;
import com.jfinal.config.*;
import com.jfinal.ext.handler.ContextPathHandler;
import com.jfinal.kit.PathKit;
import com.jfinal.kit.Prop;
import com.jfinal.kit.PropKit;
import com.jfinal.plugin.activerecord.ActiveRecordPlugin;
import com.jfinal.plugin.activerecord.dialect.MysqlDialect;
import com.jfinal.plugin.c3p0.C3p0Plugin;
import com.jfinal.template.Engine;
import com.yc.www.jfinal.controller.*;
import com.yc.www.jfinal.service.entity.Article;
import com.yc.www.jfinal.service.entity.Comment;
import com.yc.www.jfinal.service.entity.User;
/**
* Created by Nick on 2017/3/5.
*/
public class AppConfig extends JFinalConfig {
Routes routes;
public void configConstant(Constants constants) {
constants.setDevMode(true);
constants.setEncoding("UTF-8");
}
public void configRoute(Routes routes) {
this.routes = routes;
routes.add("/", IndexController.class, "/");
routes.add("/login", LoginController.class, "/");
routes.add("/article",ArticleController.class, "/");
}
public void configEngine(Engine engine) {
}
public void configPlugin(Plugins plugins) {
//Properties p = loadPropertyFile("jdbc.properties");
Prop property = PropKit.use("jdbc.txt");
C3p0Plugin c3p0Plugin = new C3p0Plugin(property.get("jdbcUrl"), property.get("user"), property.get("password").trim());
plugins.add(c3p0Plugin);
ActiveRecordPlugin arp = new ActiveRecordPlugin(c3p0Plugin);
arp.setBaseSqlTemplatePath(PathKit.getRootClassPath());
//arp.addSqlTemplate("sql_template/user.sql");
arp.setDialect(new MysqlDialect());
//add the mapping between entity and table in sql
arp.addMapping("user", "userId", User.class);
arp.addMapping("article", "articleId", Article.class);
arp.addMapping("comment", "commentId", Comment.class);
plugins.add(arp);
//ShiroPlugin shiroPlugin = new ShiroPlugin(routes);
//plugins.add(shiroPlugin);
}
public void configInterceptor(Interceptors interceptors) {
}
public void configHandler(Handlers handlers) {
handlers.add(new ContextPathHandler("basePath"));
}
}
| [
"[email protected]"
]
| |
9b526511a39482168b78205919a135d725a0dc63 | 7361846e16b9f439f692cd366ed9b8238bd74d34 | /dongdong/chongdianbao/app/src/main/java/com/btkj/chongdianbao/model/User.java | d7860d96cfac40d94f96c5aa9b0f7aefe75334e6 | []
| no_license | wannaRunaway/btwork | 9cfcb336e23c6805ee0efe315a4266b8e8f69744 | e22f47660c1ef5696024419008a9aa1f6333b267 | refs/heads/master | 2023-07-14T08:35:04.472645 | 2021-08-30T12:13:11 | 2021-08-30T12:13:11 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,303 | java | package com.btkj.chongdianbao.model;
import java.io.Serializable;
/**
* created by xuedi on 2019/8/1
*/
public class User implements Serializable {
private static User user;
public static User getInstance(){
if (null == user){
synchronized (User.class){
if (null == user){
user = new User();
}
}
}
return user;
}
/**
* balance : 1110919
* id : 41
* name : 薛地
* noReaded : 4
* phone : 15209603592
* accountNo
*/
private int id, noReaded, reserverId;
private String name, phone, wxappid, accountNo, cityName;
private double balance, mylongtitude, mylatitude;
// private boolean islogin;
private Station station;
private boolean isYuyue, isDelay, isneedlogin,isneedcheckIdcard;
public int getReserverId() {
return reserverId;
}
public void setReserverId(int reserverId) {
this.reserverId = reserverId;
}
public double getMylongtitude() {
return mylongtitude;
}
public void setMylongtitude(double mylongtitude) {
this.mylongtitude = mylongtitude;
}
public double getMylatitude() {
return mylatitude;
}
public void setMylatitude(double mylatitude) {
this.mylatitude = mylatitude;
}
public String getWxappid() {
return wxappid;
}
public void setWxappid(String wxappid) {
this.wxappid = wxappid;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public int getNoReaded() {
return noReaded;
}
public void setNoReaded(int noReaded) {
this.noReaded = noReaded;
}
public String getAccountNo() {
return accountNo;
}
public void setAccountNo(String accountNo) {
this.accountNo = accountNo;
}
public double getBalance() {
return balance;
}
public void setBalance(double balance) {
this.balance = balance;
}
public Station getStation() {
return station;
}
public void setStation(Station station) {
this.station = station;
}
public boolean isYuyue() {
return isYuyue;
}
public void setYuyue(boolean yuyue) {
isYuyue = yuyue;
}
public boolean isDelay() {
return isDelay;
}
public void setDelay(boolean delay) {
isDelay = delay;
}
public String getCityName() {
return cityName;
}
public void setCityName(String cityName) {
this.cityName = cityName;
}
public boolean isIsneedlogin() {
return isneedlogin;
}
public void setIsneedlogin(boolean isneedlogin) {
this.isneedlogin = isneedlogin;
}
public boolean isIsneedcheckIdcard() {
return isneedcheckIdcard;
}
public void setIsneedcheckIdcard(boolean isneedcheckIdcard) {
this.isneedcheckIdcard = isneedcheckIdcard;
}
}
| [
"[email protected]"
]
| |
6d027281dc24e0bdfde15dd4bc360a64ad6b371b | ab5562c710d4723341aa37e55db5e12f160af913 | /src/main/java/com/cvbuilder/entity/DB.java | b658195e3e3b312df4393f6d7825e3b4b03a6afb | []
| no_license | Telougat/CVBuilder | 5638cdba792f8e71960f3e958531b1c88148f0a5 | 4d0a72570afa52aac8101b68ea0159cb49d1c2e5 | refs/heads/master | 2022-12-29T01:47:50.657480 | 2020-10-07T21:36:39 | 2020-10-07T21:36:39 | 300,433,550 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 385 | java | package com.cvbuilder.entity;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
public class DB {
private static final EntityManagerFactory emf = Persistence.createEntityManagerFactory("default");
public static EntityManager getEntityManager() {
return DB.emf.createEntityManager();
}
}
| [
"[email protected]"
]
| |
23ab7f3494cf816a7a9f640c7ae39b81ec8a4d75 | 661745607fbf28e024deaf112608759dc8dd2469 | /360updatelibrary/src/test/java/com/emotte/shb/update/ExampleUnitTest.java | d21c79672b0ad416195c4a7f0469c6c0ae66463d | []
| no_license | ma969070578/Mobile | be602db569a40d64af22acedce443624c31b3f07 | ae5e7eedf4f34a5accd125099ae9f5b0a0b6b6eb | refs/heads/master | 2021-01-22T19:15:36.125710 | 2017-09-21T01:50:31 | 2017-09-21T01:50:31 | 85,185,915 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 314 | java | package com.emotte.shb.update;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"x969070578"
]
| x969070578 |
b3ce0dcee2118a5b81a1f3587a0a0e52b68045e6 | 5a2c482e73675da3f554d0c5b2fb6ee51faeef98 | /src/Types/MenuCommand.java | f2ab0a5c82850e69094b9da338bc836dcced32c3 | []
| no_license | yuriclaure/javapart | e2a12c28cd67263d2e66df01027880bf0628f858 | a83ce13e3877ad7ed10ba6c62ca443b673d00670 | refs/heads/master | 2020-05-26T19:57:07.494245 | 2013-03-10T00:49:01 | 2013-03-10T00:49:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 70 | java | package Types;
public enum MenuCommand {
Add, Remove, Edit, Print
}
| [
"[email protected]"
]
| |
0a5eead29f5b20fea54aeca9e47e0fa244d6e142 | 54e8503812191e2bc9478e422d73d08021b78e83 | /interface/src/main/java/Plane.java | 1d13a7526f91e5bd693ea44c7b404138dd7a5f8b | []
| no_license | meishaaaaa/02-11-2 | 16bd3d4ca3f94cb6a586263c8bab3de65a4cb0e2 | 15f4e923350ab7de31acff45a341355b1a33ff76 | refs/heads/master | 2021-01-02T19:12:19.224343 | 2020-02-11T12:46:19 | 2020-02-11T12:46:19 | 239,759,565 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 298 | java | public class Plane implements Transportation {
@Override
public int getUnitOfPrice() {
return 1000;
}
@Override
public void select(int fee) {
if (getUnitOfPrice() <= fee) {
System.out.println("可以选择飞机前往北京");
}
}
}
| [
"[email protected]"
]
| |
1b9c9befab087e05532926e36fe86f31bce3d43a | 963599f6f1f376ba94cbb504e8b324bcce5de7a3 | /sources/p059rx/internal/operators/OnSubscribeCollect.java | 79d7ba038a21ca7742e4aa7613c243f61b41a628 | []
| no_license | NikiHard/cuddly-pancake | 563718cb73fdc4b7b12c6233d9bf44f381dd6759 | 3a5aa80d25d12da08fd621dc3a15fbd536d0b3d4 | refs/heads/main | 2023-04-09T06:58:04.403056 | 2021-04-20T00:45:08 | 2021-04-20T00:45:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,805 | java | package p059rx.internal.operators;
import p059rx.Observable;
import p059rx.Subscriber;
import p059rx.exceptions.Exceptions;
import p059rx.functions.Action2;
import p059rx.functions.Func0;
/* renamed from: rx.internal.operators.OnSubscribeCollect */
public final class OnSubscribeCollect<T, R> implements Observable.OnSubscribe<R> {
final Func0<R> collectionFactory;
final Action2<R, ? super T> collector;
final Observable<T> source;
public OnSubscribeCollect(Observable<T> observable, Func0<R> func0, Action2<R, ? super T> action2) {
this.source = observable;
this.collectionFactory = func0;
this.collector = action2;
}
public void call(Subscriber<? super R> subscriber) {
try {
new CollectSubscriber(subscriber, this.collectionFactory.call(), this.collector).subscribeTo(this.source);
} catch (Throwable th) {
Exceptions.throwIfFatal(th);
subscriber.onError(th);
}
}
/* renamed from: rx.internal.operators.OnSubscribeCollect$CollectSubscriber */
static final class CollectSubscriber<T, R> extends DeferredScalarSubscriberSafe<T, R> {
final Action2<R, ? super T> collector;
public CollectSubscriber(Subscriber<? super R> subscriber, R r, Action2<R, ? super T> action2) {
super(subscriber);
this.value = r;
this.hasValue = true;
this.collector = action2;
}
public void onNext(T t) {
if (!this.done) {
try {
this.collector.call(this.value, t);
} catch (Throwable th) {
Exceptions.throwIfFatal(th);
unsubscribe();
onError(th);
}
}
}
}
}
| [
"[email protected]"
]
| |
2aac7e3f6b2666664f7176bafb916181163d3257 | 9b6f67eb9fc362cc4f10472151a6612698457a8f | /src/test/java/cn/hkxj/platform/spider/CaptchaBreakerTest.java | 68c3723b99970a49049921f1a7755d5d120b7976 | [
"MIT"
]
| permissive | sophonai/hkxj | f2bf981119ec4104d63eca3186d150a874e14234 | 462102c8d32f0af6d480c8ac5024098ffbd55d98 | refs/heads/master | 2020-07-21T05:15:24.163587 | 2019-09-06T03:31:25 | 2019-09-06T03:31:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,228 | java | package cn.hkxj.platform.spider;
import cn.hkxj.platform.PlatformApplication;
import cn.hkxj.platform.pojo.constant.RedisKeys;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.redis.core.HashOperations;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import javax.annotation.Resource;
import java.util.Set;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import static org.junit.Assert.*;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = PlatformApplication.class)
@WebAppConfiguration
@Slf4j
public class CaptchaBreakerTest {
@Resource
private StringRedisTemplate stringRedisTemplate;
private static LinkedBlockingQueue<Runnable> queue = new LinkedBlockingQueue<>();
private static final ExecutorService pool = new ThreadPoolExecutor(2, 2, 0L, TimeUnit.SECONDS, queue);
@Test
public void getCode() {
AtomicInteger sum = new AtomicInteger();
AtomicInteger success = new AtomicInteger();
AtomicInteger fail = new AtomicInteger();
HashOperations<String, String, String> hash = stringRedisTemplate.opsForHash();
Set<String> keys = hash.keys(RedisKeys.KAPTCHA.getName());
for (String key : keys) {
pool.execute(() -> {
try {
CaptchaBreaker.getCode(key);
log.info("key {} success", key);
success.getAndIncrement();
}catch (Exception e){
log.info("key {} fail", key);
fail.getAndIncrement();
}finally {
sum.getAndIncrement();
log.info("sum {} success {} fail {}", sum.get(), success.get(), fail.get());
}
});
}
while (true){
}
}
} | [
"[email protected]"
]
| |
9ce13cd1b92a76c50026664eec81d5ed052386ef | 1074c97cdd65d38c8c6ec73bfa40fb9303337468 | /rda0105-agl-aus-java-a43926f304e3/xms-persistence/src/main/java/com/gms/xms/persistence/dao/TradeTypeDao.java | 694d9d6772a7b2b637bf17388b4e52c3367f2270 | []
| no_license | gahlawat4u/repoName | 0361859254766c371068e31ff7be94025c3e5ca8 | 523cf7d30018b7783e90db98e386245edad34cae | refs/heads/master | 2020-05-17T01:26:00.968575 | 2019-04-29T06:11:52 | 2019-04-29T06:11:52 | 183,420,568 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 604 | java | package com.gms.xms.persistence.dao;
import com.gms.xms.common.exception.DaoException;
import com.gms.xms.txndb.vo.webship.TradeTypeVo;
import java.util.List;
/**
* Posted from TradeTypeDaoService
* <p>
* Author DatTV Date Mar 27, 2015
*/
public class TradeTypeDao extends BaseDao<TradeTypeVo> {
/**
* Gets list of trade types
*
* @return List<{@link TradeTypeVo}>
* @throws DaoException
*/
public List<TradeTypeVo> getTradeTypeList() throws DaoException {
return selectList(new TradeTypeVo(), "TradeType.getTradeTypeList");
}
} | [
"[email protected]"
]
| |
c18044696c1970af3d62a860e4e112f68ca00317 | 2597df9f5d08c964dd0f69f76695d2f01b01f1c3 | /src/com/example/nav/SubActivity.java | 34ce26f49cf00c0ebb448137ea711e8364f38bfc | []
| no_license | comecourse/Android-lollipop-Simple-web-app | 55ebcf1016191eb917fab21f5ea02eb505091240 | 85a2dc1207d309033097e50e94b08fee2d119fe0 | refs/heads/master | 2021-01-17T19:01:02.105560 | 2016-07-30T05:59:23 | 2016-07-30T05:59:23 | 64,528,413 | 0 | 0 | null | 2016-07-30T05:49:09 | 2016-07-30T05:42:55 | null | UTF-8 | Java | false | false | 1,246 | java | package com.example.nav;
import android.app.Activity;
import android.os.Bundle;
import android.support.v4.app.NavUtils;
import android.support.v7.app.ActionBarActivity;
import android.view.Menu;
import android.view.MenuItem;
public class SubActivity extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sub);
getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.sub, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
if (id == R.id.action_settings) {
return true;
}
if(id==android.R.id.home)
{
NavUtils.navigateUpFromSameTask(this);
}
return super.onOptionsItemSelected(item);
}
}
| [
"[email protected]"
]
| |
e751861fe8fc41691f73032f3a9255d0ec671af1 | c67f401cdd72466cb54284c990aae1df00c7f0ef | /mailsimulationapp1/src/main/java/com/te/mailsimapp/service/UserInfoServiceImpl.java | 3140ad7edf75bf46fb5c27cd77398c383c721953 | []
| no_license | poojapadagatti123/poojapadagatti123-technoelevate_poojapadagatti_JFSA_20Apr_mailsimulationapp | 368031cb568b1b73242075c79a09aa6f95615f8f | 2f3bdeede7e27aecdb22768bf8c40ab18428feb0 | refs/heads/main | 2023-06-08T23:43:39.890969 | 2021-07-03T15:28:43 | 2021-07-03T15:28:43 | 382,648,426 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,029 | java | package com.te.mailsimapp.service;
import java.util.Scanner;
import com.te.mailsimapp.dao.UserDAO;
import com.te.mailsimapp.dao.UserHibernateImpl;
import com.te.mailsimapp.dto.UserData;
public class UserInfoServiceImpl implements UserService{
Scanner sc=new Scanner(System.in);
UserDAO dao=new UserHibernateImpl();
@Override
public UserData createAccount() {
System.out.println("Enter your name");
String name=sc.next();
System.out.println("Enter Email address");
String email=ValidationCode.emailValidation();
System.out.println("Enter your Password");
String password=sc.next();
//ValidationCode.passwordValidation();
return dao.createAccount(name, password, email);
}
@Override
public UserData composed(String from) {
System.out.println();
System.out.print("To:");
String to=sc.next();
System.out.println();
return dao.compose(from,to);
}
@Override
public UserData showBox(String email) {
return dao.showBox(email);
}
}
| [
"[email protected]"
]
| |
88482f4156ffd3a47ba193700c66964ddcc2371e | c8aca4cc3e1d052aa726ea2bf898f82bdc33db97 | /src/main/java/com/third/web/rest/vm/KeyAndPasswordVM.java | d6bf9775383d69f70572a7cb2dcea34e4c4db39a | []
| no_license | PashaEagle/jhipster-third | ca5df92d7bd233bcd63d7ceecfa578915946db97 | ebaa20598198f57ad610fd9ef3993789c69d5479 | refs/heads/master | 2022-07-31T19:02:39.775119 | 2020-03-05T20:09:40 | 2020-03-05T20:09:40 | 245,257,221 | 0 | 0 | null | 2022-07-07T17:12:31 | 2020-03-05T20:06:40 | Java | UTF-8 | Java | false | false | 490 | java | package com.third.web.rest.vm;
/**
* View Model object for storing the user's key and password.
*/
public class KeyAndPasswordVM {
private String key;
private String newPassword;
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getNewPassword() {
return newPassword;
}
public void setNewPassword(String newPassword) {
this.newPassword = newPassword;
}
}
| [
"[email protected]"
]
| |
676607777f672879424d0a8c6ce0de5f0abef610 | 8361f1308da164fb5350f84557de1db1b9f2a50e | /src/main/Java/com/finstone/tmall/service/PropertyValueService.java | b25d33db5df045ecdd02f568a9f3188be6679880 | []
| no_license | uncle90/tmall_ssm | 09daa43051ddd6a66613ba8990dc54df16625ebb | 8a67752da44e81e058aa74e72ca90f78770ab6e0 | refs/heads/master | 2022-12-28T18:26:52.044376 | 2019-10-14T15:04:51 | 2019-10-14T15:04:51 | 173,953,982 | 1 | 0 | null | 2022-12-16T05:00:13 | 2019-03-05T13:42:02 | Java | UTF-8 | Java | false | false | 1,098 | java | package com.finstone.tmall.service;
import com.finstone.tmall.entity.Product;
import com.finstone.tmall.entity.PropertyValue;
import java.util.List;
/**
* 属性值 PropertyValue
*/
public interface PropertyValueService {
/**
* 根据产品所属分类,初始化指定产品的属性(名称)
* 分类:Property.cid
* 属性:Property.name
* 初始化:insert into PropertyValue(ptid, pid, value) value(?, ?, null)
* @param product
*/
void init(Product product);
PropertyValue get(int pid, int ptid);
void delete(int id);
void update(PropertyValue propertyValue);
/**
* 查询指定产品(pid=product.id)的所有属性
* 属性名称: PropertyValue.Property.name
* 属性值 : PropertyValue.value
* @param pid
* @return
*/
List<PropertyValue> list(int pid);
/**
* 查询指定属性名称下的所有属性值(产品不同) for 删除分类下的属性
* @param ptid = Property.id 属性编号
* @return
*/
List<PropertyValue> listByPropertyId(int ptid);
}
| [
"[email protected]"
]
| |
5eec57f574921a43525a9af98523659d74901f3c | ef3c1f79be430d0d015ec49d9a046bcc449fd5c2 | /src/one/nio/cluster/ServiceProvider.java | 2a10f29674b493f6f015bd7eb1e26e857f891e27 | []
| no_license | Teraqz/one-nio | 2a5be1a7090548fc06f80e3f8887bd6264e03161 | 06ce0081c087a4c40a0c36d1bd9975314bee4a8c | refs/heads/master | 2021-01-18T12:45:57.350955 | 2014-06-21T18:39:37 | 2014-06-21T18:39:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 189 | java | package one.nio.cluster;
public interface ServiceProvider {
boolean available();
boolean check() throws Exception;
boolean enable();
boolean disable();
void close();
}
| [
"[email protected]"
]
| |
02eca86533dc79e42e95ccccec31a2b97c5d5146 | 27f5457d47aaf3491f0d64032247adc08efba867 | /vertx-gaia/vertx-ams/src/main/jib/io/horizon/uca/log/LogModule.java | ac4b749bbabc738093e749ca1c21153f13600af8 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer"
]
| permissive | silentbalanceyh/vertx-zero | e73d22f4213263933683e4ebe87982ba68803878 | 1ede4c3596f491d5251eefaaaedc56947ef784cd | refs/heads/master | 2023-06-11T23:10:29.241769 | 2023-06-08T16:15:33 | 2023-06-08T16:15:33 | 108,104,586 | 348 | 71 | Apache-2.0 | 2020-04-10T02:15:18 | 2017-10-24T09:21:56 | HTML | UTF-8 | Java | false | false | 3,513 | java | package io.horizon.uca.log;
import io.horizon.uca.cache.Cc;
import java.util.Objects;
import java.util.function.Function;
/**
* @author lang : 2023/4/25
*/
public class LogModule {
private static final Cc<String, LogModule> CC_LOG_EXTENSION = Cc.openThread();
private final String module;
private String type;
private Function<String, String> colorFn;
LogModule(final String module) {
this.module = module;
}
public static LogModule instance(final String module) {
return CC_LOG_EXTENSION.pick(() -> new LogModule(module), module);
}
public LogModule bind(final Function<String, String> colorFn) {
this.colorFn = colorFn;
return this;
}
/*
* DEFAULT ->
* type -> module / type
*/
public LogModule bind(final String type) {
synchronized (this) {
this.type = type;
}
return this;
}
private String format(final String pattern) {
return " [ " + (Objects.isNull(this.colorFn) ? this.module : this.colorFn.apply(this.module)) + " ] "
+ " ( " + this.type + " ) " + pattern;
}
public void info(final Class<?> clazz, final String pattern, final Object... args) {
Annal.get(clazz).info(this.format(pattern), args);
}
public void info(final Annal logger, final String pattern, final Object... args) {
final Annal annal = Log.logger(logger);
annal.info(this.format(pattern), args);
}
public void info(final boolean condition, final Class<?> clazz, final String pattern, final Object... args) {
Annal.get(clazz).info(condition, this.format(pattern), args);
}
public void info(final boolean condition, final Annal logger, final String pattern, final Object... args) {
final Annal annal = Log.logger(logger);
annal.info(condition, this.format(pattern), args);
}
public void debug(final Class<?> clazz, final String pattern, final Object... args) {
Annal.get(clazz).debug(this.format(pattern), args);
}
public void warn(final Class<?> clazz, final String pattern, final Object... args) {
Annal.get(clazz).warn(this.format(pattern), args);
}
public void error(final Class<?> clazz, final String pattern, final Object... args) {
Annal.get(clazz).error(this.format(pattern), args);
}
public void debug(final Annal logger, final String pattern, final Object... args) {
final Annal annal = Log.logger(logger);
annal.debug(this.format(pattern), args);
}
public void warn(final Annal logger, final String pattern, final Object... args) {
final Annal annal = Log.logger(logger);
annal.warn(this.format(pattern), args);
}
public void error(final Annal logger, final String pattern, final Object... args) {
final Annal annal = Log.logger(logger);
annal.error(this.format(pattern), args);
}
public void fatal(final Class<?> clazz, final Throwable ex) {
Annal.get(clazz).fatal(ex);
}
public void fatal(final Annal logger, final Throwable ex) {
final Annal annal = Log.logger(logger);
annal.fatal(ex);
}
public void fatal(final Annal logger, final Throwable ex, final String prefix) {
final Annal annal = Log.logger(logger);
annal.fatal(ex, prefix);
}
public void fatal(final Class<?> clazz, final Throwable ex, final String prefix) {
Annal.get(clazz).fatal(ex, prefix);
}
}
| [
"[email protected]"
]
| |
311f5985ed4f115351584fa8605c644474f7a191 | c885ef92397be9d54b87741f01557f61d3f794f3 | /results/Cli-38/org.apache.commons.cli.DefaultParser/BBC-F0-opt-10/tests/29/org/apache/commons/cli/DefaultParser_ESTest_scaffolding.java | a1c6775865a5e346f46333cc2b9c47cc7054b171 | [
"CC-BY-4.0",
"MIT"
]
| permissive | pderakhshanfar/EMSE-BBC-experiment | f60ac5f7664dd9a85f755a00a57ec12c7551e8c6 | fea1a92c2e7ba7080b8529e2052259c9b697bbda | refs/heads/main | 2022-11-25T00:39:58.983828 | 2022-04-12T16:04:26 | 2022-04-12T16:04:26 | 309,335,889 | 0 | 1 | null | 2021-11-05T11:18:43 | 2020-11-02T10:30:38 | null | UTF-8 | Java | false | false | 4,497 | java | /**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Sat Oct 23 03:16:48 GMT 2021
*/
package org.apache.commons.cli;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
import org.evosuite.runtime.sandbox.Sandbox;
import org.evosuite.runtime.sandbox.Sandbox.SandboxMode;
@EvoSuiteClassExclude
public class DefaultParser_ESTest_scaffolding {
@org.junit.Rule
public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule();
private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000);
@BeforeClass
public static void initEvoSuiteFramework() {
org.evosuite.runtime.RuntimeSettings.className = "org.apache.commons.cli.DefaultParser";
org.evosuite.runtime.GuiSupport.initialize();
org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100;
org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000;
org.evosuite.runtime.RuntimeSettings.mockSystemIn = true;
org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED;
org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT();
org.evosuite.runtime.classhandling.JDKClassResetter.init();
setSystemProperties();
initializeClasses();
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
}
@Before
public void initTestCase(){
threadStopper.storeCurrentThreads();
threadStopper.startRecordingTime();
org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler();
org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode();
org.evosuite.runtime.GuiSupport.setHeadless();
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
org.evosuite.runtime.agent.InstrumentingAgent.activate();
}
@After
public void doneWithTestCase(){
threadStopper.killAndJoinClientThreads();
org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks();
org.evosuite.runtime.classhandling.JDKClassResetter.reset();
resetClasses();
org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode();
org.evosuite.runtime.agent.InstrumentingAgent.deactivate();
org.evosuite.runtime.GuiSupport.restoreHeadlessMode();
}
public static void setSystemProperties() {
/*No java.lang.System property to set*/
}
private static void initializeClasses() {
org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(DefaultParser_ESTest_scaffolding.class.getClassLoader() ,
"org.apache.commons.cli.UnrecognizedOptionException",
"org.apache.commons.cli.CommandLineParser",
"org.apache.commons.cli.Options",
"org.apache.commons.cli.Option$Builder",
"org.apache.commons.cli.MissingOptionException",
"org.apache.commons.cli.DefaultParser",
"org.apache.commons.cli.AmbiguousOptionException",
"org.apache.commons.cli.Option$1",
"org.apache.commons.cli.AlreadySelectedException",
"org.apache.commons.cli.ParseException",
"org.apache.commons.cli.OptionValidator",
"org.apache.commons.cli.OptionGroup",
"org.apache.commons.cli.CommandLine",
"org.apache.commons.cli.Option",
"org.apache.commons.cli.MissingArgumentException",
"org.apache.commons.cli.Util"
);
}
private static void resetClasses() {
org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(DefaultParser_ESTest_scaffolding.class.getClassLoader());
org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(
"org.apache.commons.cli.DefaultParser",
"org.apache.commons.cli.OptionGroup",
"org.apache.commons.cli.Options",
"org.apache.commons.cli.Option",
"org.apache.commons.cli.OptionValidator",
"org.apache.commons.cli.CommandLine",
"org.apache.commons.cli.Util",
"org.apache.commons.cli.ParseException",
"org.apache.commons.cli.UnrecognizedOptionException",
"org.apache.commons.cli.MissingOptionException",
"org.apache.commons.cli.Option$Builder",
"org.apache.commons.cli.MissingArgumentException",
"org.apache.commons.cli.AmbiguousOptionException"
);
}
}
| [
"[email protected]"
]
| |
e14740c502a45813868f67185cf4010f651aceb3 | 2a94292e78f52a0b5965139f11114343d3690fe7 | /src/CallByReference/Operation2.java | 48b5750b732bcea7ca9c2f3fcb6a5232bd5563b3 | []
| no_license | Solomon3038/Hello_World | 58094f8ebf8e268325a5a6f9c89e052cbb9960b8 | 567c57a135e4b9425742b14ef4dddd3a446fea5c | refs/heads/master | 2020-03-27T07:12:26.674214 | 2018-08-26T10:33:58 | 2018-08-26T10:33:58 | 146,171,202 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 467 | java | package CallByReference;
public class Operation2 {
int data=50;
void change(Operation2 op){
op.data=op.data+100;//changes will be in the instance variable
}
public static void main(String args[]){
Operation2 op=new Operation2();
System.out.println("before change "+op.data);
op.change(op);//passing object
System.out.println("after change "+op.data);
}
}
| [
"[email protected]"
]
| |
72099a6ee8cb45dcff6b8be6fc07eba04f8fa107 | e71af1c4f7d4b61babdc954dc9d43bd25fe436b9 | /java/com/helloants/mm/helloants1/data/zoomCheck/CustomViewPager.java | 4550219129c86cbc825327323d7cd6ec4ffeec53 | []
| no_license | jinhee0833/know | 41c4122df4272e580a249bf86b4f1653da3546f7 | d0c2060b7c4bf35d6a9cdf30a1ce4d038ceae8ba | refs/heads/master | 2021-01-17T17:14:49.374700 | 2016-06-03T07:21:58 | 2016-06-03T07:21:58 | 60,327,126 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 970 | java | package com.helloants.mm.helloants1.data.zoomCheck;
import android.content.Context;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.view.MotionEvent;
/**
* Created by JJ on 2016. 5. 16..
*/
public class CustomViewPager extends ViewPager {
public CustomViewPager(Context context) {
super(context);
}
public CustomViewPager(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
public boolean onTouchEvent(MotionEvent ev) {
try {
return super.onTouchEvent(ev);
} catch (IllegalArgumentException ex) {
ex.printStackTrace();
}
return false;
}
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
try {
return super.onInterceptTouchEvent(ev);
} catch (IllegalArgumentException ex) {
ex.printStackTrace();
}
return false;
}
} | [
"[email protected]"
]
| |
e0553341eeb03255b81259310aea3c940c1864e5 | 4179ceffc666badb0a13a6f97a2f1e38eee9b361 | /accumulators-core/src/test/java/org/chrisgray/accumulators/core/stddev/tests/StdDevAccumulatorTest.java | c299d3a8b01b5601baefd89b669075a85e36b8f3 | []
| no_license | chrisgray/accumulators | 590d9bed857c860c2d8328d59a6ff0d5b89e3830 | f9faf177411c749ad9ae2e01e744fabf4a6e47af | refs/heads/master | 2020-06-04T11:19:02.183435 | 2012-12-14T01:31:53 | 2012-12-14T01:31:53 | 6,801,782 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,194 | java | package org.chrisgray.accumulators.core.stddev.tests;
import org.chrisgray.accumulators.core.DoubleAccumulator;
import org.chrisgray.accumulators.core.stddev.StdDevAccumulator;
import org.junit.Before;
import org.junit.Test;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
public class StdDevAccumulatorTest {
protected DoubleAccumulator accumulator;
@Before
public void setup() {
accumulator = new StdDevAccumulator();
}
@Test(expected = IllegalStateException.class)
public void none() {
accumulator.result();
}
@Test
public void one() {
accumulator.accumulate(1.1);
assertThat(accumulator.result(), is(0.0));
}
@Test
public void simple() {
accumulator.accumulate(1.0);
accumulator.accumulate(0.5);
assertThat(accumulator.result(), is(0.25));
}
@Test
public void complex() {
accumulator.accumulate(600);
accumulator.accumulate(470);
accumulator.accumulate(170);
accumulator.accumulate(430);
accumulator.accumulate(300);
assertThat(accumulator.result(), is(147.32277488562318));
}
}
| [
"[email protected]"
]
| |
c09c4a28d48f0421697f127508af69a21947e128 | 8c3d6c361364ba5d27b4e7918ce3bf29cd538957 | /src/main/java/com/demo/hospital/managment/patientdetails/controller/PatientDetailsController.java | 85e885462fed2833b757f34e0b653b362fcfeeb4 | []
| no_license | sagarblock72/patient-Detail | 5b6ac6a451923092aaa96ff7d339841e64c85fc1 | 379ba7e2afdd08658cbd8d5c05b2b4bf43561b3a | refs/heads/master | 2023-06-25T08:07:09.524116 | 2021-08-04T06:28:16 | 2021-08-04T06:28:16 | 391,302,011 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,083 | java | package com.demo.hospital.managment.patientdetails.controller;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.demo.hospital.managment.patientdetails.model.AllergyMaster;
import com.demo.hospital.managment.patientdetails.model.PatientDetails;
import com.demo.hospital.managment.patientdetails.repository.AllergyMasterRepository;
import com.demo.hospital.managment.patientdetails.repository.AllergyRepository;
import com.demo.hospital.managment.patientdetails.service.IPatientDetailsService;
import com.demo.hospital.managment.patientdetails.util.MessageResponseDto;
import com.demo.hospital.managment.patientdetails.util.PatientDetailsUtil;
import com.demo.hospital.managment.patientdetails.util.StatusMessage;
@RestController
@RequestMapping("/patient")
@CrossOrigin(value = "http://localhost:4200")
public class PatientDetailsController {
private Logger log = LoggerFactory.getLogger(PatientDetailsController.class);
@Autowired
private AllergyRepository allergyRepository;
@Autowired
private IPatientDetailsService patientDetailsService;
@Autowired
private AllergyMasterRepository allergyMaster;
// save the data into database
@PostMapping("/save")
public ResponseEntity<MessageResponseDto> savePatientDetails(@RequestBody PatientDetails patientDetails) {
ResponseEntity<MessageResponseDto> resp = null;
log.info("save patient details");
try {
Long id = patientDetailsService.addPatientDetails(patientDetails);
log.info("sending the response");
resp = new ResponseEntity<>(new MessageResponseDto(StatusMessage.USER_DETAILS_SAVED.getMessage()),
HttpStatus.OK);
} catch (Exception e) {
log.error("save api catch block");
resp = new ResponseEntity<>(new MessageResponseDto(StatusMessage.SERVER_ERROR.getMessage()),
HttpStatus.INTERNAL_SERVER_ERROR);
e.printStackTrace();
}
return resp;
}
// @PutMapping("/save")
// public ResponseEntity<MessageResponseDto> updatePatientDetails(@RequestBody PatientDetails patientDetails) {
// ResponseEntity<MessageResponseDto> resp = null;
// log.info("save patient details");
// try {
//
// Long id = patientDetailsService.addPatientDetails(patientDetails);
// log.info("sending the response");
// resp = new ResponseEntity<>(new MessageResponseDto(StatusMessage.USER_DETAILS_UPDATE.getMessage()),
// HttpStatus.OK);
// } catch (Exception e) {
// log.error("save api catch block");
//
// resp = new ResponseEntity<>(new MessageResponseDto(StatusMessage.SERVER_ERROR.getMessage()),
// HttpStatus.INTERNAL_SERVER_ERROR);
// e.printStackTrace();
// }
// return resp;
// }
@PutMapping("/modify/{id}")
public ResponseEntity<MessageResponseDto> updatePatientDetails(@PathVariable Long id,
@RequestBody PatientDetails patientDetail) {
ResponseEntity<MessageResponseDto> resp = null;
try {
log.info("Controller try {} Updating Patinet Details");
PatientDetails dbPatientDetails = patientDetailsService.getUserById(id);
PatientDetailsUtil.copyNonNullValues(dbPatientDetails, patientDetail);
patientDetailsService.updatePatientDetail(dbPatientDetails);
log.info("Controller try {} Updating Patinet Details Sending Response");
return resp = new ResponseEntity<>(new MessageResponseDto(StatusMessage.USER_DETAILS_UPDATED.getMessage()),
HttpStatus.OK);
} catch (Exception e) {
log.info("Exception Occured" + e.getMessage());
return resp = new ResponseEntity<>(new MessageResponseDto(StatusMessage.SERVER_ERROR.getMessage()),HttpStatus.INTERNAL_SERVER_ERROR);
}
}
@GetMapping("/getAll")
public List<PatientDetails> getAllPatientDetails() {
return patientDetailsService.getAllUser();
}
// get patient by id
@GetMapping("/getById/{id}")
public PatientDetails getPatientDetailsById(@PathVariable("id") Long id) {
return patientDetailsService.getUserById(id);
}
@GetMapping("/allAllergy")
public List<AllergyMaster> getAllAllergy() {
return allergyMaster.findAll();
}
@GetMapping("/getAllergyByCode/{allergyCode}")
public List<AllergyMaster> getAllergyByCode(@PathVariable String allergyCode) {
System.out.println(allergyCode);
return allergyMaster.findByAllergyCode(allergyCode);
}
@GetMapping("/getByUserId/{id}")
public PatientDetails getUserDetailsById(@PathVariable("id") Long id) {
return patientDetailsService.getByUserId(id);
}
}
| [
"[email protected]"
]
| |
a257f2ef3c5f2ac2ffa830c0e56a438de6fd7570 | 24636c3be1652b29c3ea405973ba0a3e34ebe502 | /org.eclipse.microservices/src/micro/MicroFactory.java | a473d960f55f30a4c85b8afb876b4abf64a92fe1 | []
| no_license | yaseenkhantanoli/MDE-Sirius_project | f43951450434ca663ac511e88ca53e7858212add | 42b58aa3778a39994b56f5507b82eb86528b8280 | refs/heads/master | 2020-03-24T04:51:08.735233 | 2018-07-26T16:41:39 | 2018-07-26T16:41:39 | 142,466,833 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,542 | java | /**
*/
package micro;
import org.eclipse.emf.ecore.EFactory;
/**
* <!-- begin-user-doc -->
* The <b>Factory</b> for the model.
* It provides a create method for each non-abstract class of the model.
* <!-- end-user-doc -->
* @see micro.MicroPackage
* @generated
*/
public interface MicroFactory extends EFactory {
/**
* The singleton instance of the factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
MicroFactory eINSTANCE = micro.impl.MicroFactoryImpl.init();
/**
* Returns a new object of class '<em>Microservice Architecture</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return a new object of class '<em>Microservice Architecture</em>'.
* @generated
*/
MicroserviceArchitecture createMicroserviceArchitecture();
/**
* Returns a new object of class '<em>Model</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return a new object of class '<em>Model</em>'.
* @generated
*/
Model createModel();
/**
* Returns a new object of class '<em>Model Event</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return a new object of class '<em>Model Event</em>'.
* @generated
*/
ModelEvent createModelEvent();
/**
* Returns a new object of class '<em>Aggregate Service</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return a new object of class '<em>Aggregate Service</em>'.
* @generated
*/
AggregateService createAggregateService();
/**
* Returns a new object of class '<em>View Service</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return a new object of class '<em>View Service</em>'.
* @generated
*/
ViewService createViewService();
/**
* Returns a new object of class '<em>Operation</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return a new object of class '<em>Operation</em>'.
* @generated
*/
Operation createOperation();
/**
* Returns a new object of class '<em>Named Element</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return a new object of class '<em>Named Element</em>'.
* @generated
*/
NamedElement createNamedElement();
/**
* Returns a new object of class '<em>API</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return a new object of class '<em>API</em>'.
* @generated
*/
API createAPI();
/**
* Returns a new object of class '<em>Command</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return a new object of class '<em>Command</em>'.
* @generated
*/
Command createCommand();
/**
* Returns a new object of class '<em>Event</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return a new object of class '<em>Event</em>'.
* @generated
*/
Event createEvent();
/**
* Returns a new object of class '<em>Info</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return a new object of class '<em>Info</em>'.
* @generated
*/
Info createInfo();
/**
* Returns a new object of class '<em>Step</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return a new object of class '<em>Step</em>'.
* @generated
*/
Step createStep();
/**
* Returns a new object of class '<em>Saga</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return a new object of class '<em>Saga</em>'.
* @generated
*/
Saga createSaga();
/**
* Returns a new object of class '<em>Data</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return a new object of class '<em>Data</em>'.
* @generated
*/
Data createData();
/**
* Returns a new object of class '<em>Reference Attribute</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return a new object of class '<em>Reference Attribute</em>'.
* @generated
*/
ReferenceAttribute createReferenceAttribute();
/**
* Returns a new object of class '<em>Primitive Type Attribute</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return a new object of class '<em>Primitive Type Attribute</em>'.
* @generated
*/
PrimitiveTypeAttribute createPrimitiveTypeAttribute();
/**
* Returns the package supported by this factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the package supported by this factory.
* @generated
*/
MicroPackage getMicroPackage();
} //MicroFactory
| [
"[email protected]"
]
| |
54db79dc5b26f48ad2835999a599b0b71aac14a3 | 71bb06968377b1f3c65aceccd7a434a4b0575244 | /IoC_Example/src/com/training/beans/Medicine.java | c169e75a8d6f65a921d8e532a646000c4777560c | []
| no_license | tawade-harshad/MyInteliJProjects | 92c93bc79450cad3e0f9e53b78a862c698f23446 | 01fd6cc8fd94ec70a1a076d8ed6f02a14b0d2713 | refs/heads/master | 2023-01-29T01:12:24.467865 | 2019-12-15T14:28:27 | 2019-12-15T14:28:27 | 226,092,883 | 0 | 1 | null | 2023-01-11T04:07:33 | 2019-12-05T12:03:39 | Java | UTF-8 | Java | false | false | 316 | java | package com.training.beans;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Medicine {
private long code;
private String medicineName;
private double ratePerUnit;
private Distributor distributor;
}
| [
"[email protected]"
]
| |
2b03a93900dae1bf874b381123014aab92bcf5aa | 64cb88fbf5288f7d6ce055e1c6375c53ad990f3d | /src/main/java/ioedata/actuator/repository/ActuatorRepository.java | 0c6461fd0ee0e89917561b37e7d19cc4287eadae | []
| no_license | potatolylc/SmartHomeRapidPrototype | cc86f0bdb31265bd08ad7cdab7594d56efcb5ece | 5c11bf0d58b914b38c558e00350f554cb36045d8 | refs/heads/master | 2016-09-06T00:04:31.669932 | 2015-05-29T07:59:23 | 2015-05-29T07:59:23 | 33,343,631 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,222 | java | package ioedata.actuator.repository;
import java.io.Serializable;
import java.util.List;
import org.bson.types.ObjectId;
import ioedata.actuator.model.ActuatorValue;
import ioedata.mongodb.repository.BaseRepository;
/**
* This interface provides abstract methods specifically for actuator to access MongoDB.
* It will be implemented by ActuatorRepositoryImpl class.
* @author ajou
*
* @param <T>
* @param <ID>
*/
public interface ActuatorRepository<T, ID extends Serializable> extends BaseRepository<T, ID> {
/**
* Get actuator information by actuator name and device serial number.
* @param actuatorName
* @param deviceSerialNum
* @return
*/
public ActuatorValue findByActuatorNameAndDeviceSerialNum(String actuatorName, ObjectId deviceSerialNum);
/**
* Get list of all actuators by device serial number.
* @param deviceSerialNum
* @return
*/
public List<ActuatorValue> findByDeviceSerialNum(ObjectId deviceSerialNum);
/**
* Overloading isObjectExist method to check whether actuator exists by device serial number and actuator name.
* @param deviceSerialNum
* @param actuatorName
* @return
*/
public boolean isObjectExist(ObjectId deviceSerialNum, String actuatorName);
}
| [
"[email protected]"
]
| |
54a999b97ba2c541adc9577dfa5a4de3d765a4a7 | 5464087e4fbedad13e20f86e7107ba8a19944784 | /src/main/java/com/umtest/testframe/capability/CapabilityMatcher.java | 5a3e503c1ca346b15bc2deb946af8fa31ece9f13 | []
| no_license | jayapaul47/Corebas | 9c786ed2d6ded1b5efecef8c2fc2e12d59b3a31f | bfb2fd6b5ae67eccdbfb32459833865894135791 | refs/heads/master | 2023-04-06T22:27:19.881313 | 2020-10-14T05:36:59 | 2020-10-14T05:36:59 | 312,026,240 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 879 | java | package com.umtest.testframe.capability;
import org.openqa.grid.internal.utils.DefaultCapabilityMatcher;
import java.util.Map;
public class CapabilityMatcher extends DefaultCapabilityMatcher {
private final String deviceName = "deviceName";
@Override
public boolean matches(Map nodeCapability, Map requestedCapability) {
boolean basicChecks = super.matches(nodeCapability, requestedCapability);
if (! requestedCapability.containsKey(deviceName)){
//If the user didnt set the custom capability lets just return what the DefaultCapabilityMatcher
//would return. That way we are backward compatibility and arent breaking the default behavior of the
//grid
return basicChecks;
}
return (basicChecks && nodeCapability.get(deviceName).equals(requestedCapability.get(deviceName)));
}
}
| [
"[email protected]"
]
| |
d928ff25877ea8b522d50ad5871e7ead6c098afe | fa3af5d27c425e24f94a1740b1eef99a4b381c61 | /src/main/java/pl/coderslab/snakesprogram/controller/TestController.java | 87063e859243141d9995b34a5bc54ba61ed89b30 | []
| no_license | barik90/Program-for-snakes-breeder | 05a107c36f6f8374d3f4bb3a75e2b6f9792b37a4 | 7b4d80db4d070028754c28642060a7e42c7ee022 | refs/heads/master | 2020-03-20T06:21:26.048542 | 2018-06-13T17:27:34 | 2018-06-13T17:27:34 | 137,245,061 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 678 | java | package pl.coderslab.snakesprogram.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import pl.coderslab.snakesprogram.repository.FeedingRepository;
@Controller
public class TestController {
@Autowired
FeedingRepository feedingRepository;
@GetMapping("/test")
public String test() {
return "index";
}
@GetMapping("/table")
public String table(Model model) {
model.addAttribute("feedings", feedingRepository.findAll());
return "feedingList";
}
}
| [
"[email protected]"
]
| |
e21480bcab0e4320e5dba1739555402d98eac639 | f8bc4ef3aaad43163b6c2b6fc383b212a98b6437 | /JavaExercise2/src/day2/Exersice5.java | feaf3d7c61c15d84781ca8a78f9284b80f90e8e7 | []
| no_license | zaydtadesse/JavaExerciseAprill2021 | 90022aa071c50eb87cae5f1d4cbb6c9a59d845ab | 5bef06189e141d395f281213253365c413c55daf | refs/heads/main | 2023-05-15T16:58:27.350275 | 2021-06-13T22:53:57 | 2021-06-13T22:53:57 | 360,683,908 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 486 | java | package day2;
import java.util.Scanner;
public class Exersice5 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.println("Please enter first number: ");
int num1 = input.nextInt();
System.out.println("Please enter first number: ");
int num2 = input.nextInt();
int sum = num1 + num2;
int differnce = num1 - num2;
System.out.println("Sum: " + sum);
System.out.println("Difference: " + differnce);
}
}
| [
"[email protected]"
]
| |
31e1eaa6742a012372b492c37b5996a0b427b8b5 | b57dfda46fc9fd818f4e820147e9933c97f0a77c | /src/main/java/com/teklifver/repository/CityRepository.java | 0deeb270c3f89bac123db75a3368ec72932df26a | []
| no_license | samikemal/GraduationProject | 123fb80c1c0d3bd52a304cba7d078e9bc5b940d0 | c2debad24b7e8a726d4a0071372a1527f808589a | refs/heads/master | 2022-12-07T13:29:12.787622 | 2020-08-25T21:10:26 | 2020-08-25T21:10:26 | 290,321,910 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 337 | java | package com.teklifver.repository;
import com.teklifver.entity.CityEntity;
import org.springframework.data.repository.CrudRepository;
/**
* Created by hasan on 24.04.2018.
*/
public interface CityRepository extends CrudRepository<CityEntity,Long> {
CityEntity findById(long id);
CityEntity findByCityName(String cityName);
}
| [
"[email protected]"
]
| |
4b60424b103969b8428fb447672ae2b2e40cf7d2 | 74b47b895b2f739612371f871c7f940502e7165b | /aws-java-sdk-glue/src/main/java/com/amazonaws/services/glue/model/transform/LineageConfigurationMarshaller.java | b2697041680e12b93ef05a67e382608adee2d5f6 | [
"Apache-2.0"
]
| permissive | baganda07/aws-sdk-java | fe1958ed679cd95b4c48f971393bf03eb5512799 | f19bdb30177106b5d6394223a40a382b87adf742 | refs/heads/master | 2022-11-09T21:55:43.857201 | 2022-10-24T21:08:19 | 2022-10-24T21:08:19 | 221,028,223 | 0 | 0 | Apache-2.0 | 2019-11-11T16:57:12 | 2019-11-11T16:57:11 | null | UTF-8 | Java | false | false | 2,047 | java | /*
* Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.glue.model.transform;
import javax.annotation.Generated;
import com.amazonaws.SdkClientException;
import com.amazonaws.services.glue.model.*;
import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;
/**
* LineageConfigurationMarshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class LineageConfigurationMarshaller {
private static final MarshallingInfo<String> CRAWLERLINEAGESETTINGS_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("CrawlerLineageSettings").build();
private static final LineageConfigurationMarshaller instance = new LineageConfigurationMarshaller();
public static LineageConfigurationMarshaller getInstance() {
return instance;
}
/**
* Marshall the given parameter object.
*/
public void marshall(LineageConfiguration lineageConfiguration, ProtocolMarshaller protocolMarshaller) {
if (lineageConfiguration == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(lineageConfiguration.getCrawlerLineageSettings(), CRAWLERLINEAGESETTINGS_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
}
}
| [
""
]
| |
0de036e151a7faad8c3209ee89d23b4ecc71787b | b133c99928033bbf49b0aca58b1618e8b09f7e43 | /rest-es-provider/src/main/java/my/dubbo/provider/service/impl/EsProductServiceImpl.java | c773b3022985385df1e4fb143b3fbaca449743e8 | []
| no_license | lzy9456/dubbo-es-parent | ac255f11a0e9f3d0c5186d003a9a3ba1d2bb7367 | f8ac2e6dfc9a62c795487cc91574103e7d02f101 | refs/heads/master | 2023-01-21T08:48:49.662666 | 2020-11-26T12:14:13 | 2020-11-26T12:14:13 | 316,208,617 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,547 | java | package my.dubbo.provider.service.impl;
import com.google.common.collect.Iterables;
import my.dubbo.provider.dao.EsProductRepository;
import my.dubbo.provider.entity.EsProduct;
import my.dubbo.provider.service.IEsProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.elasticsearch.core.ElasticsearchOperations;
import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.Iterator;
import java.util.List;
/**
* @author _lizy
* @version 1.0
* @description TODO
* @date 2020/11/18 23:10
*/
@Service("esProductService")
public class EsProductServiceImpl implements IEsProductService {
@Autowired
private ElasticsearchOperations elasticsearchTemplate;
private Pageable pageable = PageRequest.of(0,10);
@Autowired
private EsProductRepository esProductRepository;
@Override
public Boolean createIndex() {
return elasticsearchTemplate.createIndex(EsProduct.class);
}
@Override
public Boolean deleteIndex(String index) {
return elasticsearchTemplate.deleteIndex(index);
}
@Override
public Boolean save(EsProduct docBean) {
return esProductRepository.save(docBean)==null ? false : true;
}
@Override
public Boolean saveAll(List<EsProduct> list) {
return Iterables.isEmpty(esProductRepository.saveAll(list)) ? true : false;
}
@Override
public EsProduct findById(Long id) {
return esProductRepository.findById(id).orElse(null);
}
@Override
public Iterator<EsProduct> findAll() {
return esProductRepository.findAll().iterator();
}
// @Override
// public Page<EsProduct> findByContent(String content) {
// return esProductRepository.findByContent(content,pageable);
// }
//
// @Override
// public Page<EsProduct> findByFirstCode(String firstCode) {
// return esProductRepository.findByFirstCode(firstCode,pageable);
// }
//
// @Override
// public Page<EsProduct> findBySecordCode(String secordCode) {
// return esProductRepository.findBySecordCode(secordCode,pageable);
// }
//
// @Override
// public Page<EsProduct> query(String key) {
// return esProductRepository.findByContent(key,pageable);
// }
}
| [
"[email protected]"
]
| |
ad60a98a1b28433292f6e70a20a7d6f64043f827 | de7e61a4298f9f3c5dfab328b0121143b3448c48 | /longjian-measure-domain/src/main/java/com/longfor/longjian/measure/vo/StoreUrlVo.java | 03f85b99a1066e053b8b8ee29f07019bd886ce96 | []
| no_license | zhourihu5/longjian-measure-server | f8b2ed983849e3c0809bfc5b744e821efd997c56 | 94ea0850cf14cabed71734a176b2e50c915f8d31 | refs/heads/master | 2023-07-31T06:07:15.111078 | 2019-03-29T07:30:08 | 2019-03-29T07:30:08 | 409,152,852 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 234 | java | package com.longfor.longjian.measure.vo;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* Jiazm 2019/01/10 13:59
*/
@Data
@NoArgsConstructor
public class StoreUrlVo {
private String schema;
private String uri;
}
| [
"a-jiazhongmin"
]
| a-jiazhongmin |
d872be0894703c27f0c43febb8dadd5ab11ef874 | 52b8d715da6c58e225a0731a2112fa63374eff7c | /StateMachineEditRules/src-gen/stateMachineEditRules/StateMachineEditRulesFactory.java | f4e69542077e7beca72d07a9f0d8a688bee17d39 | []
| no_license | gelareh1985/MDE-Excercises | 7b9fd2427ae69d1491c0989a640e7fed621dc02d | 22f2bc5504aa970413545f83807c7ca0ece7150a | refs/heads/master | 2020-04-05T08:20:33.053906 | 2019-08-29T10:30:34 | 2019-08-29T10:30:34 | 156,711,050 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,531 | java | /**
*/
package stateMachineEditRules;
import org.eclipse.emf.ecore.EFactory;
/**
* <!-- begin-user-doc -->
* The <b>Factory</b> for the model.
* It provides a create method for each non-abstract class of the model.
* <!-- end-user-doc -->
* @see stateMachineEditRules.StateMachineEditRulesPackage
* @generated
*/
public interface StateMachineEditRulesFactory extends EFactory {
/**
* The singleton instance of the factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
StateMachineEditRulesFactory eINSTANCE = stateMachineEditRules.impl.StateMachineEditRulesFactoryImpl.init();
/**
* Returns a new object of class '<em>Transition</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return a new object of class '<em>Transition</em>'.
* @generated
*/
Transition createTransition();
/**
* Returns a new object of class '<em>State</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return a new object of class '<em>State</em>'.
* @generated
*/
State createState();
/**
* Returns a new object of class '<em>DFA</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return a new object of class '<em>DFA</em>'.
* @generated
*/
DFA createDFA();
/**
* Returns the package supported by this factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the package supported by this factory.
* @generated
*/
StateMachineEditRulesPackage getStateMachineEditRulesPackage();
} //StateMachineEditRulesFactory
| [
"[email protected]"
]
| |
5c498194dbb4ed8b8ce227af4f240a6a7c0af8cb | b4cb1360365f87466e6dfac915198a0e2810e0a3 | /common/src/androidTest/java/com/muziko/common/ExampleInstrumentedTest.java | f0831d90b15fb8c4855af687ea382cc95c71b245 | []
| no_license | Solunadigital/Muziko | 9b7d38d441c5e41fdea17d07c3d0ab00e15c7c5a | 8fb874c4e765949c32591b826baee1937e8d49ca | refs/heads/master | 2021-09-09T01:55:13.063925 | 2018-03-13T08:13:20 | 2018-03-13T08:13:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 754 | java | package com.muziko.common;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.assertEquals;
/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.muziko.common.test", appContext.getPackageName());
}
}
| [
"[email protected]"
]
| |
0bd9ac3e7499c3a571e2df524d985f7273991bcf | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/3/3_ac7cc5dc8f056412c39f1dda6b83a47241e8cacf/ZoneView/3_ac7cc5dc8f056412c39f1dda6b83a47241e8cacf_ZoneView_t.java | 2697ee180d19b88a53add33d30ea9da2685af33b | []
| 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 | 12,162 | java | package net.rptools.maptool.client.ui.zone;
import java.awt.Point;
import java.awt.geom.AffineTransform;
import java.awt.geom.Area;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Rectangle2D;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import net.rptools.maptool.client.AppUtil;
import net.rptools.maptool.client.MapTool;
import net.rptools.maptool.model.AttachedLightSource;
import net.rptools.maptool.model.Direction;
import net.rptools.maptool.model.GUID;
import net.rptools.maptool.model.Light;
import net.rptools.maptool.model.LightSource;
import net.rptools.maptool.model.ModelChangeEvent;
import net.rptools.maptool.model.ModelChangeListener;
import net.rptools.maptool.model.SightType;
import net.rptools.maptool.model.Token;
import net.rptools.maptool.model.Zone;
public class ZoneView implements ModelChangeListener {
private Zone zone;
// VISION
private Map<GUID, Area> tokenVisionCache = new HashMap<GUID, Area>();
private Map<GUID, Map<String, Area>> lightSourceCache = new HashMap<GUID, Map<String, Area>>();
private Set<GUID> lightSourceSet = new HashSet<GUID>();
private Map<GUID, Set<DrawableLight>> drawableLightCache = new HashMap<GUID, Set<DrawableLight>>();
private Map<GUID, Set<Area>> brightLightCache = new HashMap<GUID, Set<Area>>();
private Map<PlayerView, VisibleAreaMeta> visibleAreaMap = new HashMap<PlayerView, VisibleAreaMeta>();
private AreaData topologyAreaData;
public ZoneView(Zone zone) {
this.zone = zone;
findLightSources();
zone.addModelChangeListener(this);
}
public Area getVisibleArea(PlayerView view) {
calculateVisibleArea(view);
return visibleAreaMap.get(view).visibleArea;
}
public boolean isUsingVision() {
return lightSourceSet.size() > 0 || (zone.getTopology() != null && !zone.getTopology().isEmpty());
}
public AreaData getTopologyAreaData() {
if (topologyAreaData == null) {
topologyAreaData = new AreaData(zone.getTopology());
topologyAreaData.digest();
}
return topologyAreaData;
}
public Area getLightSourceArea(Token token, Token lightSourceToken) {
// Cached ?
Map<String, Area> areaBySightMap = lightSourceCache.get(lightSourceToken.getId());
if (areaBySightMap != null) {
Area lightSourceArea = areaBySightMap.get(token.getSightType());
if (lightSourceArea != null) {
return lightSourceArea;
}
} else {
areaBySightMap = new HashMap<String, Area>();
lightSourceCache.put(lightSourceToken.getId(), areaBySightMap);
}
// Calculate
Area area = new Area();
for (AttachedLightSource attachedLightSource : lightSourceToken.getLightSources()) {
LightSource lightSource = MapTool.getCampaign().getLightSource(attachedLightSource.getLightSourceId());
if (lightSource == null) {
continue;
}
SightType sight = MapTool.getCampaign().getSightType(token.getSightType());
Area visibleArea = calculateLightSourceArea(lightSource, lightSourceToken, sight, attachedLightSource.getDirection());
if (visibleArea != null) {
area.add(visibleArea);
}
}
// Cache
areaBySightMap.put(token.getSightType(), area);
return area;
}
private Area calculateLightSourceArea(LightSource lightSource, Token lightSourceToken, SightType sight, Direction direction) {
Point p = FogUtil.calculateVisionCenter(lightSourceToken, zone);
Area lightSourceArea = lightSource.getArea(lightSourceToken, zone, direction);
// Calculate exposed area
// TODO: This won't work with directed light, need to add an anchor or something
if (sight.getMultiplier() != 1) {
lightSourceArea.transform(AffineTransform.getScaleInstance(sight.getMultiplier(), sight.getMultiplier()));
}
Area visibleArea = FogUtil.calculateVisibility(p.x, p.y, lightSourceArea, getTopologyAreaData());
if (visibleArea == null) {
return null;
}
// Keep track of colored light
Set<DrawableLight> lightSet = new HashSet<DrawableLight>();
Set<Area> brightLightSet = new HashSet<Area>();
for (Light light : lightSource.getLightList()) {
Area lightArea = lightSource.getArea(lightSourceToken, zone, direction, light);
if (sight.getMultiplier() != 1) {
lightArea.transform(AffineTransform.getScaleInstance(sight.getMultiplier(), sight.getMultiplier()));
}
lightArea.transform(AffineTransform.getTranslateInstance(p.x, p.y));
lightArea.intersect(visibleArea);
if (light.getPaint() != null) {
lightSet.add(new DrawableLight(light.getPaint(), lightArea));
} else {
brightLightSet.add(lightArea);
}
}
drawableLightCache.put(lightSourceToken.getId(), lightSet);
brightLightCache.put(lightSourceToken.getId(), brightLightSet);
return visibleArea;
}
public Area getVisibleArea(Token token) {
// Sanity
if (token == null || !token.getHasSight()) {
return null;
}
// Cache ?
Area tokenVisibleArea = tokenVisionCache.get(token.getId());
if (tokenVisibleArea != null) {
return tokenVisibleArea;
}
// Visible area without inhibition
Point p = FogUtil.calculateVisionCenter(token, zone);
int visionDistance = zone.getTokenVisionInPixels();
Area visibleArea = new Area(new Ellipse2D.Double(-visionDistance, -visionDistance, visionDistance*2, visionDistance*2));
visibleArea = FogUtil.calculateVisibility(p.x, p.y, visibleArea, getTopologyAreaData());
// Simple case
if (lightSourceSet.size() > 0) {
if (visibleArea != null) {
Rectangle2D origBounds = visibleArea.getBounds();
// Combine all light sources that might intersect our vision
List<Area> intersects = new LinkedList<Area>();
for (GUID lightSourceTokenId : lightSourceSet) {
Token lightSourceToken = zone.getToken(lightSourceTokenId);
if (lightSourceToken == null) {
continue;
}
Area lightArea = getLightSourceArea(token, lightSourceToken);
if (origBounds.intersects(lightArea.getBounds2D())) {
Area intersection = new Area(visibleArea);
intersection.intersect(lightArea);
intersects.add(intersection);
}
}
// Check for personal vision
SightType sight = MapTool.getCampaign().getSightType(token.getSightType());
if (sight != null && sight.hasPersonalLightSource()) {
Area lightArea = calculateLightSourceArea(sight.getPersonalLightSource(), token, sight, Direction.CENTER);
if (lightArea != null) {
Area intersection = new Area(visibleArea);
intersection.intersect(lightArea);
intersects.add(intersection);
}
}
while (intersects.size() > 1) {
Area a1 = intersects.remove(0);
Area a2 = intersects.remove(0);
a1.add(a2);
intersects.add(a1);
}
visibleArea = intersects.size() > 0 ? intersects.get(0) : new Area();
}
}
tokenVisionCache.put(token.getId(), visibleArea);
return visibleArea;
}
private void findLightSources() {
lightSourceSet.clear();
for (Token token : zone.getAllTokens()) {
if (token.hasLightSources()) {
lightSourceSet.add(token.getId());
}
}
}
public Set<DrawableLight> getDrawableLights() {
Set<DrawableLight> lightSet = new HashSet<DrawableLight>();
for (Set<DrawableLight> set : drawableLightCache.values()) {
lightSet.addAll(set);
}
return lightSet;
}
public Set<Area> getBrightLights() {
Set<Area> lightSet = new HashSet<Area>();
for (Set<Area> set : brightLightCache.values()) {
lightSet.addAll(set);
}
return lightSet;
}
public void flush() {
tokenVisionCache.clear();
lightSourceCache.clear();
visibleAreaMap.clear();
drawableLightCache.clear();
brightLightCache.clear();
}
private void flush(Token token) {
boolean hadLightSource = lightSourceCache.get(token.getId()) != null;
tokenVisionCache.remove(token.getId());
lightSourceCache.remove(token.getId());
drawableLightCache.remove(token.getId());
brightLightCache.remove(token.getId());
visibleAreaMap.clear();
if (hadLightSource || token.hasLightSources()) {
// Have to recalculate all token vision
tokenVisionCache.clear();
}
if (token.getHasSight()) {
visibleAreaMap.clear();
}
// TODO: This fixes a bug with changing vision type, I don't like it though, it needs to be optimized back out
lightSourceCache.clear();
}
private void calculateVisibleArea(PlayerView view) {
if (visibleAreaMap.get(view) != null) {
return;
}
// Cache it
VisibleAreaMeta meta = new VisibleAreaMeta();
meta.visibleArea = new Area();
visibleAreaMap.put(view, meta);
// Calculate it
for (Token token : zone.getAllTokens()) {
if (!token.getHasSight ()) {
continue;
}
// Don't bother if it's not visible
if (!view.isGMView() && !token.isVisible()) {
continue;
}
// Permission
if (MapTool.getServerPolicy().isUseIndividualViews()) {
if (!AppUtil.playerOwns(token)) {
continue;
}
} else {
// Party members only, unless you are the GM
if (token.getType() != Token.Type.PC && !view.isGMView()) {
continue;
}
}
Area tokenVision = getVisibleArea(token);
if (tokenVision != null) {
meta.visibleArea.add(tokenVision);
}
}
}
////
// MODEL CHANGE LISTENER
public void modelChanged(ModelChangeEvent event) {
Object evt = event.getEvent();
if (event.getModel() instanceof Zone) {
if (evt == Zone.Event.TOPOLOGY_CHANGED) {
tokenVisionCache.clear();
lightSourceCache.clear();
visibleAreaMap.clear();
topologyAreaData = null;
}
if (evt == Zone.Event.TOKEN_CHANGED || evt == Zone.Event.TOKEN_REMOVED) {
flush((Token)event.getArg());
}
if (evt == Zone.Event.TOKEN_ADDED || evt == Zone.Event.TOKEN_CHANGED) {
Token token = (Token) event.getArg();
if (token.hasLightSources()) {
lightSourceSet.add(token.getId());
} else {
lightSourceSet.remove(token.getId());
}
if (token.getHasSight()) {
visibleAreaMap.clear();
}
}
if (evt == Zone.Event.TOKEN_REMOVED) {
Token token = (Token) event.getArg();
lightSourceSet.remove(token);
}
}
}
private static class VisibleAreaMeta {
Area visibleArea;
}
}
| [
"[email protected]"
]
| |
4bba8d0e70da368a94dfd4081d204a359886366c | faa710159a8abd5ec5915e35c3e4417411ecf57a | /src/main/java/com/nieyue/service/impl/ActivationCodeServiceImpl.java | 5a8b7f984134215dd8c5ada7c027a69358ade1ca | []
| no_license | nieyue/freeride | 12a61ba9c87c981ed6c9909faeff4b45079d5e10 | 7db561460c05d75321a754e2d08b14556a620929 | refs/heads/master | 2020-04-11T16:19:38.218588 | 2019-02-22T07:35:01 | 2019-02-22T07:35:01 | 161,920,291 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 302 | java | package com.nieyue.service.impl;
import com.nieyue.bean.ActivationCode;
import org.springframework.stereotype.Service;
import com.nieyue.service.ActivationCodeService;
@Service
public class ActivationCodeServiceImpl extends BaseServiceImpl<ActivationCode,Long> implements ActivationCodeService {
}
| [
"[email protected]"
]
| |
1d7204a1762c66217f5b4667aec331db8f7b4e00 | 7730793c2e5981f98fcc3c2f12526e153fba2e72 | /src/main/java/com/apptium/order/domain/OrdContactDetails.java | ffaa3cc6b96925d4ccc8804d8296a4eec7da7472 | []
| no_license | ravi7mech/order-management | 3de18db5e26099d5fa5968ea991b62089e9b3699 | a968c8cc71fc0a23c739999de4cce1d97f9b2cb3 | refs/heads/main | 2023-06-16T16:51:09.393167 | 2021-07-14T07:39:11 | 2021-07-14T07:39:11 | 385,852,996 | 0 | 0 | null | 2021-07-14T07:39:12 | 2021-07-14T07:31:15 | Java | UTF-8 | Java | false | false | 4,807 | java | package com.apptium.order.domain;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.io.Serializable;
import javax.persistence.*;
/**
* A OrdContactDetails.
*/
@Entity
@Table(name = "ord_contact_details")
public class OrdContactDetails implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name = "contact_name")
private String contactName;
@Column(name = "contact_phone_number")
private String contactPhoneNumber;
@Column(name = "contact_email_id")
private String contactEmailId;
@Column(name = "first_name")
private String firstName;
@Column(name = "last_name")
private String lastName;
@JsonIgnoreProperties(
value = {
"ordContactDetails",
"ordNote",
"ordChannel",
"ordOrderPrice",
"ordBillingAccountRef",
"ordCharacteristics",
"ordOrderItems",
"ordPaymentRefs",
"ordReasons",
"ordContracts",
"ordFulfillments",
"ordAcquisitions",
},
allowSetters = true
)
@OneToOne(mappedBy = "ordContactDetails")
private OrdProductOrder ordProductOrder;
// jhipster-needle-entity-add-field - JHipster will add fields here
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public OrdContactDetails id(Long id) {
this.id = id;
return this;
}
public String getContactName() {
return this.contactName;
}
public OrdContactDetails contactName(String contactName) {
this.contactName = contactName;
return this;
}
public void setContactName(String contactName) {
this.contactName = contactName;
}
public String getContactPhoneNumber() {
return this.contactPhoneNumber;
}
public OrdContactDetails contactPhoneNumber(String contactPhoneNumber) {
this.contactPhoneNumber = contactPhoneNumber;
return this;
}
public void setContactPhoneNumber(String contactPhoneNumber) {
this.contactPhoneNumber = contactPhoneNumber;
}
public String getContactEmailId() {
return this.contactEmailId;
}
public OrdContactDetails contactEmailId(String contactEmailId) {
this.contactEmailId = contactEmailId;
return this;
}
public void setContactEmailId(String contactEmailId) {
this.contactEmailId = contactEmailId;
}
public String getFirstName() {
return this.firstName;
}
public OrdContactDetails firstName(String firstName) {
this.firstName = firstName;
return this;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return this.lastName;
}
public OrdContactDetails lastName(String lastName) {
this.lastName = lastName;
return this;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public OrdProductOrder getOrdProductOrder() {
return this.ordProductOrder;
}
public OrdContactDetails ordProductOrder(OrdProductOrder ordProductOrder) {
this.setOrdProductOrder(ordProductOrder);
return this;
}
public void setOrdProductOrder(OrdProductOrder ordProductOrder) {
if (this.ordProductOrder != null) {
this.ordProductOrder.setOrdContactDetails(null);
}
if (ordProductOrder != null) {
ordProductOrder.setOrdContactDetails(this);
}
this.ordProductOrder = ordProductOrder;
}
// jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof OrdContactDetails)) {
return false;
}
return id != null && id.equals(((OrdContactDetails) o).id);
}
@Override
public int hashCode() {
// see https://vladmihalcea.com/how-to-implement-equals-and-hashcode-using-the-jpa-entity-identifier/
return getClass().hashCode();
}
// prettier-ignore
@Override
public String toString() {
return "OrdContactDetails{" +
"id=" + getId() +
", contactName='" + getContactName() + "'" +
", contactPhoneNumber='" + getContactPhoneNumber() + "'" +
", contactEmailId='" + getContactEmailId() + "'" +
", firstName='" + getFirstName() + "'" +
", lastName='" + getLastName() + "'" +
"}";
}
}
| [
"[email protected]"
]
| |
371f11be3dc4495985e3dcb510121ccf4ef18e00 | d2dd79e32de106fe96e3a7d69ac3631571ad77a4 | /src/pers/rush/bookstore/tool/Cart.java | fafc7a54d027b97694bd8e9f2ba386da9576f0cc | []
| no_license | zhurunshi/bookstore | d1d932081f61b8c3b6b2c8b7a079e52428caf839 | 043a1096c1a4611e159a7b7a84d6e7d4f651cfc4 | refs/heads/master | 2020-08-30T10:34:01.741743 | 2018-05-24T06:56:52 | 2018-05-24T06:56:52 | 94,389,671 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,568 | java | package pers.rush.bookstore.tool;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import pers.rush.bookstore.vo.Book;
import pers.rush.bookstore.vo.Orderitem;
public class Cart {
protected Map<Integer, Orderitem> items;
public Map<Integer, Orderitem> getItems() {
return items;
}
public void setItems(Map<Integer, Orderitem> items) {
this.items = items;
}
//默认构造函数,如果购物车为空,生成购物车
public Cart() {
if (items == null)
items = new HashMap<Integer, Orderitem>();
}
public void addBook(Integer bookid, Orderitem orderitem) { //添加图书到购物车
if (items.containsKey("bookid")) { //如果存在,更改数量
Orderitem _orderitem = items.get(bookid);
orderitem.setQuantity(_orderitem.getOrderitemid()
+ orderitem.getQuantity());
items.put(bookid, _orderitem);
}
else { //如果不存在的话,添加入集合
items.put(bookid, orderitem);
}
}
public void updateCart(Integer bookid, int quantity) { //更新购物车的购买书籍数量
Orderitem orderitem = items.get(bookid);
orderitem.setQuantity(quantity);
items.put(bookid, orderitem);
}
public float getTotalPrice() { //计算总价格
float totalPrice = 0;
for (Iterator<Orderitem> it = items.values().iterator(); it.hasNext();) {
Orderitem orderitem = (Orderitem) it.next();
Book book = orderitem.getBook();
int quantity = orderitem.getQuantity();
totalPrice += book.getPrice() * quantity;
}
return totalPrice;
}
}
| [
"[email protected]"
]
| |
cdda2ab6900fd31110ba5c033fe592f915889567 | 313514501f967fbd4b81f1c5f254220e53c368c5 | /lab/android/lablibrary/src/main/java/com/lightappbuilder/lab4/lablibrary/utils/ImageUtils.java | 6887aa72f2dda646578a036cd38ca3d6462f314b | []
| no_license | Billshimmer/blogs | 1624b92d29730fe2b8d6dc9312e75a19a5b13c61 | 06bef0f06e3d2b8eeb89c54dd13e410ba0e0fc67 | refs/heads/master | 2021-01-13T17:03:51.323191 | 2017-09-04T01:21:05 | 2017-09-04T01:21:05 | 76,326,323 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 5,913 | java | package com.lightappbuilder.lab4.lablibrary.utils;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Matrix;
import android.media.ExifInterface;
import android.opengl.GLES10;
import android.util.Log;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
/**
* TODO 参考ThumbnailUtils 进行优化
*/
public class ImageUtils {
private static final String TAG = "ImageUtils";
private static final int MAX_BITMAP_DIMENSION;
static {
int[] maxTextureSize = new int[1];
GLES10.glGetIntegerv(GLES10.GL_MAX_TEXTURE_SIZE, maxTextureSize, 0);
Log.d(TAG, "static initializer: GLES10 GL_MAX_TEXTURE_SIZE=" + maxTextureSize[0]);
MAX_BITMAP_DIMENSION = Math.max(maxTextureSize[0], 1024);
}
/**
* 获取图片的exif的旋转角度
*/
public static int exifRotateAngle(String path) {
int angle = 0;
try {
ExifInterface exifInterface = new ExifInterface(path);
int orientation = exifInterface.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL);
switch (orientation) {
case ExifInterface.ORIENTATION_ROTATE_90:
angle = 90;
break;
case ExifInterface.ORIENTATION_ROTATE_180:
angle = 180;
break;
case ExifInterface.ORIENTATION_ROTATE_270:
angle = 270;
break;
}
} catch (IOException e) {
e.printStackTrace();
}
return angle;
}
/**
* 计算decode时缩小比例,不使图片变形(防止图片太大内存溢出)
*/
public static int calcInSampleSize(BitmapFactory.Options options, int maxWidth, int maxHeight) {
double outWidth = options.outWidth;
double outHeight = options.outHeight;
//Log.d(TAG, "calcInSampleSize outHeight="+outHeight+" outWidth="+outWidth);
double ratio = 1;
if (maxWidth > 0 && maxHeight <= 0) {
ratio = Math.ceil(outWidth / maxWidth);
} else if (maxHeight > 0 && maxWidth <= 0) {
ratio = Math.ceil(outHeight / maxHeight);
} else if (maxWidth > 0 && maxHeight > 0) {
double widthRatio = Math.ceil(outWidth / maxWidth);
double heightRatio = Math.ceil(outHeight / maxHeight);
//Log.d(TAG, "calcInSampleSize widthRatio="+widthRatio+" heightRatio="+heightRatio);
ratio = widthRatio > heightRatio ? widthRatio : heightRatio;
}
//Log.d(TAG, "calcInSampleSize ratio="+ratio);
return (int) (ratio > 1 ? ratio : 1);
}
/**
* 根据路径获得指定最大宽高的Bitmap
*/
public static Bitmap getSmallBitmap(String filePath, int maxWidth, int maxHeight) {
final BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
BitmapFactory.decodeFile(filePath, options);
options.inSampleSize = calcInSampleSize(options, maxWidth, maxHeight);
options.inJustDecodeBounds = false;
return BitmapFactory.decodeFile(filePath, options);
}
/**
* 获取不超出当前手机能渲染文理最大宽高的Bitmap
*/
public static Bitmap getSmallBitmap(String filePath) {
return getSmallBitmap(filePath, MAX_BITMAP_DIMENSION, MAX_BITMAP_DIMENSION);
}
public static boolean compressImage(Bitmap bitmap, File outFile) {
if (bitmap == null) {
return false;
}
FileOutputStream out = null;
try {
out = new FileOutputStream(outFile);
bitmap.compress(Bitmap.CompressFormat.JPEG, 95,
out);
return true;
} catch (FileNotFoundException e) {
Log.e(TAG, "compressImage FileNotFoundException", e);
} finally {
if(out != null) {
try {
out.close();
} catch (IOException ignored) {
}
}
}
return false;
}
/**
* 裁剪图片
* @param bitmap 原始图片
* @param x 起点x
* @param y 起点y
* @param cropWidth 裁剪区域width
* @param cropHeight 裁剪区域height
* @param degree 旋转角度
* @param outWidth 输出宽度
* @param outHeight 输出高度
*/
public static Bitmap cropBitmap(Bitmap bitmap, int x, int y, int cropWidth, int cropHeight, float degree, int outWidth, int outHeight) {
//规范旋转角度
degree %= 360f;
if(degree < 0) {
degree += 360f;
}
if (degree >= 315f || degree < 45f) {
degree = 0;
} else if (degree >= 45f && degree < 135f) {
degree = 90f;
} else if (degree >= 135f && degree < 225f) {
degree = 180f;
} else if (degree >= 225f && degree < 315f) {
degree = 270f;
}
//防止裁剪区域超出图片
int bmWidth = bitmap.getWidth();
int bmHeight = bitmap.getHeight();
cropWidth = Math.min(cropWidth, bmWidth);
cropHeight = Math.min(cropHeight, bmHeight);
int xBound = bmWidth - cropWidth;
int yBound = bmHeight - cropHeight;
if(x < 0) {
x = 0;
} else if(x > xBound) {
x = xBound;
}
if(y < 0) {
y = 0;
} else if(y > yBound) {
y = yBound;
}
//裁剪缩放图片
Matrix matrix = new Matrix();
matrix.postRotate(degree);
matrix.postScale((float) outWidth / cropWidth, (float)outHeight / cropHeight);
return Bitmap.createBitmap(bitmap, x, y, cropWidth, cropHeight, matrix, true);
}
}
| [
"[email protected]"
]
| |
6c8191c98124209252bf4a8957414abadf560768 | 07be9fac780e8d43f52527f4fff79289d354b1e5 | /TPs/2B_SpringDataRest/source/model/Post.java | 09d569883496ef4e2ed6fa7cff13b07ddf4ae783 | []
| no_license | dthibau/springboot | 55b68d88b0b2ab5009359150a5f7074729db6969 | f8445dadf74cbb2e210b30690844f0cfc90e4072 | refs/heads/master | 2021-08-01T18:37:46.865532 | 2021-07-28T16:43:05 | 2021-07-28T16:43:05 | 249,222,902 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,221 | java | package org.formation.model;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
@Entity
public class Post implements Serializable {
/**
*
*/
private static final long serialVersionUID = 6590486482810196501L;
@Id @GeneratedValue
private long id;
private String title;
@Lob
private String message;
@Temporal(TemporalType.TIMESTAMP)
private Date date;
@ManyToOne
private Member member;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String name) {
this.title = name;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public Date getDate() {
return date;
}
public void setDate(Date uploadedDate) {
this.date = uploadedDate;
}
public Member getMember() {
return member;
}
public void setMember(Member member) {
this.member = member;
}
}
| [
"[email protected]"
]
| |
0ae792b5a3b696fab709e71b121481f88fc5efa1 | ab9af0c92a7172cd18ef7a51a17e883a38f040e0 | /MyDemo/src/main/java/com/hank/demo/finalTest.java | d580518a074f480c8e346ac3bf7e71e0d5e4d3f7 | []
| no_license | HankLiu9320/JavaDemo | c3e73141bfd3cd4c6035e45d4bd8a65d0b89c0f9 | a8ca1a52f63fd1f7756da1ad37b1e4b89077ee15 | refs/heads/master | 2020-03-21T12:02:30.549530 | 2018-06-25T03:50:20 | 2018-06-25T03:50:20 | 138,533,506 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 751 | java | package com.hank.demo;
//被final修饰的对象,是引用不可变,对象的内容是可以改变
//fianl赋值声明的时候可以不用赋值,但是在构造方法中必须每一次都赋值
public class finalTest {
public static void main(String[] args) {
final StringBuffer sb = new StringBuffer("ss");
sb.append("2");// 改变对象的内容,对
//sb = new StringBuffer();// 编译未通过,报错:The final local variable sb cannot
// be assigned.
// It must be blank and not using a compound
// assignment
}
}
class finalDemo {
public final int a;
public finalDemo() {
a = 10;
}
} | [
"[email protected]"
]
| |
037de6184723aee69f752f300034bb1f7ffcb888 | 7a713cd0d6f5b4c8bef171fd603ef38e341c4d0c | /app/src/androidTest/java/com/example/sunnny/scrollingappbar/ExampleInstrumentedTest.java | 666cebace9d944c059ade00b2d358e419addc588 | []
| no_license | sun3y21/ScrollingAppBar | 6da647508bda541fa9a4e52424329dd44b239a8b | 2936b28f3300ce8849b2e25f77d295aaaadddba1 | refs/heads/master | 2020-05-23T20:59:09.596715 | 2017-03-13T06:04:03 | 2017-03-13T06:04:03 | 84,789,609 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 772 | java | package com.example.sunnny.scrollingappbar;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.example.sunnny.scrollingappbar", appContext.getPackageName());
}
}
| [
"[email protected]"
]
| |
4b5b32e0b7df940c09a3de790d1b6e0ab01a9a5b | d2cb1f4f186238ed3075c2748552e9325763a1cb | /methods_all/nonstatic_methods/javax_imageio_stream_MemoryCacheImageOutputStream_readDouble.java | 577a7252ce176914053c316b90c2fb5269025645 | []
| no_license | Adabot1/data | 9e5c64021261bf181b51b4141aab2e2877b9054a | 352b77eaebd8efdb4d343b642c71cdbfec35054e | refs/heads/master | 2020-05-16T14:22:19.491115 | 2019-05-25T04:35:00 | 2019-05-25T04:35:00 | 183,001,929 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 230 | java | class javax_imageio_stream_MemoryCacheImageOutputStream_readDouble{ public static void function() {javax.imageio.stream.MemoryCacheImageOutputStream obj = new javax.imageio.stream.MemoryCacheImageOutputStream();obj.readDouble();}} | [
"[email protected]"
]
| |
d00f95405fda7c36250a1d827d7cdb6b410c55bd | 06dd235ea238871d5a62fe783e0cceedb5505ad8 | /Sessions of Day 3/Example code/AnimationDemo/src/in/mihirgokani/aworkshop/animationdemo/AnimatorDemo1a.java | 7ab1c3f7e3b64b267cdf77757291bc938caa15f7 | []
| no_license | sparkma/Android-workshop-content-2013 | c288602eb811d54b0f7ea72dbc4173ada3c0bffb | 010ccbf5bb5474050401fb48e98b5d2bdd1dcd36 | refs/heads/master | 2021-01-21T04:03:59.093858 | 2013-08-13T06:30:00 | 2013-08-13T06:30:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,508 | java | package in.mihirgokani.aworkshop.animationdemo;
import android.animation.ValueAnimator;
import android.animation.ValueAnimator.AnimatorUpdateListener;
import android.app.Activity;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.drawable.ShapeDrawable;
import android.graphics.drawable.shapes.OvalShape;
import android.graphics.drawable.shapes.Shape;
import android.os.Bundle;
import android.view.View;
/**
* @author Mihir Gokani
* @created 01-Mar-2013 12:45:11 PM
*
* Demo of {@link ValueAnimator}
*
* @see AnimatorDemo1b
*/
public class AnimatorDemo1a extends Activity {
final Paint paint;
ShapeDrawable myShapeDrawable;
/**
* Constructor for AnimatorDemo1a
*/
public AnimatorDemo1a() {
/* Setup paint */
paint = new Paint();
paint.setColor(Color.argb(100, 50, 100, 200));
paint.setTextSize(32f);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Shape shape;
/* Setup shape */
shape = new OvalShape();
shape.resize(50, 50);
/* Setup drawable */
myShapeDrawable = new ShapeDrawable(shape);
myShapeDrawable.getPaint().set(paint);
myShapeDrawable.setBounds(125, 225, 275, 375);
/* Setup view (which will draw our drawable) */
final MyView myView = new MyView(this);
setContentView(myView);
/* Setup Animator */
ValueAnimator a = ValueAnimator.ofInt(0, 100);
a.setDuration(10000);
a.addUpdateListener(new AnimatorUpdateListener() {
/* Listen to the update event */
@Override
public void onAnimationUpdate(ValueAnimator va) {
int value = (Integer) va.getAnimatedValue(); // Use animated value anyhow you want!
myShapeDrawable.setAlpha(value); // For example, change transparency of our drawable!
myView.invalidate(); // Redraw!
}
});
a.start();
}
/* Our custom view which will draw the drawable */
private class MyView extends View {
public MyView(Context context) {
super(context);
}
@Override
protected void onDraw(Canvas canvas) {
myShapeDrawable.draw(canvas);
}
}
}
| [
"[email protected]"
]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.