blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
410
| content_id
stringlengths 40
40
| detected_licenses
sequencelengths 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
sequencelengths 1
1
| author_id
stringlengths 0
313
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3a1637fa8b94790c8560faeff520060759131693 | 4a93294a031c34c1e071dd760eb753e7b365299d | /src/basic/UseStatic.java | 47c6a15caabeebed5ec5ebaac0389df4bcaf6672 | [] | no_license | ElyamineAdjoudj/LearnJava_WeekDaysEvening_SeleniumNY_Winter2020 | b393ba77a7008e7f3051b67b72dfcce8bc6a78bb | d7b9de0a3caf0e89231bb8e558676e93602138e5 | refs/heads/master | 2022-06-09T15:29:08.556076 | 2020-05-07T03:40:42 | 2020-05-07T03:40:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 372 | java | package basic;
public class UseStatic {
public static void main(String[] args) {
UseStatic.display();// call by class name
// Create a object
UseStatic myObject = new UseStatic();
myObject.TvDisplay();
}
public static void display() {
System.out.println("Display is good");
}
public void TvDisplay() {
System.out.println("TV Display is FHD");
}
}
| [
"[email protected]"
] | |
7b1b58d38137b61714c241cbf9a9f7805542c753 | 647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4 | /com.tencent.mobileqqi/classes.jar/com/tencent/mobileqq/data/DraftSummaryInfo.java | cb6ed02cb31862b71e1a014bbf8525b7723567eb | [] | no_license | tsuzcx/qq_apk | 0d5e792c3c7351ab781957bac465c55c505caf61 | afe46ef5640d0ba6850cdefd3c11badbd725a3f6 | refs/heads/main | 2022-07-02T10:32:11.651957 | 2022-02-01T12:41:38 | 2022-02-01T12:41:38 | 453,860,108 | 36 | 9 | null | 2022-01-31T09:46:26 | 2022-01-31T02:43:22 | Java | UTF-8 | Java | false | false | 1,234 | java | package com.tencent.mobileqq.data;
public class DraftSummaryInfo
{
private String summary;
private long time;
private int type;
private String uin;
public DraftSummaryInfo() {}
public DraftSummaryInfo(String paramString1, int paramInt, String paramString2, long paramLong)
{
this.uin = paramString1;
this.type = paramInt;
this.summary = paramString2;
this.time = paramLong;
}
public String getSummary()
{
return this.summary;
}
public long getTime()
{
return this.time / 1000L;
}
public int getType()
{
return this.type;
}
public String getUin()
{
return this.uin;
}
public void setSummary(String paramString)
{
this.summary = paramString;
}
public void setTime(long paramLong)
{
this.time = paramLong;
}
public void setType(int paramInt)
{
this.type = paramInt;
}
public void setUin(String paramString)
{
this.uin = paramString;
}
}
/* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mobileqqi\classes.jar
* Qualified Name: com.tencent.mobileqq.data.DraftSummaryInfo
* JD-Core Version: 0.7.0.1
*/ | [
"[email protected]"
] | |
0227a9bae526e518f657b542f2f638ca538e8d21 | 92969e74f214cc5320b5665a516bf88525845e4c | /app/src/main/java/com/escmobile/bjss/controller/MainController.java | 8c8c3e51e947c3a333e30defdce75197c66836da | [] | no_license | genctasbasi/basketPriceCodingExercise | d5016a2d313f6c7e710c6a392909ede0859acec4 | b259db619df1925d1bf8ae90315cf028bb8fffe2 | refs/heads/master | 2021-03-12T23:54:15.360657 | 2015-04-27T09:44:28 | 2015-04-27T09:44:28 | 34,658,286 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,301 | java | package com.escmobile.bjss.controller;
import com.escmobile.bjss.config.Config;
import com.escmobile.bjss.model.RateJSON;
import com.escmobile.bjss.net.APIClient;
import com.escmobile.bjss.net.APICurrencyList;
import com.escmobile.bjss.net.APIRate;
import com.google.gson.JsonObject;
import retrofit.Callback;
import retrofit.RetrofitError;
import retrofit.client.Response;
/**
* Created by genctasbasi on 27/04/15.
*/
public class MainController {
private MainControllerEventListener mainControllerEventListener;
public void makeGetCurrencyListCall() {
APIClient client = APIClient.getInstance();
APICurrencyList currencyList = client.getCurrencyListClient();
currencyList.getCurrencyList(new Callback<JsonObject>() {
@Override
public void success(JsonObject jsonObject, Response response) {
if (mainControllerEventListener != null) {
mainControllerEventListener.onCurrencyListCallSucceed(jsonObject);
}
}
@Override
public void failure(RetrofitError error) {
if (mainControllerEventListener != null) {
mainControllerEventListener.onCurrencyListCallFailed(error.toString());
}
}
});
}
public void makeGetRateCall(final String currencyTo) {
APIClient client = APIClient.getInstance();
APIRate currency = client.getRateClient();
currency.getRate(Config.BASE_CURRENCY_CODE, currencyTo, new Callback<RateJSON>() {
@Override
public void success(RateJSON rate, Response response) {
if (mainControllerEventListener != null) {
mainControllerEventListener.onGetRateCallSucceed(currencyTo, rate);
}
}
@Override
public void failure(RetrofitError error) {
if (mainControllerEventListener != null) {
mainControllerEventListener.onGetRateCallFailed(error.toString());
}
}
});
}
public void setMainControllerEventListener(MainControllerEventListener mainControllerEventListener) {
this.mainControllerEventListener = mainControllerEventListener;
}
}
| [
"[email protected]"
] | |
f7470878c910f5673a27a3ec20bc7dead868412e | ed5159d056e98d6715357d0d14a9b3f20b764f89 | /test/irvine/oeis/a016/A016482Test.java | 0b6c130e60ef1c5da2d525f3cbe316d88f8bb4e9 | [] | 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 | 195 | java | package irvine.oeis.a016;
import irvine.oeis.AbstractSequenceTest;
/**
* Tests the corresponding class.
* @author Sean A. Irvine
*/
public class A016482Test extends AbstractSequenceTest {
}
| [
"[email protected]"
] | |
261d4ad6a89b70694cd1210809d61d76160033a5 | 6552244c7ef44150ea74cef7ec801d5a9f7171e9 | /app/src/main/java/com/google/android/gms/search/ime/zza.java | f58779b9d9a00b00e9dfd33099f75398a673adb2 | [] | no_license | amithbm/cbskeep | c9469156efd307fb474d817760a0b426af8f7c5c | a800f00ab617cba49d1a1bea1f0282c0cde525e7 | refs/heads/master | 2016-09-06T12:42:33.824977 | 2015-08-24T15:33:50 | 2015-08-24T15:33:50 | 41,311,235 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,546 | java | package com.google.android.gms.search.ime;
import android.os.Parcel;
import android.os.Parcelable.Creator;
import com.google.android.gms.common.internal.safeparcel.zza.zza;
import com.google.android.gms.common.internal.safeparcel.zzb;
public class zza
implements Parcelable.Creator<GetCorpusHandlesRegisteredForIMECall.Request>
{
static void zza(GetCorpusHandlesRegisteredForIMECall.Request paramRequest, Parcel paramParcel, int paramInt)
{
paramInt = zzb.zzcR(paramParcel);
zzb.zzc(paramParcel, 1000, mVersionCode);
zzb.zzJ(paramParcel, paramInt);
}
public GetCorpusHandlesRegisteredForIMECall.Request zzlA(Parcel paramParcel)
{
int j = com.google.android.gms.common.internal.safeparcel.zza.zzcQ(paramParcel);
int i = 0;
while (paramParcel.dataPosition() < j)
{
int k = com.google.android.gms.common.internal.safeparcel.zza.zzcP(paramParcel);
switch (com.google.android.gms.common.internal.safeparcel.zza.zzeS(k))
{
default:
com.google.android.gms.common.internal.safeparcel.zza.zzb(paramParcel, k);
break;
case 1000:
i = com.google.android.gms.common.internal.safeparcel.zza.zzg(paramParcel, k);
}
}
if (paramParcel.dataPosition() != j)
throw new zza.zza("Overread allowed size end=" + j, paramParcel);
return new GetCorpusHandlesRegisteredForIMECall.Request(i);
}
public GetCorpusHandlesRegisteredForIMECall.Request[] zzpe(int paramInt)
{
return new GetCorpusHandlesRegisteredForIMECall.Request[paramInt];
}
} | [
"[email protected]"
] | |
eb4e1a4b85d027ea90b1e037feb05808fafd7f5e | b4158d0e89a9bf042a55cc3ea405d67dd03ba4be | /src/main/java/com/quartciphers/skillscy/dto/SendInBlueAPI/SendInBlueAPIResponse.java | b5ed3627f532c13e9b0bece05f1246b2bd0bedf8 | [] | no_license | skillscy/QCMainWS | b925c809f56e6de7fbe491fd72e49cd4664d33e4 | e84efdf4308a32d6a11403b0f1882dec30ad414c | refs/heads/master | 2023-07-15T15:00:27.430810 | 2021-09-10T20:10:16 | 2021-09-10T20:10:16 | 358,270,848 | 0 | 0 | null | 2021-09-10T20:12:16 | 2021-04-15T13:34:12 | Java | UTF-8 | Java | false | false | 370 | java | package com.quartciphers.skillscy.dto.SendInBlueAPI;
import com.fasterxml.jackson.annotation.JsonProperty;
public class SendInBlueAPIResponse {
private String messageID;
public String getMessageID() {
return messageID;
}
@JsonProperty("messageId")
public void setMessageID(String messageID) {
this.messageID = messageID;
}
}
| [
"[email protected]"
] | |
379b5ebd4d60186100b7fb7904b6d01181097311 | d9ac5887efed27e23ea91968b9cd3a1a37d62048 | /src/de/hotmail/gurkilein/sellchest/SellchestPlayerListener.java | 88ec4d3f5b159375fbc43cf004fe741974686713 | [] | no_license | Gurke1993/Sellchest | a3d23bcced9d7ec21762165f0a966f31f41dc0db | 35dbff343e34ec303256579bde86c55bcffc1e04 | refs/heads/master | 2021-01-02T09:44:05.284977 | 2014-02-23T15:35:46 | 2014-02-23T15:35:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,344 | java | package de.hotmail.gurkilein.sellchest;
import java.text.DecimalFormat;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.block.BlockState;
import org.bukkit.block.Chest;
import org.bukkit.block.Sign;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.inventory.InventoryDragEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;
public class SellchestPlayerListener
implements Listener
{
public double stacksell(Player p, ItemStack stack) {
for (int j = 0; j < Sellchest.priceArray.length; j++) {
String priceArrayLine = (String) Sellchest.priceArray[j];
if (stack != null) {
Integer id = Integer.valueOf(stack.getTypeId());
Integer amount = Integer.valueOf(stack.getAmount());
if (id.toString().equals(priceArrayLine.split("=")[0].split(":")[0]))
{
Integer data;
if (!priceArrayLine.split("=")[0].split(":")[0].equals(priceArrayLine.split("=")[0]))
data = new Integer(priceArrayLine.split("=")[0].split(":")[1]);
else {
data = null;
}
if ((data == null) || (stack.getDurability() == data.intValue())) {
return new Double(priceArrayLine.split("=")[1]).doubleValue() * amount.intValue();
}
}
}
}
return -1;
}
public void chestsell(Player p, Inventory inv)
{
Double betrag = Double.valueOf(0.0D);
for (int i = 0; i < inv.getSize(); i++) {
ItemStack stack = inv.getItem(i);
double result = stacksell(p, stack);
if (!(result == -1)) {
inv.clear(i);
betrag = betrag + result;
}
}
DecimalFormat df = new DecimalFormat("#0.00");
String betragstring = df.format(betrag);
betrag = Double.valueOf(Double.parseDouble(betragstring));
p.sendMessage(Sellchest.success + " " + betrag);
Sellchest.econ.depositPlayer(p.getName(), betrag.doubleValue());
}
public boolean chestsell(Player p, ItemStack stack) {
double betrag = stacksell(p, stack);
if (!(betrag == -1)) {
DecimalFormat df = new DecimalFormat("#0.00");
String betragstring = df.format(betrag);
betrag = Double.valueOf(Double.parseDouble(betragstring));
p.sendMessage(Sellchest.success + " " + betrag);
Sellchest.econ.depositPlayer(p.getName(), betrag);
}
return !(betrag == -1);
}
@EventHandler
public void onklick(PlayerInteractEvent event) throws Exception
{
if (Sellchest.fastsell) return;
Player p = event.getPlayer();
Block sb = event.getClickedBlock();
if (event.getAction() == Action.RIGHT_CLICK_BLOCK && sb != null && sb.getRelative(BlockFace.DOWN) instanceof Chest) {
Inventory inv = ((Chest)sb.getRelative(BlockFace.DOWN)).getBlockInventory();
chestSellTry(p, inv, sb);
}
}
@EventHandler
public void onItemPut(InventoryDragEvent event) {
if (!Sellchest.fastsell) return;
Player p = (Player) event.getWhoClicked();
InventoryHolder ih = (InventoryHolder)event.getInventory().getHolder();
if (ih instanceof Chest) {
Block b = ((BlockState)ih).getBlock();
if (chestSellTry(p, event.getCursor(), b)) {
event.setCursor(new ItemStack (Material.AIR));
}
}
}
private boolean chestSellTry(Player p, ItemStack stack, Block sb) {
BlockState bs = sb.getState();
if (bs instanceof Sign && ((Sign) bs).getLine(0).contains(Sellchest.signtag)) {
if (Sellchest.perms.has(p, "sellchest.use")) {
chestsell(p, stack);
return true;
} else {
p.sendMessage(Sellchest.disallow);
return false;
}
}
return false;
}
private boolean chestSellTry(Player p, Inventory inv, Block sb) {
BlockState bs = sb.getState();
if (bs instanceof Sign && ((Sign) bs).getLine(0).contains(Sellchest.signtag)) {
if (Sellchest.perms.has(p, "sellchest.use")) {
chestsell(p, inv);
return true;
} else {
p.sendMessage(Sellchest.disallow);
return false;
}
}
return false;
}
} | [
"[email protected]"
] | |
dd2c0182a3c2d2a3fdad4ce9edd25d28d44adf9b | c9791dc96fb2f685583dfdafd3c97cb5c0605a61 | /src/main/java/nl/UnderKoen/UnderBot/music/TrackScheduler.java | bfd3eb5c42d5ed6d5515fd3828f2ad5184d07556 | [] | no_license | UnderKoen/UnderBot-JDA | 59022cc1131b7cbb35c3fe868b685e413f57a3e8 | 91f5fd45d0a68df20011a33a4526790fcb04c21d | refs/heads/master | 2021-08-16T22:48:36.990416 | 2017-11-20T12:56:08 | 2017-11-20T12:56:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,940 | java | package nl.underkoen.underbot.music;
import com.sedmelluq.discord.lavaplayer.player.AudioPlayer;
import com.sedmelluq.discord.lavaplayer.player.event.AudioEventAdapter;
import com.sedmelluq.discord.lavaplayer.track.AudioTrack;
import com.sedmelluq.discord.lavaplayer.track.AudioTrackEndReason;
import nl.underkoen.underbot.entities.CommandContext;
import nl.underkoen.underbot.music.commands.NextCommand;
import nl.underkoen.underbot.utils.Messages.TextMessage;
;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
/**
* Created by Under_Koen on 10-05-17.
*/
public class TrackScheduler extends AudioEventAdapter {
private final AudioPlayer player;
private final BlockingQueue<AudioTrack> queue;
public TrackScheduler(AudioPlayer player) {
this.player = player;
this.queue = new LinkedBlockingQueue<>();
}
public AudioTrack[] getQueue() {
return queue.toArray(new AudioTrack[0]);
}
public void queue(AudioTrack track, CommandContext context) {
if (player.getPlayingTrack() == defaultTrack && defaultTrack != null) {
player.startTrack(null, false);
}
if (!player.startTrack(track, true)) {
queue.offer(track);
new TextMessage().setMention(context.getMember()).addText("Queued [" + track.getInfo().title + "](" + track.getInfo().uri + ") as " + queue.size() + "th").sendMessage(context.getChannel());
} else {
new TextMessage().setMention(context.getMember()).addText("Started playing [" + track.getInfo().title + "](" + track.getInfo().uri + ")").sendMessage(context.getChannel());
}
}
public void clearQueue() {
queue.clear();
}
public AudioTrack defaultTrack;
public void setDefault(AudioTrack defaultTrack) {
this.defaultTrack = defaultTrack;
}
public void nextTrack() {
if (queue.isEmpty() && defaultTrack == null && player.getPlayingTrack() == null) return;
AudioTrack track;
if (queue.isEmpty() && defaultTrack != null) {
track = defaultTrack.makeClone();
defaultTrack = track;
player.startTrack(track, true);
} else {
track = queue.poll();
}
player.startTrack(track, false);
if (track != null) {
new TextMessage().addText("Started playing [" + track.getInfo().title + "](" + track.getInfo().uri + ")").sendMessage(MusicHandler.channel);
}
}
@Override
public void onTrackEnd(AudioPlayer player, AudioTrack track, AudioTrackEndReason endReason) {
NextCommand.votes.clear();
if (endReason.mayStartNext && (!queue.isEmpty() || defaultTrack != null)) {
nextTrack();
}
}
public void setPause(boolean bool) {
player.setPaused(bool);
}
public boolean isPaused() {
return player.isPaused();
}
}
| [
"[email protected]"
] | |
8ccd0934e6e1b6ea96191227be3fbb50ef183423 | 49256f0f3eb1f9dd55927e5afb80a49d7b111506 | /hrm_sysmanage_parent/hrm_sysmanage_interface/src/main/java/com/xue/hrm/query/TenantTypeQuery.java | a07265126ac7cff60113eaf3148de39ab7f0fc61 | [] | no_license | xuemingxin520184/hrm_parent | 55f3dee3af0969f39ba2c3208bc8d59c6461da46 | b3a585f7794b91d56455c24bced6bb3b50792243 | refs/heads/master | 2021-06-19T01:00:54.482661 | 2019-09-06T09:54:33 | 2019-09-06T09:54:33 | 205,804,497 | 0 | 0 | null | 2021-04-26T19:29:31 | 2019-09-02T07:51:16 | Java | UTF-8 | Java | false | false | 125 | java | package com.xue.hrm.query;
/**
*
* @author xue
* @since 2019-09-02
*/
public class TenantTypeQuery extends BaseQuery{
} | [
"[email protected]"
] | |
adce1788cda26de774454c25f3f49b1c4289b49c | c2a305cdfc00664e504eba6f08346338211a621a | /static/ITargetDetail0201Dao.java | dbe02d647db7ad74a4036d770733488a49d15254 | [] | no_license | muyingzhi/targetSql | a84569faebfe9685a16e597ff3a7092125c9cc1b | 96c0e9767a246649bf53ef914a0f16f9a48a1cf8 | refs/heads/main | 2023-02-23T15:58:33.511081 | 2021-01-27T00:57:08 | 2021-01-27T00:57:08 | 333,082,603 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 238 | java | package com.tianjian.ods.dao.targetdetails;
import org.springframework.stereotype.Component;
/**
* @Author: muyz
* @Date:Created in 2018/5/11
*/
@Component
public interface ITargetDetail0201Dao extends ITargetDetailDao{
} | [
"[email protected]"
] | |
beb5fe6a30decd72071d99fe926cc128c16b78e5 | bf2966abae57885c29e70852243a22abc8ba8eb0 | /aws-java-sdk-mediaconvert/src/main/java/com/amazonaws/services/mediaconvert/model/Eac3AtmosMeteringMode.java | b2d787783371934033f9ddfce9d5a12a5ffad11a | [
"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 | 1,997 | 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.mediaconvert.model;
import javax.annotation.Generated;
/**
* Choose how the service meters the loudness of your audio.
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public enum Eac3AtmosMeteringMode {
LEQ_A("LEQ_A"),
ITU_BS_1770_1("ITU_BS_1770_1"),
ITU_BS_1770_2("ITU_BS_1770_2"),
ITU_BS_1770_3("ITU_BS_1770_3"),
ITU_BS_1770_4("ITU_BS_1770_4");
private String value;
private Eac3AtmosMeteringMode(String value) {
this.value = value;
}
@Override
public String toString() {
return this.value;
}
/**
* Use this in place of valueOf.
*
* @param value
* real value
* @return Eac3AtmosMeteringMode corresponding to the value
*
* @throws IllegalArgumentException
* If the specified value does not map to one of the known values in this enum.
*/
public static Eac3AtmosMeteringMode fromValue(String value) {
if (value == null || "".equals(value)) {
throw new IllegalArgumentException("Value cannot be null or empty!");
}
for (Eac3AtmosMeteringMode enumEntry : Eac3AtmosMeteringMode.values()) {
if (enumEntry.toString().equals(value)) {
return enumEntry;
}
}
throw new IllegalArgumentException("Cannot create enum from " + value + " value!");
}
}
| [
""
] | |
1d03da3869209d10afda571a688786c6ffa0fa29 | abd7251866fe60dbfeb591bda3355b2f9ec4eae0 | /SpotifyAPIDemo/app/src/main/java/com/example/spotifyapidemo/MainActivity.java | 553a161b8bf02f9ca847bb37af72d3ed7d5dca6e | [] | no_license | CodeNextAdmin/AndroidApps | b5bc387c079780489ae3c4502f59e4ae0b6e28c1 | bcb12f40b6d7ad056efe171f3a517025fb5f4aa8 | refs/heads/master | 2022-04-19T09:29:28.891574 | 2020-03-09T17:44:56 | 2020-03-09T17:44:56 | 418,682,094 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 340 | java | package com.example.spotifyapidemo;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
| [
"[email protected]"
] | |
7c8e9565395f37bdeff19f190cfb83e4c33897e9 | 0638d3dd96bf3ba3f042ab6a47c8057005776875 | /src/test/java/test/ContactManagerImplTest.java | 64de2e7b0a1b0f2c55d9b700b66ab565c6755380 | [] | no_license | meparle/cw-cm | ce6dfaee926618ea4f238097eee1c70c93d40aeb | 518bc3236a55c5f209bd4e13079595b1b2929c5f | refs/heads/master | 2021-03-30T17:58:48.081545 | 2017-05-13T21:01:10 | 2017-05-13T21:01:10 | 83,554,531 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 14,605 | java | package test;
import impl.ContactImpl;
import impl.ContactManagerImpl;
import impl.FutureMeetingImpl;
import org.junit.Test;
import spec.*;
import java.io.File;
import java.util.Calendar;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import static org.junit.Assert.*;
/**
* @author Eileen Parle
*/
public class ContactManagerImplTest {
@Test
public void test_addNewFutureMeetingUnknownContact() {
Calendar cal = Calendar.getInstance();
cal.add(Calendar.MONTH, 1);
ContactManagerImpl cmi = new ContactManagerImpl();
try {
Set<Contact> contacts = new HashSet<>();
cmi.addFutureMeeting(contacts, cal);
cmi.getContacts(-1);
fail();
} catch (IllegalArgumentException ignored) {
}
}
@Test
public void test_addNewFutureMeetinginPast() {
Calendar cal = Calendar.getInstance();
cal.add(Calendar.MONTH, -1);
ContactManagerImpl cmi = new ContactManagerImpl();
try {
Set<Contact> contacts = new HashSet<>();
cmi.addFutureMeeting(contacts, cal);
fail();
} catch (IllegalArgumentException ignored) {
}
}
@Test
public void test_getPastMeeting() {
Calendar cal = Calendar.getInstance();
cal.add(Calendar.MONTH, -1);
ContactManagerImpl cmi = new ContactManagerImpl();
int cid = cmi.addNewContact("Bob", "Notes");
Set<Contact> contacts = cmi.getContacts(cid);
int id = cmi.addNewPastMeeting(contacts, cal, "Haha business!");
String output = cmi.getPastMeeting(id).getNotes();
String expected = "Haha business!";
assertEquals(output, expected);
}
@Test
public void test_getPastMeetingInFuture() {
Calendar cal = Calendar.getInstance();
cal.add(Calendar.MONTH, 1);
ContactManagerImpl cmi = new ContactManagerImpl();
try {
Set<Contact> contacts = new HashSet<>();
cmi.addNewPastMeeting(contacts, cal,"asdfjkl");
fail();
} catch (IllegalArgumentException ignored) {
}
}
@Test
public void test_getFutureMeeting() {
Calendar expected = Calendar.getInstance();
expected.add(Calendar.MONTH, 11);
ContactManagerImpl cmi = new ContactManagerImpl();
int cid = cmi.addNewContact("Humphrey", "A real gentleman");
Set<Contact> contacts = cmi.getContacts(cid);
int mid = cmi.addFutureMeeting(contacts, expected);
Calendar output = cmi.getFutureMeeting(mid).getDate();
expected.add(Calendar.MONTH, 11);
assertEquals(output, expected);
}
@Test
public void test_getMeetingPast() {
ContactManagerImpl cmi = new ContactManagerImpl();
Calendar cal = Calendar.getInstance();
cal.add(Calendar.MONTH, -1);
Set<Contact> contacts;
int cid = cmi.addNewContact("Humphrey", "A real gentleman");
contacts = cmi.getContacts(cid);
int mid = cmi.addNewPastMeeting(contacts, cal, "Good synergy");
Set <Contact> output = cmi.getMeeting(mid).getContacts();
Set <Contact> expected = contacts;
assertEquals(output, expected);
}
@Test
public void test_getMeetingFuture() {
ContactManagerImpl cmi = new ContactManagerImpl();
Calendar cal = Calendar.getInstance();
cal.add(Calendar.MONTH, 1);
Set<Contact> contacts;
int cid = cmi.addNewContact("Humphrey", "A real gentleman");
contacts = cmi.getContacts(cid);
int mid = cmi.addFutureMeeting(contacts, cal);
Set <Contact> output = cmi.getMeeting(mid).getContacts();
Set <Contact> expected = contacts;
assertEquals(output, expected);
}
@Test
public void test_getMeetingListOnNull() {
try {
ContactManagerImpl cmi = new ContactManagerImpl();
cmi.getMeetingListOn(null);
fail("Expected exception.");
}
catch (NullPointerException ignored) {
}
}
@Test
public void test_getMeetingListOn() {
ContactManagerImpl cmi = new ContactManagerImpl();
Calendar cal = Calendar.getInstance();
cal.add(Calendar.MONTH, -1);
Calendar cal2 = Calendar.getInstance();
cal2.add(Calendar.MONTH, -2);
int cid = cmi.addNewContact("Walter","A grumpy old man");
int cid2 = cmi.addNewContact("Orson","Rosebud");
cmi.addNewPastMeeting(cmi.getContacts(cid), cal, "Grumpier");
cmi.addNewPastMeeting(cmi.getContacts(cid2), cal, "Bobo");
cmi.addNewPastMeeting(cmi.getContacts(cid,cid2), cal2, "What a twist!");
List<Meeting> list = cmi.getMeetingListOn(cal);
assertEquals(2, list.size());
for (Meeting x : list) {
assertTrue(cal.equals(x.getDate()));
Set<Contact> actual = cmi.getContacts(cid, cid2);
Set<Contact> expected = x.getContacts();
assertTrue(compareContacts(actual,expected));
}
}
@Test
public void test_getFutureMeetingList() {
ContactManagerImpl cmi = new ContactManagerImpl();
Calendar cal = Calendar.getInstance();
cal.add(Calendar.MONTH, 1);
Calendar cal2 = Calendar.getInstance();
cal2.add(Calendar.MONTH, 2);
Set<Contact> contacts;
int cid = cmi.addNewContact("Walter","A grumpy old man");
cmi.addFutureMeeting(cmi.getContacts(cid), cal);
cmi.addFutureMeeting(cmi.getContacts(cid), cal2);
contacts = cmi.getContacts(cid);
Contact[] person = contacts.toArray(new Contact[1]);
List <Meeting> list = cmi.getFutureMeetingList(person[0]);
assertEquals(2, list.size());
assertEquals(cal, list.get(0).getDate());
assertEquals(cal2, list.get(1).getDate());
for (Meeting x : list) {
assertTrue(cal.equals(x.getDate()) || cal2.equals(x.getDate()));
}
assertTrue (list.get(0).getDate().before(list.get(1).getDate()));
}
@Test
public void test_getPastMeetingListFor() {
ContactManagerImpl cmi = new ContactManagerImpl();
Calendar cal = Calendar.getInstance();
cal.add(Calendar.MONTH, -1);
Set<Contact> contacts;
int cid = cmi.addNewContact("Walter","A grumpy old man");
cmi.addNewPastMeeting(cmi.getContacts(cid), cal,"Meeting 1");
cmi.addNewPastMeeting(cmi.getContacts(cid), cal,"Meeting 2");
contacts = cmi.getContacts(cid);
Contact[] person = contacts.toArray(new Contact[1]);
List<PastMeeting> list = cmi.getPastMeetingListFor(person[0]);
assertEquals(2, list.size());
for (PastMeeting x : list) {
assertTrue("Meeting 1".equals(x.getNotes()) || "Meeting 2".equals(x.getNotes()));
}
}
@Test
public void test_getPastMeetingListForNull() {
try {
ContactManagerImpl cmi = new ContactManagerImpl();
cmi.getPastMeetingListFor(null);
fail("Expected exception.");
}
catch (NullPointerException ignored) {
}
}
@Test
public void test_addNewPastMeetingInFuture() {
Calendar cal = Calendar.getInstance();
cal.add(Calendar.MONTH, 1);
ContactManagerImpl cmi = new ContactManagerImpl();
try {
Set<Contact> contacts = new HashSet<>();
cmi.addNewPastMeeting(contacts, cal,"asdfjkl");
fail();
} catch (IllegalArgumentException ignored) {
}
}
@Test
public void test_addMeetingNotes() {
ContactManagerImpl cmi = new ContactManagerImpl();
Calendar date = Calendar.getInstance();
date.add(Calendar.MONTH, -1);
int cid = cmi.addNewContact("Norma", "I'm ready for my close-up");
Set<Contact> contacts = cmi.getContacts(cid);
int mid = cmi.addNewPastMeeting(contacts, date, "I am big");
String notes = "It's the pictures that got small";
PastMeeting pastMeeting = cmi.addMeetingNotes(mid, notes);
assertEquals("I am big,It's the pictures that got small", pastMeeting.getNotes());
}
@Test
public void test_addMeetingNotesNull() {
ContactManagerImpl cmi = new ContactManagerImpl();
Calendar date = Calendar.getInstance();
date.add(Calendar.MONTH, -1);
int cid = cmi.addNewContact("Norma", "I'm ready for my close-up");
Set<Contact> contacts = cmi.getContacts(cid);
int mid = cmi.addNewPastMeeting(contacts, date, "I am big");
try {
PastMeeting pastMeeting = cmi.addMeetingNotes(mid, null);
fail();
} catch (NullPointerException ignored){
}
try {
PastMeeting pastMeeting = cmi.addMeetingNotes(1000,"It's the pictures that got small");
fail();
} catch (IllegalArgumentException ignored) {
}
}
@Test
public void test_addMeetingNotesFutureInPast() {
ContactManagerImpl cmi = new ContactManagerImpl();
Calendar date = Calendar.getInstance();
date.add(Calendar.DATE,1);
int cid = cmi.addNewContact("Norma", "I'm ready for my close-up");
Set<Contact> contacts = cmi.getContacts(cid);
int mid = cmi.addFutureMeeting(contacts, date);
FutureMeetingImpl theMeeting = (FutureMeetingImpl) cmi.getFutureMeeting(mid);
Calendar pastDate = Calendar.getInstance();
pastDate.add(Calendar.DATE,-1);
theMeeting.setDateForTest(pastDate);
//change date of meeting to past? access future meetings and add without using method that throws error?
String notes = "I am big,It's the pictures that got small";
PastMeeting pastMeeting = cmi.addMeetingNotes(mid, notes);
assertEquals("I am big,It's the pictures that got small", pastMeeting.getNotes());
}
@Test
public void test_addNewContactNulls() {
try {
ContactManagerImpl cmi =new ContactManagerImpl();
cmi.addNewContact(null,null);
fail("Expected exception.");
} catch (NullPointerException ignored) {
}
}
@Test
public void test_addNewContactEmpties() {
try {
ContactManagerImpl cmi =new ContactManagerImpl();
cmi.addNewContact("","");
fail("Expected exception.");
} catch (IllegalArgumentException ignored) {
}
}
@Test
public void test_addNewContact() {
ContactManagerImpl cmi = new ContactManagerImpl();
String name = "Charlie";
String notes = "Enjoys slapstick.";
int output = cmi.addNewContact(name, notes);
name = "Humphrey";
notes = "A real gentleman";
int expected = cmi.addNewContact(name, notes);
assertNotEquals(expected, output);
}
@Test
public void test_getContactsById() {
ContactManagerImpl cmi = new ContactManagerImpl();
int id = cmi.addNewContact("Bob","A capital fellow");
cmi.addNewContact("Walter","A grumpy old man");
cmi.addNewContact("Marilyn","A successful lady");
cmi.addNewContact("Bob","This is the other Bob");
Set<Contact> output = cmi.getContacts(id);
assertEquals(1, output.size());
}
@Test
public void test_getContactsByIds() {
ContactManagerImpl cmi = new ContactManagerImpl();
int id1 = cmi.addNewContact("Bob","A capital fellow");
int id2 = cmi.addNewContact("Walter","A grumpy old man");
cmi.addNewContact("Marilyn","A successful lady");
cmi.addNewContact("Bob","This is the other Bob");
Set<Contact> output = cmi.getContacts(id1,id2);
assertEquals(2, output.size());
}
@Test
public void test_GetContactsByName() {
ContactManagerImpl cmi = new ContactManagerImpl();
int id1 = cmi.addNewContact("Bob","A capital fellow");
int id2 = cmi.addNewContact("Bob","This is the other Bob");
cmi.addNewContact("Walter","A grumpy old man");
int id4 = cmi.addNewContact("Boberta","A successful lady");
Set<Contact> actual = cmi.getContacts("Bob");
Set<Contact> expected = new HashSet<>();
expected.add(new ContactImpl(id1,"Bob","A capital fellow"));
expected.add(new ContactImpl(id2,"Bob","This is the other Bob"));
expected.add(new ContactImpl(id4,"Boberta","A successful lady"));
assertTrue(compareContacts(actual,expected));
}
@Test
public void test_flush() {
String fileNameM = "/tmp/ContactManagerMeetings.csv";
String fileNameC = "/tmp/ContactManagerContacts.csv";
try {
ContactManager cmi = ContactManagerImpl.fromFiles(fileNameM, fileNameC);
int cid = cmi.addNewContact("Bob", "A capital fellow");
Set<Contact> contacts = cmi.getContacts(cid);
Calendar date = Calendar.getInstance();
date.add(Calendar.DATE, 1);
int mid = cmi.addFutureMeeting(contacts, date);
cmi.flush();
ContactManager cmiAgain = ContactManagerImpl.fromFiles(fileNameM, fileNameC);
Contact bobHope = cmiAgain.getContacts(cid).toArray(new Contact[1])[0];
assertEquals("Bob", bobHope.getName());
assertEquals("A capital fellow", bobHope.getNotes());
FutureMeeting theShow = cmiAgain.getFutureMeeting(mid);
Set<Contact> person = theShow.getContacts();
Contact fellow = person.toArray(new Contact[1])[0];
assertTrue(ContactManagerImpl.sameDate(date, theShow.getDate()));
assertEquals("Bob", fellow.getName());
} finally {
new File(fileNameC).delete();
new File(fileNameM).delete();
}
}
private static boolean compareContacts(Set<Contact> first, Set<Contact> second) {
boolean nameresult = false;
boolean notesresult = false;
boolean result = false;
for (Contact x : first) {
int cid = x.getId();
for (Contact y : second) {
if (y.getId() == cid) {
if (x.getName().equals(y.getName())) {
nameresult = true;
}
if (x.getNotes().equals(y.getNotes())) {
notesresult = true;
}
}
}
}
if (nameresult == notesresult) {
result = true;
}
return result;
}
}
| [
"[email protected]"
] | |
1355cd79516cdaa872e0fa5108ff3c4a910fdf77 | 4e13ee555b5dcdd5f1bc5157a7f78ebb845af620 | /src/main/java/netgloo/models/StatusDao.java | 4ba5c128bab2114df019fcda5677cfbb0cf54f9b | [] | no_license | MenghanC/excitedTeamSystemBack | ac3bb47dd26cd2871f3296031a52f5dec011a846 | de930d27ba0c3cfd85a0213e63f42a78bb2565e9 | refs/heads/master | 2021-01-13T09:12:45.681787 | 2016-09-25T18:58:08 | 2016-09-25T18:58:08 | 69,129,548 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 198 | java | package netgloo.models;
import org.springframework.data.repository.CrudRepository;
/**
* Created by Menghan on 2016-09-24.
*/
public interface StatusDao extends CrudRepository<Status, Long> {
}
| [
"[email protected]"
] | |
b4c5d9f113c50596b48de7c983583121ec0ebf8e | bbfa56cfc81b7145553de55829ca92f3a97fce87 | /plugins/org.ifc4emf.metamodel.ifc/src/IFC2X3/jaxb/IfcPresentationLayerAssignmentRefAdapter.java | 099125412df6477300597116e2cefcc3b586eeff | [] | no_license | patins1/raas4emf | 9e24517d786a1225344a97344777f717a568fdbe | 33395d018bc7ad17a0576033779dbdf70fa8f090 | refs/heads/master | 2021-08-16T00:27:12.859374 | 2021-07-30T13:01:48 | 2021-07-30T13:01:48 | 87,889,951 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 277 | java | package IFC2X3.jaxb;
import org.eclipse.emf.ecore.jaxb.EObjectRefAdapter;
import IFC2X3.IfcPresentationLayerAssignment;
public class IfcPresentationLayerAssignmentRefAdapter extends EObjectRefAdapter<IfcPresentationLayerAssignmentRef,IfcPresentationLayerAssignment> {
} | [
"patins@f81cfaeb-dc96-476f-bd6d-b0d16e38694e"
] | patins@f81cfaeb-dc96-476f-bd6d-b0d16e38694e |
89cf0f47fa12639750e093035175df4e85985aef | 6af7f5a3126e143ed6c43512a46852368fc2e732 | /src/blueWater_java_src/Rest_Test_Main.java | 97af01d4f7f148ec4161f2f4d81401cca690fdeb | [
"Apache-2.0"
] | permissive | sandeep-iitr/BlueWater_REST_API_DEMO | 2e430931dacb7f91d96184654b94cb03f02211e3 | 38681629dfbeb0405c4ae2f5fff78ab6fb59bbc6 | refs/heads/master | 2020-12-31T06:56:51.226511 | 2017-02-01T00:03:49 | 2017-02-01T00:03:49 | 80,573,965 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,873 | java | /*
* Developers:
* Sandeep Singh Sandha (UCLA: [email protected])
* Biplav Srivastava (IBM Research: [email protected])
*
* Testing the BlueWater Rest API
* BlueWater details: http://researcher.watson.ibm.com/researcher/view_group.php?id=6924
* REST API details: http://researcher.watson.ibm.com/researcher/view_group_subpage.php?id=7142
*
* This code released on: 31-Jan-2017
*/
package blueWater_java_src;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
public class Rest_Test_Main
{
static String REST_URL = "https://bluewater.mybluemix.net/query?";
/*This license key is only for testing purpose, generate your license key online at the below link
* https://bluewater.mybluemix.net/license.jsp
* */
static String Lic_key="Lic=6VM2RzakD9";
public static void main(String[] args)
{
/*testing the spatial query*/
spatial_query();
/*testing the meta data query*/
meta_places_query();
}//end main
/*Parameters to the REST include:
* Latitude
* Longitude
* Range (in meters)
* License key
* */
static void spatial_query()
{
String query_par="Latitude=28.959731&Longitude=77.4782&Range=100&";
String query_url=REST_URL+query_par+Lic_key;
try
{
URL url = new URL(query_url);
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("GET");
con.getResponseCode();
BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
String output;
StringBuffer response = new StringBuffer();
while ((output = in.readLine()) != null) {
response.append(output);
}
in.close();
System.out.println("Spatial URL:"+query_url);
System.out.println("Spatial Response: "+response.toString());
}
catch(Exception e)
{
e.printStackTrace();
}
}//end spatial_query
/*Parameters to the REST include:
* Places-By-User (user id)
* Place-Type (manual or auto)
* License key
* */
static void meta_places_query()
{
String query_par="Places-By-User=ibmadmin&Place-Type=manual&";
String query_url=REST_URL+query_par+Lic_key;
try
{
URL url = new URL(query_url);
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("GET");
con.getResponseCode();
BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
String output;
StringBuffer response = new StringBuffer();
while ((output = in.readLine()) != null) {
response.append(output);
}
in.close();
System.out.println("Meta URL:"+query_url);
System.out.println("Meta Response: "+response.toString());
}
catch(Exception e)
{
e.printStackTrace();
}
}//end meta_places_query
}//end Rest_Test_Main
| [
"[email protected]"
] | |
80ec46cd4d0eb8daef4bf6779ca9f85f741f6449 | 284d793c198477f04b7bd67ae728455b5cc3a487 | /showcase-sdk-java-core/src/test/java/com/geekidentity/showcase/sdk/core/User.java | 57f3e10b96de575a36cdacfd4b5201484d0667b8 | [] | no_license | geekidentity/showcase-sdk-java | 66f6b3dcb367b0b462e984939fa760d6e455844e | 749069a3a91637c604a316cf11de9f60d183552f | refs/heads/master | 2023-08-22T22:11:04.454796 | 2021-03-31T07:38:58 | 2021-03-31T07:38:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 406 | java | package com.geekidentity.showcase.sdk.core;
public class User {
private String name;
private String password;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}
| [
"[email protected]"
] | |
f00ee7b748ef79c4b8046fdb9267d08a4b9d0226 | 0b95ecbb218f7975c96d9cbf3877817c059c1510 | /hybris/bin/custom/tietomerchendise/tietomerchendisefulfilmentprocess/testsrc/com/tieto/tre/tietomerchendise/fulfilmentprocess/test/actions/PrepareOrderForManualCheck.java | 8a3ed6a3eaa088c88fdd4ad144c234e935ad2f02 | [] | no_license | mrlaron/hybrisoms | e197d4f7f70af9f2480527207d57ed05390e341e | 38d6da9a554548713db229f2a5d979544edab7d5 | refs/heads/master | 2021-01-10T06:11:33.393189 | 2015-12-17T19:49:27 | 2015-12-17T19:49:27 | 47,922,051 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 663 | java | /*
* [y] hybris Platform
*
* Copyright (c) 2000-2015 hybris AG
* All rights reserved.
*
* This software is the confidential and proprietary information of hybris
* ("Confidential Information"). You shall not disclose such Confidential
* Information and shall use it only in accordance with the terms of the
* license agreement you entered into with hybris.
*
*
*/
package com.tieto.tre.tietomerchendise.fulfilmentprocess.test.actions;
/**
* Test counterpart for
* {@link com.tieto.tre.tietomerchendise.fulfilmentprocess.actions.order.PrepareOrderForManualCheckAction}
*/
public class PrepareOrderForManualCheck extends TestActionTemp
{
//EMPTY
}
| [
"[email protected]"
] | |
ca3b7ee534f8db4126c38f5f83a070d7e4f21bdc | 34c1a48bafce54972335b08667eb7de9885d6b0c | /app/src/main/java/com/deepak/android/blogboard/AboutActivity.java | efe0f2c0561d7e0b38040b377ec0a9fcbeb814c4 | [] | no_license | git-acc-deepak/BlogBoard | 000019695ea8fd762ee2292a5fcc3ec29c0de65d | bf2a86827468af5757b94a2f9bbcaf3c7e9c7860 | refs/heads/master | 2023-03-03T05:02:51.743071 | 2021-02-16T08:15:19 | 2021-02-16T08:15:19 | 246,766,404 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 584 | java | package com.deepak.android.blogboard;
import android.os.Bundle;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
/**
* purpose of this activity is to display the version and about section of app
*/
public class AboutActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_about);
TextView buildVersion = findViewById(R.id.app_version);
buildVersion.setText(BuildConfig.VERSION_NAME);
}
}
| [
"[email protected]"
] | |
6ae56ab0615fb147f3cf370ca9c1cd9f60d2a06d | 06f724d71da27663056889b56cd4c5d5d7c45ce1 | /src/simulator/model/Invisible.java | a57b03d78b97c1eac68135f34f1ab03e1258e491 | [] | no_license | Jannileutbe/JannickLeutbecherSimulator | eca457e1b91ea3cac330cd4ed1828c91dd3f84c3 | 417fa6b5f0e65cc22b168e406caee20f08597306 | refs/heads/master | 2023-08-25T01:44:47.753865 | 2021-11-01T10:51:48 | 2021-11-01T10:51:48 | 404,318,527 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 383 | java | package simulator.model;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
//Markierung, um bestimmte Mathoden zu markieren, damit sie nicht im Kontextmenü angezeigt werden
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface Invisible {}
| [
"[email protected]"
] | |
fc7c7081f92a4ecf37e24c8a8818750927c77075 | e22f2812bafd96316cab06e28b6c30b7b68254b8 | /src/com/shangde/edu/cou/condition/QueryCourseBeforeTodayCondition.java | a032b133d99fb0cfb03afddd0a77c88c9ee8c18d | [] | no_license | fairyhawk/sedu-Deprecated | e8eafff279e80f6e0d8b06f63b05e34e3c58a3a5 | b42fbbdf2dd5d81cb37f86cdfc31d9ea65d4262b | refs/heads/master | 2021-01-02T22:51:27.188371 | 2014-01-25T10:29:46 | 2014-01-25T10:29:46 | 8,679,673 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 621 | java | package com.shangde.edu.cou.condition;
public class QueryCourseBeforeTodayCondition {
private int cus_id;
private String before_create_time;
private String today_time;
public String getBefore_create_time() {
return before_create_time;
}
public void setBefore_create_time(String before_create_time) {
this.before_create_time = before_create_time;
}
public int getCus_id() {
return cus_id;
}
public void setCus_id(int cus_id) {
this.cus_id = cus_id;
}
public String getToday_time() {
return today_time;
}
public void setToday_time(String today_time) {
this.today_time = today_time;
}
} | [
"[email protected]"
] | |
dc9a226fca15825a9dbeae587e092ff032f8a298 | 5a9b28574d68c47b51734ce4c3152b4747f05adf | /src/main/java/io/impl/CSVReader.java | f3a554fdbb2e82857a242947044d8e3254f11f6e | [] | no_license | RSTq1337/The-Transaction-Analyser | eada71528e299a412fc9f58841532e59f46cf4fa | 638cd4ba381b6b36146e4b97f5f340277f42591a | refs/heads/master | 2022-12-27T07:43:18.322406 | 2020-10-10T12:31:32 | 2020-10-10T12:31:32 | 302,753,214 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,375 | java | package io.impl;
import io.Reader;
import model.Transaction;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
public class CSVReader implements Reader<Transaction> {
@Override
public Map<String, Transaction> read(String path) {
Map<String, Transaction> transactions = new HashMap<>();
ArrayList<String> transactionsToRemove = new ArrayList<>();
try (BufferedReader br = new BufferedReader(new FileReader(path))) {
String line;
br.readLine();
while ((line = br.readLine()) != null) {
Transaction transaction = new Transaction(line.split(","));
if(transaction.getType().equals("REVERSAL")){
transactionsToRemove.add(transaction.getRelatedTransaction());
}
transactions.put(transaction.getId(), transaction);
}
} catch (FileNotFoundException e) {
System.out.println("File not found");
} catch (IOException e) {
System.out.println("Something went wrong while processing file");
}
for (String s : transactionsToRemove) {
transactions.remove(s);
}
return transactions;
}
}
| [
"[email protected]"
] | |
62472d86e13674123c8a550d6e89b8055a5a2c72 | 9cb2656f0131b48bf3c4d2a08ea5d134804ac949 | /game-server/src/main/java/com/rt/gm/execute/AddDiamondGm.java | 26ca12d73caee73c7ad1b691d2ce6df25a05f3f5 | [] | no_license | lxun1214/project | a8795b1b8094c59de9ae17f08b4187e2e1c9118e | 9286bde5d4bc630814517ce5b8f50d268cb713ea | refs/heads/master | 2022-10-20T11:25:38.556682 | 2019-10-28T12:32:39 | 2019-10-28T12:32:39 | 217,891,290 | 0 | 0 | null | 2022-10-04T23:55:59 | 2019-10-27T17:32:44 | JavaScript | UTF-8 | Java | false | false | 331 | java | package com.rt.gm.execute;
import com.rt.gm.AbsGm;
import com.rt.logic.player.CoinConst;
import com.rt.logic.player.IPlayer;
public class AddDiamondGm extends AbsGm{
@Override
public void executor(IPlayer player, String parameter) {
int num = Integer.parseInt(parameter);
player.addDelDiamond(num,CoinConst.GET_GM);
}
}
| [
"[email protected]"
] | |
20263195d3cf0202482d8513b434a458355b0c21 | f697a5b6e0dec9f3a1eaafc7f20fd2899e58230e | /src/main/java/dev/patika/patikahw02/models/VisitingResearcher.java | 500e7fee9a626bf361d2b71d1ac99c33a1cade6b | [
"MIT"
] | permissive | 113-GittiGidiyor-Java-Spring-Bootcamp/second-homework-ctemelkuran | 8e25c5e4a3bf3b8dc09b6b81e1d03655f60dc3a8 | 72065bb25e3e8d0b4bb873cc37943f18fbc915a1 | refs/heads/main | 2023-07-25T23:00:16.365763 | 2021-08-26T12:44:21 | 2021-08-26T12:44:21 | 396,691,509 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 844 | java | package dev.patika.patikahw02.models;
import javax.persistence.Entity;
@Entity
public class VisitingResearcher extends Instructor{
private double hourlySalary;
public VisitingResearcher(String name, String address, String phoneNumber, double hourlySalary) {
super(name, address, phoneNumber);
this.hourlySalary = hourlySalary;
}
public VisitingResearcher(double hourlySalary) {
this.hourlySalary = hourlySalary;
}
public VisitingResearcher() {
}
public double getHourlySalary() {
return hourlySalary;
}
public void setHourlySalary(double hourlySalary) {
this.hourlySalary = hourlySalary;
}
@Override
public String toString() {
return "VisitingResearcher{" +
"hourlySalary=" + hourlySalary +
'}';
}
}
| [
"[email protected]"
] | |
cae75640cc8ad74b57fb88cee080c34644e41ccf | f5f92f3c6c718d35036d32ea59398a0e22f0ec57 | /app/src/main/java/com/example/rafa/chesse_board/model/player/WhitePlayer.java | b71de5234287cadb7a88eaaedc19a42e5c7cfc7f | [] | no_license | rafaoncloud/Chess_Game_Android | 566d9d5a5dbfc3d219a0cef5f7b7540df659b022 | bebeaaf8cc16f69bf03f360a6c480437bc9da277 | refs/heads/master | 2021-09-03T19:51:16.731786 | 2018-01-10T21:40:04 | 2018-01-10T21:40:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,675 | java | package com.example.rafa.chesse_board.model.player;
import com.example.rafa.chesse_board.model.Alliance;
import com.example.rafa.chesse_board.model.board.Board;
import com.example.rafa.chesse_board.model.board.BoardUtils;
import com.example.rafa.chesse_board.model.board.Move;
import com.example.rafa.chesse_board.model.board.Move.KingSideCastleMove;
import com.example.rafa.chesse_board.model.board.Move.QueenSideCastleMove;
import com.example.rafa.chesse_board.model.board.Tile;
import com.example.rafa.chesse_board.model.pieces.Piece;
import com.example.rafa.chesse_board.model.pieces.Rook;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
public final class WhitePlayer extends Player {
public WhitePlayer(final Board board,
final List<Move> whiteStandardLegals,
final List<Move> blackStandardLegals) {
super(board, whiteStandardLegals, blackStandardLegals);
}
@Override
protected Collection<Move> calculateKingCastles(final Collection<Move> playerLegals,
final Collection<Move> opponentLegals) {
if(this.isInCheck() || this.isCastled() || !(this.isKingSideCastleCapable() || this.isQueenSideCastleCapable())) {
return null;
}
final List<Move> kingCastles = new ArrayList<>();
if(this.playerKing.isFirstMove() && this.playerKing.getPiecePosition() == 60 && !this.isInCheck()) {
//whites king side castle
if(!this.board.getTile(61).isTileOccupied() && !this.board.getTile(62).isTileOccupied()) {
final Tile rookTile = this.board.getTile(63);
if(rookTile.isTileOccupied() && rookTile.getPiece().isFirstMove()) {
if(Player.calculateAttacksOnTile(61, opponentLegals).isEmpty() && Player.calculateAttacksOnTile(62, opponentLegals).isEmpty() &&
rookTile.getPiece().getPieceType().isRook()) {
if(!BoardUtils.isKingPawnTrap(this.board, this.playerKing, 52)) {
kingCastles.add(new KingSideCastleMove(this.board, this.playerKing, 62, (Rook) rookTile.getPiece(), rookTile.getTileCoordinate(), 61));
}
}
}
}
//whites queen side castle
if(!this.board.getTile(59).isTileOccupied() && !this.board.getTile(58).isTileOccupied() &&
!this.board.getTile(57).isTileOccupied()) {
final Tile rookTile = this.board.getTile(56);
if(rookTile.isTileOccupied() && rookTile.getPiece().isFirstMove()) {
if(Player.calculateAttacksOnTile(58, opponentLegals).isEmpty() &&
Player.calculateAttacksOnTile(59, opponentLegals).isEmpty() && rookTile.getPiece().getPieceType().isRook()) {
if(!BoardUtils.isKingPawnTrap(this.board, this.playerKing, 52)) {
kingCastles.add(new QueenSideCastleMove(this.board, this.playerKing, 58, (Rook) rookTile.getPiece(), rookTile.getTileCoordinate(), 59));
}
}
}
}
}
return kingCastles;
}
@Override
public BlackPlayer getOpponent() {
return this.board.blackPlayer();
}
@Override
public Collection<Piece> getActivePieces() {
return this.board.getWhitePieces();
}
@Override
public Alliance getAlliance() {
return Alliance.WHITE;
}
@Override
public String toString() {
return Alliance.WHITE.toString();
}
}
| [
"[email protected]"
] | |
e48c7cf07c1cfe8a6dd59ba75e90ae770d558dec | 7f48e1e713a513fff36851300f17152d2eaf159f | /core/src/test/java/org/apache/hop/core/logging/LoggingRegistrySingltonTest.java | 4d35e16fdad5760f951fc232464be4024e04045a | [
"Apache-2.0",
"CC-BY-SA-3.0",
"CC-BY-SA-4.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | HiromuHota/incubator-hop | af414f7a25e1c79a1eecbbd8d44e5730c9d542a5 | 2b159a8477c1e509401f3626940d4b1f700f2584 | refs/heads/web | 2023-04-03T13:09:31.957533 | 2021-04-04T23:44:11 | 2021-04-04T23:44:11 | 311,226,935 | 2 | 1 | Apache-2.0 | 2021-03-01T01:11:28 | 2020-11-09T04:50:08 | Java | UTF-8 | Java | false | false | 3,501 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.hop.core.logging;
import junit.framework.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.powermock.modules.junit4.PowerMockRunner;
import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.Callable;
import java.util.concurrent.CompletionService;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorCompletionService;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
/**
* Note, this test must be run on separate JAVA instance, to be sure
* LoggingRegistry was not already initialized when using differed initialization
* or do initialize immediate in static way.
*/
@RunWith( PowerMockRunner.class )
public class LoggingRegistrySingltonTest {
/**
* Test that LoggingRegistry is concurrent-sage initialized over multiple calls. Creating more than 1000 threads can
* cause significant performance impact.
*
* @throws InterruptedException
* @throws ExecutionException
*/
@Test( timeout = 30000 )
public void testLoggingRegistryConcurrentInitialization() throws InterruptedException, ExecutionException {
CountDownLatch start = new CountDownLatch( 1 );
int count = 10;
CompletionService<LoggingRegistry> drover = registerHounds( count, start );
// fire!
start.countDown();
Set<LoggingRegistry> distinct = new HashSet<>();
int i = 0;
while ( i < count ) {
Future<LoggingRegistry> complete = drover.poll( 15, TimeUnit.SECONDS );
LoggingRegistry instance = complete.get();
distinct.add( instance );
i++;
}
Assert.assertEquals( "Only one singlton instance ;)", 1, distinct.size() );
}
CompletionService<LoggingRegistry> registerHounds( int count, CountDownLatch start ) {
ExecutorService executor = Executors.newFixedThreadPool( count );
CompletionService<LoggingRegistry> completionService = new ExecutorCompletionService<>( executor );
for ( int i = 0; i < count; i++ ) {
LogRegistryKicker hound = new LogRegistryKicker( start );
completionService.submit( hound );
}
return completionService;
}
class LogRegistryKicker implements Callable<LoggingRegistry> {
CountDownLatch start;
LogRegistryKicker( CountDownLatch start ) {
this.start = start;
}
@Override
public LoggingRegistry call() throws Exception {
try {
start.await();
} catch ( InterruptedException e ) {
throw new RuntimeException();
}
return LoggingRegistry.getInstance();
}
}
}
| [
"[email protected]"
] | |
a069737f4f450884387a7269f05ff005c1c8a577 | de75c58f6513c0f78921e5a0879a523c5d528d9c | /build.properties/src/wsl/mdn/html/TitleCell.java | 248e7cac6639f55659f467b0d5c442332e77e6e7 | [] | no_license | Prinz2109/mobiledatanow | 679af56e1809736ee283439db9b74cfa25512ab0 | a792a11b228a85a476c16127aac2a98fdc500cd1 | refs/heads/master | 2021-01-17T13:20:11.589335 | 2009-02-04T04:49:30 | 2009-02-04T04:49:30 | 33,274,021 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,817 | java | /** $Id: TitleCell.java,v 1.3 2002/07/10 23:56:24 jonc Exp $
*
*/
package wsl.mdn.html;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.ecs.*;
import org.apache.ecs.html.*;
import wsl.fw.html.WslHtmlTable;
import wsl.fw.html.WslHtmlUtil;
import wsl.fw.resource.ResId;
import wsl.mdn.server.MdnServer;
public class TitleCell extends MdnClientCell
{
//--------------------------------------------------------------------------
// constants
public final static String DEFAULT_HELP_URL = "/help/mdnhelp.html";
//--------------------------------------------------------------------------
// resources
public static final ResId
TEXT_TITLE = new ResId ("TitleCell.text.Title"),
TEXT_MENU = new ResId ("TitleCell.text.Menu"),
TEXT_LOGOUT = new ResId ("TitleCell.text.Logout"),
TEXT_HELP = new ResId ("TitleCell.text.Help");
//--------------------------------------------------------------------------
// attributes
private A _helpLink;
//--------------------------------------------------------------------------
// construction
/**
* Blank ctor
*/
public
TitleCell (
HttpServletRequest request,
HttpServletResponse response)
{
// build the cell
buildCell (request, response);
}
//--------------------------------------------------------------------------
// cell building
/**
* Build the cell
*/
private void
buildCell (
HttpServletRequest request,
HttpServletResponse response)
{
// constants
final int ROW_HEIGHT = 25;
// cell properties
this.setAlign (AlignType.CENTER);
this.setHeight (50);
// table
WslHtmlTable table = new WslHtmlTable ();
table.setWidth ("100%");
table.setHeight ("100%");
table.setCellPadding (5);
table.setCellSpacing (0);
//table.setBorder (1);
this.addElement (table);
// top row
TD topCell = new TD ();
topCell.setHeight (ROW_HEIGHT);
topCell.setAlign (AlignType.LEFT);
topCell.setColSpan (3);
TR topRow = new TR (topCell);
topRow.setBgColor (org.apache.ecs.HtmlColor.NAVY);
table.addElement (topRow);
Font font = new Font ("sans-serif", HtmlColor.WHITE, 4);
String title = TEXT_TITLE.getText ();
title += " - " + MdnHtmlServlet.TEXT_VERSION.getText () + " "
+ MdnServer.VERSION_NUMBER;
font.addElement (title);
topCell.addElement (font);
// bottom row
TD bottomCell = new TD ();
bottomCell.setHeight (ROW_HEIGHT);
bottomCell.setAlign (AlignType.LEFT);
TR bottomRow = new TR (bottomCell);
bottomRow.setBgColor (org.apache.ecs.HtmlColor.silver);
table.addElement (bottomRow);
// menu link
font = new Font ("sans-serif", HtmlColor.NAVY, 2);
bottomCell.addElement (font);
A link = new A (MdnHtmlServlet.makeHref (response,
MdnHtmlServlet.ACT_SHOWMENU), TEXT_MENU.getText ());
font.addElement (link);
// logout link
bottomCell = new TD ();
bottomCell.setHeight (30);
bottomCell.setAlign (AlignType.CENTER);
bottomRow.addElement (bottomCell);
font = new Font ("sans-serif", HtmlColor.NAVY, 2);
bottomCell.addElement (font);
link = new A (MdnHtmlServlet.makeHref (response,
MdnHtmlServlet.ACT_LOGOUT), TEXT_LOGOUT.getText ());
font.addElement (link);
// help
bottomCell = new TD ();
bottomCell.setHeight (30);
bottomCell.setAlign (AlignType.RIGHT);
bottomRow.addElement (bottomCell);
font = new Font ("sans-serif", HtmlColor.NAVY, 2);
bottomCell.addElement (font);
String url = request.getContextPath () + DEFAULT_HELP_URL;
_helpLink = new A (WslHtmlUtil.esc (url), TEXT_HELP.getText ());
font.addElement (_helpLink);
}
//--------------------------------------------------------------------------
// accessors
/**
* Set the help url
* @param url
*/
public void
setHelpUrl (
String url)
{
_helpLink.setHref (url);
}
}
| [
"nick.mobiledatanow@95061b60-9fd8-11dd-a887-7ffe1a420f8d"
] | nick.mobiledatanow@95061b60-9fd8-11dd-a887-7ffe1a420f8d |
bbddd7b2ed7e468f37965ad9a5f42399308fb926 | 869d6d30ec03d51d1cc9190bb4dbc6df9cc4f3aa | /app/src/main/java/com/keephealth/app/entity/HealthMessage.java | e05a6c1543b65fa249119c40a6a6205a10696015 | [
"Apache-2.0"
] | permissive | jiajia0524/HealthNews | 86f64a66ad02049384375810f8471cb3967ad1a7 | 07404f34486993103aff2d9acda9c61aefb7245f | refs/heads/master | 2020-03-22T16:51:19.559902 | 2017-07-28T03:05:01 | 2017-07-28T03:05:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,543 | java | package com.keephealth.app.entity;
/**
* Created on 2017/6/7.
* author:秦浩雄
* 作用: 健康资讯实体类
*/
public class HealthMessage {
private String href; //文章地址
private String imgurl; //图片地址
private String title; //标题
private String date; //日期
private String click; //点击量
private String evaluate; //评价量
private String intro; //简介
private String id; //编号Id
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getIntro() {
return intro;
}
public void setIntro(String intro) {
this.intro = intro;
}
public String getHref() {
return href;
}
public void setHref(String href) {
this.href = href;
}
public String getImgurl() {
return imgurl;
}
public void setImgurl(String imgurl) {
this.imgurl = imgurl;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
public String getClick() {
return click;
}
public void setClick(String click) {
this.click = click;
}
public String getEvaluate() {
return evaluate;
}
public void setEvaluate(String evaluate) {
this.evaluate = evaluate;
}
}
| [
"[email protected]"
] | |
cb83b991145614e8a3fbfe108c42acbd0937a5df | 32d81b4b9db2b6ea4e5c046688cfa43740500bed | /src/com/netty/io/netty/handler/codec/dns/DnsRecordEncoder.java | 9209e3f8e923cdc2f753f83a0c91c18547525452 | [] | no_license | zymap/zytest | f1ce4cf0e6c735d35f68ea8c89df98ae6d035821 | b8d9eb6cf46490958d20ebb914d543af50d1b862 | refs/heads/master | 2021-04-03T01:15:30.946483 | 2018-03-24T14:10:57 | 2018-03-24T14:10:57 | 124,623,152 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,643 | java | /*
* Copyright 2015 The Netty Project
*
* The Netty Project licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package com.netty.io.netty.handler.codec.dns;
import io.netty.buffer.ByteBuf;
import io.netty.handler.codec.dns.DatagramDnsQueryEncoder;
import io.netty.handler.codec.dns.DefaultDnsRecordEncoder;
import io.netty.handler.codec.dns.DnsQuestion;
import io.netty.handler.codec.dns.DnsRecord;
import io.netty.util.internal.UnstableApi;
/**
* Encodes a {@link DnsRecord} into binary representation.
*
* @see DatagramDnsQueryEncoder
*/
@UnstableApi
public interface DnsRecordEncoder {
io.netty.handler.codec.dns.DnsRecordEncoder DEFAULT = new DefaultDnsRecordEncoder();
/**
* Encodes a {@link DnsQuestion}.
*
* @param out the output buffer where the encoded question will be written to
*/
void encodeQuestion(DnsQuestion question, ByteBuf out) throws Exception;
/**
* Encodes a {@link DnsRecord}.
*
* @param out the output buffer where the encoded record will be written to
*/
void encodeRecord(DnsRecord record, ByteBuf out) throws Exception;
}
| [
"[email protected]"
] | |
e52cc4bc5731801868ea09f312e069fbb07a49b7 | f3aaffdb149f472a39d135ffcd7a5ada737f6310 | /businessServer/src/main/java/com/hcttest/server/model/request/GetItemCFMoviesRequest.java | e2e461adace1978539f391c8ea90d54a19ac1de8 | [] | no_license | hct951214/software | c16d0e5c3b7abec630c94f6cbb8e81b9b3130204 | c9c92a89055b2ef10fee7a62b25fc730e7a6d10a | refs/heads/master | 2020-04-07T16:56:51.599480 | 2018-11-28T05:09:03 | 2018-11-28T05:09:03 | 158,549,923 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 472 | java | package com.hcttest.server.model.request;
public class GetItemCFMoviesRequest {
private int mid;
private int num;
public GetItemCFMoviesRequest(int mid, int num) {
this.mid = mid;
this.num = num;
}
public int getNum() {
return num;
}
public void setNum(int num) {
this.num = num;
}
public int getMid() {
return mid;
}
public void setMid(int mid) {
this.mid = mid;
}
}
| [
"[email protected]"
] | |
25dd4fe4210a912872597f365a10712d9f497046 | 4fa838896a247e5e5734a0c4bb7b7c17d572f337 | /computer-database-service/src/main/java/com/excilys/cdb/service/ICompanyService.java | a87584da57977757e26458355598873377cebfbc | [] | no_license | NicolasThierion/computer-database | bf2365f41ffa47a6c6b048be1617863fad5b455a | 90439b670ce190abc0204922decf9ef2a433e18f | refs/heads/master | 2016-09-06T03:46:10.588972 | 2015-04-30T10:08:45 | 2015-04-30T10:08:45 | 32,085,550 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,587 | java | package com.excilys.cdb.service;
import java.util.List;
import java.util.NoSuchElementException;
import com.excilys.cdb.model.Company;
/**
*
* @author Nicolas THIERION
* @version 0.3.0
*/
public interface ICompanyService extends ICrudService<Long, Company> {
@Override
default List<Company> listByName() {
return listByName(0, Integer.MAX_VALUE);
}
/**
* List companies with name matching given 'name' parameter. Order results
* by name.
*
* @param offset
* Search offset.
* @param nb
* Number of results to fetch. Set a negative value for unbounded
* search.
* @param name
* Company name to search for, non case sensitive.
* @throw IllegalArgumentException if name is invalid (ie : empty) or if
* search offset is negative
* @return the list of results.
*/
@Override
List<Company> listLikeName(int offset, int count, String name);
/**
* Adds the company to DB, provided that this company doesn't exist already.
* Calling this method will assign a new "company id" to the company.
* Company will receive a new Id if adding succeed.
*
* @param company
* Company to add.
* @return the added company.
* @throw IllegalArgumentException when trying to add an invalid company. An
* invalid company is a company with a non blank field "Company id".
* See "update()" if you want to update company information of an
* existing company.
*/
@Override
Company add(Company company) throws IllegalArgumentException;
/**
* Attempt to retrieve a company given its id. Return null if not found.
*
* @param companyId
* Id of the company to retrieve.
* @return The company.
* @throws IllegalArgumentException
* if the given id is invalid. Valid id must be positive.
*/
@Override
Company search(Long companyId) throws IllegalArgumentException;
/**
* Delete the given compute from DB.
*
* @param ids
* The id of company to delete.
* @throws NoSuchElementException
* if no company with this id can be found.
*/
@Override
void delete(List<Long> ids) throws NoSuchElementException;
/**
* @param name
* Name of companies to search for.
* @return count of company entries in database that matches the given name.
*/
@Override
int getCount(String name);
}
| [
"[email protected]"
] | |
9e54a383599e792c91bf5c6f96d7a33ab687fd0b | 1d6569d4dc6d48b4d4678a28bd794167813c3e04 | /src/main/java/org/plc/dto/SecurityEventDTO.java | 66a3161d7551ea0c54837c36fe774370ea119c40 | [] | no_license | poloche/rest-spi | 6f6f09d3fdcb22f057f0145ccc052cbee71e2dc6 | 0d966b89cd4f9ef0ed9831772315c950239ffa68 | refs/heads/master | 2021-11-11T10:56:06.990682 | 2021-10-25T12:51:53 | 2021-10-25T12:51:53 | 96,545,061 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,466 | java | package org.plc.dto;
public class SecurityEventDTO {
private String clientID;
private String realmId;
private String sessionId;
private String error;
private String ipAddress;
private String eventType;
private Long time;
private String userId;
public void setClientID(String clientID) {
this.clientID = clientID;
}
public String getClientID() {
return clientID;
}
public void setRealmId(String realmId) {
this.realmId = realmId;
}
public String getRealmId() {
return realmId;
}
public void setSessionId(String sessionId) {
this.sessionId = sessionId;
}
public String getSessionId() {
return sessionId;
}
public void setError(String error) {
this.error = error;
}
public String getError() {
return error;
}
public void setIpAddress(String ipAddress) {
this.ipAddress = ipAddress;
}
public String getIpAddress() {
return ipAddress;
}
public void setEventType(String eventType) {
this.eventType = eventType;
}
public String getEventType() {
return eventType;
}
public void setTime(Long time) {
this.time = time;
}
public Long getTime() {
return time;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getUserId() {
return userId;
}
}
| [
"[email protected]"
] | |
8184afdcdba6b2624e0be78ac0c52c4071beea89 | aac1fec9f2b922c37b1a4ce018df47863d74c852 | /mybatis-3-mybatis-3.0.1/src/main/java/org/apache/ibatis/logging/nologging/NoLoggingImpl.java | 21b5d219a203d04f07bb07f6624e90127f652294 | [
"BSD-3-Clause",
"Apache-2.0"
] | permissive | better-yulong/study-code | 8939a5f928bb3404d2dae417b8dbc7cfaca7e902 | 24f6d6e6516881abbea1dc3892436082553da46c | refs/heads/master | 2022-12-24T21:08:34.047981 | 2019-07-19T08:57:26 | 2019-07-19T08:57:26 | 183,977,089 | 0 | 0 | null | 2022-12-16T00:01:24 | 2019-04-29T01:07:02 | Java | UTF-8 | Java | false | false | 420 | java | package org.apache.ibatis.logging.nologging;
import org.apache.ibatis.logging.Log;
public class NoLoggingImpl implements Log {
public NoLoggingImpl(Class clazz) {
}
public boolean isDebugEnabled() {
return false;
}
public void error(String s, Throwable e) {
}
public void error(String s) {
}
public void debug(String s) {
}
public void warn(String s) {
}
}
| [
"[email protected]"
] | |
17c5a4e661e0bd6f3a24e3c9c9a0d3e71671a541 | 985dbd199892e5c09dd7140dbec52d82d8906eb1 | /changgou_service/changgou_service_goods/src/main/java/com/changgou/goods/service/impl/SkuServiceImpl.java | 81b2aa353c745f3dab3bab642e64eeadb4f14b37 | [] | no_license | wangbo345/changgou-parent | 3225cc3e8a139c30a2ea9b8ae1f076c82570d4cd | af983c3613cfda5ec496a8102f9ee46fdcc38f35 | refs/heads/master | 2023-05-11T15:45:59.055548 | 2021-05-29T10:37:47 | 2021-05-29T10:37:47 | 371,946,263 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,129 | java | package com.changgou.goods.service.impl;
import com.changgou.goods.dao.SkuMapper;
import com.changgou.goods.service.SkuService;
import com.changgou.goods.pojo.Sku;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
public class SkuServiceImpl implements SkuService {
@Autowired
private SkuMapper skuMapper;
/**
* 查询全部列表
* @return
*/
@Override
public List<Sku> findAll() {
return skuMapper.selectAll();
}
/**
* 根据ID查询
* @param id
* @return
*/
@Override
public Sku findById(String id){
return skuMapper.selectByPrimaryKey(id);
}
/**
* 增加
* @param sku
*/
@Override
public void add(Sku sku){
skuMapper.insert(sku);
}
/**
* 修改
* @param sku
*/
@Override
public void update(Sku sku){
skuMapper.updateByPrimaryKey(sku);
}
/**
* 删除
* @param id
*/
@Override
public void delete(String id){
skuMapper.deleteByPrimaryKey(id);
}
/**
* 条件查询
* @param searchMap
* @return
*/
@Override
public List<Sku> findList(Map<String, Object> searchMap){
Example example = createExample(searchMap);
return skuMapper.selectByExample(example);
}
/**
* 分页查询
* @param page
* @param size
* @return
*/
@Override
public Page<Sku> findPage(int page, int size){
PageHelper.startPage(page,size);
return (Page<Sku>)skuMapper.selectAll();
}
/**
* 条件+分页查询
* @param searchMap 查询条件
* @param page 页码
* @param size 页大小
* @return 分页结果
*/
@Override
public Page<Sku> findPage(Map<String,Object> searchMap, int page, int size){
PageHelper.startPage(page,size);
Example example = createExample(searchMap);
return (Page<Sku>)skuMapper.selectByExample(example);
}
/**
* 根据spuId查询skuList
* @param spuId
* @return
*/
@Override
public List<Sku> findSkuListBySpuId(String spuId) {
Map<String, Object> map=new HashMap<>();
map.put("spuId",spuId);
Example example = createExample(map);
List<Sku> skuList = skuMapper.selectByExample(example);
return skuList;
}
/**
* 构建查询对象
* @param searchMap
* @return
*/
private Example createExample(Map<String, Object> searchMap){
Example example=new Example(Sku.class);
Example.Criteria criteria = example.createCriteria();
if(searchMap!=null){
// 商品id
if(searchMap.get("id")!=null && !"".equals(searchMap.get("id"))){
criteria.andEqualTo("id", searchMap.get("id"));
}
// 商品条码
if(searchMap.get("sn")!=null && !"".equals(searchMap.get("sn"))){
criteria.andEqualTo("sn",searchMap.get("sn"));
}
// SKU名称
if(searchMap.get("name")!=null && !"".equals(searchMap.get("name"))){
criteria.andLike("name","%"+searchMap.get("name")+"%");
}
// 商品图片
if(searchMap.get("image")!=null && !"".equals(searchMap.get("image"))){
criteria.andLike("image","%"+searchMap.get("image")+"%");
}
// 商品图片列表
if(searchMap.get("images")!=null && !"".equals(searchMap.get("images"))){
criteria.andLike("images","%"+searchMap.get("images")+"%");
}
// SPUID
if(searchMap.get("spuId")!=null && !"".equals(searchMap.get("spuId"))){
criteria.andEqualTo("spuId",searchMap.get("spuId"));
}
// 类目名称
if(searchMap.get("categoryName")!=null && !"".equals(searchMap.get("categoryName"))){
criteria.andLike("categoryName","%"+searchMap.get("categoryName")+"%");
}
// 品牌名称
if(searchMap.get("brandName")!=null && !"".equals(searchMap.get("brandName"))){
criteria.andLike("brandName","%"+searchMap.get("brandName")+"%");
}
// 规格
if(searchMap.get("spec")!=null && !"".equals(searchMap.get("spec"))){
criteria.andLike("spec","%"+searchMap.get("spec")+"%");
}
// 商品状态 1-正常,2-下架,3-删除
if(searchMap.get("status")!=null && !"".equals(searchMap.get("status"))){
criteria.andEqualTo("status", searchMap.get("status"));
}
// 价格(分)
if(searchMap.get("price")!=null ){
criteria.andEqualTo("price",searchMap.get("price"));
}
// 库存数量
if(searchMap.get("num")!=null ){
criteria.andEqualTo("num",searchMap.get("num"));
}
// 库存预警数量
if(searchMap.get("alertNum")!=null ){
criteria.andEqualTo("alertNum",searchMap.get("alertNum"));
}
// 重量(克)
if(searchMap.get("weight")!=null ){
criteria.andEqualTo("weight",searchMap.get("weight"));
}
// 类目ID
if(searchMap.get("categoryId")!=null ){
criteria.andEqualTo("categoryId",searchMap.get("categoryId"));
}
// 销量
if(searchMap.get("saleNum")!=null ){
criteria.andEqualTo("saleNum",searchMap.get("saleNum"));
}
// 评论数
if(searchMap.get("commentNum")!=null ){
criteria.andEqualTo("commentNum",searchMap.get("commentNum"));
}
}
return example;
}
}
| [
"[email protected]"
] | |
f3285a492ac889b72317cac1d96734ab5e16a5dd | bd2dba2626e9741ae5bdc7b6aa99de37b9624840 | /build/generated/source/proto/main/java/ee/concise/gigantic_messaging/BaseResponseOrBuilder.java | 343c909cabb9c068614f8832cdf37fd0ba6df303 | [] | no_license | GeitV/grpctest-gigantic-messaging | ab7594ecb0fe23a6ac7056a5a5000736807ba52f | 48fc50dd0067ba9ea2d0e67fbeabdf7a76de202d | refs/heads/master | 2023-01-21T20:53:35.537957 | 2020-11-27T10:05:12 | 2020-11-27T10:05:12 | 316,462,894 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | true | 1,031 | java | // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: gigantic_messaging.proto
package ee.concise.gigantic_messaging;
public interface BaseResponseOrBuilder extends
// @@protoc_insertion_point(interface_extends:gigantic_messaging.BaseResponse)
com.google.protobuf.MessageOrBuilder {
/**
* <code>.gigantic_messaging.BaseResponse.ResponseStatus status = 1;</code>
* @return The enum numeric value on the wire for status.
*/
int getStatusValue();
/**
* <code>.gigantic_messaging.BaseResponse.ResponseStatus status = 1;</code>
* @return The status.
*/
ee.concise.gigantic_messaging.BaseResponse.ResponseStatus getStatus();
/**
* <code>string message = 2;</code>
* @return The message.
*/
java.lang.String getMessage();
/**
* <code>string message = 2;</code>
* @return The bytes for message.
*/
com.google.protobuf.ByteString
getMessageBytes();
/**
* <code>int32 messageId = 3;</code>
* @return The messageId.
*/
int getMessageId();
}
| [
"[email protected]"
] | |
313562409e30ec125ea6b4a3ca31f0b3fcf7b56c | 752614584d7b5366a05f3d3699566a9f2cb5154d | /src/main/java/com/agharibi/springmvcmongodb/controllers/ImageController.java | ba6cedb0884c2312f43ba49c3ad8523615fbf1b5 | [] | no_license | ag-projects/spring-mvc-mongodb | 141749888399eeab076ecbc3be77bcb419f81540 | fbd9ac712f717c372f345fcfb5ea58998b6eba11 | refs/heads/master | 2021-07-12T18:33:52.230418 | 2017-10-15T18:25:08 | 2017-10-15T18:25:08 | 106,971,972 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,308 | java | package com.agharibi.springmvcmongodb.controllers;
import com.agharibi.springmvcmongodb.commands.RecipeCommand;
import com.agharibi.springmvcmongodb.services.ImageService;
import com.agharibi.springmvcmongodb.services.RecipeService;
import org.apache.tomcat.util.http.fileupload.IOUtils;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
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.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
@Controller
public class ImageController {
private final ImageService imageService;
private final RecipeService recipeService;
public ImageController(ImageService imageService, RecipeService recipeService) {
this.imageService = imageService;
this.recipeService = recipeService;
}
@GetMapping("recipe/{id}/image")
public String showUploadForm(@PathVariable String id, Model model) {
model.addAttribute("recipe", recipeService.findCommandById(id));
return "recipe/imageuploadform";
}
@PostMapping("recipe/{id}/image")
public String handleImagePost(@PathVariable String id, @RequestParam("imagefile")MultipartFile file) {
imageService.saveImageFile(id, file);
return "recipe/" + id + "/show";
}
@GetMapping("recipe/{id}/recipeimage")
public void renderImageFromDB(@PathVariable String id, HttpServletResponse response) throws IOException {
RecipeCommand recipeCommand = recipeService.findCommandById(id);
if (recipeCommand.getImage() != null) {
byte[] byteArray = new byte[recipeCommand.getImage().length];
int i = 0;
for (Byte wrappedByte : recipeCommand.getImage()){
byteArray[i++] = wrappedByte; //auto unboxing
}
response.setContentType("image/jpeg");
InputStream is = new ByteArrayInputStream(byteArray);
IOUtils.copy(is, response.getOutputStream());
}
}
}
| [
"[email protected]"
] | |
d41c54e996df1d21fc9622551c73416b35ebd175 | 55de2e19fa251793df5525e43cd6ede5b86b3edd | /RMI/Ejemplo_profesor/ClaseRMI.java | 065c92ffa1b9d3c424d782f3b079c431c3a5f0c9 | [] | no_license | daniccast/DSD | 46f7e4f8e14156aa55b76408b4960a88a3d9927f | 451770c981e631931678eb4fbbfd4ed219f6bcee | refs/heads/master | 2023-05-05T23:42:37.099532 | 2021-06-03T00:41:09 | 2021-06-03T00:41:09 | 303,555,562 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 679 | java | import java.io.Serializable;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
public class ClaseRMI extends UnicastRemoteObject implements InterfaceRMI{
// es necesario que el contructor ClaseRMI() invoque el constructor de la superclase
public ClaseRMI() throws RemoteException{
super( );
}
public String mayusculas(String s) throws RemoteException{
return s.toUpperCase();
}
public int suma(int a,int b){
return a + b;
}
public long checksum(int[][] m) throws RemoteException{
long s = 0;
for (int i = 0; i < m.length; i++)
for (int j = 0; j < m[0].length; j++)
s += m[i][j];
return s;
}
} | [
"[email protected]"
] | |
5a0977843750e5d6a7e6f6a0e55cb1c488d632b6 | be50ab08685c0d03b55121c3b8f0ed25bee53578 | /base-upms/base-upms-common/src/main/java/com/aiforest/cloud/upms/common/feign/FeignUserService.java | 69011a4cd0e79608f085061d0d9dbbd35ba9c4c7 | [] | no_license | panxiaochao/agent_backend | 467a6b43306693eb1413f9066216b9b63877b65d | 6fb79575f44242e86290080303bb652528ad9973 | refs/heads/master | 2023-05-25T12:50:57.148064 | 2020-10-12T22:59:23 | 2020-10-12T22:59:23 | 645,122,822 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,527 | java | package com.aiforest.cloud.upms.common.feign;
import com.aiforest.cloud.upms.common.entity.SysUser;
import com.aiforest.cloud.upms.common.dto.UserInfo;
import com.aiforest.cloud.common.core.constant.SecurityConstants;
import com.aiforest.cloud.common.core.constant.ServiceNameConstants;
import com.aiforest.cloud.common.core.util.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;
import java.util.List;
/**
* @author
*/
@FeignClient(contextId = "feignUserService", value = ServiceNameConstants.UMPS_ADMIN_SERVICE)
public interface FeignUserService {
/**
* 通过用户名查询用户、角色信息
*
* @param username 用户名
* @param from 调用标志
* @return R
*/
@GetMapping("/user/info/{username}")
R<UserInfo> info(@PathVariable("username") String username
, @RequestHeader(SecurityConstants.FROM) String from);
/**
* 手机号查询用户、角色信息
*
* @param phone
* @param from 调用标志
* @return
*/
@GetMapping("/phone/info/{phone}")
R<UserInfo> infoByPhone(@PathVariable("phone") String phone
, @RequestHeader(SecurityConstants.FROM) String from);
/**
* 查询上级机构的用户信息
*
* @param username 用户名
* @return R
*/
@GetMapping("/user/ancestor/{username}")
R<List<SysUser>> ancestorUsers(@PathVariable("username") String username);
}
| [
"[email protected]"
] | |
552e9e148555df45674a36ca8a809af756a31d2d | d49ac5010fda0fa30ccf4da2fffae60da50aa4a4 | /src/nhjkpt/configmanage/service/impl/departmentinfo/DepartmentinfoServiceImpl.java | 6417fbdb5f053322e7b414e501f62f595b71e31e | [] | no_license | LaneMa/nhjkpt | 624edc93afaba3d86f307d4f4c8dc70962501203 | 7c598f4016ce84f70bc3f7c95baf3a690e07978c | refs/heads/master | 2021-09-11T17:48:21.843976 | 2018-04-10T14:05:01 | 2018-04-10T14:05:01 | 117,777,725 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 2,181 | java | package nhjkpt.configmanage.service.impl.departmentinfo;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import nhjkpt.configmanage.service.departmentinfo.DepartmentinfoServiceI;
import nhjkpt.system.util.MyInterceptor;
import org.framework.core.common.service.impl.CommonServiceImpl;
import org.hibernate.Interceptor;
import org.hibernate.Query;
import org.hibernate.Session;
@Service("departmentinfoService")
@Transactional
public class DepartmentinfoServiceImpl extends CommonServiceImpl implements DepartmentinfoServiceI {
//获取学校今年用电量 查询年表当前月前几个月总用电量+本月小时表用电量
public Double getUseNhThisYear(String departmentid,String funcid){
double ret=0;
Calendar calendar=Calendar.getInstance();
SimpleDateFormat sdf=new SimpleDateFormat("yyyyMM");
SimpleDateFormat sdf_hg=new SimpleDateFormat("yyyy-MM");
SimpleDateFormat sdf_year=new SimpleDateFormat("yyyy");
Interceptor interceptor=new MyInterceptor("departmenthoursum","departmenthoursum_"+sdf.format(calendar.getTime()));
Session session=null;
Query query=null;
try{
session=getSession(interceptor);
query=session.createSQLQuery("select ifnull(sum(data),0) as data from departmenthoursum where departmentid='"+departmentid+"' and funcid='"+funcid+"'");
ret=(Double)query.uniqueResult();
query=session.createSQLQuery("select ifnull(sum(data),0) as data from departmentmonthsum where departmentid='"+departmentid+"' and funcid='"+funcid+"' and receivetime > '"+sdf_year.format(calendar.getTime())+"-01' and receivetime<'"+sdf_hg.format(calendar.getTime())+"'");
ret=ret+(Double)query.uniqueResult();
}catch(Exception e){
e.printStackTrace();
}finally{
if(session!=null){
session.clear();
session.close();
}
}
BigDecimal bg = new BigDecimal(ret);
double ret2 = bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
return ret2;
}
} | [
"[email protected]"
] | |
f01578ab15791cd80a21ad95c9aeee64ebbbd9ff | cbe3dbba523602db1c56d7677e715ddc9ab07826 | /sielekthor/src/main/java/ti1/apap/sielekthor/model/PembelianModel.java | b00f2a4c89afc8d73b39ca7ca3af950e78c68e1a | [] | no_license | renofathoni23/tugas1_sielekthor_1901234567 | a5f146aa3f0c68daf5ec2de4637a1495a45bfd7a | b823b9568d4321c2fcc00747f8bfae50f0857bc4 | refs/heads/main | 2023-08-12T21:25:26.327725 | 2021-10-16T15:32:43 | 2021-10-16T15:32:43 | 416,223,440 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,189 | java | package ti1.apap.sielekthor.model;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.OnDelete;
import org.hibernate.annotations.OnDeleteAction;
import org.hibernate.validator.constraints.UniqueElements;
import org.springframework.format.annotation.DateTimeFormat;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.Date;
import java.util.List;
@AllArgsConstructor
@NoArgsConstructor
@Setter
@Getter
@Entity
@Table(name="pembelian")
public class PembelianModel implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long idPembelian;
@NotNull
@Column(nullable = false)
@DateTimeFormat(pattern = "dd/MM/yyyy")
private Date tanggal_pembelian;
@NotNull
@Column(name="total_pembelian", nullable = false)
private int total;
@NotNull
@Size(max=255)
@Column(name="nama_admin_pengelola", nullable = false)
private String nama_admin;
@NotNull
@Size(max=255)
@Column(name="no_invoice_pembelian", nullable = false, unique = true)
private String no_invoice;
@NotNull
@Column(name="metode_pembayaran", nullable = false)
private Boolean is_cash;
//Relasi dengan Member
@ManyToOne (fetch = FetchType.EAGER, optional = false)
@JoinColumn(name = "idMember", referencedColumnName = "idMember", nullable = false)
@OnDelete( action = OnDeleteAction.CASCADE)
private MemberModel member;
//Relasi dengan PembelianBarang
@OneToMany(mappedBy = "pembelian", fetch = FetchType.LAZY, cascade = CascadeType.ALL)
List<PembelianBarangModel> listPembelianBarang;
// //Relasi dengan Barang
// @ManyToOne (fetch = FetchType.EAGER, optional = false)
// @JoinColumn(name = "idPembelianBarang", referencedColumnName = "idPembelianBarang", nullable = false)
// @OnDelete( action = OnDeleteAction.CASCADE)
// private PembelianBarangModel pembelianbarang;
}
| [
"[email protected]"
] | |
3c7c8a02c7708a3a90c5cba257b4262ba9da0a8c | 22ffdf4d3352b05f9f2795e71ec43f126a466dec | /src/main/java/cards/UserCard.java | 645ccb029e8d7484bd71e485dffc6ace11910363 | [] | no_license | Anton-Pervushin/ATM_Web_SkillFactory | 63e01612b2dc6376bd488d1f1000cfaffa7853f0 | 8707b7dfe619b6ba8cb41ee51a0852a2a682a706 | refs/heads/master | 2023-03-19T03:10:58.911197 | 2020-08-24T05:34:12 | 2020-08-24T05:34:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,958 | java | package cards;
import java.util.Objects;
/**
* Класс, представляющий банковскую карточку пользователя
*
* @author Meshchaninov A.A
*/
public class UserCard {
private final long cardId;
private final String userName;
private long funds;
private final short pinCode;
public final static UserCard EMPTY_CARD = new UserCard();
/**
* Конструктор пустой карты пользователя
*/
private UserCard() {
this.cardId = 0;
this.funds = 0;
this.userName = "";
this.pinCode = 0;
}
/**
* Основной конструктор объекта UserCard
*
* @param cardId id карты
* @param userName имя владельца карты
* @param funds количество денежных средств на карте
* @param pinCode пинкод от карты
*/
public UserCard(long cardId, String userName, long funds, short pinCode) {
this.cardId = cardId;
this.userName = userName;
this.funds = funds;
this.pinCode = pinCode;
}
/**
* Получение пинкода пользователя
*
* @return пинкод в виде short
*/
short getPinCode() {
return pinCode;
}
/**
* Получить id пользователя
*
* @return user id
*/
public long getCardId() {
return cardId;
}
/**
* Получить имя пользователя
*
* @return имя пользователя в виде строки
*/
public String getUserName() {
return userName;
}
/**
* Получить средства на карточке пользователя
*
* @return сумма денег на карте пользователя
*/
public long getFunds() {
return funds;
}
/**
* Добавление средств на счет пользователя
*
* @param funds добавляемая сумма средств
*/
public void setFunds(long funds) {
this.funds = funds;
}
/**
* Получить строковое предстваление объекта UserCard
*
* @return строковое предстваление объекта UserCard
*/
public String toConfigString() {
return String.format("%s:%s:%s:%s", cardId, userName, funds, pinCode);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
UserCard card = (UserCard) o;
return cardId == card.getCardId() &&
userName.equals(card.getUserName());
}
@Override
public int hashCode() {
return Objects.hash(cardId, userName);
}
}
| [
"[email protected]"
] | |
0f516a6e5b7d3b7028fe5774deb988656f75c546 | f9284d7138daf3375b63d17ffdce0fe9c38d8d52 | /src/boundary/openU.java | 2b08261cc4191c0400755db64e039ed9e67c9b14 | [] | no_license | iyuhangli/Bank-System | 7695d0a4b79779ea2be82698a85f81ee24b9b1b8 | 49dc5b34ffdf7a5d0f54f044f31a43604e8e1a6d | refs/heads/master | 2020-05-24T06:35:47.850456 | 2019-05-17T03:45:28 | 2019-05-17T03:45:28 | 187,141,681 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,929 | java | /**
* This is about open a account's UI.
* @author Yuhang LI
*/
package boundary;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import javax.swing.*;
import boundary.index.index;
import control.allcheck;
import control.openC;
public class openU extends JFrame implements MouseListener{
private static final long serialVersionUID = 1L;
JPanel jpOpenAcc[];
JLabel jlOpenAcc[],jlinfoNew;
JTextField jtOpenAcc[];
JButton submitOpenAcc,backOpenAcc;
JRadioButton saverOpenAcc,currentOpenAcc,juniorOpenAcc;
ButtonGroup buttGroup;
int numberPlus;
/**
* Create UI of open account.
*/
public openU() {
this.setSize(460,400);
this.setLayout(null);
jlinfoNew=new JLabel("New a account");
jlOpenAcc=new JLabel[6];
jpOpenAcc=new JPanel[8];
jtOpenAcc=new JTextField[5];
jlinfoNew.setFont(new java.awt.Font("Times new roman",1,20));
jlOpenAcc[0]=new JLabel("Name:");
jlOpenAcc[1]=new JLabel("ID Number:");
jlOpenAcc[2]=new JLabel("Mind! Your pin is:");
jlOpenAcc[3]=new JLabel("Date of birth:");
jlOpenAcc[4]=new JLabel("Your address:");
jlOpenAcc[5]=new JLabel("Select the account type:");
submitOpenAcc=new JButton("Submit");
backOpenAcc=new JButton("Back");
saverOpenAcc=new JRadioButton("Saver");
currentOpenAcc=new JRadioButton("Current");
juniorOpenAcc=new JRadioButton("Junior");
for(int i=0;i<5;i++)
{
numberPlus=70;
numberPlus+=i*40;
jpOpenAcc[i]=new JPanel();
jtOpenAcc[i]=new JTextField(10);
jpOpenAcc[i].add(jlOpenAcc[i]);
jpOpenAcc[i].add(jtOpenAcc[i]);
jpOpenAcc[i].setBounds(110,numberPlus,200,30);
this.add(jpOpenAcc[i]);
}
jpOpenAcc[2].setBounds(10,150,400,30);
jtOpenAcc[2].setBackground(Color.LIGHT_GRAY);
jtOpenAcc[2].setEditable(false);
String randomnum=allcheck.randomGenerate();
jtOpenAcc[2].setText(randomnum);
buttGroup=new ButtonGroup();
saverOpenAcc.addMouseListener(this);
buttGroup.add(saverOpenAcc);
currentOpenAcc.addMouseListener(this);
buttGroup.add(currentOpenAcc);
juniorOpenAcc.addMouseListener(this);
buttGroup.add(juniorOpenAcc);
jpOpenAcc[4]=new JPanel();
jpOpenAcc[4].add(currentOpenAcc);
jpOpenAcc[5]=new JPanel();
jpOpenAcc[5].add(saverOpenAcc);
jpOpenAcc[6]=new JPanel();
jpOpenAcc[6].add(juniorOpenAcc);
jlOpenAcc[5].setBounds(145,260,200,30);
jlinfoNew.setBounds(160,20,300,40);
jpOpenAcc[4].setBounds(110,282, 60, 30);
jpOpenAcc[5].setBounds(180,282,60,30);
jpOpenAcc[6].setBounds(240,282,60,30);
submitOpenAcc.setBounds(90,320,100,30);
backOpenAcc.setBounds(230,320,100,30);
this.add(jlinfoNew);
this.add(jlOpenAcc[5]);
this.add(jpOpenAcc[4]);
this.add(jpOpenAcc[5]);
this.add(jpOpenAcc[6]);
this.add(submitOpenAcc);
this.add(backOpenAcc);
this.setVisible(true);
this.setDefaultCloseOperation(index.EXIT_ON_CLOSE);
this.setTitle("Open account");
submitOpenAcc.addActionListener(new openC(jtOpenAcc[0],jtOpenAcc[1],jtOpenAcc[2],jtOpenAcc[3],jtOpenAcc[4],saverOpenAcc,currentOpenAcc,juniorOpenAcc,this) {
});
backOpenAcc.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
new customerU();
dispose();
}
});
}
@Override
public void mouseClicked(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mousePressed(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mouseReleased(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mouseEntered(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mouseExited(MouseEvent e) {
// TODO Auto-generated method stub
}
}
| [
"[email protected]"
] | |
38260fc37cbe0edce76ceb62eb684b1bdf8ce0fd | 06c8173baa7776cf4737ae21e5f37aa0a94eb786 | /app/src/main/java/com/openshop/rsyny/view/activity/FavouritesActivity.java | 776d84af67dd1ee967bfce3e266ad07cda6850ef | [] | no_license | mohamedfffccc/RSYNY | 71eec3117a9f92b295c2fba27a7d1d38cf475f14 | be30fe41ca1b5d29fa9727e6095fcdd233e17832 | refs/heads/master | 2022-12-07T16:23:45.474221 | 2020-09-02T00:53:58 | 2020-09-02T00:53:58 | 292,141,478 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,686 | java | package com.openshop.rsyny.view.activity;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.openshop.rsyny.R;
import com.openshop.rsyny.data.adapter.FavAdapter;
import com.openshop.rsyny.data.local.room.NewItem;
import com.openshop.rsyny.data.local.room.RoomDao;
import java.util.List;
import java.util.concurrent.Executors;
import butterknife.BindView;
import butterknife.ButterKnife;
import static com.openshop.rsyny.data.local.room.RoomManger.getInistance;
public class FavouritesActivity extends AppCompatActivity {
@BindView(R.id.rv_fav)
RecyclerView rvFav;
RoomDao roomDao;
List<NewItem> data;
FavAdapter adapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_favourites);
ButterKnife.bind(this);
roomDao = getInistance(this).roomDao();
rvFav.setLayoutManager(new LinearLayoutManager(FavouritesActivity.this));
getFav();
}
private void getFav() {
Executors.newSingleThreadExecutor().execute(new Runnable() {
@Override
public void run() {
data=roomDao.getAll();
runOnUiThread(new Runnable() {
@Override
public void run() {
adapter=new FavAdapter(data,FavouritesActivity.this,FavouritesActivity.this);
rvFav.setAdapter(adapter);
}
});
}
});
}
}
| [
"[email protected]"
] | |
0b9bbef5983ed2fb6082d294b0e7f3ca8b566b7a | a70034deea84cbfd02cb2be49f890146268eb957 | /src/main/java/solid/inversion/good/FrontendDeveloper.java | adeae739b7779bd71e39b3a1776da64b71ae1f46 | [] | no_license | oleskafeska/solid | 09f7ead46b5f746e7f6d0829fd7904fe3639cfb1 | 2079f4eaed5c7b92a6be474d3ea7cba70056fc77 | refs/heads/master | 2020-09-30T06:05:03.801706 | 2019-12-26T20:54:17 | 2019-12-26T20:54:17 | 227,223,328 | 0 | 0 | null | 2020-01-10T18:49:05 | 2019-12-10T21:55:44 | Java | UTF-8 | Java | false | false | 249 | java | package solid.inversion.good;
public class FrontendDeveloper implements Developer {
@Override
public void develop() {
writeJavaScript();
}
private void writeJavaScript() {
System.out.println("Writing JS");
}
}
| [
"[email protected]"
] | |
e3bfce360607d3aa1021373c50e4e95797d5a752 | ead0764d4eb4b6704abf04e4632a36a42dbafd38 | /src/main/java/com/fastchar/multipart/ParamPart.java | 26c2d2b0ed8933cbb7368efff7326e0a60037603 | [] | no_license | chis123/FastChar | 540b3ecaa03145a302e33d09552b12200875d9de | 156e88ec8876f2e07579b6af341b5f550dda0b0f | refs/heads/master | 2020-12-06T12:50:08.637948 | 2019-12-22T09:28:34 | 2019-12-22T09:28:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,928 | java | // Copyright (C) 1999-2001 by Jason Hunter <jhunter_AT_acm_DOT_org>.
// All rights reserved. Use of this class is limited.
// Please see the LICENSE for more information.
package com.fastchar.multipart;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import javax.servlet.ServletInputStream;
/**
* A <code>ParamPart</code> is an upload part which represents a normal
* <code>INPUT</code> (for example a non <code>TYPE="file"</code>) form
* parameter.
*
* @author Geoff Soutter
* @author Jason Hunter
* @version 1.1, 2002/04/30, added better encoding support, thanks to
* Changshin Lee
* @version 1.0, 2000/10/27, initial revision
*/
public class ParamPart extends Part {
/** contents of the parameter */
private byte[] value;
private String encoding;
/**
* Constructs a parameter part; this is called by the parser.
*
* @param name the name of the parameter.
* @param in the servlet input stream to read the parameter value from.
* @param boundary the MIME boundary that delimits the end of parameter value.
* @param encoding the byte-to-char encoding to use by default
* value.
*/
ParamPart(String name, ServletInputStream in,
String boundary, String encoding) throws IOException {
super(name);
this.encoding = encoding;
// Copy the part's contents into a byte array
PartInputStream pis = new PartInputStream(in, boundary);
ByteArrayOutputStream baos = new ByteArrayOutputStream(512);
byte[] buf = new byte[128];
int read;
while ((read = pis.read(buf)) != -1) {
baos.write(buf, 0, read);
}
pis.close();
baos.close();
// save it for later
value = baos.toByteArray();
}
/**
* Returns the value of the parameter as an array of bytes or a zero length
* array if the user entered no value for this parameter.
*
* @return value of parameter as raw bytes
*/
public byte[] getValue() {
return value;
}
/**
* Returns the value of the parameter in as a string (using the
* parser-specified encoding to convert from bytes) or the empty string
* if the user entered no value for this parameter.
*
* @return value of parameter as a string.
*/
public String getStringValue()
throws UnsupportedEncodingException {
return getStringValue(encoding);
}
/**
* Returns the value of the parameter in the supplied encoding
* or empty string if the user entered no value for this parameter.
*
* @return value of parameter as a string.
*/
public String getStringValue(String encoding)
throws UnsupportedEncodingException {
return new String(value, encoding);
}
/**
* Returns <code>true</code> to indicate this part is a parameter.
*
* @return true.
*/
public boolean isParam() {
return true;
}
}
| [
"[email protected]"
] | |
340fbce64837f345cd852fe52bc6821e1b0c045b | 70625b2e0b9918fc3b007a495a9db824c1e1575d | /src/main/java/pl/coderslab/charity/baseModel/BaseEntity.java | 7a5f86cbb87f5bc41fb26ab507cc7d0c277c259d | [] | no_license | Darkeduar/CharityGiveaway | 1417c03d68f8d5065f944fe78085a0a640604a81 | e6270006390cf9115b7985190c6943bdfd983f8c | refs/heads/master | 2022-07-17T01:42:50.978863 | 2019-09-20T22:10:03 | 2019-09-20T22:10:03 | 199,496,163 | 1 | 0 | null | 2022-06-21T01:33:50 | 2019-07-29T17:15:40 | CSS | UTF-8 | Java | false | false | 620 | java | package pl.coderslab.charity.baseModel;
import javax.persistence.MappedSuperclass;
import java.util.Objects;
import java.util.UUID;
@MappedSuperclass
public class BaseEntity {
private String uuid = UUID.randomUUID().toString();
public String getUuid() {
return uuid;
}
@Override
public int hashCode() {
return Objects.hashCode(uuid);
}
@Override
public boolean equals(Object obj) {
if (!(obj instanceof BaseEntity)){
return false;
}
BaseEntity that = (BaseEntity) obj;
return Objects.equals(that.uuid, that.uuid);
}
}
| [
"[email protected]"
] | |
1a66fe012c607517e8c877ebe5e003fd8320628f | 2410052d559ac953900159d5e9a114fa8c2ba091 | /app/src/main/java/com/custom_observer/Test.java | dfe3aacf6eabc0a021299986833520b6cf326dc7 | [] | no_license | VincentLoveAndroid/RxJava | 3dc6eb2f399b36a48f26cb244013b6d3844d4315 | 9ff9a6b6d9fb890fa2b64043b49c45f265cb0690 | refs/heads/master | 2021-01-19T03:29:44.351249 | 2017-04-05T16:23:00 | 2017-04-05T16:23:00 | 87,318,509 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 710 | java | package com.vincent.rxjava.customobserver;
/**
* Created by vincent on 2017/4/5.
* email-address:[email protected]
* description:
*/
public class Test {
public static void main(String arg0[]) {
Observer observer = new SimpleObserver();
Observer observer2 = new SimpleObserver();
Observer observer3 = new SimpleObserver();
SimpleObservable observable = new SimpleObservable();
observable.addObserver(observer);
observable.addObserver(observer2);
observable.addObserver(observer3);
observable.setData(1);
observable.setData(2);
observable.setData(3);
observable.setData(3);
observable.setData(4);
}
}
| [
"[email protected]"
] | |
d0d13c4384fe26978fac19d421b4b54c77aa5943 | 5f3552794f591a3a0510f71be929aa9c86eb07cd | /src/main/java/com/viching/redis/VichingRedisConfig.java | 9d4ac6d7f571f2fac11abb507de3b973bdf2cee8 | [] | no_license | viching/spring-boot-starter-redis | 83d21893428c40a78aa662a317b3532bc31828ce | f27d5f3bf9e8d42147697bc5e1520c955863e3d5 | refs/heads/master | 2020-03-31T07:11:26.233668 | 2019-05-01T12:06:10 | 2019-05-01T12:06:10 | 152,011,628 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,186 | java | package com.viching.redis;
import java.util.List;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import ch.qos.logback.core.util.Duration;
/**
* Configuration properties for Redis.(redis的属性配置类)
*/
@Configuration
@ConfigurationProperties(prefix = "spring.redis")
public class VichingRedisConfig {
/**
* Database index used by the connection factory.
*/
private int database = 0;
/**
* Connection URL. Overrides host, port, and password. User is ignored. Example:
* redis://user:[email protected]:6379
*/
private String url;
/**
* Redis server host.
*/
private String host = "localhost";
/**
* Login password of the redis server.
*/
private String password;
/**
* Redis server port.
*/
private int port = 6379;
/**
* Whether to enable SSL support.
*/
private boolean ssl;
/**
* Connection timeout.
*/
private int timeout;
private Sentinel sentinel;
private Cluster cluster;
private final Jedis jedis = new Jedis();
private final Lettuce lettuce = new Lettuce();
public int getDatabase() {
return database;
}
public void setDatabase(int database) {
this.database = database;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getHost() {
return host;
}
public void setHost(String host) {
this.host = host;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public int getPort() {
return port;
}
public void setPort(int port) {
this.port = port;
}
public boolean isSsl() {
return ssl;
}
public void setSsl(boolean ssl) {
this.ssl = ssl;
}
public int getTimeout() {
return timeout;
}
public void setTimeout(int timeout) {
this.timeout = timeout;
}
public Sentinel getSentinel() {
return sentinel;
}
public void setSentinel(Sentinel sentinel) {
this.sentinel = sentinel;
}
public Cluster getCluster() {
return cluster;
}
public void setCluster(Cluster cluster) {
this.cluster = cluster;
}
public Jedis getJedis() {
return jedis;
}
public Lettuce getLettuce() {
return lettuce;
}
/**
* Pool properties.(连接池的配置信息)
*/
public static class Pool {
/**
* Maximum number of "idle" connections in the pool. Use a negative value to
* indicate an unlimited number of idle connections.
*/
private int maxIdle = 8;
/**
* Target for the minimum number of idle connections to maintain in the pool. This
* setting only has an effect if it is positive.
*/
private int minIdle = 0;
/**
* Maximum number of connections that can be allocated by the pool at a given
* time. Use a negative value for no limit.
*/
private int maxActive = 8;
/**
* Maximum amount of time a connection allocation should block before throwing an
* exception when the pool is exhausted. Use a negative value to block
* indefinitely.
*/
private int maxWait = -1;
/**
*省略了关于连接池属性信息的get set方法
*/
public int getMaxIdle() {
return maxIdle;
}
public void setMaxIdle(int maxIdle) {
this.maxIdle = maxIdle;
}
public int getMinIdle() {
return minIdle;
}
public void setMinIdle(int minIdle) {
this.minIdle = minIdle;
}
public int getMaxActive() {
return maxActive;
}
public void setMaxActive(int maxActive) {
this.maxActive = maxActive;
}
public int getMaxWait() {
return maxWait;
}
public void setMaxWait(int maxWait) {
this.maxWait = maxWait;
}
}
/**
* Cluster properties.(集群配置信息)
*/
public static class Cluster {
/**
* Comma-separated list of "host:port" pairs to bootstrap from. This represents an
* "initial" list of cluster nodes and is required to have at least one entry.
*/
private List<String> nodes;
/**
* Maximum number of redirects to follow when executing commands across the
* cluster.
*/
private Integer maxRedirects;
/**
*省略了关于集群配置信息的get set方法
*/
public List<String> getNodes() {
return nodes;
}
public void setNodes(List<String> nodes) {
this.nodes = nodes;
}
public Integer getMaxRedirects() {
return maxRedirects;
}
public void setMaxRedirects(Integer maxRedirects) {
this.maxRedirects = maxRedirects;
}
}
/**
* Redis sentinel properties.(哨兵属性信息)
*/
public static class Sentinel {
/**
* Name of the Redis server.
*/
private String master;
/**
* Comma-separated list of "host:port" pairs.
*/
private List<String> nodes;
/**
*省略了关于哨兵属性信息的get set方法
*/
public String getMaster() {
return master;
}
public void setMaster(String master) {
this.master = master;
}
public List<String> getNodes() {
return nodes;
}
public void setNodes(List<String> nodes) {
this.nodes = nodes;
}
}
/**
* Jedis client properties.(redis的客户端jedis)
*/
public static class Jedis {
/**
* Jedis pool configuration.
*/
private Pool pool;
/**
*省略了关于jedis属性信息的get set方法
*/
public Pool getPool() {
return pool;
}
public void setPool(Pool pool) {
this.pool = pool;
}
}
/**
* Lettuce client properties.
*/
public static class Lettuce {
/**
* Shutdown timeout.
*/
private Duration shutdownTimeout = Duration.buildByMilliseconds(100f);
/**
* Lettuce pool configuration.
*/
private Pool pool;
public Duration getShutdownTimeout() {
return shutdownTimeout;
}
public void setShutdownTimeout(Duration shutdownTimeout) {
this.shutdownTimeout = shutdownTimeout;
}
public Pool getPool() {
return pool;
}
public void setPool(Pool pool) {
this.pool = pool;
}
}
}
| [
"[email protected]"
] | |
eb988a6089e705e465044223aa039afe44d54abe | 5069abf03f391f72f384bca6f39a47ac012e5749 | /app/src/androidTest/java/com/demo/quizapp/ExampleInstrumentedTest.java | 11cd1bf76a5a74a8ee7c7e6bef8b06d6192c7d41 | [] | no_license | NehaParmar/QuizApp | af1f0830b7e419e0499f0f526db0fdfcc1a636ff | 7f15676ad0f7074ff7be0dacb1474406dba73797 | refs/heads/master | 2022-11-08T12:37:35.622112 | 2020-06-22T07:30:47 | 2020-06-22T07:30:47 | 274,064,433 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 759 | java | package com.demo.quizapp;
import android.content.Context;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;
import org.junit.Test;
import org.junit.runner.RunWith;
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.getInstrumentation().getTargetContext();
assertEquals("com.demo.quizapp", appContext.getPackageName());
}
}
| [
"[email protected]"
] | |
f4116942b1734ca35d01967aac731933473036cb | d21fbfca5fcfdcff5930a5e514e3f689e1d4ffc6 | /BBS/src/co/simuluk/board/command/MainAction.java | 58738e9f23188df6e59f5e94748a620d38280e4b | [] | no_license | kisssky12/JSP | 6428f40819175f739a405a4cee814723cae25363 | 2926a5a0a58e25462374c2d8ae298679eeee9470 | refs/heads/master | 2023-01-13T18:49:22.611387 | 2020-11-06T08:42:10 | 2020-11-06T08:42:10 | 305,644,382 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 378 | java | package co.simuluk.board.command;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import co.simuluk.board.common.Action;
public class MainAction implements Action {
@Override
public String exec(HttpServletRequest request, HttpServletResponse response) {
// TODO Auto-generated method stub
return "jsp/main/main.jsp";
}
}
| [
"[email protected]"
] | |
62b4a74a21afbab42eaf5c6b8a308de73fd40436 | 8aadcae24a51c602a928500ea79110aed26faea0 | /Backend/src/main/java/com/andersenlab/crm/exceptions/OutsiderAccessException.java | ea86f7e2b0a602fd5688c348cc4c7b1b00869921 | [
"BSD-2-Clause",
"BSD-3-Clause",
"LicenseRef-scancode-generic-cla"
] | permissive | Andersen-soft/Sales.CRM | a66a7a722e7eb99e9c11ffc33e79c019b90d50e9 | 320584d659948a2b47f5a70388719366feabef92 | refs/heads/master | 2022-07-29T21:08:59.106384 | 2020-08-27T09:39:07 | 2020-08-27T09:39:07 | 284,525,952 | 12 | 11 | NOASSERTION | 2021-10-01T19:10:07 | 2020-08-02T19:17:48 | JavaScript | UTF-8 | Java | false | false | 513 | java | package com.andersenlab.crm.exceptions;
/**
* Base crm exception class
*/
public class OutsiderAccessException extends RuntimeException {
public OutsiderAccessException(Exception e) {
super(e);
}
public OutsiderAccessException(String msg) {
super(msg);
}
public OutsiderAccessException(String format, Object... args) {
super(String.format(format, args));
}
public OutsiderAccessException(String message, Exception e) {
super(message, e);
}
}
| [
"[email protected]"
] | |
032303c5d684350b3a86be80680bf22a69a5be57 | 26651d361db81ea94adffc5fe8a677a9d98cbe75 | /06_InheritanceAndPolymorphism/3/AbstractClass/src/PhysicalEntity.java | 2a7b0dbbd351bde7d4f62b508aa4304ebadebdb9 | [] | no_license | Largidak-H/skillbox_java_new | 084d6cb3185f61903d9387d8c63a1b7b4823c4e6 | 539310fbd566e3ecb68111259113100abfca0b7e | refs/heads/master | 2022-01-01T01:33:03.859550 | 2021-02-02T20:06:52 | 2021-02-02T20:06:52 | 252,516,758 | 0 | 0 | null | 2021-12-14T21:53:49 | 2020-04-02T17:03:15 | Java | UTF-8 | Java | false | false | 390 | java | import java.math.BigDecimal;
public class PhysicalEntity extends Client {
public PhysicalEntity(long account) {
setAccount(account);
}
@Override
protected BigDecimal getWithdrawCommission(double amount) {
return getBigAmount(0);
}
@Override
protected BigDecimal getReplenishCommission(double amount) {
return getBigAmount(0);
}
}
| [
"[email protected]"
] | |
e2ef56427d8c651cf9cc56e7f35b8cdf5d3d9e3b | 72dff0f24f8f9ecfea96852ef184d1523057e65b | /P173/src/p173/P173.java | 6fd76ff0c44a6048a51aba3560f10b3744bd3741 | [] | no_license | crjchfis/Programacion-1 | ef974f7414a987846de62e5da7b5d4dd1273f524 | 44534ac258717ce75086d8597203aa82bc9d25be | refs/heads/master | 2020-12-31T03:56:48.609738 | 2013-04-18T11:43:07 | 2013-04-18T11:43:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,732 | java |
package p173;
enum Formato{wav,mp3,midi,avi,mov,mpg,cdAudio,dvd}
enum Genero{rock,pop,soul,funky,tecno,bso,flamenco}
class Multimedia{
private String titulo;
private String autor;
private Formato formato;
private double duracion;
public Multimedia(String titulo,String autor,Formato formato, double duracion){
this.autor=autor;
this.duracion=duracion;
this.formato=formato;
this.titulo=titulo;
}
public String getTitulo(){
return titulo;
}
public String getAutor(){
return autor;
}
public Formato getFormato(){
return formato;
}
public double getDuracion(){
return duracion;
}
public String toString(){
return "Titulo: "+titulo+" de "+autor+"\n"+"Formato: "+formato+" Duracion:" +duracion;
}
public boolean equals(Multimedia m){
return titulo.equals(m.titulo)&& autor.equals(m.autor);
}
}
class Pelicula extends Multimedia{
private String actorPrincipal;
private String actrizPrincipal;
public Pelicula(String titulo,String autor,Formato formato, double duracion,String actor,String actriz){
super(titulo,autor,formato,duracion);
if(actor==null&&actriz==null)
throw new IllegalArgumentException("Debe haber al menos un protagonista");
actorPrincipal=actor;
actrizPrincipal=actriz;
}
public String getActor(){
return actorPrincipal;
}
public String getActriz(){
return actrizPrincipal;
}
public String toString(){
String s="Protagonizado por: ";
if(actrizPrincipal!=null){
s+=actrizPrincipal;
if(actorPrincipal!=null)
s+=" y "+actorPrincipal;
}
else{
assert actorPrincipal!=null;
s+=actorPrincipal;
}
return super.toString()+"\n"+s;
}
}
class ListaMultimedia{
private Multimedia[] lista;
private int contador;
ListaMultimedia(int tamaño){
lista=new Multimedia[tamaño];
contador=0;
}
public int size(){
return contador;
}
private boolean llena(){
return contador==lista.length;
}
public boolean add(Multimedia m){
if(llena())
return false;
else{
lista[contador]=m;
contador++;
return true;
}
}
public Multimedia get(int posicion){
if(posicion<0||posicion>contador)
throw new IndexOutOfBoundsException();
return lista[posicion];
}
public int IndexOf(Multimedia m){
for(int i=0;i<contador;i++)
if(m.equals(lista[i]))
return i;
return -1;
}
public String toString(){
String s="";
for(int i=0;i<contador;i++)
s+=lista[i].toString()+"\n\n";
return s;
}
}
class Disco extends Multimedia{
private Genero genero;
public Disco(String titulo,String autor,Formato formato, double duracion,Genero genero){
super(titulo,autor,formato,duracion);
this.genero=genero;
}
public Genero getGenero(){
return genero;
}
public String toString(){
String s;
s="Genero: "+genero;
return super.toString()+"\n"+s;
}
}
public class P173 {
public static void main(String[] args) {
ListaMultimedia lista=new ListaMultimedia(10);
int posicion;
lista.add(new Pelicula("Milion Dolar Baby","Clint Eastwood",Formato.dvd,137
,"Clint Eastwood","Hillary Swank"));
lista.add(new Pelicula("El aviador","Martin Scorsese",Formato.dvd,168
,"Leonardo Di Caprio",null));
lista.add(new Pelicula("Mar adentro","Alejandro Amenabar",Formato.avi,125
,"Javier Bardem","Belen Rueda"));
System.out.println(lista.toString());
Pelicula peli=new Pelicula("Mar adentro","Alejandro Amenabar",null,0,"","");
posicion=lista.IndexOf(peli);
System.out.println("Posicion "+posicion+"\n"+lista.get(posicion));
lista.add(new Disco("Hopes and Fears","Keane",Formato.mp3,45,Genero.pop));
lista.add(new Disco("How to dismantle an atomic bomb","u2",Formato.cdAudio,49,Genero.rock));
lista.add(new Disco("Soy gitano","Camaron",Formato.cdAudio,32,Genero.flamenco));
System.out.println(lista.toString());
Disco disco=new Disco("Soy gitano","Camaron",null,0,null);
posicion=lista.IndexOf(disco);
System.out.println("Posicion "+posicion+"\n"+lista.get(posicion));
}
}
| [
"[email protected]"
] | |
2ec5165d0b741a19a90b62f423461c3e784ba48b | 57dc9a327f33287f3ebdabe5cba2334a709aafa1 | /app/src/main/java/com/wstcon/gov/bd/esellers/utility/PaginationWithHideShowScrollListener.java | 2a6f9e4c692435d565cf60acbc27daba8bd2f4e5 | [] | no_license | salauddin23shumon/Esellers-App | acf9f676b0edd6a804b6308d777c7caecba3b715 | ef8defe702bf5f0a1f4787e352432d04c9a71f47 | refs/heads/master | 2021-07-14T05:23:03.926394 | 2021-02-19T17:53:48 | 2021-02-19T17:53:48 | 235,633,290 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,315 | java | package com.wstcon.gov.bd.esellers.utility;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
/**
* Created by delaroy on 12/5/17.
*/
public abstract class PaginationWithHideShowScrollListener extends RecyclerView.OnScrollListener {
LinearLayoutManager layoutManager;
private static final int HIDE_THRESHOLD = 20;
private int mScrolledDistance = 1;
private boolean mControlsVisible = true;
public PaginationWithHideShowScrollListener(LinearLayoutManager layoutManager) {
this.layoutManager = layoutManager;
}
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
super.onScrolled(recyclerView, dx, dy);
int visibleItemCount = layoutManager.getChildCount();
int totalItemCount = layoutManager.getItemCount();
int firstVisibleItemPosition = layoutManager.findFirstVisibleItemPosition();
if (!isLoading() && !isLastPage()) {
if ((visibleItemCount + firstVisibleItemPosition) >= totalItemCount
&& firstVisibleItemPosition >= 0
&& totalItemCount >= getTotalPageCount()) {
loadMoreItems();
}
}
int firstVisibleItem = ((LinearLayoutManager) recyclerView.getLayoutManager()).findFirstVisibleItemPosition();
if (firstVisibleItem == 0) {
if(!mControlsVisible) {
onShow();
mControlsVisible = true;
}
} else {
if (mScrolledDistance > HIDE_THRESHOLD && mControlsVisible) {
onHide();
mControlsVisible = false;
mScrolledDistance = 0;
} else if (mScrolledDistance < -HIDE_THRESHOLD && !mControlsVisible) {
onShow();
mControlsVisible = true;
mScrolledDistance = 0;
}
}
if((mControlsVisible && dy>0) || (!mControlsVisible && dy<0)) {
mScrolledDistance += dy;
}
}
protected abstract void loadMoreItems();
public abstract int getTotalPageCount();
public abstract boolean isLastPage();
public abstract boolean isLoading();
public abstract void onHide();
public abstract void onShow();
}
| [
"[email protected]"
] | |
93226006f79cf9f9fc89c9b097a5cc004d6cd0cd | ddc169a7a3b905e535daf2282c196a55e1dd9e74 | /src/chars/src/com/colloquial/chars/ShowTransliterations.java | 24b0fffd7aa7cbf6bf31a98a2c3944bb8e10c2fb | [] | no_license | rbrundrett/javabook | 78e8479347be5369981490ebca67e7e010666eef | 612a5700e7b6db285a00dc4c17e4529f9aeeec73 | refs/heads/master | 2020-12-25T00:09:14.895862 | 2014-01-20T09:56:48 | 2014-01-20T09:56:48 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 419 | java | package com.colloquial.chars;
import com.ibm.icu.text.Transliterator;
import java.util.Enumeration;
public class ShowTransliterations {
public static void main(String[] args) {
/*x ShowTransliterations.1 */
Enumeration<String> idEnum = Transliterator.getAvailableIDs();
while (idEnum.hasMoreElements())
System.out.println(idEnum.nextElement());
/*x*/
}
} | [
"[email protected]"
] | |
12ffa5c76ae8aefcd488c57100604e9b8fc12252 | 51237ba57c1cb4c55074695b3a85f9d90d186ddb | /src/test/java/NestedIf.java | 6fe27afdf4dd7e15bbdb2d3ec613c41c3b281038 | [] | no_license | vsbunga/Java | 3120faf04caee30d94a04ad5a9d8261cbdf7da6e | 2ad197dcf14789330a220052a894d3b3fc00ce67 | refs/heads/master | 2023-01-07T21:41:40.978475 | 2020-11-06T14:45:04 | 2020-11-06T14:45:04 | 307,759,167 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 461 | java | import java.sql.SQLOutput;
import java.util.SortedMap;
public class NestedIf
{
//Largest among numbers
public static void main(String[] args)
{
int a = 10, b = 20, c = 30, large;
if(a>b)
{
if(a>c)
{
large = a;
}
else
large = c;
}
else
{
large = c;
}
System.out.println(large);
}
}
| [
"[email protected]"
] | |
c3137a4d331c585c31ace7703f60fb71fb1aa4fd | 39ee0f243dee1dbc726975eb6c41e7bb53996094 | /src/saltchannel/v2/TicketBits.java | 0dee6c38185fe0e2bf7835bff007d938e4aa511a | [
"MIT",
"Python-2.0"
] | permissive | assaabloy-ppi/salt-channel | f2fb23fc5c65a3df4161b384b46955cc7016df27 | 5e390b5bf14470e09dddf0c90b891b2eb6410043 | refs/heads/master | 2023-02-25T01:31:16.112204 | 2023-02-17T08:49:02 | 2023-02-17T08:49:02 | 71,692,421 | 16 | 9 | MIT | 2021-08-24T10:03:19 | 2016-10-23T09:07:34 | Java | UTF-8 | Java | false | false | 2,817 | java | package saltchannel.v2;
import saltchannel.util.BitField;
//
// IDEA. Have step value. For example, increase ticketIndex by 1000 each time a
// ticket is issued. If last three digits are random this could provide some security
// against problem with clock set wrong so time repeats according to the host clock.
// For time-based firstTicketIndex, we cannot increase faster than time increases.
// If we assume max 1000 issued tickets per second, we can use a step size of 1000
// when time is measured in microseconds.
//
/**
* A instance of this class keeps track of all issued tickets
* that are valid using their ticket index.
* This is done by storing a single bit per valid outstanding ticket.
*
* @author Frans Lundberg
*/
public class TicketBits {
private long first;
private long next;
private BitField bits;
private final int bitSize;
/**
* Creates a new instance.
*
* @param first
* An ticket index value that must be larger than all previously
* issued tickets. All ticket indexes issued by this instance will
* be greater than or equal to 'first'.
* One possibility is to use microseconds since Epoch:
* System.currentTimeMillis() * 1000.
*/
public TicketBits(long first, int wantedBitSize) {
this.first = first;
this.next = first;
this.bits = new BitField(wantedBitSize);
this.bitSize = bits.getSize();
}
/**
* Issues a new ticket index and sets the corresponding bit to true.
*/
public long issue() {
long result = next;
bits.set((int)(next - first) % bitSize, true);
next++;
return result;
}
/**
* Returns true if ticket is in range and and its bit is set.
*/
public boolean isValid(long ticketIndex) {
return isInRange(ticketIndex) && bits.get(bitIndex(ticketIndex));
}
/**
* Clears a ticket index. If clear already, this method does nothing.
*
* @throws IllegalArgumentException
* If index is out of range.
*/
public void clear(long ticketIndex) {
if (!isInRange(ticketIndex)) {
throw new IllegalArgumentException();
}
bits.set(bitIndex(ticketIndex), false);
}
/**
* Returns true if the ticketIndex is in the current range
* of stored bits.
*/
private boolean isInRange(long ticketIndex) {
return ticketIndex >= first && ticketIndex >= (next - bitSize) && ticketIndex < next;
}
/**
* Computes bit index from ticketIndex, ticketIndex is assumed
* to be in range.
*/
private int bitIndex(long ticketIndex) {
return (int)(ticketIndex - first) % bitSize;
}
}
| [
"[email protected]"
] | |
6751c7fedf13042def9ea4dd50c246f55f5da253 | 3c445914c2c540414a787f79066eb14d656901fe | /src/application/shippingAddress.java | 2dcbdf91f2321b0972c5955d406b528625e66f0f | [] | no_license | alesnehapriya/Newark-IT-Company | c29bfa8d7e1b76697082c5a3d28b0dc7bede05b9 | 87990d08b371053a1785c6dc877e822bef141872 | refs/heads/master | 2021-05-30T13:55:02.744910 | 2016-01-19T04:22:42 | 2016-01-19T04:22:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,508 | java | package application;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import javax.swing.JOptionPane;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.TextField;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;
public class shippingAddress {
@FXML
Scene scene3;
@FXML
Stage stage;
@FXML
TextField sa_name,recp_name,street,snumber,city,zip,state,country;
@FXML
Button add;
Connection conn = null;
PreparedStatement statement2;
shippingAddress(){
stage = new Stage();
sa_name = new TextField();
recp_name = new TextField();
street = new TextField();
snumber = new TextField();
city = new TextField();
zip = new TextField();
country = new TextField();
state = new TextField();
add = new Button("ADD");
sa_name.setPromptText("Shipping Address Name");
sa_name.setLayoutX(107);
sa_name.setLayoutY(162);
recp_name.setPromptText("Recepient Name");
recp_name.setLayoutX(107);
recp_name.setLayoutY(210);
street.setPromptText("Street");
street.setLayoutX(107);
street.setLayoutY(258);
snumber.setPromptText("Street Number");
snumber.setLayoutX(107);
snumber.setLayoutY(310);
city.setPromptText("City");
city.setLayoutX(107);
city.setLayoutY(354);
zip.setPromptText("Zip");
zip.setLayoutX(107);
zip.setLayoutY(405);
state.setPromptText("State");
state.setLayoutX(107);
state.setLayoutY(457);
country.setPromptText("Country");
country.setLayoutX(107);
country.setLayoutY(508);
add.setLayoutX(107);
add.setLayoutY(562);
try{
AnchorPane page2 = (AnchorPane) FXMLLoader.load(getClass().getResource("/Interface/shipping.fxml"));
page2.setId("pane");
page2.getChildren().addAll(sa_name,recp_name,street,snumber,city,zip,state,country,add);
scene3 = new Scene(page2);
add.setOnAction(e -> insertShip());
scene3.getStylesheets().add(getClass().getResource("application.css").toExternalForm());
}
catch(Exception e1){
e1.printStackTrace();
}
stage.setTitle("Newark IT Company");
stage.setScene(scene3);
stage.show();
}
private void insertShip() {
// TODO Auto-generated method stub
signUp sign = new signUp();
System.out.println("Entered into Button");
try {
conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/newark_it_db","root","root");
String query = "insert into shipping_address values(?,?,?,?,?,?,?,?,?)";
statement2 = conn.prepareStatement(query);
statement2.setInt(1,sign.increment);
statement2.setString(2, sa_name.getText());
statement2.setString(3, recp_name.getText());
statement2.setString(4, street.getText());
statement2.setString(5, snumber.getText());
statement2.setString(6, city.getText());
statement2.setString(7, zip.getText());
statement2.setString(8, state.getText());
statement2.setString(9, country.getText());
statement2.execute();
JOptionPane.showMessageDialog(null, "Shipping Address Registered Successfully. ");
statement2.close();
conn.close();
} catch (Exception e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
clearForm();
stage.close();
}
private void clearForm() {
// TODO Auto-generated method stub
recp_name.clear();
street.clear();
snumber.clear();
city.clear();
zip.clear();
state.clear();
country.clear();
}
}
| [
"[email protected]"
] | |
6bb8fad83457726cac2587aaf8e9db952dc5e3ba | 8db49044f57a0169cc1dcacaa0dde08c9c7bd8fa | /src/main/java/com/project/uniqo/controllers/ProducerController.java | 333f9944732bd20776de20e79dd651e8a92d7a9a | [] | no_license | ivarlund/winepage | 04c4868031f8d90f0e633dfbfa9180845d8a776a | 2cf8e2727369c532ced89ffc69a0e74f9b1772f7 | refs/heads/main | 2023-02-15T01:56:58.572154 | 2021-01-09T19:32:13 | 2021-01-09T19:32:13 | 323,336,254 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 590 | java | package com.project.uniqo.controllers;
import com.project.uniqo.services.ProducerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
@Controller
public class ProducerController {
@Autowired
ProducerService producerService;
@GetMapping("/producers")
public String producerPage(Model model) {
model.addAttribute("Producers", producerService.getAllProducers());
return "producers";
}
}
| [
"[email protected]"
] | |
1b3eeadcc22f5ad6ae4fdafe347bf84b292d085a | 3e9b45bb4450cecd84bc0b13d0507ca1ff31e977 | /universityAppl/src/main/java/com/example/universityappl/UniversityApplApplication.java | 7805551ca884ed61be2a23d1cd703210a93b39c7 | [] | no_license | skander-ayedi/spring | c71a43ec4f2bf9ee3d6f77e7ea7b6ee88c498417 | b7bd1e47e77c0d2a449fad63b59fae351b1b285c | refs/heads/main | 2023-08-22T03:28:24.346279 | 2021-09-14T22:32:43 | 2021-09-14T22:32:43 | 406,535,665 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 347 | java | package com.example.universityappl;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class UniversityApplApplication {
public static void main(String[] args) {
SpringApplication.run(UniversityApplApplication.class, args);
}
}
| [
"[email protected]"
] | |
e02ac93bab79d5c2e90ad8a15e6f71a5548b912b | f7a2fa4b0585b2b9586f62f5fd6400f81fe9e390 | /feign-client-02/src/main/java/com/suchaos/learn/spring/cloud/feign/config/FeignServiceConfig.java | 813f0e33127ebdbf75563a14142c8bd97e6cdc8f | [] | no_license | suchaos/learn-spring-cloud | 1cf486a25e76c440c85b10154eef70cc0302c5b4 | 2374b56f084a23c92835379fb87ecf74d46da111 | refs/heads/master | 2022-12-16T01:19:04.941833 | 2020-09-15T02:45:21 | 2020-09-15T02:45:21 | 295,593,475 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 399 | java | package com.suchaos.learn.spring.cloud.feign.config;
import feign.Logger;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* Feign 全局配置
*
* @author suchao
* @date 2020/9/10
*/
@Configuration
public class FeignServiceConfig {
@Bean
Logger.Level feignLoggerLevel() {
return Logger.Level.FULL;
}
}
| [
"[email protected]"
] | |
4cc047e345a25834d063fcd475d1e9b7774c40bf | e25a06c7ce8baa1daf1f9abece12d3dc85fcf53a | /app/src/main/java/edu/buffalo/cse/cse486586/simpledht/SimpleDhtActivity.java | 35fc0e633d341562f81a9c121441a6a7d34143d7 | [] | no_license | anni23/Distributed-Hash-Table | f3025c0d224345168a439addbc5df3e5ac38ee1e | 21d8450b008dede38ca5e34c79cc168958d65f36 | refs/heads/master | 2021-09-04T00:12:45.652579 | 2018-01-13T06:45:44 | 2018-01-13T06:45:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,077 | java | package edu.buffalo.cse.cse486586.simpledht;
import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
import android.app.Activity;
import android.os.StrictMode;
import android.telephony.TelephonyManager;
import android.text.method.ScrollingMovementMethod;
import android.util.Log;
import android.view.Menu;
import android.widget.TextView;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.net.InetAddress;
import java.net.Socket;
public class SimpleDhtActivity extends Activity {
ContentValues cv;
ContentResolver cr;
Uri.Builder ub;
Uri uri;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_simple_dht);
TelephonyManager tel = (TelephonyManager) this.getSystemService(Context.TELEPHONY_SERVICE);
String portStr = tel.getLine1Number().substring(tel.getLine1Number().length() - 4);
final String myPort = String.valueOf((Integer.parseInt(portStr) * 2));
// Log.i("port number",myPort);
/* ub=new Uri.Builder();
ub.authority("edu.buffalo.cse.cse486586.simpledht.provider");
ub.scheme("content");
uri=ub.build();
cr=getContentResolver();
cv = new ContentValues();
cv.put("key", "port-no");
cv.put("value", myPort);
cr.insert(uri, cv);
*/
TextView tv = (TextView) findViewById(R.id.textView1);
tv.setMovementMethod(new ScrollingMovementMethod());
findViewById(R.id.button3).setOnClickListener(
new OnTestClickListener(tv, getContentResolver()));
/* String requestType = "join";
String joinPort = "11108";
String msg = myPort;
String msgToSend = "hello";
OutputStream osc;
PrintWriter pwc;
InputStream isc;
InputStreamReader isrc;
BufferedReader brc;
Socket socket;
String ackc;
Log.i("-----------------------", "-----------------------------");
Log.i("---", "--------------------------CLIENT--------------------------");
Log.i("-----------------------", "-----------------------------");
try {
socket = new Socket(InetAddress.getByAddress(new byte[]{10, 0, 2, 2}),
Integer.parseInt(joinPort));
ackc = "PA1_OK";
osc = socket.getOutputStream();
pwc = new PrintWriter(osc);
pwc.write(msgToSend);
pwc.flush();
} catch (Exception e)
{
e.printStackTrace();
}
*/
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
//getMenuInflater().inflate(R.menu.activity_simple_dht_main, menu);
return true;
}
} | [
"[email protected]"
] | |
df6edf0d3e71d55de8d960950fdc8f5f2e7568d8 | a853a3fdb5c1cd6f32c9ef1ce9f54910e66b781e | /src/main/java/game/Menu.java | 8f045a4f344156b02f92e007b3190ee6265fce25 | [] | no_license | ReimoSaar/Adventurer | 3c3fd780a2f42597c423dd87ded256ee72447f84 | e4da40276d9b5d7af6af0a87d1ad6624c3367297 | refs/heads/master | 2022-04-25T04:46:37.924376 | 2020-04-25T10:07:58 | 2020-04-25T10:07:58 | 258,506,341 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,917 | java | package game;
import game.characters.Player;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.ImageObserver;
public class Menu {
private boolean showMainButtons = true;
private boolean showStages = false;
private RectangleImage continueButton;
private RectangleImage exit;
private RectangleImage selectStage;
private RectangleImage stage1;
private RectangleImage stage2;
private RectangleImage menuBackground;
private Save save;
public Menu() {
save = new Save();
menuBackground = new RectangleImage(GameImage.getImage("background"), 0.0f, 0.0f, 1.0f, 1.0f);
continueButton = new RectangleImage(GameImage.getImage("menu/continue"), 0.45f, 0.2f, 0.1f, 0.1f);
selectStage = new RectangleImage(GameImage.getImage("menu/select_stage"), 0.45f, 0.4f, 0.1f, 0.1f);
exit = new RectangleImage(GameImage.getImage("menu/exit"), 0.45f, 0.6f, 0.1f, 0.1f);
stage1 = new RectangleImage(GameImage.getImage("menu/stage_1"), 0.45f, 0.1f, 0.1f, 0.1f);
stage2 = new RectangleImage(GameImage.getImage("menu/stage_1"), 0.45f, 0.3f, 0.1f, 0.1f);
}
public void renderMenu(Graphics g, ImageObserver imageObserver) {
Graphics2D g2 = (Graphics2D) g;
menuBackground.draw(g2, imageObserver);
if (showMainButtons) {
continueButton.draw(g2, imageObserver);
exit.draw(g2, imageObserver);
selectStage.draw(g2, imageObserver);
}
if (showStages) {
stage1.draw(g2, imageObserver);
stage2.draw(g2, imageObserver);
}
}
private boolean isOnButton(RectangleImage rectangleImage, MouseEvent e) {
float mx = e.getX();
float my = e.getY();
return mx >= rectangleImage.getRectangle().x && mx <= rectangleImage.getRectangle().x + rectangleImage.getRectangle().width &&
my >= rectangleImage.getRectangle().y && my <= rectangleImage.getRectangle().y + rectangleImage.getRectangle().height;
}
public void mousePressed(MouseEvent e, Game game) {
if (showMainButtons) {
//continue
if (isOnButton(continueButton, e)) {
game.getGameState().setState(GameState.IN_GAME);
game.getLevelState().setState(LevelState.LEVEL_1);
game.getLevelState().loadLevelState();
save.loadFile("save player.txt");
Player.loadPlayer = true;
game.getEnemyBot().loadEnemyBots(game.getLevelState());
game.getPlatform().loadPlatforms(game.getLevelState());
game.getGameBackground().loadBackground(game.getLevelState());
}
//select stage
if (isOnButton(selectStage, e)) {
showStages = true;
showMainButtons = false;
}
//exit
if (isOnButton(exit, e)) {
System.exit(-1);
}
}
if (showStages) {
//stage 1
if (isOnButton(stage1, e)) {
game.getGameState().setState(GameState.IN_GAME);
game.getLevelState().setState(LevelState.LEVEL_1);
game.getEnemyBot().addLevel1Enemies(game.getLevelState());
game.getDialogue().addLevel1Dialogues();
game.getAutoSave().addLevel1Checkpoints();
}
//stage 2
if (isOnButton(stage2, e)) {
game.getGameState().setState(GameState.IN_GAME);
game.getLevelState().setState(LevelState.LEVEL_2);
game.getEnemyBot().addLevel2Enemies(game.getLevelState());
}
}
}
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ESCAPE && !showMainButtons) {
showMainButtons = true;
showStages = false;
}
}
}
| [
"[email protected]"
] | |
34cbd214a2e53ba64be0521ed65999c8401d5d17 | 8cba34f2ab0e28408b7bafdf1bf47e6df4b95475 | /Hill-Honda-Zombie-Kill_1.1/src/Tiles/TileAccessories.java | 86145f7b021a54cbfd8066f1e94c1ad32bf582eb | [] | no_license | fuadhasanse/SWE-224-Java-Game-Project-Hill-Honda-Zombie-Kill | 351cbab844d822d6b322ce59fc73cb2b1cfdd015 | 6b0cc917a470cae3cfde4493e406573173d34782 | refs/heads/master | 2020-11-25T12:59:40.519908 | 2019-07-21T16:41:51 | 2019-07-21T16:41:51 | 228,675,072 | 1 | 0 | null | 2019-12-17T18:11:13 | 2019-12-17T18:11:12 | null | UTF-8 | Java | false | false | 3,992 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Tiles;
import java.awt.*;
import java.awt.image.*;
import java.io.*;
import javax.imageio.ImageIO;
import Main.GameBoard;
/**
*
* @author Raihan
*/
public class TileAccessories {
private static double x;
private static double y;
private int xmin;
private int ymin;
private int xmax;
private int ymax;
private double tween;
private int[][] map;
private int tileSize;
private int numRows;
private int numCols;
private int width;
private int height;
private BufferedImage tileset;
private int numTilesAcross;
private TileController[][] tiles;
private int rowOffset;
private int colOffset;
private int numRowsToDraw;
private int numColsToDraw;
public TileAccessories(int tileSize) {
this.tileSize = tileSize;
numRowsToDraw = GameBoard.HEIGHT / tileSize + 2;
numColsToDraw = GameBoard.WIDTH / tileSize + 2;
tween = 0.07;
}
public void loadTiles(String s) {
try {
tileset = ImageIO.read(
getClass().getResourceAsStream(s)
);
numTilesAcross = tileset.getWidth() / tileSize;
tiles = new TileController[2][numTilesAcross];
BufferedImage subimage;
for(int col = 0; col < numTilesAcross; col++) {
subimage = tileset.getSubimage(
col * tileSize,
0,
tileSize,
tileSize
);
tiles[0][col] = new TileController(subimage, TileController.NORMAL);
subimage = tileset.getSubimage(
col * tileSize,
tileSize,
tileSize,
tileSize
);
tiles[1][col] = new TileController(subimage, TileController.BLOCKED);
}
}
catch(Exception e) {
e.printStackTrace();
}
}
public void loadMap(String s) {
try {
InputStream in = getClass().getResourceAsStream(s);
BufferedReader br = new BufferedReader(
new InputStreamReader(in)
);
numCols = Integer.parseInt(br.readLine());
numRows = Integer.parseInt(br.readLine());
map = new int[numRows][numCols];
width = numCols * tileSize;
height = numRows * tileSize;
xmin = GameBoard.WIDTH - width;
xmax = 0;
ymin = GameBoard.HEIGHT - height;
ymax = 0;
String delims = "\\s+";
for(int row = 0; row < numRows; row++) {
String line = br.readLine();
String[] tokens = line.split(delims);
for(int col = 0; col < numCols; col++) {
map[row][col] = Integer.parseInt(tokens[col]);
}
}
}
catch(Exception e) {
e.printStackTrace();
}
}
public int getTileSize() { return tileSize; }
public static double getx() { return x; }
public static double gety() { return y; }
public int getWidth() { return width; }
public int getHeight() { return height; }
public int getType(int row, int col) {
int rc = map[row][col];
int r = rc / numTilesAcross;
int c = rc % numTilesAcross;
return tiles[r][c].getType();
}
public void setTween(double d) { tween = d; }
public void setPosition(double x, double y) {
this.x += (x - this.x) * tween;
this.y += (y - this.y) * tween;
fixBounds();
colOffset = (int)-this.x / tileSize;
rowOffset = (int)-this.y / tileSize;
}
private void fixBounds() {
if(x < xmin) x = xmin;
if(y < ymin) y = ymin;
if(x > xmax) x = xmax;
if(y > ymax) y = ymax;
}
public void draw(Graphics2D g) {
for(
int row = rowOffset;
row < rowOffset + numRowsToDraw;
row++) {
if(row >= numRows) break;
for(
int col = colOffset;
col < colOffset + numColsToDraw;
col++) {
if(col >= numCols) break;
if(map[row][col] == 0) continue;
int rc = map[row][col];
int r = rc / numTilesAcross;
int c = rc % numTilesAcross;
g.drawImage(
tiles[r][c].getImage(),
(int)x + col * tileSize,
(int)y + row * tileSize,
null
);
}
}
}
} | [
"[email protected]"
] | |
c75f76bde65ea7baf0689653d87503fd1ef61f6c | d32cbe74af5fcd86083214c00b9098fd1ebca815 | /pushLib/src/main/java/com/wl/pushutils/push/jpush/JPushReceiver.java | 5cc29f70bd221f9143f03b72a396d0f91a70b622 | [] | no_license | jiawei-paopao/push | db0079378193cdf016b8e420f241921a4558fc89 | 344944b0ab012d2fa121aec1763eb68329fe802b | refs/heads/master | 2022-04-25T13:58:12.026849 | 2019-05-17T11:49:42 | 2019-05-17T11:49:42 | 259,614,566 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,215 | java | package com.wl.pushutils.push.jpush;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import com.orhanobut.logger.Logger;
import com.wl.pushutils.push.PushControlUtils;
import com.wl.pushutils.push.PushMessageCallBack;
import com.wl.pushutils.uitls.RomUtils;
import cn.jpush.android.api.JPushInterface;
/**
* @Description: 极光推送自定义接收器
*/
public class JPushReceiver extends BroadcastReceiver {
private static final String TAG = "JPush";
private PushMessageCallBack mMessageCallBack = PushControlUtils.getInstance();
@Override
public void onReceive(Context context, Intent intent) {
try {
Bundle bundle = intent.getExtras();
if (JPushInterface.ACTION_REGISTRATION_ID.equals(intent.getAction())) {
//极光注册成功,分发RegistrationID
//RegistrationID:SDK向JPush Server注册所得到的注册ID
//一般来说,可不处理此广播信息
String regId = bundle.getString(JPushInterface.EXTRA_REGISTRATION_ID);
// TODO: 2018/11/12
Logger.t(TAG).d("极光注册ID:%s", regId);
} else if (JPushInterface.ACTION_MESSAGE_RECEIVED.equals(intent.getAction())) {
//接收到自定义消息
//自定义消息:SDK只是传递,不会有任何界面上的展示(通知栏不显示),所以必须在此处处理
//需要在 AndroidManifest.xml 里配置此 Receiver action
operatorJPushMessage(context, bundle);
} else if (JPushInterface.ACTION_NOTIFICATION_RECEIVED.equals(intent.getAction())) {
//接收到JPush通知,如果通知为空,则在通知栏上不会展示通知
//但是这个广播Intent还是会有,开发者可以取到通知内容外的其他信息
//富媒体消息也在这里
String title = bundle.getString(JPushInterface.EXTRA_NOTIFICATION_TITLE);//标题
String content = bundle.getString(JPushInterface.EXTRA_ALERT);//对应于推送框内的信息
String extras = bundle.getString(JPushInterface.EXTRA_EXTRA);//字段json
//.........还有好多可以接受的内容,详见api
// TODO: 2018/11/12
Logger.t(TAG).d("极光推送通知:"
+ "\n" + "标题:" + title
+ "\n" + "内容:" + content
+ "\n" + "额外:" + extras);
if (RomUtils.isVivo()) {
//移除所有通知~
// TODO: 2019/5/8 VIVO没有透传消息,通知栏通知到达时也没有回调,只有点击才会有回调结果,
// TODO: 2019/5/8 针对这种情况,同时也初始化极光推送,用极光推送来处理通知到达时的回调。
// TODO: 2019/5/8 需要对极光做处理:1.静默处理 2.在极光通知到达时,极光的回调广播里立即
// TODO: 2019/5/8 清除所有极光的通知,只留下VIVO的,这样瞒天过海,偷天换日。3.推送开关
// TODO: 2019/5/8 出添加极光相应的开关
JPushInterface.clearAllNotifications(context);
}
mMessageCallBack.onPushNoticeArrive(context, extras);
} else if (JPushInterface.ACTION_NOTIFICATION_OPENED.equals(intent.getAction())) {
//用户点击了通知栏的通知
//没注册广播,默认打开应用程序的主Activity,相当于用户点击桌面图标的效果
//注册了就不会默认打开主Activity,在这里处理逻辑
onClickReceivedNotification(context, bundle);
} else if (JPushInterface.ACTION_RICHPUSH_CALLBACK.equals(intent.getAction())) {
//此处尽然也可以处理富消息
//在这里根据 JPushInterface.EXTRA_EXTRA 的内容处理代码,比如打开新的Activity, 打开一个网页等..
// TODO: 2018/11/12
} else if (JPushInterface.ACTION_CONNECTION_CHANGE.equals(intent.getAction())) {
//JPush 服务的连接状态发生变化。(注:不是指 Android 系统的网络连接状态。)
boolean connected = intent.getBooleanExtra(JPushInterface.EXTRA_CONNECTION_CHANGE, false);
} else {
// TODO: 2018/11/12
}
} catch (Exception e) {
Logger.t(TAG).e(e.getMessage());
}
}
/**
* 处理JPush消息
*
* @param context
* @param bundle
*/
private void operatorJPushMessage(Context context, Bundle bundle) {
//推送的标题
String title = bundle.getString(JPushInterface.EXTRA_TITLE);
//推送的内容
String message = bundle.getString(JPushInterface.EXTRA_MESSAGE);
//额外字段(JSON字符串)
String extras = bundle.getString(JPushInterface.EXTRA_EXTRA);
//logger
Logger.t(TAG).d("极光推送消息:"
+ "\n" + "标题:" + title
+ "\n" + "内容:" + message
+ "\n" + "额外:" + extras);
//业务处理
mMessageCallBack.onReceiverMessage(context, extras);
}
/**
* 处理通知栏通知的点击事件
*
* @param context
* @param bundle
*/
private void onClickReceivedNotification(Context context, Bundle bundle) {
String title = bundle.getString(JPushInterface.EXTRA_NOTIFICATION_TITLE);//标题
String content = bundle.getString(JPushInterface.EXTRA_ALERT);//对应于推送框内的信息
String extras = bundle.getString(JPushInterface.EXTRA_EXTRA);//字段json
Logger.t(TAG).d("点击了通知栏的JPush通知:"
+ "\n" + "标题:" + title
+ "\n" + "内容:" + content
+ "\n" + "额外:" + extras);
mMessageCallBack.onPushNoticeClick(context, extras);
}
}
| [
"[email protected]"
] | |
141d2efe770e7511829df36e4feea76db0d7a366 | a83cf28d3adbc706b754a2d9a8e84162351ddc30 | /FrontrollerWebApp/src/com/nt/command/ProfileCommand.java | 8f9d12fd2befa8cecff8ea619566e4cdf2bc68e1 | [] | no_license | nerdseeker365/NTDP912 | 411cbf12395202d4bf0589fc3b6ac5510181e839 | 9c3b7231d3738b96c4f18480a919da23c7764169 | refs/heads/master | 2022-03-24T06:55:33.059743 | 2020-01-01T05:11:40 | 2020-01-01T05:11:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 773 | java | package com.nt.command;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.nt.dto.ProfileDTO;
import com.nt.service.ProfileMgmtService;
import com.nt.service.ProfileMgmtServiceImpl;
public class ProfileCommand implements Command {
private ProfileMgmtService service;
public ProfileCommand() {
service=new ProfileMgmtServiceImpl();
}
@Override
public String execute(HttpServletRequest req, HttpServletResponse res) throws Exception {
ProfileDTO dto=null;
//use service
dto=service.fetchProfileById(Integer.parseInt(req.getParameter("id")));
//keep dto in request scope
req.setAttribute("profileInfo", dto);
//return logical view name
return "show_profile";
}
}
| [
"[email protected]"
] | |
4b37622a89392395b2659546aab06d0aff529c8b | 0a4db43704cbe0b7d9f8fe32e50d11b1fe4dc1b6 | /src/main/java/ru/butakov/springdemo/jackson/Cat6.java | c2ceb9287cdb5b1c416633d5b6e241ff42cabc69 | [] | no_license | mello1984/spring-demo | 0ec53dcf9e7631fe219fd9171dbec03a0eaf47e9 | 8ed3a03f038d2ef1bc19122ce8c13aa9cfe16db1 | refs/heads/master | 2023-07-17T03:10:44.584696 | 2021-09-06T18:35:02 | 2021-09-06T18:35:02 | 398,746,797 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 432 | java | package ru.butakov.springdemo.jackson;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonView;
import lombok.AccessLevel;
import lombok.Data;
import lombok.experimental.FieldDefaults;
import java.time.LocalDate;
@Data
@FieldDefaults(level = AccessLevel.PRIVATE, makeFinal = true)
public class Cat6 {
String name;
int age;
@JsonProperty("day")
LocalDate birthday;
}
| [
"[email protected]"
] | |
8da9e9ad80799bde9cbae287997671b834e28ebd | 2964025b4cb7a3879cda360f7565efa7f9f648ef | /ChinAmerica/src/test/ProductDAOTest.java | 2f8fd0946648f9c9b4f5cfc00b633552caf3734d | [] | no_license | guitassinari/ChinAmerica | ff9d314791fb5b6d0b621747119774f2228ec175 | 7e4b4fba9a130aa2e8ee128a42373fd3558af508 | refs/heads/master | 2020-04-06T04:17:46.218372 | 2016-06-16T13:10:22 | 2016-06-16T13:10:22 | 58,137,063 | 0 | 0 | null | 2016-06-08T23:55:12 | 2016-05-05T14:31:55 | HTML | UTF-8 | Java | false | false | 842 | java | package test;
import org.junit.Assert;
import org.junit.Test;
import database.ProductDAO;
import model.Product;
import model.ProductType;
public class ProductDAOTest {
@Test
public void addAndDeleteGetByNameProductTest() {
String name = "Produto Teste";
Float price = 1f;
ProductType type = ProductType.FOOD;
Product product = new Product();
product.setName(name);
product.setPrice(price);
product.setProductType(type);
ProductDAO database = new ProductDAO();
database.addProduct(product);
Product retrievedProduct = database.getProductByName(name);
Assert.assertEquals(name, retrievedProduct.getName());
database.deleteProduct(retrievedProduct.getId());
retrievedProduct = database.getProductByName(name);
Assert.assertNull(retrievedProduct);
}
}
| [
"[email protected]"
] | |
0f5e17cbf8e672fd60e12259c71856f8069f9408 | e62e7821823cdc920512f64744055d2e693edbbc | /src/main/java/org/jlu/telstraapp/sms/SMSResponse.java | 6ae6e2b188ebb33ee5b0af6a220ff9f0b2c18441 | [] | no_license | jonathanlu101/sms_poll_app | 741c61ecef00b65b92015115bb73a74137432630 | d04566135454395b3b6947477b0c8dfb0644c463 | refs/heads/master | 2021-01-12T05:51:42.339279 | 2016-12-28T12:51:01 | 2016-12-28T12:51:01 | 77,220,658 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,343 | java | package org.jlu.telstraapp.sms;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import com.fasterxml.jackson.annotation.JsonGetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonSetter;
@Entity
@Table(name = "sms_response")
public class SMSResponse {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column (name="sms_response_id")
private int smsResponseId;
@Column(name="origin")
private String from;
@Column(name="acknowledged_timestamp")
private String acknowledgedTimestamp;
@Column(name="content")
private String content;
@ManyToOne
@JoinColumn(name="sms_message_id")
@JsonIgnore
private SMSMessage smsMessage;
public SMSResponse(){
}
public SMSResponse(SMSMessage smsMessage, String from, String acknowledgedTimestamp,
String content) {
this.smsResponseId = smsResponseId;
this.smsMessage = smsMessage;
this.from = from;
this.acknowledgedTimestamp = acknowledgedTimestamp;
this.content = content;
}
@JsonGetter("from")
public String getFrom ( ) {
return this.from;
}
@JsonSetter("from")
public void setFrom (String value) {
this.from = value;
}
@JsonGetter("acknowledgedTimestamp")
public String getAcknowledgedTimestamp ( ) {
return this.acknowledgedTimestamp;
}
@JsonSetter("acknowledgedTimestamp")
public void setToAcknowledgedTimestamp (String value) {
this.acknowledgedTimestamp = value;
}
@JsonGetter("content")
public String getContent ( ) {
return this.content;
}
@JsonSetter("content")
public void setContent (String value) {
this.content = value;
}
public SMSMessage getSmsMessage() {
return smsMessage;
}
public void setSmsMessage(SMSMessage smsMessage) {
this.smsMessage = smsMessage;
}
public int getSmsResponseId() {
return smsResponseId;
}
public void setSmsResponseId(int sms_response_id) {
this.smsResponseId = sms_response_id;
}
}
| [
"[email protected]"
] | |
7cf0b98f1c9c409da8b0bc16357738606612945a | 74584c6a815800831e289cf6aae69fc2ee5fe567 | /MobiPay/src/com/example/mobipay/NFC_receive.java | c9cc2f179cf3463564746a09fbc28755a84c0869 | [] | no_license | JingsongCHEN/NFC_Payment_System | d2a7afab26e7485619ea2fe1a84f1c33ffb66290 | e74b20eb31283bfebd23dcd3668f6d50b74dfec1 | refs/heads/master | 2021-01-02T22:53:28.010915 | 2017-08-05T09:29:35 | 2017-08-05T09:29:35 | 99,412,928 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 9,191 | java | package com.example.mobipay;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.PendingIntent;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.nfc.NdefMessage;
import android.nfc.NdefRecord;
import android.nfc.NfcAdapter;
import android.nfc.Tag;
import android.os.Bundle;
import android.os.Parcelable;
import android.provider.Settings;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import org.json.JSONException;
import org.json.JSONObject;
public class NFC_receive extends Activity {
private NfcAdapter mNfcAdapter;//nfc适配器
private TextView payloadTV;
private PendingIntent mPendingIntent;
private Context mcontext;
String NFCString = "";//接受得到的字符串内容
String merchant_id ="";
String detail = "";
String amount = "";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_nfc_receive);
mcontext = this;
payloadTV = (TextView) findViewById(R.id.payload);
checkNfcFunction();//检查nfc功能
mPendingIntent = PendingIntent.getActivity(this, 0,
new Intent(this,getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP),0 );
resolveIntent(getIntent());//处理得到的nfcIntent
final EditText Password = new EditText(this);
final Dialog alertDialog = new AlertDialog.Builder(this).setTitle("请输入").setIcon(
android.R.drawable.ic_dialog_info).setView(
Password).setPositiveButton("确定", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Account.payPassword = "";
Account.payPassword = Password.getText().toString();
Password.setText("");
int flag = -2;
try {
flag = Account.payWithPassword(merchant_id, amount, detail);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if(flag==0)
{
new AlertDialog.Builder(NFC_receive.this)
.setTitle("提示") .setMessage("交易成功")
.setPositiveButton("确定", null)
.show();
}
else if(flag == -1)
{
new AlertDialog.Builder(NFC_receive.this)
.setTitle("错误") .setMessage("手机时间与服务器不匹配")
.setPositiveButton("确定", null)
.show();
}
else if(flag == -2)
{
new AlertDialog.Builder(NFC_receive.this)
.setTitle("错误") .setMessage("余额不足")
.setPositiveButton("确定", null)
.show();
}
else if(flag <= -3)
{
int chance = -flag-2;
new AlertDialog.Builder(NFC_receive.this)
.setTitle("错误") .setMessage("密码错误,剩余尝试次数:"+chance+"次!")
.setPositiveButton("确定", null)
.show();
}
else if(flag > 0)
{
int time = flag;
new AlertDialog.Builder(NFC_receive.this)
.setTitle("错误") .setMessage("账户已锁定,剩余时间:"+time+"秒!")
.setPositiveButton("确定", null)
.show();
}
}
})
.setNegativeButton("取消", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
}
}).create();
final Button button1=(Button)findViewById(R.id.button1);
button1.setOnClickListener(new OnClickListener()
{
public void onClick(View v)
{
alertDialog.show();
}
});
}
private void checkNfcFunction() {
// TODO Auto-generated method stub
mNfcAdapter = NfcAdapter.getDefaultAdapter(this);
if(mNfcAdapter == null){
//不支持nfc功能
Toast.makeText(mcontext, "你的设备不支持nfc",Toast.LENGTH_LONG);
finish();
}else{
if(!mNfcAdapter.isEnabled()){
//设备未开启
Intent intent = new Intent(Settings.ACTION_WIRELESS_SETTINGS);
Toast.makeText(mcontext, "你的nfc未开启",Toast.LENGTH_LONG);
startActivity(intent);
return ;
}else if(!mNfcAdapter.isNdefPushEnabled()){
Toast.makeText(mcontext, "你的数据推送无法实现",Toast.LENGTH_LONG);
finish();
}
}
}
@Override
protected void onNewIntent(Intent intent) {
// TODO Auto-generated method stub
super.onNewIntent(intent);
/*if(NfcAdapter.ACTION_NDEF_DISCOVERED.equals(getIntent().getAction())){
resolveIntent(intent);
}*/
resolveIntent(intent);//处理接收到的intent
}
private void resolveIntent(Intent intent) {//处理intent内容
// TODO Auto-generated method stub
String action = intent.getAction();
if(NfcAdapter.ACTION_NDEF_DISCOVERED.equals(action)){//核对得到的intent类型与所需要的类型是否相同
NdefMessage[] messages = null;
Tag tag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);//获得标签
Parcelable[] rawMsgs = intent.getParcelableArrayExtra(NfcAdapter.EXTRA_NDEF_MESSAGES);
if(rawMsgs != null){
messages = new NdefMessage[rawMsgs.length];
for(int i=0;i<rawMsgs.length;i++){
messages[i] = (NdefMessage)rawMsgs[i];//从标签中获得信息
}
}else{
byte[] empty = new byte[]{};
NdefRecord record = new NdefRecord(NdefRecord.TNF_UNKNOWN,empty,empty,empty);
NdefMessage msg = new NdefMessage(new NdefRecord[]{record});
messages = new NdefMessage[]{msg};
}
processNDEFMsg(messages);
}else if(NfcAdapter.ACTION_TECH_DISCOVERED.equals(action)){
}else if(NfcAdapter.ACTION_TAG_DISCOVERED.equals(action)){
}else{
}
}
private void processNDEFMsg(NdefMessage[] messages) {
// TODO Auto-generated method stub
//处理ndef信息
if(messages == null || messages.length == 0){
return ;
}
for(int i=0;i<messages.length;i++){
int length = messages[i].getRecords().length;
NdefRecord[] records = messages[i].getRecords();
for(int j=0;j<length;j++){
for(NdefRecord record:records){
parseRTDUriRecord(record);
}
}
}
}
private void parseRTDUriRecord(NdefRecord record) {
//解析记录中的信息
// TODO Auto-generated method stub
Uri uri = MyNFCRecordParse.parseWellKnownUriRecord(record);
NFCString = uri.toString();
try {
JSONObject jsonObject;
jsonObject = new JSONObject(NFCString);
merchant_id = jsonObject.getString("merchant_id");
amount = jsonObject.getString("amount");
detail = jsonObject.getString("detail");
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
payloadTV.setText(merchant_id+"\n"+"账单详情:"+detail+"\n"+"金额:"+amount);
}
private void enableForegroudDispatch(){
if(mNfcAdapter!=null){
mNfcAdapter.enableForegroundDispatch(this, mPendingIntent, null, null);
}
}
private void disableForegroudDispatch(){
if(mNfcAdapter!=null){
mNfcAdapter.disableForegroundDispatch(this);
}
}
@Override
protected void onResume() {
// TODO Auto-generated method stub
super.onResume();
enableForegroudDispatch();
}
@Override
protected void onPause() {
// TODO Auto-generated method stub
super.onPause();
disableForegroudDispatch();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// TODO Auto-generated method stub
return super.onCreateOptionsMenu(menu);
}
@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;
}
return super.onOptionsItemSelected(item);
}
}
| [
"[email protected]"
] | |
c9aab717ece832c91c0af906fc0d6a7d9006f1f9 | fd347269c4a1c9ace85f7e1b9a6bfa3f1783c18a | /第四章/ClearScreen.java | 5e32a132c46a9d2cf5c62c2a66b6300aaa443928 | [] | no_license | yangdongzju1976/java | e9a9495d1c52df626825af82716e4f8e02c5fe2f | 3106dc246024e80eb3f4781e841160e2de6e2f5e | refs/heads/master | 2023-02-28T12:46:54.763102 | 2021-02-01T00:30:47 | 2021-02-01T00:30:47 | 295,046,298 | 0 | 0 | null | 2020-09-13T00:14:04 | 2020-09-12T23:55:39 | null | UTF-8 | Java | false | false | 281 | java | #include <jni.h>
#include "ClearScreen.h"
#include <stdlib.h>
public class ClearScreen {
static {
System.loadLibrary("Clear");
}
public native static void clearScreen();
public static void main(String[] args) {
clearScreen();
}
} | [
"[email protected]"
] | |
9418f7e5e6e034634f64356a7597ec8bdc5067a6 | b63dcaaa68b0df6ea73ff1b4db50104096926636 | /ht-micro-record-commons-mapper/src/main/java/com/ht/micro/record/commons/mapper/baseMapper/TFunctionMapper.java | 14734a64b6c4b30c8df415784d9a48befbbe58f4 | [] | no_license | reference-project/SpringCloudAlibaba-1 | 7f825320df876a9b3a8fd6bd5ea255e5cc553e5a | 216398663e78994703f177581e94cfaea7d98db2 | refs/heads/master | 2020-09-30T11:28:45.858462 | 2019-08-23T02:35:13 | 2019-08-23T02:35:13 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 209 | java | package com.ht.micro.record.commons.mapper.baseMapper;
import com.ht.micro.record.commons.domain.TFunction;
import tk.mybatis.mapper.MyMapper;
public interface TFunctionMapper extends MyMapper<TFunction> {
} | [
"[email protected]"
] | |
42e4f9fc8a3e8b1eb980d669347c2284910166da | 19e77d9b0d85ee50f87be4031f1cc2b5af045fd9 | /app/repository/CompanyRepository.java | 96d920019b0681fd058965c25528ad706c02eb2e | [] | no_license | sergrosh/de.idnow.example | 4a1166930c958d545580d41d32ffa842f60e27e6 | 0916a3da50e9a2d3839af7ffbfd35a403f028c5b | refs/heads/master | 2020-04-23T10:12:44.253255 | 2019-02-18T07:34:47 | 2019-02-18T07:34:47 | 171,096,275 | 0 | 0 | null | 2019-02-17T07:57:29 | 2019-02-17T07:57:29 | null | UTF-8 | Java | false | false | 1,423 | java | package repository;
import com.avaje.ebean.Ebean;
import com.avaje.ebean.EbeanServer;
import models.CompanyEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import play.db.ebean.EbeanConfig;
import javax.inject.Inject;
import java.util.Optional;
/**
* Company repository
*
* @author Sergii R.
* @since 17/02/19
*/
public class CompanyRepository {
private static final Logger LOG = LoggerFactory.getLogger(CompanyRepository.class);
private final EbeanServer ebeanServer;
@Inject
public CompanyRepository(EbeanConfig ebeanConfig) {
ebeanServer = Ebean.getServer(ebeanConfig.defaultServer());
}
public boolean save(CompanyEntity companyEntity) {
Optional<CompanyEntity> company = Optional.ofNullable(ebeanServer.find(CompanyEntity.class).setId(companyEntity.getId()).findUnique());
if (company.isPresent()) {
LOG.warn("Company with id {} already exists", companyEntity.getId());
return false;
}
ebeanServer.save(companyEntity);
return true;
}
public CompanyEntity getById(Long id) {
return ebeanServer.find(CompanyEntity.class).setId(id).findUnique();
}
public void delete(Long id) {
Optional<CompanyEntity> companyEntity = Optional.ofNullable(ebeanServer.find(CompanyEntity.class).setId(id).findUnique());
companyEntity.ifPresent(ebeanServer::delete);
}
}
| [
"[email protected]"
] | |
31552500ebb364b99c943bd4e6583497b922dfa1 | cdf6e739a436cc0de0f5d9d053e4db387b5de7bc | /rabbitmq-spring-demo/src/test/java/com/javahowtos/activemqdemo/RabbitMqDemoApplicationTests.java | 92244ff55a8f6341caabdf79523eadf28047fe59 | [] | no_license | javahowtos/jms | dc50f06853d6d793f5c976b2e1a70718ca51a133 | e2577e265f7abc8a9753b060787cff1b742fce7d | refs/heads/master | 2022-12-14T00:01:24.290891 | 2020-09-22T07:02:09 | 2020-09-22T07:02:09 | 297,562,795 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 225 | java | package com.javahowtos.activemqdemo;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class RabbitMqDemoApplicationTests {
@Test
void contextLoads() {
}
}
| [
"[email protected]"
] | |
f234b7237e2fb9d23bae2f8a9214752147414696 | d7254f2223dc1f450dfe3b8e94713d0c3490f8e6 | /src/java/com/pineone/code/study/networkutil/protocalserviceaccess/IProtocalServiceAccess.java | 05f7dc78aa5ecc59ea0558b14c2010459a7a63ae | [] | no_license | pahnjy/stringreplace | 4f18860d05e8c2beafe7c13a87970f7405192c39 | c69e522c431eab65b4a23f8aa327637594c7063a | refs/heads/master | 2021-01-10T05:19:50.216229 | 2015-12-20T10:02:08 | 2015-12-20T10:02:08 | 47,615,147 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 225 | java | package com.pineone.code.study.networkutil.protocalserviceaccess;
/**
* Created by pahnj on 2015-12-20.
*/
public interface IProtocalServiceAccess {
String getHtmlData(String url);
String getBinary(String url);
}
| [
"[email protected]"
] | |
436d9bfdff6263aabba14831f0bc53fe290324de | b8006901f62156821674557dd4861d44fcfef16d | /rocketmq-common/src/main/java/com/alibaba/rocketmq/common/protocol/header/GetConsumeStatsRequestHeader.java | 493fad9a3bb5ee9cd293ee839c432ca5555f305d | [
"Apache-2.0"
] | permissive | dingjun84/mq-backup | a9b3ae1210e138684ffe6614e3ec29d5b77bd278 | c242c5a7778aa6fae2cf64d86330f9e677bb53dc | refs/heads/master | 2021-01-19T22:13:41.005722 | 2014-12-13T08:37:20 | 2014-12-13T08:37:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,432 | java | /**
* Copyright (C) 2010-2013 Alibaba Group Holding Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.alibaba.rocketmq.common.protocol.header;
import com.alibaba.rocketmq.remoting.CommandCustomHeader;
import com.alibaba.rocketmq.remoting.annotation.CFNotNull;
import com.alibaba.rocketmq.remoting.exception.RemotingCommandException;
/**
* @author shijia.wxr<[email protected]>
* @since 2013-8-11
*/
public class GetConsumeStatsRequestHeader implements CommandCustomHeader {
@CFNotNull
private String consumerGroup;
@Override
public void checkFields() throws RemotingCommandException {
// TODO Auto-generated method stub
}
public String getConsumerGroup() {
return consumerGroup;
}
public void setConsumerGroup(String consumerGroup) {
this.consumerGroup = consumerGroup;
}
}
| [
"[email protected]"
] | |
6acf21ab3ff4826911bc93e08683845732f3ec67 | 758f64bbaafe24e4f74dc0313e14ae91aac4c7d4 | /farmPAM/src/dao/TransferFarmInfo.java | 9b5f8206ba6a76041e02cc5872233e6ea1bd2d19 | [] | no_license | leeeunkyu/FarmPAM | 2888d4e50efe7794643ea9e1c9f0323f5d49c356 | e16475b114543083fad1e6eec02f0d10c3ff0297 | refs/heads/master | 2021-07-06T20:35:47.851601 | 2017-09-27T09:18:17 | 2017-09-27T09:18:17 | 103,476,691 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,998 | java | package dao;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.HashMap;
import Util.UtilExcel;
public class TransferFarmInfo {
private static TransferFarmInfo instance = new TransferFarmInfo();
private FactoryUser factory = FactoryUser.getInstance();
private UtilExcel util=UtilExcel.getInstance();
public static TransferFarmInfo getInstance() {
return instance;
}
private TransferFarmInfo() { }
/**
* a열 조사 구분코드 examinCd api
* b열 조사 지역명 areaName 검색
* c열 조사 품목코드 prdlstCd api
* d열 조사 품목명 prdlstName 검색
* @return 성공적으로 값을 넣을경우 true 그렇지않을경우 false
*/
public boolean addFarmInfo() {
Connection conn =null;
PreparedStatement pstmt = null;
ResultSet rs = null;
HashMap<String, String> farmlist = new HashMap<>();
farmlist=util.loadFarmInfo();
String sql ="INSERT INTO farmlist VALUES (?,?,?,?,?)";
try {
conn = factory.getConnection();
pstmt = conn.prepareStatement(sql);
/*
* key 리스트
* 조사 구분코드 examinCd+[index]
* 조사 지역명 areaName+[index]
* 조사 품목코드 prdlstCd+[index]
* 조사 품목명 prdlstName+[index]
*/
for (int i = 0; i < farmlist.size()/4; i++) {
pstmt.setInt(1,i);
pstmt.setString(2, farmlist.get("examinCd["+i+"]"));
pstmt.setString(3, farmlist.get("areaName["+i+"]"));
pstmt.setString(4, farmlist.get("prdlstCd["+i+"]"));
pstmt.setString(5, farmlist.get("prdlstName["+i+"]"));
pstmt.executeUpdate();
}
System.out.println(farmlist.size());
return true;
} catch (SQLException e) {
e.printStackTrace();
} finally {
factory.close(conn,pstmt,rs);
}
return false;
}
public static void main(String[] args) {
System.out.println(TransferFarmInfo.getInstance().addFarmInfo());
}
}
| [
"[email protected]"
] | |
080c4d331484a94643c5e49353448e50274ad848 | 531de382dcbd345b657e58417e2c798de6bacca5 | /Parque_de_Atracciones_La_Curva_I/src/uned/daoo/practica/capapresentacion/DatosAltaCliente.java | de2e08214590934eea5c9845c385645ee4a2ca52 | [] | no_license | HenryRisco/Parque_de_Atracciones_La_Curva_I | d2c8df05df5e124d527deb9ff98c09b12118b106 | ce20d79114a041c9613ebb78b51e06ef1dd90807 | refs/heads/master | 2022-11-14T04:59:57.921985 | 2020-06-25T19:46:51 | 2020-06-25T19:46:51 | 274,998,160 | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 9,757 | java | package uned.daoo.practica.capapresentacion;
import javax.swing.JOptionPane;
import javax.swing.JTextField;
import uned.daoo.practica.arraylist.ArrayListCliente;
import uned.daoo.practica.modelo.Cliente;
public class DatosAltaCliente {
//public static JTextField text_fecha_de_alta;
public static JTextField text_nombre;
public static JTextField text_apellidos;
public static JTextField text_DNI;
public static JTextField text_domicilio;
public static JTextField text_numero_de_movil;
public static String dniActual;
public static Cliente clienteActual=null;
public int enteroActual;
public ArrayListCliente BD_clientes;
public Cliente cliente;
public DatosAltaCliente(ArrayListCliente BDclientes)
{
BD_clientes = BDclientes;
}
//String fecha_de_altaIU;
String nombreIU = "";
String apellidosIU = "";
String dniIU = "";
String domicilioIU = "";
String numeroMovilIU = "";
String activoIU = "";
/**
* Añade un Cliente a la colección
* @param cliente que hay que añadir
*/
public void altaCliente() {
//fecha_de_altaIU = (String)AltaCliente.text_activo.getItemAt(AltaCliente.text_activo.getSelectedIndex());
nombreIU = AltaCliente.text_nombre.getText();
apellidosIU = AltaCliente.text_apellidos.getText();
dniIU = AltaCliente.text_DNI.getText();
domicilioIU = AltaCliente.text_domicilio.getText();
numeroMovilIU = AltaCliente.text_movil.getText();
activoIU = (String)AltaCliente.text_activo.getItemAt(AltaCliente.text_activo.getSelectedIndex());
/*System.out.println("El usuario está:" + activoIU);
perfilIU = (String)AltaCliente.text_perfil.getItemAt(AltaCliente.text_perfil.getSelectedIndex());*/
boolean activoBoolean = false;
if(activoIU.compareTo("SI") == 0) {
activoBoolean = true;
}
for(int i=0; i < BD_clientes.clientes.size(); i++) {
System.out.println("Me llega aqui");
if(dniIU.compareToIgnoreCase(BD_clientes.clientes.get(i).getDni()) == 0) {
JOptionPane.showMessageDialog(null, "El usuario ya existe");
//encontrado = true;
return;
}
}
JOptionPane.showMessageDialog(null, "Los datos del usuario han sido guardados");
AltaCliente.text_DNI.setText("");
AltaCliente.text_nombre.setText("");
AltaCliente.text_apellidos.setText("");
AltaCliente.text_DNI.setText("");
AltaCliente.text_domicilio.setText("");
AltaCliente.text_movil.setText("");
AltaCliente.text_activo.getSelectedItem().toString();
}
/**
* Añade un empleado a la colección
* @param Empleado que hay que añadir
*/
/*public void darBajaCliente() {
//boolean encontrado = false;
String p = AltaCliente.text_DNI.getText();
Cliente clienteNuevo = null;
for(Cliente emp: BD_clientes.clientes) {
if(emp.getDni().equals(p)) {
clienteNuevo = emp;
}
}
if(clienteNuevo != null) {
BD_clientes.clientes.get(0).setActivo(false);
JOptionPane.showMessageDialog(null, "El usuario se ha dado de baja satisfactoriamente");
AltaCliente.text_nombre.setText("");
AltaCliente.text_apellidos.setText("");
AltaCliente.text_DNI.setText("");
AltaCliente.text_domicilio.setText("");
AltaCliente.text_movil.setText("");
AltaCliente.text_activo.getSelectedItem().toString();
AltaCliente.text_activo.getSelectedItem().toString();
}
}*/
public Cliente buscarClientePorDni(String dni) {
//Buscamos el empleado del formulario en el ArrayList
for(int i=0; i < BD_clientes.clientes.size(); i++) {
//System.out.println("Hemos legado hasta aqui 2");
if(dniActual.compareTo(dni) == 0) {
//hemos encontrado el empleado y lo asignamos a una variable de tipo Empleado
//que representa el empleado que consta en el formulario
clienteActual = BD_clientes.clientes.get(i);
}
}
return clienteActual;
}
public void buscarCliente() {
dniIU = AltaUsuario.text_DNI.getText();
System.out.println("Hemos legado hasta aqui 1");
System.out.println("El dni del formulario es " + dniIU);
System.out.println("Los empleados de la base de datos son: ");
for(int i=0; i < BD_clientes.clientes.size(); i++) {
System.out.println(BD_clientes.clientes.get(i).getNombre()+" "+ BD_clientes.clientes.get(i).getApellidos()+ " El DNI es: "+ BD_clientes.clientes.get(i).getDni() );
}
for(int i=0; i < BD_clientes.clientes.size(); i++) {
// System.out.println("Hemos legado hasta aqui 2");
if(dniIU.compareToIgnoreCase(BD_clientes.clientes.get(i).getDni()) == 0) {
//AltaUsuario.text_rol.setText(BD_empleados.empleados.get(i).toString());
AltaUsuario.text_nombre.setText(BD_clientes.clientes.get(i).getNombre());
AltaUsuario.text_apellidos.setText(BD_clientes.clientes.get(i).getApellidos());
AltaUsuario.text_DNI.setText(BD_clientes.clientes.get(i).getDni());
//Actualizamos el valor del dni actual
dniActual = BD_clientes.clientes.get(i).getDni();
clienteActual = BD_clientes.clientes.get(i);
System.out.println("El puntero en buscarUsuario es:"+ clienteActual);
//AltaUsuario.text_password.setText(BD_clientes.clientes.get(i).getContrasenya());
//AltaUsuario.text_nombre.setText(BD_clientes.clientes.get(i).getNombre());
//AltaUsuario.text_apellidos.setText(BD_clientes.clientes.get(i).getApellidos());
AltaUsuario.text_domicilio.setText(BD_clientes.clientes.get(i).getDomicilio());
AltaUsuario.text_movil.setText(BD_clientes.clientes.get(i).getNumero_de_movil());
AltaUsuario.text_activo.setSelectedItem((boolean)BD_clientes.clientes.get(i).getActivo());
System.out.println("El usuario está:" + BD_clientes.clientes.get(i).getActivo());
//AltaUsuario.text_perfil.setSelectedItem((String)BD_clientes.clientes.get(i).getPerfil());
//System.out.println("El perfil del usuario es:" + BD_empleados.empleados.get(i).getPerfil());
// AltaUsuario.text_activo.setText(BD_empleados.empleados.get(i).toString());
// AltaUsuario.text_perfil.setText(BD_empleados.empleados.get(i).getPerfil());
System.out.println("Hemos legado hasta aqui 3");
return;
/*AltaUsuario.text_apellidos.getText();
AltaUsuario.text_DNIAltaUsuario.getText();
AltaUsuario.text_password.getPassword();
AltaUsuario.text_domicilio.getText();
AltaUsuario.text_movil.getText();
AltaUsuario.text_activo.getText();
AltaUsuario.text_perfil.getText();*/
}
}
JOptionPane.showMessageDialog(null, "Usuario no encontrado");
}
public void modificarCliente() {
//rolIU = Integer.parseInt(AltaCliente.text_rol.getText());
nombreIU = AltaCliente.text_nombre.getText();
apellidosIU = AltaCliente.text_apellidos.getText();
dniIU = AltaCliente.text_DNI.getText();
domicilioIU = AltaCliente.text_domicilio.getText();
numeroMovilIU = AltaCliente.text_movil.getText();
activoIU = (String)AltaCliente.text_activo.getItemAt(AltaCliente.text_activo.getSelectedIndex());
System.out.println("El usuario está:" + activoIU);
System.out.println("Hemos legado a modificar()");
System.out.println("El dni del formulario es " + dniIU);
System.out.println("Los empleados de la base de datos son: ");
for(int i=0; i < BD_clientes.clientes.size(); i++) {
System.out.println(BD_clientes.clientes.get(i).getNombre()+" "+BD_clientes.clientes.get(i).getApellidos()+ " El DNI es: "+ BD_clientes.clientes.get(i).getDni() );
}
System.out.println("El dni actual antes del if es " + dniActual);
System.out.println("El dni actual antes del if es " + dniActual);
//COMPROBAMOS SI EL DNI DEL FORMULARIO SE HA MODIFICADO
if(dniActual.compareToIgnoreCase(AltaCliente.text_DNI.getText())!= 0) {
//Se ha modificado el DNI
//BUSCAMOS SI EL DNI EXISTE
for(int i=0; i < BD_clientes.clientes.size(); i++) {
// System.out.println("Hemos legado hasta aqui 2");
if(dniIU.compareTo(BD_clientes.clientes.get(i).getDni()) == 0) {
//Hemos encontrado el dni y por tanto no se puede modificar
JOptionPane.showMessageDialog(null, "El DNI ya existe");
//Restablecemos el valor antiguo del DNI en el formulario
AltaCliente.text_DNI.setText(dniActual);
return;
}
}
// he d'actualizar empleado
System.out.println("El puntero es:"+ clienteActual);
System.out.println("El valor del campo dni en el formulario es:"+ AltaCliente.text_DNI.getText());
clienteActual.setDni(AltaCliente.text_DNI.getText());
System.out.println("El valor nuevo dl dni es :"+ clienteActual.getDni());
dniActual=AltaCliente.text_DNI.getText();
clienteActual.setNombre(nombreIU);
clienteActual.setApellidos(apellidosIU);
clienteActual.setDomicilio(domicilioIU);
clienteActual.setNumero_de_movil(numeroMovilIU);
//empleadoActual.setRol(rolIU);
}
else {
//Grabamos los nuevos datos en el empleado del arrayList
//empleadoActual.setDni(dniIU);
clienteActual.setNombre(nombreIU);
clienteActual.setApellidos(apellidosIU);
clienteActual.setDomicilio(domicilioIU);
clienteActual.setNumero_de_movil(numeroMovilIU);
//clienteActual.setActivo(activoIU);
//empleadoActual.setRol(rolIU);
//empleadoActual
}
JOptionPane.showMessageDialog(null, "Los datos del usuario han sido guardados");
AltaCliente.text_DNI.setText("");
AltaCliente.text_nombre.setText("");
AltaCliente.text_apellidos.setText("");
AltaCliente.text_DNI.setText("");
AltaCliente.text_domicilio.setText("");
AltaCliente.text_movil.setText("");
AltaCliente.text_activo.getSelectedItem().toString();
}
}
| [
"[email protected]"
] | |
7d7f683ef06e159e237b39d1f6ac5fde2111f9c1 | f9c6725fb4c45bc69b9af4527f9dde97ca4f9a7a | /src/main/java/br/com/voitto/app/voitto_app/loginFacebook.java | 2a573f216f385dc63b8d00c0f7c3be9a6e41cbfe | [] | no_license | yanagassi/VideoApp | 1ce1a06959bad43c2a61c6412198cc0662081fa4 | b593a449cb8534c60c20182bbeb51e212d3d61de | refs/heads/master | 2020-05-03T03:59:58.527494 | 2019-04-04T17:32:39 | 2019-04-04T17:32:39 | 178,411,107 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,194 | java | package br.com.video_app.app.video_app;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.widget.Toast;
import com.facebook.CallbackManager;
import com.facebook.FacebookCallback;
import com.facebook.FacebookException;
import com.facebook.login.LoginResult;
import com.facebook.login.widget.LoginButton;
import java.lang.reflect.Array;
public class loginFacebook extends AppCompatActivity{
private LoginButton loginButon;
private CallbackManager callbackManager;
//@Override
protected void onCreate() {
//super.onCreate(savedInstanceState);
//callbackManager = CallbackManager.Factory.create();
//loginButon = (LoginButton) findViewById(R.id.facebookButton);
// loginButon.registerCallback(callbackManager, new FacebookCallback<LoginResult>() {
}
protected void onActivityResult(int requestCode, int resultCode, Intent data)
{
// super.onActivityResult(requestCode, resultCode, data);
//callbackManager.onActivityResult(requestCode,resultCode,data);
}
}
| [
"[email protected]"
] | |
3a26ab800cdcfaa2dd4a173ed8a3581d5408bbe8 | 319341972f394e7660b986fddb33fc7e2efbae29 | /src/main/java/com/hacker/earth/programming/StatisticsAggregator.java | fffeaf39d11a82ffb1b2e18cd272dad541a0b6c7 | [] | no_license | puneet098/puneet098-practice-2019 | a04b1bdc090b4009e3e626175d4b0f804a4c681e | 0da76ea00632c23aae0cf8ed5a6a448100c222f7 | refs/heads/master | 2021-05-18T11:20:28.336833 | 2020-04-04T19:12:45 | 2020-04-04T19:12:45 | 251,224,411 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 370 | java | package com.hacker.earth.programming;
public interface StatisticsAggregator {
// This is an input. Make note of this price.
public void putNewPrice(String symbol, double price);
// Get the average price
public double getAveragePrice(String symbol);
// Get the total number of prices recorded
public int getTickCount(String symbol);
}
| [
"user@DESKTOP-U61F5HF"
] | user@DESKTOP-U61F5HF |
5b05023ed52743724206bfd15e1cb41824aedc7c | 26decd1946f8dc31f24de64643ae6906e2d67fe6 | /src/main/java/com/pledgeapps/buyingtime/AlarmActivity.java | 42a80344743279bb4334b8b54ca7b01bb4f14488 | [
"MIT"
] | permissive | PledgeApps/buyingtime-android | dcde5d5c7058fff39efccde3789a2299d16e3e31 | 8f9a561f45148d048d52bddb13faff3b1007d477 | refs/heads/master | 2016-09-03T06:43:08.089681 | 2013-11-07T18:10:47 | 2013-11-07T18:10:47 | 13,804,289 | 1 | 6 | null | 2013-11-01T16:54:05 | 2013-10-23T14:02:21 | Java | UTF-8 | Java | false | false | 5,608 | java | package com.pledgeapps.buyingtime;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.v4.app.DialogFragment;
import android.support.v7.app.ActionBarActivity;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.RadioGroup;
import android.widget.Spinner;
import android.widget.TimePicker;
import android.widget.ToggleButton;
import com.pledgeapps.buyingtime.data.Alarm;
import com.pledgeapps.buyingtime.data.Alarms;
import java.util.ArrayList;
import java.util.List;
public class AlarmActivity extends ActionBarActivity {
EditText graceMinutesText;
EditText centsPerMinuteText;
EditText snoozeDurationText;
Button alarmTimeButton;
Button daysButton;
Button saveButton;
Button deleteButton;
ToggleButton activeToggle;
ToggleButton dismissPuzzle;
String[] daysOfTheWeek = new String[]{"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
int[] selectedDays = new int[0];
int selectedHour = 0;
int selectedMinute = 0;
int alarmIndex = 0;
Alarm alarm;
Handler timeHandler = new Handler() {
public void handleMessage(Message m) {
Bundle b = m.getData();
selectedHour = b.getInt("hour");
selectedMinute = b.getInt("minute");
alarmTimeButton.setText(Alarm.getDisplayTime(selectedHour,selectedMinute));
}
};
Handler daysHandler = new Handler() {
public void handleMessage(Message m) {
Bundle b = m.getData();
ArrayList<Integer> days = (ArrayList<Integer>) b.get("selectedIndexes");
selectedDays = new int[days.size()];
for (int i=0;i<days.size();i++) selectedDays[i] = days.get(i);
daysButton.setText(Alarm.getDisplayDays(selectedDays));
}
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_alarm);
Bundle extras = getIntent().getExtras();
if (extras != null) alarmIndex = extras.getInt("ALARM_INDEX");
if (alarmIndex==-1) alarm = Alarm.createNewAlarm(); else alarm = Alarms.getCurrent().get(alarmIndex);
activeToggle = (ToggleButton) findViewById(R.id.activeToggle);
dismissPuzzle = (ToggleButton) findViewById(R.id.dismissPuzzle);
graceMinutesText = (EditText) findViewById(R.id.graceMinutesText);
centsPerMinuteText = (EditText) findViewById(R.id.centsPerMinuteText);
snoozeDurationText = (EditText) findViewById(R.id.snoozeDurationText);
alarmTimeButton = (Button) findViewById(R.id.alarmTimeButton);
daysButton = (Button) findViewById(R.id.daysButton);
saveButton = (Button) findViewById(R.id.saveButton);
deleteButton = (Button) findViewById(R.id.deleteButton);
alarmTimeButton.setOnClickListener(new View.OnClickListener() {public void onClick(View view) {setTime();}});
daysButton.setOnClickListener(new View.OnClickListener() {public void onClick(View view) {setDays();}});
saveButton.setOnClickListener(new View.OnClickListener() {public void onClick(View view) {save();}});
deleteButton.setOnClickListener(new View.OnClickListener() {public void onClick(View view) {delete();}});
populateFields();
//alarmList = (ListView) findViewById(R.id.alarmList);
}
private void populateFields()
{
this.selectedHour = alarm.hour;
this.selectedMinute = alarm.minute;
this.selectedDays = alarm.daysOfWeek;
activeToggle.setChecked(alarm.active);
dismissPuzzle.setChecked(alarm.requirePuzzle);
centsPerMinuteText.setText(Integer.toString(alarm.centsPerMinute));
graceMinutesText.setText(Integer.toString(alarm.graceMinutes));
snoozeDurationText.setText(Integer.toString(alarm.snoozeDuration));
alarmTimeButton.setText(alarm.getDisplayTime());
daysButton.setText(alarm.getDisplayDays());
}
private void setTime()
{
DialogFragment timeFragment = TimePickerFragment.newInstance(timeHandler, selectedHour, selectedMinute);
timeFragment.show(this.getSupportFragmentManager(), "timePicker");
}
private void setDays()
{
ArrayList<Integer> selectedIndexes = new ArrayList<Integer>();
for (int day : selectedDays) selectedIndexes.add(day);
DialogFragment daysFragment = DaysOfWeekFragment.newInstance(daysHandler, selectedIndexes);
daysFragment.show(this.getSupportFragmentManager(), "dayPicker");
}
private void delete()
{
if (alarmIndex>-1) Alarms.getCurrent().remove(alarmIndex);
this.finish();
}
private void save()
{
alarm.minute = selectedMinute;
alarm.hour = selectedHour;
alarm.graceMinutes = Integer.parseInt(graceMinutesText.getText().toString());
alarm.centsPerMinute = Integer.parseInt(centsPerMinuteText.getText().toString());
alarm.snoozeDuration = Integer.parseInt(snoozeDurationText.getText().toString());
alarm.active = activeToggle.isChecked();
alarm.requirePuzzle = dismissPuzzle.isChecked();
alarm.daysOfWeek = selectedDays;
if (alarmIndex==-1) Alarms.getCurrent().add(alarm);
this.finish();
}
}
| [
"[email protected]"
] | |
acec8a98d73e869215bf560edb68d86d87674250 | 41d57f9b47c8d5113d2b834db1788c391fa1da77 | /src/CRUD/Operator.java | 994492aa92420b5a1bb23a28f66b1e4133c31b4f | [] | no_license | ilhamalamsyh/crud-bookStore-console | aa9f7561f07fe78b2d518abd2f5b120037562a0d | 07579aedb2d5f2b340a9b45193c45c659c4645cd | refs/heads/master | 2022-06-05T14:26:37.611711 | 2020-04-28T04:45:32 | 2020-04-28T04:45:32 | 259,534,153 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 13,777 | java | package CRUD;
import jdk.jshell.execution.Util;
import java.io.*;
import java.util.Arrays;
import java.util.Scanner;
import java.util.StringTokenizer;
public class Operator {
public static void updateData()throws IOException {
//Ambil database orginal
File database = new File("database.txt");
FileReader fileInput = new FileReader(database);
BufferedReader buffInput = new BufferedReader(fileInput);
//buat temporary database
File tempDB = new File("tempDB.txt");
FileWriter fileOutput = new FileWriter(tempDB);
BufferedWriter buffOutput = new BufferedWriter(fileOutput);
//show data
System.out.println("List buku");
showData();
//ambil user input yg akan di update
Scanner userInput = new Scanner(System.in);
System.out.println("Masukkan Nomot Buku yang akan di update: ");
int numBook = userInput.nextInt();
//show data yang akan diupdate
String data = buffInput.readLine();
int index = 0;
while (data != null){
index++;
StringTokenizer st = new StringTokenizer(data, ",");
//Show Index == numBook
if (numBook == index){
System.out.println("\nData yang akan anda update adalah: ");
System.out.println("--------------------------------------");
System.out.println("No Referensi : " + st.nextToken());
System.out.println("Tahun : " + st.nextToken());
System.out.println("Penulis : " + st.nextToken());
System.out.println("Penerbit : " + st.nextToken());
System.out.println("Judul : " + st.nextToken());
System.out.println("--------------------------------------");
//Update data
//Ambil input dari user
String[] fieldData = {"Tahun", "Penulis", "Penerbit", "Judul"};
String[] tempData = new String[4];
st = new StringTokenizer(data, ",");
String originalData = st.nextToken();
for (int i = 0; i < fieldData.length; i++) {
boolean isUpdate = Utility.yesOrNo("Apakah anda ingin merubah " + fieldData[i]);
originalData = st.nextToken();
if (isUpdate){
//user input
if (fieldData[i].equalsIgnoreCase("tahun")){
System.out.print("Input Tahun dengan format(YYYY): ");
tempData[i] = Utility.getYearFormat();
}else {
userInput = new Scanner(System.in);
System.out.print("\nMasukkan " + fieldData[i] + " baru: ");
tempData[i] = userInput.nextLine();
}
}else {
tempData[i] = originalData;
}
}
//Tampilkan data baru
st = new StringTokenizer(data, ",");
st.nextToken();
System.out.println("\nData yang anda perbaharui adalah: ");
System.out.println("--------------------------------------");
System.out.println("Tahun : " + st.nextToken() + " ---> " + tempData[0]);
System.out.println("Penulis : " + st.nextToken() + " ---> " + tempData[1]);
System.out.println("Penerbit : " + st.nextToken() + " ---> " + tempData[2]);
System.out.println("Judul : " + st.nextToken() + " ---> " + tempData[3]);
System.out.println("--------------------------------------");
boolean isUpudate = Utility.yesOrNo("Apakah Anda yakin ingin mengupdate data tersebut ");
if (isUpudate){
//Cek data baru di database
boolean isExist = Utility.checkBookOnDatabase(tempData, false);
if (isExist){
System.err.println("Data sudah ada di database, Update failed. \nSilahkam delete data yang bersangkutan");
}else {
//Format data baru ke database
String year = tempData[0];
String writter = tempData[1];
String publisher = tempData[2];
String titleBook = tempData[3];
//Buat primaary key
long entry_Number = Utility.getEntryPerYear(writter, year) + 1;
String writterWithoutSpace = writter.replaceAll("\\s+", ""); //cara untuk menghilangkan spasi pada nama penulis menggunakan regex(regular expression)
String primaryKey = writterWithoutSpace+"_"+year+"_"+entry_Number;
//Tulis data ke dataabse
buffOutput.write(primaryKey + ","+ year +","+ writter + "," + publisher + "," + titleBook);
}
}else {
//Copy data
buffOutput.write(data);
}
}else {
//Copy data
buffOutput.write(data);
}
buffOutput.newLine();
data = buffInput.readLine();
}
// Menulis data ke file
buffOutput.flush();
//Delete origial database
database.delete();
//Renama tempDB to Database
tempDB.renameTo(database);
}
public static void deleteData()throws IOException{
//Ambil Database original | Hanya untuk membaca data saja
File database = new File("database.txt"); //just read
FileReader fileInput = new FileReader(database);
BufferedReader buffInput = new BufferedReader(fileInput);
//Create Temporary Database
/*
Kita tidak dapat menggunakan file reader/writter atau buffer reader/writter.
Karena kita tidak akan bisa me-rename database nya
Jadi, kita gunakan file input
*/
File temporary_db = new File("tempDB.txt"); //membuat file tempDB
FileWriter fileOutput = new FileWriter(temporary_db);
BufferedWriter buffOutput = new BufferedWriter(fileOutput);
//Show Data
System.out.println("List Buku");
showData();
//Ambil user input untuk men delete data
Scanner userInput = new Scanner(System.in);
System.out.print("Masukkan Nomor buku yang akan dihapus: ");
int deleteNum = userInput.nextInt();
//Looping untuk membaca tiap data per=baris dan skip data yg akan di hapus
boolean isFound = false; //untuk handle jika tidak ada user input yg ditemukan datanya
int dataOnDb = 0;
String data = buffInput.readLine();
while (data != null){
dataOnDb++;
boolean isDelete = false;
StringTokenizer st = new StringTokenizer(data,",");
//Show data that will be deleted
if (deleteNum == dataOnDb){
System.out.println("\nData yang ingin anda hapus adalah");
System.out.println("------------------------------------");
System.out.println("No Referensi : "+ st.nextToken());
System.out.println("Tahun : "+ st.nextToken());
System.out.println("Penulis : "+ st.nextToken());
System.out.println("Penerbit : "+ st.nextToken());
System.out.println("Judul : "+ st.nextToken());
isDelete = Utility.yesOrNo("Are you sure to delete this data???");
isFound = true;
}
if (isDelete == true){
//Skip dan delete data
System.out.println("Data Berhasil Di hapus!!");
}else {
//pindahkan data yg tidak di delete dari database.txt to tempDB.txt
buffOutput.write(data);
buffOutput.newLine();
}
data = buffInput.readLine();
}
if (!isFound){
System.err.println("Buku not found");
}
//Simpan ke tempDB / menulis data ke file
buffOutput.flush();
//Delete database.txt
database.delete();
//renama tempDB -> database/txt
temporary_db.renameTo(database);
}
public static void showData()throws IOException {
FileReader fileData;
BufferedReader buffRead;
try {
fileData = new FileReader("database.txt");
buffRead = new BufferedReader(fileData);
} catch (Exception e){
System.out.println("Database tidak ditemukan");
System.out.println("Silahkan tambah data terlebih dahulu");
addBook();
return;
}
System.out.println("\n| No |\tTahun |\tPenulis |\tPenerbit |\tJudul");
System.out.println("-----------------------------------------------------------------------------------------");
String data = buffRead.readLine();
//String Tokenizer bisa membaca data secara perbaris dan perkata dengan batasannya adalah delimiter
//Scanner membaca data secara keseluruhan yang berada di file
int nomorData = 1;
while (data != null) {
StringTokenizer stringToken = new StringTokenizer(data, ",");
stringToken.nextToken();
System.out.printf("|%2d ", nomorData);
System.out.printf("|\t%5s ", stringToken.nextToken());
System.out.printf("|\t%-20s ", stringToken.nextToken());
System.out.printf("|\t%-20s ", stringToken.nextToken());
System.out.printf("|\t%s", stringToken.nextToken());
System.out.print("\n");
nomorData += 1;
data = buffRead.readLine();
}
System.out.println("-----------------------------------------------------------------------------------------");
}
public static void searchData()throws IOException{
//Membaca data yang dicari ada atau tidak?
try {
File file = new File("database2.txt");
}catch (Exception ex){
System.err.println("Database tidak ditemukan");
System.err.println("Silahkan tambah data terlebih dahulu");
addBook();
return;
}
//Ambil keyword dari user
Scanner terminalInput = new Scanner(System.in);
System.out.print("Masukkan Keyword untuk mencari buku: ");
String searchString = terminalInput.nextLine();
String[] keyword = searchString.split("\\s+");
//Cek keyword dari user apakah sesuai dengan data yang ada di database
Utility.checkBookOnDatabase(keyword, true);
}
public static void addBook()throws IOException{
FileWriter addData = new FileWriter("database.txt", true); //append ini adalah menentukan method
// untuk menambah data tersebut, jika 'false' maka akan meng-overwrite data yang sudah ada
BufferedWriter buffAddData = new BufferedWriter(addData);
//Ambil data dari Input User
Scanner userInput = new Scanner(System.in);
String writter, titleBook, publisher, year;
System.out.print("Input Nama Penulis: ");
writter = userInput.nextLine();
System.out.print("Input Judul Buku: ");
titleBook = userInput.nextLine();
System.out.print("Input Penerbit: ");
publisher = userInput.nextLine();
System.out.print("Input Tahun dengan format(YYYY): ");
year = Utility.getYearFormat(); //Memamnggil method dimana butuh pengecekan data format tahun
//Check Avalability Book In the Database
String[] keywords = {year+","+writter+","+publisher+","+titleBook};
System.out.println(Arrays.toString(keywords));
boolean isExist = Utility.checkBookOnDatabase(keywords, false);
System.out.println(isExist);
//Menulis Buku di Database
if (!isExist){
System.out.println(Utility.getEntryPerYear(writter, year));
long entry_Number = Utility.getEntryPerYear(writter, year) + 1;
//Tempalate
// fiersabesari_2012_1,2012,fiersabesari,media kita,jejak langkah
String writterWithoutSpace = writter.replaceAll("\\s+", ""); //cara untuk menghilangkan spasi pada nama penulis menggunakan regex(regular expression)
String primaryKey = writterWithoutSpace+"_"+year+"_"+entry_Number;
System.out.println("\nData yang anda masukkan adalah: ");
System.out.println("-----------------------------------");
System.out.println("Primary Key : "+ primaryKey);
System.out.println("Tahun terbit : "+ year);
System.out.println("Penulis : "+ writter);
System.out.println("Judul : "+ titleBook);
System.out.println("Penerbit : "+ publisher);
boolean isAdd = Utility.yesOrNo("Apakah Anda ingin menambahkan data tersebut?");
if (isAdd){
buffAddData.write(primaryKey + ","+ year +","+ writter + "," + publisher + "," + titleBook);
buffAddData.newLine();
buffAddData.flush();
}
}else {
System.out.println("Data buku yang anda masukkan sudah ada di Database sebagai berikut");
Utility.checkBookOnDatabase(keywords, true);
}
//Menutup Proses Input Jika sudah benar
buffAddData.close();
}
}
| [
"[email protected]"
] | |
b5849af5305c837272a96127347173247e9abbf7 | fbe92a618eaed92654bb50ec4b2926066e65dff2 | /Demo2.java | e28bde353533f7455dcc8d4abd079b4d589d1150 | [] | no_license | prilya/Praktikum-11 | 065d7e8354a14420c7fe406aa43f2f94e2d08e96 | 3ded6c91ea5f48ee262eb07016f5e24a43b01197 | refs/heads/master | 2020-04-12T02:36:14.802149 | 2018-12-18T07:27:45 | 2018-12-18T07:27:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 366 | java | package Praktikum11;
/**
*
* @author marsheila
*/
public class Demo2 {
public static void main(String[] args){
String teks="Java";
System.out.println("teks = Java");
System.out.println("equals(JAVA) = "+teks.equals("JAVA"));
System.out.println("equalsIgnoreCase(JAVA) = "+teks.equalsIgnoreCase("JAVA"));
}
}
| [
"[email protected]"
] | |
3f5d67baf63074f92079ad62f20fe966d7b6aa5a | ead23dd4a19364172574c676a0f633e4b579030c | /app/src/androidTest/java/pl/kksionek/docchecker/ExampleInstrumentedTest.java | 2e545727624e783ad6bc2cbe6411a7f6d172a6fc | [] | no_license | karlkar/docchecker | fafaef125617b4adf0ad508ab5c0903dd5cb8c4a | f839da4e3cb66fcf13b6af785c30c1cbae76f4d7 | refs/heads/master | 2021-01-23T07:15:36.454645 | 2017-02-01T10:54:36 | 2017-02-01T10:54:36 | 80,494,000 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 748 | java | package pl.kksionek.docchecker;
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("pl.kksionek.docchecker", appContext.getPackageName());
}
}
| [
"[email protected]"
] | |
f3cc0aa3f26548400f129b8b8730ff7618a11989 | 394696ecd764bbc348e30d3be0f9cac812a0dea7 | /exercicis_novembre/proves_scanner.java | 4344933b9b15f30a27f52b1fc02d3ebefe4e7160 | [] | no_license | Sebasprofe17/PRG | c64c58d04dccb43f55d5ecbaf47174c3efd5ab46 | ec806ab6134b6e3a4d366ba79cba80eacffe3376 | refs/heads/master | 2023-03-28T02:14:31.061372 | 2021-03-30T17:21:19 | 2021-03-30T17:21:19 | 309,616,936 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 389 | java | import java.util.*;
class proves_scanner{
public static void main(String[] args){
Scanner teclat = new Scanner(System.in);
int n;
String a;
System.out.println("Doname le sencer");
n = teclat.nextInt();
System.out.println("Doname el string");
a = teclat.nextLine();
System.out.println("No ha preguntat");
}
}
| [
"[email protected]"
] | |
bb19105250c82a8af6d09a83f1f3bb2dc0dd465c | 6905b70c33038830e23d1bd2bd4511bb99d6f87b | /HibernateHQL/src/main/java/com/prasad/HibernateHQL/Student.java | fbc67f4fbfe65bb2ed7ba6159247ac1a1f178076 | [] | no_license | Prasad-03/Hibernate_codes | 8b053a00c5c2a06b0098011280e8a2efdf7d2a03 | 3f93f77b5bdf162f039db3227f8132c817ec78b5 | refs/heads/main | 2023-03-14T14:58:08.540160 | 2021-03-04T17:13:22 | 2021-03-04T17:13:22 | 344,550,399 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 725 | java | package com.prasad.HibernateHQL;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name="StudData")
public class Student {
@Id
private int roll;
private String name;
private int marks;
public int getRoll() {
return roll;
}
public void setRoll(int roll) {
this.roll = roll;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getMarks() {
return marks;
}
public void setMarks(int marks) {
this.marks = marks;
}
@Override
public String toString() {
return "Student [roll=" + roll + ", name=" + name + ", marks=" + marks + "]";
}
}
| [
"[email protected]"
] | |
d57d14d5b33433732c209c7c2dabceebdc9bf1a1 | ad5cd983fa810454ccbb8d834882856d7bf6faca | /platform/bootstrap/gensrc/de/hybris/platform/promotions/model/ProductPercentageDiscountPromotionModel.java | 3cbecfa2a24b814284064cc480aae9666ffcfb9c | [] | no_license | amaljanan/my-hybris | 2ea57d1a4391c9a81c8f4fef7c8ab977b48992b8 | ef9f254682970282cf8ad6d26d75c661f95500dd | refs/heads/master | 2023-06-12T17:20:35.026159 | 2021-07-09T04:33:13 | 2021-07-09T04:33:13 | 384,177,175 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,831 | java | /*
* ----------------------------------------------------------------
* --- WARNING: THIS FILE IS GENERATED AND WILL BE OVERWRITTEN! ---
* --- Generated at 07-Jul-2021, 5:02:58 PM ---
* ----------------------------------------------------------------
*
* Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved.
*/
package de.hybris.platform.promotions.model;
import de.hybris.bootstrap.annotations.Accessor;
import de.hybris.platform.core.model.ItemModel;
import de.hybris.platform.promotions.model.ProductPromotionModel;
import de.hybris.platform.servicelayer.model.ItemModelContext;
import java.util.Locale;
/**
* Generated model class for type ProductPercentageDiscountPromotion first defined at extension promotions.
*/
@SuppressWarnings("all")
public class ProductPercentageDiscountPromotionModel extends ProductPromotionModel
{
/**<i>Generated model type code constant.</i>*/
public static final String _TYPECODE = "ProductPercentageDiscountPromotion";
/** <i>Generated constant</i> - Attribute key of <code>ProductPercentageDiscountPromotion.percentageDiscount</code> attribute defined at extension <code>promotions</code>. */
public static final String PERCENTAGEDISCOUNT = "percentageDiscount";
/** <i>Generated constant</i> - Attribute key of <code>ProductPercentageDiscountPromotion.messageFired</code> attribute defined at extension <code>promotions</code>. */
public static final String MESSAGEFIRED = "messageFired";
/**
* <i>Generated constructor</i> - Default constructor for generic creation.
*/
public ProductPercentageDiscountPromotionModel()
{
super();
}
/**
* <i>Generated constructor</i> - Default constructor for creation with existing context
* @param ctx the model context to be injected, must not be null
*/
public ProductPercentageDiscountPromotionModel(final ItemModelContext ctx)
{
super(ctx);
}
/**
* <i>Generated constructor</i> - Constructor with all mandatory attributes.
* @deprecated since 4.1.1 Please use the default constructor without parameters
* @param _code initial attribute declared by type <code>AbstractPromotion</code> at extension <code>promotions</code>
*/
@Deprecated(since = "4.1.1", forRemoval = true)
public ProductPercentageDiscountPromotionModel(final String _code)
{
super();
setCode(_code);
}
/**
* <i>Generated constructor</i> - for all mandatory and initial attributes.
* @deprecated since 4.1.1 Please use the default constructor without parameters
* @param _code initial attribute declared by type <code>AbstractPromotion</code> at extension <code>promotions</code>
* @param _owner initial attribute declared by type <code>Item</code> at extension <code>core</code>
*/
@Deprecated(since = "4.1.1", forRemoval = true)
public ProductPercentageDiscountPromotionModel(final String _code, final ItemModel _owner)
{
super();
setCode(_code);
setOwner(_owner);
}
/**
* <i>Generated method</i> - Getter of the <code>ProductPercentageDiscountPromotion.messageFired</code> attribute defined at extension <code>promotions</code>.
* @return the messageFired - The message to show when the promotion has fired.
*/
@Accessor(qualifier = "messageFired", type = Accessor.Type.GETTER)
public String getMessageFired()
{
return getMessageFired(null);
}
/**
* <i>Generated method</i> - Getter of the <code>ProductPercentageDiscountPromotion.messageFired</code> attribute defined at extension <code>promotions</code>.
* @param loc the value localization key
* @return the messageFired - The message to show when the promotion has fired.
* @throws IllegalArgumentException if localization key cannot be mapped to data language
*/
@Accessor(qualifier = "messageFired", type = Accessor.Type.GETTER)
public String getMessageFired(final Locale loc)
{
return getPersistenceContext().getLocalizedValue(MESSAGEFIRED, loc);
}
/**
* <i>Generated method</i> - Getter of the <code>ProductPercentageDiscountPromotion.percentageDiscount</code> attribute defined at extension <code>promotions</code>.
* @return the percentageDiscount - Percentage discount.
*/
@Accessor(qualifier = "percentageDiscount", type = Accessor.Type.GETTER)
public Double getPercentageDiscount()
{
return getPersistenceContext().getPropertyValue(PERCENTAGEDISCOUNT);
}
/**
* <i>Generated method</i> - Setter of <code>ProductPercentageDiscountPromotion.messageFired</code> attribute defined at extension <code>promotions</code>.
*
* @param value the messageFired - The message to show when the promotion has fired.
*/
@Accessor(qualifier = "messageFired", type = Accessor.Type.SETTER)
public void setMessageFired(final String value)
{
setMessageFired(value,null);
}
/**
* <i>Generated method</i> - Setter of <code>ProductPercentageDiscountPromotion.messageFired</code> attribute defined at extension <code>promotions</code>.
*
* @param value the messageFired - The message to show when the promotion has fired.
* @param loc the value localization key
* @throws IllegalArgumentException if localization key cannot be mapped to data language
*/
@Accessor(qualifier = "messageFired", type = Accessor.Type.SETTER)
public void setMessageFired(final String value, final Locale loc)
{
getPersistenceContext().setLocalizedValue(MESSAGEFIRED, loc, value);
}
/**
* <i>Generated method</i> - Setter of <code>ProductPercentageDiscountPromotion.percentageDiscount</code> attribute defined at extension <code>promotions</code>.
*
* @param value the percentageDiscount - Percentage discount.
*/
@Accessor(qualifier = "percentageDiscount", type = Accessor.Type.SETTER)
public void setPercentageDiscount(final Double value)
{
getPersistenceContext().setPropertyValue(PERCENTAGEDISCOUNT, value);
}
}
| [
"[email protected]"
] | |
3bd56d4aaeba1bf1d5bc401b98f74ff3a27c0796 | a4a2b5d95e0d180990d0c63d23937fdfbebb4813 | /src/java/service/EmployeeRegistService.java | ab8ab00db5d1ba6d7ea524bf5d79004ab236e697 | [] | no_license | ColinOOOOOh/hrSystem | 4e84d43cfc08fe0a8b3eca833d8a49279151989d | 3669d71353a4cb94777a8627a1a74ec46fbd6ec0 | refs/heads/master | 2021-01-10T18:19:13.357074 | 2016-01-05T07:52:43 | 2016-01-05T07:52:43 | 48,630,408 | 2 | 2 | null | 2015-12-30T06:44:31 | 2015-12-27T02:43:40 | Java | UTF-8 | Java | false | false | 376 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package service;
import vo.EmployeeRegistVo;
/**
*
* @author acer
*/
public interface EmployeeRegistService {
public void registEmployee(EmployeeRegistVo employeeRegistVo);
}
| [
"[email protected]"
] | |
448eca442a18e1f718dfdf440e1d343b4d9db021 | 83579777f2ae3e593d659b1be8a2bcffd26d68c7 | /src/main/java/service/ProductService.java | c5d59d4192f5f874a2d522d0c331e3e35f06685d | [] | no_license | EpicMachine/MagnetTest | 5eb00ee56b121a41a6de0aee1231e08519d26af3 | 5cead3f7fca15df570a7440277aebcefa52275c4 | refs/heads/master | 2023-04-19T12:16:25.063260 | 2021-05-03T13:29:08 | 2021-05-03T13:29:08 | 363,929,754 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 434 | java | package service;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.TransformerException;
import java.sql.SQLException;
public interface ProductService {
void writeXML() throws SQLException, ParserConfigurationException, TransformerException;
void writeXSLTFromXML() throws TransformerException;
void countXSLT();
void fillTable(int quantity);
void closeSessionFactory();
}
| [
"Develop2000vznf"
] | Develop2000vznf |
464ec9313b07a839e7646aace6ce84f9327dc378 | b6e99b0346572b7def0e9cdd1b03990beb99e26f | /src/gcom/atendimentopublico/ordemservico/FiscalizacaoSituacaoServicoACobrarPK.java | fa00d2a17ffff7093c383f1cd24c4f19e2967e37 | [] | no_license | prodigasistemas/gsan | ad64782c7bc991329ce5f0bf5491c810e9487d6b | bfbf7ad298c3c9646bdf5d9c791e62d7366499c1 | refs/heads/master | 2023-08-31T10:47:21.784105 | 2023-08-23T17:53:24 | 2023-08-23T17:53:24 | 14,600,520 | 19 | 20 | null | 2015-07-29T19:39:10 | 2013-11-21T21:24:16 | Java | UTF-8 | Java | false | false | 2,204 | java | package gcom.atendimentopublico.ordemservico;
import java.io.Serializable;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
/** @author Hibernate CodeGenerator */
public class FiscalizacaoSituacaoServicoACobrarPK implements Serializable {
private static final long serialVersionUID = 1L;
/** identifier field */
private Integer idFiscalizacaoSituacao;
/** identifier field */
private Integer idDebitoTipo;
public String toString() {
return new ToStringBuilder(this)
.append("fzstId", getIdFiscalizacaoSituacao())
.append("dbtpId", getIdDebitoTipo())
.toString();
}
public boolean equals(Object other) {
if ( (this == other ) ) return true;
if ( !(other instanceof FiscalizacaoSituacaoServicoACobrarPK) ) return false;
FiscalizacaoSituacaoServicoACobrarPK castOther = (FiscalizacaoSituacaoServicoACobrarPK) other;
return new EqualsBuilder()
.append(this.getIdFiscalizacaoSituacao(), castOther.getIdFiscalizacaoSituacao())
.append(this.getIdDebitoTipo(), castOther.getIdDebitoTipo())
.isEquals();
}
public int hashCode() {
return new HashCodeBuilder()
.append(getIdFiscalizacaoSituacao())
.append(getIdDebitoTipo())
.toHashCode();
}
/**
* @return Retorna o campo idDebitoTipo.
*/
public Integer getIdDebitoTipo() {
return idDebitoTipo;
}
/**
* @param idDebitoTipo O idDebitoTipo a ser setado.
*/
public void setIdDebitoTipo(Integer idDebitoTipo) {
this.idDebitoTipo = idDebitoTipo;
}
/**
* @return Retorna o campo idFiscalizacaoSituacao.
*/
public Integer getIdFiscalizacaoSituacao() {
return idFiscalizacaoSituacao;
}
/**
* @param idFiscalizacaoSituacao O idFiscalizacaoSituacao a ser setado.
*/
public void setIdFiscalizacaoSituacao(Integer idFiscalizacaoSituacao) {
this.idFiscalizacaoSituacao = idFiscalizacaoSituacao;
}
}
| [
"[email protected]"
] | |
67a9e8a782dc15d99d41149d582b4cae6d114536 | a50db4dca72250dbfc8c54cc2dd9688a1ae49f01 | /src/main/java/mis/web/rest/util/HeaderUtil.java | 1781033e5bacb10324d6690c7f487fc253cc6297 | [] | no_license | ShopySolutions/hims | a03c2001e0e60248ddef62aa79f3f95efc11e75e | f6f1cf560961418bda06e1036bc792751a62017b | refs/heads/master | 2021-09-15T01:53:48.213019 | 2018-05-23T20:25:57 | 2018-05-23T20:25:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,565 | java | package mis.web.rest.util;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpHeaders;
/**
* Utility class for HTTP headers creation.
*/
public final class HeaderUtil {
private static final Logger log = LoggerFactory.getLogger(HeaderUtil.class);
private static final String APPLICATION_NAME = "hmisApp";
private HeaderUtil() {
}
public static HttpHeaders createAlert(String message, String param) {
HttpHeaders headers = new HttpHeaders();
headers.add("X-hmisApp-alert", message);
headers.add("X-hmisApp-params", param);
return headers;
}
public static HttpHeaders createEntityCreationAlert(String entityName, String param) {
return createAlert(APPLICATION_NAME + "." + entityName + ".created", param);
}
public static HttpHeaders createEntityUpdateAlert(String entityName, String param) {
return createAlert(APPLICATION_NAME + "." + entityName + ".updated", param);
}
public static HttpHeaders createEntityDeletionAlert(String entityName, String param) {
return createAlert(APPLICATION_NAME + "." + entityName + ".deleted", param);
}
public static HttpHeaders createFailureAlert(String entityName, String errorKey, String defaultMessage) {
log.error("Entity processing failed, {}", defaultMessage);
HttpHeaders headers = new HttpHeaders();
headers.add("X-hmisApp-error", "error." + errorKey);
headers.add("X-hmisApp-params", entityName);
return headers;
}
}
| [
"[email protected]"
] | |
09bbe5e17d9448427e5ed541a2d89d3889ea2718 | b6eb0ecadbb70ed005d687268a0d40e89d4df73e | /feilong-taglib/src/main/java/com/feilong/taglib/common/IsNotContainsTag.java | 036882ef28b6fd8bbbefb99a2578a1cb5f4401f0 | [
"Apache-2.0"
] | permissive | ifeilong/feilong | b175d02849585c7b12ed0e9864f307ed1a26e89f | a0d4efeabc29503b97caf0c300afe956a5caeb9f | refs/heads/master | 2023-08-18T13:08:46.724616 | 2023-08-14T04:30:34 | 2023-08-14T04:30:34 | 252,767,655 | 97 | 28 | Apache-2.0 | 2023-04-17T17:47:44 | 2020-04-03T15:14:35 | Java | UTF-8 | Java | false | false | 1,333 | java | /*
* Copyright (C) 2008 feilong
*
* 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.feilong.taglib.common;
/**
* 判断一个集合(或者可以被转成Iterator) 是否 没有 一个值 (或者说这个value 不在 collection当中).
*
* @author <a href="https://github.com/ifeilong/feilong">feilong</a>
* @since 1.0.0
*/
@SuppressWarnings("squid:S110") //Inheritance tree of classes should not be too deep
public class IsNotContainsTag extends AbstractContainsSupport{
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 8239319419199818297L;
/*
* (non-Javadoc)
*
* @see com.feilong.taglib.common.AbstractContainsSupport#condition()
*/
@Override
public boolean condition(){
return !containsByStringValue();
}
}
| [
"[email protected]"
] | |
c92a736a21c3037c37a470ab39bff5ecc4340639 | 2ada1625b58c5d97259196d2aa2913929fb80b26 | /Biblioteca/src/model/DAO/PessoaDAO.java | befa59da409ff64b130791399bfa0a35b2b7b3bc | [] | no_license | Kellorran/Projeto-biblioteca | 031419725e1451947648c8e8c23f99b0abaca128 | 9fa71f4b882766d263bcc338e44b9a95b19dcb81 | refs/heads/master | 2021-01-11T21:36:47.449074 | 2017-01-13T04:10:58 | 2017-01-13T04:10:58 | 78,816,648 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 467 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package model.DAO;
import model.bean.Pessoa;
/**
*
* @author Kellorran
*/
public interface PessoaDAO {
public void create(Pessoa p);
public Pessoa get(String rg);
public void delete(Pessoa p);
public void update(Pessoa p, Pessoa p2);
}
| [
"[email protected]"
] | |
d4d8bf318e9df24384ea449010f606be469bec1e | a7e31218b1a29e62be405a5b34ae9f45472791c9 | /ImageTracking/Regions.java | aa6ad4e4b082ce3cf6e9e7275377e18e764ce431 | [] | no_license | LoganRichardson/Projects | c4cab77b3749f76ebf2532f3098f5d77025ad6a4 | 609e6ba8f913c714477453b9a3760f7f6292e093 | refs/heads/master | 2021-09-27T00:13:10.353375 | 2021-09-21T07:55:41 | 2021-09-21T07:55:41 | 152,376,267 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 16,243 | java | //Author: Steve Donaldson
//Date: 06/09/07
//Class Regions
//Description: Implements a connected components algorithm based on Algorithm 2.2 in Shapiro
// and Stockman) but simulates the recursion of their algorithm in order to
// avoid potential stack overflow. Assumes use of a binary image (pixel values
// 0 or 255) or a grayscale image (pixel values 0-255). For binary images, the
// background is assumed to be black, but can be labeled or not at the user's
// discretion (based on the setting for the "includeBlackPixels" parameter).
// For gray images, one can specify a gray tolerance within which to consider
// pixels part of the same region. The program labels all regions of contiguous
// values with successive integer labels beginning at 1. Output (from
// findRegions) is a labeled image (in grayscale format).This program keeps
// track of the # of pixels in each region for the first maxCount regions, but
// the only practical limit to the # of regions that can be found is heap space.
// The program also maintains a list of the coordinates of the first pixel
// found in each region and whether each region is on the border of the image
// (up to maxCount regions in both cases).
//
// In addition, provides several utility routines for region extraction and
// manipulation.
import java.awt.*;
import java.io.*;
import java.awt.event.*;
//******************************************************************************************
//******************************************************************************************
public class Regions {
public int imageType; //2=256 level gray scale;3=binary (b/w). Type 1
//(24 bit color) is not supported by this routine.
public int imageWidth; //image width in pixels
public int imageHeight; //image height in pixels
public int sourceImage[][]; //image for which regions are to be found
public int neighborhood; //4 or 8-neighborhood for determining neighbors
public boolean includeBlackPixels; //for binary images only: true=label all black
//pixels; false=do not label black pixels
//(note the assumption that black is the typical
//background color)
public int grayTolerance; //for grayscale images only: the number of
//grayvalues to include on either side of a pixel
//value when determining if a given pixel belongs
//to the region under construction
public int labelCount; //actual # of regions calculated
public int labeledImage[][]; //labeled image (after the algorithm completes)
public int maxCount; //maximum # of regions for which a count of the
//pixels in those regions will be accumulated
public int pixelsInRegion[]; //the # of pixels in each region (up to maxCount)
public int firstPixelInRegion[][]; //the row and column coords of the first pixel found
//in a new region
public int borderPixelCount[]; //the # of pixels in each region on the border of
//the image space. (Regions on the border may not
//be entirely within the image space)
public int sumOfRows[]; //sum of all row values for each region (used for
//computing region centroids)
public int sumOfColumns[]; //sum of all column values for each region
public int centroids[][]; //row and column values for centroids of each region
public double bestAxes[]; //angle in radians of the best axis for each labeled
//region with respect to the x-axis
//**************************************************************************************
//Method: Regions
//Description: Initializes the parameters needed to do connected components labeling
//Parameters: Just the variables corresponding to the object variables
//Returns: nothing
//Calls: nothing
Regions(int type, int width, int height, int image[][], int pixelNeighborhood, boolean includeBlack, int tolerance) {
imageType = type;
imageWidth = width;
imageHeight = height;
sourceImage = image;
neighborhood = pixelNeighborhood;
if (imageType == 3)
includeBlackPixels = includeBlack;
else
includeBlackPixels = true;
if (imageType==2)
grayTolerance = tolerance;
else
grayTolerance = 0;
labelCount = 0;
labeledImage = new int[imageHeight][imageWidth];
if (imageType == 3)
grayTolerance = 0;
maxCount = 50000;
pixelsInRegion = new int[maxCount+2]; //position 0 not used in these arrays
firstPixelInRegion = new int[maxCount+2][2];
borderPixelCount = new int[maxCount+2];
sumOfRows = new int[maxCount+2];
sumOfColumns = new int[maxCount+2];
centroids = new int[maxCount+2][2];
bestAxes = new double[maxCount+2];
for (int r = 0; r < imageHeight; r++) //set-up by negating pixel values
for (int c = 0; c < imageWidth; c++)
labeledImage[r][c] = -sourceImage[r][c];
}
//**************************************************************************************
//Method: Regions
//Description: Initializes the parameters needed to do connected components labeling
//Parameters: Just the variables corresponding to the object variables
//Returns: labeledImage[][] - see object variable description
//Calls: nothing
// Regions(ImageClass imageObject, int pixelNeighborhood, boolean includeBlack, int tolerance) {
// this(imageObject.imageType, imageObject.imageWidth, imageObject.imageHeight, imageObject.pixels, pixelNeighborhood, includeBlack, tolerance);
// }
//**************************************************************************************
public int[][] findRegions() {
StackInterface stack = new LinkedStack();
SearchNode currentSearchObject,nextSearchObject;
int row, column, r, c, k, unlabeledPixelValue, pixel, kStart, baseRow, baseColumn;
int nextRow, nextColumn, nextK;
int imageHeightMinus1 = imageHeight - 1;
int imageWidthMinus1 = imageWidth - 1;
if (neighborhood == 4) kStart = 0; else kStart = 1;
int searchCutoff = 0;
if ((includeBlackPixels)||(imageType==2))
searchCutoff = 1;
int label = 0;
for (row = 0; row < imageHeight; row++)
for (column = 0; column < imageWidth; column++)
if (labeledImage[row][column] < searchCutoff) { //found a new region to label
unlabeledPixelValue = labeledImage[row][column];
label++;
labeledImage[row][column] = label; //label first pixel found in region
if (label < maxCount) {
pixelsInRegion[label]++;
firstPixelInRegion[label][0] = row;
firstPixelInRegion[label][1] = column;
sumOfRows[label]+=row;
sumOfColumns[label]+=column;
if ((row == 0) || (row == imageHeightMinus1) || (column == 0) || (column == imageWidthMinus1))
borderPixelCount[label]++;
}
//simulate recursive connected components
currentSearchObject = new SearchNode(row, column, row-1, column-1, kStart);
stack.push(currentSearchObject);
while (!stack.isEmpty()) {
currentSearchObject=(SearchNode)stack.peek();
baseRow = currentSearchObject.row;
baseColumn = currentSearchObject.column;
r = currentSearchObject.r;
c = currentSearchObject.c;
k = currentSearchObject.k;
//determine the row and column of the next potential neighbor
nextColumn = c + 1;
nextRow = r;
if (nextColumn > baseColumn + 1) {
nextColumn = baseColumn - 1;
nextRow = r + 1;
}
//is the row in the allowable range for neighbors?
if (nextRow <= baseRow + 1) {
//prepare to skip diagonal pixels for 4-neighborhood
if (neighborhood == 4)
nextK = 1 - k;
else
nextK = k;
//update parent values on stack for neighborhood processing
currentSearchObject.r = nextRow;
currentSearchObject.c = nextColumn;
currentSearchObject.k = nextK;
}
else
stack.pop();
//is pixel at (r,c) legitimate for the neighborhood and in bounds?
if ((k == 1) && (r >= 0) && (r < imageHeight) && (c >= 0) && (c < imageWidth) && ((r != baseRow) || (c != baseColumn))) {
pixel = labeledImage[r][c];
//is the pixel unlabeled and within the specified tolerance?
if ((pixel < searchCutoff) && (Math.abs(unlabeledPixelValue - pixel) <= grayTolerance)) {
labeledImage[r][c] = label; //label the pixel
if (label < maxCount) {
pixelsInRegion[label]++;
sumOfRows[label]+=r;
sumOfColumns[label]+=c;
if ((r == 0) || (r == imageHeightMinus1) || (c == 0) || (c == imageWidthMinus1))
borderPixelCount[label]++;
}
//search neighbors of pixel at (r,c)
nextSearchObject = new SearchNode(r, c, r - 1, c - 1, kStart);
stack.push(nextSearchObject);
}
}
}
}
labelCount = label;
return labeledImage;
}
//**************************************************************************************
//Method: getSingleRegion
//Description: Returns (from a labeled image) an array containing a specified region
// labeled with 255 and having background set to 0. Assumes that
// findRegions() has been previously called.
//Parameters: regionID - identification of the region to be singled out
//Returns: singleRegionImage[][]- array having only pixels in the specified region
// set to non-zero values (255). Array is the same
// size as labeledImage.
//Calls: nothing
public int[][] getSingleRegion(int regionID) {
int singleRegionImage[][] = new int[imageHeight][imageWidth]; //initialized to 0
for (int r = 0; r < imageHeight; r++)
for (int c = 0; c < imageWidth; c++)
if (labeledImage[r][c] == regionID)
singleRegionImage[r][c] = 255;
return singleRegionImage;
}
//**************************************************************************************
//Method: filterRegions
//Description: Removes regions whose size is outside specified lower and upper bounds.
// Optionally removes regions lying on the boundary of the image space.
// (The logic behind use of this feature is that a region lying on the
// boundary is quite possibly only a portion of a complete region and
// might not necessarily be reliably used in an image recognition task.)
// Note: regions are NOT renumbered and labelCount is NOT adjusted.
// Consequently, routines that use region object data after this method
// has run must take into account the fact that there can be 0 values
// in pixelsInRegion[] and firstPixelInRegion[][] between the remaining
// legitimate region entries. Pixels are removed from the labeled image
// by setting them to the background color, which is assumed to be 0
// (for both binary and grayscale images). Note that this routine
// removes at most maxCount regions.
//Parameters: lowerBound - regions with fewer than this # of pixels are eliminated
// upperBound - regions with more than this # of pixels are eliminated
// omitBoundaryRegions - true=remove any region having one or more pixels
// that lie on the boundary of the image space
// borderThreshold - if omitBoundaryRegions is true, regions having a
// # of boundary pixels > this amount will be
// eliminated
//Returns: labeledImage[][]
// Also updates pixelsInRegion[], firstPixelInRegion[][], and
// borderPixelCount[].
//Calls: nothing
public int[][] filterRegions(int lowerBound, int upperBound, boolean omitBoundaryRegions, int borderThreshold) {
int label, pixelCount, r, c;
int oldLabelCount = labelCount;
if (oldLabelCount > maxCount) oldLabelCount = maxCount;
//remove pixels in regions not meeting specified size criteria
for (r = 0; r < imageHeight; r++)
for (c = 0; c < imageWidth; c++) {
label = labeledImage[r][c];
pixelCount=pixelsInRegion[label];
if ((pixelCount < lowerBound) || (pixelCount > upperBound) || (omitBoundaryRegions && (borderPixelCount[label]>borderThreshold))) {
labeledImage[r][c] = 0;
}
}
for (label = 1; label <= oldLabelCount; label++) {
pixelCount = pixelsInRegion[label];
if ((pixelCount < lowerBound) || (pixelCount > upperBound) || (omitBoundaryRegions && (borderPixelCount[label]>borderThreshold))) {
pixelsInRegion[label] = 0;
firstPixelInRegion[label][0] = 0;
firstPixelInRegion[label][1] = 0;
borderPixelCount[label] = 0;
}
}
return labeledImage;
}
//**************************************************************************************
//Method: computeRegionProperties
//Description: Computes specific properties for all regions in a labeled image and
// updates (for the region object under consideration) the relevant object
// parameters (arrays, etc.) storing those property values. Current
// properties computed and saved are centroids and best axes.
//Parameters: none
//Returns: nothing (but updates object parameters)
//Calls: nothing
public void computeRegionProperties() {
int maxLabels=labelCount;
if (labelCount>maxCount)
maxLabels=maxCount;
for (int label = 1; label <= maxLabels; label++) {
if (pixelsInRegion[label] > 0) {
centroids[label][0] = sumOfRows[label] / pixelsInRegion[label];
centroids[label][1] = sumOfColumns[label] / pixelsInRegion[label];
bestAxes[label] = findBestAxisForRegion(label);
}
}
return;
}
//**************************************************************************************
//Method: findBestAxisForRegion
//Description: Computes the best axis for a region in a binary image using the
// technique provided in Shapiro and Stockman (2001).
//Parameters: regionID - identification of the region for which the axis is calculated
//Returns: bestAxis - angle (with the horizontal) of the best axis in radians
//Calls: nothing
//Authors: Greg Brazda, Ben Dennis, Steve Donaldson
public double findBestAxisForRegion(int regionID) {
double piOverTwo = Math.PI / 2;
int area = pixelsInRegion[regionID];
int centroidRow = centroids[regionID][0];
int centroidCol = centroids[regionID][1];
double mrr = 0.0;
double mrc = 0.0;
double mcc = 0.0;
int deltaR, deltaC;
for (int row = 0; row < imageHeight; row++) {
for (int column = 0; column < imageWidth; column++) {
if (labeledImage[row][column] == regionID) {
deltaR = row - centroidRow;
deltaC = column - centroidCol;
mrr += (deltaR * deltaR);
mrc += ((deltaR) * (deltaC));
mcc += (deltaC * deltaC);
}
}
}
mrr /= area;
mrc /= area;
mcc /= area;
double bestAxis = 0;
if (mrr - mcc != 0) {
bestAxis = (2 * mrc) / (mrr - mcc);
bestAxis = Math.atan(bestAxis) / 2;
}
else
bestAxis = piOverTwo;
//At this point "bestAxis" may actually be the worst axis, so we must check to see
//if it needs to be adjusted by PI/2 radians.
if (mcc < mrr) //instead of "if(mcc>mrr)" because Shapiro uses vertical column axis
bestAxis += piOverTwo;
//if not already there, place angle in range -PI/2 to +PI/2
if (bestAxis > piOverTwo)
bestAxis -= Math.PI;
if (bestAxis < -piOverTwo)
bestAxis += Math.PI;
return bestAxis;
}
//**************************************************************************************
} //end Regions class
//******************************************************************************************
//******************************************************************************************
public class SearchNode {
public int row; //row for a pixel that has been labeled
public int column; //column for a pixel that has been labeled
public int r; //row of a pixel neighboring the pixel at (row,column)
public int c; //column of a pixel neighboring the pixel at (row,column)
public int k; //flag to control how pixels in 4 or 8 neighborhood are processed.
//Value is 0 or 1. For a 4-neighborhood, only every other pixel
//in an 8 neighborhood is considered.)
SearchNode(int row, int column, int r, int c, int k) {
this.row = row;
this.column = column;
this.r = r;
this.c = c;
this.k = k;
}
}
//******************************************************************************************
//******************************************************************************************
| [
"[email protected]"
] | |
72d1767f8b2f1ac06bd43bca41f62996766f3396 | cc16a38859a219a0688ef179babd31160ff0fcd4 | /src/palindrome_pairs/Solution.java | 0a674f2d3736e8c92dee3e416fbfa0df2a531ea4 | [] | no_license | harperjiang/LeetCode | f1ab4ee796b3de1b2f0ec03ceb443908c20e68b1 | 83edba731e0070ab175e5cb42ea4ac3c0b1a90c8 | refs/heads/master | 2023-06-12T20:19:24.988389 | 2023-06-01T13:47:22 | 2023-06-01T13:47:22 | 94,937,003 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,695 | java | package palindrome_pairs;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.TreeSet;
public class Solution {
public List<List<Integer>> palindromePairs(String[] words) {
HashMap<String, Integer> cache = new HashMap<>();
TreeSet<Integer> lengths = new TreeSet<>();
for (int i = 0; i < words.length; i++) {
cache.put(words[i], i);
lengths.add(words[i].length());
}
List<List<Integer>> result = new ArrayList<>();
for (int i = 0; i < words.length; i++) {
String word = words[i];
// Reverse
int reverseidx = cache.getOrDefault(reverse(word), -1);
if (reverseidx != -1 && reverseidx < i) {
result.add(List.of(reverseidx, i));
result.add(List.of(i, reverseidx));
}
// Find shorter ones around me
for (int sublen : lengths.headSet(word.length())) {
if (isPalindrome(word, sublen, word.length() - 1)) {
int suffixidx = cache.getOrDefault(reverse(word.substring(0, sublen)), -1);
if (suffixidx != -1) {
result.add(List.of(i, suffixidx));
}
}
if (isPalindrome(word, 0, word.length() - sublen - 1)) {
int prefixidx = cache.getOrDefault(reverse(word.substring(word.length() - sublen)), -1);
if (prefixidx != -1) {
result.add(List.of(prefixidx, i));
}
}
}
}
return result;
}
String reverse(String input) {
StringBuilder builder = new StringBuilder();
for (int j = input.length() - 1; j >= 0; j--)
builder.append(input.charAt(j));
return builder.toString();
}
boolean isPalindrome(String input, int i, int j) {
while (i < j) {
if (input.charAt(i) != input.charAt(j)) {
return false;
}
i++;
j--;
}
return true;
}
public static void main(String[] args) {
System.out.println(new Solution().palindromePairs(new String[]{"abcd", "dcba", "lls", "s", "sssll"}));
System.out.println(new Solution().palindromePairs(new String[]{"bat", "tab", "cat"}));
System.out.println(new Solution().palindromePairs(new String[]{"a", ""}));
System.out.println(new Solution().palindromePairs(new String[]{"a", "abc", "aba", ""}));
System.out.println(new Solution().palindromePairs(new String[]{"a", "b", "c", "ab", "ac", "aa"}));
}
}
| [
"[email protected]"
] | |
e7ca1e1ad986fde4d99342f6f4c9036fea4c4174 | be2c6f44236a89086b56545bc21de2c902862113 | /Shoping11/src/com/shop/ex1/goods/GoodsService.java | 65336e3e3f15e9ce4c3a1896281dfdf78d342aa7 | [] | no_license | leebs126/bookshop | 7263f9588ce019f0234be35ae8615c7266fafc8c | 6fc63dc4e6f0c03ae7b7f1e86200f4610f65994c | refs/heads/master | 2020-12-24T21:01:09.181144 | 2016-04-26T06:06:22 | 2016-04-26T06:06:22 | 57,095,526 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 636 | java | package com.shop.ex1.goods;
import java.util.ArrayList;
public class GoodsService {
GoodsDAO dao = new GoodsDAO();
public ArrayList list() throws Exception {
ArrayList list=dao.list();
return list;
}
public ArrayList list(String _searchWord) throws Exception {
ArrayList list=dao.list(_searchWord);
return list;
}
public GoodsVO goods_detail(String _goods_id) throws Exception {
GoodsVO goodsVO=new GoodsVO();
goodsVO = dao.goods_detail(_goods_id);
ArrayList imageList =dao.goods_detail_image(_goods_id);
goodsVO.setList_detail_Image(imageList);
return goodsVO;
}
}
| [
"[email protected]"
] | |
9141d331fd0a920e487160fe4aad5b3b6710f3bc | 90b1d3960d2201eed455de65493c139428fe1e0c | /aspect/src/aspect/SomeAnn.java | 67e6add0a7f8fa637fb973860f33c20c9868a644 | [
"Apache-2.0"
] | permissive | aQute-os/biz.aQute.aspectj | ee7fa3d4091325209c0f633c5e54e5794562bdc4 | 4a9ea5b3a0543951ee4dd5f1b4cbc5d8b8e73fff | refs/heads/master | 2023-03-11T16:28:38.336992 | 2021-02-25T13:52:22 | 2021-02-25T13:59:44 | 342,259,481 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 184 | java | package aspect;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.RUNTIME)
public @interface SomeAnn {
String foo();
}
| [
"[email protected]"
] | |
cd7d71464b972973b8d5fac1f4846fc07771e429 | 05369488608800e6585be8acb76a59370e8152d9 | /app/src/main/java/com/example/contacto/MainActivity.java | 4522ab15de227107af9fa0836a2cca25dd7c4f98 | [] | no_license | CarlosAndresAristizabal/Contacto | c06d28241fdc5581b40ba6c4d4d0d8f32aa0f9d7 | 89c8d026cf4ac3106ef2aa8f5f7d4cef7aea26f1 | refs/heads/master | 2023-01-06T08:36:07.573398 | 2020-11-02T16:42:53 | 2020-11-02T16:42:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,689 | java | package com.example.contacto;
import androidx.appcompat.app.AppCompatActivity;
import android.app.DatePickerDialog;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.DatePicker;
import android.widget.EditText;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Locale;
import static java.util.Calendar.DAY_OF_MONTH;
public class MainActivity extends AppCompatActivity {
//variables
private EditText etNombre, etTelefono, etFecha, etEmail,etDescrip;
//variable calendario
Calendar fecha = Calendar.getInstance();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//viculacion de variables con el diseño
etNombre = (EditText)findViewById(R.id.etnombre);
etFecha = (EditText) findViewById(R.id.etfecha);
etTelefono = (EditText)findViewById(R.id.ettelefono);
etEmail = (EditText)findViewById(R.id.etemail);
etDescrip = (EditText)findViewById(R.id.etdescripcion);
//captura de datos del activity detalles.
String dato_nom = getIntent().getStringExtra("Nombre");
String dato_fec = getIntent().getStringExtra("Fecha");
String dato_tel = getIntent().getStringExtra("Telefono");
String dato_ema = getIntent().getStringExtra("Email");
String dato_des = getIntent().getStringExtra("Descripcion");
//Mostrar datos del activity deatlles en los campos correspondientes
etNombre.setText(dato_nom);
etFecha.setText( dato_fec );
etTelefono.setText(dato_tel);
etEmail.setText(dato_ema);
etDescrip.setText(dato_des);
//Proceso del Calendario.
//al hacer click en el EditText
etFecha.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
new DatePickerDialog(MainActivity.this, dia, fecha.get(Calendar.YEAR),fecha.get(Calendar.MONTH), fecha.get(DAY_OF_MONTH)).show();
}
});
}
//recoger datos de los dias selecionados en el caledario y colocarlo en el EditText de fecha.
DatePickerDialog.OnDateSetListener dia = new DatePickerDialog.OnDateSetListener() {
@Override
public void onDateSet(DatePicker view, int year, int month, int dayOfMonth) {
fecha.set(Calendar.YEAR, year);
fecha.set(Calendar.MONTH, month);
fecha.set(Calendar.DAY_OF_MONTH, dayOfMonth);
actualizarInput(view);
}
};
//Metodo de Actualizaciíon de EditText a la fecha.
private void actualizarInput(View view){
String formatoDeFecha = "MM/dd/yy";
SimpleDateFormat formato =new SimpleDateFormat(formatoDeFecha, Locale.US);
etFecha.setText(formato.format(fecha.getTime()));
}
//Metodo boton guardar.
public void guardar(View view){
Intent envio = new Intent(this, Detalle_Contacto.class);
envio.putExtra("Nombre",etNombre.getText().toString());
envio.putExtra("Fecha",etFecha.getText().toString());
envio.putExtra("Telefono",etTelefono.getText().toString());
envio.putExtra("Email",etEmail.getText().toString());
envio.putExtra("Descripcion",etDescrip.getText().toString());
startActivity(envio);
}
//Metodo del boton añadir para actualizar los campos.
public void anadir(View view){
Intent anadir = new Intent(this, MainActivity.class);
startActivity(anadir);
}
}
| [
"[email protected]"
] | |
4c412c20fe2e4c65d38efd372afd98897bf7d02d | e454e76f0f22ad6351a1b63ce286063586409782 | /Examples/InterfaceSegregationPrinciple/src/module-info.java | 1d1f17e4d6be03d7c1ceefe5688b34654e70d79a | [] | no_license | Sourabhhsethii/SOLID | 470c0e8e6f9f9a3b8c7c53a629dc24acb565e013 | b1141c83347e0c1d1961c6e07832e5b48ea095f1 | refs/heads/master | 2022-07-05T09:49:44.162421 | 2020-05-12T04:17:55 | 2020-05-12T04:17:55 | 263,228,306 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 40 | java | module InterfaceSegregationPrinciple {
} | [
"[email protected]"
] | |
5815d81834202b38fe301523a21760e895a226ff | 8d8a51804846a6b47363492a4e93afd44b24f9dc | /src/main/java/com/mwt/audios/controller/AudiosController.java | daa73b794ed7d75826060bce27818ab37ed2ffc6 | [] | no_license | victormood/Nordic.Player.Microservices | 5396537f40abbfb61aaa138b678d954611eb364b | b9851c4aef9a27d2548e5a5223ef148b523b9e3e | refs/heads/master | 2020-03-20T10:00:32.192337 | 2018-06-20T12:36:08 | 2018-06-20T12:36:08 | 137,356,035 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,304 | java | package com.mwt.audios.controller;
import java.util.List;
import java.util.logging.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.mwt.audios.ds.AudiosRepository;
import com.mwt.audios.ds.entities.Audio;
/**
* A RESTFul controller for accessing audio information.
*
* @author v.manea
*/
@RestController
@RequestMapping(value = "/audios")
public class AudiosController {
protected Logger logger = Logger.getLogger(AudiosController.class.getName());
protected AudiosRepository audiosRepository;
@RequestMapping(value = "/list")
@PreAuthorize("hasRole('AUDIO') or hasRole('ADMIN')")
public List<Audio> findAll() {
List<Audio> audios = audiosRepository.findAll();
return audios;
}
/**
* Create an instance plugging in the repository of Audios.
*
* @param audiosRepository
* An audio repository implementation.
*/
@Autowired
public AudiosController(AudiosRepository audiosRepository) {
this.audiosRepository = audiosRepository;
logger.info("AudiosRepository says system has " + audiosRepository.countAudios() + " audios");
}
}
| [
"[email protected]"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.